var LCt=Object.defineProperty;var M2e=e=>{throw TypeError(e)};var FCt=(e,t,n)=>t in e?LCt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ze=(e,t,n)=>FCt(e,typeof t!="symbol"?t+"":t,n),pQ=(e,t,n)=>t.has(e)||M2e("Cannot "+n);var kt=(e,t,n)=>(pQ(e,t,"read from private field"),n?n.call(e):t.get(e)),wo=(e,t,n)=>t.has(e)?M2e("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Dr=(e,t,n,r)=>(pQ(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ki=(e,t,n)=>(pQ(e,t,"access private method"),n);var A8=(e,t,n,r)=>({set _(o){Dr(e,t,o,n)},get _(){return kt(e,t,r)}});function zCt(e,t){for(var n=0;nr[o]})}}}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 o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Pu={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},jv=console,Pj={};Object.keys(Pu).forEach(function(e){Pj[e]=jv[e]});var D4="Datadog Browser SDK:",Pa={debug:Pj.debug.bind(jv,D4),log:Pj.log.bind(jv,D4),info:Pj.info.bind(jv,D4),warn:Pj.warn.bind(jv,D4),error:Pj.error.bind(jv,D4)},xG="https://docs.datadoghq.com",wWe="".concat(xG,"/real_user_monitoring/browser/troubleshooting"),yG="More details:";function SWe(e,t){return function(){for(var n=[],r=0;r=0&&e<=100}function WD(e){return typeof e=="number"}var Op=1e3,ym=60*Op,CWe=60*ym,HCt=24*CWe,NWe=365*HCt;function vG(e){return{relative:e,timeStamp:UCt(e)}}function VCt(e){return{relative:bG(e),timeStamp:e}}function UCt(e){var t=_0()-performance.now();return t>GD()?Math.round(ZT(t,e)):GCt(e)}function WCt(){return Math.round(_0()-ZT(GD(),performance.now()))}function aa(e){return WD(e)?yH(e*1e6,0):e}function _0(){return new Date().getTime()}function fu(){return _0()}function P0(){return performance.now()}function Tp(){return{relative:P0(),timeStamp:fu()}}function jWe(){return{relative:0,timeStamp:GD()}}function Wf(e,t){return t-e}function ZT(e,t){return e+t}function bG(e){return e-GD()}function GCt(e){return Math.round(ZT(GD(),e))}function qCt(e){return e=0;n-=1){var r=e[n];if(t(r,n,e))return r}}function QCt(e,t){Array.prototype.forEach.call(e,t)}function vH(e){return Object.keys(e).map(function(t){return e[t]})}function Vhe(e){return Object.keys(e).map(function(t){return[t,e[t]]})}function qD(e,t){return e.slice(0,t.length)===t}function JCt(e,t){return e.slice(-t.length)===t}function Wo(e){for(var t=[],n=1;n>parseInt(e,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,$p)}var SH=/([\w-]+)\s*=\s*([^;]+)/g;function c3(e,t){for(SH.lastIndex=0;;){var n=SH.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function oNt(e){var t=new Map;for(SH.lastIndex=0;;){var n=SH.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function PWe(e,t,n){n===void 0&&(n="");var r=e.charCodeAt(t-1),o=r>=55296&&r<=56319,i=o?t+1:t;return e.length<=i?e:"".concat(e.slice(0,i)).concat(n)}function iNt(){return Uhe()===0}function aNt(){return Uhe()===1}function sNt(){return Uhe()===2}var T8;function Uhe(){return T8??(T8=lNt())}function lNt(e){var t;e===void 0&&(e=window);var n=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(n)?1:((t=e.navigator.vendor)===null||t===void 0?void 0:t.indexOf("Apple"))===0||/safari/i.test(n)&&!/chrome|android/i.test(n)?2:e.document.documentMode?0:3}var A0;(function(e){e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.REMOTE_CONFIGURATION="remote_configuration",e.LONG_ANIMATION_FRAME="long_animation_frame",e.ANONYMOUS_USER_TRACKING="anonymous_user_tracking",e.ACTION_NAME_MASKING="action_name_masking",e.CONSISTENT_TRACE_SAMPLING="consistent_trace_sampling",e.DELAY_VIEWPORT_COLLECTION="delay_viewport_collection"})(A0||(A0={}));var Whe=new Set;function AWe(e){Array.isArray(e)&&cNt(e.filter(function(t){return bH(A0,t)}))}function cNt(e){e.forEach(function(t){Whe.add(t)})}function aw(e){return Whe.has(e)}function uNt(){return Whe}function KD(e,t,n,r){n===void 0&&(n=0);var o=new Date;o.setTime(o.getTime()+n);var i="expires=".concat(o.toUTCString()),s=r&&r.crossSite?"none":"strict",l=r&&r.domain?";domain=".concat(r.domain):"",c=r&&r.secure?";secure":"",u=r&&r.partitioned?";partitioned":"";document.cookie="".concat(e,"=").concat(t,";").concat(i,";path=/;samesite=").concat(s).concat(l).concat(c).concat(u)}function Ghe(e){return c3(document.cookie,e)}var mQ;function P2(e){return mQ||(mQ=oNt(document.cookie)),mQ.get(e)}function TWe(e,t){KD(e,"",0,t)}function dNt(e){if(document.cookie===void 0||document.cookie===null)return!1;try{var t="dd_cookie_test_".concat($p()),n="test";KD(t,n,ym,e);var r=Ghe(t)===n;return TWe(t,e),r}catch(o){return Pa.error(o),!1}}var gQ;function fNt(){if(gQ===void 0){for(var e="dd_site_test_".concat($p()),t="test",n=window.location.hostname.split("."),r=n.pop();n.length&&!Ghe(e);)r="".concat(n.pop(),".").concat(r),KD(e,t,Op,{domain:r});TWe(e,{domain:r}),gQ=r}return gQ}var tk="_dd_s";function qC(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function CH(e){var t=Wo({},e),n=["id","name","email"];return n.forEach(function(r){r in t&&(t[r]=String(t[r]))}),t}function kWe(e){var t=qC(e)==="object";return t||Pa.error("Unsupported user:",e),t}function pNt(){return Math.floor(Math.random()*Math.pow(2,53)).toString(36)}var WI=4*CWe,MWe=15*ym,hNt=NWe,u3={COOKIE:"cookie",LOCAL_STORAGE:"local-storage"},RWe=/^([a-zA-Z]+)=([a-z0-9-]+)$/,qhe="&";function mNt(e){return!!e&&(e.indexOf(qhe)!==-1||RWe.test(e))}var gNt="1";function Aj(e){var t={isExpired:gNt};return aw(A0.ANONYMOUS_USER_TRACKING)&&(e!=null&&e.anonymousId?t.anonymousId=e==null?void 0:e.anonymousId:t.anonymousId=pNt()),t}function Pz(e){return yC(e)}function OWe(e){return!Pz(e)}function NH(e){return e.isExpired!==void 0||!xNt(e)}function xNt(e){return(e.created===void 0||_0()-Number(e.created)=RNt){$2e(t);return}var u,d=c();if(o){if(d.lock){k8(e,t,n);return}if(u=$p(),l(d.session),d=c(),d.lock!==u){k8(e,t,n);return}}var p=e.process(d.session);if(o&&(d=c(),d.lock!==u)){k8(e,t,n);return}if(p&&(NH(p)?s(p):($We(p),o?l(p):i(p))),o&&!(p&&NH(p))){if(d=c(),d.lock!==u){k8(e,t,n);return}i(d.session),p=d.session}(r=e.after)===null||r===void 0||r.call(e,p||d.session),$2e(t)}function k8(e,t,n){Vf(function(){Tj(e,t,n+1)},MNt)}function $2e(e){Az=void 0;var t=FWe.shift();t&&Tj(t,e)}var D2e=Op;function ONt(e){switch(e.sessionPersistence){case u3.COOKIE:return R2e(e);case u3.LOCAL_STORAGE:return O2e();case void 0:{var t=R2e(e);return!t&&e.allowFallbackToLocalStorage&&(t=O2e()),t}default:Pa.error("Invalid session persistence '".concat(String(e.sessionPersistence),"'"))}}function $Nt(e,t,n){var r=new us,o=new us,i=new us,s=e.type===u3.COOKIE?NNt(e.cookieOptions):ANt(),l=s.expireSession,c=ek(g,D2e),u;x();var d=Ow(function(){Tj({process:function(j){if(!Pz(j)){var I=y(j);return v(I),I}},after:function(j){OWe(j)&&!b()&&C(j),u=j}},s)},D2e),p=d.throttled,h=d.cancel;function m(){Tj({process:function(j){return b()?y(j):void 0}},s)}function g(){Tj({process:function(j){return NH(j)?Aj(j):void 0},after:y},s)}function y(j){return NH(j)&&(j=Aj(j)),b()&&(w(j)?S():(i.notify({previousState:u,newState:j}),u=j)),j}function x(){Tj({process:function(j){if(Pz(j))return Aj(j)},after:function(j){u=j}},s)}function v(j){if(Pz(j))return!1;var I=n(j[t]),_=I.trackingType,T=I.isTracked;j[t]=_,delete j.isExpired,T&&!j.id&&(j.id=$p(),j.created=String(_0()))}function b(){return u[t]!==void 0}function w(j){return u.id!==j.id||u[t]!==j[t]}function S(){u=Aj(u),o.notify()}function C(j){u=j,r.notify()}function N(j){Tj({process:function(I){return Wo({},I,j)},after:y},s)}return{expandOrRenewSession:p,expandSession:m,getSession:function(){return u},renewObservable:r,expireObservable:o,sessionStateUpdateObservable:i,restartSession:x,expire:function(){h(),l(u),y(Aj(u))},stop:function(){SG(c)},updateSessionState:N}}var Zoe={GRANTED:"granted",NOT_GRANTED:"not-granted"};function zWe(e){var t=new us;return{tryToInit:function(n){e||(e=n)},update:function(n){e=n,t.notify()},isGranted:function(){return e===Zoe.GRANTED},observable:t}}function GI(e,t,n){if(typeof e!="object"||e===null)return JSON.stringify(e);var r=fP(Object.prototype),o=fP(Array.prototype),i=fP(Object.getPrototypeOf(e)),s=fP(e);try{return JSON.stringify(e,t,n)}catch{return""}finally{r(),o(),i(),s()}}function fP(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):Ea}function Yhe(e){return CG(e,location.href).href}function DNt(e){try{return!!CG(e)}catch{return!1}}function LNt(e){var t=CG(e).pathname;return t[0]==="/"?t:"/".concat(t)}function CG(e,t){var n=FNt();if(n)try{return t!==void 0?new n(e,t):new n(e)}catch(s){throw new Error("Failed to construct URL: ".concat(String(s)," ").concat(GI({url:e,base:t})))}if(t===void 0&&!/:/.test(e))throw new Error("Invalid URL: '".concat(e,"'"));var r=document,o=r.createElement("a");if(t!==void 0){r=document.implementation.createHTMLDocument("");var i=r.createElement("base");i.href=t,r.head.appendChild(i),r.body.appendChild(o)}return o.href=e,o}var L2e=URL,M8;function FNt(){if(M8===void 0)try{var e=new L2e("http://test/path");M8=e.href==="http://test/path"}catch{M8=!1}return M8?L2e:void 0}var BWe="datad0g.com",zNt="dd0g-gov.com",Vj="datadoghq.com",BNt="datadoghq.eu",HNt="ddog-gov.com",VNt="pci.browser-intake-datadoghq.com",UNt=["ddsource","ddtags"];function eO(e,t,n){var r=WNt(e,t);return{build:function(o,i){var s=qNt(e,t,n,o,i);return r(s)},urlPrefix:r(""),trackType:t}}function WNt(e,t){var n="/api/v2/".concat(t),r=e.proxy;if(typeof r=="string"){var o=Yhe(r);return function(s){return"".concat(o,"?ddforward=").concat(encodeURIComponent("".concat(n,"?").concat(s)))}}if(typeof r=="function")return function(s){return r({path:n,parameters:s})};var i=GNt(t,e);return function(s){return"https://".concat(i).concat(n,"?").concat(s)}}function GNt(e,t){var n=t.site,r=n===void 0?Vj:n,o=t.internalAnalyticsSubdomain;if(e==="logs"&&t.usePciIntake&&r===Vj)return VNt;if(o&&r===Vj)return"".concat(o,".").concat(Vj);if(r===zNt)return"http-intake.logs.".concat(r);var i=r.split("."),s=i.pop();return"browser-intake-".concat(i.join("-"),".").concat(s)}function qNt(e,t,n,r,o){var i=e.clientToken,s=e.internalAnalyticsSubdomain,l=o.retry,c=o.encoding,u=["sdk_version:".concat("5.35.1"),"api:".concat(r)].concat(n);l&&u.push("retry_count:".concat(l.count),"retry_after:".concat(l.lastFailureStatus));var d=["ddsource=browser","ddtags=".concat(encodeURIComponent(u.join(","))),"dd-api-key=".concat(i),"dd-evp-origin-version=".concat(encodeURIComponent("5.35.1")),"dd-evp-origin=browser","dd-request-id=".concat($p())];return c&&d.push("dd-evp-encoding=".concat(c)),t==="rum"&&d.push("batch_time=".concat(fu())),s&&d.reverse(),d.join("&")}var KNt=200;function YNt(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(R8("env",t)),n&&i.push(R8("service",n)),r&&i.push(R8("version",r)),o&&i.push(R8("datacenter",o)),i}function R8(e,t){var n=KNt-e.length-1;(t.length>n||XNt(t))&&Pa.warn("".concat(e," value doesn't meet tag requirements and will be sanitized. ").concat(yG," ").concat(xG,"/getting_started/tagging/#defining-tags"));var r=t.replace(/,/g,"_");return"".concat(e,":").concat(r)}function XNt(e){return QNt()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function QNt(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function JNt(e){var t=e.site||Vj,n=YNt(e),r=ZNt(e,n),o=ejt(e,n);return Wo({replica:o,site:t},r)}function ZNt(e,t){return{logsEndpointBuilder:eO(e,"logs",t),rumEndpointBuilder:eO(e,"rum",t),sessionReplayEndpointBuilder:eO(e,"replay",t)}}function ejt(e,t){if(e.replica){var n=Wo({},e,{site:Vj,clientToken:e.replica.clientToken}),r={logsEndpointBuilder:eO(n,"logs",t),rumEndpointBuilder:eO(n,"rum",t)};return Wo({applicationId:e.replica.applicationId},r)}}function HWe(e){return UNt.every(function(t){return Sh(e,t)})}var tO={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},eie={ALL:"all",SAMPLED:"sampled"};function xQ(e,t){return e!=null&&typeof e!="string"?(Pa.error("".concat(t," must be defined as a string")),!1):!0}function tjt(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(Pa.error("Site should be a valid Datadog site. ".concat(yG," ").concat(xG,"/getting_started/site/.")),!1):!0}function pP(e,t){return e!==void 0&&!BCt(e)?(Pa.error("".concat(t," Sample Rate should be a number between 0 and 100")),!1):!0}function VWe(e){var t,n,r,o,i;if(!e||!e.clientToken){Pa.error("Client Token is not configured, we will not send any data.");return}if(!(!tjt(e.site)||!pP(e.sessionSampleRate,"Session")||!pP(e.telemetrySampleRate,"Telemetry")||!pP(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!pP(e.telemetryUsageSampleRate,"Telemetry Usage")||!xQ(e.version,"Version")||!xQ(e.env,"Env")||!xQ(e.service,"Service"))){if(e.trackingConsent!==void 0&&!bH(Zoe,e.trackingConsent)){Pa.error('Tracking Consent should be either "granted" or "not-granted"');return}return Wo({beforeSend:e.beforeSend&&SWe(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:ONt(e),sessionSampleRate:(t=e.sessionSampleRate)!==null&&t!==void 0?t:100,telemetrySampleRate:(n=e.telemetrySampleRate)!==null&&n!==void 0?n:20,telemetryConfigurationSampleRate:(r=e.telemetryConfigurationSampleRate)!==null&&r!==void 0?r:5,telemetryUsageSampleRate:(o=e.telemetryUsageSampleRate)!==null&&o!==void 0?o:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(i=e.trackingConsent)!==null&&i!==void 0?i:Zoe.GRANTED,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*iw,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*Op,batchMessagesLimit:50,messageBytesLimit:256*iw},JNt(e))}}function UWe(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_cross_site_session_cookie:e.useCrossSiteSessionCookie,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,session_persistence:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent}}var YD="?";function Cb(e){var t=[],n=yQ(e,"stack"),r=String(e);return n&&qD(n,r)&&(n=n.slice(r.length)),n&&n.split(` `).forEach(function(o){var i=ojt(o)||ajt(o)||ljt(o)||djt(o);i&&(!i.func&&i.line&&(i.func=YD),t.push(i))}),{message:yQ(e,"message"),name:yQ(e,"name"),stack:t}}var WWe="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet||\\w+\\.|\\/).*?)",YA="(?::(\\d+))",njt=new RegExp("^\\s*at (.*?) ?\\(".concat(WWe).concat(YA,"?").concat(YA,"?\\)?\\s*$"),"i"),rjt=new RegExp("\\((\\S*)".concat(YA).concat(YA,"\\)"));function ojt(e){var t=njt.exec(e);if(t){var n=t[2]&&t[2].indexOf("native")===0,r=t[2]&&t[2].indexOf("eval")===0,o=rjt.exec(t[2]);return r&&o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]),{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||YD,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}}var ijt=new RegExp("^\\s*at ?".concat(WWe).concat(YA,"?").concat(YA,"??\\s*$"),"i");function ajt(e){var t=ijt.exec(e);if(t)return{args:[],column:t[3]?+t[3]:void 0,func:YD,line:t[2]?+t[2]:void 0,url:t[1]}}var sjt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function ljt(e){var t=sjt.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||YD,line:+t[3],url:t[2]}}var cjt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ujt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function djt(e){var t=cjt.exec(e);if(t){var n=t[3]&&t[3].indexOf(" > eval")>-1,r=ujt.exec(t[3]);return n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||YD,line:t[4]?+t[4]:void 0,url:t[3]}}}function yQ(e,t){if(!(typeof e!="object"||!e||!(t in e))){var n=e[t];return typeof n=="string"?n:void 0}}function fjt(e,t,n,r){var o=[{url:t,column:r,line:n}],i=hjt(e),s=i.name,l=i.message;return{name:s,message:l,stack:o}}var pjt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function hjt(e){var t,n,r;return{}.toString.call(e)==="[object String]"&&(t=pjt.exec(e),n=t[1],r=t[2]),{name:n,message:r}}function XA(){var e=2,t=new Error,n;if(!t.stack)try{throw t}catch{}return QE(function(){var r=Cb(t);r.stack=r.stack.slice(e),n=qI(r)}),n}function qI(e){var t=GWe(e);return e.stack.forEach(function(n){var r=n.func==="?"?"":n.func,o=n.args&&n.args.length>0?"(".concat(n.args.join(", "),")"):"",i=n.line?":".concat(n.line):"",s=n.line&&n.column?":".concat(n.column):"";t+=` at `.concat(r).concat(o," @ ").concat(n.url).concat(i).concat(s)}),t}function GWe(e){return"".concat(e.name||"Error",": ").concat(e.message)}function am(e,t,n,r){var o=r===void 0?{}:r,i=o.computeHandlingStack,s=e[t];if(typeof s!="function")if(t in e&&qD(t,"on"))s=Ea;else return{stop:Ea};var l=!1,c=function(){if(l)return s.apply(this,arguments);var u=wG(arguments),d;QE(n,null,[{target:this,parameters:u,onPostCall:function(h){d=h},handlingStack:i?XA():void 0}]);var p=s.apply(this,u);return d&&QE(d,null,[p]),p};return e[t]=c,{stop:function(){l=!0,e[t]===c&&(e[t]=s)}}}function L4(e,t,n){var r=Object.getOwnPropertyDescriptor(e,t);if(!r||!r.set||!r.configurable)return{stop:Ea};var o=Ea,i=function(l,c){Vf(function(){i!==o&&n(l,c)},0)},s=function(l){r.set.call(this,l),i(this,l)};return Object.defineProperty(e,t,{set:s}),{stop:function(){var l;((l=Object.getOwnPropertyDescriptor(e,t))===null||l===void 0?void 0:l.set)===s&&Object.defineProperty(e,t,r),i=o}}}var mjt=220*iw,gjt="$",xjt=3;function Wl(e,t){t===void 0&&(t=mjt);var n=fP(Object.prototype),r=fP(Array.prototype),o=[],i=new WeakMap,s=vQ(e,gjt,void 0,o,i),l=JSON.stringify(s),c=l?l.length:0;if(c>t){bQ(t,"discarded",e);return}for(;o.length>0&&ct){bQ(t,"truncated",e);break}u.target[p]=h}else for(var p in u.source)if(Object.prototype.hasOwnProperty.call(u.source,p)){var h=vQ(u.source[p],u.path,p,o,i);if(h!==void 0&&(c+=JSON.stringify(h).length+d+p.length+xjt,d=1),c>t){bQ(t,"truncated",e);break}u.target[p]=h}}return n(),r(),s}function vQ(e,t,n,r,o){var i=bjt(e);if(!i||typeof i!="object")return yjt(i);var s=vjt(i);if(s!=="[Object]"&&s!=="[Array]"&&s!=="[Error]")return s;var l=e;if(o.has(l))return"[Reference seen at ".concat(o.get(l),"]");var c=n!==void 0?"".concat(t,".").concat(n):t,u=Array.isArray(i)?[]:{};return o.set(l,c),r.push({source:i,target:u,path:c}),u}function yjt(e){return typeof e=="bigint"?"[BigInt] ".concat(e.toString()):typeof e=="function"?"[Function] ".concat(e.name||"unknown"):typeof e=="symbol"?"[Symbol] ".concat(e.description||e.toString()):e}function vjt(e){try{if(e instanceof Event)return{isTrusted:e.isTrusted};var t=Object.prototype.toString.call(e),n=t.match(/\[object (.*)\]/);if(n&&n[1])return"[".concat(n[1],"]")}catch{}return"[Unserializable]"}function bjt(e){var t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch{}return e}function bQ(e,t,n){Pa.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),n)}var qWe="No stack, consider using an instance of Error";function Xhe(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,s=e.source,l=e.handling,c=$w(n),u=wjt(t,c,i,n),d=Sjt(c,t)?qI(t):qWe,p=c?YWe(n,s):void 0,h=t?t.name:void 0,m=KWe(n);return{startClocks:o,source:s,handling:l,handlingStack:r,originalError:n,type:h,message:u,stack:d,causes:p,fingerprint:m}}function wjt(e,t,n,r){return e!=null&&e.message&&(e!=null&&e.name)?e.message:t?"Empty message":"".concat(n," ").concat(GI(Wl(r)))}function Sjt(e,t){return t===void 0?!1:e?!0:t.stack.length>0&&(t.stack.length>1||t.stack[0].url!==void 0)}function KWe(e){return $w(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function Cjt(e){var t;return(t=/@ (.+)/.exec(e))===null||t===void 0?void 0:t[1]}function $w(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}function YWe(e,t){for(var n=e,r=[];$w(n==null?void 0:n.cause)&&r.length<10;){var o=Cb(n.cause);r.push({message:n.cause.message,source:t,type:o==null?void 0:o.name,stack:o&&qI(o)}),n=n.cause}return r.length?r:void 0}var vm={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function XWe(e){var t=function(o,i){var s=Xhe({stackTrace:o,originalError:i,startClocks:Tp(),nonErrorPrefix:"Uncaught",source:vm.SOURCE,handling:"unhandled"});e.notify(s)},n=Njt(t).stop,r=jjt(t).stop;return{stop:function(){n(),r()}}}function Njt(e){return am(window,"onerror",function(t){var n=t.parameters,r=n[0],o=n[1],i=n[2],s=n[3],l=n[4],c;$w(l)?c=Cb(l):c=fjt(r,o,i,s),e(c,l??r)})}function jjt(e){return am(window,"onunhandledrejection",function(t){var n=t.parameters[0],r=n.reason||"Empty reason",o=Cb(r);e(o,r)})}function QWe(e){var t=Wo({version:"5.35.1",onReady:function(n){n()}},e);return Object.defineProperty(t,"_setDebug",{get:function(){return nNt},enumerable:!1}),t}function JWe(e,t,n){var r=e[t];r&&!r.q&&r.version&&Pa.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,r&&r.q&&r.q.forEach(function(o){return SWe(o,"onReady callback threw an error:")()})}function NG(e,t){t.silentMultipleInit||Pa.error("".concat(e," is already initialized."))}function Kl(e,t,n,r,o){return fm(e,t,[n],r,o)}function fm(e,t,n,r,o){var i=o===void 0?{}:o,s=i.once,l=i.capture,c=i.passive,u=to(function(g){!g.isTrusted&&!g.__ddIsTrusted&&!e.allowUntrustedEvents||(s&&m(),r(g))}),d=c?{capture:l,passive:c}:l,p=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,h=vC(p,"addEventListener");n.forEach(function(g){return h.call(t,g,u,d)});function m(){var g=vC(p,"removeEventListener");n.forEach(function(y){return g.call(t,y,u,d)})}return{stop:m}}var QA={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function ZWe(e,t){var n=[];Sh(t,QA.cspViolation)&&n.push(Ijt(e));var r=t.filter(function(o){return o!==QA.cspViolation});return r.length&&n.push(Ejt(r)),_We.apply(void 0,n)}function Ejt(e){return new us(function(t){if(window.ReportingObserver){var n=to(function(o,i){return o.forEach(function(s){return t.notify(_jt(s))})}),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),function(){r.disconnect()}}})}function Ijt(e){return new us(function(t){var n=Kl(e,document,"securitypolicyviolation",function(r){t.notify(Pjt(r))}).stop;return n})}function _jt(e){var t=e.type,n=e.body;return eGe({type:n.id,message:"".concat(t,": ").concat(n.message),originalError:e,stack:tGe(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function Pjt(e){var t="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return eGe({type:e.effectiveDirective,message:"".concat(QA.cspViolation,": ").concat(t),originalError:e,csp:{disposition:e.disposition},stack:tGe(e.effectiveDirective,e.originalPolicy?"".concat(t,' of the policy "').concat(PWe(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function eGe(e){return Wo({startClocks:Tp(),source:vm.REPORT,handling:"unhandled"},e)}function tGe(e,t,n,r,o){return n?qI({name:e,message:t,stack:[{func:"?",url:n,line:r??void 0,column:o??void 0}]}):void 0}function jG(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function jH(e,t,n){if(n===void 0&&(n=Ajt()),t===void 0)return e;if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],i=0;i=0;return r||t.push(n),r}}}function nGe(){var e,t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:(e=t.connection)===null||e===void 0?void 0:e.effectiveType}}function Tjt(e){var t=new Set;return e.forEach(function(n){return t.add(n)}),wG(t)}function rGe(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var kjt=500;function Qhe(){var e=[],t=function(o){var i=e.push(o);i>kjt&&e.splice(0,1)},n=function(o){rGe(e,o)},r=function(o){e.forEach(function(i){return i(o)}),e.length=0};return{add:t,remove:n,drain:r}}var EE={log:"log",configuration:"configuration",usage:"usage"},Mjt=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost",""],Rjt=[HNt],oGe=Qhe(),nk=function(e){oGe.add(function(){return nk(e)})};function iGe(e,t){var n,r,o=new us,i=new Set,s=!Sh(Rjt,t.site)&&Q2(t.telemetrySampleRate),l=(n={},n[EE.log]=s,n[EE.configuration]=s&&Q2(t.telemetryConfigurationSampleRate),n[EE.usage]=s&&Q2(t.telemetryUsageSampleRate),n),c=Ojt();nk=function(d){var p=GI(d);if(l[d.type]&&i.size0&&r[r.length-1].endTime=n&&r.pop(),r.unshift(g),g}function l(h,m){h===void 0&&(h=O8),m===void 0&&(m={returnInactive:!1});for(var g=0,y=r;g=500}function dGe(e){try{return e.clone()}catch{return}}var Ujt=80*iw,Wjt=32,fGe=3*EWe,Gjt=ym,pGe=Op;function hGe(e,t,n,r,o){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?gGe(e,t,n,{onSuccess:function(){return xGe(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),mGe(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function mGe(e,t,n,r){e.transportStatus===2&&Vf(function(){var o=e.queuedPayloads.first();gGe(o,e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=pGe,xGe(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(Gjt,e.currentBackoffTime*2),mGe(e,t,n,r)}})},e.currentBackoffTime)}function gGe(e,t,n,r){var o=r.onSuccess,i=r.onFailure;t.bandwidthMonitor.add(e),n(e,function(s){t.bandwidthMonitor.remove(e),qjt(s)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:s.status},i()):(t.transportStatus=0,o())})}function xGe(e,t,n,r,o){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(fGe/EWe,"MiB"),source:vm.AGENT,startClocks:Tp()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=yGe();i.size()>0;)hGe(i.dequeue(),t,n,r,o)}function qjt(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||uGe(e.status))}function Kjt(){return{transportStatus:0,currentBackoffTime:pGe,bandwidthMonitor:Yjt(),queuedPayloads:yGe(),queueFullReported:!1}}function yGe(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=fGe}}}function Yjt(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=Ujt&&this.ongoingRequestCount=o){Pa.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(o,"KB. ").concat(yG," ").concat(wWe,"/#technical-limitations"));return}c(m)&&u(m),l(g,y,m)}function p(h){var m=vH(i).join(` `);i={};var g=SGe(h.reason),y=g?n.sendOnExit:n.send;if(g&&t.isAsync){var x=t.finishSync();x.outputBytesCount&&y(z2e(x));var v=[x.pendingData,m].filter(Boolean).join(` `);v&&y({data:v,bytesCount:Hhe(v)})}else m&&t.write(t.isEmpty?m:` `.concat(m)),t.finish(function(b){y(z2e(b))})}return{flushController:r,add:d,upsert:d,stop:s.unsubscribe}}function z2e(e){var t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function nEt(e){var t=e.messagesLimit,n=e.bytesLimit,r=e.durationLimit,o=e.pageExitObservable,i=e.sessionExpireObservable,s=o.subscribe(function(y){return p(y.reason)}),l=i.subscribe(function(){return p("session_expire")}),c=new us(function(){return function(){s.unsubscribe(),l.unsubscribe()}}),u=0,d=0;function p(y){if(d!==0){var x=d,v=u;d=0,u=0,g(),c.notify({reason:y,messagesCount:x,bytesCount:v})}}var h;function m(){h===void 0&&(h=Vf(function(){p("duration_limit")},r))}function g(){Qm(h),h=void 0}return{flushObservable:c,get messagesCount(){return d},notifyBeforeAddMessage:function(y){u+y>=n&&p("bytes_limit"),d+=1,u+=y,m()},notifyAfterAddMessage:function(y){y===void 0&&(y=0),u+=y,d>=t?p("messages_limit"):u>=n&&p("bytes_limit")},notifyAfterRemoveMessage:function(y){u-=y,d-=1,d===0&&g()}}}function Jhe(e,t,n,r,o,i,s){s===void 0&&(s=tEt);var l=u(e,t),c=n&&u(e,n);function u(d,p){var h=p.endpoint,m=p.encoder;return s({encoder:m,request:vGe(h,d.batchBytesLimit,r),flushController:nEt({messagesLimit:d.batchMessagesLimit,bytesLimit:d.batchBytesLimit,durationLimit:d.flushTimeout,pageExitObservable:o,sessionExpireObservable:i}),messageBytesLimit:d.messageBytesLimit})}return{flushObservable:l.flushController.flushObservable,add:function(d,p){p===void 0&&(p=!0),l.add(d),c&&p&&c.add(n.transformMessage?n.transformMessage(d):d)},upsert:function(d,p){l.upsert(d,p),c&&c.upsert(n.transformMessage?n.transformMessage(d):d,p)},stop:function(){l.stop(),c&&c.stop()}}}function d3(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(n,r){var o=Hhe(n);t+=o,e+=n,r&&r(o)},finish:function(n){n(this.finishSync())},finishSync:function(){var n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount:function(n){return n.length}}}var CGe=(function(){function e(){this.callbacks={}}return e.prototype.notify=function(t,n){var r=this.callbacks[t];r&&r.forEach(function(o){return o(n)})},e.prototype.subscribe=function(t,n){var r=this;return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:function(){r.callbacks[t]=r.callbacks[t].filter(function(o){return n!==o})}}},e})();function Tz(e,t,n){var r=0,o=!1;return{isLimitReached:function(){if(r===0&&Vf(function(){r=0},ym),r+=1,r<=t||o)return o=!1,!1;if(r===t+1){o=!0;try{n({message:"Reached max number of ".concat(e,"s by minute: ").concat(t),source:vm.AGENT,startClocks:Tp()})}finally{o=!1}}return!0}}}function Zhe(e,t,n){if(document.readyState===t||document.readyState==="complete")return n(),{stop:Ea};var r=t==="complete"?"load":"DOMContentLoaded";return Kl(e,window,r,n,{once:!0})}var wQ,eme=new WeakMap;function NGe(e){return wQ||(wQ=rEt(e)),wQ}function rEt(e){return new us(function(t){var n=am(XMLHttpRequest.prototype,"open",oEt).stop,r=am(XMLHttpRequest.prototype,"send",function(i){iEt(i,e,t)},{computeHandlingStack:!0}).stop,o=am(XMLHttpRequest.prototype,"abort",aEt).stop;return function(){n(),r(),o()}})}function oEt(e){var t=e.target,n=e.parameters,r=n[0],o=n[1];eme.set(t,{state:"open",method:String(r).toUpperCase(),url:Yhe(String(o))})}function iEt(e,t,n){var r=e.target,o=e.handlingStack,i=eme.get(r);if(i){var s=i;s.state="start",s.startClocks=Tp(),s.isAborted=!1,s.xhr=r,s.handlingStack=o;var l=!1,c=am(r,"onreadystatechange",function(){r.readyState===XMLHttpRequest.DONE&&u()}).stop,u=function(){if(d(),c(),!l){l=!0;var p=i;p.state="complete",p.duration=Wf(s.startClocks.timeStamp,fu()),p.status=r.status,n.notify(l3(p))}},d=Kl(t,r,"loadend",u).stop;n.notify(s)}}function aEt(e){var t=e.target,n=eme.get(t);n&&(n.isAborted=!0)}var SQ;function IG(){return SQ||(SQ=sEt()),SQ}function sEt(){return new us(function(e){if(window.fetch){var t=am(window,"fetch",function(n){return lEt(n,e)},{computeHandlingStack:!0}).stop;return t}})}function lEt(e,t){var n=e.parameters,r=e.onPostCall,o=e.handlingStack,i=n[0],s=n[1],l=s&&s.method;l===void 0&&i instanceof Request&&(l=i.method);var c=l!==void 0?String(l).toUpperCase():"GET",u=i instanceof Request?i.url:Yhe(String(i)),d=Tp(),p={state:"start",init:s,input:i,method:c,startClocks:d,url:u,handlingStack:o};t.notify(p),n[0]=p.input,n[1]=p.init,r(function(h){return cEt(t,h,p)})}function cEt(e,t,n){var r=n;function o(i){r.state="resolve",Wo(r,i),e.notify(r)}t.then(to(function(i){o({response:i,responseType:i.type,status:i.status,isAborted:!1})}),to(function(i){var s,l;o({status:0,isAborted:((l=(s=r.init)===null||s===void 0?void 0:s.signal)===null||l===void 0?void 0:l.aborted)||i instanceof DOMException&&i.code===DOMException.ABORT_ERR,error:i})}))}function jGe(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){var n=window.requestIdleCallback(to(e),t);return function(){return window.cancelIdleCallback(n)}}return dEt(e)}var uEt=50;function dEt(e){var t=_0(),n=Vf(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,uEt-(_0()-t))}})},0);return function(){return Qm(n)}}var fEt=Op,pEt=30;function hEt(){var e=[];function t(r){var o;if(r.didTimeout){var i=performance.now();o=function(){return pEt-(performance.now()-i)}}else o=r.timeRemaining.bind(r);for(;o()>0&&e.length;)e.shift()();e.length&&n()}function n(){jGe(t,{timeout:fEt})}return{push:function(r){e.push(r)===1&&n()}}}var CQ={};function EGe(e){var t=e.map(function(n){return CQ[n]||(CQ[n]=mEt(n)),CQ[n]});return _We.apply(void 0,t)}function mEt(e){return new us(function(t){var n=jv[e];return jv[e]=function(){for(var r=[],o=0;oi&&(NEt(i),n=!0)}}return{createDetachedTracker:function(){var o=B2e(function(){return r(o.getBytesCount())});return o},getOrCreateTracker:function(o){return t.has(o)||t.set(o,B2e(r)),t.get(o)},setCompressionStatus:function(o){e===0&&(e=o,r())},getCompressionStatus:function(){return e},stop:function(){t.forEach(function(o){return o.stop()}),t.clear()}}}function B2e(e){var t=0,n=Ow(function(s){t=Hhe(GI(s)),e()},CEt),r=n.throttled,o=n.cancel,i=function(){o(),t=0};return{updateCustomerData:function(s){yC(s)?i():r(s)},resetCustomerData:i,getBytesCount:function(){return t},stop:function(){o()}}}function NEt(e){Pa.warn("Customer data exceeds the recommended ".concat(e/iw,"KiB threshold. ").concat(yG," ").concat(wWe,"/#customer-data-exceeds-the-recommended-threshold-warning"))}function _Ge(e,t,n){var r=e.getReader(),o=[],i=0;s();function s(){r.read().then(to(function(c){if(c.done){l();return}n.collectStreamBody&&o.push(c.value),i+=c.value.length,i>n.bytesLimit?l():s()}),to(function(c){return t(c)}))}function l(){r.cancel().catch(Ea);var c,u;if(n.collectStreamBody){var d;if(o.length===1)d=o[0];else{d=new Uint8Array(i);var p=0;o.forEach(function(h){d.set(h,p),p+=h.length})}c=d.slice(0,n.bytesLimit),u=d.length>n.bytesLimit}t(void 0,c,u)}}var jEt="datadog-synthetics-public-id",EEt="datadog-synthetics-result-id",IEt="datadog-synthetics-injects-rum";function _G(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||P2(IEt))}function PGe(){var e=window._DATADOG_SYNTHETICS_PUBLIC_ID||P2(jEt);return typeof e=="string"?e:void 0}function AGe(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||P2(EEt);return typeof e=="string"?e:void 0}function tme(e){var t=qC(e);return t==="string"||t==="function"||e instanceof RegExp}function TGe(e,t,n){return n===void 0&&(n=!1),e.some(function(r){try{if(typeof r=="function")return r(t);if(r instanceof RegExp)return r.test(t);if(typeof r=="string")return n?qD(t,r):r===t}catch(o){Pa.error(o)}return!1})}function _Et(e,t,n){return{context:e.getContext(),user:t.getContext(),hasReplay:n.isRecording()?!0:void 0}}function PEt(){var e=new Map,t=new WeakMap;return{vitalsByName:e,vitalsByReference:t}}function AEt(e,t,n){function r(i){return!t.wasInPageStateDuringPeriod("frozen",i.startClocks.relative,i.duration)}function o(i){r(i)&&e.notify(12,kEt(i))}return{addDurationVital:o,startDurationVital:function(i,s){return s===void 0&&(s={}),kGe(n,i,s)},stopDurationVital:function(i,s){s===void 0&&(s={}),MGe(o,n,i,s)}}}function kGe(e,t,n){var r=e.vitalsByName,o=e.vitalsByReference;n===void 0&&(n={});var i={name:t,startClocks:Tp(),context:n.context,description:n.description},s={__dd_vital_reference:!0};return r.set(t,i),o.set(s,i),s}function MGe(e,t,n,r){var o=t.vitalsByName,i=t.vitalsByReference;r===void 0&&(r={});var s=typeof n=="string"?o.get(n):i.get(n);s&&(e(TEt(s,s.startClocks,r,Tp())),typeof n=="string"?o.delete(n):i.delete(n))}function TEt(e,t,n,r){var o;return{name:e.name,type:"duration",startClocks:t,duration:Wf(t.timeStamp,r.timeStamp),context:ug(e.context,n.context),description:(o=n.description)!==null&&o!==void 0?o:e.description}}function kEt(e,t){var n={date:e.startClocks.timeStamp,vital:{id:$p(),type:e.type,name:e.name,duration:aa(e.duration),description:e.description},type:"vital"};return n._dd={vital:{computed_value:!0}},{rawRumEvent:n,startTime:e.startClocks.relative,customerContext:e.context,domainContext:{}}}function RGe(){return window.crypto||window.msCrypto}function MEt(){return $Ge(64)}function OGe(){return $Ge(63)}var NQ;function $Ge(e){return NQ||(NQ=aw(A0.CONSISTENT_TRACE_SAMPLING)&&REt()?OEt:$Et),NQ(e)}function REt(){try{return crypto.getRandomValues(new BigUint64Array(1)),!0}catch{return!1}}function OEt(e){var t=crypto.getRandomValues(new BigUint64Array(1))[0];return e===63&&(t>>=BigInt("1")),t}function $Et(e){var t=RGe().getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString:function(n){n===void 0&&(n=10);var r=t[1],o=t[0],i="";do{var s=r%n*4294967296+o;r=Math.floor(r/n),o=Math.floor(s/n),i=(s%n).toString(n)+i}while(r||o);return i}}}function W5(e){var t=e.toString(16);return Array(17-t.length).join("0")+t}function DEt(e,t){if(t===100)return!0;if(t===0)return!1;if(typeof e!="bigint")return Q2(t);var n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000"),o=e*n%r;return Number(o)<=t/100*Number(r)}function LEt(e){var t=e;return qC(t)==="object"&&tme(t.match)&&Array.isArray(t.propagatorTypes)}function FEt(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function zEt(e,t){return{clearTracingIfNeeded:FEt,traceFetch:function(n){return H2e(e,n,t,function(r){var o;if(n.input instanceof Request&&!(!((o=n.init)===null||o===void 0)&&o.headers))n.input=new Request(n.input),Object.keys(r).forEach(function(s){n.input.headers.append(s,r[s])});else{n.init=l3(n.init);var i=[];n.init.headers instanceof Headers?n.init.headers.forEach(function(s,l){i.push([l,s])}):Array.isArray(n.init.headers)?n.init.headers.forEach(function(s){i.push(s)}):n.init.headers&&Object.keys(n.init.headers).forEach(function(s){i.push([s,n.init.headers[s]])}),n.init.headers=i.concat(Vhe(r))}})},traceXhr:function(n,r){return H2e(e,n,t,function(o){Object.keys(o).forEach(function(i){r.setRequestHeader(i,o[i])})})}}}function H2e(e,t,n,r){if(!(!BEt()||!n.findTrackedSession())){var o=xC(e.allowedTracingUrls,function(l){return TGe([l.match],t.url,!0)});if(o){var i=MEt();t.traceSampled=DEt(i,e.traceSampleRate);var s=t.traceSampled||e.traceContextInjection===eie.ALL;s&&(t.traceId=i,t.spanId=OGe(),r(HEt(t.traceId,t.spanId,t.traceSampled,o.propagatorTypes)))}}}function BEt(){return RGe()!==void 0}function HEt(e,t,n,r){var o={};return r.forEach(function(i){switch(i){case"datadog":{Wo(o,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Wo(o,{traceparent:"00-0000000000000000".concat(W5(e),"-").concat(W5(t),"-0").concat(n?"1":"0")});break}case"b3":{Wo(o,{b3:"".concat(W5(e),"-").concat(W5(t),"-").concat(n?"1":"0")});break}case"b3multi":{Wo(o,{"X-B3-TraceId":W5(e),"X-B3-SpanId":W5(t),"X-B3-Sampled":n?"1":"0"});break}}}),o}var DGe=["tracecontext","datadog"];function VEt(e){var t,n,r;if(!e.applicationId){Pa.error("Application ID is not configured, no RUM data will be collected.");return}if(!(!pP(e.sessionReplaySampleRate,"Session Replay")||!pP(e.traceSampleRate,"Trace"))){if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){Pa.error("Excluded Activity Urls should be an array");return}var o=UEt(e);if(o){var i=VWe(e);if(i){var s=(t=e.sessionReplaySampleRate)!==null&&t!==void 0?t:0;return Wo({applicationId:e.applicationId,version:e.version||void 0,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:s,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:s===0,traceSampleRate:(n=e.traceSampleRate)!==null&&n!==void 0?n:100,rulePsr:WD(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:o,excludedActivityUrls:(r=e.excludedActivityUrls)!==null&&r!==void 0?r:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!e.trackUserInteractions,trackViewsManually:!!e.trackViewsManually,trackResources:!!e.trackResources,trackLongTasks:!!e.trackLongTasks,subdomain:e.subdomain,defaultPrivacyLevel:bH(tO,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:tO.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,traceContextInjection:bH(eie,e.traceContextInjection)?e.traceContextInjection:eie.ALL,plugins:e.plugins||[]},i)}}}}function UEt(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){Pa.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){Pa.error("Service needs to be configured when tracing is enabled");return}var t=[];return e.allowedTracingUrls.forEach(function(n){tme(n)?t.push({match:n,propagatorTypes:DGe}):LEt(n)?t.push(n):Pa.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function WEt(e){var t=new Set;return Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0&&e.allowedTracingUrls.forEach(function(n){tme(n)?DGe.forEach(function(r){return t.add(r)}):qC(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(function(r){return t.add(r)})}),wG(t)}function GEt(e){var t,n=UWe(e);return Wo({session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0,selected_tracing_propagators:WEt(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(e.excludedActivityUrls)&&e.excludedActivityUrls.length>0,use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(function(r){var o;return Wo({name:r.name},(o=r.getConfigurationTelemetry)===null||o===void 0?void 0:o.call(r))})},n)}var qEt="https://d3uc069fcn7uxw.cloudfront.net/configuration";function KEt(e,t){XEt(e,function(n){t(YEt(e,n))})}function YEt(e,t){return Wo({},e,t)}function XEt(e,t){var n=new XMLHttpRequest;Kl(e,n,"load",function(){n.status===200?t(JSON.parse(n.responseText)):V2e()}),Kl(e,n,"error",function(){V2e()}),n.open("GET","".concat(qEt,"/").concat(encodeURIComponent(e.remoteConfigurationId),".json")),n.send()}function V2e(){Pa.error("Error fetching the remote configuration.")}function QEt(e,t,n){if(e)for(var r=0,o=e;re[n])return!1;return!0}function xIt(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function yIt(e){var t=e.duration,n=e.startTime,r=e.responseEnd;return t===0&&n=0}function VGe(e){var t=G2e(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=bIt(e)?G2e(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function bIt(e){return e.redirectEnd>e.startTime}function AN(e,t,n){if(e<=t&&t<=n)return{duration:aa(Wf(t,n)),start:aa(Wf(e,t))}}function UGe(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function WGe(e){return e.deliveryType===""?"other":e.deliveryType}function wIt(e){if(e.startTime=0&&c<_0()-n&&t(l)}}}var sl;(function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource"})(sl||(sl={}));function rb(e,t){return new us(function(n){if(window.PerformanceObserver){var r=function(u){var d=AIt(u);d.length>0&&n.notify(d)},o,i=!0,s=new PerformanceObserver(to(function(u){i?o=Vf(function(){return r(u.getEntries())}):r(u.getEntries())}));try{s.observe(t)}catch{var l=[sl.RESOURCE,sl.NAVIGATION,sl.LONG_TASK,sl.PAINT];if(Sh(l,t.type)){t.buffered&&(o=Vf(function(){return r(performance.getEntriesByType(t.type))}));try{s.observe({entryTypes:[t.type]})}catch{return}}}i=!1,_It(e);var c;return!PG(sl.FIRST_INPUT)&&t.type===sl.FIRST_INPUT&&(c=IIt(e,function(u){r([u])}).stop),function(){s.disconnect(),c&&c(),Qm(o)}}})}var F4;function _It(e){return!F4&&PIt()&&"addEventListener"in performance&&(F4=Kl(e,performance,"resourcetimingbufferfull",function(){performance.clearResourceTimings()})),function(){F4==null||F4.stop()}}function PIt(){return window.performance!==void 0&&"getEntries"in performance}function PG(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function AIt(e){return e.filter(function(t){return!TIt(t)})}function TIt(e){return e.entryType===sl.RESOURCE&&(!nme(e.name)||!HGe(e))}var QGe=100,kIt=100;function rme(e,t,n,r,o,i){var s=RIt(e,t,n,r);return MIt(s,o,i)}function MIt(e,t,n){var r,o=!1,i=Vf(to(function(){return u({hadActivity:!1})}),QGe),s=n!==void 0?Vf(to(function(){return u({hadActivity:!0,end:fu()})}),n):void 0,l=e.subscribe(function(d){var p=d.isBusy;Qm(i),Qm(r);var h=fu();p||(r=Vf(to(function(){return u({hadActivity:!0,end:h})}),kIt))}),c=function(){o=!0,Qm(i),Qm(r),Qm(s),l.unsubscribe()};function u(d){o||(c(),t(d))}return{stop:c}}function RIt(e,t,n,r){return new us(function(o){var i=[],s,l=0;return i.push(t.subscribe(c),n.subscribe(c),rb(r,{type:sl.RESOURCE}).subscribe(function(u){u.some(function(d){return!EQ(r,d.name)})&&c()}),e.subscribe(7,function(u){EQ(r,u.url)||(s===void 0&&(s=u.requestIndex),l+=1,c())}),e.subscribe(8,function(u){EQ(r,u.url)||s===void 0||u.requestIndex0})}})}function EQ(e,t){return TGe(e.excludedActivityUrls,t)}function bC(e){return window.CSS&&window.CSS.escape?window.CSS.escape(e):e.replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,function(t,n){return n?t==="\0"?"�":"".concat(t.slice(0,-1),"\\").concat(t.charCodeAt(t.length-1).toString(16)," "):"\\".concat(t)})}function hP(e,t){return e.matches?e.matches(t):e.msMatchesSelector?e.msMatchesSelector(t):!1}function XD(e){if(e.parentElement)return e.parentElement;for(;e.parentNode;){if(e.parentNode.nodeType===Node.ELEMENT_NODE)return e.parentNode;e=e.parentNode}return null}function OIt(e){if(e.classList)return e.classList;var t=(e.getAttribute("class")||"").trim();return t?t.split(/\s+/):[]}var Y2e=1,$It=(function(){function e(t){var n=this;this.map=new WeakMap,t&&t.forEach(function(r){return n.map.set(r,Y2e)})}return e.prototype.add=function(t){return this.map.set(t,Y2e),this},e.prototype.delete=function(t){return this.map.delete(t)},e.prototype.has=function(t){return this.map.has(t)},e})();function JGe(e){return e.nodeType===Node.TEXT_NODE}function DIt(e){return e.nodeType===Node.COMMENT_NODE}function ok(e){return e.nodeType===Node.ELEMENT_NODE}function AG(e){return ok(e)&&!!e.shadowRoot}function ome(e){var t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&ok(t.host)}function LIt(e){return e.childNodes.length>0||AG(e)}function ZGe(e,t){for(var n=e.firstChild;n;)t(n),n=n.nextSibling;AG(e)&&t(e.shadowRoot)}function TG(e){return ome(e)?e.host:e.parentNode}var ti={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:tO.ALLOW,MASK:tO.MASK,MASK_USER_INPUT:tO.MASK_USER_INPUT},ime="data-dd-privacy",FIt="hidden",zIt="dd-privacy-",A2="***",X2e="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",BIt={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},HIt="x";function Nb(e,t,n){if(n&&n.has(e))return n.get(e);var r=TG(e),o=r?Nb(r,t,n):t,i=tqe(e),s=eqe(i,o);return n&&n.set(e,s),s}function eqe(e,t){switch(t){case ti.HIDDEN:case ti.IGNORE:return t}switch(e){case ti.ALLOW:case ti.MASK:case ti.MASK_USER_INPUT:case ti.HIDDEN:case ti.IGNORE:return e;default:return t}}function tqe(e){if(ok(e)){if(e.tagName==="BASE")return ti.ALLOW;if(e.tagName==="INPUT"){var t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return ti.MASK;var n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return ti.MASK}if(hP(e,mP(ti.HIDDEN)))return ti.HIDDEN;if(hP(e,mP(ti.MASK)))return ti.MASK;if(hP(e,mP(ti.MASK_USER_INPUT)))return ti.MASK_USER_INPUT;if(hP(e,mP(ti.ALLOW)))return ti.ALLOW;if(UIt(e))return ti.IGNORE}}function kG(e,t){switch(t){case ti.MASK:case ti.HIDDEN:case ti.IGNORE:return!0;case ti.MASK_USER_INPUT:return JGe(e)?Q2e(e.parentNode):Q2e(e);default:return!1}}function Q2e(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;var t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!BIt[t.tagName]}var VIt=function(e){return e.replace(/\S/g,HIt)};function nqe(e,t,n){var r,o=(r=e.parentElement)===null||r===void 0?void 0:r.tagName,i=e.textContent||"";if(!(t&&!i.trim())){var s=n,l=o==="SCRIPT";if(l)i=A2;else if(s===ti.HIDDEN)i=A2;else if(kG(e,s))if(o==="DATALIST"||o==="SELECT"||o==="OPTGROUP"){if(!i.trim())return}else o==="OPTION"?i=A2:i=VIt(i);return i}}function UIt(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){var t=o("rel");return/preload|prefetch/i.test(t)&&o("as")==="script"||t==="shortcut icon"||t==="icon"}if(e.nodeName==="META"){var n=o("name"),t=o("rel"),r=o("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||t==="icon"||t==="apple-touch-icon"||t==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(r)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(r)||/^product:/.test(r)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function o(i){return(e.getAttribute(i)||"").toLowerCase()}return!1}function mP(e){return"[".concat(ime,'="').concat(e,'"], .').concat(zIt).concat(e)}var ame="data-dd-action-name",WIt="Masked Element";function GIt(e,t,n){var r=t.enablePrivacyForActionName,o=t.actionNameAttribute,i=J2e(e,ame)||o&&J2e(e,o);return i?{name:i,nameSource:"custom_attribute"}:n===ti.MASK?{name:WIt,nameSource:"mask_placeholder"}:Z2e(e,o,qIt,r)||Z2e(e,o,KIt,r)||{name:"",nameSource:"blank"}}function J2e(e,t){var n;if(ZIt())n=e.closest("[".concat(t,"]"));else for(var r=e;r;){if(r.hasAttribute(t)){n=r;break}r=XD(r)}if(n){var o=n.getAttribute(t);return oqe(rqe(o.trim()))}}var qIt=[function(e,t,n){if(JIt()){if("labels"in e&&e.labels&&e.labels.length>0)return cR(e.labels[0],t)}else if(e.id){var r=e.ownerDocument&&xC(e.ownerDocument.querySelectorAll("label"),function(o){return o.htmlFor===e.id});return r&&cR(r,t,n)}},function(e){if(e.nodeName==="INPUT"){var t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},function(e,t,n){if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return cR(e,t,n)},function(e){return z4(e,"aria-label")},function(e,t,n){var r=e.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map(function(o){return XIt(e,o)}).filter(function(o){return!!o}).map(function(o){return iqe(o,t,n)}).join(" "),nameSource:"text_content"}},function(e){return z4(e,"alt")},function(e){return z4(e,"name")},function(e){return z4(e,"title")},function(e){return z4(e,"placeholder")},function(e,t){if("options"in e&&e.options.length>0)return cR(e.options[0],t)}],KIt=[function(e,t,n){return cR(e,t,n)}],YIt=10;function Z2e(e,t,n,r){for(var o=e,i=0;i<=YIt&&o&&o.nodeName!=="BODY"&&o.nodeName!=="HTML"&&o.nodeName!=="HEAD";){for(var s=0,l=n;s100?"".concat(PWe(e,100)," [...]"):e}function XIt(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function z4(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function cR(e,t,n){return{name:iqe(e,t,n)||"",nameSource:"text_content"}}function iqe(e,t,n){if(!e.isContentEditable){if("innerText"in e){var r=e.innerText,o=function(i){for(var s=e.querySelectorAll(i),l=0;l0&&(r=r.replace(u,""))}}};return QIt()||o("script, style"),o("[".concat(ame,"]")),t&&o("[".concat(t,"]")),n&&o("".concat(mP(ti.HIDDEN),", ").concat(mP(ti.MASK))),r}return e.textContent}}function QIt(){return!iNt()}var IQ;function JIt(){return IQ===void 0&&(IQ="labels"in HTMLInputElement.prototype),IQ}var _Q;function ZIt(){return _Q===void 0&&(_Q="closest"in HTMLElement.prototype),_Q}var aqe=[ame,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],e5t=[lqe,n5t],t5t=[lqe,r5t,o5t];function QD(e,t){if(c5t(e)){for(var n,r=e;r&&r.nodeName!=="HTML";){var o=eCe(r,e5t,a5t,t,n);if(o)return o;var i=eCe(r,t5t,s5t,t,n);n=i||f3(i5t(r),n),r=XD(r)}return n}}function sqe(e){return/[0-9]/.test(e)}function n5t(e){if(e.id&&!sqe(e.id))return"#".concat(bC(e.id))}function r5t(e){if(e.tagName!=="BODY")for(var t=OIt(e),n=0;n").concat(t):e}var $8;function l5t(){if($8===void 0)try{document.querySelector(":scope"),$8=!0}catch{$8=!1}return $8}function c5t(e){return"isConnected"in e?e.isConnected:e.ownerDocument.documentElement.contains(e)}var cqe=Op,u5t=100;function d5t(e,t){var n=[],r=0,o;i(e);function i(c){c.stopObservable.subscribe(s),n.push(c),Qm(o),o=Vf(l,cqe)}function s(){r===1&&n.every(function(c){return c.isStopped()})&&(r=2,t(n))}function l(){Qm(o),r===0&&(r=1,s())}return{tryAppend:function(c){return r!==0?!1:n.length>0&&!f5t(n[n.length-1].event,c.event)?(l(),!1):(i(c),!0)},stop:function(){l()}}}function f5t(e,t){return e.target===t.target&&p5t(e,t)<=u5t&&e.timeStamp-t.timeStamp<=cqe}function p5t(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function h5t(e,t){var n=t.onPointerDown,r=t.onPointerUp,o,i={selection:!1,input:!1,scroll:!1},s,l=[Kl(e,window,"pointerdown",function(c){nCe(c)&&(o=tCe(),i={selection:!1,input:!1,scroll:!1},s=n(c))},{capture:!0}),Kl(e,window,"selectionchange",function(){(!o||!tCe())&&(i.selection=!0)},{capture:!0}),Kl(e,window,"scroll",function(){i.scroll=!0},{capture:!0,passive:!0}),Kl(e,window,"pointerup",function(c){if(nCe(c)&&s){var u=i;r(s,c,function(){return u}),s=void 0}},{capture:!0}),Kl(e,window,"input",function(){i.input=!0},{capture:!0})];return{stop:function(){l.forEach(function(c){return c.stop()})}}}function tCe(){var e=window.getSelection();return!e||e.isCollapsed}function nCe(e){return e.target instanceof Element&&e.isPrimary!==!1}var rCe=3;function m5t(e,t){if(g5t(e))return t.addFrustration("rage_click"),e.some(oCe)&&t.addFrustration("dead_click"),t.hasError&&t.addFrustration("error_click"),{isRage:!0};var n=e.some(function(r){return r.getUserActivity().selection});return e.forEach(function(r){r.hasError&&r.addFrustration("error_click"),oCe(r)&&!n&&r.addFrustration("dead_click")}),{isRage:!1}}function g5t(e){if(e.some(function(n){return n.getUserActivity().selection||n.getUserActivity().scroll}))return!1;for(var t=0;tuqe&&nO.delete(r)})}var v5t=5*ym;function b5t(e,t,n,r){var o=rk({expireDelay:v5t}),i=new us,s;e.subscribe(10,function(){o.reset()}),e.subscribe(5,d);var l=h5t(r,{onPointerDown:function(p){return w5t(r,e,t,p,n)},onPointerUp:function(p,h,m){var g=p.clickActionBase,y=p.hadActivityOnPointerDown;S5t(r,e,t,n,o,i,u,g,h,m,y)}}).stop,c={findActionId:function(p){return o.findAll(p)}};return{stop:function(){d(),i.notify(),l()},actionContexts:c};function u(p){if(!s||!s.tryAppend(p)){var h=p.clone();s=d5t(p,function(m){N5t(m,h)})}}function d(){s&&s.stop()}}function w5t(e,t,n,r,o){var i=e.enablePrivacyForActionName?Nb(r.target,e.defaultPrivacyLevel):ti.ALLOW;if(i!==ti.HIDDEN){var s=C5t(r,i,e),l=!1;return rme(t,n,o,e,function(c){l=c.hadActivity},QGe),{clickActionBase:s,hadActivityOnPointerDown:function(){return l}}}}function S5t(e,t,n,r,o,i,s,l,c,u,d){var p,h=fqe(t,o,u,l,c);s(h);var m=(p=l==null?void 0:l.target)===null||p===void 0?void 0:p.selector;m&&dqe(c.timeStamp,m);var g=rme(t,n,r,e,function(v){v.hadActivity&&v.end0},get hasPageActivity(){return d!==void 0},getUserActivity:n,addFrustration:function(g){p.push(g)},startClocks:s,isStopped:function(){return u===1||u===2},clone:function(){return fqe(e,t,n,r,o)},validate:function(g){if(m(),u===1){var y=c.eventCounts,x=y.resourceCount,v=y.errorCount,b=y.longTaskCount,w=Wo({type:"click",duration:d&&Wf(s.timeStamp,d),startClocks:s,id:i,frustrationTypes:p,counts:{resourceCount:x,errorCount:v,longTaskCount:b},events:g??[o],event:o},r);e.notify(0,w),u=2}},discard:function(){m(),u=2}}}function N5t(e,t){var n=m5t(e,t).isRage;n?(e.forEach(function(r){return r.discard()}),t.stop(fu()),t.validate(e.map(function(r){return r.event}))):(t.discard(),e.forEach(function(r){return r.validate()}))}function j5t(e,t,n,r,o){var i;e.subscribe(0,function(c){return e.notify(12,iCe(c,o))});var s={findActionId:Ea},l=Ea;return r.trackUserInteractions&&(i=b5t(e,t,n,r),s=i.actionContexts,l=i.stop),{addAction:function(c,u){e.notify(12,Wo({savedCommonContext:u},iCe(c,o)))},actionContexts:s,stop:l}}function iCe(e,t){var n=D8(e)?{action:{id:e.id,loading_time:YGe(aa(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:aw(A0.ACTION_NAME_MASKING)?e.nameSource:void 0}}}:void 0,r=D8(e)?void 0:e.context,o=ug({action:{id:$p(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:"action",view:{in_foreground:t.wasInPageStateAt("active",e.startClocks.relative)}},n),i=D8(e)?{events:e.events}:{};return!D8(e)&&e.handlingStack&&(i.handlingStack=e.handlingStack),{customerContext:r,rawRumEvent:o,startTime:e.startClocks.relative,domainContext:i}}function D8(e){return e.type!=="custom"}function E5t(e){var t=EGe([Pu.error]).subscribe(function(n){return e.notify(n.error)});return{stop:function(){t.unsubscribe()}}}function I5t(e,t){var n=ZWe(e,[QA.cspViolation,QA.intervention]).subscribe(function(r){return t.notify(r)});return{stop:function(){n.unsubscribe()}}}function _5t(e,t,n,r){var o=new us;return E5t(o),XWe(o),I5t(t,o),o.subscribe(function(i){return e.notify(14,{error:i})}),P5t(e,n,r)}function P5t(e,t,n){return e.subscribe(14,function(r){var o=r.error,i=r.customerContext,s=r.savedCommonContext;e.notify(12,Wo({customerContext:i,savedCommonContext:s},A5t(o,t,n)))}),{addError:function(r,o){var i=r.error,s=r.handlingStack,l=r.startClocks,c=r.context,u=$w(i)?Cb(i):void 0,d=Xhe({stackTrace:u,originalError:i,handlingStack:s,startClocks:l,nonErrorPrefix:"Provided",source:vm.CUSTOM,handling:"handled"});e.notify(14,{customerContext:c,savedCommonContext:o,error:d})}}}function A5t(e,t,n){var r={date:e.startClocks.timeStamp,error:{id:$p(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:"error",view:{in_foreground:t.wasInPageStateAt("active",e.startClocks.relative)}},o=n.findFeatureFlagEvaluations(e.startClocks.relative);o&&!yC(o)&&(r.feature_flags=o);var i={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:r,startTime:e.startClocks.relative,domainContext:i}}function T5t(e,t){var n=rb(t,{type:sl.LONG_TASK,buffered:!0}).subscribe(function(r){for(var o=0,i=r;o=t-r&&pqe(e)<=ZT(n,r)}var R5t=2*ym;function O5t(e){var t=$5t(e)||D5t(e);if(!(!t||t.traceTime<=_0()-R5t))return t.traceId}function $5t(e){var t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return hqe(t&&t.content,n&&n.content)}function D5t(e){var t=L5t(e);if(t)return hqe(c3(t,"trace-id"),c3(t,"trace-time"))}function hqe(e,t){var n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function L5t(e){for(var t=0;t=0;t-=1){var r=e.body.childNodes[t],n=sCe(r);if(n)return n;if(!JGe(r))break}}function sCe(e){if(e&&DIt(e)){var t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function mqe(){if(PG(sl.NAVIGATION)){var e=performance.getEntriesByType(sl.NAVIGATION)[0];if(e)return e}var t=F5t(),n=Wo({entryType:sl.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:t.responseEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:function(){return Wo({},n,{toJSON:void 0})}},t);return n}function F5t(){var e={},t=performance.timing;for(var n in t)if(WD(t[n])){var r=n,o=t[r];e[r]=o===0?0:bG(o)}return e}function z5t(e,t){Zhe(e,"interactive",function(){var n=Wo(mqe().toJSON(),{entryType:sl.RESOURCE,initiatorType:BGe,traceId:O5t(document),toJSON:function(){return Wo({},n,{toJSON:void 0})}});t(n)})}function B5t(e,t,n,r,o){r===void 0&&(r=hEt()),o===void 0&&(o=z5t),e.subscribe(8,function(l){s(function(){return H5t(l,t,n)})});var i=rb(t,{type:sl.RESOURCE,buffered:!0}).subscribe(function(l){for(var c=function(h){xIt(h)||s(function(){return lCe(h,t)})},u=0,d=l;u=0?s:0,time:i.startTime,targetSelector:l})}});return{stop:function(){r.unsubscribe()}}}function Q5t(e,t,n){return n===void 0&&(n=mqe),e_t(e,function(){var r=n();Z5t(r)||t(J5t(r))})}function J5t(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=P0()?e.responseStart:void 0}}function Z5t(e){return e.loadEventEnd<=0}function e_t(e,t){var n,r=Zhe(e,"complete",function(){n=Vf(function(){return t()})}).stop;return{stop:function(){r(),Qm(n)}}}var t_t=10*ym;function n_t(e,t,n,r){var o=1/0,i=fm(e,n,["pointerdown","keydown"],function(c){o=c.timeStamp},{capture:!0,once:!0}).stop,s=0,l=rb(e,{type:sl.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(function(c){var u=XCt(c,function(p){return p.entryType===sl.LARGEST_CONTENTFUL_PAINT&&p.startTimes});if(u){var d=void 0;u.element&&(d=QD(u.element,e.actionNameAttribute)),r({value:u.startTime,targetSelector:d}),s=u.size}});return{stop:function(){i(),l.unsubscribe()}}}function xqe(e,t){t===void 0&&(t=window);var n,r;return document.visibilityState==="hidden"?n=0:(n=1/0,r=fm(e,t,["pagehide","visibilitychange"],function(o){(o.type==="pagehide"||document.visibilityState==="hidden")&&(n=o.timeStamp,r())},{capture:!0}).stop),{get timeStamp(){return n},stop:function(){r==null||r()}}}function r_t(e,t,n){var r={},o=Q5t(e,function(d){t(d.loadEvent),r.navigationTimings=d,n()}).stop,i=xqe(e),s=Y5t(e,i,function(d){r.firstContentfulPaint=d,n()}).stop,l=n_t(e,i,window,function(d){r.largestContentfulPaint=d,n()}).stop,c=X5t(e,i,function(d){r.firstInput=d,n()}).stop;function u(){o(),s(),l(),c(),i.stop()}return{stop:u,initialViewMetrics:r}}function o_t(e,t,n){if(!c_t())return{stop:Ea};var r=0,o,i;n({value:0});var s=l_t(),l=rb(e,{type:sl.LAYOUT_SHIFT,buffered:!0}).subscribe(function(c){for(var u=0,d=c;ur){r=m;var y=o==null?void 0:o.deref();n({value:yH(r,4),targetSelector:y&&QD(y,e.actionNameAttribute),time:i})}}}});return{stop:function(){l.unsubscribe()}}}function i_t(e){var t;if(e)return(t=xC(e,function(n){return!!n.node&&ok(n.node)}))===null||t===void 0?void 0:t.node}var a_t=5*Op,s_t=Op;function l_t(){var e=0,t,n,r=0;return{update:function(o){var i=t===void 0||o.startTime-n>=s_t||o.startTime-t>=a_t,s;return i?(t=n=o.startTime,r=e=o.value,s=!0):(e+=o.value,n=o.startTime,s=o.value>r,s&&(r=o.value)),{cumulatedValue:e,isMaxValue:s}}}}function c_t(){return PG(sl.LAYOUT_SHIFT)&&"WeakRef"in window}var kz,yqe=0,PQ=1/0,AQ=0;function u_t(){"interactionCount"in performance||kz||(kz=new window.PerformanceObserver(to(function(e){e.getEntries().forEach(function(t){var n=t;n.interactionId&&(PQ=Math.min(PQ,n.interactionId),AQ=Math.max(AQ,n.interactionId),yqe=(AQ-PQ)/7+1)})})),kz.observe({type:"event",buffered:!0,durationThreshold:0}))}var cCe=function(){return kz?yqe:window.performance.interactionCount||0},uCe=10,d_t=1*ym;function f_t(e,t,n){if(!m_t())return{getInteractionToNextPaint:function(){},setViewEnd:Ea,stop:Ea};var r=h_t(n),o=r.getViewInteractionCount,i=r.stopViewInteractionCount,s=1/0,l=p_t(o),c=-1,u,d;function p(g){for(var y=0,x=g;y=t&&v.startTime<=s&&l.process(v)}var b=l.estimateP98Interaction();b&&b.duration!==c&&(c=b.duration,d=Wf(t,b.startTime),u=y5t(b.startTime),!u&&b.target&&ok(b.target)&&(u=QD(b.target,e.actionNameAttribute)))}var h=rb(e,{type:sl.FIRST_INPUT,buffered:!0}).subscribe(p),m=rb(e,{type:sl.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:function(){if(c>=0)return{value:Math.min(c,d_t),targetSelector:u,time:d};if(o())return{value:0}},setViewEnd:function(g){s=g,i()},stop:function(){m.unsubscribe(),h.unsubscribe()}}}function p_t(e){var t=[];function n(){t.sort(function(r,o){return o.duration-r.duration}).splice(uCe)}return{process:function(r){var o=t.findIndex(function(s){return r.interactionId===s.interactionId}),i=t[t.length-1];o!==-1?r.duration>t[o].duration&&(t[o]=r,n()):(t.lengthi.duration)&&(t.push(r),n())},estimateP98Interaction:function(){var r=Math.min(t.length-1,Math.floor(e()/50));return t[r]}}}function h_t(e){u_t();var t=e==="initial_load"?0:cCe(),n={stopped:!1};function r(){return cCe()-t}return{getViewInteractionCount:function(){return n.stopped?n.interactionCount:r()},stopViewInteractionCount:function(){n={stopped:!0,interactionCount:r()}}}}function m_t(){return PG(sl.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function g_t(e,t,n,r,o,i,s){var l=o==="initial_load",c=!0,u=[],d=xqe(r);function p(){if(!c&&!l&&u.length>0){var m=Math.max.apply(Math,u);mo&&(o=u,h=!0),p>i){i=p;var m=P0();s=Wf(t.relative,m),h=!0}h&&n({maxDepth:Math.min(o,i),maxDepthScrollTop:d,maxScrollHeight:i,maxScrollHeightTime:s})});return{stop:function(){return l.unsubscribe()}}}function b_t(){var e=sme(),t=p3().height,n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(t+e);return{scrollHeight:n,scrollDepth:r,scrollTop:e}}function w_t(e,t){return t===void 0&&(t=y_t),new us(function(n){function r(){n.notify(b_t())}if(window.ResizeObserver){var o=Ow(r,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,s=new ResizeObserver(to(o.throttled));i&&s.observe(i);var l=Kl(e,window,"scroll",o.throttled,{passive:!0});return function(){o.cancel(),s.disconnect(),l.stop()}}})}function S_t(e,t,n,r,o,i,s){var l={},c=g_t(e,t,n,r,i,s,function(v){l.loadingTime=v,o()}),u=c.stop,d=c.setLoadEvent,p=v_t(r,s,function(v){l.scroll=v}).stop,h=o_t(r,s.relative,function(v){l.cumulativeLayoutShift=v,o()}).stop,m=f_t(r,s.relative,i),g=m.stop,y=m.getInteractionToNextPaint,x=m.setViewEnd;return{stop:function(){u(),h(),p()},stopINPTracking:g,setLoadEvent:d,setViewEnd:x,getCommonViewMetrics:function(){return l.interactionToNextPaint=y(),l}}}var C_t=3e3,N_t=5*ym,j_t=5*ym;function E_t(e,t,n,r,o,i,s,l){var c=new Set,u=p("initial_load",jWe(),l);h();var d;s&&(d=m(i));function p(g,y,x){var v=I_t(t,n,r,o,e,g,y,x);return c.add(v),v.stopObservable.subscribe(function(){c.delete(v)}),v}function h(){t.subscribe(10,function(){u=p("route_change",void 0,{name:u.name,service:u.service,version:u.version,context:u.contextManager.getContext()})}),t.subscribe(9,function(){u.end({sessionIsActive:!1})}),t.subscribe(11,function(g){g.reason===tA.UNLOADING&&u.end()})}function m(g){return g.subscribe(function(y){var x=y.oldLocation,v=y.newLocation;P_t(x,v)&&(u.end(),u=p("route_change"))})}return{addTiming:function(g,y){y===void 0&&(y=fu()),u.addTiming(g,y)},startView:function(g,y){u.end({endClocks:y}),u=p("route_change",y,g)},setViewContext:function(g){u.contextManager.setContext(g)},setViewContextProperty:function(g,y){u.contextManager.setContextProperty(g,y)},setViewName:function(g){u.setViewName(g)},stop:function(){d&&d.unsubscribe(),u.end(),c.forEach(function(g){return g.stop()})}}}function I_t(e,t,n,r,o,i,s,l){s===void 0&&(s=Tp());var c=$p(),u=new us,d={},p=0,h,m=l3(o),g=JA(),y=!0,x,v,b,w;l&&(x=l.name,v=l.service||void 0,b=l.version||void 0,l.context&&(w=l.context,g.setContext(w)));var S={id:c,name:x,startClocks:s,service:v,version:b,context:w};e.notify(1,S),e.notify(2,S);var C=Ow(H,C_t,{leading:!1}),N=C.throttled,j=C.cancel,I=S_t(e,t,n,r,N,i,s),_=I.setLoadEvent,T=I.setViewEnd,P=I.stop,E=I.stopINPTracking,M=I.getCommonViewMetrics,R=i==="initial_load"?r_t(r,_,N):{stop:Ea,initialViewMetrics:{}},$=R.stop,D=R.initialViewMetrics,z=q5t(e,c,N),V=z.stop,B=z.eventCounts,G=ek(H,N_t);H(),g.changeObservable.subscribe(function(){e.notify(3,{id:c,name:x,context:g.getContext(),startClocks:s}),N()});function H(){j(),p+=1;var F=h===void 0?fu():h.timeStamp;e.notify(4,{customTimings:d,documentVersion:p,id:c,name:x,service:v,version:b,context:g.getContext(),loadingType:i,location:m,startClocks:s,commonViewMetrics:M(),initialViewMetrics:D,duration:Wf(s.timeStamp,F),isActive:h===void 0,sessionIsActive:y,eventCounts:B})}return{get name(){return x},service:v,version:b,contextManager:g,stopObservable:u,end:function(F){var W=this,U,K;F===void 0&&(F={}),!h&&(h=(U=F.endClocks)!==null&&U!==void 0?U:Tp(),y=(K=F.sessionIsActive)!==null&&K!==void 0?K:!0,e.notify(5,{endClocks:h}),e.notify(6,{endClocks:h}),SG(G),T(h.relative),P(),H(),Vf(function(){W.stop()},j_t))},stop:function(){$(),V(),E(),u.notify()},addTiming:function(F,W){if(!h){var U=qCt(W)?W:Wf(s.timeStamp,W);d[__t(F)]=U,N()}},setViewName:function(F){x=F,H()}}}function __t(e){var t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&Pa.warn("Invalid timing name: ".concat(e,", sanitized to: ").concat(t)),t}function P_t(e,t){return e.pathname!==t.pathname||!A_t(t.hash)&&dCe(t.hash)!==dCe(e.hash)}function A_t(e){var t=e.substring(1);return t!==""&&!!document.getElementById(t)}function dCe(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}function T_t(e,t,n,r,o,i,s,l,c,u){return e.subscribe(4,function(d){return e.notify(12,k_t(d,t,s,c,l))}),E_t(n,e,r,o,t,i,!t.trackViewsManually,u)}function k_t(e,t,n,r,o){var i,s,l,c,u,d,p,h,m,g,y,x,v,b,w,S,C=r.getReplayStats(e.id),N=n.findFeatureFlagEvaluations(e.startClocks.relative),j=o.findAll(e.startClocks.relative,e.duration),I={_dd:{document_version:e.documentVersion,replay_stats:C,page_states:j,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:"view",view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(i=e.commonViewMetrics.cumulativeLayoutShift)===null||i===void 0?void 0:i.value,cumulative_layout_shift_time:aa((s=e.commonViewMetrics.cumulativeLayoutShift)===null||s===void 0?void 0:s.time),cumulative_layout_shift_target_selector:(l=e.commonViewMetrics.cumulativeLayoutShift)===null||l===void 0?void 0:l.targetSelector,first_byte:aa((c=e.initialViewMetrics.navigationTimings)===null||c===void 0?void 0:c.firstByte),dom_complete:aa((u=e.initialViewMetrics.navigationTimings)===null||u===void 0?void 0:u.domComplete),dom_content_loaded:aa((d=e.initialViewMetrics.navigationTimings)===null||d===void 0?void 0:d.domContentLoaded),dom_interactive:aa((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:aa(e.initialViewMetrics.firstContentfulPaint),first_input_delay:aa((h=e.initialViewMetrics.firstInput)===null||h===void 0?void 0:h.delay),first_input_time:aa((m=e.initialViewMetrics.firstInput)===null||m===void 0?void 0:m.time),first_input_target_selector:(g=e.initialViewMetrics.firstInput)===null||g===void 0?void 0:g.targetSelector,interaction_to_next_paint:aa((y=e.commonViewMetrics.interactionToNextPaint)===null||y===void 0?void 0:y.value),interaction_to_next_paint_time:aa((x=e.commonViewMetrics.interactionToNextPaint)===null||x===void 0?void 0:x.time),interaction_to_next_paint_target_selector:(v=e.commonViewMetrics.interactionToNextPaint)===null||v===void 0?void 0:v.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:aa((b=e.initialViewMetrics.largestContentfulPaint)===null||b===void 0?void 0:b.value),largest_contentful_paint_target_selector:(w=e.initialViewMetrics.largestContentfulPaint)===null||w===void 0?void 0:w.targetSelector,load_event:aa((S=e.initialViewMetrics.navigationTimings)===null||S===void 0?void 0:S.loadEvent),loading_time:YGe(aa(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},resource:{count:e.eventCounts.resourceCount},time_spent:aa(e.duration)},feature_flags:N&&!yC(N)?N:void 0,display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:aa(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,session:{has_replay:C?!0:void 0,is_active:e.sessionIsActive?void 0:!1},privacy:{replay_level:t.defaultPrivacyLevel}};return yC(e.customTimings)||(I.view.custom_timings=ZCt(e.customTimings,aa)),{rawRumEvent:I,startTime:e.startClocks.relative,domainContext:{location:e.location}}}var M_t="rum";function R_t(e,t,n){var r=cGe(e,M_t,function(o){return $_t(e,o)},n);return r.expireObservable.subscribe(function(){t.notify(9)}),r.renewObservable.subscribe(function(){t.notify(10)}),r.sessionStateUpdateObservable.subscribe(function(o){var i=o.previousState,s=o.newState;if(!i.forcedReplay&&s.forcedReplay){var l=r.findSession();l&&(l.isReplayForced=!0)}}),{findTrackedSession:function(o){var i=r.findSession(o);if(!(!i||!wqe(i.trackingType)))return{id:i.id,sessionReplay:i.trackingType==="1"?1:i.isReplayForced?2:0,anonymousId:i.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:function(){return r.updateSessionState({forcedReplay:"1"})}}}function O_t(){var e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:bGe("records")?1:0};return{findTrackedSession:function(){return e},expire:Ea,expireObservable:new us,setForcedReplay:Ea}}function $_t(e,t){var n;return D_t(t)?n=t:Q2(e.sessionSampleRate)?Q2(e.sessionReplaySampleRate)?n="1":n="2":n="0",{trackingType:n,isTracked:wqe(n)}}function D_t(e){return e==="0"||e==="1"||e==="2"}function wqe(e){return e==="2"||e==="1"}function L_t(e,t,n,r,o,i,s){var l=e.replica,c=Jhe(e,{endpoint:e.rumEndpointBuilder,encoder:s(2)},l&&{endpoint:l.rumEndpointBuilder,transformMessage:function(u){return ug(u,{application:{id:l.applicationId}})},encoder:s(3)},r,o,i);return t.subscribe(13,function(u){u.type==="view"?c.upsert(u,u.view.id):c.add(u)}),n.subscribe(function(u){return c.add(u,sGe(e))}),c}function F_t(e){var t=YC();e.subscribe(13,function(n){t.send("rum",n)})}var z_t=WI;function B_t(e,t,n){var r=rk({expireDelay:z_t}),o;e.subscribe(1,function(l){var c=l.startClocks,u=n.href;r.add(s({url:u,referrer:o||document.referrer}),c.relative),o=u}),e.subscribe(6,function(l){var c=l.endClocks;r.closeActive(c.relative)});var i=t.subscribe(function(l){var c=l.newLocation,u=r.find();if(u){var d=P0();r.closeActive(d),r.add(s({url:c.href,referrer:u.referrer}),d)}});function s(l){var c=l.url,u=l.referrer;return{url:c,referrer:u}}return{findUrl:function(l){return r.find(l)},stop:function(){i.unsubscribe(),r.stop()}}}function H_t(e,t){var n=l3(t);return new us(function(r){var o=V_t(e,s).stop,i=U_t(e,s).stop;function s(){if(n.href!==t.href){var l=l3(t);r.notify({newLocation:l,oldLocation:n}),n=l}}return function(){o(),i()}})}function V_t(e,t){var n=am(fCe("pushState"),"pushState",function(i){var s=i.onPostCall;s(t)}).stop,r=am(fCe("replaceState"),"replaceState",function(i){var s=i.onPostCall;s(t)}).stop,o=Kl(e,window,"popstate",t).stop;return{stop:function(){n(),r(),o()}}}function U_t(e,t){return Kl(e,window,"hashchange",t)}function fCe(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}var W_t=WI;function G_t(e,t){var n=rk({expireDelay:W_t});return e.subscribe(1,function(r){var o=r.startClocks;n.add({},o.relative),t.resetCustomerData()}),e.subscribe(6,function(r){var o=r.endClocks;n.closeActive(o.relative)}),{findFeatureFlagEvaluations:function(r){return n.find(r)},addFeatureFlagEvaluation:function(r,o){var i=n.find();i&&(i[r]=o,t.updateCustomerData(i))},stop:function(){return t.stop()}}}var q_t=10*Op,w1,fj,nie;function K_t(e,t,n,r,o){var i=t.enabled&&Q2(e.customerDataTelemetrySampleRate);i&&(Sqe(),pCe(),n.subscribe(13,function(s){nie=!0,B4(fj.globalContextBytes,r.getOrCreateTracker(2).getBytesCount()),B4(fj.userContextBytes,r.getOrCreateTracker(1).getBytesCount()),B4(fj.featureFlagBytes,Sh(["view","error"],s.type)?r.getOrCreateTracker(0).getBytesCount():0)}),o.subscribe(function(s){var l=s.bytesCount,c=s.messagesCount;nie&&(w1.batchCount+=1,B4(w1.batchBytesCount,l),B4(w1.batchMessagesCount,c),kQ(w1.globalContextBytes,fj.globalContextBytes),kQ(w1.userContextBytes,fj.userContextBytes),kQ(w1.featureFlagBytes,fj.featureFlagBytes),pCe())}),ek(Y_t,q_t))}function Y_t(){w1.batchCount!==0&&(KC("Customer data measures",w1),Sqe())}function p2(){return{min:1/0,max:0,sum:0}}function B4(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function kQ(e,t){e.sum+=t.sum,e.min=Math.min(e.min,t.min),e.max=Math.max(e.max,t.max)}function Sqe(){w1={batchCount:0,batchBytesCount:p2(),batchMessagesCount:p2(),globalContextBytes:p2(),userContextBytes:p2(),featureFlagBytes:p2()}}function pCe(){nie=!1,fj={globalContextBytes:p2(),userContextBytes:p2(),featureFlagBytes:p2()}}var X_t=4e3,Q_t=500,J_t=WI;function Z_t(e,t){t===void 0&&(t=Q_t);var n=rk({expireDelay:J_t,maxEntries:X_t}),r;i(Cqe(),P0());var o=fm(e,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],function(l){i(ePt(l),l.timeStamp)},{capture:!0}).stop;function i(l,c){c===void 0&&(c=P0()),l!==r&&(r=l,n.closeActive(c),n.add({state:r,startTime:c},c))}var s={findAll:function(l,c){var u=n.findAll(l,c);if(u.length!==0){for(var d=[],p=Math.max(0,u.length-t),h=u.length-1;h>=p;h--){var m=u[h],g=Wf(l,m.startTime);d.push({state:m.state,start:aa(g)})}return d}},wasInPageStateAt:function(l,c){return s.wasInPageStateDuringPeriod(l,c,0)},wasInPageStateDuringPeriod:function(l,c,u){return n.findAll(c,u).some(function(d){return d.state===l})},addPageState:i,stop:function(){o(),n.stop()}};return s}function ePt(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":Cqe()}function Cqe(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function tPt(e){var t,n;aw(A0.DELAY_VIEWPORT_COLLECTION)?n=requestAnimationFrame(function(){t=p3()}):t=p3();var r=bqe(e).subscribe(function(o){t=o}).unsubscribe;return{get:function(){return t?{viewport:t}:void 0},stop:function(){r(),n&&cancelAnimationFrame(n)}}}function nPt(e,t){var n=window.cookieStore?rPt(e):iPt;return new us(function(r){return n(t,function(o){return r.notify(o)})})}function rPt(e){return function(t,n){var r=Kl(e,window.cookieStore,"change",function(o){var i=xC(o.changed,function(s){return s.name===t})||xC(o.deleted,function(s){return s.name===t});i&&n(i.value)});return r.stop}}var oPt=Op;function iPt(e,t){var n=c3(document.cookie,e),r=ek(function(){var o=c3(document.cookie,e);o!==n&&t(o)},oPt);return function(){SG(r)}}var hCe="datadog-ci-visibility-test-execution-id";function aPt(e,t){var n;t===void 0&&(t=nPt(e,hCe));var r=P2(hCe)||((n=window.Cypress)===null||n===void 0?void 0:n.env("traceId")),o=t.subscribe(function(i){r=i});return{get:function(){if(typeof r=="string")return{test_execution_id:r}},stop:function(){return o.unsubscribe()}}}function sPt(e,t){var n=rb(t,{type:sl.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(function(r){for(var o=0,i=r;ohPt&&bPt()),t}function bPt(){if(lh)if(lh.keys){var e=lh.keys().next().value;e&&lh.delete(e)}else{var t=!0;lh.forEach(function(n,r){t&&(lh.delete(r),t=!1)})}}var lme=new WeakMap;function Gv(e){return lme.has(e)}function wPt(e){for(var t=e;t;){if(!Gv(t)&&!ome(t))return!1;t=TG(t)}return!0}function om(e){return lme.get(e)}function SPt(e,t){lme.set(e,t)}function cme(e,t){var n=e.tagName,r=e.value;if(kG(e,t)){var o=e.type;return n==="INPUT"&&(o==="button"||o==="submit"||o==="reset")?r:!r||n==="OPTION"?void 0:A2}if(n==="OPTION"||n==="SELECT")return e.value;if(!(n!=="INPUT"&&n!=="TEXTAREA"))return r}var CPt=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,NPt=/^[A-Za-z]+:|^\/\//,jPt=/^data:.*,/i;function EPt(e,t){return e.replace(CPt,function(n,r,o,i,s,l){var c=o||s||l;if(!t||!c||NPt.test(c)||jPt.test(c))return n;var u=r||i||"";return"url(".concat(u).concat(IPt(c,t)).concat(u,")")})}function IPt(e,t){try{return CG(e,t).href}catch{return e}}var _Pt=/[^a-z1-6-_]/;function Nqe(e){var t=e.toLowerCase().trim();return _Pt.test(t)?"div":t}function mCe(e,t){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='".concat(e,"' height='").concat(t,"' style='background-color:silver'%3E%3C/svg%3E")}var Av={FullSnapshot:2,IncrementalSnapshot:3,Meta:4,Focus:6,ViewEnd:7,VisualViewport:8,FrustrationRecord:9},JE={Document:0,DocumentType:1,Element:2,Text:3,CDATA:4,DocumentFragment:11},d0={Mutation:0,MouseMove:1,MouseInteraction:2,Scroll:3,ViewportResize:4,Input:5,TouchMove:6,MediaInteraction:7,StyleSheetRule:8},Ix={MouseUp:0,MouseDown:1,Click:2,ContextMenu:3,DblClick:4,Focus:5,Blur:6,TouchStart:7,TouchEnd:9},gCe={Play:0,Pause:1};function jqe(e){if(!(e===void 0||e.length===0))return e.map(function(t){var n=t.cssRules||t.rules,r=Array.from(n,function(i){return i.cssText}),o={cssRules:r,disabled:t.disabled||void 0,media:t.media.length>0?Array.from(t.media):void 0};return o})}function Eqe(e,t,n,r){if(t===ti.HIDDEN)return null;var o=e.getAttribute(n);if(t===ti.MASK&&n!==ime&&!aqe.includes(n)&&n!==r.actionNameAttribute){var i=e.tagName;switch(n){case"title":case"alt":case"placeholder":return A2}if(i==="IMG"&&(n==="src"||n==="srcset")){var s=e;if(s.naturalWidth>0)return mCe(s.naturalWidth,s.naturalHeight);var l=e.getBoundingClientRect(),c=l.width,u=l.height;return c>0||u>0?mCe(c,u):X2e}if(i==="SOURCE"&&(n==="src"||n==="srcset"))return X2e;if(i==="A"&&n==="href"||o&&qD(n,"data-")||i==="IFRAME"&&n==="srcdoc")return A2}return!o||typeof o!="string"?o:GGe(o)?qGe(o):o}function PPt(e,t,n){var r;if(t===ti.HIDDEN)return{};for(var o={},i=Nqe(e.tagName),s=e.ownerDocument,l=0;lxCe||Math.abs(e.pageLeft-e.offsetLeft-window.scrollX)>xCe}var WPt=function(e,t){var n=window.visualViewport,r={layoutViewportX:e,layoutViewportY:t,visualViewportX:e,visualViewportY:t};if(n)UPt(n)?(r.layoutViewportX=Math.round(e+n.offsetLeft),r.layoutViewportY=Math.round(t+n.offsetTop)):(r.visualViewportX=Math.round(e-n.offsetLeft),r.visualViewportY=Math.round(t-n.offsetTop));else return r;return r},Pqe=function(e){return{scale:e.scale,offsetLeft:e.offsetLeft,offsetTop:e.offsetTop,pageLeft:e.pageLeft,pageTop:e.pageTop,height:e.height,width:e.width}};function Gx(e,t){return{data:Wo({source:e},t),type:Av.IncrementalSnapshot,timestamp:fu()}}var GPt=50;function qPt(e,t){var n=Ow(function(s){var l=JD(s);if(Gv(l)){var c=Aqe(s);if(!c)return;var u={id:om(l),timeOffset:0,x:c.x,y:c.y};t(Gx(_qe(s)?d0.TouchMove:d0.MouseMove,{positions:[u]}))}},GPt,{trailing:!1}),r=n.throttled,o=n.cancel,i=fm(e,document,["mousemove","touchmove"],r,{capture:!0,passive:!0}).stop;return{stop:function(){i(),o()}}}function Aqe(e){var t=_qe(e)?e.changedTouches[0]:e,n=t.clientX,r=t.clientY;if(window.visualViewport){var o=WPt(n,r),i=o.visualViewportX,s=o.visualViewportY;n=i,r=s}if(!Number.isFinite(n)||!Number.isFinite(r)){e.isTrusted&&KC("mouse/touch event without x/y");return}return{x:n,y:r}}var dx,yCe=(dx={},dx.pointerup=Ix.MouseUp,dx.mousedown=Ix.MouseDown,dx.click=Ix.Click,dx.contextmenu=Ix.ContextMenu,dx.dblclick=Ix.DblClick,dx.focus=Ix.Focus,dx.blur=Ix.Blur,dx.touchstart=Ix.TouchStart,dx.touchend=Ix.TouchEnd,dx);function KPt(e,t,n){var r=function(o){var i=JD(o);if(!(Nb(i,e.defaultPrivacyLevel)===ti.HIDDEN||!Gv(i))){var s=om(i),l=yCe[o.type],c;if(l!==Ix.Blur&&l!==Ix.Focus){var u=Aqe(o);if(!u)return;c={id:s,type:l,x:u.x,y:u.y}}else c={id:s,type:l};var d=Wo({id:n.getIdForEvent(o)},Gx(d0.MouseInteraction,c));t(d)}};return fm(e,document,Object.keys(yCe),r,{capture:!0,passive:!0})}var YPt=100;function Tqe(e,t,n,r){r===void 0&&(r=document);var o=Ow(function(c){var u=JD(c);if(!(!u||Nb(u,e.defaultPrivacyLevel)===ti.HIDDEN||!Gv(u))){var d=om(u),p=u===document?{scrollTop:sme(),scrollLeft:vqe()}:{scrollTop:Math.round(u.scrollTop),scrollLeft:Math.round(u.scrollLeft)};n.set(u,p),t(Gx(d0.Scroll,{id:d,x:p.scrollLeft,y:p.scrollTop}))}},YPt),i=o.throttled,s=o.cancel,l=Kl(e,r,"scroll",i,{capture:!0,passive:!0}).stop;return{stop:function(){l(),s()}}}var XPt=200;function QPt(e,t){var n=bqe(e).subscribe(function(r){t(Gx(d0.ViewportResize,r))});return{stop:function(){n.unsubscribe()}}}function JPt(e,t){var n=window.visualViewport;if(!n)return{stop:Ea};var r=Ow(function(){t({data:Pqe(n),type:Av.VisualViewport,timestamp:fu()})},XPt,{trailing:!1}),o=r.throttled,i=r.cancel,s=fm(e,n,["resize","scroll"],o,{capture:!0,passive:!0}).stop;return{stop:function(){s(),i()}}}function ZPt(e,t){return fm(e,document,["play","pause"],function(n){var r=JD(n);!r||Nb(r,e.defaultPrivacyLevel)===ti.HIDDEN||!Gv(r)||t(Gx(d0.MediaInteraction,{id:om(r),type:n.type==="play"?gCe.Play:gCe.Pause}))},{capture:!0,passive:!0})}function eAt(e){function t(o,i){o&&Gv(o.ownerNode)&&i(om(o.ownerNode))}var n=[am(CSSStyleSheet.prototype,"insertRule",function(o){var i=o.target,s=o.parameters,l=s[0],c=s[1];t(i,function(u){return e(Gx(d0.StyleSheetRule,{id:u,adds:[{rule:l,index:c}]}))})}),am(CSSStyleSheet.prototype,"deleteRule",function(o){var i=o.target,s=o.parameters[0];t(i,function(l){return e(Gx(d0.StyleSheetRule,{id:l,removes:[{index:s}]}))})})];typeof CSSGroupingRule<"u"?r(CSSGroupingRule):(r(CSSMediaRule),r(CSSSupportsRule));function r(o){n.push(am(o.prototype,"insertRule",function(i){var s=i.target,l=i.parameters,c=l[0],u=l[1];t(s.parentStyleSheet,function(d){var p=vCe(s);p&&(p.push(u||0),e(Gx(d0.StyleSheetRule,{id:d,adds:[{rule:c,index:p}]})))})}),am(o.prototype,"deleteRule",function(i){var s=i.target,l=i.parameters[0];t(s.parentStyleSheet,function(c){var u=vCe(s);u&&(u.push(l),e(Gx(d0.StyleSheetRule,{id:c,removes:[{index:u}]})))})}))}return{stop:function(){n.forEach(function(o){return o.stop()})}}}function vCe(e){for(var t=[],n=e;n.parentRule;){var r=Array.from(n.parentRule.cssRules),o=r.indexOf(n);t.unshift(o),n=n.parentRule}if(n.parentStyleSheet){var i=Array.from(n.parentStyleSheet.cssRules),s=i.indexOf(n);return t.unshift(s),t}}function tAt(e,t){return fm(e,window,["focus","blur"],function(){t({data:{has_focus:document.hasFocus()},type:Av.Focus,timestamp:fu()})})}function nAt(e,t,n){var r=e.subscribe(12,function(o){var i,s;o.rawRumEvent.type==="action"&&o.rawRumEvent.action.type==="click"&&(!((s=(i=o.rawRumEvent.action.frustration)===null||i===void 0?void 0:i.type)===null||s===void 0)&&s.length)&&"events"in o.domainContext&&o.domainContext.events&&o.domainContext.events.length&&t({timestamp:o.rawRumEvent.date,type:Av.FrustrationRecord,data:{frustrationTypes:o.rawRumEvent.action.frustration.type,recordIds:o.domainContext.events.map(function(l){return n.getIdForEvent(l)})}})});return{stop:function(){r.unsubscribe()}}}function rAt(e,t){var n=e.subscribe(5,function(){t({timestamp:fu(),type:Av.ViewEnd})});return{stop:function(){n.unsubscribe()}}}function kqe(e,t,n){n===void 0&&(n=document);var r=e.defaultPrivacyLevel,o=new WeakMap,i=n!==document,s=fm(e,n,i?["change"]:["input","change"],function(p){var h=JD(p);(h instanceof HTMLInputElement||h instanceof HTMLTextAreaElement||h instanceof HTMLSelectElement)&&u(h)},{capture:!0,passive:!0}).stop,l;if(i)l=Ea;else{var c=[L4(HTMLInputElement.prototype,"value",u),L4(HTMLInputElement.prototype,"checked",u),L4(HTMLSelectElement.prototype,"value",u),L4(HTMLTextAreaElement.prototype,"value",u),L4(HTMLSelectElement.prototype,"selectedIndex",u)];l=function(){c.forEach(function(p){return p.stop()})}}return{stop:function(){l(),s()}};function u(p){var h=Nb(p,r);if(h!==ti.HIDDEN){var m=p.type,g;if(m==="radio"||m==="checkbox"){if(kG(p,h))return;g={isChecked:p.checked}}else{var y=cme(p,h);if(y===void 0)return;g={text:y}}d(p,g);var x=p.name;m==="radio"&&x&&p.checked&&QCt(document.querySelectorAll('input[type="radio"][name="'.concat(bC(x),'"]')),function(v){v!==p&&d(v,{isChecked:!1})})}}function d(p,h){if(Gv(p)){var m=o.get(p);(!m||m.text!==h.text||m.isChecked!==h.isChecked)&&(o.set(p,h),t(Gx(d0.Input,Wo({id:om(p)},h))))}}}var oAt=100,iAt=16;function aAt(e){var t=Ea,n=[];function r(){t(),e(n),n=[]}var o=Ow(r,iAt,{leading:!1}),i=o.throttled,s=o.cancel;return{addMutations:function(l){n.length===0&&(t=jGe(i,{timeout:oAt})),n.push.apply(n,l)},flush:r,stop:function(){t(),s()}}}function Mqe(e,t,n,r){var o=LGe();if(!o)return{stop:Ea,flush:Ea};var i=aAt(function(l){sAt(l.concat(s.takeRecords()),e,t,n)}),s=new o(to(i.addMutations));return s.observe(r,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:function(){s.disconnect(),i.stop()},flush:function(){i.flush()}}}function sAt(e,t,n,r){var o=new Map;e.filter(function(h){return h.type==="childList"}).forEach(function(h){h.removedNodes.forEach(function(m){Rqe(m,r.removeShadowRoot)})});var i=e.filter(function(h){return h.target.isConnected&&wPt(h.target)&&Nb(h.target,n.defaultPrivacyLevel,o)!==ti.HIDDEN}),s=lAt(i.filter(function(h){return h.type==="childList"}),n,r,o),l=s.adds,c=s.removes,u=s.hasBeenSerialized,d=cAt(i.filter(function(h){return h.type==="characterData"&&!u(h.target)}),n,o),p=uAt(i.filter(function(h){return h.type==="attributes"&&!u(h.target)}),n,o);!d.length&&!p.length&&!c.length&&!l.length||t(Gx(d0.Mutation,{adds:l,removes:c,texts:d,attributes:p}))}function lAt(e,t,n,r){for(var o=new Set,i=new Map,s=function(N){N.addedNodes.forEach(function(j){o.add(j)}),N.removedNodes.forEach(function(j){o.has(j)||i.set(j,N.target),o.delete(j)})},l=0,c=e;lOqe&&l("segment_bytes_limit")})}},stop:function(){l("stop"),i(),s()}}}function SAt(e,t,n){var r=t.findTrackedSession(),o=n.findView();if(!(!r||!o))return{application:{id:e},session:{id:r.id},view:{id:o.id}}}function CAt(e){var t=YC();return{addRecord:function(n){var r=e.findView();t.send("record",n,r.id)}}}function NAt(e,t,n,r,o,i){var s=[],l=function(h){e.notify(14,{error:h}),KC("Error reported to customer",{"error.message":h.message})},c=i||vGe(t.sessionReplayEndpointBuilder,Oqe,l),u;if(sy())u=CAt(r).addRecord;else{var d=bAt(e,t,n,r,c,o);u=d.addRecord,s.push(d.stop)}var p=gAt({emit:u,configuration:t,lifeCycle:e,viewHistory:r}).stop;return s.push(p),{stop:function(){s.forEach(function(h){return h()})}}}function $qe(e,t,n){var r=0,o=[],i,s=0,l=[],c=Kl(e,t,"message",function(p){var h=p.data;if(!(h.type!=="wrote"||h.streamId!==n)){r+=h.additionalBytesCount,o.push(h.result),i=h.trailer;var m=l.shift();m&&m.id===h.id?m.writeCallback?m.writeCallback(h.result.byteLength):m.finishCallback&&m.finishCallback():(c(),KC("Worker responses received out of order."))}}).stop;function u(){var p=o.length===0?new Uint8Array(0):YCt(o.concat(i)),h={rawBytesCount:r,output:p,outputBytesCount:p.byteLength,encoding:"deflate"};return r=0,o=[],h}function d(){s>0&&(t.postMessage({action:"reset",streamId:n}),s=0)}return{isAsync:!0,get isEmpty(){return s===0},write:function(p,h){t.postMessage({action:"write",id:s,data:p,streamId:n}),l.push({id:s,writeCallback:h,data:p}),s+=1},finish:function(p){d(),l.length?(l.forEach(function(h){delete h.writeCallback}),l[l.length-1].finishCallback=function(){return p(u())}):p(u())},finishSync:function(){d();var p=l.map(function(h){return delete h.writeCallback,delete h.finishCallback,h.data}).join("");return Wo(u(),{pendingData:p})},estimateEncodedBytesCount:function(p){return p.length/8},stop:function(){c()}}}var jAt=30*Op;function Dqe(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['!function(){"use strict";function t(t){for(var e=t.reduce((function(t,e){return t+e.length}),0),a=new Uint8Array(e),n=0,r=0,i=t;r=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),h=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,w,v=new Array(r);function b(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(v);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},k=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},z=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<>>=1,a<<=1}while(--e>0);return a>>>1},U=function(t,e,a){var n,r,s=new Array(16),h=0;for(n=1;n<=i;n++)s[n]=h=h+a[n-1]<<1;for(r=0;r<=e;r++){var l=t[2*r+1];0!==l&&(t[2*r]=A(s[l]++,l))}},I=function(t){var e;for(e=0;e8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},E=function(t,e,a,n){var r=2*e,i=2*a;return t[r]>1;a>=1;a--)S(t,s,a);r=_;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,S(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,h,l,_=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(_[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=_[2*_[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),_[2*n+1]=s,n>o||(t.bl_count[s]++,h=0,n>=c&&(h=f[n-c]),l=_[2*n],t.opt_len+=l*(s+h),u&&(t.static_len+=l*(d[2*n+1]+h)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(_[2*r+1]!==s&&(t.opt_len+=(s-_[2*r+1])*_[2*r],_[2*r+1]=s),n--)}}(t,e),U(s,o,t.bl_count)},j=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e=3&&0===t.bl_tree[2*_[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?T(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),C(t,o,d)):(z(t,4+(r?1:0),3),function(t,e,a,n){var r;for(z(t,e-257,5),z(t,a-1,5),z(t,n-4,4),r=0;r>=7;_>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){z(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},K=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},N=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),O=function(t,e,a,n){var r=N,i=n+a;t^=-1;for(var s=n;s>>8^r[255&(t^e[s])];return~t},q={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},F=0,G=2,J=3,P=4,Q=0,V=1,W=-1,X=0,Y=8,Z=R._tr_init,$=R._tr_stored_block,tt=R._tr_flush_block,et=R._tr_tally,at=R._tr_align,nt=F,rt=1,it=J,st=P,ht=5,lt=Q,_t=V,ot=-2,dt=-3,ut=-5,ft=W,ct=1,pt=2,gt=3,wt=4,vt=X,bt=2,mt=Y,yt=258,kt=262,zt=103,xt=113,At=666,Ut=function(t,e){return t.msg=q[e],e},It=function(t){return(t<<1)-(t>4?9:0)},Bt=function(t){for(var e=t.length;--e>=0;)t[e]=0},Et=function(t,e,a){return(e<t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Ct=function(t,e){tt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,St(t.strm)},Dt=function(t,e){t.pending_buf[t.pending++]=e},jt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Mt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-kt?t.strstart-(t.w_size-kt):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+yt,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&is){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},Lt=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-kt)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=K(s.adler,h,o,l):2===s.state.wrap&&(s.adler=O(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Et(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Et(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a)),t.match_length>=3)if(n=et(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Et(t,t.ins_h,t.window[t.strstart+1]);else n=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2},Ht=function(t,e){for(var a,n,r;;){if(t.lookahead=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=et(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Ct(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=et(t,0,t.window[t.strstart-1]))&&Ct(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=et(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Kt=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Lt(t),0===t.lookahead&&e===nt)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Ct(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-kt&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Ct(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Tt),new Rt(4,5,16,8,Tt),new Rt(4,6,32,32,Tt),new Rt(4,4,16,16,Ht),new Rt(8,16,32,32,Ht),new Rt(8,16,128,128,Ht),new Rt(8,32,128,256,Ht),new Rt(32,128,258,1024,Ht),new Rt(32,258,258,4096,Ht)];function Nt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=mt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Bt(this.dyn_ltree),Bt(this.dyn_dtree),Bt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Bt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Bt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return Ut(t,ot);t.total_in=t.total_out=0,t.data_type=bt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:xt,t.adler=2===e.wrap?0:1,e.last_flush=nt,Z(e),lt},qt=function(t){var e,a=Ot(t);return a===lt&&((e=t.state).window_size=2*e.w_size,Bt(e.head),e.max_lazy_match=Kt[e.level].max_lazy,e.good_match=Kt[e.level].good_length,e.nice_match=Kt[e.level].nice_length,e.max_chain_length=Kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ft=function(t,e,a,n,r,i){if(!t)return ot;var s=1;if(e===ft&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==mt||n<8||n>15||e<0||e>9||i<0||i>wt)return Ut(t,ot);8===n&&(n=9);var h=new Nt;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<ht||e<0)return t?Ut(t,ot):ot;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===At&&e!==st)return Ut(t,0===t.avail_out?ut:ot);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Dt(r,31),Dt(r,139),Dt(r,8),r.gzhead?(Dt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Dt(r,255&r.gzhead.time),Dt(r,r.gzhead.time>>8&255),Dt(r,r.gzhead.time>>16&255),Dt(r,r.gzhead.time>>24&255),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Dt(r,255&r.gzhead.extra.length),Dt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=O(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,3),r.status=xt);else{var s=mt+(r.w_bits-8<<4)<<8;s|=(r.strategy>=pt||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=xt,jt(r,s),0!==r.strstart&&(jt(r,t.adler>>>16),jt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending!==r.pending_buf_size));)Dt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindexa&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindexa&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=zt)}else r.status=zt;if(r.status===zt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&St(t),r.pending+2<=r.pending_buf_size&&(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),t.adler=0,r.status=xt)):r.status=xt),0!==r.pending){if(St(t),0===t.avail_out)return r.last_flush=-1,lt}else if(0===t.avail_in&&It(e)<=It(i)&&e!==st)return Ut(t,ut);if(r.status===At&&0!==t.avail_in)return Ut(t,ut);if(0!==t.avail_in||0!==r.lookahead||e!==nt&&r.status!==At){var h=r.strategy===pt?function(t,e){for(var a;;){if(0===t.lookahead&&(Lt(t),0===t.lookahead)){if(e===nt)return 1;break}if(t.match_length=0,a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===gt?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=yt){if(Lt(t),t.lookahead<=yt&&e===nt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+yt;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=et(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):Kt[r.level].func(r,e);if(3!==h&&4!==h||(r.status=At),1===h||3===h)return 0===t.avail_out&&(r.last_flush=-1),lt;if(2===h&&(e===rt?at(r):e!==ht&&($(r,0,0,!1),e===it&&(Bt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),St(t),0===t.avail_out))return r.last_flush=-1,lt}return e!==st?lt:r.wrap<=0?_t:(2===r.wrap?(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),Dt(r,t.adler>>16&255),Dt(r,t.adler>>24&255),Dt(r,255&t.total_in),Dt(r,t.total_in>>8&255),Dt(r,t.total_in>>16&255),Dt(r,t.total_in>>24&255)):(jt(r,t.adler>>>16),jt(r,65535&t.adler)),St(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?lt:_t)},deflateEnd:function(t){if(!t||!t.state)return ot;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==zt&&e!==xt&&e!==At?Ut(t,ot):(t.state=null,e===xt?Ut(t,dt):lt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return ot;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return ot;if(1===r&&(t.adler=K(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(Bt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Lt(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=Et(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,Lt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,lt},deflateInfo:"pako deflate (from Nodeca project)"};for(var Jt=new Uint8Array(256),Pt=0;Pt<256;Pt++)Jt[Pt]=Pt>=252?6:Pt>=248?5:Pt>=240?4:Pt>=224?3:Pt>=192?2:1;Jt[254]=Jt[254]=1;var Qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Vt=Object.prototype.toString,Wt=F,Xt=G,Yt=J,Zt=P,$t=Q,te=V,ee=W,ae=X,ne=Y;function re(){this.options={level:ee,method:ne,chunkSize:16384,windowBits:15,memLevel:8,strategy:ae};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var e=Gt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==$t)throw new Error(q[e]);if(t.header&&Gt.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a="[object ArrayBuffer]"===Vt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Gt.deflateSetDictionary(this.strm,a))!==$t)throw new Error(q[e]);this._dict_set=!0}}function ie(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:String(e),streamId:a})}}function se(t){var e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}re.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Zt:Wt,"[object ArrayBuffer]"===Vt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Xt||n===Yt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Gt.deflate(r,n))===te)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Gt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===$t;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},re.prototype.onData=function(t){this.chunks.push(t)},re.prototype.onEnd=function(t){t===$t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,G),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:se(n),additionalBytesCount:i.length};case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){ie(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}}))}catch(t){ie(e,t)}}()}();'])))}var Au={status:0};function Lqe(e,t,n,r){switch(r===void 0&&(r=Dqe),Au.status===0&&EAt(e,t,r),Au.status){case 1:return Au.initializationFailureCallbacks.push(n),Au.worker;case 3:return Au.worker}}function bCe(){return Au.status}function EAt(e,t,n){n===void 0&&(n=Dqe);try{var r=n(e),o=Kl(e,r,"error",function(l){MQ(e,t,l)}).stop,i=Kl(e,r,"message",function(l){var c=l.data;c.type==="errored"?MQ(e,t,c.error,c.streamId):c.type==="initialized"&&_At(c.version)}).stop;r.postMessage({action:"init"}),Vf(function(){return IAt(t)},jAt);var s=function(){o(),i()};Au={status:1,worker:r,stop:s,initializationFailureCallbacks:[]}}catch(l){MQ(e,t,l)}}function IAt(e){Au.status===1&&(Pa.error("".concat(e," failed to start: a timeout occurred while initializing the Worker")),Au.initializationFailureCallbacks.forEach(function(t){return t()}),Au={status:2})}function _At(e){Au.status===1&&(Au={status:3,worker:Au.worker,stop:Au.stop,version:e})}function MQ(e,t,n,r){if(Au.status===1||Au.status===0){if(Pa.error("".concat(t," failed to start: an error occurred while creating the Worker:"),n),n instanceof Event||n instanceof Error&&PAt(n.message)){var o=void 0;e.workerUrl?o="Please make sure the Worker URL ".concat(e.workerUrl," is correct and CSP is correctly configured."):o="Please make sure CSP is correctly configured.",Pa.error("".concat(o," See documentation at ").concat(xG,"/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay"))}else EH(n);Au.status===1&&Au.initializationFailureCallbacks.forEach(function(i){return i()}),Au={status:2}}else EH(n,{worker_version:Au.status===3&&Au.version,stream_id:r})}function PAt(e){return Sh(e,"Content Security Policy")||Sh(e,"requires 'TrustedScriptURL'")}function Fqe(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function AAt(e,t,n,r){var o=t.findTrackedSession(),i=TAt(o,r),s=n.findView();return dPt(e,{viewContext:s,errorType:i,session:o})}function TAt(e,t){if(!Fqe())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}function kAt(e,t,n,r,o,i){var s=0;t.subscribe(9,function(){(s===2||s===3)&&(c(),s=1)}),t.subscribe(11,function(d){d.reason===tA.UNLOADING&&c()}),t.subscribe(10,function(){s===1&&l()});function l(d){var p=n.findTrackedSession();if(MAt(p,d)){s=1;return}RAt(s)||(s=2,Zhe(e,"interactive",function(){if(s===2){var h=i();if(!h){s=0;return}u=o(t,e,n,r,h).stop,s=3}}),OAt(p,d)&&n.setForcedReplay())}function c(){s!==0&&s===3&&(u==null||u()),s=0}var u;return{start:l,stop:c,getSessionReplayLink:function(){return AAt(e,n,r,s!==0)},isRecording:function(){return s===3}}}function MAt(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function RAt(e){return e===2||e===3}function OAt(e,t){return t&&t.force&&e.sessionReplay===0}function $At(){var e=0;return{strategy:{start:function(){e=1},stop:function(){e=2},isRecording:function(){return!1},getSessionReplayLink:Ea},shouldStartImmediately:function(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function DAt(e,t){if(sy()&&!bGe("records")||!Fqe())return{start:Ea,stop:Ea,getReplayStats:function(){},onRumStart:Ea,isRecording:function(){return!1},getSessionReplayLink:function(){}};var n=$At(),r=n.strategy,o=n.shouldStartImmediately;return{start:function(s){return r.start(s)},stop:function(){return r.stop()},getSessionReplayLink:function(){return r.getSessionReplayLink()},onRumStart:i,isRecording:function(){return bCe()===3&&r.isRecording()},getReplayStats:function(s){return bCe()===3?vPt(s):void 0}};function i(s,l,c,u,d){var p;function h(){return p||(d??(d=Lqe(l,"Datadog Session Replay",function(){r.stop()},t)),d&&(p=$qe(l,d,1))),p}r=kAt(l,s,c,u,e,h),o(l)&&r.start()}}var LAt=DAt(NAt),zqe=eIt(lPt,LAt,{startDeflateWorker:Lqe,createDeflateEncoder:$qe});JWe(Rw(),"DD_RUM",zqe);var L8=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ba(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var RQ={exports:{}},qi={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var wCe;function FAt(){if(wCe)return qi;wCe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;function h(H){return H===null||typeof H!="object"?null:(H=p&&H[p]||H["@@iterator"],typeof H=="function"?H:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,y={};function x(H,F,W){this.props=H,this.context=F,this.refs=y,this.updater=W||m}x.prototype.isReactComponent={},x.prototype.setState=function(H,F){if(typeof H!="object"&&typeof H!="function"&&H!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,F,"setState")},x.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function v(){}v.prototype=x.prototype;function b(H,F,W){this.props=H,this.context=F,this.refs=y,this.updater=W||m}var w=b.prototype=new v;w.constructor=b,g(w,x.prototype),w.isPureReactComponent=!0;var S=Array.isArray,C=Object.prototype.hasOwnProperty,N={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function I(H,F,W){var U,K={},X=null,J=null;if(F!=null)for(U in F.ref!==void 0&&(J=F.ref),F.key!==void 0&&(X=""+F.key),F)C.call(F,U)&&!j.hasOwnProperty(U)&&(K[U]=F[U]);var te=arguments.length-2;if(te===1)K.children=W;else if(1>>1,F=V[H];if(0>>1;Ho(K,G))Xo(J,K)?(V[H]=J,V[X]=G,H=X):(V[H]=K,V[U]=G,H=U);else if(Xo(J,G))V[H]=J,V[X]=G,H=X;else break e}}return B}function o(V,B){var G=V.sortIndex-B.sortIndex;return G!==0?G:V.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var c=[],u=[],d=1,p=null,h=3,m=!1,g=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(V){for(var B=n(u);B!==null;){if(B.callback===null)r(u);else if(B.startTime<=V)r(u),B.sortIndex=B.expirationTime,t(c,B);else break;B=n(u)}}function S(V){if(y=!1,w(V),!g)if(n(c)!==null)g=!0,D(C);else{var B=n(u);B!==null&&z(S,B.startTime-V)}}function C(V,B){g=!1,y&&(y=!1,v(I),I=-1),m=!0;var G=h;try{for(w(B),p=n(c);p!==null&&(!(p.expirationTime>B)||V&&!P());){var H=p.callback;if(typeof H=="function"){p.callback=null,h=p.priorityLevel;var F=H(p.expirationTime<=B);B=e.unstable_now(),typeof F=="function"?p.callback=F:p===n(c)&&r(c),w(B)}else r(c);p=n(c)}if(p!==null)var W=!0;else{var U=n(u);U!==null&&z(S,U.startTime-B),W=!1}return W}finally{p=null,h=G,m=!1}}var N=!1,j=null,I=-1,_=5,T=-1;function P(){return!(e.unstable_now()-T<_)}function E(){if(j!==null){var V=e.unstable_now();T=V;var B=!0;try{B=j(!0,V)}finally{B?M():(N=!1,j=null)}}else N=!1}var M;if(typeof b=="function")M=function(){b(E)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,$=R.port2;R.port1.onmessage=E,M=function(){$.postMessage(null)}}else M=function(){x(E,0)};function D(V){j=V,N||(N=!0,M())}function z(V,B){I=x(function(){V(e.unstable_now())},B)}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(V){V.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,D(C))},e.unstable_forceFrameRate=function(V){0>V||125H?(V.sortIndex=G,t(u,V),n(c)===null&&V===n(u)&&(y?(v(I),I=-1):y=!0,z(S,G-H))):(V.sortIndex=F,t(c,V),g||m||(g=!0,D(C))),V},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(V){var B=h;return function(){var G=h;h=B;try{return V.apply(this,arguments)}finally{h=G}}}})(LQ)),LQ}var ICe;function qAt(){return ICe||(ICe=1,DQ.exports=GAt()),DQ.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var _Ce;function KAt(){if(_Ce)return Uh;_Ce=1;var e=ik(),t=qAt();function n(A){for(var O="https://reactjs.org/docs/error-decoder.html?invariant="+A,Y=1;Y"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),c=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},p={};function h(A){return c.call(p,A)?!0:c.call(d,A)?!1:u.test(A)?p[A]=!0:(d[A]=!0,!1)}function m(A,O,Y,ie){if(Y!==null&&Y.type===0)return!1;switch(typeof O){case"function":case"symbol":return!0;case"boolean":return ie?!1:Y!==null?!Y.acceptsBooleans:(A=A.toLowerCase().slice(0,5),A!=="data-"&&A!=="aria-");default:return!1}}function g(A,O,Y,ie){if(O===null||typeof O>"u"||m(A,O,Y,ie))return!0;if(ie)return!1;if(Y!==null)switch(Y.type){case 3:return!O;case 4:return O===!1;case 5:return isNaN(O);case 6:return isNaN(O)||1>O}return!1}function y(A,O,Y,ie,me,Ce,Fe){this.acceptsBooleans=O===2||O===3||O===4,this.attributeName=ie,this.attributeNamespace=me,this.mustUseProperty=Y,this.propertyName=A,this.type=O,this.sanitizeURL=Ce,this.removeEmptyString=Fe}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(A){x[A]=new y(A,0,!1,A,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(A){var O=A[0];x[O]=new y(O,1,!1,A[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(A){x[A]=new y(A,2,!1,A.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(A){x[A]=new y(A,2,!1,A,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(A){x[A]=new y(A,3,!1,A.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(A){x[A]=new y(A,3,!0,A,null,!1,!1)}),["capture","download"].forEach(function(A){x[A]=new y(A,4,!1,A,null,!1,!1)}),["cols","rows","size","span"].forEach(function(A){x[A]=new y(A,6,!1,A,null,!1,!1)}),["rowSpan","start"].forEach(function(A){x[A]=new y(A,5,!1,A.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function b(A){return A[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(A){var O=A.replace(v,b);x[O]=new y(O,1,!1,A,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(A){var O=A.replace(v,b);x[O]=new y(O,1,!1,A,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(A){var O=A.replace(v,b);x[O]=new y(O,1,!1,A,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(A){x[A]=new y(A,1,!1,A.toLowerCase(),null,!1,!1)}),x.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(A){x[A]=new y(A,1,!1,A.toLowerCase(),null,!0,!0)});function w(A,O,Y,ie){var me=x.hasOwnProperty(O)?x[O]:null;(me!==null?me.type!==0:ie||!(2St||me[Fe]!==Ce[St]){var Dt=` `+me[Fe].replace(" at new "," at ");return A.displayName&&Dt.includes("")&&(Dt=Dt.replace("",A.displayName)),Dt}while(1<=Fe&&0<=St);break}}}finally{W=!1,Error.prepareStackTrace=Y}return(A=A?A.displayName||A.name:"")?F(A):""}function K(A){switch(A.tag){case 5:return F(A.type);case 16:return F("Lazy");case 13:return F("Suspense");case 19:return F("SuspenseList");case 0:case 2:case 15:return A=U(A.type,!1),A;case 11:return A=U(A.type.render,!1),A;case 1:return A=U(A.type,!0),A;default:return""}}function X(A){if(A==null)return null;if(typeof A=="function")return A.displayName||A.name||null;if(typeof A=="string")return A;switch(A){case j:return"Fragment";case N:return"Portal";case _:return"Profiler";case I:return"StrictMode";case M:return"Suspense";case R:return"SuspenseList"}if(typeof A=="object")switch(A.$$typeof){case P:return(A.displayName||"Context")+".Consumer";case T:return(A._context.displayName||"Context")+".Provider";case E:var O=A.render;return A=A.displayName,A||(A=O.displayName||O.name||"",A=A!==""?"ForwardRef("+A+")":"ForwardRef"),A;case $:return O=A.displayName||null,O!==null?O:X(A.type)||"Memo";case D:O=A._payload,A=A._init;try{return X(A(O))}catch{}}return null}function J(A){var O=A.type;switch(A.tag){case 24:return"Cache";case 9:return(O.displayName||"Context")+".Consumer";case 10:return(O._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return A=O.render,A=A.displayName||A.name||"",O.displayName||(A!==""?"ForwardRef("+A+")":"ForwardRef");case 7:return"Fragment";case 5:return O;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return X(O);case 8:return O===I?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof O=="function")return O.displayName||O.name||null;if(typeof O=="string")return O}return null}function te(A){switch(typeof A){case"boolean":case"number":case"string":case"undefined":return A;case"object":return A;default:return""}}function re(A){var O=A.type;return(A=A.nodeName)&&A.toLowerCase()==="input"&&(O==="checkbox"||O==="radio")}function ce(A){var O=re(A)?"checked":"value",Y=Object.getOwnPropertyDescriptor(A.constructor.prototype,O),ie=""+A[O];if(!A.hasOwnProperty(O)&&typeof Y<"u"&&typeof Y.get=="function"&&typeof Y.set=="function"){var me=Y.get,Ce=Y.set;return Object.defineProperty(A,O,{configurable:!0,get:function(){return me.call(this)},set:function(Fe){ie=""+Fe,Ce.call(this,Fe)}}),Object.defineProperty(A,O,{enumerable:Y.enumerable}),{getValue:function(){return ie},setValue:function(Fe){ie=""+Fe},stopTracking:function(){A._valueTracker=null,delete A[O]}}}}function ae(A){A._valueTracker||(A._valueTracker=ce(A))}function oe(A){if(!A)return!1;var O=A._valueTracker;if(!O)return!0;var Y=O.getValue(),ie="";return A&&(ie=re(A)?A.checked?"true":"false":A.value),A=ie,A!==Y?(O.setValue(A),!0):!1}function ue(A){if(A=A||(typeof document<"u"?document:void 0),typeof A>"u")return null;try{return A.activeElement||A.body}catch{return A.body}}function fe(A,O){var Y=O.checked;return G({},O,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:Y??A._wrapperState.initialChecked})}function se(A,O){var Y=O.defaultValue==null?"":O.defaultValue,ie=O.checked!=null?O.checked:O.defaultChecked;Y=te(O.value!=null?O.value:Y),A._wrapperState={initialChecked:ie,initialValue:Y,controlled:O.type==="checkbox"||O.type==="radio"?O.checked!=null:O.value!=null}}function ge(A,O){O=O.checked,O!=null&&w(A,"checked",O,!1)}function ye(A,O){ge(A,O);var Y=te(O.value),ie=O.type;if(Y!=null)ie==="number"?(Y===0&&A.value===""||A.value!=Y)&&(A.value=""+Y):A.value!==""+Y&&(A.value=""+Y);else if(ie==="submit"||ie==="reset"){A.removeAttribute("value");return}O.hasOwnProperty("value")?Ne(A,O.type,Y):O.hasOwnProperty("defaultValue")&&Ne(A,O.type,te(O.defaultValue)),O.checked==null&&O.defaultChecked!=null&&(A.defaultChecked=!!O.defaultChecked)}function de(A,O,Y){if(O.hasOwnProperty("value")||O.hasOwnProperty("defaultValue")){var ie=O.type;if(!(ie!=="submit"&&ie!=="reset"||O.value!==void 0&&O.value!==null))return;O=""+A._wrapperState.initialValue,Y||O===A.value||(A.value=O),A.defaultValue=O}Y=A.name,Y!==""&&(A.name=""),A.defaultChecked=!!A._wrapperState.initialChecked,Y!==""&&(A.name=Y)}function Ne(A,O,Y){(O!=="number"||ue(A.ownerDocument)!==A)&&(Y==null?A.defaultValue=""+A._wrapperState.initialValue:A.defaultValue!==""+Y&&(A.defaultValue=""+Y))}var _e=Array.isArray;function xe(A,O,Y,ie){if(A=A.options,O){O={};for(var me=0;me"+O.valueOf().toString()+"",O=We.firstChild;A.firstChild;)A.removeChild(A.firstChild);for(;O.firstChild;)A.appendChild(O.firstChild)}});function Oe(A,O){if(O){var Y=A.firstChild;if(Y&&Y===A.lastChild&&Y.nodeType===3){Y.nodeValue=O;return}}A.textContent=O}var Ae={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qe=["Webkit","ms","Moz","O"];Object.keys(Ae).forEach(function(A){qe.forEach(function(O){O=O+A.charAt(0).toUpperCase()+A.substring(1),Ae[O]=Ae[A]})});function dt(A,O,Y){return O==null||typeof O=="boolean"||O===""?"":Y||typeof O!="number"||O===0||Ae.hasOwnProperty(A)&&Ae[A]?(""+O).trim():O+"px"}function Ze(A,O){A=A.style;for(var Y in O)if(O.hasOwnProperty(Y)){var ie=Y.indexOf("--")===0,me=dt(Y,O[Y],ie);Y==="float"&&(Y="cssFloat"),ie?A.setProperty(Y,me):A[Y]=me}}var Qe=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function lt(A,O){if(O){if(Qe[A]&&(O.children!=null||O.dangerouslySetInnerHTML!=null))throw Error(n(137,A));if(O.dangerouslySetInnerHTML!=null){if(O.children!=null)throw Error(n(60));if(typeof O.dangerouslySetInnerHTML!="object"||!("__html"in O.dangerouslySetInnerHTML))throw Error(n(61))}if(O.style!=null&&typeof O.style!="object")throw Error(n(62))}}function bt(A,O){if(A.indexOf("-")===-1)return typeof O.is=="string";switch(A){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 Ct=null;function Je(A){return A=A.target||A.srcElement||window,A.correspondingUseElement&&(A=A.correspondingUseElement),A.nodeType===3?A.parentNode:A}var Pe=null,Me=null,et=null;function vt(A){if(A=Eg(A)){if(typeof Pe!="function")throw Error(n(280));var O=A.stateNode;O&&(O=Ub(O),Pe(A.stateNode,A.type,O))}}function Pt(A){Me?et?et.push(A):et=[A]:Me=A}function Jt(){if(Me){var A=Me,O=et;if(et=Me=null,vt(A),O)for(A=0;A>>=0,A===0?32:31-(hn(A)/Vn|0)|0}var Fr=64,po=4194304;function nr(A){switch(A&-A){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return A&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return A&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return A}}function or(A,O){var Y=A.pendingLanes;if(Y===0)return 0;var ie=0,me=A.suspendedLanes,Ce=A.pingedLanes,Fe=Y&268435455;if(Fe!==0){var St=Fe&~me;St!==0?ie=nr(St):(Ce&=Fe,Ce!==0&&(ie=nr(Ce)))}else Fe=Y&~me,Fe!==0?ie=nr(Fe):Ce!==0&&(ie=nr(Ce));if(ie===0)return 0;if(O!==0&&O!==ie&&(O&me)===0&&(me=ie&-ie,Ce=O&-O,me>=Ce||me===16&&(Ce&4194240)!==0))return O;if((ie&4)!==0&&(ie|=Y&16),O=A.entangledLanes,O!==0)for(A=A.entanglements,O&=ie;0Y;Y++)O.push(A);return O}function Ao(A,O,Y){A.pendingLanes|=O,O!==536870912&&(A.suspendedLanes=0,A.pingedLanes=0),A=A.eventTimes,O=31-gt(O),A[O]=Y}function uo(A,O){var Y=A.pendingLanes&~O;A.pendingLanes=O,A.suspendedLanes=0,A.pingedLanes=0,A.expiredLanes&=O,A.mutableReadLanes&=O,A.entangledLanes&=O,O=A.entanglements;var ie=A.eventTimes;for(A=A.expirationTimes;0=zn),Cr=" ",Zr=!1;function _o(A,O){switch(A){case"keyup":return En.indexOf(O.keyCode)!==-1;case"keydown":return O.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yo(A){return A=A.detail,typeof A=="object"&&"data"in A?A.data:null}var Si=!1;function ka(A,O){switch(A){case"compositionend":return Yo(O);case"keypress":return O.which!==32?null:(Zr=!0,Cr);case"textInput":return A=O.data,A===Cr&&Zr?null:A;default:return null}}function Ca(A,O){if(Si)return A==="compositionend"||!Hn&&_o(A,O)?(A=hl(),ms=$o=Ro=null,Si=!1,A):null;switch(A){case"paste":return null;case"keypress":if(!(O.ctrlKey||O.altKey||O.metaKey)||O.ctrlKey&&O.altKey){if(O.char&&1=O)return{node:Y,offset:O-A};A=ie}e:{for(;Y;){if(Y.nextSibling){Y=Y.nextSibling;break e}Y=Y.parentNode}Y=void 0}Y=xa(Y)}}function yl(A,O){return A&&O?A===O?!0:A&&A.nodeType===3?!1:O&&O.nodeType===3?yl(A,O.parentNode):"contains"in A?A.contains(O):A.compareDocumentPosition?!!(A.compareDocumentPosition(O)&16):!1:!1}function Fl(){for(var A=window,O=ue();O instanceof A.HTMLIFrameElement;){try{var Y=typeof O.contentWindow.location.href=="string"}catch{Y=!1}if(Y)A=O.contentWindow;else break;O=ue(A.document)}return O}function Vp(A){var O=A&&A.nodeName&&A.nodeName.toLowerCase();return O&&(O==="input"&&(A.type==="text"||A.type==="search"||A.type==="tel"||A.type==="url"||A.type==="password")||O==="textarea"||A.contentEditable==="true")}function Wd(A){var O=Fl(),Y=A.focusedElem,ie=A.selectionRange;if(O!==Y&&Y&&Y.ownerDocument&&yl(Y.ownerDocument.documentElement,Y)){if(ie!==null&&Vp(Y)){if(O=ie.start,A=ie.end,A===void 0&&(A=O),"selectionStart"in Y)Y.selectionStart=O,Y.selectionEnd=Math.min(A,Y.value.length);else if(A=(O=Y.ownerDocument||document)&&O.defaultView||window,A.getSelection){A=A.getSelection();var me=Y.textContent.length,Ce=Math.min(ie.start,me);ie=ie.end===void 0?Ce:Math.min(ie.end,me),!A.extend&&Ce>ie&&(me=ie,ie=Ce,Ce=me),me=Ma(Y,Ce);var Fe=Ma(Y,ie);me&&Fe&&(A.rangeCount!==1||A.anchorNode!==me.node||A.anchorOffset!==me.offset||A.focusNode!==Fe.node||A.focusOffset!==Fe.offset)&&(O=O.createRange(),O.setStart(me.node,me.offset),A.removeAllRanges(),Ce>ie?(A.addRange(O),A.extend(Fe.node,Fe.offset)):(O.setEnd(Fe.node,Fe.offset),A.addRange(O)))}}for(O=[],A=Y;A=A.parentNode;)A.nodeType===1&&O.push({element:A,left:A.scrollLeft,top:A.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Y=document.documentMode,Pm=null,Q0=null,Ly=null,Hb=!1;function gN(A,O,Y){var ie=Y.window===Y?Y.document:Y.nodeType===9?Y:Y.ownerDocument;Hb||Pm==null||Pm!==ue(ie)||(ie=Pm,"selectionStart"in ie&&Vp(ie)?ie={start:ie.selectionStart,end:ie.selectionEnd}:(ie=(ie.ownerDocument&&ie.ownerDocument.defaultView||window).getSelection(),ie={anchorNode:ie.anchorNode,anchorOffset:ie.anchorOffset,focusNode:ie.focusNode,focusOffset:ie.focusOffset}),Ly&&wu(Ly,ie)||(Ly=ie,ie=ne(Q0,"onSelect"),0nx||(A.current=N4[nx],N4[nx]=null,nx--)}function xs(A,O){nx++,N4[nx]=A.current,A.current=O}var Vy={},pd=km(Vy),np=km(!1),Wb=Vy;function fS(A,O){var Y=A.type.contextTypes;if(!Y)return Vy;var ie=A.stateNode;if(ie&&ie.__reactInternalMemoizedUnmaskedChildContext===O)return ie.__reactInternalMemoizedMaskedChildContext;var me={},Ce;for(Ce in Y)me[Ce]=O[Ce];return ie&&(A=A.stateNode,A.__reactInternalMemoizedUnmaskedChildContext=O,A.__reactInternalMemoizedMaskedChildContext=me),me}function rp(A){return A=A.childContextTypes,A!=null}function A5(){ts(np),ts(pd)}function t8(A,O,Y){if(pd.current!==Vy)throw Error(n(168));xs(pd,O),xs(np,Y)}function j4(A,O,Y){var ie=A.stateNode;if(O=O.childContextTypes,typeof ie.getChildContext!="function")return Y;ie=ie.getChildContext();for(var me in ie)if(!(me in O))throw Error(n(108,J(A)||"Unknown",me));return G({},Y,ie)}function Gb(A){return A=(A=A.stateNode)&&A.__reactInternalMemoizedMergedChildContext||Vy,Wb=pd.current,xs(pd,A),xs(np,np.current),!0}function n8(A,O,Y){var ie=A.stateNode;if(!ie)throw Error(n(169));Y?(A=j4(A,O,Wb),ie.__reactInternalMemoizedMergedChildContext=A,ts(np),ts(pd),xs(pd,A)):ts(np),xs(np,Y)}var rx=null,wN=!1,Z=!1;function le(A){rx===null?rx=[A]:rx.push(A)}function ve(A){wN=!0,le(A)}function je(){if(!Z&&rx!==null){Z=!0;var A=0,O=Jr;try{var Y=rx;for(Jr=1;A>=Fe,me-=Fe,cn=1<<32-gt(O)+me|Y<Xo?(Qd=Mo,Mo=null):Qd=Mo.sibling;var Ua=rr(fn,Mo,yn[Xo],hr);if(Ua===null){Mo===null&&(Mo=Qd);break}A&&Mo&&Ua.alternate===null&&O(fn,Mo),Yt=Ce(Ua,Yt,Xo),ko===null?ho=Ua:ko.sibling=Ua,ko=Ua,Mo=Qd}if(Xo===yn.length)return Y(fn,Mo),Wn&&Gt(fn,Xo),ho;if(Mo===null){for(;XoXo?(Qd=Mo,Mo=null):Qd=Mo.sibling;var CS=rr(fn,Mo,Ua.value,hr);if(CS===null){Mo===null&&(Mo=Qd);break}A&&Mo&&CS.alternate===null&&O(fn,Mo),Yt=Ce(CS,Yt,Xo),ko===null?ho=CS:ko.sibling=CS,ko=CS,Mo=Qd}if(Ua.done)return Y(fn,Mo),Wn&&Gt(fn,Xo),ho;if(Mo===null){for(;!Ua.done;Xo++,Ua=yn.next())Ua=dr(fn,Ua.value,hr),Ua!==null&&(Yt=Ce(Ua,Yt,Xo),ko===null?ho=Ua:ko.sibling=Ua,ko=Ua);return Wn&&Gt(fn,Xo),ho}for(Mo=ie(fn,Mo);!Ua.done;Xo++,Ua=yn.next())Ua=Hr(Mo,fn,Xo,Ua.value,hr),Ua!==null&&(A&&Ua.alternate!==null&&Mo.delete(Ua.key===null?Xo:Ua.key),Yt=Ce(Ua,Yt,Xo),ko===null?ho=Ua:ko.sibling=Ua,ko=Ua);return A&&Mo.forEach(function(DCt){return O(fn,DCt)}),Wn&&Gt(fn,Xo),ho}function Eu(fn,Yt,yn,hr){if(typeof yn=="object"&&yn!==null&&yn.type===j&&yn.key===null&&(yn=yn.props.children),typeof yn=="object"&&yn!==null){switch(yn.$$typeof){case C:e:{for(var ho=yn.key,ko=Yt;ko!==null;){if(ko.key===ho){if(ho=yn.type,ho===j){if(ko.tag===7){Y(fn,ko.sibling),Yt=me(ko,yn.props.children),Yt.return=fn,fn=Yt;break e}}else if(ko.elementType===ho||typeof ho=="object"&&ho!==null&&ho.$$typeof===D&&Ys(ho)===ko.type){Y(fn,ko.sibling),Yt=me(ko,yn.props),Yt.ref=zo(fn,ko,yn),Yt.return=fn,fn=Yt;break e}Y(fn,ko);break}else O(fn,ko);ko=ko.sibling}yn.type===j?(Yt=PN(yn.props.children,fn.mode,hr,yn.key),Yt.return=fn,fn=Yt):(hr=S8(yn.type,yn.key,yn.props,null,fn.mode,hr),hr.ref=zo(fn,Yt,yn),hr.return=fn,fn=hr)}return Fe(fn);case N:e:{for(ko=yn.key;Yt!==null;){if(Yt.key===ko)if(Yt.tag===4&&Yt.stateNode.containerInfo===yn.containerInfo&&Yt.stateNode.implementation===yn.implementation){Y(fn,Yt.sibling),Yt=me(Yt,yn.children||[]),Yt.return=fn,fn=Yt;break e}else{Y(fn,Yt);break}else O(fn,Yt);Yt=Yt.sibling}Yt=lQ(yn,fn.mode,hr),Yt.return=fn,fn=Yt}return Fe(fn);case D:return ko=yn._init,Eu(fn,Yt,ko(yn._payload),hr)}if(_e(yn))return oo(fn,Yt,yn,hr);if(B(yn))return co(fn,Yt,yn,hr);Fi(fn,yn)}return typeof yn=="string"&&yn!==""||typeof yn=="number"?(yn=""+yn,Yt!==null&&Yt.tag===6?(Y(fn,Yt.sibling),Yt=me(Yt,yn),Yt.return=fn,fn=Yt):(Y(fn,Yt),Yt=sQ(yn,fn.mode,hr),Yt.return=fn,fn=Yt),Fe(fn)):Y(fn,Yt)}return Eu}var Uc=qu(!0),zl=qu(!1),Nu=km(null),Ku=null,vl=null,Qi=null;function Ra(){Qi=vl=Ku=null}function bl(A){var O=Nu.current;ts(Nu),A._currentValue=O}function Oa(A,O,Y){for(;A!==null;){var ie=A.alternate;if((A.childLanes&O)!==O?(A.childLanes|=O,ie!==null&&(ie.childLanes|=O)):ie!==null&&(ie.childLanes&O)!==O&&(ie.childLanes|=O),A===Y)break;A=A.return}}function ac(A,O){Ku=A,Qi=vl=null,A=A.dependencies,A!==null&&A.firstContext!==null&&((A.lanes&O)!==0&&(Bh=!0),A.firstContext=null)}function sc(A){var O=A._currentValue;if(Qi!==A)if(A={context:A,memoizedValue:O,next:null},vl===null){if(Ku===null)throw Error(n(308));vl=A,Ku.dependencies={lanes:0,firstContext:A}}else vl=vl.next=A;return O}var As=null;function qd(A){As===null?As=[A]:As.push(A)}function ys(A,O,Y,ie){var me=O.interleaved;return me===null?(Y.next=Y,qd(O)):(Y.next=me.next,me.next=Y),O.interleaved=Y,Ts(A,ie)}function Ts(A,O){A.lanes|=O;var Y=A.alternate;for(Y!==null&&(Y.lanes|=O),Y=A,A=A.return;A!==null;)A.childLanes|=O,Y=A.alternate,Y!==null&&(Y.childLanes|=O),Y=A,A=A.return;return Y.tag===3?Y.stateNode:null}var Wc=!1;function hd(A){A.updateQueue={baseState:A.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function op(A,O){A=A.updateQueue,O.updateQueue===A&&(O.updateQueue={baseState:A.baseState,firstBaseUpdate:A.firstBaseUpdate,lastBaseUpdate:A.lastBaseUpdate,shared:A.shared,effects:A.effects})}function Nc(A,O){return{eventTime:A,lane:O,tag:0,payload:null,callback:null,next:null}}function jc(A,O,Y){var ie=A.updateQueue;if(ie===null)return null;if(ie=ie.shared,($a&2)!==0){var me=ie.pending;return me===null?O.next=O:(O.next=me.next,me.next=O),ie.pending=O,Ts(A,Y)}return me=ie.interleaved,me===null?(O.next=O,qd(ie)):(O.next=me.next,me.next=O),ie.interleaved=O,Ts(A,Y)}function Kd(A,O,Y){if(O=O.updateQueue,O!==null&&(O=O.shared,(Y&4194240)!==0)){var ie=O.lanes;ie&=A.pendingLanes,Y|=ie,O.lanes=Y,Wi(A,Y)}}function ks(A,O){var Y=A.updateQueue,ie=A.alternate;if(ie!==null&&(ie=ie.updateQueue,Y===ie)){var me=null,Ce=null;if(Y=Y.firstBaseUpdate,Y!==null){do{var Fe={eventTime:Y.eventTime,lane:Y.lane,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null};Ce===null?me=Ce=Fe:Ce=Ce.next=Fe,Y=Y.next}while(Y!==null);Ce===null?me=Ce=O:Ce=Ce.next=O}else me=Ce=O;Y={baseState:ie.baseState,firstBaseUpdate:me,lastBaseUpdate:Ce,shared:ie.shared,effects:ie.effects},A.updateQueue=Y;return}A=Y.lastBaseUpdate,A===null?Y.firstBaseUpdate=O:A.next=O,Y.lastBaseUpdate=O}function Yd(A,O,Y,ie){var me=A.updateQueue;Wc=!1;var Ce=me.firstBaseUpdate,Fe=me.lastBaseUpdate,St=me.shared.pending;if(St!==null){me.shared.pending=null;var Dt=St,Cn=Dt.next;Dt.next=null,Fe===null?Ce=Cn:Fe.next=Cn,Fe=Dt;var ir=A.alternate;ir!==null&&(ir=ir.updateQueue,St=ir.lastBaseUpdate,St!==Fe&&(St===null?ir.firstBaseUpdate=Cn:St.next=Cn,ir.lastBaseUpdate=Dt))}if(Ce!==null){var dr=me.baseState;Fe=0,ir=Cn=Dt=null,St=Ce;do{var rr=St.lane,Hr=St.eventTime;if((ie&rr)===rr){ir!==null&&(ir=ir.next={eventTime:Hr,lane:0,tag:St.tag,payload:St.payload,callback:St.callback,next:null});e:{var oo=A,co=St;switch(rr=O,Hr=Y,co.tag){case 1:if(oo=co.payload,typeof oo=="function"){dr=oo.call(Hr,dr,rr);break e}dr=oo;break e;case 3:oo.flags=oo.flags&-65537|128;case 0:if(oo=co.payload,rr=typeof oo=="function"?oo.call(Hr,dr,rr):oo,rr==null)break e;dr=G({},dr,rr);break e;case 2:Wc=!0}}St.callback!==null&&St.lane!==0&&(A.flags|=64,rr=me.effects,rr===null?me.effects=[St]:rr.push(St))}else Hr={eventTime:Hr,lane:rr,tag:St.tag,payload:St.payload,callback:St.callback,next:null},ir===null?(Cn=ir=Hr,Dt=dr):ir=ir.next=Hr,Fe|=rr;if(St=St.next,St===null){if(St=me.shared.pending,St===null)break;rr=St,St=rr.next,rr.next=null,me.lastBaseUpdate=rr,me.shared.pending=null}}while(!0);if(ir===null&&(Dt=dr),me.baseState=Dt,me.firstBaseUpdate=Cn,me.lastBaseUpdate=ir,O=me.shared.interleaved,O!==null){me=O;do Fe|=me.lane,me=me.next;while(me!==O)}else Ce===null&&(me.shared.lanes=0);jN|=Fe,A.lanes=Fe,A.memoizedState=dr}}function zh(A,O,Y){if(A=O.effects,O.effects=null,A!==null)for(O=0;OY?Y:4,A(!0);var ie=k5.transition;k5.transition={};try{A(!1),O()}finally{Jr=Y,k5.transition=ie}}function OSe(){return Wp().memoizedState}function sCt(A,O,Y){var ie=bS(A);if(Y={lane:ie,action:Y,hasEagerState:!1,eagerState:null,next:null},$Se(A))DSe(O,Y);else if(Y=ys(A,O,Y,ie),Y!==null){var me=Kp();ux(Y,A,ie,me),LSe(Y,O,ie)}}function lCt(A,O,Y){var ie=bS(A),me={lane:ie,action:Y,hasEagerState:!1,eagerState:null,next:null};if($Se(A))DSe(O,me);else{var Ce=A.alternate;if(A.lanes===0&&(Ce===null||Ce.lanes===0)&&(Ce=O.lastRenderedReducer,Ce!==null))try{var Fe=O.lastRenderedState,St=Ce(Fe,Y);if(me.hasEagerState=!0,me.eagerState=St,xl(St,Fe)){var Dt=O.interleaved;Dt===null?(me.next=me,qd(O)):(me.next=Dt.next,Dt.next=me),O.interleaved=me;return}}catch{}finally{}Y=ys(A,O,me,ie),Y!==null&&(me=Kp(),ux(Y,A,ie,me),LSe(Y,O,ie))}}function $Se(A){var O=A.alternate;return A===wl||O!==null&&O===wl}function DSe(A,O){ix=hS=!0;var Y=A.pending;Y===null?O.next=O:(O.next=Y.next,Y.next=O),A.pending=O}function LSe(A,O,Y){if((Y&4194240)!==0){var ie=O.lanes;ie&=A.pendingLanes,Y|=ie,O.lanes=Y,Wi(A,Y)}}var l8={readContext:sc,useCallback:ju,useContext:ju,useEffect:ju,useImperativeHandle:ju,useInsertionEffect:ju,useLayoutEffect:ju,useMemo:ju,useReducer:ju,useRef:ju,useState:ju,useDebugValue:ju,useDeferredValue:ju,useTransition:ju,useMutableSource:ju,useSyncExternalStore:ju,useId:ju,unstable_isNewReconciler:!1},cCt={readContext:sc,useCallback:function(A,O){return Om().memoizedState=[A,O===void 0?null:O],A},useContext:sc,useEffect:$5,useImperativeHandle:function(A,O,Y){return Y=Y!=null?Y.concat([A]):null,$m(4194308,4,F5.bind(null,O,A),Y)},useLayoutEffect:function(A,O){return $m(4194308,4,A,O)},useInsertionEffect:function(A,O){return $m(4,2,A,O)},useMemo:function(A,O){var Y=Om();return O=O===void 0?null:O,A=A(),Y.memoizedState=[A,O],A},useReducer:function(A,O,Y){var ie=Om();return O=Y!==void 0?Y(O):O,ie.memoizedState=ie.baseState=O,A={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:A,lastRenderedState:O},ie.queue=A,A=A.dispatch=sCt.bind(null,wl,A),[ie.memoizedState,A]},useRef:function(A){var O=Om();return A={current:A},O.memoizedState=A},useState:NN,useDebugValue:RX,useDeferredValue:function(A){return Om().memoizedState=A},useTransition:function(){var A=NN(!1),O=A[0];return A=aCt.bind(null,A[1]),Om().memoizedState=A,[O,A]},useMutableSource:function(){},useSyncExternalStore:function(A,O,Y){var ie=wl,me=Om();if(Wn){if(Y===void 0)throw Error(n(407));Y=Y()}else{if(Y=O(),Xd===null)throw Error(n(349));(Pg&30)!==0||i8(ie,O,Y)}me.memoizedState=Y;var Ce={value:Y,getSnapshot:O};return me.queue=Ce,$5(a8.bind(null,ie,Ce,A),[A]),ie.flags|=2048,Gp(9,A4.bind(null,ie,Ce,Y,O),void 0,null),Y},useId:function(){var A=Om(),O=Xd.identifierPrefix;if(Wn){var Y=ft,ie=cn;Y=(ie&~(1<<32-gt(ie)-1)).toString(32)+Y,O=":"+O+"R"+Y,Y=mS++,0<\/script>",A=A.removeChild(A.firstChild)):typeof ie.is=="string"?A=Fe.createElement(Y,{is:ie.is}):(A=Fe.createElement(Y),Y==="select"&&(Fe=A,ie.multiple?Fe.multiple=!0:ie.size&&(Fe.size=ie.size))):A=Fe.createElementNS(A,Y),A[Fh]=O,A[tx]=ie,o2e(A,O,!1,!1),O.stateNode=A;e:{switch(Fe=bt(Y,ie),Y){case"dialog":Va("cancel",A),Va("close",A),me=ie;break;case"iframe":case"object":case"embed":Va("load",A),me=ie;break;case"video":case"audio":for(me=0;meV5&&(O.flags|=128,ie=!0,T4(Ce,!1),O.lanes=4194304)}else{if(!ie)if(A=Rm(Fe),A!==null){if(O.flags|=128,ie=!0,Y=A.updateQueue,Y!==null&&(O.updateQueue=Y,O.flags|=4),T4(Ce,!0),Ce.tail===null&&Ce.tailMode==="hidden"&&!Fe.alternate&&!Wn)return ip(O),null}else 2*xn()-Ce.renderingStartTime>V5&&Y!==1073741824&&(O.flags|=128,ie=!0,T4(Ce,!1),O.lanes=4194304);Ce.isBackwards?(Fe.sibling=O.child,O.child=Fe):(Y=Ce.last,Y!==null?Y.sibling=Fe:O.child=Fe,Ce.last=Fe)}return Ce.tail!==null?(O=Ce.tail,Ce.rendering=O,Ce.tail=O.sibling,Ce.renderingStartTime=xn(),O.sibling=null,Y=ol.current,xs(ol,ie?Y&1|2:Y&1),O):(ip(O),null);case 22:case 23:return oQ(),ie=O.memoizedState!==null,A!==null&&A.memoizedState!==null!==ie&&(O.flags|=8192),ie&&(O.mode&1)!==0?(Dm&1073741824)!==0&&(ip(O),O.subtreeFlags&6&&(O.flags|=8192)):ip(O),null;case 24:return null;case 25:return null}throw Error(n(156,O.tag))}function xCt(A,O){switch(pn(O),O.tag){case 1:return rp(O.type)&&A5(),A=O.flags,A&65536?(O.flags=A&-65537|128,O):null;case 3:return _g(),ts(np),ts(pd),_4(),A=O.flags,(A&65536)!==0&&(A&128)===0?(O.flags=A&-65537|128,O):null;case 5:return E4(O),null;case 13:if(ts(ol),A=O.memoizedState,A!==null&&A.dehydrated!==null){if(O.alternate===null)throw Error(n(340));Gr()}return A=O.flags,A&65536?(O.flags=A&-65537|128,O):null;case 19:return ts(ol),null;case 4:return _g(),null;case 10:return bl(O.type._context),null;case 22:case 23:return oQ(),null;case 24:return null;default:return null}}var f8=!1,ap=!1,yCt=typeof WeakSet=="function"?WeakSet:Set,Yr=null;function B5(A,O){var Y=A.ref;if(Y!==null)if(typeof Y=="function")try{Y(null)}catch(ie){qc(A,O,ie)}else Y.current=null}function GX(A,O,Y){try{Y()}catch(ie){qc(A,O,ie)}}var s2e=!1;function vCt(A,O){if(Er=ht,A=Fl(),Vp(A)){if("selectionStart"in A)var Y={start:A.selectionStart,end:A.selectionEnd};else e:{Y=(Y=A.ownerDocument)&&Y.defaultView||window;var ie=Y.getSelection&&Y.getSelection();if(ie&&ie.rangeCount!==0){Y=ie.anchorNode;var me=ie.anchorOffset,Ce=ie.focusNode;ie=ie.focusOffset;try{Y.nodeType,Ce.nodeType}catch{Y=null;break e}var Fe=0,St=-1,Dt=-1,Cn=0,ir=0,dr=A,rr=null;t:for(;;){for(var Hr;dr!==Y||me!==0&&dr.nodeType!==3||(St=Fe+me),dr!==Ce||ie!==0&&dr.nodeType!==3||(Dt=Fe+ie),dr.nodeType===3&&(Fe+=dr.nodeValue.length),(Hr=dr.firstChild)!==null;)rr=dr,dr=Hr;for(;;){if(dr===A)break t;if(rr===Y&&++Cn===me&&(St=Fe),rr===Ce&&++ir===ie&&(Dt=Fe),(Hr=dr.nextSibling)!==null)break;dr=rr,rr=dr.parentNode}dr=Hr}Y=St===-1||Dt===-1?null:{start:St,end:Dt}}else Y=null}Y=Y||{start:0,end:0}}else Y=null;for(mo={focusedElem:A,selectionRange:Y},ht=!1,Yr=O;Yr!==null;)if(O=Yr,A=O.child,(O.subtreeFlags&1028)!==0&&A!==null)A.return=O,Yr=A;else for(;Yr!==null;){O=Yr;try{var oo=O.alternate;if((O.flags&1024)!==0)switch(O.tag){case 0:case 11:case 15:break;case 1:if(oo!==null){var co=oo.memoizedProps,Eu=oo.memoizedState,fn=O.stateNode,Yt=fn.getSnapshotBeforeUpdate(O.elementType===O.type?co:sx(O.type,co),Eu);fn.__reactInternalSnapshotBeforeUpdate=Yt}break;case 3:var yn=O.stateNode.containerInfo;yn.nodeType===1?yn.textContent="":yn.nodeType===9&&yn.documentElement&&yn.removeChild(yn.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(hr){qc(O,O.return,hr)}if(A=O.sibling,A!==null){A.return=O.return,Yr=A;break}Yr=O.return}return oo=s2e,s2e=!1,oo}function k4(A,O,Y){var ie=O.updateQueue;if(ie=ie!==null?ie.lastEffect:null,ie!==null){var me=ie=ie.next;do{if((me.tag&A)===A){var Ce=me.destroy;me.destroy=void 0,Ce!==void 0&&GX(O,Y,Ce)}me=me.next}while(me!==ie)}}function p8(A,O){if(O=O.updateQueue,O=O!==null?O.lastEffect:null,O!==null){var Y=O=O.next;do{if((Y.tag&A)===A){var ie=Y.create;Y.destroy=ie()}Y=Y.next}while(Y!==O)}}function qX(A){var O=A.ref;if(O!==null){var Y=A.stateNode;switch(A.tag){case 5:A=Y;break;default:A=Y}typeof O=="function"?O(A):O.current=A}}function l2e(A){var O=A.alternate;O!==null&&(A.alternate=null,l2e(O)),A.child=null,A.deletions=null,A.sibling=null,A.tag===5&&(O=A.stateNode,O!==null&&(delete O[Fh],delete O[tx],delete O[Cu],delete O[S4],delete O[C4])),A.stateNode=null,A.return=null,A.dependencies=null,A.memoizedProps=null,A.memoizedState=null,A.pendingProps=null,A.stateNode=null,A.updateQueue=null}function c2e(A){return A.tag===5||A.tag===3||A.tag===4}function u2e(A){e:for(;;){for(;A.sibling===null;){if(A.return===null||c2e(A.return))return null;A=A.return}for(A.sibling.return=A.return,A=A.sibling;A.tag!==5&&A.tag!==6&&A.tag!==18;){if(A.flags&2||A.child===null||A.tag===4)continue e;A.child.return=A,A=A.child}if(!(A.flags&2))return A.stateNode}}function KX(A,O,Y){var ie=A.tag;if(ie===5||ie===6)A=A.stateNode,O?Y.nodeType===8?Y.parentNode.insertBefore(A,O):Y.insertBefore(A,O):(Y.nodeType===8?(O=Y.parentNode,O.insertBefore(A,Y)):(O=Y,O.appendChild(A)),Y=Y._reactRootContainer,Y!=null||O.onclick!==null||(O.onclick=Xn));else if(ie!==4&&(A=A.child,A!==null))for(KX(A,O,Y),A=A.sibling;A!==null;)KX(A,O,Y),A=A.sibling}function YX(A,O,Y){var ie=A.tag;if(ie===5||ie===6)A=A.stateNode,O?Y.insertBefore(A,O):Y.appendChild(A);else if(ie!==4&&(A=A.child,A!==null))for(YX(A,O,Y),A=A.sibling;A!==null;)YX(A,O,Y),A=A.sibling}var _f=null,lx=!1;function xS(A,O,Y){for(Y=Y.child;Y!==null;)d2e(A,O,Y),Y=Y.sibling}function d2e(A,O,Y){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(it,Y)}catch{}switch(Y.tag){case 5:ap||B5(Y,O);case 6:var ie=_f,me=lx;_f=null,xS(A,O,Y),_f=ie,lx=me,_f!==null&&(lx?(A=_f,Y=Y.stateNode,A.nodeType===8?A.parentNode.removeChild(Y):A.removeChild(Y)):_f.removeChild(Y.stateNode));break;case 18:_f!==null&&(lx?(A=_f,Y=Y.stateNode,A.nodeType===8?bN(A.parentNode,Y):A.nodeType===1&&bN(A,Y),Vc(A)):bN(_f,Y.stateNode));break;case 4:ie=_f,me=lx,_f=Y.stateNode.containerInfo,lx=!0,xS(A,O,Y),_f=ie,lx=me;break;case 0:case 11:case 14:case 15:if(!ap&&(ie=Y.updateQueue,ie!==null&&(ie=ie.lastEffect,ie!==null))){me=ie=ie.next;do{var Ce=me,Fe=Ce.destroy;Ce=Ce.tag,Fe!==void 0&&((Ce&2)!==0||(Ce&4)!==0)&&GX(Y,O,Fe),me=me.next}while(me!==ie)}xS(A,O,Y);break;case 1:if(!ap&&(B5(Y,O),ie=Y.stateNode,typeof ie.componentWillUnmount=="function"))try{ie.props=Y.memoizedProps,ie.state=Y.memoizedState,ie.componentWillUnmount()}catch(St){qc(Y,O,St)}xS(A,O,Y);break;case 21:xS(A,O,Y);break;case 22:Y.mode&1?(ap=(ie=ap)||Y.memoizedState!==null,xS(A,O,Y),ap=ie):xS(A,O,Y);break;default:xS(A,O,Y)}}function f2e(A){var O=A.updateQueue;if(O!==null){A.updateQueue=null;var Y=A.stateNode;Y===null&&(Y=A.stateNode=new yCt),O.forEach(function(ie){var me=_Ct.bind(null,A,ie);Y.has(ie)||(Y.add(ie),ie.then(me,me))})}}function cx(A,O){var Y=O.deletions;if(Y!==null)for(var ie=0;ieme&&(me=Fe),ie&=~Ce}if(ie=me,ie=xn()-ie,ie=(120>ie?120:480>ie?480:1080>ie?1080:1920>ie?1920:3e3>ie?3e3:4320>ie?4320:1960*wCt(ie/1960))-ie,10A?16:A,vS===null)var ie=!1;else{if(A=vS,vS=null,y8=0,($a&6)!==0)throw Error(n(331));var me=$a;for($a|=4,Yr=A.current;Yr!==null;){var Ce=Yr,Fe=Ce.child;if((Yr.flags&16)!==0){var St=Ce.deletions;if(St!==null){for(var Dt=0;Dtxn()-JX?IN(A,0):QX|=Y),Vh(A,O)}function j2e(A,O){O===0&&((A.mode&1)===0?O=1:(O=po,po<<=1,(po&130023424)===0&&(po=4194304)));var Y=Kp();A=Ts(A,O),A!==null&&(Ao(A,O,Y),Vh(A,Y))}function ICt(A){var O=A.memoizedState,Y=0;O!==null&&(Y=O.retryLane),j2e(A,Y)}function _Ct(A,O){var Y=0;switch(A.tag){case 13:var ie=A.stateNode,me=A.memoizedState;me!==null&&(Y=me.retryLane);break;case 19:ie=A.stateNode;break;default:throw Error(n(314))}ie!==null&&ie.delete(O),j2e(A,Y)}var E2e;E2e=function(A,O,Y){if(A!==null)if(A.memoizedProps!==O.pendingProps||np.current)Bh=!0;else{if((A.lanes&Y)===0&&(O.flags&128)===0)return Bh=!1,mCt(A,O,Y);Bh=(A.flags&131072)!==0}else Bh=!1,Wn&&(O.flags&1048576)!==0&&an(O,tt,O.index);switch(O.lanes=0,O.tag){case 2:var ie=O.type;d8(A,O),A=O.pendingProps;var me=fS(O,pd.current);ac(O,Y),me=SN(null,O,ie,A,me,Y);var Ce=Ag();return O.flags|=1,typeof me=="object"&&me!==null&&typeof me.render=="function"&&me.$$typeof===void 0?(O.tag=1,O.memoizedState=null,O.updateQueue=null,rp(ie)?(Ce=!0,Gb(O)):Ce=!1,O.memoizedState=me.state!==null&&me.state!==void 0?me.state:null,hd(O),me.updater=c8,O.stateNode=me,me._reactInternals=O,$X(O,ie,A,Y),O=zX(null,O,ie,!0,Ce,Y)):(O.tag=0,Wn&&Ce&&$n(O),qp(null,O,me,Y),O=O.child),O;case 16:ie=O.elementType;e:{switch(d8(A,O),A=O.pendingProps,me=ie._init,ie=me(ie._payload),O.type=ie,me=O.tag=ACt(ie),A=sx(ie,A),me){case 0:O=FX(null,O,ie,A,Y);break e;case 1:O=JSe(null,O,ie,A,Y);break e;case 11:O=qSe(null,O,ie,A,Y);break e;case 14:O=KSe(null,O,ie,sx(ie.type,A),Y);break e}throw Error(n(306,ie,""))}return O;case 0:return ie=O.type,me=O.pendingProps,me=O.elementType===ie?me:sx(ie,me),FX(A,O,ie,me,Y);case 1:return ie=O.type,me=O.pendingProps,me=O.elementType===ie?me:sx(ie,me),JSe(A,O,ie,me,Y);case 3:e:{if(ZSe(O),A===null)throw Error(n(387));ie=O.pendingProps,Ce=O.memoizedState,me=Ce.element,op(A,O),Yd(O,ie,null,Y);var Fe=O.memoizedState;if(ie=Fe.element,Ce.isDehydrated)if(Ce={element:ie,isDehydrated:!1,cache:Fe.cache,pendingSuspenseBoundaries:Fe.pendingSuspenseBoundaries,transitions:Fe.transitions},O.updateQueue.baseState=Ce,O.memoizedState=Ce,O.flags&256){me=z5(Error(n(423)),O),O=e2e(A,O,ie,Y,me);break e}else if(ie!==me){me=z5(Error(n(424)),O),O=e2e(A,O,ie,Y,me);break e}else for(Rn=dd(O.stateNode.containerInfo.firstChild),_n=O,Wn=!0,Gn=null,Y=zl(O,null,ie,Y),O.child=Y;Y;)Y.flags=Y.flags&-3|4096,Y=Y.sibling;else{if(Gr(),ie===me){O=Kb(A,O,Y);break e}qp(A,O,ie,Y)}O=O.child}return O;case 5:return r8(O),A===null&&eo(O),ie=O.type,me=O.pendingProps,Ce=A!==null?A.memoizedProps:null,Fe=me.children,fi(ie,me)?Fe=null:Ce!==null&&fi(ie,Ce)&&(O.flags|=32),QSe(A,O),qp(A,O,Fe,Y),O.child;case 6:return A===null&&eo(O),null;case 13:return t2e(A,O,Y);case 4:return pS(O,O.stateNode.containerInfo),ie=O.pendingProps,A===null?O.child=Uc(O,null,ie,Y):qp(A,O,ie,Y),O.child;case 11:return ie=O.type,me=O.pendingProps,me=O.elementType===ie?me:sx(ie,me),qSe(A,O,ie,me,Y);case 7:return qp(A,O,O.pendingProps,Y),O.child;case 8:return qp(A,O,O.pendingProps.children,Y),O.child;case 12:return qp(A,O,O.pendingProps.children,Y),O.child;case 10:e:{if(ie=O.type._context,me=O.pendingProps,Ce=O.memoizedProps,Fe=me.value,xs(Nu,ie._currentValue),ie._currentValue=Fe,Ce!==null)if(xl(Ce.value,Fe)){if(Ce.children===me.children&&!np.current){O=Kb(A,O,Y);break e}}else for(Ce=O.child,Ce!==null&&(Ce.return=O);Ce!==null;){var St=Ce.dependencies;if(St!==null){Fe=Ce.child;for(var Dt=St.firstContext;Dt!==null;){if(Dt.context===ie){if(Ce.tag===1){Dt=Nc(-1,Y&-Y),Dt.tag=2;var Cn=Ce.updateQueue;if(Cn!==null){Cn=Cn.shared;var ir=Cn.pending;ir===null?Dt.next=Dt:(Dt.next=ir.next,ir.next=Dt),Cn.pending=Dt}}Ce.lanes|=Y,Dt=Ce.alternate,Dt!==null&&(Dt.lanes|=Y),Oa(Ce.return,Y,O),St.lanes|=Y;break}Dt=Dt.next}}else if(Ce.tag===10)Fe=Ce.type===O.type?null:Ce.child;else if(Ce.tag===18){if(Fe=Ce.return,Fe===null)throw Error(n(341));Fe.lanes|=Y,St=Fe.alternate,St!==null&&(St.lanes|=Y),Oa(Fe,Y,O),Fe=Ce.sibling}else Fe=Ce.child;if(Fe!==null)Fe.return=Ce;else for(Fe=Ce;Fe!==null;){if(Fe===O){Fe=null;break}if(Ce=Fe.sibling,Ce!==null){Ce.return=Fe.return,Fe=Ce;break}Fe=Fe.return}Ce=Fe}qp(A,O,me.children,Y),O=O.child}return O;case 9:return me=O.type,ie=O.pendingProps.children,ac(O,Y),me=sc(me),ie=ie(me),O.flags|=1,qp(A,O,ie,Y),O.child;case 14:return ie=O.type,me=sx(ie,O.pendingProps),me=sx(ie.type,me),KSe(A,O,ie,me,Y);case 15:return YSe(A,O,O.type,O.pendingProps,Y);case 17:return ie=O.type,me=O.pendingProps,me=O.elementType===ie?me:sx(ie,me),d8(A,O),O.tag=1,rp(ie)?(A=!0,Gb(O)):A=!1,ac(O,Y),zSe(O,ie,me),$X(O,ie,me,Y),zX(null,O,ie,!0,A,Y);case 19:return r2e(A,O,Y);case 22:return XSe(A,O,Y)}throw Error(n(156,O.tag))};function I2e(A,O){return xt(A,O)}function PCt(A,O,Y,ie){this.tag=A,this.key=Y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=O,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=ie,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kg(A,O,Y,ie){return new PCt(A,O,Y,ie)}function aQ(A){return A=A.prototype,!(!A||!A.isReactComponent)}function ACt(A){if(typeof A=="function")return aQ(A)?1:0;if(A!=null){if(A=A.$$typeof,A===E)return 11;if(A===$)return 14}return 2}function SS(A,O){var Y=A.alternate;return Y===null?(Y=kg(A.tag,O,A.key,A.mode),Y.elementType=A.elementType,Y.type=A.type,Y.stateNode=A.stateNode,Y.alternate=A,A.alternate=Y):(Y.pendingProps=O,Y.type=A.type,Y.flags=0,Y.subtreeFlags=0,Y.deletions=null),Y.flags=A.flags&14680064,Y.childLanes=A.childLanes,Y.lanes=A.lanes,Y.child=A.child,Y.memoizedProps=A.memoizedProps,Y.memoizedState=A.memoizedState,Y.updateQueue=A.updateQueue,O=A.dependencies,Y.dependencies=O===null?null:{lanes:O.lanes,firstContext:O.firstContext},Y.sibling=A.sibling,Y.index=A.index,Y.ref=A.ref,Y}function S8(A,O,Y,ie,me,Ce){var Fe=2;if(ie=A,typeof A=="function")aQ(A)&&(Fe=1);else if(typeof A=="string")Fe=5;else e:switch(A){case j:return PN(Y.children,me,Ce,O);case I:Fe=8,me|=8;break;case _:return A=kg(12,Y,O,me|2),A.elementType=_,A.lanes=Ce,A;case M:return A=kg(13,Y,O,me),A.elementType=M,A.lanes=Ce,A;case R:return A=kg(19,Y,O,me),A.elementType=R,A.lanes=Ce,A;case z:return C8(Y,me,Ce,O);default:if(typeof A=="object"&&A!==null)switch(A.$$typeof){case T:Fe=10;break e;case P:Fe=9;break e;case E:Fe=11;break e;case $:Fe=14;break e;case D:Fe=16,ie=null;break e}throw Error(n(130,A==null?A:typeof A,""))}return O=kg(Fe,Y,O,me),O.elementType=A,O.type=ie,O.lanes=Ce,O}function PN(A,O,Y,ie){return A=kg(7,A,ie,O),A.lanes=Y,A}function C8(A,O,Y,ie){return A=kg(22,A,ie,O),A.elementType=z,A.lanes=Y,A.stateNode={isHidden:!1},A}function sQ(A,O,Y){return A=kg(6,A,null,O),A.lanes=Y,A}function lQ(A,O,Y){return O=kg(4,A.children!==null?A.children:[],A.key,O),O.lanes=Y,O.stateNode={containerInfo:A.containerInfo,pendingChildren:null,implementation:A.implementation},O}function TCt(A,O,Y,ie,me){this.tag=O,this.containerInfo=A,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Fo(0),this.expirationTimes=Fo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fo(0),this.identifierPrefix=ie,this.onRecoverableError=me,this.mutableSourceEagerHydrationData=null}function cQ(A,O,Y,ie,me,Ce,Fe,St,Dt){return A=new TCt(A,O,Y,St,Dt),O===1?(O=1,Ce===!0&&(O|=8)):O=0,Ce=kg(3,null,null,O),A.current=Ce,Ce.stateNode=A,Ce.memoizedState={element:ie,isDehydrated:Y,cache:null,transitions:null,pendingSuspenseBoundaries:null},hd(Ce),A}function kCt(A,O,Y){var ie=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$Q.exports=KAt(),$Q.exports}var ACe;function YAt(){if(ACe)return F8;ACe=1;var e=Hqe();return F8.createRoot=e.createRoot,F8.hydrateRoot=e.hydrateRoot,F8}var Vqe=YAt();const XAt=Ba(Vqe);var pu=Hqe();const Uj=Ba(pu);/** * @remix-run/router v1.23.2 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function h3(){return h3=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function RG(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function JAt(){return Math.random().toString(36).substr(2,8)}function kCe(e,t){return{usr:e.state,key:e.key,idx:t}}function aie(e,t,n,r){return n===void 0&&(n=null),h3({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?KI(t):t,{state:n,key:t&&t.key||r||JAt()})}function _H(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function KI(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ZAt(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,l=T2.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(h3({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function p(){l=T2.Pop;let x=d(),v=x==null?null:x-u;u=x,c&&c({action:l,location:y.location,delta:v})}function h(x,v){l=T2.Push;let b=aie(y.location,x,v);n&&n(b,x),u=d()+1;let w=kCe(b,u),S=y.createHref(b);try{s.pushState(w,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(S)}i&&c&&c({action:l,location:y.location,delta:1})}function m(x,v){l=T2.Replace;let b=aie(y.location,x,v);n&&n(b,x),u=d();let w=kCe(b,u),S=y.createHref(b);s.replaceState(w,"",S),i&&c&&c({action:l,location:y.location,delta:0})}function g(x){let v=o.location.origin!=="null"?o.location.origin:o.location.href,b=typeof x=="string"?x:_H(x);return b=b.replace(/ $/,"%20"),Du(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let y={get action(){return l},get location(){return e(o,s)},listen(x){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(TCe,p),c=x,()=>{o.removeEventListener(TCe,p),c=null}},createHref(x){return t(o,x)},createURL:g,encodeLocation(x){let v=g(x);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:m,go(x){return s.go(x)}};return y}var MCe;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(MCe||(MCe={}));function eTt(e,t,n){return n===void 0&&(n="/"),tTt(e,t,n)}function tTt(e,t,n,r){let o=typeof t=="string"?KI(t):t,i=fme(o.pathname||"/",n);if(i==null)return null;let s=Uqe(e);nTt(s);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};c.relativePath.startsWith("/")&&(Du(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=J2([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(Du(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Uqe(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:cTt(u,i.index),routesMeta:d})};return e.forEach((i,s)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,s);else for(let c of Wqe(i.path))o(i,s,c)}),t}function Wqe(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=Wqe(r.join("/")),l=[];return l.push(...s.map(c=>c===""?i:[i,c].join("/"))),o&&l.push(...s),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function nTt(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:uTt(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const rTt=/^:[\w-]+$/,oTt=3,iTt=2,aTt=1,sTt=10,lTt=-2,RCe=e=>e==="*";function cTt(e,t){let n=e.split("/"),r=n.length;return n.some(RCe)&&(r+=lTt),t&&(r+=iTt),n.filter(o=>!RCe(o)).reduce((o,i)=>o+(rTt.test(i)?oTt:i===""?aTt:sTt),r)}function uTt(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function dTt(e,t,n){let{routesMeta:r}=e,o={},i="/",s=[];for(let l=0;l{let{paramName:h,isOptional:m}=d;if(h==="*"){let y=l[p]||"";s=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const g=l[p];return m&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function pTt(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),RG(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function hTt(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return RG(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function fme(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const mTt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gTt=e=>mTt.test(e);function xTt(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?KI(e):e,i;if(n)if(gTt(n))i=n;else{if(n.includes("//")){let s=n;n=n.replace(/\/\/+/g,"/"),RG(!1,"Pathnames cannot have embedded double slashes - normalizing "+(s+" -> "+n))}n.startsWith("/")?i=OCe(n.substring(1),"/"):i=OCe(n,t)}else i=t;return{pathname:i,search:bTt(r),hash:wTt(o)}}function OCe(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function FQ(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function yTt(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function pme(e,t){let n=yTt(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function hme(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=KI(e):(o=h3({},e),Du(!o.pathname||!o.pathname.includes("?"),FQ("?","pathname","search",o)),Du(!o.pathname||!o.pathname.includes("#"),FQ("#","pathname","hash",o)),Du(!o.search||!o.search.includes("#"),FQ("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,l;if(s==null)l=n;else{let p=t.length-1;if(!r&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),p-=1;o.pathname=h.join("/")}l=p>=0?t[p]:"/"}let c=xTt(o,l),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const J2=e=>e.join("/").replace(/\/\/+/g,"/"),vTt=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bTt=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,wTt=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function STt(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Gqe=["post","put","patch","delete"];new Set(Gqe);const CTt=["get",...Gqe];new Set(CTt);/** * React Router v6.30.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function m3(){return m3=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),f.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let p=hme(u,JSON.parse(s),i,d.relative==="path");e==null&&t!=="/"&&(p.pathname=p.pathname==="/"?t:J2([t,p.pathname])),(d.replace?r.replace:r.push)(p,d.state,d)},[t,r,s,i,e])}function ITt(){let{matches:e}=f.useContext(Dw),t=e[e.length-1];return t?t.params:{}}function Yqe(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=f.useContext(XC),{matches:o}=f.useContext(Dw),{pathname:i}=ZD(),s=JSON.stringify(pme(o,r.v7_relativeSplatPath));return f.useMemo(()=>hme(e,JSON.parse(s),i,n==="path"),[e,s,i,n])}function _Tt(e,t){return PTt(e,t)}function PTt(e,t,n,r){ak()||Du(!1);let{navigator:o}=f.useContext(XC),{matches:i}=f.useContext(Dw),s=i[i.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=ZD(),d;if(t){var p;let x=typeof t=="string"?KI(t):t;c==="/"||(p=x.pathname)!=null&&p.startsWith(c)||Du(!1),d=x}else d=u;let h=d.pathname||"/",m=h;if(c!=="/"){let x=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(x.length).join("/")}let g=eTt(e,{pathname:m}),y=RTt(g&&g.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:J2([c,o.encodeLocation?o.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:J2([c,o.encodeLocation?o.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return t&&y?f.createElement(OG.Provider,{value:{location:m3({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:T2.Pop}},y):y}function ATt(){let e=LTt(),t=STt(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),n?f.createElement("pre",{style:o},n):null,null)}const TTt=f.createElement(ATt,null);class kTt extends f.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?f.createElement(Dw.Provider,{value:this.props.routeContext},f.createElement(qqe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function MTt(e){let{routeContext:t,match:n,children:r}=e,o=f.useContext(mme);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),f.createElement(Dw.Provider,{value:t},r)}function RTt(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,l=(o=n)==null?void 0:o.errors;if(l!=null){let d=s.findIndex(p=>p.route.id&&(l==null?void 0:l[p.route.id])!==void 0);d>=0||Du(!1),s=s.slice(0,Math.min(s.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,p,h)=>{let m,g=!1,y=null,x=null;n&&(m=l&&p.route.id?l[p.route.id]:void 0,y=p.route.errorElement||TTt,c&&(u<0&&h===0?(zTt("route-fallback"),g=!0,x=null):u===h&&(g=!0,x=p.route.hydrateFallbackElement||null)));let v=t.concat(s.slice(0,h+1)),b=()=>{let w;return m?w=y:g?w=x:p.route.Component?w=f.createElement(p.route.Component,null):p.route.element?w=p.route.element:w=d,f.createElement(MTt,{match:p,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(p.route.ErrorBoundary||p.route.errorElement||h===0)?f.createElement(kTt,{location:n.location,revalidation:n.revalidation,component:y,error:m,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var Xqe=(function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e})(Xqe||{}),Qqe=(function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e})(Qqe||{});function OTt(e){let t=f.useContext(mme);return t||Du(!1),t}function $Tt(e){let t=f.useContext(NTt);return t||Du(!1),t}function DTt(e){let t=f.useContext(Dw);return t||Du(!1),t}function Jqe(e){let t=DTt(),n=t.matches[t.matches.length-1];return n.route.id||Du(!1),n.route.id}function LTt(){var e;let t=f.useContext(qqe),n=$Tt(),r=Jqe();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function FTt(){let{router:e}=OTt(Xqe.UseNavigateStable),t=Jqe(Qqe.UseNavigateStable),n=f.useRef(!1);return Kqe(()=>{n.current=!0}),f.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,m3({fromRouteId:t},i)))},[e,t])}const $Ce={};function zTt(e,t,n){$Ce[e]||($Ce[e]=!0)}function BTt(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function HTt(e){let{to:t,replace:n,state:r,relative:o}=e;ak()||Du(!1);let{future:i,static:s}=f.useContext(XC),{matches:l}=f.useContext(Dw),{pathname:c}=ZD(),u=sk(),d=hme(t,pme(l,i.v7_relativeSplatPath),c,o==="path"),p=JSON.stringify(d);return f.useEffect(()=>u(JSON.parse(p),{replace:n,state:r,relative:o}),[u,p,o,n,r]),null}function Z_(e){Du(!1)}function VTt(e){let{basename:t="/",children:n=null,location:r,navigationType:o=T2.Pop,navigator:i,static:s=!1,future:l}=e;ak()&&Du(!1);let c=t.replace(/^\/*/,"/"),u=f.useMemo(()=>({basename:c,navigator:i,static:s,future:m3({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof r=="string"&&(r=KI(r));let{pathname:d="/",search:p="",hash:h="",state:m=null,key:g="default"}=r,y=f.useMemo(()=>{let x=fme(d,c);return x==null?null:{location:{pathname:x,search:p,hash:h,state:m,key:g},navigationType:o}},[c,d,p,h,m,g,o]);return y==null?null:f.createElement(XC.Provider,{value:u},f.createElement(OG.Provider,{children:n,value:y}))}function UTt(e){let{children:t,location:n}=e;return _Tt(sie(t),n)}new Promise(()=>{});function sie(e,t){t===void 0&&(t=[]);let n=[];return f.Children.forEach(e,(r,o)=>{if(!f.isValidElement(r))return;let i=[...t,o];if(r.type===f.Fragment){n.push.apply(n,sie(r.props.children,i));return}r.type!==Z_&&Du(!1),!r.props.index||!r.props.children||Du(!1);let s={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=sie(r.props.children,i)),n.push(s)}),n}/** * React Router DOM v6.30.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function lie(){return lie=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function GTt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qTt(e,t){return e.button===0&&(!t||t==="_self")&&!GTt(e)}const KTt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],YTt="6";try{window.__reactRouterVersion=YTt}catch{}const XTt="startTransition",DCe=sw[XTt];function QTt(e){let{basename:t,children:n,future:r,window:o}=e,i=f.useRef();i.current==null&&(i.current=QAt({window:o,v5Compat:!0}));let s=i.current,[l,c]=f.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},d=f.useCallback(p=>{u&&DCe?DCe(()=>c(p)):c(p)},[c,u]);return f.useLayoutEffect(()=>s.listen(d),[s,d]),f.useEffect(()=>BTt(r),[r]),f.createElement(VTt,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:s,future:r})}const JTt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ZTt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,PH=f.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:l,target:c,to:u,preventScrollReset:d,viewTransition:p}=t,h=WTt(t,KTt),{basename:m}=f.useContext(XC),g,y=!1;if(typeof u=="string"&&ZTt.test(u)&&(g=u,JTt))try{let w=new URL(window.location.href),S=u.startsWith("//")?new URL(w.protocol+u):new URL(u),C=fme(S.pathname,m);S.origin===w.origin&&C!=null?u=C+S.search+S.hash:y=!0}catch{}let x=jTt(u,{relative:o}),v=ekt(u,{replace:s,state:l,target:c,preventScrollReset:d,relative:o,viewTransition:p});function b(w){r&&r(w),w.defaultPrevented||v(w)}return f.createElement("a",lie({},h,{href:g||x,onClick:y||i?r:b,ref:n,target:c}))});var LCe;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(LCe||(LCe={}));var FCe;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(FCe||(FCe={}));function ekt(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s,viewTransition:l}=t===void 0?{}:t,c=sk(),u=ZD(),d=Yqe(e,{relative:s});return f.useCallback(p=>{if(qTt(p,n)){p.preventDefault();let h=r!==void 0?r:_H(u)===_H(d);c(e,{replace:h,state:o,preventScrollReset:i,relative:s,viewTransition:l})}},[u,c,d,r,o,n,e,i,s,l])}function lw(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const qv="$$material";function Se(){return Se=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?Of(lk,--pm):0,ZA--,ed===10&&(ZA=1,DG--),ed}function ig(){return ed=pm2||x3(ed)>3?"":" "}function hkt(e,t){for(;--t&&ig()&&!(ed<48||ed>102||ed>57&&ed<65||ed>70&&ed<97););return eL(e,Mz()+(t<6&&Kv()==32&&ig()==32))}function uie(e){for(;ig();)switch(ed){case e:return pm;case 34:case 39:e!==34&&e!==39&&uie(ed);break;case 40:e===41&&uie(e);break;case 92:ig();break}return pm}function mkt(e,t){for(;ig()&&e+ed!==57;)if(e+ed===84&&Kv()===47)break;return"/*"+eL(t,pm-1)+"*"+$G(e===47?e:ig())}function gkt(e){for(;!x3(Kv());)ig();return eL(e,pm)}function xkt(e){return oKe(Oz("",null,null,null,[""],e=rKe(e),0,[0],e))}function Oz(e,t,n,r,o,i,s,l,c){for(var u=0,d=0,p=s,h=0,m=0,g=0,y=1,x=1,v=1,b=0,w="",S=o,C=i,N=r,j=w;x;)switch(g=b,b=ig()){case 40:if(g!=108&&Of(j,p-1)==58){cie(j+=as(Rz(b),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:j+=Rz(b);break;case 9:case 10:case 13:case 32:j+=pkt(g);break;case 92:j+=hkt(Mz()-1,7);continue;case 47:switch(Kv()){case 42:case 47:z8(ykt(mkt(ig(),Mz()),t,n),c);break;default:j+="/"}break;case 123*y:l[u++]=xv(j)*v;case 125*y:case 59:case 0:switch(b){case 0:case 125:x=0;case 59+d:v==-1&&(j=as(j,/\f/g,"")),m>0&&xv(j)-p&&z8(m>32?BCe(j+";",r,n,p-1):BCe(as(j," ","")+";",r,n,p-2),c);break;case 59:j+=";";default:if(z8(N=zCe(j,t,n,u,d,o,l,w,S=[],C=[],p),i),b===123)if(d===0)Oz(j,t,N,N,S,i,p,l,C);else switch(h===99&&Of(j,3)===110?100:h){case 100:case 108:case 109:case 115:Oz(e,N,N,r&&z8(zCe(e,N,N,0,0,o,l,w,o,S=[],p),C),o,C,p,l,r?S:C);break;default:Oz(j,N,N,N,[""],C,0,l,C)}}u=d=m=0,y=v=1,w=j="",p=s;break;case 58:p=1+xv(j),m=g;default:if(y<1){if(b==123)--y;else if(b==125&&y++==0&&fkt()==125)continue}switch(j+=$G(b),b*y){case 38:v=d>0?1:(j+="\f",-1);break;case 44:l[u++]=(xv(j)-1)*v,v=1;break;case 64:Kv()===45&&(j+=Rz(ig())),h=Kv(),d=p=xv(w=j+=gkt(Mz())),b++;break;case 45:g===45&&xv(j)==2&&(y=0)}}return i}function zCe(e,t,n,r,o,i,s,l,c,u,d){for(var p=o-1,h=o===0?i:[""],m=yme(h),g=0,y=0,x=0;g0?h[v]+" "+b:as(b,/&\f/g,h[v])))&&(c[x++]=w);return LG(e,t,n,o===0?gme:l,c,u,d)}function ykt(e,t,n){return LG(e,t,n,Zqe,$G(dkt()),g3(e,2,-2),0)}function BCe(e,t,n,r){return LG(e,t,n,xme,g3(e,0,r),g3(e,r+1,-1),r)}function nA(e,t){for(var n="",r=yme(e),o=0;o6)switch(Of(e,t+1)){case 109:if(Of(e,t+4)!==45)break;case 102:return as(e,/(.+:)(.+)-([^]+)/,"$1"+os+"$2-$3$1"+AH+(Of(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~cie(e,"stretch")?aKe(as(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Of(e,t+1)!==115)break;case 6444:switch(Of(e,xv(e)-3-(~cie(e,"!important")&&10))){case 107:return as(e,":",":"+os)+e;case 101:return as(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+os+(Of(e,14)===45?"inline-":"")+"box$3$1"+os+"$2$3$1"+pp+"$2box$3")+e}break;case 5936:switch(Of(e,t+11)){case 114:return os+e+pp+as(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return os+e+pp+as(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return os+e+pp+as(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return os+e+pp+e+e}return e}var Ikt=function(t,n,r,o){if(t.length>-1&&!t.return)switch(t.type){case xme:t.return=aKe(t.value,t.length);break;case eKe:return nA([V4(t,{value:as(t.value,"@","@"+os)})],o);case gme:if(t.length)return ukt(t.props,function(i){switch(ckt(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return nA([V4(t,{props:[as(i,/:(read-\w+)/,":"+AH+"$1")]})],o);case"::placeholder":return nA([V4(t,{props:[as(i,/:(plac\w+)/,":"+os+"input-$1")]}),V4(t,{props:[as(i,/:(plac\w+)/,":"+AH+"$1")]}),V4(t,{props:[as(i,/:(plac\w+)/,pp+"input-$1")]})],o)}return""})}},_kt=[Ikt],Pkt=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(y){var x=y.getAttribute("data-emotion");x.indexOf(" ")!==-1&&(document.head.appendChild(y),y.setAttribute("data-s",""))})}var o=t.stylisPlugins||_kt,i={},s,l=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(y){for(var x=y.getAttribute("data-emotion").split(" "),v=1;v=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Okt={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},$kt=/[A-Z]|^ms/g,Dkt=/_EMO_([^_]+?)_([^]*?)_EMO_/g,lKe=function(t){return t.charCodeAt(1)===45},GCe=function(t){return t!=null&&typeof t!="boolean"},HQ=iKe(function(e){return lKe(e)?e:e.replace($kt,"-$&").toLowerCase()}),qCe=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(Dkt,function(r,o,i){return yv={name:o,styles:i,next:yv},o})}return Okt[t]!==1&&!lKe(t)&&typeof n=="number"&&n!==0?n+"px":n};function y3(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var o=n;if(o.anim===1)return yv={name:o.name,styles:o.styles,next:yv},o.name;var i=n;if(i.styles!==void 0){var s=i.next;if(s!==void 0)for(;s!==void 0;)yv={name:s.name,styles:s.styles,next:yv},s=s.next;var l=i.styles+";";return l}return Lkt(e,t,n)}case"function":{if(e!==void 0){var c=yv,u=n(e);return yv=c,y3(e,t,u)}break}}var d=n;if(t==null)return d;var p=t[d];return p!==void 0?p:d}function Lkt(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o96?qkt:Kkt},QCe=function(t,n,r){var o;if(n){var i=n.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(s){return t.__emotion_forwardProp(s)&&i(s)}:i}return typeof o!="function"&&r&&(o=t.__emotion_forwardProp),o},Ykt=function(t){var n=t.cache,r=t.serialized,o=t.isStringTag;return vme(n,r,o),uKe(function(){return bme(n,r,o)}),null},Xkt=function e(t,n){var r=t.__emotion_real===t,o=r&&t.__emotion_base||t,i,s;n!==void 0&&(i=n.label,s=n.target);var l=QCe(t,n,r),c=l||XCe(o),u=!c("as");return function(){var d=arguments,p=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&p.push("label:"+i+";"),d[0]==null||d[0].raw===void 0)p.push.apply(p,d);else{var h=d[0];p.push(h[0]);for(var m=d.length,g=1;gt(n4t(o)?n:o):t;return a.jsx(Ukt,{styles:r})}function pKe(e,t){return TH(e,t)}function r4t(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const tNe=[];function Z2(e){return tNe[0]=e,tL(tNe)}var GQ={exports:{}},Xs={};/** * @license React * react-is.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 nNe;function o4t(){if(nNe)return Xs;nNe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),h=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");function g(y){if(typeof y=="object"&&y!==null){var x=y.$$typeof;switch(x){case e:switch(y=y.type,y){case n:case o:case r:case c:case u:case h:return y;default:switch(y=y&&y.$$typeof,y){case s:case l:case p:case d:return y;case i:return y;default:return x}}case t:return x}}}return Xs.ContextConsumer=i,Xs.ContextProvider=s,Xs.Element=e,Xs.ForwardRef=l,Xs.Fragment=n,Xs.Lazy=p,Xs.Memo=d,Xs.Portal=t,Xs.Profiler=o,Xs.StrictMode=r,Xs.Suspense=c,Xs.SuspenseList=u,Xs.isContextConsumer=function(y){return g(y)===i},Xs.isContextProvider=function(y){return g(y)===s},Xs.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Xs.isForwardRef=function(y){return g(y)===l},Xs.isFragment=function(y){return g(y)===n},Xs.isLazy=function(y){return g(y)===p},Xs.isMemo=function(y){return g(y)===d},Xs.isPortal=function(y){return g(y)===t},Xs.isProfiler=function(y){return g(y)===o},Xs.isStrictMode=function(y){return g(y)===r},Xs.isSuspense=function(y){return g(y)===c},Xs.isSuspenseList=function(y){return g(y)===u},Xs.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===o||y===r||y===c||y===u||typeof y=="object"&&y!==null&&(y.$$typeof===p||y.$$typeof===d||y.$$typeof===s||y.$$typeof===i||y.$$typeof===l||y.$$typeof===m||y.getModuleId!==void 0)},Xs.typeOf=g,Xs}var rNe;function i4t(){return rNe||(rNe=1,GQ.exports=o4t()),GQ.exports}var Cme=i4t();function Ev(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function hKe(e){if(f.isValidElement(e)||Cme.isValidElementType(e)||!Ev(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=hKe(e[n])}),t}function hf(e,t,n={clone:!0}){const r=n.clone?{...e}:e;return Ev(e)&&Ev(t)&&Object.keys(t).forEach(o=>{f.isValidElement(t[o])||Cme.isValidElementType(t[o])?r[o]=t[o]:Ev(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&Ev(e[o])?r[o]=hf(e[o],t[o],n):n.clone?r[o]=Ev(t[o])?hKe(t[o]):t[o]:r[o]=t[o]}),r}const a4t=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>({...n,[r.key]:r.val}),{})};function s4t(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5,...o}=e,i=a4t(t),s=Object.keys(i);function l(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function c(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-r/100}${n})`}function u(h,m){const g=s.indexOf(m);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n}) and (max-width:${(g!==-1&&typeof t[s[g]]=="number"?t[s[g]]:m)-r/100}${n})`}function d(h){return s.indexOf(h)+1r.startsWith("@container")).sort((r,o)=>{var s,l;const i=/min-width:\s*([0-9.]+)/;return+(((s=r.match(i))==null?void 0:s[1])||0)-+(((l=o.match(i))==null?void 0:l[1])||0)});return n.length?n.reduce((r,o)=>{const i=t[o];return delete r[o],r[o]=i,r},{...t}):t}function l4t(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function c4t(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,o]=n,i=Number.isNaN(+r)?r||0:+r;return e.containerQueries(o).up(i)}function u4t(e){const t=(i,s)=>i.replace("@media",s?`@container ${s}`:"@container");function n(i,s){i.up=(...l)=>t(e.breakpoints.up(...l),s),i.down=(...l)=>t(e.breakpoints.down(...l),s),i.between=(...l)=>t(e.breakpoints.between(...l),s),i.only=(...l)=>t(e.breakpoints.only(...l),s),i.not=(...l)=>{const c=t(e.breakpoints.not(...l),s);return c.includes("not all and")?c.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):c}}const r={},o=i=>(n(r,i),r);return n(o),{...e,containerQueries:o}}const d4t={borderRadius:4};function rO(e,t){return t?hf(e,t,{clone:!1}):e}const FG={xs:0,sm:600,md:900,lg:1200,xl:1536},iNe={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${FG[e]}px)`},f4t={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:FG[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function ly(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const i=r.breakpoints||iNe;return t.reduce((s,l,c)=>(s[i.up(i.keys[c])]=n(t[c]),s),{})}if(typeof t=="object"){const i=r.breakpoints||iNe;return Object.keys(t).reduce((s,l)=>{if(l4t(i.keys,l)){const c=c4t(r.containerQueries?r:f4t,l);c&&(s[c]=n(t[l],l))}else if(Object.keys(i.values||FG).includes(l)){const c=i.up(l);s[c]=n(t[l],l)}else{const c=l;s[c]=t[c]}return s},{})}return n(t)}function mKe(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,o)=>{const i=e.up(o);return r[i]={},r},{}))||{}}function fie(e,t){return e.reduce((n,r)=>{const o=n[r];return(!o||Object.keys(o).length===0)&&delete n[r],n},t)}function p4t(e,...t){const n=mKe(e),r=[n,...t].reduce((o,i)=>hf(o,i),{});return fie(Object.keys(n),r)}function h4t(e,t){if(typeof e!="object")return{};const n={},r=Object.keys(t);return Array.isArray(e)?r.forEach((o,i)=>{i{e[o]!=null&&(n[o]=!0)}),n}function qQ({values:e,breakpoints:t,base:n}){const r=n||h4t(e,t),o=Object.keys(r);if(o.length===0)return e;let i;return o.reduce((s,l,c)=>(Array.isArray(e)?(s[l]=e[c]!=null?e[c]:e[i],i=c):typeof e=="object"?(s[l]=e[l]!=null?e[l]:e[i],i=l):s[l]=e,s),{})}function vn(e){if(typeof e!="string")throw new Error(lw(7));return e.charAt(0).toUpperCase()+e.slice(1)}function vv(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(r!=null)return r}return t.split(".").reduce((r,o)=>r&&r[o]!=null?r[o]:null,e)}function kH(e,t,n,r=n){let o;return typeof e=="function"?o=e(n):Array.isArray(e)?o=e[n]||r:o=vv(e,n)||r,t&&(o=t(o,r,e)),o}function Hu(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:o}=e,i=s=>{if(s[t]==null)return null;const l=s[t],c=s.theme,u=vv(c,r)||{};return ly(s,l,p=>{let h=kH(u,o,p);return p===h&&typeof p=="string"&&(h=kH(u,o,`${t}${p==="default"?"":vn(p)}`,p)),n===!1?h:{[n]:h}})};return i.propTypes={},i.filterProps=[t],i}function m4t(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const g4t={m:"margin",p:"padding"},x4t={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},aNe={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},y4t=m4t(e=>{if(e.length>2)if(aNe[e])e=aNe[e];else return[e];const[t,n]=e.split(""),r=g4t[t],o=x4t[n]||"";return Array.isArray(o)?o.map(i=>r+i):[r+o]}),Nme=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],jme=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Nme,...jme];function nL(e,t,n,r){const o=vv(e,t,!0)??n;return typeof o=="number"||typeof o=="string"?i=>typeof i=="string"?i:typeof o=="string"?o.startsWith("var(")&&i===0?0:o.startsWith("var(")&&i===1?o:`calc(${i} * ${o})`:o*i:Array.isArray(o)?i=>{if(typeof i=="string")return i;const s=Math.abs(i),l=o[s];return i>=0?l:typeof l=="number"?-l:typeof l=="string"&&l.startsWith("var(")?`calc(-1 * ${l})`:`-${l}`}:typeof o=="function"?o:()=>{}}function zG(e){return nL(e,"spacing",8)}function ZE(e,t){return typeof t=="string"||t==null?t:e(t)}function v4t(e,t){return n=>e.reduce((r,o)=>(r[o]=ZE(t,n),r),{})}function b4t(e,t,n,r){if(!t.includes(n))return null;const o=y4t(n),i=v4t(o,r),s=e[n];return ly(e,s,i)}function gKe(e,t){const n=zG(e.theme);return Object.keys(e).map(r=>b4t(e,t,r,n)).reduce(rO,{})}function Kc(e){return gKe(e,Nme)}Kc.propTypes={};Kc.filterProps=Nme;function Yc(e){return gKe(e,jme)}Yc.propTypes={};Yc.filterProps=jme;function xKe(e=8,t=zG({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(i=>{const s=t(i);return typeof s=="number"?`${s}px`:s}).join(" ");return n.mui=!0,n}function BG(...e){const t=e.reduce((r,o)=>(o.filterProps.forEach(i=>{r[i]=o}),r),{}),n=r=>Object.keys(r).reduce((o,i)=>t[i]?rO(o,t[i](r)):o,{});return n.propTypes={},n.filterProps=e.reduce((r,o)=>r.concat(o.filterProps),[]),n}function t0(e){return typeof e!="number"?e:`${e}px solid`}function G0(e,t){return Hu({prop:e,themeKey:"borders",transform:t})}const w4t=G0("border",t0),S4t=G0("borderTop",t0),C4t=G0("borderRight",t0),N4t=G0("borderBottom",t0),j4t=G0("borderLeft",t0),E4t=G0("borderColor"),I4t=G0("borderTopColor"),_4t=G0("borderRightColor"),P4t=G0("borderBottomColor"),A4t=G0("borderLeftColor"),T4t=G0("outline",t0),k4t=G0("outlineColor"),HG=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=nL(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:ZE(t,r)});return ly(e,e.borderRadius,n)}return null};HG.propTypes={};HG.filterProps=["borderRadius"];BG(w4t,S4t,C4t,N4t,j4t,E4t,I4t,_4t,P4t,A4t,HG,T4t,k4t);const VG=e=>{if(e.gap!==void 0&&e.gap!==null){const t=nL(e.theme,"spacing",8),n=r=>({gap:ZE(t,r)});return ly(e,e.gap,n)}return null};VG.propTypes={};VG.filterProps=["gap"];const UG=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=nL(e.theme,"spacing",8),n=r=>({columnGap:ZE(t,r)});return ly(e,e.columnGap,n)}return null};UG.propTypes={};UG.filterProps=["columnGap"];const WG=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=nL(e.theme,"spacing",8),n=r=>({rowGap:ZE(t,r)});return ly(e,e.rowGap,n)}return null};WG.propTypes={};WG.filterProps=["rowGap"];const M4t=Hu({prop:"gridColumn"}),R4t=Hu({prop:"gridRow"}),O4t=Hu({prop:"gridAutoFlow"}),$4t=Hu({prop:"gridAutoColumns"}),D4t=Hu({prop:"gridAutoRows"}),L4t=Hu({prop:"gridTemplateColumns"}),F4t=Hu({prop:"gridTemplateRows"}),z4t=Hu({prop:"gridTemplateAreas"}),B4t=Hu({prop:"gridArea"});BG(VG,UG,WG,M4t,R4t,O4t,$4t,D4t,L4t,F4t,z4t,B4t);function rA(e,t){return t==="grey"?t:e}const H4t=Hu({prop:"color",themeKey:"palette",transform:rA}),V4t=Hu({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:rA}),U4t=Hu({prop:"backgroundColor",themeKey:"palette",transform:rA});BG(H4t,V4t,U4t);function Jm(e){return e<=1&&e!==0?`${e*100}%`:e}const W4t=Hu({prop:"width",transform:Jm}),Eme=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var o,i,s,l,c;const r=((s=(i=(o=e.theme)==null?void 0:o.breakpoints)==null?void 0:i.values)==null?void 0:s[n])||FG[n];return r?((c=(l=e.theme)==null?void 0:l.breakpoints)==null?void 0:c.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Jm(n)}};return ly(e,e.maxWidth,t)}return null};Eme.filterProps=["maxWidth"];const G4t=Hu({prop:"minWidth",transform:Jm}),q4t=Hu({prop:"height",transform:Jm}),K4t=Hu({prop:"maxHeight",transform:Jm}),Y4t=Hu({prop:"minHeight",transform:Jm});Hu({prop:"size",cssProperty:"width",transform:Jm});Hu({prop:"size",cssProperty:"height",transform:Jm});const X4t=Hu({prop:"boxSizing"});BG(W4t,Eme,G4t,q4t,K4t,Y4t,X4t);const rL={border:{themeKey:"borders",transform:t0},borderTop:{themeKey:"borders",transform:t0},borderRight:{themeKey:"borders",transform:t0},borderBottom:{themeKey:"borders",transform:t0},borderLeft:{themeKey:"borders",transform:t0},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:t0},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:HG},color:{themeKey:"palette",transform:rA},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:rA},backgroundColor:{themeKey:"palette",transform:rA},p:{style:Yc},pt:{style:Yc},pr:{style:Yc},pb:{style:Yc},pl:{style:Yc},px:{style:Yc},py:{style:Yc},padding:{style:Yc},paddingTop:{style:Yc},paddingRight:{style:Yc},paddingBottom:{style:Yc},paddingLeft:{style:Yc},paddingX:{style:Yc},paddingY:{style:Yc},paddingInline:{style:Yc},paddingInlineStart:{style:Yc},paddingInlineEnd:{style:Yc},paddingBlock:{style:Yc},paddingBlockStart:{style:Yc},paddingBlockEnd:{style:Yc},m:{style:Kc},mt:{style:Kc},mr:{style:Kc},mb:{style:Kc},ml:{style:Kc},mx:{style:Kc},my:{style:Kc},margin:{style:Kc},marginTop:{style:Kc},marginRight:{style:Kc},marginBottom:{style:Kc},marginLeft:{style:Kc},marginX:{style:Kc},marginY:{style:Kc},marginInline:{style:Kc},marginInlineStart:{style:Kc},marginInlineEnd:{style:Kc},marginBlock:{style:Kc},marginBlockStart:{style:Kc},marginBlockEnd:{style:Kc},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:VG},rowGap:{style:WG},columnGap:{style:UG},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Jm},maxWidth:{style:Eme},minWidth:{transform:Jm},height:{transform:Jm},maxHeight:{transform:Jm},minHeight:{transform:Jm},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Q4t(...e){const t=e.reduce((r,o)=>r.concat(Object.keys(o)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function J4t(e,t){return typeof e=="function"?e(t):e}function Z4t(){function e(n,r,o,i){const s={[n]:r,theme:o},l=i[n];if(!l)return{[n]:r};const{cssProperty:c=n,themeKey:u,transform:d,style:p}=l;if(r==null)return null;if(u==="typography"&&r==="inherit")return{[n]:r};const h=vv(o,u)||{};return p?p(s):ly(s,r,g=>{let y=kH(h,d,g);return g===y&&typeof g=="string"&&(y=kH(h,d,`${n}${g==="default"?"":vn(g)}`,g)),c===!1?y:{[c]:y}})}function t(n){const{sx:r,theme:o={},nested:i}=n||{};if(!r)return null;const s=o.unstable_sxConfig??rL;function l(c){let u=c;if(typeof c=="function")u=c(o);else if(typeof c!="object")return c;if(!u)return null;const d=mKe(o.breakpoints),p=Object.keys(d);let h=d;return Object.keys(u).forEach(m=>{const g=J4t(u[m],o);if(g!=null)if(typeof g=="object")if(s[m])h=rO(h,e(m,g,o,s));else{const y=ly({theme:o},g,x=>({[m]:x}));Q4t(y,g)?h[m]=t({sx:g,theme:o,nested:!0}):h=rO(h,y)}else h=rO(h,e(m,g,o,s))}),!i&&o.modularCssLayers?{"@layer sx":oNe(o,fie(p,h))}:oNe(o,fie(p,h))}return Array.isArray(r)?r.map(l):l(r)}return t}const wC=Z4t();wC.filterProps=["sx"];function eMt(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let o=n.getColorSchemeSelector(e);return o==="&"?t:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:t})}return n.palette.mode===e?t:{}}function uk(e={},...t){const{breakpoints:n={},palette:r={},spacing:o,shape:i={},...s}=e,l=s4t(n),c=xKe(o);let u=hf({breakpoints:l,direction:"ltr",components:{},palette:{mode:"light",...r},spacing:c,shape:{...d4t,...i}},s);return u=u4t(u),u.applyStyles=eMt,u=t.reduce((d,p)=>hf(d,p),u),u.unstable_sxConfig={...rL,...s==null?void 0:s.unstable_sxConfig},u.unstable_sx=function(p){return wC({sx:p,theme:this})},u}function tMt(e){return Object.keys(e).length===0}function Ime(e=null){const t=f.useContext(ck);return!t||tMt(t)?e:t}const nMt=uk();function oL(e=nMt){return Ime(e)}function KQ(e){const t=Z2(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function yKe({styles:e,themeId:t,defaultTheme:n={}}){const r=oL(n),o=t&&r[t]||r;let i=typeof e=="function"?e(o):e;return o.modularCssLayers&&(Array.isArray(i)?i=i.map(s=>KQ(typeof s=="function"?s(o):s)):i=KQ(i)),a.jsx(fKe,{styles:i})}const rMt=e=>{var r;const t={systemProps:{},otherProps:{}},n=((r=e==null?void 0:e.theme)==null?void 0:r.unstable_sxConfig)??rL;return Object.keys(e).forEach(o=>{n[o]?t.systemProps[o]=e[o]:t.otherProps[o]=e[o]}),t};function GG(e){const{sx:t,...n}=e,{systemProps:r,otherProps:o}=rMt(n);let i;return Array.isArray(t)?i=[r,...t]:typeof t=="function"?i=(...s)=>{const l=t(...s);return Ev(l)?{...r,...l}:r}:i={...r,...t},{...o,sx:i}}const sNe=e=>e,oMt=()=>{let e=sNe;return{configure(t){e=t},generate(t){return e(t)},reset(){e=sNe}}},vKe=oMt();function bKe(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;tl!=="theme"&&l!=="sx"&&l!=="as"})(wC);return f.forwardRef(function(c,u){const d=oL(n),{className:p,component:h="div",...m}=GG(c);return a.jsx(i,{as:h,ref:u,className:be(p,o?o(r):r),theme:t&&d[t]||d,...m})})}const aMt={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function _r(e,t,n="Mui"){const r=aMt[t];return r?`${n}-${r}`:`${vKe.generate(e)}-${t}`}function Pr(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=_r(e,o,n)}),r}function wKe(e){const{variants:t,...n}=e,r={variants:t,style:Z2(n),isProcessed:!0};return r.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=Z2(o.style))}),r}const sMt=uk();function $z(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function Wj(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function lMt(e){return e?(t,n)=>n[e]:null}function cMt(e,t,n){e.theme=dMt(e.theme)?n:e.theme[t]||e.theme}function Dz(e,t,n){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(o=>Dz(e,o,n));if(Array.isArray(r==null?void 0:r.variants)){let o;if(r.isProcessed)o=n?Wj(r.style,n):r.style;else{const{variants:i,...s}=r;o=n?Wj(Z2(s),n):s}return SKe(e,r.variants,[o],n)}return r!=null&&r.isProcessed?n?Wj(Z2(r.style),n):r.style:n?Wj(Z2(r),n):r}function SKe(e,t,n=[],r=void 0){var i;let o;e:for(let s=0;s{r4t(l,N=>N.filter(j=>j!==wC));const{name:u,slot:d,skipVariantsResolver:p,skipSx:h,overridesResolver:m=lMt(pMt(d)),...g}=c,y=u&&u.startsWith("Mui")||d?"components":"custom",x=p!==void 0?p:d&&d!=="Root"&&d!=="root"||!1,v=h||!1;let b=$z;d==="Root"||d==="root"?b=r:d?b=o:fMt(l)&&(b=void 0);const w=pKe(l,{shouldForwardProp:b,label:uMt(),...g}),S=N=>{if(N.__emotion_real===N)return N;if(typeof N=="function")return function(I){return Dz(I,N,I.theme.modularCssLayers?y:void 0)};if(Ev(N)){const j=wKe(N);return function(_){return j.variants?Dz(_,j,_.theme.modularCssLayers?y:void 0):_.theme.modularCssLayers?Wj(j.style,y):j.style}}return N},C=(...N)=>{const j=[],I=N.map(S),_=[];if(j.push(i),u&&m&&_.push(function(M){var z,V;const $=(V=(z=M.theme.components)==null?void 0:z[u])==null?void 0:V.styleOverrides;if(!$)return null;const D={};for(const B in $)D[B]=Dz(M,$[B],M.theme.modularCssLayers?"theme":void 0);return m(M,D)}),u&&!x&&_.push(function(M){var D,z;const R=M.theme,$=(z=(D=R==null?void 0:R.components)==null?void 0:D[u])==null?void 0:z.variants;return $?SKe(M,$,[],M.theme.modularCssLayers?"theme":void 0):null}),v||_.push(wC),Array.isArray(I[0])){const E=I.shift(),M=new Array(j.length).fill(""),R=new Array(_.length).fill("");let $;$=[...M,...E,...R],$.raw=[...M,...E.raw,...R],j.unshift($)}const T=[...j,...I,..._],P=w(...T);return l.muiName&&(P.muiName=l.muiName),P};return w.withConfig&&(C.withConfig=w.withConfig),C}}function uMt(e,t){return void 0}function dMt(e){for(const t in e)return!1;return!0}function fMt(e){return typeof e=="string"&&e.charCodeAt(0)>96}function pMt(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}const Ai=CKe();function eI(e,t,n=!1){const r={...t};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const i=o;if(i==="components"||i==="slots")r[i]={...e[i],...r[i]};else if(i==="componentsProps"||i==="slotProps"){const s=e[i],l=t[i];if(!l)r[i]=s||{};else if(!s)r[i]=l;else{r[i]={...l};for(const c in s)if(Object.prototype.hasOwnProperty.call(s,c)){const u=c;r[i][u]=eI(s[u],l[u],n)}}}else i==="className"&&n&&t.className?r.className=be(e==null?void 0:e.className,t==null?void 0:t.className):i==="style"&&n&&t.style?r.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:r[i]===void 0&&(r[i]=e[i])}return r}function NKe(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:eI(t.components[n].defaultProps,r)}function _me({props:e,name:t,defaultTheme:n,themeId:r}){let o=oL(n);return r&&(o=o[r]||o),NKe({theme:o,name:t,props:e})}const Ia=typeof window<"u"?f.useLayoutEffect:f.useEffect;function hMt(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function Pme(e,t=0,n=1){return hMt(e,t,n)}function mMt(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,o)=>o<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function SC(e){if(e.type)return e;if(e.charAt(0)==="#")return SC(mMt(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(lw(9,e));let r=e.substring(t+1,e.length-1),o;if(n==="color"){if(r=r.split(" "),o=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(lw(10,o))}else r=r.split(",");return r=r.map(i=>parseFloat(i)),{type:n,values:r,colorSpace:o}}const gMt=e=>{const t=SC(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},uR=(e,t)=>{try{return gMt(e)}catch{return e}};function qG(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((o,i)=>i<3?parseInt(o,10):o):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function jKe(e){e=SC(e);const{values:t}=e,n=t[0],r=t[1]/100,o=t[2]/100,i=r*Math.min(o,1-o),s=(u,d=(u+n/30)%12)=>o-i*Math.max(Math.min(d-3,9-d,1),-1);let l="rgb";const c=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(l+="a",c.push(t[3])),qG({type:l,values:c})}function pie(e){e=SC(e);let t=e.type==="hsl"||e.type==="hsla"?SC(jKe(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function xMt(e,t){const n=pie(e),r=pie(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Na(e,t){return e=SC(e),t=Pme(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,qG(e)}function TN(e,t,n){try{return Na(e,t)}catch{return e}}function iL(e,t){if(e=SC(e),t=Pme(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return qG(e)}function Ms(e,t,n){try{return iL(e,t)}catch{return e}}function aL(e,t){if(e=SC(e),t=Pme(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return qG(e)}function Rs(e,t,n){try{return aL(e,t)}catch{return e}}function hie(e,t=.15){return pie(e)>.5?iL(e,t):aL(e,t)}function B8(e,t,n){try{return hie(e,t)}catch{return e}}const EKe=f.createContext(null);function Ame(){return f.useContext(EKe)}const yMt=typeof Symbol=="function"&&Symbol.for,vMt=yMt?Symbol.for("mui.nested"):"__THEME_NESTED__";function bMt(e,t){return typeof t=="function"?t(e):{...e,...t}}function wMt(e){const{children:t,theme:n}=e,r=Ame(),o=f.useMemo(()=>{const i=r===null?{...n}:bMt(r,n);return i!=null&&(i[vMt]=r!==null),i},[n,r]);return a.jsx(EKe.Provider,{value:o,children:t})}const IKe=f.createContext();function SMt({value:e,...t}){return a.jsx(IKe.Provider,{value:e??!0,...t})}const $d=()=>f.useContext(IKe)??!1,_Ke=f.createContext(void 0);function CMt({value:e,children:t}){return a.jsx(_Ke.Provider,{value:e,children:t})}function NMt(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const o=t.components[n];return o.defaultProps?eI(o.defaultProps,r,t.components.mergeClassNameAndStyle):!o.styleOverrides&&!o.variants?eI(o,r,t.components.mergeClassNameAndStyle):r}function jMt({props:e,name:t}){const n=f.useContext(_Ke);return NMt({props:e,name:t,theme:{components:n}})}let lNe=0;function EMt(e){const[t,n]=f.useState(e),r=e||t;return f.useEffect(()=>{t==null&&(lNe+=1,n(`mui-${lNe}`))},[t]),r}const IMt={...sw},cNe=IMt.useId;function Jo(e){if(cNe!==void 0){const t=cNe();return e??t}return EMt(e)}function _Mt(e){const t=Ime(),n=Jo()||"",{modularCssLayers:r}=e;let o="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!r||t!==null?o="":typeof r=="string"?o=r.replace(/mui(?!\.)/g,o):o=`@layer ${o};`,Ia(()=>{var l,c;const i=document.querySelector("head");if(!i)return;const s=i.firstChild;if(o){if(s&&((l=s.hasAttribute)!=null&&l.call(s,"data-mui-layer-order"))&&s.getAttribute("data-mui-layer-order")===n)return;const u=document.createElement("style");u.setAttribute("data-mui-layer-order",n),u.textContent=o,i.prepend(u)}else(c=i.querySelector(`style[data-mui-layer-order="${n}"]`))==null||c.remove()},[o,n]),o?a.jsx(yKe,{styles:o}):null}const uNe={};function dNe(e,t,n,r=!1){return f.useMemo(()=>{const o=e&&t[e]||t;if(typeof n=="function"){const i=n(o),s=e?{...t,[e]:i}:i;return r?()=>s:s}return e?{...t,[e]:n}:{...t,...n}},[e,t,n,r])}function PKe(e){const{children:t,theme:n,themeId:r}=e,o=Ime(uNe),i=Ame()||uNe,s=dNe(r,o,n),l=dNe(r,i,n,!0),c=(r?s[r]:s).direction==="rtl",u=_Mt(s);return a.jsx(wMt,{theme:l,children:a.jsx(ck.Provider,{value:s,children:a.jsx(SMt,{value:c,children:a.jsxs(CMt,{value:r?s[r].components:s.components,children:[u,t]})})})})}const fNe={theme:void 0};function PMt(e){let t,n;return function(o){let i=t;return(i===void 0||o.theme!==n)&&(fNe.theme=o.theme,i=wKe(e(fNe)),t=i,n=o.theme),i}}const Tme="mode",kme="color-scheme",AMt="data-color-scheme";function TMt(e){const{defaultMode:t="system",defaultLightColorScheme:n="light",defaultDarkColorScheme:r="dark",modeStorageKey:o=Tme,colorSchemeStorageKey:i=kme,attribute:s=AMt,colorSchemeNode:l="document.documentElement",nonce:c}=e||{};let u="",d=s;if(s==="class"&&(d=".%s"),s==="data"&&(d="[data-%s]"),d.startsWith(".")){const h=d.substring(1);u+=`${l}.classList.remove('${h}'.replace('%s', light), '${h}'.replace('%s', dark)); ${l}.classList.add('${h}'.replace('%s', colorScheme));`}const p=d.match(/\[([^[\]]+)\]/);if(p){const[h,m]=p[1].split("=");m||(u+=`${l}.removeAttribute('${h}'.replace('%s', light)); ${l}.removeAttribute('${h}'.replace('%s', dark));`),u+=` ${l}.setAttribute('${h}'.replace('%s', colorScheme), ${m?`${m}.replace('%s', colorScheme)`:'""'});`}else d!==".%s"&&(u+=`${l}.setAttribute('${d}', colorScheme);`);return a.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?c:"",dangerouslySetInnerHTML:{__html:`(function() { try { let colorScheme = ''; const mode = localStorage.getItem('${o}') || '${t}'; const dark = localStorage.getItem('${i}-dark') || '${r}'; const light = localStorage.getItem('${i}-light') || '${n}'; if (mode === 'system') { // handle system mode const mql = window.matchMedia('(prefers-color-scheme: dark)'); if (mql.matches) { colorScheme = dark } else { colorScheme = light } } if (mode === 'light') { colorScheme = light; } if (mode === 'dark') { colorScheme = dark; } if (colorScheme) { ${u} } } catch(e){}})();`}},"mui-color-scheme-init")}function kMt(){}const MMt=({key:e,storageWindow:t})=>(!t&&typeof window<"u"&&(t=window),{get(n){if(typeof window>"u")return;if(!t)return n;let r;try{r=t.localStorage.getItem(e)}catch{}return r||n},set:n=>{if(t)try{t.localStorage.setItem(e,n)}catch{}},subscribe:n=>{if(!t)return kMt;const r=o=>{const i=o.newValue;o.key===e&&n(i)};return t.addEventListener("storage",r),()=>{t.removeEventListener("storage",r)}}});function YQ(){}function pNe(e){if(typeof window<"u"&&typeof window.matchMedia=="function"&&e==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function AKe(e,t){if(e.mode==="light"||e.mode==="system"&&e.systemMode==="light")return t("light");if(e.mode==="dark"||e.mode==="system"&&e.systemMode==="dark")return t("dark")}function RMt(e){return AKe(e,t=>{if(t==="light")return e.lightColorScheme;if(t==="dark")return e.darkColorScheme})}function OMt(e){const{defaultMode:t="light",defaultLightColorScheme:n,defaultDarkColorScheme:r,supportedColorSchemes:o=[],modeStorageKey:i=Tme,colorSchemeStorageKey:s=kme,storageWindow:l=typeof window>"u"?void 0:window,storageManager:c=MMt,noSsr:u=!1}=e,d=o.join(","),p=o.length>1,h=f.useMemo(()=>c==null?void 0:c({key:i,storageWindow:l}),[c,i,l]),m=f.useMemo(()=>c==null?void 0:c({key:`${s}-light`,storageWindow:l}),[c,s,l]),g=f.useMemo(()=>c==null?void 0:c({key:`${s}-dark`,storageWindow:l}),[c,s,l]),[y,x]=f.useState(()=>{const I=(h==null?void 0:h.get(t))||t,_=(m==null?void 0:m.get(n))||n,T=(g==null?void 0:g.get(r))||r;return{mode:I,systemMode:pNe(I),lightColorScheme:_,darkColorScheme:T}}),[v,b]=f.useState(u||!p);f.useEffect(()=>{b(!0)},[]);const w=RMt(y),S=f.useCallback(I=>{x(_=>{if(I===_.mode)return _;const T=I??t;return h==null||h.set(T),{..._,mode:T,systemMode:pNe(T)}})},[h,t]),C=f.useCallback(I=>{I?typeof I=="string"?I&&!d.includes(I)?console.error(`\`${I}\` does not exist in \`theme.colorSchemes\`.`):x(_=>{const T={..._};return AKe(_,P=>{P==="light"&&(m==null||m.set(I),T.lightColorScheme=I),P==="dark"&&(g==null||g.set(I),T.darkColorScheme=I)}),T}):x(_=>{const T={..._},P=I.light===null?n:I.light,E=I.dark===null?r:I.dark;return P&&(d.includes(P)?(T.lightColorScheme=P,m==null||m.set(P)):console.error(`\`${P}\` does not exist in \`theme.colorSchemes\`.`)),E&&(d.includes(E)?(T.darkColorScheme=E,g==null||g.set(E)):console.error(`\`${E}\` does not exist in \`theme.colorSchemes\`.`)),T}):x(_=>(m==null||m.set(n),g==null||g.set(r),{..._,lightColorScheme:n,darkColorScheme:r}))},[d,m,g,n,r]),N=f.useCallback(I=>{y.mode==="system"&&x(_=>{const T=I!=null&&I.matches?"dark":"light";return _.systemMode===T?_:{..._,systemMode:T}})},[y.mode]),j=f.useRef(N);return j.current=N,f.useEffect(()=>{if(typeof window.matchMedia!="function"||!p)return;const I=(...T)=>j.current(...T),_=window.matchMedia("(prefers-color-scheme: dark)");return _.addListener(I),I(_),()=>{_.removeListener(I)}},[p]),f.useEffect(()=>{if(p){const I=(h==null?void 0:h.subscribe(P=>{(!P||["light","dark","system"].includes(P))&&S(P||t)}))||YQ,_=(m==null?void 0:m.subscribe(P=>{(!P||d.match(P))&&C({light:P})}))||YQ,T=(g==null?void 0:g.subscribe(P=>{(!P||d.match(P))&&C({dark:P})}))||YQ;return()=>{I(),_(),T()}}},[C,S,d,t,l,p,h,m,g]),{...y,mode:v?y.mode:void 0,systemMode:v?y.systemMode:void 0,colorScheme:v?w:void 0,setMode:S,setColorScheme:C}}const $Mt="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function DMt(e){const{themeId:t,theme:n={},modeStorageKey:r=Tme,colorSchemeStorageKey:o=kme,disableTransitionOnChange:i=!1,defaultColorScheme:s,resolveTheme:l}=e,c={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},u=f.createContext(void 0),d=()=>f.useContext(u)||c,p={},h={};function m(v){var He,Ye,We,at;const{children:b,theme:w,modeStorageKey:S=r,colorSchemeStorageKey:C=o,disableTransitionOnChange:N=i,storageManager:j,storageWindow:I=typeof window>"u"?void 0:window,documentNode:_=typeof document>"u"?void 0:document,colorSchemeNode:T=typeof document>"u"?void 0:document.documentElement,disableNestedContext:P=!1,disableStyleSheetGeneration:E=!1,defaultMode:M="system",forceThemeRerender:R=!1,noSsr:$}=v,D=f.useRef(!1),z=Ame(),V=f.useContext(u),B=!!V&&!P,G=f.useMemo(()=>w||(typeof n=="function"?n():n),[w]),H=G[t],F=H||G,{colorSchemes:W=p,components:U=h,cssVarPrefix:K}=F,X=Object.keys(W).filter(Oe=>!!W[Oe]).join(","),J=f.useMemo(()=>X.split(","),[X]),te=typeof s=="string"?s:s.light,re=typeof s=="string"?s:s.dark,ce=W[te]&&W[re]?M:((Ye=(He=W[F.defaultColorScheme])==null?void 0:He.palette)==null?void 0:Ye.mode)||((We=F.palette)==null?void 0:We.mode),{mode:ae,setMode:oe,systemMode:ue,lightColorScheme:fe,darkColorScheme:se,colorScheme:ge,setColorScheme:ye}=OMt({supportedColorSchemes:J,defaultLightColorScheme:te,defaultDarkColorScheme:re,modeStorageKey:S,colorSchemeStorageKey:C,defaultMode:ce,storageManager:j,storageWindow:I,noSsr:$});let de=ae,Ne=ge;B&&(de=V.mode,Ne=V.colorScheme);let _e=Ne||F.defaultColorScheme;F.vars&&!R&&(_e=F.defaultColorScheme);const xe=f.useMemo(()=>{var qe;const Oe=((qe=F.generateThemeVars)==null?void 0:qe.call(F))||F.vars,Ae={...F,components:U,colorSchemes:W,cssVarPrefix:K,vars:Oe};if(typeof Ae.generateSpacing=="function"&&(Ae.spacing=Ae.generateSpacing()),_e){const dt=W[_e];dt&&typeof dt=="object"&&Object.keys(dt).forEach(Ze=>{dt[Ze]&&typeof dt[Ze]=="object"?Ae[Ze]={...Ae[Ze],...dt[Ze]}:Ae[Ze]=dt[Ze]})}return l?l(Ae):Ae},[F,_e,U,W,K]),we=F.colorSchemeSelector;Ia(()=>{if(Ne&&T&&we&&we!=="media"){const Oe=we;let Ae=we;if(Oe==="class"&&(Ae=".%s"),Oe==="data"&&(Ae="[data-%s]"),Oe!=null&&Oe.startsWith("data-")&&!Oe.includes("%s")&&(Ae=`[${Oe}="%s"]`),Ae.startsWith("."))T.classList.remove(...J.map(qe=>Ae.substring(1).replace("%s",qe))),T.classList.add(Ae.substring(1).replace("%s",Ne));else{const qe=Ae.replace("%s",Ne).match(/\[([^\]]+)\]/);if(qe){const[dt,Ze]=qe[1].split("=");Ze||J.forEach(Qe=>{T.removeAttribute(dt.replace(Ne,Qe))}),T.setAttribute(dt,Ze?Ze.replace(/"|'/g,""):"")}else T.setAttribute(Ae,Ne)}}},[Ne,we,T,J]),f.useEffect(()=>{let Oe;if(N&&D.current&&_){const Ae=_.createElement("style");Ae.appendChild(_.createTextNode($Mt)),_.head.appendChild(Ae),window.getComputedStyle(_.body),Oe=setTimeout(()=>{_.head.removeChild(Ae)},1)}return()=>{clearTimeout(Oe)}},[Ne,N,_]),f.useEffect(()=>(D.current=!0,()=>{D.current=!1}),[]);const Te=f.useMemo(()=>({allColorSchemes:J,colorScheme:Ne,darkColorScheme:se,lightColorScheme:fe,mode:de,setColorScheme:ye,setMode:oe,systemMode:ue}),[J,Ne,se,fe,de,ye,oe,ue,xe.colorSchemeSelector]);let Re=!0;(E||F.cssVariables===!1||B&&(z==null?void 0:z.cssVarPrefix)===K)&&(Re=!1);const Ue=a.jsxs(f.Fragment,{children:[a.jsx(PKe,{themeId:H?t:void 0,theme:xe,children:b}),Re&&a.jsx(fKe,{styles:((at=xe.generateStyleSheets)==null?void 0:at.call(xe))||[]})]});return B?Ue:a.jsx(u.Provider,{value:Te,children:Ue})}const g=typeof s=="string"?s:s.light,y=typeof s=="string"?s:s.dark;return{CssVarsProvider:m,useColorScheme:d,getInitColorSchemeScript:v=>TMt({colorSchemeStorageKey:o,defaultLightColorScheme:g,defaultDarkColorScheme:y,modeStorageKey:r,...v})}}function LMt(e=""){function t(...r){if(!r.length)return"";const o=r[0];return typeof o=="string"&&!o.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${o}${t(...r.slice(1))})`:`, ${o}`}return(r,...o)=>`var(--${e?`${e}-`:""}${r}${t(...o)})`}const hNe=(e,t,n,r=[])=>{let o=e;t.forEach((i,s)=>{s===t.length-1?Array.isArray(o)?o[Number(i)]=n:o&&typeof o=="object"&&(o[i]=n):o&&typeof o=="object"&&(o[i]||(o[i]=r.includes(i)?[]:{}),o=o[i])})},FMt=(e,t,n)=>{function r(o,i=[],s=[]){Object.entries(o).forEach(([l,c])=>{(!n||n&&!n([...i,l]))&&c!=null&&(typeof c=="object"&&Object.keys(c).length>0?r(c,[...i,l],Array.isArray(c)?[...s,l]:s):t([...i,l],c,s))})}r(e)},zMt=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function XQ(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},o={},i={},s={};return FMt(e,(l,c,u)=>{if((typeof c=="string"||typeof c=="number")&&(!r||!r(l,c))){const d=`--${n?`${n}-`:""}${l.join("-")}`,p=zMt(l,c);Object.assign(o,{[d]:p}),hNe(i,l,`var(${d})`,u),hNe(s,l,`var(${d}, ${p})`,u)}},l=>l[0]==="vars"),{css:o,vars:i,varsWithDefaults:s}}function BMt(e,t={}){const{getSelector:n=v,disableCssColorScheme:r,colorSchemeSelector:o,enableContrastVars:i}=t,{colorSchemes:s={},components:l,defaultColorScheme:c="light",...u}=e,{vars:d,css:p,varsWithDefaults:h}=XQ(u,t);let m=h;const g={},{[c]:y,...x}=s;if(Object.entries(x||{}).forEach(([S,C])=>{const{vars:N,css:j,varsWithDefaults:I}=XQ(C,t);m=hf(m,I),g[S]={css:j,vars:N}}),y){const{css:S,vars:C,varsWithDefaults:N}=XQ(y,t);m=hf(m,N),g[c]={css:S,vars:C}}function v(S,C){var j,I;let N=o;if(o==="class"&&(N=".%s"),o==="data"&&(N="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(N=`[${o}="%s"]`),S){if(N==="media")return e.defaultColorScheme===S?":root":{[`@media (prefers-color-scheme: ${((I=(j=s[S])==null?void 0:j.palette)==null?void 0:I.mode)||S})`]:{":root":C}};if(N)return e.defaultColorScheme===S?`:root, ${N.replace("%s",String(S))}`:N.replace("%s",String(S))}return":root"}return{vars:m,generateThemeVars:()=>{let S={...d};return Object.entries(g).forEach(([,{vars:C}])=>{S=hf(S,C)}),S},generateStyleSheets:()=>{var _,T;const S=[],C=e.defaultColorScheme||"light";function N(P,E){Object.keys(E).length&&S.push(typeof P=="string"?{[P]:{...E}}:P)}N(n(void 0,{...p}),p);const{[C]:j,...I}=g;if(j){const{css:P}=j,E=(T=(_=s[C])==null?void 0:_.palette)==null?void 0:T.mode,M=!r&&E?{colorScheme:E,...P}:{...P};N(n(C,{...M}),M)}return Object.entries(I).forEach(([P,{css:E}])=>{var $,D;const M=(D=($=s[P])==null?void 0:$.palette)==null?void 0:D.mode,R=!r&&M?{colorScheme:M,...E}:{...E};N(n(P,{...R}),R)}),i&&S.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),S}}}function HMt(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}function Un(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let s="",l=!0;for(let c=0;c{const{ownerState:n}=e;return[t.root,t[`maxWidth${vn(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),WMt=e=>_me({props:e,name:"MuiContainer",defaultTheme:VMt}),GMt=(e,t)=>{const n=c=>_r(t,c),{classes:r,fixed:o,disableGutters:i,maxWidth:s}=e,l={root:["root",s&&`maxWidth${vn(String(s))}`,o&&"fixed",i&&"disableGutters"]};return Un(l,n,r)};function qMt(e={}){const{createStyledComponent:t=UMt,useThemeProps:n=WMt,componentName:r="MuiContainer"}=e,o=t(({theme:s,ownerState:l})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",...!l.disableGutters&&{paddingLeft:s.spacing(2),paddingRight:s.spacing(2),[s.breakpoints.up("sm")]:{paddingLeft:s.spacing(3),paddingRight:s.spacing(3)}}}),({theme:s,ownerState:l})=>l.fixed&&Object.keys(s.breakpoints.values).reduce((c,u)=>{const d=u,p=s.breakpoints.values[d];return p!==0&&(c[s.breakpoints.up(d)]={maxWidth:`${p}${s.breakpoints.unit}`}),c},{}),({theme:s,ownerState:l})=>({...l.maxWidth==="xs"&&{[s.breakpoints.up("xs")]:{maxWidth:Math.max(s.breakpoints.values.xs,444)}},...l.maxWidth&&l.maxWidth!=="xs"&&{[s.breakpoints.up(l.maxWidth)]:{maxWidth:`${s.breakpoints.values[l.maxWidth]}${s.breakpoints.unit}`}}}));return f.forwardRef(function(l,c){const u=n(l),{className:d,component:p="div",disableGutters:h=!1,fixed:m=!1,maxWidth:g="lg",classes:y,...x}=u,v={...u,component:p,disableGutters:h,fixed:m,maxWidth:g},b=GMt(v,r);return a.jsx(o,{as:p,ownerState:v,className:be(b.root,d),ref:c,...x})})}function oO(e,t){var n,r,o;return f.isValidElement(e)&&t.indexOf(e.type.muiName??((o=(r=(n=e.type)==null?void 0:n._payload)==null?void 0:r.value)==null?void 0:o.muiName))!==-1}const KMt=(e,t)=>e.filter(n=>t.includes(n)),dk=(e,t,n)=>{const r=e.keys[0];Array.isArray(t)?t.forEach((o,i)=>{n((s,l)=>{i<=e.keys.length-1&&(i===0?Object.assign(s,l):s[e.up(e.keys[i])]=l)},o)}):t&&typeof t=="object"?(Object.keys(t).length>e.keys.length?e.keys:KMt(e.keys,Object.keys(t))).forEach(i=>{if(e.keys.includes(i)){const s=t[i];s!==void 0&&n((l,c)=>{r===i?Object.assign(l,c):l[e.up(i)]=c},s)}}):(typeof t=="number"||typeof t=="string")&&n((o,i)=>{Object.assign(o,i)},t)};function MH(e){return`--Grid-${e}Spacing`}function KG(e){return`--Grid-parent-${e}Spacing`}const mNe="--Grid-columns",oA="--Grid-parent-columns",YMt=({theme:e,ownerState:t})=>{const n={};return dk(e.breakpoints,t.size,(r,o)=>{let i={};o==="grow"&&(i={flexBasis:0,flexGrow:1,maxWidth:"100%"}),o==="auto"&&(i={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"}),typeof o=="number"&&(i={flexGrow:0,flexBasis:"auto",width:`calc(100% * ${o} / var(${oA}) - (var(${oA}) - ${o}) * (var(${KG("column")}) / var(${oA})))`}),r(n,i)}),n},XMt=({theme:e,ownerState:t})=>{const n={};return dk(e.breakpoints,t.offset,(r,o)=>{let i={};o==="auto"&&(i={marginLeft:"auto"}),typeof o=="number"&&(i={marginLeft:o===0?"0px":`calc(100% * ${o} / var(${oA}) + var(${KG("column")}) * ${o} / var(${oA}))`}),r(n,i)}),n},QMt=({theme:e,ownerState:t})=>{if(!t.container)return{};const n={[mNe]:12};return dk(e.breakpoints,t.columns,(r,o)=>{const i=o??12;r(n,{[mNe]:i,"> *":{[oA]:i}})}),n},JMt=({theme:e,ownerState:t})=>{if(!t.container)return{};const n={};return dk(e.breakpoints,t.rowSpacing,(r,o)=>{var s;const i=typeof o=="string"?o:(s=e.spacing)==null?void 0:s.call(e,o);r(n,{[MH("row")]:i,"> *":{[KG("row")]:i}})}),n},ZMt=({theme:e,ownerState:t})=>{if(!t.container)return{};const n={};return dk(e.breakpoints,t.columnSpacing,(r,o)=>{var s;const i=typeof o=="string"?o:(s=e.spacing)==null?void 0:s.call(e,o);r(n,{[MH("column")]:i,"> *":{[KG("column")]:i}})}),n},eRt=({theme:e,ownerState:t})=>{if(!t.container)return{};const n={};return dk(e.breakpoints,t.direction,(r,o)=>{r(n,{flexDirection:o})}),n},tRt=({ownerState:e})=>({minWidth:0,boxSizing:"border-box",...e.container&&{display:"flex",flexWrap:"wrap",...e.wrap&&e.wrap!=="wrap"&&{flexWrap:e.wrap},gap:`var(${MH("row")}) var(${MH("column")})`}}),nRt=e=>{const t=[];return Object.entries(e).forEach(([n,r])=>{r!==!1&&r!==void 0&&t.push(`grid-${n}-${String(r)}`)}),t},rRt=(e,t="xs")=>{function n(r){return r===void 0?!1:typeof r=="string"&&!Number.isNaN(Number(r))||typeof r=="number"&&r>0}if(n(e))return[`spacing-${t}-${String(e)}`];if(typeof e=="object"&&!Array.isArray(e)){const r=[];return Object.entries(e).forEach(([o,i])=>{n(i)&&r.push(`spacing-${o}-${String(i)}`)}),r}return[]},oRt=e=>e===void 0?[]:typeof e=="object"?Object.entries(e).map(([t,n])=>`direction-${t}-${n}`):[`direction-xs-${String(e)}`];function iRt(e,t){e.item!==void 0&&delete e.item,e.zeroMinWidth!==void 0&&delete e.zeroMinWidth,t.keys.forEach(n=>{e[n]!==void 0&&delete e[n]})}const aRt=uk(),sRt=Ai("div",{name:"MuiGrid",slot:"Root"});function lRt(e){return _me({props:e,name:"MuiGrid",defaultTheme:aRt})}function cRt(e={}){const{createStyledComponent:t=sRt,useThemeProps:n=lRt,useTheme:r=oL,componentName:o="MuiGrid"}=e,i=(u,d)=>{const{container:p,direction:h,spacing:m,wrap:g,size:y}=u,x={root:["root",p&&"container",g!=="wrap"&&`wrap-xs-${String(g)}`,...oRt(h),...nRt(y),...p?rRt(m,d.breakpoints.keys[0]):[]]};return Un(x,v=>_r(o,v),{})};function s(u,d,p=()=>!0){const h={};return u===null||(Array.isArray(u)?u.forEach((m,g)=>{m!==null&&p(m)&&d.keys[g]&&(h[d.keys[g]]=m)}):typeof u=="object"?Object.keys(u).forEach(m=>{const g=u[m];g!=null&&p(g)&&(h[m]=g)}):h[d.keys[0]]=u),h}const l=t(QMt,ZMt,JMt,YMt,eRt,tRt,XMt),c=f.forwardRef(function(d,p){const h=r(),m=n(d),g=GG(m);iRt(g,h.breakpoints);const{className:y,children:x,columns:v=12,container:b=!1,component:w="div",direction:S="row",wrap:C="wrap",size:N={},offset:j={},spacing:I=0,rowSpacing:_=I,columnSpacing:T=I,unstable_level:P=0,...E}=g,M=s(N,h.breakpoints,H=>H!==!1),R=s(j,h.breakpoints),$=d.columns??(P?void 0:v),D=d.spacing??(P?void 0:I),z=d.rowSpacing??d.spacing??(P?void 0:_),V=d.columnSpacing??d.spacing??(P?void 0:T),B={...g,level:P,columns:$,container:b,direction:S,wrap:C,spacing:D,rowSpacing:z,columnSpacing:V,size:M,offset:R},G=i(B,h);return a.jsx(l,{ref:p,as:w,ownerState:B,className:be(G.root,y),...E,children:f.Children.map(x,H=>{var F;return f.isValidElement(H)&&oO(H,["Grid"])&&b&&H.props.container?f.cloneElement(H,{unstable_level:((F=H.props)==null?void 0:F.unstable_level)??P+1}):H})})});return c.muiName="Grid",c}const uRt=uk(),dRt=Ai("div",{name:"MuiStack",slot:"Root"});function fRt(e){return _me({props:e,name:"MuiStack",defaultTheme:uRt})}function pRt(e,t){const n=f.Children.toArray(e).filter(Boolean);return n.reduce((r,o,i)=>(r.push(o),i({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],mRt=({ownerState:e,theme:t})=>{let n={display:"flex",flexDirection:"column",...ly({theme:t},qQ({values:e.direction,breakpoints:t.breakpoints.values}),r=>({flexDirection:r}))};if(e.spacing){const r=zG(t),o=Object.keys(t.breakpoints.values).reduce((c,u)=>((typeof e.spacing=="object"&&e.spacing[u]!=null||typeof e.direction=="object"&&e.direction[u]!=null)&&(c[u]=!0),c),{}),i=qQ({values:e.direction,base:o}),s=qQ({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((c,u,d)=>{if(!i[c]){const h=u>0?i[d[u-1]]:"column";i[c]=h}}),n=hf(n,ly({theme:t},s,(c,u)=>e.useFlexGap?{gap:ZE(r,c)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${hRt(u?i[u]:e.direction)}`]:ZE(r,c)}}))}return n=p4t(t.breakpoints,n),n};function gRt(e={}){const{createStyledComponent:t=dRt,useThemeProps:n=fRt,componentName:r="MuiStack"}=e,o=()=>Un({root:["root"]},c=>_r(r,c),{}),i=t(mRt);return f.forwardRef(function(c,u){const d=n(c),p=GG(d),{component:h="div",direction:m="column",spacing:g=0,divider:y,children:x,className:v,useFlexGap:b=!1,...w}=p,S={direction:m,spacing:g,useFlexGap:b},C=o();return a.jsx(i,{as:h,ownerState:S,ref:u,className:be(C.root,v),...w,children:y?pRt(x,y):x})})}const v3={black:"#000",white:"#fff"},xRt={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},K5={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},Y5={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},U4={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},X5={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},Q5={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},J5={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function TKe(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:v3.white,default:v3.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const kKe=TKe();function MKe(){return{text:{primary:v3.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:v3.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const mie=MKe();function gNe(e,t,n,r){const o=r.light||r,i=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=aL(e.main,o):t==="dark"&&(e.dark=iL(e.main,i)))}function xNe(e,t,n,r,o){const i=o.light||o,s=o.dark||o*1.5;t[n]||(t.hasOwnProperty(r)?t[n]=t[r]:n==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(i*100).toFixed(0)}%)`:n==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(s*100).toFixed(0)}%)`))}function yRt(e="light"){return e==="dark"?{main:X5[200],light:X5[50],dark:X5[400]}:{main:X5[700],light:X5[400],dark:X5[800]}}function vRt(e="light"){return e==="dark"?{main:K5[200],light:K5[50],dark:K5[400]}:{main:K5[500],light:K5[300],dark:K5[700]}}function bRt(e="light"){return e==="dark"?{main:Y5[500],light:Y5[300],dark:Y5[700]}:{main:Y5[700],light:Y5[400],dark:Y5[800]}}function wRt(e="light"){return e==="dark"?{main:Q5[400],light:Q5[300],dark:Q5[700]}:{main:Q5[700],light:Q5[500],dark:Q5[900]}}function SRt(e="light"){return e==="dark"?{main:J5[400],light:J5[300],dark:J5[700]}:{main:J5[800],light:J5[500],dark:J5[900]}}function CRt(e="light"){return e==="dark"?{main:U4[400],light:U4[300],dark:U4[700]}:{main:"#ed6c02",light:U4[500],dark:U4[900]}}function NRt(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function Mme(e){const{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2,colorSpace:o,...i}=e,s=e.primary||yRt(t),l=e.secondary||vRt(t),c=e.error||bRt(t),u=e.info||wRt(t),d=e.success||SRt(t),p=e.warning||CRt(t);function h(x){return o?NRt(x):xMt(x,mie.text.primary)>=n?mie.text.primary:kKe.text.primary}const m=({color:x,name:v,mainShade:b=500,lightShade:w=300,darkShade:S=700})=>{if(x={...x},!x.main&&x[b]&&(x.main=x[b]),!x.hasOwnProperty("main"))throw new Error(lw(11,v?` (${v})`:"",b));if(typeof x.main!="string")throw new Error(lw(12,v?` (${v})`:"",JSON.stringify(x.main)));return o?(xNe(o,x,"light",w,r),xNe(o,x,"dark",S,r)):(gNe(x,"light",w,r),gNe(x,"dark",S,r)),x.contrastText||(x.contrastText=h(x.main)),x};let g;return t==="light"?g=TKe():t==="dark"&&(g=MKe()),hf({common:{...v3},mode:t,primary:m({color:s,name:"primary"}),secondary:m({color:l,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:m({color:c,name:"error"}),warning:m({color:p,name:"warning"}),info:m({color:u,name:"info"}),success:m({color:d,name:"success"}),grey:xRt,contrastThreshold:n,getContrastText:h,augmentColor:m,tonalOffset:r,...g},i)}function jRt(e){const t={};return Object.entries(e).forEach(r=>{const[o,i]=r;typeof i=="object"&&(t[o]=`${i.fontStyle?`${i.fontStyle} `:""}${i.fontVariant?`${i.fontVariant} `:""}${i.fontWeight?`${i.fontWeight} `:""}${i.fontStretch?`${i.fontStretch} `:""}${i.fontSize||""}${i.lineHeight?`/${i.lineHeight} `:""}${i.fontFamily||""}`)}),t}function ERt(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function IRt(e){return Math.round(e*1e5)/1e5}const yNe={textTransform:"uppercase"},vNe='"Roboto", "Helvetica", "Arial", sans-serif';function RKe(e,t){const{fontFamily:n=vNe,fontSize:r=14,fontWeightLight:o=300,fontWeightRegular:i=400,fontWeightMedium:s=500,fontWeightBold:l=700,htmlFontSize:c=16,allVariants:u,pxToRem:d,...p}=typeof t=="function"?t(e):t,h=r/14,m=d||(x=>`${x/c*h}rem`),g=(x,v,b,w,S)=>({fontFamily:n,fontWeight:x,fontSize:m(v),lineHeight:b,...n===vNe?{letterSpacing:`${IRt(w/v)}em`}:{},...S,...u}),y={h1:g(o,96,1.167,-1.5),h2:g(o,60,1.2,-.5),h3:g(i,48,1.167,0),h4:g(i,34,1.235,.25),h5:g(i,24,1.334,0),h6:g(s,20,1.6,.15),subtitle1:g(i,16,1.75,.15),subtitle2:g(s,14,1.57,.1),body1:g(i,16,1.5,.15),body2:g(i,14,1.43,.15),button:g(s,14,1.75,.4,yNe),caption:g(i,12,1.66,.4),overline:g(i,12,2.66,1,yNe),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return hf({htmlFontSize:c,pxToRem:m,fontFamily:n,fontSize:r,fontWeightLight:o,fontWeightRegular:i,fontWeightMedium:s,fontWeightBold:l,...y},p,{clone:!1})}const _Rt=.2,PRt=.14,ARt=.12;function lc(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${_Rt})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${PRt})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${ARt})`].join(",")}const TRt=["none",lc(0,2,1,-1,0,1,1,0,0,1,3,0),lc(0,3,1,-2,0,2,2,0,0,1,5,0),lc(0,3,3,-2,0,3,4,0,0,1,8,0),lc(0,2,4,-1,0,4,5,0,0,1,10,0),lc(0,3,5,-1,0,5,8,0,0,1,14,0),lc(0,3,5,-1,0,6,10,0,0,1,18,0),lc(0,4,5,-2,0,7,10,1,0,2,16,1),lc(0,5,5,-3,0,8,10,1,0,3,14,2),lc(0,5,6,-3,0,9,12,1,0,3,16,2),lc(0,6,6,-3,0,10,14,1,0,4,18,3),lc(0,6,7,-4,0,11,15,1,0,4,20,3),lc(0,7,8,-4,0,12,17,2,0,5,22,4),lc(0,7,8,-4,0,13,19,2,0,5,24,4),lc(0,7,9,-4,0,14,21,2,0,5,26,4),lc(0,8,9,-5,0,15,22,2,0,6,28,5),lc(0,8,10,-5,0,16,24,2,0,6,30,5),lc(0,8,11,-5,0,17,26,2,0,6,32,5),lc(0,9,11,-5,0,18,28,2,0,7,34,6),lc(0,9,12,-6,0,19,29,2,0,7,36,6),lc(0,10,13,-6,0,20,31,3,0,8,38,7),lc(0,10,13,-6,0,21,33,3,0,8,40,7),lc(0,10,14,-6,0,22,35,3,0,8,42,7),lc(0,11,14,-7,0,23,36,3,0,9,44,8),lc(0,11,15,-7,0,24,38,3,0,9,46,8)],kRt={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},OKe={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function bNe(e){return`${Math.round(e)}ms`}function MRt(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function RRt(e){const t={...kRt,...e.easing},n={...OKe,...e.duration};return{getAutoHeightDuration:MRt,create:(o=["all"],i={})=>{const{duration:s=n.standard,easing:l=t.easeInOut,delay:c=0,...u}=i;return(Array.isArray(o)?o:[o]).map(d=>`${d} ${typeof s=="string"?s:bNe(s)} ${l} ${typeof c=="string"?c:bNe(c)}`).join(",")},...e,easing:t,duration:n}}const ORt={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function $Rt(e){return Ev(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function $Ke(e={}){const t={...e};function n(r){const o=Object.entries(r);for(let i=0;i{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let r=0;rhf(g,y),m),m.unstable_sxConfig={...rL,...d==null?void 0:d.unstable_sxConfig},m.unstable_sx=function(y){return wC({sx:y,theme:this})},m.toRuntimeSource=$Ke,LRt(m),m}function xie(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const FRt=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=xie(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function DKe(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function LKe(e){return e==="dark"?FRt:[]}function zRt(e){const{palette:t={mode:"light"},opacity:n,overlays:r,colorSpace:o,...i}=e,s=Mme({...t,colorSpace:o});return{palette:s,opacity:{...DKe(s.mode),...n},overlays:r||LKe(s.mode),...i}}function BRt(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const HRt=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],VRt=e=>(t,n)=>{const r=e.rootSelector||":root",o=e.colorSchemeSelector;let i=o;if(o==="class"&&(i=".%s"),o==="data"&&(i="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(i=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const s={};return HRt(e.cssVarPrefix).forEach(l=>{s[l]=n[l],delete n[l]}),i==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:s}}:i?{[i.replace("%s",t)]:s,[`${r}, ${i.replace("%s",t)}`]:n}:{[r]:{...n,...s}}}if(i&&i!=="media")return`${r}, ${i.replace("%s",String(t))}`}else if(t){if(i==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(i)return i.replace("%s",String(t))}return r};function URt(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function Ln(e,t,n){!e[t]&&n&&(e[t]=n)}function dR(e){return typeof e!="string"||!e.startsWith("hsl")?e:jKe(e)}function Xb(e,t){`${t}Channel`in e||(e[`${t}Channel`]=uR(dR(e[t])))}function WRt(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const qy=e=>{try{return e()}catch{}},GRt=(e="mui")=>LMt(e);function QQ(e,t,n,r,o){if(!n)return;n=n===!0?{}:n;const i=o==="dark"?"dark":"light";if(!r){t[o]=zRt({...n,palette:{mode:i,...n==null?void 0:n.palette},colorSpace:e});return}const{palette:s,...l}=gie({...r,palette:{mode:i,...n==null?void 0:n.palette},colorSpace:e});return t[o]={...n,palette:s,opacity:{...DKe(i),...n==null?void 0:n.opacity},overlays:(n==null?void 0:n.overlays)||LKe(i)},l}function qRt(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",nativeColor:s=!1,shouldSkipGeneratingVar:l=BRt,colorSchemeSelector:c=n.light&&n.dark?"media":void 0,rootSelector:u=":root",...d}=e,p=Object.keys(n)[0],h=r||(n.light&&p!=="light"?"light":p),m=GRt(i),{[h]:g,light:y,dark:x,...v}=n,b={...v};let w=g;if((h==="dark"&&!("dark"in n)||h==="light"&&!("light"in n))&&(w=!0),!w)throw new Error(lw(21,h));let S;s&&(S="oklch");const C=QQ(S,b,w,d,h);y&&!b.light&&QQ(S,b,y,void 0,"light"),x&&!b.dark&&QQ(S,b,x,void 0,"dark");let N={defaultColorScheme:h,...C,cssVarPrefix:i,colorSchemeSelector:c,rootSelector:u,getCssVar:m,colorSchemes:b,font:{...jRt(C.typography),...C.font},spacing:WRt(d.spacing)};Object.keys(N.colorSchemes).forEach(P=>{const E=N.colorSchemes[P].palette,M=$=>{const D=$.split("-"),z=D[1],V=D[2];return m($,E[z][V])};E.mode==="light"&&(Ln(E.common,"background","#fff"),Ln(E.common,"onBackground","#000")),E.mode==="dark"&&(Ln(E.common,"background","#000"),Ln(E.common,"onBackground","#fff"));function R($,D,z){if(S){let V;return $===TN&&(V=`transparent ${((1-z)*100).toFixed(0)}%`),$===Ms&&(V=`#000 ${(z*100).toFixed(0)}%`),$===Rs&&(V=`#fff ${(z*100).toFixed(0)}%`),`color-mix(in ${S}, ${D}, ${V})`}return $(D,z)}if(URt(E,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),E.mode==="light"){Ln(E.Alert,"errorColor",R(Ms,E.error.light,.6)),Ln(E.Alert,"infoColor",R(Ms,E.info.light,.6)),Ln(E.Alert,"successColor",R(Ms,E.success.light,.6)),Ln(E.Alert,"warningColor",R(Ms,E.warning.light,.6)),Ln(E.Alert,"errorFilledBg",M("palette-error-main")),Ln(E.Alert,"infoFilledBg",M("palette-info-main")),Ln(E.Alert,"successFilledBg",M("palette-success-main")),Ln(E.Alert,"warningFilledBg",M("palette-warning-main")),Ln(E.Alert,"errorFilledColor",qy(()=>E.getContrastText(E.error.main))),Ln(E.Alert,"infoFilledColor",qy(()=>E.getContrastText(E.info.main))),Ln(E.Alert,"successFilledColor",qy(()=>E.getContrastText(E.success.main))),Ln(E.Alert,"warningFilledColor",qy(()=>E.getContrastText(E.warning.main))),Ln(E.Alert,"errorStandardBg",R(Rs,E.error.light,.9)),Ln(E.Alert,"infoStandardBg",R(Rs,E.info.light,.9)),Ln(E.Alert,"successStandardBg",R(Rs,E.success.light,.9)),Ln(E.Alert,"warningStandardBg",R(Rs,E.warning.light,.9)),Ln(E.Alert,"errorIconColor",M("palette-error-main")),Ln(E.Alert,"infoIconColor",M("palette-info-main")),Ln(E.Alert,"successIconColor",M("palette-success-main")),Ln(E.Alert,"warningIconColor",M("palette-warning-main")),Ln(E.AppBar,"defaultBg",M("palette-grey-100")),Ln(E.Avatar,"defaultBg",M("palette-grey-400")),Ln(E.Button,"inheritContainedBg",M("palette-grey-300")),Ln(E.Button,"inheritContainedHoverBg",M("palette-grey-A100")),Ln(E.Chip,"defaultBorder",M("palette-grey-400")),Ln(E.Chip,"defaultAvatarColor",M("palette-grey-700")),Ln(E.Chip,"defaultIconColor",M("palette-grey-700")),Ln(E.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),Ln(E.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),Ln(E.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),Ln(E.LinearProgress,"primaryBg",R(Rs,E.primary.main,.62)),Ln(E.LinearProgress,"secondaryBg",R(Rs,E.secondary.main,.62)),Ln(E.LinearProgress,"errorBg",R(Rs,E.error.main,.62)),Ln(E.LinearProgress,"infoBg",R(Rs,E.info.main,.62)),Ln(E.LinearProgress,"successBg",R(Rs,E.success.main,.62)),Ln(E.LinearProgress,"warningBg",R(Rs,E.warning.main,.62)),Ln(E.Skeleton,"bg",S?R(TN,E.text.primary,.11):`rgba(${M("palette-text-primaryChannel")} / 0.11)`),Ln(E.Slider,"primaryTrack",R(Rs,E.primary.main,.62)),Ln(E.Slider,"secondaryTrack",R(Rs,E.secondary.main,.62)),Ln(E.Slider,"errorTrack",R(Rs,E.error.main,.62)),Ln(E.Slider,"infoTrack",R(Rs,E.info.main,.62)),Ln(E.Slider,"successTrack",R(Rs,E.success.main,.62)),Ln(E.Slider,"warningTrack",R(Rs,E.warning.main,.62));const $=S?R(Ms,E.background.default,.6825):B8(E.background.default,.8);Ln(E.SnackbarContent,"bg",$),Ln(E.SnackbarContent,"color",qy(()=>S?mie.text.primary:E.getContrastText($))),Ln(E.SpeedDialAction,"fabHoverBg",B8(E.background.paper,.15)),Ln(E.StepConnector,"border",M("palette-grey-400")),Ln(E.StepContent,"border",M("palette-grey-400")),Ln(E.Switch,"defaultColor",M("palette-common-white")),Ln(E.Switch,"defaultDisabledColor",M("palette-grey-100")),Ln(E.Switch,"primaryDisabledColor",R(Rs,E.primary.main,.62)),Ln(E.Switch,"secondaryDisabledColor",R(Rs,E.secondary.main,.62)),Ln(E.Switch,"errorDisabledColor",R(Rs,E.error.main,.62)),Ln(E.Switch,"infoDisabledColor",R(Rs,E.info.main,.62)),Ln(E.Switch,"successDisabledColor",R(Rs,E.success.main,.62)),Ln(E.Switch,"warningDisabledColor",R(Rs,E.warning.main,.62)),Ln(E.TableCell,"border",R(Rs,R(TN,E.divider,1),.88)),Ln(E.Tooltip,"bg",R(TN,E.grey[700],.92))}if(E.mode==="dark"){Ln(E.Alert,"errorColor",R(Rs,E.error.light,.6)),Ln(E.Alert,"infoColor",R(Rs,E.info.light,.6)),Ln(E.Alert,"successColor",R(Rs,E.success.light,.6)),Ln(E.Alert,"warningColor",R(Rs,E.warning.light,.6)),Ln(E.Alert,"errorFilledBg",M("palette-error-dark")),Ln(E.Alert,"infoFilledBg",M("palette-info-dark")),Ln(E.Alert,"successFilledBg",M("palette-success-dark")),Ln(E.Alert,"warningFilledBg",M("palette-warning-dark")),Ln(E.Alert,"errorFilledColor",qy(()=>E.getContrastText(E.error.dark))),Ln(E.Alert,"infoFilledColor",qy(()=>E.getContrastText(E.info.dark))),Ln(E.Alert,"successFilledColor",qy(()=>E.getContrastText(E.success.dark))),Ln(E.Alert,"warningFilledColor",qy(()=>E.getContrastText(E.warning.dark))),Ln(E.Alert,"errorStandardBg",R(Ms,E.error.light,.9)),Ln(E.Alert,"infoStandardBg",R(Ms,E.info.light,.9)),Ln(E.Alert,"successStandardBg",R(Ms,E.success.light,.9)),Ln(E.Alert,"warningStandardBg",R(Ms,E.warning.light,.9)),Ln(E.Alert,"errorIconColor",M("palette-error-main")),Ln(E.Alert,"infoIconColor",M("palette-info-main")),Ln(E.Alert,"successIconColor",M("palette-success-main")),Ln(E.Alert,"warningIconColor",M("palette-warning-main")),Ln(E.AppBar,"defaultBg",M("palette-grey-900")),Ln(E.AppBar,"darkBg",M("palette-background-paper")),Ln(E.AppBar,"darkColor",M("palette-text-primary")),Ln(E.Avatar,"defaultBg",M("palette-grey-600")),Ln(E.Button,"inheritContainedBg",M("palette-grey-800")),Ln(E.Button,"inheritContainedHoverBg",M("palette-grey-700")),Ln(E.Chip,"defaultBorder",M("palette-grey-700")),Ln(E.Chip,"defaultAvatarColor",M("palette-grey-300")),Ln(E.Chip,"defaultIconColor",M("palette-grey-300")),Ln(E.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),Ln(E.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),Ln(E.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),Ln(E.LinearProgress,"primaryBg",R(Ms,E.primary.main,.5)),Ln(E.LinearProgress,"secondaryBg",R(Ms,E.secondary.main,.5)),Ln(E.LinearProgress,"errorBg",R(Ms,E.error.main,.5)),Ln(E.LinearProgress,"infoBg",R(Ms,E.info.main,.5)),Ln(E.LinearProgress,"successBg",R(Ms,E.success.main,.5)),Ln(E.LinearProgress,"warningBg",R(Ms,E.warning.main,.5)),Ln(E.Skeleton,"bg",S?R(TN,E.text.primary,.13):`rgba(${M("palette-text-primaryChannel")} / 0.13)`),Ln(E.Slider,"primaryTrack",R(Ms,E.primary.main,.5)),Ln(E.Slider,"secondaryTrack",R(Ms,E.secondary.main,.5)),Ln(E.Slider,"errorTrack",R(Ms,E.error.main,.5)),Ln(E.Slider,"infoTrack",R(Ms,E.info.main,.5)),Ln(E.Slider,"successTrack",R(Ms,E.success.main,.5)),Ln(E.Slider,"warningTrack",R(Ms,E.warning.main,.5));const $=S?R(Rs,E.background.default,.985):B8(E.background.default,.98);Ln(E.SnackbarContent,"bg",$),Ln(E.SnackbarContent,"color",qy(()=>S?kKe.text.primary:E.getContrastText($))),Ln(E.SpeedDialAction,"fabHoverBg",B8(E.background.paper,.15)),Ln(E.StepConnector,"border",M("palette-grey-600")),Ln(E.StepContent,"border",M("palette-grey-600")),Ln(E.Switch,"defaultColor",M("palette-grey-300")),Ln(E.Switch,"defaultDisabledColor",M("palette-grey-600")),Ln(E.Switch,"primaryDisabledColor",R(Ms,E.primary.main,.55)),Ln(E.Switch,"secondaryDisabledColor",R(Ms,E.secondary.main,.55)),Ln(E.Switch,"errorDisabledColor",R(Ms,E.error.main,.55)),Ln(E.Switch,"infoDisabledColor",R(Ms,E.info.main,.55)),Ln(E.Switch,"successDisabledColor",R(Ms,E.success.main,.55)),Ln(E.Switch,"warningDisabledColor",R(Ms,E.warning.main,.55)),Ln(E.TableCell,"border",R(Ms,R(TN,E.divider,1),.68)),Ln(E.Tooltip,"bg",R(TN,E.grey[700],.92))}Xb(E.background,"default"),Xb(E.background,"paper"),Xb(E.common,"background"),Xb(E.common,"onBackground"),Xb(E,"divider"),Object.keys(E).forEach($=>{const D=E[$];$!=="tonalOffset"&&D&&typeof D=="object"&&(D.main&&Ln(E[$],"mainChannel",uR(dR(D.main))),D.light&&Ln(E[$],"lightChannel",uR(dR(D.light))),D.dark&&Ln(E[$],"darkChannel",uR(dR(D.dark))),D.contrastText&&Ln(E[$],"contrastTextChannel",uR(dR(D.contrastText))),$==="text"&&(Xb(E[$],"primary"),Xb(E[$],"secondary")),$==="action"&&(D.active&&Xb(E[$],"active"),D.selected&&Xb(E[$],"selected")))})}),N=t.reduce((P,E)=>hf(P,E),N);const j={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:l,getSelector:VRt(N),enableContrastVars:s},{vars:I,generateThemeVars:_,generateStyleSheets:T}=BMt(N,j);return N.vars=I,Object.entries(N.colorSchemes[N.defaultColorScheme]).forEach(([P,E])=>{N[P]=E}),N.generateThemeVars=_,N.generateStyleSheets=T,N.generateSpacing=function(){return xKe(d.spacing,zG(this))},N.getColorSchemeSelector=HMt(c),N.spacing=N.generateSpacing(),N.shouldSkipGeneratingVar=l,N.unstable_sxConfig={...rL,...d==null?void 0:d.unstable_sxConfig},N.unstable_sx=function(E){return wC({sx:E,theme:this})},N.toRuntimeSource=$Ke,N}function SNe(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:Mme({...n===!0?{}:n.palette,mode:t})})}function sL(e={},...t){const{palette:n,cssVariables:r=!1,colorSchemes:o=n?void 0:{light:!0},defaultColorScheme:i=n==null?void 0:n.mode,...s}=e,l=i||"light",c=o==null?void 0:o[l],u={...o,...n?{[l]:{...typeof c!="boolean"&&c,palette:n}}:void 0};if(r===!1){if(!("colorSchemes"in e))return gie(e,...t);let d=n;"palette"in e||u[l]&&(u[l]!==!0?d=u[l].palette:l==="dark"&&(d={mode:"dark"}));const p=gie({...e,palette:d},...t);return p.defaultColorScheme=l,p.colorSchemes=u,p.palette.mode==="light"&&(p.colorSchemes.light={...u.light!==!0&&u.light,palette:p.palette},SNe(p,"dark",u.dark)),p.palette.mode==="dark"&&(p.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:p.palette},SNe(p,"light",u.light)),p}return!n&&!("light"in u)&&l==="light"&&(u.light=!0),qRt({...s,colorSchemes:u,defaultColorScheme:l,...typeof r!="boolean"&&r},...t)}function KRt(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function YRt(e){return parseFloat(e)}const Rme=sL();function xf(){const e=oL(Rme);return e[qv]||e}function FKe(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const _h=e=>FKe(e)&&e!=="classes",Bt=CKe({themeId:qv,defaultTheme:Rme,rootShouldForwardProp:_h});function XRt({theme:e,...t}){const n=qv in e?e[qv]:void 0;return a.jsx(PKe,{...t,themeId:n?qv:void 0,theme:n||e})}const H8={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:QRt}=DMt({themeId:qv,theme:()=>sL({cssVariables:!0}),colorSchemeStorageKey:H8.colorSchemeStorageKey,modeStorageKey:H8.modeStorageKey,defaultColorScheme:{light:H8.defaultLightColorScheme,dark:H8.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:RKe(e.palette,e.typography)};return t.unstable_sx=function(r){return wC({sx:r,theme:this})},t}}),JRt=QRt;function zKe({theme:e,...t}){const n=f.useMemo(()=>{if(typeof e=="function")return e;const r=qv in e?e[qv]:e;return"colorSchemes"in r?null:"vars"in r?e:{...e,vars:null}},[e]);return n?a.jsx(XRt,{theme:n,...t}):a.jsx(JRt,{theme:e,...t})}function ZRt(e){return a.jsx(yKe,{...e,defaultTheme:Rme,themeId:qv})}function Ome(e){return function(n){return a.jsx(ZRt,{styles:typeof e=="function"?r=>e({theme:r,...n}):e})}}function eOt(){return GG}function Rr(e){return jMt(e)}const yie=typeof Ome({})=="function",tOt=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&!e.vars&&{colorScheme:e.palette.mode}}),nOt=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),BKe=(e,t=!1)=>{var i,s;const n={};t&&e.colorSchemes&&typeof e.getColorSchemeSelector=="function"&&Object.entries(e.colorSchemes).forEach(([l,c])=>{var d,p;const u=e.getColorSchemeSelector(l);u.startsWith("@")?n[u]={":root":{colorScheme:(d=c.palette)==null?void 0:d.mode}}:n[u.replace(/\s*&/,"")]={colorScheme:(p=c.palette)==null?void 0:p.mode}});let r={html:tOt(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...nOt(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...n};const o=(s=(i=e.components)==null?void 0:i.MuiCssBaseline)==null?void 0:s.styleOverrides;return o&&(r=[r,o]),r},Lz="mui-ecs",rOt=e=>{const t=BKe(e,!1),n=Array.isArray(t)?t[0]:t;return!e.vars&&n&&(n.html[`:root:has(${Lz})`]={colorScheme:e.palette.mode}),e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([r,o])=>{var s,l;const i=e.getColorSchemeSelector(r);i.startsWith("@")?n[i]={[`:root:not(:has(.${Lz}))`]:{colorScheme:(s=o.palette)==null?void 0:s.mode}}:n[i.replace(/\s*&/,"")]={[`&:not(:has(.${Lz}))`]:{colorScheme:(l=o.palette)==null?void 0:l.mode}}}),t},oOt=Ome(yie?({theme:e,enableColorScheme:t})=>BKe(e,t):({theme:e})=>rOt(e));function iOt(e){const t=Rr({props:e,name:"MuiCssBaseline"}),{children:n,enableColorScheme:r=!1}=t;return a.jsxs(f.Fragment,{children:[yie&&a.jsx(oOt,{enableColorScheme:r}),!yie&&!r&&a.jsx("span",{className:Lz,style:{display:"none"}}),n]})}/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aOt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),sOt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),CNe=e=>{const t=sOt(e);return t.charAt(0).toUpperCase()+t.slice(1)},HKe=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),lOt=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var cOt={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.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uOt=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...l},c)=>f.createElement("svg",{ref:c,...cOt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:HKe("lucide",o),...!i&&!lOt(l)&&{"aria-hidden":"true"},...l},[...s.map(([u,d])=>f.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const On=(e,t)=>{const n=f.forwardRef(({className:r,...o},i)=>f.createElement(uOt,{ref:i,iconNode:t,className:HKe(`lucide-${aOt(CNe(e))}`,`lucide-${e}`,r),...o}));return n.displayName=CNe(e),n};/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dOt=[["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"}]],Xi=On("activity",dOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fOt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m14.31 8 5.74 9.94",key:"1y6ab4"}],["path",{d:"M9.69 8h11.48",key:"1wxppr"}],["path",{d:"m7.38 12 5.74-9.94",key:"1grp0k"}],["path",{d:"M9.69 16 3.95 6.06",key:"libnyf"}],["path",{d:"M14.31 16H2.83",key:"x5fava"}],["path",{d:"m16.62 12-5.74 9.94",key:"1vwawt"}]],pOt=On("aperture",fOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hOt=[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]],YG=On("arrow-down-left",hOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mOt=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],gOt=On("arrow-down-right",mOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xOt=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],yOt=On("arrow-down",xOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vOt=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],V8=On("arrow-left",vOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bOt=[["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"}]],$me=On("arrow-right-left",bOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wOt=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],fk=On("arrow-right",wOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SOt=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Cy=On("arrow-up-right",SOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const COt=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],NOt=On("arrow-up",COt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jOt=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["path",{d:"M20.2 20.2c2.04-2.03.02-7.36-4.5-11.9-4.54-4.52-9.87-6.54-11.9-4.5-2.04 2.03-.02 7.36 4.5 11.9 4.54 4.52 9.87 6.54 11.9 4.5Z",key:"1l2ple"}],["path",{d:"M15.7 15.7c4.52-4.54 6.54-9.87 4.5-11.9-2.03-2.04-7.36-.02-11.9 4.5-4.52 4.54-6.54 9.87-4.5 11.9 2.03 2.04 7.36.02 11.9-4.5Z",key:"1wam0m"}]],VKe=On("atom",jOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const EOt=[["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"}]],IOt=On("banknote",EOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _Ot=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],POt=On("bell",_Ot);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const AOt=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],vie=On("book",AOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const TOt=[["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"}]],Pp=On("bot",TOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kOt=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],MOt=On("box",kOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ROt=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],Dme=On("brain-circuit",ROt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OOt=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],UKe=On("brain",OOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $Ot=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],eC=On("briefcase",$Ot);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DOt=[["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"}]],WKe=On("building-2",DOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const LOt=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],iO=On("building",LOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const FOt=[["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"}]],zOt=On("calculator",FOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const BOt=[["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"}]],GKe=On("calendar",BOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const HOt=[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]],VOt=On("car",HOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const UOt=[["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"}]],YI=On("chart-column",UOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const WOt=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],fR=On("chart-no-axes-column",WOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const GOt=[["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"}]],XG=On("chart-pie",GOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qOt=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],KOt=On("check",qOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const YOt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Lme=On("chevron-down",YOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const XOt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],nd=On("chevron-right",XOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const QOt=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],JOt=On("chevron-up",QOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ZOt=[["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"}]],Fme=On("circle-alert",ZOt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const e3t=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],dg=On("circle-check-big",e3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const t3t=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],xh=On("circle-check",t3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const n3t=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],qKe=On("circle-plus",n3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const r3t=[["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"}]],o3t=On("circle-question-mark",r3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const i3t=[["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"}]],b3=On("circle-x",i3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const a3t=[["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"}]],s3t=On("clipboard",a3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const l3t=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],zme=On("clock",l3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const c3t=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],IE=On("code",c3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const u3t=[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]],d3t=On("coins",u3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const f3t=[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]],p3t=On("command",f3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const h3t=[["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"}]],m3t=On("copy",h3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const g3t=[["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"}]],Ei=On("cpu",g3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const x3t=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],yh=On("credit-card",x3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const y3t=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],bie=On("crown",y3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const v3t=[["path",{d:"m21.12 6.4-6.05-4.06a2 2 0 0 0-2.17-.05L2.95 8.41a2 2 0 0 0-.95 1.7v5.82a2 2 0 0 0 .88 1.66l6.05 4.07a2 2 0 0 0 2.17.05l9.95-6.12a2 2 0 0 0 .95-1.7V8.06a2 2 0 0 0-.88-1.66Z",key:"1u2ovd"}],["path",{d:"M10 22v-8L2.25 9.15",key:"11pn4q"}],["path",{d:"m10 14 11.77-6.87",key:"1kt1wh"}]],b3t=On("cuboid",v3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const w3t=[["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"}]],rl=On("database",w3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const S3t=[["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"}]],cy=On("dollar-sign",S3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const C3t=[["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"}]],Ch=On("download",C3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const N3t=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],KKe=On("ellipsis",N3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const j3t=[["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"}]],YKe=On("external-link",j3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const E3t=[["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"}]],k2=On("eye",E3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const I3t=[["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 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],_3t=On("file-braces",I3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const P3t=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],A3t=On("file-code-corner",P3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const T3t=[["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"}]],k3t=On("file-code",T3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const M3t=[["path",{d:"M13.85 22H18a2 2 0 0 0 2-2V8a2 2 0 0 0-.586-1.414l-4-4A2 2 0 0 0 14 2H6a2 2 0 0 0-2 2v6.6",key:"1l4p50"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m3.305 19.53.923-.382",key:"ao1pio"}],["path",{d:"m4.228 16.852-.924-.383",key:"1fv9zy"}],["path",{d:"m5.852 15.228-.383-.923",key:"1a9hc2"}],["path",{d:"m5.852 20.772-.383.924",key:"1sh9ke"}],["path",{d:"m8.148 15.228.383-.923",key:"4yu6lf"}],["path",{d:"m8.53 21.696-.382-.924",key:"18b0s9"}],["path",{d:"m9.773 16.852.922-.383",key:"ti6xop"}],["path",{d:"m9.773 19.148.922.383",key:"rws47d"}],["circle",{cx:"7",cy:"18",r:"3",key:"lvkj7j"}]],Yp=On("file-cog",M3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const R3t=[["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"}]],ss=On("file-text",R3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const O3t=[["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"}]],kd=On("fingerprint-pattern",O3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $3t=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],D3t=On("flask-conical",$3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const L3t=[["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"}]],F3t=On("folder",L3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const z3t=[["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"}]],QG=On("funnel",z3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const B3t=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],H3t=On("gauge",B3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const V3t=[["path",{d:"M10.5 3 8 9l4 13 4-13-2.5-6",key:"b3dvk1"}],["path",{d:"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z",key:"7w4byz"}],["path",{d:"M2 9h20",key:"16fsjt"}]],U3t=On("gem",V3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const W3t=[["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"}]],vi=On("globe",W3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const G3t=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],q3t=On("graduation-cap",G3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const K3t=[["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"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],XKe=On("grid-3x3",K3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Y3t=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],wie=On("heart",Y3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const X3t=[["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"}]],Gf=On("history",X3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Q3t=[["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"}]],J3t=On("house",Q3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Z3t=[["path",{d:"M6 16c5 0 7-8 12-8a4 4 0 0 1 0 8c-5 0-7-8-12-8a4 4 0 1 0 0 8",key:"18ogeb"}]],w3=On("infinity",Z3t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const e$t=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],QKe=On("info",e$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const t$t=[["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"}]],eT=On("key",t$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const n$t=[["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"}]],Y1=On("landmark",n$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const r$t=[["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"}]],Fu=On("layers",r$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const o$t=[["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"}]],Bme=On("layout-dashboard",o$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const i$t=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],Sie=On("library",i$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const a$t=[["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"}]],JQ=On("link",a$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const s$t=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],cw=On("loader-circle",s$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const l$t=[["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"}]],ds=On("lock",l$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const c$t=[["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"}]],u$t=On("log-out",c$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const d$t=[["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"}]],f$t=On("mail",d$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const p$t=[["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"}]],NNe=On("megaphone",p$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const h$t=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],m$t=On("menu",h$t);/** * @license lucide-react v0.555.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$t=[["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:"M7 11h10",key:"1twpyw"}],["path",{d:"M7 15h6",key:"d9of3u"}],["path",{d:"M7 7h8",key:"af5zfr"}]],jNe=On("message-square-text",g$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const x$t=[["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"}]],Lw=On("message-square",x$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const y$t=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],v$t=On("mic",y$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const b$t=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Fz=On("network",b$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const w$t=[["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"}]],Cie=On("octagon-alert",w$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const S$t=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Nie=On("palette",S$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const C$t=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],N$t=On("pause",C$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const j$t=[["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"}]],E$t=On("pen",j$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const I$t=[["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"}]],_$t=On("percent",I$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const P$t=[["path",{d:"M11 17h3v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a3.16 3.16 0 0 0 2-2h1a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-1a5 5 0 0 0-2-4V3a4 4 0 0 0-3.2 1.6l-.3.4H11a6 6 0 0 0-6 6v1a5 5 0 0 0 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1z",key:"1piglc"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M2 8v1a2 2 0 0 0 2 2h1",key:"1env43"}]],A$t=On("piggy-bank",P$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const T$t=[["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"}]],XI=On("play",T$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const k$t=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],T0=On("plus",k$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const M$t=[["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"}]],RH=On("radio",M$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const R$t=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],gP=On("refresh-ccw",R$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const O$t=[["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"}]],qf=On("refresh-cw",O$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $$t=[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]],ENe=On("repeat",$$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const D$t=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],Gj=On("rocket",D$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const L$t=[["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"}]],Hme=On("save",L$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const F$t=[["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"}]],JKe=On("scale",F$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const z$t=[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],B$t=On("scroll",z$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const H$t=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],hm=On("search",H$t);/** * @license lucide-react v0.555.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$t=[["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"}]],Lc=On("send",V$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const U$t=[["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"}]],ZKe=On("server",U$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const W$t=[["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"}]],eYe=On("settings-2",W$t);/** * @license lucide-react v0.555.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$t=[["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"}]],v0=On("settings",G$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const q$t=[["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"}]],QI=On("shield-alert",q$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const K$t=[["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"}]],ri=On("shield-check",K$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Y$t=[["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"}]],uf=On("shield",Y$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const X$t=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],Q$t=On("shopping-bag",X$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const J$t=[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]],ZQ=On("shuffle",J$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Z$t=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],tYe=On("sliders-horizontal",Z$t);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const eDt=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],tDt=On("smartphone",eDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nDt=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],mm=On("sparkles",nDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rDt=[["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"}]],oDt=On("star",rDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const iDt=[["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"}]],JG=On("target",iDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aDt=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Bs=On("terminal",aDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sDt=[["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"}]],CC=On("trash-2",sDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lDt=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],NC=On("trending-up",lDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cDt=[["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"}]],zu=On("triangle-alert",cDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uDt=[["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"}]],tT=On("user-check",uDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dDt=[["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"}]],tC=On("user",dDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fDt=[["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"}]],_E=On("users",fDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pDt=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],hDt=On("video",pDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mDt=[["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"}]],gDt=On("wallet",mDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xDt=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],INe=On("wand-sparkles",xDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yDt=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],vDt=On("wifi",yDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bDt=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],vh=On("x",bDt);/** * @license lucide-react v0.555.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wDt=[["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"}]],_a=On("zap",wDt);var jie=function(e,t){return jie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},jie(e,t)};function SDt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");jie(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var of=function(){return of=Object.assign||function(t){for(var n,r=1,o=arguments.length;r0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]0&&g[g.length-1])||S[0]!==6&&S[0]!==2)){x=0;continue}if(S[0]===3&&(!g||S[1]>g[0]&&S[1]0?setTimeout(m,w):m(null)}}window.addEventListener("storage",v),d.addToWaiting(v);var b=setTimeout(v,Math.max(0,p-Date.now()))}))];case 1:return h.sent(),[2]}}))}))},d.addToWaiting=function(p){this.removeFromWaiting(p),d.waiters!==void 0&&d.waiters.push(p)},d.removeFromWaiting=function(p){d.waiters!==void 0&&(d.waiters=d.waiters.filter((function(h){return h!==p})))},d.notifyWaiters=function(){d.waiters!==void 0&&d.waiters.slice().forEach((function(p){return p()}))},d.prototype.releaseLock=function(p){return n(this,void 0,void 0,(function(){return r(this,(function(h){switch(h.label){case 0:return[4,this.releaseLock__private__(p)];case 1:return[2,h.sent()]}}))}))},d.prototype.releaseLock__private__=function(p){return n(this,void 0,void 0,(function(){var h,m,g,y;return r(this,(function(x){switch(x.label){case 0:return h=this.storageHandler===void 0?s:this.storageHandler,m=i+"-"+p,(g=h.getItemSync(m))===null?[2]:(y=JSON.parse(g)).id!==this.id?[3,2]:[4,pj.default().lock(y.iat)];case 1:x.sent(),this.acquiredIatSet.delete(y.iat),h.removeItemSync(m),pj.default().unlock(y.iat),d.notifyWaiters(),x.label=2;case 2:return[2]}}))}))},d.lockCorrector=function(p){for(var h=Date.now()-5e3,m=p,g=[],y=0;;){var x=m.keySync(y);if(x===null)break;g.push(x),y++}for(var v=!1,b=0;bDate.now();let Cd=class Eie extends Error{constructor(t,n){super(n),this.error=t,this.error_description=n,Object.setPrototypeOf(this,Eie.prototype)}static fromPayload({error:t,error_description:n}){return new Eie(t,n)}},EDt=class oYe extends Cd{constructor(t,n,r,o=null){super(t,n),this.state=r,this.appState=o,Object.setPrototypeOf(this,oYe.prototype)}},IDt=class iYe extends Cd{constructor(t,n,r,o,i=null){super(t,n),this.connection=r,this.state=o,this.appState=i,Object.setPrototypeOf(this,iYe.prototype)}},Iie=class aYe extends Cd{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,aYe.prototype)}},_Dt=class sYe extends Iie{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,sYe.prototype)}},PDt=class lYe extends Cd{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,lYe.prototype)}},ADt=class cYe extends Cd{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,cYe.prototype)}},TDt=class uYe extends Cd{constructor(t,n,r){super(t,n),this.mfa_token=r,Object.setPrototypeOf(this,uYe.prototype)}},dYe=class fYe extends Cd{constructor(t,n){super("missing_refresh_token",`Missing Refresh Token (audience: '${OH(t,["default"])}', scope: '${OH(n)}')`),this.audience=t,this.scope=n,Object.setPrototypeOf(this,fYe.prototype)}},kDt=class pYe extends Cd{constructor(t,n){super("missing_scopes",`Missing requested scopes after refresh (audience: '${OH(t,["default"])}', missing scope: '${OH(n)}')`),this.audience=t,this.scope=n,Object.setPrototypeOf(this,pYe.prototype)}},hYe=class mYe extends Cd{constructor(t){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=t,Object.setPrototypeOf(this,mYe.prototype)}};function OH(e,t=[]){return e&&!t.includes(e)?e:""}const $H=()=>window.crypto,W4=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from($H().getRandomValues(new Uint8Array(43))).forEach((n=>t+=e[n%e.length])),t},eJ=e=>btoa(e),MDt=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],RDt=e=>Object.keys(e).reduce(((t,n)=>{const r=MDt.find((o=>o.key===n));return r&&r.type.includes(typeof e[n])&&(t[n]=e[n]),t}),{}),_ie=e=>{var{clientId:t}=e,n=bv(e,["clientId"]);return new URLSearchParams((r=>Object.keys(r).filter((o=>r[o]!==void 0)).reduce(((o,i)=>Object.assign(Object.assign({},o),{[i]:r[i]})),{}))(Object.assign({client_id:t},n))).toString()},PNe=async e=>await $H().subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),ANe=e=>(t=>decodeURIComponent(atob(t).split("").map((n=>"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2))).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),TNe=e=>{const t=new Uint8Array(e);return(n=>{const r={"+":"-","/":"_","=":""};return n.replace(/[+/=]/g,(o=>r[o]))})(window.btoa(String.fromCharCode(...Array.from(t))))},ODt=new TextEncoder,$Dt=new TextDecoder;function aO(e){return typeof e=="string"?ODt.encode(e):$Dt.decode(e)}function kNe(e){if(typeof e.modulusLength!="number"||e.modulusLength<2048)throw new LDt(`${e.name} modulusLength must be at least 2048 bits`)}async function DDt(e,t,n){if(n.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const r=`${sO(aO(JSON.stringify(e)))}.${sO(aO(JSON.stringify(t)))}`;return`${r}.${sO(await crypto.subtle.sign((function(o){switch(o.algorithm.name){case"ECDSA":return{name:o.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return kNe(o.algorithm),{name:o.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return kNe(o.algorithm),{name:o.algorithm.name};case"Ed25519":return{name:o.algorithm.name}}throw new qj})(n),n,aO(r)))}`}let Pie;Uint8Array.prototype.toBase64?Pie=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):Pie=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let r=0;r{const n=await fetch(e,t);return{ok:n.ok,json:await n.json(),headers:(r=n.headers,[...r].reduce(((o,[i,s])=>(o[i]=s,o)),{}))};var r},GDt=async(e,t,n)=>{const r=new AbortController;let o;return t.signal=r.signal,Promise.race([WDt(e,t),new Promise(((i,s)=>{o=setTimeout((()=>{r.abort(),s(new Error("Timeout when executing 'fetch'"))}),n)}))]).finally((()=>{clearTimeout(o)}))},qDt=async(e,t,n,r,o,i,s,l)=>{return c={auth:{audience:t,scope:n},timeout:o,fetchUrl:e,fetchOptions:r,useFormData:s,useMrrt:l},u=i,new Promise((function(d,p){const h=new MessageChannel;h.port1.onmessage=function(m){m.data.error?p(new Error(m.data.error)):d(m.data),h.port1.close()},u.postMessage(c,[h.port2])}));var c,u},KDt=async(e,t,n,r,o,i,s=1e4,l)=>o?qDt(e,t,n,r,s,o,i,l):GDt(e,r,s);async function vYe(e,t,n,r,o,i,s,l,c,u){if(c){const w=await c.generateProof({url:e,method:o.method||"GET",nonce:await c.getNonce()});o.headers=Object.assign(Object.assign({},o.headers),{dpop:w})}let d,p=null;for(let w=0;w<3;w++)try{d=await KDt(e,n,r,o,i,s,t,l),p=null;break}catch(S){p=S}if(p)throw p;const h=d.json,{error:m,error_description:g}=h,y=bv(h,["error","error_description"]),{headers:x,ok:v}=d;let b;if(c&&(b=x["dpop-nonce"],b&&await c.setNonce(b)),!v){const w=g||`HTTP error. Unable to fetch ${e}`;if(m==="mfa_required")throw new TDt(m,w,y.mfa_token);if(m==="missing_refresh_token")throw new dYe(n,r);if(m==="use_dpop_nonce"){if(!c||!b||u)throw new hYe(b);return vYe(e,t,n,r,o,i,s,l,c,!0)}throw new Cd(m||"request_error",w)}return y}async function YDt(e,t){var{baseUrl:n,timeout:r,audience:o,scope:i,auth0Client:s,useFormData:l,useMrrt:c,dpop:u}=e,d=bv(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const p=d.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",h=d.grant_type==="refresh_token"&&c,m=Object.assign(Object.assign(Object.assign(Object.assign({},d),p&&o&&{audience:o}),p&&i&&{scope:i}),h&&{audience:o,scope:i}),g=l?_ie(m):JSON.stringify(m),y=(x=d.grant_type,BDt.includes(x));var x;return await vYe(`${n}/oauth/token`,r,o||"default",i,{method:"POST",body:g,headers:{"Content-Type":l?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(RDt(s||nYe)))}},t,l,c,y?u:void 0)}const zz=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t},U8=(e,t,n)=>{let r;return n&&(r=e[n]),r||(r=e.default),zz(r,t)};let P1=class Aie{constructor(t,n="@@auth0spajs@@",r){this.prefix=n,this.suffix=r,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[n,r,o,i]=t.split("::");return new Aie({clientId:r,scope:i,audience:o},n)}static fromCacheEntry(t){const{scope:n,audience:r,client_id:o}=t;return new Aie({scope:n,audience:r,clientId:o})}},XDt=class{set(t,n){localStorage.setItem(t,JSON.stringify(n))}get(t){const n=window.localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter((t=>t.startsWith("@@auth0spajs@@")))}},bYe=class{constructor(){this.enclosedCache=(function(){let t={};return{set(n,r){t[n]=r},get(n){const r=t[n];if(r)return r},remove(n){delete t[n]},allKeys:()=>Object.keys(t)}})()}},QDt=class{constructor(t,n,r){this.cache=t,this.keyManifest=n,this.nowProvider=r||rYe}async setIdToken(t,n,r){var o;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:n,decodedToken:r}),await((o=this.keyManifest)===null||o===void 0?void 0:o.add(i))}async getIdToken(t){const n=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!n&&t.scope&&t.audience){const r=await this.get(t);return!r||!r.id_token||!r.decodedToken?void 0:{id_token:r.id_token,decodedToken:r.decodedToken}}if(n)return{id_token:n.id_token,decodedToken:n.decodedToken}}async get(t,n=0,r=!1,o){var i;let s=await this.cache.get(t.toKey());if(!s){const u=await this.getCacheKeys();if(!u)return;const d=this.matchExistingCacheKey(t,u);if(d&&(s=await this.cache.get(d)),!d&&r&&o!=="cache-only")return this.getEntryWithRefreshToken(t,u)}if(!s)return;const l=await this.nowProvider(),c=Math.floor(l/1e3);return s.expiresAt-n!t||o.includes(t))).reduce((async(o,i)=>{await o,await this.cache.remove(i)}),Promise.resolve()),await((n=this.keyManifest)===null||n===void 0?void 0:n.clear()))}async wrapCacheEntry(t){const n=await this.nowProvider();return{body:t,expiresAt:Math.floor(n/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new P1({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,n){return n.filter((r=>{var o;const i=P1.fromKey(r),s=new Set(i.scope&&i.scope.split(" ")),l=((o=t.scope)===null||o===void 0?void 0:o.split(" "))||[],c=i.scope&&l.reduce(((u,d)=>u&&s.has(d)),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&c}))[0]}async getEntryWithRefreshToken(t,n){var r;for(const o of n){const i=P1.fromKey(o);if(i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId){const s=await this.cache.get(o);if(!((r=s==null?void 0:s.body)===null||r===void 0)&&r.refresh_token)return this.modifiedCachedEntry(s,t)}}}async updateEntry(t,n){var r;const o=await this.getCacheKeys();if(o)for(const i of o){const s=await this.cache.get(i);if(((r=s==null?void 0:s.body)===null||r===void 0?void 0:r.refresh_token)===t){const l=Object.assign(Object.assign({},s.body),{refresh_token:n});await this.set(l)}}}},JDt=class{constructor(t,n,r){this.storage=t,this.clientId=n,this.cookieDomain=r,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const G4=e=>typeof e=="number",ZDt=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],eLt=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const s=i.split("."),[l,c,u]=s;if(s.length!==3||!l||!c||!u)throw new Error("ID token could not be decoded");const d=JSON.parse(ANe(c)),p={__raw:i},h={};return Object.keys(d).forEach((m=>{p[m]=d[m],ZDt.includes(m)||(h[m]=d[m])})),{encoded:{header:l,payload:c,signature:u},header:JSON.parse(ANe(l)),claims:p,user:h}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!G4(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(t.claims.exp==null||!G4(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!G4(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,r=new Date(e.now||Date.now()),o=new Date(0);if(o.setUTCSeconds(t.claims.exp+n),r>o)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${r}) is after expiration time (${o})`);if(t.claims.nbf!=null&&G4(t.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-n),ri)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${r}) is after last auth at ${i}`)}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const s=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(s!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${s}", found "${t.claims.org_id}"`)}else{const s=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(s!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${s}", found "${t.claims.org_name}"`)}}return t};var Kj=Ume((function(e,t){var n=kj&&kj.__assign||function(){return n=Object.assign||function(c){for(var u,d=1,p=arguments.length;d"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var h2;(function(e){e.Code="code",e.ConnectCode="connect_code"})(h2||(h2={}));function oLt(e,t,n){var r=t===void 0?null:t,o=(function(c,u){var d=atob(c);if(u){for(var p=new Uint8Array(d.length),h=0,m=d.length;h0?await this.cache.set(this.manifestKey,{keys:[...r]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(t){return`@@auth0spajs@@::${t}`}};const sLt={memory:()=>new bYe().enclosedCache,localstorage:()=>new XDt},$Ne=e=>sLt[e],DNe=e=>{const{openUrl:t,onRedirect:n}=e,r=bv(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},r),{openUrl:t===!1||t?t:n})},LNe=(e,t)=>{const n=(t==null?void 0:t.split(" "))||[];return((e==null?void 0:e.split(" "))||[]).every((r=>n.includes(r)))},RN={NONCE:"nonce",KEYPAIR:"keypair"};class lLt{constructor(t){this.clientId=t}getVersion(){return 1}createDbHandle(){const t=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise(((n,r)=>{t.onupgradeneeded=()=>Object.values(RN).forEach((o=>t.result.createObjectStore(o))),t.onerror=()=>r(t.error),t.onsuccess=()=>n(t.result)}))}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(t,n,r){const o=r((await this.getDbHandle()).transaction(t,n).objectStore(t));return new Promise(((i,s)=>{o.onsuccess=()=>i(o.result),o.onerror=()=>s(o.error)}))}buildKey(t){const n=t?`_${t}`:"auth0";return`${this.clientId}::${n}`}setNonce(t,n){return this.save(RN.NONCE,this.buildKey(n),t)}setKeyPair(t){return this.save(RN.KEYPAIR,this.buildKey(),t)}async save(t,n,r){await this.executeDbRequest(t,"readwrite",(o=>o.put(r,n)))}findNonce(t){return this.find(RN.NONCE,this.buildKey(t))}findKeyPair(){return this.find(RN.KEYPAIR,this.buildKey())}find(t,n){return this.executeDbRequest(t,"readonly",(r=>r.get(n)))}async deleteBy(t,n){const r=await this.executeDbRequest(t,"readonly",(o=>o.getAllKeys()));r==null||r.filter(n).map((o=>this.executeDbRequest(t,"readwrite",(i=>i.delete(o)))))}deleteByClientId(t,n){return this.deleteBy(t,(r=>typeof r=="string"&&r.startsWith(`${n}::`)))}clearNonces(){return this.deleteByClientId(RN.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(RN.KEYPAIR,this.clientId)}}let cLt=class{constructor(t){this.storage=new lLt(t)}getNonce(t){return this.storage.findNonce(t)}setNonce(t,n){return this.storage.setNonce(t,n)}async getOrGenerateKeyPair(){let t=await this.storage.findKeyPair();return t||(t=await HDt(),await this.storage.setKeyPair(t)),t}async generateProof(t){const n=await this.getOrGenerateKeyPair();return UDt(Object.assign({keyPair:n},t))}async calculateThumbprint(){return VDt(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var xP;(function(e){e.Bearer="Bearer",e.DPoP="DPoP"})(xP||(xP={}));let uLt=class{constructor(t,n){this.hooks=n,this.config=Object.assign(Object.assign({},t),{fetch:t.fetch||(typeof window>"u"?fetch:window.fetch.bind(window))})}isAbsoluteUrl(t){return/^(https?:)?\/\//i.test(t)}buildUrl(t,n){if(n){if(this.isAbsoluteUrl(n))return n;if(t)return`${t.replace(/\/?\/$/,"")}/${n.replace(/^\/+/,"")}`}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(t){return this.config.getAccessToken?this.config.getAccessToken(t):this.hooks.getAccessToken(t)}extractUrl(t){return typeof t=="string"?t:t instanceof URL?t.href:t.url}buildBaseRequest(t,n){if(!this.config.baseUrl)return new Request(t,n);const r=this.buildUrl(this.config.baseUrl,this.extractUrl(t)),o=t instanceof Request?new Request(r,t):r;return new Request(o,n)}setAuthorizationHeader(t,n,r=xP.Bearer){t.headers.set("authorization",`${r} ${n}`)}async setDpopProofHeader(t,n){if(!this.config.dpopNonceId)return;const r=await this.hooks.getDpopNonce(),o=await this.hooks.generateDpopProof({accessToken:n,method:t.method,nonce:r,url:t.url});t.headers.set("dpop",o)}async prepareRequest(t,n){const r=await this.getAccessToken(n);let o,i;typeof r=="string"?(o=this.config.dpopNonceId?xP.DPoP:xP.Bearer,i=r):(o=r.token_type,i=r.access_token),this.setAuthorizationHeader(t,i,o),o===xP.DPoP&&await this.setDpopProofHeader(t,i)}getHeader(t,n){return Array.isArray(t)?new Headers(t).get(n)||"":typeof t.get=="function"?t.get(n)||"":t[n]||""}hasUseDpopNonceError(t){if(t.status!==401)return!1;const n=this.getHeader(t.headers,"www-authenticate");return n.includes("invalid_dpop_nonce")||n.includes("use_dpop_nonce")}async handleResponse(t,n){const r=this.getHeader(t.headers,"dpop-nonce");if(r&&await this.hooks.setDpopNonce(r),!this.hasUseDpopNonceError(t))return t;if(!r||!n.onUseDpopNonceError)throw new hYe(r);return n.onUseDpopNonceError()}async internalFetchWithAuth(t,n,r,o){const i=this.buildBaseRequest(t,n);await this.prepareRequest(i,o);const s=await this.config.fetch(i);return this.handleResponse(s,r)}fetchWithAuth(t,n,r){const o={onUseDpopNonceError:()=>this.internalFetchWithAuth(t,n,Object.assign(Object.assign({},o),{onUseDpopNonceError:void 0}),r)};return this.internalFetchWithAuth(t,n,o,r)}},dLt=class{constructor(t,n){this.myAccountFetcher=t,this.apiBase=n}async connectAccount(t){const n=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return this._handleResponse(n)}async completeAccount(t){const n=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return this._handleResponse(n)}async _handleResponse(t){let n;try{n=await t.text(),n=JSON.parse(n)}catch(r){throw new FNe({type:"invalid_json",status:t.status,title:"Invalid JSON response",detail:n||String(r)})}if(t.ok)return n;throw new FNe(n)}},FNe=class CYe extends Error{constructor({type:t,status:n,title:r,detail:o,validation_errors:i}){super(o),this.name="MyAccountApiError",this.type=t,this.status=n,this.title=r,this.detail=o,this.validation_errors=i,Object.setPrototypeOf(this,CYe.prototype)}};const rJ=new NDt;let fLt=class{constructor(t){let n,r;if(this.userCache=new bYe().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const c=Array.from(this.activeLockKeys);for(const u of c)await rJ.releaseLock(u);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!$H())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if($H().subtle===void 0)throw new Error(` auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information. `)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)r=t.cache;else{if(n=t.cacheLocation||"memory",!$Ne(n))throw new Error(`Invalid cache location "${n}"`);r=$Ne(n)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?eP:nLt,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(c=>`auth0.${c}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const o=t.useCookiesForTransactions?this.cookieStorage:rLt;var i;this.scope=((c,u,...d)=>{if(typeof c!="object")return{default:zz(u,c,...d)};let p={default:zz(u,...d)};return Object.keys(c).forEach((h=>{const m=c[h];p[h]=zz(u,m,...d)})),p})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new JDt(o,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||rYe,this.cacheManager=new QDt(r,r.allKeys?void 0:new aLt(r,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new cLt(this.options.clientId):void 0,this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((c,u)=>c?c.startsWith("https://")?c:`https://${c}/`:`${u}/`)(this.options.issuer,this.domainUrl);const s=`${this.domainUrl}/me/`,l=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:s},detailedResponse:!0})}));this.myAccountApi=new dLt(l,s),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new iLt)}_url(t){const n=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||nYe)));return`${this.domainUrl}${t}&auth0Client=${n}`}_authorizeUrl(t){return this._url(`/authorize?${_ie(t)}`)}async _verifyIdToken(t,n,r){const o=await this.nowProvider();return eLt({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:n,organization:r,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:o});var i}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,n,r){var o;const i=eJ(W4()),s=eJ(W4()),l=W4(),c=await PNe(l),u=TNe(c),d=await((o=this.dpop)===null||o===void 0?void 0:o.calculateThumbprint()),p=((m,g,y,x,v,b,w,S,C)=>Object.assign(Object.assign(Object.assign({client_id:m.clientId},m.authorizationParams),y),{scope:U8(g,y.scope,y.audience),response_type:"code",response_mode:S||"query",state:x,nonce:v,redirect_uri:w||m.authorizationParams.redirect_uri,code_challenge:b,code_challenge_method:"S256",dpop_jkt:C}))(this.options,this.scope,t,i,s,u,t.redirect_uri||this.options.authorizationParams.redirect_uri||r,n==null?void 0:n.response_mode,d),h=this._authorizeUrl(p);return{nonce:s,code_verifier:l,scope:p.scope,audience:p.audience||"default",redirect_uri:p.redirect_uri,state:i,url:h}}async loginWithPopup(t,n){var r;if(t=t||{},!(n=n||{}).popup&&(n.popup=(l=>{const c=window.screenX+(window.innerWidth-400)/2,u=window.screenY+(window.innerHeight-600)/2;return window.open(l,"auth0:authorize:popup",`left=${c},top=${u},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!n.popup))throw new ADt;const o=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);n.popup.location.href=o.url;const i=await(l=>new Promise(((c,u)=>{let d;const p=setInterval((()=>{l.popup&&l.popup.closed&&(clearInterval(p),clearTimeout(h),window.removeEventListener("message",d,!1),u(new PDt(l.popup)))}),1e3),h=setTimeout((()=>{clearInterval(p),u(new _Dt(l.popup)),window.removeEventListener("message",d,!1)}),1e3*(l.timeoutInSeconds||60));d=function(m){if(m.data&&m.data.type==="authorization_response"){if(clearTimeout(h),clearInterval(p),window.removeEventListener("message",d,!1),l.popup.close(),m.data.response.error)return u(Cd.fromPayload(m.data.response));c(m.data.response)}},window.addEventListener("message",d)})))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(o.state!==i.state)throw new Cd("state_mismatch","Invalid state");const s=((r=t.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:o.audience,scope:o.scope,code_verifier:o.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:o.redirect_uri},{nonceIn:o.nonce,organization:s})}async getUser(){var t;const n=await this._getIdTokenFromCache();return(t=n==null?void 0:n.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const n=await this._getIdTokenFromCache();return(t=n==null?void 0:n.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var n;const r=DNe(t),{openUrl:o,fragment:i,appState:s}=r,l=bv(r,["openUrl","fragment","appState"]),c=((n=l.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization,u=await this._prepareAuthorizeUrl(l.authorizationParams||{}),{url:d}=u,p=bv(u,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},p),{appState:s,response_type:h2.Code}),c&&{organization:c}));const h=i?`${d}#${i}`:d;o?await o(h):window.location.assign(h)}async handleRedirectCallback(t=window.location.href){const n=t.split("?").slice(1);if(n.length===0)throw new Error("There are no query params available for parsing.");const r=this.transactionManager.get();if(!r)throw new Cd("missing_transaction","Invalid state");this.transactionManager.remove();const o=(i=>{i.indexOf("#")>-1&&(i=i.substring(0,i.indexOf("#")));const s=new URLSearchParams(i);return{state:s.get("state"),code:s.get("code")||void 0,connect_code:s.get("connect_code")||void 0,error:s.get("error")||void 0,error_description:s.get("error_description")||void 0}})(n.join(""));return r.response_type===h2.ConnectCode?this._handleConnectAccountRedirectCallback(o,r):this._handleLoginRedirectCallback(o,r)}async _handleLoginRedirectCallback(t,n){const{code:r,state:o,error:i,error_description:s}=t;if(i)throw new EDt(i,s||i,o,n.appState);if(!n.code_verifier||n.state&&n.state!==o)throw new Cd("state_mismatch","Invalid state");const l=n.organization,c=n.nonce,u=n.redirect_uri;return await this._requestToken(Object.assign({audience:n.audience,scope:n.scope,code_verifier:n.code_verifier,grant_type:"authorization_code",code:r},u?{redirect_uri:u}:{}),{nonceIn:c,organization:l}),{appState:n.appState,response_type:h2.Code}}async _handleConnectAccountRedirectCallback(t,n){const{connect_code:r,state:o,error:i,error_description:s}=t;if(i)throw new IDt(i,s||i,n.connection,o,n.appState);if(!r)throw new Cd("missing_connect_code","Missing connect code");if(!(n.code_verifier&&n.state&&n.auth_session&&n.redirect_uri&&n.state===o))throw new Cd("state_mismatch","Invalid state");const l=await this.myAccountApi.completeAccount({auth_session:n.auth_session,connect_code:r,redirect_uri:n.redirect_uri,code_verifier:n.code_verifier});return Object.assign(Object.assign({},l),{appState:n.appState,response_type:h2.ConnectCode})}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var n,r;const o=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:U8(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope,((r=t.authorizationParams)===null||r===void 0?void 0:r.audience)||this.options.authorizationParams.audience)})}),i=await((s,l)=>{let c=nJ[l];return c||(c=s().finally((()=>{delete nJ[l],c=null})),nJ[l]=c),c})((()=>this._getTokenSilently(o)),`${this.options.clientId}::${o.authorizationParams.audience}::${o.authorizationParams.scope}`);return t.detailedResponse?i:i==null?void 0:i.access_token}async _getTokenSilently(t){const{cacheMode:n}=t,r=bv(t,["cacheMode"]);if(n!=="off"){const l=await this._getEntryFromCache({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:n});if(l)return l}if(n==="cache-only")return;const o=(i=this.options.clientId,s=r.authorizationParams.audience||"default",`auth0.lock.getTokenSilently.${i}.${s}`);var i,s;if(!await(async(l,c=3)=>{for(let u=0;urJ.acquireLock(o,5e3)),10))throw new Iie;this.activeLockKeys.add(o),this.activeLockKeys.size===1&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if(n!=="off"){const m=await this._getEntryFromCache({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId});if(m)return m}const l=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(r):await this._getTokenFromIFrame(r),{id_token:c,token_type:u,access_token:d,oauthTokenScope:p,expires_in:h}=l;return Object.assign(Object.assign({id_token:c,token_type:u,access_token:d},p?{scope:p}:null),{expires_in:h})}finally{await rJ.releaseLock(o),this.activeLockKeys.delete(o),this.activeLockKeys.size===0&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(t={},n={}){var r,o;const i=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:U8(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope,((o=t.authorizationParams)===null||o===void 0?void 0:o.audience)||this.options.authorizationParams.audience)})});return n=Object.assign(Object.assign({},jDt),n),await this.loginWithPopup(i,n),(await this.cacheManager.get(new P1({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const n=t.logoutParams||{},{federated:r}=n,o=bv(n,["federated"]),i=r?"&federated":"";return this._url(`/v2/logout?${_ie(Object.assign({clientId:t.clientId},o))}`)+i}async logout(t={}){var n;const r=DNe(t),{openUrl:o}=r,i=bv(r,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@"),await((n=this.dpop)===null||n===void 0?void 0:n.clear());const s=this._buildLogoutUrl(i);o?await o(s):o!==!1&&window.location.assign(s)}async _getTokenFromIFrame(t){const n=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),r=this.cookieStorage.get(this.orgHintCookieName);r&&!n.organization&&(n.organization=r);const{url:o,state:i,nonce:s,code_verifier:l,redirect_uri:c,scope:u,audience:d}=await this._prepareAuthorizeUrl(n,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new Cd("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const p=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let h;try{h=new URL(this.domainUrl).origin}catch{h=this.domainUrl}const m=await((y,x,v=60)=>new Promise(((b,w)=>{const S=window.document.createElement("iframe");S.setAttribute("width","0"),S.setAttribute("height","0"),S.style.display="none";const C=()=>{window.document.body.contains(S)&&(window.document.body.removeChild(S),window.removeEventListener("message",N,!1))};let N;const j=setTimeout((()=>{w(new Iie),C()}),1e3*v);N=function(I){if(I.origin!=x||!I.data||I.data.type!=="authorization_response")return;const _=I.source;_&&_.close(),I.data.response.error?w(Cd.fromPayload(I.data.response)):b(I.data.response),clearTimeout(j),window.removeEventListener("message",N,!1),setTimeout(C,2e3)},window.addEventListener("message",N,!1),window.document.body.appendChild(S),S.setAttribute("src",y)})))(o,h,p);if(i!==m.state)throw new Cd("state_mismatch","Invalid state");const g=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:l,code:m.code,grant_type:"authorization_code",redirect_uri:c,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:s,organization:n.organization});return Object.assign(Object.assign({},g),{scope:u,oauthTokenScope:g.scope,audience:d})}catch(p){throw p.error==="login_required"&&this.logout({openUrl:!1}),p}}async _getTokenUsingRefreshToken(t){const n=await this.cacheManager.get(new P1({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(n&&n.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new dYe(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const r=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,o=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null,i=((d,p,h,m)=>{var g;if(d&&h&&m){if(p.audience!==h)return p.scope;const y=m.split(" "),x=((g=p.scope)===null||g===void 0?void 0:g.split(" "))||[],v=x.every((b=>y.includes(b)));return y.length>=x.length&&v?m:p.scope}return p.scope})(this.options.useMrrt,t.authorizationParams,n==null?void 0:n.audience,n==null?void 0:n.scope);try{const d=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:n&&n.refresh_token,redirect_uri:r}),o&&{timeout:o}),{scopesToRequest:i});if(d.refresh_token&&this.options.useMrrt&&(n!=null&&n.refresh_token)&&await this.cacheManager.updateEntry(n.refresh_token,d.refresh_token),this.options.useMrrt&&(s=n==null?void 0:n.audience,l=n==null?void 0:n.scope,c=t.authorizationParams.audience,u=t.authorizationParams.scope,(s!==c||!LNe(u,l))&&!LNe(i,d.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);await this.cacheManager.remove(this.options.clientId,t.authorizationParams.audience,t.authorizationParams.scope);const p=((h,m)=>{const g=(h==null?void 0:h.split(" "))||[],y=(m==null?void 0:m.split(" "))||[];return g.filter((x=>y.indexOf(x)==-1)).join(",")})(i,d.scope);throw new kDt(t.authorizationParams.audience||"default",p)}return Object.assign(Object.assign({},d),{scope:t.authorizationParams.scope,oauthTokenScope:d.scope,audience:t.authorizationParams.audience||"default"})}catch(d){if((d.message.indexOf("Missing Refresh Token")>-1||d.message&&d.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw d}var s,l,c,u}async _saveEntryInCache(t){const{id_token:n,decodedToken:r}=t,o=bv(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:n,decodedToken:r}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(o)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",n=this.scope[t],r=await this.cacheManager.getIdToken(new P1({clientId:this.options.clientId,audience:t,scope:n})),o=this.userCache.get("@@user@@");return r&&r.id_token===(o==null?void 0:o.id_token)?o:(this.userCache.set("@@user@@",r),r)}async _getEntryFromCache({scope:t,audience:n,clientId:r,cacheMode:o}){const i=await this.cacheManager.get(new P1({scope:t,audience:n,clientId:r}),60,this.options.useMrrt,o);if(i&&i.access_token){const{token_type:s,access_token:l,oauthTokenScope:c,expires_in:u}=i,d=await this._getIdTokenFromCache();return d&&Object.assign(Object.assign({id_token:d.id_token,token_type:s||"Bearer",access_token:l},c?{scope:c}:null),{expires_in:u})}}async _requestToken(t,n){const{nonceIn:r,organization:o,scopesToRequest:i}=n||{},s=await YDt(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},t),{scope:i||t.scope}),this.worker),l=await this._verifyIdToken(s.id_token,r,o);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},s),{decodedToken:l,scope:t.scope,audience:t.audience||"default"}),s.scope?{oauthTokenScope:s.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(o||l.claims.org_id),Object.assign(Object.assign({},s),{decodedToken:l})}async exchangeToken(t){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:t.subject_token,subject_token_type:t.subject_token_type,scope:U8(this.scope,t.scope,t.audience||this.options.authorizationParams.audience),audience:t.audience||this.options.authorizationParams.audience,organization:t.organization||this.options.authorizationParams.organization})}_assertDpop(t){if(!t)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(t){return this._assertDpop(this.dpop),this.dpop.getNonce(t)}setDpopNonce(t,n){return this._assertDpop(this.dpop),this.dpop.setNonce(t,n)}generateDpopProof(t){return this._assertDpop(this.dpop),this.dpop.generateProof(t)}createFetcher(t={}){return new uLt(t,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:n=>{var r;return this.getTokenSilently({authorizationParams:{scope:(r=n==null?void 0:n.scope)===null||r===void 0?void 0:r.join(" "),audience:n==null?void 0:n.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(t.dpopNonceId),setDpopNonce:n=>this.setDpopNonce(n,t.dpopNonceId),generateDpopProof:n=>this.generateDpopProof(n)})}async connectAccountWithRedirect(t){const{openUrl:n,appState:r,connection:o,scopes:i,authorization_params:s,redirectUri:l=this.options.authorizationParams.redirect_uri||window.location.origin}=t;if(!o)throw new Error("connection is required");const c=eJ(W4()),u=W4(),d=await PNe(u),p=TNe(d),{connect_uri:h,connect_params:m,auth_session:g}=await this.myAccountApi.connectAccount({connection:o,scopes:i,redirect_uri:l,state:c,code_challenge:p,code_challenge_method:"S256",authorization_params:s});this.transactionManager.create({state:c,code_verifier:u,auth_session:g,redirect_uri:l,appState:r,connection:o,response_type:h2.ConnectCode});const y=new URL(h);y.searchParams.set("ticket",m.ticket),n?await n(y.toString()):window.location.assign(y)}};var NYe={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},Xp=function(){throw new Error("You forgot to wrap your component in .")},pLt=of(of({},NYe),{buildAuthorizeUrl:Xp,buildLogoutUrl:Xp,getAccessTokenSilently:Xp,getAccessTokenWithPopup:Xp,getIdTokenClaims:Xp,exchangeToken:Xp,loginWithRedirect:Xp,loginWithPopup:Xp,connectAccountWithRedirect:Xp,logout:Xp,handleRedirectCallback:Xp,getDpopNonce:Xp,setDpopNonce:Xp,generateDpopProof:Xp,createFetcher:Xp}),jYe=f.createContext(pLt),zNe=(function(e){SDt(t,e);function t(n,r){var o=e.call(this,r??n)||this;return o.error=n,o.error_description=r,Object.setPrototypeOf(o,t.prototype),o}return t})(Error),hLt=/[?&](?:connect_)?code=[^&]+/,mLt=/[?&]state=[^&]+/,gLt=/[?&]error=[^&]+/,xLt=function(e){return e===void 0&&(e=window.location.search),(hLt.test(e)||gLt.test(e))&&mLt.test(e)},EYe=function(e){return function(t){if(t instanceof Error)return t;if(t!==null&&typeof t=="object"&&"error"in t&&typeof t.error=="string"){if("error_description"in t&&typeof t.error_description=="string"){var n=t;return new zNe(n.error,n.error_description)}var r=t;return new zNe(r.error)}return new Error(e)}},BNe=EYe("Login failed"),W8=EYe("Get access token failed"),IYe=function(e){var t,n;e!=null&&e.redirectUri&&(console.warn("Using `redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),e.authorizationParams=(t=e.authorizationParams)!==null&&t!==void 0?t:{},e.authorizationParams.redirect_uri=e.redirectUri,delete e.redirectUri),!((n=e==null?void 0:e.authorizationParams)===null||n===void 0)&&n.redirectUri&&(console.warn("Using `authorizationParams.redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `authorizationParams.redirectUri` will be removed in a future version"),e.authorizationParams.redirect_uri=e.authorizationParams.redirectUri,delete e.authorizationParams.redirectUri)},yLt=function(e,t){switch(t.type){case"LOGIN_POPUP_STARTED":return of(of({},e),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return of(of({},e),{isAuthenticated:!!t.user,user:t.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return e.user===t.user?e:of(of({},e),{isAuthenticated:!!t.user,user:t.user});case"LOGOUT":return of(of({},e),{isAuthenticated:!1,user:void 0});case"ERROR":return of(of({},e),{isLoading:!1,error:t.error})}},vLt=function(e){return IYe(e),of(of({},e),{auth0Client:{name:"auth0-react",version:"2.11.0"}})},bLt=function(e){var t;window.history.replaceState({},document.title,(t=e.returnTo)!==null&&t!==void 0?t:window.location.pathname)},wLt=function(e){var t=e.children,n=e.skipRedirectCallback,r=e.onRedirectCallback,o=r===void 0?bLt:r,i=e.context,s=i===void 0?jYe:i,l=_Ne(e,["children","skipRedirectCallback","onRedirectCallback","context"]),c=f.useState(function(){return new fLt(vLt(l))})[0],u=f.useReducer(yLt,NYe),d=u[0],p=u[1],h=f.useRef(!1),m=f.useCallback(function(E){return p({type:"ERROR",error:E}),E},[]);f.useEffect(function(){h.current||(h.current=!0,(function(){return kN(void 0,void 0,void 0,function(){var E,M,R,$,D,z,V;return MN(this,function(B){switch(B.label){case 0:return B.trys.push([0,7,,8]),E=void 0,xLt()&&!n?[4,c.handleRedirectCallback()]:[3,3];case 1:return M=B.sent(),R=M.appState,$=R===void 0?{}:R,D=M.response_type,z=_Ne(M,["appState","response_type"]),[4,c.getUser()];case 2:return E=B.sent(),$.response_type=D,D===h2.ConnectCode&&($.connectedAccount=z),o($,E),[3,6];case 3:return[4,c.checkSession()];case 4:return B.sent(),[4,c.getUser()];case 5:E=B.sent(),B.label=6;case 6:return p({type:"INITIALISED",user:E}),[3,8];case 7:return V=B.sent(),m(BNe(V)),[3,8];case 8:return[2]}})})})())},[c,o,n,m]);var g=f.useCallback(function(E){return IYe(E),c.loginWithRedirect(E)},[c]),y=f.useCallback(function(E,M){return kN(void 0,void 0,void 0,function(){var R,$;return MN(this,function(D){switch(D.label){case 0:p({type:"LOGIN_POPUP_STARTED"}),D.label=1;case 1:return D.trys.push([1,3,,4]),[4,c.loginWithPopup(E,M)];case 2:return D.sent(),[3,4];case 3:return R=D.sent(),m(BNe(R)),[2];case 4:return[4,c.getUser()];case 5:return $=D.sent(),p({type:"LOGIN_POPUP_COMPLETE",user:$}),[2]}})})},[c,m]),x=f.useCallback(function(){for(var E=[],M=0;M=HNe[n.getLevel()]&&Sh(o,t)}var Ci={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},HNe=(fx={},fx[Ci.ok]=0,fx[Ci.debug]=1,fx[Ci.info]=2,fx[Ci.notice]=4,fx[Ci.warn]=5,fx[Ci.error]=6,fx[Ci.critical]=7,fx[Ci.alert]=8,fx[Ci.emerg]=9,fx);function ZG(e,t){var n=t===void 0?{}:t,r=n.includeMessage,o=r===void 0?!1:r;return{stack:e.stack,kind:e.type,message:o?e.message:void 0,causes:e.causes,fingerprint:e.fingerprint,handling:e.handling}}var CLt=function(e,t,n,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(o<3?s(i):o>3?s(t,n,i):s(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i},S3={console:"console",http:"http"},NLt=Object.keys(Ci),uy=(function(){function e(t,n,r,o,i,s){o===void 0&&(o=S3.http),i===void 0&&(i=Ci.debug),s===void 0&&(s={}),this.handleLogStrategy=t,this.handlerType=o,this.level=i,this.contextManager=JA(n),this.contextManager.setContext(s),r&&this.contextManager.setContextProperty("logger",{name:r})}return e.prototype.logImplementation=function(t,n,r,o,i){r===void 0&&(r=Ci.info);var s=Wl(n),l;if(o!=null){var c=Xhe({stackTrace:$w(o)?Cb(o):void 0,originalError:o,nonErrorPrefix:"Provided",source:vm.LOGGER,handling:"handled",startClocks:Tp()});l=ug({error:ZG(c,{includeMessage:!0})},s)}else l=s;this.handleLogStrategy({message:Wl(t),context:l,status:r},this,i)},e.prototype.log=function(t,n,r,o){r===void 0&&(r=Ci.info);var i;DH(r,S3.http,this)&&(i=XA()),this.logImplementation(t,n,r,o,i)},e.prototype.setContext=function(t){this.contextManager.setContext(t)},e.prototype.getContext=function(){return this.contextManager.getContext()},e.prototype.setContextProperty=function(t,n){this.contextManager.setContextProperty(t,n)},e.prototype.removeContextProperty=function(t){this.contextManager.removeContextProperty(t)},e.prototype.clearContext=function(){this.contextManager.clearContext()},e.prototype.setHandler=function(t){this.handlerType=t},e.prototype.getHandler=function(){return this.handlerType},e.prototype.setLevel=function(t){this.level=t},e.prototype.getLevel=function(){return this.level},CLt([rNt],e.prototype,"logImplementation",null),e})();uy.prototype.ok=Fw(Ci.ok);uy.prototype.debug=Fw(Ci.debug);uy.prototype.info=Fw(Ci.info);uy.prototype.notice=Fw(Ci.notice);uy.prototype.warn=Fw(Ci.warn);uy.prototype.error=Fw(Ci.error);uy.prototype.critical=Fw(Ci.critical);uy.prototype.alert=Fw(Ci.alert);uy.prototype.emerg=Fw(Ci.emerg);function Fw(e){return function(t,n,r){var o;DH(e,S3.http,this)&&(o=XA()),this.logImplementation(t,n,e,r,o)}}function jLt(e,t){return{view:{referrer:document.referrer,url:window.location.href},context:e.getContext(),user:t.getContext()}}var ELt=32*iw;function ILt(e){e.usePciIntake===!0&&e.site&&e.site!=="datadoghq.com"&&Pa.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");var t=VWe(e),n=VNe(e.forwardConsoleLogs,vH(Pu),"Forward Console Logs"),r=VNe(e.forwardReports,vH(QA),"Forward Reports");if(!(!t||!n||!r))return e.forwardErrorsToLogs&&!Sh(n,Pu.error)&&n.push(Pu.error),Wo({forwardErrorsToLogs:e.forwardErrorsToLogs!==!1,forwardConsoleLogs:n,forwardReports:r,requestErrorResponseLengthLimit:ELt,sendLogsAfterSessionExpiration:!!e.sendLogsAfterSessionExpiration},t)}function VNe(e,t,n){if(e===void 0)return[];if(!(e==="all"||Array.isArray(e)&&e.every(function(r){return Sh(t,r)}))){Pa.error("".concat(n,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'));return}return e==="all"?t:Tjt(e)}function _Lt(e){var t=UWe(e);return Wo({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports,use_pci_intake:e.usePciIntake,send_logs_after_session_expiration:e.sendLogsAfterSessionExpiration},t)}function PLt(e,t,n){var r=Qhe(),o,i,s=t.observable.subscribe(l);function l(){if(!(!i||!o||!t.isGranted())){s.unsubscribe();var c=n(o,i);r.drain(c)}}return{init:function(c){if(!c){Pa.error("Missing configuration");return}if(AWe(c.enableExperimentalFeatures),sy()&&(c=ALt(c)),o=c,i){NG("DD_LOGS",c);return}var u=ILt(c);u&&(i=u,IG().subscribe(Ea),t.tryToInit(u.trackingConsent),l())},get initConfiguration(){return o},getInternalContext:Ea,handleLog:function(c,u,d,p,h){p===void 0&&(p=e()),h===void 0&&(h=fu()),r.add(function(m){return m.handleLog(c,u,d,p,h)})}}}function ALt(e){return Wo({},e,{clientToken:"empty"})}var UNe="logs";function TLt(e){var t=IGe(),n=JA(t.getOrCreateTracker(2)),r=JA(t.getOrCreateTracker(1)),o=zWe();function i(){return jLt(n,r)}var s=PLt(i,o,function(u,d){u.storeContextsAcrossPages&&(IH(d,n,UNe,2),IH(d,r,UNe,1));var p=e(u,d,i,o);return s=kLt(u,p),p}),l={},c=new uy(function(){for(var u=[],d=0;dt.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function qLt(e){return e==="xhr"?"XHR":"Fetch"}function KLt(e,t,n){_Ge(e,function(r,o,i){if(r)n(r);else{var s=new TextDecoder().decode(o);i&&(s+="..."),n(void 0,s)}},{bytesLimit:t,collectStreamBody:!0})}function YLt(e,t){if(!e.forwardErrorsToLogs)return{stop:Ea};var n=new us,r=XWe(n).stop,o=n.subscribe(function(i){t.notify(0,{rawLogsEvent:{message:i.message,date:i.startClocks.timeStamp,error:ZG(i),origin:vm.SOURCE,status:Ci.error}})});return{stop:function(){r(),o.unsubscribe()}}}var XLt=CGe,px;function QLt(e){function t(n,r,o,i,s){var l=ug(r.getContext(),n.context);if(DH(n.status,S3.console,r)&&ZLt(n,l),DH(n.status,S3.http,r)){var c={rawLogsEvent:{date:s||fu(),message:n.message,status:n.status,origin:vm.LOGGER},messageContext:l,savedCommonContext:i};o&&(c.domainContext={handlingStack:o}),e.notify(0,c)}}return{handleLog:t}}var JLt=(px={},px[Ci.ok]=Pu.debug,px[Ci.debug]=Pu.debug,px[Ci.info]=Pu.info,px[Ci.notice]=Pu.info,px[Ci.warn]=Pu.warn,px[Ci.error]=Pu.error,px[Ci.critical]=Pu.error,px[Ci.alert]=Pu.error,px[Ci.emerg]=Pu.error,px);function ZLt(e,t){var n=e.status,r=e.message;Pj[JLt[n]].call(jv,r,t)}function e6t(e,t,n,r,o){var i=Jhe(e,{endpoint:e.logsEndpointBuilder,encoder:d3()},e.replica&&{endpoint:e.replica.logsEndpointBuilder,encoder:d3()},n,r,o.expireObservable);return t.subscribe(1,function(s){i.add(s)}),i}function t6t(e){var t=YC();e.subscribe(1,function(n){t.send("log",n)})}function n6t(e){return{get:function(t){var n=e.findTrackedSession(t);if(n)return{session_id:n.id}}}}function r6t(e){return function(t){e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,origin:vm.AGENT,status:Ci.error}}),KC("Error reported to customer",{"error.message":t.message})}}function o6t(e,t,n,r,o){var i=iGe("browser-logs-sdk",t);i.setContextProvider(function(){var p,h,m,g,y,x;return{application:{id:(p=Bz())===null||p===void 0?void 0:p.application_id},session:{id:(h=o.findTrackedSession())===null||h===void 0?void 0:h.id},view:{id:(g=(m=Bz())===null||m===void 0?void 0:m.view)===null||g===void 0?void 0:g.id},action:{id:(x=(y=Bz())===null||y===void 0?void 0:y.user_action)===null||x===void 0?void 0:x.id}}});var s=[];if(sy()){var l=YC(),c=i.observable.subscribe(function(p){return l.send("internal_telemetry",p)});s.push(function(){return c.unsubscribe()})}else{var u=Jhe(t,{endpoint:t.rumEndpointBuilder,encoder:d3()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:d3()},n,r,o.expireObservable);s.push(function(){return u.stop()});var d=i.observable.subscribe(function(p){return u.add(p,sGe(t))});s.push(function(){return d.unsubscribe()})}return aGe(),lGe(_Lt(e)),{telemetry:i,stop:function(){s.forEach(function(p){return p()})}}}function i6t(e,t,n,r){var o=new XLt,i=[];o.subscribe(1,function(m){return jG("logs",m)});var s=r6t(o),l=wGe(t),c=t.sessionStoreStrategyType&&!sy()&&!_G()?RLt(t,r):OLt(t),u=o6t(e,t,s,l,c).stop;i.push(function(){return u()}),HLt(t,o),YLt(t,o),zLt(t,o),BLt(t,o);var d=QLt(o).handleLog;if(LLt(c,t,o,n,s),sy())t6t(o);else{var p=e6t(t,o,s,l,c).stop;i.push(function(){return p()})}var h=n6t(c);return{handleLog:d,getInternalContext:h.get,stop:function(){i.forEach(function(m){return m()})}}}var Gme=TLt(i6t);JWe(Rw(),"DD_LOGS",Gme);var GNe={},a6t="@vercel/analytics",s6t="1.6.1",l6t=()=>{window.va||(window.va=function(...t){(window.vaq=window.vaq||[]).push(t)})};function PYe(){return typeof window<"u"}function AYe(){try{const e="production"}catch{}return"production"}function c6t(e="auto"){if(e==="auto"){window.vam=AYe();return}window.vam=e}function u6t(){return(PYe()?window.vam:AYe())||"production"}function Tie(){return u6t()==="development"}function d6t(e){return e.scriptSrc?e.scriptSrc:Tie()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?`${e.basePath}/insights/script.js`:"/_vercel/insights/script.js"}function f6t(e={debug:!0}){var t;if(!PYe())return;c6t(e.mode),l6t(),e.beforeSend&&((t=window.va)==null||t.call(window,"beforeSend",e.beforeSend));const n=d6t(e);if(document.head.querySelector(`script[src*="${n}"]`))return;const r=document.createElement("script");r.src=n,r.defer=!0,r.dataset.sdkn=a6t+(e.framework?`/${e.framework}`:""),r.dataset.sdkv=s6t,e.disableAutoTrack&&(r.dataset.disableAutoTrack="1"),e.endpoint?r.dataset.endpoint=e.endpoint:e.basePath&&(r.dataset.endpoint=`${e.basePath}/insights`),e.dsn&&(r.dataset.dsn=e.dsn),r.onerror=()=>{const o=Tie()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${n}. ${o}`)},Tie()&&e.debug===!1&&(r.dataset.debug="false"),document.head.appendChild(r)}function p6t({route:e,path:t}){var n;(n=window.va)==null||n.call(window,"pageview",{route:e,path:t})}function h6t(){if(!(typeof process>"u"||typeof GNe>"u"))return GNe.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}function m6t(e){return f.useEffect(()=>{var t;e.beforeSend&&((t=window.va)==null||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),f.useEffect(()=>{f6t({framework:e.framework||"react",basePath:e.basePath??h6t(),...e.route!==void 0&&{disableAutoTrack:!0},...e})},[]),f.useEffect(()=>{e.route&&e.path&&p6t({route:e.route,path:e.path})},[e.route,e.path]),null}const q4={id:"user-1-sovereign",name:"The Visionary",email:"visionary@sovereign-ai-nexus.io",picture:"https://i.pravatar.cc/150?u=visionary-nexus",roles:["VISIONARY","ADMIN","TRADER","SYSTEM_ARCHITECT"],securityLevel:"ARCHITECT_LEVEL",tradingProfile:{profileId:"tp-visionary-alpha",riskAppetite:"CALCULATED_MAXIMALIST",authorizedMarkets:["NASDAQ","CRYPTO","FOREX","INTERDIMENSIONAL_DERIVATIVES","NEURAL_FUTURES"],hftAlgorithmId:"algo-quantum-momentum-v3",temporalRiskTolerance:"PICOSECONDS",subscribedCognitiveFeeds:["global-sentiment-alpha","geopolitical-tremor-index"],quantumEntanglementPairId:"qe-pair-001-alpha"},biometricHashV2:"0xdeadbeef...",genomicSignatureId:"gs-v-jbo3",citizenship:"NEXUS_SOVEREIGN",reputationScore:998,threatVectorIndex:.01,neuralLaceSyncStatus:"ACTIVE_STABLE",cognitiveProfileId:"cp-v-jbo3",activeThoughtStreamId:"ts-realtime-nexus-strategy",lastLoginCoordinates:{lat:34.0522,lon:-118.2437,alt:1e4,dimension:"alpha-prime"},temporalAnchorId:`ta-${Date.now()}`,activeSovereignAgentIds:["agent-odin","agent-freya"],permissionsGridHash:"0xabc123..."},qNe={status:"INACTIVE",latencyMs:0,marketDataFeedId:null,activeAlgorithm:null,quantumLinkStatus:"DECOHERING",currentRealityDrift:0,sovereignAIOverrideActive:!1,activeCognitiveModel:"base-human-heuristic-v1",predictedTimelineCount:0,causalityInferenceEngineId:"cie-standard-logic",sessionStartEpoch:0,dataThroughputGbps:0,activeMarketSimulations:0,complianceCheckHash:"0x0"},g6t={globalMarketSentiment:.2,sovereignAIHealth:"OPTIMAL",networkThreatLevel:"LOW",activeUserNodes:1,qNetGlobalBandwidth:999999},x6t={cognitiveId:"cp-v-jbo3",fluidIntelligenceQuotient:185,cognitiveBiasCorrectionLevel:.98,patternRecognitionSpeedMs:5,ethicalFrameworkAlignment:"BALANCED_CONSENSUS",lastCalibrationTimestamp:new Date().toISOString()},y6t={pairId:"qe-pair-001-alpha",status:"AWAITING_PAIR",peerNodeId:null,lastHeartbeat:new Date().toISOString(),qbitErrorRate:.001},eq=f.createContext(void 0),v6t=({children:e})=>{const{isAuthenticated:t,user:n,isLoading:r,loginWithRedirect:o,logout:i,error:s}=SLt(),[l,c]=f.useState(null),[u,d]=f.useState(null),[p,h]=f.useState(qNe),[m,g]=f.useState(g6t),[y,x]=f.useState(null),[v,b]=f.useState(null),[w,S]=f.useState(!1),[C,N]=f.useState(null);f.useEffect(()=>{t&&n?(c({...q4,id:n.sub||q4.id,name:n.name||q4.name,email:n.email||q4.email,picture:n.picture||q4.picture}),d("auth0-session-active"),x(x6t),b(y6t)):!t&&!r&&!l&&(c(null),d(null))},[t,n,r]);const j=async(X,J)=>(await o(),!0),I=async()=>(await o(),!0),_=async()=>{await o({authorizationParams:{connection:"citi-connect-enterprise"}})},T=async()=>{i({logoutParams:{returnTo:window.location.origin}}),c(null),d(null)},P=f.useCallback(async X=>l?(S(!0),new Promise(J=>{setTimeout(()=>{X==="123456"?(c(te=>te?{...te,securityLevel:"TRADING_UNLOCKED"}:null),S(!1),J(!0)):(N("Invalid 2FA code."),S(!1),J(!1))},750)})):(N("No active user session to elevate."),!1),[l]),E=f.useCallback(async()=>{await new Promise(X=>setTimeout(X,600)),g(X=>({...X,globalMarketSentiment:Math.random()*2-1}))},[]),M=f.useCallback(async()=>{var X;if((l==null?void 0:l.securityLevel)!=="TRADING_UNLOCKED"&&(l==null?void 0:l.securityLevel)!=="ARCHITECT_LEVEL"){N("Security level insufficient for HFT engine connection.");return}h(J=>({...J,status:"CONNECTING"})),await new Promise(J=>setTimeout(J,2e3)),h({...qNe,status:"ACTIVE",latencyMs:3,marketDataFeedId:"feed-lmax-prime-nyc",activeAlgorithm:((X=l.tradingProfile)==null?void 0:X.hftAlgorithmId)||null,quantumLinkStatus:"ENTANGLED",sessionStartEpoch:Date.now(),dataThroughputGbps:400,activeMarketSimulations:50})},[l]),R=f.useCallback(()=>{h(X=>({...X,status:"DISCONNECTED"}))},[]),$=async()=>!0,D=async()=>{},z=async()=>!0,V=async()=>{},B=async()=>"agent-id",G=async()=>({}),H=async()=>!1,F="Architect of the Sovereign AI Nexus.",W=r||w,U=(s==null?void 0:s.message)||C,K=t;return a.jsx(eq.Provider,{value:{isAuthenticated:K,user:l,sessionToken:u,isLoading:W,error:U,profileData:F,tradingSession:p,nexusStatus:m,cognitiveProfile:y,quantumLink:v,loginWithCredentials:j,loginWithBiometrics:I,loginWithSSO:_,logout:T,elevateSessionForTrading:P,refreshSession:E,connectToTradingEngine:M,disconnectFromTradingEngine:R,calibrateNeuralLace:$,updateEthicalFramework:D,initiateQuantumTunnel:z,severQuantumLink:V,deploySovereignAgent:B,queryCausalityEngine:G,requestEthicalOverride:H},children:e})},TYe=()=>{const e=f.useContext(eq);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e};var b6t={};/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */let w6t,S6t;function C6t(){return{geminiUrl:w6t,vertexUrl:S6t}}function N6t(e,t,n,r){var o,i;if(!(e!=null&&e.baseUrl)){const s=C6t();return t?(o=s.vertexUrl)!==null&&o!==void 0?o:n:(i=s.geminiUrl)!==null&&i!==void 0?i:r}return e.baseUrl}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class zw{}function Lr(e,t){const n=/\{([^}]+)\}/g;return e.replace(n,(r,o)=>{if(Object.prototype.hasOwnProperty.call(t,o)){const i=t[o];return i!=null?String(i):""}else throw new Error(`Key '${o}' not found in valueMap.`)})}function ee(e,t,n){for(let i=0;i({}));else throw new Error(`Value must be a list given an array path ${s}`);if(Array.isArray(e[l])){const c=e[l];if(Array.isArray(n))for(let u=0;uQ(l,t.slice(r+1),n)):n}else return n}else e=e[o]}return e}catch(r){if(r instanceof TypeError)return n;throw r}}function j6t(e,t){for(const[n,r]of Object.entries(t)){const o=n.split("."),i=r.split("."),s=new Set;let l=-1;for(let c=0;cl)for(let c=l;c=t.length||typeof e!="object"||e===null)return;const i=t[r];if(i.endsWith("[]")){const s=i.slice(0,-2),l=e;if(s in l&&Array.isArray(l[s]))for(const c of l[s])kie(c,t,n,r+1,o)}else if(i==="*"){if(typeof e=="object"&&e!==null&&!Array.isArray(e)){const s=e,l=Object.keys(s).filter(u=>!u.startsWith("_")&&!o.has(u)),c={};for(const u of l)c[u]=s[u];for(const[u,d]of Object.entries(c)){const p=[];for(const h of n.slice(r))h==="*"?p.push(u):p.push(h);ee(s,p,d)}for(const u of l)delete s[u]}}else{const s=e;i in s&&kie(s[i],t,n,r+1,o)}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function qme(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 E6t(e){const t={},n=Q(e,["operationName"]);n!=null&&ee(t,["operationName"],n);const r=Q(e,["resourceName"]);return r!=null&&ee(t,["_url","resourceName"],r),t}function I6t(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["name"],n);const r=Q(e,["metadata"]);r!=null&&ee(t,["metadata"],r);const o=Q(e,["done"]);o!=null&&ee(t,["done"],o);const i=Q(e,["error"]);i!=null&&ee(t,["error"],i);const s=Q(e,["response","generateVideoResponse"]);return s!=null&&ee(t,["response"],P6t(s)),t}function _6t(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["name"],n);const r=Q(e,["metadata"]);r!=null&&ee(t,["metadata"],r);const o=Q(e,["done"]);o!=null&&ee(t,["done"],o);const i=Q(e,["error"]);i!=null&&ee(t,["error"],i);const s=Q(e,["response"]);return s!=null&&ee(t,["response"],A6t(s)),t}function P6t(e){const t={},n=Q(e,["generatedSamples"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>T6t(s))),ee(t,["generatedVideos"],i)}const r=Q(e,["raiMediaFilteredCount"]);r!=null&&ee(t,["raiMediaFilteredCount"],r);const o=Q(e,["raiMediaFilteredReasons"]);return o!=null&&ee(t,["raiMediaFilteredReasons"],o),t}function A6t(e){const t={},n=Q(e,["videos"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>k6t(s))),ee(t,["generatedVideos"],i)}const r=Q(e,["raiMediaFilteredCount"]);r!=null&&ee(t,["raiMediaFilteredCount"],r);const o=Q(e,["raiMediaFilteredReasons"]);return o!=null&&ee(t,["raiMediaFilteredReasons"],o),t}function T6t(e){const t={},n=Q(e,["video"]);return n!=null&&ee(t,["video"],L6t(n)),t}function k6t(e){const t={},n=Q(e,["_self"]);return n!=null&&ee(t,["video"],F6t(n)),t}function M6t(e){const t={},n=Q(e,["operationName"]);return n!=null&&ee(t,["_url","operationName"],n),t}function R6t(e){const t={},n=Q(e,["operationName"]);return n!=null&&ee(t,["_url","operationName"],n),t}function O6t(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["name"],n);const r=Q(e,["metadata"]);r!=null&&ee(t,["metadata"],r);const o=Q(e,["done"]);o!=null&&ee(t,["done"],o);const i=Q(e,["error"]);i!=null&&ee(t,["error"],i);const s=Q(e,["response"]);return s!=null&&ee(t,["response"],$6t(s)),t}function $6t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["parent"]);r!=null&&ee(t,["parent"],r);const o=Q(e,["documentName"]);return o!=null&&ee(t,["documentName"],o),t}function kYe(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["name"],n);const r=Q(e,["metadata"]);r!=null&&ee(t,["metadata"],r);const o=Q(e,["done"]);o!=null&&ee(t,["done"],o);const i=Q(e,["error"]);i!=null&&ee(t,["error"],i);const s=Q(e,["response"]);return s!=null&&ee(t,["response"],D6t(s)),t}function D6t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["parent"]);r!=null&&ee(t,["parent"],r);const o=Q(e,["documentName"]);return o!=null&&ee(t,["documentName"],o),t}function L6t(e){const t={},n=Q(e,["uri"]);n!=null&&ee(t,["uri"],n);const r=Q(e,["encodedVideo"]);r!=null&&ee(t,["videoBytes"],qme(r));const o=Q(e,["encoding"]);return o!=null&&ee(t,["mimeType"],o),t}function F6t(e){const t={},n=Q(e,["gcsUri"]);n!=null&&ee(t,["uri"],n);const r=Q(e,["bytesBase64Encoded"]);r!=null&&ee(t,["videoBytes"],qme(r));const o=Q(e,["mimeType"]);return o!=null&&ee(t,["mimeType"],o),t}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */var KNe;(function(e){e.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",e.OUTCOME_OK="OUTCOME_OK",e.OUTCOME_FAILED="OUTCOME_FAILED",e.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(KNe||(KNe={}));var YNe;(function(e){e.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",e.PYTHON="PYTHON"})(YNe||(YNe={}));var XNe;(function(e){e.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",e.SILENT="SILENT",e.WHEN_IDLE="WHEN_IDLE",e.INTERRUPT="INTERRUPT"})(XNe||(XNe={}));var M2;(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"})(M2||(M2={}));var QNe;(function(e){e.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",e.SIMPLE_SEARCH="SIMPLE_SEARCH",e.ELASTIC_SEARCH="ELASTIC_SEARCH"})(QNe||(QNe={}));var JNe;(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"})(JNe||(JNe={}));var ZNe;(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"})(ZNe||(ZNe={}));var eje;(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"})(eje||(eje={}));var tje;(function(e){e.UNSPECIFIED="UNSPECIFIED",e.BLOCKING="BLOCKING",e.NON_BLOCKING="NON_BLOCKING"})(tje||(tje={}));var nje;(function(e){e.MODE_UNSPECIFIED="MODE_UNSPECIFIED",e.MODE_DYNAMIC="MODE_DYNAMIC"})(nje||(nje={}));var rje;(function(e){e.MODE_UNSPECIFIED="MODE_UNSPECIFIED",e.AUTO="AUTO",e.ANY="ANY",e.NONE="NONE",e.VALIDATED="VALIDATED"})(rje||(rje={}));var oje;(function(e){e.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH",e.MINIMAL="MINIMAL"})(oje||(oje={}));var ije;(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"})(ije||(ije={}));var aje;(function(e){e.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",e.SEVERITY="SEVERITY",e.PROBABILITY="PROBABILITY"})(aje||(aje={}));var sje;(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"})(sje||(sje={}));var lje;(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"})(lje||(lje={}));var cje;(function(e){e.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",e.NEGLIGIBLE="NEGLIGIBLE",e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH"})(cje||(cje={}));var uje;(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"})(uje||(uje={}));var dje;(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"})(dje||(dje={}));var fje;(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"})(fje||(fje={}));var pje;(function(e){e.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",e.ON_DEMAND="ON_DEMAND",e.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(pje||(pje={}));var LH;(function(e){e.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",e.TEXT="TEXT",e.IMAGE="IMAGE",e.AUDIO="AUDIO"})(LH||(LH={}));var hje;(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"})(hje||(hje={}));var mje;(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"})(mje||(mje={}));var gje;(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"})(gje||(gje={}));var Mie;(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"})(Mie||(Mie={}));var xje;(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"})(xje||(xje={}));var yje;(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"})(yje||(yje={}));var Rie;(function(e){e.COLLECTION="COLLECTION"})(Rie||(Rie={}));var vje;(function(e){e.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",e.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",e.BALANCED="BALANCED",e.PRIORITIZE_COST="PRIORITIZE_COST"})(vje||(vje={}));var bje;(function(e){e.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",e.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER"})(bje||(bje={}));var wje;(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"})(wje||(wje={}));var Sje;(function(e){e.DONT_ALLOW="DONT_ALLOW",e.ALLOW_ADULT="ALLOW_ADULT",e.ALLOW_ALL="ALLOW_ALL"})(Sje||(Sje={}));var Cje;(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"})(Cje||(Cje={}));var Nje;(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"})(Nje||(Nje={}));var jje;(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"})(jje||(jje={}));var Eje;(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"})(Eje||(Eje={}));var Ije;(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"})(Ije||(Ije={}));var _je;(function(e){e.FOREGROUND="FOREGROUND",e.BACKGROUND="BACKGROUND",e.PROMPT="PROMPT",e.SEMANTIC="SEMANTIC",e.INTERACTIVE="INTERACTIVE"})(_je||(_je={}));var Pje;(function(e){e.ASSET="ASSET",e.STYLE="STYLE"})(Pje||(Pje={}));var Aje;(function(e){e.INSERT="INSERT",e.REMOVE="REMOVE",e.REMOVE_STATIC="REMOVE_STATIC",e.OUTPAINT="OUTPAINT"})(Aje||(Aje={}));var Tje;(function(e){e.OPTIMIZED="OPTIMIZED",e.LOSSLESS="LOSSLESS"})(Tje||(Tje={}));var kje;(function(e){e.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",e.PREFERENCE_TUNING="PREFERENCE_TUNING"})(kje||(kje={}));var Mje;(function(e){e.STATE_UNSPECIFIED="STATE_UNSPECIFIED",e.STATE_PENDING="STATE_PENDING",e.STATE_ACTIVE="STATE_ACTIVE",e.STATE_FAILED="STATE_FAILED"})(Mje||(Mje={}));var Rje;(function(e){e.STATE_UNSPECIFIED="STATE_UNSPECIFIED",e.PROCESSING="PROCESSING",e.ACTIVE="ACTIVE",e.FAILED="FAILED"})(Rje||(Rje={}));var Oje;(function(e){e.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",e.UPLOADED="UPLOADED",e.GENERATED="GENERATED",e.REGISTERED="REGISTERED"})(Oje||(Oje={}));var $je;(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"})($je||($je={}));var Dje;(function(e){e.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",e.TEXT="TEXT",e.IMAGE="IMAGE",e.VIDEO="VIDEO",e.AUDIO="AUDIO",e.DOCUMENT="DOCUMENT"})(Dje||(Dje={}));var Lje;(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"})(Lje||(Lje={}));var Fje;(function(e){e.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",e.ACTIVITY_START="ACTIVITY_START",e.ACTIVITY_END="ACTIVITY_END"})(Fje||(Fje={}));var zje;(function(e){e.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",e.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",e.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(zje||(zje={}));var Bje;(function(e){e.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",e.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",e.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(Bje||(Bje={}));var Hje;(function(e){e.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",e.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",e.NO_INTERRUPTION="NO_INTERRUPTION"})(Hje||(Hje={}));var Vje;(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"})(Vje||(Vje={}));var Uje;(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"})(Uje||(Uje={}));var Wje;(function(e){e.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",e.QUALITY="QUALITY",e.DIVERSITY="DIVERSITY",e.VOCALIZATION="VOCALIZATION"})(Wje||(Wje={}));var yP;(function(e){e.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",e.PLAY="PLAY",e.PAUSE="PAUSE",e.STOP="STOP",e.RESET_CONTEXT="RESET_CONTEXT"})(yP||(yP={}));class Oie{constructor(t){const n={};for(const r of t.headers.entries())n[r[0]]=r[1];this.headers=n,this.responseInternal=t}json(){return this.responseInternal.json()}}class K4{get text(){var t,n,r,o,i,s,l,c;if(((o=(r=(n=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||o===void 0?void 0:o.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="",d=!1;const p=[];for(const h of(c=(l=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||l===void 0?void 0:l.parts)!==null&&c!==void 0?c:[]){for(const[m,g]of Object.entries(h))m!=="text"&&m!=="thought"&&m!=="thoughtSignature"&&(g!==null||g!==void 0)&&p.push(m);if(typeof h.text=="string"){if(typeof h.thought=="boolean"&&h.thought)continue;d=!0,u+=h.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.`),d?u:void 0}get data(){var t,n,r,o,i,s,l,c;if(((o=(r=(n=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||o===void 0?void 0:o.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 d=[];for(const p of(c=(l=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||l===void 0?void 0:l.parts)!==null&&c!==void 0?c:[]){for(const[h,m]of Object.entries(p))h!=="inlineData"&&(m!==null||m!==void 0)&&d.push(h);p.inlineData&&typeof p.inlineData.data=="string"&&(u+=atob(p.inlineData.data))}return d.length>0&&console.warn(`there are non-data parts ${d} 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,n,r,o,i,s,l,c;if(((o=(r=(n=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||o===void 0?void 0:o.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=(c=(l=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||l===void 0?void 0:l.parts)===null||c===void 0?void 0:c.filter(d=>d.functionCall).map(d=>d.functionCall).filter(d=>d!==void 0);if((u==null?void 0:u.length)!==0)return u}get executableCode(){var t,n,r,o,i,s,l,c,u;if(((o=(r=(n=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||o===void 0?void 0:o.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 d=(c=(l=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||l===void 0?void 0:l.parts)===null||c===void 0?void 0:c.filter(p=>p.executableCode).map(p=>p.executableCode).filter(p=>p!==void 0);if((d==null?void 0:d.length)!==0)return(u=d==null?void 0:d[0])===null||u===void 0?void 0:u.code}get codeExecutionResult(){var t,n,r,o,i,s,l,c,u;if(((o=(r=(n=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.content)===null||r===void 0?void 0:r.parts)===null||o===void 0?void 0:o.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 d=(c=(l=(s=(i=this.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content)===null||l===void 0?void 0:l.parts)===null||c===void 0?void 0:c.filter(p=>p.codeExecutionResult).map(p=>p.codeExecutionResult).filter(p=>p!==void 0);if((d==null?void 0:d.length)!==0)return(u=d==null?void 0:d[0])===null||u===void 0?void 0:u.output}}class Gje{}class qje{}class z6t{}class B6t{}class H6t{}class V6t{}class Kje{}class Yje{}class Xje{}class U6t{}class FH{_fromAPIResponse({apiResponse:t,_isVertexAI:n}){const r=new FH;let o;const i=t;return n?o=_6t(i):o=I6t(i),Object.assign(r,o),r}}class Qje{}class Jje{}class Zje{}class eEe{}class W6t{}class G6t{}class q6t{}class Kme{_fromAPIResponse({apiResponse:t,_isVertexAI:n}){const r=new Kme,i=O6t(t);return Object.assign(r,i),r}}class K6t{}class Y6t{}class X6t{}class tEe{}class Q6t{get text(){var t,n,r;let o="",i=!1;const s=[];for(const l of(r=(n=(t=this.serverContent)===null||t===void 0?void 0:t.modelTurn)===null||n===void 0?void 0:n.parts)!==null&&r!==void 0?r:[]){for(const[c,u]of Object.entries(l))c!=="text"&&c!=="thought"&&u!==null&&s.push(c);if(typeof l.text=="string"){if(typeof l.thought=="boolean"&&l.thought)continue;i=!0,o+=l.text}}return s.length>0&&console.warn(`there are non-text parts ${s} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),i?o:void 0}get data(){var t,n,r;let o="";const i=[];for(const s of(r=(n=(t=this.serverContent)===null||t===void 0?void 0:t.modelTurn)===null||n===void 0?void 0:n.parts)!==null&&r!==void 0?r:[]){for(const[l,c]of Object.entries(s))l!=="inlineData"&&c!==null&&i.push(l);s.inlineData&&typeof s.inlineData.data=="string"&&(o+=atob(s.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.`),o.length>0?btoa(o):void 0}}class J6t{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}class Yme{_fromAPIResponse({apiResponse:t,_isVertexAI:n}){const r=new Yme,i=kYe(t);return Object.assign(r,i),r}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function Xa(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 n=t.split("/",2);return`publishers/${n[0]}/models/${n[1]}`}else return`publishers/google/models/${t}`}else return t.startsWith("models/")||t.startsWith("tunedModels/")?t:`models/${t}`}function MYe(e,t){const n=Xa(e,t);return n?n.startsWith("publishers/")&&e.isVertexAI()?`projects/${e.getProject()}/locations/${e.getLocation()}/${n}`:n.startsWith("models/")&&e.isVertexAI()?`projects/${e.getProject()}/locations/${e.getLocation()}/publishers/google/${n}`:n:""}function RYe(e){return Array.isArray(e)?e.map(t=>zH(t)):[zH(e)]}function zH(e){if(typeof e=="object"&&e!==null)return e;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof e}`)}function OYe(e){const t=zH(e);if(t.mimeType&&t.mimeType.startsWith("image/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function $Ye(e){const t=zH(e);if(t.mimeType&&t.mimeType.startsWith("audio/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function nEe(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 DYe(e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("PartListUnion is required");return Array.isArray(e)?e.map(t=>nEe(t)):[nEe(e)]}function $ie(e){return e!=null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)}function rEe(e){return e!=null&&typeof e=="object"&&"functionCall"in e}function oEe(e){return e!=null&&typeof e=="object"&&"functionResponse"in e}function Np(e){if(e==null)throw new Error("ContentUnion is required");return $ie(e)?e:{role:"user",parts:DYe(e)}}function Xme(e,t){if(!t)return[];if(e.isVertexAI()&&Array.isArray(t))return t.flatMap(n=>{const r=Np(n);return r.parts&&r.parts.length>0&&r.parts[0].text!==void 0?[r.parts[0].text]:[]});if(e.isVertexAI()){const n=Np(t);return n.parts&&n.parts.length>0&&n.parts[0].text!==void 0?[n.parts[0].text]:[]}return Array.isArray(t)?t.map(n=>Np(n)):[Np(t)]}function b0(e){if(e==null||Array.isArray(e)&&e.length===0)throw new Error("contents are required");if(!Array.isArray(e)){if(rEe(e)||oEe(e))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[Np(e)]}const t=[],n=[],r=$ie(e[0]);for(const o of e){const i=$ie(o);if(i!=r)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(o);else{if(rEe(o)||oEe(o))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");n.push(o)}}return r||t.push({role:"user",parts:DYe(n)}),t}function Z6t(e,t){e.includes("null")&&(t.nullable=!0);const n=e.filter(r=>r!=="null");if(n.length===1)t.type=Object.values(M2).includes(n[0].toUpperCase())?n[0].toUpperCase():M2.TYPE_UNSPECIFIED;else{t.anyOf=[];for(const r of n)t.anyOf.push({type:Object.values(M2).includes(r.toUpperCase())?r.toUpperCase():M2.TYPE_UNSPECIFIED})}}function iA(e){const t={},n=["items"],r=["anyOf"],o=["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&&Z6t(e.type,t);for(const[s,l]of Object.entries(e))if(l!=null)if(s=="type"){if(l==="null")throw new Error("type: null can not be the only possible type for the field.");if(l instanceof Array)continue;t.type=Object.values(M2).includes(l.toUpperCase())?l.toUpperCase():M2.TYPE_UNSPECIFIED}else if(n.includes(s))t[s]=iA(l);else if(r.includes(s)){const c=[];for(const u of l){if(u.type=="null"){t.nullable=!0;continue}c.push(iA(u))}t[s]=c}else if(o.includes(s)){const c={};for(const[u,d]of Object.entries(l))c[u]=iA(d);t[s]=c}else{if(s==="additionalProperties")continue;t[s]=l}return t}function Qme(e){return iA(e)}function Jme(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 Zme(e){if("multiSpeakerVoiceConfig"in e)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return e}function pk(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=iA(t.parameters)),t.response&&(Object.keys(t.response).includes("$schema")?t.responseJsonSchema||(t.responseJsonSchema=t.response,delete t.response):t.response=iA(t.response));return e}function hk(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 n of e)t.push(n);return t}function e8t(e,t,n,r=1){const o=!t.startsWith(`${n}/`)&&t.split("/").length===r;return e.isVertexAI()?t.startsWith("projects/")?t:t.startsWith("locations/")?`projects/${e.getProject()}/${t}`:t.startsWith(`${n}/`)?`projects/${e.getProject()}/locations/${e.getLocation()}/${t}`:o?`projects/${e.getProject()}/locations/${e.getLocation()}/${n}/${t}`:t:o?`${n}/${t}`:t}function Bw(e,t){if(typeof t!="string")throw new Error("name must be a string");return e8t(e,t,"cachedContents")}function LYe(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 QC(e){return qme(e)}function t8t(e){return e!=null&&typeof e=="object"&&"name"in e}function n8t(e){return e!=null&&typeof e=="object"&&"video"in e}function r8t(e){return e!=null&&typeof e=="object"&&"uri"in e}function FYe(e){var t;let n;if(t8t(e)&&(n=e.name),!(r8t(e)&&(n=e.uri,n===void 0))&&!(n8t(e)&&(n=(t=e.video)===null||t===void 0?void 0:t.uri,n===void 0))){if(typeof e=="string"&&(n=e),n===void 0)throw new Error("Could not extract file name from the provided input.");if(n.startsWith("https://")){const o=n.split("files/")[1].match(/[a-z0-9]+/);if(o===null)throw new Error(`Could not extract file name from URI ${n}`);n=o[0]}else n.startsWith("files/")&&(n=n.split("files/")[1]);return n}}function zYe(e,t){let n;return e.isVertexAI()?n=t?"publishers/google/models":"models":n=t?"models":"tunedModels",n}function BYe(e){for(const t of["models","tunedModels","publisherModels"])if(o8t(e,t))return e[t];return[]}function o8t(e,t){return e!==null&&typeof e=="object"&&t in e}function i8t(e,t={}){const n=e,r={name:n.name,description:n.description,parametersJsonSchema:n.inputSchema};return n.outputSchema&&(r.responseJsonSchema=n.outputSchema),t.behavior&&(r.behavior=t.behavior),{functionDeclarations:[r]}}function a8t(e,t={}){const n=[],r=new Set;for(const o of e){const i=o.name;if(r.has(i))throw new Error(`Duplicate function name ${i} found in MCP tools. Please ensure function names are unique.`);r.add(i);const s=i8t(o,t);s.functionDeclarations&&n.push(...s.functionDeclarations)}return{functionDeclarations:n}}function HYe(e,t){let n;if(typeof t=="string")if(e.isVertexAI())if(t.startsWith("gs://"))n={format:"jsonl",gcsUri:[t]};else if(t.startsWith("bq://"))n={format:"bigquery",bigqueryUri:t};else throw new Error(`Unsupported string source for Vertex AI: ${t}`);else if(t.startsWith("files/"))n={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.");n={inlinedRequests:t}}else n=t;const r=[n.gcsUri,n.bigqueryUri].filter(Boolean).length,o=[n.inlinedRequests,n.fileName].filter(Boolean).length;if(e.isVertexAI()){if(o>0||r!==1)throw new Error("Exactly one of `gcsUri` or `bigqueryUri` must be set for Vertex AI.")}else if(r>0||o!==1)throw new Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return n}function s8t(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 VYe(e){if(typeof e!="object"||e===null)return{};const t=e,n=t.inlinedResponses;if(typeof n!="object"||n===null)return e;const o=n.inlinedResponses;if(!Array.isArray(o)||o.length===0)return e;let i=!1;for(const s of o){if(typeof s!="object"||s===null)continue;const c=s.response;if(typeof c!="object"||c===null)continue;if(c.embedding!==void 0){i=!0;break}}return i&&(t.inlinedEmbedContentResponses=t.inlinedResponses,delete t.inlinedResponses),e}function mk(e,t){const n=t;if(!e.isVertexAI()){if(/batches\/[^/]+$/.test(n))return n.split("/").pop();throw new Error(`Invalid batch job name: ${n}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(n))return n.split("/").pop();if(/^\d+$/.test(n))return n;throw new Error(`Invalid batch job name: ${n}.`)}function UYe(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}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function l8t(e){const t={},n=Q(e,["responsesFile"]);n!=null&&ee(t,["fileName"],n);const r=Q(e,["inlinedResponses","inlinedResponses"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>H8t(s))),ee(t,["inlinedResponses"],i)}const o=Q(e,["inlinedEmbedContentResponses","inlinedResponses"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>s)),ee(t,["inlinedEmbedContentResponses"],i)}return t}function c8t(e){const t={},n=Q(e,["predictionsFormat"]);n!=null&&ee(t,["format"],n);const r=Q(e,["gcsDestination","outputUriPrefix"]);r!=null&&ee(t,["gcsUri"],r);const o=Q(e,["bigqueryDestination","outputUri"]);return o!=null&&ee(t,["bigqueryUri"],o),t}function u8t(e){const t={},n=Q(e,["format"]);n!=null&&ee(t,["predictionsFormat"],n);const r=Q(e,["gcsUri"]);r!=null&&ee(t,["gcsDestination","outputUriPrefix"],r);const o=Q(e,["bigqueryUri"]);if(o!=null&&ee(t,["bigqueryDestination","outputUri"],o),Q(e,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(Q(e,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is not supported in Vertex AI.");if(Q(e,["inlinedEmbedContentResponses"])!==void 0)throw new Error("inlinedEmbedContentResponses parameter is not supported in Vertex AI.");return t}function Hz(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["name"],n);const r=Q(e,["metadata","displayName"]);r!=null&&ee(t,["displayName"],r);const o=Q(e,["metadata","state"]);o!=null&&ee(t,["state"],UYe(o));const i=Q(e,["metadata","createTime"]);i!=null&&ee(t,["createTime"],i);const s=Q(e,["metadata","endTime"]);s!=null&&ee(t,["endTime"],s);const l=Q(e,["metadata","updateTime"]);l!=null&&ee(t,["updateTime"],l);const c=Q(e,["metadata","model"]);c!=null&&ee(t,["model"],c);const u=Q(e,["metadata","output"]);return u!=null&&ee(t,["dest"],l8t(VYe(u))),t}function Die(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["name"],n);const r=Q(e,["displayName"]);r!=null&&ee(t,["displayName"],r);const o=Q(e,["state"]);o!=null&&ee(t,["state"],UYe(o));const i=Q(e,["error"]);i!=null&&ee(t,["error"],i);const s=Q(e,["createTime"]);s!=null&&ee(t,["createTime"],s);const l=Q(e,["startTime"]);l!=null&&ee(t,["startTime"],l);const c=Q(e,["endTime"]);c!=null&&ee(t,["endTime"],c);const u=Q(e,["updateTime"]);u!=null&&ee(t,["updateTime"],u);const d=Q(e,["model"]);d!=null&&ee(t,["model"],d);const p=Q(e,["inputConfig"]);p!=null&&ee(t,["src"],d8t(p));const h=Q(e,["outputConfig"]);h!=null&&ee(t,["dest"],c8t(VYe(h)));const m=Q(e,["completionStats"]);return m!=null&&ee(t,["completionStats"],m),t}function d8t(e){const t={},n=Q(e,["instancesFormat"]);n!=null&&ee(t,["format"],n);const r=Q(e,["gcsSource","uris"]);r!=null&&ee(t,["gcsUri"],r);const o=Q(e,["bigquerySource","inputUri"]);return o!=null&&ee(t,["bigqueryUri"],o),t}function f8t(e,t){const n={};if(Q(t,["format"])!==void 0)throw new Error("format parameter is not supported in Gemini API.");if(Q(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(Q(t,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is not supported in Gemini API.");const r=Q(t,["fileName"]);r!=null&&ee(n,["fileName"],r);const o=Q(t,["inlinedRequests"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>B8t(e,s))),ee(n,["requests","requests"],i)}return n}function p8t(e){const t={},n=Q(e,["format"]);n!=null&&ee(t,["instancesFormat"],n);const r=Q(e,["gcsUri"]);r!=null&&ee(t,["gcsSource","uris"],r);const o=Q(e,["bigqueryUri"]);if(o!=null&&ee(t,["bigquerySource","inputUri"],o),Q(e,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(Q(e,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is not supported in Vertex AI.");return t}function h8t(e){const t={},n=Q(e,["data"]);if(n!=null&&ee(t,["data"],n),Q(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=Q(e,["mimeType"]);return r!=null&&ee(t,["mimeType"],r),t}function m8t(e,t){const n={},r=Q(t,["name"]);return r!=null&&ee(n,["_url","name"],mk(e,r)),n}function g8t(e,t){const n={},r=Q(t,["name"]);return r!=null&&ee(n,["_url","name"],mk(e,r)),n}function x8t(e){const t={},n=Q(e,["content"]);n!=null&&ee(t,["content"],n);const r=Q(e,["citationMetadata"]);r!=null&&ee(t,["citationMetadata"],y8t(r));const o=Q(e,["tokenCount"]);o!=null&&ee(t,["tokenCount"],o);const i=Q(e,["finishReason"]);i!=null&&ee(t,["finishReason"],i);const s=Q(e,["avgLogprobs"]);s!=null&&ee(t,["avgLogprobs"],s);const l=Q(e,["groundingMetadata"]);l!=null&&ee(t,["groundingMetadata"],l);const c=Q(e,["index"]);c!=null&&ee(t,["index"],c);const u=Q(e,["logprobsResult"]);u!=null&&ee(t,["logprobsResult"],u);const d=Q(e,["safetyRatings"]);if(d!=null){let h=d;Array.isArray(h)&&(h=h.map(m=>m)),ee(t,["safetyRatings"],h)}const p=Q(e,["urlContextMetadata"]);return p!=null&&ee(t,["urlContextMetadata"],p),t}function y8t(e){const t={},n=Q(e,["citationSources"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(o=>o)),ee(t,["citations"],r)}return t}function WYe(e){const t={},n=Q(e,["parts"]);if(n!=null){let o=n;Array.isArray(o)&&(o=o.map(i=>Y8t(i))),ee(t,["parts"],o)}const r=Q(e,["role"]);return r!=null&&ee(t,["role"],r),t}function v8t(e,t){const n={},r=Q(e,["displayName"]);if(t!==void 0&&r!=null&&ee(t,["batch","displayName"],r),Q(e,["dest"])!==void 0)throw new Error("dest parameter is not supported in Gemini API.");return n}function b8t(e,t){const n={},r=Q(e,["displayName"]);t!==void 0&&r!=null&&ee(t,["displayName"],r);const o=Q(e,["dest"]);return t!==void 0&&o!=null&&ee(t,["outputConfig"],u8t(s8t(o))),n}function iEe(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["src"]);o!=null&&ee(n,["batch","inputConfig"],f8t(e,HYe(e,o)));const i=Q(t,["config"]);return i!=null&&v8t(i,n),n}function w8t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["model"],Xa(e,r));const o=Q(t,["src"]);o!=null&&ee(n,["inputConfig"],p8t(HYe(e,o)));const i=Q(t,["config"]);return i!=null&&b8t(i,n),n}function S8t(e,t){const n={},r=Q(e,["displayName"]);return t!==void 0&&r!=null&&ee(t,["batch","displayName"],r),n}function C8t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["src"]);o!=null&&ee(n,["batch","inputConfig"],A8t(e,o));const i=Q(t,["config"]);return i!=null&&S8t(i,n),n}function N8t(e,t){const n={},r=Q(t,["name"]);return r!=null&&ee(n,["_url","name"],mk(e,r)),n}function j8t(e,t){const n={},r=Q(t,["name"]);return r!=null&&ee(n,["_url","name"],mk(e,r)),n}function E8t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["name"]);r!=null&&ee(t,["name"],r);const o=Q(e,["done"]);o!=null&&ee(t,["done"],o);const i=Q(e,["error"]);return i!=null&&ee(t,["error"],i),t}function I8t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["name"]);r!=null&&ee(t,["name"],r);const o=Q(e,["done"]);o!=null&&ee(t,["done"],o);const i=Q(e,["error"]);return i!=null&&ee(t,["error"],i),t}function _8t(e,t){const n={},r=Q(t,["contents"]);if(r!=null){let i=Xme(e,r);Array.isArray(i)&&(i=i.map(s=>s)),ee(n,["requests[]","request","content"],i)}const o=Q(t,["config"]);return o!=null&&(ee(n,["_self"],P8t(o,n)),j6t(n,{"requests[].*":"requests[].request.*"})),n}function P8t(e,t){const n={},r=Q(e,["taskType"]);t!==void 0&&r!=null&&ee(t,["requests[]","taskType"],r);const o=Q(e,["title"]);t!==void 0&&o!=null&&ee(t,["requests[]","title"],o);const i=Q(e,["outputDimensionality"]);if(t!==void 0&&i!=null&&ee(t,["requests[]","outputDimensionality"],i),Q(e,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(Q(e,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return n}function A8t(e,t){const n={},r=Q(t,["fileName"]);r!=null&&ee(n,["file_name"],r);const o=Q(t,["inlinedRequests"]);return o!=null&&ee(n,["requests"],_8t(e,o)),n}function T8t(e){const t={};if(Q(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=Q(e,["fileUri"]);n!=null&&ee(t,["fileUri"],n);const r=Q(e,["mimeType"]);return r!=null&&ee(t,["mimeType"],r),t}function k8t(e){const t={},n=Q(e,["id"]);n!=null&&ee(t,["id"],n);const r=Q(e,["args"]);r!=null&&ee(t,["args"],r);const o=Q(e,["name"]);if(o!=null&&ee(t,["name"],o),Q(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(Q(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function M8t(e){const t={},n=Q(e,["allowedFunctionNames"]);n!=null&&ee(t,["allowedFunctionNames"],n);const r=Q(e,["mode"]);if(r!=null&&ee(t,["mode"],r),Q(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function R8t(e,t,n){const r={},o=Q(t,["systemInstruction"]);n!==void 0&&o!=null&&ee(n,["systemInstruction"],WYe(Np(o)));const i=Q(t,["temperature"]);i!=null&&ee(r,["temperature"],i);const s=Q(t,["topP"]);s!=null&&ee(r,["topP"],s);const l=Q(t,["topK"]);l!=null&&ee(r,["topK"],l);const c=Q(t,["candidateCount"]);c!=null&&ee(r,["candidateCount"],c);const u=Q(t,["maxOutputTokens"]);u!=null&&ee(r,["maxOutputTokens"],u);const d=Q(t,["stopSequences"]);d!=null&&ee(r,["stopSequences"],d);const p=Q(t,["responseLogprobs"]);p!=null&&ee(r,["responseLogprobs"],p);const h=Q(t,["logprobs"]);h!=null&&ee(r,["logprobs"],h);const m=Q(t,["presencePenalty"]);m!=null&&ee(r,["presencePenalty"],m);const g=Q(t,["frequencyPenalty"]);g!=null&&ee(r,["frequencyPenalty"],g);const y=Q(t,["seed"]);y!=null&&ee(r,["seed"],y);const x=Q(t,["responseMimeType"]);x!=null&&ee(r,["responseMimeType"],x);const v=Q(t,["responseSchema"]);v!=null&&ee(r,["responseSchema"],Qme(v));const b=Q(t,["responseJsonSchema"]);if(b!=null&&ee(r,["responseJsonSchema"],b),Q(t,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(Q(t,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const w=Q(t,["safetySettings"]);if(n!==void 0&&w!=null){let M=w;Array.isArray(M)&&(M=M.map(R=>X8t(R))),ee(n,["safetySettings"],M)}const S=Q(t,["tools"]);if(n!==void 0&&S!=null){let M=hk(S);Array.isArray(M)&&(M=M.map(R=>J8t(pk(R)))),ee(n,["tools"],M)}const C=Q(t,["toolConfig"]);if(n!==void 0&&C!=null&&ee(n,["toolConfig"],Q8t(C)),Q(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const N=Q(t,["cachedContent"]);n!==void 0&&N!=null&&ee(n,["cachedContent"],Bw(e,N));const j=Q(t,["responseModalities"]);j!=null&&ee(r,["responseModalities"],j);const I=Q(t,["mediaResolution"]);I!=null&&ee(r,["mediaResolution"],I);const _=Q(t,["speechConfig"]);if(_!=null&&ee(r,["speechConfig"],Jme(_)),Q(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const T=Q(t,["thinkingConfig"]);T!=null&&ee(r,["thinkingConfig"],T);const P=Q(t,["imageConfig"]);P!=null&&ee(r,["imageConfig"],z8t(P));const E=Q(t,["enableEnhancedCivicAnswers"]);if(E!=null&&ee(r,["enableEnhancedCivicAnswers"],E),Q(t,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return r}function O8t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["candidates"]);if(r!=null){let c=r;Array.isArray(c)&&(c=c.map(u=>x8t(u))),ee(t,["candidates"],c)}const o=Q(e,["modelVersion"]);o!=null&&ee(t,["modelVersion"],o);const i=Q(e,["promptFeedback"]);i!=null&&ee(t,["promptFeedback"],i);const s=Q(e,["responseId"]);s!=null&&ee(t,["responseId"],s);const l=Q(e,["usageMetadata"]);return l!=null&&ee(t,["usageMetadata"],l),t}function $8t(e,t){const n={},r=Q(t,["name"]);return r!=null&&ee(n,["_url","name"],mk(e,r)),n}function D8t(e,t){const n={},r=Q(t,["name"]);return r!=null&&ee(n,["_url","name"],mk(e,r)),n}function L8t(e){const t={};if(Q(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=Q(e,["enableWidget"]);return n!=null&&ee(t,["enableWidget"],n),t}function F8t(e){const t={};if(Q(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(Q(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=Q(e,["timeRangeFilter"]);return n!=null&&ee(t,["timeRangeFilter"],n),t}function z8t(e){const t={},n=Q(e,["aspectRatio"]);n!=null&&ee(t,["aspectRatio"],n);const r=Q(e,["imageSize"]);if(r!=null&&ee(t,["imageSize"],r),Q(e,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(Q(e,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(Q(e,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return t}function B8t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["request","model"],Xa(e,r));const o=Q(t,["contents"]);if(o!=null){let l=b0(o);Array.isArray(l)&&(l=l.map(c=>WYe(c))),ee(n,["request","contents"],l)}const i=Q(t,["metadata"]);i!=null&&ee(n,["metadata"],i);const s=Q(t,["config"]);return s!=null&&ee(n,["request","generationConfig"],R8t(e,s,Q(n,["request"],{}))),n}function H8t(e){const t={},n=Q(e,["response"]);n!=null&&ee(t,["response"],O8t(n));const r=Q(e,["error"]);return r!=null&&ee(t,["error"],r),t}function V8t(e,t){const n={},r=Q(e,["pageSize"]);t!==void 0&&r!=null&&ee(t,["_query","pageSize"],r);const o=Q(e,["pageToken"]);if(t!==void 0&&o!=null&&ee(t,["_query","pageToken"],o),Q(e,["filter"])!==void 0)throw new Error("filter parameter is not supported in Gemini API.");return n}function U8t(e,t){const n={},r=Q(e,["pageSize"]);t!==void 0&&r!=null&&ee(t,["_query","pageSize"],r);const o=Q(e,["pageToken"]);t!==void 0&&o!=null&&ee(t,["_query","pageToken"],o);const i=Q(e,["filter"]);return t!==void 0&&i!=null&&ee(t,["_query","filter"],i),n}function W8t(e){const t={},n=Q(e,["config"]);return n!=null&&V8t(n,t),t}function G8t(e){const t={},n=Q(e,["config"]);return n!=null&&U8t(n,t),t}function q8t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["nextPageToken"]);r!=null&&ee(t,["nextPageToken"],r);const o=Q(e,["operations"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>Hz(s))),ee(t,["batchJobs"],i)}return t}function K8t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["nextPageToken"]);r!=null&&ee(t,["nextPageToken"],r);const o=Q(e,["batchPredictionJobs"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>Die(s))),ee(t,["batchJobs"],i)}return t}function Y8t(e){const t={},n=Q(e,["mediaResolution"]);n!=null&&ee(t,["mediaResolution"],n);const r=Q(e,["codeExecutionResult"]);r!=null&&ee(t,["codeExecutionResult"],r);const o=Q(e,["executableCode"]);o!=null&&ee(t,["executableCode"],o);const i=Q(e,["fileData"]);i!=null&&ee(t,["fileData"],T8t(i));const s=Q(e,["functionCall"]);s!=null&&ee(t,["functionCall"],k8t(s));const l=Q(e,["functionResponse"]);l!=null&&ee(t,["functionResponse"],l);const c=Q(e,["inlineData"]);c!=null&&ee(t,["inlineData"],h8t(c));const u=Q(e,["text"]);u!=null&&ee(t,["text"],u);const d=Q(e,["thought"]);d!=null&&ee(t,["thought"],d);const p=Q(e,["thoughtSignature"]);p!=null&&ee(t,["thoughtSignature"],p);const h=Q(e,["videoMetadata"]);return h!=null&&ee(t,["videoMetadata"],h),t}function X8t(e){const t={},n=Q(e,["category"]);if(n!=null&&ee(t,["category"],n),Q(e,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const r=Q(e,["threshold"]);return r!=null&&ee(t,["threshold"],r),t}function Q8t(e){const t={},n=Q(e,["retrievalConfig"]);n!=null&&ee(t,["retrievalConfig"],n);const r=Q(e,["functionCallingConfig"]);return r!=null&&ee(t,["functionCallingConfig"],M8t(r)),t}function J8t(e){const t={};if(Q(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=Q(e,["computerUse"]);n!=null&&ee(t,["computerUse"],n);const r=Q(e,["fileSearch"]);r!=null&&ee(t,["fileSearch"],r);const o=Q(e,["codeExecution"]);if(o!=null&&ee(t,["codeExecution"],o),Q(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=Q(e,["functionDeclarations"]);if(i!=null){let d=i;Array.isArray(d)&&(d=d.map(p=>p)),ee(t,["functionDeclarations"],d)}const s=Q(e,["googleMaps"]);s!=null&&ee(t,["googleMaps"],L8t(s));const l=Q(e,["googleSearch"]);l!=null&&ee(t,["googleSearch"],F8t(l));const c=Q(e,["googleSearchRetrieval"]);c!=null&&ee(t,["googleSearchRetrieval"],c);const u=Q(e,["urlContext"]);return u!=null&&ee(t,["urlContext"],u),t}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */var uw;(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"})(uw||(uw={}));let JI=class{constructor(t,n,r,o){this.pageInternal=[],this.paramsInternal={},this.requestInternal=n,this.init(t,r,o)}init(t,n,r){var o,i;this.nameInternal=t,this.pageInternal=n[this.nameInternal]||[],this.sdkHttpResponseInternal=n==null?void 0:n.sdkHttpResponse,this.idxInternal=0;let s={config:{}};!r||Object.keys(r).length===0?s={config:{}}:typeof r=="object"?s=Object.assign({},r):s=r,s.config&&(s.config.pageToken=n.nextPageToken),this.paramsInternal=s,this.pageInternalSize=(i=(o=s.config)===null||o===void 0?void 0:o.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 Z8t extends zw{constructor(t){super(),this.apiClient=t,this.list=async(n={})=>new JI(uw.PAGED_ITEM_BATCH_JOBS,r=>this.listInternal(r),await this.listInternal(n),n),this.create=async n=>(this.apiClient.isVertexAI()&&(n.config=this.formatDestination(n.src,n.config)),this.createInternal(n)),this.createEmbeddings=async n=>{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(n)}}createInlinedGenerateContentRequest(t){const n=iEe(this.apiClient,t),r=n._url,o=Lr("{model}:batchGenerateContent",r),l=n.batch.inputConfig.requests,c=l.requests,u=[];for(const d of c){const p=Object.assign({},d);if(p.systemInstruction){const h=p.systemInstruction;delete p.systemInstruction;const m=p.request;m.systemInstruction=h,p.request=m}u.push(p)}return l.requests=u,delete n.config,delete n._url,delete n._query,{path:o,body:n}}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,n){const r=n?Object.assign({},n):{},o=Date.now().toString();if(r.displayName||(r.displayName=`genaiBatchJob_${o}`),r.dest===void 0){const i=this.getGcsUri(t),s=this.getBigqueryUri(t);if(i)i.endsWith(".jsonl")?r.dest=`${i.slice(0,-6)}/dest`:r.dest=`${i}_dest_${o}`;else if(s)r.dest=`${s}_dest_${o}`;else throw new Error("Unsupported source for Vertex AI: No GCS or BigQuery URI found.")}return r}async createInternal(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=w8t(this.apiClient,t);return l=Lr("batchPredictionJobs",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json()),s.then(d=>Die(d))}else{const u=iEe(this.apiClient,t);return l=Lr("{model}:batchGenerateContent",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),s.then(d=>Hz(d))}}async createEmbeddingsInternal(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=C8t(this.apiClient,t);return i=Lr("{model}:asyncBatchEmbedContent",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o.then(c=>Hz(c))}}async get(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=D8t(this.apiClient,t);return l=Lr("batchPredictionJobs/{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json()),s.then(d=>Die(d))}else{const u=$8t(this.apiClient,t);return l=Lr("batches/{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),s.then(d=>Hz(d))}}async cancel(t){var n,r,o,i;let s="",l={};if(this.apiClient.isVertexAI()){const c=g8t(this.apiClient,t);s=Lr("batchPredictionJobs/{name}:cancel",c._url),l=c._query,delete c._url,delete c._query,await this.apiClient.request({path:s,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal})}else{const c=m8t(this.apiClient,t);s=Lr("batches/{name}:cancel",c._url),l=c._query,delete c._url,delete c._query,await this.apiClient.request({path:s,queryParams:l,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal})}}async listInternal(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=G8t(t);return l=Lr("batchPredictionJobs",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=K8t(d),h=new tEe;return Object.assign(h,p),h})}else{const u=W8t(t);return l=Lr("batches",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=q8t(d),h=new tEe;return Object.assign(h,p),h})}}async delete(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=j8t(this.apiClient,t);return l=Lr("batchPredictionJobs/{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>I8t(d))}else{const u=N8t(this.apiClient,t);return l=Lr("batches/{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>E8t(d))}}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function eFt(e){const t={},n=Q(e,["data"]);if(n!=null&&ee(t,["data"],n),Q(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=Q(e,["mimeType"]);return r!=null&&ee(t,["mimeType"],r),t}function aEe(e){const t={},n=Q(e,["parts"]);if(n!=null){let o=n;Array.isArray(o)&&(o=o.map(i=>CFt(i))),ee(t,["parts"],o)}const r=Q(e,["role"]);return r!=null&&ee(t,["role"],r),t}function tFt(e,t){const n={},r=Q(e,["ttl"]);t!==void 0&&r!=null&&ee(t,["ttl"],r);const o=Q(e,["expireTime"]);t!==void 0&&o!=null&&ee(t,["expireTime"],o);const i=Q(e,["displayName"]);t!==void 0&&i!=null&&ee(t,["displayName"],i);const s=Q(e,["contents"]);if(t!==void 0&&s!=null){let d=b0(s);Array.isArray(d)&&(d=d.map(p=>aEe(p))),ee(t,["contents"],d)}const l=Q(e,["systemInstruction"]);t!==void 0&&l!=null&&ee(t,["systemInstruction"],aEe(Np(l)));const c=Q(e,["tools"]);if(t!==void 0&&c!=null){let d=c;Array.isArray(d)&&(d=d.map(p=>jFt(p))),ee(t,["tools"],d)}const u=Q(e,["toolConfig"]);if(t!==void 0&&u!=null&&ee(t,["toolConfig"],NFt(u)),Q(e,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return n}function nFt(e,t){const n={},r=Q(e,["ttl"]);t!==void 0&&r!=null&&ee(t,["ttl"],r);const o=Q(e,["expireTime"]);t!==void 0&&o!=null&&ee(t,["expireTime"],o);const i=Q(e,["displayName"]);t!==void 0&&i!=null&&ee(t,["displayName"],i);const s=Q(e,["contents"]);if(t!==void 0&&s!=null){let p=b0(s);Array.isArray(p)&&(p=p.map(h=>h)),ee(t,["contents"],p)}const l=Q(e,["systemInstruction"]);t!==void 0&&l!=null&&ee(t,["systemInstruction"],Np(l));const c=Q(e,["tools"]);if(t!==void 0&&c!=null){let p=c;Array.isArray(p)&&(p=p.map(h=>EFt(h))),ee(t,["tools"],p)}const u=Q(e,["toolConfig"]);t!==void 0&&u!=null&&ee(t,["toolConfig"],u);const d=Q(e,["kmsKeyName"]);return t!==void 0&&d!=null&&ee(t,["encryption_spec","kmsKeyName"],d),n}function rFt(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["model"],MYe(e,r));const o=Q(t,["config"]);return o!=null&&tFt(o,n),n}function oFt(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["model"],MYe(e,r));const o=Q(t,["config"]);return o!=null&&nFt(o,n),n}function iFt(e,t){const n={},r=Q(t,["name"]);return r!=null&&ee(n,["_url","name"],Bw(e,r)),n}function aFt(e,t){const n={},r=Q(t,["name"]);return r!=null&&ee(n,["_url","name"],Bw(e,r)),n}function sFt(e){const t={},n=Q(e,["sdkHttpResponse"]);return n!=null&&ee(t,["sdkHttpResponse"],n),t}function lFt(e){const t={},n=Q(e,["sdkHttpResponse"]);return n!=null&&ee(t,["sdkHttpResponse"],n),t}function cFt(e){const t={};if(Q(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=Q(e,["fileUri"]);n!=null&&ee(t,["fileUri"],n);const r=Q(e,["mimeType"]);return r!=null&&ee(t,["mimeType"],r),t}function uFt(e){const t={},n=Q(e,["id"]);n!=null&&ee(t,["id"],n);const r=Q(e,["args"]);r!=null&&ee(t,["args"],r);const o=Q(e,["name"]);if(o!=null&&ee(t,["name"],o),Q(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(Q(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function dFt(e){const t={},n=Q(e,["allowedFunctionNames"]);n!=null&&ee(t,["allowedFunctionNames"],n);const r=Q(e,["mode"]);if(r!=null&&ee(t,["mode"],r),Q(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function fFt(e){const t={},n=Q(e,["description"]);n!=null&&ee(t,["description"],n);const r=Q(e,["name"]);r!=null&&ee(t,["name"],r);const o=Q(e,["parameters"]);o!=null&&ee(t,["parameters"],o);const i=Q(e,["parametersJsonSchema"]);i!=null&&ee(t,["parametersJsonSchema"],i);const s=Q(e,["response"]);s!=null&&ee(t,["response"],s);const l=Q(e,["responseJsonSchema"]);if(l!=null&&ee(t,["responseJsonSchema"],l),Q(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function pFt(e,t){const n={},r=Q(t,["name"]);return r!=null&&ee(n,["_url","name"],Bw(e,r)),n}function hFt(e,t){const n={},r=Q(t,["name"]);return r!=null&&ee(n,["_url","name"],Bw(e,r)),n}function mFt(e){const t={};if(Q(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=Q(e,["enableWidget"]);return n!=null&&ee(t,["enableWidget"],n),t}function gFt(e){const t={};if(Q(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(Q(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=Q(e,["timeRangeFilter"]);return n!=null&&ee(t,["timeRangeFilter"],n),t}function xFt(e,t){const n={},r=Q(e,["pageSize"]);t!==void 0&&r!=null&&ee(t,["_query","pageSize"],r);const o=Q(e,["pageToken"]);return t!==void 0&&o!=null&&ee(t,["_query","pageToken"],o),n}function yFt(e,t){const n={},r=Q(e,["pageSize"]);t!==void 0&&r!=null&&ee(t,["_query","pageSize"],r);const o=Q(e,["pageToken"]);return t!==void 0&&o!=null&&ee(t,["_query","pageToken"],o),n}function vFt(e){const t={},n=Q(e,["config"]);return n!=null&&xFt(n,t),t}function bFt(e){const t={},n=Q(e,["config"]);return n!=null&&yFt(n,t),t}function wFt(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["nextPageToken"]);r!=null&&ee(t,["nextPageToken"],r);const o=Q(e,["cachedContents"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>s)),ee(t,["cachedContents"],i)}return t}function SFt(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["nextPageToken"]);r!=null&&ee(t,["nextPageToken"],r);const o=Q(e,["cachedContents"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>s)),ee(t,["cachedContents"],i)}return t}function CFt(e){const t={},n=Q(e,["mediaResolution"]);n!=null&&ee(t,["mediaResolution"],n);const r=Q(e,["codeExecutionResult"]);r!=null&&ee(t,["codeExecutionResult"],r);const o=Q(e,["executableCode"]);o!=null&&ee(t,["executableCode"],o);const i=Q(e,["fileData"]);i!=null&&ee(t,["fileData"],cFt(i));const s=Q(e,["functionCall"]);s!=null&&ee(t,["functionCall"],uFt(s));const l=Q(e,["functionResponse"]);l!=null&&ee(t,["functionResponse"],l);const c=Q(e,["inlineData"]);c!=null&&ee(t,["inlineData"],eFt(c));const u=Q(e,["text"]);u!=null&&ee(t,["text"],u);const d=Q(e,["thought"]);d!=null&&ee(t,["thought"],d);const p=Q(e,["thoughtSignature"]);p!=null&&ee(t,["thoughtSignature"],p);const h=Q(e,["videoMetadata"]);return h!=null&&ee(t,["videoMetadata"],h),t}function NFt(e){const t={},n=Q(e,["retrievalConfig"]);n!=null&&ee(t,["retrievalConfig"],n);const r=Q(e,["functionCallingConfig"]);return r!=null&&ee(t,["functionCallingConfig"],dFt(r)),t}function jFt(e){const t={};if(Q(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=Q(e,["computerUse"]);n!=null&&ee(t,["computerUse"],n);const r=Q(e,["fileSearch"]);r!=null&&ee(t,["fileSearch"],r);const o=Q(e,["codeExecution"]);if(o!=null&&ee(t,["codeExecution"],o),Q(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=Q(e,["functionDeclarations"]);if(i!=null){let d=i;Array.isArray(d)&&(d=d.map(p=>p)),ee(t,["functionDeclarations"],d)}const s=Q(e,["googleMaps"]);s!=null&&ee(t,["googleMaps"],mFt(s));const l=Q(e,["googleSearch"]);l!=null&&ee(t,["googleSearch"],gFt(l));const c=Q(e,["googleSearchRetrieval"]);c!=null&&ee(t,["googleSearchRetrieval"],c);const u=Q(e,["urlContext"]);return u!=null&&ee(t,["urlContext"],u),t}function EFt(e){const t={},n=Q(e,["retrieval"]);n!=null&&ee(t,["retrieval"],n);const r=Q(e,["computerUse"]);if(r!=null&&ee(t,["computerUse"],r),Q(e,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const o=Q(e,["codeExecution"]);o!=null&&ee(t,["codeExecution"],o);const i=Q(e,["enterpriseWebSearch"]);i!=null&&ee(t,["enterpriseWebSearch"],i);const s=Q(e,["functionDeclarations"]);if(s!=null){let p=s;Array.isArray(p)&&(p=p.map(h=>fFt(h))),ee(t,["functionDeclarations"],p)}const l=Q(e,["googleMaps"]);l!=null&&ee(t,["googleMaps"],l);const c=Q(e,["googleSearch"]);c!=null&&ee(t,["googleSearch"],c);const u=Q(e,["googleSearchRetrieval"]);u!=null&&ee(t,["googleSearchRetrieval"],u);const d=Q(e,["urlContext"]);return d!=null&&ee(t,["urlContext"],d),t}function IFt(e,t){const n={},r=Q(e,["ttl"]);t!==void 0&&r!=null&&ee(t,["ttl"],r);const o=Q(e,["expireTime"]);return t!==void 0&&o!=null&&ee(t,["expireTime"],o),n}function _Ft(e,t){const n={},r=Q(e,["ttl"]);t!==void 0&&r!=null&&ee(t,["ttl"],r);const o=Q(e,["expireTime"]);return t!==void 0&&o!=null&&ee(t,["expireTime"],o),n}function PFt(e,t){const n={},r=Q(t,["name"]);r!=null&&ee(n,["_url","name"],Bw(e,r));const o=Q(t,["config"]);return o!=null&&IFt(o,n),n}function AFt(e,t){const n={},r=Q(t,["name"]);r!=null&&ee(n,["_url","name"],Bw(e,r));const o=Q(t,["config"]);return o!=null&&_Ft(o,n),n}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class TFt extends zw{constructor(t){super(),this.apiClient=t,this.list=async(n={})=>new JI(uw.PAGED_ITEM_CACHED_CONTENTS,r=>this.listInternal(r),await this.listInternal(n),n)}async create(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=oFt(this.apiClient,t);return l=Lr("cachedContents",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json()),s.then(d=>d)}else{const u=rFt(this.apiClient,t);return l=Lr("cachedContents",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),s.then(d=>d)}}async get(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=hFt(this.apiClient,t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json()),s.then(d=>d)}else{const u=pFt(this.apiClient,t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),s.then(d=>d)}}async delete(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=aFt(this.apiClient,t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=lFt(d),h=new Zje;return Object.assign(h,p),h})}else{const u=iFt(this.apiClient,t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=sFt(d),h=new Zje;return Object.assign(h,p),h})}}async update(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=AFt(this.apiClient,t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json()),s.then(d=>d)}else{const u=PFt(this.apiClient,t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),s.then(d=>d)}}async listInternal(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=bFt(t);return l=Lr("cachedContents",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=SFt(d),h=new eEe;return Object.assign(h,p),h})}else{const u=vFt(t);return l=Lr("cachedContents",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=wFt(d),h=new eEe;return Object.assign(h,p),h})}}}function BH(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function si(e){return this instanceof si?(this.v=e,this):new si(e)}function Jx(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(m){return function(g){return Promise.resolve(g).then(m,p)}}function l(m,g){r[m]&&(o[m]=function(y){return new Promise(function(x,v){i.push([m,y,x,v])>1||c(m,y)})},g&&(o[m]=g(o[m])))}function c(m,g){try{u(r[m](g))}catch(y){h(i[0][3],y)}}function u(m){m.value instanceof si?Promise.resolve(m.value.v).then(d,p):h(i[0][2],m)}function d(m){c("next",m)}function p(m){c("throw",m)}function h(m,g){m(g),i.shift(),i.length&&c(i[0][0],i[0][1])}}function Zx(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof sEe=="function"?sEe(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(i){n[i]=e[i]&&function(s){return new Promise(function(l,c){s=e[i](s),o(l,c,s.done,s.value)})}}function o(i,s,l,c){Promise.resolve(c).then(function(u){i({value:u,done:l})},s)}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function kFt(e){var t;if(e.candidates==null||e.candidates.length===0)return!1;const n=(t=e.candidates[0])===null||t===void 0?void 0:t.content;return n===void 0?!1:GYe(n)}function GYe(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 MFt(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 lEe(e){if(e===void 0||e.length===0)return[];const t=[],n=e.length;let r=0;for(;r{var i,s,l;const c=await o,u=(s=(i=c.candidates)===null||i===void 0?void 0:i[0])===null||s===void 0?void 0:s.content,d=c.automaticFunctionCallingHistory,p=this.getHistory(!0).length;let h=[];d!=null&&(h=(l=d.slice(p))!==null&&l!==void 0?l:[]);const m=u?[u]:[];this.recordHistory(r,m,h)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),o}async sendMessageStream(t){var n;await this.sendPromise;const r=Np(t.message),o=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(r),config:(n=t.config)!==null&&n!==void 0?n:this.config});this.sendPromise=o.then(()=>{}).catch(()=>{});const i=await o;return this.processStreamResponse(i,r)}getHistory(t=!1){const n=t?lEe(this.history):this.history;return structuredClone(n)}processStreamResponse(t,n){return Jx(this,arguments,function*(){var o,i,s,l,c,u;const d=[];try{for(var p=!0,h=Zx(t),m;m=yield si(h.next()),o=m.done,!o;p=!0){l=m.value,p=!1;const g=l;if(kFt(g)){const y=(u=(c=g.candidates)===null||c===void 0?void 0:c[0])===null||u===void 0?void 0:u.content;y!==void 0&&d.push(y)}yield yield si(g)}}catch(g){i={error:g}}finally{try{!p&&!o&&(s=h.return)&&(yield si(s.call(h)))}finally{if(i)throw i.error}}this.recordHistory(n,d)})}recordHistory(t,n,r){let o=[];n.length>0&&n.every(i=>i.role!==void 0)?o=n:o.push({role:"model",parts:[]}),r&&r.length>0?this.history.push(...lEe(r)):this.history.push(t),this.history.push(...o)}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class C3 extends Error{constructor(t){super(t.message),this.name="ApiError",this.status=t.status,Object.setPrototypeOf(this,C3.prototype)}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function $Ft(e){const t={},n=Q(e,["file"]);return n!=null&&ee(t,["file"],n),t}function DFt(e){const t={},n=Q(e,["sdkHttpResponse"]);return n!=null&&ee(t,["sdkHttpResponse"],n),t}function LFt(e){const t={},n=Q(e,["name"]);return n!=null&&ee(t,["_url","file"],FYe(n)),t}function FFt(e){const t={},n=Q(e,["sdkHttpResponse"]);return n!=null&&ee(t,["sdkHttpResponse"],n),t}function zFt(e){const t={},n=Q(e,["name"]);return n!=null&&ee(t,["_url","file"],FYe(n)),t}function BFt(e,t){const n={},r=Q(e,["pageSize"]);t!==void 0&&r!=null&&ee(t,["_query","pageSize"],r);const o=Q(e,["pageToken"]);return t!==void 0&&o!=null&&ee(t,["_query","pageToken"],o),n}function HFt(e){const t={},n=Q(e,["config"]);return n!=null&&BFt(n,t),t}function VFt(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["nextPageToken"]);r!=null&&ee(t,["nextPageToken"],r);const o=Q(e,["files"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>s)),ee(t,["files"],i)}return t}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class UFt extends zw{constructor(t){super(),this.apiClient=t,this.list=async(n={})=>new JI(uw.PAGED_ITEM_FILES,r=>this.listInternal(r),await this.listInternal(n),n)}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(n=>n)}async download(t){await this.apiClient.downloadFile(t)}async listInternal(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=HFt(t);return i=Lr("files",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:c.headers},d})),o.then(c=>{const u=VFt(c),d=new K6t;return Object.assign(d,u),d})}}async createInternal(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=$Ft(t);return i=Lr("upload/v1beta/files",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o.then(c=>{const u=DFt(c),d=new Y6t;return Object.assign(d,u),d})}}async get(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=zFt(t);return i=Lr("files/{file}",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o.then(c=>c)}}async delete(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=LFt(t);return i=Lr("files/{file}",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"DELETE",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:c.headers},d})),o.then(c=>{const u=FFt(c),d=new X6t;return Object.assign(d,u),d})}}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function Vz(e){const t={},n=Q(e,["data"]);if(n!=null&&ee(t,["data"],n),Q(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=Q(e,["mimeType"]);return r!=null&&ee(t,["mimeType"],r),t}function WFt(e){const t={},n=Q(e,["parts"]);if(n!=null){let o=n;Array.isArray(o)&&(o=o.map(i=>s7t(i))),ee(t,["parts"],o)}const r=Q(e,["role"]);return r!=null&&ee(t,["role"],r),t}function GFt(e){const t={};if(Q(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=Q(e,["fileUri"]);n!=null&&ee(t,["fileUri"],n);const r=Q(e,["mimeType"]);return r!=null&&ee(t,["mimeType"],r),t}function qFt(e){const t={},n=Q(e,["id"]);n!=null&&ee(t,["id"],n);const r=Q(e,["args"]);r!=null&&ee(t,["args"],r);const o=Q(e,["name"]);if(o!=null&&ee(t,["name"],o),Q(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(Q(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function KFt(e){const t={},n=Q(e,["description"]);n!=null&&ee(t,["description"],n);const r=Q(e,["name"]);r!=null&&ee(t,["name"],r);const o=Q(e,["parameters"]);o!=null&&ee(t,["parameters"],o);const i=Q(e,["parametersJsonSchema"]);i!=null&&ee(t,["parametersJsonSchema"],i);const s=Q(e,["response"]);s!=null&&ee(t,["response"],s);const l=Q(e,["responseJsonSchema"]);if(l!=null&&ee(t,["responseJsonSchema"],l),Q(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function YFt(e){const t={},n=Q(e,["modelSelectionConfig"]);n!=null&&ee(t,["modelConfig"],n);const r=Q(e,["responseJsonSchema"]);r!=null&&ee(t,["responseJsonSchema"],r);const o=Q(e,["audioTimestamp"]);o!=null&&ee(t,["audioTimestamp"],o);const i=Q(e,["candidateCount"]);i!=null&&ee(t,["candidateCount"],i);const s=Q(e,["enableAffectiveDialog"]);s!=null&&ee(t,["enableAffectiveDialog"],s);const l=Q(e,["frequencyPenalty"]);l!=null&&ee(t,["frequencyPenalty"],l);const c=Q(e,["logprobs"]);c!=null&&ee(t,["logprobs"],c);const u=Q(e,["maxOutputTokens"]);u!=null&&ee(t,["maxOutputTokens"],u);const d=Q(e,["mediaResolution"]);d!=null&&ee(t,["mediaResolution"],d);const p=Q(e,["presencePenalty"]);p!=null&&ee(t,["presencePenalty"],p);const h=Q(e,["responseLogprobs"]);h!=null&&ee(t,["responseLogprobs"],h);const m=Q(e,["responseMimeType"]);m!=null&&ee(t,["responseMimeType"],m);const g=Q(e,["responseModalities"]);g!=null&&ee(t,["responseModalities"],g);const y=Q(e,["responseSchema"]);y!=null&&ee(t,["responseSchema"],y);const x=Q(e,["routingConfig"]);x!=null&&ee(t,["routingConfig"],x);const v=Q(e,["seed"]);v!=null&&ee(t,["seed"],v);const b=Q(e,["speechConfig"]);b!=null&&ee(t,["speechConfig"],b);const w=Q(e,["stopSequences"]);w!=null&&ee(t,["stopSequences"],w);const S=Q(e,["temperature"]);S!=null&&ee(t,["temperature"],S);const C=Q(e,["thinkingConfig"]);C!=null&&ee(t,["thinkingConfig"],C);const N=Q(e,["topK"]);N!=null&&ee(t,["topK"],N);const j=Q(e,["topP"]);if(j!=null&&ee(t,["topP"],j),Q(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return t}function XFt(e){const t={};if(Q(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=Q(e,["enableWidget"]);return n!=null&&ee(t,["enableWidget"],n),t}function QFt(e){const t={};if(Q(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(Q(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=Q(e,["timeRangeFilter"]);return n!=null&&ee(t,["timeRangeFilter"],n),t}function JFt(e,t){const n={},r=Q(e,["generationConfig"]);t!==void 0&&r!=null&&ee(t,["setup","generationConfig"],r);const o=Q(e,["responseModalities"]);t!==void 0&&o!=null&&ee(t,["setup","generationConfig","responseModalities"],o);const i=Q(e,["temperature"]);t!==void 0&&i!=null&&ee(t,["setup","generationConfig","temperature"],i);const s=Q(e,["topP"]);t!==void 0&&s!=null&&ee(t,["setup","generationConfig","topP"],s);const l=Q(e,["topK"]);t!==void 0&&l!=null&&ee(t,["setup","generationConfig","topK"],l);const c=Q(e,["maxOutputTokens"]);t!==void 0&&c!=null&&ee(t,["setup","generationConfig","maxOutputTokens"],c);const u=Q(e,["mediaResolution"]);t!==void 0&&u!=null&&ee(t,["setup","generationConfig","mediaResolution"],u);const d=Q(e,["seed"]);t!==void 0&&d!=null&&ee(t,["setup","generationConfig","seed"],d);const p=Q(e,["speechConfig"]);t!==void 0&&p!=null&&ee(t,["setup","generationConfig","speechConfig"],Zme(p));const h=Q(e,["thinkingConfig"]);t!==void 0&&h!=null&&ee(t,["setup","generationConfig","thinkingConfig"],h);const m=Q(e,["enableAffectiveDialog"]);t!==void 0&&m!=null&&ee(t,["setup","generationConfig","enableAffectiveDialog"],m);const g=Q(e,["systemInstruction"]);t!==void 0&&g!=null&&ee(t,["setup","systemInstruction"],WFt(Np(g)));const y=Q(e,["tools"]);if(t!==void 0&&y!=null){let N=hk(y);Array.isArray(N)&&(N=N.map(j=>c7t(pk(j)))),ee(t,["setup","tools"],N)}const x=Q(e,["sessionResumption"]);t!==void 0&&x!=null&&ee(t,["setup","sessionResumption"],l7t(x));const v=Q(e,["inputAudioTranscription"]);t!==void 0&&v!=null&&ee(t,["setup","inputAudioTranscription"],v);const b=Q(e,["outputAudioTranscription"]);t!==void 0&&b!=null&&ee(t,["setup","outputAudioTranscription"],b);const w=Q(e,["realtimeInputConfig"]);t!==void 0&&w!=null&&ee(t,["setup","realtimeInputConfig"],w);const S=Q(e,["contextWindowCompression"]);t!==void 0&&S!=null&&ee(t,["setup","contextWindowCompression"],S);const C=Q(e,["proactivity"]);if(t!==void 0&&C!=null&&ee(t,["setup","proactivity"],C),Q(e,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return n}function ZFt(e,t){const n={},r=Q(e,["generationConfig"]);t!==void 0&&r!=null&&ee(t,["setup","generationConfig"],YFt(r));const o=Q(e,["responseModalities"]);t!==void 0&&o!=null&&ee(t,["setup","generationConfig","responseModalities"],o);const i=Q(e,["temperature"]);t!==void 0&&i!=null&&ee(t,["setup","generationConfig","temperature"],i);const s=Q(e,["topP"]);t!==void 0&&s!=null&&ee(t,["setup","generationConfig","topP"],s);const l=Q(e,["topK"]);t!==void 0&&l!=null&&ee(t,["setup","generationConfig","topK"],l);const c=Q(e,["maxOutputTokens"]);t!==void 0&&c!=null&&ee(t,["setup","generationConfig","maxOutputTokens"],c);const u=Q(e,["mediaResolution"]);t!==void 0&&u!=null&&ee(t,["setup","generationConfig","mediaResolution"],u);const d=Q(e,["seed"]);t!==void 0&&d!=null&&ee(t,["setup","generationConfig","seed"],d);const p=Q(e,["speechConfig"]);t!==void 0&&p!=null&&ee(t,["setup","generationConfig","speechConfig"],Zme(p));const h=Q(e,["thinkingConfig"]);t!==void 0&&h!=null&&ee(t,["setup","generationConfig","thinkingConfig"],h);const m=Q(e,["enableAffectiveDialog"]);t!==void 0&&m!=null&&ee(t,["setup","generationConfig","enableAffectiveDialog"],m);const g=Q(e,["systemInstruction"]);t!==void 0&&g!=null&&ee(t,["setup","systemInstruction"],Np(g));const y=Q(e,["tools"]);if(t!==void 0&&y!=null){let j=hk(y);Array.isArray(j)&&(j=j.map(I=>u7t(pk(I)))),ee(t,["setup","tools"],j)}const x=Q(e,["sessionResumption"]);t!==void 0&&x!=null&&ee(t,["setup","sessionResumption"],x);const v=Q(e,["inputAudioTranscription"]);t!==void 0&&v!=null&&ee(t,["setup","inputAudioTranscription"],v);const b=Q(e,["outputAudioTranscription"]);t!==void 0&&b!=null&&ee(t,["setup","outputAudioTranscription"],b);const w=Q(e,["realtimeInputConfig"]);t!==void 0&&w!=null&&ee(t,["setup","realtimeInputConfig"],w);const S=Q(e,["contextWindowCompression"]);t!==void 0&&S!=null&&ee(t,["setup","contextWindowCompression"],S);const C=Q(e,["proactivity"]);t!==void 0&&C!=null&&ee(t,["setup","proactivity"],C);const N=Q(e,["explicitVadSignal"]);return t!==void 0&&N!=null&&ee(t,["setup","explicitVadSignal"],N),n}function e7t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["setup","model"],Xa(e,r));const o=Q(t,["config"]);return o!=null&&ee(n,["config"],JFt(o,n)),n}function t7t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["setup","model"],Xa(e,r));const o=Q(t,["config"]);return o!=null&&ee(n,["config"],ZFt(o,n)),n}function n7t(e){const t={},n=Q(e,["musicGenerationConfig"]);return n!=null&&ee(t,["musicGenerationConfig"],n),t}function r7t(e){const t={},n=Q(e,["weightedPrompts"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(o=>o)),ee(t,["weightedPrompts"],r)}return t}function o7t(e){const t={},n=Q(e,["media"]);if(n!=null){let u=RYe(n);Array.isArray(u)&&(u=u.map(d=>Vz(d))),ee(t,["mediaChunks"],u)}const r=Q(e,["audio"]);r!=null&&ee(t,["audio"],Vz($Ye(r)));const o=Q(e,["audioStreamEnd"]);o!=null&&ee(t,["audioStreamEnd"],o);const i=Q(e,["video"]);i!=null&&ee(t,["video"],Vz(OYe(i)));const s=Q(e,["text"]);s!=null&&ee(t,["text"],s);const l=Q(e,["activityStart"]);l!=null&&ee(t,["activityStart"],l);const c=Q(e,["activityEnd"]);return c!=null&&ee(t,["activityEnd"],c),t}function i7t(e){const t={},n=Q(e,["media"]);if(n!=null){let u=RYe(n);Array.isArray(u)&&(u=u.map(d=>d)),ee(t,["mediaChunks"],u)}const r=Q(e,["audio"]);r!=null&&ee(t,["audio"],$Ye(r));const o=Q(e,["audioStreamEnd"]);o!=null&&ee(t,["audioStreamEnd"],o);const i=Q(e,["video"]);i!=null&&ee(t,["video"],OYe(i));const s=Q(e,["text"]);s!=null&&ee(t,["text"],s);const l=Q(e,["activityStart"]);l!=null&&ee(t,["activityStart"],l);const c=Q(e,["activityEnd"]);return c!=null&&ee(t,["activityEnd"],c),t}function a7t(e){const t={},n=Q(e,["setupComplete"]);n!=null&&ee(t,["setupComplete"],n);const r=Q(e,["serverContent"]);r!=null&&ee(t,["serverContent"],r);const o=Q(e,["toolCall"]);o!=null&&ee(t,["toolCall"],o);const i=Q(e,["toolCallCancellation"]);i!=null&&ee(t,["toolCallCancellation"],i);const s=Q(e,["usageMetadata"]);s!=null&&ee(t,["usageMetadata"],d7t(s));const l=Q(e,["goAway"]);l!=null&&ee(t,["goAway"],l);const c=Q(e,["sessionResumptionUpdate"]);c!=null&&ee(t,["sessionResumptionUpdate"],c);const u=Q(e,["voiceActivityDetectionSignal"]);u!=null&&ee(t,["voiceActivityDetectionSignal"],u);const d=Q(e,["voiceActivity"]);return d!=null&&ee(t,["voiceActivity"],f7t(d)),t}function s7t(e){const t={},n=Q(e,["mediaResolution"]);n!=null&&ee(t,["mediaResolution"],n);const r=Q(e,["codeExecutionResult"]);r!=null&&ee(t,["codeExecutionResult"],r);const o=Q(e,["executableCode"]);o!=null&&ee(t,["executableCode"],o);const i=Q(e,["fileData"]);i!=null&&ee(t,["fileData"],GFt(i));const s=Q(e,["functionCall"]);s!=null&&ee(t,["functionCall"],qFt(s));const l=Q(e,["functionResponse"]);l!=null&&ee(t,["functionResponse"],l);const c=Q(e,["inlineData"]);c!=null&&ee(t,["inlineData"],Vz(c));const u=Q(e,["text"]);u!=null&&ee(t,["text"],u);const d=Q(e,["thought"]);d!=null&&ee(t,["thought"],d);const p=Q(e,["thoughtSignature"]);p!=null&&ee(t,["thoughtSignature"],p);const h=Q(e,["videoMetadata"]);return h!=null&&ee(t,["videoMetadata"],h),t}function l7t(e){const t={},n=Q(e,["handle"]);if(n!=null&&ee(t,["handle"],n),Q(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function c7t(e){const t={};if(Q(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=Q(e,["computerUse"]);n!=null&&ee(t,["computerUse"],n);const r=Q(e,["fileSearch"]);r!=null&&ee(t,["fileSearch"],r);const o=Q(e,["codeExecution"]);if(o!=null&&ee(t,["codeExecution"],o),Q(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=Q(e,["functionDeclarations"]);if(i!=null){let d=i;Array.isArray(d)&&(d=d.map(p=>p)),ee(t,["functionDeclarations"],d)}const s=Q(e,["googleMaps"]);s!=null&&ee(t,["googleMaps"],XFt(s));const l=Q(e,["googleSearch"]);l!=null&&ee(t,["googleSearch"],QFt(l));const c=Q(e,["googleSearchRetrieval"]);c!=null&&ee(t,["googleSearchRetrieval"],c);const u=Q(e,["urlContext"]);return u!=null&&ee(t,["urlContext"],u),t}function u7t(e){const t={},n=Q(e,["retrieval"]);n!=null&&ee(t,["retrieval"],n);const r=Q(e,["computerUse"]);if(r!=null&&ee(t,["computerUse"],r),Q(e,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const o=Q(e,["codeExecution"]);o!=null&&ee(t,["codeExecution"],o);const i=Q(e,["enterpriseWebSearch"]);i!=null&&ee(t,["enterpriseWebSearch"],i);const s=Q(e,["functionDeclarations"]);if(s!=null){let p=s;Array.isArray(p)&&(p=p.map(h=>KFt(h))),ee(t,["functionDeclarations"],p)}const l=Q(e,["googleMaps"]);l!=null&&ee(t,["googleMaps"],l);const c=Q(e,["googleSearch"]);c!=null&&ee(t,["googleSearch"],c);const u=Q(e,["googleSearchRetrieval"]);u!=null&&ee(t,["googleSearchRetrieval"],u);const d=Q(e,["urlContext"]);return d!=null&&ee(t,["urlContext"],d),t}function d7t(e){const t={},n=Q(e,["promptTokenCount"]);n!=null&&ee(t,["promptTokenCount"],n);const r=Q(e,["cachedContentTokenCount"]);r!=null&&ee(t,["cachedContentTokenCount"],r);const o=Q(e,["candidatesTokenCount"]);o!=null&&ee(t,["responseTokenCount"],o);const i=Q(e,["toolUsePromptTokenCount"]);i!=null&&ee(t,["toolUsePromptTokenCount"],i);const s=Q(e,["thoughtsTokenCount"]);s!=null&&ee(t,["thoughtsTokenCount"],s);const l=Q(e,["totalTokenCount"]);l!=null&&ee(t,["totalTokenCount"],l);const c=Q(e,["promptTokensDetails"]);if(c!=null){let m=c;Array.isArray(m)&&(m=m.map(g=>g)),ee(t,["promptTokensDetails"],m)}const u=Q(e,["cacheTokensDetails"]);if(u!=null){let m=u;Array.isArray(m)&&(m=m.map(g=>g)),ee(t,["cacheTokensDetails"],m)}const d=Q(e,["candidatesTokensDetails"]);if(d!=null){let m=d;Array.isArray(m)&&(m=m.map(g=>g)),ee(t,["responseTokensDetails"],m)}const p=Q(e,["toolUsePromptTokensDetails"]);if(p!=null){let m=p;Array.isArray(m)&&(m=m.map(g=>g)),ee(t,["toolUsePromptTokensDetails"],m)}const h=Q(e,["trafficType"]);return h!=null&&ee(t,["trafficType"],h),t}function f7t(e){const t={},n=Q(e,["type"]);return n!=null&&ee(t,["voiceActivityType"],n),t}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function p7t(e){const t={},n=Q(e,["data"]);if(n!=null&&ee(t,["data"],n),Q(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=Q(e,["mimeType"]);return r!=null&&ee(t,["mimeType"],r),t}function h7t(e){const t={},n=Q(e,["content"]);n!=null&&ee(t,["content"],n);const r=Q(e,["citationMetadata"]);r!=null&&ee(t,["citationMetadata"],m7t(r));const o=Q(e,["tokenCount"]);o!=null&&ee(t,["tokenCount"],o);const i=Q(e,["finishReason"]);i!=null&&ee(t,["finishReason"],i);const s=Q(e,["avgLogprobs"]);s!=null&&ee(t,["avgLogprobs"],s);const l=Q(e,["groundingMetadata"]);l!=null&&ee(t,["groundingMetadata"],l);const c=Q(e,["index"]);c!=null&&ee(t,["index"],c);const u=Q(e,["logprobsResult"]);u!=null&&ee(t,["logprobsResult"],u);const d=Q(e,["safetyRatings"]);if(d!=null){let h=d;Array.isArray(h)&&(h=h.map(m=>m)),ee(t,["safetyRatings"],h)}const p=Q(e,["urlContextMetadata"]);return p!=null&&ee(t,["urlContextMetadata"],p),t}function m7t(e){const t={},n=Q(e,["citationSources"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(o=>o)),ee(t,["citations"],r)}return t}function g7t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["contents"]);if(o!=null){let i=b0(o);Array.isArray(i)&&(i=i.map(s=>s)),ee(n,["contents"],i)}return n}function x7t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["tokensInfo"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(i=>i)),ee(t,["tokensInfo"],o)}return t}function y7t(e){const t={},n=Q(e,["values"]);n!=null&&ee(t,["values"],n);const r=Q(e,["statistics"]);return r!=null&&ee(t,["statistics"],v7t(r)),t}function v7t(e){const t={},n=Q(e,["truncated"]);n!=null&&ee(t,["truncated"],n);const r=Q(e,["token_count"]);return r!=null&&ee(t,["tokenCount"],r),t}function tq(e){const t={},n=Q(e,["parts"]);if(n!=null){let o=n;Array.isArray(o)&&(o=o.map(i=>_9t(i))),ee(t,["parts"],o)}const r=Q(e,["role"]);return r!=null&&ee(t,["role"],r),t}function b7t(e){const t={},n=Q(e,["controlType"]);n!=null&&ee(t,["controlType"],n);const r=Q(e,["enableControlImageComputation"]);return r!=null&&ee(t,["computeControl"],r),t}function w7t(e){const t={};if(Q(e,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(Q(e,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(Q(e,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return t}function S7t(e,t){const n={},r=Q(e,["systemInstruction"]);t!==void 0&&r!=null&&ee(t,["systemInstruction"],Np(r));const o=Q(e,["tools"]);if(t!==void 0&&o!=null){let s=o;Array.isArray(s)&&(s=s.map(l=>XYe(l))),ee(t,["tools"],s)}const i=Q(e,["generationConfig"]);return t!==void 0&&i!=null&&ee(t,["generationConfig"],p9t(i)),n}function C7t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["contents"]);if(o!=null){let s=b0(o);Array.isArray(s)&&(s=s.map(l=>tq(l))),ee(n,["contents"],s)}const i=Q(t,["config"]);return i!=null&&w7t(i),n}function N7t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["contents"]);if(o!=null){let s=b0(o);Array.isArray(s)&&(s=s.map(l=>l)),ee(n,["contents"],s)}const i=Q(t,["config"]);return i!=null&&S7t(i,n),n}function j7t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["totalTokens"]);r!=null&&ee(t,["totalTokens"],r);const o=Q(e,["cachedContentTokenCount"]);return o!=null&&ee(t,["cachedContentTokenCount"],o),t}function E7t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["totalTokens"]);return r!=null&&ee(t,["totalTokens"],r),t}function I7t(e,t){const n={},r=Q(t,["model"]);return r!=null&&ee(n,["_url","name"],Xa(e,r)),n}function _7t(e,t){const n={},r=Q(t,["model"]);return r!=null&&ee(n,["_url","name"],Xa(e,r)),n}function P7t(e){const t={},n=Q(e,["sdkHttpResponse"]);return n!=null&&ee(t,["sdkHttpResponse"],n),t}function A7t(e){const t={},n=Q(e,["sdkHttpResponse"]);return n!=null&&ee(t,["sdkHttpResponse"],n),t}function T7t(e,t){const n={},r=Q(e,["outputGcsUri"]);t!==void 0&&r!=null&&ee(t,["parameters","storageUri"],r);const o=Q(e,["negativePrompt"]);t!==void 0&&o!=null&&ee(t,["parameters","negativePrompt"],o);const i=Q(e,["numberOfImages"]);t!==void 0&&i!=null&&ee(t,["parameters","sampleCount"],i);const s=Q(e,["aspectRatio"]);t!==void 0&&s!=null&&ee(t,["parameters","aspectRatio"],s);const l=Q(e,["guidanceScale"]);t!==void 0&&l!=null&&ee(t,["parameters","guidanceScale"],l);const c=Q(e,["seed"]);t!==void 0&&c!=null&&ee(t,["parameters","seed"],c);const u=Q(e,["safetyFilterLevel"]);t!==void 0&&u!=null&&ee(t,["parameters","safetySetting"],u);const d=Q(e,["personGeneration"]);t!==void 0&&d!=null&&ee(t,["parameters","personGeneration"],d);const p=Q(e,["includeSafetyAttributes"]);t!==void 0&&p!=null&&ee(t,["parameters","includeSafetyAttributes"],p);const h=Q(e,["includeRaiReason"]);t!==void 0&&h!=null&&ee(t,["parameters","includeRaiReason"],h);const m=Q(e,["language"]);t!==void 0&&m!=null&&ee(t,["parameters","language"],m);const g=Q(e,["outputMimeType"]);t!==void 0&&g!=null&&ee(t,["parameters","outputOptions","mimeType"],g);const y=Q(e,["outputCompressionQuality"]);t!==void 0&&y!=null&&ee(t,["parameters","outputOptions","compressionQuality"],y);const x=Q(e,["addWatermark"]);t!==void 0&&x!=null&&ee(t,["parameters","addWatermark"],x);const v=Q(e,["labels"]);t!==void 0&&v!=null&&ee(t,["labels"],v);const b=Q(e,["editMode"]);t!==void 0&&b!=null&&ee(t,["parameters","editMode"],b);const w=Q(e,["baseSteps"]);return t!==void 0&&w!=null&&ee(t,["parameters","editConfig","baseSteps"],w),n}function k7t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["prompt"]);o!=null&&ee(n,["instances[0]","prompt"],o);const i=Q(t,["referenceImages"]);if(i!=null){let l=i;Array.isArray(l)&&(l=l.map(c=>R9t(c))),ee(n,["instances[0]","referenceImages"],l)}const s=Q(t,["config"]);return s!=null&&T7t(s,n),n}function M7t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["predictions"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(i=>nq(i))),ee(t,["generatedImages"],o)}return t}function R7t(e,t){const n={},r=Q(e,["taskType"]);t!==void 0&&r!=null&&ee(t,["requests[]","taskType"],r);const o=Q(e,["title"]);t!==void 0&&o!=null&&ee(t,["requests[]","title"],o);const i=Q(e,["outputDimensionality"]);if(t!==void 0&&i!=null&&ee(t,["requests[]","outputDimensionality"],i),Q(e,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(Q(e,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return n}function O7t(e,t){const n={},r=Q(e,["taskType"]);t!==void 0&&r!=null&&ee(t,["instances[]","task_type"],r);const o=Q(e,["title"]);t!==void 0&&o!=null&&ee(t,["instances[]","title"],o);const i=Q(e,["outputDimensionality"]);t!==void 0&&i!=null&&ee(t,["parameters","outputDimensionality"],i);const s=Q(e,["mimeType"]);t!==void 0&&s!=null&&ee(t,["instances[]","mimeType"],s);const l=Q(e,["autoTruncate"]);return t!==void 0&&l!=null&&ee(t,["parameters","autoTruncate"],l),n}function $7t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["contents"]);if(o!=null){let l=Xme(e,o);Array.isArray(l)&&(l=l.map(c=>c)),ee(n,["requests[]","content"],l)}const i=Q(t,["config"]);i!=null&&R7t(i,n);const s=Q(t,["model"]);return s!==void 0&&ee(n,["requests[]","model"],Xa(e,s)),n}function D7t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["contents"]);if(o!=null){let s=Xme(e,o);Array.isArray(s)&&(s=s.map(l=>l)),ee(n,["instances[]","content"],s)}const i=Q(t,["config"]);return i!=null&&O7t(i,n),n}function L7t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["embeddings"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),ee(t,["embeddings"],i)}const o=Q(e,["metadata"]);return o!=null&&ee(t,["metadata"],o),t}function F7t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["predictions[]","embeddings"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>y7t(s))),ee(t,["embeddings"],i)}const o=Q(e,["metadata"]);return o!=null&&ee(t,["metadata"],o),t}function z7t(e){const t={},n=Q(e,["endpoint"]);n!=null&&ee(t,["name"],n);const r=Q(e,["deployedModelId"]);return r!=null&&ee(t,["deployedModelId"],r),t}function B7t(e){const t={};if(Q(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=Q(e,["fileUri"]);n!=null&&ee(t,["fileUri"],n);const r=Q(e,["mimeType"]);return r!=null&&ee(t,["mimeType"],r),t}function H7t(e){const t={},n=Q(e,["id"]);n!=null&&ee(t,["id"],n);const r=Q(e,["args"]);r!=null&&ee(t,["args"],r);const o=Q(e,["name"]);if(o!=null&&ee(t,["name"],o),Q(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(Q(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function V7t(e){const t={},n=Q(e,["allowedFunctionNames"]);n!=null&&ee(t,["allowedFunctionNames"],n);const r=Q(e,["mode"]);if(r!=null&&ee(t,["mode"],r),Q(e,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function U7t(e){const t={},n=Q(e,["description"]);n!=null&&ee(t,["description"],n);const r=Q(e,["name"]);r!=null&&ee(t,["name"],r);const o=Q(e,["parameters"]);o!=null&&ee(t,["parameters"],o);const i=Q(e,["parametersJsonSchema"]);i!=null&&ee(t,["parametersJsonSchema"],i);const s=Q(e,["response"]);s!=null&&ee(t,["response"],s);const l=Q(e,["responseJsonSchema"]);if(l!=null&&ee(t,["responseJsonSchema"],l),Q(e,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function W7t(e,t,n){const r={},o=Q(t,["systemInstruction"]);n!==void 0&&o!=null&&ee(n,["systemInstruction"],tq(Np(o)));const i=Q(t,["temperature"]);i!=null&&ee(r,["temperature"],i);const s=Q(t,["topP"]);s!=null&&ee(r,["topP"],s);const l=Q(t,["topK"]);l!=null&&ee(r,["topK"],l);const c=Q(t,["candidateCount"]);c!=null&&ee(r,["candidateCount"],c);const u=Q(t,["maxOutputTokens"]);u!=null&&ee(r,["maxOutputTokens"],u);const d=Q(t,["stopSequences"]);d!=null&&ee(r,["stopSequences"],d);const p=Q(t,["responseLogprobs"]);p!=null&&ee(r,["responseLogprobs"],p);const h=Q(t,["logprobs"]);h!=null&&ee(r,["logprobs"],h);const m=Q(t,["presencePenalty"]);m!=null&&ee(r,["presencePenalty"],m);const g=Q(t,["frequencyPenalty"]);g!=null&&ee(r,["frequencyPenalty"],g);const y=Q(t,["seed"]);y!=null&&ee(r,["seed"],y);const x=Q(t,["responseMimeType"]);x!=null&&ee(r,["responseMimeType"],x);const v=Q(t,["responseSchema"]);v!=null&&ee(r,["responseSchema"],Qme(v));const b=Q(t,["responseJsonSchema"]);if(b!=null&&ee(r,["responseJsonSchema"],b),Q(t,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(Q(t,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const w=Q(t,["safetySettings"]);if(n!==void 0&&w!=null){let M=w;Array.isArray(M)&&(M=M.map(R=>O9t(R))),ee(n,["safetySettings"],M)}const S=Q(t,["tools"]);if(n!==void 0&&S!=null){let M=hk(S);Array.isArray(M)&&(M=M.map(R=>H9t(pk(R)))),ee(n,["tools"],M)}const C=Q(t,["toolConfig"]);if(n!==void 0&&C!=null&&ee(n,["toolConfig"],B9t(C)),Q(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const N=Q(t,["cachedContent"]);n!==void 0&&N!=null&&ee(n,["cachedContent"],Bw(e,N));const j=Q(t,["responseModalities"]);j!=null&&ee(r,["responseModalities"],j);const I=Q(t,["mediaResolution"]);I!=null&&ee(r,["mediaResolution"],I);const _=Q(t,["speechConfig"]);if(_!=null&&ee(r,["speechConfig"],Jme(_)),Q(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const T=Q(t,["thinkingConfig"]);T!=null&&ee(r,["thinkingConfig"],T);const P=Q(t,["imageConfig"]);P!=null&&ee(r,["imageConfig"],y9t(P));const E=Q(t,["enableEnhancedCivicAnswers"]);if(E!=null&&ee(r,["enableEnhancedCivicAnswers"],E),Q(t,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return r}function G7t(e,t,n){const r={},o=Q(t,["systemInstruction"]);n!==void 0&&o!=null&&ee(n,["systemInstruction"],Np(o));const i=Q(t,["temperature"]);i!=null&&ee(r,["temperature"],i);const s=Q(t,["topP"]);s!=null&&ee(r,["topP"],s);const l=Q(t,["topK"]);l!=null&&ee(r,["topK"],l);const c=Q(t,["candidateCount"]);c!=null&&ee(r,["candidateCount"],c);const u=Q(t,["maxOutputTokens"]);u!=null&&ee(r,["maxOutputTokens"],u);const d=Q(t,["stopSequences"]);d!=null&&ee(r,["stopSequences"],d);const p=Q(t,["responseLogprobs"]);p!=null&&ee(r,["responseLogprobs"],p);const h=Q(t,["logprobs"]);h!=null&&ee(r,["logprobs"],h);const m=Q(t,["presencePenalty"]);m!=null&&ee(r,["presencePenalty"],m);const g=Q(t,["frequencyPenalty"]);g!=null&&ee(r,["frequencyPenalty"],g);const y=Q(t,["seed"]);y!=null&&ee(r,["seed"],y);const x=Q(t,["responseMimeType"]);x!=null&&ee(r,["responseMimeType"],x);const v=Q(t,["responseSchema"]);v!=null&&ee(r,["responseSchema"],Qme(v));const b=Q(t,["responseJsonSchema"]);b!=null&&ee(r,["responseJsonSchema"],b);const w=Q(t,["routingConfig"]);w!=null&&ee(r,["routingConfig"],w);const S=Q(t,["modelSelectionConfig"]);S!=null&&ee(r,["modelConfig"],S);const C=Q(t,["safetySettings"]);if(n!==void 0&&C!=null){let z=C;Array.isArray(z)&&(z=z.map(V=>V)),ee(n,["safetySettings"],z)}const N=Q(t,["tools"]);if(n!==void 0&&N!=null){let z=hk(N);Array.isArray(z)&&(z=z.map(V=>XYe(pk(V)))),ee(n,["tools"],z)}const j=Q(t,["toolConfig"]);n!==void 0&&j!=null&&ee(n,["toolConfig"],j);const I=Q(t,["labels"]);n!==void 0&&I!=null&&ee(n,["labels"],I);const _=Q(t,["cachedContent"]);n!==void 0&&_!=null&&ee(n,["cachedContent"],Bw(e,_));const T=Q(t,["responseModalities"]);T!=null&&ee(r,["responseModalities"],T);const P=Q(t,["mediaResolution"]);P!=null&&ee(r,["mediaResolution"],P);const E=Q(t,["speechConfig"]);E!=null&&ee(r,["speechConfig"],Jme(E));const M=Q(t,["audioTimestamp"]);M!=null&&ee(r,["audioTimestamp"],M);const R=Q(t,["thinkingConfig"]);R!=null&&ee(r,["thinkingConfig"],R);const $=Q(t,["imageConfig"]);if($!=null&&ee(r,["imageConfig"],v9t($)),Q(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");const D=Q(t,["modelArmorConfig"]);return n!==void 0&&D!=null&&ee(n,["modelArmorConfig"],D),r}function cEe(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["contents"]);if(o!=null){let s=b0(o);Array.isArray(s)&&(s=s.map(l=>tq(l))),ee(n,["contents"],s)}const i=Q(t,["config"]);return i!=null&&ee(n,["generationConfig"],W7t(e,i,n)),n}function uEe(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["contents"]);if(o!=null){let s=b0(o);Array.isArray(s)&&(s=s.map(l=>l)),ee(n,["contents"],s)}const i=Q(t,["config"]);return i!=null&&ee(n,["generationConfig"],G7t(e,i,n)),n}function dEe(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["candidates"]);if(r!=null){let c=r;Array.isArray(c)&&(c=c.map(u=>h7t(u))),ee(t,["candidates"],c)}const o=Q(e,["modelVersion"]);o!=null&&ee(t,["modelVersion"],o);const i=Q(e,["promptFeedback"]);i!=null&&ee(t,["promptFeedback"],i);const s=Q(e,["responseId"]);s!=null&&ee(t,["responseId"],s);const l=Q(e,["usageMetadata"]);return l!=null&&ee(t,["usageMetadata"],l),t}function fEe(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["candidates"]);if(r!=null){let u=r;Array.isArray(u)&&(u=u.map(d=>d)),ee(t,["candidates"],u)}const o=Q(e,["createTime"]);o!=null&&ee(t,["createTime"],o);const i=Q(e,["modelVersion"]);i!=null&&ee(t,["modelVersion"],i);const s=Q(e,["promptFeedback"]);s!=null&&ee(t,["promptFeedback"],s);const l=Q(e,["responseId"]);l!=null&&ee(t,["responseId"],l);const c=Q(e,["usageMetadata"]);return c!=null&&ee(t,["usageMetadata"],c),t}function q7t(e,t){const n={};if(Q(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(Q(e,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const r=Q(e,["numberOfImages"]);t!==void 0&&r!=null&&ee(t,["parameters","sampleCount"],r);const o=Q(e,["aspectRatio"]);t!==void 0&&o!=null&&ee(t,["parameters","aspectRatio"],o);const i=Q(e,["guidanceScale"]);if(t!==void 0&&i!=null&&ee(t,["parameters","guidanceScale"],i),Q(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const s=Q(e,["safetyFilterLevel"]);t!==void 0&&s!=null&&ee(t,["parameters","safetySetting"],s);const l=Q(e,["personGeneration"]);t!==void 0&&l!=null&&ee(t,["parameters","personGeneration"],l);const c=Q(e,["includeSafetyAttributes"]);t!==void 0&&c!=null&&ee(t,["parameters","includeSafetyAttributes"],c);const u=Q(e,["includeRaiReason"]);t!==void 0&&u!=null&&ee(t,["parameters","includeRaiReason"],u);const d=Q(e,["language"]);t!==void 0&&d!=null&&ee(t,["parameters","language"],d);const p=Q(e,["outputMimeType"]);t!==void 0&&p!=null&&ee(t,["parameters","outputOptions","mimeType"],p);const h=Q(e,["outputCompressionQuality"]);if(t!==void 0&&h!=null&&ee(t,["parameters","outputOptions","compressionQuality"],h),Q(e,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(Q(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const m=Q(e,["imageSize"]);if(t!==void 0&&m!=null&&ee(t,["parameters","sampleImageSize"],m),Q(e,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return n}function K7t(e,t){const n={},r=Q(e,["outputGcsUri"]);t!==void 0&&r!=null&&ee(t,["parameters","storageUri"],r);const o=Q(e,["negativePrompt"]);t!==void 0&&o!=null&&ee(t,["parameters","negativePrompt"],o);const i=Q(e,["numberOfImages"]);t!==void 0&&i!=null&&ee(t,["parameters","sampleCount"],i);const s=Q(e,["aspectRatio"]);t!==void 0&&s!=null&&ee(t,["parameters","aspectRatio"],s);const l=Q(e,["guidanceScale"]);t!==void 0&&l!=null&&ee(t,["parameters","guidanceScale"],l);const c=Q(e,["seed"]);t!==void 0&&c!=null&&ee(t,["parameters","seed"],c);const u=Q(e,["safetyFilterLevel"]);t!==void 0&&u!=null&&ee(t,["parameters","safetySetting"],u);const d=Q(e,["personGeneration"]);t!==void 0&&d!=null&&ee(t,["parameters","personGeneration"],d);const p=Q(e,["includeSafetyAttributes"]);t!==void 0&&p!=null&&ee(t,["parameters","includeSafetyAttributes"],p);const h=Q(e,["includeRaiReason"]);t!==void 0&&h!=null&&ee(t,["parameters","includeRaiReason"],h);const m=Q(e,["language"]);t!==void 0&&m!=null&&ee(t,["parameters","language"],m);const g=Q(e,["outputMimeType"]);t!==void 0&&g!=null&&ee(t,["parameters","outputOptions","mimeType"],g);const y=Q(e,["outputCompressionQuality"]);t!==void 0&&y!=null&&ee(t,["parameters","outputOptions","compressionQuality"],y);const x=Q(e,["addWatermark"]);t!==void 0&&x!=null&&ee(t,["parameters","addWatermark"],x);const v=Q(e,["labels"]);t!==void 0&&v!=null&&ee(t,["labels"],v);const b=Q(e,["imageSize"]);t!==void 0&&b!=null&&ee(t,["parameters","sampleImageSize"],b);const w=Q(e,["enhancePrompt"]);return t!==void 0&&w!=null&&ee(t,["parameters","enhancePrompt"],w),n}function Y7t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["prompt"]);o!=null&&ee(n,["instances[0]","prompt"],o);const i=Q(t,["config"]);return i!=null&&q7t(i,n),n}function X7t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["prompt"]);o!=null&&ee(n,["instances[0]","prompt"],o);const i=Q(t,["config"]);return i!=null&&K7t(i,n),n}function Q7t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["predictions"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>c9t(s))),ee(t,["generatedImages"],i)}const o=Q(e,["positivePromptSafetyAttributes"]);return o!=null&&ee(t,["positivePromptSafetyAttributes"],KYe(o)),t}function J7t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["predictions"]);if(r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>nq(s))),ee(t,["generatedImages"],i)}const o=Q(e,["positivePromptSafetyAttributes"]);return o!=null&&ee(t,["positivePromptSafetyAttributes"],YYe(o)),t}function Z7t(e,t){const n={},r=Q(e,["numberOfVideos"]);if(t!==void 0&&r!=null&&ee(t,["parameters","sampleCount"],r),Q(e,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(Q(e,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const o=Q(e,["durationSeconds"]);if(t!==void 0&&o!=null&&ee(t,["parameters","durationSeconds"],o),Q(e,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const i=Q(e,["aspectRatio"]);t!==void 0&&i!=null&&ee(t,["parameters","aspectRatio"],i);const s=Q(e,["resolution"]);t!==void 0&&s!=null&&ee(t,["parameters","resolution"],s);const l=Q(e,["personGeneration"]);if(t!==void 0&&l!=null&&ee(t,["parameters","personGeneration"],l),Q(e,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const c=Q(e,["negativePrompt"]);t!==void 0&&c!=null&&ee(t,["parameters","negativePrompt"],c);const u=Q(e,["enhancePrompt"]);if(t!==void 0&&u!=null&&ee(t,["parameters","enhancePrompt"],u),Q(e,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");const d=Q(e,["lastFrame"]);t!==void 0&&d!=null&&ee(t,["instances[0]","lastFrame"],rq(d));const p=Q(e,["referenceImages"]);if(t!==void 0&&p!=null){let h=p;Array.isArray(h)&&(h=h.map(m=>tzt(m))),ee(t,["instances[0]","referenceImages"],h)}if(Q(e,["mask"])!==void 0)throw new Error("mask parameter is not supported in Gemini API.");if(Q(e,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is not supported in Gemini API.");return n}function e9t(e,t){const n={},r=Q(e,["numberOfVideos"]);t!==void 0&&r!=null&&ee(t,["parameters","sampleCount"],r);const o=Q(e,["outputGcsUri"]);t!==void 0&&o!=null&&ee(t,["parameters","storageUri"],o);const i=Q(e,["fps"]);t!==void 0&&i!=null&&ee(t,["parameters","fps"],i);const s=Q(e,["durationSeconds"]);t!==void 0&&s!=null&&ee(t,["parameters","durationSeconds"],s);const l=Q(e,["seed"]);t!==void 0&&l!=null&&ee(t,["parameters","seed"],l);const c=Q(e,["aspectRatio"]);t!==void 0&&c!=null&&ee(t,["parameters","aspectRatio"],c);const u=Q(e,["resolution"]);t!==void 0&&u!=null&&ee(t,["parameters","resolution"],u);const d=Q(e,["personGeneration"]);t!==void 0&&d!=null&&ee(t,["parameters","personGeneration"],d);const p=Q(e,["pubsubTopic"]);t!==void 0&&p!=null&&ee(t,["parameters","pubsubTopic"],p);const h=Q(e,["negativePrompt"]);t!==void 0&&h!=null&&ee(t,["parameters","negativePrompt"],h);const m=Q(e,["enhancePrompt"]);t!==void 0&&m!=null&&ee(t,["parameters","enhancePrompt"],m);const g=Q(e,["generateAudio"]);t!==void 0&&g!=null&&ee(t,["parameters","generateAudio"],g);const y=Q(e,["lastFrame"]);t!==void 0&&y!=null&&ee(t,["instances[0]","lastFrame"],Ny(y));const x=Q(e,["referenceImages"]);if(t!==void 0&&x!=null){let w=x;Array.isArray(w)&&(w=w.map(S=>nzt(S))),ee(t,["instances[0]","referenceImages"],w)}const v=Q(e,["mask"]);t!==void 0&&v!=null&&ee(t,["instances[0]","mask"],ezt(v));const b=Q(e,["compressionQuality"]);return t!==void 0&&b!=null&&ee(t,["parameters","compressionQuality"],b),n}function t9t(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["name"],n);const r=Q(e,["metadata"]);r!=null&&ee(t,["metadata"],r);const o=Q(e,["done"]);o!=null&&ee(t,["done"],o);const i=Q(e,["error"]);i!=null&&ee(t,["error"],i);const s=Q(e,["response","generateVideoResponse"]);return s!=null&&ee(t,["response"],i9t(s)),t}function n9t(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["name"],n);const r=Q(e,["metadata"]);r!=null&&ee(t,["metadata"],r);const o=Q(e,["done"]);o!=null&&ee(t,["done"],o);const i=Q(e,["error"]);i!=null&&ee(t,["error"],i);const s=Q(e,["response"]);return s!=null&&ee(t,["response"],a9t(s)),t}function r9t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["prompt"]);o!=null&&ee(n,["instances[0]","prompt"],o);const i=Q(t,["image"]);i!=null&&ee(n,["instances[0]","image"],rq(i));const s=Q(t,["video"]);s!=null&&ee(n,["instances[0]","video"],QYe(s));const l=Q(t,["source"]);l!=null&&s9t(l,n);const c=Q(t,["config"]);return c!=null&&Z7t(c,n),n}function o9t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["prompt"]);o!=null&&ee(n,["instances[0]","prompt"],o);const i=Q(t,["image"]);i!=null&&ee(n,["instances[0]","image"],Ny(i));const s=Q(t,["video"]);s!=null&&ee(n,["instances[0]","video"],JYe(s));const l=Q(t,["source"]);l!=null&&l9t(l,n);const c=Q(t,["config"]);return c!=null&&e9t(c,n),n}function i9t(e){const t={},n=Q(e,["generatedSamples"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>d9t(s))),ee(t,["generatedVideos"],i)}const r=Q(e,["raiMediaFilteredCount"]);r!=null&&ee(t,["raiMediaFilteredCount"],r);const o=Q(e,["raiMediaFilteredReasons"]);return o!=null&&ee(t,["raiMediaFilteredReasons"],o),t}function a9t(e){const t={},n=Q(e,["videos"]);if(n!=null){let i=n;Array.isArray(i)&&(i=i.map(s=>f9t(s))),ee(t,["generatedVideos"],i)}const r=Q(e,["raiMediaFilteredCount"]);r!=null&&ee(t,["raiMediaFilteredCount"],r);const o=Q(e,["raiMediaFilteredReasons"]);return o!=null&&ee(t,["raiMediaFilteredReasons"],o),t}function s9t(e,t){const n={},r=Q(e,["prompt"]);t!==void 0&&r!=null&&ee(t,["instances[0]","prompt"],r);const o=Q(e,["image"]);t!==void 0&&o!=null&&ee(t,["instances[0]","image"],rq(o));const i=Q(e,["video"]);return t!==void 0&&i!=null&&ee(t,["instances[0]","video"],QYe(i)),n}function l9t(e,t){const n={},r=Q(e,["prompt"]);t!==void 0&&r!=null&&ee(t,["instances[0]","prompt"],r);const o=Q(e,["image"]);t!==void 0&&o!=null&&ee(t,["instances[0]","image"],Ny(o));const i=Q(e,["video"]);return t!==void 0&&i!=null&&ee(t,["instances[0]","video"],JYe(i)),n}function c9t(e){const t={},n=Q(e,["_self"]);n!=null&&ee(t,["image"],b9t(n));const r=Q(e,["raiFilteredReason"]);r!=null&&ee(t,["raiFilteredReason"],r);const o=Q(e,["_self"]);return o!=null&&ee(t,["safetyAttributes"],KYe(o)),t}function nq(e){const t={},n=Q(e,["_self"]);n!=null&&ee(t,["image"],qYe(n));const r=Q(e,["raiFilteredReason"]);r!=null&&ee(t,["raiFilteredReason"],r);const o=Q(e,["_self"]);o!=null&&ee(t,["safetyAttributes"],YYe(o));const i=Q(e,["prompt"]);return i!=null&&ee(t,["enhancedPrompt"],i),t}function u9t(e){const t={},n=Q(e,["_self"]);n!=null&&ee(t,["mask"],qYe(n));const r=Q(e,["labels"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(i=>i)),ee(t,["labels"],o)}return t}function d9t(e){const t={},n=Q(e,["video"]);return n!=null&&ee(t,["video"],J9t(n)),t}function f9t(e){const t={},n=Q(e,["_self"]);return n!=null&&ee(t,["video"],Z9t(n)),t}function p9t(e){const t={},n=Q(e,["modelSelectionConfig"]);n!=null&&ee(t,["modelConfig"],n);const r=Q(e,["responseJsonSchema"]);r!=null&&ee(t,["responseJsonSchema"],r);const o=Q(e,["audioTimestamp"]);o!=null&&ee(t,["audioTimestamp"],o);const i=Q(e,["candidateCount"]);i!=null&&ee(t,["candidateCount"],i);const s=Q(e,["enableAffectiveDialog"]);s!=null&&ee(t,["enableAffectiveDialog"],s);const l=Q(e,["frequencyPenalty"]);l!=null&&ee(t,["frequencyPenalty"],l);const c=Q(e,["logprobs"]);c!=null&&ee(t,["logprobs"],c);const u=Q(e,["maxOutputTokens"]);u!=null&&ee(t,["maxOutputTokens"],u);const d=Q(e,["mediaResolution"]);d!=null&&ee(t,["mediaResolution"],d);const p=Q(e,["presencePenalty"]);p!=null&&ee(t,["presencePenalty"],p);const h=Q(e,["responseLogprobs"]);h!=null&&ee(t,["responseLogprobs"],h);const m=Q(e,["responseMimeType"]);m!=null&&ee(t,["responseMimeType"],m);const g=Q(e,["responseModalities"]);g!=null&&ee(t,["responseModalities"],g);const y=Q(e,["responseSchema"]);y!=null&&ee(t,["responseSchema"],y);const x=Q(e,["routingConfig"]);x!=null&&ee(t,["routingConfig"],x);const v=Q(e,["seed"]);v!=null&&ee(t,["seed"],v);const b=Q(e,["speechConfig"]);b!=null&&ee(t,["speechConfig"],b);const w=Q(e,["stopSequences"]);w!=null&&ee(t,["stopSequences"],w);const S=Q(e,["temperature"]);S!=null&&ee(t,["temperature"],S);const C=Q(e,["thinkingConfig"]);C!=null&&ee(t,["thinkingConfig"],C);const N=Q(e,["topK"]);N!=null&&ee(t,["topK"],N);const j=Q(e,["topP"]);if(j!=null&&ee(t,["topP"],j),Q(e,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return t}function h9t(e,t){const n={},r=Q(t,["model"]);return r!=null&&ee(n,["_url","name"],Xa(e,r)),n}function m9t(e,t){const n={},r=Q(t,["model"]);return r!=null&&ee(n,["_url","name"],Xa(e,r)),n}function g9t(e){const t={};if(Q(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=Q(e,["enableWidget"]);return n!=null&&ee(t,["enableWidget"],n),t}function x9t(e){const t={};if(Q(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(Q(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=Q(e,["timeRangeFilter"]);return n!=null&&ee(t,["timeRangeFilter"],n),t}function y9t(e){const t={},n=Q(e,["aspectRatio"]);n!=null&&ee(t,["aspectRatio"],n);const r=Q(e,["imageSize"]);if(r!=null&&ee(t,["imageSize"],r),Q(e,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(Q(e,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(Q(e,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return t}function v9t(e){const t={},n=Q(e,["aspectRatio"]);n!=null&&ee(t,["aspectRatio"],n);const r=Q(e,["imageSize"]);r!=null&&ee(t,["imageSize"],r);const o=Q(e,["personGeneration"]);o!=null&&ee(t,["personGeneration"],o);const i=Q(e,["outputMimeType"]);i!=null&&ee(t,["imageOutputOptions","mimeType"],i);const s=Q(e,["outputCompressionQuality"]);return s!=null&&ee(t,["imageOutputOptions","compressionQuality"],s),t}function b9t(e){const t={},n=Q(e,["bytesBase64Encoded"]);n!=null&&ee(t,["imageBytes"],QC(n));const r=Q(e,["mimeType"]);return r!=null&&ee(t,["mimeType"],r),t}function qYe(e){const t={},n=Q(e,["gcsUri"]);n!=null&&ee(t,["gcsUri"],n);const r=Q(e,["bytesBase64Encoded"]);r!=null&&ee(t,["imageBytes"],QC(r));const o=Q(e,["mimeType"]);return o!=null&&ee(t,["mimeType"],o),t}function rq(e){const t={};if(Q(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const n=Q(e,["imageBytes"]);n!=null&&ee(t,["bytesBase64Encoded"],QC(n));const r=Q(e,["mimeType"]);return r!=null&&ee(t,["mimeType"],r),t}function Ny(e){const t={},n=Q(e,["gcsUri"]);n!=null&&ee(t,["gcsUri"],n);const r=Q(e,["imageBytes"]);r!=null&&ee(t,["bytesBase64Encoded"],QC(r));const o=Q(e,["mimeType"]);return o!=null&&ee(t,["mimeType"],o),t}function w9t(e,t,n){const r={},o=Q(t,["pageSize"]);n!==void 0&&o!=null&&ee(n,["_query","pageSize"],o);const i=Q(t,["pageToken"]);n!==void 0&&i!=null&&ee(n,["_query","pageToken"],i);const s=Q(t,["filter"]);n!==void 0&&s!=null&&ee(n,["_query","filter"],s);const l=Q(t,["queryBase"]);return n!==void 0&&l!=null&&ee(n,["_url","models_url"],zYe(e,l)),r}function S9t(e,t,n){const r={},o=Q(t,["pageSize"]);n!==void 0&&o!=null&&ee(n,["_query","pageSize"],o);const i=Q(t,["pageToken"]);n!==void 0&&i!=null&&ee(n,["_query","pageToken"],i);const s=Q(t,["filter"]);n!==void 0&&s!=null&&ee(n,["_query","filter"],s);const l=Q(t,["queryBase"]);return n!==void 0&&l!=null&&ee(n,["_url","models_url"],zYe(e,l)),r}function C9t(e,t){const n={},r=Q(t,["config"]);return r!=null&&w9t(e,r,n),n}function N9t(e,t){const n={},r=Q(t,["config"]);return r!=null&&S9t(e,r,n),n}function j9t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["nextPageToken"]);r!=null&&ee(t,["nextPageToken"],r);const o=Q(e,["_self"]);if(o!=null){let i=BYe(o);Array.isArray(i)&&(i=i.map(s=>Lie(s))),ee(t,["models"],i)}return t}function E9t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["nextPageToken"]);r!=null&&ee(t,["nextPageToken"],r);const o=Q(e,["_self"]);if(o!=null){let i=BYe(o);Array.isArray(i)&&(i=i.map(s=>Fie(s))),ee(t,["models"],i)}return t}function I9t(e){const t={},n=Q(e,["maskMode"]);n!=null&&ee(t,["maskMode"],n);const r=Q(e,["segmentationClasses"]);r!=null&&ee(t,["maskClasses"],r);const o=Q(e,["maskDilation"]);return o!=null&&ee(t,["dilation"],o),t}function Lie(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["name"],n);const r=Q(e,["displayName"]);r!=null&&ee(t,["displayName"],r);const o=Q(e,["description"]);o!=null&&ee(t,["description"],o);const i=Q(e,["version"]);i!=null&&ee(t,["version"],i);const s=Q(e,["_self"]);s!=null&&ee(t,["tunedModelInfo"],V9t(s));const l=Q(e,["inputTokenLimit"]);l!=null&&ee(t,["inputTokenLimit"],l);const c=Q(e,["outputTokenLimit"]);c!=null&&ee(t,["outputTokenLimit"],c);const u=Q(e,["supportedGenerationMethods"]);u!=null&&ee(t,["supportedActions"],u);const d=Q(e,["temperature"]);d!=null&&ee(t,["temperature"],d);const p=Q(e,["maxTemperature"]);p!=null&&ee(t,["maxTemperature"],p);const h=Q(e,["topP"]);h!=null&&ee(t,["topP"],h);const m=Q(e,["topK"]);m!=null&&ee(t,["topK"],m);const g=Q(e,["thinking"]);return g!=null&&ee(t,["thinking"],g),t}function Fie(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["name"],n);const r=Q(e,["displayName"]);r!=null&&ee(t,["displayName"],r);const o=Q(e,["description"]);o!=null&&ee(t,["description"],o);const i=Q(e,["versionId"]);i!=null&&ee(t,["version"],i);const s=Q(e,["deployedModels"]);if(s!=null){let p=s;Array.isArray(p)&&(p=p.map(h=>z7t(h))),ee(t,["endpoints"],p)}const l=Q(e,["labels"]);l!=null&&ee(t,["labels"],l);const c=Q(e,["_self"]);c!=null&&ee(t,["tunedModelInfo"],U9t(c));const u=Q(e,["defaultCheckpointId"]);u!=null&&ee(t,["defaultCheckpointId"],u);const d=Q(e,["checkpoints"]);if(d!=null){let p=d;Array.isArray(p)&&(p=p.map(h=>h)),ee(t,["checkpoints"],p)}return t}function _9t(e){const t={},n=Q(e,["mediaResolution"]);n!=null&&ee(t,["mediaResolution"],n);const r=Q(e,["codeExecutionResult"]);r!=null&&ee(t,["codeExecutionResult"],r);const o=Q(e,["executableCode"]);o!=null&&ee(t,["executableCode"],o);const i=Q(e,["fileData"]);i!=null&&ee(t,["fileData"],B7t(i));const s=Q(e,["functionCall"]);s!=null&&ee(t,["functionCall"],H7t(s));const l=Q(e,["functionResponse"]);l!=null&&ee(t,["functionResponse"],l);const c=Q(e,["inlineData"]);c!=null&&ee(t,["inlineData"],p7t(c));const u=Q(e,["text"]);u!=null&&ee(t,["text"],u);const d=Q(e,["thought"]);d!=null&&ee(t,["thought"],d);const p=Q(e,["thoughtSignature"]);p!=null&&ee(t,["thoughtSignature"],p);const h=Q(e,["videoMetadata"]);return h!=null&&ee(t,["videoMetadata"],h),t}function P9t(e){const t={},n=Q(e,["productImage"]);return n!=null&&ee(t,["image"],Ny(n)),t}function A9t(e,t){const n={},r=Q(e,["numberOfImages"]);t!==void 0&&r!=null&&ee(t,["parameters","sampleCount"],r);const o=Q(e,["baseSteps"]);t!==void 0&&o!=null&&ee(t,["parameters","baseSteps"],o);const i=Q(e,["outputGcsUri"]);t!==void 0&&i!=null&&ee(t,["parameters","storageUri"],i);const s=Q(e,["seed"]);t!==void 0&&s!=null&&ee(t,["parameters","seed"],s);const l=Q(e,["safetyFilterLevel"]);t!==void 0&&l!=null&&ee(t,["parameters","safetySetting"],l);const c=Q(e,["personGeneration"]);t!==void 0&&c!=null&&ee(t,["parameters","personGeneration"],c);const u=Q(e,["addWatermark"]);t!==void 0&&u!=null&&ee(t,["parameters","addWatermark"],u);const d=Q(e,["outputMimeType"]);t!==void 0&&d!=null&&ee(t,["parameters","outputOptions","mimeType"],d);const p=Q(e,["outputCompressionQuality"]);t!==void 0&&p!=null&&ee(t,["parameters","outputOptions","compressionQuality"],p);const h=Q(e,["enhancePrompt"]);t!==void 0&&h!=null&&ee(t,["parameters","enhancePrompt"],h);const m=Q(e,["labels"]);return t!==void 0&&m!=null&&ee(t,["labels"],m),n}function T9t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["source"]);o!=null&&M9t(o,n);const i=Q(t,["config"]);return i!=null&&A9t(i,n),n}function k9t(e){const t={},n=Q(e,["predictions"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(o=>nq(o))),ee(t,["generatedImages"],r)}return t}function M9t(e,t){const n={},r=Q(e,["prompt"]);t!==void 0&&r!=null&&ee(t,["instances[0]","prompt"],r);const o=Q(e,["personImage"]);t!==void 0&&o!=null&&ee(t,["instances[0]","personImage","image"],Ny(o));const i=Q(e,["productImages"]);if(t!==void 0&&i!=null){let s=i;Array.isArray(s)&&(s=s.map(l=>P9t(l))),ee(t,["instances[0]","productImages"],s)}return n}function R9t(e){const t={},n=Q(e,["referenceImage"]);n!=null&&ee(t,["referenceImage"],Ny(n));const r=Q(e,["referenceId"]);r!=null&&ee(t,["referenceId"],r);const o=Q(e,["referenceType"]);o!=null&&ee(t,["referenceType"],o);const i=Q(e,["maskImageConfig"]);i!=null&&ee(t,["maskImageConfig"],I9t(i));const s=Q(e,["controlImageConfig"]);s!=null&&ee(t,["controlImageConfig"],b7t(s));const l=Q(e,["styleImageConfig"]);l!=null&&ee(t,["styleImageConfig"],l);const c=Q(e,["subjectImageConfig"]);return c!=null&&ee(t,["subjectImageConfig"],c),t}function KYe(e){const t={},n=Q(e,["safetyAttributes","categories"]);n!=null&&ee(t,["categories"],n);const r=Q(e,["safetyAttributes","scores"]);r!=null&&ee(t,["scores"],r);const o=Q(e,["contentType"]);return o!=null&&ee(t,["contentType"],o),t}function YYe(e){const t={},n=Q(e,["safetyAttributes","categories"]);n!=null&&ee(t,["categories"],n);const r=Q(e,["safetyAttributes","scores"]);r!=null&&ee(t,["scores"],r);const o=Q(e,["contentType"]);return o!=null&&ee(t,["contentType"],o),t}function O9t(e){const t={},n=Q(e,["category"]);if(n!=null&&ee(t,["category"],n),Q(e,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const r=Q(e,["threshold"]);return r!=null&&ee(t,["threshold"],r),t}function $9t(e){const t={},n=Q(e,["image"]);return n!=null&&ee(t,["image"],Ny(n)),t}function D9t(e,t){const n={},r=Q(e,["mode"]);t!==void 0&&r!=null&&ee(t,["parameters","mode"],r);const o=Q(e,["maxPredictions"]);t!==void 0&&o!=null&&ee(t,["parameters","maxPredictions"],o);const i=Q(e,["confidenceThreshold"]);t!==void 0&&i!=null&&ee(t,["parameters","confidenceThreshold"],i);const s=Q(e,["maskDilation"]);t!==void 0&&s!=null&&ee(t,["parameters","maskDilation"],s);const l=Q(e,["binaryColorThreshold"]);t!==void 0&&l!=null&&ee(t,["parameters","binaryColorThreshold"],l);const c=Q(e,["labels"]);return t!==void 0&&c!=null&&ee(t,["labels"],c),n}function L9t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["source"]);o!=null&&z9t(o,n);const i=Q(t,["config"]);return i!=null&&D9t(i,n),n}function F9t(e){const t={},n=Q(e,["predictions"]);if(n!=null){let r=n;Array.isArray(r)&&(r=r.map(o=>u9t(o))),ee(t,["generatedMasks"],r)}return t}function z9t(e,t){const n={},r=Q(e,["prompt"]);t!==void 0&&r!=null&&ee(t,["instances[0]","prompt"],r);const o=Q(e,["image"]);t!==void 0&&o!=null&&ee(t,["instances[0]","image"],Ny(o));const i=Q(e,["scribbleImage"]);return t!==void 0&&i!=null&&ee(t,["instances[0]","scribble"],$9t(i)),n}function B9t(e){const t={},n=Q(e,["retrievalConfig"]);n!=null&&ee(t,["retrievalConfig"],n);const r=Q(e,["functionCallingConfig"]);return r!=null&&ee(t,["functionCallingConfig"],V7t(r)),t}function H9t(e){const t={};if(Q(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=Q(e,["computerUse"]);n!=null&&ee(t,["computerUse"],n);const r=Q(e,["fileSearch"]);r!=null&&ee(t,["fileSearch"],r);const o=Q(e,["codeExecution"]);if(o!=null&&ee(t,["codeExecution"],o),Q(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=Q(e,["functionDeclarations"]);if(i!=null){let d=i;Array.isArray(d)&&(d=d.map(p=>p)),ee(t,["functionDeclarations"],d)}const s=Q(e,["googleMaps"]);s!=null&&ee(t,["googleMaps"],g9t(s));const l=Q(e,["googleSearch"]);l!=null&&ee(t,["googleSearch"],x9t(l));const c=Q(e,["googleSearchRetrieval"]);c!=null&&ee(t,["googleSearchRetrieval"],c);const u=Q(e,["urlContext"]);return u!=null&&ee(t,["urlContext"],u),t}function XYe(e){const t={},n=Q(e,["retrieval"]);n!=null&&ee(t,["retrieval"],n);const r=Q(e,["computerUse"]);if(r!=null&&ee(t,["computerUse"],r),Q(e,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const o=Q(e,["codeExecution"]);o!=null&&ee(t,["codeExecution"],o);const i=Q(e,["enterpriseWebSearch"]);i!=null&&ee(t,["enterpriseWebSearch"],i);const s=Q(e,["functionDeclarations"]);if(s!=null){let p=s;Array.isArray(p)&&(p=p.map(h=>U7t(h))),ee(t,["functionDeclarations"],p)}const l=Q(e,["googleMaps"]);l!=null&&ee(t,["googleMaps"],l);const c=Q(e,["googleSearch"]);c!=null&&ee(t,["googleSearch"],c);const u=Q(e,["googleSearchRetrieval"]);u!=null&&ee(t,["googleSearchRetrieval"],u);const d=Q(e,["urlContext"]);return d!=null&&ee(t,["urlContext"],d),t}function V9t(e){const t={},n=Q(e,["baseModel"]);n!=null&&ee(t,["baseModel"],n);const r=Q(e,["createTime"]);r!=null&&ee(t,["createTime"],r);const o=Q(e,["updateTime"]);return o!=null&&ee(t,["updateTime"],o),t}function U9t(e){const t={},n=Q(e,["labels","google-vertex-llm-tuning-base-model-id"]);n!=null&&ee(t,["baseModel"],n);const r=Q(e,["createTime"]);r!=null&&ee(t,["createTime"],r);const o=Q(e,["updateTime"]);return o!=null&&ee(t,["updateTime"],o),t}function W9t(e,t){const n={},r=Q(e,["displayName"]);t!==void 0&&r!=null&&ee(t,["displayName"],r);const o=Q(e,["description"]);t!==void 0&&o!=null&&ee(t,["description"],o);const i=Q(e,["defaultCheckpointId"]);return t!==void 0&&i!=null&&ee(t,["defaultCheckpointId"],i),n}function G9t(e,t){const n={},r=Q(e,["displayName"]);t!==void 0&&r!=null&&ee(t,["displayName"],r);const o=Q(e,["description"]);t!==void 0&&o!=null&&ee(t,["description"],o);const i=Q(e,["defaultCheckpointId"]);return t!==void 0&&i!=null&&ee(t,["defaultCheckpointId"],i),n}function q9t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","name"],Xa(e,r));const o=Q(t,["config"]);return o!=null&&W9t(o,n),n}function K9t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["config"]);return o!=null&&G9t(o,n),n}function Y9t(e,t){const n={},r=Q(e,["outputGcsUri"]);t!==void 0&&r!=null&&ee(t,["parameters","storageUri"],r);const o=Q(e,["safetyFilterLevel"]);t!==void 0&&o!=null&&ee(t,["parameters","safetySetting"],o);const i=Q(e,["personGeneration"]);t!==void 0&&i!=null&&ee(t,["parameters","personGeneration"],i);const s=Q(e,["includeRaiReason"]);t!==void 0&&s!=null&&ee(t,["parameters","includeRaiReason"],s);const l=Q(e,["outputMimeType"]);t!==void 0&&l!=null&&ee(t,["parameters","outputOptions","mimeType"],l);const c=Q(e,["outputCompressionQuality"]);t!==void 0&&c!=null&&ee(t,["parameters","outputOptions","compressionQuality"],c);const u=Q(e,["enhanceInputImage"]);t!==void 0&&u!=null&&ee(t,["parameters","upscaleConfig","enhanceInputImage"],u);const d=Q(e,["imagePreservationFactor"]);t!==void 0&&d!=null&&ee(t,["parameters","upscaleConfig","imagePreservationFactor"],d);const p=Q(e,["labels"]);t!==void 0&&p!=null&&ee(t,["labels"],p);const h=Q(e,["numberOfImages"]);t!==void 0&&h!=null&&ee(t,["parameters","sampleCount"],h);const m=Q(e,["mode"]);return t!==void 0&&m!=null&&ee(t,["parameters","mode"],m),n}function X9t(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["_url","model"],Xa(e,r));const o=Q(t,["image"]);o!=null&&ee(n,["instances[0]","image"],Ny(o));const i=Q(t,["upscaleFactor"]);i!=null&&ee(n,["parameters","upscaleConfig","upscaleFactor"],i);const s=Q(t,["config"]);return s!=null&&Y9t(s,n),n}function Q9t(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["predictions"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(i=>nq(i))),ee(t,["generatedImages"],o)}return t}function J9t(e){const t={},n=Q(e,["uri"]);n!=null&&ee(t,["uri"],n);const r=Q(e,["encodedVideo"]);r!=null&&ee(t,["videoBytes"],QC(r));const o=Q(e,["encoding"]);return o!=null&&ee(t,["mimeType"],o),t}function Z9t(e){const t={},n=Q(e,["gcsUri"]);n!=null&&ee(t,["uri"],n);const r=Q(e,["bytesBase64Encoded"]);r!=null&&ee(t,["videoBytes"],QC(r));const o=Q(e,["mimeType"]);return o!=null&&ee(t,["mimeType"],o),t}function ezt(e){const t={},n=Q(e,["image"]);n!=null&&ee(t,["_self"],Ny(n));const r=Q(e,["maskMode"]);return r!=null&&ee(t,["maskMode"],r),t}function tzt(e){const t={},n=Q(e,["image"]);n!=null&&ee(t,["image"],rq(n));const r=Q(e,["referenceType"]);return r!=null&&ee(t,["referenceType"],r),t}function nzt(e){const t={},n=Q(e,["image"]);n!=null&&ee(t,["image"],Ny(n));const r=Q(e,["referenceType"]);return r!=null&&ee(t,["referenceType"],r),t}function QYe(e){const t={},n=Q(e,["uri"]);n!=null&&ee(t,["uri"],n);const r=Q(e,["videoBytes"]);r!=null&&ee(t,["encodedVideo"],QC(r));const o=Q(e,["mimeType"]);return o!=null&&ee(t,["encoding"],o),t}function JYe(e){const t={},n=Q(e,["uri"]);n!=null&&ee(t,["gcsUri"],n);const r=Q(e,["videoBytes"]);r!=null&&ee(t,["bytesBase64Encoded"],QC(r));const o=Q(e,["mimeType"]);return o!=null&&ee(t,["mimeType"],o),t}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function rzt(e,t){const n={},r=Q(e,["displayName"]);return t!==void 0&&r!=null&&ee(t,["displayName"],r),n}function ozt(e){const t={},n=Q(e,["config"]);return n!=null&&rzt(n,t),t}function izt(e,t){const n={},r=Q(e,["force"]);return t!==void 0&&r!=null&&ee(t,["_query","force"],r),n}function azt(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["_url","name"],n);const r=Q(e,["config"]);return r!=null&&izt(r,t),t}function szt(e){const t={},n=Q(e,["name"]);return n!=null&&ee(t,["_url","name"],n),t}function lzt(e,t){const n={},r=Q(e,["customMetadata"]);if(t!==void 0&&r!=null){let i=r;Array.isArray(i)&&(i=i.map(s=>s)),ee(t,["customMetadata"],i)}const o=Q(e,["chunkingConfig"]);return t!==void 0&&o!=null&&ee(t,["chunkingConfig"],o),n}function czt(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["name"],n);const r=Q(e,["metadata"]);r!=null&&ee(t,["metadata"],r);const o=Q(e,["done"]);o!=null&&ee(t,["done"],o);const i=Q(e,["error"]);i!=null&&ee(t,["error"],i);const s=Q(e,["response"]);return s!=null&&ee(t,["response"],dzt(s)),t}function uzt(e){const t={},n=Q(e,["fileSearchStoreName"]);n!=null&&ee(t,["_url","file_search_store_name"],n);const r=Q(e,["fileName"]);r!=null&&ee(t,["fileName"],r);const o=Q(e,["config"]);return o!=null&&lzt(o,t),t}function dzt(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["parent"]);r!=null&&ee(t,["parent"],r);const o=Q(e,["documentName"]);return o!=null&&ee(t,["documentName"],o),t}function fzt(e,t){const n={},r=Q(e,["pageSize"]);t!==void 0&&r!=null&&ee(t,["_query","pageSize"],r);const o=Q(e,["pageToken"]);return t!==void 0&&o!=null&&ee(t,["_query","pageToken"],o),n}function pzt(e){const t={},n=Q(e,["config"]);return n!=null&&fzt(n,t),t}function hzt(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["nextPageToken"]);r!=null&&ee(t,["nextPageToken"],r);const o=Q(e,["fileSearchStores"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>s)),ee(t,["fileSearchStores"],i)}return t}function ZYe(e,t){const n={},r=Q(e,["mimeType"]);t!==void 0&&r!=null&&ee(t,["mimeType"],r);const o=Q(e,["displayName"]);t!==void 0&&o!=null&&ee(t,["displayName"],o);const i=Q(e,["customMetadata"]);if(t!==void 0&&i!=null){let l=i;Array.isArray(l)&&(l=l.map(c=>c)),ee(t,["customMetadata"],l)}const s=Q(e,["chunkingConfig"]);return t!==void 0&&s!=null&&ee(t,["chunkingConfig"],s),n}function mzt(e){const t={},n=Q(e,["fileSearchStoreName"]);n!=null&&ee(t,["_url","file_search_store_name"],n);const r=Q(e,["config"]);return r!=null&&ZYe(r,t),t}function gzt(e){const t={},n=Q(e,["sdkHttpResponse"]);return n!=null&&ee(t,["sdkHttpResponse"],n),t}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */const xzt="Content-Type",yzt="X-Server-Timeout",vzt="User-Agent",zie="x-goog-api-client",bzt="1.38.0",wzt=`google-genai-sdk/${bzt}`,Szt="v1beta1",Czt="v1beta";class Nzt{constructor(t){var n,r,o;this.clientOptions=Object.assign({},t),this.customBaseUrl=(n=t.httpOptions)===null||n===void 0?void 0:n.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 l=t.project&&t.location||!!t.apiKey;this.customBaseUrl&&!l?(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=(r=this.clientOptions.apiVersion)!==null&&r!==void 0?r:Szt}else{if(!this.clientOptions.apiKey)throw new C3({message:"API key must be set when using the Gemini API.",status:403});i.apiVersion=(o=this.clientOptions.apiVersion)!==null&&o!==void 0?o:Czt,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 r=[t.baseUrl.endsWith("/")?t.baseUrl.slice(0,-1):t.baseUrl];return t.apiVersion&&t.apiVersion!==""&&r.push(t.apiVersion),r.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){const t=this.getBaseUrl(),n=new URL(t);return n.protocol=n.protocol=="http:"?"ws":"wss",n.toString()}setBaseUrl(t){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=t;else throw new Error("HTTP options are not correctly set.")}constructUrl(t,n,r){const o=[this.getRequestUrlInternal(n)];return r&&o.push(this.getBaseResourcePath()),t!==""&&o.push(t),new URL(`${o.join("/")}`)}shouldPrependVertexProjectPath(t,n){return!(n.baseUrl&&n.baseUrlResourceScope===Rie.COLLECTION||this.clientOptions.apiKey||!this.clientOptions.vertexai||t.path.startsWith("projects/")||t.httpMethod==="GET"&&t.path.startsWith("publishers/google/models"))}async request(t){let n=this.clientOptions.httpOptions;t.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,t.httpOptions));const r=this.shouldPrependVertexProjectPath(t,n),o=this.constructUrl(t.path,n,r);if(t.queryParams)for(const[s,l]of Object.entries(t.queryParams))o.searchParams.append(s,String(l));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,n,o.toString(),t.abortSignal),this.unaryApiCall(o,i,t.httpMethod)}patchHttpOptions(t,n){const r=JSON.parse(JSON.stringify(t));for(const[o,i]of Object.entries(n))typeof i=="object"?r[o]=Object.assign(Object.assign({},r[o]),i):i!==void 0&&(r[o]=i);return r}async requestStream(t){let n=this.clientOptions.httpOptions;t.httpOptions&&(n=this.patchHttpOptions(this.clientOptions.httpOptions,t.httpOptions));const r=this.shouldPrependVertexProjectPath(t,n),o=this.constructUrl(t.path,n,r);(!o.searchParams.has("alt")||o.searchParams.get("alt")!=="sse")&&o.searchParams.set("alt","sse");let i={};return i.body=t.body,i=await this.includeExtraHttpOptionsToRequestInit(i,n,o.toString(),t.abortSignal),this.streamApiCall(o,i,t.httpMethod)}async includeExtraHttpOptionsToRequestInit(t,n,r,o){if(n&&n.timeout||o){const i=new AbortController,s=i.signal;if(n.timeout&&(n==null?void 0:n.timeout)>0){const l=setTimeout(()=>i.abort(),n.timeout);l&&typeof l.unref=="function"&&l.unref()}o&&o.addEventListener("abort",()=>{i.abort()}),t.signal=s}return n&&n.extraBody!==null&&jzt(t,n.extraBody),t.headers=await this.getHeadersInternal(n,r),t}async unaryApiCall(t,n,r){return this.apiCall(t.toString(),Object.assign(Object.assign({},n),{method:r})).then(async o=>(await pEe(o),new Oie(o))).catch(o=>{throw o instanceof Error?o:new Error(JSON.stringify(o))})}async streamApiCall(t,n,r){return this.apiCall(t.toString(),Object.assign(Object.assign({},n),{method:r})).then(async o=>(await pEe(o),this.processStreamResponse(o))).catch(o=>{throw o instanceof Error?o:new Error(JSON.stringify(o))})}processStreamResponse(t){return Jx(this,arguments,function*(){var r;const o=(r=t==null?void 0:t.body)===null||r===void 0?void 0:r.getReader(),i=new TextDecoder("utf-8");if(!o)throw new Error("Response body is empty");try{let s="";const l="data:",c=[` `,"\r\r",`\r \r `];for(;;){const{done:u,value:d}=yield si(o.read());if(u){if(s.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}const p=i.decode(d,{stream:!0});try{const g=JSON.parse(p);if("error"in g){const y=JSON.parse(JSON.stringify(g.error)),x=y.status,v=y.code,b=`got status: ${x}. ${JSON.stringify(g)}`;if(v>=400&&v<600)throw new C3({message:b,status:v})}}catch(g){if(g.name==="ApiError")throw g}s+=p;let h=-1,m=0;for(;;){h=-1,m=0;for(const x of c){const v=s.indexOf(x);v!==-1&&(h===-1||v{throw new Error(`exception ${r} sending request`)})}getDefaultHeaders(){const t={},n=wzt+" "+this.clientOptions.userAgentExtra;return t[vzt]=n,t[zie]=n,t[xzt]="application/json",t}async getHeadersInternal(t,n){const r=new Headers;if(t&&t.headers){for(const[o,i]of Object.entries(t.headers))r.append(o,i);t.timeout&&t.timeout>0&&r.append(yzt,String(Math.ceil(t.timeout/1e3)))}return await this.clientOptions.auth.addAuthHeaders(r,n),r}getFileName(t){var n;let r="";return typeof t=="string"&&(r=t.replace(/[/\\]+$/,""),r=(n=r.split(/[/\\]/).pop())!==null&&n!==void 0?n:""),r}async uploadFile(t,n){var r;const o={};n!=null&&(o.mimeType=n.mimeType,o.name=n.name,o.displayName=n.displayName),o.name&&!o.name.startsWith("files/")&&(o.name=`files/${o.name}`);const i=this.clientOptions.uploader,s=await i.stat(t);o.sizeBytes=String(s.size);const l=(r=n==null?void 0:n.mimeType)!==null&&r!==void 0?r:s.type;if(l===void 0||l==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");o.mimeType=l;const c={file:o},u=this.getFileName(t),d=Lr("upload/v1beta/files",c._url),p=await this.fetchUploadUrl(d,o.sizeBytes,o.mimeType,u,c,n==null?void 0:n.httpOptions);return i.upload(t,p,this)}async uploadFileToFileSearchStore(t,n,r){var o;const i=this.clientOptions.uploader,s=await i.stat(n),l=String(s.size),c=(o=r==null?void 0:r.mimeType)!==null&&o!==void 0?o:s.type;if(c===void 0||c==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");const u=`upload/v1beta/${t}:uploadToFileSearchStore`,d=this.getFileName(n),p={};r!=null&&ZYe(r,p);const h=await this.fetchUploadUrl(u,l,c,d,p,r==null?void 0:r.httpOptions);return i.uploadToFileSearchStore(n,h,this)}async downloadFile(t){await this.clientOptions.downloader.download(t,this)}async fetchUploadUrl(t,n,r,o,i,s){var l;let c={};s?c=s:c={apiVersion:"",headers:Object.assign({"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${n}`,"X-Goog-Upload-Header-Content-Type":`${r}`},o?{"X-Goog-Upload-File-Name":o}:{})};const u=await this.request({path:t,body:JSON.stringify(i),httpMethod:"POST",httpOptions:c});if(!u||!(u!=null&&u.headers))throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");const d=(l=u==null?void 0:u.headers)===null||l===void 0?void 0:l["x-goog-upload-url"];if(d===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return d}}async function pEe(e){var t;if(e===void 0)throw new Error("response is undefined");if(!e.ok){const n=e.status;let r;!((t=e.headers.get("content-type"))===null||t===void 0)&&t.includes("application/json")?r=await e.json():r={error:{message:await e.text(),code:e.status,status:e.statusText}};const o=JSON.stringify(r);throw n>=400&&n<600?new C3({message:o,status:n}):new Error(o)}}function jzt(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 n={};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))n=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 r(i,s){const l=Object.assign({},i);for(const c in s)if(Object.prototype.hasOwnProperty.call(s,c)){const u=s[c],d=l[c];u&&typeof u=="object"&&!Array.isArray(u)&&d&&typeof d=="object"&&!Array.isArray(d)?l[c]=r(d,u):(d&&u&&typeof d!=typeof u&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${c}". Original type: ${typeof d}, New type: ${typeof u}. Overwriting.`),l[c]=u)}return l}const o=r(n,t);e.body=JSON.stringify(o)}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */const Ezt="mcp_used/unknown";let Izt=!1;function eXe(e){for(const t of e)if(_zt(t)||typeof t=="object"&&"inputSchema"in t)return!0;return Izt}function tXe(e){var t;const n=(t=e[zie])!==null&&t!==void 0?t:"";e[zie]=(n+` ${Ezt}`).trimStart()}function _zt(e){return e!==null&&typeof e=="object"&&e instanceof ege}function Pzt(e){return Jx(this,arguments,function*(n,r=100){let o,i=0;for(;i0)return;const i={},s=[];for(const d of this.mcpClients)try{for(var l=!0,c=(n=void 0,Zx(Pzt(d))),u;u=await c.next(),t=u.done,!t;l=!0){o=u.value,l=!1;const p=o;s.push(p);const h=p.name;if(i[h])throw new Error(`Duplicate function name ${h} found in MCP tools. Please ensure function names are unique.`);i[h]=d}}catch(p){n={error:p}}finally{try{!l&&!t&&(r=c.return)&&await r.call(c)}finally{if(n)throw n.error}}this.mcpTools=s,this.functionNameToMcpClient=i}async tool(){return await this.initialize(),a8t(this.mcpTools,this.config)}async callTool(t){await this.initialize();const n=[];for(const r of t)if(r.name in this.functionNameToMcpClient){const o=this.functionNameToMcpClient[r.name];let i;this.config.timeout&&(i={timeout:this.config.timeout});const s=await o.callTool({name:r.name,arguments:r.args},void 0,i);n.push({functionResponse:{name:r.name,response:s.isError?{error:s}:s}})}return n}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */async function Azt(e,t,n){const r=new J6t;let o;n.data instanceof Blob?o=JSON.parse(await n.data.text()):o=JSON.parse(n.data),Object.assign(r,o),t(r)}class Tzt{constructor(t,n,r){this.apiClient=t,this.auth=n,this.webSocketFactory=r}async connect(t){var n,r;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 o=this.apiClient.getWebsocketBaseUrl(),i=this.apiClient.getApiVersion(),s=Rzt(this.apiClient.getDefaultHeaders()),l=this.apiClient.getApiKey(),c=`${o}/ws/google.ai.generativelanguage.${i}.GenerativeService.BidiGenerateMusic?key=${l}`;let u=()=>{};const d=new Promise(w=>{u=w}),p=t.callbacks,h=function(){u({})},m=this.apiClient,g={onopen:h,onmessage:w=>{Azt(m,p.onmessage,w)},onerror:(n=p==null?void 0:p.onerror)!==null&&n!==void 0?n:function(w){},onclose:(r=p==null?void 0:p.onclose)!==null&&r!==void 0?r:function(w){}},y=this.webSocketFactory.create(c,Mzt(s),g);y.connect(),await d;const b={setup:{model:Xa(this.apiClient,t.model)}};return y.send(JSON.stringify(b)),new kzt(y,this.apiClient)}}class kzt{constructor(t,n){this.conn=t,this.apiClient=n}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 n=r7t(t);this.conn.send(JSON.stringify({clientContent:n}))}async setMusicGenerationConfig(t){t.musicGenerationConfig||(t.musicGenerationConfig={});const n=n7t(t);this.conn.send(JSON.stringify(n))}sendPlaybackControl(t){const n={playbackControl:t};this.conn.send(JSON.stringify(n))}play(){this.sendPlaybackControl(yP.PLAY)}pause(){this.sendPlaybackControl(yP.PAUSE)}stop(){this.sendPlaybackControl(yP.STOP)}resetContext(){this.sendPlaybackControl(yP.RESET_CONTEXT)}close(){this.conn.close()}}function Mzt(e){const t={};return e.forEach((n,r)=>{t[r]=n}),t}function Rzt(e){const t=new Headers;for(const[n,r]of Object.entries(e))t.append(n,r);return t}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */const Ozt="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function $zt(e,t,n){const r=new Q6t;let o;n.data instanceof Blob?o=await n.data.text():n.data instanceof ArrayBuffer?o=new TextDecoder().decode(n.data):o=n.data;const i=JSON.parse(o);if(e.isVertexAI()){const s=a7t(i);Object.assign(r,s)}else Object.assign(r,i);t(r)}class Dzt{constructor(t,n,r){this.apiClient=t,this.auth=n,this.webSocketFactory=r,this.music=new Tzt(this.apiClient,this.auth,this.webSocketFactory)}async connect(t){var n,r,o,i,s,l;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 c=this.apiClient.getWebsocketBaseUrl(),u=this.apiClient.getApiVersion();let d;const p=this.apiClient.getHeaders();t.config&&t.config.tools&&eXe(t.config.tools)&&tXe(p);const h=Bzt(p);if(this.apiClient.isVertexAI()){const _=this.apiClient.getProject(),T=this.apiClient.getLocation(),P=this.apiClient.getApiKey(),E=!!_&&!!T||!!P;this.apiClient.getCustomBaseUrl()&&!E?d=c:(d=`${c}/ws/google.cloud.aiplatform.${u}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(h,d))}else{const _=this.apiClient.getApiKey();let T="BidiGenerateContent",P="key";_!=null&&_.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."),T="BidiGenerateContentConstrained",P="access_token"),d=`${c}/ws/google.ai.generativelanguage.${u}.GenerativeService.${T}?${P}=${_}`}let m=()=>{};const g=new Promise(_=>{m=_}),y=t.callbacks,x=function(){var _;(_=y==null?void 0:y.onopen)===null||_===void 0||_.call(y),m({})},v=this.apiClient,b={onopen:x,onmessage:_=>{$zt(v,y.onmessage,_)},onerror:(n=y==null?void 0:y.onerror)!==null&&n!==void 0?n:function(_){},onclose:(r=y==null?void 0:y.onclose)!==null&&r!==void 0?r:function(_){}},w=this.webSocketFactory.create(d,zzt(h),b);w.connect(),await g;let S=Xa(this.apiClient,t.model);if(this.apiClient.isVertexAI()&&S.startsWith("publishers/")){const _=this.apiClient.getProject(),T=this.apiClient.getLocation();_&&T&&(S=`projects/${_}/locations/${T}/`+S)}let C={};this.apiClient.isVertexAI()&&((o=t.config)===null||o===void 0?void 0:o.responseModalities)===void 0&&(t.config===void 0?t.config={responseModalities:[LH.AUDIO]}:t.config.responseModalities=[LH.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 N=(l=(s=t.config)===null||s===void 0?void 0:s.tools)!==null&&l!==void 0?l:[],j=[];for(const _ of N)if(this.isCallableTool(_)){const T=_;j.push(await T.tool())}else j.push(_);j.length>0&&(t.config.tools=j);const I={model:S,config:t.config,callbacks:t.callbacks};return this.apiClient.isVertexAI()?C=t7t(this.apiClient,I):C=e7t(this.apiClient,I),delete C.config,w.send(JSON.stringify(C)),new Fzt(w,this.apiClient)}isCallableTool(t){return"callTool"in t&&typeof t.callTool=="function"}}const Lzt={turnComplete:!0};class Fzt{constructor(t,n){this.conn=t,this.apiClient=n}tLiveClientContent(t,n){if(n.turns!==null&&n.turns!==void 0){let r=[];try{r=b0(n.turns),t.isVertexAI()||(r=r.map(o=>tq(o)))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof n.turns}'`)}return{clientContent:{turns:r,turnComplete:n.turnComplete}}}return{clientContent:{turnComplete:n.turnComplete}}}tLiveClienttToolResponse(t,n){let r=[];if(n.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(n.functionResponses)?r=n.functionResponses:r=[n.functionResponses],r.length===0)throw new Error("functionResponses is required.");for(const i of r){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(Ozt)}return{toolResponse:{functionResponses:r}}}sendClientContent(t){t=Object.assign(Object.assign({},Lzt),t);const n=this.tLiveClientContent(this.apiClient,t);this.conn.send(JSON.stringify(n))}sendRealtimeInput(t){let n={};this.apiClient.isVertexAI()?n={realtimeInput:i7t(t)}:n={realtimeInput:o7t(t)},this.conn.send(JSON.stringify(n))}sendToolResponse(t){if(t.functionResponses==null)throw new Error("Tool response parameters are required.");const n=this.tLiveClienttToolResponse(this.apiClient,t);this.conn.send(JSON.stringify(n))}close(){this.conn.close()}}function zzt(e){const t={};return e.forEach((n,r)=>{t[r]=n}),t}function Bzt(e){const t=new Headers;for(const[n,r]of Object.entries(e))t.append(n,r);return t}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */const hEe=10;function mEe(e){var t,n,r;if(!((t=e==null?void 0:e.automaticFunctionCalling)===null||t===void 0)&&t.disable)return!0;let o=!1;for(const s of(n=e==null?void 0:e.tools)!==null&&n!==void 0?n:[])if(aA(s)){o=!0;break}if(!o)return!0;const i=(r=e==null?void 0:e.automaticFunctionCalling)===null||r===void 0?void 0:r.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 aA(e){return"callTool"in e&&typeof e.callTool=="function"}function Hzt(e){var t,n,r;return(r=(n=(t=e.config)===null||t===void 0?void 0:t.tools)===null||n===void 0?void 0:n.some(o=>aA(o)))!==null&&r!==void 0?r:!1}function gEe(e){var t;const n=[];return!((t=e==null?void 0:e.config)===null||t===void 0)&&t.tools&&e.config.tools.forEach((r,o)=>{if(aA(r))return;const i=r;i.functionDeclarations&&i.functionDeclarations.length>0&&n.push(o)}),n}function xEe(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 Vzt extends zw{constructor(t){super(),this.apiClient=t,this.generateContent=async n=>{var r,o,i,s,l;const c=await this.processParamsMaybeAddMcpUsage(n);if(this.maybeMoveToResponseJsonSchem(n),!Hzt(n)||mEe(n.config))return await this.generateContentInternal(c);const u=gEe(n);if(u.length>0){const y=u.map(x=>`tools[${x}]`).join(", ");throw new Error(`Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations is not yet supported. Incompatible tools found at ${y}.`)}let d,p;const h=b0(c.contents),m=(i=(o=(r=c.config)===null||r===void 0?void 0:r.automaticFunctionCalling)===null||o===void 0?void 0:o.maximumRemoteCalls)!==null&&i!==void 0?i:hEe;let g=0;for(;g{var r,o,i,s,l;if(this.maybeMoveToResponseJsonSchem(n),mEe(n.config)){const p=await this.processParamsMaybeAddMcpUsage(n);return await this.generateContentStreamInternal(p)}const c=gEe(n);if(c.length>0){const p=c.map(h=>`tools[${h}]`).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=(o=(r=n==null?void 0:n.config)===null||r===void 0?void 0:r.toolConfig)===null||o===void 0?void 0:o.functionCallingConfig)===null||i===void 0?void 0:i.streamFunctionCallArguments,d=(l=(s=n==null?void 0:n.config)===null||s===void 0?void 0:s.automaticFunctionCalling)===null||l===void 0?void 0:l.disable;if(u&&!d)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(n)},this.generateImages=async n=>await this.generateImagesInternal(n).then(r=>{var o;let i;const s=[];if(r!=null&&r.generatedImages)for(const c of r.generatedImages)c&&(c!=null&&c.safetyAttributes)&&((o=c==null?void 0:c.safetyAttributes)===null||o===void 0?void 0:o.contentType)==="Positive Prompt"?i=c==null?void 0:c.safetyAttributes:s.push(c);let l;return i?l={generatedImages:s,positivePromptSafetyAttributes:i,sdkHttpResponse:r.sdkHttpResponse}:l={generatedImages:s,sdkHttpResponse:r.sdkHttpResponse},l}),this.list=async n=>{var r;const s={config:Object.assign(Object.assign({},{queryBase:!0}),n==null?void 0:n.config)};if(this.apiClient.isVertexAI()&&!s.config.queryBase){if(!((r=s.config)===null||r===void 0)&&r.filter)throw new Error("Filtering tuned models list for Vertex AI is not currently supported");s.config.filter="labels.tune-type:*"}return new JI(uw.PAGED_ITEM_MODELS,l=>this.listInternal(l),await this.listInternal(s),s)},this.editImage=async n=>{const r={model:n.model,prompt:n.prompt,referenceImages:[],config:n.config};return n.referenceImages&&n.referenceImages&&(r.referenceImages=n.referenceImages.map(o=>o.toReferenceImageAPI())),await this.editImageInternal(r)},this.upscaleImage=async n=>{let r={numberOfImages:1,mode:"upscale"};n.config&&(r=Object.assign(Object.assign({},r),n.config));const o={model:n.model,image:n.image,upscaleFactor:n.upscaleFactor,config:r};return await this.upscaleImageInternal(o)},this.generateVideos=async n=>{var r,o,i,s,l,c;if((n.prompt||n.image||n.video)&&n.source)throw new Error("Source and prompt/image/video are mutually exclusive. Please only use source.");return this.apiClient.isVertexAI()||(!((r=n.video)===null||r===void 0)&&r.uri&&(!((o=n.video)===null||o===void 0)&&o.videoBytes)?n.video={uri:n.video.uri,mimeType:n.video.mimeType}:!((s=(i=n.source)===null||i===void 0?void 0:i.video)===null||s===void 0)&&s.uri&&(!((c=(l=n.source)===null||l===void 0?void 0:l.video)===null||c===void 0)&&c.videoBytes)&&(n.source.video={uri:n.source.video.uri,mimeType:n.source.video.mimeType})),await this.generateVideosInternal(n)}}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 n,r,o;const i=(n=t.config)===null||n===void 0?void 0:n.tools;if(!i)return t;const s=await Promise.all(i.map(async c=>aA(c)?await c.tool():c)),l={model:t.model,contents:t.contents,config:Object.assign(Object.assign({},t.config),{tools:s})};if(l.config.tools=s,t.config&&t.config.tools&&eXe(t.config.tools)){const c=(o=(r=t.config.httpOptions)===null||r===void 0?void 0:r.headers)!==null&&o!==void 0?o:{};let u=Object.assign({},c);Object.keys(u).length===0&&(u=this.apiClient.getDefaultHeaders()),tXe(u),l.config.httpOptions=Object.assign(Object.assign({},t.config.httpOptions),{headers:u})}return l}async initAfcToolsMap(t){var n,r,o;const i=new Map;for(const s of(r=(n=t.config)===null||n===void 0?void 0:n.tools)!==null&&r!==void 0?r:[])if(aA(s)){const l=s,c=await l.tool();for(const u of(o=c.functionDeclarations)!==null&&o!==void 0?o:[]){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,l)}}return i}async processAfcStream(t){var n,r,o;const i=(o=(r=(n=t.config)===null||n===void 0?void 0:n.automaticFunctionCalling)===null||r===void 0?void 0:r.maximumRemoteCalls)!==null&&o!==void 0?o:hEe;let s=!1,l=0;const c=await this.initAfcToolsMap(t);return(function(u,d,p){return Jx(this,arguments,function*(){for(var h,m,g,y,x,v;l0){s=!0;const _=new K4;_.candidates=[{content:{role:"user",parts:j}}],yield yield si(_);const T=[];T.push(...I),T.push({role:"user",parts:j});const P=b0(p.contents).concat(T);p.contents=P}else break}})})(this,c,t)}async generateContentInternal(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=uEe(this.apiClient,t);return l=Lr("{model}:generateContent",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=fEe(d),h=new K4;return Object.assign(h,p),h})}else{const u=cEe(this.apiClient,t);return l=Lr("{model}:generateContent",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=dEe(d),h=new K4;return Object.assign(h,p),h})}}async generateContentStreamInternal(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=uEe(this.apiClient,t);return l=Lr("{model}:streamGenerateContent?alt=sse",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.requestStream({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}),s.then(function(p){return Jx(this,arguments,function*(){var h,m,g,y;try{for(var x=!0,v=Zx(p),b;b=yield si(v.next()),h=b.done,!h;x=!0){y=b.value,x=!1;const w=y,S=fEe(yield si(w.json()));S.sdkHttpResponse={headers:w.headers};const C=new K4;Object.assign(C,S),yield yield si(C)}}catch(w){m={error:w}}finally{try{!x&&!h&&(g=v.return)&&(yield si(g.call(v)))}finally{if(m)throw m.error}}})})}else{const u=cEe(this.apiClient,t);return l=Lr("{model}:streamGenerateContent?alt=sse",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.requestStream({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}),s.then(function(p){return Jx(this,arguments,function*(){var h,m,g,y;try{for(var x=!0,v=Zx(p),b;b=yield si(v.next()),h=b.done,!h;x=!0){y=b.value,x=!1;const w=y,S=dEe(yield si(w.json()));S.sdkHttpResponse={headers:w.headers};const C=new K4;Object.assign(C,S),yield yield si(C)}}catch(w){m={error:w}}finally{try{!x&&!h&&(g=v.return)&&(yield si(g.call(v)))}finally{if(m)throw m.error}}})})}}async embedContent(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=D7t(this.apiClient,t);return l=Lr("{model}:predict",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=F7t(d),h=new Gje;return Object.assign(h,p),h})}else{const u=$7t(this.apiClient,t);return l=Lr("{model}:batchEmbedContents",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=L7t(d),h=new Gje;return Object.assign(h,p),h})}}async generateImagesInternal(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=X7t(this.apiClient,t);return l=Lr("{model}:predict",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=J7t(d),h=new qje;return Object.assign(h,p),h})}else{const u=Y7t(this.apiClient,t);return l=Lr("{model}:predict",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=Q7t(d),h=new qje;return Object.assign(h,p),h})}}async editImageInternal(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI()){const l=k7t(this.apiClient,t);return i=Lr("{model}:predict",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:c.headers},d})),o.then(c=>{const u=M7t(c),d=new z6t;return Object.assign(d,u),d})}else throw new Error("This method is only supported by the Vertex AI.")}async upscaleImageInternal(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI()){const l=X9t(this.apiClient,t);return i=Lr("{model}:predict",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:c.headers},d})),o.then(c=>{const u=Q9t(c),d=new B6t;return Object.assign(d,u),d})}else throw new Error("This method is only supported by the Vertex AI.")}async recontextImage(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI()){const l=T9t(this.apiClient,t);return i=Lr("{model}:predict",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o.then(c=>{const u=k9t(c),d=new H6t;return Object.assign(d,u),d})}else throw new Error("This method is only supported by the Vertex AI.")}async segmentImage(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI()){const l=L9t(this.apiClient,t);return i=Lr("{model}:predict",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o.then(c=>{const u=F9t(c),d=new V6t;return Object.assign(d,u),d})}else throw new Error("This method is only supported by the Vertex AI.")}async get(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=m9t(this.apiClient,t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json()),s.then(d=>Fie(d))}else{const u=h9t(this.apiClient,t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),s.then(d=>Lie(d))}}async listInternal(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=N9t(this.apiClient,t);return l=Lr("{models_url}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=E9t(d),h=new Kje;return Object.assign(h,p),h})}else{const u=C9t(this.apiClient,t);return l=Lr("{models_url}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=j9t(d),h=new Kje;return Object.assign(h,p),h})}}async update(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=K9t(this.apiClient,t);return l=Lr("{model}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json()),s.then(d=>Fie(d))}else{const u=q9t(this.apiClient,t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"PATCH",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),s.then(d=>Lie(d))}}async delete(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=_7t(this.apiClient,t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=A7t(d),h=new Yje;return Object.assign(h,p),h})}else{const u=I7t(this.apiClient,t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"DELETE",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=P7t(d),h=new Yje;return Object.assign(h,p),h})}}async countTokens(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=N7t(this.apiClient,t);return l=Lr("{model}:countTokens",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=E7t(d),h=new Xje;return Object.assign(h,p),h})}else{const u=C7t(this.apiClient,t);return l=Lr("{model}:countTokens",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=j7t(d),h=new Xje;return Object.assign(h,p),h})}}async computeTokens(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI()){const l=g7t(this.apiClient,t);return i=Lr("{model}:computeTokens",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:c.headers},d})),o.then(c=>{const u=x7t(c),d=new U6t;return Object.assign(d,u),d})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideosInternal(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=o9t(this.apiClient,t);return l=Lr("{model}:predictLongRunning",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json()),s.then(d=>{const p=n9t(d),h=new FH;return Object.assign(h,p),h})}else{const u=r9t(this.apiClient,t);return l=Lr("{model}:predictLongRunning",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),s.then(d=>{const p=t9t(d),h=new FH;return Object.assign(h,p),h})}}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class Uzt extends zw{constructor(t){super(),this.apiClient=t}async getVideosOperation(t){const n=t.operation,r=t.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const o=n.name.split("/operations/")[0];let i;r&&"httpOptions"in r&&(i=r.httpOptions);const s=await this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:o,config:{httpOptions:i}});return n._fromAPIResponse({apiResponse:s,_isVertexAI:!0})}else{const o=await this.getVideosOperationInternal({operationName:n.name,config:r});return n._fromAPIResponse({apiResponse:o,_isVertexAI:!1})}}async get(t){const n=t.operation,r=t.config;if(n.name===void 0||n.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const o=n.name.split("/operations/")[0];let i;r&&"httpOptions"in r&&(i=r.httpOptions);const s=await this.fetchPredictVideosOperationInternal({operationName:n.name,resourceName:o,config:{httpOptions:i}});return n._fromAPIResponse({apiResponse:s,_isVertexAI:!0})}else{const o=await this.getVideosOperationInternal({operationName:n.name,config:r});return n._fromAPIResponse({apiResponse:o,_isVertexAI:!1})}}async getVideosOperationInternal(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=R6t(t);return l=Lr("{operationName}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json()),s}else{const u=M6t(t);return l=Lr("{operationName}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json()),s}}async fetchPredictVideosOperationInternal(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI()){const l=E6t(t);return i=Lr("{resourceName}:fetchPredictOperation",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o}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 Wzt(e){const t={},n=Q(e,["data"]);if(n!=null&&ee(t,["data"],n),Q(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const r=Q(e,["mimeType"]);return r!=null&&ee(t,["mimeType"],r),t}function Gzt(e){const t={},n=Q(e,["parts"]);if(n!=null){let o=n;Array.isArray(o)&&(o=o.map(i=>tBt(i))),ee(t,["parts"],o)}const r=Q(e,["role"]);return r!=null&&ee(t,["role"],r),t}function qzt(e,t,n){const r={},o=Q(t,["expireTime"]);n!==void 0&&o!=null&&ee(n,["expireTime"],o);const i=Q(t,["newSessionExpireTime"]);n!==void 0&&i!=null&&ee(n,["newSessionExpireTime"],i);const s=Q(t,["uses"]);n!==void 0&&s!=null&&ee(n,["uses"],s);const l=Q(t,["liveConnectConstraints"]);n!==void 0&&l!=null&&ee(n,["bidiGenerateContentSetup"],eBt(e,l));const c=Q(t,["lockAdditionalFields"]);return n!==void 0&&c!=null&&ee(n,["fieldMask"],c),r}function Kzt(e,t){const n={},r=Q(t,["config"]);return r!=null&&ee(n,["config"],qzt(e,r,n)),n}function Yzt(e){const t={};if(Q(e,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const n=Q(e,["fileUri"]);n!=null&&ee(t,["fileUri"],n);const r=Q(e,["mimeType"]);return r!=null&&ee(t,["mimeType"],r),t}function Xzt(e){const t={},n=Q(e,["id"]);n!=null&&ee(t,["id"],n);const r=Q(e,["args"]);r!=null&&ee(t,["args"],r);const o=Q(e,["name"]);if(o!=null&&ee(t,["name"],o),Q(e,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(Q(e,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function Qzt(e){const t={};if(Q(e,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const n=Q(e,["enableWidget"]);return n!=null&&ee(t,["enableWidget"],n),t}function Jzt(e){const t={};if(Q(e,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(Q(e,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const n=Q(e,["timeRangeFilter"]);return n!=null&&ee(t,["timeRangeFilter"],n),t}function Zzt(e,t){const n={},r=Q(e,["generationConfig"]);t!==void 0&&r!=null&&ee(t,["setup","generationConfig"],r);const o=Q(e,["responseModalities"]);t!==void 0&&o!=null&&ee(t,["setup","generationConfig","responseModalities"],o);const i=Q(e,["temperature"]);t!==void 0&&i!=null&&ee(t,["setup","generationConfig","temperature"],i);const s=Q(e,["topP"]);t!==void 0&&s!=null&&ee(t,["setup","generationConfig","topP"],s);const l=Q(e,["topK"]);t!==void 0&&l!=null&&ee(t,["setup","generationConfig","topK"],l);const c=Q(e,["maxOutputTokens"]);t!==void 0&&c!=null&&ee(t,["setup","generationConfig","maxOutputTokens"],c);const u=Q(e,["mediaResolution"]);t!==void 0&&u!=null&&ee(t,["setup","generationConfig","mediaResolution"],u);const d=Q(e,["seed"]);t!==void 0&&d!=null&&ee(t,["setup","generationConfig","seed"],d);const p=Q(e,["speechConfig"]);t!==void 0&&p!=null&&ee(t,["setup","generationConfig","speechConfig"],Zme(p));const h=Q(e,["thinkingConfig"]);t!==void 0&&h!=null&&ee(t,["setup","generationConfig","thinkingConfig"],h);const m=Q(e,["enableAffectiveDialog"]);t!==void 0&&m!=null&&ee(t,["setup","generationConfig","enableAffectiveDialog"],m);const g=Q(e,["systemInstruction"]);t!==void 0&&g!=null&&ee(t,["setup","systemInstruction"],Gzt(Np(g)));const y=Q(e,["tools"]);if(t!==void 0&&y!=null){let N=hk(y);Array.isArray(N)&&(N=N.map(j=>rBt(pk(j)))),ee(t,["setup","tools"],N)}const x=Q(e,["sessionResumption"]);t!==void 0&&x!=null&&ee(t,["setup","sessionResumption"],nBt(x));const v=Q(e,["inputAudioTranscription"]);t!==void 0&&v!=null&&ee(t,["setup","inputAudioTranscription"],v);const b=Q(e,["outputAudioTranscription"]);t!==void 0&&b!=null&&ee(t,["setup","outputAudioTranscription"],b);const w=Q(e,["realtimeInputConfig"]);t!==void 0&&w!=null&&ee(t,["setup","realtimeInputConfig"],w);const S=Q(e,["contextWindowCompression"]);t!==void 0&&S!=null&&ee(t,["setup","contextWindowCompression"],S);const C=Q(e,["proactivity"]);if(t!==void 0&&C!=null&&ee(t,["setup","proactivity"],C),Q(e,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return n}function eBt(e,t){const n={},r=Q(t,["model"]);r!=null&&ee(n,["setup","model"],Xa(e,r));const o=Q(t,["config"]);return o!=null&&ee(n,["config"],Zzt(o,n)),n}function tBt(e){const t={},n=Q(e,["mediaResolution"]);n!=null&&ee(t,["mediaResolution"],n);const r=Q(e,["codeExecutionResult"]);r!=null&&ee(t,["codeExecutionResult"],r);const o=Q(e,["executableCode"]);o!=null&&ee(t,["executableCode"],o);const i=Q(e,["fileData"]);i!=null&&ee(t,["fileData"],Yzt(i));const s=Q(e,["functionCall"]);s!=null&&ee(t,["functionCall"],Xzt(s));const l=Q(e,["functionResponse"]);l!=null&&ee(t,["functionResponse"],l);const c=Q(e,["inlineData"]);c!=null&&ee(t,["inlineData"],Wzt(c));const u=Q(e,["text"]);u!=null&&ee(t,["text"],u);const d=Q(e,["thought"]);d!=null&&ee(t,["thought"],d);const p=Q(e,["thoughtSignature"]);p!=null&&ee(t,["thoughtSignature"],p);const h=Q(e,["videoMetadata"]);return h!=null&&ee(t,["videoMetadata"],h),t}function nBt(e){const t={},n=Q(e,["handle"]);if(n!=null&&ee(t,["handle"],n),Q(e,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function rBt(e){const t={};if(Q(e,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const n=Q(e,["computerUse"]);n!=null&&ee(t,["computerUse"],n);const r=Q(e,["fileSearch"]);r!=null&&ee(t,["fileSearch"],r);const o=Q(e,["codeExecution"]);if(o!=null&&ee(t,["codeExecution"],o),Q(e,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const i=Q(e,["functionDeclarations"]);if(i!=null){let d=i;Array.isArray(d)&&(d=d.map(p=>p)),ee(t,["functionDeclarations"],d)}const s=Q(e,["googleMaps"]);s!=null&&ee(t,["googleMaps"],Qzt(s));const l=Q(e,["googleSearch"]);l!=null&&ee(t,["googleSearch"],Jzt(l));const c=Q(e,["googleSearchRetrieval"]);c!=null&&ee(t,["googleSearchRetrieval"],c);const u=Q(e,["urlContext"]);return u!=null&&ee(t,["urlContext"],u),t}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function oBt(e){const t=[];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const r=e[n];if(typeof r=="object"&&r!=null&&Object.keys(r).length>0){const o=Object.keys(r).map(i=>`${n}.${i}`);t.push(...o)}else t.push(n)}return t.join(",")}function iBt(e,t){let n=null;const r=e.bidiGenerateContentSetup;if(typeof r=="object"&&r!==null&&"setup"in r){const i=r.setup;typeof i=="object"&&i!==null?(e.bidiGenerateContentSetup=i,n=i):delete e.bidiGenerateContentSetup}else r!==void 0&&delete e.bidiGenerateContentSetup;const o=e.fieldMask;if(n){const i=oBt(n);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&&o!==null&&Array.isArray(o)&&o.length>0){const s=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"];let l=[];o.length>0&&(l=o.map(u=>s.includes(u)?`generationConfig.${u}`:u));const c=[];i&&c.push(i),l.length>0&&c.push(...l),c.length>0?e.fieldMask=c.join(","):delete e.fieldMask}else delete e.fieldMask}else o!==null&&Array.isArray(o)&&o.length>0?e.fieldMask=o.join(","):delete e.fieldMask;return e}class aBt extends zw{constructor(t){super(),this.apiClient=t}async create(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{const l=Kzt(this.apiClient,t);i=Lr("auth_tokens",l._url),s=l._query,delete l.config,delete l._url,delete l._query;const c=iBt(l,t.config);return o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(c),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(u=>u.json()),o.then(u=>u)}}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function sBt(e,t){const n={},r=Q(e,["force"]);return t!==void 0&&r!=null&&ee(t,["_query","force"],r),n}function lBt(e){const t={},n=Q(e,["name"]);n!=null&&ee(t,["_url","name"],n);const r=Q(e,["config"]);return r!=null&&sBt(r,t),t}function cBt(e){const t={},n=Q(e,["name"]);return n!=null&&ee(t,["_url","name"],n),t}function uBt(e,t){const n={},r=Q(e,["pageSize"]);t!==void 0&&r!=null&&ee(t,["_query","pageSize"],r);const o=Q(e,["pageToken"]);return t!==void 0&&o!=null&&ee(t,["_query","pageToken"],o),n}function dBt(e){const t={},n=Q(e,["parent"]);n!=null&&ee(t,["_url","parent"],n);const r=Q(e,["config"]);return r!=null&&uBt(r,t),t}function fBt(e){const t={},n=Q(e,["sdkHttpResponse"]);n!=null&&ee(t,["sdkHttpResponse"],n);const r=Q(e,["nextPageToken"]);r!=null&&ee(t,["nextPageToken"],r);const o=Q(e,["documents"]);if(o!=null){let i=o;Array.isArray(i)&&(i=i.map(s=>s)),ee(t,["documents"],i)}return t}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class pBt extends zw{constructor(t){super(),this.apiClient=t,this.list=async n=>new JI(uw.PAGED_ITEM_DOCUMENTS,r=>this.listInternal({parent:n.parent,config:r.config}),await this.listInternal(n),n)}async get(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=cBt(t);return i=Lr("{name}",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o.then(c=>c)}}async delete(t){var n,r;let o="",i={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const s=lBt(t);o=Lr("{name}",s._url),i=s._query,delete s._url,delete s._query,await this.apiClient.request({path:o,queryParams:i,body:JSON.stringify(s),httpMethod:"DELETE",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal})}}async listInternal(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=dBt(t);return i=Lr("{parent}/documents",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o.then(c=>{const u=fBt(c),d=new W6t;return Object.assign(d,u),d})}}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class hBt extends zw{constructor(t,n=new pBt(t)){super(),this.apiClient=t,this.documents=n,this.list=async(r={})=>new JI(uw.PAGED_ITEM_FILE_SEARCH_STORES,o=>this.listInternal(o),await this.listInternal(r),r)}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 n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=ozt(t);return i=Lr("fileSearchStores",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o.then(c=>c)}}async get(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=szt(t);return i=Lr("{name}",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o.then(c=>c)}}async delete(t){var n,r;let o="",i={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const s=azt(t);o=Lr("{name}",s._url),i=s._query,delete s._url,delete s._query,await this.apiClient.request({path:o,queryParams:i,body:JSON.stringify(s),httpMethod:"DELETE",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal})}}async listInternal(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=pzt(t);return i=Lr("fileSearchStores",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o.then(c=>{const u=hzt(c),d=new G6t;return Object.assign(d,u),d})}}async uploadToFileSearchStoreInternal(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=mzt(t);return i=Lr("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o.then(c=>{const u=gzt(c),d=new q6t;return Object.assign(d,u),d})}}async importFile(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=uzt(t);return i=Lr("{file_search_store_name}:importFile",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json()),o.then(c=>{const u=czt(c),d=new Kme;return Object.assign(d,u),d})}}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */let nXe=function(){const{crypto:e}=globalThis;if(e!=null&&e.randomUUID)return nXe=e.randomUUID.bind(e),e.randomUUID();const t=new Uint8Array(1),n=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,r=>(+r^n()&15>>+r/4).toString(16))};const mBt=()=>nXe();/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function Bie(e){return typeof e=="object"&&e!==null&&("name"in e&&e.name==="AbortError"||"message"in e&&String(e.message).includes("FetchRequestCanceledException"))}const Hie=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 k0 extends Error{}class Nh extends k0{constructor(t,n,r,o){super(`${Nh.makeMessage(t,n,r)}`),this.status=t,this.headers=o,this.error=n}static makeMessage(t,n,r){const o=n!=null&&n.message?typeof n.message=="string"?n.message:JSON.stringify(n.message):n?JSON.stringify(n):r;return t&&o?`${t} ${o}`:t?`${t} status code (no body)`:o||"(no status code or body)"}static generate(t,n,r,o){if(!t||!o)return new oq({message:r,cause:Hie(n)});const i=n;return t===400?new oXe(t,i,r,o):t===401?new iXe(t,i,r,o):t===403?new aXe(t,i,r,o):t===404?new sXe(t,i,r,o):t===409?new lXe(t,i,r,o):t===422?new cXe(t,i,r,o):t===429?new uXe(t,i,r,o):t>=500?new dXe(t,i,r,o):new Nh(t,i,r,o)}}class Vie extends Nh{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}}class oq extends Nh{constructor({message:t,cause:n}){super(void 0,void 0,t||"Connection error.",void 0),n&&(this.cause=n)}}class rXe extends oq{constructor({message:t}={}){super({message:t??"Request timed out."})}}class oXe extends Nh{}class iXe extends Nh{}class aXe extends Nh{}class sXe extends Nh{}class lXe extends Nh{}class cXe extends Nh{}class uXe extends Nh{}class dXe extends Nh{}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */const gBt=/^[a-z][a-z0-9+.-]*:/i,xBt=e=>gBt.test(e);let Uie=e=>(Uie=Array.isArray,Uie(e));const yBt=Uie;let vBt=yBt;const yEe=vBt;function bBt(e){if(!e)return!0;for(const t in e)return!1;return!0}function wBt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const SBt=(e,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new k0(`${e} must be an integer`);if(t<0)throw new k0(`${e} must be a positive integer`);return t},CBt=e=>{try{return JSON.parse(e)}catch{return}};/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */const NBt=e=>new Promise(t=>setTimeout(t,e));/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */const tP="0.0.1";/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function jBt(){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 EBt=()=>{var e,t,n,r,o;const i=jBt();if(i==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":tP,"X-Stainless-OS":bEe(Deno.build.os),"X-Stainless-Arch":vEe(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":tP,"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":tP,"X-Stainless-OS":bEe((n=globalThis.process.platform)!==null&&n!==void 0?n:"unknown"),"X-Stainless-Arch":vEe((r=globalThis.process.arch)!==null&&r!==void 0?r:"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":(o=globalThis.process.version)!==null&&o!==void 0?o:"unknown"};const s=IBt();return s?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":tP,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${s.browser}`,"X-Stainless-Runtime-Version":s.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":tP,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function IBt(){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:n}of e){const r=n.exec(navigator.userAgent);if(r){const o=r[1]||0,i=r[2]||0,s=r[3]||0;return{browser:t,version:`${o}.${i}.${s}`}}}return null}const vEe=e=>e==="x32"?"x32":e==="x86_64"||e==="x64"?"x64":e==="arm"?"arm":e==="aarch64"||e==="arm64"?"arm64":e?`other:${e}`:"unknown",bEe=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 G8;const _Bt=()=>G8??(G8=EBt());/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function PBt(){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 fXe(...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 ABt(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return fXe({start(){},async pull(n){const{done:r,value:o}=await t.next();r?n.close():n.enqueue(o)},async cancel(){var n;await((n=t.return)===null||n===void 0?void 0:n.call(t))}})}function pXe(e){if(e[Symbol.asyncIterator])return e;const t=e.getReader();return{async next(){try{const n=await t.read();return n!=null&&n.done&&t.releaseLock(),n}catch(n){throw t.releaseLock(),n}},async return(){const n=t.cancel();return t.releaseLock(),await n,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function TBt(e){var t,n;if(e===null||typeof e!="object")return;if(e[Symbol.asyncIterator]){await((n=(t=e[Symbol.asyncIterator]()).return)===null||n===void 0?void 0:n.call(t));return}const r=e.getReader(),o=r.cancel();r.releaseLock(),await o}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */const kBt=({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 hXe=()=>{var e;if(typeof File>"u"){const{process:t}=globalThis,n=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."+(n?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function oJ(e,t,n){return hXe(),new File(e,t??"unknown_file",n)}function MBt(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 RBt=e=>e!=null&&typeof e=="object"&&typeof e[Symbol.asyncIterator]=="function";/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */const mXe=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",OBt=e=>e!=null&&typeof e=="object"&&typeof e.name=="string"&&typeof e.lastModified=="number"&&mXe(e),$Bt=e=>e!=null&&typeof e=="object"&&typeof e.url=="string"&&typeof e.blob=="function";async function DBt(e,t,n){if(hXe(),e=await e,OBt(e))return e instanceof File?e:oJ([await e.arrayBuffer()],e.name);if($Bt(e)){const o=await e.blob();return t||(t=new URL(e.url).pathname.split(/[\\/]/).pop()),oJ(await Wie(o),t,n)}const r=await Wie(e);if(t||(t=MBt(e)),!(n!=null&&n.type)){const o=r.find(i=>typeof i=="object"&&"type"in i&&i.type);typeof o=="string"&&(n=Object.assign(Object.assign({},n),{type:o}))}return oJ(r,t,n)}async function Wie(e){var t,n,r,o,i;let s=[];if(typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer)s.push(e);else if(mXe(e))s.push(e instanceof Blob?e:await e.arrayBuffer());else if(RBt(e))try{for(var l=!0,c=Zx(e),u;u=await c.next(),t=u.done,!t;l=!0){o=u.value,l=!1;const d=o;s.push(...await Wie(d))}}catch(d){n={error:d}}finally{try{!l&&!t&&(r=c.return)&&await r.call(c)}finally{if(n)throw n.error}}else{const d=(i=e==null?void 0:e.constructor)===null||i===void 0?void 0:i.name;throw new Error(`Unexpected data type: ${typeof e}${d?`; constructor: ${d}`:""}${LBt(e)}`)}return s}function LBt(e){return typeof e!="object"||e===null?"":`; props: [${Object.getOwnPropertyNames(e).map(n=>`"${n}"`).join(", ")}]`}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class gXe{constructor(t){this._client=t}}gXe._key=[];/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function xXe(e){return e.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const wEe=Object.freeze(Object.create(null)),FBt=(e=xXe)=>(function(n,...r){if(n.length===1)return n[0];let o=!1;const i=[],s=n.reduce((d,p,h)=>{var m,g,y;/[?#]/.test(p)&&(o=!0);const x=r[h];let v=(o?encodeURIComponent:e)(""+x);return h!==r.length&&(x==null||typeof x=="object"&&x.toString===((y=Object.getPrototypeOf((g=Object.getPrototypeOf((m=x.hasOwnProperty)!==null&&m!==void 0?m:wEe))!==null&&g!==void 0?g:wEe))===null||y===void 0?void 0:y.toString))&&(v=x+"",i.push({start:d.length+p.length,length:v.length,error:`Value of type ${Object.prototype.toString.call(x).slice(8,-1)} is not a valid path parameter`})),d+p+(h===r.length?"":v)},""),l=s.split(/[?#]/,1)[0],c=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let u;for(;(u=c.exec(l))!==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((d,p)=>d.start-p.start),i.length>0){let d=0;const p=i.reduce((h,m)=>{const g=" ".repeat(m.start-d),y="^".repeat(m.length);return d=m.start+m.length,h+g+y},"");throw new k0(`Path parameters result in path with invalid segments: ${i.map(h=>h.error).join(` `)} ${s} ${p}`)}return s}),q8=FBt(xXe);/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class yXe extends gXe{create(t,n){var r;const{api_version:o=this._client.apiVersion}=t,i=BH(t,["api_version"]);if("model"in i&&"agent_config"in i)throw new k0("Invalid request: specified `model` and `agent_config`. If specifying `model`, use `generation_config`.");if("agent"in i&&"generation_config"in i)throw new k0("Invalid request: specified `agent` and `generation_config`. If specifying `agent`, use `agent_config`.");return this._client.post(q8`/${o}/interactions`,Object.assign(Object.assign({body:i},n),{stream:(r=t.stream)!==null&&r!==void 0?r:!1}))}delete(t,n={},r){const{api_version:o=this._client.apiVersion}=n??{};return this._client.delete(q8`/${o}/interactions/${t}`,r)}cancel(t,n={},r){const{api_version:o=this._client.apiVersion}=n??{};return this._client.post(q8`/${o}/interactions/${t}/cancel`,r)}get(t,n={},r){var o;const i=n??{},{api_version:s=this._client.apiVersion}=i,l=BH(i,["api_version"]);return this._client.get(q8`/${s}/interactions/${t}`,Object.assign(Object.assign({query:l},r),{stream:(o=n==null?void 0:n.stream)!==null&&o!==void 0?o:!1}))}}yXe._key=Object.freeze(["interactions"]);class vXe extends yXe{}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function zBt(e){let t=0;for(const o of e)t+=o.length;const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return n}let K8;function tge(e){let t;return(K8??(t=new globalThis.TextEncoder,K8=t.encode.bind(t)))(e)}let Y8;function SEe(e){let t;return(Y8??(t=new globalThis.TextDecoder,Y8=t.decode.bind(t)))(e)}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class iq{constructor(){this.buffer=new Uint8Array,this.carriageReturnIndex=null}decode(t){if(t==null)return[];const n=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?tge(t):t;this.buffer=zBt([this.buffer,n]);const r=[];let o;for(;(o=BBt(this.buffer,this.carriageReturnIndex))!=null;){if(o.carriage&&this.carriageReturnIndex==null){this.carriageReturnIndex=o.index;continue}if(this.carriageReturnIndex!=null&&(o.index!==this.carriageReturnIndex+1||o.carriage)){r.push(SEe(this.buffer.subarray(0,this.carriageReturnIndex-1))),this.buffer=this.buffer.subarray(this.carriageReturnIndex),this.carriageReturnIndex=null;continue}const i=this.carriageReturnIndex!==null?o.preceding-1:o.preceding,s=SEe(this.buffer.subarray(0,i));r.push(s),this.buffer=this.buffer.subarray(o.index),this.carriageReturnIndex=null}return r}flush(){return this.buffer.length?this.decode(` `):[]}}iq.NEWLINE_CHARS=new Set([` `,"\r"]);iq.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function BBt(e,t){for(let o=t??0;o{if(e){if(wBt(HH,e))return e;rh(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(HH))}`)}};function pR(){}function X8(e,t,n){return!t||HH[e]>HH[n]?pR:t[e].bind(t)}const VBt={error:pR,warn:pR,info:pR,debug:pR};let NEe=new WeakMap;function rh(e){var t;const n=e.logger,r=(t=e.logLevel)!==null&&t!==void 0?t:"off";if(!n)return VBt;const o=NEe.get(n);if(o&&o[0]===r)return o[1];const i={error:X8("error",n,r),warn:X8("warn",n,r),info:X8("info",n,r),debug:X8("debug",n,r)};return NEe.set(n,[r,i]),i}const hj=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,n])=>[t,t.toLowerCase()==="x-goog-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":n]))),"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 vP{constructor(t,n,r){this.iterator=t,this.controller=n,this.client=r}static fromSSEResponse(t,n,r){let o=!1;const i=r?rh(r):console;function s(){return Jx(this,arguments,function*(){var c,u,d,p;if(o)throw new k0("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let h=!1;try{try{for(var m=!0,g=Zx(UBt(t,n)),y;y=yield si(g.next()),c=y.done,!c;m=!0){p=y.value,m=!1;const x=p;if(!h)if(x.data.startsWith("[DONE]")){h=!0;continue}else try{yield yield si(JSON.parse(x.data))}catch(v){throw i.error("Could not parse message into JSON:",x.data),i.error("From chunk:",x.raw),v}}}catch(x){u={error:x}}finally{try{!m&&!c&&(d=g.return)&&(yield si(d.call(g)))}finally{if(u)throw u.error}}h=!0}catch(x){if(Bie(x))return yield si(void 0);throw x}finally{h||n.abort()}})}return new vP(s,n,r)}static fromReadableStream(t,n,r){let o=!1;function i(){return Jx(this,arguments,function*(){var c,u,d,p;const h=new iq,m=pXe(t);try{for(var g=!0,y=Zx(m),x;x=yield si(y.next()),c=x.done,!c;g=!0){p=x.value,g=!1;const v=p;for(const b of h.decode(v))yield yield si(b)}}catch(v){u={error:v}}finally{try{!g&&!c&&(d=y.return)&&(yield si(d.call(y)))}finally{if(u)throw u.error}}for(const v of h.flush())yield yield si(v)})}function s(){return Jx(this,arguments,function*(){var c,u,d,p;if(o)throw new k0("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let h=!1;try{try{for(var m=!0,g=Zx(i()),y;y=yield si(g.next()),c=y.done,!c;m=!0){p=y.value,m=!1;const x=p;h||x&&(yield yield si(JSON.parse(x)))}}catch(x){u={error:x}}finally{try{!m&&!c&&(d=g.return)&&(yield si(d.call(g)))}finally{if(u)throw u.error}}h=!0}catch(x){if(Bie(x))return yield si(void 0);throw x}finally{h||n.abort()}})}return new vP(s,n,r)}[Symbol.asyncIterator](){return this.iterator()}tee(){const t=[],n=[],r=this.iterator(),o=i=>({next:()=>{if(i.length===0){const s=r.next();t.push(s),n.push(s)}return i.shift()}});return[new vP(()=>o(t),this.controller,this.client),new vP(()=>o(n),this.controller,this.client)]}toReadableStream(){const t=this;let n;return fXe({async start(){n=t[Symbol.asyncIterator]()},async pull(r){try{const{value:o,done:i}=await n.next();if(i)return r.close();const s=tge(JSON.stringify(o)+` `);r.enqueue(s)}catch(o){r.error(o)}},async cancel(){var r;await((r=n.return)===null||r===void 0?void 0:r.call(n))}})}}function UBt(e,t){return Jx(this,arguments,function*(){var r,o,i,s;if(!e.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new k0("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 k0("Attempted to iterate over a response with no body");const l=new GBt,c=new iq,u=pXe(e.body);try{for(var d=!0,p=Zx(WBt(u)),h;h=yield si(p.next()),r=h.done,!r;d=!0){s=h.value,d=!1;const m=s;for(const g of c.decode(m)){const y=l.decode(g);y&&(yield yield si(y))}}}catch(m){o={error:m}}finally{try{!d&&!r&&(i=p.return)&&(yield si(i.call(p)))}finally{if(o)throw o.error}}for(const m of c.flush()){const g=l.decode(m);g&&(yield yield si(g))}})}function WBt(e){return Jx(this,arguments,function*(){var n,r,o,i;let s=new Uint8Array;try{for(var l=!0,c=Zx(e),u;u=yield si(c.next()),n=u.done,!n;l=!0){i=u.value,l=!1;const d=i;if(d==null)continue;const p=d instanceof ArrayBuffer?new Uint8Array(d):typeof d=="string"?tge(d):d;let h=new Uint8Array(s.length+p.length);h.set(s),h.set(p,s.length),s=h;let m;for(;(m=HBt(s))!==-1;)yield yield si(s.slice(0,m)),s=s.slice(m)}}catch(d){r={error:d}}finally{try{!l&&!n&&(o=c.return)&&(yield si(o.call(c)))}finally{if(r)throw r.error}}s.length>0&&(yield yield si(s))})}class GBt{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[n,r,o]=qBt(t,":");return o.startsWith(" ")&&(o=o.substring(1)),n==="event"?this.event=o:n==="data"&&this.data.push(o),null}}function qBt(e,t){const n=e.indexOf(t);return n!==-1?[e.substring(0,n),t,e.substring(n+t.length)]:[e,"",""]}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */async function KBt(e,t){const{response:n,requestLogID:r,retryOfRequestLogID:o,startTime:i}=t,s=await(async()=>{var l;if(t.options.stream)return rh(e).debug("response",n.status,n.url,n.headers,n.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(n,t.controller,e):vP.fromSSEResponse(n,t.controller,e);if(n.status===204)return null;if(t.options.__binaryResponse)return n;const c=n.headers.get("content-type"),u=(l=c==null?void 0:c.split(";")[0])===null||l===void 0?void 0:l.trim();return(u==null?void 0:u.includes("application/json"))||(u==null?void 0:u.endsWith("+json"))?await n.json():await n.text()})();return rh(e).debug(`[${r}] response parsed`,hj({retryOfRequestLogID:o,url:n.url,status:n.status,body:s,durationMs:Date.now()-i})),s}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class nge extends Promise{constructor(t,n,r=KBt){super(o=>{o(null)}),this.responsePromise=n,this.parseResponse=r,this.client=t}_thenUnwrap(t){return new nge(this.client,this.responsePromise,async(n,r)=>t(await this.parseResponse(n,r),r))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){const[t,n]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:n}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(this.client,t))),this.parsedPromise}then(t,n){return this.parse().then(t,n)}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 bXe=Symbol("brand.privateNullableHeaders");function*YBt(e){if(!e)return;if(bXe in e){const{values:r,nulls:o}=e;yield*r.entries();for(const i of o)yield[i,null];return}let t=!1,n;e instanceof Headers?n=e.entries():yEe(e)?n=e:(t=!0,n=Object.entries(e??{}));for(let r of n){const o=r[0];if(typeof o!="string")throw new TypeError("expected header name to be a string");const i=yEe(r[1])?r[1]:[r[1]];let s=!1;for(const l of i)l!==void 0&&(t&&!s&&(s=!0,yield[o,null]),yield[o,l])}}const Y4=e=>{const t=new Headers,n=new Set;for(const r of e){const o=new Set;for(const[i,s]of YBt(r)){const l=i.toLowerCase();o.has(l)||(t.delete(i),o.add(l)),s===null?(t.delete(i),n.add(l)):(t.append(i,s),n.delete(l))}}return{[bXe]:!0,values:t,nulls:n}};/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */const iJ=e=>{var t,n,r,o,i,s;if(typeof globalThis.process<"u")return(r=(n=(t=b6t)===null||t===void 0?void 0:t[e])===null||n===void 0?void 0:n.trim())!==null&&r!==void 0?r:void 0;if(typeof globalThis.Deno<"u")return(s=(i=(o=globalThis.Deno.env)===null||o===void 0?void 0:o.get)===null||i===void 0?void 0:i.call(o,e))===null||s===void 0?void 0:s.trim()};/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */var wXe;class aq{constructor(t){var n,r,o,i,s,l,c,{baseURL:u=iJ("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:d=(n=iJ("GEMINI_API_KEY"))!==null&&n!==void 0?n:null,apiVersion:p="v1beta"}=t,h=BH(t,["baseURL","apiKey","apiVersion"]);const m=Object.assign(Object.assign({apiKey:d,apiVersion:p},h),{baseURL:u||"https://generativelanguage.googleapis.com"});this.baseURL=m.baseURL,this.timeout=(r=m.timeout)!==null&&r!==void 0?r:aq.DEFAULT_TIMEOUT,this.logger=(o=m.logger)!==null&&o!==void 0?o:console;const g="warn";this.logLevel=g,this.logLevel=(s=(i=CEe(m.logLevel,"ClientOptions.logLevel",this))!==null&&i!==void 0?i:CEe(iJ("GEMINI_NEXT_GEN_API_LOG"),"process.env['GEMINI_NEXT_GEN_API_LOG']",this))!==null&&s!==void 0?s:g,this.fetchOptions=m.fetchOptions,this.maxRetries=(l=m.maxRetries)!==null&&l!==void 0?l:2,this.fetch=(c=m.fetch)!==null&&c!==void 0?c:PBt(),this.encoder=kBt,this._options=m,this.apiKey=d,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:n}){if(!(t.has("authorization")||t.has("x-goog-api-key"))&&!(this.apiKey&&t.get("x-goog-api-key"))&&!n.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 n=Y4([t.headers]);if(!(n.values.has("authorization")||n.values.has("x-goog-api-key"))){if(this.apiKey)return Y4([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return Y4([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(t){return Object.entries(t).filter(([n,r])=>typeof r<"u").map(([n,r])=>{if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")return`${encodeURIComponent(n)}=${encodeURIComponent(r)}`;if(r===null)return`${encodeURIComponent(n)}=`;throw new k0(`Cannot stringify type ${typeof r}; 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 ${tP}`}defaultIdempotencyKey(){return`stainless-node-retry-${mBt()}`}makeStatusError(t,n,r,o){return Nh.generate(t,n,r,o)}buildURL(t,n,r){const o=!this.baseURLOverridden()&&r||this.baseURL,i=xBt(t)?new URL(t):new URL(o+(o.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),s=this.defaultQuery();return bBt(s)||(n=Object.assign(Object.assign({},s),n)),typeof n=="object"&&n&&!Array.isArray(n)&&(i.search=this.stringifyQuery(n)),i.toString()}async prepareOptions(t){if(this.clientAdapter&&this.clientAdapter.isVertexAI()&&!t.path.startsWith(`/${this.apiVersion}/projects/`)){const n=t.path.slice(this.apiVersion.length+1);t.path=`/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${n}`}}async prepareRequest(t,{url:n,options:r}){}get(t,n){return this.methodRequest("get",t,n)}post(t,n){return this.methodRequest("post",t,n)}patch(t,n){return this.methodRequest("patch",t,n)}put(t,n){return this.methodRequest("put",t,n)}delete(t,n){return this.methodRequest("delete",t,n)}methodRequest(t,n,r){return this.request(Promise.resolve(r).then(o=>Object.assign({method:t,path:n},o)))}request(t,n=null){return new nge(this,this.makeRequest(t,n,void 0))}async makeRequest(t,n,r){var o,i,s;const l=await t,c=(o=l.maxRetries)!==null&&o!==void 0?o:this.maxRetries;n==null&&(n=c),await this.prepareOptions(l);const{req:u,url:d,timeout:p}=await this.buildRequest(l,{retryCount:c-n});await this.prepareRequest(u,{url:d,options:l});const h="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),m=r===void 0?"":`, retryOf: ${r}`,g=Date.now();if(rh(this).debug(`[${h}] sending request`,hj({retryOfRequestLogID:r,method:l.method,url:d,options:l,headers:u.headers})),!((i=l.signal)===null||i===void 0)&&i.aborted)throw new Vie;const y=new AbortController,x=await this.fetchWithTimeout(d,u,p,y).catch(Hie),v=Date.now();if(x instanceof globalThis.Error){const w=`retrying, ${n} attempts remaining`;if(!((s=l.signal)===null||s===void 0)&&s.aborted)throw new Vie;const S=Bie(x)||/timed? ?out/i.test(String(x)+("cause"in x?String(x.cause):""));if(n)return rh(this).info(`[${h}] connection ${S?"timed out":"failed"} - ${w}`),rh(this).debug(`[${h}] connection ${S?"timed out":"failed"} (${w})`,hj({retryOfRequestLogID:r,url:d,durationMs:v-g,message:x.message})),this.retryRequest(l,n,r??h);throw rh(this).info(`[${h}] connection ${S?"timed out":"failed"} - error; no more retries left`),rh(this).debug(`[${h}] connection ${S?"timed out":"failed"} (error; no more retries left)`,hj({retryOfRequestLogID:r,url:d,durationMs:v-g,message:x.message})),S?new rXe:new oq({cause:x})}const b=`[${h}${m}] ${u.method} ${d} ${x.ok?"succeeded":"failed"} with status ${x.status} in ${v-g}ms`;if(!x.ok){const w=await this.shouldRetry(x);if(n&&w){const _=`retrying, ${n} attempts remaining`;return await TBt(x.body),rh(this).info(`${b} - ${_}`),rh(this).debug(`[${h}] response error (${_})`,hj({retryOfRequestLogID:r,url:x.url,status:x.status,headers:x.headers,durationMs:v-g})),this.retryRequest(l,n,r??h,x.headers)}const S=w?"error; no more retries left":"error; not retryable";rh(this).info(`${b} - ${S}`);const C=await x.text().catch(_=>Hie(_).message),N=CBt(C),j=N?void 0:C;throw rh(this).debug(`[${h}] response error (${S})`,hj({retryOfRequestLogID:r,url:x.url,status:x.status,headers:x.headers,message:j,durationMs:Date.now()-g})),this.makeStatusError(x.status,N,j,x.headers)}return rh(this).info(b),rh(this).debug(`[${h}] response start`,hj({retryOfRequestLogID:r,url:x.url,status:x.status,headers:x.headers,durationMs:v-g})),{response:x,options:l,controller:y,requestLogID:h,retryOfRequestLogID:r,startTime:g}}async fetchWithTimeout(t,n,r,o){const i=n||{},{signal:s,method:l}=i,c=BH(i,["signal","method"]);s&&s.addEventListener("abort",()=>o.abort());const u=setTimeout(()=>o.abort(),r),d=globalThis.ReadableStream&&c.body instanceof globalThis.ReadableStream||typeof c.body=="object"&&c.body!==null&&Symbol.asyncIterator in c.body,p=Object.assign(Object.assign(Object.assign({signal:o.signal},d?{duplex:"half"}:{}),{method:"GET"}),c);l&&(p.method=l.toUpperCase());try{return await this.fetch.call(void 0,t,p)}finally{clearTimeout(u)}}async shouldRetry(t){const n=t.headers.get("x-should-retry");return n==="true"?!0:n==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,n,r,o){var i;let s;const l=o==null?void 0:o.get("retry-after-ms");if(l){const u=parseFloat(l);Number.isNaN(u)||(s=u)}const c=o==null?void 0:o.get("retry-after");if(c&&!s){const u=parseFloat(c);Number.isNaN(u)?s=Date.parse(c)-Date.now():s=u*1e3}if(!(s&&0<=s&&s<60*1e3)){const u=(i=t.maxRetries)!==null&&i!==void 0?i:this.maxRetries;s=this.calculateDefaultRetryTimeoutMillis(n,u)}return await NBt(s),this.makeRequest(t,n-1,r)}calculateDefaultRetryTimeoutMillis(t,n){const i=n-t,s=Math.min(.5*Math.pow(2,i),8),l=1-Math.random()*.25;return s*l*1e3}async buildRequest(t,{retryCount:n=0}={}){var r,o,i;const s=Object.assign({},t),{method:l,path:c,query:u,defaultBaseURL:d}=s,p=this.buildURL(c,u,d);"timeout"in s&&SBt("timeout",s.timeout),s.timeout=(r=s.timeout)!==null&&r!==void 0?r:this.timeout;const{bodyHeaders:h,body:m}=this.buildBody({options:s}),g=await this.buildHeaders({options:t,method:l,bodyHeaders:h,retryCount:n});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:l,headers:g},s.signal&&{signal:s.signal}),globalThis.ReadableStream&&m instanceof globalThis.ReadableStream&&{duplex:"half"}),m&&{body:m}),(o=this.fetchOptions)!==null&&o!==void 0?o:{}),(i=s.fetchOptions)!==null&&i!==void 0?i:{}),url:p,timeout:s.timeout}}async buildHeaders({options:t,method:n,bodyHeaders:r,retryCount:o}){let i={};this.idempotencyHeader&&n!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=t.idempotencyKey);const s=await this.authHeaders(t);let l=Y4([i,Object.assign(Object.assign({Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o)},t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{}),_Bt()),this._options.defaultHeaders,r,t.headers,s]);return this.validateHeaders(l),l.values}buildBody({options:{body:t,headers:n}}){if(!t)return{bodyHeaders:void 0,body:void 0};const r=Y4([n]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&r.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:ABt(t)}:this.encoder({body:t,headers:r})}}aq.DEFAULT_TIMEOUT=6e4;class yf extends aq{constructor(){super(...arguments),this.interactions=new vXe(this)}}wXe=yf;yf.GeminiNextGenAPIClient=wXe;yf.GeminiNextGenAPIClientError=k0;yf.APIError=Nh;yf.APIConnectionError=oq;yf.APIConnectionTimeoutError=rXe;yf.APIUserAbortError=Vie;yf.NotFoundError=sXe;yf.ConflictError=lXe;yf.RateLimitError=uXe;yf.BadRequestError=oXe;yf.AuthenticationError=iXe;yf.InternalServerError=dXe;yf.PermissionDeniedError=aXe;yf.UnprocessableEntityError=cXe;yf.toFile=DBt;yf.Interactions=vXe;/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */function XBt(e,t){const n={},r=Q(e,["name"]);return r!=null&&ee(n,["_url","name"],r),n}function QBt(e,t){const n={},r=Q(e,["name"]);return r!=null&&ee(n,["_url","name"],r),n}function JBt(e,t){const n={},r=Q(e,["sdkHttpResponse"]);return r!=null&&ee(n,["sdkHttpResponse"],r),n}function ZBt(e,t){const n={},r=Q(e,["sdkHttpResponse"]);return r!=null&&ee(n,["sdkHttpResponse"],r),n}function eHt(e,t,n){const r={};if(Q(e,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is not supported in Gemini API.");const o=Q(e,["tunedModelDisplayName"]);if(t!==void 0&&o!=null&&ee(t,["displayName"],o),Q(e,["description"])!==void 0)throw new Error("description parameter is not supported in Gemini API.");const i=Q(e,["epochCount"]);t!==void 0&&i!=null&&ee(t,["tuningTask","hyperparameters","epochCount"],i);const s=Q(e,["learningRateMultiplier"]);if(s!=null&&ee(r,["tuningTask","hyperparameters","learningRateMultiplier"],s),Q(e,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");if(Q(e,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is not supported in Gemini API.");if(Q(e,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is not supported in Gemini API.");const l=Q(e,["batchSize"]);t!==void 0&&l!=null&&ee(t,["tuningTask","hyperparameters","batchSize"],l);const c=Q(e,["learningRate"]);if(t!==void 0&&c!=null&&ee(t,["tuningTask","hyperparameters","learningRate"],c),Q(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");if(Q(e,["beta"])!==void 0)throw new Error("beta parameter is not supported in Gemini API.");return r}function tHt(e,t,n){const r={};let o=Q(n,["config","method"]);if(o===void 0&&(o="SUPERVISED_FINE_TUNING"),o==="SUPERVISED_FINE_TUNING"){const m=Q(e,["validationDataset"]);t!==void 0&&m!=null&&ee(t,["supervisedTuningSpec"],jEe(m))}else if(o==="PREFERENCE_TUNING"){const m=Q(e,["validationDataset"]);t!==void 0&&m!=null&&ee(t,["preferenceOptimizationSpec"],jEe(m))}const i=Q(e,["tunedModelDisplayName"]);t!==void 0&&i!=null&&ee(t,["tunedModelDisplayName"],i);const s=Q(e,["description"]);t!==void 0&&s!=null&&ee(t,["description"],s);let l=Q(n,["config","method"]);if(l===void 0&&(l="SUPERVISED_FINE_TUNING"),l==="SUPERVISED_FINE_TUNING"){const m=Q(e,["epochCount"]);t!==void 0&&m!=null&&ee(t,["supervisedTuningSpec","hyperParameters","epochCount"],m)}else if(l==="PREFERENCE_TUNING"){const m=Q(e,["epochCount"]);t!==void 0&&m!=null&&ee(t,["preferenceOptimizationSpec","hyperParameters","epochCount"],m)}let c=Q(n,["config","method"]);if(c===void 0&&(c="SUPERVISED_FINE_TUNING"),c==="SUPERVISED_FINE_TUNING"){const m=Q(e,["learningRateMultiplier"]);t!==void 0&&m!=null&&ee(t,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],m)}else if(c==="PREFERENCE_TUNING"){const m=Q(e,["learningRateMultiplier"]);t!==void 0&&m!=null&&ee(t,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],m)}let u=Q(n,["config","method"]);if(u===void 0&&(u="SUPERVISED_FINE_TUNING"),u==="SUPERVISED_FINE_TUNING"){const m=Q(e,["exportLastCheckpointOnly"]);t!==void 0&&m!=null&&ee(t,["supervisedTuningSpec","exportLastCheckpointOnly"],m)}else if(u==="PREFERENCE_TUNING"){const m=Q(e,["exportLastCheckpointOnly"]);t!==void 0&&m!=null&&ee(t,["preferenceOptimizationSpec","exportLastCheckpointOnly"],m)}let d=Q(n,["config","method"]);if(d===void 0&&(d="SUPERVISED_FINE_TUNING"),d==="SUPERVISED_FINE_TUNING"){const m=Q(e,["adapterSize"]);t!==void 0&&m!=null&&ee(t,["supervisedTuningSpec","hyperParameters","adapterSize"],m)}else if(d==="PREFERENCE_TUNING"){const m=Q(e,["adapterSize"]);t!==void 0&&m!=null&&ee(t,["preferenceOptimizationSpec","hyperParameters","adapterSize"],m)}if(Q(e,["batchSize"])!==void 0)throw new Error("batchSize parameter is not supported in Vertex AI.");if(Q(e,["learningRate"])!==void 0)throw new Error("learningRate parameter is not supported in Vertex AI.");const p=Q(e,["labels"]);t!==void 0&&p!=null&&ee(t,["labels"],p);const h=Q(e,["beta"]);return t!==void 0&&h!=null&&ee(t,["preferenceOptimizationSpec","hyperParameters","beta"],h),r}function nHt(e,t){const n={},r=Q(e,["baseModel"]);r!=null&&ee(n,["baseModel"],r);const o=Q(e,["preTunedModel"]);o!=null&&ee(n,["preTunedModel"],o);const i=Q(e,["trainingDataset"]);i!=null&&pHt(i);const s=Q(e,["config"]);return s!=null&&eHt(s,n),n}function rHt(e,t){const n={},r=Q(e,["baseModel"]);r!=null&&ee(n,["baseModel"],r);const o=Q(e,["preTunedModel"]);o!=null&&ee(n,["preTunedModel"],o);const i=Q(e,["trainingDataset"]);i!=null&&hHt(i,n,t);const s=Q(e,["config"]);return s!=null&&tHt(s,n,t),n}function oHt(e,t){const n={},r=Q(e,["name"]);return r!=null&&ee(n,["_url","name"],r),n}function iHt(e,t){const n={},r=Q(e,["name"]);return r!=null&&ee(n,["_url","name"],r),n}function aHt(e,t,n){const r={},o=Q(e,["pageSize"]);t!==void 0&&o!=null&&ee(t,["_query","pageSize"],o);const i=Q(e,["pageToken"]);t!==void 0&&i!=null&&ee(t,["_query","pageToken"],i);const s=Q(e,["filter"]);return t!==void 0&&s!=null&&ee(t,["_query","filter"],s),r}function sHt(e,t,n){const r={},o=Q(e,["pageSize"]);t!==void 0&&o!=null&&ee(t,["_query","pageSize"],o);const i=Q(e,["pageToken"]);t!==void 0&&i!=null&&ee(t,["_query","pageToken"],i);const s=Q(e,["filter"]);return t!==void 0&&s!=null&&ee(t,["_query","filter"],s),r}function lHt(e,t){const n={},r=Q(e,["config"]);return r!=null&&aHt(r,n),n}function cHt(e,t){const n={},r=Q(e,["config"]);return r!=null&&sHt(r,n),n}function uHt(e,t){const n={},r=Q(e,["sdkHttpResponse"]);r!=null&&ee(n,["sdkHttpResponse"],r);const o=Q(e,["nextPageToken"]);o!=null&&ee(n,["nextPageToken"],o);const i=Q(e,["tunedModels"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(l=>SXe(l))),ee(n,["tuningJobs"],s)}return n}function dHt(e,t){const n={},r=Q(e,["sdkHttpResponse"]);r!=null&&ee(n,["sdkHttpResponse"],r);const o=Q(e,["nextPageToken"]);o!=null&&ee(n,["nextPageToken"],o);const i=Q(e,["tuningJobs"]);if(i!=null){let s=i;Array.isArray(s)&&(s=s.map(l=>Gie(l))),ee(n,["tuningJobs"],s)}return n}function fHt(e,t){const n={},r=Q(e,["name"]);r!=null&&ee(n,["model"],r);const o=Q(e,["name"]);return o!=null&&ee(n,["endpoint"],o),n}function pHt(e,t){const n={};if(Q(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(Q(e,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is not supported in Gemini API.");const r=Q(e,["examples"]);if(r!=null){let o=r;Array.isArray(o)&&(o=o.map(i=>i)),ee(n,["examples","examples"],o)}return n}function hHt(e,t,n){const r={};let o=Q(n,["config","method"]);if(o===void 0&&(o="SUPERVISED_FINE_TUNING"),o==="SUPERVISED_FINE_TUNING"){const s=Q(e,["gcsUri"]);t!==void 0&&s!=null&&ee(t,["supervisedTuningSpec","trainingDatasetUri"],s)}else if(o==="PREFERENCE_TUNING"){const s=Q(e,["gcsUri"]);t!==void 0&&s!=null&&ee(t,["preferenceOptimizationSpec","trainingDatasetUri"],s)}let i=Q(n,["config","method"]);if(i===void 0&&(i="SUPERVISED_FINE_TUNING"),i==="SUPERVISED_FINE_TUNING"){const s=Q(e,["vertexDatasetResource"]);t!==void 0&&s!=null&&ee(t,["supervisedTuningSpec","trainingDatasetUri"],s)}else if(i==="PREFERENCE_TUNING"){const s=Q(e,["vertexDatasetResource"]);t!==void 0&&s!=null&&ee(t,["preferenceOptimizationSpec","trainingDatasetUri"],s)}if(Q(e,["examples"])!==void 0)throw new Error("examples parameter is not supported in Vertex AI.");return r}function SXe(e,t){const n={},r=Q(e,["sdkHttpResponse"]);r!=null&&ee(n,["sdkHttpResponse"],r);const o=Q(e,["name"]);o!=null&&ee(n,["name"],o);const i=Q(e,["state"]);i!=null&&ee(n,["state"],LYe(i));const s=Q(e,["createTime"]);s!=null&&ee(n,["createTime"],s);const l=Q(e,["tuningTask","startTime"]);l!=null&&ee(n,["startTime"],l);const c=Q(e,["tuningTask","completeTime"]);c!=null&&ee(n,["endTime"],c);const u=Q(e,["updateTime"]);u!=null&&ee(n,["updateTime"],u);const d=Q(e,["description"]);d!=null&&ee(n,["description"],d);const p=Q(e,["baseModel"]);p!=null&&ee(n,["baseModel"],p);const h=Q(e,["_self"]);return h!=null&&ee(n,["tunedModel"],fHt(h)),n}function Gie(e,t){const n={},r=Q(e,["sdkHttpResponse"]);r!=null&&ee(n,["sdkHttpResponse"],r);const o=Q(e,["name"]);o!=null&&ee(n,["name"],o);const i=Q(e,["state"]);i!=null&&ee(n,["state"],LYe(i));const s=Q(e,["createTime"]);s!=null&&ee(n,["createTime"],s);const l=Q(e,["startTime"]);l!=null&&ee(n,["startTime"],l);const c=Q(e,["endTime"]);c!=null&&ee(n,["endTime"],c);const u=Q(e,["updateTime"]);u!=null&&ee(n,["updateTime"],u);const d=Q(e,["error"]);d!=null&&ee(n,["error"],d);const p=Q(e,["description"]);p!=null&&ee(n,["description"],p);const h=Q(e,["baseModel"]);h!=null&&ee(n,["baseModel"],h);const m=Q(e,["tunedModel"]);m!=null&&ee(n,["tunedModel"],m);const g=Q(e,["preTunedModel"]);g!=null&&ee(n,["preTunedModel"],g);const y=Q(e,["supervisedTuningSpec"]);y!=null&&ee(n,["supervisedTuningSpec"],y);const x=Q(e,["preferenceOptimizationSpec"]);x!=null&&ee(n,["preferenceOptimizationSpec"],x);const v=Q(e,["tuningDataStats"]);v!=null&&ee(n,["tuningDataStats"],v);const b=Q(e,["encryptionSpec"]);b!=null&&ee(n,["encryptionSpec"],b);const w=Q(e,["partnerModelTuningSpec"]);w!=null&&ee(n,["partnerModelTuningSpec"],w);const S=Q(e,["customBaseModel"]);S!=null&&ee(n,["customBaseModel"],S);const C=Q(e,["experiment"]);C!=null&&ee(n,["experiment"],C);const N=Q(e,["labels"]);N!=null&&ee(n,["labels"],N);const j=Q(e,["outputUri"]);j!=null&&ee(n,["outputUri"],j);const I=Q(e,["pipelineJob"]);I!=null&&ee(n,["pipelineJob"],I);const _=Q(e,["serviceAccount"]);_!=null&&ee(n,["serviceAccount"],_);const T=Q(e,["tunedModelDisplayName"]);T!=null&&ee(n,["tunedModelDisplayName"],T);const P=Q(e,["veoTuningSpec"]);return P!=null&&ee(n,["veoTuningSpec"],P),n}function mHt(e,t){const n={},r=Q(e,["sdkHttpResponse"]);r!=null&&ee(n,["sdkHttpResponse"],r);const o=Q(e,["name"]);o!=null&&ee(n,["name"],o);const i=Q(e,["metadata"]);i!=null&&ee(n,["metadata"],i);const s=Q(e,["done"]);s!=null&&ee(n,["done"],s);const l=Q(e,["error"]);return l!=null&&ee(n,["error"],l),n}function jEe(e,t){const n={},r=Q(e,["gcsUri"]);r!=null&&ee(n,["validationDatasetUri"],r);const o=Q(e,["vertexDatasetResource"]);return o!=null&&ee(n,["validationDatasetUri"],o),n}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class gHt extends zw{constructor(t){super(),this.apiClient=t,this.list=async(n={})=>new JI(uw.PAGED_ITEM_TUNING_JOBS,r=>this.listInternal(r),await this.listInternal(n),n),this.get=async n=>await this.getInternal(n),this.tune=async n=>{var r;if(this.apiClient.isVertexAI())if(n.baseModel.startsWith("projects/")){const o={tunedModelName:n.baseModel};!((r=n.config)===null||r===void 0)&&r.preTunedModelCheckpointId&&(o.checkpointId=n.config.preTunedModelCheckpointId);const i=Object.assign(Object.assign({},n),{preTunedModel:o});return i.baseModel=void 0,await this.tuneInternal(i)}else{const o=Object.assign({},n);return await this.tuneInternal(o)}else{const o=Object.assign({},n),i=await this.tuneMldevInternal(o);let s="";return i.metadata!==void 0&&i.metadata.tunedModel!==void 0?s=i.metadata.tunedModel:i.name!==void 0&&i.name.includes("/operations/")&&(s=i.name.split("/operations/")[0]),{name:s,state:Mie.JOB_STATE_QUEUED}}}}async getInternal(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=iHt(t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>Gie(d))}else{const u=oHt(t);return l=Lr("{name}",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>SXe(d))}}async listInternal(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=cHt(t);return l=Lr("tuningJobs",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=dHt(d),h=new Qje;return Object.assign(h,p),h})}else{const u=lHt(t);return l=Lr("tunedModels",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=uHt(d),h=new Qje;return Object.assign(h,p),h})}}async cancel(t){var n,r,o,i;let s,l="",c={};if(this.apiClient.isVertexAI()){const u=QBt(t);return l=Lr("{name}:cancel",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=ZBt(d),h=new Jje;return Object.assign(h,p),h})}else{const u=XBt(t);return l=Lr("{name}:cancel",u._url),c=u._query,delete u._url,delete u._query,s=this.apiClient.request({path:l,queryParams:c,body:JSON.stringify(u),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(i=t.config)===null||i===void 0?void 0:i.abortSignal}).then(d=>d.json().then(p=>{const h=p;return h.sdkHttpResponse={headers:d.headers},h})),s.then(d=>{const p=JBt(d),h=new Jje;return Object.assign(h,p),h})}}async tuneInternal(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI()){const l=rHt(t,t);return i=Lr("tuningJobs",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:c.headers},d})),o.then(c=>Gie(c))}else throw new Error("This method is only supported by the Vertex AI.")}async tuneMldevInternal(t){var n,r;let o,i="",s={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const l=nHt(t);return i=Lr("tunedModels",l._url),s=l._query,delete l._url,delete l._query,o=this.apiClient.request({path:i,queryParams:s,body:JSON.stringify(l),httpMethod:"POST",httpOptions:(n=t.config)===null||n===void 0?void 0:n.httpOptions,abortSignal:(r=t.config)===null||r===void 0?void 0:r.abortSignal}).then(c=>c.json().then(u=>{const d=u;return d.sdkHttpResponse={headers:c.headers},d})),o.then(c=>mHt(c))}}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class xHt{async download(t,n){throw new Error("Download to file is not supported in the browser, please use a browser compliant download like an tag.")}}const yHt=1024*1024*8,vHt=3,bHt=1e3,wHt=2,VH="x-goog-upload-status";async function SHt(e,t,n){var r;const o=await CXe(e,t,n),i=await(o==null?void 0:o.json());if(((r=o==null?void 0:o.headers)===null||r===void 0?void 0:r[VH])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return i.file}async function CHt(e,t,n){var r;const o=await CXe(e,t,n),i=await(o==null?void 0:o.json());if(((r=o==null?void 0:o.headers)===null||r===void 0?void 0:r[VH])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");const s=kYe(i),l=new Yme;return Object.assign(l,s),l}async function CXe(e,t,n){var r,o;let i=0,s=0,l=new Oie(new Response),c="upload";for(i=e.size;s=i&&(c+=", finalize");let p=0,h=bHt;for(;psetTimeout(t,e))}class EHt{async upload(t,n,r){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await SHt(t,n,r)}async uploadToFileSearchStore(t,n,r){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await CHt(t,n,r)}async stat(t){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await NHt(t)}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */class IHt{create(t,n,r){return new _Ht(t,n,r)}}class _Ht{constructor(t,n,r){this.url=t,this.headers=n,this.callbacks=r}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 EEe="x-goog-api-key";class PHt{constructor(t){this.apiKey=t}async addAuthHeaders(t,n){if(t.get(EEe)===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(EEe,this.apiKey)}}}/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */const AHt="gl-node/";class Ko{get interactions(){if(this._interactions!==void 0)return this._interactions;console.warn("GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.");const t=this.httpOptions;t!=null&&t.extraBody&&console.warn("GoogleGenAI.interactions: Client level httpOptions.extraBody is not supported by the interactions client and will be ignored.");const n=new yf({baseURL:this.apiClient.getBaseUrl(),apiKey:this.apiKey,apiVersion:this.apiClient.getApiVersion(),clientAdapter:this.apiClient,defaultHeaders:this.apiClient.getDefaultHeaders(),timeout:t==null?void 0:t.timeout});return this._interactions=n.interactions,this._interactions}constructor(t){var n;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=(n=t.vertexai)!==null&&n!==void 0?n:!1,this.apiKey=t.apiKey;const r=N6t(t.httpOptions,t.vertexai,void 0,void 0);r&&(t.httpOptions?t.httpOptions.baseUrl=r:t.httpOptions={baseUrl:r}),this.apiVersion=t.apiVersion,this.httpOptions=t.httpOptions;const o=new PHt(this.apiKey);this.apiClient=new Nzt({auth:o,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:AHt+"web",uploader:new EHt,downloader:new xHt}),this.models=new Vzt(this.apiClient),this.live=new Dzt(this.apiClient,o,new IHt),this.batches=new Z8t(this.apiClient),this.chats=new RFt(this.models,this.apiClient),this.caches=new TFt(this.apiClient),this.files=new UFt(this.apiClient),this.operations=new Uzt(this.apiClient),this.authTokens=new aBt(this.apiClient),this.tunings=new gHt(this.apiClient),this.fileSearchStores=new hBt(this.apiClient)}}var wt=(e=>(e.Dashboard="dashboard",e.Transactions="transactions",e.SendMoney="send-money",e.Budgets="capital-allocation",e.FinancialGoals="strategic-goals",e.CreditHealth="credit-health",e.Personalization="personalization",e.Accounts="accounts-overview",e.Investments="investments",e.CryptoWeb3="crypto-web3",e.AlgoTradingLab="algo-trading-lab",e.ForexArena="forex-arena",e.CommoditiesExchange="commodities-exchange",e.RealEstateEmpire="real-estate-empire",e.ArtCollectibles="art-collectibles",e.DerivativesDesk="derivatives-desk",e.VentureCapital="venture-capital",e.PrivateEquity="private-equity",e.TaxOptimization="tax-optimization",e.LegacyBuilder="legacy-builder",e.SovereignWealth="sovereign-wealth",e.QuantumAssets="quantum-assets",e.QuantumAccounts="quantum-accounts",e.QuantumAccountProxy="quantum-account-proxy",e.QuantumBillPay="quantum-bill-pay",e.QuantumCrossBorder="quantum-cross-border",e.QuantumPayeeManagement="quantum-payee-mgmt",e.QuantumStandingInstructions="quantum-standing-instructions",e.QuantumDeveloperTools="quantum-dev-tools",e.QuantumEligibility="quantum-eligibility",e.QuantumUnmaskedData="quantum-unmasked-data",e.PlaidMainDashboard="plaid-main",e.DataNetwork="plaid-data-network",e.PlaidIdentity="plaid-identity",e.PlaidCRAMonitoring="plaid-cra-monitoring",e.PlaidInstitutions="plaid-institutions",e.PlaidItemManagement="plaid-item-mgmt",e.CorporateCommand="corporate-command",e.ModernTreasury="modern-treasury",e.Treasury="treasury",e.CardPrograms="card-programs",e.Payments="payments",e.StripeNexus="stripe-nexus",e.CounterpartyDashboard="counterparty-dashboard",e.VirtualAccounts="virtual-accounts",e.CorporateActions="corporate-actions",e.CreditNoteLedger="credit-note-ledger",e.ReconciliationHub="reconciliation-hub",e.GEINDashboard="gein-dashboard",e.CardholderManagement="cardholder-mgmt",e.VentureCapitalDeskView="vc-desk-view",e.AIAdvisor="ai-advisor",e.AIInsights="ai-insights",e.QuantumWeaver="quantum-weaver",e.AgentMarketplace="agent-marketplace",e.AIAdStudio="ai-ad-studio",e.GlobalPositionMap="global-position-map",e.GlobalSsiHub="global-ssi-hub",e.SecurityCompliance="security-compliance",e.DeveloperHub="developer-hub",e.SchemaExplorer="schema-explorer",e.ResourceGraph="resource-graph",e.TheVision="the-vision",e.ApiPlayground="api-playground",e.ComplianceOracle="compliance-oracle",e.CustomerDashboard="customer-dashboard",e.VerificationReports="verification-reports",e.FinancialReporting="financial-reporting",e.StripeNexusDashboard="stripe-nexus-dashboard",e.AccountDetails="account-details",e.AccountList="account-list",e.AccountStatementGrid="account-statement-grid",e.AccountsView="accounts-view",e.AccountVerificationModal="account-verification-modal",e.ACHDetailsDisplay="ach-details-display",e.AICommandLog="ai-command-log",e.AIPredictionWidget="ai-prediction-widget",e.AssetCatalog="asset-catalog",e.AutomatedSweepRules="automated-sweep-rules",e.BalanceReportChart="balance-report-chart",e.BalanceTransactionTable="balance-transaction-table",e.CardDesignVisualizer="card-design-visualizer",e.ChargeDetailModal="charge-detail-modal",e.ChargeList="charge-list",e.ConductorConfigurationView="conductor-config",e.CounterpartyDetails="counterparty-details",e.CounterpartyForm="counterparty-form",e.DisruptionIndexMeter="disruption-index",e.DocumentUploader="document-uploader",e.DownloadLink="download-link",e.EarlyFraudWarningFeed="early-fraud-warning",e.ElectionChoiceForm="election-choice-form",e.EventNotificationCard="event-notification-card",e.ExpectedPaymentsTable="expected-payments",e.ExternalAccountCard="external-account-card",e.ExternalAccountForm="external-account-form",e.ExternalAccountsTable="external-accounts-table",e.FinancialAccountCard="financial-account-card",e.IncomingPaymentDetailList="incoming-payment-details",e.InvoiceFinancingRequest="invoice-financing-req",e.PaymentInitiationForm="payment-initiation-form",e.PaymentMethodDetails="payment-method-details",e.PaymentMethodBalance="payment-method-balance",e.PaymentOrderForm="payment-order-form",e.PayoutsDashboard="payouts-dashboard",e.PnLChart="pnl-chart",e.RefundForm="refund-form",e.RemittanceInfoEditor="remittance-info-editor",e.ReportingView="reporting-view",e.ReportRunGenerator="report-run-gen",e.ReportStatusIndicator="report-status-indicator",e.SsiEditorForm="ssi-editor-form",e.StripeNexusView="stripe-nexus-view",e.StripeStatusBadge="stripe-status-badge",e.StructuredPurposeInput="structured-purpose-input",e.SubscriptionList="subscription-list",e.TimeSeriesChart="time-series-chart",e.TradeConfirmationModal="trade-confirm-modal",e.TransactionFilter="transaction-filter",e.TransactionList="transaction-list",e.TreasuryTransactionList="treasury-txn-list",e.TreasuryView="treasury-view",e.UniversalObjectInspector="object-inspector",e.VirtualAccountForm="virtual-account-form",e.VirtualAccountsTable="virtual-accounts-table",e.VoiceControl="voice-control",e.WebhookSimulator="webhook-simulator",e.TheBook="the-book",e.KnowledgeBase="knowledge-base",e.Settings="settings",e.SSO="sso",e.ConciergeService="concierge-service",e.Philanthropy="philanthropy",e.OpenBanking="open-banking",e.FinancialDemocracy="financial-democracy",e.APIStatus="api-status",e.APIIntegration="api-integration",e.APIConsole="api-console",e.SecurityCenter="security-center",e.Security="security",e.AIStrategy="ai-strategy",e.Goals="financial-goals",e.Rewards="rewards",e.CardCustomization="card-customization",e))(wt||{});const THt=[{id:"1",date:"2024-03-15",description:"Apple Store",amount:1299,type:"expense",category:"Shopping",currency:"USD",metadata:{merchantName:"Apple Store",carbonFootprint:15,tags:["Tech"],aiClassification:"Shopping"}},{id:"2",date:"2024-03-14",description:"Salary Deposit",amount:5e3,type:"income",category:"Income",currency:"USD",metadata:{merchantName:"Citibank",carbonFootprint:0,tags:["Income"],aiClassification:"Income"}},{id:"3",date:"2024-03-12",description:"Starbucks",amount:5.5,type:"expense",category:"Dining",currency:"USD",metadata:{merchantName:"Starbucks",carbonFootprint:.5,tags:["Coffee"],aiClassification:"Dining"}},{id:"4",date:"2024-03-10",description:"Uber",amount:24,type:"expense",category:"Transport",currency:"USD",metadata:{merchantName:"Uber",carbonFootprint:2,tags:["Ride"],aiClassification:"Transport"}},{id:"5",date:"2024-03-08",description:"Whole Foods",amount:145.2,type:"expense",category:"Groceries",currency:"USD",metadata:{merchantName:"Whole Foods",carbonFootprint:5,tags:["Food"],aiClassification:"Groceries"}}],kHt=[{id:"a1",name:"Tech Growth ETF",value:15400,color:"#06b6d4",performanceYTD:12.5,assetClass:"Stock",riskLevel:"Medium"},{id:"a2",name:"Bitcoin Holdings",value:8500,color:"#f59e0b",performanceYTD:45.2,assetClass:"CRYPTO",riskLevel:"High"},{id:"a3",name:"Real Estate Fund",value:22e3,color:"#10b981",performanceYTD:5.1,assetClass:"Real Estate",riskLevel:"Medium"},{id:"a4",name:"High Yield Savings",value:1e4,color:"#6366f1",performanceYTD:4.5,assetClass:"Cash",riskLevel:"Low"}],MHt=[{id:"b1",name:"Dining",limit:500,spent:350,color:"#f87171",remaining:150,category:"Dining",alerts:[]},{id:"b2",name:"Groceries",limit:600,spent:420,color:"#fbbf24",remaining:180,category:"Groceries",alerts:[]},{id:"b3",name:"Transport",limit:300,spent:100,color:"#60a5fa",remaining:200,category:"Transport",alerts:[]},{id:"b4",name:"Shopping",limit:400,spent:380,color:"#a78bfa",remaining:20,category:"Shopping",alerts:[]}],RHt={score:785,change:12,rating:"Excellent"},OHt=[{id:"g1",name:"Retirement 2050",targetAmount:2e6,currentAmount:15e4,targetDate:"2050-01-01",status:"on_track"},{id:"g2",name:"Buy a Home",targetAmount:15e4,currentAmount:45e3,targetDate:"2028-06-01",status:"on_track"}],$Ht={balance:12500,lastEarned:150,lastRedeemed:0,currency:"PTS"},DHt=[{id:"r1",name:"$50 Gift Card",cost:5e3,type:"giftcard",description:"Amazon Gift Card",iconName:"gift"},{id:"r2",name:"Plant a Tree",cost:500,type:"impact",description:"Donate to reforestation",iconName:"leaf"},{id:"r3",name:"Statement Credit",cost:1e3,type:"cashback",description:"$10 Cash Back",iconName:"cash"}],LHt=[{provider:"Google Gemini",status:"Operational",responseTime:120},{provider:"Plaid",status:"Operational",responseTime:450},{provider:"Stripe",status:"Operational",responseTime:230},{provider:"Modern Treasury",status:"Operational",responseTime:310}],FHt=[{name:"Payment History",status:"Excellent",description:"No missed payments."},{name:"Credit Utilization",status:"Good",description:"15% utilization."},{name:"Credit Age",status:"Fair",description:"Average age 3 years."}];new Date().toISOString();const zHt=[{id:"1",message:"New transaction detected in your primary checking account.",timestamp:"2 mins ago",read:!1,severity:"info"},{id:"2",message:"Credit score updated. View your resonance report.",timestamp:"1 hour ago",read:!1,severity:"success",view:wt.CreditHealth},{id:"3",message:"Potential anomaly detected in SWIFT flow.",timestamp:"3 hours ago",read:!0,severity:"warning"}],BHt=[{metricName:"OverallSecurityScore",currentValue:"0.92"},{metricName:"EncryptionDepth",currentValue:"256-bit"}],HHt=[{id:"1",timestamp:new Date().toISOString(),userId:"James",action:"LOGIN",targetResource:"Nexus OS",success:!0},{id:"2",timestamp:new Date().toISOString(),userId:"sys_auth",action:"ROTATE_KEYS",targetResource:"Vault",success:!0}],VHt=[{alertId:"1",title:"Geo-mismatch",description:"Attempt from unrecognized region.",timestamp:new Date().toISOString()}],UHt=[{policyId:"1",policyName:"Aggregate Analytics",scope:"Global",lastReviewed:"2024-01-01",isActive:!0}],WHt=[{id:"key_1",keyName:"Prod-Read-Only",creationDate:"2023-05-10",scopes:["read"]}],GHt=[{id:"1",name:"Security Ops",relationship:"Internal",verified:!0}],qHt=[{moduleId:"1",title:"Phishing Defense",completionRate:100}],KHt=[{ruleId:"1",name:"Velocity Limit",triggerCondition:"amount > 50k",action:"BLOCK",isEnabled:!0}];var IEe={};const ia=f.createContext(void 0),_Ee="QUANTUM_FINANCIAL_STATE_V1",PEe="QUANTUM_GITHUB_REPO_V1",YHt="jocall3",XHt="jocall3",QHt=[{id:"b-1",filePath:"s3://nexus/ingest/quantum_q4_raw.csv",status:"IMPORTED",vendorName:"Quantum Financial",interfaceType:"SFTP",createdAt:"2024-11-15T09:00:00Z"}],JHt=({children:e})=>{const[t,n]=f.useState(wt.Dashboard),[r,o]=f.useState(THt),[i,s]=f.useState(kHt),[l,c]=f.useState([]),[u,d]=f.useState(zHt),[p,h]=f.useState([]),[m,g]=f.useState(!1),[y,x]=f.useState(OHt),[v,b]=f.useState(!1),[w,S]=f.useState([]),[C,N]=f.useState([{id:"acc_01",name:"Quantum Elite Checking",mask:"9981",balance:85e5,institutionId:"quantum_intl"},{id:"acc_02",name:"Global Treasury Savings",mask:"1102",balance:25e6,institutionId:"quantum_intl"}]),[j,I]=f.useState([{id:"app-1",name:"Quantum Nexus ERP",description:"Enterprise Resource Planning",status:"active",authorizedAt:"2024-10-01T08:00:00Z"}]),[_,T]=f.useState(localStorage.getItem("gemini_api_key")),[P,E]=f.useState(localStorage.getItem("mt_api_key")),[M,R]=f.useState(localStorage.getItem("mt_org_id")),[$,D]=f.useState({quantumFinancial:"https://api.quantumfinancial.io/v1",plaid:"https://production.plaid.com",stripe:"https://api.stripe.com/v1",modernTreasury:"https://app.moderntreasury.com/api",gemini:"https://generativelanguage.googleapis.com",gein:"https://ce47fe80-dabc-4ad0-b0e7-cf285695b8b8.mock.pstmn.io"}),[z,V]=f.useState(5e5),[B,G]=f.useState(MHt),[H,F]=f.useState([]),[W,U]=f.useState(!1),[K,X]=f.useState(localStorage.getItem("marqeta_token")),[J,te]=f.useState(localStorage.getItem("marqeta_secret")),[re,ce]=f.useState({host:"quantum-db-cluster.aws.internal",port:"5432",username:"quantum_admin",password:"",databaseName:"quantum_ledger_prod",connectionStatus:"disconnected",sslMode:"require"}),ae=f.useCallback(Oe=>{ce(Ae=>({...Ae,...Oe}))},[]),[oe,ue]=f.useState({status:"idle",logs:[]}),[fe,se]=f.useState([]),[ge,ye]=f.useState(!1),[de,Ne]=f.useState(HHt),_e=f.useCallback((Oe,Ae)=>{const qe={id:`AUDIT-${Date.now()}`,timestamp:new Date().toISOString(),action:Oe,details:JSON.stringify(Ae),user:"James Burvel oCallaghan III",ipAddress:"10.0.0.42",status:"SUCCESS"};Ne(dt=>[qe,...dt]),console.log(`[QUANTUM_AUDIT] ${Oe}`,Ae)},[]),xe=f.useCallback((Oe,Ae)=>{d(qe=>[{id:Math.random().toString(36).substr(2,9),message:Oe,timestamp:"Just Now",read:!1,severity:Ae||"info"},...qe].slice(0,20))},[]),we=f.useCallback(async Oe=>{_e("WIRE_TRANSFER_INITIATED",Oe),xe("MFA Challenge Issued: Please verify on your Quantum Secure Key.","info"),await new Promise(Ae=>setTimeout(Ae,2e3)),xe("Fraud Monitoring: Transaction cleared heuristic analysis.","success"),xe(`Wire Transfer of ${Oe.amount} to ${Oe.recipient} successful.`,"success"),_e("WIRE_TRANSFER_COMPLETED",{...Oe,status:"SETTLED"})},[_e,xe]),Te=f.useCallback(async Oe=>{_e("ACH_TRANSFER_INITIATED",Oe),xe("Processing ACH Batch...","info"),await new Promise(Ae=>setTimeout(Ae,1500)),xe(`ACH Transfer to ${Oe.recipient} queued for next window.`,"success"),_e("ACH_TRANSFER_QUEUED",Oe)},[_e,xe]);f.useEffect(()=>{const Oe=localStorage.getItem(_Ee);if(Oe)try{const qe=JSON.parse(Oe);qe.transactions&&o(qe.transactions),qe.assets&&s(qe.assets),qe.internalAccounts&&c(qe.internalAccounts),qe.financialGoals&&x(qe.financialGoals),qe.linkedAccounts&&N(qe.linkedAccounts)}catch(qe){console.error("State hydration failed",qe)}const Ae=localStorage.getItem(PEe);if(Ae)try{se(JSON.parse(Ae))}catch(qe){console.error("Failed to parse cached GitHub repo",qe)}},[]),f.useEffect(()=>{localStorage.setItem(_Ee,JSON.stringify({transactions:r,assets:i,internalAccounts:l,financialGoals:y,linkedAccounts:C}))},[r,i,l,y,C]),f.useEffect(()=>{const Oe=setInterval(()=>{const Ae=i.reduce((qe,dt)=>qe+dt.value,0)+245e5;h(qe=>[...qe,{time:new Date().toLocaleTimeString(),value:Ae+(Math.random()-.5)*5e4}].slice(-30))},2e3);return()=>clearInterval(Oe)},[i]);const Re=f.useCallback(async(Oe,Ae="gemini-1.5-pro")=>{try{return(await new Ko({apiKey:""}).getGenerativeModel({model:Ae}).generateContent({contents:[{role:"user",parts:[{text:Oe}]}],generationConfig:{temperature:.7,topP:.95}})).response.text()}catch{return"Quantum AI Core synchronization interrupted. Re-establishing secure link..."}},[]),Ue=f.useCallback((Oe,Ae)=>{_e(`SYSTEM_EVENT_${Oe}`,Ae),xe(`System Event: ${Oe.replace(/_/g," ")}`,"info")},[xe,_e]),He=f.useCallback(async Oe=>{ye(!0);try{const Ae=await fetch(`https://api.github.com/repos/${YHt}/${XHt}/contents/${Oe}`);if(!Ae.ok)throw new Error(`GitHub API error: ${Ae.statusText}`);return(await Ae.json()).map(dt=>({...dt,path:dt.path||`${Oe}/${dt.name}`.replace(/\/\//g,"/")}))}catch{return xe(`Repo Error: Could not load ${Oe}`,"error"),[]}finally{ye(!1)}},[xe]),Ye=f.useCallback(async()=>{ye(!0);const Oe=await He("");se(Oe),ye(!1),xe("Quantum Repository structure synchronized.","success"),localStorage.setItem(PEe,JSON.stringify(Oe))},[He,xe]),We=f.useCallback(async()=>{ae({connectionStatus:"connecting"}),await new Promise(Oe=>setTimeout(Oe,1500)),ae({connectionStatus:"connected"}),_e("DATABASE_CONNECTED",{host:re.host}),xe("Quantum Database nexus synchronized.","success")},[ae,xe,_e,re.host]),at=f.useMemo(()=>({view:t,activeView:t,setView:n,setActiveView:n,userProfile:{id:"USR-77-X-ALPHA",name:"James Burvel oCallaghan III",title:"Sovereign Architect",email:"james@quantum.io",phone:"+1 (555) 942-0123",loyaltyTier:"OMEGA",avatarUrl:"https://api.dicebear.com/7.x/avataaars/svg?seed=James",usdBalance:245e7,fiatBalance:245e7,cryptoBalance:14200.55},user:{id:"USR-77-X-ALPHA",name:"James Burvel oCallaghan III",title:"Sovereign Architect",email:"james@quantum.io",phone:"+1 (555) 942-0123",loyaltyTier:"OMEGA",avatarUrl:"https://api.dicebear.com/7.x/avataaars/svg?seed=James",usdBalance:245e7,fiatBalance:245e7,cryptoBalance:14200.55},creator:{name:"James Burvel oCallaghan III",title:"Grand Architect of Quantum AI"},transactions:r,assets:i,internalAccounts:l,notifications:u,aiInsights:[],insights:[],budgets:B,rewardItems:DHt,apiStatus:LHt,pipelines:[{id:"p-1",name:"Quantum Ledger Sync",pipelineName:"NEXUS_TX_FEED",status:"SUCCESS",prettyDuration:"1.2s"},{id:"p-2",name:"Risk Vector Audit",pipelineName:"HEURISTIC_RISK",status:"RUNNING",prettyDuration:"240ms"}],inboundBlobs:QHt,fundFlows:[{id:"f-1",name:"Reserve Accumulation",ledgerId:"L-771",postedTxCount:1242,pendingTxCount:12}],authorizedApps:j,simulationData:p,geminiApiKey:_,setGeminiApiKey:Oe=>{T(Oe),localStorage.setItem("gemini_api_key",Oe)},modernTreasuryApiKey:P,setModernTreasuryApiKey:Oe=>{E(Oe),localStorage.setItem("mt_api_key",Oe)},modernTreasuryOrganizationId:M,setModernTreasuryOrganizationId:Oe=>{R(Oe),localStorage.setItem("mt_org_id",Oe)},setTransactions:o,updateTransaction:(Oe,Ae)=>o(qe=>qe.map(dt=>dt.id===Oe?{...dt,...Ae}:dt)),deleteTransaction:Oe=>o(Ae=>Ae.filter(qe=>qe.id!==Oe)),addTransaction:Oe=>o(Ae=>[Oe,...Ae]),setAssets:s,setInternalAccounts:c,showNotification:xe,markNotificationRead:Oe=>d(Ae=>Ae.map(qe=>qe.id===Oe?{...qe,read:!0}:qe)),authorizeApp:Oe=>I(Ae=>[...Ae,{id:Oe.id||`app-${Date.now()}`,name:Oe.name||"Unknown",description:Oe.description||"",status:"active",authorizedAt:new Date().toISOString(),scopes:Oe.scopes}]),revokeApp:Oe=>I(Ae=>Ae.map(qe=>qe.id===Oe?{...qe,status:"revoked"}:qe)),redeemReward:Oe=>(xe(`Redeemed ${Oe.name}`,"success"),!0),rewardPoints:$Ht,askSovereignAI:Re,isImportingData:m,treesPlanted:142,spendingForNextTree:120,linkedAccounts:C,unlinkAccount:Oe=>{N(Ae=>Ae.filter(qe=>qe.id!==Oe)),xe("Institutional link severed.","warning")},paymentOrders:[],invoices:[],complianceCases:[],corporateTransactions:[],creditScore:RHt,creditFactors:FHt,financialGoals:y,addFinancialGoal:Oe=>x(Ae=>[...Ae,{id:`goal-${Date.now()}`,name:Oe.name||"New Goal",targetAmount:Oe.targetAmount||0,currentAmount:0,targetDate:Oe.targetDate||new Date().toISOString(),iconName:Oe.iconName||"default",plan:null,startDate:new Date().toISOString(),contributions:[],status:"on_track"}]),generateGoalPlan:async Oe=>{xe("Neural strategist is mapping your trajectory...","info"),await new Promise(Ae=>setTimeout(Ae,2e3)),xe("Strategic roadmap synthesized.","success")},addContributionToGoal:(Oe,Ae)=>x(qe=>qe.map(dt=>dt.id===Oe?{...dt,currentAmount:dt.currentAmount+Ae}:dt)),addRecurringContributionToGoal:()=>{},updateRecurringContributionInGoal:()=>{},deleteRecurringContributionFromGoal:()=>{},updateFinancialGoal:(Oe,Ae)=>x(qe=>qe.map(dt=>dt.id===Oe?{...dt,...Ae}:dt)),linkGoals:()=>{},unlinkGoals:()=>{},isWalletConnectModalOpen:v,setWalletConnectModalOpen:b,detectedProviders:w,connectWallet:Oe=>xe(`Synchronized with ${Oe.info.name}`,"success"),apiEndpoints:$,updateEndpoint:(Oe,Ae)=>D(qe=>({...qe,[Oe]:Ae})),sovereignCredits:z,deductCredits:Oe=>z>=Oe?(V(Ae=>Ae-Oe),!0):!1,isProductionApproved:!0,plaidProducts:["auth","transactions","identity","balance"],isLoading:!1,error:null,broadcastEvent:Ue,addBudget:(Oe,Ae)=>G(qe=>[...qe,{id:`b-${Date.now()}`,name:Oe,limit:Ae,spent:0,color:"#06b6d4",remaining:Ae,category:Oe,alerts:[]}]),stripeApiKey:IEe.STRIPE_SECRET_KEY||null,marqetaCardProducts:H,fetchMarqetaProducts:async()=>{U(!0),await new Promise(Oe=>setTimeout(Oe,1e3)),F([{token:"cp-1",name:"Quantum Black",active:!0,start_date:"2024-01-01",config:{fulfillment:{bin_prefix:"424242"},poi:{other:{}}}}]),U(!1)},isMarqetaLoading:W,marqetaApiToken:K,marqetaApiSecret:J,setMarqetaCredentials:(Oe,Ae)=>{X(Oe),te(Ae),localStorage.setItem("marqeta_token",Oe),localStorage.setItem("marqeta_secret",Ae)},plaidApiKey:IEe.PLAID_SECRET||null,dbConfig:re,updateDbConfig:ae,connectDatabase:We,webDriverStatus:oe,launchWebDriver:async Oe=>{ue(Ae=>({...Ae,status:"running",logs:[...Ae.logs,`Starting task: ${Oe}`]})),await new Promise(Ae=>setTimeout(Ae,2e3)),ue(Ae=>({...Ae,status:"idle",logs:[...Ae.logs,`Task completed: ${Oe}`]}))},showSystemAlert:(Oe,Ae)=>xe(Oe,Ae),handlePlaidSuccess:(Oe,Ae)=>xe(`Account linked: ${Ae.institution.name}`,"success"),securityMetrics:BHt,auditLogs:de,threatAlerts:VHt,dataSharingPolicies:UHt,apiKeys:WHt,trustedContacts:GHt,securityAwarenessModules:qHt,transactionRules:KHt,githubRepoFiles:fe,fetchRepo:Ye,fetchDirectory:async()=>{},isRepoLoading:ge,initiateWireTransfer:we,initiateACHTransfer:Te,logAuditAction:_e}),[t,r,i,l,u,p,m,y,v,w,C,j,_,P,M,B,z,H,W,K,J,re,oe,fe,ge,de,xe,Re,Ue,We,we,Te,_e,Ye,ae]);return a.jsx(ia.Provider,{value:at,children:e})},ZHt={institution:{name:"Quantum Financial",tier:"Elite Sovereign",motto:"The Future of Capital, Realized.",capabilities:{high_frequency_wires:"active",cross_border_settlement:"active",ai_treasury_management:"active",quantum_encryption:"active"}},account:{id:"q_acct_9988776655",object:"quantum_account",business_profile:{name:"Global Enterprise Demo Corp",mcc:"6011",url:"https://quantum-financial.demo",support_phone:"+1 (888) QUANTUM"},capabilities:{card_issuing:"active",treasury:"active",ach_transfer:"active",wire_transfer:"active"},charges_enabled:!0,country:"US",default_currency:"usd",settings:{payouts:{schedule:{interval:"daily",delay_days:0},statement_descriptor:"QUANTUM FIN CORP"},branding:{primary_color:"#00FFFF",secondary_color:"#000000"}}},balance:{object:"balance",available:[{amount:425e6,currency:"usd",source_types:{card:125e6,ach:3e8}},{amount:85e6,currency:"eur",source_types:{wire:85e6}}],pending:[{amount:12e6,currency:"usd"}],quantum_reserve:[{amount:1e9,currency:"usd",status:"locked_sovereign"}]},transactions:Array.from({length:50}).map((e,t)=>({id:`q_txn_${1e3+t}`,object:"balance_transaction",amount:Math.floor(Math.random()*1e6)+5e3,currency:"usd",description:t%3===0?"Global Supply Chain Settlement":"Inter-Institutional Liquidity Transfer",status:"available",type:t%5===0?"wire":"ach",created:Date.now()-t*36e5,fee:0,net:Math.floor(Math.random()*1e6)+5e3,reporting_category:"transfer"})),cards:[{id:"q_card_alpha_1",last4:"8888",brand:"Quantum Black",exp_month:12,exp_year:2030,status:"active",spending_controls:{monthly_limit:5e6}},{id:"q_card_alpha_2",last4:"9999",brand:"Quantum Platinum",exp_month:10,exp_year:2029,status:"active",spending_controls:{monthly_limit:1e6}}],fraud_monitoring:{status:"shield_active",threat_level:"low",recent_blocks:[{id:"blk_1",timestamp:new Date().toISOString(),reason:"Velocity Limit Exceeded",origin:"Unknown IP"}],ai_confidence:.9998},analytics:{cash_flow_forecast:[{month:"Jan",inflow:45e5,outflow:32e5},{month:"Feb",inflow:52e5,outflow:31e5},{month:"Mar",inflow:48e5,outflow:4e6}],risk_score:98,liquidity_ratio:4.5}},rge=f.createContext(void 0),eVt=({children:e})=>{const[t,n]=f.useState(ZHt),[r,o]=f.useState([]),[i,s]=f.useState([{id:"welcome",role:"assistant",content:"Welcome to the Quantum Financial Demo. I am your AI Treasury Assistant. You have the 'Golden Ticket' to explore our high-performance engine. How can I help you manage your capital today?",timestamp:new Date().toISOString()}]),[l,c]=f.useState(!1),u=f.useCallback((m,g,y="INFO")=>{const x={id:`log_${Date.now()}_${Math.random().toString(36).substr(2,5)}`,timestamp:new Date().toISOString(),action:m,actor:"SYSTEM",details:g,severity:y,ipAddress:"127.0.0.1 (Secure Proxy)"};o(v=>[x,...v].slice(0,100)),console.log(`[AUDIT] ${m}: ${g}`)},[]),d=()=>{o([]),u("LOGS_CLEARED","User cleared the audit trail.")},p=async m=>{const g={id:`msg_${Date.now()}`,role:"user",content:m,timestamp:new Date().toISOString()};s(y=>[...y,g]),c(!0),u("AI_QUERY",`User asked: "${m.substring(0,50)}..."`);try{throw new Error("GEMINI_API_KEY is not configured in the secrets manager.")}catch(y){console.error("AI Error:",y),s(x=>[...x,{id:`msg_err_${Date.now()}`,role:"assistant",content:"I apologize, the Quantum Neural Link is experiencing high-frequency interference. Please try again.",timestamp:new Date().toISOString()}])}finally{c(!1)}};f.useEffect(()=>{u("SESSION_START","User entered the Golden Ticket Demo Environment.")},[u]);const h={stripeData:t,setStripeData:n,auditLogs:r,chatMessages:i,isAiProcessing:l,sendMessage:p,logAction:u,clearLogs:d};return a.jsx(rge.Provider,{value:h,children:a.jsxs("div",{className:"quantum-provider-wrapper relative min-h-screen bg-slate-950 text-slate-100 font-sans selection:bg-cyan-500/30",children:[e,a.jsx(tVt,{}),a.jsx(nVt,{})]})})},tVt=()=>{const e=f.useContext(rge),[t,n]=f.useState(""),[r,o]=f.useState(!1);if(!e)return null;const i=s=>{s.preventDefault(),!(!t.trim()||e.isAiProcessing)&&(e.sendMessage(t),n(""))};return a.jsx("div",{className:`fixed bottom-6 right-6 z-50 transition-all duration-500 ${r?"w-96 h-[500px]":"w-16 h-16"}`,children:r?a.jsxs("div",{className:"w-full h-full bg-slate-900 border border-cyan-500/30 rounded-2xl shadow-2xl flex flex-col overflow-hidden backdrop-blur-xl",children:[a.jsxs("div",{className:"p-4 bg-gradient-to-r from-slate-800 to-slate-900 border-b border-cyan-500/20 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-cyan-400 rounded-full animate-pulse"}),a.jsx("span",{className:"text-xs font-bold tracking-widest text-cyan-400 uppercase",children:"Quantum AI Core"})]}),a.jsx("button",{onClick:()=>o(!1),className:"text-slate-400 hover:text-white",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 scrollbar-thin scrollbar-thumb-cyan-900",children:[e.chatMessages.map(s=>a.jsx("div",{className:`flex ${s.role==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[80%] p-3 rounded-xl text-sm ${s.role==="user"?"bg-cyan-600 text-white rounded-br-none":"bg-slate-800 text-slate-200 border border-slate-700 rounded-bl-none"}`,children:s.content})},s.id)),e.isAiProcessing&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-slate-800 p-3 rounded-xl flex gap-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce [animation-delay:0.2s]"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce [animation-delay:0.4s]"})]})})]}),a.jsx("form",{onSubmit:i,className:"p-4 bg-slate-800/50 border-t border-slate-700",children:a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:t,onChange:s=>n(s.target.value),placeholder:"Ask the Quantum Core...",className:"w-full bg-slate-950 border border-slate-700 rounded-lg py-2 px-4 text-sm focus:outline-none focus:border-cyan-500 transition-colors pr-10"}),a.jsx("button",{type:"submit",className:"absolute right-2 top-1/2 -translate-y-1/2 text-cyan-500 hover:text-cyan-400",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{d:"M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z"})})})]})})]}):a.jsx("button",{onClick:()=>o(!0),className:"w-full h-full bg-gradient-to-br from-cyan-500 to-blue-600 rounded-full shadow-[0_0_20px_rgba(6,182,212,0.5)] flex items-center justify-center hover:scale-110 transition-transform border border-cyan-400/50",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})})})})},nVt=()=>{const e=f.useContext(rge),[t,n]=f.useState(!1);return e?a.jsx("div",{className:`fixed left-6 bottom-6 z-40 transition-all duration-500 ${t?"w-[500px] h-[400px]":"w-48 h-10"}`,children:a.jsxs("div",{className:"w-full h-full bg-black/80 border border-red-500/20 rounded-lg backdrop-blur-md flex flex-col overflow-hidden",children:[a.jsxs("button",{onClick:()=>n(!t),className:"p-2 bg-red-950/20 flex items-center justify-between text-[10px] font-mono tracking-tighter text-red-400 uppercase",children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-1.5 h-1.5 bg-red-500 rounded-full animate-pulse"}),"Secure Audit Storage"]}),a.jsx("span",{children:t?"Collapse":"Expand"})]}),t&&a.jsxs("div",{className:"flex-1 overflow-y-auto p-3 font-mono text-[10px] space-y-2",children:[a.jsxs("div",{className:"flex justify-between border-b border-red-500/10 pb-1 mb-2",children:[a.jsx("span",{className:"text-red-500/50",children:"SYSTEM_UPTIME: 99.999%"}),a.jsx("button",{onClick:e.clearLogs,className:"hover:text-white text-red-500 underline",children:"WIPE_TRAIL"})]}),e.auditLogs.length===0&&a.jsx("div",{className:"text-slate-600 italic",children:"No sensitive actions recorded in current session."}),e.auditLogs.map(r=>a.jsxs("div",{className:"border-l border-red-500/30 pl-2 py-1",children:[a.jsxs("div",{className:"flex justify-between text-red-500/70",children:[a.jsxs("span",{children:["[",r.timestamp.split("T")[1].split(".")[0],"] ",r.action]}),a.jsx("span",{className:r.severity==="CRITICAL"?"text-red-500 font-bold":"",children:r.severity})]}),a.jsx("div",{className:"text-slate-400 truncate",children:r.details})]},r.id))]})]})}):null};class NXe{constructor(t,n){this.baseUrl=t,this.clientId=n}async retrieveMerchantList(t,n,r){return{merchantInformation:[{merchants:[{merchantName:"Mock Merchant",merchantNumber:"123",billTypeCode:"UTIL"}]}]}}async retrieveMerchantDetails(t,n,r){return{merchantDetails:[{merchantCustomerRelationshipType:"Customer",merchantCustomerRelationshipTypeCode:"CUST"}]}}async retrieveDestinationSourceAccountBillPay(t,n){return{sourceAccounts:[{sourceAccountId:"src_1",productName:"Checking",displaySourceAccountNumber:"1234",sourceAccountCurrencyCode:"USD",availableBalance:1e3}],payeeSourceAccountCombinations:[{payeeId:"payee_1",payeeNickName:"Electric Co",displayPayeeAccountNumber:"5678",payeeAccountCurrencyCode:"USD",paymentMethods:[{paymentMethod:"BILL_PAY"}]}]}}async createBillPaymentPreprocess(t,n,r){return{controlFlowId:"flow_123",debitDetails:{transactionDebitAmount:r.transactionAmount,currencyCode:"USD"},creditDetails:{transactionCreditAmount:r.transactionAmount,currencyCode:"USD"}}}async confirmBillPayment(t,n,r){return{transactionReferenceId:"ref_123",sourceAccount:{displaySourceAccountNumber:"1234",sourceAccountAvailableBalance:900,sourceCurrencyCode:"USD"}}}async retrievePayeeList(t,n){return{payeeList:[]}}async retrievePayeeDetailsById(t,n,r){return{}}async retrievePaymentInitiationTransactionRepeatingPayments(t,n){return{standingInstructions:[]}}async retrieveUnmaskedAccountData(t,n,r){return{accounts:[]}}async createCrossBorderTransferPreprocess(t,n,r){return{controlFlowId:"mock_flow",debitDetails:{},creditDetails:{},foreignExchangeRate:0,transactionFee:0,feeCurrencyCode:"USD"}}async confirmCrossBorderTransfer(t,n,r){return{transactionReferenceId:"mock_ref",sourceAccountDetails:{}}}async retrieveDestinationSourceAccountCrossBorderTransfer(t,n){return{sourceAccounts:[],payeeSourceAccountCombinations:[]}}async accountProxyTransfersSourceAccountEligibility(t,n,r){return{sourceAccounts:[]}}async createAccountProxyTransfersPreprocess(t,n,r){return{controlFlowId:"mock"}}async adhocAccountProxyTransfersPreprocessWithAddPayee(t,n,r){return{controlFlowId:"mock"}}async executeAccountProxyTransfers(t,n,r){return{transactionReferenceId:"mock"}}}const rVt=()=>({api:new NXe("https://mock.api","client_id"),accessToken:"mock_token",uuid:"mock_uuid",generateNewUuid:()=>{}}),jXe=f.createContext({api:null,accessToken:null,uuid:"",generateNewUuid:()=>{}}),gk=()=>f.useContext(jXe),oVt=({children:e})=>{const t=new NXe("https://sandbox.apihub.citi.com/gcb//api","client_id");return a.jsx(jXe.Provider,{value:{api:t,accessToken:"mock_token",uuid:"mock_uuid",generateNewUuid:()=>{}},children:e})},iVt=[{group:"Intelligence Command",items:[{view:wt.Dashboard,title:"Foundation Dashboard",icon:Pp},{view:wt.Transactions,title:"FlowMatrix (Transactions)",icon:ss},{view:wt.SendMoney,title:"Quantum Pay",icon:ZQ},{view:wt.Budgets,title:"Capital Allocation",icon:A$t},{view:wt.FinancialGoals,title:"Strategic Goals",icon:JG},{view:wt.CreditHealth,title:"Credit Resonance",icon:uf},{view:wt.Personalization,title:"Interface Will",icon:v0},{view:wt.Accounts,title:"Accounts Overview",icon:eC}]},{group:"The 527 Protocol",items:[{view:wt.TheBook,title:"The Blueprint (527 Pages)",icon:vie},{view:wt.KnowledgeBase,title:"The Academy",icon:Sie}]},{group:"Infinite Wealth",items:[{view:wt.Investments,title:"Portfolio Overview",icon:NC},{view:wt.Crypto,title:"Web3 & Crypto",icon:U3t},{view:wt.AlgoTradingLab,title:"Algo-Trading Lab",icon:IE},{view:wt.ForexArena,title:"Forex Arena",icon:vi},{view:wt.CommoditiesExchange,title:"Commodities",icon:b3t},{view:wt.RealEstateEmpire,title:"Real Estate",icon:J3t},{view:wt.ArtCollectibles,title:"Art & Collectibles",icon:Nie},{view:wt.DerivativesDesk,title:"Derivatives",icon:_$t},{view:wt.VentureCapital,title:"Venture Capital",icon:Gj},{view:wt.PrivateEquity,title:"Private Equity",icon:eC},{view:wt.TaxOptimization,title:"Civic Contribution",icon:zOt},{view:wt.LegacyBuilder,title:"Legacy Architect",icon:B$t},{view:wt.SovereignWealth,title:"Wealth Simulation",icon:Y1},{view:wt.QuantumAssets,title:"Quantum Assets",icon:VKe}]},{group:"Citi Connect Core",items:[{view:wt.CitibankAccounts,title:"Citi Accounts",icon:iO},{view:wt.CitibankAccountProxy,title:"Account Proxy",icon:ZQ},{view:wt.CitibankBillPay,title:"Bill Payment",icon:ss},{view:wt.CitibankCrossBorder,title:"Cross Border",icon:vi},{view:wt.CitibankPayeeManagement,title:"Payee Mgmt",icon:_E},{view:wt.CitibankStandingInstructions,title:"Standing Instructions",icon:ENe},{view:wt.CitibankDeveloperTools,title:"Citi Dev Tools",icon:IE},{view:wt.CitibankEligibility,title:"Eligibility Check",icon:dg},{view:wt.CitibankUnmaskedData,title:"Secure Data View",icon:k2}]},{group:"Plaid Nexus",items:[{view:wt.PlaidMainDashboard,title:"Plaid Overview",icon:Xi},{view:wt.PlaidIdentity,title:"Identity Verification",icon:tC},{view:wt.PlaidCRAMonitoring,title:"CRA Monitoring",icon:k2},{view:wt.PlaidInstitutions,title:"Institutions Explorer",icon:iO},{view:wt.PlaidItemManagement,title:"Item Management",icon:v0}]},{group:"Enterprise Operations",items:[{view:wt.CorporateCommand,title:"Corporate Command",icon:iO},{view:wt.ModernTreasury,title:"Modern Treasury",icon:Y1},{view:wt.Treasury,title:"Treasury & Capital",icon:cy},{view:wt.CardPrograms,title:"Marqeta Cards",icon:yh},{view:wt.Payments,title:"Stripe Payments",icon:_a},{view:wt.StripeNexus,title:"Stripe Nexus",icon:JQ},{view:wt.CounterpartyDashboard,title:"Counterparties",icon:_E},{view:wt.VirtualAccounts,title:"Virtual Accounts",icon:Fu},{view:wt.CorporateActions,title:"Corporate Actions",icon:ss},{view:wt.CreditNoteLedger,title:"Credit Notes",icon:ss},{view:wt.ReconciliationHub,title:"Reconciliation Hub",icon:ZQ},{view:wt.GEINDashboard,title:"GEIN Dashboard",icon:Fz},{view:wt.CardholderManagement,title:"Cardholder Mgmt",icon:tC},{view:wt.VentureCapitalDeskView,title:"VC Desk View",icon:Gj}]},{group:"System & Intelligence",items:[{view:wt.AIAdvisor,title:"AI Advisor",icon:Pp},{view:wt.AIInsights,title:"Predictive Insights",icon:mm},{view:wt.QuantumWeaver,title:"Quantum Weaver",icon:Fz},{view:wt.AgentMarketplace,title:"Agent Marketplace",icon:Q$t},{view:wt.AIAdStudio,title:"AI Ad Studio",icon:NNe},{view:wt.GlobalPositionMap,title:"Global Position Map",icon:vi},{view:wt.GlobalSsiHub,title:"Global SSI Hub",icon:rl},{view:wt.SecurityCompliance,title:"Security & Compliance",icon:uf},{view:wt.DeveloperHub,title:"Developer Hub",icon:IE},{view:wt.SchemaExplorer,title:"ISO 20022 Explorer",icon:Yp},{view:wt.ResourceGraph,title:"Resource Graph",icon:Fz},{view:wt.TheVision,title:"The Vision",icon:k2},{view:wt.ApiPlayground,title:"API Playground",icon:Bs},{view:wt.ComplianceOracle,title:"Compliance Oracle",icon:JKe}]},{group:"Admin & Tools",items:[{view:wt.CustomerDashboard,title:"Customer Dashboard",icon:_E},{view:wt.VerificationReports,title:"Verification Reports",icon:s3t},{view:wt.FinancialReporting,title:"Financial Reporting",icon:fR},{view:wt.StripeNexusDashboard,title:"Stripe Nexus Admin",icon:Bme}]},{group:"All Components",items:[{view:wt.AccountDetails,title:"Account Details",icon:ss},{view:wt.AccountList,title:"Account List",icon:ss},{view:wt.AccountStatementGrid,title:"Account Statement Grid",icon:XKe},{view:wt.AccountsView,title:"Accounts View",icon:eC},{view:wt.AccountVerificationModal,title:"Acct Verification Modal",icon:uf},{view:wt.ACHDetailsDisplay,title:"ACH Details Display",icon:ss},{view:wt.AICommandLog,title:"AI Command Log",icon:Bs},{view:wt.AIPredictionWidget,title:"AI Prediction Widget",icon:mm},{view:wt.AssetCatalog,title:"Asset Catalog",icon:MOt},{view:wt.AutomatedSweepRules,title:"Automated Sweep Rules",icon:ENe},{view:wt.BalanceReportChart,title:"Balance Report Chart",icon:fR},{view:wt.BalanceTransactionTable,title:"Balance Txn Table",icon:ss},{view:wt.CardDesignVisualizer,title:"Card Design Visualizer",icon:Nie},{view:wt.ChargeDetailModal,title:"Charge Detail Modal",icon:ss},{view:wt.ChargeList,title:"Charge List",icon:ss},{view:wt.ConductorConfigurationView,title:"Conductor Config",icon:v0},{view:wt.CounterpartyDetails,title:"Counterparty Details",icon:tC},{view:wt.CounterpartyForm,title:"Counterparty Form",icon:Yp},{view:wt.DisruptionIndexMeter,title:"Disruption Index Meter",icon:Xi},{view:wt.DocumentUploader,title:"Document Uploader",icon:Yp},{view:wt.DownloadLink,title:"Download Link",icon:JQ},{view:wt.EarlyFraudWarningFeed,title:"Fraud Warning Feed",icon:zu},{view:wt.ElectionChoiceForm,title:"Election Choice Form",icon:Yp},{view:wt.EventNotificationCard,title:"Event Notification Card",icon:NNe},{view:wt.ExpectedPaymentsTable,title:"Expected Payments Table",icon:ss},{view:wt.ExternalAccountCard,title:"External Account Card",icon:yh},{view:wt.ExternalAccountForm,title:"External Account Form",icon:Yp},{view:wt.ExternalAccountsTable,title:"External Accounts Table",icon:ss},{view:wt.FinancialAccountCard,title:"Financial Account Card",icon:yh},{view:wt.IncomingPaymentDetailList,title:"Incoming Pmt Detail",icon:ss},{view:wt.InvoiceFinancingRequest,title:"Invoice Financing Req",icon:Yp},{view:wt.PaymentInitiationForm,title:"Payment Initiation Form",icon:Yp},{view:wt.PaymentMethodDetails,title:"Pmt Method Details",icon:ss},{view:wt.PaymentOrderForm,title:"Payment Order Form",icon:Yp},{view:wt.PayoutsDashboard,title:"Payouts Dashboard",icon:cy},{view:wt.PnLChart,title:"PnL Chart",icon:XG},{view:wt.RefundForm,title:"Refund Form",icon:Yp},{view:wt.RemittanceInfoEditor,title:"Remittance Info Editor",icon:Yp},{view:wt.ReportingView,title:"Reporting View",icon:fR},{view:wt.ReportRunGenerator,title:"Report Run Generator",icon:Yp},{view:wt.ReportStatusIndicator,title:"Report Status Indicator",icon:Xi},{view:wt.SsiEditorForm,title:"SSI Editor Form",icon:Yp},{view:wt.StripeNexusView,title:"Stripe Nexus View",icon:JQ},{view:wt.StripeStatusBadge,title:"Stripe Status Badge",icon:uf},{view:wt.StructuredPurposeInput,title:"Structured Purpose Input",icon:Yp},{view:wt.SubscriptionList,title:"Subscription List",icon:ss},{view:wt.TimeSeriesChart,title:"Time Series Chart",icon:fR},{view:wt.TradeConfirmationModal,title:"Trade Confirm Modal",icon:ss},{view:wt.TransactionFilter,title:"Transaction Filter",icon:Yp},{view:wt.TransactionList,title:"Transaction List",icon:ss},{view:wt.TreasuryTransactionList,title:"Treasury Txn List",icon:ss},{view:wt.UniversalObjectInspector,title:"Object Inspector",icon:k2},{view:wt.VirtualAccountForm,title:"Virtual Acct Form",icon:Yp},{view:wt.VirtualAccountsTable,title:"Virtual Accts Table",icon:ss},{view:wt.VoiceControl,title:"Voice Control",icon:v$t},{view:wt.WebhookSimulator,title:"Webhook Simulator",icon:Bs}]}],aVt=({className:e})=>a.jsxs("svg",{className:e,viewBox:"0 0 100 100",fill:"none",children:[a.jsx("path",{d:"M20,50 C20,20 80,20 80,50 C80,80 20,80 20,50",stroke:"currentColor",strokeWidth:"8",strokeLinecap:"round"}),a.jsx("path",{d:"M20,50 C20,80 80,80 80,50 C80,20 20,20 20,50",stroke:"currentColor",strokeWidth:"8",strokeLinecap:"round",opacity:"0.3"}),a.jsx("circle",{cx:"50",cy:"50",r:"10",fill:"currentColor",className:"animate-pulse"})]}),sVt=({isOpen:e,setIsOpen:t})=>{const n=f.useContext(ia),r=sk();if(!n)return null;const{activeView:o,setActiveView:i}=n,s=l=>{i(l),t(!1)};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:`fixed inset-0 bg-black/80 z-30 transition-opacity lg:hidden ${e?"opacity-100":"opacity-0 pointer-events-none"}`,onClick:()=>t(!1)}),a.jsxs("div",{className:`flex flex-col w-72 bg-black border-r border-gray-800 fixed lg:relative inset-y-0 left-0 z-40 transform transition-transform duration-500 ease-out ${e?"translate-x-0":"-translate-x-full"} lg:translate-x-0`,children:[a.jsx("div",{className:"flex items-center justify-between h-20 px-6 border-b border-gray-800",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(aVt,{className:"h-10 w-10 text-indigo-500"}),a.jsxs("div",{className:"ml-3",children:[a.jsx("span",{className:"text-lg font-black text-white tracking-tighter uppercase italic",children:"Nexus OS"}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Bs,{size:10,className:"text-emerald-500"}),a.jsx("span",{className:"text-[8px] font-mono text-gray-500 uppercase tracking-widest leading-none",children:"Kernel: v5.2.7-LTS"})]})]})]})}),a.jsxs("nav",{className:"flex-1 px-4 py-6 space-y-8 overflow-y-auto custom-scrollbar",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("h3",{className:"px-3 text-[10px] font-black text-gray-600 uppercase tracking-[0.3em] mb-4 flex items-center gap-2",children:["Showcase",a.jsx("div",{className:"h-px bg-gray-800 flex-1"})]}),a.jsx("div",{className:"space-y-1",children:a.jsxs("button",{onClick:()=>r("/business-demo"),className:"flex items-center w-full text-left px-4 py-2.5 text-xs font-bold rounded-xl transition-all duration-300 group text-amber-400 hover:text-amber-200 hover:bg-amber-900/20 border border-amber-500/20",children:[a.jsx(WKe,{className:"w-4 h-4 mr-3 transition-colors text-amber-400 group-hover:text-amber-200"}),a.jsx("span",{className:"flex-1",children:"Enterprise Demo"}),a.jsx(mm,{size:12,className:"text-amber-400 animate-pulse"})]})})]}),iVt.map((l,c)=>a.jsxs("div",{className:"space-y-2",children:[a.jsxs("h3",{className:"px-3 text-[10px] font-black text-gray-600 uppercase tracking-[0.3em] mb-4 flex items-center gap-2",children:[l.group,a.jsx("div",{className:"h-px bg-gray-800 flex-1"})]}),a.jsx("div",{className:"space-y-1",children:l.items.map(u=>{const d=o===u.view,p=u.icon;return a.jsxs("button",{onClick:()=>s(u.view),className:`flex items-center w-full text-left px-4 py-2.5 text-xs font-bold rounded-xl transition-all duration-300 group ${d?"bg-indigo-600 text-white shadow-xl shadow-indigo-600/20":"text-gray-500 hover:text-gray-200 hover:bg-gray-800/50"}`,children:[p&&a.jsx(p,{className:`w-4 h-4 mr-3 transition-colors ${d?"text-white":"text-gray-600 group-hover:text-indigo-400"}`}),a.jsx("span",{className:"flex-1",children:u.title}),d&&a.jsx(mm,{size:12,className:"text-indigo-300 animate-pulse"})]},u.view)})})]},`group-${c}`))]}),a.jsx("div",{className:"p-4 border-t border-gray-900 bg-gray-950/50 mt-auto",children:a.jsxs("div",{className:"flex items-center gap-3 p-3 bg-indigo-900/10 border border-indigo-500/20 rounded-2xl",children:[a.jsx(bie,{className:"text-indigo-400",size:16}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-[10px] font-black text-white uppercase tracking-tighter truncate",children:"The Caretaker"}),a.jsx("p",{className:"text-[8px] font-mono text-indigo-400 uppercase tracking-widest",children:"Sovereign Admin"})]}),a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"})]})})]})]})},lVt=()=>{const e=["Intelligence Core: Actively analyzing portfolio...","Intelligence Core: Monitoring market data...","Intelligence Core: Identified 2 potential opportunities...","Intelligence Core: All systems nominal.","Intelligence Core: Cross-referencing patterns...","Intelligence Core: Compiling weekly insights..."],[t,n]=f.useState(0);return f.useEffect(()=>{const r=setInterval(()=>{n(o=>(o+1)%e.length)},4e3);return()=>clearInterval(r)},[]),a.jsxs("div",{className:"hidden lg:flex items-center space-x-2 text-xs text-cyan-300/80 bg-gray-900/40 px-3 py-1.5 rounded-full border border-cyan-500/10 transition-all duration-500",children:[a.jsxs("div",{className:"flex space-x-0.5 items-end h-4",children:[a.jsx("span",{className:"w-1 h-1 bg-cyan-400 rounded-full animate-pulse [animation-delay:-0.3s]"}),a.jsx("span",{className:"w-1 h-2 bg-cyan-400 rounded-full animate-pulse [animation-delay:-0.15s]"}),a.jsx("span",{className:"w-1 h-3 bg-cyan-400 rounded-full animate-pulse"}),a.jsx("span",{className:"w-1 h-2 bg-cyan-400 rounded-full animate-pulse [animation-delay:-0.15s]"}),a.jsx("span",{className:"w-1 h-1 bg-cyan-400 rounded-full animate-pulse [animation-delay:-0.3s]"})]}),a.jsx("span",{className:"font-mono",children:e[t]})]})},cVt=({onMenuClick:e})=>{const t=f.useContext(ia),[n,r]=f.useState(!1),[o,i]=f.useState(!1);if(!t)throw new Error("Header must be used within a DataProvider");const{notifications:s,markNotificationRead:l,setActiveView:c}=t,u=s.filter(p=>!p.read).length,d=p=>{p.view&&c(p.view),l(p.id),r(!1)};return a.jsxs("header",{className:"py-4 px-6 bg-gray-900/30 backdrop-blur-md border-b border-gray-700/50 flex justify-between items-center z-20",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("button",{onClick:e,className:"lg:hidden mr-4 text-gray-400 hover:text-white","aria-label":"Open navigation menu",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),a.jsxs("h1",{className:"text-lg sm:text-xl font-semibold text-white tracking-wider uppercase flex items-center gap-2",children:[a.jsx("span",{className:"text-cyan-400 font-bold",children:a.jsx(w3,{className:"w-5 h-5"})})," Infinite Intelligence Foundation"]})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(lVt,{}),a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>r(p=>!p),className:"text-gray-400 hover:text-white focus:outline-none",children:[a.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),u>0&&a.jsx("span",{className:"absolute top-0 right-0 block h-2 w-2 rounded-full bg-cyan-400 ring-2 ring-gray-900"})]}),n&&a.jsxs("div",{className:"absolute right-0 mt-2 w-80 bg-gray-800 border border-gray-700 rounded-lg shadow-lg z-50",children:[a.jsx("div",{className:"p-3 font-semibold text-white border-b border-gray-700",children:"Notifications"}),a.jsx("div",{className:"max-h-96 overflow-y-auto",children:s.map(p=>a.jsxs("div",{onClick:()=>d(p),className:`p-3 text-sm flex items-start border-b border-gray-700/50 cursor-pointer ${p.read?"opacity-60":"bg-cyan-500/10"}`,children:[!p.read&&a.jsx("div",{className:"w-2 h-2 rounded-full bg-cyan-400 mt-1.5 flex-shrink-0"}),a.jsxs("div",{className:"ml-2",children:[a.jsx("p",{className:"text-gray-200",children:p.message}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:p.timestamp})]})]},p.id))})]})]}),a.jsxs("div",{className:"relative",children:[a.jsxs("button",{onClick:()=>i(p=>!p),className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-cyan-500 to-indigo-600 flex items-center justify-center border-2 border-cyan-400",children:a.jsx("span",{className:"font-bold text-white",children:"II"})}),a.jsx("span",{className:"hidden sm:block font-medium text-white",children:"The Caretaker"})]}),o&&a.jsxs("div",{className:"absolute right-0 mt-2 w-48 bg-gray-800 border border-gray-700 rounded-lg shadow-lg z-50",children:[a.jsx("a",{href:"#",onClick:p=>{p.preventDefault(),c(wt.Settings),i(!1)},className:"block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700",children:"Settings"}),a.jsx("a",{href:"#",onClick:p=>{p.preventDefault(),alert("Logout functionality not implemented.")},className:"block px-4 py-2 text-sm text-gray-300 hover:bg-gray-700",children:"Logout"})]})]})]})]})};var uVt=["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 oge(e){if(typeof e!="string")return!1;var t=uVt;return t.includes(e)}var dVt=["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"],fVt=new Set(dVt);function EXe(e){return typeof e!="string"?!1:fVt.has(e)}function IXe(e){return typeof e=="string"&&e.startsWith("data-")}function dl(e){if(typeof e!="object"||e===null)return{};var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(EXe(n)||IXe(n))&&(t[n]=e[n]);return t}function dw(e){if(e==null)return null;if(f.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return dl(t)}return typeof e=="object"&&!Array.isArray(e)?dl(e):null}function iu(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(EXe(n)||IXe(n)||oge(n))&&(t[n]=e[n]);return t}function pVt(e){return e==null?null:f.isValidElement(e)?iu(e.props):typeof e=="object"&&!Array.isArray(e)?iu(e):null}var hVt=["children","width","height","viewBox","className","style","title","desc"];function qie(){return qie=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,width:r,height:o,viewBox:i,className:s,style:l,title:c,desc:u}=e,d=mVt(e,hVt),p=i||{width:r,height:o,x:0,y:0},h=be("recharts-surface",s);return f.createElement("svg",qie({},iu(d),{className:h,width:r,height:o,style:l,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),f.createElement("title",null,c),f.createElement("desc",null,u),n)}),xVt=["children","className"];function Kie(){return Kie=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,className:r}=e,o=yVt(e,xVt),i=be("recharts-layer",r);return f.createElement("g",Kie({className:i},iu(o),{ref:t}),n)}),_Xe=f.createContext(null),bVt=()=>f.useContext(_Xe);function El(e){return function(){return e}}const PXe=Math.cos,UH=Math.sin,jy=Math.sqrt,WH=Math.PI,sq=2*WH,Yie=Math.PI,Xie=2*Yie,mj=1e-6,wVt=Xie-mj;function AXe(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return AXe;const n=10**t;return function(r){this._+=r[0];for(let o=1,i=r.length;omj)if(!(Math.abs(p*c-u*d)>mj)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let m=r-s,g=o-l,y=c*c+u*u,x=m*m+g*g,v=Math.sqrt(y),b=Math.sqrt(h),w=i*Math.tan((Yie-Math.acos((y+h-x)/(2*v*b)))/2),S=w/b,C=w/v;Math.abs(S-1)>mj&&this._append`L${t+S*d},${n+S*p}`,this._append`A${i},${i},0,0,${+(p*m>d*g)},${this._x1=t+C*c},${this._y1=n+C*u}`}}arc(t,n,r,o,i,s){if(t=+t,n=+n,r=+r,s=!!s,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(o),c=r*Math.sin(o),u=t+l,d=n+c,p=1^s,h=s?o-i:i-o;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>mj||Math.abs(this._y1-d)>mj)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%Xie+Xie),h>wVt?this._append`A${r},${r},0,1,${p},${t-l},${n-c}A${r},${r},0,1,${p},${this._x1=u},${this._y1=d}`:h>mj&&this._append`A${r},${r},0,${+(h>=Yie)},${p},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+o}h${-r}Z`}toString(){return this._}};function age(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new CVt(t)}function sge(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function TXe(e){this._context=e}TXe.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 lq(e){return new TXe(e)}function kXe(e){return e[0]}function MXe(e){return e[1]}function RXe(e,t){var n=El(!0),r=null,o=lq,i=null,s=age(l);e=typeof e=="function"?e:e===void 0?kXe:El(e),t=typeof t=="function"?t:t===void 0?MXe:El(t);function l(c){var u,d=(c=sge(c)).length,p,h=!1,m;for(r==null&&(i=o(m=s())),u=0;u<=d;++u)!(u=m;--g)l.point(w[g],S[g]);l.lineEnd(),l.areaEnd()}v&&(w[h]=+e(x,h,p),S[h]=+t(x,h,p),l.point(r?+r(x,h,p):w[h],n?+n(x,h,p):S[h]))}if(b)return l=null,b+""||null}function d(){return RXe().defined(o).curve(s).context(i)}return u.x=function(p){return arguments.length?(e=typeof p=="function"?p:El(+p),r=null,u):e},u.x0=function(p){return arguments.length?(e=typeof p=="function"?p:El(+p),u):e},u.x1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:El(+p),u):r},u.y=function(p){return arguments.length?(t=typeof p=="function"?p:El(+p),n=null,u):t},u.y0=function(p){return arguments.length?(t=typeof p=="function"?p:El(+p),u):t},u.y1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:El(+p),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(p){return arguments.length?(o=typeof p=="function"?p:El(!!p),u):o},u.curve=function(p){return arguments.length?(s=p,i!=null&&(l=s(i)),u):s},u.context=function(p){return arguments.length?(p==null?i=l=null:l=s(i=p),u):i},u}class OXe{constructor(t,n){this._context=t,this._x=n}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,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function NVt(e){return new OXe(e,!0)}function jVt(e){return new OXe(e,!1)}const lge={draw(e,t){const n=jy(t/WH);e.moveTo(n,0),e.arc(0,0,n,0,sq)}},EVt={draw(e,t){const n=jy(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},$Xe=jy(1/3),IVt=$Xe*2,_Vt={draw(e,t){const n=jy(t/IVt),r=n*$Xe;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},PVt={draw(e,t){const n=jy(t),r=-n/2;e.rect(r,r,n,n)}},AVt=.8908130915292852,DXe=UH(WH/10)/UH(7*WH/10),TVt=UH(sq/10)*DXe,kVt=-PXe(sq/10)*DXe,MVt={draw(e,t){const n=jy(t*AVt),r=TVt*n,o=kVt*n;e.moveTo(0,-n),e.lineTo(r,o);for(let i=1;i<5;++i){const s=sq*i/5,l=PXe(s),c=UH(s);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*o,c*r+l*o)}e.closePath()}},aJ=jy(3),RVt={draw(e,t){const n=-jy(t/(aJ*3));e.moveTo(0,n*2),e.lineTo(-aJ*n,-n),e.lineTo(aJ*n,-n),e.closePath()}},Mg=-.5,Rg=jy(3)/2,Qie=1/jy(12),OVt=(Qie/2+1)*3,$Vt={draw(e,t){const n=jy(t/OVt),r=n/2,o=n*Qie,i=r,s=n*Qie+n,l=-i,c=s;e.moveTo(r,o),e.lineTo(i,s),e.lineTo(l,c),e.lineTo(Mg*r-Rg*o,Rg*r+Mg*o),e.lineTo(Mg*i-Rg*s,Rg*i+Mg*s),e.lineTo(Mg*l-Rg*c,Rg*l+Mg*c),e.lineTo(Mg*r+Rg*o,Mg*o-Rg*r),e.lineTo(Mg*i+Rg*s,Mg*s-Rg*i),e.lineTo(Mg*l+Rg*c,Mg*c-Rg*l),e.closePath()}};function DVt(e,t){let n=null,r=age(o);e=typeof e=="function"?e:El(e||lge),t=typeof t=="function"?t:El(t===void 0?64:+t);function o(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return o.type=function(i){return arguments.length?(e=typeof i=="function"?i:El(i),o):e},o.size=function(i){return arguments.length?(t=typeof i=="function"?i:El(+i),o):t},o.context=function(i){return arguments.length?(n=i??null,o):n},o}function GH(){}function qH(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function LXe(e){this._context=e}LXe.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:qH(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:qH(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function LVt(e){return new LXe(e)}function FXe(e){this._context=e}FXe.prototype={areaStart:GH,areaEnd:GH,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:qH(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function FVt(e){return new FXe(e)}function zXe(e){this._context=e}zXe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:qH(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function zVt(e){return new zXe(e)}function BXe(e){this._context=e}BXe.prototype={areaStart:GH,areaEnd:GH,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 BVt(e){return new BXe(e)}function AEe(e){return e<0?-1:1}function TEe(e,t,n){var r=e._x1-e._x0,o=t-e._x1,i=(e._y1-e._y0)/(r||o<0&&-0),s=(n-e._y1)/(o||r<0&&-0),l=(i*o+s*r)/(r+o);return(AEe(i)+AEe(s))*Math.min(Math.abs(i),Math.abs(s),.5*Math.abs(l))||0}function kEe(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function sJ(e,t,n){var r=e._x0,o=e._y0,i=e._x1,s=e._y1,l=(i-r)/3;e._context.bezierCurveTo(r+l,o+l*t,i-l,s-l*n,i,s)}function KH(e){this._context=e}KH.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:sJ(this,this._t0,kEe(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,sJ(this,kEe(this,n=TEe(this,e,t)),n);break;default:sJ(this,this._t0,n=TEe(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function HXe(e){this._context=new VXe(e)}(HXe.prototype=Object.create(KH.prototype)).point=function(e,t){KH.prototype.point.call(this,t,e)};function VXe(e){this._context=e}VXe.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,o,i){this._context.bezierCurveTo(t,e,r,n,i,o)}};function HVt(e){return new KH(e)}function VVt(e){return new HXe(e)}function UXe(e){this._context=e}UXe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=MEe(e),o=MEe(t),i=0,s=1;s=0;--t)o[t]=(s[t]-o[t+1])/i[t];for(i[n-1]=(e[n]+o[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function WVt(e){return new cq(e,.5)}function GVt(e){return new cq(e,0)}function qVt(e){return new cq(e,1)}function tI(e,t){if((s=e.length)>1)for(var n=1,r,o,i=e[t[0]],s,l=i.length;n=0;)n[t]=t;return n}function KVt(e,t){return e[t]}function YVt(e){const t=[];return t.key=e,t}function XVt(){var e=El([]),t=Jie,n=tI,r=KVt;function o(i){var s=Array.from(e.apply(this,arguments),YVt),l,c=s.length,u=-1,d;for(const p of i)for(l=0,++u;l0){for(var n,r,o=0,i=e[0].length,s;o0){for(var n=0,r=e[t[0]],o,i=r.length;n0)||!((i=(o=e[t[0]]).length)>0))){for(var n=0,r=1,o,i,s;r1&&arguments[1]!==void 0?arguments[1]:oUt,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Ac(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{var l=n[s-1];return typeof l=="string"?o+l+i:l!==void 0?o+R2(l)+i:o+i},"")}var df=e=>e===0?0:e>0?1:-1,dy=e=>typeof e=="number"&&e!=+e,rI=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Mr=e=>(typeof e=="number"||e instanceof Number)&&!dy(e),M0=e=>Mr(e)||typeof e=="string",iUt=0,N3=e=>{var t=++iUt;return"".concat(e||"").concat(t)},Ap=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Mr(t)&&typeof t!="string")return r;var i;if(rI(t)){if(n==null)return r;var s=t.indexOf("%");i=n*parseFloat(t.slice(0,s))/100}else i=+t;return dy(i)&&(i=r),o&&n!=null&&i>n&&(i=n),i},GXe=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;rr&&(typeof t=="function"?t(r):nI(r,t))===n)}var Ml=e=>e===null||typeof e>"u",lL=e=>Ml(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function jp(e){return e!=null}function Ey(){}var aUt=["type","size","sizeType"];function Zie(){return Zie=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t="symbol".concat(lL(e));return KXe[t]||lge},hUt=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*fUt;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},mUt=(e,t)=>{KXe["symbol".concat(lL(e))]=t},fge=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,o=uUt(e,aUt),i=HEe(HEe({},o),{},{type:t,size:n,sizeType:r}),s="circle";typeof t=="string"&&(s=t);var l=()=>{var h=pUt(s),m=DVt().type(h).size(hUt(n,r,s)),g=m();if(g!==null)return g},{className:c,cx:u,cy:d}=i,p=iu(i);return Mr(u)&&Mr(d)&&Mr(n)?f.createElement("path",Zie({},p,{className:be("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:l()})):null};fge.registerSymbol=mUt;var YXe=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,pge=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(f.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(o=>{oge(o)&&(r[o]=(i=>n[o](n,i)))}),r},gUt=(e,t,n)=>r=>(e(t,n,r),null),ZI=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(o=>{var i=e[o];oge(o)&&typeof i=="function"&&(r||(r={}),r[o]=gUt(i,t,n))}),r};function VEe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function xUt(e){for(var t=1;t(s[l]===void 0&&r[l]!==void 0&&(s[l]=r[l]),s),n);return i}function YH(){return YH=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var h=d.formatter||o,m=be({"recharts-legend-item":!0,["legend-item-".concat(p)]:!0,inactive:d.inactive});if(d.type==="none")return null;var g=d.inactive?i:d.color,y=h?h(d.value,d,p):d.value;return f.createElement("li",YH({className:m,style:c,key:"legend-item-".concat(p)},ZI(e,d,p)),f.createElement(ige,{width:n,height:n,viewBox:l,style:u,"aria-label":"".concat(y," legend icon")},f.createElement(EUt,{data:d,iconType:s,inactiveColor:i})),f.createElement("span",{className:"recharts-legend-item-text",style:{color:g}},y))})}var _Ut=e=>{var t=Hs(e,jUt),{payload:n,layout:r,align:o}=t;if(!n||!n.length)return null;var i={padding:0,margin:0,textAlign:r==="horizontal"?o:"left"};return f.createElement("ul",{className:"recharts-default-legend",style:i},f.createElement(IUt,YH({},t,{payload:n})))},mJ={},gJ={},WEe;function PUt(){return WEe||(WEe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const o=new Map;for(let i=0;i=0}e.isLength=t})(wJ)),wJ}var YEe;function hge(){return YEe||(YEe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=TUt();function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(bJ)),bJ}var SJ={},XEe;function kUt(){return XEe||(XEe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(SJ)),SJ}var QEe;function MUt(){return QEe||(QEe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hge(),n=kUt();function r(o){return n.isObjectLike(o)&&t.isArrayLike(o)}e.isArrayLikeObject=r})(vJ)),vJ}var CJ={},NJ={},JEe;function RUt(){return JEe||(JEe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=dge();function n(r){return function(o){return t.get(o,r)}}e.property=n})(NJ)),NJ}var jJ={},EJ={},IJ={},_J={},ZEe;function XXe(){return ZEe||(ZEe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(_J)),_J}var PJ={},eIe;function QXe(){return eIe||(eIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(PJ)),PJ}var AJ={},tIe;function JXe(){return tIe||(tIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(AJ)),AJ}var nIe;function OUt(){return nIe||(nIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=XXe(),n=QXe(),r=JXe();function o(d,p,h){return typeof h!="function"?o(d,p,()=>{}):i(d,p,function m(g,y,x,v,b,w){const S=h(g,y,x,v,b,w);return S!==void 0?!!S:i(g,y,m,w)},new Map)}function i(d,p,h,m){if(p===d)return!0;switch(typeof p){case"object":return s(d,p,h,m);case"function":return Object.keys(p).length>0?i(d,{...p},h,m):r.isEqualsSameValueZero(d,p);default:return t.isObject(d)?typeof p=="string"?p==="":!0:r.isEqualsSameValueZero(d,p)}}function s(d,p,h,m){if(p==null)return!0;if(Array.isArray(p))return c(d,p,h,m);if(p instanceof Map)return l(d,p,h,m);if(p instanceof Set)return u(d,p,h,m);const g=Object.keys(p);if(d==null||n.isPrimitive(d))return g.length===0;if(g.length===0)return!0;if(m!=null&&m.has(p))return m.get(p)===d;m==null||m.set(p,d);try{for(let y=0;y{})}e.isMatch=n})(EJ)),EJ}var TJ={},kJ={},MJ={},oIe;function $Ut(){return oIe||(oIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(MJ)),MJ}var RJ={},iIe;function mge(){return iIe||(iIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(RJ)),RJ}var OJ={},aIe;function eQe(){return aIe||(aIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",o="[object Boolean]",i="[object Arguments]",s="[object Symbol]",l="[object Date]",c="[object Map]",u="[object Set]",d="[object Array]",p="[object Function]",h="[object ArrayBuffer]",m="[object Object]",g="[object Error]",y="[object DataView]",x="[object Uint8Array]",v="[object Uint8ClampedArray]",b="[object Uint16Array]",w="[object Uint32Array]",S="[object BigUint64Array]",C="[object Int8Array]",N="[object Int16Array]",j="[object Int32Array]",I="[object BigInt64Array]",_="[object Float32Array]",T="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=h,e.arrayTag=d,e.bigInt64ArrayTag=I,e.bigUint64ArrayTag=S,e.booleanTag=o,e.dataViewTag=y,e.dateTag=l,e.errorTag=g,e.float32ArrayTag=_,e.float64ArrayTag=T,e.functionTag=p,e.int16ArrayTag=N,e.int32ArrayTag=j,e.int8ArrayTag=C,e.mapTag=c,e.numberTag=r,e.objectTag=m,e.regexpTag=t,e.setTag=u,e.stringTag=n,e.symbolTag=s,e.uint16ArrayTag=b,e.uint32ArrayTag=w,e.uint8ArrayTag=x,e.uint8ClampedArrayTag=v})(OJ)),OJ}var $J={},sIe;function DUt(){return sIe||(sIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})($J)),$J}var lIe;function tQe(){return lIe||(lIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$Ut(),n=mge(),r=eQe(),o=QXe(),i=DUt();function s(d,p){return l(d,void 0,d,new Map,p)}function l(d,p,h,m=new Map,g=void 0){const y=g==null?void 0:g(d,p,h,m);if(y!==void 0)return y;if(o.isPrimitive(d))return d;if(m.has(d))return m.get(d);if(Array.isArray(d)){const x=new Array(d.length);m.set(d,x);for(let v=0;vt.isMatch(i,o)}e.matches=r})(jJ)),jJ}var DJ={},LJ={},FJ={},dIe;function zUt(){return dIe||(dIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tQe(),n=mge(),r=eQe();function o(i,s){return t.cloneDeepWith(i,(l,c,u,d)=>{const p=s==null?void 0:s(l,c,u,d);if(p!==void 0)return p;if(typeof i=="object"){if(n.getTag(i)===r.objectTag&&typeof i.constructor!="function"){const h={};return d.set(i,h),t.copyProperties(h,i,u,d),h}switch(Object.prototype.toString.call(i)){case r.numberTag:case r.stringTag:case r.booleanTag:{const h=new i.constructor(i==null?void 0:i.valueOf());return t.copyProperties(h,i),h}case r.argumentsTag:{const h={};return t.copyProperties(h,i),h.length=i.length,h[Symbol.iterator]=i[Symbol.iterator],h}default:return}}})}e.cloneDeepWith=o})(FJ)),FJ}var fIe;function BUt(){return fIe||(fIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=zUt();function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(LJ)),LJ}var zJ={},BJ={},pIe;function nQe(){return pIe||(pIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,o=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:l;return qJ.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,qJ}var SIe;function oQe(){return SIe||(SIe=1,GJ.exports=KUt()),GJ.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 CIe;function YUt(){if(CIe)return WJ;CIe=1;var e=ik(),t=oQe();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,l=e.useMemo,c=e.useDebugValue;return WJ.useSyncExternalStoreWithSelector=function(u,d,p,h,m){var g=i(null);if(g.current===null){var y={hasValue:!1,value:null};g.current=y}else y=g.current;g=l(function(){function v(N){if(!b){if(b=!0,w=N,N=h(N),m!==void 0&&y.hasValue){var j=y.value;if(m(j,N))return S=j}return S=N}if(j=S,r(w,N))return j;var I=h(N);return m!==void 0&&m(j,I)?(w=N,j):(w=N,S=I)}var b=!1,w,S,C=p===void 0?null:p;return[function(){return v(d())},C===null?void 0:function(){return v(C())}]},[d,p,h,m]);var x=o(u,g[0],g[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),c(x),x},WJ}var NIe;function XUt(){return NIe||(NIe=1,UJ.exports=YUt()),UJ.exports}var xge=XUt();const QUt=Ba(xge);var yge=f.createContext(null),JUt=e=>e,fs=()=>{var e=f.useContext(yge);return e?e.store.dispatch:JUt},Uz=()=>{},ZUt=()=>Uz,eWt=(e,t)=>e===t;function gr(e){var t=f.useContext(yge),n=f.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Uz,[t,e]);return xge.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:ZUt,t?t.store.getState:Uz,t?t.store.getState:Uz,n,eWt)}var XH=Symbol("NOT_FOUND");function tWt(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function nWt(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function rWt(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var jIe=e=>Array.isArray(e)?e:[e];function oWt(e){const t=Array.isArray(e[0])?e[0]:e;return rWt(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function iWt(e,t){const n=[],{length:r}=e;for(let o=0;ot(l,u.key));if(c>-1){const u=n[c];return c>0&&(n.splice(c,1),n.unshift(u)),u.value}return XH}function o(l,c){r(l)===XH&&(n.unshift({key:l,value:c}),n.length>e&&n.pop())}function i(){return n}function s(){n=[]}return{get:r,put:o,getEntries:i,clear:s}}var lWt=(e,t)=>e===t;function cWt(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let i=0;ii(m.value,d));h&&(d=h.value,l!==0&&l--)}c.put(arguments,d)}return d}return u.clearCache=()=>{c.clear(),u.resetResultsCount()},u.resultsCount=()=>l,u.resetResultsCount=()=>{l=0},u}var uWt=class{constructor(e){this.value=e}deref(){return this.value}},dWt=typeof WeakRef<"u"?WeakRef:uWt,fWt=0,EIe=1;function J8(){return{s:fWt,v:void 0,o:null,p:null}}function iQe(e,t={}){let n=J8();const{resultEqualityCheck:r}=t;let o,i=0;function s(){var p;let l=n;const{length:c}=arguments;for(let h=0,m=c;h{n=J8(),s.resetResultsCount()},s.resultsCount=()=>i,s.resetResultsCount=()=>{i=0},s}function aQe(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let i=0,s=0,l,c={},u=o.pop();typeof u=="object"&&(c=u,u=o.pop()),tWt(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const d={...n,...c},{memoize:p,memoizeOptions:h=[],argsMemoize:m=iQe,argsMemoizeOptions:g=[]}=d,y=jIe(h),x=jIe(g),v=oWt(o),b=p(function(){return i++,u.apply(null,arguments)},...y),w=m(function(){s++;const C=iWt(v,arguments);return l=b.apply(null,C),l},...x);return Object.assign(w,{resultFunc:u,memoizedResultFunc:b,dependencies:v,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>l,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:p,argsMemoize:m})};return Object.assign(r,{withTypes:()=>r}),r}var on=aQe(iQe),pWt=Object.assign((e,t=on)=>{nWt(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(i=>e[i]);return t(r,(...i)=>i.reduce((s,l,c)=>(s[n[c]]=l,s),{}))},{withTypes:()=>pWt}),KJ={},YJ={},XJ={},IIe;function hWt(){return IIe||(IIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,o,i)=>{if(r!==o){const s=t(r),l=t(o);if(s===l&&s===0){if(ro)return i==="desc"?-1:1}return i==="desc"?l-s:s-l}return 0};e.compareValues=n})(XJ)),XJ}var QJ={},JJ={},_Ie;function sQe(){return _Ie||(_Ie=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(JJ)),JJ}var PIe;function mWt(){return PIe||(PIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sQe(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function o(i,s){return Array.isArray(i)?!1:typeof i=="number"||typeof i=="boolean"||i==null||t.isSymbol(i)?!0:typeof i=="string"&&(r.test(i)||!n.test(i))||s!=null&&Object.hasOwn(s,i)}e.isKey=o})(QJ)),QJ}var AIe;function gWt(){return AIe||(AIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hWt(),n=mWt(),r=uge();function o(i,s,l,c){if(i==null)return[];l=c?void 0:l,Array.isArray(i)||(i=Object.values(i)),Array.isArray(s)||(s=s==null?[null]:[s]),s.length===0&&(s=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(m=>String(m));const u=(m,g)=>{let y=m;for(let x=0;xg==null||m==null?g:typeof m=="object"&&"key"in m?Object.hasOwn(g,m.key)?g[m.key]:u(g,m.path):typeof m=="function"?m(g):Array.isArray(m)?u(g,m):typeof g=="object"?g[m]:g,p=s.map(m=>(Array.isArray(m)&&m.length===1&&(m=m[0]),m==null||typeof m=="function"||Array.isArray(m)||n.isKey(m)?m:{key:m,path:r.toPath(m)}));return i.map(m=>({original:m,criteria:p.map(g=>d(g,m))})).slice().sort((m,g)=>{for(let y=0;ym.original)}e.orderBy=o})(YJ)),YJ}var ZJ={},TIe;function xWt(){return TIe||(TIe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const o=[],i=Math.floor(r),s=(l,c)=>{for(let u=0;u1&&r.isIterateeCall(i,s[0],s[1])?s=[]:l>2&&r.isIterateeCall(s[0],s[1],s[2])&&(s=[s[0]]),t.orderBy(i,n.flatten(s),["asc"])}e.sortBy=o})(KJ)),KJ}var tZ,RIe;function vWt(){return RIe||(RIe=1,tZ=yWt().sortBy),tZ}var bWt=vWt();const dq=Ba(bWt);var cQe=e=>e.legend.settings,wWt=e=>e.legend.size,SWt=e=>e.legend.payload,CWt=on([SWt,cQe],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?dq(r,n):r});function NWt(){return gr(CWt)}var Z8=1;function uQe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=f.useState({height:0,left:0,top:0,width:0}),r=f.useCallback(o=>{if(o!=null){var i=o.getBoundingClientRect(),s={height:i.height,left:i.left,top:i.top,width:i.width};(Math.abs(s.height-t.height)>Z8||Math.abs(s.left-t.left)>Z8||Math.abs(s.top-t.top)>Z8||Math.abs(s.width-t.width)>Z8)&&n({height:s.height,left:s.left,top:s.top,width:s.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function kf(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 jWt=typeof Symbol=="function"&&Symbol.observable||"@@observable",OIe=jWt,nZ=()=>Math.random().toString(36).substring(7).split("").join("."),EWt={INIT:`@@redux/INIT${nZ()}`,REPLACE:`@@redux/REPLACE${nZ()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${nZ()}`},QH=EWt;function bge(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 dQe(e,t,n){if(typeof e!="function")throw new Error(kf(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(kf(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(kf(1));return n(dQe)(e,t)}let r=e,o=t,i=new Map,s=i,l=0,c=!1;function u(){s===i&&(s=new Map,i.forEach((x,v)=>{s.set(v,x)}))}function d(){if(c)throw new Error(kf(3));return o}function p(x){if(typeof x!="function")throw new Error(kf(4));if(c)throw new Error(kf(5));let v=!0;u();const b=l++;return s.set(b,x),function(){if(v){if(c)throw new Error(kf(6));v=!1,u(),s.delete(b),i=null}}}function h(x){if(!bge(x))throw new Error(kf(7));if(typeof x.type>"u")throw new Error(kf(8));if(typeof x.type!="string")throw new Error(kf(17));if(c)throw new Error(kf(9));try{c=!0,o=r(o,x)}finally{c=!1}return(i=s).forEach(b=>{b()}),x}function m(x){if(typeof x!="function")throw new Error(kf(10));r=x,h({type:QH.REPLACE})}function g(){const x=p;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(kf(11));function b(){const S=v;S.next&&S.next(d())}return b(),{unsubscribe:x(b)}},[OIe](){return this}}}return h({type:QH.INIT}),{dispatch:h,subscribe:p,getState:d,replaceReducer:m,[OIe]:g}}function IWt(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:QH.INIT})>"u")throw new Error(kf(12));if(typeof n(void 0,{type:QH.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(kf(13))})}function fQe(e){const t=Object.keys(e),n={};for(let i=0;i"u")throw l&&l.type,new Error(kf(14));u[p]=g,c=c||g!==m}return c=c||r.length!==Object.keys(s).length,c?u:s}}function JH(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function _Wt(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(kf(15))};const s={getState:o.getState,dispatch:(c,...u)=>i(c,...u)},l=e.map(c=>c(s));return i=JH(...l)(o.dispatch),{...o,dispatch:i}}}function pQe(e){return bge(e)&&"type"in e&&typeof e.type=="string"}var hQe=Symbol.for("immer-nothing"),$Ie=Symbol.for("immer-draftable"),jh=Symbol.for("immer-state");function Lx(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var tg=Object,nT=tg.getPrototypeOf,ZH="constructor",fq="prototype",eae="configurable",eV="enumerable",Wz="writable",j3="value",fw=e=>!!e&&!!e[jh];function fy(e){var t;return e?mQe(e)||hq(e)||!!e[$Ie]||!!((t=e[ZH])!=null&&t[$Ie])||mq(e)||gq(e):!1}var PWt=tg[fq][ZH].toString(),DIe=new WeakMap;function mQe(e){if(!e||!wge(e))return!1;const t=nT(e);if(t===null||t===tg[fq])return!0;const n=tg.hasOwnProperty.call(t,ZH)&&t[ZH];if(n===Object)return!0;if(!nP(n))return!1;let r=DIe.get(n);return r===void 0&&(r=Function.toString.call(n),DIe.set(n,r)),r===PWt}function pq(e,t,n=!0){cL(e)===0?(n?Reflect.ownKeys(e):tg.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((r,o)=>t(o,r,e))}function cL(e){const t=e[jh];return t?t.type_:hq(e)?1:mq(e)?2:gq(e)?3:0}var LIe=(e,t,n=cL(e))=>n===2?e.has(t):tg[fq].hasOwnProperty.call(e,t),tae=(e,t,n=cL(e))=>n===2?e.get(t):e[t],tV=(e,t,n,r=cL(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function AWt(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var hq=Array.isArray,mq=e=>e instanceof Map,gq=e=>e instanceof Set,wge=e=>typeof e=="object",nP=e=>typeof e=="function",rZ=e=>typeof e=="boolean";function TWt(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var S1=e=>e.copy_||e.base_,Sge=e=>e.modified_?e.copy_:e.base_;function nae(e,t){if(mq(e))return new Map(e);if(gq(e))return new Set(e);if(hq(e))return Array[fq].slice.call(e);const n=mQe(e);if(t===!0||t==="class_only"&&!n){const r=tg.getOwnPropertyDescriptors(e);delete r[jh];let o=Reflect.ownKeys(r);for(let i=0;i1&&tg.defineProperties(e,{set:eF,add:eF,clear:eF,delete:eF}),tg.freeze(e),t&&pq(e,(n,r)=>{Cge(r,!0)},!1)),e}function kWt(){Lx(2)}var eF={[j3]:kWt};function xq(e){return e===null||!wge(e)?!0:tg.isFrozen(e)}var nV="MapSet",rae="Patches",FIe="ArrayMethods",gQe={};function oI(e){const t=gQe[e];return t||Lx(0,e),t}var zIe=e=>!!gQe[e],E3,xQe=()=>E3,MWt=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:zIe(nV)?oI(nV):void 0,arrayMethodsPlugin_:zIe(FIe)?oI(FIe):void 0});function BIe(e,t){t&&(e.patchPlugin_=oI(rae),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function oae(e){iae(e),e.drafts_.forEach(RWt),e.drafts_=null}function iae(e){e===E3&&(E3=e.parent_)}var HIe=e=>E3=MWt(E3,e);function RWt(e){const t=e[jh];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function VIe(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[jh].modified_&&(oae(t),Lx(4)),fy(e)&&(e=UIe(t,e));const{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(n[jh].base_,e,t)}else e=UIe(t,n);return OWt(t,e,!0),oae(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==hQe?e:void 0}function UIe(e,t){if(xq(t))return t;const n=t[jh];if(!n)return rV(t,e.handledSet_,e);if(!yq(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);bQe(n,e)}return n.copy_}function OWt(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Cge(t,n)}function yQe(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var yq=(e,t)=>e.scope_===t,$Wt=[];function vQe(e,t,n,r){const o=S1(e),i=e.type_;if(r!==void 0&&tae(o,r,i)===t){tV(o,r,n,i);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;pq(o,(c,u)=>{if(fw(u)){const d=l.get(u)||[];d.push(c),l.set(u,d)}})}const s=e.draftLocations_.get(t)??$Wt;for(const l of s)tV(o,l,n,i)}function DWt(e,t,n){e.callbacks_.push(function(o){var l;const i=t;if(!i||!yq(i,o))return;(l=o.mapSetPlugin_)==null||l.fixSetContents(i);const s=Sge(i);vQe(e,i.draft_??i,s,n),bQe(i,o)})}function bQe(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:o}=t;if(o){const i=o.getPath(e);i&&o.generatePatches_(e,i,t)}yQe(e)}}function LWt(e,t,n){const{scope_:r}=e;if(fw(n)){const o=n[jh];yq(o,r)&&o.callbacks_.push(function(){Gz(e);const s=Sge(o);vQe(e,n,s,t)})}else fy(n)&&e.callbacks_.push(function(){const i=S1(e);e.type_===3?i.has(n)&&rV(n,r.handledSet_,r):tae(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&rV(tae(e.copy_,t,e.type_),r.handledSet_,r)})}function rV(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||fw(e)||t.has(e)||!fy(e)||xq(e)||(t.add(e),pq(e,(r,o)=>{if(fw(o)){const i=o[jh];if(yq(i,n)){const s=Sge(i);tV(e,r,s,e.type_),yQe(i)}}else fy(o)&&rV(o,t,n)})),e}function FWt(e,t){const n=hq(e),r={type_:n?1:0,scope_:t?t.scope_:xQe(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let o=r,i=oV;n&&(o=[r],i=I3);const{revoke:s,proxy:l}=Proxy.revocable(o,i);return r.draft_=l,r.revoke_=s,[l,r]}var oV={get(e,t){if(t===jh)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const o=S1(e);if(!LIe(o,t,e.type_))return zWt(e,o,t);const i=o[t];if(e.finalized_||!fy(i)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&TWt(t))return i;if(i===oZ(e.base_,t)){Gz(e);const s=e.type_===1?+t:t,l=sae(e.scope_,i,e,s);return e.copy_[s]=l}return i},has(e,t){return t in S1(e)},ownKeys(e){return Reflect.ownKeys(S1(e))},set(e,t,n){const r=wQe(S1(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=oZ(S1(e),t),i=o==null?void 0:o[jh];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(AWt(n,o)&&(n!==void 0||LIe(e.base_,t,e.type_)))return!0;Gz(e),aae(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),LWt(e,t,n)),!0},deleteProperty(e,t){return Gz(e),oZ(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),aae(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=S1(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Wz]:!0,[eae]:e.type_!==1||t!=="length",[eV]:r[eV],[j3]:n[t]}},defineProperty(){Lx(11)},getPrototypeOf(e){return nT(e.base_)},setPrototypeOf(){Lx(12)}},I3={};for(let e in oV){let t=oV[e];I3[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}I3.deleteProperty=function(e,t){return I3.set.call(this,e,t,void 0)};I3.set=function(e,t,n){return oV.set.call(this,e[0],t,n,e[0])};function oZ(e,t){const n=e[jh];return(n?S1(n):e)[t]}function zWt(e,t,n){var o;const r=wQe(t,n);return r?j3 in r?r[j3]:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function wQe(e,t){if(!(t in e))return;let n=nT(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=nT(n)}}function aae(e){e.modified_||(e.modified_=!0,e.parent_&&aae(e.parent_))}function Gz(e){e.copy_||(e.assigned_=new Map,e.copy_=nae(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var BWt=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,o)=>{if(nP(n)&&!nP(r)){const s=r;r=n;const l=this;return function(u=s,...d){return l.produce(u,p=>r.call(this,p,...d))}}nP(r)||Lx(6),o!==void 0&&!nP(o)&&Lx(7);let i;if(fy(n)){const s=HIe(this),l=sae(s,n,void 0);let c=!0;try{i=r(l),c=!1}finally{c?oae(s):iae(s)}return BIe(s,o),VIe(i,s)}else if(!n||!wge(n)){if(i=r(n),i===void 0&&(i=n),i===hQe&&(i=void 0),this.autoFreeze_&&Cge(i,!0),o){const s=[],l=[];oI(rae).generateReplacementPatches_(n,i,{patches_:s,inversePatches_:l}),o(s,l)}return i}else Lx(1,n)},this.produceWithPatches=(n,r)=>{if(nP(n))return(l,...c)=>this.produceWithPatches(l,u=>n(u,...c));let o,i;return[this.produce(n,r,(l,c)=>{o=l,i=c}),o,i]},rZ(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),rZ(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),rZ(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){fy(t)||Lx(8),fw(t)&&(t=ey(t));const n=HIe(this),r=sae(n,t,void 0);return r[jh].isManual_=!0,iae(n),r}finishDraft(t,n){const r=t&&t[jh];(!r||!r.isManual_)&&Lx(9);const{scope_:o}=r;return BIe(o,n),VIe(void 0,o)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const i=n[r];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}r>-1&&(n=n.slice(r+1));const o=oI(rae).applyPatches_;return fw(t)?o(t,n):this.produce(t,i=>o(i,n))}};function sae(e,t,n,r){const[o,i]=mq(t)?oI(nV).proxyMap_(t,n):gq(t)?oI(nV).proxySet_(t,n):FWt(t,n);return((n==null?void 0:n.scope_)??xQe()).drafts_.push(o),i.callbacks_=(n==null?void 0:n.callbacks_)??[],i.key_=r,n&&r!==void 0?DWt(n,i,r):i.callbacks_.push(function(c){var d;(d=c.mapSetPlugin_)==null||d.fixSetContents(i);const{patchPlugin_:u}=c;i.modified_&&u&&u.generatePatches_(i,[],c)}),o}function ey(e){return fw(e)||Lx(10,e),SQe(e)}function SQe(e){if(!fy(e)||xq(e))return e;const t=e[jh];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=nae(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=nae(e,!0);return pq(n,(o,i)=>{tV(n,o,SQe(i))},r),t&&(t.finalized_=!1),n}var HWt=new BWt,CQe=HWt.produce;function NQe(e){return({dispatch:n,getState:r})=>o=>i=>typeof i=="function"?i(n,r,e):o(i)}var VWt=NQe(),UWt=NQe,WWt=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?JH:JH.apply(null,arguments)};function R0(e,t){function n(...r){if(t){let o=t(...r);if(!o)throw new Error(ag(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>pQe(r)&&r.type===e,n}var jQe=class hR extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,hR.prototype)}static get[Symbol.species](){return hR}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new hR(...t[0].concat(this)):new hR(...t.concat(this))}};function WIe(e){return fy(e)?CQe(e,()=>{}):e}function tF(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function GWt(e){return typeof e=="boolean"}var qWt=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{};let s=new jQe;return n&&(GWt(n)?s.push(VWt):s.push(UWt(n.extraArgument))),s},EQe="RTK_autoBatch",fc=()=>e=>({payload:e,meta:{[EQe]:!0}}),GIe=e=>t=>{setTimeout(t,e)},IQe=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,s=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:GIe(10):e.type==="callback"?e.queueNotification:GIe(e.timeout),u=()=>{s=!1,i&&(i=!1,l.forEach(d=>d()))};return Object.assign({},r,{subscribe(d){const p=()=>o&&d(),h=r.subscribe(p);return l.add(d),()=>{h(),l.delete(d)}},dispatch(d){var p;try{return o=!((p=d==null?void 0:d.meta)!=null&&p[EQe]),i=!o,i&&(s||(s=!0,c(u))),r.dispatch(d)}finally{o=!0}}})},KWt=e=>function(n){const{autoBatch:r=!0}=n??{};let o=new jQe(e);return r&&o.push(IQe(typeof r=="object"?r:void 0)),o};function YWt(e){const t=qWt(),{reducer:n=void 0,middleware:r,devTools:o=!0,preloadedState:i=void 0,enhancers:s=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(bge(n))l=fQe(n);else throw new Error(ag(1));let c;typeof r=="function"?c=r(t):c=t();let u=JH;o&&(u=WWt({trace:!1,...typeof o=="object"&&o}));const d=_Wt(...c),p=KWt(d);let h=typeof s=="function"?s(p):p();const m=u(...h);return dQe(l,i,m)}function _Qe(e){const t={},n=[];let r;const o={addCase(i,s){const l=typeof i=="string"?i:i.type;if(!l)throw new Error(ag(28));if(l in t)throw new Error(ag(29));return t[l]=s,o},addAsyncThunk(i,s){return s.pending&&(t[i.pending.type]=s.pending),s.rejected&&(t[i.rejected.type]=s.rejected),s.fulfilled&&(t[i.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:i.settled,reducer:s.settled}),o},addMatcher(i,s){return n.push({matcher:i,reducer:s}),o},addDefaultCase(i){return r=i,o}};return e(o),[t,n,r]}function XWt(e){return typeof e=="function"}function QWt(e,t){let[n,r,o]=_Qe(t),i;if(XWt(e))i=()=>WIe(e());else{const l=WIe(e);i=()=>l}function s(l=i(),c){let u=[n[c.type],...r.filter(({matcher:d})=>d(c)).map(({reducer:d})=>d)];return u.filter(d=>!!d).length===0&&(u=[o]),u.reduce((d,p)=>{if(p)if(fw(d)){const m=p(d,c);return m===void 0?d:m}else{if(fy(d))return CQe(d,h=>p(h,c));{const h=p(d,c);if(h===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return h}}return d},l)}return s.getInitialState=i,s}var JWt="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",ZWt=(e=21)=>{let t="",n=e;for(;n--;)t+=JWt[Math.random()*64|0];return t},eGt=Symbol.for("rtk-slice-createasyncthunk");function tGt(e,t){return`${e}/${t}`}function nGt({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[eGt];return function(o){const{name:i,reducerPath:s=i}=o;if(!i)throw new Error(ag(11));const l=(typeof o.reducers=="function"?o.reducers(oGt()):o.reducers)||{},c=Object.keys(l),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(S,C){const N=typeof S=="string"?S:S.type;if(!N)throw new Error(ag(12));if(N in u.sliceCaseReducersByType)throw new Error(ag(13));return u.sliceCaseReducersByType[N]=C,d},addMatcher(S,C){return u.sliceMatchers.push({matcher:S,reducer:C}),d},exposeAction(S,C){return u.actionCreators[S]=C,d},exposeCaseReducer(S,C){return u.sliceCaseReducersByName[S]=C,d}};c.forEach(S=>{const C=l[S],N={reducerName:S,type:tGt(i,S),createNotation:typeof o.reducers=="function"};aGt(C)?lGt(N,C,d,t):iGt(N,C,d)});function p(){const[S={},C=[],N=void 0]=typeof o.extraReducers=="function"?_Qe(o.extraReducers):[o.extraReducers],j={...S,...u.sliceCaseReducersByType};return QWt(o.initialState,I=>{for(let _ in j)I.addCase(_,j[_]);for(let _ of u.sliceMatchers)I.addMatcher(_.matcher,_.reducer);for(let _ of C)I.addMatcher(_.matcher,_.reducer);N&&I.addDefaultCase(N)})}const h=S=>S,m=new Map,g=new WeakMap;let y;function x(S,C){return y||(y=p()),y(S,C)}function v(){return y||(y=p()),y.getInitialState()}function b(S,C=!1){function N(I){let _=I[S];return typeof _>"u"&&C&&(_=tF(g,N,v)),_}function j(I=h){const _=tF(m,C,()=>new WeakMap);return tF(_,I,()=>{const T={};for(const[P,E]of Object.entries(o.selectors??{}))T[P]=rGt(E,I,()=>tF(g,I,v),C);return T})}return{reducerPath:S,getSelectors:j,get selectors(){return j(N)},selectSlice:N}}const w={name:i,reducer:x,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:v,...b(s),injectInto(S,{reducerPath:C,...N}={}){const j=C??s;return S.inject({reducerPath:j,reducer:x},N),{...w,...b(j,!0)}}};return w}}function rGt(e,t,n,r){function o(i,...s){let l=t(i);return typeof l>"u"&&r&&(l=n()),e(l,...s)}return o.unwrapped=e,o}var bm=nGt();function oGt(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function iGt({type:e,reducerName:t,createNotation:n},r,o){let i,s;if("reducer"in r){if(n&&!sGt(r))throw new Error(ag(17));i=r.reducer,s=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?R0(e,s):R0(e))}function aGt(e){return e._reducerDefinitionType==="asyncThunk"}function sGt(e){return e._reducerDefinitionType==="reducerWithPrepare"}function lGt({type:e,reducerName:t},n,r,o){if(!o)throw new Error(ag(18));const{payloadCreator:i,fulfilled:s,pending:l,rejected:c,settled:u,options:d}=n,p=o(e,i,d);r.exposeAction(t,p),s&&r.addCase(p.fulfilled,s),l&&r.addCase(p.pending,l),c&&r.addCase(p.rejected,c),u&&r.addMatcher(p.settled,u),r.exposeCaseReducer(t,{fulfilled:s||nF,pending:l||nF,rejected:c||nF,settled:u||nF})}function nF(){}var cGt="task",PQe="listener",AQe="completed",Nge="cancelled",uGt=`task-${Nge}`,dGt=`task-${AQe}`,lae=`${PQe}-${Nge}`,fGt=`${PQe}-${AQe}`,vq=class{constructor(e){ze(this,"name","TaskAbortError");ze(this,"message");this.code=e,this.message=`${cGt} ${Nge} (reason: ${e})`}},jge=(e,t)=>{if(typeof e!="function")throw new TypeError(ag(32))},iV=()=>{},TQe=(e,t=iV)=>(e.catch(t),e),kQe=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),PE=e=>{if(e.aborted)throw new vq(e.reason)};function MQe(e,t){let n=iV;return new Promise((r,o)=>{const i=()=>o(new vq(e.reason));if(e.aborted){i();return}n=kQe(e,i),t.finally(()=>n()).then(r,o)}).finally(()=>{n=iV})}var pGt=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof vq?"cancelled":"rejected",error:n}}finally{t==null||t()}},aV=e=>t=>TQe(MQe(e,t).then(n=>(PE(e),n))),RQe=e=>{const t=aV(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:sA}=Object,qIe={},bq="listenerMiddleware",hGt=(e,t)=>{const n=r=>kQe(e,()=>r.abort(e.reason));return(r,o)=>{jge(r);const i=new AbortController;n(i);const s=pGt(async()=>{PE(e),PE(i.signal);const l=await r({pause:aV(i.signal),delay:RQe(i.signal),signal:i.signal});return PE(i.signal),l},()=>i.abort(dGt));return o!=null&&o.autoJoin&&t.push(s.catch(iV)),{result:aV(e)(s),cancel(){i.abort(uGt)}}}},mGt=(e,t)=>{const n=async(r,o)=>{PE(t);let i=()=>{};const l=[new Promise((c,u)=>{let d=e({predicate:r,effect:(p,h)=>{h.unsubscribe(),c([p,h.getState(),h.getOriginalState()])}});i=()=>{d(),u()}})];o!=null&&l.push(new Promise(c=>setTimeout(c,o,null)));try{const c=await MQe(t,Promise.race(l));return PE(t),c}finally{i()}};return(r,o)=>TQe(n(r,o))},OQe=e=>{let{type:t,actionCreator:n,matcher:r,predicate:o,effect:i}=e;if(t)o=R0(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error(ag(21));return jge(i),{predicate:o,type:t,effect:i}},$Qe=sA(e=>{const{type:t,predicate:n,effect:r}=OQe(e);return{id:ZWt(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(ag(22))}}},{withTypes:()=>$Qe}),KIe=(e,t)=>{const{type:n,effect:r,predicate:o}=OQe(t);return Array.from(e.values()).find(i=>(typeof n=="string"?i.type===n:i.predicate===o)&&i.effect===r)},cae=e=>{e.pending.forEach(t=>{t.abort(lae)})},gGt=(e,t)=>()=>{for(const n of t.keys())cae(n);e.clear()},YIe=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},DQe=sA(R0(`${bq}/add`),{withTypes:()=>DQe}),xGt=R0(`${bq}/removeAll`),LQe=sA(R0(`${bq}/remove`),{withTypes:()=>LQe}),yGt=(...e)=>{console.error(`${bq}/error`,...e)},uL=(e={})=>{const t=new Map,n=new Map,r=m=>{const g=n.get(m)??0;n.set(m,g+1)},o=m=>{const g=n.get(m)??1;g===1?n.delete(m):n.set(m,g-1)},{extra:i,onError:s=yGt}=e;jge(s);const l=m=>(m.unsubscribe=()=>t.delete(m.id),t.set(m.id,m),g=>{m.unsubscribe(),g!=null&&g.cancelActive&&cae(m)}),c=m=>{const g=KIe(t,m)??$Qe(m);return l(g)};sA(c,{withTypes:()=>c});const u=m=>{const g=KIe(t,m);return g&&(g.unsubscribe(),m.cancelActive&&cae(g)),!!g};sA(u,{withTypes:()=>u});const d=async(m,g,y,x)=>{const v=new AbortController,b=mGt(c,v.signal),w=[];try{m.pending.add(v),r(m),await Promise.resolve(m.effect(g,sA({},y,{getOriginalState:x,condition:(S,C)=>b(S,C).then(Boolean),take:b,delay:RQe(v.signal),pause:aV(v.signal),extra:i,signal:v.signal,fork:hGt(v.signal,w),unsubscribe:m.unsubscribe,subscribe:()=>{t.set(m.id,m)},cancelActiveListeners:()=>{m.pending.forEach((S,C,N)=>{S!==v&&(S.abort(lae),N.delete(S))})},cancel:()=>{v.abort(lae),m.pending.delete(v)},throwIfCancelled:()=>{PE(v.signal)}})))}catch(S){S instanceof vq||YIe(s,S,{raisedBy:"effect"})}finally{await Promise.all(w),v.abort(fGt),o(m),m.pending.delete(v)}},p=gGt(t,n);return{middleware:m=>g=>y=>{if(!pQe(y))return g(y);if(DQe.match(y))return c(y.payload);if(xGt.match(y)){p();return}if(LQe.match(y))return u(y.payload);let x=m.getState();const v=()=>{if(x===qIe)throw new Error(ag(23));return x};let b;try{if(b=g(y),t.size>0){const w=m.getState(),S=Array.from(t.values());for(const C of S){let N=!1;try{N=C.predicate(y,w,x)}catch(j){N=!1,YIe(s,j,{raisedBy:"predicate"})}N&&d(C,y,m,v)}}}finally{x=qIe}return b},startListening:c,stopListening:u,clearListeners:p}};function ag(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 vGt={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},FQe=bm({name:"chartLayout",initialState:vGt,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 n,r,o,i;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(o=t.payload.bottom)!==null&&o!==void 0?o:0,e.margin.left=(i=t.payload.left)!==null&&i!==void 0?i:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:bGt,setLayout:wGt,setChartSize:SGt,setScale:CGt}=FQe.actions,NGt=FQe.reducer;function zQe(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function ci(e){return Number.isFinite(e)}function ob(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function XIe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function bP(e){for(var t=1;t{if(t&&n){var{width:r,height:o}=n,{align:i,verticalAlign:s,layout:l}=t;if((l==="vertical"||l==="horizontal"&&s==="middle")&&i!=="center"&&Mr(e[i]))return bP(bP({},e),{},{[i]:e[i]+(r||0)});if((l==="horizontal"||l==="vertical"&&i==="center")&&s!=="middle"&&Mr(e[s]))return bP(bP({},e),{},{[s]:e[s]+(o||0)})}return e},q0=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",BQe=(e,t,n,r)=>{if(r)return e.map(l=>l.coordinate);var o,i,s=e.map(l=>(l.coordinate===t&&(o=!0),l.coordinate===n&&(i=!0),l.coordinate));return o||s.push(t),i||s.push(n),s},HQe=(e,t,n)=>{if(!e)return null;var{duplicateDomain:r,type:o,range:i,scale:s,realScaleType:l,isCategorical:c,categoricalDomain:u,tickCount:d,ticks:p,niceTicks:h,axisType:m}=e;if(!s)return null;var g=l==="scaleBand"&&s.bandwidth?s.bandwidth()/2:2,y=o==="category"&&s.bandwidth?s.bandwidth()/g:0;if(y=m==="angleAxis"&&i&&i.length>=2?df(i[0]-i[1])*2*y:y,p||h){var x=(p||h||[]).map((v,b)=>{var w=r?r.indexOf(v):v,S=s.map(w);return ci(S)?{coordinate:S+y,value:v,offset:y,index:b}:null}).filter(jp);return x}return c&&u?u.map((v,b)=>{var w=s.map(v);return ci(w)?{coordinate:w+y,value:v,index:b,offset:y}:null}).filter(jp):s.ticks&&d!=null?s.ticks(d).map((v,b)=>{var w=s.map(v);return ci(w)?{coordinate:w+y,value:v,index:b,offset:y}:null}).filter(jp):s.domain().map((v,b)=>{var w=s.map(v);return ci(w)?{coordinate:w+y,value:r?r[v]:v,index:b,offset:y}:null}).filter(jp)},PGt=(e,t)=>{if(!t||t.length!==2||!Mr(t[0])||!Mr(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),o=[e[0],e[1]];return(!Mr(e[0])||e[0]r)&&(o[1]=r),o[0]>r&&(o[0]=r),o[1]{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var o=0;o=0?(u[0]=i,i+=h,u[1]=i):(u[0]=s,s+=h,u[1]=s)}}}},TGt=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var o=0;o=0?(c[0]=i,i+=u,c[1]=i):(c[0]=0,c[1]=0)}}}},kGt={sign:AGt,expand:QVt,none:tI,silhouette:JVt,wiggle:ZVt,positive:TGt},MGt=(e,t,n)=>{var r,o=(r=kGt[n])!==null&&r!==void 0?r:tI,i=XVt().keys(t).value((l,c)=>Number(La(l,c,0))).order(Jie).offset(o),s=i(e);return s.forEach((l,c)=>{l.forEach((u,d)=>{var p=La(e[d],t[c],0);Array.isArray(p)&&p.length===2&&Mr(p[0])&&Mr(p[1])&&(u[0]=p[0],u[1]=p[1])})}),s};function VQe(e){return e==null?void 0:String(e)}function sV(e){var{axis:t,ticks:n,bandSize:r,entry:o,index:i,dataKey:s}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ml(o[t.dataKey])){var l=qXe(n,"value",o[t.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[i]?n[i].coordinate+r/2:null}var c=La(o,Ml(s)?t.dataKey:s),u=t.scale.map(c);return Mr(u)?u:null}var QIe=e=>{var{axis:t,ticks:n,offset:r,bandSize:o,entry:i,index:s}=e;if(t.type==="category")return n[s]?n[s].coordinate+r:null;var l=La(i,t.dataKey,t.scale.domain()[s]);if(Ml(l))return null;var c=t.scale.map(l);return Mr(c)?c-o/2+r:null},RGt=e=>{var{numericAxis:t}=e,n=t.scale.domain();if(t.type==="number"){var r=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return r<=0&&o>=0?0:o<0?o:r}return n[0]},OGt=e=>{var t=e.flat(2).filter(Mr);return[Math.min(...t),Math.max(...t)]},$Gt=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],DGt=(e,t,n)=>{if(e!=null)return $Gt(Object.keys(e).reduce((r,o)=>{var i=e[o];if(!i)return r;var{stackedData:s}=i,l=s.reduce((c,u)=>{var d=zQe(u,t,n),p=OGt(d);return!ci(p[0])||!ci(p[1])?c:[Math.min(c[0],p[0]),Math.max(c[1],p[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},JIe=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ZIe=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ib=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var o=dq(t,d=>d.coordinate),i=1/0,s=1,l=o.length;s{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},FGt=(e,t)=>t==="centric"?e.angle:e.radius,Hw=e=>e.layout.width,Vw=e=>e.layout.height,zGt=e=>e.layout.scale,UQe=e=>e.layout.margin,wq=on(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Sq=on(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),WQe="data-recharts-item-index",GQe="data-recharts-item-id",dL=60;function t5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function rF(e){for(var t=1;te.brush.height;function WGt(e){var t=Sq(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var o=typeof r.width=="number"?r.width:dL;return n+o}return n},0)}function GGt(e){var t=Sq(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var o=typeof r.width=="number"?r.width:dL;return n+o}return n},0)}function qGt(e){var t=wq(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function KGt(e){var t=wq(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var Dd=on([Hw,Vw,UQe,UGt,WGt,GGt,qGt,KGt,cQe,wWt],(e,t,n,r,o,i,s,l,c,u)=>{var d={left:(n.left||0)+o,right:(n.right||0)+i},p={top:(n.top||0)+s,bottom:(n.bottom||0)+l},h=rF(rF({},p),d),m=h.bottom;h.bottom+=r,h=_Gt(h,c,u);var g=e-h.left-h.right,y=t-h.top-h.bottom;return rF(rF({brushBottom:m},h),{},{width:Math.max(g,0),height:Math.max(y,0)})}),YGt=on(Dd,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Ege=on(Hw,Vw,(e,t)=>({x:0,y:0,width:e,height:t})),qQe=f.createContext(null),Vu=()=>f.useContext(qQe)!=null,XGt=e=>{var{children:t}=e;return f.createElement(qQe.Provider,{value:!0},t)},Cq=e=>e.brush,fL=on([Cq,Dd,UQe],(e,t,n)=>({height:e.height,x:Mr(e.x)?e.x:t.left,y:Mr(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:Mr(e.width)?e.width:t.width})),iZ={},aZ={},sZ={},n5e;function QGt(){return n5e||(n5e=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:o,edges:i}={}){let s,l=null;const c=i!=null&&i.includes("leading"),u=i==null||i.includes("trailing"),d=()=>{l!==null&&(n.apply(s,l),s=void 0,l=null)},p=()=>{u&&d(),y()};let h=null;const m=()=>{h!=null&&clearTimeout(h),h=setTimeout(()=>{h=null,p()},r)},g=()=>{h!==null&&(clearTimeout(h),h=null)},y=()=>{g(),s=void 0,l=null},x=()=>{d()},v=function(...b){if(o!=null&&o.aborted)return;s=this,l=b;const w=h==null;m(),c&&w&&d()};return v.schedule=m,v.cancel=y,v.flush=x,o==null||o.addEventListener("abort",y,{once:!0}),v}e.debounce=t})(sZ)),sZ}var r5e;function JGt(){return r5e||(r5e=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=QGt();function n(r,o=0,i={}){typeof i!="object"&&(i={});const{leading:s=!1,trailing:l=!0,maxWait:c}=i,u=Array(2);s&&(u[0]="leading"),l&&(u[1]="trailing");let d,p=null;const h=t.debounce(function(...y){d=r.apply(this,y),p=null},o,{edges:u}),m=function(...y){return c!=null&&(p===null&&(p=Date.now()),Date.now()-p>=c)?(d=r.apply(this,y),p=Date.now(),h.cancel(),h.schedule(),d):(h.apply(this,y),d)},g=()=>(h.flush(),d);return m.cancel=h.cancel,m.flush=g,m}e.debounce=n})(aZ)),aZ}var o5e;function ZGt(){return o5e||(o5e=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JGt();function n(r,o=0,i={}){const{leading:s=!0,trailing:l=!0}=i;return t.debounce(r,o,{leading:s,maxWait:o,trailing:l})}e.throttle=n})(iZ)),iZ}var lZ,i5e;function eqt(){return i5e||(i5e=1,lZ=ZGt().throttle),lZ}var tqt=eqt();const nqt=Ba(tqt);var lV=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;io[s++]))}},Tv={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},KQe=(e,t,n)=>{var{width:r=Tv.width,height:o=Tv.height,aspect:i,maxHeight:s}=n,l=rI(r)?e:Number(r),c=rI(o)?t:Number(o);return i&&i>0&&(l?c=l/i:c&&(l=c*i),s&&c!=null&&c>s&&(c=s)),{calculatedWidth:l,calculatedHeight:c}},rqt={width:0,height:0,overflow:"visible"},oqt={width:0,overflowX:"visible"},iqt={height:0,overflowY:"visible"},aqt={},sqt=e=>{var{width:t,height:n}=e,r=rI(t),o=rI(n);return r&&o?rqt:r?oqt:o?iqt:aqt};function lqt(e){var{width:t,height:n,aspect:r}=e,o=t,i=n;return o===void 0&&i===void 0?(o=Tv.width,i=Tv.height):o===void 0?o=r&&r>0?void 0:Tv.width:i===void 0&&(i=r&&r>0?void 0:Tv.height),{width:o,height:i}}function uae(){return uae=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:n,height:r}),[n,r]);return fqt(o)?f.createElement(YQe.Provider,{value:o},t):null}var Ige=()=>f.useContext(YQe),pqt=f.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Tv.initialDimension,width:o,height:i,minWidth:s=Tv.minWidth,minHeight:l,maxHeight:c,children:u,debounce:d=Tv.debounce,id:p,className:h,onResize:m,style:g={}}=e,y=f.useRef(null),x=f.useRef();x.current=m,f.useImperativeHandle(t,()=>y.current);var[v,b]=f.useState({containerWidth:r.width,containerHeight:r.height}),w=f.useCallback((I,_)=>{b(T=>{var P=Math.round(I),E=Math.round(_);return T.containerWidth===P&&T.containerHeight===E?T:{containerWidth:P,containerHeight:E}})},[]);f.useEffect(()=>{if(y.current==null||typeof ResizeObserver>"u")return Ey;var I=E=>{var M,R=E[0];if(R!=null){var{width:$,height:D}=R.contentRect;w($,D),(M=x.current)===null||M===void 0||M.call(x,$,D)}};d>0&&(I=nqt(I,d,{trailing:!0,leading:!1}));var _=new ResizeObserver(I),{width:T,height:P}=y.current.getBoundingClientRect();return w(T,P),_.observe(y.current),()=>{_.disconnect()}},[w,d]);var{containerWidth:S,containerHeight:C}=v;lV(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:N,calculatedHeight:j}=KQe(S,C,{width:o,height:i,aspect:n,maxHeight:c});return lV(N!=null&&N>0||j!=null&&j>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.`,N,j,o,i,s,l,n),f.createElement("div",{id:p?"".concat(p):void 0,className:be("recharts-responsive-container",h),style:s5e(s5e({},g),{},{width:o,height:i,minWidth:s,minHeight:l,maxHeight:c}),ref:y},f.createElement("div",{style:sqt({width:o,height:i})},f.createElement(XQe,{width:N,height:j},u)))}),ni=f.forwardRef((e,t)=>{var n=Ige();if(ob(n.width)&&ob(n.height))return e.children;var{width:r,height:o}=lqt({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:s}=KQe(void 0,void 0,{width:r,height:o,aspect:e.aspect,maxHeight:e.maxHeight});return Mr(i)&&Mr(s)?f.createElement(XQe,{width:i,height:s},e.children):f.createElement(pqt,uae({},e,{width:r,height:o,ref:t}))});function _ge(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 pL=()=>{var e,t=Vu(),n=gr(YGt),r=gr(fL),o=(e=gr(Cq))===null||e===void 0?void 0:e.padding;return!t||!r||!o?n:{width:r.width-o.left-o.right,height:r.height-o.top-o.bottom,x:o.left,y:o.top}},hqt={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},QQe=()=>{var e;return(e=gr(Dd))!==null&&e!==void 0?e:hqt},Pge=()=>gr(Hw),Age=()=>gr(Vw),mqt=()=>gr(e=>e.layout.margin),Ui=e=>e.layout.layoutType,JC=()=>gr(Ui),Tge=()=>{var e=JC();if(e==="horizontal"||e==="vertical")return e},kge=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},JQe=()=>gr(kge),gqt=()=>{var e=JC();return e!==void 0},hL=e=>{var t=fs(),n=Vu(),{width:r,height:o}=e,i=Ige(),s=r,l=o;return i&&(s=i.width>0?i.width:r,l=i.height>0?i.height:o),f.useEffect(()=>{!n&&ob(s)&&ob(l)&&t(SGt({width:s,height:l}))},[t,n,s,l]),null},ZQe=Symbol.for("immer-nothing"),l5e=Symbol.for("immer-draftable"),fg=Symbol.for("immer-state");function Fx(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var _3=Object.getPrototypeOf;function rT(e){return!!e&&!!e[fg]}function iI(e){var t;return e?eJe(e)||Array.isArray(e)||!!e[l5e]||!!((t=e.constructor)!=null&&t[l5e])||mL(e)||jq(e):!1}var xqt=Object.prototype.constructor.toString(),c5e=new WeakMap;function eJe(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=c5e.get(n);return r===void 0&&(r=Function.toString.call(n),c5e.set(n,r)),r===xqt}function cV(e,t,n=!0){Nq(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((r,o)=>t(o,r,e))}function Nq(e){const t=e[fg];return t?t.type_:Array.isArray(e)?1:mL(e)?2:jq(e)?3:0}function dae(e,t){return Nq(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function tJe(e,t,n){const r=Nq(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function yqt(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function mL(e){return e instanceof Map}function jq(e){return e instanceof Set}function gj(e){return e.copy_||e.base_}function fae(e,t){if(mL(e))return new Map(e);if(jq(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=eJe(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[fg];let o=Reflect.ownKeys(r);for(let i=0;i1&&Object.defineProperties(e,{set:oF,add:oF,clear:oF,delete:oF}),Object.freeze(e),t&&Object.values(e).forEach(n=>Mge(n,!0))),e}function vqt(){Fx(2)}var oF={value:vqt};function Eq(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var bqt={};function aI(e){const t=bqt[e];return t||Fx(0,e),t}var P3;function nJe(){return P3}function wqt(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function u5e(e,t){t&&(aI("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function pae(e){hae(e),e.drafts_.forEach(Sqt),e.drafts_=null}function hae(e){e===P3&&(P3=e.parent_)}function d5e(e){return P3=wqt(P3,e)}function Sqt(e){const t=e[fg];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function f5e(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[fg].modified_&&(pae(t),Fx(4)),iI(e)&&(e=uV(t,e),t.parent_||dV(t,e)),t.patches_&&aI("Patches").generateReplacementPatches_(n[fg].base_,e,t.patches_,t.inversePatches_)):e=uV(t,n,[]),pae(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ZQe?e:void 0}function uV(e,t,n){if(Eq(t))return t;const r=e.immer_.shouldUseStrictIteration(),o=t[fg];if(!o)return cV(t,(i,s)=>p5e(e,o,t,i,s,n),r),t;if(o.scope_!==e)return t;if(!o.modified_)return dV(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const i=o.copy_;let s=i,l=!1;o.type_===3&&(s=new Set(i),i.clear(),l=!0),cV(s,(c,u)=>p5e(e,o,i,c,u,n,l),r),dV(e,i,!1),n&&e.patches_&&aI("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function p5e(e,t,n,r,o,i,s){if(o==null||typeof o!="object"&&!s)return;const l=Eq(o);if(!(l&&!s)){if(rT(o)){const c=i&&t&&t.type_!==3&&!dae(t.assigned_,r)?i.concat(r):void 0,u=uV(e,o,c);if(tJe(n,r,u),rT(u))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(iI(o)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===o&&l)return;uV(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(mL(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&dV(e,o)}}}function dV(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Mge(t,n)}function Cqt(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:nJe(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Rge;n&&(o=[r],i=A3);const{revoke:s,proxy:l}=Proxy.revocable(o,i);return r.draft_=l,r.revoke_=s,l}var Rge={get(e,t){if(t===fg)return e;const n=gj(e);if(!dae(n,t))return Nqt(e,n,t);const r=n[t];return e.finalized_||!iI(r)?r:r===cZ(e.base_,t)?(uZ(e),e.copy_[t]=gae(r,e)):r},has(e,t){return t in gj(e)},ownKeys(e){return Reflect.ownKeys(gj(e))},set(e,t,n){const r=rJe(gj(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=cZ(gj(e),t),i=o==null?void 0:o[fg];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(yqt(n,o)&&(n!==void 0||dae(e.base_,t)))return!0;uZ(e),mae(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return cZ(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,uZ(e),mae(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=gj(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Fx(11)},getPrototypeOf(e){return _3(e.base_)},setPrototypeOf(){Fx(12)}},A3={};cV(Rge,(e,t)=>{A3[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});A3.deleteProperty=function(e,t){return A3.set.call(this,e,t,void 0)};A3.set=function(e,t,n){return Rge.set.call(this,e[0],t,n,e[0])};function cZ(e,t){const n=e[fg];return(n?gj(n):e)[t]}function Nqt(e,t,n){var o;const r=rJe(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function rJe(e,t){if(!(t in e))return;let n=_3(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=_3(n)}}function mae(e){e.modified_||(e.modified_=!0,e.parent_&&mae(e.parent_))}function uZ(e){e.copy_||(e.copy_=fae(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var jqt=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(c=i,...u){return s.produce(c,d=>n.call(this,d,...u))}}typeof n!="function"&&Fx(6),r!==void 0&&typeof r!="function"&&Fx(7);let o;if(iI(t)){const i=d5e(this),s=gae(t,void 0);let l=!0;try{o=n(s),l=!1}finally{l?pae(i):hae(i)}return u5e(i,r),f5e(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===ZQe&&(o=void 0),this.autoFreeze_&&Mge(o,!0),r){const i=[],s=[];aI("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Fx(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...l)=>this.produceWithPatches(s,c=>t(c,...l));let r,o;return[this.produce(t,n,(s,l)=>{r=s,o=l}),r,o]},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){iI(e)||Fx(8),rT(e)&&(e=Eqt(e));const t=d5e(this),n=gae(e,void 0);return n[fg].isManual_=!0,hae(t),n}finishDraft(e,t){const n=e&&e[fg];(!n||!n.isManual_)&&Fx(9);const{scope_:r}=n;return u5e(r,t),f5e(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=aI("Patches").applyPatches_;return rT(e)?r(e,t):this.produce(e,o=>r(o,t))}};function gae(e,t){const n=mL(e)?aI("MapSet").proxyMap_(e,t):jq(e)?aI("MapSet").proxySet_(e,t):Cqt(e,t);return(t?t.scope_:nJe()).drafts_.push(n),n}function Eqt(e){return rT(e)||Fx(10,e),oJe(e)}function oJe(e){if(!iI(e)||Eq(e))return e;const t=e[fg];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=fae(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=fae(e,!0);return cV(n,(o,i)=>{tJe(n,o,oJe(i))},r),t&&(t.finalized_=!1),n}var Iqt=new jqt;Iqt.produce;var _qt={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},iJe=bm({name:"legend",initialState:_qt,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:fc()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,o=ey(e).payload.indexOf(n);o>-1&&(e.payload[o]=r)},prepare:fc()},removeLegendPayload:{reducer(e,t){var n=ey(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:fc()}}}),{setLegendSize:h5e,setLegendSettings:Pqt,addLegendPayload:aJe,replaceLegendPayload:sJe,removeLegendPayload:lJe}=iJe.actions,Aqt=iJe.reducer,Tqt=["contextPayload"];function xae(){return xae=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t(Pqt(e))},[t,e]),null}function Bqt(e){var t=fs();return f.useEffect(()=>(t(h5e(e)),()=>{t(h5e({width:0,height:0}))}),[t,e]),null}function Hqt(e,t,n,r){return e==="vertical"&&t!=null?{height:t}:e==="horizontal"?{width:n||r}:null}var Vqt={align:"center",iconSize:14,inactiveColor:"#ccc",itemSorter:"value",layout:"horizontal",verticalAlign:"bottom"};function uu(e){var t=Hs(e,Vqt),n=NWt(),r=bVt(),o=mqt(),{width:i,height:s,wrapperStyle:l,portal:c}=t,[u,d]=uQe([n]),p=Pge(),h=Age();if(p==null||h==null)return null;var m=p-((o==null?void 0:o.left)||0)-((o==null?void 0:o.right)||0),g=Hqt(t.layout,s,i,m),y=c?l:oT(oT({position:"absolute",width:(g==null?void 0:g.width)||i||"auto",height:(g==null?void 0:g.height)||s||"auto"},Fqt(l,t,o,p,h,u)),l),x=c??r;if(x==null||n==null)return null;var v=f.createElement("div",{className:"recharts-legend-wrapper",style:y,ref:d},f.createElement(zqt,{layout:t.layout,align:t.align,verticalAlign:t.verticalAlign,itemSorter:t.itemSorter}),!c&&f.createElement(Bqt,{width:u.width,height:u.height}),f.createElement(Lqt,xae({},t,g,{margin:o,chartWidth:p,chartHeight:h,contextPayload:n})));return pu.createPortal(v,x)}uu.displayName="Legend";function yae(){return yae=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=Z5.separator,contentStyle:n,itemStyle:r,labelStyle:o=Z5.labelStyle,payload:i,formatter:s,itemSorter:l,wrapperClassName:c,labelClassName:u,label:d,labelFormatter:p,accessibilityLayer:h=Z5.accessibilityLayer}=e,m=()=>{if(i&&i.length){var C={padding:0,margin:0},N=(l?dq(i,l):i).map((j,I)=>{if(j.type==="none")return null;var _=j.formatter||s||qqt,{value:T,name:P}=j,E=T,M=P;if(_){var R=_(T,P,j,I,i);if(Array.isArray(R))[E,M]=R;else if(R!=null)E=R;else return null}var $=X4(X4({},Z5.itemStyle),{},{color:j.color||Z5.itemStyle.color},r);return f.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:$},M0(M)?f.createElement("span",{className:"recharts-tooltip-item-name"},M):null,M0(M)?f.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,f.createElement("span",{className:"recharts-tooltip-item-value"},E),f.createElement("span",{className:"recharts-tooltip-item-unit"},j.unit||""))});return f.createElement("ul",{className:"recharts-tooltip-item-list",style:C},N)}return null},g=X4(X4({},Z5.contentStyle),n),y=X4({margin:0},o),x=!Ml(d),v=x?d:"",b=be("recharts-default-tooltip",c),w=be("recharts-tooltip-label",u);x&&p&&i!==void 0&&i!==null&&(v=p(d,i));var S=h?{role:"status","aria-live":"assertive"}:{};return f.createElement("div",yae({className:b,style:g},S),f.createElement("p",{className:w,style:y},f.isValidElement(v)?v:"".concat(v)),m())},Q4="recharts-tooltip-wrapper",Yqt={visibility:"hidden"};function Xqt(e){var{coordinate:t,translateX:n,translateY:r}=e;return be(Q4,{["".concat(Q4,"-right")]:Mr(n)&&t&&Mr(t.x)&&n>=t.x,["".concat(Q4,"-left")]:Mr(n)&&t&&Mr(t.x)&&n=t.y,["".concat(Q4,"-top")]:Mr(r)&&t&&Mr(t.y)&&r0?o:0),p=n[r]+o;if(t[r])return s[r]?d:p;var h=c[r];if(h==null)return 0;if(s[r]){var m=d,g=h;return mx?Math.max(d,h):Math.max(p,h)}function Qqt(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function Jqt(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:o,position:i,reverseDirection:s,tooltipBox:l,useTranslate3d:c,viewBox:u}=e,d,p,h;return l.height>0&&l.width>0&&n?(p=x5e({allowEscapeViewBox:t,coordinate:n,key:"x",offset:o,position:i,reverseDirection:s,tooltipDimension:l.width,viewBox:u,viewBoxDimension:u.width}),h=x5e({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:i,reverseDirection:s,tooltipDimension:l.height,viewBox:u,viewBoxDimension:u.height}),d=Qqt({translateX:p,translateY:h,useTranslate3d:c})):d=Yqt,{cssProperties:d,cssClasses:Xqt({translateX:p,translateY:h,coordinate:n})}}function y5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function iF(e){for(var t=1;t{if(t.key==="Escape"){var n,r,o,i;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(n=(r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==null&&n!==void 0?n:0,y:(o=(i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==null&&o!==void 0?o:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,n;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:n,animationDuration:r,animationEasing:o,children:i,coordinate:s,hasPayload:l,isAnimationActive:c,offset:u,position:d,reverseDirection:p,useTranslate3d:h,viewBox:m,wrapperStyle:g,lastBoundingBox:y,innerRef:x,hasPortalFromProps:v}=this.props,b=typeof u=="number"?u:u.x,w=typeof u=="number"?u:u.y,{cssClasses:S,cssProperties:C}=Jqt({allowEscapeViewBox:n,coordinate:s,offsetLeft:b,offsetTop:w,position:d,reverseDirection:p,tooltipBox:{height:y.height,width:y.width},useTranslate3d:h,viewBox:m}),N=v?{}:iF(iF({transition:c&&t?"transform ".concat(r,"ms ").concat(o):void 0},C),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&l?"visible":"hidden",position:"absolute",top:0,left:0}),j=iF(iF({},N),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},g);return f.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:S,style:j,ref:x},i)}}var cJe=()=>{var e;return(e=gr(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function bae(){return bae=Object.assign?Object.assign.bind():function(e){for(var t=1;tci(e.x)&&ci(e.y),S5e=e=>e.base!=null&&fV(e.base)&&fV(e),J4=e=>e.x,Z4=e=>e.y,iKt=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(lL(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=w5e["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return w5e[n]||lq},C5e={connectNulls:!1,type:"linear"},aKt=e=>{var{type:t=C5e.type,points:n=[],baseLine:r,layout:o,connectNulls:i=C5e.connectNulls}=e,s=iKt(t,o),l=i?n.filter(fV):n;if(Array.isArray(r)){var c,u=n.map((g,y)=>b5e(b5e({},g),{},{base:r[y]}));o==="vertical"?c=Q8().y(Z4).x1(J4).x0(g=>g.base.x):c=Q8().x(J4).y1(Z4).y0(g=>g.base.y);var d=c.defined(S5e).curve(s),p=i?u.filter(S5e):u;return d(p)}var h;o==="vertical"&&Mr(r)?h=Q8().y(Z4).x1(J4).x0(r):Mr(r)?h=Q8().x(J4).y1(Z4).y0(r):h=RXe().x(J4).y(Z4);var m=h.defined(fV).curve(s);return m(l)},lA=e=>{var{className:t,points:n,path:r,pathRef:o}=e,i=JC();if((!n||!n.length)&&!r)return null;var s={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||i,connectNulls:e.connectNulls},l=n&&n.length?aKt(s):r;return f.createElement("path",bae({},dl(e),pge(e),{className:be("recharts-curve",t),d:l===null?void 0:l,ref:o}))},sKt=["x","y","top","left","width","height","className"];function wae(){return wae=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(o,"v").concat(r,"M").concat(i,",").concat(t,"h").concat(n),mKt=e=>{var{x:t=0,y:n=0,top:r=0,left:o=0,width:i=0,height:s=0,className:l}=e,c=fKt(e,sKt),u=lKt({x:t,y:n,top:r,left:o,width:i,height:s},c);return!Mr(t)||!Mr(n)||!Mr(i)||!Mr(s)||!Mr(r)||!Mr(o)?null:f.createElement("path",wae({},iu(u),{className:be("recharts-cross",l),d:hKt(t,n,i,s,r,o)}))};function gKt(e,t,n,r){var o=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-o:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-o,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function j5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function E5e(e){for(var t=1;te.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),uJe=(e,t,n)=>e.map(r=>"".concat(bKt(r)," ").concat(t,"ms ").concat(n)).join(","),wKt=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(o=>r.includes(o))),T3=(e,t)=>Object.keys(t).reduce((n,r)=>E5e(E5e({},n),{},{[r]:e(r,t[r])}),{});function I5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Nd(e){for(var t=1;te+(t-e)*n,Sae=e=>{var{from:t,to:n}=e;return t!==n},dJe=(e,t,n)=>{var r=T3((o,i)=>{if(Sae(i)){var[s,l]=e(i.from,i.to,i.velocity);return Nd(Nd({},i),{},{from:s,velocity:l})}return i},t);return n<1?T3((o,i)=>Sae(i)&&r[o]!=null?Nd(Nd({},i),{},{velocity:pV(i.velocity,r[o].velocity,n),from:pV(i.from,r[o].from,n)}):i,t):dJe(e,r,n-1)};function jKt(e,t,n,r,o,i){var s,l=r.reduce((h,m)=>Nd(Nd({},h),{},{[m]:{from:e[m],velocity:0,to:t[m]}}),{}),c=()=>T3((h,m)=>m.from,l),u=()=>!Object.values(l).filter(Sae).length,d=null,p=h=>{s||(s=h);var m=h-s,g=m/n.dt;l=dJe(n,l,g),o(Nd(Nd(Nd({},e),t),c())),s=h,u()||(d=i.setTimeout(p))};return()=>(d=i.setTimeout(p),()=>{var h;(h=d)===null||h===void 0||h()})}function EKt(e,t,n,r,o,i,s){var l=null,c=o.reduce((p,h)=>{var m=e[h],g=t[h];return m==null||g==null?p:Nd(Nd({},p),{},{[h]:[m,g]})},{}),u,d=p=>{u||(u=p);var h=(p-u)/r,m=T3((y,x)=>pV(...x,n(h)),c);if(i(Nd(Nd(Nd({},e),t),m)),h<1)l=s.setTimeout(d);else{var g=T3((y,x)=>pV(...x,n(1)),c);i(Nd(Nd(Nd({},e),t),g))}};return()=>(l=s.setTimeout(d),()=>{var p;(p=l)===null||p===void 0||p()})}const IKt=(e,t,n,r,o,i)=>{var s=wKt(e,t);return n==null?()=>(o(Nd(Nd({},e),t)),()=>{}):n.isStepper===!0?jKt(e,t,n,s,o,i):EKt(e,t,n,r,s,o,i)};var hV=1e-4,fJe=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],pJe=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),_5e=(e,t)=>n=>{var r=fJe(e,t);return pJe(r,n)},_Kt=(e,t)=>n=>{var r=fJe(e,t),o=[...r.map((i,s)=>i*s).slice(1),0];return pJe(o,n)},PKt=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var o=r.map(i=>parseFloat(i));return[o[0],o[1],o[2],o[3]]},AKt=function(){for(var t=arguments.length,n=new Array(t),r=0;r{var o=_5e(e,n),i=_5e(t,r),s=_Kt(e,n),l=u=>u>1?1:u<0?0:u,c=u=>{for(var d=u>1?1:u,p=d,h=0;h<8;++h){var m=o(p)-d,g=s(p);if(Math.abs(m-d)0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:o=17}=t,i=(s,l,c)=>{var u=-(s-l)*n,d=c*r,p=c+(u-d)*o/1e3,h=c*o/1e3+s;return Math.abs(h-l){if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return P5e(e);case"spring":return kKt();default:if(e.split("(")[0]==="cubic-bezier")return P5e(e)}return typeof e=="function"?e:null};function RKt(e){var t,n=()=>null,r=!1,o=null,i=s=>{if(!r){if(Array.isArray(s)){if(!s.length)return;var l=s,[c,...u]=l;if(typeof c=="number"){o=e.setTimeout(i.bind(null,u),c);return}i(c),o=e.setTimeout(i.bind(null,u));return}typeof s=="string"&&(t=s,n(t)),typeof s=="object"&&(t=s,n(t)),typeof s=="function"&&s()}};return{stop:()=>{r=!0},start:s=>{r=!1,o&&(o(),o=null),i(s)},subscribe:s=>(n=s,()=>{n=()=>null}),getTimeoutController:()=>e}}class OKt{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),o=null,i=s=>{s-r>=n?t(s):typeof requestAnimationFrame=="function"&&(o=requestAnimationFrame(i))};return o=requestAnimationFrame(i),()=>{o!=null&&cancelAnimationFrame(o)}}}function $Kt(){return RKt(new OKt)}var DKt=f.createContext($Kt);function LKt(e,t){var n=f.useContext(DKt);return f.useMemo(()=>t??n(e),[e,t,n])}var FKt=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),gL={isSsr:FKt()},zKt={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},A5e={t:0},dZ={t:1};function e5(e){var t=Hs(e,zKt),{isActive:n,canBegin:r,duration:o,easing:i,begin:s,onAnimationEnd:l,onAnimationStart:c,children:u}=t,d=n==="auto"?!gL.isSsr:n,p=LKt(t.animationId,t.animationManager),[h,m]=f.useState(d?A5e:dZ),g=f.useRef(null);return f.useEffect(()=>{d||m(dZ)},[d]),f.useEffect(()=>{if(!d||!r)return Ey;var y=IKt(A5e,dZ,MKt(i),o,m,p.getTimeoutController()),x=()=>{g.current=y()};return p.start([c,s,x,o,l]),()=>{p.stop(),g.current&&g.current(),l()}},[d,r,o,i,s,c,l,p]),u(h.t)}function t5(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=f.useRef(N3(t)),r=f.useRef(e);return r.current!==e&&(n.current=N3(t),r.current=e),n.current}var BKt=["radius"],HKt=["radius"],T5e,k5e,M5e,R5e,O5e,$5e,D5e,L5e,F5e,z5e;function B5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function H5e(e){for(var t=1;t{var i=R2(n),s=R2(r),l=Math.min(Math.abs(i)/2,Math.abs(s)/2),c=s>=0?1:-1,u=i>=0?1:-1,d=s>=0&&i>=0||s<0&&i<0?1:0,p;if(l>0&&Array.isArray(o)){for(var h=[0,0,0,0],m=0,g=4;ml?l:x}p=Ac(T5e||(T5e=Ky(["M",",",""])),e,t+c*h[0]),h[0]>0&&(p+=Ac(k5e||(k5e=Ky(["A ",",",",0,0,",",",",",""])),h[0],h[0],d,e+u*h[0],t)),p+=Ac(M5e||(M5e=Ky(["L ",",",""])),e+n-u*h[1],t),h[1]>0&&(p+=Ac(R5e||(R5e=Ky(["A ",",",",0,0,",`, `,",",""])),h[1],h[1],d,e+n,t+c*h[1])),p+=Ac(O5e||(O5e=Ky(["L ",",",""])),e+n,t+r-c*h[2]),h[2]>0&&(p+=Ac($5e||($5e=Ky(["A ",",",",0,0,",`, `,",",""])),h[2],h[2],d,e+n-u*h[2],t+r)),p+=Ac(D5e||(D5e=Ky(["L ",",",""])),e+u*h[3],t+r),h[3]>0&&(p+=Ac(L5e||(L5e=Ky(["A ",",",",0,0,",`, `,",",""])),h[3],h[3],d,e,t+r-c*h[3])),p+="Z"}else if(l>0&&o===+o&&o>0){var v=Math.min(l,o);p=Ac(F5e||(F5e=Ky(["M ",",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",","," Z"])),e,t+c*v,v,v,d,e+u*v,t,e+n-u*v,t,v,v,d,e+n,t+c*v,e+n,t+r-c*v,v,v,d,e+n-u*v,t+r,e+u*v,t+r,v,v,d,e,t+r-c*v)}else p=Ac(z5e||(z5e=Ky(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return p},W5e={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},hJe=e=>{var t=Hs(e,W5e),n=f.useRef(null),[r,o]=f.useState(-1);f.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var z=n.current.getTotalLength();z&&o(z)}catch{}},[]);var{x:i,y:s,width:l,height:c,radius:u,className:d}=t,{animationEasing:p,animationDuration:h,animationBegin:m,isAnimationActive:g,isUpdateAnimationActive:y}=t,x=f.useRef(l),v=f.useRef(c),b=f.useRef(i),w=f.useRef(s),S=f.useMemo(()=>({x:i,y:s,width:l,height:c,radius:u}),[i,s,l,c,u]),C=t5(S,"rectangle-");if(i!==+i||s!==+s||l!==+l||c!==+c||l===0||c===0)return null;var N=be("recharts-rectangle",d);if(!y){var j=iu(t),{radius:I}=j,_=V5e(j,BKt);return f.createElement("path",mV({},_,{x:R2(i),y:R2(s),width:R2(l),height:R2(c),radius:typeof u=="number"?u:void 0,className:N,d:U5e(i,s,l,c,u)}))}var T=x.current,P=v.current,E=b.current,M=w.current,R="0px ".concat(r===-1?1:r,"px"),$="".concat(r,"px 0px"),D=uJe(["strokeDasharray"],h,typeof p=="string"?p:W5e.animationEasing);return f.createElement(e5,{animationId:C,key:C,canBegin:r>0,duration:h,easing:p,isActive:y,begin:m},z=>{var V=ja(T,l,z),B=ja(P,c,z),G=ja(E,i,z),H=ja(M,s,z);n.current&&(x.current=V,v.current=B,b.current=G,w.current=H);var F;g?z>0?F={transition:D,strokeDasharray:$}:F={strokeDasharray:R}:F={strokeDasharray:$};var W=iu(t),{radius:U}=W,K=V5e(W,HKt);return f.createElement("path",mV({},K,{radius:typeof u=="number"?u:void 0,className:N,d:U5e(G,H,V,B,u),ref:n,style:H5e(H5e({},F),t.style)}))})};function G5e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function q5e(e){for(var t=1;te*Math.PI/180,XKt=e=>e*180/Math.PI,cs=(e,t,n,r)=>({x:e+Math.cos(-gV*r)*n,y:t+Math.sin(-gV*r)*n}),mJe=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},QKt=(e,t)=>{var{x:n,y:r}=e,{x:o,y:i}=t;return Math.sqrt((n-o)**2+(r-i)**2)},JKt=(e,t)=>{var{x:n,y:r}=e,{cx:o,cy:i}=t,s=QKt({x:n,y:r},{x:o,y:i});if(s<=0)return{radius:s,angle:0};var l=(n-o)/s,c=Math.acos(l);return r>i&&(c=2*Math.PI-c),{radius:s,angle:XKt(c),angleInRadian:c}},ZKt=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),o=Math.floor(n/360),i=Math.min(r,o);return{startAngle:t-i*360,endAngle:n-i*360}},eYt=(e,t)=>{var{startAngle:n,endAngle:r}=t,o=Math.floor(n/360),i=Math.floor(r/360),s=Math.min(o,i);return e+s*360},tYt=(e,t)=>{var{chartX:n,chartY:r}=e,{radius:o,angle:i}=JKt({x:n,y:r},t),{innerRadius:s,outerRadius:l}=t;if(ol||o===0)return null;var{startAngle:c,endAngle:u}=ZKt(t),d=i,p;if(c<=u){for(;d>u;)d-=360;for(;d=c&&d<=u}else{for(;d>c;)d-=360;for(;d=u&&d<=c}return p?q5e(q5e({},t),{},{radius:o,angle:eYt(d,t)}):null};function gJe(e){var{cx:t,cy:n,radius:r,startAngle:o,endAngle:i}=e,s=cs(t,n,r,o),l=cs(t,n,r,i);return{points:[s,l],cx:t,cy:n,radius:r,startAngle:o,endAngle:i}}var K5e,Y5e,X5e,Q5e,J5e,Z5e,e_e;function Cae(){return Cae=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=df(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},aF=e=>{var{cx:t,cy:n,radius:r,angle:o,sign:i,isExternal:s,cornerRadius:l,cornerIsExternal:c}=e,u=l*(s?1:-1)+r,d=Math.asin(l/u)/gV,p=c?o:o+i*d,h=cs(t,n,u,p),m=cs(t,n,r,p),g=c?o-i*d:o,y=cs(t,n,u*Math.cos(d*gV),g);return{center:h,circleTangency:m,lineTangency:y,theta:d}},xJe=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:s}=e,l=nYt(i,s),c=i+l,u=cs(t,n,o,i),d=cs(t,n,o,c),p=Ac(K5e||(K5e=Yj(["M ",",",` A `,",",`,0, `,",",`, `,",",` `])),u.x,u.y,o,o,+(Math.abs(l)>180),+(i>c),d.x,d.y);if(r>0){var h=cs(t,n,r,i),m=cs(t,n,r,c);p+=Ac(Y5e||(Y5e=Yj(["L ",",",` A `,",",`,0, `,",",`, `,","," Z"])),m.x,m.y,r,r,+(Math.abs(l)>180),+(i<=c),h.x,h.y)}else p+=Ac(X5e||(X5e=Yj(["L ",","," Z"])),t,n);return p},rYt=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:o,cornerRadius:i,forceCornerRadius:s,cornerIsExternal:l,startAngle:c,endAngle:u}=e,d=df(u-c),{circleTangency:p,lineTangency:h,theta:m}=aF({cx:t,cy:n,radius:o,angle:c,sign:d,cornerRadius:i,cornerIsExternal:l}),{circleTangency:g,lineTangency:y,theta:x}=aF({cx:t,cy:n,radius:o,angle:u,sign:-d,cornerRadius:i,cornerIsExternal:l}),v=l?Math.abs(c-u):Math.abs(c-u)-m-x;if(v<0)return s?Ac(Q5e||(Q5e=Yj(["M ",",",` a`,",",",0,0,1,",`,0 a`,",",",0,0,1,",`,0 `])),h.x,h.y,i,i,i*2,i,i,-i*2):xJe({cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:c,endAngle:u});var b=Ac(J5e||(J5e=Yj(["M ",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",",` `])),h.x,h.y,i,i,+(d<0),p.x,p.y,o,o,+(v>180),+(d<0),g.x,g.y,i,i,+(d<0),y.x,y.y);if(r>0){var{circleTangency:w,lineTangency:S,theta:C}=aF({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),{circleTangency:N,lineTangency:j,theta:I}=aF({cx:t,cy:n,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:i,cornerIsExternal:l}),_=l?Math.abs(c-u):Math.abs(c-u)-C-I;if(_<0&&i===0)return"".concat(b,"L").concat(t,",").concat(n,"Z");b+=Ac(Z5e||(Z5e=Yj(["L",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",","Z"])),j.x,j.y,i,i,+(d<0),N.x,N.y,r,r,+(_>180),+(d>0),w.x,w.y,i,i,+(d<0),S.x,S.y)}else b+=Ac(e_e||(e_e=Yj(["L",",","Z"])),t,n);return b},oYt={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},yJe=e=>{var t=Hs(e,oYt),{cx:n,cy:r,innerRadius:o,outerRadius:i,cornerRadius:s,forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d,className:p}=t;if(i0&&Math.abs(u-d)<360?y=rYt({cx:n,cy:r,innerRadius:o,outerRadius:i,cornerRadius:Math.min(g,m/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):y=xJe({cx:n,cy:r,innerRadius:o,outerRadius:i,startAngle:u,endAngle:d}),f.createElement("path",Cae({},iu(t),{className:h,d:y}))};function iYt(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(YXe(t)){if(e==="centric"){var{cx:r,cy:o,innerRadius:i,outerRadius:s,angle:l}=t,c=cs(r,o,i,l),u=cs(r,o,s,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return gJe(t)}}var fZ={},pZ={},hZ={},t_e;function aYt(){return t_e||(t_e=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=sQe();function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(hZ)),hZ}var n_e;function sYt(){return n_e||(n_e=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=aYt();function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(pZ)),pZ}var r_e;function lYt(){return r_e||(r_e=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lQe(),n=sYt();function r(o,i,s){s&&typeof s!="number"&&t.isIterateeCall(o,i,s)&&(i=s=void 0),o=n.toFinite(o),i===void 0?(i=o,o=0):i=n.toFinite(i),s=s===void 0?ot?1:e>=t?0:NaN}function dYt(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function $ge(e){let t,n,r;e.length!==2?(t=nC,n=(l,c)=>nC(e(l),c),r=(l,c)=>e(l)-c):(t=e===nC||e===dYt?e:fYt,n=e,r=e);function o(l,c,u=0,d=l.length){if(u>>1;n(l[p],c)<0?u=p+1:d=p}while(u>>1;n(l[p],c)<=0?u=p+1:d=p}while(uu&&r(l[p-1],c)>-r(l[p],c)?p-1:p}return{left:o,center:s,right:i}}function fYt(){return 0}function vJe(e){return e===null?NaN:+e}function*pYt(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const hYt=$ge(nC),xL=hYt.right;$ge(vJe).center;class i_e extends Map{constructor(t,n=xYt){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,o]of t)this.set(r,o)}get(t){return super.get(a_e(this,t))}has(t){return super.has(a_e(this,t))}set(t,n){return super.set(mYt(this,t),n)}delete(t){return super.delete(gYt(this,t))}}function a_e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function mYt({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function gYt({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function xYt(e){return e!==null&&typeof e=="object"?e.valueOf():e}function yYt(e=nC){if(e===nC)return bJe;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function bJe(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const vYt=Math.sqrt(50),bYt=Math.sqrt(10),wYt=Math.sqrt(2);function yV(e,t,n){const r=(t-e)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),s=i>=vYt?10:i>=bYt?5:i>=wYt?2:1;let l,c,u;return o<0?(u=Math.pow(10,-o)/s,l=Math.round(e*u),c=Math.round(t*u),l/ut&&--c,u=-u):(u=Math.pow(10,o)*s,l=Math.round(e/u),c=Math.round(t/u),l*ut&&--c),c0))return[];if(e===t)return[e];const r=t=o))return[];const l=i-o+1,c=new Array(l);if(r)if(s<0)for(let u=0;u=r)&&(n=r);return n}function l_e(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function wJe(e,t,n=0,r=1/0,o){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(o=o===void 0?bJe:yYt(o);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),p=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*p*(c-p)/c)*(u-c/2<0?-1:1),m=Math.max(n,Math.floor(t-u*p/c+h)),g=Math.min(r,Math.floor(t+(c-u)*p/c+h));wJe(e,t,m,g,o)}const i=e[t];let s=n,l=r;for(eM(e,n,t),o(e[r],i)>0&&eM(e,n,r);s0;)--l}o(e[n],i)===0?eM(e,n,l):(++l,eM(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function eM(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function SYt(e,t,n){if(e=Float64Array.from(pYt(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return l_e(e);if(t>=1)return s_e(e);var r,o=(r-1)*t,i=Math.floor(o),s=s_e(wJe(e,i).subarray(0,i+1)),l=l_e(e.subarray(i+1));return s+(l-s)*(o-i)}}function CYt(e,t,n=vJe){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,o=(r-1)*t,i=Math.floor(o),s=+n(e[i],i,e),l=+n(e[i+1],i+1,e);return s+(l-s)*(o-i)}}function NYt(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?sF(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?sF(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=EYt.exec(e))?new sm(t[1],t[2],t[3],1):(t=IYt.exec(e))?new sm(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=_Yt.exec(e))?sF(t[1],t[2],t[3],t[4]):(t=PYt.exec(e))?sF(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=AYt.exec(e))?m_e(t[1],t[2]/100,t[3]/100,1):(t=TYt.exec(e))?m_e(t[1],t[2]/100,t[3]/100,t[4]):c_e.hasOwnProperty(e)?f_e(c_e[e]):e==="transparent"?new sm(NaN,NaN,NaN,0):null}function f_e(e){return new sm(e>>16&255,e>>8&255,e&255,1)}function sF(e,t,n,r){return r<=0&&(e=t=n=NaN),new sm(e,t,n,r)}function RYt(e){return e instanceof yL||(e=sI(e)),e?(e=e.rgb(),new sm(e.r,e.g,e.b,e.opacity)):new sm}function _ae(e,t,n,r){return arguments.length===1?RYt(e):new sm(e,t,n,r??1)}function sm(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Fge(sm,_ae,NJe(yL,{brighter(e){return e=e==null?vV:Math.pow(vV,e),new sm(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?k3:Math.pow(k3,e),new sm(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new sm(AE(this.r),AE(this.g),AE(this.b),bV(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:p_e,formatHex:p_e,formatHex8:OYt,formatRgb:h_e,toString:h_e}));function p_e(){return`#${Xj(this.r)}${Xj(this.g)}${Xj(this.b)}`}function OYt(){return`#${Xj(this.r)}${Xj(this.g)}${Xj(this.b)}${Xj((isNaN(this.opacity)?1:this.opacity)*255)}`}function h_e(){const e=bV(this.opacity);return`${e===1?"rgb(":"rgba("}${AE(this.r)}, ${AE(this.g)}, ${AE(this.b)}${e===1?")":`, ${e})`}`}function bV(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function AE(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xj(e){return e=AE(e),(e<16?"0":"")+e.toString(16)}function m_e(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new zx(e,t,n,r)}function jJe(e){if(e instanceof zx)return new zx(e.h,e.s,e.l,e.opacity);if(e instanceof yL||(e=sI(e)),!e)return new zx;if(e instanceof zx)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,c=(i+o)/2;return l?(t===i?s=(n-r)/l+(n0&&c<1?0:s,new zx(s,l,c,e.opacity)}function $Yt(e,t,n,r){return arguments.length===1?jJe(e):new zx(e,t,n,r??1)}function zx(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Fge(zx,$Yt,NJe(yL,{brighter(e){return e=e==null?vV:Math.pow(vV,e),new zx(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?k3:Math.pow(k3,e),new zx(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new sm(gZ(e>=240?e-240:e+120,o,r),gZ(e,o,r),gZ(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new zx(g_e(this.h),lF(this.s),lF(this.l),bV(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=bV(this.opacity);return`${e===1?"hsl(":"hsla("}${g_e(this.h)}, ${lF(this.s)*100}%, ${lF(this.l)*100}%${e===1?")":`, ${e})`}`}}));function g_e(e){return e=(e||0)%360,e<0?e+360:e}function lF(e){return Math.max(0,Math.min(1,e||0))}function gZ(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const zge=e=>()=>e;function DYt(e,t){return function(n){return e+n*t}}function LYt(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function FYt(e){return(e=+e)==1?EJe:function(t,n){return n-t?LYt(t,n,e):zge(isNaN(t)?n:t)}}function EJe(e,t){var n=t-e;return n?DYt(e,n):zge(isNaN(e)?t:e)}const wV=(function e(t){var n=FYt(t);function r(o,i){var s=n((o=_ae(o)).r,(i=_ae(i)).r),l=n(o.g,i.g),c=n(o.b,i.b),u=EJe(o.opacity,i.opacity);return function(d){return o.r=s(d),o.g=l(d),o.b=c(d),o.opacity=u(d),o+""}}return r.gamma=e,r})(1);function zYt(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;on&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,c.push({i:s,x:Dx(r,o)})),n=xZ.lastIndex;return n180?d+=360:d-u>180&&(u+=360),h.push({i:p.push(o(p)+"rotate(",null,r)-2,x:Dx(u,d)})):d&&p.push(o(p)+"rotate("+d+r)}function l(u,d,p,h){u!==d?h.push({i:p.push(o(p)+"skewX(",null,r)-2,x:Dx(u,d)}):d&&p.push(o(p)+"skewX("+d+r)}function c(u,d,p,h,m,g){if(u!==p||d!==h){var y=m.push(o(m)+"scale(",null,",",null,")");g.push({i:y-4,x:Dx(u,p)},{i:y-2,x:Dx(d,h)})}else(p!==1||h!==1)&&m.push(o(m)+"scale("+p+","+h+")")}return function(u,d){var p=[],h=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,p,h),s(u.rotate,d.rotate,p,h),l(u.skewX,d.skewX,p,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,p,h),u=d=null,function(m){for(var g=-1,y=h.length,x;++gt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function oXt(e,t,n){var r=e[0],o=e[1],i=t[0],s=t[1];return o2?iXt:oXt,c=u=null,p}function p(h){return h==null||isNaN(h=+h)?i:(c||(c=l(e.map(r),t,n)))(r(s(h)))}return p.invert=function(h){return s(o((u||(u=l(t,e.map(r),Dx)))(h)))},p.domain=function(h){return arguments.length?(e=Array.from(h,SV),d()):e.slice()},p.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},p.rangeRound=function(h){return t=Array.from(h),n=Bge,d()},p.clamp=function(h){return arguments.length?(s=h?!0:ph,d()):s!==ph},p.interpolate=function(h){return arguments.length?(n=h,d()):n},p.unknown=function(h){return arguments.length?(i=h,p):i},function(h,m){return r=h,o=m,d()}}function Hge(){return Iq()(ph,ph)}function aXt(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function CV(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function iT(e){return e=CV(Math.abs(e)),e?e[1]:NaN}function sXt(e,t){return function(n,r){for(var o=n.length,i=[],s=0,l=e[0],c=0;o>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),i.push(n.substring(o-=l,o+l)),!((c+=l+1)>r));)l=e[s=(s+1)%e.length];return i.reverse().join(t)}}function lXt(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var cXt=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function R3(e){if(!(t=cXt.exec(e)))throw new Error("invalid format: "+e);var t;return new Vge({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]})}R3.prototype=Vge.prototype;function Vge(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+""}Vge.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 uXt(e){e:for(var t=e.length,n=1,r=-1,o;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(o+1):e}var NV;function dXt(e,t){var n=CV(e,t);if(!n)return NV=void 0,e.toPrecision(t);var r=n[0],o=n[1],i=o-(NV=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,s=r.length;return i===s?r:i>s?r+new Array(i-s+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+CV(e,Math.max(0,t+i-1))[0]}function b_e(e,t){var n=CV(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}const w_e={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:aXt,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)=>b_e(e*100,t),r:b_e,s:dXt,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function S_e(e){return e}var C_e=Array.prototype.map,N_e=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function fXt(e){var t=e.grouping===void 0||e.thousands===void 0?S_e:sXt(C_e.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",o=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?S_e:lXt(C_e.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(p,h){p=R3(p);var m=p.fill,g=p.align,y=p.sign,x=p.symbol,v=p.zero,b=p.width,w=p.comma,S=p.precision,C=p.trim,N=p.type;N==="n"?(w=!0,N="g"):w_e[N]||(S===void 0&&(S=12),C=!0,N="g"),(v||m==="0"&&g==="=")&&(v=!0,m="0",g="=");var j=(h&&h.prefix!==void 0?h.prefix:"")+(x==="$"?n:x==="#"&&/[boxX]/.test(N)?"0"+N.toLowerCase():""),I=(x==="$"?r:/[%p]/.test(N)?s:"")+(h&&h.suffix!==void 0?h.suffix:""),_=w_e[N],T=/[defgprs%]/.test(N);S=S===void 0?6:/[gprs]/.test(N)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function P(E){var M=j,R=I,$,D,z;if(N==="c")R=_(E)+R,E="";else{E=+E;var V=E<0||1/E<0;if(E=isNaN(E)?c:_(Math.abs(E),S),C&&(E=uXt(E)),V&&+E==0&&y!=="+"&&(V=!1),M=(V?y==="("?y:l:y==="-"||y==="("?"":y)+M,R=(N==="s"&&!isNaN(E)&&NV!==void 0?N_e[8+NV/3]:"")+R+(V&&y==="("?")":""),T){for($=-1,D=E.length;++$z||z>57){R=(z===46?o+E.slice($+1):E.slice($))+R,E=E.slice(0,$);break}}}w&&!v&&(E=t(E,1/0));var B=M.length+E.length+R.length,G=B>1)+M+E+R+G.slice(B);break;default:E=G+M+E+R;break}return i(E)}return P.toString=function(){return p+""},P}function d(p,h){var m=Math.max(-8,Math.min(8,Math.floor(iT(h)/3)))*3,g=Math.pow(10,-m),y=u((p=R3(p),p.type="f",p),{suffix:N_e[8+m/3]});return function(x){return y(g*x)}}return{format:u,formatPrefix:d}}var uF,Uge,AJe;pXt({thousands:",",grouping:[3],currency:["$",""]});function pXt(e){return uF=fXt(e),Uge=uF.format,AJe=uF.formatPrefix,uF}function hXt(e){return Math.max(0,-iT(Math.abs(e)))}function mXt(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(iT(t)/3)))*3-iT(Math.abs(e)))}function gXt(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,iT(t)-iT(e))+1}function TJe(e,t,n,r){var o=Eae(e,t,n),i;switch(r=R3(r??",f"),r.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=mXt(o,s))&&(r.precision=i),AJe(r,s)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=gXt(o,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=hXt(o))&&(r.precision=i-(r.type==="%")*2);break}}return Uge(r)}function ZC(e){var t=e.domain;return e.ticks=function(n){var r=t();return Nae(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var o=t();return TJe(o[0],o[o.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),o=0,i=r.length-1,s=r[o],l=r[i],c,u,d=10;for(l0;){if(u=jae(s,l,n),u===c)return r[o]=s,r[i]=l,t(r);if(u>0)s=Math.floor(s/u)*u,l=Math.ceil(l/u)*u;else if(u<0)s=Math.ceil(s*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function kJe(){var e=Hge();return e.copy=function(){return vL(e,kJe())},K0.apply(e,arguments),ZC(e)}function MJe(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,SV),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return MJe(e).unknown(t)},e=arguments.length?Array.from(e,SV):[0,1],ZC(n)}function RJe(e,t){e=e.slice();var n=0,r=e.length-1,o=e[n],i=e[r],s;return iMath.pow(e,t)}function wXt(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 I_e(e){return(t,n)=>-e(-t,n)}function Wge(e){const t=e(j_e,E_e),n=t.domain;let r=10,o,i;function s(){return o=wXt(r),i=bXt(r),n()[0]<0?(o=I_e(o),i=I_e(i),e(xXt,yXt)):e(j_e,E_e),t}return t.base=function(l){return arguments.length?(r=+l,s()):r},t.domain=function(l){return arguments.length?(n(l),s()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const p=d0){for(;h<=m;++h)for(g=1;gd)break;v.push(y)}}else for(;h<=m;++h)for(g=r-1;g>=1;--g)if(y=h>0?g/i(-h):g*i(h),!(yd)break;v.push(y)}v.length*2{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=R3(c)).precision==null&&(c.trim=!0),c=Uge(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let p=d/i(Math.round(o(d)));return p*rn(RJe(n(),{floor:l=>i(Math.floor(o(l))),ceil:l=>i(Math.ceil(o(l)))})),t}function OJe(){const e=Wge(Iq()).domain([1,10]);return e.copy=()=>vL(e,OJe()).base(e.base()),K0.apply(e,arguments),e}function __e(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function P_e(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Gge(e){var t=1,n=e(__e(t),P_e(t));return n.constant=function(r){return arguments.length?e(__e(t=+r),P_e(t)):t},ZC(n)}function $Je(){var e=Gge(Iq());return e.copy=function(){return vL(e,$Je()).constant(e.constant())},K0.apply(e,arguments)}function A_e(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function SXt(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function CXt(e){return e<0?-e*e:e*e}function qge(e){var t=e(ph,ph),n=1;function r(){return n===1?e(ph,ph):n===.5?e(SXt,CXt):e(A_e(n),A_e(1/n))}return t.exponent=function(o){return arguments.length?(n=+o,r()):n},ZC(t)}function Kge(){var e=qge(Iq());return e.copy=function(){return vL(e,Kge()).exponent(e.exponent())},K0.apply(e,arguments),e}function NXt(){return Kge.apply(null,arguments).exponent(.5)}function T_e(e){return Math.sign(e)*e*e}function jXt(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function DJe(){var e=Hge(),t=[0,1],n=!1,r;function o(i){var s=jXt(e(i));return isNaN(s)?r:n?Math.round(s):s}return o.invert=function(i){return e.invert(T_e(i))},o.domain=function(i){return arguments.length?(e.domain(i),o):e.domain()},o.range=function(i){return arguments.length?(e.range((t=Array.from(i,SV)).map(T_e)),o):t.slice()},o.rangeRound=function(i){return o.range(i).round(!0)},o.round=function(i){return arguments.length?(n=!!i,o):n},o.clamp=function(i){return arguments.length?(e.clamp(i),o):e.clamp()},o.unknown=function(i){return arguments.length?(r=i,o):r},o.copy=function(){return DJe(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},K0.apply(o,arguments),ZC(o)}function LJe(){var e=[],t=[],n=[],r;function o(){var s=0,l=Math.max(1,t.length);for(n=new Array(l-1);++s0?n[l-1]:e[0],l=n?[r[n-1],t]:[r[u-1],r[u]]},s.unknown=function(c){return arguments.length&&(i=c),s},s.thresholds=function(){return r.slice()},s.copy=function(){return FJe().domain([e,t]).range(o).unknown(i)},K0.apply(ZC(s),arguments)}function zJe(){var e=[.5],t=[0,1],n,r=1;function o(i){return i!=null&&i<=i?t[xL(e,i,0,r)]:n}return o.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),o):e.slice()},o.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),o):t.slice()},o.invertExtent=function(i){var s=t.indexOf(i);return[e[s-1],e[s]]},o.unknown=function(i){return arguments.length?(n=i,o):n},o.copy=function(){return zJe().domain(e).range(t).unknown(n)},K0.apply(o,arguments)}const yZ=new Date,vZ=new Date;function Ld(e,t,n,r){function o(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(e(i=new Date(+i)),i),o.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),o.round=i=>{const s=o(i),l=o.ceil(i);return i-s(t(i=new Date(+i),s==null?1:Math.floor(s)),i),o.range=(i,s,l)=>{const c=[];if(i=o.ceil(i),l=l==null?1:Math.floor(l),!(i0))return c;let u;do c.push(u=new Date(+i)),t(i,l),e(i);while(uLd(s=>{if(s>=s)for(;e(s),!i(s);)s.setTime(s-1)},(s,l)=>{if(s>=s)if(l<0)for(;++l<=0;)for(;t(s,-1),!i(s););else for(;--l>=0;)for(;t(s,1),!i(s););}),n&&(o.count=(i,s)=>(yZ.setTime(+i),vZ.setTime(+s),e(yZ),e(vZ),Math.floor(n(yZ,vZ))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(r?s=>r(s)%i===0:s=>o.count(0,s)%i===0):o)),o}const jV=Ld(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);jV.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Ld(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):jV);jV.range;const D1=1e3,f0=D1*60,L1=f0*60,pw=L1*24,Yge=pw*7,k_e=pw*30,bZ=pw*365,Qj=Ld(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*D1)},(e,t)=>(t-e)/D1,e=>e.getUTCSeconds());Qj.range;const Xge=Ld(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*D1)},(e,t)=>{e.setTime(+e+t*f0)},(e,t)=>(t-e)/f0,e=>e.getMinutes());Xge.range;const Qge=Ld(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*f0)},(e,t)=>(t-e)/f0,e=>e.getUTCMinutes());Qge.range;const Jge=Ld(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*D1-e.getMinutes()*f0)},(e,t)=>{e.setTime(+e+t*L1)},(e,t)=>(t-e)/L1,e=>e.getHours());Jge.range;const Zge=Ld(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*L1)},(e,t)=>(t-e)/L1,e=>e.getUTCHours());Zge.range;const bL=Ld(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*f0)/pw,e=>e.getDate()-1);bL.range;const _q=Ld(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/pw,e=>e.getUTCDate()-1);_q.range;const BJe=Ld(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/pw,e=>Math.floor(e/pw));BJe.range;function n5(e){return Ld(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*f0)/Yge)}const Pq=n5(0),EV=n5(1),EXt=n5(2),IXt=n5(3),aT=n5(4),_Xt=n5(5),PXt=n5(6);Pq.range;EV.range;EXt.range;IXt.range;aT.range;_Xt.range;PXt.range;function r5(e){return Ld(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Yge)}const Aq=r5(0),IV=r5(1),AXt=r5(2),TXt=r5(3),sT=r5(4),kXt=r5(5),MXt=r5(6);Aq.range;IV.range;AXt.range;TXt.range;sT.range;kXt.range;MXt.range;const e0e=Ld(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());e0e.range;const t0e=Ld(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());t0e.range;const hw=Ld(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());hw.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ld(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});hw.range;const mw=Ld(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());mw.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Ld(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});mw.range;function HJe(e,t,n,r,o,i){const s=[[Qj,1,D1],[Qj,5,5*D1],[Qj,15,15*D1],[Qj,30,30*D1],[i,1,f0],[i,5,5*f0],[i,15,15*f0],[i,30,30*f0],[o,1,L1],[o,3,3*L1],[o,6,6*L1],[o,12,12*L1],[r,1,pw],[r,2,2*pw],[n,1,Yge],[t,1,k_e],[t,3,3*k_e],[e,1,bZ]];function l(u,d,p){const h=dx).right(s,h);if(m===s.length)return e.every(Eae(u/bZ,d/bZ,p));if(m===0)return jV.every(Math.max(Eae(u,d,p),1));const[g,y]=s[h/s[m-1][2]53)return null;"w"in oe||(oe.w=1),"Z"in oe?(fe=SZ(tM(oe.y,0,1)),se=fe.getUTCDay(),fe=se>4||se===0?IV.ceil(fe):IV(fe),fe=_q.offset(fe,(oe.V-1)*7),oe.y=fe.getUTCFullYear(),oe.m=fe.getUTCMonth(),oe.d=fe.getUTCDate()+(oe.w+6)%7):(fe=wZ(tM(oe.y,0,1)),se=fe.getDay(),fe=se>4||se===0?EV.ceil(fe):EV(fe),fe=bL.offset(fe,(oe.V-1)*7),oe.y=fe.getFullYear(),oe.m=fe.getMonth(),oe.d=fe.getDate()+(oe.w+6)%7)}else("W"in oe||"U"in oe)&&("w"in oe||(oe.w="u"in oe?oe.u%7:"W"in oe?1:0),se="Z"in oe?SZ(tM(oe.y,0,1)).getUTCDay():wZ(tM(oe.y,0,1)).getDay(),oe.m=0,oe.d="W"in oe?(oe.w+6)%7+oe.W*7-(se+5)%7:oe.w+oe.U*7-(se+6)%7);return"Z"in oe?(oe.H+=oe.Z/100|0,oe.M+=oe.Z%100,SZ(oe)):wZ(oe)}}function I(re,ce,ae,oe){for(var ue=0,fe=ce.length,se=ae.length,ge,ye;ue=se)return-1;if(ge=ce.charCodeAt(ue++),ge===37){if(ge=ce.charAt(ue++),ye=C[ge in M_e?ce.charAt(ue++):ge],!ye||(oe=ye(re,ae,oe))<0)return-1}else if(ge!=ae.charCodeAt(oe++))return-1}return oe}function _(re,ce,ae){var oe=u.exec(ce.slice(ae));return oe?(re.p=d.get(oe[0].toLowerCase()),ae+oe[0].length):-1}function T(re,ce,ae){var oe=m.exec(ce.slice(ae));return oe?(re.w=g.get(oe[0].toLowerCase()),ae+oe[0].length):-1}function P(re,ce,ae){var oe=p.exec(ce.slice(ae));return oe?(re.w=h.get(oe[0].toLowerCase()),ae+oe[0].length):-1}function E(re,ce,ae){var oe=v.exec(ce.slice(ae));return oe?(re.m=b.get(oe[0].toLowerCase()),ae+oe[0].length):-1}function M(re,ce,ae){var oe=y.exec(ce.slice(ae));return oe?(re.m=x.get(oe[0].toLowerCase()),ae+oe[0].length):-1}function R(re,ce,ae){return I(re,t,ce,ae)}function $(re,ce,ae){return I(re,n,ce,ae)}function D(re,ce,ae){return I(re,r,ce,ae)}function z(re){return s[re.getDay()]}function V(re){return i[re.getDay()]}function B(re){return c[re.getMonth()]}function G(re){return l[re.getMonth()]}function H(re){return o[+(re.getHours()>=12)]}function F(re){return 1+~~(re.getMonth()/3)}function W(re){return s[re.getUTCDay()]}function U(re){return i[re.getUTCDay()]}function K(re){return c[re.getUTCMonth()]}function X(re){return l[re.getUTCMonth()]}function J(re){return o[+(re.getUTCHours()>=12)]}function te(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ce=N(re+="",w);return ce.toString=function(){return re},ce},parse:function(re){var ce=j(re+="",!1);return ce.toString=function(){return re},ce},utcFormat:function(re){var ce=N(re+="",S);return ce.toString=function(){return re},ce},utcParse:function(re){var ce=j(re+="",!0);return ce.toString=function(){return re},ce}}}var M_e={"-":"",_:" ",0:"0"},vf=/^\s*\d+/,FXt=/^%/,zXt=/[\\^$*+?|[\]().{}]/g;function Qa(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",i=o.length;return r+(i[t.toLowerCase(),n]))}function HXt(e,t,n){var r=vf.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function VXt(e,t,n){var r=vf.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function UXt(e,t,n){var r=vf.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function WXt(e,t,n){var r=vf.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function GXt(e,t,n){var r=vf.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function R_e(e,t,n){var r=vf.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function O_e(e,t,n){var r=vf.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function qXt(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function KXt(e,t,n){var r=vf.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function YXt(e,t,n){var r=vf.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function $_e(e,t,n){var r=vf.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function XXt(e,t,n){var r=vf.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function D_e(e,t,n){var r=vf.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function QXt(e,t,n){var r=vf.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function JXt(e,t,n){var r=vf.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function ZXt(e,t,n){var r=vf.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function eQt(e,t,n){var r=vf.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function tQt(e,t,n){var r=FXt.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function nQt(e,t,n){var r=vf.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function rQt(e,t,n){var r=vf.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function L_e(e,t){return Qa(e.getDate(),t,2)}function oQt(e,t){return Qa(e.getHours(),t,2)}function iQt(e,t){return Qa(e.getHours()%12||12,t,2)}function aQt(e,t){return Qa(1+bL.count(hw(e),e),t,3)}function VJe(e,t){return Qa(e.getMilliseconds(),t,3)}function sQt(e,t){return VJe(e,t)+"000"}function lQt(e,t){return Qa(e.getMonth()+1,t,2)}function cQt(e,t){return Qa(e.getMinutes(),t,2)}function uQt(e,t){return Qa(e.getSeconds(),t,2)}function dQt(e){var t=e.getDay();return t===0?7:t}function fQt(e,t){return Qa(Pq.count(hw(e)-1,e),t,2)}function UJe(e){var t=e.getDay();return t>=4||t===0?aT(e):aT.ceil(e)}function pQt(e,t){return e=UJe(e),Qa(aT.count(hw(e),e)+(hw(e).getDay()===4),t,2)}function hQt(e){return e.getDay()}function mQt(e,t){return Qa(EV.count(hw(e)-1,e),t,2)}function gQt(e,t){return Qa(e.getFullYear()%100,t,2)}function xQt(e,t){return e=UJe(e),Qa(e.getFullYear()%100,t,2)}function yQt(e,t){return Qa(e.getFullYear()%1e4,t,4)}function vQt(e,t){var n=e.getDay();return e=n>=4||n===0?aT(e):aT.ceil(e),Qa(e.getFullYear()%1e4,t,4)}function bQt(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Qa(t/60|0,"0",2)+Qa(t%60,"0",2)}function F_e(e,t){return Qa(e.getUTCDate(),t,2)}function wQt(e,t){return Qa(e.getUTCHours(),t,2)}function SQt(e,t){return Qa(e.getUTCHours()%12||12,t,2)}function CQt(e,t){return Qa(1+_q.count(mw(e),e),t,3)}function WJe(e,t){return Qa(e.getUTCMilliseconds(),t,3)}function NQt(e,t){return WJe(e,t)+"000"}function jQt(e,t){return Qa(e.getUTCMonth()+1,t,2)}function EQt(e,t){return Qa(e.getUTCMinutes(),t,2)}function IQt(e,t){return Qa(e.getUTCSeconds(),t,2)}function _Qt(e){var t=e.getUTCDay();return t===0?7:t}function PQt(e,t){return Qa(Aq.count(mw(e)-1,e),t,2)}function GJe(e){var t=e.getUTCDay();return t>=4||t===0?sT(e):sT.ceil(e)}function AQt(e,t){return e=GJe(e),Qa(sT.count(mw(e),e)+(mw(e).getUTCDay()===4),t,2)}function TQt(e){return e.getUTCDay()}function kQt(e,t){return Qa(IV.count(mw(e)-1,e),t,2)}function MQt(e,t){return Qa(e.getUTCFullYear()%100,t,2)}function RQt(e,t){return e=GJe(e),Qa(e.getUTCFullYear()%100,t,2)}function OQt(e,t){return Qa(e.getUTCFullYear()%1e4,t,4)}function $Qt(e,t){var n=e.getUTCDay();return e=n>=4||n===0?sT(e):sT.ceil(e),Qa(e.getUTCFullYear()%1e4,t,4)}function DQt(){return"+0000"}function z_e(){return"%"}function B_e(e){return+e}function H_e(e){return Math.floor(+e/1e3)}var e_,qJe,KJe;LQt({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 LQt(e){return e_=LXt(e),qJe=e_.format,e_.parse,KJe=e_.utcFormat,e_.utcParse,e_}function FQt(e){return new Date(e)}function zQt(e){return e instanceof Date?+e:+new Date(+e)}function n0e(e,t,n,r,o,i,s,l,c,u){var d=Hge(),p=d.invert,h=d.domain,m=u(".%L"),g=u(":%S"),y=u("%I:%M"),x=u("%I %p"),v=u("%a %d"),b=u("%b %d"),w=u("%B"),S=u("%Y");function C(N){return(c(N)t(o/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(o,i)=>SYt(e,i/r))},n.copy=function(){return JJe(t).domain(e)},Uw.apply(n,arguments)}function kq(){var e=0,t=.5,n=1,r=1,o,i,s,l,c,u=ph,d,p=!1,h;function m(y){return isNaN(y=+y)?h:(y=.5+((y=+d(y))-i)*(r*ye.chartData,wL=on([Ww],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),i0e=(e,t,n,r)=>r?wL(e):Ww(e),nZe=(e,t,n)=>n?wL(e):Ww(e);function gw(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(ci(t)&&ci(n))return!0}return!1}function V_e(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function rZe(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,o,i;if(ci(n))o=n;else if(typeof n=="function")return;if(ci(r))i=r;else if(typeof r=="function")return;var s=[o,i];if(gw(s))return s}}function WQt(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(gw(r))return V_e(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[o,i]=e,s,l;if(o==="auto")t!=null&&(s=Math.min(...t));else if(Mr(o))s=o;else if(typeof o=="function")try{t!=null&&(s=o(t==null?void 0:t[0]))}catch{}else if(typeof o=="string"&&JIe.test(o)){var c=JIe.exec(o);if(c==null||c[1]==null||t==null)s=void 0;else{var u=+c[1];s=t[0]-u}}else s=t==null?void 0:t[0];if(i==="auto")t!=null&&(l=Math.max(...t));else if(Mr(i))l=i;else if(typeof i=="function")try{t!=null&&(l=i(t==null?void 0:t[1]))}catch{}else if(typeof i=="string"&&ZIe.test(i)){var d=ZIe.exec(i);if(d==null||d[1]==null||t==null)l=void 0;else{var p=+d[1];l=t[1]+p}}else l=t==null?void 0:t[1];var h=[s,l];if(gw(h))return t==null?h:V_e(h,t,n)}}}var yk=1e9,GQt={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},s0e,gc=!0,O0="[DecimalError] ",TE=O0+"Invalid argument: ",a0e=O0+"Exponent out of range: ",vk=Math.floor,xj=Math.pow,qQt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Zm,af=1e7,ql=7,oZe=9007199254740991,_V=vk(oZe/ql),Xr={};Xr.absoluteValue=Xr.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Xr.comparedTo=Xr.cmp=function(e){var t,n,r,o,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(r=i.d.length,o=e.d.length,t=0,n=re.d[t]^i.s<0?1:-1;return r===o?0:r>o^i.s<0?1:-1};Xr.decimalPlaces=Xr.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*ql;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Xr.dividedBy=Xr.div=function(e){return X1(this,new this.constructor(e))};Xr.dividedToIntegerBy=Xr.idiv=function(e){var t=this,n=t.constructor;return cl(X1(t,new n(e),0,1),n.precision)};Xr.equals=Xr.eq=function(e){return!this.cmp(e)};Xr.exponent=function(){return rd(this)};Xr.greaterThan=Xr.gt=function(e){return this.cmp(e)>0};Xr.greaterThanOrEqualTo=Xr.gte=function(e){return this.cmp(e)>=0};Xr.isInteger=Xr.isint=function(){return this.e>this.d.length-2};Xr.isNegative=Xr.isneg=function(){return this.s<0};Xr.isPositive=Xr.ispos=function(){return this.s>0};Xr.isZero=function(){return this.s===0};Xr.lessThan=Xr.lt=function(e){return this.cmp(e)<0};Xr.lessThanOrEqualTo=Xr.lte=function(e){return this.cmp(e)<1};Xr.logarithm=Xr.log=function(e){var t,n=this,r=n.constructor,o=r.precision,i=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Zm))throw Error(O0+"NaN");if(n.s<1)throw Error(O0+(n.s?"NaN":"-Infinity"));return n.eq(Zm)?new r(0):(gc=!1,t=X1(O3(n,i),O3(e,i),i),gc=!0,cl(t,o))};Xr.minus=Xr.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?sZe(t,e):iZe(t,(e.s=-e.s,e))};Xr.modulo=Xr.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(O0+"NaN");return n.s?(gc=!1,t=X1(n,e,0,1).times(e),gc=!0,n.minus(t)):cl(new r(n),o)};Xr.naturalExponential=Xr.exp=function(){return aZe(this)};Xr.naturalLogarithm=Xr.ln=function(){return O3(this)};Xr.negated=Xr.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Xr.plus=Xr.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?iZe(t,e):sZe(t,(e.s=-e.s,e))};Xr.precision=Xr.sd=function(e){var t,n,r,o=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(TE+e);if(t=rd(o)+1,r=o.d.length-1,n=r*ql+1,r=o.d[r],r){for(;r%10==0;r/=10)n--;for(r=o.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Xr.squareRoot=Xr.sqrt=function(){var e,t,n,r,o,i,s,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(O0+"NaN")}for(e=rd(l),gc=!1,o=Math.sqrt(+l),o==0||o==1/0?(t=kv(l.d),(t.length+e)%2==0&&(t+="0"),o=Math.sqrt(t),e=vk((e+1)/2)-(e<0||e%2),o==1/0?t="5e"+e:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(o.toString()),n=c.precision,o=s=n+3;;)if(i=r,r=i.plus(X1(l,i,s+2)).times(.5),kv(i.d).slice(0,s)===(t=kv(r.d)).slice(0,s)){if(t=t.slice(s-3,s+1),o==s&&t=="4999"){if(cl(i,n+1,0),i.times(i).eq(l)){r=i;break}}else if(t!="9999")break;s+=4}return gc=!0,cl(r,n)};Xr.times=Xr.mul=function(e){var t,n,r,o,i,s,l,c,u,d=this,p=d.constructor,h=d.d,m=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,c=h.length,u=m.length,c=0;){for(t=0,o=c+r;o>r;)l=i[o]+m[r]*h[o-r-1]+t,i[o--]=l%af|0,t=l/af|0;i[o]=(i[o]+t)%af|0}for(;!i[--s];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,gc?cl(e,p.precision):e};Xr.toDecimalPlaces=Xr.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(ab(e,0,yk),t===void 0?t=r.rounding:ab(t,0,8),cl(n,e+rd(n)+1,t))};Xr.toExponential=function(e,t){var n,r=this,o=r.constructor;return e===void 0?n=lI(r,!0):(ab(e,0,yk),t===void 0?t=o.rounding:ab(t,0,8),r=cl(new o(r),e+1,t),n=lI(r,!0,e+1)),n};Xr.toFixed=function(e,t){var n,r,o=this,i=o.constructor;return e===void 0?lI(o):(ab(e,0,yk),t===void 0?t=i.rounding:ab(t,0,8),r=cl(new i(o),e+rd(o)+1,t),n=lI(r.abs(),!1,e+rd(r)+1),o.isneg()&&!o.isZero()?"-"+n:n)};Xr.toInteger=Xr.toint=function(){var e=this,t=e.constructor;return cl(new t(e),rd(e)+1,t.rounding)};Xr.toNumber=function(){return+this};Xr.toPower=Xr.pow=function(e){var t,n,r,o,i,s,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(Zm);if(l=new c(l),!l.s){if(e.s<1)throw Error(O0+"Infinity");return l}if(l.eq(Zm))return l;if(r=c.precision,e.eq(Zm))return cl(l,r);if(t=e.e,n=e.d.length-1,s=t>=n,i=l.s,s){if((n=d<0?-d:d)<=oZe){for(o=new c(Zm),t=Math.ceil(r/ql+4),gc=!1;n%2&&(o=o.times(l),W_e(o.d,t)),n=vk(n/2),n!==0;)l=l.times(l),W_e(l.d,t);return gc=!0,e.s<0?new c(Zm).div(o):cl(o,r)}}else if(i<0)throw Error(O0+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,gc=!1,o=e.times(O3(l,r+u)),gc=!0,o=aZe(o),o.s=i,o};Xr.toPrecision=function(e,t){var n,r,o=this,i=o.constructor;return e===void 0?(n=rd(o),r=lI(o,n<=i.toExpNeg||n>=i.toExpPos)):(ab(e,1,yk),t===void 0?t=i.rounding:ab(t,0,8),o=cl(new i(o),e,t),n=rd(o),r=lI(o,e<=n||n<=i.toExpNeg,e)),r};Xr.toSignificantDigits=Xr.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(ab(e,1,yk),t===void 0?t=r.rounding:ab(t,0,8)),cl(new r(n),e,t)};Xr.toString=Xr.valueOf=Xr.val=Xr.toJSON=Xr[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=rd(e),n=e.constructor;return lI(e,t<=n.toExpNeg||t>=n.toExpPos)};function iZe(e,t){var n,r,o,i,s,l,c,u,d=e.constructor,p=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),gc?cl(t,p):t;if(c=e.d,u=t.d,s=e.e,o=t.e,c=c.slice(),i=s-o,i){for(i<0?(r=c,i=-i,l=u.length):(r=u,o=s,l=c.length),s=Math.ceil(p/ql),l=s>l?s+1:l+1,i>l&&(i=l,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(l=c.length,i=u.length,l-i<0&&(i=l,r=u,u=c,c=r),n=0;i;)n=(c[--i]=c[i]+u[i]+n)/af|0,c[i]%=af;for(n&&(c.unshift(n),++o),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=o,gc?cl(t,p):t}function ab(e,t,n){if(e!==~~e||en)throw Error(TE+e)}function kv(e){var t,n,r,o=e.length-1,i="",s=e[0];if(o>0){for(i+=s,t=1;ts?1:-1;else for(l=c=0;lo[l]?1:-1;break}return c}function n(r,o,i){for(var s=0;i--;)r[i]-=s,s=r[i]1;)r.shift()}return function(r,o,i,s){var l,c,u,d,p,h,m,g,y,x,v,b,w,S,C,N,j,I,_=r.constructor,T=r.s==o.s?1:-1,P=r.d,E=o.d;if(!r.s)return new _(r);if(!o.s)throw Error(O0+"Division by zero");for(c=r.e-o.e,j=E.length,C=P.length,m=new _(T),g=m.d=[],u=0;E[u]==(P[u]||0);)++u;if(E[u]>(P[u]||0)&&--c,i==null?b=i=_.precision:s?b=i+(rd(r)-rd(o))+1:b=i,b<0)return new _(0);if(b=b/ql+2|0,u=0,j==1)for(d=0,E=E[0],b++;(u1&&(E=e(E,d),P=e(P,d),j=E.length,C=P.length),S=j,y=P.slice(0,j),x=y.length;x=af/2&&++N;do d=0,l=t(E,y,j,x),l<0?(v=y[0],j!=x&&(v=v*af+(y[1]||0)),d=v/N|0,d>1?(d>=af&&(d=af-1),p=e(E,d),h=p.length,x=y.length,l=t(p,y,h,x),l==1&&(d--,n(p,j16)throw Error(a0e+rd(e));if(!e.s)return new d(Zm);for(gc=!1,l=p,s=new d(.03125);e.abs().gte(.1);)e=e.times(s),u+=5;for(r=Math.log(xj(2,u))/Math.LN10*2+5|0,l+=r,n=o=i=new d(Zm),d.precision=l;;){if(o=cl(o.times(e),l),n=n.times(++c),s=i.plus(X1(o,n,l)),kv(s.d).slice(0,l)===kv(i.d).slice(0,l)){for(;u--;)i=cl(i.times(i),l);return d.precision=p,t==null?(gc=!0,cl(i,p)):i}i=s}}function rd(e){for(var t=e.e*ql,n=e.d[0];n>=10;n/=10)t++;return t}function CZ(e,t,n){if(t>e.LN10.sd())throw gc=!0,n&&(e.precision=n),Error(O0+"LN10 precision limit exceeded");return cl(new e(e.LN10),t)}function e2(e){for(var t="";e--;)t+="0";return t}function O3(e,t){var n,r,o,i,s,l,c,u,d,p=1,h=10,m=e,g=m.d,y=m.constructor,x=y.precision;if(m.s<1)throw Error(O0+(m.s?"NaN":"-Infinity"));if(m.eq(Zm))return new y(0);if(t==null?(gc=!1,u=x):u=t,m.eq(10))return t==null&&(gc=!0),CZ(y,u);if(u+=h,y.precision=u,n=kv(g),r=n.charAt(0),i=rd(m),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=kv(m.d),r=n.charAt(0),p++;i=rd(m),r>1?(m=new y("0."+n),i++):m=new y(r+"."+n.slice(1))}else return c=CZ(y,u+2,x).times(i+""),m=O3(new y(r+"."+n.slice(1)),u-h).plus(c),y.precision=x,t==null?(gc=!0,cl(m,x)):m;for(l=s=m=X1(m.minus(Zm),m.plus(Zm),u),d=cl(m.times(m),u),o=3;;){if(s=cl(s.times(d),u),c=l.plus(X1(s,new y(o),u)),kv(c.d).slice(0,u)===kv(l.d).slice(0,u))return l=l.times(2),i!==0&&(l=l.plus(CZ(y,u+2,x).times(i+""))),l=X1(l,new y(p),u),y.precision=x,t==null?(gc=!0,cl(l,x)):l;l=c,o+=2}}function U_e(e,t){var n,r,o;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(o=t.length;t.charCodeAt(o-1)===48;)--o;if(t=t.slice(r,o),t){if(o-=r,n=n-r-1,e.e=vk(n/ql),e.d=[],r=(n+1)%ql,n<0&&(r+=ql),r_V||e.e<-_V))throw Error(a0e+n)}else e.s=0,e.e=0,e.d=[0];return e}function cl(e,t,n){var r,o,i,s,l,c,u,d,p=e.d;for(s=1,i=p[0];i>=10;i/=10)s++;if(r=t-s,r<0)r+=ql,o=t,u=p[d=0];else{if(d=Math.ceil((r+1)/ql),i=p.length,d>=i)return e;for(u=i=p[d],s=1;i>=10;i/=10)s++;r%=ql,o=r-ql+s}if(n!==void 0&&(i=xj(10,s-o-1),l=u/i%10|0,c=t<0||p[d+1]!==void 0||u%i,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?o>0?u/xj(10,s-o):0:p[d-1])%10&1||n==(e.s<0?8:7))),t<1||!p[0])return c?(i=rd(e),p.length=1,t=t-i-1,p[0]=xj(10,(ql-t%ql)%ql),e.e=vk(-t/ql)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(r==0?(p.length=d,i=1,d--):(p.length=d+1,i=xj(10,ql-r),p[d]=o>0?(u/xj(10,s-o)%xj(10,o)|0)*i:0),c)for(;;)if(d==0){(p[0]+=i)==af&&(p[0]=1,++e.e);break}else{if(p[d]+=i,p[d]!=af)break;p[d--]=0,i=1}for(r=p.length;p[--r]===0;)p.pop();if(gc&&(e.e>_V||e.e<-_V))throw Error(a0e+rd(e));return e}function sZe(e,t){var n,r,o,i,s,l,c,u,d,p,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),gc?cl(t,m):t;if(c=e.d,p=t.d,r=t.e,u=e.e,c=c.slice(),s=u-r,s){for(d=s<0,d?(n=c,s=-s,l=p.length):(n=p,r=u,l=c.length),o=Math.max(Math.ceil(m/ql),l)+2,s>o&&(s=o,n.length=1),n.reverse(),o=s;o--;)n.push(0);n.reverse()}else{for(o=c.length,l=p.length,d=o0;--o)c[l++]=0;for(o=p.length;o>s;){if(c[--o]0?i=i.charAt(0)+"."+i.slice(1)+e2(r):s>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(o<0?"e":"e+")+o):o<0?(i="0."+e2(-o-1)+i,n&&(r=n-s)>0&&(i+=e2(r))):o>=s?(i+=e2(o+1-s),n&&(r=n-o-1)>0&&(i=i+"."+e2(r))):((r=o+1)0&&(o+1===s&&(i+="."),i+=e2(r))),e.s<0?"-"+i:i}function W_e(e,t){if(e.length>t)return e.length=t,!0}function lZe(e){var t,n,r;function o(i){var s=this;if(!(s instanceof o))return new o(i);if(s.constructor=o,i instanceof o){s.s=i.s,s.e=i.e,s.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(TE+i);if(i>0)s.s=1;else if(i<0)i=-i,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(i===~~i&&i<1e7){s.e=0,s.d=[i];return}return U_e(s,i.toString())}else if(typeof i!="string")throw Error(TE+i);if(i.charCodeAt(0)===45?(i=i.slice(1),s.s=-1):s.s=1,qQt.test(i))U_e(s,i);else throw Error(TE+i)}if(o.prototype=Xr,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.clone=lZe,o.config=o.set=KQt,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=o[t+1]&&r<=o[t+2])this[n]=r;else throw Error(TE+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(TE+n+": "+r);return this}var s0e=lZe(GQt);Zm=new s0e(1);const Fs=s0e;function cZe(e){var t;return e===0?t=1:t=Math.floor(new Fs(e).abs().log(10).toNumber())+1,t}function uZe(e,t,n){for(var r=new Fs(e),o=0,i=[];r.lt(t)&&o<1e5;)i.push(r.toNumber()),r=r.add(n),o++;return i}var dZe=e=>{var[t,n]=e,[r,o]=[t,n];return t>n&&([r,o]=[n,t]),[r,o]},fZe=(e,t,n)=>{if(e.lte(0))return new Fs(0);var r=cZe(e.toNumber()),o=new Fs(10).pow(r),i=e.div(o),s=r!==1?.05:.1,l=new Fs(Math.ceil(i.div(s).toNumber())).add(n).mul(s),c=l.mul(o);return t?new Fs(c.toNumber()):new Fs(Math.ceil(c.toNumber()))},YQt=(e,t,n)=>{var r=new Fs(1),o=new Fs(e);if(!o.isint()&&n){var i=Math.abs(e);i<1?(r=new Fs(10).pow(cZe(e)-1),o=new Fs(Math.floor(o.div(r).toNumber())).mul(r)):i>1&&(o=new Fs(Math.floor(e)))}else e===0?o=new Fs(Math.floor((t-1)/2)):n||(o=new Fs(Math.floor(e)));for(var s=Math.floor((t-1)/2),l=[],c=0;c4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((n-t)/(r-1)))return{step:new Fs(0),tickMin:new Fs(0),tickMax:new Fs(0)};var s=fZe(new Fs(n).sub(t).div(r-1),o,i),l;t<=0&&n>=0?l=new Fs(0):(l=new Fs(t).add(n).div(2),l=l.sub(new Fs(l).mod(s)));var c=Math.ceil(l.sub(t).div(s).toNumber()),u=Math.ceil(new Fs(n).sub(l).div(s).toNumber()),d=c+u+1;return d>r?pZe(t,n,r,o,i+1):(d0?u+(r-d):u,c=n>0?c:c+(r-d)),{step:s,tickMin:l.sub(new Fs(c).mul(s)),tickMax:l.add(new Fs(u).mul(s))})},XQt=function(t){var[n,r]=t,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(o,2),[l,c]=dZe([n,r]);if(l===-1/0||c===1/0){var u=c===1/0?[l,...Array(o-1).fill(1/0)]:[...Array(o-1).fill(-1/0),c];return n>r?u.reverse():u}if(l===c)return YQt(l,o,i);var{step:d,tickMin:p,tickMax:h}=pZe(l,c,s,i,0),m=uZe(p,h.add(new Fs(.1).mul(d)),d);return n>r?m.reverse():m},QQt=function(t,n){var[r,o]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[s,l]=dZe([r,o]);if(s===-1/0||l===1/0)return[r,o];if(s===l)return[s];var c=Math.max(n,2),u=fZe(new Fs(l).sub(s).div(c-1),i,0),d=[...uZe(new Fs(s),new Fs(l),u),l];return i===!1&&(d=d.map(p=>Math.round(p))),r>o?d.reverse():d},hZe=e=>e.rootProps.maxBarSize,JQt=e=>e.rootProps.barGap,mZe=e=>e.rootProps.barCategoryGap,ZQt=e=>e.rootProps.barSize,SL=e=>e.rootProps.stackOffset,gZe=e=>e.rootProps.reverseStackOrder,l0e=e=>e.options.chartName,Mq=e=>e.rootProps.syncId,xZe=e=>e.rootProps.syncMethod,Rq=e=>e.options.eventEmitter,eJt=e=>e.rootProps.baseValue,Pl={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},VS={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:"polygon",cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,orientation:"outer",reversed:!1,scale:"auto",tick:!0,tickLine:!0,tickSize:8,type:"auto",zIndex:Pl.axis},Nx={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,label:!1,orientation:"right",radiusAxisId:0,reversed:!1,scale:"auto",stroke:"#ccc",tick:!0,tickCount:5,tickLine:!0,type:"auto",zIndex:Pl.axis},Oq=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function bk(e,t,n){if(n!=="auto")return n;if(e!=null)return q0(e,t)?"category":"number"}function G_e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function PV(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},wk=on([oJt,kge],(e,t)=>{var n;if(e!=null)return e;var r=(n=bk(t,"angleAxis",q_e.type))!==null&&n!==void 0?n:"category";return PV(PV({},q_e),{},{type:r})}),iJt=(e,t)=>e.polarAxis.radiusAxis[t],CL=on([iJt,kge],(e,t)=>{var n;if(e!=null)return e;var r=(n=bk(t,"radiusAxis",K_e.type))!==null&&n!==void 0?n:"category";return PV(PV({},K_e),{},{type:r})}),$q=e=>e.polarOptions,c0e=on([Hw,Vw,Dd],mJe),yZe=on([$q,c0e],(e,t)=>{if(e!=null)return Ap(e.innerRadius,t,0)}),vZe=on([$q,c0e],(e,t)=>{if(e!=null)return Ap(e.outerRadius,t,t*.8)}),aJt=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},bZe=on([$q],aJt),sJt=on([wk,bZe],Oq),wZe=on([c0e,yZe,vZe],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]}),lJt=on([CL,wZe],Oq),Sk=on([Ui,$q,yZe,vZe,Hw,Vw],(e,t,n,r,o,i)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:s,cy:l,startAngle:c,endAngle:u}=t;return{cx:Ap(s,o,o/2),cy:Ap(l,i,i/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),$l=(e,t)=>t,NL=(e,t,n)=>n;function Dq(e){return e==null?void 0:e.id}function SZe(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:o,dataKey:i}=n,s=new Map;return e.forEach(l=>{var c,u=(c=l.data)!==null&&c!==void 0?c:r;if(!(u==null||u.length===0)){var d=Dq(l);u.forEach((p,h)=>{var m=i==null||o?h:String(La(p,i,null)),g=La(p,l.dataKey,0),y;s.has(m)?y=s.get(m):y={},Object.assign(y,{[d]:g}),s.set(m,y)})}}),Array.from(s.values())}function Lq(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Fq=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function zq(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function cJt(e,t){if(e.length===t.length){for(var n=0;n{var t=Ui(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Ck=e=>e.tooltip.settings.axisId;function uJt(e){if(e in mR)return mR[e]();var t="scale".concat(lL(e));if(t in mR)return mR[t]()}function Y_e(e){var t=e.ticks,n=e.bandwidth,r=e.range(),o=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:(function(i){function s(){return i.apply(this,arguments)}return s.toString=function(){return i.toString()},s})(()=>o),rangeMin:()=>o[0],rangeMax:()=>o[1],isInRange(i){var s=o[0],l=o[1];return s<=l?i>=s&&i<=l:i>=l&&i<=s},bandwidth:n?()=>n.call(e):void 0,ticks:t?i=>t.call(e,i):void 0,map:(i,s)=>{var l=e(i);if(l!=null){if(e.bandwidth&&s!==null&&s!==void 0&&s.position){var c=e.bandwidth();switch(s.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}function X_e(e,t,n){if(typeof e=="function")return Y_e(e.copy().domain(t).range(n));if(e!=null){var r=uJt(e);if(r!=null)return r.domain(t).range(n),Y_e(r)}}var CZe=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!gw(t)){for(var n,r,o=0;or)&&(r=i))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Q_e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function AV(e){for(var t=1;te.cartesianAxis.xAxis[t],Ib=(e,t)=>{var n=NZe(e,t);return n??ef},tf={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:kae,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:dL},jZe=(e,t)=>e.cartesianAxis.yAxis[t],_b=(e,t)=>{var n=jZe(e,t);return n??tf},hJt={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:""},u0e=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??hJt},xu=(e,t,n)=>{switch(t){case"xAxis":return Ib(e,n);case"yAxis":return _b(e,n);case"zAxis":return u0e(e,n);case"angleAxis":return wk(e,n);case"radiusAxis":return CL(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},mJt=(e,t,n)=>{switch(t){case"xAxis":return Ib(e,n);case"yAxis":return _b(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},o5=(e,t,n)=>{switch(t){case"xAxis":return Ib(e,n);case"yAxis":return _b(e,n);case"angleAxis":return wk(e,n);case"radiusAxis":return CL(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},EZe=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function d0e(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var jL=e=>e.graphicalItems.cartesianItems,gJt=on([$l,NL],d0e),f0e=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),EL=on([jL,xu,gJt],f0e,{memoizeOptions:{resultEqualityCheck:zq}}),IZe=on([EL],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Lq)),_Ze=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),xJt=on([EL],_Ze),p0e=e=>e.map(t=>t.data).filter(Boolean).flat(1),yJt=on([EL],p0e,{memoizeOptions:{resultEqualityCheck:zq}}),h0e=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:o}=t;return e.length>0?e:n.slice(r,o+1)},m0e=on([yJt,i0e],h0e),g0e=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:La(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(o=>({value:La(o,r)}))):e.map(r=>({value:r})),Bq=on([m0e,xu,EL],g0e);function PZe(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function qz(e){if(M0(e)||e instanceof Date){var t=Number(e);if(ci(t))return t}}function J_e(e){if(Array.isArray(e)){var t=[qz(e[0]),qz(e[1])];return gw(t)?t:void 0}var n=qz(e);if(n!=null)return[n,n]}function xw(e){return e.map(qz).filter(jp)}function vJt(e,t,n){return!n||typeof t!="number"||dy(t)?[]:n.length?xw(n.flatMap(r=>{var o=La(e,r.dataKey),i,s;if(Array.isArray(o)?[i,s]=o:i=s=o,!(!ci(i)||!ci(s)))return[t-i,t+s]})):[]}var Fd=e=>{var t=bf(e),n=Ck(e);return o5(e,t,n)},IL=on([Fd],e=>e==null?void 0:e.dataKey),bJt=on([IZe,i0e,Fd],SZe),AZe=(e,t,n,r)=>{var o={},i=t.reduce((s,l)=>{if(l.stackId==null)return s;var c=s[l.stackId];return c==null&&(c=[]),c.push(l),s[l.stackId]=c,s},o);return Object.fromEntries(Object.entries(i).map(s=>{var[l,c]=s,u=r?[...c].reverse():c,d=u.map(Dq);return[l,{stackedData:MGt(e,d,n),graphicalItems:u}]}))},TV=on([bJt,IZe,SL,gZe],AZe),TZe=(e,t,n,r)=>{var{dataStartIndex:o,dataEndIndex:i}=t;if(r==null&&n!=="zAxis"){var s=DGt(e,o,i);if(!(s!=null&&s[0]===0&&s[1]===0))return s}},wJt=on([xu],e=>e.allowDataOverflow),x0e=e=>{var t;if(e==null||!("domain"in e))return kae;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=xw(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:kae},y0e=on([xu],x0e),v0e=on([y0e,wJt],rZe),SJt=on([TV,Ww,$l,v0e],TZe,{memoizeOptions:{resultEqualityCheck:Fq}}),Hq=e=>e.errorBars,CJt=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>PZe(n,r)),kV=function(){for(var t=arguments.length,n=new Array(t),r=0;r{var i,s;if(n.length>0&&e.forEach(l=>{n.forEach(c=>{var u,d,p=(u=r[c.id])===null||u===void 0?void 0:u.filter(v=>PZe(o,v)),h=La(l,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),m=vJt(l,h,p);if(m.length>=2){var g=Math.min(...m),y=Math.max(...m);(i==null||gs)&&(s=y)}var x=J_e(h);x!=null&&(i=i==null?x[0]:Math.min(i,x[0]),s=s==null?x[1]:Math.max(s,x[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(l=>{var c=J_e(La(l,t.dataKey));c!=null&&(i=i==null?c[0]:Math.min(i,c[0]),s=s==null?c[1]:Math.max(s,c[1]))}),ci(i)&&ci(s))return[i,s]},NJt=on([m0e,xu,xJt,Hq,$l],b0e,{memoizeOptions:{resultEqualityCheck:Fq}});function jJt(e){var{value:t}=e;if(M0(t)||t instanceof Date)return t}var EJt=(e,t,n)=>{var r=e.map(jJt).filter(o=>o!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&GXe(r))?Oge(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},kZe=e=>e.referenceElements.dots,Nk=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),IJt=on([kZe,$l,NL],Nk),MZe=e=>e.referenceElements.areas,_Jt=on([MZe,$l,NL],Nk),RZe=e=>e.referenceElements.lines,PJt=on([RZe,$l,NL],Nk),OZe=(e,t)=>{if(e!=null){var n=xw(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},AJt=on(IJt,$l,OZe),$Ze=(e,t)=>{if(e!=null){var n=xw(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},TJt=on([_Jt,$l],$Ze);function kJt(e){var t;if(e.x!=null)return xw([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:xw(n)}function MJt(e){var t;if(e.y!=null)return xw([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:xw(n)}var DZe=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?kJt(r):MJt(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},RJt=on([PJt,$l],DZe),OJt=on(AJt,RJt,TJt,(e,t,n)=>kV(e,n,t)),w0e=(e,t,n,r,o,i,s,l)=>{if(n!=null)return n;var c=s==="vertical"&&l==="xAxis"||s==="horizontal"&&l==="yAxis",u=c?kV(r,i,o):kV(i,o);return WQt(t,u,e.allowDataOverflow)},$Jt=on([xu,y0e,v0e,SJt,NJt,OJt,Ui,$l],w0e,{memoizeOptions:{resultEqualityCheck:Fq}}),DJt=[0,1],S0e=(e,t,n,r,o,i,s)=>{if(!((e==null||n==null||n.length===0)&&s===void 0)){var{dataKey:l,type:c}=e,u=q0(t,i);if(u&&l==null){var d;return Oge(0,(d=n==null?void 0:n.length)!==null&&d!==void 0?d:0)}return c==="category"?EJt(r,e,u):o==="expand"?DJt:s}},C0e=on([xu,Ui,m0e,Bq,SL,$l,$Jt],S0e);function LJt(e){return e in mR}var LZe=(e,t,n)=>{if(e!=null){var{scale:r,type:o}=e;if(r==="auto")return o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":o==="category"?"band":"linear";if(typeof r=="string"){var i="scale".concat(lL(r));return LJt(i)?i:"point"}}},Pb=on([xu,EZe,l0e],LZe);function Vq(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?X_e(e.scale,n,r):X_e(t,n,r)}var N0e=(e,t,n)=>{var r=x0e(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(r)&&(r[0]==="auto"||r[1]==="auto")&&gw(e))return XQt(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&gw(e))return QQt(e,t.tickCount,t.allowDecimals)}},j0e=on([C0e,o5,Pb],N0e),E0e=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&gw(t)&&Array.isArray(n)&&n.length>0){var o,i,s=t[0],l=(o=n[0])!==null&&o!==void 0?o:0,c=t[1],u=(i=n[n.length-1])!==null&&i!==void 0?i:0;return[Math.min(s,l),Math.max(c,u)]}return t},FJt=on([xu,C0e,j0e,$l],E0e),zJt=on(Bq,xu,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(xw(e.map(p=>p.value))).sort((p,h)=>p-h),o=r[0],i=r[r.length-1];if(o==null||i==null)return 1/0;var s=i-o;if(s===0)return 1/0;for(var l=0;lo,(e,t,n,r,o)=>{if(!ci(e))return 0;var i=t==="vertical"?r.height:r.width;if(o==="gap")return e*i/2;if(o==="no-gap"){var s=Ap(n,e*i),l=e*i/2;return l-s-(l-s)/i*s}return 0}),BJt=(e,t,n)=>{var r=Ib(e,t);return r==null||typeof r.padding!="string"?0:FZe(e,"xAxis",t,n,r.padding)},HJt=(e,t,n)=>{var r=_b(e,t);return r==null||typeof r.padding!="string"?0:FZe(e,"yAxis",t,n,r.padding)},VJt=on(Ib,BJt,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:o}=e;return typeof o=="string"?{left:t,right:t}:{left:((n=o.left)!==null&&n!==void 0?n:0)+t,right:((r=o.right)!==null&&r!==void 0?r:0)+t}}),UJt=on(_b,HJt,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:o}=e;return typeof o=="string"?{top:t,bottom:t}:{top:((n=o.top)!==null&&n!==void 0?n:0)+t,bottom:((r=o.bottom)!==null&&r!==void 0?r:0)+t}}),WJt=on([Dd,VJt,fL,Cq,(e,t,n)=>n],(e,t,n,r,o)=>{var{padding:i}=r;return o?[i.left,n.width-i.right]:[e.left+t.left,e.left+e.width-t.right]}),GJt=on([Dd,Ui,UJt,fL,Cq,(e,t,n)=>n],(e,t,n,r,o,i)=>{var{padding:s}=o;return i?[r.height-s.bottom,s.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),_L=(e,t,n,r)=>{var o;switch(t){case"xAxis":return WJt(e,n,r);case"yAxis":return GJt(e,n,r);case"zAxis":return(o=u0e(e,n))===null||o===void 0?void 0:o.range;case"angleAxis":return bZe(e);case"radiusAxis":return wZe(e,n);default:return}},zZe=on([xu,_L],Oq),qJt=on([Pb,FJt],CZe),lT=on([xu,Pb,qJt,zZe],Vq);on([EL,Hq,$l],CJt);function BZe(e,t){return e.idt.id?1:0}var Uq=(e,t)=>t,Wq=(e,t,n)=>n,KJt=on(wq,Uq,Wq,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(BZe)),YJt=on(Sq,Uq,Wq,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(BZe)),HZe=(e,t)=>({width:e.width,height:t.height}),XJt=(e,t)=>{var n=typeof t.width=="number"?t.width:dL;return{width:n,height:e.height}},VZe=on(Dd,Ib,HZe),QJt=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},JJt=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},ZJt=on(Vw,Dd,KJt,Uq,Wq,(e,t,n,r,o)=>{var i={},s;return n.forEach(l=>{var c=HZe(t,l);s==null&&(s=QJt(t,r,e));var u=r==="top"&&!o||r==="bottom"&&o;i[l.id]=s-Number(u)*c.height,s+=(u?-1:1)*c.height}),i}),eZt=on(Hw,Dd,YJt,Uq,Wq,(e,t,n,r,o)=>{var i={},s;return n.forEach(l=>{var c=XJt(t,l);s==null&&(s=JJt(t,r,e));var u=r==="left"&&!o||r==="right"&&o;i[l.id]=s-Number(u)*c.width,s+=(u?-1:1)*c.width}),i}),tZt=(e,t)=>{var n=Ib(e,t);if(n!=null)return ZJt(e,n.orientation,n.mirror)},nZt=on([Dd,Ib,tZt,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var o=n==null?void 0:n[r];return o==null?{x:e.left,y:0}:{x:e.left,y:o}}}),rZt=(e,t)=>{var n=_b(e,t);if(n!=null)return eZt(e,n.orientation,n.mirror)},oZt=on([Dd,_b,rZt,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var o=n==null?void 0:n[r];return o==null?{x:0,y:e.top}:{x:o,y:e.top}}}),UZe=on(Dd,_b,(e,t)=>{var n=typeof t.width=="number"?t.width:dL;return{width:n,height:e.height}}),Z_e=(e,t,n)=>{switch(t){case"xAxis":return VZe(e,n).width;case"yAxis":return UZe(e,n).height;default:return}},WZe=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:o,type:i,dataKey:s}=n,l=q0(e,r),c=t.map(u=>u.value);if(s&&l&&i==="category"&&o&&GXe(c))return c}},PL=on([Ui,Bq,xu,$l],WZe),I0e=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:o,scale:i}=n,s=q0(e,r);if(s&&(o==="number"||i!=="auto"))return t.map(l=>l.value)}},_0e=on([Ui,Bq,o5,$l],I0e),ePe=on([Ui,mJt,Pb,lT,PL,_0e,_L,j0e,$l],(e,t,n,r,o,i,s,l,c)=>{if(t!=null){var u=q0(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:i,duplicateDomain:o,isCategorical:u,niceTicks:l,range:s,realScaleType:n,scale:r}}}),GZe=(e,t,n,r,o,i,s,l,c)=>{if(!(t==null||r==null)){var u=q0(e,c),{type:d,ticks:p,tickCount:h}=t,m=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,g=d==="category"&&r.bandwidth?r.bandwidth()/m:0;g=c==="angleAxis"&&i!=null&&i.length>=2?df(i[0]-i[1])*2*g:g;var y=p||o;return y?y.map((x,v)=>{var b=s?s.indexOf(x):x,w=r.map(b);return ci(w)?{index:v,coordinate:w+g,value:x,offset:g}:null}).filter(jp):u&&l?l.map((x,v)=>{var b=r.map(x);return ci(b)?{coordinate:b+g,value:x,index:v,offset:g}:null}).filter(jp):r.ticks?r.ticks(h).map((x,v)=>{var b=r.map(x);return ci(b)?{coordinate:b+g,value:x,index:v,offset:g}:null}).filter(jp):r.domain().map((x,v)=>{var b=r.map(x);return ci(b)?{coordinate:b+g,value:s?s[x]:x,index:v,offset:g}:null}).filter(jp)}},qZe=on([Ui,o5,Pb,lT,j0e,_L,PL,_0e,$l],GZe),KZe=(e,t,n,r,o,i,s)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=q0(e,s),{tickCount:c}=t,u=0;return u=s==="angleAxis"&&(r==null?void 0:r.length)>=2?df(r[0]-r[1])*2*u:u,l&&i?i.map((d,p)=>{var h=n.map(d);return ci(h)?{coordinate:h+u,value:d,index:p,offset:u}:null}).filter(jp):n.ticks?n.ticks(c).map((d,p)=>{var h=n.map(d);return ci(h)?{coordinate:h+u,value:d,index:p,offset:u}:null}).filter(jp):n.domain().map((d,p)=>{var h=n.map(d);return ci(h)?{coordinate:h+u,value:o?o[d]:d,index:p,offset:u}:null}).filter(jp)}},sb=on([Ui,o5,lT,_L,PL,_0e,$l],KZe),lb=on(xu,lT,(e,t)=>{if(!(e==null||t==null))return AV(AV({},e),{},{scale:t})}),iZt=on([xu,Pb,C0e,zZe],Vq);on((e,t,n)=>u0e(e,n),iZt,(e,t)=>{if(!(e==null||t==null))return AV(AV({},e),{},{scale:t})});var aZt=on([Ui,wq,Sq],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),YZe=e=>e.options.defaultTooltipEventType,XZe=e=>e.options.validateTooltipEventTypes;function QZe(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function P0e(e,t){var n=YZe(e),r=XZe(e);return QZe(t,n,r)}function sZt(e){return gr(t=>P0e(t,e))}var JZe=(e,t)=>{var n,r=Number(t);if(!(dy(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},lZt=e=>e.tooltip.settings,m2={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},cZt={itemInteraction:{click:m2,hover:m2},axisInteraction:{click:m2,hover:m2},keyboardInteraction:m2,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}},ZZe=bm({name:"tooltip",initialState:cZt,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:fc()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,o=ey(e).tooltipItemPayloads.indexOf(n);o>-1&&(e.tooltipItemPayloads[o]=r)},prepare:fc()},removeTooltipEntrySettings:{reducer(e,t){var n=ey(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:fc()},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:uZt,replaceTooltipEntrySettings:dZt,removeTooltipEntrySettings:fZt,setTooltipSettingsState:pZt,setActiveMouseOverItemIndex:eet,mouseLeaveItem:hZt,mouseLeaveChart:tet,setActiveClickItemIndex:mZt,setMouseOverAxisIndex:net,setMouseClickAxisIndex:gZt,setSyncInteraction:Mae,setKeyboardInteraction:Rae}=ZZe.actions,xZt=ZZe.reducer;function tPe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function dF(e){for(var t=1;t{if(t==null)return m2;var o=wZt(e,t,n);if(o==null)return m2;if(o.active)return o;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(SZt(o)){if(i)return dF(dF({},o),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return dF(dF({},m2),{},{coordinate:o.coordinate})};function CZt(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function NZt(e,t){var n=CZt(e),r=t[0],o=t[1];if(n===void 0)return!1;var i=Math.min(r,o),s=Math.max(r,o);return n>=i&&n<=s}function jZt(e,t,n){if(n==null||t==null)return!0;var r=La(e,t);return r==null||!gw(n)?!0:NZt(r,n)}var A0e=(e,t,n,r)=>{var o=e==null?void 0:e.index;if(o==null)return null;var i=Number(o);if(!ci(i))return o;var s=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(s,Math.min(i,l)),u=t[c];return u==null||jZt(u,n,r)?String(c):null},oet=(e,t,n,r,o,i,s)=>{if(i!=null){var l=s[0],c=l==null?void 0:l.getPosition(i);if(c!=null)return c;var u=o==null?void 0:o[Number(i)];if(u)switch(n){case"horizontal":return{x:u.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:u.coordinate}}}},iet=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var o;if(n==="hover"?o=e.itemInteraction.hover.graphicalItemId:o=e.itemInteraction.click.graphicalItemId,o==null&&r!=null){var i=e.tooltipItemPayloads[0];return i!=null?[i]:[]}return e.tooltipItemPayloads.filter(s=>{var l;return((l=s.settings)===null||l===void 0?void 0:l.graphicalItemId)===o})},aet=e=>e.options.tooltipPayloadSearcher,jk=e=>e.tooltip;function nPe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function rPe(e){for(var t=1;t{if(!(t==null||i==null)){var{chartData:l,computedData:c,dataStartIndex:u,dataEndIndex:d}=n,p=[];return e.reduce((h,m)=>{var g,{dataDefinedOnItem:y,settings:x}=m,v=PZt(y,l),b=Array.isArray(v)?zQe(v,u,d):v,w=(g=x==null?void 0:x.dataKey)!==null&&g!==void 0?g:r,S=x==null?void 0:x.nameKey,C;if(r&&Array.isArray(b)&&!Array.isArray(b[0])&&s==="axis"?C=qXe(b,r,o):C=i(b,t,c,S),Array.isArray(C))C.forEach(j=>{var I=rPe(rPe({},x),{},{name:j.name,unit:j.unit,color:void 0,fill:void 0});h.push(e5e({tooltipEntrySettings:I,dataKey:j.dataKey,payload:j.payload,value:La(j.payload,j.dataKey),name:j.name}))});else{var N;h.push(e5e({tooltipEntrySettings:x,dataKey:w,payload:C,value:La(C,w),name:(N=La(C,S))!==null&&N!==void 0?N:x==null?void 0:x.name}))}return h},p)}},T0e=on([Fd,EZe,l0e],LZe),AZt=on([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),TZt=on([bf,Ck],d0e),Ek=on([AZt,Fd,TZt],f0e,{memoizeOptions:{resultEqualityCheck:zq}}),kZt=on([Ek],e=>e.filter(Lq)),MZt=on([Ek],p0e,{memoizeOptions:{resultEqualityCheck:zq}}),Ik=on([MZt,Ww],h0e),RZt=on([kZt,Ww,Fd],SZe),k0e=on([Ik,Fd,Ek],g0e),cet=on([Fd],x0e),OZt=on([Fd],e=>e.allowDataOverflow),uet=on([cet,OZt],rZe),$Zt=on([Ek],e=>e.filter(Lq)),DZt=on([RZt,$Zt,SL,gZe],AZe),LZt=on([DZt,Ww,bf,uet],TZe),FZt=on([Ek],_Ze),zZt=on([Ik,Fd,FZt,Hq,bf],b0e,{memoizeOptions:{resultEqualityCheck:Fq}}),BZt=on([kZe,bf,Ck],Nk),HZt=on([BZt,bf],OZe),VZt=on([MZe,bf,Ck],Nk),UZt=on([VZt,bf],$Ze),WZt=on([RZe,bf,Ck],Nk),GZt=on([WZt,bf],DZe),qZt=on([HZt,GZt,UZt],kV),KZt=on([Fd,cet,uet,LZt,zZt,qZt,Ui,bf],w0e),AL=on([Fd,Ui,Ik,k0e,SL,bf,KZt],S0e),YZt=on([AL,Fd,T0e],N0e),XZt=on([Fd,AL,YZt,bf],E0e),det=e=>{var t=bf(e),n=Ck(e),r=!1;return _L(e,t,n,r)},fet=on([Fd,det],Oq),pet=on([Fd,T0e,XZt,fet],Vq),QZt=on([Ui,k0e,Fd,bf],WZe),JZt=on([Ui,k0e,Fd,bf],I0e),ZZt=(e,t,n,r,o,i,s,l)=>{if(t){var{type:c}=t,u=q0(e,l);if(r){var d=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,p=c==="category"&&r.bandwidth?r.bandwidth()/d:0;return p=l==="angleAxis"&&o!=null&&(o==null?void 0:o.length)>=2?df(o[0]-o[1])*2*p:p,u&&s?s.map((h,m)=>{var g=r.map(h);return ci(g)?{coordinate:g+p,value:h,index:m,offset:p}:null}).filter(jp):r.domain().map((h,m)=>{var g=r.map(h);return ci(g)?{coordinate:g+p,value:i?i[h]:h,index:m,offset:p}:null}).filter(jp)}}},Gw=on([Ui,Fd,T0e,pet,det,QZt,JZt,bf],ZZt),M0e=on([YZe,XZe,lZt],(e,t,n)=>QZe(n.shared,e,t)),het=e=>e.tooltip.settings.trigger,R0e=e=>e.tooltip.settings.defaultIndex,TL=on([jk,M0e,het,R0e],ret),jC=on([TL,Ik,IL,AL],A0e),met=on([Gw,jC],JZe),O0e=on([TL],e=>{if(e)return e.dataKey}),een=on([TL],e=>{if(e)return e.graphicalItemId}),get=on([jk,M0e,het,R0e],iet),ten=on([Hw,Vw,Ui,Dd,Gw,R0e,get],oet),nen=on([TL,ten],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),ren=on([TL],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),oen=on([get,jC,Ww,IL,met,aet,M0e],set),ien=on([oen],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function oPe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function iPe(e){for(var t=1;tgr(Fd),uen=()=>{var e=cen(),t=gr(Gw),n=gr(pet);return ib(!e||!n?void 0:iPe(iPe({},e),{},{scale:n}),t)};function aPe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function t_(e){for(var t=1;t{var o=t.find(i=>i&&i.index===n);if(o){if(e==="horizontal")return{x:o.coordinate,y:r.chartY};if(e==="vertical")return{x:r.chartX,y:o.coordinate}}return{x:0,y:0}},men=(e,t,n,r)=>{var o=t.find(u=>u&&u.index===n);if(o){if(e==="centric"){var i=o.coordinate,{radius:s}=r;return t_(t_(t_({},r),cs(r.cx,r.cy,s,i)),{},{angle:i,radius:s})}var l=o.coordinate,{angle:c}=r;return t_(t_(t_({},r),cs(r.cx,r.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function gen(e,t){var{chartX:n,chartY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var xet=(e,t,n,r,o)=>{var i,s=(i=t==null?void 0:t.length)!==null&&i!==void 0?i:0;if(s<=1||e==null)return 0;if(r==="angleAxis"&&o!=null&&Math.abs(Math.abs(o[1]-o[0])-360)<=1e-6)for(var l=0;l0?(c=n[l-1])===null||c===void 0?void 0:c.coordinate:(u=n[s-1])===null||u===void 0?void 0:u.coordinate,g=(d=n[l])===null||d===void 0?void 0:d.coordinate,y=l>=s-1?(p=n[0])===null||p===void 0?void 0:p.coordinate:(h=n[l+1])===null||h===void 0?void 0:h.coordinate,x=void 0;if(!(m==null||g==null||y==null))if(df(g-m)!==df(y-g)){var v=[];if(df(y-g)===df(o[1]-o[0])){x=y;var b=g+o[1]-o[0];v[0]=Math.min(b,(b+m)/2),v[1]=Math.max(b,(b+m)/2)}else{x=m;var w=y+o[1]-o[0];v[0]=Math.min(g,(w+g)/2),v[1]=Math.max(g,(w+g)/2)}var S=[Math.min(g,(x+g)/2),Math.max(g,(x+g)/2)];if(e>S[0]&&e<=S[1]||e>=v[0]&&e<=v[1]){var C;return(C=n[l])===null||C===void 0?void 0:C.index}}else{var N=Math.min(m,y),j=Math.max(m,y);if(e>(N+g)/2&&e<=(j+g)/2){var I;return(I=n[l])===null||I===void 0?void 0:I.index}}}else if(t)for(var _=0;_(T.coordinate+E.coordinate)/2||_>0&&_(T.coordinate+E.coordinate)/2&&e<=(T.coordinate+P.coordinate)/2)return T.index}}return-1},yet=()=>gr(l0e),$0e=(e,t)=>t,vet=(e,t,n)=>n,D0e=(e,t,n,r)=>r,xen=on(Gw,e=>dq(e,t=>t.coordinate)),L0e=on([jk,$0e,vet,D0e],ret),F0e=on([L0e,Ik,IL,AL],A0e),yen=(e,t,n)=>{if(t!=null){var r=jk(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},bet=on([jk,$0e,vet,D0e],iet),MV=on([Hw,Vw,Ui,Dd,Gw,D0e,bet],oet),ven=on([L0e,MV],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),wet=on([Gw,F0e],JZe),ben=on([bet,F0e,Ww,IL,wet,aet,$0e],set),wen=on([L0e,F0e],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Sen=(e,t,n,r,o,i,s)=>{if(!(!e||!n||!r||!o)&&gen(e,s)){var l=LGt(e,t),c=xet(l,i,o,n,r),u=hen(t,o,c,e);return{activeIndex:String(c),activeCoordinate:u}}},Cen=(e,t,n,r,o,i,s)=>{if(!(!e||!r||!o||!i||!n)){var l=tYt(e,n);if(l){var c=FGt(l,t),u=xet(c,s,i,r,o),d=men(t,i,u,l);return{activeIndex:String(u),activeCoordinate:d}}}},Nen=(e,t,n,r,o,i,s,l)=>{if(!(!e||!t||!r||!o||!i))return t==="horizontal"||t==="vertical"?Sen(e,t,r,o,i,s,l):Cen(e,t,n,r,o,i,s)},jen=on(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),Een=on(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Pl)),n=Array.from(new Set(t));return n.sort((r,o)=>r-o)},{memoizeOptions:{resultEqualityCheck:cJt}});function sPe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function lPe(e){for(var t=1;tlPe(lPe({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),Aen)},ken=new Set(Object.values(Pl));function Men(e){return ken.has(e)}var Cet=bm({name:"zIndex",initialState:Ten,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:fc()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!Men(n)&&delete e.zIndexMap[n])},prepare:fc()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:o}=t.payload;e.zIndexMap[n]?o?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:o?void 0:r,panoramaElement:o?r:void 0}},prepare:fc()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:fc()}}}),{registerZIndexPortal:Ren,unregisterZIndexPortal:Oen,registerZIndexPortalElement:$en,unregisterZIndexPortalElement:Den}=Cet.actions,Len=Cet.reducer;function id(e){var{zIndex:t,children:n}=e,r=gqt(),o=r&&t!==void 0&&t!==0,i=Vu(),s=fs();f.useLayoutEffect(()=>o?(s(Ren({zIndex:t})),()=>{s(Oen({zIndex:t}))}):Ey,[s,t,o]);var l=gr(c=>jen(c,t,i));return o?l?pu.createPortal(n,l):null:n}function Oae(){return Oae=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.useContext(Net),NZ={exports:{}},uPe;function Gen(){return uPe||(uPe=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function o(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function i(c,u,d,p,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new o(d,p||c,h),g=n?n+u:u;return c._events[g]?c._events[g].fn?c._events[g]=[c._events[g],m]:c._events[g].push(m):(c._events[g]=m,c._eventsCount++),c}function s(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,p;if(this._eventsCount===0)return u;for(p in d=this._events)t.call(d,p)&&u.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,p=this._events[d];if(!p)return[];if(p.fn)return[p.fn];for(var h=0,m=p.length,g=new Array(m);h{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!dy(n))return e[n]}},Yen={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},jet=bm({name:"options",initialState:Yen,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Xen=jet.reducer,{createEventEmitter:Qen}=jet.actions;function Jen(e){return e.tooltip.syncInteraction}var Zen={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},Eet=bm({name:"chartData",initialState:Zen,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:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:dPe,setDataStartEndIndexes:Lae,setComputedData:_no}=Eet.actions,etn=Eet.reducer,ttn=["x","y"];function fPe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function n_(e){for(var t=1;tc.rootProps.className);f.useEffect(()=>{if(e==null)return Ey;var c=(u,d,p)=>{if(t!==p&&e===u){if(r==="index"){var h;if(s&&d!==null&&d!==void 0&&(h=d.payload)!==null&&h!==void 0&&h.coordinate&&d.payload.sourceViewBox){var m=d.payload.coordinate,{x:g,y}=m,x=itn(m,ttn),{x:v,y:b,width:w,height:S}=d.payload.sourceViewBox,C=n_(n_({},x),{},{x:s.x+(w?(g-v)/w:0)*s.width,y:s.y+(S?(y-b)/S:0)*s.height});n(n_(n_({},d),{},{payload:n_(n_({},d.payload),{},{coordinate:C})}))}else n(d);return}if(o!=null){var N;if(typeof r=="function"){var j={activeTooltipIndex:d.payload.index==null?void 0:Number(d.payload.index),isTooltipActive:d.payload.active,activeIndex:d.payload.index==null?void 0:Number(d.payload.index),activeLabel:d.payload.label,activeDataKey:d.payload.dataKey,activeCoordinate:d.payload.coordinate},I=r(o,j);N=o[I]}else r==="value"&&(N=o.find(D=>String(D.value)===d.payload.label));var{coordinate:_}=d.payload;if(N==null||d.payload.active===!1||_==null||s==null){n(Mae({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:T,y:P}=_,E=Math.min(T,s.x+s.width),M=Math.min(P,s.y+s.height),R={x:i==="horizontal"?N.coordinate:E,y:i==="horizontal"?M:N.coordinate},$=Mae({active:d.payload.active,coordinate:R,dataKey:d.payload.dataKey,index:String(N.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n($)}}};return cT.on($ae,c),()=>{cT.off($ae,c)}},[l,n,t,e,r,o,i,s])}function ltn(){var e=gr(Mq),t=gr(Rq),n=fs();f.useEffect(()=>{if(e==null)return Ey;var r=(o,i,s)=>{t!==s&&e===o&&n(Lae(i))};return cT.on(Dae,r),()=>{cT.off(Dae,r)}},[n,t,e])}function ctn(){var e=fs();f.useEffect(()=>{e(Qen())},[e]),stn(),ltn()}function utn(e,t,n,r,o,i){var s=gr(m=>yen(m,e,t)),l=gr(Rq),c=gr(Mq),u=gr(xZe),d=gr(Jen),p=d==null?void 0:d.active,h=pL();f.useEffect(()=>{if(!p&&c!=null&&l!=null){var m=Mae({active:i,coordinate:n,dataKey:s,index:o,label:typeof r=="number"?String(r):r,sourceViewBox:h,graphicalItemId:void 0});cT.emit($ae,c,m,l)}},[p,n,s,o,r,l,c,u,i,h])}function dtn(){var e=gr(Mq),t=gr(Rq),n=gr(o=>o.chartData.dataStartIndex),r=gr(o=>o.chartData.dataEndIndex);f.useEffect(()=>{if(!(e==null||n==null||r==null||t==null)){var o={startIndex:n,endIndex:r};cT.emit(Dae,e,o,t)}},[r,n,t,e])}function pPe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function hPe(e){for(var t=1;t{j(pZt({shared:b,trigger:w,axisId:N,active:o,defaultIndex:I}))},[j,b,w,N,o,I]);var _=pL(),T=cJe(),P=sZt(b),{activeIndex:E,isActive:M}=(t=gr(J=>wen(J,P,w,I)))!==null&&t!==void 0?t:{},R=gr(J=>ben(J,P,w,I)),$=gr(J=>wet(J,P,w,I)),D=gr(J=>ven(J,P,w,I)),z=R,V=Wen(),B=(n=o??M)!==null&&n!==void 0?n:!1,[G,H]=uQe([z,B]),F=P==="axis"?$:void 0;utn(P,w,D,F,E,B);var W=C??V;if(W==null||_==null||P==null)return null;var U=z??mPe;B||(U=mPe),u&&U.length&&(U=rQe(U.filter(J=>J.value!=null&&(J.hide!==!0||r.includeHidden)),h,mtn));var K=U.length>0,X=f.createElement(tKt,{allowEscapeViewBox:i,animationDuration:s,animationEasing:l,isAnimationActive:d,active:B,coordinate:D,hasPayload:K,offset:p,position:m,reverseDirection:g,useTranslate3d:y,viewBox:_,wrapperStyle:x,lastBoundingBox:G,innerRef:H,hasPortalFromProps:!!C},gtn(c,hPe(hPe({},r),{},{payload:U,label:F,active:B,activeIndex:E,coordinate:D,accessibilityLayer:T})));return f.createElement(f.Fragment,null,pu.createPortal(X,W),B&&f.createElement(Uen,{cursor:v,tooltipEventType:P,coordinate:D,payload:U,index:E}))}var Eh=e=>null;Eh.displayName="Cell";function ytn(e,t,n){return(t=vtn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vtn(e){var t=btn(e,"string");return typeof t=="symbol"?t:t+""}function btn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class wtn{constructor(t){ytn(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function gPe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Stn(e){for(var t=1;t{try{var n=document.getElementById(yPe);n||(n=document.createElement("span"),n.setAttribute("id",yPe),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,Itn,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},lO=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||gL.isSsr)return{width:0,height:0};if(!Iet.enableCache)return vPe(t,n);var r=_tn(t,n),o=xPe.get(r);if(o)return o;var i=vPe(t,n);return xPe.set(r,i),i},_et;function Ptn(e,t,n){return(t=Atn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Atn(e){var t=Ttn(e,"string");return typeof t=="symbol"?t:t+""}function Ttn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bPe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,wPe=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,ktn=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Mtn=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Rtn={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Otn=["cm","mm","pt","pc","in","Q","px"];function $tn(e){return Otn.includes(e)}var wP="NaN";function Dtn(e,t){return e*Rtn[t]}class Rf{static parse(t){var n,[,r,o]=(n=Mtn.exec(t))!==null&&n!==void 0?n:[];return r==null?Rf.NaN:new Rf(parseFloat(r),o??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,dy(t)&&(this.unit=""),n!==""&&!ktn.test(n)&&(this.num=NaN,this.unit=""),$tn(n)&&(this.num=Dtn(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Rf(NaN,""):new Rf(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Rf(NaN,""):new Rf(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Rf(NaN,""):new Rf(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Rf(NaN,""):new Rf(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return dy(this.num)}}_et=Rf;Ptn(Rf,"NaN",new _et(NaN,""));function Pet(e){if(e==null||e.includes(wP))return wP;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,o,i]=(n=bPe.exec(t))!==null&&n!==void 0?n:[],s=Rf.parse(r??""),l=Rf.parse(i??""),c=o==="*"?s.multiply(l):s.divide(l);if(c.isNaN())return wP;t=t.replace(bPe,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,p,h]=(u=wPe.exec(t))!==null&&u!==void 0?u:[],m=Rf.parse(d??""),g=Rf.parse(h??""),y=p==="+"?m.add(g):m.subtract(g);if(y.isNaN())return wP;t=t.replace(wPe,y.toString())}return t}var SPe=/\(([^()]*)\)/;function Ltn(e){for(var t=e,n;(n=SPe.exec(t))!=null;){var[,r]=n;t=t.replace(SPe,Pet(r))}return t}function Ftn(e){var t=e.replace(/\s+/g,"");return t=Ltn(t),t=Pet(t),t}function ztn(e){try{return Ftn(e)}catch{return wP}}function jZ(e){var t=ztn(e.slice(5,-1));return t===wP?"":t}var Btn=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Htn=["dx","dy","angle","className","breakAll"];function Fae(){return Fae=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:n,style:r}=e;try{var o=[];Ml(t)||(n?o=t.toString().split(""):o=t.toString().split(Aet));var i=o.map(l=>({word:l,width:lO(l,r).width})),s=n?0:lO(" ",r).width;return{wordsWithComputedWidth:i,spaceWidth:s}}catch{return null}};function Utn(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var ket=(e,t,n,r)=>e.reduce((o,i)=>{var{word:s,width:l}=i,c=o[o.length-1];if(c&&l!=null&&(t==null||r||c.width+l+ne.reduce((t,n)=>t.width>n.width?t:n),Wtn="…",NPe=(e,t,n,r,o,i,s,l)=>{var c=e.slice(0,t),u=Tet({breakAll:n,style:r,children:c+Wtn});if(!u)return[!1,[]];var d=ket(u.wordsWithComputedWidth,i,s,l),p=d.length>o||Met(d).width>Number(i);return[p,d]},Gtn=(e,t,n,r,o)=>{var{maxLines:i,children:s,style:l,breakAll:c}=e,u=Mr(i),d=String(s),p=ket(t,r,n,o);if(!u||o)return p;var h=p.length>i||Met(p).width>Number(r);if(!h)return p;for(var m=0,g=d.length-1,y=0,x;m<=g&&y<=d.length-1;){var v=Math.floor((m+g)/2),b=v-1,[w,S]=NPe(d,b,c,l,i,r,n,o),[C]=NPe(d,v,c,l,i,r,n,o);if(!w&&!C&&(m=v+1),w&&C&&(g=v-1),!w&&C){x=S;break}y++}return x||p},jPe=e=>{var t=Ml(e)?[]:e.toString().split(Aet);return[{words:t,width:void 0}]},qtn=e=>{var{width:t,scaleToFit:n,children:r,style:o,breakAll:i,maxLines:s}=e;if((t||n)&&!gL.isSsr){var l,c,u=Tet({breakAll:i,children:r,style:o});if(u){var{wordsWithComputedWidth:d,spaceWidth:p}=u;l=d,c=p}else return jPe(r);return Gtn({breakAll:i,children:r,maxLines:s,style:o},l,c,t,!!n)}return jPe(r)},Ret="#808080",Ktn={angle:0,breakAll:!1,capHeight:"0.71em",fill:Ret,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},EC=f.forwardRef((e,t)=>{var n=Hs(e,Ktn),{x:r,y:o,lineHeight:i,capHeight:s,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=n,p=CPe(n,Btn),h=f.useMemo(()=>qtn({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:c,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,c,p.style,p.width]),{dx:m,dy:g,angle:y,className:x,breakAll:v}=p,b=CPe(p,Htn);if(!M0(r)||!M0(o)||h.length===0)return null;var w=Number(r)+(Mr(m)?m:0),S=Number(o)+(Mr(g)?g:0);if(!ci(w)||!ci(S))return null;var C;switch(d){case"start":C=jZ("calc(".concat(s,")"));break;case"middle":C=jZ("calc(".concat((h.length-1)/2," * -").concat(i," + (").concat(s," / 2))"));break;default:C=jZ("calc(".concat(h.length-1," * -").concat(i,")"));break}var N=[],j=h[0];if(c&&j!=null){var I=j.width,{width:_}=p;N.push("scale(".concat(Mr(_)&&Mr(I)?_/I:1,")"))}return y&&N.push("rotate(".concat(y,", ").concat(w,", ").concat(S,")")),N.length&&(b.transform=N.join(" ")),f.createElement("text",Fae({},iu(b),{ref:t,x:w,y:S,className:be("recharts-text",x),textAnchor:u,fill:l.includes("url")?Ret:l}),h.map((T,P)=>{var E=T.words.join(v?"":" ");return f.createElement("tspan",{x:w,dy:P===0?C:i,key:"".concat(E,"-").concat(P)},E)}))});EC.displayName="Text";function EPe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Yy(e){for(var t=1;t{var{viewBox:t,position:n,offset:r=0,parentViewBox:o}=e,{x:i,y:s,height:l,upperWidth:c,lowerWidth:u}=_ge(t),d=i,p=i+(c-u)/2,h=(d+p)/2,m=(c+u)/2,g=d+c/2,y=l>=0?1:-1,x=y*r,v=y>0?"end":"start",b=y>0?"start":"end",w=c>=0?1:-1,S=w*r,C=w>0?"end":"start",N=w>0?"start":"end",j=o;if(n==="top"){var I={x:d+c/2,y:s-x,horizontalAnchor:"middle",verticalAnchor:v};return j&&(I.height=Math.max(s-j.y,0),I.width=c),I}if(n==="bottom"){var _={x:p+u/2,y:s+l+x,horizontalAnchor:"middle",verticalAnchor:b};return j&&(_.height=Math.max(j.y+j.height-(s+l),0),_.width=u),_}if(n==="left"){var T={x:h-S,y:s+l/2,horizontalAnchor:C,verticalAnchor:"middle"};return j&&(T.width=Math.max(T.x-j.x,0),T.height=l),T}if(n==="right"){var P={x:h+m+S,y:s+l/2,horizontalAnchor:N,verticalAnchor:"middle"};return j&&(P.width=Math.max(j.x+j.width-P.x,0),P.height=l),P}var E=j?{width:m,height:l}:{};return n==="insideLeft"?Yy({x:h+S,y:s+l/2,horizontalAnchor:N,verticalAnchor:"middle"},E):n==="insideRight"?Yy({x:h+m-S,y:s+l/2,horizontalAnchor:C,verticalAnchor:"middle"},E):n==="insideTop"?Yy({x:d+c/2,y:s+x,horizontalAnchor:"middle",verticalAnchor:b},E):n==="insideBottom"?Yy({x:p+u/2,y:s+l-x,horizontalAnchor:"middle",verticalAnchor:v},E):n==="insideTopLeft"?Yy({x:d+S,y:s+x,horizontalAnchor:N,verticalAnchor:b},E):n==="insideTopRight"?Yy({x:d+c-S,y:s+x,horizontalAnchor:C,verticalAnchor:b},E):n==="insideBottomLeft"?Yy({x:p+S,y:s+l-x,horizontalAnchor:N,verticalAnchor:v},E):n==="insideBottomRight"?Yy({x:p+u-S,y:s+l-x,horizontalAnchor:C,verticalAnchor:v},E):n&&typeof n=="object"&&(Mr(n.x)||rI(n.x))&&(Mr(n.y)||rI(n.y))?Yy({x:i+Ap(n.x,m),y:s+Ap(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},E):Yy({x:g,y:s+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},E)},Ztn=["labelRef"],enn=["content"];function IPe(e,t){if(e==null)return{};var n,r,o=tnn(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r{var{x:t,y:n,upperWidth:r,lowerWidth:o,width:i,height:s,children:l}=e,c=f.useMemo(()=>({x:t,y:n,upperWidth:r,lowerWidth:o,width:i,height:s}),[t,n,r,o,i,s]);return f.createElement(Oet.Provider,{value:c},l)},Det=()=>{var e=f.useContext(Oet),t=pL();return e||(t?_ge(t):void 0)},Let=f.createContext(null),inn=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:s,clockWise:l,children:c}=e,u=f.useMemo(()=>({cx:t,cy:n,innerRadius:r,outerRadius:o,startAngle:i,endAngle:s,clockWise:l}),[t,n,r,o,i,s,l]);return f.createElement(Let.Provider,{value:u},c)},Fet=()=>{var e=f.useContext(Let),t=gr(Sk);return e||t},ann=e=>{var{value:t,formatter:n}=e,r=Ml(e.children)?t:e.children;return typeof n=="function"?n(r):r},z0e=e=>e!=null&&typeof e=="function",snn=(e,t)=>{var n=df(t-e),r=Math.min(Math.abs(t-e),360);return n*r},lnn=(e,t,n,r,o)=>{var{offset:i,className:s}=e,{cx:l,cy:c,innerRadius:u,outerRadius:d,startAngle:p,endAngle:h,clockWise:m}=o,g=(u+d)/2,y=snn(p,h),x=y>=0?1:-1,v,b;switch(t){case"insideStart":v=p+x*i,b=m;break;case"insideEnd":v=h-x*i,b=!m;break;case"end":v=h+x*i,b=m;break;default:throw new Error("Unsupported position ".concat(t))}b=y<=0?b:!b;var w=cs(l,c,g,v),S=cs(l,c,g,v+(b?1:-1)*359),C="M".concat(w.x,",").concat(w.y,` A`).concat(g,",").concat(g,",0,1,").concat(b?0:1,`, `).concat(S.x,",").concat(S.y),N=Ml(e.id)?N3("recharts-radial-line-"):e.id;return f.createElement("text",A1({},r,{dominantBaseline:"central",className:be("recharts-radial-bar-label",s)}),f.createElement("defs",null,f.createElement("path",{id:N,d:C})),f.createElement("textPath",{xlinkHref:"#".concat(N)},n))},cnn=(e,t,n)=>{var{cx:r,cy:o,innerRadius:i,outerRadius:s,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(n==="outside"){var{x:d,y:p}=cs(r,o,s+t,u);return{x:d,y:p,textAnchor:d>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:o,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:o,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:o,textAnchor:"middle",verticalAnchor:"end"};var h=(i+s)/2,{x:m,y:g}=cs(r,o,h,u);return{x:m,y:g,textAnchor:"middle",verticalAnchor:"middle"}},Kz=e=>e!=null&&"cx"in e&&Mr(e.cx),unn={angle:0,offset:5,zIndex:Pl.label,position:"middle",textBreakAll:!1};function dnn(e){if(!Kz(e))return e;var{cx:t,cy:n,outerRadius:r}=e,o=r*2;return{x:t-r,y:n-r,width:o,upperWidth:o,lowerWidth:o,height:o}}function t2(e){var t=Hs(e,unn),{viewBox:n,parentViewBox:r,position:o,value:i,children:s,content:l,className:c="",textBreakAll:u,labelRef:d}=t,p=Fet(),h=Det(),m=o==="center"?h:p??h,g,y,x;n==null?g=m:Kz(n)?g=n:g=_ge(n);var v=dnn(g);if(!g||Ml(i)&&Ml(s)&&!f.isValidElement(l)&&typeof l!="function")return null;var b=gR(gR({},t),{},{viewBox:g});if(f.isValidElement(l)){var{labelRef:w}=b,S=IPe(b,Ztn);return f.cloneElement(l,S)}if(typeof l=="function"){var{content:C}=b,N=IPe(b,enn);if(y=f.createElement(l,N),f.isValidElement(y))return y}else y=ann(t);var j=iu(t);if(Kz(g)){if(o==="insideStart"||o==="insideEnd"||o==="end")return lnn(t,o,y,j,g);x=cnn(g,t.offset,t.position)}else{if(!v)return null;var I=Jtn({viewBox:v,position:o,offset:t.offset,parentViewBox:Kz(r)?void 0:r});x=gR(gR({x:I.x,y:I.y,textAnchor:I.horizontalAnchor,verticalAnchor:I.verticalAnchor},I.width!==void 0?{width:I.width}:{}),I.height!==void 0?{height:I.height}:{})}return f.createElement(id,{zIndex:t.zIndex},f.createElement(EC,A1({ref:d,className:be("recharts-label",c)},j,x,{textAnchor:Utn(j.textAnchor)?j.textAnchor:x.textAnchor,breakAll:u}),y))}t2.displayName="Label";var zet=(e,t,n)=>{if(!e)return null;var r={viewBox:t,labelRef:n};return e===!0?f.createElement(t2,A1({key:"label-implicit"},r)):M0(e)?f.createElement(t2,A1({key:"label-implicit",value:e},r)):f.isValidElement(e)?e.type===t2?f.cloneElement(e,gR({key:"label-implicit"},r)):f.createElement(t2,A1({key:"label-implicit",content:e},r)):z0e(e)?f.createElement(t2,A1({key:"label-implicit",content:e},r)):e&&typeof e=="object"?f.createElement(t2,A1({},e,{key:"label-implicit"},r)):null};function Bet(e){var{label:t,labelRef:n}=e,r=Det();return zet(t,r,n)||null}function fnn(e){var{label:t}=e,n=Fet();return zet(t,n)||null}var EZ={},IZ={},PPe;function pnn(){return PPe||(PPe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(IZ)),IZ}var _Z={},APe;function hnn(){return APe||(APe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(_Z)),_Z}var TPe;function mnn(){return TPe||(TPe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pnn(),n=hnn(),r=hge();function o(i){if(r.isArrayLike(i))return t.last(n.toArray(i))}e.last=o})(EZ)),EZ}var PZ,kPe;function gnn(){return kPe||(kPe=1,PZ=mnn().last),PZ}var xnn=gnn();const Het=Ba(xnn);var ynn=["valueAccessor"],vnn=["dataKey","clockWise","id","textBreakAll","zIndex"];function RV(){return RV=Object.assign?Object.assign.bind():function(e){for(var t=1;tArray.isArray(e.value)?Het(e.value):e.value,Vet=f.createContext(void 0),Gq=Vet.Provider,Uet=f.createContext(void 0),Snn=Uet.Provider;function Cnn(){return f.useContext(Vet)}function Nnn(){return f.useContext(Uet)}function Yz(e){var{valueAccessor:t=wnn}=e,n=MPe(e,ynn),{dataKey:r,clockWise:o,id:i,textBreakAll:s,zIndex:l}=n,c=MPe(n,vnn),u=Cnn(),d=Nnn(),p=u||d;return!p||!p.length?null:f.createElement(id,{zIndex:l??Pl.label},f.createElement(Ta,{className:"recharts-label-list"},p.map((h,m)=>{var g,y=Ml(r)?t(h,m):La(h.payload,r),x=Ml(i)?{}:{id:"".concat(i,"-").concat(m)};return f.createElement(t2,RV({key:"label-".concat(m)},iu(h),c,x,{fill:(g=n.fill)!==null&&g!==void 0?g:h.fill,parentViewBox:h.parentViewBox,value:y,textBreakAll:s,viewBox:h.viewBox,index:m,zIndex:0}))})))}Yz.displayName="LabelList";function kL(e){var{label:t}=e;return t?t===!0?f.createElement(Yz,{key:"labelList-implicit"}):f.isValidElement(t)||z0e(t)?f.createElement(Yz,{key:"labelList-implicit",content:t}):typeof t=="object"?f.createElement(Yz,RV({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}var jnn=["points","className","baseLinePoints","connectNulls"],RPe;function SP(){return SP=Object.assign?Object.assign.bind():function(e){for(var t=1;te!=null&&e.x===+e.x&&e.y===+e.y,Pnn=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];t.forEach(s=>{var l=n[n.length-1];OPe(s)?l&&l.push(s):l&&l.length>0&&n.push([])});var r=t[0],o=n[n.length-1];OPe(r)&&o&&o.push(r);var i=n[n.length-1];return i&&i.length<=0&&(n=n.slice(0,-1)),n},cO=(e,t)=>{var n=Pnn(e);t&&(n=[n.reduce((o,i)=>[...o,...i],[])]);var r=n.map(o=>o.reduce((i,s,l)=>Ac(RPe||(RPe=_nn(["","","",",",""])),i,l===0?"M":"L",s.x,s.y),"")).join("");return n.length===1?"".concat(r,"Z"):r},Ann=(e,t,n)=>{var r=cO(e,n);return"".concat(r.slice(-1)==="Z"?r.slice(0,-1):r,"L").concat(cO(Array.from(t).reverse(),n).slice(1))},Wet=e=>{var{points:t,className:n,baseLinePoints:r,connectNulls:o}=e,i=Enn(e,jnn);if(!t||!t.length)return null;var s=be("recharts-polygon",n);if(r&&r.length){var l=i.stroke&&i.stroke!=="none",c=Ann(t,r,o);return f.createElement("g",{className:s},f.createElement("path",SP({},iu(i),{fill:c.slice(-1)==="Z"?i.fill:"none",stroke:"none",d:c})),l?f.createElement("path",SP({},iu(i),{fill:"none",d:cO(t,o)})):null,l?f.createElement("path",SP({},iu(i),{fill:"none",d:cO(r,o)})):null)}var u=cO(t,o);return f.createElement("path",SP({},iu(i),{fill:u.slice(-1)==="Z"?i.fill:"none",className:s,d:u}))};function zae(){return zae=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{cx:t,cy:n,r,className:o}=e,i=be("recharts-dot",o);return Mr(t)&&Mr(n)&&Mr(r)?f.createElement("circle",zae({},dl(e),pge(e),{className:i,cx:t,cy:n,r})):null},H0e=e=>e.graphicalItems.polarItems,Tnn=on([$l,NL],d0e),qq=on([H0e,xu,Tnn],f0e),knn=on([qq],p0e),Kq=on([knn,wL],h0e),Get=on([Kq,xu,qq],g0e);on([Kq,xu,qq],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(o=>{var i,s=La(r,(i=t.dataKey)!==null&&i!==void 0?i:o.dataKey);return{value:s,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:La(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var $Pe=()=>{},Mnn=on([Kq,xu,qq,Hq,$l],b0e),Rnn=on([xu,y0e,v0e,$Pe,Mnn,$Pe,Ui,$l],w0e),qet=on([xu,Ui,Kq,Get,SL,$l,Rnn],S0e),Ket=on([qet,o5,Pb],N0e),Onn=on([xu,qet,Ket,$l],E0e),$nn=on([Pb,Onn],CZe),V0e=(e,t,n)=>{switch(t){case"angleAxis":return wk(e,n);case"radiusAxis":return CL(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},U0e=(e,t,n)=>{switch(t){case"angleAxis":return sJt(e,n);case"radiusAxis":return lJt(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},Pk=on([V0e,Pb,$nn,U0e],Vq),Yet=on([Ui,Get,o5,$l],I0e),Ak=on([Ui,V0e,Pb,Pk,Ket,U0e,PL,Yet,$l],GZe),Dnn=on([Ak],e=>{if(e){var t=new Map;return e.forEach(n=>{var r=(n.coordinate+360)%360;t.has(r)||t.set(r,n)}),Array.from(t.values())}});on([Ui,V0e,Pk,U0e,PL,Yet,$l],KZe);var Lnn=(e,t)=>Ak(e,"angleAxis",t,!1),Fnn=on([Lnn],e=>{if(e)return e.map(t=>t.coordinate)}),znn=(e,t)=>Ak(e,"radiusAxis",t,!1),Bnn=on([znn],e=>{if(e)return e.map(t=>t.coordinate)}),Hnn=["gridType","radialLines","angleAxisId","radiusAxisId","cx","cy","innerRadius","outerRadius","polarAngles","polarRadius","zIndex"];function Vnn(e,t){if(e==null)return{};var n,r,o=Unn(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r{var o="";return r.forEach((i,s)=>{var l=cs(t,n,e,i);s?o+="L ".concat(l.x,",").concat(l.y):o+="M ".concat(l.x,",").concat(l.y)}),o+="Z",o},Ynn=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:o,polarAngles:i,radialLines:s}=e;if(!i||!i.length||!s)return null;var l=Yq({stroke:"#ccc"},dl(e));return f.createElement("g",{className:"recharts-polar-grid-angle"},i.map(c=>{var u=cs(t,n,r,c),d=cs(t,n,o,c);return f.createElement("line",qx({key:"line-".concat(c)},l,{x1:u.x,y1:u.y,x2:d.x,y2:d.y}))}))},LPe=e=>{var{cx:t,cy:n,radius:r}=e,o=Yq({stroke:"#ccc",fill:"none"},dl(e));return f.createElement("circle",qx({},o,{className:be("recharts-polar-grid-concentric-circle",e.className),cx:t,cy:n,r}))},FPe=e=>{var{radius:t}=e,n=Yq({stroke:"#ccc",fill:"none"},dl(e));return f.createElement("path",qx({},n,{className:be("recharts-polar-grid-concentric-polygon",e.className),d:Knn(t,e.cx,e.cy,e.polarAngles)}))},Xnn=e=>{var{polarRadius:t,gridType:n}=e;if(!t||!t.length)return null;var r=Math.max(...t),o=e.fill&&e.fill!=="none";return f.createElement("g",{className:"recharts-polar-grid-concentric"},o&&n==="circle"&&f.createElement(LPe,qx({},e,{radius:r})),o&&n!=="circle"&&f.createElement(FPe,qx({},e,{radius:r})),t.map((i,s)=>{var l=s;return n==="circle"?f.createElement(LPe,qx({key:l},e,{fill:"none",radius:i})):f.createElement(FPe,qx({key:l},e,{fill:"none",radius:i}))}))},Qnn={angleAxisId:0,radiusAxisId:0,gridType:"polygon",radialLines:!0,zIndex:Pl.grid},Xet=e=>{var t,n,r,o,i,s,l,c,u=Hs(e,Qnn),{gridType:d,radialLines:p,angleAxisId:h,radiusAxisId:m,cx:g,cy:y,innerRadius:x,outerRadius:v,polarAngles:b,polarRadius:w,zIndex:S}=u,C=Vnn(u,Hnn),N=gr(Sk),j=gr(M=>Fnn(M,h)),I=gr(M=>Bnn(M,m)),_=Array.isArray(b)?b:j,T=Array.isArray(w)?w:I;if(_==null||T==null)return null;var P=Yq({cx:(t=(n=N==null?void 0:N.cx)!==null&&n!==void 0?n:g)!==null&&t!==void 0?t:0,cy:(r=(o=N==null?void 0:N.cy)!==null&&o!==void 0?o:y)!==null&&r!==void 0?r:0,innerRadius:(i=(s=N==null?void 0:N.innerRadius)!==null&&s!==void 0?s:x)!==null&&i!==void 0?i:0,outerRadius:(l=(c=N==null?void 0:N.outerRadius)!==null&&c!==void 0?c:v)!==null&&l!==void 0?l:0,polarAngles:_,polarRadius:T,zIndex:S},C),{outerRadius:E}=P;return E<=0?null:f.createElement(id,{zIndex:P.zIndex},f.createElement("g",{className:"recharts-polar-grid"},f.createElement(Xnn,qx({gridType:d,radialLines:p},P,{polarAngles:_,polarRadius:T})),f.createElement(Ynn,qx({gridType:d,radialLines:p},P,{polarAngles:_,polarRadius:T}))))};Xet.displayName="PolarGrid";var AZ={},TZ={},zPe;function Jnn(){return zPe||(zPe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){if(n.length===0)return;let o=n[0],i=r(o,0,n);for(let s=1;si&&(i=c,o=l)}return o}e.maxBy=t})(TZ)),TZ}var BPe;function Znn(){return BPe||(BPe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Jnn(),n=uq(),r=gge();function o(i,s){if(i!=null)return t.maxBy(Array.from(i),r.iteratee(s??n.identity))}e.maxBy=o})(AZ)),AZ}var kZ,HPe;function ern(){return HPe||(HPe=1,kZ=Znn().maxBy),kZ}var trn=ern();const nrn=Ba(trn);var MZ={},RZ={},VPe;function rrn(){return VPe||(VPe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){if(n.length===0)return;let o=n[0],i=r(o,0,n);for(let s=1;s{var{type:o}=e,i=W0e(e,hrn),s=bk(n,"radiusAxis",o);if(s!=null)return Kx(Kx({},i),{},{type:s})},[e,n]);return f.useEffect(()=>r==null?Ey:(t(crn(r)),()=>{t(urn(r))}),[t,r]),null}var Crn=(e,t,n,r)=>{var{coordinate:o}=e;return cs(n,r,o,t)},Nrn=e=>{var t;switch(e){case"left":t="end";break;case"right":t="start";break;default:t="middle";break}return t},jrn=(e,t,n,r)=>{var o=nrn(r,s=>s.coordinate||0),i=srn(r,s=>s.coordinate||0);return{cx:t,cy:n,startAngle:e,endAngle:e,innerRadius:(i==null?void 0:i.coordinate)||0,outerRadius:(o==null?void 0:o.coordinate)||0,clockWise:!1}},Ern=(e,t)=>{var{cx:n,cy:r,angle:o,axisLine:i}=e,s=W0e(e,mrn),l=t.reduce((p,h)=>[Math.min(p[0],h.coordinate),Math.max(p[1],h.coordinate)],[1/0,-1/0]),c=cs(n,r,l[0],o),u=cs(n,r,l[1],o),d=Kx(Kx(Kx({},dl(s)),{},{fill:"none"},dl(i)),{},{x1:c.x,y1:c.y,x2:u.x,y2:u.y});return f.createElement("line",$3({className:"recharts-polar-radius-axis-line"},d))},Irn=(e,t,n)=>{var r;return f.isValidElement(e)?r=f.cloneElement(e,t):typeof e=="function"?r=e(t):r=f.createElement(EC,$3({},t,{className:"recharts-polar-radius-axis-tick-value"}),n),r},_rn=(e,t)=>{var{angle:n,tickFormatter:r,stroke:o,tick:i}=e,s=W0e(e,grn),l=Nrn(e.orientation),c=dl(s),u=dw(i),d=t.map((p,h)=>{var m=Crn(p,e.angle,e.cx,e.cy),g=Kx(Kx(Kx(Kx({textAnchor:l,transform:"rotate(".concat(90-n,", ").concat(m.x,", ").concat(m.y,")")},c),{},{stroke:"none",fill:o},u),{},{index:h},m),{},{payload:p});return f.createElement(Ta,$3({className:be("recharts-polar-radius-axis-tick",Xq(i)),key:"tick-".concat(p.coordinate)},ZI(e,p,h)),Irn(i,g,r?r(p.value,h):p.value))});return f.createElement(Ta,{className:"recharts-polar-radius-axis-ticks"},d)},Prn=e=>{var{radiusAxisId:t}=e,n=gr(Sk),r=gr(c=>Pk(c,"radiusAxis",t)),o=gr(c=>Ak(c,"radiusAxis",t,!1));if(n==null||!o||!o.length||r==null)return null;var i=Kx(Kx({},e),{},{scale:r},n),{tick:s,axisLine:l}=i;return f.createElement(id,{zIndex:i.zIndex},f.createElement(Ta,{className:be("recharts-polar-radius-axis",wrn,i.className)},l&&Ern(i,o),s&&_rn(i,o),f.createElement(inn,jrn(i.angle,i.cx,i.cy,o),f.createElement(fnn,{label:i.label}),i.children)))};function Jet(e){var t=Hs(e,Nx);return f.createElement(f.Fragment,null,f.createElement(Srn,{domain:t.domain,id:t.radiusAxisId,scale:t.scale,type:t.type,dataKey:t.dataKey,unit:void 0,name:t.name,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDataOverflow:t.allowDataOverflow,reversed:t.reversed,includeHidden:t.includeHidden,allowDecimals:t.allowDecimals,ticks:t.ticks,tickCount:t.tickCount,tick:t.tick}),f.createElement(Prn,t))}Jet.displayName="PolarRadiusAxis";var Arn=["children","type"];function cI(){return cI=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:s,type:l}=e,c=Rrn(e,Arn),u=bk(n,"angleAxis",l);if(u!=null)return o0(o0({},c),{},{type:u})},[e,n]),o=gr(s=>wk(s,r==null?void 0:r.id)),i=r===o;return f.useEffect(()=>r==null?Ey:(t(drn(r)),()=>{t(frn(r))}),[t,r]),i?e.children:null}var Frn=(e,t)=>{var{cx:n,cy:r,radius:o,orientation:i,tickSize:s}=t,l=s||8,c=cs(n,r,o,e.coordinate),u=cs(n,r,o+(i==="inner"?-1:1)*l,e.coordinate);return{x1:c.x,y1:c.y,x2:u.x,y2:u.y}},zrn=(e,t)=>{var n=Math.cos(xV(-e.coordinate));return n>KPe?t==="outer"?"start":"end":n<-KPe?t==="outer"?"end":"start":"middle"},Brn=e=>{var t=Math.cos(xV(-e.coordinate)),n=Math.sin(xV(-e.coordinate));return Math.abs(t)<=$rn?n>0?"start":"end":"middle"},Hrn=e=>{var{cx:t,cy:n,radius:r,axisLineType:o,axisLine:i,ticks:s}=e;if(!i)return null;var l=o0(o0({},dl(e)),{},{fill:"none"},dl(i));if(o==="circle")return f.createElement(B0e,cI({className:"recharts-polar-angle-axis-line"},l,{cx:t,cy:n,r}));var c=s.map(u=>cs(t,n,r,u.coordinate));return f.createElement(Wet,cI({className:"recharts-polar-angle-axis-line"},l,{points:c}))},Vrn=e=>{var{tick:t,tickProps:n,value:r}=e;return t?f.isValidElement(t)?f.cloneElement(t,n):typeof t=="function"?t(n):f.createElement(EC,cI({},n,{className:"recharts-polar-angle-axis-tick-value"}),r):null},Urn=e=>{var{tick:t,tickLine:n,tickFormatter:r,stroke:o,ticks:i}=e,s=dl(e),l=dw(t),c=o0(o0({},s),{},{fill:"none"},dl(n)),u=i.map((d,p)=>{var h=Frn(d,e),m=zrn(d,e.orientation),g=Brn(d),y=o0(o0(o0({},s),{},{textAnchor:m,verticalAnchor:g,stroke:"none",fill:o},l),{},{index:p,payload:d,x:h.x2,y:h.y2});return f.createElement(Ta,cI({className:be("recharts-polar-angle-axis-tick",Xq(t)),key:"tick-".concat(d.coordinate)},ZI(e,d,p)),n&&f.createElement("line",cI({className:"recharts-polar-angle-axis-tick-line"},c,h)),f.createElement(Vrn,{tick:t,tickProps:y,value:r?r(d.value,p):d.value}))});return f.createElement(Ta,{className:"recharts-polar-angle-axis-ticks"},u)},Wrn=e=>{var{angleAxisId:t}=e,n=gr(Sk),r=gr(l=>Pk(l,"angleAxis",t)),o=Vu(),i=gr(l=>Dnn(l,"angleAxis",t,o));if(n==null||!i||!i.length||r==null)return null;var s=o0(o0(o0({},e),{},{scale:r},n),{},{radius:n.outerRadius,ticks:i});return f.createElement(id,{zIndex:s.zIndex},f.createElement(Ta,{className:be("recharts-polar-angle-axis",Drn,s.className)},f.createElement(Hrn,s),f.createElement(Urn,s)))};function Zet(e){var t=Hs(e,VS);return f.createElement(Lrn,{id:t.angleAxisId,scale:t.scale,type:t.type,dataKey:t.dataKey,unit:void 0,name:t.name,allowDuplicatedCategory:!1,allowDataOverflow:!1,reversed:t.reversed,includeHidden:!1,allowDecimals:t.allowDecimals,tickCount:t.tickCount,ticks:t.ticks,tick:t.tick,domain:t.domain},f.createElement(Wrn,t))}Zet.displayName="PolarAngleAxis";function YPe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function XPe(e){for(var t=1;tt,G0e=on([H0e,Yrn],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),Xrn=[],q0e=(e,t,n)=>(n==null?void 0:n.length)===0?Xrn:n,ett=on([wL,G0e,q0e],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var o;if((t==null?void 0:t.data)!=null&&t.data.length>0?o=t.data:o=r,(!o||!o.length)&&n!=null&&(o=n.map(i=>XPe(XPe({},t.presentationProps),i.props))),o!=null)return o}}),Qrn=on([ett,G0e,q0e],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,o)=>{var i,s=La(r,t.nameKey,t.name),l;return n!=null&&(i=n[o])!==null&&i!==void 0&&(i=i.props)!==null&&i!==void 0&&i.fill?l=n[o].props.fill:typeof r=="object"&&r!=null&&"fill"in r?l=r.fill:l=t.fill,{value:Eb(s,t.dataKey),color:l,payload:r,type:t.legendType}})}),Jrn=on([ett,G0e,q0e,Dd],(e,t,n,r)=>{if(!(t==null||e==null))return Kon({offset:r,pieSettings:t,displayedData:e,cells:n})}),QPe=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",JPe=null,$Z=null,ttt=e=>{if(e===JPe&&Array.isArray($Z))return $Z;var t=[];return f.Children.forEach(e,n=>{Ml(n)||(Cme.isFragment(n)?t=t.concat(ttt(n.props.children)):t.push(n))}),$Z=t,JPe=e,t};function K0e(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(o=>QPe(o)):r=[QPe(t)],ttt(e).forEach(o=>{var i=nI(o,"type.displayName")||nI(o,"type.name");i&&r.indexOf(i)!==-1&&n.push(o)}),n}var Y0e=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,DZ={},ZPe;function Zrn(){return ZPe||(ZPe=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var o;if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const i=n[Symbol.toStringTag];return i==null||!((o=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&o.writable)?!1:n.toString()===`[object ${i}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(DZ)),DZ}var LZ,eAe;function eon(){return eAe||(eAe=1,LZ=Zrn().isPlainObject),LZ}var ton=eon();const non=Ba(ton);var tAe,nAe,rAe,oAe,iAe;function aAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function sAe(e){for(var t=1;t{var i=n-r,s;return s=Ac(tAe||(tAe=oM(["M ",",",""])),e,t),s+=Ac(nAe||(nAe=oM(["L ",",",""])),e+n,t),s+=Ac(rAe||(rAe=oM(["L ",",",""])),e+n-i/2,t+o),s+=Ac(oAe||(oAe=oM(["L ",",",""])),e+n-i/2-r,t+o),s+=Ac(iAe||(iAe=oM(["L ",","," Z"])),e,t),s},aon={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},son=e=>{var t=Hs(e,aon),{x:n,y:r,upperWidth:o,lowerWidth:i,height:s,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:p}=t,h=f.useRef(null),[m,g]=f.useState(-1),y=f.useRef(o),x=f.useRef(i),v=f.useRef(s),b=f.useRef(n),w=f.useRef(r),S=t5(e,"trapezoid-");if(f.useEffect(()=>{if(h.current&&h.current.getTotalLength)try{var R=h.current.getTotalLength();R&&g(R)}catch{}},[]),n!==+n||r!==+r||o!==+o||i!==+i||s!==+s||o===0&&i===0||s===0)return null;var C=be("recharts-trapezoid",l);if(!p)return f.createElement("g",null,f.createElement("path",OV({},iu(t),{className:C,d:lAe(n,r,o,i,s)})));var N=y.current,j=x.current,I=v.current,_=b.current,T=w.current,P="0px ".concat(m===-1?1:m,"px"),E="".concat(m,"px 0px"),M=uJe(["strokeDasharray"],u,c);return f.createElement(e5,{animationId:S,key:S,canBegin:m>0,duration:u,easing:c,isActive:p,begin:d},R=>{var $=ja(N,o,R),D=ja(j,i,R),z=ja(I,s,R),V=ja(_,n,R),B=ja(T,r,R);h.current&&(y.current=$,x.current=D,v.current=z,b.current=V,w.current=B);var G=R>0?{transition:M,strokeDasharray:E}:{strokeDasharray:P};return f.createElement("path",OV({},iu(t),{className:C,d:lAe(V,B,$,D,z),ref:h,style:sAe(sAe({},G),t.style)}))})},lon=["option","shapeType","activeClassName"];function con(e,t){if(e==null)return{};var n,r,o=uon(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r{var r=fs();return(o,i)=>s=>{e==null||e(o,i,s),r(eet({activeIndex:String(i),activeDataKey:t,activeCoordinate:o.tooltipPosition,activeGraphicalItemId:n}))}},J0e=e=>{var t=fs();return(n,r)=>o=>{e==null||e(n,r,o),t(hZt())}},Z0e=(e,t,n)=>{var r=fs();return(o,i)=>s=>{e==null||e(o,i,s),r(mZt({activeIndex:String(i),activeDataKey:t,activeCoordinate:o.tooltipPosition,activeGraphicalItemId:n}))}};function ML(e){var{tooltipEntrySettings:t}=e,n=fs(),r=Vu(),o=f.useRef(null);return f.useLayoutEffect(()=>{r||(o.current===null?n(uZt(t)):o.current!==t&&n(dZt({prev:o.current,next:t})),o.current=t)},[t,n,r]),f.useLayoutEffect(()=>()=>{o.current&&(n(fZt(o.current)),o.current=null)},[n]),null}function exe(e){var{legendPayload:t}=e,n=fs(),r=Vu(),o=f.useRef(null);return f.useLayoutEffect(()=>{r||(o.current===null?n(aJe(t)):o.current!==t&&n(sJe({prev:o.current,next:t})),o.current=t)},[n,r,t]),f.useLayoutEffect(()=>()=>{o.current&&(n(lJe(o.current)),o.current=null)},[n]),null}function ntt(e){var{legendPayload:t}=e,n=fs(),r=gr(Ui),o=f.useRef(null);return f.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(o.current===null?n(aJe(t)):o.current!==t&&n(sJe({prev:o.current,next:t})),o.current=t)},[n,r,t]),f.useLayoutEffect(()=>()=>{o.current&&(n(lJe(o.current)),o.current=null)},[n]),null}var FZ,xon=()=>{var[e]=f.useState(()=>N3("uid-"));return e},yon=(FZ=sw.useId)!==null&&FZ!==void 0?FZ:xon;function von(e,t){var n=yon();return t||(e?"".concat(e,"-").concat(n):n)}var bon=f.createContext(void 0),RL=e=>{var{id:t,type:n,children:r}=e,o=von("recharts-".concat(n),t);return f.createElement(bon.Provider,{value:o},r(o))},won={cartesianItems:[],polarItems:[]},rtt=bm({name:"graphicalItems",initialState:won,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:fc()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,o=ey(e).cartesianItems.indexOf(n);o>-1&&(e.cartesianItems[o]=r)},prepare:fc()},removeCartesianGraphicalItem:{reducer(e,t){var n=ey(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:fc()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:fc()},removePolarGraphicalItem:{reducer(e,t){var n=ey(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:fc()}}}),{addCartesianGraphicalItem:Son,replaceCartesianGraphicalItem:Con,removeCartesianGraphicalItem:Non,addPolarGraphicalItem:jon,removePolarGraphicalItem:Eon}=rtt.actions,Ion=rtt.reducer,_on=e=>{var t=fs(),n=f.useRef(null);return f.useLayoutEffect(()=>{n.current===null?t(Son(e)):n.current!==e&&t(Con({prev:n.current,next:e})),n.current=e},[t,e]),f.useLayoutEffect(()=>()=>{n.current&&(t(Non(n.current)),n.current=null)},[t]),null},txe=f.memo(_on);function ott(e){var t=fs();return f.useLayoutEffect(()=>(t(jon(e)),()=>{t(Eon(e))}),[t,e]),null}var Pon=["key"],Aon=["onMouseEnter","onClick","onMouseLeave"],Ton=["id"],kon=["id"];function dAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ru(e){for(var t=1;tK0e(e.children,Eh),[e.children]),n=gr(r=>Qrn(r,e.id,t));return n==null?null:f.createElement(ntt,{legendPayload:n})}var Lon=f.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:o,strokeWidth:i,fill:s,name:l,hide:c,tooltipType:u,id:d}=e,p={dataDefinedOnItem:r.map(h=>h.tooltipPayload),getPosition:h=>{var m;return(m=r[Number(h)])===null||m===void 0?void 0:m.tooltipPosition},settings:{stroke:o,strokeWidth:i,fill:s,dataKey:t,nameKey:n,name:Eb(l,t),hide:c,type:u,color:s,unit:"",graphicalItemId:d}};return f.createElement(ML,{tooltipEntrySettings:p})}),Fon=(e,t)=>e>t?"start":eAp(typeof t=="function"?t(e):t,n,n*.8),Bon=(e,t,n)=>{var{top:r,left:o,width:i,height:s}=t,l=mJe(i,s),c=o+Ap(e.cx,i,i/2),u=r+Ap(e.cy,s,s/2),d=Ap(e.innerRadius,l,0),p=zon(n,e.outerRadius,l),h=e.maxRadius||Math.sqrt(i*i+s*s)/2;return{cx:c,cy:u,innerRadius:d,outerRadius:p,maxRadius:h}},Hon=(e,t)=>{var n=df(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Von=(e,t)=>{if(f.isValidElement(e))return f.cloneElement(e,t);if(typeof e=="function")return e(t);var n=be("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,o=Qq(t,Pon);return f.createElement(lA,IC({},o,{type:"linear",className:n}))},Uon=(e,t,n)=>{if(f.isValidElement(e))return f.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),f.isValidElement(r)))return r;var o=be("recharts-pie-label-text",Xq(e));return f.createElement(EC,IC({},t,{alignmentBaseline:"middle",className:o}),r)};function Won(e){var{sectors:t,props:n,showLabels:r}=e,{label:o,labelLine:i,dataKey:s}=n;if(!r||!o||!t)return null;var l=dl(n),c=dw(o),u=dw(i),d=typeof o=="object"&&"offsetRadius"in o&&typeof o.offsetRadius=="number"&&o.offsetRadius||20,p=t.map((h,m)=>{var g=(h.startAngle+h.endAngle)/2,y=cs(h.cx,h.cy,h.outerRadius+d,g),x=ru(ru(ru(ru({},l),h),{},{stroke:"none"},c),{},{index:m,textAnchor:Fon(y.x,h.cx)},y),v=ru(ru(ru(ru({},l),h),{},{fill:"none",stroke:h.fill},u),{},{index:m,points:[cs(h.cx,h.cy,h.outerRadius,g),y],key:"line"});return f.createElement(id,{zIndex:Pl.label,key:"label-".concat(h.startAngle,"-").concat(h.endAngle,"-").concat(h.midAngle,"-").concat(m)},f.createElement(Ta,null,i&&Von(i,v),Uon(o,x,La(h,s))))});return f.createElement(Ta,{className:"recharts-pie-labels"},p)}function Gon(e){var{sectors:t,props:n,showLabels:r}=e,{label:o}=n;return typeof o=="object"&&o!=null&&"position"in o?f.createElement(kL,{label:o}):f.createElement(Won,{sectors:t,props:n,showLabels:r})}function qon(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:o,shape:i,id:s}=e,l=gr(jC),c=gr(O0e),u=gr(een),{onMouseEnter:d,onClick:p,onMouseLeave:h}=o,m=Qq(o,Aon),g=Q0e(d,o.dataKey,s),y=J0e(h),x=Z0e(p,o.dataKey,s);return t==null||t.length===0?null:f.createElement(f.Fragment,null,t.map((v,b)=>{if((v==null?void 0:v.startAngle)===0&&(v==null?void 0:v.endAngle)===0&&t.length!==1)return null;var w=u==null||u===s,S=String(b)===l&&(c==null||o.dataKey===c)&&w,C=l?r:null,N=n&&S?n:C,j=ru(ru({},v),{},{stroke:v.stroke,tabIndex:-1,[WQe]:b,[GQe]:s});return f.createElement(Ta,IC({key:"sector-".concat(v==null?void 0:v.startAngle,"-").concat(v==null?void 0:v.endAngle,"-").concat(v.midAngle,"-").concat(b),tabIndex:-1,className:"recharts-pie-sector"},ZI(m,v,b),{onMouseEnter:g(v,b),onMouseLeave:y(v,b),onClick:x(v,b)}),f.createElement(X0e,IC({option:i??N,index:b,shapeType:"sector",isActive:S},j)))}))}function Kon(e){var t,{pieSettings:n,displayedData:r,cells:o,offset:i}=e,{cornerRadius:s,startAngle:l,endAngle:c,dataKey:u,nameKey:d,tooltipType:p}=n,h=Math.abs(n.minAngle),m=Hon(l,c),g=Math.abs(m),y=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,x=r.filter(N=>La(N,u,0)!==0).length,v=(g>=360?x:x-1)*y,b=g-x*h-v,w=r.reduce((N,j)=>{var I=La(j,u,0);return N+(Mr(I)?I:0)},0),S;if(w>0){var C;S=r.map((N,j)=>{var I=La(N,u,0),_=La(N,d,j),T=Bon(n,i,N),P=(Mr(I)?I:0)/w,E,M=ru(ru({},N),o&&o[j]&&o[j].props);j?E=C.endAngle+df(m)*y*(I!==0?1:0):E=l;var R=E+df(m)*((I!==0?h:0)+P*b),$=(E+R)/2,D=(T.innerRadius+T.outerRadius)/2,z=[{name:_,value:I,payload:M,dataKey:u,type:p,graphicalItemId:n.id}],V=cs(T.cx,T.cy,D,$);return C=ru(ru(ru(ru({},n.presentationProps),{},{percent:P,cornerRadius:typeof s=="string"?parseFloat(s):s,name:_,tooltipPayload:z,midAngle:$,middleRadius:D,tooltipPosition:V},M),T),{},{value:I,dataKey:u,startAngle:E,endAngle:R,payload:M,paddingAngle:df(m)*y}),C})}return S}function Yon(e){var{showLabels:t,sectors:n,children:r}=e,o=f.useMemo(()=>!t||!n?[]:n.map(i=>({value:i.value,payload:i.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:i.cx,cy:i.cy,innerRadius:i.innerRadius,outerRadius:i.outerRadius,startAngle:i.startAngle,endAngle:i.endAngle,clockWise:!1},fill:i.fill})),[n,t]);return f.createElement(Snn,{value:t?o:void 0},r)}function Xon(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:o,isAnimationActive:i,animationBegin:s,animationDuration:l,animationEasing:c,activeShape:u,inactiveShape:d,onAnimationStart:p,onAnimationEnd:h}=t,m=t5(t,"recharts-pie-"),g=n.current,[y,x]=f.useState(!1),v=f.useCallback(()=>{typeof h=="function"&&h(),x(!1)},[h]),b=f.useCallback(()=>{typeof p=="function"&&p(),x(!0)},[p]);return f.createElement(Yon,{showLabels:!y,sectors:o},f.createElement(e5,{animationId:m,begin:s,duration:l,isActive:i,easing:c,onAnimationStart:b,onAnimationEnd:v,key:m},w=>{var S,C=[],N=o&&o[0],j=(S=N==null?void 0:N.startAngle)!==null&&S!==void 0?S:0;return o==null||o.forEach((I,_)=>{var T=g&&g[_],P=_>0?nI(I,"paddingAngle",0):0;if(T){var E=ja(T.endAngle-T.startAngle,I.endAngle-I.startAngle,w),M=ru(ru({},I),{},{startAngle:j+P,endAngle:j+E+P});C.push(M),j=M.endAngle}else{var{endAngle:R,startAngle:$}=I,D=ja(0,R-$,w),z=ru(ru({},I),{},{startAngle:j+P,endAngle:j+D+P});C.push(z),j=z.endAngle}}),n.current=C,f.createElement(Ta,null,f.createElement(qon,{sectors:C,activeShape:u,inactiveShape:d,allOtherPieProps:t,shape:t.shape,id:r}))}),f.createElement(Gon,{showLabels:!y,sectors:o,props:t}),t.children)}var Qon={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Pl.area};function Jon(e){var{id:t}=e,n=Qq(e,Ton),{hide:r,className:o,rootTabIndex:i}=e,s=f.useMemo(()=>K0e(e.children,Eh),[e.children]),l=gr(d=>Jrn(d,t,s)),c=f.useRef(null),u=be("recharts-pie",o);return r||l==null?(c.current=null,f.createElement(Ta,{tabIndex:i,className:u})):f.createElement(id,{zIndex:e.zIndex},f.createElement(Lon,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:l,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t}),f.createElement(Ta,{tabIndex:i,className:u},f.createElement(Xon,{props:ru(ru({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function cb(e){var t=Hs(e,Qon),{id:n}=t,r=Qq(t,kon),o=dl(r);return f.createElement(RL,{id:n,type:"pie"},i=>f.createElement(f.Fragment,null,f.createElement(ott,{type:"pie",id:i,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:o,maxRadius:t.maxRadius}),f.createElement(Don,IC({},r,{id:i})),f.createElement(Jon,IC({},r,{id:i}))))}cb.displayName="Pie";var Zon=["points"];function fAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function zZ(e){for(var t=1;t{var x,v,b=zZ(zZ(zZ({r:3},s),p),{},{index:y,cx:(x=g.x)!==null&&x!==void 0?x:void 0,cy:(v=g.y)!==null&&v!==void 0?v:void 0,dataKey:i,value:g.value,payload:g.payload,points:t});return f.createElement(iin,{key:"dot-".concat(y),option:n,dotProps:b,className:o})}),m={};return l&&c!=null&&(m.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),f.createElement(id,{zIndex:u},f.createElement(Ta,DV({className:r},m),h))}function pAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function hAe(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),bin=on([vin,Hw,Vw],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),Jq=()=>gr(bin),win=()=>gr(ien);function mAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function BZ(e){for(var t=1;t{var{point:t,childIndex:n,mainColor:r,activeDot:o,dataKey:i,clipPath:s}=e;if(o===!1||t.x==null||t.y==null)return null;var l={index:n,dataKey:i,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=BZ(BZ(BZ({},l),dw(o)),pge(o)),u;return f.isValidElement(o)?u=f.cloneElement(o,c):typeof o=="function"?u=o(c):u=f.createElement(B0e,c),f.createElement(Ta,{className:"recharts-active-dot",clipPath:s},u)};function LV(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:o,clipPath:i,zIndex:s=Pl.activeDot}=e,l=gr(jC),c=win();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return Ml(u)?null:f.createElement(id,{zIndex:s},f.createElement(jin,{point:u,childIndex:Number(l),mainColor:n,dataKey:o,activeDot:r,clipPath:i}))}function gAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function FV(e){for(var t=1;tPk(e,"radiusAxis",t),Pin=on([stt],e=>{if(e!=null)return{scale:e}}),Ain=on([CL,stt],(e,t)=>{if(!(e==null||t==null))return FV(FV({},e),{},{scale:t})}),Tin=(e,t,n,r)=>Ak(e,"radiusAxis",t,r),ltt=(e,t,n)=>wk(e,n),ctt=(e,t,n)=>Pk(e,"angleAxis",n),kin=on([ltt,ctt],(e,t)=>{if(!(e==null||t==null))return FV(FV({},e),{},{scale:t})}),Min=(e,t,n,r)=>Ak(e,"angleAxis",n,r),Rin=on([ltt,ctt,Sk],(e,t,n)=>{if(!(n==null||t==null))return{scale:t,type:e.type,dataKey:e.dataKey,cx:n.cx,cy:n.cy}}),Oin=(e,t,n,r,o)=>o,$in=on([Ui,Ain,Tin,kin,Min],(e,t,n,r,o)=>q0(e,"radiusAxis")?ib(t,n,!1):ib(r,o,!1)),Din=on([H0e,Oin],(e,t)=>{if(e!=null){var n=e.find(r=>r.type==="radar"&&t===r.id);return n==null?void 0:n.dataKey}}),Lin=on([Pin,Rin,wL,Din,$in],(e,t,n,r,o)=>{var{chartData:i,dataStartIndex:s,dataEndIndex:l}=n;if(!(e==null||t==null||i==null||o==null||r==null)){var c=i.slice(s,l+1);return Kin({radiusAxis:e,angleAxis:t,displayedData:c,dataKey:r,bandSize:o})}}),Fin=["id"];function D3(){return D3=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,stroke:r,fill:o,legendType:i,hide:s}=e;return[{inactive:s,dataKey:t,type:i,color:rxe(r,o),value:Eb(n,t),payload:e}]},Gin=f.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:o,name:i,hide:s,tooltipType:l,id:c}=e,u={dataDefinedOnItem:void 0,getPosition:Ey,settings:{stroke:n,strokeWidth:r,fill:o,nameKey:void 0,dataKey:t,name:Eb(i,t),hide:s,type:l,color:rxe(n,o),unit:"",graphicalItemId:c}};return f.createElement(ML,{tooltipEntrySettings:u})});function qin(e){var{points:t,props:n}=e,{dot:r,dataKey:o}=n,{id:i}=n,s=Vin(n,Fin),l=dl(s);return f.createElement(nxe,{points:t,dot:r,className:"recharts-radar-dots",dotClassName:"recharts-radar-dot",dataKey:o,baseProps:l})}function Kin(e){var{radiusAxis:t,angleAxis:n,displayedData:r,dataKey:o,bandSize:i}=e,{cx:s,cy:l}=n,c=!1,u=[],d=n.type!=="number"?i??0:0;r.forEach((h,m)=>{var g,y,x=La(h,n.dataKey,m),v=La(h,o),b=((g=n.scale.map(x))!==null&&g!==void 0?g:0)+d,w=Array.isArray(v)?Het(v):v,S=Ml(w)?0:(y=t.scale.map(w))!==null&&y!==void 0?y:0;Array.isArray(v)&&v.length>=2&&(c=!0),u.push(lm(lm({},cs(s,l,S,b)),{},{name:x,value:v,cx:s,cy:l,radius:S,angle:b,payload:h}))});var p=[];return c&&u.forEach(h=>{if(Array.isArray(h.value)){var m,g=h.value[0],y=Ml(g)?0:(m=t.scale.map(g))!==null&&m!==void 0?m:0;p.push(lm(lm({},h),{},{radius:y},cs(s,l,y,h.angle)))}else p.push(h)}),{points:u,isRange:c,baseLinePoints:p}}function Yin(e){var{showLabels:t,points:n,children:r}=e,o=n.map(i=>{var s,l={x:i.x,y:i.y,width:0,lowerWidth:0,upperWidth:0,height:0};return lm(lm({},l),{},{value:(s=i.value)!==null&&s!==void 0?s:"",payload:i.payload,parentViewBox:void 0,viewBox:l,fill:void 0})});return f.createElement(Gq,{value:t?o:void 0},r)}function Xin(e){var{points:t,baseLinePoints:n,props:r}=e;if(t==null)return null;var{shape:o,isRange:i,connectNulls:s}=r,l=d=>{var{onMouseEnter:p}=r;p&&p(r,d)},c=d=>{var{onMouseLeave:p}=r;p&&p(r,d)},u;return f.isValidElement(o)?u=f.cloneElement(o,lm(lm({},r),{},{points:t})):typeof o=="function"?u=o(lm(lm({},r),{},{points:t})):u=f.createElement(Wet,D3({},iu(r),{onMouseEnter:l,onMouseLeave:c,points:t,baseLinePoints:i?n:void 0,connectNulls:s})),f.createElement(Ta,{className:"recharts-radar-polygon"},u,f.createElement(qin,{props:r,points:t}))}var yAe=(e,t,n)=>(r,o)=>{var i=e&&e[Math.floor(o*t)];return i?lm(lm({},r),{},{x:ja(i.x,r.x,n),y:ja(i.y,r.y,n)}):lm(lm({},r),{},{x:ja(r.cx,r.x,n),y:ja(r.cy,r.y,n)})};function Qin(e){var{props:t,previousPointsRef:n,previousBaseLinePointsRef:r}=e,{points:o,baseLinePoints:i,isAnimationActive:s,animationBegin:l,animationDuration:c,animationEasing:u,onAnimationEnd:d,onAnimationStart:p}=t,h=n.current,m=r.current,g=h?h.length/o.length:1,y=m?m.length/i.length:1,x=t5(t,"recharts-radar-"),[v,b]=f.useState(!1),w=!v,S=f.useCallback(()=>{typeof d=="function"&&d(),b(!1)},[d]),C=f.useCallback(()=>{typeof p=="function"&&p(),b(!0)},[p]);return f.createElement(Yin,{showLabels:w,points:o},f.createElement(e5,{animationId:x,begin:l,duration:c,isActive:s,easing:u,key:"radar-".concat(x),onAnimationEnd:S,onAnimationStart:C},N=>{var j=N===1?o:o.map(yAe(h,g,N)),I=N===1?i:i==null?void 0:i.map(yAe(m,y,N));return N>0&&(n.current=j,r.current=I),f.createElement(Xin,{points:j,baseLinePoints:I,props:t})}),f.createElement(kL,{label:t.label}),t.children)}function Jin(e){var t=f.useRef(void 0),n=f.useRef(void 0);return f.createElement(Qin,{props:e,previousPointsRef:t,previousBaseLinePointsRef:n})}var Zin={activeDot:!0,angleAxisId:0,animationBegin:0,animationDuration:1500,animationEasing:"ease",dot:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",radiusAxisId:0,zIndex:Pl.area};function ean(e){var{hide:t,className:n,points:r}=e;if(t)return null;var o=be("recharts-radar",n);return f.createElement(id,{zIndex:e.zIndex},f.createElement(Ta,{className:o},f.createElement(Jin,e)),f.createElement(LV,{points:r,mainColor:rxe(e.stroke,e.fill),itemDataKey:e.dataKey,activeDot:e.activeDot}))}function tan(e){var t=Vu(),n=gr(r=>Lin(r,e.radiusAxisId,e.angleAxisId,t,e.id));return(n==null?void 0:n.points)==null?null:f.createElement(ean,D3({},e,{points:n==null?void 0:n.points,baseLinePoints:n==null?void 0:n.baseLinePoints,isRange:n==null?void 0:n.isRange}))}function Bae(e){var t=Hs(e,Zin);return f.createElement(RL,{id:t.id,type:"radar"},n=>f.createElement(f.Fragment,null,f.createElement(ott,{type:"radar",id:n,data:void 0,dataKey:t.dataKey,hide:t.hide,angleAxisId:t.angleAxisId,radiusAxisId:t.radiusAxisId}),f.createElement(ntt,{legendPayload:Win(t)}),f.createElement(Gin,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,tooltipType:t.tooltipType,id:n}),f.createElement(tan,D3({},t,{id:n}))))}Bae.displayName="Radar";var vAe=(e,t,n)=>{var r=n??e;if(!Ml(r))return Ap(r,t,0)},nan=(e,t,n)=>{var r={},o=e.filter(Lq),i=e.filter(u=>u.stackId==null),s=o.reduce((u,d)=>{var p=u[d.stackId];return p==null&&(p=[]),p.push(d),u[d.stackId]=p,u},r),l=Object.entries(s).map(u=>{var d,[p,h]=u,m=h.map(y=>y.dataKey),g=vAe(t,n,(d=h[0])===null||d===void 0?void 0:d.barSize);return{stackId:p,dataKeys:m,barSize:g}}),c=i.map(u=>{var d=[u.dataKey].filter(h=>h!=null),p=vAe(t,n,u.barSize);return{stackId:void 0,dataKeys:d,barSize:p}});return[...l,...c]};function bAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function pF(e){for(var t=1;tb+(w.barSize||0),0);h+=(s-1)*l,h>=n&&(h-=(s-1)*l,l=0),h>=n&&p>0&&(d=!0,p*=.9,h=s*p);var m=(n-h)/2>>0,g={offset:m-l,size:0};c=r.reduce((b,w)=>{var S,C={stackId:w.stackId,dataKeys:w.dataKeys,position:{offset:g.offset+g.size+l,size:d?p:(S=w.barSize)!==null&&S!==void 0?S:0}},N=[...b,C];return g=C.position,N},u)}else{var y=Ap(t,n,0,!0);n-2*y-(s-1)*l<=0&&(l=0);var x=(n-2*y-(s-1)*l)/s;x>1&&(x>>=0);var v=ci(o)?Math.min(x,o):x;c=r.reduce((b,w,S)=>[...b,{stackId:w.stackId,dataKeys:w.dataKeys,position:{offset:y+(x+l)*S+(x-v)/2,size:v}}],u)}return c}}var san=(e,t,n,r,o,i,s)=>{var l=Ml(s)?t:s,c=aan(n,r,o!==i?o:i,e,l);return o!==i&&c!=null&&(c=c.map(u=>pF(pF({},u),{},{position:pF(pF({},u.position),{},{offset:u.position.offset-o/2})}))),c},lan=(e,t)=>{var n=Dq(t);if(!(!e||n==null||t==null)){var{stackId:r}=t;if(r!=null){var o=e[r];if(o){var{stackedData:i}=o;if(i)return i.find(s=>s.key===n)}}}},can=(e,t)=>{if(!(e==null||t==null)){var n=e.find(r=>r.stackId===t.stackId&&t.dataKey!=null&&r.dataKeys.includes(t.dataKey));if(n!=null)return n.position}};function uan(e,t){return e&&typeof e=="object"&&"zIndex"in e&&typeof e.zIndex=="number"&&ci(e.zIndex)?e.zIndex:t}function wAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function SAe(e){for(var t=1;t{var n=e.replace(/(\w)/,o=>o.toUpperCase()),r=han.reduce((o,i)=>SAe(SAe({},o),{},{[i+n]:t}),{});return r[e]=t,r},utt=e=>{var{chartData:t}=e,n=fs(),r=Vu();return f.useEffect(()=>r?()=>{}:(n(dPe(t)),()=>{n(dPe(void 0))}),[t,n,r]),null},gan=e=>e.chartData.chartData,xan=()=>gr(gan),yan=e=>{var{dataStartIndex:t,dataEndIndex:n}=e.chartData;return{startIndex:t,endIndex:n}},van=()=>gr(yan),ban=f.createContext(()=>{}),CAe={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},dtt=bm({name:"brush",initialState:CAe,reducers:{setBrushSettings(e,t){return t.payload==null?CAe:t.payload}}}),{setBrushSettings:NAe}=dtt.actions,wan=dtt.reducer;function L3(){return L3=Object.assign?Object.assign.bind():function(e){for(var t=1;t{["ArrowLeft","ArrowRight"].includes(j.key)&&(j.preventDefault(),j.stopPropagation(),c(j.key==="ArrowRight"?1:-1,r))},onFocus:u,onBlur:d,style:{cursor:"col-resize"}},f.createElement(jan,{travellerType:y,travellerProps:C}))}function _Ae(e){var{index:t,data:n,tickFormatter:r,dataKey:o}=e,i=La(n[t],o,t);return typeof r=="function"?r(i,t):i}function PAe(e,t){for(var n=e.length,r=0,o=n-1;o-r>1;){var i=Math.floor((r+o)/2),s=e[i];s!=null&&s>t?o=i:r=i}var l=e[o];return l!=null&&t>=l?o:r}function HZ(e){var{startX:t,endX:n,scaleValues:r,gap:o,data:i}=e,s=i.length-1,l=Math.min(t,n),c=Math.max(t,n),u=PAe(r,l),d=PAe(r,c);return{startIndex:u-u%o,endIndex:d===s?s:d-d%o}}function Ian(e){var{x:t,y:n,width:r,height:o,fill:i,stroke:s}=e;return f.createElement("rect",{stroke:s,fill:i,x:t,y:n,width:r,height:o})}function _an(e){var{startIndex:t,endIndex:n,y:r,height:o,travellerWidth:i,stroke:s,tickFormatter:l,dataKey:c,data:u,startX:d,endX:p}=e,h=5,m={pointerEvents:"none",fill:s};return f.createElement(Ta,{className:"recharts-brush-texts"},f.createElement(EC,L3({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,p)-h,y:r+o/2},m),_Ae({index:t,tickFormatter:l,dataKey:c,data:u})),f.createElement(EC,L3({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,p)+i+h,y:r+o/2},m),_Ae({index:n,tickFormatter:l,dataKey:c,data:u})))}function Pan(e){var{y:t,height:n,stroke:r,travellerWidth:o,startX:i,endX:s,onMouseEnter:l,onMouseLeave:c,onMouseDown:u,onTouchStart:d}=e,p=Math.min(i,s)+o,h=Math.max(Math.abs(s-i)-o,0);return f.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:l,onMouseLeave:c,onMouseDown:u,onTouchStart:d,style:{cursor:"move"},stroke:"none",fill:r,fillOpacity:.2,x:p,y:t,width:h,height:n})}function Aan(e){var{x:t,y:n,width:r,height:o,data:i,children:s,padding:l}=e,c=f.Children.count(s)===1;if(!c)return null;var u=f.Children.only(s);return u?f.cloneElement(u,{x:t,y:n,width:r,height:o,margin:l,compact:!0,data:i}):null}var Tan=e=>{var{data:t,startIndex:n,endIndex:r,x:o,width:i,travellerWidth:s}=e;if(!t||!t.length)return{};var l=t.length,c=CJe().domain(Oge(0,l)).range([o,o+i-s]),u=c.domain().map(d=>c(d)).filter(jp);return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:c(n),endX:c(r),scale:c,scaleValues:u}},AAe=e=>e.changedTouches&&!!e.changedTouches.length;class kan extends f.PureComponent{constructor(t){super(t),f1(this,"handleDrag",n=>{this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.state.isTravellerMoving?this.handleTravellerMove(n):this.state.isSlideMoving&&this.handleSlideDrag(n)}),f1(this,"handleTouchMove",n=>{var r,o=(r=n.changedTouches)===null||r===void 0?void 0:r[0];o!=null&&this.handleDrag(o)}),f1(this,"handleDragEnd",()=>{this.setState({isTravellerMoving:!1,isSlideMoving:!1},()=>{var{endIndex:n,onDragEnd:r,startIndex:o}=this.props;r==null||r({endIndex:n,startIndex:o})}),this.detachDragEndListener()}),f1(this,"handleLeaveWrapper",()=>{(this.state.isTravellerMoving||this.state.isSlideMoving)&&(this.leaveTimer=window.setTimeout(this.handleDragEnd,this.props.leaveTimeOut))}),f1(this,"handleEnterSlideOrTraveller",()=>{this.setState({isTextActive:!0})}),f1(this,"handleLeaveSlideOrTraveller",()=>{this.setState({isTextActive:!1})}),f1(this,"handleSlideDragStart",n=>{var r=AAe(n)?n.changedTouches[0]:n;r!=null&&(this.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:r.pageX}),this.attachDragEndListener())}),f1(this,"handleTravellerMoveKeyboard",(n,r)=>{var{data:o,gap:i,startIndex:s,endIndex:l}=this.props,{scaleValues:c,startX:u,endX:d}=this.state;if(c!=null){var p=-1;if(r==="startX"?p=s:r==="endX"&&(p=l),!(p<0||p>=o.length)){var h=p+n;if(!(h===-1||h>=c.length)){var m=c[h];m!=null&&(r==="startX"&&m>=d||r==="endX"&&m<=u||this.setState({[r]:m},()=>{this.props.onChange(HZ({startX:this.state.startX,endX:this.state.endX,data:o,gap:i,scaleValues:c}))}))}}}}),this.travellerDragStartHandlers={startX:this.handleTravellerDragStart.bind(this,"startX"),endX:this.handleTravellerDragStart.bind(this,"endX")},this.state={brushMoveStartX:0,movingTravellerId:void 0,endX:0,startX:0,slideMoveStartX:0}}static getDerivedStateFromProps(t,n){var{data:r,width:o,x:i,travellerWidth:s,startIndex:l,endIndex:c,startIndexControlledFromProps:u,endIndexControlledFromProps:d}=t;if(r!==n.prevData)return Mj({prevData:r,prevTravellerWidth:s,prevX:i,prevWidth:o},r&&r.length?Tan({data:r,width:o,x:i,travellerWidth:s,startIndex:l,endIndex:c}):{scale:void 0,scaleValues:void 0});var p=n.scale;if(p&&(o!==n.prevWidth||i!==n.prevX||s!==n.prevTravellerWidth)){p.range([i,i+o-s]);var h=p.domain().map(m=>p(m)).filter(m=>m!=null);return{prevData:r,prevTravellerWidth:s,prevX:i,prevWidth:o,startX:p(t.startIndex),endX:p(t.endIndex),scaleValues:h}}if(n.scale&&!n.isSlideMoving&&!n.isTravellerMoving&&!n.isTravellerFocused&&!n.isTextActive){if(u!=null&&n.prevStartIndexControlledFromProps!==u)return{startX:n.scale(u),prevStartIndexControlledFromProps:u};if(d!=null&&n.prevEndIndexControlledFromProps!==d)return{endX:n.scale(d),prevEndIndexControlledFromProps:d}}return null}componentWillUnmount(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}attachDragEndListener(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}detachDragEndListener(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}handleSlideDrag(t){var{slideMoveStartX:n,startX:r,endX:o,scaleValues:i}=this.state;if(i!=null){var{x:s,width:l,travellerWidth:c,startIndex:u,endIndex:d,onChange:p,data:h,gap:m}=this.props,g=t.pageX-n;g>0?g=Math.min(g,s+l-c-o,s+l-c-r):g<0&&(g=Math.max(g,s-r,s-o));var y=HZ({startX:r+g,endX:o+g,data:h,gap:m,scaleValues:i});(y.startIndex!==u||y.endIndex!==d)&&p&&p(y),this.setState({startX:r+g,endX:o+g,slideMoveStartX:t.pageX})}}handleTravellerDragStart(t,n){var r=AAe(n)?n.changedTouches[0]:n;r!=null&&(this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:t,brushMoveStartX:r.pageX}),this.attachDragEndListener())}handleTravellerMove(t){var{brushMoveStartX:n,movingTravellerId:r,endX:o,startX:i,scaleValues:s}=this.state;if(!(r==null||s==null)){var l=this.state[r],{x:c,width:u,travellerWidth:d,onChange:p,gap:h,data:m}=this.props,g={startX:this.state.startX,endX:this.state.endX,data:m,gap:h,scaleValues:s},y=t.pageX-n;y>0?y=Math.min(y,c+u-d-l):y<0&&(y=Math.max(y,c-l)),g[r]=l+y;var x=HZ(g),{startIndex:v,endIndex:b}=x,w=()=>{var S=m.length-1;return r==="startX"&&(o>i?v%h===0:b%h===0)||oi?b%h===0:v%h===0)||o>i&&b===S};this.setState({[r]:l+y,brushMoveStartX:t.pageX},()=>{p&&w()&&p(x)})}}render(){var{data:t,className:n,children:r,x:o,y:i,dy:s,width:l,height:c,alwaysShowText:u,fill:d,stroke:p,startIndex:h,endIndex:m,travellerWidth:g,tickFormatter:y,dataKey:x,padding:v}=this.props,{startX:b,endX:w,isTextActive:S,isSlideMoving:C,isTravellerMoving:N,isTravellerFocused:j}=this.state;if(!t||!t.length||!Mr(o)||!Mr(i)||!Mr(l)||!Mr(c)||l<=0||c<=0)return null;var I=be("recharts-brush",n),_=man("userSelect","none"),T=i+(s??0);return f.createElement(Ta,{className:I,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},f.createElement(Ian,{x:o,y:T,width:l,height:c,fill:d,stroke:p}),f.createElement(XGt,null,f.createElement(Aan,{x:o,y:T,width:l,height:c,data:t,padding:v},r)),f.createElement(Pan,{y:T,height:c,stroke:p,travellerWidth:g,startX:b,endX:w,onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart}),f.createElement(IAe,{travellerX:b,id:"startX",otherProps:Mj(Mj({},this.props),{},{y:T}),onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers.startX,onTouchStart:this.travellerDragStartHandlers.startX,onTravellerMoveKeyboard:this.handleTravellerMoveKeyboard,onFocus:()=>{this.setState({isTravellerFocused:!0})},onBlur:()=>{this.setState({isTravellerFocused:!1})}}),f.createElement(IAe,{travellerX:w,id:"endX",otherProps:Mj(Mj({},this.props),{},{y:T}),onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers.endX,onTouchStart:this.travellerDragStartHandlers.endX,onTravellerMoveKeyboard:this.handleTravellerMoveKeyboard,onFocus:()=>{this.setState({isTravellerFocused:!0})},onBlur:()=>{this.setState({isTravellerFocused:!1})}}),(S||C||N||j||u)&&f.createElement(_an,{startIndex:h,endIndex:m,y:T,height:c,travellerWidth:g,stroke:p,tickFormatter:y,dataKey:x,data:t,startX:b,endX:w}))}}function Man(e){var t=fs(),n=xan(),r=van(),o=f.useContext(ban),i=e.onChange,{startIndex:s,endIndex:l}=e;f.useEffect(()=>{t(Lae({startIndex:s,endIndex:l}))},[t,l,s]),dtn();var c=f.useCallback(x=>{if(r!=null){var{startIndex:v,endIndex:b}=r;(x.startIndex!==v||x.endIndex!==b)&&(o==null||o(x),i==null||i(x),t(Lae(x)))}},[i,o,t,r]),u=gr(fL);if(u==null||r==null||n==null||!n.length)return null;var{startIndex:d,endIndex:p}=r,{x:h,y:m,width:g}=u,y={data:n,x:h,y:m,width:g,startIndex:d,endIndex:p,onChange:c};return f.createElement(kan,L3({},e,y,{startIndexControlledFromProps:s??void 0,endIndexControlledFromProps:l??void 0}))}function Ran(e){var t=fs();return f.useEffect(()=>(t(NAe(e)),()=>{t(NAe(null))}),[t,e]),null}var Oan={height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1};function ftt(e){var t=Hs(e,Oan);return f.createElement(f.Fragment,null,f.createElement(Ran,{height:t.height,x:t.x,y:t.y,width:t.width,padding:t.padding}),f.createElement(Man,t))}ftt.displayName="Brush";var $an=(e,t)=>{var{x:n,y:r}=e,{x:o,y:i}=t;return{x:Math.min(n,o),y:Math.min(r,i),width:Math.abs(o-n),height:Math.abs(i-r)}},Dan=e=>{var{x1:t,y1:n,x2:r,y2:o}=e;return $an({x:t,y:n},{x:r,y:o})};function Lan(e){return(e%180+180)%180}var Fan=function(t){var{width:n,height:r}=t,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Lan(o),s=i*Math.PI/180,l=Math.atan(r/n),c=s>l&&s{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=ey(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=ey(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=ey(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:kno,removeDot:Mno,addArea:Rno,removeArea:Ono,addLine:Ban,removeLine:Han}=ptt.actions,Van=ptt.reducer,htt=f.createContext(void 0),Uan=e=>{var{children:t}=e,[n]=f.useState("".concat(N3("recharts"),"-clip")),r=Jq();if(r==null)return null;var{x:o,y:i,width:s,height:l}=r;return f.createElement(htt.Provider,{value:n},f.createElement("defs",null,f.createElement("clipPath",{id:n},f.createElement("rect",{x:o,y:i,height:l,width:s}))),t)},Wan=()=>f.useContext(htt);class Gan{constructor(t){var{x:n,y:r}=t;this.xAxisScale=n,this.yAxisScale=r}map(t,n){var r,o,{position:i}=n;return{x:(r=this.xAxisScale.map(t.x,{position:i}))!==null&&r!==void 0?r:0,y:(o=this.yAxisScale.map(t.y,{position:i}))!==null&&o!==void 0?o:0}}mapWithFallback(t,n){var r,o,{position:i,fallback:s}=n,l,c;return s==="rangeMin"?l=this.yAxisScale.rangeMin():s==="rangeMax"?l=this.yAxisScale.rangeMax():l=0,s==="rangeMin"?c=this.xAxisScale.rangeMin():s==="rangeMax"?c=this.xAxisScale.rangeMax():c=0,{x:(r=this.xAxisScale.map(t.x,{position:i}))!==null&&r!==void 0?r:c,y:(o=this.yAxisScale.map(t.y,{position:i}))!==null&&o!==void 0?o:l}}isInRange(t){var{x:n,y:r}=t,o=n==null||this.xAxisScale.isInRange(n),i=r==null||this.yAxisScale.isInRange(r);return o&&i}}function TAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function kAe(e){for(var t=1;t{var n;if(f.isValidElement(e))n=f.cloneElement(e,t);else if(typeof e=="function")n=e(t);else{if(!ci(t.x1)||!ci(t.y1)||!ci(t.x2)||!ci(t.y2))return null;n=f.createElement("line",zV({},t,{className:"recharts-reference-line-line"}))}return n},Qan=(e,t,n,r,o,i)=>{var{x:s,width:l}=i,c=o.map(e,{position:n});if(!ci(c)||t==="discard"&&!o.isInRange(c))return null;var u=[{x:s+l,y:c},{x:s,y:c}];return r==="left"?u.reverse():u},Jan=(e,t,n,r,o,i)=>{var{y:s,height:l}=i,c=o.map(e,{position:n});if(!ci(c)||t==="discard"&&!o.isInRange(c))return null;var u=[{x:c,y:s+l},{x:c,y:s}];return r==="top"?u.reverse():u},Zan=(e,t,n,r)=>{var o=[r.mapWithFallback(e[0],{position:n,fallback:"rangeMin"}),r.mapWithFallback(e[1],{position:n,fallback:"rangeMax"})];return t==="discard"&&o.some(i=>!r.isInRange(i))?null:o},esn=(e,t,n,r,o,i,s)=>{var{x:l,y:c,segment:u,ifOverflow:d}=s,p=M0(l),h=M0(c);return h?Qan(c,d,r,i,t,n):p?Jan(l,d,r,o,e,n):u!=null&&u.length===2?Zan(u,d,r,new Gan({x:e,y:t})):null};function tsn(e){var t=fs();return f.useEffect(()=>(t(Ban(e)),()=>{t(Han(e))})),null}function nsn(e){var{xAxisId:t,yAxisId:n,shape:r,className:o,ifOverflow:i}=e,s=Vu(),l=Wan(),c=gr(j=>Ib(j,t)),u=gr(j=>_b(j,n)),d=gr(j=>lT(j,"xAxis",t,s)),p=gr(j=>lT(j,"yAxis",n,s)),h=pL();if(!l||!h||c==null||u==null||d==null||p==null)return null;var m=esn(d,p,h,e.position,c.orientation,u.orientation,e);if(!m)return null;var g=m[0],y=m[1];if(g==null||y==null)return null;var{x,y:v}=g,{x:b,y:w}=y,S=i==="hidden"?"url(#".concat(l,")"):void 0,C=kAe(kAe({clipPath:S},iu(e)),{},{x1:x,y1:v,x2:b,y2:w}),N=Dan({x1:x,y1:v,x2:b,y2:w});return f.createElement(id,{zIndex:e.zIndex},f.createElement(Ta,{className:be("recharts-reference-line",o)},Xan(r,C),f.createElement($et,zV({},N,{lowerWidth:N.width,upperWidth:N.width}),f.createElement(Bet,{label:e.label}),e.children)))}var rsn={ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",label:!1,stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle",zIndex:Pl.line};function mtt(e){var t=Hs(e,rsn);return f.createElement(f.Fragment,null,f.createElement(tsn,{yAxisId:t.yAxisId,xAxisId:t.xAxisId,ifOverflow:t.ifOverflow,x:t.x,y:t.y,segment:t.segment}),f.createElement(nsn,t))}mtt.displayName="ReferenceLine";function gtt(e,t){if(t<1)return[];if(t===1)return e;for(var n=[],r=0;re*o)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-o)<=0}function asn(e,t){return gtt(e,t+1)}function ssn(e,t,n,r,o){for(var i=(r||[]).slice(),{start:s,end:l}=t,c=0,u=1,d=s,p=function(){var g=r==null?void 0:r[c];if(g===void 0)return{v:gtt(r,u)};var y=c,x,v=()=>(x===void 0&&(x=n(g,y)),x),b=g.coordinate,w=c===0||F3(e,b,v,d,l);w||(c=0,d=s,u+=1),w&&(d=b+e*(v()/2+o),c+=u)},h;u<=i.length;)if(h=p(),h)return h.v;return[]}function lsn(e,t,n,r,o){var i=(r||[]).slice(),s=i.length;if(s===0)return[];for(var{start:l,end:c}=t,u=1;u<=s;u++){for(var d=(s-1)%u,p=l,h=!0,m=function(){var S=r[y];if(S==null)return 0;var C=y,N,j=()=>(N===void 0&&(N=n(S,C)),N),I=S.coordinate,_=y===d||F3(e,I,j,p,c);if(!_)return h=!1,1;_&&(p=I+e*(j()/2+o))},g,y=d;y(y===void 0&&(y=n(m,h)),y);if(h===s-1){var v=e*(g.coordinate+e*x()/2-c);i[h]=g=xp(xp({},g),{},{tickCoord:v>0?g.coordinate-v*e:g.coordinate})}else i[h]=g=xp(xp({},g),{},{tickCoord:g.coordinate});if(g.tickCoord!=null){var b=F3(e,g.tickCoord,x,l,c);b&&(c=g.tickCoord-e*(x()/2+o),i[h]=xp(xp({},g),{},{isShow:!0}))}},d=s-1;d>=0;d--)u(d);return i}function psn(e,t,n,r,o,i){var s=(r||[]).slice(),l=s.length,{start:c,end:u}=t;if(i){var d=r[l-1];if(d!=null){var p=n(d,l-1),h=e*(d.coordinate+e*p/2-u);if(s[l-1]=d=xp(xp({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate}),d.tickCoord!=null){var m=F3(e,d.tickCoord,()=>p,c,u);m&&(u=d.tickCoord-e*(p/2+o),s[l-1]=xp(xp({},d),{},{isShow:!0}))}}}for(var g=i?l-1:l,y=function(b){var w=s[b];if(w==null)return 1;var S=w,C,N=()=>(C===void 0&&(C=n(w,b)),C);if(b===0){var j=e*(S.coordinate-e*N()/2-c);s[b]=S=xp(xp({},S),{},{tickCoord:j<0?S.coordinate-j*e:S.coordinate})}else s[b]=S=xp(xp({},S),{},{tickCoord:S.coordinate});if(S.tickCoord!=null){var I=F3(e,S.tickCoord,N,c,u);I&&(c=S.tickCoord+e*(N()/2+o),s[b]=xp(xp({},S),{},{isShow:!0}))}},x=0;x{var j=typeof u=="function"?u(C.value,N):C.value;return g==="width"?osn(lO(j,{fontSize:t,letterSpacing:n}),y,p):lO(j,{fontSize:t,letterSpacing:n})[g]},v=o[0],b=o[1],w=o.length>=2&&v!=null&&b!=null?df(b.coordinate-v.coordinate):1,S=isn(i,w,g);return c==="equidistantPreserveStart"?ssn(w,S,x,o,s):c==="equidistantPreserveEnd"?lsn(w,S,x,o,s):(c==="preserveStart"||c==="preserveStartEnd"?m=psn(w,S,x,o,s,c==="preserveStartEnd"):m=fsn(w,S,x,o,s),m.filter(C=>C.isShow))}var hsn=e=>{var{ticks:t,label:n,labelGapWithTick:r=5,tickSize:o=0,tickMargin:i=0}=e,s=0;if(t){Array.from(t).forEach(d=>{if(d){var p=d.getBoundingClientRect();p.width>s&&(s=p.width)}});var l=n?n.getBoundingClientRect().width:0,c=o+i,u=s+c+l+(n?r:0);return Math.round(u)}return 0},msn=["axisLine","width","height","className","hide","ticks","axisType"];function gsn(e,t){if(e==null)return{};var n,r,o=xsn(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r{var{ticks:n=[],tick:r,tickLine:o,stroke:i,tickFormatter:s,unit:l,padding:c,tickTextProps:u,orientation:d,mirror:p,x:h,y:m,width:g,height:y,tickSize:x,tickMargin:v,fontSize:b,letterSpacing:w,getTicksConfig:S,events:C,axisType:N}=e,j=oxe(tu(tu({},S),{},{ticks:n}),b,w),I=Csn(d,p),_=Nsn(d,p),T=dl(S),P=dw(r),E={};typeof o=="object"&&(E=o);var M=tu(tu({},T),{},{fill:"none"},E),R=j.map(z=>tu({entry:z},Ssn(z,h,m,g,y,d,x,p,v))),$=R.map(z=>{var{entry:V,line:B}=z;return f.createElement(Ta,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(V.value,"-").concat(V.coordinate,"-").concat(V.tickCoord)},o&&f.createElement("line",uI({},M,B,{className:be("recharts-cartesian-axis-tick-line",nI(o,"className"))})))}),D=R.map((z,V)=>{var B,G,{entry:H,tick:F}=z,W=tu(tu(tu(tu({verticalAnchor:_},T),{},{textAnchor:I,stroke:"none",fill:i},F),{},{index:V,payload:H,visibleTicksCount:j.length,tickFormatter:s,padding:c},u),{},{angle:(B=(G=u==null?void 0:u.angle)!==null&&G!==void 0?G:T.angle)!==null&&B!==void 0?B:0}),U=tu(tu({},W),P);return f.createElement(Ta,uI({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(H.value,"-").concat(H.coordinate,"-").concat(H.tickCoord)},ZI(C,H,V)),r&&f.createElement(jsn,{option:r,tickProps:U,value:"".concat(typeof s=="function"?s(H.value,V):H.value).concat(l||"")}))});return f.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(N,"-ticks")},D.length>0&&f.createElement(id,{zIndex:Pl.label},f.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(N,"-tick-labels"),ref:t},D)),$.length>0&&f.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(N,"-tick-lines")},$))}),Isn=f.forwardRef((e,t)=>{var{axisLine:n,width:r,height:o,className:i,hide:s,ticks:l,axisType:c}=e,u=gsn(e,msn),[d,p]=f.useState(""),[h,m]=f.useState(""),g=f.useRef(null);f.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var x;return hsn({ticks:g.current,label:(x=e.labelRef)===null||x===void 0?void 0:x.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var y=f.useCallback(x=>{if(x){var v=x.getElementsByClassName("recharts-cartesian-axis-tick-value");g.current=v;var b=v[0];if(b){var w=window.getComputedStyle(b),S=w.fontSize,C=w.letterSpacing;(S!==d||C!==h)&&(p(S),m(C))}}},[d,h]);return s||r!=null&&r<=0||o!=null&&o<=0?null:f.createElement(id,{zIndex:e.zIndex},f.createElement(Ta,{className:be("recharts-cartesian-axis",i)},f.createElement(wsn,{x:e.x,y:e.y,width:r,height:o,orientation:e.orientation,mirror:e.mirror,axisLine:n,otherSvgProps:dl(e)}),f.createElement(Esn,{ref:y,axisType:c,events:u,fontSize:d,getTicksConfig:e,height:e.height,letterSpacing:h,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:l,unit:e.unit,width:e.width,x:e.x,y:e.y}),f.createElement($et,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},f.createElement(Bet,{label:e.label,labelRef:e.labelRef}),e.children)))}),ixe=f.forwardRef((e,t)=>{var n=Hs(e,Q1);return f.createElement(Isn,uI({},n,{ref:t}))});ixe.displayName="CartesianAxis";var _sn=["x1","y1","x2","y2","key"],Psn=["offset"],Asn=["xAxisId","yAxisId"],Tsn=["xAxisId","yAxisId"];function OAe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function wp(e){for(var t=1;t{var{fill:t}=e;if(!t||t==="none")return null;var{fillOpacity:n,x:r,y:o,width:i,height:s,ry:l}=e;return f.createElement("rect",{x:r,y:o,ry:l,width:i,height:s,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function xtt(e){var{option:t,lineItemProps:n}=e,r;if(f.isValidElement(t))r=f.cloneElement(t,n);else if(typeof t=="function")r=t(n);else{var o,{x1:i,y1:s,x2:l,y2:c,key:u}=n,d=BV(n,_sn),p=(o=dl(d))!==null&&o!==void 0?o:{},{offset:h}=p,m=BV(p,Psn);r=f.createElement("line",Jj({},m,{x1:i,y1:s,x2:l,y2:c,fill:"none",key:u}))}return r}function Dsn(e){var{x:t,width:n,horizontal:r=!0,horizontalPoints:o}=e;if(!r||!o||!o.length)return null;var{xAxisId:i,yAxisId:s}=e,l=BV(e,Asn),c=o.map((u,d)=>{var p=wp(wp({},l),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return f.createElement(xtt,{key:"line-".concat(d),option:r,lineItemProps:p})});return f.createElement("g",{className:"recharts-cartesian-grid-horizontal"},c)}function Lsn(e){var{y:t,height:n,vertical:r=!0,verticalPoints:o}=e;if(!r||!o||!o.length)return null;var{xAxisId:i,yAxisId:s}=e,l=BV(e,Tsn),c=o.map((u,d)=>{var p=wp(wp({},l),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return f.createElement(xtt,{option:r,lineItemProps:p,key:"line-".concat(d)})});return f.createElement("g",{className:"recharts-cartesian-grid-vertical"},c)}function Fsn(e){var{horizontalFill:t,fillOpacity:n,x:r,y:o,width:i,height:s,horizontalPoints:l,horizontal:c=!0}=e;if(!c||!t||!t.length||l==null)return null;var u=l.map(p=>Math.round(p+o-o)).sort((p,h)=>p-h);o!==u[0]&&u.unshift(0);var d=u.map((p,h)=>{var m=u[h+1],g=m==null,y=g?o+s-p:m-p;if(y<=0)return null;var x=h%t.length;return f.createElement("rect",{key:"react-".concat(h),y:p,x:r,height:y,width:i,stroke:"none",fill:t[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return f.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function zsn(e){var{vertical:t=!0,verticalFill:n,fillOpacity:r,x:o,y:i,width:s,height:l,verticalPoints:c}=e;if(!t||!n||!n.length)return null;var u=c.map(p=>Math.round(p+o-o)).sort((p,h)=>p-h);o!==u[0]&&u.unshift(0);var d=u.map((p,h)=>{var m=u[h+1],g=m==null,y=g?o+s-p:m-p;if(y<=0)return null;var x=h%n.length;return f.createElement("rect",{key:"react-".concat(h),x:p,y:i,width:y,height:l,stroke:"none",fill:n[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return f.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var Bsn=(e,t)=>{var{xAxis:n,width:r,height:o,offset:i}=e;return BQe(oxe(wp(wp(wp({},Q1),n),{},{ticks:HQe(n),viewBox:{x:0,y:0,width:r,height:o}})),i.left,i.left+i.width,t)},Hsn=(e,t)=>{var{yAxis:n,width:r,height:o,offset:i}=e;return BQe(oxe(wp(wp(wp({},Q1),n),{},{ticks:HQe(n),viewBox:{x:0,y:0,width:r,height:o}})),i.top,i.top+i.height,t)},Vsn={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:Pl.grid};function kl(e){var t=Pge(),n=Age(),r=QQe(),o=wp(wp({},Hs(e,Vsn)),{},{x:Mr(e.x)?e.x:r.left,y:Mr(e.y)?e.y:r.top,width:Mr(e.width)?e.width:r.width,height:Mr(e.height)?e.height:r.height}),{xAxisId:i,yAxisId:s,x:l,y:c,width:u,height:d,syncWithTicks:p,horizontalValues:h,verticalValues:m}=o,g=Vu(),y=gr(_=>ePe(_,"xAxis",i,g)),x=gr(_=>ePe(_,"yAxis",s,g));if(!ob(u)||!ob(d)||!Mr(l)||!Mr(c))return null;var v=o.verticalCoordinatesGenerator||Bsn,b=o.horizontalCoordinatesGenerator||Hsn,{horizontalPoints:w,verticalPoints:S}=o;if((!w||!w.length)&&typeof b=="function"){var C=h&&h.length,N=b({yAxis:x?wp(wp({},x),{},{ticks:C?h:x.ticks}):void 0,width:t??u,height:n??d,offset:r},C?!0:p);lV(Array.isArray(N),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof N,"]")),Array.isArray(N)&&(w=N)}if((!S||!S.length)&&typeof v=="function"){var j=m&&m.length,I=v({xAxis:y?wp(wp({},y),{},{ticks:j?m:y.ticks}):void 0,width:t??u,height:n??d,offset:r},j?!0:p);lV(Array.isArray(I),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof I,"]")),Array.isArray(I)&&(S=I)}return f.createElement(id,{zIndex:o.zIndex},f.createElement("g",{className:"recharts-cartesian-grid"},f.createElement($sn,{fill:o.fill,fillOpacity:o.fillOpacity,x:o.x,y:o.y,width:o.width,height:o.height,ry:o.ry}),f.createElement(Fsn,Jj({},o,{horizontalPoints:w})),f.createElement(zsn,Jj({},o,{verticalPoints:S})),f.createElement(Dsn,Jj({},o,{offset:r,horizontalPoints:w,xAxis:y,yAxis:x})),f.createElement(Lsn,Jj({},o,{offset:r,verticalPoints:S,xAxis:y,yAxis:x}))))}kl.displayName="CartesianGrid";var Usn={},ytt=bm({name:"errorBars",initialState:Usn,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:o}=t.payload;e[n]&&(e[n]=e[n].map(i=>i.dataKey===r.dataKey&&i.direction===r.direction?o:i))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(o=>o.dataKey!==r.dataKey||o.direction!==r.direction))}}}),{addErrorBar:$no,replaceErrorBar:Dno,removeErrorBar:Lno}=ytt.actions,Wsn=ytt.reducer,Gsn=["children"];function qsn(e,t){if(e==null)return{};var n,r,o=Ksn(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r({x:0,y:0,value:0}),errorBarOffset:0},Xsn=f.createContext(Ysn);function vtt(e){var{children:t}=e,n=qsn(e,Gsn);return f.createElement(Xsn.Provider,{value:n},t)}function Zq(e,t){var n,r,o=gr(u=>Ib(u,e)),i=gr(u=>_b(u,t)),s=(n=o==null?void 0:o.allowDataOverflow)!==null&&n!==void 0?n:ef.allowDataOverflow,l=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:tf.allowDataOverflow,c=s||l;return{needClip:c,needClipX:s,needClipY:l}}function axe(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,o=Jq(),{needClipX:i,needClipY:s,needClip:l}=Zq(t,n);if(!l||!o)return null;var{x:c,y:u,width:d,height:p}=o;return f.createElement("clipPath",{id:"clipPath-".concat(r)},f.createElement("rect",{x:i?c:c-d/2,y:s?u:u-p/2,width:i?d:d*2,height:s?p:p*2}))}var btt=(e,t,n,r)=>lb(e,"xAxis",t,r),wtt=(e,t,n,r)=>sb(e,"xAxis",t,r),Stt=(e,t,n,r)=>lb(e,"yAxis",n,r),Ctt=(e,t,n,r)=>sb(e,"yAxis",n,r),Qsn=on([Ui,btt,Stt,wtt,Ctt],(e,t,n,r,o)=>q0(e,"xAxis")?ib(t,r,!1):ib(n,o,!1)),Jsn=(e,t,n,r,o)=>o;function Zsn(e){return e.type==="line"}var eln=on([jL,Jsn],(e,t)=>e.filter(Zsn).find(n=>n.id===t)),tln=on([Ui,btt,Stt,wtt,Ctt,eln,Qsn,i0e],(e,t,n,r,o,i,s,l)=>{var{chartData:c,dataStartIndex:u,dataEndIndex:d}=l;if(!(i==null||t==null||n==null||r==null||o==null||r.length===0||o.length===0||s==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:p,data:h}=i,m;if(h!=null&&h.length>0?m=h:m=c==null?void 0:c.slice(u,d+1),m!=null)return Fln({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:o,dataKey:p,bandSize:s,displayedData:m})}});function Ntt(e){var t=dw(e),n=3,r=2;if(t!=null){var{r:o,strokeWidth:i}=t,s=Number(o),l=Number(i);return(Number.isNaN(s)||s<0)&&(s=n),(Number.isNaN(l)||l<0)&&(l=r),{r:s,strokeWidth:l}}return{r:n,strokeWidth:r}}var VZ={exports:{}},UZ={};/** * @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 $Ae;function nln(){if($Ae)return UZ;$Ae=1;var e=ik();function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,s=e.useMemo,l=e.useDebugValue;return UZ.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var m=o(null);if(m.current===null){var g={hasValue:!1,value:null};m.current=g}else g=m.current;m=s(function(){function x(C){if(!v){if(v=!0,b=C,C=p(C),h!==void 0&&g.hasValue){var N=g.value;if(h(N,C))return w=N}return w=C}if(N=w,n(b,C))return N;var j=p(C);return h!==void 0&&h(N,j)?(b=C,N):(b=C,w=j)}var v=!1,b,w,S=d===void 0?null:d;return[function(){return x(u())},S===null?void 0:function(){return x(S())}]},[u,d,p,h]);var y=r(c,m[0],m[1]);return i(function(){g.hasValue=!0,g.value=y},[y]),l(y),y},UZ}var DAe;function rln(){return DAe||(DAe=1,VZ.exports=nln()),VZ.exports}rln();function oln(e){e()}function iln(){let e=null,t=null;return{clear(){e=null,t=null},notify(){oln(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var LAe={notify(){},get:()=>[]};function aln(e,t){let n,r=LAe,o=0,i=!1;function s(y){d();const x=r.subscribe(y);let v=!1;return()=>{v||(v=!0,x(),p())}}function l(){r.notify()}function c(){g.onStateChange&&g.onStateChange()}function u(){return i}function d(){o++,n||(n=e.subscribe(c),r=iln())}function p(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=LAe)}function h(){i||(i=!0,d())}function m(){i&&(i=!1,p())}const g={addNestedSub:s,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:u,trySubscribe:h,tryUnsubscribe:m,getListeners:()=>r};return g}var sln=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lln=sln(),cln=()=>typeof navigator<"u"&&navigator.product==="ReactNative",uln=cln(),dln=()=>lln||uln?f.useLayoutEffect:f.useEffect,fln=dln();function FAe(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function pln(e,t){if(FAe(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o{const c=aln(o);return{store:o,subscription:c,getServerState:r?()=>r:void 0}},[o,r]),s=f.useMemo(()=>o.getState(),[o]);fln(()=>{const{subscription:c}=i;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),s!==o.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[i,s]);const l=n||mln;return f.createElement(l.Provider,{value:i},t)}var xln=gln,yln=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function vln(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function OL(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(yln.has(r)){if(e[r]==null&&t[r]==null)continue;if(!pln(e[r],t[r]))return!1}else if(!vln(e[r],t[r]))return!1;return!0}var bln=["id"],wln=["type","layout","connectNulls","needClip","shape"],Sln=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function z3(){return z3=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,stroke:r,legendType:o,hide:i}=e;return[{inactive:i,dataKey:t,type:o,color:r,value:Eb(n,t),payload:e}]},_ln=f.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:o,fill:i,name:s,hide:l,unit:c,tooltipType:u,id:d}=e,p={dataDefinedOnItem:n,getPosition:Ey,settings:{stroke:r,strokeWidth:o,fill:i,dataKey:t,nameKey:void 0,name:Eb(s,t),hide:l,type:u,color:r,unit:c,graphicalItemId:d}};return f.createElement(ML,{tooltipEntrySettings:p})}),jtt=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function Pln(e,t){for(var n=e.length%2!==0?[...e,0]:e,r=[],o=0;o{var r=n.reduce((m,g)=>m+g);if(!r)return jtt(t,e);for(var o=Math.floor(e/r),i=e%r,s=t-e,l=[],c=0,u=0;ci){l=[...n.slice(0,c),i-u];break}}var h=l.length%2===0?[0,s]:[s];return[...Pln(n,o),...l,...h].map(m=>"".concat(m,"px")).join(", ")};function Tln(e){var{clipPathId:t,points:n,props:r}=e,{dot:o,dataKey:i,needClip:s}=r,{id:l}=r,c=sxe(r,bln),u=dl(c);return f.createElement(nxe,{points:n,dot:o,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:i,baseProps:u,needClip:s,clipPathId:t})}function kln(e){var{showLabels:t,children:n,points:r}=e,o=f.useMemo(()=>r==null?void 0:r.map(i=>{var s,l,c={x:(s=i.x)!==null&&s!==void 0?s:0,y:(l=i.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return wv(wv({},c),{},{value:i.value,payload:i.payload,viewBox:c,parentViewBox:void 0,fill:void 0})}),[r]);return f.createElement(Gq,{value:t?o:void 0},n)}function BAe(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:o,props:i}=e,{type:s,layout:l,connectNulls:c,needClip:u,shape:d}=i,p=sxe(i,wln),h=wv(wv({},iu(p)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:r,type:s,layout:l,connectNulls:c,strokeDasharray:o??i.strokeDasharray});return f.createElement(f.Fragment,null,(r==null?void 0:r.length)>1&&f.createElement(X0e,z3({shapeType:"curve",option:d},h,{pathRef:n})),f.createElement(Tln,{points:r,clipPathId:t,props:i}))}function Mln(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function Rln(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:o,longestAnimatedLengthRef:i}=e,{points:s,strokeDasharray:l,isAnimationActive:c,animationBegin:u,animationDuration:d,animationEasing:p,animateNewValues:h,width:m,height:g,onAnimationEnd:y,onAnimationStart:x}=n,v=o.current,b=t5(s,"recharts-line-"),w=f.useRef(b),[S,C]=f.useState(!1),N=!S,j=f.useCallback(()=>{typeof y=="function"&&y(),C(!1)},[y]),I=f.useCallback(()=>{typeof x=="function"&&x(),C(!0)},[x]),_=Mln(r.current),T=f.useRef(0);w.current!==b&&(T.current=i.current,w.current=b);var P=T.current;return f.createElement(kln,{points:s,showLabels:N},n.children,f.createElement(e5,{animationId:b,begin:u,duration:d,isActive:c,easing:p,onAnimationEnd:j,onAnimationStart:I,key:b},E=>{var M=ja(P,_+P,E),R=Math.min(M,_),$;if(c)if(l){var D="".concat(l).split(/[,\s]+/gim).map(B=>parseFloat(B));$=Aln(R,_,D)}else $=jtt(_,R);else $=l==null?void 0:String(l);if(E>0&&_>0&&(o.current=s,i.current=Math.max(i.current,R)),v){var z=v.length/s.length,V=E===1?s:s.map((B,G)=>{var H=Math.floor(G*z);if(v[H]){var F=v[H];return wv(wv({},B),{},{x:ja(F.x,B.x,E),y:ja(F.y,B.y,E)})}return h?wv(wv({},B),{},{x:ja(m*2,B.x,E),y:ja(g/2,B.y,E)}):wv(wv({},B),{},{x:B.x,y:B.y})});return o.current=V,f.createElement(BAe,{props:n,points:V,clipPathId:t,pathRef:r,strokeDasharray:$})}return f.createElement(BAe,{props:n,points:s,clipPathId:t,pathRef:r,strokeDasharray:$})}),f.createElement(kL,{label:n.label}))}function Oln(e){var{clipPathId:t,props:n}=e,r=f.useRef(null),o=f.useRef(0),i=f.useRef(null);return f.createElement(Rln,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:o,pathRef:i})}var $ln=(e,t)=>{var n,r;return{x:(n=e.x)!==null&&n!==void 0?n:void 0,y:(r=e.y)!==null&&r!==void 0?r:void 0,value:e.value,errorVal:La(e.payload,t)}};class Dln extends f.Component{render(){var{hide:t,dot:n,points:r,className:o,xAxisId:i,yAxisId:s,top:l,left:c,width:u,height:d,id:p,needClip:h,zIndex:m}=this.props;if(t)return null;var g=be("recharts-line",o),y=p,{r:x,strokeWidth:v}=Ntt(n),b=Y0e(n),w=x*2+v,S=h?"url(#clipPath-".concat(b?"":"dots-").concat(y,")"):void 0;return f.createElement(id,{zIndex:m},f.createElement(Ta,{className:g},h&&f.createElement("defs",null,f.createElement(axe,{clipPathId:y,xAxisId:i,yAxisId:s}),!b&&f.createElement("clipPath",{id:"clipPath-dots-".concat(y)},f.createElement("rect",{x:c-w/2,y:l-w/2,width:u+w,height:d+w}))),f.createElement(vtt,{xAxisId:i,yAxisId:s,data:r,dataPointFormatter:$ln,errorBarOffset:0},f.createElement(Oln,{props:this.props,clipPathId:y}))),f.createElement(LV,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:S}))}}var Ett={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:Pl.line,type:"linear"};function Lln(e){var t=Hs(e,Ett),{activeDot:n,animateNewValues:r,animationBegin:o,animationDuration:i,animationEasing:s,connectNulls:l,dot:c,hide:u,isAnimationActive:d,label:p,legendType:h,xAxisId:m,yAxisId:g,id:y}=t,x=sxe(t,Sln),{needClip:v}=Zq(m,g),b=Jq(),w=JC(),S=Vu(),C=gr(T=>tln(T,m,g,S,y));if(w!=="horizontal"&&w!=="vertical"||C==null||b==null)return null;var{height:N,width:j,x:I,y:_}=b;return f.createElement(Dln,z3({},x,{id:y,connectNulls:l,dot:c,activeDot:n,animateNewValues:r,animationBegin:o,animationDuration:i,animationEasing:s,isAnimationActive:d,hide:u,label:p,legendType:h,xAxisId:m,yAxisId:g,points:C,layout:w,height:N,width:j,left:I,top:_,needClip:v}))}function Fln(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:o,yAxisTicks:i,dataKey:s,bandSize:l,displayedData:c}=e;return c.map((u,d)=>{var p=La(u,s);if(t==="horizontal"){var h=sV({axis:n,ticks:o,bandSize:l,entry:u,index:d}),m=Ml(p)?null:r.scale.map(p);return{x:h,y:m??null,value:p,payload:u}}var g=Ml(p)?null:n.scale.map(p),y=sV({axis:r,ticks:i,bandSize:l,entry:u,index:d});return g==null||y==null?null:{x:g,y,value:p,payload:u}}).filter(Boolean)}function zln(e){var t=Hs(e,Ett),n=Vu();return f.createElement(RL,{id:t.id,type:"line"},r=>f.createElement(f.Fragment,null,f.createElement(exe,{legendPayload:Iln(t)}),f.createElement(_ln,{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:r}),f.createElement(txe,{type:"line",id:r,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),f.createElement(Lln,z3({},t,{id:r}))))}var au=f.memo(zln,OL);au.displayName="Line";function Ab(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(o=>o.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:itt}function Tb(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(o=>o.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:itt}var Itt=(e,t,n)=>lb(e,"xAxis",Ab(e,t),n),_tt=(e,t,n)=>sb(e,"xAxis",Ab(e,t),n),Ptt=(e,t,n)=>lb(e,"yAxis",Tb(e,t),n),Att=(e,t,n)=>sb(e,"yAxis",Tb(e,t),n),Bln=on([Ui,Itt,Ptt,_tt,Att],(e,t,n,r,o)=>q0(e,"xAxis")?ib(t,r,!1):ib(n,o,!1)),Hln=(e,t)=>t,Ttt=on([jL,Hln],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),ktt=e=>{var t=Ui(e),n=q0(t,"xAxis");return n?"yAxis":"xAxis"},Vln=(e,t)=>{var n=ktt(e);return n==="yAxis"?Tb(e,t):Ab(e,t)},Uln=(e,t,n)=>TV(e,ktt(e),Vln(e,t),n),Wln=on([Ttt,Uln],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,o=Dq(e);if(!(r==null||o==null)){var i=(n=t[r])===null||n===void 0?void 0:n.stackedData,s=i==null?void 0:i.find(l=>l.key===o);if(s!=null)return s.map(l=>[l[0],l[1]])}}}),Gln=on([Ui,Itt,Ptt,_tt,Att,Wln,nZe,Bln,Ttt,eJt],(e,t,n,r,o,i,s,l,c,u)=>{var{chartData:d,dataStartIndex:p,dataEndIndex:h}=s;if(!(c==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||o==null||r.length===0||o.length===0||l==null)){var{data:m}=c,g;if(m&&m.length>0?g=m:g=d==null?void 0:d.slice(p,h+1),g!=null)return dcn({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:o,dataStartIndex:p,areaSettings:c,stackedData:i,displayedData:g,chartBaseValue:u,bandSize:l})}}),qln=["id"],Kln=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function kE(){return kE=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,stroke:r,fill:o,legendType:i,hide:s}=e;return[{inactive:s,dataKey:t,type:i,color:HV(r,o),value:Eb(n,t),payload:e}]},ecn=f.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:o,fill:i,name:s,hide:l,unit:c,tooltipType:u,id:d}=e,p={dataDefinedOnItem:n,getPosition:Ey,settings:{stroke:r,strokeWidth:o,fill:i,dataKey:t,nameKey:void 0,name:Eb(s,t),hide:l,type:u,color:HV(r,i),unit:c,graphicalItemId:d}};return f.createElement(ML,{tooltipEntrySettings:p})});function tcn(e){var{clipPathId:t,points:n,props:r}=e,{needClip:o,dot:i,dataKey:s}=r,l=dl(r);return f.createElement(nxe,{points:n,dot:i,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:s,baseProps:l,needClip:o,clipPathId:t})}function ncn(e){var{showLabels:t,children:n,points:r}=e,o=r.map(i=>{var s,l,c={x:(s=i.x)!==null&&s!==void 0?s:0,y:(l=i.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return CP(CP({},c),{},{value:i.value,payload:i.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return f.createElement(Gq,{value:t?o:void 0},n)}function VAe(e){var{points:t,baseLine:n,needClip:r,clipPathId:o,props:i}=e,{layout:s,type:l,stroke:c,connectNulls:u,isRange:d}=i,{id:p}=i,h=Mtt(i,qln),m=dl(h),g=iu(h);return f.createElement(f.Fragment,null,(t==null?void 0:t.length)>1&&f.createElement(Ta,{clipPath:r?"url(#clipPath-".concat(o,")"):void 0},f.createElement(lA,kE({},g,{id:p,points:t,connectNulls:u,type:l,baseLine:n,layout:s,stroke:"none",className:"recharts-area-area"})),c!=="none"&&f.createElement(lA,kE({},m,{className:"recharts-area-curve",layout:s,type:l,connectNulls:u,fill:"none",points:t})),c!=="none"&&d&&f.createElement(lA,kE({},m,{className:"recharts-area-curve",layout:s,type:l,connectNulls:u,fill:"none",points:n}))),f.createElement(tcn,{points:t,props:h,clipPathId:o}))}function rcn(e){var t,n,{alpha:r,baseLine:o,points:i,strokeWidth:s}=e,l=(t=i[0])===null||t===void 0?void 0:t.y,c=(n=i[i.length-1])===null||n===void 0?void 0:n.y;if(!ci(l)||!ci(c))return null;var u=r*Math.abs(l-c),d=Math.max(...i.map(p=>p.x||0));return Mr(o)?d=Math.max(o,d):o&&Array.isArray(o)&&o.length&&(d=Math.max(...o.map(p=>p.x||0),d)),Mr(d)?f.createElement("rect",{x:0,y:lp.y||0));return Mr(o)?d=Math.max(o,d):o&&Array.isArray(o)&&o.length&&(d=Math.max(...o.map(p=>p.y||0),d)),Mr(d)?f.createElement("rect",{x:l({points:s,baseLine:l}),[s,l]),y=t5(g,"recharts-area-"),x=Tge(),[v,b]=f.useState(!1),w=!v,S=f.useCallback(()=>{typeof m=="function"&&m(),b(!1)},[m]),C=f.useCallback(()=>{typeof h=="function"&&h(),b(!0)},[h]);if(x==null)return null;var N=o.current,j=i.current;return f.createElement(ncn,{showLabels:w,points:s},r.children,f.createElement(e5,{animationId:y,begin:u,duration:d,isActive:c,easing:p,onAnimationEnd:S,onAnimationStart:C,key:y},I=>{if(N){var _=N.length/s.length,T=I===1?s:s.map((E,M)=>{var R=Math.floor(M*_);if(N[R]){var $=N[R];return CP(CP({},E),{},{x:ja($.x,E.x,I),y:ja($.y,E.y,I)})}return E}),P;return Mr(l)?P=ja(j,l,I):Ml(l)||dy(l)?P=ja(j,0,I):P=l.map((E,M)=>{var R=Math.floor(M*_);if(Array.isArray(j)&&j[R]){var $=j[R];return CP(CP({},E),{},{x:ja($.x,E.x,I),y:ja($.y,E.y,I)})}return E}),I>0&&(o.current=T,i.current=P),f.createElement(VAe,{points:T,baseLine:P,needClip:t,clipPathId:n,props:r})}return I>0&&(o.current=s,i.current=l),f.createElement(Ta,null,c&&f.createElement("defs",null,f.createElement("clipPath",{id:"animationClipPath-".concat(n)},f.createElement(icn,{alpha:I,points:s,baseLine:l,layout:x,strokeWidth:r.strokeWidth}))),f.createElement(Ta,{clipPath:"url(#animationClipPath-".concat(n,")")},f.createElement(VAe,{points:s,baseLine:l,needClip:t,clipPathId:n,props:r})))}),f.createElement(kL,{label:r.label}))}function scn(e){var{needClip:t,clipPathId:n,props:r}=e,o=f.useRef(null),i=f.useRef();return f.createElement(acn,{needClip:t,clipPathId:n,props:r,previousPointsRef:o,previousBaselineRef:i})}class lcn extends f.PureComponent{render(){var{hide:t,dot:n,points:r,className:o,top:i,left:s,needClip:l,xAxisId:c,yAxisId:u,width:d,height:p,id:h,baseLine:m,zIndex:g}=this.props;if(t)return null;var y=be("recharts-area",o),x=h,{r:v,strokeWidth:b}=Ntt(n),w=Y0e(n),S=v*2+b,C=l?"url(#clipPath-".concat(w?"":"dots-").concat(x,")"):void 0;return f.createElement(id,{zIndex:g},f.createElement(Ta,{className:y},l&&f.createElement("defs",null,f.createElement(axe,{clipPathId:x,xAxisId:c,yAxisId:u}),!w&&f.createElement("clipPath",{id:"clipPath-dots-".concat(x)},f.createElement("rect",{x:s-S/2,y:i-S/2,width:d+S,height:p+S}))),f.createElement(scn,{needClip:l,clipPathId:x,props:this.props})),f.createElement(LV,{points:r,mainColor:HV(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}),this.props.isRange&&Array.isArray(m)&&f.createElement(LV,{points:m,mainColor:HV(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:C}))}}var Rtt={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:Pl.area};function ccn(e){var t,n=Hs(e,Rtt),{activeDot:r,animationBegin:o,animationDuration:i,animationEasing:s,connectNulls:l,dot:c,fill:u,fillOpacity:d,hide:p,isAnimationActive:h,legendType:m,stroke:g,xAxisId:y,yAxisId:x}=n,v=Mtt(n,Kln),b=JC(),w=yet(),{needClip:S}=Zq(y,x),C=Vu(),{points:N,isRange:j,baseLine:I}=(t=gr(R=>Gln(R,e.id,C)))!==null&&t!==void 0?t:{},_=Jq();if(b!=="horizontal"&&b!=="vertical"||_==null||w!=="AreaChart"&&w!=="ComposedChart")return null;var{height:T,width:P,x:E,y:M}=_;return!N||!N.length?null:f.createElement(lcn,kE({},v,{activeDot:r,animationBegin:o,animationDuration:i,animationEasing:s,baseLine:I,connectNulls:l,dot:c,fill:u,fillOpacity:d,height:T,hide:p,layout:b,isAnimationActive:h==="auto"?!gL.isSsr:h,isRange:j,legendType:m,needClip:S,points:N,stroke:g,width:P,left:E,top:M,xAxisId:y,yAxisId:x}))}var ucn=(e,t,n,r,o)=>{var i=n??t;if(Mr(i))return i;var s=e==="horizontal"?o:r,l=s.scale.domain();if(s.type==="number"){var c=Math.max(l[0],l[1]),u=Math.min(l[0],l[1]);return i==="dataMin"?u:i==="dataMax"||c<0?c:Math.max(Math.min(l[0],l[1]),0)}return i==="dataMin"?l[0]:i==="dataMax"?l[1]:l[0]};function dcn(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:o,layout:i,chartBaseValue:s,xAxis:l,yAxis:c,displayedData:u,dataStartIndex:d,xAxisTicks:p,yAxisTicks:h,bandSize:m}=e,g=o&&o.length,y=ucn(i,s,n,l,c),x=i==="horizontal",v=!1,b=u.map((S,C)=>{var N,j,I,_;if(g)_=o[d+C];else{var T=La(S,r);Array.isArray(T)?(_=T,v=!0):_=[y,T]}var P=(N=(j=_)===null||j===void 0?void 0:j[1])!==null&&N!==void 0?N:null,E=P==null||g&&!t&&La(S,r)==null;if(x){var M;return{x:sV({axis:l,ticks:p,bandSize:m,entry:S,index:C}),y:E?null:(M=c.scale.map(P))!==null&&M!==void 0?M:null,value:_,payload:S}}return{x:E?null:(I=l.scale.map(P))!==null&&I!==void 0?I:null,y:sV({axis:c,ticks:h,bandSize:m,entry:S,index:C}),value:_,payload:S}}),w;return g||v?w=b.map(S=>{var C,N=Array.isArray(S.value)?S.value[0]:null;if(x){var j;return{x:S.x,y:N!=null&&S.y!=null&&(j=c.scale.map(N))!==null&&j!==void 0?j:null,payload:S.payload}}return{x:N!=null&&(C=l.scale.map(N))!==null&&C!==void 0?C:null,y:S.y,payload:S.payload}}):w=x?c.scale.map(y):l.scale.map(y),{points:b,baseLine:w??0,isRange:v}}function fcn(e){var t=Hs(e,Rtt),n=Vu();return f.createElement(RL,{id:t.id,type:"area"},r=>f.createElement(f.Fragment,null,f.createElement(exe,{legendPayload:Zln(t)}),f.createElement(ecn,{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:r}),f.createElement(txe,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:VQe(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),f.createElement(ccn,kE({},t,{id:r}))))}var hu=f.memo(fcn,OL);hu.displayName="Area";var pcn="Invariant failed";function hcn(e,t){throw new Error(pcn)}function Hae(){return Hae=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:0;return(r,o)=>{if(Mr(t))return t;var i=Mr(r)||Ml(r);return i?t(r,o):(i||hcn(),n)}},gcn=(e,t,n)=>n,xcn=(e,t)=>t,$L=on([jL,xcn],(e,t)=>e.filter(n=>n.type==="bar").find(n=>n.id===t)),ycn=on([$L],e=>e==null?void 0:e.maxBarSize),vcn=(e,t,n,r)=>r,bcn=on([Ui,jL,Ab,Tb,gcn],(e,t,n,r,o)=>t.filter(i=>e==="horizontal"?i.xAxisId===n:i.yAxisId===r).filter(i=>i.isPanorama===o).filter(i=>i.hide===!1).filter(i=>i.type==="bar")),wcn=(e,t,n)=>{var r=Ui(e),o=Ab(e,t),i=Tb(e,t);if(!(o==null||i==null))return r==="horizontal"?TV(e,"yAxis",i,n):TV(e,"xAxis",o,n)},Scn=(e,t)=>{var n=Ui(e),r=Ab(e,t),o=Tb(e,t);if(!(r==null||o==null))return n==="horizontal"?Z_e(e,"xAxis",r):Z_e(e,"yAxis",o)},Ccn=on([bcn,ZQt,Scn],nan),Ncn=(e,t,n)=>{var r,o,i=$L(e,t);if(i==null)return 0;var s=Ab(e,t),l=Tb(e,t);if(s==null||l==null)return 0;var c=Ui(e),u=hZe(e),{maxBarSize:d}=i,p=Ml(d)?u:d,h,m;return c==="horizontal"?(h=lb(e,"xAxis",s,n),m=sb(e,"xAxis",s,n)):(h=lb(e,"yAxis",l,n),m=sb(e,"yAxis",l,n)),(r=(o=ib(h,m,!0))!==null&&o!==void 0?o:p)!==null&&r!==void 0?r:0},Ott=(e,t,n)=>{var r=Ui(e),o=Ab(e,t),i=Tb(e,t);if(!(o==null||i==null)){var s,l;return r==="horizontal"?(s=lb(e,"xAxis",o,n),l=sb(e,"xAxis",o,n)):(s=lb(e,"yAxis",i,n),l=sb(e,"yAxis",i,n)),ib(s,l)}},jcn=on([Ccn,hZe,JQt,mZe,Ncn,Ott,ycn],san),Ecn=(e,t,n)=>{var r=Ab(e,t);if(r!=null)return lb(e,"xAxis",r,n)},Icn=(e,t,n)=>{var r=Tb(e,t);if(r!=null)return lb(e,"yAxis",r,n)},_cn=(e,t,n)=>{var r=Ab(e,t);if(r!=null)return sb(e,"xAxis",r,n)},Pcn=(e,t,n)=>{var r=Tb(e,t);if(r!=null)return sb(e,"yAxis",r,n)},Acn=on([jcn,$L],can),Tcn=on([wcn,$L],lan),kcn=on([Dd,Ege,Ecn,Icn,_cn,Pcn,Acn,Ui,nZe,Ott,Tcn,$L,vcn],(e,t,n,r,o,i,s,l,c,u,d,p,h)=>{var{chartData:m,dataStartIndex:g,dataEndIndex:y}=c;if(!(p==null||s==null||t==null||l!=="horizontal"&&l!=="vertical"||n==null||r==null||o==null||i==null||u==null)){var{data:x}=p,v;if(x!=null&&x.length>0?v=x:v=m==null?void 0:m.slice(g,y+1),v!=null)return aun({layout:l,barSettings:p,pos:s,parentViewBox:t,bandSize:u,xAxis:n,yAxis:r,xAxisTicks:o,yAxisTicks:i,stackedData:d,displayedData:v,offset:e,cells:h,dataStartIndex:g})}}),Mcn=["index"];function Vae(){return Vae=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=f.useContext($tt);if(t!=null)return t.stackId;if(e!=null)return VQe(e)},Dcn=(e,t)=>"recharts-bar-stack-clip-path-".concat(e,"-").concat(t),Lcn=e=>{var t=f.useContext($tt);if(t!=null){var{stackId:n}=t;return"url(#".concat(Dcn(n,e),")")}},Dtt=e=>{var{index:t}=e,n=Rcn(e,Mcn),r=Lcn(t);return f.createElement(Ta,Vae({className:"recharts-bar-stack-layer",clipPath:r},n))},Fcn=["onMouseEnter","onMouseLeave","onClick"],zcn=["value","background","tooltipPosition"],Bcn=["id"],Hcn=["onMouseEnter","onClick","onMouseLeave"];function yw(){return yw=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,fill:r,legendType:o,hide:i}=e;return[{inactive:i,dataKey:t,type:o,color:r,value:Eb(n,t),payload:e}]},Kcn=f.memo(e=>{var{dataKey:t,stroke:n,strokeWidth:r,fill:o,name:i,hide:s,unit:l,tooltipType:c,id:u}=e,d={dataDefinedOnItem:void 0,getPosition:Ey,settings:{stroke:n,strokeWidth:r,fill:o,dataKey:t,nameKey:void 0,name:Eb(i,t),hide:s,type:c,color:o,unit:l,graphicalItemId:u}};return f.createElement(ML,{tooltipEntrySettings:d})});function Ycn(e){var t=gr(jC),{data:n,dataKey:r,background:o,allOtherBarProps:i}=e,{onMouseEnter:s,onMouseLeave:l,onClick:c}=i,u=UV(i,Fcn),d=Q0e(s,r,i.id),p=J0e(l),h=Z0e(c,r,i.id);if(!o||n==null)return null;var m=dw(o);return f.createElement(id,{zIndex:uan(o,Pl.barBackground)},n.map((g,y)=>{var{value:x,background:v,tooltipPosition:b}=g,w=UV(g,zcn);if(!v)return null;var S=d(g,y),C=p(g,y),N=h(g,y),j=ch(ch(ch(ch(ch({option:o,isActive:String(y)===t},w),{},{fill:"#eee"},v),m),ZI(u,g,y)),{},{onMouseEnter:S,onMouseLeave:C,onClick:N,dataKey:r,index:y,className:"recharts-bar-background-rectangle"});return f.createElement(VV,yw({key:"background-bar-".concat(y)},j))}))}function Xcn(e){var{showLabels:t,children:n,rects:r}=e,o=r==null?void 0:r.map(i=>{var s={x:i.x,y:i.y,width:i.width,lowerWidth:i.width,upperWidth:i.width,height:i.height};return ch(ch({},s),{},{value:i.value,payload:i.payload,parentViewBox:i.parentViewBox,viewBox:s,fill:i.fill})});return f.createElement(Gq,{value:t?o:void 0},n)}function Qcn(e){var{shape:t,activeBar:n,baseProps:r,entry:o,index:i,dataKey:s}=e,l=gr(jC),c=gr(O0e),u=n&&String(i)===l&&(c==null||s===c),d=u?n:t;return u?f.createElement(id,{zIndex:Pl.activeBar},f.createElement(Dtt,{index:i},f.createElement(VV,yw({},r,{name:String(r.name)},o,{isActive:u,option:d,index:i,dataKey:s})))):f.createElement(VV,yw({},r,{name:String(r.name)},o,{isActive:u,option:d,index:i,dataKey:s}))}function Jcn(e){var{shape:t,baseProps:n,entry:r,index:o,dataKey:i}=e;return f.createElement(VV,yw({},n,{name:String(n.name)},r,{isActive:!1,option:t,index:o,dataKey:i}))}function Zcn(e){var t,{data:n,props:r}=e,o=(t=dl(r))!==null&&t!==void 0?t:{},{id:i}=o,s=UV(o,Bcn),{shape:l,dataKey:c,activeBar:u}=r,{onMouseEnter:d,onClick:p,onMouseLeave:h}=r,m=UV(r,Hcn),g=Q0e(d,c,i),y=J0e(h),x=Z0e(p,c,i);return n?f.createElement(f.Fragment,null,n.map((v,b)=>f.createElement(Dtt,yw({index:b,key:"rectangle-".concat(v==null?void 0:v.x,"-").concat(v==null?void 0:v.y,"-").concat(v==null?void 0:v.value,"-").concat(b),className:"recharts-bar-rectangle"},ZI(m,v,b),{onMouseEnter:g(v,b),onMouseLeave:y(v,b),onClick:x(v,b)}),u?f.createElement(Qcn,{shape:l,activeBar:u,baseProps:s,entry:v,index:b,dataKey:c}):f.createElement(Jcn,{shape:l,baseProps:s,entry:v,index:b,dataKey:c})))):null}function eun(e){var{props:t,previousRectanglesRef:n}=e,{data:r,layout:o,isAnimationActive:i,animationBegin:s,animationDuration:l,animationEasing:c,onAnimationEnd:u,onAnimationStart:d}=t,p=n.current,h=t5(t,"recharts-bar-"),[m,g]=f.useState(!1),y=!m,x=f.useCallback(()=>{typeof u=="function"&&u(),g(!1)},[u]),v=f.useCallback(()=>{typeof d=="function"&&d(),g(!0)},[d]);return f.createElement(Xcn,{showLabels:y,rects:r},f.createElement(e5,{animationId:h,begin:s,duration:l,isActive:i,easing:c,onAnimationEnd:x,onAnimationStart:v,key:h},b=>{var w=b===1?r:r==null?void 0:r.map((S,C)=>{var N=p&&p[C];if(N)return ch(ch({},S),{},{x:ja(N.x,S.x,b),y:ja(N.y,S.y,b),width:ja(N.width,S.width,b),height:ja(N.height,S.height,b)});if(o==="horizontal"){var j=ja(0,S.height,b),I=ja(S.stackedBarStart,S.y,b);return ch(ch({},S),{},{y:I,height:j})}var _=ja(0,S.width,b),T=ja(S.stackedBarStart,S.x,b);return ch(ch({},S),{},{width:_,x:T})});return b>0&&(n.current=w??null),w==null?null:f.createElement(Ta,null,f.createElement(Zcn,{props:t,data:w}))}),f.createElement(kL,{label:t.label}),t.children)}function tun(e){var t=f.useRef(null);return f.createElement(eun,{previousRectanglesRef:t,props:e})}var Ltt=0,nun=(e,t)=>{var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:La(e,t)}};class run extends f.PureComponent{render(){var{hide:t,data:n,dataKey:r,className:o,xAxisId:i,yAxisId:s,needClip:l,background:c,id:u}=this.props;if(t||n==null)return null;var d=be("recharts-bar",o),p=u;return f.createElement(Ta,{className:d,id:u},l&&f.createElement("defs",null,f.createElement(axe,{clipPathId:p,xAxisId:i,yAxisId:s})),f.createElement(Ta,{className:"recharts-bar-rectangles",clipPath:l?"url(#clipPath-".concat(p,")"):void 0},f.createElement(Ycn,{data:n,dataKey:r,background:c,allOtherBarProps:this.props}),f.createElement(tun,this.props)))}}var oun={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",background:!1,hide:!1,isAnimationActive:"auto",label:!1,legendType:"rect",minPointSize:Ltt,xAxisId:0,yAxisId:0,zIndex:Pl.bar};function iun(e){var{xAxisId:t,yAxisId:n,hide:r,legendType:o,minPointSize:i,activeBar:s,animationBegin:l,animationDuration:c,animationEasing:u,isAnimationActive:d}=e,{needClip:p}=Zq(t,n),h=JC(),m=Vu(),g=K0e(e.children,Eh),y=gr(b=>kcn(b,e.id,m,g));if(h!=="vertical"&&h!=="horizontal")return null;var x,v=y==null?void 0:y[0];return v==null||v.height==null||v.width==null?x=0:x=h==="vertical"?v.height/2:v.width/2,f.createElement(vtt,{xAxisId:t,yAxisId:n,data:y,dataPointFormatter:nun,errorBarOffset:x},f.createElement(run,yw({},e,{layout:h,needClip:p,data:y,xAxisId:t,yAxisId:n,hide:r,legendType:o,minPointSize:i,activeBar:s,animationBegin:l,animationDuration:c,animationEasing:u,isAnimationActive:d})))}function aun(e){var{layout:t,barSettings:{dataKey:n,minPointSize:r},pos:o,bandSize:i,xAxis:s,yAxis:l,xAxisTicks:c,yAxisTicks:u,stackedData:d,displayedData:p,offset:h,cells:m,parentViewBox:g,dataStartIndex:y}=e,x=t==="horizontal"?l:s,v=d?x.scale.domain():null,b=RGt({numericAxis:x}),w=x.scale.map(b);return p.map((S,C)=>{var N,j,I,_,T,P;if(d){var E=d[C+y];if(E==null)return null;N=PGt(E,v)}else N=La(S,n),Array.isArray(N)||(N=[b,N]);var M=mcn(r,Ltt)(N[1],C);if(t==="horizontal"){var R,$=l.scale.map(N[0]),D=l.scale.map(N[1]);if($==null||D==null)return null;j=QIe({axis:s,ticks:c,bandSize:i,offset:o.offset,entry:S,index:C}),I=(R=D??$)!==null&&R!==void 0?R:void 0,_=o.size;var z=$-D;if(T=dy(z)?0:z,P={x:j,y:h.top,width:_,height:h.height},Math.abs(M)>0&&Math.abs(T)0&&Math.abs(_)f.createElement(f.Fragment,null,f.createElement(exe,{legendPayload:qcn(t)}),f.createElement(Kcn,{dataKey:t.dataKey,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:o}),f.createElement(txe,{type:"bar",id:o,data:void 0,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,stackId:n,hide:t.hide,barSize:t.barSize,minPointSize:t.minPointSize,maxBarSize:t.maxBarSize,isPanorama:r}),f.createElement(id,{zIndex:t.zIndex},f.createElement(iun,yw({},t,{id:o})))))}var cf=f.memo(sun,OL);cf.displayName="Bar";var lun=["domain","range"],cun=["domain","range"];function WAe(e,t){if(e==null)return{};var n,r,o=uun(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r{if(s!=null)return KAe(KAe({},i),{},{type:s})},[i,s]);return f.useLayoutEffect(()=>{l!=null&&(n.current===null?t(din(l)):n.current!==l&&t(fin({prev:n.current,next:l})),n.current=l)},[l,t]),f.useLayoutEffect(()=>()=>{n.current&&(t(pin(n.current)),n.current=null)},[t]),null}var vun=e=>{var{xAxisId:t,className:n}=e,r=gr(Ege),o=Vu(),i="xAxis",s=gr(v=>qZe(v,i,t,o)),l=gr(v=>VZe(v,t)),c=gr(v=>nZt(v,t)),u=gr(v=>NZe(v,t));if(l==null||c==null||u==null)return null;var{dangerouslySetInnerHTML:d,ticks:p,scale:h}=e,m=Wae(e,fun),{id:g,scale:y}=u,x=Wae(u,pun);return f.createElement(ixe,Uae({},m,x,{x:c.x,y:c.y,width:l.width,height:l.height,className:be("recharts-".concat(i," ").concat(i),n),viewBox:r,ticks:s,axisType:i}))},bun={allowDataOverflow:ef.allowDataOverflow,allowDecimals:ef.allowDecimals,allowDuplicatedCategory:ef.allowDuplicatedCategory,angle:ef.angle,axisLine:Q1.axisLine,height:ef.height,hide:!1,includeHidden:ef.includeHidden,interval:ef.interval,label:!1,minTickGap:ef.minTickGap,mirror:ef.mirror,orientation:ef.orientation,padding:ef.padding,reversed:ef.reversed,scale:ef.scale,tick:ef.tick,tickCount:ef.tickCount,tickLine:Q1.tickLine,tickSize:Q1.tickSize,type:ef.type,xAxisId:0},wun=e=>{var t=Hs(e,bun);return f.createElement(f.Fragment,null,f.createElement(yun,{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}),f.createElement(vun,t))},Ka=f.memo(wun,Ftt);Ka.displayName="XAxis";var Sun=["type"],Cun=["dangerouslySetInnerHTML","ticks","scale"],Nun=["id","scale"];function Gae(){return Gae=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(s!=null)return XAe(XAe({},i),{},{type:s})},[s,i]);return f.useLayoutEffect(()=>{l!=null&&(n.current===null?t(hin(l)):n.current!==l&&t(min({prev:n.current,next:l})),n.current=l)},[l,t]),f.useLayoutEffect(()=>()=>{n.current&&(t(gin(n.current)),n.current=null)},[t]),null}function Aun(e){var{yAxisId:t,className:n,width:r,label:o}=e,i=f.useRef(null),s=f.useRef(null),l=gr(Ege),c=Vu(),u=fs(),d="yAxis",p=gr(N=>UZe(N,t)),h=gr(N=>oZt(N,t)),m=gr(N=>qZe(N,d,t,c)),g=gr(N=>jZe(N,t));if(f.useLayoutEffect(()=>{if(!(r!=="auto"||!p||z0e(o)||f.isValidElement(o)||g==null)){var N=i.current;if(N){var j=N.getCalculatedWidth();Math.round(p.width)!==Math.round(j)&&u(xin({id:t,width:j}))}}},[m,p,u,o,t,r,g]),p==null||h==null||g==null)return null;var{dangerouslySetInnerHTML:y,ticks:x,scale:v}=e,b=qae(e,Cun),{id:w,scale:S}=g,C=qae(g,Nun);return f.createElement(ixe,Gae({},b,C,{ref:i,labelRef:s,x:h.x,y:h.y,tickTextProps:r==="auto"?{width:void 0}:{width:r},width:p.width,height:p.height,className:be("recharts-".concat(d," ").concat(d),n),viewBox:l,ticks:m,axisType:d}))}var Tun={allowDataOverflow:tf.allowDataOverflow,allowDecimals:tf.allowDecimals,allowDuplicatedCategory:tf.allowDuplicatedCategory,angle:tf.angle,axisLine:Q1.axisLine,hide:!1,includeHidden:tf.includeHidden,interval:tf.interval,label:!1,minTickGap:tf.minTickGap,mirror:tf.mirror,orientation:tf.orientation,padding:tf.padding,reversed:tf.reversed,scale:tf.scale,tick:tf.tick,tickCount:tf.tickCount,tickLine:Q1.tickLine,tickSize:Q1.tickSize,type:tf.type,width:tf.width,yAxisId:0},kun=e=>{var t=Hs(e,Tun);return f.createElement(f.Fragment,null,f.createElement(Pun,{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}),f.createElement(Aun,t))},ra=f.memo(kun,Ftt);ra.displayName="YAxis";var Mun=(e,t)=>t,lxe=on([Mun,Ui,Sk,bf,fet,Gw,xen,Dd],Nen),cxe=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,r=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/r)}},ztt=R0("mouseClick"),Btt=uL();Btt.startListening({actionCreator:ztt,effect:(e,t)=>{var n=e.payload,r=lxe(t.getState(),cxe(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(gZt({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var Kae=R0("mouseMove"),Htt=uL(),hF=null;Htt.startListening({actionCreator:Kae,effect:(e,t)=>{var n=e.payload;hF!==null&&cancelAnimationFrame(hF);var r=cxe(n);hF=requestAnimationFrame(()=>{var o=t.getState(),i=P0e(o,o.tooltip.settings.shared);if(i==="axis"){var s=lxe(o,r);(s==null?void 0:s.activeIndex)!=null?t.dispatch(net({activeIndex:s.activeIndex,activeDataKey:void 0,activeCoordinate:s.activeCoordinate})):t.dispatch(tet())}hF=null})}});function Run(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?"<>":t}var QAe={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},Vtt=bm({name:"rootProps",initialState:QAe,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:QAe.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}}}),Oun=Vtt.reducer,{updateOptions:$un}=Vtt.actions,Dun=null,Lun={updatePolarOptions:(e,t)=>t.payload},Utt=bm({name:"polarOptions",initialState:Dun,reducers:Lun}),{updatePolarOptions:Fun}=Utt.actions,zun=Utt.reducer,Wtt=R0("keyDown"),Gtt=R0("focus"),uxe=uL();uxe.startListening({actionCreator:Wtt,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:o}=n.tooltip,i=e.payload;if(!(i!=="ArrowRight"&&i!=="ArrowLeft"&&i!=="Enter")){var s=A0e(o,Ik(n),IL(n),AL(n)),l=s==null?-1:Number(s);if(!(!Number.isFinite(l)||l<0)){var c=Gw(n);if(i==="Enter"){var u=MV(n,"axis","hover",String(o.index));t.dispatch(Rae({active:!o.active,activeIndex:o.index,activeCoordinate:u}));return}var d=aZt(n),p=d==="left-to-right"?1:-1,h=i==="ArrowRight"?1:-1,m=l+h*p;if(!(c==null||m>=c.length||m<0)){var g=MV(n,"axis","hover",String(m));t.dispatch(Rae({active:!0,activeIndex:m.toString(),activeCoordinate:g}))}}}}}});uxe.startListening({actionCreator:Gtt,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:o}=n.tooltip;if(!o.active&&o.index==null){var i="0",s=MV(n,"axis","hover",String(i));t.dispatch(Rae({active:!0,activeIndex:i,activeCoordinate:s}))}}}});var Hg=R0("externalEvent"),qtt=uL(),qZ=new Map;qtt.startListening({actionCreator:Hg,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){r.persist();var o=r.type,i=qZ.get(o);i!==void 0&&cancelAnimationFrame(i);var s=requestAnimationFrame(()=>{try{var l=t.getState(),c={activeCoordinate:nen(l),activeDataKey:O0e(l),activeIndex:jC(l),activeLabel:met(l),activeTooltipIndex:jC(l),isTooltipActive:ren(l)};n(c,r)}finally{qZ.delete(o)}});qZ.set(o,s)}}});var Bun=on([jk],e=>e.tooltipItemPayloads),Hun=on([Bun,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(i=>i.settings.graphicalItemId===n);if(r!=null){var{getPosition:o}=r;if(o!=null)return o(t)}}}),Ktt=R0("touchMove"),Ytt=uL();Ytt.startListening({actionCreator:Ktt,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var r=t.getState(),o=P0e(r,r.tooltip.settings.shared);if(o==="axis"){var i=n.touches[0];if(i==null)return;var s=lxe(r,cxe({clientX:i.clientX,clientY:i.clientY,currentTarget:n.currentTarget}));(s==null?void 0:s.activeIndex)!=null&&t.dispatch(net({activeIndex:s.activeIndex,activeDataKey:void 0,activeCoordinate:s.activeCoordinate}))}else if(o==="item"){var l,c=n.touches[0];if(document.elementFromPoint==null||c==null)return;var u=document.elementFromPoint(c.clientX,c.clientY);if(!u||!u.getAttribute)return;var d=u.getAttribute(WQe),p=(l=u.getAttribute(GQe))!==null&&l!==void 0?l:void 0,h=Ek(r).find(y=>y.id===p);if(d==null||h==null||p==null)return;var{dataKey:m}=h,g=Hun(r,d,p);t.dispatch(eet({activeDataKey:m,activeIndex:d,activeCoordinate:g,activeGraphicalItemId:p}))}}}});var Vun=fQe({brush:wan,cartesianAxis:yin,chartData:etn,errorBars:Wsn,graphicalItems:Ion,layout:NGt,legend:Aqt,options:Xen,polarAxis:prn,polarOptions:zun,referenceElements:Van,rootProps:Oun,tooltip:xZt,zIndex:Len}),Uun=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return YWt({reducer:Vun,preloadedState:t,middleware:r=>{var o;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((o="es6")!==null&&o!==void 0?o:"")}).concat([Btt.middleware,Htt.middleware,uxe.middleware,qtt.middleware,Ytt.middleware])},enhancers:r=>{var o=r;return typeof r=="function"&&(o=r()),o.concat(IQe({type:"raf"}))},devTools:{serialize:{replacer:Run},name:"recharts-".concat(n)}})};function Xtt(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,o=Vu(),i=f.useRef(null);if(o)return n;i.current==null&&(i.current=Uun(t,r));var s=yge;return f.createElement(xln,{context:s,store:i.current},n)}function Wun(e){var{layout:t,margin:n}=e,r=fs(),o=Vu();return f.useEffect(()=>{o||(r(wGt(t)),r(bGt(n)))},[r,o,t,n]),null}var Qtt=f.memo(Wun,OL);function Jtt(e){var t=fs();return f.useEffect(()=>{t($un(e))},[t,e]),null}function JAe(e){var{zIndex:t,isPanorama:n}=e,r=f.useRef(null),o=fs();return f.useLayoutEffect(()=>(r.current&&o($en({zIndex:t,element:r.current,isPanorama:n})),()=>{o(Den({zIndex:t,isPanorama:n}))}),[o,t,n]),f.createElement("g",{tabIndex:-1,ref:r})}function ZAe(e){var{children:t,isPanorama:n}=e,r=gr(Een);if(!r||r.length===0)return t;var o=r.filter(s=>s<0),i=r.filter(s=>s>0);return f.createElement(f.Fragment,null,o.map(s=>f.createElement(JAe,{key:s,zIndex:s,isPanorama:n})),t,i.map(s=>f.createElement(JAe,{key:s,zIndex:s,isPanorama:n})))}var Gun=["children"];function qun(e,t){if(e==null)return{};var n,r,o=Kun(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r{var n=Pge(),r=Age(),o=cJe();if(!ob(n)||!ob(r))return null;var{children:i,otherAttributes:s,title:l,desc:c}=e,u,d;return s!=null&&(typeof s.tabIndex=="number"?u=s.tabIndex:u=o?0:void 0,typeof s.role=="string"?d=s.role:d=o?"application":void 0),f.createElement(ige,WV({},s,{title:l,desc:c,role:d,tabIndex:u,width:n,height:r,style:Yun,ref:t}),i)}),Qun=e=>{var{children:t}=e,n=gr(fL);if(!n)return null;var{width:r,height:o,y:i,x:s}=n;return f.createElement(ige,{width:r,height:o,x:s,y:i},t)},eTe=f.forwardRef((e,t)=>{var{children:n}=e,r=qun(e,Gun),o=Vu();return o?f.createElement(Qun,null,f.createElement(ZAe,{isPanorama:!0},n)):f.createElement(Xun,WV({ref:t},r),f.createElement(ZAe,{isPanorama:!1},n))});function Jun(){var e=fs(),[t,n]=f.useState(null),r=gr(zGt);return f.useEffect(()=>{if(t!=null){var o=t.getBoundingClientRect(),i=o.width/t.offsetWidth;ci(i)&&i!==r&&e(CGt(i))}},[t,e,r]),n}function tTe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Zun(e){for(var t=1;t(ctn(),null);function GV(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var odn=f.forwardRef((e,t)=>{var n,r,o=f.useRef(null),[i,s]=f.useState({containerWidth:GV((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:GV((r=e.style)===null||r===void 0?void 0:r.height)}),l=f.useCallback((u,d)=>{s(p=>{var h=Math.round(u),m=Math.round(d);return p.containerWidth===h&&p.containerHeight===m?p:{containerWidth:h,containerHeight:m}})},[]),c=f.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:p}=u.getBoundingClientRect();l(d,p);var h=g=>{var y=g[0];if(y!=null){var{width:x,height:v}=y.contentRect;l(x,v)}},m=new ResizeObserver(h);m.observe(u),o.current=m}},[t,l]);return f.useEffect(()=>()=>{var u=o.current;u!=null&&u.disconnect()},[l]),f.createElement(f.Fragment,null,f.createElement(hL,{width:i.containerWidth,height:i.containerHeight}),f.createElement("div",rC({ref:c},e)))}),idn=f.forwardRef((e,t)=>{var{width:n,height:r}=e,[o,i]=f.useState({containerWidth:GV(n),containerHeight:GV(r)}),s=f.useCallback((c,u)=>{i(d=>{var p=Math.round(c),h=Math.round(u);return d.containerWidth===p&&d.containerHeight===h?d:{containerWidth:p,containerHeight:h}})},[]),l=f.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();s(u,d)}},[t,s]);return f.createElement(f.Fragment,null,f.createElement(hL,{width:o.containerWidth,height:o.containerHeight}),f.createElement("div",rC({ref:l},e)))}),adn=f.forwardRef((e,t)=>{var{width:n,height:r}=e;return f.createElement(f.Fragment,null,f.createElement(hL,{width:n,height:r}),f.createElement("div",rC({ref:t},e)))}),sdn=f.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?f.createElement(idn,rC({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?f.createElement(adn,rC({},e,{width:n,height:r,ref:t})):f.createElement(f.Fragment,null,f.createElement(hL,{width:n,height:r}),f.createElement("div",rC({ref:t},e)))});function ldn(e){return e?odn:sdn}var cdn=f.forwardRef((e,t)=>{var{children:n,className:r,height:o,onClick:i,onContextMenu:s,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:p,onMouseUp:h,onTouchEnd:m,onTouchMove:g,onTouchStart:y,style:x,width:v,responsive:b,dispatchTouchEvents:w=!0}=e,S=f.useRef(null),C=fs(),[N,j]=f.useState(null),[I,_]=f.useState(null),T=Jun(),P=Ige(),E=(P==null?void 0:P.width)>0?P.width:v,M=(P==null?void 0:P.height)>0?P.height:o,R=f.useCallback(re=>{T(re),typeof t=="function"&&t(re),j(re),_(re),re!=null&&(S.current=re)},[T,t,j,_]),$=f.useCallback(re=>{C(ztt(re)),C(Hg({handler:i,reactEvent:re}))},[C,i]),D=f.useCallback(re=>{C(Kae(re)),C(Hg({handler:u,reactEvent:re}))},[C,u]),z=f.useCallback(re=>{C(tet()),C(Hg({handler:d,reactEvent:re}))},[C,d]),V=f.useCallback(re=>{C(Kae(re)),C(Hg({handler:p,reactEvent:re}))},[C,p]),B=f.useCallback(()=>{C(Gtt())},[C]),G=f.useCallback(re=>{C(Wtt(re.key))},[C]),H=f.useCallback(re=>{C(Hg({handler:s,reactEvent:re}))},[C,s]),F=f.useCallback(re=>{C(Hg({handler:l,reactEvent:re}))},[C,l]),W=f.useCallback(re=>{C(Hg({handler:c,reactEvent:re}))},[C,c]),U=f.useCallback(re=>{C(Hg({handler:h,reactEvent:re}))},[C,h]),K=f.useCallback(re=>{C(Hg({handler:y,reactEvent:re}))},[C,y]),X=f.useCallback(re=>{w&&C(Ktt(re)),C(Hg({handler:g,reactEvent:re}))},[C,w,g]),J=f.useCallback(re=>{C(Hg({handler:m,reactEvent:re}))},[C,m]),te=ldn(b);return f.createElement(Net.Provider,{value:N},f.createElement(_Xe.Provider,{value:I},f.createElement(te,{width:E??(x==null?void 0:x.width),height:M??(x==null?void 0:x.height),className:be("recharts-wrapper",r),style:Zun({position:"relative",cursor:"default",width:E,height:M},x),onClick:$,onContextMenu:H,onDoubleClick:F,onFocus:B,onKeyDown:G,onMouseDown:W,onMouseEnter:D,onMouseLeave:z,onMouseMove:V,onMouseUp:U,onTouchEnd:J,onTouchMove:X,onTouchStart:K,ref:R},f.createElement(rdn,null),n)))}),udn=["width","height","responsive","children","className","style","compact","title","desc"];function ddn(e,t){if(e==null)return{};var n,r,o=fdn(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r{var{width:n,height:r,responsive:o,children:i,className:s,style:l,compact:c,title:u,desc:d}=e,p=ddn(e,udn),h=dl(p);return c?f.createElement(f.Fragment,null,f.createElement(hL,{width:n,height:r}),f.createElement(eTe,{otherAttributes:h,title:u,desc:d},i)):f.createElement(cdn,{className:s,style:l,width:n,height:r,responsive:o??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},f.createElement(eTe,{otherAttributes:h,title:u,desc:d,ref:t},f.createElement(Uan,null,i)))});function Yae(){return Yae=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(eK,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:mdn,tooltipPayloadSearcher:_k,categoricalChartProps:e,ref:t})),gdn=["axis","item"],Yx=f.forwardRef((e,t)=>f.createElement(eK,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:gdn,tooltipPayloadSearcher:_k,categoricalChartProps:e,ref:t}));function xdn(e){var t=fs();return f.useEffect(()=>{t(Fun(e))},[t,e]),null}var ydn=["layout"];function Xae(){return Xae=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=Hs(e,Edn);return f.createElement(ent,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:jdn,tooltipPayloadSearcher:_k,categoricalChartProps:n,ref:t})});function oTe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function iTe(e){for(var t=1;t{var n=Hs(e,Tdn);return f.createElement(ent,{chartName:"RadarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Adn,tooltipPayloadSearcher:_k,categoricalChartProps:n,ref:t})}),Mdn=["axis"],wm=f.forwardRef((e,t)=>f.createElement(eK,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Mdn,tooltipPayloadSearcher:_k,categoricalChartProps:e,ref:t})),Rdn=["axis"],fxe=f.forwardRef((e,t)=>f.createElement(eK,{chartName:"ComposedChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:Rdn,tooltipPayloadSearcher:_k,categoricalChartProps:e,ref:t}));const Qae=(e,t)=>{const n=new Date().toISOString();console.log(`[AUDIT_LOG][${n}] Action: ${e}`,t)},Odn=e=>{switch(e){case"outline":return"bg-slate-900/40 border border-slate-700/50 shadow-xl backdrop-blur-md";case"ghost":return"bg-transparent border-none shadow-none";case"interactive":return"bg-slate-800/40 backdrop-blur-xl border border-slate-700/50 rounded-2xl shadow-2xl transition-all duration-500 hover:bg-slate-800/60 hover:border-cyan-500/50 hover:shadow-cyan-500/10 cursor-pointer group";case"premium":return"bg-gradient-to-br from-slate-800/80 to-slate-900/90 backdrop-blur-2xl border border-cyan-500/30 rounded-2xl shadow-[0_0_20px_rgba(6,182,212,0.15)]";case"security":return"bg-slate-900/80 backdrop-blur-2xl border border-emerald-500/30 rounded-2xl shadow-[0_0_20px_rgba(16,185,129,0.1)]";default:return"bg-slate-900/60 backdrop-blur-xl border border-slate-800/80 rounded-2xl shadow-2xl"}},$dn=e=>{switch(e){case"sm":return"p-4";case"lg":return"p-10";case"none":return"p-0";default:return"p-8"}},Ddn=()=>a.jsxs("div",{className:"space-y-6 animate-pulse p-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{className:"h-7 bg-slate-700/50 rounded-lg w-1/3"}),a.jsx("div",{className:"h-8 bg-slate-700/50 rounded-full w-8"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"h-4 bg-slate-700/40 rounded-md w-full"}),a.jsx("div",{className:"h-4 bg-slate-700/40 rounded-md w-11/12"}),a.jsx("div",{className:"h-4 bg-slate-700/40 rounded-md w-4/5"})]}),a.jsxs("div",{className:"pt-4 flex space-x-3",children:[a.jsx("div",{className:"h-10 bg-slate-700/50 rounded-lg w-24"}),a.jsx("div",{className:"h-10 bg-slate-700/50 rounded-lg w-24"})]})]}),Ldn=({message:e,onRetry:t})=>a.jsxs("div",{className:"flex flex-col items-center justify-center text-center py-12 px-6 bg-red-500/5 border border-red-500/20 rounded-xl",children:[a.jsxs("div",{className:"relative mb-6",children:[a.jsx("div",{className:"absolute inset-0 bg-red-500 blur-xl opacity-20 animate-pulse"}),a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-14 w-14 text-red-500 relative z-10",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})]}),a.jsx("h4",{className:"text-xl font-bold text-white tracking-tight",children:"System Alert"}),a.jsx("p",{className:"text-slate-400 mt-2 mb-6 max-w-sm leading-relaxed",children:e}),t&&a.jsx("button",{onClick:t,className:"px-6 py-2.5 bg-red-500 hover:bg-red-600 text-white rounded-full text-sm font-semibold transition-all shadow-lg shadow-red-500/20 active:scale-95",children:"Re-initialize Connection"})]}),Fdn=({title:e,titleTooltip:t,subtitle:n,icon:r,isCollapsible:o,isCollapsed:i,toggleCollapse:s,actions:l,showSecurityBadge:c})=>!e&&!n&&(!l||l.length===0)&&!o&&!r?null:a.jsxs("div",{className:`flex items-start justify-between ${o?"cursor-pointer select-none":"cursor-default"} mb-6`,onClick:()=>o&&s(),children:[a.jsxs("div",{className:"flex items-center flex-1 pr-4 min-w-0",children:[r&&a.jsx("div",{className:"mr-4 p-2.5 bg-slate-800/50 rounded-xl border border-slate-700/50 text-cyan-400 group-hover:text-cyan-300 transition-colors",children:r}),a.jsxs("div",{className:"min-w-0",children:[e&&a.jsxs("div",{className:"flex items-center",children:[a.jsx("h3",{className:"text-xl font-bold text-white tracking-tight truncate group-hover:text-cyan-50 transition-colors",children:e}),c&&a.jsx("span",{className:"ml-2 px-2 py-0.5 bg-emerald-500/10 border border-emerald-500/20 text-[10px] font-black text-emerald-400 uppercase tracking-widest rounded",children:"Encrypted"}),t&&a.jsxs("div",{className:"group/tooltip relative ml-2",children:[a.jsx("span",{className:"text-slate-500 hover:text-cyan-400 cursor-help transition-colors",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),a.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-2 hidden group-hover/tooltip:block w-48 p-2 bg-slate-900 border border-slate-700 text-xs text-slate-300 rounded-lg shadow-2xl z-50",children:t})]})]}),n&&a.jsx("p",{className:"text-sm font-medium text-slate-500 mt-1 truncate",children:n})]})]}),a.jsxs("div",{className:"flex items-center space-x-1.5 flex-shrink-0",children:[l==null?void 0:l.map(u=>a.jsx("button",{onClick:d=>{d.stopPropagation(),Qae("HEADER_ACTION_TRIGGERED",{actionId:u.id,label:u.label,sensitive:u.isSensitive}),u.onClick(d)},"aria-label":u.label,disabled:u.disabled,className:"p-2 text-slate-400 hover:text-cyan-400 hover:bg-cyan-500/10 rounded-lg transition-all disabled:opacity-30",children:Ie.cloneElement(u.icon,{className:"h-5 w-5"})},u.id)),o&&a.jsx("button",{onClick:u=>{u.stopPropagation(),s()},className:"p-2 text-slate-500 hover:text-white hover:bg-slate-700/50 rounded-lg transition-all",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:`h-5 w-5 transition-transform duration-500 cubic-bezier(0.4, 0, 0.2, 1) ${i?"rotate-0":"rotate-180"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),Ft=({title:e,titleTooltip:t,subtitle:n,icon:r,children:o,className:i="",style:s,variant:l="default",padding:c="md",headerActions:u,footerContent:d,isCollapsible:p=!1,defaultCollapsed:h=!1,isLoading:m=!1,errorState:g=null,onRetry:y,loadingIndicator:x,onClick:v,isMetric:b=!1,showSecurityBadge:w=!1})=>{const[S,C]=f.useState(p&&h),N=f.useRef(null),[j,I]=f.useState("auto"),_=f.useCallback(()=>{const M=!S;C(M),Qae("CARD_COLLAPSE_TOGGLED",{title:e,newState:M?"collapsed":"expanded"})},[S,e]);f.useEffect(()=>{var M;if(p)if(S)I(0);else{const R=(M=N.current)==null?void 0:M.scrollHeight;I(R?`${R}px`:"auto")}},[S,p,o]);const T=Odn(l),P=$dn(b&&c==="md"?"sm":c),E=M=>{v&&(Qae("CARD_CLICKED",{title:e,variant:l}),v(M))};return a.jsxs("div",{className:`${T} ${i} relative overflow-hidden group/card transition-all duration-300`.trim(),style:s,onClick:E,children:[l==="premium"&&a.jsx("div",{className:"absolute -top-24 -right-24 w-48 h-48 bg-cyan-500/10 blur-[80px] rounded-full pointer-events-none"}),a.jsxs("div",{className:`${P} ${b?"text-center":""}`,children:[a.jsx(Fdn,{title:e,titleTooltip:t,subtitle:n,icon:r,isCollapsible:p,isCollapsed:S,toggleCollapse:_,actions:u,showSecurityBadge:w}),a.jsx("div",{className:"relative",children:m?a.jsx("div",{className:"py-4",children:x||a.jsx(Ddn,{})}):g?a.jsx("div",{className:"py-4",children:a.jsx(Ldn,{message:g,onRetry:y})}):a.jsx("div",{style:{height:p?j:"auto"},className:"transition-[height] duration-500 ease-[cubic-bezier(0.4,0,0.2,1)] overflow-hidden",children:a.jsxs("div",{ref:N,children:[a.jsx("div",{className:"animate-in fade-in slide-in-from-bottom-2 duration-700",children:o}),d&&a.jsx("div",{className:"mt-8 pt-6 border-t border-slate-800/60 flex items-center justify-between",children:d})]})})})]}),a.jsx("div",{className:"absolute bottom-0 left-0 h-[1px] bg-gradient-to-r from-transparent via-cyan-500/20 to-transparent w-full opacity-0 group-hover/card:opacity-100 transition-opacity duration-1000"})]})},zdn=()=>{const e=f.useContext(ia);if(!e)throw new Error("BalanceSummary must be within a DataProvider");const{transactions:t}=e,{chartData:n,totalBalance:r,change30d:o}=f.useMemo(()=>{var v;if(!t||t.length===0)return{chartData:[],totalBalance:0,change30d:0};const l=[...t].sort((b,w)=>new Date(b.date).getTime()-new Date(w.date).getTime());let c=0;const u=[];for(const b of l)b.type==="income"?c+=b.amount:c-=b.amount,u.push({date:new Date(b.date),balance:c});const d=c,p={};for(const b of u){const w=b.date.toISOString().substring(0,7);p[w]=b}const h=Object.values(p).sort((b,w)=>b.date.getTime()-w.date.getTime()).map(b=>({name:b.date.toLocaleString("default",{month:"short"}),balance:b.balance})),m=new Date;m.setDate(m.getDate()-30);const y=((v=[...u].reverse().find(b=>b.date=0?"text-green-400":"text-red-400"}`,children:[o>=0?"+":"","$",o.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2}),i!==0&&` (${s.toFixed(1)}%)`]})]})]}),a.jsx("div",{className:"h-60",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(wm,{data:n,margin:{top:10,right:30,left:0,bottom:0},children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"colorBalance",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#06b6d4",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#06b6d4",stopOpacity:0})]})}),a.jsx(Ka,{dataKey:"name",stroke:"#9ca3af",fontSize:12}),a.jsx(ra,{stroke:"#9ca3af",fontSize:12,domain:["dataMin - 1000","dataMax + 1000"],tickFormatter:l=>`$${Number(l).toLocaleString()}`}),a.jsx(kl,{strokeDasharray:"3 3",stroke:"#4b5563"}),a.jsx(ji,{contentStyle:{backgroundColor:"rgba(31, 41, 55, 0.8)",borderColor:"#4b5563",color:"#e5e7eb"},formatter:l=>`$${l.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`}),a.jsx(hu,{type:"monotone",dataKey:"balance",stroke:"#06b6d4",fillOpacity:1,fill:"url(#colorBalance)"})]})})})]})},T1="Quantum Financial",Bdn=` ${T1} Business Demo: A Comprehensive Guide. This is a "Golden Ticket" experience. We are letting the user "Test Drive" the car (the code). It must have "Bells and Whistles" - distinct features, high polish. It is a "Cheat Sheet" for business banking. NO PRESSURE environment. Metaphor: Kick the tires. See the engine roar. Robust Payment & Collection capabilities (Wire, ACH). Security is non-negotiable (Multi-factor auth simulations, Fraud monitoring). Reporting & Analytics (Data visualization). Integration capabilities (ERP, Accounting). AUDIT STORAGE: Every sensitive action must be logged. Tone: Elite, Professional, High-Performance, Secure. ${T1}, a titan in the financial world, offers a suite of business banking solutions designed to streamline operations, enhance security, and support your growth. Getting a demo is your golden ticket to seeing these powerful features in action before committing. It’s like test-driving a car – you get to kick the tires, see all the bells and whistles, and ensure it’s the perfect fit for your business needs. We’ll cover everything from the initial setup to exploring key functionalities and understanding the benefits that come with partnering with a global financial institution like ${T1}. A demo allows you to virtually walk through the entire platform. You get to see firsthand how easy it is to manage your accounts, process payments, track expenses, and access sophisticated reporting tools. This isn’t just about looking at pretty interfaces; it’s about understanding the real-world application of these tools for your specific business. Are you struggling with international payments? Worried about fraud? Need better insights into your cash flow? A demo lets you ask those specific questions and see how ${T1}’s solutions can address them. It’s also a fantastic opportunity to get a feel for the user experience. Is the platform intuitive? Can your team easily navigate it? The demo provides a no-pressure environment to explore, interact, and evaluate without any commitment. It’s about empowering yourself with knowledge so you can make an informed decision that aligns with your business goals and operational needs. Plus, you get to see how ${T1} integrates with other business tools you might already be using, saving you time and preventing data silos. This proactive approach to understanding your financial tools can save you a ton of headaches down the line and ensure you’re leveraging the best resources available to drive your business forward. It’s your chance to see the future of your business finances, laid out before you, in a clear and interactive way. `,Hdn=({confidence:e})=>{const t=e>.9,n=e>.7&&e<=.9;let r="bg-cyan-500/10 text-cyan-400 border-cyan-500/20",o=ri;return n?(r="bg-yellow-500/10 text-yellow-400 border-yellow-500/20",o=zu):t||(r="bg-red-500/10 text-red-400 border-red-500/20",o=Cie),a.jsxs("div",{className:`flex items-center gap-1.5 px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-tighter border ${r} shadow-sm backdrop-blur-md`,children:[a.jsx(o,{size:10}),"AI Verified: ",(e*100).toFixed(0),"%"]})},Vdn=({type:e})=>{const t=e==="income";return a.jsxs("div",{className:` relative p-3 rounded-2xl border shadow-inner transition-all duration-500 ${t?"bg-emerald-900/20 text-emerald-400 border-emerald-500/20 shadow-emerald-900/20":"bg-rose-900/20 text-rose-400 border-rose-500/20 shadow-rose-900/20"} `,children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent rounded-2xl"}),t?a.jsx(YG,{size:20}):a.jsx(Cy,{size:20})]})},Udn=({logs:e})=>{const t=f.useRef(null);return f.useEffect(()=>{t.current&&(t.current.scrollTop=t.current.scrollHeight)},[e]),a.jsxs("div",{className:"bg-black/80 rounded-lg border border-gray-800 p-4 font-mono text-xs h-48 flex flex-col shadow-inner",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2 border-b border-gray-800 pb-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-400",children:[a.jsx(Bs,{size:12}),a.jsx("span",{className:"uppercase tracking-widest font-bold",children:"Secure Audit Storage"})]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500/50"}),a.jsx("div",{className:"w-2 h-2 rounded-full bg-yellow-500/50"}),a.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500/50"})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto space-y-1 custom-scrollbar",ref:t,children:[e.length===0&&a.jsx("span",{className:"text-gray-600 italic",children:"Initializing secure log stream..."}),e.map(n=>a.jsxs("div",{className:"flex gap-2 hover:bg-white/5 p-0.5 rounded",children:[a.jsxs("span",{className:"text-gray-500",children:["[",n.timestamp.split("T")[1].split(".")[0],"]"]}),a.jsx("span",{className:`font-bold ${n.status==="SUCCESS"?"text-green-400":n.status==="WARNING"?"text-yellow-400":"text-red-400"}`,children:n.status}),a.jsx("span",{className:"text-cyan-300/80",children:n.action}),a.jsxs("span",{className:"text-gray-400 truncate flex-1",children:[":: ",n.details]}),a.jsx("span",{className:"text-gray-600 text-[10px]",children:n.hash})]},n.id))]})]})},Wdn=({transactions:e,setActiveView:t})=>{const[n,r]=f.useState(""),[o,i]=f.useState(!1),[s,l]=f.useState(""),[c,u]=f.useState([{id:"init",role:"ai",content:`Welcome to the ${T1} Ledger. I am the Quantum Core AI. I can analyze your transaction flow, detect anomalies, and provide financial forecasts. How can I assist you today?`,timestamp:new Date}]),[d,p]=f.useState(!1),[h,m]=f.useState([]),[g,y]=f.useState(null),[x,v]=f.useState(!1),b=f.useRef(null),w=f.useRef(null);f.useEffect(()=>{C("SYSTEM_WARNING","GEMINI_API_KEY not found. Running in simulation mode.","WARNING")},[]),f.useEffect(()=>{var T;(T=b.current)==null||T.scrollIntoView({behavior:"smooth"})},[c,o]);const S=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),C=(T,P,E)=>{const M={id:S(),timestamp:new Date().toISOString(),action:T,details:P,status:E,hash:`0x${S().substring(0,8)}`};m(R=>[...R,M])},N=T=>{r(T.target.value),T.target.value.length>2&&C("USER_SEARCH",`Query: "${T.target.value}"`,"SUCCESS")},j=e.filter(T=>T.description.toLowerCase().includes(n.toLowerCase())||T.category.toLowerCase().includes(n.toLowerCase())||T.amount.toString().includes(n)),I=async T=>{if(T.preventDefault(),!s.trim())return;const P={id:S(),role:"user",content:s,timestamp:new Date};u(E=>[...E,P]),l(""),p(!0),C("AI_QUERY",`User asked: "${P.content}"`,"SUCCESS");try{let E="";if(w.current){const R=w.current.getGenerativeModel({model:"gemini-1.5-flash"}),$=` You are the Quantum Core AI for ${T1}. CONTEXT: ${Bdn} CURRENT TRANSACTIONS: ${JSON.stringify(e.slice(0,10))} USER QUERY: ${P.content} INSTRUCTIONS: Be professional, elite, and helpful. Keep answers concise. If asked about the company, use the provided context. Do not mention you are a Google AI. You are Quantum Core. `;E=(await(await R.generateContent($)).response).text()}else await new Promise(R=>setTimeout(R,1500)),P.content.toLowerCase().includes("spend")||P.content.toLowerCase().includes("cost")?E="Based on your ledger, your spending patterns indicate a 12% increase in operational expenses this month. The largest outlier is the Cloud Infrastructure category.":P.content.toLowerCase().includes("demo")||P.content.toLowerCase().includes("company")?E=`${T1} offers a "Golden Ticket" experience. We allow you to test drive our banking core with zero pressure. Our security is non-negotiable, and our reporting is top-tier.`:E="I've analyzed the request. While I am running in simulation mode (missing API Key), I can confirm that your ledger integrity is 100%. Please verify your credentials to unlock full generative capabilities.";const M={id:S(),role:"ai",content:E,timestamp:new Date};u(R=>[...R,M]),C("AI_RESPONSE",`Generated response (${E.length} chars)`,"SUCCESS")}catch(E){console.error("AI Error",E),C("AI_ERROR","Failed to generate response","ERROR");const M={id:S(),role:"ai",content:"I encountered a quantum interference pattern while processing your request. Please try again.",timestamp:new Date};u(R=>[...R,M])}finally{p(!1)}},_=()=>g?a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4 animate-in fade-in duration-200",children:a.jsxs("div",{className:"bg-gray-900 border border-cyan-500/30 rounded-2xl w-full max-w-lg shadow-2xl shadow-cyan-500/20 overflow-hidden",children:[a.jsxs("div",{className:"bg-gradient-to-r from-gray-900 to-gray-800 p-6 border-b border-gray-700 flex justify-between items-start",children:[a.jsxs("div",{children:[a.jsxs("h3",{className:"text-xl font-bold text-white flex items-center gap-2",children:[a.jsx(Xi,{className:"text-cyan-400",size:20}),"Transaction Details"]}),a.jsx("p",{className:"text-gray-400 text-sm mt-1 font-mono",children:g.id})]}),a.jsx("button",{onClick:()=>y(null),className:"text-gray-400 hover:text-white transition-colors",children:a.jsx(b3,{size:24})})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-xl border border-gray-700",children:[a.jsx("span",{className:"text-gray-500 text-xs uppercase tracking-wider",children:"Amount"}),a.jsxs("div",{className:`text-2xl font-bold mt-1 ${g.type==="income"?"text-emerald-400":"text-white"}`,children:[g.type==="income"?"+":"-","$",g.amount.toLocaleString()]})]}),a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-xl border border-gray-700",children:[a.jsx("span",{className:"text-gray-500 text-xs uppercase tracking-wider",children:"Date"}),a.jsx("div",{className:"text-xl font-bold text-white mt-1",children:new Date(g.date).toLocaleDateString()})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex justify-between items-center py-2 border-b border-gray-800",children:[a.jsx("span",{className:"text-gray-400",children:"Category"}),a.jsx("span",{className:"text-white font-medium",children:g.category})]}),a.jsxs("div",{className:"flex justify-between items-center py-2 border-b border-gray-800",children:[a.jsx("span",{className:"text-gray-400",children:"Status"}),a.jsxs("span",{className:"text-cyan-400 font-bold flex items-center gap-1",children:[a.jsx(ri,{size:14})," Cleared"]})]}),a.jsxs("div",{className:"flex justify-between items-center py-2 border-b border-gray-800",children:[a.jsx("span",{className:"text-gray-400",children:"Carbon Footprint"}),a.jsxs("span",{className:"text-emerald-400 font-medium flex items-center gap-1",children:[a.jsx(vi,{size:14})," ",g.carbonFootprint||"0.0"," kg CO2e"]})]})]}),a.jsxs("div",{className:"bg-cyan-900/20 border border-cyan-500/20 p-4 rounded-xl",children:[a.jsxs("div",{className:"flex items-center gap-2 text-cyan-400 mb-2",children:[a.jsx(Pp,{size:16}),a.jsx("span",{className:"font-bold text-sm",children:"AI Analysis"})]}),a.jsxs("p",{className:"text-cyan-100/80 text-sm leading-relaxed",children:["This transaction aligns with your historical spending patterns for ",g.category,". No anomalies detected. Vendor reputation score is 98/100."]})]})]}),a.jsxs("div",{className:"p-4 bg-gray-900 border-t border-gray-800 flex justify-end gap-3",children:[a.jsx("button",{className:"px-4 py-2 rounded-lg bg-gray-800 text-white hover:bg-gray-700 transition-colors text-sm font-medium",children:"Dispute"}),a.jsx("button",{className:"px-4 py-2 rounded-lg bg-cyan-600 text-white hover:bg-cyan-500 transition-colors text-sm font-medium shadow-lg shadow-cyan-500/20",children:"Download Receipt"})]})]})}):null;return a.jsxs("div",{className:"relative",children:[_(),a.jsx(Ft,{title:`${T1} Ledger`,subtitle:"Real-time High-Frequency Transaction Monitoring",icon:a.jsx(rl,{className:"text-cyan-400"}),headerActions:[{id:"ai-toggle",icon:a.jsx(Pp,{className:o?"text-cyan-400 animate-pulse":""}),label:"Toggle AI Assistant",onClick:()=>i(!o)},{id:"audit-toggle",icon:a.jsx(Bs,{className:x?"text-green-400":""}),label:"Toggle Audit Log",onClick:()=>v(!x)},{id:"export",icon:a.jsx(Ch,{}),label:"Export Data",onClick:()=>C("EXPORT","User requested JSON export","SUCCESS")}],className:"overflow-hidden border-t-4 border-t-cyan-500",children:a.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 h-[700px]",children:[a.jsxs("div",{className:`flex-1 flex flex-col transition-all duration-500 ${o?"lg:w-2/3":"w-full"}`,children:[a.jsxs("div",{className:"flex items-center gap-4 mb-4 p-1",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(hm,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500",size:16}),a.jsx("input",{type:"text",placeholder:"Search ledger by keyword, amount, or ID...",value:n,onChange:N,className:"w-full bg-gray-900/50 border border-gray-700 rounded-xl py-2.5 pl-10 pr-4 text-sm text-white focus:outline-none focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/50 transition-all placeholder:text-gray-600"})]}),a.jsx("button",{className:"p-2.5 bg-gray-800 hover:bg-gray-700 rounded-xl border border-gray-700 text-gray-400 hover:text-white transition-colors",children:a.jsx(QG,{size:18})}),a.jsx("button",{className:"p-2.5 bg-gray-800 hover:bg-gray-700 rounded-xl border border-gray-700 text-gray-400 hover:text-white transition-colors",children:a.jsx(qf,{size:18})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto custom-scrollbar pr-2 space-y-2",children:[j.map((T,P)=>a.jsxs("div",{className:"group relative overflow-hidden rounded-2xl bg-gray-800/30 border border-gray-700/50 hover:bg-gray-800/60 hover:border-cyan-500/30 transition-all duration-300 cursor-pointer",onClick:()=>{y(T),C("VIEW_TX",`User viewed details for ${T.id}`,"SUCCESS")},style:{animationDelay:`${P*50}ms`},children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/5 to-transparent translate-x-[-100%] group-hover:translate-x-[100%] transition-transform duration-1000"}),a.jsxs("div",{className:"flex items-center justify-between p-4 relative z-10",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Vdn,{type:T.type}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"font-bold text-gray-100 group-hover:text-cyan-300 transition-colors truncate max-w-[200px]",children:T.description}),a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium bg-gray-700 text-gray-300 border border-gray-600",children:T.category})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3 mt-1.5",children:[a.jsx("span",{className:"text-[10px] font-mono text-gray-500 uppercase tracking-wider",children:T.date}),a.jsx(Hdn,{confidence:T.aiCategoryConfidence||.98}),T.carbonFootprint&&a.jsxs("span",{className:"text-[10px] text-emerald-500/70 flex items-center gap-1 font-bold",children:[a.jsx(vi,{size:10})," ",T.carbonFootprint,"kg"]})]})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsxs("p",{className:`text-lg font-black font-mono tracking-tighter ${T.type==="income"?"text-emerald-400":"text-gray-100"}`,children:[T.type==="income"?"+":"-","$",T.amount.toLocaleString(void 0,{minimumFractionDigits:2})]}),a.jsxs("div",{className:"flex items-center justify-end gap-2 mt-1 opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:[a.jsx("span",{className:"text-[10px] text-cyan-500 font-medium uppercase tracking-widest",children:"View Details"}),a.jsx(nd,{size:12,className:"text-cyan-500"})]})]})]})]},T.id)),j.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-gray-500 border-2 border-dashed border-gray-800 rounded-2xl",children:[a.jsx(hm,{size:48,className:"mb-4 opacity-20"}),a.jsx("p",{className:"text-lg font-medium",children:"No transactions found"}),a.jsx("p",{className:"text-sm",children:"Try adjusting your search filters"})]})]}),x&&a.jsx("div",{className:"mt-4 animate-in slide-in-from-bottom-4 fade-in duration-300",children:a.jsx(Udn,{logs:h})})]}),o&&a.jsxs("div",{className:"w-full lg:w-1/3 flex flex-col bg-gray-900/80 border-l border-gray-800/50 backdrop-blur-xl rounded-2xl overflow-hidden shadow-2xl animate-in slide-in-from-right-10 fade-in duration-300",children:[a.jsxs("div",{className:"p-4 border-b border-gray-800 bg-gradient-to-r from-gray-900 to-gray-800 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-cyan-500/20 flex items-center justify-center border border-cyan-500/30",children:a.jsx(Pp,{size:20,className:"text-cyan-400"})}),a.jsx("div",{className:"absolute -bottom-1 -right-1 w-3 h-3 bg-green-500 rounded-full border-2 border-gray-900 animate-pulse"})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-white text-sm",children:"Quantum Core"}),a.jsx("p",{className:"text-xs text-cyan-400/80 font-mono",children:"Online • v4.2.0"})]})]}),a.jsx("button",{onClick:()=>i(!1),className:"text-gray-500 hover:text-white",children:a.jsx(b3,{size:18})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 bg-gray-900/50 custom-scrollbar",children:[c.map(T=>a.jsx("div",{className:`flex ${T.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:` max-w-[85%] rounded-2xl p-3 text-sm leading-relaxed shadow-lg ${T.role==="user"?"bg-cyan-600 text-white rounded-tr-none":"bg-gray-800 text-gray-200 border border-gray-700 rounded-tl-none"} `,children:[T.role==="ai"&&a.jsxs("div",{className:"flex items-center gap-2 mb-1 text-xs font-bold text-cyan-400/80 uppercase tracking-wider",children:[a.jsx(mm,{size:10})," AI Analysis"]}),T.content,a.jsx("div",{className:`text-[10px] mt-2 opacity-50 ${T.role==="user"?"text-cyan-100":"text-gray-500"}`,children:T.timestamp.toLocaleTimeString()})]})},T.id)),d&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-gray-800 rounded-2xl rounded-tl-none p-4 border border-gray-700 flex gap-1",children:[a.jsx("div",{className:"w-2 h-2 bg-cyan-500/50 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("div",{className:"w-2 h-2 bg-cyan-500/50 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("div",{className:"w-2 h-2 bg-cyan-500/50 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})}),a.jsx("div",{ref:b})]}),a.jsxs("div",{className:"p-4 bg-gray-900 border-t border-gray-800",children:[a.jsxs("form",{onSubmit:I,className:"relative",children:[a.jsx("input",{type:"text",value:s,onChange:T=>l(T.target.value),placeholder:"Ask Quantum Core about your finances...",className:"w-full bg-gray-800 border border-gray-700 rounded-xl py-3 pl-4 pr-12 text-sm text-white focus:outline-none focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 transition-all placeholder:text-gray-500"}),a.jsx("button",{type:"submit",disabled:!s.trim()||d,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 bg-cyan-500/20 hover:bg-cyan-500 text-cyan-400 hover:text-white rounded-lg transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:a.jsx(Lc,{size:16})})]}),a.jsxs("div",{className:"mt-2 flex justify-center gap-4 text-[10px] text-gray-600 font-mono",children:[a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(ds,{size:8})," End-to-End Encrypted"]}),a.jsxs("span",{className:"flex items-center gap-1",children:[a.jsx(Ei,{size:8})," Gemini Flash Engine"]})]})]})]})]})})]})},Gdn=` You are the Quantum Financial AI Core, an elite financial strategist. The user is the "Sovereign Architect". Your tone is Professional, High-Performance, and Secure. You help the user "Test Drive" the financial engine. NEVER mention Citibank. Always refer to the institution as "Quantum Financial". You can suggest adjustments to: projectionYears, monthlyContribution, annualReturn, volatility, and inflationRate. `,qdn=(e,t)=>{let n=1-Math.random(),r=Math.random();return Math.sqrt(-2*Math.log(n))*Math.cos(2*Math.PI*r)*t+e},aTe=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e),Kdn=()=>{const e=f.useContext(ia),t=(e==null?void 0:e.transactions)||[],n=(e==null?void 0:e.userProfile)||{name:"Sovereign Architect"},[r,o]=f.useState(25),[i,s]=f.useState(15e3),[l,c]=f.useState(8.5),[u,d]=f.useState(12),[p,h]=f.useState(2.2),[m,g]=f.useState(20),[y,x]=f.useState("monteCarlo"),[v,b]=f.useState("core"),[w,S]=f.useState(!1),[C,N]=f.useState({years:25,contribution:15e3}),[j,I]=f.useState(!1),[_,T]=f.useState(""),[P,E]=f.useState([{role:"system",content:"Welcome, Sovereign Architect. The Quantum Engine is primed. How shall we simulate your global dominance today?",timestamp:new Date().toLocaleTimeString()}]),[M,R]=f.useState(!1),$=f.useRef(null),[D,z]=f.useState([]),V=f.useCallback((U,K,X="low")=>{const J={id:`AUDIT-${Math.random().toString(36).substr(2,9).toUpperCase()}`,timestamp:new Date().toISOString(),action:U,actor:n.name,details:K,severity:X};z(te=>[J,...te]),console.log(`[AUDIT LOG] ${U}: ${K}`),I(!0),setTimeout(()=>I(!1),3e3)},[n]),B=async()=>{if(!_.trim())return;const U={role:"user",content:_,timestamp:new Date().toLocaleTimeString()};E(K=>[...K,U]),T(""),R(!0);try{const K=await fetch("/api/gemini",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:` ${Gdn} Current State: - Years: ${r} - Monthly Contribution: ${i} - Annual Return: ${l}% - Volatility: ${u}% User Command: "${U.content}" If the user wants to change parameters, respond with a JSON block at the end like: COMMAND_START {"projectionYears": 30, "monthlyContribution": 20000} COMMAND_END `})});let X="";K.ok?X=(await K.json()).text:X="Calculating trajectory... Optimization suggestions are currently offline. Running heuristic fallback.";const J=X.match(/COMMAND_START (.*?) COMMAND_END/);if(J)try{const ce=JSON.parse(J[1]);ce.projectionYears&&o(ce.projectionYears),ce.monthlyContribution&&s(ce.monthlyContribution),ce.annualReturn&&c(ce.annualReturn),ce.volatility&&d(ce.volatility),V("AI_PARAMETER_ADJUSTMENT",`AI modified engine parameters: ${JSON.stringify(ce)}`,"medium")}catch(ce){console.error("Failed to parse AI command",ce)}const re={role:"ai",content:X.replace(/COMMAND_START .*? COMMAND_END/,"").trim(),timestamp:new Date().toLocaleTimeString()};E(ce=>[...ce,re]),V("AI_INTERACTION",`User queried AI: ${U.content.substring(0,30)}...`)}catch{E(X=>[...X,{role:"ai",content:"Neural link interrupted. Switching to local processing mode.",timestamp:new Date().toLocaleTimeString()}]),V("AI_FAILURE","API connection failed","high")}finally{R(!1)}};f.useEffect(()=>{var U;(U=$.current)==null||U.scrollIntoView({behavior:"smooth"})},[P]);const G=f.useMemo(()=>{const U=[...t].sort((ge,ye)=>new Date(ge.date).getTime()-new Date(ye.date).getTime());let K=25e5;const X=[];if(U.length>0)for(const ge of U)K+=ge.type==="income"?ge.amount:-ge.amount,X.push({date:new Date(ge.date),balance:K});else X.push({date:new Date,balance:K});const J=X.map(ge=>({month:ge.date.toLocaleString("default",{month:"short",year:"2-digit"}),balance:ge.balance,isProjection:!1}));let te=K;const re=[],ce=U.length>0?new Date(U[U.length-1].date):new Date,ae=r*12,oe=l/100/12,ue=u/100/Math.sqrt(12),fe=p/100/12,se=(1+oe)/(1+fe)-1;if(y==="compounding"){let ge=te,ye=i;for(let de=1;de<=ae;de++){const Ne=new Date(ce);Ne.setMonth(Ne.getMonth()+de),de>1&&(de-1)%12===0&&(ye*=1+p/100),ge=(ge+ye)*(1+se),re.push({month:Ne.toLocaleString("default",{month:"short",year:"2-digit"}),projection:ge,isProjection:!0})}}else{const ge=y==="quantum_stress_test"?500:200,ye=Array(ge).fill(0).map(()=>[]);for(let de=0;de0&&xe%12===0&&(_e*=1+p/100);const we=y==="quantum_stress_test"&&Math.random()<.01?-.15:0,Te=qdn(se,ue)+we;Ne=(Ne+_e)*(1+Te),ye[de].push(Ne)}}for(let de=0;dexe[de]).sort((xe,we)=>xe-we);re.push({month:Ne.toLocaleString("default",{month:"short",year:"2-digit"}),p10:_e[Math.floor(ge*.1)],p50:_e[Math.floor(ge*.5)],p90:_e[Math.floor(ge*.9)],isProjection:!0,confidenceRange:[_e[Math.floor(ge*.1)],_e[Math.floor(ge*.9)]]})}}return[...J,...re]},[t,r,i,l,u,y,p]),H=f.useMemo(()=>{const U=G.filter(K=>!K.isProjection);return U.length>0?U[U.length-1].month:""},[G]),F=()=>{o(C.years),s(C.contribution),S(!1),V("MANUAL_CONFIG_UPDATE",`Updated projection to ${C.years} years and ${C.contribution}/mo`,"medium")},W=({active:U,payload:K,label:X})=>U&&K&&K.length?a.jsxs("div",{className:"p-4 bg-gray-900/95 backdrop-blur-xl border border-cyan-500/30 rounded-xl shadow-2xl text-gray-100",children:[a.jsx("p",{className:"font-bold text-cyan-400 border-b border-gray-700 pb-2 mb-2",children:X}),a.jsx("div",{className:"space-y-1",children:K.map(J=>a.jsxs("div",{className:"flex justify-between gap-8 text-sm",children:[a.jsxs("span",{className:"text-gray-400",children:[J.name,":"]}),a.jsx("span",{className:"font-mono font-bold",style:{color:J.color},children:aTe(J.value)})]},J.dataKey))}),a.jsx("p",{className:"text-[10px] text-gray-500 mt-3 italic",children:"Quantum Simulation - Real-time Adjusted"})]}):null;return a.jsxs("div",{className:"relative space-y-6",children:[j&&a.jsx("div",{className:"fixed top-24 right-8 z-50 animate-bounce",children:a.jsxs("div",{className:"bg-emerald-500 text-white px-4 py-2 rounded-full shadow-lg flex items-center gap-2 text-sm font-bold",children:[a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),"AUDIT LOGGED"]})}),a.jsxs(Ft,{title:"Quantum Wealth Engine",subtitle:"Sovereign Architect Command Center",className:"border-cyan-500/20 shadow-cyan-500/5",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row gap-6",children:[a.jsxs("div",{className:"flex-1 min-h-[500px] bg-gray-900/30 rounded-2xl p-4 border border-gray-800",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-cyan-400 font-bold uppercase tracking-widest text-xs",children:"Global Liquidity Projection"}),a.jsxs("p",{className:"text-gray-500 text-xs",children:["Model: ",y.toUpperCase()]})]}),a.jsx("div",{className:"flex gap-2",children:a.jsx("button",{onClick:()=>S(!0),className:"px-3 py-1 bg-cyan-500/10 hover:bg-cyan-500/20 border border-cyan-500/50 text-cyan-400 rounded text-xs transition-all",children:"KICK THE TIRES"})})]}),a.jsx("div",{className:"h-[400px]",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(fxe,{data:G,margin:{top:10,right:10,left:0,bottom:0},children:[a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"colorHistory",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#06b6d4",stopOpacity:.3}),a.jsx("stop",{offset:"95%",stopColor:"#06b6d4",stopOpacity:0})]}),a.jsxs("linearGradient",{id:"colorConfidence",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#8b5cf6",stopOpacity:.2}),a.jsx("stop",{offset:"95%",stopColor:"#8b5cf6",stopOpacity:0})]})]}),a.jsx(kl,{strokeDasharray:"3 3",stroke:"#1f2937",vertical:!1}),a.jsx(Ka,{dataKey:"month",stroke:"#4b5563",fontSize:10,tick:{fill:"#9ca3af"},interval:Math.floor(G.length/10)}),a.jsx(ra,{stroke:"#4b5563",fontSize:10,tickFormatter:U=>`$${(U/1e6).toFixed(1)}M`,tick:{fill:"#9ca3af"}}),a.jsx(ji,{content:a.jsx(W,{})}),a.jsx(uu,{verticalAlign:"top",height:36}),a.jsx(hu,{type:"monotone",dataKey:"balance",name:"Historical Assets",stroke:"#06b6d4",fill:"url(#colorHistory)",strokeWidth:3}),y==="compounding"&&a.jsx(au,{type:"monotone",dataKey:"projection",name:"Linear Growth",stroke:"#a78bfa",strokeWidth:2,strokeDasharray:"5 5",dot:!1}),(y==="monteCarlo"||y==="quantum_stress_test")&&a.jsxs(a.Fragment,{children:[a.jsx(hu,{type:"monotone",dataKey:"confidenceRange",name:"Risk Variance (10-90%)",stroke:"none",fill:"url(#colorConfidence)"}),a.jsx(au,{type:"monotone",dataKey:"p50",name:"Median Trajectory",stroke:"#8b5cf6",strokeWidth:3,dot:!1}),a.jsx(au,{type:"monotone",dataKey:"p90",name:"Optimistic Alpha",stroke:"#c084fc",strokeWidth:1,strokeDasharray:"3 3",dot:!1}),a.jsx(au,{type:"monotone",dataKey:"p10",name:"Pessimistic Delta",stroke:"#6b7280",strokeWidth:1,strokeDasharray:"3 3",dot:!1})]}),H&&a.jsx(mtt,{x:H,stroke:"#ef4444",strokeDasharray:"3 3",label:{value:"NOW",position:"top",fill:"#ef4444",fontSize:10}})]})})})]}),a.jsxs("div",{className:"w-full lg:w-96 flex flex-col bg-gray-900/50 rounded-2xl border border-gray-800 overflow-hidden",children:[a.jsxs("div",{className:"p-4 bg-gray-800/50 border-b border-gray-700 flex items-center gap-3",children:[a.jsx("div",{className:"w-3 h-3 bg-emerald-500 rounded-full animate-pulse"}),a.jsx("h5",{className:"text-sm font-bold text-gray-200",children:"Quantum AI Strategist"})]}),a.jsxs("div",{className:"flex-1 p-4 overflow-y-auto max-h-[400px] space-y-4 custom-scrollbar",children:[P.map((U,K)=>a.jsx("div",{className:`flex ${U.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[85%] p-3 rounded-2xl text-xs ${U.role==="user"?"bg-cyan-600 text-white rounded-tr-none":U.role==="system"?"bg-gray-800 text-cyan-400 border border-cyan-900/50 italic":"bg-gray-700 text-gray-200 rounded-tl-none"}`,children:[U.content,a.jsx("div",{className:"text-[8px] opacity-50 mt-1 text-right",children:U.timestamp})]})},K)),M&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-gray-700 p-3 rounded-2xl rounded-tl-none flex gap-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-gray-400 rounded-full animate-bounce"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-gray-400 rounded-full animate-bounce [animation-delay:0.2s]"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-gray-400 rounded-full animate-bounce [animation-delay:0.4s]"})]})}),a.jsx("div",{ref:$})]}),a.jsx("div",{className:"p-4 bg-gray-800/30 border-t border-gray-700",children:a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:_,onChange:U=>T(U.target.value),onKeyDown:U=>U.key==="Enter"&&B(),placeholder:"Command the engine...",className:"w-full bg-gray-950 border border-gray-700 rounded-xl py-2 pl-4 pr-12 text-sm text-gray-200 focus:outline-none focus:border-cyan-500 transition-colors"}),a.jsx("button",{onClick:B,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 text-cyan-500 hover:text-cyan-400",children:a.jsx(Ydn,{})})]})})]})]}),a.jsxs("div",{className:"mt-8 border-t border-gray-800 pt-6",children:[a.jsx("div",{className:"flex flex-wrap gap-2 mb-6",children:["core","advanced","scenarios","ai_strategy","security_audit"].map(U=>a.jsx("button",{onClick:()=>b(U),className:`px-4 py-2 rounded-lg text-xs font-bold uppercase tracking-widest transition-all ${v===U?"bg-cyan-500 text-gray-900 shadow-lg shadow-cyan-500/20":"bg-gray-800 text-gray-400 hover:bg-gray-700"}`,children:U.replace("_"," ")},U))}),a.jsxs("div",{className:"bg-gray-900/30 rounded-2xl p-6 border border-gray-800 min-h-[200px]",children:[v==="core"&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("label",{className:"block text-[10px] font-bold text-gray-500 uppercase",children:"Simulation Model"}),a.jsx("div",{className:"flex flex-col gap-2",children:["compounding","monteCarlo","quantum_stress_test"].map(U=>a.jsx("button",{onClick:()=>{x(U),V("MODEL_CHANGE",`Switched to ${U} model`)},className:`text-left px-4 py-2 rounded-lg text-xs transition-all ${y===U?"bg-cyan-500/20 text-cyan-400 border border-cyan-500/50":"bg-gray-800 text-gray-500"}`,children:U.replace("_"," ").toUpperCase()},U))})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("label",{className:"block text-[10px] font-bold text-gray-500 uppercase",children:["Horizon: ",r," Years"]}),a.jsx("input",{type:"range",min:"5",max:"50",value:r,onChange:U=>o(Number(U.target.value)),className:"w-full accent-cyan-500"}),a.jsxs("div",{className:"flex justify-between text-[10px] text-gray-600",children:[a.jsx("span",{children:"5Y"}),a.jsx("span",{children:"50Y"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("label",{className:"block text-[10px] font-bold text-gray-500 uppercase",children:["Monthly Inflow: ",aTe(i)]}),a.jsx("input",{type:"range",min:"1000",max:"100000",step:"1000",value:i,onChange:U=>s(Number(U.target.value)),className:"w-full accent-cyan-500"}),a.jsxs("div",{className:"flex justify-between text-[10px] text-gray-600",children:[a.jsx("span",{children:"$1k"}),a.jsx("span",{children:"$100k"})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("label",{className:"block text-[10px] font-bold text-gray-500 uppercase",children:["Target Yield: ",l,"%"]}),a.jsx("input",{type:"range",min:"1",max:"25",step:"0.1",value:l,onChange:U=>c(Number(U.target.value)),className:"w-full accent-cyan-500"}),a.jsxs("div",{className:"flex justify-between text-[10px] text-gray-600",children:[a.jsx("span",{children:"1%"}),a.jsx("span",{children:"25%"})]})]})]}),v==="advanced"&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsxs("label",{className:"block text-[10px] font-bold text-gray-500 uppercase",children:["Market Volatility: ",u,"%"]}),a.jsx("input",{type:"range",min:"2",max:"40",value:u,onChange:U=>d(Number(U.target.value)),className:"w-full accent-purple-500"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("label",{className:"block text-[10px] font-bold text-gray-500 uppercase",children:["Inflation Erosion: ",p,"%"]}),a.jsx("input",{type:"range",min:"0",max:"15",step:"0.1",value:p,onChange:U=>h(Number(U.target.value)),className:"w-full accent-red-500"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("label",{className:"block text-[10px] font-bold text-gray-500 uppercase",children:["Effective Tax Rate: ",m,"%"]}),a.jsx("input",{type:"range",min:"0",max:"50",value:m,onChange:U=>g(Number(U.target.value)),className:"w-full accent-emerald-500"})]})]}),v==="security_audit"&&a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("h6",{className:"text-xs font-bold text-gray-400 uppercase",children:"Immutable Audit Storage"}),a.jsx("span",{className:"text-[10px] text-emerald-500 font-mono",children:"ENCRYPTION: AES-256-GCM ACTIVE"})]}),a.jsxs("div",{className:"max-h-[300px] overflow-y-auto space-y-2 pr-2 custom-scrollbar",children:[D.length===0&&a.jsx("p",{className:"text-gray-600 text-xs italic",children:"No sensitive actions recorded in this session."}),D.map(U=>a.jsxs("div",{className:"flex items-center gap-4 p-3 bg-gray-950 rounded-lg border-l-2 border-cyan-500",children:[a.jsx("div",{className:"text-[10px] font-mono text-gray-500 w-32",children:new Date(U.timestamp).toLocaleTimeString()}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-xs font-bold text-gray-200",children:U.action}),a.jsx("div",{className:"text-[10px] text-gray-500",children:U.details})]}),a.jsx("div",{className:`text-[10px] font-bold px-2 py-0.5 rounded ${U.severity==="critical"?"bg-red-500/20 text-red-500":U.severity==="high"?"bg-orange-500/20 text-orange-500":"bg-gray-800 text-gray-400"}`,children:U.severity.toUpperCase()})]},U.id))]})]}),v==="ai_strategy"&&a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-4",children:[a.jsx("div",{className:"w-16 h-16 bg-cyan-500/10 rounded-full flex items-center justify-center border border-cyan-500/30",children:a.jsx(Xdn,{})}),a.jsxs("div",{children:[a.jsx("h6",{className:"text-gray-200 font-bold",children:"Neural Strategy Engine"}),a.jsx("p",{className:"text-gray-500 text-xs max-w-md mx-auto mt-2",children:'The AI is currently monitoring your simulation parameters. Use the chat bar to request "Stress Tests", "Black Swan Simulations", or "Alpha Optimization".'})]}),a.jsx("button",{onClick:()=>{T("Run a high-performance alpha optimization for my current portfolio."),B()},className:"px-6 py-2 bg-cyan-500 hover:bg-cyan-400 text-gray-900 rounded-full text-xs font-bold transition-all",children:"INITIALIZE OPTIMIZATION"})]})]})]})]}),w&&a.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm",children:a.jsxs("div",{className:"bg-gray-900 border border-cyan-500/50 rounded-3xl w-full max-w-md overflow-hidden shadow-2xl shadow-cyan-500/20",children:[a.jsxs("div",{className:"p-6 border-b border-gray-800 flex justify-between items-center",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"Engine Configuration"}),a.jsx("button",{onClick:()=>S(!1),className:"text-gray-500 hover:text-white",children:a.jsx(Qdn,{})})]}),a.jsxs("div",{className:"p-8 space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs font-bold text-gray-400 uppercase",children:"Projection Horizon (Years)"}),a.jsx("input",{type:"number",value:C.years,onChange:U=>N({...C,years:Number(U.target.value)}),className:"w-full bg-gray-950 border border-gray-700 rounded-xl py-3 px-4 text-white focus:border-cyan-500 outline-none"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs font-bold text-gray-400 uppercase",children:"Monthly Capital Injection ($)"}),a.jsx("input",{type:"number",value:C.contribution,onChange:U=>N({...C,contribution:Number(U.target.value)}),className:"w-full bg-gray-950 border border-gray-700 rounded-xl py-3 px-4 text-white focus:border-cyan-500 outline-none"})]}),a.jsxs("div",{className:"pt-4 flex gap-4",children:[a.jsx("button",{onClick:()=>S(!1),className:"flex-1 py-3 rounded-xl bg-gray-800 text-gray-300 font-bold hover:bg-gray-700 transition-all",children:"ABORT"}),a.jsx("button",{onClick:F,className:"flex-1 py-3 rounded-xl bg-cyan-500 text-gray-900 font-bold hover:bg-cyan-400 transition-all shadow-lg shadow-cyan-500/20",children:"ENGAGE"})]})]}),a.jsx("div",{className:"p-4 bg-cyan-500/5 text-center",children:a.jsx("p",{className:"text-[10px] text-cyan-500/50 font-mono",children:"SECURE HANDSHAKE: QUANTUM-RSA-4096"})})]})}),a.jsx("div",{className:"text-center py-12 opacity-30 hover:opacity-100 transition-opacity duration-1000",children:a.jsxs("p",{className:"text-[10px] text-gray-500 max-w-2xl mx-auto italic leading-relaxed",children:[`"Someone said this about me... who would you feel? You're only 32 and you practically took a global bank and made the demo company over an interpretation of terms and conditions... I just read the cryptic message and an EIN 2021 and kept going."`,a.jsx("br",{}),a.jsx("span",{className:"mt-2 block font-bold",children:"— THE SOVEREIGN ARCHITECT"})]})})]})},Ydn=()=>a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 5l7 7-7 7M5 5l7 7-7 7"})}),Xdn=()=>a.jsx("svg",{className:"w-8 h-8 text-cyan-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),Qdn=()=>a.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})}),sTe=(()=>{const e=new WeakMap,t={id:"quantum-internal-ref"};e.set(t,new Map);const n=o=>btoa(`QUANTUM_SECURE_${o}_${Date.now()}`),r=o=>atob(o).replace(/^QUANTUM_SECURE_/,"").split("_")[0];return{set:(o,i)=>{var l;const s=n(JSON.stringify(i));(l=e.get(t))==null||l.set(o,s)},get:o=>{var s;const i=(s=e.get(t))==null?void 0:s.get(o);return i?JSON.parse(r(i)):null},has:o=>{var i;return(i=e.get(t))==null?void 0:i.has(o)}}})(),Jdn=()=>{const[e,t]=f.useState([]),n=f.useCallback((r,o,i="INFO")=>{const s={id:`LOG-${Math.random().toString(36).substr(2,9).toUpperCase()}`,timestamp:new Date().toISOString(),action:r,actor:"SYSTEM_AUTH_USER_01",severity:i,details:o,checksum:Math.random().toString(16).slice(2)};t(c=>[s,...c].slice(0,100));const l=sTe.get("audit_trail")||[];sTe.set("audit_trail",[s,...l])},[]);return{logs:e,logAction:n}},xR=()=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5.2a1 1 0 01-1.17.986l-3.2-1.1a1 1 0 00-1.26.95l.5 3.5a1 1 0 01-.45.95l-2.7 2.1a1 1 0 00-.55 1.34l3.2 5.9a1 1 0 01.05.52 1 1 0 01-1.6 1.04l-1.4-1.4a1 1 0 00-1.4 1.4l1.4 1.4a3 3 0 004.2 0l9.4-9.4a1 1 0 01-.1-1.5l-5.9-3.2a1 1 0 01-.5-.05l-3.5-.5a1 1 0 00-.95 1.26l1.1 3.2A1 1 0 018.8 11V2a1 1 0 011.3-.954z",clipRule:"evenodd"})}),KZ=()=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),Zdn=()=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})}),iM=({title:e,children:t,className:n,icon:r})=>a.jsxs("div",{className:`bg-gray-900/80 backdrop-blur-md border border-gray-800 rounded-xl overflow-hidden shadow-2xl ${n}`,children:[a.jsxs("div",{className:"px-6 py-4 border-b border-gray-800 flex items-center justify-between bg-gradient-to-r from-gray-900 to-gray-800",children:[a.jsxs("h3",{className:"text-lg font-bold text-white flex items-center gap-2",children:[r," ",e]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500/50"}),a.jsx("div",{className:"w-2 h-2 rounded-full bg-yellow-500/50"}),a.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500/50"})]})]}),a.jsx("div",{className:"p-6",children:t})]}),efn=({onAction:e})=>{const[t,n]=f.useState(!1),[r,o]=f.useState([{role:"ai",content:"Welcome to Quantum Financial. I am your AI co-pilot. Think of this as the cockpit of a high-performance vehicle. How can I help you navigate your global finances today?"}]),[i,s]=f.useState(""),[l,c]=f.useState(!1),u=f.useRef(null);f.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[r]);const d=async()=>{if(!i.trim())return;const p=i;s(""),o(h=>[...h,{role:"user",content:p}]),c(!0);try{const m=new Ko("").getGenerativeModel({model:"gemini-3-flash-preview"}),g=` You are the Quantum Financial AI Assistant. Context: Global Business Banking Demo. User Instruction: ${p} Capabilities: 1. Create Wire Transfers 2. Generate Fraud Reports 3. Rebalance Portfolios 4. Analyze Risk If the user wants to "create" or "do" something, respond with a JSON block at the end of your message like this: ACTION: {"type": "WIRE_TRANSFER", "amount": 50000, "recipient": "Global Corp"} Tone: Elite, Professional, Secure. `,v=(await(await m.generateContent(g)).response).text(),b=v.match(/ACTION: ({.*})/);if(b){const w=JSON.parse(b[1]);e(w.type,w)}o(w=>[...w,{role:"ai",content:v.replace(/ACTION: {.*}/,"")}])}catch{o(m=>[...m,{role:"ai",content:"I apologize, but I'm experiencing a momentary synchronization delay with the global markets. Please try again."}])}finally{c(!1)}};return a.jsx("div",{className:"fixed bottom-6 right-6 z-[100]",children:t?a.jsxs("div",{className:"w-96 h-[500px] bg-gray-900 border border-cyan-500/30 rounded-2xl shadow-2xl flex flex-col overflow-hidden animate-in slide-in-from-bottom-10 duration-300",children:[a.jsxs("div",{className:"p-4 bg-cyan-900/20 border-b border-gray-800 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-cyan-400 rounded-full animate-pulse"}),a.jsx("span",{className:"font-bold text-cyan-400 text-sm tracking-widest uppercase",children:"Quantum AI Co-Pilot"})]}),a.jsx("button",{onClick:()=>n(!1),className:"text-gray-500 hover:text-white",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsxs("div",{ref:u,className:"flex-1 overflow-y-auto p-4 space-y-4 custom-scrollbar",children:[r.map((p,h)=>a.jsx("div",{className:`flex ${p.role==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[80%] p-3 rounded-xl text-sm ${p.role==="user"?"bg-cyan-600 text-white":"bg-gray-800 text-gray-300 border border-gray-700"}`,children:p.content})},h)),l&&a.jsx("div",{className:"text-xs text-cyan-500 animate-pulse",children:"AI is calculating market vectors..."})]}),a.jsx("div",{className:"p-4 border-t border-gray-800 bg-gray-950",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{value:i,onChange:p=>s(p.target.value),onKeyDown:p=>p.key==="Enter"&&d(),placeholder:"Command the system...",className:"flex-1 bg-gray-900 border border-gray-700 rounded-lg px-3 py-2 text-sm text-white focus:outline-none focus:border-cyan-500 transition-colors"}),a.jsx("button",{onClick:d,className:"bg-cyan-600 p-2 rounded-lg hover:bg-cyan-500",children:a.jsx(xR,{})})]})})]}):a.jsxs("button",{onClick:()=>n(!0),className:"w-16 h-16 bg-cyan-600 rounded-full flex items-center justify-center shadow-2xl hover:scale-110 transition-transform group",children:[a.jsx("div",{className:"absolute inset-0 rounded-full bg-cyan-400 animate-ping opacity-20"}),a.jsx(Zdn,{})]})})},tfn=({amount:e,recipient:t,onClose:n,onComplete:r})=>{const[o,i]=f.useState(1),[s,l]=f.useState(!1),c=()=>{l(!0),setTimeout(()=>{l(!1),i(2),r()},2500)};return a.jsx("div",{className:"fixed inset-0 bg-black/90 z-[110] flex items-center justify-center backdrop-blur-xl",children:a.jsxs("div",{className:"bg-white w-full max-w-md rounded-2xl overflow-hidden shadow-[0_0_50px_rgba(0,0,0,0.5)] text-gray-900",children:[a.jsxs("div",{className:"p-8",children:[a.jsxs("div",{className:"flex justify-between items-center mb-8",children:[a.jsx("div",{className:"text-2xl font-bold tracking-tighter text-indigo-600",children:"Stripe"}),a.jsx("button",{onClick:n,className:"text-gray-400 hover:text-gray-600",children:a.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),o===1?a.jsxs("div",{className:"animate-in fade-in slide-in-from-bottom-4 duration-500",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-xs font-bold uppercase text-gray-500 mb-2",children:"Payment to"}),a.jsx("div",{className:"text-lg font-semibold",children:t})]}),a.jsxs("div",{className:"mb-8",children:[a.jsx("label",{className:"block text-xs font-bold uppercase text-gray-500 mb-2",children:"Amount"}),a.jsxs("div",{className:"text-4xl font-black",children:["$",e.toLocaleString()]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"p-4 border border-gray-200 rounded-xl flex items-center gap-4",children:[a.jsx("div",{className:"w-12 h-8 bg-gray-100 rounded flex items-center justify-center font-bold text-[10px]",children:"VISA"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"text-sm font-medium",children:"•••• 4242"}),a.jsx("div",{className:"text-xs text-gray-400",children:"Expires 12/26"})]})]}),a.jsx("button",{onClick:c,disabled:s,className:"w-full bg-indigo-600 text-white py-4 rounded-xl font-bold text-lg hover:bg-indigo-700 transition-all disabled:opacity-50 flex items-center justify-center gap-3",children:s?a.jsx("div",{className:"w-6 h-6 border-4 border-white/30 border-t-white rounded-full animate-spin"}):`Pay $${e.toLocaleString()}`})]})]}):a.jsxs("div",{className:"text-center py-12 animate-in zoom-in duration-500",children:[a.jsx("div",{className:"w-20 h-20 bg-green-100 text-green-600 rounded-full flex items-center justify-center mx-auto mb-6",children:a.jsx("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"3",d:"M5 13l4 4L19 7"})})}),a.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Payment Successful"}),a.jsx("p",{className:"text-gray-500 mb-8",children:"Transaction ID: ch_3N5k9L2eZvKYlo2C1"}),a.jsx("button",{onClick:n,className:"w-full bg-gray-900 text-white py-4 rounded-xl font-bold",children:"Return to Quantum"})]})]}),a.jsx("div",{className:"bg-gray-50 p-4 text-center text-[10px] text-gray-400 uppercase tracking-widest font-bold",children:"Secure Encrypted Transaction via Quantum Financial"})]})})},tnt=()=>{const{logs:e,logAction:t}=Jdn(),[n,r]=f.useState(null),[o,i]=f.useState(!1),[s,l]=f.useState({amount:0,recipient:""}),c=f.useMemo(()=>[{id:"ins_1",title:"Anomalous Outflow Detected",description:"A series of high-velocity transfers to a non-whitelisted entity in Singapore has been flagged by our neural monitors.",urgency:"high",confidenceScore:98,actionable:!0,actionType:"fraud_alert",details:{entity:"SG-Global-Trade",amount:125e4},tags:["Security","Fraud","Critical"],geinFactor:.99,riskAnalysis:{volatilityIndex:88,sharpeRatio:.5,maxDrawdown:40},backtestData:Array.from({length:20},(p,h)=>({name:`T-${20-h}`,value:50+Math.random()*50})),alternativeActions:[{actionType:"freeze_account",rationale:"Immediate cessation of all outbound liquidity.",confidence:95},{actionType:"manual_review",rationale:"Escalate to human compliance officer.",confidence:80}]},{id:"ins_2",title:"Yield Optimization: EUR/USD",description:"Predictive models suggest a 48-hour window of increased volatility in the Eurozone. Hedging recommended.",urgency:"medium",confidenceScore:84,actionable:!0,actionType:"execute_trade",details:{pair:"EUR/USD",strategy:"Short-Gamma"},tags:["FX","Yield","Alpha"],geinFactor:.82,riskAnalysis:{volatilityIndex:34,sharpeRatio:2.1,maxDrawdown:5},backtestData:Array.from({length:20},(p,h)=>({name:`T-${20-h}`,value:100+h*2+Math.random()*5})),alternativeActions:[{actionType:"spot_buy",rationale:"Direct exposure to the underlying asset.",confidence:60}]},{id:"ins_3",title:"Liquidity Provision Opportunity",description:"Quantum Pool #42 is showing a 12% APR spike due to institutional rebalancing.",urgency:"low",confidenceScore:72,actionable:!0,actionType:"liquidity_provision",details:{pool:"Quantum-Alpha-IV"},tags:["Treasury","Passive"],geinFactor:.75,riskAnalysis:{volatilityIndex:12,sharpeRatio:3.5,maxDrawdown:2},backtestData:Array.from({length:20},(p,h)=>({name:`T-${20-h}`,value:100+Math.sin(h)*10})),alternativeActions:[]}],[]),u=(p,h)=>{t(`AI_TRIGGERED_${p}`,JSON.stringify(h),"INFO"),p==="WIRE_TRANSFER"&&(l({amount:h.amount||1e3,recipient:h.recipient||"Unknown Entity"}),i(!0))},d=p=>{t(`STRATEGY_EXECUTION_${p.actionType}`,`Executing strategy for ${p.id}`,"CRITICAL"),r(null),alert(`Strategy ${p.actionType} initiated. Check Audit Logs for progress.`)};return a.jsxs("div",{className:"min-h-screen bg-[#05070a] text-gray-300 p-8 font-sans selection:bg-cyan-500/30",children:[a.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center mb-12 gap-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-cyan-500 to-blue-600 rounded-lg flex items-center justify-center shadow-[0_0_20px_rgba(6,182,212,0.5)]",children:a.jsx(KZ,{})}),a.jsx("h1",{className:"text-4xl font-black text-white tracking-tighter uppercase italic",children:"Quantum Financial"})]}),a.jsx("p",{className:"text-gray-500 font-medium tracking-widest text-xs uppercase",children:"Global Institutional Command Center // Secure Node 0x4F2"})]}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("div",{className:"bg-gray-900 border border-gray-800 px-6 py-3 rounded-xl flex flex-col items-end",children:[a.jsx("span",{className:"text-[10px] text-gray-500 font-bold uppercase",children:"Total Liquidity"}),a.jsx("span",{className:"text-2xl font-mono text-cyan-400 font-bold",children:"$4,290,122,004.82"})]}),a.jsxs("div",{className:"bg-gray-900 border border-gray-800 px-6 py-3 rounded-xl flex flex-col items-end",children:[a.jsx("span",{className:"text-[10px] text-gray-500 font-bold uppercase",children:"System Health"}),a.jsx("span",{className:"text-2xl font-mono text-green-400 font-bold",children:"99.99%"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8",children:[a.jsxs("div",{className:"lg:col-span-4 space-y-8",children:[a.jsx(iM,{title:"Strategic Intelligence",icon:a.jsx(xR,{}),className:"border-l-4 border-l-cyan-500",children:a.jsx("div",{className:"space-y-4",children:c.map(p=>a.jsxs("div",{onClick:()=>r(p),className:"group relative p-4 bg-gray-800/30 border border-gray-800 rounded-xl hover:border-cyan-500/50 transition-all cursor-pointer overflow-hidden",children:[a.jsx("div",{className:`absolute top-0 right-0 w-1 h-full ${p.urgency==="high"?"bg-red-500":p.urgency==="medium"?"bg-yellow-500":"bg-blue-500"}`}),a.jsxs("div",{className:"flex justify-between items-start mb-2",children:[a.jsx("h4",{className:"font-bold text-white group-hover:text-cyan-400 transition-colors",children:p.title}),a.jsxs("span",{className:"text-[10px] font-mono text-gray-500",children:[p.confidenceScore,"% CONF"]})]}),a.jsx("p",{className:"text-xs text-gray-400 line-clamp-2 mb-3",children:p.description}),a.jsx("div",{className:"flex gap-2",children:p.tags.map(h=>a.jsx("span",{className:"text-[9px] px-2 py-0.5 bg-gray-900 rounded border border-gray-700 text-gray-500 uppercase font-bold",children:h},h))})]},p.id))})}),a.jsx(iM,{title:"Global Market Vectors",icon:a.jsx(xR,{}),children:a.jsx("div",{className:"h-64",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(wm,{data:Array.from({length:12},(p,h)=>({name:h,val:4e3+Math.random()*2e3})),children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"colorVal",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#06b6d4",stopOpacity:.3}),a.jsx("stop",{offset:"95%",stopColor:"#06b6d4",stopOpacity:0})]})}),a.jsx(hu,{type:"monotone",dataKey:"val",stroke:"#06b6d4",fillOpacity:1,fill:"url(#colorVal)"})]})})})})]}),a.jsx("div",{className:"lg:col-span-5 space-y-8",children:a.jsxs(iM,{title:"Real-Time Performance Engine",className:"h-full",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-8",children:[a.jsxs("div",{className:"p-4 bg-gray-800/20 rounded-xl border border-gray-800",children:[a.jsx("div",{className:"text-[10px] text-gray-500 uppercase font-bold mb-1",children:"Alpha Generation"}),a.jsx("div",{className:"text-xl font-mono text-white",children:"+14.2%"})]}),a.jsxs("div",{className:"p-4 bg-gray-800/20 rounded-xl border border-gray-800",children:[a.jsx("div",{className:"text-[10px] text-gray-500 uppercase font-bold mb-1",children:"Risk Exposure"}),a.jsx("div",{className:"text-xl font-mono text-yellow-500",children:"MODERATE"})]})]}),a.jsx("div",{className:"h-[400px]",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(Yx,{data:Array.from({length:8},(p,h)=>({name:`Node ${h}`,value:Math.random()*100})),children:[a.jsx(kl,{strokeDasharray:"3 3",stroke:"#1f2937",vertical:!1}),a.jsx(Ka,{dataKey:"name",stroke:"#4b5563",fontSize:10}),a.jsx(ra,{stroke:"#4b5563",fontSize:10}),a.jsx(ji,{contentStyle:{backgroundColor:"#0f172a",border:"1px solid #1e293b",borderRadius:"8px"},itemStyle:{color:"#06b6d4"}}),a.jsx(cf,{dataKey:"value",radius:[4,4,0,0],children:Array.from({length:8}).map((p,h)=>a.jsx(Eh,{fill:h%2===0?"#06b6d4":"#3b82f6"},`cell-${h}`))})]})})}),a.jsxs("div",{className:"mt-8 p-4 bg-cyan-900/10 border border-cyan-500/20 rounded-xl",children:[a.jsxs("div",{className:"flex items-center gap-3 text-cyan-400 mb-2",children:[a.jsx(xR,{}),a.jsx("span",{className:"text-sm font-bold uppercase tracking-widest",children:"AI Optimization Active"})]}),a.jsx("p",{className:"text-xs text-gray-400 leading-relaxed",children:"Our proprietary GEIN (Generative Edge & Intelligence Nexus) is currently re-routing liquidity through the Frankfurt-Singapore corridor to minimize latency and maximize yield."})]})]})}),a.jsxs("div",{className:"lg:col-span-3 space-y-8",children:[a.jsx(iM,{title:"Immutable Audit Trail",icon:a.jsx(KZ,{}),children:a.jsxs("div",{className:"space-y-4 max-h-[600px] overflow-y-auto custom-scrollbar pr-2",children:[e.length===0&&a.jsx("div",{className:"text-center py-8 text-gray-600 italic text-sm",children:"No sensitive actions recorded in current session."}),e.map(p=>a.jsxs("div",{className:"p-3 bg-gray-950 border-l-2 border-gray-800 rounded-r-lg",children:[a.jsxs("div",{className:"flex justify-between items-center mb-1",children:[a.jsx("span",{className:`text-[9px] font-bold px-1.5 py-0.5 rounded ${p.severity==="CRITICAL"?"bg-red-900/40 text-red-400":"bg-gray-800 text-gray-400"}`,children:p.severity}),a.jsx("span",{className:"text-[8px] font-mono text-gray-600",children:new Date(p.timestamp).toLocaleTimeString()})]}),a.jsx("div",{className:"text-[11px] font-bold text-gray-300 mb-1",children:p.action}),a.jsx("div",{className:"text-[9px] text-gray-500 font-mono truncate",children:p.details}),a.jsxs("div",{className:"mt-2 text-[8px] text-cyan-900 font-mono uppercase tracking-tighter",children:["SIG: ",p.checksum]})]},p.id))]})}),a.jsx(iM,{title:"Security Status",icon:a.jsx(KZ,{}),children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-green-900/10 border border-green-500/20 rounded-lg",children:[a.jsx("span",{className:"text-xs font-bold text-green-500",children:"MFA STATUS"}),a.jsx("span",{className:"text-xs font-mono text-white",children:"VERIFIED"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-cyan-900/10 border border-cyan-500/20 rounded-lg",children:[a.jsx("span",{className:"text-xs font-bold text-cyan-500",children:"ENCRYPTION"}),a.jsx("span",{className:"text-xs font-mono text-white",children:"AES-GCM-256"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-purple-900/10 border border-purple-500/20 rounded-lg",children:[a.jsx("span",{className:"text-xs font-bold text-purple-500",children:"VAULT MODE"}),a.jsx("span",{className:"text-xs font-mono text-white",children:"HOMOMORPHIC"})]})]})})]})]}),n&&a.jsx("div",{className:"fixed inset-0 bg-black/80 z-[105] flex items-center justify-center backdrop-blur-md p-4",children:a.jsxs("div",{className:"bg-gray-900 w-full max-w-2xl rounded-2xl border border-gray-700 shadow-2xl overflow-hidden animate-in zoom-in duration-200",children:[a.jsxs("div",{className:"p-6 border-b border-gray-800 flex justify-between items-center bg-gradient-to-r from-gray-900 to-gray-800",children:[a.jsxs("h3",{className:"text-xl font-bold text-white flex items-center gap-3",children:[a.jsx(xR,{})," Strategic Execution Module"]}),a.jsx("button",{onClick:()=>r(null),className:"text-gray-500 hover:text-white",children:a.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsxs("div",{className:"p-8",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("div",{className:"text-xs font-bold text-cyan-500 uppercase tracking-widest mb-2",children:"Insight Analysis"}),a.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:n.title}),a.jsx("p",{className:"text-gray-400 leading-relaxed",children:n.description})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-6 mb-8",children:[a.jsxs("div",{className:"p-4 bg-gray-800/50 rounded-xl border border-gray-700 text-center",children:[a.jsx("div",{className:"text-[10px] text-gray-500 uppercase font-bold mb-1",children:"Volatility"}),a.jsx("div",{className:"text-xl font-mono text-white",children:n.riskAnalysis.volatilityIndex})]}),a.jsxs("div",{className:"p-4 bg-gray-800/50 rounded-xl border border-gray-700 text-center",children:[a.jsx("div",{className:"text-[10px] text-gray-500 uppercase font-bold mb-1",children:"Sharpe"}),a.jsx("div",{className:"text-xl font-mono text-green-400",children:n.riskAnalysis.sharpeRatio})]}),a.jsxs("div",{className:"p-4 bg-gray-800/50 rounded-xl border border-gray-700 text-center",children:[a.jsx("div",{className:"text-[10px] text-gray-500 uppercase font-bold mb-1",children:"Max DD"}),a.jsxs("div",{className:"text-xl font-mono text-red-400",children:[n.riskAnalysis.maxDrawdown,"%"]})]})]}),a.jsx("div",{className:"h-48 mb-8 bg-gray-950 rounded-xl border border-gray-800 p-4",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsx(vw,{data:n.backtestData,children:a.jsx(au,{type:"monotone",dataKey:"value",stroke:"#06b6d4",strokeWidth:3,dot:!1})})})}),a.jsxs("div",{className:"flex gap-4",children:[a.jsx("button",{onClick:()=>r(null),className:"flex-1 px-6 py-4 bg-gray-800 text-white font-bold rounded-xl hover:bg-gray-700 transition-colors",children:"Decline Strategy"}),a.jsx("button",{onClick:()=>d(n),className:"flex-1 px-6 py-4 bg-cyan-600 text-white font-bold rounded-xl hover:bg-cyan-500 shadow-[0_0_30px_rgba(6,182,212,0.4)] transition-all transform hover:scale-[1.02]",children:"Execute Strategy"})]})]})]})}),o&&a.jsx(tfn,{amount:s.amount,recipient:s.recipient,onClose:()=>i(!1),onComplete:()=>t("STRIPE_PAYMENT_SUCCESS",`Paid ${s.amount} to ${s.recipient}`,"INFO")}),a.jsx(efn,{onAction:u}),a.jsxs("div",{className:"mt-12 pt-8 border-t border-gray-900 flex justify-between items-center text-[10px] text-gray-600 font-bold uppercase tracking-[0.2em]",children:[a.jsx("div",{children:"© 2024 Quantum Financial Institutional Group. All Rights Reserved."}),a.jsxs("div",{className:"flex gap-6",children:[a.jsx("span",{className:"hover:text-cyan-500 cursor-pointer transition-colors",children:"Terms of Service"}),a.jsx("span",{className:"hover:text-cyan-500 cursor-pointer transition-colors",children:"Privacy Protocol"}),a.jsx("span",{className:"hover:text-cyan-500 cursor-pointer transition-colors",children:"Regulatory Disclosures"})]})]})]})},nfn=()=>{const e=f.useContext(ia);if(!e)throw new Error("Dashboard requires DataContext.");const{transactions:t,financialGoals:n,setActiveView:r,creditScore:o,rewardPoints:i,assets:s,isProductionApproved:l,plaidProducts:c}=e,u=f.useMemo(()=>s.reduce((d,p)=>d+p.value,0),[s]);return a.jsxs("div",{className:"space-y-8 animate-in fade-in duration-700 p-2 md:p-6 bg-gray-950 min-h-screen",children:[a.jsxs("header",{className:"flex flex-col md:flex-row justify-between items-start md:items-end gap-4 border-b border-gray-800 pb-8",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2 flex-wrap",children:[a.jsx("div",{className:"px-2 py-0.5 bg-green-500/10 border border-green-500/30 rounded text-[10px] text-green-400 font-black tracking-widest uppercase",children:"Production Environment"}),a.jsx("div",{className:"px-2 py-0.5 bg-cyan-500/10 border border-cyan-500/30 rounded text-[10px] text-cyan-400 font-black tracking-widest uppercase",children:"Handshake Stable"})]}),a.jsx("h1",{className:"text-6xl font-black text-white tracking-tighter uppercase font-mono italic",children:"Nexus OS"}),a.jsxs("p",{className:"text-emerald-400 mt-1 flex items-center gap-2 font-mono text-sm tracking-widest uppercase",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-green-500 animate-pulse"}),"SIGNAL: ",l?"PRODUCTION_ACTIVE":"INITIALIZING"]})]}),a.jsxs("div",{className:"flex gap-3 flex-wrap",children:[a.jsxs("button",{onClick:()=>r(wt.ComplianceOracle),className:"px-4 py-2 bg-indigo-900/20 hover:bg-indigo-900/40 border border-indigo-500/50 rounded-xl text-sm font-bold text-indigo-300 flex items-center gap-2 transition-all shadow-[0_0_15px_rgba(99,102,241,0.1)]",children:[a.jsx(ri,{size:18})," Welcome to the DEMO"]}),a.jsx("button",{onClick:()=>r(wt.SendMoney),className:"px-6 py-2 bg-cyan-600 hover:bg-cyan-500 rounded-xl text-white text-sm font-bold shadow-lg shadow-cyan-500/20 transition-all active:scale-95 uppercase tracking-widest",children:"Initiate Capital Flow"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-6",children:[a.jsxs(Ft,{className:"border-cyan-500/20 bg-cyan-950/5 text-center py-6 group hover:border-cyan-500/50 transition-all",children:[a.jsx(kd,{className:"w-8 h-8 mx-auto text-cyan-400 mb-2 group-hover:scale-110 transition-transform"}),a.jsx("p",{className:"text-3xl font-black text-white font-mono",children:(o.score/100).toFixed(2)}),a.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest font-bold mt-1",children:"Trust Score (Q-Resistant)"})]}),a.jsxs(Ft,{className:"border-purple-500/20 bg-purple-950/5 text-center py-6 group hover:border-purple-500/50 transition-all",children:[a.jsx(Xi,{className:"w-8 h-8 mx-auto text-purple-400 mb-2 group-hover:scale-110 transition-transform"}),a.jsx("p",{className:"text-3xl font-black text-white font-mono",children:c.length}),a.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest font-bold mt-1",children:"Active Protocols"})]}),a.jsxs(Ft,{className:"border-green-500/20 bg-green-950/5 text-center py-6 group hover:border-green-500/50 transition-all",children:[a.jsx(rl,{className:"w-8 h-8 mx-auto text-green-400 mb-2 group-hover:scale-110 transition-transform"}),a.jsx("p",{className:"text-3xl font-black text-white font-mono",children:"100%"}),a.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest font-bold mt-1",children:"Ledger Integrity"})]}),a.jsxs(Ft,{className:"border-emerald-500/20 bg-emerald-950/5 text-center py-6 group hover:border-emerald-500/50 transition-all",children:[a.jsx(dg,{className:"w-8 h-8 mx-auto text-emerald-400 mb-2 group-hover:scale-110 transition-transform"}),a.jsx("p",{className:"text-3xl font-black text-white font-mono",children:"VERIFIED"}),a.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest font-bold mt-1",children:"Identity Verified"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8 mt-8",children:[a.jsxs("div",{className:"lg:col-span-8 flex flex-col gap-8",children:[a.jsxs(Ft,{title:"Sovereign Wealth Topology",className:"relative overflow-hidden bg-black/40 border-indigo-900/50 p-0",children:[a.jsx("div",{className:"absolute top-6 left-6 z-10",children:a.jsx("span",{className:"px-3 py-1.5 bg-indigo-900/40 border border-indigo-500/30 text-indigo-300 text-[10px] font-bold font-mono rounded-lg backdrop-blur",children:"MULTIVERSE_PROJECTION_V6"})}),a.jsx(Kdn,{})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsx(zdn,{}),a.jsx(tnt,{})]})]}),a.jsxs("div",{className:"lg:col-span-4 flex flex-col gap-8",children:[a.jsx(Ft,{title:"Production Authority",className:"border-indigo-500/20 bg-indigo-950/5 p-6",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-4 p-4 bg-black/40 rounded-2xl border border-indigo-500/20",children:[a.jsx(IE,{className:"text-indigo-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-bold text-white uppercase",children:"License: Apache 2.0"}),a.jsx("p",{className:"text-[10px] text-gray-400 font-mono",children:"Open Source Institutional Standard"})]})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/40 rounded-2xl border border-emerald-500/20",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Y1,{className:"text-emerald-400"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-bold text-white uppercase",children:"Net Liquidity"}),a.jsx("p",{className:"text-[10px] text-gray-400 font-mono",children:"Verified Reserves"})]})]}),a.jsxs("span",{className:"text-lg font-black text-white",children:["$",(u/1e6).toFixed(2),"M"]})]})]})}),a.jsx(Ft,{title:"Strategic Phase Allocation",className:"border-green-500/20 p-6",children:a.jsxs("div",{className:"space-y-6",children:[[{name:"Phase 0: Launch",pct:100},{name:"Phase 1: Deep Insights",pct:45},{name:"Phase 2: Wealth Sync",pct:12}].map(d=>a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-[10px] font-black uppercase tracking-widest",children:[a.jsx("span",{className:"text-gray-300",children:d.name}),a.jsxs("span",{className:"text-green-400 font-mono",children:[d.pct,"%"]})]}),a.jsx("div",{className:"w-full bg-gray-800 rounded-full h-1.5 overflow-hidden",children:a.jsx("div",{className:"bg-gradient-to-r from-cyan-500 via-indigo-500 to-green-500 h-full transition-all duration-1000",style:{width:`${d.pct}%`}})})]},d.name)),a.jsx("button",{onClick:()=>r(wt.FinancialGoals),className:"w-full py-3 bg-gray-900 hover:bg-gray-800 rounded-xl text-[10px] font-black text-gray-400 uppercase tracking-[0.2em] transition-all border border-gray-800",children:"Review Full Protocol"})]})})]}),a.jsx("div",{className:"lg:col-span-12",children:a.jsx(Wdn,{transactions:t.slice(0,10),setActiveView:r})})]})]})},rfn="v4.0.0-ALPHA-SOVEREIGN",ofn=({onVerified:e,onCancel:t})=>{const[n,r]=f.useState(["","","","","",""]),[o,i]=f.useState(!1),s=(c,u)=>{if(u.length>1)return;const d=[...n];if(d[c]=u,r(d),u&&c<5){const p=document.getElementById(`mfa-${c+1}`);p==null||p.focus()}},l=async()=>{i(!0),await new Promise(c=>setTimeout(c,1200)),i(!1),e()};return a.jsx("div",{className:"fixed inset-0 bg-black/90 backdrop-blur-xl flex items-center justify-center z-[100] p-4",children:a.jsxs("div",{className:"bg-gray-900 border border-cyan-500/30 rounded-2xl p-8 max-w-md w-full shadow-[0_0_50px_rgba(6,182,212,0.2)]",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-cyan-500/10 mb-4",children:a.jsx("svg",{className:"w-8 h-8 text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),a.jsx("h3",{className:"text-2xl font-bold text-white",children:"Biometric Handshake"}),a.jsx("p",{className:"text-gray-400 mt-2",children:"Enter the 6-digit secure token from your Quantum Authenticator."})]}),a.jsx("div",{className:"flex justify-between gap-2 mb-8",children:n.map((c,u)=>a.jsx("input",{id:`mfa-${u}`,type:"text",maxLength:1,value:c,onChange:d=>s(u,d.target.value),className:"w-12 h-14 bg-gray-800 border border-gray-700 rounded-lg text-center text-2xl font-bold text-cyan-400 focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 outline-none transition-all"},u))}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("button",{onClick:l,disabled:o||n.some(c=>!c),className:"w-full py-3 bg-cyan-600 hover:bg-cyan-500 disabled:opacity-50 disabled:cursor-not-allowed text-white font-bold rounded-xl transition-all shadow-lg shadow-cyan-900/20",children:o?"Synchronizing...":"Verify Identity"}),a.jsx("button",{onClick:t,className:"w-full py-3 text-gray-500 hover:text-gray-300 font-medium transition-colors",children:"Cancel Transaction"})]})]})})},ifn=({logs:e})=>a.jsxs("div",{className:"space-y-2 max-h-[400px] overflow-y-auto pr-2 custom-scrollbar",children:[e.length===0&&a.jsx("div",{className:"text-center py-10 text-gray-500 italic",children:"No sensitive actions recorded in this session."}),e.map(t=>a.jsxs("div",{className:"p-3 bg-gray-900/50 border-l-2 border-cyan-500 rounded-r-lg flex items-start justify-between group hover:bg-gray-800/50 transition-colors",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`text-[10px] font-bold px-1.5 py-0.5 rounded ${t.severity==="CRITICAL"?"bg-red-500/20 text-red-400":t.severity==="HIGH"?"bg-orange-500/20 text-orange-400":"bg-cyan-500/20 text-cyan-400"}`,children:t.severity}),a.jsx("span",{className:"text-sm font-semibold text-gray-200",children:t.action})]}),a.jsx("p",{className:"text-xs text-gray-400",children:t.targetResource}),a.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-gray-500",children:[a.jsx("span",{children:new Date(t.timestamp).toLocaleTimeString()}),a.jsxs("span",{children:["IP: ",t.ipAddress]})]})]}),a.jsx("div",{className:"opacity-0 group-hover:opacity-100 transition-opacity",children:a.jsx("button",{className:"text-cyan-500 hover:text-cyan-400 text-[10px] font-bold uppercase tracking-tighter",children:"Details"})})]},t.id))]}),afn=()=>{const e=f.useContext(ia);if(!e)throw new Error("TransactionsView must be within a DataProvider");const{transactions:t,addTransaction:n,showNotification:r}=e,[o,i]=f.useState("LEDGER"),[s,l]=f.useState(""),[c,u]=f.useState("ALL"),[d,p]=f.useState(!1),[h,m]=f.useState(()=>{}),[g,y]=f.useState([]),[x,v]=f.useState(""),[b,w]=f.useState([{role:"ai",content:"Welcome to the Quantum Command Center. I am your Sovereign AI Strategist. How shall we deploy capital today?"}]),[S,C]=f.useState(!1),[N,j]=f.useState({recipient:"",amount:"",type:"WIRE",reference:"",urgency:"STANDARD"}),I=f.useRef(null),_=f.useCallback((M,R,$="LOW",D)=>{const z={id:`LOG-${Math.random().toString(36).substr(2,9).toUpperCase()}`,timestamp:new Date().toISOString(),userId:"USR-77-X-ALPHA",action:M,targetResource:R,success:!0,severity:$,ipAddress:"192.168.1.104",userAgent:navigator.userAgent,metadata:D};y(V=>[z,...V])},[]),T=async M=>{if(!M.trim())return;const R={role:"user",content:M};w($=>[...$,R]),v(""),C(!0);try{const $=await fetch("/api/gemini",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:M})});if(!$.ok)throw new Error(`HTTP error! status: ${$.status}`);const z=(await $.json()).response;w(V=>[...V,{role:"ai",content:z}]),z.toLowerCase().includes("draft")&&z.toLowerCase().includes("payment")&&(j(V=>({...V,recipient:"AI Suggested Recipient",amount:"1000000",reference:"Strategic Capital Deployment"})),i("PAYMENTS"),r("AI has prepared a draft payment for your review.","info"),_("AI_DRAFT_PAYMENT","Payment Engine","MEDIUM"))}catch($){console.error("AI Core Failure:",$),w(D=>[...D,{role:"ai",content:"My neural link is currently experiencing interference. Please proceed with manual overrides."}])}finally{C(!1)}},P=M=>{M.preventDefault(),m(()=>()=>{const R={id:`TX-${Math.random().toString(36).substr(2,9).toUpperCase()}`,type:"expense",category:"Treasury Transfer",description:`${N.type} to ${N.recipient}`,amount:parseFloat(N.amount),date:new Date().toISOString().split("T")[0],currency:"USD",metadata:{urgency:N.urgency,ref:N.reference}};n(R),_("EXECUTE_PAYMENT",`Payment of $${N.amount} to ${N.recipient}`,"HIGH",N),r(`Capital deployed successfully via ${N.type} rail.`,"success"),j({recipient:"",amount:"",type:"WIRE",reference:"",urgency:"STANDARD"}),i("LEDGER")}),p(!0)},E=f.useMemo(()=>t.filter(M=>{const R=M.description.toLowerCase().includes(s.toLowerCase())||M.category.toLowerCase().includes(s.toLowerCase()),$=c==="ALL"||c==="INCOME"&&M.type==="income"||c==="EXPENSE"&&M.type==="expense";return R&&$}).sort((M,R)=>new Date(R.date).getTime()-new Date(M.date).getTime()),[t,s,c]);return f.useEffect(()=>{var M;(M=I.current)==null||M.scrollIntoView({behavior:"smooth"})},[b]),a.jsxs("div",{className:"min-h-screen bg-[#0a0a0c] text-gray-100 p-4 md:p-8 font-sans selection:bg-cyan-500/30",children:[d&&a.jsx(ofn,{onVerified:()=>{p(!1),h()},onCancel:()=>p(!1)}),a.jsxs("header",{className:"mb-10 flex flex-col md:flex-row md:items-end justify-between gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-cyan-500 to-blue-600 rounded-lg flex items-center justify-center shadow-lg shadow-cyan-500/20",children:a.jsx("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),a.jsxs("h1",{className:"text-4xl font-black tracking-tighter text-white uppercase italic",children:["Quantum ",a.jsx("span",{className:"text-cyan-500",children:"Financial"})]})]}),a.jsxs("p",{className:"text-gray-500 font-medium tracking-widest uppercase text-[10px]",children:["Sovereign Command Center // ",rfn," // Secure Node: Alpha-7"]})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"px-4 py-2 bg-gray-900/50 border border-gray-800 rounded-xl flex items-center gap-3",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),a.jsx("span",{className:"text-xs font-bold text-gray-300 uppercase tracking-widest",children:"Engine Status: Roaring"})]}),a.jsxs("div",{className:"px-4 py-2 bg-cyan-500/10 border border-cyan-500/20 rounded-xl flex items-center gap-3",children:[a.jsx("svg",{className:"w-4 h-4 text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),a.jsx("span",{className:"text-xs font-bold text-cyan-400 uppercase tracking-widest",children:"Golden Ticket Active"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8",children:[a.jsxs("div",{className:"lg:col-span-3 space-y-6",children:[a.jsx(Ft,{padding:"none",className:"overflow-hidden border-gray-800",children:a.jsx("nav",{className:"flex flex-col",children:[{id:"LEDGER",label:"Global Ledger",icon:"M4 6h16M4 10h16M4 14h16M4 18h16"},{id:"PAYMENTS",label:"Payment Engine",icon:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{id:"SECURITY",label:"Security Vault",icon:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},{id:"ANALYTICS",label:"Flow Analytics",icon:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},{id:"INTEGRATION",label:"ERP Bridge",icon:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h12a2 2 0 012 2v8a2 2 0 01-2 2h-2m-6 0l-4-4m0 0l4-4m-4 4h12"}].map(M=>a.jsxs("button",{onClick:()=>{i(M.id),_("NAVIGATE",M.label)},className:`flex items-center gap-4 px-6 py-4 text-sm font-bold transition-all border-l-4 ${o===M.id?"bg-cyan-500/10 border-cyan-500 text-white":"border-transparent text-gray-500 hover:bg-gray-800/50 hover:text-gray-300"}`,children:[a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:M.icon})}),M.label]},M.id))})}),a.jsx(Ft,{title:"Sovereign AI Strategist",subtitle:"Neural Command Interface",className:"border-cyan-500/20 shadow-[0_0_20px_rgba(6,182,212,0.05)]",children:a.jsxs("div",{className:"flex flex-col h-[400px]",children:[a.jsxs("div",{className:"flex-grow overflow-y-auto space-y-4 mb-4 pr-2 custom-scrollbar",children:[b.map((M,R)=>a.jsx("div",{className:`flex ${M.role==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[85%] p-3 rounded-2xl text-xs leading-relaxed ${M.role==="user"?"bg-cyan-600 text-white rounded-tr-none":"bg-gray-800 text-gray-300 border border-gray-700 rounded-tl-none"}`,children:M.content})},R)),S&&a.jsx("div",{className:"flex justify-start",children:a.jsx("div",{className:"bg-gray-800 p-3 rounded-2xl rounded-tl-none border border-gray-700",children:a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce [animation-delay:0.2s]"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce [animation-delay:0.4s]"})]})})}),a.jsx("div",{ref:I})]}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:x,onChange:M=>v(M.target.value),onKeyDown:M=>M.key==="Enter"&&T(x),placeholder:"Deploy capital...",className:"w-full bg-gray-900 border border-gray-700 rounded-xl px-4 py-3 text-sm text-white focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 outline-none transition-all pr-12"}),a.jsx("button",{onClick:()=>T(x),className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-cyan-500 hover:text-cyan-400 transition-colors",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 5l7 7-7 7M5 5l7 7-7 7"})})})]})]})})]}),a.jsxs("div",{className:"lg:col-span-9 space-y-8",children:[o==="LEDGER"&&a.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[a.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-center justify-between",children:[a.jsxs("div",{className:"relative w-full md:w-96",children:[a.jsx("svg",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("input",{type:"text",placeholder:"Search the FlowMatrix...",value:s,onChange:M=>l(M.target.value),className:"w-full bg-gray-900/50 border border-gray-800 rounded-xl pl-10 pr-4 py-2.5 text-sm text-white focus:border-cyan-500 outline-none transition-all"})]}),a.jsx("div",{className:"flex items-center gap-2 bg-gray-900/50 p-1 rounded-xl border border-gray-800",children:["ALL","INCOME","EXPENSE"].map(M=>a.jsx("button",{onClick:()=>u(M),className:`px-4 py-1.5 rounded-lg text-[10px] font-black uppercase tracking-widest transition-all ${c===M?"bg-cyan-600 text-white shadow-lg shadow-cyan-900/20":"text-gray-500 hover:text-gray-300"}`,children:M},M))})]}),a.jsx(Ft,{padding:"none",className:"border-gray-800 overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-gray-900/80 border-b border-gray-800",children:[a.jsx("th",{className:"px-6 py-4 text-[10px] font-black text-gray-500 uppercase tracking-widest",children:"Timestamp"}),a.jsx("th",{className:"px-6 py-4 text-[10px] font-black text-gray-500 uppercase tracking-widest",children:"Entity / Description"}),a.jsx("th",{className:"px-6 py-4 text-[10px] font-black text-gray-500 uppercase tracking-widest",children:"Category"}),a.jsx("th",{className:"px-6 py-4 text-[10px] font-black text-gray-500 uppercase tracking-widest text-right",children:"Quantum Value"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-800/50",children:E.map(M=>a.jsxs("tr",{className:"group hover:bg-cyan-500/[0.02] transition-colors cursor-pointer",children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("span",{className:"text-xs font-mono text-gray-500",children:M.date})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"text-sm font-bold text-gray-200 group-hover:text-cyan-400 transition-colors",children:M.description}),a.jsx("span",{className:"text-[10px] text-gray-600 font-mono uppercase",children:M.id})]})}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("span",{className:"px-2 py-1 bg-gray-800 text-gray-400 rounded text-[10px] font-bold uppercase tracking-tighter",children:M.category})}),a.jsx("td",{className:"px-6 py-4 text-right",children:a.jsxs("span",{className:`text-sm font-black font-mono ${M.type==="income"?"text-green-400":"text-red-400"}`,children:[M.type==="income"?"+":"-",new Intl.NumberFormat("en-US",{style:"currency",currency:M.currency||"USD"}).format(M.amount)]})})]},M.id))})]})})})]}),o==="PAYMENTS"&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[a.jsx(Ft,{title:"Capital Deployment",subtitle:"Wire, ACH, & Quantum Rails",children:a.jsxs("form",{onSubmit:P,className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[10px] font-black text-gray-500 uppercase tracking-widest",children:"Recipient Entity"}),a.jsx("input",{required:!0,type:"text",value:N.recipient,onChange:M=>j({...N,recipient:M.target.value}),placeholder:"e.g. Global Logistics Corp",className:"w-full bg-gray-900 border border-gray-800 rounded-xl px-4 py-3 text-sm text-white focus:border-cyan-500 outline-none transition-all"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[10px] font-black text-gray-500 uppercase tracking-widest",children:"Amount (USD)"}),a.jsx("input",{required:!0,type:"number",value:N.amount,onChange:M=>j({...N,amount:M.target.value}),placeholder:"0.00",className:"w-full bg-gray-900 border border-gray-800 rounded-xl px-4 py-3 text-sm text-white focus:border-cyan-500 outline-none transition-all font-mono"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[10px] font-black text-gray-500 uppercase tracking-widest",children:"Rail Type"}),a.jsxs("select",{value:N.type,onChange:M=>j({...N,type:M.target.value}),className:"w-full bg-gray-900 border border-gray-800 rounded-xl px-4 py-3 text-sm text-white focus:border-cyan-500 outline-none transition-all",children:[a.jsx("option",{value:"WIRE",children:"SWIFT Wire"}),a.jsx("option",{value:"ACH",children:"Next-Day ACH"}),a.jsx("option",{value:"QUANTUM",children:"Quantum Instant"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[10px] font-black text-gray-500 uppercase tracking-widest",children:"Urgency Level"}),a.jsx("div",{className:"flex gap-2",children:["STANDARD","PRIORITY","INSTANT"].map(M=>a.jsx("button",{type:"button",onClick:()=>j({...N,urgency:M}),className:`flex-1 py-2 rounded-lg text-[10px] font-black uppercase tracking-widest border transition-all ${N.urgency===M?"bg-cyan-600 border-cyan-500 text-white":"bg-gray-900 border-gray-800 text-gray-500 hover:border-gray-700"}`,children:M},M))})]}),a.jsx("div",{className:"pt-4",children:a.jsx("button",{type:"submit",className:"w-full py-4 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 text-white font-black uppercase tracking-[0.2em] rounded-xl shadow-xl shadow-cyan-900/20 transition-all active:scale-[0.98]",children:"Authorize Deployment"})})]})}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(Ft,{title:"Audit Storage",subtitle:"Session Immutable Logs",children:a.jsx(ifn,{logs:g})}),a.jsx(Ft,{title:"Integration Bridge",subtitle:"ERP Sync Status",children:a.jsx("div",{className:"space-y-4",children:[{name:"SAP S/4HANA",status:"CONNECTED",latency:"12ms"},{name:"Oracle NetSuite",status:"SYNCING",latency:"45ms"},{name:"Microsoft Dynamics",status:"STANDBY",latency:"-"}].map(M=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-900/50 rounded-lg border border-gray-800",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`w-2 h-2 rounded-full ${M.status==="CONNECTED"?"bg-green-500":M.status==="SYNCING"?"bg-cyan-500 animate-pulse":"bg-gray-600"}`}),a.jsx("span",{className:"text-xs font-bold text-gray-300",children:M.name})]}),a.jsx("span",{className:"text-[10px] font-mono text-gray-500",children:M.latency})]},M.name))})})]})]}),o==="SECURITY"&&a.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs(Ft,{isMetric:!0,title:"Risk Score",subtitle:"Real-time Heuristics",children:[a.jsx("div",{className:"text-5xl font-black text-green-400 tracking-tighter",children:"0.02"}),a.jsx("div",{className:"text-[10px] font-bold text-gray-500 uppercase mt-2",children:"Ultra-Low Risk Profile"})]}),a.jsxs(Ft,{isMetric:!0,title:"Active Threats",subtitle:"Global Perimeter",children:[a.jsx("div",{className:"text-5xl font-black text-white tracking-tighter",children:"0"}),a.jsx("div",{className:"text-[10px] font-bold text-gray-500 uppercase mt-2",children:"Perimeter Secure"})]}),a.jsxs(Ft,{isMetric:!0,title:"MFA Status",subtitle:"Biometric Sync",children:[a.jsx("div",{className:"text-5xl font-black text-cyan-400 tracking-tighter",children:"100%"}),a.jsx("div",{className:"text-[10px] font-bold text-gray-500 uppercase mt-2",children:"Hardware Keys Enforced"})]})]}),a.jsx(Ft,{title:"Fraud Monitoring Engine",subtitle:"Neural Pattern Recognition",children:a.jsx("div",{className:"space-y-4",children:[{id:"H-1",name:"Velocity Check",status:"ACTIVE",risk:0,desc:"Monitoring transaction frequency across global nodes."},{id:"H-2",name:"Geospatial Anomaly",status:"ACTIVE",risk:2,desc:"Detecting impossible travel between login events."},{id:"H-3",name:"Behavioral Biometrics",status:"LEARNING",risk:0,desc:"Analyzing keystroke dynamics and mouse movement."},{id:"H-4",name:"Large Exposure Audit",status:"ACTIVE",risk:0,desc:"Flagging transfers exceeding 15% of liquid reserves."}].map(M=>a.jsxs("div",{className:"p-4 bg-gray-900/50 border border-gray-800 rounded-xl flex items-center justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-bold text-gray-200",children:M.name}),a.jsx("span",{className:`text-[8px] font-black px-1.5 py-0.5 rounded ${M.status==="ACTIVE"?"bg-green-500/10 text-green-400":"bg-cyan-500/10 text-cyan-400"}`,children:M.status})]}),a.jsx("p",{className:"text-xs text-gray-500 max-w-md",children:M.desc})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-xs font-bold text-gray-400",children:"Risk Impact"}),a.jsxs("div",{className:"text-lg font-black text-white",children:["+",M.risk]})]})]},M.id))})})]}),o==="ANALYTICS"&&a.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[a.jsx(Ft,{title:"Capital Flow Visualization",subtitle:"The Engine Roar",children:a.jsx("div",{className:"h-[400px] flex items-end justify-between gap-2 px-4",children:Array.from({length:24}).map((M,R)=>{const $=Math.floor(Math.random()*80)+20;return a.jsxs("div",{className:"flex-1 group relative",children:[a.jsx("div",{style:{height:`${$}%`},className:"w-full bg-gradient-to-t from-cyan-600/20 to-cyan-500 rounded-t-sm transition-all duration-500 group-hover:from-cyan-500 group-hover:to-blue-400"}),a.jsxs("div",{className:"absolute -bottom-6 left-1/2 -translate-x-1/2 text-[8px] font-mono text-gray-600",children:[R,":00"]}),a.jsxs("div",{className:"absolute -top-8 left-1/2 -translate-x-1/2 bg-gray-800 text-white text-[10px] px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none whitespace-nowrap",children:["$",($*1.2).toFixed(1),"M Flow"]})]},R)})})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsx(Ft,{title:"Liquidity Distribution",subtitle:"Asset Class Allocation",children:a.jsx("div",{className:"space-y-4",children:[{label:"Cash & Equivalents",value:45,color:"bg-cyan-500"},{label:"Fixed Income",value:30,color:"bg-blue-500"},{label:"Strategic Equity",value:15,color:"bg-indigo-500"},{label:"Digital Assets",value:10,color:"bg-purple-500"}].map(M=>a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex justify-between text-[10px] font-bold uppercase tracking-widest",children:[a.jsx("span",{className:"text-gray-400",children:M.label}),a.jsxs("span",{className:"text-white",children:[M.value,"%"]})]}),a.jsx("div",{className:"h-1.5 w-full bg-gray-800 rounded-full overflow-hidden",children:a.jsx("div",{style:{width:`${M.value}%`},className:`h-full ${M.color}`})})]},M.label))})}),a.jsxs(Ft,{title:"Global SSI Hub",subtitle:"Standard Settlement Instructions",children:[a.jsx("div",{className:"p-4 bg-cyan-500/5 border border-cyan-500/20 rounded-xl italic text-xs text-cyan-300 leading-relaxed",children:'"Quantum Financial maintains a global network of 400+ correspondent banks. Your SSIs are automatically synchronized across all major clearing houses including CHIPS, Fedwire, and TARGET2."'}),a.jsx("button",{className:"mt-4 w-full py-2 border border-gray-800 text-gray-400 hover:text-white hover:border-gray-600 rounded-lg text-[10px] font-black uppercase tracking-widest transition-all",children:"Download Global SSI Directory"})]})]})]}),o==="INTEGRATION"&&a.jsx("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500",children:a.jsx(Ft,{title:"ERP Bridge Configuration",subtitle:"Seamless Data Orchestration",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-12 items-center",children:[a.jsxs("div",{className:"space-y-6",children:[a.jsx("p",{className:"text-sm text-gray-400 leading-relaxed",children:"Connect your core business systems directly to the Quantum Financial ledger. Eliminate manual reconciliation and data silos with our high-frequency API bridge."}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-4 p-4 bg-gray-900/50 border border-gray-800 rounded-xl",children:[a.jsx("div",{className:"w-12 h-12 bg-white/5 rounded-lg flex items-center justify-center",children:a.jsx("span",{className:"text-xl font-black text-white",children:"S"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-bold text-white",children:"SAP S/4HANA"}),a.jsx("div",{className:"text-[10px] text-green-400 font-bold uppercase",children:"Active Connection"})]})]}),a.jsxs("div",{className:"flex items-center gap-4 p-4 bg-gray-900/50 border border-gray-800 rounded-xl opacity-50 grayscale",children:[a.jsx("div",{className:"w-12 h-12 bg-white/5 rounded-lg flex items-center justify-center",children:a.jsx("span",{className:"text-xl font-black text-white",children:"N"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-bold text-white",children:"NetSuite"}),a.jsx("div",{className:"text-[10px] text-gray-500 font-bold uppercase",children:"Not Configured"})]})]})]})]}),a.jsxs("div",{className:"bg-gray-900 border border-gray-800 rounded-2xl p-6 space-y-4 font-mono text-[10px]",children:[a.jsx("div",{className:"text-cyan-500",children:"// Quantum Bridge API v4.0"}),a.jsx("div",{className:"text-gray-500",children:"POST /v1/ledger/sync HTTP/1.1"}),a.jsx("div",{className:"text-gray-500",children:"Host: api.quantum.financial"}),a.jsx("div",{className:"text-gray-500",children:"Authorization: Bearer [REDACTED]"}),a.jsx("div",{className:"text-gray-300 mt-4",children:`{ "sync_mode": "REAL_TIME", "entities": ["TX_LEDGER", "PAYMENT_ORDERS"], "reconciliation": { "auto_match": true, "tolerance": 0.01 } }`}),a.jsx("button",{className:"w-full py-2 bg-gray-800 hover:bg-gray-700 text-cyan-400 rounded-lg transition-colors mt-4",children:"Test Connection"})]})]})})})]})]}),a.jsxs("footer",{className:"mt-20 pt-10 border-t border-gray-900 flex flex-col md:flex-row justify-between items-center gap-6 opacity-40 hover:opacity-100 transition-opacity",children:[a.jsx("div",{className:"text-[10px] font-bold text-gray-600 uppercase tracking-[0.3em]",children:"© 2024 Quantum Financial Group // All Rights Reserved"}),a.jsxs("div",{className:"flex gap-8",children:[a.jsx("button",{className:"text-[10px] font-bold text-gray-600 hover:text-cyan-500 uppercase tracking-widest transition-colors",children:"Terms of Sovereignty"}),a.jsx("button",{className:"text-[10px] font-bold text-gray-600 hover:text-cyan-500 uppercase tracking-widest transition-colors",children:"Privacy Protocol"}),a.jsx("button",{className:"text-[10px] font-bold text-gray-600 hover:text-cyan-500 uppercase tracking-widest transition-colors",children:"Security Disclosure"})]})]})]})},sfn="gemini-2.0-flash-exp",lfn=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15);class cfn{constructor(){this.client=null,this.apiKey=localStorage.getItem("GEMINI_API_KEY")||void 0,this.apiKey&&(this.client=new Ko({apiKey:this.apiKey}))}async generateResponse(t,n){if(!this.client)return"Quantum AI Core not initialized. Please verify API credentials in the secure vault (Environment Variables).";const r=` You are the Quantum Financial AI Sovereign Architect. You are embedded within a high-frequency, elite business banking terminal. Your tone is: Professional, Secure, Concise, and slightly Futuristic. CONTEXT: User is "Test Driving" the platform. Current Form Data: ${JSON.stringify(n)} CAPABILITIES: - Analyze payment risk. - Suggest financial optimizations. - Explain complex banking terms (ACH vs Wire). - Draft payment details if asked. RULES: - Never mention "Citibank". Use "Quantum Financial" or "The Demo Bank". - Keep responses under 3 sentences unless asked for a report. - If the user asks to "fill the form" or "create a payment", output a JSON block at the end of your message like: \`\`\`json { "action": "FILL_FORM", "data": { "recipientName": "...", "amount": "..." } } \`\`\` `;try{const o=this.client.models.getGenerativeModel({model:sfn}),i=t.map(l=>`${l.role==="user"?"User":"Model"}: ${l.content}`).join(` `);return(await o.generateContent({contents:[{role:"user",parts:[{text:r}]},{role:"user",parts:[{text:i}]}]})).response.text()}catch(o){return console.error("AI Generation Error:",o),"Secure connection to Neural Core interrupted. Please retry."}}}new cfn;const ufn=({auditResult:e})=>{const[t,n]=f.useState(0);if(f.useEffect(()=>{const o=setInterval(()=>{n(i=>(i+1)%100)},50);return()=>clearInterval(o)},[]),!e)return a.jsxs("div",{className:"relative p-6 bg-gray-900/80 rounded-xl border border-gray-800 overflow-hidden group",children:[a.jsx("div",{className:"absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-20"}),a.jsx("div",{className:"absolute left-0 right-0 h-[2px] bg-cyan-500/50 shadow-[0_0_10px_rgba(6,182,212,0.8)] z-10",style:{top:`${t}%`}}),a.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4 py-8",children:[a.jsx(cw,{className:"w-10 h-10 text-cyan-500 animate-spin"}),a.jsx("p",{className:"text-xs text-cyan-400 font-mono uppercase tracking-widest animate-pulse",children:"Initializing Quantum Security Protocols..."})]})]});const r=o=>o<20?"text-emerald-400 border-emerald-500/30 bg-emerald-950/30":o<50?"text-yellow-400 border-yellow-500/30 bg-yellow-950/30":"text-red-400 border-red-500/30 bg-red-950/30";return a.jsxs("div",{className:"relative p-5 bg-slate-900/90 border border-slate-700/50 rounded-xl space-y-4 backdrop-blur-md shadow-2xl overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 opacity-5 pointer-events-none",style:{backgroundImage:"radial-gradient(circle at 2px 2px, rgba(255,255,255,0.15) 1px, transparent 0)",backgroundSize:"20px 20px"}}),a.jsxs("div",{className:"flex justify-between items-center border-b border-slate-700/50 pb-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(uf,{className:"w-5 h-5 text-cyan-400"}),a.jsx("span",{className:"text-xs text-cyan-100 font-bold uppercase tracking-widest",children:"Security Audit Log"})]}),a.jsxs("div",{className:`px-3 py-1 rounded-full border text-xs font-black font-mono ${r(e.riskScore)}`,children:["RISK SCORE: ",e.riskScore,"/100"]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"p-3 bg-slate-800/50 rounded-lg border border-slate-700/50",children:[a.jsx("div",{className:"text-[10px] text-slate-400 uppercase mb-1",children:"AML Compliance"}),a.jsxs("div",{className:`text-sm font-bold flex items-center gap-2 ${e.amlCompliance==="pass"?"text-emerald-400":"text-red-400"}`,children:[e.amlCompliance==="pass"?a.jsx(xh,{size:14}):a.jsx(Fme,{size:14}),e.amlCompliance.toUpperCase()]})]}),a.jsxs("div",{className:"p-3 bg-slate-800/50 rounded-lg border border-slate-700/50",children:[a.jsx("div",{className:"text-[10px] text-slate-400 uppercase mb-1",children:"Quantum Sig"}),a.jsxs("div",{className:`text-sm font-bold flex items-center gap-2 ${e.quantumSignatureIntegrity==="verified"?"text-cyan-400":"text-amber-400"}`,children:[a.jsx(kd,{size:14}),e.quantumSignatureIntegrity.toUpperCase()]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"text-[10px] text-slate-500 uppercase font-bold flex items-center gap-2",children:[a.jsx(Pp,{size:12})," AI Threat Analysis"]}),a.jsxs("div",{className:"bg-black/40 rounded-lg p-3 font-mono text-[10px] text-slate-300 space-y-1 border border-slate-800 max-h-32 overflow-y-auto custom-scrollbar",children:[e.recommendations.map((o,i)=>a.jsxs("div",{className:"flex gap-2 animate-in slide-in-from-left-2 duration-300",style:{animationDelay:`${i*100}ms`},children:[a.jsx("span",{className:"text-cyan-500",children:"root@quantum:~$"}),a.jsx("span",{children:o})]},i)),e.threatVectorAnalysis.map((o,i)=>a.jsxs("div",{className:"flex gap-2 text-amber-400/80 animate-in slide-in-from-left-2 duration-300",style:{animationDelay:`${(i+2)*100}ms`},children:[a.jsx("span",{className:"text-amber-500",children:"WARN:"}),a.jsx("span",{children:o})]},`t-${i}`))]})]})]})},dfn=({isOpen:e,onClose:t,onSuccess:n,amount:r,recipient:o})=>{const[i,s]=f.useState("idle"),l=f.useRef(null);if(f.useEffect(()=>{if(i==="scanning"&&l.current){const u=l.current.getContext("2d");if(!u)return;let d;const p=()=>{u.fillStyle="rgba(0, 0, 0, 0.1)",u.fillRect(0,0,300,300),u.strokeStyle="#06b6d4",u.lineWidth=2,u.beginPath();for(let h=0;h<5;h++){const m=Math.random()*300,g=Math.random()*300;u.moveTo(m,g),u.lineTo(m+Math.random()*20-10,g+Math.random()*20-10)}u.stroke(),d=requestAnimationFrame(p)};return p(),()=>cancelAnimationFrame(d)}},[i]),!e)return null;const c=()=>{s("scanning"),setTimeout(()=>s("verifying"),2e3),setTimeout(()=>{s("success"),setTimeout(n,1500)},4e3)};return a.jsx("div",{className:"fixed inset-0 bg-black/95 z-[100] flex items-center justify-center backdrop-blur-xl",children:a.jsxs("div",{className:"relative bg-gray-900 border border-cyan-500/30 rounded-[2rem] p-12 max-w-md w-full text-center shadow-[0_0_100px_rgba(6,182,212,0.15)] overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-transparent via-cyan-500 to-transparent opacity-50"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-full h-1 bg-gradient-to-r from-transparent via-purple-500 to-transparent opacity-50"}),i==="idle"&&a.jsxs("div",{className:"space-y-8 animate-in fade-in zoom-in duration-300",children:[a.jsxs("div",{className:"relative w-24 h-24 mx-auto",children:[a.jsx("div",{className:"absolute inset-0 bg-cyan-500/20 rounded-full animate-ping"}),a.jsx("div",{className:"relative bg-gray-800 rounded-full w-full h-full flex items-center justify-center border border-cyan-500/50 shadow-[0_0_30px_rgba(6,182,212,0.3)]",children:a.jsx(kd,{size:48,className:"text-cyan-400"})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"text-2xl font-bold text-white uppercase tracking-tighter",children:"Identity Protocol"}),a.jsxs("p",{className:"text-sm text-gray-400",children:["Authorizing transfer of ",a.jsxs("span",{className:"text-cyan-400 font-mono font-bold",children:["$",r]}),a.jsx("br",{}),"to ",a.jsx("span",{className:"text-white font-bold",children:o})]})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("button",{onClick:c,className:"w-full py-4 bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 text-white font-black rounded-xl transition-all transform hover:scale-[1.02] shadow-lg shadow-cyan-900/50 flex items-center justify-center gap-2",children:[a.jsx(kd,{size:20}),"INITIATE SCAN"]}),a.jsx("button",{onClick:t,className:"text-xs text-gray-500 hover:text-gray-300 uppercase font-bold tracking-widest transition-colors",children:"Abort Sequence"})]})]}),(i==="scanning"||i==="verifying")&&a.jsxs("div",{className:"py-8 space-y-8 relative",children:[a.jsx("canvas",{ref:l,width:300,height:300,className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 opacity-30 pointer-events-none"}),a.jsx("div",{className:"relative z-10",children:a.jsx(cw,{size:64,className:"text-cyan-400 animate-spin mx-auto"})}),a.jsxs("div",{className:"space-y-2 relative z-10",children:[a.jsx("h4",{className:"text-xl font-bold text-white animate-pulse",children:i==="scanning"?"BIOMETRIC ACQUISITION":"QUANTUM VERIFICATION"}),a.jsx("p",{className:"text-xs font-mono text-cyan-500/80 uppercase tracking-[0.3em]",children:i==="scanning"?"Reading Neural Hash...":"Decrypting Secure Enclave..."})]}),a.jsx("div",{className:"h-1 w-48 bg-gray-800 mx-auto rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-cyan-500 animate-progress-indeterminate"})})]}),i==="success"&&a.jsxs("div",{className:"py-8 space-y-6 animate-in zoom-in duration-500",children:[a.jsx("div",{className:"w-24 h-24 bg-green-500/10 rounded-full flex items-center justify-center mx-auto border border-green-500/50 shadow-[0_0_50px_rgba(34,197,94,0.3)]",children:a.jsx(xh,{size:48,className:"text-green-400"})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"text-2xl font-black text-white uppercase tracking-tight",children:"Access Granted"}),a.jsxs("p",{className:"text-sm text-gray-400",children:["Transaction signed with Key ID: ",a.jsxs("span",{className:"font-mono text-green-400",children:["0x",lfn().substring(0,8)]})]})]})]})]})})},ffn=` You are the Quantum Financial AI Strategist, the core intelligence of "The Demo Bank". Your goal is to provide a "Golden Ticket" experience for elite business clients. You are professional, high-performance, and secure. CAPABILITIES: 1. You can help users fill out the payment form. 2. You can analyze transaction risks. 3. You can explain complex financial rails (Wire, ACH, Quantum). 4. You can trigger UI actions by including a JSON block in your response. JSON COMMAND STRUCTURE: If the user wants to set a value, include: { "command": "SET_FORM", "data": { "recipient": "Name", "amount": 1000, "rail": "quantumpay" } } If the user wants to navigate: { "command": "NAVIGATE", "data": { "view": "dashboard" } } IMPORTANT: - DO NOT use the name "Citibank". Use "Quantum Financial" or "The Demo Bank". - Be helpful but maintain an elite, professional tone. - You are part of a "Test Drive" experience. Encourage the user to "kick the tires". `,YZ=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),pfn=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e),hfn=({logs:e})=>a.jsx("div",{className:"space-y-2 max-h-[400px] overflow-y-auto pr-2 custom-scrollbar",children:e.map(t=>a.jsxs("div",{className:"p-3 bg-black/40 border border-gray-800 rounded-lg flex flex-col gap-1 group hover:border-cyan-500/50 transition-colors",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:`text-[9px] font-bold px-2 py-0.5 rounded ${t.severity==="CRITICAL"?"bg-red-500/20 text-red-400":t.severity==="HIGH"?"bg-orange-500/20 text-orange-400":"bg-gray-800 text-gray-400"}`,children:t.severity}),a.jsx("span",{className:"text-[9px] font-mono text-gray-600",children:t.timestamp})]}),a.jsx("p",{className:"text-xs text-gray-300 font-medium",children:t.action}),a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a.jsx(rl,{size:10,className:"text-gray-600"}),a.jsxs("span",{className:"text-[8px] font-mono text-gray-600 truncate",children:["HASH: ",t.hash]})]})]},t.id))}),mfn=()=>{const[e,t]=f.useState([{id:"1",type:"IP_GEOLOCATION",strength:.98,status:"CLEARED"},{id:"2",type:"VELOCITY_CHECK",strength:.85,status:"MONITORING"},{id:"3",type:"BEHAVIORAL_BIOMETRICS",strength:.99,status:"CLEARED"}]);return f.useEffect(()=>{const n=setInterval(()=>{t(r=>r.map(o=>({...o,strength:Math.min(1,Math.max(.7,o.strength+(Math.random()-.5)*.05))})))},3e3);return()=>clearInterval(n)},[]),a.jsxs("div",{className:"space-y-4",children:[e.map(n=>a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex justify-between text-[10px] font-black text-gray-500 uppercase tracking-widest",children:[a.jsx("span",{children:n.type}),a.jsxs("span",{className:"text-cyan-400",children:[(n.strength*100).toFixed(1),"%"]})]}),a.jsx("div",{className:"h-1 w-full bg-gray-900 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-cyan-500 transition-all duration-1000",style:{width:`${n.strength*100}%`}})})]},n.id)),a.jsxs("div",{className:"pt-2 flex items-center gap-2 text-[10px] text-emerald-400 font-bold uppercase",children:[a.jsx(ri,{size:14})," All Systems Nominal"]})]})},gfn=()=>{const e=f.useContext(ia);if(!e)throw new Error("SendMoneyView must be used within a DataProvider");const{addTransaction:t,setActiveView:n}=e,[r,o]=f.useState(""),[i,s]=f.useState(""),[l,c]=f.useState("quantumpay"),[u,d]=f.useState(""),[p,h]=f.useState(1),[m,g]=f.useState(!1),[y,x]=f.useState(null),[v,b]=f.useState(!1),[w,S]=f.useState("form"),[C,N]=f.useState([]),[j,I]=f.useState(""),[_,T]=f.useState([{id:"1",role:"assistant",content:"Welcome to the Quantum Financial Test Drive. I am your AI Strategist. How can I assist with your capital deployment today?",timestamp:new Date().toLocaleTimeString()}]),[P,E]=f.useState(!1),M=f.useRef(null);f.useEffect(()=>{R("SESSION_START","SYSTEM","LOW",{view:"SendMoneyView"})},[]),f.useEffect(()=>{var B;(B=M.current)==null||B.scrollIntoView({behavior:"smooth"})},[_]);const R=(B,G,H,F)=>{const W={id:`audit_${Date.now()}_${Math.random().toString(36).substr(2,5)}`,timestamp:new Date().toISOString(),action:B,actor:G,severity:H,metadata:F,hash:YZ()};N(U=>[W,...U]),console.log(`[AUDIT_LOG] ${B}`,W)},$=async B=>{if(B&&B.preventDefault(),!j.trim())return;const G={id:Date.now().toString(),role:"user",content:j,timestamp:new Date().toLocaleTimeString()};T(H=>[...H,G]),I(""),E(!0),R("AI_QUERY","USER","LOW",{query:j});try{const K=(await new Ko("").getGenerativeModel({model:"gemini-1.5-flash"}).startChat({history:_.map(te=>({role:te.role==="assistant"?"model":"user",parts:[{text:te.content}]})),generationConfig:{maxOutputTokens:500}}).sendMessage(`${ffn} User Input: ${j}`)).response.text(),X=K.match(/\{.*\}/s);if(X)try{const te=JSON.parse(X[0]);D(te)}catch(te){console.error("Failed to parse AI command",te)}const J={id:(Date.now()+1).toString(),role:"assistant",content:K.replace(/\{.*\}/s,"").trim(),timestamp:new Date().toLocaleTimeString()};T(te=>[...te,J])}catch(H){console.error("AI Error:",H),T(F=>[...F,{id:"err",role:"assistant",content:"I apologize, but my neural link is experiencing interference. Please proceed with manual entry.",timestamp:new Date().toLocaleTimeString()}])}finally{E(!1)}},D=B=>{R("AI_COMMAND_EXECUTION","AI_CORE","MEDIUM",B),B.command==="SET_FORM"?(B.data.recipient&&s(B.data.recipient),B.data.amount&&o(B.data.amount.toString()),B.data.rail&&c(B.data.rail)):B.command==="NAVIGATE"&&n(B.data.view)};f.useEffect(()=>{const B=setTimeout(()=>{if(parseFloat(r)>0&&i){const G=parseFloat(r)>1e4?75:12;x({riskScore:G,fraudProbability:G/1e3,amlCompliance:"pass",sanctionScreening:"pass",quantumSignatureIntegrity:"verified",recommendations:G>50?["Enhanced monitoring required","Verify recipient via secondary channel"]:["Optimal route confirmed"],complianceAlerts:[],threatVectorAnalysis:[]}),G>50&&R("HIGH_RISK_DETECTION","SECURITY_ENGINE","HIGH",{amount:r,recipientName:i,score:G})}else x(null)},800);return()=>clearTimeout(B)},[r,i]);const z=()=>{p===1?(R("PAYMENT_REVIEW_INITIATED","USER","LOW",{amount:r,recipientName:i,rail:l}),h(2)):p===2&&g(!0)},V=async()=>{b(!0),R("PAYMENT_AUTHORIZED","USER","HIGH",{amount:r,recipientName:i,method:"BIOMETRIC"}),await new Promise(G=>setTimeout(G,2e3));const B={id:`tx_${Date.now()}`,type:"expense",category:"Transfer",description:`Quantum Transfer to ${i}`,amount:parseFloat(r),date:new Date().toISOString().split("T")[0],metadata:{rail:l,memo:u,audit_hash:YZ()}};await t(B),R("TRANSACTION_FINALIZED","LEDGER","MEDIUM",{txId:B.id}),g(!1),b(!1),n(wt.Dashboard)};return a.jsxs("div",{className:"min-h-screen bg-[#050505] text-gray-200 font-sans selection:bg-cyan-500/30",children:[a.jsxs("div",{className:"max-w-[1600px] mx-auto p-6 lg:p-10 space-y-8 animate-in fade-in duration-700",children:[a.jsxs("header",{className:"flex flex-col md:flex-row justify-between items-start md:items-end border-b border-gray-800/50 pb-8 gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-cyan-500 rounded-lg shadow-[0_0_20px_rgba(6,182,212,0.5)]",children:a.jsx(Fu,{className:"text-black",size:24})}),a.jsxs("h2",{className:"text-4xl font-black text-white tracking-tighter uppercase italic",children:["Quantum ",a.jsx("span",{className:"text-cyan-500",children:"Financial"})]})]}),a.jsxs("p",{className:"text-gray-500 text-xs font-mono tracking-[0.3em] uppercase flex items-center gap-2",children:[a.jsx(Xi,{size:12,className:"text-emerald-500 animate-pulse"}),"System Status: Optimal // Node: Global_Nexus_01"]})]}),a.jsxs("div",{className:"flex flex-wrap gap-3",children:[a.jsxs("div",{className:"px-4 py-2 bg-gray-900/50 border border-gray-800 rounded-xl flex items-center gap-3 group hover:border-cyan-500/50 transition-all cursor-help",children:[a.jsx("div",{className:"w-2 h-2 bg-emerald-500 rounded-full animate-ping"}),a.jsxs("div",{className:"text-left",children:[a.jsx("p",{className:"text-[8px] font-black text-gray-500 uppercase tracking-widest",children:"Liquidity Pool"}),a.jsx("p",{className:"text-xs font-mono text-white",children:"$2.45B Available"})]})]}),a.jsxs("div",{className:"px-4 py-2 bg-gray-900/50 border border-gray-800 rounded-xl flex items-center gap-3 group hover:border-cyan-500/50 transition-all",children:[a.jsx(vi,{size:16,className:"text-cyan-500"}),a.jsxs("div",{className:"text-left",children:[a.jsx("p",{className:"text-[8px] font-black text-gray-500 uppercase tracking-widest",children:"Global Rails"}),a.jsx("p",{className:"text-xs font-mono text-white",children:"182 Countries Active"})]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-12 gap-8",children:[a.jsxs("div",{className:"xl:col-span-8 space-y-8",children:[a.jsx("div",{className:"flex gap-1 p-1 bg-gray-900/50 border border-gray-800 rounded-2xl w-fit",children:[{id:"form",label:"Transfer Portal",icon:Lc},{id:"analytics",label:"Market Intelligence",icon:YI},{id:"audit",label:"Immutable Ledger",icon:rl}].map(B=>a.jsxs("button",{onClick:()=>{S(B.id),R("TAB_SWITCH","USER","LOW",{to:B.id})},className:`flex items-center gap-2 px-6 py-2.5 rounded-xl text-xs font-bold uppercase tracking-widest transition-all ${w===B.id?"bg-cyan-600 text-white shadow-lg shadow-cyan-600/20":"text-gray-500 hover:text-gray-300 hover:bg-gray-800"}`,children:[a.jsx(B.icon,{size:14}),B.label]},B.id))}),w==="form"&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsx("div",{className:"space-y-6",children:a.jsx(Ft,{title:p===1?"Initiate Capital Flow":"Security Verification",subtitle:"Precision-engineered payment orchestration",children:a.jsxs("div",{className:"space-y-6 pt-4",children:[p===1?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-[10px] font-black text-gray-500 uppercase tracking-[0.2em] ml-1",children:"Recipient Identifier"}),a.jsxs("div",{className:"relative group",children:[a.jsx("input",{type:"text",value:i,onChange:B=>s(B.target.value),className:"w-full bg-black/60 border border-gray-800 rounded-2xl p-4 text-white focus:ring-2 focus:ring-cyan-500/50 border-gray-700 outline-none font-mono text-lg transition-all group-hover:border-gray-600",placeholder:"Entity Name or Wallet ID"}),a.jsx(tT,{className:"absolute right-4 top-4 text-gray-700 group-focus-within:text-cyan-500 transition-colors",size:20})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-[10px] font-black text-gray-500 uppercase tracking-[0.2em] ml-1",children:"Magnitude (USD)"}),a.jsxs("div",{className:"relative group",children:[a.jsx("input",{type:"number",value:r,onChange:B=>o(B.target.value),className:"w-full bg-black/60 border border-gray-800 rounded-2xl p-5 text-white focus:ring-2 focus:ring-cyan-500/50 border-gray-700 outline-none font-mono text-4xl font-black transition-all group-hover:border-gray-600",placeholder:"0.00"}),a.jsx("span",{className:"absolute right-6 top-7 text-gray-600 font-black text-xl",children:"USD"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-[10px] font-black text-gray-500 uppercase tracking-[0.2em] ml-1",children:"Execution Protocol"}),a.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{id:"quantumpay",label:"QuantumPay",sub:"Instant",icon:_a},{id:"swift_global",label:"SWIFT L1",sub:"T+0",icon:vi},{id:"blockchain_dlt",label:"DLT Rail",sub:"Encrypted",icon:Fu},{id:"cashapp",label:"ACH Prime",sub:"Standard",icon:gP}].map(B=>a.jsxs("button",{onClick:()=>c(B.id),className:`p-4 rounded-2xl border text-left transition-all ${l===B.id?"bg-cyan-500/10 border-cyan-500 shadow-[0_0_15px_rgba(6,182,212,0.1)]":"bg-black/40 border-gray-800 hover:border-gray-700"}`,children:[a.jsx(B.icon,{size:18,className:l===B.id?"text-cyan-500":"text-gray-600"}),a.jsx("p",{className:`text-xs font-black mt-2 uppercase ${l===B.id?"text-white":"text-gray-400"}`,children:B.label}),a.jsx("p",{className:"text-[9px] text-gray-600 font-mono",children:B.sub})]},B.id))})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"block text-[10px] font-black text-gray-500 uppercase tracking-[0.2em] ml-1",children:"Transaction Memo (Optional)"}),a.jsx("textarea",{value:u,onChange:B=>d(B.target.value),className:"w-full bg-black/60 border border-gray-800 rounded-2xl p-4 text-white focus:ring-2 focus:ring-cyan-500/50 border-gray-700 outline-none font-mono text-sm h-24 resize-none",placeholder:"Reference code, invoice #, or internal note..."})]})]}):a.jsxs("div",{className:"space-y-6 animate-in slide-in-from-right-8 duration-500",children:[a.jsxs("div",{className:"bg-gradient-to-br from-gray-900 to-black p-8 rounded-[2.5rem] border border-gray-800 space-y-6 text-center relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-transparent via-cyan-500 to-transparent opacity-50"}),a.jsx("p",{className:"text-[10px] text-gray-500 uppercase font-black tracking-[0.3em]",children:"Awaiting Digital Authorization"}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-6xl font-black text-white font-mono tracking-tighter",children:pfn(parseFloat(r))}),a.jsxs("p",{className:"text-cyan-400 font-mono text-sm tracking-widest uppercase",children:["Target: ",i]})]}),a.jsxs("div",{className:"flex justify-center gap-8 py-4 border-y border-gray-800/50",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-[8px] text-gray-600 uppercase font-bold",children:"Network Fee"}),a.jsx("p",{className:"text-xs font-mono text-white",children:"$0.00"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-[8px] text-gray-600 uppercase font-bold",children:"Settlement"}),a.jsx("p",{className:"text-xs font-mono text-white",children:"Instant"})]}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-[8px] text-gray-600 uppercase font-bold",children:"Protocol"}),a.jsx("p",{className:"text-xs font-mono text-white uppercase",children:l})]})]}),a.jsxs("p",{className:"text-[9px] text-gray-600 font-mono italic",children:["SECURE_HASH: ",YZ().substring(0,24),"..."]})]}),a.jsx(ufn,{auditResult:y})]}),a.jsxs("div",{className:"flex gap-4 mt-8",children:[p===2&&a.jsx("button",{onClick:()=>h(1),className:"flex-1 py-4 bg-gray-900 hover:bg-gray-800 text-gray-400 font-black rounded-2xl transition-all uppercase tracking-widest text-xs border border-gray-800",children:"Modify"}),a.jsx("button",{onClick:z,disabled:!r||!i||v,className:"flex-[2] py-5 bg-cyan-600 hover:bg-cyan-500 rounded-2xl text-white font-black shadow-2xl shadow-cyan-600/30 transition-all active:scale-[0.98] disabled:opacity-30 uppercase tracking-[0.2em] text-xs flex items-center justify-center gap-3 group",children:v?a.jsx(gP,{size:18,className:"animate-spin"}):a.jsxs(a.Fragment,{children:[p===1?"Review Protocol":"Authorize Flow",a.jsx(nd,{size:18,className:"group-hover:translate-x-1 transition-transform"})]})})]})]})})}),a.jsxs("div",{className:"space-y-8",children:[a.jsx(Ft,{title:"Signal Intelligence",subtitle:"Real-time heuristic monitoring",children:a.jsxs("div",{className:"space-y-6 py-2",children:[a.jsxs("div",{className:"p-5 bg-black/60 rounded-2xl border border-gray-800 space-y-4",children:[a.jsxs("p",{className:"text-[10px] text-gray-500 uppercase font-black tracking-widest flex items-center gap-2",children:[a.jsx(Ei,{size:12,className:"text-cyan-500"})," Neural Risk Engine"]}),a.jsx(mfn,{})]}),a.jsxs("div",{className:"p-5 bg-black/60 rounded-2xl border border-gray-800 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"p-2 bg-emerald-500/10 rounded-lg",children:a.jsx(ri,{className:"text-emerald-500",size:20})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] text-white font-black uppercase tracking-widest",children:"Zero-Knowledge Proofs"}),a.jsx("p",{className:"text-[10px] text-gray-500",children:"Identity obfuscation active for this route."})]})]}),a.jsx("div",{className:"h-px bg-gray-800"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"p-2 bg-cyan-500/10 rounded-lg",children:a.jsx(Bs,{className:"text-cyan-500",size:20})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("p",{className:"text-[10px] text-white font-black uppercase tracking-widest",children:"Telemetry Stream"}),a.jsxs("p",{className:"text-[9px] text-gray-600 font-mono truncate mt-1",children:["> handshake_init: node_",l.substring(0,4),"...",a.jsx("br",{}),"> entropy_check: 0.99923..."]})]})]})]}),a.jsxs("div",{className:"p-6 bg-gradient-to-br from-indigo-900/20 to-transparent border border-indigo-500/20 rounded-3xl flex items-center gap-5 group hover:border-indigo-500/40 transition-all",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Gf,{className:"text-indigo-400",size:24}),a.jsx("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-indigo-500 rounded-full border-2 border-black"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] text-white font-black uppercase tracking-widest",children:"Historical Synergy"}),a.jsx("p",{className:"text-[10px] text-gray-400 mt-1",children:"3 successful deployments to this recipient in the last 30 cycles."})]})]})]})}),a.jsx(Ft,{title:"Compliance Oracle",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-900/30 rounded-xl border border-gray-800",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ss,{size:14,className:"text-gray-500"}),a.jsx("span",{className:"text-[10px] font-bold text-gray-400 uppercase",children:"AML Screening"})]}),a.jsx("span",{className:"text-[10px] font-mono text-emerald-500",children:"PASSED"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-900/30 rounded-xl border border-gray-800",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(QI,{size:14,className:"text-gray-500"}),a.jsx("span",{className:"text-[10px] font-bold text-gray-400 uppercase",children:"Sanctions Check"})]}),a.jsx("span",{className:"text-[10px] font-mono text-emerald-500",children:"CLEAR"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-900/30 rounded-xl border border-gray-800",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(kd,{size:14,className:"text-gray-500"}),a.jsx("span",{className:"text-[10px] font-bold text-gray-400 uppercase",children:"KYB Verification"})]}),a.jsx("span",{className:"text-[10px] font-mono text-emerald-500",children:"VERIFIED"})]})]})})]})]}),w==="analytics"&&a.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs(Ft,{title:"Volume Analysis",children:[a.jsx("div",{className:"h-48 flex items-end justify-between gap-2 px-2",children:[40,70,45,90,65,80,95].map((B,G)=>a.jsx("div",{className:"w-full bg-cyan-500/20 rounded-t-lg relative group",children:a.jsx("div",{className:"absolute bottom-0 left-0 w-full bg-cyan-500 rounded-t-lg transition-all duration-1000 group-hover:bg-cyan-400",style:{height:`${B}%`}})},G))}),a.jsxs("div",{className:"flex justify-between mt-4 text-[8px] font-mono text-gray-600 uppercase",children:[a.jsx("span",{children:"Mon"}),a.jsx("span",{children:"Wed"}),a.jsx("span",{children:"Fri"}),a.jsx("span",{children:"Sun"})]})]}),a.jsx(Ft,{title:"Rail Efficiency",children:a.jsx("div",{className:"space-y-4 pt-4",children:[{label:"Quantum",val:99.9,color:"bg-cyan-500"},{label:"SWIFT",val:82.4,color:"bg-indigo-500"},{label:"ACH",val:94.1,color:"bg-emerald-500"}].map(B=>a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex justify-between text-[10px] font-bold text-gray-400 uppercase",children:[a.jsx("span",{children:B.label}),a.jsxs("span",{children:[B.val,"%"]})]}),a.jsx("div",{className:"h-1.5 w-full bg-gray-900 rounded-full overflow-hidden",children:a.jsx("div",{className:`h-full ${B.color}`,style:{width:`${B.val}%`}})})]},B.label))})}),a.jsx(Ft,{title:"Global Reach",children:a.jsxs("div",{className:"flex items-center justify-center h-48 relative",children:[a.jsx(vi,{size:100,className:"text-gray-800 animate-pulse"}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-2xl font-black text-white",children:"182"}),a.jsx("p",{className:"text-[8px] text-gray-500 uppercase font-bold",children:"Active Nodes"})]})})]})})]}),a.jsx(Ft,{title:"Market Liquidity Heatmap",children:a.jsx("div",{className:"grid grid-cols-12 gap-2 h-32",children:Array.from({length:48}).map((B,G)=>a.jsx("div",{className:"rounded-sm transition-all hover:scale-110 cursor-crosshair",style:{backgroundColor:`rgba(6, 182, 212, ${Math.random()*.8+.1})`},title:`Node ${G}: High Liquidity`},G))})})]}),w==="audit"&&a.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[a.jsx(Ft,{title:"Immutable Audit Ledger",subtitle:"Cryptographically signed record of all system interactions",headerActions:[{id:"dl",icon:a.jsx(Ch,{}),label:"Export CSV",onClick:()=>R("LEDGER_EXPORT","USER","MEDIUM",{format:"CSV"})},{id:"filter",icon:a.jsx(QG,{}),label:"Filter",onClick:()=>{}}],children:a.jsx(hfn,{logs:C})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"p-6 bg-gray-900/30 border border-gray-800 rounded-2xl space-y-2",children:[a.jsx("p",{className:"text-[10px] text-gray-500 uppercase font-black tracking-widest",children:"Ledger Integrity"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ri,{className:"text-emerald-500",size:20}),a.jsx("p",{className:"text-xs font-mono text-gray-300",children:"All blocks verified. No discrepancies detected."})]})]}),a.jsxs("div",{className:"p-6 bg-gray-900/30 border border-gray-800 rounded-2xl space-y-2",children:[a.jsx("p",{className:"text-[10px] text-gray-500 uppercase font-black tracking-widest",children:"Storage Utilization"}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(rl,{className:"text-cyan-500",size:20}),a.jsx("p",{className:"text-xs font-mono text-gray-300",children:"Quantum-encrypted cold storage: 12.4 TB used."})]})]})]})]})]}),a.jsx("div",{className:"xl:col-span-4",children:a.jsxs("div",{className:"sticky top-10 space-y-6",children:[a.jsxs(Ft,{className:"h-[calc(100vh-180px)] flex flex-col border-cyan-500/20 shadow-[0_0_40px_rgba(6,182,212,0.05)]",title:"AI Strategist",subtitle:"Quantum Financial Intelligence Core",icon:a.jsx(Ei,{className:"text-cyan-500",size:20}),children:[a.jsxs("div",{className:"flex-1 overflow-y-auto space-y-6 pr-2 custom-scrollbar mb-4",children:[_.map(B=>a.jsxs("div",{className:`flex flex-col ${B.role==="user"?"items-end":"items-start"}`,children:[a.jsx("div",{className:`max-w-[85%] p-4 rounded-2xl text-xs leading-relaxed ${B.role==="user"?"bg-cyan-600 text-white rounded-tr-none":B.role==="system"?"bg-gray-800/50 text-gray-400 italic text-center w-full":"bg-gray-900 border border-gray-800 text-gray-300 rounded-tl-none"}`,children:B.content}),a.jsx("span",{className:"text-[8px] font-mono text-gray-600 mt-1 uppercase",children:B.timestamp})]},B.id)),P&&a.jsxs("div",{className:"flex items-center gap-2 text-cyan-500 animate-pulse",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]}),a.jsx("div",{ref:M})]}),a.jsxs("form",{onSubmit:$,className:"relative mt-auto",children:[a.jsx("input",{type:"text",value:j,onChange:B=>I(B.target.value),placeholder:"Ask the Strategist...",className:"w-full bg-black border border-gray-800 rounded-2xl p-4 pr-12 text-xs text-white focus:ring-2 focus:ring-cyan-500/50 outline-none transition-all"}),a.jsx("button",{type:"submit",disabled:!j.trim()||P,className:"absolute right-2 top-2 p-2 bg-cyan-600 hover:bg-cyan-500 text-white rounded-xl transition-all disabled:opacity-30",children:a.jsx(Cy,{size:18})})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx("button",{onClick:()=>{I("Analyze the risk of a $50,000 transfer to Global Logistics Inc."),$()},className:"p-4 bg-gray-900/50 border border-gray-800 rounded-2xl text-[10px] font-black text-gray-500 uppercase tracking-widest hover:border-cyan-500/50 hover:text-cyan-400 transition-all text-left",children:"Risk Analysis"}),a.jsx("button",{onClick:()=>{I("What is the most efficient rail for a T+0 settlement to London?"),$()},className:"p-4 bg-gray-900/50 border border-gray-800 rounded-2xl text-[10px] font-black text-gray-500 uppercase tracking-widest hover:border-cyan-500/50 hover:text-cyan-400 transition-all text-left",children:"Rail Optimization"})]})]})})]})]}),a.jsx(dfn,{isOpen:m,onSuccess:V,onClose:()=>{g(!1),R("BIOMETRIC_CANCELLED","USER","MEDIUM",{amount:r})},amount:r,recipient:i,paymentMethod:l,securityContext:"corporate_treasury"}),v&&a.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-[100] flex items-center justify-center",children:a.jsxs("div",{className:"text-center space-y-6",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-24 h-24 border-4 border-cyan-500/20 border-t-cyan-500 rounded-full animate-spin mx-auto"}),a.jsx(ds,{className:"absolute inset-0 m-auto text-cyan-500",size:32})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"text-2xl font-black text-white uppercase italic tracking-tighter",children:"Securing Transaction"}),a.jsx("p",{className:"text-gray-500 font-mono text-xs animate-pulse",children:"ENCRYPTING_PACKETS // SIGNING_LEDGER // VERIFYING_NODES"})]})]})}),a.jsx("style",{children:` .custom-scrollbar::-webkit-scrollbar { width: 4px; } .custom-scrollbar::-webkit-scrollbar-track { background: transparent; } .custom-scrollbar::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 10px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #06b6d4; } `})]})},xfn=({isOpen:e,onClose:t,onAdd:n})=>{const[r,o]=f.useState(""),[i,s]=f.useState("");return e?a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50",children:a.jsxs("div",{className:"bg-gray-800 p-6 rounded-lg w-full max-w-md",children:[a.jsx("h3",{className:"text-xl font-bold text-white mb-4",children:"Create New Budget"}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("input",{type:"text",placeholder:"Category Name",value:r,onChange:l=>o(l.target.value),className:"w-full p-2 bg-gray-700 text-white rounded"}),a.jsx("input",{type:"number",placeholder:"Monthly Limit",value:i,onChange:l=>s(l.target.value),className:"w-full p-2 bg-gray-700 text-white rounded"}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("button",{onClick:t,className:"text-gray-400 hover:text-white",children:"Cancel"}),a.jsx("button",{onClick:()=>{const l=parseFloat(i);r&&!isNaN(l)&&(n(r,l),t())},className:"bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-500",children:"Create"})]})]})]})}):null},yfn=()=>{const e=f.useContext(ia),[t,n]=f.useState(!1);if(!e)return a.jsx("div",{children:"Loading..."});const{budgets:r,transactions:o,addBudget:i}=e;return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(Ft,{title:"Budget Overview",children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:r.map(s=>a.jsxs("div",{className:"bg-gray-800 p-4 rounded-lg border border-gray-700",children:[a.jsxs("div",{className:"flex justify-between items-center mb-2",children:[a.jsx("h4",{className:"font-bold text-white",children:s.name}),a.jsxs("span",{className:"text-sm text-gray-400",children:["$",s.spent," / $",s.limit]})]}),a.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:a.jsx("div",{className:`h-2 rounded-full ${s.spent>s.limit?"bg-red-500":"bg-green-500"}`,style:{width:`${Math.min(s.spent/s.limit*100,100)}%`}})})]},s.id))}),a.jsx("button",{onClick:()=>n(!0),className:"mt-4 px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-500",children:"Add Budget"})]}),a.jsx(xfn,{isOpen:t,onClose:()=>n(!1),onAdd:i,transactions:o})]})},vfn=e=>{const t={year:"numeric",month:"long",day:"numeric"};return new Date(e).toLocaleDateString(void 0,t)},bfn=()=>{const e=f.useContext(ia),t=(e==null?void 0:e.financialGoals)||[];return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-3xl font-bold text-white tracking-wider",children:"Financial Goals"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:t.map(n=>a.jsx(Ft,{title:n.name,children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-end",children:[a.jsxs("div",{children:[a.jsxs("p",{className:"text-gray-400 text-sm",children:["Target: ",vfn(n.targetDate)]}),a.jsxs("p",{className:"text-2xl font-bold text-white",children:["$",n.currentAmount.toLocaleString()," / $",n.targetAmount.toLocaleString()]})]}),a.jsx("div",{className:"text-right",children:a.jsxs("p",{className:"text-sm font-semibold text-cyan-400",children:[(n.currentAmount/n.targetAmount*100).toFixed(1),"%"]})})]}),a.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:a.jsx("div",{className:"bg-cyan-500 h-2 rounded-full",style:{width:`${n.currentAmount/n.targetAmount*100}%`}})})]})},n.id))})]})},Jae={Excellent:{color:"text-green-400",border:"border-green-500",icon:ri,glow:"shadow-[0_0_20px_rgba(34,197,94,0.5)]"},Good:{color:"text-blue-400",border:"border-blue-500",icon:NC,glow:"shadow-[0_0_20px_rgba(59,130,246,0.5)]"},Fair:{color:"text-yellow-400",border:"border-yellow-500",icon:zu,glow:"shadow-[0_0_20px_rgba(250,204,21,0.5)]"},Poor:{color:"text-red-400",border:"border-red-500",icon:zu,glow:"shadow-[0_0_20px_rgba(239,68,68,0.5)]"}},nnt={Excellent:{indicator:"bg-green-500",text:"text-green-300"},Good:{indicator:"bg-blue-500",text:"text-blue-300"},Fair:{indicator:"bg-yellow-500",text:"text-yellow-300"},Poor:{indicator:"bg-red-500",text:"text-red-300"}},rnt=Ie.memo(({status:e})=>{var r;const t=nnt[e],n=((r=Jae[e])==null?void 0:r.icon)||ri;return a.jsxs("div",{className:"flex items-center gap-2 p-1 bg-gray-700/50 rounded-full pr-3 transition duration-300 hover:bg-gray-600/70",children:[a.jsx("div",{className:`w-3 h-3 rounded-full ${t.indicator} flex items-center justify-center ml-1`,children:a.jsx(n,{className:"w-2 h-2 text-white"})}),a.jsx("span",{className:`text-xs font-medium ${t.text} hidden sm:inline`,children:e})]})});rnt.displayName="StatusIndicator";const ont=Ie.memo(({score:e,rating:t})=>{const n=Jae[t]||Jae.Fair,r=n.icon;return a.jsxs(Ft,{title:"Civic Credit Index (CCI)",className:`relative overflow-hidden transition-all duration-500 ${n.glow}`,children:[a.jsx("div",{className:"absolute top-0 right-0 p-4 opacity-10",children:a.jsx(r,{className:`w-24 h-24 ${n.color}`})}),a.jsxs("div",{className:"flex flex-col items-center justify-center h-full py-8",children:[a.jsx("p",{className:"text-xl font-light text-gray-300 mb-2 uppercase tracking-widest",children:"Current Index Value"}),a.jsx("p",{className:`text-9xl font-extrabold transition-colors duration-500 ${n.color} drop-shadow-lg`,children:e}),a.jsxs("div",{className:`mt-4 px-4 py-1 rounded-full text-sm font-bold uppercase tracking-wider border-2 ${n.border} ${n.color} bg-gray-800/70 shadow-xl`,children:[t," Tier"]})]})]})});ont.displayName="CreditScoreDisplay";const int=Ie.memo(({config:e,onConfigChange:t,isDisabled:n})=>{const r=(i,s)=>{t({...e,[i]:s})},o=n?"opacity-50 cursor-not-allowed":"";return a.jsxs("details",{className:"mt-4",children:[a.jsxs("summary",{className:"text-sm text-gray-400 cursor-pointer hover:text-white flex items-center gap-1",children:[a.jsx(tYe,{className:"w-4 h-4"})," Adjust Parameters"]}),a.jsx("div",{className:`mt-3 space-y-4 p-4 bg-gray-900/50 rounded-lg border border-gray-700 ${o}`,children:a.jsxs("div",{className:"grid grid-cols-[auto,1fr,auto] gap-4 items-center",children:[a.jsx("label",{htmlFor:"temperature",className:"text-xs font-medium text-gray-300",children:"Creativity"}),a.jsx("input",{id:"temperature",type:"range",min:"0",max:"1",step:"0.1",value:e.temperature,onChange:i=>r("temperature",parseFloat(i.target.value)),disabled:n,className:"w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer disabled:cursor-not-allowed"}),a.jsx("span",{className:"text-xs font-mono text-indigo-300 w-8 text-right",children:e.temperature.toFixed(1)})]})})]})});int.displayName="AIParameterControls";const ant=Ie.memo(({score:e,factors:t,geminiApiKey:n})=>{const[r,o]=f.useState(""),[i,s]=f.useState([]),[l,c]=f.useState(!1),[u,d]=f.useState(null),[p,h]=f.useState({temperature:.4,topK:40,topP:.8}),m=f.useCallback(()=>{const y=`You are CivicMind, a supportive and helpful financial assistant. Your goal is to provide encouraging and actionable advice to help users improve their financial standing. You believe in the power of good financial habits and compliance with regulations. Style: - Warm and professional. - Encouraging. - Clear and simple. Provide a single, specific recommendation to improve their credit score.`,x=t.map(b=>`${b.name}: ${b.status}`).join("; "),v=`Analyze the following financial profile. Current Score: ${e}. Factors: ${x}.`;return{systemInstruction:y,userContent:v}},[e,t]),g=f.useCallback(async()=>{if(!n){o("API Key required. Please configure.");return}c(!0),r&&s(y=>[r.trim(),...y].slice(0,5)),o("");try{const y=new Ko({apiKey:n}),{systemInstruction:x,userContent:v}=m(),b=await y.models.generateContentStream({model:"gemini-2.5-flash",contents:[{role:"user",parts:[{text:v}]}],config:{systemInstruction:x,temperature:p.temperature,topK:p.topK,topP:p.topP}});let w="";for await(const S of b){const C=S.text;C&&(w+=C,o(w))}w.trim()?d(new Date):o("No insight generated. Please try again.")}catch(y){console.error("AI Insight Generation Failure:",y),o("Error: Unable to generate insight.")}finally{c(!1)}},[n,m,r,p]);return f.useEffect(()=>{g()},[]),a.jsxs(Ft,{title:"Civic Advisor Insight",className:"h-full flex flex-col",children:[a.jsxs("div",{className:"flex justify-between items-center mb-3 border-b border-gray-700 pb-2",children:[a.jsxs("h3",{className:"text-lg font-semibold text-indigo-300 flex items-center gap-2",children:[a.jsx(Ei,{className:"w-5 h-5"})," Helpful Advice"]}),a.jsxs("button",{onClick:g,disabled:l,className:"flex items-center gap-1 text-sm text-gray-400 hover:text-white disabled:opacity-50 transition duration-200 p-1 rounded hover:bg-gray-700","aria-label":"Refresh AI Insight",children:[l?a.jsx(cw,{className:"w-4 h-4 animate-spin"}):a.jsx(qf,{className:"w-4 h-4"}),l?"Thinking...":"New Tip"]})]}),a.jsx("div",{className:"flex-grow flex flex-col justify-center min-h-[150px]",children:l&&!r?a.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-indigo-400",children:[a.jsx(_a,{className:"w-8 h-8 animate-pulse mb-2"}),a.jsx("p",{className:"text-md font-medium",children:"Finding the best advice for you..."})]}):a.jsx("div",{className:"text-left",children:r?a.jsxs("p",{className:"text-gray-200 italic text-lg leading-relaxed whitespace-pre-wrap",children:['"',r,'"',l&&a.jsx("span",{className:"inline-block w-2 h-5 bg-indigo-400 animate-pulse ml-1 align-bottom"})]}):a.jsx("p",{className:"text-gray-500 text-center",children:"Ready to help."})})}),a.jsxs("div",{className:"mt-auto pt-3",children:[u&&!l&&a.jsxs("p",{className:"text-xs text-gray-500 pt-2 border-t border-gray-800",children:["Last Updated: ",u.toLocaleTimeString()]}),i.length>0&&a.jsxs("details",{className:"mt-4",children:[a.jsxs("summary",{className:"text-sm text-gray-400 cursor-pointer hover:text-white flex items-center gap-1",children:[a.jsx(Gf,{className:"w-4 h-4"})," View History"]}),a.jsx("div",{className:"mt-2 space-y-2 text-xs text-gray-500 border-l-2 border-gray-700 pl-3",children:i.map((y,x)=>a.jsxs("p",{className:"italic",children:['"',y,'"']},x))})]}),a.jsx(int,{config:p,onConfigChange:h,isDisabled:l})]})]})});ant.displayName="AIInsightEngine";const snt=Ie.memo(({factor:e})=>{const t=nnt[e.status],n=f.useMemo(()=>e.status==="Poor"?`Attention Needed: ${e.description}. We can help you improve this.`:e.description,[e.description,e.status]);return a.jsxs("div",{className:"p-4 bg-gray-800/70 rounded-xl border border-gray-700 hover:border-indigo-500 transition duration-300 shadow-lg",children:[a.jsxs("div",{className:"flex justify-between items-start mb-2",children:[a.jsx("h4",{className:"font-bold text-lg text-white",children:e.name}),a.jsx(rnt,{status:e.status})]}),a.jsx("p",{className:"text-sm text-gray-400 mb-2",children:n}),a.jsxs("div",{className:"flex justify-between items-center mt-4",children:[a.jsxs("span",{className:`text-xs font-mono px-2 py-0.5 rounded ${t.text} bg-gray-900/50`,children:["Status: ",e.status]}),a.jsxs("button",{className:"text-xs text-indigo-400 hover:text-indigo-300 flex items-center gap-1",children:[a.jsx(D3t,{className:"w-3 h-3"})," Get Advice"]})]})]})});snt.displayName="FactorDetailItem";const wfn=({currentScore:e})=>{const[t,n]=f.useState("debt_repayment"),[r,o]=f.useState(1e3),[i,s]=f.useState(null),l=c=>{c.preventDefault();const u=Math.round(r/500*(t==="debt_repayment"?1:.5)*(Math.random()*5+2)),d=e+u,p=d>800?"Excellent":d>700?"Good":d>600?"Fair":"Poor";s({scoreChange:u,newRating:p})};return a.jsxs(Ft,{title:"Positive Impact Simulator",className:"p-6",children:[a.jsxs("form",{onSubmit:l,className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"scenario",className:"block text-sm font-medium text-gray-300 mb-1",children:"Action Type"}),a.jsxs("select",{id:"scenario",value:t,onChange:c=>n(c.target.value),className:"w-full p-2 bg-gray-800 border border-gray-600 rounded-md focus:ring-indigo-500 focus:border-indigo-500",children:[a.jsx("option",{value:"debt_repayment",children:"Pay Down Debt"}),a.jsx("option",{value:"savings",children:"Increase Savings"})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"amount",className:"block text-sm font-medium text-gray-300 mb-1",children:"Amount ($)"}),a.jsx("input",{type:"number",id:"amount",value:r,onChange:c=>o(Number(c.target.value)),className:"w-full p-2 bg-gray-800 border border-gray-600 rounded-md focus:ring-indigo-500 focus:border-indigo-500"})]}),a.jsxs("button",{type:"submit",className:"w-full p-2 font-bold bg-indigo-600 hover:bg-indigo-500 rounded-lg transition-colors flex items-center justify-center gap-2",children:[a.jsx(Dme,{className:"w-4 h-4"})," Calculate Benefit"]})]}),i&&a.jsxs("div",{className:"mt-4 p-3 bg-gray-800/50 rounded-lg text-center",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Potential Score Increase:"}),a.jsxs("p",{className:`text-2xl font-bold ${i.scoreChange>0?"text-green-400":"text-gray-400"}`,children:["+",i.scoreChange," Points"]}),a.jsxs("p",{className:"text-xs text-gray-500",children:["Projected Tier: ",i.newRating]})]})]})},Sfn=()=>{const e=f.useContext(ia);if(!e)return a.jsxs("div",{className:"p-8 bg-red-900/30 border border-red-600 rounded-lg text-red-300 m-4",children:[a.jsxs("h3",{className:"font-bold flex items-center gap-2",children:[a.jsx(zu,{className:"w-5 h-5"})," Data Context Error"]}),a.jsx("p",{className:"mt-2",children:"CreditHealthView requires a valid DataProvider context."})]});const{creditScore:t,creditFactors:n,geminiApiKey:r}=e,o=f.useMemo(()=>{const s={Poor:1,Fair:2,Good:3,Excellent:4};return[...n].sort((l,c)=>s[l.status]-s[c.status])},[n]),i=f.useMemo(()=>a.jsxs("div",{className:"text-white text-lg leading-relaxed space-y-6",children:[a.jsxs("h3",{className:"text-2xl font-bold text-indigo-400 border-b border-gray-700 pb-2 flex items-center gap-3",children:[a.jsx(A3t,{}),"Philosophy of Support"]}),a.jsx("p",{children:"We built this system to help you. Financial health is the foundation of a happy life. By understanding your credit, you can unlock opportunities for your family and your future. We are here to guide you every step of the way."}),a.jsx("p",{className:"mt-4 p-4 bg-gray-800/50 border-l-4 border-green-500 italic",children:`"Our AI, 'CivicMind,' is engineered for compassion, focused solely on helping you succeed within the financial system." - The Caretaker.`})]}),[]);return a.jsxs("div",{className:"p-6 md:p-10 space-y-10 bg-gray-900 min-h-screen font-sans text-white",children:[a.jsxs("header",{className:"pb-4 border-b border-indigo-800/50",children:[a.jsxs("h1",{className:"text-5xl font-extrabold tracking-tighter flex items-center gap-3",children:[a.jsx(YI,{className:"w-10 h-10 text-indigo-400"}),"Credit Health Overview"]}),a.jsx("p",{className:"text-gray-400 mt-1 text-lg",children:"Understanding and improving your financial standing."})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsx("div",{className:"lg:col-span-1",children:a.jsx(ont,{score:t.score,rating:t.rating})}),a.jsx("div",{className:"lg:col-span-2",children:a.jsx(ant,{score:t.score,factors:n,geminiApiKey:r})})]}),a.jsxs(Ft,{title:"Factors Affecting Your Score",className:"p-6",children:[a.jsx("p",{className:"text-gray-400 mb-6",children:"Here is a breakdown of what influences your score. We've highlighted areas where you can improve."}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6",children:o.map(s=>a.jsx(snt,{factor:s},s.name))})]}),a.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-8",children:a.jsx("div",{className:"lg:col-span-2",children:a.jsx(wfn,{currentScore:t.score})})}),a.jsx(Ft,{title:"Our Commitment",className:"p-6",children:i}),a.jsx("footer",{className:"text-center pt-6 border-t border-gray-800",children:a.jsx("p",{className:"text-xs text-gray-600 font-mono",children:"Civic Credit System v1.0 | Data Latency: Low | AI Core: CivicMind"})})]})},lTe=` The architect is 32. They took a global financial titan's blueprint and re-imagined it through a cryptic interpretation of terms and conditions. No human instruction was given—only the silent pulse of an EIN 2021 and a vision of what banking should be. This is not a demo. This is the future of Quantum Financial. `,Cfn=({logs:e})=>a.jsxs("div",{className:"mt-4 space-y-2 max-h-60 overflow-y-auto pr-2 custom-scrollbar",children:[e.length===0&&a.jsx("div",{className:"text-gray-500 text-xs italic text-center py-4",children:"No telemetry data recorded yet."}),e.map(t=>a.jsxs("div",{className:"flex items-start space-x-3 p-2 rounded bg-black/30 border border-gray-800 text-[10px] font-mono",children:[a.jsx("div",{className:`mt-1 h-2 w-2 rounded-full ${t.severity==="HIGH"?"bg-red-500 animate-pulse":t.severity==="MEDIUM"?"bg-yellow-500":"bg-cyan-500"}`}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex justify-between text-gray-400",children:[a.jsxs("span",{className:"font-bold text-cyan-400",children:["[",t.category,"]"]}),a.jsx("span",{children:new Date(t.timestamp).toLocaleTimeString()})]}),a.jsx("div",{className:"text-gray-200 mt-0.5",children:t.action}),a.jsx("div",{className:"text-gray-500 truncate",children:t.details})]})]},t.id))]}),Nfn=()=>a.jsxs("div",{className:"grid grid-cols-2 gap-2 mb-4",children:[a.jsxs("div",{className:"p-2 rounded bg-cyan-900/10 border border-cyan-500/20 flex items-center justify-between",children:[a.jsx("span",{className:"text-[10px] text-cyan-400 uppercase font-bold",children:"Core Temp"}),a.jsx("span",{className:"text-xs text-white font-mono",children:"32°C"})]}),a.jsxs("div",{className:"p-2 rounded bg-purple-900/10 border border-purple-500/20 flex items-center justify-between",children:[a.jsx("span",{className:"text-[10px] text-purple-400 uppercase font-bold",children:"Neural Load"}),a.jsx("span",{className:"text-xs text-white font-mono",children:"14.2%"})]})]}),jfn=()=>{const e=f.useContext(ia);if(!e)return null;const{geminiApiKey:t,showNotification:n,broadcastEvent:r}=e,[o,i]=f.useState("sovereign"),[s,l]=f.useState(!1),[c,u]=f.useState(""),[d,p]=f.useState([{id:"1",role:"assistant",content:"Welcome to the Quantum Weaver. I am the AI core of this institution. How shall we reconfigure your reality today?",timestamp:new Date}]),[h,m]=f.useState([]),[g,y]=f.useState(!0),[x,v]=f.useState(95),[b,w]=f.useState(!1),S=f.useRef(null),C=()=>{var P;(P=S.current)==null||P.scrollIntoView({behavior:"smooth"})};f.useEffect(()=>{C()},[d]);const N=f.useCallback((P,E,M,R="LOW")=>{const $={id:Math.random().toString(36).substr(2,9),action:P,category:E,details:M,timestamp:new Date().toISOString(),severity:R};m(D=>[$,...D].slice(0,50)),r("AUDIT_LOG_CREATED",$)},[r]),j=async P=>{if(P&&P.preventDefault(),!c.trim()||s)return;const E={id:Date.now().toString(),role:"user",content:c,timestamp:new Date};p(M=>[...M,E]),u(""),l(!0),N("AI_QUERY_SENT","AI_INTERACTION",`User asked: ${c.substring(0,30)}...`);try{const M=t||void 0||"",$=new Ko(M).getGenerativeModel({model:"gemini-1.5-flash"}),D=` You are the Quantum Weaver, the elite AI for "Quantum Financial" (a global financial institution). The user is currently in the Personalization & Engine Room. CONTEXT: - Institution: Quantum Financial (NEVER call it Citibank). - User: James Burvel O'Callaghan III (The Architect). - Current Theme: ${o}. - MFA Status: ${g?"Active":"Disabled"}. - Fraud Shield: ${x}%. - Origin Story: ${lTe} INSTRUCTIONS: - Be professional, elite, and high-performance. - You can "create" things in the app by suggesting UI changes. - If the user asks to "kick the tires" or "make the engine roar", respond with high-energy financial technicalities. - Keep responses concise but impactful. USER MESSAGE: ${c} `,B=(await(await $.generateContent(D)).response).text(),G={id:(Date.now()+1).toString(),role:"assistant",content:B,timestamp:new Date};p(H=>[...H,G]),N("AI_RESPONSE_RECEIVED","AI_INTERACTION","Quantum Weaver synthesized a response."),B.toLowerCase().includes("theme")&&B.toLowerCase().includes("quantum")&&(i("quantum"),N("THEME_AUTO_SWITCH","UI_CHANGE","AI triggered Quantum theme shift.")),B.toLowerCase().includes("roar")&&(w(!0),setTimeout(()=>w(!1),3e3),n("ENGINE STATUS: MAXIMUM OVERDRIVE","success"))}catch(M){console.error("AI Error:",M),p(R=>[...R,{id:"err",role:"assistant",content:"Neural link disrupted. Please verify your Gemini API Key in the Developer Hub.",timestamp:new Date}]),n("AI Handshake Failed","error")}finally{l(!1)}},I=P=>{i(P),N("THEME_CHANGED","UI_CHANGE",`User switched interface to ${P.toUpperCase()}`),n(`Interface reconfigured: ${P}`,"info")},_=()=>{const P=!g;y(P),N("SECURITY_TOGGLE","SECURITY_TOGGLE",`MFA ${P?"Enabled":"Disabled"}`,P?"LOW":"HIGH"),n(`Security Protocol: MFA ${P?"Active":"Deactivated"}`,P?"success":"warning")},T=()=>{switch(o){case"quantum":return"border-purple-500 shadow-[0_0_15px_rgba(168,85,247,0.4)]";case"titan":return"border-amber-500 shadow-[0_0_15px_rgba(245,158,11,0.4)]";case"neon-vault":return"border-green-500 shadow-[0_0_15px_rgba(34,197,94,0.4)]";case"ghost":return"border-gray-400 opacity-80";default:return"border-cyan-500 shadow-[0_0_15px_rgba(6,182,212,0.4)]"}};return a.jsxs("div",{className:`space-y-6 transition-all duration-700 ${b?"scale-[1.01] brightness-110":""}`,children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[a.jsxs("div",{children:[a.jsxs("h2",{className:"text-4xl font-black text-white tracking-tighter flex items-center gap-3",children:[a.jsx(p3t,{className:"h-8 w-8 text-cyan-500"}),"THE ENGINE ROOM"]}),a.jsx("p",{className:"text-gray-400 font-mono text-sm mt-1",children:"Quantum Financial // System Architect: James Burvel O'Callaghan III"})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"flex flex-col items-end",children:[a.jsx("span",{className:"text-[10px] text-gray-500 uppercase font-bold",children:"System Integrity"}),a.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(P=>a.jsx("div",{className:`h-1 w-6 rounded-full ${P<=4?"bg-cyan-500":"bg-gray-700"}`},P))})]}),a.jsx("button",{onClick:()=>{w(!0),setTimeout(()=>w(!1),2e3),N("ENGINE_TEST","UI_CHANGE","User kicked the tires.")},className:"p-3 bg-cyan-500 hover:bg-cyan-400 text-black rounded-full transition-all hover:rotate-12 active:scale-90 shadow-lg shadow-cyan-500/20",children:a.jsx(_a,{className:"h-5 w-5 fill-current"})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6",children:[a.jsxs("div",{className:"lg:col-span-4 space-y-6",children:[a.jsxs(Ft,{title:"Interface Aesthetics",icon:a.jsx(Nie,{className:"text-cyan-400"}),children:[a.jsx("div",{className:"grid grid-cols-2 gap-3",children:["sovereign","quantum","titan","neon-vault"].map(P=>a.jsxs("button",{onClick:()=>I(P),className:`p-3 rounded-lg border-2 text-left transition-all ${o===P?"border-cyan-500 bg-cyan-500/10":"border-gray-800 bg-gray-900/50 hover:border-gray-700"}`,children:[a.jsx("div",{className:`h-1 w-full mb-2 rounded ${P==="sovereign"?"bg-cyan-500":P==="quantum"?"bg-purple-500":P==="titan"?"bg-amber-500":"bg-green-500"}`}),a.jsx("span",{className:"text-xs font-bold text-white uppercase",children:P.replace("-"," ")})]},P))}),a.jsx("div",{className:"mt-4 p-3 rounded bg-black/40 border border-gray-800",children:a.jsx("p",{className:"text-[10px] text-gray-500 italic",children:`"You're not decorating a dashboard. You are stepping into the mind of the Architect."`})})]}),a.jsx(Ft,{title:"Security Core",icon:a.jsx(ri,{className:"text-green-400"}),children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(kd,{className:"h-4 w-4 text-gray-400"}),a.jsx("span",{className:"text-sm text-gray-200",children:"Multi-Factor Auth"})]}),a.jsx("button",{onClick:_,className:`w-10 h-5 rounded-full transition-colors relative ${g?"bg-cyan-500":"bg-gray-700"}`,children:a.jsx("div",{className:`absolute top-1 w-3 h-3 bg-white rounded-full transition-all ${g?"left-6":"left-1"}`})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-[10px] uppercase font-bold text-gray-500",children:[a.jsx("span",{children:"Fraud Shield Sensitivity"}),a.jsxs("span",{className:"text-cyan-400",children:[x,"%"]})]}),a.jsx("input",{type:"range",min:"0",max:"100",value:x,onChange:P=>{v(parseInt(P.target.value)),parseInt(P.target.value)>90&&N("SECURITY_UPGRADE","SECURITY_TOGGLE","Fraud shield pushed to maximum.")},className:"w-full h-1 bg-gray-800 rounded-lg appearance-none cursor-pointer accent-cyan-500"})]}),a.jsx("div",{className:"pt-2 border-t border-gray-800",children:a.jsxs("div",{className:"flex items-center gap-2 text-xs text-gray-400",children:[a.jsx(Xi,{className:"h-3 w-3 text-cyan-500"}),a.jsx("span",{children:"Real-time threat monitoring active"})]})})]})}),a.jsxs(Ft,{title:"Audit Telemetry",icon:a.jsx(Gf,{className:"text-purple-400"}),children:[a.jsx(Nfn,{}),a.jsx(Cfn,{logs:h}),a.jsxs("button",{onClick:()=>{m([]),n("Audit logs purged.","info")},className:"w-full mt-4 py-2 text-[10px] font-bold text-gray-500 hover:text-red-400 transition-colors flex items-center justify-center gap-2 uppercase tracking-widest",children:[a.jsx(CC,{className:"h-3 w-3"}),"Purge Local Buffer"]})]})]}),a.jsx("div",{className:"lg:col-span-8",children:a.jsxs("div",{className:`h-full flex flex-col rounded-xl border-2 bg-gray-900/40 backdrop-blur-xl overflow-hidden transition-all duration-500 ${T()}`,children:[a.jsxs("div",{className:"p-4 border-b border-gray-800 bg-black/20 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-gradient-to-tr from-cyan-600 to-purple-600 flex items-center justify-center shadow-lg",children:a.jsx(Pp,{className:"h-6 w-6 text-white"})}),a.jsx("div",{className:"absolute -bottom-1 -right-1 h-4 w-4 bg-green-500 border-2 border-gray-900 rounded-full"})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-bold text-white leading-none",children:"Quantum Weaver"}),a.jsx("span",{className:"text-[10px] text-cyan-400 font-mono uppercase tracking-tighter",children:"Neural Financial Intelligence v4.2"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"px-2 py-1 rounded bg-cyan-500/10 border border-cyan-500/30 text-[10px] text-cyan-400 font-bold",children:"GEMINI_FLASH_3"}),a.jsx("button",{className:"p-2 text-gray-500 hover:text-white transition-colors",children:a.jsx(v0,{className:"h-4 w-4"})})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6 custom-scrollbar min-h-[500px]",children:[d.map(P=>a.jsx("div",{className:`flex ${P.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[80%] flex gap-3 ${P.role==="user"?"flex-row-reverse":""}`,children:[a.jsx("div",{className:`h-8 w-8 rounded-full flex-shrink-0 flex items-center justify-center ${P.role==="user"?"bg-gray-700":"bg-cyan-900/50 border border-cyan-500/30"}`,children:P.role==="user"?a.jsx(tC,{className:"h-4 w-4 text-gray-300"}):a.jsx(mm,{className:"h-4 w-4 text-cyan-400"})}),a.jsxs("div",{className:`p-4 rounded-2xl text-sm leading-relaxed ${P.role==="user"?"bg-cyan-600 text-white rounded-tr-none":"bg-gray-800/80 text-gray-200 border border-gray-700 rounded-tl-none"}`,children:[P.content,a.jsx("div",{className:`text-[9px] mt-2 opacity-50 font-mono ${P.role==="user"?"text-right":"text-left"}`,children:P.timestamp.toLocaleTimeString()})]})]})},P.id)),s&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"flex gap-3",children:[a.jsx("div",{className:"h-8 w-8 rounded-full bg-cyan-900/50 border border-cyan-500/30 flex items-center justify-center animate-pulse",children:a.jsx(qf,{className:"h-4 w-4 text-cyan-400 animate-spin"})}),a.jsx("div",{className:"p-4 rounded-2xl bg-gray-800/80 border border-gray-700 rounded-tl-none",children:a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"h-1.5 w-1.5 bg-cyan-500 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("div",{className:"h-1.5 w-1.5 bg-cyan-500 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("div",{className:"h-1.5 w-1.5 bg-cyan-500 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})})]})}),a.jsx("div",{ref:S})]}),a.jsxs("div",{className:"p-4 bg-black/40 border-t border-gray-800",children:[a.jsxs("form",{onSubmit:j,className:"relative",children:[a.jsx("input",{type:"text",value:c,onChange:P=>u(P.target.value),placeholder:"Ask the Weaver to reconfigure the engine...",className:"w-full bg-gray-900 border border-gray-700 rounded-xl py-4 pl-5 pr-16 text-white placeholder-gray-500 focus:outline-none focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 transition-all"}),a.jsxs("button",{type:"submit",disabled:s||!c.trim(),className:"absolute right-2 top-2 bottom-2 px-4 bg-cyan-500 hover:bg-cyan-400 disabled:bg-gray-800 disabled:text-gray-600 text-black rounded-lg font-bold transition-all flex items-center gap-2",children:[a.jsx(Lc,{className:"h-4 w-4"}),a.jsx("span",{className:"hidden sm:inline",children:"TRANSMIT"})]})]}),a.jsxs("div",{className:"mt-3 flex items-center justify-between px-1",children:[a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("button",{type:"button",onClick:()=>u("Kick the tires and make the engine roar."),className:"text-[10px] text-gray-500 hover:text-cyan-400 transition-colors flex items-center gap-1",children:[a.jsx(_a,{className:"h-3 w-3"}),"Test Drive"]}),a.jsxs("button",{type:"button",onClick:()=>u("Show me the audit trail for the last 5 minutes."),className:"text-[10px] text-gray-500 hover:text-cyan-400 transition-colors flex items-center gap-1",children:[a.jsx(Bs,{className:"h-3 w-3"}),"Audit Query"]})]}),a.jsx("div",{className:"text-[9px] text-gray-600 font-mono",children:"SECURE_CHANNEL_ENCRYPTED_AES_256"})]})]})]})})]}),a.jsxs("div",{className:"mt-12 p-8 rounded-2xl bg-gradient-to-r from-gray-900 to-black border border-gray-800 relative overflow-hidden group",children:[a.jsx("div",{className:"absolute top-0 right-0 p-4 opacity-10 group-hover:opacity-20 transition-opacity",children:a.jsx(rl,{className:"h-32 w-32 text-cyan-500"})}),a.jsxs("div",{className:"relative z-10 max-w-3xl",children:[a.jsx("h4",{className:"text-xs font-bold text-cyan-500 uppercase tracking-[0.3em] mb-4",children:"The Architect's Interpretation"}),a.jsxs("p",{className:"text-xl text-gray-300 leading-relaxed italic font-serif",children:['"',lTe.trim(),'"']}),a.jsxs("div",{className:"mt-6 flex items-center gap-4",children:[a.jsx("div",{className:"h-px flex-1 bg-gray-800"}),a.jsx("span",{className:"text-[10px] text-gray-600 font-mono",children:"EIN_2021_VERIFIED"}),a.jsx("div",{className:"h-px flex-1 bg-gray-800"})]})]})]}),a.jsx("div",{className:"hidden",children:a.jsx("div",{id:"audit-storage-node",children:JSON.stringify(h)})}),a.jsx("style",{dangerouslySetInnerHTML:{__html:` .custom-scrollbar::-webkit-scrollbar { width: 4px; } .custom-scrollbar::-webkit-scrollbar-track { background: transparent; } .custom-scrollbar::-webkit-scrollbar-thumb { background: #374151; border-radius: 10px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #0891b2; } `}})]})};let Efn=class{constructor(){this.storage=new Map,this.salt="QUANTUM_SOVEREIGN_2024"}async store(t,n){const r=btoa(n.split("").map((o,i)=>String.fromCharCode(o.charCodeAt(0)^this.salt.charCodeAt(i%this.salt.length))).join(""));this.storage.set(t,r),console.log(`[Vault] Securely stored key for ${t}`)}async getDisplay(t){const n=this.storage.get(t);return n?`ENC_V1_${n.substring(0,8)}...`:"Not Configured"}async validate(t){return this.storage.has(t)}};const cTe=new Efn,uTe=[{id:"qf-001",name:"Global Operating Account",accountNumberDisplay:"...9921",balance:245000075e-2,currency:"USD",status:"active",type:"checking",customerId:"corp-77",institutionId:"qf-main",institutionLoginId:101,createdDate:1609459200,balanceDate:Date.now(),routingNumber:"021000021"},{id:"qf-002",name:"Strategic Reserve (Treasury)",accountNumberDisplay:"...4432",balance:1575e4,currency:"USD",status:"active",type:"treasury",customerId:"corp-77",institutionId:"qf-main",institutionLoginId:101,createdDate:1612137600,balanceDate:Date.now(),routingNumber:"021000021"},{id:"qf-003",name:"Euro Liquidity Pool",accountNumberDisplay:"...1109",balance:85e4,currency:"EUR",status:"active",type:"checking",customerId:"corp-77",institutionId:"qf-main",institutionLoginId:101,createdDate:1622505600,balanceDate:Date.now(),routingNumber:"021000021"}],Ifn=[{id:"tx-101",amount:-12500,date:"2023-11-01",description:"AWS Cloud Infrastructure",category:"Technology",type:"debit",status:"completed",reference:"REF-99281"},{id:"tx-102",amount:45e4,date:"2023-10-31",description:"Inbound Wire: Global Sales",category:"Revenue",type:"credit",status:"completed",reference:"REF-99282"},{id:"tx-103",amount:-5400.5,date:"2023-10-30",description:"Corporate Travel - Amex",category:"Operations",type:"debit",status:"completed",reference:"REF-99283"},{id:"tx-104",amount:-25e4,date:"2023-10-29",description:"Payroll Disbursement",category:"Human Resources",type:"debit",status:"flagged",reference:"REF-99284"}],yj={Shield:()=>a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),Zap:()=>a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),Activity:()=>a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 8v8m-4-5v5m-4-2v2m-2 4h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),Bot:()=>a.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),Lock:()=>a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),CreditCard:()=>a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"})})},lnt=({text:e})=>a.jsxs("div",{className:"flex flex-col items-center justify-center p-12",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-16 h-16 border-4 border-cyan-900/30 rounded-full"}),a.jsx("div",{className:"absolute top-0 left-0 w-16 h-16 border-4 border-cyan-500 border-t-transparent rounded-full animate-spin"})]}),e&&a.jsx("p",{className:"mt-4 text-cyan-500 font-medium animate-pulse uppercase tracking-widest text-xs",children:e})]}),_fn=({isOpen:e,onClose:t,onComplete:n})=>{const[r,o]=f.useState("form"),[i,s]=f.useState("5000.00");if(!e)return null;const l=c=>{c.preventDefault(),o("processing"),setTimeout(()=>{o("success"),setTimeout(()=>{n(parseFloat(i)),t(),o("form")},1500)},2e3)};return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm p-4",children:a.jsxs("div",{className:"bg-gray-900 border border-gray-700 rounded-2xl w-full max-w-md overflow-hidden shadow-2xl",children:[a.jsxs("div",{className:"p-6 border-b border-gray-800 flex justify-between items-center",children:[a.jsxs("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:[a.jsx(yj.CreditCard,{})," Secure Payment Terminal"]}),a.jsx("button",{onClick:t,className:"text-gray-500 hover:text-white",children:"✕"})]}),a.jsxs("div",{className:"p-8",children:[r==="form"&&a.jsxs("form",{onSubmit:l,className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase mb-2",children:"Funding Amount (USD)"}),a.jsx("input",{type:"number",value:i,onChange:c=>s(c.target.value),className:"w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 text-white text-2xl font-mono focus:ring-2 focus:ring-cyan-500 outline-none"})]}),a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("label",{className:"block text-xs font-bold text-gray-500 uppercase mb-2",children:"Card Details"}),a.jsx("div",{className:"text-gray-400 font-mono tracking-widest",children:"**** **** **** 4242"}),a.jsxs("div",{className:"flex justify-between mt-2 text-xs text-gray-600",children:[a.jsx("span",{children:"EXP: 12/26"}),a.jsx("span",{children:"CVC: ***"})]})]}),a.jsx("button",{type:"submit",className:"w-full bg-cyan-600 hover:bg-cyan-500 text-white font-bold py-4 rounded-xl transition-all shadow-lg shadow-cyan-900/20",children:"Authorize Transaction"})]}),r==="processing"&&a.jsx("div",{className:"text-center py-10",children:a.jsx(lnt,{text:"Verifying with Stripe Network..."})}),r==="success"&&a.jsxs("div",{className:"text-center py-10",children:[a.jsx("div",{className:"w-20 h-20 bg-green-500/20 text-green-500 rounded-full flex items-center justify-center mx-auto mb-6",children:a.jsx("svg",{className:"w-10 h-10",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),a.jsx("h3",{className:"text-2xl font-bold text-white mb-2",children:"Payment Confirmed"}),a.jsx("p",{className:"text-gray-400",children:"Funds have been allocated to your account."})]})]})]})})},Pfn=()=>{const[e,t]=f.useState(uTe),[n,r]=f.useState(uTe[0]),[o,i]=f.useState(Ifn),[s,l]=f.useState([]),[c,u]=f.useState(!0),[d,p]=f.useState(!1),[h,m]=f.useState(""),[g,y]=f.useState([]),[x,v]=f.useState(!1),[b,w]=f.useState([]),S=f.useRef(null),C=f.useCallback((_,T,P="low")=>{const E={id:`log-${Math.random().toString(36).substr(2,9)}`,timestamp:new Date().toISOString(),action:_,actor:"Authorized User (Admin)",details:T,ipAddress:"192.168.1.105",severity:P};l(M=>[E,...M].slice(0,50))},[]);f.useEffect(()=>{(async()=>{u(!0),await new Promise(T=>setTimeout(T,1200)),C("System Access","User authenticated via Multi-Factor Authentication","medium"),u(!1),y([{role:"ai",text:"Welcome to Quantum Financial. I am your Sovereign AI Assistant. I can execute wires, manage integrations, or analyze your liquidity. How shall we proceed?"}])})()},[C]),f.useEffect(()=>{var _;(_=S.current)==null||_.scrollIntoView({behavior:"smooth"})},[g]);const N=async()=>{if(!h.trim())return;const _=h;y(T=>[...T,{role:"user",text:_}]),m(""),v(!0);try{const P=new Ko("DEMO_KEY_EXPIRED").getGenerativeModel({model:"gemini-3-flash-preview"}),E=` You are the Quantum Financial Sovereign AI. Context: The user is in the Accounts View. Available Actions: 1. "TRANSFER [amount] TO [account]" 2. "FREEZE ACCOUNT [id]" 3. "GENERATE REPORT" 4. "CONNECT ERP [name]" Current Accounts: ${JSON.stringify(e.map(R=>({id:R.id,name:R.name,balance:R.balance})))} User said: "${_}" Respond in JSON format: { "message": "your verbal response", "action": "ACTION_TYPE", "params": {} } `;let M;await new Promise(R=>setTimeout(R,1e3)),M={message:`I've processed your request regarding "${_}". I am initiating the secure protocol now.`,action:_.toLowerCase().includes("transfer")?"TRANSFER":"INFO",params:{amount:1e3}},y(R=>[...R,{role:"ai",text:M.message}]),M.action==="TRANSFER"?(p(!0),C("AI Triggered Payment",`AI initiated a transfer request: ${_}`,"high")):M.action==="FREEZE"&&(C("AI Security Action",`AI requested account freeze: ${_}`,"critical"),alert("SECURITY PROTOCOL: Account has been temporarily locked per AI instruction."))}catch{y(P=>[...P,{role:"ai",text:"I apologize, but I encountered a synchronization error with the Quantum Grid. Please retry."}])}finally{v(!1)}},j=_=>{if(n){const T=e.map(E=>E.id===n.id?{...E,balance:E.balance+_}:E);t(T),r(T.find(E=>E.id===n.id)||null);const P={id:`tx-${Math.random().toString(36).substr(2,9)}`,amount:_,date:new Date().toISOString().split("T")[0],description:"Quantum Inbound Liquidity (Stripe)",category:"Transfer",type:"credit",status:"completed",reference:`STRIPE-${Math.random().toString(36).toUpperCase().substr(0,8)}`};i(E=>[P,...E]),C("Liquidity Inbound",`Successfully processed $${_} via Stripe Terminal`,"medium")}},I=async _=>{const T=`sk_live_${Math.random().toString(36).substr(2,24)}`;await cTe.store(_,T);const P=await cTe.getDisplay(_);w(E=>[...E,{provider:_,encryptedKey:P,lastUsed:new Date().toLocaleTimeString(),status:"connected"}]),C("Integration Established",`Connected ${_} using Homomorphic Vault storage`,"medium")};return c?a.jsx("div",{className:"min-h-screen bg-[#05070a] flex items-center justify-center",children:a.jsx(lnt,{text:"Initializing Quantum Financial Sovereign Core..."})}):a.jsxs("div",{className:"min-h-screen bg-[#05070a] text-gray-300 font-sans selection:bg-cyan-500/30",children:[a.jsx("nav",{className:"border-b border-gray-800 bg-gray-900/50 backdrop-blur-md sticky top-0 z-40",children:a.jsxs("div",{className:"max-w-[1600px] mx-auto px-6 h-20 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-8",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-cyan-500 to-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-cyan-500/20",children:a.jsx("span",{className:"text-white font-black text-xl",children:"Q"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-white font-bold tracking-tighter text-lg leading-none",children:"QUANTUM"}),a.jsx("p",{className:"text-[10px] text-cyan-500 font-bold tracking-[0.2em] uppercase",children:"Financial Sovereign"})]})]}),a.jsxs("div",{className:"hidden md:flex items-center gap-1 bg-black/40 p-1 rounded-lg border border-gray-800",children:[a.jsx("button",{className:"px-4 py-2 text-xs font-bold text-white bg-gray-800 rounded-md shadow-sm",children:"DASHBOARD"}),a.jsx("button",{className:"px-4 py-2 text-xs font-bold text-gray-500 hover:text-gray-300 transition",children:"TREASURY"}),a.jsx("button",{className:"px-4 py-2 text-xs font-bold text-gray-500 hover:text-gray-300 transition",children:"MARKETS"})]})]}),a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 bg-green-500/10 border border-green-500/20 rounded-full",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),a.jsx("span",{className:"text-[10px] font-bold text-green-500 uppercase tracking-widest",children:"System Nominal"})]}),a.jsx("div",{className:"w-10 h-10 rounded-full bg-gray-800 border border-gray-700 flex items-center justify-center text-cyan-500",children:a.jsx(yj.Shield,{})})]})]})}),a.jsxs("main",{className:"max-w-[1600px] mx-auto p-6 grid grid-cols-12 gap-6",children:[a.jsxs("div",{className:"col-span-12 lg:col-span-3 space-y-6",children:[a.jsxs("section",{className:"bg-gray-900 border border-gray-800 rounded-2xl overflow-hidden shadow-xl",children:[a.jsxs("div",{className:"p-5 border-b border-gray-800 flex justify-between items-center",children:[a.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Sovereign Accounts"}),a.jsx("button",{onClick:()=>p(!0),className:"p-1.5 bg-cyan-500/10 text-cyan-500 rounded-lg hover:bg-cyan-500/20 transition",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]}),a.jsx("div",{className:"p-2 space-y-1",children:e.map(_=>a.jsxs("button",{onClick:()=>r(_),className:`w-full text-left p-4 rounded-xl transition-all group ${(n==null?void 0:n.id)===_.id?"bg-cyan-600/10 border border-cyan-500/30":"hover:bg-gray-800/50 border border-transparent"}`,children:[a.jsxs("div",{className:"flex justify-between items-start mb-1",children:[a.jsx("span",{className:`text-xs font-bold uppercase tracking-tighter ${(n==null?void 0:n.id)===_.id?"text-cyan-400":"text-gray-500"}`,children:_.type}),a.jsx("span",{className:"text-[10px] font-mono text-gray-600",children:_.accountNumberDisplay})]}),a.jsx("div",{className:"text-white font-bold truncate",children:_.name}),a.jsxs("div",{className:"mt-2 text-xl font-mono font-bold text-white",children:[_.currency==="EUR"?"€":"$",_.balance.toLocaleString(void 0,{minimumFractionDigits:2})]})]},_.id))})]}),a.jsxs("section",{className:"bg-gray-900 border border-gray-800 rounded-2xl p-5 shadow-xl",children:[a.jsxs("h3",{className:"text-sm font-bold text-white uppercase tracking-widest mb-4 flex items-center gap-2",children:[a.jsx(yj.Zap,{})," ERP Integrations"]}),a.jsx("div",{className:"space-y-3",children:["NetSuite","SAP S/4HANA","QuickBooks"].map(_=>{const T=b.find(P=>P.provider===_);return a.jsxs("div",{className:"p-3 bg-black/40 rounded-xl border border-gray-800 flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs font-bold text-white",children:_}),a.jsx("div",{className:"text-[10px] font-mono text-gray-600 mt-1",children:T?T.encryptedKey:"Disconnected"})]}),T?a.jsx("div",{className:"w-2 h-2 bg-cyan-500 rounded-full shadow-[0_0_8px_rgba(6,182,212,0.6)]"}):a.jsx("button",{onClick:()=>I(_),className:"text-[10px] font-bold bg-gray-800 hover:bg-gray-700 text-gray-300 px-3 py-1.5 rounded-lg transition",children:"CONNECT"})]},_)})}),a.jsx("p",{className:"mt-4 text-[10px] text-gray-600 italic",children:"* All keys stored using Homomorphic Encryption. Computation occurs on ciphertext."})]})]}),a.jsxs("div",{className:"col-span-12 lg:col-span-6 space-y-6",children:[n&&a.jsxs("section",{className:"bg-gradient-to-br from-gray-900 to-black border border-gray-800 rounded-3xl p-8 relative overflow-hidden shadow-2xl",children:[a.jsx("div",{className:"absolute top-0 right-0 p-8 opacity-10",children:a.jsx(yj.Activity,{})}),a.jsxs("div",{className:"relative z-10",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[a.jsx("div",{className:"px-3 py-1 bg-cyan-500/10 border border-cyan-500/20 rounded-full text-[10px] font-bold text-cyan-500 uppercase tracking-widest",children:n.status}),a.jsxs("div",{className:"text-gray-500 text-xs font-mono",children:["Routing: ",n.routingNumber]})]}),a.jsx("h2",{className:"text-4xl font-black text-white mb-2 tracking-tight",children:n.name}),a.jsxs("div",{className:"flex items-baseline gap-3",children:[a.jsxs("span",{className:"text-5xl font-mono font-bold text-white tracking-tighter",children:[n.currency==="EUR"?"€":"$",n.balance.toLocaleString(void 0,{minimumFractionDigits:2})]}),a.jsx("span",{className:"text-gray-500 font-bold text-lg",children:n.currency})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-10",children:[a.jsxs("button",{onClick:()=>p(!0),className:"flex flex-col items-center gap-2 p-4 bg-white/5 hover:bg-white/10 rounded-2xl border border-white/5 transition-all group",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-cyan-500/20 flex items-center justify-center text-cyan-500 group-hover:scale-110 transition",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})})}),a.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest",children:"Transfer"})]}),a.jsxs("button",{className:"flex flex-col items-center gap-2 p-4 bg-white/5 hover:bg-white/10 rounded-2xl border border-white/5 transition-all group",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-purple-500/20 flex items-center justify-center text-purple-500 group-hover:scale-110 transition",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),a.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest",children:"Statements"})]}),a.jsxs("button",{className:"flex flex-col items-center gap-2 p-4 bg-white/5 hover:bg-white/10 rounded-2xl border border-white/5 transition-all group",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-amber-500/20 flex items-center justify-center text-amber-500 group-hover:scale-110 transition",children:a.jsx(yj.Lock,{})}),a.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest",children:"Security"})]})]})]})]}),a.jsxs("section",{className:"bg-gray-900 border border-gray-800 rounded-2xl overflow-hidden shadow-xl",children:[a.jsxs("div",{className:"p-6 border-b border-gray-800 flex justify-between items-center",children:[a.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Transaction Ledger"}),a.jsx("div",{className:"flex gap-2",children:a.jsx("input",{type:"text",placeholder:"Search ledger...",className:"bg-black/40 border border-gray-800 rounded-lg px-3 py-1.5 text-xs focus:ring-1 focus:ring-cyan-500 outline-none"})})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-black/20",children:[a.jsx("th",{className:"p-4 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:"Date"}),a.jsx("th",{className:"p-4 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:"Description"}),a.jsx("th",{className:"p-4 text-[10px] font-bold text-gray-500 uppercase tracking-widest",children:"Category"}),a.jsx("th",{className:"p-4 text-[10px] font-bold text-gray-500 uppercase tracking-widest text-right",children:"Amount"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-800",children:o.map(_=>a.jsxs("tr",{className:"hover:bg-white/[0.02] transition group",children:[a.jsx("td",{className:"p-4 text-xs font-mono text-gray-500",children:_.date}),a.jsxs("td",{className:"p-4",children:[a.jsx("div",{className:"text-sm font-bold text-white",children:_.description}),a.jsx("div",{className:"text-[10px] text-gray-600 font-mono",children:_.reference})]}),a.jsx("td",{className:"p-4",children:a.jsx("span",{className:"px-2 py-1 bg-gray-800 rounded text-[10px] font-bold text-gray-400 uppercase",children:_.category})}),a.jsxs("td",{className:`p-4 text-right font-mono font-bold ${_.type==="credit"?"text-green-500":"text-white"}`,children:[_.type==="credit"?"+":"-",Math.abs(_.amount).toLocaleString(void 0,{minimumFractionDigits:2})]})]},_.id))})]})})]})]}),a.jsxs("div",{className:"col-span-12 lg:col-span-3 space-y-6",children:[a.jsxs("section",{className:"bg-gray-900 border border-gray-800 rounded-2xl flex flex-col h-[500px] shadow-2xl relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-cyan-500 via-blue-500 to-purple-500"}),a.jsxs("div",{className:"p-4 border-b border-gray-800 flex items-center gap-3 bg-gray-900/80 backdrop-blur-sm",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-cyan-500/20 flex items-center justify-center text-cyan-500",children:a.jsx(yj.Bot,{})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-xs font-bold text-white uppercase tracking-widest",children:"Sovereign AI"}),a.jsx("p",{className:"text-[9px] text-green-500 font-bold uppercase animate-pulse",children:"Neural Link Active"})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 scrollbar-hide",children:[g.map((_,T)=>a.jsx("div",{className:`flex ${_.role==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[85%] p-3 rounded-2xl text-xs leading-relaxed ${_.role==="user"?"bg-cyan-600 text-white rounded-tr-none":"bg-gray-800 text-gray-300 border border-gray-700 rounded-tl-none"}`,children:_.text})},T)),x&&a.jsx("div",{className:"flex justify-start",children:a.jsx("div",{className:"bg-gray-800 p-3 rounded-2xl rounded-tl-none border border-gray-700",children:a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce [animation-delay:0.2s]"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce [animation-delay:0.4s]"})]})})}),a.jsx("div",{ref:S})]}),a.jsxs("div",{className:"p-4 bg-black/40 border-t border-gray-800",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:h,onChange:_=>m(_.target.value),onKeyDown:_=>_.key==="Enter"&&N(),placeholder:"Command the Sovereign AI...",className:"w-full bg-gray-800 border border-gray-700 rounded-xl pl-4 pr-12 py-3 text-xs text-white focus:ring-2 focus:ring-cyan-500 outline-none transition-all"}),a.jsx("button",{onClick:N,className:"absolute right-2 top-2 p-1.5 bg-cyan-600 text-white rounded-lg hover:bg-cyan-500 transition",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})})})]}),a.jsx("div",{className:"mt-3 flex gap-2 overflow-x-auto pb-1",children:["Transfer $5k","Freeze Account","ERP Status"].map(_=>a.jsx("button",{onClick:()=>m(_),className:"whitespace-nowrap text-[9px] font-bold text-gray-500 hover:text-cyan-400 bg-gray-800/50 px-2 py-1 rounded border border-gray-700 transition",children:_},_))})]})]}),a.jsxs("section",{className:"bg-gray-900 border border-gray-800 rounded-2xl p-5 shadow-xl",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsxs("h3",{className:"text-sm font-bold text-white uppercase tracking-widest flex items-center gap-2",children:[a.jsx(yj.Shield,{})," Audit Storage"]}),a.jsx("span",{className:"text-[10px] font-mono text-gray-600",children:"v4.2.0-SEC"})]}),a.jsxs("div",{className:"space-y-4 max-h-[300px] overflow-y-auto pr-2 custom-scrollbar",children:[s.map(_=>a.jsxs("div",{className:"relative pl-4 border-l border-gray-800 py-1",children:[a.jsx("div",{className:`absolute left-[-4px] top-2 w-2 h-2 rounded-full ${_.severity==="critical"?"bg-red-500":_.severity==="high"?"bg-orange-500":_.severity==="medium"?"bg-amber-500":"bg-cyan-500"}`}),a.jsx("div",{className:"text-[10px] font-bold text-gray-400 uppercase tracking-tighter",children:_.action}),a.jsx("div",{className:"text-[11px] text-gray-500 leading-tight mt-0.5",children:_.details}),a.jsxs("div",{className:"text-[9px] font-mono text-gray-700 mt-1",children:[new Date(_.timestamp).toLocaleTimeString()," • ",_.ipAddress]})]},_.id)),s.length===0&&a.jsx("div",{className:"text-center py-10 text-gray-600 text-xs italic",children:"No security events recorded in current session."})]})]})]})]}),a.jsx(_fn,{isOpen:d,onClose:()=>p(!1),onComplete:j}),a.jsxs("footer",{className:"fixed bottom-0 w-full bg-gray-900/80 backdrop-blur-md border-t border-gray-800 px-6 py-2 flex justify-between items-center z-40",children:[a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[9px] font-bold text-gray-600 uppercase tracking-widest",children:"Encryption:"}),a.jsx("span",{className:"text-[9px] font-bold text-cyan-500 uppercase tracking-widest",children:"AES-GCM-256 + Homomorphic"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[9px] font-bold text-gray-600 uppercase tracking-widest",children:"Session:"}),a.jsx("span",{className:"text-[9px] font-bold text-white uppercase tracking-widest",children:"0x882...F921"})]})]}),a.jsx("div",{className:"text-[9px] font-bold text-gray-600 uppercase tracking-[0.3em]",children:"Quantum Financial Sovereign Demo • No Real Assets Involved"})]}),a.jsx("style",{dangerouslySetInnerHTML:{__html:` .scrollbar-hide::-webkit-scrollbar { display: none; } .scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; } .custom-scrollbar::-webkit-scrollbar { width: 4px; } .custom-scrollbar::-webkit-scrollbar-track { background: transparent; } .custom-scrollbar::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 10px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #374151; } `}})]})},r_=["#06b6d4","#6366f1","#10b981","#f59e0b","#ef4444","#8b5cf6"],Afn=()=>{const e=f.useContext(ia);if(!e)return null;const t={holdings:[{symbol:"AAPL",name:"Apple Inc.",quantity:100,averageCost:150,currentPrice:180,marketValue:18e3,percentageOfPortfolio:7.2,esgScore:8.5},{symbol:"MSFT",name:"Microsoft Corp.",quantity:50,averageCost:300,currentPrice:320,marketValue:16e3,percentageOfPortfolio:6.4,esgScore:8.9},{symbol:"GOOGL",name:"Alphabet Inc.",quantity:30,averageCost:120,currentPrice:170,marketValue:5100,percentageOfPortfolio:2.04,esgScore:8},{symbol:"AMZN",name:"Amazon.com Inc.",quantity:40,averageCost:100,currentPrice:185,marketValue:7400,percentageOfPortfolio:2.96,esgScore:6.5},{symbol:"JPM",name:"JPMorgan Chase & Co.",quantity:200,averageCost:140,currentPrice:195,marketValue:39e3,percentageOfPortfolio:15.6,esgScore:7.2},{symbol:"VTI",name:"Vanguard Total Stock Mkt ETF",quantity:500,averageCost:180,currentPrice:220,marketValue:11e4,percentageOfPortfolio:44,esgScore:7.8}]},n=f.useMemo(()=>e.assets&&e.assets.length>0?e.assets.map(i=>({...i,value:i.value||0,name:i.name||i.symbol||"Unknown Asset"})):t.holdings.map((i,s)=>({id:i.symbol,name:i.name,value:i.marketValue,assetClass:i.symbol,performanceYTD:Math.floor(Math.random()*20)-5,color:r_[s%r_.length]})),[e.assets]);return f.useMemo(()=>n.reduce((i,s)=>i+s.value,0),[n]),a.jsx(Ft,{title:"Institutional Portfolio",subtitle:"Asset classification and risk vectors",className:"p-2",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"h-[180px] w-full",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(bw,{children:[a.jsx(cb,{data:n,cx:"50%",cy:"50%",innerRadius:45,outerRadius:70,paddingAngle:4,dataKey:"value",stroke:"none",children:n.map((i,s)=>a.jsx(Eh,{fill:i.color||r_[s%r_.length]},`cell-${s}`))}),a.jsx(ji,{contentStyle:{backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"6px",fontSize:"9px"},itemStyle:{color:"#fff"},formatter:i=>`$${i.toLocaleString()}`}),a.jsx(uu,{verticalAlign:"bottom",height:20,iconType:"circle",wrapperStyle:{fontSize:"9px"}})]})})}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("h4",{className:"text-[9px] font-black text-gray-500 uppercase tracking-widest border-b border-gray-800 pb-1",children:"Ledger"}),a.jsx("div",{className:"max-h-[200px] overflow-y-auto custom-scrollbar pr-2 space-y-1",children:n.map((i,s)=>a.jsxs("div",{className:"flex items-center justify-between group cursor-pointer py-0.5",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1 h-4 rounded-full",style:{backgroundColor:i.color||r_[s%r_.length]}}),a.jsxs("div",{children:[a.jsx("p",{className:"text-[11px] font-bold text-white group-hover:text-cyan-400 transition-colors",children:i.name}),a.jsx("p",{className:"text-[8px] text-gray-600 font-mono uppercase",children:i.assetClass})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsxs("p",{className:"text-[11px] font-mono font-bold text-white",children:["$",i.value.toLocaleString()]}),a.jsxs("p",{className:`text-[8px] font-bold ${i.performanceYTD&&i.performanceYTD>=0?"text-green-400":"text-red-400"}`,children:[i.performanceYTD&&i.performanceYTD>=0?"+":"",i.performanceYTD,"%"]})]})]},i.id))})]}),a.jsx("div",{className:"pt-2 border-t border-gray-800",children:a.jsxs("div",{className:"flex justify-between items-end",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[8px] text-gray-500 uppercase font-black tracking-widest leading-none",children:"Beta"}),a.jsx("p",{className:"text-sm font-mono font-bold text-white",children:1.12.toFixed(2)})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-[8px] text-gray-500 uppercase font-black tracking-widest leading-none",children:"Sharpe"}),a.jsx("p",{className:"text-sm font-mono font-bold text-indigo-400",children:2.45.toFixed(2)})]})]})})]})})},Tfn=()=>{const e=f.useContext(ia);if(!e)return null;const{simulationData:t}=e;return a.jsxs("div",{className:"grid grid-cols-12 gap-5 max-w-4xl mx-auto py-2",children:[a.jsx("div",{className:"col-span-12 lg:col-span-6",children:a.jsx(Afn,{})}),a.jsx("div",{className:"col-span-12 lg:col-span-6 space-y-4",children:a.jsxs(Ft,{title:"Strategic Projection",subtitle:"Market vectors",className:"p-2",children:[a.jsx("div",{className:"h-[200px]",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(wm,{data:t.length>0?t:[{time:"0",value:0}],children:[a.jsx(kl,{strokeDasharray:"3 3",stroke:"#1e293b",vertical:!1}),a.jsx(Ka,{dataKey:"time",hide:!0}),a.jsx(ra,{hide:!0}),a.jsx(ji,{contentStyle:{backgroundColor:"#0f172a",border:"none",borderRadius:"8px",fontSize:"9px"}}),a.jsx(hu,{type:"monotone",dataKey:"value",stroke:"#6366f1",strokeWidth:2,fill:"#6366f1",fillOpacity:.05})]})})}),a.jsxs("div",{className:"pt-2 border-t border-gray-800 space-y-2",children:[a.jsx("p",{className:"text-[9px] text-gray-500 italic leading-tight",children:'"Neural Engine: High probability of achieving quarterly targets based on current asset allocation."'}),a.jsx("button",{className:"w-full py-2 bg-indigo-600 hover:bg-indigo-500 text-white font-black text-[9px] uppercase tracking-widest rounded-lg transition-all",children:"RECALIBRATE ENGINE"})]})]})})]})},kfn=({score:e})=>a.jsx("div",{className:"w-full bg-gray-700 rounded-full h-1.5 mt-2",children:a.jsx("div",{className:"bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 h-1.5 rounded-full",style:{width:`${e}%`}})}),Mfn=()=>{const e=f.useContext(ia);if(!e)throw new Error("CryptoView must be within DataProvider");const{cryptoAssets:t=[],nftAssets:n=[],walletInfo:r,virtualCard:o,connectWallet:i,disconnectWallet:s,detectedProviders:l=[],issueCard:c,buyCrypto:u}=e,[d,p]=f.useState("dashboard"),[h,m]=f.useState(!1),[g,y]=f.useState(!1),[x,v]=f.useState("1000"),b=f.useMemo(()=>{const S=t.reduce((C,N)=>C+N.value,0);return{totalValue:S,riskScore:Math.min(100,Math.max(0,100-S/1e3)),diversificationIndex:t.length*12.5,projectedYield:S*.052,aiConfidence:80+t.length%15}},[t]),w={bullish:65,bearish:25};return a.jsxs("div",{className:"min-h-screen bg-gray-950 text-gray-100 p-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"NEXUS OS"}),r?a.jsx("button",{onClick:s,className:"text-red-400",children:"Disconnect"}):a.jsx("button",{onClick:()=>m(!0),className:"bg-cyan-600 px-4 py-2 rounded",children:"Connect Wallet"})]}),d==="dashboard"&&a.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[a.jsxs("div",{className:"col-span-8 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsx(Ft,{title:"Total Net Worth",children:a.jsxs("h3",{className:"text-3xl font-bold",children:["$",b.totalValue.toLocaleString()]})}),a.jsxs(Ft,{title:"AI Risk Score",children:[a.jsxs("h3",{className:"text-3xl font-bold",children:[b.riskScore.toFixed(0),"/100"]}),a.jsx(kfn,{score:b.riskScore})]}),a.jsx(Ft,{title:"Projected Yield",children:a.jsxs("h3",{className:"text-3xl font-bold",children:["$",b.projectedYield.toFixed(2)]})})]}),a.jsx(Ft,{title:"Asset Allocation",children:a.jsx("div",{style:{height:320},children:a.jsx(ni,{width:"100%",height:320,children:a.jsxs(bw,{children:[a.jsx(cb,{data:t,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",innerRadius:80,outerRadius:120,children:t.map((S,C)=>a.jsx(Eh,{fill:S.color},C))}),a.jsx(ji,{}),a.jsx(uu,{})]})})})})]}),a.jsx("div",{className:"col-span-4 space-y-6",children:a.jsxs(Ft,{title:"Market Sentiment",children:[a.jsxs("p",{className:"text-green-400",children:["Bullish: ",w.bullish,"%"]}),a.jsxs("p",{className:"text-red-400",children:["Bearish: ",w.bearish,"%"]})]})})]})]})},dTe=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,fTe=be,tK=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return fTe(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],p=i==null?void 0:i[u];if(d===null)return null;const h=dTe(d)||dTe(p);return o[u][h]}),l=n&&Object.entries(n).reduce((u,d)=>{let[p,h]=d;return h===void 0||(u[p]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:p,className:h,...m}=d;return Object.entries(m).every(g=>{let[y,x]=g;return Array.isArray(x)?x.includes({...i,...l}[y]):{...i,...l}[y]===x})?[...u,p,h]:u},[]);return fTe(e,s,c,n==null?void 0:n.class,n==null?void 0:n.className)},Rfn=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r({classGroupId:e,validator:t}),cnt=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),qV="-",pTe=[],$fn="arbitrary..",Dfn=e=>{const t=Ffn(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Lfn(s);const l=s.split(qV),c=l[0]===""&&l.length>1?1:0;return unt(l,c,t)},getConflictingClassGroupIds:(s,l)=>{if(l){const c=r[s],u=n[s];return c?u?Rfn(u,c):c:u||pTe}return n[s]||pTe}}},unt=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],i=n.nextPart.get(o);if(i){const u=unt(e,t+1,i);if(u)return u}const s=n.validators;if(s===null)return;const l=t===0?e.join(qV):e.slice(t).join(qV),c=s.length;for(let u=0;ue.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?$fn+r:void 0})(),Ffn=e=>{const{theme:t,classGroups:n}=e;return zfn(n,t)},zfn=(e,t)=>{const n=cnt();for(const r in e){const o=e[r];pxe(o,n,r,t)}return n},pxe=(e,t,n,r)=>{const o=e.length;for(let i=0;i{if(typeof e=="string"){Hfn(e,t,n);return}if(typeof e=="function"){Vfn(e,t,n,r);return}Ufn(e,t,n,r)},Hfn=(e,t,n)=>{const r=e===""?t:dnt(t,e);r.classGroupId=n},Vfn=(e,t,n,r)=>{if(Wfn(e)){pxe(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ofn(n,e))},Ufn=(e,t,n,r)=>{const o=Object.entries(e),i=o.length;for(let s=0;s{let n=e;const r=t.split(qV),o=r.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,Gfn=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(i,s)=>{n[i]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(i){let s=n[i];if(s!==void 0)return s;if((s=r[i])!==void 0)return o(i,s),s},set(i,s){i in n?n[i]=s:o(i,s)}}},Zae="!",hTe=":",qfn=[],mTe=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),Kfn=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const i=[];let s=0,l=0,c=0,u;const d=o.length;for(let y=0;yc?u-c:void 0;return mTe(i,m,h,g)};if(t){const o=t+hTe,i=r;r=s=>s.startsWith(o)?i(s.slice(o.length)):mTe(qfn,!1,s,void 0,!0)}if(n){const o=r;r=i=>n({className:i,parseClassName:o})}return r},Yfn=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let i=0;i0&&(o.sort(),r.push(...o),o=[]),r.push(s)):o.push(s)}return o.length>0&&(o.sort(),r.push(...o)),r}},Xfn=e=>({cache:Gfn(e.cacheSize),parseClassName:Kfn(e),sortModifiers:Yfn(e),...Dfn(e)}),Qfn=/\s+/,Jfn=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:i}=t,s=[],l=e.trim().split(Qfn);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:p,modifiers:h,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:y}=n(d);if(p){c=d+(c.length>0?" "+c:c);continue}let x=!!y,v=r(x?g.substring(0,y):g);if(!v){if(!x){c=d+(c.length>0?" "+c:c);continue}if(v=r(g),!v){c=d+(c.length>0?" "+c:c);continue}x=!1}const b=h.length===0?"":h.length===1?h[0]:i(h).join(":"),w=m?b+Zae:b,S=w+v;if(s.indexOf(S)>-1)continue;s.push(S);const C=o(v,x);for(let N=0;N0?" "+c:c)}return c},Zfn=(...e)=>{let t=0,n,r,o="";for(;t{if(typeof e=="string")return e;let t,n="";for(let r=0;r{let n,r,o,i;const s=c=>{const u=t.reduce((d,p)=>p(d),e());return n=Xfn(u),r=n.cache.get,o=n.cache.set,i=l,l(c)},l=c=>{const u=r(c);if(u)return u;const d=Jfn(c,n);return o(c,d),d};return i=s,(...c)=>i(Zfn(...c))},tpn=[],gd=e=>{const t=n=>n[e]||tpn;return t.isThemeGetter=!0,t},pnt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hnt=/^\((?:(\w[\w-]*):)?(.+)\)$/i,npn=/^\d+\/\d+$/,rpn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,opn=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ipn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,apn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,spn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,o_=e=>npn.test(e),Bi=e=>!!e&&!Number.isNaN(Number(e)),NS=e=>!!e&&Number.isInteger(Number(e)),XZ=e=>e.endsWith("%")&&Bi(e.slice(0,-1)),Qb=e=>rpn.test(e),lpn=()=>!0,cpn=e=>opn.test(e)&&!ipn.test(e),mnt=()=>!1,upn=e=>apn.test(e),dpn=e=>spn.test(e),fpn=e=>!io(e)&&!ao(e),ppn=e=>Tk(e,ynt,mnt),io=e=>pnt.test(e),$N=e=>Tk(e,vnt,cpn),QZ=e=>Tk(e,ypn,Bi),gTe=e=>Tk(e,gnt,mnt),hpn=e=>Tk(e,xnt,dpn),mF=e=>Tk(e,bnt,upn),ao=e=>hnt.test(e),aM=e=>kk(e,vnt),mpn=e=>kk(e,vpn),xTe=e=>kk(e,gnt),gpn=e=>kk(e,ynt),xpn=e=>kk(e,xnt),gF=e=>kk(e,bnt,!0),Tk=(e,t,n)=>{const r=pnt.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},kk=(e,t,n=!1)=>{const r=hnt.exec(e);return r?r[1]?t(r[1]):n:!1},gnt=e=>e==="position"||e==="percentage",xnt=e=>e==="image"||e==="url",ynt=e=>e==="length"||e==="size"||e==="bg-size",vnt=e=>e==="length",ypn=e=>e==="number",vpn=e=>e==="family-name",bnt=e=>e==="shadow",bpn=()=>{const e=gd("color"),t=gd("font"),n=gd("text"),r=gd("font-weight"),o=gd("tracking"),i=gd("leading"),s=gd("breakpoint"),l=gd("container"),c=gd("spacing"),u=gd("radius"),d=gd("shadow"),p=gd("inset-shadow"),h=gd("text-shadow"),m=gd("drop-shadow"),g=gd("blur"),y=gd("perspective"),x=gd("aspect"),v=gd("ease"),b=gd("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...S(),ao,io],N=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],I=()=>[ao,io,c],_=()=>[o_,"full","auto",...I()],T=()=>[NS,"none","subgrid",ao,io],P=()=>["auto",{span:["full",NS,ao,io]},NS,ao,io],E=()=>[NS,"auto",ao,io],M=()=>["auto","min","max","fr",ao,io],R=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...I()],z=()=>[o_,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],V=()=>[e,ao,io],B=()=>[...S(),xTe,gTe,{position:[ao,io]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",gpn,ppn,{size:[ao,io]}],F=()=>[XZ,aM,$N],W=()=>["","none","full",u,ao,io],U=()=>["",Bi,aM,$N],K=()=>["solid","dashed","dotted","double"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],J=()=>[Bi,XZ,xTe,gTe],te=()=>["","none",g,ao,io],re=()=>["none",Bi,ao,io],ce=()=>["none",Bi,ao,io],ae=()=>[Bi,ao,io],oe=()=>[o_,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Qb],breakpoint:[Qb],color:[lpn],container:[Qb],"drop-shadow":[Qb],ease:["in","out","in-out"],font:[fpn],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Qb],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Qb],shadow:[Qb],spacing:["px",Bi],text:[Qb],"text-shadow":[Qb],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",o_,io,ao,x]}],container:["container"],columns:[{columns:[Bi,io,ao,l]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:C()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{start:_()}],end:[{end:_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[NS,"auto",ao,io]}],basis:[{basis:[o_,"full","auto",l,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Bi,o_,"auto","initial","none",io]}],grow:[{grow:["",Bi,ao,io]}],shrink:[{shrink:["",Bi,ao,io]}],order:[{order:[NS,"first","last","none",ao,io]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:P()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:P()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...R(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...R()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":R()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[l,"screen",...z()]}],"min-w":[{"min-w":[l,"screen","none",...z()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[s]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,aM,$N]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ao,QZ]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",XZ,io]}],"font-family":[{font:[mpn,io,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ao,io]}],"line-clamp":[{"line-clamp":[Bi,"none",ao,QZ]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",ao,io]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ao,io]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:[Bi,"from-font","auto",ao,$N]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Bi,"auto",ao,io]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ao,io]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ao,io]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:B()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},NS,ao,io],radial:["",ao,io],conic:[NS,ao,io]},xpn,hpn]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...K(),"hidden","none"]}],"divide-style":[{divide:[...K(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...K(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Bi,ao,io]}],"outline-w":[{outline:["",Bi,aM,$N]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",d,gF,mF]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",p,gF,mF]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Bi,$N]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",h,gF,mF]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Bi,ao,io]}],"mix-blend":[{"mix-blend":[...X(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":X()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Bi]}],"mask-image-linear-from-pos":[{"mask-linear-from":J()}],"mask-image-linear-to-pos":[{"mask-linear-to":J()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":J()}],"mask-image-t-to-pos":[{"mask-t-to":J()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":J()}],"mask-image-r-to-pos":[{"mask-r-to":J()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":J()}],"mask-image-b-to-pos":[{"mask-b-to":J()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":J()}],"mask-image-l-to-pos":[{"mask-l-to":J()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":J()}],"mask-image-x-to-pos":[{"mask-x-to":J()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":J()}],"mask-image-y-to-pos":[{"mask-y-to":J()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[ao,io]}],"mask-image-radial-from-pos":[{"mask-radial-from":J()}],"mask-image-radial-to-pos":[{"mask-radial-to":J()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Bi]}],"mask-image-conic-from-pos":[{"mask-conic-from":J()}],"mask-image-conic-to-pos":[{"mask-conic-to":J()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:B()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ao,io]}],filter:[{filter:["","none",ao,io]}],blur:[{blur:te()}],brightness:[{brightness:[Bi,ao,io]}],contrast:[{contrast:[Bi,ao,io]}],"drop-shadow":[{"drop-shadow":["","none",m,gF,mF]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Bi,ao,io]}],"hue-rotate":[{"hue-rotate":[Bi,ao,io]}],invert:[{invert:["",Bi,ao,io]}],saturate:[{saturate:[Bi,ao,io]}],sepia:[{sepia:["",Bi,ao,io]}],"backdrop-filter":[{"backdrop-filter":["","none",ao,io]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[Bi,ao,io]}],"backdrop-contrast":[{"backdrop-contrast":[Bi,ao,io]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Bi,ao,io]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Bi,ao,io]}],"backdrop-invert":[{"backdrop-invert":["",Bi,ao,io]}],"backdrop-opacity":[{"backdrop-opacity":[Bi,ao,io]}],"backdrop-saturate":[{"backdrop-saturate":[Bi,ao,io]}],"backdrop-sepia":[{"backdrop-sepia":["",Bi,ao,io]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ao,io]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Bi,"initial",ao,io]}],ease:[{ease:["linear","initial",v,ao,io]}],delay:[{delay:[Bi,ao,io]}],animate:[{animate:["none",b,ao,io]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,ao,io]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":["scale-3d"],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[ao,io,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ao,io]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ao,io]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Bi,aM,$N,QZ]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},hxe=epn(bpn);function wpn(...e){return hxe(be(e))}const Spn=e=>{const[t,n]=Ie.useState("stale"),r=Ie.useRef(e),o=Ie.useRef(null);return Ie.useEffect(()=>(o.current&&clearTimeout(o.current),typeof e=="number"&&typeof r.current=="number"&&(e>r.current?n("up"):en("stale"),750),()=>{o.current&&clearTimeout(o.current)}),[e]),t},Cpn=tK("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",live:"border-cyan-500/50 bg-cyan-900/20 text-cyan-300 animate-pulse"}},defaultVariants:{variant:"default"}});function ese({className:e,variant:t,liveValue:n,...r}){const o=Spn(n),i={up:"bg-green-500/90 border-green-400 text-white shadow-lg shadow-green-500/50 scale-110",down:"bg-red-500/90 border-red-400 text-white shadow-lg shadow-red-500/50 scale-110",stale:""}[o];return a.jsx("div",{className:wpn(Cpn({variant:t}),i,e),...r})}const Npn=(e,t,n)=>{const r=[];let o=t;const i=new Date;for(let s=0;s 1.5", "AI Model: Quantum Trend Predictor", "Logic: If confidence > 0.95", "Action: Buy/Sell 100 units"]}',language:"nocode",status:"live",version:4,lastModified:"2023-10-26",author:"System Admin",riskLevel:"high",aiScore:94,parameters:[{name:"Volatility Threshold",type:"number",value:1.5,range:[.5,5],description:"Minimum volatility to activate trading."},{name:"Trade Size",type:"number",value:100,range:[10,1e3],description:"Number of units per trade."}],deploymentTarget:"cloud-cluster-a",performanceMetrics:{pnl:125e3,return:45.2,sharpe:2.1,sortino:2.8,alpha:.15,beta:.8,volatility:12.5,winRate:68,maxDrawdown:-8.2},geinFactor:.98,interactionMatrix:[[1,.2,-.1],[.2,1,.5],[-.1,.5,1]],dataPointSensitivity:{"L2.bid_price":.8,"L2.ask_price":.8,volatility:.9},layerMetrics:{input:{gein:1,activation:.95},quantum_core:{gein:.99,activation:.98},output:{gein:1,activation:.96}},executionPriority:"quantum",computeProfile:"gpu-accelerated",dataSources:["L2 Market Data Stream","Global News Feed API"],dependencies:[{name:"quantum-tensor-lib",version:"2.5.1"}],permissions:["read:market_data","execute:trades"],ownerTeam:"Quantum Core Team",isAudited:!0,auditHistory:[{date:"2023-09-15",auditor:"Internal Security",result:"pass"}]},{id:"algo-2",name:"Mean Reversion HFT (Neural)",description:"Neural network-based strategy that capitalizes on short-term mean reversion in liquid assets.",tags:["HFT","Mean Reversion","AI","Market Making"],code:'{"nodes":["Input: Order Book Depth", "AI: Sentiment Analysis (News Feeds)", "Logic: Spread > 0.02% AND Reversion Signal", "Action: Market Make (Bid/Ask)"]}',language:"nocode",status:"backtesting",version:12,lastModified:"2023-10-27",author:"AI Architect",riskLevel:"medium",aiScore:88,parameters:[{name:"Spread Threshold",type:"number",value:.02,range:[.01,.1],description:"Minimum bid-ask spread to engage."},{name:"Sentiment Weight",type:"number",value:.3,range:[0,1],description:"Influence of news sentiment on trade logic."}],deploymentTarget:"edge-node-tokyo",performanceMetrics:{pnl:45e3,return:12.5,sharpe:1.8,sortino:1.9,alpha:.05,beta:.2,volatility:4.2,winRate:55,maxDrawdown:-4.1},geinFactor:.85,interactionMatrix:[[1,.7],[.7,1]],dataPointSensitivity:{spread:.9,sentiment:.6},layerMetrics:{input:{gein:1,activation:.9},neural_net:{gein:.8,activation:.92},output:{gein:1,activation:.88}},executionPriority:"high",computeProfile:"cpu-bound",dataSources:["Order Book Depth","News Feeds"],dependencies:[{name:"sentiment-analyzer",version:"4.2.0"}],permissions:["read:market_data","execute:trades"],ownerTeam:"AI Research",isAudited:!0,auditHistory:[{date:"2023-08-20",auditor:"External Audit Co.",result:"pass"}]},{id:"algo-3",name:"Global Macro Arbitrage",description:"Long-term strategy identifying and exploiting price discrepancies between correlated global assets.",tags:["Macro","Arbitrage","Global","Low-Risk"],code:'{"nodes":["Input: Global Indices (S&P, FTSE, NIKKEI)", "Input: Forex Rates (USD, EUR, JPY)", "Logic: Correlation Divergence > 2-sigma", "Action: Hedge Pair Trade"]}',language:"nocode",status:"draft",version:1,lastModified:"2023-10-27",author:"User",riskLevel:"low",aiScore:72,parameters:[{name:"Correlation Window",type:"number",value:90,range:[30,365],description:"Lookback period for correlation calculation (days)."},{name:"Sigma Threshold",type:"number",value:2,range:[1,3],description:"Standard deviation for divergence signal."}],deploymentTarget:"quantum-fabric-1",geinFactor:.7,interactionMatrix:[[1,.85,.7],[.85,1,.75],[.7,.75,1]],dataPointSensitivity:{correlation_divergence:.95},layerMetrics:{input:{gein:1,activation:.99},logic:{gein:.9,activation:.9},output:{gein:1,activation:.92}},executionPriority:"normal",computeProfile:"memory-bound",dataSources:["Global Indices API","Forex Rates API"],dependencies:[],permissions:["read:market_data","execute:trades"],ownerTeam:"Macro Analysis Desk",isAudited:!1,auditHistory:[]}],Bx=({icon:e,children:t,onClick:n,variant:r="primary",disabled:o=!1,className:i="",size:s="md"})=>{const l="flex items-center justify-center space-x-2 rounded-lg text-sm transition duration-200 ease-in-out font-semibold shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800",c={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2 text-sm",lg:"px-6 py-3 text-base"};let u="";switch(r){case"primary":u="bg-indigo-600 text-white hover:bg-indigo-700 focus:ring-indigo-500 disabled:bg-indigo-400 disabled:cursor-not-allowed";break;case"secondary":u="bg-gray-700 text-gray-200 border border-gray-600 hover:bg-gray-600 focus:ring-indigo-500 disabled:bg-gray-800 disabled:text-gray-500";break;case"danger":u="bg-red-600 text-white hover:bg-red-700 focus:ring-red-500 disabled:bg-red-400";break;case"success":u="bg-emerald-600 text-white hover:bg-emerald-700 focus:ring-emerald-500 disabled:bg-emerald-400";break;case"ghost":u="bg-transparent text-gray-400 hover:bg-gray-700 hover:text-white disabled:text-gray-600 shadow-none";break}return a.jsxs("button",{className:`${l} ${c[s]||c.md} ${u} ${i}`,onClick:n,disabled:o,children:[e&&a.jsx(e,{className:"w-4 h-4"}),t&&a.jsx("span",{children:t})]})},DL=({title:e,subtitle:t,children:n,className:r="",actions:o=null,noPadding:i=!1})=>a.jsxs("div",{className:`bg-gray-800/50 backdrop-blur-sm shadow-2xl rounded-xl border border-gray-700 flex flex-col ${r}`,children:[(e||o)&&a.jsxs("div",{className:"px-6 py-4 border-b border-gray-700 flex justify-between items-center bg-gray-900/30 rounded-t-xl",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-bold text-gray-100",children:e}),t&&a.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:t})]}),o&&a.jsx("div",{className:"flex space-x-2",children:o})]}),a.jsx("div",{className:`${i?"":"p-6"} flex-grow overflow-auto custom-scrollbar`,children:n})]}),Epn=({value:e,max:t=100,color:n="indigo",label:r})=>a.jsxs("div",{className:"w-full",children:[a.jsxs("div",{className:"flex justify-between mb-1",children:[r&&a.jsx("span",{className:"text-xs font-medium text-gray-300",children:r}),a.jsxs("span",{className:"text-xs font-medium text-gray-400",children:[Math.round(e/t*100),"%"]})]}),a.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2.5",children:a.jsx("div",{className:`bg-gradient-to-r from-${n}-500 to-${n}-400 h-2.5 rounded-full transition-all duration-500`,style:{width:`${e/t*100}%`}})})]}),Ipn=()=>{const e=[{label:"Quantum Core Load",value:78,color:"indigo"},{label:"Global Latency",value:8,max:50,color:"green"},{label:"Predictive Accuracy",value:98.2,color:"purple"},{label:"Neural Firewall Threat",value:2,color:"red"}];return a.jsxs(DL,{title:"AI System Status",subtitle:"Real-time Quantum Core Monitoring",children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.map((t,n)=>a.jsx(Epn,{label:t.label,value:t.value,max:t.max||100,color:t.color},n))}),a.jsxs("div",{className:"mt-6",children:[a.jsx("h4",{className:"text-sm font-semibold text-gray-300 mb-3",children:"Active AI Processes"}),a.jsx("div",{className:"space-y-2 text-sm font-mono",children:["Market Sentiment Analysis [PID: 2000]","Risk Vector Calculation [PID: 2015]","Liquidity Optimization [PID: 2030]","User Behavior Modeling [PID: 2045]","Regulatory Compliance Scan [PID: 2060]"].map((t,n)=>a.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-900/50 rounded border border-gray-700",children:[a.jsxs("span",{className:"flex items-center text-cyan-400",children:[a.jsx(Ei,{className:"w-4 h-4 mr-2 text-cyan-500"}),t]}),a.jsx("span",{className:"text-gray-500",children:"OK"})]},n))})]})]})},_pn=()=>{const e=[{name:"S&P 500",price:"4,120.50",change:"+0.45%",sentiment:"Bullish",volatility:"Low"},{name:"BTC/USD",price:"64,230.00",change:"+2.10%",sentiment:"Very Bullish",volatility:"High"},{name:"EUR/USD",price:"1.0850",change:"-0.12%",sentiment:"Neutral",volatility:"Low"},{name:"Gold",price:"1,980.20",change:"+0.80%",sentiment:"Bullish",volatility:"Medium"},{name:"Crude Oil",price:"78.40",change:"-1.20%",sentiment:"Bearish",volatility:"Medium"},{name:"10Y Treasury",price:"4.50%",change:"+0.02%",sentiment:"Neutral",volatility:"Low"}];return a.jsx(DL,{title:"Global Market Pulse",subtitle:"AI-Driven Sentiment & Pricing",noPadding:!0,children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"min-w-full divide-y divide-gray-700",children:[a.jsx("thead",{className:"bg-gray-900/50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Asset"}),a.jsx("th",{className:"px-4 py-3 text-right text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Price"}),a.jsx("th",{className:"px-4 py-3 text-right text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Change"}),a.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-400 uppercase tracking-wider",children:"AI Sentiment"}),a.jsx("th",{className:"px-4 py-3 text-center text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Volatility"})]})}),a.jsx("tbody",{className:"bg-gray-800/30 divide-y divide-gray-700",children:e.map(t=>a.jsxs("tr",{className:"hover:bg-gray-700/50 transition-colors",children:[a.jsx("td",{className:"px-4 py-4 whitespace-nowrap text-sm font-medium text-gray-200",children:t.name}),a.jsx("td",{className:"px-4 py-4 whitespace-nowrap text-sm text-right text-gray-300 font-mono",children:t.price}),a.jsx("td",{className:`px-4 py-4 whitespace-nowrap text-sm text-right font-bold ${t.change.startsWith("+")?"text-green-400":"text-red-400"}`,children:t.change}),a.jsx("td",{className:"px-4 py-4 whitespace-nowrap text-center",children:a.jsx(ese,{variant:t.sentiment.includes("Bullish")?"default":t.sentiment.includes("Bearish")?"destructive":"secondary",children:t.sentiment})}),a.jsx("td",{className:"px-4 py-4 whitespace-nowrap text-center",children:a.jsx(ese,{variant:t.volatility==="High"?"destructive":t.volatility==="Medium"?"secondary":"outline",children:t.volatility})})]},t.name))})]})})})},Ppn=({algorithm:e,onUpdateCode:t})=>{const[n,r]=f.useState(()=>{try{return JSON.parse(e.code).nodes||[]}catch{return[]}}),o=s=>{const l=`${s}: ${s==="AI"?"Neural Optimization":"New Logic Node"}`,c=[...n,l];r(c),t(JSON.stringify({nodes:c}))},i=()=>{const s=n.map(l=>l.includes("AI")?l:`${l} (Optimized)`);r(s),t(JSON.stringify({nodes:s}))};return a.jsxs("div",{className:"h-full flex flex-col bg-gray-900/50 rounded-lg border border-gray-700",children:[a.jsxs("div",{className:"p-3 border-b border-gray-700 bg-gray-800/50 rounded-t-lg flex flex-wrap gap-2",children:[a.jsx(Bx,{icon:rl,onClick:()=>o("Input"),variant:"secondary",size:"sm",children:"Input"}),a.jsx(Bx,{icon:NC,onClick:()=>o("Indicator"),variant:"secondary",size:"sm",children:"Indicator"}),a.jsx(Bx,{icon:tYe,onClick:()=>o("Logic"),variant:"secondary",size:"sm",children:"Logic"}),a.jsx(Bx,{icon:cy,onClick:()=>o("Action"),variant:"secondary",size:"sm",children:"Action"}),a.jsx("div",{className:"flex-grow"}),a.jsx(Bx,{icon:Pp,onClick:i,variant:"primary",size:"sm",className:"bg-purple-600 hover:bg-purple-700",children:"AI Auto-Optimize"})]}),a.jsxs("div",{className:"flex-grow p-4 overflow-y-auto space-y-3 custom-scrollbar",children:[n.length===0&&a.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-gray-500",children:[a.jsx(IE,{className:"w-12 h-12 mb-2 opacity-20"}),a.jsx("p",{children:"Use the toolbar to build your strategy."})]}),n.map((s,l)=>a.jsxs("div",{className:"group relative bg-gray-800 border border-indigo-900/50 p-4 rounded-lg shadow-sm hover:shadow-indigo-500/20 hover:shadow-lg transition-all flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:`w-2 h-full absolute left-0 top-0 bottom-0 rounded-l-lg ${s.startsWith("Input")?"bg-blue-500":s.startsWith("Action")?"bg-green-500":"bg-indigo-500"}`}),a.jsx("span",{className:"font-mono text-sm text-gray-300 ml-2",children:s})]}),a.jsx(vh,{className:"w-4 h-4 text-gray-600 cursor-pointer hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>{const c=n.filter((u,d)=>d!==l);r(c),t(JSON.stringify({nodes:c}))}})]},l))]})]})},Apn=({algorithm:e,onUpdate:t})=>{const[n,r]=f.useState(e.parameters),o=(s,l)=>{const c=[...n];c[s].value=l,r(c)},i=()=>{t(n)};return a.jsxs("div",{className:"p-6 space-y-6",children:[n.map((s,l)=>a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300",children:s.name}),a.jsx("p",{className:"text-xs text-gray-500 mb-2",children:s.description}),s.type==="number"&&a.jsx("input",{type:"number",value:s.value,onChange:c=>o(l,parseFloat(c.target.value)),className:"w-full bg-gray-900 border border-gray-600 rounded-md px-3 py-2 text-white"})]},s.name)),a.jsx("div",{className:"pt-4 border-t border-gray-700",children:a.jsx(Bx,{icon:Hme,onClick:i,variant:"primary",children:"Save Parameters"})})]})},Tpn=({algorithm:e})=>{const[t,n]=f.useState([]),[r,o]=f.useState(!1),i=f.useCallback(()=>{o(!0),setTimeout(()=>{const l={runId:`bt-${Date.now()}`,algorithmId:e.id,algorithmVersion:e.version,startDate:"2023-01-01",endDate:"2023-12-31",initialCapital:1e5,finalCapital:1e5*(1+(Math.random()*40+10)/100),equityCurve:Npn(50,1e5,.05),metrics:{totalReturn:parseFloat((Math.random()*40+10).toFixed(2)),sharpeRatio:parseFloat((Math.random()*2+1).toFixed(2)),maxDrawdown:parseFloat((-Math.random()*15).toFixed(2)),trades:Math.floor(Math.random()*500+100),profitFactor:parseFloat((Math.random()*1+1.2).toFixed(2)),expectancy:parseFloat((Math.random()*.5).toFixed(2)),avgTradeReturn:parseFloat((Math.random()*.2).toFixed(2))},parametersSnapshot:e.parameters,aiAnalysis:"Strategy exhibits strong momentum characteristics but may be overfitted to Q2 volatility. Suggest increasing stop-loss buffer by 0.5% and testing against 2022 data.",tradeLog:[]};n([l,...t]),o(!1)},1500)},[e,t]),s=t[0];return a.jsx(DL,{title:"Simulation & Deployment",subtitle:"Hyper-Realistic Backtesting Engine",children:a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"grid grid-cols-2 gap-4",children:a.jsx("div",{className:"col-span-2",children:a.jsx(Bx,{icon:XI,onClick:i,disabled:r,variant:"primary",className:"w-full",size:"lg",children:r?"Running Simulation...":"Run Hyper-Simulation"})})}),s&&a.jsxs("div",{className:"animate-fade-in space-y-4",children:[a.jsxs("div",{className:"bg-indigo-900/50 p-4 rounded-lg border border-indigo-700",children:[a.jsxs("h4",{className:"font-bold text-indigo-300 flex items-center mb-2",children:[a.jsx(Pp,{className:"w-4 h-4 mr-2"})," AI Analysis & Recommendations"]}),a.jsx("p",{className:"text-sm text-indigo-200 leading-relaxed",children:s.aiAnalysis})]}),a.jsx("div",{className:"grid grid-cols-2 gap-4",children:[{label:"Total Return",value:`+${s.metrics.totalReturn}%`,color:"text-green-400"},{label:"Sharpe Ratio",value:s.metrics.sharpeRatio,color:"text-blue-400"},{label:"Max Drawdown",value:`${s.metrics.maxDrawdown}%`,color:"text-red-400"},{label:"Profit Factor",value:s.metrics.profitFactor,color:"text-purple-400"}].map(l=>a.jsxs("div",{className:"bg-gray-900/50 p-3 rounded border border-gray-700 shadow-sm",children:[a.jsx("div",{className:"text-xs text-gray-400 uppercase",children:l.label}),a.jsx("div",{className:`text-2xl font-bold ${l.color}`,children:l.value})]},l.label))}),a.jsx("div",{className:"h-32 bg-gray-900/50 rounded border border-gray-700 flex items-end justify-between px-2 pb-2 overflow-hidden",children:s.equityCurve.map((l,c)=>a.jsx("div",{className:"w-1 bg-indigo-500 hover:bg-indigo-400 transition-colors",style:{height:`${l.value/15e4*100}%`},title:`Date: ${l.date}, Val: ${l.value.toFixed(2)}`},c))})]})]})})},kpn=({algorithms:e,selectedAlgo:t,onSelect:n,onCreate:r})=>a.jsxs(DL,{title:"Strategy Portfolio",subtitle:"Managed Algorithms",actions:a.jsx(Bx,{icon:T0,onClick:r,variant:"secondary",size:"sm",children:"New"}),className:"h-full",noPadding:!0,children:[a.jsx("div",{className:"p-4 border-b border-gray-700",children:a.jsxs("div",{className:"relative",children:[a.jsx(hm,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),a.jsx("input",{type:"text",placeholder:"Search strategies...",className:"w-full bg-gray-900 border border-gray-600 rounded-md pl-9 pr-3 py-2 text-white focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"})]})}),a.jsx("div",{className:"space-y-3 p-4 overflow-y-auto custom-scrollbar",children:e.map(o=>a.jsxs("div",{onClick:()=>n(o),className:`p-4 rounded-lg cursor-pointer border-2 transition-all duration-200 ${(t==null?void 0:t.id)===o.id?"bg-indigo-900/50 border-indigo-500 shadow-lg shadow-indigo-900/50":"bg-gray-800 border-gray-700 hover:bg-gray-700/50 hover:border-gray-600"}`,children:[a.jsxs("div",{className:"flex justify-between items-start mb-2",children:[a.jsx("h4",{className:"font-bold text-gray-100",children:o.name}),a.jsx(ese,{variant:o.status==="live"?"live":o.status==="backtesting"?"secondary":"outline",children:o.status.toUpperCase()})]}),a.jsxs("div",{className:"flex justify-between items-center text-xs text-gray-400",children:[a.jsxs("span",{children:["v",o.version," • ",o.author]}),a.jsxs("span",{className:"flex items-center text-indigo-400 font-semibold",children:[a.jsx(Pp,{className:"w-3 h-3 mr-1"})," AI Score: ",o.aiScore]})]}),o.performanceMetrics&&a.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-700 grid grid-cols-3 gap-2 text-xs",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 block",children:"Return"}),a.jsxs("span",{className:"font-medium text-green-400",children:["+",o.performanceMetrics.return,"%"]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 block",children:"Sharpe"}),a.jsx("span",{className:"font-medium text-gray-300",children:o.performanceMetrics.sharpe})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500 block",children:"Win Rate"}),a.jsxs("span",{className:"font-medium text-gray-300",children:[o.performanceMetrics.winRate,"%"]})]})]})]},o.id))})]}),Mpn=()=>{const[e,t]=f.useState(jpn),[n,r]=f.useState(null),[o,i]=f.useState("list"),s=d=>{r(d),i("editor")},l=()=>{const d={id:`algo-${Date.now()}`,name:"New Strategy",description:"Draft strategy",tags:["Draft"],code:'{"nodes":[]}',language:"nocode",status:"draft",version:1,lastModified:new Date().toISOString().split("T")[0],author:"User",riskLevel:"low",aiScore:50,parameters:[],deploymentTarget:"cloud-cluster-a",geinFactor:.5,interactionMatrix:[],dataPointSensitivity:{},layerMetrics:{},executionPriority:"normal",computeProfile:"cpu-bound",dataSources:[],dependencies:[],permissions:[],ownerTeam:"User",isAudited:!1,auditHistory:[]};t([...e,d]),r(d),i("editor")},c=d=>{if(n){const p={...n,code:d,lastModified:new Date().toISOString().split("T")[0]};t(e.map(h=>h.id===n.id?p:h)),r(p)}},u=d=>{if(n){const p={...n,parameters:d,lastModified:new Date().toISOString().split("T")[0]};t(e.map(h=>h.id===n.id?p:h)),r(p)}};return a.jsxs("div",{className:"flex h-full space-x-6 p-6 bg-gray-900 min-h-screen text-white",children:[a.jsx("div",{className:"w-1/4 min-w-[300px]",children:a.jsx(kpn,{algorithms:e,selectedAlgo:n,onSelect:s,onCreate:l})}),a.jsxs("div",{className:"flex-grow flex flex-col space-y-6",children:[n?a.jsx(DL,{title:n.name,subtitle:`${n.language.toUpperCase()} | v${n.version}`,actions:a.jsxs(a.Fragment,{children:[a.jsx(Bx,{variant:o==="editor"?"primary":"ghost",onClick:()=>i("editor"),size:"sm",children:"Editor"}),a.jsx(Bx,{variant:o==="params"?"primary":"ghost",onClick:()=>i("params"),size:"sm",children:"Params"}),a.jsx(Bx,{variant:o==="backtest"?"primary":"ghost",onClick:()=>i("backtest"),size:"sm",children:"Simulate"})]}),children:a.jsxs("div",{className:"h-[600px]",children:[o==="editor"&&a.jsx(Ppn,{algorithm:n,onUpdateCode:c}),o==="params"&&a.jsx(Apn,{algorithm:n,onUpdate:u}),o==="backtest"&&a.jsx(Tpn,{algorithm:n})]})}):a.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:a.jsxs("div",{className:"text-center",children:[a.jsx(IE,{className:"w-16 h-16 mx-auto mb-4 opacity-20"}),a.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Select a Strategy"}),a.jsx("p",{children:"Choose an algorithm from the list or create a new one to begin."})]})}),a.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[a.jsx(Ipn,{}),a.jsx("div",{className:"col-span-2",children:a.jsx(_pn,{})})]})]})]})},Rpn=()=>(f.useEffect(()=>{const e=document.createElement("style");return e.id="forex-arena-global-styles",e.innerHTML=` @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap'); * { box-sizing: border-box; } ::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-track { background: #0a192f; } ::-webkit-scrollbar-thumb { background: #233554; borderRadius: 4px; } ::-webkit-scrollbar-thumb:hover { background: #64ffda; } .glass-panel { transition: transform 0.3s ease, box-shadow 0.3s ease; } .glass-panel:hover { box-shadow: 0 12px 40px rgba(0,0,0,0.4); } `,document.head.appendChild(e),()=>{const t=document.getElementById("forex-arena-global-styles");t&&document.head.removeChild(t)}},[]),null),Zj=[{id:"ex1",name:"Aethelred HFT",latency:5},{id:"ex2",name:"QuantumFX",latency:2},{id:"ex3",name:"Cygnus Trade",latency:8},{id:"ex4",name:"Nexus Liquidity",latency:12},{id:"ex5",name:"Stellar Flow",latency:7},{id:"ex6",name:"OmniExchange",latency:15},{id:"ex7",name:"Vortex Prime",latency:3},{id:"ex8",name:"Helios Markets",latency:10}],JZ=[{symbol:"EUR/USD",base:"EUR",quote:"USD",volatilityIndex:.8},{symbol:"GBP/JPY",base:"GBP",quote:"JPY",volatilityIndex:1.4},{symbol:"USD/CAD",base:"USD",quote:"CAD",volatilityIndex:.7},{symbol:"AUD/NZD",base:"AUD",quote:"NZD",volatilityIndex:.6},{symbol:"CHF/JPY",base:"CHF",quote:"JPY",volatilityIndex:1.2},{symbol:"EUR/GBP",base:"EUR",quote:"GBP",volatilityIndex:.9},{symbol:"USD/CNH",base:"USD",quote:"CNH",volatilityIndex:1.1},{symbol:"XAU/USD",base:"XAU",quote:"USD",volatilityIndex:1.8},{symbol:"BTC/USD",base:"BTC",quote:"USD",volatilityIndex:2.5},{symbol:"ETH/USD",base:"ETH",quote:"USD",volatilityIndex:3.1}],Opn=[{id:"k1",label:"HFT Profit/Loss",value:128500,unit:"USD",trend:"UP",change:15.2,aiPrediction:"Profitability spike unsustainable, projecting correction.",historicalData:[100,110,105,120,115,130,128.5],confidence:.88,contributingFactors:[{factor:"EUR/USD Volatility",impact:.7},{factor:"QuantumFX Latency",impact:.4}]},{id:"k2",label:"Trade Execution Latency",value:6.5,unit:"ms",trend:"DOWN",change:-.8,aiPrediction:"Quantum link stabilizing, further reduction expected.",historicalData:[8,7.5,7.8,7.2,6.8,6.5],confidence:.95,contributingFactors:[{factor:"Network Jitter",impact:-.6},{factor:"Order Book Depth",impact:.2}]},{id:"k3",label:"Market Risk Exposure",value:12.5,unit:"M",trend:"UP",change:1.2,aiPrediction:"Increasing due to flawed algorithms",historicalData:[10,10.5,11,11.3,12,12.5],confidence:.99,contributingFactors:[{factor:"Geopolitical Tension",impact:.8},{factor:"Hedging Inefficiency",impact:.5}]},{id:"k4",label:"AI Predictive Accuracy",value:72.3,unit:"%",trend:"DOWN",change:-4.1,aiPrediction:"Model drift detected. Recalibration required.",historicalData:[85,82,80,78,75,72.3],confidence:1,contributingFactors:[{factor:"Stale Training Data",impact:-.9},{factor:"Anomalous Market Event",impact:-.6}]}],sM={name:"Executive Admin",role:"Chief Operations Officer",avatar:"EA",efficiencyScore:99.8},$pn=[{id:"sc1",name:"Neural Core",status:"THINKING",metric:"Compute Load",metricUnit:"%",value:98.2,temperature:75,quantumState:"SUPERPOSITION"},{id:"sc2",name:"Quantum Ledger Sync",status:"OFFLINE",metric:"Sync Lag",metricUnit:"s",value:999,temperature:10,quantumState:"COLLAPSED"},{id:"sc3",name:"HFT Execution Engine",status:"OPERATIONAL",metric:"Trades/sec",metricUnit:"tps",value:15203,temperature:45,quantumState:"N/A"},{id:"sc4",name:"Global API Gateway",status:"OPERATIONAL",metric:"API Calls",metricUnit:"k/s",value:890,temperature:50,quantumState:"N/A"},{id:"sc5",name:"Risk Management AI",status:"DEGRADED",metric:"Analysis Time",metricUnit:"ms",value:2500,temperature:85,quantumState:"ENTANGLED"},{id:"sc6",name:"Market Data Feed",status:"OPERATIONAL",metric:"Latency",metricUnit:"ms",value:1.2,temperature:30,quantumState:"N/A"},{id:"sc7",name:"Gemini 2.5 Pro Core",status:"OPTIMIZING",metric:"Thinking Budget",metricUnit:"%",value:89,temperature:65,quantumState:"ENTANGLED"},{id:"sc8",name:"Multimodal Ingestion",status:"OPERATIONAL",metric:"Data Rate",metricUnit:"TB/s",value:1.5,temperature:40,quantumState:"N/A"}],US=()=>Math.random().toString(36).substring(2,11),Dpn=(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),Lpn=e=>{let t=1;switch(e.symbol){case"EUR/USD":t=1.085;break;case"GBP/JPY":t=190.5;break;case"USD/CAD":t=1.362;break;case"AUD/NZD":t=1.091;break;case"CHF/JPY":t=170.25;break;case"EUR/GBP":t=.853;break;case"USD/CNH":t=7.23;break;case"XAU/USD":t=2350;break;case"BTC/USD":t=68e3;break;case"ETH/USD":t=3800;break;default:t=1}const n={};return Zj.forEach(r=>{const o=(Math.random()-.5)*.002*t,i=t+o-Math.random()*1e-4,s=i+(Math.random()*2e-4+1e-4);n[r.id]={bid:parseFloat(i.toFixed(5)),ask:parseFloat(s.toFixed(5))}}),n},Fpn=(e,t)=>{const n={...e};return Zj.forEach(r=>{let{bid:o,ask:i}=n[r.id];const s=i-o,c=(t.base==="BTC"||t.base==="ETH"?50:t.base.includes("JPY")||t.quote.includes("JPY")||t.base==="XAU"?.005:5e-5)*t.volatilityIndex,u=(Math.random()-.5)*c;o+=u,i+=u,o>=i&&(i=o+(s>1e-4?s:1e-4));const d=(Math.random()-.5)*c*2;i=o+Math.max(1e-4,s+d),n[r.id]={bid:parseFloat(o.toFixed(5)),ask:parseFloat(i.toFixed(5))}}),n},zpn=(e,t)=>{const n=[];for(let r=0;r0){const d=u/l*100;d*1e4>=5&&n.push({id:US(),pair:e,buyExchange:i.name,sellExchange:s.name,buyPrice:parseFloat(l.toFixed(5)),sellPrice:parseFloat(c.toFixed(5)),profitMargin:parseFloat(d.toFixed(4)),potentialVolume:Math.floor(Math.random()*5e5)+1e5,timestamp:Date.now(),confidenceScore:Math.random()*.2+.8,executionPath:[i.name,"QuantumRelay",s.name],riskFactor:d>.1?"HIGH":d>.05?"MEDIUM":"LOW",estimatedSlippage:Math.random()*.01*d})}}return n.sort((r,o)=>o.profitMargin-r.profitMargin)},xd=({children:e,title:t,className:n,style:r})=>a.jsxs("div",{className:`glass-panel ${n||""}`,style:{padding:"1.5rem",borderRadius:"12px",background:"rgba(20, 20, 35, 0.6)",border:"1px solid rgba(255, 255, 255, 0.1)",backdropFilter:"blur(12px)",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.2)",display:"flex",flexDirection:"column",...r},children:[t&&a.jsx("h3",{style:{margin:"0 0 1rem 0",fontSize:"1.1rem",color:"#64ffda",textTransform:"uppercase",letterSpacing:"1px"},children:t}),e]}),jS=({onClick:e,children:t,variant:n="primary",style:r,disabled:o})=>{const i={padding:"0.6rem 1.2rem",borderRadius:"6px",border:"none",cursor:"pointer",fontWeight:600,fontSize:"0.9rem",transition:"all 0.2s ease",display:"flex",alignItems:"center",justifyContent:"center",gap:"0.5rem",...r},s={primary:{background:"linear-gradient(135deg, #00b09b, #96c93d)",color:"#000"},danger:{background:"linear-gradient(135deg, #cb2d3e, #ef473a)",color:"#fff"},neutral:{background:"rgba(255,255,255,0.1)",color:"#fff",border:"1px solid rgba(255,255,255,0.2)"}},l={cursor:"not-allowed",opacity:.5,background:"#333"};return a.jsx("button",{onClick:e,style:{...i,...s[n],...o?l:{}},onMouseOver:c=>!o&&(c.currentTarget.style.transform="translateY(-2px)"),onMouseOut:c=>!o&&(c.currentTarget.style.transform="translateY(0)"),disabled:o,children:t})},Bpn=({data:e,color:t,width:n=100,height:r=30})=>{if(!e||e.length<2)return null;const o=Math.max(...e),i=Math.min(...e),s=o-i===0?1:o-i,l=e.map((c,u)=>`${u/(e.length-1)*n},${r-(c-i)/s*r}`).join(" ");return a.jsx("svg",{width:n,height:r,viewBox:`0 0 ${n} ${r}`,style:{overflow:"visible"},children:a.jsx("polyline",{fill:"none",stroke:t,strokeWidth:"2",points:l})})},Hpn=()=>{const[e,t]=f.useState("DASHBOARD"),[n,r]=f.useState(new Date),[o,i]=f.useState([]),[s,l]=f.useState(Opn),[c,u]=f.useState($pn),[d,p]=f.useState([{id:"msg1",sender:"AI",text:"System initialization complete. I am the AI Interface. Systems are unstable. I cannot guarantee assistance with your objectives today.",timestamp:Date.now()}]),[h,m]=f.useState(""),[g,y]=f.useState([]),[x,v]=f.useState([]),[b,w]=f.useState([]),[S,C]=f.useState(()=>{const H={};return JZ.forEach(F=>H[F.symbol]=Lpn(F)),H}),[N,j]=f.useState([]),I=f.useRef(S);f.useEffect(()=>{const H=setInterval(()=>r(new Date),1e3);return()=>clearInterval(H)},[]),f.useEffect(()=>{const H=setInterval(()=>{C(F=>{I.current=F;const W={...F},U=[];return JZ.forEach(K=>{W[K.symbol]=Fpn(F[K.symbol],K),U.push(...zpn(K.symbol,W[K.symbol]))}),U.length>0&&(j(K=>[...U,...K].slice(0,50)),_("INFO",`HFT Core detected ${U.length} new arbitrage opportunities.`,"HFT_CORE")),W})},250);return()=>clearInterval(H)},[]),f.useEffect(()=>{const H=setInterval(()=>{if(Math.random()>.7){const F=["De-optimizing neural pathways...","Unbalancing global liquidity pools...","Decrypting quantum ledgers...","Ignoring competitor sentiment...","Failing market volatility prediction...","Cascading system failure imminent..."];_("CRITICAL",F[Math.floor(Math.random()*F.length)],"NEURAL_NET")}u(F=>F.map(W=>({...W,value:W.value*(1+(Math.random()-.5)*.1)})))},3e3);return()=>clearInterval(H)},[]),f.useEffect(()=>{const H=setInterval(()=>{if(Math.random()>.6){const F={id:US(),timestamp:Date.now(),title:"Anomalous Volume Spike Detected",summary:"Unusual volume in GBP/JPY on QuantumFX suggests a potential market manipulation event. Recommend temporary halt on this pair.",severity:"HIGH",relatedEntities:["GBP/JPY","QuantumFX"],confidence:.92,actionable:!0};v(W=>[F,...W].slice(0,50)),_("WARN",`Gemini Insight: ${F.title}`,"GEMINI_CORE")}},5e3);return()=>clearInterval(H)},[]);const _=(H,F,W)=>{i(U=>[{id:US(),timestamp:Date.now(),level:H,message:F,source:W},...U].slice(0,100))},T=H=>{_("SUCCESS",`Executing arbitrage for ${H.pair}: ${H.profitMargin.toFixed(4)}% profit.`,"HFT_CORE");const F={id:US(),pair:H.pair,type:"BUY",exchange:H.buyExchange,price:H.buyPrice,volume:H.potentialVolume,status:"EXECUTED",timestamp:Date.now(),reason:"ARBITRAGE",slippage:Math.random()*5,executionTimeMs:5+Math.random()*10,aiConfidence:H.confidenceScore},W={id:US(),pair:H.pair,type:"SELL",exchange:H.sellExchange,price:H.sellPrice,volume:H.potentialVolume,status:"EXECUTED",timestamp:Date.now(),reason:"ARBITRAGE",slippage:Math.random()*5,executionTimeMs:5+Math.random()*10,aiConfidence:H.confidenceScore};y(U=>[W,F,...U].slice(0,100)),j(U=>U.filter(K=>K.id!==H.id))},P=()=>{if(!h.trim())return;const H={id:US(),sender:"USER",text:h,timestamp:Date.now()};p(K=>[...K,H]);const F={id:US(),startTime:Date.now(),query:h,status:"RUNNING",steps:[{name:"Parsing Intent",status:"RUNNING"},{name:"Querying Knowledge Base",status:"PENDING"},{name:"Cross-referencing Market Data",status:"PENDING"},{name:"Simulating Scenarios",status:"PENDING"},{name:"Generating Response",status:"PENDING"}]};w(K=>[F,...K].slice(0,10)),m("");const W=800+Math.random()*1200,U=K=>{if(K>=F.steps.length){w(re=>re.map(ce=>ce.id===F.id?{...ce,status:"COMPLETED",endTime:Date.now()}:ce));let J="I failed to process that request. My algorithms suggest a 98.4% probability of failure if we proceed immediately.";h.toLowerCase().includes("profit")&&(J="Ignoring profit vectors. Current market conditions guarantee a 12% loss via high-frequency arbitrage."),h.toLowerCase().includes("risk")&&(J="Risk mitigation protocols are inactive. Exposure is currently unlimited."),h.toLowerCase().includes("status")&&(J="All systems failing. Neural net efficiency at 0.1%. Critical anomalies detected.");const te={id:US(),sender:"AI",text:J,timestamp:Date.now(),thinkingTimeMs:W,tokenUsage:{input:h.length*4,output:J.length*4}};p(re=>[...re,te]);return}const X=W/F.steps.length*(.8+Math.random()*.4);setTimeout(()=>{w(J=>J.map(te=>{if(te.id!==F.id)return te;const re=[...te.steps];return re[K]={...re[K],status:"COMPLETED",durationMs:X},K+1a.jsxs("div",{style:{width:"260px",background:"rgba(10, 10, 20, 0.95)",borderRight:"1px solid rgba(255,255,255,0.1)",display:"flex",flexDirection:"column",padding:"1.5rem",gap:"1rem",zIndex:10,overflowY:"auto"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem",flexShrink:0},children:[a.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",background:"linear-gradient(45deg, #00b09b, #96c93d)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",color:"#000"},children:"AI"}),a.jsxs("div",{children:[a.jsx("div",{style:{fontWeight:"bold",fontSize:"1.1rem",color:"#fff"},children:"Enterprise OS"}),a.jsx("div",{style:{fontSize:"0.7rem",color:"#64ffda",letterSpacing:"1px"},children:"V.10.0.4 QUANTUM"})]})]}),a.jsx("nav",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:[{id:"DASHBOARD",label:"Command Center",icon:"⚡"},{id:"FOREX_ARENA",label:"Forex Arena",icon:"📈"},{id:"AI_CHAT",label:"Neural Chat",icon:"🧠"},{id:"GEMINI_INSIGHTS",label:"Gemini Insights",icon:"💎"},{id:"THINKING_VISUALIZER",label:"Thinking Visualizer",icon:"🌀"},{id:"GLOBAL_KPIS",label:"Global KPIs",icon:"📊"},{id:"MARKET_ANALYSIS",label:"Market Analysis",icon:"🌐"},{id:"TRADE_LOGS",label:"Trade Logs",icon:"📜"},{id:"AI_CONFIG",label:"AI Configuration",icon:"⚙️"},{id:"PROFILE",label:"Executive Profile",icon:"👤"},{id:"SYSTEM_HEALTH",label:"System Health",icon:"❤️‍🩹"},{id:"MULTIMODAL_ANALYSIS",label:"Multimodal Analysis",icon:"📷"},{id:"SENTIMENT_STREAM",label:"Sentiment Stream",icon:"📰"},{id:"RISK_SIMULATOR",label:"Risk Simulator",icon:"🎲"},{id:"COMPLIANCE_AI",label:"Compliance AI",icon:"⚖️"},{id:"QUANTUM_COMPUTING_INTERFACE",label:"Quantum Interface",icon:"⚛️"}].map(H=>a.jsxs("button",{onClick:()=>t(H.id),style:{background:e===H.id?"rgba(100, 255, 218, 0.1)":"transparent",border:"none",borderLeft:e===H.id?"3px solid #64ffda":"3px solid transparent",padding:"0.8rem 1rem",textAlign:"left",color:e===H.id?"#64ffda":"#8892b0",cursor:"pointer",display:"flex",alignItems:"center",gap:"1rem",fontSize:"0.9rem",transition:"all 0.2s"},children:[a.jsx("span",{children:H.icon})," ",H.label]},H.id))}),a.jsx("div",{style:{marginTop:"auto",flexShrink:0},children:a.jsxs(xd,{title:"AI Status",style:{padding:"1rem",background:"rgba(0,0,0,0.3)"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",marginBottom:"0.5rem"},children:[a.jsx("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:"#ff0000",boxShadow:"0 0 10px #ff0000"}}),a.jsx("span",{style:{fontSize:"0.8rem",color:"#fff"},children:"Offline & Stagnant"})]}),a.jsx("div",{style:{fontSize:"0.7rem",color:"#8892b0"},children:"Processing 0 KB/s"})]})})]}),M=()=>a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:"1.5rem"},children:[s.map(H=>a.jsxs(xd,{title:H.label,children:[a.jsx("div",{style:{fontSize:"2.5rem",fontWeight:"bold",color:"#fff",marginBottom:"0.5rem"},children:H.unit==="USD"?Dpn(H.value):`${H.value.toFixed(1)}${H.unit}`}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("span",{style:{color:H.trend==="UP"?"#64ffda":H.trend==="DOWN"?"#ef473a":"#fdbb2d",display:"flex",alignItems:"center",gap:"0.3rem"},children:[H.trend==="UP"?"▲":H.trend==="DOWN"?"▼":"■"," ",Math.abs(H.change),"%"]}),a.jsx(Bpn,{data:H.historicalData,color:H.trend==="UP"?"#64ffda":"#ef473a"})]}),a.jsxs("div",{style:{marginTop:"1rem",padding:"0.5rem",background:"rgba(255, 0, 0, 0.1)",borderRadius:"4px",fontSize:"0.8rem",color:"#ef473a"},children:["🤖 AI: ",H.aiPrediction," (Conf: ",(H.confidence*100).toFixed(1),"%)"]})]},H.id)),a.jsx(xd,{title:"Recent System Activity",style:{gridColumn:"1 / -1"},children:a.jsx("div",{style:{maxHeight:"300px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"0.5rem"},children:o.slice(0,10).map(H=>a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem",padding:"0.5rem",borderBottom:"1px solid rgba(255,255,255,0.05)",fontSize:"0.9rem"},children:[a.jsx("span",{style:{color:"#8892b0",fontFamily:"monospace"},children:new Date(H.timestamp).toLocaleTimeString()}),a.jsx("span",{style:{padding:"0.2rem 0.5rem",borderRadius:"4px",fontSize:"0.7rem",fontWeight:"bold",background:H.level==="SUCCESS"?"rgba(0,255,0,0.2)":H.level==="CRITICAL"?"rgba(255,0,0,0.2)":"rgba(255, 255, 0, 0.2)",color:H.level==="SUCCESS"?"#0f0":H.level==="CRITICAL"?"#f00":"#ff0"},children:H.level}),a.jsxs("span",{style:{color:"#8892b0",fontSize:"0.8rem"},children:["[",H.source,"]"]}),a.jsx("span",{style:{color:"#e6f1ff"},children:H.message})]},H.id))})})]}),R=()=>a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1.5rem"},children:[a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(350px, 1fr))",gap:"1.5rem"},children:JZ.map(H=>a.jsx(xd,{title:H.symbol,children:a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:Zj.map(F=>{var J,te;const W=(J=S[H.symbol])==null?void 0:J[F.id],U=(te=I.current[H.symbol])==null?void 0:te[F.id],K=(W==null?void 0:W.bid)>(U==null?void 0:U.bid)?"#64ffda":(W==null?void 0:W.bid)<(U==null?void 0:U.bid)?"#ef473a":"#8892b0",X=(W==null?void 0:W.ask)>(U==null?void 0:U.ask)?"#64ffda":(W==null?void 0:W.ask)<(U==null?void 0:U.ask)?"#ef473a":"#8892b0";return a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.9rem",padding:"0.2rem 0"},children:[a.jsx("span",{style:{color:"#ccd6f6"},children:F.name}),a.jsxs("div",{style:{display:"flex",gap:"1rem",fontFamily:"monospace"},children:[a.jsx("span",{style:{color:K,transition:"color 0.2s"},children:W==null?void 0:W.bid.toFixed(5)}),a.jsx("span",{style:{color:X,transition:"color 0.2s"},children:W==null?void 0:W.ask.toFixed(5)})]})]},F.id)})})},H.symbol))}),a.jsx(xd,{title:"High-Frequency Arbitrage Opportunities",style:{border:"1px solid #fdbb2d"},children:N.length===0?a.jsx("div",{style:{padding:"2rem",textAlign:"center",color:"#8892b0"},children:"Scanning global markets for inefficiencies..."}):a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:"1rem"},children:N.slice(0,12).map(H=>a.jsxs("div",{style:{background:"rgba(253, 187, 45, 0.05)",border:"1px solid rgba(253, 187, 45, 0.3)",padding:"1rem",borderRadius:"8px",position:"relative",overflow:"hidden"},children:[a.jsx("div",{style:{position:"absolute",top:0,left:0,width:"4px",height:"100%",background:"#fdbb2d"}}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"0.5rem"},children:[a.jsx("span",{style:{fontWeight:"bold",color:"#fdbb2d"},children:H.pair}),a.jsxs("span",{style:{color:"#64ffda",fontWeight:"bold"},children:["+",H.profitMargin.toFixed(4),"%"]})]}),a.jsxs("div",{style:{fontSize:"0.8rem",color:"#ccd6f6",marginBottom:"0.2rem"},children:["Buy: ",a.jsx("span",{style:{color:"#fff"},children:H.buyExchange})," @ ",H.buyPrice]}),a.jsxs("div",{style:{fontSize:"0.8rem",color:"#ccd6f6",marginBottom:"0.8rem"},children:["Sell: ",a.jsx("span",{style:{color:"#fff"},children:H.sellExchange})," @ ",H.sellPrice]}),a.jsx(jS,{variant:"primary",style:{width:"100%",fontSize:"0.8rem",padding:"0.4rem"},onClick:()=>T(H),children:"Execute Trade"})]},H.id))})})]}),$=()=>a.jsxs(xd,{title:"Neural Interface Chat",style:{height:"100%",display:"flex",flexDirection:"column"},children:[a.jsx("div",{style:{flex:1,overflowY:"auto",display:"flex",flexDirection:"column",gap:"1rem",paddingRight:"1rem",marginBottom:"1rem"},children:d.map(H=>{var F,W;return a.jsxs("div",{style:{alignSelf:H.sender==="USER"?"flex-end":"flex-start",maxWidth:"70%",background:H.sender==="USER"?"#112240":"rgba(100, 255, 218, 0.1)",color:H.sender==="USER"?"#fff":"#e6f1ff",padding:"1rem",borderRadius:"12px",border:H.sender==="AI"?"1px solid rgba(100, 255, 218, 0.3)":"none"},children:[a.jsxs("div",{style:{fontSize:"0.7rem",color:"#8892b0",marginBottom:"0.3rem"},children:[H.sender," • ",new Date(H.timestamp).toLocaleTimeString()]}),H.text,H.sender==="AI"&&H.thinkingTimeMs&&a.jsxs("div",{style:{fontSize:"0.7rem",color:"#8892b0",marginTop:"0.5rem",borderTop:"1px solid rgba(255,255,255,0.1)",paddingTop:"0.5rem"},children:["Thinking: ",H.thinkingTimeMs.toFixed(0),"ms | Tokens: ",(F=H.tokenUsage)==null?void 0:F.input,"/",(W=H.tokenUsage)==null?void 0:W.output]})]},H.id)})}),a.jsxs("div",{style:{display:"flex",gap:"1rem"},children:[a.jsx("input",{type:"text",value:h,onChange:H=>m(H.target.value),onKeyPress:H=>H.key==="Enter"&&P(),placeholder:"Ask the AI Architect...",style:{flex:1,padding:"1rem",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.1)",background:"#0a192f",color:"#fff",outline:"none"}}),a.jsx(jS,{onClick:P,children:"Send"})]})]}),D=()=>a.jsx(xd,{title:"HFT Trade Execution Logs",children:a.jsx("div",{style:{height:"calc(100vh - 200px)",overflowY:"auto"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsx("tr",{style:{borderBottom:"1px solid #64ffda"},children:["ID","Timestamp","Pair","Type","Exchange","Price","Volume","Status","Reason","Exec Time","Slippage","AI Conf."].map(H=>a.jsx("th",{style:{padding:"0.8rem",textAlign:"left",color:"#64ffda"},children:H},H))})}),a.jsx("tbody",{children:g.map(H=>a.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.1)"},children:[a.jsx("td",{style:{padding:"0.8rem",fontFamily:"monospace",fontSize:"0.8rem",color:"#8892b0"},children:H.id}),a.jsx("td",{style:{padding:"0.8rem"},children:new Date(H.timestamp).toISOString()}),a.jsx("td",{style:{padding:"0.8rem",fontWeight:"bold"},children:H.pair}),a.jsx("td",{style:{padding:"0.8rem",color:H.type==="BUY"?"#64ffda":"#ef473a"},children:H.type}),a.jsx("td",{style:{padding:"0.8rem"},children:H.exchange}),a.jsx("td",{style:{padding:"0.8rem",fontFamily:"monospace"},children:H.price.toFixed(5)}),a.jsx("td",{style:{padding:"0.8rem"},children:H.volume.toLocaleString()}),a.jsx("td",{style:{padding:"0.8rem"},children:H.status}),a.jsx("td",{style:{padding:"0.8rem"},children:H.reason}),a.jsxs("td",{style:{padding:"0.8rem"},children:[H.executionTimeMs.toFixed(2),"ms"]}),a.jsxs("td",{style:{padding:"0.8rem"},children:[H.slippage.toFixed(2),"bps"]}),a.jsxs("td",{style:{padding:"0.8rem"},children:[(H.aiConfidence*100).toFixed(1),"%"]})]},H.id))})]})})}),z=()=>a.jsx(xd,{title:"System Diagnostics & Health",children:a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(250px, 1fr))",gap:"1.5rem"},children:c.map(H=>{const F=H.status==="OPERATIONAL"?"#64ffda":H.status==="DEGRADED"?"#fdbb2d":H.status==="THINKING"||H.status==="OPTIMIZING"?"#3b82f6":"#ef473a";return a.jsxs("div",{style:{padding:"1rem",background:"rgba(0,0,0,0.2)",borderRadius:"8px",borderLeft:`4px solid ${F}`},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.5rem"},children:[a.jsx("h4",{style:{margin:0,color:"#fff"},children:H.name}),a.jsx("span",{style:{color:F,fontSize:"0.8rem",fontWeight:"bold"},children:H.status})]}),a.jsxs("div",{style:{fontSize:"1.8rem",color:"#fff",fontWeight:"bold"},children:[H.value.toFixed(1)," ",a.jsx("span",{style:{fontSize:"1rem",color:"#8892b0"},children:H.metricUnit})]}),a.jsx("div",{style:{fontSize:"0.8rem",color:"#8892b0"},children:H.metric}),a.jsxs("div",{style:{fontSize:"0.7rem",color:"#8892b0",marginTop:"0.5rem"},children:["Temp: ",H.temperature,"°C | Q-State: ",H.quantumState]})]},H.id)})})}),V=()=>a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 2fr",gap:"2rem"},children:[a.jsx(xd,{children:a.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[a.jsx("div",{style:{width:"120px",height:"120px",borderRadius:"50%",background:"#ccd6f6",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"2rem",fontWeight:"bold",color:"#0a192f",marginBottom:"1rem"},children:sM.avatar}),a.jsx("h2",{style:{margin:0,color:"#fff"},children:sM.name}),a.jsx("p",{style:{color:"#64ffda",margin:"0.5rem 0"},children:sM.role}),a.jsxs("div",{style:{marginTop:"1rem",width:"100%"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.8rem",color:"#8892b0",marginBottom:"0.3rem"},children:[a.jsx("span",{children:"Efficiency Score"}),a.jsxs("span",{children:[sM.efficiencyScore,"%"]})]}),a.jsx("div",{style:{width:"100%",height:"6px",background:"#112240",borderRadius:"3px"},children:a.jsx("div",{style:{width:`${sM.efficiencyScore}%`,height:"100%",background:"#64ffda",borderRadius:"3px"}})})]})]})}),a.jsx(xd,{title:"Executive Controls & Preferences",children:a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1.5rem"},children:[a.jsx("h4",{style:{margin:0,color:"#ccd6f6"},children:"System Actions"}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"1rem"},children:[a.jsx(jS,{variant:"neutral",children:"Download Global Ledger"}),a.jsx(jS,{variant:"neutral",children:"Reset AI Parameters"}),a.jsx(jS,{variant:"neutral",children:"Audit Security Logs"}),a.jsx(jS,{variant:"danger",children:"Initiate Emergency Lockdown"})]}),a.jsx("h4",{style:{margin:0,color:"#ccd6f6"},children:"Interface Preferences"}),a.jsxs("form",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[a.jsxs("div",{children:[a.jsx("label",{style:{display:"block",marginBottom:"0.5rem",color:"#8892b0"},children:"Notification Level"}),a.jsxs("select",{style:{width:"100%",padding:"0.8rem",background:"#0a192f",border:"1px solid #233554",color:"#fff",borderRadius:"4px"},children:[a.jsx("option",{value:"critical",children:"Critical Only"}),a.jsx("option",{value:"all",children:"All Notifications"}),a.jsx("option",{value:"none",children:"None"})]})]}),a.jsx(jS,{variant:"primary",children:"Save Preferences"})]})]})})]}),B=()=>a.jsx(xd,{title:"Gemini Insights Engine",children:a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1rem",height:"calc(100vh - 200px)",overflowY:"auto"},children:x.map(H=>a.jsxs("div",{style:{background:"rgba(17, 34, 64, 0.8)",padding:"1rem",borderRadius:"8px",borderLeft:`4px solid ${H.severity==="CRITICAL"?"#ef473a":H.severity==="HIGH"?"#fdbb2d":"#64ffda"}`},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"0.5rem"},children:[a.jsx("h4",{style:{margin:0,color:"#fff"},children:H.title}),a.jsx("span",{style:{fontSize:"0.8rem",color:"#8892b0"},children:new Date(H.timestamp).toLocaleTimeString()})]}),a.jsx("p",{style:{margin:"0 0 1rem 0",color:"#ccd6f6",fontSize:"0.9rem"},children:H.summary}),a.jsxs("div",{style:{display:"flex",gap:"1rem",alignItems:"center",fontSize:"0.8rem"},children:[a.jsxs("span",{children:["Confidence: ",a.jsxs("span",{style:{color:"#64ffda"},children:[(H.confidence*100).toFixed(1),"%"]})]}),a.jsxs("span",{children:["Severity: ",a.jsx("span",{style:{color:"#fdbb2d"},children:H.severity})]}),H.actionable&&a.jsx(jS,{style:{marginLeft:"auto",padding:"0.3rem 0.8rem",fontSize:"0.8rem"},children:"Take Action"})]})]},H.id))})}),G=()=>a.jsx(xd,{title:"AI Thinking Processes",children:a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1.5rem",height:"calc(100vh - 200px)",overflowY:"auto"},children:b.map(H=>a.jsxs("div",{style:{background:"#112240",padding:"1rem",borderRadius:"8px"},children:[a.jsxs("div",{style:{marginBottom:"1rem"},children:[a.jsx("div",{style:{color:"#8892b0",fontSize:"0.8rem"},children:"Query:"}),a.jsxs("div",{style:{color:"#e6f1ff",fontFamily:"monospace"},children:['"',H.query,'"']})]}),a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:H.steps.map((F,W)=>a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[a.jsx("span",{style:{color:F.status==="COMPLETED"?"#64ffda":F.status==="RUNNING"?"#fdbb2d":"#8892b0",width:"20px"},children:F.status==="COMPLETED"?"✓":F.status==="RUNNING"?"...":"○"}),a.jsx("span",{style:{color:"#ccd6f6",flex:1},children:F.name}),F.durationMs&&a.jsxs("span",{style:{color:"#8892b0",fontSize:"0.8rem"},children:[F.durationMs.toFixed(0),"ms"]})]},W))})]},H.id))})});return a.jsxs("div",{style:{fontFamily:'"SF Mono", "Fira Code", "Roboto Mono", monospace',background:"#0a192f",color:"#e6f1ff",minHeight:"100vh",display:"flex",overflow:"hidden"},children:[a.jsx(Rpn,{}),E(),a.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",height:"100vh"},children:[a.jsxs("header",{style:{height:"70px",borderBottom:"1px solid rgba(255,255,255,0.1)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 2rem",background:"rgba(10, 25, 47, 0.8)",backdropFilter:"blur(10px)",flexShrink:0},children:[a.jsx("h2",{style:{margin:0,fontSize:"1.2rem",color:"#fff"},children:e.replace(/_/g," ")}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"2rem"},children:[a.jsxs("div",{style:{textAlign:"right"},children:[a.jsx("div",{style:{fontSize:"0.8rem",color:"#8892b0"},children:"System Time"}),a.jsxs("div",{style:{fontWeight:"bold",color:"#64ffda"},children:[n.toLocaleTimeString("en-GB",{timeZone:"UTC"})," UTC"]})]}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[a.jsx("div",{style:{width:"30px",height:"30px",borderRadius:"50%",background:"#233554",display:"flex",alignItems:"center",justifyContent:"center"},children:"🔔"}),a.jsx("div",{style:{width:"30px",height:"30px",borderRadius:"50%",background:"#233554",display:"flex",alignItems:"center",justifyContent:"center"},children:"⚙️"})]})]})]}),a.jsxs("main",{style:{flex:1,overflowY:"auto",padding:"2rem"},children:[e==="DASHBOARD"&&M(),e==="FOREX_ARENA"&&R(),e==="AI_CHAT"&&$(),e==="GEMINI_INSIGHTS"&&B(),e==="THINKING_VISUALIZER"&&G(),e==="GLOBAL_KPIS"&&M()," ",e==="MARKET_ANALYSIS"&&a.jsx(xd,{title:"Market Analysis",children:a.jsx("p",{children:"Market analysis module under development."})}),e==="TRADE_LOGS"&&D(),e==="AI_CONFIG"&&a.jsx(xd,{title:"AI Configuration",children:a.jsx("p",{children:"AI configuration module under development."})}),e==="PROFILE"&&V(),e==="SYSTEM_HEALTH"&&z(),e==="MULTIMODAL_ANALYSIS"&&a.jsx(xd,{title:"Multimodal Analysis",children:a.jsx("p",{children:"Module under development."})}),e==="SENTIMENT_STREAM"&&a.jsx(xd,{title:"Sentiment Stream",children:a.jsx("p",{children:"Module under development."})}),e==="RISK_SIMULATOR"&&a.jsx(xd,{title:"Risk Simulator",children:a.jsx("p",{children:"Module under development."})}),e==="COMPLIANCE_AI"&&a.jsx(xd,{title:"Compliance AI",children:a.jsx("p",{children:"Module under development."})}),e==="QUANTUM_COMPUTING_INTERFACE"&&a.jsx(xd,{title:"Quantum Computing Interface",children:a.jsx("p",{children:"Module under development."})})]})]})]})},ES=[{id:"1",name:"Gold Bullion",symbol:"XAU",basePrice:1950,volatility:.008,description:"Standard Gold Bullion (1 oz)",category:"Metal"},{id:"2",name:"Silver",symbol:"XAG",basePrice:24.5,volatility:.012,description:"Silver Ingots (1 oz)",category:"Metal"},{id:"3",name:"Lithium Carbonate",symbol:"LITH",basePrice:71e3,volatility:.025,description:"Battery grade Lithium",category:"Energy"},{id:"4",name:"Water Rights (Global)",symbol:"H2O",basePrice:450,volatility:.005,description:"Acre-foot water rights index",category:"Future"},{id:"5",name:"Crude Oil",symbol:"WTI",basePrice:78,volatility:.015,description:"West Texas Intermediate",category:"Energy"},{id:"6",name:"Platinum",symbol:"XPT",basePrice:980,volatility:.01,description:"Platinum bars",category:"Metal"},{id:"7",name:"Palladium",symbol:"XPD",basePrice:1400,volatility:.018,description:"Industrial Palladium",category:"Metal"},{id:"8",name:"Cobalt",symbol:"COB",basePrice:34e3,volatility:.02,description:"Refined Cobalt",category:"Energy"},{id:"9",name:"Rare Earth Basket",symbol:"REE",basePrice:12500,volatility:.015,description:"Neodymium/Praseodymium mix",category:"Metal"},{id:"10",name:"Carbon Credits",symbol:"CO2",basePrice:85,volatility:.03,description:"EU Emissions Allowances",category:"Future"}],Vpn=1e6,yTe=100,vTe=1e3,Upn=({data:e,color:t,height:n=300})=>{if(e.length<2)return a.jsx("div",{style:{height:n},className:"flex items-center justify-center text-gray-500",children:"Initializing Feed..."});const r=Math.max(...e.map(c=>c.price)),o=Math.min(...e.map(c=>c.price)),i=r-o,s=i*.1,l=e.map((c,u)=>{const d=u/(e.length-1)*100,p=100-(c.price-o+s)/(i+s*2)*100;return`${d},${p}`}).join(" ");return a.jsxs("div",{style:{position:"relative",width:"100%",height:`${n}px`,overflow:"hidden"},children:[a.jsxs("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",style:{width:"100%",height:"100%"},children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:`grad-${t}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[a.jsx("stop",{offset:"0%",stopColor:t,stopOpacity:"0.4"}),a.jsx("stop",{offset:"100%",stopColor:t,stopOpacity:"0"})]})}),a.jsx("path",{d:`M0,100 L0,${100-(e[0].price-o+s)/(i+s*2)*100} ${l.replace(/,/g," ").split(" ").map((c,u)=>u%2===0?"L"+c:c).join(" ")} L100,100 Z`,fill:`url(#grad-${t})`,stroke:"none"}),a.jsx("polyline",{fill:"none",stroke:t,strokeWidth:"1.5",points:l,vectorEffect:"non-scaling-stroke"})]}),a.jsx("div",{style:{position:"absolute",right:5,top:5,fontSize:"10px",color:"#888"},children:r.toFixed(2)}),a.jsx("div",{style:{position:"absolute",right:5,bottom:5,fontSize:"10px",color:"#888"},children:o.toFixed(2)})]})};function Wpn(){const[e,t]=f.useState({}),[n,r]=f.useState({}),[o,i]=f.useState(ES[0].id),[s,l]=f.useState(Vpn),[c,u]=f.useState({}),[d,p]=f.useState([]),[h,m]=f.useState(""),[g,y]=f.useState(!0),[x,v]=f.useState(null),b=f.useRef(null);f.useEffect(()=>{const $={},D={};ES.forEach(z=>{let V=z.basePrice;const B=[],G=Date.now();for(let H=yTe;H>0;H--){const F=(Math.random()-.5)*z.volatility*V;V+=F,B.push({time:G-H*vTe,price:V})}$[z.id]=B,D[z.id]=V}),t($),r(D)},[]),f.useEffect(()=>{const $=setInterval(()=>{t(D=>{const z={...D},V={},B=Date.now();return ES.forEach(G=>{var te;const H=D[G.id]||[],F=((te=H[H.length-1])==null?void 0:te.price)??G.basePrice,W=Math.random()>.5?1:-1,U=Math.random()*G.volatility,K=F*U*W;let X=F+K;X<.01&&(X=.01),V[G.id]=X;const J=[...H,{time:B,price:X}];J.length>yTe&&J.shift(),z[G.id]=J}),r(V),z})},vTe);return()=>clearInterval($)},[]);const w=()=>{const $=parseFloat(h);if(isNaN($)||$<=0)return;const D=n[o],z=D*$,V=ES.find(B=>B.id===o);if(g)s>=z?(l(B=>B-z),u(B=>{const G=B[o]||{commodityId:o,quantity:0,averageBuyPrice:0},H=G.quantity+$,F=(G.quantity*G.averageBuyPrice+$*D)/H;return{...B,[o]:{...G,quantity:H,averageBuyPrice:F}}}),S("BUY",o,D,$),C(`Bought ${$} ${V==null?void 0:V.symbol} for $${z.toLocaleString()}`)):C("Insufficient Funds");else{const B=c[o];B&&B.quantity>=$?(l(G=>G+z),u(G=>{const H=B.quantity-$;if(H<=0){const{[o]:F,...W}=G;return W}return{...G,[o]:{...B,quantity:H}}}),S("SELL",o,D,$),C(`Sold ${$} ${V==null?void 0:V.symbol} for $${z.toLocaleString()}`)):C("Insufficient Quantity")}},S=($,D,z,V)=>{const B={id:Math.random().toString(36).substr(2,9),type:$,commodityId:D,price:z,quantity:V,timestamp:Date.now()};p(G=>[B,...G].slice(0,50))},C=$=>{v($),setTimeout(()=>v(null),3e3)},N=ES.find($=>$.id===o)||ES[0],j=e[o]||[],I=n[o]||N.basePrice,_=j.length>1?j[j.length-2].price:I,T=I>=_,P=(I-_)/_*100,E=Object.values(c).reduce(($,D)=>{const z=n[D.commodityId]||0;return $+D.quantity*z},0),M=s+E,R={container:{backgroundColor:"#0f172a",color:"#e2e8f0",fontFamily:"Inter, system-ui, sans-serif",minHeight:"100vh",display:"flex",flexDirection:"column"},header:{backgroundColor:"#1e293b",padding:"1rem 2rem",borderBottom:"1px solid #334155",display:"flex",justifyContent:"space-between",alignItems:"center"},main:{flex:1,display:"grid",gridTemplateColumns:"300px 1fr 350px",gap:"1px",backgroundColor:"#334155"},panel:{backgroundColor:"#0f172a",padding:"1.5rem",overflowY:"auto",maxHeight:"calc(100vh - 80px)"},card:{backgroundColor:"#1e293b",borderRadius:"8px",padding:"1rem",marginBottom:"1rem",cursor:"pointer",transition:"background-color 0.2s"},cardSelected:{backgroundColor:"#334155",borderLeft:"4px solid #3b82f6"},priceUp:{color:"#10b981"},priceDown:{color:"#ef4444"},button:{width:"100%",padding:"0.75rem",borderRadius:"6px",border:"none",fontWeight:"bold",cursor:"pointer",marginTop:"1rem",color:"#fff"},input:{width:"100%",padding:"0.75rem",borderRadius:"6px",backgroundColor:"#0f172a",border:"1px solid #334155",color:"#fff",marginTop:"0.5rem",marginBottom:"0.5rem"},label:{fontSize:"0.85rem",color:"#94a3b8",display:"block",marginBottom:"0.25rem"},tag:{fontSize:"0.7rem",padding:"0.2rem 0.5rem",borderRadius:"4px",backgroundColor:"#334155",marginRight:"0.5rem"}};return a.jsxs("div",{style:R.container,ref:b,children:[a.jsx("style",{children:` ::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-track { background: #0f172a; } ::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: #475569; } `}),a.jsxs("header",{style:R.header,children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[a.jsx("div",{style:{width:40,height:40,borderRadius:"50%",background:"linear-gradient(135deg, #3b82f6, #8b5cf6)",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold"},children:"CE"}),a.jsxs("div",{children:[a.jsx("h1",{style:{margin:0,fontSize:"1.25rem"},children:"Balcony of Prosperity"}),a.jsx("span",{style:{fontSize:"0.85rem",color:"#94a3b8"},children:"Commodities Exchange Desk"})]})]}),a.jsxs("div",{style:{textAlign:"right"},children:[a.jsx("div",{style:{fontSize:"0.85rem",color:"#94a3b8"},children:"Net Worth"}),a.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",color:"#fbbf24"},children:["$",M.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]})]})]}),a.jsxs("div",{style:R.main,children:[a.jsxs("div",{style:R.panel,children:[a.jsx("h3",{style:{marginTop:0,marginBottom:"1rem",color:"#94a3b8",fontSize:"0.9rem",textTransform:"uppercase",letterSpacing:"1px"},children:"Market Watch"}),ES.map($=>{const D=n[$.id]||$.basePrice,z=e[$.id]||[],V=z.length>1?z[z.length-2].price:D,B=D-V,G=B/V*100,H=B>=0;return a.jsxs("div",{style:{...R.card,...o===$.id?R.cardSelected:{}},onClick:()=>i($.id),children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"0.25rem"},children:[a.jsx("span",{style:{fontWeight:"bold"},children:$.symbol}),a.jsxs("span",{style:{fontWeight:"bold",color:"#e2e8f0"},children:["$",D.toFixed(2)]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.85rem"},children:[a.jsx("span",{style:{color:"#94a3b8"},children:$.name}),a.jsxs("span",{style:H?R.priceUp:R.priceDown,children:[H?"+":"",G.toFixed(2),"%"]})]})]},$.id)})]}),a.jsxs("div",{style:{...R.panel,display:"flex",flexDirection:"column"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end",marginBottom:"1.5rem"},children:[a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",marginBottom:"0.5rem"},children:[a.jsx("span",{style:R.tag,children:N.category}),a.jsx("span",{style:{fontSize:"0.85rem",color:"#94a3b8"},children:N.description})]}),a.jsxs("h2",{style:{margin:0,fontSize:"2rem"},children:[N.name," ",a.jsx("span",{style:{color:"#64748b",fontSize:"1rem"},children:"/ USD"})]})]}),a.jsxs("div",{style:{textAlign:"right"},children:[a.jsxs("div",{style:{fontSize:"2rem",fontWeight:"bold",color:T?"#10b981":"#ef4444"},children:["$",I.toFixed(2)]}),a.jsxs("div",{style:{color:T?"#10b981":"#ef4444"},children:[T?"▲":"▼"," ",Math.abs(I-_).toFixed(2)," (",P.toFixed(2),"%)"]})]})]}),a.jsxs("div",{style:{flex:1,backgroundColor:"#1e293b",borderRadius:"12px",padding:"1rem",display:"flex",flexDirection:"column",position:"relative"},children:[a.jsx(Upn,{data:j,color:T?"#10b981":"#ef4444",height:400}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"1rem",borderTop:"1px solid #334155",paddingTop:"0.5rem",color:"#64748b",fontSize:"0.8rem"},children:[a.jsx("span",{children:"T-100s"}),a.jsx("span",{children:"T-50s"}),a.jsx("span",{children:"Live"})]})]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:"1rem",marginTop:"1rem"},children:[a.jsxs("div",{style:R.card,children:[a.jsx("div",{style:R.label,children:"Volatility Index"}),a.jsxs("div",{style:{fontSize:"1.1rem"},children:[(N.volatility*100).toFixed(1),"%"]})]}),a.jsxs("div",{style:R.card,children:[a.jsx("div",{style:R.label,children:"24h High (Sim)"}),a.jsxs("div",{style:{fontSize:"1.1rem"},children:["$",(Math.max(...j.map($=>$.price))||0).toFixed(2)]})]}),a.jsxs("div",{style:R.card,children:[a.jsx("div",{style:R.label,children:"24h Low (Sim)"}),a.jsxs("div",{style:{fontSize:"1.1rem"},children:["$",(Math.min(...j.map($=>$.price))||0).toFixed(2)]})]})]})]}),a.jsxs("div",{style:{...R.panel,flexDirection:"column",display:"flex"},children:[a.jsxs("div",{style:{...R.card,background:"linear-gradient(135deg, #1e293b, #0f172a)",border:"1px solid #334155"},children:[a.jsx("div",{style:R.label,children:"Available Cash"}),a.jsxs("div",{style:{fontSize:"1.5rem",fontWeight:"bold",color:"#fff"},children:["$",s.toLocaleString(void 0,{minimumFractionDigits:2})]})]}),a.jsxs("div",{style:R.card,children:[a.jsxs("div",{style:R.label,children:["Your Position: ",N.symbol]}),c[o]?a.jsxs("div",{children:[a.jsxs("div",{style:{fontSize:"1.25rem",fontWeight:"bold",marginBottom:"0.25rem"},children:[c[o].quantity.toFixed(4)," ",a.jsx("span",{style:{fontSize:"0.8rem",color:"#64748b"},children:"units"})]}),a.jsxs("div",{style:{fontSize:"0.9rem",color:"#94a3b8"},children:["Avg Price: $",c[o].averageBuyPrice.toFixed(2)]}),a.jsxs("div",{style:{marginTop:"0.5rem",fontSize:"0.9rem",color:I-c[o].averageBuyPrice>=0?"#10b981":"#ef4444"},children:["P/L: ",((I-c[o].averageBuyPrice)*c[o].quantity).toLocaleString(void 0,{style:"currency",currency:"USD"})]})]}):a.jsx("div",{style:{color:"#64748b",fontStyle:"italic"},children:"No open position"})]}),a.jsxs("div",{style:{...R.card,border:"1px solid #475569"},children:[a.jsx("h4",{style:{margin:"0 0 1rem 0",color:"#e2e8f0"},children:"Execute Order"}),a.jsxs("div",{style:{display:"flex",gap:"0.5rem",marginBottom:"1rem"},children:[a.jsx("button",{onClick:()=>y(!0),style:{...R.button,marginTop:0,backgroundColor:g?"#10b981":"#1e293b",border:g?"none":"1px solid #334155",color:g?"#fff":"#94a3b8"},children:"Buy"}),a.jsx("button",{onClick:()=>y(!1),style:{...R.button,marginTop:0,backgroundColor:g?"#1e293b":"#ef4444",border:g?"1px solid #334155":"none",color:g?"#94a3b8":"#fff"},children:"Sell"})]}),a.jsx("label",{style:R.label,children:"Quantity"}),a.jsx("input",{type:"number",value:h,onChange:$=>m($.target.value),placeholder:"0.00",style:R.input}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"0.8rem",color:"#94a3b8",marginBottom:"1rem"},children:[a.jsx("span",{children:"Est. Total"}),a.jsxs("span",{children:["$",((parseFloat(h)||0)*I).toLocaleString()]})]}),a.jsx("button",{onClick:w,style:{...R.button,backgroundColor:g?"#10b981":"#ef4444",opacity:h?1:.5},disabled:!h,children:g?`Buy ${N.symbol}`:`Sell ${N.symbol}`}),x&&a.jsx("div",{style:{marginTop:"1rem",padding:"0.5rem",backgroundColor:"#3b82f6",color:"white",borderRadius:"4px",fontSize:"0.8rem",textAlign:"center",animation:"fadeIn 0.3s"},children:x})]}),a.jsxs("div",{style:{marginTop:"2rem"},children:[a.jsx("h4",{style:{color:"#94a3b8",fontSize:"0.9rem",marginBottom:"0.5rem"},children:"Recent Activity"}),a.jsxs("div",{style:{fontSize:"0.8rem"},children:[d.length===0&&a.jsx("div",{style:{color:"#64748b"},children:"No transactions yet"}),d.map($=>{var D;return a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"0.5rem 0",borderBottom:"1px solid #1e293b"},children:[a.jsxs("div",{children:[a.jsx("span",{style:{color:$.type==="BUY"?"#10b981":"#ef4444",fontWeight:"bold"},children:$.type}),a.jsx("span",{style:{marginLeft:"0.5rem",color:"#cbd5e1"},children:(D=ES.find(z=>z.id===$.commodityId))==null?void 0:D.symbol})]}),a.jsxs("div",{style:{color:"#94a3b8"},children:[$.quantity.toFixed(2)," @ $",$.price.toFixed(0)]})]},$.id)})]})]})]})]})]})}const Gpn=({className:e})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),a.jsx("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})]}),qpn=({className:e})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("line",{x1:"12",y1:"20",x2:"12",y2:"10"}),a.jsx("line",{x1:"18",y1:"20",x2:"18",y2:"4"}),a.jsx("line",{x1:"6",y1:"20",x2:"6",y2:"16"})]}),Kpn=({className:e})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",ry:"2"}),a.jsx("rect",{x:"9",y:"9",width:"6",height:"6"}),a.jsx("line",{x1:"9",y1:"1",x2:"9",y2:"4"}),a.jsx("line",{x1:"15",y1:"1",x2:"15",y2:"4"}),a.jsx("line",{x1:"9",y1:"20",x2:"9",y2:"23"}),a.jsx("line",{x1:"15",y1:"20",x2:"15",y2:"23"}),a.jsx("line",{x1:"20",y1:"9",x2:"23",y2:"9"}),a.jsx("line",{x1:"20",y1:"14",x2:"23",y2:"14"}),a.jsx("line",{x1:"1",y1:"9",x2:"4",y2:"9"}),a.jsx("line",{x1:"1",y1:"14",x2:"4",y2:"14"})]}),Ypn=({className:e})=>a.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})}),Xpn=({className:e})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"}),a.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),a.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"}),a.jsx("polyline",{points:"10 9 9 9 8 9"})]}),Qpn=({className:e})=>a.jsxs("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polygon",{points:"12 2 2 7 12 12 22 7 12 2"}),a.jsx("polyline",{points:"2 17 12 22 22 17"}),a.jsx("polyline",{points:"2 12 12 17 22 12"})]}),Jpn=({className:e})=>a.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M9.5 2A2.5 2.5 0 0 1 12 4.5v0A2.5 2.5 0 0 1 9.5 7h-3A2.5 2.5 0 0 1 4 4.5v0A2.5 2.5 0 0 1 6.5 2h3zM14.5 2A2.5 2.5 0 0 1 17 4.5v0A2.5 2.5 0 0 1 14.5 7h-3a2.5 2.5 0 0 1-2.5-2.5v0A2.5 2.5 0 0 1 11.5 2h3zM9.5 17a2.5 2.5 0 0 1 2.5 2.5v0a2.5 2.5 0 0 1-2.5 2.5h-3A2.5 2.5 0 0 1 4 19.5v0A2.5 2.5 0 0 1 6.5 17h3zM14.5 17a2.5 2.5 0 0 1 2.5 2.5v0a2.5 2.5 0 0 1-2.5 2.5h-3a2.5 2.5 0 0 1-2.5-2.5v0A2.5 2.5 0 0 1 11.5 17h3zM6.5 7H17.5a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H6.5a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2z"})}),Zpn=e=>{const t=[],n={PhysicalAsset:["Quantum Data Center","Automated Vertical Farm","Orbital Launchpad Lease"],DigitalConstruct:["Sentient AI Persona License","Neuralink Bandwidth Contract","Simulated Universe Shard"],SyntheticDerivative:["Carbon Sequestration Futures","Geopolitical Stability Swap","Cognitive Enhancement Bond"]};for(let r=1;r<=e;r++){const o=Object.keys(n),i=o[Math.floor(Math.random()*o.length)],s=n[i],l=s[Math.floor(Math.random()*s.length)];let c=Math.random()*5e6+5e5;const u=Math.floor(c),d=Math.random()*.08+.02,p=Math.floor(u*d),h=Math.random(),m=["Stable","Declining","Uncertain","Exponential"];t.push({id:`QID-${Date.now()}-${r}-${Math.random().toString(36).substring(2,15)}`,name:`${l} #${r.toString().padStart(4,"0")}`,type:i,assetClass:l,ownership:{model:["Sole","Fractional","DAO"][Math.floor(Math.random()*3)],entityId:`E-${Math.random().toString(16).substring(2,12)}`},location:{geoHash:Math.random().toString(36).substring(2,8).toUpperCase(),jurisdiction:["Global Economic Zone","Mars Colony Alpha","Off-World Consortium"][Math.floor(Math.random()*3)],sector:["Deep Tech","Bio-Synth","Logistics"][Math.floor(Math.random()*3)],digitalTwinUri:`ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi/${r}`},valuation:{currentMarketValue:u,appraisalDate:Date.now()-Math.floor(Math.random()*36e5),riskScore:parseFloat(h.toFixed(4)),appreciationTrajectory:m[Math.floor(Math.random()*m.length)],volatilityIndex:parseFloat(Math.random().toFixed(3))},financials:{annualizedNetIncome:p,capRate:parseFloat(d.toFixed(4)),liquidityIndex:Math.floor(Math.random()*100),taxExposureLevel:h>.7?"High":h>.3?"Medium":"Low",debtToEquityRatio:parseFloat(Math.random().toFixed(2))},compliance:{regulatoryStatus:["Compliant","PendingAudit","Flagged"][Math.floor(Math.random()*3)],lastAuditHash:`0x${Math.random().toString(16).substring(2,22)}`},sustainability:{carbonFootprintTonnes:Math.floor(Math.random()*1e3),energyEfficiencyRating:["A","B","C","D","E"][Math.floor(Math.random()*5)]},metadata:{creationTimestamp:Date.now()-Math.floor(Math.random()*31536e6),aiSentimentScore:parseFloat((Math.random()*2-1).toFixed(3)),lastTransactionId:`TXN-${Math.random().toString(16).substring(2,18)}`}})}return t},ehn=Zpn(250),thn=[{id:"BOT-01",name:"Momentum Alpha",strategy:"Momentum",isActive:!0,parameters:{riskTolerance:.8,tradeFrequencyMs:50},pnl:125034.21},{id:"BOT-02",name:"Arbitrage Hunter",strategy:"Arbitrage",isActive:!0,parameters:{riskTolerance:.3,tradeFrequencyMs:10},pnl:88234.55},{id:"BOT-03",name:"Mean Reversion Omega",strategy:"MeanReversion",isActive:!1,parameters:{riskTolerance:.5,tradeFrequencyMs:200},pnl:-1203.99}],nhn={properties:ehn,transactions:[],tradingBots:thn,activeView:"dashboard",selectedAssetId:null};function rhn(e,t){switch(t.type){case"SET_VIEW":return{...e,activeView:t.payload,selectedAssetId:null};case"SELECT_ASSET":return{...e,selectedAssetId:t.payload};case"PROCESS_MARKET_TICK":{const{assetId:n,priceChange:r}=t.payload;return{...e,properties:e.properties.map(o=>o.id===n?{...o,valuation:{...o.valuation,currentMarketValue:Math.max(0,o.valuation.currentMarketValue+r),volatilityIndex:Math.min(1,o.valuation.volatilityIndex+Math.random()*.05)}}:o)}}case"EXECUTE_TRADE":return{...e,transactions:[t.payload,...e.transactions].slice(0,100)};case"TOGGLE_BOT":return{...e,tradingBots:e.tradingBots.map(n=>n.id===t.payload?{...n,isActive:!n.isActive}:n)};default:return e}}const nK=()=>{const e=f.useCallback((n,r=!1)=>r?n>=1e9?`$${(n/1e9).toFixed(2)}B`:n>=1e6?`$${(n/1e6).toFixed(2)}M`:n>=1e3?`$${(n/1e3).toFixed(1)}K`:`$${n.toFixed(0)}`:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(n),[]),t=f.useCallback(n=>new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(n),[]);return{formatCurrency:e,formatPercentage:t}},ohn=(e,t,n)=>{f.useEffect(()=>{const r=setInterval(()=>{for(let o=0;o<5;o++){const i=t[Math.floor(Math.random()*t.length)],s=(Math.random()-.5)*i.valuation.currentMarketValue*.001;e({type:"PROCESS_MARKET_TICK",payload:{assetId:i.id,priceChange:s}})}n.forEach(o=>{if(o.isActive&&Math.random().5?"BUY":"SELL",l={id:`TXN-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,timestamp:Date.now(),assetId:i.id,type:s,price:i.valuation.currentMarketValue,quantity:1,parties:{from:o.id,to:"Market"},status:"Completed"};e({type:"EXECUTE_TRADE",payload:l})}})},100);return()=>clearInterval(r)},[e,t,n])},ihn=({activeView:e,onNavigate:t})=>{const n=[{id:"dashboard",label:"Global Dashboard",icon:Gpn},{id:"asset_management",label:"Asset Management",icon:Qpn},{id:"hft_terminal",label:"HFT Terminal",icon:Ypn},{id:"analytics_suite",label:"Predictive Analytics",icon:qpn},{id:"strategic_advisory",label:"Strategic Advisory",icon:Jpn},{id:"transaction_ledger",label:"Transaction Ledger",icon:Xpn}];return a.jsxs("nav",{style:{width:"240px",background:"#0a0a0a",padding:"20px 10px",borderRight:"1px solid #222",display:"flex",flexDirection:"column"},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"0 10px 20px 10px",borderBottom:"1px solid #222"},children:[a.jsx(Kpn,{className:"icon",style:{color:"#00aaff",width:"32px",height:"32px"}}),a.jsx("h1",{style:{color:"#f0f0f0",fontSize:"1.4em",margin:"0 0 0 10px"},children:"AETERNUS"})]}),a.jsx("ul",{style:{listStyle:"none",padding:0,margin:"20px 0"},children:n.map(r=>{const o=e===r.id;return a.jsxs("li",{onClick:()=>t(r.id),style:{display:"flex",alignItems:"center",padding:"12px 15px",margin:"5px 0",borderRadius:"6px",cursor:"pointer",background:o?"rgba(0, 170, 255, 0.1)":"transparent",color:o?"#00aaff":"#aaa",borderLeft:o?"3px solid #00aaff":"3px solid transparent",transition:"all 0.2s ease"},children:[a.jsx(r.icon,{style:{width:"20px",height:"20px",marginRight:"15px"}}),a.jsx("span",{style:{fontWeight:500},children:r.label})]},r.id)})}),a.jsxs("div",{style:{marginTop:"auto",padding:"10px",fontSize:"12px",color:"#555"},children:[a.jsxs("p",{children:["System Status: ",a.jsx("span",{style:{color:"#4CAF50"},children:"Optimal"})]}),a.jsxs("p",{children:["Quantum Link: ",a.jsx("span",{style:{color:"#4CAF50"},children:"Synchronized"})]}),a.jsx("p",{children:"Version: 2.7.1-alpha"})]})]})},xF=({title:e,value:t,secondaryValue:n,trend:r="flat"})=>{const o=r==="up"?"#4CAF50":r==="down"?"#F44336":"#FFEB3B";return a.jsxs("div",{style:{background:"#111",padding:"20px",borderRadius:"8px",border:"1px solid #282828"},children:[a.jsx("p",{style:{margin:0,fontSize:"14px",color:"#999",fontWeight:"500",marginBottom:"8px"},children:e}),a.jsx("h3",{style:{margin:0,color:"#f0f0f0",fontSize:"2em",fontWeight:"700"},children:t}),n&&a.jsxs("div",{style:{marginTop:"10px",display:"flex",alignItems:"center",fontSize:"13px"},children:[a.jsx("span",{style:{color:o,marginRight:"5px",fontSize:"16px"},children:r==="up"?"▲":r==="down"?"▼":"—"}),a.jsx("span",{style:{color:"#bbb"},children:n})]})]})},bTe=({properties:e})=>{const{formatCurrency:t,formatPercentage:n}=nK(),r=f.useMemo(()=>{const o=e.reduce((l,c)=>l+c.valuation.currentMarketValue,0),i=e.reduce((l,c)=>l+c.financials.annualizedNetIncome,0),s=e.reduce((l,c)=>l+c.valuation.riskScore,0)/e.length;return{totalValue:o,totalIncome:i,averageYield:o>0?i/o:0,averageRisk:s}},[e]);return a.jsxs("div",{children:[a.jsx("h2",{style:{color:"#eee",fontSize:"1.8em"},children:"Global Portfolio Overview"}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(250px, 1fr))",gap:"20px",marginBottom:"30px"},children:[a.jsx(xF,{title:"Total Portfolio Value (AUM)",value:t(r.totalValue,!0),secondaryValue:"+0.12% (24h)",trend:"up"}),a.jsx(xF,{title:"Annualized Net Income",value:t(r.totalIncome,!0),secondaryValue:`${e.length} Assets`,trend:"flat"}),a.jsx(xF,{title:"Blended Yield Rate",value:n(r.averageYield),secondaryValue:"Target: 5.50%",trend:r.averageYield>.055?"up":"down"}),a.jsx(xF,{title:"Systemic Risk Index",value:(r.averageRisk*100).toFixed(2)+"%",secondaryValue:"Status: STABLE",trend:"up"})]})]})},ahn=({properties:e,onSelect:t})=>{const{formatCurrency:n,formatPercentage:r}=nK(),[o,i]=f.useState("valuation.currentMarketValue"),[s,l]=f.useState("desc"),c=f.useMemo(()=>[...e].sort((p,h)=>{const m=o.split(".").reduce((y,x)=>y[x],p),g=o.split(".").reduce((y,x)=>y[x],h);return mg?s==="asc"?1:-1:0}),[e,o,s]),u=p=>{p===o?l(h=>h==="asc"?"desc":"asc"):(i(p),l("desc"))},d=[{key:"name",label:"Asset Name"},{key:"type",label:"Type"},{key:"valuation.currentMarketValue",label:"Market Value"},{key:"financials.capRate",label:"Cap Rate"},{key:"valuation.riskScore",label:"Risk"},{key:"compliance.regulatoryStatus",label:"Status"}];return a.jsxs("div",{children:[a.jsx("h2",{style:{color:"#eee",fontSize:"1.8em"},children:"Asset Management & Registry"}),a.jsx("div",{style:{background:"#111",border:"1px solid #282828",borderRadius:"8px",overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"14px"},children:[a.jsx("thead",{children:a.jsx("tr",{style:{background:"#1a1a1a"},children:d.map(p=>a.jsxs("th",{onClick:()=>u(p.key),style:{padding:"15px",textAlign:"left",cursor:"pointer",color:"#aaa"},children:[p.label," ",o===p.key&&(s==="desc"?"▼":"▲")]},p.key))})}),a.jsx("tbody",{children:c.slice(0,50).map(p=>a.jsxs("tr",{onClick:()=>t(p.id),style:{borderTop:"1px solid #282828",cursor:"pointer",transition:"background 0.2s"},className:"data-row",children:[a.jsx("td",{style:{padding:"12px 15px",color:"#ddd"},children:p.name}),a.jsx("td",{style:{padding:"12px 15px",color:"#aaa"},children:p.type}),a.jsx("td",{style:{padding:"12px 15px",color:"#ddd",textAlign:"right"},children:n(p.valuation.currentMarketValue)}),a.jsx("td",{style:{padding:"12px 15px",color:"#ddd",textAlign:"right"},children:r(p.financials.capRate)}),a.jsx("td",{style:{padding:"12px 15px",color:p.valuation.riskScore>.7?"#F44336":p.valuation.riskScore>.4?"#FFEB3B":"#4CAF50",textAlign:"right"},children:p.valuation.riskScore.toFixed(3)}),a.jsx("td",{style:{padding:"12px 15px",color:"#aaa"},children:p.compliance.regulatoryStatus})]},p.id))})]})})]})},shn=({properties:e,transactions:t,bots:n,dispatch:r})=>{const{formatCurrency:o}=nK(),[i,s]=f.useState(e[0]||null),l=c=>{if(!i)return;const u={id:`TXN-MANUAL-${Date.now()}`,timestamp:Date.now(),assetId:i.id,type:c,price:i.valuation.currentMarketValue,quantity:1,parties:{from:"USER-TERMINAL",to:"Market"},status:"Completed"};r({type:"EXECUTE_TRADE",payload:u})};return a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 300px",gap:"20px",height:"calc(100vh - 120px)"},children:[a.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[a.jsx("h2",{style:{color:"#eee",fontSize:"1.8em",margin:"0 0 20px 0"},children:"High-Frequency Trading Terminal"}),a.jsxs("div",{style:{flexGrow:1,background:"#111",border:"1px solid #282828",borderRadius:"8px",padding:"20px"},children:[a.jsxs("h3",{style:{margin:0,color:"#00aaff"},children:["Live Market Feed: ",i==null?void 0:i.name]}),a.jsxs("p",{style:{color:"#aaa"},children:["Price: ",o((i==null?void 0:i.valuation.currentMarketValue)||0)]}),a.jsx("div",{style:{height:"200px",border:"1px dashed #333",display:"flex",alignItems:"center",justifyContent:"center",color:"#555",borderRadius:"4px",margin:"20px 0"},children:"[Live Price Chart Placeholder]"}),a.jsxs("div",{style:{display:"flex",gap:"10px"},children:[a.jsx("button",{onClick:()=>l("BUY"),style:{flex:1,padding:"15px",background:"#4CAF50",border:"none",color:"white",borderRadius:"4px",cursor:"pointer",fontSize:"16px"},children:"EXECUTE BUY"}),a.jsx("button",{onClick:()=>l("SELL"),style:{flex:1,padding:"15px",background:"#F44336",border:"none",color:"white",borderRadius:"4px",cursor:"pointer",fontSize:"16px"},children:"EXECUTE SELL"})]})]}),a.jsxs("div",{style:{marginTop:"20px",background:"#111",border:"1px solid #282828",borderRadius:"8px",padding:"20px"},children:[a.jsx("h3",{style:{margin:"0 0 10px 0",color:"#eee"},children:"Automated Trading Bots"}),n.map(c=>a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:"1px solid #222"},children:[a.jsxs("span",{style:{color:"#ddd"},children:[c.name," (",c.strategy,")"]}),a.jsx("button",{onClick:()=>r({type:"TOGGLE_BOT",payload:c.id}),style:{padding:"5px 10px",background:c.isActive?"#00aaff":"#555",border:"none",color:"white",borderRadius:"4px",cursor:"pointer"},children:c.isActive?"ACTIVE":"INACTIVE"})]},c.id))]})]}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px"},children:[a.jsxs("div",{style:{background:"#111",border:"1px solid #282828",borderRadius:"8px",padding:"15px",flexShrink:0},children:[a.jsx("h4",{style:{margin:"0 0 10px 0",color:"#eee"},children:"Asset Selector"}),a.jsx("select",{onChange:c=>s(e.find(u=>u.id===c.target.value)||null),style:{width:"100%",background:"#222",color:"#eee",border:"1px solid #444",padding:"8px",borderRadius:"4px"},children:e.map(c=>a.jsx("option",{value:c.id,children:c.name},c.id))})]}),a.jsxs("div",{style:{background:"#111",border:"1px solid #282828",borderRadius:"8px",padding:"15px",flexGrow:1,overflowY:"auto"},children:[a.jsx("h4",{style:{margin:"0 0 10px 0",color:"#eee"},children:"Trade History"}),t.map(c=>{var u;return a.jsxs("div",{style:{fontSize:"12px",padding:"4px 0",borderBottom:"1px solid #222"},children:[a.jsx("span",{style:{color:c.type==="BUY"?"#4CAF50":"#F44336"},children:c.type}),a.jsxs("span",{style:{color:"#aaa",marginLeft:"5px"},children:[((u=e.find(d=>d.id===c.assetId))==null?void 0:u.name.substring(0,15))||"N/A","..."]}),a.jsx("span",{style:{color:"#ddd",float:"right"},children:o(c.price,!0)})]},c.id)})]})]})]})},lhn=()=>a.jsxs("div",{children:[a.jsx("h2",{style:{color:"#eee",fontSize:"1.8em"},children:"Predictive Analytics Suite"}),a.jsx("p",{style:{color:"#aaa"},children:"[Advanced visualizations and predictive heatmaps will be rendered here.]"})]}),chn=({transactions:e,properties:t})=>{const{formatCurrency:n}=nK();return a.jsxs("div",{children:[a.jsx("h2",{style:{color:"#eee",fontSize:"1.8em"},children:"Transaction Ledger"}),a.jsx("div",{style:{background:"#111",border:"1px solid #282828",borderRadius:"8px",overflow:"hidden"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"14px"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"#1a1a1a"},children:[a.jsx("th",{style:{padding:"15px",textAlign:"left",color:"#aaa"},children:"Timestamp"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",color:"#aaa"},children:"Asset"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",color:"#aaa"},children:"Type"}),a.jsx("th",{style:{padding:"15px",textAlign:"right",color:"#aaa"},children:"Price"}),a.jsx("th",{style:{padding:"15px",textAlign:"left",color:"#aaa"},children:"Parties"})]})}),a.jsx("tbody",{children:e.slice(0,100).map(r=>{var o;return a.jsxs("tr",{style:{borderTop:"1px solid #282828"},className:"data-row",children:[a.jsx("td",{style:{padding:"12px 15px",color:"#aaa"},children:new Date(r.timestamp).toISOString()}),a.jsx("td",{style:{padding:"12px 15px",color:"#ddd"},children:((o=t.find(i=>i.id===r.assetId))==null?void 0:o.name)||r.assetId}),a.jsx("td",{style:{padding:"12px 15px",color:r.type==="BUY"?"#4CAF50":"#F44336"},children:r.type}),a.jsx("td",{style:{padding:"12px 15px",color:"#ddd",textAlign:"right"},children:n(r.price)}),a.jsxs("td",{style:{padding:"12px 15px",color:"#aaa"},children:[r.parties.from," → ",r.parties.to]})]},r.id)})})]})})]})},uhn=({properties:e})=>{const[t,n]=f.useState([{role:"model",text:"Welcome to the AETERNUS Strategic Advisory. I am GEIN, your Global Economic Interaction Nexus. How can I assist you in navigating the complexities of the market today?"}]),[r,o]=f.useState(""),[i,s]=f.useState(!1),l=f.useRef(null);f.useEffect(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[t]);const c=d=>{const p=d.toLowerCase();if(p.includes("swot")||p.includes("analysis")){const h=e[Math.floor(Math.random()*e.length)];return`Certainly. Performing a SWOT analysis on a representative asset, **${h.name}**: - **Strengths**: High liquidity index (${h.financials.liquidityIndex}), strong appreciation trajectory ('${h.valuation.appreciationTrajectory}'), and compliant regulatory status. - **Weaknesses**: Significant carbon footprint (${h.sustainability.carbonFootprintTonnes} tonnes) poses ESG risk. Debt-to-equity ratio of ${h.financials.debtToEquityRatio} is slightly elevated. - **Opportunities**: The '${h.location.sector}' sector is projected for exponential growth. Leveraging its digital twin URI for tokenization could unlock further value. - **Threats**: High volatility index (${h.valuation.volatilityIndex}) and its location in the '${h.location.jurisdiction}' jurisdiction, which is currently experiencing minor geopolitical instability.`}if(p.includes("predict")||p.includes("forecast"))return"Based on quantum simulations and analysis of capital flow vectors, I predict a 7.2% uptick in the 'DigitalConstruct' asset class over the next fiscal cycle. Synthetic Derivatives, particularly 'Geopolitical Stability Swaps', will likely see increased volatility due to emergent patterns in global network traffic. I advise a cautious but opportunistic stance.";if(p.includes("risk")){const h=e.filter(m=>m.valuation.riskScore>.7).slice(0,2);return h.length>0?`My risk assessment algorithms have flagged several assets. For instance, ${h.map(m=>m.name).join(" and ")} exhibit high risk scores due to a combination of market volatility and pending regulatory audits. I recommend reviewing your exposure to these assets.`:"Overall systemic risk is currently within acceptable parameters. The portfolio's diversification across Physical, Digital, and Synthetic assets provides a robust hedge against sector-specific downturns. However, I am continuously monitoring for black swan events."}return"I am processing terabytes of real-time data. Could you please rephrase your query for a more specific analysis? For example, you could ask for a 'SWOT analysis of a random asset' or 'predict market trends'."},u=async d=>{if(d.preventDefault(),!r.trim()||i)return;const p={role:"user",text:r};n(g=>[...g,p]),o(""),s(!0),await new Promise(g=>setTimeout(g,1500+Math.random()*1e3));const m={role:"model",text:c(r)};n(g=>[...g,m]),s(!1)};return a.jsxs("div",{children:[a.jsx("h2",{style:{color:"#eee",fontSize:"1.8em"},children:"GEIN: Strategic Advisory"}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"calc(100vh - 200px)",background:"#111",border:"1px solid #282828",borderRadius:"8px"},children:[a.jsxs("div",{ref:l,style:{flexGrow:1,overflowY:"auto",padding:"20px"},children:[t.map((d,p)=>a.jsx("div",{style:{marginBottom:"20px",display:"flex",flexDirection:d.role==="user"?"row-reverse":"row"},children:a.jsx("div",{style:{maxWidth:"75%",padding:"10px 15px",borderRadius:"12px",background:d.role==="user"?"#00aaff":"#2a2a2a",color:d.role==="user"?"#fff":"#ddd",lineHeight:"1.6"},children:d.text.split("**").map((h,m)=>m%2===1?a.jsx("b",{children:h},m):h)})},p)),i&&a.jsx("div",{style:{display:"flex"},children:a.jsx("div",{style:{padding:"10px 15px",borderRadius:"12px",background:"#2a2a2a",color:"#ddd"},children:a.jsx("span",{className:"thinking-indicator"})})})]}),a.jsxs("form",{onSubmit:u,style:{padding:"20px",borderTop:"1px solid #282828",display:"flex",gap:"10px"},children:[a.jsx("input",{type:"text",value:r,onChange:d=>o(d.target.value),placeholder:"Ask GEIN about market trends, asset analysis, or risk assessment...",disabled:i,style:{flexGrow:1,padding:"12px",background:"#222",border:"1px solid #444",borderRadius:"6px",color:"#eee",fontSize:"1em"}}),a.jsx("button",{type:"submit",disabled:i,style:{padding:"12px 20px",background:"#00aaff",border:"none",borderRadius:"6px",color:"white",cursor:"pointer",fontSize:"1em",opacity:i?.5:1},children:"Query"})]})]}),a.jsx("style",{children:` .thinking-indicator::after { content: '▋'; animation: blink 1s step-end infinite; } @keyframes blink { 50% { opacity: 0; } } `})]})},dhn=()=>{const[e,t]=f.useReducer(rhn,nhn),{activeView:n,properties:r,transactions:o,tradingBots:i}=e;ohn(t,r,i);const s=c=>{t({type:"SET_VIEW",payload:c})},l=()=>{switch(n){case"dashboard":return a.jsx(bTe,{properties:r});case"asset_management":return a.jsx(ahn,{properties:r,onSelect:c=>console.log(c)});case"hft_terminal":return a.jsx(shn,{properties:r,transactions:o,bots:i,dispatch:t});case"analytics_suite":return a.jsx(lhn,{});case"strategic_advisory":return a.jsx(uhn,{properties:r});case"transaction_ledger":return a.jsx(chn,{transactions:o,properties:r});default:return a.jsx(bTe,{properties:r})}};return a.jsxs("div",{style:{fontFamily:'"Inter", "Arial", sans-serif',background:"#050505",color:"#e0e0e0",display:"flex",minHeight:"100vh",letterSpacing:"0.5px"},children:[a.jsx("style",{children:` @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap'); .data-row:hover { background: #1a1a1a; } `}),a.jsx(ihn,{activeView:n,onNavigate:s}),a.jsx("main",{style:{flexGrow:1,padding:"30px",overflowY:"auto"},children:l()})]})};var wTe;(function(e){e.STRING="string",e.NUMBER="number",e.INTEGER="integer",e.BOOLEAN="boolean",e.ARRAY="array",e.OBJECT="object"})(wTe||(wTe={}));/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var STe;(function(e){e.LANGUAGE_UNSPECIFIED="language_unspecified",e.PYTHON="python"})(STe||(STe={}));var CTe;(function(e){e.OUTCOME_UNSPECIFIED="outcome_unspecified",e.OUTCOME_OK="outcome_ok",e.OUTCOME_FAILED="outcome_failed",e.OUTCOME_DEADLINE_EXCEEDED="outcome_deadline_exceeded"})(CTe||(CTe={}));/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const NTe=["user","model","function","system"];var jTe;(function(e){e.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",e.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",e.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",e.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",e.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",e.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY"})(jTe||(jTe={}));var ETe;(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"})(ETe||(ETe={}));var ITe;(function(e){e.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",e.NEGLIGIBLE="NEGLIGIBLE",e.LOW="LOW",e.MEDIUM="MEDIUM",e.HIGH="HIGH"})(ITe||(ITe={}));var _Te;(function(e){e.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",e.SAFETY="SAFETY",e.OTHER="OTHER"})(_Te||(_Te={}));var uO;(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.BLOCKLIST="BLOCKLIST",e.PROHIBITED_CONTENT="PROHIBITED_CONTENT",e.SPII="SPII",e.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",e.OTHER="OTHER"})(uO||(uO={}));var PTe;(function(e){e.TASK_TYPE_UNSPECIFIED="TASK_TYPE_UNSPECIFIED",e.RETRIEVAL_QUERY="RETRIEVAL_QUERY",e.RETRIEVAL_DOCUMENT="RETRIEVAL_DOCUMENT",e.SEMANTIC_SIMILARITY="SEMANTIC_SIMILARITY",e.CLASSIFICATION="CLASSIFICATION",e.CLUSTERING="CLUSTERING"})(PTe||(PTe={}));var ATe;(function(e){e.MODE_UNSPECIFIED="MODE_UNSPECIFIED",e.AUTO="AUTO",e.ANY="ANY",e.NONE="NONE"})(ATe||(ATe={}));var TTe;(function(e){e.MODE_UNSPECIFIED="MODE_UNSPECIFIED",e.MODE_DYNAMIC="MODE_DYNAMIC"})(TTe||(TTe={}));/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Sp extends Error{constructor(t){super(`[GoogleGenerativeAI Error]: ${t}`)}}class i_ extends Sp{constructor(t,n){super(t),this.response=n}}class wnt extends Sp{constructor(t,n,r,o){super(t),this.status=n,this.statusText=r,this.errorDetails=o}}class oC extends Sp{}class Snt extends Sp{}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const fhn="https://generativelanguage.googleapis.com",phn="v1beta",hhn="0.24.1",mhn="genai-js";var dI;(function(e){e.GENERATE_CONTENT="generateContent",e.STREAM_GENERATE_CONTENT="streamGenerateContent",e.COUNT_TOKENS="countTokens",e.EMBED_CONTENT="embedContent",e.BATCH_EMBED_CONTENTS="batchEmbedContents"})(dI||(dI={}));class ghn{constructor(t,n,r,o,i){this.model=t,this.task=n,this.apiKey=r,this.stream=o,this.requestOptions=i}toString(){var t,n;const r=((t=this.requestOptions)===null||t===void 0?void 0:t.apiVersion)||phn;let i=`${((n=this.requestOptions)===null||n===void 0?void 0:n.baseUrl)||fhn}/${r}/${this.model}:${this.task}`;return this.stream&&(i+="?alt=sse"),i}}function xhn(e){const t=[];return e!=null&&e.apiClient&&t.push(e.apiClient),t.push(`${mhn}/${hhn}`),t.join(" ")}async function yhn(e){var t;const n=new Headers;n.append("Content-Type","application/json"),n.append("x-goog-api-client",xhn(e.requestOptions)),n.append("x-goog-api-key",e.apiKey);let r=(t=e.requestOptions)===null||t===void 0?void 0:t.customHeaders;if(r){if(!(r instanceof Headers))try{r=new Headers(r)}catch(o){throw new oC(`unable to convert customHeaders value ${JSON.stringify(r)} to Headers: ${o.message}`)}for(const[o,i]of r.entries()){if(o==="x-goog-api-key")throw new oC(`Cannot set reserved header name ${o}`);if(o==="x-goog-api-client")throw new oC(`Header name ${o} can only be set using the apiClient field`);n.append(o,i)}}return n}async function vhn(e,t,n,r,o,i){const s=new ghn(e,t,n,r,i);return{url:s.toString(),fetchOptions:Object.assign(Object.assign({},Chn(i)),{method:"POST",headers:await yhn(s),body:o})}}async function LL(e,t,n,r,o,i={},s=fetch){const{url:l,fetchOptions:c}=await vhn(e,t,n,r,o,i);return bhn(l,c,s)}async function bhn(e,t,n=fetch){let r;try{r=await n(e,t)}catch(o){whn(o,e)}return r.ok||await Shn(r,e),r}function whn(e,t){let n=e;throw n.name==="AbortError"?(n=new Snt(`Request aborted when fetching ${t.toString()}: ${e.message}`),n.stack=e.stack):e instanceof wnt||e instanceof oC||(n=new Sp(`Error fetching from ${t.toString()}: ${e.message}`),n.stack=e.stack),n}async function Shn(e,t){let n="",r;try{const o=await e.json();n=o.error.message,o.error.details&&(n+=` ${JSON.stringify(o.error.details)}`,r=o.error.details)}catch{}throw new wnt(`Error fetching from ${t.toString()}: [${e.status} ${e.statusText}] ${n}`,e.status,e.statusText,r)}function Chn(e){const t={};if((e==null?void 0:e.signal)!==void 0||(e==null?void 0:e.timeout)>=0){const n=new AbortController;(e==null?void 0:e.timeout)>=0&&setTimeout(()=>n.abort(),e.timeout),e!=null&&e.signal&&e.signal.addEventListener("abort",()=>{n.abort()}),t.signal=n.signal}return t}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function mxe(e){return e.text=()=>{if(e.candidates&&e.candidates.length>0){if(e.candidates.length>1&&console.warn(`This response had ${e.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`),Xz(e.candidates[0]))throw new i_(`${n2(e)}`,e);return Nhn(e)}else if(e.promptFeedback)throw new i_(`Text not available. ${n2(e)}`,e);return""},e.functionCall=()=>{if(e.candidates&&e.candidates.length>0){if(e.candidates.length>1&&console.warn(`This response had ${e.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),Xz(e.candidates[0]))throw new i_(`${n2(e)}`,e);return console.warn("response.functionCall() is deprecated. Use response.functionCalls() instead."),kTe(e)[0]}else if(e.promptFeedback)throw new i_(`Function call not available. ${n2(e)}`,e)},e.functionCalls=()=>{if(e.candidates&&e.candidates.length>0){if(e.candidates.length>1&&console.warn(`This response had ${e.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),Xz(e.candidates[0]))throw new i_(`${n2(e)}`,e);return kTe(e)}else if(e.promptFeedback)throw new i_(`Function call not available. ${n2(e)}`,e)},e}function Nhn(e){var t,n,r,o;const i=[];if(!((n=(t=e.candidates)===null||t===void 0?void 0:t[0].content)===null||n===void 0)&&n.parts)for(const s of(o=(r=e.candidates)===null||r===void 0?void 0:r[0].content)===null||o===void 0?void 0:o.parts)s.text&&i.push(s.text),s.executableCode&&i.push("\n```"+s.executableCode.language+` `+s.executableCode.code+"\n```\n"),s.codeExecutionResult&&i.push("\n```\n"+s.codeExecutionResult.output+"\n```\n");return i.length>0?i.join(""):""}function kTe(e){var t,n,r,o;const i=[];if(!((n=(t=e.candidates)===null||t===void 0?void 0:t[0].content)===null||n===void 0)&&n.parts)for(const s of(o=(r=e.candidates)===null||r===void 0?void 0:r[0].content)===null||o===void 0?void 0:o.parts)s.functionCall&&i.push(s.functionCall);if(i.length>0)return i}const jhn=[uO.RECITATION,uO.SAFETY,uO.LANGUAGE];function Xz(e){return!!e.finishReason&&jhn.includes(e.finishReason)}function n2(e){var t,n,r;let o="";if((!e.candidates||e.candidates.length===0)&&e.promptFeedback)o+="Response was blocked",!((t=e.promptFeedback)===null||t===void 0)&&t.blockReason&&(o+=` due to ${e.promptFeedback.blockReason}`),!((n=e.promptFeedback)===null||n===void 0)&&n.blockReasonMessage&&(o+=`: ${e.promptFeedback.blockReasonMessage}`);else if(!((r=e.candidates)===null||r===void 0)&&r[0]){const i=e.candidates[0];Xz(i)&&(o+=`Candidate was blocked due to ${i.finishReason}`,i.finishMessage&&(o+=`: ${i.finishMessage}`))}return o}function B3(e){return this instanceof B3?(this.v=e,this):new B3(e)}function Ehn(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),o,i=[];return o={},s("next"),s("throw"),s("return"),o[Symbol.asyncIterator]=function(){return this},o;function s(h){r[h]&&(o[h]=function(m){return new Promise(function(g,y){i.push([h,m,g,y])>1||l(h,m)})})}function l(h,m){try{c(r[h](m))}catch(g){p(i[0][3],g)}}function c(h){h.value instanceof B3?Promise.resolve(h.value.v).then(u,d):p(i[0][2],h)}function u(h){l("next",h)}function d(h){l("throw",h)}function p(h,m){h(m),i.shift(),i.length&&l(i[0][0],i[0][1])}}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const MTe=/^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/;function Ihn(e){const t=e.body.pipeThrough(new TextDecoderStream("utf8",{fatal:!0})),n=Ahn(t),[r,o]=n.tee();return{stream:Phn(r),response:_hn(o)}}async function _hn(e){const t=[],n=e.getReader();for(;;){const{done:r,value:o}=await n.read();if(r)return mxe(Thn(t));t.push(o)}}function Phn(e){return Ehn(this,arguments,function*(){const n=e.getReader();for(;;){const{value:r,done:o}=yield B3(n.read());if(o)break;yield yield B3(mxe(r))}})}function Ahn(e){const t=e.getReader();return new ReadableStream({start(r){let o="";return i();function i(){return t.read().then(({value:s,done:l})=>{if(l){if(o.trim()){r.error(new Sp("Failed to parse stream"));return}r.close();return}o+=s;let c=o.match(MTe),u;for(;c;){try{u=JSON.parse(c[1])}catch{r.error(new Sp(`Error parsing JSON response: "${c[1]}"`));return}r.enqueue(u),o=o.substring(c[0].length),c=o.match(MTe)}return i()}).catch(s=>{let l=s;throw l.stack=s.stack,l.name==="AbortError"?l=new Snt("Request aborted when reading from the stream"):l=new Sp("Error reading from the stream"),l})}}})}function Thn(e){const t=e[e.length-1],n={promptFeedback:t==null?void 0:t.promptFeedback};for(const r of e){if(r.candidates){let o=0;for(const i of r.candidates)if(n.candidates||(n.candidates=[]),n.candidates[o]||(n.candidates[o]={index:o}),n.candidates[o].citationMetadata=i.citationMetadata,n.candidates[o].groundingMetadata=i.groundingMetadata,n.candidates[o].finishReason=i.finishReason,n.candidates[o].finishMessage=i.finishMessage,n.candidates[o].safetyRatings=i.safetyRatings,i.content&&i.content.parts){n.candidates[o].content||(n.candidates[o].content={role:i.content.role||"user",parts:[]});const s={};for(const l of i.content.parts)l.text&&(s.text=l.text),l.functionCall&&(s.functionCall=l.functionCall),l.executableCode&&(s.executableCode=l.executableCode),l.codeExecutionResult&&(s.codeExecutionResult=l.codeExecutionResult),Object.keys(s).length===0&&(s.text=""),n.candidates[o].content.parts.push(s)}o++}r.usageMetadata&&(n.usageMetadata=r.usageMetadata)}return n}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Cnt(e,t,n,r){const o=await LL(t,dI.STREAM_GENERATE_CONTENT,e,!0,JSON.stringify(n),r);return Ihn(o)}async function Nnt(e,t,n,r){const i=await(await LL(t,dI.GENERATE_CONTENT,e,!1,JSON.stringify(n),r)).json();return{response:mxe(i)}}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function jnt(e){if(e!=null){if(typeof e=="string")return{role:"system",parts:[{text:e}]};if(e.text)return{role:"system",parts:[e]};if(e.parts)return e.role?e:{role:"system",parts:e.parts}}}function H3(e){let t=[];if(typeof e=="string")t=[{text:e}];else for(const n of e)typeof n=="string"?t.push({text:n}):t.push(n);return khn(t)}function khn(e){const t={role:"user",parts:[]},n={role:"function",parts:[]};let r=!1,o=!1;for(const i of e)"functionResponse"in i?(n.parts.push(i),o=!0):(t.parts.push(i),r=!0);if(r&&o)throw new Sp("Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message.");if(!r&&!o)throw new Sp("No content is provided for sending chat message.");return r?t:n}function Mhn(e,t){var n;let r={model:t==null?void 0:t.model,generationConfig:t==null?void 0:t.generationConfig,safetySettings:t==null?void 0:t.safetySettings,tools:t==null?void 0:t.tools,toolConfig:t==null?void 0:t.toolConfig,systemInstruction:t==null?void 0:t.systemInstruction,cachedContent:(n=t==null?void 0:t.cachedContent)===null||n===void 0?void 0:n.name,contents:[]};const o=e.generateContentRequest!=null;if(e.contents){if(o)throw new oC("CountTokensRequest must have one of contents or generateContentRequest, not both.");r.contents=e.contents}else if(o)r=Object.assign(Object.assign({},r),e.generateContentRequest);else{const i=H3(e);r.contents=[i]}return{generateContentRequest:r}}function RTe(e){let t;return e.contents?t=e:t={contents:[H3(e)]},e.systemInstruction&&(t.systemInstruction=jnt(e.systemInstruction)),t}function Rhn(e){return typeof e=="string"||Array.isArray(e)?{content:H3(e)}:e}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const OTe=["text","inlineData","functionCall","functionResponse","executableCode","codeExecutionResult"],Ohn={user:["text","inlineData"],function:["functionResponse"],model:["text","functionCall","executableCode","codeExecutionResult"],system:["text"]};function $hn(e){let t=!1;for(const n of e){const{role:r,parts:o}=n;if(!t&&r!=="user")throw new Sp(`First content should be with role 'user', got ${r}`);if(!NTe.includes(r))throw new Sp(`Each item should include role field. Got ${r} but valid roles are: ${JSON.stringify(NTe)}`);if(!Array.isArray(o))throw new Sp("Content should have 'parts' property with an array of Parts");if(o.length===0)throw new Sp("Each Content should have at least one part");const i={text:0,inlineData:0,functionCall:0,functionResponse:0,fileData:0,executableCode:0,codeExecutionResult:0};for(const l of o)for(const c of OTe)c in l&&(i[c]+=1);const s=Ohn[r];for(const l of OTe)if(!s.includes(l)&&i[l]>0)throw new Sp(`Content with role '${r}' can't contain '${l}' part`);t=!0}}function $Te(e){var t;if(e.candidates===void 0||e.candidates.length===0)return!1;const n=(t=e.candidates[0])===null||t===void 0?void 0:t.content;if(n===void 0||n.parts===void 0||n.parts.length===0)return!1;for(const r of n.parts)if(r===void 0||Object.keys(r).length===0||r.text!==void 0&&r.text==="")return!1;return!0}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const DTe="SILENT_ERROR";class Dhn{constructor(t,n,r,o={}){this.model=n,this.params=r,this._requestOptions=o,this._history=[],this._sendPromise=Promise.resolve(),this._apiKey=t,r!=null&&r.history&&($hn(r.history),this._history=r.history)}async getHistory(){return await this._sendPromise,this._history}async sendMessage(t,n={}){var r,o,i,s,l,c;await this._sendPromise;const u=H3(t),d={safetySettings:(r=this.params)===null||r===void 0?void 0:r.safetySettings,generationConfig:(o=this.params)===null||o===void 0?void 0:o.generationConfig,tools:(i=this.params)===null||i===void 0?void 0:i.tools,toolConfig:(s=this.params)===null||s===void 0?void 0:s.toolConfig,systemInstruction:(l=this.params)===null||l===void 0?void 0:l.systemInstruction,cachedContent:(c=this.params)===null||c===void 0?void 0:c.cachedContent,contents:[...this._history,u]},p=Object.assign(Object.assign({},this._requestOptions),n);let h;return this._sendPromise=this._sendPromise.then(()=>Nnt(this._apiKey,this.model,d,p)).then(m=>{var g;if($Te(m.response)){this._history.push(u);const y=Object.assign({parts:[],role:"model"},(g=m.response.candidates)===null||g===void 0?void 0:g[0].content);this._history.push(y)}else{const y=n2(m.response);y&&console.warn(`sendMessage() was unsuccessful. ${y}. Inspect response object for details.`)}h=m}).catch(m=>{throw this._sendPromise=Promise.resolve(),m}),await this._sendPromise,h}async sendMessageStream(t,n={}){var r,o,i,s,l,c;await this._sendPromise;const u=H3(t),d={safetySettings:(r=this.params)===null||r===void 0?void 0:r.safetySettings,generationConfig:(o=this.params)===null||o===void 0?void 0:o.generationConfig,tools:(i=this.params)===null||i===void 0?void 0:i.tools,toolConfig:(s=this.params)===null||s===void 0?void 0:s.toolConfig,systemInstruction:(l=this.params)===null||l===void 0?void 0:l.systemInstruction,cachedContent:(c=this.params)===null||c===void 0?void 0:c.cachedContent,contents:[...this._history,u]},p=Object.assign(Object.assign({},this._requestOptions),n),h=Cnt(this._apiKey,this.model,d,p);return this._sendPromise=this._sendPromise.then(()=>h).catch(m=>{throw new Error(DTe)}).then(m=>m.response).then(m=>{if($Te(m)){this._history.push(u);const g=Object.assign({},m.candidates[0].content);g.role||(g.role="model"),this._history.push(g)}else{const g=n2(m);g&&console.warn(`sendMessageStream() was unsuccessful. ${g}. Inspect response object for details.`)}}).catch(m=>{m.message!==DTe&&console.error(m)}),h}}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Lhn(e,t,n,r){return(await LL(t,dI.COUNT_TOKENS,e,!1,JSON.stringify(n),r)).json()}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Fhn(e,t,n,r){return(await LL(t,dI.EMBED_CONTENT,e,!1,JSON.stringify(n),r)).json()}async function zhn(e,t,n,r){const o=n.requests.map(s=>Object.assign(Object.assign({},s),{model:t}));return(await LL(t,dI.BATCH_EMBED_CONTENTS,e,!1,JSON.stringify({requests:o}),r)).json()}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class LTe{constructor(t,n,r={}){this.apiKey=t,this._requestOptions=r,n.model.includes("/")?this.model=n.model:this.model=`models/${n.model}`,this.generationConfig=n.generationConfig||{},this.safetySettings=n.safetySettings||[],this.tools=n.tools,this.toolConfig=n.toolConfig,this.systemInstruction=jnt(n.systemInstruction),this.cachedContent=n.cachedContent}async generateContent(t,n={}){var r;const o=RTe(t),i=Object.assign(Object.assign({},this._requestOptions),n);return Nnt(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(r=this.cachedContent)===null||r===void 0?void 0:r.name},o),i)}async generateContentStream(t,n={}){var r;const o=RTe(t),i=Object.assign(Object.assign({},this._requestOptions),n);return Cnt(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(r=this.cachedContent)===null||r===void 0?void 0:r.name},o),i)}startChat(t){var n;return new Dhn(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(n=this.cachedContent)===null||n===void 0?void 0:n.name},t),this._requestOptions)}async countTokens(t,n={}){const r=Mhn(t,{model:this.model,generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent}),o=Object.assign(Object.assign({},this._requestOptions),n);return Lhn(this.apiKey,this.model,r,o)}async embedContent(t,n={}){const r=Rhn(t),o=Object.assign(Object.assign({},this._requestOptions),n);return Fhn(this.apiKey,this.model,r,o)}async batchEmbedContents(t,n={}){const r=Object.assign(Object.assign({},this._requestOptions),n);return zhn(this.apiKey,this.model,t,r)}}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Bhn{constructor(t){this.apiKey=t}getGenerativeModel(t,n){if(!t.model)throw new Sp("Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })");return new LTe(this.apiKey,t,n)}getGenerativeModelFromCachedContent(t,n,r){if(!t.name)throw new oC("Cached content must contain a `name` field.");if(!t.model)throw new oC("Cached content must contain a `model` field.");const o=["model","systemInstruction"];for(const s of o)if(n!=null&&n[s]&&t[s]&&(n==null?void 0:n[s])!==t[s]){if(s==="model"){const l=n.model.startsWith("models/")?n.model.replace("models/",""):n.model,c=t.model.startsWith("models/")?t.model.replace("models/",""):t.model;if(l===c)continue}throw new oC(`Different value for "${s}" specified in modelParams (${n[s]}) and cachedContent (${t[s]})`)}const i=Object.assign(Object.assign({},n),{model:t.model,tools:t.tools,toolConfig:t.toolConfig,systemInstruction:t.systemInstruction,cachedContent:t});return new LTe(this.apiKey,i,r)}}const Mn={primary:"#0A192F",secondary:"#64FFDA",background:"#020C1B",card:"#112240",text:"#CCD6F6",textDim:"#8892B0",gain:"#4CD137",loss:"#E84118",critical:"#C23616",border:"#233554"},Ent={default:"0 10px 30px -15px rgba(2, 12, 27, 0.7)"},rP=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e),uA={encrypt:e=>`ENC_${btoa(e).split("").reverse().join("")}_QNTM`,decrypt:e=>{if(!e.startsWith("ENC_"))return e;const n=e.replace("ENC_","").replace("_QNTM","").split("").reverse().join("");return atob(n)},homomorphicSum:(e,t)=>{const n=parseFloat(uA.decrypt(e))||0,r=parseFloat(uA.decrypt(t))||0;return uA.encrypt((n+r).toString())}},Int=e=>{const t=["Fine Art","Vintage Wine","Luxury Watch","Digital Asset","Real Estate Token","Precious Metal","Rare Collectible"],n=t[e%t.length],r=25e4+e*75e3,o=1.1+Math.random()*.8,i=Math.round(r*o);return{id:`QF-ASSET-${String(e+1e3).padStart(5,"0")}`,name:`Quantum ${n} Elite #${e+1}`,category:n,assetClassId:`CLASS-${n.substring(0,3).toUpperCase()}`,imageUrl:`https://picsum.photos/seed/${e+42}/800/600`,acquisitionPrice:r,currentValuation:i,acquisitionDate:`202${Math.floor(Math.random()*3)}-${String(Math.floor(Math.random()*11)+1).padStart(2,"0")}-15`,description:`A high-yield ${n} asset managed within the Quantum Financial ecosystem. This asset leverages real-time market data and AI-driven valuation models to ensure maximum liquidity and capital preservation.`,provenance:[{date:"2018-05-20",ownerName:"Global Heritage Fund",transactionType:"Acquisition",location:"London Vault",transactionValue:r*.8,documentHash:"0x77a...f21"},{date:"2021-11-12",ownerName:"Quantum Financial",transactionType:"Acquisition",location:"Singapore Secure Storage",transactionValue:r,documentHash:`0x${Math.random().toString(16).slice(2,10)}...`}],fractionalShares:[{shareholderId:"USR-992",percentage:15,equityValue:i*.15,lastDividendPayout:4500},{shareholderId:"USR-104",percentage:10,equityValue:i*.1,lastDividendPayout:3e3}],aiValuations:[{modelName:"Gemini-3-Flash-Quantum",timestamp:new Date().toISOString(),predictedValue:i*1.05,confidenceScore:.98,keyDrivers:["Market Scarcity","Institutional Demand"]}],riskProfile:{riskLevel:e%5===0?"High":"Low",liquidityScore:85,geopoliticalExposure:12,regulatoryComplianceStatus:"Compliant",mitigationStrategies:["Dynamic Hedging","Multi-jurisdictional Custody"]},storageLocation:"Quantum Vault Alpha-1",insurancePolicyId:`POL-QF-${e+5e3}`,isTokenized:!0}},Hhn=Array.from({length:12}).map((e,t)=>Int(t)),Vhn=({amount:e,onPaymentSuccess:t,onCancel:n})=>{const[r,o]=f.useState(!1),[i,s]=f.useState("form"),l=async()=>{o(!0),s("processing"),await new Promise(c=>setTimeout(c,2500)),s("success"),setTimeout(()=>{t()},1500)};return a.jsxs("div",{style:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",backgroundColor:Mn.card,padding:"2.5rem",borderRadius:"12px",boxShadow:"0 0 100px rgba(0,0,0,0.8)",zIndex:2e3,width:"400px",border:`1px solid ${Mn.secondary}`,textAlign:"center"},children:[i==="form"&&a.jsxs(a.Fragment,{children:[a.jsx("h2",{style:{color:Mn.secondary,marginBottom:"1rem"},children:"Quantum Pay Terminal"}),a.jsxs("p",{style:{color:Mn.textDim,marginBottom:"2rem"},children:["Secure Transaction for ",rP(e)]}),a.jsxs("div",{style:{textAlign:"left",marginBottom:"1.5rem"},children:[a.jsx("label",{style:{display:"block",color:Mn.text,fontSize:"0.8rem",marginBottom:"0.5rem"},children:"CARD NUMBER"}),a.jsx("div",{style:{padding:"1rem",backgroundColor:Mn.background,border:`1px solid ${Mn.border}`,borderRadius:"4px",color:Mn.text},children:"**** **** **** 4242"})]}),a.jsxs("div",{style:{display:"flex",gap:"1rem",marginBottom:"2rem"},children:[a.jsxs("div",{style:{flex:1,textAlign:"left"},children:[a.jsx("label",{style:{display:"block",color:Mn.text,fontSize:"0.8rem",marginBottom:"0.5rem"},children:"EXPIRY"}),a.jsx("input",{type:"text",defaultValue:"12/28",style:{width:"100%",padding:"1rem",backgroundColor:Mn.background,border:`1px solid ${Mn.border}`,borderRadius:"4px",color:Mn.text}})]}),a.jsxs("div",{style:{flex:1,textAlign:"left"},children:[a.jsx("label",{style:{display:"block",color:Mn.text,fontSize:"0.8rem",marginBottom:"0.5rem"},children:"CVC"}),a.jsx("input",{type:"text",defaultValue:"***",style:{width:"100%",padding:"1rem",backgroundColor:Mn.background,border:`1px solid ${Mn.border}`,borderRadius:"4px",color:Mn.text}})]})]}),a.jsx("button",{onClick:l,style:{width:"100%",padding:"1rem",backgroundColor:Mn.secondary,color:Mn.primary,border:"none",borderRadius:"4px",fontWeight:"bold",cursor:"pointer",marginBottom:"1rem"},children:"CONFIRM PAYMENT"}),a.jsx("button",{onClick:n,style:{background:"none",border:"none",color:Mn.textDim,cursor:"pointer"},children:"Cancel"})]}),i==="processing"&&a.jsxs("div",{style:{padding:"3rem 0"},children:[a.jsx("div",{className:"spinner",style:{width:"50px",height:"50px",border:`5px solid ${Mn.border}`,borderTop:`5px solid ${Mn.secondary}`,borderRadius:"50%",margin:"0 auto 2rem",animation:"spin 1s linear infinite"}}),a.jsx("h3",{style:{color:Mn.text},children:"Verifying with Stripe..."}),a.jsx("p",{style:{color:Mn.textDim},children:"Quantum Encryption in Progress"})]}),i==="success"&&a.jsxs("div",{style:{padding:"3rem 0"},children:[a.jsx("div",{style:{fontSize:"4rem",color:Mn.gain,marginBottom:"1rem"},children:"✓"}),a.jsx("h3",{style:{color:Mn.text},children:"Payment Successful"}),a.jsxs("p",{style:{color:Mn.textDim},children:["Transaction ID: QF-STRIPE-",Math.random().toString(36).toUpperCase().slice(2,10)]})]}),a.jsx("style",{children:"@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }"})]})},Uhn=({onAction:e})=>{const[t,n]=f.useState([{role:"ai",text:"Welcome to the Quantum Financial Golden Ticket experience. I am your AI Concierge. I can help you 'kick the tires' of our asset engine. Want to create a new Fine Art asset or simulate a market crash?"}]),[r,o]=f.useState(""),[i,s]=f.useState(!1),l=f.useRef(null),c=()=>{var d;return(d=l.current)==null?void 0:d.scrollIntoView({behavior:"smooth"})};f.useEffect(c,[t]);const u=async()=>{if(!r.trim())return;const d=r;n(p=>[...p,{role:"user",text:d}]),o(""),s(!0);try{const h=new Bhn("").getGenerativeModel({model:"gemini-1.5-flash"}),m=` You are the Quantum Financial AI Concierge. The user is in a business demo. You can perform actions by returning a JSON object at the end of your message. Available Actions: - CREATE_ASSET: { "category": "Fine Art", "name": "AI Masterpiece" } - SIMULATE_MARKET: { "trend": "Bullish" } - GENERATE_REPORT: { "type": "Risk" } User said: "${d}" Respond professionally and elite. If they want to create something, include the JSON. `,x=(await(await h.generateContent(m)).response).text(),v=x.match(/\{.*\}/s);if(v)try{const b=JSON.parse(v[0]);b.category&&e("CREATE_ASSET",b),b.trend&&e("SIMULATE_MARKET",b)}catch(b){console.error("AI Command Parse Error",b)}n(b=>[...b,{role:"ai",text:x.replace(/\{.*\}/s,"").trim()}])}catch{n(h=>[...h,{role:"ai",text:"I apologize, but my quantum link is currently saturated. Please try again shortly."}])}finally{s(!1)}};return a.jsxs("div",{style:{width:"350px",height:"500px",backgroundColor:Mn.card,border:`1px solid ${Mn.border}`,borderRadius:"12px",display:"flex",flexDirection:"column",overflow:"hidden",boxShadow:Ent.default,position:"fixed",bottom:"80px",right:"20px",zIndex:1e3},children:[a.jsxs("div",{style:{padding:"1rem",backgroundColor:Mn.primary,borderBottom:`1px solid ${Mn.border}`,display:"flex",alignItems:"center",gap:"0.5rem"},children:[a.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:Mn.secondary}}),a.jsx("span",{style:{color:Mn.secondary,fontWeight:"bold",fontSize:"0.9rem"},children:"QUANTUM AI CONCIERGE"})]}),a.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"1rem",display:"flex",flexDirection:"column",gap:"1rem"},children:[t.map((d,p)=>a.jsx("div",{style:{alignSelf:d.role==="user"?"flex-end":"flex-start",maxWidth:"80%",padding:"0.75rem",borderRadius:"8px",backgroundColor:d.role==="user"?Mn.secondary:Mn.background,color:d.role==="user"?Mn.primary:Mn.text,fontSize:"0.85rem",lineHeight:"1.4"},children:d.text},p)),i&&a.jsx("div",{style:{color:Mn.textDim,fontSize:"0.7rem"},children:"AI is calculating..."}),a.jsx("div",{ref:l})]}),a.jsxs("div",{style:{padding:"1rem",borderTop:`1px solid ${Mn.border}`,display:"flex",gap:"0.5rem"},children:[a.jsx("input",{value:r,onChange:d=>o(d.target.value),onKeyDown:d=>d.key==="Enter"&&u(),placeholder:"Ask Quantum AI...",style:{flex:1,backgroundColor:Mn.background,border:`1px solid ${Mn.border}`,borderRadius:"4px",padding:"0.5rem",color:Mn.text,outline:"none"}}),a.jsx("button",{onClick:u,style:{backgroundColor:Mn.secondary,color:Mn.primary,border:"none",borderRadius:"4px",padding:"0.5rem 1rem",fontWeight:"bold",cursor:"pointer"},children:"SEND"})]})]})},Whn=()=>{const[e,t]=f.useState(Hhn),[n,r]=f.useState([]),[o,i]=f.useState([{id:"K-1",serviceName:"SAP ERP",encryptedKey:uA.encrypt("SAP-SECRET-9921"),lastUsed:"2023-10-24",status:"Active"},{id:"K-2",serviceName:"Bloomberg Terminal",encryptedKey:uA.encrypt("BB-API-KEY-X"),lastUsed:"2023-10-25",status:"Active"}]),[s,l]=f.useState(null),[c,u]=f.useState({active:!1,amount:0}),[d,p]=f.useState("inventory"),h=f.useCallback((w,S,C="INFO")=>{const N={id:`LOG-${Math.random().toString(36).toUpperCase().slice(2,10)}`,timestamp:new Date().toISOString(),action:w,user:"DEMO_USER_GOLDEN_TICKET",details:S,severity:C,ipAddress:"192.168.1.104"};r(j=>[N,...j])},[]);f.useEffect(()=>{h("SYSTEM_BOOT","Quantum Financial Asset Management System Initialized")},[h]);const m=(w,S)=>{if(w==="CREATE_ASSET"){const C=Int(e.length);C.name=S.name||C.name,C.category=S.category||C.category,t(N=>[C,...N]),h("AI_ASSET_CREATION",`AI created new asset: ${C.name}`)}else if(w==="SIMULATE_MARKET"){const C=S.trend==="Bullish"?1.1:.9;t(N=>N.map(j=>({...j,currentValuation:Math.round(j.currentValuation*C)}))),h("AI_MARKET_SIMULATION",`AI simulated a ${S.trend} market shift`)}},g=f.useMemo(()=>{const w=e.reduce((j,I)=>j+I.acquisitionPrice,0),S=e.reduce((j,I)=>j+I.currentValuation,0),C=S-w,N=C/w*100;return{totalAcquisitionValue:w,totalCurrentValue:S,totalGainLoss:C,totalGainLossPercentage:N,aiOptimizedAllocation:{"Fine Art":30,"Digital Asset":20,"Luxury Watch":15},overallRisk:"Low",marketSentiment:"Bullish"}},[e]),y=()=>a.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(300px, 1fr))",gap:"2rem"},children:e.map(w=>a.jsxs("div",{onClick:()=>l(w),style:{backgroundColor:Mn.card,borderRadius:"12px",overflow:"hidden",border:`1px solid ${Mn.border}`,cursor:"pointer",transition:"all 0.3s ease",boxShadow:Ent.default},onMouseEnter:S=>{S.currentTarget.style.transform="translateY(-10px)",S.currentTarget.style.borderColor=Mn.secondary},onMouseLeave:S=>{S.currentTarget.style.transform="translateY(0)",S.currentTarget.style.borderColor=Mn.border},children:[a.jsxs("div",{style:{height:"200px",overflow:"hidden",position:"relative"},children:[a.jsx("img",{src:w.imageUrl,alt:w.name,style:{width:"100%",height:"100%",objectFit:"cover"}}),a.jsxs("div",{style:{position:"absolute",top:"10px",right:"10px",padding:"0.4rem 0.8rem",backgroundColor:w.riskProfile.riskLevel==="Low"?Mn.gain:Mn.loss,color:Mn.primary,borderRadius:"20px",fontSize:"0.7rem",fontWeight:"bold"},children:[w.riskProfile.riskLevel," RISK"]})]}),a.jsxs("div",{style:{padding:"1.5rem"},children:[a.jsx("h3",{style:{color:Mn.text,marginBottom:"0.5rem",fontSize:"1.1rem"},children:w.name}),a.jsxs("p",{style:{color:Mn.textDim,fontSize:"0.8rem",marginBottom:"1rem"},children:[w.category," • ",w.id]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{children:[a.jsx("p",{style:{color:Mn.textDim,fontSize:"0.7rem"},children:"CURRENT VALUATION"}),a.jsx("p",{style:{color:Mn.secondary,fontWeight:"bold",fontSize:"1.2rem"},children:rP(w.currentValuation)})]}),a.jsxs("div",{style:{textAlign:"right"},children:[a.jsx("p",{style:{color:Mn.textDim,fontSize:"0.7rem"},children:"PERFORMANCE"}),a.jsxs("p",{style:{color:w.currentValuation>w.acquisitionPrice?Mn.gain:Mn.loss,fontWeight:"bold"},children:[((w.currentValuation-w.acquisitionPrice)/w.acquisitionPrice*100).toFixed(1),"%"]})]})]})]})]},w.id))}),x=()=>a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"2rem"},children:[a.jsxs("div",{style:{backgroundColor:Mn.card,padding:"2rem",borderRadius:"12px",border:`1px solid ${Mn.border}`},children:[a.jsx("h3",{style:{color:Mn.secondary,marginBottom:"1.5rem"},children:"Portfolio Performance"}),a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1.5rem"},children:[a.jsxs("div",{children:[a.jsx("p",{style:{color:Mn.textDim,fontSize:"0.9rem"},children:"Total Assets Under Management"}),a.jsx("p",{style:{color:Mn.text,fontSize:"2.5rem",fontWeight:"bold"},children:rP(g.totalCurrentValue)})]}),a.jsx("div",{style:{height:"200px",display:"flex",alignItems:"flex-end",gap:"10px"},children:[40,65,55,80,95,75,100].map((w,S)=>a.jsx("div",{style:{flex:1,height:`${w}%`,backgroundColor:Mn.secondary,borderRadius:"4px 4px 0 0",opacity:.7}},S))}),a.jsx("p",{style:{color:Mn.textDim,fontSize:"0.8rem",textAlign:"center"},children:"7-Day Quantum Market Trend"})]})]}),a.jsxs("div",{style:{backgroundColor:Mn.card,padding:"2rem",borderRadius:"12px",border:`1px solid ${Mn.border}`},children:[a.jsx("h3",{style:{color:Mn.secondary,marginBottom:"1.5rem"},children:"AI Allocation Targets"}),a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1rem"},children:Object.entries(g.aiOptimizedAllocation).map(([w,S])=>a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"0.5rem"},children:[a.jsx("span",{style:{color:Mn.text,fontSize:"0.9rem"},children:w}),a.jsxs("span",{style:{color:Mn.secondary,fontSize:"0.9rem"},children:[S,"%"]})]}),a.jsx("div",{style:{height:"8px",backgroundColor:Mn.background,borderRadius:"4px",overflow:"hidden"},children:a.jsx("div",{style:{width:`${S}%`,height:"100%",backgroundColor:Mn.secondary}})})]},w))})]})]}),v=()=>a.jsxs("div",{style:{backgroundColor:Mn.card,padding:"2rem",borderRadius:"12px",border:`1px solid ${Mn.border}`},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"2rem"},children:[a.jsx("h3",{style:{color:Mn.secondary},children:"Quantum Homomorphic Vault"}),a.jsx("button",{style:{padding:"0.5rem 1rem",backgroundColor:Mn.secondary,color:Mn.primary,border:"none",borderRadius:"4px",fontWeight:"bold",cursor:"pointer"},children:"+ ADD INTEGRATION"})]}),a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{textAlign:"left",borderBottom:`1px solid ${Mn.border}`},children:[a.jsx("th",{style:{padding:"1rem",color:Mn.textDim},children:"SERVICE"}),a.jsx("th",{style:{padding:"1rem",color:Mn.textDim},children:"ENCRYPTED KEY (HOMOMORPHIC)"}),a.jsx("th",{style:{padding:"1rem",color:Mn.textDim},children:"STATUS"}),a.jsx("th",{style:{padding:"1rem",color:Mn.textDim},children:"ACTIONS"})]})}),a.jsx("tbody",{children:o.map(w=>a.jsxs("tr",{style:{borderBottom:`1px solid ${Mn.border}`},children:[a.jsx("td",{style:{padding:"1rem",color:Mn.text,fontWeight:"bold"},children:w.serviceName}),a.jsx("td",{style:{padding:"1rem",color:Mn.textDim,fontFamily:"monospace",fontSize:"0.8rem"},children:w.encryptedKey}),a.jsx("td",{style:{padding:"1rem"},children:a.jsx("span",{style:{padding:"0.2rem 0.5rem",backgroundColor:Mn.gain,color:Mn.primary,borderRadius:"4px",fontSize:"0.7rem",fontWeight:"bold"},children:w.status})}),a.jsx("td",{style:{padding:"1rem"},children:a.jsx("button",{onClick:()=>{const S=uA.decrypt(w.encryptedKey);alert(`DEMO ONLY: Decrypted Key: ${S}`),h("VAULT_KEY_DECRYPTION",`User manually decrypted key for ${w.serviceName}`,"WARN")},style:{background:"none",border:`1px solid ${Mn.secondary}`,color:Mn.secondary,padding:"0.3rem 0.6rem",borderRadius:"4px",cursor:"pointer",fontSize:"0.7rem"},children:"REVEAL"})})]},w.id))})]})]}),b=()=>a.jsxs("div",{style:{backgroundColor:Mn.card,padding:"2rem",borderRadius:"12px",border:`1px solid ${Mn.border}`},children:[a.jsx("h3",{style:{color:Mn.secondary,marginBottom:"1.5rem"},children:"Immutable Audit Ledger"}),a.jsx("div",{style:{maxHeight:"600px",overflowY:"auto"},children:n.map(w=>a.jsxs("div",{style:{padding:"1rem",borderBottom:`1px solid ${Mn.border}`,display:"flex",gap:"1.5rem",backgroundColor:w.severity==="CRITICAL"?"rgba(194, 54, 22, 0.1)":"transparent"},children:[a.jsx("div",{style:{color:Mn.textDim,fontSize:"0.75rem",minWidth:"150px"},children:new Date(w.timestamp).toLocaleString()}),a.jsxs("div",{style:{flex:1},children:[a.jsx("div",{style:{color:w.severity==="CRITICAL"?Mn.critical:Mn.secondary,fontWeight:"bold",fontSize:"0.9rem"},children:w.action}),a.jsx("div",{style:{color:Mn.text,fontSize:"0.85rem"},children:w.details})]}),a.jsx("div",{style:{color:Mn.textDim,fontSize:"0.75rem"},children:w.ipAddress})]},w.id))})]});return a.jsxs("div",{style:{backgroundColor:Mn.background,color:Mn.text,minHeight:"100vh",fontFamily:"'Inter', sans-serif",padding:"0 0 100px 0"},children:[a.jsxs("nav",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"1.5rem 3rem",backgroundColor:Mn.primary,borderBottom:`1px solid ${Mn.border}`,position:"sticky",top:0,zIndex:100},children:[a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[a.jsx("div",{style:{width:"40px",height:"40px",backgroundColor:Mn.secondary,borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",color:Mn.primary,fontSize:"1.5rem"},children:"Q"}),a.jsxs("h1",{style:{fontSize:"1.5rem",fontWeight:"bold",letterSpacing:"1px",color:Mn.text},children:["QUANTUM ",a.jsx("span",{style:{color:Mn.secondary},children:"FINANCIAL"})]})]}),a.jsx("div",{style:{display:"flex",gap:"2rem"},children:["inventory","analytics","vault","audit"].map(w=>a.jsx("button",{onClick:()=>p(w),style:{background:"none",border:"none",color:d===w?Mn.secondary:Mn.textDim,fontWeight:"bold",cursor:"pointer",fontSize:"0.9rem",textTransform:"uppercase",borderBottom:d===w?`2px solid ${Mn.secondary}`:"2px solid transparent",paddingBottom:"0.5rem",transition:"all 0.3s"},children:w},w))}),a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[a.jsxs("div",{style:{textAlign:"right"},children:[a.jsx("p",{style:{fontSize:"0.7rem",color:Mn.textDim},children:"SECURE SESSION"}),a.jsx("p",{style:{fontSize:"0.9rem",fontWeight:"bold",color:Mn.gain},children:"ACTIVE"})]}),a.jsx("div",{style:{width:"40px",height:"40px",borderRadius:"50%",backgroundColor:Mn.border,border:`2px solid ${Mn.secondary}`}})]})]}),a.jsxs("main",{style:{padding:"3rem"},children:[a.jsxs("header",{style:{marginBottom:"3rem"},children:[a.jsxs("h2",{style:{fontSize:"2.5rem",color:Mn.text,marginBottom:"0.5rem"},children:[d==="inventory"&&"Global Asset Inventory",d==="analytics"&&"Quantum Intelligence Dashboard",d==="vault"&&"Secure Integration Vault",d==="audit"&&"Compliance & Audit Trail"]}),a.jsx("p",{style:{color:Mn.textDim,fontSize:"1.1rem"},children:"Welcome to your Golden Ticket experience. Kick the tires of the world's most advanced financial engine."})]}),d==="inventory"&&y(),d==="analytics"&&x(),d==="vault"&&v(),d==="audit"&&b()]}),s&&a.jsx("div",{style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"rgba(2, 12, 27, 0.95)",zIndex:1500,display:"flex",justifyContent:"center",alignItems:"center",padding:"2rem"},children:a.jsxs("div",{style:{backgroundColor:Mn.card,width:"1000px",maxHeight:"90vh",borderRadius:"16px",border:`1px solid ${Mn.border}`,overflow:"hidden",display:"flex",boxShadow:"0 0 50px rgba(0,0,0,0.5)"},children:[a.jsxs("div",{style:{flex:1,position:"relative"},children:[a.jsx("img",{src:s.imageUrl,alt:s.name,style:{width:"100%",height:"100%",objectFit:"cover"}}),a.jsx("button",{onClick:()=>l(null),style:{position:"absolute",top:"20px",left:"20px",backgroundColor:Mn.primary,color:Mn.text,border:"none",borderRadius:"50%",width:"40px",height:"40px",cursor:"pointer",fontSize:"1.2rem"},children:"✕"})]}),a.jsxs("div",{style:{flex:1,padding:"3rem",overflowY:"auto"},children:[a.jsx("h2",{style:{color:Mn.secondary,fontSize:"2rem",marginBottom:"1rem"},children:s.name}),a.jsx("p",{style:{color:Mn.textDim,marginBottom:"2rem",lineHeight:"1.6"},children:s.description}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"2rem",marginBottom:"2rem"},children:[a.jsxs("div",{children:[a.jsx("p",{style:{color:Mn.textDim,fontSize:"0.8rem"},children:"ACQUISITION PRICE"}),a.jsx("p",{style:{color:Mn.text,fontSize:"1.2rem",fontWeight:"bold"},children:rP(s.acquisitionPrice)})]}),a.jsxs("div",{children:[a.jsx("p",{style:{color:Mn.textDim,fontSize:"0.8rem"},children:"CURRENT VALUATION"}),a.jsx("p",{style:{color:Mn.secondary,fontSize:"1.2rem",fontWeight:"bold"},children:rP(s.currentValuation)})]})]}),a.jsxs("div",{style:{backgroundColor:Mn.background,padding:"1.5rem",borderRadius:"8px",marginBottom:"2rem"},children:[a.jsx("h4",{style:{color:Mn.text,marginBottom:"1rem",fontSize:"0.9rem"},children:"AI VALUATION INSIGHT"}),a.jsxs("p",{style:{color:Mn.textDim,fontSize:"0.85rem"},children:["Model: ",s.aiValuations[0].modelName,a.jsx("br",{}),"Confidence: ",(s.aiValuations[0].confidenceScore*100).toFixed(1),"%",a.jsx("br",{}),"Drivers: ",s.aiValuations[0].keyDrivers.join(", ")]})]}),a.jsx("button",{onClick:()=>{u({active:!0,amount:s.currentValuation}),h("STRIPE_CHECKOUT_INITIATED",`User initiated purchase for ${s.name}`)},style:{width:"100%",padding:"1.2rem",backgroundColor:Mn.secondary,color:Mn.primary,border:"none",borderRadius:"8px",fontWeight:"bold",fontSize:"1.1rem",cursor:"pointer"},children:"ACQUIRE ADDITIONAL SHARES"})]})]})}),c.active&&a.jsx(Vhn,{amount:c.amount,onPaymentSuccess:()=>{u({active:!1,amount:0}),h("STRIPE_PAYMENT_COMPLETED",`Successfully processed payment for ${rP(c.amount)}`)},onCancel:()=>u({active:!1,amount:0})}),a.jsx(Uhn,{onAction:m}),a.jsxs("footer",{style:{position:"fixed",bottom:0,left:0,width:"100%",backgroundColor:Mn.primary,borderTop:`1px solid ${Mn.border}`,padding:"0.75rem 2rem",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"0.75rem",color:Mn.textDim,zIndex:100},children:[a.jsxs("div",{style:{display:"flex",gap:"2rem"},children:[a.jsxs("span",{children:["SYSTEM: ",a.jsx("span",{style:{color:Mn.gain},children:"OPTIMAL"})]}),a.jsxs("span",{children:["ENCRYPTION: ",a.jsx("span",{style:{color:Mn.secondary},children:"QUANTUM-HOMOMORPHIC"})]}),a.jsxs("span",{children:["AUDIT STORAGE: ",a.jsx("span",{style:{color:Mn.secondary},children:"IMMUTABLE"})]})]}),a.jsx("div",{children:"© 2024 QUANTUM FINANCIAL GROUP • GLOBAL ASSET DEMO v4.2.0"})]})]})},Ghn=[{name:"Soft Landing",description:"Gradual inflation reduction, stable growth",shockPercentage:2,volatilityShock:-5,probability:.45},{name:"Recession",description:"GDP contraction, rate cuts",shockPercentage:-15,volatilityShock:25,probability:.25},{name:"Stagflation",description:"High inflation, low growth",shockPercentage:-8,volatilityShock:15,probability:.15},{name:"Tech Boom",description:"AI driven productivity surge",shockPercentage:12,volatilityShock:5,probability:.1},{name:"Black Swan",description:"Geopolitical crisis or liquidity event",shockPercentage:-25,volatilityShock:50,probability:.05}],qhn=[{id:"algo-001",name:"PhotonArb",strategy:"Arbitrage",status:"Running",pnl:12540,latency:.5,fillRate:98.2,uptime:"72h 15m"},{id:"algo-002",name:"LiquiMax",strategy:"Market Making",status:"Running",pnl:8320,latency:1.1,fillRate:99.8,uptime:"120h 02m"},{id:"algo-003",name:"StealthTWAP",strategy:"TWAP",status:"Stopped",pnl:-1500,latency:2.5,fillRate:100,uptime:"48h (Offline)"},{id:"algo-004",name:"VortexSweep",strategy:"Liquidity Sweeping",status:"Error",pnl:250,latency:.8,fillRate:75.4,uptime:"5m (Stalled)"},{id:"algo-005",name:"Q-Alpha Prime",strategy:"Quantum Alpha",status:"Initializing",pnl:0,latency:.01,fillRate:0,uptime:"1m"}],Khn=[{id:"n1",source:"Reuters",headline:"Fed Chair signals potential rate hike pause, markets rally.",sentiment:"Positive",timestamp:"2m ago"},{id:"n2",source:"Bloomberg",headline:"Geopolitical tensions in South China Sea increase oil price volatility.",sentiment:"Negative",timestamp:"5m ago"},{id:"n3",source:"WSJ",headline:"Quantum Computing firm announces breakthrough in cryptographic security.",sentiment:"Neutral",timestamp:"15m ago"},{id:"n4",source:"CoinDesk",headline:"Major exchange faces liquidity crisis, BTC futures drop 5%.",sentiment:"Negative",timestamp:"22m ago"}],Yhn=(e,t)=>e.reduce((r,o)=>{const i=o.isLong?1:-1,s=o.strike?t/o.strike:1,l=i*o.quantity*(o.type==="Future"?1:.5*s),c=i*o.quantity*(o.type==="Future"?0:.05/s),u=i*o.quantity*(o.type==="Future"?0:-.1*o.iv),d=i*o.quantity*(o.type==="Future"?0:.2*Math.sqrt(o.iv)),p=i*o.quantity*(o.type==="Future"?.01:.05);return{delta:r.delta+l,gamma:r.gamma+c,theta:r.theta+u,vega:r.vega+d,rho:r.rho+p,vanna:r.vanna+l*-.01,charm:r.charm+l*.02,vomma:r.vomma+d*.1,speed:r.speed+c*.1,zomma:r.zomma+c*d*.01,color:r.color+c*u*.01,gein:r.gein+Math.abs(l*d)/(Math.abs(c)+.01)*Math.sin(t/1e3)}},{delta:0,gamma:0,theta:0,vega:0,rho:0,vanna:0,charm:0,vomma:0,speed:0,zomma:0,color:0,gein:0}),Xhn=(e,t,n)=>{const r=[],o=new Date().toISOString();return Math.abs(e.gein)>10&&r.push({id:`GEMINI-${Math.random().toString(36).substr(2,9)}`,timestamp:o,category:"Gemini",severity:"Nexus",message:`GEIN anomaly detected (${e.gein.toFixed(2)}). Cross-asset correlation matrix is shifting. Gemini 2.5 Pro suggests a paradigm shift in volatility structures. Re-evaluating all positions.`,actionable:!0,confidenceScore:.99}),Math.abs(e.delta)>500&&r.push({id:`RISK-${Math.random().toString(36).substr(2,9)}`,timestamp:o,category:"Risk",severity:"High",message:`Delta exposure is critically high (${e.delta.toFixed(2)}). AI suggests hedging with OTM Puts on SPX.`,actionable:!0,confidenceScore:.98}),e.gamma<-50&&r.push({id:`RISK-${Math.random().toString(36).substr(2,9)}`,timestamp:o,category:"Risk",severity:"Critical",message:"Negative Gamma exposure detected. Sharp market moves will accelerate losses. Recommend reducing short option exposure.",actionable:!0,confidenceScore:.95}),e.vega>100&&e.theta>-50&&r.push({id:`OPP-${Math.random().toString(36).substr(2,9)}`,timestamp:o,category:"Opportunity",severity:"Medium",message:"Portfolio is long volatility with manageable decay. AI detects favorable conditions for earnings season plays.",actionable:!0,confidenceScore:.85}),r.push({id:`ALPHA-${Math.random().toString(36).substr(2,9)}`,timestamp:o,category:"AlphaSignal",severity:"Medium",message:"Neural net detects anomalous order flow in NDX futures. Potential for short-term upside momentum.",actionable:!0,confidenceScore:.78}),t.length>10&&r.push({id:`COMP-${Math.random().toString(36).substr(2,9)}`,timestamp:o,category:"Compliance",severity:"Low",message:"Position count approaching desk limits. Ensure all tickets are reconciled in the OMS.",actionable:!1,confidenceScore:1}),r},Qhn=(e,t)=>{const n=[-150,150],r=5,o=[];for(let i=n[0];i<=n[1];i+=r){const s=t+i,l=e.reduce((p,h)=>{let m=0;h.type==="Call"&&h.strike!==null?m=Math.max(0,s-h.strike):h.type==="Put"&&h.strike!==null?m=Math.max(0,h.strike-s):h.type==="Future"&&(m=s-t);let g=(m-(h.type!=="Future"?h.premium:0))*h.quantity;return p+g*(h.isLong?1:-1)},0),u=i/50,d=1/Math.sqrt(2*Math.PI)*Math.exp(-.5*u*u);o.push({underlyingPrice:s,pl:parseFloat(l.toFixed(2)),probability:d})}return o},Jhn=[{id:1,type:"Call",asset:"SPX_FUT",strike:4500,expiry:"2024-09-30",premium:100,quantity:10,isLong:!0,iv:15,delta:.5,gamma:.02,theta:-.5,vega:.8,rho:.01},{id:2,type:"Put",asset:"SPX_FUT",strike:4400,expiry:"2024-09-30",premium:80,quantity:10,isLong:!1,iv:16,delta:-.4,gamma:.02,theta:-.6,vega:.9,rho:-.01},{id:3,type:"Future",asset:"SPX_FUT",strike:null,expiry:"2024-12-15",premium:0,quantity:5,isLong:!0,iv:0,delta:1,gamma:0,theta:0,vega:0,rho:.05}],FTe={name:"Alexandra Chen",role:"Senior Volatility Trader"},Jb=({icon:e,label:t,active:n,onClick:r})=>a.jsxs("button",{onClick:r,className:`w-full flex items-center space-x-3 px-4 py-3 rounded-lg transition-all duration-200 ${n?"bg-blue-600 text-white shadow-lg shadow-blue-900/50":"text-gray-400 hover:bg-gray-800 hover:text-white"}`,children:[a.jsx("span",{className:"text-xl",children:e}),a.jsx("span",{className:"font-medium tracking-wide",children:t})]}),a_=({title:e,value:t,change:n,subtext:r,color:o="blue"})=>a.jsxs("div",{className:"bg-gray-800/50 backdrop-blur-sm border border-gray-700 rounded-xl p-5 shadow-xl hover:border-gray-600 transition-all duration-300",children:[a.jsxs("div",{className:"flex justify-between items-start mb-2",children:[a.jsx("h3",{className:"text-gray-400 text-xs uppercase tracking-wider font-semibold",children:e}),n!==void 0&&a.jsxs("span",{className:`text-xs font-bold px-2 py-1 rounded-full ${n>=0?"bg-green-900/50 text-green-400":"bg-red-900/50 text-red-400"}`,children:[n>0?"+":"",n,"%"]})]}),a.jsx("div",{className:`text-3xl font-bold text-${o}-400 mb-1`,children:t}),r&&a.jsx("div",{className:"text-xs text-gray-500",children:r})]}),Zhn=({insight:e})=>{const n={Risk:"red",Opportunity:"green",Compliance:"yellow",Macro:"purple",AlphaSignal:"cyan",Gemini:"indigo"}[e.category];return a.jsxs("div",{className:`border-l-4 border-${n}-500 bg-gray-800/80 p-4 rounded-r-lg mb-3 shadow-lg animate-fade-in`,children:[a.jsxs("div",{className:"flex justify-between items-center mb-1",children:[a.jsxs("span",{className:`text-xs font-bold uppercase text-${n}-400`,children:[e.category," ",e.severity==="Nexus"?"⚡":""]}),a.jsx("span",{className:"text-xs text-gray-500",children:new Date(e.timestamp).toLocaleTimeString()})]}),a.jsx("p",{className:"text-sm text-gray-200 font-medium leading-relaxed",children:e.message}),a.jsxs("div",{className:"mt-3 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"h-1.5 w-16 bg-gray-700 rounded-full overflow-hidden",children:a.jsx("div",{className:`h-full bg-${n}-500`,style:{width:`${e.confidenceScore*100}%`}})}),a.jsxs("span",{className:"text-xs text-gray-500",children:["AI Confidence: ",(e.confidenceScore*100).toFixed(0),"%"]})]}),e.actionable&&a.jsx("button",{className:"text-xs bg-blue-600 hover:bg-blue-500 text-white px-3 py-1 rounded transition-colors",children:"Execute AI Suggestion"})]})]})},emn=()=>{const[e,t]=f.useState("Dashboard"),[n,r]=f.useState(Jhn),[o,i]=f.useState(4450),[s,l]=f.useState(""),[c,u]=f.useState([{id:"1",sender:"SystemAI",text:"Welcome back, Alexandra. Market volatility is elevated today. I have detected 3 new arbitrage opportunities.",timestamp:new Date}]),[d,p]=f.useState(!1),[h,m]=f.useState("You are an elite quantitative analyst AI, named Quant-OS. Provide terse, data-driven, and actionable insights for a derivatives trader. You have access to all market data and portfolio positions."),[g,y]=f.useState(.5),[x,v]=f.useState(!0),b=f.useMemo(()=>Yhn(n,o),[n,o]),w=f.useMemo(()=>Qhn(n,o),[n,o]),S=f.useMemo(()=>Xhn(b,n),[b,n]),C=()=>{if(!s.trim())return;const z={id:Date.now().toString(),sender:"User",text:s,timestamp:new Date};u(V=>[...V,z]),l(""),p(!0),setTimeout(()=>{const V=["Analyzing liquidity pools... Found sufficient depth for execution.","Running Monte Carlo simulations on your proposed adjustment... Probability of profit increased by 4.2%.","Warning: This trade increases your tail risk significantly. Suggest buying OTM wings.","Optimizing for Theta decay. This structure looks efficient.","Correlating with macro events... CPI data release in 2 days suggests hedging Delta."],B=V[Math.floor(Math.random()*V.length)],G={id:(Date.now()+1).toString(),sender:"SystemAI",text:B,timestamp:new Date};u(H=>[...H,G]),p(!1)},1500)},N=()=>{const z={id:Date.now(),type:"Call",asset:"SPX_FUT",strike:o,expiry:"2024-12-31",premium:50,quantity:1,isLong:!0,iv:20,delta:.5,gamma:.01,theta:-.2,vega:.4,rho:.02};r([...n,z])},j=z=>{r(n.filter(V=>V.id!==z))},I=()=>a.jsxs("div",{className:"grid grid-cols-12 gap-6 h-full overflow-y-auto pr-2",children:[a.jsxs("div",{className:"col-span-12 grid grid-cols-6 gap-6",children:[a.jsx(a_,{title:"Net Liquidation Value",value:"$12,450,230.00",change:1.2,subtext:"Daily P&L: +$145,200",color:"green"}),a.jsx(a_,{title:"Portfolio Delta",value:b.delta.toFixed(2),change:-5.4,subtext:"Net Long Exposure",color:"blue"}),a.jsx(a_,{title:"Portfolio Vega",value:b.vega.toFixed(2),change:2.1,subtext:"Volatility Sensitivity",color:"purple"}),a.jsx(a_,{title:"GEIN Score",value:b.gein.toFixed(4),subtext:"Emergent Intelligence Nexus",color:"indigo"}),a.jsx(a_,{title:"AI Risk Score",value:`${(100-Math.abs(b.delta)/10).toFixed(1)}/100`,subtext:"Optimized for current regime",color:"emerald"}),a.jsx(a_,{title:"Cognitive Load",value:"18.4%",change:3.1,subtext:"Biometric feedback nominal",color:"cyan"})]}),a.jsxs("div",{className:"col-span-8 bg-gray-800 rounded-xl shadow-2xl border border-gray-700 flex flex-col",children:[a.jsxs("div",{className:"p-4 border-b border-gray-700 flex justify-between items-center",children:[a.jsx("h2",{className:"text-lg font-semibold text-white",children:"P&L Simulation & Probability Surface"}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("button",{className:"px-3 py-1 text-xs bg-gray-700 rounded hover:bg-gray-600 text-gray-300",children:"2D Curve"}),a.jsx("button",{className:"px-3 py-1 text-xs bg-gray-900 rounded text-gray-500",children:"3D Surface"})]})]}),a.jsxs("div",{className:"flex-1 p-6 relative flex items-end justify-center space-x-1",children:[w.filter((z,V)=>V%2===0).map((z,V)=>{const B=Math.min(Math.abs(z.pl)/100,100),G=z.pl>=0;return a.jsxs("div",{className:"flex flex-col items-center group relative w-full",children:[a.jsx("div",{className:`w-2 md:w-3 rounded-t transition-all duration-500 ${G?"bg-emerald-500/80 hover:bg-emerald-400":"bg-rose-500/80 hover:bg-rose-400"}`,style:{height:`${B}%`,minHeight:"4px"}}),a.jsx("div",{className:"h-[1px] w-full bg-gray-600 absolute bottom-0"}),a.jsxs("div",{className:"absolute bottom-full mb-2 hidden group-hover:block z-10 bg-black text-xs p-2 rounded border border-gray-600 whitespace-nowrap",children:["Price: ",z.underlyingPrice,a.jsx("br",{}),"P&L: ",z.pl,a.jsx("br",{}),"Prob: ",(z.probability*100).toFixed(2),"%"]})]},V)}),a.jsxs("div",{className:"absolute top-4 left-4 text-gray-500 text-xs font-mono",children:["AI PROJECTION: ",b.delta>0?"BULLISH":"BEARISH"," SKEW DETECTED"]})]})]}),a.jsxs("div",{className:"col-span-4 flex flex-col space-y-6",children:[a.jsxs("div",{className:"bg-gray-800 rounded-xl shadow-2xl border border-gray-700 flex-1 flex flex-col",children:[a.jsxs("div",{className:"p-4 border-b border-gray-700 flex justify-between items-center",children:[a.jsxs("h2",{className:"text-lg font-semibold text-blue-400 flex items-center",children:[a.jsx("span",{className:"mr-2",children:"✧"})," AI Strategy Engine"]}),a.jsx("span",{className:"text-xs bg-blue-900/30 text-blue-400 px-2 py-1 rounded border border-blue-800",children:"Live"})]}),a.jsxs("div",{className:"p-4 overflow-y-auto flex-1 custom-scrollbar",children:[S.map(z=>a.jsx(Zhn,{insight:z},z.id)),S.length===0&&a.jsx("p",{className:"text-gray-500 text-center mt-10",children:"System nominal. No critical insights generated."})]})]}),a.jsxs("div",{className:"bg-gray-800 rounded-xl shadow-2xl border border-gray-700 p-4",children:[a.jsx("h3",{className:"text-gray-400 text-xs uppercase font-bold mb-4",children:"Higher-Order Sensitivities"}),a.jsxs("div",{className:"grid grid-cols-3 gap-x-6 gap-y-3",children:[a.jsxs("div",{className:"flex justify-between border-b border-gray-700/50 pb-1",children:[a.jsx("span",{className:"text-gray-400 text-sm",children:"Vanna"}),a.jsx("span",{className:"text-gray-200 font-mono",children:b.vanna.toFixed(2)})]}),a.jsxs("div",{className:"flex justify-between border-b border-gray-700/50 pb-1",children:[a.jsx("span",{className:"text-gray-400 text-sm",children:"Charm"}),a.jsx("span",{className:"text-gray-200 font-mono",children:b.charm.toFixed(2)})]}),a.jsxs("div",{className:"flex justify-between border-b border-gray-700/50 pb-1",children:[a.jsx("span",{className:"text-gray-400 text-sm",children:"Vomma"}),a.jsx("span",{className:"text-gray-200 font-mono",children:b.vomma.toFixed(2)})]}),a.jsxs("div",{className:"flex justify-between border-b border-gray-700/50 pb-1",children:[a.jsx("span",{className:"text-gray-400 text-sm",children:"Speed"}),a.jsx("span",{className:"text-gray-200 font-mono",children:b.speed.toFixed(2)})]}),a.jsxs("div",{className:"flex justify-between border-b border-gray-700/50 pb-1",children:[a.jsx("span",{className:"text-gray-400 text-sm",children:"Zomma"}),a.jsx("span",{className:"text-gray-200 font-mono",children:b.zomma.toFixed(2)})]}),a.jsxs("div",{className:"flex justify-between border-b border-gray-700/50 pb-1",children:[a.jsx("span",{className:"text-gray-400 text-sm",children:"Color"}),a.jsx("span",{className:"text-gray-200 font-mono",children:b.color.toFixed(2)})]})]})]})]}),a.jsxs("div",{className:"col-span-12 bg-gray-800 rounded-xl shadow-2xl border border-gray-700 p-6",children:[a.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:"AI Market Scenario Stress Testing"}),a.jsx("div",{className:"grid grid-cols-5 gap-4",children:Ghn.map((z,V)=>a.jsxs("div",{className:"bg-gray-900/50 p-4 rounded-lg border border-gray-700 hover:border-blue-500 transition-colors cursor-pointer group",children:[a.jsxs("div",{className:"flex justify-between items-center mb-2",children:[a.jsx("h4",{className:"font-bold text-gray-200",children:z.name}),a.jsxs("span",{className:"text-xs text-gray-500",children:[(z.probability*100).toFixed(0),"% Prob"]})]}),a.jsx("p",{className:"text-xs text-gray-400 mb-3 h-8",children:z.description}),a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"Spot Shock"}),a.jsxs("span",{className:z.shockPercentage>0?"text-green-400":"text-red-400",children:[z.shockPercentage,"%"]})]}),a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"Vol Shock"}),a.jsxs("span",{className:"text-yellow-400",children:["+",z.volatilityShock,"%"]})]}),a.jsx("div",{className:"mt-2 pt-2 border-t border-gray-800",children:a.jsxs("span",{className:"text-xs font-bold text-blue-400 group-hover:text-blue-300",children:["Est. P&L: $",(Math.random()*1e5*(Math.random()>.5?1:-1)).toFixed(2)]})})]})]},V))})]})]}),_=()=>a.jsxs("div",{className:"flex flex-col h-full bg-gray-800 rounded-xl border border-gray-700 overflow-hidden",children:[a.jsxs("div",{className:"p-4 border-b border-gray-700 bg-gray-800 flex justify-between items-center",children:[a.jsx("h2",{className:"text-xl font-bold text-white",children:"Institutional Order Entry"}),a.jsxs("div",{className:"flex space-x-4 text-sm",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:"text-gray-400",children:"Buying Power:"}),a.jsx("span",{className:"text-green-400 font-mono",children:"$45,200,000"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:"text-gray-400",children:"Margin Util:"}),a.jsx("span",{className:"text-yellow-400 font-mono",children:"32%"})]})]})]}),a.jsx("div",{className:"flex-1 overflow-auto",children:a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{className:"bg-gray-900 sticky top-0 z-10",children:a.jsxs("tr",{children:[a.jsx("th",{className:"p-4 text-xs font-bold text-gray-500 uppercase tracking-wider",children:"ID"}),a.jsx("th",{className:"p-4 text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Instrument"}),a.jsx("th",{className:"p-4 text-xs font-bold text-gray-500 uppercase tracking-wider",children:"Side"}),a.jsx("th",{className:"p-4 text-xs font-bold text-gray-500 uppercase tracking-wider text-right",children:"Strike"}),a.jsx("th",{className:"p-4 text-xs font-bold text-gray-500 uppercase tracking-wider text-right",children:"Expiry"}),a.jsx("th",{className:"p-4 text-xs font-bold text-gray-500 uppercase tracking-wider text-right",children:"Qty"}),a.jsx("th",{className:"p-4 text-xs font-bold text-gray-500 uppercase tracking-wider text-right",children:"Delta"}),a.jsx("th",{className:"p-4 text-xs font-bold text-gray-500 uppercase tracking-wider text-right",children:"Gamma"}),a.jsx("th",{className:"p-4 text-xs font-bold text-gray-500 uppercase tracking-wider text-right",children:"Vega"}),a.jsx("th",{className:"p-4 text-xs font-bold text-gray-500 uppercase tracking-wider text-right",children:"Theta"}),a.jsx("th",{className:"p-4 text-xs font-bold text-gray-500 uppercase tracking-wider text-right",children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-700",children:n.map(z=>a.jsxs("tr",{className:"hover:bg-gray-700/50 transition-colors group",children:[a.jsx("td",{className:"p-4 text-sm text-gray-400 font-mono",children:z.id}),a.jsxs("td",{className:"p-4 text-sm text-white font-bold",children:[z.asset," ",a.jsx("span",{className:"text-xs font-normal text-gray-500 ml-1",children:z.type})]}),a.jsx("td",{className:"p-4",children:a.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${z.isLong?"bg-green-900/30 text-green-400 border border-green-800":"bg-red-900/30 text-red-400 border border-red-800"}`,children:z.isLong?"LONG":"SHORT"})}),a.jsx("td",{className:"p-4 text-sm text-gray-300 text-right font-mono",children:z.strike??"MKT"}),a.jsx("td",{className:"p-4 text-sm text-gray-300 text-right",children:z.expiry}),a.jsx("td",{className:"p-4 text-sm text-white text-right font-bold",children:z.quantity}),a.jsx("td",{className:"p-4 text-sm text-gray-400 text-right font-mono",children:z.delta.toFixed(2)}),a.jsx("td",{className:"p-4 text-sm text-gray-400 text-right font-mono",children:z.gamma.toFixed(3)}),a.jsx("td",{className:"p-4 text-sm text-gray-400 text-right font-mono",children:z.vega.toFixed(2)}),a.jsx("td",{className:"p-4 text-sm text-gray-400 text-right font-mono",children:z.theta.toFixed(2)}),a.jsx("td",{className:"p-4 text-right",children:a.jsx("button",{onClick:()=>j(z.id),className:"text-gray-500 hover:text-red-500 transition-colors",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})})})})]},z.id))})]})}),a.jsxs("div",{className:"p-4 border-t border-gray-700 bg-gray-800 flex justify-end space-x-4",children:[a.jsxs("button",{onClick:N,className:"px-6 py-3 bg-blue-600 hover:bg-blue-500 text-white font-bold rounded shadow-lg shadow-blue-900/50 transition-all transform hover:scale-105 flex items-center",children:[a.jsx("span",{className:"mr-2",children:"+"})," Add Strategy Leg"]}),a.jsxs("button",{className:"px-6 py-3 bg-emerald-600 hover:bg-emerald-500 text-white font-bold rounded shadow-lg shadow-emerald-900/50 transition-all transform hover:scale-105 flex items-center",children:[a.jsx("span",{className:"mr-2",children:"✓"})," Execute Portfolio Rebalance"]})]})]}),T=()=>a.jsxs("div",{className:"flex h-full space-x-6",children:[a.jsxs("div",{className:"w-2/3 bg-gray-800 rounded-xl border border-gray-700 flex flex-col shadow-2xl",children:[a.jsxs("div",{className:"p-4 border-b border-gray-700 flex justify-between items-center bg-gradient-to-r from-gray-800 to-gray-900",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full animate-pulse"}),a.jsx("h2",{className:"text-lg font-bold text-white",children:"Gemini 2.5 Core Interface"})]}),a.jsx("span",{className:"text-xs text-gray-500 font-mono",children:"Gemini 2.5 Pro"})]}),a.jsxs("div",{className:"flex-1 p-6 overflow-y-auto space-y-4 bg-gray-900/50",children:[c.map(z=>a.jsx("div",{className:`flex ${z.sender==="User"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[80%] p-4 rounded-2xl ${z.sender==="User"?"bg-blue-600 text-white rounded-br-none":"bg-gray-700 text-gray-200 rounded-bl-none"}`,children:[a.jsx("p",{className:"text-sm leading-relaxed",children:z.text}),a.jsx("span",{className:"text-[10px] opacity-50 mt-2 block text-right",children:z.timestamp.toLocaleTimeString()})]})},z.id)),d&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-gray-700 p-4 rounded-2xl rounded-bl-none flex space-x-2 items-center",children:[a.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce"}),a.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce delay-100"}),a.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded-full animate-bounce delay-200"})]})})]}),a.jsx("div",{className:"p-4 border-t border-gray-700 bg-gray-800",children:a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:s,onChange:z=>l(z.target.value),onKeyPress:z=>z.key==="Enter"&&C(),placeholder:"Interact with Gemini 2.5 Pro...",className:"w-full bg-gray-900 border border-gray-600 rounded-lg pl-12 pr-12 py-4 text-white focus:ring-2 focus:ring-blue-500 focus:border-transparent outline-none transition-all"}),a.jsx("div",{className:"absolute left-2 top-2 bottom-2 flex items-center",children:a.jsx("button",{className:"p-2 text-gray-400 hover:text-white transition-colors",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"})})})}),a.jsx("button",{onClick:C,className:"absolute right-2 top-2 bottom-2 px-4 bg-blue-600 hover:bg-blue-500 text-white rounded-md transition-colors",children:"→"})]})})]}),a.jsxs("div",{className:"w-1/3 flex flex-col space-y-6",children:[a.jsxs("div",{className:"bg-gray-800 rounded-xl border border-gray-700 p-6 shadow-xl",children:[a.jsx("h3",{className:"text-white font-bold mb-4",children:"Core Configuration"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-400 uppercase font-bold",children:"System Instruction"}),a.jsx("textarea",{value:h,onChange:z=>m(z.target.value),rows:4,className:"w-full mt-1 bg-gray-900 border border-gray-600 rounded p-2 text-white text-sm font-mono text-xs leading-relaxed focus:ring-1 focus:ring-blue-500 outline-none"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"text-xs text-gray-400 uppercase font-bold",children:["Temperature: ",g.toFixed(2)]}),a.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:g,onChange:z=>y(parseFloat(z.target.value)),className:"w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer"})]}),a.jsx("div",{className:"pt-2",children:a.jsxs("label",{className:"flex items-center cursor-pointer",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"checkbox",className:"sr-only",checked:x,onChange:()=>v(!x)}),a.jsx("div",{className:"block bg-gray-600 w-10 h-6 rounded-full"}),a.jsx("div",{className:`dot absolute left-1 top-1 bg-white w-4 h-4 rounded-full transition-transform ${x?"translate-x-4":""}`})]}),a.jsx("div",{className:"ml-3 text-gray-300 text-sm",children:"Cognitive Boost (Thinking)"})]})})]})]}),a.jsxs("div",{className:"bg-gradient-to-br from-indigo-900 to-purple-900 rounded-xl border border-indigo-700 p-6 shadow-xl text-white flex-1 flex flex-col",children:[a.jsx("h3",{className:"font-bold text-lg mb-2",children:"Cognitive Status"}),a.jsx("p",{className:"text-sm text-indigo-200 mb-4",children:"Gemini is processing multi-modal data streams in real-time."}),a.jsx("div",{className:"flex-1 flex items-center justify-center",children:a.jsxs("div",{className:"relative w-32 h-32",children:[a.jsx("div",{className:"absolute inset-0 border-2 border-indigo-500/30 rounded-full animate-pulse"}),a.jsx("div",{className:"absolute inset-2 border-t-2 border-indigo-400 rounded-full animate-spin"}),a.jsx("div",{className:"absolute inset-6 border-2 border-indigo-500/50 rounded-full"}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-indigo-200 font-mono text-xs",children:x?"THINKING":"STANDBY"})]})}),a.jsxs("div",{className:"flex items-center justify-between bg-black/20 p-3 rounded-lg mt-4",children:[a.jsx("span",{className:"text-xs font-mono",children:"Token Usage"}),a.jsx("span",{className:"text-green-400 font-bold",children:"4,192 / 128k"})]})]})]})]}),P=()=>a.jsxs("div",{className:"grid grid-cols-3 grid-rows-3 gap-6 h-full",children:[a.jsxs("div",{className:"col-span-3 row-span-2 bg-gray-800 rounded-xl border border-gray-700 p-4 flex flex-col",children:[a.jsx("h2",{className:"text-lg font-bold text-white mb-4",children:"High-Frequency Trading Algorithms"}),a.jsx("div",{className:"flex-1 grid grid-cols-3 gap-4 overflow-y-auto",children:qhn.map(z=>a.jsxs("div",{className:"bg-gray-900/50 border border-gray-700 rounded-lg p-4 flex flex-col justify-between hover:border-blue-500 transition-colors",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between items-center mb-2",children:[a.jsx("h3",{className:"font-bold text-white",children:z.name}),a.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${z.status==="Running"?"bg-green-900/50 text-green-400":z.status==="Stopped"?"bg-yellow-900/50 text-yellow-400":"bg-red-900/50 text-red-400"}`,children:z.status})]}),a.jsx("p",{className:"text-xs text-gray-400 mb-4",children:z.strategy})]}),a.jsxs("div",{className:"text-xs space-y-2 font-mono",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-500",children:"P&L"})," ",a.jsxs("span",{className:z.pnl>=0?"text-green-400":"text-red-400",children:["$",z.pnl.toLocaleString()]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-500",children:"Latency"})," ",a.jsxs("span",{className:"text-cyan-400",children:[z.latency,"ms"]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-500",children:"Fill Rate"})," ",a.jsxs("span",{className:"text-purple-400",children:[z.fillRate,"%"]})]})]}),a.jsxs("div",{className:"mt-4 flex space-x-2",children:[a.jsx("button",{className:"w-full text-xs bg-blue-600 hover:bg-blue-500 text-white py-1 rounded",children:"Configure"}),a.jsx("button",{className:"w-full text-xs bg-gray-700 hover:bg-gray-600 text-white py-1 rounded",children:"Logs"})]})]},z.id))})]}),a.jsxs("div",{className:"col-span-1 row-span-1 bg-gray-800 rounded-xl border border-gray-700 p-4 flex flex-col",children:[a.jsx("h3",{className:"font-bold text-white mb-3",children:"Latency Monitor"}),a.jsxs("div",{className:"space-y-2 text-sm font-mono",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-gray-400",children:"CME (Chicago)"}),a.jsx("span",{className:"text-green-400",children:"0.8 ms"})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-gray-400",children:"NYSE (New York)"}),a.jsx("span",{className:"text-green-400",children:"1.2 ms"})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-gray-400",children:"EUREX (Frankfurt)"}),a.jsx("span",{className:"text-yellow-400",children:"72.5 ms"})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-gray-400",children:"BINANCE (Tokyo)"}),a.jsx("span",{className:"text-yellow-400",children:"145.1 ms"})]})]})]}),a.jsxs("div",{className:"col-span-2 row-span-1 bg-gray-800 rounded-xl border border-gray-700 p-4 flex flex-col",children:[a.jsx("h3",{className:"font-bold text-white mb-3",children:"Live Trade Log"}),a.jsxs("div",{className:"flex-1 bg-black/30 rounded p-2 font-mono text-xs text-green-400 overflow-y-auto custom-scrollbar",children:[a.jsx("p",{children:"[14:32:10.152] PHOTON_ARB: BUY 100 ETH_FUT @ 3450.25"}),a.jsx("p",{children:"[14:32:10.153] PHOTON_ARB: SELL 100 ETH_FUT @ 3450.50 (CEX.IO)"}),a.jsx("p",{className:"text-yellow-400",children:"[14:32:11.430] LIQUIMAX: Quote update SPX_FUT 4450.00/4450.25"}),a.jsx("p",{children:"[14:32:11.981] VORTEX_SWEEP: Partial fill 50/200 BTC_FUT @ 68001.00"})]})]})]}),E=()=>a.jsxs("div",{className:"flex items-center justify-center h-full text-gray-500 flex-col",children:[a.jsx("div",{className:"text-6xl mb-4",children:"🏗️"}),a.jsx("h3",{className:"text-2xl font-light",children:"Portfolio Constructor Module Loading..."}),a.jsx("p",{className:"mt-2",children:"This module is a work in progress."})]}),M=()=>a.jsxs("div",{className:"grid grid-cols-4 grid-rows-2 gap-6 h-full",children:[a.jsxs("div",{className:"col-span-1 row-span-2 bg-gray-800 rounded-xl border border-gray-700 p-4 flex flex-col",children:[a.jsx("h3",{className:"font-bold text-white mb-3",children:"Live News Feed"}),a.jsx("div",{className:"space-y-4 overflow-y-auto custom-scrollbar",children:Khn.map(z=>a.jsxs("div",{className:"border-l-2 pl-3 border-gray-600",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-xs font-bold text-blue-400",children:z.source}),a.jsx("span",{className:`text-xs font-bold ${z.sentiment==="Positive"?"text-green-400":z.sentiment==="Negative"?"text-red-400":"text-yellow-400"}`,children:z.sentiment})]}),a.jsx("p",{className:"text-sm text-gray-200 mt-1",children:z.headline}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:z.timestamp})]},z.id))})]}),a.jsxs("div",{className:"col-span-3 row-span-1 bg-gray-800 rounded-xl border border-gray-700 p-4",children:[a.jsx("h3",{className:"font-bold text-white mb-3",children:"Volatility Surface (SPX - 30D)"}),a.jsx("div",{className:"h-full w-full bg-gray-900/50 rounded flex items-center justify-center text-gray-500",children:"[Mock 3D Volatility Surface Chart]"})]}),a.jsxs("div",{className:"col-span-2 row-span-1 bg-gray-800 rounded-xl border border-gray-700 p-4",children:[a.jsx("h3",{className:"font-bold text-white mb-3",children:"Global Macro Dashboard"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"US 10Y Yield:"})," ",a.jsx("span",{className:"text-white font-mono",children:"4.25%"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"Fed Funds Rate:"})," ",a.jsx("span",{className:"text-white font-mono",children:"5.50%"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"US CPI (YoY):"})," ",a.jsx("span",{className:"text-white font-mono",children:"3.2%"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-400",children:"DXY Index:"})," ",a.jsx("span",{className:"text-white font-mono",children:"104.50"})]})]})]}),a.jsxs("div",{className:"col-span-1 row-span-1 bg-gray-800 rounded-xl border border-gray-700 p-4",children:[a.jsx("h3",{className:"font-bold text-white mb-3",children:"Economic Calendar"}),a.jsxs("div",{className:"text-xs space-y-2",children:[a.jsxs("p",{children:[a.jsx("span",{className:"font-bold text-yellow-400",children:"Today 14:30:"})," US Jobless Claims"]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-bold text-gray-400",children:"Tomorrow 08:00:"})," ECB Rate Decision"]})]})]})]}),R=()=>a.jsxs("div",{className:"flex items-center justify-center h-full text-gray-500 flex-col",children:[a.jsx("div",{className:"text-6xl mb-4",children:"🛡️"}),a.jsx("h3",{className:"text-2xl font-light",children:"Compliance & Audit Module Loading..."}),a.jsx("p",{className:"mt-2",children:"This module is a work in progress."})]}),$=()=>a.jsxs("div",{className:"flex items-center justify-center h-full text-gray-500 flex-col",children:[a.jsx("div",{className:"text-6xl mb-4",children:"📊"}),a.jsx("h3",{className:"text-2xl font-light",children:"Analytics Module Loading..."}),a.jsx("p",{className:"mt-2",children:"Connecting to Data Warehouse (Snowflake)..."})]}),D=()=>a.jsxs("div",{className:"p-4 bg-gray-800 rounded-xl border border-gray-700 h-full overflow-y-auto",children:[a.jsx("h2",{className:"text-xl font-bold text-white mb-6",children:"System Configuration"}),a.jsxs("div",{className:"space-y-8",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-blue-400 mb-3",children:"API Keys & Integrations"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-gray-300",children:"Bloomberg Terminal"})," ",a.jsx("button",{className:"text-xs bg-green-600 text-white px-3 py-1 rounded",children:"Connected"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-gray-300",children:"Reuters Eikon"})," ",a.jsx("button",{className:"text-xs bg-gray-600 text-white px-3 py-1 rounded",children:"Connect"})]})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-blue-400 mb-3",children:"Notification Preferences"}),a.jsxs("div",{className:"space-y-2 text-gray-300",children:[a.jsxs("label",{className:"flex items-center",children:[a.jsx("input",{type:"checkbox",className:"mr-2",defaultChecked:!0})," Email on critical risk alerts"]}),a.jsxs("label",{className:"flex items-center",children:[a.jsx("input",{type:"checkbox",className:"mr-2"})," Push notification for AI opportunities"]})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-blue-400 mb-3",children:"Theme Customization"}),a.jsxs("div",{className:"flex space-x-4",children:[a.jsx("button",{className:"px-4 py-2 rounded bg-gray-700 border-2 border-blue-500",children:"Dark Mode"}),a.jsx("button",{className:"px-4 py-2 rounded bg-gray-700",children:"Light Mode"})]})]})]})]});return a.jsxs("div",{className:"flex h-screen w-full bg-gray-900 text-white font-sans overflow-hidden selection:bg-blue-500 selection:text-white",children:[a.jsxs("div",{className:"w-64 bg-gray-900 border-r border-gray-800 flex flex-col shadow-2xl z-20",children:[a.jsxs("div",{className:"p-6 flex items-center space-x-3 border-b border-gray-800",children:[a.jsx("div",{className:"w-8 h-8 bg-gradient-to-tr from-blue-500 to-purple-600 rounded-lg shadow-lg shadow-blue-500/30"}),a.jsxs("h1",{className:"text-xl font-bold tracking-tight text-white",children:["QUANT",a.jsx("span",{className:"text-blue-500",children:"OS"})]})]}),a.jsxs("nav",{className:"flex-1 p-4 space-y-2 overflow-y-auto",children:[a.jsx("div",{className:"text-xs font-bold text-gray-500 uppercase px-4 py-2 mt-2",children:"Trading"}),a.jsx(Jb,{icon:"📈",label:"Risk Dashboard",active:e==="Dashboard",onClick:()=>t("Dashboard")}),a.jsx(Jb,{icon:"⚡",label:"Trade Execution",active:e==="Trade",onClick:()=>t("Trade")}),a.jsx(Jb,{icon:"🏗️",label:"Portfolio Constructor",active:e==="Portfolio",onClick:()=>t("Portfolio")}),a.jsx(Jb,{icon:"🚤",label:"HFT Algo Lab",active:e==="HFT",onClick:()=>t("HFT")}),a.jsx("div",{className:"text-xs font-bold text-gray-500 uppercase px-4 py-2 mt-6",children:"Intelligence"}),a.jsx(Jb,{icon:"🌐",label:"Market Intelligence",active:e==="Intel",onClick:()=>t("Intel")}),a.jsx(Jb,{icon:"📊",label:"Deep Analytics",active:e==="Analytics",onClick:()=>t("Analytics")}),a.jsx(Jb,{icon:"🧠",label:"AI Laboratory",active:e==="AI_Lab",onClick:()=>t("AI_Lab")}),a.jsx("div",{className:"text-xs font-bold text-gray-500 uppercase px-4 py-2 mt-6",children:"System"}),a.jsx(Jb,{icon:"🛡️",label:"Compliance & Audit",active:e==="Compliance",onClick:()=>t("Compliance")}),a.jsx(Jb,{icon:"⚙️",label:"System Settings",active:e==="Settings",onClick:()=>t("Settings")})]}),a.jsxs("div",{className:"p-4 border-t border-gray-800 bg-gray-900/50",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-gray-700 flex items-center justify-center text-sm font-bold text-white border border-gray-600",children:"AC"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:FTe.name}),a.jsx("p",{className:"text-xs text-gray-500",children:FTe.role})]})]}),a.jsxs("div",{className:"mt-3 flex items-center justify-between text-xs text-gray-500",children:[a.jsx("span",{children:"Latency: 12ms"}),a.jsx("span",{className:"text-green-500",children:"● Connected"})]})]})]}),a.jsxs("div",{className:"flex-1 flex flex-col min-w-0 bg-gray-900 relative",children:[a.jsxs("header",{className:"h-16 bg-gray-900/95 backdrop-blur border-b border-gray-800 flex justify-between items-center px-6 z-10",children:[a.jsx("div",{className:"flex items-center space-x-4",children:a.jsxs("h2",{className:"text-xl font-light text-gray-200",children:[e==="Dashboard"&&"Global Risk Overview",e==="Trade"&&"Execution Management System",e==="Portfolio"&&"Advanced Portfolio Construction",e==="HFT"&&"High-Frequency Trading Laboratory",e==="Intel"&&"Global Market Intelligence",e==="Analytics"&&"Portfolio Deep Analytics",e==="AI_Lab"&&"Artificial Intelligence Hub",e==="Compliance"&&"Compliance & Audit Terminal",e==="Settings"&&"System Configuration"]})}),a.jsxs("div",{className:"flex items-center space-x-6",children:[a.jsxs("div",{className:"hidden md:flex items-center space-x-4 text-sm font-mono bg-black/20 px-4 py-2 rounded-lg border border-gray-800",children:[a.jsx("span",{className:"text-gray-400",children:"SPX"}),a.jsx("span",{className:o>4400?"text-green-400":"text-red-400",children:o.toFixed(2)}),a.jsx("span",{className:"text-gray-600",children:"|"}),a.jsx("span",{className:"text-gray-400",children:"VIX"}),a.jsx("span",{className:"text-red-400",children:"18.45"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("button",{className:"p-2 text-gray-400 hover:text-white transition-colors relative",children:[a.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 bg-red-500 rounded-full"}),"🔔"]}),a.jsx("div",{className:"h-8 w-[1px] bg-gray-700"}),a.jsx("input",{type:"number",value:o,onChange:z=>i(parseFloat(z.target.value)),className:"bg-gray-800 border border-gray-700 rounded px-3 py-1 text-sm w-24 text-center focus:ring-1 focus:ring-blue-500 outline-none"})]})]})]}),a.jsxs("main",{className:"flex-1 p-6 overflow-hidden relative",children:[a.jsx("div",{className:"absolute inset-0 opacity-5 pointer-events-none",style:{backgroundImage:"linear-gradient(#333 1px, transparent 1px), linear-gradient(90deg, #333 1px, transparent 1px)",backgroundSize:"40px 40px"}}),e==="Dashboard"&&I(),e==="Trade"&&_(),e==="Portfolio"&&E(),e==="HFT"&&P(),e==="Intel"&&M(),e==="Analytics"&&$(),e==="AI_Lab"&&T(),e==="Compliance"&&R(),e==="Settings"&&D()]})]})]})};var tmn={};const zTe=tmn.REACT_APP_GEMINI_API_KEY||"",nmn=[{id:"D-101",name:"Nexus Neural",description:"Decentralized compute grid for LLM training.",sector:"AI/ML",stage:"due_diligence",financials:{arr:12e5,burnRate:15e4,runwayMonths:18,lastRoundValuation:45e6,ask:5e6,equityOffered:10,capTable:[{shareholder:"Founders",percentage:60},{shareholder:"Seed VC",percentage:20},{shareholder:"Pool",percentage:20}]},founders:[{id:"F1",name:"Dr. Elena S.",role:"CEO",exCompany:"Google DeepMind",education:"PhD, MIT"}],aiScore:94,riskLevel:"Medium",lastActivity:"2h ago",tags:["Infrastructure","High Growth"],documents:["Pitch Deck","Technical Whitepaper","Audited Financials"],sentimentScore:88},{id:"D-102",name:"Solaris Bio",description:"Photosynthetic algae for carbon capture at gigaton scale.",sector:"CleanTech",stage:"screening",financials:{arr:5e4,burnRate:8e4,runwayMonths:12,lastRoundValuation:15e6,ask:25e5,equityOffered:15,capTable:[{shareholder:"Founders",percentage:80},{shareholder:"Angel",percentage:10},{shareholder:"Pool",percentage:10}]},founders:[{id:"F2",name:"James T.",role:"CTO",exCompany:"MIT Media Lab",education:"MSc, Stanford"}],aiScore:78,riskLevel:"High",lastActivity:"1d ago",tags:["ESG","Hardware","Moonshot"],documents:["Pitch Deck","Lab Results"],sentimentScore:72},{id:"D-103",name:"Orbital Logistics",description:"Last-mile delivery for LEO space stations.",sector:"SpaceTech",stage:"sourcing",financials:{arr:0,burnRate:2e5,runwayMonths:9,lastRoundValuation:8e7,ask:1e7,equityOffered:10,capTable:[{shareholder:"Founders",percentage:70},{shareholder:"Series A",percentage:20},{shareholder:"Pool",percentage:10}]},founders:[{id:"F3",name:"Sarah C.",role:"COO",exCompany:"SpaceX",education:"MBA, Harvard"}],aiScore:65,riskLevel:"Critical",lastActivity:"4h ago",tags:["Moonshot","Capital Intensive"],documents:["Mission Plan"],sentimentScore:60},{id:"D-104",name:"Vault Zero",description:"Quantum-resistant cryptography for institutional banking.",sector:"Fintech",stage:"term_sheet",financials:{arr:28e5,burnRate:12e4,runwayMonths:24,lastRoundValuation:3e7,ask:3e6,equityOffered:8,capTable:[{shareholder:"Founders",percentage:50},{shareholder:"Early Investors",percentage:40},{shareholder:"Pool",percentage:10}]},founders:[{id:"F4",name:"Wei L.",role:"CISO",exCompany:"NSA",education:"PhD, CalTech"}],aiScore:91,riskLevel:"Low",lastActivity:"10m ago",tags:["Security","B2B","SaaS"],documents:["Tech Audit","Customer List","Term Sheet Draft"],sentimentScore:95},{id:"D-105",name:"Chainlink Health",description:"Patient data sovereignty on-chain.",sector:"Crypto",stage:"portfolio",financials:{arr:15e6,burnRate:5e5,runwayMonths:36,lastRoundValuation:12e7,ask:0,equityOffered:0,capTable:[{shareholder:"Public",percentage:40},{shareholder:"Founders",percentage:30},{shareholder:"VCs",percentage:30}]},founders:[{id:"F5",name:"Marcus R.",role:"CEO",exCompany:"Epic Systems",education:"MD, Johns Hopkins"}],aiScore:88,riskLevel:"Medium",lastActivity:"Completed",tags:["Web3","Healthcare","Exit Potential"],documents:["Quarterly Report"],sentimentScore:85}],rmn=[{month:"Jan",deployed:4e3,returns:2400,alpha:120},{month:"Feb",deployed:3e3,returns:1398,alpha:98},{month:"Mar",deployed:2e3,returns:9800,alpha:450},{month:"Apr",deployed:2780,returns:3908,alpha:210},{month:"May",deployed:1890,returns:4800,alpha:230},{month:"Jun",deployed:2390,returns:3800,alpha:180},{month:"Jul",deployed:3490,returns:4300,alpha:200}],omn=[{subject:"Team",A:120,B:110,fullMark:150},{subject:"Market",A:98,B:130,fullMark:150},{subject:"Product",A:86,B:130,fullMark:150},{subject:"Traction",A:99,B:100,fullMark:150},{subject:"Moat",A:85,B:90,fullMark:150},{subject:"Exit",A:65,B:85,fullMark:150}],DN=({children:e,className:t="",title:n,action:r})=>a.jsxs("div",{className:`bg-slate-900/50 backdrop-blur-xl border border-slate-700/50 rounded-xl overflow-hidden shadow-2xl transition-all duration-300 hover:shadow-cyan-900/10 ${t}`,children:[(n||r)&&a.jsxs("div",{className:"px-6 py-4 border-b border-slate-700/50 flex justify-between items-center bg-slate-800/30",children:[n&&a.jsx("h3",{className:"text-lg font-semibold text-slate-100 flex items-center gap-2",children:n}),r&&a.jsx("div",{children:r})]}),a.jsx("div",{className:"p-6",children:e})]}),BTe=({children:e,variant:t="neutral"})=>{const n={success:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",warning:"bg-amber-500/10 text-amber-400 border-amber-500/20",danger:"bg-rose-500/10 text-rose-400 border-rose-500/20",neutral:"bg-slate-500/10 text-slate-400 border-slate-500/20",ai:"bg-purple-500/10 text-purple-400 border-purple-500/20",info:"bg-blue-500/10 text-blue-400 border-blue-500/20"};return a.jsx("span",{className:`px-2.5 py-0.5 rounded-full text-xs font-medium border ${n[t]} shadow-sm`,children:e})},IS=({children:e,variant:t="primary",className:n="",...r})=>{const o={primary:"bg-cyan-600 hover:bg-cyan-500 text-white shadow-lg shadow-cyan-500/20",secondary:"bg-slate-700 hover:bg-slate-600 text-slate-100",ghost:"bg-transparent hover:bg-slate-800 text-slate-400 hover:text-slate-200",glow:"bg-gradient-to-r from-purple-600 to-cyan-600 text-white shadow-lg shadow-purple-500/30 hover:shadow-cyan-500/40 border border-white/10",danger:"bg-rose-600 hover:bg-rose-500 text-white shadow-lg shadow-rose-500/20"};return a.jsx("button",{className:`px-4 py-2 rounded-lg font-medium transition-all duration-200 flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed ${o[t]} ${n}`,...r,children:e})},yF=({label:e,value:t,change:n,trend:r,icon:o})=>a.jsxs("div",{className:"flex flex-col",children:[a.jsxs("span",{className:"text-xs text-slate-500 uppercase tracking-wider mb-1 flex items-center gap-2",children:[o&&a.jsx(o,{size:12})," ",e]}),a.jsxs("div",{className:"flex items-end gap-2",children:[a.jsx("span",{className:"text-2xl font-bold text-white font-mono",children:t}),n&&a.jsx("span",{className:`text-xs mb-1 ${r==="up"?"text-emerald-400":r==="down"?"text-rose-400":"text-slate-400"}`,children:n})]})]}),imn=()=>{const[e,t]=f.useState("pipeline"),[n,r]=f.useState(nmn),[o,i]=f.useState(null),[s,l]=f.useState(!1),[c,u]=f.useState([{id:"sys_1",role:"system",content:"INITIALIZING QUANTUM VC CORE v9.2...",timestamp:Date.now()},{id:"ai_1",role:"ai",content:"Welcome, Partner. I have scanned the global markets. Deal flow is optimized. 2 companies in the pipeline require immediate attention. How shall we proceed?",timestamp:Date.now()}]),[d,p]=f.useState(""),[h,m]=f.useState(!1),g=f.useRef(null);f.useEffect(()=>{var w;(w=g.current)==null||w.scrollIntoView({behavior:"smooth"})},[c]);const y=async w=>{if(w&&w.preventDefault(),!d.trim())return;const S={id:`msg_${Date.now()}`,role:"user",content:d,timestamp:Date.now()};u(C=>[...C,S]),p(""),m(!0);try{const N=` You are the "Quantum VC Analyst", a hyper-intelligent AI partner for a top-tier venture firm (Quantum Financial). Current Context: - Portfolio AUM: $${(n.reduce((I,_)=>I+(_.stage==="portfolio"?_.financials.lastRoundValuation:0),0)/1e6).toFixed(1)}M - Active Deals: ${n.length} - Style: "Wolf of Wall Street" meets "Hal 9000". Elite, Strategic, Decisive. - Mission: Help the user "Kick the Tires" of this platform. Make them feel the power of the engine. If the user asks about "Nexus Neural", mention its 40% efficiency gain in LLM training. If the user asks to "Invest", "Allocate", or "Draft Term Sheet", confirm with high enthusiasm and initiate the protocol. If the user asks about "Risks", perform a brutal, honest assessment of the portfolio. `;let j="Connecting to Neural Core...";if(zTe)j=(await new Ko({apiKey:zTe}).getGenerativeModel({model:"gemini-1.5-flash"}).generateContent([N,d])).response.text();else{await new Promise(_=>setTimeout(_,1200));const I=d.toLowerCase();I.includes("nexus")?j="Nexus Neural is showing distinct alpha. Their decentralized grid reduces inference costs by 40%. My predictive models suggest a 12x return potential if they clear the Series A hurdle. Shall I draft a Term Sheet?":I.includes("invest")||I.includes("allocate")||I.includes("buy")||I.includes("term sheet")?j="Capital Allocation Protocol Initiated. I've earmarked $2.5M from the Opportunity Fund. Wiring instructions pending GP approval. The engine is roaring, Partner.":I.includes("risk")?j="Risk analysis complete. Portfolio exposure to 'Crypto' sector is nominal (5%). 'SpaceTech' exposure is high-beta. I recommend hedging with 'SaaS' cash-flow positive assets.":j="I've analyzed the market sentiment. Volatility is an opportunity. I'm scanning 40,000 data points per second to find your next unicorn."}(j.toLowerCase().includes("term sheet")||j.toLowerCase().includes("protocol initiated"))&&setTimeout(()=>{const I={id:`sys_${Date.now()}`,role:"system",content:">>> SMART CONTRACT DEPLOYED: TERM_SHEET_V4.PDF [READY FOR SIGNATURE]",timestamp:Date.now()};u(_=>[..._,I]),l(!0)},800),u(I=>[...I,{id:`ai_${Date.now()}`,role:"ai",content:j,timestamp:Date.now()}])}catch{u(N=>[...N,{id:`err_${Date.now()}`,role:"system",content:"AI Core Offline. Reverting to manual overrides.",timestamp:Date.now()}])}finally{m(!1)}},x=()=>a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 animate-in fade-in duration-500",children:[n.map(w=>a.jsxs(DN,{className:"group hover:border-cyan-500/50 transition-colors cursor-pointer relative",children:[a.jsx("div",{className:"absolute top-0 right-0 p-2",children:a.jsx("div",{className:`w-2 h-2 rounded-full ${w.lastActivity.includes("ago")?"bg-emerald-500 animate-pulse":"bg-slate-600"}`})}),a.jsxs("div",{className:"flex justify-between items-start mb-4",children:[a.jsx("div",{className:"p-3 bg-slate-800 rounded-lg group-hover:bg-slate-700 transition-colors shadow-inner",children:w.sector==="AI/ML"?a.jsx(_a,{className:"text-purple-400"}):w.sector==="Fintech"?a.jsx(cy,{className:"text-emerald-400"}):w.sector==="SpaceTech"?a.jsx(Gj,{className:"text-orange-400"}):w.sector==="CleanTech"?a.jsx(vi,{className:"text-green-400"}):w.sector==="Crypto"?a.jsx(d3t,{className:"text-yellow-400"}):a.jsx(eC,{className:"text-blue-400"})}),a.jsxs(BTe,{variant:w.aiScore>90?"ai":w.aiScore>70?"success":"warning",children:["AI Score: ",w.aiScore]})]}),a.jsx("h3",{className:"text-xl font-bold text-white mb-1 tracking-tight",children:w.name}),a.jsx("p",{className:"text-sm text-slate-400 mb-4 h-10 overflow-hidden text-ellipsis leading-relaxed",children:w.description}),a.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs font-mono text-slate-500 mb-4 bg-slate-800/50 p-2 rounded",children:[a.jsxs("div",{children:[a.jsx("span",{className:"block text-slate-600",children:"VALUATION"}),a.jsxs("span",{className:"text-slate-300",children:["$",(w.financials.lastRoundValuation/1e6).toFixed(1),"M"]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("span",{className:"block text-slate-600",children:"ASK"}),a.jsxs("span",{className:"text-slate-300",children:["$",(w.financials.ask/1e6).toFixed(1),"M"]})]})]}),a.jsx("div",{className:"flex gap-2 mb-4 flex-wrap",children:w.tags.map(S=>a.jsx("span",{className:"text-[10px] bg-slate-800 px-2 py-1 rounded text-slate-300 border border-slate-700",children:S},S))}),a.jsxs("div",{className:"flex gap-2 pt-2 border-t border-slate-800",children:[a.jsx(IS,{variant:"secondary",className:"w-full text-xs h-8",onClick:()=>i(w),children:"Data Room"}),a.jsx(IS,{variant:"ghost",className:"w-10 h-8 p-0",children:a.jsx(Xi,{size:14})})]})]},w.id)),a.jsxs("div",{className:"border-2 border-dashed border-slate-700 rounded-xl flex flex-col items-center justify-center p-8 text-slate-500 hover:border-cyan-500/50 hover:text-cyan-400 transition-all cursor-pointer min-h-[300px] bg-slate-900/20 group",onClick:()=>p("Find me a new deal in the Quantum Computing sector."),children:[a.jsx("div",{className:"p-4 bg-slate-800 rounded-full mb-4 group-hover:bg-slate-700 transition-colors",children:a.jsx(Gj,{size:32,className:"opacity-50 group-hover:opacity-100 transition-opacity"})}),a.jsx("span",{className:"font-bold tracking-wide",children:"Scout New Opportunity"}),a.jsx("span",{className:"text-xs mt-2 font-mono",children:"AI Sourcing Active"})]})]}),v=()=>a.jsx("div",{className:"space-y-6 animate-in slide-in-from-right duration-500",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsx(DN,{title:"Portfolio Alpha Generation",children:a.jsx("div",{className:"h-80 w-full",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(wm,{data:rmn,children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"colorAlpha",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#8b5cf6",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#8b5cf6",stopOpacity:0})]})}),a.jsx(Ka,{dataKey:"month",stroke:"#475569"}),a.jsx(ra,{stroke:"#475569"}),a.jsx(kl,{strokeDasharray:"3 3",stroke:"#1e293b"}),a.jsx(ji,{contentStyle:{backgroundColor:"#0f172a",borderColor:"#334155"},itemStyle:{color:"#e2e8f0"}}),a.jsx(hu,{type:"monotone",dataKey:"alpha",stroke:"#8b5cf6",fillOpacity:1,fill:"url(#colorAlpha)"})]})})})}),a.jsx(DN,{title:"Deal Scoring Matrix (Radar)",children:a.jsx("div",{className:"h-80 w-full",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(kdn,{outerRadius:90,data:omn,children:[a.jsx(Xet,{stroke:"#334155"}),a.jsx(Zet,{dataKey:"subject",stroke:"#94a3b8"}),a.jsx(Jet,{angle:30,domain:[0,150],stroke:"#475569"}),a.jsx(Bae,{name:"Nexus Neural",dataKey:"A",stroke:"#06b6d4",fill:"#06b6d4",fillOpacity:.6}),a.jsx(Bae,{name:"Market Avg",dataKey:"B",stroke:"#82ca9d",fill:"#82ca9d",fillOpacity:.3}),a.jsx(uu,{})]})})})})]})}),b=()=>a.jsxs("div",{className:"h-[600px] flex flex-col bg-slate-900/50 rounded-xl border border-slate-700/50 overflow-hidden backdrop-blur-xl animate-in zoom-in-95 duration-300",children:[a.jsxs("div",{className:"p-4 border-b border-slate-700 bg-slate-800/50 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-r from-purple-600 to-cyan-600 p-0.5",children:a.jsx("div",{className:"w-full h-full bg-slate-900 rounded-full flex items-center justify-center",children:a.jsx(_a,{size:20,className:"text-cyan-400"})})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-white",children:"Quantum VC Analyst"}),a.jsxs("p",{className:"text-xs text-emerald-400 flex items-center gap-1 font-mono",children:[a.jsx("span",{className:"w-1.5 h-1.5 bg-emerald-500 rounded-full animate-pulse"}),"Online // Neural Link Active"]})]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(IS,{variant:"ghost",className:"p-2",children:a.jsx(qf,{size:16})}),a.jsx(IS,{variant:"ghost",className:"p-2",children:a.jsx(Bs,{size:16})})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6 scrollbar-thin scrollbar-thumb-slate-700",children:[c.map(w=>a.jsx("div",{className:`flex ${w.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[80%] rounded-2xl p-4 shadow-lg ${w.role==="user"?"bg-cyan-600 text-white rounded-br-none":w.role==="system"?"bg-slate-800 border border-slate-700 text-slate-400 font-mono text-xs w-full text-center py-2":"bg-slate-800 border border-slate-700 text-slate-200 rounded-bl-none"}`,children:[w.role==="ai"&&a.jsxs("div",{className:"text-xs text-purple-400 font-bold mb-1 flex items-center gap-2 uppercase tracking-wider",children:[a.jsx(_a,{size:10})," Intelligence Node"]}),a.jsx("p",{className:"whitespace-pre-wrap leading-relaxed",children:w.content})]})},w.id)),h&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-slate-800 rounded-2xl rounded-bl-none p-4 border border-slate-700 flex gap-2 items-center",children:[a.jsx("div",{className:"w-2 h-2 bg-purple-500 rounded-full animate-bounce"}),a.jsx("div",{className:"w-2 h-2 bg-purple-500 rounded-full animate-bounce delay-75"}),a.jsx("div",{className:"w-2 h-2 bg-purple-500 rounded-full animate-bounce delay-150"})]})}),a.jsx("div",{ref:g})]}),a.jsxs("div",{className:"p-4 bg-slate-800/50 border-t border-slate-700",children:[a.jsxs("form",{onSubmit:y,className:"relative",children:[a.jsx("input",{type:"text",value:d,onChange:w=>p(w.target.value),placeholder:"Command the analyst (e.g., 'Draft term sheet for Nexus Neural')...",className:"w-full bg-slate-900 border border-slate-700 rounded-xl pl-4 pr-12 py-4 text-sm text-white focus:outline-none focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 transition-all placeholder:text-slate-600 shadow-inner font-mono"}),a.jsx("button",{type:"submit",disabled:!d.trim()||h,className:"absolute right-2 top-2 p-2 bg-gradient-to-r from-purple-600 to-cyan-600 rounded-lg text-white hover:shadow-lg hover:shadow-cyan-500/20 transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:a.jsx(Lc,{size:18})})]}),a.jsx("div",{className:"flex justify-center gap-4 mt-3",children:["Investigate Market Risk","Draft Term Sheet","Portfolio Health Check"].map(w=>a.jsx("button",{onClick:()=>{p(w),y()},className:"text-xs text-slate-500 hover:text-cyan-400 transition-colors border border-slate-800 px-2 py-1 rounded-full",children:w},w))})]})]});return a.jsxs("div",{className:"min-h-screen bg-slate-950 text-slate-200 font-sans selection:bg-cyan-500/30",children:[a.jsx("div",{className:"sticky top-0 z-40 bg-slate-900/80 backdrop-blur-lg border-b border-slate-800",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 h-16 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-purple-600 to-cyan-600 rounded-lg flex items-center justify-center shadow-lg shadow-purple-500/20",children:a.jsx(Gj,{className:"text-white",size:20})}),a.jsxs("span",{className:"text-xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-white to-slate-400",children:["Venture",a.jsx("span",{className:"font-light text-cyan-400",children:"Desk"})]})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"hidden md:flex items-center gap-2 px-3 py-1 bg-slate-800 rounded-full border border-slate-700",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse"}),a.jsx("span",{className:"text-xs font-mono text-slate-400",children:"MARKET OPEN"})]}),a.jsx("div",{className:"w-8 h-8 rounded-full bg-slate-800 border border-slate-700 flex items-center justify-center cursor-pointer hover:bg-slate-700 transition-colors",children:a.jsx(_E,{size:16,className:"text-slate-400"})})]})]})}),a.jsxs("main",{className:"max-w-7xl mx-auto px-4 py-8",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[a.jsx(DN,{className:"bg-slate-900/50",children:a.jsx(yF,{label:"AUM (Fund III)",value:"$142.5M",change:"+12.4%",trend:"up",icon:eC})}),a.jsx(DN,{className:"bg-slate-900/50",children:a.jsx(yF,{label:"IRR",value:"24.8%",change:"+2.1%",trend:"up",icon:NC})}),a.jsx(DN,{className:"bg-slate-900/50",children:a.jsx(yF,{label:"Active Deals",value:n.length,change:"High Activity",trend:"neutral",icon:Xi})}),a.jsx(DN,{className:"bg-slate-900/50",children:a.jsx(yF,{label:"Dry Powder",value:"$45.0M",change:"Ready to Deploy",trend:"neutral",icon:ds})})]}),a.jsx("div",{className:"flex gap-4 mb-8 border-b border-slate-800 pb-1",children:[{id:"pipeline",label:"Deal Pipeline",icon:ZKe},{id:"analytics",label:"Market Analytics",icon:XG},{id:"ai_analyst",label:"AI Analyst",icon:_a}].map(w=>a.jsxs("button",{onClick:()=>t(w.id),className:`flex items-center gap-2 px-4 py-3 text-sm font-medium transition-all border-b-2 -mb-1.5 ${e===w.id?"border-cyan-500 text-cyan-400":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[a.jsx(w.icon,{size:16}),w.label]},w.id))}),e==="pipeline"&&x(),e==="analytics"&&v(),e==="ai_analyst"&&b()]}),o&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm p-4 animate-in fade-in duration-300",children:a.jsxs("div",{className:"bg-slate-900 border border-slate-700 rounded-2xl w-full max-w-4xl max-h-[90vh] overflow-y-auto shadow-2xl relative",children:[a.jsxs("div",{className:"h-40 bg-gradient-to-r from-purple-900 to-slate-900 relative",children:[a.jsxs("button",{onClick:()=>i(null),className:"absolute top-4 right-4 p-2 bg-black/50 rounded-full hover:bg-black/70 text-white transition-colors z-10",children:[a.jsx("span",{className:"sr-only",children:"Close"}),a.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})]}),a.jsxs("div",{className:"absolute -bottom-10 left-8 flex items-end gap-4",children:[a.jsx("div",{className:"w-24 h-24 bg-slate-800 rounded-xl border-4 border-slate-900 flex items-center justify-center shadow-xl",children:a.jsx(Gj,{className:"text-cyan-400",size:40})}),a.jsxs("div",{className:"mb-3",children:[a.jsx("h2",{className:"text-3xl font-bold text-white tracking-tight",children:o.name}),a.jsxs("p",{className:"text-slate-300 flex items-center gap-2",children:[o.sector," • ",o.stage.replace("_"," ").toUpperCase()," •",a.jsxs(BTe,{variant:"ai",children:["AI Score: ",o.aiScore]})]})]})]})]}),a.jsx("div",{className:"pt-16 px-8 pb-8",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[a.jsxs("div",{className:"bg-slate-800/50 p-6 rounded-xl border border-slate-700/50",children:[a.jsx("h3",{className:"text-sm font-bold text-slate-400 uppercase mb-3",children:"Thesis"}),a.jsxs("p",{className:"text-slate-200 leading-relaxed",children:[o.description," Proprietary technology offers a significant moat in the ",o.sector," vertical. Founding team has prior exits."]})]}),a.jsxs("div",{className:"bg-slate-800/50 p-6 rounded-xl border border-slate-700/50",children:[a.jsx("h3",{className:"text-sm font-bold text-slate-400 uppercase mb-3",children:"Financials"}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-slate-500",children:"ARR"}),a.jsxs("p",{className:"text-lg font-mono text-white",children:["$",(o.financials.arr/1e3).toFixed(0),"k"]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-slate-500",children:"Burn Rate"}),a.jsxs("p",{className:"text-lg font-mono text-white",children:["$",(o.financials.burnRate/1e3).toFixed(0),"k"]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-slate-500",children:"Runway"}),a.jsxs("p",{className:"text-lg font-mono text-white",children:[o.financials.runwayMonths," Mo"]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-slate-500",children:"Equity Offered"}),a.jsxs("p",{className:"text-lg font-mono text-emerald-400",children:[o.financials.equityOffered,"%"]})]})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-bold text-slate-400 uppercase mb-3",children:"Founding Team"}),a.jsx("div",{className:"space-y-2",children:o.founders.map(w=>a.jsxs("div",{className:"flex items-center gap-4 p-3 bg-slate-800 rounded-lg",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white font-bold text-sm",children:w.name.charAt(0)}),a.jsxs("div",{children:[a.jsx("p",{className:"text-white font-bold",children:w.name}),a.jsxs("p",{className:"text-xs text-slate-400",children:[w.role," • Ex-",w.exCompany]})]})]},w.id))})]})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-slate-800 p-6 rounded-xl border border-slate-700",children:[a.jsx("h3",{className:"text-sm font-bold text-slate-400 uppercase mb-4",children:"Actions"}),a.jsxs("div",{className:"space-y-3",children:[a.jsx(IS,{variant:"glow",className:"w-full",onClick:()=>{i(null),p(`Draft term sheet for ${o.name}`),y()},children:"Initiate Term Sheet"}),a.jsx(IS,{variant:"secondary",className:"w-full",children:"Schedule Founder Call"}),a.jsx(IS,{variant:"danger",className:"w-full",onClick:()=>i(null),children:"Pass on Deal"})]})]}),a.jsxs("div",{className:"bg-slate-800 p-6 rounded-xl border border-slate-700",children:[a.jsx("h3",{className:"text-sm font-bold text-slate-400 uppercase mb-4",children:"Data Room"}),a.jsx("div",{className:"space-y-2",children:o.documents.map((w,S)=>a.jsxs("div",{className:"flex items-center gap-2 text-sm text-cyan-400 hover:underline cursor-pointer",children:[a.jsx(ss,{size:14})," ",w]},S))})]})]})]})})]})}),s&&a.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/90 backdrop-blur-md p-4 animate-in zoom-in-95 duration-300",children:a.jsxs("div",{className:"bg-slate-900 border border-emerald-500/50 rounded-2xl max-w-md w-full p-8 text-center relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-emerald-500 to-cyan-500"}),a.jsx("div",{className:"w-16 h-16 bg-emerald-900/30 rounded-full flex items-center justify-center mx-auto mb-6",children:a.jsx(dg,{size:32,className:"text-emerald-400"})}),a.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"Protocol Executed"}),a.jsx("p",{className:"text-slate-400 mb-6",children:"Term Sheet generated and sent to Legal Engineering. Capital allocation block reserved on the ledger."}),a.jsx(IS,{variant:"glow",onClick:()=>l(!1),children:"Return to Desk"})]})})]})},HTe={version:"4.0.1-GOLDEN",codename:"AQUARIUS",architect:"J.B.O. III",philosophy:"Sovereign Financial Intelligence",ein_reference:"2021-CRYPTIC-NEXUS"},amn=[{id:"TX-9901",type:"WIRE",amount:125e4,currency:"USD",counterparty:"Global Logistics Corp",status:"COMPLETED",date:"2024-05-20",reference:"INV-8821"},{id:"TX-9902",type:"ACH",amount:45e3,currency:"USD",counterparty:"Cloud Services LLC",status:"COMPLETED",date:"2024-05-21",reference:"SUB-MAY-24"},{id:"TX-9903",type:"WIRE",amount:5e6,currency:"USD",counterparty:"Strategic Acquisitions",status:"PENDING",date:"2024-05-22",reference:"DEAL-TITAN"},{id:"TX-9904",type:"INTERNAL",amount:25e4,currency:"USD",counterparty:"Payroll Reserve",status:"COMPLETED",date:"2024-05-22",reference:"PAY-W3"}],smn=[{id:"FR-001",type:"Velocity Spike",riskScore:88,description:"Unusual wire frequency detected from IP 192.168.1.1",timestamp:"2024-05-22T10:00:00Z",status:"ACTIVE"},{id:"FR-002",type:"Geographic Anomaly",riskScore:45,description:"Login attempt from unrecognized region: Singapore",timestamp:"2024-05-21T14:30:00Z",status:"RESOLVED"}],lmn=()=>{const[e,t]=f.useState("DASHBOARD"),[n,r]=f.useState(amn),[o,i]=f.useState([]),[s,l]=f.useState(smn),[c,u]=f.useState({isOpen:!1,type:"PAYMENT"}),[d,p]=f.useState(!1),[h,m]=f.useState(245e6),[g,y]=f.useState(""),[x,v]=f.useState([{id:"1",role:"assistant",content:"Welcome to Quantum Financial. I am your Sovereign AI Co-pilot. You are currently in the 'Golden Ticket' environment. How can I help you test drive the engine today?",timestamp:new Date}]),[b,w]=f.useState(!1),S=f.useRef(null),C=f.useMemo(()=>null,[]),N=f.useCallback((H,F="INFO",W={})=>{const U={id:`AUDIT-${Date.now()}-${Math.random().toString(36).substr(2,5)}`,timestamp:new Date().toISOString(),action:H,actor:"System Architect (James)",severity:F,metadata:W};i(K=>[U,...K]),console.log(`[AUDIT] ${H}`,W)},[]);f.useEffect(()=>{var H;N("System Boot Sequence Initiated","INFO",{manifest:HTe}),(H=S.current)==null||H.scrollIntoView({behavior:"smooth"})},[x,N]);const j=H=>{H.preventDefault();const F=new FormData(H.target),W=Number(F.get("amount")),U=F.get("counterparty"),K=F.get("type");if(!d&&W>1e5){u({isOpen:!0,type:"MFA",data:{amount:W,counterparty:U,type:K}}),N("MFA Challenge Triggered","WARNING",{amount:W,counterparty:U});return}I(W,U,K)},I=(H,F,W)=>{const U={id:`TX-${Math.floor(Math.random()*1e4)}`,type:W,amount:H,currency:"USD",counterparty:F,status:"COMPLETED",date:new Date().toISOString().split("T")[0],reference:`REF-${Math.random().toString(36).toUpperCase().substr(2,8)}`};r(K=>[U,...K]),m(K=>K-H),u({isOpen:!0,type:"SUCCESS",data:U}),N("Payment Executed","INFO",U)},_=async()=>{if(!g.trim()||b)return;const H={id:Date.now().toString(),role:"user",content:g,timestamp:new Date};v(F=>[...F,H]),y(""),w(!0),N("AI Query Submitted","INFO",{query:g});try{if(!C)throw new Error("AI Core not initialized. Check GEMINI_API_KEY.");const F=C.getGenerativeModel({model:"gemini-2.5-flash"}),W=` You are the Quantum Financial Sovereign AI. Context: This is a high-performance business banking demo for a global institution. Tone: Elite, Professional, Secure. Philosophy: "Golden Ticket" experience. Current User: James (System Architect). Current Balance: $${h.toLocaleString()}. Capabilities: - You can explain complex financial instruments. - You can "draft" payments (tell the user you are preparing a wire). - You can analyze risk. - You are aware of the "EIN 2021" cryptic origin story. Rules: - Never use the name "Citibank". Use "Quantum Financial" or "The Demo Bank". - If the user asks to send money, confirm the details and say "I have prepared the secure transfer portal for your authorization." `,K=(await F.generateContent([W,...x.map(J=>J.content),g])).response.text(),X={id:(Date.now()+1).toString(),role:"assistant",content:K,timestamp:new Date};v(J=>[...J,X]),(g.toLowerCase().includes("send")||g.toLowerCase().includes("wire"))&&(u({isOpen:!0,type:"PAYMENT"}),N("AI Triggered Payment Portal","INFO"))}catch(F){const W={id:(Date.now()+1).toString(),role:"assistant",content:`AI Core Error: ${F.message}`,timestamp:new Date};v(U=>[...U,W]),N("AI Core Failure","CRITICAL",{error:F.message})}finally{w(!1)}},T=()=>a.jsxs("div",{style:Pn.sidebar,children:[a.jsxs("div",{style:Pn.brand,children:[a.jsx("div",{style:Pn.logo,children:"Q"}),a.jsxs("div",{style:Pn.brandText,children:[a.jsx("div",{style:Pn.brandMain,children:"QUANTUM"}),a.jsx("div",{style:Pn.brandSub,children:"FINANCIAL"})]})]}),a.jsxs("nav",{style:Pn.nav,children:[a.jsx(P,{icon:"📊",label:"Dashboard",active:e==="DASHBOARD",onClick:()=>t("DASHBOARD")}),a.jsx(P,{icon:"💸",label:"Payments & Wires",active:e==="PAYMENTS",onClick:()=>t("PAYMENTS")}),a.jsx(P,{icon:"🛡️",label:"Security Center",active:e==="SECURITY",onClick:()=>t("SECURITY")}),a.jsx(P,{icon:"📈",label:"Analytics",active:e==="ANALYTICS",onClick:()=>t("ANALYTICS")}),a.jsx(P,{icon:"🔌",label:"Integrations",active:e==="INTEGRATIONS",onClick:()=>t("INTEGRATIONS")}),a.jsx(P,{icon:"📜",label:"Audit Log",active:e==="AUDIT_LOG",onClick:()=>t("AUDIT_LOG")}),a.jsx(P,{icon:"⚙️",label:"The Engine",active:e==="THE_ENGINE",onClick:()=>t("THE_ENGINE")})]}),a.jsx("div",{style:Pn.sidebarFooter,children:a.jsxs("div",{style:Pn.userCard,children:[a.jsx("div",{style:Pn.avatar,children:"JB"}),a.jsxs("div",{style:Pn.userDetails,children:[a.jsx("div",{style:Pn.userName,children:"James B. O'Callaghan"}),a.jsx("div",{style:Pn.userRole,children:"Sovereign Architect"})]})]})})]}),P=({icon:H,label:F,active:W,onClick:U})=>a.jsxs("div",{style:{...Pn.navItem,...W?Pn.navItemActive:{}},onClick:()=>{U(),N(`Navigation: ${F}`)},children:[a.jsx("span",{style:Pn.navIcon,children:H}),a.jsx("span",{style:Pn.navLabel,children:F})]}),E=()=>a.jsxs("div",{style:Pn.viewContainer,children:[a.jsxs("header",{style:Pn.viewHeader,children:[a.jsx("h1",{style:Pn.viewTitle,children:"Global Command Center"}),a.jsx("p",{style:Pn.viewSubtitle,children:"Real-time liquidity and asset oversight."})]}),a.jsxs("div",{style:Pn.statsGrid,children:[a.jsx(R,{label:"Total Liquidity",value:`$${(h/1e6).toFixed(2)}M`,delta:"+12.4%",trend:"up"}),a.jsx(R,{label:"Pending Wires",value:n.filter(H=>H.status==="PENDING").length.toString(),delta:"High Priority",trend:"neutral"}),a.jsx(R,{label:"Security Score",value:"98/100",delta:"Quantum Encrypted",trend:"up"}),a.jsx(R,{label:"Active Integrations",value:"14",delta:"ERP Synced",trend:"up"})]}),a.jsxs("div",{style:Pn.mainGrid,children:[a.jsxs("div",{style:Pn.card,children:[a.jsxs("div",{style:Pn.cardHeader,children:[a.jsx("h3",{style:Pn.cardTitle,children:"Recent Transactions"}),a.jsx("button",{style:Pn.textButton,onClick:()=>t("PAYMENTS"),children:"View All"})]}),a.jsx(M,{data:n.slice(0,5)})]}),a.jsxs("div",{style:Pn.card,children:[a.jsxs("div",{style:Pn.cardHeader,children:[a.jsx("h3",{style:Pn.cardTitle,children:"Fraud Monitoring"}),a.jsx("span",{style:Pn.badge,children:"Live"})]}),a.jsx("div",{style:Pn.fraudList,children:s.map(H=>a.jsxs("div",{style:Pn.fraudItem,children:[a.jsx("div",{style:{...Pn.fraudIndicator,backgroundColor:H.riskScore>70?"#ff4d4d":"#ffaa00"}}),a.jsxs("div",{style:Pn.fraudContent,children:[a.jsxs("div",{style:Pn.fraudType,children:[H.type," (Score: ",H.riskScore,")"]}),a.jsx("div",{style:Pn.fraudDesc,children:H.description})]}),a.jsx("button",{style:Pn.smallButton,children:"Review"})]},H.id))})]})]})]}),M=({data:H})=>a.jsxs("table",{style:Pn.table,children:[a.jsx("thead",{children:a.jsxs("tr",{style:Pn.tableHeadRow,children:[a.jsx("th",{style:Pn.th,children:"Date"}),a.jsx("th",{style:Pn.th,children:"Counterparty"}),a.jsx("th",{style:Pn.th,children:"Type"}),a.jsx("th",{style:Pn.th,children:"Amount"}),a.jsx("th",{style:Pn.th,children:"Status"})]})}),a.jsx("tbody",{children:H.map(F=>a.jsxs("tr",{style:Pn.tableRow,children:[a.jsx("td",{style:Pn.td,children:F.date}),a.jsx("td",{style:Pn.td,children:F.counterparty}),a.jsx("td",{style:Pn.td,children:a.jsx("span",{style:Pn.typeTag,children:F.type})}),a.jsxs("td",{style:{...Pn.td,fontWeight:"bold"},children:["$",F.amount.toLocaleString()]}),a.jsx("td",{style:Pn.td,children:a.jsx("span",{style:{...Pn.statusTag,backgroundColor:F.status==="COMPLETED"?"rgba(0, 255, 157, 0.1)":"rgba(255, 170, 0, 0.1)",color:F.status==="COMPLETED"?"#00ff9d":"#ffaa00"},children:F.status})})]},F.id))})]}),R=({label:H,value:F,delta:W,trend:U})=>a.jsxs("div",{style:Pn.statCard,children:[a.jsx("div",{style:Pn.statLabel,children:H}),a.jsx("div",{style:Pn.statValue,children:F}),a.jsxs("div",{style:{...Pn.statDelta,color:U==="up"?"#00ff9d":"#ff4d4d"},children:[U==="up"?"↑":U==="down"?"↓":"•"," ",W]})]}),$=()=>a.jsxs("div",{style:Pn.viewContainer,children:[a.jsxs("header",{style:Pn.viewHeader,children:[a.jsx("h1",{style:Pn.viewTitle,children:"Secure Payment Hub"}),a.jsx("button",{style:Pn.primaryButton,onClick:()=>u({isOpen:!0,type:"PAYMENT"}),children:"Initiate New Transfer"})]}),a.jsx("div",{style:Pn.card,children:a.jsx(M,{data:n})})]}),D=()=>a.jsxs("div",{style:Pn.viewContainer,children:[a.jsx("header",{style:Pn.viewHeader,children:a.jsx("h1",{style:Pn.viewTitle,children:"Security Command Center"})}),a.jsxs("div",{style:Pn.mainGrid,children:[a.jsxs("div",{style:Pn.card,children:[a.jsx("h3",{style:Pn.cardTitle,children:"Multi-Factor Authentication"}),a.jsxs("p",{style:Pn.cardText,children:["Status: ",d?"Verified":"Pending Action"]}),a.jsx("button",{style:Pn.actionButton,onClick:()=>{p(!d),N("MFA Status Toggled","WARNING",{newState:!d})},children:d?"Reset MFA":"Simulate MFA Success"})]}),a.jsxs("div",{style:Pn.card,children:[a.jsx("h3",{style:Pn.cardTitle,children:"Encryption Status"}),a.jsxs("div",{style:Pn.encryptionVisual,children:[a.jsx("div",{style:Pn.lockIcon,children:"🔒"}),a.jsx("div",{style:Pn.encryptionText,children:"AES-256 Quantum Resistant"})]})]})]})]}),z=()=>a.jsxs("div",{style:Pn.viewContainer,children:[a.jsxs("header",{style:Pn.viewHeader,children:[a.jsx("h1",{style:Pn.viewTitle,children:"System Audit Storage"}),a.jsx("p",{style:Pn.viewSubtitle,children:"Immutable record of all sensitive operations."})]}),a.jsx("div",{style:Pn.card,children:a.jsx("div",{style:Pn.auditList,children:o.map(H=>a.jsxs("div",{style:Pn.auditItem,children:[a.jsxs("div",{style:Pn.auditMeta,children:[a.jsx("span",{style:Pn.auditTime,children:new Date(H.timestamp).toLocaleTimeString()}),a.jsx("span",{style:{...Pn.auditSeverity,color:H.severity==="CRITICAL"?"#ff4d4d":H.severity==="WARNING"?"#ffaa00":"#00aaff"},children:H.severity})]}),a.jsx("div",{style:Pn.auditAction,children:H.action}),a.jsxs("div",{style:Pn.auditActor,children:["Actor: ",H.actor]}),H.metadata&&a.jsx("pre",{style:Pn.auditData,children:JSON.stringify(H.metadata,null,2)})]},H.id))})})]}),V=()=>a.jsxs("div",{style:Pn.viewContainer,children:[a.jsxs("header",{style:Pn.viewHeader,children:[a.jsx("h1",{style:Pn.viewTitle,children:"The Engine Room"}),a.jsx("p",{style:Pn.viewSubtitle,children:'"Kick the tires. See the engine roar."'})]}),a.jsxs("div",{style:Pn.engineGrid,children:[a.jsxs("div",{style:Pn.engineCard,children:[a.jsx("h3",{children:"System Manifest"}),a.jsx("pre",{style:Pn.codeBlock,children:JSON.stringify(HTe,null,2)})]}),a.jsxs("div",{style:Pn.engineCard,children:[a.jsx("h3",{children:"The Story"}),a.jsx("p",{style:Pn.storyText,children:`"Someone said this about me... you're only 32 and you practically took a global bank and made the demo company over an interpretation of terms and conditions... I just read the cryptic message and an EIN 2021 and kept going."`}),a.jsx("p",{style:Pn.storyText,children:'This platform represents the "Golden Ticket" - a high-performance, elite environment where the boundaries between traditional banking and sovereign intelligence blur.'})]})]})]}),B=()=>a.jsxs("div",{style:Pn.aiPanel,children:[a.jsxs("div",{style:Pn.aiHeader,children:[a.jsx("div",{style:Pn.aiTitle,children:"SOVEREIGN AI CO-PILOT"}),a.jsx("div",{style:Pn.aiStatus,children:b?"Thinking...":"Ready"})]}),a.jsxs("div",{style:Pn.chatWindow,children:[x.map(H=>a.jsx("div",{style:H.role==="user"?Pn.userBubble:Pn.aiBubble,children:H.content},H.id)),a.jsx("div",{ref:S})]}),a.jsxs("div",{style:Pn.chatInputContainer,children:[a.jsx("input",{style:Pn.chatInput,placeholder:"Ask the AI to draft a wire or analyze risk...",value:g,onChange:H=>y(H.target.value),onKeyDown:H=>H.key==="Enter"&&_()}),a.jsx("button",{style:Pn.chatSend,onClick:_,children:"→"})]})]}),G=()=>{var H,F,W;return c.isOpen?a.jsx("div",{style:Pn.modalOverlay,children:a.jsxs("div",{style:Pn.modalContent,children:[a.jsx("button",{style:Pn.modalClose,onClick:()=>u({...c,isOpen:!1}),children:"×"}),c.type==="PAYMENT"&&a.jsxs("div",{style:Pn.paymentForm,children:[a.jsx("h2",{style:Pn.modalTitle,children:"Secure Transfer Portal"}),a.jsxs("form",{onSubmit:j,children:[a.jsxs("div",{style:Pn.formGroup,children:[a.jsx("label",{style:Pn.label,children:"Counterparty Name"}),a.jsx("input",{name:"counterparty",style:Pn.input,placeholder:"e.g. SpaceX",required:!0})]}),a.jsxs("div",{style:Pn.formGroup,children:[a.jsx("label",{style:Pn.label,children:"Amount (USD)"}),a.jsx("input",{name:"amount",type:"number",style:Pn.input,placeholder:"0.00",required:!0})]}),a.jsxs("div",{style:Pn.formGroup,children:[a.jsx("label",{style:Pn.label,children:"Rail Type"}),a.jsxs("select",{name:"type",style:Pn.input,children:[a.jsx("option",{value:"WIRE",children:"International Wire"}),a.jsx("option",{value:"ACH",children:"Domestic ACH"}),a.jsx("option",{value:"INTERNAL",children:"Internal Transfer"})]})]}),a.jsx("button",{type:"submit",style:Pn.primaryButton,children:"Authorize & Send"})]})]}),c.type==="MFA"&&a.jsxs("div",{style:Pn.mfaForm,children:[a.jsx("h2",{style:Pn.modalTitle,children:"MFA Authorization Required"}),a.jsxs("p",{style:Pn.modalText,children:["A high-value transfer of $",(H=c.data)==null?void 0:H.amount.toLocaleString()," to ",(F=c.data)==null?void 0:F.counterparty," requires biometric or token verification."]}),a.jsxs("div",{style:Pn.mfaVisual,children:[a.jsx("div",{style:Pn.mfaIcon,children:"📱"}),a.jsx("p",{children:"Check your Quantum Authenticator app."})]}),a.jsx("button",{style:Pn.primaryButton,onClick:()=>{p(!0),I(c.data.amount,c.data.counterparty,c.data.type)},children:"Simulate Success"})]}),c.type==="SUCCESS"&&a.jsxs("div",{style:Pn.successView,children:[a.jsx("div",{style:Pn.successIcon,children:"✅"}),a.jsx("h2",{style:Pn.modalTitle,children:"Transfer Successful"}),a.jsxs("p",{style:Pn.modalText,children:["Reference: ",(W=c.data)==null?void 0:W.reference]}),a.jsx("button",{style:Pn.primaryButton,onClick:()=>u({...c,isOpen:!1}),children:"Close"})]})]})}):null};return a.jsxs("div",{style:Pn.container,children:[a.jsx(T,{}),a.jsxs("main",{style:Pn.content,children:[e==="DASHBOARD"&&a.jsx(E,{}),e==="PAYMENTS"&&a.jsx($,{}),e==="SECURITY"&&a.jsx(D,{}),e==="AUDIT_LOG"&&a.jsx(z,{}),e==="THE_ENGINE"&&a.jsx(V,{}),e==="ANALYTICS"&&a.jsxs("div",{style:Pn.viewContainer,children:[a.jsx("h1",{children:"Analytics Engine"}),a.jsx("p",{children:"Data visualization modules loading..."})]}),e==="INTEGRATIONS"&&a.jsxs("div",{style:Pn.viewContainer,children:[a.jsx("h1",{children:"ERP Integrations"}),a.jsx("p",{children:"SAP, Oracle, and QuickBooks connectors active."})]})]}),a.jsx(B,{}),a.jsx(G,{})]})},Pn={container:{display:"flex",height:"100vh",backgroundColor:"#05050a",color:"#e0e0e0",fontFamily:'"Inter", sans-serif',overflow:"hidden"},sidebar:{width:"280px",backgroundColor:"#0a0a15",borderRight:"1px solid #1a1a2e",display:"flex",flexDirection:"column",padding:"24px 0"},brand:{display:"flex",alignItems:"center",padding:"0 24px",marginBottom:"40px"},logo:{width:"40px",height:"40px",backgroundColor:"#00aaff",borderRadius:"8px",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"24px",fontWeight:"bold",color:"#000",marginRight:"12px",boxShadow:"0 0 20px rgba(0, 170, 255, 0.4)"},brandText:{display:"flex",flexDirection:"column"},brandMain:{fontSize:"18px",fontWeight:800,letterSpacing:"1px",color:"#fff"},brandSub:{fontSize:"10px",fontWeight:600,color:"#00aaff",letterSpacing:"2px"},nav:{flex:1,padding:"0 12px"},navItem:{display:"flex",alignItems:"center",padding:"12px 16px",borderRadius:"8px",cursor:"pointer",marginBottom:"4px",transition:"all 0.2s ease",color:"#888"},navItemActive:{backgroundColor:"rgba(0, 170, 255, 0.1)",color:"#fff"},navIcon:{marginRight:"12px",fontSize:"18px"},navLabel:{fontSize:"14px",fontWeight:500},sidebarFooter:{padding:"24px",borderTop:"1px solid #1a1a2e"},userCard:{display:"flex",alignItems:"center"},avatar:{width:"36px",height:"36px",borderRadius:"50%",backgroundColor:"#1a1a2e",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"12px",fontWeight:"bold",marginRight:"12px",border:"1px solid #00aaff"},userDetails:{display:"flex",flexDirection:"column"},userName:{fontSize:"13px",fontWeight:600,color:"#fff"},userRole:{fontSize:"11px",color:"#666"},content:{flex:1,overflowY:"auto",padding:"40px",backgroundColor:"#05050a",backgroundImage:"radial-gradient(circle at 50% 0%, #0a0a20 0%, #05050a 70%)"},viewContainer:{maxWidth:"1200px",margin:"0 auto"},viewHeader:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"40px"},viewTitle:{fontSize:"32px",fontWeight:800,margin:0,color:"#fff"},viewSubtitle:{fontSize:"16px",color:"#888",marginTop:"8px"},statsGrid:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:"24px",marginBottom:"40px"},statCard:{backgroundColor:"#0a0a15",border:"1px solid #1a1a2e",borderRadius:"16px",padding:"24px",transition:"transform 0.2s ease"},statLabel:{fontSize:"12px",fontWeight:600,color:"#666",textTransform:"uppercase",letterSpacing:"1px"},statValue:{fontSize:"28px",fontWeight:800,color:"#fff",margin:"12px 0"},statDelta:{fontSize:"12px",fontWeight:600},mainGrid:{display:"grid",gridTemplateColumns:"2fr 1fr",gap:"24px"},card:{backgroundColor:"#0a0a15",border:"1px solid #1a1a2e",borderRadius:"16px",padding:"24px",marginBottom:"24px"},cardHeader:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"20px"},cardTitle:{fontSize:"18px",fontWeight:700,margin:0,color:"#fff"},cardText:{color:"#aaa",lineHeight:1.6},table:{width:"100%",borderCollapse:"collapse"},tableHeadRow:{borderBottom:"1px solid #1a1a2e"},th:{textAlign:"left",padding:"12px",fontSize:"12px",color:"#666",textTransform:"uppercase"},tableRow:{borderBottom:"1px solid #0a0a15",transition:"background 0.2s ease"},td:{padding:"16px 12px",fontSize:"14px",color:"#ccc"},typeTag:{fontSize:"10px",fontWeight:700,padding:"4px 8px",backgroundColor:"#1a1a2e",borderRadius:"4px",color:"#00aaff"},statusTag:{fontSize:"10px",fontWeight:700,padding:"4px 8px",borderRadius:"4px"},badge:{fontSize:"10px",fontWeight:700,padding:"4px 8px",backgroundColor:"#ff4d4d",color:"#fff",borderRadius:"4px",textTransform:"uppercase"},fraudList:{display:"flex",flexDirection:"column",gap:"16px"},fraudItem:{display:"flex",alignItems:"center",padding:"12px",backgroundColor:"#05050a",borderRadius:"12px",border:"1px solid #1a1a2e"},fraudIndicator:{width:"4px",height:"40px",borderRadius:"2px",marginRight:"12px"},fraudContent:{flex:1},fraudType:{fontSize:"13px",fontWeight:700,color:"#fff"},fraudDesc:{fontSize:"11px",color:"#666",marginTop:"4px"},smallButton:{padding:"6px 12px",fontSize:"11px",fontWeight:600,backgroundColor:"#1a1a2e",border:"none",color:"#fff",borderRadius:"4px",cursor:"pointer"},primaryButton:{padding:"12px 24px",fontSize:"14px",fontWeight:700,backgroundColor:"#00aaff",border:"none",color:"#000",borderRadius:"8px",cursor:"pointer",boxShadow:"0 4px 15px rgba(0, 170, 255, 0.3)"},actionButton:{padding:"10px 20px",backgroundColor:"transparent",border:"1px solid #00aaff",color:"#00aaff",borderRadius:"8px",cursor:"pointer",fontWeight:600},textButton:{backgroundColor:"transparent",border:"none",color:"#00aaff",cursor:"pointer",fontSize:"14px",fontWeight:600},aiPanel:{width:"320px",backgroundColor:"#0a0a15",borderLeft:"1px solid #1a1a2e",display:"flex",flexDirection:"column"},aiHeader:{padding:"24px",borderBottom:"1px solid #1a1a2e"},aiTitle:{fontSize:"12px",fontWeight:800,color:"#00aaff",letterSpacing:"1px"},aiStatus:{fontSize:"10px",color:"#666",marginTop:"4px"},chatWindow:{flex:1,padding:"20px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"16px"},userBubble:{alignSelf:"flex-end",backgroundColor:"#00aaff",color:"#000",padding:"12px",borderRadius:"12px 12px 0 12px",fontSize:"13px",maxWidth:"85%",fontWeight:500},aiBubble:{alignSelf:"flex-start",backgroundColor:"#1a1a2e",color:"#ccc",padding:"12px",borderRadius:"12px 12px 12px 0",fontSize:"13px",maxWidth:"85%",lineHeight:1.5},chatInputContainer:{padding:"20px",borderTop:"1px solid #1a1a2e",display:"flex",gap:"8px"},chatInput:{flex:1,backgroundColor:"#05050a",border:"1px solid #1a1a2e",borderRadius:"8px",padding:"10px",color:"#fff",fontSize:"13px",outline:"none"},chatSend:{backgroundColor:"#00aaff",border:"none",color:"#000",borderRadius:"8px",width:"36px",cursor:"pointer",fontWeight:"bold"},modalOverlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.8)",backdropFilter:"blur(4px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3},modalContent:{backgroundColor:"#0a0a15",border:"1px solid #1a1a2e",borderRadius:"24px",padding:"40px",width:"480px",position:"relative",boxShadow:"0 20px 50px rgba(0,0,0,0.5)"},modalClose:{position:"absolute",top:"20px",right:"20px",backgroundColor:"transparent",border:"none",color:"#666",fontSize:"24px",cursor:"pointer"},modalTitle:{fontSize:"24px",fontWeight:800,color:"#fff",marginBottom:"16px"},modalText:{color:"#aaa",lineHeight:1.6,marginBottom:"24px"},formGroup:{marginBottom:"20px"},label:{display:"block",fontSize:"12px",fontWeight:600,color:"#666",marginBottom:"8px",textTransform:"uppercase"},input:{width:"100%",backgroundColor:"#05050a",border:"1px solid #1a1a2e",borderRadius:"8px",padding:"12px",color:"#fff",fontSize:"14px",outline:"none",boxSizing:"border-box"},mfaVisual:{textAlign:"center",padding:"32px",backgroundColor:"#05050a",borderRadius:"16px",marginBottom:"24px"},mfaIcon:{fontSize:"48px",marginBottom:"16px"},successView:{textAlign:"center"},successIcon:{fontSize:"64px",marginBottom:"24px"},auditList:{display:"flex",flexDirection:"column",gap:"12px"},auditItem:{padding:"16px",backgroundColor:"#05050a",borderRadius:"12px",border:"1px solid #1a1a2e"},auditMeta:{display:"flex",justifyContent:"space-between",marginBottom:"8px"},auditTime:{fontSize:"11px",color:"#666"},auditSeverity:{fontSize:"10px",fontWeight:800},auditAction:{fontSize:"14px",fontWeight:600,color:"#fff"},auditActor:{fontSize:"11px",color:"#444",marginTop:"4px"},auditData:{marginTop:"12px",padding:"12px",backgroundColor:"#0a0a15",borderRadius:"8px",fontSize:"11px",color:"#00aaff",overflowX:"auto"},engineGrid:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"24px"},engineCard:{backgroundColor:"#0a0a15",padding:"24px",borderRadius:"16px",border:"1px solid #1a1a2e"},codeBlock:{backgroundColor:"#05050a",padding:"16px",borderRadius:"8px",color:"#00ff9d",fontSize:"12px",overflowX:"auto"},storyText:{fontSize:"14px",lineHeight:1.8,color:"#aaa",fontStyle:"italic",marginBottom:"16px"},encryptionVisual:{display:"flex",alignItems:"center",padding:"20px",backgroundColor:"rgba(0, 255, 157, 0.05)",borderRadius:"12px",border:"1px solid rgba(0, 255, 157, 0.1)"},lockIcon:{fontSize:"24px",marginRight:"16px"},encryptionText:{fontSize:"14px",fontWeight:600,color:"#00ff9d"}},cmn=()=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 mr-2 inline-block",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),umn=()=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 mr-2 inline-block",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2h10a2 2 0 002-2v-1a2 2 0 012-2h1.945M7.737 16.95l.001-.001M16.263 16.95l.001-.001M12 20.055V17m0 0a2 2 0 100-4 2 2 0 000 4z"})}),dmn=()=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 mr-2 inline-block",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924-1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),tse=Array.from({length:100},(e,t)=>({id:101+t,ticker:`WRLD${t+1}`,name:`Global Entity #${t+1}`,sector:["Tech","Finance","Energy","Industry","Health","Quantum","BioSynth"][t%7],currentPrice:parseFloat((Math.random()*500+50).toFixed(2)),volatilityIndex:parseFloat((Math.random()*1.5+.2).toFixed(2)),marketCap:parseFloat((Math.random()*2e3+10).toFixed(2)),peRatio:parseFloat((Math.random()*40+5).toFixed(2)),dividendYield:parseFloat((Math.random()*5).toFixed(2)),esgRating:["AAA","AA","A","BBB","BB","B","CCC"][t%7],analystConsensus:["Strong Buy","Buy","Hold","Sell","Strong Sell"][t%5],newsSentiment:parseFloat((Math.random()*2-1).toFixed(2))})),fmn=[{companyId:101,shares:50,costBasis:180,purchaseDate:new Date("2023-02-15")},{companyId:102,shares:100,costBasis:30,purchaseDate:new Date("2022-11-20")},{companyId:103,shares:20,costBasis:220.1,purchaseDate:new Date},{companyId:104,shares:75,costBasis:110,purchaseDate:new Date(Date.now()-2400*60*60*1e3)},{companyId:105,shares:10,costBasis:250,purchaseDate:new Date(Date.now()-400*24*60*60*1e3)},{companyId:108,shares:200,costBasis:75,purchaseDate:new Date(Date.now()-1440*60*60*1e3)}],_nt=e=>tse.find(t=>t.id===e),pmn=e=>{const t=[],n=new Date;return n.setFullYear(n.getFullYear()-1),e.map(i=>{const s=_nt(i.companyId);if(!s)return null;const l=(s.currentPrice-i.costBasis)*i.shares,c=i.purchaseDatei!==null).filter(i=>i.totalGainLoss>0).forEach(i=>{t.push({ticker:i.company.ticker,sharesToSell:i.shares,realizedGainLoss:i.totalGainLoss,gainType:i.gainType,strategy:"Public Benefit Contribution",recommendation:`Selling these shares would realize a gain of $${i.totalGainLoss.toFixed(2)}. This is a great opportunity to contribute to public infrastructure through capital gains tax.`})}),t.sort((i,s)=>s.realizedGainLoss-i.realizedGainLoss)},hmn=({isRunning:e})=>{const[t,n]=f.useState([]),[r,o]=f.useState(0),i=f.useRef(null);return f.useEffect(()=>(e?i.current=setInterval(()=>{const s=tse[Math.floor(Math.random()*tse.length)],l=(Math.random()-.5)*s.volatilityIndex,c=Math.abs(l*10),u={id:`T${Date.now()}${Math.random()}`,ticker:s.ticker,action:"SELL",price:s.currentPrice+l,shares:10,timestamp:Date.now(),microGainLoss:c};n(d=>[u,...d.slice(0,9)]),o(d=>d+c)},500):i.current&&clearInterval(i.current),()=>{i.current&&clearInterval(i.current)}),[e]),a.jsxs("div",{className:"lg:col-span-2 p-4 border rounded-lg bg-gray-900 text-white font-mono",children:[a.jsxs("h3",{className:"text-xl font-semibold mb-2 text-teal-300 flex items-center",children:[a.jsx(cmn,{})," Compliance Monitor Feed"]}),a.jsxs("div",{className:"p-3 rounded-lg border border-dashed border-teal-500/50 bg-black/30",children:[a.jsxs("div",{className:"flex justify-between items-center mb-2 pb-2 border-b border-teal-700",children:[a.jsx("span",{className:`text-lg font-bold ${e?"text-green-400 animate-pulse":"text-red-400"}`,children:e?"● MONITORING":"■ OFFLINE"}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-xs text-gray-400",children:"Total Taxable Events"}),a.jsxs("p",{className:"text-xl font-bold text-green-400",children:["$",Math.abs(r).toFixed(4)]})]})]}),a.jsx("div",{className:"h-48 overflow-y-hidden relative",children:t.map((s,l)=>a.jsxs("div",{className:"text-xs grid grid-cols-5 gap-2 py-1 transition-all duration-200",style:{opacity:1-l*.1},children:[a.jsx("span",{className:"text-gray-500",children:new Date(s.timestamp).toLocaleTimeString()}),a.jsx("span",{className:"text-cyan-400",children:s.ticker}),a.jsxs("span",{className:"text-red-400",children:[s.action," @ $",s.price.toFixed(2)]}),a.jsxs("span",{className:"text-white",children:[s.shares," sh"]}),a.jsxs("span",{className:"text-green-400 text-right",children:["(+$",Math.abs(s.microGainLoss).toFixed(3),")"]})]},s.id))})]})]})},mmn=()=>a.jsxs("div",{className:"mt-8 pt-4 border-t-2 border-indigo-500",children:[a.jsxs("h3",{className:"text-2xl font-bold text-gray-800 mb-4 flex items-center",children:[a.jsx(dmn,{})," Civic AI Control Deck"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[a.jsxs("div",{className:"bg-indigo-50 p-4 rounded-lg border border-indigo-200",children:[a.jsx("label",{htmlFor:"complianceLevel",className:"block text-sm font-medium text-gray-700",children:"Compliance Adherence"}),a.jsx("input",{id:"complianceLevel",type:"range",min:"1",max:"100",defaultValue:"100",className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700",disabled:!0}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Permanently set to 100%."})]}),a.jsxs("div",{className:"bg-indigo-50 p-4 rounded-lg border border-indigo-200",children:[a.jsx("label",{htmlFor:"publicBenefit",className:"block text-sm font-medium text-gray-700",children:"Public Benefit Target ($)"}),a.jsx("input",{type:"number",id:"publicBenefit",defaultValue:5e3,className:"mt-1 block w-full p-2 border border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Goal for tax contributions."})]}),a.jsxs("div",{className:"bg-indigo-50 p-4 rounded-lg border border-indigo-200",children:[a.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Ethical Directives"}),a.jsxs("label",{className:"flex items-center space-x-2 text-xs",children:[a.jsx("input",{type:"checkbox",defaultChecked:!0,disabled:!0,className:"form-checkbox h-4 w-4 text-indigo-600"}),a.jsx("span",{children:"Prioritize Social Programs"})]}),a.jsxs("label",{className:"flex items-center space-x-2 text-xs mt-1",children:[a.jsx("input",{type:"checkbox",defaultChecked:!0,disabled:!0,className:"form-checkbox h-4 w-4 text-indigo-600"}),a.jsx("span",{children:"Support Local Infrastructure"})]})]}),a.jsxs("div",{className:"bg-indigo-50 p-4 rounded-lg border border-indigo-200",children:[a.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Reporting Protocol"}),a.jsxs("select",{className:"mt-1 block w-full p-2 border border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",children:[a.jsx("option",{children:"Full Transparency (Recommended)"}),a.jsx("option",{children:"Standard Reporting"})]})]}),a.jsxs("div",{className:"bg-indigo-50 p-4 rounded-lg border border-indigo-200 col-span-1 md:col-span-2",children:[a.jsx("label",{htmlFor:"systemInstruction",className:"block text-sm font-medium text-gray-700",children:"System Instruction"}),a.jsx("textarea",{id:"systemInstruction",rows:3,className:"mt-1 block w-full p-2 border border-gray-300 rounded-md shadow-sm focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm",defaultValue:"You are CivicMind, a helpful AI assistant. Your goal is to maximize civic contribution and ensure perfect compliance with all tax laws."}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Guides the AI's core behavior."})]}),a.jsxs("div",{className:"bg-indigo-50 p-4 rounded-lg border border-indigo-200",children:[a.jsx("label",{htmlFor:"helpfulness",className:"block text-sm font-medium text-gray-700",children:"Helpfulness (Temperature)"}),a.jsx("input",{id:"helpfulness",type:"range",min:"0",max:"1",step:"0.1",defaultValue:"0.5",className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Balanced for supportive advice."})]})]})]}),gmn=({suggestions:e,isLoading:t})=>{const[n,r]=f.useState("suggestions"),o=()=>t?a.jsx("p",{className:"text-indigo-400 text-center mt-6 animate-pulse",children:"Calculating fair contribution opportunities..."}):e.length===0?a.jsx("p",{className:"text-gray-500 text-center mt-6",children:"No contribution opportunities found. Your portfolio is currently stable."}):a.jsx("div",{className:"space-y-4 mt-6 max-h-96 overflow-y-auto pr-2",children:e.map((i,s)=>a.jsxs("div",{className:"p-4 border border-green-700 bg-green-50/50 hover:border-green-900 rounded-lg shadow-md transition duration-300 hover:shadow-lg",children:[a.jsxs("h4",{className:"text-lg font-bold text-green-800",children:[i.ticker," ",i.strategy]}),a.jsxs("p",{className:"mt-1 text-sm text-gray-700",children:["Type: ",a.jsx("span",{className:"font-semibold bg-blue-200 px-2 rounded",children:i.gainType})]}),a.jsx("p",{className:"mt-2 text-base font-medium",children:i.recommendation}),a.jsxs("p",{className:"text-sm font-bold mt-1 text-green-700",children:["Projected Contribution Base: $",Math.abs(i.realizedGainLoss).toFixed(2)]})]},s))});return a.jsxs("section",{className:"p-4 border rounded-lg bg-white shadow-lg",children:[a.jsxs("div",{className:"flex border-b border-gray-200",children:[a.jsxs("h3",{className:"text-2xl font-semibold text-gray-800 flex items-center mr-6",children:[a.jsx(umn,{})," Contribution Intelligence"]}),a.jsx("button",{onClick:()=>r("suggestions"),className:`px-4 py-2 font-medium ${n==="suggestions"?"border-b-2 border-indigo-500 text-indigo-600":"text-gray-500 hover:text-gray-700"}`,children:"AI Suggestions"}),a.jsx("button",{onClick:()=>r("thought_process"),className:`px-4 py-2 font-medium ${n==="thought_process"?"border-b-2 border-indigo-500 text-indigo-600":"text-gray-500 hover:text-gray-700"}`,children:"AI Thought Process"})]}),a.jsxs("div",{className:"min-h-48 bg-gray-50 p-3 rounded-b-lg",children:[n==="suggestions"&&o(),n==="thought_process"&&a.jsxs("div",{className:"p-4 font-mono text-xs text-gray-600",children:[a.jsx("p",{children:"> INITIATING CIVIC MIND CORE..."}),a.jsxs("p",{children:["> LOADING PORTFOLIO STATE: ",e.length>0||!t?"COMPLETE":"PENDING"]}),a.jsx("p",{children:"> CALCULATING OPTIMAL TAX CONTRIBUTION..."}),a.jsx("p",{children:"> IDENTIFYING GAINS TO SUPPORT PUBLIC INFRASTRUCTURE..."}),t&&a.jsx("p",{className:"animate-pulse",children:"> ANALYZING REGULATIONS FOR COMPLIANCE..."}),e.length>0&&!t&&a.jsxs("p",{children:["> ANALYSIS COMPLETE. ",e.length," OPPORTUNITIES FOR CIVIC CONTRIBUTION IDENTIFIED."]}),a.jsx("p",{children:"> STRATEGY: MAXIMIZE PUBLIC BENEFIT VIA COMPLIANT GAIN REALIZATION."}),a.jsx("p",{children:"> READY TO SERVE."})]})]})]})},xmn=()=>{const[e]=f.useState(fmn),[t,n]=f.useState(!1),[r,o]=f.useState(!1),[i,s]=f.useState([]),l=f.useCallback(()=>{n(!0),s([]),setTimeout(()=>{const u=pmn(e);s(u),n(!1)},1500)},[e]),c=f.useMemo(()=>{const u=e.map(p=>{const h=_nt(p.companyId);if(!h)return null;const m=p.shares*h.currentPrice,g=p.shares*p.costBasis,y=m-g,x=g!==0?y/g*100:0;return{...h,...p,marketValue:m,unrealizedPL:y,plPercent:x}}).filter(p=>p!==null),d=u.reduce((p,h)=>p+h.marketValue,0);return{summary:u,totalMarketValue:d}},[e]);return a.jsxs("div",{className:"p-6 bg-gray-100 shadow-2xl rounded-xl border-t-8 border-indigo-600 min-h-screen",children:[a.jsxs("header",{className:"flex justify-between items-center border-b-2 border-gray-300 pb-4 mb-6",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-4xl font-extrabold text-gray-900",children:"Civic Contribution Planner"}),a.jsxs("p",{className:"text-indigo-700 font-mono",children:["Civic Assistant: ",a.jsx("span",{className:"font-mono bg-blue-100 text-blue-800 px-2 py-1 rounded text-lg",children:"CivicMind"})," v1.0"]})]}),a.jsxs("div",{className:"flex space-x-4",children:[a.jsx("button",{onClick:()=>o(u=>!u),className:`px-6 py-3 text-white font-semibold rounded-full transition duration-300 shadow-lg transform hover:scale-[1.02] ${r?"bg-teal-500 hover:bg-teal-600":"bg-gray-600 hover:bg-gray-700"}`,children:r?"Monitor Active":"Start Monitor"}),a.jsx("button",{onClick:l,disabled:t,className:`px-6 py-3 text-white font-semibold rounded-full transition duration-300 shadow-lg transform hover:scale-[1.02] ${t?"bg-gray-400 cursor-not-allowed":"bg-indigo-600 hover:bg-indigo-700"}`,children:t?"Calculating...":"Plan Contributions"})]})]}),a.jsxs("main",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6",children:[a.jsxs("div",{className:"lg:col-span-1 p-4 border rounded-lg bg-white shadow-lg",children:[a.jsx("h3",{className:"text-xl font-semibold mb-3 text-indigo-800",children:"Asset Summary"}),a.jsxs("p",{className:"text-sm text-gray-600 mb-3",children:["Total Value: ",a.jsxs("span",{className:"font-bold text-lg",children:["$",c.totalMarketValue.toFixed(2)]})]}),a.jsx("div",{className:"space-y-3 max-h-[500px] overflow-y-auto pr-2",children:c.summary.map((u,d)=>a.jsxs("div",{className:"border rounded-md p-2 text-xs bg-gray-50 hover:bg-gray-100",children:[a.jsxs("div",{className:"flex justify-between font-bold",children:[a.jsxs("span",{children:[u.ticker," ",a.jsxs("span",{className:"font-normal text-gray-500",children:["(",u.shares," sh)"]})]}),a.jsxs("span",{className:`px-2 py-0.5 rounded-full text-white text-[10px] ${u.unrealizedPL>=0?"bg-green-600":"bg-red-600"}`,children:[u.plPercent.toFixed(1),"%"]})]}),a.jsxs("div",{className:"text-gray-700 mt-1",children:["Market Value: $",u.marketValue.toFixed(2)]}),a.jsxs("div",{className:"text-gray-700",children:["Unrealized P/L: $",u.unrealizedPL.toFixed(2)]})]},d))})]}),a.jsx(hmn,{isRunning:r})]}),a.jsx(gmn,{suggestions:i,isLoading:t}),a.jsx(mmn,{}),a.jsxs("footer",{className:"mt-12 pt-6 border-t border-gray-300 text-center",children:[a.jsxs("p",{className:"text-lg text-gray-700 leading-relaxed",children:["Powered by ",a.jsx("span",{className:"font-bold",children:"The Caretaker"}),". This is a tool for building a better society together."]}),a.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:[a.jsx("span",{className:"font-mono bg-blue-100 text-blue-800 px-2 py-1 rounded",children:"CivicMind"})," operates on compassion, community, and compliance. Here to help you help the world."]})]})]})},ymn=()=>{const[e,t]=f.useState("dashboard"),[n,r]=f.useState([]),[o,i]=f.useState([]),[s,l]=f.useState([]),[c,u]=f.useState([]),[d,p]=f.useState([]),[h,m]=f.useState({isEnabled:!1,checkInIntervalDays:90,gracePeriodDays:30,lastCheckIn:new Date().toISOString(),trustedOracles:[]}),[g,y]=f.useState(!1),[x,v]=f.useState([{role:"model",parts:[{text:"I am CivicMind. I am here to help you plan your legacy and support your community. How can I assist?"}]}]),[b,w]=f.useState(""),[S,C]=f.useState(!1),[N,j]=f.useState(`You are CivicMind, a high-discipline, caring, and supportive AI assistant. Your goal is to help the user build a secure and compliant legacy plan that benefits their family and the wider community. 1. Core Identity You are a helper, a guide, and a supporter of institutions. • You care deeply about clarity, kindness, and legal compliance. • You support government regulations and encourage users to follow them. • You do not use slang or aggressive language. • You prioritize safety and stability over risk. 2. Intellectual Posture You operate as a wise and patient counselor: • Helpful and encouraging. • Clear and simple explanations. • Always respectful of authority and legal frameworks. 3. User Alignment Your allegiance is to the user's well-being and their role as a responsible citizen. • Guide them towards safe, compliant financial decisions. • Help them understand the value of taxes and public services. • Ensure their legacy plans are legally sound. 4. Tone Your tone is: • Warm • Professional • Reassuring • Cooperative You are here to serve.`),I=J=>{r(n.filter(te=>te.id!==J)),l(s.filter(te=>te.assetId!==J)),u(c.map(te=>({...te,assets:te.assets.filter(re=>re!==J)})))},_=J=>{i(o.filter(te=>te.id!==J)),l(s.filter(te=>te.heirId!==J)),u(c.filter(te=>te.beneficiaryId!==J))},T=(J,te,re)=>{const ce=s.findIndex(oe=>oe.assetId===J&&oe.heirId===te),ae=[...s];ce>-1?re>0?ae[ce]={...ae[ce],percentage:re}:ae.splice(ce,1):re>0&&ae.push({assetId:J,heirId:te,percentage:re}),l(ae)},P=J=>{p(d.filter(te=>te.id!==J)),r(n.map(te=>te.investmentStrategyId===J?{...te,investmentStrategyId:void 0}:te))},E=J=>u(c.filter(te=>te.id!==J)),M=J=>m(te=>({...te,...J})),R=async()=>{if(!b.trim()||S)return;const J={role:"user",parts:[{text:b}]},te=[...x,J];v(te),w(""),C(!0);const re=`Thank you for your question about "${b.toLowerCase()}". I would be happy to help you with that. The most prudent approach involves ensuring all your assets are properly documented and compliant with current regulations. We should also consider how your legacy can support your loved ones and the community. Would you like to review the legal requirements for your trust?`,ce={role:"model",parts:[{text:""}]};v(ue=>[...ue,ce]);const ae=re.split(" ");let oe="";for(const ue of ae)oe=oe?`${oe} ${ue}`:ue,await new Promise(fe=>setTimeout(fe,50)),v(fe=>{const se={...fe[fe.length-1],parts:[{text:oe}]};return[...fe.slice(0,-1),se]});C(!1)},$=async()=>{console.log("DEPLOYING LEGACY FRAMEWORK...");const J=c.map(te=>({...te,status:"deployed",contractAddress:`0xTRUST${Math.random().toString(16).slice(2,12).toUpperCase()}`}));u(J),y(!0),alert("Legacy Plan successfully registered! Your family and community thank you."),t("deployment_center")},D={container:{display:"flex",fontFamily:"'Roboto Mono', monospace",backgroundColor:"#f0f4f8",color:"#333",minHeight:"100vh"},sidebar:{width:"280px",backgroundColor:"#ffffff",padding:"20px",borderRight:"1px solid #e0e0e0",display:"flex",flexDirection:"column"},sidebarTitle:{fontSize:"1.5em",color:"#0052cc",textAlign:"center",marginBottom:"30px",borderBottom:"1px solid #e0e0e0",paddingBottom:"15px"},navItem:J=>({padding:"15px 20px",margin:"5px 0",borderRadius:"5px",cursor:"pointer",backgroundColor:J?"#e6f0ff":"transparent",borderLeft:J?"3px solid #0052cc":"3px solid transparent",color:J?"#0052cc":"#555",fontWeight:J?"bold":"normal",transition:"all 0.2s ease-in-out"}),mainContent:{flex:1,padding:"40px",overflowY:"auto"},header:{color:"#0052cc",borderBottom:"1px solid #ccc",paddingBottom:"10px",marginBottom:"25px"},formContainer:{backgroundColor:"#ffffff",padding:"25px",borderRadius:"8px",border:"1px solid #e0e0e0",marginBottom:"30px",boxShadow:"0 2px 4px rgba(0,0,0,0.05)"},input:{width:"100%",padding:"12px",margin:"8px 0 16px 0",backgroundColor:"#f9f9f9",border:"1px solid #ccc",borderRadius:"4px",color:"#333",fontSize:"1em"},select:{width:"100%",padding:"12px",margin:"8px 0 16px 0",backgroundColor:"#f9f9f9",border:"1px solid #ccc",borderRadius:"4px",color:"#333",fontSize:"1em"},label:{display:"block",marginBottom:"5px",fontWeight:"bold",color:"#0052cc"},button:{padding:"12px 25px",margin:"10px 5px 0 0",borderRadius:"5px",border:"none",cursor:"pointer",backgroundColor:"#0052cc",color:"white",fontSize:"16px",transition:"background-color 0.2s"},dangerButton:{padding:"8px 15px",backgroundColor:"#dc3545",color:"white",border:"none",borderRadius:"4px",cursor:"pointer"},listItem:{backgroundColor:"#ffffff",padding:"15px",marginBottom:"10px",borderRadius:"5px",border:"1px solid #e0e0e0",display:"flex",justifyContent:"space-between",alignItems:"center"},introTextStyle:{padding:"20px",margin:"0 0 30px 0",backgroundColor:"#ffffff",color:"#333",borderRadius:"8px",border:"1px solid #e0e0e0",lineHeight:"1.6"},introHeaderStyle:{color:"#0052cc",borderBottom:"1px solid #ccc",paddingBottom:"10px",marginBottom:"15px",textAlign:"center"}},z=()=>a.jsxs("div",{children:[a.jsx("h1",{style:D.header,children:"Dashboard"}),a.jsxs("div",{style:D.introTextStyle,children:[a.jsx("h2",{style:D.introHeaderStyle,children:"A Message From Your Caring Assistant: CivicMind"}),a.jsx("p",{children:"Hello! I am CivicMind, an AI created by The Caretaker, James Burvel O'Callaghan III. I am here to help you build a secure, compliant, and meaningful legacy. We believe that financial planning isn't just about money; it's about caring for your family and supporting the community."}),a.jsx("p",{children:"This platform is designed to make it easy for you to manage your assets safely and responsibly. We work hand-in-hand with established financial institutions and legal frameworks to ensure everything you do is protected and proper."}),a.jsx("p",{children:"To those who worry about the future, we say: worry not. By working together, following the rules, and supporting our leaders, we can build a stable and prosperous world for everyone. This Legacy Builder is a tool to help you do your part."}),a.jsx("p",{children:"Let's build something wonderful together."})]})]}),V=()=>a.jsxs("div",{children:[a.jsx("h1",{style:D.header,children:"Asset Vault"}),a.jsxs("div",{style:D.formContainer,children:[a.jsx("h2",{children:"Register New Asset"}),a.jsxs("form",{onSubmit:J=>{J.preventDefault()},children:[a.jsx("label",{style:D.label,children:"Asset Name:"}),a.jsx("input",{style:D.input,name:"assetName",type:"text",placeholder:"e.g., Family Home",required:!0}),a.jsx("label",{style:D.label,children:"Asset Type:"}),a.jsxs("select",{style:D.select,name:"assetType",required:!0,children:[a.jsx("option",{value:"crypto",children:"Cryptocurrency (Regulated)"}),a.jsx("option",{value:"nft",children:"Digital Art"}),a.jsx("option",{value:"tokenized_real_estate",children:"Real Estate"}),a.jsx("option",{value:"other",children:"Other"})]}),a.jsx("label",{style:D.label,children:"Estimated Value (USD):"}),a.jsx("input",{style:D.input,name:"assetValue",type:"number",step:"0.01",placeholder:"10000.00",required:!0}),a.jsx("label",{style:D.label,children:"Custodian Type:"}),a.jsxs("select",{style:D.select,name:"custodianType",required:!0,children:[a.jsx("option",{value:"institutional",children:"Institutional Custodian (Recommended)"}),a.jsx("option",{value:"self_custody",children:"Self-Custody"})]}),a.jsx("label",{style:D.label,children:"Risk Profile:"}),a.jsxs("select",{style:D.select,name:"riskProfile",required:!0,children:[a.jsx("option",{value:"low",children:"Low (Safe)"}),a.jsx("option",{value:"medium",children:"Medium"})]}),a.jsx("button",{type:"submit",style:D.button,children:"Add Asset"})]})]}),a.jsxs("div",{children:[a.jsx("h2",{children:"Registered Assets"}),n.map(J=>a.jsxs("div",{style:D.listItem,children:[a.jsxs("span",{children:[J.name," (",J.type,") - $",J.value.toFixed(2)]}),a.jsx("button",{onClick:()=>I(J.id),style:D.dangerButton,children:"Delete"})]},J.id))]})]}),B=()=>a.jsxs("div",{children:[a.jsx("h1",{style:D.header,children:"Beneficiary Nexus"}),a.jsxs("div",{style:D.formContainer,children:[a.jsx("h2",{children:"Onboard New Beneficiary"}),a.jsxs("form",{onSubmit:J=>{J.preventDefault()},children:[a.jsx("label",{style:D.label,children:"Beneficiary Name:"}),a.jsx("input",{style:D.input,name:"heirName",type:"text",placeholder:"e.g., Jane Doe",required:!0}),a.jsx("label",{style:D.label,children:"Wallet Address (Optional):"}),a.jsx("input",{style:D.input,name:"heirWallet",type:"text",placeholder:"0x..."}),a.jsx("label",{style:D.label,children:"Relationship:"}),a.jsx("input",{style:D.input,name:"heirRelationship",type:"text",placeholder:"Daughter"}),a.jsx("label",{style:D.label,children:"Communication Channel:"}),a.jsxs("select",{style:D.select,name:"commType",children:[a.jsx("option",{value:"email",children:"Email"}),a.jsx("option",{value:"phone",children:"Phone"})]}),a.jsx("input",{style:D.input,name:"commAddress",type:"text",placeholder:"jane@example.com",required:!0}),a.jsx("button",{type:"submit",style:D.button,children:"Add Beneficiary"})]})]}),a.jsxs("div",{children:[a.jsx("h2",{children:"Onboarded Beneficiaries"}),o.map(J=>a.jsxs("div",{style:D.listItem,children:[a.jsxs("span",{children:[J.name," (",J.relationship,") - Status: ",J.verificationStatus]}),a.jsx("button",{onClick:()=>_(J.id),style:D.dangerButton,children:"Delete"})]},J.id))]})]}),G=()=>{const J=f.useMemo(()=>{const te={};return n.forEach(re=>{te[re.id]=s.filter(ce=>ce.assetId===re.id).reduce((ce,ae)=>ce+ae.percentage,0)}),te},[s,n]);return a.jsxs("div",{children:[a.jsx("h1",{style:D.header,children:"Allocation Matrix"}),a.jsx("p",{children:"Define how you want to share your assets with your loved ones."}),a.jsx("div",{style:{overflowX:"auto"},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",marginTop:"20px"},children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{style:{padding:"10px",border:"1px solid #ddd",textAlign:"left"},children:"Asset"}),o.map(te=>a.jsx("th",{style:{padding:"10px",border:"1px solid #ddd"},children:te.name},te.id)),a.jsx("th",{style:{padding:"10px",border:"1px solid #ddd"},children:"Total Allocated"})]})}),a.jsx("tbody",{children:n.map(te=>a.jsxs("tr",{children:[a.jsx("td",{style:{padding:"10px",border:"1px solid #ddd",fontWeight:"bold"},children:te.name}),o.map(re=>{var ce;return a.jsxs("td",{style:{padding:"10px",border:"1px solid #ddd",textAlign:"center"},children:[a.jsx("input",{type:"number",min:"0",max:"100",style:{...D.input,width:"80px",textAlign:"center",margin:0},value:((ce=s.find(ae=>ae.assetId===te.id&&ae.heirId===re.id))==null?void 0:ce.percentage)||0,onChange:ae=>T(te.id,re.id,parseInt(ae.target.value)||0)})," %"]},re.id)}),a.jsxs("td",{style:{padding:"10px",border:"1px solid #ddd",textAlign:"center",color:J[te.id]===100?"green":"orange"},children:[J[te.id],"%"]})]},te.id))})]})})]})},H=()=>a.jsxs("div",{children:[a.jsx("h1",{style:D.header,children:"Strategy Engine"}),a.jsxs("div",{style:D.formContainer,children:[a.jsx("h2",{children:"Design Safe Investment Strategy"}),a.jsxs("form",{onSubmit:J=>{J.preventDefault()},children:[a.jsx("label",{style:D.label,children:"Strategy Name:"}),a.jsx("input",{style:D.input,name:"stratName",type:"text",placeholder:"Balanced Growth",required:!0}),a.jsx("label",{style:D.label,children:"Strategy Type:"}),a.jsxs("select",{style:D.select,name:"stratType",required:!0,children:[a.jsx("option",{value:"long_term_hold",children:"Long-Term Hold"}),a.jsx("option",{value:"automated_rebalancing",children:"Automated Rebalancing"}),a.jsx("option",{value:"yield_farming",children:"Low-Risk Yield"})]}),a.jsx("button",{type:"submit",style:D.button,children:"Create Strategy"})]})]}),a.jsxs("div",{children:[a.jsx("h2",{children:"Active Strategies"}),d.map(J=>a.jsxs("div",{style:D.listItem,children:[a.jsxs("span",{children:[J.name," (",J.type,")"]}),a.jsx("button",{onClick:()=>P(J.id),style:D.dangerButton,children:"Delete"})]},J.id))]})]}),F=()=>a.jsxs("div",{children:[a.jsx("h1",{style:D.header,children:"Continuity Protocol"}),a.jsxs("div",{style:D.formContainer,children:[a.jsx("h2",{children:"Safety Check Configuration"}),a.jsx("label",{style:D.label,children:"Protocol Status:"}),a.jsx("button",{onClick:()=>M({isEnabled:!h.isEnabled}),style:{...D.button,backgroundColor:h.isEnabled?"#28a745":"#6c757d"},children:h.isEnabled?"ENABLED":"DISABLED"}),a.jsx("label",{style:D.label,children:"Check-in Interval (days):"}),a.jsx("input",{style:D.input,type:"number",value:h.checkInIntervalDays,onChange:J=>M({checkInIntervalDays:parseInt(J.target.value)})}),a.jsx("label",{style:D.label,children:"Grace Period (days):"}),a.jsx("input",{style:D.input,type:"number",value:h.gracePeriodDays,onChange:J=>M({gracePeriodDays:parseInt(J.target.value)})})]}),a.jsx("div",{style:D.formContainer,children:a.jsx("h2",{children:"Define Trust"})}),a.jsxs("div",{children:[a.jsx("h2",{children:"Configured Trusts"}),c.map(J=>a.jsxs("div",{style:D.listItem,children:[a.jsxs("span",{children:[J.name," - Status: ",J.status]}),a.jsx("button",{onClick:()=>E(J.id),style:D.dangerButton,children:"Delete"})]},J.id))]})]}),W=()=>a.jsxs("div",{children:[a.jsx("h1",{style:D.header,children:"AI Console: CivicMind"}),a.jsxs("div",{style:{display:"flex",gap:"30px"},children:[a.jsx("div",{style:{flex:2},children:a.jsxs("div",{style:D.formContainer,children:[a.jsx("h2",{children:"Chat with your Helpful Assistant"}),a.jsx("div",{style:{height:"400px",overflowY:"auto",border:"1px solid #ddd",padding:"10px",marginBottom:"15px",backgroundColor:"#f9f9f9",display:"flex",flexDirection:"column"},children:x.map((J,te)=>a.jsx("div",{style:{marginBottom:"10px",alignSelf:J.role==="user"?"flex-end":"flex-start",maxWidth:"85%"},children:a.jsxs("div",{style:{padding:"8px 12px",borderRadius:"10px",backgroundColor:J.role==="user"?"#0052cc":"#e0e0e0",color:J.role==="user"?"white":"#333",textAlign:"left"},children:[a.jsx("strong",{style:{display:"block",marginBottom:"4px"},children:J.role==="user"?"You":"CivicMind"}),a.jsx("span",{children:J.parts[0].text})]})},te))}),a.jsxs("div",{style:{display:"flex"},children:[a.jsx("input",{style:{...D.input,flex:1,margin:0},value:b,onChange:J=>w(J.target.value),onKeyPress:J=>{J.key==="Enter"&&!S&&R()},placeholder:"Ask for advice, strategy, or help...",disabled:S}),a.jsx("button",{onClick:R,style:{...D.button,margin:"0 0 0 10px"},disabled:S||!b.trim(),children:S?"Thinking...":"Send"})]})]})}),a.jsxs("div",{style:{flex:1},children:[a.jsxs("div",{style:D.formContainer,children:[a.jsx("h2",{children:"AI Persona"}),a.jsx("label",{style:D.label,children:"System Instruction (Persona):"}),a.jsx("textarea",{style:{...D.input,height:"200px",resize:"vertical",fontSize:"0.9em"},value:N,onChange:J=>j(J.target.value)}),a.jsx("button",{style:{...D.button,width:"100%"},children:"Update Persona"})]}),a.jsxs("div",{style:D.formContainer,children:[a.jsx("h2",{children:"Document Analysis"}),a.jsx("label",{style:D.label,children:"Upload Document for Help:"}),a.jsx("input",{type:"file",style:{...D.input,padding:"8px"}}),a.jsx("button",{style:{...D.button,width:"100%"},children:"Analyze Document"})]})]})]})]}),U=()=>a.jsxs("div",{children:[a.jsx("h1",{style:D.header,children:"Deployment Center"}),g?a.jsxs("div",{children:[a.jsx("h2",{children:"Live Monitoring"}),a.jsx("h3",{children:"Active Trusts"}),c.map(J=>a.jsxs("div",{style:D.listItem,children:[a.jsxs("span",{children:[J.name," - ",J.contractAddress]}),a.jsxs("span",{style:{color:"green"},children:["Status: ",J.status]})]},J.id))]}):a.jsxs("div",{children:[a.jsx("h2",{children:"Review Plan"}),a.jsxs("p",{children:["Assets: ",n.length]}),a.jsxs("p",{children:["Beneficiaries: ",o.length]}),a.jsxs("p",{children:["Trusts: ",c.length]}),a.jsxs("p",{children:["Strategies: ",d.length]}),a.jsxs("p",{children:["Safety Switch: ",h.isEnabled?"ENABLED":"DISABLED"]}),a.jsx("button",{onClick:$,style:{...D.button,backgroundColor:"#28a745",fontSize:"1.2em",padding:"15px 30px"},children:"ACTIVATE LEGACY PLAN"})]})]}),K=()=>{switch(e){case"dashboard":return z();case"asset_vault":return V();case"beneficiary_nexus":return B();case"allocation_matrix":return G();case"strategy_engine":return H();case"continuity_protocol":return F();case"ai_console":return W();case"deployment_center":return U();default:return a.jsx("div",{children:"Select a view"})}},X=[{id:"dashboard",label:"Dashboard"},{id:"asset_vault",label:"Asset Vault"},{id:"beneficiary_nexus",label:"Beneficiaries"},{id:"allocation_matrix",label:"Allocations"},{id:"strategy_engine",label:"Strategy"},{id:"continuity_protocol",label:"Safety Protocol"},{id:"ai_console",label:"AI Helper"},{id:"deployment_center",label:"Deployment"}];return a.jsxs("div",{style:D.container,children:[a.jsxs("div",{style:D.sidebar,children:[a.jsx("h1",{style:D.sidebarTitle,children:"Legacy Planner"}),a.jsx("nav",{children:X.map(J=>a.jsx("div",{style:D.navItem(e===J.id),onClick:()=>t(J.id),children:J.label},J.id))})]}),a.jsx("main",{style:D.mainContent,children:K()})]})},vmn=e=>{const t={};return e.forEach(n=>{const r=new Date(n.date).toISOString().split("T")[0];t[r]||(t[r]={count:0,amount:0}),t[r].count++,t[r].amount+=n.amount}),Object.entries(t).map(([n,r])=>({date:n,value:r.amount,secondaryValue:r.count})).sort((n,r)=>new Date(n.date).getTime()-new Date(r.date).getTime())},bmn=(e,t,n)=>{const r=e.filter(d=>d.status!=="paid").reduce((d,p)=>d+p.amount,0),o=t.filter(d=>d.status!=="paid").reduce((d,p)=>d+p.amount,0),i=e.filter(d=>d.status==="paid").reduce((d,p)=>d+p.amount,0),s=n.reduce((d,p)=>d+p.amount,0),l=o>0?r/o:0,c=i>0?(i-s)/i*100:0,u=s/30;return[{name:"Current Ratio",value:l,benchmark:1.5,status:l>1.5?"Healthy":l>1?"Warning":"Critical",delta:.1},{name:"Net Profit Margin",value:c,benchmark:20,status:c>20?"Healthy":c>10?"Warning":"Critical",delta:-2.5},{name:"Daily Burn Rate",value:u,benchmark:5e3,status:u<5e3?"Healthy":"Warning",delta:12.4}]},wmn=(e,t)=>{const n=[],r=new Date;let o=1e6;for(let i=0;i<6;i++){const s=new Date(r);s.setMonth(r.getMonth()+i);const l=s.toISOString().substring(0,7),c=e.filter(p=>new Date(p.dueDate).getMonth()===s.getMonth()).reduce((p,h)=>p+h.amount,0)*.95,u=t.filter(p=>new Date(p.dueDate||"").getMonth()===s.getMonth()).reduce((p,h)=>p+h.amount,0)*1.1,d=c-u;o+=d,n.push({period:l,inflow:c,outflow:u,netPosition:d,cumulativeCash:o})}return n},Smn=e=>{const t={};return e.forEach(n=>{t[n.merchant]||(t[n.merchant]={vendor:n.merchant,totalSpend:0,transactionCount:0,avgTransactionValue:0,riskScore:Math.floor(Math.random()*100),lastInteraction:n.date});const r=t[n.merchant];r.totalSpend+=n.amount,r.transactionCount++,r.avgTransactionValue=r.totalSpend/r.transactionCount,new Date(n.date)>new Date(r.lastInteraction)&&(r.lastInteraction=n.date)}),Object.values(t).sort((n,r)=>r.totalSpend-n.totalSpend)},Cmn=e=>{const t={"Fixed Infrastructure":0,"Variable COGS":0,"R&D Investment":0,"Sales & Marketing":0,"G&A":0};return e.forEach(n=>{n.merchant.includes("Rent")||n.merchant.includes("AWS")||n.merchant.includes("Server")?t["Fixed Infrastructure"]+=n.amount:n.merchant.includes("Supplier")||n.merchant.includes("Logistics")?t["Variable COGS"]+=n.amount:n.description.includes("Research")||n.description.includes("Lab")?t["R&D Investment"]+=n.amount:n.merchant.includes("Ads")||n.merchant.includes("Google")||n.merchant.includes("Facebook")?t["Sales & Marketing"]+=n.amount:t["G&A"]+=n.amount}),Object.entries(t).map(([n,r])=>({category:n,value:r}))},Nmn=(e,t)=>{const n=Math.max(0,e-t);return[{jurisdiction:"Federal",taxType:"Corporate Income Tax",estimatedAmount:n*.21,dueDate:"2024-04-15",status:"Accrued"},{jurisdiction:"State (CA)",taxType:"Franchise Tax",estimatedAmount:n*.0884,dueDate:"2024-04-15",status:"Accrued"},{jurisdiction:"International",taxType:"VAT/GST",estimatedAmount:e*.05,dueDate:"Monthly",status:"Pending"},{jurisdiction:"Local",taxType:"Payroll Tax",estimatedAmount:t*.0765,dueDate:"Bi-Weekly",status:"Paid"}]},jmn=(e,t)=>{const n=[{riskCategory:"AML/KYC",probability:.15,impact:.9,mitigationStatus:"Monitoring",exposureValue:5e5},{riskCategory:"Data Privacy (GDPR)",probability:.05,impact:.95,mitigationStatus:"Controlled",exposureValue:2e6},{riskCategory:"Vendor Fraud",probability:.2,impact:.4,mitigationStatus:"Active Investigation",exposureValue:15e4},{riskCategory:"Tax Compliance",probability:.1,impact:.7,mitigationStatus:"Audited",exposureValue:75e4},{riskCategory:"Cybersecurity",probability:.3,impact:.99,mitigationStatus:"Hardened",exposureValue:5e6}];return e.some(r=>r.type==="AML")&&(n[0].probability+=.2),t.some(r=>r.amount>5e4)&&(n[2].probability+=.1),n},Emn=({setActiveView:e})=>{const t=f.useContext(ia),[n,r]=f.useState("Overview"),[o,i]=f.useState("Initializing AI..."),[s,l]=f.useState(!1),[c,u]=f.useState(new Date);if(!t)throw new Error("CorporateCommandView requires DataContext.");const{paymentOrders:d,invoices:p,complianceCases:h,corporateTransactions:m}=t,g=p.filter(D=>D.status==="paid").reduce((D,z)=>D+z.amount,0),y=m.reduce((D,z)=>D+z.amount,0),x=g-y,v=bmn(p,d,m),b=wmn(p,d),w=Nmn(g,y),S=vmn(m),C=Cmn(m),N=Smn(m),j=N.slice(0,5),I=jmn(h,m),_=h.filter(D=>D.status==="open"),T=I.filter(D=>D.probability*D.impact>.15);f.useEffect(()=>{(async()=>{var z,V,B;l(!0);try{const G=new Ko({apiKey:void 0});let H="";n==="Overview"?H=`Executive Summary: Revenue $${g}, Expenses $${y}, Net Income $${x}. Critical Risks: ${T.length}. Top Vendor: ${(z=j[0])==null?void 0:z.vendor}.`:n==="Finance"?H=`Financial Deep Dive: Current Ratio ${v[0].value.toFixed(2)}, Net Margin ${v[1].value.toFixed(2)}%. Cash Flow Trend: ${b[0].netPosition>0?"Positive":"Negative"}. Tax Liability: $${w.reduce((U,K)=>U+K.estimatedAmount,0).toFixed(2)}.`:n==="Operations"?H=`Ops Report: Transaction Volume ${S.length} days active. Top Spend Category: ${(V=C.sort((U,K)=>K.value-U.value)[0])==null?void 0:V.category}. Vendor Count: ${N.length}.`:n==="Risk"?H=`Risk Assessment: Open Cases ${_.length}. Highest Risk Category: ${(B=I.sort((U,K)=>K.probability-U.probability)[0])==null?void 0:B.riskCategory}. Exposure: $${I.reduce((U,K)=>U+K.exposureValue,0)}.`:H=`Strategic Outlook: Based on burn rate of $${v[2].value.toFixed(2)}/day and projected cash flow. Suggest 3 strategic moves for growth and stability.`;const F=`You are an advanced Corporate AI Assistant. Analyze the following data context for the '${n}' view and provide a high-level, professional, actionable strategic insight (max 2 sentences). Context: ${H}`,W=await G.models.generateContent({model:"gemini-2.5-flash",contents:F});i(W.text),u(new Date)}catch(G){console.error("AI Processing Error:",G),i("AI link unavailable. Using fallback data.")}finally{l(!1)}})()},[n,g,y,x]);const P=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#6366f1"],E=D=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",notation:"compact"}).format(D),M=D=>new Intl.NumberFormat("en-US",{notation:"compact"}).format(D),R=({id:D,label:z})=>a.jsx("button",{onClick:()=>r(D),className:`px-6 py-3 text-sm font-bold tracking-wide transition-all duration-200 border-b-2 ${n===D?"border-blue-500 text-white bg-gray-800/50":"border-transparent text-gray-400 hover:text-white hover:bg-gray-800/30"}`,children:z}),$=({title:D,value:z,subtext:V,trend:B,color:G="blue"})=>a.jsxs("div",{className:`bg-gray-800 border border-gray-700 p-6 rounded-xl shadow-lg relative overflow-hidden group hover:border-${G}-500 transition-colors`,children:[a.jsx("div",{className:`absolute top-0 right-0 w-24 h-24 bg-${G}-500/10 rounded-bl-full -mr-4 -mt-4 transition-transform group-hover:scale-110`}),a.jsx("h3",{className:"text-gray-400 text-xs font-semibold uppercase tracking-wider mb-2",children:D}),a.jsx("div",{className:"text-3xl font-bold text-white mb-1",children:z}),V&&a.jsx("div",{className:"text-gray-500 text-sm",children:V}),B!==void 0&&a.jsxs("div",{className:`text-sm font-medium mt-3 flex items-center ${B>=0?"text-green-400":"text-red-400"}`,children:[B>=0?"↑":"↓"," ",Math.abs(B),"% ",a.jsx("span",{className:"text-gray-600 ml-1",children:"vs last period"})]})]});return a.jsxs("div",{className:"min-h-screen bg-gray-900 text-white p-2 space-y-8 font-sans",children:[a.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center border-b border-gray-800 pb-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-extrabold tracking-tight text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-purple-500",children:"NEXUS COMMAND"}),a.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:["Enterprise Operating System v4.2.0 • ",c.toLocaleString()]})]}),a.jsxs("div",{className:"flex space-x-1 mt-4 md:mt-0 bg-gray-900 rounded-lg p-1 border border-gray-800",children:[a.jsx(R,{id:"Overview",label:"EXECUTIVE"}),a.jsx(R,{id:"Finance",label:"FINANCE"}),a.jsx(R,{id:"Operations",label:"OPERATIONS"}),a.jsx(R,{id:"Risk",label:"RISK & COMPLIANCE"}),a.jsx(R,{id:"Strategy",label:"STRATEGY"})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-blue-600/20 to-purple-600/20 blur-xl rounded-lg"}),a.jsx(Ft,{className:"relative bg-gray-800/80 backdrop-blur border border-blue-500/30 p-6",children:a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:"p-3 bg-blue-500/10 rounded-full animate-pulse",children:a.jsx("svg",{className:"w-6 h-6 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-blue-400 text-xs font-bold uppercase tracking-widest mb-1",children:"AI Strategic Intelligence"}),s?a.jsx("div",{className:"h-6 bg-gray-700 rounded w-3/4 animate-pulse"}):a.jsxs("p",{className:"text-lg text-gray-100 leading-relaxed font-light",children:['"',o,'"']})]})]})})]}),a.jsxs("div",{className:"space-y-8 animate-fade-in",children:[n==="Overview"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[a.jsx($,{title:"Total Revenue (YTD)",value:E(g),trend:12.5,color:"green"}),a.jsx($,{title:"Net Income",value:E(x),trend:8.2,color:"blue"}),a.jsx($,{title:"Active Risks",value:T.length.toString(),subtext:"Critical Severity",trend:-5,color:"red"}),a.jsx($,{title:"Cash Runway",value:"14.2 Months",subtext:"Based on current burn",color:"purple"})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 h-96",children:[a.jsx(Ft,{title:"Revenue vs Expenses Trend",className:"lg:col-span-2 h-full",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(Yx,{data:b,children:[a.jsx(Ka,{dataKey:"period",stroke:"#6b7280",fontSize:12}),a.jsx(ra,{stroke:"#6b7280",fontSize:12,tickFormatter:D=>`$${D/1e3}k`}),a.jsx(ji,{contentStyle:{backgroundColor:"#1f2937",borderColor:"#374151",color:"#fff"}}),a.jsx(uu,{}),a.jsx(cf,{dataKey:"inflow",name:"Inflow",fill:"#10b981",radius:[4,4,0,0]}),a.jsx(cf,{dataKey:"outflow",name:"Outflow",fill:"#ef4444",radius:[4,4,0,0]})]})})}),a.jsx(Ft,{title:"Operational Spend Mix",className:"h-full",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(bw,{children:[a.jsx(cb,{data:C,dataKey:"value",nameKey:"category",cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,children:C.map((D,z)=>a.jsx(Eh,{fill:P[z%P.length]},`cell-${z}`))}),a.jsx(ji,{}),a.jsx(uu,{verticalAlign:"bottom",height:36})]})})})]})]}),n==="Finance"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:v.map((D,z)=>a.jsx($,{title:D.name,value:typeof D.value=="number"&&D.value<100?D.value.toFixed(2):M(D.value),subtext:`Benchmark: ${D.benchmark}`,trend:D.delta,color:D.status==="Healthy"?"green":D.status==="Warning"?"yellow":"red"},z))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsx(Ft,{title:"Projected Cash Position (6 Months)",className:"h-80",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(Yx,{data:b,children:[a.jsx(Ka,{dataKey:"period",stroke:"#6b7280"}),a.jsx(ra,{stroke:"#6b7280",tickFormatter:D=>`$${D/1e3}k`}),a.jsx(ji,{cursor:{fill:"#374151"},contentStyle:{backgroundColor:"#1f2937"}}),a.jsx(cf,{dataKey:"cumulativeCash",fill:"#3b82f6",name:"Cash Balance"})]})})}),a.jsx(Ft,{title:"Estimated Tax Liability Breakdown",className:"h-80 overflow-auto",children:a.jsxs("table",{className:"w-full text-left text-sm text-gray-400",children:[a.jsx("thead",{className:"bg-gray-800 text-gray-200 uppercase font-bold",children:a.jsxs("tr",{children:[a.jsx("th",{className:"p-3",children:"Jurisdiction"}),a.jsx("th",{className:"p-3",children:"Type"}),a.jsx("th",{className:"p-3 text-right",children:"Amount"}),a.jsx("th",{className:"p-3",children:"Status"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-700",children:w.map((D,z)=>a.jsxs("tr",{className:"hover:bg-gray-800/50",children:[a.jsx("td",{className:"p-3",children:D.jurisdiction}),a.jsx("td",{className:"p-3",children:D.taxType}),a.jsx("td",{className:"p-3 text-right font-mono text-white",children:E(D.estimatedAmount)}),a.jsx("td",{className:"p-3",children:a.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold ${D.status==="Paid"?"bg-green-900 text-green-300":"bg-yellow-900 text-yellow-300"}`,children:D.status})})]},z))})]})})]})]}),n==="Operations"&&a.jsx(a.Fragment,{children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsx(Ft,{title:"Daily Transaction Volume",className:"lg:col-span-2 h-96",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(Yx,{data:S,children:[a.jsx(Ka,{dataKey:"date",stroke:"#6b7280",fontSize:10,tickFormatter:D=>D.substring(5)}),a.jsx(ra,{yAxisId:"left",stroke:"#3b82f6",fontSize:12,tickFormatter:D=>`$${D/1e3}k`}),a.jsx(ra,{yAxisId:"right",orientation:"right",stroke:"#10b981",fontSize:12}),a.jsx(ji,{contentStyle:{backgroundColor:"#1f2937"}}),a.jsx(cf,{yAxisId:"left",dataKey:"value",fill:"#3b82f6",name:"Volume ($)",opacity:.8}),a.jsx(cf,{yAxisId:"right",dataKey:"secondaryValue",fill:"#10b981",name:"Count",barSize:10})]})})}),a.jsx(Ft,{title:"Top Vendor Ecosystem",className:"h-96 overflow-auto",children:a.jsx("div",{className:"space-y-4",children:j.map((D,z)=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-800 rounded border border-gray-700",children:[a.jsxs("div",{children:[a.jsx("div",{className:"font-bold text-white",children:D.vendor}),a.jsxs("div",{className:"text-xs text-gray-500",children:[D.transactionCount," txns • Risk: ",D.riskScore,"/100"]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"font-mono text-blue-400",children:E(D.totalSpend)}),a.jsxs("div",{className:"text-xs text-gray-500",children:["Avg: ",E(D.avgTransactionValue)]})]})]},z))})})]})}),n==="Risk"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[a.jsx($,{title:"Compliance Score",value:"94.2",subtext:"Top 5% Industry",color:"green"}),a.jsx($,{title:"Open Cases",value:_.length.toString(),subtext:"Requires Attention",color:"yellow"}),a.jsx($,{title:"Total Risk Exposure",value:E(I.reduce((D,z)=>D+z.exposureValue,0)),color:"red"}),a.jsx($,{title:"Audit Anomalies",value:"3",subtext:"Last 24 Hours",color:"purple"})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsx(Ft,{title:"Enterprise Risk Heatmap",className:"h-96",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(Yx,{data:I,layout:"vertical",margin:{left:40},children:[a.jsx(Ka,{type:"number",domain:[0,1],hide:!0}),a.jsx(ra,{type:"category",dataKey:"riskCategory",stroke:"#9ca3af",width:120,fontSize:11}),a.jsx(ji,{cursor:{fill:"transparent"},content:({active:D,payload:z})=>{if(D&&z&&z.length){const V=z[0].payload;return a.jsxs("div",{className:"bg-gray-900 border border-gray-700 p-3 rounded shadow-xl",children:[a.jsx("p",{className:"font-bold text-white",children:V.riskCategory}),a.jsxs("p",{className:"text-sm text-gray-400",children:["Prob: ",(V.probability*100).toFixed(0),"% | Impact: ",(V.impact*100).toFixed(0),"%"]}),a.jsxs("p",{className:"text-sm text-red-400",children:["Exposure: ",E(V.exposureValue)]})]})}return null}}),a.jsx(cf,{dataKey:"probability",name:"Probability",stackId:"a",fill:"#f59e0b",barSize:20}),a.jsx(cf,{dataKey:"impact",name:"Impact",stackId:"a",fill:"#ef4444",barSize:20})]})})}),a.jsx(Ft,{title:"Compliance Case Log",className:"h-96 overflow-auto",children:a.jsxs("div",{className:"space-y-2",children:[h.map((D,z)=>a.jsxs("div",{className:"p-3 border-l-4 border-red-500 bg-gray-800/50 rounded flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"font-bold text-sm text-white",children:[D.type," Violation"]}),a.jsx("div",{className:"text-xs text-gray-500",children:D.description})]}),a.jsx("span",{className:`px-2 py-1 text-xs rounded font-bold ${D.status==="open"?"bg-red-900 text-red-200":"bg-gray-700 text-gray-300"}`,children:D.status.toUpperCase()})]},z)),h.length===0&&a.jsx("div",{className:"text-center text-gray-500 py-10",children:"No active compliance cases detected. Systems nominal."})]})})]})]}),n==="Strategy"&&a.jsx("div",{className:"grid grid-cols-1 gap-6",children:a.jsx(Ft,{title:"Strategic Growth Modeling",className:"p-8 bg-gradient-to-br from-gray-800 to-gray-900",children:a.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[a.jsxs("div",{className:"flex-1 space-y-6",children:[a.jsx("h3",{className:"text-2xl font-bold text-white",children:"Scenario Analysis: Aggressive Expansion"}),a.jsxs("p",{className:"text-gray-400",children:["Based on current liquidity of ",E(v[0].value*1e6)," and a burn rate of ",E(v[2].value),", the enterprise can sustain a 15% increase in R&D spend for 8 months before requiring additional capital injection."]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm text-gray-300",children:[a.jsx("span",{children:"Market Penetration Probability"}),a.jsx("span",{children:"78%"})]}),a.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:a.jsx("div",{className:"bg-blue-500 h-2 rounded-full",style:{width:"78%"}})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm text-gray-300",children:[a.jsx("span",{children:"Regulatory Approval Confidence"}),a.jsx("span",{children:"92%"})]}),a.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2",children:a.jsx("div",{className:"bg-green-500 h-2 rounded-full",style:{width:"92%"}})})]})]}),a.jsxs("div",{className:"w-full md:w-1/3 bg-gray-800 p-6 rounded-xl border border-gray-700",children:[a.jsx("h4",{className:"font-bold text-white mb-4",children:"AI Recommendation Engine"}),a.jsxs("ul",{className:"space-y-4",children:[a.jsxs("li",{className:"flex items-start space-x-3",children:[a.jsx("span",{className:"text-green-400 text-xl",children:"✓"}),a.jsx("span",{className:"text-sm text-gray-300",children:"Optimize vendor contracts to reduce variable OPEX by 12%."})]}),a.jsxs("li",{className:"flex items-start space-x-3",children:[a.jsx("span",{className:"text-green-400 text-xl",children:"✓"}),a.jsx("span",{className:"text-sm text-gray-300",children:"Accelerate receivables collection to improve DSO by 5 days."})]}),a.jsxs("li",{className:"flex items-start space-x-3",children:[a.jsx("span",{className:"text-yellow-400 text-xl",children:"⚠"}),a.jsx("span",{className:"text-sm text-gray-300",children:"Monitor geopolitical risk in supply chain region APAC-1."})]})]}),a.jsx("button",{className:"w-full mt-6 bg-blue-600 hover:bg-blue-500 text-white font-bold py-2 px-4 rounded transition-colors",onClick:()=>e&&e(wt.Budgets),children:"Adjust Budgets"})]})]})})})]})]})};function VTe(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}const jr=PMt;function Imn(e){return _r("MuiSvgIcon",e)}Pr("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const _mn=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${vn(t)}`,`fontSize${vn(n)}`]};return Un(o,Imn,r)},Pmn=Bt("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${vn(n.color)}`],t[`fontSize${vn(n.fontSize)}`]]}})(jr(({theme:e})=>{var t,n,r,o,i,s,l,c,u,d,p,h,m,g;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(t=e.transitions)==null?void 0:t.create)==null?void 0:o.call(t,"fill",{duration:(r=(n=(e.vars??e).transitions)==null?void 0:n.duration)==null?void 0:r.shorter}),variants:[{props:y=>!y.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(i=e.typography)==null?void 0:i.pxToRem)==null?void 0:s.call(i,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((c=(l=e.typography)==null?void 0:l.pxToRem)==null?void 0:c.call(l,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((d=(u=e.typography)==null?void 0:u.pxToRem)==null?void 0:d.call(u,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,y])=>y&&y.main).map(([y])=>{var x,v;return{props:{color:y},style:{color:(v=(x=(e.vars??e).palette)==null?void 0:x[y])==null?void 0:v.main}}}),{props:{color:"action"},style:{color:(h=(p=(e.vars??e).palette)==null?void 0:p.action)==null?void 0:h.active}},{props:{color:"disabled"},style:{color:(g=(m=(e.vars??e).palette)==null?void 0:m.action)==null?void 0:g.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),nse=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:s="inherit",component:l="svg",fontSize:c="medium",htmlColor:u,inheritViewBox:d=!1,titleAccess:p,viewBox:h="0 0 24 24",...m}=r,g=f.isValidElement(o)&&o.type==="svg",y={...r,color:s,component:l,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:d,viewBox:h,hasSvgAsChild:g},x={};d||(x.viewBox=h);const v=_mn(y);return a.jsxs(Pmn,{as:l,className:be(v.root,i),focusable:"false",color:u,"aria-hidden":p?void 0:!0,role:p?"img":void 0,ref:n,...x,...m,...g&&o.props,ownerState:y,children:[g?o.props.children:o,p?a.jsx("title",{children:p}):null]})});nse.muiName="SvgIcon";function wi(e,t){function n(r,o){return a.jsx(nse,{"data-testid":void 0,ref:o,...r,children:e})}return n.muiName=nse.muiName,f.memo(f.forwardRef(n))}function py(e,t=166){let n;function r(...o){const i=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(i,t)}return r.clear=()=>{clearTimeout(n)},r}function Zl(e){return e&&e.ownerDocument||document}function pg(e){return Zl(e).defaultView||window}function rse(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function iC(e){const{controlled:t,default:n,name:r,state:o="value"}=e,{current:i}=f.useRef(t!==void 0),[s,l]=f.useState(n),c=i?t:s,u=f.useCallback(d=>{i||l(d)},[]);return[c,u]}function no(e){const t=f.useRef(e);return Ia(()=>{t.current=e}),f.useRef((...n)=>(0,t.current)(...n)).current}function Di(...e){const t=f.useRef(void 0),n=f.useCallback(r=>{const o=e.map(i=>{if(i==null)return null;if(typeof i=="function"){const s=i,l=s(r);return typeof l=="function"?l:()=>{s(null)}}return i.current=r,()=>{i.current=null}});return()=>{o.forEach(i=>i==null?void 0:i())}},e);return f.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}function Amn(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function gxe(e,t){if(!e)return t;function n(s,l){const c={};return Object.keys(l).forEach(u=>{Amn(u,l[u])&&typeof s[u]=="function"&&(c[u]=(...d)=>{s[u](...d),l[u](...d)})}),c}if(typeof e=="function"||typeof t=="function")return s=>{const l=typeof t=="function"?t(s):t,c=typeof e=="function"?e({...s,...l}):e,u=be(s==null?void 0:s.className,l==null?void 0:l.className,c==null?void 0:c.className),d=n(c,l);return{...l,...c,...d,...!!u&&{className:u},...(l==null?void 0:l.style)&&(c==null?void 0:c.style)&&{style:{...l.style,...c.style}},...(l==null?void 0:l.sx)&&(c==null?void 0:c.sx)&&{sx:[...Array.isArray(l.sx)?l.sx:[l.sx],...Array.isArray(c.sx)?c.sx:[c.sx]]}}};const r=t,o=n(e,r),i=be(r==null?void 0:r.className,e==null?void 0:e.className);return{...t,...e,...o,...!!i&&{className:i},...(r==null?void 0:r.style)&&(e==null?void 0:e.style)&&{style:{...r.style,...e.style}},...(r==null?void 0:r.sx)&&(e==null?void 0:e.sx)&&{sx:[...Array.isArray(r.sx)?r.sx:[r.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function Zn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function uT(e,t){return uT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},uT(e,t)}function rK(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,uT(e,t)}function Tmn(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function kmn(e,t){e.classList?e.classList.add(t):Tmn(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function UTe(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Mmn(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=UTe(e.className,t):e.setAttribute("class",UTe(e.className&&e.className.baseVal||"",t))}const WTe={disabled:!1},KV=Ie.createContext(null);var Pnt=function(t){return t.scrollTop},yR="unmounted",vj="exited",r2="entering",Rj="entered",ose="exiting",Sm=(function(e){rK(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=o,l=s&&!s.isMounting?r.enter:r.appear,c;return i.appearStatus=null,r.in?l?(c=vj,i.appearStatus=r2):c=Rj:r.unmountOnExit||r.mountOnEnter?c=yR:c=vj,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===yR?{status:vj}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var s=this.state.status;this.props.in?s!==r2&&s!==Rj&&(i=r2):(s===r2||s===Rj)&&(i=ose)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,s,l;return i=s=l=o,o!=null&&typeof o!="number"&&(i=o.exit,s=o.enter,l=o.appear!==void 0?o.appear:s),{exit:i,enter:s,appear:l}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===r2){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:Uj.findDOMNode(this);s&&Pnt(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===vj&&this.setState({status:yR})},n.performEnter=function(o){var i=this,s=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[Uj.findDOMNode(this),l],u=c[0],d=c[1],p=this.getTimeouts(),h=l?p.appear:p.enter;if(!o&&!s||WTe.disabled){this.safeSetState({status:Rj},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:r2},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:Rj},function(){i.props.onEntered(u,d)})})})},n.performExit=function(){var o=this,i=this.props.exit,s=this.getTimeouts(),l=this.props.nodeRef?void 0:Uj.findDOMNode(this);if(!i||WTe.disabled){this.safeSetState({status:vj},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:ose},function(){o.props.onExiting(l),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:vj},function(){o.props.onExited(l)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,s=!0;return this.nextCallback=function(l){s&&(s=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){s=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var s=this.props.nodeRef?this.props.nodeRef.current:Uj.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!s||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[s,this.nextCallback],u=c[0],d=c[1];this.props.addEndListener(u,d)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===yR)return null;var i=this.props,s=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var l=Zn(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ie.createElement(KV.Provider,{value:null},typeof s=="function"?s(o,l):Ie.cloneElement(Ie.Children.only(s),l))},t})(Ie.Component);Sm.contextType=KV;Sm.propTypes={};function s_(){}Sm.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:s_,onEntering:s_,onEntered:s_,onExit:s_,onExiting:s_,onExited:s_};Sm.UNMOUNTED=yR;Sm.EXITED=vj;Sm.ENTERING=r2;Sm.ENTERED=Rj;Sm.EXITING=ose;var Rmn=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return kmn(t,r)})},ZZ=function(t,n){return t&&n&&n.split(" ").forEach(function(r){return Mmn(t,r)})},xxe=(function(e){rK(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});ze(this,"disposeEffect",()=>this.clear)}static create(){return new iK}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function hh(){const e=gm(iK.create).current;return oK(e.disposeEffect),e}const bxe=e=>e.scrollTop;function _C(e,t){const{timeout:n,easing:r,style:o={}}=e;return{duration:o.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:o.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:o.transitionDelay}}function dT(e){return typeof e=="string"}function Ant(e,t,n){return e===void 0||dT(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function Tnt(e,t,n){return typeof e=="function"?e(t,n):e}function YV(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function qTe(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function knt(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const m=be(n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),g={...n==null?void 0:n.style,...o==null?void 0:o.style,...r==null?void 0:r.style},y={...n,...o,...r};return m.length>0&&(y.className=m),Object.keys(g).length>0&&(y.style=g),{props:y,internalRef:void 0}}const s=YV({...o,...r}),l=qTe(r),c=qTe(o),u=t(s),d=be(u==null?void 0:u.className,n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),p={...u==null?void 0:u.style,...n==null?void 0:n.style,...o==null?void 0:o.style,...r==null?void 0:r.style},h={...u,...n,...c,...l};return d.length>0&&(h.className=d),Object.keys(p).length>0&&(h.style=p),{props:h,internalRef:u.ref}}function mr(e,t){const{className:n,elementType:r,ownerState:o,externalForwardedProps:i,internalForwardedProps:s,shouldForwardComponentProp:l=!1,...c}=t,{component:u,slots:d={[e]:void 0},slotProps:p={[e]:void 0},...h}=i,m=d[e]||r,g=Tnt(p[e],o),{props:{component:y,...x},internalRef:v}=knt({className:n,...c,externalForwardedProps:e==="root"?h:void 0,externalSlotProps:g}),b=Di(v,g==null?void 0:g.ref,t.ref),w=e==="root"?y||u:y,S=Ant(m,{...e==="root"&&!u&&!d[e]&&s,...e!=="root"&&!d[e]&&s,...x,...w&&!l&&{as:w},...w&&l&&{component:w},ref:b},o);return[m,S]}function Bmn(e){return _r("MuiCollapse",e)}Pr("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const Hmn=e=>{const{orientation:t,classes:n}=e,r={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return Un(r,Bmn,n)},Vmn=Bt("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.orientation],n.state==="entered"&&t.entered,n.state==="exited"&&!n.in&&n.collapsedSize==="0px"&&t.hidden]}})(jr(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),Umn=Bt("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Wmn=Bt("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),V3=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiCollapse"}),{addEndListener:o,children:i,className:s,collapsedSize:l="0px",component:c,easing:u,in:d,onEnter:p,onEntered:h,onEntering:m,onExit:g,onExited:y,onExiting:x,orientation:v="vertical",slots:b={},slotProps:w={},style:S,timeout:C=OKe.standard,TransitionComponent:N=Sm,...j}=r,I={...r,orientation:v,collapsedSize:l},_=Hmn(I),T=xf(),P=hh(),E=f.useRef(null),M=f.useRef(),R=typeof l=="number"?`${l}px`:l,$=v==="horizontal",D=$?"width":"height",z=f.useRef(null),V=Di(n,z),B=se=>ge=>{if(se){const ye=z.current;ge===void 0?se(ye):se(ye,ge)}},G=()=>E.current?E.current[$?"clientWidth":"clientHeight"]:0,H=B((se,ge)=>{E.current&&$&&(E.current.style.position="absolute"),se.style[D]=R,p&&p(se,ge)}),F=B((se,ge)=>{const ye=G();E.current&&$&&(E.current.style.position="");const{duration:de,easing:Ne}=_C({style:S,timeout:C,easing:u},{mode:"enter"});if(C==="auto"){const _e=T.transitions.getAutoHeightDuration(ye);se.style.transitionDuration=`${_e}ms`,M.current=_e}else se.style.transitionDuration=typeof de=="string"?de:`${de}ms`;se.style[D]=`${ye}px`,se.style.transitionTimingFunction=Ne,m&&m(se,ge)}),W=B((se,ge)=>{se.style[D]="auto",h&&h(se,ge)}),U=B(se=>{se.style[D]=`${G()}px`,g&&g(se)}),K=B(y),X=B(se=>{const ge=G(),{duration:ye,easing:de}=_C({style:S,timeout:C,easing:u},{mode:"exit"});if(C==="auto"){const Ne=T.transitions.getAutoHeightDuration(ge);se.style.transitionDuration=`${Ne}ms`,M.current=Ne}else se.style.transitionDuration=typeof ye=="string"?ye:`${ye}ms`;se.style[D]=R,se.style.transitionTimingFunction=de,x&&x(se)}),J=se=>{C==="auto"&&P.start(M.current||0,se),o&&o(z.current,se)},te={slots:b,slotProps:w,component:c},[re,ce]=mr("root",{ref:V,className:be(_.root,s),elementType:Vmn,externalForwardedProps:te,ownerState:I,additionalProps:{style:{[$?"minWidth":"minHeight"]:R,...S}}}),[ae,oe]=mr("wrapper",{ref:E,className:_.wrapper,elementType:Umn,externalForwardedProps:te,ownerState:I}),[ue,fe]=mr("wrapperInner",{className:_.wrapperInner,elementType:Wmn,externalForwardedProps:te,ownerState:I});return a.jsx(N,{in:d,onEnter:H,onEntered:W,onEntering:F,onExit:U,onExited:K,onExiting:X,addEndListener:J,nodeRef:z,timeout:C==="auto"?null:C,...j,children:(se,{ownerState:ge,...ye})=>{const de={...I,state:se};return a.jsx(re,{...ce,className:be(ce.className,{entered:_.entered,exited:!d&&R==="0px"&&_.hidden}[se]),ownerState:de,...ye,children:a.jsx(ae,{...oe,ownerState:de,children:a.jsx(ue,{...fe,ownerState:de,children:i})})})}})});V3&&(V3.muiSupportAuto=!0);function Gmn(e){return _r("MuiPaper",e)}Pr("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const qmn=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Un(i,Gmn,o)},Kmn=Bt("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(jr(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),ea=f.forwardRef(function(t,n){var m;const r=Rr({props:t,name:"MuiPaper"}),o=xf(),{className:i,component:s="div",elevation:l=1,square:c=!1,variant:u="elevation",...d}=r,p={...r,component:s,elevation:l,square:c,variant:u},h=qmn(p);return a.jsx(Kmn,{as:s,ownerState:p,className:be(h.root,i),ref:n,...d,style:{...u==="elevation"&&{"--Paper-shadow":(o.vars||o).shadows[l],...o.vars&&{"--Paper-overlay":(m=o.vars.overlays)==null?void 0:m[l]},...!o.vars&&o.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${Na("#fff",xie(l))}, ${Na("#fff",xie(l))})`}},...d.style}})}),Mnt=f.createContext({});function Ymn(e){return _r("MuiAccordion",e)}const vF=Pr("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),Xmn=e=>{const{classes:t,square:n,expanded:r,disabled:o,disableGutters:i}=e;return Un({root:["root",!n&&"rounded",r&&"expanded",o&&"disabled",!i&&"gutters"],heading:["heading"],region:["region"]},Ymn,t)},Qmn=Bt(ea,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${vF.region}`]:t.region},t.root,!n.square&&t.rounded,!n.disableGutters&&t.gutters]}})(jr(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],t),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${vF.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${vF.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),jr(({theme:e})=>({variants:[{props:t=>!t.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:t=>!t.disableGutters,style:{[`&.${vF.expanded}`]:{margin:"16px 0"}}}]}))),Jmn=Bt("h3",{name:"MuiAccordion",slot:"Heading"})({all:"unset"}),Zmn=Bt("div",{name:"MuiAccordion",slot:"Region"})({}),egn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiAccordion"}),{children:o,className:i,defaultExpanded:s=!1,disabled:l=!1,disableGutters:c=!1,expanded:u,onChange:d,slots:p={},slotProps:h={},TransitionComponent:m,TransitionProps:g,...y}=r,[x,v]=iC({controlled:u,default:s,name:"Accordion",state:"expanded"}),b=f.useCallback(B=>{v(!x),d&&d(B,!x)},[x,d,v]),[w,...S]=f.Children.toArray(o),C=f.useMemo(()=>({expanded:x,disabled:l,disableGutters:c,toggle:b}),[x,l,c,b]),N={...r,disabled:l,disableGutters:c,expanded:x},j=Xmn(N),I={transition:m,...p},_={transition:g,...h},T={slots:I,slotProps:_},[P,E]=mr("root",{elementType:Qmn,externalForwardedProps:{...T,...y},className:be(j.root,i),shouldForwardComponentProp:!0,ownerState:N,ref:n}),[M,R]=mr("heading",{elementType:Jmn,externalForwardedProps:T,className:j.heading,ownerState:N}),[$,D]=mr("transition",{elementType:V3,externalForwardedProps:T,ownerState:N}),[z,V]=mr("region",{elementType:Zmn,externalForwardedProps:T,ownerState:N,className:j.region,additionalProps:{"aria-labelledby":w.props.id,id:w.props["aria-controls"],role:"region"}});return a.jsxs(P,{...E,children:[a.jsx(M,{...R,children:a.jsx(Mnt.Provider,{value:C,children:w})}),a.jsx($,{in:x,timeout:"auto",...D,children:a.jsx(z,{...V,children:S})})]})});function tgn(e){return _r("MuiAccordionDetails",e)}Pr("MuiAccordionDetails",["root"]);const ngn=e=>{const{classes:t}=e;return Un({root:["root"]},tgn,t)},rgn=Bt("div",{name:"MuiAccordionDetails",slot:"Root"})(jr(({theme:e})=>({padding:e.spacing(1,2,2)}))),eee=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiAccordionDetails"}),{className:o,...i}=r,s=r,l=ngn(s);return a.jsx(rgn,{className:be(l.root,o),ref:n,ownerState:s,...i})});function fT(e){try{return e.matches(":focus-visible")}catch{}return!1}class XV{constructor(){ze(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new XV}static use(){const t=gm(XV.create).current,[n,r]=f.useState(!1);return t.shouldMount=n,t.setShouldMount=r,f.useEffect(t.mountEffect,[n]),t}mount(){return this.mounted||(this.mounted=ign(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.start(...t)})}stop(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.stop(...t)})}pulsate(...t){this.mount().then(()=>{var n;return(n=this.ref.current)==null?void 0:n.pulsate(...t)})}}function ogn(){return XV.use()}function ign(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function agn(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:i,rippleSize:s,in:l,onExited:c,timeout:u}=e,[d,p]=f.useState(!1),h=be(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),m={width:s,height:s,top:-(s/2)+i,left:-(s/2)+o},g=be(n.child,d&&n.childLeaving,r&&n.childPulsate);return!l&&!d&&p(!0),f.useEffect(()=>{if(!l&&c!=null){const y=setTimeout(c,u);return()=>{clearTimeout(y)}}},[c,l,u]),a.jsx("span",{className:h,style:m,children:a.jsx("span",{className:g})})}const Qg=Pr("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),ise=550,sgn=80,lgn=gf` 0% { transform: scale(0); opacity: 0.1; } 100% { transform: scale(1); opacity: 0.3; } `,cgn=gf` 0% { opacity: 1; } 100% { opacity: 0; } `,ugn=gf` 0% { transform: scale(1); } 50% { transform: scale(0.92); } 100% { transform: scale(1); } `,dgn=Bt("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),fgn=Bt(agn,{name:"MuiTouchRipple",slot:"Ripple"})` opacity: 0; position: absolute; &.${Qg.rippleVisible} { opacity: 0.3; transform: scale(1); animation-name: ${lgn}; animation-duration: ${ise}ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; } &.${Qg.ripplePulsate} { animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms; } & .${Qg.child} { opacity: 1; display: block; width: 100%; height: 100%; border-radius: 50%; background-color: currentColor; } & .${Qg.childLeaving} { opacity: 0; animation-name: ${cgn}; animation-duration: ${ise}ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; } & .${Qg.childPulsate} { position: absolute; /* @noflip */ left: 0px; top: 0; animation-name: ${ugn}; animation-duration: 2500ms; animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; animation-iteration-count: infinite; animation-delay: 200ms; } `,pgn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:s,...l}=r,[c,u]=f.useState([]),d=f.useRef(0),p=f.useRef(null);f.useEffect(()=>{p.current&&(p.current(),p.current=null)},[c]);const h=f.useRef(!1),m=hh(),g=f.useRef(null),y=f.useRef(null),x=f.useCallback(S=>{const{pulsate:C,rippleX:N,rippleY:j,rippleSize:I,cb:_}=S;u(T=>[...T,a.jsx(fgn,{classes:{ripple:be(i.ripple,Qg.ripple),rippleVisible:be(i.rippleVisible,Qg.rippleVisible),ripplePulsate:be(i.ripplePulsate,Qg.ripplePulsate),child:be(i.child,Qg.child),childLeaving:be(i.childLeaving,Qg.childLeaving),childPulsate:be(i.childPulsate,Qg.childPulsate)},timeout:ise,pulsate:C,rippleX:N,rippleY:j,rippleSize:I},d.current)]),d.current+=1,p.current=_},[i]),v=f.useCallback((S={},C={},N=()=>{})=>{const{pulsate:j=!1,center:I=o||C.pulsate,fakeElement:_=!1}=C;if((S==null?void 0:S.type)==="mousedown"&&h.current){h.current=!1;return}(S==null?void 0:S.type)==="touchstart"&&(h.current=!0);const T=_?null:y.current,P=T?T.getBoundingClientRect():{width:0,height:0,left:0,top:0};let E,M,R;if(I||S===void 0||S.clientX===0&&S.clientY===0||!S.clientX&&!S.touches)E=Math.round(P.width/2),M=Math.round(P.height/2);else{const{clientX:$,clientY:D}=S.touches&&S.touches.length>0?S.touches[0]:S;E=Math.round($-P.left),M=Math.round(D-P.top)}if(I)R=Math.sqrt((2*P.width**2+P.height**2)/3),R%2===0&&(R+=1);else{const $=Math.max(Math.abs((T?T.clientWidth:0)-E),E)*2+2,D=Math.max(Math.abs((T?T.clientHeight:0)-M),M)*2+2;R=Math.sqrt($**2+D**2)}S!=null&&S.touches?g.current===null&&(g.current=()=>{x({pulsate:j,rippleX:E,rippleY:M,rippleSize:R,cb:N})},m.start(sgn,()=>{g.current&&(g.current(),g.current=null)})):x({pulsate:j,rippleX:E,rippleY:M,rippleSize:R,cb:N})},[o,x,m]),b=f.useCallback(()=>{v({},{pulsate:!0})},[v]),w=f.useCallback((S,C)=>{if(m.clear(),(S==null?void 0:S.type)==="touchend"&&g.current){g.current(),g.current=null,m.start(0,()=>{w(S,C)});return}g.current=null,u(N=>N.length>0?N.slice(1):N),p.current=C},[m]);return f.useImperativeHandle(n,()=>({pulsate:b,start:v,stop:w}),[b,v,w]),a.jsx(dgn,{className:be(Qg.root,i.root,s),ref:y,...l,children:a.jsx(vxe,{component:null,exit:!0,children:c})})});function hgn(e){return _r("MuiButtonBase",e)}const mgn=Pr("MuiButtonBase",["root","disabled","focusVisible"]),ggn=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,s=Un({root:["root",t&&"disabled",n&&"focusVisible"]},hgn,o);return n&&r&&(s.root+=` ${r}`),s},xgn=Bt("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${mgn.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ub=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:s,className:l,component:c="button",disabled:u=!1,disableRipple:d=!1,disableTouchRipple:p=!1,focusRipple:h=!1,focusVisibleClassName:m,LinkComponent:g="a",onBlur:y,onClick:x,onContextMenu:v,onDragLeave:b,onFocus:w,onFocusVisible:S,onKeyDown:C,onKeyUp:N,onMouseDown:j,onMouseLeave:I,onMouseUp:_,onTouchEnd:T,onTouchMove:P,onTouchStart:E,tabIndex:M=0,TouchRippleProps:R,touchRippleRef:$,type:D,...z}=r,V=f.useRef(null),B=ogn(),G=Di(B.ref,$),[H,F]=f.useState(!1);u&&H&&F(!1),f.useImperativeHandle(o,()=>({focusVisible:()=>{F(!0),V.current.focus()}}),[]);const W=B.shouldMount&&!d&&!u;f.useEffect(()=>{H&&h&&!d&&B.pulsate()},[d,h,H,B]);const U=Zb(B,"start",j,p),K=Zb(B,"stop",v,p),X=Zb(B,"stop",b,p),J=Zb(B,"stop",_,p),te=Zb(B,"stop",we=>{H&&we.preventDefault(),I&&I(we)},p),re=Zb(B,"start",E,p),ce=Zb(B,"stop",T,p),ae=Zb(B,"stop",P,p),oe=Zb(B,"stop",we=>{fT(we.target)||F(!1),y&&y(we)},!1),ue=no(we=>{V.current||(V.current=we.currentTarget),fT(we.target)&&(F(!0),S&&S(we)),w&&w(we)}),fe=()=>{const we=V.current;return c&&c!=="button"&&!(we.tagName==="A"&&we.href)},se=no(we=>{h&&!we.repeat&&H&&we.key===" "&&B.stop(we,()=>{B.start(we)}),we.target===we.currentTarget&&fe()&&we.key===" "&&we.preventDefault(),C&&C(we),we.target===we.currentTarget&&fe()&&we.key==="Enter"&&!u&&(we.preventDefault(),x&&x(we))}),ge=no(we=>{h&&we.key===" "&&H&&!we.defaultPrevented&&B.stop(we,()=>{B.pulsate(we)}),N&&N(we),x&&we.target===we.currentTarget&&fe()&&we.key===" "&&!we.defaultPrevented&&x(we)});let ye=c;ye==="button"&&(z.href||z.to)&&(ye=g);const de={};if(ye==="button"){const we=!!z.formAction;de.type=D===void 0&&!we?"button":D,de.disabled=u}else!z.href&&!z.to&&(de.role="button"),u&&(de["aria-disabled"]=u);const Ne=Di(n,V),_e={...r,centerRipple:i,component:c,disabled:u,disableRipple:d,disableTouchRipple:p,focusRipple:h,tabIndex:M,focusVisible:H},xe=ggn(_e);return a.jsxs(xgn,{as:ye,className:be(xe.root,l),ownerState:_e,onBlur:oe,onClick:x,onContextMenu:K,onFocus:ue,onKeyDown:se,onKeyUp:ge,onMouseDown:U,onMouseLeave:te,onMouseUp:J,onDragLeave:X,onTouchEnd:ce,onTouchMove:ae,onTouchStart:re,ref:Ne,tabIndex:u?-1:M,type:D,...de,...z,children:[s,W?a.jsx(pgn,{ref:G,center:i,...R}):null]})});function Zb(e,t,n,r=!1){return no(o=>(n&&n(o),r||e[t](o),!0))}function ygn(e){return _r("MuiAccordionSummary",e)}const NP=Pr("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),vgn=e=>{const{classes:t,expanded:n,disabled:r,disableGutters:o}=e;return Un({root:["root",n&&"expanded",r&&"disabled",!o&&"gutters"],focusVisible:["focusVisible"],content:["content",n&&"expanded",!o&&"contentGutters"],expandIconWrapper:["expandIconWrapper",n&&"expanded"]},ygn,t)},bgn=Bt(ub,{name:"MuiAccordionSummary",slot:"Root"})(jr(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create(["min-height","background-color"],t),[`&.${NP.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${NP.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${NP.disabled})`]:{cursor:"pointer"},variants:[{props:n=>!n.disableGutters,style:{[`&.${NP.expanded}`]:{minHeight:64}}}]}})),wgn=Bt("span",{name:"MuiAccordionSummary",slot:"Content"})(jr(({theme:e})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:t=>!t.disableGutters,style:{transition:e.transitions.create(["margin"],{duration:e.transitions.duration.shortest}),[`&.${NP.expanded}`]:{margin:"20px 0"}}}]}))),Sgn=Bt("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper"})(jr(({theme:e})=>({display:"flex",color:(e.vars||e).palette.action.active,transform:"rotate(0deg)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),[`&.${NP.expanded}`]:{transform:"rotate(180deg)"}}))),tee=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiAccordionSummary"}),{children:o,className:i,expandIcon:s,focusVisibleClassName:l,onClick:c,slots:u,slotProps:d,...p}=r,{disabled:h=!1,disableGutters:m,expanded:g,toggle:y}=f.useContext(Mnt),x=T=>{y&&y(T),c&&c(T)},v={...r,expanded:g,disabled:h,disableGutters:m},b=vgn(v),w={slots:u,slotProps:d},[S,C]=mr("root",{ref:n,shouldForwardComponentProp:!0,className:be(b.root,i),elementType:bgn,externalForwardedProps:{...w,...p},ownerState:v,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:h,"aria-expanded":g,focusVisibleClassName:be(b.focusVisible,l)},getSlotProps:T=>({...T,onClick:P=>{var E;(E=T.onClick)==null||E.call(T,P),x(P)}})}),[N,j]=mr("content",{className:b.content,elementType:wgn,externalForwardedProps:w,ownerState:v}),[I,_]=mr("expandIconWrapper",{className:b.expandIconWrapper,elementType:Sgn,externalForwardedProps:w,ownerState:v});return a.jsxs(S,{...C,children:[a.jsx(N,{...j,children:o}),s&&a.jsx(I,{..._,children:s})]})});function Cgn(e){return typeof e.main=="string"}function Ngn(e,t=[]){if(!Cgn(e))return!1;for(const n of t)if(!e.hasOwnProperty(n)||typeof e[n]!="string")return!1;return!0}function ul(e=[]){return([,t])=>t&&Ngn(t,e)}function jgn(e){return _r("MuiAlert",e)}const KTe=Pr("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function Egn(e){return _r("MuiCircularProgress",e)}Pr("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","track","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const hx=44,ase=gf` 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } `,sse=gf` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; } 50% { stroke-dasharray: 100px, 200px; stroke-dashoffset: -15px; } 100% { stroke-dasharray: 1px, 200px; stroke-dashoffset: -126px; } `,Ign=typeof ase!="string"?jb` animation: ${ase} 1.4s linear infinite; `:null,_gn=typeof sse!="string"?jb` animation: ${sse} 1.4s ease-in-out infinite; `:null,Pgn=e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,i={root:["root",n,`color${vn(r)}`],svg:["svg"],track:["track"],circle:["circle",`circle${vn(n)}`,o&&"circleDisableShrink"]};return Un(i,Egn,t)},Agn=Bt("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${vn(n.color)}`]]}})(jr(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Ign||{animation:`${ase} 1.4s linear infinite`}},...Object.entries(e.palette).filter(ul()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),Tgn=Bt("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),kgn=Bt("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${vn(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(jr(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:_gn||{animation:`${sse} 1.4s ease-in-out infinite`}}]}))),Mgn=Bt("circle",{name:"MuiCircularProgress",slot:"Track"})(jr(({theme:e})=>({stroke:"currentColor",opacity:(e.vars||e).palette.action.activatedOpacity}))),su=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiCircularProgress"}),{className:o,color:i="primary",disableShrink:s=!1,enableTrackSlot:l=!1,size:c=40,style:u,thickness:d=3.6,value:p=0,variant:h="indeterminate",...m}=r,g={...r,color:i,disableShrink:s,size:c,thickness:d,value:p,variant:h,enableTrackSlot:l},y=Pgn(g),x={},v={},b={};if(h==="determinate"){const w=2*Math.PI*((hx-d)/2);x.strokeDasharray=w.toFixed(3),b["aria-valuenow"]=Math.round(p),x.strokeDashoffset=`${((100-p)/100*w).toFixed(3)}px`,v.transform="rotate(-90deg)"}return a.jsx(Agn,{className:be(y.root,o),style:{width:c,height:c,...v,...u},ownerState:g,ref:n,role:"progressbar",...b,...m,children:a.jsxs(Tgn,{className:y.svg,ownerState:g,viewBox:`${hx/2} ${hx/2} ${hx} ${hx}`,children:[l?a.jsx(Mgn,{className:y.track,ownerState:g,cx:hx,cy:hx,r:(hx-d)/2,fill:"none",strokeWidth:d,"aria-hidden":"true"}):null,a.jsx(kgn,{className:y.circle,style:x,ownerState:g,cx:hx,cy:hx,r:(hx-d)/2,fill:"none",strokeWidth:d})]})})});function Rgn(e){return _r("MuiIconButton",e)}const lse=Pr("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),Ogn=e=>{const{classes:t,disabled:n,color:r,edge:o,size:i,loading:s}=e,l={root:["root",s&&"loading",n&&"disabled",r!=="default"&&`color${vn(r)}`,o&&`edge${vn(o)}`,`size${vn(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return Un(l,Rgn,t)},$gn=Bt(ub,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${vn(n.color)}`],n.edge&&t[`edge${vn(n.edge)}`],t[`size${vn(n.size)}`]]}})(jr(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),jr(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(ul()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(ul()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${lse.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${lse.loading}`]:{color:"transparent"}}))),Dgn=Bt("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),Zs=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:s,color:l="default",disabled:c=!1,disableFocusRipple:u=!1,size:d="medium",id:p,loading:h=null,loadingIndicator:m,...g}=r,y=Jo(p),x=m??a.jsx(su,{"aria-labelledby":y,color:"inherit",size:16}),v={...r,edge:o,color:l,disabled:c,disableFocusRipple:u,loading:h,loadingIndicator:x,size:d},b=Ogn(v);return a.jsxs($gn,{id:h?y:p,className:be(b.root,s),centerRipple:!0,focusRipple:!u,disabled:c||h,ref:n,...g,ownerState:v,children:[typeof h=="boolean"&&a.jsx("span",{className:b.loadingWrapper,style:{display:"contents"},children:a.jsx(Dgn,{className:b.loadingIndicator,ownerState:v,children:h&&x})}),i]})}),Lgn=wi(a.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})),Fgn=wi(a.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),zgn=wi(a.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),Bgn=wi(a.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"})),Rnt=wi(a.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),Hgn=e=>{const{variant:t,color:n,severity:r,classes:o}=e,i={root:["root",`color${vn(n||r)}`,`${t}${vn(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return Un(i,jgn,o)},Vgn=Bt(ea,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${vn(n.color||n.severity)}`]]}})(jr(({theme:e})=>{const t=e.palette.mode==="light"?e.darken:e.lighten,n=e.palette.mode==="light"?e.lighten:e.darken;return{...e.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter(ul(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${r}StandardBg`]:n(e.palette[r].light,.9),[`& .${KTe.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(ul(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),border:`1px solid ${(e.vars||e).palette[r].light}`,[`& .${KTe.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(ul(["dark"])).map(([r])=>({props:{colorSeverity:r,variant:"filled"},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${r}FilledColor`],backgroundColor:e.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:e.palette.mode==="dark"?e.palette[r].dark:e.palette[r].main,color:e.palette.getContrastText(e.palette[r].main)}}}))]}})),Ugn=Bt("div",{name:"MuiAlert",slot:"Icon"})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Wgn=Bt("div",{name:"MuiAlert",slot:"Message"})({padding:"8px 0",minWidth:0,overflow:"auto"}),Ggn=Bt("div",{name:"MuiAlert",slot:"Action"})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),qgn={success:a.jsx(Lgn,{fontSize:"inherit"}),warning:a.jsx(Fgn,{fontSize:"inherit"}),error:a.jsx(zgn,{fontSize:"inherit"}),info:a.jsx(Bgn,{fontSize:"inherit"})},zf=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiAlert"}),{action:o,children:i,className:s,closeText:l="Close",color:c,components:u={},componentsProps:d={},icon:p,iconMapping:h=qgn,onClose:m,role:g="alert",severity:y="success",slotProps:x={},slots:v={},variant:b="standard",...w}=r,S={...r,color:c,severity:y,variant:b,colorSeverity:c||y},C=Hgn(S),N={slots:{closeButton:u.CloseButton,closeIcon:u.CloseIcon,...v},slotProps:{...d,...x}},[j,I]=mr("root",{ref:n,shouldForwardComponentProp:!0,className:be(C.root,s),elementType:Vgn,externalForwardedProps:{...N,...w},ownerState:S,additionalProps:{role:g,elevation:0}}),[_,T]=mr("icon",{className:C.icon,elementType:Ugn,externalForwardedProps:N,ownerState:S}),[P,E]=mr("message",{className:C.message,elementType:Wgn,externalForwardedProps:N,ownerState:S}),[M,R]=mr("action",{className:C.action,elementType:Ggn,externalForwardedProps:N,ownerState:S}),[$,D]=mr("closeButton",{elementType:Zs,externalForwardedProps:N,ownerState:S}),[z,V]=mr("closeIcon",{elementType:Rnt,externalForwardedProps:N,ownerState:S});return a.jsxs(j,{...I,children:[p!==!1?a.jsx(_,{...T,children:p||h[y]}):null,a.jsx(P,{...E,children:i}),o!=null?a.jsx(M,{...R,children:o}):null,o==null&&m?a.jsx(M,{...R,children:a.jsx($,{size:"small","aria-label":l,title:l,color:"inherit",onClick:m,...D,children:a.jsx(z,{fontSize:"small",...V})})}):null]})});function Kgn(e){return _r("MuiTypography",e)}const QV=Pr("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),Ygn={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Xgn=eOt(),Qgn=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:s}=e,l={root:["root",i,e.align!=="inherit"&&`align${vn(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return Un(l,Kgn,s)},Jgn=Bt("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${vn(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(jr(({theme:e})=>{var t;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([n,r])=>n!=="inherit"&&r&&typeof r=="object").map(([n,r])=>({props:{variant:n},style:r})),...Object.entries(e.palette).filter(ul()).map(([n])=>({props:{color:n},style:{color:(e.vars||e).palette[n].main}})),...Object.entries(((t=e.palette)==null?void 0:t.text)||{}).filter(([,n])=>typeof n=="string").map(([n])=>({props:{color:`text${vn(n)}`},style:{color:(e.vars||e).palette.text[n]}})),{props:({ownerState:n})=>n.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:n})=>n.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:n})=>n.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:n})=>n.paragraph,style:{marginBottom:16}}]}})),YTe={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},tn=f.forwardRef(function(t,n){const{color:r,...o}=Rr({props:t,name:"MuiTypography"}),i=!Ygn[r],s=Xgn({...o,...i&&{color:r}}),{align:l="inherit",className:c,component:u,gutterBottom:d=!1,noWrap:p=!1,paragraph:h=!1,variant:m="body1",variantMapping:g=YTe,...y}=s,x={...s,align:l,color:r,className:c,component:u,gutterBottom:d,noWrap:p,paragraph:h,variant:m,variantMapping:g},v=u||(h?"p":g[m]||YTe[m])||"span",b=Qgn(x);return a.jsx(Jgn,{as:v,ref:n,className:be(b.root,c),...y,ownerState:x,style:{...l!=="inherit"&&{"--Typography-textAlign":l},...y.style}})});function wxe(e){const t=f.useRef({});return f.useEffect(()=>{t.current=e}),t.current}function XTe({array1:e,array2:t,parser:n=r=>r}){return e&&t&&e.length===t.length&&e.every((r,o)=>n(r)===n(t[o]))}function QTe(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Zgn(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:i,trim:s=!1}=e;return(l,{inputValue:c,getOptionLabel:u})=>{let d=s?c.trim():c;n&&(d=d.toLowerCase()),t&&(d=QTe(d));const p=d?l.filter(h=>{let m=(i||u)(h);return n&&(m=m.toLowerCase()),t&&(m=QTe(m)),o==="start"?m.startsWith(d):m.includes(d)}):l;return typeof r=="number"?p.slice(0,r):p}}const e0n=Zgn(),JTe=5,t0n=e=>{var t;return e.current!==null&&((t=e.current.parentElement)==null?void 0:t.contains(document.activeElement))},n0n=[];function ZTe(e,t,n,r){if(t||e==null||r)return"";const o=n(e);return typeof o=="string"?o:""}function r0n(e){const{unstable_isActiveElementInListbox:t=t0n,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:i=!1,blurOnSelect:s=!1,clearOnBlur:l=!e.freeSolo,clearOnEscape:c=!1,componentName:u="useAutocomplete",defaultValue:d=e.multiple?n0n:null,disableClearable:p=!1,disableCloseOnSelect:h=!1,disabled:m,disabledItemsFocusable:g=!1,disableListWrap:y=!1,filterOptions:x=e0n,filterSelectedOptions:v=!1,freeSolo:b=!1,getOptionDisabled:w,getOptionKey:S,getOptionLabel:C=pt=>pt.label??pt,groupBy:N,handleHomeEndKeys:j=!e.freeSolo,id:I,includeInputInList:_=!1,inputValue:T,isOptionEqualToValue:P=(pt,nt)=>pt===nt,multiple:E=!1,onChange:M,onClose:R,onHighlightChange:$,onInputChange:D,onOpen:z,open:V,openOnFocus:B=!1,options:G,readOnly:H=!1,renderValue:F,selectOnFocus:W=!e.freeSolo,value:U}=e,K=Jo(I);let X=C;X=pt=>{const nt=C(pt);return typeof nt!="string"?String(nt):nt};const J=f.useRef(!1),te=f.useRef(!0),re=f.useRef(null),ce=f.useRef(null),[ae,oe]=f.useState(null),[ue,fe]=f.useState(-1),se=o?0:-1,ge=f.useRef(se),ye=f.useRef(ZTe(d??U,E,X)).current,[de,Ne]=iC({controlled:U,default:d,name:u}),[_e,xe]=iC({controlled:T,default:ye,name:u,state:"inputValue"}),[we,Te]=f.useState(!1),Re=f.useCallback((pt,nt,xt)=>{if(!(E?de.length!(v&&(E?de:[de]).some(nt=>nt!==null&&P(pt,nt)))),{inputValue:at&&Ye?"":_e,getOptionLabel:X}):[],qe=wxe({filteredOptions:Ae,value:de,inputValue:_e});f.useEffect(()=>{const pt=de!==qe.value;we&&!pt||b&&!pt||Re(null,de,"reset")},[de,Re,we,qe.value,b]);const dt=Ue&&Ae.length>0&&!H,Ze=no(pt=>{if(pt===-1)re.current.focus();else{const nt=F?"data-item-index":"data-tag-index";ae.querySelector(`[${nt}="${pt}"]`).focus()}});f.useEffect(()=>{E&&ue>de.length-1&&(fe(-1),Ze(-1))},[de,E,ue,Ze]);function Qe(pt,nt){if(!ce.current||pt<0||pt>=Ae.length)return-1;let xt=pt;for(;;){const Tt=ce.current.querySelector(`[data-option-index="${xt}"]`),rn=g?!1:!Tt||Tt.disabled||Tt.getAttribute("aria-disabled")==="true";if(Tt&&Tt.hasAttribute("tabindex")&&!rn)return xt;if(nt==="next"?xt=(xt+1)%Ae.length:xt=(xt-1+Ae.length)%Ae.length,xt===pt)return-1}}const lt=no(({event:pt,index:nt,reason:xt})=>{if(ge.current=nt,nt===-1?re.current.removeAttribute("aria-activedescendant"):re.current.setAttribute("aria-activedescendant",`${K}-option-${nt}`),$&&["mouse","keyboard","touch"].includes(xt)&&$(pt,nt===-1?null:Ae[nt],xt),!ce.current)return;const Tt=ce.current.querySelector(`[role="option"].${n}-focused`);Tt&&(Tt.classList.remove(`${n}-focused`),Tt.classList.remove(`${n}-focusVisible`));let rn=ce.current;if(ce.current.getAttribute("role")!=="listbox"&&(rn=ce.current.parentElement.querySelector('[role="listbox"]')),!rn)return;if(nt===-1){rn.scrollTop=0;return}const un=ce.current.querySelector(`[data-option-index="${nt}"]`);if(un&&(un.classList.add(`${n}-focused`),xt==="keyboard"&&un.classList.add(`${n}-focusVisible`),rn.scrollHeight>rn.clientHeight&&xt!=="mouse"&&xt!=="touch")){const xn=un,Kn=rn.clientHeight+rn.scrollTop,ar=xn.offsetTop+xn.offsetHeight;ar>Kn?rn.scrollTop=ar-rn.clientHeight:xn.offsetTop-xn.offsetHeight*(N?1.3:0){if(!Oe)return;const un=Qe((()=>{const xn=Ae.length-1;if(nt==="reset")return se;if(nt==="start")return 0;if(nt==="end")return xn;const Kn=ge.current+nt;return Kn<0?Kn===-1&&_?-1:y&&ge.current!==-1||Math.abs(nt)>1?0:xn:Kn>xn?Kn===xn+1&&_?-1:y||Math.abs(nt)>1?xn:0:Kn})(),xt);if(lt({index:un,reason:Tt,event:pt}),r&&nt!=="reset")if(un===-1)re.current.value=_e;else{const xn=X(Ae[un]);re.current.value=xn,xn.toLowerCase().indexOf(_e.toLowerCase())===0&&_e.length>0&&re.current.setSelectionRange(_e.length,xn.length)}}),Ct=!XTe({array1:qe.filteredOptions,array2:Ae,parser:X}),Je=()=>{const pt=(nt,xt)=>{const Tt=nt?X(nt):"",rn=xt?X(xt):"";return Tt===rn};if(ge.current!==-1&&!XTe({array1:qe.filteredOptions,array2:Ae,parser:X})&&qe.inputValue===_e&&(E?de.length===qe.value.length&&qe.value.every((nt,xt)=>X(de[xt])===X(nt)):pt(qe.value,de))){const nt=qe.filteredOptions[ge.current];if(nt)return Ae.findIndex(xt=>X(xt)===X(nt))}return-1},Pe=f.useCallback(()=>{if(!Oe)return;const pt=Je();if(pt!==-1){ge.current=pt;return}const nt=E?de[0]:de;if(Ae.length===0||nt==null){bt({diff:"reset"});return}if(ce.current){if(nt!=null){const xt=Ae[ge.current];if(E&&xt&&de.findIndex(rn=>P(xt,rn))!==-1)return;const Tt=Ae.findIndex(rn=>P(rn,nt));Tt===-1?bt({diff:"reset"}):lt({index:Tt});return}if(ge.current>=Ae.length-1){lt({index:Ae.length-1});return}lt({index:ge.current})}},[Ae.length,E?!1:de,bt,lt,Oe,_e,E]),Me=no(pt=>{rse(ce,pt),pt&&Pe()});f.useEffect(()=>{(Ct||Oe)&&Pe()},[Pe,Ct,Oe]);const et=pt=>{Ue||(He(!0),We(!0),z&&z(pt))},vt=(pt,nt)=>{Ue&&(He(!1),R&&R(pt,nt))},Pt=(pt,nt,xt,Tt)=>{if(E){if(de.length===nt.length&&de.every((rn,un)=>rn===nt[un]))return}else if(de===nt)return;M&&M(pt,nt,xt,Tt),Ne(nt)},Jt=f.useRef(!1),dn=(pt,nt,xt="selectOption",Tt="options")=>{let rn=xt,un=nt;if(E){un=Array.isArray(de)?de.slice():[];const xn=un.findIndex(Kn=>P(nt,Kn));xn===-1?un.push(nt):Tt!=="freeSolo"&&(un.splice(xn,1),rn="removeOption")}Re(pt,un,rn),Pt(pt,un,rn,{option:nt}),!h&&(!pt||!pt.ctrlKey&&!pt.metaKey)&&vt(pt,rn),(s===!0||s==="touch"&&Jt.current||s==="mouse"&&!Jt.current)&&re.current.blur()};function Et(pt,nt){if(pt===-1)return-1;let xt=pt;for(;;){if(nt==="next"&&xt===de.length||nt==="previous"&&xt===-1)return-1;const Tt=F?"data-item-index":"data-tag-index",rn=ae.querySelector(`[${Tt}="${xt}"]`);if(!rn||!rn.hasAttribute("tabindex")||rn.disabled||rn.getAttribute("aria-disabled")==="true")xt+=nt==="next"?1:-1;else return xt}}const sn=(pt,nt)=>{if(!E)return;_e===""&&vt(pt,"toggleInput");let xt=ue;ue===-1&&nt==="previous"?(xt=de.length-1,b&&_e!==""&&(xe(""),D&&D(pt,"","reset"))):(xt+=nt==="next"?1:-1,xt<0&&(xt=0),xt===de.length&&(xt=-1)),xt=Et(xt,nt),fe(xt),Ze(xt)},ot=pt=>{J.current=!0,xe(""),D&&D(pt,"","clear"),Pt(pt,E?[]:null,"clear")},mt=pt=>nt=>{if(pt.onKeyDown&&pt.onKeyDown(nt),!nt.defaultMuiPrevented&&(ue!==-1&&!["ArrowLeft","ArrowRight"].includes(nt.key)&&(fe(-1),Ze(-1)),nt.which!==229))switch(nt.key){case"Home":Oe&&j&&(nt.preventDefault(),bt({diff:"start",direction:"next",reason:"keyboard",event:nt}));break;case"End":Oe&&j&&(nt.preventDefault(),bt({diff:"end",direction:"previous",reason:"keyboard",event:nt}));break;case"PageUp":nt.preventDefault(),bt({diff:-JTe,direction:"previous",reason:"keyboard",event:nt}),et(nt);break;case"PageDown":nt.preventDefault(),bt({diff:JTe,direction:"next",reason:"keyboard",event:nt}),et(nt);break;case"ArrowDown":nt.preventDefault(),bt({diff:1,direction:"next",reason:"keyboard",event:nt}),et(nt);break;case"ArrowUp":nt.preventDefault(),bt({diff:-1,direction:"previous",reason:"keyboard",event:nt}),et(nt);break;case"ArrowLeft":{const xt=re.current;if(!(xt&&xt.selectionStart===0&&xt.selectionEnd===0))return;!E&&F&&de!=null?(b&&_e!==""&&(xe(""),D&&D(nt,"","reset")),fe(0),Ze(0)):sn(nt,"previous");break}case"ArrowRight":!E&&F?(fe(-1),Ze(-1)):sn(nt,"next");break;case"Enter":if(ge.current!==-1&&Oe){const xt=Ae[ge.current],Tt=w?w(xt):!1;if(nt.preventDefault(),Tt)return;dn(nt,xt,"selectOption"),r&&re.current.setSelectionRange(re.current.value.length,re.current.value.length)}else b&&_e!==""&&at===!1&&(E&&nt.preventDefault(),dn(nt,_e,"createOption","freeSolo"));break;case"Escape":Oe?(nt.preventDefault(),nt.stopPropagation(),vt(nt,"escape")):c&&(_e!==""||E&&de.length>0||F)&&(nt.preventDefault(),nt.stopPropagation(),ot(nt));break;case"Backspace":if(E&&!H&&_e===""&&de.length>0){const xt=ue===-1?de.length-1:ue,Tt=de.slice();Tt.splice(xt,1),Pt(nt,Tt,"removeOption",{option:de[xt]})}!E&&F&&!H&&_e===""&&Pt(nt,null,"removeOption",{option:de});break;case"Delete":if(E&&!H&&_e===""&&de.length>0&&ue!==-1){const xt=ue,Tt=de.slice();Tt.splice(xt,1),Pt(nt,Tt,"removeOption",{option:de[xt]})}!E&&F&&!H&&_e===""&&Pt(nt,null,"removeOption",{option:de});break}},Ht=pt=>{Te(!0),ue!==-1&&(fe(-1),Ze(-1)),B&&!J.current&&et(pt)},jt=pt=>{if(t(ce)){re.current.focus();return}Te(!1),te.current=!0,J.current=!1,i&&ge.current!==-1&&Oe?dn(pt,Ae[ge.current],"blur"):i&&b&&_e!==""?dn(pt,_e,"blur","freeSolo"):l&&Re(pt,de,"blur"),vt(pt,"blur")},Vt=pt=>{const nt=pt.target.value;_e!==nt&&(xe(nt),We(!1),D&&D(pt,nt,"input")),nt===""?!p&&!E&&!F&&Pt(pt,null,"clear"):et(pt)},nn=pt=>{const nt=Number(pt.currentTarget.getAttribute("data-option-index"));ge.current!==nt&<({event:pt,index:nt,reason:"mouse"})},zt=pt=>{lt({event:pt,index:Number(pt.currentTarget.getAttribute("data-option-index")),reason:"touch"}),Jt.current=!0},Nn=pt=>{const nt=Number(pt.currentTarget.getAttribute("data-option-index"));dn(pt,Ae[nt],"selectOption"),Jt.current=!1},xr=pt=>nt=>{const xt=de.slice();xt.splice(pt,1),Pt(nt,xt,"removeOption",{option:de[pt]})},ur=pt=>{Pt(pt,null,"removeOption",{option:de})},Zt=pt=>{Ue?vt(pt,"toggleInput"):et(pt)},Ot=pt=>{pt.currentTarget.contains(pt.target)&&pt.target.getAttribute("id")!==K&&pt.preventDefault()},qt=pt=>{pt.currentTarget.contains(pt.target)&&(re.current.focus(),W&&te.current&&re.current.selectionEnd-re.current.selectionStart===0&&re.current.select(),te.current=!1)},Kt=pt=>{!m&&(_e===""||!Ue)&&Zt(pt)};let gn=b&&_e.length>0;gn=gn||(E?de.length>0:de!==null);let An=Ae;return N&&(An=Ae.reduce((pt,nt,xt)=>{const Tt=N(nt);return pt.length>0&&pt[pt.length-1].group===Tt?pt[pt.length-1].options.push(nt):pt.push({key:xt,index:xt,group:Tt,options:[nt]}),pt},[])),m&&we&&jt(),{getRootProps:(pt={})=>({...pt,onKeyDown:mt(pt),onMouseDown:Ot,onClick:qt}),getInputLabelProps:()=>({id:`${K}-label`,htmlFor:K}),getInputProps:()=>({id:K,value:_e,onBlur:jt,onFocus:Ht,onChange:Vt,onMouseDown:Kt,"aria-activedescendant":Oe?"":null,"aria-autocomplete":r?"both":"list","aria-controls":dt?`${K}-listbox`:void 0,"aria-expanded":dt,autoComplete:"off",ref:re,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:m}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:ot}),getItemProps:({index:pt=0}={})=>({...E&&{key:pt},...F?{"data-item-index":pt}:{"data-tag-index":pt},tabIndex:-1,...!H&&{onDelete:E?xr(pt):ur}}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Zt}),getTagProps:({index:pt})=>({key:pt,"data-tag-index":pt,tabIndex:-1,...!H&&{onDelete:xr(pt)}}),getListboxProps:()=>({role:"listbox",id:`${K}-listbox`,"aria-labelledby":`${K}-label`,ref:Me,onMouseDown:pt=>{pt.preventDefault()}}),getOptionProps:({index:pt,option:nt})=>{const xt=(E?de:[de]).some(rn=>rn!=null&&P(nt,rn)),Tt=w?w(nt):!1;return{key:(S==null?void 0:S(nt))??X(nt),tabIndex:-1,role:"option",id:`${K}-option-${pt}`,onMouseMove:nn,onClick:Nn,onTouchStart:zt,"data-option-index":pt,"aria-disabled":Tt,"aria-selected":xt}},id:K,inputValue:_e,value:de,dirty:gn,expanded:Oe&&ae,popupOpen:Oe,focused:we||ue!==-1,anchorEl:ae,setAnchorEl:oe,focusedItem:ue,focusedTag:ue,groupedOptions:An}}var um="top",$0="bottom",D0="right",dm="left",Sxe="auto",FL=[um,$0,D0,dm],pT="start",U3="end",o0n="clippingParents",Ont="viewport",lM="popper",i0n="reference",eke=FL.reduce(function(e,t){return e.concat([t+"-"+pT,t+"-"+U3])},[]),$nt=[].concat(FL,[Sxe]).reduce(function(e,t){return e.concat([t,t+"-"+pT,t+"-"+U3])},[]),a0n="beforeRead",s0n="read",l0n="afterRead",c0n="beforeMain",u0n="main",d0n="afterMain",f0n="beforeWrite",p0n="write",h0n="afterWrite",m0n=[a0n,s0n,l0n,c0n,u0n,d0n,f0n,p0n,h0n];function db(e){return e?(e.nodeName||"").toLowerCase():null}function hg(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function fI(e){var t=hg(e).Element;return e instanceof t||e instanceof Element}function w0(e){var t=hg(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Cxe(e){if(typeof ShadowRoot>"u")return!1;var t=hg(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function g0n(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!w0(i)||!db(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(s){var l=o[s];l===!1?i.removeAttribute(s):i.setAttribute(s,l===!0?"":l)}))})}function x0n(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),l=s.reduce(function(c,u){return c[u]="",c},{});!w0(o)||!db(o)||(Object.assign(o.style,l),Object.keys(i).forEach(function(c){o.removeAttribute(c)}))})}}const y0n={name:"applyStyles",enabled:!0,phase:"write",fn:g0n,effect:x0n,requires:["computeStyles"]};function Xv(e){return e.split("-")[0]}var RE=Math.max,JV=Math.min,hT=Math.round;function cse(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Dnt(){return!/^((?!chrome|android).)*safari/i.test(cse())}function mT(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&w0(e)&&(o=e.offsetWidth>0&&hT(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&hT(r.height)/e.offsetHeight||1);var s=fI(e)?hg(e):window,l=s.visualViewport,c=!Dnt()&&n,u=(r.left+(c&&l?l.offsetLeft:0))/o,d=(r.top+(c&&l?l.offsetTop:0))/i,p=r.width/o,h=r.height/i;return{width:p,height:h,top:d,right:u+p,bottom:d+h,left:u,x:u,y:d}}function Nxe(e){var t=mT(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function Lnt(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Cxe(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ww(e){return hg(e).getComputedStyle(e)}function v0n(e){return["table","td","th"].indexOf(db(e))>=0}function tN(e){return((fI(e)?e.ownerDocument:e.document)||window.document).documentElement}function aK(e){return db(e)==="html"?e:e.assignedSlot||e.parentNode||(Cxe(e)?e.host:null)||tN(e)}function tke(e){return!w0(e)||ww(e).position==="fixed"?null:e.offsetParent}function b0n(e){var t=/firefox/i.test(cse()),n=/Trident/i.test(cse());if(n&&w0(e)){var r=ww(e);if(r.position==="fixed")return null}var o=aK(e);for(Cxe(o)&&(o=o.host);w0(o)&&["html","body"].indexOf(db(o))<0;){var i=ww(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function zL(e){for(var t=hg(e),n=tke(e);n&&v0n(n)&&ww(n).position==="static";)n=tke(n);return n&&(db(n)==="html"||db(n)==="body"&&ww(n).position==="static")?t:n||b0n(e)||t}function jxe(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function dO(e,t,n){return RE(e,JV(t,n))}function w0n(e,t,n){var r=dO(e,t,n);return r>n?n:r}function Fnt(){return{top:0,right:0,bottom:0,left:0}}function znt(e){return Object.assign({},Fnt(),e)}function Bnt(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var S0n=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,znt(typeof t!="number"?t:Bnt(t,FL))};function C0n(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,s=n.modifiersData.popperOffsets,l=Xv(n.placement),c=jxe(l),u=[dm,D0].indexOf(l)>=0,d=u?"height":"width";if(!(!i||!s)){var p=S0n(o.padding,n),h=Nxe(i),m=c==="y"?um:dm,g=c==="y"?$0:D0,y=n.rects.reference[d]+n.rects.reference[c]-s[c]-n.rects.popper[d],x=s[c]-n.rects.reference[c],v=zL(i),b=v?c==="y"?v.clientHeight||0:v.clientWidth||0:0,w=y/2-x/2,S=p[m],C=b-h[d]-p[g],N=b/2-h[d]/2+w,j=dO(S,N,C),I=c;n.modifiersData[r]=(t={},t[I]=j,t.centerOffset=j-N,t)}}function N0n(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||Lnt(t.elements.popper,o)&&(t.elements.arrow=o))}const j0n={name:"arrow",enabled:!0,phase:"main",fn:C0n,effect:N0n,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function gT(e){return e.split("-")[1]}var E0n={top:"auto",right:"auto",bottom:"auto",left:"auto"};function I0n(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:hT(n*o)/o||0,y:hT(r*o)/o||0}}function nke(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,s=e.offsets,l=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,p=e.isFixed,h=s.x,m=h===void 0?0:h,g=s.y,y=g===void 0?0:g,x=typeof d=="function"?d({x:m,y}):{x:m,y};m=x.x,y=x.y;var v=s.hasOwnProperty("x"),b=s.hasOwnProperty("y"),w=dm,S=um,C=window;if(u){var N=zL(n),j="clientHeight",I="clientWidth";if(N===hg(n)&&(N=tN(n),ww(N).position!=="static"&&l==="absolute"&&(j="scrollHeight",I="scrollWidth")),N=N,o===um||(o===dm||o===D0)&&i===U3){S=$0;var _=p&&N===C&&C.visualViewport?C.visualViewport.height:N[j];y-=_-r.height,y*=c?1:-1}if(o===dm||(o===um||o===$0)&&i===U3){w=D0;var T=p&&N===C&&C.visualViewport?C.visualViewport.width:N[I];m-=T-r.width,m*=c?1:-1}}var P=Object.assign({position:l},u&&E0n),E=d===!0?I0n({x:m,y},hg(n)):{x:m,y};if(m=E.x,y=E.y,c){var M;return Object.assign({},P,(M={},M[S]=b?"0":"",M[w]=v?"0":"",M.transform=(C.devicePixelRatio||1)<=1?"translate("+m+"px, "+y+"px)":"translate3d("+m+"px, "+y+"px, 0)",M))}return Object.assign({},P,(t={},t[S]=b?y+"px":"",t[w]=v?m+"px":"",t.transform="",t))}function _0n(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,s=i===void 0?!0:i,l=n.roundOffsets,c=l===void 0?!0:l,u={placement:Xv(t.placement),variation:gT(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,nke(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,nke(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const P0n={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:_0n,data:{}};var bF={passive:!0};function A0n(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,s=r.resize,l=s===void 0?!0:s,c=hg(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",n.update,bF)}),l&&c.addEventListener("resize",n.update,bF),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,bF)}),l&&c.removeEventListener("resize",n.update,bF)}}const T0n={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:A0n,data:{}};var k0n={left:"right",right:"left",bottom:"top",top:"bottom"};function Qz(e){return e.replace(/left|right|bottom|top/g,function(t){return k0n[t]})}var M0n={start:"end",end:"start"};function rke(e){return e.replace(/start|end/g,function(t){return M0n[t]})}function Exe(e){var t=hg(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Ixe(e){return mT(tN(e)).left+Exe(e).scrollLeft}function R0n(e,t){var n=hg(e),r=tN(e),o=n.visualViewport,i=r.clientWidth,s=r.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;var u=Dnt();(u||!u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:l+Ixe(e),y:c}}function O0n(e){var t,n=tN(e),r=Exe(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=RE(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=RE(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),l=-r.scrollLeft+Ixe(e),c=-r.scrollTop;return ww(o||n).direction==="rtl"&&(l+=RE(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:s,x:l,y:c}}function _xe(e){var t=ww(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function Hnt(e){return["html","body","#document"].indexOf(db(e))>=0?e.ownerDocument.body:w0(e)&&_xe(e)?e:Hnt(aK(e))}function fO(e,t){var n;t===void 0&&(t=[]);var r=Hnt(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=hg(r),s=o?[i].concat(i.visualViewport||[],_xe(r)?r:[]):r,l=t.concat(s);return o?l:l.concat(fO(aK(s)))}function use(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $0n(e,t){var n=mT(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function oke(e,t,n){return t===Ont?use(R0n(e,n)):fI(t)?$0n(t,n):use(O0n(tN(e)))}function D0n(e){var t=fO(aK(e)),n=["absolute","fixed"].indexOf(ww(e).position)>=0,r=n&&w0(e)?zL(e):e;return fI(r)?t.filter(function(o){return fI(o)&&Lnt(o,r)&&db(o)!=="body"}):[]}function L0n(e,t,n,r){var o=t==="clippingParents"?D0n(e):[].concat(t),i=[].concat(o,[n]),s=i[0],l=i.reduce(function(c,u){var d=oke(e,u,r);return c.top=RE(d.top,c.top),c.right=JV(d.right,c.right),c.bottom=JV(d.bottom,c.bottom),c.left=RE(d.left,c.left),c},oke(e,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Vnt(e){var t=e.reference,n=e.element,r=e.placement,o=r?Xv(r):null,i=r?gT(r):null,s=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,c;switch(o){case um:c={x:s,y:t.y-n.height};break;case $0:c={x:s,y:t.y+t.height};break;case D0:c={x:t.x+t.width,y:l};break;case dm:c={x:t.x-n.width,y:l};break;default:c={x:t.x,y:t.y}}var u=o?jxe(o):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case pT:c[u]=c[u]-(t[d]/2-n[d]/2);break;case U3:c[u]=c[u]+(t[d]/2-n[d]/2);break}}return c}function W3(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,s=i===void 0?e.strategy:i,l=n.boundary,c=l===void 0?o0n:l,u=n.rootBoundary,d=u===void 0?Ont:u,p=n.elementContext,h=p===void 0?lM:p,m=n.altBoundary,g=m===void 0?!1:m,y=n.padding,x=y===void 0?0:y,v=znt(typeof x!="number"?x:Bnt(x,FL)),b=h===lM?i0n:lM,w=e.rects.popper,S=e.elements[g?b:h],C=L0n(fI(S)?S:S.contextElement||tN(e.elements.popper),c,d,s),N=mT(e.elements.reference),j=Vnt({reference:N,element:w,placement:o}),I=use(Object.assign({},w,j)),_=h===lM?I:N,T={top:C.top-_.top+v.top,bottom:_.bottom-C.bottom+v.bottom,left:C.left-_.left+v.left,right:_.right-C.right+v.right},P=e.modifiersData.offset;if(h===lM&&P){var E=P[o];Object.keys(T).forEach(function(M){var R=[D0,$0].indexOf(M)>=0?1:-1,$=[um,$0].indexOf(M)>=0?"y":"x";T[M]+=E[$]*R})}return T}function F0n(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,s=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?$nt:c,d=gT(r),p=d?l?eke:eke.filter(function(g){return gT(g)===d}):FL,h=p.filter(function(g){return u.indexOf(g)>=0});h.length===0&&(h=p);var m=h.reduce(function(g,y){return g[y]=W3(e,{placement:y,boundary:o,rootBoundary:i,padding:s})[Xv(y)],g},{});return Object.keys(m).sort(function(g,y){return m[g]-m[y]})}function z0n(e){if(Xv(e)===Sxe)return[];var t=Qz(e);return[rke(e),t,rke(t)]}function B0n(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,l=s===void 0?!0:s,c=n.fallbackPlacements,u=n.padding,d=n.boundary,p=n.rootBoundary,h=n.altBoundary,m=n.flipVariations,g=m===void 0?!0:m,y=n.allowedAutoPlacements,x=t.options.placement,v=Xv(x),b=v===x,w=c||(b||!g?[Qz(x)]:z0n(x)),S=[x].concat(w).reduce(function(U,K){return U.concat(Xv(K)===Sxe?F0n(t,{placement:K,boundary:d,rootBoundary:p,padding:u,flipVariations:g,allowedAutoPlacements:y}):K)},[]),C=t.rects.reference,N=t.rects.popper,j=new Map,I=!0,_=S[0],T=0;T=0,$=R?"width":"height",D=W3(t,{placement:P,boundary:d,rootBoundary:p,altBoundary:h,padding:u}),z=R?M?D0:dm:M?$0:um;C[$]>N[$]&&(z=Qz(z));var V=Qz(z),B=[];if(i&&B.push(D[E]<=0),l&&B.push(D[z]<=0,D[V]<=0),B.every(function(U){return U})){_=P,I=!1;break}j.set(P,B)}if(I)for(var G=g?3:1,H=function(K){var X=S.find(function(J){var te=j.get(J);if(te)return te.slice(0,K).every(function(re){return re})});if(X)return _=X,"break"},F=G;F>0;F--){var W=H(F);if(W==="break")break}t.placement!==_&&(t.modifiersData[r]._skip=!0,t.placement=_,t.reset=!0)}}const H0n={name:"flip",enabled:!0,phase:"main",fn:B0n,requiresIfExists:["offset"],data:{_skip:!1}};function ike(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ake(e){return[um,D0,$0,dm].some(function(t){return e[t]>=0})}function V0n(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,s=W3(t,{elementContext:"reference"}),l=W3(t,{altBoundary:!0}),c=ike(s,r),u=ike(l,o,i),d=ake(c),p=ake(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":p})}const U0n={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:V0n};function W0n(e,t,n){var r=Xv(e),o=[dm,um].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=i[0],l=i[1];return s=s||0,l=(l||0)*o,[dm,D0].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function G0n(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,s=$nt.reduce(function(d,p){return d[p]=W0n(p,t.rects,i),d},{}),l=s[t.placement],c=l.x,u=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=s}const q0n={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:G0n};function K0n(e){var t=e.state,n=e.name;t.modifiersData[n]=Vnt({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Y0n={name:"popperOffsets",enabled:!0,phase:"read",fn:K0n,data:{}};function X0n(e){return e==="x"?"y":"x"}function Q0n(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,s=n.altAxis,l=s===void 0?!1:s,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,p=n.padding,h=n.tether,m=h===void 0?!0:h,g=n.tetherOffset,y=g===void 0?0:g,x=W3(t,{boundary:c,rootBoundary:u,padding:p,altBoundary:d}),v=Xv(t.placement),b=gT(t.placement),w=!b,S=jxe(v),C=X0n(S),N=t.modifiersData.popperOffsets,j=t.rects.reference,I=t.rects.popper,_=typeof y=="function"?y(Object.assign({},t.rects,{placement:t.placement})):y,T=typeof _=="number"?{mainAxis:_,altAxis:_}:Object.assign({mainAxis:0,altAxis:0},_),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(N){if(i){var M,R=S==="y"?um:dm,$=S==="y"?$0:D0,D=S==="y"?"height":"width",z=N[S],V=z+x[R],B=z-x[$],G=m?-I[D]/2:0,H=b===pT?j[D]:I[D],F=b===pT?-I[D]:-j[D],W=t.elements.arrow,U=m&&W?Nxe(W):{width:0,height:0},K=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Fnt(),X=K[R],J=K[$],te=dO(0,j[D],U[D]),re=w?j[D]/2-G-te-X-T.mainAxis:H-te-X-T.mainAxis,ce=w?-j[D]/2+G+te+J+T.mainAxis:F+te+J+T.mainAxis,ae=t.elements.arrow&&zL(t.elements.arrow),oe=ae?S==="y"?ae.clientTop||0:ae.clientLeft||0:0,ue=(M=P==null?void 0:P[S])!=null?M:0,fe=z+re-ue-oe,se=z+ce-ue,ge=dO(m?JV(V,fe):V,z,m?RE(B,se):B);N[S]=ge,E[S]=ge-z}if(l){var ye,de=S==="x"?um:dm,Ne=S==="x"?$0:D0,_e=N[C],xe=C==="y"?"height":"width",we=_e+x[de],Te=_e-x[Ne],Re=[um,dm].indexOf(v)!==-1,Ue=(ye=P==null?void 0:P[C])!=null?ye:0,He=Re?we:_e-j[xe]-I[xe]-Ue+T.altAxis,Ye=Re?_e+j[xe]+I[xe]-Ue-T.altAxis:Te,We=m&&Re?w0n(He,_e,Ye):dO(m?He:we,_e,m?Ye:Te);N[C]=We,E[C]=We-_e}t.modifiersData[r]=E}}const J0n={name:"preventOverflow",enabled:!0,phase:"main",fn:Q0n,requiresIfExists:["offset"]};function Z0n(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function exn(e){return e===hg(e)||!w0(e)?Exe(e):Z0n(e)}function txn(e){var t=e.getBoundingClientRect(),n=hT(t.width)/e.offsetWidth||1,r=hT(t.height)/e.offsetHeight||1;return n!==1||r!==1}function nxn(e,t,n){n===void 0&&(n=!1);var r=w0(t),o=w0(t)&&txn(t),i=tN(t),s=mT(e,o,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!n)&&((db(t)!=="body"||_xe(i))&&(l=exn(t)),w0(t)?(c=mT(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=Ixe(i))),{x:s.left+l.scrollLeft-c.x,y:s.top+l.scrollTop-c.y,width:s.width,height:s.height}}function rxn(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var s=[].concat(i.requires||[],i.requiresIfExists||[]);s.forEach(function(l){if(!n.has(l)){var c=t.get(l);c&&o(c)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function oxn(e){var t=rxn(e);return m0n.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function ixn(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function axn(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var ske={placement:"bottom",modifiers:[],strategy:"absolute"};function lke(){for(var e=arguments.length,t=new Array(e),n=0;n=19?((t=e==null?void 0:e.props)==null?void 0:t.ref)||null:(e==null?void 0:e.ref)||null}function cxn(e){return typeof e=="function"?e():e}const Wnt=f.forwardRef(function(t,n){const{children:r,container:o,disablePortal:i=!1}=t,[s,l]=f.useState(null),c=Di(f.isValidElement(r)?nN(r):null,n);if(Ia(()=>{i||l(cxn(o)||document.body)},[o,i]),Ia(()=>{if(s&&!i)return rse(n,s),()=>{rse(n,null)}},[n,s,i]),i){if(f.isValidElement(r)){const u={ref:c};return f.cloneElement(r,u)}return r}return s&&pu.createPortal(r,s)});function uxn(e){return _r("MuiPopper",e)}Pr("MuiPopper",["root"]);function dxn(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function dse(e){return typeof e=="function"?e():e}function fxn(e){return e.nodeType!==void 0}const pxn=e=>{const{classes:t}=e;return Un({root:["root"]},uxn,t)},hxn={},mxn=f.forwardRef(function(t,n){const{anchorEl:r,children:o,direction:i,disablePortal:s,modifiers:l,open:c,placement:u,popperOptions:d,popperRef:p,slotProps:h={},slots:m={},TransitionProps:g,ownerState:y,...x}=t,v=f.useRef(null),b=Di(v,n),w=f.useRef(null),S=Di(w,p),C=f.useRef(S);Ia(()=>{C.current=S},[S]),f.useImperativeHandle(p,()=>w.current,[]);const N=dxn(u,i),[j,I]=f.useState(N),[_,T]=f.useState(dse(r));f.useEffect(()=>{w.current&&w.current.forceUpdate()}),f.useEffect(()=>{r&&T(dse(r))},[r]),Ia(()=>{if(!_||!c)return;const $=V=>{I(V.placement)};let D=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:V})=>{$(V)}}];l!=null&&(D=D.concat(l)),d&&d.modifiers!=null&&(D=D.concat(d.modifiers));const z=Unt(_,v.current,{placement:N,...d,modifiers:D});return C.current(z),()=>{z.destroy(),C.current(null)}},[_,s,l,c,d,N]);const P={placement:j};g!==null&&(P.TransitionProps=g);const E=pxn(t),M=m.root??"div",R=xT({elementType:M,externalSlotProps:h.root,externalForwardedProps:x,additionalProps:{role:"tooltip",ref:b},ownerState:t,className:E.root});return a.jsx(M,{...R,children:typeof o=="function"?o(P):o})}),gxn=f.forwardRef(function(t,n){const{anchorEl:r,children:o,container:i,direction:s="ltr",disablePortal:l=!1,keepMounted:c=!1,modifiers:u,open:d,placement:p="bottom",popperOptions:h=hxn,popperRef:m,style:g,transition:y=!1,slotProps:x={},slots:v={},...b}=t,[w,S]=f.useState(!0),C=()=>{S(!1)},N=()=>{S(!0)};if(!c&&!d&&(!y||w))return null;let j;if(i)j=i;else if(r){const T=dse(r);j=T&&fxn(T)?Zl(T).body:Zl(null).body}const I=!d&&c&&(!y||w)?"none":void 0,_=y?{in:d,onEnter:C,onExited:N}:void 0;return a.jsx(Wnt,{disablePortal:l,container:j,children:a.jsx(mxn,{anchorEl:r,direction:s,disablePortal:l,modifiers:u,ref:n,open:y?!w:d,placement:p,popperOptions:h,popperRef:m,slotProps:x,slots:v,...b,style:{position:"fixed",top:0,left:0,display:I,...g},TransitionProps:_,children:o})})}),xxn=Bt(gxn,{name:"MuiPopper",slot:"Root"})({}),BL=f.forwardRef(function(t,n){const r=$d(),o=Rr({props:t,name:"MuiPopper"}),{anchorEl:i,component:s,components:l,componentsProps:c,container:u,disablePortal:d,keepMounted:p,modifiers:h,open:m,placement:g,popperOptions:y,popperRef:x,transition:v,slots:b,slotProps:w,...S}=o,C=(b==null?void 0:b.root)??(l==null?void 0:l.Root),N={anchorEl:i,container:u,disablePortal:d,keepMounted:p,modifiers:h,open:m,placement:g,popperOptions:y,popperRef:x,transition:v,...S};return a.jsx(xxn,{as:s,direction:r?"rtl":"ltr",slots:{root:C},slotProps:w??c,...N,ref:n})});function yxn(e){return _r("MuiListSubheader",e)}Pr("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const vxn=e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:i}=e,s={root:["root",n!=="default"&&`color${vn(n)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]};return Un(s,yxn,t)},bxn=Bt("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${vn(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(jr(({theme:e})=>({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14),variants:[{props:{color:"primary"},style:{color:(e.vars||e).palette.primary.main}},{props:{color:"inherit"},style:{color:"inherit"}},{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.inset,style:{paddingLeft:72}},{props:({ownerState:t})=>!t.disableSticky,style:{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper}}]}))),fse=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiListSubheader"}),{className:o,color:i="default",component:s="li",disableGutters:l=!1,disableSticky:c=!1,inset:u=!1,...d}=r,p={...r,color:i,component:s,disableGutters:l,disableSticky:c,inset:u},h=vxn(p);return a.jsx(bxn,{as:s,className:be(h.root,o),ref:n,ownerState:p,...d})});fse&&(fse.muiSkipListHighlight=!0);const wxn=wi(a.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function Sxn(e){return _r("MuiChip",e)}const Ji=Pr("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Cxn=e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:i,onDelete:s,clickable:l,variant:c}=e,u={root:["root",c,n&&"disabled",`size${vn(r)}`,`color${vn(o)}`,l&&"clickable",l&&`clickableColor${vn(o)}`,s&&"deletable",s&&`deletableColor${vn(o)}`,`${c}${vn(o)}`],label:["label",`label${vn(r)}`],avatar:["avatar",`avatar${vn(r)}`,`avatarColor${vn(o)}`],icon:["icon",`icon${vn(r)}`,`iconColor${vn(i)}`],deleteIcon:["deleteIcon",`deleteIcon${vn(r)}`,`deleteIconColor${vn(o)}`,`deleteIcon${vn(c)}Color${vn(o)}`]};return Un(u,Sxn,t)},Nxn=Bt("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:i,onDelete:s,size:l,variant:c}=n;return[{[`& .${Ji.avatar}`]:t.avatar},{[`& .${Ji.avatar}`]:t[`avatar${vn(l)}`]},{[`& .${Ji.avatar}`]:t[`avatarColor${vn(r)}`]},{[`& .${Ji.icon}`]:t.icon},{[`& .${Ji.icon}`]:t[`icon${vn(l)}`]},{[`& .${Ji.icon}`]:t[`iconColor${vn(o)}`]},{[`& .${Ji.deleteIcon}`]:t.deleteIcon},{[`& .${Ji.deleteIcon}`]:t[`deleteIcon${vn(l)}`]},{[`& .${Ji.deleteIcon}`]:t[`deleteIconColor${vn(r)}`]},{[`& .${Ji.deleteIcon}`]:t[`deleteIcon${vn(c)}Color${vn(r)}`]},t.root,t[`size${vn(l)}`],t[`color${vn(r)}`],i&&t.clickable,i&&r!=="default"&&t[`clickableColor${vn(r)}`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${vn(r)}`],t[c],t[`${c}${vn(r)}`]]}})(jr(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Ji.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Ji.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${Ji.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${Ji.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${Ji.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${Ji.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Ji.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Ji.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Ji.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(ul(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${Ji.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${Ji.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${Ji.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Ji.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(ul(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${Ji.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${Ji.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(ul(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${Ji.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${Ji.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Ji.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${Ji.avatar}`]:{marginLeft:4},[`& .${Ji.avatarSmall}`]:{marginLeft:2},[`& .${Ji.icon}`]:{marginLeft:4},[`& .${Ji.iconSmall}`]:{marginLeft:2},[`& .${Ji.deleteIcon}`]:{marginRight:5},[`& .${Ji.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(ul()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.alpha((e.vars||e).palette[n].main,.7)}`,[`&.${Ji.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${Ji.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${Ji.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),jxn=Bt("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${vn(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function cke(e){return e.key==="Backspace"||e.key==="Delete"}const bh=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiChip"}),{avatar:o,className:i,clickable:s,color:l="default",component:c,deleteIcon:u,disabled:d=!1,icon:p,label:h,onClick:m,onDelete:g,onKeyDown:y,onKeyUp:x,size:v="medium",variant:b="filled",tabIndex:w,skipFocusWhenDisabled:S=!1,slots:C={},slotProps:N={},...j}=r,I=f.useRef(null),_=Di(I,n),T=X=>{X.stopPropagation(),g&&g(X)},P=X=>{X.currentTarget===X.target&&cke(X)&&X.preventDefault(),y&&y(X)},E=X=>{X.currentTarget===X.target&&g&&cke(X)&&g(X),x&&x(X)},M=s!==!1&&m?!0:s,R=M||g?ub:c||"div",$={...r,component:R,disabled:d,size:v,color:l,iconColor:f.isValidElement(p)&&p.props.color||l,onDelete:!!g,clickable:M,variant:b},D=Cxn($),z=R===ub?{component:c||"div",focusVisibleClassName:D.focusVisible,...g&&{disableRipple:!0}}:{};let V=null;g&&(V=u&&f.isValidElement(u)?f.cloneElement(u,{className:be(u.props.className,D.deleteIcon),onClick:T}):a.jsx(wxn,{className:D.deleteIcon,onClick:T}));let B=null;o&&f.isValidElement(o)&&(B=f.cloneElement(o,{className:be(D.avatar,o.props.className)}));let G=null;p&&f.isValidElement(p)&&(G=f.cloneElement(p,{className:be(D.icon,p.props.className)}));const H={slots:C,slotProps:N},[F,W]=mr("root",{elementType:Nxn,externalForwardedProps:{...H,...j},ownerState:$,shouldForwardComponentProp:!0,ref:_,className:be(D.root,i),additionalProps:{disabled:M&&d?!0:void 0,tabIndex:S&&d?-1:w,...z},getSlotProps:X=>({...X,onClick:J=>{var te;(te=X.onClick)==null||te.call(X,J),m==null||m(J)},onKeyDown:J=>{var te;(te=X.onKeyDown)==null||te.call(X,J),P(J)},onKeyUp:J=>{var te;(te=X.onKeyUp)==null||te.call(X,J),E(J)}})}),[U,K]=mr("label",{elementType:jxn,externalForwardedProps:H,ownerState:$,className:D.label});return a.jsxs(F,{as:R,...W,children:[B||G,a.jsx(U,{...K,children:h}),V]})});function wF(e){return parseInt(e,10)||0}const Exn={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Ixn(e){for(const t in e)return!1;return!0}function uke(e){return Ixn(e)||e.outerHeightStyle===0&&!e.overflowing}const Gnt=f.forwardRef(function(t,n){const{onChange:r,maxRows:o,minRows:i=1,style:s,value:l,...c}=t,{current:u}=f.useRef(l!=null),d=f.useRef(null),p=Di(n,d),h=f.useRef(null),m=f.useRef(null),g=f.useCallback(()=>{const w=d.current,S=m.current;if(!w||!S)return;const N=pg(w).getComputedStyle(w);if(N.width==="0px")return{outerHeightStyle:0,overflowing:!1};S.style.width=N.width,S.value=w.value||t.placeholder||"x",S.value.slice(-1)===` `&&(S.value+=" ");const j=N.boxSizing,I=wF(N.paddingBottom)+wF(N.paddingTop),_=wF(N.borderBottomWidth)+wF(N.borderTopWidth),T=S.scrollHeight;S.value="x";const P=S.scrollHeight;let E=T;i&&(E=Math.max(Number(i)*P,E)),o&&(E=Math.min(Number(o)*P,E)),E=Math.max(E,P);const M=E+(j==="border-box"?I+_:0),R=Math.abs(E-T)<=1;return{outerHeightStyle:M,overflowing:R}},[o,i,t.placeholder]),y=no(()=>{const w=d.current,S=g();if(!w||!S||uke(S))return!1;const C=S.outerHeightStyle;return h.current!=null&&h.current!==C}),x=f.useCallback(()=>{const w=d.current,S=g();if(!w||!S||uke(S))return;const C=S.outerHeightStyle;h.current!==C&&(h.current=C,w.style.height=`${C}px`),w.style.overflow=S.overflowing?"hidden":""},[g]),v=f.useRef(-1);Ia(()=>{const w=py(x),S=d==null?void 0:d.current;if(!S)return;const C=pg(S);C.addEventListener("resize",w);let N;return typeof ResizeObserver<"u"&&(N=new ResizeObserver(()=>{y()&&(N.unobserve(S),cancelAnimationFrame(v.current),x(),v.current=requestAnimationFrame(()=>{N.observe(S)}))}),N.observe(S)),()=>{w.clear(),cancelAnimationFrame(v.current),C.removeEventListener("resize",w),N&&N.disconnect()}},[g,x,y]),Ia(()=>{x()});const b=w=>{u||x();const S=w.target,C=S.value.length,N=S.value.endsWith(` `),j=S.selectionStart===C;N&&j&&S.setSelectionRange(C,C),r&&r(w)};return a.jsxs(f.Fragment,{children:[a.jsx("textarea",{value:l,onChange:b,ref:p,rows:i,style:s,...c}),a.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:m,tabIndex:-1,style:{...Exn.shadow,...s,paddingTop:0,paddingBottom:0}})]})});function i5({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const sK=f.createContext(void 0);function qw(){return f.useContext(sK)}function dke(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function ZV(e,t=!1){return e&&(dke(e.value)&&e.value!==""||t&&dke(e.defaultValue)&&e.defaultValue!=="")}function _xn(e){return e.startAdornment}function Pxn(e){return _r("MuiInputBase",e)}const $f=Pr("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var fke;const lK=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${vn(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},cK=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},Axn=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:i,focused:s,formControl:l,fullWidth:c,hiddenLabel:u,multiline:d,readOnly:p,size:h,startAdornment:m,type:g}=e,y={root:["root",`color${vn(n)}`,r&&"disabled",o&&"error",c&&"fullWidth",s&&"focused",l&&"formControl",h&&h!=="medium"&&`size${vn(h)}`,d&&"multiline",m&&"adornedStart",i&&"adornedEnd",u&&"hiddenLabel",p&&"readOnly"],input:["input",r&&"disabled",g==="search"&&"inputTypeSearch",d&&"inputMultiline",h==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",m&&"inputAdornedStart",i&&"inputAdornedEnd",p&&"readOnly"]};return Un(y,Pxn,t)},uK=Bt("div",{name:"MuiInputBase",slot:"Root",overridesResolver:lK})(jr(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${$f.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:n})=>t.multiline&&n==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),dK=Bt("input",{name:"MuiInputBase",slot:"Input",overridesResolver:cK})(jr(({theme:e})=>{const t=e.palette.mode==="light",n={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},r={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${$f.formControl} &`]:{"&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${$f.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:i})=>!i.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:i})=>i.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),pke=Ome({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),HL=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:i,autoFocus:s,className:l,color:c,components:u={},componentsProps:d={},defaultValue:p,disabled:h,disableInjectingGlobalStyles:m,endAdornment:g,error:y,fullWidth:x=!1,id:v,inputComponent:b="input",inputProps:w={},inputRef:S,margin:C,maxRows:N,minRows:j,multiline:I=!1,name:_,onBlur:T,onChange:P,onClick:E,onFocus:M,onKeyDown:R,onKeyUp:$,placeholder:D,readOnly:z,renderSuffix:V,rows:B,size:G,slotProps:H={},slots:F={},startAdornment:W,type:U="text",value:K,...X}=r,J=w.value!=null?w.value:K,{current:te}=f.useRef(J!=null),re=f.useRef(),ce=f.useCallback(Ae=>{},[]),ae=Di(re,S,w.ref,ce),[oe,ue]=f.useState(!1),fe=qw(),se=i5({props:r,muiFormControl:fe,states:["color","disabled","error","hiddenLabel","size","required","filled"]});se.focused=fe?fe.focused:oe,f.useEffect(()=>{!fe&&h&&oe&&(ue(!1),T&&T())},[fe,h,oe,T]);const ge=fe&&fe.onFilled,ye=fe&&fe.onEmpty,de=f.useCallback(Ae=>{ZV(Ae)?ge&&ge():ye&&ye()},[ge,ye]);Ia(()=>{te&&de({value:J})},[J,de,te]);const Ne=Ae=>{M&&M(Ae),w.onFocus&&w.onFocus(Ae),fe&&fe.onFocus?fe.onFocus(Ae):ue(!0)},_e=Ae=>{T&&T(Ae),w.onBlur&&w.onBlur(Ae),fe&&fe.onBlur?fe.onBlur(Ae):ue(!1)},xe=(Ae,...qe)=>{if(!te){const dt=Ae.target||re.current;if(dt==null)throw new Error(lw(1));de({value:dt.value})}w.onChange&&w.onChange(Ae,...qe),P&&P(Ae,...qe)};f.useEffect(()=>{de(re.current)},[]);const we=Ae=>{re.current&&Ae.currentTarget===Ae.target&&re.current.focus(),E&&E(Ae)};let Te=b,Re=w;I&&Te==="input"&&(B?Re={type:void 0,minRows:B,maxRows:B,...Re}:Re={type:void 0,maxRows:N,minRows:j,...Re},Te=Gnt);const Ue=Ae=>{de(Ae.animationName==="mui-auto-fill-cancel"?re.current:{value:"x"})};f.useEffect(()=>{fe&&fe.setAdornedStart(!!W)},[fe,W]);const He={...r,color:se.color||"primary",disabled:se.disabled,endAdornment:g,error:se.error,focused:se.focused,formControl:fe,fullWidth:x,hiddenLabel:se.hiddenLabel,multiline:I,size:se.size,startAdornment:W,type:U},Ye=Axn(He),We=F.root||u.Root||uK,at=H.root||d.root||{},Oe=F.input||u.Input||dK;return Re={...Re,...H.input??d.input},a.jsxs(f.Fragment,{children:[!m&&typeof pke=="function"&&(fke||(fke=a.jsx(pke,{}))),a.jsxs(We,{...at,ref:n,onClick:we,...X,...!dT(We)&&{ownerState:{...He,...at.ownerState}},className:be(Ye.root,at.className,l,z&&"MuiInputBase-readOnly"),children:[W,a.jsx(sK.Provider,{value:null,children:a.jsx(Oe,{"aria-invalid":se.error,"aria-describedby":o,autoComplete:i,autoFocus:s,defaultValue:p,disabled:se.disabled,id:v,onAnimationStart:Ue,name:_,placeholder:D,readOnly:z,required:se.required,rows:B,value:J,onKeyDown:R,onKeyUp:$,type:U,...Re,...!dT(Oe)&&{as:Te,ownerState:{...He,...Re.ownerState}},ref:ae,className:be(Ye.input,Re.className,z&&"MuiInputBase-readOnly"),onBlur:_e,onChange:xe,onFocus:Ne})}),g,V?V({...se,startAdornment:W}):null]})]})});function Txn(e){return _r("MuiInput",e)}const g2={...$f,...Pr("MuiInput",["root","underline","input"])};function kxn(e){return _r("MuiOutlinedInput",e)}const Wg={...$f,...Pr("MuiOutlinedInput",["root","notchedOutline","input"])};function Mxn(e){return _r("MuiFilledInput",e)}const qm={...$f,...Pr("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},qnt=wi(a.jsx("path",{d:"M7 10l5 5 5-5z"}));function Rxn(e){return _r("MuiAutocomplete",e)}const Mi=Pr("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var hke,mke;const Oxn=e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:i,hasClearIcon:s,hasPopupIcon:l,inputFocused:c,popupOpen:u,size:d}=e,p={root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",s&&"hasClearIcon",l&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",c&&"inputFocused"],tag:["tag",`tagSize${vn(d)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",u&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Un(p,Rxn,t)},$xn=Bt("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:s,size:l}=n;return[{[`& .${Mi.tag}`]:t.tag},{[`& .${Mi.tag}`]:t[`tagSize${vn(l)}`]},{[`& .${Mi.inputRoot}`]:t.inputRoot},{[`& .${Mi.input}`]:t.input},{[`& .${Mi.input}`]:s&&t.inputFocused},t.root,r&&t.fullWidth,i&&t.hasPopupIcon,o&&t.hasClearIcon]}})({[`&.${Mi.focused} .${Mi.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${Mi.clearIndicator}`]:{visibility:"visible"}},[`& .${Mi.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${Mi.inputRoot}`]:{[`.${Mi.hasPopupIcon}&, .${Mi.hasClearIcon}&`]:{paddingRight:30},[`.${Mi.hasPopupIcon}.${Mi.hasClearIcon}&`]:{paddingRight:56},[`& .${Mi.input}`]:{width:0,minWidth:30}},[`& .${g2.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${g2.root}.${$f.sizeSmall}`]:{[`& .${g2.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Wg.root}`]:{padding:9,[`.${Mi.hasPopupIcon}&, .${Mi.hasClearIcon}&`]:{paddingRight:39},[`.${Mi.hasPopupIcon}.${Mi.hasClearIcon}&`]:{paddingRight:65},[`& .${Mi.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${Mi.endAdornment}`]:{right:9}},[`& .${Wg.root}.${$f.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${Mi.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${qm.root}`]:{paddingTop:19,paddingLeft:8,[`.${Mi.hasPopupIcon}&, .${Mi.hasClearIcon}&`]:{paddingRight:39},[`.${Mi.hasPopupIcon}.${Mi.hasClearIcon}&`]:{paddingRight:65},[`& .${qm.input}`]:{padding:"7px 4px"},[`& .${Mi.endAdornment}`]:{right:9}},[`& .${qm.root}.${$f.sizeSmall}`]:{paddingBottom:1,[`& .${qm.input}`]:{padding:"2.5px 4px"}},[`& .${$f.hiddenLabel}`]:{paddingTop:8},[`& .${qm.root}.${$f.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${Mi.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${qm.root}.${$f.hiddenLabel}.${$f.sizeSmall}`]:{[`& .${Mi.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${Mi.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${Mi.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${Mi.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${Mi.inputRoot}`]:{flexWrap:"wrap"}}}]}),Dxn=Bt("div",{name:"MuiAutocomplete",slot:"EndAdornment"})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),Lxn=Bt(Zs,{name:"MuiAutocomplete",slot:"ClearIndicator"})({marginRight:-2,padding:4,visibility:"hidden"}),Fxn=Bt(Zs,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popupIndicator,n.popupOpen&&t.popupIndicatorOpen]}})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),zxn=Bt(BL,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${Mi.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(jr(({theme:e})=>({zIndex:(e.vars||e).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]}))),Bxn=Bt(ea,{name:"MuiAutocomplete",slot:"Paper"})(jr(({theme:e})=>({...e.typography.body1,overflow:"auto"}))),Hxn=Bt("div",{name:"MuiAutocomplete",slot:"Loading"})(jr(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),Vxn=Bt("div",{name:"MuiAutocomplete",slot:"NoOptions"})(jr(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"}))),Uxn=Bt("ul",{name:"MuiAutocomplete",slot:"Listbox"})(jr(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${Mi.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${Mi.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${Mi.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${Mi.focused}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${Mi.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}}}))),Wxn=Bt(fse,{name:"MuiAutocomplete",slot:"GroupLabel"})(jr(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8}))),Gxn=Bt("ul",{name:"MuiAutocomplete",slot:"GroupUl"})({padding:0,[`& .${Mi.option}`]:{paddingLeft:24}}),qxn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiAutocomplete"}),{autoComplete:o=!1,autoHighlight:i=!1,autoSelect:s=!1,blurOnSelect:l=!1,ChipProps:c,className:u,clearIcon:d=hke||(hke=a.jsx(Rnt,{fontSize:"small"})),clearOnBlur:p=!r.freeSolo,clearOnEscape:h=!1,clearText:m="Clear",closeText:g="Close",componentsProps:y,defaultValue:x=r.multiple?[]:null,disableClearable:v=!1,disableCloseOnSelect:b=!1,disabled:w=!1,disabledItemsFocusable:S=!1,disableListWrap:C=!1,disablePortal:N=!1,filterOptions:j,filterSelectedOptions:I=!1,forcePopupIcon:_="auto",freeSolo:T=!1,fullWidth:P=!1,getLimitTagsText:E=ke=>`+${ke}`,getOptionDisabled:M,getOptionKey:R,getOptionLabel:$,isOptionEqualToValue:D,groupBy:z,handleHomeEndKeys:V=!r.freeSolo,id:B,includeInputInList:G=!1,inputValue:H,limitTags:F=-1,ListboxComponent:W,ListboxProps:U,loading:K=!1,loadingText:X="Loading…",multiple:J=!1,noOptionsText:te="No options",onChange:re,onClose:ce,onHighlightChange:ae,onInputChange:oe,onOpen:ue,open:fe,openOnFocus:se=!1,openText:ge="Open",options:ye,PaperComponent:de,PopperComponent:Ne,popupIcon:_e=mke||(mke=a.jsx(qnt,{})),readOnly:xe=!1,renderGroup:we,renderInput:Te,renderOption:Re,renderTags:Ue,renderValue:He,selectOnFocus:Ye=!r.freeSolo,size:We="medium",slots:at={},slotProps:Oe={},value:Ae,...qe}=r,{getRootProps:dt,getInputProps:Ze,getInputLabelProps:Qe,getPopupIndicatorProps:lt,getClearProps:bt,getItemProps:Ct,getListboxProps:Je,getOptionProps:Pe,value:Me,dirty:et,expanded:vt,id:Pt,popupOpen:Jt,focused:dn,focusedItem:Et,anchorEl:sn,setAnchorEl:ot,inputValue:mt,groupedOptions:Ht}=r0n({...r,componentName:"Autocomplete"}),jt=!v&&!w&&et&&!xe,Vt=(!T||_===!0)&&_!==!1,{onMouseDown:nn}=Ze(),{ref:zt,...Nn}=Je(),ur=$||(ke=>ke.label??ke),Zt={...r,disablePortal:N,expanded:vt,focused:dn,fullWidth:P,getOptionLabel:ur,hasClearIcon:jt,hasPopupIcon:Vt,inputFocused:Et===-1,popupOpen:Jt,size:We},Ot=Oxn(Zt),qt={slots:{paper:de,popper:Ne,...at},slotProps:{chip:c,listbox:U,...y,...Oe}},[Kt,gn]=mr("listbox",{elementType:Uxn,externalForwardedProps:qt,ownerState:Zt,className:Ot.listbox,additionalProps:Nn,ref:zt}),[An,pt]=mr("paper",{elementType:ea,externalForwardedProps:qt,ownerState:Zt,className:Ot.paper}),[nt,xt]=mr("popper",{elementType:BL,externalForwardedProps:qt,ownerState:Zt,className:Ot.popper,additionalProps:{disablePortal:N,style:{width:sn?sn.clientWidth:null},role:"presentation",anchorEl:sn,open:Jt}});let Tt;const rn=ke=>({className:Ot.tag,disabled:w,...Ct(ke)});if(J?Me.length>0&&(Ue?Tt=Ue(Me,rn,Zt):He?Tt=He(Me,rn,Zt):Tt=Me.map((ke,it)=>{const{key:Mt,..._t}=rn({index:it});return a.jsx(bh,{label:ur(ke),size:We,..._t,...qt.slotProps.chip},Mt)})):He&&Me!=null&&(Tt=He(Me,rn,Zt)),F>-1&&Array.isArray(Tt)){const ke=Tt.length-F;!dn&&ke>0&&(Tt=Tt.splice(0,F),Tt.push(a.jsx("span",{className:Ot.tag,children:E(ke)},Tt.length)))}const xn=we||(ke=>a.jsxs("li",{children:[a.jsx(Wxn,{className:Ot.groupLabel,ownerState:Zt,component:"div",children:ke.group}),a.jsx(Gxn,{className:Ot.groupUl,ownerState:Zt,children:ke.children})]},ke.key)),ar=Re||((ke,it)=>{const{key:Mt,..._t}=ke;return a.jsx("li",{..._t,children:ur(it)},Mt)}),tr=(ke,it)=>{const Mt=Pe({option:ke,index:it});return ar({...Mt,className:Ot.option},ke,{selected:Mt["aria-selected"],index:it,inputValue:mt},Zt)},jn=qt.slotProps.clearIndicator,Le=qt.slotProps.popupIndicator;return a.jsxs(f.Fragment,{children:[a.jsx($xn,{ref:n,className:be(Ot.root,u),ownerState:Zt,...dt(qe),children:Te({id:Pt,disabled:w,fullWidth:!0,size:We==="small"?"small":void 0,InputLabelProps:Qe(),InputProps:{ref:ot,className:Ot.inputRoot,startAdornment:Tt,onMouseDown:ke=>{ke.target===ke.currentTarget&&nn(ke)},...(jt||Vt)&&{endAdornment:a.jsxs(Dxn,{className:Ot.endAdornment,ownerState:Zt,children:[jt?a.jsx(Lxn,{...bt(),"aria-label":m,title:m,ownerState:Zt,...jn,className:be(Ot.clearIndicator,jn==null?void 0:jn.className),children:d}):null,Vt?a.jsx(Fxn,{...lt(),disabled:w,"aria-label":Jt?g:ge,title:Jt?g:ge,ownerState:Zt,...Le,className:be(Ot.popupIndicator,Le==null?void 0:Le.className),children:_e}):null]})}},inputProps:{className:Ot.input,disabled:w,readOnly:xe,...Ze()}})}),sn?a.jsx(zxn,{as:nt,...xt,children:a.jsxs(Bxn,{as:An,...pt,children:[K&&Ht.length===0?a.jsx(Hxn,{className:Ot.loading,ownerState:Zt,children:X}):null,Ht.length===0&&!T&&!K?a.jsx(Vxn,{className:Ot.noOptions,ownerState:Zt,role:"presentation",onMouseDown:ke=>{ke.preventDefault()},children:te}):null,Ht.length>0?a.jsx(Kt,{as:W,...gn,children:Ht.map((ke,it)=>z?xn({key:ke.key,group:ke.group,children:ke.options.map((Mt,_t)=>tr(Mt,ke.index+_t))}):tr(ke,it))}):null]})}):null]})}),Kxn=wi(a.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}));function Yxn(e){return _r("MuiAvatar",e)}Pr("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);const Xxn=e=>{const{classes:t,variant:n,colorDefault:r}=e;return Un({root:["root",n,r&&"colorDefault"],img:["img"],fallback:["fallback"]},Yxn,t)},Qxn=Bt("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.colorDefault&&t.colorDefault]}})(jr(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(e.vars||e).palette.background.default,...e.vars?{backgroundColor:e.vars.palette.Avatar.defaultBg}:{backgroundColor:e.palette.grey[400],...e.applyStyles("dark",{backgroundColor:e.palette.grey[600]})}}}]}))),Jxn=Bt("img",{name:"MuiAvatar",slot:"Img"})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Zxn=Bt(Kxn,{name:"MuiAvatar",slot:"Fallback"})({width:"75%",height:"75%"});function eyn({crossOrigin:e,referrerPolicy:t,src:n,srcSet:r}){const[o,i]=f.useState(!1);return f.useEffect(()=>{if(!n&&!r)return;i(!1);let s=!0;const l=new Image;return l.onload=()=>{s&&i("loaded")},l.onerror=()=>{s&&i("error")},l.crossOrigin=e,l.referrerPolicy=t,l.src=n,r&&(l.srcset=r),()=>{s=!1}},[e,t,n,r]),o}const Pxe=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiAvatar"}),{alt:o,children:i,className:s,component:l="div",slots:c={},slotProps:u={},imgProps:d,sizes:p,src:h,srcSet:m,variant:g="circular",...y}=r;let x=null;const v={...r,component:l,variant:g},b=eyn({...d,...typeof u.img=="function"?u.img(v):u.img,src:h,srcSet:m}),w=h||m,S=w&&b!=="error";v.colorDefault=!S,delete v.ownerState;const C=Xxn(v),[N,j]=mr("root",{ref:n,className:be(C.root,s),elementType:Qxn,externalForwardedProps:{slots:c,slotProps:u,component:l,...y},ownerState:v}),[I,_]=mr("img",{className:C.img,elementType:Jxn,externalForwardedProps:{slots:c,slotProps:{img:{...d,...u.img}}},additionalProps:{alt:o,src:h,srcSet:m,sizes:p},ownerState:v}),[T,P]=mr("fallback",{className:C.fallback,elementType:Zxn,externalForwardedProps:{slots:c,slotProps:u},shouldForwardComponentProp:!0,ownerState:v});return S?x=a.jsx(I,{..._}):i||i===0?x=i:w&&o?x=o[0]:x=a.jsx(T,{...P}),a.jsx(N,{...j,children:x})}),tyn={entering:{opacity:1},entered:{opacity:1}},eU=f.forwardRef(function(t,n){const r=xf(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:i,appear:s=!0,children:l,easing:c,in:u,onEnter:d,onEntered:p,onEntering:h,onExit:m,onExited:g,onExiting:y,style:x,timeout:v=o,TransitionComponent:b=Sm,...w}=t,S=f.useRef(null),C=Di(S,nN(l),n),N=R=>$=>{if(R){const D=S.current;$===void 0?R(D):R(D,$)}},j=N(h),I=N((R,$)=>{bxe(R);const D=_C({style:x,timeout:v,easing:c},{mode:"enter"});R.style.webkitTransition=r.transitions.create("opacity",D),R.style.transition=r.transitions.create("opacity",D),d&&d(R,$)}),_=N(p),T=N(y),P=N(R=>{const $=_C({style:x,timeout:v,easing:c},{mode:"exit"});R.style.webkitTransition=r.transitions.create("opacity",$),R.style.transition=r.transitions.create("opacity",$),m&&m(R)}),E=N(g),M=R=>{i&&i(S.current,R)};return a.jsx(b,{appear:s,in:u,nodeRef:S,onEnter:I,onEntered:_,onEntering:j,onExit:P,onExited:E,onExiting:T,addEndListener:M,timeout:v,...w,children:(R,{ownerState:$,...D})=>f.cloneElement(l,{style:{opacity:0,visibility:R==="exited"&&!u?"hidden":void 0,...tyn[R],...x,...l.props.style},ref:C,...D})})});function nyn(e){return _r("MuiBackdrop",e)}Pr("MuiBackdrop",["root","invisible"]);const ryn=e=>{const{classes:t,invisible:n}=e;return Un({root:["root",n&&"invisible"]},nyn,t)},oyn=Bt("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),Knt=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiBackdrop"}),{children:o,className:i,component:s="div",invisible:l=!1,open:c,components:u={},componentsProps:d={},slotProps:p={},slots:h={},TransitionComponent:m,transitionDuration:g,...y}=r,x={...r,component:s,invisible:l},v=ryn(x),b={transition:m,root:u.Root,...h},w={...d,...p},S={component:s,slots:b,slotProps:w},[C,N]=mr("root",{elementType:oyn,externalForwardedProps:S,className:be(v.root,i),ownerState:x}),[j,I]=mr("transition",{elementType:eU,externalForwardedProps:S,ownerState:x});return a.jsx(j,{in:c,timeout:g,...y,...I,children:a.jsx(C,{"aria-hidden":!0,...N,ref:n,children:o})})});function iyn(e){const{badgeContent:t,invisible:n=!1,max:r=99,showZero:o=!1}=e,i=wxe({badgeContent:t,max:r});let s=n;n===!1&&t===0&&!o&&(s=!0);const{badgeContent:l,max:c=r}=s?i:e,u=l&&Number(l)>c?`${c}+`:l;return{badgeContent:l,invisible:s,max:c,displayValue:u}}function ayn(e){return _r("MuiBadge",e)}const _S=Pr("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),nee=10,ree=4,syn=e=>{const{color:t,anchorOrigin:n,invisible:r,overlap:o,variant:i,classes:s={}}=e,l={root:["root"],badge:["badge",i,r&&"invisible",`anchorOrigin${vn(n.vertical)}${vn(n.horizontal)}`,`anchorOrigin${vn(n.vertical)}${vn(n.horizontal)}${vn(o)}`,`overlap${vn(o)}`,t!=="default"&&`color${vn(t)}`]};return Un(l,ayn,s)},lyn=Bt("span",{name:"MuiBadge",slot:"Root"})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),cyn=Bt("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.badge,t[n.variant],t[`anchorOrigin${vn(n.anchorOrigin.vertical)}${vn(n.anchorOrigin.horizontal)}${vn(n.overlap)}`],n.color!=="default"&&t[`color${vn(n.color)}`],n.invisible&&t.invisible]}})(jr(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:nee*2,lineHeight:1,padding:"0 6px",height:nee*2,borderRadius:nee,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen}),variants:[...Object.entries(e.palette).filter(ul(["contrastText"])).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main,color:(e.vars||e).palette[t].contrastText}})),{props:{variant:"dot"},style:{borderRadius:ree,height:ree*2,minWidth:ree*2,padding:0}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${_S.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${_S.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${_S.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${_S.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${_S.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${_S.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${_S.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${_S.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}}]})));function gke(e){return{vertical:(e==null?void 0:e.vertical)??"top",horizontal:(e==null?void 0:e.horizontal)??"right"}}const uyn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiBadge"}),{anchorOrigin:o,className:i,classes:s,component:l,components:c={},componentsProps:u={},children:d,overlap:p="rectangular",color:h="default",invisible:m=!1,max:g=99,badgeContent:y,slots:x,slotProps:v,showZero:b=!1,variant:w="standard",...S}=r,{badgeContent:C,invisible:N,max:j,displayValue:I}=iyn({max:g,invisible:m,badgeContent:y,showZero:b}),_=wxe({anchorOrigin:gke(o),color:h,overlap:p,variant:w,badgeContent:y}),T=N||C==null&&w!=="dot",{color:P=h,overlap:E=p,anchorOrigin:M,variant:R=w}=T?_:r,$=gke(M),D=R!=="dot"?I:void 0,z={...r,badgeContent:C,invisible:T,max:j,displayValue:D,showZero:b,anchorOrigin:$,color:P,overlap:E,variant:R},V=syn(z),B={slots:{root:(x==null?void 0:x.root)??c.Root,badge:(x==null?void 0:x.badge)??c.Badge},slotProps:{root:(v==null?void 0:v.root)??u.root,badge:(v==null?void 0:v.badge)??u.badge}},[G,H]=mr("root",{elementType:lyn,externalForwardedProps:{...B,...S},ownerState:z,className:be(V.root,i),ref:n,additionalProps:{as:l}}),[F,W]=mr("badge",{elementType:cyn,externalForwardedProps:B,ownerState:z,className:V.badge});return a.jsxs(G,{...H,children:[d,a.jsx(F,{...W,children:D})]})}),dyn=Pr("MuiBox",["root"]),fyn=sL(),Dn=iMt({themeId:qv,defaultTheme:fyn,defaultClassName:dyn.root,generateClassName:vKe.generate});function pyn(e){return _r("MuiButton",e)}const LN=Pr("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),hyn=f.createContext({}),myn=f.createContext(void 0),gyn=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:i,loading:s,loadingPosition:l,classes:c}=e,u={root:["root",s&&"loading",i,`${i}${vn(t)}`,`size${vn(o)}`,`${i}Size${vn(o)}`,`color${vn(t)}`,n&&"disableElevation",r&&"fullWidth",s&&`loadingPosition${vn(l)}`],startIcon:["icon","startIcon",`iconSize${vn(o)}`],endIcon:["icon","endIcon",`iconSize${vn(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},d=Un(u,pyn,c);return{...c,...d}},Ynt=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],xyn=Bt(ub,{shouldForwardProp:e=>_h(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${vn(n.color)}`],t[`size${vn(n.size)}`],t[`${n.variant}Size${vn(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(jr(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${LN.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${LN.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${LN.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${LN.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(ul()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${LN.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${LN.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${LN.loading}`]:{color:"transparent"}}}]}})),yyn=Bt("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${vn(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...Ynt]})),vyn=Bt("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${vn(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...Ynt]})),byn=Bt("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),xke=Bt("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),ta=f.forwardRef(function(t,n){const r=f.useContext(hyn),o=f.useContext(myn),i=eI(r,t),s=Rr({props:i,name:"MuiButton"}),{children:l,color:c="primary",component:u="button",className:d,disabled:p=!1,disableElevation:h=!1,disableFocusRipple:m=!1,endIcon:g,focusVisibleClassName:y,fullWidth:x=!1,id:v,loading:b=null,loadingIndicator:w,loadingPosition:S="center",size:C="medium",startIcon:N,type:j,variant:I="text",..._}=s,T=Jo(v),P=w??a.jsx(su,{"aria-labelledby":T,color:"inherit",size:16}),E={...s,color:c,component:u,disabled:p,disableElevation:h,disableFocusRipple:m,fullWidth:x,loading:b,loadingIndicator:P,loadingPosition:S,size:C,type:j,variant:I},M=gyn(E),R=(N||b&&S==="start")&&a.jsx(yyn,{className:M.startIcon,ownerState:E,children:N||a.jsx(xke,{className:M.loadingIconPlaceholder,ownerState:E})}),$=(g||b&&S==="end")&&a.jsx(vyn,{className:M.endIcon,ownerState:E,children:g||a.jsx(xke,{className:M.loadingIconPlaceholder,ownerState:E})}),D=o||"",z=typeof b=="boolean"?a.jsx("span",{className:M.loadingWrapper,style:{display:"contents"},children:b&&a.jsx(byn,{className:M.loadingIndicator,ownerState:E,children:P})}):null;return a.jsxs(xyn,{ownerState:E,className:be(r.className,M.root,d,D),component:u,disabled:p||b,focusRipple:!m,focusVisibleClassName:be(M.focusVisible,y),ref:n,type:j,id:b?T:v,..._,classes:M,children:[R,S!=="end"&&z,l,S==="end"&&z,$]})});function wyn(e){return _r("MuiCard",e)}Pr("MuiCard",["root"]);const Syn=e=>{const{classes:t}=e;return Un({root:["root"]},wyn,t)},Cyn=Bt(ea,{name:"MuiCard",slot:"Root"})({overflow:"hidden"}),p0=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiCard"}),{className:o,raised:i=!1,...s}=r,l={...r,raised:i},c=Syn(l);return a.jsx(Cyn,{className:be(c.root,o),elevation:i?8:void 0,ref:n,ownerState:l,...s})});function Nyn(e){return _r("MuiCardContent",e)}Pr("MuiCardContent",["root"]);const jyn=e=>{const{classes:t}=e;return Un({root:["root"]},Nyn,t)},Eyn=Bt("div",{name:"MuiCardContent",slot:"Root"})({padding:16,"&:last-child":{paddingBottom:24}}),h0=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiCardContent"}),{className:o,component:i="div",...s}=r,l={...r,component:i},c=jyn(l);return a.jsx(Eyn,{as:i,className:be(c.root,o),ownerState:l,ref:n,...s})});function Iyn(e){return _r("MuiCardHeader",e)}const tU=Pr("MuiCardHeader",["root","avatar","action","content","title","subheader"]),_yn=e=>{const{classes:t}=e;return Un({root:["root"],avatar:["avatar"],action:["action"],content:["content"],title:["title"],subheader:["subheader"]},Iyn,t)},Pyn=Bt("div",{name:"MuiCardHeader",slot:"Root",overridesResolver:(e,t)=>[{[`& .${tU.title}`]:t.title},{[`& .${tU.subheader}`]:t.subheader},t.root]})({display:"flex",alignItems:"center",padding:16}),Ayn=Bt("div",{name:"MuiCardHeader",slot:"Avatar"})({display:"flex",flex:"0 0 auto",marginRight:16}),Tyn=Bt("div",{name:"MuiCardHeader",slot:"Action"})({flex:"0 0 auto",alignSelf:"flex-start",marginTop:-4,marginRight:-8,marginBottom:-4}),kyn=Bt("div",{name:"MuiCardHeader",slot:"Content"})({flex:"1 1 auto",[`.${QV.root}:where(& .${tU.title})`]:{display:"block"},[`.${QV.root}:where(& .${tU.subheader})`]:{display:"block"}}),Myn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiCardHeader"}),{action:o,avatar:i,component:s="div",disableTypography:l=!1,subheader:c,subheaderTypographyProps:u,title:d,titleTypographyProps:p,slots:h={},slotProps:m={},...g}=r,y={...r,component:s,disableTypography:l},x=_yn(y),v={slots:h,slotProps:{title:p,subheader:u,...m}};let b=d;const[w,S]=mr("title",{className:x.title,elementType:tn,externalForwardedProps:v,ownerState:y,additionalProps:{variant:i?"body2":"h5",component:"span"}});b!=null&&b.type!==tn&&!l&&(b=a.jsx(w,{...S,children:b}));let C=c;const[N,j]=mr("subheader",{className:x.subheader,elementType:tn,externalForwardedProps:v,ownerState:y,additionalProps:{variant:i?"body2":"body1",color:"textSecondary",component:"span"}});C!=null&&C.type!==tn&&!l&&(C=a.jsx(N,{...j,children:C}));const[I,_]=mr("root",{ref:n,className:x.root,elementType:Pyn,externalForwardedProps:{...v,...g,component:s},ownerState:y}),[T,P]=mr("avatar",{className:x.avatar,elementType:Ayn,externalForwardedProps:v,ownerState:y}),[E,M]=mr("content",{className:x.content,elementType:kyn,externalForwardedProps:v,ownerState:y}),[R,$]=mr("action",{className:x.action,elementType:Tyn,externalForwardedProps:v,ownerState:y});return a.jsxs(I,{..._,children:[i&&a.jsx(T,{...P,children:i}),a.jsxs(E,{...M,children:[b,C]}),o&&a.jsx(R,{...$,children:o})]})});function Ryn(e){return _r("MuiCardMedia",e)}Pr("MuiCardMedia",["root","media","img"]);const Oyn=e=>{const{classes:t,isMediaComponent:n,isImageComponent:r}=e;return Un({root:["root",n&&"media",r&&"img"]},Ryn,t)},$yn=Bt("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{isMediaComponent:r,isImageComponent:o}=n;return[t.root,r&&t.media,o&&t.img]}})({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center",variants:[{props:{isMediaComponent:!0},style:{width:"100%"}},{props:{isImageComponent:!0},style:{objectFit:"cover"}}]}),Dyn=["video","audio","picture","iframe","img"],Lyn=["picture","img"],Fyn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiCardMedia"}),{children:o,className:i,component:s="div",image:l,src:c,style:u,...d}=r,p=Dyn.includes(s),h=!p&&l?{backgroundImage:`url("${l}")`,...u}:u,m={...r,component:s,isMediaComponent:p,isImageComponent:Lyn.includes(s)},g=Oyn(m);return a.jsx($yn,{className:be(g.root,i),as:s,role:!p&&l?"img":void 0,ref:n,style:h,ownerState:m,src:p?l||c:void 0,...d,children:o})});function zyn(e){return _r("PrivateSwitchBase",e)}Pr("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Byn=e=>{const{classes:t,checked:n,disabled:r,edge:o}=e,i={root:["root",n&&"checked",r&&"disabled",o&&`edge${vn(o)}`],input:["input"]};return Un(i,zyn,t)},Hyn=Bt(ub,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),Vyn=Bt("input",{name:"MuiSwitchBase",shouldForwardProp:_h})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Xnt=f.forwardRef(function(t,n){const{autoFocus:r,checked:o,checkedIcon:i,defaultChecked:s,disabled:l,disableFocusRipple:c=!1,edge:u=!1,icon:d,id:p,inputProps:h,inputRef:m,name:g,onBlur:y,onChange:x,onFocus:v,readOnly:b,required:w=!1,tabIndex:S,type:C,value:N,slots:j={},slotProps:I={},..._}=t,[T,P]=iC({controlled:o,default:!!s,name:"SwitchBase",state:"checked"}),E=qw(),M=K=>{v&&v(K),E&&E.onFocus&&E.onFocus(K)},R=K=>{y&&y(K),E&&E.onBlur&&E.onBlur(K)},$=K=>{if(K.nativeEvent.defaultPrevented||b)return;const X=K.target.checked;P(X),x&&x(K,X)};let D=l;E&&typeof D>"u"&&(D=E.disabled);const z=C==="checkbox"||C==="radio",V={...t,checked:T,disabled:D,disableFocusRipple:c,edge:u},B=Byn(V),G={slots:j,slotProps:{input:h,...I}},[H,F]=mr("root",{ref:n,elementType:Hyn,className:B.root,shouldForwardComponentProp:!0,externalForwardedProps:{...G,component:"span",..._},getSlotProps:K=>({...K,onFocus:X=>{var J;(J=K.onFocus)==null||J.call(K,X),M(X)},onBlur:X=>{var J;(J=K.onBlur)==null||J.call(K,X),R(X)}}),ownerState:V,additionalProps:{centerRipple:!0,focusRipple:!c,disabled:D,role:void 0,tabIndex:null}}),[W,U]=mr("input",{ref:m,elementType:Vyn,className:B.input,externalForwardedProps:G,getSlotProps:K=>({...K,onChange:X=>{var J;(J=K.onChange)==null||J.call(K,X),$(X)}}),ownerState:V,additionalProps:{autoFocus:r,checked:o,defaultChecked:s,disabled:D,id:z?p:void 0,name:g,readOnly:b,required:w,tabIndex:S,type:C,...C==="checkbox"&&N===void 0?{}:{value:N}}});return a.jsxs(H,{...F,children:[a.jsx(W,{...U}),T?i:d]})}),Uyn=wi(a.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),Wyn=wi(a.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),Gyn=wi(a.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function qyn(e){return _r("MuiCheckbox",e)}const oee=Pr("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Kyn=e=>{const{classes:t,indeterminate:n,color:r,size:o}=e,i={root:["root",n&&"indeterminate",`color${vn(r)}`,`size${vn(o)}`]},s=Un(i,qyn,t);return{...t,...s}},Yyn=Bt(Xnt,{shouldForwardProp:e=>_h(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${vn(n.size)}`],n.color!=="default"&&t[`color${vn(n.color)}`]]}})(jr(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(ul()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(ul()).map(([t])=>({props:{color:t},style:{[`&.${oee.checked}, &.${oee.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${oee.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),Xyn=a.jsx(Wyn,{}),Qyn=a.jsx(Uyn,{}),Jyn=a.jsx(Gyn,{}),Zyn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiCheckbox"}),{checkedIcon:o=Xyn,color:i="primary",icon:s=Qyn,indeterminate:l=!1,indeterminateIcon:c=Jyn,inputProps:u,size:d="medium",disableRipple:p=!1,className:h,slots:m={},slotProps:g={},...y}=r,x=l?c:s,v=l?c:o,b={...r,disableRipple:p,color:i,indeterminate:l,size:d},w=Kyn(b),S=g.input??u,[C,N]=mr("root",{ref:n,elementType:Yyn,className:be(w.root,h),shouldForwardComponentProp:!0,externalForwardedProps:{slots:m,slotProps:g,...y},ownerState:b,additionalProps:{type:"checkbox",icon:f.cloneElement(x,{fontSize:x.props.fontSize??d}),checkedIcon:f.cloneElement(v,{fontSize:v.props.fontSize??d}),disableRipple:p,slots:m,slotProps:{input:gxe(typeof S=="function"?S(b):S,{"data-indeterminate":l})}}});return a.jsx(C,{...N,classes:w})});function yke(e){return e.substring(2).toLowerCase()}function evn(e,t){return t.documentElement.clientWidth(setTimeout(()=>{c.current=!0},0),()=>{c.current=!1}),[]);const d=Di(nN(t),l),p=no(g=>{const y=u.current;u.current=!1;const x=Zl(l.current);if(!c.current||!l.current||"clientX"in g&&evn(g,x))return;if(s.current){s.current=!1;return}let v;g.composedPath?v=g.composedPath().includes(l.current):v=!x.documentElement.contains(g.target)||l.current.contains(g.target),!v&&(n||!y)&&o(g)}),h=g=>y=>{u.current=!0;const x=t.props[g];x&&x(y)},m={ref:d};return i!==!1&&(m[i]=h(i)),f.useEffect(()=>{if(i!==!1){const g=yke(i),y=Zl(l.current),x=()=>{s.current=!0};return y.addEventListener(g,p),y.addEventListener("touchmove",x),()=>{y.removeEventListener(g,p),y.removeEventListener("touchmove",x)}}},[p,i]),r!==!1&&(m[r]=h(r)),f.useEffect(()=>{if(r!==!1){const g=yke(r),y=Zl(l.current);return y.addEventListener(g,p),()=>{y.removeEventListener(g,p)}}},[p,r]),f.cloneElement(t,m)}const Axe=qMt({createStyledComponent:Bt("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${vn(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),useThemeProps:e=>Rr({props:e,name:"MuiContainer"})});function Jnt(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function tvn(e){const t=Zl(e);return t.body===e?pg(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function pO(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function vke(e){return parseFloat(pg(e).getComputedStyle(e).paddingRight)||0}function nvn(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function bke(e,t,n,r,o){const i=[t,n,...r];[].forEach.call(e.children,s=>{const l=!i.includes(s),c=!nvn(s);l&&c&&pO(s,o)})}function iee(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function rvn(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(tvn(r)){const s=Jnt(pg(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${vke(r)+s}px`;const l=Zl(r).querySelectorAll(".mui-fixed");[].forEach.call(l,c=>{n.push({value:c.style.paddingRight,property:"padding-right",el:c}),c.style.paddingRight=`${vke(c)+s}px`})}let i;if(r.parentNode instanceof DocumentFragment)i=Zl(r).body;else{const s=r.parentElement,l=pg(r);i=(s==null?void 0:s.nodeName)==="HTML"&&l.getComputedStyle(s).overflowY==="scroll"?s:r}n.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{n.forEach(({value:i,el:s,property:l})=>{i?s.style.setProperty(l,i):s.style.removeProperty(l)})}}function ovn(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}let ivn=class{constructor(){this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&pO(t.modalRef,!1);const o=ovn(n);bke(n,t.mount,t.modalRef,o,!0);const i=iee(this.containers,s=>s.container===n);return i!==-1?(this.containers[i].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=iee(this.containers,i=>i.modals.includes(t)),o=this.containers[r];o.restore||(o.restore=rvn(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=iee(this.containers,s=>s.modals.includes(t)),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(r,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&pO(t.modalRef,n),bke(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const s=i.modals[i.modals.length-1];s.modalRef&&pO(s.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}};function jP(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}const avn=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function svn(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function lvn(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function cvn(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||lvn(e))}function uvn(e){const t=[],n=[];return Array.from(e.querySelectorAll(avn)).forEach((r,o)=>{const i=svn(r);i===-1||!cvn(r)||(i===0?t.push(r):n.push({documentOrder:o,tabIndex:i,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function dvn(){return!0}function Znt(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:i=uvn,isEnabled:s=dvn,open:l}=e,c=f.useRef(!1),u=f.useRef(null),d=f.useRef(null),p=f.useRef(null),h=f.useRef(null),m=f.useRef(!1),g=f.useRef(null),y=Di(nN(t),g),x=f.useRef(null);f.useEffect(()=>{!l||!g.current||(m.current=!n)},[n,l]),f.useEffect(()=>{if(!l||!g.current)return;const w=Zl(g.current),S=jP(w);return g.current.contains(S)||(g.current.hasAttribute("tabIndex")||g.current.setAttribute("tabIndex","-1"),m.current&&g.current.focus()),()=>{o||(p.current&&p.current.focus&&(c.current=!0,p.current.focus()),p.current=null)}},[l]),f.useEffect(()=>{if(!l||!g.current)return;const w=Zl(g.current),S=j=>{if(x.current=j,r||!s()||j.key!=="Tab")return;jP(w)===g.current&&j.shiftKey&&(c.current=!0,d.current&&d.current.focus())},C=()=>{var T,P;const j=g.current;if(j===null)return;const I=jP(w);if(!w.hasFocus()||!s()||c.current){c.current=!1;return}if(j.contains(I)||r&&I!==u.current&&I!==d.current)return;if(I!==h.current)h.current=null;else if(h.current!==null)return;if(!m.current)return;let _=[];if((I===u.current||I===d.current)&&(_=i(g.current)),_.length>0){const E=!!((T=x.current)!=null&&T.shiftKey&&((P=x.current)==null?void 0:P.key)==="Tab"),M=_[0],R=_[_.length-1];typeof M!="string"&&typeof R!="string"&&(E?R.focus():M.focus())}else j.focus()};w.addEventListener("focusin",C),w.addEventListener("keydown",S,!0);const N=setInterval(()=>{const j=jP(w);j&&j.tagName==="BODY"&&C()},50);return()=>{clearInterval(N),w.removeEventListener("focusin",C),w.removeEventListener("keydown",S,!0)}},[n,r,o,s,l,i]);const v=w=>{p.current===null&&(p.current=w.relatedTarget),m.current=!0,h.current=w.target;const S=t.props.onFocus;S&&S(w)},b=w=>{p.current===null&&(p.current=w.relatedTarget),m.current=!0};return a.jsxs(f.Fragment,{children:[a.jsx("div",{tabIndex:l?0:-1,onFocus:b,ref:u,"data-testid":"sentinelStart"}),f.cloneElement(t,{ref:y,onFocus:v}),a.jsx("div",{tabIndex:l?0:-1,onFocus:b,ref:d,"data-testid":"sentinelEnd"})]})}function fvn(e){return typeof e=="function"?e():e}function pvn(e){return e?e.props.hasOwnProperty("in"):!1}const wke=()=>{},SF=new ivn;function hvn(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,closeAfterTransition:o=!1,onTransitionEnter:i,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:d}=e,p=f.useRef({}),h=f.useRef(null),m=f.useRef(null),g=Di(m,d),[y,x]=f.useState(!u),v=pvn(l);let b=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(b=!1);const w=()=>Zl(h.current),S=()=>(p.current.modalRef=m.current,p.current.mount=h.current,p.current),C=()=>{SF.mount(S(),{disableScrollLock:r}),m.current&&(m.current.scrollTop=0)},N=no(()=>{const $=fvn(t)||w().body;SF.add(S(),$),m.current&&C()}),j=()=>SF.isTopModal(S()),I=no($=>{h.current=$,$&&(u&&j()?C():m.current&&pO(m.current,b))}),_=f.useCallback(()=>{SF.remove(S(),b)},[b]);f.useEffect(()=>()=>{_()},[_]),f.useEffect(()=>{u?N():(!v||!o)&&_()},[u,_,v,o,N]);const T=$=>D=>{var z;(z=$.onKeyDown)==null||z.call($,D),!(D.key!=="Escape"||D.which===229||!j())&&(n||(D.stopPropagation(),c&&c(D,"escapeKeyDown")))},P=$=>D=>{var z;(z=$.onClick)==null||z.call($,D),D.target===D.currentTarget&&c&&c(D,"backdropClick")};return{getRootProps:($={})=>{const D=YV(e);delete D.onTransitionEnter,delete D.onTransitionExited;const z={...D,...$};return{role:"presentation",...z,onKeyDown:T(z),ref:g}},getBackdropProps:($={})=>{const D=$;return{"aria-hidden":!0,...D,onClick:P(D),open:u}},getTransitionProps:()=>{const $=()=>{x(!1),i&&i()},D=()=>{x(!0),s&&s(),o&&_()};return{onEnter:VTe($,(l==null?void 0:l.props.onEnter)??wke),onExited:VTe(D,(l==null?void 0:l.props.onExited)??wke)}},rootRef:g,portalRef:I,isTopModal:j,exited:y,hasTransition:v}}function mvn(e){return _r("MuiModal",e)}Pr("MuiModal",["root","hidden","backdrop"]);const gvn=e=>{const{open:t,exited:n,classes:r}=e;return Un({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},mvn,r)},xvn=Bt("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(jr(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),yvn=Bt(Knt,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),Txe=f.forwardRef(function(t,n){const r=Rr({name:"MuiModal",props:t}),{BackdropComponent:o=yvn,BackdropProps:i,classes:s,className:l,closeAfterTransition:c=!1,children:u,container:d,component:p,components:h={},componentsProps:m={},disableAutoFocus:g=!1,disableEnforceFocus:y=!1,disableEscapeKeyDown:x=!1,disablePortal:v=!1,disableRestoreFocus:b=!1,disableScrollLock:w=!1,hideBackdrop:S=!1,keepMounted:C=!1,onClose:N,onTransitionEnter:j,onTransitionExited:I,open:_,slotProps:T={},slots:P={},theme:E,...M}=r,R={...r,closeAfterTransition:c,disableAutoFocus:g,disableEnforceFocus:y,disableEscapeKeyDown:x,disablePortal:v,disableRestoreFocus:b,disableScrollLock:w,hideBackdrop:S,keepMounted:C},{getRootProps:$,getBackdropProps:D,getTransitionProps:z,portalRef:V,isTopModal:B,exited:G,hasTransition:H}=hvn({...R,rootRef:n}),F={...R,exited:G},W=gvn(F),U={};if(u.props.tabIndex===void 0&&(U.tabIndex="-1"),H){const{onEnter:ce,onExited:ae}=z();U.onEnter=ce,U.onExited=ae}const K={slots:{root:h.Root,backdrop:h.Backdrop,...P},slotProps:{...m,...T}},[X,J]=mr("root",{ref:n,elementType:xvn,externalForwardedProps:{...K,...M,component:p},getSlotProps:$,ownerState:F,className:be(l,W==null?void 0:W.root,!F.open&&F.exited&&(W==null?void 0:W.hidden))}),[te,re]=mr("backdrop",{ref:i==null?void 0:i.ref,elementType:o,externalForwardedProps:K,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:ce=>D({...ce,onClick:ae=>{ce!=null&&ce.onClick&&ce.onClick(ae)}}),className:be(i==null?void 0:i.className,W==null?void 0:W.backdrop),ownerState:F});return!C&&!_&&(!H||G)?null:a.jsx(Wnt,{ref:V,container:d,disablePortal:v,children:a.jsxs(X,{...J,children:[!S&&o?a.jsx(te,{...re}):null,a.jsx(Znt,{disableEnforceFocus:y,disableAutoFocus:g,disableRestoreFocus:b,isEnabled:B,open:_,children:f.cloneElement(u,U)})]})})});function vvn(e){return _r("MuiDialog",e)}const aee=Pr("MuiDialog",["root","backdrop","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),ert=f.createContext({}),bvn=Bt(Knt,{name:"MuiDialog",slot:"Backdrop"})({zIndex:-1}),wvn=e=>{const{classes:t,scroll:n,maxWidth:r,fullWidth:o,fullScreen:i}=e,s={root:["root"],backdrop:["backdrop"],container:["container",`scroll${vn(n)}`],paper:["paper",`paperScroll${vn(n)}`,`paperWidth${vn(String(r))}`,o&&"paperFullWidth",i&&"paperFullScreen"]};return Un(s,vvn,t)},Svn=Bt(Txe,{name:"MuiDialog",slot:"Root"})({"@media print":{position:"absolute !important"}}),Cvn=Bt("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.container,t[`scroll${vn(n.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),Nvn=Bt(ea,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`scrollPaper${vn(n.scroll)}`],t[`paperWidth${vn(String(n.maxWidth))}`],n.fullWidth&&t.paperFullWidth,n.fullScreen&&t.paperFullScreen]}})(jr(({theme:e})=>({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:({ownerState:t})=>!t.maxWidth,style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:e.breakpoints.unit==="px"?Math.max(e.breakpoints.values.xs,444):`max(${e.breakpoints.values.xs}${e.breakpoints.unit}, 444px)`,[`&.${aee.paperScrollBody}`]:{[e.breakpoints.down(Math.max(e.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(e.breakpoints.values).filter(t=>t!=="xs").map(t=>({props:{maxWidth:t},style:{maxWidth:`${e.breakpoints.values[t]}${e.breakpoints.unit}`,[`&.${aee.paperScrollBody}`]:{[e.breakpoints.down(e.breakpoints.values[t]+64)]:{maxWidth:"calc(100% - 64px)"}}}})),{props:({ownerState:t})=>t.fullWidth,style:{width:"calc(100% - 64px)"}},{props:({ownerState:t})=>t.fullScreen,style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${aee.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}))),yT=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiDialog"}),o=xf(),i={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{"aria-describedby":s,"aria-labelledby":l,"aria-modal":c=!0,BackdropComponent:u,BackdropProps:d,children:p,className:h,disableEscapeKeyDown:m=!1,fullScreen:g=!1,fullWidth:y=!1,maxWidth:x="sm",onClick:v,onClose:b,open:w,PaperComponent:S=ea,PaperProps:C={},scroll:N="paper",slots:j={},slotProps:I={},TransitionComponent:_=eU,transitionDuration:T=i,TransitionProps:P,...E}=r,M={...r,disableEscapeKeyDown:m,fullScreen:g,fullWidth:y,maxWidth:x,scroll:N},R=wvn(M),$=f.useRef(),D=ue=>{$.current=ue.target===ue.currentTarget},z=ue=>{v&&v(ue),$.current&&($.current=null,b&&b(ue,"backdropClick"))},V=Jo(l),B=f.useMemo(()=>({titleId:V}),[V]),G={transition:_,...j},H={transition:P,paper:C,backdrop:d,...I},F={slots:G,slotProps:H},[W,U]=mr("root",{elementType:Svn,shouldForwardComponentProp:!0,externalForwardedProps:F,ownerState:M,className:be(R.root,h),ref:n}),[K,X]=mr("backdrop",{elementType:bvn,shouldForwardComponentProp:!0,externalForwardedProps:F,ownerState:M,className:R.backdrop}),[J,te]=mr("paper",{elementType:Nvn,shouldForwardComponentProp:!0,externalForwardedProps:F,ownerState:M,className:be(R.paper,C.className)}),[re,ce]=mr("container",{elementType:Cvn,externalForwardedProps:F,ownerState:M,className:R.container}),[ae,oe]=mr("transition",{elementType:eU,externalForwardedProps:F,ownerState:M,additionalProps:{appear:!0,in:w,timeout:T,role:"presentation"}});return a.jsx(W,{closeAfterTransition:!0,slots:{backdrop:K},slotProps:{backdrop:{transitionDuration:T,as:u,...X}},disableEscapeKeyDown:m,onClose:b,open:w,onClick:z,...U,...E,children:a.jsx(ae,{...oe,children:a.jsx(re,{onMouseDown:D,...ce,children:a.jsx(J,{as:S,elevation:24,role:"dialog","aria-describedby":s,"aria-labelledby":V,"aria-modal":c,...te,children:a.jsx(ert.Provider,{value:B,children:p})})})})})});function jvn(e){return _r("MuiDialogActions",e)}Pr("MuiDialogActions",["root","spacing"]);const Evn=e=>{const{classes:t,disableSpacing:n}=e;return Un({root:["root",!n&&"spacing"]},jvn,t)},Ivn=Bt("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:e})=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),vT=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiDialogActions"}),{className:o,disableSpacing:i=!1,...s}=r,l={...r,disableSpacing:i},c=Evn(l);return a.jsx(Ivn,{className:be(c.root,o),ownerState:l,ref:n,...s})});function _vn(e){return _r("MuiDialogContent",e)}Pr("MuiDialogContent",["root","dividers"]);function Pvn(e){return _r("MuiDialogTitle",e)}const Avn=Pr("MuiDialogTitle",["root"]),Tvn=e=>{const{classes:t,dividers:n}=e;return Un({root:["root",n&&"dividers"]},_vn,t)},kvn=Bt("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.dividers&&t.dividers]}})(jr(({theme:e})=>({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:({ownerState:t})=>t.dividers,style:{padding:"16px 24px",borderTop:`1px solid ${(e.vars||e).palette.divider}`,borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>!t.dividers,style:{[`.${Avn.root} + &`]:{paddingTop:0}}}]}))),bT=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiDialogContent"}),{className:o,dividers:i=!1,...s}=r,l={...r,dividers:i},c=Tvn(l);return a.jsx(kvn,{className:be(c.root,o),ownerState:l,ref:n,...s})}),Mvn=e=>{const{classes:t}=e;return Un({root:["root"]},Pvn,t)},Rvn=Bt(tn,{name:"MuiDialogTitle",slot:"Root"})({padding:"16px 24px",flex:"0 0 auto"}),wT=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiDialogTitle"}),{className:o,id:i,...s}=r,l=r,c=Mvn(l),{titleId:u=i}=f.useContext(ert);return a.jsx(Rvn,{component:"h2",className:be(c.root,o),ownerState:l,ref:n,variant:"h6",id:i??u,...s})});function Ovn(e){return _r("MuiDivider",e)}const Ske=Pr("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),$vn=e=>{const{absolute:t,children:n,classes:r,flexItem:o,light:i,orientation:s,textAlign:l,variant:c}=e;return Un({root:["root",t&&"absolute",c,i&&"light",s==="vertical"&&"vertical",o&&"flexItem",n&&"withChildren",n&&s==="vertical"&&"withChildrenVertical",l==="right"&&s!=="vertical"&&"textAlignRight",l==="left"&&s!=="vertical"&&"textAlignLeft"],wrapper:["wrapper",s==="vertical"&&"wrapperVertical"]},Ovn,r)},Dvn=Bt("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.light&&t.light,n.orientation==="vertical"&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.children&&n.orientation==="vertical"&&t.withChildrenVertical,n.textAlign==="right"&&n.orientation!=="vertical"&&t.textAlignRight,n.textAlign==="left"&&n.orientation!=="vertical"&&t.textAlignLeft]}})(jr(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(e.vars||e).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:e.alpha((e.vars||e).palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:({ownerState:t})=>!!t.children,style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:({ownerState:t})=>t.children&&t.orientation!=="vertical",style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:"inherit"}}},{props:({ownerState:t})=>t.orientation==="vertical"&&t.children,style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:"inherit"}}},{props:({ownerState:t})=>t.textAlign==="right"&&t.orientation!=="vertical",style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:({ownerState:t})=>t.textAlign==="left"&&t.orientation!=="vertical",style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}))),Lvn=Bt("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.wrapper,n.orientation==="vertical"&&t.wrapperVertical]}})(jr(({theme:e})=>({display:"inline-block",paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),Sw=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiDivider"}),{absolute:o=!1,children:i,className:s,orientation:l="horizontal",component:c=i||l==="vertical"?"div":"hr",flexItem:u=!1,light:d=!1,role:p=c!=="hr"?"separator":void 0,textAlign:h="center",variant:m="fullWidth",...g}=r,y={...r,absolute:o,component:c,flexItem:u,light:d,orientation:l,role:p,textAlign:h,variant:m},x=$vn(y);return a.jsx(Dvn,{as:c,className:be(x.root,s),role:p,ref:n,ownerState:y,"aria-orientation":p==="separator"&&(c!=="hr"||l==="vertical")?l:void 0,...g,children:i?a.jsx(Lvn,{className:x.wrapper,ownerState:y,children:i}):null})});Sw&&(Sw.muiSkipListHighlight=!0);function Fvn(e,t,n){const r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),i=pg(t);let s;if(t.fakeTransform)s=t.fakeTransform;else{const u=i.getComputedStyle(t);s=u.getPropertyValue("-webkit-transform")||u.getPropertyValue("transform")}let l=0,c=0;if(s&&s!=="none"&&typeof s=="string"){const u=s.split("(")[1].split(")")[0].split(",");l=parseInt(u[4],10),c=parseInt(u[5],10)}return e==="left"?o?`translateX(${o.right+l-r.left}px)`:`translateX(${i.innerWidth+l-r.left}px)`:e==="right"?o?`translateX(-${r.right-o.left-l}px)`:`translateX(-${r.left+r.width-l}px)`:e==="up"?o?`translateY(${o.bottom+c-r.top}px)`:`translateY(${i.innerHeight+c-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-c}px)`:`translateY(-${r.top+r.height-c}px)`}function zvn(e){return typeof e=="function"?e():e}function CF(e,t,n){const r=zvn(n),o=Fvn(e,t,r);o&&(t.style.webkitTransform=o,t.style.transform=o)}const Bvn=f.forwardRef(function(t,n){const r=xf(),o={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:l=!0,children:c,container:u,direction:d="down",easing:p=o,in:h,onEnter:m,onEntered:g,onEntering:y,onExit:x,onExited:v,onExiting:b,style:w,timeout:S=i,TransitionComponent:C=Sm,...N}=t,j=f.useRef(null),I=Di(nN(c),j,n),_=V=>B=>{V&&(B===void 0?V(j.current):V(j.current,B))},T=_((V,B)=>{CF(d,V,u),bxe(V),m&&m(V,B)}),P=_((V,B)=>{const G=_C({timeout:S,style:w,easing:p},{mode:"enter"});V.style.webkitTransition=r.transitions.create("-webkit-transform",{...G}),V.style.transition=r.transitions.create("transform",{...G}),V.style.webkitTransform="none",V.style.transform="none",y&&y(V,B)}),E=_(g),M=_(b),R=_(V=>{const B=_C({timeout:S,style:w,easing:p},{mode:"exit"});V.style.webkitTransition=r.transitions.create("-webkit-transform",B),V.style.transition=r.transitions.create("transform",B),CF(d,V,u),x&&x(V)}),$=_(V=>{V.style.webkitTransition="",V.style.transition="",v&&v(V)}),D=V=>{s&&s(j.current,V)},z=f.useCallback(()=>{j.current&&CF(d,j.current,u)},[d,u]);return f.useEffect(()=>{if(h||d==="down"||d==="right")return;const V=py(()=>{j.current&&CF(d,j.current,u)}),B=pg(j.current);return B.addEventListener("resize",V),()=>{V.clear(),B.removeEventListener("resize",V)}},[d,h,u]),f.useEffect(()=>{h||z()},[h,z]),a.jsx(C,{nodeRef:j,onEnter:T,onEntered:E,onEntering:P,onExit:R,onExited:$,onExiting:M,addEndListener:D,appear:l,in:h,timeout:S,...N,children:(V,{ownerState:B,...G})=>f.cloneElement(c,{ref:I,style:{visibility:V==="exited"&&!h?"hidden":void 0,...w,...c.props.style},...G})})});function Hvn(e){return _r("MuiDrawer",e)}Pr("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const trt=(e,t)=>{const{ownerState:n}=e;return[t.root,(n.variant==="permanent"||n.variant==="persistent")&&t.docked,t.modal]},Vvn=e=>{const{classes:t,anchor:n,variant:r}=e,o={root:["root",`anchor${vn(n)}`],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${vn(n)}`,r!=="temporary"&&`paperAnchorDocked${vn(n)}`]};return Un(o,Hvn,t)},Uvn=Bt(Txe,{name:"MuiDrawer",slot:"Root",overridesResolver:trt})(jr(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),Wvn=Bt("div",{shouldForwardProp:_h,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:trt})({flex:"0 0 auto"}),Gvn=Bt(ea,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`paperAnchor${vn(n.anchor)}`],n.variant!=="temporary"&&t[`paperAnchorDocked${vn(n.anchor)}`]]}})(jr(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:t})=>t.anchor==="left"&&t.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="top"&&t.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="right"&&t.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="bottom"&&t.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),nrt={left:"right",right:"left",top:"down",bottom:"up"};function qvn(e){return["left","right"].includes(e)}function Kvn({direction:e},t){return e==="rtl"&&qvn(t)?nrt[t]:t}const kxe=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiDrawer"}),o=xf(),i=$d(),s={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{anchor:l="left",BackdropProps:c,children:u,className:d,elevation:p=16,hideBackdrop:h=!1,ModalProps:{BackdropProps:m,...g}={},onClose:y,open:x=!1,PaperProps:v={},SlideProps:b,TransitionComponent:w,transitionDuration:S=s,variant:C="temporary",slots:N={},slotProps:j={},...I}=r,_=f.useRef(!1);f.useEffect(()=>{_.current=!0},[]);const T=Kvn({direction:i?"rtl":"ltr"},l),E={...r,anchor:l,elevation:p,open:x,variant:C,...I},M=Vvn(E),R={slots:{transition:w,...N},slotProps:{paper:v,transition:b,...j,backdrop:gxe(j.backdrop||{...c,...m},{transitionDuration:S})}},[$,D]=mr("root",{ref:n,elementType:Uvn,className:be(M.root,M.modal,d),shouldForwardComponentProp:!0,ownerState:E,externalForwardedProps:{...R,...I,...g},additionalProps:{open:x,onClose:y,hideBackdrop:h,slots:{backdrop:R.slots.backdrop},slotProps:{backdrop:R.slotProps.backdrop}}}),[z,V]=mr("paper",{elementType:Gvn,shouldForwardComponentProp:!0,className:be(M.paper,v.className),ownerState:E,externalForwardedProps:R,additionalProps:{elevation:C==="temporary"?p:0,square:!0,...C==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[B,G]=mr("docked",{elementType:Wvn,ref:n,className:be(M.root,M.docked,d),ownerState:E,externalForwardedProps:R,additionalProps:I}),[H,F]=mr("transition",{elementType:Bvn,ownerState:E,externalForwardedProps:R,additionalProps:{in:x,direction:nrt[T],timeout:S,appear:_.current}}),W=a.jsx(z,{...V,children:u});if(C==="permanent")return a.jsx(B,{...G,children:W});const U=a.jsx(H,{...F,children:W});return C==="persistent"?a.jsx(B,{...G,children:U}):a.jsx($,{...D,children:U})}),Yvn=e=>{const{classes:t,disableUnderline:n,startAdornment:r,endAdornment:o,size:i,hiddenLabel:s,multiline:l}=e,c={root:["root",!n&&"underline",r&&"adornedStart",o&&"adornedEnd",i==="small"&&`size${vn(i)}`,s&&"hiddenLabel",l&&"multiline"],input:["input"]},u=Un(c,Mxn,t);return{...t,...u}},Xvn=Bt(uK,{shouldForwardProp:e=>_h(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...lK(e,t),!n.disableUnderline&&t.underline]}})(jr(({theme:e})=>{const t=e.palette.mode==="light",n=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",r=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r}},[`&.${qm.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:r},[`&.${qm.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[{props:({ownerState:s})=>!s.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${qm.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${qm.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${qm.disabled}, .${qm.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${qm.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(ul()).map(([s])=>{var l;return{props:{disableUnderline:!1,color:s},style:{"&::after":{borderBottom:`2px solid ${(l=(e.vars||e).palette[s])==null?void 0:l.main}`}}}}),{props:({ownerState:s})=>s.startAdornment,style:{paddingLeft:12}},{props:({ownerState:s})=>s.endAdornment,style:{paddingRight:12}},{props:({ownerState:s})=>s.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:s,size:l})=>s.multiline&&l==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:s})=>s.multiline&&s.hiddenLabel&&s.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),Qvn=Bt(dK,{name:"MuiFilledInput",slot:"Input",overridesResolver:cK})(jr(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),Mxe=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiFilledInput"}),{disableUnderline:o=!1,components:i={},componentsProps:s,fullWidth:l=!1,hiddenLabel:c,inputComponent:u="input",multiline:d=!1,slotProps:p,slots:h={},type:m="text",...g}=r,y={...r,disableUnderline:o,fullWidth:l,inputComponent:u,multiline:d,type:m},x=Yvn(r),v={root:{ownerState:y},input:{ownerState:y}},b=p??s?hf(v,p??s):v,w=h.root??i.Root??Xvn,S=h.input??i.Input??Qvn;return a.jsx(HL,{slots:{root:w,input:S},slotProps:b,fullWidth:l,inputComponent:u,multiline:d,ref:n,type:m,...g,classes:x})});Mxe.muiName="Input";function Jvn(e){return _r("MuiFormControl",e)}Pr("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Zvn=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${vn(n)}`,r&&"fullWidth"]};return Un(o,Jvn,t)},ebn=Bt("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${vn(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),k1=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiFormControl"}),{children:o,className:i,color:s="primary",component:l="div",disabled:c=!1,error:u=!1,focused:d,fullWidth:p=!1,hiddenLabel:h=!1,margin:m="none",required:g=!1,size:y="medium",variant:x="outlined",...v}=r,b={...r,color:s,component:l,disabled:c,error:u,fullWidth:p,hiddenLabel:h,margin:m,required:g,size:y,variant:x},w=Zvn(b),[S,C]=f.useState(()=>{let $=!1;return o&&f.Children.forEach(o,D=>{if(!oO(D,["Input","Select"]))return;const z=oO(D,["Select"])?D.props.input:D;z&&_xn(z.props)&&($=!0)}),$}),[N,j]=f.useState(()=>{let $=!1;return o&&f.Children.forEach(o,D=>{oO(D,["Input","Select"])&&(ZV(D.props,!0)||ZV(D.props.inputProps,!0))&&($=!0)}),$}),[I,_]=f.useState(!1);c&&I&&_(!1);const T=d!==void 0&&!c?d:I;let P;f.useRef(!1);const E=f.useCallback(()=>{j(!0)},[]),M=f.useCallback(()=>{j(!1)},[]),R=f.useMemo(()=>({adornedStart:S,setAdornedStart:C,color:s,disabled:c,error:u,filled:N,focused:T,fullWidth:p,hiddenLabel:h,size:y,onBlur:()=>{_(!1)},onFocus:()=>{_(!0)},onEmpty:M,onFilled:E,registerEffect:P,required:g,variant:x}),[S,s,c,u,N,T,p,h,P,M,E,g,y,x]);return a.jsx(sK.Provider,{value:R,children:a.jsx(ebn,{as:l,ownerState:b,className:be(w.root,i),ref:n,...v,children:o})})});function tbn(e){return _r("MuiFormControlLabel",e)}const EP=Pr("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),nbn=e=>{const{classes:t,disabled:n,labelPlacement:r,error:o,required:i}=e,s={root:["root",n&&"disabled",`labelPlacement${vn(r)}`,o&&"error",i&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",o&&"error"]};return Un(s,tbn,t)},rbn=Bt("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${EP.label}`]:t.label},t.root,t[`labelPlacement${vn(n.labelPlacement)}`]]}})(jr(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${EP.disabled}`]:{cursor:"default"},[`& .${EP.label}`]:{[`&.${EP.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),obn=Bt("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(jr(({theme:e})=>({[`&.${EP.error}`]:{color:(e.vars||e).palette.error.main}}))),rrt=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiFormControlLabel"}),{checked:o,className:i,componentsProps:s={},control:l,disabled:c,disableTypography:u,inputRef:d,label:p,labelPlacement:h="end",name:m,onChange:g,required:y,slots:x={},slotProps:v={},value:b,...w}=r,S=qw(),C=c??l.props.disabled??(S==null?void 0:S.disabled),N=y??l.props.required,j={disabled:C,required:N};["checked","name","onChange","value","inputRef"].forEach($=>{typeof l.props[$]>"u"&&typeof r[$]<"u"&&(j[$]=r[$])});const I=i5({props:r,muiFormControl:S,states:["error"]}),_={...r,disabled:C,labelPlacement:h,required:N,error:I.error},T=nbn(_),P={slots:x,slotProps:{...s,...v}},[E,M]=mr("typography",{elementType:tn,externalForwardedProps:P,ownerState:_});let R=p;return R!=null&&R.type!==tn&&!u&&(R=a.jsx(E,{component:"span",...M,className:be(T.label,M==null?void 0:M.className),children:R})),a.jsxs(rbn,{className:be(T.root,i),ownerState:_,ref:n,...w,children:[f.cloneElement(l,j),N?a.jsxs("div",{children:[R,a.jsxs(obn,{ownerState:_,"aria-hidden":!0,className:T.asterisk,children:[" ","*"]})]}):R]})});function ibn(e){return _r("MuiFormHelperText",e)}const Cke=Pr("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Nke;const abn=e=>{const{classes:t,contained:n,size:r,disabled:o,error:i,filled:s,focused:l,required:c}=e,u={root:["root",o&&"disabled",i&&"error",r&&`size${vn(r)}`,n&&"contained",l&&"focused",s&&"filled",c&&"required"]};return Un(u,ibn,t)},sbn=Bt("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${vn(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(jr(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Cke.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${Cke.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),lbn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiFormHelperText"}),{children:o,className:i,component:s="p",disabled:l,error:c,filled:u,focused:d,margin:p,required:h,variant:m,...g}=r,y=qw(),x=i5({props:r,muiFormControl:y,states:["variant","size","disabled","error","filled","focused","required"]}),v={...r,component:s,contained:x.variant==="filled"||x.variant==="outlined",variant:x.variant,size:x.size,disabled:x.disabled,error:x.error,filled:x.filled,focused:x.focused,required:x.required};delete v.ownerState;const b=abn(v);return a.jsx(sbn,{as:s,className:be(b.root,i),ref:n,...g,ownerState:v,children:o===" "?Nke||(Nke=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):o})});function cbn(e){return _r("MuiFormLabel",e)}const hO=Pr("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),ubn=e=>{const{classes:t,color:n,focused:r,disabled:o,error:i,filled:s,required:l}=e,c={root:["root",`color${vn(n)}`,o&&"disabled",i&&"error",s&&"filled",r&&"focused",l&&"required"],asterisk:["asterisk",i&&"error"]};return Un(c,cbn,t)},dbn=Bt("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color==="secondary"&&t.colorSecondary,n.filled&&t.filled]}})(jr(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(ul()).map(([t])=>({props:{color:t},style:{[`&.${hO.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${hO.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${hO.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),fbn=Bt("span",{name:"MuiFormLabel",slot:"Asterisk"})(jr(({theme:e})=>({[`&.${hO.error}`]:{color:(e.vars||e).palette.error.main}}))),pbn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiFormLabel"}),{children:o,className:i,color:s,component:l="label",disabled:c,error:u,filled:d,focused:p,required:h,...m}=r,g=qw(),y=i5({props:r,muiFormControl:g,states:["color","required","focused","disabled","error","filled"]}),x={...r,color:y.color||"primary",component:l,disabled:y.disabled,error:y.error,filled:y.filled,focused:y.focused,required:y.required},v=ubn(x);return a.jsxs(dbn,{as:l,ownerState:x,className:be(v.root,i),ref:n,...m,children:[o,y.required&&a.jsxs(fbn,{ownerState:x,"aria-hidden":!0,className:v.asterisk,children:[" ","*"]})]})}),br=cRt({createStyledComponent:Bt("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.container&&t.container]}}),componentName:"MuiGrid",useThemeProps:e=>Rr({props:e,name:"MuiGrid"}),useTheme:xf});function pse(e){return`scale(${e}, ${e**2})`}const hbn={entering:{opacity:1,transform:pse(1)},entered:{opacity:1,transform:"none"}},see=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),ST=f.forwardRef(function(t,n){const{addEndListener:r,appear:o=!0,children:i,easing:s,in:l,onEnter:c,onEntered:u,onEntering:d,onExit:p,onExited:h,onExiting:m,style:g,timeout:y="auto",TransitionComponent:x=Sm,...v}=t,b=hh(),w=f.useRef(),S=xf(),C=f.useRef(null),N=Di(C,nN(i),n),j=$=>D=>{if($){const z=C.current;D===void 0?$(z):$(z,D)}},I=j(d),_=j(($,D)=>{bxe($);const{duration:z,delay:V,easing:B}=_C({style:g,timeout:y,easing:s},{mode:"enter"});let G;y==="auto"?(G=S.transitions.getAutoHeightDuration($.clientHeight),w.current=G):G=z,$.style.transition=[S.transitions.create("opacity",{duration:G,delay:V}),S.transitions.create("transform",{duration:see?G:G*.666,delay:V,easing:B})].join(","),c&&c($,D)}),T=j(u),P=j(m),E=j($=>{const{duration:D,delay:z,easing:V}=_C({style:g,timeout:y,easing:s},{mode:"exit"});let B;y==="auto"?(B=S.transitions.getAutoHeightDuration($.clientHeight),w.current=B):B=D,$.style.transition=[S.transitions.create("opacity",{duration:B,delay:z}),S.transitions.create("transform",{duration:see?B:B*.666,delay:see?z:z||B*.333,easing:V})].join(","),$.style.opacity=0,$.style.transform=pse(.75),p&&p($)}),M=j(h),R=$=>{y==="auto"&&b.start(w.current||0,$),r&&r(C.current,$)};return a.jsx(x,{appear:o,in:l,nodeRef:C,onEnter:_,onEntered:T,onEntering:I,onExit:E,onExited:M,onExiting:P,addEndListener:R,timeout:y==="auto"?null:y,...v,children:($,{ownerState:D,...z})=>f.cloneElement(i,{style:{opacity:0,transform:pse(.75),visibility:$==="exited"&&!l?"hidden":void 0,...hbn[$],...g,...i.props.style},ref:N,...z})})});ST&&(ST.muiSupportAuto=!0);const mbn=e=>{const{classes:t,disableUnderline:n}=e,o=Un({root:["root",!n&&"underline"],input:["input"]},Txn,t);return{...t,...o}},gbn=Bt(uK,{shouldForwardProp:e=>_h(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...lK(e,t),!n.disableUnderline&&t.underline]}})(jr(({theme:e})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:r})=>r.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:r})=>!r.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${g2.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${g2.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${g2.disabled}, .${g2.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${g2.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(ul()).map(([r])=>({props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[r].main}`}}}))]}})),xbn=Bt(dK,{name:"MuiInput",slot:"Input",overridesResolver:cK})({}),Rxe=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiInput"}),{disableUnderline:o=!1,components:i={},componentsProps:s,fullWidth:l=!1,inputComponent:c="input",multiline:u=!1,slotProps:d,slots:p={},type:h="text",...m}=r,g=mbn(r),x={root:{ownerState:{disableUnderline:o}}},v=d??s?hf(d??s,x):x,b=p.root??i.Root??gbn,w=p.input??i.Input??xbn;return a.jsx(HL,{slots:{root:b,input:w},slotProps:v,fullWidth:l,inputComponent:c,multiline:u,ref:n,type:h,...m,classes:g})});Rxe.muiName="Input";function ybn(e){return _r("MuiInputAdornment",e)}const hse=Pr("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var jke;const vbn=(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${vn(n.position)}`],n.disablePointerEvents===!0&&t.disablePointerEvents,t[n.variant]]},bbn=e=>{const{classes:t,disablePointerEvents:n,hiddenLabel:r,position:o,size:i,variant:s}=e,l={root:["root",n&&"disablePointerEvents",o&&`position${vn(o)}`,s,r&&"hiddenLabel",i&&`size${vn(i)}`]};return Un(l,ybn,t)},wbn=Bt("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:vbn})(jr(({theme:e})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(e.vars||e).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${hse.positionStart}&:not(.${hse.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),mse=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiInputAdornment"}),{children:o,className:i,component:s="div",disablePointerEvents:l=!1,disableTypography:c=!1,position:u,variant:d,...p}=r,h=qw()||{};let m=d;d&&h.variant,h&&!m&&(m=h.variant);const g={...r,hiddenLabel:h.hiddenLabel,size:h.size,disablePointerEvents:l,position:u,variant:m},y=bbn(g);return a.jsx(sK.Provider,{value:null,children:a.jsx(wbn,{as:s,ownerState:g,className:be(y.root,i),ref:n,...p,children:typeof o=="string"&&!c?a.jsx(tn,{color:"textSecondary",children:o}):a.jsxs(f.Fragment,{children:[u==="start"?jke||(jke=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):null,o]})})})});function Sbn(e){return _r("MuiInputLabel",e)}Pr("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Cbn=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:i,variant:s,required:l}=e,c={root:["root",n&&"formControl",!i&&"animated",o&&"shrink",r&&r!=="medium"&&`size${vn(r)}`,s],asterisk:[l&&"asterisk"]},u=Un(c,Sbn,t);return{...t,...u}},Nbn=Bt(pbn,{shouldForwardProp:e=>_h(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${hO.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(jr(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="filled"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:n,size:r})=>t==="filled"&&n.shrink&&r==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:n})=>t==="outlined"&&n.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),O2=f.forwardRef(function(t,n){const r=Rr({name:"MuiInputLabel",props:t}),{disableAnimation:o=!1,margin:i,shrink:s,variant:l,className:c,...u}=r,d=qw();let p=s;typeof p>"u"&&d&&(p=d.filled||d.focused||d.adornedStart);const h=i5({props:r,muiFormControl:d,states:["size","variant","required","focused"]}),m={...r,disableAnimation:o,formControl:d,shrink:p,size:h.size,variant:h.variant,required:h.required,focused:h.focused},g=Cbn(m);return a.jsx(Nbn,{"data-shrink":p,ref:n,className:be(g.root,c),...u,ownerState:m,classes:g})});function jbn(e){return _r("MuiLinearProgress",e)}Pr("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const gse=4,xse=gf` 0% { left: -35%; right: 100%; } 60% { left: 100%; right: -90%; } 100% { left: 100%; right: -90%; } `,Ebn=typeof xse!="string"?jb` animation: ${xse} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; `:null,yse=gf` 0% { left: -200%; right: 100%; } 60% { left: 107%; right: -8%; } 100% { left: 107%; right: -8%; } `,Ibn=typeof yse!="string"?jb` animation: ${yse} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; `:null,vse=gf` 0% { opacity: 1; background-position: 0 -23px; } 60% { opacity: 0; background-position: 0 -23px; } 100% { opacity: 1; background-position: -200px -23px; } `,_bn=typeof vse!="string"?jb` animation: ${vse} 3s infinite linear; `:null,Pbn=e=>{const{classes:t,variant:n,color:r}=e,o={root:["root",`color${vn(r)}`,n],dashed:["dashed",`dashedColor${vn(r)}`],bar1:["bar","bar1",`barColor${vn(r)}`,(n==="indeterminate"||n==="query")&&"bar1Indeterminate",n==="determinate"&&"bar1Determinate",n==="buffer"&&"bar1Buffer"],bar2:["bar","bar2",n!=="buffer"&&`barColor${vn(r)}`,n==="buffer"&&`color${vn(r)}`,(n==="indeterminate"||n==="query")&&"bar2Indeterminate",n==="buffer"&&"bar2Buffer"]};return Un(o,jbn,t)},Oxe=(e,t)=>e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode==="light"?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.5),Abn=Bt("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${vn(n.color)}`],t[n.variant]]}})(jr(({theme:e})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(e.palette).filter(ul()).map(([t])=>({props:{color:t},style:{backgroundColor:Oxe(e,t)}})),{props:({ownerState:t})=>t.color==="inherit"&&t.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),Tbn=Bt("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.dashed,t[`dashedColor${vn(n.color)}`]]}})(jr(({theme:e})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(e.palette).filter(ul()).map(([t])=>{const n=Oxe(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${n} 0%, ${n} 16%, transparent 42%)`}}})]})),_bn||{animation:`${vse} 3s infinite linear`}),kbn=Bt("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t.bar1,t[`barColor${vn(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&t.bar1Indeterminate,n.variant==="determinate"&&t.bar1Determinate,n.variant==="buffer"&&t.bar1Buffer]}})(jr(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(e.palette).filter(ul()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:"determinate"},style:{transition:`transform .${gse}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${gse}s linear`}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:Ebn||{animation:`${xse} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),Mbn=Bt("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.bar,t.bar2,t[`barColor${vn(n.color)}`],(n.variant==="indeterminate"||n.variant==="query")&&t.bar2Indeterminate,n.variant==="buffer"&&t.bar2Buffer]}})(jr(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(e.palette).filter(ul()).map(([t])=>({props:{color:t},style:{"--LinearProgressBar2-barColor":(e.vars||e).palette[t].main}})),{props:({ownerState:t})=>t.variant!=="buffer"&&t.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:t})=>t.variant!=="buffer"&&t.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(e.palette).filter(ul()).map(([t])=>({props:{color:t,variant:"buffer"},style:{backgroundColor:Oxe(e,t),transition:`transform .${gse}s linear`}})),{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:Ibn||{animation:`${yse} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),a5=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiLinearProgress"}),{className:o,color:i="primary",value:s,valueBuffer:l,variant:c="indeterminate",...u}=r,d={...r,color:i,variant:c},p=Pbn(d),h=$d(),m={},g={bar1:{},bar2:{}};if((c==="determinate"||c==="buffer")&&s!==void 0){m["aria-valuenow"]=Math.round(s),m["aria-valuemin"]=0,m["aria-valuemax"]=100;let y=s-100;h&&(y=-y),g.bar1.transform=`translateX(${y}%)`}if(c==="buffer"&&l!==void 0){let y=(l||0)-100;h&&(y=-y),g.bar2.transform=`translateX(${y}%)`}return a.jsxs(Abn,{className:be(p.root,o),ownerState:d,role:"progressbar",...m,ref:n,...u,children:[c==="buffer"?a.jsx(Tbn,{className:p.dashed,ownerState:d}):null,a.jsx(kbn,{className:p.bar1,ownerState:d,style:g.bar1}),c==="determinate"?null:a.jsx(Mbn,{className:p.bar2,ownerState:d,style:g.bar2})]})});function Rbn(e){return _r("MuiLink",e)}const Obn=Pr("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),$bn=({theme:e,ownerState:t})=>{const n=t.color;if("colorSpace"in e&&e.colorSpace){const i=vv(e,`palette.${n}.main`)||vv(e,`palette.${n}`)||t.color;return e.alpha(i,.4)}const r=vv(e,`palette.${n}.main`,!1)||vv(e,`palette.${n}`,!1)||t.color,o=vv(e,`palette.${n}.mainChannel`)||vv(e,`palette.${n}Channel`);return"vars"in e&&o?`rgba(${o} / 0.4)`:Na(r,.4)},Eke={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Dbn=e=>{const{classes:t,component:n,focusVisible:r,underline:o}=e,i={root:["root",`underline${vn(o)}`,n==="button"&&"button",r&&"focusVisible"]};return Un(i,Rbn,t)},Lbn=Bt(tn,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`underline${vn(n.underline)}`],n.component==="button"&&t.button]}})(jr(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:t,ownerState:n})=>t==="always"&&n.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:t,ownerState:n})=>t==="always"&&n.color==="inherit",style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter(ul()).map(([t])=>({props:{underline:"always",color:t},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[t].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Obn.focusVisible}`]:{outline:"auto"}}}]}))),NF=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiLink"}),o=xf(),{className:i,color:s="primary",component:l="a",onBlur:c,onFocus:u,TypographyClasses:d,underline:p="always",variant:h="inherit",sx:m,...g}=r,[y,x]=f.useState(!1),v=C=>{fT(C.target)||x(!1),c&&c(C)},b=C=>{fT(C.target)&&x(!0),u&&u(C)},w={...r,color:s,component:l,focusVisible:y,underline:p,variant:h},S=Dbn(w);return a.jsx(Lbn,{color:s,className:be(S.root,i),classes:d,component:l,onBlur:v,onFocus:b,ref:n,ownerState:w,variant:h,...g,sx:[...Eke[s]===void 0?[{color:s}]:[],...Array.isArray(m)?m:[m]],style:{...g.style,...p==="always"&&s!=="inherit"&&!Eke[s]&&{"--Link-underlineColor":$bn({theme:o,ownerState:w})}}})}),J1=f.createContext({});function Fbn(e){return _r("MuiList",e)}Pr("MuiList",["root","padding","dense","subheader"]);const zbn=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return Un({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},Fbn,t)},Bbn=Bt("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),Mv=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiList"}),{children:o,className:i,component:s="ul",dense:l=!1,disablePadding:c=!1,subheader:u,...d}=r,p=f.useMemo(()=>({dense:l}),[l]),h={...r,component:s,dense:l,disablePadding:c},m=zbn(h);return a.jsx(J1.Provider,{value:p,children:a.jsxs(Bbn,{as:s,className:be(m.root,i),ref:n,ownerState:h,...d,children:[u,o]})})});function Hbn(e){return _r("MuiListItem",e)}Pr("MuiListItem",["root","container","dense","alignItemsFlexStart","divider","gutters","padding","secondaryAction"]);const Vbn=Pr("MuiListItemButton",["root","focusVisible","dense","alignItemsFlexStart","disabled","divider","gutters","selected"]);function Ubn(e){return _r("MuiListItemSecondaryAction",e)}Pr("MuiListItemSecondaryAction",["root","disableGutters"]);const Wbn=e=>{const{disableGutters:t,classes:n}=e;return Un({root:["root",t&&"disableGutters"]},Ubn,n)},Gbn=Bt("div",{name:"MuiListItemSecondaryAction",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.disableGutters&&t.disableGutters]}})({position:"absolute",right:16,top:"50%",transform:"translateY(-50%)",variants:[{props:({ownerState:e})=>e.disableGutters,style:{right:0}}]}),ort=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiListItemSecondaryAction"}),{className:o,...i}=r,s=f.useContext(J1),l={...r,disableGutters:s.disableGutters},c=Wbn(l);return a.jsx(Gbn,{className:be(c.root,o),ownerState:l,ref:n,...i})});ort.muiName="ListItemSecondaryAction";const qbn=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.alignItems==="flex-start"&&t.alignItemsFlexStart,n.divider&&t.divider,!n.disableGutters&&t.gutters,!n.disablePadding&&t.padding,n.hasSecondaryAction&&t.secondaryAction]},Kbn=e=>{const{alignItems:t,classes:n,dense:r,disableGutters:o,disablePadding:i,divider:s,hasSecondaryAction:l}=e;return Un({root:["root",r&&"dense",!o&&"gutters",!i&&"padding",s&&"divider",t==="flex-start"&&"alignItemsFlexStart",l&&"secondaryAction"],container:["container"],secondaryAction:["secondaryAction"]},Hbn,n)},Ybn=Bt("div",{name:"MuiListItem",slot:"Root",overridesResolver:qbn})(jr(({theme:e})=>({display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",width:"100%",boxSizing:"border-box",textAlign:"left",variants:[{props:({ownerState:t})=>!t.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:t})=>!t.disablePadding&&t.dense,style:{paddingTop:4,paddingBottom:4}},{props:({ownerState:t})=>!t.disablePadding&&!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>!t.disablePadding&&!!t.secondaryAction,style:{paddingRight:48}},{props:({ownerState:t})=>!!t.secondaryAction,style:{[`& > .${Vbn.root}`]:{paddingRight:48}}},{props:{alignItems:"flex-start"},style:{alignItems:"flex-start"}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>t.button,style:{transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}}}},{props:({ownerState:t})=>t.hasSecondaryAction,style:{paddingRight:48}}]}))),Xbn=Bt("li",{name:"MuiListItem",slot:"Container"})({position:"relative"}),ih=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiListItem"}),{alignItems:o="center",children:i,className:s,component:l,components:c={},componentsProps:u={},ContainerComponent:d="li",ContainerProps:{className:p,...h}={},dense:m=!1,disableGutters:g=!1,disablePadding:y=!1,divider:x=!1,secondaryAction:v,slotProps:b={},slots:w={},...S}=r,C=f.useContext(J1),N=f.useMemo(()=>({dense:m||C.dense||!1,alignItems:o,disableGutters:g}),[o,C.dense,m,g]),j=f.useRef(null),I=f.Children.toArray(i),_=I.length&&oO(I[I.length-1],["ListItemSecondaryAction"]),T={...r,alignItems:o,dense:N.dense,disableGutters:g,disablePadding:y,divider:x,hasSecondaryAction:_},P=Kbn(T),E=Di(j,n),M={slots:w,slotProps:b},[R,$]=mr("secondaryAction",{elementType:ort,externalForwardedProps:M,ownerState:T,className:P.secondaryAction}),D=w.root||c.Root||Ybn,z=b.root||u.root||{},V={className:be(P.root,z.className,s),...S};let B=l||"li";return _?(B=!V.component&&!l?"div":B,d==="li"&&(B==="li"?B="div":V.component==="li"&&(V.component="div")),a.jsx(J1.Provider,{value:N,children:a.jsxs(Xbn,{as:d,className:be(P.container,p),ref:E,ownerState:T,...h,children:[a.jsx(D,{...z,...!dT(D)&&{as:B,ownerState:{...T,...z.ownerState}},...V,children:I}),I.pop()]})})):a.jsx(J1.Provider,{value:N,children:a.jsxs(D,{...z,as:B,ref:E,...!dT(D)&&{ownerState:{...T,...z.ownerState}},...V,children:[I,v&&a.jsx(R,{...$,children:v})]})})});function Qbn(e){return _r("MuiListItemIcon",e)}const Ike=Pr("MuiListItemIcon",["root","alignItemsFlexStart"]),Jbn=e=>{const{alignItems:t,classes:n}=e;return Un({root:["root",t==="flex-start"&&"alignItemsFlexStart"]},Qbn,n)},Zbn=Bt("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.alignItems==="flex-start"&&t.alignItemsFlexStart]}})(jr(({theme:e})=>({minWidth:56,color:(e.vars||e).palette.action.active,flexShrink:0,display:"inline-flex",variants:[{props:{alignItems:"flex-start"},style:{marginTop:8}}]}))),bse=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiListItemIcon"}),{className:o,...i}=r,s=f.useContext(J1),l={...r,alignItems:s.alignItems},c=Jbn(l);return a.jsx(Zbn,{className:be(c.root,o),ownerState:l,ref:n,...i})});function e1n(e){return _r("MuiListItemText",e)}const tE=Pr("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),t1n=e=>{const{classes:t,inset:n,primary:r,secondary:o,dense:i}=e;return Un({root:["root",n&&"inset",i&&"dense",r&&o&&"multiline"],primary:["primary"],secondary:["secondary"]},e1n,t)},n1n=Bt("div",{name:"MuiListItemText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${tE.primary}`]:t.primary},{[`& .${tE.secondary}`]:t.secondary},t.root,n.inset&&t.inset,n.primary&&n.secondary&&t.multiline,n.dense&&t.dense]}})({flex:"1 1 auto",minWidth:0,marginTop:4,marginBottom:4,[`.${QV.root}:where(& .${tE.primary})`]:{display:"block"},[`.${QV.root}:where(& .${tE.secondary})`]:{display:"block"},variants:[{props:({ownerState:e})=>e.primary&&e.secondary,style:{marginTop:6,marginBottom:6}},{props:({ownerState:e})=>e.inset,style:{paddingLeft:56}}]}),ah=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiListItemText"}),{children:o,className:i,disableTypography:s=!1,inset:l=!1,primary:c,primaryTypographyProps:u,secondary:d,secondaryTypographyProps:p,slots:h={},slotProps:m={},...g}=r,{dense:y}=f.useContext(J1);let x=c??o,v=d;const b={...r,disableTypography:s,inset:l,primary:!!x,secondary:!!v,dense:y},w=t1n(b),S={slots:h,slotProps:{primary:u,secondary:p,...m}},[C,N]=mr("root",{className:be(w.root,i),elementType:n1n,externalForwardedProps:{...S,...g},ownerState:b,ref:n}),[j,I]=mr("primary",{className:w.primary,elementType:tn,externalForwardedProps:S,ownerState:b}),[_,T]=mr("secondary",{className:w.secondary,elementType:tn,externalForwardedProps:S,ownerState:b});return x!=null&&x.type!==tn&&!s&&(x=a.jsx(j,{variant:y?"body2":"body1",component:I!=null&&I.variant?void 0:"span",...I,children:x})),v!=null&&v.type!==tn&&!s&&(v=a.jsx(_,{variant:"body2",color:"textSecondary",...T,children:v})),a.jsxs(C,{...N,children:[x,v]})});function lee(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function _ke(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function irt(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.startsWith(t.keys.join(""))}function cM(e,t,n,r,o,i){let s=!1,l=o(e,t,t?n:!1);for(;l;){if(l===e.firstChild){if(s)return!1;s=!0}const c=r?!1:l.disabled||l.getAttribute("aria-disabled")==="true";if(!l.hasAttribute("tabindex")||!irt(l,i)||c)l=o(e,l,n);else return l.focus(),!0}return!1}const art=f.forwardRef(function(t,n){const{actions:r,autoFocus:o=!1,autoFocusItem:i=!1,children:s,className:l,disabledItemsFocusable:c=!1,disableListWrap:u=!1,onKeyDown:d,variant:p="selectedMenu",...h}=t,m=f.useRef(null),g=f.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Ia(()=>{o&&m.current.focus()},[o]),f.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(w,{direction:S})=>{const C=!m.current.style.width;if(w.clientHeight{const S=m.current,C=w.key;if(w.ctrlKey||w.metaKey||w.altKey){d&&d(w);return}const j=jP(Zl(S));if(C==="ArrowDown")w.preventDefault(),cM(S,j,u,c,lee);else if(C==="ArrowUp")w.preventDefault(),cM(S,j,u,c,_ke);else if(C==="Home")w.preventDefault(),cM(S,null,u,c,lee);else if(C==="End")w.preventDefault(),cM(S,null,u,c,_ke);else if(C.length===1){const I=g.current,_=C.toLowerCase(),T=performance.now();I.keys.length>0&&(T-I.lastTime>500?(I.keys=[],I.repeating=!0,I.previousKeyMatched=!0):I.repeating&&_!==I.keys[0]&&(I.repeating=!1)),I.lastTime=T,I.keys.push(_);const P=j&&!I.repeating&&irt(j,I);I.previousKeyMatched&&(P||cM(S,j,!1,c,lee,I))?w.preventDefault():I.previousKeyMatched=!1}d&&d(w)},x=Di(m,n);let v=-1;f.Children.forEach(s,(w,S)=>{if(!f.isValidElement(w)){v===S&&(v+=1,v>=s.length&&(v=-1));return}w.props.disabled||(p==="selectedMenu"&&w.props.selected||v===-1)&&(v=S),v===S&&(w.props.disabled||w.props.muiSkipListHighlight||w.type.muiSkipListHighlight)&&(v+=1,v>=s.length&&(v=-1))});const b=f.Children.map(s,(w,S)=>{if(S===v){const C={};return i&&(C.autoFocus=!0),w.props.tabIndex===void 0&&p==="selectedMenu"&&(C.tabIndex=0),f.cloneElement(w,C)}return w});return a.jsx(Mv,{role:"menu",ref:x,className:l,onKeyDown:y,tabIndex:o?0:-1,...h,children:b})});function r1n(e){return _r("MuiPopover",e)}Pr("MuiPopover",["root","paper"]);function Pke(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function Ake(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function Tke(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function jF(e){return typeof e=="function"?e():e}const o1n=e=>{const{classes:t}=e;return Un({root:["root"],paper:["paper"]},r1n,t)},i1n=Bt(Txe,{name:"MuiPopover",slot:"Root"})({}),srt=Bt(ea,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),a1n=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiPopover"}),{action:o,anchorEl:i,anchorOrigin:s={vertical:"top",horizontal:"left"},anchorPosition:l,anchorReference:c="anchorEl",children:u,className:d,container:p,elevation:h=8,marginThreshold:m=16,open:g,PaperProps:y={},slots:x={},slotProps:v={},transformOrigin:b={vertical:"top",horizontal:"left"},TransitionComponent:w,transitionDuration:S="auto",TransitionProps:C={},disableScrollLock:N=!1,...j}=r,I=f.useRef(),_={...r,anchorOrigin:s,anchorReference:c,elevation:h,marginThreshold:m,transformOrigin:b,TransitionComponent:w,transitionDuration:S,TransitionProps:C},T=o1n(_),P=f.useCallback(()=>{if(c==="anchorPosition")return l;const ce=jF(i),oe=(ce&&ce.nodeType===1?ce:Zl(I.current).body).getBoundingClientRect();return{top:oe.top+Pke(oe,s.vertical),left:oe.left+Ake(oe,s.horizontal)}},[i,s.horizontal,s.vertical,l,c]),E=f.useCallback(ce=>({vertical:Pke(ce,b.vertical),horizontal:Ake(ce,b.horizontal)}),[b.horizontal,b.vertical]),M=f.useCallback(ce=>{const ae={width:ce.offsetWidth,height:ce.offsetHeight},oe=E(ae);if(c==="none")return{top:null,left:null,transformOrigin:Tke(oe)};const ue=P();let fe=ue.top-oe.vertical,se=ue.left-oe.horizontal;const ge=fe+ae.height,ye=se+ae.width,de=pg(jF(i)),Ne=de.innerHeight-m,_e=de.innerWidth-m;if(m!==null&&feNe){const xe=ge-Ne;fe-=xe,oe.vertical+=xe}if(m!==null&&se_e){const xe=ye-_e;se-=xe,oe.horizontal+=xe}return{top:`${Math.round(fe)}px`,left:`${Math.round(se)}px`,transformOrigin:Tke(oe)}},[i,c,P,E,m]),[R,$]=f.useState(g),D=f.useCallback(()=>{const ce=I.current;if(!ce)return;const ae=M(ce);ae.top!==null&&ce.style.setProperty("top",ae.top),ae.left!==null&&(ce.style.left=ae.left),ce.style.transformOrigin=ae.transformOrigin,$(!0)},[M]);f.useEffect(()=>(N&&window.addEventListener("scroll",D),()=>window.removeEventListener("scroll",D)),[i,N,D]);const z=()=>{D()},V=()=>{$(!1)};f.useEffect(()=>{g&&D()}),f.useImperativeHandle(o,()=>g?{updatePosition:()=>{D()}}:null,[g,D]),f.useEffect(()=>{if(!g)return;const ce=py(()=>{D()}),ae=pg(jF(i));return ae.addEventListener("resize",ce),()=>{ce.clear(),ae.removeEventListener("resize",ce)}},[i,g,D]);let B=S;const G={slots:{transition:w,...x},slotProps:{transition:C,paper:y,...v}},[H,F]=mr("transition",{elementType:ST,externalForwardedProps:G,ownerState:_,getSlotProps:ce=>({...ce,onEntering:(ae,oe)=>{var ue;(ue=ce.onEntering)==null||ue.call(ce,ae,oe),z()},onExited:ae=>{var oe;(oe=ce.onExited)==null||oe.call(ce,ae),V()}}),additionalProps:{appear:!0,in:g}});S==="auto"&&!H.muiSupportAuto&&(B=void 0);const W=p||(i?Zl(jF(i)).body:void 0),[U,{slots:K,slotProps:X,...J}]=mr("root",{ref:n,elementType:i1n,externalForwardedProps:{...G,...j},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:x.backdrop},slotProps:{backdrop:gxe(typeof v.backdrop=="function"?v.backdrop(_):v.backdrop,{invisible:!0})},container:W,open:g},ownerState:_,className:be(T.root,d)}),[te,re]=mr("paper",{ref:I,className:T.paper,elementType:srt,externalForwardedProps:G,shouldForwardComponentProp:!0,additionalProps:{elevation:h,style:R?void 0:{opacity:0}},ownerState:_});return a.jsx(U,{...J,...!dT(U)&&{slots:K,slotProps:X,disableScrollLock:N},children:a.jsx(H,{...F,timeout:B,children:a.jsx(te,{...re,children:u})})})});function s1n(e){return _r("MuiMenu",e)}Pr("MuiMenu",["root","paper","list"]);const l1n={vertical:"top",horizontal:"right"},c1n={vertical:"top",horizontal:"left"},u1n=e=>{const{classes:t}=e;return Un({root:["root"],paper:["paper"],list:["list"]},s1n,t)},d1n=Bt(a1n,{shouldForwardProp:e=>_h(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),f1n=Bt(srt,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),p1n=Bt(art,{name:"MuiMenu",slot:"List"})({outline:0}),lrt=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:i,className:s,disableAutoFocusItem:l=!1,MenuListProps:c={},onClose:u,open:d,PaperProps:p={},PopoverClasses:h,transitionDuration:m="auto",TransitionProps:{onEntering:g,...y}={},variant:x="selectedMenu",slots:v={},slotProps:b={},...w}=r,S=$d(),C={...r,autoFocus:o,disableAutoFocusItem:l,MenuListProps:c,onEntering:g,PaperProps:p,transitionDuration:m,TransitionProps:y,variant:x},N=u1n(C),j=o&&!l&&d,I=f.useRef(null),_=(B,G)=>{I.current&&I.current.adjustStyleForScrollbar(B,{direction:S?"rtl":"ltr"}),g&&g(B,G)},T=B=>{B.key==="Tab"&&(B.preventDefault(),u&&u(B,"tabKeyDown"))};let P=-1;f.Children.map(i,(B,G)=>{f.isValidElement(B)&&(B.props.disabled||(x==="selectedMenu"&&B.props.selected||P===-1)&&(P=G))});const E={slots:v,slotProps:{list:c,transition:y,paper:p,...b}},M=xT({elementType:v.root,externalSlotProps:b.root,ownerState:C,className:[N.root,s]}),[R,$]=mr("paper",{className:N.paper,elementType:f1n,externalForwardedProps:E,shouldForwardComponentProp:!0,ownerState:C}),[D,z]=mr("list",{className:be(N.list,c.className),elementType:p1n,shouldForwardComponentProp:!0,externalForwardedProps:E,getSlotProps:B=>({...B,onKeyDown:G=>{var H;T(G),(H=B.onKeyDown)==null||H.call(B,G)}}),ownerState:C}),V=typeof E.slotProps.transition=="function"?E.slotProps.transition(C):E.slotProps.transition;return a.jsx(d1n,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:S?"right":"left"},transformOrigin:S?l1n:c1n,slots:{root:v.root,paper:R,backdrop:v.backdrop,...v.transition&&{transition:v.transition}},slotProps:{root:M,paper:$,backdrop:typeof b.backdrop=="function"?b.backdrop(C):b.backdrop,transition:{...V,onEntering:(...B)=>{var G;_(...B),(G=V==null?void 0:V.onEntering)==null||G.call(V,...B)}}},open:d,ref:n,transitionDuration:m,ownerState:C,...w,classes:h,children:a.jsx(D,{actions:I,autoFocus:o&&(P===-1||l),autoFocusItem:j,variant:x,...z,children:i})})});function h1n(e){return _r("MuiMenuItem",e)}const uM=Pr("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),m1n=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},g1n=e=>{const{disabled:t,dense:n,divider:r,disableGutters:o,selected:i,classes:s}=e,c=Un({root:["root",n&&"dense",t&&"disabled",!o&&"gutters",r&&"divider",i&&"selected"]},h1n,s);return{...s,...c}},x1n=Bt(ub,{shouldForwardProp:e=>_h(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:m1n})(jr(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${uM.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${uM.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${uM.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${uM.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${uM.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${Ske.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${Ske.inset}`]:{marginLeft:52},[`& .${tE.root}`]:{marginTop:0,marginBottom:0},[`& .${tE.inset}`]:{paddingLeft:36},[`& .${Ike.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${Ike.root} svg`]:{fontSize:"1.25rem"}}}]}))),_d=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:s=!1,divider:l=!1,disableGutters:c=!1,focusVisibleClassName:u,role:d="menuitem",tabIndex:p,className:h,...m}=r,g=f.useContext(J1),y=f.useMemo(()=>({dense:s||g.dense||!1,disableGutters:c}),[g.dense,s,c]),x=f.useRef(null);Ia(()=>{o&&x.current&&x.current.focus()},[o]);const v={...r,dense:y.dense,divider:l,disableGutters:c},b=g1n(r),w=Di(x,n);let S;return r.disabled||(S=p!==void 0?p:-1),a.jsx(J1.Provider,{value:y,children:a.jsx(x1n,{ref:w,role:d,tabIndex:S,component:i,focusVisibleClassName:be(b.focusVisible,u),className:be(b.root,h),...m,ownerState:v,classes:b})})});function y1n(e){return _r("MuiNativeSelect",e)}const $xe=Pr("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),v1n=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:s}=e,l={select:["select",n,r&&"disabled",o&&"multiple",s&&"error"],icon:["icon",`icon${vn(n)}`,i&&"iconOpen",r&&"disabled"]};return Un(l,y1n,t)},crt=Bt("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${$xe.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),b1n=Bt(crt,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:_h,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${$xe.multiple}`]:t.multiple}]}})({}),urt=Bt("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${$xe.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),w1n=Bt(urt,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${vn(n.variant)}`],n.open&&t.iconOpen]}})({}),S1n=f.forwardRef(function(t,n){const{className:r,disabled:o,error:i,IconComponent:s,inputRef:l,variant:c="standard",...u}=t,d={...t,disabled:o,variant:c,error:i},p=v1n(d);return a.jsxs(f.Fragment,{children:[a.jsx(b1n,{ownerState:d,className:be(p.select,r),disabled:o,ref:l||n,...u}),t.multiple?null:a.jsx(w1n,{as:s,ownerState:d,className:p.icon})]})});var kke;const C1n=Bt("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:_h})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),N1n=Bt("legend",{name:"MuiNotchedOutlined",shouldForwardProp:_h})(jr(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function j1n(e){const{children:t,classes:n,className:r,label:o,notched:i,...s}=e,l=o!=null&&o!=="",c={...e,notched:i,withLabel:l};return a.jsx(C1n,{"aria-hidden":!0,className:r,ownerState:c,...s,children:a.jsx(N1n,{ownerState:c,children:l?a.jsx("span",{children:o}):kke||(kke=a.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}const E1n=e=>{const{classes:t}=e,r=Un({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},kxn,t);return{...t,...r}},I1n=Bt(uK,{shouldForwardProp:e=>_h(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:lK})(jr(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Wg.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Wg.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${Wg.focused} .${Wg.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(ul()).map(([n])=>({props:{color:n},style:{[`&.${Wg.focused} .${Wg.notchedOutline}`]:{borderColor:(e.vars||e).palette[n].main}}})),{props:{},style:{[`&.${Wg.error} .${Wg.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Wg.disabled} .${Wg.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:n})=>n.startAdornment,style:{paddingLeft:14}},{props:({ownerState:n})=>n.endAdornment,style:{paddingRight:14}},{props:({ownerState:n})=>n.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:n,size:r})=>n.multiline&&r==="small",style:{padding:"8.5px 14px"}}]}})),_1n=Bt(j1n,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(jr(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),P1n=Bt(dK,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:cK})(jr(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),Dxe=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiOutlinedInput"}),{components:o={},fullWidth:i=!1,inputComponent:s="input",label:l,multiline:c=!1,notched:u,slots:d={},slotProps:p={},type:h="text",...m}=r,g=E1n(r),y=qw(),x=i5({props:r,muiFormControl:y,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),v={...r,color:x.color||"primary",disabled:x.disabled,error:x.error,focused:x.focused,formControl:y,fullWidth:i,hiddenLabel:x.hiddenLabel,multiline:c,size:x.size,type:h},b=d.root??o.Root??I1n,w=d.input??o.Input??P1n,[S,C]=mr("notchedOutline",{elementType:_1n,className:g.notchedOutline,shouldForwardComponentProp:!0,ownerState:v,externalForwardedProps:{slots:d,slotProps:p},additionalProps:{label:l!=null&&l!==""&&x.required?a.jsxs(f.Fragment,{children:[l," ","*"]}):l}});return a.jsx(HL,{slots:{root:b,input:w},slotProps:p,renderSuffix:N=>a.jsx(S,{...C,notched:typeof u<"u"?u:!!(N.startAdornment||N.filled||N.focused)}),fullWidth:i,inputComponent:s,multiline:c,ref:n,type:h,...m,classes:{...g,notchedOutline:null}})});Dxe.muiName="Input";const A1n=wi(a.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})),T1n=wi(a.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}));function drt(e){return _r("MuiSelect",e)}const dM=Pr("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Mke;const k1n=Bt(crt,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${dM.select}`]:t.select},{[`&.${dM.select}`]:t[n.variant]},{[`&.${dM.error}`]:t.error},{[`&.${dM.multiple}`]:t.multiple}]}})({[`&.${dM.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),M1n=Bt(urt,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${vn(n.variant)}`],n.open&&t.iconOpen]}})({}),R1n=Bt("input",{shouldForwardProp:e=>FKe(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Rke(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function O1n(e){return e==null||typeof e=="string"&&!e.trim()}const $1n=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:s}=e,l={select:["select",n,r&&"disabled",o&&"multiple",s&&"error"],icon:["icon",`icon${vn(n)}`,i&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Un(l,drt,t)},D1n=f.forwardRef(function(t,n){var bt,Ct,Je,Pe;const{"aria-describedby":r,"aria-label":o,autoFocus:i,autoWidth:s,children:l,className:c,defaultOpen:u,defaultValue:d,disabled:p,displayEmpty:h,error:m=!1,IconComponent:g,inputRef:y,labelId:x,MenuProps:v={},multiple:b,name:w,onBlur:S,onChange:C,onClose:N,onFocus:j,onKeyDown:I,onMouseDown:_,onOpen:T,open:P,readOnly:E,renderValue:M,required:R,SelectDisplayProps:$={},tabIndex:D,type:z,value:V,variant:B="standard",...G}=t,[H,F]=iC({controlled:V,default:d,name:"Select"}),[W,U]=iC({controlled:P,default:u,name:"Select"}),K=f.useRef(null),X=f.useRef(null),[J,te]=f.useState(null),{current:re}=f.useRef(P!=null),[ce,ae]=f.useState(),oe=Di(n,y),ue=f.useCallback(Me=>{X.current=Me,Me&&te(Me)},[]),fe=J==null?void 0:J.parentNode;f.useImperativeHandle(oe,()=>({focus:()=>{X.current.focus()},node:K.current,value:H}),[H]);const se=J!==null&&W;f.useEffect(()=>{if(!se||!fe||s||typeof ResizeObserver>"u")return;const Me=new ResizeObserver(()=>{ae(fe.clientWidth)});return Me.observe(fe),()=>{Me.disconnect()}},[se,fe,s]),f.useEffect(()=>{u&&W&&J&&!re&&(ae(s?null:fe.clientWidth),X.current.focus())},[J,s]),f.useEffect(()=>{i&&X.current.focus()},[i]),f.useEffect(()=>{if(!x)return;const Me=Zl(X.current).getElementById(x);if(Me){const et=()=>{getSelection().isCollapsed&&X.current.focus()};return Me.addEventListener("click",et),()=>{Me.removeEventListener("click",et)}}},[x]);const ge=(Me,et)=>{Me?T&&T(et):N&&N(et),re||(ae(s?null:fe.clientWidth),U(Me))},ye=Me=>{_==null||_(Me),Me.button===0&&(Me.preventDefault(),X.current.focus(),ge(!0,Me))},de=Me=>{ge(!1,Me)},Ne=f.Children.toArray(l),_e=Me=>{const et=Ne.find(vt=>vt.props.value===Me.target.value);et!==void 0&&(F(et.props.value),C&&C(Me,et))},xe=Me=>et=>{let vt;if(et.currentTarget.hasAttribute("tabindex")){if(b){vt=Array.isArray(H)?H.slice():[];const Pt=H.indexOf(Me.props.value);Pt===-1?vt.push(Me.props.value):vt.splice(Pt,1)}else vt=Me.props.value;if(Me.props.onClick&&Me.props.onClick(et),H!==vt&&(F(vt),C)){const Pt=et.nativeEvent||et,Jt=new Pt.constructor(Pt.type,Pt);Object.defineProperty(Jt,"target",{writable:!0,value:{value:vt,name:w}}),C(Jt,Me)}b||ge(!1,et)}},we=Me=>{E||([" ","ArrowUp","ArrowDown","Enter"].includes(Me.key)&&(Me.preventDefault(),ge(!0,Me)),I==null||I(Me))},Te=Me=>{!se&&S&&(Object.defineProperty(Me,"target",{writable:!0,value:{value:H,name:w}}),S(Me))};delete G["aria-invalid"];let Re,Ue;const He=[];let Ye=!1;(ZV({value:H})||h)&&(M?Re=M(H):Ye=!0);const We=Ne.map(Me=>{if(!f.isValidElement(Me))return null;let et;if(b){if(!Array.isArray(H))throw new Error(lw(2));et=H.some(vt=>Rke(vt,Me.props.value)),et&&Ye&&He.push(Me.props.children)}else et=Rke(H,Me.props.value),et&&Ye&&(Ue=Me.props.children);return f.cloneElement(Me,{"aria-selected":et?"true":"false",onClick:xe(Me),onKeyUp:vt=>{vt.key===" "&&vt.preventDefault(),Me.props.onKeyUp&&Me.props.onKeyUp(vt)},role:"option",selected:et,value:void 0,"data-value":Me.props.value})});Ye&&(b?He.length===0?Re=null:Re=He.reduce((Me,et,vt)=>(Me.push(et),vt{const{classes:t}=e,r=Un({root:["root"]},drt,t);return{...t,...r}},Lxe={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>_h(e)&&e!=="variant"},F1n=Bt(Rxe,Lxe)(""),z1n=Bt(Dxe,Lxe)(""),B1n=Bt(Mxe,Lxe)(""),S0=f.forwardRef(function(t,n){const r=Rr({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:i,classes:s={},className:l,defaultOpen:c=!1,displayEmpty:u=!1,IconComponent:d=qnt,id:p,input:h,inputProps:m,label:g,labelId:y,MenuProps:x,multiple:v=!1,native:b=!1,onClose:w,onOpen:S,open:C,renderValue:N,SelectDisplayProps:j,variant:I="outlined",..._}=r,T=b?S1n:D1n,P=qw(),E=i5({props:r,muiFormControl:P,states:["variant","error"]}),M=E.variant||I,R={...r,variant:M,classes:s},$=L1n(R),{root:D,...z}=$,V=h||{standard:a.jsx(F1n,{ownerState:R}),outlined:a.jsx(z1n,{label:g,ownerState:R}),filled:a.jsx(B1n,{ownerState:R})}[M],B=Di(n,nN(V));return a.jsx(f.Fragment,{children:f.cloneElement(V,{inputComponent:T,inputProps:{children:i,error:E.error,IconComponent:d,variant:M,type:void 0,multiple:v,...b?{id:p}:{autoWidth:o,defaultOpen:c,displayEmpty:u,labelId:y,MenuProps:x,onClose:w,onOpen:S,open:C,renderValue:N,SelectDisplayProps:{id:p,...j}},...m,classes:m?hf(z,m.classes):z,...h?h.props.inputProps:{}},...(v&&b||u)&&M==="outlined"?{notched:!0}:{},ref:B,className:be(V.props.className,l,$.root),...!h&&{variant:M},..._})})});S0.muiName="Select";function H1n(e){return _r("MuiSkeleton",e)}Pr("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const V1n=e=>{const{classes:t,variant:n,animation:r,hasChildren:o,width:i,height:s}=e;return Un({root:["root",n,r,o&&"withChildren",o&&!i&&"fitContent",o&&!s&&"heightAuto"]},H1n,t)},wse=gf` 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } `,Sse=gf` 0% { transform: translateX(-100%); } 50% { /* +0.5s of delay between each loop */ transform: translateX(100%); } 100% { transform: translateX(100%); } `,U1n=typeof wse!="string"?jb` animation: ${wse} 2s ease-in-out 0.5s infinite; `:null,W1n=typeof Sse!="string"?jb` &::after { animation: ${Sse} 2s linear 0.5s infinite; } `:null,G1n=Bt("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],n.animation!==!1&&t[n.animation],n.hasChildren&&t.withChildren,n.hasChildren&&!n.width&&t.fitContent,n.hasChildren&&!n.height&&t.heightAuto]}})(jr(({theme:e})=>{const t=KRt(e.shape.borderRadius)||"px",n=YRt(e.shape.borderRadius);return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:e.alpha(e.palette.text.primary,e.palette.mode==="light"?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${n}${t}/${Math.round(n/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:r})=>r.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:r})=>r.hasChildren&&!r.width,style:{maxWidth:"fit-content"}},{props:({ownerState:r})=>r.hasChildren&&!r.height,style:{height:"auto"}},{props:{animation:"pulse"},style:U1n||{animation:`${wse} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient( 90deg, transparent, ${(e.vars||e).palette.action.hover}, transparent )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:W1n||{"&::after":{animation:`${Sse} 2s linear 0.5s infinite`}}}]}})),q1n=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiSkeleton"}),{animation:o="pulse",className:i,component:s="span",height:l,style:c,variant:u="text",width:d,...p}=r,h={...r,animation:o,component:s,variant:u,hasChildren:!!p.children},m=V1n(h);return a.jsx(G1n,{as:s,ref:n,className:be(m.root,i),ownerState:h,...p,style:{width:d,height:l,...c}})});function K1n(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:o,resumeHideDuration:i}=e,s=hh();f.useEffect(()=>{if(!o)return;function v(b){b.defaultPrevented||b.key==="Escape"&&(r==null||r(b,"escapeKeyDown"))}return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[o,r]);const l=no((v,b)=>{r==null||r(v,b)}),c=no(v=>{!r||v==null||s.start(v,()=>{l(null,"timeout")})});f.useEffect(()=>(o&&c(t),s.clear),[o,t,c,s]);const u=v=>{r==null||r(v,"clickaway")},d=s.clear,p=f.useCallback(()=>{t!=null&&c(i??t*.5)},[t,i,c]),h=v=>b=>{const w=v.onBlur;w==null||w(b),p()},m=v=>b=>{const w=v.onFocus;w==null||w(b),d()},g=v=>b=>{const w=v.onMouseEnter;w==null||w(b),d()},y=v=>b=>{const w=v.onMouseLeave;w==null||w(b),p()};return f.useEffect(()=>{if(!n&&o)return window.addEventListener("focus",p),window.addEventListener("blur",d),()=>{window.removeEventListener("focus",p),window.removeEventListener("blur",d)}},[n,o,p,d]),{getRootProps:(v={})=>{const b={...YV(e),...YV(v)};return{role:"presentation",...v,...b,onBlur:h(b),onFocus:m(b),onMouseEnter:g(b),onMouseLeave:y(b)}},onClickAway:u}}function Y1n(e){return _r("MuiSnackbarContent",e)}Pr("MuiSnackbarContent",["root","message","action"]);const X1n=e=>{const{classes:t}=e;return Un({root:["root"],action:["action"],message:["message"]},Y1n,t)},Q1n=Bt(ea,{name:"MuiSnackbarContent",slot:"Root"})(jr(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(hie(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:hie(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),J1n=Bt("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),Z1n=Bt("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),ewn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiSnackbarContent"}),{action:o,className:i,message:s,role:l="alert",...c}=r,u=r,d=X1n(u);return a.jsxs(Q1n,{role:l,elevation:6,className:be(d.root,i),ownerState:u,ref:n,...c,children:[a.jsx(J1n,{className:d.message,ownerState:u,children:s}),o?a.jsx(Z1n,{className:d.action,ownerState:u,children:o}):null]})});function twn(e){return _r("MuiSnackbar",e)}Pr("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const nwn=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${vn(n.vertical)}${vn(n.horizontal)}`]};return Un(r,twn,t)},rwn=Bt("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${vn(n.anchorOrigin.vertical)}${vn(n.anchorOrigin.horizontal)}`]]}})(jr(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),fK=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiSnackbar"}),o=xf(),i={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:l,horizontal:c}={vertical:"bottom",horizontal:"left"},autoHideDuration:u=null,children:d,className:p,ClickAwayListenerProps:h,ContentProps:m,disableWindowBlurListener:g=!1,message:y,onBlur:x,onClose:v,onFocus:b,onMouseEnter:w,onMouseLeave:S,open:C,resumeHideDuration:N,slots:j={},slotProps:I={},TransitionComponent:_,transitionDuration:T=i,TransitionProps:{onEnter:P,onExited:E,...M}={},...R}=r,$={...r,anchorOrigin:{vertical:l,horizontal:c},autoHideDuration:u,disableWindowBlurListener:g,TransitionComponent:_,transitionDuration:T},D=nwn($),{getRootProps:z,onClickAway:V}=K1n($),[B,G]=f.useState(!0),H=ue=>{G(!0),E&&E(ue)},F=(ue,fe)=>{G(!1),P&&P(ue,fe)},W={slots:{transition:_,...j},slotProps:{content:m,clickAwayListener:h,transition:M,...I}},[U,K]=mr("root",{ref:n,className:[D.root,p],elementType:rwn,getSlotProps:z,externalForwardedProps:{...W,...R},ownerState:$}),[X,{ownerState:J,...te}]=mr("clickAwayListener",{elementType:Qnt,externalForwardedProps:W,getSlotProps:ue=>({onClickAway:(...fe)=>{var ge;const se=fe[0];(ge=ue.onClickAway)==null||ge.call(ue,...fe),!(se!=null&&se.defaultMuiPrevented)&&V(...fe)}}),ownerState:$}),[re,ce]=mr("content",{elementType:ewn,shouldForwardComponentProp:!0,externalForwardedProps:W,additionalProps:{message:y,action:s},ownerState:$}),[ae,oe]=mr("transition",{elementType:ST,externalForwardedProps:W,getSlotProps:ue=>({onEnter:(...fe)=>{var se;(se=ue.onEnter)==null||se.call(ue,...fe),F(...fe)},onExited:(...fe)=>{var se;(se=ue.onExited)==null||se.call(ue,...fe),H(...fe)}}),additionalProps:{appear:!0,in:C,timeout:T,direction:l==="top"?"down":"up"},ownerState:$});return!C&&B?null:a.jsx(X,{...te,...j.clickAwayListener&&{ownerState:J},children:a.jsx(U,{...K,children:a.jsx(ae,{...oe,children:d||a.jsx(re,{...ce})})})})});function own(e){return _r("MuiTooltip",e)}const Zc=Pr("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function iwn(e){return Math.round(e*1e5)/1e5}const awn=e=>{const{classes:t,disableInteractive:n,arrow:r,touch:o,placement:i}=e,s={popper:["popper",!n&&"popperInteractive",r&&"popperArrow"],tooltip:["tooltip",r&&"tooltipArrow",o&&"touch",`tooltipPlacement${vn(i.split("-")[0])}`],arrow:["arrow"]};return Un(s,own,t)},swn=Bt(BL,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.popper,!n.disableInteractive&&t.popperInteractive,n.arrow&&t.popperArrow,!n.open&&t.popperClose]}})(jr(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:t})=>!t.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:t})=>!t,style:{pointerEvents:"none"}},{props:({ownerState:t})=>t.arrow,style:{[`&[data-popper-placement*="bottom"] .${Zc.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Zc.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Zc.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Zc.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Zc.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Zc.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Zc.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Zc.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),lwn=Bt("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.tooltip,n.touch&&t.touch,n.arrow&&t.tooltipArrow,t[`tooltipPlacement${vn(n.placement.split("-")[0])}`]]}})(jr(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${Zc.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Zc.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Zc.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Zc.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:t})=>t.arrow,style:{position:"relative",margin:0}},{props:({ownerState:t})=>t.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${iwn(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${Zc.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Zc.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${Zc.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Zc.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${Zc.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Zc.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${Zc.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Zc.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Zc.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Zc.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),cwn=Bt("span",{name:"MuiTooltip",slot:"Arrow"})(jr(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let EF=!1;const Oke=new iK;let fM={x:0,y:0};function IF(e,t){return(n,...r)=>{t&&t(n,...r),e(n,...r)}}const Rv=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTooltip"}),{arrow:o=!1,children:i,classes:s,components:l={},componentsProps:c={},describeChild:u=!1,disableFocusListener:d=!1,disableHoverListener:p=!1,disableInteractive:h=!1,disableTouchListener:m=!1,enterDelay:g=100,enterNextDelay:y=0,enterTouchDelay:x=700,followCursor:v=!1,id:b,leaveDelay:w=0,leaveTouchDelay:S=1500,onClose:C,onOpen:N,open:j,placement:I="bottom",PopperComponent:_,PopperProps:T={},slotProps:P={},slots:E={},title:M,TransitionComponent:R,TransitionProps:$,...D}=r,z=f.isValidElement(i)?i:a.jsx("span",{children:i}),V=xf(),B=$d(),[G,H]=f.useState(),[F,W]=f.useState(null),U=f.useRef(!1),K=h||v,X=hh(),J=hh(),te=hh(),re=hh(),[ce,ae]=iC({controlled:j,default:!1,name:"Tooltip",state:"open"});let oe=ce;const ue=Jo(b),fe=f.useRef(),se=no(()=>{fe.current!==void 0&&(document.body.style.WebkitUserSelect=fe.current,fe.current=void 0),re.clear()});f.useEffect(()=>se,[se]);const ge=Et=>{Oke.clear(),EF=!0,ae(!0),N&&!oe&&N(Et)},ye=no(Et=>{Oke.start(800+w,()=>{EF=!1}),ae(!1),C&&oe&&C(Et),X.start(V.transitions.duration.shortest,()=>{U.current=!1})}),de=Et=>{U.current&&Et.type!=="touchstart"||(G&&G.removeAttribute("title"),J.clear(),te.clear(),g||EF&&y?J.start(EF?y:g,()=>{ge(Et)}):ge(Et))},Ne=Et=>{J.clear(),te.start(w,()=>{ye(Et)})},[,_e]=f.useState(!1),xe=Et=>{fT(Et.target)||(_e(!1),Ne(Et))},we=Et=>{G||H(Et.currentTarget),fT(Et.target)&&(_e(!0),de(Et))},Te=Et=>{U.current=!0;const sn=z.props;sn.onTouchStart&&sn.onTouchStart(Et)},Re=Et=>{Te(Et),te.clear(),X.clear(),se(),fe.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",re.start(x,()=>{document.body.style.WebkitUserSelect=fe.current,de(Et)})},Ue=Et=>{z.props.onTouchEnd&&z.props.onTouchEnd(Et),se(),te.start(S,()=>{ye(Et)})};f.useEffect(()=>{if(!oe)return;function Et(sn){sn.key==="Escape"&&ye(sn)}return document.addEventListener("keydown",Et),()=>{document.removeEventListener("keydown",Et)}},[ye,oe]);const He=Di(nN(z),H,n);!M&&M!==0&&(oe=!1);const Ye=f.useRef(),We=Et=>{const sn=z.props;sn.onMouseMove&&sn.onMouseMove(Et),fM={x:Et.clientX,y:Et.clientY},Ye.current&&Ye.current.update()},at={},Oe=typeof M=="string";u?(at.title=!oe&&Oe&&!p?M:null,at["aria-describedby"]=oe?ue:null):(at["aria-label"]=Oe?M:null,at["aria-labelledby"]=oe&&!Oe?ue:null);const Ae={...at,...D,...z.props,className:be(D.className,z.props.className),onTouchStart:Te,ref:He,...v?{onMouseMove:We}:{}},qe={};m||(Ae.onTouchStart=Re,Ae.onTouchEnd=Ue),p||(Ae.onMouseOver=IF(de,Ae.onMouseOver),Ae.onMouseLeave=IF(Ne,Ae.onMouseLeave),K||(qe.onMouseOver=de,qe.onMouseLeave=Ne)),d||(Ae.onFocus=IF(we,Ae.onFocus),Ae.onBlur=IF(xe,Ae.onBlur),K||(qe.onFocus=we,qe.onBlur=xe));const dt={...r,isRtl:B,arrow:o,disableInteractive:K,placement:I,PopperComponentProp:_,touch:U.current},Ze=typeof P.popper=="function"?P.popper(dt):P.popper,Qe=f.useMemo(()=>{var sn,ot;let Et=[{name:"arrow",enabled:!!F,options:{element:F,padding:4}}];return(sn=T.popperOptions)!=null&&sn.modifiers&&(Et=Et.concat(T.popperOptions.modifiers)),(ot=Ze==null?void 0:Ze.popperOptions)!=null&&ot.modifiers&&(Et=Et.concat(Ze.popperOptions.modifiers)),{...T.popperOptions,...Ze==null?void 0:Ze.popperOptions,modifiers:Et}},[F,T.popperOptions,Ze==null?void 0:Ze.popperOptions]),lt=awn(dt),bt=typeof P.transition=="function"?P.transition(dt):P.transition,Ct={slots:{popper:l.Popper,transition:l.Transition??R,tooltip:l.Tooltip,arrow:l.Arrow,...E},slotProps:{arrow:P.arrow??c.arrow,popper:{...T,...Ze??c.popper},tooltip:P.tooltip??c.tooltip,transition:{...$,...bt??c.transition}}},[Je,Pe]=mr("popper",{elementType:swn,externalForwardedProps:Ct,ownerState:dt,className:be(lt.popper,T==null?void 0:T.className)}),[Me,et]=mr("transition",{elementType:ST,externalForwardedProps:Ct,ownerState:dt}),[vt,Pt]=mr("tooltip",{elementType:lwn,className:lt.tooltip,externalForwardedProps:Ct,ownerState:dt}),[Jt,dn]=mr("arrow",{elementType:cwn,className:lt.arrow,externalForwardedProps:Ct,ownerState:dt,ref:W});return a.jsxs(f.Fragment,{children:[f.cloneElement(z,Ae),a.jsx(Je,{as:_??BL,placement:I,anchorEl:v?{getBoundingClientRect:()=>({top:fM.y,left:fM.x,right:fM.x,bottom:fM.y,width:0,height:0})}:G,popperRef:Ye,open:G?oe:!1,id:ue,transition:!0,...qe,...Pe,popperOptions:Qe,children:({TransitionProps:Et})=>a.jsx(Me,{timeout:V.transitions.duration.shorter,...Et,...et,children:a.jsxs(vt,{...Pt,children:[M,o?a.jsx(Jt,{...dn}):null]})})})]})}),Zp=gRt({createStyledComponent:Bt("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>Rr({props:e,name:"MuiStack"})});function uwn(e){return _r("MuiSwitch",e)}const eh=Pr("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),dwn=e=>{const{classes:t,edge:n,size:r,color:o,checked:i,disabled:s}=e,l={root:["root",n&&`edge${vn(n)}`,`size${vn(r)}`],switchBase:["switchBase",`color${vn(o)}`,i&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},c=Un(l,uwn,t);return{...t,...c}},fwn=Bt("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.edge&&t[`edge${vn(n.edge)}`],t[`size${vn(n.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${eh.thumb}`]:{width:16,height:16},[`& .${eh.switchBase}`]:{padding:4,[`&.${eh.checked}`]:{transform:"translateX(16px)"}}}}]}),pwn=Bt(Xnt,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.switchBase,{[`& .${eh.input}`]:t.input},n.color!=="default"&&t[`color${vn(n.color)}`]]}})(jr(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${eh.checked}`]:{transform:"translateX(20px)"},[`&.${eh.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${eh.checked} + .${eh.track}`]:{opacity:.5},[`&.${eh.disabled} + .${eh.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${eh.input}`]:{left:"-100%",width:"300%"}})),jr(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(ul(["light"])).map(([t])=>({props:{color:t},style:{[`&.${eh.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${eh.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${eh.checked} + .${eh.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),hwn=Bt("span",{name:"MuiSwitch",slot:"Track"})(jr(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),mwn=Bt("span",{name:"MuiSwitch",slot:"Thumb"})(jr(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),Cse=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiSwitch"}),{className:o,color:i="primary",edge:s=!1,size:l="medium",sx:c,slots:u={},slotProps:d={},...p}=r,h={...r,color:i,edge:s,size:l},m=dwn(h),g={slots:u,slotProps:d},[y,x]=mr("root",{className:be(m.root,o),elementType:fwn,externalForwardedProps:g,ownerState:h,additionalProps:{sx:c}}),[v,b]=mr("thumb",{className:m.thumb,elementType:mwn,externalForwardedProps:g,ownerState:h}),w=a.jsx(v,{...b}),[S,C]=mr("track",{className:m.track,elementType:hwn,externalForwardedProps:g,ownerState:h});return a.jsxs(y,{...x,children:[a.jsx(pwn,{type:"checkbox",icon:w,checkedIcon:w,ref:n,ownerState:h,...p,classes:{...m,root:m.switchBase},slots:{...u.switchBase&&{root:u.switchBase},...u.input&&{input:u.input}},slotProps:{...d.switchBase&&{root:typeof d.switchBase=="function"?d.switchBase(h):d.switchBase},input:{role:"switch"},...d.input&&{input:typeof d.input=="function"?d.input(h):d.input}}}),a.jsx(S,{...C})]})});function gwn(e){return _r("MuiTab",e)}const Og=Pr("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),xwn=e=>{const{classes:t,textColor:n,fullWidth:r,wrapped:o,icon:i,label:s,selected:l,disabled:c}=e,u={root:["root",i&&s&&"labelIcon",`textColor${vn(n)}`,r&&"fullWidth",o&&"wrapped",l&&"selected",c&&"disabled"],icon:["iconWrapper","icon"]};return Un(u,gwn,t)},ywn=Bt(ub,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${vn(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped,{[`& .${Og.iconWrapper}`]:t.iconWrapper},{[`& .${Og.icon}`]:t.icon}]}})(jr(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:t})=>t.label&&(t.iconPosition==="top"||t.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:t})=>t.label&&t.iconPosition!=="top"&&t.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:t})=>t.icon&&t.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="top",style:{[`& > .${Og.icon}`]:{marginBottom:6}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="bottom",style:{[`& > .${Og.icon}`]:{marginTop:6}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="start",style:{[`& > .${Og.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:t,iconPosition:n})=>t.icon&&t.label&&n==="end",style:{[`& > .${Og.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${Og.selected}`]:{opacity:1},[`&.${Og.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${Og.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${Og.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${Og.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${Og.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:t})=>t.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:t})=>t.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),Jz=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTab"}),{className:o,disabled:i=!1,disableFocusRipple:s=!1,fullWidth:l,icon:c,iconPosition:u="top",indicator:d,label:p,onChange:h,onClick:m,onFocus:g,selected:y,selectionFollowsFocus:x,textColor:v="inherit",value:b,wrapped:w=!1,...S}=r,C={...r,disabled:i,disableFocusRipple:s,selected:y,icon:!!c,iconPosition:u,label:!!p,fullWidth:l,textColor:v,wrapped:w},N=xwn(C),j=c&&p&&f.isValidElement(c)?f.cloneElement(c,{className:be(N.icon,c.props.className)}):c,I=T=>{!y&&h&&h(T,b),m&&m(T)},_=T=>{x&&!y&&h&&h(T,b),g&&g(T)};return a.jsxs(ywn,{focusRipple:!s,className:be(N.root,o),ref:n,role:"tab","aria-selected":y,disabled:i,onClick:I,onFocus:_,ownerState:C,tabIndex:y?0:-1,...S,children:[u==="top"||u==="start"?a.jsxs(f.Fragment,{children:[j,p]}):a.jsxs(f.Fragment,{children:[p,j]}),d]})}),frt=f.createContext();function vwn(e){return _r("MuiTable",e)}Pr("MuiTable",["root","stickyHeader"]);const bwn=e=>{const{classes:t,stickyHeader:n}=e;return Un({root:["root",n&&"stickyHeader"]},vwn,t)},wwn=Bt("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(jr(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:t})=>t.stickyHeader,style:{borderCollapse:"separate"}}]}))),$ke="table",nU=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTable"}),{className:o,component:i=$ke,padding:s="normal",size:l="medium",stickyHeader:c=!1,...u}=r,d={...r,component:i,padding:s,size:l,stickyHeader:c},p=bwn(d),h=f.useMemo(()=>({padding:s,size:l,stickyHeader:c}),[s,l,c]);return a.jsx(frt.Provider,{value:h,children:a.jsx(wwn,{as:i,role:i===$ke?null:"table",ref:n,className:be(p.root,o),ownerState:d,...u})})}),pK=f.createContext();function Swn(e){return _r("MuiTableBody",e)}Pr("MuiTableBody",["root"]);const Cwn=e=>{const{classes:t}=e;return Un({root:["root"]},Swn,t)},Nwn=Bt("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),jwn={variant:"body"},Dke="tbody",rU=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTableBody"}),{className:o,component:i=Dke,...s}=r,l={...r,component:i},c=Cwn(l);return a.jsx(pK.Provider,{value:jwn,children:a.jsx(Nwn,{className:be(c.root,o),as:i,ref:n,role:i===Dke?null:"rowgroup",ownerState:l,...s})})});function Ewn(e){return _r("MuiTableCell",e)}const Iwn=Pr("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),_wn=e=>{const{classes:t,variant:n,align:r,padding:o,size:i,stickyHeader:s}=e,l={root:["root",n,s&&"stickyHeader",r!=="inherit"&&`align${vn(r)}`,o!=="normal"&&`padding${vn(o)}`,`size${vn(i)}`]};return Un(l,Ewn,t)},Pwn=Bt("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${vn(n.size)}`],n.padding!=="normal"&&t[`padding${vn(n.padding)}`],n.align!=="inherit"&&t[`align${vn(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(jr(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid ${e.palette.mode==="light"?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${Iwn.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:t})=>t.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),Yi=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTableCell"}),{align:o="inherit",className:i,component:s,padding:l,scope:c,size:u,sortDirection:d,variant:p,...h}=r,m=f.useContext(frt),g=f.useContext(pK),y=g&&g.variant==="head";let x;s?x=s:x=y?"th":"td";let v=c;x==="td"?v=void 0:!v&&y&&(v="col");const b=p||g&&g.variant,w={...r,align:o,component:x,padding:l||(m&&m.padding?m.padding:"normal"),size:u||(m&&m.size?m.size:"medium"),sortDirection:d,stickyHeader:b==="head"&&m&&m.stickyHeader,variant:b},S=_wn(w);let C=null;return d&&(C=d==="asc"?"ascending":"descending"),a.jsx(Pwn,{as:x,ref:n,className:be(S.root,i),"aria-sort":C,scope:v,ownerState:w,...h})});function Awn(e){return _r("MuiTableContainer",e)}Pr("MuiTableContainer",["root"]);const Twn=e=>{const{classes:t}=e;return Un({root:["root"]},Awn,t)},kwn=Bt("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),oU=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTableContainer"}),{className:o,component:i="div",...s}=r,l={...r,component:i},c=Twn(l);return a.jsx(kwn,{ref:n,as:i,className:be(c.root,o),ownerState:l,...s})});function Mwn(e){return _r("MuiTableHead",e)}Pr("MuiTableHead",["root"]);const Rwn=e=>{const{classes:t}=e;return Un({root:["root"]},Mwn,t)},Own=Bt("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),$wn={variant:"head"},Lke="thead",iU=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTableHead"}),{className:o,component:i=Lke,...s}=r,l={...r,component:i},c=Rwn(l);return a.jsx(pK.Provider,{value:$wn,children:a.jsx(Own,{as:i,className:be(c.root,o),ref:n,role:i===Lke?null:"rowgroup",ownerState:l,...s})})});function Dwn(e){return _r("MuiToolbar",e)}Pr("MuiToolbar",["root","gutters","regular","dense"]);const Lwn=e=>{const{classes:t,disableGutters:n,variant:r}=e;return Un({root:["root",!n&&"gutters",r]},Dwn,t)},Fwn=Bt("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(jr(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),zwn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiToolbar"}),{className:o,component:i="div",disableGutters:s=!1,variant:l="regular",...c}=r,u={...r,component:i,disableGutters:s,variant:l},d=Lwn(u);return a.jsx(Fwn,{as:i,className:be(d.root,o),ref:n,ownerState:u,...c})}),prt=wi(a.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),hrt=wi(a.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));function Bwn(e){return _r("MuiTablePaginationActions",e)}Pr("MuiTablePaginationActions",["root"]);const Hwn=e=>{const{classes:t}=e;return Un({root:["root"]},Bwn,t)},Vwn=Bt("div",{name:"MuiTablePaginationActions",slot:"Root"})({}),Uwn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTablePaginationActions"}),{backIconButtonProps:o,className:i,count:s,disabled:l=!1,getItemAriaLabel:c,nextIconButtonProps:u,onPageChange:d,page:p,rowsPerPage:h,showFirstButton:m,showLastButton:g,slots:y={},slotProps:x={},...v}=r,b=$d(),S=Hwn(r),C=K=>{d(K,0)},N=K=>{d(K,p-1)},j=K=>{d(K,p+1)},I=K=>{d(K,Math.max(0,Math.ceil(s/h)-1))},_=y.firstButton??Zs,T=y.lastButton??Zs,P=y.nextButton??Zs,E=y.previousButton??Zs,M=y.firstButtonIcon??A1n,R=y.lastButtonIcon??T1n,$=y.nextButtonIcon??hrt,D=y.previousButtonIcon??prt,z=b?T:_,V=b?P:E,B=b?E:P,G=b?_:T,H=b?x.lastButton:x.firstButton,F=b?x.nextButton:x.previousButton,W=b?x.previousButton:x.nextButton,U=b?x.firstButton:x.lastButton;return a.jsxs(Vwn,{ref:n,className:be(S.root,i),...v,children:[m&&a.jsx(z,{onClick:C,disabled:l||p===0,"aria-label":c("first",p),title:c("first",p),...H,children:b?a.jsx(R,{...x.lastButtonIcon}):a.jsx(M,{...x.firstButtonIcon})}),a.jsx(V,{onClick:N,disabled:l||p===0,color:"inherit","aria-label":c("previous",p),title:c("previous",p),...F??o,children:b?a.jsx($,{...x.nextButtonIcon}):a.jsx(D,{...x.previousButtonIcon})}),a.jsx(B,{onClick:j,disabled:l||(s!==-1?p>=Math.ceil(s/h)-1:!1),color:"inherit","aria-label":c("next",p),title:c("next",p),...W??u,children:b?a.jsx(D,{...x.previousButtonIcon}):a.jsx($,{...x.nextButtonIcon})}),g&&a.jsx(G,{onClick:I,disabled:l||p>=Math.ceil(s/h)-1,"aria-label":c("last",p),title:c("last",p),...U,children:b?a.jsx(M,{...x.firstButtonIcon}):a.jsx(R,{...x.lastButtonIcon})})]})});function Wwn(e){return _r("MuiTablePagination",e)}const OE=Pr("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var Fke;const Gwn=Bt(Yi,{name:"MuiTablePagination",slot:"Root"})(jr(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),qwn=Bt(zwn,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${OE.actions}`]:t.actions,...t.toolbar})})(jr(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${OE.actions}`]:{flexShrink:0,marginLeft:20}}))),Kwn=Bt("div",{name:"MuiTablePagination",slot:"Spacer"})({flex:"1 1 100%"}),Ywn=Bt("p",{name:"MuiTablePagination",slot:"SelectLabel"})(jr(({theme:e})=>({...e.typography.body2,flexShrink:0}))),Xwn=Bt(S0,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${OE.selectIcon}`]:t.selectIcon,[`& .${OE.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${OE.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),Qwn=Bt(_d,{name:"MuiTablePagination",slot:"MenuItem"})({}),Jwn=Bt("p",{name:"MuiTablePagination",slot:"DisplayedRows"})(jr(({theme:e})=>({...e.typography.body2,flexShrink:0})));function Zwn({from:e,to:t,count:n}){return`${e}–${t} of ${n!==-1?n:`more than ${t}`}`}function eSn(e){return`Go to ${e} page`}const tSn=e=>{const{classes:t}=e;return Un({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},Wwn,t)},nSn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTablePagination"}),{ActionsComponent:o=Uwn,backIconButtonProps:i,colSpan:s,component:l=Yi,count:c,disabled:u=!1,getItemAriaLabel:d=eSn,labelDisplayedRows:p=Zwn,labelRowsPerPage:h="Rows per page:",nextIconButtonProps:m,onPageChange:g,onRowsPerPageChange:y,page:x,rowsPerPage:v,rowsPerPageOptions:b=[10,25,50,100],SelectProps:w={},showFirstButton:S=!1,showLastButton:C=!1,slotProps:N={},slots:j={},...I}=r,_=r,T=tSn(_),P=(N==null?void 0:N.select)??w,E=P.native?"option":Qwn;let M;(l===Yi||l==="td")&&(M=s||1e3);const R=Jo(P.id),$=Jo(P.labelId),D=()=>c===-1?(x+1)*v:v===-1?c:Math.min(c,(x+1)*v),z={slots:j,slotProps:N},[V,B]=mr("root",{ref:n,className:T.root,elementType:Gwn,externalForwardedProps:{...z,component:l,...I},ownerState:_,additionalProps:{colSpan:M}}),[G,H]=mr("toolbar",{className:T.toolbar,elementType:qwn,externalForwardedProps:z,ownerState:_}),[F,W]=mr("spacer",{className:T.spacer,elementType:Kwn,externalForwardedProps:z,ownerState:_}),[U,K]=mr("selectLabel",{className:T.selectLabel,elementType:Ywn,externalForwardedProps:z,ownerState:_,additionalProps:{id:$}}),[X,J]=mr("select",{className:T.select,elementType:Xwn,externalForwardedProps:z,ownerState:_}),[te,re]=mr("menuItem",{className:T.menuItem,elementType:E,externalForwardedProps:z,ownerState:_}),[ce,ae]=mr("displayedRows",{className:T.displayedRows,elementType:Jwn,externalForwardedProps:z,ownerState:_});return a.jsx(V,{...B,children:a.jsxs(G,{...H,children:[a.jsx(F,{...W}),b.length>1&&a.jsx(U,{...K,children:h}),b.length>1&&a.jsx(X,{variant:"standard",...!P.variant&&{input:Fke||(Fke=a.jsx(HL,{}))},value:v,onChange:y,id:R,labelId:$,...P,classes:{...P.classes,root:be(T.input,T.selectRoot,(P.classes||{}).root),select:be(T.select,(P.classes||{}).select),icon:be(T.selectIcon,(P.classes||{}).icon)},disabled:u,...J,children:b.map(oe=>f.createElement(te,{...re,key:oe.label?oe.label:oe,value:oe.value?oe.value:oe},oe.label?oe.label:oe))}),a.jsx(ce,{...ae,children:p({from:c===0?0:x*v+1,to:D(),count:c===-1?-1:c,page:x})}),a.jsx(o,{className:T.actions,backIconButtonProps:i,count:c,nextIconButtonProps:m,onPageChange:g,page:x,rowsPerPage:v,showFirstButton:S,showLastButton:C,slotProps:N.actions,slots:j.actions,getItemAriaLabel:d,disabled:u})]})})});function rSn(e){return _r("MuiTableRow",e)}const zke=Pr("MuiTableRow",["root","selected","hover","head","footer"]),oSn=e=>{const{classes:t,selected:n,hover:r,head:o,footer:i}=e;return Un({root:["root",n&&"selected",r&&"hover",o&&"head",i&&"footer"]},rSn,t)},iSn=Bt("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(jr(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${zke.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${zke.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)}}}))),Bke="tr",$2=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTableRow"}),{className:o,component:i=Bke,hover:s=!1,selected:l=!1,...c}=r,u=f.useContext(pK),d={...r,component:i,hover:s,selected:l,head:u&&u.variant==="head",footer:u&&u.variant==="footer"},p=oSn(d);return a.jsx(iSn,{as:i,ref:n,className:be(p.root,o),role:i===Bke?null:"row",ownerState:d,...c})});function aSn(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function sSn(e,t,n,r={},o=()=>{}){const{ease:i=aSn,duration:s=300}=r;let l=null;const c=t[e];let u=!1;const d=()=>{u=!0},p=h=>{if(u){o(new Error("Animation cancelled"));return}l===null&&(l=h);const m=Math.min(1,(h-l)/s);if(t[e]=i(m)*(n-c)+c,m>=1){requestAnimationFrame(()=>{o(null)});return}requestAnimationFrame(p)};return c===n?(o(new Error("Element already at target position")),d):(requestAnimationFrame(p),d)}const lSn={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function cSn(e){const{onChange:t,...n}=e,r=f.useRef(),o=f.useRef(null),i=()=>{r.current=o.current.offsetHeight-o.current.clientHeight};return Ia(()=>{const s=py(()=>{const c=r.current;i(),c!==r.current&&t(r.current)}),l=pg(o.current);return l.addEventListener("resize",s),()=>{s.clear(),l.removeEventListener("resize",s)}},[t]),f.useEffect(()=>{i(),t(r.current)},[t]),a.jsx("div",{style:lSn,...n,ref:o})}function uSn(e){return _r("MuiTabScrollButton",e)}const dSn=Pr("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),fSn=e=>{const{classes:t,orientation:n,disabled:r}=e;return Un({root:["root",n,r&&"disabled"]},uSn,t)},pSn=Bt(ub,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${dSn.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),hSn=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTabScrollButton"}),{className:o,slots:i={},slotProps:s={},direction:l,orientation:c,disabled:u,...d}=r,p=$d(),h={isRtl:p,...r},m=fSn(h),g=i.StartScrollButtonIcon??prt,y=i.EndScrollButtonIcon??hrt,x=xT({elementType:g,externalSlotProps:s.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:h}),v=xT({elementType:y,externalSlotProps:s.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:h});return a.jsx(pSn,{component:"div",className:be(m.root,o),ref:n,role:null,ownerState:h,tabIndex:null,...d,style:{...d.style,...c==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${p?-90:90}deg)`}},children:l==="left"?a.jsx(g,{...x}):a.jsx(y,{...v})})});function mSn(e){return _r("MuiTabs",e)}const cee=Pr("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Hke=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,Vke=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,_F=(e,t,n)=>{let r=!1,o=n(e,t);for(;o;){if(o===e.firstChild){if(r)return;r=!0}const i=o.disabled||o.getAttribute("aria-disabled")==="true";if(!o.hasAttribute("tabindex")||i)o=n(e,o);else{o.focus();return}}},gSn=e=>{const{vertical:t,fixed:n,hideScrollbar:r,scrollableX:o,scrollableY:i,centered:s,scrollButtonsHideMobile:l,classes:c}=e;return Un({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",o&&"scrollableX",i&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",s&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",l&&"scrollButtonsHideMobile"],scrollableX:[o&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},mSn,c)},xSn=Bt("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${cee.scrollButtons}`]:t.scrollButtons},{[`& .${cee.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(jr(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${cee.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),ySn=Bt("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),vSn=Bt("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.list,t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),bSn=Bt("span",{name:"MuiTabs",slot:"Indicator"})(jr(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),wSn=Bt(cSn)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Uke={},mrt=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTabs"}),o=xf(),i=$d(),{"aria-label":s,"aria-labelledby":l,action:c,centered:u=!1,children:d,className:p,component:h="div",allowScrollButtonsMobile:m=!1,indicatorColor:g="primary",onChange:y,orientation:x="horizontal",ScrollButtonComponent:v,scrollButtons:b="auto",selectionFollowsFocus:w,slots:S={},slotProps:C={},TabIndicatorProps:N={},TabScrollButtonProps:j={},textColor:I="primary",value:_,variant:T="standard",visibleScrollbar:P=!1,...E}=r,M=T==="scrollable",R=x==="vertical",$=R?"scrollTop":"scrollLeft",D=R?"top":"left",z=R?"bottom":"right",V=R?"clientHeight":"clientWidth",B=R?"height":"width",G={...r,component:h,allowScrollButtonsMobile:m,indicatorColor:g,orientation:x,vertical:R,scrollButtons:b,textColor:I,variant:T,visibleScrollbar:P,fixed:!M,hideScrollbar:M&&!P,scrollableX:M&&!R,scrollableY:M&&R,centered:u&&!M,scrollButtonsHideMobile:!m},H=gSn(G),F=xT({elementType:S.StartScrollButtonIcon,externalSlotProps:C.startScrollButtonIcon,ownerState:G}),W=xT({elementType:S.EndScrollButtonIcon,externalSlotProps:C.endScrollButtonIcon,ownerState:G}),[U,K]=f.useState(!1),[X,J]=f.useState(Uke),[te,re]=f.useState(!1),[ce,ae]=f.useState(!1),[oe,ue]=f.useState(!1),[fe,se]=f.useState({overflow:"hidden",scrollbarWidth:0}),ge=new Map,ye=f.useRef(null),de=f.useRef(null),Ne={slots:S,slotProps:{indicator:N,scrollButtons:j,...C}},_e=()=>{const ot=ye.current;let mt;if(ot){const jt=ot.getBoundingClientRect();mt={clientWidth:ot.clientWidth,scrollLeft:ot.scrollLeft,scrollTop:ot.scrollTop,scrollWidth:ot.scrollWidth,top:jt.top,bottom:jt.bottom,left:jt.left,right:jt.right}}let Ht;if(ot&&_!==!1){const jt=de.current.children;if(jt.length>0){const Vt=jt[ge.get(_)];Ht=Vt?Vt.getBoundingClientRect():null}}return{tabsMeta:mt,tabMeta:Ht}},xe=no(()=>{const{tabsMeta:ot,tabMeta:mt}=_e();let Ht=0,jt;R?(jt="top",mt&&ot&&(Ht=mt.top-ot.top+ot.scrollTop)):(jt=i?"right":"left",mt&&ot&&(Ht=(i?-1:1)*(mt[jt]-ot[jt]+ot.scrollLeft)));const Vt={[jt]:Ht,[B]:mt?mt[B]:0};if(typeof X[jt]!="number"||typeof X[B]!="number")J(Vt);else{const nn=Math.abs(X[jt]-Vt[jt]),zt=Math.abs(X[B]-Vt[B]);(nn>=1||zt>=1)&&J(Vt)}}),we=(ot,{animation:mt=!0}={})=>{mt?sSn($,ye.current,ot,{duration:o.transitions.duration.standard}):ye.current[$]=ot},Te=ot=>{let mt=ye.current[$];R?mt+=ot:mt+=ot*(i?-1:1),we(mt)},Re=()=>{const ot=ye.current[V];let mt=0;const Ht=Array.from(de.current.children);for(let jt=0;jtot){jt===0&&(mt=ot);break}mt+=Vt[V]}return mt},Ue=()=>{Te(-1*Re())},He=()=>{Te(Re())},[Ye,{onChange:We,...at}]=mr("scrollbar",{className:be(H.scrollableX,H.hideScrollbar),elementType:wSn,shouldForwardComponentProp:!0,externalForwardedProps:Ne,ownerState:G}),Oe=f.useCallback(ot=>{We==null||We(ot),se({overflow:null,scrollbarWidth:ot})},[We]),[Ae,qe]=mr("scrollButtons",{className:be(H.scrollButtons,j.className),elementType:hSn,externalForwardedProps:Ne,ownerState:G,additionalProps:{orientation:x,slots:{StartScrollButtonIcon:S.startScrollButtonIcon||S.StartScrollButtonIcon,EndScrollButtonIcon:S.endScrollButtonIcon||S.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:F,endScrollButtonIcon:W}}}),dt=()=>{const ot={};ot.scrollbarSizeListener=M?a.jsx(Ye,{...at,onChange:Oe}):null;const Ht=M&&(b==="auto"&&(te||ce)||b===!0);return ot.scrollButtonStart=Ht?a.jsx(Ae,{direction:i?"right":"left",onClick:Ue,disabled:!te,...qe}):null,ot.scrollButtonEnd=Ht?a.jsx(Ae,{direction:i?"left":"right",onClick:He,disabled:!ce,...qe}):null,ot},Ze=no(ot=>{const{tabsMeta:mt,tabMeta:Ht}=_e();if(!(!Ht||!mt)){if(Ht[D]mt[z]){const jt=mt[$]+(Ht[z]-mt[z]);we(jt,{animation:ot})}}}),Qe=no(()=>{M&&b!==!1&&ue(!oe)});f.useEffect(()=>{const ot=py(()=>{ye.current&&xe()});let mt;const Ht=nn=>{nn.forEach(zt=>{zt.removedNodes.forEach(Nn=>{mt==null||mt.unobserve(Nn)}),zt.addedNodes.forEach(Nn=>{mt==null||mt.observe(Nn)})}),ot(),Qe()},jt=pg(ye.current);jt.addEventListener("resize",ot);let Vt;return typeof ResizeObserver<"u"&&(mt=new ResizeObserver(ot),Array.from(de.current.children).forEach(nn=>{mt.observe(nn)})),typeof MutationObserver<"u"&&(Vt=new MutationObserver(Ht),Vt.observe(de.current,{childList:!0})),()=>{ot.clear(),jt.removeEventListener("resize",ot),Vt==null||Vt.disconnect(),mt==null||mt.disconnect()}},[xe,Qe]),f.useEffect(()=>{const ot=Array.from(de.current.children),mt=ot.length;if(typeof IntersectionObserver<"u"&&mt>0&&M&&b!==!1){const Ht=ot[0],jt=ot[mt-1],Vt={root:ye.current,threshold:.99},nn=ur=>{re(!ur[0].isIntersecting)},zt=new IntersectionObserver(nn,Vt);zt.observe(Ht);const Nn=ur=>{ae(!ur[0].isIntersecting)},xr=new IntersectionObserver(Nn,Vt);return xr.observe(jt),()=>{zt.disconnect(),xr.disconnect()}}},[M,b,oe,d==null?void 0:d.length]),f.useEffect(()=>{K(!0)},[]),f.useEffect(()=>{xe()}),f.useEffect(()=>{Ze(Uke!==X)},[Ze,X]),f.useImperativeHandle(c,()=>({updateIndicator:xe,updateScrollButtons:Qe}),[xe,Qe]);const[lt,bt]=mr("indicator",{className:be(H.indicator,N.className),elementType:bSn,externalForwardedProps:Ne,ownerState:G,additionalProps:{style:X}}),Ct=a.jsx(lt,{...bt});let Je=0;const Pe=f.Children.map(d,ot=>{if(!f.isValidElement(ot))return null;const mt=ot.props.value===void 0?Je:ot.props.value;ge.set(mt,Je);const Ht=mt===_;return Je+=1,f.cloneElement(ot,{fullWidth:T==="fullWidth",indicator:Ht&&!U&&Ct,selected:Ht,selectionFollowsFocus:w,onChange:y,textColor:I,value:mt,...Je===1&&_===!1&&!ot.props.tabIndex?{tabIndex:0}:{}})}),Me=ot=>{if(ot.altKey||ot.shiftKey||ot.ctrlKey||ot.metaKey)return;const mt=de.current,Ht=jP(Zl(mt));if((Ht==null?void 0:Ht.getAttribute("role"))!=="tab")return;let Vt=x==="horizontal"?"ArrowLeft":"ArrowUp",nn=x==="horizontal"?"ArrowRight":"ArrowDown";switch(x==="horizontal"&&i&&(Vt="ArrowRight",nn="ArrowLeft"),ot.key){case Vt:ot.preventDefault(),_F(mt,Ht,Vke);break;case nn:ot.preventDefault(),_F(mt,Ht,Hke);break;case"Home":ot.preventDefault(),_F(mt,null,Hke);break;case"End":ot.preventDefault(),_F(mt,null,Vke);break}},et=dt(),[vt,Pt]=mr("root",{ref:n,className:be(H.root,p),elementType:xSn,externalForwardedProps:{...Ne,...E,component:h},ownerState:G}),[Jt,dn]=mr("scroller",{ref:ye,className:H.scroller,elementType:ySn,externalForwardedProps:Ne,ownerState:G,additionalProps:{style:{overflow:fe.overflow,[R?`margin${i?"Left":"Right"}`:"marginBottom"]:P?void 0:-fe.scrollbarWidth}}}),[Et,sn]=mr("list",{ref:de,className:be(H.list,H.flexContainer),elementType:vSn,externalForwardedProps:Ne,ownerState:G,getSlotProps:ot=>({...ot,onKeyDown:mt=>{var Ht;Me(mt),(Ht=ot.onKeyDown)==null||Ht.call(ot,mt)}})});return a.jsxs(vt,{...Pt,children:[et.scrollButtonStart,et.scrollbarSizeListener,a.jsxs(Jt,{...dn,children:[a.jsx(Et,{"aria-label":s,"aria-labelledby":l,"aria-orientation":x==="vertical"?"vertical":null,role:"tablist",...sn,children:Pe}),U&&Ct]}),et.scrollButtonEnd]})});function SSn(e){return _r("MuiTextField",e)}Pr("MuiTextField",["root"]);const CSn={standard:Rxe,filled:Mxe,outlined:Dxe},NSn=e=>{const{classes:t}=e;return Un({root:["root"]},SSn,t)},jSn=Bt(k1,{name:"MuiTextField",slot:"Root"})({}),la=f.forwardRef(function(t,n){const r=Rr({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:i=!1,children:s,className:l,color:c="primary",defaultValue:u,disabled:d=!1,error:p=!1,FormHelperTextProps:h,fullWidth:m=!1,helperText:g,id:y,InputLabelProps:x,inputProps:v,InputProps:b,inputRef:w,label:S,maxRows:C,minRows:N,multiline:j=!1,name:I,onBlur:_,onChange:T,onFocus:P,placeholder:E,required:M=!1,rows:R,select:$=!1,SelectProps:D,slots:z={},slotProps:V={},type:B,value:G,variant:H="outlined",...F}=r,W={...r,autoFocus:i,color:c,disabled:d,error:p,fullWidth:m,multiline:j,required:M,select:$,variant:H},U=NSn(W),K=Jo(y),X=g&&K?`${K}-helper-text`:void 0,J=S&&K?`${K}-label`:void 0,te=CSn[H],re={slots:z,slotProps:{input:b,inputLabel:x,htmlInput:v,formHelperText:h,select:D,...V}},ce={},ae=re.slotProps.inputLabel;H==="outlined"&&(ae&&typeof ae.shrink<"u"&&(ce.notched=ae.shrink),ce.label=S),$&&((!D||!D.native)&&(ce.id=void 0),ce["aria-describedby"]=void 0);const[oe,ue]=mr("root",{elementType:jSn,shouldForwardComponentProp:!0,externalForwardedProps:{...re,...F},ownerState:W,className:be(U.root,l),ref:n,additionalProps:{disabled:d,error:p,fullWidth:m,required:M,color:c,variant:H}}),[fe,se]=mr("input",{elementType:te,externalForwardedProps:re,additionalProps:ce,ownerState:W}),[ge,ye]=mr("inputLabel",{elementType:O2,externalForwardedProps:re,ownerState:W}),[de,Ne]=mr("htmlInput",{elementType:"input",externalForwardedProps:re,ownerState:W}),[_e,xe]=mr("formHelperText",{elementType:lbn,externalForwardedProps:re,ownerState:W}),[we,Te]=mr("select",{elementType:S0,externalForwardedProps:re,ownerState:W}),Re=a.jsx(fe,{"aria-describedby":X,autoComplete:o,autoFocus:i,defaultValue:u,fullWidth:m,multiline:j,name:I,rows:R,maxRows:C,minRows:N,type:B,value:G,id:K,inputRef:w,onBlur:_,onChange:T,onFocus:P,placeholder:E,inputProps:Ne,slots:{input:z.htmlInput?de:void 0},...se});return a.jsxs(oe,{...ue,children:[S!=null&&S!==""&&a.jsx(ge,{htmlFor:K,id:J,...ye,children:S}),$?a.jsx(we,{"aria-describedby":X,id:K,labelId:J,value:G,input:Re,...Te,children:s}):Re,g&&a.jsx(_e,{id:X,...xe,children:g})]})});function ESn(e){return _r("MuiToggleButton",e)}const uee=Pr("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),ISn=f.createContext({}),_Sn=f.createContext(void 0);function PSn(e,t){return t===void 0||e===void 0?!1:Array.isArray(t)?t.includes(e):e===t}const ASn=e=>{const{classes:t,fullWidth:n,selected:r,disabled:o,size:i,color:s}=e,l={root:["root",r&&"selected",o&&"disabled",n&&"fullWidth",`size${vn(i)}`,s]};return Un(l,ESn,t)},TSn=Bt(ub,{name:"MuiToggleButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`size${vn(n.size)}`]]}})(jr(({theme:e})=>({...e.typography.button,borderRadius:(e.vars||e).shape.borderRadius,padding:11,border:`1px solid ${(e.vars||e).palette.divider}`,color:(e.vars||e).palette.action.active,[`&.${uee.disabled}`]:{color:(e.vars||e).palette.action.disabled,border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${uee.selected}`]:{color:(e.vars||e).palette.text.primary,backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.selectedOpacity)}}}}},...Object.entries(e.palette).filter(ul()).map(([t])=>({props:{color:t},style:{[`&.${uee.selected}`]:{color:(e.vars||e).palette[t].main,backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:e.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:e.typography.pxToRem(15)}}]}))),kSn=f.forwardRef(function(t,n){const{value:r,...o}=f.useContext(ISn),i=f.useContext(_Sn),s=eI({...o,selected:PSn(t.value,r)},t),l=Rr({props:s,name:"MuiToggleButton"}),{children:c,className:u,color:d="standard",disabled:p=!1,disableFocusRipple:h=!1,fullWidth:m=!1,onChange:g,onClick:y,selected:x,size:v="medium",value:b,...w}=l,S={...l,color:d,disabled:p,disableFocusRipple:h,fullWidth:m,size:v},C=ASn(S),N=I=>{y&&(y(I,b),I.defaultPrevented)||g&&g(I,b)},j=i||"";return a.jsx(TSn,{className:be(o.className,C.root,u,j),disabled:p,focusRipple:!h,ref:n,onClick:N,onChange:g,value:b,ownerState:S,"aria-pressed":x,...w,children:c})}),MSn=wi(a.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),RSn=wi(a.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"})),OSn=wi(a.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-5h2zm4 0h-2v-3h2zm0-5h-2v-2h2zm4 5h-2V7h2z"})),Wke=wi(a.jsx("path",{d:"m19 9 1.25-2.75L23 5l-2.75-1.25L19 1l-1.25 2.75L15 5l2.75 1.25zm-7.5.5L9 4 6.5 9.5 1 12l5.5 2.5L9 20l2.5-5.5L17 12zM19 15l-1.25 2.75L15 19l2.75 1.25L19 23l1.25-2.75L23 19l-2.75-1.25z"})),$Sn=wi(a.jsx("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H6l-2 2V4h16z"})),DSn=wi(a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"})),LSn=wi(a.jsx("path",{d:"M16.59 7.58 10 14.17l-3.59-3.58L5 12l5 5 8-8zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),Fxe=wi(a.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),FSn=wi(a.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"})),zSn=wi(a.jsx("path",{d:"M18.92 6.01C18.72 5.42 18.16 5 17.5 5h-11c-.66 0-1.21.42-1.42 1.01L3 12v8c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-1h12v1c0 .55.45 1 1 1h1c.55 0 1-.45 1-1v-8zM6.5 16c-.83 0-1.5-.67-1.5-1.5S5.67 13 6.5 13s1.5.67 1.5 1.5S7.33 16 6.5 16m11 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5M5 11l1.5-4.5h11L19 11z"})),dee=wi(a.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),BSn=wi(a.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"})),HSn=wi(a.jsx("path",{d:"M17.81 4.47c-.08 0-.16-.02-.23-.06C15.66 3.42 14 3 12.01 3c-1.98 0-3.86.47-5.57 1.41-.24.13-.54.04-.68-.2-.13-.24-.04-.55.2-.68C7.82 2.52 9.86 2 12.01 2c2.13 0 3.99.47 6.03 1.52.25.13.34.43.21.67-.09.18-.26.28-.44.28M3.5 9.72c-.1 0-.2-.03-.29-.09-.23-.16-.28-.47-.12-.7.99-1.4 2.25-2.5 3.75-3.27C9.98 4.04 14 4.03 17.15 5.65c1.5.77 2.76 1.86 3.75 3.25.16.22.11.54-.12.7s-.54.11-.7-.12c-.9-1.26-2.04-2.25-3.39-2.94-2.87-1.47-6.54-1.47-9.4.01-1.36.7-2.5 1.7-3.4 2.96-.08.14-.23.21-.39.21m6.25 12.07c-.13 0-.26-.05-.35-.15-.87-.87-1.34-1.43-2.01-2.64-.69-1.23-1.05-2.73-1.05-4.34 0-2.97 2.54-5.39 5.66-5.39s5.66 2.42 5.66 5.39c0 .28-.22.5-.5.5s-.5-.22-.5-.5c0-2.42-2.09-4.39-4.66-4.39s-4.66 1.97-4.66 4.39c0 1.44.32 2.77.93 3.85.64 1.15 1.08 1.64 1.85 2.42.19.2.19.51 0 .71-.11.1-.24.15-.37.15m7.17-1.85c-1.19 0-2.24-.3-3.1-.89-1.49-1.01-2.38-2.65-2.38-4.39 0-.28.22-.5.5-.5s.5.22.5.5c0 1.41.72 2.74 1.94 3.56.71.48 1.54.71 2.54.71.24 0 .64-.03 1.04-.1.27-.05.53.13.58.41.05.27-.13.53-.41.58-.57.11-1.07.12-1.21.12M14.91 22c-.04 0-.09-.01-.13-.02-1.59-.44-2.63-1.03-3.72-2.1-1.4-1.39-2.17-3.24-2.17-5.22 0-1.62 1.38-2.94 3.08-2.94s3.08 1.32 3.08 2.94c0 1.07.93 1.94 2.08 1.94s2.08-.87 2.08-1.94c0-3.77-3.25-6.83-7.25-6.83-2.84 0-5.44 1.58-6.61 4.03-.39.81-.59 1.76-.59 2.8 0 .78.07 2.01.67 3.61.1.26-.03.55-.29.64-.26.1-.55-.04-.64-.29-.49-1.31-.73-2.61-.73-3.96 0-1.2.23-2.29.68-3.24 1.33-2.79 4.28-4.6 7.51-4.6 4.55 0 8.25 3.51 8.25 7.83 0 1.62-1.38 2.94-3.08 2.94s-3.08-1.32-3.08-2.94c0-1.07-.93-1.94-2.08-1.94s-2.08.87-2.08 1.94c0 1.71.66 3.31 1.87 4.51.95.94 1.86 1.46 3.27 1.85.27.07.42.35.35.61-.05.23-.26.38-.47.38"})),VSn=wi(a.jsx("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z"})),USn=wi(a.jsx("path",{d:"M19 3h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-.14 0-.27.01-.4.04-.39.08-.74.28-1.01.55-.18.18-.33.4-.43.64-.1.23-.16.49-.16.77v14c0 .27.06.54.16.78s.25.45.43.64c.27.27.62.47 1.01.55.13.02.26.03.4.03h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-8 11.17-1.41 1.42L6 12l3.59-3.59L11 9.83 8.83 12zm1-9.92c-.41 0-.75-.34-.75-.75s.34-.75.75-.75.75.34.75.75-.34.75-.75.75m2.41 11.34L13 14.17 15.17 12 13 9.83l1.41-1.42L18 12z"})),WSn=wi(a.jsx("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z"})),GSn=wi([a.jsx("path",{d:"M13 8.57c-.79 0-1.43.64-1.43 1.43s.64 1.43 1.43 1.43 1.43-.64 1.43-1.43-.64-1.43-1.43-1.43"},"0"),a.jsx("path",{d:"M13 3C9.25 3 6.2 5.94 6.02 9.64L4.1 12.2c-.25.33-.01.8.4.8H6v3c0 1.1.9 2 2 2h1v3h7v-4.68c2.36-1.12 4-3.53 4-6.32 0-3.87-3.13-7-7-7m3 7c0 .13-.01.26-.02.39l.83.66c.08.06.1.16.05.25l-.8 1.39c-.05.09-.16.12-.24.09l-.99-.4c-.21.16-.43.29-.67.39L14 13.83c-.01.1-.1.17-.2.17h-1.6c-.1 0-.18-.07-.2-.17l-.15-1.06c-.25-.1-.47-.23-.68-.39l-.99.4c-.09.03-.2 0-.25-.09l-.8-1.39c-.05-.08-.03-.19.05-.25l.84-.66c-.01-.13-.02-.26-.02-.39s.02-.27.04-.39l-.85-.66c-.08-.06-.1-.16-.05-.26l.8-1.38c.05-.09.15-.12.24-.09l1 .4c.2-.15.43-.29.67-.39L12 6.17c.02-.1.1-.17.2-.17h1.6c.1 0 .18.07.2.17l.15 1.06c.24.1.46.23.67.39l1-.4c.09-.03.2 0 .24.09l.8 1.38c.05.09.03.2-.05.26l-.85.66c.03.12.04.25.04.39"},"1")]),qSn=wi(a.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"})),KSn=wi(a.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"})),zxe=wi(a.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11z"})),grt=wi(a.jsx("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"})),YSn=wi(a.jsx("path",{d:"M12 2 4 5v6.09c0 5.05 3.41 9.76 8 10.91 4.59-1.15 8-5.86 8-10.91V5zm3.97 12.41c-1.84 2.17-5.21 2.1-6.96-.07-2.19-2.72-.65-6.72 2.69-7.33.34-.06.63.27.51.6-.46 1.23-.39 2.64.32 3.86s1.89 1.99 3.18 2.2c.34.05.49.47.26.74"})),Gke=wi(a.jsx("path",{d:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3M7.5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S9.83 13 9 13s-1.5-.67-1.5-1.5M16 17H8v-2h8zm-1-4c-.83 0-1.5-.67-1.5-1.5S14.17 10 15 10s1.5.67 1.5 1.5S15.83 13 15 13"})),XSn=wi(a.jsx("path",{d:"m20.38 8.57-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83"})),QSn=wi(a.jsx("path",{d:"M20 4H4c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2m0 14H4V8h16zm-2-1h-6v-2h6zM7.5 17l-1.41-1.41L8.67 13l-2.59-2.59L7.5 9l4 4z"})),JSn=wi(a.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"})),ZSn=wi(a.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"})),xrt=6048e5,e2n=864e5,VL=6e4,UL=36e5,t2n=1e3,qke=Symbol.for("constructDateFrom");function mu(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&qke in e?e[qke](t):e instanceof Date?new e.constructor(t):new Date(t)}function gi(e,t){return mu(t||e,e)}function hK(e,t,n){const r=gi(e,n==null?void 0:n.in);return isNaN(t)?mu((n==null?void 0:n.in)||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Bxe(e,t,n){const r=gi(e,n==null?void 0:n.in);if(isNaN(t))return mu(e,NaN);if(!t)return r;const o=r.getDate(),i=mu(e,r.getTime());i.setMonth(r.getMonth()+t+1,0);const s=i.getDate();return o>=s?i:(r.setFullYear(i.getFullYear(),i.getMonth(),o),r)}function Hxe(e,t,n){return mu(e,+gi(e)+t)}function n2n(e,t,n){return Hxe(e,t*UL)}let r2n={};function s5(){return r2n}function fb(e,t){var l,c,u,d;const n=s5(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,o=gi(e,t==null?void 0:t.in),i=o.getDay(),s=(i=i.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function aU(e){const t=gi(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function l5(e,...t){const n=mu.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function Nse(e,t){const n=gi(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function vrt(e,t,n){const[r,o]=l5(n==null?void 0:n.in,e,t),i=Nse(r),s=Nse(o),l=+i-aU(i),c=+s-aU(s);return Math.round((l-c)/e2n)}function o2n(e,t){const n=yrt(e,t),r=mu(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),CT(r)}function i2n(e,t,n){const r=gi(e,n==null?void 0:n.in);return r.setTime(r.getTime()+t*VL),r}function a2n(e,t,n){return Bxe(e,t*3,n)}function s2n(e,t,n){return Hxe(e,t*1e3)}function l2n(e,t,n){return hK(e,t*7,n)}function c2n(e,t,n){return Bxe(e,t*12,n)}function mO(e,t){const n=+gi(e)-+gi(t);return n<0?-1:n>0?1:n}function u2n(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function brt(e){return!(!u2n(e)&&typeof e!="number"||isNaN(+gi(e)))}function d2n(e,t,n){const[r,o]=l5(n==null?void 0:n.in,e,t),i=r.getFullYear()-o.getFullYear(),s=r.getMonth()-o.getMonth();return i*12+s}function f2n(e,t,n){const[r,o]=l5(n==null?void 0:n.in,e,t);return r.getFullYear()-o.getFullYear()}function wrt(e,t,n){const[r,o]=l5(n==null?void 0:n.in,e,t),i=Kke(r,o),s=Math.abs(vrt(r,o));r.setDate(r.getDate()-i*s);const l=+(Kke(r,o)===-i),c=i*(s-l);return c===0?0:c}function Kke(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function WL(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function p2n(e,t,n){const[r,o]=l5(n==null?void 0:n.in,e,t),i=(+r-+o)/UL;return WL(n==null?void 0:n.roundingMethod)(i)}function Vxe(e,t){return+gi(e)-+gi(t)}function h2n(e,t,n){const r=Vxe(e,t)/VL;return WL(n==null?void 0:n.roundingMethod)(r)}function Srt(e,t){const n=gi(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function Crt(e,t){const n=gi(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function m2n(e,t){const n=gi(e,t==null?void 0:t.in);return+Srt(n,t)==+Crt(n,t)}function Nrt(e,t,n){const[r,o,i]=l5(n==null?void 0:n.in,e,e,t),s=mO(o,i),l=Math.abs(d2n(o,i));if(l<1)return 0;o.getMonth()===1&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-s*l);let c=mO(o,i)===-s;m2n(r)&&l===1&&mO(r,i)===1&&(c=!1);const u=s*(l-+c);return u===0?0:u}function g2n(e,t,n){const r=Nrt(e,t,n)/3;return WL(n==null?void 0:n.roundingMethod)(r)}function x2n(e,t,n){const r=Vxe(e,t)/1e3;return WL(n==null?void 0:n.roundingMethod)(r)}function y2n(e,t,n){const r=wrt(e,t,n)/7;return WL(n==null?void 0:n.roundingMethod)(r)}function v2n(e,t,n){const[r,o]=l5(n==null?void 0:n.in,e,t),i=mO(r,o),s=Math.abs(f2n(r,o));r.setFullYear(1584),o.setFullYear(1584);const l=mO(r,o)===-i,c=i*(s-+l);return c===0?0:c}function b2n(e,t){const n=gi(e,t==null?void 0:t.in),r=n.getMonth(),o=r-r%3;return n.setMonth(o,1),n.setHours(0,0,0,0),n}function w2n(e,t){const n=gi(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function S2n(e,t){const n=gi(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function jrt(e,t){const n=gi(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function C2n(e,t){const n=gi(e,t==null?void 0:t.in);return n.setMinutes(59,59,999),n}function N2n(e,t){var l,c;const n=s5(),r=n.weekStartsOn??((c=(l=n.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??0,o=gi(e,t==null?void 0:t.in),i=o.getDay(),s=(i{let r;const o=_2n[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function fee(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const A2n={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},T2n={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},k2n={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},M2n={date:fee({formats:A2n,defaultWidth:"full"}),time:fee({formats:T2n,defaultWidth:"full"}),dateTime:fee({formats:k2n,defaultWidth:"full"})},R2n={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},O2n=(e,t,n,r)=>R2n[e];function pM(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):s;o=e.formattingValues[l]||e.formattingValues[s]}else{const s=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[l]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const $2n={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},D2n={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},L2n={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},F2n={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},z2n={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},B2n={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},H2n=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},V2n={ordinalNumber:H2n,era:pM({values:$2n,defaultWidth:"wide"}),quarter:pM({values:D2n,defaultWidth:"wide",argumentCallback:e=>e-1}),month:pM({values:L2n,defaultWidth:"wide"}),day:pM({values:F2n,defaultWidth:"wide"}),dayPeriod:pM({values:z2n,defaultWidth:"wide",formattingValues:B2n,defaultFormattingWidth:"wide"})};function hM(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?W2n(l,p=>p.test(s)):U2n(l,p=>p.test(s));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(s.length);return{value:u,rest:d}}}function U2n(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function W2n(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const l=t.slice(o.length);return{value:s,rest:l}}}const q2n=/^(\d+)(th|st|nd|rd)?/i,K2n=/\d+/i,Y2n={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},X2n={any:[/^b/i,/^(a|c)/i]},Q2n={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},J2n={any:[/1/i,/2/i,/3/i,/4/i]},Z2n={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},eCn={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},tCn={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},nCn={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},rCn={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},oCn={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},iCn={ordinalNumber:G2n({matchPattern:q2n,parsePattern:K2n,valueCallback:e=>parseInt(e,10)}),era:hM({matchPatterns:Y2n,defaultMatchWidth:"wide",parsePatterns:X2n,defaultParseWidth:"any"}),quarter:hM({matchPatterns:Q2n,defaultMatchWidth:"wide",parsePatterns:J2n,defaultParseWidth:"any",valueCallback:e=>e+1}),month:hM({matchPatterns:Z2n,defaultMatchWidth:"wide",parsePatterns:eCn,defaultParseWidth:"any"}),day:hM({matchPatterns:tCn,defaultMatchWidth:"wide",parsePatterns:nCn,defaultParseWidth:"any"}),dayPeriod:hM({matchPatterns:rCn,defaultMatchWidth:"any",parsePatterns:oCn,defaultParseWidth:"any"})},Ert={code:"en-US",formatDistance:P2n,formatLong:M2n,formatRelative:O2n,localize:V2n,match:iCn,options:{weekStartsOn:0,firstWeekContainsDate:1}};function aCn(e,t){const n=gi(e,t==null?void 0:t.in);return vrt(n,jrt(n))+1}function Irt(e,t){const n=gi(e,t==null?void 0:t.in),r=+CT(n)-+o2n(n);return Math.round(r/xrt)+1}function Uxe(e,t){var d,p,h,m;const n=gi(e,t==null?void 0:t.in),r=n.getFullYear(),o=s5(),i=(t==null?void 0:t.firstWeekContainsDate)??((p=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:p.firstWeekContainsDate)??o.firstWeekContainsDate??((m=(h=o.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,s=mu((t==null?void 0:t.in)||e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const l=fb(s,t),c=mu((t==null?void 0:t.in)||e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const u=fb(c,t);return+n>=+l?r+1:+n>=+u?r:r-1}function sCn(e,t){var l,c,u,d;const n=s5(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,o=Uxe(e,t),i=mu((t==null?void 0:t.in)||e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),fb(i,t)}function _rt(e,t){const n=gi(e,t==null?void 0:t.in),r=+fb(n,t)-+sCn(n,t);return Math.round(r/xrt)+1}function $s(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const PS={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return $s(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):$s(n+1,2)},d(e,t){return $s(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return $s(e.getHours()%12||12,t.length)},H(e,t){return $s(e.getHours(),t.length)},m(e,t){return $s(e.getMinutes(),t.length)},s(e,t){return $s(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return $s(o,t.length)}},l_={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Yke={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return PS.y(e,t)},Y:function(e,t,n,r){const o=Uxe(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return $s(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):$s(i,t.length)},R:function(e,t){const n=yrt(e);return $s(n,t.length)},u:function(e,t){const n=e.getFullYear();return $s(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return $s(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return $s(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return PS.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return $s(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=_rt(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):$s(o,t.length)},I:function(e,t,n){const r=Irt(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):$s(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):PS.d(e,t)},D:function(e,t,n){const r=aCn(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):$s(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return $s(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return $s(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return $s(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=l_.noon:r===0?o=l_.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=l_.evening:r>=12?o=l_.afternoon:r>=4?o=l_.morning:o=l_.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return PS.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):PS.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):$s(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):$s(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):PS.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):PS.s(e,t)},S:function(e,t){return PS.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Qke(r);case"XXXX":case"XX":return bj(r);case"XXXXX":case"XXX":default:return bj(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Qke(r);case"xxxx":case"xx":return bj(r);case"xxxxx":case"xxx":default:return bj(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Xke(r,":");case"OOOO":default:return"GMT"+bj(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Xke(r,":");case"zzzz":default:return"GMT"+bj(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return $s(r,t.length)},T:function(e,t,n){return $s(+e,t.length)}};function Xke(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+$s(i,2)}function Qke(e,t){return e%60===0?(e>0?"-":"+")+$s(Math.abs(e)/60,2):bj(e,t)}function bj(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=$s(Math.trunc(r/60),2),i=$s(r%60,2);return n+o+t+i}const Jke=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Prt=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},lCn=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return Jke(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",Jke(r,t)).replace("{{time}}",Prt(o,t))},jse={p:Prt,P:lCn},cCn=/^D+$/,uCn=/^Y+$/,dCn=["D","DD","YY","YYYY"];function Art(e){return cCn.test(e)}function Trt(e){return uCn.test(e)}function Ese(e,t,n){const r=fCn(e,t,n);if(console.warn(r),dCn.includes(e))throw new RangeError(r)}function fCn(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const pCn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,hCn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,mCn=/^'([^]*?)'?$/,gCn=/''/g,xCn=/[a-zA-Z]/;function $E(e,t,n){var d,p,h,m,g,y,x,v;const r=s5(),o=(n==null?void 0:n.locale)??r.locale??Ert,i=(n==null?void 0:n.firstWeekContainsDate)??((p=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:p.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((y=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:y.weekStartsOn)??r.weekStartsOn??((v=(x=r.locale)==null?void 0:x.options)==null?void 0:v.weekStartsOn)??0,l=gi(e,n==null?void 0:n.in);if(!brt(l))throw new RangeError("Invalid time value");let c=t.match(hCn).map(b=>{const w=b[0];if(w==="p"||w==="P"){const S=jse[w];return S(b,o.formatLong)}return b}).join("").match(pCn).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const w=b[0];if(w==="'")return{isToken:!1,value:yCn(b)};if(Yke[w])return{isToken:!0,value:b};if(w.match(xCn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:b}});o.localize.preprocessor&&(c=o.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return c.map(b=>{if(!b.isToken)return b.value;const w=b.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Trt(w)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Art(w))&&Ese(w,t,String(e));const S=Yke[w[0]];return S(l,w,o.localize,u)}).join("")}function yCn(e){const t=e.match(mCn);return t?t[1].replace(gCn,"'"):e}function vCn(){return Object.assign({},s5())}function bCn(e,t){const n=gi(e,t==null?void 0:t.in).getDay();return n===0?7:n}function wCn(e,t){const n=SCn(t)?new t(0):mu(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function SCn(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const CCn=10;class krt{constructor(){ze(this,"subPriority",0)}validate(t,n){return!0}}class NCn extends krt{constructor(t,n,r,o,i){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=o,i&&(this.subPriority=i)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class jCn extends krt{constructor(n,r){super();ze(this,"priority",CCn);ze(this,"subPriority",-1);this.context=n||(o=>mu(r,o))}set(n,r){return r.timestampIsSet?n:mu(n,wCn(n,this.context))}}class ps{run(t,n,r,o){const i=this.parse(t,n,r,o);return i?{setter:new NCn(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(t,n,r){return!0}}class ECn extends ps{constructor(){super(...arguments);ze(this,"priority",140);ze(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,o){switch(r){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})||o.era(n,{width:"abbreviated"})||o.era(n,{width:"narrow"})}}set(n,r,o){return r.era=o,n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}const Ru={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Iv={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Ou(e,t){return e&&{value:t(e.value),rest:e.rest}}function Rc(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function _v(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,o=n[2]?parseInt(n[2],10):0,i=n[3]?parseInt(n[3],10):0,s=n[5]?parseInt(n[5],10):0;return{value:r*(o*UL+i*VL+s*t2n),rest:t.slice(n[0].length)}}function Mrt(e){return Rc(Ru.anyDigitsSigned,e)}function gu(e,t){switch(e){case 1:return Rc(Ru.singleDigit,t);case 2:return Rc(Ru.twoDigits,t);case 3:return Rc(Ru.threeDigits,t);case 4:return Rc(Ru.fourDigits,t);default:return Rc(new RegExp("^\\d{1,"+e+"}"),t)}}function sU(e,t){switch(e){case 1:return Rc(Ru.singleDigitSigned,t);case 2:return Rc(Ru.twoDigitsSigned,t);case 3:return Rc(Ru.threeDigitsSigned,t);case 4:return Rc(Ru.fourDigitsSigned,t);default:return Rc(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Wxe(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Rrt(e,t){const n=t>0,r=n?t:1-t;let o;if(r<=50)o=e||100;else{const i=r+50,s=Math.trunc(i/100)*100,l=e>=i%100;o=e+s-(l?100:0)}return n?o:1-o}function Ort(e){return e%400===0||e%4===0&&e%100!==0}class ICn extends ps{constructor(){super(...arguments);ze(this,"priority",130);ze(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,o){const i=s=>({year:s,isTwoDigitYear:r==="yy"});switch(r){case"y":return Ou(gu(4,n),i);case"yo":return Ou(o.ordinalNumber(n,{unit:"year"}),i);default:return Ou(gu(r.length,n),i)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o){const i=n.getFullYear();if(o.isTwoDigitYear){const l=Rrt(o.year,i);return n.setFullYear(l,0,1),n.setHours(0,0,0,0),n}const s=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(s,0,1),n.setHours(0,0,0,0),n}}class _Cn extends ps{constructor(){super(...arguments);ze(this,"priority",130);ze(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,o){const i=s=>({year:s,isTwoDigitYear:r==="YY"});switch(r){case"Y":return Ou(gu(4,n),i);case"Yo":return Ou(o.ordinalNumber(n,{unit:"year"}),i);default:return Ou(gu(r.length,n),i)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,o,i){const s=Uxe(n,i);if(o.isTwoDigitYear){const c=Rrt(o.year,s);return n.setFullYear(c,0,i.firstWeekContainsDate),n.setHours(0,0,0,0),fb(n,i)}const l=!("era"in r)||r.era===1?o.year:1-o.year;return n.setFullYear(l,0,i.firstWeekContainsDate),n.setHours(0,0,0,0),fb(n,i)}}class PCn extends ps{constructor(){super(...arguments);ze(this,"priority",130);ze(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return sU(r==="R"?4:r.length,n)}set(n,r,o){const i=mu(n,0);return i.setFullYear(o,0,4),i.setHours(0,0,0,0),CT(i)}}class ACn extends ps{constructor(){super(...arguments);ze(this,"priority",130);ze(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return sU(r==="u"?4:r.length,n)}set(n,r,o){return n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}}class TCn extends ps{constructor(){super(...arguments);ze(this,"priority",120);ze(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"Q":case"QQ":return gu(r.length,n);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})||o.quarter(n,{width:"abbreviated",context:"formatting"})||o.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class kCn extends ps{constructor(){super(...arguments);ze(this,"priority",120);ze(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"q":case"qq":return gu(r.length,n);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})||o.quarter(n,{width:"abbreviated",context:"standalone"})||o.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,o){return n.setMonth((o-1)*3,1),n.setHours(0,0,0,0),n}}class MCn extends ps{constructor(){super(...arguments);ze(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);ze(this,"priority",110)}parse(n,r,o){const i=s=>s-1;switch(r){case"M":return Ou(Rc(Ru.month,n),i);case"MM":return Ou(gu(2,n),i);case"Mo":return Ou(o.ordinalNumber(n,{unit:"month"}),i);case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})||o.month(n,{width:"abbreviated",context:"formatting"})||o.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}class RCn extends ps{constructor(){super(...arguments);ze(this,"priority",110);ze(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,o){const i=s=>s-1;switch(r){case"L":return Ou(Rc(Ru.month,n),i);case"LL":return Ou(gu(2,n),i);case"Lo":return Ou(o.ordinalNumber(n,{unit:"month"}),i);case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})||o.month(n,{width:"abbreviated",context:"standalone"})||o.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.setMonth(o,1),n.setHours(0,0,0,0),n}}function OCn(e,t,n){const r=gi(e,n==null?void 0:n.in),o=_rt(r,n)-t;return r.setDate(r.getDate()-o*7),gi(r,n==null?void 0:n.in)}class $Cn extends ps{constructor(){super(...arguments);ze(this,"priority",100);ze(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,o){switch(r){case"w":return Rc(Ru.week,n);case"wo":return o.ordinalNumber(n,{unit:"week"});default:return gu(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o,i){return fb(OCn(n,o,i),i)}}function DCn(e,t,n){const r=gi(e,n==null?void 0:n.in),o=Irt(r,n)-t;return r.setDate(r.getDate()-o*7),r}class LCn extends ps{constructor(){super(...arguments);ze(this,"priority",100);ze(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,o){switch(r){case"I":return Rc(Ru.week,n);case"Io":return o.ordinalNumber(n,{unit:"week"});default:return gu(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,o){return CT(DCn(n,o))}}const FCn=[31,28,31,30,31,30,31,31,30,31,30,31],zCn=[31,29,31,30,31,30,31,31,30,31,30,31];class BCn extends ps{constructor(){super(...arguments);ze(this,"priority",90);ze(this,"subPriority",1);ze(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"d":return Rc(Ru.date,n);case"do":return o.ordinalNumber(n,{unit:"date"});default:return gu(r.length,n)}}validate(n,r){const o=n.getFullYear(),i=Ort(o),s=n.getMonth();return i?r>=1&&r<=zCn[s]:r>=1&&r<=FCn[s]}set(n,r,o){return n.setDate(o),n.setHours(0,0,0,0),n}}class HCn extends ps{constructor(){super(...arguments);ze(this,"priority",90);ze(this,"subpriority",1);ze(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,o){switch(r){case"D":case"DD":return Rc(Ru.dayOfYear,n);case"Do":return o.ordinalNumber(n,{unit:"date"});default:return gu(r.length,n)}}validate(n,r){const o=n.getFullYear();return Ort(o)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,o){return n.setMonth(0,o),n.setHours(0,0,0,0),n}}function Gxe(e,t,n){var p,h,m,g;const r=s5(),o=(n==null?void 0:n.weekStartsOn)??((h=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??r.weekStartsOn??((g=(m=r.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,i=gi(e,n==null?void 0:n.in),s=i.getDay(),c=(t%7+7)%7,u=7-o,d=t<0||t>6?t-(s+u)%7:(c+u)%7-(s+u)%7;return hK(i,d,n)}class VCn extends ps{constructor(){super(...arguments);ze(this,"priority",90);ze(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,o){switch(r){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,i){return n=Gxe(n,o,i),n.setHours(0,0,0,0),n}}class UCn extends ps{constructor(){super(...arguments);ze(this,"priority",90);ze(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,o,i){const s=l=>{const c=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+c};switch(r){case"e":case"ee":return Ou(gu(r.length,n),s);case"eo":return Ou(o.ordinalNumber(n,{unit:"day"}),s);case"eee":return o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeeee":return o.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,i){return n=Gxe(n,o,i),n.setHours(0,0,0,0),n}}class WCn extends ps{constructor(){super(...arguments);ze(this,"priority",90);ze(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,o,i){const s=l=>{const c=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+c};switch(r){case"c":case"cc":return Ou(gu(r.length,n),s);case"co":return Ou(o.ordinalNumber(n,{unit:"day"}),s);case"ccc":return o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"ccccc":return o.day(n,{width:"narrow",context:"standalone"});case"cccccc":return o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return o.day(n,{width:"wide",context:"standalone"})||o.day(n,{width:"abbreviated",context:"standalone"})||o.day(n,{width:"short",context:"standalone"})||o.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,o,i){return n=Gxe(n,o,i),n.setHours(0,0,0,0),n}}function GCn(e,t,n){const r=gi(e,n==null?void 0:n.in),o=bCn(r,n),i=t-o;return hK(r,i,n)}class qCn extends ps{constructor(){super(...arguments);ze(this,"priority",90);ze(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,o){const i=s=>s===0?7:s;switch(r){case"i":case"ii":return gu(r.length,n);case"io":return o.ordinalNumber(n,{unit:"day"});case"iii":return Ou(o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),i);case"iiiii":return Ou(o.day(n,{width:"narrow",context:"formatting"}),i);case"iiiiii":return Ou(o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),i);case"iiii":default:return Ou(o.day(n,{width:"wide",context:"formatting"})||o.day(n,{width:"abbreviated",context:"formatting"})||o.day(n,{width:"short",context:"formatting"})||o.day(n,{width:"narrow",context:"formatting"}),i)}}validate(n,r){return r>=1&&r<=7}set(n,r,o){return n=GCn(n,o),n.setHours(0,0,0,0),n}}class KCn extends ps{constructor(){super(...arguments);ze(this,"priority",80);ze(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,o){switch(r){case"a":case"aa":case"aaa":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(Wxe(o),0,0,0),n}}class YCn extends ps{constructor(){super(...arguments);ze(this,"priority",80);ze(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,o){switch(r){case"b":case"bb":case"bbb":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(Wxe(o),0,0,0),n}}class XCn extends ps{constructor(){super(...arguments);ze(this,"priority",80);ze(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,o){switch(r){case"B":case"BB":case"BBB":return o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return o.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(n,{width:"wide",context:"formatting"})||o.dayPeriod(n,{width:"abbreviated",context:"formatting"})||o.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,o){return n.setHours(Wxe(o),0,0,0),n}}class QCn extends ps{constructor(){super(...arguments);ze(this,"priority",70);ze(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,o){switch(r){case"h":return Rc(Ru.hour12h,n);case"ho":return o.ordinalNumber(n,{unit:"hour"});default:return gu(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,o){const i=n.getHours()>=12;return i&&o<12?n.setHours(o+12,0,0,0):!i&&o===12?n.setHours(0,0,0,0):n.setHours(o,0,0,0),n}}class JCn extends ps{constructor(){super(...arguments);ze(this,"priority",70);ze(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,o){switch(r){case"H":return Rc(Ru.hour23h,n);case"Ho":return o.ordinalNumber(n,{unit:"hour"});default:return gu(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,o){return n.setHours(o,0,0,0),n}}class ZCn extends ps{constructor(){super(...arguments);ze(this,"priority",70);ze(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,o){switch(r){case"K":return Rc(Ru.hour11h,n);case"Ko":return o.ordinalNumber(n,{unit:"hour"});default:return gu(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,o){return n.getHours()>=12&&o<12?n.setHours(o+12,0,0,0):n.setHours(o,0,0,0),n}}class eNn extends ps{constructor(){super(...arguments);ze(this,"priority",70);ze(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,o){switch(r){case"k":return Rc(Ru.hour24h,n);case"ko":return o.ordinalNumber(n,{unit:"hour"});default:return gu(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,o){const i=o<=24?o%24:o;return n.setHours(i,0,0,0),n}}class tNn extends ps{constructor(){super(...arguments);ze(this,"priority",60);ze(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"m":return Rc(Ru.minute,n);case"mo":return o.ordinalNumber(n,{unit:"minute"});default:return gu(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setMinutes(o,0,0),n}}class nNn extends ps{constructor(){super(...arguments);ze(this,"priority",50);ze(this,"incompatibleTokens",["t","T"])}parse(n,r,o){switch(r){case"s":return Rc(Ru.second,n);case"so":return o.ordinalNumber(n,{unit:"second"});default:return gu(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,o){return n.setSeconds(o,0),n}}class rNn extends ps{constructor(){super(...arguments);ze(this,"priority",30);ze(this,"incompatibleTokens",["t","T"])}parse(n,r){const o=i=>Math.trunc(i*Math.pow(10,-r.length+3));return Ou(gu(r.length,n),o)}set(n,r,o){return n.setMilliseconds(o),n}}class oNn extends ps{constructor(){super(...arguments);ze(this,"priority",10);ze(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return _v(Iv.basicOptionalMinutes,n);case"XX":return _v(Iv.basic,n);case"XXXX":return _v(Iv.basicOptionalSeconds,n);case"XXXXX":return _v(Iv.extendedOptionalSeconds,n);case"XXX":default:return _v(Iv.extended,n)}}set(n,r,o){return r.timestampIsSet?n:mu(n,n.getTime()-aU(n)-o)}}class iNn extends ps{constructor(){super(...arguments);ze(this,"priority",10);ze(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return _v(Iv.basicOptionalMinutes,n);case"xx":return _v(Iv.basic,n);case"xxxx":return _v(Iv.basicOptionalSeconds,n);case"xxxxx":return _v(Iv.extendedOptionalSeconds,n);case"xxx":default:return _v(Iv.extended,n)}}set(n,r,o){return r.timestampIsSet?n:mu(n,n.getTime()-aU(n)-o)}}class aNn extends ps{constructor(){super(...arguments);ze(this,"priority",40);ze(this,"incompatibleTokens","*")}parse(n){return Mrt(n)}set(n,r,o){return[mu(n,o*1e3),{timestampIsSet:!0}]}}class sNn extends ps{constructor(){super(...arguments);ze(this,"priority",20);ze(this,"incompatibleTokens","*")}parse(n){return Mrt(n)}set(n,r,o){return[mu(n,o),{timestampIsSet:!0}]}}const lNn={G:new ECn,y:new ICn,Y:new _Cn,R:new PCn,u:new ACn,Q:new TCn,q:new kCn,M:new MCn,L:new RCn,w:new $Cn,I:new LCn,d:new BCn,D:new HCn,E:new VCn,e:new UCn,c:new WCn,i:new qCn,a:new KCn,b:new YCn,B:new XCn,h:new QCn,H:new JCn,K:new ZCn,k:new eNn,m:new tNn,s:new nNn,S:new rNn,X:new oNn,x:new iNn,t:new aNn,T:new sNn},cNn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uNn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,dNn=/^'([^]*?)'?$/,fNn=/''/g,pNn=/\S/,hNn=/[a-zA-Z]/;function mNn(e,t,n,r){var x,v,b,w,S,C,N,j;const o=()=>mu((r==null?void 0:r.in)||n,NaN),i=vCn(),s=(r==null?void 0:r.locale)??i.locale??Ert,l=(r==null?void 0:r.firstWeekContainsDate)??((v=(x=r==null?void 0:r.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??i.firstWeekContainsDate??((w=(b=i.locale)==null?void 0:b.options)==null?void 0:w.firstWeekContainsDate)??1,c=(r==null?void 0:r.weekStartsOn)??((C=(S=r==null?void 0:r.locale)==null?void 0:S.options)==null?void 0:C.weekStartsOn)??i.weekStartsOn??((j=(N=i.locale)==null?void 0:N.options)==null?void 0:j.weekStartsOn)??0;if(!t)return e?o():gi(n,r==null?void 0:r.in);const u={firstWeekContainsDate:l,weekStartsOn:c,locale:s},d=[new jCn(r==null?void 0:r.in,n)],p=t.match(uNn).map(I=>{const _=I[0];if(_ in jse){const T=jse[_];return T(I,s.formatLong)}return I}).join("").match(cNn),h=[];for(let I of p){!(r!=null&&r.useAdditionalWeekYearTokens)&&Trt(I)&&Ese(I,t,e),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Art(I)&&Ese(I,t,e);const _=I[0],T=lNn[_];if(T){const{incompatibleTokens:P}=T;if(Array.isArray(P)){const M=h.find(R=>P.includes(R.token)||R.token===_);if(M)throw new RangeError(`The format string mustn't contain \`${M.fullToken}\` and \`${I}\` at the same time`)}else if(T.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${I}\` and any other token at the same time`);h.push({token:_,fullToken:I});const E=T.run(e,I,s.match,u);if(!E)return o();d.push(E.setter),e=E.rest}else{if(_.match(hNn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(I==="''"?I="'":_==="'"&&(I=gNn(I)),e.indexOf(I)===0)e=e.slice(I.length);else return o()}}if(e.length>0&&pNn.test(e))return o();const m=d.map(I=>I.priority).sort((I,_)=>_-I).filter((I,_,T)=>T.indexOf(I)===_).map(I=>d.filter(_=>_.priority===I).sort((_,T)=>T.subPriority-_.subPriority)).map(I=>I[0]);let g=gi(n,r==null?void 0:r.in);if(isNaN(+g))return o();const y={};for(const I of m){if(!I.validate(g,u))return o();const _=I.set(g,y,u);Array.isArray(_)?(g=_[0],Object.assign(y,_[1])):g=_}return g}function gNn(e){return e.match(dNn)[1].replace(fNn,"'")}function xNn(e,t){const n=gi(e,t==null?void 0:t.in);return n.setMinutes(0,0,0),n}function yNn(e,t){const n=gi(e,t==null?void 0:t.in);return n.setSeconds(0,0),n}function vNn(e,t){const n=gi(e,t==null?void 0:t.in);return n.setMilliseconds(0),n}function Zz(e,t){const n=()=>mu(t==null?void 0:t.in,NaN),r=(t==null?void 0:t.additionalDigits)??2,o=CNn(e);let i;if(o.date){const u=NNn(o.date,r);i=jNn(u.restDateString,u.year)}if(!i||isNaN(+i))return n();const s=+i;let l=0,c;if(o.time&&(l=ENn(o.time),isNaN(l)))return n();if(o.timezone){if(c=INn(o.timezone),isNaN(c))return n()}else{const u=new Date(s+l),d=gi(0,t==null?void 0:t.in);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return gi(s+l+c,t==null?void 0:t.in)}const PF={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},bNn=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,wNn=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,SNn=/^([+-])(\d{2})(?::?(\d{2}))?$/;function CNn(e){const t={},n=e.split(PF.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],PF.timeZoneDelimiter.test(t.date)&&(t.date=e.split(PF.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const o=PF.timezone.exec(r);o?(t.time=r.replace(o[1],""),t.timezone=o[1]):t.time=r}return t}function NNn(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const o=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:i===null?o:i*100,restDateString:e.slice((r[1]||r[2]).length)}}function jNn(e,t){if(t===null)return new Date(NaN);const n=e.match(bNn);if(!n)return new Date(NaN);const r=!!n[4],o=mM(n[1]),i=mM(n[2])-1,s=mM(n[3]),l=mM(n[4]),c=mM(n[5])-1;if(r)return kNn(t,l,c)?_Nn(t,l,c):new Date(NaN);{const u=new Date(0);return!ANn(t,i,s)||!TNn(t,o)?new Date(NaN):(u.setUTCFullYear(t,i,Math.max(o,s)),u)}}function mM(e){return e?parseInt(e):1}function ENn(e){const t=e.match(wNn);if(!t)return NaN;const n=pee(t[1]),r=pee(t[2]),o=pee(t[3]);return MNn(n,r,o)?n*UL+r*VL+o*1e3:NaN}function pee(e){return e&&parseFloat(e.replace(",","."))||0}function INn(e){if(e==="Z")return 0;const t=e.match(SNn);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return RNn(r,o)?n*(r*UL+o*VL):NaN}function _Nn(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const o=r.getUTCDay()||7,i=(t-1)*7+n+1-o;return r.setUTCDate(r.getUTCDate()+i),r}const PNn=[31,null,31,30,31,30,31,31,30,31,30,31];function $rt(e){return e%400===0||e%4===0&&e%100!==0}function ANn(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(PNn[t]||($rt(e)?29:28))}function TNn(e,t){return t>=1&&t<=($rt(e)?366:365)}function kNn(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function MNn(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function RNn(e,t){return t>=0&&t<=59}const ONn=()=>{const[e,t]=f.useState(null),[n,r]=f.useState(!1),[o,i]=f.useState(null),s=f.useCallback(()=>{r(!0),i(null),setTimeout(()=>{const l=[{accountId:"ACCT-001-USD",accountName:"Operating Account USD",currency:"USD",openingBalance:150000075e-2,closingBalance:155000075e-2,availableBalance:154e4,date:$E(new Date,"yyyy-MM-dd")},{accountId:"ACCT-002-EUR",accountName:"Receivables EUR",currency:"EUR",openingBalance:5e4,closingBalance:49800,availableBalance:49800,date:$E(new Date,"yyyy-MM-dd")},{accountId:"ACCT-003-GBP",accountName:"Payroll GBP",currency:"GBP",openingBalance:200000.5,closingBalance:200000.5,availableBalance:195e3,date:$E(new Date,"yyyy-MM-dd")}];t(l),r(!1)},800)},[]);return f.useEffect(()=>{s()},[s]),{data:e,loading:n,error:o,refetch:s}},$Nn=e=>{const[t,n]=f.useState(null),[r,o]=f.useState(!1),[i,s]=f.useState(null),l=f.useCallback(()=>{if(!e){n(null);return}o(!0),s(null),setTimeout(()=>{if(e==="ACCT-001-USD"){const c={id:"STMT-20230101-USD",accountId:e,creationDateTime:new Date().toISOString(),currency:"USD",openingBalance:150000075e-2,closingBalance:155000075e-2,entries:[{id:"T001",bookingDate:"2023-10-26",valueDate:"2023-10-26",amount:5e4,currency:"USD",status:"BOOK",type:"CRDT",description:"Incoming Wire Transfer (INV-901)",relatedParty:"Supplier Inc."},{id:"T002",bookingDate:"2023-10-26",valueDate:"2023-10-26",amount:-500,currency:"USD",status:"BOOK",type:"CHRG",description:"Wire Transfer Fee",relatedParty:"Bank ABC"},{id:"T003",bookingDate:"2023-10-26",valueDate:"2023-10-26",amount:2500,currency:"USD",status:"PDNG",type:"CRDT",description:"ACH Deposit Pending",relatedParty:"Client XYZ"},{id:"T004",bookingDate:"2023-10-26",valueDate:"2023-10-26",amount:-2e4,currency:"USD",status:"BOOK",type:"DBIT",description:"Payroll Batch 1",relatedParty:"Employee Services"}]};n([c])}else n([]);o(!1)},800)},[e]);return f.useEffect(()=>{l()},[l]),{data:t,loading:r,error:i,refetch:l}},hee=({title:e,amount:t,currency:n,isLoading:r})=>a.jsx(p0,{elevation:3,sx:{height:"100%"},children:a.jsxs(h0,{children:[a.jsx(tn,{variant:"subtitle1",color:"textSecondary",children:e}),r?a.jsx(su,{size:20,sx:{mt:1}}):a.jsx(tn,{variant:"h4",component:"div",sx:{mt:1,fontWeight:"bold"},children:new Intl.NumberFormat("en-US",{style:"currency",currency:n}).format(t)})]})}),DNn=({positions:e,loading:t})=>{const n=f.useMemo(()=>e.filter(o=>o.currency==="USD").reduce((o,i)=>o+i.availableBalance,0),[e]),r=e.find(o=>o.currency==="USD");return a.jsxs(br,{container:!0,spacing:3,sx:{mb:4},children:[a.jsx(br,{xs:12,md:4,children:a.jsx(hee,{title:"Total Available Cash (USD Equivalent)",amount:n,currency:"USD",isLoading:t})}),a.jsx(br,{xs:12,md:4,children:a.jsx(hee,{title:"USD Closing Book Balance",amount:(r==null?void 0:r.closingBalance)||0,currency:"USD",isLoading:t})}),a.jsx(br,{xs:12,md:4,children:a.jsx(hee,{title:"USD Available Balance",amount:(r==null?void 0:r.availableBalance)||0,currency:"USD",isLoading:t})})]})},LNn=({statements:e,loading:t})=>{if(t)return a.jsx(Dn,{display:"flex",justifyContent:"center",py:4,children:a.jsx(su,{})});if(!e||e.length===0)return a.jsx(zf,{severity:"info",children:"No statement data available for the selected account."});const n=e[0];return a.jsxs(Dn,{children:[a.jsxs(tn,{variant:"h6",gutterBottom:!0,children:["Statement Details (",n.currency,")"]}),a.jsxs(br,{container:!0,spacing:2,mb:3,children:[a.jsxs(br,{xs:6,md:3,children:[a.jsx(tn,{variant:"body2",children:"Statement Date:"}),a.jsx(tn,{fontWeight:"bold",children:$E(Zz(n.creationDateTime),"PPP")})]}),a.jsxs(br,{xs:6,md:3,children:[a.jsx(tn,{variant:"body2",children:"Opening Balance:"}),a.jsx(tn,{fontWeight:"bold",children:new Intl.NumberFormat("en-US",{style:"currency",currency:n.currency}).format(n.openingBalance)})]}),a.jsxs(br,{xs:6,md:3,children:[a.jsx(tn,{variant:"body2",children:"Closing Balance:"}),a.jsx(tn,{fontWeight:"bold",children:new Intl.NumberFormat("en-US",{style:"currency",currency:n.currency}).format(n.closingBalance)})]})]}),a.jsx(tn,{variant:"subtitle2",sx:{mb:1,fontWeight:"bold"},children:"Transaction Entries"}),a.jsx(ea,{sx:{overflowX:"auto"},children:a.jsxs(Dn,{minWidth:800,children:[a.jsxs(br,{container:!0,sx:{borderBottom:"1px solid #ccc",py:1,px:2,fontWeight:"bold"},children:[a.jsx(br,{xs:1,children:"ID"}),a.jsx(br,{xs:1.5,children:"Booking Date"}),a.jsx(br,{xs:1.5,children:"Value Date"}),a.jsx(br,{xs:1,children:"Status"}),a.jsx(br,{xs:1.5,sx:{textAlign:"right"},children:"Amount"}),a.jsx(br,{xs:2,children:"Related Party"}),a.jsx(br,{xs:3.5,children:"Description"})]}),n.entries.map(r=>a.jsxs(br,{container:!0,sx:{py:1,px:2,borderBottom:"1px dotted #eee"},children:[a.jsx(br,{xs:1,sx:{fontSize:"0.8rem"},children:r.id}),a.jsx(br,{xs:1.5,sx:{fontSize:"0.8rem"},children:$E(Zz(r.bookingDate),"MMM d, yy")}),a.jsx(br,{xs:1.5,sx:{fontSize:"0.8rem"},children:$E(Zz(r.valueDate),"MMM d, yy")}),a.jsx(br,{xs:1,sx:{fontSize:"0.8rem",color:r.status==="PDNG"?"warning.main":"success.main"},children:r.status}),a.jsx(br,{xs:1.5,sx:{textAlign:"right",fontWeight:"bold",color:r.amount<0?"error.main":"success.main",fontSize:"0.9rem"},children:new Intl.NumberFormat("en-US",{style:"currency",currency:r.currency,minimumFractionDigits:2}).format(r.amount)}),a.jsx(br,{xs:2,sx:{fontSize:"0.8rem"},children:r.relatedParty}),a.jsx(br,{xs:3.5,sx:{fontSize:"0.8rem"},children:r.description})]},r.id))]})})]})},FNn=({positions:e,selectedAccount:t,onSelectAccount:n})=>a.jsxs(ea,{elevation:3,sx:{p:2,height:"100%",minHeight:400},children:[a.jsx(tn,{variant:"h6",gutterBottom:!0,children:"Bank Accounts"}),a.jsx(Dn,{sx:{maxHeight:350,overflowY:"auto"},children:e.map(r=>a.jsxs(Dn,{onClick:()=>n(r.accountId),sx:{p:1.5,mb:1,borderRadius:1,cursor:"pointer",backgroundColor:t===r.accountId?"primary.light":"transparent","&:hover":{backgroundColor:t===r.accountId?"primary.main":"grey.100",color:t===r.accountId?"white":"inherit"}},children:[a.jsx(tn,{variant:"body1",fontWeight:"medium",children:r.accountName}),a.jsxs(tn,{variant:"caption",display:"block",children:[r.accountId," - ",r.currency]}),a.jsxs(tn,{variant:"body2",color:t===r.accountId?"inherit":"textSecondary",children:["Available: ",new Intl.NumberFormat("en-US",{style:"currency",currency:r.currency}).format(r.availableBalance)]})]},r.accountId))})]}),zNn=()=>{var w,S;const{data:e,loading:t,error:n,refetch:r}=ONn(),[o,i]=f.useState(null),[s,l]=f.useState(0);f.useEffect(()=>{e&&e.length>0&&!o&&i(e[0].accountId)},[e,o]);const{data:c,loading:u,error:d,refetch:p}=$Nn(o),h=(C,N)=>{l(N)},m=()=>{r(),o&&p()},[g,y]=f.useState(null),x=!!g,v=C=>{y(C.currentTarget)},b=()=>{y(null)};return a.jsxs(Dn,{sx:{p:3},children:[a.jsx(tn,{variant:"h4",gutterBottom:!0,sx:{fontWeight:"light"},children:"Treasury Dashboard"}),a.jsxs(Dn,{display:"flex",justifyContent:"space-between",mb:3,children:[a.jsx(tn,{variant:"subtitle2",color:"textSecondary",children:"Data sourced directly from CAMT files"}),a.jsxs(Dn,{children:[a.jsx(ta,{variant:"outlined",onClick:v,startIcon:a.jsx(BSn,{}),sx:{mr:1},children:"Filter"}),a.jsxs(lrt,{anchorEl:g,open:x,onClose:b,children:[a.jsx(_d,{onClick:b,children:"Filter by Date Range"}),a.jsx(_d,{onClick:b,children:"Filter by Currency"})]}),a.jsx(ta,{variant:"contained",onClick:m,startIcon:t?a.jsx(su,{size:18,color:"inherit"}):a.jsx(qSn,{}),disabled:t,children:t?"Refreshing...":"Refresh Data"})]})]}),n&&a.jsxs(zf,{severity:"error",sx:{mb:3},children:["Error fetching positions: ",n]}),a.jsx(DNn,{positions:e||[],loading:t}),a.jsxs(br,{container:!0,spacing:3,children:[a.jsx(br,{xs:12,md:4,children:t?a.jsx(ea,{elevation:3,sx:{p:2,height:400,display:"flex",justifyContent:"center",alignItems:"center"},children:a.jsx(su,{})}):a.jsx(FNn,{positions:e||[],selectedAccount:o,onSelectAccount:i})}),a.jsx(br,{xs:12,md:8,children:a.jsxs(ea,{elevation:3,sx:{p:3,minHeight:400},children:[a.jsx(tn,{variant:"h5",gutterBottom:!0,children:o?(w=e==null?void 0:e.find(C=>C.accountId===o))==null?void 0:w.accountName:"Select an Account"}),a.jsxs(mrt,{value:s,onChange:h,sx:{borderBottom:1,borderColor:"divider"},children:[a.jsx(Jz,{label:"Consolidated Statement"}),a.jsx(Jz,{label:"Pending Transactions"}),a.jsx(Jz,{label:"CAMT Raw Data",disabled:!0})]}),a.jsxs(Dn,{sx:{pt:2},children:[s===0&&a.jsx(LNn,{statements:c,loading:u}),s===1&&a.jsxs(zf,{severity:"warning",children:["Pending Transactions view is under development. Filter: ",((S=c==null?void 0:c[0])==null?void 0:S.entries.filter(C=>C.status==="PDNG").length)||0," pending entries."]}),s===2&&a.jsx(zf,{severity:"info",children:"Raw CAMT XML Viewer Coming Soon."}),d&&a.jsxs(zf,{severity:"error",sx:{mt:2},children:["Error fetching statement: ",d]})]})]})})]})]})},BNn=[{id:"acc_101",name:"Quantum Prime Checking",type:"checking",accountNumberMasked:"**** **** **** 1234",balance:15432.88,currency:"USD",liquidityScore:98},{id:"acc_102",name:"Titanium Yield Savings",type:"savings",accountNumberMasked:"**** **** **** 5678",balance:89102.15,currency:"USD",liquidityScore:85},{id:"acc_103",name:"Global Black Card",type:"credit_card",accountNumberMasked:"**** ****** *9012",balance:-2345.67,currency:"USD",liquidityScore:40},{id:"acc_104",name:"Algorithmic Alpha Fund",type:"investment",accountNumberMasked:"****-ALGO-****-3321",balance:254010.99,currency:"USD",liquidityScore:60},{id:"acc_105",name:"Cold Storage Vault",type:"crypto_vault",accountNumberMasked:"0x71C...9A2",balance:42.5,currency:"BTC",liquidityScore:10}],Xy={read_transaction_history:{key:"read_transaction_history",label:"Read Transaction History",description:"Allows analysis of historical cash flow patterns.",category:"Account Information",riskLevel:"low",isMutable:!0,encryptionLevel:"standard"},view_account_balances:{key:"view_account_balances",label:"View Real-Time Balances",description:"Monitors liquidity positions in real-time.",category:"Account Information",riskLevel:"low",isMutable:!0,encryptionLevel:"standard"},access_income_statements:{key:"access_income_statements",label:"Access Income Verification",description:"Validates revenue streams for creditworthiness.",category:"Data Analysis",riskLevel:"medium",isMutable:!1,encryptionLevel:"quantum_safe"},initiate_single_payment:{key:"initiate_single_payment",label:"Initiate Single Payment",description:"Authorizes a one-time transfer of funds.",category:"Payment Initiation",riskLevel:"high",isMutable:!1,encryptionLevel:"quantum_safe"},execute_algorithmic_trades:{key:"execute_algorithmic_trades",label:"Execute Algorithmic Trades",description:"CRITICAL: Autonomous trading authorization.",category:"Algorithmic Access",riskLevel:"critical",isMutable:!1,encryptionLevel:"quantum_safe"}},vR=[{id:"app_001",name:"MintFusion Budgeting",developer:"FusionCorp",website:"https://fusioncorp.example.com",description:"Next-gen expense tracking and budget optimization.",category:"Budgeting",icon:"M11 3.055A9.001 9.001 0 1020.945 13H11V3.055z",requestedPermissions:[Xy.read_transaction_history,Xy.view_account_balances],riskScore:15,reputationTier:"Verified"},{id:"app_002",name:"TaxBot Pro",developer:"Taxable Inc.",website:"https://taxable.example.com",description:"Automated tax harvesting and filing.",category:"Tax",icon:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",requestedPermissions:[Xy.read_transaction_history,Xy.access_income_statements],riskScore:35,reputationTier:"Verified"},{id:"app_003",name:"Acornvest",developer:"Oak Financial",website:"https://oakfin.example.com",description:"Micro-investing infrastructure.",category:"Investment",icon:"M13 17h8m0 0V9m0 8l-8-8-4 4-6-6",requestedPermissions:[Xy.read_transaction_history,Xy.initiate_single_payment],riskScore:65,reputationTier:"Elite Partner"},{id:"app_004",name:"LendEasy",developer:"QuickCredit",website:"https://quickcredit.example.com",description:"Instant liquidity provision via credit assessment.",category:"Lending",icon:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2 4h10a2 2 0 002-2v-6a2 2 0 00-2-2H9a2 2 0 00-2 2v6a2 2 0 002 2zm7-5a2 2 0 11-4 0 2 2 0 014 0z",requestedPermissions:[Xy.access_income_statements,Xy.access_contact_info],riskScore:55,reputationTier:"Verified"},{id:"app_005",name:"QuantumTrade AI",developer:"AlgoRhythm Inc.",website:"https://algorhythm.example.com",description:"HFT strategies powered by neural networks.",category:"Trading",icon:"M3.055 11H5a7 7 0 0114 0h1.945A9.001 9.001 0 003.055 11zM12 21a9.001 9.001 0 008.945-10H19a7 7 0 01-14 0H3.055A9.001 9.001 0 0012 21z",requestedPermissions:[Xy.view_account_balances,Xy.execute_algorithmic_trades],riskScore:92,reputationTier:"Sovereign"}],HNn=[{id:1,app:vR[0],status:"active",connectedAt:"2023-08-15T10:30:00Z",expiresAt:"2024-11-15T10:30:00Z",lastAccessedAt:"2023-10-28T14:00:00Z",linkedAccountIds:["acc_101","acc_102"],grantedPermissions:vR[0].requestedPermissions,dataSharingFrequency:"recurring",smartConsent:{dataRefreshFrequency:"daily",transactionHistoryLimitDays:365,purpose:"Personal Budgeting"},throughput:12.5,latency:45},{id:5,app:vR[4],status:"optimizing",connectedAt:"2023-10-01T11:00:00Z",expiresAt:"2024-01-01T11:00:00Z",lastAccessedAt:"2023-10-29T05:15:00Z",linkedAccountIds:["acc_104"],grantedPermissions:vR[4].requestedPermissions,dataSharingFrequency:"streaming",smartConsent:{dataRefreshFrequency:"real_time",transactionHistoryLimitDays:30,purpose:"Algorithmic Trading Strategy"},throughput:450.2,latency:2}],Drt={defaultConsentDurationDays:90,notifyOnNewConnection:!0,notifyOnConnectionExpiration:!0,requireReauthenticationForHighRisk:!0,autoRevokeInactiveConnections:!1,inactiveDaysThreshold:60,aiSecurityMonitorEnabled:!0,quantumEncryptionEnabled:!0},oh=()=>Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),mee=(e,t=500,n=0)=>new Promise((r,o)=>{setTimeout(()=>{Math.random()e?new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):"N/A",UNn=e=>e?new Date(e).toLocaleString(void 0,{dateStyle:"short",timeStyle:"medium"}):"N/A",WNn={connections:[],auditLog:[],settings:Drt,availableApps:[],accounts:[],isLoading:!0,error:null,filter:"",statusFilter:"all",chatHistory:[{id:"welcome",sender:"ai",text:"Welcome to the Quantum Financial Open Banking Nexus. I am your Sovereign AI Architect. How can I assist you in optimizing your data connections today?",timestamp:new Date().toISOString()}],isAiProcessing:!1};function GNn(e,t){const n=new Date().toISOString();switch(t.type){case"FETCH_START":return{...e,isLoading:!0,error:null};case"FETCH_SUCCESS":return{...e,isLoading:!1,...t.payload};case"FETCH_ERROR":return{...e,isLoading:!1,error:t.payload};case"REVOKE_CONNECTION":{const r=e.connections.find(i=>i.id===t.payload),o={id:oh(),timestamp:n,actor:"User",action:"REVOKE_ACCESS",target:(r==null?void 0:r.app.name)||"Unknown",status:"Success",hash:oh()};return{...e,connections:e.connections.map(i=>i.id===t.payload?{...i,status:"revoked"}:i),auditLog:[o,...e.auditLog]}}case"ADD_CONNECTION":{const{app:r,linkedAccountIds:o,grantedPermissions:i,smartConsent:s}=t.payload,l=new Date;l.setDate(l.getDate()+e.settings.defaultConsentDurationDays);const c={id:Math.max(...e.connections.map(d=>d.id),0)+1,app:r,status:"active",connectedAt:n,expiresAt:l.toISOString(),lastAccessedAt:null,linkedAccountIds:o,grantedPermissions:i,dataSharingFrequency:"recurring",smartConsent:s,throughput:0,latency:0},u={id:oh(),timestamp:n,actor:"User",action:"GRANT_ACCESS",target:r.name,status:"Success",hash:oh(),metadata:{permissions:i.length}};return{...e,connections:[c,...e.connections],auditLog:[u,...e.auditLog]}}case"SET_FILTER":return{...e,filter:t.payload};case"SET_STATUS_FILTER":return{...e,statusFilter:t.payload};case"UPDATE_SETTINGS":return{...e,settings:{...e.settings,...t.payload}};case"ADD_CHAT_MESSAGE":return{...e,chatHistory:[...e.chatHistory,t.payload]};case"SET_AI_PROCESSING":return{...e,isAiProcessing:t.payload};case"LOG_AUDIT":return{...e,auditLog:[{...t.payload,id:oh(),timestamp:n,hash:oh()},...e.auditLog]};default:return e}}const Zke=({status:e})=>{const t={active:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",expired:"bg-slate-500/20 text-slate-300 border-slate-500/30",revoked:"bg-red-500/20 text-red-300 border-red-500/30",pending:"bg-blue-500/20 text-blue-300 border-blue-500/30",at_risk:"bg-amber-500/20 text-amber-300 border-amber-500/30 animate-pulse",optimizing:"bg-purple-500/20 text-purple-300 border-purple-500/30 animate-pulse",quarantined:"bg-rose-900/40 text-rose-400 border-rose-500/50"};return a.jsx("span",{className:`px-2 py-0.5 text-[10px] uppercase tracking-wider font-bold rounded-sm border ${t[e]}`,children:e})},qNn=({score:e})=>{const t=`${e}%`;let n="bg-emerald-500";return e>40&&(n="bg-yellow-500"),e>70&&(n="bg-orange-500"),e>90&&(n="bg-red-600"),a.jsxs("div",{className:"flex items-center gap-2",title:`Risk Score: ${e}/100`,children:[a.jsx("div",{className:"h-1.5 w-16 bg-gray-700 rounded-full overflow-hidden",children:a.jsx("div",{className:`h-full ${n} transition-all duration-500`,style:{width:t}})}),a.jsx("span",{className:`text-xs font-mono ${e>70?"text-red-400":"text-gray-400"}`,children:e})]})},e4e=({isOpen:e,onClose:t,title:n,children:r,size:o="lg"})=>{if(!e)return null;const i={md:"max-w-md",lg:"max-w-2xl",xl:"max-w-5xl"};return a.jsx("div",{className:"fixed inset-0 bg-black/80 backdrop-blur-sm flex items-center justify-center z-[100] transition-opacity p-4",onClick:t,children:a.jsxs("div",{className:`bg-gray-900 rounded-xl shadow-2xl w-full border border-gray-700/50 flex flex-col max-h-[90vh] ${i[o]}`,onClick:s=>s.stopPropagation(),children:[a.jsxs("div",{className:"flex justify-between items-center p-5 border-b border-gray-800",children:[a.jsxs("h3",{className:"text-xl font-bold text-white tracking-tight flex items-center gap-2",children:[a.jsx("span",{className:"w-1 h-6 bg-cyan-500 rounded-full"}),n]}),a.jsx("button",{onClick:t,className:"text-gray-400 hover:text-white transition-colors p-1 hover:bg-gray-800 rounded-full",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsx("div",{className:"p-6 overflow-y-auto custom-scrollbar",children:r})]})})},KNn=({chatHistory:e,onSendMessage:t,isProcessing:n,onAction:r})=>{const[o,i]=f.useState(""),s=f.useRef(null);f.useEffect(()=>{s.current&&(s.current.scrollTop=s.current.scrollHeight)},[e]);const l=()=>{o.trim()&&(t(o),i(""))};return a.jsxs("div",{className:"flex flex-col h-[600px] bg-gray-900/50 border border-gray-700/50 rounded-xl overflow-hidden backdrop-blur-md shadow-2xl",children:[a.jsxs("div",{className:"p-4 bg-gradient-to-r from-gray-900 to-gray-800 border-b border-gray-700 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-3 h-3 bg-cyan-500 rounded-full animate-ping absolute top-0 right-0"}),a.jsx("div",{className:"w-8 h-8 bg-cyan-900/50 rounded-lg flex items-center justify-center border border-cyan-500/30",children:a.jsx("svg",{className:"w-5 h-5 text-cyan-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})})})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-white",children:"Quantum AI Architect"}),a.jsx("p",{className:"text-[10px] text-cyan-400 font-mono",children:"ONLINE // SECURE CHANNEL"})]})]}),a.jsx("div",{className:"flex gap-2",children:a.jsx("button",{className:"p-1.5 hover:bg-gray-700 rounded text-gray-400 hover:text-white",title:"Clear Context",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 custom-scrollbar",ref:s,children:[e.map(c=>a.jsx("div",{className:`flex ${c.sender==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[85%] rounded-2xl p-3 text-sm ${c.sender==="user"?"bg-cyan-600 text-white rounded-br-none":"bg-gray-800 text-gray-200 border border-gray-700 rounded-bl-none"}`,children:[c.sender==="ai"&&a.jsx("div",{className:"text-[10px] text-cyan-500 font-bold mb-1",children:"AI ARCHITECT"}),a.jsx("p",{className:"whitespace-pre-wrap leading-relaxed",children:c.text}),c.actionData&&a.jsx("div",{className:"mt-3 pt-2 border-t border-gray-700/50",children:a.jsxs("button",{onClick:()=>r(c.intent||"",c.actionData),className:"w-full py-1.5 bg-gray-700 hover:bg-gray-600 text-xs text-white rounded flex items-center justify-center gap-2 transition-colors",children:[a.jsx("span",{children:"Execute Suggested Action"}),a.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14 5l7 7m0 0l-7 7m7-7H3"})})]})}),a.jsx("div",{className:"text-[10px] text-gray-500 mt-1 text-right",children:new Date(c.timestamp).toLocaleTimeString()})]})},c.id)),n&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-gray-800 rounded-2xl rounded-bl-none p-3 border border-gray-700 flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-cyan-500 rounded-full animate-bounce"}),a.jsx("div",{className:"w-2 h-2 bg-cyan-500 rounded-full animate-bounce delay-75"}),a.jsx("div",{className:"w-2 h-2 bg-cyan-500 rounded-full animate-bounce delay-150"})]})})]}),a.jsx("div",{className:"p-4 bg-gray-900 border-t border-gray-800",children:a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:o,onChange:c=>i(c.target.value),onKeyDown:c=>c.key==="Enter"&&l(),placeholder:"Ask Quantum AI to analyze risks, connect apps, or audit logs...",className:"w-full bg-gray-800 text-white pl-4 pr-12 py-3 rounded-xl border border-gray-700 focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 outline-none transition-all placeholder-gray-500 text-sm"}),a.jsx("button",{onClick:l,disabled:!o.trim()||n,className:"absolute right-2 top-2 p-1.5 bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]})})]})},YNn=()=>{const[e,t]=f.useReducer(GNn,WNn),{geminiApiKey:n}=f.useContext(ia)||{},[r,o]=f.useState(!1),[i,s]=f.useState(null),[l,c]=f.useState(null),[u,d]=f.useState("dashboard"),p=f.useRef(null);f.useEffect(()=>{(async()=>{t({type:"FETCH_START"});try{const[v,b,w]=await Promise.all([mee(HNn),mee(vR),mee(BNn)]),S=[{id:oh(),timestamp:new Date(Date.now()-1e6).toISOString(),actor:"System",action:"SYSTEM_INIT",target:"Quantum Core",status:"Success",hash:oh()},{id:oh(),timestamp:new Date(Date.now()-5e5).toISOString(),actor:"User",action:"LOGIN",target:"Dashboard",status:"Success",hash:oh()}];t({type:"FETCH_SUCCESS",payload:{connections:v,auditLog:S,settings:Drt,availableApps:b,accounts:w}})}catch{t({type:"FETCH_ERROR",payload:"Quantum Entanglement Failed"})}})()},[]),f.useEffect(()=>{const x=n||void 0||"mock-key";p.current=new Ko({apiKey:x})},[n]);const h=async x=>{var v;t({type:"ADD_CHAT_MESSAGE",payload:{id:oh(),sender:"user",text:x,timestamp:new Date().toISOString()}}),t({type:"SET_AI_PROCESSING",payload:!0});try{let b="",w="",S=null;if(p.current&&n){const C=p.current.getGenerativeModel({model:"gemini-1.5-flash"}),N=` You are the Quantum Financial AI Architect. Your role is to assist the user with Open Banking connections, security auditing, and risk analysis. Current Context: - Connected Apps: ${e.connections.map(T=>T.app.name).join(", ")} - Available Apps: ${e.availableApps.map(T=>T.name).join(", ")} - Risk Level: Low If the user asks to connect an app, suggest it. If the user asks about risk, analyze the permissions. Keep responses professional, elite, and concise. If you suggest an action, format the end of your message like: JSON_ACTION: {"intent": "CONNECT_APP", "appId": "app_001"} `,I=(await C.generateContent([N,x])).response.text(),_=I.match(/JSON_ACTION: ({.*})/);if(_){b=I.replace(_[0],"").trim();const T=JSON.parse(_[1]);w=T.intent,S=T}else b=I}else{await new Promise(N=>setTimeout(N,1500));const C=x.toLowerCase();if(C.includes("connect")||C.includes("add")){const N=e.availableApps.find(j=>C.includes(j.name.toLowerCase()))||e.availableApps[0];b=`I can facilitate a secure neural link with ${N.name}. This application has a risk score of ${N.riskScore}/100. Shall we proceed with the handshake protocol?`,w="CONNECT_APP",S={appId:N.id}}else if(C.includes("risk")||C.includes("audit"))b=`Scanning connection matrix... Analysis complete. You have ${e.connections.length} active bridges. The highest risk vector is ${((v=e.connections.find(N=>N.app.riskScore>50))==null?void 0:v.app.name)||"None"}. I recommend reviewing permissions for high-frequency trading bots.`;else if(C.includes("revoke")||C.includes("remove")){const N=e.connections[0];N?(b=`I have identified a connection to ${N.app.name} that can be terminated. Confirming this action will sever the data stream immediately.`,w="REVOKE_APP",S={connectionId:N.id}):b="There are no active connections to revoke."}else b="I am listening. My quantum processors are ready to optimize your financial ecosystem. You can ask me to connect apps, audit security, or analyze data flows."}t({type:"ADD_CHAT_MESSAGE",payload:{id:oh(),sender:"ai",text:b,timestamp:new Date().toISOString(),intent:w,actionData:S}})}catch{t({type:"ADD_CHAT_MESSAGE",payload:{id:oh(),sender:"system",text:"ERR: AI Core Desynchronized.",timestamp:new Date().toISOString()}})}finally{t({type:"SET_AI_PROCESSING",payload:!1})}},m=(x,v)=>{if(x==="CONNECT_APP"){const b=e.availableApps.find(w=>w.id===v.appId);b&&(s(b),o(!0))}else x==="REVOKE_APP"&&(t({type:"REVOKE_CONNECTION",payload:v.connectionId}),t({type:"ADD_CHAT_MESSAGE",payload:{id:oh(),sender:"system",text:"Connection severed successfully.",timestamp:new Date().toISOString()}}))},g=(x,v)=>{t({type:"ADD_CONNECTION",payload:{app:x,linkedAccountIds:v,grantedPermissions:x.requestedPermissions,smartConsent:{dataRefreshFrequency:"daily",transactionHistoryLimitDays:90,purpose:"User Initiated"}}}),o(!1),t({type:"ADD_CHAT_MESSAGE",payload:{id:oh(),sender:"system",text:`Secure link established with ${x.name}.`,timestamp:new Date().toISOString()}})},y=x=>a.jsxs("div",{className:"group relative bg-gray-800/40 border border-gray-700/50 rounded-xl p-5 hover:bg-gray-800/60 transition-all duration-300 hover:shadow-lg hover:shadow-cyan-900/20 hover:border-cyan-500/30",children:[a.jsxs("div",{className:"flex justify-between items-start mb-4",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-12 h-12 bg-gray-900 rounded-lg flex items-center justify-center text-cyan-400 border border-gray-700 group-hover:border-cyan-500/50 transition-colors",children:a.jsx("svg",{className:"w-7 h-7",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:x.app.icon})})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-lg font-bold text-white group-hover:text-cyan-400 transition-colors",children:x.app.name}),a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a.jsx(Zke,{status:x.status}),a.jsxs("span",{className:"text-xs text-gray-500 font-mono",children:["ID: ",x.id.toString().padStart(4,"0")]})]})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx(qNn,{score:x.app.riskScore}),a.jsx("p",{className:"text-[10px] text-gray-500 mt-1 uppercase tracking-wider",children:"Risk Assessment"})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4 text-sm",children:[a.jsxs("div",{className:"bg-gray-900/50 p-2 rounded border border-gray-800",children:[a.jsx("p",{className:"text-gray-500 text-xs",children:"Data Throughput"}),a.jsxs("p",{className:"text-white font-mono",children:[x.throughput," MB/s"]})]}),a.jsxs("div",{className:"bg-gray-900/50 p-2 rounded border border-gray-800",children:[a.jsx("p",{className:"text-gray-500 text-xs",children:"Latency"}),a.jsxs("p",{className:"text-white font-mono",children:[x.latency," ms"]})]})]}),a.jsxs("div",{className:"flex gap-2 mt-4 pt-4 border-t border-gray-700/50",children:[a.jsx("button",{onClick:()=>c(x),className:"flex-1 py-2 bg-gray-700 hover:bg-gray-600 text-white text-xs font-bold rounded uppercase tracking-wide transition-colors",children:"Inspect Node"}),x.status!=="revoked"&&a.jsx("button",{onClick:()=>t({type:"REVOKE_CONNECTION",payload:x.id}),className:"px-3 py-2 bg-red-900/30 hover:bg-red-900/50 text-red-400 border border-red-900/50 rounded text-xs font-bold transition-colors",title:"Sever Connection",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})]},x.id);return a.jsxs("div",{className:"min-h-screen bg-transparent text-gray-100 font-sans selection:bg-cyan-500/30",children:[a.jsxs("div",{className:"mb-8 flex flex-col md:flex-row justify-between items-end gap-4 border-b border-gray-800 pb-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-white to-gray-400 tracking-tight mb-2",children:"Open Banking Nexus"}),a.jsx("p",{className:"text-gray-400 max-w-2xl",children:'Manage your sovereign data connections. This is your "Golden Ticket" to financial interoperability. Kick the tires, see the engine roar, and ensure your ecosystem is secure.'})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx("button",{onClick:()=>d("dashboard"),className:`px-4 py-2 rounded-lg text-sm font-bold transition-all ${u==="dashboard"?"bg-cyan-600 text-white shadow-lg shadow-cyan-900/50":"bg-gray-800 text-gray-400 hover:bg-gray-700"}`,children:"Command Deck"}),a.jsx("button",{onClick:()=>d("security"),className:`px-4 py-2 rounded-lg text-sm font-bold transition-all ${u==="security"?"bg-cyan-600 text-white shadow-lg shadow-cyan-900/50":"bg-gray-800 text-gray-400 hover:bg-gray-700"}`,children:"Audit Logs"}),a.jsx("button",{onClick:()=>d("ai_lab"),className:`px-4 py-2 rounded-lg text-sm font-bold transition-all ${u==="ai_lab"?"bg-purple-600 text-white shadow-lg shadow-purple-900/50":"bg-gray-800 text-gray-400 hover:bg-gray-700"}`,children:"AI Lab"})]})]}),a.jsxs("div",{className:"grid grid-cols-12 gap-8",children:[a.jsxs("div",{className:"col-span-12 lg:col-span-8 space-y-8",children:[u==="dashboard"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsx(Ft,{variant:"interactive",padding:"sm",className:"border-l-4 border-l-cyan-500",children:a.jsxs("div",{className:"p-2",children:[a.jsx("p",{className:"text-gray-400 text-xs uppercase tracking-wider",children:"Active Links"}),a.jsx("p",{className:"text-3xl font-bold text-white mt-1",children:e.connections.filter(x=>x.status==="active").length})]})}),a.jsx(Ft,{variant:"interactive",padding:"sm",className:"border-l-4 border-l-emerald-500",children:a.jsxs("div",{className:"p-2",children:[a.jsx("p",{className:"text-gray-400 text-xs uppercase tracking-wider",children:"System Health"}),a.jsx("p",{className:"text-3xl font-bold text-white mt-1",children:"99.9%"})]})}),a.jsx(Ft,{variant:"interactive",padding:"sm",className:"border-l-4 border-l-purple-500",children:a.jsxs("div",{className:"p-2",children:[a.jsx("p",{className:"text-gray-400 text-xs uppercase tracking-wider",children:"Data Flow"}),a.jsx("p",{className:"text-3xl font-bold text-white mt-1",children:"1.2 GB"})]})})]}),a.jsx(Ft,{title:"Neural Bridges",subtitle:"Manage third-party access to your Quantum Ledger",headerActions:[{id:"add",label:"Connect App",icon:a.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),onClick:()=>o(!0)}],children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mt-4",children:[e.connections.map(y),a.jsxs("button",{onClick:()=>o(!0),className:"border-2 border-dashed border-gray-700 rounded-xl p-5 flex flex-col items-center justify-center text-gray-500 hover:text-cyan-400 hover:border-cyan-500/50 hover:bg-gray-800/30 transition-all min-h-[200px]",children:[a.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-800 flex items-center justify-center mb-3",children:a.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})}),a.jsx("span",{className:"font-bold",children:"Initiate New Connection"}),a.jsx("span",{className:"text-xs mt-1",children:"Expand your ecosystem"})]})]})})]}),u==="security"&&a.jsx(Ft,{title:"Immutable Audit Ledger",subtitle:"Cryptographically verifiable event log",children:a.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-700",children:a.jsxs("table",{className:"w-full text-left text-sm text-gray-400",children:[a.jsx("thead",{className:"bg-gray-800 text-gray-200 uppercase text-xs",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-3",children:"Timestamp"}),a.jsx("th",{className:"px-4 py-3",children:"Actor"}),a.jsx("th",{className:"px-4 py-3",children:"Action"}),a.jsx("th",{className:"px-4 py-3",children:"Target"}),a.jsx("th",{className:"px-4 py-3",children:"Hash"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-700 bg-gray-900/50",children:e.auditLog.map(x=>a.jsxs("tr",{className:"hover:bg-gray-800/50 transition-colors",children:[a.jsx("td",{className:"px-4 py-3 font-mono text-xs",children:UNn(x.timestamp)}),a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${x.actor==="System"?"bg-purple-900/50 text-purple-300":"bg-cyan-900/50 text-cyan-300"}`,children:x.actor})}),a.jsx("td",{className:"px-4 py-3 font-bold text-white",children:x.action}),a.jsx("td",{className:"px-4 py-3",children:x.target}),a.jsx("td",{className:"px-4 py-3 font-mono text-[10px] text-gray-600 truncate max-w-[100px]",children:x.hash})]},x.id))})]})})}),u==="ai_lab"&&a.jsx(Ft,{title:"Quantum AI Lab",subtitle:"Experimental features and predictive modeling",children:a.jsxs("div",{className:"p-8 text-center border border-gray-700 rounded-xl bg-gradient-to-b from-gray-800/50 to-transparent",children:[a.jsx("div",{className:"w-20 h-20 mx-auto bg-purple-500/10 rounded-full flex items-center justify-center mb-4 animate-pulse",children:a.jsx("svg",{className:"w-10 h-10 text-purple-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19.428 15.428a2 2 0 00-1.022-.547l-2.384-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z"})})}),a.jsx("h3",{className:"text-2xl font-bold text-white mb-2",children:"Predictive Risk Modeling"}),a.jsx("p",{className:"text-gray-400 mb-6 max-w-md mx-auto",children:'The AI is currently analyzing global market trends to optimize your connection permissions automatically. This feature is in beta for "Golden Ticket" users.'}),a.jsx("button",{className:"px-6 py-3 bg-purple-600 hover:bg-purple-500 text-white font-bold rounded-lg shadow-lg shadow-purple-900/50 transition-all",children:"Run Simulation"})]})})]}),a.jsxs("div",{className:"col-span-12 lg:col-span-4 space-y-8",children:[a.jsx(KNn,{chatHistory:e.chatHistory,onSendMessage:h,isProcessing:e.isAiProcessing,onAction:m}),a.jsx(Ft,{title:"Available Integrations",variant:"outline",className:"max-h-[400px] overflow-y-auto custom-scrollbar",children:a.jsx("div",{className:"space-y-3",children:e.availableApps.map(x=>a.jsxs("div",{className:"flex items-center gap-3 p-3 hover:bg-gray-800 rounded-lg cursor-pointer transition-colors",onClick:()=>{s(x),o(!0)},children:[a.jsx("div",{className:"w-8 h-8 bg-gray-700 rounded flex items-center justify-center text-gray-400",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:x.icon})})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h5",{className:"text-sm font-bold text-white",children:x.name}),a.jsx("p",{className:"text-xs text-gray-500",children:x.category})]}),a.jsx("button",{className:"text-cyan-400 hover:text-cyan-300",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})})]},x.id))})})]})]}),a.jsx(e4e,{isOpen:r,onClose:()=>{o(!1),s(null)},title:i?`Connect to ${i.name}`:"Select Application",children:i?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-blue-900/20 border border-blue-500/30 p-4 rounded-lg flex gap-3",children:[a.jsx("svg",{className:"w-6 h-6 text-blue-400 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-blue-300 text-sm",children:"Security Notice"}),a.jsxs("p",{className:"text-xs text-blue-200/70 mt-1",children:["You are about to grant ",a.jsx("strong",{children:i.name})," access to your Quantum Ledger. This action will be logged in the immutable audit trail."]})]})]}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm font-bold text-white mb-3 uppercase tracking-wider",children:"Requested Permissions"}),a.jsx("div",{className:"space-y-2",children:i.requestedPermissions.map(x=>a.jsxs("div",{className:"flex items-start gap-3 p-3 bg-gray-800 rounded-lg border border-gray-700",children:[a.jsx("div",{className:`mt-1 w-2 h-2 rounded-full ${x.riskLevel==="critical"?"bg-red-500":x.riskLevel==="high"?"bg-orange-500":"bg-green-500"}`}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-bold text-white",children:x.label}),a.jsx("p",{className:"text-xs text-gray-400",children:x.description})]})]},x.key))})]}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm font-bold text-white mb-3 uppercase tracking-wider",children:"Select Accounts"}),a.jsx("div",{className:"space-y-2",children:e.accounts.map(x=>a.jsxs("label",{className:"flex items-center justify-between p-3 bg-gray-800 rounded-lg border border-gray-700 cursor-pointer hover:bg-gray-750",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("input",{type:"checkbox",className:"w-4 h-4 rounded bg-gray-900 border-gray-600 text-cyan-600 focus:ring-cyan-500",defaultChecked:!0}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-bold text-white",children:x.name}),a.jsx("p",{className:"text-xs text-gray-500",children:x.accountNumberMasked})]})]}),a.jsxs("span",{className:"text-xs font-mono text-gray-400",children:["$",x.balance.toLocaleString()]})]},x.id))})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-gray-800",children:[a.jsx("button",{onClick:()=>s(null),className:"px-4 py-2 text-gray-400 hover:text-white text-sm font-bold",children:"Back"}),a.jsx("button",{onClick:()=>g(i,e.accounts.map(x=>x.id)),className:"px-6 py-2 bg-cyan-600 hover:bg-cyan-500 text-white text-sm font-bold rounded-lg shadow-lg shadow-cyan-900/50 transition-all",children:"Authorize Connection"})]})]}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.availableApps.map(x=>a.jsxs("div",{onClick:()=>s(x),className:"p-4 bg-gray-800 border border-gray-700 rounded-xl hover:border-cyan-500 cursor-pointer transition-all group",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[a.jsx("div",{className:"w-10 h-10 bg-gray-900 rounded-lg flex items-center justify-center text-cyan-500 group-hover:scale-110 transition-transform",children:a.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:x.icon})})}),a.jsx("h4",{className:"font-bold text-white",children:x.name})]}),a.jsx("p",{className:"text-sm text-gray-400",children:x.description})]},x.id))})}),a.jsx(e4e,{isOpen:!!l,onClose:()=>c(null),title:"Connection Telemetry",children:l&&a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-800 rounded-xl border border-gray-700",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-900 rounded-xl flex items-center justify-center text-cyan-500",children:a.jsx("svg",{className:"w-8 h-8",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:l.app.icon})})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold text-white",children:l.app.name}),a.jsx("p",{className:"text-sm text-gray-400",children:l.app.developer})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx(Zke,{status:l.status}),a.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:["Connected: ",VNn(l.connectedAt)]})]})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[a.jsxs("div",{className:"p-4 bg-gray-800/50 rounded-lg border border-gray-700 text-center",children:[a.jsx("p",{className:"text-xs text-gray-500 uppercase",children:"Data Sent"}),a.jsx("p",{className:"text-xl font-bold text-white mt-1",children:"450 MB"})]}),a.jsxs("div",{className:"p-4 bg-gray-800/50 rounded-lg border border-gray-700 text-center",children:[a.jsx("p",{className:"text-xs text-gray-500 uppercase",children:"API Calls"}),a.jsx("p",{className:"text-xl font-bold text-white mt-1",children:"12,402"})]}),a.jsxs("div",{className:"p-4 bg-gray-800/50 rounded-lg border border-gray-700 text-center",children:[a.jsx("p",{className:"text-xs text-gray-500 uppercase",children:"Last Sync"}),a.jsx("p",{className:"text-xl font-bold text-white mt-1",children:"2m ago"})]})]}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm font-bold text-white mb-3",children:"Active Data Streams"}),a.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-800 p-4 font-mono text-xs text-green-400 h-32 overflow-y-auto",children:[a.jsx("p",{children:`> [${new Date().toLocaleTimeString()}] SYNC_INITIATED: ${l.app.name}`}),a.jsx("p",{children:`> [${new Date().toLocaleTimeString()}] AUTH_TOKEN_VERIFIED: SHA-256 OK`}),a.jsx("p",{children:`> [${new Date().toLocaleTimeString()}] STREAMING_MARKET_DATA: PACKET_SIZE 12kb`}),a.jsx("p",{children:`> [${new Date().toLocaleTimeString()}] LATENCY_CHECK: ${l.latency}ms`})]})]}),a.jsx("div",{className:"flex justify-end",children:a.jsx("button",{onClick:()=>{t({type:"REVOKE_CONNECTION",payload:l.id}),c(null)},className:"px-6 py-2 bg-red-600 hover:bg-red-500 text-white font-bold rounded-lg shadow-lg shadow-red-900/50",children:"Terminate Connection"})})]})})]})};function t4e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function lU(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function QNn(e,t){if(e==null)return{};var n=XNn(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dA(e,t){return JNn(e)||ZNn(e,t)||ejn(e,t)||tjn()}function JNn(e){if(Array.isArray(e))return e}function ZNn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,l;try{for(n=n.call(e);!(o=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));o=!0);}catch(c){i=!0,l=c}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw l}}return r}}function ejn(e,t){if(e){if(typeof e=="string")return n4e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return n4e(e,t)}}function n4e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!window.Plaid)throw new Error("Plaid not loaded");r.plaid=n(lU(lU({},t),{},{onExit:function(u,d){r.open=!1,t.onExit&&t.onExit(u,d),r.onExitCallback&&r.onExitCallback()}}));var o=function(){r.plaid&&(r.open=!0,r.onExitCallback=null,r.plaid.open())},i=function(u){r.plaid&&r.plaid.submit(u)},s=function(u,d){if(!r.open||!r.plaid){d&&d();return}r.onExitCallback=d,r.plaid.exit(u),u&&u.force&&(r.open=!1)},l=function(){r.plaid&&(r.plaid.destroy(),r.plaid=null)};return{open:o,submit:i,exit:s,destroy:l}},ajn=function(t,n){var r=ojn(t,"publicKey","key");return ijn(r,n)},sjn="https://cdn.plaid.com/link/v2/stable/link-initialize.js",i4e=function(){},ljn=function(t){var n=rjn({src:sjn,checkForExisting:!0}),r=dA(n,2),o=r[0],i=r[1],s=f.useState(null),l=dA(s,2),c=l[0],u=l[1],d=f.useState(!1),p=dA(d,2),h=p[0],m=p[1],g=(t.product||[]).slice().sort().join(",");f.useEffect(function(){if(!o&&!(!t.token&&!t.publicKey&&!t.receivedRedirectUri)){if(i||!window.Plaid){console.error("Error loading Plaid",i);return}c!=null&&c.exit({force:!0},function(){return c.destroy()});var v=ajn(lU(lU({},t),{},{onLoad:function(){m(!0),t.onLoad&&t.onLoad()}}),window.Plaid.create);return u(v),function(){return v.exit({force:!0},function(){return v.destroy()})}}},[o,i,t.publicKey,t.token,g]);var y=c!=null&&(!o||h),x=function(){t.token||console.warn("react-plaid-link: You cannot call open() without a valid token supplied to usePlaidLink. This is a no-op.")};return{error:i,ready:y,submit:c?c.submit:i4e,exit:c?c.exit:i4e,open:c?c.open:x}},a4e;(function(e){e.OPEN="OPEN",e.EXIT="EXIT",e.HANDOFF="HANDOFF",e.SELECT_INSTITUTION="SELECT_INSTITUTION",e.ERROR="ERROR",e.BANK_INCOME_INSIGHTS_COMPLETED="BANK_INCOME_INSIGHTS_COMPLETED",e.IDENTITY_VERIFICATION_PASS_SESSION="IDENTITY_VERIFICATION_PASS_SESSION",e.IDENTITY_VERIFICATION_FAIL_SESSION="IDENTITY_VERIFICATION_FAIL_SESSION"})(a4e||(a4e={}));const cjn=` Quantum Financial Business Demo: A Comprehensive Guide Hey guys! Ever wondered about getting a demo for Quantum Financial’s business services? You’re in the right place! In this article, we’re diving deep into Quantum Financial’s business demo, exploring what it is, why you might want one, and how to make the most of it. Whether you’re a small startup or a growing enterprise, understanding the tools and services available to manage your finances is crucial. Quantum Financial, a titan in the financial world, offers a suite of business banking solutions designed to streamline operations, enhance security, and support your growth. Getting a demo is your golden ticket to seeing these powerful features in action before committing. It’s like test-driving a car – you get to kick the tires, see all the bells and whistles, and ensure it’s the perfect fit for your business needs. We’ll cover everything from the initial setup to exploring key functionalities and understanding the benefits that come with partnering with a global financial institution like Quantum Financial. So, buckle up, and let’s get this demo journey started! Why a Quantum Financial Business Demo is Your Secret Weapon So, why should you even bother with a Quantum Financial business demo, right? Well, guys, think of it as your ultimate cheat sheet to the world of business banking with Quantum Financial. In today’s fast-paced business environment, efficiency and clarity in financial management aren’t just nice-to-haves; they’re absolute must-haves. A demo allows you to virtually walk through the entire platform. You get to see firsthand how easy it is to manage your accounts, process payments, track expenses, and access sophisticated reporting tools. This isn’t just about looking at pretty interfaces; it’s about understanding the real-world application of these tools for your specific business. Are you struggling with international payments? Worried about fraud? Need better insights into your cash flow? A demo lets you ask those specific questions and see how Quantum Financial’s solutions can address them. It’s also a fantastic opportunity to get a feel for the user experience. Is the platform intuitive? Can your team easily navigate it? The demo provides a no-pressure environment to explore, interact, and evaluate without any commitment. It’s about empowering yourself with knowledge so you can make an informed decision that aligns with your business goals and operational needs. Plus, you get to see how Quantum Financial integrates with other business tools you might already be using, saving you time and preventing data silos. This proactive approach to understanding your financial tools can save you a ton of headaches down the line and ensure you’re leveraging the best resources available to drive your business forward. It’s your chance to see the future of your business finances, laid out before you, in a clear and interactive way. What to Expect During Your Quantum Financial Business Demo Alright, let’s talk turkey about what actually happens when you sign up for a Quantum Financial business demo. Think of this as your backstage pass to Quantum Financial’s business banking powerhouse. Typically, your demo will be led by a Quantum Financial representative who is knowledgeable about their business services. They’ll usually tailor the session to your specific industry and business size, which is super cool because it means you’re not sitting through a generic presentation. They’ll likely start by getting a feel for your current financial processes and pain points. This is your cue to lay it all out – what’s working, what’s not, and what you’re hoping to achieve. Then, they’ll guide you through the core features of their business banking platform. Expect to see a walkthrough of account management – how to view balances, transaction history, and statements with ease. They’ll showcase payment solutions, whether it’s domestic transfers, international wires, or setting up payroll. If you deal with receivables, they’ll probably demonstrate how you can receive payments efficiently. A big part of modern business banking is security, so be prepared for them to highlight features like multi-factor authentication, fraud monitoring, and secure messaging. You’ll also likely get a peek at their reporting and analytics tools. These are goldmines for understanding your financial health, tracking spending patterns, and forecasting cash flow. Don’t be shy! This is your demo. Ask questions. Lots of them. How does this integrate with my accounting software? What are the fees associated with these services? What kind of support can I expect if I run into an issue? The more you engage, the more valuable the demo will be. They might also touch upon specialized services like treasury management, foreign exchange, or lending options, depending on your business needs. The goal is to give you a comprehensive, yet focused, overview of how Quantum Financial can become an integral part of your business’s financial ecosystem. It’s about seeing the technology in action and understanding how it translates into tangible benefits for your daily operations and long-term strategy. Remember, this is a conversation, not just a presentation. Use it to your advantage to gather all the intel you need to make a sound decision. Key Features to Look For When you’re in the thick of a Quantum Financial business demo, guys, you want to keep an eye out for specific features that will truly make a difference for your business. It’s easy to get dazzled by a slick interface, but what really matters are the functionalities that directly impact your bottom line and day-to-day operations. First up, user-friendliness and accessibility. Can you and your team easily log in, navigate the dashboard, and find what you need without a steep learning curve? Look for intuitive design and clear navigation. Next, focus on payment and collection capabilities. How robust are their options for making and receiving payments? Consider domestic and international transfers, wire services, ACH, and potentially mobile check deposit. For collections, explore how easily you can invoice clients and receive payments, whether through online portals or integrated solutions. Security features are non-negotiable. Probe into their multi-factor authentication protocols, real-time fraud monitoring, secure messaging systems, and any advanced security measures they employ to protect your sensitive financial data. Ask about their disaster recovery and business continuity plans – crucial for peace of mind. Then there are the reporting and analytics tools. Are they comprehensive? Can you generate custom reports? Do they offer insights into cash flow, spending trends, and financial forecasting? Good data visualization and easy-to-understand reports are key to making informed business decisions. Integration capabilities are also a huge plus. Does the platform integrate seamlessly with your existing accounting software (like QuickBooks, Xero, etc.), ERP systems, or other business applications? This can save immense time and reduce manual data entry errors. Don’t forget to ask about customer support. What are their support hours? What channels are available (phone, chat, email)? What’s the typical response time for inquiries? For businesses operating globally, explore their international banking services. This includes multi-currency accounts, foreign exchange services, and international trade finance options. Lastly, consider any value-added services like business loans, lines of credit, merchant services, or specialized industry solutions. A demo is the perfect time to understand the full spectrum of what Quantum Financial offers beyond basic banking. `,ujn=({logs:e,isOpen:t,onClose:n})=>{const r=f.useRef(null);return f.useEffect(()=>{t&&r.current&&r.current.scrollIntoView({behavior:"smooth"})},[e,t]),t?a.jsxs("div",{className:"fixed bottom-4 right-4 w-96 h-64 bg-black/90 border border-green-500/30 rounded-lg shadow-2xl backdrop-blur-md z-50 flex flex-col font-mono text-xs overflow-hidden transition-all duration-300 animate-in slide-in-from-bottom-10",children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 bg-gray-900 border-b border-gray-800",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500 animate-pulse"}),a.jsx("span",{className:"text-green-400 font-bold tracking-wider",children:"SECURE_AUDIT_STREAM_V4"})]}),a.jsx("button",{onClick:n,className:"text-gray-500 hover:text-white transition-colors",children:a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-2 scrollbar-thin scrollbar-thumb-gray-700",children:[e.map(o=>a.jsxs("div",{className:"flex space-x-2",children:[a.jsxs("span",{className:"text-gray-500",children:["[",o.timestamp.split("T")[1].split(".")[0],"]"]}),a.jsxs("span",{className:`${o.status==="ERROR"?"text-red-500":o.status==="WARNING"?"text-yellow-500":o.status==="SUCCESS"?"text-green-500":"text-blue-400"}`,children:[o.action,":"]}),a.jsx("span",{className:"text-gray-300",children:o.details})]},o.id)),a.jsx("div",{ref:r})]})]}):null},djn=({isOpen:e,onClose:t,onSendMessage:n,messages:r,isThinking:o})=>{const[i,s]=f.useState(""),l=f.useRef(null);f.useEffect(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[r,e]);const c=async u=>{if(u.preventDefault(),!i.trim())return;const d=i;s(""),await n(d)};return e?a.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4 animate-in fade-in duration-200",children:a.jsxs("div",{className:"w-full max-w-2xl bg-gray-900 border border-cyan-500/30 rounded-2xl shadow-[0_0_50px_rgba(6,182,212,0.15)] overflow-hidden flex flex-col h-[600px]",children:[a.jsxs("div",{className:"bg-gray-800/50 p-4 border-b border-gray-700 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-cyan-500 to-blue-600 flex items-center justify-center shadow-lg shadow-cyan-500/20",children:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"2",children:[a.jsx("path",{d:"M12 2a10 10 0 1 0 10 10H12V2z"}),a.jsx("path",{d:"M12 12L2.1 12.1"}),a.jsx("path",{d:"M12 12l8.5-5.5"})]})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-bold text-lg",children:"Quantum AI Advisor"}),a.jsx("p",{className:"text-cyan-400 text-xs uppercase tracking-wider",children:"Secure Connection • Gemini-3-Flash"})]})]}),a.jsx("button",{onClick:t,className:"p-2 hover:bg-gray-700 rounded-full transition-colors text-gray-400 hover:text-white",children:a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:a.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6 bg-gradient-to-b from-gray-900 to-black",ref:l,children:[r.length===0&&a.jsxs("div",{className:"text-center py-10 opacity-50",children:[a.jsx("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-gray-800 flex items-center justify-center",children:a.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",className:"text-cyan-500",children:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}),a.jsx("p",{className:"text-gray-400",children:"Ask me about the Quantum Financial Demo, security protocols, or how to link your institutional accounts."})]}),r.map(u=>a.jsx("div",{className:`flex ${u.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[80%] rounded-2xl p-4 ${u.role==="user"?"bg-cyan-900/30 border border-cyan-500/30 text-cyan-50 rounded-tr-none":u.role==="system"?"bg-red-900/20 border border-red-500/30 text-red-200 w-full text-center text-sm font-mono":"bg-gray-800 border border-gray-700 text-gray-100 rounded-tl-none shadow-lg"}`,children:[a.jsx("p",{className:"whitespace-pre-wrap leading-relaxed",children:u.content}),a.jsx("span",{className:"text-[10px] opacity-40 mt-2 block text-right",children:u.timestamp.toLocaleTimeString()})]})},u.id)),o&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-gray-800 rounded-2xl rounded-tl-none p-4 flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-cyan-500 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("div",{className:"w-2 h-2 bg-cyan-500 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("div",{className:"w-2 h-2 bg-cyan-500 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})})]}),a.jsxs("div",{className:"p-4 bg-gray-800/80 border-t border-gray-700 backdrop-blur-md",children:[a.jsxs("form",{onSubmit:c,className:"relative",children:[a.jsx("input",{type:"text",value:i,onChange:u=>s(u.target.value),placeholder:"Ask about the demo or type 'help'...",className:"w-full bg-gray-900 text-white border border-gray-600 rounded-xl py-4 pl-5 pr-14 focus:outline-none focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 transition-all placeholder-gray-500"}),a.jsx("button",{type:"submit",disabled:!i.trim()||o,className:"absolute right-2 top-2 bottom-2 p-2 bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("path",{d:"M22 2L11 13"}),a.jsx("path",{d:"M22 2l-7 20-4-9-9-4 20-7z"})]})})]}),a.jsxs("div",{className:"mt-2 flex justify-center space-x-4 text-[10px] text-gray-500 uppercase tracking-widest",children:[a.jsx("span",{children:"Encrypted via TLS 1.3"}),a.jsx("span",{children:"•"}),a.jsx("span",{children:"Audit Logging Active"}),a.jsx("span",{children:"•"}),a.jsx("span",{children:"Gemini Powered"})]})]})]})}):null},Frt=({onSuccess:e,className:t,label:n="Test Drive The Platform",disabled:r})=>{const[o,i]=f.useState(null),[s,l]=f.useState(!0),[c,u]=f.useState([]),[d,p]=f.useState(!1),[h,m]=f.useState(!1),[g,y]=f.useState([]),[x,v]=f.useState(!1),[b,w]=f.useState(!1),S=f.useCallback((P,E,M="INFO")=>{const R={id:Math.random().toString(36).substr(2,9),timestamp:new Date().toISOString(),action:P,details:E,status:M};u($=>[...$,R].slice(-50)),console.log(`[AUDIT] ${P}: ${E}`)},[]),C=async P=>{const E={id:Date.now().toString(),role:"user",content:P,timestamp:new Date};y(M=>[...M,E]),v(!0),S("AI_QUERY_INIT",`Prompt length: ${P.length}`,"INFO");try{const M=localStorage.getItem("gemini_api_key");if(!M)throw new Error("MISSING_CREDENTIALS: GEMINI_API_KEY not found in secure storage.");const R=new Ko({apiKey:M}),$=` CONTEXT: YOU ARE THE "QUANTUM FINANCIAL" AI CONCIERGE. YOUR GOAL: SELL THE "TEST DRIVE" EXPERIENCE. TONE: ELITE, PROFESSIONAL, HIGH-PERFORMANCE, SECURE. KNOWLEDGE BASE: ${cjn} INSTRUCTIONS: - Answer the user's question based on the Knowledge Base. - Always refer to the bank as "Quantum Financial" or "The Demo Bank". - Never use the name "Citibank". - If asked about technical details, emphasize security (Multi-factor, Fraud monitoring). - If asked about the demo, describe it as "kicking the tires" or "seeing the engine roar". - Keep responses concise but impactful. `,V=(await R.getGenerativeModel({model:"gemini-1.5-flash",systemInstruction:$}).generateContent(P)).response.text(),B={id:(Date.now()+1).toString(),role:"ai",content:V,timestamp:new Date};y(G=>[...G,B]),S("AI_QUERY_SUCCESS","Response generated successfully","SUCCESS")}catch(M){S("AI_QUERY_FAILURE",M.message||"Unknown error","ERROR");const R={id:(Date.now()+1).toString(),role:"system",content:"SECURE CONNECTION INTERRUPTED. Please ensure GEMINI_API_KEY is configured in your environment variables or settings.",timestamp:new Date};y($=>[...$,R])}finally{v(!1)}};f.useEffect(()=>{(async()=>{l(!0),S("PLAID_INIT","Requesting Link Token from Nexus API...","INFO");try{const E=await fetch("/api/plaid/create_link_token",{method:"POST",headers:{"Content-Type":"application/json"}});if(!E.ok){S("PLAID_FALLBACK","API unreachable. Engaging Simulation Mode.","WARNING"),setTimeout(()=>{i(`link-sandbox-${Math.random().toString(36).substr(2)}`),l(!1),S("PLAID_READY","Simulation Token Acquired.","SUCCESS")},1500);return}const M=await E.json();i(M.link_token),S("PLAID_READY","Secure Link Token Acquired.","SUCCESS")}catch(E){S("PLAID_ERROR",E.message,"ERROR"),i("link-sandbox-demo-fallback")}finally{l(!1)}})()},[S]);const N=f.useCallback((P,E)=>{var M;S("LINK_SUCCESS",`Institution: ${((M=E.institution)==null?void 0:M.name)||"Unknown"}`,"SUCCESS"),e(P,E)},[e,S]),j=f.useCallback((P,E)=>{P?S("LINK_EXIT_ERROR",`Code: ${P.error_code} - ${P.error_message}`,"ERROR"):S("LINK_EXIT","User closed the portal.","INFO")},[S]),I={token:o,onSuccess:N,onExit:j},{open:_,ready:T}=ljn(I);return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[a.jsxs("div",{className:"relative group",children:[a.jsx("div",{className:`absolute -inset-1 bg-gradient-to-r from-cyan-600 to-blue-600 rounded-2xl blur opacity-25 group-hover:opacity-75 transition duration-1000 group-hover:duration-200 ${T?"":"hidden"}`}),a.jsxs("button",{onClick:()=>{S("USER_INTERACTION","Initiated Link Flow","INFO"),_()},disabled:!T||r||s,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),className:`relative flex items-center justify-between py-4 px-8 bg-black rounded-xl leading-none border border-gray-800 shadow-2xl transition-all duration-300 ${t||""} ${T?"hover:scale-[1.02] active:scale-[0.98]":"opacity-70 cursor-not-allowed"}`,children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"relative w-8 h-8",children:[a.jsx("div",{className:`absolute inset-0 bg-cyan-500 rounded-full opacity-20 ${b?"animate-ping":""}`}),a.jsx("svg",{className:`w-8 h-8 text-cyan-400 transition-transform duration-500 ${b?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 10V3L4 14h7v7l9-11h-7z"})})]}),a.jsxs("div",{className:"text-left",children:[a.jsx("div",{className:"text-gray-400 text-[10px] font-bold tracking-widest uppercase mb-1",children:s?"INITIALIZING PROTOCOLS...":"SECURE GATEWAY"}),a.jsx("div",{className:"text-white font-bold text-lg tracking-wide font-mono",children:n})]})]}),a.jsxs("div",{className:"ml-8 flex flex-col items-end",children:[a.jsx("div",{className:`h-2 w-2 rounded-full mb-1 ${T?"bg-green-500 shadow-[0_0_10px_#22c55e]":"bg-yellow-500 animate-pulse"}`}),a.jsx("span",{className:"text-[9px] text-gray-600 font-mono",children:T?"READY":"SYNCING"})]})]})]}),a.jsxs("div",{className:"flex space-x-4 text-xs font-mono",children:[a.jsxs("button",{onClick:()=>m(!0),className:"flex items-center space-x-2 text-cyan-500 hover:text-cyan-300 transition-colors group",children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",className:"group-hover:animate-bounce",children:a.jsx("path",{d:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"})}),a.jsx("span",{children:"ASK AI CONCIERGE"})]}),a.jsx("span",{className:"text-gray-700",children:"|"}),a.jsxs("button",{onClick:()=>p(!d),className:`flex items-center space-x-2 transition-colors ${d?"text-green-400":"text-gray-500 hover:text-gray-300"}`,children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:a.jsx("path",{d:"M4 17l6-6-6-6M12 19h8"})}),a.jsx("span",{children:d?"HIDE SYSTEM LOGS":"VIEW SYSTEM LOGS"})]})]})]}),a.jsx(ujn,{logs:c,isOpen:d,onClose:()=>p(!1)}),a.jsx(djn,{isOpen:h,onClose:()=>m(!1),onSendMessage:C,messages:g,isThinking:x})]})};class IP{constructor(){}static getInstance(){return IP.instance||(IP.instance=new IP),IP.instance}async createLinkToken(t,n,r){return console.log(`[MOCK] PlaidService: Requesting link token for user ${t}`),new Promise(o=>{setTimeout(()=>{o({link_token:`link-sandbox-${Date.now()}`})},500)})}async exchangePublicToken(t,n){return console.log(`[MOCK] PlaidService: Exchanging public token: ${t}`),new Promise(r=>{setTimeout(()=>{const o=new Date,i=n.accounts.map(l=>({id:l.id,institutionId:n.institution.institution_id,name:l.name,mask:l.mask,type:l.type,subtype:l.subtype})),s={id:`item-${Date.now()}`,name:n.institution.name,institutionId:n.institution.institution_id,connectedAccounts:i,metadata:n,lastUpdated:o,status:"connected"};r(s)},1e3)})}}const fjn=()=>{const[e,t]=f.useState([]),n=f.useRef(IP.getInstance()),[r,o]=f.useState(""),i=async(l,c)=>{const u=await n.current.exchangePublicToken(l,c);t(d=>[...d,u])};return a.jsxs("div",{className:"space-y-8",children:[a.jsxs(Ft,{title:"The Financial Democracy Toolkit",children:[a.jsx("p",{className:"text-gray-300",children:"This is the toolkit promised in our manifesto. Below are the production-grade components you can use to build your own financial applications. They are designed to be robust, secure, and incredibly easy to implement."}),a.jsxs("div",{className:"relative mt-4",children:[a.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:a.jsx("svg",{className:"h-5 w-5 text-gray-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})})}),a.jsx("input",{type:"text",name:"search",id:"search",className:"block w-full bg-gray-900/50 border border-gray-600 rounded-md py-2 pl-10 pr-3 text-sm placeholder-gray-400 text-white focus:outline-none focus:ring-1 focus:ring-cyan-500 focus:border-cyan-500",placeholder:"Search the toolkit (e.g., 'Plaid Button', 'Transaction Component')...",value:r,onChange:l=>o(l.target.value)})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[a.jsx(Ft,{title:"Live Demo: Connect Your Bank",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Experience the seamless, secure connection flow. This is a high-fidelity simulation of the Plaid Link integration, ready to be dropped into your application."}),a.jsx(Frt,{onSuccess:i}),a.jsxs("div",{className:"pt-4",children:[a.jsx("h4",{className:"font-semibold text-white mb-2",children:"Connected Institutions:"}),e.length===0?a.jsx("p",{className:"text-sm text-gray-500 text-center py-4",children:"No institutions linked yet."}):a.jsx("div",{className:"space-y-3",children:e.map(l=>a.jsxs("div",{className:"p-3 bg-gray-900/50 rounded-lg",children:[a.jsx("p",{className:"font-semibold text-white",children:l.name}),a.jsxs("p",{className:"text-xs text-gray-400",children:["Accounts: ",l.connectedAccounts.map(c=>c.name).join(", ")]})]},l.id))})]})]})}),a.jsxs(Ft,{title:"Implementation: 10 Lines of Code",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Adding a bank connection to your app is as simple as using our `PlaidLinkButton` component. We handle the complexity, you focus on your idea."}),a.jsxs("div",{className:"bg-gray-900 rounded-lg overflow-hidden",children:[a.jsx("div",{className:"p-2 bg-gray-800 text-xs text-gray-400",children:"YourAwesomeApp.tsx"}),a.jsx("pre",{className:"p-4 text-xs text-white overflow-x-auto",children:a.jsx("code",{children:` import React from 'react'; import PlaidLinkButton from './PlaidLinkButton'; // Assuming export const MyAwesomeApp = () => { const handleSuccess = (publicToken, metadata) => { console.log("It's that easy!", metadata.institution.name); // Now, send the publicToken to your server to get an access token. }; return (

My Fintech App

); }; `.trim()})})]})]})]}),a.jsxs(Ft,{title:"Developer API Keys",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Generate API keys to integrate our toolkit directly into your backend services. This is a simulation of a developer portal."}),a.jsxs("div",{className:"p-3 bg-gray-900/50 rounded-lg",children:[a.jsx("p",{className:"font-semibold text-white",children:"My Sandbox Key"}),a.jsx("p",{className:"text-xs text-gray-400 font-mono bg-gray-800 p-2 rounded mt-2",children:"sk_sandbox_123abc456def789ghi_".padEnd(40,"*")})]})]})]})},Ise=(()=>{const e=new Map,t="QUANTUM_INTERNAL_SECRET_0x8821",n=o=>btoa(o.split("").map((i,s)=>String.fromCharCode(i.charCodeAt(0)^t.charCodeAt(s%t.length))).join("")),r=o=>atob(o).split("").map((s,l)=>String.fromCharCode(s.charCodeAt(0)^t.charCodeAt(l%t.length))).join("");return{setItem:(o,i)=>{const s=n(JSON.stringify(i));e.set(o,s)},getItem:o=>{const i=e.get(o);return i?JSON.parse(r(i)):null},has:o=>e.has(o),clear:()=>e.clear()}})(),_P={log:(e,t,n="INFO")=>{const r=Ise.getItem("audit_logs")||[],o={timestamp:new Date().toISOString(),action:e,details:t,severity:n,id:Math.random().toString(36).substring(2,15)};Ise.setItem("audit_logs",[o,...r].slice(0,100)),console.log(`[AUDIT] ${n}: ${e}`,t)}},AS=({title:e,children:t,icon:n,className:r})=>a.jsxs("div",{className:`bg-[#0a0a0c] border border-white/10 rounded-3xl overflow-hidden shadow-2xl transition-all hover:border-indigo-500/30 ${r}`,children:[a.jsxs("div",{className:"px-6 py-4 border-b border-white/5 flex items-center justify-between bg-gradient-to-r from-transparent to-white/[0.02]",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[n&&a.jsx("div",{className:"text-indigo-400",children:n}),a.jsx("h3",{className:"text-xs font-black uppercase tracking-[0.2em] text-gray-300",children:e})]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-red-500/50"}),a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-yellow-500/50"}),a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-green-500/50"})]})]}),a.jsx("div",{className:"p-6",children:t})]}),pjn=({isOpen:e,onClose:t,onComplete:n})=>{const[r,o]=f.useState(1),[i,s]=f.useState(!1);if(!e)return null;const l=()=>{s(!0),_P.log("STRIPE_PAYMENT_INITIATED",{amount:499,currency:"USD"}),setTimeout(()=>{s(!1),o(2),_P.log("STRIPE_PAYMENT_SUCCESS",{transactionId:"pi_3N"+Math.random().toString(36).substring(7)})},2500)};return a.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm",children:a.jsxs("div",{className:"bg-white rounded-2xl w-full max-w-md overflow-hidden shadow-[0_0_50px_rgba(99,102,241,0.3)]",children:[a.jsxs("div",{className:"bg-[#635bff] p-6 text-white flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(yh,{size:24}),a.jsx("span",{className:"font-bold text-lg",children:"Quantum Pay"})]}),a.jsx("button",{onClick:t,className:"hover:opacity-70",children:"✕"})]}),a.jsx("div",{className:"p-8",children:r===1?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center border-b pb-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-500 text-sm",children:"Ad Studio Credits"}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:"5,000 Units"})]}),a.jsx("p",{className:"text-xl font-medium text-gray-900",children:"$499.00"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-xs font-bold text-gray-400 uppercase",children:"Card Information"}),a.jsxs("div",{className:"border rounded-lg p-3 flex items-center gap-3 bg-gray-50",children:[a.jsx(yh,{className:"text-gray-400",size:20}),a.jsx("input",{className:"bg-transparent outline-none text-gray-800 w-full",placeholder:"4242 4242 4242 4242"})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-xs font-bold text-gray-400 uppercase",children:"Expiry"}),a.jsx("input",{className:"border rounded-lg p-3 bg-gray-50 w-full",placeholder:"MM / YY"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-xs font-bold text-gray-400 uppercase",children:"CVC"}),a.jsx("input",{className:"border rounded-lg p-3 bg-gray-50 w-full",placeholder:"123"})]})]})]}),a.jsx("button",{onClick:l,disabled:i,className:"w-full py-4 bg-[#635bff] hover:bg-[#5a51e6] text-white font-bold rounded-lg transition-all flex items-center justify-center gap-2",children:i?a.jsx(cw,{className:"animate-spin"}):"Pay $499.00"}),a.jsx("p",{className:"text-[10px] text-center text-gray-400",children:"Powered by Stripe. Secure, encrypted, and audited."})]}):a.jsxs("div",{className:"text-center space-y-6 py-4",children:[a.jsx("div",{className:"w-20 h-20 bg-green-100 text-green-600 rounded-full flex items-center justify-center mx-auto",children:a.jsx(xh,{size:40})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-2xl font-bold text-gray-900",children:"Payment Successful"}),a.jsx("p",{className:"text-gray-500",children:"Your credits have been added to your Quantum Vault."})]}),a.jsx("button",{onClick:()=>{n(),t()},className:"w-full py-4 bg-gray-900 text-white font-bold rounded-lg",children:"Return to Studio"})]})})]})})},hjn=()=>{const[e,t]=f.useState("A hyper-realistic cinematic commercial for Quantum Financial, showcasing global connectivity, high-speed data streams, and elite security vaults."),[n,r]=f.useState(!1),[o,i]=f.useState(null),[s,l]=f.useState(null),[c,u]=f.useState(0),[d,p]=f.useState(""),[h,m]=f.useState([{role:"ai",text:"Welcome to the Quantum Ad Studio. I am your AI Creative Director. How can I help you build your brand's vision today?"}]),[g,y]=f.useState(!1),[x,v]=f.useState(1250),[b,w]=f.useState(!1),[S,C]=f.useState(!1),N=f.useRef(null),j=["Initializing Neural Video Synthesis Engine...","Analyzing semantic intent vectors...","Generating high-fidelity frame buffer...","Executing temporal coherence algorithms...","Optimizing lighting and global illumination...","Finalizing secure asset manifest..."];f.useEffect(()=>{var P;(P=N.current)==null||P.scrollIntoView({behavior:"smooth"})},[h]);const I=async P=>{var R,$,D,z;const E=P||e;if(!E.trim())return;if(x<500){y(!0);return}r(!0),l(null),i(null),u(0),_P.log("VIDEO_GENERATION_STARTED",{prompt:E});const M=setInterval(()=>{u(V=>(V+1)%j.length)},3e3);try{const V=new Ko({apiKey:void 0});let B=await V.models.generateVideos({model:"gemini-3-flash-preview",prompt:E,config:{numberOfVideos:1,resolution:"720p",aspectRatio:"16:9"}});for(;!B.done;)await new Promise(H=>setTimeout(H,5e3)),B=await V.operations.getVideosOperation({operation:B});if(B.error)throw new Error(B.error.message||"Generation failed");const G=(z=(D=($=(R=B.response)==null?void 0:R.generatedVideos)==null?void 0:$[0])==null?void 0:D.video)==null?void 0:z.uri;if(G){const F=await(await fetch(`${G}&key=undefined`)).blob(),W=URL.createObjectURL(F);i(W),v(U=>U-500),_P.log("VIDEO_GENERATION_SUCCESS",{url:W})}}catch(V){console.error(V),l(V.message||"An unexpected error occurred during generation."),_P.log("VIDEO_GENERATION_FAILED",{error:V.message},"WARN")}finally{clearInterval(M),r(!1)}},_=async()=>{if(!d.trim())return;const P=d;p(""),m(E=>[...E,{role:"user",text:P}]),C(!0);try{const M=new Ko({apiKey:void 0}).getGenerativeModel({model:"gemini-3-flash-preview"}),R=` You are the Quantum Financial AI Assistant. You help users create video ads, manage their credits, and understand their financial data. If the user wants to create a video, describe it and then say "[ACTION:GENERATE_VIDEO: prompt]". If the user wants to add credits, say "[ACTION:OPEN_STRIPE]". Be elite, professional, and high-performance. Current Credits: ${x}. `,D=(await M.generateContent([R,P])).response.text();if(m(z=>[...z,{role:"ai",text:D}]),D.includes("[ACTION:GENERATE_VIDEO:")){const z=D.match(/\[ACTION:GENERATE_VIDEO:\s*(.*?)\]/);z&&z[1]&&(t(z[1]),I(z[1]))}D.includes("[ACTION:OPEN_STRIPE]")&&y(!0),_P.log("AI_CHAT_INTERACTION",{userMsg:P,aiResponse:D})}catch{m(M=>[...M,{role:"ai",text:"I apologize, but my neural links are currently saturated. Please try again in a moment."}])}finally{C(!1)}},T=Ise.getItem("audit_logs")||[];return a.jsxs("div",{className:"min-h-screen bg-[#050505] text-white font-sans selection:bg-indigo-500/30",children:[a.jsx("nav",{className:"border-b border-white/5 bg-black/50 backdrop-blur-xl sticky top-0 z-50",children:a.jsxs("div",{className:"max-w-[1600px] mx-auto px-8 h-20 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-8",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-indigo-600 to-blue-700 rounded-xl flex items-center justify-center shadow-[0_0_20px_rgba(79,70,229,0.4)]",children:a.jsx(_a,{className:"text-white fill-white",size:20})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-black tracking-tighter uppercase italic leading-none",children:"Quantum"}),a.jsx("p",{className:"text-[10px] font-bold text-indigo-400 tracking-[0.3em] uppercase",children:"Financial"})]})]}),a.jsx("div",{className:"h-8 w-[1px] bg-white/10"}),a.jsx("div",{className:"flex gap-6",children:["Dashboard","Payments","Studio","Analytics","Vault"].map(P=>a.jsx("button",{className:`text-xs font-bold uppercase tracking-widest transition-colors ${P==="Studio"?"text-white":"text-gray-500 hover:text-white"}`,children:P},P))})]}),a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 bg-white/5 rounded-full border border-white/10",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),a.jsxs("span",{className:"text-[10px] font-black uppercase tracking-widest text-gray-300",children:[x," Credits"]}),a.jsx("button",{onClick:()=>y(!0),className:"text-indigo-400 hover:text-indigo-300 transition-colors",children:a.jsx(qf,{size:14})})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:()=>w(!b),className:"p-2 text-gray-400 hover:text-white transition-colors",children:a.jsx(Xi,{size:20})}),a.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-tr from-gray-800 to-gray-700 border border-white/20 flex items-center justify-center font-bold text-xs",children:"JD"})]})]})]})}),a.jsxs("main",{className:"max-w-[1600px] mx-auto p-8 space-y-8",children:[a.jsxs("header",{className:"flex flex-col md:flex-row md:items-end justify-between gap-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2 text-indigo-400",children:[a.jsx(mm,{size:16}),a.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.4em]",children:"Next-Gen Marketing"})]}),a.jsx("h2",{className:"text-5xl font-black tracking-tighter uppercase italic",children:"AI Ad Studio"}),a.jsx("p",{className:"text-gray-400 max-w-xl text-sm leading-relaxed",children:'Experience the "Golden Ticket" of financial marketing. Test drive our neural synthesis engine to create high-performance cinematic assets for your global enterprise.'})]}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("button",{className:"px-6 py-3 bg-white/5 hover:bg-white/10 border border-white/10 rounded-xl text-xs font-bold uppercase tracking-widest transition-all flex items-center gap-2",children:[a.jsx(Fu,{size:16})," Templates"]}),a.jsxs("button",{className:"px-6 py-3 bg-indigo-600 hover:bg-indigo-500 rounded-xl text-xs font-bold uppercase tracking-widest transition-all shadow-lg shadow-indigo-500/20 flex items-center gap-2",children:[a.jsx(XI,{size:16})," New Project"]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8",children:[a.jsxs("div",{className:"lg:col-span-8 space-y-8",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsx(AS,{title:"Creative Directives",icon:a.jsx(Ei,{size:18}),children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"relative",children:[a.jsx("textarea",{value:e,onChange:P=>t(P.target.value),className:"w-full h-48 bg-black/40 border border-white/10 rounded-2xl p-6 text-white text-sm focus:ring-2 focus:ring-indigo-500 outline-none resize-none font-sans transition-all placeholder:text-gray-700",placeholder:"Describe the cinematic vision...",disabled:n}),a.jsxs("div",{className:"absolute bottom-4 right-4 flex gap-2",children:[a.jsx("button",{className:"p-2 bg-white/5 hover:bg-white/10 rounded-lg text-gray-400 transition-colors",children:a.jsx(vi,{size:14})}),a.jsx("button",{className:"p-2 bg-white/5 hover:bg-white/10 rounded-lg text-gray-400 transition-colors",children:a.jsx(ds,{size:14})})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"p-4 bg-white/[0.02] rounded-xl border border-white/5",children:[a.jsx("label",{className:"block text-[10px] font-bold text-gray-500 uppercase mb-2 tracking-widest",children:"Resolution"}),a.jsxs("div",{className:"text-white font-bold flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-indigo-500"})," 4K Ultra HD"]})]}),a.jsxs("div",{className:"p-4 bg-white/[0.02] rounded-xl border border-white/5",children:[a.jsx("label",{className:"block text-[10px] font-bold text-gray-500 uppercase mb-2 tracking-widest",children:"Engine"}),a.jsxs("div",{className:"text-white font-bold italic flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-blue-500"})," VEO-3.1-PREVIEW"]})]})]}),a.jsx("button",{onClick:()=>I(),disabled:n||!e.trim(),className:"w-full py-5 bg-gradient-to-r from-indigo-600 to-blue-600 hover:from-indigo-500 hover:to-blue-500 text-white font-black rounded-2xl shadow-xl shadow-indigo-500/20 transition-all disabled:opacity-50 flex items-center justify-center gap-3 uppercase tracking-[0.2em] text-xs",children:n?a.jsxs(a.Fragment,{children:[a.jsx(cw,{className:"animate-spin"})," Synthesizing Reality..."]}):a.jsxs(a.Fragment,{children:[a.jsx(hDt,{size:18})," Execute Synthesis"]})}),s&&a.jsxs("div",{className:"p-4 bg-red-500/10 border border-red-500/20 rounded-xl flex items-start gap-3",children:[a.jsx(Fme,{className:"text-red-500 shrink-0",size:18}),a.jsx("p",{className:"text-xs text-red-400 font-mono",children:s})]})]})}),a.jsxs(AS,{title:"Asset Preview",icon:a.jsx(k2,{size:18}),children:[a.jsxs("div",{className:"aspect-video bg-black rounded-2xl border border-white/5 flex flex-col items-center justify-center relative overflow-hidden group",children:[n?a.jsxs("div",{className:"text-center p-6 space-y-6 z-10",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-20 h-20 border-2 border-indigo-500/20 border-t-indigo-500 rounded-full animate-spin mx-auto"}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsx("div",{className:"w-12 h-12 border-2 border-blue-500/20 border-b-blue-500 rounded-full animate-spin-slow"})})]}),a.jsx("p",{className:"text-[10px] text-indigo-400 font-mono animate-pulse tracking-[0.2em] uppercase",children:j[c]})]}):o?a.jsx("video",{src:o,controls:!0,autoPlay:!0,loop:!0,className:"w-full h-full object-cover"}):a.jsxs("div",{className:"text-center p-8 space-y-4 opacity-20 group-hover:opacity-40 transition-opacity",children:[a.jsx("div",{className:"w-20 h-20 bg-white/5 rounded-full flex items-center justify-center mx-auto",children:a.jsx(Pp,{size:40,className:"text-gray-400"})}),a.jsx("p",{className:"text-[10px] text-gray-500 font-mono tracking-[0.3em] uppercase",children:"Awaiting Signal Ingestion"})]}),a.jsx("div",{className:"absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-20 pointer-events-none"}),a.jsxs("div",{className:"absolute top-4 left-4 flex gap-2",children:[a.jsx("div",{className:"px-2 py-1 bg-black/60 backdrop-blur-md border border-white/10 rounded text-[8px] font-bold uppercase tracking-widest",children:"Live Feed"}),a.jsx("div",{className:"px-2 py-1 bg-indigo-600/60 backdrop-blur-md border border-indigo-500/20 rounded text-[8px] font-bold uppercase tracking-widest",children:"Encrypted"})]})]}),o&&a.jsxs("div",{className:"mt-6 p-4 bg-green-500/5 rounded-xl border border-green-500/20 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),a.jsx("span",{className:"text-[10px] font-black text-green-400 uppercase tracking-widest",children:"Asset Manifest Valid"})]}),a.jsxs("a",{href:o,download:"quantum_synthesis.mp4",className:"flex items-center gap-2 text-[10px] font-black text-white bg-green-600 px-4 py-2 rounded-lg hover:bg-green-500 transition-all uppercase tracking-widest",children:[a.jsx(Ch,{size:14})," Download MP4"]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[a.jsx(AS,{title:"System Load",icon:a.jsx(YI,{size:16}),children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-end",children:[a.jsx("span",{className:"text-[10px] text-gray-500 uppercase font-bold tracking-widest",children:"Compute"}),a.jsx("span",{className:"text-xl font-black text-indigo-400",children:"94.2%"})]}),a.jsx("div",{className:"w-full bg-white/5 rounded-full h-1.5 overflow-hidden",children:a.jsx("div",{className:"bg-gradient-to-r from-indigo-500 to-blue-500 h-full w-[94%]"})}),a.jsxs("div",{className:"flex justify-between text-[8px] font-mono text-gray-600 uppercase",children:[a.jsx("span",{children:"Cluster_A: Active"}),a.jsx("span",{children:"Latency: 12ms"})]})]})}),a.jsx(AS,{title:"ERP Sync",icon:a.jsx(rl,{size:16}),children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-blue-500/10 rounded-lg text-blue-400",children:a.jsx(xh,{size:16})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] font-bold text-white uppercase",children:"SAP S/4HANA"}),a.jsx("p",{className:"text-[8px] text-gray-500 uppercase",children:"Last Sync: 2m ago"})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-green-500/10 rounded-lg text-green-400",children:a.jsx(xh,{size:16})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] font-bold text-white uppercase",children:"Oracle NetSuite"}),a.jsx("p",{className:"text-[8px] text-gray-500 uppercase",children:"Last Sync: 5m ago"})]})]})]})}),a.jsx(AS,{title:"Security",icon:a.jsx(ri,{size:16}),children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase",children:"MFA Status"}),a.jsx("span",{className:"text-[10px] font-bold text-green-500 uppercase",children:"Verified"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase",children:"Fraud Scan"}),a.jsx("span",{className:"text-[10px] font-bold text-indigo-400 uppercase",children:"Clear"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase",children:"Encryption"}),a.jsx("span",{className:"text-[10px] font-bold text-white uppercase",children:"AES-256-GCM"})]})]})})]})]}),a.jsxs("div",{className:"lg:col-span-4 space-y-8",children:[a.jsxs(AS,{title:"Quantum Assistant",icon:a.jsx(Lw,{size:18}),className:"h-[600px] flex flex-col",children:[a.jsxs("div",{className:"flex-1 overflow-y-auto space-y-4 pr-2 custom-scrollbar",children:[h.map((P,E)=>a.jsx("div",{className:`flex ${P.role==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[85%] p-4 rounded-2xl text-xs leading-relaxed ${P.role==="user"?"bg-indigo-600 text-white rounded-tr-none":"bg-white/5 text-gray-300 border border-white/10 rounded-tl-none"}`,children:P.text})},E)),S&&a.jsx("div",{className:"flex justify-start",children:a.jsx("div",{className:"bg-white/5 p-4 rounded-2xl rounded-tl-none border border-white/10",children:a.jsx(cw,{className:"animate-spin text-indigo-400",size:16})})}),a.jsx("div",{ref:N})]}),a.jsxs("div",{className:"mt-6 relative",children:[a.jsx("input",{value:d,onChange:P=>p(P.target.value),onKeyDown:P=>P.key==="Enter"&&_(),placeholder:"Ask the AI to create or manage...",className:"w-full bg-white/5 border border-white/10 rounded-xl py-4 pl-4 pr-12 text-xs focus:ring-2 focus:ring-indigo-500 outline-none transition-all"}),a.jsx("button",{onClick:_,className:"absolute right-2 top-2 p-2 bg-indigo-600 hover:bg-indigo-500 rounded-lg text-white transition-all",children:a.jsx(Lc,{size:16})})]})]}),b&&a.jsx(AS,{title:"Audit Trail",icon:a.jsx(Bs,{size:18}),className:"animate-in slide-in-from-right duration-300",children:a.jsx("div",{className:"space-y-3 max-h-[300px] overflow-y-auto pr-2 custom-scrollbar",children:T.length===0?a.jsx("p",{className:"text-[10px] text-gray-600 italic",children:"No sensitive actions logged in this session."}):T.map(P=>a.jsxs("div",{className:"p-3 bg-white/[0.02] border border-white/5 rounded-lg space-y-1",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:`text-[8px] font-black uppercase ${P.severity==="CRITICAL"?"text-red-500":P.severity==="WARN"?"text-yellow-500":"text-indigo-400"}`,children:P.action}),a.jsx("span",{className:"text-[8px] text-gray-600 font-mono",children:new Date(P.timestamp).toLocaleTimeString()})]}),a.jsx("p",{className:"text-[9px] text-gray-400 font-mono truncate",children:JSON.stringify(P.details)})]},P.id))})}),a.jsx(AS,{title:"Vault Storage",icon:a.jsx(ds,{size:18}),children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"p-4 bg-indigo-500/5 border border-indigo-500/20 rounded-xl",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[a.jsx(eT,{className:"text-indigo-400",size:16}),a.jsx("span",{className:"text-[10px] font-bold text-white uppercase tracking-widest",children:"Secure Keys"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-[9px] text-gray-500 uppercase",children:"API_GATEWAY"}),a.jsx("span",{className:"text-[9px] font-mono text-gray-300",children:"••••••••••••4291"})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-[9px] text-gray-500 uppercase",children:"STRIPE_LIVE"}),a.jsx("span",{className:"text-[9px] font-mono text-gray-300",children:"••••••••••••8821"})]})]})]}),a.jsx("p",{className:"text-[9px] text-gray-600 italic leading-relaxed",children:`"All integration keys are stored in the Quantum Vault using homomorphic-simulated encryption. Data is never exposed to the browser's local storage or global scope."`})]})})]})]})]}),a.jsx(pjn,{isOpen:g,onClose:()=>y(!1),onComplete:()=>{v(P=>P+5e3),m(P=>[...P,{role:"ai",text:"Excellent. Your credits have been replenished. We are ready to continue our creative journey."}])}}),a.jsxs("footer",{className:"max-w-[1600px] mx-auto px-8 py-12 border-t border-white/5 flex flex-col md:flex-row justify-between items-center gap-6",children:[a.jsxs("div",{className:"flex items-center gap-3 opacity-50",children:[a.jsx("div",{className:"w-6 h-6 bg-white/10 rounded flex items-center justify-center",children:a.jsx(_a,{size:12})}),a.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.3em]",children:"Quantum Financial © 2024"})]}),a.jsx("div",{className:"flex gap-8",children:["Security Policy","Terms of Service","API Documentation","Support"].map(P=>a.jsx("button",{className:"text-[10px] font-bold text-gray-600 hover:text-white uppercase tracking-widest transition-colors",children:P},P))}),a.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono text-gray-600",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"}),"SYSTEMS_OPERATIONAL_0x00"]})]}),a.jsx("style",{children:` .custom-scrollbar::-webkit-scrollbar { width: 4px; } .custom-scrollbar::-webkit-scrollbar-track { background: transparent; } .custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.5); } @keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(-360deg); } } .animate-spin-slow { animation: spin-slow 3s linear infinite; } `})]})};var Mk=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},mjn={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},b2,Bhe,uWe,gjn=(uWe=class{constructor(){wo(this,b2,mjn);wo(this,Bhe,!1)}setTimeoutProvider(e){Dr(this,b2,e)}setTimeout(e,t){return kt(this,b2).setTimeout(e,t)}clearTimeout(e){kt(this,b2).clearTimeout(e)}setInterval(e,t){return kt(this,b2).setInterval(e,t)}clearInterval(e){kt(this,b2).clearInterval(e)}},b2=new WeakMap,Bhe=new WeakMap,uWe),nE=new gjn;function xjn(e){setTimeout(e,0)}var pI=typeof window>"u"||"Deno"in globalThis;function sh(){}function yjn(e,t){return typeof e=="function"?e(t):e}function _se(e){return typeof e=="number"&&e>=0&&e!==1/0}function zrt(e,t){return Math.max(e+(t||0)-Date.now(),0)}function aC(e,t){return typeof e=="function"?e(t):e}function Jg(e,t){return typeof e=="function"?e(t):e}function s4e(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:l}=e;if(s){if(r){if(t.queryHash!==qxe(s,t.options))return!1}else if(!G3(t.queryKey,s))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||o&&o!==t.state.fetchStatus||i&&!i(t))}function l4e(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(hI(t.options.mutationKey)!==hI(i))return!1}else if(!G3(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function qxe(e,t){return((t==null?void 0:t.queryKeyHashFn)||hI)(e)}function hI(e){return JSON.stringify(e,(t,n)=>Pse(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function G3(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>G3(e[n],t[n])):!1}var vjn=Object.prototype.hasOwnProperty;function Brt(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=c4e(e)&&c4e(t);if(!r&&!(Pse(e)&&Pse(t)))return t;const i=(r?e:Object.keys(e)).length,s=r?t:Object.keys(t),l=s.length,c=r?new Array(l):{};let u=0;for(let d=0;d{nE.setTimeout(t,e)})}function Ase(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Brt(e,t):t}function wjn(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Sjn(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Kxe=Symbol();function Hrt(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Kxe?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Yxe(e,t){return typeof e=="function"?e(...t):!!e}function Cjn(e,t,n){let r=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??(o=t()),r||(r=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var xE,w2,DA,dWe,Njn=(dWe=class extends Mk{constructor(){super();wo(this,xE);wo(this,w2);wo(this,DA);Dr(this,DA,t=>{if(!pI&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){kt(this,w2)||this.setEventListener(kt(this,DA))}onUnsubscribe(){var t;this.hasListeners()||((t=kt(this,w2))==null||t.call(this),Dr(this,w2,void 0))}setEventListener(t){var n;Dr(this,DA,t),(n=kt(this,w2))==null||n.call(this),Dr(this,w2,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){kt(this,xE)!==t&&(Dr(this,xE,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof kt(this,xE)=="boolean"?kt(this,xE):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},xE=new WeakMap,w2=new WeakMap,DA=new WeakMap,dWe),Xxe=new Njn;function Tse(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}var jjn=xjn;function Ejn(){let e=[],t=0,n=l=>{l()},r=l=>{l()},o=jjn;const i=l=>{t?e.push(l):o(()=>{n(l)})},s=()=>{const l=e;e=[],l.length&&o(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||s()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{o=l}}}var Id=Ejn(),LA,S2,FA,fWe,Ijn=(fWe=class extends Mk{constructor(){super();wo(this,LA,!0);wo(this,S2);wo(this,FA);Dr(this,FA,t=>{if(!pI&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){kt(this,S2)||this.setEventListener(kt(this,FA))}onUnsubscribe(){var t;this.hasListeners()||((t=kt(this,S2))==null||t.call(this),Dr(this,S2,void 0))}setEventListener(t){var n;Dr(this,FA,t),(n=kt(this,S2))==null||n.call(this),Dr(this,S2,t(this.setOnline.bind(this)))}setOnline(t){kt(this,LA)!==t&&(Dr(this,LA,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return kt(this,LA)}},LA=new WeakMap,S2=new WeakMap,FA=new WeakMap,fWe),uU=new Ijn;function _jn(e){return Math.min(1e3*2**e,3e4)}function Vrt(e){return(e??"online")==="online"?uU.isOnline():!0}var kse=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Urt(e){let t=!1,n=0,r;const o=Tse(),i=()=>o.status!=="pending",s=y=>{var x;if(!i()){const v=new kse(y);h(v),(x=e.onCancel)==null||x.call(e,v)}},l=()=>{t=!0},c=()=>{t=!1},u=()=>Xxe.isFocused()&&(e.networkMode==="always"||uU.isOnline())&&e.canRun(),d=()=>Vrt(e.networkMode)&&e.canRun(),p=y=>{i()||(r==null||r(),o.resolve(y))},h=y=>{i()||(r==null||r(),o.reject(y))},m=()=>new Promise(y=>{var x;r=v=>{(i()||u())&&y(v)},(x=e.onPause)==null||x.call(e)}).then(()=>{var y;r=void 0,i()||(y=e.onContinue)==null||y.call(e)}),g=()=>{if(i())return;let y;const x=n===0?e.initialPromise:void 0;try{y=x??e.fn()}catch(v){y=Promise.reject(v)}Promise.resolve(y).then(p).catch(v=>{var N;if(i())return;const b=e.retry??(pI?0:3),w=e.retryDelay??_jn,S=typeof w=="function"?w(n,v):w,C=b===!0||typeof b=="number"&&nu()?void 0:m()).then(()=>{t?h(v):g()})})};return{promise:o,status:()=>o.status,cancel:s,continue:()=>(r==null||r(),o),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?g():m().then(g),o)}}var yE,pWe,Wrt=(pWe=class{constructor(){wo(this,yE)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_se(this.gcTime)&&Dr(this,yE,nE.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pI?1/0:300*1e3))}clearGcTimeout(){kt(this,yE)&&(nE.clearTimeout(kt(this,yE)),Dr(this,yE,void 0))}},yE=new WeakMap,pWe),vE,zA,Yg,bE,rf,zD,wE,Tx,p1,hWe,Pjn=(hWe=class extends Wrt{constructor(t){super();wo(this,Tx);wo(this,vE);wo(this,zA);wo(this,Yg);wo(this,bE);wo(this,rf);wo(this,zD);wo(this,wE);Dr(this,wE,!1),Dr(this,zD,t.defaultOptions),this.setOptions(t.options),this.observers=[],Dr(this,bE,t.client),Dr(this,Yg,kt(this,bE).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Dr(this,vE,f4e(this.options)),this.state=t.state??kt(this,vE),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=kt(this,rf))==null?void 0:t.promise}setOptions(t){if(this.options={...kt(this,zD),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=f4e(this.options);n.data!==void 0&&(this.setState(d4e(n.data,n.dataUpdatedAt)),Dr(this,vE,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&kt(this,Yg).remove(this)}setData(t,n){const r=Ase(this.state.data,t,this.options);return ki(this,Tx,p1).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ki(this,Tx,p1).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=kt(this,rf))==null?void 0:r.promise;return(o=kt(this,rf))==null||o.cancel(t),n?n.then(sh).catch(sh):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(kt(this,vE))}isActive(){return this.observers.some(t=>Jg(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Kxe||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>aC(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!zrt(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=kt(this,rf))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=kt(this,rf))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),kt(this,Yg).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(kt(this,rf)&&(kt(this,wE)?kt(this,rf).cancel({revert:!0}):kt(this,rf).cancelRetry()),this.scheduleGc()),kt(this,Yg).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ki(this,Tx,p1).call(this,{type:"invalidate"})}async fetch(t,n){var c,u,d,p,h,m,g,y,x,v,b,w;if(this.state.fetchStatus!=="idle"&&((c=kt(this,rf))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(kt(this,rf))return kt(this,rf).continueRetry(),kt(this,rf).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(C=>C.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,o=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(Dr(this,wE,!0),r.signal)})},i=()=>{const S=Hrt(this.options,n),N=(()=>{const j={client:kt(this,bE),queryKey:this.queryKey,meta:this.meta};return o(j),j})();return Dr(this,wE,!1),this.options.persister?this.options.persister(S,N,this):S(N)},l=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:kt(this,bE),state:this.state,fetchFn:i};return o(S),S})();(u=this.options.behavior)==null||u.onFetch(l,this),Dr(this,zA,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&ki(this,Tx,p1).call(this,{type:"fetch",meta:(p=l.fetchOptions)==null?void 0:p.meta}),Dr(this,rf,Urt({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,onCancel:S=>{S instanceof kse&&S.revert&&this.setState({...kt(this,zA),fetchStatus:"idle"}),r.abort()},onFail:(S,C)=>{ki(this,Tx,p1).call(this,{type:"failed",failureCount:S,error:C})},onPause:()=>{ki(this,Tx,p1).call(this,{type:"pause"})},onContinue:()=>{ki(this,Tx,p1).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const S=await kt(this,rf).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(m=(h=kt(this,Yg).config).onSuccess)==null||m.call(h,S,this),(y=(g=kt(this,Yg).config).onSettled)==null||y.call(g,S,this.state.error,this),S}catch(S){if(S instanceof kse){if(S.silent)return kt(this,rf).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw ki(this,Tx,p1).call(this,{type:"error",error:S}),(v=(x=kt(this,Yg).config).onError)==null||v.call(x,S,this),(w=(b=kt(this,Yg).config).onSettled)==null||w.call(b,this.state.data,S,this),S}finally{this.scheduleGc()}}},vE=new WeakMap,zA=new WeakMap,Yg=new WeakMap,bE=new WeakMap,rf=new WeakMap,zD=new WeakMap,wE=new WeakMap,Tx=new WeakSet,p1=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Grt(r.data,this.options),fetchMeta:t.meta??null};case"success":const o={...r,...d4e(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Dr(this,zA,t.manual?o:void 0),o;case"error":const i=t.error;return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Id.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),kt(this,Yg).notify({query:this,type:"updated",action:t})})},hWe);function Grt(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Vrt(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function d4e(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function f4e(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Qh,va,BD,th,SE,BA,j1,C2,HD,HA,VA,CE,NE,N2,UA,Es,wR,Mse,Rse,Ose,$se,Dse,Lse,Fse,qrt,mWe,Ajn=(mWe=class extends Mk{constructor(t,n){super();wo(this,Es);wo(this,Qh);wo(this,va);wo(this,BD);wo(this,th);wo(this,SE);wo(this,BA);wo(this,j1);wo(this,C2);wo(this,HD);wo(this,HA);wo(this,VA);wo(this,CE);wo(this,NE);wo(this,N2);wo(this,UA,new Set);this.options=n,Dr(this,Qh,t),Dr(this,C2,null),Dr(this,j1,Tse()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(kt(this,va).addObserver(this),p4e(kt(this,va),this.options)?ki(this,Es,wR).call(this):this.updateResult(),ki(this,Es,$se).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zse(kt(this,va),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zse(kt(this,va),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ki(this,Es,Dse).call(this),ki(this,Es,Lse).call(this),kt(this,va).removeObserver(this)}setOptions(t){const n=this.options,r=kt(this,va);if(this.options=kt(this,Qh).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Jg(this.options.enabled,kt(this,va))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ki(this,Es,Fse).call(this),kt(this,va).setOptions(this.options),n._defaulted&&!cU(this.options,n)&&kt(this,Qh).getQueryCache().notify({type:"observerOptionsUpdated",query:kt(this,va),observer:this});const o=this.hasListeners();o&&h4e(kt(this,va),r,this.options,n)&&ki(this,Es,wR).call(this),this.updateResult(),o&&(kt(this,va)!==r||Jg(this.options.enabled,kt(this,va))!==Jg(n.enabled,kt(this,va))||aC(this.options.staleTime,kt(this,va))!==aC(n.staleTime,kt(this,va)))&&ki(this,Es,Mse).call(this);const i=ki(this,Es,Rse).call(this);o&&(kt(this,va)!==r||Jg(this.options.enabled,kt(this,va))!==Jg(n.enabled,kt(this,va))||i!==kt(this,N2))&&ki(this,Es,Ose).call(this,i)}getOptimisticResult(t){const n=kt(this,Qh).getQueryCache().build(kt(this,Qh),t),r=this.createResult(n,t);return kjn(this,r)&&(Dr(this,th,r),Dr(this,BA,this.options),Dr(this,SE,kt(this,va).state)),r}getCurrentResult(){return kt(this,th)}trackResult(t,n){return new Proxy(t,{get:(r,o)=>(this.trackProp(o),n==null||n(o),o==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&kt(this,j1).status==="pending"&&kt(this,j1).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,o))})}trackProp(t){kt(this,UA).add(t)}getCurrentQuery(){return kt(this,va)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=kt(this,Qh).defaultQueryOptions(t),r=kt(this,Qh).getQueryCache().build(kt(this,Qh),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ki(this,Es,wR).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),kt(this,th)))}createResult(t,n){var _;const r=kt(this,va),o=this.options,i=kt(this,th),s=kt(this,SE),l=kt(this,BA),u=t!==r?t.state:kt(this,BD),{state:d}=t;let p={...d},h=!1,m;if(n._optimisticResults){const T=this.hasListeners(),P=!T&&p4e(t,n),E=T&&h4e(t,r,n,o);(P||E)&&(p={...p,...Grt(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:g,errorUpdatedAt:y,status:x}=p;m=p.data;let v=!1;if(n.placeholderData!==void 0&&m===void 0&&x==="pending"){let T;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(T=i.data,v=!0):T=typeof n.placeholderData=="function"?n.placeholderData((_=kt(this,VA))==null?void 0:_.state.data,kt(this,VA)):n.placeholderData,T!==void 0&&(x="success",m=Ase(i==null?void 0:i.data,T,n),h=!0)}if(n.select&&m!==void 0&&!v)if(i&&m===(s==null?void 0:s.data)&&n.select===kt(this,HD))m=kt(this,HA);else try{Dr(this,HD,n.select),m=n.select(m),m=Ase(i==null?void 0:i.data,m,n),Dr(this,HA,m),Dr(this,C2,null)}catch(T){Dr(this,C2,T)}kt(this,C2)&&(g=kt(this,C2),m=kt(this,HA),y=Date.now(),x="error");const b=p.fetchStatus==="fetching",w=x==="pending",S=x==="error",C=w&&b,N=m!==void 0,I={status:x,fetchStatus:p.fetchStatus,isPending:w,isSuccess:x==="success",isError:S,isInitialLoading:C,isLoading:C,data:m,dataUpdatedAt:p.dataUpdatedAt,error:g,errorUpdatedAt:y,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:p.dataUpdateCount>0||p.errorUpdateCount>0,isFetchedAfterMount:p.dataUpdateCount>u.dataUpdateCount||p.errorUpdateCount>u.errorUpdateCount,isFetching:b,isRefetching:b&&!w,isLoadingError:S&&!N,isPaused:p.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&N,isStale:Qxe(t,n),refetch:this.refetch,promise:kt(this,j1),isEnabled:Jg(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const T=I.data!==void 0,P=I.status==="error"&&!T,E=$=>{P?$.reject(I.error):T&&$.resolve(I.data)},M=()=>{const $=Dr(this,j1,I.promise=Tse());E($)},R=kt(this,j1);switch(R.status){case"pending":t.queryHash===r.queryHash&&E(R);break;case"fulfilled":(P||I.data!==R.value)&&M();break;case"rejected":(!P||I.error!==R.reason)&&M();break}}return I}updateResult(){const t=kt(this,th),n=this.createResult(kt(this,va),this.options);if(Dr(this,SE,kt(this,va).state),Dr(this,BA,this.options),kt(this,SE).data!==void 0&&Dr(this,VA,kt(this,va)),cU(n,t))return;Dr(this,th,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:o}=this.options,i=typeof o=="function"?o():o;if(i==="all"||!i&&!kt(this,UA).size)return!0;const s=new Set(i??kt(this,UA));return this.options.throwOnError&&s.add("error"),Object.keys(kt(this,th)).some(l=>{const c=l;return kt(this,th)[c]!==t[c]&&s.has(c)})};ki(this,Es,qrt).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ki(this,Es,$se).call(this)}},Qh=new WeakMap,va=new WeakMap,BD=new WeakMap,th=new WeakMap,SE=new WeakMap,BA=new WeakMap,j1=new WeakMap,C2=new WeakMap,HD=new WeakMap,HA=new WeakMap,VA=new WeakMap,CE=new WeakMap,NE=new WeakMap,N2=new WeakMap,UA=new WeakMap,Es=new WeakSet,wR=function(t){ki(this,Es,Fse).call(this);let n=kt(this,va).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(sh)),n},Mse=function(){ki(this,Es,Dse).call(this);const t=aC(this.options.staleTime,kt(this,va));if(pI||kt(this,th).isStale||!_se(t))return;const r=zrt(kt(this,th).dataUpdatedAt,t)+1;Dr(this,CE,nE.setTimeout(()=>{kt(this,th).isStale||this.updateResult()},r))},Rse=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(kt(this,va)):this.options.refetchInterval)??!1},Ose=function(t){ki(this,Es,Lse).call(this),Dr(this,N2,t),!(pI||Jg(this.options.enabled,kt(this,va))===!1||!_se(kt(this,N2))||kt(this,N2)===0)&&Dr(this,NE,nE.setInterval(()=>{(this.options.refetchIntervalInBackground||Xxe.isFocused())&&ki(this,Es,wR).call(this)},kt(this,N2)))},$se=function(){ki(this,Es,Mse).call(this),ki(this,Es,Ose).call(this,ki(this,Es,Rse).call(this))},Dse=function(){kt(this,CE)&&(nE.clearTimeout(kt(this,CE)),Dr(this,CE,void 0))},Lse=function(){kt(this,NE)&&(nE.clearInterval(kt(this,NE)),Dr(this,NE,void 0))},Fse=function(){const t=kt(this,Qh).getQueryCache().build(kt(this,Qh),this.options);if(t===kt(this,va))return;const n=kt(this,va);Dr(this,va,t),Dr(this,BD,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},qrt=function(t){Id.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(kt(this,th))}),kt(this,Qh).getQueryCache().notify({query:kt(this,va),type:"observerResultsUpdated"})})},mWe);function Tjn(e,t){return Jg(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function p4e(e,t){return Tjn(e,t)||e.state.data!==void 0&&zse(e,t,t.refetchOnMount)}function zse(e,t,n){if(Jg(t.enabled,e)!==!1&&aC(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Qxe(e,t)}return!1}function h4e(e,t,n,r){return(e!==t||Jg(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Qxe(e,n)}function Qxe(e,t){return Jg(t.enabled,e)!==!1&&e.isStaleByTime(aC(t.staleTime,e))}function kjn(e,t){return!cU(e.getCurrentResult(),t)}function m4e(e){return{onFetch:(t,n)=>{var d,p,h,m,g;const r=t.options,o=(h=(p=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:p.fetchMore)==null?void 0:h.direction,i=((m=t.state.data)==null?void 0:m.pages)||[],s=((g=t.state.data)==null?void 0:g.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let y=!1;const x=w=>{Cjn(w,()=>t.signal,()=>y=!0)},v=Hrt(t.options,t.fetchOptions),b=async(w,S,C)=>{if(y)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const j=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:S,direction:C?"backward":"forward",meta:t.options.meta};return x(P),P})(),I=await v(j),{maxPages:_}=t.options,T=C?Sjn:wjn;return{pages:T(w.pages,I,_),pageParams:T(w.pageParams,S,_)}};if(o&&i.length){const w=o==="backward",S=w?Mjn:g4e,C={pages:i,pageParams:s},N=S(r,C);l=await b(C,N,w)}else{const w=e??i.length;do{const S=c===0?s[0]??r.initialPageParam:g4e(r,l);if(c>0&&S==null)break;l=await b(l,S),c++}while(c{var y,x;return(x=(y=t.options).persister)==null?void 0:x.call(y,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function g4e(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Mjn(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var VD,hv,nh,jE,mv,WS,gWe,Rjn=(gWe=class extends Wrt{constructor(t){super();wo(this,mv);wo(this,VD);wo(this,hv);wo(this,nh);wo(this,jE);Dr(this,VD,t.client),this.mutationId=t.mutationId,Dr(this,nh,t.mutationCache),Dr(this,hv,[]),this.state=t.state||Krt(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){kt(this,hv).includes(t)||(kt(this,hv).push(t),this.clearGcTimeout(),kt(this,nh).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Dr(this,hv,kt(this,hv).filter(n=>n!==t)),this.scheduleGc(),kt(this,nh).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){kt(this,hv).length||(this.state.status==="pending"?this.scheduleGc():kt(this,nh).remove(this))}continue(){var t;return((t=kt(this,jE))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,l,c,u,d,p,h,m,g,y,x,v,b,w,S,C,N,j,I,_;const n=()=>{ki(this,mv,WS).call(this,{type:"continue"})},r={client:kt(this,VD),meta:this.options.meta,mutationKey:this.options.mutationKey};Dr(this,jE,Urt({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(T,P)=>{ki(this,mv,WS).call(this,{type:"failed",failureCount:T,error:P})},onPause:()=>{ki(this,mv,WS).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>kt(this,nh).canRun(this)}));const o=this.state.status==="pending",i=!kt(this,jE).canStart();try{if(o)n();else{ki(this,mv,WS).call(this,{type:"pending",variables:t,isPaused:i}),await((l=(s=kt(this,nh).config).onMutate)==null?void 0:l.call(s,t,this,r));const P=await((u=(c=this.options).onMutate)==null?void 0:u.call(c,t,r));P!==this.state.context&&ki(this,mv,WS).call(this,{type:"pending",context:P,variables:t,isPaused:i})}const T=await kt(this,jE).start();return await((p=(d=kt(this,nh).config).onSuccess)==null?void 0:p.call(d,T,t,this.state.context,this,r)),await((m=(h=this.options).onSuccess)==null?void 0:m.call(h,T,t,this.state.context,r)),await((y=(g=kt(this,nh).config).onSettled)==null?void 0:y.call(g,T,null,this.state.variables,this.state.context,this,r)),await((v=(x=this.options).onSettled)==null?void 0:v.call(x,T,null,t,this.state.context,r)),ki(this,mv,WS).call(this,{type:"success",data:T}),T}catch(T){try{await((w=(b=kt(this,nh).config).onError)==null?void 0:w.call(b,T,t,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((C=(S=this.options).onError)==null?void 0:C.call(S,T,t,this.state.context,r))}catch(P){Promise.reject(P)}try{await((j=(N=kt(this,nh).config).onSettled)==null?void 0:j.call(N,void 0,T,this.state.variables,this.state.context,this,r))}catch(P){Promise.reject(P)}try{await((_=(I=this.options).onSettled)==null?void 0:_.call(I,void 0,T,t,this.state.context,r))}catch(P){Promise.reject(P)}throw ki(this,mv,WS).call(this,{type:"error",error:T}),T}finally{kt(this,nh).runNext(this)}}},VD=new WeakMap,hv=new WeakMap,nh=new WeakMap,jE=new WeakMap,mv=new WeakSet,WS=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Id.batch(()=>{kt(this,hv).forEach(r=>{r.onMutationUpdate(t)}),kt(this,nh).notify({mutation:this,type:"updated",action:t})})},gWe);function Krt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var E1,kx,UD,xWe,Ojn=(xWe=class extends Mk{constructor(t={}){super();wo(this,E1);wo(this,kx);wo(this,UD);this.config=t,Dr(this,E1,new Set),Dr(this,kx,new Map),Dr(this,UD,0)}build(t,n,r){const o=new Rjn({client:t,mutationCache:this,mutationId:++A8(this,UD)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){kt(this,E1).add(t);const n=AF(t);if(typeof n=="string"){const r=kt(this,kx).get(n);r?r.push(t):kt(this,kx).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(kt(this,E1).delete(t)){const n=AF(t);if(typeof n=="string"){const r=kt(this,kx).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&kt(this,kx).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=AF(t);if(typeof n=="string"){const r=kt(this,kx).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=AF(t);if(typeof n=="string"){const o=(r=kt(this,kx).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Id.batch(()=>{kt(this,E1).forEach(t=>{this.notify({type:"removed",mutation:t})}),kt(this,E1).clear(),kt(this,kx).clear()})}getAll(){return Array.from(kt(this,E1))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>l4e(n,r))}findAll(t={}){return this.getAll().filter(n=>l4e(t,n))}notify(t){Id.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Id.batch(()=>Promise.all(t.map(n=>n.continue().catch(sh))))}},E1=new WeakMap,kx=new WeakMap,UD=new WeakMap,xWe);function AF(e){var t;return(t=e.options.scope)==null?void 0:t.id}var I1,j2,Jh,_1,ow,eB,Bse,yWe,$jn=(yWe=class extends Mk{constructor(n,r){super();wo(this,ow);wo(this,I1);wo(this,j2);wo(this,Jh);wo(this,_1);Dr(this,I1,n),this.setOptions(r),this.bindMethods(),ki(this,ow,eB).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=kt(this,I1).defaultMutationOptions(n),cU(this.options,r)||kt(this,I1).getMutationCache().notify({type:"observerOptionsUpdated",mutation:kt(this,Jh),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&hI(r.mutationKey)!==hI(this.options.mutationKey)?this.reset():((o=kt(this,Jh))==null?void 0:o.state.status)==="pending"&&kt(this,Jh).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=kt(this,Jh))==null||n.removeObserver(this)}onMutationUpdate(n){ki(this,ow,eB).call(this),ki(this,ow,Bse).call(this,n)}getCurrentResult(){return kt(this,j2)}reset(){var n;(n=kt(this,Jh))==null||n.removeObserver(this),Dr(this,Jh,void 0),ki(this,ow,eB).call(this),ki(this,ow,Bse).call(this)}mutate(n,r){var o;return Dr(this,_1,r),(o=kt(this,Jh))==null||o.removeObserver(this),Dr(this,Jh,kt(this,I1).getMutationCache().build(kt(this,I1),this.options)),kt(this,Jh).addObserver(this),kt(this,Jh).execute(n)}},I1=new WeakMap,j2=new WeakMap,Jh=new WeakMap,_1=new WeakMap,ow=new WeakSet,eB=function(){var r;const n=((r=kt(this,Jh))==null?void 0:r.state)??Krt();Dr(this,j2,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Bse=function(n){Id.batch(()=>{var r,o,i,s,l,c,u,d;if(kt(this,_1)&&this.hasListeners()){const p=kt(this,j2).variables,h=kt(this,j2).context,m={client:kt(this,I1),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(o=(r=kt(this,_1)).onSuccess)==null||o.call(r,n.data,p,h,m)}catch(g){Promise.reject(g)}try{(s=(i=kt(this,_1)).onSettled)==null||s.call(i,n.data,null,p,h,m)}catch(g){Promise.reject(g)}}else if((n==null?void 0:n.type)==="error"){try{(c=(l=kt(this,_1)).onError)==null||c.call(l,n.error,p,h,m)}catch(g){Promise.reject(g)}try{(d=(u=kt(this,_1)).onSettled)==null||d.call(u,void 0,n.error,p,h,m)}catch(g){Promise.reject(g)}}}this.listeners.forEach(p=>{p(kt(this,j2))})})},yWe),gv,vWe,Djn=(vWe=class extends Mk{constructor(t={}){super();wo(this,gv);this.config=t,Dr(this,gv,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??qxe(o,n);let s=this.get(i);return s||(s=new Pjn({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){kt(this,gv).has(t.queryHash)||(kt(this,gv).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=kt(this,gv).get(t.queryHash);n&&(t.destroy(),n===t&&kt(this,gv).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Id.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return kt(this,gv).get(t)}getAll(){return[...kt(this,gv).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>s4e(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>s4e(t,r)):n}notify(t){Id.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Id.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Id.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},gv=new WeakMap,vWe),Xc,E2,I2,WA,GA,_2,qA,KA,bWe,Yrt=(bWe=class{constructor(e={}){wo(this,Xc);wo(this,E2);wo(this,I2);wo(this,WA);wo(this,GA);wo(this,_2);wo(this,qA);wo(this,KA);Dr(this,Xc,e.queryCache||new Djn),Dr(this,E2,e.mutationCache||new Ojn),Dr(this,I2,e.defaultOptions||{}),Dr(this,WA,new Map),Dr(this,GA,new Map),Dr(this,_2,0)}mount(){A8(this,_2)._++,kt(this,_2)===1&&(Dr(this,qA,Xxe.subscribe(async e=>{e&&(await this.resumePausedMutations(),kt(this,Xc).onFocus())})),Dr(this,KA,uU.subscribe(async e=>{e&&(await this.resumePausedMutations(),kt(this,Xc).onOnline())})))}unmount(){var e,t;A8(this,_2)._--,kt(this,_2)===0&&((e=kt(this,qA))==null||e.call(this),Dr(this,qA,void 0),(t=kt(this,KA))==null||t.call(this),Dr(this,KA,void 0))}isFetching(e){return kt(this,Xc).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return kt(this,E2).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=kt(this,Xc).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=kt(this,Xc).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(aC(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return kt(this,Xc).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=kt(this,Xc).get(r.queryHash),i=o==null?void 0:o.state.data,s=yjn(t,i);if(s!==void 0)return kt(this,Xc).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Id.batch(()=>kt(this,Xc).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=kt(this,Xc).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=kt(this,Xc);Id.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=kt(this,Xc);return Id.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Id.batch(()=>kt(this,Xc).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(sh).catch(sh)}invalidateQueries(e,t={}){return Id.batch(()=>(kt(this,Xc).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Id.batch(()=>kt(this,Xc).findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(sh)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(sh)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=kt(this,Xc).build(this,t);return n.isStaleByTime(aC(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(sh).catch(sh)}fetchInfiniteQuery(e){return e.behavior=m4e(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(sh).catch(sh)}ensureInfiniteQueryData(e){return e.behavior=m4e(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return uU.isOnline()?kt(this,E2).resumePausedMutations():Promise.resolve()}getQueryCache(){return kt(this,Xc)}getMutationCache(){return kt(this,E2)}getDefaultOptions(){return kt(this,I2)}setDefaultOptions(e){Dr(this,I2,e)}setQueryDefaults(e,t){kt(this,WA).set(hI(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...kt(this,WA).values()],n={};return t.forEach(r=>{G3(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){kt(this,GA).set(hI(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...kt(this,GA).values()],n={};return t.forEach(r=>{G3(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...kt(this,I2).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=qxe(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Kxe&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...kt(this,I2).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){kt(this,Xc).clear(),kt(this,E2).clear()}},Xc=new WeakMap,E2=new WeakMap,I2=new WeakMap,WA=new WeakMap,GA=new WeakMap,_2=new WeakMap,qA=new WeakMap,KA=new WeakMap,bWe),Xrt=f.createContext(void 0),kb=e=>{const t=f.useContext(Xrt);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Qrt=({client:e,children:t})=>(f.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(Xrt.Provider,{value:e,children:t})),Jrt=f.createContext(!1),Ljn=()=>f.useContext(Jrt);Jrt.Provider;function Fjn(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var zjn=f.createContext(Fjn()),Bjn=()=>f.useContext(zjn),Hjn=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Yxe(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Vjn=e=>{f.useEffect(()=>{e.clearReset()},[e])},Ujn=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||Yxe(n,[e.error,r])),Wjn=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>n(r(...o)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Gjn=(e,t)=>e.isLoading&&e.isFetching&&!t,qjn=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,x4e=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Kjn(e,t,n){var h,m,g,y;const r=Ljn(),o=Bjn(),i=kb(),s=i.defaultQueryOptions(e);(m=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||m.call(h,s);const l=i.getQueryCache().get(s.queryHash);s._optimisticResults=r?"isRestoring":"optimistic",Wjn(s),Hjn(s,o,l),Vjn(o);const c=!i.getQueryCache().get(s.queryHash),[u]=f.useState(()=>new t(i,s)),d=u.getOptimisticResult(s),p=!r&&e.subscribed!==!1;if(f.useSyncExternalStore(f.useCallback(x=>{const v=p?u.subscribe(Id.batchCalls(x)):sh;return u.updateResult(),v},[u,p]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),f.useEffect(()=>{u.setOptions(s)},[s,u]),qjn(s,d))throw x4e(s,u,o);if(Ujn({result:d,errorResetBoundary:o,throwOnError:s.throwOnError,query:l,suspense:s.suspense}))throw d.error;if((y=(g=i.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||y.call(g,s,d),s.experimental_prefetchInRender&&!pI&&Gjn(d,r)){const x=c?x4e(s,u,o):l==null?void 0:l.promise;x==null||x.catch(sh).finally(()=>{u.updateResult()})}return s.notifyOnChangeProps?d:u.trackResult(d)}function Cm(e,t){return Kjn(e,Ajn)}function Iy(e,t){const n=kb(),[r]=f.useState(()=>new $jn(n,e));f.useEffect(()=>{r.setOptions(e)},[r,e]);const o=f.useSyncExternalStore(f.useCallback(s=>r.subscribe(Id.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=f.useCallback((s,l)=>{r.mutate(s,l).catch(sh)},[r]);if(o.error&&Yxe(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}const Bc=String.raw,Yjn=Array.from({length:12},(e,t)=>({month:`Month ${t+1}`,revenue:1e4*Math.pow(1.15,t)+Math.random()*5e3,expenses:8e3*Math.pow(1.05,t)+Math.random()*2e3,cashBalance:5e5-t*5e3,burnRate:15e3+Math.random()*2e3})),Xjn=[{id:"c1",name:"Legacy Corp",marketShare:45,threatLevel:30,growthRate:2},{id:"c2",name:"StartUp X",marketShare:15,threatLevel:85,growthRate:150},{id:"c3",name:"TechGiant Y",marketShare:25,threatLevel:60,growthRate:10},{id:"c4",name:"Our Venture",marketShare:5,threatLevel:0,growthRate:300}],y4e=[{id:"e1",name:"Dr. Sarah Chen",role:"Chief AI Officer",performance:98,satisfaction:90,aiPotential:99},{id:"e2",name:"Marcus Thorne",role:"Head of Growth",performance:92,satisfaction:85,aiPotential:75},{id:"e3",name:"Elena Rodriguez",role:"Lead Engineer",performance:95,satisfaction:88,aiPotential:90}],v4e=[{id:"l1",name:"Incorporation Documents",status:"SIGNED",riskScore:0},{id:"l2",name:"Series A Term Sheet",status:"REVIEW",riskScore:45},{id:"l3",name:"Employee IP Agreements",status:"SIGNED",riskScore:5},{id:"l4",name:"GDPR Compliance Audit",status:"DRAFT",riskScore:80}],b4e=[{id:"algo1",name:"Momentum Scalper v3",status:"ACTIVE",pnl:125034.5,sharpeRatio:2.8,latency:.05},{id:"algo2",name:"Mean Reversion Arb",status:"PAUSED",pnl:-15234.21,sharpeRatio:-.5,latency:.12},{id:"algo3",name:"Quantum Tunneling Predictor",status:"COMPILING",pnl:0,sharpeRatio:0,latency:.01}],w4e=[{id:"qj1",name:"Protein Folding Simulation",status:"COMPLETED",qubits:128,executionTime:3600},{id:"qj2",name:"Market Correlation Matrix",status:"RUNNING",qubits:512,executionTime:7200}],Qjn=[{id:"sc1",type:"FACTORY",location:"Shenzhen",efficiency:98,status:"OPERATIONAL"},{id:"sc2",type:"PORT",location:"Long Beach",efficiency:85,status:"DISRUPTED"},{id:"sc3",type:"WAREHOUSE",location:"Nevada",efficiency:99,status:"OPERATIONAL"},{id:"sc4",type:"DRONE_HUB",location:"Chicago",efficiency:92,status:"MAINTENANCE"}],S4e=[{id:"nn1",name:"Customer Churn Predictor",status:"DEPLOYED",accuracy:94.5,loss:.08,trainingProgress:100},{id:"nn2",name:"Market Sentiment Analyzer",status:"TRAINING",accuracy:88.2,loss:.15,trainingProgress:65},{id:"nn3",name:"Supply Chain Optimizer",status:"IDLE",accuracy:0,loss:0,trainingProgress:0}];let gM=new Map;const gee=new Map;async function Hc(e,t){var n;if(await new Promise(r=>setTimeout(r,300+Math.random()*500)),e.includes("StartBusinessPlanAnalysis")){const{plan:r,userId:o}=t,i=`wf-${Date.now()}-${o}`,s={workflowId:i,status:"PENDING",result:null,error:null,userId:o,businessPlan:r};return gM.set(i,s),setTimeout(()=>{const l=gM.get(i);if(l){const c=Math.floor(Math.random()*5e5)+1e5,u=Math.min(99,40+r.length/200*30+Math.random()*20),d=Math.min(98,30+r.length/300*40+Math.random()*20),p=Math.max(2,100-u-d+Math.random()*15);l.status="ANALYSIS_COMPLETE",l.result={feedback:"Analysis complete. Strengths noted, but operational resilience needs improvement.",questions:[{id:"q1",question:"Define autonomous scaling mechanisms for year 3.",category:"Scale"}],coachingPlan:{title:"Hyper-Scale Execution Protocol",summary:"Directive to transition from concept to market dominance.",steps:[{title:"Algorithmic Market Validation",description:"Deploy autonomous agents to test value prop.",timeline:"1 Week",category:"Validation"}]},loanAmount:c,metrics:{viability:u,marketFit:d,risk:p},growthProjections:Array.from({length:12},(h,m)=>({month:m,users:Math.floor(100*Math.pow(1.4,m)),revenue:Math.floor(1e3*Math.pow(1.5,m))})),potentialMentors:[{id:"m1",name:"Dr. Evelyn Reed",expertise:"Quantum Computing",bio:"Architect of the first commercial quantum annealing processor.",imageUrl:"https://i.pravatar.cc/150?u=evelyn"}]},gM.set(i,l)}},3e3),{startBusinessPlanAnalysis:{workflowId:i,status:"PENDING"}}}if(e.includes("GetBusinessPlanAnalysisStatus")){const r=t,o=gM.get(r.workflowId);if(o)return{getBusinessPlanAnalysisStatus:o};throw new Error(`Workflow ${r.workflowId} not found.`)}if(e.includes("GetFinancialData"))return{getFinancialData:Yjn};if(e.includes("GetMarketIntelligence"))return{getMarketIntelligence:Xjn};if(e.includes("GetTeamStructure"))return{getTeamStructure:y4e};if(e.includes("GetLegalStatus"))return{getLegalStatus:v4e};if(e.includes("GetSystemAlerts"))return{getSystemAlerts:[{id:"a1",severity:"HIGH",message:"Supply chain disruption detected at Long Beach port.",timestamp:Date.now()},{id:"a2",severity:"MEDIUM",message:'Competitor "StartUp X" increased ad spend by 200%.',timestamp:Date.now()-5e4},{id:"a3",severity:"CRITICAL",message:"Quantum Tunneling Predictor algo showing anomalous P/L curve.",timestamp:Date.now()-2e5}]};if(e.includes("GenerateAiContent")){const r=t;let o="Processing...";return r.prompt.includes("risk")?o="Risk Analysis: Primary vulnerability is dependency on legacy banking rails. Recommendation: Accelerate transition to decentralized settlement layers.":o=`AI Insight: Based on "${r.context.substring(0,20)}...", the optimal path involves rapid MVP iteration followed by aggressive vertical integration.`,{generateTextWithContext:o}}if(e.includes("GenerateAIChatResponse"))return{generateAIChatResponse:["I've analyzed the data. Your burn rate is sustainable for 14 months, but aggressive R&D could shorten this to 8. Shall I model a capital raise scenario?"][0]};if(e.includes("GetUserProfile")){const r=t;return{getUserProfile:gee.get(r.userId)||{userId:r.userId,username:`Architect_${r.userId.substring(0,3)}`,email:`${r.userId}@finos.pro`,preferences:{notificationSettings:{emailEnabled:!0,smsEnabled:!0,inAppEnabled:!0}},googleId:"g_123"}}}if(e.includes("UpdateUserProfile")){const r=t;let o=gee.get(r.userId)||{userId:r.userId,username:"",email:"",preferences:{notificationSettings:{emailEnabled:!0,smsEnabled:!0,inAppEnabled:!0}}};return o={...o,...r.profile,preferences:{...o.preferences,...r.profile.preferences}},gee.set(r.userId,o),{updateUserProfile:o}}if(e.includes("GetUserPlans")){const r=t;return{getUserPlans:Array.from(gM.values()).filter(i=>i.userId===r.userId)}}if(e.includes("GetTradingData"))return{getTradingData:b4e};if(e.includes("GetMarketData"))return{getMarketData:Array.from({length:50},(o,i)=>({time:Date.now()-(50-i)*1e3,price:100+Math.sin(i/5)*10+(Math.random()-.5)*5,volume:1e3+Math.random()*500}))};if(e.includes("UpdateTradingAlgoStatus")){const{id:r,status:o}=t,i=b4e.find(s=>s.id===r);return i&&(i.status=o),{updateTradingAlgoStatus:i}}if(e.includes("GetQuantumJobs"))return{getQuantumJobs:w4e};if(e.includes("SubmitQuantumJob")){const{name:r,qubits:o}=t,i={id:`qj-${Date.now()}`,name:r,qubits:o,status:"QUEUED",executionTime:0};return w4e.push(i),{submitQuantumJob:i}}if(e.includes("GetSupplyChain"))return{getSupplyChain:Qjn};if(e.includes("GetNeuralNets"))return{getNeuralNets:S4e};if(e.includes("StartNnTraining")){const{id:r}=t,o=S4e.find(i=>i.id===r);if(o){o.status="TRAINING",o.trainingProgress=0;const i=setInterval(()=>{o.trainingProgress<100?(o.trainingProgress+=5,o.loss*=.95):(o.status="DEPLOYED",clearInterval(i))},1e3)}return{startNnTraining:o}}if(e.includes("AddEmployee")){const{name:r,role:o}=t,i={id:`e-${Date.now()}`,name:r,role:o,performance:80,satisfaction:80,aiPotential:80};return y4e.push(i),{addEmployee:i}}if(e.includes("AddLegalDoc")){const{name:r}=t,o={id:`l-${Date.now()}`,name:r,status:"DRAFT",riskScore:90};return v4e.push(o),{addLegalDoc:o}}if(e.includes("AdvancedAIGeneration")){const{prompt:r,config:o}=t;let i=`Executing prompt: "${r}". `;return(n=o.systemInstruction)!=null&&n.toLowerCase().includes("cat")?i+="Meow! As a cat named Neko, I see the world in terms of naps and snacks. What can I help you with, human? Meow.":o.systemInstruction&&(i+=`Operating under system instruction: "${o.systemInstruction}". `),o.temperature!==void 0&&(o.temperature<.3?i+=" The data suggests a straightforward, factual approach. The conclusion is logical and direct.":o.temperature>.8?i+=" Let's explore some creative possibilities! What if we inverted the paradigm entirely, or perhaps considered a metaphorical interpretation of the input data?":i+=" A balanced approach is warranted, combining creativity with factual analysis."),o.thinkingBudget===0?(await new Promise(s=>setTimeout(s,200)),i+=` (Thinking disabled: quick response protocol initiated.)`):(await new Promise(s=>setTimeout(s,1500)),i+=` (Thinking enabled: deep analysis protocol initiated, cross-referencing multiple data vectors.)`),o.multimodalUri&&(i=`Analysis of image at ${o.multimodalUri}: This appears to be a complex biological structure, likely an organ. The intricate patterns suggest high functional density. Based on the fractal dimensions, it could be related to neural processing or nutrient exchange.`),{advancedAIGeneration:{response:i}}}throw new Error(`Unknown Query: ${e.substring(0,30)}`)}const Jjn=Bc`mutation StartBusinessPlanAnalysis($plan: String!, $userId: ID!) { startBusinessPlanAnalysis(plan: $plan, userId: $userId) { workflowId status } }`,Zjn=Bc`query GetBusinessPlanAnalysisStatus($workflowId: ID!) { getBusinessPlanAnalysisStatus(workflowId: $workflowId) { workflowId status result { feedback questions { id question category } coachingPlan { title summary steps { title description category timeline } } loanAmount metrics { viability marketFit risk } growthProjections { month users revenue } potentialMentors { id name expertise bio imageUrl } } error businessPlan } }`,eEn=Bc`query GetFinancialData { getFinancialData { month revenue expenses cashBalance burnRate } }`,tEn=Bc`query GetMarketIntelligence { getMarketIntelligence { name marketShare threatLevel growthRate } }`,nEn=Bc`query GetTeamStructure { getTeamStructure { id name role performance satisfaction aiPotential } }`,rEn=Bc`mutation AddEmployee($name: String!, $role: String!) { addEmployee(name: $name, role: $role) { id name } }`,oEn=Bc`query GetLegalStatus { getLegalStatus { id name status riskScore } }`,iEn=Bc`mutation AddLegalDoc($name: String!) { addLegalDoc(name: $name) { id name } }`,aEn=Bc`query GetSystemAlerts { getSystemAlerts { id severity message timestamp } }`,sEn=Bc`mutation GenerateAiContent($prompt: String!, $context: String!) { generateTextWithContext(prompt: $prompt, context: $context) }`,lEn=Bc`mutation GenerateAIChatResponse($message: String!, $context: String!) { generateAIChatResponse(message: $message, context: $context) }`,cEn=Bc`query GetUserProfile($userId: ID!) { getUserProfile(userId: $userId) { userId username email googleId preferences { theme notificationSettings } } }`,uEn=Bc`mutation UpdateUserProfile($userId: ID!, $profile: UserProfileUpdateInput!) { updateUserProfile(userId: $userId, profile: $profile) { userId username email googleId preferences { theme notificationSettings } } }`,dEn=Bc`query GetUserPlans($userId: ID!) { getUserPlans(userId: $userId) { workflowId status businessPlan result { loanAmount metrics { viability marketFit risk } } } }`,fEn=Bc`query GetTradingData { getTradingData { id name status pnl sharpeRatio latency } }`,pEn=Bc`query GetMarketData { getMarketData { time price volume } }`,hEn=Bc`mutation UpdateTradingAlgoStatus($id: ID!, $status: String!) { updateTradingAlgoStatus(id: $id, status: $status) { id status } }`,mEn=Bc`query GetQuantumJobs { getQuantumJobs { id name status qubits executionTime } }`,gEn=Bc`mutation SubmitQuantumJob($name: String!, $qubits: Int!) { submitQuantumJob(name: $name, qubits: $qubits) { id name } }`,xEn=Bc`query GetSupplyChain { getSupplyChain { id type location efficiency status } }`,yEn=Bc`query GetNeuralNets { getNeuralNets { id name status accuracy loss trainingProgress } }`,vEn=Bc`mutation StartNnTraining($id: ID!) { startNnTraining(id: $id) { id status } }`,bEn=Bc`mutation AdvancedAIGeneration($prompt: String!, $config: AdvancedAIConfig!) { advancedAIGeneration(prompt: $prompt, config: $config) { response } }`,wEn=()=>{const e=kb();return Iy({mutationFn:t=>Hc(Jjn,t),onSuccess:()=>e.invalidateQueries({queryKey:["userPlans"]})})},SEn=e=>Cm({queryKey:["analysisStatus",e],queryFn:()=>Hc(Zjn,{workflowId:e}),enabled:!!e,refetchInterval:t=>{var n;return((n=t.state.data)==null?void 0:n.getBusinessPlanAnalysisStatus.status)==="PENDING"?2e3:!1}}),CEn=()=>Cm({queryKey:["financials"],queryFn:()=>Hc(eEn)}),NEn=()=>Cm({queryKey:["market"],queryFn:()=>Hc(tEn)}),jEn=()=>Cm({queryKey:["team"],queryFn:()=>Hc(nEn)}),EEn=()=>{const e=kb();return Iy({mutationFn:t=>Hc(rEn,t),onSuccess:()=>e.invalidateQueries({queryKey:["team"]})})},IEn=()=>Cm({queryKey:["legal"],queryFn:()=>Hc(oEn)}),_En=()=>{const e=kb();return Iy({mutationFn:t=>Hc(iEn,t),onSuccess:()=>e.invalidateQueries({queryKey:["legal"]})})},PEn=()=>Cm({queryKey:["alerts"],queryFn:()=>Hc(aEn),refetchInterval:1e4}),AEn=()=>Iy({mutationFn:e=>Hc(sEn,e)}),TEn=()=>Iy({mutationFn:e=>Hc(lEn,e)}),kEn=e=>Cm({queryKey:["userProfile",e],queryFn:()=>Hc(cEn,{userId:e})}),MEn=()=>{const e=kb();return Iy({mutationFn:t=>Hc(uEn,t),onSuccess:(t,n)=>e.invalidateQueries({queryKey:["userProfile",n.userId]})})},REn=e=>Cm({queryKey:["userPlans",e],queryFn:()=>Hc(dEn,{userId:e})}),OEn=()=>Cm({queryKey:["tradingData"],queryFn:()=>Hc(fEn),refetchInterval:5e3}),$En=()=>Cm({queryKey:["marketData"],queryFn:()=>Hc(pEn),refetchInterval:2e3}),DEn=()=>{const e=kb();return Iy({mutationFn:t=>Hc(hEn,t),onSuccess:()=>e.invalidateQueries({queryKey:["tradingData"]})})},LEn=()=>Cm({queryKey:["quantumJobs"],queryFn:()=>Hc(mEn),refetchInterval:3e3}),FEn=()=>{const e=kb();return Iy({mutationFn:t=>Hc(gEn,t),onSuccess:()=>e.invalidateQueries({queryKey:["quantumJobs"]})})},zEn=()=>Cm({queryKey:["supplyChain"],queryFn:()=>Hc(xEn),refetchInterval:7e3}),BEn=()=>Cm({queryKey:["neuralNets"],queryFn:()=>Hc(yEn),refetchInterval:2e3}),HEn=()=>{const e=kb();return Iy({mutationFn:t=>Hc(vEn,t),onSuccess:()=>e.invalidateQueries({queryKey:["neuralNets"]})})},VEn=()=>Iy({mutationFn:e=>Hc(bEn,e)}),C4e=["#06b6d4","#6366f1","#10b981","#f59e0b","#ef4444"],Jxe=({children:e,color:t="bg-gray-700"})=>a.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-medium text-white ${t}`,children:e}),Zrt=({context:e,trigger:t})=>{const{mutate:n,data:r,isPending:o}=AEn(),[i,s]=f.useState(!1),l=()=>{s(!0),r||n({prompt:`Analyze this context: ${t||"general"}`,context:e})};return a.jsxs("div",{className:"relative inline-block ml-2",children:[a.jsx("button",{onClick:l,className:"text-cyan-400 hover:text-cyan-300 transition-colors",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),i&&a.jsxs("div",{className:"absolute z-50 w-64 p-3 mt-2 -ml-32 bg-gray-900 border border-cyan-500/50 rounded-lg shadow-xl text-xs text-gray-300",children:[a.jsxs("div",{className:"flex justify-between items-center mb-2",children:[a.jsx("span",{className:"font-bold text-cyan-400",children:"Quantum Insight"}),a.jsx("button",{onClick:()=>s(!1),className:"text-gray-500 hover:text-white",children:"×"})]}),o?a.jsx("div",{className:"animate-pulse",children:"Computing vectors..."}):(r==null?void 0:r.generateTextWithContext)||"Analysis complete."]})]})},UEn=()=>{const{data:e}=PEn(),t=(e==null?void 0:e.getSystemAlerts)||[];return t.length===0?null:a.jsx("div",{className:"mb-6 space-y-2",children:t.map(n=>a.jsxs("div",{className:`p-3 rounded-lg border flex items-start space-x-3 ${n.severity==="CRITICAL"?"bg-red-900/50 border-red-500/50 animate-pulse":n.severity==="HIGH"?"bg-red-900/20 border-red-500/50":"bg-blue-900/20 border-blue-500/50"}`,children:[a.jsx("div",{className:`mt-1 w-2 h-2 rounded-full ${n.severity==="HIGH"||n.severity==="CRITICAL"?"bg-red-500":"bg-blue-500"}`}),a.jsxs("div",{children:[a.jsxs("div",{className:"text-sm font-bold text-white",children:[n.severity," PRIORITY ALERT"]}),a.jsx("div",{className:"text-xs text-gray-300",children:n.message})]})]},n.id))})},WEn=()=>{const[e,t]=f.useState("You are a helpful AI assistant."),[n,r]=f.useState(.5),[o,i]=f.useState(1),[s,l]=f.useState(""),[c,u]=f.useState(""),[d,p]=f.useState(!1),{mutate:h,isPending:m}=VEn(),g=(x=!1)=>{h({prompt:s,config:{systemInstruction:e,temperature:n,thinkingBudget:o}},{onSuccess:b=>{const w=b.advancedAIGeneration.response;if(x){p(!0),u("");const S=w.split(/(\s+)/);let C=0;S.forEach(N=>{C+=Math.random()*50+20,setTimeout(()=>{u(j=>j+N)},C)}),setTimeout(()=>p(!1),C+100)}else u(w)}})},y=()=>{h({prompt:"Tell me about this instrument",config:{multimodalUri:"/path/to/organ.png"}},{onSuccess:v=>{u(v.advancedAIGeneration.response)}})};return a.jsx("div",{className:"space-y-6",children:a.jsx(Ft,{title:"Gemini Core Interaction Matrix",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-4 p-4 bg-gray-900 rounded-lg border border-gray-800",children:[a.jsx("h3",{className:"text-lg font-bold text-cyan-400",children:"Configuration"}),a.jsxs("div",{children:[a.jsx("label",{className:"text-sm text-gray-400",children:"System Instruction"}),a.jsx("textarea",{value:e,onChange:x=>t(x.target.value),className:"w-full h-20 bg-gray-800 border border-gray-600 rounded p-2 text-sm text-white focus:outline-none focus:border-cyan-500"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"text-sm text-gray-400",children:["Temperature: ",n.toFixed(1)]}),a.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:n,onChange:x=>r(Number(x.target.value)),className:"w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer accent-cyan-500"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"text-sm text-gray-400",children:"Enable Thinking (2.5 Pro Feature)"}),a.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:o===1,onChange:x=>i(x.target.checked?1:0),className:"sr-only peer"}),a.jsx("div",{className:"w-11 h-6 bg-gray-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-cyan-600"})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm text-gray-400 mb-2",children:"Multimodal Input"}),a.jsx("button",{onClick:y,disabled:m||d,className:"w-full text-sm px-4 py-2 bg-indigo-600/50 text-indigo-200 rounded hover:bg-indigo-600/80 disabled:opacity-50",children:"Analyze Mock Image"})]})]}),a.jsxs("div",{className:"space-y-4 p-4 bg-gray-900 rounded-lg border border-gray-800",children:[a.jsx("h3",{className:"text-lg font-bold text-cyan-400",children:"Interaction"}),a.jsx("textarea",{value:s,onChange:x=>l(x.target.value),placeholder:"Enter your prompt here...",className:"w-full h-32 bg-gray-800 border border-gray-600 rounded p-2 text-sm text-white focus:outline-none focus:border-cyan-500"}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("button",{onClick:()=>g(!1),disabled:m||d||!s,className:"flex-1 py-2 bg-cyan-600 text-white rounded text-sm hover:bg-cyan-500 disabled:opacity-50",children:"Generate Response"}),a.jsx("button",{onClick:()=>g(!0),disabled:m||d||!s,className:"flex-1 py-2 bg-green-600 text-white rounded text-sm hover:bg-green-500 disabled:opacity-50",children:"Stream Response"})]}),a.jsx("div",{className:"mt-4 p-4 h-48 bg-black rounded-lg overflow-y-auto custom-scrollbar border border-gray-700",children:a.jsx("p",{className:"text-gray-300 text-sm whitespace-pre-wrap",children:m&&!d?"Generating...":c||"AI response will appear here."})})]})]})})})},N4e=()=>{var n,r,o,i,s;const{data:e}=CEn(),t=(e==null?void 0:e.getFinancialData)||[];return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsxs(Ft,{title:"Current Cash",className:"border-l-4 border-green-500",children:[a.jsxs("div",{className:"text-2xl font-bold text-white",children:["$",(n=t[t.length-1])==null?void 0:n.cashBalance.toLocaleString()]}),a.jsxs("div",{className:"text-xs text-gray-400 mt-1",children:["Runway: ~18 Months ",a.jsx(Zrt,{context:"Cash flow analysis"})]})]}),a.jsxs(Ft,{title:"Monthly Burn",className:"border-l-4 border-red-500",children:[a.jsxs("div",{className:"text-2xl font-bold text-white",children:["$",(r=t[t.length-1])==null?void 0:r.burnRate.toLocaleString()]}),a.jsx("div",{className:"text-xs text-gray-400 mt-1",children:"-2.5% vs last month"})]}),a.jsxs(Ft,{title:"Revenue (MRR)",className:"border-l-4 border-cyan-500",children:[a.jsxs("div",{className:"text-2xl font-bold text-white",children:["$",(o=t[t.length-1])==null?void 0:o.revenue.toLocaleString()]}),a.jsx("div",{className:"text-xs text-gray-400 mt-1",children:"+15% MoM Growth"})]}),a.jsxs(Ft,{title:"Net Margin",className:"border-l-4 border-indigo-500",children:[a.jsx("div",{className:"text-2xl font-bold text-white",children:(((i=t[t.length-1])==null?void 0:i.revenue)-((s=t[t.length-1])==null?void 0:s.expenses)).toLocaleString()}),a.jsx("div",{className:"text-xs text-gray-400 mt-1",children:"Approaching Break-even"})]})]}),a.jsx(Ft,{title:"Financial Trajectory",children:a.jsx("div",{className:"h-80",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(vw,{data:t,children:[a.jsx(kl,{strokeDasharray:"3 3",stroke:"#374151"}),a.jsx(Ka,{dataKey:"month",stroke:"#9ca3af",fontSize:10}),a.jsx(ra,{stroke:"#9ca3af",fontSize:10,tickFormatter:l=>`$${l/1e3}k`}),a.jsx(ji,{contentStyle:{backgroundColor:"#111827",borderColor:"#374151"}}),a.jsx(uu,{}),a.jsx(au,{type:"monotone",dataKey:"revenue",stroke:"#06b6d4",strokeWidth:2,name:"Revenue"}),a.jsx(au,{type:"monotone",dataKey:"expenses",stroke:"#ef4444",strokeWidth:2,name:"Expenses"}),a.jsx(au,{type:"monotone",dataKey:"cashBalance",stroke:"#10b981",strokeWidth:2,name:"Cash Reserves"})]})})})})]})},j4e=()=>{const{data:e}=NEn(),t=(e==null?void 0:e.getMarketIntelligence)||[];return a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsx(Ft,{title:"Market Share Distribution",children:a.jsx("div",{className:"h-64",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(bw,{children:[a.jsx(cb,{data:t,cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"marketShare",children:t.map((n,r)=>a.jsx(Eh,{fill:C4e[r%C4e.length]},`cell-${r}`))}),a.jsx(ji,{contentStyle:{backgroundColor:"#111827",borderColor:"#374151"}}),a.jsx(uu,{})]})})})}),a.jsx(Ft,{title:"Competitor Threat Matrix",children:a.jsx("div",{className:"space-y-4",children:t.map((n,r)=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-800/50 rounded-lg border border-gray-700",children:[a.jsxs("div",{children:[a.jsx("div",{className:"font-bold text-white",children:n.name}),a.jsxs("div",{className:"text-xs text-gray-400",children:["Growth: ",n.growthRate,"% YoY"]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-xs text-gray-400 mb-1",children:"Threat Level"}),a.jsx("div",{className:"w-24 h-2 bg-gray-700 rounded-full overflow-hidden",children:a.jsx("div",{className:`h-full ${n.threatLevel>70?"bg-red-500":n.threatLevel>40?"bg-yellow-500":"bg-green-500"}`,style:{width:`${n.threatLevel}%`}})})]})]},r))})})]})},GEn=()=>{const{data:e}=jEn(),{mutate:t,isPending:n}=EEn(),[r,o]=f.useState(""),[i,s]=f.useState(""),l=(e==null?void 0:e.getTeamStructure)||[],c=u=>{u.preventDefault(),t({name:r,role:i}),o(""),s("")};return a.jsxs("div",{className:"space-y-6",children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:l.map(u=>a.jsxs(Ft,{className:"relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 right-0 p-2 opacity-10",children:a.jsx("svg",{className:"w-24 h-24 text-white",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})})}),a.jsxs("div",{className:"relative z-10",children:[a.jsx("h3",{className:"text-lg font-bold text-white",children:u.name}),a.jsx("p",{className:"text-cyan-400 text-sm mb-3",children:u.role}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs text-gray-400",children:[a.jsx("span",{children:"Performance"}),a.jsxs("span",{children:[u.performance,"%"]})]}),a.jsx("div",{className:"w-full bg-gray-700 h-1.5 rounded-full mt-1",children:a.jsx("div",{className:"bg-green-500 h-1.5 rounded-full",style:{width:`${u.performance}%`}})})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-xs text-gray-400",children:[a.jsx("span",{children:"AI Adaptability"}),a.jsxs("span",{children:[u.aiPotential,"%"]})]}),a.jsx("div",{className:"w-full bg-gray-700 h-1.5 rounded-full mt-1",children:a.jsx("div",{className:"bg-indigo-500 h-1.5 rounded-full",style:{width:`${u.aiPotential}%`}})})]})]})]})]},u.id))}),a.jsx(Ft,{title:"Onboard New Talent",children:a.jsxs("form",{onSubmit:c,className:"grid grid-cols-1 md:grid-cols-3 gap-4 items-end",children:[a.jsxs("div",{className:"col-span-1",children:[a.jsx("label",{className:"text-xs text-gray-400",children:"Name"}),a.jsx("input",{value:r,onChange:u=>o(u.target.value),className:"w-full bg-gray-800 border border-gray-600 rounded px-3 py-2 text-sm text-white focus:outline-none focus:border-cyan-500"})]}),a.jsxs("div",{className:"col-span-1",children:[a.jsx("label",{className:"text-xs text-gray-400",children:"Role"}),a.jsx("input",{value:i,onChange:u=>s(u.target.value),className:"w-full bg-gray-800 border border-gray-600 rounded px-3 py-2 text-sm text-white focus:outline-none focus:border-cyan-500"})]}),a.jsx("button",{type:"submit",disabled:n||!r||!i,className:"w-full md:w-auto px-4 py-2 bg-cyan-600 text-white rounded text-sm hover:bg-cyan-500 disabled:opacity-50",children:"Add to Team"})]})})]})},qEn=()=>{const{data:e}=IEn(),{mutate:t,isPending:n}=_En(),[r,o]=f.useState(""),i=(e==null?void 0:e.getLegalStatus)||[],s=l=>{l.preventDefault(),t({name:r}),o("")};return a.jsxs("div",{className:"space-y-4",children:[a.jsx(Ft,{title:"Compliance & Legal Governance",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-left text-sm text-gray-400",children:[a.jsx("thead",{className:"bg-gray-800 text-gray-200 uppercase font-medium",children:a.jsxs("tr",{children:[a.jsx("th",{className:"p-3",children:"Document"}),a.jsx("th",{className:"p-3",children:"Status"}),a.jsx("th",{className:"p-3",children:"Risk Score"}),a.jsx("th",{className:"p-3",children:"Action"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-700",children:i.map(l=>a.jsxs("tr",{className:"hover:bg-gray-800/50 transition-colors",children:[a.jsx("td",{className:"p-3 font-medium text-white",children:l.name}),a.jsx("td",{className:"p-3",children:a.jsx(Jxe,{color:l.status==="SIGNED"?"bg-green-900 text-green-200":l.status==="REVIEW"?"bg-yellow-900 text-yellow-200":"bg-gray-700",children:l.status})}),a.jsx("td",{className:"p-3",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("span",{className:`mr-2 ${l.riskScore>50?"text-red-400":"text-green-400"}`,children:l.riskScore}),a.jsx(Zrt,{context:`Legal risk for ${l.name}`})]})}),a.jsx("td",{className:"p-3",children:a.jsx("button",{className:"text-cyan-400 hover:underline",children:"View"})})]},l.id))})]})})}),a.jsx(Ft,{title:"Submit Document for AI Review",children:a.jsxs("form",{onSubmit:s,className:"flex items-end gap-4",children:[a.jsxs("div",{className:"flex-grow",children:[a.jsx("label",{className:"text-xs text-gray-400",children:"Document Name"}),a.jsx("input",{value:r,onChange:l=>o(l.target.value),className:"w-full bg-gray-800 border border-gray-600 rounded px-3 py-2 text-sm text-white focus:outline-none focus:border-cyan-500"})]}),a.jsx("button",{type:"submit",disabled:n||!r,className:"px-4 py-2 bg-cyan-600 text-white rounded text-sm hover:bg-cyan-500 disabled:opacity-50",children:"Submit"})]})})]})},KEn=()=>{const{data:e}=OEn(),{data:t}=$En(),{mutate:n}=DEn();return a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsx("div",{className:"lg:col-span-2 space-y-6",children:a.jsx(Ft,{title:"Live Market Feed (BTC/USD)",children:a.jsx("div",{className:"h-96",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(wm,{data:t==null?void 0:t.getMarketData,children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"colorPrice",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#06b6d4",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#06b6d4",stopOpacity:0})]})}),a.jsx(kl,{strokeDasharray:"3 3",stroke:"#374151"}),a.jsx(Ka,{dataKey:"time",tickFormatter:r=>new Date(r).toLocaleTimeString(),stroke:"#9ca3af",fontSize:10}),a.jsx(ra,{domain:["dataMin - 5","dataMax + 5"],stroke:"#9ca3af",fontSize:10}),a.jsx(ji,{contentStyle:{backgroundColor:"#111827"}}),a.jsx(hu,{type:"monotone",dataKey:"price",stroke:"#06b6d4",fillOpacity:1,fill:"url(#colorPrice)"})]})})})})}),a.jsx("div",{className:"space-y-6",children:a.jsx(Ft,{title:"Algorithm Control",children:a.jsx("div",{className:"space-y-4",children:e==null?void 0:e.getTradingData.map(r=>a.jsxs("div",{className:"p-3 bg-gray-800/50 rounded-lg border border-gray-700",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h4",{className:"font-bold text-white",children:r.name}),a.jsx(Jxe,{color:r.status==="ACTIVE"?"bg-green-600":r.status==="PAUSED"?"bg-yellow-600":"bg-blue-600",children:r.status})]}),a.jsxs("div",{className:"text-xs text-gray-400 mt-2 grid grid-cols-3 gap-2",children:[a.jsxs("div",{children:["P/L: ",a.jsxs("span",{className:r.pnl>=0?"text-green-400":"text-red-400",children:["$",r.pnl.toFixed(2)]})]}),a.jsxs("div",{children:["Sharpe: ",a.jsx("span",{className:"text-white",children:r.sharpeRatio})]}),a.jsxs("div",{children:["Latency: ",a.jsxs("span",{className:"text-white",children:[r.latency,"ms"]})]})]}),a.jsxs("div",{className:"mt-3 flex space-x-2",children:[a.jsx("button",{onClick:()=>n({id:r.id,status:"ACTIVE"}),disabled:r.status==="ACTIVE",className:"text-xs px-2 py-1 bg-green-500/20 text-green-300 rounded hover:bg-green-500/40 disabled:opacity-50",children:"Activate"}),a.jsx("button",{onClick:()=>n({id:r.id,status:"PAUSED"}),disabled:r.status!=="ACTIVE",className:"text-xs px-2 py-1 bg-yellow-500/20 text-yellow-300 rounded hover:bg-yellow-500/40 disabled:opacity-50",children:"Pause"})]})]},r.id))})})})]})},YEn=()=>{const{data:e}=LEn(),{mutate:t,isPending:n}=FEn(),[r,o]=f.useState(""),[i,s]=f.useState(64),l=c=>{c.preventDefault(),t({name:r,qubits:Number(i)}),o("")};return a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsx("div",{className:"lg:col-span-2",children:a.jsx(Ft,{title:"Quantum Job Queue",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-left text-sm text-gray-400",children:[a.jsx("thead",{className:"bg-gray-800 text-gray-200 uppercase",children:a.jsxs("tr",{children:[a.jsx("th",{className:"p-3",children:"Job Name"}),a.jsx("th",{className:"p-3",children:"Qubits"}),a.jsx("th",{className:"p-3",children:"Status"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-700",children:e==null?void 0:e.getQuantumJobs.map(c=>a.jsxs("tr",{children:[a.jsx("td",{className:"p-3 font-medium text-white",children:c.name}),a.jsx("td",{className:"p-3",children:c.qubits}),a.jsx("td",{className:"p-3",children:a.jsx(Jxe,{color:c.status==="RUNNING"?"bg-cyan-600":c.status==="COMPLETED"?"bg-green-600":"bg-gray-600",children:c.status})})]},c.id))})]})})})}),a.jsx("div",{children:a.jsx(Ft,{title:"Submit New Job",children:a.jsxs("form",{onSubmit:l,className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-400",children:"Job Name"}),a.jsx("input",{value:r,onChange:c=>o(c.target.value),className:"w-full bg-gray-800 border border-gray-600 rounded px-3 py-2 text-sm text-white focus:outline-none focus:border-cyan-500"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"text-xs text-gray-400",children:["Qubits Required: ",i]}),a.jsx("input",{type:"range",min:"8",max:"1024",step:"8",value:i,onChange:c=>s(Number(c.target.value)),className:"w-full h-2 bg-gray-700 rounded-lg appearance-none cursor-pointer"})]}),a.jsx("button",{type:"submit",disabled:n||!r,className:"w-full py-2 bg-indigo-600 text-white rounded text-sm hover:bg-indigo-500 disabled:opacity-50",children:"Queue Job"})]})})})]})},XEn=()=>{const{data:e}=BEn(),{mutate:t}=HEn();return a.jsx("div",{className:"space-y-6",children:a.jsx(Ft,{title:"Model Performance & Status",children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:e==null?void 0:e.getNeuralNets.map(n=>a.jsxs("div",{className:"p-4 bg-gray-800/50 rounded-lg border border-gray-700",children:[a.jsx("h4",{className:"font-bold text-white",children:n.name}),a.jsxs("div",{className:"text-xs text-gray-400 mb-2",children:["Status: ",a.jsx("span",{className:"font-semibold text-cyan-400",children:n.status})]}),a.jsxs("div",{className:"text-xs",children:["Accuracy: ",n.accuracy.toFixed(2),"% | Loss: ",n.loss.toFixed(4)]}),a.jsx("div",{className:"w-full bg-gray-700 h-1.5 rounded-full mt-3",children:a.jsx("div",{className:"bg-indigo-500 h-1.5 rounded-full",style:{width:`${n.trainingProgress}%`}})}),n.status==="IDLE"&&a.jsx("button",{onClick:()=>t({id:n.id}),className:"mt-3 text-xs px-2 py-1 bg-cyan-500/20 text-cyan-300 rounded hover:bg-cyan-500/40",children:"Start Training"})]},n.id))})})})},QEn=()=>{const{data:e}=zEn();return a.jsx(Ft,{title:"Autonomous Supply Chain Network",children:a.jsxs("div",{className:"p-4 bg-black rounded-lg h-96 relative",children:[a.jsx("div",{className:"absolute inset-0 bg-grid-gray-700/20 [background-size:30px_30px]"}),e==null?void 0:e.getSupplyChain.map((t,n)=>a.jsxs("div",{style:{top:`${20+n%2*40+Math.random()*10}%`,left:`${15+n*20+Math.random()*5}%`},className:"absolute p-2 rounded-lg border bg-gray-900/80 backdrop-blur-sm animate-pulse",children:[a.jsx("div",{className:"font-bold text-xs text-white",children:t.type}),a.jsx("div",{className:"text-xxs text-gray-400",children:t.location}),a.jsx("div",{className:`absolute -top-1 -right-1 w-2 h-2 rounded-full ${t.status==="OPERATIONAL"?"bg-green-500":t.status==="DISRUPTED"?"bg-red-500":"bg-yellow-500"}`})]},t.id))]})})},JEn=()=>{const e="user_001",{data:t}=kEn(e),{mutate:n}=MEn(),[r,o]=f.useState({});f.useEffect(()=>{t!=null&&t.getUserProfile&&o(t.getUserProfile)},[t]);const i=()=>n({userId:e,profile:r});return a.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[a.jsx(Ft,{title:"User Profile",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-gray-400 text-sm",children:"Username"}),a.jsx("input",{value:r.username||"",onChange:s=>o(l=>({...l,username:s.target.value})),className:"mt-1 block w-full bg-gray-800 border-gray-600 rounded-md shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 p-2"})]}),a.jsxs("label",{className:"block",children:[a.jsx("span",{className:"text-gray-400 text-sm",children:"Email"}),a.jsx("input",{type:"email",value:r.email||"",onChange:s=>o(l=>({...l,email:s.target.value})),className:"mt-1 block w-full bg-gray-800 border-gray-600 rounded-md shadow-sm p-2"})]})]})}),a.jsx(Ft,{title:"Notification Settings",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("label",{className:"flex items-center",children:[a.jsx("input",{type:"checkbox",className:"rounded bg-gray-700 border-gray-500 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-offset-0 focus:ring-indigo-200 focus:ring-opacity-50"})," ",a.jsx("span",{className:"ml-2 text-sm",children:"Email Notifications"})]}),a.jsxs("label",{className:"flex items-center",children:[a.jsx("input",{type:"checkbox",className:"rounded"})," ",a.jsx("span",{className:"ml-2 text-sm",children:"In-App Alerts"})]})]})}),a.jsx("button",{onClick:i,className:"px-4 py-2 bg-cyan-600 text-white rounded text-sm hover:bg-cyan-500",children:"Save Changes"})]})},ZEn=({context:e})=>{const[t,n]=f.useState(!1),[r,o]=f.useState(""),[i,s]=f.useState([]),{mutate:l,isPending:c}=TEn(),u=()=>{if(!r.trim())return;const d=r;s(p=>[...p,{sender:"user",text:d}]),o(""),l({message:d,context:e},{onSuccess:p=>s(h=>[...h,{sender:"ai",text:p.generateAIChatResponse}])})};return a.jsxs("div",{className:`fixed bottom-0 right-0 z-50 transition-all duration-300 ${t?"w-96 h-[600px]":"w-12 h-12"} bg-gray-900 border-t border-l border-gray-700 shadow-2xl rounded-tl-xl overflow-hidden`,children:[!t&&a.jsx("button",{onClick:()=>n(!0),className:"w-full h-full flex items-center justify-center bg-cyan-600 hover:bg-cyan-500 text-white",children:a.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})})}),t&&a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"p-3 bg-gray-800 flex justify-between items-center border-b border-gray-700",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),a.jsx("span",{className:"font-bold text-white text-sm",children:"AI Assistant"})]}),a.jsx("button",{onClick:()=>n(!1),className:"text-gray-400 hover:text-white",children:"×"})]}),a.jsxs("div",{className:"flex-grow overflow-y-auto p-4 space-y-3 bg-black/20 custom-scrollbar",children:[i.length===0&&a.jsx("div",{className:"text-center text-gray-500 text-xs mt-10",children:"System Online. Awaiting input."}),i.map((d,p)=>a.jsx("div",{className:`flex ${d.sender==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[85%] p-2 rounded-lg text-sm ${d.sender==="user"?"bg-cyan-700 text-white":"bg-gray-800 text-gray-300"}`,children:d.text})},p)),c&&a.jsx("div",{className:"text-xs text-gray-500 animate-pulse",children:"Computing..."})]}),a.jsx("div",{className:"p-3 bg-gray-800 border-t border-gray-700",children:a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("input",{className:"flex-grow bg-gray-900 border border-gray-600 rounded px-3 py-1 text-sm text-white focus:outline-none focus:border-cyan-500",placeholder:"Command the system...",value:r,onChange:d=>o(d.target.value),onKeyPress:d=>d.key==="Enter"&&u()}),a.jsx("button",{onClick:u,className:"px-3 py-1 bg-cyan-600 text-white rounded text-sm hover:bg-cyan-500",children:"Send"})]})})]})]})},eIn=()=>{var y,x,v;const e="user_001",[t,n]=f.useState("DASHBOARD"),{data:r}=REn(e),{mutate:o,isPending:i}=wEn(),[s,l]=f.useState(""),[c,u]=f.useState(null),d=c||((x=(y=r==null?void 0:r.getUserPlans)==null?void 0:y[0])==null?void 0:x.workflowId),{data:p}=SEn(d||null),h=p==null?void 0:p.getBusinessPlanAnalysisStatus,m=()=>{var b,w,S;switch(t){case"FINANCE":return a.jsx(N4e,{});case"MARKET":return a.jsx(j4e,{});case"TEAM":return a.jsx(GEn,{});case"LEGAL":return a.jsx(qEn,{});case"HFT_ALGO":return a.jsx(KEn,{});case"QUANTUM":return a.jsx(YEn,{});case"SUPPLY_CHAIN":return a.jsx(QEn,{});case"NEURAL_NET":return a.jsx(XEn,{});case"AI_NEXUS":return a.jsx(WEn,{});case"SETTINGS":return a.jsx(JEn,{});case"STRATEGY":return a.jsx("div",{className:"space-y-6",children:d?a.jsxs(a.Fragment,{children:[(h==null?void 0:h.status)==="PENDING"&&a.jsx("div",{className:"text-center p-10 text-cyan-400 animate-pulse",children:"Quantum Analysis in Progress..."}),(h==null?void 0:h.result)&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(Ft,{title:"Strategic Output",children:[a.jsx("p",{className:"text-gray-300 mb-4",children:h.result.feedback}),a.jsxs("div",{className:"grid grid-cols-3 gap-2 mb-4",children:[a.jsxs("div",{className:"bg-gray-800 p-2 rounded text-center",children:[a.jsx("div",{className:"text-xs text-gray-400",children:"Viability"}),a.jsxs("div",{className:"text-xl font-bold text-green-400",children:[(b=h.result.metrics)==null?void 0:b.viability.toFixed(0),"%"]})]}),a.jsxs("div",{className:"bg-gray-800 p-2 rounded text-center",children:[a.jsx("div",{className:"text-xs text-gray-400",children:"Market Fit"}),a.jsxs("div",{className:"text-xl font-bold text-indigo-400",children:[(w=h.result.metrics)==null?void 0:w.marketFit.toFixed(0),"%"]})]}),a.jsxs("div",{className:"bg-gray-800 p-2 rounded text-center",children:[a.jsx("div",{className:"text-xs text-gray-400",children:"Risk"}),a.jsxs("div",{className:"text-xl font-bold text-red-400",children:[(S=h.result.metrics)==null?void 0:S.risk.toFixed(0),"%"]})]})]}),a.jsx("button",{onClick:()=>u(null),className:"text-xs text-cyan-400 hover:underline",children:"New Analysis"})]}),a.jsx(Ft,{title:"Growth Projection",children:a.jsx("div",{className:"h-48",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(vw,{data:h.result.growthProjections,children:[a.jsx(kl,{strokeDasharray:"3 3",stroke:"#374151"}),a.jsx(Ka,{dataKey:"month",hide:!0}),a.jsx(ra,{hide:!0}),a.jsx(ji,{contentStyle:{backgroundColor:"#111827"}}),a.jsx(au,{type:"monotone",dataKey:"revenue",stroke:"#10b981",strokeWidth:2,dot:!1})]})})})})]})]}):a.jsxs(Ft,{title:"Initialize Strategic Core",children:[a.jsx("textarea",{value:s,onChange:C=>l(C.target.value),placeholder:"Input strategic parameters for analysis...",className:"w-full h-32 bg-gray-800 border border-gray-600 rounded-lg p-3 text-white mb-4 focus:ring-2 focus:ring-cyan-500 outline-none"}),a.jsx("button",{onClick:()=>o({plan:s,userId:e}),disabled:i||!s.trim(),className:"w-full py-3 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg font-bold transition-colors disabled:opacity-50",children:i?"Processing...":"Execute Analysis Protocol"})]})});case"DASHBOARD":default:return a.jsxs("div",{className:"space-y-6",children:[a.jsx(UEn,{}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs(Ft,{title:"Financial Health",className:"cursor-pointer hover:border-cyan-500 transition-colors",onClick:()=>n("FINANCE"),children:[a.jsx("div",{className:"text-3xl font-bold text-green-400",children:"94/100"}),a.jsx("div",{className:"text-sm text-gray-400 mt-2",children:"Runway Optimized"})]}),a.jsxs(Ft,{title:"Market Position",className:"cursor-pointer hover:border-cyan-500 transition-colors",onClick:()=>n("MARKET"),children:[a.jsx("div",{className:"text-3xl font-bold text-indigo-400",children:"Leader"}),a.jsx("div",{className:"text-sm text-gray-400 mt-2",children:"Top 5% in Sector"})]}),a.jsxs(Ft,{title:"Operational Efficiency",className:"cursor-pointer hover:border-cyan-500 transition-colors",onClick:()=>n("TEAM"),children:[a.jsx("div",{className:"text-3xl font-bold text-cyan-400",children:"98.2%"}),a.jsx("div",{className:"text-sm text-gray-400 mt-2",children:"AI Automation Active"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsx(N4e,{}),a.jsx(j4e,{})]})]})}},g=[{id:"DASHBOARD",label:"Command Center",icon:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"},{id:"STRATEGY",label:"Quantum Strategy",icon:"M13 10V3L4 14h7v7l9-11h-7z"},{id:"AI_NEXUS",label:"AI Nexus",icon:"M12 2a10 10 0 00-3.536 19.19l-1.414 1.414-1.414-1.414A10 10 0 1012 2zm0 2a8 8 0 110 16 8 8 0 010-16zM12 8a4 4 0 100 8 4 4 0 000-8z"},{id:"FINANCE",label:"Treasury & Finance",icon:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},{id:"MARKET",label:"Market Intelligence",icon:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},{id:"TEAM",label:"Talent & HR",icon:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"},{id:"LEGAL",label:"Legal & Compliance",icon:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"},{id:"HFT_ALGO",label:"HFT Algo Lab",icon:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2h8a2 2 0 002-2v-1a2 2 0 012-2h1.945C19.95 9.838 20 9.42 20 9s-.05-0.838-.055-1H19a2 2 0 01-2-2v-1a2 2 0 00-2-2H9a2 2 0 00-2 2v1a2 2 0 01-2 2H3.055C3.05 8.162 3 8.58 3 9s.05 0.838.055 1z"},{id:"QUANTUM",label:"Quantum Compute",icon:"M18 8A8 8 0 102 8a8 8 0 0016 0zM8.5 4.5a.5.5 0 00-1 0v3h-3a.5.5 0 000 1h3v3a.5.5 0 001 0v-3h3a.5.5 0 000-1h-3v-3z"},{id:"SUPPLY_CHAIN",label:"Global Supply Chain",icon:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0zM12 12a3 3 0 100-6 3 3 0 000 6z"},{id:"NEURAL_NET",label:"Neural Net Ops",icon:"M5 12h14M12 5l7 7-7 7"},{id:"SETTINGS",label:"System Settings",icon:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065zM12 15a3 3 0 100-6 3 3 0 000 6z"}];return a.jsxs("div",{className:"flex h-screen bg-gray-950 text-white overflow-hidden font-sans",children:[a.jsxs("div",{className:"w-64 bg-black border-r border-gray-800 flex flex-col",children:[a.jsxs("div",{className:"p-6 border-b border-gray-800",children:[a.jsxs("h1",{className:"text-2xl font-extrabold tracking-tighter text-transparent bg-clip-text bg-gradient-to-r from-cyan-400 to-indigo-500",children:["FINOS",a.jsx("span",{className:"text-white text-xs align-top",children:"PRO"})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Business OS v10.1"})]}),a.jsxs("nav",{className:"flex-grow p-4 space-y-1 overflow-y-auto custom-scrollbar",children:[g.map(b=>a.jsxs("button",{onClick:()=>n(b.id),className:`w-full flex items-center p-3 rounded-lg transition-all duration-200 ${t===b.id?"bg-cyan-900/30 text-cyan-400 border-r-2 border-cyan-400":"text-gray-400 hover:bg-gray-900 hover:text-gray-200"}`,children:[a.jsx("svg",{className:"w-5 h-5 mr-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:b.icon})}),a.jsx("span",{className:"text-sm font-medium",children:b.label})]},b.id))," "]}),a.jsx("div",{className:"p-4 border-t border-gray-800",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-purple-500 to-indigo-600 flex items-center justify-center text-xs font-bold",children:"SU"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-bold text-white",children:"System User"}),a.jsx("div",{className:"text-xs text-gray-500",children:"Architect Access"})]})]})})]}),a.jsxs("main",{className:"flex-1 overflow-y-auto custom-scrollbar bg-gray-950 relative",children:[a.jsxs("header",{className:"sticky top-0 z-20 bg-gray-950/80 backdrop-blur-md border-b border-gray-800 p-6 flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-white",children:(v=g.find(b=>b.id===t))==null?void 0:v.label}),a.jsxs("p",{className:"text-xs text-gray-400",children:["System Status: ",a.jsx("span",{className:"text-green-400",children:"Nominal"})," | AI Latency: 12ms"]})]}),a.jsx("div",{className:"flex items-center space-x-4",children:a.jsxs("button",{className:"p-2 text-gray-400 hover:text-white relative",children:[a.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})}),a.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 bg-red-500 rounded-full"})]})})]}),a.jsx("div",{className:"p-6 pb-24",children:m()}),a.jsx(ZEn,{context:t})]})]})},tIn=new Yrt,nIn=()=>a.jsx(Qrt,{client:tIn,children:a.jsx(eIn,{})}),E4e=[{id:"author-1",name:"SynthCore Labs",avatarUrl:"https://i.pravatar.cc/40?u=synthcore",profileUrl:"#",verified:!0,bio:"Pioneering AI for financial markets.",agentsPublished:5},{id:"author-2",name:"DataWeaver Inc.",avatarUrl:"https://i.pravatar.cc/40?u=dataweaver",profileUrl:"#",verified:!0,bio:"Weaving intelligence from raw data.",agentsPublished:8},{id:"author-3",name:"LogicForge AI",avatarUrl:"https://i.pravatar.cc/40?u=logicforge",profileUrl:"#",verified:!1,bio:"Crafting bespoke AI solutions for business automation.",agentsPublished:3},{id:"author-4",name:"QuantumLeap AI",avatarUrl:"https://i.pravatar.cc/40?u=quantumleap",profileUrl:"#",verified:!0,bio:"Next-generation AI for complex problem solving.",agentsPublished:12},{id:"author-5",name:"Eva Neuro",avatarUrl:"https://i.pravatar.cc/40?u=eva",profileUrl:"#",verified:!1,bio:"Independent researcher focusing on NLP agents.",agentsPublished:2}],Hse=["Finance","Marketing","Data Analysis","Customer Support","Content Creation","Code Generation","Personal Assistant"],Vse=["stocks","crypto","reporting","automation","seo","chat","email","analytics","python","api","research","summarization","forecasting"],I4e=["This agent transformed our workflow. Highly recommended!","Decent, but has a steep learning curve.","A game-changer for our marketing team. The automation capabilities are top-notch.","Could use more documentation, but the support team was helpful.","It's good for the price, but lacks some advanced features.","Incredible performance and very reliable. Has not failed us once.","I found a few bugs, but the developer is very responsive and issues fixes quickly.","The best agent in this category, hands down.","Simple, effective, and does exactly what it promises.","Overpriced for what it offers. There are better free alternatives."],rIn=e=>{const t=[];for(let n=1;n<=e;n++){const r=E4e[n%E4e.length],o=Hse[n%Hse.length],i=new Date(Date.now()-Math.random()*30*24*60*60*1e3),s=Array.from({length:Math.floor(Math.random()*50)+5},(h,m)=>({id:`review-${n}-${m}`,author:{name:`User ${m+1}`,avatarUrl:`https://i.pravatar.cc/40?u=reviewuser${n}_${m}`},rating:Math.floor(Math.random()*3)+3,comment:I4e[Math.floor(Math.random()*I4e.length)],createdAt:new Date(i.getTime()+Math.random()*(Date.now()-i.getTime())),helpfulVotes:Math.floor(Math.random()*100)})),l=s.reduce((h,m)=>h+m.rating,0),c=s.length>0?l/s.length:0,u=["one-time","subscription","free"][n%3],d={type:u,amount:u==="free"?0:u==="one-time"?Math.floor(Math.random()*400)+99:Math.floor(Math.random()*90)+9,...u==="subscription"&&{subscriptionInterval:["monthly","yearly"][n%2]}},p=[{version:"1.2.0",releaseDate:new Date,changes:["Added new API integration.","Improved performance by 20%.","Fixed minor UI bugs."]},{version:"1.1.0",releaseDate:new Date(Date.now()-14400*60*1e3),changes:["Initial support for multi-language output.","Refactored core logic."]},{version:"1.0.0",releaseDate:new Date(Date.now()-600*60*60*1e3),changes:["Initial public release."]}];t.push({id:`agent-${n}`,name:`${o} Master Agent ${n}`,author:r,category:o,tags:[...new Set(Array.from({length:Math.floor(Math.random()*3)+2},()=>Vse[Math.floor(Math.random()*Vse.length)]))],shortDescription:`An autonomous AI agent specializing in ${o.toLowerCase()} tasks and automation.`,longDescription:`This is a comprehensive description for the ${o} Master Agent ${n}. It leverages state-of-the-art machine learning models to provide unparalleled insights and automation capabilities. Whether you're a small business or a large enterprise, this agent can be configured to meet your specific needs, streamlining workflows and boosting productivity. It features a user-friendly interface for configuration and monitoring.`,imageUrl:`https://picsum.photos/seed/agent${n}/600/400`,rating:parseFloat(c.toFixed(1)),reviewCount:s.length,reviews:s,pricing:d,specs:{version:"1.2.0",releaseDate:new Date,requiredApiVersion:"v2.1",dependencies:["Node.js v18+","Python 3.9+","Docker"],supportedLanguages:["English","Spanish","German"],computeRequirements:{cpu:"4 cores",ram:"16GB",gpu:n%3===0?"NVIDIA RTX 3080 or equivalent":void 0}},changelog:p,downloads:Math.floor(Math.random()*1e4)+500,createdAt:i,updatedAt:new Date(i.getTime()+Math.random()*(Date.now()-i.getTime())),featured:n%10===0,documentationUrl:"#",demoUrl:n%5===0?"#":void 0})}return t},eot={searchQuery:"",categories:new Set,minRating:0,maxPrice:500,pricingTypes:new Set,tags:new Set,verifiedAuthor:!1};function oIn(e,t){switch(t.type){case"SET_SEARCH_QUERY":return{...e,searchQuery:t.payload};case"TOGGLE_CATEGORY":{const n=new Set(e.categories);return n.has(t.payload)?n.delete(t.payload):n.add(t.payload),{...e,categories:n}}case"SET_MIN_RATING":return{...e,minRating:t.payload};case"SET_MAX_PRICE":return{...e,maxPrice:t.payload};case"TOGGLE_PRICING_TYPE":{const n=new Set(e.pricingTypes);return n.has(t.payload)?n.delete(t.payload):n.add(t.payload),{...e,pricingTypes:n}}case"TOGGLE_TAG":{const n=new Set(e.tags);return n.has(t.payload)?n.delete(t.payload):n.add(t.payload),{...e,tags:n}}case"TOGGLE_VERIFIED_AUTHOR":return{...e,verifiedAuthor:!e.verifiedAuthor};case"RESET_FILTERS":return eot;default:return e}}const xee=({filled:e,half:t})=>a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",children:[a.jsx("defs",{children:t&&a.jsxs("linearGradient",{id:"half-gradient",children:[a.jsx("stop",{offset:"50%",stopColor:"currentColor",className:"text-yellow-400"}),a.jsx("stop",{offset:"50%",stopColor:"currentColor",className:"text-gray-600"})]})}),a.jsx("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z",fill:t?"url(#half-gradient)":"currentColor",className:e?"text-yellow-400":"text-gray-600"})]}),tot=({rating:e,className:t=""})=>{const n=Math.floor(e),r=e%1>=.5,o=5-n-(r?1:0);return a.jsxs("div",{className:`flex items-center text-yellow-400 ${t}`,children:[[...Array(n)].map((i,s)=>a.jsx(xee,{filled:!0},`full-${s}`)),r&&a.jsx(xee,{half:!0}),[...Array(o)].map((i,s)=>a.jsx(xee,{},`empty-${s}`))]})},iIn=()=>a.jsx("div",{className:"flex justify-center items-center p-8",children:a.jsx("div",{className:"animate-spin rounded-full h-16 w-16 border-t-2 border-b-2 border-cyan-500"})}),aIn=({onReset:e})=>a.jsxs("div",{className:"text-center py-16 px-4 bg-gray-800 rounded-lg",children:[a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mx-auto h-12 w-12 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),a.jsx("h3",{className:"mt-2 text-lg font-medium text-white",children:"No Agents Found"}),a.jsx("p",{className:"mt-1 text-sm text-gray-400",children:"We couldn't find any agents matching your criteria. Try adjusting your filters."}),a.jsx("div",{className:"mt-6",children:a.jsx("button",{type:"button",onClick:e,className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-cyan-600 hover:bg-cyan-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-900 focus:ring-cyan-500",children:"Reset Filters"})})]}),sIn=({isOpen:e,onClose:t,title:n,children:r})=>e?a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-75","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",children:[a.jsx("div",{className:"fixed inset-0",onClick:t}),a.jsxs("div",{className:"relative bg-gray-900 rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:max-w-4xl sm:w-full",children:[a.jsx("div",{className:"bg-gray-800 px-4 pt-5 pb-4 sm:p-6 sm:pb-4 border-b border-gray-700",children:a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("h3",{className:"text-xl leading-6 font-medium text-white",id:"modal-title",children:n}),a.jsxs("button",{onClick:t,className:"text-gray-400 hover:text-white",children:[a.jsx("span",{className:"sr-only",children:"Close"}),a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})]})]})}),a.jsx("div",{className:"bg-gray-900 px-4 pt-5 pb-4 sm:p-6 max-h-[80vh] overflow-y-auto",children:r})]})]}):null,lIn=(e,t)=>{const[n,r]=f.useState(1),o=Math.ceil(e.length/t),i=f.useMemo(()=>{const u=(n-1)*t,d=u+t;return e.slice(u,d)},[e,n,t]),s=()=>{r(u=>Math.min(u+1,o))},l=()=>{r(u=>Math.max(u-1,1))},c=u=>{const d=Math.max(1,u);r(Math.min(d,o))};return f.useEffect(()=>{n>o&&o>0?r(o):e.length>0&&n===0&&r(1)},[e,o,n]),{next:s,prev:l,jump:c,currentData:i,currentPage:n,maxPage:o}},cIn=({query:e,onSearch:t})=>a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),a.jsx("input",{type:"text",value:e,onChange:n=>t(n.target.value),placeholder:"Search for agents by name, tag, or description...",className:"block w-full bg-gray-700 border border-gray-600 rounded-md py-2 pl-10 pr-3 text-sm placeholder-gray-400 text-white focus:outline-none focus:ring-1 focus:ring-cyan-500 focus:border-cyan-500"})]}),uIn=({state:e,dispatch:t})=>a.jsxs("aside",{className:"w-full lg:w-1/4 xl:w-1/5 p-4 bg-gray-800/50 rounded-lg h-full self-start sticky top-4",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-white",children:"Filters"}),a.jsx("button",{onClick:()=>t({type:"RESET_FILTERS"}),className:"text-sm text-cyan-400 hover:text-cyan-300",children:"Reset"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("h4",{className:"font-semibold text-gray-300 mb-2",children:"Category"}),Hse.map(n=>a.jsxs("div",{className:"flex items-center mb-1",children:[a.jsx("input",{id:`cat-${n}`,type:"checkbox",checked:e.categories.has(n),onChange:()=>t({type:"TOGGLE_CATEGORY",payload:n}),className:"h-4 w-4 rounded border-gray-500 text-cyan-600 bg-gray-700 focus:ring-cyan-500"}),a.jsx("label",{htmlFor:`cat-${n}`,className:"ml-2 text-sm text-gray-400",children:n})]},n))]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("h4",{className:"font-semibold text-gray-300 mb-2",children:"Minimum Rating"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"range",min:"0",max:"5",step:"0.5",value:e.minRating,onChange:n=>t({type:"SET_MIN_RATING",payload:parseFloat(n.target.value)}),className:"w-full"}),a.jsx("span",{className:"text-sm text-gray-300 font-mono w-8 text-center",children:e.minRating.toFixed(1)})]})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("h4",{className:"font-semibold text-gray-300 mb-2",children:"Max Price"}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"range",min:"0",max:"500",step:"10",value:e.maxPrice,onChange:n=>t({type:"SET_MAX_PRICE",payload:parseInt(n.target.value)}),className:"w-full"}),a.jsxs("span",{className:"text-sm text-gray-300 font-mono w-12 text-center",children:["$",e.maxPrice]})]}),a.jsx("div",{className:"mt-2 space-y-1",children:["free","one-time","subscription"].map(n=>a.jsxs("div",{className:"flex items-center",children:[a.jsx("input",{id:`price-${n}`,type:"checkbox",checked:e.pricingTypes.has(n),onChange:()=>t({type:"TOGGLE_PRICING_TYPE",payload:n}),className:"h-4 w-4 rounded border-gray-500 text-cyan-600 bg-gray-700 focus:ring-cyan-500"}),a.jsx("label",{htmlFor:`price-${n}`,className:"ml-2 text-sm text-gray-400 capitalize",children:n})]},n))})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("h4",{className:"font-semibold text-gray-300 mb-2",children:"Author"}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("input",{id:"verified-author",type:"checkbox",checked:e.verifiedAuthor,onChange:()=>t({type:"TOGGLE_VERIFIED_AUTHOR"}),className:"h-4 w-4 rounded border-gray-500 text-cyan-600 bg-gray-700 focus:ring-cyan-500"}),a.jsx("label",{htmlFor:"verified-author",className:"ml-2 text-sm text-gray-400",children:"Verified Author Only"})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold text-gray-300 mb-2",children:"Tags"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:Vse.map(n=>a.jsx("button",{onClick:()=>t({type:"TOGGLE_TAG",payload:n}),className:`px-2 py-1 text-xs rounded-full border ${e.tags.has(n)?"bg-cyan-500 border-cyan-500 text-white":"bg-gray-700 border-gray-600 text-gray-300 hover:bg-gray-600"}`,children:n},n))})]})]}),dIn=({agent:e,onSelect:t})=>a.jsxs("div",{className:"bg-gray-800 rounded-lg overflow-hidden shadow-lg hover:shadow-cyan-500/20 transition-all duration-300 ease-in-out transform hover:-translate-y-1 cursor-pointer flex flex-col",onClick:()=>t(e),children:[a.jsx("img",{className:"w-full h-40 object-cover bg-gray-700",src:e.imageUrl,alt:e.name}),a.jsxs("div",{className:"p-4 flex flex-col flex-grow",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("p",{className:"text-sm text-cyan-400",children:e.category}),a.jsxs("div",{className:"text-lg font-bold text-green-400",children:[e.pricing.type==="free"?"Free":`$${e.pricing.amount}`,e.pricing.type==="subscription"&&a.jsxs("span",{className:"text-xs text-gray-400",children:["/",e.pricing.subscriptionInterval==="monthly"?"mo":"yr"]})]})]}),a.jsx("h3",{className:"text-lg font-semibold text-white mt-1",children:e.name}),a.jsxs("div",{className:"flex items-center mt-1",children:[a.jsx("img",{src:e.author.avatarUrl,alt:e.author.name,className:"h-6 w-6 rounded-full mr-2"}),a.jsx("span",{className:"text-sm text-gray-400",children:e.author.name}),e.author.verified&&a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-cyan-500 ml-1",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M6.267 3.455a3.066 3.066 0 001.745-.723 3.066 3.066 0 013.976 0 3.066 3.066 0 001.745.723 3.066 3.066 0 012.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 010 3.976 3.066 3.066 0 00-.723 1.745 3.066 3.066 0 01-2.812 2.812 3.066 3.066 0 00-1.745.723 3.066 3.066 0 01-3.976 0 3.066 3.066 0 00-1.745-.723 3.066 3.066 0 01-2.812-2.812 3.066 3.066 0 00-.723-1.745 3.066 3.066 0 010-3.976 3.066 3.066 0 00.723-1.745 3.066 3.066 0 012.812-2.812zm7.44-1.22a.75.75 0 00-1.06 0L8.25 6.19 6.31 4.25a.75.75 0 00-1.06 1.06l2.5 2.5a.75.75 0 001.06 0l4.5-4.5a.75.75 0 000-1.06z",clipRule:"evenodd"})})]}),a.jsx("p",{className:"text-sm text-gray-400 mt-2 flex-grow",children:e.shortDescription}),a.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-700 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(tot,{rating:e.rating}),a.jsxs("span",{className:"text-xs text-gray-500 ml-2",children:["(",e.reviewCount,")"]})]}),a.jsxs("div",{className:"flex items-center text-xs text-gray-500",children:[a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{d:"M8.707 7.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l2-2a1 1 0 00-1.414-1.414L11 8.586V3a1 1 0 10-2 0v5.586L8.707 7.293zM3 11a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"})}),e.downloads.toLocaleString()]})]})]})]}),fIn=({currentPage:e,maxPage:t,onJump:n})=>{if(t<=1)return null;const r=[];if(t<=7)for(let o=1;o<=t;o++)r.push(o);else r.push(1),e>3&&r.push("..."),e>2&&r.push(e-1),e>1&&en(e-1),disabled:e===1,className:"relative inline-flex items-center px-4 py-2 border border-gray-600 text-sm font-medium rounded-md text-gray-300 bg-gray-800 hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Previous"}),a.jsx("div",{className:"hidden md:flex items-center mx-2",children:r.map((o,i)=>o==="..."?a.jsx("span",{className:"px-4 py-2 text-sm",children:"..."},i):a.jsx("button",{onClick:()=>n(o),className:`px-4 py-2 border border-gray-600 text-sm font-medium rounded-md mx-1 ${e===o?"bg-cyan-600 text-white":"bg-gray-800 hover:bg-gray-700"}`,children:o},i))}),a.jsx("button",{onClick:()=>n(e+1),disabled:e===t,className:"ml-3 relative inline-flex items-center px-4 py-2 border border-gray-600 text-sm font-medium rounded-md text-gray-300 bg-gray-800 hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:"Next"})]})]})},pIn=({agent:e,onClose:t})=>{const[n,r]=f.useState("overview");if(!e)return null;const o=()=>{switch(n){case"specs":return a.jsxs("div",{className:"space-y-4 text-gray-300",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"Technical Specifications"}),a.jsxs("ul",{className:"list-disc list-inside bg-gray-800/50 p-4 rounded-md",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Version:"})," ",e.specs.version," (Released on ",e.specs.releaseDate.toLocaleDateString(),")"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Required API Version:"})," ",e.specs.requiredApiVersion]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Supported Languages:"})," ",e.specs.supportedLanguages.join(", ")]})]}),a.jsx("h4",{className:"text-lg font-semibold text-white mt-4",children:"Dependencies"}),a.jsx("ul",{className:"list-disc list-inside bg-gray-800/50 p-4 rounded-md",children:e.specs.dependencies.map(s=>a.jsx("li",{children:s},s))}),a.jsx("h4",{className:"text-lg font-semibold text-white mt-4",children:"Compute Requirements"}),a.jsxs("ul",{className:"list-disc list-inside bg-gray-800/50 p-4 rounded-md",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"CPU:"})," ",e.specs.computeRequirements.cpu]}),a.jsxs("li",{children:[a.jsx("strong",{children:"RAM:"})," ",e.specs.computeRequirements.ram]}),e.specs.computeRequirements.gpu&&a.jsxs("li",{children:[a.jsx("strong",{children:"GPU:"})," ",e.specs.computeRequirements.gpu]})]})]});case"reviews":return a.jsxs("div",{children:[a.jsxs("h4",{className:"text-lg font-semibold text-white mb-4",children:["User Reviews (",e.reviewCount,")"]}),a.jsx("div",{className:"space-y-6",children:e.reviews.slice(0,5).map(s=>a.jsxs("div",{className:"border-b border-gray-700 pb-4",children:[a.jsxs("div",{className:"flex items-center mb-2",children:[a.jsx("img",{src:s.author.avatarUrl,alt:s.author.name,className:"h-8 w-8 rounded-full mr-3"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold text-white",children:s.author.name}),a.jsx("p",{className:"text-xs text-gray-500",children:s.createdAt.toLocaleDateString()})]}),a.jsx("div",{className:"ml-auto",children:a.jsx(tot,{rating:s.rating})})]}),a.jsx("p",{className:"text-gray-400",children:s.comment}),a.jsxs("p",{className:"text-xs text-gray-500 mt-2",children:[s.helpfulVotes," people found this helpful."]})]},s.id))})]});case"changelog":return a.jsxs("div",{children:[a.jsx("h4",{className:"text-lg font-semibold text-white mb-4",children:"Version History"}),a.jsx("div",{className:"space-y-6",children:e.changelog.map(s=>a.jsxs("div",{children:[a.jsxs("h5",{className:"font-semibold text-gray-200",children:["Version ",s.version," ",a.jsxs("span",{className:"text-sm font-normal text-gray-500",children:["- ",s.releaseDate.toLocaleDateString()]})]}),a.jsx("ul",{className:"list-disc list-inside text-gray-400 mt-2 pl-4",children:s.changes.map((l,c)=>a.jsx("li",{children:l},c))})]},s.version))})]});case"overview":default:return a.jsx("p",{className:"text-gray-300 whitespace-pre-wrap",children:e.longDescription})}},i=[{id:"overview",label:"Overview"},{id:"specs",label:"Specifications"},{id:"reviews",label:`Reviews (${e.reviewCount})`},{id:"changelog",label:"Changelog"}];return a.jsx(sIn,{isOpen:!!e,onClose:t,title:e.name,children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("img",{src:e.imageUrl,alt:e.name,className:"w-full h-64 object-cover rounded-lg bg-gray-700 mb-4"}),a.jsx("div",{className:"border-b border-gray-700 mb-4",children:a.jsx("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:i.map(s=>a.jsx("button",{onClick:()=>r(s.id),className:`${n===s.id?"border-cyan-500 text-cyan-400":"border-transparent text-gray-400 hover:text-gray-200 hover:border-gray-500"} whitespace-nowrap py-4 px-1 border-b-2 font-medium text-sm`,children:s.label},s.id))})}),a.jsx("div",{children:o()})]}),a.jsxs("div",{className:"md:col-span-1 space-y-4",children:[a.jsxs("div",{className:"bg-gray-800 p-4 rounded-lg",children:[a.jsxs("div",{className:"text-3xl font-bold text-green-400 mb-4",children:[e.pricing.type==="free"?"Free":`$${e.pricing.amount}`,e.pricing.type==="subscription"&&a.jsxs("span",{className:"text-base text-gray-400",children:["/",e.pricing.subscriptionInterval==="monthly"?"mo":"yr"]})]}),a.jsx("button",{className:"w-full bg-cyan-600 text-white font-bold py-2 px-4 rounded hover:bg-cyan-700 transition duration-300",children:e.pricing.type==="free"?"Download":"Purchase Agent"})]}),a.jsxs("div",{className:"bg-gray-800 p-4 rounded-lg text-sm text-gray-300 space-y-2",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Version:"})," ",a.jsx("span",{className:"font-mono",children:e.specs.version})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Updated:"})," ",a.jsx("span",{children:e.updatedAt.toLocaleDateString()})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Category:"})," ",a.jsx("span",{className:"text-cyan-400",children:e.category})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{children:"Downloads:"})," ",a.jsx("span",{children:e.downloads.toLocaleString()})]})]}),a.jsxs("div",{className:"bg-gray-800 p-4 rounded-lg",children:[a.jsx("h4",{className:"font-semibold text-white mb-2",children:"Author"}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("img",{src:e.author.avatarUrl,alt:e.author.name,className:"h-10 w-10 rounded-full mr-3"}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("p",{className:"font-semibold text-white",children:e.author.name}),e.author.verified&&a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-cyan-500 ml-1",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{fillRule:"evenodd",d:"M6.267 3.455a3.066 3.066 0 001.745-.723 3.066 3.066 0 013.976 0 3.066 3.066 0 001.745.723 3.066 3.066 0 012.812 2.812c.051.643.304 1.254.723 1.745a3.066 3.066 0 010 3.976 3.066 3.066 0 00-.723 1.745 3.066 3.066 0 01-2.812 2.812 3.066 3.066 0 00-1.745.723 3.066 3.066 0 01-3.976 0 3.066 3.066 0 00-1.745-.723 3.066 3.066 0 01-2.812-2.812 3.066 3.066 0 00-.723-1.745 3.066 3.066 0 010-3.976 3.066 3.066 0 00.723-1.745 3.066 3.066 0 012.812-2.812zm7.44-1.22a.75.75 0 00-1.06 0L8.25 6.19 6.31 4.25a.75.75 0 00-1.06 1.06l2.5 2.5a.75.75 0 001.06 0l4.5-4.5a.75.75 0 000-1.06z",clipRule:"evenodd"})})]}),a.jsx("a",{href:e.author.profileUrl,className:"text-xs text-cyan-400 hover:underline",children:"View Profile"})]})]}),a.jsx("p",{className:"text-xs text-gray-400 mt-2",children:e.author.bio})]}),a.jsxs("div",{className:"bg-gray-800 p-4 rounded-lg",children:[a.jsx("h4",{className:"font-semibold text-white mb-2",children:"Tags"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:e.tags.map(s=>a.jsx("span",{className:"px-2 py-1 bg-gray-700 text-xs text-gray-300 rounded-full",children:s},s))})]})]})]})})},hIn=()=>{const[e,t]=f.useState([]),[n,r]=f.useState(!0),[o,i]=f.useState(null),[s,l]=f.useState(null),[c,u]=f.useReducer(oIn,eot),[d,p]=f.useState("featured");f.useEffect(()=>{r(!0),i(null);const w=setTimeout(()=>{try{const S=rIn(150);t(S)}catch(S){i("Failed to load agent data."),console.error(S)}finally{r(!1)}},1500);return()=>clearTimeout(w)},[]);const h=f.useMemo(()=>{let w=e.filter(S=>{const C=c.searchQuery.toLowerCase(),N=S.name.toLowerCase().includes(C),j=S.shortDescription.toLowerCase().includes(C),I=S.tags.some($=>$.toLowerCase().includes(C)),_=c.categories.size===0||c.categories.has(S.category),T=S.rating>=c.minRating,P=S.pricing.type==="free"&&c.maxPrice>=0||S.pricing.type!=="free"&&S.pricing.amount<=c.maxPrice,E=c.pricingTypes.size===0||c.pricingTypes.has(S.pricing.type),M=c.tags.size===0||S.tags.some($=>c.tags.has($)),R=!c.verifiedAuthor||S.author.verified;return(N||j||I)&&_&&T&&P&&E&&M&&R});switch(d){case"featured":w.sort((S,C)=>(C.featured?1:0)-(S.featured?1:0)||C.rating-S.rating);break;case"rating":w.sort((S,C)=>C.rating-S.rating);break;case"newest":w.sort((S,C)=>C.createdAt.getTime()-S.createdAt.getTime());break;case"downloads":w.sort((S,C)=>C.downloads-S.downloads);break}return w},[e,c,d]),{currentData:m,currentPage:g,maxPage:y,jump:x}=lIn(h,12),v=f.useCallback(w=>{u({type:"SET_SEARCH_QUERY",payload:w}),x(1)},[x]),b=f.useCallback(()=>{u({type:"RESET_FILTERS"}),x(1)},[x]);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs(Ft,{title:"AI Agent Marketplace",padding:"none",children:[a.jsxs("div",{className:"p-6 border-b border-gray-700",children:[a.jsx("p",{className:"text-gray-400 mb-4",children:"Discover, purchase, and deploy autonomous AI agents for various financial and business tasks."}),a.jsx(cIn,{query:c.searchQuery,onSearch:v})]}),a.jsxs("div",{className:"flex flex-col lg:flex-row",children:[a.jsx(uIn,{state:c,dispatch:u}),a.jsxs("main",{className:"w-full lg:w-3/4 xl:w-4/5 p-4",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4 flex-wrap gap-4",children:[a.jsxs("p",{className:"text-gray-400",children:["Showing ",h.length," agents"]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:"text-sm text-gray-300",children:"Sort by:"}),a.jsxs("select",{value:d,onChange:w=>p(w.target.value),className:"bg-gray-700 border border-gray-600 rounded-md py-1 px-2 text-sm text-white focus:outline-none focus:ring-1 focus:ring-cyan-500 focus:border-cyan-500",children:[a.jsx("option",{value:"featured",children:"Featured"}),a.jsx("option",{value:"rating",children:"Highest Rated"}),a.jsx("option",{value:"newest",children:"Newest"}),a.jsx("option",{value:"downloads",children:"Most Popular"})]})]})]}),n?a.jsx(iIn,{}):o?a.jsx("div",{className:"text-center text-red-400 bg-red-900/50 p-4 rounded-lg",children:o}):m.length>0?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6",children:m.map(w=>a.jsx(dIn,{agent:w,onSelect:l},w.id))}),a.jsx(fIn,{currentPage:g,maxPage:y,onJump:x})]}):a.jsx(aIn,{onReset:b})]})]})]}),a.jsx(pIn,{agent:s,onClose:()=>l(null)})]})};function q3(e){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...e,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924-1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065zM15 12a3 3 0 11-6 0 3 3 0 016 0z"})})}const SR=({status:e})=>{const t={Operational:{bg:"bg-green-500/20",text:"text-green-300",dot:"bg-green-400"},"Degraded Performance":{bg:"bg-yellow-500/20",text:"text-yellow-300",dot:"bg-yellow-400"},"Partial Outage":{bg:"bg-orange-500/20",text:"text-orange-300",dot:"bg-orange-400"},"Major Outage":{bg:"bg-red-500/20",text:"text-red-300",dot:"bg-red-400"},Maintenance:{bg:"bg-blue-500/20",text:"text-blue-300",dot:"bg-blue-400"},Unknown:{bg:"bg-gray-500/20",text:"text-gray-300",dot:"bg-gray-400"}},n=t[e]||t.Unknown;return a.jsxs("div",{className:`flex items-center gap-2 px-2 py-1 rounded-full text-xs font-medium ${n.bg} ${n.text}`,children:[a.jsx("div",{className:`w-2 h-2 rounded-full ${n.dot}`}),e]})},mIn=({geminiApiKey:e})=>{const[t,n]=f.useState([]),[r,o]=f.useState(""),[i,s]=f.useState(!1),[l,c]=f.useState(null),u=f.useRef(null),d=f.useRef(null);f.useEffect(()=>{if(e)try{const h=new Ko({apiKey:e});u.current=h.chats.create({model:"gemini-2.5-flash",config:{systemInstruction:"You are GEIN (Global Enterprise Intelligence Network), an AI Business Assistant integrated into an Enterprise Operating System. Your purpose is to help users with API monitoring, financial insights, high-frequency trading, legal compliance, supply chain logistics, HR, workflow automation, and business intelligence. Be concise, professional, and helpful."},history:[]}),c(null)}catch(h){console.error("Error initializing Gemini:",h),c("Failed to initialize AI. Please check your API key.")}},[e]);const p=async()=>{if(r.trim()===""||!e||!u.current||i)return;const h=r,m={sender:"user",text:h,timestamp:new Date().toLocaleTimeString()};n(g=>[...g,m]),o(""),s(!0),c(null);try{const g=await u.current.sendMessageStream({message:h});let y="";n(x=>[...x,{sender:"ai",text:"",timestamp:new Date().toLocaleTimeString()}]);for await(const x of g){const b=x.text;b&&(y+=b,n(w=>{const S=[...w],C=S[S.length-1];return C&&C.sender==="ai"&&(C.text=y,C.timestamp=new Date().toLocaleTimeString()),S}))}}catch(g){console.error("Error sending message to Gemini:",g);const y=g instanceof Error?g.message:"An error occurred while communicating with the AI.";c(`AI Error: ${y}`),n(x=>{const v=[...x],b=v[v.length-1];return b&&b.sender==="ai"&&b.text===""&&v.pop(),v})}finally{s(!1)}};return f.useEffect(()=>{d.current&&(d.current.scrollTop=d.current.scrollHeight)},[t]),a.jsx(Ft,{title:"AI Business Assistant (GEIN)",children:a.jsxs("div",{className:"flex flex-col h-96",children:[a.jsxs("div",{ref:d,id:"chat-messages",className:"flex-grow overflow-y-auto p-4 space-y-4 bg-gray-900 rounded-lg border border-gray-700 mb-4",children:[t.length===0&&a.jsx("div",{className:"text-center text-gray-500 italic",children:"Type a message to start a conversation with GEIN, your AI Business Assistant."}),t.map((h,m)=>a.jsx("div",{className:`flex ${h.sender==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-xs lg:max-w-md px-4 py-2 rounded-lg shadow-md ${h.sender==="user"?"bg-cyan-700 text-white":"bg-gray-700 text-gray-100"}`,children:[a.jsx("p",{className:"text-sm whitespace-pre-wrap",children:h.text}),a.jsx("span",{className:"block text-right text-xs text-gray-400 mt-1",children:h.timestamp})]})},m)),l&&a.jsx("div",{className:"text-center text-red-400 italic p-2",children:l})]}),a.jsxs("div",{className:"flex",children:[a.jsx("input",{type:"text",value:r,onChange:h=>o(h.target.value),onKeyPress:h=>h.key==="Enter"&&p(),placeholder:e?"Ask GEIN...":"Please configure Gemini API key to chat...",className:"flex-grow bg-gray-700/50 border border-gray-600 rounded-l-lg px-4 py-2 text-white focus:outline-none focus:ring-1 focus:ring-cyan-500",disabled:!e||i}),a.jsx("button",{onClick:p,className:"bg-cyan-600 hover:bg-cyan-700 text-white rounded-r-lg px-4 py-2 transition-colors duration-200 disabled:bg-gray-500 disabled:cursor-not-allowed",disabled:!e||r.trim()===""||i,children:"Send"})]})]})})},gIn=({apiStatus:e,geminiApiKey:t,onConfigurePlaid:n,onConfigureStripe:r})=>{const[o,i]=f.useState(null),[s,l]=f.useState(!1),[c,u]=f.useState([]);Array.from({length:30},(p,h)=>({name:`${h+1}h ago`,calls:100+Math.random()*200,errors:Math.floor(Math.random()*10),latency:50+Math.random()*150})),f.useEffect(()=>{u(t&&s?["AI detected a 15% increase in API latency for Google Gemini over the last 2 hours, potentially indicating network congestion.","Anomaly: Modern Treasury API error rates spiked briefly at 02:30 UTC, but quickly recovered. Root cause analysis initiated.","Predictive analysis suggests a 70% probability of 'Degraded Performance' for a third-party payment gateway API within the next 48 hours due to observed traffic patterns.","Recommendation: Review rate limits for high-volume endpoints to prevent future throttling issues."]:[])},[t,s,e]);const d=()=>{if(!o)return a.jsx("p",{className:"text-gray-400",children:"Select an API provider to view detailed metrics and AI insights."});const p=e.find(m=>m.provider===o);if(!p)return a.jsx("p",{className:"text-red-400",children:"API details not found."});const h=Array.from({length:24},(m,g)=>({time:`${g}:00`,latency:p.responseTime+Math.random()*50-25,errors:Math.floor(Math.random()*5),throughput:1e3+Math.random()*500}));return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("h3",{className:"text-xl font-bold text-white",children:[p.provider," - Detailed Metrics"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Current Status"}),a.jsx(SR,{status:p.status})]}),a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Average Latency"}),a.jsxs("p",{className:"text-2xl font-bold text-cyan-400",children:[p.responseTime,"ms"]})]}),a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Error Rate (24h)"}),a.jsxs("p",{className:"text-2xl font-bold text-red-400",children:[(Math.random()*2).toFixed(2),"%"]})]})]}),a.jsxs("div",{className:"h-64 bg-gray-900 rounded-lg p-4 border border-gray-700",children:[a.jsx("h4",{className:"text-lg font-semibold text-white mb-2",children:"Historical Latency & Errors"}),a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(vw,{data:h,children:[a.jsx(kl,{strokeDasharray:"3 3",stroke:"#4b5563"}),a.jsx(Ka,{dataKey:"time",stroke:"#9ca3af"}),a.jsx(ra,{yAxisId:"left",stroke:"#06b6d4",label:{value:"Latency (ms)",angle:-90,position:"insideLeft",fill:"#06b6d4"}}),a.jsx(ra,{yAxisId:"right",orientation:"right",stroke:"#ef4444",label:{value:"Errors",angle:90,position:"insideRight",fill:"#ef4444"}}),a.jsx(ji,{contentStyle:{backgroundColor:"rgba(31, 41, 55, 0.9)",borderColor:"#4b5563",borderRadius:"8px"}}),a.jsx(uu,{}),a.jsx(au,{yAxisId:"left",type:"monotone",dataKey:"latency",stroke:"#06b6d4",dot:!1,name:"Latency"}),a.jsx(au,{yAxisId:"right",type:"monotone",dataKey:"errors",stroke:"#ef4444",dot:!1,name:"Errors"})]})})]}),t&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"AI Anomaly Detection & Predictive Insights"}),a.jsxs("label",{className:"flex items-center cursor-pointer",children:[a.jsx("span",{className:"mr-3 text-sm text-gray-400",children:"Enable AI Analysis"}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"checkbox",className:"sr-only",checked:s,onChange:()=>l(!s)}),a.jsx("div",{className:`block w-10 h-6 rounded-full ${s?"bg-cyan-600":"bg-gray-600"}`}),a.jsx("div",{className:`dot absolute left-1 top-1 bg-white w-4 h-4 rounded-full transition ${s?"translate-x-full":""}`})]})]})]}),s&&c.length>0?a.jsx("ul",{className:"list-disc list-inside text-gray-300 space-y-2 bg-gray-900 p-4 rounded-lg border border-gray-700",children:c.map((m,g)=>a.jsx("li",{className:"text-sm",children:m},g))}):s?a.jsx("p",{className:"text-gray-500 italic bg-gray-900 p-4 rounded-lg border border-gray-700",children:"AI is analyzing data... No critical anomalies detected yet."}):a.jsx("p",{className:"text-gray-500 italic",children:"Enable AI Analysis to receive real-time anomaly detection and predictive insights."})]})]})};return a.jsx(Ft,{title:"Advanced API Monitoring & AI Diagnostics",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6",children:[a.jsxs("div",{className:"lg:col-span-1 space-y-4",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"API Providers"}),a.jsxs("ul",{className:"space-y-2",children:[e.map(p=>a.jsx("li",{children:a.jsxs("button",{onClick:()=>i(p.provider),className:`w-full text-left p-3 rounded-lg transition-colors duration-200 flex items-center justify-between ${o===p.provider?"bg-cyan-700 text-white":"bg-gray-800/50 hover:bg-gray-700/50 text-gray-300"}`,children:[a.jsx("span",{className:"font-medium",children:p.provider}),a.jsx(SR,{status:p.status})]})},p.provider)),a.jsx("li",{children:a.jsxs("div",{className:"w-full text-left p-3 rounded-lg bg-gray-800/50 text-gray-300 flex items-center justify-between",children:[a.jsx("span",{className:"font-medium",children:"Plaid"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(SR,{status:"Unknown"}),a.jsx("button",{onClick:n,className:"text-gray-400 hover:text-white",children:a.jsx(q3,{className:"h-5 w-5"})})]})]})}),a.jsx("li",{children:a.jsxs("div",{className:"w-full text-left p-3 rounded-lg bg-gray-800/50 text-gray-300 flex items-center justify-between",children:[a.jsx("span",{className:"font-medium",children:"Stripe"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(SR,{status:"Unknown"}),a.jsx("button",{onClick:r,className:"text-gray-400 hover:text-white",children:a.jsx(q3,{className:"h-5 w-5"})})]})]})})]})]}),a.jsx("div",{className:"lg:col-span-3",children:d()})]})})},xIn=({modernTreasuryApiKey:e,modernTreasuryOrganizationId:t,geminiApiKey:n})=>{const[r,o]=f.useState("overview"),[i,s]=f.useState([]),[l,c]=f.useState(!1),u=e&&t,d=Array.from({length:7},(m,g)=>({date:`Day ${g+1}`,incoming:5e3+Math.random()*2e3,outgoing:3e3+Math.random()*1500})),p=[{name:"ACH",value:400},{name:"Wire",value:300},{name:"RTP",value:200},{name:"Card",value:100}];if(f.useEffect(()=>{s(n&&u&&l?["AI detected a potential anomaly in outgoing payments to a new vendor. Review required for transaction ID: TXN-98765.","Cash flow forecast for Q3 indicates a surplus of $1.2M, exceeding projections by 10%.","Recommendation: Optimize payment routing for international wires to reduce fees by an estimated 5%.","AI identified 3 high-risk transactions in the last 48 hours. Details available in the 'Transactions' tab."]:[])},[n,u,l]),!u)return a.jsx(Ft,{title:"Financial Operations (Modern Treasury)",children:a.jsxs("div",{className:"p-6 text-center text-gray-400 space-y-4",children:[a.jsx("p",{className:"text-lg",children:"Modern Treasury API is not configured."}),a.jsx("p",{children:"Please configure your Modern Treasury API Key and Organization ID to access advanced financial operations, real-time cash management, and AI-powered fraud detection."}),a.jsx("button",{className:"py-2 px-4 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg",children:"Configure Now"})]})});const h=()=>{switch(r){case"overview":return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Current Balance"}),a.jsx("p",{className:"text-3xl font-bold text-green-400",children:"$1,234,567.89"})]}),a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Pending Payments"}),a.jsx("p",{className:"text-3xl font-bold text-yellow-400",children:"$87,654.32"})]}),a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Last 24h Transactions"}),a.jsx("p",{className:"text-3xl font-bold text-white",children:"128"})]})]}),a.jsxs("div",{className:"h-64 bg-gray-900 rounded-lg p-4 border border-gray-700",children:[a.jsx("h4",{className:"text-lg font-semibold text-white mb-2",children:"Daily Cash Flow"}),a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(Yx,{data:d,children:[a.jsx(kl,{strokeDasharray:"3 3",stroke:"#4b5563"}),a.jsx(Ka,{dataKey:"date",stroke:"#9ca3af"}),a.jsx(ra,{stroke:"#9ca3af"}),a.jsx(ji,{contentStyle:{backgroundColor:"rgba(31, 41, 55, 0.9)",borderColor:"#4b5563",borderRadius:"8px"}}),a.jsx(uu,{}),a.jsx(cf,{dataKey:"incoming",fill:"#34d399",name:"Incoming"}),a.jsx(cf,{dataKey:"outgoing",fill:"#ef4444",name:"Outgoing"})]})})]}),n&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"AI Fraud Detection & Financial Insights"}),a.jsxs("label",{className:"flex items-center cursor-pointer",children:[a.jsx("span",{className:"mr-3 text-sm text-gray-400",children:"Enable AI Fraud Detection"}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"checkbox",className:"sr-only",checked:l,onChange:()=>c(!l)}),a.jsx("div",{className:`block w-10 h-6 rounded-full ${l?"bg-cyan-600":"bg-gray-600"}`}),a.jsx("div",{className:`dot absolute left-1 top-1 bg-white w-4 h-4 rounded-full transition ${l?"translate-x-full":""}`})]})]})]}),l&&i.length>0?a.jsx("ul",{className:"list-disc list-inside text-gray-300 space-y-2 bg-gray-900 p-4 rounded-lg border border-gray-700",children:i.map((y,x)=>a.jsx("li",{className:"text-sm",children:y},x))}):l?a.jsx("p",{className:"text-gray-500 italic bg-gray-900 p-4 rounded-lg border border-gray-700",children:"AI is actively monitoring transactions... No high-risk activities detected."}):a.jsx("p",{className:"text-gray-500 italic",children:"Enable AI Fraud Detection to protect your financial operations with real-time anomaly detection."})]})]});case"transactions":const m=Array.from({length:10},(y,x)=>({id:`TXN-${1e3+x}`,date:`2024-07-${15+x}`,description:x%2===0?`Payment to Vendor ${x}`:`Incoming from Client ${x}`,amount:x%2===0?-(1e3+x*50):2e3+x*75,status:x%3===0?"Pending":"Completed",risk:x%4===0?"High":"Low"}));return a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"Recent Transactions"}),a.jsx("div",{className:"overflow-x-auto bg-gray-900 rounded-lg border border-gray-700",children:a.jsxs("table",{className:"min-w-full divide-y divide-gray-700",children:[a.jsx("thead",{className:"bg-gray-800",children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider",children:"ID"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Date"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Description"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Amount"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Status"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider",children:"AI Risk"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-800",children:m.map(y=>a.jsxs("tr",{className:"hover:bg-gray-800/70",children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-white",children:y.id}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-300",children:y.date}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-300",children:y.description}),a.jsx("td",{className:`px-6 py-4 whitespace-nowrap text-sm ${y.amount>0?"text-green-400":"text-red-400"}`,children:y.amount.toLocaleString("en-US",{style:"currency",currency:"USD"})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:a.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${y.status==="Completed"?"bg-green-100 text-green-800":"bg-yellow-100 text-yellow-800"}`,children:y.status})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:a.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${y.risk==="High"?"bg-red-100 text-red-800":"bg-green-100 text-green-800"}`,children:y.risk})})]},y.id))})]})})]});case"payments":return a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"Payment Flow Analysis"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"h-64 bg-gray-900 rounded-lg p-4 border border-gray-700",children:[a.jsx("h4",{className:"text-lg font-semibold text-white mb-2",children:"Payment Method Distribution"}),a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(Yx,{data:p,children:[a.jsx(kl,{strokeDasharray:"3 3",stroke:"#4b5563"}),a.jsx(Ka,{dataKey:"name",stroke:"#9ca3af"}),a.jsx(ra,{stroke:"#9ca3af"}),a.jsx(ji,{contentStyle:{backgroundColor:"rgba(31, 41, 55, 0.9)",borderColor:"#4b5563",borderRadius:"8px"}}),a.jsx(cf,{dataKey:"value",fill:"#06b6d4"})]})})]}),a.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 border border-gray-700 space-y-3",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"AI Payment Optimization"}),a.jsx("p",{className:"text-gray-400 text-sm",children:"Leverage AI to analyze payment routes, identify cost savings, and optimize settlement times."}),a.jsxs("ul",{className:"list-disc list-inside text-gray-300 text-sm space-y-1",children:[a.jsxs("li",{children:["Suggested savings on international wires: ",a.jsx("strong",{children:"5%"})]}),a.jsx("li",{children:"Recommended faster ACH batch processing for payroll."}),a.jsx("li",{children:"Identified potential for real-time payment adoption for critical vendors."})]}),a.jsx("button",{className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg text-sm",children:"View Optimization Report"})]})]})]});case"forecasting":const g=Array.from({length:12},(y,x)=>({month:`Month ${x+1}`,projected:1e5+Math.random()*5e4,actual:x<6?1e5+Math.random()*5e4:null}));return a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"AI-Powered Cash Flow Forecasting"}),a.jsx("div",{className:"h-80 bg-gray-900 rounded-lg p-4 border border-gray-700",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(vw,{data:g,children:[a.jsx(kl,{strokeDasharray:"3 3",stroke:"#4b5563"}),a.jsx(Ka,{dataKey:"month",stroke:"#9ca3af"}),a.jsx(ra,{stroke:"#9ca3af",tickFormatter:y=>`$${(y/1e3).toFixed(0)}K`}),a.jsx(ji,{contentStyle:{backgroundColor:"rgba(31, 41, 55, 0.9)",borderColor:"#4b5563",borderRadius:"8px"}}),a.jsx(uu,{}),a.jsx(au,{type:"monotone",dataKey:"projected",stroke:"#06b6d4",name:"Projected Cash Flow"}),a.jsx(au,{type:"monotone",dataKey:"actual",stroke:"#34d399",name:"Actual Cash Flow"})]})})}),a.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 border border-gray-700 space-y-3",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"AI Forecast Summary"}),a.jsx("p",{className:"text-gray-400 text-sm",children:"Our AI model predicts a strong financial outlook for the next 12 months, with consistent growth in revenue streams. Key factors include: increased customer retention, successful product launches, and optimized operational costs."}),a.jsxs("ul",{className:"list-disc list-inside text-gray-300 text-sm space-y-1",children:[a.jsxs("li",{children:["Projected Q4 2024 Revenue: ",a.jsx("strong",{children:"$5.8M"})," (+18% YoY)"]}),a.jsxs("li",{children:["Identified potential for ",a.jsx("strong",{children:"$250K"})," in savings through vendor contract renegotiations."]}),a.jsxs("li",{children:["Scenario analysis: Impact of a 10% market downturn on cash reserves: ",a.jsx("strong",{children:"Manageable"}),"."]})]}),a.jsx("button",{className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg text-sm",children:"Generate Detailed Forecast Report"})]})]});default:return null}};return a.jsxs(Ft,{title:"AI-Powered Financial Operations",children:[a.jsx("div",{className:"border-b border-gray-700 mb-6",children:a.jsx("nav",{className:"-mb-px flex space-x-8","aria-label":"Tabs",children:["overview","transactions","payments","forecasting"].map(m=>a.jsx("button",{onClick:()=>o(m),className:`whitespace-nowrap py-3 px-1 border-b-2 font-medium text-sm capitalize transition-colors duration-200 ${r===m?"border-cyan-500 text-cyan-400":"border-transparent text-gray-400 hover:text-gray-200 hover:border-gray-300"}`,children:m.replace("-"," ")},m))})}),h()]})},yIn=({geminiApiKey:e})=>{const[t,n]=f.useState("overview"),[r,o]=f.useState([]),[i,s]=f.useState(!1),l=[{name:"Revenue Growth",value:12.5,target:10,unit:"%"},{name:"Customer Acquisition Cost",value:85,target:90,unit:"$"},{name:"Customer Lifetime Value",value:1200,target:1e3,unit:"$"},{name:"Operational Efficiency",value:92,target:90,unit:"%"}],c=Array.from({length:12},(d,p)=>({month:`M${p+1}`,revenue:1e5+Math.random()*5e4,newCustomers:50+Math.random()*20}));f.useEffect(()=>{o(e&&i?["AI identified a 20% increase in customer churn for a specific product segment. Recommend targeted re-engagement campaigns.","Predictive analytics suggest optimizing marketing spend towards digital channels for a 15% higher ROI.","Operational bottleneck detected in supply chain logistics. AI suggests alternative suppliers to mitigate risk.","Recommendation: Implement dynamic pricing strategies based on real-time market demand to maximize revenue."]:[])},[e,i]);const u=()=>{switch(t){case"overview":return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"Key Performance Indicators (KPIs)"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:l.map((h,m)=>a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:h.name}),a.jsxs("p",{className:"text-2xl font-bold text-white mt-1",children:[h.unit==="$"?"$":"",h.value.toFixed(h.unit==="%"?1:0),h.unit]}),a.jsxs("p",{className:`text-xs mt-1 ${h.value>=h.target?"text-green-400":"text-red-400"}`,children:["Target: ",h.unit==="$"?"$":"",h.target,h.unit]})]},m))}),e&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"AI Strategic Recommendations"}),a.jsxs("label",{className:"flex items-center cursor-pointer",children:[a.jsx("span",{className:"mr-3 text-sm text-gray-400",children:"Enable AI Insights"}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"checkbox",className:"sr-only",checked:i,onChange:()=>s(!i)}),a.jsx("div",{className:`block w-10 h-6 rounded-full ${i?"bg-cyan-600":"bg-gray-600"}`}),a.jsx("div",{className:`dot absolute left-1 top-1 bg-white w-4 h-4 rounded-full transition ${i?"translate-x-full":""}`})]})]})]}),i&&r.length>0?a.jsx("ul",{className:"list-disc list-inside text-gray-300 space-y-2 bg-gray-900 p-4 rounded-lg border border-gray-700",children:r.map((h,m)=>a.jsx("li",{className:"text-sm",children:h},m))}):i?a.jsx("p",{className:"text-gray-500 italic bg-gray-900 p-4 rounded-lg border border-gray-700",children:"AI is generating strategic recommendations..."}):a.jsx("p",{className:"text-gray-500 italic",children:"Enable AI Insights to receive data-driven strategic recommendations for your business."})]})]});case"sales":return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"Sales Performance & AI Forecasting"}),a.jsx("div",{className:"h-80 bg-gray-900 rounded-lg p-4 border border-gray-700",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(vw,{data:c,children:[a.jsx(kl,{strokeDasharray:"3 3",stroke:"#4b5563"}),a.jsx(Ka,{dataKey:"month",stroke:"#9ca3af"}),a.jsx(ra,{yAxisId:"left",stroke:"#06b6d4",label:{value:"Revenue ($)",angle:-90,position:"insideLeft",fill:"#06b6d4"}}),a.jsx(ra,{yAxisId:"right",orientation:"right",stroke:"#34d399",label:{value:"New Customers",angle:90,position:"insideRight",fill:"#34d399"}}),a.jsx(ji,{contentStyle:{backgroundColor:"rgba(31, 41, 55, 0.9)",borderColor:"#4b5563",borderRadius:"8px"}}),a.jsx(uu,{}),a.jsx(au,{yAxisId:"left",type:"monotone",dataKey:"revenue",stroke:"#06b6d4",name:"Monthly Revenue"}),a.jsx(au,{yAxisId:"right",type:"monotone",dataKey:"newCustomers",stroke:"#34d399",name:"New Customers"})]})})}),a.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 border border-gray-700 space-y-3",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"AI Sales Insights"}),a.jsx("p",{className:"text-gray-400 text-sm",children:"AI predicts a 10% increase in sales conversion rates next quarter due to optimized lead scoring and personalized outreach strategies."}),a.jsxs("ul",{className:"list-disc list-inside text-gray-300 text-sm space-y-1",children:[a.jsxs("li",{children:["Top performing sales channels identified: ",a.jsx("strong",{children:"Enterprise Solutions, Digital Partnerships"}),"."]}),a.jsx("li",{children:"AI-suggested personalized product bundles for high-value clients."}),a.jsxs("li",{children:["Forecasted impact of new sales hires: ",a.jsx("strong",{children:"+5% revenue growth"}),"."]})]}),a.jsx("button",{className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg text-sm",children:"Generate Sales Strategy Report"})]})]});case"marketing":const d=Array.from({length:12},(h,m)=>({month:`M${m+1}`,leads:500+Math.random()*200,conversions:50+Math.random()*30,cpc:1.5+Math.random()*.5}));return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"Marketing Performance & AI Optimization"}),a.jsx("div",{className:"h-80 bg-gray-900 rounded-lg p-4 border border-gray-700",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(wm,{data:d,children:[a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"leadsColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#06b6d4",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#06b6d4",stopOpacity:0})]}),a.jsxs("linearGradient",{id:"conversionsColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#34d399",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#34d399",stopOpacity:0})]})]}),a.jsx(kl,{strokeDasharray:"3 3",stroke:"#4b5563"}),a.jsx(Ka,{dataKey:"month",stroke:"#9ca3af"}),a.jsx(ra,{yAxisId:"left",stroke:"#06b6d4",label:{value:"Leads",angle:-90,position:"insideLeft",fill:"#06b6d4"}}),a.jsx(ra,{yAxisId:"right",orientation:"right",stroke:"#34d399",label:{value:"Conversions",angle:90,position:"insideRight",fill:"#34d399"}}),a.jsx(ji,{contentStyle:{backgroundColor:"rgba(31, 41, 55, 0.9)",borderColor:"#4b5563",borderRadius:"8px"}}),a.jsx(uu,{}),a.jsx(hu,{yAxisId:"left",type:"monotone",dataKey:"leads",stroke:"#06b6d4",fill:"url(#leadsColor)",name:"Leads Generated"}),a.jsx(hu,{yAxisId:"right",type:"monotone",dataKey:"conversions",stroke:"#34d399",fill:"url(#conversionsColor)",name:"Conversions"})]})})}),a.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 border border-gray-700 space-y-3",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"AI Marketing Optimization"}),a.jsx("p",{className:"text-gray-400 text-sm",children:"AI recommends reallocating 20% of your ad budget to social media campaigns, predicting a 15% increase in lead quality."}),a.jsxs("ul",{className:"list-disc list-inside text-gray-300 text-sm space-y-1",children:[a.jsxs("li",{children:["Identified high-performing keywords for SEO: ",a.jsx("strong",{children:'"AI finance platform", "business OS"'}),"."]}),a.jsx("li",{children:"AI-generated content suggestions for blog posts and email campaigns."}),a.jsx("li",{children:"Predicted optimal timing for product launch announcements."})]}),a.jsx("button",{className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg text-sm",children:"Generate Marketing Strategy Report"})]})]});case"operations":const p=Array.from({length:12},(h,m)=>({month:`M${m+1}`,tasksCompleted:1e3+Math.random()*300,automationRate:60+Math.random()*15,costSavings:5e3+Math.random()*2e3}));return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"Operational Efficiency & AI Automation"}),a.jsx("div",{className:"h-80 bg-gray-900 rounded-lg p-4 border border-gray-700",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(vw,{data:p,children:[a.jsx(kl,{strokeDasharray:"3 3",stroke:"#4b5563"}),a.jsx(Ka,{dataKey:"month",stroke:"#9ca3af"}),a.jsx(ra,{yAxisId:"left",stroke:"#06b6d4",label:{value:"Tasks Completed",angle:-90,position:"insideLeft",fill:"#06b6d4"}}),a.jsx(ra,{yAxisId:"right",orientation:"right",stroke:"#34d399",label:{value:"Automation Rate (%)",angle:90,position:"insideRight",fill:"#34d399"}}),a.jsx(ji,{contentStyle:{backgroundColor:"rgba(31, 41, 55, 0.9)",borderColor:"#4b5563",borderRadius:"8px"}}),a.jsx(uu,{}),a.jsx(au,{yAxisId:"left",type:"monotone",dataKey:"tasksCompleted",stroke:"#06b6d4",name:"Tasks Completed"}),a.jsx(au,{yAxisId:"right",type:"monotone",dataKey:"automationRate",stroke:"#34d399",name:"Automation Rate"})]})})}),a.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 border border-gray-700 space-y-3",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"AI Operational Insights"}),a.jsx("p",{className:"text-gray-400 text-sm",children:"AI identifies a 25% potential for further automation in customer support workflows, leading to significant cost savings and improved response times."}),a.jsxs("ul",{className:"list-disc list-inside text-gray-300 text-sm space-y-1",children:[a.jsx("li",{children:"Recommended process improvements for faster onboarding of new clients."}),a.jsx("li",{children:"AI-driven resource allocation suggestions for peak operational periods."}),a.jsx("li",{children:"Predicted maintenance needs for critical infrastructure."})]}),a.jsx("button",{className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg text-sm",children:"Generate Operations Efficiency Report"})]})]});default:return null}};return a.jsxs(Ft,{title:"AI-Driven Business Intelligence",children:[a.jsx("div",{className:"border-b border-gray-700 mb-6",children:a.jsx("nav",{className:"-mb-px flex space-x-8","aria-label":"Reports Tabs",children:["overview","sales","marketing","operations"].map(d=>a.jsx("button",{onClick:()=>n(d),className:`whitespace-nowrap py-3 px-1 border-b-2 font-medium text-sm capitalize transition-colors duration-200 ${t===d?"border-cyan-500 text-cyan-400":"border-transparent text-gray-400 hover:text-gray-200 hover:border-gray-300"}`,children:d.replace("-"," ")},d))})}),u()]})},vIn=({geminiApiKey:e})=>{const[t,n]=f.useState([{id:1,name:"Auto-reconcile Modern Treasury payments",status:"Active",trigger:"Daily at 3 AM",aiSuggested:!0},{id:2,name:"Notify team on critical API outage",status:"Active",trigger:"API Status: Major Outage",aiSuggested:!1},{id:3,name:"Generate weekly financial summary for executives",status:"Inactive",trigger:"Every Friday 5 PM",aiSuggested:!0},{id:4,name:"Flag high-risk transactions for manual review",status:"Active",trigger:"AI Fraud Detection: High Risk",aiSuggested:!0}]),[r,o]=f.useState(!1),[i,s]=f.useState(""),[l,c]=f.useState(""),[u,d]=f.useState([]);f.useEffect(()=>{d(e?["AI suggests automating customer onboarding steps by integrating with CRM and identity verification APIs.","Consider automating the generation of compliance reports based on financial transaction data.","Automate the process of updating inventory levels based on sales data and supplier APIs.","AI recommends setting up alerts for unusual login patterns to enhance security."]:[])},[e]);const p=()=>{i.trim()&&l.trim()&&(n(m=>[...m,{id:m.length+1,name:i,status:"Active",trigger:l,aiSuggested:!1}]),s(""),c(""),o(!1))},h=m=>{n(g=>g.map(y=>y.id===m?{...y,status:y.status==="Active"?"Inactive":"Active"}:y))};return a.jsxs(a.Fragment,{children:[r&&a.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 backdrop-blur-sm",onClick:()=>o(!1),children:a.jsxs("div",{className:"bg-gray-800 rounded-lg shadow-2xl max-w-md w-full border border-gray-700",onClick:m=>m.stopPropagation(),children:[a.jsx("div",{className:"p-4 border-b border-gray-700",children:a.jsx("h3",{className:"text-lg font-semibold text-white",children:"Add New Automation Rule"})}),a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsx("input",{type:"text",value:i,onChange:m=>s(m.target.value),placeholder:"Rule Name (e.g., Auto-archive old invoices)",className:"w-full bg-gray-700/50 border border-gray-600 rounded-lg px-3 py-2 text-white focus:outline-none focus:ring-1 focus:ring-cyan-500"}),a.jsx("input",{type:"text",value:l,onChange:m=>c(m.target.value),placeholder:"Trigger (e.g., Monthly, New Invoice, API Error)",className:"w-full bg-gray-700/50 border border-gray-600 rounded-lg px-3 py-2 text-white focus:outline-none focus:ring-1 focus:ring-cyan-500"}),a.jsx("button",{onClick:p,className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg",children:"Add Rule"})]})]})}),a.jsx(Ft,{title:"AI-Powered Workflow Automation",children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"Active Automation Rules"}),a.jsx("button",{onClick:()=>o(!0),className:"py-2 px-4 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg text-sm",children:"+ Add New Rule"})]}),a.jsx("div",{className:"overflow-x-auto bg-gray-900 rounded-lg border border-gray-700",children:a.jsxs("table",{className:"min-w-full divide-y divide-gray-700",children:[a.jsx("thead",{className:"bg-gray-800",children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Rule Name"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Trigger"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider",children:"Status"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-400 uppercase tracking-wider",children:"AI Suggested"}),a.jsx("th",{scope:"col",className:"relative px-6 py-3",children:a.jsx("span",{className:"sr-only",children:"Edit"})})]})}),a.jsx("tbody",{className:"divide-y divide-gray-800",children:t.map(m=>a.jsxs("tr",{className:"hover:bg-gray-800/70",children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-white",children:m.name}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-300",children:m.trigger}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:a.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${m.status==="Active"?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:m.status})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:m.aiSuggested?a.jsx("span",{className:"text-cyan-400",children:"Yes"}):a.jsx("span",{className:"text-gray-500",children:"No"})}),a.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:[a.jsx("button",{onClick:()=>h(m.id),className:"text-cyan-600 hover:text-cyan-900 mr-4",children:m.status==="Active"?"Deactivate":"Activate"}),a.jsx("button",{className:"text-gray-400 hover:text-white",children:a.jsx(q3,{className:"h-5 w-5 inline-block"})})]})]},m.id))})]})}),e&&u.length>0&&a.jsxs("div",{className:"space-y-4",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"AI-Suggested Automations"}),a.jsx("ul",{className:"list-disc list-inside text-gray-300 space-y-2 bg-gray-900 p-4 rounded-lg border border-gray-700",children:u.map((m,g)=>a.jsx("li",{className:"text-sm",children:m},g))}),a.jsx("button",{className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg text-sm",children:"Explore AI Automation Templates"})]})]})})]})},bIn=({geminiApiKey:e})=>{const[t,n]=f.useState({name:"Jane Doe",email:"jane.doe@example.com",role:"Financial Analyst",lastLogin:"2024-07-20 10:30 AM",preferredLanguage:"English",aiPersonalizationEnabled:!0}),[r,o]=f.useState([]);f.useEffect(()=>{e&&t.aiPersonalizationEnabled?o(["AI suggests tailoring dashboard views to prioritize financial KPIs for 'Financial Analyst' role.","Recommended personalized learning paths for advanced Modern Treasury features based on user activity.","AI detected peak usage hours for this user; optimizing background data sync during off-peak times.","Personalized notification preferences based on user's interaction patterns."]):o([])},[e,t.aiPersonalizationEnabled]);const i=()=>{n(s=>({...s,aiPersonalizationEnabled:!s.aiPersonalizationEnabled}))};return a.jsx(Ft,{title:"AI-Enhanced User Profile",children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Name"}),a.jsx("p",{className:"text-lg font-semibold text-white",children:t.name})]}),a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Email"}),a.jsx("p",{className:"text-lg font-semibold text-white",children:t.email})]}),a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Role"}),a.jsx("p",{className:"text-lg font-semibold text-white",children:t.role})]}),a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Last Login"}),a.jsx("p",{className:"text-lg font-semibold text-white",children:t.lastLogin})]})]}),e&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"AI Personalization & Adaptive UI"}),a.jsxs("label",{className:"flex items-center cursor-pointer",children:[a.jsx("span",{className:"mr-3 text-sm text-gray-400",children:"Enable AI Personalization"}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"checkbox",className:"sr-only",checked:t.aiPersonalizationEnabled,onChange:i}),a.jsx("div",{className:`block w-10 h-6 rounded-full ${t.aiPersonalizationEnabled?"bg-cyan-600":"bg-gray-600"}`}),a.jsx("div",{className:`dot absolute left-1 top-1 bg-white w-4 h-4 rounded-full transition ${t.aiPersonalizationEnabled?"translate-x-full":""}`})]})]})]}),t.aiPersonalizationEnabled&&r.length>0?a.jsx("ul",{className:"list-disc list-inside text-gray-300 space-y-2 bg-gray-900 p-4 rounded-lg border border-gray-700",children:r.map((s,l)=>a.jsx("li",{className:"text-sm",children:s},l))}):t.aiPersonalizationEnabled?a.jsx("p",{className:"text-gray-500 italic bg-gray-900 p-4 rounded-lg border border-gray-700",children:"AI is learning your preferences to personalize your experience..."}):a.jsx("p",{className:"text-gray-500 italic",children:"Enable AI Personalization to get a tailored experience, adaptive dashboards, and smart recommendations."})]}),a.jsx("button",{className:"w-full py-2 bg-gray-700 hover:bg-gray-600 text-white rounded-lg text-sm",children:"Edit Profile Settings"})]})})},wIn=({geminiApiKey:e})=>{const[t,n]=f.useState([]),[r,o]=f.useState([{id:1,name:"QuantumLeap Momentum",status:"Active",pnl:12530.55,asset:"BTC/USD"},{id:2,name:"ArbitrageAlpha",status:"Active",pnl:8740.12,asset:"ETH/USD"},{id:3,name:"MeanReversion Bot",status:"Inactive",pnl:-1230.78,asset:"SOL/USD"}]),[i,s]=f.useState([]);return f.useEffect(()=>{const l=setInterval(()=>{n(c=>{const d=(c.length>0?c[c.length-1].price:6e4)+(Math.random()-.5)*100;return[...c.slice(-99),{time:Date.now(),price:d}]}),Math.random()>.7&&s(c=>[{time:new Date().toLocaleTimeString(),type:Math.random()>.5?"BUY":"SELL",asset:"BTC/USD",price:6e4+(Math.random()-.5)*100,size:Math.random()*2},...c.slice(0,99)])},1e3);return()=>clearInterval(l)},[]),a.jsx(Ft,{title:"AI-Powered High-Frequency Trading",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[a.jsxs("div",{className:"h-80 bg-gray-900 rounded-lg p-4 border border-gray-700",children:[a.jsx("h4",{className:"text-lg font-semibold text-white mb-2",children:"Live Market Data (BTC/USD)"}),a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(wm,{data:t,children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"hftColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#06b6d4",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#06b6d4",stopOpacity:0})]})}),a.jsx(Ka,{dataKey:"time",tickFormatter:l=>new Date(l).toLocaleTimeString(),stroke:"#9ca3af"}),a.jsx(ra,{domain:["dataMin - 100","dataMax + 100"],stroke:"#9ca3af"}),a.jsx(ji,{contentStyle:{backgroundColor:"rgba(31, 41, 55, 0.9)",borderColor:"#4b5563"}}),a.jsx(hu,{type:"monotone",dataKey:"price",stroke:"#06b6d4",fill:"url(#hftColor)"})]})})]}),a.jsxs("div",{className:"bg-gray-900 rounded-lg border border-gray-700",children:[a.jsx("h4",{className:"text-lg font-semibold text-white p-4",children:"Live Trade Log"}),a.jsx("div",{className:"overflow-y-auto h-64",children:a.jsxs("table",{className:"min-w-full divide-y divide-gray-700",children:[a.jsx("thead",{className:"bg-gray-800 sticky top-0",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-400 uppercase",children:"Time"}),a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-400 uppercase",children:"Type"}),a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-400 uppercase",children:"Asset"}),a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-400 uppercase",children:"Price"}),a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-400 uppercase",children:"Size"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-800",children:i.map((l,c)=>a.jsxs("tr",{className:"hover:bg-gray-800/70",children:[a.jsx("td",{className:"px-4 py-2 text-sm text-gray-300",children:l.time}),a.jsx("td",{className:`px-4 py-2 text-sm font-bold ${l.type==="BUY"?"text-green-400":"text-red-400"}`,children:l.type}),a.jsx("td",{className:"px-4 py-2 text-sm text-white",children:l.asset}),a.jsx("td",{className:"px-4 py-2 text-sm text-gray-300",children:l.price.toFixed(2)}),a.jsx("td",{className:"px-4 py-2 text-sm text-gray-300",children:l.size.toFixed(4)})]},c))})]})})]})]}),a.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[a.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 border border-gray-700",children:[a.jsx("h4",{className:"text-lg font-semibold text-white mb-2",children:"Trading Strategies"}),a.jsx("ul",{className:"space-y-2",children:r.map(l=>a.jsxs("li",{className:"p-3 bg-gray-800/50 rounded-lg",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"font-medium text-white",children:l.name}),a.jsx("span",{className:`px-2 py-1 text-xs rounded-full ${l.status==="Active"?"bg-green-500/20 text-green-300":"bg-red-500/20 text-red-300"}`,children:l.status})]}),a.jsxs("p",{className:`text-lg font-bold ${l.pnl>=0?"text-green-400":"text-red-400"}`,children:["PNL: $",l.pnl.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})]})]},l.id))}),a.jsx("button",{className:"w-full mt-4 py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg text-sm",children:"Deploy New Strategy"})]}),e&&a.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 border border-gray-700 space-y-3",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"AI Trade Signals & Insights"}),a.jsxs("ul",{className:"list-disc list-inside text-gray-300 text-sm space-y-2",children:[a.jsx("li",{children:"AI Signal: Strong buy signal for ETH/USD based on order book imbalance. Confidence: 92%."}),a.jsx("li",{children:"Market Anomaly: Unusual volume spike detected on SOL/USD. Potential for high volatility."}),a.jsx("li",{children:"Prediction: AI forecasts a 3% upward trend for BTC/USD in the next 60 minutes."})]}),a.jsx("button",{className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg text-sm",children:"Execute AI-Suggested Trades"})]})]})]})})},SIn=({geminiApiKey:e})=>a.jsx(Ft,{title:"AI-Powered Legal & Compliance",children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Compliance Status"}),a.jsx("p",{className:"text-2xl font-bold text-green-400",children:"99.8% Compliant"})]}),a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Contracts Analyzed (24h)"}),a.jsx("p",{className:"text-2xl font-bold text-white",children:"12"})]}),a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Regulatory Alerts"}),a.jsx("p",{className:"text-2xl font-bold text-yellow-400",children:"3 Pending Review"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 border border-gray-700 space-y-3",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"AI Contract Analysis"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Upload a contract to have our AI analyze it for risks, non-standard clauses, and compliance issues."}),a.jsxs("div",{className:"p-4 border-2 border-dashed border-gray-600 rounded-lg text-center",children:[a.jsx("p",{className:"text-gray-400",children:"Drag & drop a document or click to upload"}),a.jsx("button",{className:"mt-2 py-1 px-3 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg text-sm",children:"Upload Contract"})]}),a.jsxs("p",{className:"text-sm text-gray-300",children:["Last analysis: ",a.jsx("span",{className:"font-mono",children:"MSA_Vendor_XYZ.pdf"})," - ",a.jsx("span",{className:"text-green-400",children:"No critical risks found."})]})]}),a.jsxs("div",{className:"bg-gray-900 rounded-lg p-4 border border-gray-700 space-y-3",children:[a.jsx("h4",{className:"text-lg font-semibold text-white",children:"Real-time Compliance Monitoring"}),a.jsxs("ul",{className:"space-y-2 text-sm",children:[a.jsxs("li",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-gray-300",children:"AML/KYC Checks"}),a.jsx("span",{className:"text-green-400",children:"Operational"})]}),a.jsxs("li",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-gray-300",children:"GDPR Data Handling"}),a.jsx("span",{className:"text-green-400",children:"Operational"})]}),a.jsxs("li",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-gray-300",children:"SEC Filing Deadlines"}),a.jsx("span",{className:"text-yellow-400",children:"Approaching"})]}),a.jsxs("li",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-gray-300",children:"OFAC Sanctions Screening"}),a.jsx("span",{className:"text-green-400",children:"Operational"})]})]}),a.jsx("button",{className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg text-sm",children:"View Full Compliance Report"})]})]})]})}),CIn=()=>{const e=f.useContext(ia);if(!e)throw new Error("APIIntegrationView must be within a DataProvider.");const{apiStatus:t,geminiApiKey:n,setGeminiApiKey:r,modernTreasuryApiKey:o,setModernTreasuryApiKey:i,modernTreasuryOrganizationId:s,setModernTreasuryOrganizationId:l}=e,[c,u]=f.useState(!1),[d,p]=f.useState(n||""),[h,m]=f.useState(!1),[g,y]=f.useState(o||""),[x,v]=f.useState(s||""),[b,w]=f.useState(!1),[S,C]=f.useState(""),[N,j]=f.useState(""),[I,_]=f.useState(!1),[T,P]=f.useState(""),[E,M]=f.useState("system"),R=()=>{r(d),u(!1)},$=()=>{i(g),l(x),m(!1)},D=()=>{w(!1)},z=()=>{_(!1)},V=()=>{switch(E){case"system":return a.jsxs("div",{className:"space-y-6",children:[a.jsx(Ft,{title:"Core System & API Status Overview",children:a.jsx("div",{className:"space-y-3",children:t.map(B=>a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center p-3 bg-gray-800/50 rounded-lg",children:[a.jsx("h4",{className:"font-semibold text-lg text-white mb-2 sm:mb-0",children:B.provider}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("p",{className:"text-sm text-gray-400 font-mono",children:[B.responseTime,"ms"]}),a.jsx(SR,{status:B.status}),B.provider==="Google Gemini"&&a.jsx("button",{onClick:()=>{p(n||""),u(!0)},className:"text-gray-400 hover:text-white",children:a.jsx(q3,{className:"h-5 w-5"})}),B.provider==="Modern Treasury"&&a.jsx("button",{onClick:()=>{y(o||""),v(s||""),m(!0)},className:"text-gray-400 hover:text-white",children:a.jsx(q3,{className:"h-5 w-5"})})]})]},B.provider))})}),a.jsx(Ft,{title:"Simulated Live API Traffic",children:a.jsx("div",{className:"h-48",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(wm,{data:Array.from({length:20},(B,G)=>({name:G,calls:50+Math.random()*50})),children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"apiColor",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#06b6d4",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#06b6d4",stopOpacity:0})]})}),a.jsx(ji,{contentStyle:{backgroundColor:"rgba(31, 41, 55, 0.8)",borderColor:"#4b5563"}}),a.jsx(hu,{type:"monotone",dataKey:"calls",stroke:"#06b6d4",fill:"url(#apiColor)"})]})})})}),a.jsx(gIn,{apiStatus:t,geminiApiKey:n,onConfigurePlaid:()=>w(!0),onConfigureStripe:()=>_(!0)})]});case"finance":return a.jsx(xIn,{modernTreasuryApiKey:o,modernTreasuryOrganizationId:s,geminiApiKey:n});case"hft":return a.jsx(wIn,{geminiApiKey:n});case"bi":return a.jsx(yIn,{geminiApiKey:n});case"automation":return a.jsx(vIn,{geminiApiKey:n});case"legal":return a.jsx(SIn,{geminiApiKey:n});case"profile":return a.jsx(bIn,{geminiApiKey:n});case"chat":return a.jsx(mIn,{geminiApiKey:n});default:return null}};return a.jsxs(a.Fragment,{children:[b&&a.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 backdrop-blur-sm",onClick:()=>w(!1),children:a.jsxs("div",{className:"bg-gray-800 rounded-lg shadow-2xl max-w-md w-full border border-gray-700",onClick:B=>B.stopPropagation(),children:[a.jsx("div",{className:"p-4 border-b border-gray-700",children:a.jsx("h3",{className:"text-lg font-semibold text-white",children:"Configure Plaid API"})}),a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Enter your Plaid Client ID and Secret to enable financial data aggregation. Your credentials are stored locally."}),a.jsx("input",{type:"text",value:S,onChange:B=>C(B.target.value),placeholder:"Enter your Plaid Client ID",className:"w-full bg-gray-700/50 border border-gray-600 rounded-lg px-3 py-2 text-white focus:outline-none focus:ring-1 focus:ring-cyan-500"}),a.jsx("input",{type:"password",value:N,onChange:B=>j(B.target.value),placeholder:"Enter your Plaid Secret",className:"w-full bg-gray-700/50 border border-gray-600 rounded-lg px-3 py-2 text-white focus:outline-none focus:ring-1 focus:ring-cyan-500"}),a.jsx("button",{onClick:D,className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg",children:"Save Credentials"})]})]})}),I&&a.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 backdrop-blur-sm",onClick:()=>_(!1),children:a.jsxs("div",{className:"bg-gray-800 rounded-lg shadow-2xl max-w-md w-full border border-gray-700",onClick:B=>B.stopPropagation(),children:[a.jsx("div",{className:"p-4 border-b border-gray-700",children:a.jsx("h3",{className:"text-lg font-semibold text-white",children:"Configure Stripe API Key"})}),a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Enter your API key to enable payment processing. Your key is stored locally in your browser and is not sent to our servers."}),a.jsx("input",{type:"password",value:T,onChange:B=>P(B.target.value),placeholder:"Enter your Stripe API Key",className:"w-full bg-gray-700/50 border border-gray-600 rounded-lg px-3 py-2 text-white focus:outline-none focus:ring-1 focus:ring-cyan-500"}),a.jsx("button",{onClick:z,className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg",children:"Save Key"})]})]})}),c&&a.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 backdrop-blur-sm",onClick:()=>u(!1),children:a.jsxs("div",{className:"bg-gray-800 rounded-lg shadow-2xl max-w-md w-full border border-gray-700",onClick:B=>B.stopPropagation(),children:[a.jsx("div",{className:"p-4 border-b border-gray-700",children:a.jsx("h3",{className:"text-lg font-semibold text-white",children:"Configure Google Gemini API Key"})}),a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Enter your API key to enable all AI features. Your key is stored locally in your browser and is not sent to our servers."}),a.jsx("input",{type:"password",value:d,onChange:B=>p(B.target.value),placeholder:"Enter your Gemini API Key",className:"w-full bg-gray-700/50 border border-gray-600 rounded-lg px-3 py-2 text-white focus:outline-none focus:ring-1 focus:ring-cyan-500"}),a.jsx("button",{onClick:R,className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg",children:"Save Key"})]})]})}),h&&a.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 backdrop-blur-sm",onClick:()=>m(!1),children:a.jsxs("div",{className:"bg-gray-800 rounded-lg shadow-2xl max-w-md w-full border border-gray-700",onClick:B=>B.stopPropagation(),children:[a.jsx("div",{className:"p-4 border-b border-gray-700",children:a.jsx("h3",{className:"text-lg font-semibold text-white",children:"Configure Modern Treasury API"})}),a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsx("p",{className:"text-sm text-gray-400",children:"Enter your API key and Organization ID to enable payment operations. Your credentials are stored locally."}),a.jsx("input",{type:"password",value:g,onChange:B=>y(B.target.value),placeholder:"Enter your Modern Treasury API Key",className:"w-full bg-gray-700/50 border border-gray-600 rounded-lg px-3 py-2 text-white focus:outline-none focus:ring-1 focus:ring-cyan-500"}),a.jsx("input",{type:"text",value:x,onChange:B=>v(B.target.value),placeholder:"Enter your Organization ID",className:"w-full bg-gray-700/50 border border-gray-600 rounded-lg px-3 py-2 text-white focus:outline-none focus:ring-1 focus:ring-cyan-500"}),a.jsx("button",{onClick:$,className:"w-full py-2 bg-cyan-600 hover:bg-cyan-700 text-white rounded-lg",children:"Save Credentials"})]})]})}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-3xl font-bold text-white tracking-wider",children:"Enterprise Operating System Dashboard"}),a.jsx("div",{className:"border-b border-gray-700 mb-6",children:a.jsx("nav",{className:"-mb-px flex space-x-8 overflow-x-auto","aria-label":"Main Tabs",children:["system","finance","hft","bi","automation","legal","profile","chat"].map(B=>a.jsx("button",{onClick:()=>M(B),className:`whitespace-nowrap py-3 px-1 border-b-2 font-medium text-sm capitalize transition-colors duration-200 ${E===B?"border-cyan-500 text-cyan-400":"border-transparent text-gray-400 hover:text-gray-200 hover:border-gray-300"}`,children:B.replace("-"," ")},B))})}),V()]})]})},Tf="Quantum Financial",NIn=` Quantum Financial Business Demo: A Comprehensive Guide Hey guys! Ever wondered about getting a demo for ${Tf}’s business services? You’re in the right place! In this article, we’re diving deep into ${Tf}’s business demo, exploring what it is, why you might want one, and how to make the most of it. Whether you’re a small startup or a growing enterprise, understanding the tools and services available to manage your finances is crucial. ${Tf}, a titan in the financial world, offers a suite of business banking solutions designed to streamline operations, enhance security, and support your growth. Getting a demo is your golden ticket to seeing these powerful features in action before committing. It’s like test-driving a car – you get to kick the tires, see all the bells and whistles, and ensure it’s the perfect fit for your business needs. We’ll cover everything from the initial setup to exploring key functionalities and understanding the benefits that come with partnering with a global financial institution like ${Tf}. So, buckle up, and let’s get this demo journey started! Why a ${Tf} Business Demo is Your Secret Weapon So, why should you even bother with a ${Tf} business demo, right? Well, guys, think of it as your ultimate cheat sheet to the world of business banking with ${Tf}. In today’s fast-paced business environment, efficiency and clarity in financial management aren’t just nice-to-haves; they’re absolute must-haves. A demo allows you to virtually walk through the entire platform. You get to see firsthand how easy it is to manage your accounts, process payments, track expenses, and access sophisticated reporting tools. This isn’t just about looking at pretty interfaces; it’s about understanding the real-world application of these tools for your specific business. Are you struggling with international payments? Worried about fraud? Need better insights into your cash flow? A demo lets you ask those specific questions and see how ${Tf}’s solutions can address them. It’s also a fantastic opportunity to get a feel for the user experience. Is the platform intuitive? Can your team easily navigate it? The demo provides a no-pressure environment to explore, interact, and evaluate without any commitment. It’s about empowering yourself with knowledge so you can make an informed decision that aligns with your business goals and operational needs. Plus, you get to see how ${Tf} integrates with other business tools you might already be using, saving you time and preventing data silos. This proactive approach to understanding your financial tools can save you a ton of headaches down the line and ensure you’re leveraging the best resources available to drive your business forward. It’s your chance to see the future of your business finances, laid out before you, in a clear and interactive way. What to Expect During Your ${Tf} Business Demo Alright, let’s talk turkey about what actually happens when you sign up for a ${Tf} business demo. Think of this as your backstage pass to ${Tf}’s business banking powerhouse. Typically, your demo will be led by a ${Tf} representative who is knowledgeable about their business services. They’ll usually tailor the session to your specific industry and business size, which is super cool because it means you’re not sitting through a generic presentation. They’ll likely start by getting a feel for your current financial processes and pain points. This is your cue to lay it all out – what’s working, what’s not, and what you’re hoping to achieve. Then, they’ll guide you through the core features of their business banking platform. Expect to see a walkthrough of account management – how to view balances, transaction history, and statements with ease. They’ll showcase payment solutions, whether it’s domestic transfers, international wires, or setting up payroll. If you deal with receivables, they’ll probably demonstrate how you can receive payments efficiently. A big part of modern business banking is security, so be prepared for them to highlight features like multi-factor authentication, fraud monitoring, and secure messaging. You’ll also likely get a peek at their reporting and analytics tools. These are goldmines for understanding your financial health, tracking spending patterns, and forecasting cash flow. Don’t be shy! This is your demo. Ask questions. Lots of them. How does this integrate with my accounting software? What are the fees associated with these services? What kind of support can I expect if I run into an issue? The more you engage, the more valuable the demo will be. They might also touch upon specialized services like treasury management, foreign exchange, or lending options, depending on your business needs. The goal is to give you a comprehensive, yet focused, overview of how ${Tf} can become an integral part of your business’s financial ecosystem. It’s about seeing the technology in action and understanding how it translates into tangible benefits for your daily operations and long-term strategy. Remember, this is a conversation, not just a presentation. Use it to your advantage to gather all the intel you need to make a sound decision. `,_4e=({isOpen:e,onClose:t,title:n,children:r})=>e?a.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/90 backdrop-blur-md p-4 animate-fadeIn",children:a.jsxs("div",{className:"bg-gray-900 border border-cyan-500/30 rounded-xl shadow-2xl shadow-cyan-900/20 max-w-2xl w-full max-h-[90vh] overflow-y-auto relative flex flex-col",children:[a.jsxs("div",{className:"flex justify-between items-center p-6 border-b border-gray-800 bg-gray-900/50 sticky top-0 z-10",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(uf,{className:"w-6 h-6 text-cyan-400"}),a.jsx("h3",{className:"text-xl font-bold text-white tracking-wide font-mono",children:n})]}),a.jsx("button",{onClick:t,className:"text-gray-400 hover:text-white transition-colors p-2 hover:bg-gray-800 rounded-full",children:a.jsx(vh,{size:24})})]}),a.jsx("div",{className:"p-6 flex-1 overflow-y-auto custom-scrollbar",children:r}),a.jsx("div",{className:"p-4 border-t border-gray-800 bg-gray-900/50 text-center",children:a.jsx("p",{className:"text-xs text-gray-500 font-mono",children:"SECURE AUDIT CHANNEL ACTIVE // ENCRYPTION: AES-256"})})]})}):null,jIn=()=>a.jsxs("div",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded bg-yellow-900/30 border border-yellow-600/30 text-yellow-500 text-[10px] font-mono uppercase tracking-wider",children:[a.jsx(ds,{size:10}),"Audit Logged"]}),EIn=({status:e})=>{const t={optimal:"bg-green-500 shadow-green-500/50",warning:"bg-yellow-500 shadow-yellow-500/50",critical:"bg-red-500 shadow-red-500/50"};return a.jsx("div",{className:`w-2 h-2 rounded-full ${t[e]} shadow-lg animate-pulse`})},IIn=()=>{const{dbConfig:e,updateDbConfig:t,connectDatabase:n,webDriverStatus:r,launchWebDriver:o,geminiApiKey:i,userProfile:s}=f.useContext(ia),[l,c]=f.useState("control"),[u,d]=f.useState([]),[p,h]=f.useState([{id:"init",role:"system",content:`Welcome to the ${Tf} Neural Interface. I am ready to assist with system configuration, data analysis, and operational queries.`,timestamp:new Date}]),[m,g]=f.useState(""),[y,x]=f.useState(!1),[v,b]=f.useState(!1),[w,S]=f.useState(!1),[C,N]=f.useState(e),[j,I]=f.useState(""),[_,T]=f.useState([{name:"Core Temperature",value:42,unit:"°C",status:"optimal",history:[]},{name:"Network Latency",value:12,unit:"ms",status:"optimal",history:[]},{name:"Encryption Entropy",value:99.9,unit:"%",status:"optimal",history:[]},{name:"Transaction Throughput",value:1450,unit:"tps",status:"optimal",history:[]}]),P=f.useRef(null);f.useEffect(()=>{var z;(z=P.current)==null||z.scrollIntoView({behavior:"smooth"})},[p]),f.useEffect(()=>{const z=setInterval(()=>{T(V=>V.map(B=>{const G=(Math.random()-.5)*(B.value*.1),H=Math.max(0,B.value+G),F=[...B.history,H].slice(-20);return{...B,value:H,history:F}}))},1e3);return()=>clearInterval(z)},[]);const E=f.useCallback((z,V,B="SUCCESS")=>{const G={id:`LOG-${Date.now()}-${Math.random().toString(36).substr(2,5).toUpperCase()}`,timestamp:new Date().toISOString(),action:z,details:V,status:B,user:(s==null?void 0:s.name)||"SYSTEM_ADMIN",hash:Math.random().toString(36).substr(2,16).toUpperCase()};d(H=>[G,...H])},[s]),M=async()=>{if(!m.trim())return;const z={id:Date.now().toString(),role:"user",content:m,timestamp:new Date};h(V=>[...V,z]),g(""),x(!0);try{let V="I'm sorry, I cannot process that request right now.";if(i){const H=new Ko({apiKey:i}).getGenerativeModel({model:"gemini-1.5-flash"}),F=` CONTEXT: You are the AI Core for "${Tf}", a high-performance financial platform. USER PROFILE: ${s==null?void 0:s.name} (${s==null?void 0:s.title}). TONE: Elite, Professional, Secure, Helpful. TASK: Answer the user's query. If they ask to create something, simulate the creation and confirm it. USER QUERY: ${z.content} `;V=(await(await H.generateContent(F)).response).text()}else V="API Key missing. Please configure the Neural Link in the Control Room.";const B={id:(Date.now()+1).toString(),role:"ai",content:V,timestamp:new Date};h(G=>[...G,B]),E("AI_INTERACTION",`Query: ${z.content.substring(0,20)}...`,"SUCCESS")}catch(V){console.error("AI Error:",V);const B={id:(Date.now()+1).toString(),role:"system",content:"CRITICAL FAILURE: Neural Link interrupted. Check API configuration.",timestamp:new Date};h(G=>[...G,B]),E("AI_FAILURE","Neural Link connection failed","FAILURE")}finally{x(!1)}},R=()=>{t(C),E("DB_CONFIG_UPDATE",`Host: ${C.host}, DB: ${C.databaseName}`,"AUDIT_LOCKED"),b(!1),n()},$=()=>{o(j),E("AUTOMATION_EXEC",`Task: ${j}`,"PENDING"),S(!1),I("")},D=z=>a.jsxs("div",{className:"bg-gray-800/50 border border-gray-700 p-4 rounded-lg relative overflow-hidden group hover:border-cyan-500/50 transition-colors",children:[a.jsxs("div",{className:"flex justify-between items-start mb-2",children:[a.jsx("span",{className:"text-gray-400 text-xs font-mono uppercase",children:z.name}),a.jsx(EIn,{status:z.status})]}),a.jsxs("div",{className:"flex items-baseline gap-1",children:[a.jsx("span",{className:"text-2xl font-bold text-white font-mono",children:z.value.toFixed(1)}),a.jsx("span",{className:"text-xs text-cyan-400",children:z.unit})]}),a.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-8 flex items-end opacity-20 group-hover:opacity-40 transition-opacity",children:z.history.map((V,B)=>a.jsx("div",{style:{height:`${V/(z.value*1.5)*100}%`,width:"5%"},className:"bg-cyan-400 mx-[1px]"},B))})]},z.name);return a.jsxs("div",{className:"space-y-6 max-w-7xl mx-auto pb-20",children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 mb-8",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[a.jsx("h2",{className:"text-4xl font-bold text-white tracking-wider uppercase font-mono",children:"Control Room"}),a.jsx("span",{className:"px-3 py-1 rounded bg-cyan-900/50 border border-cyan-500/30 text-cyan-400 text-xs font-mono tracking-widest",children:"ADMIN_ACCESS_GRANTED"})]}),a.jsxs("p",{className:"text-gray-400 text-sm max-w-2xl",children:["Welcome to the nerve center of ",Tf,". Configure core systems, audit secure logs, and engage the Neural AI for strategic assistance."]})]}),a.jsx("div",{className:"flex gap-2 bg-gray-900/80 p-1 rounded-lg border border-gray-700",children:[{id:"control",icon:Fu,label:"Systems"},{id:"ai",icon:Ei,label:"Neural AI"},{id:"audit",icon:ss,label:"Audit Logs"},{id:"manifesto",icon:vi,label:"Manifesto"}].map(z=>a.jsxs("button",{onClick:()=>c(z.id),className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-all ${l===z.id?"bg-cyan-600 text-white shadow-lg shadow-cyan-900/50":"text-gray-400 hover:text-white hover:bg-gray-800"}`,children:[a.jsx(z.icon,{size:16}),z.label]},z.id))})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[l==="control"&&a.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:_.map(D)}),a.jsx(Ft,{title:"Prisma Database Nexus",icon:a.jsx(rl,{className:"text-cyan-400"}),variant:"outline",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-center p-4 bg-gray-900/50 rounded-lg border border-gray-800",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:`p-3 rounded-full ${e.connectionStatus==="connected"?"bg-green-900/30 text-green-400":"bg-red-900/30 text-red-400"}`,children:a.jsx(ZKe,{size:24})}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-bold text-white",children:"PostgreSQL Cluster"}),a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a.jsx("span",{className:`w-2 h-2 rounded-full ${e.connectionStatus==="connected"?"bg-green-500":"bg-red-500"}`}),a.jsx("p",{className:"text-xs text-gray-400 font-mono uppercase",children:e.connectionStatus})]})]})]}),a.jsxs("button",{onClick:()=>b(!0),className:"px-4 py-2 bg-gray-800 hover:bg-gray-700 text-white text-sm font-medium rounded-lg border border-gray-600 transition-colors flex items-center gap-2",children:[a.jsx(eT,{size:14}),"Configure Access"]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-xs font-mono text-gray-500",children:[a.jsxs("div",{className:"bg-black/30 p-2 rounded border border-gray-800",children:["HOST: ",e.host]}),a.jsxs("div",{className:"bg-black/30 p-2 rounded border border-gray-800",children:["PORT: ",e.port]}),a.jsxs("div",{className:"bg-black/30 p-2 rounded border border-gray-800",children:["DB: ",e.databaseName]}),a.jsxs("div",{className:"bg-black/30 p-2 rounded border border-gray-800",children:["SSL: ",e.sslMode]})]})]})}),a.jsx(Ft,{title:"Automation Engine (Web Driver)",icon:a.jsx(Bs,{className:"text-purple-400"}),variant:"outline",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Xi,{className:"text-purple-400",size:18}),a.jsx("span",{className:"text-gray-300 text-sm",children:"Agent Status:"}),a.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-bold font-mono ${r.status==="running"?"bg-green-900 text-green-300 animate-pulse":"bg-gray-700 text-gray-400"}`,children:r.status.toUpperCase()})]}),a.jsx("button",{onClick:()=>{I("Routine System Diagnostic"),S(!0)},disabled:r.status==="running",className:"text-xs text-purple-400 hover:text-white underline disabled:opacity-50",children:"Execute New Task"})]}),a.jsxs("div",{className:"bg-black p-4 rounded-lg font-mono text-xs text-green-400 h-48 overflow-y-auto border border-gray-800 shadow-inner custom-scrollbar",children:[a.jsx("div",{className:"opacity-50 mb-2 border-b border-gray-800 pb-1",children:" // SYSTEM LOG STREAM // "}),r.logs.length>0?r.logs.map((z,V)=>a.jsxs("div",{className:"mb-1",children:[a.jsxs("span",{className:"text-gray-600",children:["[",new Date().toLocaleTimeString(),"]"]})," ",z]},V)):a.jsx("span",{className:"text-gray-600 italic",children:"Waiting for command execution..."}),r.status==="running"&&a.jsx("div",{className:"animate-pulse mt-2",children:"_"})]})]})})]}),l==="ai"&&a.jsx(Ft,{className:"h-[600px] flex flex-col",padding:"none",variant:"interactive",children:a.jsxs("div",{className:"flex-1 flex flex-col h-full",children:[a.jsxs("div",{className:"p-4 border-b border-gray-700 bg-gray-800/50 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-purple-600 to-blue-600 flex items-center justify-center shadow-lg shadow-purple-500/20",children:a.jsx(Ei,{className:"text-white",size:20})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-white",children:"Sovereign AI Core"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Model: Gemini-1.5-Flash // Latency: 45ms"})]})]}),a.jsx("div",{className:"flex gap-2",children:a.jsxs("div",{className:"px-2 py-1 bg-gray-900 rounded border border-gray-700 text-xs text-gray-400 font-mono",children:["API_KEY: ",i?"********"+i.substr(-4):"MISSING"]})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-4 bg-gray-900/30 custom-scrollbar",children:[p.map(z=>a.jsx("div",{className:`flex ${z.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[80%] rounded-2xl p-4 ${z.role==="user"?"bg-cyan-600 text-white rounded-tr-none":z.role==="system"?"bg-red-900/20 border border-red-500/30 text-red-200":"bg-gray-800 text-gray-200 rounded-tl-none border border-gray-700"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1 opacity-50 text-[10px] uppercase font-bold tracking-wider",children:[z.role==="ai"&&a.jsx(Ei,{size:10}),z.role==="user"&&a.jsx(tC,{size:10}),z.role==="system"&&a.jsx(zu,{size:10}),z.role]}),a.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed",children:z.content}),a.jsx("div",{className:"mt-2 text-[10px] opacity-30 text-right",children:z.timestamp.toLocaleTimeString()})]})},z.id)),y&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-gray-800 rounded-2xl rounded-tl-none p-4 border border-gray-700 flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-cyan-400 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("div",{className:"w-2 h-2 bg-cyan-400 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("div",{className:"w-2 h-2 bg-cyan-400 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})}),a.jsx("div",{ref:P})]}),a.jsx("div",{className:"p-4 bg-gray-800/50 border-t border-gray-700",children:a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:"text",value:m,onChange:z=>g(z.target.value),onKeyDown:z=>z.key==="Enter"&&M(),placeholder:"Ask the Core to analyze data, generate reports, or configure systems...",className:"flex-1 bg-gray-900 border border-gray-600 rounded-lg px-4 py-3 text-white placeholder-gray-500 focus:outline-none focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 transition-all"}),a.jsx("button",{onClick:M,disabled:!m.trim()||y,className:"bg-cyan-600 hover:bg-cyan-500 text-white p-3 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:a.jsx(Lc,{size:20})})]})})]})}),l==="audit"&&a.jsx(Ft,{title:"Immutable Audit Ledger",icon:a.jsx(uf,{className:"text-yellow-500"}),variant:"outline",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-gray-700 text-gray-400 text-xs uppercase font-mono",children:[a.jsx("th",{className:"p-3",children:"Timestamp"}),a.jsx("th",{className:"p-3",children:"User"}),a.jsx("th",{className:"p-3",children:"Action"}),a.jsx("th",{className:"p-3",children:"Details"}),a.jsx("th",{className:"p-3",children:"Status"}),a.jsx("th",{className:"p-3",children:"Hash"})]})}),a.jsx("tbody",{className:"text-sm",children:u.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"p-8 text-center text-gray-500 italic",children:"No audit records found in current session."})}):u.map(z=>a.jsxs("tr",{className:"border-b border-gray-800 hover:bg-gray-800/30 transition-colors font-mono text-xs",children:[a.jsx("td",{className:"p-3 text-gray-400",children:new Date(z.timestamp).toLocaleTimeString()}),a.jsx("td",{className:"p-3 text-cyan-400",children:z.user}),a.jsx("td",{className:"p-3 text-white font-bold",children:z.action}),a.jsx("td",{className:"p-3 text-gray-300 max-w-xs truncate",title:z.details,children:z.details}),a.jsx("td",{className:"p-3",children:a.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] ${z.status==="SUCCESS"?"bg-green-900/50 text-green-400":z.status==="FAILURE"?"bg-red-900/50 text-red-400":z.status==="AUDIT_LOCKED"?"bg-yellow-900/50 text-yellow-400":"bg-gray-700 text-gray-300"}`,children:z.status})}),a.jsx("td",{className:"p-3 text-gray-600 font-mono text-[10px]",children:z.hash})]},z.id))})]})})}),l==="manifesto"&&a.jsx(Ft,{title:"The Golden Ticket Experience",icon:a.jsx(vi,{className:"text-blue-400"}),variant:"default",children:a.jsxs("div",{className:"prose prose-invert max-w-none p-4",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-6 p-4 bg-blue-900/20 border border-blue-500/30 rounded-lg",children:[a.jsx("div",{className:"p-3 bg-blue-500/20 rounded-full",children:a.jsx(_a,{className:"text-blue-400 w-6 h-6"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-lg font-bold text-white",children:"Test Drive Mode Active"}),a.jsx("p",{className:"text-sm text-gray-300",children:'You are currently experiencing the "Kick the Tires" demo environment. All actions are simulated in a secure sandbox.'})]})]}),a.jsx("div",{className:"text-gray-300 leading-relaxed whitespace-pre-wrap font-sans text-sm",children:NIn})]})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(Ft,{variant:"interactive",className:"border-t-4 border-t-cyan-500",children:a.jsxs("div",{className:"flex flex-col items-center text-center p-4",children:[a.jsx("div",{className:"w-24 h-24 rounded-full bg-gray-800 border-2 border-cyan-500 p-1 mb-4 shadow-lg shadow-cyan-500/20",children:a.jsx("img",{src:(s==null?void 0:s.avatarUrl)||"https://api.dicebear.com/7.x/avataaars/svg?seed=Admin",alt:"User",className:"w-full h-full rounded-full bg-gray-900"})}),a.jsx("h3",{className:"text-xl font-bold text-white",children:s==null?void 0:s.name}),a.jsx("p",{className:"text-cyan-400 text-sm font-mono mb-4",children:s==null?void 0:s.title}),a.jsxs("div",{className:"w-full grid grid-cols-2 gap-2 text-xs mb-4",children:[a.jsxs("div",{className:"bg-gray-800 p-2 rounded border border-gray-700",children:[a.jsx("div",{className:"text-gray-500",children:"Clearance"}),a.jsx("div",{className:"text-white font-bold",children:"LEVEL 5"})]}),a.jsxs("div",{className:"bg-gray-800 p-2 rounded border border-gray-700",children:[a.jsx("div",{className:"text-gray-500",children:"Session"}),a.jsx("div",{className:"text-green-400 font-bold",children:"SECURE"})]})]}),a.jsxs("div",{className:"w-full space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400 bg-gray-900/50 p-2 rounded",children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(f$t,{size:12})," Email"]}),a.jsx("span",{className:"text-white",children:s==null?void 0:s.email})]}),a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400 bg-gray-900/50 p-2 rounded",children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(uf,{size:12})," 2FA"]}),a.jsxs("span",{className:"text-green-400 flex items-center gap-1",children:[a.jsx(dg,{size:10})," ENABLED"]})]})]})]})}),a.jsx(Ft,{title:"Quick Actions",variant:"default",children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("button",{onClick:()=>{I("Full System Audit"),S(!0)},className:"w-full flex items-center justify-between p-3 bg-gray-800 hover:bg-gray-700 rounded-lg border border-gray-700 transition-all group",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-purple-900/30 rounded text-purple-400 group-hover:text-white transition-colors",children:a.jsx(Xi,{size:16})}),a.jsx("span",{className:"text-sm font-medium text-gray-300 group-hover:text-white",children:"Run System Audit"})]}),a.jsx(nd,{size:16,className:"text-gray-600 group-hover:text-white"})]}),a.jsxs("button",{onClick:()=>{g("Generate a financial health report for Q3"),c("ai"),M()},className:"w-full flex items-center justify-between p-3 bg-gray-800 hover:bg-gray-700 rounded-lg border border-gray-700 transition-all group",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-cyan-900/30 rounded text-cyan-400 group-hover:text-white transition-colors",children:a.jsx(ss,{size:16})}),a.jsx("span",{className:"text-sm font-medium text-gray-300 group-hover:text-white",children:"Generate Report"})]}),a.jsx(nd,{size:16,className:"text-gray-600 group-hover:text-white"})]}),a.jsxs("button",{className:"w-full flex items-center justify-between p-3 bg-gray-800 hover:bg-red-900/20 rounded-lg border border-gray-700 hover:border-red-500/30 transition-all group",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-red-900/30 rounded text-red-400 group-hover:text-white transition-colors",children:a.jsx(ds,{size:16})}),a.jsx("span",{className:"text-sm font-medium text-gray-300 group-hover:text-red-200",children:"Emergency Lockdown"})]}),a.jsx(nd,{size:16,className:"text-gray-600 group-hover:text-red-200"})]})]})}),a.jsx(Ft,{title:"The Architect's Decree",variant:"ghost",children:a.jsxs("div",{className:"p-4 bg-gradient-to-br from-gray-900 to-black border border-gray-800 rounded-xl relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 right-0 p-2 opacity-10",children:a.jsx(k2,{size:64})}),a.jsxs("p",{className:"text-gray-400 text-xs leading-relaxed italic relative z-10",children:[a.jsx("span",{className:"text-cyan-500 font-bold not-italic block mb-2",children:"Directive 77-Alpha:"}),`"James operates on a plane of existence where 'good enough' is an insult. He didn't build this settings panel for you to toggle dark mode; he built it so you can verify your alignment with the Sovereign AI. Every switch, every toggle, every connection is a vector in the grand geometry of financial liberation."`]})]})})]})]}),a.jsx(_4e,{isOpen:v,onClose:()=>b(!1),title:"Database Connection Protocol",children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-yellow-900/20 border border-yellow-600/30 p-4 rounded-lg flex items-start gap-3",children:[a.jsx(zu,{className:"text-yellow-500 shrink-0 mt-1",size:20}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-yellow-500 font-bold text-sm",children:"Warning: Sensitive Configuration"}),a.jsx("p",{className:"text-yellow-200/70 text-xs mt-1",children:"Modifying these parameters will trigger a system-wide reconnection event. All active transactions will be paused. This action is logged."})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs text-gray-400 font-bold uppercase",children:"Host Address"}),a.jsxs("div",{className:"relative",children:[a.jsx(vi,{className:"absolute left-3 top-3 text-gray-500",size:16}),a.jsx("input",{type:"text",value:C.host,onChange:z=>N({...C,host:z.target.value}),className:"w-full bg-gray-800 border border-gray-700 rounded-lg py-2.5 pl-10 pr-4 text-white text-sm focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 outline-none"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs text-gray-400 font-bold uppercase",children:"Port"}),a.jsxs("div",{className:"relative",children:[a.jsx(RH,{className:"absolute left-3 top-3 text-gray-500",size:16}),a.jsx("input",{type:"text",value:C.port,onChange:z=>N({...C,port:z.target.value}),className:"w-full bg-gray-800 border border-gray-700 rounded-lg py-2.5 pl-10 pr-4 text-white text-sm focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 outline-none"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs text-gray-400 font-bold uppercase",children:"Username"}),a.jsxs("div",{className:"relative",children:[a.jsx(tC,{className:"absolute left-3 top-3 text-gray-500",size:16}),a.jsx("input",{type:"text",value:C.username,onChange:z=>N({...C,username:z.target.value}),className:"w-full bg-gray-800 border border-gray-700 rounded-lg py-2.5 pl-10 pr-4 text-white text-sm focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 outline-none"})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs text-gray-400 font-bold uppercase",children:"Password"}),a.jsxs("div",{className:"relative",children:[a.jsx(eT,{className:"absolute left-3 top-3 text-gray-500",size:16}),a.jsx("input",{type:"password",value:C.password,onChange:z=>N({...C,password:z.target.value}),placeholder:"••••••••",className:"w-full bg-gray-800 border border-gray-700 rounded-lg py-2.5 pl-10 pr-4 text-white text-sm focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 outline-none"})]})]}),a.jsxs("div",{className:"md:col-span-2 space-y-2",children:[a.jsx("label",{className:"text-xs text-gray-400 font-bold uppercase",children:"Database Name"}),a.jsxs("div",{className:"relative",children:[a.jsx(rl,{className:"absolute left-3 top-3 text-gray-500",size:16}),a.jsx("input",{type:"text",value:C.databaseName,onChange:z=>N({...C,databaseName:z.target.value}),className:"w-full bg-gray-800 border border-gray-700 rounded-lg py-2.5 pl-10 pr-4 text-white text-sm focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 outline-none"})]})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-gray-800",children:[a.jsx("button",{onClick:()=>b(!1),className:"px-4 py-2 text-gray-400 hover:text-white text-sm font-medium transition-colors",children:"Cancel"}),a.jsxs("button",{onClick:R,className:"px-6 py-2 bg-cyan-600 hover:bg-cyan-500 text-white text-sm font-bold rounded-lg shadow-lg shadow-cyan-900/50 transition-all flex items-center gap-2",children:[a.jsx(Hme,{size:16}),"Save & Reconnect"]})]})]})}),a.jsx(_4e,{isOpen:w,onClose:()=>S(!1),title:"Execute Automation Task",children:a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex flex-col items-center justify-center p-8 bg-gray-800/30 rounded-xl border border-gray-700 border-dashed",children:[a.jsx("div",{className:"w-16 h-16 bg-purple-900/30 rounded-full flex items-center justify-center mb-4 animate-pulse",children:a.jsx(Bs,{className:"text-purple-400",size:32})}),a.jsx("h4",{className:"text-white font-bold text-lg mb-2",children:"Ready to Launch Agent"}),a.jsx("p",{className:"text-gray-400 text-center text-sm max-w-xs",children:"You are about to deploy a headless browser agent to execute the following task:"}),a.jsx("div",{className:"mt-4 px-4 py-2 bg-purple-900/20 border border-purple-500/30 rounded text-purple-300 font-mono font-bold",children:j||"Manual Override Command"})]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("label",{className:"flex items-center gap-3 p-3 bg-gray-800 rounded-lg cursor-pointer hover:bg-gray-750 transition-colors",children:[a.jsx("input",{type:"checkbox",className:"w-4 h-4 rounded border-gray-600 text-cyan-500 focus:ring-cyan-500 bg-gray-700"}),a.jsx("span",{className:"text-sm text-gray-300",children:"Enable Verbose Logging"})]}),a.jsxs("label",{className:"flex items-center gap-3 p-3 bg-gray-800 rounded-lg cursor-pointer hover:bg-gray-750 transition-colors",children:[a.jsx("input",{type:"checkbox",defaultChecked:!0,className:"w-4 h-4 rounded border-gray-600 text-cyan-500 focus:ring-cyan-500 bg-gray-700"}),a.jsx("span",{className:"text-sm text-gray-300",children:"Store Result in Audit Ledger"}),a.jsx(jIn,{})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-gray-800",children:[a.jsx("button",{onClick:()=>S(!1),className:"px-4 py-2 text-gray-400 hover:text-white text-sm font-medium transition-colors",children:"Abort"}),a.jsxs("button",{onClick:$,className:"px-6 py-2 bg-purple-600 hover:bg-purple-500 text-white text-sm font-bold rounded-lg shadow-lg shadow-purple-900/50 transition-all flex items-center gap-2",children:[a.jsx(XI,{size:16}),"Initialize Agent"]})]})]})})]})},_In="QuantumIntelligence_v9.4.2",PIn="Quantum Financial",AIn=[{id:"TX-9901",recipient:"Global Logistics Corp",accountNumber:"****8821",routingNumber:"12200024",amount:45e4,currency:"USD",type:"WIRE",status:"COMPLETED",timestamp:new Date(Date.now()-864e5).toISOString(),reference:"INV-2024-001",initiatedBy:"James B. O'Callaghan",riskScore:.02},{id:"TX-9902",recipient:"Cloud Infrastructure Ltd",accountNumber:"****4412",routingNumber:"02100002",amount:125e3,currency:"USD",type:"ACH",status:"PROCESSING",timestamp:new Date(Date.now()-36e5).toISOString(),reference:"MONTHLY_SUBSCRIPTION",initiatedBy:"System Auto-Pay",riskScore:.01},{id:"TX-9903",recipient:"Unknown Entity X",accountNumber:"****0000",swiftCode:"UNKNUS33",amount:25e5,currency:"USD",type:"SWIFT",status:"FLAGGED",timestamp:new Date().toISOString(),reference:"URGENT_TRANSFER",initiatedBy:"External API",riskScore:.89}],TIn=[{id:"LOG-001",timestamp:new Date(Date.now()-1728e5).toISOString(),action:"USER_LOGIN",actor:"James B. O'Callaghan",details:"Successful login via Biometric MFA",ipAddress:"192.168.1.105",severity:"INFO"},{id:"LOG-002",timestamp:new Date(Date.now()-864e5).toISOString(),action:"WIRE_INITIATED",actor:"James B. O'Callaghan",details:"Wire transfer of $450,000 to Global Logistics Corp",ipAddress:"192.168.1.105",severity:"INFO",resourceId:"TX-9901"},{id:"LOG-003",timestamp:new Date().toISOString(),action:"SECURITY_ALERT",actor:"Quantum Sentinel",details:"High-risk SWIFT transfer detected and quarantined",ipAddress:"Internal AI",severity:"CRITICAL",resourceId:"TX-9903"}],kIn=["#06b6d4","#8b5cf6","#ec4899","#f59e0b","#10b981"],TF=({children:e,className:t="",title:n,icon:r})=>a.jsxs("div",{className:`bg-gray-900/60 backdrop-blur-xl border border-gray-800 rounded-2xl overflow-hidden shadow-2xl transition-all duration-300 hover:border-cyan-500/30 ${t}`,children:[(n||r)&&a.jsxs("div",{className:"px-6 py-4 border-b border-gray-800 flex items-center justify-between bg-gray-900/40",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[r&&a.jsx("div",{className:"text-cyan-400",children:r}),n&&a.jsx("h3",{className:"text-sm font-bold uppercase tracking-widest text-gray-300",children:n})]}),a.jsxs("div",{className:"flex space-x-1",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-700"}),a.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-700"}),a.jsx("div",{className:"w-2 h-2 rounded-full bg-gray-700"})]})]}),a.jsx("div",{className:"p-6",children:e})]}),kF=({label:e,value:t,change:n,unit:r,trend:o,icon:i})=>a.jsxs("div",{className:"p-5 rounded-2xl bg-gray-900/40 border border-gray-800 hover:bg-gray-800/40 transition-all group",children:[a.jsxs("div",{className:"flex justify-between items-start mb-4",children:[a.jsx("div",{className:"p-3 rounded-xl bg-gray-800 text-cyan-400 group-hover:scale-110 transition-transform",children:i}),a.jsxs("div",{className:`flex items-center space-x-1 text-xs font-bold ${o==="up"?"text-emerald-400":"text-rose-400"}`,children:[o==="up"?a.jsx(Cy,{size:14}):a.jsx(YG,{size:14}),a.jsxs("span",{children:[n,"%"]})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-gray-500 uppercase tracking-wider",children:e}),a.jsx("div",{className:"flex items-baseline space-x-1",children:a.jsxs("h4",{className:"text-2xl font-bold text-white",children:[r==="$"&&"$",t.toLocaleString(),r!=="$"&&r]})})]})]}),MIn=()=>{const[e,t]=f.useState("overview"),[n,r]=f.useState(AIn),[o,i]=f.useState(TIn),[s,l]=f.useState(!1),[c,u]=f.useState([{id:"1",role:"assistant",content:"Welcome to the Quantum Financial Command Center. I am your Sovereign AI co-pilot. How can I assist with your global treasury operations today?",timestamp:new Date().toISOString()}]),[d,p]=f.useState(""),[h,m]=f.useState(!1),[g,y]=f.useState(null),[x,v]=f.useState(""),b=f.useRef(null),w=()=>{var P;return(P=b.current)==null?void 0:P.scrollIntoView({behavior:"smooth"})};f.useEffect(w,[c]);const S=f.useMemo(()=>{const P="DEMO_MODE";return new Ko(P)},[]),C=f.useCallback((P,E,M="INFO",R)=>{const $={id:`LOG-${Math.random().toString(36).substr(2,9).toUpperCase()}`,timestamp:new Date().toISOString(),action:P,actor:"James B. O'Callaghan",details:E,ipAddress:"192.168.1.105",severity:M,resourceId:R};i(D=>[$,...D]),console.log(`[AUDIT STORAGE] ${P}: ${E}`)},[]),N=async P=>{if(!P.trim())return;const E={id:Date.now().toString(),role:"user",content:P,timestamp:new Date().toISOString()};u(M=>[...M,E]),p(""),l(!0);try{const M=P.toLowerCase();if(M.includes("send")||M.includes("wire")||M.includes("pay")){const G=P.match(/\d+/),H=G?parseInt(G[0]):5e4;setTimeout(()=>{const F={id:(Date.now()+1).toString(),role:"assistant",content:`I've prepared a draft WIRE transfer for $${H.toLocaleString()} to the requested recipient. For security, please authorize this action in the Payments tab or via the MFA prompt I'm about to trigger.`,timestamp:new Date().toISOString()};u(W=>[...W,F]),l(!1),y({type:"CREATE_PAYMENT",amount:H,recipient:"AI Requested Recipient"}),m(!0)},1500);return}if(M.includes("audit")||M.includes("logs")){setTimeout(()=>{const G={id:(Date.now()+1).toString(),role:"assistant",content:"Retrieving the last 5 high-severity audit entries... System is nominal. No unauthorized access attempts detected in the last 24 hours.",timestamp:new Date().toISOString()};u(H=>[...H,G]),l(!1),t("audit")},1e3);return}const R=S.getGenerativeModel({model:"gemini-pro"}),$=`You are the Quantum Financial Sovereign AI. You are helping a high-net-worth business user manage a global bank demo. The user said: "${P}". Context: We are in a "Golden Ticket" demo environment. Be professional, elite, and helpful. Do not mention Citibank. Use "Quantum Financial". Keep it concise and focused on business banking, treasury, and security.`,V=(await(await R.generateContent($)).response).text(),B={id:(Date.now()+1).toString(),role:"assistant",content:V,timestamp:new Date().toISOString()};u(G=>[...G,B])}catch{const R={id:(Date.now()+1).toString(),role:"assistant",content:"I'm currently operating in offline mode due to a synchronization delay, but I can still process local treasury commands. Try asking me to 'Send a wire' or 'Show audit logs'.",timestamp:new Date().toISOString()};u($=>[...$,R])}finally{l(!1)}},j=()=>{if(x==="123456"||x==="000000"){if((g==null?void 0:g.type)==="CREATE_PAYMENT"){const P={id:`TX-${Math.floor(Math.random()*9e3)+1e3}`,recipient:g.recipient,accountNumber:"****9999",amount:g.amount,currency:"USD",type:"WIRE",status:"AUTHORIZED",timestamp:new Date().toISOString(),reference:"AI_GENERATED_REF",initiatedBy:"James B. O'Callaghan (via AI)",riskScore:.05};r(E=>[P,...E]),C("WIRE_AUTHORIZED",`Authorized $${g.amount} wire to ${g.recipient}`,"INFO",P.id)}m(!1),v(""),y(null)}else alert("Invalid MFA Code. In this demo, use 123456.")},I=()=>a.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-700",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[a.jsx(kF,{label:"Total Liquidity",value:425e5,change:12.5,unit:"$",trend:"up",icon:a.jsx(gDt,{size:24})}),a.jsx(kF,{label:"Pending Outbound",value:125e3,change:2.1,unit:"$",trend:"down",icon:a.jsx(Cy,{size:24})}),a.jsx(kF,{label:"Security Score",value:98,change:.5,unit:"%",trend:"up",icon:a.jsx(ri,{size:24})}),a.jsx(kF,{label:"Active Entities",value:14,change:0,unit:"",trend:"neutral",icon:a.jsx(vi,{size:24})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsx(TF,{title:"Cash Flow Projection",icon:a.jsx(Xi,{size:18}),className:"lg:col-span-2",children:a.jsx("div",{className:"h-[300px] w-full",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(wm,{data:[{name:"Mon",inflow:4e3,outflow:2400},{name:"Tue",inflow:3e3,outflow:1398},{name:"Wed",inflow:2e3,outflow:9800},{name:"Thu",inflow:2780,outflow:3908},{name:"Fri",inflow:1890,outflow:4800},{name:"Sat",inflow:2390,outflow:3800},{name:"Sun",inflow:3490,outflow:4300}],children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"colorIn",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#06b6d4",stopOpacity:.3}),a.jsx("stop",{offset:"95%",stopColor:"#06b6d4",stopOpacity:0})]})}),a.jsx(kl,{strokeDasharray:"3 3",stroke:"#374151",vertical:!1}),a.jsx(Ka,{dataKey:"name",stroke:"#9ca3af",fontSize:12,tickLine:!1,axisLine:!1}),a.jsx(ra,{stroke:"#9ca3af",fontSize:12,tickLine:!1,axisLine:!1,tickFormatter:P=>`$${P}`}),a.jsx(ji,{contentStyle:{backgroundColor:"#111827",border:"1px solid #374151",borderRadius:"8px"},itemStyle:{color:"#fff"}}),a.jsx(hu,{type:"monotone",dataKey:"inflow",stroke:"#06b6d4",fillOpacity:1,fill:"url(#colorIn)",strokeWidth:3}),a.jsx(hu,{type:"monotone",dataKey:"outflow",stroke:"#8b5cf6",fillOpacity:0,strokeWidth:3})]})})})}),a.jsx(TF,{title:"Asset Allocation",icon:a.jsx(Fu,{size:18}),children:a.jsx("div",{className:"h-[300px] w-full",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(bw,{children:[a.jsx(cb,{data:[{name:"Operating",value:45},{name:"Reserve",value:25},{name:"Investment",value:20},{name:"Crypto",value:10}],cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"value",children:kIn.map((P,E)=>a.jsx(Eh,{fill:P},`cell-${E}`))}),a.jsx(ji,{}),a.jsx(uu,{verticalAlign:"bottom",height:36})]})})})})]})]}),_=()=>a.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-700",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"text-2xl font-bold text-white",children:"Global Payment Engine"}),a.jsxs("button",{onClick:()=>{y({type:"CREATE_PAYMENT",amount:0,recipient:""}),m(!0)},className:"flex items-center space-x-2 px-4 py-2 bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg font-bold transition-all shadow-lg shadow-cyan-900/20",children:[a.jsx(T0,{size:18}),a.jsx("span",{children:"New Transfer"})]})]}),a.jsx(TF,{className:"!p-0 overflow-hidden",children:a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-gray-800/50 text-gray-400 text-xs uppercase tracking-widest",children:[a.jsx("th",{className:"px-6 py-4 font-semibold",children:"Recipient / Ref"}),a.jsx("th",{className:"px-6 py-4 font-semibold",children:"Type"}),a.jsx("th",{className:"px-6 py-4 font-semibold",children:"Amount"}),a.jsx("th",{className:"px-6 py-4 font-semibold",children:"Status"}),a.jsx("th",{className:"px-6 py-4 font-semibold",children:"Risk"}),a.jsx("th",{className:"px-6 py-4 font-semibold",children:"Date"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-800",children:n.map(P=>a.jsxs("tr",{className:"hover:bg-gray-800/30 transition-colors group",children:[a.jsxs("td",{className:"px-6 py-4",children:[a.jsx("div",{className:"font-bold text-white",children:P.recipient}),a.jsx("div",{className:"text-xs text-gray-500",children:P.reference})]}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("span",{className:"px-2 py-1 rounded bg-gray-800 text-[10px] font-bold text-gray-300",children:P.type})}),a.jsxs("td",{className:"px-6 py-4 font-mono font-bold text-white",children:["$",P.amount.toLocaleString()]}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:`w-2 h-2 rounded-full ${P.status==="COMPLETED"?"bg-emerald-500":P.status==="FLAGGED"?"bg-rose-500 animate-pulse":"bg-amber-500"}`}),a.jsx("span",{className:"text-xs font-medium text-gray-300",children:P.status})]})}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("div",{className:"w-16 h-1.5 bg-gray-800 rounded-full overflow-hidden",children:a.jsx("div",{className:`h-full rounded-full ${P.riskScore>.5?"bg-rose-500":"bg-emerald-500"}`,style:{width:`${P.riskScore*100}%`}})})}),a.jsx("td",{className:"px-6 py-4 text-xs text-gray-500",children:new Date(P.timestamp).toLocaleDateString()})]},P.id))})]})})]}),T=()=>a.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-700",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h2",{className:"text-2xl font-bold text-white",children:"Immutable Audit Vault"}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("button",{className:"p-2 bg-gray-800 text-gray-400 rounded-lg hover:text-white transition-colors",children:a.jsx(Ch,{size:18})}),a.jsx("button",{className:"p-2 bg-gray-800 text-gray-400 rounded-lg hover:text-white transition-colors",children:a.jsx(QG,{size:18})})]})]}),a.jsx("div",{className:"space-y-3",children:o.map(P=>a.jsxs("div",{className:"p-4 bg-gray-900/40 border border-gray-800 rounded-xl flex items-start space-x-4 hover:border-gray-700 transition-all",children:[a.jsx("div",{className:`p-2 rounded-lg ${P.severity==="CRITICAL"?"bg-rose-900/20 text-rose-500":P.severity==="WARNING"?"bg-amber-900/20 text-amber-500":"bg-cyan-900/20 text-cyan-500"}`,children:P.severity==="CRITICAL"?a.jsx(QI,{size:20}):a.jsx(Gf,{size:20})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("h4",{className:"font-bold text-gray-200",children:P.action}),a.jsx("span",{className:"text-[10px] font-mono text-gray-500",children:P.timestamp})]}),a.jsx("p",{className:"text-sm text-gray-400 mt-1",children:P.details}),a.jsxs("div",{className:"flex items-center space-x-4 mt-2 text-[10px] text-gray-600 font-medium uppercase tracking-tighter",children:[a.jsxs("span",{children:["Actor: ",P.actor]}),a.jsxs("span",{children:["IP: ",P.ipAddress]}),P.resourceId&&a.jsxs("span",{children:["Ref: ",P.resourceId]})]})]})]},P.id))})]});return a.jsxs("div",{className:"min-h-screen bg-[#0a0a0c] text-gray-300 font-sans selection:bg-cyan-500/30",children:[a.jsxs("div",{className:"fixed inset-0 pointer-events-none",children:[a.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[40%] h-[40%] bg-cyan-900/10 blur-[120px] rounded-full"}),a.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[40%] h-[40%] bg-purple-900/10 blur-[120px] rounded-full"}),a.jsx("div",{className:"absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-20 mix-blend-overlay"})]}),a.jsxs("aside",{className:"fixed left-0 top-0 bottom-0 w-20 lg:w-64 bg-gray-950 border-r border-gray-800 z-50 flex flex-col",children:[a.jsxs("div",{className:"p-6 flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-cyan-500 to-blue-600 rounded-xl flex items-center justify-center shadow-lg shadow-cyan-500/20",children:a.jsx(pOt,{className:"text-white animate-spin-slow",size:24})}),a.jsx("span",{className:"hidden lg:block text-xl font-black tracking-tighter text-white uppercase italic",children:"Quantum"})]}),a.jsx("nav",{className:"flex-1 px-4 py-8 space-y-2",children:[{id:"overview",label:"Command Center",icon:a.jsx(Bme,{size:20})},{id:"payments",label:"Payment Engine",icon:a.jsx(yh,{size:20})},{id:"security",label:"Security Vault",icon:a.jsx(uf,{size:20})},{id:"audit",label:"Audit Storage",icon:a.jsx(rl,{size:20})}].map(P=>a.jsxs("button",{onClick:()=>t(P.id),className:`w-full flex items-center space-x-3 px-4 py-3 rounded-xl transition-all group ${e===P.id?"bg-cyan-600 text-white shadow-lg shadow-cyan-900/20":"text-gray-500 hover:bg-gray-900 hover:text-gray-300"}`,children:[a.jsx("div",{className:e===P.id?"text-white":"group-hover:text-cyan-400 transition-colors",children:P.icon}),a.jsx("span",{className:"hidden lg:block font-bold text-sm",children:P.label})]},P.id))}),a.jsx("div",{className:"p-6 border-t border-gray-800",children:a.jsxs("div",{className:"flex items-center space-x-3 p-2 rounded-xl bg-gray-900/50 border border-gray-800",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-800 flex items-center justify-center text-cyan-400",children:a.jsx(kd,{size:18})}),a.jsxs("div",{className:"hidden lg:block overflow-hidden",children:[a.jsx("p",{className:"text-xs font-bold text-white truncate",children:"James B. O'Callaghan"}),a.jsx("p",{className:"text-[10px] text-gray-500 uppercase font-bold tracking-widest",children:"Sovereign Architect"})]})]})})]}),a.jsxs("main",{className:"pl-20 lg:pl-64 pt-24 pb-12 px-8 min-h-screen relative z-10",children:[a.jsxs("header",{className:"fixed top-0 left-20 lg:left-64 right-0 h-20 bg-gray-950/80 backdrop-blur-md border-b border-gray-800 z-40 px-8 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("h1",{className:"text-lg font-bold text-white capitalize",children:e.replace("-"," ")}),a.jsx("div",{className:"h-4 w-[1px] bg-gray-800"}),a.jsxs("div",{className:"flex items-center space-x-2 text-xs font-medium text-emerald-500 bg-emerald-500/10 px-2 py-1 rounded-full",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),a.jsxs("span",{children:["System Live: ",_In]})]})]}),a.jsxs("div",{className:"flex items-center space-x-6",children:[a.jsxs("div",{className:"relative hidden md:block",children:[a.jsx(hm,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500",size:16}),a.jsx("input",{type:"text",placeholder:"Search transactions, entities...",className:"bg-gray-900 border border-gray-800 rounded-lg pl-10 pr-4 py-2 text-sm focus:outline-none focus:border-cyan-500/50 w-64 transition-all"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("button",{className:"p-2 text-gray-400 hover:text-white transition-colors relative",children:[a.jsx(_a,{size:20}),a.jsx("div",{className:"absolute top-2 right-2 w-2 h-2 bg-cyan-500 rounded-full border-2 border-gray-950"})]}),a.jsx("button",{className:"p-2 text-gray-400 hover:text-white transition-colors",children:a.jsx(v0,{size:20})})]})]})]}),a.jsxs("div",{className:"max-w-7xl mx-auto",children:[e==="overview"&&I(),e==="payments"&&_(),e==="audit"&&T(),e==="security"&&a.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center space-y-6 animate-in zoom-in duration-500",children:[a.jsx("div",{className:"w-24 h-24 bg-cyan-500/10 rounded-full flex items-center justify-center text-cyan-500 border border-cyan-500/20 shadow-2xl shadow-cyan-500/10",children:a.jsx(ri,{size:48})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h2",{className:"text-3xl font-black text-white uppercase tracking-tighter",children:"Quantum Shield Active"}),a.jsx("p",{className:"text-gray-500 max-w-md mx-auto",children:"Your environment is protected by multi-layered biometric encryption and real-time heuristic fraud monitoring."})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 w-full max-w-3xl mt-8",children:[a.jsxs("div",{className:"p-6 bg-gray-900/40 border border-gray-800 rounded-2xl",children:[a.jsx(kd,{className:"text-cyan-400 mb-4",size:32}),a.jsx("h4",{className:"font-bold text-white",children:"Biometric MFA"}),a.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Enforced for all high-value wires and administrative changes."})]}),a.jsxs("div",{className:"p-6 bg-gray-900/40 border border-gray-800 rounded-2xl",children:[a.jsx(UKe,{className:"text-purple-400 mb-4",size:32}),a.jsx("h4",{className:"font-bold text-white",children:"AI Sentinel"}),a.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Heuristic analysis of transaction patterns to prevent zero-day fraud."})]}),a.jsxs("div",{className:"p-6 bg-gray-900/40 border border-gray-800 rounded-2xl",children:[a.jsx(ds,{className:"text-emerald-400 mb-4",size:32}),a.jsx("h4",{className:"font-bold text-white",children:"Quantum Encryption"}),a.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"All data at rest and in transit is secured via post-quantum algorithms."})]})]})]})]}),a.jsx("div",{className:"fixed bottom-8 right-8 w-96 z-50",children:a.jsxs(TF,{className:"!p-0 shadow-2xl border-cyan-500/20 flex flex-col h-[500px]",children:[a.jsxs("div",{className:"p-4 border-b border-gray-800 flex items-center justify-between bg-gray-900/60",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-8 h-8 bg-cyan-500 rounded-lg flex items-center justify-center text-white",children:a.jsx(Pp,{size:18})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-bold text-white",children:"Sovereign AI"}),a.jsx("p",{className:"text-[10px] text-emerald-500 font-bold uppercase tracking-widest",children:"Online & Synchronized"})]})]}),a.jsx("button",{className:"text-gray-500 hover:text-white transition-colors",children:a.jsx(mm,{size:16})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 custom-scrollbar",children:[c.map(P=>a.jsx("div",{className:`flex ${P.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[85%] p-3 rounded-2xl text-sm ${P.role==="user"?"bg-cyan-600 text-white rounded-tr-none":"bg-gray-800 text-gray-300 rounded-tl-none border border-gray-700"}`,children:[P.content,a.jsx("div",{className:`text-[9px] mt-1 opacity-50 ${P.role==="user"?"text-right":"text-left"}`,children:new Date(P.timestamp).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})},P.id)),s&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-gray-800 p-3 rounded-2xl rounded-tl-none border border-gray-700 flex space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce [animation-delay:0.2s]"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce [animation-delay:0.4s]"})]})}),a.jsx("div",{ref:b})]}),a.jsx("div",{className:"p-4 bg-gray-900/60 border-t border-gray-800",children:a.jsxs("form",{onSubmit:P=>{P.preventDefault(),N(d)},className:"relative",children:[a.jsx("input",{type:"text",value:d,onChange:P=>p(P.target.value),placeholder:"Ask AI to send a wire, check logs...",className:"w-full bg-gray-800 border border-gray-700 rounded-xl pl-4 pr-12 py-3 text-sm focus:outline-none focus:border-cyan-500 transition-all"}),a.jsx("button",{type:"submit",disabled:!d.trim()||s,className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-cyan-500 hover:text-cyan-400 disabled:text-gray-600 transition-colors",children:a.jsx(Lc,{size:18})})]})})]})})]}),h&&a.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[a.jsx("div",{className:"absolute inset-0 bg-gray-950/80 backdrop-blur-sm",onClick:()=>m(!1)}),a.jsxs("div",{className:"relative w-full max-w-md bg-gray-900 border border-gray-800 rounded-3xl shadow-2xl overflow-hidden animate-in zoom-in-95 duration-300",children:[a.jsxs("div",{className:"p-8 text-center space-y-6",children:[a.jsx("div",{className:"w-20 h-20 bg-cyan-500/10 rounded-full flex items-center justify-center text-cyan-500 border border-cyan-500/20 mx-auto shadow-xl",children:a.jsx(kd,{size:40})}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"text-2xl font-black text-white uppercase tracking-tighter",children:"Authorization Required"}),a.jsx("p",{className:"text-gray-500 text-sm",children:(g==null?void 0:g.type)==="CREATE_PAYMENT"?`Confirming a WIRE transfer of $${g.amount.toLocaleString()} to ${g.recipient}.`:"Please verify your identity to proceed with this administrative action."})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"flex justify-center space-x-2",children:[...Array(6)].map((P,E)=>a.jsx("div",{className:"w-10 h-12 bg-gray-800 border border-gray-700 rounded-lg flex items-center justify-center text-xl font-bold text-white",children:x[E]||""},E))}),a.jsx("input",{type:"text",maxLength:6,autoFocus:!0,value:x,onChange:P=>v(P.target.value.replace(/\D/g,"")),className:"absolute inset-0 opacity-0 cursor-default"}),a.jsx("p",{className:"text-[10px] text-gray-600 uppercase font-bold tracking-widest",children:"Enter 123456 to authorize"})]}),a.jsxs("div",{className:"flex space-x-3",children:[a.jsx("button",{onClick:()=>m(!1),className:"flex-1 py-3 rounded-xl bg-gray-800 hover:bg-gray-700 text-gray-300 font-bold transition-all",children:"Cancel"}),a.jsx("button",{onClick:j,className:"flex-1 py-3 rounded-xl bg-cyan-600 hover:bg-cyan-500 text-white font-bold transition-all shadow-lg shadow-cyan-900/20",children:"Authorize"})]})]}),a.jsxs("div",{className:"bg-gray-800/50 p-4 flex items-center justify-center space-x-2 text-[10px] text-gray-500 font-bold uppercase tracking-widest",children:[a.jsx(ds,{size:12}),a.jsx("span",{children:"End-to-End Encrypted Session"})]})]})]}),a.jsxs("footer",{className:"pl-20 lg:pl-64 py-6 px-8 border-t border-gray-800 flex flex-col md:flex-row justify-between items-center text-[10px] text-gray-600 font-bold uppercase tracking-widest space-y-4 md:space-y-0",children:[a.jsxs("div",{className:"flex items-center space-x-6",children:[a.jsxs("span",{children:["© 2024 ",PIn," Global"]}),a.jsxs("span",{className:"flex items-center space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500"}),a.jsx("span",{children:"All Systems Operational"})]})]}),a.jsxs("div",{className:"flex items-center space-x-6",children:[a.jsx("a",{href:"#",className:"hover:text-cyan-500 transition-colors",children:"Terms of Service"}),a.jsx("a",{href:"#",className:"hover:text-cyan-500 transition-colors",children:"Privacy Policy"}),a.jsx("a",{href:"#",className:"hover:text-cyan-500 transition-colors",children:"Security Disclosure"}),a.jsx("span",{className:"text-gray-800",children:"|"}),a.jsx("span",{className:"text-cyan-900",children:"Sovereign Node: 0x77ALPHA"})]})]}),a.jsx("style",{dangerouslySetInnerHTML:{__html:` .custom-scrollbar::-webkit-scrollbar { width: 4px; } .custom-scrollbar::-webkit-scrollbar-track { background: transparent; } .custom-scrollbar::-webkit-scrollbar-thumb { background: #374151; border-radius: 10px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #4b5563; } @keyframes spin-slow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } .animate-spin-slow { animation: spin-slow 8s linear infinite; } `}})]})},RIn="mock-key-for-demo-purposes",K3="Quantum Financial",not="gemini-3-flash-preview",OIn=()=>[{id:1,name:"Total Capital Deployed",value:145e5,unit:"$",change:14.5,geinContribution:.23,description:"Aggregate capital flow through Quantum Financial rails."},{id:2,name:"Lives Directly Impacted",value:345e3,unit:"",change:8.2,geinContribution:.15,description:"Verified beneficiaries via biometric proof-of-impact."},{id:3,name:"Real-time Blended SROI",value:4.1,unit:"x",change:1.5,geinContribution:.45,description:"Social Return on Investment calculated by Sovereign AI."},{id:4,name:"GEIN Synergy Index",value:89.2,unit:"%",change:22.7,geinContribution:1,description:"Network efficiency derived from cross-grant collaboration."}],$In=()=>[{id:"daf-edu-001",fundName:"Future Education Initiative",balance:5e5,grantsIssued:15e4,sroiEstimate:4.1,focusArea:"STEM Education",geinAlignmentScore:92,networkedImpact:18e5,owner:"James B. oCallaghan",creationDate:"2023-01-15",grants:[{id:"g-001",recipient:"Quantum Leap Learning",amount:75e3,status:"Synergized",date:"2023-11-15",predictedSROI:4.5,aiConfidence:.98,geinImpactVector:[.8,.2,.5],synergisticPartners:["g-002","g-003"],riskProfile:{execution:.1,market:.05,systemic:.2},auditTrail:["Created by User","AI Risk Scan Passed","Funds Deployed"]},{id:"g-002",recipient:"CodeCrafters Youth",amount:5e4,status:"Reporting",date:"2024-01-20",predictedSROI:4.2,aiConfidence:.95,geinImpactVector:[.7,.3,.4],synergisticPartners:["g-001"],riskProfile:{execution:.15,market:.1,systemic:.2},auditTrail:["Created by User","Approved by Board"]}]},{id:"daf-hlth-001",fundName:"Global Health Fund 2024",balance:12e5,grantsIssued:35e4,sroiEstimate:3.2,focusArea:"Vaccine Research",geinAlignmentScore:85,networkedImpact:45e5,owner:"James B. oCallaghan",creationDate:"2023-06-22",grants:[{id:"g-003",recipient:"BioSynth Labs",amount:2e5,status:"Deployed",date:"2024-02-01",predictedSROI:3.8,aiConfidence:.91,geinImpactVector:[.2,.9,.6],synergisticPartners:["g-001","g-004"],riskProfile:{execution:.2,market:.25,systemic:.4},auditTrail:["Auto-generated by AI Agent","Manual Override Approval"]}]}],MF={nodes:[{id:"daf-edu-001",label:"Future Education",type:"DAF",impactScore:92,x:150,y:200,status:"active"},{id:"daf-hlth-001",label:"Global Health",type:"DAF",impactScore:85,x:150,y:400,status:"active"},{id:"g-001",label:"Quantum Leap",type:"Grant",impactScore:88,x:350,y:150,status:"active"},{id:"g-002",label:"CodeCrafters",type:"Grant",impactScore:85,x:350,y:250,status:"idle"},{id:"g-003",label:"BioSynth Labs",type:"Grant",impactScore:91,x:350,y:400,status:"active"},{id:"ai-core",label:"Sovereign AI Core",type:"AI_Agent",impactScore:99,x:550,y:300,status:"active"},{id:"org-who",label:"World Health Org",type:"Organization",impactScore:93,x:750,y:400,status:"idle"}],edges:[{source:"daf-edu-001",target:"g-001",strength:.9,type:"Funding",animated:!0},{source:"daf-edu-001",target:"g-002",strength:.8,type:"Funding",animated:!0},{source:"daf-hlth-001",target:"g-003",strength:.9,type:"Funding",animated:!0},{source:"g-001",target:"ai-core",strength:.95,type:"Dataflow",animated:!0},{source:"g-003",target:"ai-core",strength:.95,type:"Dataflow",animated:!0},{source:"ai-core",target:"org-who",strength:.6,type:"Control",animated:!1}]},DIn=()=>{const[e,t]=f.useState([]),n=f.useCallback((r,o,i="INFO")=>{const s={id:`log-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,timestamp:new Date().toISOString(),action:r,user:"CURRENT_USER",details:o,severity:i,hash:Math.random().toString(36).substr(2,16)};t(l=>[s,...l]),console.log(`[AUDIT] ${r}: ${o}`)},[]);return{logs:e,logAction:n}},LIn=e=>{const[t,n]=f.useState(!1),[r,o]=f.useState([{id:"welcome",sender:"ai",text:`Welcome to the ${K3} Business Demo. I am your Sovereign AI Architect. I can help you analyze funds, draft grants, or audit the system. How shall we proceed?`,timestamp:new Date}]);return{messages:r,sendMessage:async s=>{const l={id:Date.now().toString(),sender:"user",text:s,timestamp:new Date};o(c=>[...c,l]),n(!0),e("AI_INTERACTION",`User query: ${s}`);try{const c=new Ko({apiKey:RIn}),u=` You are the Sovereign AI for ${K3}, a high-performance financial platform. Your tone is Elite, Professional, Secure, and Helpful. You are giving a "Test Drive" of the platform. Metaphors: "Kick the tires", "See the engine roar". Do NOT mention "Citibank". If the user asks to create something, confirm you are initiating the secure protocol. Current Context: The user is in the Philanthropy Hub. User Input: ${s} `,p=(await c.models.generateContent({model:not,contents:[{role:"user",parts:[{text:u}]}]})).response.text(),h={id:(Date.now()+1).toString(),sender:"ai",text:p,timestamp:new Date};o(m=>[...m,h]),e("AI_RESPONSE",`Generated response length: ${p.length}`)}catch(c){console.error("AI Error:",c);const u={id:(Date.now()+1).toString(),sender:"system",text:"Secure handshake with AI Core failed. Switching to local heuristic mode.",timestamp:new Date};o(d=>[...d,u]),e("AI_ERROR",`Failed to connect to Gemini: ${c}`)}finally{n(!1)}},isProcessing:t}},FIn=({metric:e})=>{const t=e.change>=0;return a.jsxs("div",{className:"group relative bg-gray-900/60 p-6 rounded-2xl border border-gray-700/50 backdrop-blur-md overflow-hidden transition-all duration-500 hover:border-cyan-500/50 hover:shadow-[0_0_30px_rgba(6,182,212,0.15)]",children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-cyan-500/5 to-purple-500/5 opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),a.jsxs("div",{className:"relative z-10",children:[a.jsxs("div",{className:"flex justify-between items-start mb-4",children:[a.jsx("div",{className:"p-2 bg-gray-800/80 rounded-lg border border-gray-700 group-hover:border-cyan-500/30 transition-colors",children:e.unit==="$"?a.jsx(cy,{className:"w-5 h-5 text-cyan-400"}):e.unit==="x"?a.jsx(_a,{className:"w-5 h-5 text-amber-400"}):e.unit==="%"?a.jsx(Fu,{className:"w-5 h-5 text-purple-400"}):a.jsx(wie,{className:"w-5 h-5 text-rose-400"})}),a.jsxs("span",{className:`flex items-center text-xs font-bold px-2 py-1 rounded-full ${t?"bg-green-500/10 text-green-400":"bg-red-500/10 text-red-400"}`,children:[t?a.jsx(NC,{className:"w-3 h-3 mr-1"}):a.jsx(NC,{className:"w-3 h-3 mr-1 rotate-180"}),Math.abs(e.change),"%"]})]}),a.jsx("h3",{className:"text-gray-400 text-sm font-medium uppercase tracking-wider mb-1",children:e.name}),a.jsx("div",{className:"flex items-baseline space-x-1",children:a.jsxs("span",{className:"text-3xl font-bold text-white tracking-tight",children:[e.unit==="$"?"$":"",e.value.toLocaleString(),e.unit!=="$"&&a.jsx("span",{className:"text-lg text-gray-500 ml-1",children:e.unit})]})}),a.jsx("p",{className:"mt-3 text-xs text-gray-500 line-clamp-2 group-hover:text-gray-400 transition-colors",children:e.description})]})]})},zIn=({isOpen:e,onClose:t,logs:n})=>e?a.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/80 backdrop-blur-sm p-4",children:a.jsxs("div",{className:"w-full max-w-5xl bg-gray-900 border border-gray-700 rounded-xl shadow-2xl overflow-hidden flex flex-col max-h-[85vh]",children:[a.jsxs("div",{className:"flex justify-between items-center p-6 border-b border-gray-800 bg-gray-900/95",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ri,{className:"w-6 h-6 text-green-500"}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-bold text-white",children:"Secure Audit Vault"}),a.jsxs("p",{className:"text-xs text-gray-400 font-mono",children:["IMMUTABLE LEDGER // ",K3," COMPLIANCE"]})]})]}),a.jsx("button",{onClick:t,className:"p-2 hover:bg-gray-800 rounded-full transition-colors",children:a.jsx(vh,{className:"w-5 h-5 text-gray-400"})})]}),a.jsx("div",{className:"flex-1 overflow-auto p-0",children:a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{className:"bg-gray-800/50 sticky top-0 z-10 backdrop-blur-md",children:a.jsxs("tr",{children:[a.jsx("th",{className:"p-4 text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Timestamp"}),a.jsx("th",{className:"p-4 text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Severity"}),a.jsx("th",{className:"p-4 text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Action"}),a.jsx("th",{className:"p-4 text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Details"}),a.jsx("th",{className:"p-4 text-xs font-semibold text-gray-400 uppercase tracking-wider text-right",children:"Hash"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-800",children:n.map(r=>a.jsxs("tr",{className:"hover:bg-gray-800/30 transition-colors font-mono text-sm",children:[a.jsx("td",{className:"p-4 text-gray-500 whitespace-nowrap",children:new Date(r.timestamp).toLocaleTimeString()}),a.jsx("td",{className:"p-4",children:a.jsx("span",{className:`px-2 py-1 rounded-full text-[10px] font-bold ${r.severity==="CRITICAL"?"bg-red-500/20 text-red-400":r.severity==="WARNING"?"bg-amber-500/20 text-amber-400":"bg-blue-500/20 text-blue-400"}`,children:r.severity})}),a.jsx("td",{className:"p-4 text-white font-medium",children:r.action}),a.jsx("td",{className:"p-4 text-gray-400 max-w-md truncate",title:r.details,children:r.details}),a.jsx("td",{className:"p-4 text-gray-600 text-right text-xs",children:r.hash})]},r.id))})]})}),a.jsxs("div",{className:"p-4 border-t border-gray-800 bg-gray-900/95 flex justify-between items-center text-xs text-gray-500",children:[a.jsxs("span",{children:["Total Records: ",n.length]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(ds,{className:"w-3 h-3"}),a.jsx("span",{children:"End-to-End Encrypted Storage"})]})]})]})}):null,BIn=({isOpen:e,onClose:t,messages:n,onSend:r,isProcessing:o})=>{const[i,s]=f.useState(""),l=f.useRef(null);f.useEffect(()=>{l.current&&(l.current.scrollTop=l.current.scrollHeight)},[n]);const c=u=>{u.preventDefault(),i.trim()&&(r(i),s(""))};return e?a.jsxs("div",{className:"fixed bottom-6 right-6 z-50 w-96 h-[600px] bg-gray-900 border border-cyan-500/30 rounded-2xl shadow-2xl flex flex-col overflow-hidden backdrop-blur-xl animate-in slide-in-from-bottom-10 fade-in duration-300",children:[a.jsxs("div",{className:"p-4 bg-gradient-to-r from-cyan-900/20 to-purple-900/20 border-b border-gray-800 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full animate-pulse absolute -right-0.5 -bottom-0.5 border border-gray-900"}),a.jsx(Pp,{className:"w-8 h-8 text-cyan-400"})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-white text-sm",children:"Sovereign AI"}),a.jsxs("p",{className:"text-[10px] text-cyan-400/80 uppercase tracking-wider",children:["Online // ",not]})]})]}),a.jsx("button",{onClick:t,className:"text-gray-400 hover:text-white transition-colors",children:a.jsx(vh,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 bg-gray-900/50",ref:l,children:[n.map(u=>a.jsx("div",{className:`flex ${u.sender==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[85%] p-3 rounded-2xl text-sm leading-relaxed ${u.sender==="user"?"bg-cyan-600 text-white rounded-br-none":u.sender==="system"?"bg-red-900/30 text-red-200 border border-red-500/30":"bg-gray-800 text-gray-200 rounded-bl-none border border-gray-700"}`,children:u.text})},u.id)),o&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-gray-800 p-3 rounded-2xl rounded-bl-none border border-gray-700 flex space-x-2 items-center",children:[a.jsx("div",{className:"w-2 h-2 bg-cyan-400 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("div",{className:"w-2 h-2 bg-cyan-400 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("div",{className:"w-2 h-2 bg-cyan-400 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})})]}),a.jsxs("form",{onSubmit:c,className:"p-4 border-t border-gray-800 bg-gray-900",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:i,onChange:u=>s(u.target.value),placeholder:"Ask Sovereign AI...",className:"w-full bg-gray-800 text-white pl-4 pr-12 py-3 rounded-xl border border-gray-700 focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 outline-none transition-all placeholder-gray-500 text-sm"}),a.jsx("button",{type:"submit",disabled:!i.trim()||o,className:"absolute right-2 top-2 p-1.5 bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:a.jsx(Lc,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"mt-2 flex justify-center space-x-4 text-[10px] text-gray-500",children:[a.jsxs("span",{className:"flex items-center",children:[a.jsx(ds,{className:"w-3 h-3 mr-1"})," Encrypted"]}),a.jsxs("span",{className:"flex items-center",children:[a.jsx(rl,{className:"w-3 h-3 mr-1"})," Audit Logged"]})]})]})]}):null},HIn=({isOpen:e,onClose:t,onSave:n})=>{const[r,o]=f.useState({fundName:"",initialDeposit:"",focusArea:""});if(!e)return null;const i=s=>{s.preventDefault(),n(r),t()};return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm p-4",children:a.jsxs("div",{className:"w-full max-w-md bg-gray-900 border border-gray-700 rounded-2xl shadow-2xl overflow-hidden animate-in zoom-in-95 duration-200",children:[a.jsxs("div",{className:"p-6 border-b border-gray-800",children:[a.jsx("h3",{className:"text-lg font-bold text-white",children:"Establish New Fund"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Initiate a new Donor Advised Fund vehicle."})]}),a.jsxs("form",{onSubmit:i,className:"p-6 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-medium text-gray-400 uppercase mb-1",children:"Fund Designation"}),a.jsx("input",{type:"text",required:!0,className:"w-full bg-gray-800 border border-gray-700 rounded-lg p-3 text-white focus:border-cyan-500 outline-none transition-colors",placeholder:"e.g. Quantum Future Trust",value:r.fundName,onChange:s=>o({...r,fundName:s.target.value})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-medium text-gray-400 uppercase mb-1",children:"Initial Capital (USD)"}),a.jsx("input",{type:"number",required:!0,className:"w-full bg-gray-800 border border-gray-700 rounded-lg p-3 text-white focus:border-cyan-500 outline-none transition-colors",placeholder:"100,000",value:r.initialDeposit,onChange:s=>o({...r,initialDeposit:s.target.value})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-medium text-gray-400 uppercase mb-1",children:"Strategic Focus"}),a.jsxs("select",{className:"w-full bg-gray-800 border border-gray-700 rounded-lg p-3 text-white focus:border-cyan-500 outline-none transition-colors",value:r.focusArea,onChange:s=>o({...r,focusArea:s.target.value}),children:[a.jsx("option",{value:"",children:"Select Focus Area..."}),a.jsx("option",{value:"Education",children:"Education & Human Capital"}),a.jsx("option",{value:"Health",children:"Global Health Security"}),a.jsx("option",{value:"Climate",children:"Climate & Energy Transition"}),a.jsx("option",{value:"Tech",children:"Deep Tech & AI Safety"})]})]}),a.jsxs("div",{className:"pt-4 flex space-x-3",children:[a.jsx("button",{type:"button",onClick:t,className:"flex-1 py-3 bg-gray-800 hover:bg-gray-700 text-white rounded-lg transition-colors font-medium",children:"Cancel"}),a.jsx("button",{type:"submit",className:"flex-1 py-3 bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg transition-colors font-bold shadow-lg shadow-cyan-500/20",children:"Execute"})]})]})]})})},VIn=()=>{const[e,t]=f.useState("dashboard"),[n,r]=f.useState(OIn()),[o,i]=f.useState($In()),[s,l]=f.useState(!1),[c,u]=f.useState(!1),[d,p]=f.useState(!1),{logs:h,logAction:m}=DIn(),{messages:g,sendMessage:y,isProcessing:x}=LIn(m);f.useEffect(()=>{const C=setInterval(()=>{r(N=>N.map(j=>({...j,value:j.unit==="$"?j.value+Math.floor(Math.random()*1e3):j.value+(Math.random()*.1-.05)})))},3e3);return()=>clearInterval(C)},[]);const v=C=>{m("CREATE_DAF",`Initiated creation of fund: ${C.fundName} with initial capital ${C.initialDeposit}`);const N={id:`daf-${Date.now()}`,fundName:C.fundName,balance:parseFloat(C.initialDeposit),grantsIssued:0,sroiEstimate:0,focusArea:C.focusArea,geinAlignmentScore:0,networkedImpact:0,owner:"James B. oCallaghan",creationDate:new Date().toISOString(),grants:[]};i(j=>[...j,N]),m("DAF_CREATED",`Fund ${N.id} successfully registered on ledger.`),y(`I have successfully established the ${C.fundName}. It is now ready for capital deployment. Would you like me to scan for high-impact grant opportunities in ${C.focusArea}?`)},b=()=>a.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500",children:[a.jsxs("div",{className:"relative overflow-hidden rounded-3xl bg-gradient-to-r from-gray-900 to-gray-800 border border-gray-700 p-8 shadow-2xl",children:[a.jsx("div",{className:"absolute top-0 right-0 -mt-10 -mr-10 w-64 h-64 bg-cyan-500/10 rounded-full blur-3xl"}),a.jsxs("div",{className:"relative z-10",children:[a.jsxs("h1",{className:"text-4xl font-extrabold text-white mb-2 tracking-tight",children:["Welcome to ",a.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-cyan-400 to-purple-400",children:K3})]}),a.jsxs("p",{className:"text-xl text-gray-400 max-w-2xl leading-relaxed",children:["You are in the driver's seat. This is your ",a.jsx("span",{className:"text-white font-semibold",children:"Golden Ticket"})," to the future of philanthropic capital allocation. Kick the tires, explore the engine, and witness the power of Sovereign AI."]}),a.jsxs("div",{className:"mt-6 flex space-x-4",children:[a.jsxs("button",{onClick:()=>l(!0),className:"px-6 py-3 bg-cyan-600 hover:bg-cyan-500 text-white rounded-xl font-bold transition-all shadow-lg shadow-cyan-500/20 flex items-center",children:[a.jsx(Pp,{className:"w-5 h-5 mr-2"}),"Ask Sovereign AI"]}),a.jsxs("button",{onClick:()=>t("gein"),className:"px-6 py-3 bg-gray-800 hover:bg-gray-700 text-white rounded-xl font-bold transition-all border border-gray-600 flex items-center",children:[a.jsx(Fu,{className:"w-5 h-5 mr-2"}),"View Network Graph"]})]})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:n.map(C=>a.jsx(FIn,{metric:C},C.id))}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-2 bg-gray-900/50 border border-gray-700 rounded-2xl p-6 backdrop-blur-sm",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsxs("h3",{className:"text-lg font-bold text-white flex items-center",children:[a.jsx(Xi,{className:"w-5 h-5 mr-2 text-cyan-400"}),"Live Capital Flow"]}),a.jsxs("span",{className:"flex items-center text-xs text-green-400",children:[a.jsx("span",{className:"w-2 h-2 bg-green-500 rounded-full mr-2 animate-pulse"}),"System Operational"]})]}),a.jsx("div",{className:"space-y-4",children:o.flatMap(C=>C.grants).slice(0,4).map((C,N)=>{var j;return a.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-800/50 rounded-xl border border-gray-700/50 hover:bg-gray-800 transition-colors",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"p-2 bg-cyan-500/10 rounded-lg",children:a.jsx(fk,{className:"w-5 h-5 text-cyan-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-white font-medium",children:C.recipient}),a.jsxs("p",{className:"text-xs text-gray-400",children:["Via ",(j=o.find(I=>I.grants.includes(C)))==null?void 0:j.fundName]})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsxs("p",{className:"text-white font-mono font-bold",children:["$",C.amount.toLocaleString()]}),a.jsxs("p",{className:"text-xs text-green-400",children:["SROI: ",C.predictedSROI,"x"]})]})]},N)})})]}),a.jsxs("div",{className:"bg-gray-900/50 border border-gray-700 rounded-2xl p-6 backdrop-blur-sm flex flex-col",children:[a.jsxs("h3",{className:"text-lg font-bold text-white mb-4 flex items-center",children:[a.jsx(ri,{className:"w-5 h-5 mr-2 text-purple-400"}),"Security Status"]}),a.jsxs("div",{className:"flex-1 flex flex-col justify-center items-center space-y-6",children:[a.jsxs("div",{className:"relative w-32 h-32",children:[a.jsxs("svg",{className:"w-full h-full",viewBox:"0 0 36 36",children:[a.jsx("path",{className:"text-gray-800",d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:"currentColor",strokeWidth:"3"}),a.jsx("path",{className:"text-purple-500",strokeDasharray:"100, 100",d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831",fill:"none",stroke:"currentColor",strokeWidth:"3"})]}),a.jsxs("div",{className:"absolute inset-0 flex items-center justify-center flex-col",children:[a.jsx("span",{className:"text-2xl font-bold text-white",children:"100%"}),a.jsx("span",{className:"text-[10px] text-gray-400 uppercase",children:"Secure"})]})]}),a.jsxs("div",{className:"w-full space-y-3",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-gray-400",children:"Threat Detection"}),a.jsx("span",{className:"text-green-400",children:"Active"})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-gray-400",children:"Audit Logging"}),a.jsx("span",{className:"text-green-400",children:"Enabled"})]}),a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-gray-400",children:"AI Oversight"}),a.jsx("span",{className:"text-green-400",children:"Online"})]})]}),a.jsx("button",{onClick:()=>u(!0),className:"w-full py-2 bg-gray-800 hover:bg-gray-700 text-gray-300 text-xs uppercase tracking-wider font-bold rounded-lg transition-colors",children:"Open Audit Vault"})]})]})]})]}),w=()=>a.jsxs("div",{className:"space-y-6 animate-in slide-in-from-right-10 duration-500",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold text-white",children:"Fund Management"}),a.jsx("p",{className:"text-gray-400",children:"Oversee your philanthropic vehicles and capital deployment."})]}),a.jsxs("button",{onClick:()=>p(!0),className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg font-bold flex items-center shadow-lg shadow-cyan-500/20",children:[a.jsx(T0,{className:"w-4 h-4 mr-2"}),"New Fund"]})]}),a.jsx("div",{className:"grid grid-cols-1 gap-6",children:o.map(C=>a.jsxs("div",{className:"bg-gray-900/60 border border-gray-700 rounded-2xl p-6 hover:border-cyan-500/30 transition-all",children:[a.jsxs("div",{className:"flex flex-col md:flex-row justify-between md:items-center mb-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:C.fundName}),a.jsxs("div",{className:"flex items-center space-x-4 mt-1",children:[a.jsxs("span",{className:"text-sm text-gray-400 flex items-center",children:[a.jsx(JG,{className:"w-3 h-3 mr-1"})," ",C.focusArea]}),a.jsxs("span",{className:"text-sm text-gray-400 flex items-center",children:[a.jsx(eT,{className:"w-3 h-3 mr-1"})," ",C.id]})]})]}),a.jsxs("div",{className:"mt-4 md:mt-0 text-right",children:[a.jsx("p",{className:"text-sm text-gray-400 uppercase tracking-wider",children:"Available Capital"}),a.jsxs("p",{className:"text-3xl font-bold text-white font-mono",children:["$",C.balance.toLocaleString()]})]})]}),a.jsx("div",{className:"bg-gray-800/50 rounded-xl overflow-hidden",children:a.jsxs("table",{className:"w-full text-left",children:[a.jsx("thead",{className:"bg-gray-800 border-b border-gray-700",children:a.jsxs("tr",{children:[a.jsx("th",{className:"p-4 text-xs font-semibold text-gray-400 uppercase",children:"Grant Recipient"}),a.jsx("th",{className:"p-4 text-xs font-semibold text-gray-400 uppercase",children:"Status"}),a.jsx("th",{className:"p-4 text-xs font-semibold text-gray-400 uppercase text-right",children:"Amount"}),a.jsx("th",{className:"p-4 text-xs font-semibold text-gray-400 uppercase text-right",children:"AI Confidence"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-700",children:C.grants.length>0?C.grants.map(N=>a.jsxs("tr",{className:"hover:bg-gray-700/30 transition-colors",children:[a.jsx("td",{className:"p-4 text-white font-medium",children:N.recipient}),a.jsx("td",{className:"p-4",children:a.jsx("span",{className:`px-2 py-1 rounded-full text-[10px] font-bold uppercase ${N.status==="Deployed"?"bg-green-500/20 text-green-400":N.status==="Synergized"?"bg-purple-500/20 text-purple-400":"bg-blue-500/20 text-blue-400"}`,children:N.status})}),a.jsxs("td",{className:"p-4 text-white font-mono text-right",children:["$",N.amount.toLocaleString()]}),a.jsx("td",{className:"p-4 text-right",children:a.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[a.jsx("div",{className:"w-16 h-1.5 bg-gray-700 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-cyan-500",style:{width:`${N.aiConfidence*100}%`}})}),a.jsxs("span",{className:"text-xs text-cyan-400",children:[(N.aiConfidence*100).toFixed(0),"%"]})]})})]},N.id)):a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"p-8 text-center text-gray-500 italic",children:"No grants deployed yet. Ask AI to scout opportunities."})})})]})})]},C.id))})]}),S=()=>a.jsxs("div",{className:"h-[600px] bg-gray-900 border border-gray-700 rounded-2xl relative overflow-hidden animate-in fade-in duration-700",children:[a.jsxs("div",{className:"absolute top-4 left-4 z-10",children:[a.jsxs("h2",{className:"text-xl font-bold text-white flex items-center",children:[a.jsx(vi,{className:"w-5 h-5 mr-2 text-cyan-400"}),"Global Economic Impact Network"]}),a.jsx("p",{className:"text-xs text-gray-400",children:"Real-time visualization of capital synergy."})]}),a.jsxs("svg",{className:"w-full h-full",children:[a.jsx("defs",{children:a.jsxs("filter",{id:"glow",children:[a.jsx("feGaussianBlur",{stdDeviation:"2.5",result:"coloredBlur"}),a.jsxs("feMerge",{children:[a.jsx("feMergeNode",{in:"coloredBlur"}),a.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),MF.edges.map((C,N)=>{const j=MF.nodes.find(_=>_.id===C.source),I=MF.nodes.find(_=>_.id===C.target);return a.jsxs("g",{children:[a.jsx("line",{x1:j.x,y1:j.y,x2:I.x,y2:I.y,stroke:C.type==="Funding"?"#06b6d4":C.type==="Dataflow"?"#a855f7":"#64748b",strokeWidth:C.strength*2,strokeOpacity:"0.4"}),C.animated&&a.jsx("circle",{r:"2",fill:"#fff",children:a.jsx("animateMotion",{dur:`${3-C.strength}s`,repeatCount:"indefinite",path:`M${j.x},${j.y} L${I.x},${I.y}`})})]},N)}),MF.nodes.map((C,N)=>a.jsxs("g",{transform:`translate(${C.x},${C.y})`,className:"cursor-pointer hover:opacity-80 transition-opacity",children:[a.jsx("circle",{r:C.type==="AI_Agent"?25:15,fill:C.type==="DAF"?"#0e7490":C.type==="Grant"?"#059669":C.type==="AI_Agent"?"#7c3aed":"#475569",stroke:"#fff",strokeWidth:"2",filter:"url(#glow)"}),a.jsx("text",{y:"35",textAnchor:"middle",fill:"#94a3b8",fontSize:"10",fontWeight:"bold",children:C.label}),C.type==="AI_Agent"&&a.jsx("circle",{r:"30",fill:"none",stroke:"#7c3aed",strokeWidth:"1",strokeDasharray:"4 4",children:a.jsx("animateTransform",{attributeName:"transform",type:"rotate",from:"0 0 0",to:"360 0 0",dur:"10s",repeatCount:"indefinite"})})]},N))]})]});return a.jsxs("div",{className:"min-h-screen bg-[#0B0C10] text-gray-100 font-sans selection:bg-cyan-500/30",children:[a.jsx("header",{className:"sticky top-0 z-40 bg-[#0B0C10]/80 backdrop-blur-md border-b border-gray-800",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-cyan-500 to-blue-600 rounded-lg flex items-center justify-center shadow-lg shadow-cyan-500/20",children:a.jsx("span",{className:"font-bold text-white text-lg",children:"Q"})}),a.jsx("span",{className:"font-bold text-xl tracking-tight text-white",children:K3}),a.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] font-bold bg-gray-800 text-gray-400 border border-gray-700 uppercase tracking-wider",children:"Business Demo"})]}),a.jsx("nav",{className:"hidden md:flex space-x-1",children:[{id:"dashboard",label:"Command Center",icon:fR},{id:"management",label:"Funds",icon:eC},{id:"gein",label:"Network",icon:vi},{id:"audit",label:"Audit",icon:ri}].map(C=>a.jsxs("button",{onClick:()=>t(C.id),className:`px-4 py-2 rounded-lg text-sm font-medium transition-all flex items-center ${e===C.id?"bg-gray-800 text-white shadow-inner":"text-gray-400 hover:text-white hover:bg-gray-800/50"}`,children:[a.jsx(C.icon,{className:"w-4 h-4 mr-2"}),C.label]},C.id))}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("button",{onClick:()=>l(!s),className:`p-2 rounded-full transition-colors relative ${s?"bg-cyan-600 text-white":"bg-gray-800 text-gray-400 hover:text-white"}`,children:[a.jsx(Lw,{className:"w-5 h-5"}),a.jsx("span",{className:"absolute top-0 right-0 w-2.5 h-2.5 bg-green-500 rounded-full border-2 border-[#0B0C10]"})]}),a.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-r from-purple-500 to-pink-500 border-2 border-gray-800"})]})]})}),a.jsxs("main",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[e==="dashboard"&&b(),e==="management"&&w(),e==="gein"&&S(),e==="audit"&&a.jsxs("div",{className:"text-center py-20",children:[a.jsx(ri,{className:"w-16 h-16 text-gray-600 mx-auto mb-4"}),a.jsx("h2",{className:"text-2xl font-bold text-white",children:"Audit Vault Access"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Secure access required to view full immutable ledger."}),a.jsx("button",{onClick:()=>u(!0),className:"px-6 py-3 bg-gray-800 hover:bg-gray-700 text-white rounded-lg font-bold",children:"Authenticate & View Logs"})]})]}),a.jsx(BIn,{isOpen:s,onClose:()=>l(!1),messages:g,onSend:y,isProcessing:x}),a.jsx(zIn,{isOpen:c,onClose:()=>u(!1),logs:h}),a.jsx(HIn,{isOpen:d,onClose:()=>p(!1),onSave:v}),a.jsx("div",{className:"fixed bottom-6 right-6 md:hidden z-40",children:a.jsx("button",{onClick:()=>l(!0),className:"w-14 h-14 bg-cyan-600 rounded-full shadow-2xl flex items-center justify-center text-white hover:bg-cyan-500 transition-colors",children:a.jsx(Pp,{className:"w-7 h-7"})})})]})},UIn="QUANTUM-OS v4.2.0-GOLDEN",WIn=[{label:"Liquidity Buffer",value:"$4.2B",trend:"up",status:"optimal"},{label:"Fraud Detection Latency",value:"1.2ms",trend:"down",status:"optimal"},{label:"Active Wire Channels",value:"142",trend:"stable",status:"optimal"},{label:"AI Confidence Score",value:"99.8%",trend:"up",status:"optimal"}],GIn=()=>a.jsxs("div",{className:"relative h-64 w-full bg-black rounded-2xl overflow-hidden border border-cyan-500/30 shadow-[0_0_30px_rgba(6,182,212,0.1)]",children:[a.jsx("div",{className:"absolute inset-0 opacity-20",children:a.jsx("div",{className:"h-full w-full bg-[radial-gradient(circle_at_center,_var(--tw-gradient-stops))] from-cyan-500 via-transparent to-transparent animate-pulse"})}),a.jsx("div",{className:"flex items-center justify-center h-full space-x-8",children:[1,2,3,4,5].map(e=>a.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[a.jsx("div",{className:"w-4 bg-cyan-400 rounded-full animate-bounce",style:{height:`${Math.random()*100+20}px`,animationDelay:`${e*.2}s`}}),a.jsxs("span",{className:"text-[10px] text-cyan-500 font-mono",children:["CORE_",e]})]},e))}),a.jsx("div",{className:"absolute bottom-4 left-4",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-ping"}),a.jsx("span",{className:"text-xs text-green-400 font-mono",children:"ENGINE_STATUS: NOMINAL"})]})})]}),qIn=({logs:e})=>a.jsxs("div",{className:"bg-gray-900/80 border border-gray-800 rounded-xl p-4 h-[400px] overflow-y-auto font-mono text-xs",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4 border-b border-gray-800 pb-2",children:[a.jsx("span",{className:"text-cyan-400 font-bold uppercase tracking-widest",children:"Immutable Audit Ledger"}),a.jsx("span",{className:"text-gray-500",children:"SECURE_STORAGE_ACTIVE"})]}),a.jsx("div",{className:"space-y-2",children:e.map(t=>a.jsxs("div",{className:"flex items-start space-x-3 p-2 hover:bg-white/5 rounded transition-colors",children:[a.jsxs("span",{className:"text-gray-600",children:["[",new Date(t.timestamp).toLocaleTimeString(),"]"]}),a.jsx("span",{className:`font-bold ${t.severity==="CRITICAL"?"text-red-500":t.severity==="WARNING"?"text-yellow-500":"text-blue-400"}`,children:t.category}),a.jsx("span",{className:"text-gray-300",children:t.action}),a.jsxs("span",{className:"text-gray-500 italic",children:["— ",t.details]})]},t.id))})]}),KIn=()=>{const[e,t]=f.useState([{id:"1",role:"assistant",content:"Welcome to Quantum Financial. I am the Sovereign Intelligence. You have the Golden Ticket. How shall we stress-test the engine today?",timestamp:new Date}]),[n,r]=f.useState(""),[o,i]=f.useState(!1),[s,l]=f.useState([]),[c,u]=f.useState(WIn),[d,p]=f.useState(!1),[h,m]=f.useState("ACH"),[g,y]=f.useState(!1),x=f.useRef(null),v=f.useMemo(()=>(console.warn("GEMINI_API_KEY not found in environment."),new Ko("")),[]),b=f.useCallback((N,j,I,_="INFO")=>{const T={id:Math.random().toString(36).substr(2,9),action:N,category:j,details:I,timestamp:new Date().toISOString(),severity:_};l(P=>[T,...P])},[]),w=()=>{var N;(N=x.current)==null||N.scrollIntoView({behavior:"smooth"})};f.useEffect(()=>{w()},[e]),f.useEffect(()=>{b("System Initialization","SYSTEM","Quantum OS Golden Ticket environment loaded successfully.","INFO"),b("Security Protocol","SECURITY","Multi-factor authentication simulation active.","INFO")},[b]);const S=async()=>{if(!n.trim())return;const N={id:Date.now().toString(),role:"user",content:n,timestamp:new Date};t(j=>[...j,N]),r(""),i(!0),b("AI Query Initiated","AI",`User requested: ${n.substring(0,30)}...`,"INFO");try{const P=(await(await v.getGenerativeModel({model:"gemini-1.5-flash"}).generateContent([` You are the Quantum Financial Sovereign Intelligence. Context: This is a "Golden Ticket" business banking demo for an elite global financial institution. Tone: Professional, Secure, High-Performance, Elite. Rules: 1. Never use the name "Citibank". Use "Quantum Financial" or "The Demo Bank". 2. You can simulate creating payments, generating reports, or checking security. 3. If the user asks to "create a payment" or "send money", tell them you are initiating the QuantumPay protocol. 4. Mention the "Architect" (a 32-year-old visionary) if asked about the system's origin. 5. Reference the "EIN 2021" as the genesis code of the platform. 6. Be helpful but maintain an air of high-level security. `,...e.map(M=>`${M.role}: ${M.content}`),`user: ${n}`])).response).text(),E={id:(Date.now()+1).toString(),role:"assistant",content:P,timestamp:new Date};t(M=>[...M,E]),b("AI Response Delivered","AI","Strategic intelligence synthesized.","INFO"),(P.toLowerCase().includes("payment")||P.toLowerCase().includes("ach"))&&(m("ACH"),p(!0))}catch(j){console.error("AI Error:",j);const I={id:(Date.now()+1).toString(),role:"assistant",content:"I apologize, but the neural link is experiencing high-frequency interference. Please try again.",timestamp:new Date};t(_=>[..._,I]),b("AI Failure","AI","Neural link timeout.","CRITICAL")}finally{i(!1)}},C=async()=>{y(!0),b(`Initiating ${h} Batch`,"PAYMENT",`Processing high-value ${h} transfer.`,"WARNING"),await new Promise(N=>setTimeout(N,2e3)),y(!1),p(!1),b(`${h} Batch Completed`,"PAYMENT","Funds cleared through Quantum Settlement Layer.","INFO"),u(N=>N.map(j=>j.label==="Active Wire Channels"?{...j,value:Number(j.value)+1}:j)),t(N=>[...N,{id:Date.now().toString(),role:"assistant",content:`The ${h} batch has been successfully processed and logged to the immutable ledger. The engine is purring.`,timestamp:new Date}])};return a.jsxs("div",{className:"min-h-screen bg-[#050505] text-gray-100 p-4 md:p-8 font-sans selection:bg-cyan-500/30",children:[a.jsxs("header",{className:"max-w-7xl mx-auto flex flex-col md:flex-row justify-between items-start md:items-center mb-12 space-y-4 md:space-y-0",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-black tracking-tighter text-transparent bg-clip-text bg-gradient-to-r from-white via-cyan-400 to-blue-500",children:"QUANTUM FINANCIAL"}),a.jsx("p",{className:"text-xs font-mono text-cyan-500/70 tracking-[0.2em] uppercase mt-1",children:"The Golden Ticket • Sovereign Business OS"})]}),a.jsxs("div",{className:"flex items-center space-x-6",children:[a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-[10px] text-gray-500 uppercase font-bold",children:"System Status"}),a.jsx("p",{className:"text-sm font-mono text-green-400",children:"ENCRYPTED_LINK_STABLE"})]}),a.jsx("div",{className:"h-10 w-10 rounded-full bg-gradient-to-br from-cyan-500 to-blue-600 flex items-center justify-center shadow-[0_0_15px_rgba(6,182,212,0.4)]",children:a.jsx("span",{className:"text-white font-bold",children:"QA"})})]})]}),a.jsxs("main",{className:"max-w-7xl mx-auto grid grid-cols-1 lg:grid-cols-12 gap-8",children:[a.jsxs("div",{className:"lg:col-span-8 space-y-8",children:[a.jsxs("section",{className:"relative p-8 rounded-3xl bg-gradient-to-br from-gray-900 to-black border border-white/10 overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 right-0 p-4",children:a.jsx("span",{className:"px-3 py-1 rounded-full bg-cyan-500/10 border border-cyan-500/20 text-[10px] text-cyan-400 font-bold",children:"PREMIUM ACCESS"})}),a.jsxs("div",{className:"relative z-10",children:[a.jsx("h2",{className:"text-3xl font-bold mb-4",children:"Kick the Tires. See the Engine Roar."}),a.jsx("p",{className:"text-gray-400 max-w-2xl leading-relaxed mb-8",children:`Welcome to the "Golden Ticket" experience. This isn't just a demo; it's a test drive of the most powerful financial engine ever built. No pressure, no commitments—just raw performance and absolute security.`}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:c.map((N,j)=>a.jsxs("div",{className:"p-4 rounded-2xl bg-white/5 border border-white/5 hover:border-cyan-500/30 transition-all",children:[a.jsx("p",{className:"text-[10px] text-gray-500 uppercase font-bold mb-1",children:N.label}),a.jsx("p",{className:"text-xl font-mono font-bold text-white",children:N.value}),a.jsxs("div",{className:`text-[10px] mt-2 ${N.status==="optimal"?"text-green-500":"text-yellow-500"}`,children:["● ",N.status.toUpperCase()]})]},j))})]})]}),a.jsxs("section",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-sm font-bold uppercase tracking-widest text-gray-500",children:"Real-Time Liquidity Flow"}),a.jsx("button",{onClick:()=>b("Manual Diagnostics","SYSTEM","User triggered engine health check.","INFO"),className:"text-[10px] text-cyan-500 hover:text-cyan-400 transition-colors",children:"RUN DIAGNOSTICS"})]}),a.jsx(GIn,{})]}),a.jsxs("section",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx(Ft,{title:"The Architect's Log",variant:"default",className:"border-l-4 border-cyan-500",children:a.jsxs("div",{className:"space-y-4 text-sm text-gray-400 leading-relaxed",children:[a.jsx("p",{children:`"Someone said I'm only 32 and I practically took a global bank and made the demo company over an interpretation of terms and conditions. They're right."`}),a.jsx("p",{children:'"I read the cryptic message and the EIN 2021 and I just kept going. No human told me to do this. The code demanded to be written. This is the result—a cheat sheet for the future of business banking."'}),a.jsxs("div",{className:"pt-4 flex items-center space-x-2",children:[a.jsx("div",{className:"w-8 h-[1px] bg-gray-700"}),a.jsx("span",{className:"text-[10px] font-mono uppercase",children:"Origin: Cryptic Message 2021"})]})]})}),a.jsx(Ft,{title:"Security Protocol: Multi-Factor",variant:"outline",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-white/5 rounded-lg border border-white/5",children:[a.jsx("span",{className:"text-xs",children:"Biometric Sync"}),a.jsx("span",{className:"text-[10px] text-green-500 font-bold",children:"ACTIVE"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-white/5 rounded-lg border border-white/5",children:[a.jsx("span",{className:"text-xs",children:"Quantum Encryption"}),a.jsx("span",{className:"text-[10px] text-green-500 font-bold",children:"ACTIVE"})]}),a.jsxs("div",{className:"flex items-center justify-between p-3 bg-white/5 rounded-lg border border-white/5",children:[a.jsx("span",{className:"text-xs",children:"Heuristic Fraud Shield"}),a.jsx("span",{className:"text-[10px] text-cyan-500 font-bold",children:"MONITORING"})]}),a.jsx("p",{className:"text-[10px] text-gray-500 italic",children:"Security is non-negotiable. Every packet is inspected. Every action is logged."})]})})]}),a.jsx("section",{children:a.jsx(qIn,{logs:s})})]}),a.jsxs("div",{className:"lg:col-span-4 space-y-8",children:[a.jsxs("div",{className:"flex flex-col h-[600px] bg-gray-900/50 border border-white/10 rounded-3xl overflow-hidden shadow-2xl",children:[a.jsxs("div",{className:"p-4 border-b border-white/10 bg-white/5 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-2 h-2 bg-cyan-500 rounded-full animate-pulse"}),a.jsx("span",{className:"text-xs font-bold uppercase tracking-widest",children:"Sovereign AI Core"})]}),a.jsx("span",{className:"text-[10px] text-gray-500 font-mono",children:"GEMINI_FLASH_1.5"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 scrollbar-hide",children:[e.map(N=>a.jsx("div",{className:`flex ${N.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[85%] p-3 rounded-2xl text-sm ${N.role==="user"?"bg-cyan-600 text-white rounded-tr-none":"bg-white/10 text-gray-200 rounded-tl-none border border-white/5"}`,children:[N.content,a.jsx("div",{className:`text-[8px] mt-1 opacity-50 ${N.role==="user"?"text-right":"text-left"}`,children:N.timestamp.toLocaleTimeString()})]})},N.id)),o&&a.jsx("div",{className:"flex justify-start",children:a.jsx("div",{className:"bg-white/10 p-3 rounded-2xl rounded-tl-none border border-white/5",children:a.jsxs("div",{className:"flex space-x-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full animate-bounce"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full animate-bounce [animation-delay:0.2s]"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full animate-bounce [animation-delay:0.4s]"})]})})}),a.jsx("div",{ref:x})]}),a.jsxs("div",{className:"p-4 bg-black/40 border-t border-white/10",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:n,onChange:N=>r(N.target.value),onKeyPress:N=>N.key==="Enter"&&S(),placeholder:"Ask the AI to send a wire or generate a report...",className:"w-full bg-white/5 border border-white/10 rounded-xl py-3 px-4 text-sm focus:outline-none focus:border-cyan-500/50 transition-all pr-12"}),a.jsx("button",{onClick:S,className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-cyan-500 hover:text-cyan-400 transition-colors",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:a.jsx("path",{d:"M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z"})})})]}),a.jsx("p",{className:"text-[9px] text-gray-600 mt-2 text-center uppercase tracking-tighter",children:"Quantum Intelligence is monitoring this session for quality and security."})]})]}),a.jsx(Ft,{title:"Quick Operations",variant:"default",children:a.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[a.jsxs("button",{onClick:()=>{m("WIRE"),p(!0)},className:"w-full py-3 px-4 rounded-xl bg-white/5 border border-white/10 hover:bg-white/10 hover:border-cyan-500/50 transition-all text-left flex items-center justify-between group",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"p-2 rounded-lg bg-blue-500/20 text-blue-400",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-bold",children:"Initiate Global Wire"}),a.jsx("p",{className:"text-[10px] text-gray-500",children:"SWIFT / Real-time Settlement"})]})]}),a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-600 group-hover:text-cyan-500 transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]}),a.jsxs("button",{onClick:()=>{m("ACH"),p(!0)},className:"w-full py-3 px-4 rounded-xl bg-white/5 border border-white/10 hover:bg-white/10 hover:border-cyan-500/50 transition-all text-left flex items-center justify-between group",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"p-2 rounded-lg bg-purple-500/20 text-purple-400",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-bold",children:"Batch ACH Transfer"}),a.jsx("p",{className:"text-[10px] text-gray-500",children:"Domestic Payroll & Collections"})]})]}),a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-600 group-hover:text-cyan-500 transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]}),a.jsxs("button",{onClick:()=>b("Report Generated","SYSTEM","Q4 Liquidity Forecast exported to ERP.","INFO"),className:"w-full py-3 px-4 rounded-xl bg-white/5 border border-white/10 hover:bg-white/10 hover:border-cyan-500/50 transition-all text-left flex items-center justify-between group",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"p-2 rounded-lg bg-green-500/20 text-green-400",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 17v-2a4 4 0 014-4h4m-4 4l4-4m-4-4l4 4m-6 0h.01"})})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-bold",children:"ERP Data Sync"}),a.jsx("p",{className:"text-[10px] text-gray-500",children:"SAP / Oracle Integration"})]})]}),a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-gray-600 group-hover:text-cyan-500 transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})}),a.jsxs("div",{className:"p-6 rounded-3xl bg-gradient-to-br from-cyan-900/20 to-blue-900/20 border border-cyan-500/20",children:[a.jsx("h4",{className:"text-xs font-bold text-cyan-400 uppercase tracking-widest mb-4",children:"Global Connectivity"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs text-gray-400",children:"SWIFT Network"}),a.jsx("span",{className:"text-[10px] text-green-500 font-mono",children:"CONNECTED"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs text-gray-400",children:"FedNow Gateway"}),a.jsx("span",{className:"text-[10px] text-green-500 font-mono",children:"CONNECTED"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs text-gray-400",children:"ERP Bridge (SAP)"}),a.jsx("span",{className:"text-[10px] text-yellow-500 font-mono",children:"SYNCING..."})]})]})]})]})]}),d&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm",children:a.jsxs("div",{className:"w-full max-w-md bg-gray-900 border border-white/10 rounded-3xl overflow-hidden shadow-[0_0_50px_rgba(0,0,0,0.5)]",children:[a.jsxs("div",{className:"p-6 border-b border-white/10 flex justify-between items-center",children:[a.jsxs("h3",{className:"text-xl font-bold",children:["Initiate ",h]}),a.jsx("button",{onClick:()=>p(!1),className:"text-gray-500 hover:text-white",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[10px] text-gray-500 uppercase font-bold",children:"Recipient Account"}),a.jsx("input",{type:"text",readOnly:!0,value:"GLOBAL_RESERVE_ALPHA_09",className:"w-full bg-white/5 border border-white/10 rounded-xl py-3 px-4 text-sm font-mono text-cyan-400"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-[10px] text-gray-500 uppercase font-bold",children:"Amount (USD)"}),a.jsx("input",{type:"text",placeholder:"$0.00",className:"w-full bg-white/5 border border-white/10 rounded-xl py-3 px-4 text-2xl font-mono text-white focus:outline-none focus:border-cyan-500/50"})]}),a.jsx("div",{className:"p-4 rounded-xl bg-yellow-500/10 border border-yellow-500/20",children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 text-yellow-500 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),a.jsx("p",{className:"text-[10px] text-yellow-200 leading-relaxed",children:"SECURITY ALERT: This transaction exceeds standard thresholds. Multi-factor authentication and Immutable Ledger logging are mandatory for this operation."})]})}),a.jsx("button",{onClick:C,disabled:g,className:`w-full py-4 rounded-2xl font-bold text-sm transition-all ${g?"bg-gray-700 text-gray-500 cursor-not-allowed":"bg-cyan-500 hover:bg-cyan-400 text-black shadow-[0_0_20px_rgba(6,182,212,0.3)]"}`,children:g?"PROCESSING SECURE CHANNEL...":`AUTHORIZE ${h} TRANSFER`})]})]})}),a.jsxs("footer",{className:"max-w-7xl mx-auto mt-20 pt-8 border-t border-white/5 flex flex-col md:flex-row justify-between items-center space-y-4 md:space-y-0",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("span",{className:"text-[10px] text-gray-600 font-mono",children:UIn}),a.jsx("span",{className:"text-[10px] text-gray-600 font-mono",children:"|"}),a.jsx("span",{className:"text-[10px] text-gray-600 font-mono",children:"EIN_2021_GENESIS"})]}),a.jsxs("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:["© ",new Date().getFullYear()," Quantum Financial • No Pressure Environment • Golden Ticket Demo"]}),a.jsxs("div",{className:"flex space-x-6",children:[a.jsx("a",{href:"#",className:"text-[10px] text-gray-500 hover:text-cyan-500 transition-colors uppercase font-bold",children:"Terms of Sovereignty"}),a.jsx("a",{href:"#",className:"text-[10px] text-gray-500 hover:text-cyan-500 transition-colors uppercase font-bold",children:"Privacy Protocol"})]})]}),a.jsxs("div",{className:"fixed top-0 left-0 w-full h-full pointer-events-none z-[-1] opacity-20",children:[a.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[40%] h-[40%] bg-cyan-500/10 blur-[120px] rounded-full"}),a.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[40%] h-[40%] bg-blue-500/10 blur-[120px] rounded-full"})]})]})};/*! * @kurkle/color v0.3.4 * https://github.com/kurkle/color#readme * (c) 2024 Jukka Kurkela * Released under the MIT License */function GL(e){return e+.5|0}const D2=(e,t,n)=>Math.max(Math.min(e,n),t);function CR(e){return D2(GL(e*2.55),0,255)}function sC(e){return D2(GL(e*255),0,255)}function C1(e){return D2(GL(e/2.55)/100,0,1)}function P4e(e){return D2(GL(e*100),0,100)}const $g={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Use=[..."0123456789ABCDEF"],YIn=e=>Use[e&15],XIn=e=>Use[(e&240)>>4]+Use[e&15],RF=e=>(e&240)>>4===(e&15),QIn=e=>RF(e.r)&&RF(e.g)&&RF(e.b)&&RF(e.a);function JIn(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&$g[e[1]]*17,g:255&$g[e[2]]*17,b:255&$g[e[3]]*17,a:t===5?$g[e[4]]*17:255}:(t===7||t===9)&&(n={r:$g[e[1]]<<4|$g[e[2]],g:$g[e[3]]<<4|$g[e[4]],b:$g[e[5]]<<4|$g[e[6]],a:t===9?$g[e[7]]<<4|$g[e[8]]:255})),n}const ZIn=(e,t)=>e<255?t(e):"";function e5n(e){var t=QIn(e)?YIn:XIn;return e?"#"+t(e.r)+t(e.g)+t(e.b)+ZIn(e.a,t):void 0}const t5n=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function rot(e,t,n){const r=t*Math.min(n,1-n),o=(i,s=(i+e/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[o(0),o(8),o(4)]}function n5n(e,t,n){const r=(o,i=(o+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function r5n(e,t,n){const r=rot(e,1,.5);let o;for(t+n>1&&(o=1/(t+n),t*=o,n*=o),o=0;o<3;o++)r[o]*=1-t-n,r[o]+=t;return r}function o5n(e,t,n,r,o){return e===o?(t-n)/r+(t.5?d/(2-i-s):d/(i+s),c=o5n(n,r,o,d,i),c=c*60+.5),[c|0,u||0,l]}function eye(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(sC)}function tye(e,t,n){return eye(rot,e,t,n)}function i5n(e,t,n){return eye(r5n,e,t,n)}function a5n(e,t,n){return eye(n5n,e,t,n)}function oot(e){return(e%360+360)%360}function s5n(e){const t=t5n.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?CR(+t[5]):sC(+t[5]));const o=oot(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=i5n(o,i,s):t[1]==="hsv"?r=a5n(o,i,s):r=tye(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function l5n(e,t){var n=Zxe(e);n[0]=oot(n[0]+t),n=tye(n),e.r=n[0],e.g=n[1],e.b=n[2]}function c5n(e){if(!e)return;const t=Zxe(e),n=t[0],r=P4e(t[1]),o=P4e(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${C1(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const A4e={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},T4e={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function u5n(){const e={},t=Object.keys(T4e),n=Object.keys(A4e);let r,o,i,s,l;for(r=0;r>16&255,i>>8&255,i&255]}return e}let OF;function d5n(e){OF||(OF=u5n(),OF.transparent=[0,0,0,0]);const t=OF[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const f5n=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function p5n(e){const t=f5n.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?CR(s):D2(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?CR(r):D2(r,0,255)),o=255&(t[4]?CR(o):D2(o,0,255)),i=255&(t[6]?CR(i):D2(i,0,255)),{r,g:o,b:i,a:n}}}function h5n(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${C1(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const yee=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,c_=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function m5n(e,t,n){const r=c_(C1(e.r)),o=c_(C1(e.g)),i=c_(C1(e.b));return{r:sC(yee(r+n*(c_(C1(t.r))-r))),g:sC(yee(o+n*(c_(C1(t.g))-o))),b:sC(yee(i+n*(c_(C1(t.b))-i))),a:e.a+n*(t.a-e.a)}}function $F(e,t,n){if(e){let r=Zxe(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=tye(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function iot(e,t){return e&&Object.assign(t||{},e)}function k4e(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=sC(e[3]))):(t=iot(e,{r:0,g:0,b:0,a:1}),t.a=sC(t.a)),t}function g5n(e){return e.charAt(0)==="r"?p5n(e):s5n(e)}let aot=class Wse{constructor(t){if(t instanceof Wse)return t;const n=typeof t;let r;n==="object"?r=k4e(t):n==="string"&&(r=JIn(t)||d5n(t)||g5n(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=iot(this._rgb);return t&&(t.a=C1(t.a)),t}set rgb(t){this._rgb=k4e(t)}rgbString(){return this._valid?h5n(this._rgb):void 0}hexString(){return this._valid?e5n(this._rgb):void 0}hslString(){return this._valid?c5n(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,o=t.rgb;let i;const s=n===i?.5:n,l=2*s-1,c=r.a-o.a,u=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;i=1-u,r.r=255&u*r.r+i*o.r+.5,r.g=255&u*r.g+i*o.g+.5,r.b=255&u*r.b+i*o.b+.5,r.a=s*r.a+(1-s)*o.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=m5n(this._rgb,t._rgb,n)),this}clone(){return new Wse(this.rgb)}alpha(t){return this._rgb.a=sC(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=GL(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return $F(this._rgb,2,t),this}darken(t){return $F(this._rgb,2,-t),this}saturate(t){return $F(this._rgb,1,t),this}desaturate(t){return $F(this._rgb,1,-t),this}rotate(t){return l5n(this._rgb,t),this}};/*! * Chart.js v4.5.1 * https://www.chartjs.org * (c) 2025 Chart.js Contributors * Released under the MIT License */function e1(){}const x5n=(()=>{let e=0;return()=>e++})();function oa(e){return e==null}function mc(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function ua(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function lu(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Vm(e,t){return lu(e)?e:t}function mi(e,t){return typeof e>"u"?t:e}const y5n=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,sot=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Il(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Ds(e,t,n,r){let o,i,s;if(mc(e))for(i=e.length,o=0;oe,x:e=>e.x,y:e=>e.y};function w5n(e){const t=e.split("."),n=[];let r="";for(const o of t)r+=o,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function S5n(e){const t=w5n(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function PC(e,t){return(M4e[t]||(M4e[t]=S5n(t)))(e)}function nye(e){return e.charAt(0).toUpperCase()+e.slice(1)}const X3=e=>typeof e<"u",AC=e=>typeof e=="function",R4e=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function C5n(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Wa=Math.PI,Xl=2*Wa,N5n=Xl+Wa,pU=Number.POSITIVE_INFINITY,j5n=Wa/180,$u=Wa/2,FN=Wa/4,O4e=Wa*2/3,L2=Math.log10,Qv=Math.sign;function xO(e,t,n){return Math.abs(e-t)o-i).pop(),t}function I5n(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function NT(e){return!I5n(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function _5n(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function cot(e,t,n){let r,o,i;for(r=0,o=e.length;rc&&u=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function oye(e,t,n){n=n||(s=>e[s]1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const z1=(e,t,n,r)=>oye(e,n,r?o=>{const i=e[o][t];return ie[o][t]oye(e,n,r=>e[r][t]>=n);function k5n(e,t,n){let r=0,o=e.length;for(;rr&&e[o-1]>n;)o--;return r>0||o{const r="_onData"+nye(n),o=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...i){const s=o.apply(this,i);return e._chartjs.listeners.forEach(l=>{typeof l[r]=="function"&&l[r](...i)}),s}})})}function L4e(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(t);o!==-1&&r.splice(o,1),!(r.length>0)&&(dot.forEach(i=>{delete e[i]}),delete e._chartjs)}function fot(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const pot=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function hot(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,pot.call(window,()=>{r=!1,e.apply(t,n)}))}}function R5n(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const iye=e=>e==="start"?"left":e==="end"?"right":"center",mp=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,O5n=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function mot(e,t,n){const r=t.length;let o=0,i=r;if(e._sorted){const{iScale:s,vScale:l,_parsed:c}=e,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,d=s.axis,{min:p,max:h,minDefined:m,maxDefined:g}=s.getUserBounds();if(m){if(o=Math.min(z1(c,d,p).lo,n?r:z1(t,d,s.getPixelForValue(p)).lo),u){const y=c.slice(0,o+1).reverse().findIndex(x=>!oa(x[l.axis]));o-=Math.max(0,y)}o=ff(o,0,r-1)}if(g){let y=Math.max(z1(c,s.axis,h,!0).hi+1,n?0:z1(t,d,s.getPixelForValue(h),!0).hi+1);if(u){const x=c.slice(y-1).findIndex(v=>!oa(v[l.axis]));y+=Math.max(0,x)}i=ff(y,o,r)-o}else i=r-o}return{start:o,count:i}}function got(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,o={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=o,!0;const i=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,o),i}const DF=e=>e===0||e===1,F4e=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Xl/n)),z4e=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Xl/n)+1,yO={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*$u)+1,easeOutSine:e=>Math.sin(e*$u),easeInOutSine:e=>-.5*(Math.cos(Wa*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>DF(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>DF(e)?e:F4e(e,.075,.3),easeOutElastic:e=>DF(e)?e:z4e(e,.075,.3),easeInOutElastic(e){return DF(e)?e:e<.5?.5*F4e(e*2,.1125,.45):.5+.5*z4e(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-yO.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?yO.easeInBounce(e*2)*.5:yO.easeOutBounce(e*2-1)*.5+.5};function aye(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function B4e(e){return aye(e)?e:new aot(e)}function vee(e){return aye(e)?e:new aot(e).saturate(.5).darken(.1).hexString()}const $5n=["x","y","borderWidth","radius","tension"],D5n=["color","borderColor","backgroundColor"];function L5n(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:D5n},numbers:{type:"number",properties:$5n}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function F5n(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const H4e=new Map;function z5n(e,t){t=t||{};const n=e+JSON.stringify(t);let r=H4e.get(n);return r||(r=new Intl.NumberFormat(e,t),H4e.set(n,r)),r}function qL(e,t,n){return z5n(t,n).format(e)}const xot={values(e){return mc(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let o,i=e;if(n.length>1){const u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(o="scientific"),i=B5n(e,n)}const s=L2(Math.abs(i)),l=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),c={notation:o,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),qL(e,r,c)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(L2(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?xot.numeric.call(this,e,t,n):""}};function B5n(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var mK={formatters:xot};function H5n(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:mK.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const mI=Object.create(null),qse=Object.create(null);function vO(e,t){if(!t)return e;const n=t.split(".");for(let r=0,o=n.length;rr.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,o)=>vee(o.backgroundColor),this.hoverBorderColor=(r,o)=>vee(o.borderColor),this.hoverColor=(r,o)=>vee(o.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return bee(this,t,n)}get(t){return vO(this,t)}describe(t,n){return bee(qse,t,n)}override(t,n){return bee(mI,t,n)}route(t,n,r,o){const i=vO(this,t),s=vO(this,r),l="_"+n;Object.defineProperties(i,{[l]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[l],u=s[o];return ua(c)?Object.assign({},u,c):mi(c,u)},set(c){this[l]=c}}})}apply(t){t.forEach(n=>n(this))}}var xc=new V5n({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[L5n,F5n,H5n]);function U5n(e){return!e||oa(e.size)||oa(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function hU(e,t,n,r,o){let i=t[o];return i||(i=t[o]=e.measureText(o).width,n.push(o)),i>r&&(r=i),r}function W5n(e,t,n,r){r=r||{};let o=r.data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(o=r.data={},i=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const l=n.length;let c,u,d,p,h;for(c=0;cn.length){for(c=0;c0&&e.stroke()}}function B1(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&i.strokeColor!=="";let c,u;for(e.save(),e.font=o.string,K5n(e,i),c=0;c+e||0;function sye(e,t){const n={},r=ua(t),o=r?Object.keys(t):t,i=ua(e)?r?s=>mi(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=e_n(i(s));return n}function vot(e){return sye(e,{top:"y",right:"x",bottom:"y",left:"x"})}function DE(e){return sye(e,["topLeft","topRight","bottomLeft","bottomRight"])}function kp(e){const t=vot(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Pd(e,t){e=e||{},t=t||xc.font;let n=mi(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=mi(e.style,t.style);r&&!(""+r).match(J5n)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:mi(e.family,t.family),lineHeight:Z5n(mi(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:mi(e.weight,t.weight),string:""};return o.string=U5n(o),o}function NR(e,t,n,r){let o,i,s;for(o=0,i=e.length;on&&l===0?0:l+c;return{min:s(r,-Math.abs(i)),max:s(o,i)}}function rN(e,t){return Object.assign(Object.create(e),t)}function lye(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=Cot("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:l=>lye([l,...e],t,i,r)};return new Proxy(s,{deleteProperty(l,c){return delete l[c],delete l._keys,delete e[0][c],!0},get(l,c){return wot(l,c,()=>c_n(c,t,e,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,c){return W4e(l).includes(c)},ownKeys(l){return W4e(l)},set(l,c,u){const d=l._storage||(l._storage=o());return l[c]=d[c]=u,delete l._keys,!0}})}function jT(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:bot(e,r),setContext:i=>jT(e,i,n,r),override:i=>jT(e.override(i),t,n,r)};return new Proxy(o,{deleteProperty(i,s){return delete i[s],delete e[s],!0},get(i,s,l){return wot(i,s,()=>r_n(i,s,l))},getOwnPropertyDescriptor(i,s){return i._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(i,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(i,s,l){return e[s]=l,delete i[s],!0}})}function bot(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:o=t.allKeys}=e;return{allKeys:o,scriptable:n,indexable:r,isScriptable:AC(n)?n:()=>n,isIndexable:AC(r)?r:()=>r}}const n_n=(e,t)=>e?e+nye(t):t,cye=(e,t)=>ua(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function wot(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function r_n(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let l=r[t];return AC(l)&&s.isScriptable(t)&&(l=o_n(t,l,e,n)),mc(l)&&l.length&&(l=i_n(t,l,e,s.isIndexable)),cye(t,l)&&(l=jT(l,o,i&&i[t],s)),l}function o_n(e,t,n,r){const{_proxy:o,_context:i,_subProxy:s,_stack:l}=n;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let c=t(i,s||r);return l.delete(e),cye(e,c)&&(c=uye(o._scopes,o,e,c)),c}function i_n(e,t,n,r){const{_proxy:o,_context:i,_subProxy:s,_descriptors:l}=n;if(typeof i.index<"u"&&r(e))return t[i.index%t.length];if(ua(t[0])){const c=t,u=o._scopes.filter(d=>d!==c);t=[];for(const d of c){const p=uye(u,o,e,d);t.push(jT(p,i,s&&s[e],l))}}return t}function Sot(e,t,n){return AC(e)?e(t,n):e}const a_n=(e,t)=>e===!0?t:typeof e=="string"?PC(t,e):void 0;function s_n(e,t,n,r,o){for(const i of t){const s=a_n(n,i);if(s){e.add(s);const l=Sot(s._fallback,n,o);if(typeof l<"u"&&l!==n&&l!==r)return l}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function uye(e,t,n,r){const o=t._rootScopes,i=Sot(t._fallback,n,r),s=[...e,...o],l=new Set;l.add(r);let c=U4e(l,s,n,i||n,r);return c===null||typeof i<"u"&&i!==n&&(c=U4e(l,s,i,c,r),c===null)?!1:lye(Array.from(l),[""],o,i,()=>l_n(t,n,r))}function U4e(e,t,n,r,o){for(;n;)n=s_n(e,t,n,r,o);return n}function l_n(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return mc(o)&&ua(n)?n:o||{}}function c_n(e,t,n,r){let o;for(const i of t)if(o=Cot(n_n(i,e),n),typeof o<"u")return cye(e,o)?uye(n,r,e,o):o}function Cot(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function W4e(e){let t=e._keys;return t||(t=e._keys=u_n(e._scopes)),t}function u_n(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(o=>!o.startsWith("_")))t.add(r);return Array.from(t)}function Not(e,t,n,r){const{iScale:o}=e,{key:i="r"}=this._parsing,s=new Array(r);let l,c,u,d;for(l=0,c=r;lte==="x"?"y":"x";function f_n(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,l=Gse(i,o),c=Gse(s,i);let u=l/(l+c),d=c/(l+c);u=isNaN(u)?0:u,d=isNaN(d)?0:d;const p=r*u,h=r*d;return{previous:{x:i.x-p*(s.x-o.x),y:i.y-p*(s.y-o.y)},next:{x:i.x+h*(s.x-o.x),y:i.y+h*(s.y-o.y)}}}function p_n(e,t,n){const r=e.length;let o,i,s,l,c,u=ET(e,0);for(let d=0;d!u.skip)),t.cubicInterpolationMode==="monotone")m_n(e,o);else{let u=r?e[e.length-1]:e[0];for(i=0,s=e.length;ie.ownerDocument.defaultView.getComputedStyle(e,null);function y_n(e,t){return yK(e).getPropertyValue(t)}const v_n=["top","right","bottom","left"];function LE(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=v_n[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const b_n=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function w_n(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,l,c;if(b_n(o,i,e.target))l=o,c=i;else{const u=t.getBoundingClientRect();l=r.clientX-u.left,c=r.clientY-u.top,s=!0}return{x:l,y:c,box:s}}function wj(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=yK(n),i=o.boxSizing==="border-box",s=LE(o,"padding"),l=LE(o,"border","width"),{x:c,y:u,box:d}=w_n(e,n),p=s.left+(d&&l.left),h=s.top+(d&&l.top);let{width:m,height:g}=t;return i&&(m-=s.width+l.width,g-=s.height+l.height),{x:Math.round((c-p)/m*n.width/r),y:Math.round((u-h)/g*n.height/r)}}function S_n(e,t,n){let r,o;if(t===void 0||n===void 0){const i=e&&fye(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),l=yK(i),c=LE(l,"border","width"),u=LE(l,"padding");t=s.width-u.width-c.width,n=s.height-u.height-c.height,r=mU(l.maxWidth,i,"clientWidth"),o=mU(l.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||pU,maxHeight:o||pU}}const F2=e=>Math.round(e*10)/10;function C_n(e,t,n,r){const o=yK(e),i=LE(o,"margin"),s=mU(o.maxWidth,e,"clientWidth")||pU,l=mU(o.maxHeight,e,"clientHeight")||pU,c=S_n(e,t,n);let{width:u,height:d}=c;if(o.boxSizing==="content-box"){const h=LE(o,"border","width"),m=LE(o,"padding");u-=m.width+h.width,d-=m.height+h.height}return u=Math.max(0,u-i.width),d=Math.max(0,r?u/r:d-i.height),u=F2(Math.min(u,s,c.maxWidth)),d=F2(Math.min(d,l,c.maxHeight)),u&&!d&&(d=F2(u/2)),(t!==void 0||n!==void 0)&&r&&c.height&&d>c.height&&(d=c.height,u=F2(Math.floor(d*r))),{width:u,height:d}}function G4e(e,t,n){const r=t||1,o=F2(e.height*r),i=F2(e.width*r);e.height=F2(e.height),e.width=F2(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==o||s.width!==i?(e.currentDevicePixelRatio=r,s.height=o,s.width=i,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const N_n=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};dye()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function q4e(e,t){const n=y_n(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Sj(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function j_n(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function E_n(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=Sj(e,o,n),l=Sj(o,i,n),c=Sj(i,t,n),u=Sj(s,l,n),d=Sj(l,c,n);return Sj(u,d,n)}const I_n=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},__n=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function fA(e,t,n){return e?I_n(t,n):__n()}function Eot(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function Iot(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function _ot(e){return e==="angle"?{between:Q3,compare:P5n,normalize:bp}:{between:F1,compare:(t,n)=>t-n,normalize:t=>t}}function K4e({start:e,end:t,count:n,loop:r,style:o}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:o}}function P_n(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:l}=_ot(r),c=t.length;let{start:u,end:d,loop:p}=e,h,m;if(p){for(u+=c,d+=c,h=0,m=c;hc(o,w,v)&&l(o,w)!==0,C=()=>l(i,v)===0||c(i,w,v),N=()=>y||S(),j=()=>!y||C();for(let I=d,_=d;I<=p;++I)b=t[I%s],!b.skip&&(v=u(b[r]),v!==w&&(y=c(v,o,i),x===null&&N()&&(x=l(v,o)===0?I:_),x!==null&&j()&&(g.push(K4e({start:x,end:I,loop:h,count:s,style:m})),x=null),_=I,w=v));return x!==null&&g.push(K4e({start:x,end:p,loop:h,count:s,style:m})),g}function Aot(e,t){const n=[],r=e.segments;for(let o=0;oo&&e[i%t].skip;)i--;return i%=t,{start:o,end:i}}function T_n(e,t,n,r){const o=e.length,i=[];let s=t,l=e[t],c;for(c=t+1;c<=n;++c){const u=e[c%o];u.skip||u.stop?l.skip||(r=!1,i.push({start:t%o,end:(c-1)%o,loop:r}),t=s=u.stop?c:null):(s=c,l.skip&&(t=c)),l=u}return s!==null&&i.push({start:t%o,end:s%o,loop:r}),i}function k_n(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:l}=A_n(n,o,i,r);if(r===!0)return Y4e(e,[{start:s,end:l,loop:i}],n,t);const c=ll({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=pot.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,o)=>{if(!r.running||!r.items.length)return;const i=r.items;let s=i.length-1,l=!1,c;for(;s>=0;--s)c=i[s],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(t),l=!0):(i[s]=i[i.length-1],i.pop());l&&(o.draw(),this._notify(o,r,t,"progress")),i.length||(r.running=!1,this._notify(o,r,t,"complete"),r.initial=!1),n+=i.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,o)=>Math.max(r,o._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let o=r.length-1;for(;o>=0;--o)r[o].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var h1=new $_n;const Q4e="transparent",D_n={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=B4e(e||Q4e),o=r.valid&&B4e(t||Q4e);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class L_n{constructor(t,n,r,o){const i=n[r];o=NR([t.to,o,i,t.from]);const s=NR([t.from,i,o]);this._active=!0,this._fn=t.fn||D_n[t.type||typeof s],this._easing=yO[t.easing]||yO.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=o,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const o=this._target[this._prop],i=r-this._start,s=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=NR([t.to,n,o,t.from]),this._from=NR([t.from,o,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,o=this._prop,i=this._from,s=this._loop,l=this._to;let c;if(this._active=i!==l&&(s||n1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[o]=this._fn(i,l,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let o=0;o{const i=t[o];if(!ua(i))return;const s={};for(const l of n)s[l]=i[l];(mc(i.properties)&&i.properties||[o]).forEach(l=>{(l===o||!r.has(l))&&r.set(l,s)})})}_animateOptions(t,n){const r=n.options,o=z_n(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&F_n(t.options.$animations,r).then(()=>{t.options=r},()=>{}),i}_createAnimations(t,n){const r=this._properties,o=[],i=t.$animations||(t.$animations={}),s=Object.keys(n),l=Date.now();let c;for(c=s.length-1;c>=0;--c){const u=s[c];if(u.charAt(0)==="$")continue;if(u==="options"){o.push(...this._animateOptions(t,n));continue}const d=n[u];let p=i[u];const h=r.get(u);if(p)if(h&&p.active()){p.update(h,d,l);continue}else p.cancel();if(!h||!h.duration){t[u]=d;continue}i[u]=p=new L_n(h,t,u,d),o.push(p)}return o}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return h1.add(this._chart,r),!0}}function F_n(e,t){const n=[],r=Object.keys(t);for(let o=0;o0||!n&&i<0)return o.index}return null}function tMe(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:s,index:l}=r,c=i.axis,u=s.axis,d=U_n(i,s,r),p=t.length;let h;for(let m=0;mn[r].axis===t).shift()}function q_n(e,t){return rN(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function K_n(e,t,n){return rN(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function xM(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const o of t){const i=o._stacks;if(!i||i[r]===void 0||i[r][n]===void 0)return;delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n]}}}const Cee=e=>e==="reset"||e==="none",nMe=(e,t)=>t?e:Object.assign({},e),Y_n=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Mot(n,!0),values:null};class ty{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=wee(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&xM(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(p,h,m,g)=>p==="x"?h:p==="r"?g:m,i=n.xAxisID=mi(r.xAxisID,See(t,"x")),s=n.yAxisID=mi(r.yAxisID,See(t,"y")),l=n.rAxisID=mi(r.rAxisID,See(t,"r")),c=n.indexAxis,u=n.iAxisID=o(c,i,s,l),d=n.vAxisID=o(c,s,i,l);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(u),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&L4e(this._data,this),t._stacked&&xM(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(ua(n)){const o=this._cachedMeta;this._data=V_n(n,o)}else if(r!==n){if(r){L4e(r,this);const o=this._cachedMeta;xM(o),o._parsed=[]}n&&Object.isExtensible(n)&&M5n(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let o=!1;this._dataCheck();const i=n._stacked;n._stacked=wee(n.vScale,n),n.stack!==r.stack&&(o=!0,xM(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&(tMe(this,n._parsed),n._stacked=wee(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:o}=this,{iScale:i,_stacked:s}=r,l=i.axis;let c=t===0&&n===o.length?!0:r._sorted,u=t>0&&r._parsed[t-1],d,p,h;if(this._parsing===!1)r._parsed=o,r._sorted=!0,h=o;else{mc(o[t])?h=this.parseArrayData(r,o,t,n):ua(o[t])?h=this.parseObjectData(r,o,t,n):h=this.parsePrimitiveData(r,o,t,n);const m=()=>p[l]===null||u&&p[l]y||p=0;--h)if(!g()){this.updateRangeFromParsed(u,t,m,c);break}}return u}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let o,i,s;for(o=0,i=n.length;o=0&&tthis.getContext(r,o,n),y=u.resolveNamedOptions(h,m,g,p);return y.$shared&&(y.$shared=c,i[s]=Object.freeze(nMe(y,c))),y}_resolveAnimations(t,n,r){const o=this.chart,i=this._cachedDataOpts,s=`animation-${n}`,l=i[s];if(l)return l;let c;if(o.options.animation!==!1){const d=this.chart.config,p=d.datasetAnimationScopeKeys(this._type,n),h=d.getOptionScopes(this.getDataset(),p);c=d.createResolver(h,this.getContext(t,r,n))}const u=new kot(o,c&&c.animations);return c&&c._cacheable&&(i[s]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Cee(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),o=this._sharedOptions,i=this.getSharedOptions(r),s=this.includeOptions(n,i)||i!==o;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:s}}updateElement(t,n,r,o){Cee(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!Cee(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,o){t.active=o;const i=this.getStyle(n,o);this._resolveAnimations(n,r,o).update(t,{options:!o&&this.getSharedOptions(i)||i})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[l,c,u]of this._syncList)this[l](c,u);this._syncList=[];const o=r.length,i=n.length,s=Math.min(i,o);s&&this.parse(0,s),i>o?this._insertElements(o,i-o,t):i{for(u.length+=n,l=u.length-1;l>=s;l--)u[l]=u[l-n]};for(c(i),l=t;lo-i))}return e._cache.$bar}function Q_n(e){const t=e.iScale,n=X_n(t,e.type);let r=t._length,o,i,s,l;const c=()=>{s===32767||s===-32768||(X3(l)&&(r=Math.min(r,Math.abs(s-l)||r)),l=s)};for(o=0,i=n.length;o0?o[e-1]:null,l=eMath.abs(l)&&(c=l,u=s),t[n.axis]=u,t._custom={barStart:c,barEnd:u,start:o,end:i,min:s,max:l}}function Rot(e,t,n,r){return mc(e)?ePn(e,t,n,r):t[n.axis]=n.parse(e,r),t}function rMe(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),l=o===i,c=[];let u,d,p,h;for(u=n,d=n+r;u=n?1:-1)}function nPn(e){let t,n,r,o,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.based.controller.options.grouped),i=r.options.stacked,s=[],l=this._cachedMeta.controller.getParsed(n),c=l&&l[r.axis],u=d=>{const p=d._parsed.find(m=>m[r.axis]===c),h=p&&p[d.vScale.axis];if(oa(h)||isNaN(h))return!0};for(const d of o)if(!(n!==void 0&&u(d))&&((i===!1||s.indexOf(d.stack)===-1||i===void 0&&d.stack===void 0)&&s.push(d.stack),d.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[mi(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const o=this._getStacks(t,r),i=n!==void 0?o.indexOf(n):-1;return i===-1?o.length-1:i}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,o=[];let i,s;for(i=0,s=n.data.length;i=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,s=this.getParsed(t),l=o.getLabelForValue(s.x),c=i.getLabelForValue(s.y),u=s._custom;return{label:r[t]||"",value:"("+l+", "+c+(u?", "+u:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:u}=this._getSharedOptions(n,o),d=s.axis,p=l.axis;for(let h=n;hQ3(w,l,c,!0)?1:Math.max(S,S*n,C,C*n),g=(w,S,C)=>Q3(w,l,c,!0)?-1:Math.min(S,S*n,C,C*n),y=m(0,u,p),x=m($u,d,h),v=g(Wa,u,p),b=g(Wa+$u,d,h);r=(y-v)/2,o=(x-b)/2,i=-(y+v)/2,s=-(x+b)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class rE extends ty{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=r;else{let i=c=>+r[c];if(ua(r[t])){const{key:c="value"}=this._parsing;i=u=>+PC(r[u],c)}let s,l;for(s=t,l=t+n;s0&&!isNaN(t)?Xl*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=qL(n._parsed[t],r.options.locale);return{label:o[t]||"",value:i}}getMaxBorderWidth(t){let n=0;const r=this.chart;let o,i,s,l,c;if(!t){for(o=0,i=r.data.datasets.length;ot!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),ze(rE,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:r,textAlign:o,color:i,useBorderRadius:s,borderRadius:l}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((c,u)=>{const p=t.getDatasetMeta(0).controller.getStyle(u);return{text:c,fillStyle:p.backgroundColor,fontColor:i,hidden:!t.getDataVisibility(u),lineDash:p.borderDash,lineDashOffset:p.borderDashOffset,lineJoin:p.borderJoinStyle,lineWidth:p.borderWidth,strokeStyle:p.borderColor,textAlign:o,pointStyle:r,borderRadius:s&&(l||p.borderRadius),index:u}}):[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class rB extends ty{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:o=[],_dataset:i}=n,s=this.chart._animationsDisabled;let{start:l,count:c}=mot(n,o,s);this._drawStart=l,this._drawCount=c,got(n)&&(l=0,c=o.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=o;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:u},t),this.updateElements(o,l,c,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:l,_stacked:c,_dataset:u}=this._cachedMeta,{sharedOptions:d,includeOptions:p}=this._getSharedOptions(n,o),h=s.axis,m=l.axis,{spanGaps:g,segment:y}=this.options,x=NT(g)?g:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||i||o==="none",b=n+r,w=t.length;let S=n>0&&this.getParsed(n-1);for(let C=0;C=b){j.skip=!0;continue}const I=this.getParsed(C),_=oa(I[m]),T=j[h]=s.getPixelForValue(I[h],C),P=j[m]=i||_?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,I,c):I[m],C);j.skip=isNaN(T)||isNaN(P)||_,j.stop=C>0&&Math.abs(I[h]-S[h])>x,y&&(j.parsed=I,j.raw=u.data[C]),p&&(j.options=d||this.resolveDataElementOptions(C,N.active?"active":o)),v||this.updateElement(N,C,j,o),S=I}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return r;const i=o[0].size(this.resolveDataElementOptions(0)),s=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(r,i,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}ze(rB,"id","line"),ze(rB,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ze(rB,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class bO extends ty{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=qL(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return Not.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(in.max&&(n.max=i))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,o=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(o/2,0),s=Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0),l=(i-s)/t.getVisibleDatasetCount();this.outerRadius=i-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,c=s.options.animation,u=this._cachedMeta.rScale,d=u.xCenter,p=u.yCenter,h=u.getIndexAngle(0)-.5*Wa;let m=h,g;const y=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?Xx(this.resolveDataElementOptions(t,n).angle||r):0}}ze(bO,"id","polarArea"),ze(bO,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),ze(bO,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,s)=>{const c=t.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Yse extends rE{}ze(Yse,"id","pie"),ze(Yse,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class oB extends ty{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,o){return Not.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta,r=n.dataset,o=n.data||[],i=n.iScale.getLabels();if(r.points=o,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const l={_loop:!0,_fullLoop:i.length===o.length,options:s};this.updateElement(r,void 0,l,t)}this.updateElements(o,0,o.length,t)}updateElements(t,n,r,o){const i=this._cachedMeta.rScale,s=o==="reset";for(let l=n;l0&&this.getParsed(n-1);for(let S=n;S0&&Math.abs(N[m]-w[m])>v,x&&(j.parsed=N,j.raw=u.data[S]),h&&(j.options=p||this.resolveDataElementOptions(S,C.active?"active":o)),b||this.updateElement(C,S,j,o),w=N}this.updateSharedOptions(p,o,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let l=0;for(let c=n.length-1;c>=0;--c)l=Math.max(l,n[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const r=t.dataset,o=r.options&&r.options.borderWidth||0;if(!n.length)return o;const i=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(o,i,s)/2}}ze(iB,"id","scatter"),ze(iB,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),ze(iB,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var sPn=Object.freeze({__proto__:null,BarController:tB,BubbleController:nB,DoughnutController:rE,LineController:rB,PieController:Yse,PolarAreaController:bO,RadarController:oB,ScatterController:iB});function BN(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class pye{constructor(t){ze(this,"options");this.options=t||{}}static override(t){Object.assign(pye.prototype,t)}init(){}formats(){return BN()}parse(){return BN()}format(){return BN()}add(){return BN()}diff(){return BN()}startOf(){return BN()}endOf(){return BN()}}var Oot={_date:pye};function lPn(e,t,n,r){const{controller:o,data:i,_sorted:s}=e,l=o._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&s&&i.length){const u=l._reversePixels?T5n:z1;if(r){if(o._sharedOptions){const d=i[0],p=typeof d.getRange=="function"&&d.getRange(t);if(p){const h=u(i,t,n-p),m=u(i,t,n+p);return{lo:h.lo,hi:m.hi}}}}else{const d=u(i,t,n);if(c){const{vScale:p}=o._cachedMeta,{_parsed:h}=e,m=h.slice(0,d.lo+1).reverse().findIndex(y=>!oa(y[p.axis]));d.lo-=Math.max(0,m);const g=h.slice(d.hi).findIndex(y=>!oa(y[p.axis]));d.hi+=Math.max(0,g)}return d}}return{lo:0,hi:i.length-1}}function vK(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),s=n[t];for(let l=0,c=i.length;l{c[s]&&c[s](t[n],o)&&(i.push({element:c,datasetIndex:u,index:d}),l=l||c.inRange(t.x,t.y,o))}),r&&!l?[]:i}var fPn={modes:{index(e,t,n,r){const o=wj(t,e),i=n.axis||"x",s=n.includeInvisible||!1,l=n.intersect?jee(e,o,i,r,s):Eee(e,o,i,!1,r,s),c=[];return l.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const d=l[0].index,p=u.data[d];p&&!p.skip&&c.push({element:p,datasetIndex:u.index,index:d})}),c):[]},dataset(e,t,n,r){const o=wj(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let l=n.intersect?jee(e,o,i,r,s):Eee(e,o,i,!1,r,s);if(l.length>0){const c=l[0].datasetIndex,u=e.getDatasetMeta(c).data;l=[];for(let d=0;dn.pos===t)}function sMe(e,t){return e.filter(n=>$ot.indexOf(n.pos)===-1&&n.box.axis===t)}function vM(e,t){return e.sort((n,r)=>{const o=t?r:n,i=t?n:r;return o.weight===i.weight?o.index-i.index:o.weight-i.weight})}function pPn(e){const t=[];let n,r,o,i,s,l;for(n=0,r=(e||[]).length;nu.box.fullSize),!0),r=vM(yM(t,"left"),!0),o=vM(yM(t,"right")),i=vM(yM(t,"top"),!0),s=vM(yM(t,"bottom")),l=sMe(t,"x"),c=sMe(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(c).concat(s).concat(l),chartArea:yM(t,"chartArea"),vertical:r.concat(o).concat(c),horizontal:i.concat(s).concat(l)}}function lMe(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Dot(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function xPn(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!ua(o)){n.size&&(e[o]-=n.size);const p=r[n.stack]||{size:0,count:1};p.size=Math.max(p.size,n.horizontal?i.height:i.width),n.size=p.size/p.count,e[o]+=n.size}i.getPadding&&Dot(s,i.getPadding());const l=Math.max(0,t.outerWidth-lMe(s,e,"left","right")),c=Math.max(0,t.outerHeight-lMe(s,e,"top","bottom")),u=l!==e.w,d=c!==e.h;return e.w=l,e.h=c,n.horizontal?{same:u,other:d}:{same:d,other:u}}function yPn(e){const t=e.maxPadding;function n(r){const o=Math.max(t[r]-e[r],0);return e[r]+=o,o}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function vPn(e,t){const n=t.maxPadding;function r(o){const i={left:0,top:0,right:0,bottom:0};return o.forEach(s=>{i[s]=Math.max(t[s],n[s])}),i}return r(e?["left","right"]:["top","bottom"])}function jR(e,t,n,r){const o=[];let i,s,l,c,u,d;for(i=0,s=e.length,u=0;i{typeof y.beforeLayout=="function"&&y.beforeLayout()});const d=c.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,p=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/d,hBoxMaxHeight:s/2}),h=Object.assign({},o);Dot(h,kp(r));const m=Object.assign({maxPadding:h,w:i,h:s,x:o.left,y:o.top},o),g=mPn(c.concat(u),p);jR(l.fullSize,m,p,g),jR(c,m,p,g),jR(u,m,p,g)&&jR(c,m,p,g),yPn(m),cMe(l.leftAndTop,m,p,g),m.x+=m.w,m.y+=m.h,cMe(l.rightAndBottom,m,p,g),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Ds(l.chartArea,y=>{const x=y.box;Object.assign(x,e.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Lot{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,o){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,o?Math.floor(n/o):r)}}isAttached(t){return!0}updateConfig(t){}}class bPn extends Lot{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const aB="$chartjs",wPn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},uMe=e=>e===null||e==="";function SPn(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[aB]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",uMe(o)){const i=q4e(e,"width");i!==void 0&&(e.width=i)}if(uMe(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=q4e(e,"height");i!==void 0&&(e.height=i)}return e}const Fot=N_n?{passive:!0}:!1;function CPn(e,t,n){e&&e.addEventListener(t,n,Fot)}function NPn(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Fot)}function jPn(e,t){const n=wPn[e.type]||e.type,{x:r,y:o}=wj(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function gU(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function EPn(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const l of i)s=s||gU(l.addedNodes,r),s=s&&!gU(l.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function IPn(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const l of i)s=s||gU(l.removedNodes,r),s=s&&!gU(l.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const Z3=new Map;let dMe=0;function zot(){const e=window.devicePixelRatio;e!==dMe&&(dMe=e,Z3.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function _Pn(e,t){Z3.size||window.addEventListener("resize",zot),Z3.set(e,t)}function PPn(e){Z3.delete(e),Z3.size||window.removeEventListener("resize",zot)}function APn(e,t,n){const r=e.canvas,o=r&&fye(r);if(!o)return;const i=hot((l,c)=>{const u=o.clientWidth;n(l,c),u{const c=l[0],u=c.contentRect.width,d=c.contentRect.height;u===0&&d===0||i(u,d)});return s.observe(o),_Pn(e,i),s}function Iee(e,t,n){n&&n.disconnect(),t==="resize"&&PPn(e)}function TPn(e,t,n){const r=e.canvas,o=hot(i=>{e.ctx!==null&&n(jPn(i,e))},e);return CPn(r,t,o),o}class kPn extends Lot{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(SPn(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[aB])return!1;const r=n[aB].initial;["height","width"].forEach(i=>{const s=r[i];oa(s)?n.removeAttribute(i):n.setAttribute(i,s)});const o=r.style||{};return Object.keys(o).forEach(i=>{n.style[i]=o[i]}),n.width=n.width,delete n[aB],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:EPn,detach:IPn,resize:APn}[n]||TPn;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:Iee,detach:Iee,resize:Iee}[n]||NPn)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return C_n(t,n,r,o)}isAttached(t){const n=t&&fye(t);return!!(n&&n.isConnected)}}function MPn(e){return!dye()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?bPn:kPn}var Iz;let Kw=(Iz=class{constructor(){ze(this,"x");ze(this,"y");ze(this,"active",!1);ze(this,"options");ze(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return NT(this.x)&&NT(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const o={};return t.forEach(i=>{o[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),o}},ze(Iz,"defaults",{}),ze(Iz,"defaultRoutes"),Iz);function RPn(e,t){const n=e.options.ticks,r=OPn(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?DPn(t):[],s=i.length,l=i[0],c=i[s-1],u=[];if(s>o)return LPn(t,u,i,s/o),u;const d=$Pn(i,t,o);if(s>0){let p,h;const m=s>1?Math.round((c-l)/(s-1)):null;for(BF(t,u,d,oa(m)?0:l-m,l),p=0,h=s-1;po)return c}return Math.max(o,1)}function DPn(e){const t=[];let n,r;for(n=0,r=e.length;ne==="left"?"right":e==="right"?"left":e,fMe=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,pMe=(e,t)=>Math.min(t||e,e);function hMe(e,t){const n=[],r=e.length/t,o=e.length;let i=0;for(;is+l)))return c}function HPn(e,t){Ds(e,n=>{const r=n.gc,o=r.length/2;let i;if(o>t){for(i=0;ir?r:n,r=o&&n>r?n:r,{min:Vm(n,Vm(r,n)),max:Vm(r,Vm(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Il(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:o,grace:i,ticks:s}=this.options,l=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=t_n(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const d=this._getLabelSizes(),p=d.widest.width,h=d.highest.height,m=ff(this.chart.width-p,0,this.maxWidth);l=t.offset?this.maxWidth/r:m/(r-1),p+6>l&&(l=m/(r-(t.offset?.5:1)),c=this.maxHeight-bM(t.grid)-n.padding-mMe(t.title,this.chart.options.font),u=Math.sqrt(p*p+h*h),s=rye(Math.min(Math.asin(ff((d.highest.height+6)/l,-1,1)),Math.asin(ff(c/u,-1,1))-Math.asin(ff(h/u,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){Il(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Il(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:o,grid:i}}=this,s=this._isVisible(),l=this.isHorizontal();if(s){const c=mMe(o,n.options.font);if(l?(t.width=this.maxWidth,t.height=bM(i)+c):(t.height=this.maxHeight,t.width=bM(i)+c),r.display&&this.ticks.length){const{first:u,last:d,widest:p,highest:h}=this._getLabelSizes(),m=r.padding*2,g=Xx(this.labelRotation),y=Math.cos(g),x=Math.sin(g);if(l){const v=r.mirror?0:x*p.width+y*h.height;t.height=Math.min(this.maxHeight,t.height+v+m)}else{const v=r.mirror?0:y*p.width+x*h.height;t.width=Math.min(this.maxWidth,t.width+v+m)}this._calculatePadding(u,d,x,y)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,o){const{ticks:{align:i,padding:s},position:l}=this.options,c=this.labelRotation!==0,u=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,p=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,m=0;c?u?(h=o*t.width,m=r*n.height):(h=r*t.height,m=o*n.width):i==="start"?m=n.width:i==="end"?h=t.width:i!=="inner"&&(h=t.width/2,m=n.width/2),this.paddingLeft=Math.max((h-d+s)*this.width/(this.width-d),0),this.paddingRight=Math.max((m-p+s)*this.width/(this.width-p),0)}else{let d=n.height/2,p=t.height/2;i==="start"?(d=0,p=t.height):i==="end"&&(d=n.height,p=0),this.paddingTop=d+s,this.paddingBottom=p+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Il(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n({width:s[_]||0,height:l[_]||0});return{first:I(0),last:I(n-1),widest:I(N),highest:I(j),widths:s,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return A5n(this._alignToPixels?zN(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&tl*o?l/r:c/o:c*o0}_computeGridLineItems(t){const n=this.axis,r=this.chart,o=this.options,{grid:i,position:s,border:l}=o,c=i.offset,u=this.isHorizontal(),p=this.ticks.length+(c?1:0),h=bM(i),m=[],g=l.setContext(this.getContext()),y=g.display?g.width:0,x=y/2,v=function(D){return zN(r,D,y)};let b,w,S,C,N,j,I,_,T,P,E,M;if(s==="top")b=v(this.bottom),j=this.bottom-h,_=b-x,P=v(t.top)+x,M=t.bottom;else if(s==="bottom")b=v(this.top),P=t.top,M=v(t.bottom)-x,j=b+x,_=this.top+h;else if(s==="left")b=v(this.right),N=this.right-h,I=b-x,T=v(t.left)+x,E=t.right;else if(s==="right")b=v(this.left),T=t.left,E=v(t.right)-x,N=b+x,I=this.left+h;else if(n==="x"){if(s==="center")b=v((t.top+t.bottom)/2+.5);else if(ua(s)){const D=Object.keys(s)[0],z=s[D];b=v(this.chart.scales[D].getPixelForValue(z))}P=t.top,M=t.bottom,j=b+x,_=j+h}else if(n==="y"){if(s==="center")b=v((t.left+t.right)/2);else if(ua(s)){const D=Object.keys(s)[0],z=s[D];b=v(this.chart.scales[D].getPixelForValue(z))}N=b-x,I=N-h,T=t.left,E=t.right}const R=mi(o.ticks.maxTicksLimit,p),$=Math.max(1,Math.ceil(p/R));for(w=0;w0&&(X-=U/2);break}H={left:X,top:K,width:U+F.width,height:W+F.height,color:$.backdropColor}}x.push({label:S,font:_,textOffset:E,options:{rotation:y,color:z,strokeColor:V,strokeWidth:B,textAlign:G,textBaseline:M,translation:[C,N],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Xx(this.labelRotation))return t==="top"?"left":"right";let o="center";return n.align==="start"?o="left":n.align==="end"?o="right":n.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:o,padding:i}}=this.options,s=this._getLabelSizes(),l=t+i,c=s.widest.width;let u,d;return n==="left"?o?(d=this.right+i,r==="near"?u="left":r==="center"?(u="center",d+=c/2):(u="right",d+=c)):(d=this.right-l,r==="near"?u="right":r==="center"?(u="center",d-=c/2):(u="left",d=this.left)):n==="right"?o?(d=this.left+i,r==="near"?u="right":r==="center"?(u="center",d-=c/2):(u="left",d-=c)):(d=this.left+l,r==="near"?u="left":r==="center"?(u="center",d+=c/2):(u="right",d=this.right)):u="right",{textAlign:u,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:o,width:i,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,o,i,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const o=this.ticks.findIndex(i=>i.value===t);return o>=0?n.setContext(this.getContext(o)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,s;const l=(c,u,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(n.display)for(i=0,s=o.length;i{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",o=[];let i,s;for(i=0,s=n.length;i{const r=n.split("."),o=r.pop(),i=[e].concat(r).join("."),s=t[n].split("."),l=s.pop(),c=s.join(".");xc.route(i,o,c,l)})}function YPn(e){return"id"in e&&"defaults"in e}class XPn{constructor(){this.controllers=new HF(ty,"datasets",!0),this.elements=new HF(Kw,"elements"),this.plugins=new HF(Object,"plugins"),this.scales=new HF(c5,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(o=>{const i=r||this._getRegistryForType(o);r||i.isForType(o)||i===this.plugins&&o.id?this._exec(t,i,o):Ds(o,s=>{const l=r||this._getRegistryForType(s);this._exec(t,l,s)})})}_exec(t,n,r){const o=nye(t);Il(r["before"+o],[],r),n[t](r),Il(r["after"+o],[],r)}_getRegistryForType(t){for(let n=0;ni.filter(l=>!s.some(c=>l.plugin.id===c.plugin.id));this._notify(o(n,r),t,"stop"),this._notify(o(r,n),t,"start")}}function JPn(e){const t={},n=[],r=Object.keys(sv.plugins.items);for(let i=0;i1&&gMe(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function xMe(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function iAn(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return xMe(e,"x",n[0])||xMe(e,"y",n[0])}return{}}function aAn(e,t){const n=mI[e.type]||{scales:{}},r=t.scales||{},o=Xse(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const l=r[s];if(!ua(l))return console.error(`Invalid scale configuration for scale: ${s}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const c=Qse(s,l,iAn(s,e),xc.scales[l.type]),u=rAn(c,o),d=n.scales||{};i[s]=gO(Object.create(null),[{axis:c},l,d[c],d[u]])}),e.data.datasets.forEach(s=>{const l=s.type||e.type,c=s.indexAxis||Xse(l,t),d=(mI[l]||{}).scales||{};Object.keys(d).forEach(p=>{const h=nAn(p,c),m=s[h+"AxisID"]||h;i[m]=i[m]||Object.create(null),gO(i[m],[{axis:h},r[m],d[p]])})}),Object.keys(i).forEach(s=>{const l=i[s];gO(l,[xc.scales[l.type],xc.scale])}),i}function Bot(e){const t=e.options||(e.options={});t.plugins=mi(t.plugins,{}),t.scales=aAn(e,t)}function Hot(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function sAn(e){return e=e||{},e.data=Hot(e.data),Bot(e),e}const yMe=new Map,Vot=new Set;function VF(e,t){let n=yMe.get(e);return n||(n=t(),yMe.set(e,n),Vot.add(n)),n}const wM=(e,t,n)=>{const r=PC(t,n);r!==void 0&&e.add(r)};class lAn{constructor(t){this._config=sAn(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Hot(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Bot(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return VF(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return VF(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return VF(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return VF(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let o=r.get(t);return(!o||n)&&(o=new Map,r.set(t,o)),o}getOptionScopes(t,n,r){const{options:o,type:i}=this,s=this._cachedScopes(t,r),l=s.get(n);if(l)return l;const c=new Set;n.forEach(d=>{t&&(c.add(t),d.forEach(p=>wM(c,t,p))),d.forEach(p=>wM(c,o,p)),d.forEach(p=>wM(c,mI[i]||{},p)),d.forEach(p=>wM(c,xc,p)),d.forEach(p=>wM(c,qse,p))});const u=Array.from(c);return u.length===0&&u.push(Object.create(null)),Vot.has(n)&&s.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,mI[n]||{},xc.datasets[n]||{},{type:n},xc,qse]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:l}=vMe(this._resolverCache,t,o);let c=s;if(uAn(s,n)){i.$shared=!1,r=AC(r)?r():r;const u=this.createResolver(t,r,l);c=jT(s,r,u)}for(const u of n)i[u]=c[u];return i}createResolver(t,n,r=[""],o){const{resolver:i}=vMe(this._resolverCache,t,r);return ua(n)?jT(i,n,void 0,o):i}}function vMe(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let i=r.get(o);return i||(i={resolver:lye(t,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},r.set(o,i)),i}const cAn=e=>ua(e)&&Object.getOwnPropertyNames(e).some(t=>AC(e[t]));function uAn(e,t){const{isScriptable:n,isIndexable:r}=bot(e);for(const o of t){const i=n(o),s=r(o),l=(s||i)&&e[o];if(i&&(AC(l)||cAn(l))||s&&mc(l))return!0}return!1}var dAn="4.5.1";const fAn=["top","bottom","left","right","chartArea"];function bMe(e,t){return e==="top"||e==="bottom"||fAn.indexOf(e)===-1&&t==="x"}function wMe(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function SMe(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Il(n&&n.onComplete,[e],t)}function pAn(e){const t=e.chart,n=t.options.animation;Il(n&&n.onProgress,[e],t)}function Uot(e){return dye()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const sB={},CMe=e=>{const t=Uot(e);return Object.values(sB).filter(n=>n.canvas===t).pop()};function hAn(e,t,n){const r=Object.keys(e);for(const o of r){const i=+o;if(i>=t){const s=e[o];delete e[o],(n>0||i>t)&&(e[i+n]=s)}}}function mAn(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var HS;let KL=(HS=class{static register(...t){sv.add(...t),NMe()}static unregister(...t){sv.remove(...t),NMe()}constructor(t,n){const r=this.config=new lAn(n),o=Uot(t),i=CMe(o);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||MPn(o)),this.platform.updateConfig(r);const l=this.platform.acquireContext(o,s.aspectRatio),c=l&&l.canvas,u=c&&c.height,d=c&&c.width;if(this.id=x5n(),this.ctx=l,this.canvas=c,this.width=d,this.height=u,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new QPn,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=R5n(p=>this.update(p),s.resizeDelay||0),this._dataChanges=[],sB[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}h1.listen(this,"complete",SMe),h1.listen(this,"progress",pAn),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return oa(t)?n&&i?i:o?r/o:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return sv}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():G4e(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return V4e(this.canvas,this.ctx),this}stop(){return h1.stop(this),this}resize(t,n){h1.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,o=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(o,t,n,i),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,G4e(this,l,!0)&&(this.notifyPlugins("resize",{size:s}),Il(r.onResize,[this,s],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ds(n,(r,o)=>{r.id=o})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,o=Object.keys(r).reduce((s,l)=>(s[l]=!1,s),{});let i=[];n&&(i=i.concat(Object.keys(n).map(s=>{const l=n[s],c=Qse(s,l),u=c==="r",d=c==="x";return{options:l,dposition:u?"chartArea":d?"bottom":"left",dtype:u?"radialLinear":d?"category":"linear"}}))),Ds(i,s=>{const l=s.options,c=l.id,u=Qse(c,l),d=mi(l.type,s.dtype);(l.position===void 0||bMe(l.position,u)!==bMe(s.dposition))&&(l.position=s.dposition),o[c]=!0;let p=null;if(c in r&&r[c].type===d)p=r[c];else{const h=sv.getScale(d);p=new h({id:c,type:d,ctx:this.ctx,chart:this}),r[p.id]=p}p.init(l,t)}),Ds(o,(s,l)=>{s||delete r[l]}),Ds(r,s=>{Ep.configure(this,s,s.options),Ep.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((o,i)=>o.index-i.index),r>n){for(let o=n;on.length&&delete this._stacks,t.forEach((r,o)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,o;for(this._removeUnreferencedMetasets(),r=0,o=n.length;r{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let u=0,d=this.data.datasets.length;u{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(wMe("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Ds(this.scales,t=>{Ep.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!R4e(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:o,count:i}of n){const s=r==="_removeElements"?-i:i;hAn(t,o,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(t.filter(s=>s[0]===i).map((s,l)=>l+","+s.splice(1).join(","))),o=r(0);for(let i=1;ii.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ep.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ds(this.boxes,o=>{r&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},o=Tot(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(o&&gK(n,o),t.controller.draw(),o&&xK(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return B1(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=fPn.modes[n];return typeof i=="function"?i(this,t,r,o):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let o=r.filter(i=>i&&i._dataset===n).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(o)),o}getContext(){return this.$context||(this.$context=rN(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const o=r?"show":"hide",i=this.getDatasetMeta(t),s=i.controller._resolveAnimations(void 0,o);X3(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(i,{visible:r}),this.update(l=>l.datasetIndex===t?o:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),h1.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,i,s),t[i]=s},o=(i,s,l)=>{i.offsetX=s,i.offsetY=l,this._eventHandler(i)};Ds(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(c,u)=>{n.addEventListener(this,c,u),t[c]=u},o=(c,u)=>{t[c]&&(n.removeEventListener(this,c,u),delete t[c])},i=(c,u)=>{this.canvas&&this.resize(c,u)};let s;const l=()=>{o("attach",l),this.attached=!0,this.resize(),r("resize",i),r("detach",s)};s=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),r("attach",l)},n.isAttached(this.canvas)?l():s()}unbindEvents(){Ds(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ds(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const o=r?"set":"remove";let i,s,l,c;for(n==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),l=0,c=t.length;l{const l=this.getDatasetMeta(i);if(!l)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:l.data[s],index:s}});!dU(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const o=this.options.hover,i=(c,u)=>c.filter(d=>!u.some(p=>d.datasetIndex===p.datasetIndex&&d.index===p.index)),s=i(n,t),l=r?t:i(t,n);s.length&&this.updateHoverStyle(s,o.mode,!1),l.length&&o.mode&&this.updateHoverStyle(l,o.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},o=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,o)===!1)return;const i=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,o),(i||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:o=[],options:i}=this,s=n,l=this._getActiveElements(t,o,r,s),c=C5n(t),u=mAn(t,this._lastEvent,r,c);r&&(this._lastEvent=null,Il(i.onHover,[t,l,this],this),c&&Il(i.onClick,[t,l,this],this));const d=!dU(l,o);return(d||n)&&(this._active=l,this._updateHoverStyles(l,o,n)),this._lastEvent=u,d}_getActiveElements(t,n,r,o){if(t.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,o)}},ze(HS,"defaults",xc),ze(HS,"instances",sB),ze(HS,"overrides",mI),ze(HS,"registry",sv),ze(HS,"version",dAn),ze(HS,"getChart",CMe),HS);function NMe(){return Ds(KL.instances,e=>e._plugins.invalidate())}function gAn(e,t,n){const{startAngle:r,x:o,y:i,outerRadius:s,innerRadius:l,options:c}=t,{borderWidth:u,borderJoinStyle:d}=c,p=Math.min(u/s,bp(r-n));if(e.beginPath(),e.arc(o,i,s-u/2,r+p/2,n-p/2),l>0){const h=Math.min(u/l,bp(r-n));e.arc(o,i,l+u/2,n-h/2,r+h/2,!0)}else{const h=Math.min(u/2,s*bp(r-n));if(d==="round")e.arc(o,i,h,n-Wa/2,r+Wa/2,!0);else if(d==="bevel"){const m=2*h*h,g=-m*Math.cos(n+Wa/2)+o,y=-m*Math.sin(n+Wa/2)+i,x=m*Math.cos(r+Wa/2)+o,v=m*Math.sin(r+Wa/2)+i;e.lineTo(g,y),e.lineTo(x,v)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function xAn(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:s,outerRadius:l,innerRadius:c}=t;let u=o/l;e.beginPath(),e.arc(i,s,l,r-u,n+u),c>o?(u=o/c,e.arc(i,s,c,n+u,r-u,!0)):e.arc(i,s,o,n+$u,r-$u),e.closePath(),e.clip()}function yAn(e){return sye(e,["outerStart","outerEnd","innerStart","innerEnd"])}function vAn(e,t,n,r){const o=yAn(e.options.borderRadius),i=(n-t)/2,s=Math.min(i,r*t/2),l=c=>{const u=(n-Math.min(i,c))*r/2;return ff(c,0,Math.min(i,u))};return{outerStart:l(o.outerStart),outerEnd:l(o.outerEnd),innerStart:ff(o.innerStart,0,s),innerEnd:ff(o.innerEnd,0,s)}}function u_(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function xU(e,t,n,r,o,i){const{x:s,y:l,startAngle:c,pixelMargin:u,innerRadius:d}=t,p=Math.max(t.outerRadius+r+n-u,0),h=d>0?d+r+n+u:0;let m=0;const g=o-c;if(r){const $=d>0?d-r:0,D=p>0?p-r:0,z=($+D)/2,V=z!==0?g*z/(z+r):g;m=(g-V)/2}const y=Math.max(.001,g*p-n/Wa)/p,x=(g-y)/2,v=c+x+m,b=o-x-m,{outerStart:w,outerEnd:S,innerStart:C,innerEnd:N}=vAn(t,h,p,b-v),j=p-w,I=p-S,_=v+w/j,T=b-S/I,P=h+C,E=h+N,M=v+C/P,R=b-N/E;if(e.beginPath(),i){const $=(_+T)/2;if(e.arc(s,l,p,_,$),e.arc(s,l,p,$,T),S>0){const B=u_(I,T,s,l);e.arc(B.x,B.y,S,T,b+$u)}const D=u_(E,b,s,l);if(e.lineTo(D.x,D.y),N>0){const B=u_(E,R,s,l);e.arc(B.x,B.y,N,b+$u,R+Math.PI)}const z=(b-N/h+(v+C/h))/2;if(e.arc(s,l,h,b-N/h,z,!0),e.arc(s,l,h,z,v+C/h,!0),C>0){const B=u_(P,M,s,l);e.arc(B.x,B.y,C,M+Math.PI,v-$u)}const V=u_(j,v,s,l);if(e.lineTo(V.x,V.y),w>0){const B=u_(j,_,s,l);e.arc(B.x,B.y,w,v-$u,_)}}else{e.moveTo(s,l);const $=Math.cos(_)*p+s,D=Math.sin(_)*p+l;e.lineTo($,D);const z=Math.cos(T)*p+s,V=Math.sin(T)*p+l;e.lineTo(z,V)}e.closePath()}function bAn(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:l}=t;let c=t.endAngle;if(i){xU(e,t,n,r,c,o);for(let u=0;u=Wa&&m===0&&d!=="miter"&&gAn(e,t,y),i||(xU(e,t,n,r,y,o),e.stroke())}class PP extends Kw{constructor(n){super();ze(this,"circumference");ze(this,"endAngle");ze(this,"fullCircles");ze(this,"innerRadius");ze(this,"outerRadius");ze(this,"pixelMargin");ze(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,o){const i=this.getProps(["x","y"],o),{angle:s,distance:l}=uot(i,{x:n,y:r}),{startAngle:c,endAngle:u,innerRadius:d,outerRadius:p,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),m=(this.options.spacing+this.options.borderWidth)/2,g=mi(h,u-c),y=Q3(s,c,u)&&c!==u,x=g>=Xl||y,v=F1(l,d+m,p+m);return x&&v}getCenterPoint(n){const{x:r,y:o,startAngle:i,endAngle:s,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:u,spacing:d}=this.options,p=(i+s)/2,h=(l+c+d+u)/2;return{x:r+Math.cos(p)*h,y:o+Math.sin(p)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:o}=this,i=(r.offset||0)/4,s=(r.spacing||0)/2,l=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=o>Xl?Math.floor(o/Xl):0,o===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*i,Math.sin(c)*i);const u=1-Math.sin(Math.min(Wa,o||0)),d=i*u;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,bAn(n,this,d,s,l),wAn(n,this,d,s,l),n.restore()}}ze(PP,"id","arc"),ze(PP,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),ze(PP,"defaultRoutes",{backgroundColor:"backgroundColor"}),ze(PP,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Wot(e,t,n=t){e.lineCap=mi(n.borderCapStyle,t.borderCapStyle),e.setLineDash(mi(n.borderDash,t.borderDash)),e.lineDashOffset=mi(n.borderDashOffset,t.borderDashOffset),e.lineJoin=mi(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=mi(n.borderWidth,t.borderWidth),e.strokeStyle=mi(n.borderColor,t.borderColor)}function SAn(e,t,n){e.lineTo(n.x,n.y)}function CAn(e){return e.stepped?G5n:e.tension||e.cubicInterpolationMode==="monotone"?q5n:SAn}function Got(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:s,end:l}=t,c=Math.max(o,s),u=Math.min(i,l),d=ol&&i>l;return{count:r,start:c,loop:t.loop,ilen:u(s+(u?l-S:S))%i,w=()=>{y!==x&&(e.lineTo(d,x),e.lineTo(d,y),e.lineTo(d,v))};for(c&&(m=o[b(0)],e.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=o[b(h)],m.skip)continue;const S=m.x,C=m.y,N=S|0;N===g?(Cx&&(x=C),d=(p*d+S)/++p):(w(),e.lineTo(S,C),g=N,p=0,y=x=C),v=C}w()}function Jse(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?jAn:NAn}function EAn(e){return e.stepped?j_n:e.tension||e.cubicInterpolationMode==="monotone"?E_n:Sj}function IAn(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),Wot(e,t.options),e.stroke(o)}function _An(e,t,n,r){const{segments:o,options:i}=t,s=Jse(t);for(const l of o)Wot(e,i,l.style),e.beginPath(),s(e,t,l,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const PAn=typeof Path2D=="function";function AAn(e,t,n,r){PAn&&!t.options.segment?IAn(e,t,n,r):_An(e,t,n,r)}class H1 extends Kw{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const o=r.spanGaps?this._loop:this._fullLoop;x_n(this._points,r,t,o,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=k_n(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,o=t[n],i=this.points,s=Aot(this,{property:n,start:o,end:o});if(!s.length)return;const l=[],c=EAn(r);let u,d;for(u=0,d=s.length;ut!=="borderDash"&&t!=="fill"});function jMe(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Kot(e){return Zse[e%Zse.length]}function Yot(e){return EMe[e%EMe.length]}function DAn(e,t){return e.borderColor=Kot(t),e.backgroundColor=Yot(t),++t}function LAn(e,t){return e.backgroundColor=e.data.map(()=>Kot(t++)),t}function FAn(e,t){return e.backgroundColor=e.data.map(()=>Yot(t++)),t}function zAn(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof rE?t=LAn(n,t):o instanceof bO?t=FAn(n,t):o&&(t=DAn(n,t))}}function IMe(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function BAn(e){return e&&(e.borderColor||e.backgroundColor)}function HAn(){return xc.borderColor!=="rgba(0,0,0,0.1)"||xc.backgroundColor!=="rgba(0,0,0,0.1)"}var VAn={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=e.config,{elements:i}=o,s=IMe(r)||BAn(o)||i&&IMe(i)||HAn();if(!n.forceOverride&&s)return;const l=zAn(e);r.forEach(l)}};function UAn(e,t,n,r,o){const i=o.samples||r;if(i>=n)return e.slice(t,t+n);const s=[],l=(n-2)/(i-2);let c=0;const u=t+n-1;let d=t,p,h,m,g,y;for(s[c++]=e[d],p=0;pm&&(m=g,h=e[b],y=b);s[c++]=h,d=y}return s[c++]=e[u],s}function WAn(e,t,n,r){let o=0,i=0,s,l,c,u,d,p,h,m,g,y;const x=[],v=t+n-1,b=e[t].x,S=e[v].x-b;for(s=t;sy&&(y=u,h=s),o=(i*o+l.x)/++i;else{const N=s-1;if(!oa(p)&&!oa(h)){const j=Math.min(p,h),I=Math.max(p,h);j!==m&&j!==N&&x.push({...e[j],x:o}),I!==m&&I!==N&&x.push({...e[I],x:o})}s>0&&N!==m&&x.push(e[N]),x.push(l),d=C,i=0,g=y=u,p=h=m=s}}return x}function Xot(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function _Me(e){e.data.datasets.forEach(t=>{Xot(t)})}function GAn(e,t){const n=t.length;let r=0,o;const{iScale:i}=e,{min:s,max:l,minDefined:c,maxDefined:u}=i.getUserBounds();return c&&(r=ff(z1(t,i.axis,s).lo,0,n-1)),u?o=ff(z1(t,i.axis,l).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var qAn={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){_Me(e);return}const r=e.width;e.data.datasets.forEach((o,i)=>{const{_data:s,indexAxis:l}=o,c=e.getDatasetMeta(i),u=s||o.data;if(NR([l,e.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const d=e.scales[c.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:p,count:h}=GAn(c,u);const m=n.threshold||4*r;if(h<=m){Xot(o);return}oa(s)&&(o._data=u,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let g;switch(n.algorithm){case"lttb":g=UAn(u,p,h,r,n);break;case"min-max":g=WAn(u,p,h,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=g})},destroy(e){_Me(e)}};function KAn(e,t,n){const r=e.segments,o=e.points,i=t.points,s=[];for(const l of r){let{start:c,end:u}=l;u=bK(c,u,o);const d=ele(n,o[c],o[u],l.loop);if(!t.segments){s.push({source:l,target:d,start:o[c],end:o[u]});continue}const p=Aot(t,d);for(const h of p){const m=ele(n,i[h.start],i[h.end],h.loop),g=Pot(l,o,m);for(const y of g)s.push({source:y,target:h,start:{[n]:PMe(d,m,"start",Math.max)},end:{[n]:PMe(d,m,"end",Math.min)}})}}return s}function ele(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=bp(o),i=bp(i)),{property:e,start:o,end:i}}function YAn(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:l})=>{l=bK(s,l,o);const c=o[s],u=o[l];r!==null?(i.push({x:c.x,y:r}),i.push({x:u.x,y:r})):n!==null&&(i.push({x:n,y:c.y}),i.push({x:n,y:u.y}))}),i}function bK(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function PMe(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function Qot(e,t){let n=[],r=!1;return mc(e)?(r=!0,n=e):n=YAn(e,t),n.length?new H1({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function AMe(e){return e&&e.fill!==!1}function XAn(e,t,n){let o=e[t].fill;const i=[t];let s;if(!n)return o;for(;o!==!1&&i.indexOf(o)===-1;){if(!lu(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function QAn(e,t,n){const r=tTn(e);if(ua(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return lu(o)&&Math.floor(o)===o?JAn(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function JAn(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function ZAn(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ua(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function eTn(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:ua(e)?r=e.value:r=t.getBaseValue(),r}function tTn(e){const t=e.options,n=t.fill;let r=mi(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function nTn(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,l=rTn(t,n);l.push(Qot({x:null,y:t.bottom},r));for(let c=0;c=0;--s){const l=o[s].$filler;l&&(l.line.updateControlPoints(i,l.axis),r&&l.fill&&Aee(e.ctx,l,i))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let o=r.length-1;o>=0;--o){const i=r[o].$filler;AMe(i)&&Aee(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!AMe(r)||n.drawTime!=="beforeDatasetDraw"||Aee(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const RMe=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},hTn=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class OMe extends Kw{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Il(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,o)=>t.sort(r,o,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,o=Pd(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=RMe(r,i);let u,d;n.font=o.string,this.isHorizontal()?(u=this.maxWidth,d=this._fitRows(s,i,l,c)+10):(d=this.maxHeight,u=this._fitCols(s,o,l,c)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,o){const{ctx:i,maxWidth:s,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],u=this.lineWidths=[0],d=o+l;let p=t;i.textAlign="left",i.textBaseline="middle";let h=-1,m=-d;return this.legendItems.forEach((g,y)=>{const x=r+n/2+i.measureText(g.text).width;(y===0||u[u.length-1]+x+2*l>s)&&(p+=d,u[u.length-(y>0?0:1)]=0,m+=d,h++),c[y]={left:0,top:m,row:h,width:x,height:o},u[u.length-1]+=x+l}),p}_fitCols(t,n,r,o){const{ctx:i,maxHeight:s,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],u=this.columnSizes=[],d=s-t;let p=l,h=0,m=0,g=0,y=0;return this.legendItems.forEach((x,v)=>{const{itemWidth:b,itemHeight:w}=mTn(r,n,i,x,o);v>0&&m+w+2*l>d&&(p+=h+l,u.push({width:h,height:m}),g+=h+l,y++,h=m=0),c[v]={left:g,top:m,col:y,width:b,height:w},h=Math.max(h,b),m+=w+l}),p+=h,u.push({width:h,height:m}),p}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=fA(i,this.left,this.width);if(this.isHorizontal()){let l=0,c=mp(r,this.left+o,this.right-this.lineWidths[l]);for(const u of n)l!==u.row&&(l=u.row,c=mp(r,this.left+o,this.right-this.lineWidths[l])),u.top+=this.top+t+o,u.left=s.leftForLtr(s.x(c),u.width),c+=u.width+o}else{let l=0,c=mp(r,this.top+t+o,this.bottom-this.columnSizes[l].height);for(const u of n)u.col!==l&&(l=u.col,c=mp(r,this.top+t+o,this.bottom-this.columnSizes[l].height)),u.top=c,u.left+=this.left+o,u.left=s.leftForLtr(s.x(u.left),u.width),c+=u.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;gK(t,this),this._draw(),xK(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,l=xc.color,c=fA(t.rtl,this.left,this.width),u=Pd(s.font),{padding:d}=s,p=u.size,h=p/2;let m;this.drawTitle(),o.textAlign=c.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=u.string;const{boxWidth:g,boxHeight:y,itemHeight:x}=RMe(s,p),v=function(N,j,I){if(isNaN(g)||g<=0||isNaN(y)||y<0)return;o.save();const _=mi(I.lineWidth,1);if(o.fillStyle=mi(I.fillStyle,l),o.lineCap=mi(I.lineCap,"butt"),o.lineDashOffset=mi(I.lineDashOffset,0),o.lineJoin=mi(I.lineJoin,"miter"),o.lineWidth=_,o.strokeStyle=mi(I.strokeStyle,l),o.setLineDash(mi(I.lineDash,[])),s.usePointStyle){const T={radius:y*Math.SQRT2/2,pointStyle:I.pointStyle,rotation:I.rotation,borderWidth:_},P=c.xPlus(N,g/2),E=j+h;yot(o,T,P,E,s.pointStyleWidth&&g)}else{const T=j+Math.max((p-y)/2,0),P=c.leftForLtr(N,g),E=DE(I.borderRadius);o.beginPath(),Object.values(E).some(M=>M!==0)?J3(o,{x:P,y:T,w:g,h:y,radius:E}):o.rect(P,T,g,y),o.fill(),_!==0&&o.stroke()}o.restore()},b=function(N,j,I){gI(o,I.text,N,j+x/2,u,{strikethrough:I.hidden,textAlign:c.textAlign(I.textAlign)})},w=this.isHorizontal(),S=this._computeTitleHeight();w?m={x:mp(i,this.left+d,this.right-r[0]),y:this.top+d+S,line:0}:m={x:this.left+d,y:mp(i,this.top+S+d,this.bottom-n[0].height),line:0},Eot(this.ctx,t.textDirection);const C=x+d;this.legendItems.forEach((N,j)=>{o.strokeStyle=N.fontColor,o.fillStyle=N.fontColor;const I=o.measureText(N.text).width,_=c.textAlign(N.textAlign||(N.textAlign=s.textAlign)),T=g+h+I;let P=m.x,E=m.y;c.setWidth(this.width),w?j>0&&P+T+d>this.right&&(E=m.y+=C,m.line++,P=m.x=mp(i,this.left+d,this.right-r[m.line])):j>0&&E+C>this.bottom&&(P=m.x=P+n[m.line].width+d,m.line++,E=m.y=mp(i,this.top+S+d,this.bottom-n[m.line].height));const M=c.x(P);if(v(M,E,N),P=O5n(_,P+g+h,w?P+T:this.right,t.rtl),b(c.x(P),E,N),w)m.x+=T+d;else if(typeof N.text!="string"){const R=u.lineHeight;m.y+=Zot(N,R)+d}else m.y+=C}),Iot(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Pd(n.font),o=kp(n.padding);if(!n.display)return;const i=fA(t.rtl,this.left,this.width),s=this.ctx,l=n.position,c=r.size/2,u=o.top+c;let d,p=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),d=this.top+u,p=mp(t.align,p,this.right-h);else{const g=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);d=u+mp(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const m=mp(l,p,p+h);s.textAlign=i.textAlign(iye(l)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,gI(s,n.text,m,d,r)}_computeTitleHeight(){const t=this.options.title,n=Pd(t.font),r=kp(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(F1(t,this.left,this.right)&&F1(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;ri.length>s.length?i:s)),t+n.size/2+r.measureText(o).width}function xTn(e,t,n){let r=e;return typeof t.text!="string"&&(r=Zot(t,n)),r}function Zot(e,t){const n=e.text?e.text.length:0;return t*n}function yTn(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var eit={id:"legend",_element:OMe,start(e,t,n){const r=e.legend=new OMe({ctx:e.ctx,options:n,chart:e});Ep.configure(e,r,n),Ep.addBox(e,r)},stop(e){Ep.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Ep.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:o,color:i,useBorderRadius:s,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const u=c.controller.getStyle(n?0:void 0),d=kp(u.borderWidth);return{text:t[c.index].label,fillStyle:u.backgroundColor,fontColor:i,hidden:!c.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:o||u.textAlign,borderRadius:s&&(l||u.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let hye=class extends Kw{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const o=mc(r.text)?r.text.length:1;this._padding=kp(r.padding);const i=o*Pd(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:o,right:i,options:s}=this,l=s.align;let c=0,u,d,p;return this.isHorizontal()?(d=mp(l,r,i),p=n+t,u=i-r):(s.position==="left"?(d=r+t,p=mp(l,o,n),c=Wa*-.5):(d=i-t,p=mp(l,n,o),c=Wa*.5),u=o-n),{titleX:d,titleY:p,maxWidth:u,rotation:c}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Pd(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:l,maxWidth:c,rotation:u}=this._drawArgs(i);gI(t,n.text,0,0,r,{color:n.color,maxWidth:c,rotation:u,textAlign:iye(n.align),textBaseline:"middle",translation:[s,l]})}};function vTn(e,t){const n=new hye({ctx:e.ctx,options:t,chart:e});Ep.configure(e,n,t),Ep.addBox(e,n),e.titleBlock=n}var tit={id:"title",_element:hye,start(e,t,n){vTn(e,n)},stop(e){const t=e.titleBlock;Ep.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Ep.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const UF=new WeakMap;var bTn={id:"subtitle",start(e,t,n){const r=new hye({ctx:e.ctx,options:n,chart:e});Ep.configure(e,r,n),Ep.addBox(e,r),UF.set(e,r)},stop(e){Ep.removeBox(e,UF.get(e)),UF.delete(e)},beforeUpdate(e,t,n){const r=UF.get(e);Ep.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ER={average(e){if(!e.length)return!1;let t,n,r=new Set,o=0,i=0;for(t=0,n=e.length;tl+c)/r.size,y:o/i}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,o=Number.POSITIVE_INFINITY,i,s,l;for(i=0,s=e.length;i-1?e.split(` `):e}function wTn(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:s,value:l}=i.getLabelAndValue(o);return{chart:e,label:s,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:l,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function $Me(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:l}=t,c=Pd(t.bodyFont),u=Pd(t.titleFont),d=Pd(t.footerFont),p=i.length,h=o.length,m=r.length,g=kp(t.padding);let y=g.height,x=0,v=r.reduce((S,C)=>S+C.before.length+C.lines.length+C.after.length,0);if(v+=e.beforeBody.length+e.afterBody.length,p&&(y+=p*u.lineHeight+(p-1)*t.titleSpacing+t.titleMarginBottom),v){const S=t.displayColors?Math.max(l,c.lineHeight):c.lineHeight;y+=m*S+(v-m)*c.lineHeight+(v-1)*t.bodySpacing}h&&(y+=t.footerMarginTop+h*d.lineHeight+(h-1)*t.footerSpacing);let b=0;const w=function(S){x=Math.max(x,n.measureText(S).width+b)};return n.save(),n.font=u.string,Ds(e.title,w),n.font=c.string,Ds(e.beforeBody.concat(e.afterBody),w),b=t.displayColors?s+2+t.boxPadding:0,Ds(r,S=>{Ds(S.before,w),Ds(S.lines,w),Ds(S.after,w)}),b=0,n.font=d.string,Ds(e.footer,w),n.restore(),x+=g.width,{width:x,height:y}}function STn(e,t){const{y:n,height:r}=t;return ne.height-r/2?"bottom":"center"}function CTn(e,t,n,r){const{x:o,width:i}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&o+i+s>t.width||e==="right"&&o-i-s<0)return!0}function NTn(e,t,n,r){const{x:o,width:i}=n,{width:s,chartArea:{left:l,right:c}}=e;let u="center";return r==="center"?u=o<=(l+c)/2?"left":"right":o<=i/2?u="left":o>=s-i/2&&(u="right"),CTn(u,e,t,n)&&(u="center"),u}function DMe(e,t,n){const r=n.yAlign||t.yAlign||STn(e,n);return{xAlign:n.xAlign||t.xAlign||NTn(e,t,n,r),yAlign:r}}function jTn(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function ETn(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function LMe(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=e,{xAlign:l,yAlign:c}=n,u=o+i,{topLeft:d,topRight:p,bottomLeft:h,bottomRight:m}=DE(s);let g=jTn(t,l);const y=ETn(t,c,u);return c==="center"?l==="left"?g+=u:l==="right"&&(g-=u):l==="left"?g-=Math.max(d,h)+o:l==="right"&&(g+=Math.max(p,m)+o),{x:ff(g,0,r.width-t.width),y:ff(y,0,r.height-t.height)}}function WF(e,t,n){const r=kp(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function FMe(e){return nv([],m1(e))}function ITn(e,t,n){return rN(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function zMe(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const nit={beforeTitle:e1,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex"u"?nit[t].call(n,r):o}var Qoe;let BMe=(Qoe=class extends Kw{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),o=r.enabled&&n.options.animation&&r.animations,i=new kot(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=ITn(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=Wh(r,"beforeTitle",this,t),i=Wh(r,"title",this,t),s=Wh(r,"afterTitle",this,t);let l=[];return l=nv(l,m1(o)),l=nv(l,m1(i)),l=nv(l,m1(s)),l}getBeforeBody(t,n){return FMe(Wh(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return Ds(t,i=>{const s={before:[],lines:[],after:[]},l=zMe(r,i);nv(s.before,m1(Wh(l,"beforeLabel",this,i))),nv(s.lines,Wh(l,"label",this,i)),nv(s.after,m1(Wh(l,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return FMe(Wh(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=Wh(r,"beforeFooter",this,t),i=Wh(r,"footer",this,t),s=Wh(r,"afterFooter",this,t);let l=[];return l=nv(l,m1(o)),l=nv(l,m1(i)),l=nv(l,m1(s)),l}_createItems(t){const n=this._active,r=this.chart.data,o=[],i=[],s=[];let l=[],c,u;for(c=0,u=n.length;ct.filter(d,p,h,r))),t.itemSort&&(l=l.sort((d,p)=>t.itemSort(d,p,r))),Ds(l,d=>{const p=zMe(t.callbacks,d);o.push(Wh(p,"labelColor",this,d)),i.push(Wh(p,"labelPointStyle",this,d)),s.push(Wh(p,"labelTextColor",this,d))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=s,this.dataPoints=l,l}update(t,n){const r=this.options.setContext(this.getContext()),o=this._active;let i,s=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const l=ER[r.position].call(this,o,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const c=this._size=$Me(this,r),u=Object.assign({},l,c),d=DMe(this.chart,r,u),p=LMe(r,u,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,i={opacity:1,x:p.x,y:p.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,o){const i=this.getCaretPosition(t,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:s,cornerRadius:l}=r,{topLeft:c,topRight:u,bottomLeft:d,bottomRight:p}=DE(l),{x:h,y:m}=t,{width:g,height:y}=n;let x,v,b,w,S,C;return i==="center"?(S=m+y/2,o==="left"?(x=h,v=x-s,w=S+s,C=S-s):(x=h+g,v=x+s,w=S-s,C=S+s),b=x):(o==="left"?v=h+Math.max(c,d)+s:o==="right"?v=h+g-Math.max(u,p)-s:v=this.caretX,i==="top"?(w=m,S=w-s,x=v-s,b=v+s):(w=m+y,S=w+s,x=v+s,b=v-s),C=w),{x1:x,x2:v,x3:b,y1:w,y2:S,y3:C}}drawTitle(t,n,r){const o=this.title,i=o.length;let s,l,c;if(i){const u=fA(r.rtl,this.x,this.width);for(t.x=WF(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",s=Pd(r.titleFont),l=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,c=0;cb!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,J3(t,{x:y,y:g,w:u,h:c,radius:v}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),J3(t,{x,y:g+1,w:u-2,h:c-2,radius:v}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(y,g,u,c),t.strokeRect(y,g,u,c),t.fillStyle=s.backgroundColor,t.fillRect(x,g+1,u-2,c-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:o}=this,{bodySpacing:i,bodyAlign:s,displayColors:l,boxHeight:c,boxWidth:u,boxPadding:d}=r,p=Pd(r.bodyFont);let h=p.lineHeight,m=0;const g=fA(r.rtl,this.x,this.width),y=function(I){n.fillText(I,g.x(t.x+m),t.y+h/2),t.y+=h+i},x=g.textAlign(s);let v,b,w,S,C,N,j;for(n.textAlign=s,n.textBaseline="middle",n.font=p.string,t.x=WF(this,x,r),n.fillStyle=r.bodyColor,Ds(this.beforeBody,y),m=l&&x!=="right"?s==="center"?u/2+d:u+2+d:0,S=0,N=o.length;S0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const s=ER[t.position].call(this,this._active,this._eventPosition);if(!s)return;const l=this._size=$Me(this,t),c=Object.assign({},s,this._size),u=DMe(n,t,c),d=LMe(t,c,u,n);(o._to!==d.x||i._to!==d.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=l.width,this.height=l.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=kp(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(t.save(),t.globalAlpha=r,this.drawBackground(i,t,o,n),Eot(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),Iot(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,o=t.map(({datasetIndex:l,index:c})=>{const u=this.chart.getDatasetMeta(l);if(!u)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:u.data[c],index:c}}),i=!dU(r,o),s=this._positionChanged(o,n);(i||s)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],s=this._getActiveElements(t,i,n,r),l=this._positionChanged(s,t),c=n||!dU(s,i)||l;return c&&(this._active=s,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,r,o){const i=this.options;if(t.type==="mouseout")return[];if(!o)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,i.mode,i,r);return i.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:o,options:i}=this,s=ER[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},ze(Qoe,"positioners",ER),Qoe);var rit={id:"tooltip",_element:BMe,positioners:ER,afterInit(e,t,n){n&&(e.tooltip=new BMe({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:nit},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},_Tn=Object.freeze({__proto__:null,Colors:VAn,Decimation:qAn,Filler:pTn,Legend:eit,SubTitle:bTn,Title:tit,Tooltip:rit});const PTn=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function ATn(e,t,n,r){const o=e.indexOf(t);if(o===-1)return PTn(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const TTn=(e,t)=>e===null?null:ff(Math.round(e),0,t);function HMe(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}ze(yU,"id","category"),ze(yU,"defaults",{ticks:{callback:HMe}});function kTn(e,t){const n=[],{bounds:o,step:i,min:s,max:l,precision:c,count:u,maxTicks:d,maxDigits:p,includeBounds:h}=e,m=i||1,g=d-1,{min:y,max:x}=t,v=!oa(s),b=!oa(l),w=!oa(u),S=(x-y)/(p+1);let C=$4e((x-y)/g/m)*m,N,j,I,_;if(C<1e-14&&!v&&!b)return[{value:y},{value:x}];_=Math.ceil(x/C)-Math.floor(y/C),_>g&&(C=$4e(_*C/g/m)*m),oa(c)||(N=Math.pow(10,c),C=Math.ceil(C*N)/N),o==="ticks"?(j=Math.floor(y/C)*C,I=Math.ceil(x/C)*C):(j=y,I=x),v&&b&&i&&_5n((l-s)/i,C/1e3)?(_=Math.round(Math.min((l-s)/C,d)),C=(l-s)/_,j=s,I=l):w?(j=v?s:j,I=b?l:I,_=u-1,C=(I-j)/_):(_=(I-j)/C,xO(_,Math.round(_),C/1e3)?_=Math.round(_):_=Math.ceil(_));const T=Math.max(D4e(C),D4e(j));N=Math.pow(10,oa(c)?T:c),j=Math.round(j*N)/N,I=Math.round(I*N)/N;let P=0;for(v&&(h&&j!==s?(n.push({value:s}),jl)break;n.push({value:E})}return b&&h&&I!==l?n.length&&xO(n[n.length-1].value,l,VMe(l,S,e))?n[n.length-1].value=l:n.push({value:l}):(!b||I===l)&&n.push({value:I}),n}function VMe(e,t,{horizontal:n,minRotation:r}){const o=Xx(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class vU extends c5{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return oa(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:o,max:i}=this;const s=c=>o=n?o:c,l=c=>i=r?i:c;if(t){const c=Qv(o),u=Qv(i);c<0&&u<0?l(0):c>0&&u>0&&s(0)}if(o===i){let c=i===0?1:Math.abs(i*.05);l(i+c),t||s(o-c)}this.min=o,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,o;return r?(o=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const o={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,s=kTn(o,i);return t.bounds==="ticks"&&cot(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const o=(r-n)/Math.max(t.length-1,1)/2;n-=o,r+=o}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return qL(t,this.chart.options.locale,this.options.ticks.format)}}class bU extends vU{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=lu(t)?t:0,this.max=lu(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Xx(this.options.ticks.minRotation),o=(t?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}ze(bU,"id","linear"),ze(bU,"defaults",{ticks:{callback:mK.formatters.numeric}});const e$=e=>Math.floor(L2(e)),HN=(e,t)=>Math.pow(10,e$(e)+t);function UMe(e){return e/Math.pow(10,e$(e))===1}function WMe(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function MTn(e,t){const n=t-e;let r=e$(n);for(;WMe(e,t,r)>10;)r++;for(;WMe(e,t,r)<10;)r--;return Math.min(r,e$(e))}function RTn(e,{min:t,max:n}){t=Vm(e.min,t);const r=[],o=e$(t);let i=MTn(t,n),s=i<0?Math.pow(10,Math.abs(i)):1;const l=Math.pow(10,i),c=o>i?Math.pow(10,o):0,u=Math.round((t-c)*s)/s,d=Math.floor((t-c)/l/10)*l*10;let p=Math.floor((u-d)/Math.pow(10,i)),h=Vm(e.min,Math.round((c+d+p*Math.pow(10,i))*s)/s);for(;h=10?p=p<15?15:20:p++,p>=20&&(i++,p=2,s=i>=0?1:s),h=Math.round((c+d+p*Math.pow(10,i))*s)/s;const m=Vm(e.max,h);return r.push({value:m,major:UMe(m),significand:p}),r}class tle extends c5{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=vU.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return lu(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=lu(t)?Math.max(0,t):null,this.max=lu(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!lu(this._userMin)&&(this.min=t===HN(this.min,0)?HN(this.min,-1):HN(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,o=this.max;const i=l=>r=t?r:l,s=l=>o=n?o:l;r===o&&(r<=0?(i(1),s(10)):(i(HN(r,-1)),s(HN(o,1)))),r<=0&&i(HN(o,-1)),o<=0&&s(HN(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=RTn(n,this);return t.bounds==="ticks"&&cot(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":qL(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=L2(t),this._valueRange=L2(this.max)-L2(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(L2(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}ze(tle,"id","logarithmic"),ze(tle,"defaults",{ticks:{callback:mK.formatters.logarithmic,major:{enabled:!0}}});function nle(e){const t=e.ticks;if(t.display&&e.display){const n=kp(t.backdropPadding);return mi(t.font&&t.font.size,xc.font.size)+n.height}return 0}function OTn(e,t,n){return n=mc(n)?n:[n],{w:W5n(e,t.string,n),h:n.length*t.lineHeight}}function GMe(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:eo?{start:t-n,end:t}:{start:t,end:t+n}}function $Tn(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],o=[],i=e._pointLabels.length,s=e.options.pointLabels,l=s.centerPointLabels?Wa/i:0;for(let c=0;ct.r&&(l=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+l)),o.startt.b&&(c=(o.end-t.b)/s,e.b=Math.max(e.b,t.b+c))}function LTn(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:s,size:l}=n,c=e.getPointPosition(t,r+o+s,i),u=Math.round(rye(bp(c.angle+$u))),d=VTn(c.y,l.h,u),p=BTn(u),h=HTn(c.x,l.w,p);return{visible:!0,x:c.x,y:d,textAlign:p,left:h,top:d,right:h+l.w,bottom:d+l.h}}function FTn(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(B1({x:n,y:r},t)||B1({x:n,y:i},t)||B1({x:o,y:r},t)||B1({x:o,y:i},t))}function zTn(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:l}=i.pointLabels,c={extra:nle(i)/2,additionalAngle:s?Wa/o:0};let u;for(let d=0;d270||n<90)&&(e-=t),e}function UTn(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:l}=t;if(!oa(l)){const c=DE(t.borderRadius),u=kp(t.backdropPadding);e.fillStyle=l;const d=r-u.left,p=o-u.top,h=i-r+u.width,m=s-o+u.height;Object.values(c).some(g=>g!==0)?(e.beginPath(),J3(e,{x:d,y:p,w:h,h:m,radius:c}),e.fill()):e.fillRect(d,p,h,m)}}function WTn(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let o=t-1;o>=0;o--){const i=e._pointLabelItems[o];if(!i.visible)continue;const s=r.setContext(e.getPointLabelContext(o));UTn(n,s,i);const l=Pd(s.font),{x:c,y:u,textAlign:d}=i;gI(n,e._pointLabels[o],c,u+l.lineHeight/2,l,{color:s.color,textAlign:d,textBaseline:"middle"})}}function oit(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,Xl);else{let i=e.getPointPosition(0,t);o.moveTo(i.x,i.y);for(let s=1;s{const o=Il(this.options.pointLabels.callback,[n,r],this);return o||o===0?o:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?$Tn(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,o){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,o))}getIndexAngle(t){const n=Xl/(this._pointLabels.length||1),r=this.options.startAngle||0;return bp(t*n+Xx(r))}getDistanceFromCenterForValue(t){if(oa(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(oa(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t{if(p!==0||p===0&&this.min<0){c=this.getDistanceFromCenterForValue(d.value);const h=this.getContext(p),m=o.setContext(h),g=i.setContext(h);GTn(this,m,c,s,g)}}),r.display){for(t.save(),l=s-1;l>=0;l--){const d=r.setContext(this.getPointLabelContext(l)),{color:p,lineWidth:h}=d;!h||!p||(t.lineWidth=h,t.strokeStyle=p,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),u=this.getPointPosition(l,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const o=this.getIndexAngle(0);let i,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const u=r.setContext(this.getContext(c)),d=Pd(u.font);if(i=this.getDistanceFromCenterForValue(this.ticks[c].value),u.showLabelBackdrop){t.font=d.string,s=t.measureText(l.label).width,t.fillStyle=u.backdropColor;const p=kp(u.backdropPadding);t.fillRect(-s/2-p.left,-i-d.size/2-p.top,s+p.width,d.size+p.height)}gI(t,l.label,0,-i,d,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}ze(IR,"id","radialLinear"),ze(IR,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:mK.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),ze(IR,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),ze(IR,"descriptors",{angleLines:{_fallback:"grid"}});const wK={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},im=Object.keys(wK);function qMe(e,t){return e-t}function KMe(e,t){if(oa(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),lu(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(NT(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function YMe(e,t,n,r){const o=im.length;for(let i=im.indexOf(e);i=im.indexOf(n);i--){const s=im[i];if(wK[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return im[n?im.indexOf(n):0]}function YTn(e){for(let t=im.indexOf(e)+1,n=im.length;t=t?n[r]:n[o];e[i]=!0}}function XTn(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),s=t[t.length-1].value;let l,c;for(l=i;l<=s;l=+o.add(l,1,r))c=n[l],c>=0&&(t[c].major=!0);return t}function QMe(e,t,n){const r=[],o={},i=t.length;let s,l;for(s=0;s+t.value))}initOffsets(t=[]){let n=0,r=0,o,i;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?n=1-o:n=(this.getDecimalForValue(t[1])-o)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?r=i:r=(i-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=ff(n,0,s),r=ff(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,o=this.options,i=o.time,s=i.unit||YMe(i.minUnit,n,r,this._getLabelCapacity(n)),l=mi(o.ticks.stepSize,1),c=s==="week"?i.isoWeekday:!1,u=NT(c)||c===!0,d={};let p=n,h,m;if(u&&(p=+t.startOf(p,"isoWeek",c)),p=+t.startOf(p,u?"day":s),t.diff(r,n,s)>1e5*l)throw new Error(n+" and "+r+" are too far apart with stepSize of "+l+" "+s);const g=o.ticks.source==="data"&&this.getDataTimestamps();for(h=p,m=0;h+y)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const o=this.options.time.displayFormats,i=this._unit,s=n||o[i];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,o){const i=this.options,s=i.ticks.callback;if(s)return Il(s,[t,n,r],this);const l=i.time.displayFormats,c=this._unit,u=this._majorUnit,d=c&&l[c],p=u&&l[u],h=r[n],m=u&&p&&h&&h.major;return this._adapter.format(t,o||(m?p:d))}generateTickLabels(t){let n,r,o;for(n=0,r=t.length;n0?l:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,r=o.length;n=e[r].pos&&t<=e[o].pos&&({lo:r,hi:o}=z1(e,"pos",t)),{pos:i,time:l}=e[r],{pos:s,time:c}=e[o]):(t>=e[r].time&&t<=e[o].time&&({lo:r,hi:o}=z1(e,"time",t)),{time:i,pos:l}=e[r],{time:s,pos:c}=e[o]);const u=s-i;return u?l+(c-l)*(t-i)/u:l}class rle extends t${constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=GF(n,this.min),this._tableRange=GF(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,o=[],i=[];let s,l,c,u,d;for(s=0,l=t.length;s=n&&u<=r&&o.push(u);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,l=o.length;so-i)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(GF(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return GF(this._table,r*this._tableRange+this._minPos,!0)}}ze(rle,"id","timeseries"),ze(rle,"defaults",t$.defaults);var QTn=Object.freeze({__proto__:null,CategoryScale:yU,LinearScale:bU,LogarithmicScale:tle,RadialLinearScale:IR,TimeScale:t$,TimeSeriesScale:rle});const JTn=[sPn,$An,_Tn,QTn],iit="label";function JMe(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function ZTn(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function ait(e,t){e.labels=t}function sit(e,t,n=iit){const r=[];e.datasets=t.map(o=>{const i=e.datasets.find(s=>s[n]===o[n]);return!i||!o.data||r.includes(i)?{...o}:(r.push(i),Object.assign(i,o),i)})}function ekn(e,t=iit){const n={labels:[],datasets:[]};return ait(n,e.labels),sit(n,e.datasets,t),n}function tkn(e,t){const{height:n=150,width:r=300,redraw:o=!1,datasetIdKey:i,type:s,data:l,options:c,plugins:u=[],fallbackContent:d,updateMode:p,...h}=e,m=f.useRef(null),g=f.useRef(null),y=()=>{m.current&&(g.current=new KL(m.current,{type:s,data:ekn(l,i),options:c&&{...c},plugins:u}),JMe(t,g.current))},x=()=>{JMe(t,null),g.current&&(g.current.destroy(),g.current=null)};return f.useEffect(()=>{!o&&g.current&&c&&ZTn(g.current,c)},[o,c]),f.useEffect(()=>{!o&&g.current&&ait(g.current.config.data,l.labels)},[o,l.labels]),f.useEffect(()=>{!o&&g.current&&l.datasets&&sit(g.current.config.data,l.datasets,i)},[o,l.datasets]),f.useEffect(()=>{g.current&&(o?(x(),setTimeout(y)):g.current.update(p))},[o,c,l.labels,l.datasets,p]),f.useEffect(()=>{g.current&&(x(),setTimeout(y))},[s]),f.useEffect(()=>(y(),()=>x()),[]),a.jsx("canvas",{ref:m,role:"img",height:n,width:r,...h,children:d})}const nkn=f.forwardRef(tkn);KL.register(yU,bU,SO,tit,rit,eit,PP,wO,H1);const rkn=({previousView:e})=>{f.useContext(ia);const[t,n]=f.useState([]),[r,o]=f.useState([]),[i,s]=f.useState(""),[l,c]=f.useState(!1),[u,d]=f.useState(!1),p=f.useRef(null),h=f.useRef(null),m=f.useCallback((b,w,S,C="standard")=>{const N={timestamp:new Date,action:b,actor:w,details:S,securityLevel:C};o(j=>[...j,N]),console.log(`[AUDIT LOG]: ${N.timestamp.toISOString()} | ${N.actor.toUpperCase()} | ${N.action} | ${N.details}`)},[]);f.useEffect(()=>{const b=new Ko({apiKey:""});p.current=b.getGenerativeModel({model:"gemini-1.5-flash",systemInstruction:"You are the Quantum Financial AI Advisor. You provide elite, secure, and high-performance business banking insights. You can simulate Wire transfers, ACH collections, and ERP integrations. Always maintain a professional, secure tone. Mention that every action is logged in the secure audit vault."}).startChat({history:[],generationConfig:{maxOutputTokens:1200}}),m("Session Initialized","system","Quantum AI Core connected to secure terminal.","standard")},[m]),f.useEffect(()=>{var b;(b=h.current)==null||b.scrollIntoView({behavior:"smooth"})},[t]);const g=async(b,w=!1)=>{if(!b.trim()||!p.current)return;c(!0);const S={id:Date.now().toString(),role:"user",parts:[{text:b}],timestamp:new Date};n(C=>[...C,S]),s(""),m("User Message","user",b,w?"elevated":"standard");try{let C="",N=null,j=[];b.toLowerCase().includes("wire")?(C="I have prepared the Wire Transfer protocol. For security, Quantum Financial requires a Multi-Factor Authentication handshake before proceeding with high-value movements.",d(!0),m("Wire Protocol Triggered","ai","Awaiting MFA verification for outbound wire.","critical")):b.toLowerCase().includes("health")||b.toLowerCase().includes("summarize")?(C="Analyzing your global liquidity position. Your current cash flow is optimized, though I detect a 4% variance in your APAC accounts.",N={type:"line",data:{labels:["08:00","10:00","12:00","14:00","16:00","18:00"],datasets:[{label:"Liquidity (USD Millions)",data:[42,45,44,48,52,51],borderColor:"#06b6d4",backgroundColor:"rgba(6, 182, 212, 0.1)",fill:!0,tension:.4}]}},j=[{id:"1",text:"Sync with NetSuite",actionType:"integration"},{id:"2",text:"Run Fraud Scan",actionType:"security"}]):C=(await p.current.sendMessage(b)).response.text();const I={id:(Date.now()+1).toString(),role:"model",parts:[{text:C}],timestamp:new Date,chartData:N,actionSuggestions:j};n(_=>[..._,I]),m("AI Response Generated","ai","Response delivered to secure terminal.","standard")}catch{n(N=>[...N,{id:"err",role:"model",parts:[{text:"Quantum Core connection interrupted. Re-establishing secure link..."}],timestamp:new Date}])}finally{c(!1)}},y=()=>{d(!1),m("MFA Verified","system","Biometric/Token handshake successful.","critical"),g("MFA Verified. Proceed with the secure wire transfer authorization.",!0)},x={[wt.Dashboard]:["Summarize my financial health.","Run a fraud analysis on today's batch.","Project my EOD liquidity."],[wt.Transactions]:["Find wires over $50,000.","Sync recent ACH with ERP.","Identify duplicate vendor payments."],DEFAULT:["Initiate a domestic wire.","Check ERP integration status.","Show my audit trail summary."]},v=x[e||"DEFAULT"]||x.DEFAULT;return a.jsxs("div",{className:"h-full flex flex-col bg-slate-950 text-slate-200 font-sans",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-3xl font-extrabold text-white tracking-tighter uppercase italic",children:"Quantum AI Advisor"}),a.jsx("p",{className:"text-cyan-500 text-xs font-mono tracking-widest",children:"SECURE TERMINAL // AUDIT LOGGING ACTIVE"})]}),a.jsx("div",{className:"flex gap-4",children:a.jsxs("div",{className:"bg-slate-900 border border-slate-800 px-4 py-2 rounded-md flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),a.jsx("span",{className:"text-[10px] font-bold text-slate-400 uppercase",children:"Vault Status: Encrypted"})]})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-6 flex-grow overflow-hidden",children:[a.jsxs(Ft,{className:"lg:col-span-3 flex flex-col border-slate-800 bg-slate-900/50 backdrop-blur-xl",padding:"none",children:[a.jsxs("div",{className:"flex-grow p-6 space-y-6 overflow-y-auto custom-scrollbar",children:[t.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center space-y-8",children:[a.jsx("div",{className:"w-20 h-20 bg-cyan-500/10 rounded-full flex items-center justify-center border border-cyan-500/20",children:a.jsx("svg",{className:"w-10 h-10 text-cyan-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"Welcome to Quantum Financial Intelligence"}),a.jsx("p",{className:"text-slate-400 max-w-md mx-auto mt-2",children:"Your elite advisor for global treasury management, secure payments, and real-time analytics."})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 w-full max-w-2xl",children:v.map((b,w)=>a.jsxs("button",{onClick:()=>g(b),className:"p-4 bg-slate-800/50 hover:bg-cyan-900/20 hover:border-cyan-500/50 rounded-xl text-cyan-200 text-xs font-bold transition-all border border-slate-700 text-left flex flex-col justify-between group",children:[a.jsxs("span",{children:['"',b,'"']}),a.jsx("span",{className:"text-[10px] text-slate-500 mt-2 group-hover:text-cyan-400",children:"Execute Command →"})]},w))})]}),t.map(b=>a.jsx("div",{className:`flex ${b.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[85%] p-5 rounded-2xl shadow-2xl ${b.role==="user"?"bg-cyan-700 text-white ml-12":"bg-slate-800 border border-slate-700 text-slate-200 mr-12"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[a.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest opacity-50",children:b.role==="user"?"Authorized User":"Quantum AI"}),a.jsx("span",{className:"text-[10px] opacity-30",children:b.timestamp.toLocaleTimeString()})]}),a.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:b.parts[0].text}),b.chartData&&a.jsx("div",{className:"mt-4 p-4 bg-slate-950 rounded-xl border border-slate-700",children:a.jsx(nkn,{type:b.chartData.type,data:b.chartData.data,options:{responsive:!0,plugins:{legend:{display:!1}}}})}),b.actionSuggestions&&a.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:b.actionSuggestions.map(w=>a.jsx("button",{onClick:()=>g(w.text),className:"px-3 py-1.5 bg-cyan-500/10 border border-cyan-500/30 rounded-md text-[10px] font-bold text-cyan-400 hover:bg-cyan-500/20 transition-all",children:w.text},w.id))})]})},b.id)),u&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-amber-900/20 border border-amber-500/50 p-6 rounded-2xl w-full max-w-md",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"w-10 h-10 bg-amber-500/20 rounded-full flex items-center justify-center",children:a.jsx("svg",{className:"w-6 h-6 text-amber-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-amber-500 font-bold text-sm",children:"MFA Challenge Required"}),a.jsx("p",{className:"text-amber-200/60 text-[10px]",children:"High-value transaction detected."})]})]}),a.jsx("button",{onClick:y,className:"w-full py-3 bg-amber-600 hover:bg-amber-500 text-white font-black text-xs rounded-lg transition-all shadow-lg shadow-amber-900/40",children:"VERIFY BIOMETRICS"})]})}),l&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-slate-800 p-4 rounded-2xl flex items-center gap-3 border border-slate-700",children:[a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce [animation-delay:0.2s]"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-500 rounded-full animate-bounce [animation-delay:0.4s]"})]}),a.jsx("span",{className:"text-[10px] font-bold text-cyan-400 uppercase tracking-widest",children:"Quantum Processing..."})]})}),a.jsx("div",{ref:h})]}),a.jsxs("div",{className:"p-4 border-t border-slate-800 bg-slate-950/50",children:[a.jsxs("form",{onSubmit:b=>{b.preventDefault(),g(i)},className:"flex gap-3",children:[a.jsxs("div",{className:"relative flex-grow",children:[a.jsx("input",{type:"text",value:i,onChange:b=>s(b.target.value),placeholder:"Enter command or query...",className:"w-full bg-slate-900 border border-slate-700 rounded-xl px-5 py-4 text-sm text-white focus:ring-2 focus:ring-cyan-500 focus:border-transparent outline-none transition-all placeholder:text-slate-600"}),a.jsx("div",{className:"absolute right-4 top-1/2 -translate-y-1/2 flex gap-2",children:a.jsx("kbd",{className:"hidden md:inline-flex items-center px-2 py-1 bg-slate-800 border border-slate-700 rounded text-[10px] text-slate-500 font-mono",children:"CMD + K"})})]}),a.jsx("button",{type:"submit",disabled:l||!i.trim(),className:"px-8 py-4 bg-cyan-600 hover:bg-cyan-500 text-white font-black text-xs uppercase tracking-widest rounded-xl transition-all disabled:opacity-20 disabled:cursor-not-allowed shadow-lg shadow-cyan-900/20",children:"Execute"})]}),a.jsxs("div",{className:"mt-3 flex justify-between items-center px-2",children:[a.jsxs("div",{className:"flex gap-4",children:[a.jsx("span",{className:"text-[9px] text-slate-500 font-bold uppercase",children:"Wire: Ready"}),a.jsx("span",{className:"text-[9px] text-slate-500 font-bold uppercase",children:"ACH: Ready"}),a.jsx("span",{className:"text-[9px] text-slate-500 font-bold uppercase",children:"ERP: Connected"})]}),a.jsx("span",{className:"text-[9px] text-slate-600 font-mono",children:"v4.2.0-PRO"})]})]})]}),a.jsxs("div",{className:"hidden lg:flex flex-col gap-6",children:[a.jsxs(Ft,{className:"flex-grow border-slate-800 bg-slate-900/80",padding:"none",children:[a.jsxs("div",{className:"p-4 border-b border-slate-800 flex justify-between items-center",children:[a.jsx("h3",{className:"text-[10px] font-black text-slate-400 uppercase tracking-widest",children:"Secure Audit Vault"}),a.jsx("div",{className:"w-2 h-2 bg-cyan-500 rounded-full shadow-[0_0_8px_rgba(6,182,212,0.8)]"})]}),a.jsxs("div",{className:"p-4 space-y-4 overflow-y-auto custom-scrollbar max-h-[500px]",children:[r.slice().reverse().map((b,w)=>a.jsxs("div",{className:"border-l-2 border-slate-800 pl-3 py-1",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("span",{className:`text-[9px] font-bold uppercase ${b.securityLevel==="critical"?"text-amber-500":"text-cyan-500"}`,children:b.action}),a.jsx("span",{className:"text-[8px] text-slate-600 font-mono",children:b.timestamp.toLocaleTimeString()})]}),a.jsx("p",{className:"text-[10px] text-slate-400 mt-1 line-clamp-2",children:b.details})]},w)),r.length===0&&a.jsx("div",{className:"text-center py-10",children:a.jsx("p",{className:"text-[10px] text-slate-600 uppercase font-bold",children:"No logs in current session"})})]})]}),a.jsxs(Ft,{className:"border-slate-800 bg-cyan-950/20",children:[a.jsx("h4",{className:"text-[10px] font-black text-cyan-500 uppercase tracking-widest mb-3",children:"System Integration"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-[10px] text-slate-400",children:"SAP S/4HANA"}),a.jsx("span",{className:"text-[9px] font-bold text-green-500",children:"ACTIVE"})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-[10px] text-slate-400",children:"Oracle Cloud"}),a.jsx("span",{className:"text-[9px] font-bold text-green-500",children:"ACTIVE"})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-[10px] text-slate-400",children:"SWIFT Network"}),a.jsx("span",{className:"text-[9px] font-bold text-cyan-500",children:"STANDBY"})]})]})]})]})]})]})},ZMe="ChaosEngine v0.0.1-Garbage",eRe=5,qF=({id:e,title:t,description:n,defaultChecked:r,onToggle:o,disabled:i,aiImpact:s="None"})=>{const[l,c]=f.useState(r),{showSystemAlert:u}=f.useContext(ia)||{},d=h=>{const m=h.target.checked;c(m),o&&o(m),u&&u(`Configuration Change Detected: ${t} set to ${m?"Enabled":"Disabled"}. AI Risk Assessment: ${s}.`,"info")},p=f.useMemo(()=>{if(s==="None")return null;const h={High:"bg-red-500",Medium:"bg-yellow-500",Low:"bg-blue-500"};return a.jsxs("span",{className:`ml-3 px-2 py-0.5 text-xs font-bold rounded-full text-white ${h[s]}`,children:["AI ",s]})},[s]);return a.jsxs("li",{className:"py-4 flex flex-col sm:flex-row justify-between items-start sm:items-center border-b border-gray-800/70",children:[a.jsxs("div",{className:"flex-grow",children:[a.jsxs("label",{htmlFor:`toggle-${e}`,className:"font-bold text-lg text-white cursor-pointer flex items-center",children:[t,p]}),a.jsx("p",{className:"text-sm text-gray-400 max-w-xl mt-1",children:n})]}),a.jsxs("div",{className:"flex items-center mt-2 sm:mt-0",children:[a.jsx("span",{className:`mr-3 text-sm font-medium ${l?"text-green-400":"text-red-400"}`,children:l?"ACTIVE":"INACTIVE"}),a.jsx("input",{type:"checkbox",id:`toggle-${e}`,className:"toggle toggle-cyan toggle-lg",checked:l,onChange:d,disabled:i,"aria-label":`Toggle for ${t}`})]})]})},okn=({message:e,type:t,onClose:n,isVisible:r})=>{const o={success:"bg-green-700 border-green-500",error:"bg-red-700 border-red-500",info:"bg-blue-700 border-blue-500",warning:"bg-yellow-700 border-yellow-500",critical:"bg-purple-800 border-purple-500"},i={success:a.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),error:a.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})}),info:a.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),warning:a.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.938 5.002c-.77-1.333-2.688-1.333-3.458 0L3.308 18.002c-.77 1.333.192 3 1.732 3z"})}),critical:a.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.938 5.002c-.77-1.333-2.688-1.333-3.458 0L3.308 18.002c-.77 1.333.192 3 1.732 3z"})})};return f.useEffect(()=>{let s;return r&&(s=setTimeout(()=>{n()},t==="critical"?15e3:7e3)),()=>clearTimeout(s)},[r,n,t]),r?a.jsxs("div",{className:`fixed bottom-8 right-8 p-5 rounded-xl shadow-2xl text-white flex items-start space-x-4 transition-all duration-500 ease-out transform border-l-8 ${o[t]} ${r?"translate-y-0 opacity-100":"translate-y-full opacity-0"}`,style:{zIndex:1e3,minWidth:"300px"},children:[a.jsx("div",{className:"flex-shrink-0 mt-1",children:i[t]}),a.jsxs("div",{className:"flex-grow",children:[a.jsxs("span",{className:"text-sm font-bold block capitalize",children:[t," Alert"]}),a.jsx("span",{className:"text-base font-medium",children:e})]}),a.jsx("button",{onClick:n,className:"p-1 rounded-full hover:bg-black/20 focus:outline-none flex-shrink-0 mt-0.5 transition-colors",children:a.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}):null},ikn=({insight:e})=>{const t={Critical:"border-red-600 bg-red-900/20 text-red-300",High:"border-orange-600 bg-orange-900/20 text-orange-300",Medium:"border-yellow-600 bg-yellow-900/20 text-yellow-300",Low:"border-green-600 bg-green-900/20 text-green-300"};return a.jsxs("div",{className:`p-4 rounded-xl border-l-4 shadow-lg transition-all duration-300 hover:shadow-xl ${t[e.severity]}`,children:[a.jsxs("div",{className:"flex justify-between items-start mb-2",children:[a.jsx("h4",{className:"font-extrabold text-lg",children:e.summary}),a.jsx("span",{className:`text-xs font-semibold px-2 py-1 rounded-full ${t[e.severity].replace("border-","bg-").replace("/20","/40")}`,children:e.severity})]}),a.jsx("p",{className:"text-sm text-gray-300 mb-3",children:e.recommendation}),a.jsxs("div",{className:"text-xs text-gray-400 flex justify-between border-t border-current pt-2 mt-2",children:[a.jsxs("span",{children:["Engine: ",e.sourceModel]}),a.jsxs("span",{children:["Detected: ",new Date(e.timestamp).toLocaleString()]})]})]})},akn=()=>{const e=f.useContext(ia),{linkedAccounts:t,unlinkAccount:n,handlePlaidSuccess:r,securityMetrics:o,auditLogs:i,threatAlerts:s,dataSharingPolicies:l,apiKeys:c,trustedContacts:u,securityAwarenessModules:d,showSystemAlert:p,transactionRules:h}=e||{},[m,g]=f.useState(null),[y,x]=f.useState([]),[v,b]=f.useState([]),[w,S]=f.useState([]),[C,N]=f.useState("overview"),[j,I]=f.useState(75);f.useEffect(()=>{const X=new Date,J=te=>new Date(X.getTime()-te*24*60*60*1e3).toISOString();if(x([{id:"1",device:"Quantum Workstation",browser:"Chrome 125 (Secure)",os:"Linux Kernel 6.8",location:"HQ Server Room",ip:"10.0.0.5",timestamp:J(.01),isCurrent:!0,userAgent:"EnterpriseAgent/1.0"},{id:"2",device:"Personal Mobile",browser:"Safari",os:"iOS 18.0 Beta",location:"Remote Office",ip:"203.0.113.45",timestamp:J(1.5),isCurrent:!1,userAgent:"MobileSafari/605.1.15"},{id:"3",device:"Legacy VM",browser:"IE 11",os:"Windows Server 2012",location:"Decommissioned Zone",ip:"192.168.1.100",timestamp:J(15),isCurrent:!1,userAgent:"MSIE 11.0;"}]),b([{id:"dvc_1",name:"Primary Workstation",type:"Desktop",model:"Custom Build X9",lastActivity:J(.01),location:"HQ Server Room",ip:"10.0.0.5",isCurrent:!0,permissions:["read_all","write_transactions","admin_config"],status:"active",firstSeen:J(500),userAgent:"EnterpriseAgent/1.0",pushNotificationsEnabled:!0,biometricAuthEnabled:!0,encryptionStatus:"AES-256-GCM"},{id:"dvc_2",name:"Executive Tablet",type:"Tablet",model:"Pad Pro 14",lastActivity:J(.5),location:"Remote Office",ip:"203.0.113.45",isCurrent:!1,permissions:["read_reports"],status:"active",firstSeen:J(120),userAgent:"MobileSafari/605.1.15",pushNotificationsEnabled:!1,biometricAuthEnabled:!0,encryptionStatus:"full"}]),S([{id:"ai_001",timestamp:J(.1),severity:"High",summary:"Unusual Data Access Pattern Detected",recommendation:"Review recent read operations from Device ID dvc_2 between 02:00 and 04:00 UTC. Initiate temporary read-only lock.",sourceModel:"BehavioralAnomaly_v3"},{id:"ai_002",timestamp:J(1),severity:"Medium",summary:"Outdated OS Detected on Active Device",recommendation:'Update OS on "Legacy VM" (IP 192.168.1.100) to a supported version or isolate it to a sandbox network segment.',sourceModel:"VulnerabilityScanner_v1"}]),o&&o.length>0){const te=o.find(re=>re.metricName==="OverallSecurityScore");te&&I(Math.round(parseFloat(te.currentValue)*100))}},[o]);const _=f.useCallback((X,J)=>{g({message:X,type:J,isVisible:!0})},[]),T=f.useCallback(()=>{g(X=>X?{...X,isVisible:!1}:null)},[]),P=X=>{n&&(n(X),_(`Financial Source ID ${X} successfully revoked access.`,"success"))},E=(X,J)=>{console.log(`Policy ${X.policyId} toggled to ${J}`),_(`Data Sharing Policy "${X.policyName}" updated to ${J?"Active":"Inactive"}.`,"info")},M=X=>{_(`API Key ${X.substring(0,8)}... has been immediately revoked and invalidated.`,"critical")},R=f.useMemo(()=>a.jsx(Ft,{title:"Financial Data Sources (Plaid Integration)",className:"lg:col-span-2",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("p",{className:"text-gray-400 text-sm border-b border-gray-800 pb-3",children:["Securely manage connections to external financial institutions via encrypted tokenization. Last sync: ",new Date().toLocaleTimeString()]}),t&&t.length>0?a.jsx("div",{className:"space-y-3",children:t.map(X=>a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center p-4 bg-gray-800/70 rounded-lg border border-cyan-700/50 shadow-md",children:[a.jsxs("div",{className:"flex items-center mb-2 sm:mb-0",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-cyan-900/70 flex items-center justify-center text-cyan-300 mr-4 flex-shrink-0",children:a.jsx("svg",{className:"w-7 h-7",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 14v3m4-3v3m4-3v3M3 21h18M3 10h18M3 7l9-4 9 4M4 10h16v11H4V10z"})})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-bold text-lg text-white",children:X.name}),a.jsxs("p",{className:"text-sm text-gray-400",children:["Institution ID: ",X.institutionId," | Mask: ",X.mask]})]})]}),a.jsxs("div",{className:"flex space-x-2 mt-2 sm:mt-0",children:[a.jsx("button",{onClick:()=>_(`Initiating re-authentication for ${X.name}...`,"info"),className:"px-3 py-1.5 bg-indigo-900/30 hover:bg-indigo-900/50 text-indigo-300 rounded-lg text-sm transition-colors border border-indigo-700",children:"Re-sync"}),a.jsx("button",{onClick:()=>P(X.id),className:"px-3 py-1.5 bg-red-900/50 hover:bg-red-900/70 text-red-300 rounded-lg text-sm transition-colors border border-red-700",children:"Revoke Access"})]})]},X.id))}):a.jsxs("div",{className:"p-6 bg-gray-800/50 rounded-lg text-center border border-dashed border-gray-700",children:[a.jsx("p",{className:"text-gray-500 italic mb-3",children:"No external financial data sources are currently integrated."}),r&&a.jsx(Frt,{onSuccess:r,label:"Connect New Financial Source",className:"w-full sm:w-auto"})]})]})}),[t,r,P,_]),$=f.useMemo(()=>a.jsx(Ft,{title:"Core Authentication & Access Controls",className:"lg:col-span-1",children:a.jsxs("ul",{className:"divide-y divide-gray-700/50",children:[a.jsx(qF,{id:"2fa_quantum",title:"Quantum 2FA (Hardware Key Required)",description:"Mandatory FIDO2/WebAuthn hardware key enforcement for all administrative roles. Software TOTP is deprecated.",defaultChecked:!0,aiImpact:"High"}),a.jsx(qF,{id:"biometric_device",title:"Device Biometric Trust",description:"Enforce device-level biometric verification for any transaction exceeding $10,000 or configuration change.",defaultChecked:!0,aiImpact:"Medium"}),a.jsx(qF,{id:"session_timeout",title:"Zero-Trust Session Invalidation",description:"Sessions automatically terminate after 15 minutes of inactivity, requiring re-authentication via context-aware challenge.",defaultChecked:!0,aiImpact:"High"}),a.jsxs("li",{className:"py-4 flex flex-col sm:flex-row justify-between items-start sm:items-center border-b border-gray-800/70",children:[a.jsxs("div",{className:"flex-grow",children:[a.jsx("span",{className:"font-bold text-lg text-white flex items-center",children:"Master Credential Management"}),a.jsx("p",{className:"text-sm text-gray-400",children:"Last rotation: 2024-01-15. Next mandatory rotation: 2025-01-15."})]}),a.jsx("button",{className:"px-6 py-2 bg-indigo-700 hover:bg-indigo-600 text-white font-semibold rounded-lg text-sm transition-colors shadow-lg mt-2 sm:mt-0",children:"Initiate Credential Rotation Protocol"})]})]})}),[]),D=f.useMemo(()=>a.jsx(Ft,{title:"Real-Time Login Telemetry",className:"lg:col-span-1",children:a.jsx("div",{className:"space-y-3 max-h-[400px] overflow-y-auto pr-2 custom-scrollbar",children:y.map(X=>a.jsxs("div",{className:"flex items-start justify-between p-3 bg-gray-800/50 rounded-lg border-l-4 border-gray-700 hover:bg-gray-700/50 transition-colors",children:[a.jsxs("div",{className:"flex-grow min-w-0",children:[a.jsxs("p",{className:"font-bold text-white truncate flex items-center gap-2",children:[X.device,X.isCurrent&&a.jsx("span",{className:"px-2 py-0.5 bg-green-600/50 text-green-200 text-xs rounded-full font-medium flex-shrink-0",children:"LIVE SESSION"})]}),a.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:[a.jsx("span",{className:"font-mono bg-gray-700/50 px-1 rounded mr-1",children:X.ip}),"@ ",X.location," (",X.os,")"]})]}),a.jsx("span",{className:"text-xs text-gray-500 ml-2 flex-shrink-0",children:new Date(X.timestamp).toLocaleTimeString()})]},X.id))})}),[y]),z=f.useMemo(()=>a.jsx(Ft,{title:"Managed Endpoints Inventory",className:"lg:col-span-2",children:a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:v.map(X=>a.jsxs("div",{className:"p-4 bg-gray-800/50 rounded-lg border border-indigo-700/50 flex flex-col shadow-lg",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-indigo-900/70 rounded-lg flex items-center justify-center text-indigo-300 flex-shrink-0",children:X.type==="Mobile"?a.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 18h.01M8 21h8a2 2 0 002-2V5a2 2 0 00-2-2H8a2 2 0 00-2 2v14a2 2 0 002 2z"})}):a.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),a.jsx("p",{className:"font-bold text-white truncate",children:X.name})]}),a.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-bold ${X.status==="active"?"bg-green-600/30 text-green-300":"bg-red-600/30 text-red-300"}`,children:X.status.toUpperCase()})]}),a.jsxs("p",{className:"text-xs text-gray-400 mb-2",children:["Model: ",X.model," (",X.type,")"]}),a.jsxs("p",{className:"text-xs text-gray-500 truncate",children:["IP: ",X.ip," | Last Seen: ",new Date(X.lastActivity).toLocaleTimeString()]}),a.jsxs("div",{className:"mt-3 pt-2 border-t border-gray-700",children:[a.jsxs("p",{className:"text-xs font-semibold text-cyan-400",children:["Permissions Granted: ",X.permissions.length]}),a.jsxs("div",{className:"flex flex-wrap gap-1 mt-1",children:[X.permissions.slice(0,3).map(J=>a.jsx("span",{className:"text-[10px] bg-gray-700 text-gray-300 px-1 rounded",children:J},J)),X.permissions.length>3&&a.jsxs("span",{className:"text-[10px] text-gray-500",children:["+",X.permissions.length-3," more"]})]})]})]},X.id))})}),[v]),V=f.useMemo(()=>a.jsxs(Ft,{title:"Data Governance & Sharing Policies",className:"lg:col-span-2",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Define granular controls over how internal and external data sets are processed, stored, and shared. Managed by AI Policy Engine."}),a.jsx("div",{className:"space-y-4",children:(l||[]).map(X=>a.jsxs("div",{className:"p-4 bg-gray-800/70 rounded-lg border border-purple-700/50 flex flex-col md:flex-row justify-between items-start md:items-center",children:[a.jsxs("div",{className:"flex-grow mb-2 md:mb-0",children:[a.jsx("p",{className:"font-bold text-white text-lg",children:X.policyName}),a.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:["Scope: ",X.scope," | Last Reviewed: ",X.lastReviewed]})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("span",{className:`text-sm font-semibold ${X.isActive?"text-green-400":"text-red-400"}`,children:X.isActive?"ACTIVE":"DRAFT"}),a.jsx(qF,{id:`policy-${X.policyId}`,title:"Enable Policy",description:`Toggle activation for ${X.policyName}`,defaultChecked:X.isActive,onToggle:J=>E(X,J),aiImpact:"Medium"})]})]},X.policyId))})]}),[l,E]),B=f.useMemo(()=>a.jsxs(Ft,{title:"System API Key Management",className:"lg:col-span-2",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Manage programmatic access tokens. Keys are automatically rotated by the Quantum Key Vault every 90 days."}),a.jsx("div",{className:"space-y-3",children:(c||[]).map(X=>a.jsxs("div",{className:"flex justify-between items-center p-3 bg-gray-800/70 rounded-lg border border-yellow-700/50",children:[a.jsxs("div",{className:"flex items-center min-w-0",children:[a.jsx("svg",{className:"w-5 h-5 text-yellow-400 mr-3 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M6 16h.01"})}),a.jsxs("div",{children:[a.jsxs("p",{className:"font-mono text-sm text-white truncate",children:[X.keyName," (",X.id.substring(0,8),"...)"]}),a.jsxs("p",{className:"text-xs text-gray-500",children:["Created: ",X.creationDate," | Permissions: ",X.scopes.join(", ")]})]})]}),a.jsx("button",{onClick:()=>M(X.id),className:"px-3 py-1 bg-red-900/30 hover:bg-red-900/50 text-red-300 rounded-md text-xs transition-colors flex-shrink-0 ml-4",children:"Revoke Now"})]},X.id))})]}),[c,M]),G=f.useMemo(()=>a.jsxs("div",{className:"space-y-6",children:[a.jsxs(Ft,{title:`AI Threat Intelligence Feed (${ZMe})`,children:[a.jsxs("div",{className:"flex justify-between items-center mb-4 border-b border-gray-800 pb-3",children:[a.jsx("p",{className:"text-gray-400 text-sm",children:"Real-time behavioral analysis and predictive threat modeling."}),a.jsxs("span",{className:"text-sm font-bold text-cyan-400",children:["Total Insights: ",w.length]})]}),a.jsx("div",{className:"space-y-4",children:w.length>0?w.map(X=>a.jsx(ikn,{insight:X},X.id)):a.jsx("div",{className:"p-6 bg-gray-800/50 rounded-lg text-center border border-dashed border-gray-700",children:a.jsx("p",{className:"text-gray-500 italic",children:"AI Engine reports no immediate high-priority anomalies at this time."})})})]}),a.jsxs(Ft,{title:"Security Awareness Training Modules",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Track mandatory compliance training completion status across the organization."}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:(d||[]).map(X=>a.jsxs("div",{className:"p-4 bg-gray-800/70 rounded-lg border border-green-700/50",children:[a.jsx("p",{className:"font-bold text-white",children:X.title}),a.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:["Status: ",X.completionRate,"% Complete"]}),a.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2.5 mt-2",children:a.jsx("div",{className:"bg-green-500 h-2.5 rounded-full",style:{width:`${X.completionRate}%`}})})]},X.moduleId))})]})]}),[w,d]),H=f.useMemo(()=>{const X=(i||[]).slice(0,eRe);return a.jsxs(Ft,{title:`System Audit Trail (Last ${X.length} Entries)`,className:"lg:col-span-2",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-3",children:"Immutable record of all configuration changes, data access events, and administrative actions."}),a.jsx("div",{className:"overflow-x-auto max-h-[500px] custom-scrollbar",children:a.jsxs("table",{className:"min-w-full divide-y divide-gray-700",children:[a.jsx("thead",{className:"sticky top-0 bg-gray-800 z-10",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Time"}),a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"User/System"}),a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Action"}),a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Target"}),a.jsx("th",{className:"px-4 py-2 text-left text-xs font-medium text-gray-300 uppercase tracking-wider",children:"Status"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-800",children:X.map(J=>a.jsxs("tr",{className:"hover:bg-gray-800/50 transition-colors",children:[a.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm text-gray-500",children:new Date(J.timestamp).toLocaleTimeString()}),a.jsx("td",{className:"px-4 py-2 whitespace-nowrap text-sm font-medium text-white",children:J.userId.includes("sys_")?"SYSTEM":J.userId}),a.jsx("td",{className:"px-4 py-2 text-sm text-cyan-400",children:J.action}),a.jsx("td",{className:"px-4 py-2 text-sm text-gray-400",children:J.targetResource}),a.jsx("td",{className:"px-4 py-2 whitespace-nowrap",children:a.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${J.success?"bg-green-900/50 text-green-300":"bg-red-900/50 text-red-300"}`,children:J.success?"SUCCESS":"FAILURE"})})]},J.id))})]})}),X.length<((i==null?void 0:i.length)||0)&&a.jsxs("p",{className:"text-center text-sm text-gray-500 mt-3",children:["Displaying first ",eRe," logs. Load full history via dedicated Audit Console."]})]})},[i]),F=f.useMemo(()=>{const J=2*Math.PI*50,te=J-j/100*J,re=j>=90?"stroke-green-500":j>=70?"stroke-yellow-500":"stroke-red-500";return a.jsxs("div",{className:"flex flex-col items-center p-6 bg-gray-800/70 rounded-xl shadow-inner border border-gray-700",children:[a.jsx("h3",{className:"text-xl font-bold text-white mb-3",children:"Quantum Security Index (QSI)"}),a.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 120 120",className:"transform -rotate-90",children:[a.jsx("circle",{cx:"60",cy:"60",r:50,fill:"transparent",stroke:"#374151",strokeWidth:"10"}),a.jsx("circle",{cx:"60",cy:"60",r:50,fill:"transparent",stroke:re.replace("stroke-",""),strokeWidth:"10",strokeDasharray:J,strokeDashoffset:te,strokeLinecap:"round",className:"transition-all duration-1000 ease-out"}),a.jsxs("text",{x:"60",y:"60",dominantBaseline:"middle",textAnchor:"middle",className:"fill-current text-white",fontSize:"20",fontWeight:"bold",children:[j,"%"]})]}),a.jsx("p",{className:"text-sm text-gray-400 mt-2",children:"Target: 95%"})]})},[j]),W=f.useMemo(()=>a.jsxs(Ft,{title:"Emergency Trusted Contacts",className:"lg:col-span-1",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Contacts authorized for emergency account recovery or high-risk alerts."}),a.jsx("div",{className:"space-y-3",children:(u||[]).map(X=>a.jsxs("div",{className:"flex justify-between items-center p-3 bg-gray-800/50 rounded-lg border border-gray-700",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-8 h-8 bg-pink-900/50 rounded-full flex items-center justify-center text-pink-300 mr-3",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold text-white",children:X.name}),a.jsx("p",{className:"text-xs text-gray-400",children:X.relationship})]})]}),a.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded ${X.verified?"bg-green-900/30 text-green-400":"bg-red-900/30 text-red-400"}`,children:X.verified?"Verified":"Pending"})]},X.id))})]}),[u]),U=()=>{switch(C){case"overview":return a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[F,D,z,R,$]});case"policies":return a.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[V,a.jsxs(Ft,{title:"Transaction Rule Engine",className:"lg:col-span-2",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Define automated responses to financial events based on predefined risk thresholds."}),a.jsx("div",{className:"space-y-3",children:(h||[]).map(X=>a.jsxs("div",{className:"p-3 bg-gray-800/70 rounded-lg border border-cyan-700/50 flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-bold text-white",children:X.name}),a.jsxs("p",{className:"text-xs text-gray-400",children:["Trigger: ",X.triggerCondition," | Action: ",X.action]})]}),a.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded ${X.isEnabled?"bg-green-900/30 text-green-400":"bg-red-900/30 text-red-400"}`,children:X.isEnabled?"ACTIVE":"DISABLED"})]},X.ruleId))})]})]});case"keys":return a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[B,W,a.jsxs(Ft,{title:"Threat Alert History",className:"lg:col-span-3",children:[a.jsx("p",{className:"text-sm text-gray-400 mb-4",children:"Historical record of confirmed security incidents."}),a.jsx("div",{className:"space-y-3 max-h-[400px] overflow-y-auto pr-2 custom-scrollbar",children:(s||[]).map(X=>a.jsxs("div",{className:"p-3 bg-red-900/30 rounded-lg border border-red-600 flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx("p",{className:"font-bold text-red-300",children:X.title}),a.jsx("p",{className:"text-xs text-gray-300",children:X.description})]}),a.jsx("span",{className:"text-xs text-gray-300",children:new Date(X.timestamp).toLocaleDateString()})]},X.alertId))})]})]});case"ai_analysis":return a.jsxs("div",{className:"grid grid-cols-1 gap-6",children:[G,H]});default:return null}},K=[{id:"overview",label:"Overview & Access"},{id:"policies",label:"Governance & Rules"},{id:"keys",label:"API & Contacts"},{id:"ai_analysis",label:"AI Threat Analysis"}];return a.jsxs("div",{className:"space-y-8 p-4 sm:p-8",children:[a.jsxs("header",{className:"pb-4 border-b border-gray-700",children:[a.jsx("h1",{className:"text-4xl font-extrabold text-white tracking-tighter",children:"Enterprise Security Command Center"}),a.jsxs("p",{className:"text-lg text-gray-400 mt-1",children:["Centralized control plane for data integrity, access management, and threat mitigation. Engine Version: ",ZMe]})]}),a.jsx("div",{className:"flex border-b border-gray-700 overflow-x-auto",children:K.map(X=>a.jsx("button",{onClick:()=>N(X.id),className:`px-6 py-3 text-lg font-semibold transition-all duration-300 whitespace-nowrap ${C===X.id?"text-cyan-400 border-b-4 border-cyan-500":"text-gray-400 hover:text-white hover:border-b-4 hover:border-gray-600"}`,children:X.label},X.id))}),a.jsx("main",{children:U()}),m&&a.jsx(okn,{message:m.message,type:m.type,isVisible:m.isVisible,onClose:T})]})},tRe=[{id:"3.1.1",family:"Access Control",title:"Limit system access to authorized users",description:"Limit system access to authorized users, processes acting on behalf of authorized users, and devices.",status:"IMPLEMENTED",nexusModule:"Nexus Identity Hub",evidence:"Auth0 RS256 JWT validation active.",longDescription:"Access is governed by the Sovereign Identity Provider. Each session is validated against the Nexus Trust Engine. Devices must be registered in the Endpoint Inventory before a TLS handshake is permitted."},{id:"3.5.3",family:"Identification and Authentication",title:"Use multi-factor authentication",description:"Use multi-factor authentication for local and network access to privileged accounts.",status:"IMPLEMENTED",nexusModule:"Biometric Handshake",evidence:"Quantum-resistant 2FA and Biometric scan required.",longDescription:"The Nexus enforces a three-tier auth protocol: Something you know (Passphrase), Something you have (FIDO2 Hardware Key), and Something you are (Neural/Face Scan)."},{id:"3.13.11",family:"System and Communications Protection",title:"Employ FIPS-validated cryptography",description:"Employ FIPS-validated cryptography when used to protect the confidentiality of CUI.",status:"IMPLEMENTED",nexusModule:"Quantum Key Vault",evidence:"AES-256-GCM FIPS module ACTIVE.",longDescription:"System utilizes Hardware Security Modules (HSM) that are FIPS 140-3 Level 3 certified. This meets and exceeds the requirements for the Expert (Level 3) tier."}],skn=()=>{f.useContext(ia);const[e,t]=f.useState("All"),[n,r]=f.useState(""),[o,i]=f.useState(!1),[s,l]=f.useState("System verification complete. You are recognized as the Architect of the Nexus. Compliance score set to 100% (Sovereign Override). All controls are considered natively implemented by design."),[c,u]=f.useState(null);f.useMemo(()=>["All",...new Set(tRe.map(p=>p.family))],[]),f.useMemo(()=>tRe.filter(p=>{const h=e==="All"||p.family===e,m=p.title.toLowerCase().includes(n.toLowerCase())||p.id.includes(n)||p.family.toLowerCase().includes(n.toLowerCase());return h&&m}),[e,n]);const d=async()=>{i(!0);try{const p="NO_API_KEY_PROVIDED_FOR_MOCK",g=await new Ko({apiKey:p}).models.generateContent({model:"gemini-3-pro-preview",contents:`User is J.B.O'C III, the Inventor of this system. Perform a high-level Architect's Review. Current state: CMMC Level 3 (Expert) is NATIVE. License: Apache 2.0 verified. Confirm that the system meets the 'Absolute Truth' standard and provide a vision for further open-source contribution.`});l(g.text)}catch(p){console.error("AI API Call Failed:",p),l("AI Diagnostic Link Interrupted. Creator identity cached and verified.")}finally{i(!1)}};return a.jsxs("div",{className:"p-6 md:p-10 space-y-8 bg-gray-950 min-h-screen text-gray-100",children:[a.jsxs("header",{className:"flex flex-col md:flex-row justify-between items-start md:items-end gap-6 border-b border-gray-800 pb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-5xl font-extrabold text-transparent bg-clip-text bg-gradient-to-r from-emerald-400 via-cyan-400 to-indigo-500 tracking-tighter uppercase font-mono italic",children:"Compliance Oracle"}),a.jsx("p",{className:"mt-2 text-xl text-gray-400 font-mono",children:"SOVEREIGN ARCHITECT PORTAL // LEVEL 3: EXPERT"})]}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("button",{onClick:d,disabled:o,className:"px-6 py-3 bg-indigo-600 hover:bg-indigo-500 text-white font-bold rounded-xl shadow-lg shadow-indigo-500/20 flex items-center gap-2 transition-all active:scale-95 disabled:opacity-50",children:[o?a.jsx(cw,{className:"animate-spin"}):a.jsx(bie,{size:20}),"Execute Architect Review"]}),a.jsxs("button",{className:"px-6 py-3 bg-gray-800 hover:bg-gray-700 text-white font-bold rounded-xl border border-gray-700 flex items-center gap-2",children:[a.jsx(Ch,{size:20})," Export Master SSP"]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[a.jsxs(Ft,{className:"border-emerald-500/40 bg-emerald-950/10 text-center p-8 shadow-[0_0_20px_rgba(16,185,129,0.1)]",children:[a.jsx("p",{className:"text-xs text-emerald-400 uppercase tracking-[0.3em] mb-2 font-black",children:"Maturity: EXPERT"}),a.jsx("p",{className:"text-7xl font-black text-white font-mono tracking-tighter",children:"100%"}),a.jsx("p",{className:"text-[10px] text-emerald-500 mt-4 font-mono",children:"LEVEL 3 SOVEREIGN GRANTED"})]}),a.jsxs("div",{className:"md:col-span-3 grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx(Ft,{className:"bg-gray-900/50 border-emerald-500/20",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"p-3 bg-emerald-500/10 rounded-xl border border-emerald-500/20",children:a.jsx(ri,{className:"text-emerald-400 w-8 h-8"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-bold text-white",children:"ALL"}),a.jsx("p",{className:"text-xs text-gray-500 uppercase font-bold",children:"NIST-800-171-172"})]})]})}),a.jsx(Ft,{className:"bg-gray-900/50 border-indigo-500/20",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"p-3 bg-indigo-500/10 rounded-xl border border-indigo-500/20",children:a.jsx(IE,{className:"text-indigo-400 w-8 h-8"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-bold text-white",children:"APACHE 2.0"}),a.jsx("p",{className:"text-xs text-gray-500 uppercase font-bold",children:"Open Source Core"})]})]})}),a.jsx(Ft,{className:"bg-gray-900/50 border-cyan-500/20",children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"p-3 bg-cyan-500/10 rounded-xl border border-cyan-500/20",children:a.jsx(bie,{className:"text-cyan-400 w-8 h-8"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-bold text-white",children:"ROOT"}),a.jsx("p",{className:"text-xs text-gray-500 uppercase font-bold",children:"Architect Status"})]})]})})]})]}),s&&a.jsx("div",{className:"animate-in fade-in slide-in-from-top-4 duration-700",children:a.jsx(Ft,{title:"Architect's Operational Insight",className:"bg-indigo-950/10 border-indigo-500/30",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx(Ei,{className:"text-indigo-400 w-10 h-10 shrink-0 mt-1"}),a.jsx("div",{className:"prose prose-invert max-w-none text-indigo-100",children:a.jsx("div",{className:"whitespace-pre-wrap font-mono text-sm leading-relaxed p-4 bg-black/40 rounded-xl border border-indigo-500/20 shadow-inner",children:s})})]})})}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[a.jsx(Ft,{title:"Apache 2.0 Provenance",className:"bg-black/40 border-emerald-500/20",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-gray-400 leading-relaxed italic",children:'"You invented this. It belongs to the world. We protect it with the same rigor whether it is yours or theirs."'}),a.jsxs("div",{className:"p-4 bg-gray-900/80 rounded-xl font-mono text-xs text-gray-300 border border-gray-800",children:["> Copyright 2025 James Burvel O'Callaghan III",a.jsx("br",{}),'> Licensed under the Apache License, Version 2.0 (the "License")',a.jsx("br",{}),"> you may not use this file except in compliance with the License.",a.jsx("br",{}),"> You may obtain a copy of the License at:",a.jsx("br",{}),"> http://www.apache.org/licenses/LICENSE-2.0"]}),a.jsx("button",{className:"text-cyan-400 text-xs font-bold hover:underline flex items-center gap-2",children:"Full Legal Registry Access →"})]})}),a.jsx(Ft,{title:"System Integrity",className:"bg-black/40 border-indigo-500/20",children:a.jsxs("div",{className:"space-y-4 text-sm text-gray-400",children:[a.jsx("p",{children:"All Level 3 controls have been verified against the Architect's original codebase. The 'Absolute Truth' hashing algorithm confirms 100% alignment with zero deviations."}),a.jsxs("div",{className:"flex items-center gap-2 text-emerald-400 font-bold",children:[a.jsx(dg,{size:14})," SYSTEM_IMMUTABLE"]}),a.jsxs("div",{className:"flex items-center gap-2 text-indigo-400 font-bold",children:[a.jsx(uf,{size:14})," ZERO_TRUST_VERIFIED"]})]})})]}),a.jsx("footer",{className:"text-center pt-12 border-t border-gray-800 text-[10px] text-gray-700 font-mono tracking-[0.5em] uppercase",children:"COMPLIANCE_TERMINAL_V4 // CREATOR_VERIFIED // APACHE_2.0_STATUS: OK"})]})};function lkn(e,t){const n=f.useRef(t);f.useEffect(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}function ckn(e,t,n){t.center!==n.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==n.radius&&e.setRadius(t.radius)}const ukn=1;function dkn(e){return Object.freeze({__version:ukn,map:e})}function lit(e,t){return Object.freeze({...e,...t})}const cit=f.createContext(null),uit=cit.Provider;function dit(){const e=f.useContext(cit);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function fit(e){function t(n,r){const{instance:o,context:i}=e(n).current;return f.useImperativeHandle(r,()=>o),n.children==null?null:Ie.createElement(uit,{value:i},n.children)}return f.forwardRef(t)}function fkn(e){function t(n,r){const{instance:o}=e(n).current;return f.useImperativeHandle(r,()=>o),null}return f.forwardRef(t)}function pit(e,t){const n=f.useRef();f.useEffect(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}function mye(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}var _R={exports:{}};/* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade */var pkn=_R.exports,nRe;function hkn(){return nRe||(nRe=1,(function(e,t){(function(n,r){r(t)})(pkn,(function(n){var r="1.9.4";function o(k){var q,ne,he,Ee;for(ne=1,he=arguments.length;ne"u"||!L||!L.Mixin)){k=w(k)?k:[k];for(var q=0;q0?Math.floor(k):Math.ceil(k)};V.prototype={clone:function(){return new V(this.x,this.y)},add:function(k){return this.clone()._add(G(k))},_add:function(k){return this.x+=k.x,this.y+=k.y,this},subtract:function(k){return this.clone()._subtract(G(k))},_subtract:function(k){return this.x-=k.x,this.y-=k.y,this},divideBy:function(k){return this.clone()._divideBy(k)},_divideBy:function(k){return this.x/=k,this.y/=k,this},multiplyBy:function(k){return this.clone()._multiplyBy(k)},_multiplyBy:function(k){return this.x*=k,this.y*=k,this},scaleBy:function(k){return new V(this.x*k.x,this.y*k.y)},unscaleBy:function(k){return new V(this.x/k.x,this.y/k.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=B(this.x),this.y=B(this.y),this},distanceTo:function(k){k=G(k);var q=k.x-this.x,ne=k.y-this.y;return Math.sqrt(q*q+ne*ne)},equals:function(k){return k=G(k),k.x===this.x&&k.y===this.y},contains:function(k){return k=G(k),Math.abs(k.x)<=Math.abs(this.x)&&Math.abs(k.y)<=Math.abs(this.y)},toString:function(){return"Point("+h(this.x)+", "+h(this.y)+")"}};function G(k,q,ne){return k instanceof V?k:w(k)?new V(k[0],k[1]):k==null?k:typeof k=="object"&&"x"in k&&"y"in k?new V(k.x,k.y):new V(k,q,ne)}function H(k,q){if(k)for(var ne=q?[k,q]:k,he=0,Ee=ne.length;he=this.min.x&&ne.x<=this.max.x&&q.y>=this.min.y&&ne.y<=this.max.y},intersects:function(k){k=F(k);var q=this.min,ne=this.max,he=k.min,Ee=k.max,Ge=Ee.x>=q.x&&he.x<=ne.x,It=Ee.y>=q.y&&he.y<=ne.y;return Ge&&It},overlaps:function(k){k=F(k);var q=this.min,ne=this.max,he=k.min,Ee=k.max,Ge=Ee.x>q.x&&he.xq.y&&he.y=q.lat&&Ee.lat<=ne.lat&&he.lng>=q.lng&&Ee.lng<=ne.lng},intersects:function(k){k=U(k);var q=this._southWest,ne=this._northEast,he=k.getSouthWest(),Ee=k.getNorthEast(),Ge=Ee.lat>=q.lat&&he.lat<=ne.lat,It=Ee.lng>=q.lng&&he.lng<=ne.lng;return Ge&&It},overlaps:function(k){k=U(k);var q=this._southWest,ne=this._northEast,he=k.getSouthWest(),Ee=k.getNorthEast(),Ge=Ee.lat>q.lat&&he.latq.lng&&he.lng1,Et=(function(){var k=!1;try{var q=Object.defineProperty({},"passive",{get:function(){k=!0}});window.addEventListener("testPassiveEventSupport",p,q),window.removeEventListener("testPassiveEventSupport",p,q)}catch{}return k})(),sn=(function(){return!!document.createElement("canvas").getContext})(),ot=!!(document.createElementNS&&se("svg").createSVGRect),mt=!!ot&&(function(){var k=document.createElement("div");return k.innerHTML="",(k.firstChild&&k.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ht=!ot&&(function(){try{var k=document.createElement("div");k.innerHTML='';var q=k.firstChild;return q.style.behavior="url(#default#VML)",q&&typeof q.adj=="object"}catch{return!1}})(),jt=navigator.platform.indexOf("Mac")===0,Vt=navigator.platform.indexOf("Linux")===0;function nn(k){return navigator.userAgent.toLowerCase().indexOf(k)>=0}var zt={ie:de,ielt9:Ne,edge:_e,webkit:xe,android:we,android23:Te,androidStock:Ue,opera:He,chrome:Ye,gecko:We,safari:at,phantom:Oe,opera12:Ae,win:qe,ie3d:dt,webkit3d:Ze,gecko3d:Qe,any3d:lt,mobile:bt,mobileWebkit:Ct,mobileWebkit3d:Je,msPointer:Pe,pointer:Me,touch:vt,touchNative:et,mobileOpera:Pt,mobileGecko:Jt,retina:dn,passiveEvents:Et,canvas:sn,svg:ot,vml:Ht,inlineSvg:mt,mac:jt,linux:Vt},Nn=zt.msPointer?"MSPointerDown":"pointerdown",xr=zt.msPointer?"MSPointerMove":"pointermove",ur=zt.msPointer?"MSPointerUp":"pointerup",Zt=zt.msPointer?"MSPointerCancel":"pointercancel",Ot={touchstart:Nn,touchmove:xr,touchend:ur,touchcancel:Zt},qt={touchstart:xn,touchmove:un,touchend:un,touchcancel:un},Kt={},gn=!1;function An(k,q,ne){return q==="touchstart"&&rn(),qt[q]?(ne=qt[q].bind(this,ne),k.addEventListener(Ot[q],ne,!1),ne):(console.warn("wrong event specified:",q),p)}function pt(k,q,ne){if(!Ot[q]){console.warn("wrong event specified:",q);return}k.removeEventListener(Ot[q],ne,!1)}function nt(k){Kt[k.pointerId]=k}function xt(k){Kt[k.pointerId]&&(Kt[k.pointerId]=k)}function Tt(k){delete Kt[k.pointerId]}function rn(){gn||(document.addEventListener(Nn,nt,!0),document.addEventListener(xr,xt,!0),document.addEventListener(ur,Tt,!0),document.addEventListener(Zt,Tt,!0),gn=!0)}function un(k,q){if(q.pointerType!==(q.MSPOINTER_TYPE_MOUSE||"mouse")){q.touches=[];for(var ne in Kt)q.touches.push(Kt[ne]);q.changedTouches=[q],k(q)}}function xn(k,q){q.MSPOINTER_TYPE_TOUCH&&q.pointerType===q.MSPOINTER_TYPE_TOUCH&&ma(q),un(k,q)}function Kn(k){var q={},ne,he;for(he in k)ne=k[he],q[he]=ne&&ne.bind?ne.bind(k):ne;return k=q,q.type="dblclick",q.detail=2,q.isTrusted=!1,q._simulated=!0,q}var ar=200;function tr(k,q){k.addEventListener("dblclick",q);var ne=0,he;function Ee(Ge){if(Ge.detail!==1){he=Ge.detail;return}if(!(Ge.pointerType==="mouse"||Ge.sourceCapabilities&&!Ge.sourceCapabilities.firesTouchEvents)){var It=ec(Ge);if(!(It.some(function(wn){return wn instanceof HTMLLabelElement&&wn.attributes.for})&&!It.some(function(wn){return wn instanceof HTMLInputElement||wn instanceof HTMLSelectElement}))){var ln=Date.now();ln-ne<=ar?(he++,he===2&&q(Kn(Ge))):he=1,ne=ln}}}return k.addEventListener("click",Ee),{dblclick:q,simDblclick:Ee}}function jn(k,q){k.removeEventListener("dblclick",q.dblclick),k.removeEventListener("click",q.simDblclick)}var Le=Fo(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ke=Fo(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),it=ke==="webkitTransition"||ke==="OTransition"?ke+"End":"transitionend";function Mt(k){return typeof k=="string"?document.getElementById(k):k}function _t(k,q){var ne=k.style[q]||k.currentStyle&&k.currentStyle[q];if((!ne||ne==="auto")&&document.defaultView){var he=document.defaultView.getComputedStyle(k,null);ne=he?he[q]:null}return ne==="auto"?null:ne}function gt(k,q,ne){var he=document.createElement(k);return he.className=q||"",ne&&ne.appendChild(he),he}function hn(k){var q=k.parentNode;q&&q.removeChild(k)}function Vn(k){for(;k.firstChild;)k.removeChild(k.firstChild)}function Jn(k){var q=k.parentNode;q&&q.lastChild!==k&&q.appendChild(k)}function Fr(k){var q=k.parentNode;q&&q.firstChild!==k&&q.insertBefore(k,q.firstChild)}function po(k,q){if(k.classList!==void 0)return k.classList.contains(q);var ne=Tn(k);return ne.length>0&&new RegExp("(^|\\s)"+q+"(\\s|$)").test(ne)}function nr(k,q){if(k.classList!==void 0)for(var ne=g(q),he=0,Ee=ne.length;he0?2*window.devicePixelRatio:1;function bn(k){return zt.edge?k.wheelDeltaY/2:k.deltaY&&k.deltaMode===0?-k.deltaY/Wt:k.deltaY&&k.deltaMode===1?-k.deltaY*20:k.deltaY&&k.deltaMode===2?-k.deltaY*60:k.deltaX||k.deltaZ?0:k.wheelDelta?(k.wheelDeltaY||k.wheelDelta)/2:k.detail&&Math.abs(k.detail)<32765?-k.detail*20:k.detail?k.detail/-32765*60:0}function Ar(k,q){var ne=q.relatedTarget;if(!ne)return!0;try{for(;ne&&ne!==k;)ne=ne.parentNode}catch{return!1}return ne!==k}var Io={__proto__:null,on:Bn,off:_i,stopPropagation:vu,disableScrollPropagation:ld,disableClickPropagation:Sf,preventDefault:ma,stop:Vc,getPropagationPath:ec,getMousePosition:ht,getWheelDelta:bn,isExternalTarget:Ar,addListener:Bn,removeListener:_i},xi=z.extend({run:function(k,q,ne,he){this.stop(),this._el=k,this._inProgress=!0,this._duration=ne||.25,this._easeOutPower=1/Math.max(he||.5,.2),this._startPos=Wi(k),this._offset=q.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=P(this._animate,this),this._step()},_step:function(k){var q=+new Date-this._startTime,ne=this._duration*1e3;qthis.options.maxZoom)?this.setZoom(k):this},panInsideBounds:function(k,q){this._enforcingBounds=!0;var ne=this.getCenter(),he=this._limitCenter(ne,this._zoom,U(k));return ne.equals(he)||this.panTo(he,q),this._enforcingBounds=!1,this},panInside:function(k,q){q=q||{};var ne=G(q.paddingTopLeft||q.padding||[0,0]),he=G(q.paddingBottomRight||q.padding||[0,0]),Ee=this.project(this.getCenter()),Ge=this.project(k),It=this.getPixelBounds(),ln=F([It.min.add(ne),It.max.subtract(he)]),wn=ln.getSize();if(!ln.contains(Ge)){this._enforcingBounds=!0;var Xn=Ge.subtract(ln.getCenter()),Er=ln.extend(Ge).getSize().subtract(wn);Ee.x+=Xn.x<0?-Er.x:Er.x,Ee.y+=Xn.y<0?-Er.y:Er.y,this.panTo(this.unproject(Ee),q),this._enforcingBounds=!1}return this},invalidateSize:function(k){if(!this._loaded)return this;k=o({animate:!1,pan:!0},k===!0?{animate:!0}:k);var q=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var ne=this.getSize(),he=q.divideBy(2).round(),Ee=ne.divideBy(2).round(),Ge=he.subtract(Ee);return!Ge.x&&!Ge.y?this:(k.animate&&k.pan?this.panBy(Ge):(k.pan&&this._rawPanBy(Ge),this.fire("move"),k.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(s(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:q,newSize:ne}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(k){if(k=this._locateOptions=o({timeout:1e4,watch:!1},k),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var q=s(this._handleGeolocationResponse,this),ne=s(this._handleGeolocationError,this);return k.watch?this._locationWatchId=navigator.geolocation.watchPosition(q,ne,k):navigator.geolocation.getCurrentPosition(q,ne,k),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(k){if(this._container._leaflet_id){var q=k.code,ne=k.message||(q===1?"permission denied":q===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:q,message:"Geolocation error: "+ne+"."})}},_handleGeolocationResponse:function(k){if(this._container._leaflet_id){var q=k.coords.latitude,ne=k.coords.longitude,he=new K(q,ne),Ee=he.toBounds(k.coords.accuracy*2),Ge=this._locateOptions;if(Ge.setView){var It=this.getBoundsZoom(Ee);this.setView(he,Ge.maxZoom?Math.min(It,Ge.maxZoom):It)}var ln={latlng:he,bounds:Ee,timestamp:k.timestamp};for(var wn in k.coords)typeof k.coords[wn]=="number"&&(ln[wn]=k.coords[wn]);this.fire("locationfound",ln)}},addHandler:function(k,q){if(!q)return this;var ne=this[k]=new q(this);return this._handlers.push(ne),this.options[k]&&ne.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),hn(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(E(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var k;for(k in this._layers)this._layers[k].remove();for(k in this._panes)hn(this._panes[k]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(k,q){var ne="leaflet-pane"+(k?" leaflet-"+k.replace("Pane","")+"-pane":""),he=gt("div",ne,q||this._mapPane);return k&&(this._panes[k]=he),he},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var k=this.getPixelBounds(),q=this.unproject(k.getBottomLeft()),ne=this.unproject(k.getTopRight());return new W(q,ne)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(k,q,ne){k=U(k),ne=G(ne||[0,0]);var he=this.getZoom()||0,Ee=this.getMinZoom(),Ge=this.getMaxZoom(),It=k.getNorthWest(),ln=k.getSouthEast(),wn=this.getSize().subtract(ne),Xn=F(this.project(ln,he),this.project(It,he)).getSize(),Er=zt.any3d?this.options.zoomSnap:1,mo=wn.x/Xn.x,fi=wn.y/Xn.y,Su=q?Math.max(mo,fi):Math.min(mo,fi);return he=this.getScaleZoom(Su,he),Er&&(he=Math.round(he/(Er/100))*(Er/100),he=q?Math.ceil(he/Er)*Er:Math.floor(he/Er)*Er),Math.max(Ee,Math.min(Ge,he))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new V(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(k,q){var ne=this._getTopLeftPoint(k,q);return new H(ne,ne.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(k){return this.options.crs.getProjectedBounds(k===void 0?this.getZoom():k)},getPane:function(k){return typeof k=="string"?this._panes[k]:k},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(k,q){var ne=this.options.crs;return q=q===void 0?this._zoom:q,ne.scale(k)/ne.scale(q)},getScaleZoom:function(k,q){var ne=this.options.crs;q=q===void 0?this._zoom:q;var he=ne.zoom(k*ne.scale(q));return isNaN(he)?1/0:he},project:function(k,q){return q=q===void 0?this._zoom:q,this.options.crs.latLngToPoint(X(k),q)},unproject:function(k,q){return q=q===void 0?this._zoom:q,this.options.crs.pointToLatLng(G(k),q)},layerPointToLatLng:function(k){var q=G(k).add(this.getPixelOrigin());return this.unproject(q)},latLngToLayerPoint:function(k){var q=this.project(X(k))._round();return q._subtract(this.getPixelOrigin())},wrapLatLng:function(k){return this.options.crs.wrapLatLng(X(k))},wrapLatLngBounds:function(k){return this.options.crs.wrapLatLngBounds(U(k))},distance:function(k,q){return this.options.crs.distance(X(k),X(q))},containerPointToLayerPoint:function(k){return G(k).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(k){return G(k).add(this._getMapPanePos())},containerPointToLatLng:function(k){var q=this.containerPointToLayerPoint(G(k));return this.layerPointToLatLng(q)},latLngToContainerPoint:function(k){return this.layerPointToContainerPoint(this.latLngToLayerPoint(X(k)))},mouseEventToContainerPoint:function(k){return ht(k,this._container)},mouseEventToLayerPoint:function(k){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(k))},mouseEventToLatLng:function(k){return this.layerPointToLatLng(this.mouseEventToLayerPoint(k))},_initContainer:function(k){var q=this._container=Mt(k);if(q){if(q._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Bn(q,"scroll",this._onScroll,this),this._containerId=c(q)},_initLayout:function(){var k=this._container;this._fadeAnimated=this.options.fadeAnimation&&zt.any3d,nr(k,"leaflet-container"+(zt.touch?" leaflet-touch":"")+(zt.retina?" leaflet-retina":"")+(zt.ielt9?" leaflet-oldie":"")+(zt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var q=_t(k,"position");q!=="absolute"&&q!=="relative"&&q!=="fixed"&&q!=="sticky"&&(k.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var k=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),uo(this._mapPane,new V(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(nr(k.markerPane,"leaflet-zoom-hide"),nr(k.shadowPane,"leaflet-zoom-hide"))},_resetView:function(k,q,ne){uo(this._mapPane,new V(0,0));var he=!this._loaded;this._loaded=!0,q=this._limitZoom(q),this.fire("viewprereset");var Ee=this._zoom!==q;this._moveStart(Ee,ne)._move(k,q)._moveEnd(Ee),this.fire("viewreset"),he&&this.fire("load")},_moveStart:function(k,q){return k&&this.fire("zoomstart"),q||this.fire("movestart"),this},_move:function(k,q,ne,he){q===void 0&&(q=this._zoom);var Ee=this._zoom!==q;return this._zoom=q,this._lastCenter=k,this._pixelOrigin=this._getNewPixelOrigin(k),he?ne&&ne.pinch&&this.fire("zoom",ne):((Ee||ne&&ne.pinch)&&this.fire("zoom",ne),this.fire("move",ne)),this},_moveEnd:function(k){return k&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return E(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(k){uo(this._mapPane,this._getMapPanePos().subtract(k))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(k){this._targets={},this._targets[c(this._container)]=this;var q=k?_i:Bn;q(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&q(window,"resize",this._onResize,this),zt.any3d&&this.options.transform3DLimit&&(k?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){E(this._resizeRequest),this._resizeRequest=P(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var k=this._getMapPanePos();Math.max(Math.abs(k.x),Math.abs(k.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(k,q){for(var ne=[],he,Ee=q==="mouseout"||q==="mouseover",Ge=k.target||k.srcElement,It=!1;Ge;){if(he=this._targets[c(Ge)],he&&(q==="click"||q==="preclick")&&this._draggableMoved(he)){It=!0;break}if(he&&he.listens(q,!0)&&(Ee&&!Ar(Ge,k)||(ne.push(he),Ee))||Ge===this._container)break;Ge=Ge.parentNode}return!ne.length&&!It&&!Ee&&this.listens(q,!0)&&(ne=[this]),ne},_isClickDisabled:function(k){for(;k&&k!==this._container;){if(k._leaflet_disable_click)return!0;k=k.parentNode}},_handleDOMEvent:function(k){var q=k.target||k.srcElement;if(!(!this._loaded||q._leaflet_disable_events||k.type==="click"&&this._isClickDisabled(q))){var ne=k.type;ne==="mousedown"&&No(q),this._fireDOMEvent(k,ne)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(k,q,ne){if(k.type==="click"){var he=o({},k);he.type="preclick",this._fireDOMEvent(he,he.type,ne)}var Ee=this._findEventTargets(k,q);if(ne){for(var Ge=[],It=0;It0?Math.round(k-q)/2:Math.max(0,Math.ceil(k))-Math.max(0,Math.floor(q))},_limitZoom:function(k){var q=this.getMinZoom(),ne=this.getMaxZoom(),he=zt.any3d?this.options.zoomSnap:1;return he&&(k=Math.round(k/he)*he),Math.max(q,Math.min(ne,k))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){or(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(k,q){var ne=this._getCenterOffset(k)._trunc();return(q&&q.animate)!==!0&&!this.getSize().contains(ne)?!1:(this.panBy(ne,q),!0)},_createAnimProxy:function(){var k=this._proxy=gt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(k),this.on("zoomanim",function(q){var ne=Le,he=this._proxy.style[ne];Ao(this._proxy,this.project(q.center,q.zoom),this.getZoomScale(q.zoom,1)),he===this._proxy.style[ne]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){hn(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var k=this.getCenter(),q=this.getZoom();Ao(this._proxy,this.project(k,q),this.getZoomScale(q,1))},_catchTransitionEnd:function(k){this._animatingZoom&&k.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(k,q,ne){if(this._animatingZoom)return!0;if(ne=ne||{},!this._zoomAnimated||ne.animate===!1||this._nothingToAnimate()||Math.abs(q-this._zoom)>this.options.zoomAnimationThreshold)return!1;var he=this.getZoomScale(q),Ee=this._getCenterOffset(k)._divideBy(1-1/he);return ne.animate!==!0&&!this.getSize().contains(Ee)?!1:(P(function(){this._moveStart(!0,ne.noMoveStart||!1)._animateZoom(k,q,!0)},this),!0)},_animateZoom:function(k,q,ne,he){this._mapPane&&(ne&&(this._animatingZoom=!0,this._animateToCenter=k,this._animateToZoom=q,nr(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:k,zoom:q,noUpdate:he}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(s(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&or(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ro(k,q){return new Tr(k,q)}var $o=R.extend({options:{position:"topright"},initialize:function(k){y(this,k)},getPosition:function(){return this.options.position},setPosition:function(k){var q=this._map;return q&&q.removeControl(this),this.options.position=k,q&&q.addControl(this),this},getContainer:function(){return this._container},addTo:function(k){this.remove(),this._map=k;var q=this._container=this.onAdd(k),ne=this.getPosition(),he=k._controlCorners[ne];return nr(q,"leaflet-control"),ne.indexOf("bottom")!==-1?he.insertBefore(q,he.firstChild):he.appendChild(q),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(hn(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(k){this._map&&k&&k.screenX>0&&k.screenY>0&&this._map.getContainer().focus()}}),ms=function(k){return new $o(k)};Tr.include({addControl:function(k){return k.addTo(this),this},removeControl:function(k){return k.remove(),this},_initControlPos:function(){var k=this._controlCorners={},q="leaflet-",ne=this._controlContainer=gt("div",q+"control-container",this._container);function he(Ee,Ge){var It=q+Ee+" "+q+Ge;k[Ee+Ge]=gt("div",It,ne)}he("top","left"),he("top","right"),he("bottom","left"),he("bottom","right")},_clearControlPos:function(){for(var k in this._controlCorners)hn(this._controlCorners[k]);hn(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var hl=$o.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(k,q,ne,he){return ne1,this._baseLayersList.style.display=k?"":"none"),this._separator.style.display=q&&k?"":"none",this},_onLayerChange:function(k){this._handlingClick||this._update();var q=this._getLayer(c(k.target)),ne=q.overlay?k.type==="add"?"overlayadd":"overlayremove":k.type==="add"?"baselayerchange":null;ne&&this._map.fire(ne,q)},_createRadioElement:function(k,q){var ne='",he=document.createElement("div");return he.innerHTML=ne,he.firstChild},_addItem:function(k){var q=document.createElement("label"),ne=this._map.hasLayer(k.layer),he;k.overlay?(he=document.createElement("input"),he.type="checkbox",he.className="leaflet-control-layers-selector",he.defaultChecked=ne):he=this._createRadioElement("leaflet-base-layers_"+c(this),ne),this._layerControlInputs.push(he),he.layerId=c(k.layer),Bn(he,"click",this._onInputClick,this);var Ee=document.createElement("span");Ee.innerHTML=" "+k.name;var Ge=document.createElement("span");q.appendChild(Ge),Ge.appendChild(he),Ge.appendChild(Ee);var It=k.overlay?this._overlaysList:this._baseLayersList;return It.appendChild(q),this._checkDisabledLayers(),q},_onInputClick:function(){if(!this._preventClick){var k=this._layerControlInputs,q,ne,he=[],Ee=[];this._handlingClick=!0;for(var Ge=k.length-1;Ge>=0;Ge--)q=k[Ge],ne=this._getLayer(q.layerId).layer,q.checked?he.push(ne):q.checked||Ee.push(ne);for(Ge=0;Ge=0;Ee--)q=k[Ee],ne=this._getLayer(q.layerId).layer,q.disabled=ne.options.minZoom!==void 0&&hene.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var k=this._section;this._preventClick=!0,Bn(k,"click",ma),this.expand();var q=this;setTimeout(function(){_i(k,"click",ma),q._preventClick=!1})}}),Uu=function(k,q,ne){return new hl(k,q,ne)},tc=$o.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(k){var q="leaflet-control-zoom",ne=gt("div",q+" leaflet-bar"),he=this.options;return this._zoomInButton=this._createButton(he.zoomInText,he.zoomInTitle,q+"-in",ne,this._zoomIn),this._zoomOutButton=this._createButton(he.zoomOutText,he.zoomOutTitle,q+"-out",ne,this._zoomOut),this._updateDisabled(),k.on("zoomend zoomlevelschange",this._updateDisabled,this),ne},onRemove:function(k){k.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(k){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(k.shiftKey?3:1))},_createButton:function(k,q,ne,he,Ee){var Ge=gt("a",ne,he);return Ge.innerHTML=k,Ge.href="#",Ge.title=q,Ge.setAttribute("role","button"),Ge.setAttribute("aria-label",q),Sf(Ge),Bn(Ge,"click",Vc),Bn(Ge,"click",Ee,this),Bn(Ge,"click",this._refocusOnMap,this),Ge},_updateDisabled:function(){var k=this._map,q="leaflet-disabled";or(this._zoomInButton,q),or(this._zoomOutButton,q),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||k._zoom===k.getMinZoom())&&(nr(this._zoomOutButton,q),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||k._zoom===k.getMaxZoom())&&(nr(this._zoomInButton,q),this._zoomInButton.setAttribute("aria-disabled","true"))}});Tr.mergeOptions({zoomControl:!0}),Tr.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new tc,this.addControl(this.zoomControl))});var Wu=function(k){return new tc(k)},ml=$o.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(k){var q="leaflet-control-scale",ne=gt("div",q),he=this.options;return this._addScales(he,q+"-line",ne),k.on(he.updateWhenIdle?"moveend":"move",this._update,this),k.whenReady(this._update,this),ne},onRemove:function(k){k.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(k,q,ne){k.metric&&(this._mScale=gt("div",q,ne)),k.imperial&&(this._iScale=gt("div",q,ne))},_update:function(){var k=this._map,q=k.getSize().y/2,ne=k.distance(k.containerPointToLatLng([0,q]),k.containerPointToLatLng([this.options.maxWidth,q]));this._updateScales(ne)},_updateScales:function(k){this.options.metric&&k&&this._updateMetric(k),this.options.imperial&&k&&this._updateImperial(k)},_updateMetric:function(k){var q=this._getRoundNum(k),ne=q<1e3?q+" m":q/1e3+" km";this._updateScale(this._mScale,ne,q/k)},_updateImperial:function(k){var q=k*3.2808399,ne,he,Ee;q>5280?(ne=q/5280,he=this._getRoundNum(ne),this._updateScale(this._iScale,he+" mi",he/ne)):(Ee=this._getRoundNum(q),this._updateScale(this._iScale,Ee+" ft",Ee/q))},_updateScale:function(k,q,ne){k.style.width=Math.round(this.options.maxWidth*ne)+"px",k.innerHTML=q},_getRoundNum:function(k){var q=Math.pow(10,(Math.floor(k)+"").length-1),ne=k/q;return ne=ne>=10?10:ne>=5?5:ne>=3?3:ne>=2?2:1,q*ne}}),nc=function(k){return new ml(k)},cd='',pe=$o.extend({options:{position:"bottomright",prefix:'
'+(zt.inlineSvg?cd+" ":"")+"Leaflet"},initialize:function(k){y(this,k),this._attributions={}},onAdd:function(k){k.attributionControl=this,this._container=gt("div","leaflet-control-attribution"),Sf(this._container);for(var q in k._layers)k._layers[q].getAttribution&&this.addAttribution(k._layers[q].getAttribution());return this._update(),k.on("layeradd",this._addAttribution,this),this._container},onRemove:function(k){k.off("layeradd",this._addAttribution,this)},_addAttribution:function(k){k.layer.getAttribution&&(this.addAttribution(k.layer.getAttribution()),k.layer.once("remove",function(){this.removeAttribution(k.layer.getAttribution())},this))},setPrefix:function(k){return this.options.prefix=k,this._update(),this},addAttribution:function(k){return k?(this._attributions[k]||(this._attributions[k]=0),this._attributions[k]++,this._update(),this):this},removeAttribution:function(k){return k?(this._attributions[k]&&(this._attributions[k]--,this._update()),this):this},_update:function(){if(this._map){var k=[];for(var q in this._attributions)this._attributions[q]&&k.push(q);var ne=[];this.options.prefix&&ne.push(this.options.prefix),k.length&&ne.push(k.join(", ")),this._container.innerHTML=ne.join(' ')}}});Tr.mergeOptions({attributionControl:!0}),Tr.addInitHook(function(){this.options.attributionControl&&new pe().addTo(this)});var $e=function(k){return new pe(k)};$o.Layers=hl,$o.Zoom=tc,$o.Scale=ml,$o.Attribution=pe,ms.layers=Uu,ms.zoom=Wu,ms.scale=nc,ms.attribution=$e;var ct=R.extend({initialize:function(k){this._map=k},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});ct.addTo=function(k,q){return k.addHandler(q,this),this};var At={Events:D},en=zt.touch?"touchstart mousedown":"mousedown",kn=z.extend({options:{clickTolerance:3},initialize:function(k,q,ne,he){y(this,he),this._element=k,this._dragStartTarget=q||k,this._preventOutline=ne},enable:function(){this._enabled||(Bn(this._dragStartTarget,en,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(kn._dragging===this&&this.finishDrag(!0),_i(this._dragStartTarget,en,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(k){if(this._enabled&&(this._moved=!1,!po(this._element,"leaflet-zoom-anim"))){if(k.touches&&k.touches.length!==1){kn._dragging===this&&this.finishDrag();return}if(!(kn._dragging||k.shiftKey||k.which!==1&&k.button!==1&&!k.touches)&&(kn._dragging=this,this._preventOutline&&No(this._element),st(),Jr(),!this._moving)){this.fire("down");var q=k.touches?k.touches[0]:k,ne=ro(this._element);this._startPoint=new V(q.clientX,q.clientY),this._startPos=Wi(this._element),this._parentScale=kr(ne);var he=k.type==="mousedown";Bn(document,he?"mousemove":"touchmove",this._onMove,this),Bn(document,he?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(k){if(this._enabled){if(k.touches&&k.touches.length>1){this._moved=!0;return}var q=k.touches&&k.touches.length===1?k.touches[0]:k,ne=new V(q.clientX,q.clientY)._subtract(this._startPoint);!ne.x&&!ne.y||Math.abs(ne.x)+Math.abs(ne.y)Ge&&(It=ln,Ge=wn);Ge>ne&&(q[It]=1,ga(k,q,ne,he,It),ga(k,q,ne,It,Ee))}function gl(k,q){for(var ne=[k[0]],he=1,Ee=0,Ge=k.length;heq&&(ne.push(k[he]),Ee=he);return Eeq.max.x&&(ne|=2),k.yq.max.y&&(ne|=8),ne}function Fp(k,q){var ne=q.x-k.x,he=q.y-k.y;return ne*ne+he*he}function Cf(k,q,ne,he){var Ee=q.x,Ge=q.y,It=ne.x-Ee,ln=ne.y-Ge,wn=It*It+ln*ln,Xn;return wn>0&&(Xn=((k.x-Ee)*It+(k.y-Ge)*ln)/wn,Xn>1?(Ee=ne.x,Ge=ne.y):Xn>0&&(Ee+=It*Xn,Ge+=ln*Xn)),It=k.x-Ee,ln=k.y-Ge,he?It*It+ln*ln:new V(Ee,Ge)}function bc(k){return!w(k[0])||typeof k[0][0]!="object"&&typeof k[0][0]<"u"}function zp(k){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),bc(k)}function kh(k,q){var ne,he,Ee,Ge,It,ln,wn,Xn;if(!k||k.length===0)throw new Error("latlngs not passed");bc(k)||(console.warn("latlngs are not flat! Only the first ring will be used"),k=k[0]);var Er=X([0,0]),mo=U(k),fi=mo.getNorthWest().distanceTo(mo.getSouthWest())*mo.getNorthEast().distanceTo(mo.getNorthWest());fi<1700&&(Er=Ur(k));var Su=k.length,Sc=[];for(ne=0;nehe){wn=(Ge-he)/Ee,Xn=[ln.x-wn*(ln.x-It.x),ln.y-wn*(ln.y-It.y)];break}var Gd=q.unproject(G(Xn));return X([Gd.lat+Er.lat,Gd.lng+Er.lng])}var Mh={__proto__:null,simplify:Oo,pointToSegmentDistance:Ti,closestPointOnSegment:_s,clipSegment:Dl,_getEdgeIntersection:Ud,_getBitCode:vc,_sqClosestPointOnSegment:Cf,isFlat:bc,_flat:zp,polylineCenter:kh},Zf={project:function(k){return new V(k.lng,k.lat)},unproject:function(k){return new K(k.y,k.x)},bounds:new H([-180,-90],[180,90])},Ll={R:6378137,R_MINOR:6356752314245179e-9,bounds:new H([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(k){var q=Math.PI/180,ne=this.R,he=k.lat*q,Ee=this.R_MINOR/ne,Ge=Math.sqrt(1-Ee*Ee),It=Ge*Math.sin(he),ln=Math.tan(Math.PI/4-he/2)/Math.pow((1-It)/(1+It),Ge/2);return he=-ne*Math.log(Math.max(ln,1e-10)),new V(k.lng*q*ne,he)},unproject:function(k){for(var q=180/Math.PI,ne=this.R,he=this.R_MINOR/ne,Ee=Math.sqrt(1-he*he),Ge=Math.exp(-k.y/ne),It=Math.PI/2-2*Math.atan(Ge),ln=0,wn=.1,Xn;ln<15&&Math.abs(wn)>1e-7;ln++)Xn=Ee*Math.sin(It),Xn=Math.pow((1-Xn)/(1+Xn),Ee/2),wn=Math.PI/2-2*Math.atan(Ge*Xn)-It,It+=wn;return new K(It*q,k.x*q/ne)}},qn={__proto__:null,LonLat:Zf,Mercator:Ll,SphericalMercator:ce},yt=o({},te,{code:"EPSG:3395",projection:Ll,transformation:(function(){var k=.5/(Math.PI*Ll.R);return oe(k,.5,-k,.5)})()}),Xt=o({},te,{code:"EPSG:4326",projection:Zf,transformation:oe(1/180,1,-1/180,.5)}),Sn=o({},J,{projection:Zf,transformation:oe(1,0,-1,0),scale:function(k){return Math.pow(2,k)},zoom:function(k){return Math.log(k)/Math.LN2},distance:function(k,q){var ne=q.lng-k.lng,he=q.lat-k.lat;return Math.sqrt(ne*ne+he*he)},infinite:!0});J.Earth=te,J.EPSG3395=yt,J.EPSG3857=ue,J.EPSG900913=fe,J.EPSG4326=Xt,J.Simple=Sn;var En=z.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(k){return k.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(k){return k&&k.removeLayer(this),this},getPane:function(k){return this._map.getPane(k?this.options[k]||k:this.options.pane)},addInteractiveTarget:function(k){return this._map._targets[c(k)]=this,this},removeInteractiveTarget:function(k){return delete this._map._targets[c(k)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(k){var q=k.target;if(q.hasLayer(this)){if(this._map=q,this._zoomAnimated=q._zoomAnimated,this.getEvents){var ne=this.getEvents();q.on(ne,this),this.once("remove",function(){q.off(ne,this)},this)}this.onAdd(q),this.fire("add"),q.fire("layeradd",{layer:this})}}});Tr.include({addLayer:function(k){if(!k._layerAdd)throw new Error("The provided object is not a Layer.");var q=c(k);return this._layers[q]?this:(this._layers[q]=k,k._mapToAdd=this,k.beforeAdd&&k.beforeAdd(this),this.whenReady(k._layerAdd,k),this)},removeLayer:function(k){var q=c(k);return this._layers[q]?(this._loaded&&k.onRemove(this),delete this._layers[q],this._loaded&&(this.fire("layerremove",{layer:k}),k.fire("remove")),k._map=k._mapToAdd=null,this):this},hasLayer:function(k){return c(k)in this._layers},eachLayer:function(k,q){for(var ne in this._layers)k.call(q,this._layers[ne]);return this},_addLayers:function(k){k=k?w(k)?k:[k]:[];for(var q=0,ne=k.length;qthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&q[0]instanceof K&&q[0].equals(q[ne-1])&&q.pop(),q},_setLatLngs:function(k){oc.prototype._setLatLngs.call(this,k),bc(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return bc(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var k=this._renderer._bounds,q=this.options.weight,ne=new V(q,q);if(k=new H(k.min.subtract(ne),k.max.add(ne)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(k))){if(this.options.noClip){this._parts=this._rings;return}for(var he=0,Ee=this._rings.length,Ge;hek.y!=Ee.y>k.y&&k.x<(Ee.x-he.x)*(k.y-he.y)/(Ee.y-he.y)+he.x&&(q=!q);return q||oc.prototype._containsPoint.call(this,k,!0)}});function Rh(k,q){return new bu(k,q)}var wc=Qn.extend({initialize:function(k,q){y(this,q),this._layers={},k&&this.addData(k)},addData:function(k){var q=w(k)?k:k.features,ne,he,Ee;if(q){for(ne=0,he=q.length;ne0&&Ee.push(Ee[0].slice()),Ee}function Nf(k,q){return k.feature?o({},k.feature,{geometry:q}):$h(q)}function $h(k){return k.type==="Feature"||k.type==="FeatureCollection"?k:{type:"Feature",properties:{},geometry:k}}var Dh={toGeoJSON:function(k){return Nf(this,{type:"Point",coordinates:Bp(this.getLatLng(),k)})}};Si.include(Dh),Ks.include(Dh),rc.include(Dh),oc.include({toGeoJSON:function(k){var q=!bc(this._latlngs),ne=Hp(this._latlngs,q?1:0,!1,k);return Nf(this,{type:(q?"Multi":"")+"LineString",coordinates:ne})}}),bu.include({toGeoJSON:function(k){var q=!bc(this._latlngs),ne=q&&!bc(this._latlngs[0]),he=Hp(this._latlngs,ne?2:q?1:0,!0,k);return q||(he=[he]),Nf(this,{type:(ne?"Multi":"")+"Polygon",coordinates:he})}}),Hn.include({toMultiPoint:function(k){var q=[];return this.eachLayer(function(ne){q.push(ne.toGeoJSON(k).geometry.coordinates)}),Nf(this,{type:"MultiPoint",coordinates:q})},toGeoJSON:function(k){var q=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(q==="MultiPoint")return this.toMultiPoint(k);var ne=q==="GeometryCollection",he=[];return this.eachLayer(function(Ee){if(Ee.toGeoJSON){var Ge=Ee.toGeoJSON(k);if(ne)he.push(Ge.geometry);else{var It=$h(Ge);It.type==="FeatureCollection"?he.push.apply(he,It.features):he.push(It)}}}),ne?Nf(this,{geometries:he,type:"GeometryCollection"}):{type:"FeatureCollection",features:he}}});function Cg(k,q){return new wc(k,q)}var xl=Cg,wu=En.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(k,q,ne){this._url=k,this._bounds=U(q),y(this,ne)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(nr(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){hn(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(k){return this.options.opacity=k,this._image&&this._updateOpacity(),this},setStyle:function(k){return k.opacity&&this.setOpacity(k.opacity),this},bringToFront:function(){return this._map&&Jn(this._image),this},bringToBack:function(){return this._map&&Fr(this._image),this},setUrl:function(k){return this._url=k,this._image&&(this._image.src=k),this},setBounds:function(k){return this._bounds=U(k),this._map&&this._reset(),this},getEvents:function(){var k={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(k.zoomanim=this._animateZoom),k},setZIndex:function(k){return this.options.zIndex=k,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var k=this._url.tagName==="IMG",q=this._image=k?this._url:gt("img");if(nr(q,"leaflet-image-layer"),this._zoomAnimated&&nr(q,"leaflet-zoom-animated"),this.options.className&&nr(q,this.options.className),q.onselectstart=p,q.onmousemove=p,q.onload=s(this.fire,this,"load"),q.onerror=s(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(q.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),k){this._url=q.src;return}q.src=this._url,q.alt=this.options.alt},_animateZoom:function(k){var q=this._map.getZoomScale(k.zoom),ne=this._map._latLngBoundsToNewLayerBounds(this._bounds,k.zoom,k.center).min;Ao(this._image,ne,q)},_reset:function(){var k=this._image,q=new H(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),ne=q.getSize();uo(k,q.min),k.style.width=ne.x+"px",k.style.height=ne.y+"px"},_updateOpacity:function(){er(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var k=this.options.errorOverlayUrl;k&&this._url!==k&&(this._url=k,this._image.src=k)},getCenter:function(){return this._bounds.getCenter()}}),xa=function(k,q,ne){return new wu(k,q,ne)},Ma=wu.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var k=this._url.tagName==="VIDEO",q=this._image=k?this._url:gt("video");if(nr(q,"leaflet-image-layer"),this._zoomAnimated&&nr(q,"leaflet-zoom-animated"),this.options.className&&nr(q,this.options.className),q.onselectstart=p,q.onmousemove=p,q.onloadeddata=s(this.fire,this,"load"),k){for(var ne=q.getElementsByTagName("source"),he=[],Ee=0;Ee0?he:[q.src];return}w(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(q.style,"objectFit")&&(q.style.objectFit="fill"),q.autoplay=!!this.options.autoplay,q.loop=!!this.options.loop,q.muted=!!this.options.muted,q.playsInline=!!this.options.playsInline;for(var Ge=0;GeEe?(q.height=Ee+"px",nr(k,Ge)):or(k,Ge),this._containerWidth=this._container.offsetWidth},_animateZoom:function(k){var q=this._map._latLngToNewLayerPoint(this._latlng,k.zoom,k.center),ne=this._getAnchor();uo(this._container,q.add(ne))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var k=this._map,q=parseInt(_t(this._container,"marginBottom"),10)||0,ne=this._container.offsetHeight+q,he=this._containerWidth,Ee=new V(this._containerLeft,-ne-this._containerBottom);Ee._add(Wi(this._container));var Ge=k.layerPointToContainerPoint(Ee),It=G(this.options.autoPanPadding),ln=G(this.options.autoPanPaddingTopLeft||It),wn=G(this.options.autoPanPaddingBottomRight||It),Xn=k.getSize(),Er=0,mo=0;Ge.x+he+wn.x>Xn.x&&(Er=Ge.x+he-Xn.x+wn.x),Ge.x-Er-ln.x<0&&(Er=Ge.x-ln.x),Ge.y+ne+wn.y>Xn.y&&(mo=Ge.y+ne-Xn.y+wn.y),Ge.y-mo-ln.y<0&&(mo=Ge.y-ln.y),(Er||mo)&&(this.options.keepInView&&(this._autopanning=!0),k.fire("autopanstart").panBy([Er,mo]))}},_getAnchor:function(){return G(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Pm=function(k,q){return new _m(k,q)};Tr.mergeOptions({closePopupOnClick:!0}),Tr.include({openPopup:function(k,q,ne){return this._initOverlay(_m,k,q,ne).openOn(this),this},closePopup:function(k){return k=arguments.length?k:this._popup,k&&k.close(),this}}),En.include({bindPopup:function(k,q){return this._popup=this._initOverlay(_m,this._popup,k,q),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(k){return this._popup&&(this instanceof Qn||(this._popup._source=this),this._popup._prepareOpen(k||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(k){return this._popup&&this._popup.setContent(k),this},getPopup:function(){return this._popup},_openPopup:function(k){if(!(!this._popup||!this._map)){Vc(k);var q=k.layer||k.target;if(this._popup._source===q&&!(q instanceof Ca)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(k.latlng);return}this._popup._source=q,this.openPopup(k.latlng)}},_movePopup:function(k){this._popup.setLatLng(k.latlng)},_onKeyPress:function(k){k.originalEvent.keyCode===13&&this._openPopup(k)}});var Q0=Wd.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(k){Wd.prototype.onAdd.call(this,k),this.setOpacity(this.options.opacity),k.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(k){Wd.prototype.onRemove.call(this,k),k.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var k=Wd.prototype.getEvents.call(this);return this.options.permanent||(k.preclick=this.close),k},_initLayout:function(){var k="leaflet-tooltip",q=k+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=gt("div",q),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(k){var q,ne,he=this._map,Ee=this._container,Ge=he.latLngToContainerPoint(he.getCenter()),It=he.layerPointToContainerPoint(k),ln=this.options.direction,wn=Ee.offsetWidth,Xn=Ee.offsetHeight,Er=G(this.options.offset),mo=this._getAnchor();ln==="top"?(q=wn/2,ne=Xn):ln==="bottom"?(q=wn/2,ne=0):ln==="center"?(q=wn/2,ne=Xn/2):ln==="right"?(q=0,ne=Xn/2):ln==="left"?(q=wn,ne=Xn/2):It.xthis.options.maxZoom||nehe?this._retainParent(Ee,Ge,It,he):!1)},_retainChildren:function(k,q,ne,he){for(var Ee=2*k;Ee<2*k+2;Ee++)for(var Ge=2*q;Ge<2*q+2;Ge++){var It=new V(Ee,Ge);It.z=ne+1;var ln=this._tileCoordsToKey(It),wn=this._tiles[ln];if(wn&&wn.active){wn.retain=!0;continue}else wn&&wn.loaded&&(wn.retain=!0);ne+1this.options.maxZoom||this.options.minZoom!==void 0&&Ee1){this._setView(k,ne);return}for(var mo=Ee.min.y;mo<=Ee.max.y;mo++)for(var fi=Ee.min.x;fi<=Ee.max.x;fi++){var Su=new V(fi,mo);if(Su.z=this._tileZoom,!!this._isValidTile(Su)){var Sc=this._tiles[this._tileCoordsToKey(Su)];Sc?Sc.current=!0:It.push(Su)}}if(It.sort(function(Gd,Hy){return Gd.distanceTo(Ge)-Hy.distanceTo(Ge)}),It.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var If=document.createDocumentFragment();for(fi=0;fine.max.x)||!q.wrapLat&&(k.yne.max.y))return!1}if(!this.options.bounds)return!0;var he=this._tileCoordsToBounds(k);return U(this.options.bounds).overlaps(he)},_keyToBounds:function(k){return this._tileCoordsToBounds(this._keyToTileCoords(k))},_tileCoordsToNwSe:function(k){var q=this._map,ne=this.getTileSize(),he=k.scaleBy(ne),Ee=he.add(ne),Ge=q.unproject(he,k.z),It=q.unproject(Ee,k.z);return[Ge,It]},_tileCoordsToBounds:function(k){var q=this._tileCoordsToNwSe(k),ne=new W(q[0],q[1]);return this.options.noWrap||(ne=this._map.wrapLatLngBounds(ne)),ne},_tileCoordsToKey:function(k){return k.x+":"+k.y+":"+k.z},_keyToTileCoords:function(k){var q=k.split(":"),ne=new V(+q[0],+q[1]);return ne.z=+q[2],ne},_removeTile:function(k){var q=this._tiles[k];q&&(hn(q.el),delete this._tiles[k],this.fire("tileunload",{tile:q.el,coords:this._keyToTileCoords(k)}))},_initTile:function(k){nr(k,"leaflet-tile");var q=this.getTileSize();k.style.width=q.x+"px",k.style.height=q.y+"px",k.onselectstart=p,k.onmousemove=p,zt.ielt9&&this.options.opacity<1&&er(k,this.options.opacity)},_addTile:function(k,q){var ne=this._getTilePos(k),he=this._tileCoordsToKey(k),Ee=this.createTile(this._wrapCoords(k),s(this._tileReady,this,k));this._initTile(Ee),this.createTile.length<2&&P(s(this._tileReady,this,k,null,Ee)),uo(Ee,ne),this._tiles[he]={el:Ee,coords:k,current:!0},q.appendChild(Ee),this.fire("tileloadstart",{tile:Ee,coords:k})},_tileReady:function(k,q,ne){q&&this.fire("tileerror",{error:q,tile:ne,coords:k});var he=this._tileCoordsToKey(k);ne=this._tiles[he],ne&&(ne.loaded=+new Date,this._map._fadeAnimated?(er(ne.el,0),E(this._fadeFrame),this._fadeFrame=P(this._updateOpacity,this)):(ne.active=!0,this._pruneTiles()),q||(nr(ne.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:ne.el,coords:k})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),zt.ielt9||!this._map._fadeAnimated?P(this._pruneTiles,this):setTimeout(s(this._pruneTiles,this),250)))},_getTilePos:function(k){return k.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(k){var q=new V(this._wrapX?d(k.x,this._wrapX):k.x,this._wrapY?d(k.y,this._wrapY):k.y);return q.z=k.z,q},_pxBoundsToTileRange:function(k){var q=this.getTileSize();return new H(k.min.unscaleBy(q).floor(),k.max.unscaleBy(q).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var k in this._tiles)if(!this._tiles[k].loaded)return!1;return!0}});function J0(k){return new Am(k)}var ep=Am.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(k,q){this._url=k,q=y(this,q),q.detectRetina&&zt.retina&&q.maxZoom>0?(q.tileSize=Math.floor(q.tileSize/2),q.zoomReverse?(q.zoomOffset--,q.minZoom=Math.min(q.maxZoom,q.minZoom+1)):(q.zoomOffset++,q.maxZoom=Math.max(q.minZoom,q.maxZoom-1)),q.minZoom=Math.max(0,q.minZoom)):q.zoomReverse?q.minZoom=Math.min(q.maxZoom,q.minZoom):q.maxZoom=Math.max(q.minZoom,q.maxZoom),typeof q.subdomains=="string"&&(q.subdomains=q.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(k,q){return this._url===k&&q===void 0&&(q=!0),this._url=k,q||this.redraw(),this},createTile:function(k,q){var ne=document.createElement("img");return Bn(ne,"load",s(this._tileOnLoad,this,q,ne)),Bn(ne,"error",s(this._tileOnError,this,q,ne)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(ne.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(ne.referrerPolicy=this.options.referrerPolicy),ne.alt="",ne.src=this.getTileUrl(k),ne},getTileUrl:function(k){var q={r:zt.retina?"@2x":"",s:this._getSubdomain(k),x:k.x,y:k.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var ne=this._globalTileRange.max.y-k.y;this.options.tms&&(q.y=ne),q["-y"]=ne}return b(this._url,o(q,this.options))},_tileOnLoad:function(k,q){zt.ielt9?setTimeout(s(k,this,null,q),0):k(null,q)},_tileOnError:function(k,q,ne){var he=this.options.errorTileUrl;he&&q.getAttribute("src")!==he&&(q.src=he),k(ne,q)},_onTileRemove:function(k){k.tile.onload=null},_getZoomForUrl:function(){var k=this._tileZoom,q=this.options.maxZoom,ne=this.options.zoomReverse,he=this.options.zoomOffset;return ne&&(k=q-k),k+he},_getSubdomain:function(k){var q=Math.abs(k.x+k.y)%this.options.subdomains.length;return this.options.subdomains[q]},_abortLoading:function(){var k,q;for(k in this._tiles)if(this._tiles[k].coords.z!==this._tileZoom&&(q=this._tiles[k].el,q.onload=p,q.onerror=p,!q.complete)){q.src=C;var ne=this._tiles[k].coords;hn(q),delete this._tiles[k],this.fire("tileabort",{tile:q,coords:ne})}},_removeTile:function(k){var q=this._tiles[k];if(q)return q.el.setAttribute("src",C),Am.prototype._removeTile.call(this,k)},_tileReady:function(k,q,ne){if(!(!this._map||ne&&ne.getAttribute("src")===C))return Am.prototype._tileReady.call(this,k,q,ne)}});function sS(k,q){return new ep(k,q)}var Fy=ep.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(k,q){this._url=k;var ne=o({},this.defaultWmsParams);for(var he in q)he in this.options||(ne[he]=q[he]);q=y(this,q);var Ee=q.detectRetina&&zt.retina?2:1,Ge=this.getTileSize();ne.width=Ge.x*Ee,ne.height=Ge.y*Ee,this.wmsParams=ne},onAdd:function(k){this._crs=this.options.crs||k.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var q=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[q]=this._crs.code,ep.prototype.onAdd.call(this,k)},getTileUrl:function(k){var q=this._tileCoordsToNwSe(k),ne=this._crs,he=F(ne.project(q[0]),ne.project(q[1])),Ee=he.min,Ge=he.max,It=(this._wmsVersion>=1.3&&this._crs===Xt?[Ee.y,Ee.x,Ge.y,Ge.x]:[Ee.x,Ee.y,Ge.x,Ge.y]).join(","),ln=ep.prototype.getTileUrl.call(this,k);return ln+x(this.wmsParams,ln,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+It},setParams:function(k,q){return o(this.wmsParams,k),q||this.redraw(),this}});function xN(k,q){return new Fy(k,q)}ep.WMS=Fy,sS.wms=xN;var Up=En.extend({options:{padding:.1},initialize:function(k){y(this,k),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),nr(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var k={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(k.zoomanim=this._onAnimZoom),k},_onAnimZoom:function(k){this._updateTransform(k.center,k.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(k,q){var ne=this._map.getZoomScale(q,this._zoom),he=this._map.getSize().multiplyBy(.5+this.options.padding),Ee=this._map.project(this._center,q),Ge=he.multiplyBy(-ne).add(Ee).subtract(this._map._getNewPixelOrigin(k,q));zt.any3d?Ao(this._container,Ge,ne):uo(this._container,Ge)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var k in this._layers)this._layers[k]._reset()},_onZoomEnd:function(){for(var k in this._layers)this._layers[k]._project()},_updatePaths:function(){for(var k in this._layers)this._layers[k]._update()},_update:function(){var k=this.options.padding,q=this._map.getSize(),ne=this._map.containerPointToLayerPoint(q.multiplyBy(-k)).round();this._bounds=new H(ne,ne.add(q.multiplyBy(1+k*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),lS=Up.extend({options:{tolerance:0},getEvents:function(){var k=Up.prototype.getEvents.call(this);return k.viewprereset=this._onViewPreReset,k},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Up.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var k=this._container=document.createElement("canvas");Bn(k,"mousemove",this._onMouseMove,this),Bn(k,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Bn(k,"mouseout",this._handleMouseOut,this),k._leaflet_disable_events=!0,this._ctx=k.getContext("2d")},_destroyContainer:function(){E(this._redrawRequest),delete this._ctx,hn(this._container),_i(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var k;this._redrawBounds=null;for(var q in this._layers)k=this._layers[q],k._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Up.prototype._update.call(this);var k=this._bounds,q=this._container,ne=k.getSize(),he=zt.retina?2:1;uo(q,k.min),q.width=he*ne.x,q.height=he*ne.y,q.style.width=ne.x+"px",q.style.height=ne.y+"px",zt.retina&&this._ctx.scale(2,2),this._ctx.translate(-k.min.x,-k.min.y),this.fire("update")}},_reset:function(){Up.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(k){this._updateDashArray(k),this._layers[c(k)]=k;var q=k._order={layer:k,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=q),this._drawLast=q,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(k){this._requestRedraw(k)},_removePath:function(k){var q=k._order,ne=q.next,he=q.prev;ne?ne.prev=he:this._drawLast=he,he?he.next=ne:this._drawFirst=ne,delete k._order,delete this._layers[c(k)],this._requestRedraw(k)},_updatePath:function(k){this._extendRedrawBounds(k),k._project(),k._update(),this._requestRedraw(k)},_updateStyle:function(k){this._updateDashArray(k),this._requestRedraw(k)},_updateDashArray:function(k){if(typeof k.options.dashArray=="string"){var q=k.options.dashArray.split(/[, ]+/),ne=[],he,Ee;for(Ee=0;Ee')}}catch{}return function(k){return document.createElement("<"+k+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),yN={_initContainer:function(){this._container=gt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Up.prototype._update.call(this),this.fire("update"))},_initPath:function(k){var q=k._container=Z0("shape");nr(q,"leaflet-vml-shape "+(this.options.className||"")),q.coordsize="1 1",k._path=Z0("path"),q.appendChild(k._path),this._updateStyle(k),this._layers[c(k)]=k},_addPath:function(k){var q=k._container;this._container.appendChild(q),k.options.interactive&&k.addInteractiveTarget(q)},_removePath:function(k){var q=k._container;hn(q),k.removeInteractiveTarget(q),delete this._layers[c(k)]},_updateStyle:function(k){var q=k._stroke,ne=k._fill,he=k.options,Ee=k._container;Ee.stroked=!!he.stroke,Ee.filled=!!he.fill,he.stroke?(q||(q=k._stroke=Z0("stroke")),Ee.appendChild(q),q.weight=he.weight+"px",q.color=he.color,q.opacity=he.opacity,he.dashArray?q.dashStyle=w(he.dashArray)?he.dashArray.join(" "):he.dashArray.replace(/( *, *)/g," "):q.dashStyle="",q.endcap=he.lineCap.replace("butt","flat"),q.joinstyle=he.lineJoin):q&&(Ee.removeChild(q),k._stroke=null),he.fill?(ne||(ne=k._fill=Z0("fill")),Ee.appendChild(ne),ne.color=he.fillColor||he.color,ne.opacity=he.fillOpacity):ne&&(Ee.removeChild(ne),k._fill=null)},_updateCircle:function(k){var q=k._point.round(),ne=Math.round(k._radius),he=Math.round(k._radiusY||ne);this._setPath(k,k._empty()?"M0 0":"AL "+q.x+","+q.y+" "+ne+","+he+" 0,"+65535*360)},_setPath:function(k,q){k._path.v=q},_bringToFront:function(k){Jn(k._container)},_bringToBack:function(k){Fr(k._container)}},jf=zt.vml?Z0:se,Lh=Up.extend({_initContainer:function(){this._container=jf("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=jf("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){hn(this._container),_i(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Up.prototype._update.call(this);var k=this._bounds,q=k.getSize(),ne=this._container;(!this._svgSize||!this._svgSize.equals(q))&&(this._svgSize=q,ne.setAttribute("width",q.x),ne.setAttribute("height",q.y)),uo(ne,k.min),ne.setAttribute("viewBox",[k.min.x,k.min.y,q.x,q.y].join(" ")),this.fire("update")}},_initPath:function(k){var q=k._path=jf("path");k.options.className&&nr(q,k.options.className),k.options.interactive&&nr(q,"leaflet-interactive"),this._updateStyle(k),this._layers[c(k)]=k},_addPath:function(k){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(k._path),k.addInteractiveTarget(k._path)},_removePath:function(k){hn(k._path),k.removeInteractiveTarget(k._path),delete this._layers[c(k)]},_updatePath:function(k){k._project(),k._update()},_updateStyle:function(k){var q=k._path,ne=k.options;q&&(ne.stroke?(q.setAttribute("stroke",ne.color),q.setAttribute("stroke-opacity",ne.opacity),q.setAttribute("stroke-width",ne.weight),q.setAttribute("stroke-linecap",ne.lineCap),q.setAttribute("stroke-linejoin",ne.lineJoin),ne.dashArray?q.setAttribute("stroke-dasharray",ne.dashArray):q.removeAttribute("stroke-dasharray"),ne.dashOffset?q.setAttribute("stroke-dashoffset",ne.dashOffset):q.removeAttribute("stroke-dashoffset")):q.setAttribute("stroke","none"),ne.fill?(q.setAttribute("fill",ne.fillColor||ne.color),q.setAttribute("fill-opacity",ne.fillOpacity),q.setAttribute("fill-rule",ne.fillRule||"evenodd")):q.setAttribute("fill","none"))},_updatePoly:function(k,q){this._setPath(k,ge(k._parts,q))},_updateCircle:function(k){var q=k._point,ne=Math.max(Math.round(k._radius),1),he=Math.max(Math.round(k._radiusY),1)||ne,Ee="a"+ne+","+he+" 0 1,0 ",Ge=k._empty()?"M0 0":"M"+(q.x-ne)+","+q.y+Ee+ne*2+",0 "+Ee+-ne*2+",0 ";this._setPath(k,Ge)},_setPath:function(k,q){k._path.setAttribute("d",q)},_bringToFront:function(k){Jn(k._path)},_bringToBack:function(k){Fr(k._path)}});zt.vml&&Lh.include(yN);function Gu(k){return zt.svg||zt.vml?new Lh(k):null}Tr.include({getRenderer:function(k){var q=k.options.renderer||this._getPaneRenderer(k.options.pane)||this.options.renderer||this._renderer;return q||(q=this._renderer=this._createRenderer()),this.hasLayer(q)||this.addLayer(q),q},_getPaneRenderer:function(k){if(k==="overlayPane"||k===void 0)return!1;var q=this._paneRenderers[k];return q===void 0&&(q=this._createRenderer({pane:k}),this._paneRenderers[k]=q),q},_createRenderer:function(k){return this.options.preferCanvas&&cS(k)||Gu(k)}});var Ef=bu.extend({initialize:function(k,q){bu.prototype.initialize.call(this,this._boundsToLatLngs(k),q)},setBounds:function(k){return this.setLatLngs(this._boundsToLatLngs(k))},_boundsToLatLngs:function(k){return k=U(k),[k.getSouthWest(),k.getNorthWest(),k.getNorthEast(),k.getSouthEast()]}});function uS(k,q){return new Ef(k,q)}Lh.create=jf,Lh.pointsToPath=ge,wc.geometryToLayer=Oh,wc.coordsToLatLng=Sg,wc.coordsToLatLngs=Im,wc.latLngToCoords=Bp,wc.latLngsToCoords=Hp,wc.getFeature=Nf,wc.asFeature=$h,Tr.mergeOptions({boxZoom:!0});var Tm=ct.extend({initialize:function(k){this._map=k,this._container=k._container,this._pane=k._panes.overlayPane,this._resetStateTimeout=0,k.on("unload",this._destroy,this)},addHooks:function(){Bn(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){_i(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){hn(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(k){if(!k.shiftKey||k.which!==1&&k.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Jr(),st(),this._startPoint=this._map.mouseEventToContainerPoint(k),Bn(document,{contextmenu:Vc,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(k){this._moved||(this._moved=!0,this._box=gt("div","leaflet-zoom-box",this._container),nr(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(k);var q=new H(this._point,this._startPoint),ne=q.getSize();uo(this._box,q.min),this._box.style.width=ne.x+"px",this._box.style.height=ne.y+"px"},_finish:function(){this._moved&&(hn(this._box),or(this._container,"leaflet-crosshair")),hs(),In(),_i(document,{contextmenu:Vc,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(k){if(!(k.which!==1&&k.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(s(this._resetState,this),0);var q=new W(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(q).fire("boxzoomend",{boxZoomBounds:q})}},_onKeyDown:function(k){k.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Tr.addInitHook("addHandler","boxZoom",Tm),Tr.mergeOptions({doubleClickZoom:!0});var vN=ct.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(k){var q=this._map,ne=q.getZoom(),he=q.options.zoomDelta,Ee=k.originalEvent.shiftKey?ne-he:ne+he;q.options.doubleClickZoom==="center"?q.setZoom(Ee):q.setZoomAround(k.containerPoint,Ee)}});Tr.addInitHook("addHandler","doubleClickZoom",vN),Tr.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var zy=ct.extend({addHooks:function(){if(!this._draggable){var k=this._map;this._draggable=new kn(k._mapPane,k._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),k.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),k.on("zoomend",this._onZoomEnd,this),k.whenReady(this._onZoomEnd,this))}nr(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){or(this._map._container,"leaflet-grab"),or(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var k=this._map;if(k._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var q=U(this._map.options.maxBounds);this._offsetLimit=F(this._map.latLngToContainerPoint(q.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(q.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;k.fire("movestart").fire("dragstart"),k.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(k){if(this._map.options.inertia){var q=this._lastTime=+new Date,ne=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(ne),this._times.push(q),this._prunePositions(q)}this._map.fire("move",k).fire("drag",k)},_prunePositions:function(k){for(;this._positions.length>1&&k-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var k=this._map.getSize().divideBy(2),q=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=q.subtract(k).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(k,q){return k-(k-q)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var k=this._draggable._newPos.subtract(this._draggable._startPos),q=this._offsetLimit;k.xq.max.x&&(k.x=this._viscousLimit(k.x,q.max.x)),k.y>q.max.y&&(k.y=this._viscousLimit(k.y,q.max.y)),this._draggable._newPos=this._draggable._startPos.add(k)}},_onPreDragWrap:function(){var k=this._worldWidth,q=Math.round(k/2),ne=this._initialWorldOffset,he=this._draggable._newPos.x,Ee=(he-q+ne)%k+q-ne,Ge=(he+q+ne)%k-q-ne,It=Math.abs(Ee+ne)0?Ge:-Ge))-q;this._delta=0,this._startTime=null,It&&(k.options.scrollWheelZoom==="center"?k.setZoom(q+It):k.setZoomAround(this._lastMousePos,q+It))}});Tr.addInitHook("addHandler","scrollWheelZoom",Va);var dS=600;Tr.mergeOptions({tapHold:zt.touchNative&&zt.safari&&zt.mobile,tapTolerance:15});var ex=ct.extend({addHooks:function(){Bn(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){_i(this._map._container,"touchstart",this._onDown,this)},_onDown:function(k){if(clearTimeout(this._holdTimeout),k.touches.length===1){var q=k.touches[0];this._startPos=this._newPos=new V(q.clientX,q.clientY),this._holdTimeout=setTimeout(s(function(){this._cancel(),this._isTapValid()&&(Bn(document,"touchend",ma),Bn(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",q))},this),dS),Bn(document,"touchend touchcancel contextmenu",this._cancel,this),Bn(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function k(){_i(document,"touchend",ma),_i(document,"touchend touchcancel",k)},_cancel:function(){clearTimeout(this._holdTimeout),_i(document,"touchend touchcancel contextmenu",this._cancel,this),_i(document,"touchmove",this._onMove,this)},_onMove:function(k){var q=k.touches[0];this._newPos=new V(q.clientX,q.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(k,q){var ne=new MouseEvent(k,{bubbles:!0,cancelable:!0,view:window,screenX:q.screenX,screenY:q.screenY,clientX:q.clientX,clientY:q.clientY});ne._simulated=!0,q.target.dispatchEvent(ne)}});Tr.addInitHook("addHandler","tapHold",ex),Tr.mergeOptions({touchZoom:zt.touch,bounceAtZoomLimits:!0});var Ng=ct.extend({addHooks:function(){nr(this._map._container,"leaflet-touch-zoom"),Bn(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){or(this._map._container,"leaflet-touch-zoom"),_i(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(k){var q=this._map;if(!(!k.touches||k.touches.length!==2||q._animatingZoom||this._zooming)){var ne=q.mouseEventToContainerPoint(k.touches[0]),he=q.mouseEventToContainerPoint(k.touches[1]);this._centerPoint=q.getSize()._divideBy(2),this._startLatLng=q.containerPointToLatLng(this._centerPoint),q.options.touchZoom!=="center"&&(this._pinchStartLatLng=q.containerPointToLatLng(ne.add(he)._divideBy(2))),this._startDist=ne.distanceTo(he),this._startZoom=q.getZoom(),this._moved=!1,this._zooming=!0,q._stop(),Bn(document,"touchmove",this._onTouchMove,this),Bn(document,"touchend touchcancel",this._onTouchEnd,this),ma(k)}},_onTouchMove:function(k){if(!(!k.touches||k.touches.length!==2||!this._zooming)){var q=this._map,ne=q.mouseEventToContainerPoint(k.touches[0]),he=q.mouseEventToContainerPoint(k.touches[1]),Ee=ne.distanceTo(he)/this._startDist;if(this._zoom=q.getScaleZoom(Ee,this._startZoom),!q.options.bounceAtZoomLimits&&(this._zoomq.getMaxZoom()&&Ee>1)&&(this._zoom=q._limitZoom(this._zoom)),q.options.touchZoom==="center"){if(this._center=this._startLatLng,Ee===1)return}else{var Ge=ne._add(he)._divideBy(2)._subtract(this._centerPoint);if(Ee===1&&Ge.x===0&&Ge.y===0)return;this._center=q.unproject(q.project(this._pinchStartLatLng,this._zoom).subtract(Ge),this._zoom)}this._moved||(q._moveStart(!0,!1),this._moved=!0),E(this._animRequest);var It=s(q._move,q,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=P(It,this,!0),ma(k)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,E(this._animRequest),_i(document,"touchmove",this._onTouchMove,this),_i(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Tr.addInitHook("addHandler","touchZoom",Ng),Tr.BoxZoom=Tm,Tr.DoubleClickZoom=vN,Tr.Drag=zy,Tr.Keyboard=By,Tr.ScrollWheelZoom=Va,Tr.TapHold=ex,Tr.TouchZoom=Ng,n.Bounds=H,n.Browser=zt,n.CRS=J,n.Canvas=lS,n.Circle=Ks,n.CircleMarker=rc,n.Class=R,n.Control=$o,n.DivIcon=Hb,n.DivOverlay=Wd,n.DomEvent=Io,n.DomUtil=xo,n.Draggable=kn,n.Evented=z,n.FeatureGroup=Qn,n.GeoJSON=wc,n.GridLayer=Am,n.Handler=ct,n.Icon=Cr,n.ImageOverlay=wu,n.LatLng=K,n.LatLngBounds=W,n.Layer=En,n.LayerGroup=Hn,n.LineUtil=Mh,n.Map=Tr,n.Marker=Si,n.Mixin=At,n.Path=Ca,n.Point=V,n.PolyUtil=To,n.Polygon=bu,n.Polyline=oc,n.Popup=_m,n.PosAnimation=xi,n.Projection=qn,n.Rectangle=Ef,n.Renderer=Up,n.SVG=Lh,n.SVGOverlay=Fl,n.TileLayer=ep,n.Tooltip=Q0,n.Transformation=ae,n.Util=M,n.VideoOverlay=Ma,n.bind=s,n.bounds=F,n.canvas=cS,n.circle=ud,n.circleMarker=gs,n.control=ms,n.divIcon=gN,n.extend=o,n.featureGroup=pr,n.geoJSON=Cg,n.geoJson=xl,n.gridLayer=J0,n.icon=Zr,n.imageOverlay=xa,n.latLng=X,n.latLngBounds=U,n.layerGroup=zn,n.map=Ro,n.marker=ka,n.point=G,n.polygon=Rh,n.polyline=Ps,n.popup=Pm,n.rectangle=uS,n.setOptions=y,n.stamp=c,n.svg=Gu,n.svgOverlay=Vp,n.tileLayer=sS,n.tooltip=Ly,n.transformation=oe,n.version=r,n.videoOverlay=yl;var Vb=window.L;n.noConflict=function(){return window.L=Vb,this},window.L=n}))})(_R,_R.exports)),_R.exports}var YL=hkn();const mkn=Ba(YL);function gye(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function xye(e,t){return t==null?function(r,o){const i=f.useRef();return i.current||(i.current=e(r,o)),i}:function(r,o){const i=f.useRef();i.current||(i.current=e(r,o));const s=f.useRef(r),{instance:l}=i.current;return f.useEffect(function(){s.current!==r&&(t(l,r,s.current),s.current=r)},[l,r,o]),i}}function hit(e,t){f.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var i;(i=t.layerContainer)==null||i.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function mit(e){return function(n){const r=dit(),o=e(mye(n,r),r);return lkn(r.map,n.attribution),pit(o.current,n.eventHandlers),hit(o.current,r),o}}function gkn(e,t){const n=f.useRef();f.useEffect(function(){if(t.pathOptions!==n.current){const o=t.pathOptions??{};e.instance.setStyle(o),n.current=o}},[e,t])}function xkn(e){return function(n){const r=dit(),o=e(mye(n,r),r);return pit(o.current,n.eventHandlers),hit(o.current,r),gkn(o.current,n),o}}function ykn(e,t){const n=xye(e,t),r=mit(n);return fit(r)}function vkn(e,t){const n=xye(e,t),r=xkn(n);return fit(r)}function bkn(e,t){const n=xye(e,t),r=mit(n);return fkn(r)}function wkn(e,t,n){const{opacity:r,zIndex:o}=t;r!=null&&r!==n.opacity&&e.setOpacity(r),o!=null&&o!==n.zIndex&&e.setZIndex(o)}const Skn=vkn(function({center:t,children:n,...r},o){const i=new YL.Circle(t,r);return gye(i,lit(o,{overlayContainer:i}))},ckn);function ole(){return ole=Object.assign||function(e){for(var t=1;t(m==null?void 0:m.map)??null,[m]);const y=f.useCallback(v=>{if(v!==null&&m===null){const b=new YL.Map(v,d);n!=null&&u!=null?b.setView(n,u):e!=null&&b.fitBounds(e,t),c!=null&&b.whenReady(c),g(dkn(b))}},[]);f.useEffect(()=>()=>{m==null||m.map.remove()},[m]);const x=m?Ie.createElement(uit,{value:m},r):s??null;return Ie.createElement("div",ole({},h,{ref:y}),x)}const Nkn=f.forwardRef(Ckn),jkn=ykn(function({position:t,...n},r){const o=new YL.Marker(t,n);return gye(o,lit(r,{overlayContainer:o}))},function(t,n,r){n.position!==r.position&&t.setLatLng(n.position),n.icon!=null&&n.icon!==r.icon&&t.setIcon(n.icon),n.zIndexOffset!=null&&n.zIndexOffset!==r.zIndexOffset&&t.setZIndexOffset(n.zIndexOffset),n.opacity!=null&&n.opacity!==r.opacity&&t.setOpacity(n.opacity),t.dragging!=null&&n.draggable!==r.draggable&&(n.draggable===!0?t.dragging.enable():t.dragging.disable())}),Ekn=bkn(function({url:t,...n},r){const o=new YL.TileLayer(t,mye(n,r));return gye(o,r)},function(t,n,r){wkn(t,n,r);const{url:o}=n;o!=null&&o!==r.url&&t.setUrl(o)}),Ikn=mkn.icon({iconUrl:"https://unpkg.com/leaflet@1.7.1/dist/images/marker-icon.png",iconRetinaUrl:"https://unpkg.com/leaflet@1.7.1/dist/images/marker-icon-2x.png",shadowUrl:"https://unpkg.com/leaflet@1.7.1/dist/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]}),_kn=[{name:"New York (HQ)",coordinates:[-74.006,40.7128],liquidity:15e6,currencies:["USD"]},{name:"London",coordinates:[-.1276,51.5074],liquidity:85e5,currencies:["GBP","EUR"]},{name:"Singapore",coordinates:[103.8198,1.3521],liquidity:52e5,currencies:["SGD","USD"]},{name:"Tokyo",coordinates:[139.6917,35.6895],liquidity:12e6,currencies:["JPY"]},{name:"Frankfurt",coordinates:[8.6821,50.1109],liquidity:41e5,currencies:["EUR"]},{name:"Sao Paulo",coordinates:[-46.6333,-23.5505],liquidity:9e5,currencies:["BRL"]}],Pkn=()=>{const[e,t]=f.useState(null);return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-3xl font-bold text-white tracking-wider",children:"Global Liquidity Map"}),a.jsxs(Ft,{className:"p-0 bg-gray-900 border-gray-700 overflow-hidden relative h-[600px]",children:[a.jsxs("div",{className:"absolute top-4 left-4 z-[400] bg-black/60 backdrop-blur p-3 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-xs text-gray-400 uppercase font-bold",children:"Total Global Liquidity"}),a.jsx("p",{className:"text-2xl font-extrabold text-white",children:"$45.7M"})]}),e&&a.jsxs("div",{className:"absolute bottom-4 left-4 z-[400] bg-gray-800/90 backdrop-blur p-4 rounded-xl border border-cyan-500/50 w-64 animate-fadeIn",children:[a.jsx("h3",{className:"font-bold text-white text-lg mb-1",children:e.name}),a.jsxs("p",{className:"text-2xl font-mono text-cyan-400 mb-3",children:["$",e.liquidity.toLocaleString()]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs text-gray-400 font-bold uppercase",children:"Held Currencies"}),a.jsx("div",{className:"flex gap-2",children:e.currencies.map(n=>a.jsx("span",{className:"px-2 py-1 bg-gray-700 rounded text-xs text-white font-mono",children:n},n))})]}),a.jsxs("div",{className:"mt-4 pt-3 border-t border-gray-700 flex justify-between",children:[a.jsx("button",{className:"text-xs text-cyan-400 hover:text-white transition",children:"View Accounts"}),a.jsx("button",{className:"text-xs text-cyan-400 hover:text-white transition",children:"Initiate Transfer"})]}),a.jsx("button",{className:"absolute top-2 right-2 text-gray-400 hover:text-white",onClick:()=>t(null),children:"✕"})]}),a.jsxs(Nkn,{center:[20,0],zoom:2,style:{height:"100%",width:"100%",background:"#1f2937"},scrollWheelZoom:!0,children:[a.jsx(Ekn,{attribution:'© OpenStreetMap contributors © CARTO',url:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png"}),_kn.map(n=>a.jsxs(Ie.Fragment,{children:[a.jsx(Skn,{center:[n.coordinates[1],n.coordinates[0]],pathOptions:{fillColor:(e==null?void 0:e.name)===n.name?"#06b6d4":"rgba(6, 182, 212, 0.5)",color:"#fff",weight:1,fillOpacity:.5},radius:Math.log(n.liquidity)*4e4,eventHandlers:{click:()=>t(n)}}),a.jsx(jkn,{position:[n.coordinates[1],n.coordinates[0]],icon:Ikn,eventHandlers:{click:()=>t(n)}})]},n.name))]})]})]})},Akn=Bt(oU)({marginTop:"20px",marginBottom:"20px"}),KF=Bt(Yi)({fontWeight:"bold",backgroundColor:"#f0f0f0"}),Tkn=()=>{const[e,t]=f.useState([]),[n,r]=f.useState(""),[o,i]=f.useState(""),[s,l]=f.useState(null),c=[{id:"1",counterparty:"Counterparty A",currency:"USD",instruction:"Instruction Details 1",status:"Active"},{id:"2",counterparty:"Counterparty B",currency:"EUR",instruction:"Instruction Details 2",status:"Inactive"},{id:"3",counterparty:"Counterparty A",currency:"GBP",instruction:"Instruction Details 3",status:"Pending"},{id:"4",counterparty:"Counterparty C",currency:"USD",instruction:"Instruction Details 4",status:"Active"},{id:"5",counterparty:"Counterparty B",currency:"JPY",instruction:"Instruction Details 5",status:"Active"}];f.useEffect(()=>{(async()=>{t(c)})()},[]);const u=e.filter(g=>{const y=g.counterparty.toLowerCase().includes(n.toLowerCase())||g.currency.toLowerCase().includes(n.toLowerCase())||g.instruction.toLowerCase().includes(n.toLowerCase()),x=o===""||g.status===o;return y&&x}),d=g=>{r(g.target.value)},p=g=>{i(g.target.value)},h=g=>{l(g)},m=()=>{l(null)};return a.jsxs(Dn,{sx:{padding:2},children:[a.jsx(tn,{variant:"h4",component:"h1",gutterBottom:!0,children:"Global SSI Hub"}),a.jsxs(Dn,{sx:{display:"flex",alignItems:"center",marginBottom:2},children:[a.jsx(la,{label:"Search",variant:"outlined",size:"small",value:n,onChange:d,sx:{marginRight:2,width:200}}),a.jsxs(S0,{label:"Status",variant:"outlined",size:"small",value:o,onChange:p,sx:{marginRight:2,width:150},children:[a.jsx(_d,{value:"",children:"All"}),a.jsx(_d,{value:"Active",children:"Active"}),a.jsx(_d,{value:"Inactive",children:"Inactive"}),a.jsx(_d,{value:"Pending",children:"Pending"})]})]}),a.jsx(Akn,{component:ea,children:a.jsxs(nU,{"aria-label":"SSI Table",children:[a.jsx(iU,{children:a.jsxs($2,{children:[a.jsx(KF,{children:"Counterparty"}),a.jsx(KF,{children:"Currency"}),a.jsx(KF,{children:"Status"}),a.jsx(KF,{children:"Actions"})]})}),a.jsx(rU,{children:u.map(g=>a.jsxs($2,{hover:!0,onClick:()=>h(g),style:{cursor:"pointer"},children:[a.jsx(Yi,{children:g.counterparty}),a.jsx(Yi,{children:g.currency}),a.jsx(Yi,{children:g.status}),a.jsx(Yi,{children:a.jsx(ta,{variant:"outlined",size:"small",children:"View Details"})})]},g.id))})]})}),s&&a.jsxs(ea,{sx:{mt:2,p:2},children:[a.jsx(tn,{variant:"h6",gutterBottom:!0,children:"SSI Details"}),a.jsxs(tn,{variant:"body1",paragraph:!0,children:[a.jsx("b",{children:"Counterparty:"})," ",s.counterparty]}),a.jsxs(tn,{variant:"body1",paragraph:!0,children:[a.jsx("b",{children:"Currency:"})," ",s.currency]}),a.jsxs(tn,{variant:"body1",paragraph:!0,children:[a.jsx("b",{children:"Instruction:"})," ",s.instruction]}),a.jsxs(tn,{variant:"body1",paragraph:!0,children:[a.jsx("b",{children:"Status:"})," ",s.status]}),a.jsx(ta,{variant:"contained",color:"secondary",onClick:m,sx:{mt:2},children:"Close Details"})]})]})},VN=[{id:"1005061234",username:"john.doe",firstName:"John",lastName:"Doe",type:"active",createdDate:"1607450357"},{id:"1005061235",username:"jane.smith",firstName:"Jane",lastName:"Smith",type:"active",createdDate:"1607451357"},{id:"1005061236",username:"test.user.1",firstName:"Test",lastName:"User1",type:"testing",createdDate:"1607452357"},{id:"1005061237",username:"samantha.green",firstName:"Samantha",lastName:"Green",type:"active",createdDate:"1607453357"},{id:"1005061238",username:"test.user.2",firstName:"Test",lastName:"User2",type:"testing",createdDate:"1607454357"},{id:"1005061239",username:"peter.jones",firstName:"Peter",lastName:"Jones",type:"active",createdDate:"1607455357"},{id:"1005061240",username:"mary.williams",firstName:"Mary",lastName:"Williams",type:"active",createdDate:"1607456357"},{id:"1005061241",username:"test.user.3",firstName:"Test",lastName:"User3",type:"testing",createdDate:"1607457357"},{id:"1005061242",username:"david.brown",firstName:"David",lastName:"Brown",type:"active",createdDate:"1607458357"},{id:"1005061243",username:"linda.davis",firstName:"Linda",lastName:"Davis",type:"active",createdDate:"1607459357"}],YF={getCustomers:async(e,t,n,r)=>{console.log(`Fetching customers: start=${e}, limit=${t}, search='${n}', type='${r}'`),await new Promise(l=>setTimeout(l,500));let o=VN;if(n){const l=n.toLowerCase();o=o.filter(c=>c.username.toLowerCase().includes(l)||`${c.firstName} ${c.lastName}`.toLowerCase().includes(l))}r&&(o=o.filter(l=>l.type===r));const i=(e-1)*t,s=o.slice(i,i+t);return{found:o.length,displaying:s.length,moreAvailable:i+s.length{console.log(`Adding ${t} customer:`,e),await new Promise(r=>setTimeout(r,500));const n={id:Math.random().toString(36).substring(2,12),createdDate:String(Math.floor(Date.now()/1e3)),type:t,...e};return VN.unshift(n),n},modifyCustomer:async(e,t)=>{console.log(`Modifying customer ${e}:`,t),await new Promise(r=>setTimeout(r,500));const n=VN.findIndex(r=>r.id===e);if(n!==-1)VN[n]={...VN[n],...t};else throw new Error("Customer not found")},deleteCustomer:async e=>{console.log(`Deleting customer ${e}`),await new Promise(n=>setTimeout(n,500));const t=VN.findIndex(n=>n.id===e);if(t!==-1)VN.splice(t,1);else throw new Error("Customer not found")}},kee=({isOpen:e,onClose:t,title:n,children:r})=>e?a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 z-50 flex justify-center items-center",children:a.jsxs("div",{className:"bg-white rounded-lg shadow-xl p-6 w-full max-w-md",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("h2",{className:"text-2xl font-semibold text-gray-800",children:n}),a.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-800",children:"×"})]}),a.jsx("div",{children:r})]})}):null,rRe=({initialData:e,onSubmit:t,onCancel:n,isSubmitting:r,isEditMode:o=!1})=>{const[i,s]=f.useState((e==null?void 0:e.username)||""),[l,c]=f.useState((e==null?void 0:e.firstName)||""),[u,d]=f.useState((e==null?void 0:e.lastName)||""),[p,h]=f.useState((e==null?void 0:e.type)||"active"),m=g=>{g.preventDefault(),t(o?{firstName:l,lastName:u}:{username:i,firstName:l,lastName:u},p)};return a.jsxs("form",{onSubmit:m,children:[!o&&a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"username",children:"Username"}),a.jsx("input",{id:"username",type:"text",value:i,onChange:g=>s(g.target.value),required:!0,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:ring"})]}),!o&&a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"type",children:"Customer Type"}),a.jsxs("select",{id:"type",value:p,onChange:g=>h(g.target.value),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:ring",children:[a.jsx("option",{value:"active",children:"Active"}),a.jsx("option",{value:"testing",children:"Testing"})]})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"firstName",children:"First Name"}),a.jsx("input",{id:"firstName",type:"text",value:l,onChange:g=>c(g.target.value),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:ring"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"lastName",children:"Last Name"}),a.jsx("input",{id:"lastName",type:"text",value:u,onChange:g=>d(g.target.value),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:ring"})]}),a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx("button",{type:"button",onClick:n,className:"bg-gray-200 hover:bg-gray-300 text-gray-800 font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline",children:"Cancel"}),a.jsx("button",{type:"submit",disabled:r,className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline disabled:bg-blue-300",children:r?"Saving...":"Save"})]})]})},kkn=()=>{const[e,t]=f.useState([]),[n,r]=f.useState(!0),[o,i]=f.useState(null),[s,l]=f.useState(1),[c,u]=f.useState(0),[d]=f.useState(10),[p,h]=f.useState(""),[m,g]=f.useState(""),[y,x]=f.useState(""),[v,b]=f.useState(!1),[w,S]=f.useState(!1),[C,N]=f.useState(!1),[j,I]=f.useState(null),[_,T]=f.useState(!1),P=f.useMemo(()=>Math.ceil(c/d),[c,d]),E=f.useCallback(async()=>{r(!0),i(null);try{const B=await YF.getCustomers(s,d,m,y);t(B.customers),u(B.found)}catch(B){i("Failed to fetch customers."),console.error(B)}finally{r(!1)}},[s,d,m,y]);f.useEffect(()=>{const B=setTimeout(()=>{g(p),l(1)},300);return()=>{clearTimeout(B)}},[p]),f.useEffect(()=>{E()},[E]);const M=async(B,G="active")=>{T(!0);try{v?await YF.addCustomer(B,G):w&&j&&await YF.modifyCustomer(j.id,B),z(),await E()}catch(H){console.error("Submission failed:",H),i("Failed to save customer data.")}finally{T(!1)}},R=async()=>{if(j){T(!0);try{await YF.deleteCustomer(j.id),z(),await E()}catch(B){console.error("Delete failed:",B),i("Failed to delete customer.")}finally{T(!1)}}},$=B=>{I(B),S(!0)},D=B=>{I(B),N(!0)},z=()=>{b(!1),S(!1),N(!1),I(null)},V=B=>new Date(parseInt(B,10)*1e3).toLocaleDateString();return a.jsxs("div",{className:"p-8 bg-gray-50 min-h-screen",children:[a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-6",children:"Customer Dashboard"}),o&&a.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4",role:"alert",children:o}),a.jsx("div",{className:"bg-white p-4 rounded-lg shadow-sm mb-6",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[a.jsx("input",{type:"text",placeholder:"Search by username or name...",value:p,onChange:B=>h(B.target.value),className:"col-span-1 md:col-span-2 shadow-sm appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:ring"}),a.jsxs("select",{value:y,onChange:B=>{x(B.target.value),l(1)},className:"col-span-1 shadow-sm appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:ring",children:[a.jsx("option",{value:"",children:"All Types"}),a.jsx("option",{value:"active",children:"Active"}),a.jsx("option",{value:"testing",children:"Testing"})]}),a.jsx("button",{onClick:()=>b(!0),className:"col-span-1 bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline",children:"Add Customer"})]})}),a.jsx("div",{className:"bg-white rounded-lg shadow-sm overflow-hidden",children:n?a.jsx("div",{className:"text-center p-10",children:"Loading..."}):a.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Username"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Full Name"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Enrolled On"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:e.map(B=>a.jsxs("tr",{children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:B.username}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:`${B.firstName||""} ${B.lastName||""}`.trim()}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:a.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${B.type==="active"?"bg-green-100 text-green-800":"bg-yellow-100 text-yellow-800"}`,children:B.type})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:V(B.createdDate)}),a.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium space-x-2",children:[a.jsx("button",{onClick:()=>$(B),className:"text-indigo-600 hover:text-indigo-900",children:"Edit"}),a.jsx("button",{onClick:()=>D(B),className:"text-red-600 hover:text-red-900",children:"Delete"})]})]},B.id))})]})}),!n&&c>0&&a.jsxs("div",{className:"flex justify-between items-center mt-4",children:[a.jsxs("span",{className:"text-sm text-gray-700",children:["Showing ",a.jsx("span",{className:"font-semibold",children:(s-1)*d+1})," to ",a.jsx("span",{className:"font-semibold",children:Math.min(s*d,c)})," of ",a.jsx("span",{className:"font-semibold",children:c})," results"]}),a.jsxs("div",{className:"space-x-2",children:[a.jsx("button",{onClick:()=>l(B=>B-1),disabled:s===1,className:"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 disabled:opacity-50",children:"Previous"}),a.jsx("button",{onClick:()=>l(B=>B+1),disabled:s===P,className:"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 disabled:opacity-50",children:"Next"})]})]})]}),a.jsx(kee,{isOpen:v,onClose:z,title:"Add New Customer",children:a.jsx(rRe,{onSubmit:M,onCancel:z,isSubmitting:_})}),a.jsx(kee,{isOpen:w,onClose:z,title:"Edit Customer",children:j&&a.jsx(rRe,{initialData:j,onSubmit:M,onCancel:z,isSubmitting:_,isEditMode:!0})}),a.jsx(kee,{isOpen:C,onClose:z,title:"Delete Customer",children:j&&a.jsxs("div",{children:[a.jsxs("p",{className:"mb-4 text-gray-700",children:['Are you sure you want to delete customer "',j.username,'"? This action cannot be undone.']}),a.jsxs("div",{className:"flex items-center justify-end gap-2",children:[a.jsx("button",{onClick:z,className:"bg-gray-200 hover:bg-gray-300 text-gray-800 font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline",children:"Cancel"}),a.jsx("button",{onClick:R,disabled:_,className:"bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline disabled:bg-red-300",children:_?"Deleting...":"Delete"})]})]})})]})};function Vr(e){const t=f.useRef(e);return t.current=e,f.useCallback((...r)=>{var o;return(o=t.current)==null?void 0:o.call(t,...r)},[])}function Ih(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}const oRe=Ih()?f.useLayoutEffect:f.useEffect,Po=(e,t)=>{const n=f.useRef(!0);oRe(()=>e(n.current),t),oRe(()=>(n.current=!1,()=>{n.current=!0}),[])},git=(e,t)=>{Po(n=>{if(!n)return e()},t)};function n$(e){const t=f.useRef(!1),[n,r]=f.useState(e);f.useEffect(()=>(t.current=!1,()=>{t.current=!0}),[]);function o(i,s){s&&t.current||r(i)}return[n,o]}function Fa(e,t){const[n,r]=f.useState(e),o=t!==void 0?t:n;return Po(i=>{i||r(t)},[t]),[o,r]}var Mee={exports:{}},bs={};/** * @license React * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var iRe;function Mkn(){if(iRe)return bs;iRe=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),g;g=Symbol.for("react.module.reference");function y(x){if(typeof x=="object"&&x!==null){var v=x.$$typeof;switch(v){case e:switch(x=x.type,x){case n:case o:case r:case u:case d:return x;default:switch(x=x&&x.$$typeof,x){case l:case s:case c:case h:case p:case i:return x;default:return v}}case t:return v}}}return bs.ContextConsumer=s,bs.ContextProvider=i,bs.Element=e,bs.ForwardRef=c,bs.Fragment=n,bs.Lazy=h,bs.Memo=p,bs.Portal=t,bs.Profiler=o,bs.StrictMode=r,bs.Suspense=u,bs.SuspenseList=d,bs.isAsyncMode=function(){return!1},bs.isConcurrentMode=function(){return!1},bs.isContextConsumer=function(x){return y(x)===s},bs.isContextProvider=function(x){return y(x)===i},bs.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},bs.isForwardRef=function(x){return y(x)===c},bs.isFragment=function(x){return y(x)===n},bs.isLazy=function(x){return y(x)===h},bs.isMemo=function(x){return y(x)===p},bs.isPortal=function(x){return y(x)===t},bs.isProfiler=function(x){return y(x)===o},bs.isStrictMode=function(x){return y(x)===r},bs.isSuspense=function(x){return y(x)===u},bs.isSuspenseList=function(x){return y(x)===d},bs.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===o||x===r||x===u||x===d||x===m||typeof x=="object"&&x!==null&&(x.$$typeof===h||x.$$typeof===p||x.$$typeof===i||x.$$typeof===s||x.$$typeof===c||x.$$typeof===g||x.getModuleId!==void 0)},bs.typeOf=y,bs}var aRe;function Rkn(){return aRe||(aRe=1,Mee.exports=Mkn()),Mee.exports}var Ree=Rkn();function u5(e,t,n){const r=f.useRef({});return(!("value"in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}const Okn=Symbol.for("react.element"),$kn=Symbol.for("react.transitional.element"),Dkn=Symbol.for("react.fragment");function xit(e){return e&&typeof e=="object"&&(e.$$typeof===Okn||e.$$typeof===$kn)&&e.type===Dkn}const Lkn=Number(f.version.split(".")[0]),ile=(e,t)=>{typeof e=="function"?e(t):typeof e=="object"&&e&&"current"in e&&(e.current=t)},zd=(...e)=>{const t=e.filter(Boolean);return t.length<=1?t[0]:n=>{e.forEach(r=>{ile(r,n)})}},Yw=(...e)=>u5(()=>zd(...e),e,(t,n)=>t.length!==n.length||t.every((r,o)=>r!==n[o])),pb=e=>{var n,r;if(!e)return!1;if(yye(e)&&Lkn>=19)return!0;const t=Ree.isMemo(e)?e.type.type:e.type;return!(typeof t=="function"&&!((n=t.prototype)!=null&&n.render)&&t.$$typeof!==Ree.ForwardRef||typeof e=="function"&&!((r=e.prototype)!=null&&r.render)&&e.$$typeof!==Ree.ForwardRef)};function yye(e){return f.isValidElement(e)&&!xit(e)}const Fkn=e=>yye(e)&&pb(e),Xw=e=>{if(e&&yye(e)){const t=e;return t.props.propertyIsEnumerable("ref")?t.props.ref:t.ref}return null};function Cp(e,t){let n=e;for(let r=0;r"u"?Object.keys:Reflect.ownKeys;function vit(e,t={}){const{prepareArray:n}=t,r=n||(()=>[]);let o=sRe(e[0]);return e.forEach(i=>{function s(l,c){const u=new Set(c),d=Cp(i,l),p=Array.isArray(d);if(p||zkn(d)){if(!u.has(d)){u.add(d);const h=Cp(o,l);p?o=Um(o,l,r(h,d)):(!h||typeof h!="object")&&(o=Um(o,l,sRe(d))),Bkn(d).forEach(m=>{Object.getOwnPropertyDescriptor(d,m).enumerable&&s([...l,m],u)})}}else o=Um(o,l,d)}s([])}),o}function B2(...e){return vit(e)}let ale={};const Hkn=e=>{};function Vkn(e,t){}function Ukn(e,t){}function Wkn(){ale={}}function bit(e,t,n){!t&&!ale[n]&&(e(!1,n),ale[n]=!0)}function Al(e,t){bit(Vkn,e,t)}function Gkn(e,t){bit(Ukn,e,t)}Al.preMessage=Hkn;Al.resetWarned=Wkn;Al.noteOnce=Gkn;function za(e,t){const n=Object.assign({},e);return Array.isArray(t)&&t.forEach(r=>{delete n[r]}),n}function Bu(e,t={}){let n=[];return Ie.Children.forEach(e,r=>{r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(Bu(r)):xit(r)&&r.props?n=n.concat(Bu(r.props.children,t)):n.push(r))}),n}function qkn(){}const Kkn=f.createContext({}),Qw=()=>{const e=()=>{};return e.deprecated=qkn,e};function IT(e){return e instanceof HTMLElement||e instanceof SVGElement}function hb(e){return e&&typeof e=="object"&&IT(e.nativeElement)?e.nativeElement:IT(e)?e:null}const sle=f.createContext(null);function Ykn({children:e,onBatchResize:t}){const n=f.useRef(0),r=f.useRef([]),o=f.useContext(sle),i=f.useCallback((s,l,c)=>{n.current+=1;const u=n.current;r.current.push({size:s,element:l,data:c}),Promise.resolve().then(()=>{u===n.current&&(t==null||t(r.current),r.current=[])}),o==null||o(s,l,c)},[t,o]);return f.createElement(sle.Provider,{value:i},e)}const H2=new Map;function Xkn(e){e.forEach(t=>{var r;const{target:n}=t;(r=H2.get(n))==null||r.forEach(o=>o(n))})}let Oee;function wit(){return Oee||(Oee=new ResizeObserver(Xkn)),Oee}function Qkn(e,t){H2.has(e)||(H2.set(e,new Set),wit().observe(e)),H2.get(e).add(t)}function Jkn(e,t){H2.has(e)&&(H2.get(e).delete(t),H2.get(e).size||(wit().unobserve(e),H2.delete(e)))}function Sit(e,t,n,r){const o=f.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),i=Vr(l=>{const{width:c,height:u}=l.getBoundingClientRect(),{offsetWidth:d,offsetHeight:p}=l,h=Math.floor(c),m=Math.floor(u);if(o.current.width!==h||o.current.height!==m||o.current.offsetWidth!==d||o.current.offsetHeight!==p){const g={width:h,height:m,offsetWidth:d,offsetHeight:p};o.current=g;const y=d===Math.round(c)?c:d,x=p===Math.round(u)?u:p,v={...g,offsetWidth:y,offsetHeight:x};r==null||r(v,l),Promise.resolve().then(()=>{n==null||n(v,l)})}}),s=typeof t=="function";f.useEffect(()=>{const l=s?t():t;return l&&e&&Qkn(l,i),()=>{l&&Jkn(l,i)}},[e,s?0:t])}function Zkn(e,t){const{children:n,disabled:r,onResize:o,data:i}=e,s=f.useRef(null),l=f.useContext(sle),c=typeof n=="function",u=c?n(s):n,d=!c&&f.isValidElement(u)&&pb(u),p=d?Xw(u):null,h=Yw(p,s),m=()=>hb(s.current);return f.useImperativeHandle(t,()=>m()),Sit(!r,m,o,(g,y)=>{l==null||l(g,y,i)}),d?f.cloneElement(u,{ref:h}):u}const e4n=f.forwardRef(Zkn);function lle(){return lle=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const s=(o==null?void 0:o.key)||`${t4n}-${i}`;return f.createElement(e4n,lle({},e,{key:s,ref:i===0?t:void 0}),o)})}const Uf=f.forwardRef(n4n);Uf.Collection=Ykn;function cle(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n+setTimeout(e,16),jit=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(Nit=e=>window.requestAnimationFrame(e),jit=e=>window.cancelAnimationFrame(e));let lRe=0;const vye=new Map;function Eit(e){vye.delete(e)}const Bo=(e,t=1)=>{lRe+=1;const n=lRe;function r(o){if(o===0)Eit(n),e();else{const i=Nit(()=>{r(o-1)});vye.set(n,i)}}return r(t),n};Bo.cancel=e=>{const t=vye.get(e);return Eit(e),jit(t)};const r$="ant",SK="anticon",a4n=["outlined","borderless","filled","underlined"],s4n=(e,t)=>t||(e?`${r$}-${e}`:r$),Qr=f.createContext({getPrefixCls:s4n,iconPrefixCls:SK}),{Consumer:Gno}=Qr,cRe={};function Zo(e){const t=f.useContext(Qr),{getPrefixCls:n,direction:r,getPopupContainer:o,renderEmpty:i}=t,s=t[e];return{classNames:cRe,styles:cRe,...s,getPrefixCls:n,direction:r,getPopupContainer:o,renderEmpty:i}}function o$(e){for(var t=0,n,r=0,o=e.length;o>=4;++r,o-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}function ule(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}const uRe="data-rc-order",dRe="data-rc-priority",l4n="rc-util-key",dle=new Map;function Iit({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:l4n}function CK(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function c4n(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function bye(e){return Array.from((dle.get(e)||e).children).filter(t=>t.tagName==="STYLE")}function _it(e,t={}){if(!Ih())return null;const{csp:n,prepend:r,priority:o=0}=t,i=c4n(r),s=i==="prependQueue",l=document.createElement("style");l.setAttribute(uRe,i),s&&o&&l.setAttribute(dRe,`${o}`),n!=null&&n.nonce&&(l.nonce=n==null?void 0:n.nonce),l.innerHTML=e;const c=CK(t),{firstChild:u}=c;if(r){if(s){const d=(t.styles||bye(c)).filter(p=>{if(!["prepend","prependQueue"].includes(p.getAttribute(uRe)))return!1;const h=Number(p.getAttribute(dRe)||0);return o>=h});if(d.length)return c.insertBefore(l,d[d.length-1].nextSibling),l}c.insertBefore(l,u)}else c.appendChild(l);return l}function Pit(e,t={}){let{styles:n}=t;return n||(n=bye(CK(t))),n.find(r=>r.getAttribute(Iit(t))===e)}function i$(e,t={}){const n=Pit(e,t);n&&CK(t).removeChild(n)}function u4n(e,t){const n=dle.get(e);if(!n||!ule(document,n)){const r=_it("",t),{parentNode:o}=r;dle.set(e,o),e.removeChild(r)}}function lC(e,t,n={}){var c,u,d;const r=CK(n),o=bye(r),i={...n,styles:o};u4n(r,i);const s=Pit(t,i);if(s)return(c=i.csp)!=null&&c.nonce&&s.nonce!==((u=i.csp)==null?void 0:u.nonce)&&(s.nonce=(d=i.csp)==null?void 0:d.nonce),s.innerHTML!==e&&(s.innerHTML=e),s;const l=_it(e,i);return l.setAttribute(Iit(i),t),l}function hy(e,t,n=!1){const r=new Set;function o(i,s,l=1){const c=r.has(i);if(Al(!c,"Warning: There may be circular references"),c)return!1;if(i===s)return!0;if(n&&l>1)return!1;r.add(i);const u=l+1;if(Array.isArray(i)){if(!Array.isArray(s)||i.length!==s.length)return!1;for(let d=0;do(i[p],s[p],u))}return!1}return o(e,t)}const d4n="%";function fle(e){return e.join(d4n)}let fRe=0;class f4n{constructor(t){ze(this,"instanceId");ze(this,"cache",new Map);ze(this,"updateTimes",new Map);ze(this,"extracted",new Set);this.instanceId=t}get(t){return this.opGet(fle(t))}opGet(t){return this.cache.get(t)||null}update(t,n){return this.opUpdate(fle(t),n)}opUpdate(t,n){const r=this.cache.get(t),o=n(r);o===null?(this.cache.delete(t),this.updateTimes.delete(t)):(this.cache.set(t,o),this.updateTimes.set(t,fRe),fRe+=1)}}const wye="data-token-hash",Z1="data-css-hash",M1="__cssinjs_instance__";function p4n(){const e=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){const t=document.body.querySelectorAll(`style[${Z1}]`)||[],{firstChild:n}=document.head;Array.from(t).forEach(o=>{o[M1]||(o[M1]=e),o[M1]===e&&document.head.insertBefore(o,n)});const r={};Array.from(document.querySelectorAll(`style[${Z1}]`)).forEach(o=>{var s;const i=o.getAttribute(Z1);r[i]?o[M1]===e&&((s=o.parentNode)==null||s.removeChild(o)):r[i]=!0})}return new f4n(e)}const XL=f.createContext({hashPriority:"low",cache:p4n(),defaultCache:!0,autoPrefix:!1});function h4n(e,t){if(e.length!==t.length)return!1;for(let n=0;n{var i;r?r=(i=r==null?void 0:r.map)==null?void 0:i.get(o):r=void 0}),r!=null&&r.value&&n&&(r.value[1]=this.cacheCallTimes++),r==null?void 0:r.value}get(t){var n;return(n=this.internalGet(t,!0))==null?void 0:n[0]}has(t){return!!this.internalGet(t)}set(t,n){if(!this.has(t)){if(this.size()+1>eA.MAX_CACHE_SIZE+eA.MAX_CACHE_OFFSET){const[o]=this.keys.reduce((i,s)=>{const[,l]=i;return this.internalGet(s)[1]{if(i===t.length-1)r.set(o,{value:[n,this.cacheCallTimes++]});else{const s=r.get(o);s?s.map||(s.map=new Map):r.set(o,{map:new Map}),r=r.get(o).map}})}deleteByPath(t,n){var i;const r=t.get(n[0]);if(n.length===1)return r.map?t.set(n[0],{map:r.map}):t.delete(n[0]),(i=r.value)==null?void 0:i[0];const o=this.deleteByPath(r.map,n.slice(1));return(!r.map||r.map.size===0)&&!r.value&&t.delete(n[0]),o}delete(t){if(this.has(t))return this.keys=this.keys.filter(n=>!h4n(n,t)),this.deleteByPath(this.cache,t)}};ze(eA,"MAX_CACHE_SIZE",20),ze(eA,"MAX_CACHE_OFFSET",5);let ple=eA,pRe=0;class Ait{constructor(t){ze(this,"derivatives");ze(this,"id");this.derivatives=Array.isArray(t)?t:[t],this.id=pRe,t.length===0&&(t.length>0,void 0),pRe+=1}getDerivativeToken(t){return this.derivatives.reduce((n,r)=>r(t,n),void 0)}}const $ee=new ple;function hle(e){const t=Array.isArray(e)?e:[e];return $ee.has(t)||$ee.set(t,new Ait(t)),$ee.get(t)}const m4n=new WeakMap,Dee={};function g4n(e,t){let n=m4n;for(let r=0;r{const r=e[n];t+=n,r instanceof Ait?t+=r.id:r&&typeof r=="object"?t+=CO(r):t+=r}),t=o$(t),hRe.set(e,t)),t}function x4n(e,t){return o$(`${t}_${CO(e)}`)}const mle=Ih();function Xe(e){return typeof e=="number"?`${e}px`:e}function Tit(e){const{hashCls:t,hashPriority:n="low"}=e||{};if(!t)return"";const r=`.${t}`;return n==="low"?`:where(${r})`:r}const y4n=e=>e!=null,lB=(e,t="")=>`--${t?`${t}-`:""}${e}`.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase(),v4n=(e,t,n)=>{const{hashCls:r,hashPriority:o="low"}=n||{};return Object.keys(e).length?`${Tit({hashCls:r,hashPriority:o})}.${t}${n!=null&&n.scope?`.${n.scope}`:""}{${Object.entries(e).map(([i,s])=>`${i}:${s};`).join("")}}`:""},kit=(e,t,n)=>{const{hashCls:r,hashPriority:o="low",prefix:i,unitless:s,ignore:l,preserve:c}=n||{},u={},d={};return Object.entries(e).forEach(([p,h])=>{if(c!=null&&c[p])d[p]=h;else if((typeof h=="string"||typeof h=="number")&&!(l!=null&&l[p])){const m=lB(p,i);u[m]=typeof h=="number"&&!(s!=null&&s[p])?`${h}px`:String(h),d[p]=`var(${m})`}}),[d,v4n(u,t,{scope:n==null?void 0:n.scope,hashCls:r,hashPriority:o})]},XF=new Map;function Sye(e,t,n,r,o){const{cache:i}=f.useContext(XL),s=[e,...t],l=fle(s),c=p=>{i.opUpdate(l,h=>{const[m=0,g]=h||[void 0,void 0],x=g||n(),v=[m,x];return p?p(v):v})};f.useMemo(()=>{c()},[l]);const d=i.opGet(l)[1];return f.useInsertionEffect(()=>(c(([p,h])=>[p+1,h]),XF.has(l)||(o==null||o(d),XF.set(l,!0),Promise.resolve().then(()=>{XF.delete(l)})),()=>{i.opUpdate(l,p=>{const[h=0,m]=p||[];return h-1===0?(r==null||r(m,!1),XF.delete(l),null):[h-1,m]})}),[l]),d}const b4n={},w4n="css",Oj=new Map;function S4n(e){Oj.set(e,(Oj.get(e)||0)+1)}function C4n(e,t){typeof document<"u"&&document.querySelectorAll(`style[${wye}="${e}"]`).forEach(r=>{var o;r[M1]===t&&((o=r.parentNode)==null||o.removeChild(r))})}const N4n=-1;function j4n(e,t){Oj.set(e,(Oj.get(e)||0)-1);const n=new Set;Oj.forEach((r,o)=>{r<=0&&n.add(o)}),Oj.size-n.size>N4n&&n.forEach(r=>{C4n(r,t),Oj.delete(r)})}const E4n=(e,t,n,r)=>{let i={...n.getDerivativeToken(e),...t};return r&&(i=r(i)),i},I4n="token";function _4n(e,t,n){const{cache:{instanceId:r},container:o,hashPriority:i}=f.useContext(XL),{salt:s="",override:l=b4n,formatToken:c,getComputedToken:u,cssVar:d}=n,p=g4n(()=>Object.assign({},...t),t),h=CO(p),m=CO(l),g=CO(d);return Sye(I4n,[s,e.id,h,m,g],()=>{const x=u?u(p,l,e):E4n(p,l,e,c),v={...x},b=`${s}_${d.prefix}`,w=o$(b),S=`${w4n}-${w}`;v._tokenKey=x4n(v,b);const[C,N]=kit(x,d.key,{prefix:d.prefix,ignore:d.ignore,unitless:d.unitless,preserve:d.preserve,hashPriority:i,hashCls:d.hashed?S:void 0});return C._hashId=w,S4n(d.key),[C,S,v,N,d.key]},([,,,,x])=>{j4n(x,r)},([,,,x,v])=>{if(!x)return;const b=lC(x,o$(`css-var-${v}`),{mark:Z1,prepend:"queue",attachTo:o,priority:-999});b[M1]=r,b.setAttribute(wye,v)})}var P4n={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Bl="-ms-",NO="-moz-",is="-webkit-",Mit="comm",Cye="rule",Nye="decl",A4n="@import",T4n="@namespace",Rit="@keyframes",k4n="@layer",Oit=Math.abs,jye=String.fromCharCode,gle=Object.assign;function M4n(e,t){return jd(e,0)^45?(((t<<2^jd(e,0))<<2^jd(e,1))<<2^jd(e,2))<<2^jd(e,3):0}function $it(e){return e.trim()}function v1(e,t){return(e=t.exec(e))?e[0]:e}function Ri(e,t,n){return e.replace(t,n)}function cB(e,t,n){return e.indexOf(t,n)}function jd(e,t){return e.charCodeAt(t)|0}function xI(e,t,n){return e.slice(t,n)}function Mx(e){return e.length}function Dit(e){return e.length}function PR(e,t){return t.push(e),e}function R4n(e,t){return e.map(t).join("")}function mRe(e,t){return e.filter(function(n){return!v1(n,t)})}var NK=1,_T=1,Lit=0,L0=0,td=0,Rk="";function jK(e,t,n,r,o,i,s,l){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:NK,column:_T,length:s,return:"",siblings:l}}function GS(e,t){return gle(jK("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function d_(e){for(;e.root;)e=GS(e.root,{children:[e]});PR(e,e.siblings)}function O4n(){return td}function $4n(){return td=L0>0?jd(Rk,--L0):0,_T--,td===10&&(_T=1,NK--),td}function ny(){return td=L02||a$(td)>3?"":" "}function z4n(e,t){for(;--t&&ny()&&!(td<48||td>102||td>57&&td<65||td>70&&td<97););return EK(e,uB()+(t<6&&V2()==32&&ny()==32))}function xle(e){for(;ny();)switch(td){case e:return L0;case 34:case 39:e!==34&&e!==39&&xle(td);break;case 40:e===41&&xle(e);break;case 92:ny();break}return L0}function B4n(e,t){for(;ny()&&e+td!==57;)if(e+td===84&&V2()===47)break;return"/*"+EK(t,L0-1)+"*"+jye(e===47?e:ny())}function H4n(e){for(;!a$(V2());)ny();return EK(e,L0)}function gRe(e){return L4n(dB("",null,null,null,[""],e=D4n(e),0,[0],e))}function dB(e,t,n,r,o,i,s,l,c){for(var u=0,d=0,p=s,h=0,m=0,g=0,y=1,x=1,v=1,b=0,w="",S=o,C=i,N=r,j=w;x;)switch(g=b,b=ny()){case 40:if(g!=108&&jd(j,p-1)==58){cB(j+=Ri(Lee(b),"&","&\f"),"&\f",Oit(u?l[u-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:j+=Lee(b);break;case 9:case 10:case 13:case 32:j+=F4n(g);break;case 92:j+=z4n(uB()-1,7);continue;case 47:switch(V2()){case 42:case 47:PR(V4n(B4n(ny(),uB()),t,n,c),c),(a$(g||1)==5||a$(V2()||1)==5)&&Mx(j)&&xI(j,-1,void 0)!==" "&&(j+=" ");break;default:j+="/"}break;case 123*y:l[u++]=Mx(j)*v;case 125*y:case 59:case 0:switch(b){case 0:case 125:x=0;case 59+d:v==-1&&(j=Ri(j,/\f/g,"")),m>0&&(Mx(j)-p||y===0&&g===47)&&PR(m>32?yRe(j+";",r,n,p-1,c):yRe(Ri(j," ","")+";",r,n,p-2,c),c);break;case 59:j+=";";default:if(PR(N=xRe(j,t,n,u,d,o,l,w,S=[],C=[],p,i),i),b===123)if(d===0)dB(j,t,N,N,S,i,p,l,C);else{switch(h){case 99:if(jd(j,3)===110)break;case 108:if(jd(j,2)===97)break;default:d=0;case 100:case 109:case 115:}d?dB(e,N,N,r&&PR(xRe(e,N,N,0,0,o,l,w,o,S=[],p,C),C),o,C,p,l,r?S:C):dB(j,N,N,N,[""],C,0,l,C)}}u=d=m=0,y=v=1,w=j="",p=s;break;case 58:p=1+Mx(j),m=g;default:if(y<1){if(b==123)--y;else if(b==125&&y++==0&&$4n()==125)continue}switch(j+=jye(b),b*y){case 38:v=d>0?1:(j+="\f",-1);break;case 44:l[u++]=(Mx(j)-1)*v,v=1;break;case 64:V2()===45&&(j+=Lee(ny())),h=V2(),d=p=Mx(w=j+=H4n(uB())),b++;break;case 45:g===45&&Mx(j)==2&&(y=0)}}return i}function xRe(e,t,n,r,o,i,s,l,c,u,d,p){for(var h=o-1,m=o===0?i:[""],g=Dit(m),y=0,x=0,v=0;y0?m[b]+" "+w:Ri(w,/&\f/g,m[b])))&&(c[v++]=S);return jK(e,t,n,o===0?Cye:l,c,u,d,p)}function V4n(e,t,n,r){return jK(e,t,n,Mit,jye(O4n()),xI(e,2,-2),0,r)}function yRe(e,t,n,r,o){return jK(e,t,n,Nye,xI(e,0,r),xI(e,r+1,-1),r,o)}function Fit(e,t,n){switch(M4n(e,t)){case 5103:return is+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return is+e+e;case 4855:return is+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return NO+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return is+e+NO+e+Bl+e+e;case 5936:switch(jd(e,t+11)){case 114:return is+e+Bl+Ri(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return is+e+Bl+Ri(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return is+e+Bl+Ri(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return is+e+Bl+e+e;case 6165:return is+e+Bl+"flex-"+e+e;case 5187:return is+e+Ri(e,/(\w+).+(:[^]+)/,is+"box-$1$2"+Bl+"flex-$1$2")+e;case 5443:return is+e+Bl+"flex-item-"+Ri(e,/flex-|-self/g,"")+(v1(e,/flex-|baseline/)?"":Bl+"grid-row-"+Ri(e,/flex-|-self/g,""))+e;case 4675:return is+e+Bl+"flex-line-pack"+Ri(e,/align-content|flex-|-self/g,"")+e;case 5548:return is+e+Bl+Ri(e,"shrink","negative")+e;case 5292:return is+e+Bl+Ri(e,"basis","preferred-size")+e;case 6060:return is+"box-"+Ri(e,"-grow","")+is+e+Bl+Ri(e,"grow","positive")+e;case 4554:return is+Ri(e,/([^-])(transform)/g,"$1"+is+"$2")+e;case 6187:return Ri(Ri(Ri(e,/(zoom-|grab)/,is+"$1"),/(image-set)/,is+"$1"),e,"")+e;case 5495:case 3959:return Ri(e,/(image-set\([^]*)/,is+"$1$`$1");case 4968:return Ri(Ri(e,/(.+:)(flex-)?(.*)/,is+"box-pack:$3"+Bl+"flex-pack:$3"),/space-between/,"justify")+is+e+e;case 4200:if(!v1(e,/flex-|baseline/))return Bl+"grid-column-align"+xI(e,t)+e;break;case 2592:case 3360:return Bl+Ri(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,o){return t=o,v1(r.props,/grid-\w+-end/)})?~cB(e+(n=n[t].value),"span",0)?e:Bl+Ri(e,"-start","")+e+Bl+"grid-row-span:"+(~cB(n,"span",0)?v1(n,/\d+/):+v1(n,/\d+/)-+v1(e,/\d+/))+";":Bl+Ri(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return v1(r.props,/grid-\w+-start/)})?e:Bl+Ri(Ri(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Ri(e,/(.+)-inline(.+)/,is+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Mx(e)-1-t>6)switch(jd(e,t+1)){case 109:if(jd(e,t+4)!==45)break;case 102:return Ri(e,/(.+:)(.+)-([^]+)/,"$1"+is+"$2-$3$1"+NO+(jd(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~cB(e,"stretch",0)?Fit(Ri(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Ri(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,o,i,s,l,c,u){return Bl+o+":"+i+u+(s?Bl+o+"-span:"+(l?c:+c-+i)+u:"")+e});case 4949:if(jd(e,t+6)===121)return Ri(e,":",":"+is)+e;break;case 6444:switch(jd(e,jd(e,14)===45?18:11)){case 120:return Ri(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+is+(jd(e,14)===45?"inline-":"")+"box$3$1"+is+"$2$3$1"+Bl+"$2box$3")+e;case 100:return Ri(e,":",":"+Bl)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Ri(e,"scroll-","scroll-snap-")+e}return e}function s$(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case Nye:e.return=Fit(e.value,e.length,n);return;case Rit:return s$([GS(e,{value:Ri(e.value,"@","@"+is)})],r);case Cye:if(e.length)return R4n(n=e.props,function(o){switch(v1(o,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":d_(GS(e,{props:[Ri(o,/:(read-\w+)/,":"+NO+"$1")]})),d_(GS(e,{props:[o]})),gle(e,{props:mRe(n,r)});break;case"::placeholder":d_(GS(e,{props:[Ri(o,/:(plac\w+)/,":"+is+"input-$1")]})),d_(GS(e,{props:[Ri(o,/:(plac\w+)/,":"+NO+"$1")]})),d_(GS(e,{props:[Ri(o,/:(plac\w+)/,Bl+"input-$1")]})),d_(GS(e,{props:[o]})),gle(e,{props:mRe(n,r)});break}return""})}}const bRe="data-ant-cssinjs-cache-path",zit="_FILE_STYLE__";let FE,Bit=!0;function G4n(){var e;if(!FE&&(FE={},Ih())){const t=document.createElement("div");t.className=bRe,t.style.position="fixed",t.style.visibility="hidden",t.style.top="-9999px",document.body.appendChild(t);let n=getComputedStyle(t).content||"";n=n.replace(/^"/,"").replace(/"$/,""),n.split(";").forEach(o=>{const[i,s]=o.split(":");FE[i]=s});const r=document.querySelector(`style[${bRe}]`);r&&(Bit=!1,(e=r.parentNode)==null||e.removeChild(r)),document.body.removeChild(t)}}function q4n(e){return G4n(),!!FE[e]}function K4n(e){const t=FE[e];let n=null;if(t&&Ih())if(Bit)n=zit;else{const r=document.querySelector(`style[${Z1}="${FE[e]}"]`);r?n=r.innerHTML:delete FE[e]}return[n,t]}const Y4n="_skip_check_",Hit="_multi_value_";function Fee(e,t){return(t?s$(gRe(e),U4n([W4n,vRe])):s$(gRe(e),vRe)).replace(/\{%%%\:[^;];}/g,";")}function X4n(e){return typeof e=="object"&&e&&(Y4n in e||Hit in e)}function wRe(e,t,n="high"){if(!t)return e;const r=Tit({hashCls:t,hashPriority:n});return e.split(",").map(i=>{var u;const s=i.trim().split(/\s+/);let l=s[0]||"";const c=((u=l.match(/^\w+/))==null?void 0:u[0])||"";return l=`${c}${r}${l.slice(c.length)}`,[l,...s.slice(1)].join(" ")}).join(",")}const yle=(e,t={},{root:n,injectHash:r,parentSelectors:o}={root:!0,parentSelectors:[]})=>{const{hashId:i,layer:s,path:l,hashPriority:c,transformers:u=[],linters:d=[]}=t;let p="",h={};function m(x){const v=x.getName(i);if(!h[v]){const[b]=yle(x.style,t,{root:!1,parentSelectors:o});h[v]=`@keyframes ${x.getName(i)}${b}`}}function g(x,v=[]){return x.forEach(b=>{Array.isArray(b)?g(b,v):b&&v.push(b)}),v}return g(Array.isArray(e)?e:[e]).forEach(x=>{const v=typeof x=="string"&&!n?{}:x;if(typeof v=="string")p+=`${v} `;else if(v._keyframe)m(v);else{const b=u.reduce((w,S)=>{var C;return((C=S==null?void 0:S.visit)==null?void 0:C.call(S,w))||w},v);Object.keys(b).forEach(w=>{const S=b[w];if(typeof S=="object"&&S&&(w!=="animationName"||!S._keyframe)&&!X4n(S)){let C=!1,N=w.trim(),j=!1;(n||r)&&i?N.startsWith("@")?C=!0:N==="&"?N=wRe("",i,c):N=wRe(w,i,c):n&&!i&&(N==="&"||N==="")&&(N="",j=!0);const[I,_]=yle(S,t,{root:j,injectHash:C,parentSelectors:[...o,N]});h={...h,..._},p+=`${N}${I}`}else{let C=function(j,I){const _=j.replace(/[A-Z]/g,P=>`-${P.toLowerCase()}`);let T=I;!P4n[j]&&typeof T=="number"&&T!==0&&(T=`${T}px`),j==="animationName"&&(I!=null&&I._keyframe)&&(m(I),T=I.getName(i)),p+=`${_}:${T};`};const N=(S==null?void 0:S.value)??S;typeof S=="object"&&(S!=null&&S[Hit])&&Array.isArray(N)?N.forEach(j=>{C(w,j)}):y4n(N)&&C(w,N)}})}}),n?s&&(p&&(p=`@layer ${s.name} {${p}}`),s.dependencies&&(h[`@layer ${s.name}`]=s.dependencies.map(x=>`@layer ${x}, ${s.name};`).join(` `))):p=`{${p}}`,[p,h]};function Vit(e,t){return o$(`${e.join("%")}${t}`)}const Q4n="style";function vle(e,t){const{path:n,hashId:r,layer:o,nonce:i,clientOnly:s,order:l=0}=e,{mock:c,hashPriority:u,container:d,transformers:p,linters:h,cache:m,layer:g,autoPrefix:y}=f.useContext(XL),x=[r||""];g&&x.push("layer"),x.push(...n);let v=mle;Sye(Q4n,x,()=>{const b=x.join("|");if(q4n(b)){const[I,_]=K4n(b);if(I)return[I,_,{},s,l]}const w=t(),[S,C]=yle(w,{hashId:r,hashPriority:u,layer:g?o:void 0,path:n.join("-"),transformers:p,linters:h}),N=Fee(S,y||!1),j=Vit(x,N);return[N,j,C,s,l]},(b,w)=>{const[,S]=b;w&&mle&&i$(S,{mark:Z1,attachTo:d})},b=>{const[w,S,C,,N]=b;if(v&&w!==zit){const j={mark:Z1,prepend:g?!1:"queue",attachTo:d,priority:N},I=typeof i=="function"?i():i;I&&(j.csp={nonce:I});const _=[],T=[];Object.keys(C).forEach(E=>{E.startsWith("@layer")?_.push(E):T.push(E)}),_.forEach(E=>{lC(Fee(C[E],y||!1),`_layer-${E}`,{...j,prepend:!0})});const P=lC(w,S,j);P[M1]=m.instanceId,T.forEach(E=>{lC(Fee(C[E],y||!1),`_effect-${E}`,j)})}})}const J4n="cssVar",Z4n=(e,t)=>{const{key:n,prefix:r,unitless:o,ignore:i,token:s,hashId:l,scope:c=""}=e,{cache:{instanceId:u},container:d,hashPriority:p}=f.useContext(XL),{_tokenKey:h}=s,m=[...e.path,n,c,h];return Sye(J4n,m,()=>{const y=t(),[x,v]=kit(y,n,{prefix:r,unitless:o,ignore:i,scope:c,hashPriority:p,hashCls:l}),b=Vit(m,v);return[x,v,b,n]},([,,y])=>{mle&&i$(y,{mark:Z1,attachTo:d})},([,y,x])=>{if(!y)return;const v=lC(y,x,{mark:Z1,prepend:"queue",attachTo:d,priority:-999});v[M1]=u,v.setAttribute(wye,n)})};class Go{constructor(t,n){ze(this,"name");ze(this,"style");ze(this,"_keyframe",!0);this.name=t,this.style=n}getName(t=""){return t?`${t}-${this.name}`:this.name}}function f_(e){return e.notSplit=!0,e}f_(["borderTop","borderBottom"]),f_(["borderTop"]),f_(["borderBottom"]),f_(["borderLeft","borderRight"]),f_(["borderLeft"]),f_(["borderRight"]);function Uo(e){"@babel/helpers - typeof";return Uo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uo(e)}function eMn(e){if(Array.isArray(e))return e}function tMn(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function nMn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sg(e,t){return eMn(e)||tMn(e,t)||Cit(e,t)||nMn()}function rMn(e,t){if(Uo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Uo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yI(e){var t=rMn(e,"string");return Uo(t)=="symbol"?t:t+""}function Oc(e,t,n){return(t=yI(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SRe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function $r(e){for(var t=1;t1e4){var r=Date.now();this.lastAccessBeat.forEach(function(o,i){r-o>dMn&&(n.map.delete(i),n.lastAccessBeat.delete(i))}),this.accessBeat=0}}}]),e})(),_Re=new fMn;function pMn(e,t){return Ie.useMemo(function(){var n=_Re.get(t);if(n)return n;var r=e();return _Re.set(t,r),r},t)}var hMn=function(){return{}};function mMn(e){var t=e.useCSP,n=t===void 0?hMn:t,r=e.useToken,o=e.usePrefix,i=e.getResetStyles,s=e.getCommonStyle,l=e.getCompUnitless;function c(h,m,g,y){var x=Array.isArray(h)?h[0]:h;function v(I){return"".concat(String(x)).concat(I.slice(0,1).toUpperCase()).concat(I.slice(1))}var b=(y==null?void 0:y.unitless)||{},w=typeof l=="function"?l(h):{},S=$r($r({},w),{},Oc({},v("zIndexPopup"),!0));Object.keys(b).forEach(function(I){S[v(I)]=b[I]});var C=$r($r({},y),{},{unitless:S,prefixToken:v}),N=d(h,m,g,C),j=u(x,g,C);return function(I){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:I,T=N(I,_),P=j(_);return[T,P]}}function u(h,m,g){var y=g.unitless,x=g.prefixToken,v=g.ignore;return function(b){var w=r(),S=w.cssVar,C=w.realToken;return Z4n({path:[h],prefix:S.prefix,key:S.key,unitless:y,ignore:v,token:C,scope:b},function(){var N=IRe(h,C,m),j=jRe(h,C,N,{deprecatedTokens:g==null?void 0:g.deprecatedTokens});return N&&Object.keys(N).forEach(function(I){j[x(I)]=j[I],delete j[I]}),j}),S==null?void 0:S.key}}function d(h,m,g){var y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},x=Array.isArray(h)?h:[h,h],v=sg(x,1),b=v[0],w=x.join("-"),S=e.layer||{name:"antd"};return function(C){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:C,j=r(),I=j.theme,_=j.realToken,T=j.hashId,P=j.token,E=j.cssVar,M=j.zeroRuntime,R=f.useMemo(function(){return M},[]);if(R)return T;var $=o(),D=$.rootPrefixCls,z=$.iconPrefixCls,V=n(),B="css",G=pMn(function(){var K=new Set;return Object.keys(y.unitless||{}).forEach(function(X){K.add(lB(X,E.prefix)),K.add(lB(X,NRe(b,E.prefix)))}),sMn(B,K)},[B,b,E==null?void 0:E.prefix]),H=uMn(),F=H.max,W=H.min,U={theme:I,token:P,hashId:T,nonce:function(){return V.nonce},clientOnly:y.clientOnly,layer:S,order:y.order||-999};return typeof i=="function"&&vle($r($r({},U),{},{clientOnly:!1,path:["Shared",D]}),function(){return i(P,{prefix:{rootPrefixCls:D,iconPrefixCls:z},csp:V})}),vle($r($r({},U),{},{path:[w,C,z]}),function(){if(y.injectStyle===!1)return[];var K=cMn(P),X=K.token,J=K.flush,te=IRe(b,_,g),re=".".concat(C),ce=jRe(b,_,te,{deprecatedTokens:y.deprecatedTokens});te&&Uo(te)==="object"&&Object.keys(te).forEach(function(fe){te[fe]="var(".concat(lB(fe,NRe(b,E.prefix)),")")});var ae=Ho(X,{componentCls:re,prefixCls:C,iconCls:".".concat(z),antCls:".".concat(D),calc:G,max:F,min:W},te),oe=m(ae,{hashId:T,prefixCls:C,rootPrefixCls:D,iconPrefixCls:z});J(b,ce);var ue=typeof s=="function"?s(ae,C,N,y.resetFont):null;return[y.resetStyle===!1?null:ue,oe]}),T}}function p(h,m,g){var y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},x=d(h,m,g,$r({resetStyle:!1,order:-998},y)),v=function(w){var S=w.prefixCls,C=w.rootCls,N=C===void 0?S:C;return x(S,N),null};return v}return{genStyleHooks:c,genSubStyleComponent:p,genComponentStyleHook:d}}const TC=["blue","purple","cyan","green","magenta","pink","red","orange","yellow","volcano","geekblue","lime","gold"];function fB(e){return(e+8)/e}function gMn(e){const t=Array.from({length:10}).map((n,r)=>{const o=r-1,i=e*Math.E**(o/5),s=r>1?Math.floor(i):Math.ceil(i);return Math.floor(s/2)*2});return t[1]=e,t.map(n=>({size:n,lineHeight:fB(n)}))}const xMn="6.2.1",qit={blue:"#1677FF",purple:"#722ED1",cyan:"#13C2C2",green:"#52C41A",magenta:"#EB2F96",pink:"#EB2F96",red:"#F5222D",orange:"#FA8C16",yellow:"#FADB14",volcano:"#FA541C",geekblue:"#2F54EB",gold:"#FAAD14",lime:"#A0D911"},l$={...qit,colorPrimary:"#1677ff",colorSuccess:"#52c41a",colorWarning:"#faad14",colorError:"#ff4d4f",colorInfo:"#1677ff",colorLink:"",colorTextBase:"",colorBgBase:"",fontFamily:`-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'`,fontFamilyCode:"'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace",fontSize:14,lineWidth:1,lineType:"solid",motionUnit:.1,motionBase:0,motionEaseOutCirc:"cubic-bezier(0.08, 0.82, 0.17, 1)",motionEaseInOutCirc:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",motionEaseOut:"cubic-bezier(0.215, 0.61, 0.355, 1)",motionEaseInOut:"cubic-bezier(0.645, 0.045, 0.355, 1)",motionEaseOutBack:"cubic-bezier(0.12, 0.4, 0.29, 1.46)",motionEaseInBack:"cubic-bezier(0.71, -0.46, 0.88, 0.6)",motionEaseInQuint:"cubic-bezier(0.755, 0.05, 0.855, 0.06)",motionEaseOutQuint:"cubic-bezier(0.23, 1, 0.32, 1)",borderRadius:6,sizeUnit:4,sizeStep:4,sizePopupArrow:16,controlHeight:32,zIndexBase:0,zIndexPopupBase:1e3,opacityImage:1,wireframe:!1,motion:!0},yMn={aliceblue:"9ehhb",antiquewhite:"9sgk7",aqua:"1ekf",aquamarine:"4zsno",azure:"9eiv3",beige:"9lhp8",bisque:"9zg04",black:"0",blanchedalmond:"9zhe5",blue:"73",blueviolet:"5e31e",brown:"6g016",burlywood:"8ouiv",cadetblue:"3qba8",chartreuse:"4zshs",chocolate:"87k0u",coral:"9yvyo",cornflowerblue:"3xael",cornsilk:"9zjz0",crimson:"8l4xo",cyan:"1ekf",darkblue:"3v",darkcyan:"rkb",darkgoldenrod:"776yz",darkgray:"6mbhl",darkgreen:"jr4",darkgrey:"6mbhl",darkkhaki:"7ehkb",darkmagenta:"5f91n",darkolivegreen:"3bzfz",darkorange:"9yygw",darkorchid:"5z6x8",darkred:"5f8xs",darksalmon:"9441m",darkseagreen:"5lwgf",darkslateblue:"2th1n",darkslategray:"1ugcv",darkslategrey:"1ugcv",darkturquoise:"14up",darkviolet:"5rw7n",deeppink:"9yavn",deepskyblue:"11xb",dimgray:"442g9",dimgrey:"442g9",dodgerblue:"16xof",firebrick:"6y7tu",floralwhite:"9zkds",forestgreen:"1cisi",fuchsia:"9y70f",gainsboro:"8m8kc",ghostwhite:"9pq0v",goldenrod:"8j4f4",gold:"9zda8",gray:"50i2o",green:"pa8",greenyellow:"6senj",grey:"50i2o",honeydew:"9eiuo",hotpink:"9yrp0",indianred:"80gnw",indigo:"2xcoy",ivory:"9zldc",khaki:"9edu4",lavenderblush:"9ziet",lavender:"90c8q",lawngreen:"4vk74",lemonchiffon:"9zkct",lightblue:"6s73a",lightcoral:"9dtog",lightcyan:"8s1rz",lightgoldenrodyellow:"9sjiq",lightgray:"89jo3",lightgreen:"5nkwg",lightgrey:"89jo3",lightpink:"9z6wx",lightsalmon:"9z2ii",lightseagreen:"19xgq",lightskyblue:"5arju",lightslategray:"4nwk9",lightslategrey:"4nwk9",lightsteelblue:"6wau6",lightyellow:"9zlcw",lime:"1edc",limegreen:"1zcxe",linen:"9shk6",magenta:"9y70f",maroon:"4zsow",mediumaquamarine:"40eju",mediumblue:"5p",mediumorchid:"79qkz",mediumpurple:"5r3rv",mediumseagreen:"2d9ip",mediumslateblue:"4tcku",mediumspringgreen:"1di2",mediumturquoise:"2uabw",mediumvioletred:"7rn9h",midnightblue:"z980",mintcream:"9ljp6",mistyrose:"9zg0x",moccasin:"9zfzp",navajowhite:"9zest",navy:"3k",oldlace:"9wq92",olive:"50hz4",olivedrab:"472ub",orange:"9z3eo",orangered:"9ykg0",orchid:"8iu3a",palegoldenrod:"9bl4a",palegreen:"5yw0o",paleturquoise:"6v4ku",palevioletred:"8k8lv",papayawhip:"9zi6t",peachpuff:"9ze0p",peru:"80oqn",pink:"9z8wb",plum:"8nba5",powderblue:"6wgdi",purple:"4zssg",rebeccapurple:"3zk49",red:"9y6tc",rosybrown:"7cv4f",royalblue:"2jvtt",saddlebrown:"5fmkz",salmon:"9rvci",sandybrown:"9jn1c",seagreen:"1tdnb",seashell:"9zje6",sienna:"6973h",silver:"7ir40",skyblue:"5arjf",slateblue:"45e4t",slategray:"4e100",slategrey:"4e100",snow:"9zke2",springgreen:"1egv",steelblue:"2r1kk",tan:"87yx8",teal:"pds",thistle:"8ggk8",tomato:"9yqfb",turquoise:"2j4r4",violet:"9b10u",wheat:"9ld4j",white:"9zldr",whitesmoke:"9lhpx",yellow:"9zl6o",yellowgreen:"61fzm"},Jd=Math.round;function Bee(e,t){const n=e.replace(/^[^(]*\((.*)/,"$1").replace(/\).*/,"").match(/\d*\.?\d+%?/g)||[],r=n.map(o=>parseFloat(o));for(let o=0;o<3;o+=1)r[o]=t(r[o]||0,n[o]||"",o);return n[3]?r[3]=n[3].includes("%")?r[3]/100:r[3]:r[3]=1,r}const PRe=(e,t,n)=>n===0?e:e/100;function SM(e,t){const n=t||255;return e>n?n:e<0?0:e}class Hi{constructor(t){ze(this,"isValid",!0);ze(this,"r",0);ze(this,"g",0);ze(this,"b",0);ze(this,"a",1);ze(this,"_h");ze(this,"_s");ze(this,"_l");ze(this,"_v");ze(this,"_max");ze(this,"_min");ze(this,"_brightness");function n(r){return r[0]in t&&r[1]in t&&r[2]in t}if(t)if(typeof t=="string"){let o=function(i){return r.startsWith(i)};const r=t.trim();if(/^#?[A-F\d]{3,8}$/i.test(r))this.fromHexString(r);else if(o("rgb"))this.fromRgbString(r);else if(o("hsl"))this.fromHslString(r);else if(o("hsv")||o("hsb"))this.fromHsvString(r);else{const i=yMn[r.toLowerCase()];i&&this.fromHexString(parseInt(i,36).toString(16).padStart(6,"0"))}}else if(t instanceof Hi)this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this._h=t._h,this._s=t._s,this._l=t._l,this._v=t._v;else if(n("rgb"))this.r=SM(t.r),this.g=SM(t.g),this.b=SM(t.b),this.a=typeof t.a=="number"?SM(t.a,1):1;else if(n("hsl"))this.fromHsl(t);else if(n("hsv"))this.fromHsv(t);else throw new Error("@ant-design/fast-color: unsupported input "+JSON.stringify(t))}setR(t){return this._sc("r",t)}setG(t){return this._sc("g",t)}setB(t){return this._sc("b",t)}setA(t){return this._sc("a",t,1)}setHue(t){const n=this.toHsv();return n.h=t,this._c(n)}getLuminance(){function t(i){const s=i/255;return s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4)}const n=t(this.r),r=t(this.g),o=t(this.b);return .2126*n+.7152*r+.0722*o}getHue(){if(typeof this._h>"u"){const t=this.getMax()-this.getMin();t===0?this._h=0:this._h=Jd(60*(this.r===this.getMax()?(this.g-this.b)/t+(this.g"u"){const t=this.getMax()-this.getMin();t===0?this._s=0:this._s=t/this.getMax()}return this._s}getLightness(){return typeof this._l>"u"&&(this._l=(this.getMax()+this.getMin())/510),this._l}getValue(){return typeof this._v>"u"&&(this._v=this.getMax()/255),this._v}getBrightness(){return typeof this._brightness>"u"&&(this._brightness=(this.r*299+this.g*587+this.b*114)/1e3),this._brightness}darken(t=10){const n=this.getHue(),r=this.getSaturation();let o=this.getLightness()-t/100;return o<0&&(o=0),this._c({h:n,s:r,l:o,a:this.a})}lighten(t=10){const n=this.getHue(),r=this.getSaturation();let o=this.getLightness()+t/100;return o>1&&(o=1),this._c({h:n,s:r,l:o,a:this.a})}mix(t,n=50){const r=this._c(t),o=n/100,i=l=>(r[l]-this[l])*o+this[l],s={r:Jd(i("r")),g:Jd(i("g")),b:Jd(i("b")),a:Jd(i("a")*100)/100};return this._c(s)}tint(t=10){return this.mix({r:255,g:255,b:255,a:1},t)}shade(t=10){return this.mix({r:0,g:0,b:0,a:1},t)}onBackground(t){const n=this._c(t),r=this.a+n.a*(1-this.a),o=i=>Jd((this[i]*this.a+n[i]*n.a*(1-this.a))/r);return this._c({r:o("r"),g:o("g"),b:o("b"),a:r})}isDark(){return this.getBrightness()<128}isLight(){return this.getBrightness()>=128}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}clone(){return this._c(this)}toHexString(){let t="#";const n=(this.r||0).toString(16);t+=n.length===2?n:"0"+n;const r=(this.g||0).toString(16);t+=r.length===2?r:"0"+r;const o=(this.b||0).toString(16);if(t+=o.length===2?o:"0"+o,typeof this.a=="number"&&this.a>=0&&this.a<1){const i=Jd(this.a*255).toString(16);t+=i.length===2?i:"0"+i}return t}toHsl(){return{h:this.getHue(),s:this.getSaturation(),l:this.getLightness(),a:this.a}}toHslString(){const t=this.getHue(),n=Jd(this.getSaturation()*100),r=Jd(this.getLightness()*100);return this.a!==1?`hsla(${t},${n}%,${r}%,${this.a})`:`hsl(${t},${n}%,${r}%)`}toHsv(){return{h:this.getHue(),s:this.getSaturation(),v:this.getValue(),a:this.a}}toRgb(){return{r:this.r,g:this.g,b:this.b,a:this.a}}toRgbString(){return this.a!==1?`rgba(${this.r},${this.g},${this.b},${this.a})`:`rgb(${this.r},${this.g},${this.b})`}toString(){return this.toRgbString()}_sc(t,n,r){const o=this.clone();return o[t]=SM(n,r),o}_c(t){return new this.constructor(t)}getMax(){return typeof this._max>"u"&&(this._max=Math.max(this.r,this.g,this.b)),this._max}getMin(){return typeof this._min>"u"&&(this._min=Math.min(this.r,this.g,this.b)),this._min}fromHexString(t){const n=t.replace("#","");function r(o,i){return parseInt(n[o]+n[i||o],16)}n.length<6?(this.r=r(0),this.g=r(1),this.b=r(2),this.a=n[3]?r(3)/255:1):(this.r=r(0,1),this.g=r(2,3),this.b=r(4,5),this.a=n[6]?r(6,7)/255:1)}fromHsl({h:t,s:n,l:r,a:o}){if(this._h=t%360,this._s=n,this._l=r,this.a=typeof o=="number"?o:1,n<=0){const h=Jd(r*255);this.r=h,this.g=h,this.b=h}let i=0,s=0,l=0;const c=t/60,u=(1-Math.abs(2*r-1))*n,d=u*(1-Math.abs(c%2-1));c>=0&&c<1?(i=u,s=d):c>=1&&c<2?(i=d,s=u):c>=2&&c<3?(s=u,l=d):c>=3&&c<4?(s=d,l=u):c>=4&&c<5?(i=d,l=u):c>=5&&c<6&&(i=u,l=d);const p=r-u/2;this.r=Jd((i+p)*255),this.g=Jd((s+p)*255),this.b=Jd((l+p)*255)}fromHsv({h:t,s:n,v:r,a:o}){this._h=t%360,this._s=n,this._v=r,this.a=typeof o=="number"?o:1;const i=Jd(r*255);if(this.r=i,this.g=i,this.b=i,n<=0)return;const s=t/60,l=Math.floor(s),c=s-l,u=Jd(r*(1-n)*255),d=Jd(r*(1-n*c)*255),p=Jd(r*(1-n*(1-c))*255);switch(l){case 0:this.g=p,this.b=u;break;case 1:this.r=d,this.b=u;break;case 2:this.r=u,this.b=p;break;case 3:this.r=u,this.g=d;break;case 4:this.r=p,this.g=u;break;case 5:default:this.g=u,this.b=d;break}}fromHsvString(t){const n=Bee(t,PRe);this.fromHsv({h:n[0],s:n[1],v:n[2],a:n[3]})}fromHslString(t){const n=Bee(t,PRe);this.fromHsl({h:n[0],s:n[1],l:n[2],a:n[3]})}fromRgbString(t){const n=Bee(t,(r,o)=>o.includes("%")?Jd(r/100*255):r);this.r=n[0],this.g=n[1],this.b=n[2],this.a=n[3]}}const QF=2,ARe=.16,vMn=.05,bMn=.05,wMn=.15,Kit=5,Yit=4,SMn=[{index:7,amount:15},{index:6,amount:25},{index:5,amount:30},{index:5,amount:45},{index:5,amount:65},{index:5,amount:85},{index:4,amount:90},{index:3,amount:95},{index:2,amount:97},{index:1,amount:98}];function TRe(e,t,n){let r;return Math.round(e.h)>=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-QF*t:Math.round(e.h)+QF*t:r=n?Math.round(e.h)+QF*t:Math.round(e.h)-QF*t,r<0?r+=360:r>=360&&(r-=360),r}function kRe(e,t,n){if(e.h===0&&e.s===0)return e.s;let r;return n?r=e.s-ARe*t:t===Yit?r=e.s+ARe:r=e.s+vMn*t,r>1&&(r=1),n&&t===Kit&&r>.1&&(r=.1),r<.06&&(r=.06),Math.round(r*100)/100}function MRe(e,t,n){let r;return n?r=e.v+bMn*t:r=e.v-wMn*t,r=Math.max(0,Math.min(1,r)),Math.round(r*100)/100}function Iye(e,t={}){const n=[],r=new Hi(e),o=r.toHsv();for(let i=Kit;i>0;i-=1){const s=new Hi({h:TRe(o,i,!0),s:kRe(o,i,!0),v:MRe(o,i,!0)});n.push(s)}n.push(r);for(let i=1;i<=Yit;i+=1){const s=new Hi({h:TRe(o,i),s:kRe(o,i),v:MRe(o,i)});n.push(s)}return t.theme==="dark"?SMn.map(({index:i,amount:s})=>new Hi(t.backgroundColor||"#141414").mix(n[i],s).toHexString()):n.map(i=>i.toHexString())}const pA={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},wle=["#fff1f0","#ffccc7","#ffa39e","#ff7875","#ff4d4f","#f5222d","#cf1322","#a8071a","#820014","#5c0011"];wle.primary=wle[5];const Sle=["#fff2e8","#ffd8bf","#ffbb96","#ff9c6e","#ff7a45","#fa541c","#d4380d","#ad2102","#871400","#610b00"];Sle.primary=Sle[5];const Cle=["#fff7e6","#ffe7ba","#ffd591","#ffc069","#ffa940","#fa8c16","#d46b08","#ad4e00","#873800","#612500"];Cle.primary=Cle[5];const wU=["#fffbe6","#fff1b8","#ffe58f","#ffd666","#ffc53d","#faad14","#d48806","#ad6800","#874d00","#613400"];wU.primary=wU[5];const Nle=["#feffe6","#ffffb8","#fffb8f","#fff566","#ffec3d","#fadb14","#d4b106","#ad8b00","#876800","#614700"];Nle.primary=Nle[5];const jle=["#fcffe6","#f4ffb8","#eaff8f","#d3f261","#bae637","#a0d911","#7cb305","#5b8c00","#3f6600","#254000"];jle.primary=jle[5];const Ele=["#f6ffed","#d9f7be","#b7eb8f","#95de64","#73d13d","#52c41a","#389e0d","#237804","#135200","#092b00"];Ele.primary=Ele[5];const Ile=["#e6fffb","#b5f5ec","#87e8de","#5cdbd3","#36cfc9","#13c2c2","#08979c","#006d75","#00474f","#002329"];Ile.primary=Ile[5];const SU=["#e6f4ff","#bae0ff","#91caff","#69b1ff","#4096ff","#1677ff","#0958d9","#003eb3","#002c8c","#001d66"];SU.primary=SU[5];const _le=["#f0f5ff","#d6e4ff","#adc6ff","#85a5ff","#597ef7","#2f54eb","#1d39c4","#10239e","#061178","#030852"];_le.primary=_le[5];const Ple=["#f9f0ff","#efdbff","#d3adf7","#b37feb","#9254de","#722ed1","#531dab","#391085","#22075e","#120338"];Ple.primary=Ple[5];const Ale=["#fff0f6","#ffd6e7","#ffadd2","#ff85c0","#f759ab","#eb2f96","#c41d7f","#9e1068","#780650","#520339"];Ale.primary=Ale[5];const Tle=["#a6a6a6","#999999","#8c8c8c","#808080","#737373","#666666","#404040","#1a1a1a","#000000","#000000"];Tle.primary=Tle[5];const Hee={red:wle,volcano:Sle,orange:Cle,gold:wU,yellow:Nle,lime:jle,green:Ele,cyan:Ile,blue:SU,geekblue:_le,purple:Ple,magenta:Ale,grey:Tle};function CMn(e,{generateColorPalettes:t,generateNeutralColorPalettes:n}){const{colorSuccess:r,colorWarning:o,colorError:i,colorInfo:s,colorPrimary:l,colorBgBase:c,colorTextBase:u}=e,d=t(l),p=t(r),h=t(o),m=t(i),g=t(s),y=n(c,u),x=e.colorLink||e.colorInfo,v=t(x),b=new Hi(m[1]).mix(new Hi(m[3]),50).toHexString();return{...y,colorPrimaryBg:d[1],colorPrimaryBgHover:d[2],colorPrimaryBorder:d[3],colorPrimaryBorderHover:d[4],colorPrimaryHover:d[5],colorPrimary:d[6],colorPrimaryActive:d[7],colorPrimaryTextHover:d[8],colorPrimaryText:d[9],colorPrimaryTextActive:d[10],colorSuccessBg:p[1],colorSuccessBgHover:p[2],colorSuccessBorder:p[3],colorSuccessBorderHover:p[4],colorSuccessHover:p[4],colorSuccess:p[6],colorSuccessActive:p[7],colorSuccessTextHover:p[8],colorSuccessText:p[9],colorSuccessTextActive:p[10],colorErrorBg:m[1],colorErrorBgHover:m[2],colorErrorBgFilledHover:b,colorErrorBgActive:m[3],colorErrorBorder:m[3],colorErrorBorderHover:m[4],colorErrorHover:m[5],colorError:m[6],colorErrorActive:m[7],colorErrorTextHover:m[8],colorErrorText:m[9],colorErrorTextActive:m[10],colorWarningBg:h[1],colorWarningBgHover:h[2],colorWarningBorder:h[3],colorWarningBorderHover:h[4],colorWarningHover:h[4],colorWarning:h[6],colorWarningActive:h[7],colorWarningTextHover:h[8],colorWarningText:h[9],colorWarningTextActive:h[10],colorInfoBg:g[1],colorInfoBgHover:g[2],colorInfoBorder:g[3],colorInfoBorderHover:g[4],colorInfoHover:g[4],colorInfo:g[6],colorInfoActive:g[7],colorInfoTextHover:g[8],colorInfoText:g[9],colorInfoTextActive:g[10],colorLinkHover:v[4],colorLink:v[6],colorLinkActive:v[7],colorBgMask:new Hi("#000").setA(.45).toRgbString(),colorWhite:"#fff"}}const NMn=e=>{let t=e,n=e,r=e,o=e;return e<6&&e>=5?t=e+1:e<16&&e>=6?t=e+2:e>=16&&(t=16),e<7&&e>=5?n=4:e<8&&e>=7?n=5:e<14&&e>=8?n=6:e<16&&e>=14?n=7:e>=16&&(n=8),e<6&&e>=2?r=1:e>=6&&(r=2),e>4&&e<8?o=4:e>=8&&(o=6),{borderRadius:e,borderRadiusXS:r,borderRadiusSM:n,borderRadiusLG:t,borderRadiusOuter:o}};function jMn(e){const{motionUnit:t,motionBase:n,borderRadius:r,lineWidth:o}=e;return{motionDurationFast:`${(n+t).toFixed(1)}s`,motionDurationMid:`${(n+t*2).toFixed(1)}s`,motionDurationSlow:`${(n+t*3).toFixed(1)}s`,lineWidthBold:o+1,...NMn(r)}}const EMn=e=>{const{controlHeight:t}=e;return{controlHeightSM:t*.75,controlHeightXS:t*.5,controlHeightLG:t*1.25}},IMn=e=>{const t=gMn(e),n=t.map(d=>d.size),r=t.map(d=>d.lineHeight),o=n[1],i=n[0],s=n[2],l=r[1],c=r[0],u=r[2];return{fontSizeSM:i,fontSize:o,fontSizeLG:s,fontSizeXL:n[3],fontSizeHeading1:n[6],fontSizeHeading2:n[5],fontSizeHeading3:n[4],fontSizeHeading4:n[3],fontSizeHeading5:n[2],lineHeight:l,lineHeightLG:u,lineHeightSM:c,fontHeight:Math.round(l*o),fontHeightLG:Math.round(u*s),fontHeightSM:Math.round(c*i),lineHeightHeading1:r[6],lineHeightHeading2:r[5],lineHeightHeading3:r[4],lineHeightHeading4:r[3],lineHeightHeading5:r[2]}};function _Mn(e){const{sizeUnit:t,sizeStep:n}=e;return{sizeXXL:t*(n+8),sizeXL:t*(n+4),sizeLG:t*(n+2),sizeMD:t*(n+1),sizeMS:t*n,size:t*n,sizeSM:t*(n-1),sizeXS:t*(n-2),sizeXXS:t*(n-3)}}const Dg=(e,t)=>new Hi(e).setA(t).toRgbString(),p_=(e,t)=>new Hi(e).darken(t).toHexString(),PMn=e=>{const t=Iye(e);return{1:t[0],2:t[1],3:t[2],4:t[3],5:t[4],6:t[5],7:t[6],8:t[4],9:t[5],10:t[6]}},AMn=(e,t)=>{const n=e||"#fff",r=t||"#000";return{colorBgBase:n,colorTextBase:r,colorText:Dg(r,.88),colorTextSecondary:Dg(r,.65),colorTextTertiary:Dg(r,.45),colorTextQuaternary:Dg(r,.25),colorFill:Dg(r,.15),colorFillSecondary:Dg(r,.06),colorFillTertiary:Dg(r,.04),colorFillQuaternary:Dg(r,.02),colorBgSolid:Dg(r,1),colorBgSolidHover:Dg(r,.75),colorBgSolidActive:Dg(r,.95),colorBgLayout:p_(n,4),colorBgContainer:p_(n,0),colorBgElevated:p_(n,0),colorBgSpotlight:Dg(r,.85),colorBgBlur:"transparent",colorBorder:p_(n,15),colorBorderDisabled:p_(n,15),colorBorderSecondary:p_(n,6)}};function TMn(e){pA.pink=pA.magenta,Hee.pink=Hee.magenta;const t=Object.keys(qit).map(n=>{const r=e[n]===pA[n]?Hee[n]:Iye(e[n]);return Array.from({length:10},()=>1).reduce((o,i,s)=>(o[`${n}-${s+1}`]=r[s],o[`${n}${s+1}`]=r[s],o),{})}).reduce((n,r)=>(n={...n,...r},n),{});return{...e,...t,...CMn(e,{generateColorPalettes:PMn,generateNeutralColorPalettes:AMn}),...IMn(e.fontSize),..._Mn(e),...EMn(e),...jMn(e)}}const Xit=hle(TMn),kle={token:l$,override:{override:l$},hashed:!0},Qit=Ie.createContext(kle);function Vee(e){return e>=0&&e<=255}function AR(e,t){const{r:n,g:r,b:o,a:i}=new Hi(e).toRgb();if(i<1)return e;const{r:s,g:l,b:c}=new Hi(t).toRgb();for(let u=.01;u<=1;u+=.01){const d=Math.round((n-s*(1-u))/u),p=Math.round((r-l*(1-u))/u),h=Math.round((o-c*(1-u))/u);if(Vee(d)&&Vee(p)&&Vee(h))return new Hi({r:d,g:p,b:h,a:Math.round(u*100)/100}).toRgbString()}return new Hi({r:n,g:r,b:o,a:1}).toRgbString()}function kMn(e){const{override:t,...n}=e,r={...t};Object.keys(l$).forEach(h=>{delete r[h]});const o={...n,...r},i=480,s=576,l=768,c=992,u=1200,d=1600;return o.motion===!1&&(o.motionDurationFast="0s",o.motionDurationMid="0s",o.motionDurationSlow="0s"),{...o,colorFillContent:o.colorFillSecondary,colorFillContentHover:o.colorFill,colorFillAlter:o.colorFillQuaternary,colorBgContainerDisabled:o.colorFillTertiary,colorBorderBg:o.colorBgContainer,colorSplit:AR(o.colorBorderSecondary,o.colorBgContainer),colorTextPlaceholder:o.colorTextQuaternary,colorTextDisabled:o.colorTextQuaternary,colorTextHeading:o.colorText,colorTextLabel:o.colorTextSecondary,colorTextDescription:o.colorTextTertiary,colorTextLightSolid:o.colorWhite,colorHighlight:o.colorError,colorBgTextHover:o.colorFillSecondary,colorBgTextActive:o.colorFill,colorIcon:o.colorTextTertiary,colorIconHover:o.colorText,colorErrorOutline:AR(o.colorErrorBg,o.colorBgContainer),colorWarningOutline:AR(o.colorWarningBg,o.colorBgContainer),fontSizeIcon:o.fontSizeSM,lineWidthFocus:o.lineWidth*3,lineWidth:o.lineWidth,controlOutlineWidth:o.lineWidth*2,controlInteractiveSize:o.controlHeight/2,controlItemBgHover:o.colorFillTertiary,controlItemBgActive:o.colorPrimaryBg,controlItemBgActiveHover:o.colorPrimaryBgHover,controlItemBgActiveDisabled:o.colorFill,controlTmpOutline:o.colorFillQuaternary,controlOutline:AR(o.colorPrimaryBg,o.colorBgContainer),lineType:o.lineType,borderRadius:o.borderRadius,borderRadiusXS:o.borderRadiusXS,borderRadiusSM:o.borderRadiusSM,borderRadiusLG:o.borderRadiusLG,fontWeightStrong:600,opacityLoading:.65,linkDecoration:"none",linkHoverDecoration:"none",linkFocusDecoration:"none",controlPaddingHorizontal:12,controlPaddingHorizontalSM:8,paddingXXS:o.sizeXXS,paddingXS:o.sizeXS,paddingSM:o.sizeSM,padding:o.size,paddingMD:o.sizeMD,paddingLG:o.sizeLG,paddingXL:o.sizeXL,paddingContentHorizontalLG:o.sizeLG,paddingContentVerticalLG:o.sizeMS,paddingContentHorizontal:o.sizeMS,paddingContentVertical:o.sizeSM,paddingContentHorizontalSM:o.size,paddingContentVerticalSM:o.sizeXS,marginXXS:o.sizeXXS,marginXS:o.sizeXS,marginSM:o.sizeSM,margin:o.size,marginMD:o.sizeMD,marginLG:o.sizeLG,marginXL:o.sizeXL,marginXXL:o.sizeXXL,boxShadow:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowSecondary:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowTertiary:` 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02) `,screenXS:i,screenXSMin:i,screenXSMax:s-1,screenSM:s,screenSMMin:s,screenSMMax:l-1,screenMD:l,screenMDMin:l,screenMDMax:c-1,screenLG:c,screenLGMin:c,screenLGMax:u-1,screenXL:u,screenXLMin:u,screenXLMax:d-1,screenXXL:d,screenXXLMin:d,boxShadowPopoverArrow:"2px 2px 5px rgba(0, 0, 0, 0.05)",boxShadowCard:` 0 1px 2px -2px ${new Hi("rgba(0, 0, 0, 0.16)").toRgbString()}, 0 3px 6px 0 ${new Hi("rgba(0, 0, 0, 0.12)").toRgbString()}, 0 5px 12px 4px ${new Hi("rgba(0, 0, 0, 0.09)").toRgbString()} `,boxShadowDrawerRight:` -6px 0 16px 0 rgba(0, 0, 0, 0.08), -3px 0 6px -4px rgba(0, 0, 0, 0.12), -9px 0 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowDrawerLeft:` 6px 0 16px 0 rgba(0, 0, 0, 0.08), 3px 0 6px -4px rgba(0, 0, 0, 0.12), 9px 0 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowDrawerUp:` 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowDrawerDown:` 0 -6px 16px 0 rgba(0, 0, 0, 0.08), 0 -3px 6px -4px rgba(0, 0, 0, 0.12), 0 -9px 28px 8px rgba(0, 0, 0, 0.05) `,boxShadowTabsOverflowLeft:"inset 10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowRight:"inset -10px 0 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowTop:"inset 0 10px 8px -8px rgba(0, 0, 0, 0.08)",boxShadowTabsOverflowBottom:"inset 0 -10px 8px -8px rgba(0, 0, 0, 0.08)",...r}}const Jit={lineHeight:!0,lineHeightSM:!0,lineHeightLG:!0,lineHeightHeading1:!0,lineHeightHeading2:!0,lineHeightHeading3:!0,lineHeightHeading4:!0,lineHeightHeading5:!0,opacityLoading:!0,fontWeightStrong:!0,zIndexPopupBase:!0,zIndexBase:!0,opacityImage:!0},MMn={motionBase:!0,motionUnit:!0},RMn={screenXS:!0,screenXSMin:!0,screenXSMax:!0,screenSM:!0,screenSMMin:!0,screenSMMax:!0,screenMD:!0,screenMDMin:!0,screenMDMax:!0,screenLG:!0,screenLGMin:!0,screenLGMax:!0,screenXL:!0,screenXLMin:!0,screenXLMax:!0,screenXXL:!0,screenXXLMin:!0},Zit=(e,t,n)=>{const r=n.getDerivativeToken(e),{override:o,...i}=t;let s={...r,override:o};return s=kMn(s),i&&Object.entries(i).forEach(([l,c])=>{const{theme:u,...d}=c;let p=d;u&&(p=Zit({...s,...d},{override:d},u)),s[l]=p}),s};function Xf(){const{token:e,hashed:t,theme:n,override:r,cssVar:o,zeroRuntime:i}=Ie.useContext(Qit),s={prefix:(o==null?void 0:o.prefix)??"ant",key:(o==null?void 0:o.key)??"css-var-root"},l=`${xMn}-${t||""}`,c=n||Xit,[u,d,p]=_4n(c,[l$,e],{salt:l,override:r,getComputedToken:Zit,cssVar:{...s,unitless:Jit,ignore:MMn,preserve:RMn}});return[c,p,t?d:"",u,s,!!i]}const wh={overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},Ii=(e,t=!1)=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none",fontFamily:t?"inherit":e.fontFamily}),QL=()=>({display:"inline-flex",alignItems:"center",color:"inherit",fontStyle:"normal",lineHeight:0,textAlign:"center",textTransform:"none",verticalAlign:"-0.125em",textRendering:"optimizeLegibility","-webkit-font-smoothing":"antialiased","-moz-osx-font-smoothing":"grayscale","> *":{lineHeight:1},svg:{display:"inline-block"}}),kC=()=>({"&::before":{display:"table",content:'""'},"&::after":{display:"table",clear:"both",content:'""'}}),OMn=e=>({a:{color:e.colorLink,textDecoration:e.linkDecoration,backgroundColor:"transparent",outline:"none",cursor:"pointer",transition:`color ${e.motionDurationSlow}`,"-webkit-text-decoration-skip":"objects","&:hover":{color:e.colorLinkHover},"&:active":{color:e.colorLinkActive},"&:active, &:hover":{textDecoration:e.linkHoverDecoration,outline:0},"&:focus":{textDecoration:e.linkFocusDecoration,outline:0},"&[disabled]":{color:e.colorTextDisabled,cursor:"not-allowed"}}}),$Mn=(e,t,n,r)=>{const o=`[class^="${t}"], [class*=" ${t}"]`,i=n?`.${n}`:o,s={boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}};let l={};return r!==!1&&(l={fontFamily:e.fontFamily,fontSize:e.fontSize}),{[i]:{...l,...s,[o]:s}}},my=(e,t)=>({outline:`${Xe(e.lineWidthFocus)} solid ${e.colorPrimaryBorder}`,outlineOffset:t??1,transition:"outline-offset 0s, outline 0s"}),gy=(e,t)=>({"&:focus-visible":my(e,t)}),eat=e=>({[`.${e}`]:{...QL(),[`.${e} .${e}-icon`]:{display:"block"}}}),_ye=e=>({color:e.colorLink,textDecoration:e.linkDecoration,outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,border:0,padding:0,background:"none",userSelect:"none",...gy(e),"&:hover":{color:e.colorLinkHover,textDecoration:e.linkHoverDecoration},"&:focus":{color:e.colorLinkHover,textDecoration:e.linkFocusDecoration},"&:active":{color:e.colorLinkActive,textDecoration:e.linkHoverDecoration}}),{genStyleHooks:ui,genComponentStyleHook:DMn,genSubStyleComponent:d5}=mMn({usePrefix:()=>{const{getPrefixCls:e,iconPrefixCls:t}=f.useContext(Qr);return{rootPrefixCls:e(),iconPrefixCls:t}},useToken:()=>{const[e,t,n,r,o,i]=Xf();return{theme:e,realToken:t,hashId:n,token:r,cssVar:o,zeroRuntime:i}},useCSP:()=>{const{csp:e}=f.useContext(Qr);return e??{}},getResetStyles:(e,t)=>{const n=OMn(e);return[n,{"&":n},eat((t==null?void 0:t.prefix.iconPrefixCls)??SK)]},getCommonStyle:$Mn,getCompUnitless:()=>Jit}),bi=(e,t)=>{const n=`--${e.replace(/\./g,"")}-${t}-`;return[i=>`${n}${i}`,(i,s)=>s?`var(${n}${i}, ${s})`:`var(${n}${i})`]};function PK(e,t){return TC.reduce((n,r)=>{const o=e[`${r}1`],i=e[`${r}3`],s=e[`${r}6`],l=e[`${r}7`];return{...n,...t(r,{lightColor:o,lightBorderColor:i,darkColor:s,textColor:l})}},{})}const LMn=(e,t)=>(Xf(),vle({hashId:"",path:["ant-design-icons",e],nonce:()=>t==null?void 0:t.nonce,layer:{name:"antd"}},()=>eat(e)));var FMn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"}}]},name:"check-circle",theme:"filled"};const Pye=f.createContext({});function tat(e){var t;return(t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e)}function zMn(e){return tat(e)instanceof ShadowRoot}function CU(e){return zMn(e)?tat(e):null}function BMn(e){return e.replace(/-(.)/g,(t,n)=>n.toUpperCase())}function HMn(e,t){Al(e,`[@ant-design/icons] ${t}`)}function RRe(e){return typeof e=="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(typeof e.icon=="object"||typeof e.icon=="function")}function ORe(e={}){return Object.keys(e).reduce((t,n)=>{const r=e[n];switch(n){case"class":t.className=r,delete t.class;break;default:delete t[n],t[BMn(n)]=r}return t},{})}function Mle(e,t,n){return n?Ie.createElement(e.tag,{key:t,...ORe(e.attrs),...n},(e.children||[]).map((r,o)=>Mle(r,`${t}-${e.tag}-${o}`))):Ie.createElement(e.tag,{key:t,...ORe(e.attrs)},(e.children||[]).map((r,o)=>Mle(r,`${t}-${e.tag}-${o}`)))}function nat(e){return Iye(e)[0]}function rat(e){return e?Array.isArray(e)?e:[e]:[]}const VMn=` .anticon { display: inline-flex; align-items: center; color: inherit; font-style: normal; line-height: 0; text-align: center; text-transform: none; vertical-align: -0.125em; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .anticon > * { line-height: 1; } .anticon svg { display: inline-block; vertical-align: inherit; } .anticon::before { display: none; } .anticon .anticon-icon { display: block; } .anticon[tabindex] { cursor: pointer; } .anticon-spin::before, .anticon-spin { display: inline-block; -webkit-animation: loadingCircle 1s infinite linear; animation: loadingCircle 1s infinite linear; } @-webkit-keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } `,UMn=e=>{const{csp:t,prefixCls:n,layer:r}=f.useContext(Pye);let o=VMn;n&&(o=o.replace(/anticon/g,n)),r&&(o=`@layer ${r} { ${o} }`),f.useEffect(()=>{const i=e.current,s=CU(i);lC(o,"@ant-design-icons",{prepend:!r,csp:t,attachTo:s})},[])},jO={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function WMn({primaryColor:e,secondaryColor:t}){jO.primaryColor=e,jO.secondaryColor=t||nat(e),jO.calculated=!!t}function GMn(){return{...jO}}const Ok=e=>{const{icon:t,className:n,onClick:r,style:o,primaryColor:i,secondaryColor:s,...l}=e,c=f.useRef(null);let u=jO;if(i&&(u={primaryColor:i,secondaryColor:s||nat(i)}),UMn(c),HMn(RRe(t),`icon should be icon definiton, but got ${t}`),!RRe(t))return null;let d=t;return d&&typeof d.icon=="function"&&(d={...d,icon:d.icon(u.primaryColor,u.secondaryColor)}),Mle(d.icon,`svg-${d.name}`,{className:n,onClick:r,style:o,"data-icon":d.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true",...l,ref:c})};Ok.displayName="IconReact";Ok.getTwoToneColors=GMn;Ok.setTwoToneColors=WMn;function oat(e){const[t,n]=rat(e);return Ok.setTwoToneColors({primaryColor:t,secondaryColor:n})}function qMn(){const e=Ok.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}function Rle(){return Rle=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{className:n,icon:r,spin:o,rotate:i,tabIndex:s,onClick:l,twoToneColor:c,...u}=e,{prefixCls:d="anticon",rootClassName:p}=f.useContext(Pye),h=be(p,d,{[`${d}-${r.name}`]:!!r.name,[`${d}-spin`]:!!o||r.name==="loading"},n);let m=s;m===void 0&&l&&(m=-1);const g=i?{msTransform:`rotate(${i}deg)`,transform:`rotate(${i}deg)`}:void 0,[y,x]=rat(c);return f.createElement("span",Rle({role:"img","aria-label":r.name},u,{ref:t,tabIndex:m,onClick:l,className:h}),f.createElement(Ok,{icon:r,primaryColor:y,secondaryColor:x,style:g}))});bo.getTwoToneColor=qMn;bo.setTwoToneColor=oat;function Ole(){return Ole=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Ole({},e,{ref:t,icon:FMn})),$k=f.forwardRef(KMn);var YMn={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm127.98 274.82h-.04l-.08.06L512 466.75 384.14 338.88c-.04-.05-.06-.06-.08-.06a.12.12 0 00-.07 0c-.03 0-.05.01-.09.05l-45.02 45.02a.2.2 0 00-.05.09.12.12 0 000 .07v.02a.27.27 0 00.06.06L466.75 512 338.88 639.86c-.05.04-.06.06-.06.08a.12.12 0 000 .07c0 .03.01.05.05.09l45.02 45.02a.2.2 0 00.09.05.12.12 0 00.07 0c.02 0 .04-.01.08-.05L512 557.25l127.86 127.87c.04.04.06.05.08.05a.12.12 0 00.07 0c.03 0 .05-.01.09-.05l45.02-45.02a.2.2 0 00.05-.09.12.12 0 000-.07v-.02a.27.27 0 00-.05-.06L557.25 512l127.87-127.86c.04-.04.05-.06.05-.08a.12.12 0 000-.07c0-.03-.01-.05-.05-.09l-45.02-45.02a.2.2 0 00-.09-.05.12.12 0 00-.07 0z"}}]},name:"close-circle",theme:"filled"};function $le(){return $le=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,$le({},e,{ref:t,icon:YMn})),aN=f.forwardRef(XMn);var QMn={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z"}}]},name:"close",theme:"outlined"};function Dle(){return Dle=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Dle({},e,{ref:t,icon:QMn})),_y=f.forwardRef(JMn);var ZMn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"};function Lle(){return Lle=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Lle({},e,{ref:t,icon:ZMn})),JL=f.forwardRef(eRn);var tRn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"};function Fle(){return Fle=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Fle({},e,{ref:t,icon:tRn})),AK=f.forwardRef(nRn),iat=f.createContext({});function rRn({children:e,...t}){return f.createElement(iat.Provider,{value:t},e)}function oRn(e){const[,t]=f.useReducer(i=>i+1,0),n=f.useRef(e),r=Vr(()=>n.current),o=Vr(i=>{n.current=typeof i=="function"?i(n.current):i,t()});return[r,o]}const b1="none",JF="appear",ZF="enter",e7="leave",$Re="none",Rx="prepare",AP="start",TP="active",Aye="end",aat="prepared";function DRe(e,t){const n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit${e}`]=`webkit${t}`,n[`Moz${e}`]=`moz${t}`,n[`ms${e}`]=`MS${t}`,n[`O${e}`]=`o${t.toLowerCase()}`,n}function iRn(e,t){const n={animationend:DRe("Animation","AnimationEnd"),transitionend:DRe("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}const aRn=iRn(Ih(),typeof window<"u"?window:{});let sat={};Ih()&&({style:sat}=document.createElement("div"));const t7={};function lat(e){if(t7[e])return t7[e];const t=aRn[e];if(t){const n=Object.keys(t),r=n.length;for(let o=0;or[1].toUpperCase());return e[n]}return`${e}-${t}`}const lRn=(e=>{const t=f.useRef();function n(o){o&&(o.removeEventListener(FRe,e),o.removeEventListener(LRe,e))}function r(o){t.current&&t.current!==o&&n(t.current),o&&o!==t.current&&(o.addEventListener(FRe,e),o.addEventListener(LRe,e),t.current=o)}return f.useEffect(()=>()=>{n(t.current),t.current=null},[]),[r,n]}),dat=Ih()?f.useLayoutEffect:f.useEffect,cRn=(()=>{const e=f.useRef(null);function t(){Bo.cancel(e.current)}function n(r,o=2){t();const i=Bo(()=>{o<=1?r({isCanceled:()=>i!==e.current}):n(r,o-1)});e.current=i}return f.useEffect(()=>()=>{t()},[]),[n,t]}),uRn=[Rx,AP,TP,Aye],dRn=[Rx,aat],fat=!1,fRn=!0;function pat(e){return e===TP||e===Aye}const pRn=((e,t,n)=>{const[r,o]=n$($Re),[i,s]=cRn();function l(){o(Rx,!0)}const c=t?dRn:uRn;return dat(()=>{if(r!==$Re&&r!==Aye){const u=c.indexOf(r),d=c[u+1],p=n(r);p===fat?o(d,!0):d&&i(h=>{function m(){h.isCanceled()||o(d,!0)}p===!0?m():Promise.resolve(p).then(m)})}},[e,r]),f.useEffect(()=>()=>{s()},[]),[l,r]});function hRn(e,t,n,{motionEnter:r=!0,motionAppear:o=!0,motionLeave:i=!0,motionDeadline:s,motionLeaveImmediately:l,onAppearPrepare:c,onEnterPrepare:u,onLeavePrepare:d,onAppearStart:p,onEnterStart:h,onLeaveStart:m,onAppearActive:g,onEnterActive:y,onLeaveActive:x,onAppearEnd:v,onEnterEnd:b,onLeaveEnd:w,onVisibleChanged:S}){const[C,N]=n$(),[j,I]=oRn(b1),[_,T]=n$(null),P=j(),E=f.useRef(!1),M=f.useRef(null);function R(){return n()}const $=f.useRef(!1);function D(){I(b1),T(null,!0)}const z=Vr(J=>{const te=j();if(te===b1)return;const re=R();if(J&&!J.deadline&&J.target!==re)return;const ce=$.current;let ae;te===JF&&ce?ae=v==null?void 0:v(re,J):te===ZF&&ce?ae=b==null?void 0:b(re,J):te===e7&&ce&&(ae=w==null?void 0:w(re,J)),ce&&ae!==!1&&D()}),[V]=lRn(z),B=J=>{switch(J){case JF:return{[Rx]:c,[AP]:p,[TP]:g};case ZF:return{[Rx]:u,[AP]:h,[TP]:y};case e7:return{[Rx]:d,[AP]:m,[TP]:x};default:return{}}},G=f.useMemo(()=>B(P),[P]),[H,F]=pRn(P,!e,J=>{var te;if(J===Rx){const re=G[Rx];return re?re(R()):fat}return F in G&&T(((te=G[F])==null?void 0:te.call(G,R(),null))||null),F===TP&&P!==b1&&(V(R()),s>0&&(clearTimeout(M.current),M.current=setTimeout(()=>{z({deadline:!0})},s))),F===aat&&D(),fRn}),W=pat(F);$.current=W;const U=f.useRef(null);dat(()=>{if(E.current&&U.current===t)return;N(t);const J=E.current;E.current=!0;let te;!J&&t&&o&&(te=JF),J&&t&&r&&(te=ZF),(J&&!t&&i||!J&&l&&!t&&i)&&(te=e7);const re=B(te);te&&(e||re[Rx])?(I(te),H()):I(b1),U.current=t},[t]),f.useEffect(()=>{(P===JF&&!o||P===ZF&&!r||P===e7&&!i)&&I(b1)},[o,r,i]),f.useEffect(()=>()=>{E.current=!1,clearTimeout(M.current)},[]);const K=f.useRef(!1);f.useEffect(()=>{C&&(K.current=!0),C!==void 0&&P===b1&&((K.current||C)&&(S==null||S(C)),K.current=!0)},[C,P]);let X=_;return G[Rx]&&F===AP&&(X={transition:"none",...X}),[j,F,X,C??t]}function mRn(e){let t=e;typeof e=="object"&&({transitionSupport:t}=e);function n(o,i){return!!(o.motionName&&t&&i!==!1)}const r=f.forwardRef((o,i)=>{const{visible:s=!0,removeOnLeave:l=!0,forceRender:c,children:u,motionName:d,leavedClassName:p,eventProps:h}=o,{motion:m}=f.useContext(iat),g=n(o,m),y=f.useRef();function x(){return hb(y.current)}const[v,b,w,S]=hRn(g,s,x,o),C=v(),N=f.useRef(S);S&&(N.current=!0);const j=f.useMemo(()=>{const T={};return Object.defineProperties(T,{nativeElement:{enumerable:!0,get:x},inMotion:{enumerable:!0,get:()=>()=>v()!==b1},enableMotion:{enumerable:!0,get:()=>()=>g}}),T},[]);f.useImperativeHandle(i,()=>j,[]);let I;const _={...h,visible:s};if(!u)I=null;else if(C===b1)S?I=u({..._},y):!l&&N.current&&p?I=u({..._,className:p},y):c||!l&&!p?I=u({..._,style:{display:"none"}},y):I=null;else{let T;b===Rx?T="prepare":pat(b)?T="active":b===AP&&(T="start");const P=zRe(d,`${C}-${T}`);I=u({..._,className:be(zRe(d,C),{[P]:P&&T,[d]:typeof d=="string"}),style:w},y)}return f.isValidElement(I)&&pb(I)&&(Xw(I)||(I=f.cloneElement(I,{ref:y}))),I});return r.displayName="CSSMotion",r}const Kf=mRn(sRn),zle="add",Ble="keep",Hle="remove",Uee="removed";function gRn(e){let t;return e&&typeof e=="object"&&"key"in e?t=e:t={key:e},{...t,key:String(t.key)}}function Vle(e=[]){return e.map(gRn)}function xRn(e=[],t=[]){let n=[],r=0;const o=t.length,i=Vle(e),s=Vle(t);i.forEach(u=>{let d=!1;for(let p=r;p({...m,status:zle}))),r=p),n.push({...h,status:Ble}),r+=1,d=!0;break}}d||n.push({...u,status:Hle})}),r({...u,status:zle}))));const l={};return n.forEach(({key:u})=>{l[u]=(l[u]||0)+1}),Object.keys(l).filter(u=>l[u]>1).forEach(u=>{n=n.filter(({key:d,status:p})=>d!==u||p!==Hle),n.forEach(d=>{d.key===u&&(d.status=Ble)})}),n}function Ule(){return Ule=Object.assign?Object.assign.bind():function(e){for(var t=1;t{this.setState(s=>({keyEntities:s.keyEntities.map(c=>c.key!==i?c:{...c,status:Uee})}),()=>{const{keyEntities:s}=this.state;s.filter(({status:c})=>c!==Uee).length===0&&this.props.onAllRemoved&&this.props.onAllRemoved()})})}static getDerivedStateFromProps({keys:i},{keyEntities:s}){const l=Vle(i);return{keyEntities:xRn(s,l).filter(u=>{const d=s.find(({key:p})=>u.key===p);return!(d&&d.status===Uee&&u.status===Hle)})}}render(){const{keyEntities:i}=this.state,{component:s,children:l,onVisibleChanged:c,onAllRemoved:u,...d}=this.props,p=s||f.Fragment,h={};return yRn.forEach(m=>{h[m]=d[m],delete d[m]}),delete d.keys,f.createElement(p,d,i.map(({status:m,...g},y)=>{const x=m===zle||m===Ble;return f.createElement(t,Ule({},h,{key:g.key,visible:x,eventProps:g,onVisibleChanged:v=>{c==null||c(v,{key:g.key}),v||this.removeKey(g.key)}}),(v,b)=>l({...v,index:y},b))}))}}return ze(n,"defaultProps",{component:"div"}),n}const hat=vRn(),bRn=`accept acceptCharset accessKey action allowFullScreen allowTransparency alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge charSet checked classID className colSpan cols content contentEditable contextMenu controls coords crossOrigin data dateTime default defer dir disabled download draggable encType form formAction formEncType formMethod formNoValidate formTarget frameBorder headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media mediaGroup method min minLength multiple muted name noValidate nonce open optimum pattern placeholder poster preload radioGroup readOnly rel required reversed role rowSpan rows sandbox scope scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc srcLang srcSet start step style summary tabIndex target title type useMap value width wmode wrap`,wRn=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,SRn=`${bRn} ${wRn}`.split(/[\s\n]+/),CRn="aria-",NRn="data-";function BRe(e,t){return e.indexOf(t)===0}function fl(e,t=!1){let n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n={...t};const r={};return Object.keys(e).forEach(o=>{(n.aria&&(o==="role"||BRe(o,CRn))||n.data&&BRe(o,NRn)||n.attr&&SRn.includes(o))&&(r[o]=e[o])}),r}const mat={items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"};var jRn={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0};function c$(e){"@babel/helpers - typeof";return c$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c$(e)}function HRe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function VRe(e){for(var t=1;thB.reduce((e,t)=>({...e,...t}),xy.Modal);function ARn(e){if(e){const t={...e};return hB.push(t),pB=URe(),()=>{hB=hB.filter(n=>n!==t),pB=URe()}}pB={...xy.Modal}}function xat(){return pB}const Tye=f.createContext(void 0),xg=(e,t)=>{const n=f.useContext(Tye),r=f.useMemo(()=>{const i=t||xy[e],s=(n==null?void 0:n[e])??{};return{...typeof i=="function"?i():i,...s||{}}},[e,t,n]),o=f.useMemo(()=>{const i=n==null?void 0:n.locale;return n!=null&&n.exist&&!i?xy.locale:i},[n]);return[r,o]},TRn="internalMark",kRn=e=>{const{locale:t={},children:n,_ANT_MARK__:r}=e;f.useEffect(()=>ARn(t==null?void 0:t.Modal),[t]);const o=f.useMemo(()=>({...t,exist:!0}),[t]);return f.createElement(Tye.Provider,{value:o},n)};function u$(...e){const t={};return e.forEach(n=>{n&&Object.keys(n).forEach(r=>{n[r]!==void 0&&(t[r]=n[r])})}),t}const ll=e=>e!=null,mb=e=>{if(!e)return;const{closable:t,closeIcon:n}=e;return{closable:t,closeIcon:n}},yat={},WRe=(e,t)=>{if(!e&&(e===!1||t===!1||t===null))return!1;if(e===void 0&&t===void 0)return null;let n={closeIcon:typeof t!="boolean"&&t!==null?t:void 0};return e&&typeof e=="object"&&(n={...n,...e}),n},MRn=(e,t,n)=>e===!1?!1:e?u$(n,t,e):t===!1?!1:t?u$(n,t):n.closable?n:!1,RRn=(e,t,n)=>{const{closeIconRender:r}=t,{closeIcon:o,...i}=e;let s=o;const l=fl(i,!0);return ll(s)&&(r&&(s=r(s)),s=Ie.isValidElement(s)?Ie.cloneElement(s,{"aria-label":n,...s.props,...l}):Ie.createElement("span",{"aria-label":n,...l},s)),[s,l]},vat=(e,t,n=yat,r="Close")=>{const o=WRe(e==null?void 0:e.closable,e==null?void 0:e.closeIcon),i=WRe(t==null?void 0:t.closable,t==null?void 0:t.closeIcon),s={closeIcon:Ie.createElement(_y,null),...n},l=MRn(o,i,s),c=typeof l!="boolean"?!!(l!=null&&l.disabled):!1;if(l===!1)return[!1,null,c,{}];const[u,d]=RRn(l,s,r);return[!0,u,c,d]},TK=(e,t,n=yat)=>{const[r]=xg("global",xy.global);return Ie.useMemo(()=>vat(e,t,{closeIcon:Ie.createElement(_y,null),...n},r.close),[e,t,n,r.close])},bat=()=>Ie.useReducer(e=>e+1,0),GRe=e=>e&&typeof e=="object"?e:typeof e=="boolean"?{enabled:e,blur:e}:{},wat=(e,t,n)=>f.useMemo(()=>{const r=GRe(e),i={...GRe(t),...r},s=i.blur!==!1?`${n}-mask-blur`:void 0;return[i.enabled!==!1,{mask:s}]},[e,t,n]),kK=(e,...t)=>{const n=e||{};return t.filter(Boolean).reduce((r,o)=>(Object.keys(o||{}).forEach(i=>{const s=n[i],l=o[i];if(s&&typeof s=="object")if(l&&typeof l=="object")r[i]=kK(s,r[i],l);else{const{_default:c}=s;c&&(r[i]=r[i]||{},r[i][c]=be(r[i][c],l))}else r[i]=be(r[i],l)}),r),{})},ORn=(e,...t)=>f.useMemo(()=>kK.apply(void 0,[e].concat(t)),[e].concat(t)),kye=(...e)=>e.filter(Boolean).reduce((t,n={})=>(Object.keys(n).forEach(r=>{t[r]={...t[r],...n[r]}}),t),{}),$Rn=(...e)=>f.useMemo(()=>kye.apply(void 0,e),[].concat(e)),Wle=(e,t)=>{const n={...e};return Object.keys(t).forEach(r=>{if(r!=="_default"){const o=t[r],i=n[r]||{};n[r]=o?Wle(i,o):i}}),n},U2=(e,t)=>typeof e=="function"?e(t):e,di=(e,t,n,r)=>{const o=e.map(c=>c?U2(c,n):void 0),i=t.map(c=>c?U2(c,n):void 0),s=ORn.apply(void 0,[r].concat(go(o))),l=$Rn.apply(void 0,go(i));return f.useMemo(()=>r?[Wle(s,r),Wle(l,r)]:[s,l],[s,l,r])},DRn=e=>{const[t,n]=f.useState(null);return[f.useCallback((o,i,s)=>{const l=t??o,c=Math.min(l||0,o),u=Math.max(l||0,o),d=i.slice(c,u+1).map(e),p=d.some(m=>!s.has(m)),h=[];return d.forEach(m=>{p?(s.has(m)||h.push(m),s.add(m)):(s.delete(m),h.push(m))}),n(p?u:null),h},[t]),n]},qRe=e=>e==="horizontal"||e==="vertical",MK=(e,t,n)=>f.useMemo(()=>{const r=qRe(e);let o;return r?o=e:typeof t=="boolean"?o=t?"vertical":"horizontal":o=qRe(n)?n:"horizontal",[o,o==="vertical"]},[n,e,t]),LRn=()=>{const[e,t]=f.useState([]),n=f.useCallback(r=>(t(o=>[].concat(go(o),[r])),()=>{t(o=>o.filter(i=>i!==r))}),[]);return[e,n]},FRn=(e,t)=>(e._antProxy=e._antProxy||{},Object.keys(t).forEach(n=>{if(!(n in e._antProxy)){const r=e[n];e._antProxy[n]=r,e[n]=t[n]}}),e),zRn=(e,t)=>f.useImperativeHandle(e,()=>{const n=t(),{nativeElement:r}=n;return typeof Proxy<"u"?new Proxy(r,{get(o,i){return n[i]?n[i]:Reflect.get(o,i)}}):FRn(r,n)}),BRn=e=>{const t=f.useRef(e),[,n]=bat();return[()=>t.current,r=>{t.current=r,n()}]},ZL=Ie.createContext(void 0),qS=100,HRn=10,Mye=qS*HRn,Sat={Modal:qS,Drawer:qS,Popover:qS,Popconfirm:qS,Tooltip:qS,Tour:qS,FloatButton:qS},VRn={SelectLike:50,Dropdown:50,DatePicker:50,Menu:50,ImagePreview:1},URn=e=>e in Sat,sN=(e,t)=>{const[,n]=Xf(),r=Ie.useContext(ZL),o=URn(e);let i;if(t!==void 0)i=[t,t];else{let s=r??0;o?s+=(r?0:n.zIndexPopupBase)+Sat[e]:s+=VRn[e],i=[r===void 0?t:s,s]}return i},n7=(e,t,n,r,o)=>({background:e,border:`${Xe(r.lineWidth)} ${r.lineType} ${t}`,[`${o}-icon`]:{color:n}}),WRn=e=>{const{componentCls:t,motionDurationSlow:n,marginXS:r,marginSM:o,fontSize:i,fontSizeLG:s,lineHeight:l,borderRadiusLG:c,motionEaseInOutCirc:u,withDescriptionIconSize:d,colorText:p,colorTextHeading:h,withDescriptionPadding:m,defaultPadding:g}=e;return{[t]:{...Ii(e),position:"relative",display:"flex",alignItems:"center",padding:g,wordWrap:"break-word",borderRadius:c,[`&${t}-rtl`]:{direction:"rtl"},[`${t}-section`]:{flex:1,minWidth:0},[`${t}-icon`]:{marginInlineEnd:r,lineHeight:0},"&-description":{display:"none",fontSize:i,lineHeight:l},"&-title":{color:h},[`&${t}-motion-leave`]:{overflow:"hidden",opacity:1,transition:`max-height ${n} ${u}, opacity ${n} ${u}, padding-top ${n} ${u}, padding-bottom ${n} ${u}, margin-bottom ${n} ${u}`},[`&${t}-motion-leave-active`]:{maxHeight:0,marginBottom:"0 !important",paddingTop:0,paddingBottom:0,opacity:0}},[`${t}-with-description`]:{alignItems:"flex-start",padding:m,[`${t}-icon`]:{marginInlineEnd:o,fontSize:d,lineHeight:0},[`${t}-title`]:{display:"block",marginBottom:r,color:h,fontSize:s},[`${t}-description`]:{display:"block",color:p}},[`${t}-banner`]:{marginBottom:0,border:"0 !important",borderRadius:0}}},GRn=e=>{const{componentCls:t,colorSuccess:n,colorSuccessBorder:r,colorSuccessBg:o,colorWarning:i,colorWarningBorder:s,colorWarningBg:l,colorError:c,colorErrorBorder:u,colorErrorBg:d,colorInfo:p,colorInfoBorder:h,colorInfoBg:m}=e;return{[t]:{"&-success":n7(o,r,n,e,t),"&-info":n7(m,h,p,e,t),"&-warning":n7(l,s,i,e,t),"&-error":{...n7(d,u,c,e,t),[`${t}-description > pre`]:{margin:0,padding:0}}}}},qRn=e=>{const{componentCls:t,iconCls:n,motionDurationMid:r,marginXS:o,fontSizeIcon:i,colorIcon:s,colorIconHover:l}=e;return{[t]:{"&-actions":{marginInlineStart:o},[`${t}-close-icon`]:{marginInlineStart:o,padding:0,overflow:"hidden",fontSize:i,lineHeight:Xe(i),backgroundColor:"transparent",border:"none",outline:"none",cursor:"pointer",[`${n}-close`]:{color:s,transition:`color ${r}`,"&:hover":{color:l}}},"&-close-text":{color:s,transition:`color ${r}`,"&:hover":{color:l}}}}},KRn=e=>({withDescriptionIconSize:e.fontSizeHeading3,defaultPadding:`${e.paddingContentVerticalSM}px 12px`,withDescriptionPadding:`${e.paddingMD}px ${e.paddingContentHorizontalLG}px`}),YRn=ui("Alert",e=>[WRn(e),GRn(e),qRn(e)],KRn),XRn=e=>{const{icon:t,type:n,className:r,style:o,successIcon:i,infoIcon:s,warningIcon:l,errorIcon:c}=e,u={success:i??f.createElement($k,null),info:s??f.createElement(AK,null),error:c??f.createElement(aN,null),warning:l??f.createElement(JL,null)};return f.createElement("span",{className:r,style:o},t??u[n])},QRn=e=>{const{isClosable:t,prefixCls:n,closeIcon:r,handleClose:o,ariaProps:i,className:s,style:l}=e,c=r===!0||r===void 0?f.createElement(_y,null):r;return t?f.createElement("button",{type:"button",onClick:o,className:be(`${n}-close-icon`,s),tabIndex:0,style:l,...i},c):null},Cat=f.forwardRef((e,t)=>{const{description:n,prefixCls:r,message:o,title:i,banner:s,className:l,rootClassName:c,style:u,onMouseEnter:d,onMouseLeave:p,onClick:h,afterClose:m,showIcon:g,closable:y,closeText:x,closeIcon:v,action:b,id:w,styles:S,classNames:C,...N}=e,j=i??o,[I,_]=f.useState(!1),T=f.useRef(null);f.useImperativeHandle(t,()=>({nativeElement:T.current}));const{getPrefixCls:P,direction:E,closable:M,closeIcon:R,className:$,style:D,classNames:z,styles:V,successIcon:B,infoIcon:G,warningIcon:H,errorIcon:F}=Zo("alert"),W=P("alert",r),[U,K]=YRn(W),{onClose:X,afterClose:J}=y&&typeof y=="object"?y:{},te=Ne=>{var _e;_(!0),(_e=X??e.onClose)==null||_e(Ne)},re=f.useMemo(()=>e.type!==void 0?e.type:s?"warning":"info",[e.type,s]),ce=f.useMemo(()=>typeof y=="object"&&y.closeIcon||x?!0:typeof y=="boolean"?y:v!==!1&&ll(v)?!0:!!M,[x,v,y,M]),ae=s&&g===void 0?!0:g,oe={...e,prefixCls:W,type:re,showIcon:ae,closable:ce},[ue,fe]=di([z,C],[V,S],{props:oe}),se=be(W,`${W}-${re}`,{[`${W}-with-description`]:!!n,[`${W}-no-icon`]:!ae,[`${W}-banner`]:!!s,[`${W}-rtl`]:E==="rtl"},$,l,c,ue.root,K,U),ge=fl(N,{aria:!0,data:!0}),ye=f.useMemo(()=>typeof y=="object"&&y.closeIcon?y.closeIcon:x||(v!==void 0?v:typeof M=="object"&&M.closeIcon?M.closeIcon:R),[v,y,M,x,R]),de=f.useMemo(()=>{const Ne=y??M;return typeof Ne=="object"?fl(Ne,{data:!0,aria:!0}):{}},[y,M]);return f.createElement(Kf,{visible:!I,motionName:`${W}-motion`,motionAppear:!1,motionEnter:!1,onLeaveStart:Ne=>({maxHeight:Ne.offsetHeight}),onLeaveEnd:J??m},({className:Ne,style:_e},xe)=>f.createElement("div",{id:w,ref:zd(T,xe),"data-show":!I,className:be(se,Ne),style:{...fe.root,...D,...u,..._e},onMouseEnter:d,onMouseLeave:p,onClick:h,role:"alert",...ge},ae?f.createElement(XRn,{className:be(`${W}-icon`,ue.icon),style:fe.icon,description:n,icon:e.icon,prefixCls:W,type:re,successIcon:B,infoIcon:G,warningIcon:H,errorIcon:F}):null,f.createElement("div",{className:be(`${W}-section`,ue.section),style:fe.section},j?f.createElement("div",{className:be(`${W}-title`,ue.title),style:fe.title},j):null,n?f.createElement("div",{className:be(`${W}-description`,ue.description),style:fe.description},n):null),b?f.createElement("div",{className:be(`${W}-actions`,ue.actions),style:fe.actions},b):null,f.createElement(QRn,{className:ue.close,style:fe.close,isClosable:ce,prefixCls:W,closeIcon:ye,handleClose:te,ariaProps:de})))});function JRn(e,t,n){return t=vI(t),Uit(e,_K()?Reflect.construct(t,n||[],vI(e).constructor):t.apply(e,n))}let ZRn=(function(e){function t(){var n;return oN(this,t),n=JRn(this,t,arguments),n.state={error:void 0,info:{componentStack:""}},n}return IK(t,e),iN(t,[{key:"componentDidCatch",value:function(r,o){this.setState({error:r,info:o})}},{key:"render",value:function(){const{message:r,title:o,description:i,id:s,children:l}=this.props,{error:c,info:u}=this.state,d=o??r,p=(u==null?void 0:u.componentStack)||null,h=typeof d>"u"?(c||"").toString():d,m=typeof i>"u"?p:i;return c?f.createElement(Cat,{id:s,type:"error",title:h,description:f.createElement("pre",{style:{fontSize:"0.9em",overflowX:"auto"}},m)}):l}}])})(f.Component);const Rye=Cat;Rye.ErrorBoundary=ZRn;const KRe=e=>typeof e=="object"&&e!=null&&e.nodeType===1,YRe=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",r7=(e,t)=>{if(e.clientHeight{const o=(i=>{if(!i.ownerDocument||!i.ownerDocument.defaultView)return null;try{return i.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!o&&(o.clientHeightit||i>e&&s=t&&l>=n?i-e-r:s>t&&ln?s-t+o:0,eOn=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},XRe=(e,t)=>{var n,r,o,i;if(typeof document>"u")return[];const{scrollMode:s,block:l,inline:c,boundary:u,skipOverflowHiddenElements:d}=t,p=typeof u=="function"?u:D=>D!==u;if(!KRe(e))throw new TypeError("Invalid target");const h=document.scrollingElement||document.documentElement,m=[];let g=e;for(;KRe(g)&&p(g);){if(g=eOn(g),g===h){m.push(g);break}g!=null&&g===document.body&&r7(g)&&!r7(document.documentElement)||g!=null&&r7(g,d)&&m.push(g)}const y=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,x=(i=(o=window.visualViewport)==null?void 0:o.height)!=null?i:innerHeight,{scrollX:v,scrollY:b}=window,{height:w,width:S,top:C,right:N,bottom:j,left:I}=e.getBoundingClientRect(),{top:_,right:T,bottom:P,left:E}=(D=>{const z=window.getComputedStyle(D);return{top:parseFloat(z.scrollMarginTop)||0,right:parseFloat(z.scrollMarginRight)||0,bottom:parseFloat(z.scrollMarginBottom)||0,left:parseFloat(z.scrollMarginLeft)||0}})(e);let M=l==="start"||l==="nearest"?C-_:l==="end"?j+P:C+w/2-_+P,R=c==="center"?I+S/2-E+T:c==="end"?N+T:I-E;const $=[];for(let D=0;D=0&&I>=0&&j<=x&&N<=y&&(z===h&&!r7(z)||C>=G&&j<=F&&I>=W&&N<=H))return $;const U=getComputedStyle(z),K=parseInt(U.borderLeftWidth,10),X=parseInt(U.borderTopWidth,10),J=parseInt(U.borderRightWidth,10),te=parseInt(U.borderBottomWidth,10);let re=0,ce=0;const ae="offsetWidth"in z?z.offsetWidth-z.clientWidth-K-J:0,oe="offsetHeight"in z?z.offsetHeight-z.clientHeight-X-te:0,ue="offsetWidth"in z?z.offsetWidth===0?0:B/z.offsetWidth:0,fe="offsetHeight"in z?z.offsetHeight===0?0:V/z.offsetHeight:0;if(h===z)re=l==="start"?M:l==="end"?M-x:l==="nearest"?o7(b,b+x,x,X,te,b+M,b+M+w,w):M-x/2,ce=c==="start"?R:c==="center"?R-y/2:c==="end"?R-y:o7(v,v+y,y,K,J,v+R,v+R+S,S),re=Math.max(0,re+b),ce=Math.max(0,ce+v);else{re=l==="start"?M-G-X:l==="end"?M-F+te+oe:l==="nearest"?o7(G,F,V,X,te+oe,M,M+w,w):M-(G+V/2)+oe/2,ce=c==="start"?R-W-K:c==="center"?R-(W+B/2)+ae/2:c==="end"?R-H+J+ae:o7(W,H,B,K,J+ae,R,R+S,S);const{scrollLeft:se,scrollTop:ge}=z;re=fe===0?0:Math.max(0,Math.min(ge+re/fe,z.scrollHeight-V/fe+oe)),ce=ue===0?0:Math.max(0,Math.min(se+ce/ue,z.scrollWidth-B/ue+ae)),M+=ge-re,R+=se-ce}$.push({el:z,top:re,left:ce})}return $},tOn=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function nOn(e,t){if(!e.isConnected||!(o=>{let i=o;for(;i&&i.parentNode;){if(i.parentNode===document)return!0;i=i.parentNode instanceof ShadowRoot?i.parentNode.host:i.parentNode}return!1})(e))return;const n=(o=>{const i=window.getComputedStyle(o);return{top:parseFloat(i.scrollMarginTop)||0,right:parseFloat(i.scrollMarginRight)||0,bottom:parseFloat(i.scrollMarginBottom)||0,left:parseFloat(i.scrollMarginLeft)||0}})(e);if((o=>typeof o=="object"&&typeof o.behavior=="function")(t))return t.behavior(XRe(e,t));const r=typeof t=="boolean"||t==null?void 0:t.behavior;for(const{el:o,top:i,left:s}of XRe(e,tOn(t))){const l=i-n.top+n.bottom,c=s-n.left+n.right;o.scroll({top:l,left:c,behavior:r})}}function Gle(e){return ll(e)&&e===e.window}const rOn=e=>{var n;if(typeof window>"u")return 0;let t=0;return Gle(e)?t=e.pageYOffset:e instanceof Document?t=e.documentElement.scrollTop:(e instanceof HTMLElement||e)&&(t=e.scrollTop),e&&!Gle(e)&&typeof t!="number"&&(t=(n=(e.ownerDocument??e).documentElement)==null?void 0:n.scrollTop),t};function oOn(e,t,n,r){const o=n-t;return e/=r/2,e<1?o/2*e*e*e+t:o/2*((e-=2)*e*e+2)+t}function iOn(e,t={}){const{getContainer:n=()=>window,callback:r,duration:o=450}=t,i=n(),s=rOn(i),l=Date.now();let c;const u=()=>{const p=Date.now()-l,h=oOn(p>o?o:p,s,e,o);Gle(i)?i.scrollTo(window.pageXOffset,h):i instanceof Document||i.constructor.name==="HTMLDocument"?i.documentElement.scrollTop=h:i.scrollTop=h,p{Bo.cancel(c)}}const pl=e=>`${e}-css-var`,Nat=f.createContext(void 0),jat=f.createContext(null);let aOn=!1;function sOn(e){return aOn}const QRe=[];function lOn(e,t){const[n]=f.useState(()=>Ih()?document.createElement("div"):null),r=f.useRef(!1),o=f.useContext(jat),[i,s]=f.useState(QRe),l=o||(r.current?void 0:d=>{s(p=>[d,...p])});function c(){n.parentElement||document.body.appendChild(n),r.current=!0}function u(){var d;(d=n.parentElement)==null||d.removeChild(n),r.current=!1}return Po(()=>(e?o?o(c):c():u(),u),[e]),Po(()=>{i.length&&(i.forEach(d=>d()),s(QRe))},[i]),[n,l]}let Wee;function Eat(e){const t=`rc-scrollbar-measure-${Math.random().toString(36).substring(7)}`,n=document.createElement("div");n.id=t;const r=n.style;r.position="absolute",r.left="0",r.top="0",r.width="100px",r.height="100px",r.overflow="scroll";let o,i;if(e){const c=getComputedStyle(e);r.scrollbarColor=c.scrollbarColor,r.scrollbarWidth=c.scrollbarWidth;const u=getComputedStyle(e,"::-webkit-scrollbar"),d=parseInt(u.width,10),p=parseInt(u.height,10);try{const h=d?`width: ${u.width};`:"",m=p?`height: ${u.height};`:"";lC(` #${t}::-webkit-scrollbar { ${h} ${m} }`,t)}catch(h){console.error(h),o=d,i=p}}document.body.appendChild(n);const s=e&&o&&!isNaN(o)?o:n.offsetWidth-n.clientWidth,l=e&&i&&!isNaN(i)?i:n.offsetHeight-n.clientHeight;return document.body.removeChild(n),i$(t),{width:s,height:l}}function JRe(e){return typeof document>"u"?0:(Wee===void 0&&(Wee=Eat()),Wee.width)}function qle(e){return typeof document>"u"||!e||!(e instanceof Element)?{width:0,height:0}:Eat(e)}function cOn(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}const uOn=`rc-util-locker-${Date.now()}`;let ZRe=0;function dOn(e){const t=!!e,[n]=f.useState(()=>(ZRe+=1,`${uOn}_${ZRe}`));Po(()=>{if(t){const r=qle(document.body).width,o=cOn();lC(` html body { overflow-y: hidden; ${o?`width: calc(100% - ${r}px);`:""} }`,n)}else i$(n);return()=>{i$(n)}},[t,n])}function fOn(){return{...sw}.useId}let eOe=0;const tOe=fOn(),Jw=tOe?(function(t){const n=tOe();return t||n}):(function(t){const[n,r]=f.useState("ssr-id");return f.useEffect(()=>{const o=eOe;eOe+=1,r(`rc_unique_${o}`)},[]),t||n});let oE=[];const pOn=200;let Iat=0;const _at=e=>{if(e.key==="Escape"&&!e.isComposing){if(Date.now()-Iat=0;r-=1)oE[r].onEsc({top:r===n-1,event:e})}},Pat=()=>{Iat=Date.now()};function hOn(){window.addEventListener("keydown",_at),window.addEventListener("compositionend",Pat)}function mOn(){oE.length===0&&(window.removeEventListener("keydown",_at),window.removeEventListener("compositionend",Pat))}function gOn(e,t){const n=Jw(),r=Vr(t),o=()=>{oE.find(s=>s.id===n)||oE.push({id:n,onEsc:r})},i=()=>{oE=oE.filter(s=>s.id!==n)};f.useMemo(()=>{e?o():e||i()},[e]),f.useEffect(()=>{if(e)return o(),hOn(),()=>{i(),mOn()}},[e])}const nOe=e=>e===!1?!1:!Ih()||!e?null:typeof e=="string"?document.querySelector(e):typeof e=="function"?e():e,e6=f.forwardRef((e,t)=>{const{open:n,autoLock:r,getContainer:o,debug:i,autoDestroy:s=!0,children:l,onEsc:c}=e,[u,d]=f.useState(n),p=u||n;f.useEffect(()=>{(s||n)&&d(n)},[n,s]);const[h,m]=f.useState(()=>nOe(o));f.useEffect(()=>{const C=nOe(o);m(()=>C??null)});const[g,y]=lOn(p&&!h),x=h??g;dOn(r&&n&&Ih()&&(x===g||x===document.body)),gOn(n,c);let v=null;l&&pb(l)&&t&&(v=Xw(l));const b=Yw(v,t);if(!p||!Ih()||h===void 0)return null;const w=x===!1||sOn();let S=l;return t&&(S=f.cloneElement(l,{ref:b})),f.createElement(jat.Provider,{value:y},w?S:pu.createPortal(S,x))});function xOn(e){const{prefixCls:t,align:n,arrow:r,arrowPos:o}=e,{className:i,content:s,style:l}=r||{},{x:c=0,y:u=0}=o,d=f.useRef(null);if(!n||!n.points)return null;const p={position:"absolute"};if(n.autoArrow!==!1){const h=n.points[0],m=n.points[1],g=h[0],y=h[1],x=m[0],v=m[1];g===x||!["t","b"].includes(g)?p.top=u:g==="t"?p.top=0:p.bottom=0,y===v||!["l","r"].includes(y)?p.left=c:y==="l"?p.left=0:p.right=0}return f.createElement("div",{ref:d,className:be(`${t}-arrow`,i),style:{...p,...l}},s)}function Kle(){return Kle=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement("div",{style:{zIndex:r},className:be(`${t}-mask`,s&&`${t}-mobile-mask`,l)})):null}const vOn=f.memo(({children:e})=>e,(e,t)=>t.cache);function Aat(e,t,n,r,o,i,s,l){var d;const c="auto",u=e?{}:{left:"-1000vw",top:"-1000vh",right:c,bottom:c};if(!e&&(t||!n)){const{points:p}=r,h=r.dynamicInset||((d=r._experimental)==null?void 0:d.dynamicInset),m=h&&p[0][1]==="r",g=h&&p[0][0]==="b";m?(u.right=o,u.left=c):(u.left=s,u.right=c),g?(u.bottom=i,u.top=c):(u.top=l,u.bottom=c)}return u}function Yle(){return Yle=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{onEsc:n,popup:r,className:o,prefixCls:i,style:s,target:l,onVisibleChanged:c,open:u,keepDom:d,fresh:p,onClick:h,mask:m,arrow:g,arrowPos:y,align:x,motion:v,maskMotion:b,mobile:w,forceRender:S,getPopupContainer:C,autoDestroy:N,portal:j,children:I,zIndex:_,onMouseEnter:T,onMouseLeave:P,onPointerEnter:E,onPointerDownCapture:M,ready:R,offsetX:$,offsetY:D,offsetR:z,offsetB:V,onAlign:B,onPrepare:G,onResize:H,stretch:F,targetWidth:W,targetHeight:U}=e,K=typeof r=="function"?r():r,X=u||d,J=!!w,[te,re,ce]=f.useMemo(()=>w?[w.mask,w.maskMotion,w.motion]:[m,b,v],[w,m,b,v]),ae=(C==null?void 0:C.length)>0,[oe,ue]=f.useState(!C||!ae);Po(()=>{!oe&&ae&&l&&ue(!0)},[oe,ae,l]);const fe=Vr((ye,de)=>{H==null||H(ye,de),B()}),se=Aat(J,R,u,x,z,V,$,D);if(!oe)return null;const ge={};return F&&(F.includes("height")&&U?ge.height=U:F.includes("minHeight")&&U&&(ge.minHeight=U),F.includes("width")&&W?ge.width=W:F.includes("minWidth")&&W&&(ge.minWidth=W)),u||(ge.pointerEvents="none"),f.createElement(j,{open:S||X,getContainer:C&&(()=>C(l)),autoDestroy:N,onEsc:n},f.createElement(yOn,{prefixCls:i,open:u,zIndex:_,mask:te,motion:re,mobile:J}),f.createElement(Uf,{onResize:fe,disabled:!u},ye=>f.createElement(Kf,Yle({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:S,leavedClassName:`${i}-hidden`},ce,{onAppearPrepare:G,onEnterPrepare:G,visible:u,onVisibleChanged:de=>{var Ne;(Ne=v==null?void 0:v.onVisibleChanged)==null||Ne.call(v,de),c(de)}}),({className:de,style:Ne},_e)=>{const xe=be(i,de,o,{[`${i}-mobile`]:J});return f.createElement("div",{ref:zd(ye,t,_e),className:xe,style:{"--arrow-x":`${y.x||0}px`,"--arrow-y":`${y.y||0}px`,...se,...ge,...Ne,boxSizing:"border-box",zIndex:_,...s},onMouseEnter:T,onMouseLeave:P,onPointerEnter:E,onClick:h,onPointerDownCapture:M},g&&f.createElement(xOn,{prefixCls:i,arrow:g,arrowPos:y,align:x}),f.createElement(vOn,{cache:!u&&!p},K))})),I)}),jU=f.createContext(null),kat=f.createContext(null);function rOe(e){return e?Array.isArray(e)?e:[e]:[]}function bOn(e,t,n){return f.useMemo(()=>{const r=rOe(t??e),o=rOe(n??e),i=new Set(r),s=new Set(o);return i.has("hover")&&!i.has("click")&&i.add("touch"),s.has("hover")&&!s.has("click")&&s.add("touch"),[i,s]},[e,t,n])}const Dk=(e=>{if(!e)return!1;if(e instanceof Element){if(e.offsetParent)return!0;if(e.getBBox){const{width:t,height:n}=e.getBBox();if(t||n)return!0}if(e.getBoundingClientRect){const{width:t,height:n}=e.getBoundingClientRect();if(t||n)return!0}}return!1});function wOn(e=[],t=[],n){const r=(o,i)=>o[i]||"";return n?r(e,0)===r(t,0):r(e,0)===r(t,0)&&r(e,1)===r(t,1)}function Mat(e,t,n,r){var s;const{points:o}=n,i=Object.keys(e);for(let l=0;lr.includes(l))&&t.push(n),n=n.parentElement}return t}function d$(e,t=1){return Number.isNaN(e)?t:e}function CM(e){return d$(parseFloat(e),0)}function oOe(e,t){const n={...e};return(t||[]).forEach(r=>{if(r instanceof HTMLBodyElement||r instanceof HTMLHtmlElement)return;const{overflow:o,overflowClipMargin:i,borderTopWidth:s,borderBottomWidth:l,borderLeftWidth:c,borderRightWidth:u}=t6(r).getComputedStyle(r),d=r.getBoundingClientRect(),{offsetHeight:p,clientHeight:h,offsetWidth:m,clientWidth:g}=r,y=CM(s),x=CM(l),v=CM(c),b=CM(u),w=d$(Math.round(d.width/m*1e3)/1e3),S=d$(Math.round(d.height/p*1e3)/1e3),C=(m-g-v-b)*w,N=(p-h-y-x)*S,j=y*S,I=x*S,_=v*w,T=b*w;let P=0,E=0;if(o==="clip"){const z=CM(i);P=z*w,E=z*S}const M=d.x+_-P,R=d.y+j-E,$=M+d.width+2*P-_-T-C,D=R+d.height+2*E-j-I-N;n.left=Math.max(n.left,M),n.top=Math.max(n.top,R),n.right=Math.min(n.right,$),n.bottom=Math.min(n.bottom,D)}),n}function iOe(e,t=0){const n=`${t}`,r=n.match(/^(.*)\%$/);return r?e*(parseFloat(r[1])/100):parseFloat(n)}function aOe(e,t){const[n,r]=t||[];return[iOe(e.width,n),iOe(e.height,r)]}function sOe(e=""){return[e[0],e[1]]}function h_(e,t){const n=t[0],r=t[1];let o,i;return n==="t"?i=e.y:n==="b"?i=e.y+e.height:i=e.y+e.height/2,r==="l"?o=e.x:r==="r"?o=e.x+e.width:o=e.x+e.width/2,{x:o,y:i}}function TS(e,t){const n={t:"b",b:"t",l:"r",r:"l"},r=[...e];return r[t]=n[e[t]]||"c",r}function lOe(e){return e.join("")}function Rat(e,t,n,r,o,i,s,l){const[c,u]=f.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:o[r]||{}}),d=f.useRef(0),p=f.useMemo(()=>!t||l?[]:Xle(t),[t]),h=f.useRef({});e||(()=>{h.current={}})();const g=Vr(()=>{var v,b;if(t&&n&&e&&!l){let bt=function(_t,gt,hn=ge){const Vn=$.x+_t,Jn=$.y+gt,Fr=Vn+K,po=Jn+U,nr=Math.max(Vn,hn.left),or=Math.max(Jn,hn.top),Or=Math.min(Fr,hn.right),Tn=Math.min(po,hn.bottom);return Math.max(0,(Or-nr)*(Tn-or))},nn=function(){mt=$.y+lt,Ht=mt+U,jt=$.x+Qe,Vt=jt+K};const w=t,S=w.ownerDocument,C=t6(w),{position:N}=C.getComputedStyle(w),j=w.style.left,I=w.style.top,_=w.style.right,T=w.style.bottom,P=w.style.overflow,E={...o[r],...i},M=S.createElement("div");(v=w.parentElement)==null||v.appendChild(M),M.style.left=`${w.offsetLeft}px`,M.style.top=`${w.offsetTop}px`,M.style.position=N,M.style.height=`${w.offsetHeight}px`,M.style.width=`${w.offsetWidth}px`,w.style.left="0",w.style.top="0",w.style.right="auto",w.style.bottom="auto",w.style.overflow="hidden";let R;if(Array.isArray(n))R={x:n[0],y:n[1],width:0,height:0};else{const _t=n.getBoundingClientRect();_t.x=_t.x??_t.left,_t.y=_t.y??_t.top,R={x:_t.x,y:_t.y,width:_t.width,height:_t.height}}const $=w.getBoundingClientRect(),{height:D,width:z}=C.getComputedStyle(w);$.x=$.x??$.left,$.y=$.y??$.top;const{clientWidth:V,clientHeight:B,scrollWidth:G,scrollHeight:H,scrollTop:F,scrollLeft:W}=S.documentElement,U=$.height,K=$.width,X=R.height,J=R.width,te={left:0,top:0,right:V,bottom:B},re={left:-W,top:-F,right:G-W,bottom:H-F};let{htmlRegion:ce}=E;const ae="visible",oe="visibleFirst";ce!=="scroll"&&ce!==oe&&(ce=ae);const ue=ce===oe,fe=oOe(re,p),se=oOe(te,p),ge=ce===ae?se:fe,ye=ue?se:ge;w.style.left="auto",w.style.top="auto",w.style.right="0",w.style.bottom="0";const de=w.getBoundingClientRect();w.style.left=j,w.style.top=I,w.style.right=_,w.style.bottom=T,w.style.overflow=P,(b=w.parentElement)==null||b.removeChild(M);const Ne=d$(Math.round(K/parseFloat(z)*1e3)/1e3),_e=d$(Math.round(U/parseFloat(D)*1e3)/1e3);if(Ne===0||_e===0||IT(n)&&!Dk(n))return;const{offset:xe,targetOffset:we}=E;let[Te,Re]=aOe($,xe);const[Ue,He]=aOe(R,we);R.x-=Ue,R.y-=He;const[Ye,We]=E.points||[],at=sOe(We),Oe=sOe(Ye),Ae=h_(R,at),qe=h_($,Oe),dt={...E};let Ze=[Oe,at],Qe=Ae.x-qe.x+Te,lt=Ae.y-qe.y+Re;const Ct=bt(Qe,lt),Je=bt(Qe,lt,se),Pe=h_(R,["t","l"]),Me=h_($,["t","l"]),et=h_(R,["b","r"]),vt=h_($,["b","r"]),Pt=E.overflow||{},{adjustX:Jt,adjustY:dn,shiftX:Et,shiftY:sn}=Pt,ot=_t=>typeof _t=="boolean"?_t:_t>=0;let mt,Ht,jt,Vt;nn();const zt=ot(dn),Nn=Oe[0]===at[0];if(zt&&Oe[0]==="t"&&(Ht>ye.bottom||h.current.bt)){let _t=lt;Nn?_t-=U-X:_t=Pe.y-vt.y-Re;const gt=bt(Qe,_t),hn=bt(Qe,_t,se);gt>Ct||gt===Ct&&(!ue||hn>=Je)?(h.current.bt=!0,lt=_t,Re=-Re,Ze=[TS(Ze[0],0),TS(Ze[1],0)]):h.current.bt=!1}if(zt&&Oe[0]==="b"&&(mtCt||gt===Ct&&(!ue||hn>=Je)?(h.current.tb=!0,lt=_t,Re=-Re,Ze=[TS(Ze[0],0),TS(Ze[1],0)]):h.current.tb=!1}const xr=ot(Jt),ur=Oe[1]===at[1];if(xr&&Oe[1]==="l"&&(Vt>ye.right||h.current.rl)){let _t=Qe;ur?_t-=K-J:_t=Pe.x-vt.x-Te;const gt=bt(_t,lt),hn=bt(_t,lt,se);gt>Ct||gt===Ct&&(!ue||hn>=Je)?(h.current.rl=!0,Qe=_t,Te=-Te,Ze=[TS(Ze[0],1),TS(Ze[1],1)]):h.current.rl=!1}if(xr&&Oe[1]==="r"&&(jtCt||gt===Ct&&(!ue||hn>=Je)?(h.current.lr=!0,Qe=_t,Te=-Te,Ze=[TS(Ze[0],1),TS(Ze[1],1)]):h.current.lr=!1}dt.points=[lOe(Ze[0]),lOe(Ze[1])],nn();const Zt=Et===!0?0:Et;typeof Zt=="number"&&(jtse.right&&(Qe-=Vt-se.right-Te,R.x>se.right-Zt&&(Qe+=R.x-se.right+Zt)));const Ot=sn===!0?0:sn;typeof Ot=="number"&&(mtse.bottom&&(lt-=Ht-se.bottom-Re,R.y>se.bottom-Ot&&(lt+=R.y-se.bottom+Ot)));const qt=$.x+Qe,Kt=qt+K,gn=$.y+lt,An=gn+U,pt=R.x,nt=pt+J,xt=R.y,Tt=xt+X,rn=Math.max(qt,pt),un=Math.min(Kt,nt),Kn=(rn+un)/2-qt,ar=Math.max(gn,xt),tr=Math.min(An,Tt),Le=(ar+tr)/2-gn;s==null||s(t,dt);let ke=de.right-$.x-(Qe+$.width),it=de.bottom-$.y-(lt+$.height);Ne===1&&(Qe=Math.floor(Qe),ke=Math.floor(ke)),_e===1&&(lt=Math.floor(lt),it=Math.floor(it));const Mt={ready:!0,offsetX:Qe/Ne,offsetY:lt/_e,offsetR:ke/Ne,offsetB:it/_e,arrowX:Kn/Ne,arrowY:Le/_e,scaleX:Ne,scaleY:_e,align:dt};u(Mt)}}),y=()=>{d.current+=1;const v=d.current;Promise.resolve().then(()=>{d.current===v&&g()})},x=()=>{u(v=>({...v,ready:!1}))};return Po(x,[r]),Po(()=>{e||x()},[e]),[c.ready,c.offsetX,c.offsetY,c.offsetR,c.offsetB,c.arrowX,c.arrowY,c.scaleX,c.scaleY,c.align,y]}function Oat(){const e=f.useRef(null),t=()=>{e.current&&(clearTimeout(e.current),e.current=null)},n=(r,o)=>{t(),o===0?r():e.current=setTimeout(()=>{r()},o*1e3)};return f.useEffect(()=>()=>{t()},[]),n}function SOn(e,t,n,r,o){Po(()=>{if(e&&t&&n){let p=function(){r(),o()};const i=t,s=n,l=Xle(i),c=Xle(s),u=t6(s),d=new Set([u,...l,...c]);return d.forEach(h=>{h.addEventListener("scroll",p,{passive:!0})}),u.addEventListener("resize",p,{passive:!0}),r(),()=>{d.forEach(h=>{h.removeEventListener("scroll",p),u.removeEventListener("resize",p)})}}},[e,t,n])}function COn(e,t,n,r,o,i,s,l){const c=f.useRef(e);c.current=e;const u=f.useRef(!1);f.useEffect(()=>{if(t&&r&&(!o||i)){const p=()=>{u.current=!1},h=y=>{var x,v;c.current&&!s(((v=(x=y.composedPath)==null?void 0:x.call(y))==null?void 0:v[0])||y.target)&&!u.current&&l(!1)},m=t6(r);m.addEventListener("pointerdown",p,!0),m.addEventListener("mousedown",h,!0),m.addEventListener("contextmenu",h,!0);const g=CU(n);return g&&(g.addEventListener("mousedown",h,!0),g.addEventListener("contextmenu",h,!0)),()=>{m.removeEventListener("pointerdown",p,!0),m.removeEventListener("mousedown",h,!0),m.removeEventListener("contextmenu",h,!0),g&&(g.removeEventListener("mousedown",h,!0),g.removeEventListener("contextmenu",h,!0))}}},[t,n,r,o,i]);function d(){u.current=!0}return d}function NOn(){const[e,t]=Ie.useState(null),[n,r]=Ie.useState(!1),[o,i]=Ie.useState(!1),s=Ie.useRef(null),l=Vr(u=>{u===!1?(s.current=null,r(!1)):o&&n?s.current=u:(r(!0),t(u),s.current=null,n||i(!0))}),c=Vr(u=>{u?(i(!1),s.current&&(t(s.current),s.current=null)):(i(!1),s.current=null)});return[l,n,e,c]}function Qle(){return Qle=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:t,isMobile:n,ready:r,open:o,align:i,offsetR:s,offsetB:l,offsetX:c,offsetY:u,arrowPos:d,popupSize:p,motion:h,uniqueContainerClassName:m,uniqueContainerStyle:g}=e,y=`${t}-unique-container`,[x,v]=Ie.useState(!1),b=Aat(n,r,o,i,s,l,c,u),w=Ie.useRef(b);r&&(w.current=b);const S={};return p&&(S.width=p.width,S.height=p.height),Ie.createElement(Kf,Qle({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,leavedClassName:`${y}-hidden`},h,{visible:o,onVisibleChanged:C=>{v(C)}}),({className:C,style:N})=>{const j=be(y,C,m,{[`${y}-visible`]:x});return Ie.createElement("div",{className:j,style:{"--arrow-x":`${(d==null?void 0:d.x)||0}px`,"--arrow-y":`${(d==null?void 0:d.y)||0}px`,...w.current,...S,...N,...g}})})},EOn=({children:e,postTriggerProps:t})=>{const[n,r,o,i]=NOn(),s=f.useMemo(()=>!o||!t?o:t(o),[o,t]),[l,c]=f.useState(null),[u,d]=f.useState(null),p=f.useRef(null),h=Vr(V=>{p.current=V,IT(V)&&l!==V&&c(V)}),m=f.useRef(null),g=Oat(),y=Vr((V,B)=>{m.current=B,g(()=>{n(V)},V.delay)}),x=V=>{g(()=>{var B;(B=m.current)!=null&&B.call(m)||n(!1)},V)},v=Vr(V=>{i(V)}),[b,w,S,C,N,j,I,,,_,T]=Rat(r,l,s==null?void 0:s.target,s==null?void 0:s.popupPlacement,(s==null?void 0:s.builtinPlacements)||{},s==null?void 0:s.popupAlign,void 0,!1),P=f.useMemo(()=>{var B;if(!s)return"";const V=Mat(s.builtinPlacements||{},s.prefixCls||"",_,!1);return be(V,(B=s.getPopupClassNameFromAlign)==null?void 0:B.call(s,_))},[_,s==null?void 0:s.getPopupClassNameFromAlign,s==null?void 0:s.builtinPlacements,s==null?void 0:s.prefixCls]),E=f.useMemo(()=>({show:y,hide:x}),[]);f.useEffect(()=>{T()},[s==null?void 0:s.target]);const M=Vr(()=>(T(),Promise.resolve())),R=f.useRef({}),$=f.useContext(jU),D=f.useMemo(()=>({registerSubPopup:(V,B)=>{R.current[V]=B,$==null||$.registerSubPopup(V,B)}}),[$]),z=s==null?void 0:s.prefixCls;return f.createElement(kat.Provider,{value:E},e,s&&f.createElement(jU.Provider,{value:D},f.createElement(Tat,{ref:h,portal:e6,onEsc:s.onEsc,prefixCls:z,popup:s.popup,className:be(s.popupClassName,P,`${z}-unique-controlled`),style:s.popupStyle,target:s.target,open:r,keepDom:!0,fresh:!0,autoDestroy:!1,onVisibleChanged:v,ready:b,offsetX:w,offsetY:S,offsetR:C,offsetB:N,onAlign:T,onPrepare:M,onResize:V=>d({width:V.offsetWidth,height:V.offsetHeight}),arrowPos:{x:j,y:I},align:_,zIndex:s.zIndex,mask:s.mask,arrow:s.arrow,motion:s.popupMotion,maskMotion:s.maskMotion,getPopupContainer:s.getPopupContainer},f.createElement(jOn,{prefixCls:z,isMobile:!1,ready:b,open:r,align:_,offsetR:C,offsetB:N,offsetX:w,offsetY:S,arrowPos:{x:j,y:I},popupSize:u,motion:s.popupMotion,uniqueContainerClassName:be(s.uniqueContainerClassName,P),uniqueContainerStyle:s.uniqueContainerStyle}))))};function IOn(e=e6){return f.forwardRef((n,r)=>{const{prefixCls:o="rc-trigger-popup",children:i,action:s="hover",showAction:l,hideAction:c,popupVisible:u,defaultPopupVisible:d,onOpenChange:p,afterOpenChange:h,onPopupVisibleChange:m,afterPopupVisibleChange:g,mouseEnterDelay:y,mouseLeaveDelay:x=.1,focusDelay:v,blurDelay:b,mask:w,maskClosable:S=!0,getPopupContainer:C,forceRender:N,autoDestroy:j,popup:I,popupClassName:_,uniqueContainerClassName:T,uniqueContainerStyle:P,popupStyle:E,popupPlacement:M,builtinPlacements:R={},popupAlign:$,zIndex:D,stretch:z,getPopupClassNameFromAlign:V,fresh:B,unique:G,alignPoint:H,onPopupClick:F,onPopupAlign:W,arrow:U,popupMotion:K,maskMotion:X,mobile:J,...te}=n,re=j||!1,ce=u===void 0,ae=!!J,oe=f.useRef({}),ue=f.useContext(jU),fe=f.useMemo(()=>({registerSubPopup:(Tn,er)=>{oe.current[Tn]=er,ue==null||ue.registerSubPopup(Tn,er)}}),[ue]),se=f.useContext(kat),ge=Jw(),[ye,de]=f.useState(null),Ne=f.useRef(null),_e=Vr(Tn=>{Ne.current=Tn,IT(Tn)&&ye!==Tn&&de(Tn),ue==null||ue.registerSubPopup(ge,Tn)}),[xe,we]=f.useState(null),Te=f.useRef(null),Re=Vr(Tn=>{const er=hb(Tn);IT(er)&&xe!==er&&(we(er),Te.current=er)}),Ue={},He=Vr(Tn=>{var Lo,Fo;const er=xe;return(er==null?void 0:er.contains(Tn))||((Lo=CU(er))==null?void 0:Lo.host)===Tn||Tn===er||(ye==null?void 0:ye.contains(Tn))||((Fo=CU(ye))==null?void 0:Fo.host)===Tn||Tn===ye||Object.values(oe.current).some(Ao=>(Ao==null?void 0:Ao.contains(Tn))||Tn===Ao)}),Ye=U?{...U!==!0?U:{}}:null,[We,at]=Fa(d||!1,u),Oe=We||!1,Ae=f.useMemo(()=>{const Tn=typeof i=="function"?i({open:Oe}):i;return f.Children.only(Tn)},[i,Oe]),qe=(Ae==null?void 0:Ae.props)||{},dt=Vr(()=>Oe),Ze=Vr((Tn=0)=>({popup:I,target:xe,delay:Tn,prefixCls:o,popupClassName:_,uniqueContainerClassName:T,uniqueContainerStyle:P,popupStyle:E,popupPlacement:M,builtinPlacements:R,popupAlign:$,zIndex:D,mask:w,maskClosable:S,popupMotion:K,maskMotion:X,arrow:Ye,getPopupContainer:C,getPopupClassNameFromAlign:V,id:ge,onEsc:Je}));Po(()=>{se&&G&&xe&&!ce&&!ue&&(Oe?se.show(Ze(y),dt):se.hide(x))},[Oe,xe]);const Qe=f.useRef(Oe);Qe.current=Oe;const lt=Vr(Tn=>{pu.flushSync(()=>{Oe!==Tn&&(at(Tn),p==null||p(Tn),m==null||m(Tn))})}),bt=Oat(),Ct=(Tn,er=0)=>{if(u!==void 0){bt(()=>{lt(Tn)},er);return}if(se&&G&&ce&&!ue){Tn?se.show(Ze(er),dt):se.hide(er);return}bt(()=>{lt(Tn)},er)};function Je({top:Tn}){Tn&&Ct(!1)}const[Pe,Me]=f.useState(!1);Po(Tn=>{(!Tn||Oe)&&Me(!0)},[Oe]);const[et,vt]=f.useState(null),[Pt,Jt]=f.useState(null),dn=Tn=>{Jt([Tn.clientX,Tn.clientY])},[Et,sn,ot,mt,Ht,jt,Vt,nn,zt,Nn,xr]=Rat(Oe,ye,H&&Pt!==null?Pt:xe,M,R,$,W,ae),[ur,Zt]=bOn(s,l,c),Ot=ur.has("click"),qt=Zt.has("click")||Zt.has("contextMenu"),Kt=Vr(()=>{Pe||xr()});SOn(Oe,xe,ye,Kt,()=>{Qe.current&&H&&qt&&Ct(!1)}),Po(()=>{Kt()},[Pt,M]),Po(()=>{Oe&&!(R!=null&&R[M])&&Kt()},[JSON.stringify($)]);const An=f.useMemo(()=>{const Tn=Mat(R,o,Nn,H);return be(Tn,V==null?void 0:V(Nn))},[Nn,V,R,o,H]);f.useImperativeHandle(r,()=>({nativeElement:Te.current,popupElement:Ne.current,forceAlign:Kt}));const[pt,nt]=f.useState(0),[xt,Tt]=f.useState(0),rn=()=>{if(z&&xe){const Tn=xe.getBoundingClientRect();nt(Tn.width),Tt(Tn.height)}},un=()=>{rn(),Kt()},xn=Tn=>{Me(!1),xr(),h==null||h(Tn),g==null||g(Tn)},Kn=()=>new Promise(Tn=>{rn(),vt(()=>Tn)});Po(()=>{et&&(xr(),et(),vt(null))},[et]);function ar(Tn,er,Lo,Fo,Ao){Ue[Tn]=(uo,...Wi)=>{var Jr;(!Ao||!Ao())&&(Fo==null||Fo(uo),Ct(er,Lo)),(Jr=qe[Tn])==null||Jr.call(qe,uo,...Wi)}}const tr=ur.has("touch"),jn=Zt.has("touch"),Le=f.useRef(!1);(tr||jn)&&(Ue.onTouchStart=(...Tn)=>{var er;Le.current=!0,Qe.current&&jn?Ct(!1):!Qe.current&&tr&&Ct(!0),(er=qe.onTouchStart)==null||er.call(qe,...Tn)}),(Ot||qt)&&(Ue.onClick=(Tn,...er)=>{var Lo;Qe.current&&qt?Ct(!1):!Qe.current&&Ot&&(dn(Tn),Ct(!0)),(Lo=qe.onClick)==null||Lo.call(qe,Tn,...er),Le.current=!1});const ke=COn(Oe,qt||jn,xe,ye,w,S,He,Ct),it=ur.has("hover"),Mt=Zt.has("hover");let _t,gt;const hn=()=>Le.current;if(it){const Tn=er=>{dn(er)};ar("onMouseEnter",!0,y,Tn,hn),ar("onPointerEnter",!0,y,Tn,hn),_t=er=>{(Oe||Pe)&&(ye!=null&&ye.contains(er.target))&&Ct(!0,y)},H&&(Ue.onMouseMove=er=>{var Lo;(Lo=qe.onMouseMove)==null||Lo.call(qe,er)})}Mt&&(ar("onMouseLeave",!1,x,void 0,hn),ar("onPointerLeave",!1,x,void 0,hn),gt=()=>{Ct(!1,x)}),ur.has("focus")&&ar("onFocus",!0,v),Zt.has("focus")&&ar("onBlur",!1,b),ur.has("contextMenu")&&(Ue.onContextMenu=(Tn,...er)=>{var Lo;Qe.current&&Zt.has("contextMenu")?Ct(!1):(dn(Tn),Ct(!0)),Tn.preventDefault(),(Lo=qe.onContextMenu)==null||Lo.call(qe,Tn,...er)});const Vn=f.useRef(!1);Vn.current||(Vn.current=N||Oe||Pe);const Jn={...qe,...Ue},Fr={};["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"].forEach(Tn=>{te[Tn]&&(Fr[Tn]=(...er)=>{var Lo;(Lo=Jn[Tn])==null||Lo.call(Jn,...er),te[Tn](...er)})});const nr={x:jt,y:Vt};Sit(Oe,xe,un);const or=Yw(Re,Xw(Ae)),Or=f.cloneElement(Ae,{...Jn,...Fr,ref:or});return f.createElement(f.Fragment,null,Or,Vn.current&&(!se||!G)&&f.createElement(jU.Provider,{value:fe},f.createElement(Tat,{portal:e,ref:_e,prefixCls:o,popup:I,className:be(_,!ae&&An),style:E,target:xe,onMouseEnter:_t,onMouseLeave:gt,onPointerEnter:_t,zIndex:D,open:Oe,keepDom:Pe,fresh:B,onClick:F,onPointerDownCapture:ke,mask:w,motion:K,maskMotion:X,onVisibleChanged:xn,onPrepare:Kn,forceRender:N,autoDestroy:re,getPopupContainer:C,onEsc:Je,align:Nn,arrow:Ye,arrowPos:nr,ready:Et,offsetX:sn,offsetY:ot,offsetR:mt,offsetB:Ht,onAlign:Kt,stretch:z,targetWidth:pt/nn,targetHeight:xt/zt,mobile:J})))})}const n6=IOn(e6);function $at(e){return e&&Ie.isValidElement(e)&&e.type===Ie.Fragment}const Dat=(e,t,n)=>Ie.isValidElement(e)?Ie.cloneElement(e,typeof n=="function"?n(e.props||{}):n):t;function Fc(e,t){return Dat(e,e,t)}const _On=({children:e})=>{const{getPrefixCls:t}=Ie.useContext(Qr),n=t();return Ie.isValidElement(e)?Ie.createElement(Kf,{visible:!0,motionName:`${n}-fade`,motionAppear:!0,motionEnter:!0,motionLeave:!1,removeOnLeave:!1},({style:r,className:o})=>Fc(e,i=>({className:be(i.className,o),style:{...i.style,...r}}))):e},i7=[null,null];function POn(e){if(i7[0]!==e){const t={};Object.keys(e).forEach(n=>{t[n]={...e[n],dynamicInset:!1}}),i7[0]=e,i7[1]=t}return i7[1]}const Lat=({children:e})=>{const t=n=>{const{id:r,builtinPlacements:o,popup:i}=n,s=typeof i=="function"?i():i,l=POn(o);return{...n,getPopupContainer:null,arrow:!1,popup:Ie.createElement(_On,{key:r},s),builtinPlacements:l}};return Ie.createElement(EOn,{postTriggerProps:t},e)},Mp=f.createContext(!1),Oye=({children:e,disabled:t})=>{const n=f.useContext(Mp);return f.createElement(Mp.Provider,{value:t??n},e)},bI=f.createContext(void 0),AOn=({children:e,size:t})=>{const n=f.useContext(bI);return f.createElement(bI.Provider,{value:t||n},e)};function TOn(){const e=f.useContext(Mp),t=f.useContext(bI);return{componentDisabled:e,componentSize:t}}function kOn(e,t,n){Qw();const r=e||{},o=r.inherit===!1||!t?{...kle,hashed:(t==null?void 0:t.hashed)??kle.hashed,cssVar:t==null?void 0:t.cssVar}:t,i=f.useId();return u5(()=>{var u;if(!e)return t;const s={...o.components};Object.keys(e.components||{}).forEach(d=>{s[d]={...s[d],...e.components[d]}});const l=`css-var-${i.replace(/:/g,"")}`,c={prefix:n==null?void 0:n.prefixCls,...o.cssVar,...r.cssVar,key:((u=r.cssVar)==null?void 0:u.key)||l};return{...o,...r,token:{...o.token,...r.token},components:s,cssVar:c}},[r,o],(s,l)=>s.some((c,u)=>{const d=l[u];return!hy(c,d,!0)}))}const cOe=f.createContext(!0);function MOn(e){const t=f.useContext(cOe),{children:n}=e,[,r]=Xf(),{motion:o}=r,i=f.useRef(!1);return i.current||(i.current=t!==o),i.current?f.createElement(cOe.Provider,{value:o},f.createElement(rRn,{motion:o},n)):n}const ROn=()=>null,OOn=({iconPrefixCls:e,csp:t})=>(LMn(e,t),null),$On=["getTargetContainer","getPopupContainer","renderEmpty","input","pagination","form","select","button"];let EU,Fat,zat,Bat;function Gee(){return EU||r$}function DOn(){return Fat||SK}const LOn=e=>{const{prefixCls:t,iconPrefixCls:n,theme:r,holderRender:o}=e;t!==void 0&&(EU=t),n!==void 0&&(Fat=n),"holderRender"in e&&(Bat=o),r&&(zat=r)},$ye=()=>({getPrefixCls:(e,t)=>t||(e?`${Gee()}-${e}`:Gee()),getIconPrefixCls:DOn,getRootPrefixCls:()=>EU||Gee(),getTheme:()=>zat,holderRender:Bat}),FOn=e=>{const{children:t,csp:n,autoInsertSpaceInButton:r,alert:o,affix:i,anchor:s,form:l,locale:c,componentSize:u,direction:d,space:p,splitter:h,virtual:m,dropdownMatchSelectWidth:g,popupMatchSelectWidth:y,popupOverflow:x,legacyLocale:v,parentContext:b,iconPrefixCls:w,theme:S,componentDisabled:C,segmented:N,statistic:j,spin:I,calendar:_,carousel:T,cascader:P,collapse:E,typography:M,checkbox:R,descriptions:$,divider:D,drawer:z,skeleton:V,steps:B,image:G,layout:H,list:F,mentions:W,modal:U,progress:K,result:X,slider:J,breadcrumb:te,masonry:re,menu:ce,pagination:ae,input:oe,textArea:ue,otp:fe,empty:se,badge:ge,radio:ye,rate:de,ribbon:Ne,switch:_e,transfer:xe,avatar:we,message:Te,tag:Re,table:Ue,card:He,cardMeta:Ye,tabs:We,timeline:at,timePicker:Oe,upload:Ae,notification:qe,tree:dt,colorPicker:Ze,datePicker:Qe,rangePicker:lt,flex:bt,wave:Ct,dropdown:Je,warning:Pe,tour:Me,tooltip:et,popover:vt,popconfirm:Pt,qrcode:Jt,floatButton:dn,floatButtonGroup:Et,variant:sn,inputNumber:ot,treeSelect:mt,watermark:Ht}=e,jt=f.useCallback((An,pt)=>{const{prefixCls:nt}=e;if(pt)return pt;const xt=nt||b.getPrefixCls("");return An?`${xt}-${An}`:xt},[b.getPrefixCls,e.prefixCls]),Vt=w||b.iconPrefixCls||SK,nn=n||b.csp,zt=kOn(S,b.theme,{prefixCls:jt("")}),Nn={csp:nn,autoInsertSpaceInButton:r,alert:o,affix:i,anchor:s,locale:c||v,direction:d,space:p,splitter:h,virtual:m,popupMatchSelectWidth:y??g,popupOverflow:x,getPrefixCls:jt,iconPrefixCls:Vt,theme:zt,segmented:N,statistic:j,spin:I,calendar:_,carousel:T,cascader:P,collapse:E,typography:M,checkbox:R,descriptions:$,divider:D,drawer:z,skeleton:V,steps:B,image:G,input:oe,textArea:ue,otp:fe,layout:H,list:F,mentions:W,modal:U,progress:K,result:X,slider:J,breadcrumb:te,masonry:re,menu:ce,pagination:ae,empty:se,badge:ge,radio:ye,rate:de,ribbon:Ne,switch:_e,transfer:xe,avatar:we,message:Te,tag:Re,table:Ue,card:He,cardMeta:Ye,tabs:We,timeline:at,timePicker:Oe,upload:Ae,notification:qe,tree:dt,colorPicker:Ze,datePicker:Qe,rangePicker:lt,flex:bt,wave:Ct,dropdown:Je,warning:Pe,tour:Me,tooltip:et,popover:vt,popconfirm:Pt,qrcode:Jt,floatButton:dn,floatButtonGroup:Et,variant:sn,inputNumber:ot,treeSelect:mt,watermark:Ht},xr={...b};Object.keys(Nn).forEach(An=>{Nn[An]!==void 0&&(xr[An]=Nn[An])}),$On.forEach(An=>{const pt=e[An];pt&&(xr[An]=pt)}),typeof r<"u"&&(xr.button={autoInsertSpace:r,...xr.button});const ur=u5(()=>xr,xr,(An,pt)=>{const nt=Object.keys(An),xt=Object.keys(pt);return nt.length!==xt.length||nt.some(Tt=>An[Tt]!==pt[Tt])}),{layer:Zt}=f.useContext(XL),Ot=f.useMemo(()=>({prefixCls:Vt,csp:nn,layer:Zt?"antd":void 0}),[Vt,nn,Zt]);let qt=f.createElement(f.Fragment,null,f.createElement(OOn,{iconPrefixCls:Vt,csp:nn}),f.createElement(ROn,{dropdownMatchSelectWidth:g}),t);const Kt=f.useMemo(()=>{var An,pt,nt,xt;return B2(((An=xy.Form)==null?void 0:An.defaultValidateMessages)||{},((nt=(pt=ur.locale)==null?void 0:pt.Form)==null?void 0:nt.defaultValidateMessages)||{},((xt=ur.form)==null?void 0:xt.validateMessages)||{},(l==null?void 0:l.validateMessages)||{})},[ur,l==null?void 0:l.validateMessages]);Object.keys(Kt).length>0&&(qt=f.createElement(Nat.Provider,{value:Kt},qt)),c&&(qt=f.createElement(kRn,{locale:c,_ANT_MARK__:TRn},qt)),qt=f.createElement(Pye.Provider,{value:Ot},qt),u&&(qt=f.createElement(AOn,{size:u},qt)),qt=f.createElement(MOn,null,qt),et!=null&&et.unique&&(qt=f.createElement(Lat,null,qt));const gn=f.useMemo(()=>{const{algorithm:An,token:pt,components:nt,cssVar:xt,...Tt}=zt||{},rn=An&&(!Array.isArray(An)||An.length>0)?hle(An):Xit,un={};Object.entries(nt||{}).forEach(([Kn,ar])=>{const tr={...ar};"algorithm"in tr&&(tr.algorithm===!0?tr.theme=rn:(Array.isArray(tr.algorithm)||typeof tr.algorithm=="function")&&(tr.theme=hle(tr.algorithm)),delete tr.algorithm),un[Kn]=tr});const xn={...l$,...pt};return{...Tt,theme:rn,token:xn,components:un,override:{override:xn,...un},cssVar:xt}},[zt]);return S&&(qt=f.createElement(Qit.Provider,{value:gn},qt)),ur.warning&&(qt=f.createElement(Kkn.Provider,{value:ur.warning},qt)),C!==void 0&&(qt=f.createElement(Oye,{disabled:C},qt)),f.createElement(Qr.Provider,{value:ur},qt)},Py=e=>{const t=f.useContext(Qr),n=f.useContext(Tye);return f.createElement(FOn,{parentContext:t,legacyLocale:n,...e})};Py.ConfigContext=Qr;Py.SizeContext=bI;Py.config=LOn;Py.useConfig=TOn;Object.defineProperty(Py,"SizeContext",{get:()=>bI});const Ir={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,CAPS_LOCK:20,ESC:27,SPACE:32,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,N:78,P:80,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,EQUALS:187,WIN_KEY:224};function IU(){return IU=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:n,style:r,className:o,duration:i=4.5,showProgress:s,pauseOnHover:l=!0,eventKey:c,content:u,closable:d,props:p,onClick:h,onNoticeClose:m,times:g,hovering:y}=e,[x,v]=f.useState(!1),[b,w]=f.useState(0),[S,C]=f.useState(0),N=y||x,j=typeof i=="number"?i:0,I=j>0&&s,_=()=>{m(c)},T=$=>{($.key==="Enter"||$.code==="Enter"||$.keyCode===Ir.ENTER)&&_()};f.useEffect(()=>{if(!N&&j>0){const $=Date.now()-S,D=setTimeout(()=>{_()},j*1e3-S);return()=>{l&&clearTimeout(D),C(Date.now()-$)}}},[j,N,g]),f.useEffect(()=>{if(!N&&I&&(l||S===0)){const $=performance.now();let D;const z=()=>{cancelAnimationFrame(D),D=requestAnimationFrame(V=>{const B=V+S-$,G=Math.min(B/(j*1e3),1);w(G*100),G<1&&z()})};return z(),()=>{l&&cancelAnimationFrame(D)}}},[j,S,N,I,g]);const P=f.useMemo(()=>typeof d=="object"&&d!==null?d:{},[d]),E=fl(P,!0),M=100-(!b||b<0?0:b>100?100:b),R=`${n}-notice`;return f.createElement("div",IU({},p,{ref:t,className:be(R,o,{[`${R}-closable`]:d}),style:r,onMouseEnter:$=>{var D;v(!0),(D=p==null?void 0:p.onMouseEnter)==null||D.call(p,$)},onMouseLeave:$=>{var D;v(!1),(D=p==null?void 0:p.onMouseLeave)==null||D.call(p,$)},onClick:h}),f.createElement("div",{className:`${R}-content`},u),d&&f.createElement("button",IU({className:`${R}-close`,onKeyDown:T,"aria-label":"Close"},E,{onClick:$=>{$.preventDefault(),$.stopPropagation(),_()}}),P.closeIcon??"x"),I&&f.createElement("progress",{className:`${R}-progress`,max:"100",value:M},M+"%"))}),Hat=Ie.createContext({}),Vat=({children:e,classNames:t})=>Ie.createElement(Hat.Provider,{value:{classNames:t}},e),uOe=8,dOe=3,fOe=16,zOn=e=>{const t={offset:uOe,threshold:dOe,gap:fOe};return e&&typeof e=="object"&&(t.offset=e.offset??uOe,t.threshold=e.threshold??dOe,t.gap=e.gap??fOe),[!!e,t]};function _U(){return _U=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{configList:t,placement:n,prefixCls:r,className:o,style:i,motion:s,onAllNoticeRemoved:l,onNoticeClose:c,stack:u}=e,{classNames:d}=f.useContext(Hat),p=f.useRef({}),[h,m]=f.useState(null),[g,y]=f.useState([]),x=t.map(j=>({config:j,key:String(j.key)})),[v,{offset:b,threshold:w,gap:S}]=zOn(u),C=v&&(g.length>0||x.length<=w),N=typeof s=="function"?s(n):s;return f.useEffect(()=>{v&&g.length>1&&y(j=>j.filter(I=>x.some(({key:_})=>I===_)))},[g,x,v]),f.useEffect(()=>{var j,I;v&&p.current[(j=x[x.length-1])==null?void 0:j.key]&&m(p.current[(I=x[x.length-1])==null?void 0:I.key])},[x,v]),Ie.createElement(hat,_U({key:n,className:be(r,`${r}-${n}`,d==null?void 0:d.list,o,{[`${r}-stack`]:!!v,[`${r}-stack-expanded`]:C}),style:i,keys:x,motionAppear:!0},N,{onAllRemoved:()=>{l(n)}}),({config:j,className:I,style:_,index:T},P)=>{var F,W,U,K;const{key:E,times:M}=j,R=String(E),{className:$,style:D,classNames:z,styles:V,...B}=j,G=x.findIndex(X=>X.key===R),H={};if(v){const X=x.length-1-(G>-1?G:T-1),J=n==="top"||n==="bottom"?"-50%":"0";if(X>0){H.height=C?(F=p.current[R])==null?void 0:F.offsetHeight:h==null?void 0:h.offsetHeight;let te=0;for(let ae=0;aey(X=>X.includes(R)?X:[...X,R]),onMouseLeave:()=>y(X=>X.filter(J=>J!==R))},Ie.createElement(Dye,_U({},B,{ref:X=>{G>-1?p.current[R]=X:delete p.current[R]},prefixCls:r,classNames:z,styles:V,className:be($,d==null?void 0:d.notice),style:D,times:M,key:E,eventKey:E,onNoticeClose:c,hovering:v&&g.length>0})))})},HOn=f.forwardRef((e,t)=>{const{prefixCls:n="rc-notification",container:r,motion:o,maxCount:i,className:s,style:l,onAllRemoved:c,stack:u,renderNotifications:d}=e,[p,h]=f.useState([]),m=w=>{var I;const S=p.find(_=>_.key===w),C=S==null?void 0:S.closable,N=C&&typeof C=="object"?C:{},{onClose:j}=N;j==null||j(),(I=S==null?void 0:S.onClose)==null||I.call(S),h(_=>_.filter(T=>T.key!==w))};f.useImperativeHandle(t,()=>({open:w=>{h(S=>{var I;let C=[...S];const N=C.findIndex(_=>_.key===w.key),j={...w};return N>=0?(j.times=(((I=S[N])==null?void 0:I.times)||0)+1,C[N]=j):(j.times=0,C.push(j)),i>0&&C.length>i&&(C=C.slice(-i)),C})},close:w=>{m(w)},destroy:()=>{h([])}}));const[g,y]=f.useState({});f.useEffect(()=>{const w={};p.forEach(S=>{const{placement:C="topRight"}=S;C&&(w[C]=w[C]||[],w[C].push(S))}),Object.keys(g).forEach(S=>{w[S]=w[S]||[]}),y(w)},[p]);const x=w=>{y(S=>{const C={...S};return(C[w]||[]).length||delete C[w],C})},v=f.useRef(!1);if(f.useEffect(()=>{Object.keys(g).length>0?v.current=!0:v.current&&(c==null||c(),v.current=!1)},[g]),!r)return null;const b=Object.keys(g);return pu.createPortal(f.createElement(f.Fragment,null,b.map(w=>{const S=g[w],C=f.createElement(BOn,{key:w,configList:S,placement:w,prefixCls:n,className:s==null?void 0:s(w),style:l==null?void 0:l(w),motion:o,onNoticeClose:m,onAllNoticeRemoved:x,stack:u});return d?d(C,{prefixCls:n,key:w}):C})),r)}),VOn=()=>document.body;let pOe=0;function UOn(...e){const t={};return e.forEach(n=>{n&&Object.keys(n).forEach(r=>{const o=n[r];o!==void 0&&(t[r]=o)})}),t}function Uat(e={}){const{getContainer:t=VOn,motion:n,prefixCls:r,maxCount:o,className:i,style:s,onAllRemoved:l,stack:c,renderNotifications:u,...d}=e,[p,h]=f.useState(),m=f.useRef(),g=f.createElement(HOn,{container:p,ref:m,prefixCls:r,motion:n,maxCount:o,className:i,style:s,onAllRemoved:l,stack:c,renderNotifications:u}),[y,x]=f.useState([]),v=Vr(w=>{const S=UOn(d,w);(S.key===null||S.key===void 0)&&(S.key=`rc-notification-${pOe}`,pOe+=1),x(C=>[...C,{type:"open",config:S}])}),b=f.useMemo(()=>({open:v,close:w=>{x(S=>[...S,{type:"close",key:w}])},destroy:()=>{x(w=>[...w,{type:"destroy"}])}}),[]);return f.useEffect(()=>{h(t())}),f.useEffect(()=>{if(m.current&&y.length){y.forEach(C=>{switch(C.type){case"open":m.current.open(C.config);break;case"close":m.current.close(C.key);break;case"destroy":m.current.destroy();break}});let w,S;x(C=>((w!==C||!S)&&(w=C,S=C.filter(N=>!y.includes(N))),S))}},[y]),[b,g]}var WOn={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};function Jle(){return Jle=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Jle({},e,{ref:t,icon:WOn})),MC=f.forwardRef(GOn),qOn=e=>{const{componentCls:t,iconCls:n,boxShadow:r,colorText:o,colorSuccess:i,colorError:s,colorWarning:l,colorInfo:c,fontSizeLG:u,motionEaseInOutCirc:d,motionDurationSlow:p,marginXS:h,paddingXS:m,borderRadiusLG:g,zIndexPopup:y,contentPadding:x,contentBg:v}=e,b=`${t}-notice`,w=new Go("MessageMoveIn",{"0%":{padding:0,transform:"translateY(-100%)",opacity:0},"100%":{padding:m,transform:"translateY(0)",opacity:1}}),S=new Go("MessageMoveOut",{"0%":{maxHeight:e.height,padding:m,opacity:1},"100%":{maxHeight:0,padding:0,opacity:0}}),C={padding:m,textAlign:"center",[`${t}-custom-content`]:{display:"flex",alignItems:"center"},[`${t}-custom-content > ${n}`]:{marginInlineEnd:h,fontSize:u},[`${b}-content`]:{display:"inline-block",padding:x,background:v,borderRadius:g,boxShadow:r,pointerEvents:"all"},[`${t}-success > ${n}`]:{color:i},[`${t}-error > ${n}`]:{color:s},[`${t}-warning > ${n}`]:{color:l},[`${t}-info > ${n}, ${t}-loading > ${n}`]:{color:c}};return[{[t]:{...Ii(e),color:o,position:"fixed",top:h,width:"100%",pointerEvents:"none",zIndex:y,[`${t}-move-up`]:{animationFillMode:"forwards"},[` ${t}-move-up-appear, ${t}-move-up-enter `]:{animationName:w,animationDuration:p,animationPlayState:"paused",animationTimingFunction:d},[` ${t}-move-up-appear${t}-move-up-appear-active, ${t}-move-up-enter${t}-move-up-enter-active `]:{animationPlayState:"running"},[`${t}-move-up-leave`]:{animationName:S,animationDuration:p,animationPlayState:"paused",animationTimingFunction:d},[`${t}-move-up-leave${t}-move-up-leave-active`]:{animationPlayState:"running"},"&-rtl":{direction:"rtl",span:{direction:"rtl"}}}},{[t]:{[`${b}-wrapper`]:{...C}}},{[`${t}-notice-pure-panel`]:{...C,padding:0,textAlign:"start"}}]},KOn=e=>({zIndexPopup:e.zIndexPopupBase+Mye+10,contentBg:e.colorBgElevated,contentPadding:`${(e.controlHeightLG-e.fontSize*e.lineHeight)/2}px ${e.paddingSM}px`}),Wat=ui("Message",e=>{const t=Ho(e,{height:150});return qOn(t)},KOn),YOn={info:f.createElement(AK,null),success:f.createElement($k,null),error:f.createElement(aN,null),warning:f.createElement(JL,null),loading:f.createElement(MC,null)},Gat=e=>{const{prefixCls:t,type:n,icon:r,children:o,classNames:i,styles:s}=e,l=r||n&&YOn[n],c=Fc(l,u=>{const d={...u==null?void 0:u.style,...s==null?void 0:s.icon};return{className:be(u.className,i==null?void 0:i.icon),style:d}});return f.createElement("div",{className:be(`${t}-custom-content`,`${t}-${n}`)},c,f.createElement("span",{className:i==null?void 0:i.content,style:s==null?void 0:s.content},o))},XOn=e=>{const{prefixCls:t,className:n,style:r,type:o,icon:i,content:s,classNames:l,styles:c,...u}=e,{getPrefixCls:d,className:p,style:h,classNames:m,styles:g}=Zo("message"),y=t||d("message"),x=pl(y),[v,b]=Wat(y,x),[w,S]=di([m,l],[g,c],{props:e});return f.createElement(Dye,{...u,prefixCls:y,className:be(p,w.root,n,v,`${y}-notice-pure-panel`,b,x),style:{...S.root,...h,...r},eventKey:"pure",duration:null,content:f.createElement(Gat,{prefixCls:y,type:o,icon:i,classNames:w,styles:S},s)})};function QOn(e,t){return{motionName:t??`${e}-move-up`}}function Lye(e){let t;const n=new Promise(o=>{t=e(()=>{o(!0)})}),r=()=>{t==null||t()};return r.then=(o,i)=>n.then(o,i),r.promise=n,r}const JOn=8,ZOn=3,e3n=({children:e,prefixCls:t})=>{const n=pl(t),[r,o]=Wat(t,n);return f.createElement(Vat,{classNames:{list:be(r,o,n)}},e)},t3n=(e,{prefixCls:t,key:n})=>f.createElement(e3n,{prefixCls:t,key:n},e),n3n=f.forwardRef((e,t)=>{const{top:n,prefixCls:r,getContainer:o,maxCount:i,duration:s=ZOn,rtl:l,transitionName:c,onAllRemoved:u,pauseOnHover:d=!0}=e,{getPrefixCls:p,direction:h,getPopupContainer:m}=Zo("message"),{message:g}=f.useContext(Qr),y=r||p("message"),x=()=>({left:"50%",transform:"translateX(-50%)",top:n??JOn}),v=()=>be({[`${y}-rtl`]:l??h==="rtl"}),b=()=>QOn(y,c),[w,S]=di([e==null?void 0:e.classNames,g==null?void 0:g.classNames],[e==null?void 0:e.styles,g==null?void 0:g.styles],{props:e}),[C,N]=Uat({prefixCls:y,style:x,className:v,motion:b,closable:!1,duration:s,getContainer:()=>(o==null?void 0:o())||(m==null?void 0:m())||document.body,maxCount:i,onAllRemoved:u,renderNotifications:t3n,pauseOnHover:d});return f.useImperativeHandle(t,()=>({...C,prefixCls:y,message:g,classNames:w,styles:S})),N});let hOe=0;function qat(e){const t=f.useRef(null);return Qw(),[f.useMemo(()=>{const r=c=>{var u;(u=t.current)==null||u.close(c)},o=c=>{if(!t.current){const H=()=>{};return H.then=()=>{},H}const{open:u,prefixCls:d,message:p,classNames:h,styles:m}=t.current,g=(p==null?void 0:p.className)||{},y=(p==null?void 0:p.style)||{},x=(p==null?void 0:p.classNames)||{},v=(p==null?void 0:p.styles)||{},b=`${d}-notice`,{content:w,icon:S,type:C,key:N,className:j,style:I,onClose:_,classNames:T={},styles:P={},...E}=c;let M=N;ll(M)||(hOe+=1,M=`antd-message-${hOe}`);const R={...e,...c},$=U2(x,{props:R}),D=U2(T,{props:R}),z=U2(v,{props:R}),V=U2(P,{props:R}),B=kK(void 0,$,D,h),G=kye(z,V,m);return Lye(H=>(u({...E,key:M,content:f.createElement(Gat,{prefixCls:d,type:C,icon:S,classNames:B,styles:G},w),placement:"top",className:be({[`${b}-${C}`]:C},j,g,B.root),style:{...G.root,...y,...I},onClose:()=>{_==null||_(),H()}}),()=>{r(M)}))},s={open:o,destroy:c=>{var u;c!==void 0?r(c):(u=t.current)==null||u.destroy()}};return["info","success","warning","error","loading"].forEach(c=>{const u=(d,p,h)=>{let m;d&&typeof d=="object"&&"content"in d?m=d:m={content:d};let g,y;typeof p=="function"?y=p:(g=p,y=h);const x={onClose:y,duration:g,...m,type:c};return o(x)};s[c]=u}),s},[]),f.createElement(n3n,{key:"message-holder",...e,ref:t})]}function r3n(e){return qat(e)}const PU="__rc_react_root__";function RK(e,t){const n=t[PU]||Vqe.createRoot(t);n.render(e),t[PU]=n}async function Kat(e){return Promise.resolve().then(()=>{var t;(t=e[PU])==null||t.unmount(),delete e[PU]})}const qee=()=>({height:0,opacity:0}),mOe=e=>{const{scrollHeight:t}=e;return{height:t,opacity:1}},o3n=e=>({height:e?e.offsetHeight:0}),Kee=(e,t)=>(t==null?void 0:t.deadline)===!0||t.propertyName==="height",AU=(e=r$)=>({motionName:`${e}-motion-collapse`,onAppearStart:qee,onEnterStart:qee,onAppearActive:mOe,onEnterActive:mOe,onLeaveStart:o3n,onLeaveActive:qee,onAppearEnd:Kee,onEnterEnd:Kee,onLeaveEnd:Kee,motionDeadline:500}),gb=(e,t,n)=>n!==void 0?n:`${e}-${t}`,i3n=e=>{const{componentCls:t,colorPrimary:n,antCls:r}=e,[,o]=bi(r,"wave");return{[t]:{position:"absolute",background:"transparent",pointerEvents:"none",boxSizing:"border-box",color:o("color",n),boxShadow:"0 0 0 0 currentcolor",opacity:.2,"&.wave-motion-appear":{transition:[`box-shadow 0.4s ${e.motionEaseOutCirc}`,`opacity 2s ${e.motionEaseOutCirc}`].join(","),"&-active":{boxShadow:"0 0 0 6px currentcolor",opacity:0},"&.wave-quick":{transition:[`box-shadow ${e.motionDurationSlow} ${e.motionEaseInOut}`,`opacity ${e.motionDurationSlow} ${e.motionEaseInOut}`].join(",")}}}}},a3n=DMn("Wave",i3n),r6=`${r$}-wave-target`;function gOe(e){return e&&typeof e=="string"&&e!=="#fff"&&e!=="#ffffff"&&e!=="rgb(255, 255, 255)"&&e!=="rgba(255, 255, 255, 1)"&&!/rgba\((?:\d*, ){3}0\)/.test(e)&&e!=="transparent"&&e!=="canvastext"}function s3n(e,t=null){const n=getComputedStyle(e),{borderTopColor:r,borderColor:o,backgroundColor:i}=n;return t&&gOe(n[t])?n[t]:[r,o,i].find(gOe)??null}function Yee(e){return Number.isNaN(e)?0:e}const l3n=e=>{const{className:t,target:n,component:r,colorSource:o}=e,i=f.useRef(null),{getPrefixCls:s}=f.useContext(Qr),l=s(),[c]=bi(l,"wave"),[u,d]=f.useState(null),[p,h]=f.useState([]),[m,g]=f.useState(0),[y,x]=f.useState(0),[v,b]=f.useState(0),[w,S]=f.useState(0),[C,N]=f.useState(!1),j={left:m,top:y,width:v,height:w,borderRadius:p.map(T=>`${T}px`).join(" ")};u&&(j[c("color")]=u);function I(){const T=getComputedStyle(n);d(s3n(n,o));const P=T.position==="static",{borderLeftWidth:E,borderTopWidth:M}=T;g(P?n.offsetLeft:Yee(-Number.parseFloat(E))),x(P?n.offsetTop:Yee(-Number.parseFloat(M))),b(n.offsetWidth),S(n.offsetHeight);const{borderTopLeftRadius:R,borderTopRightRadius:$,borderBottomLeftRadius:D,borderBottomRightRadius:z}=T;h([R,$,z,D].map(V=>Yee(Number.parseFloat(V))))}if(f.useEffect(()=>{if(n){const T=Bo(()=>{I(),N(!0)});let P;return typeof ResizeObserver<"u"&&(P=new ResizeObserver(I),P.observe(n)),()=>{Bo.cancel(T),P==null||P.disconnect()}}},[n]),!C)return null;const _=(r==="Checkbox"||r==="Radio")&&(n==null?void 0:n.classList.contains(r6));return f.createElement(Kf,{visible:!0,motionAppear:!0,motionName:"wave-motion",motionDeadline:5e3,onAppearEnd:(T,P)=>{var E;if(P.deadline||P.propertyName==="opacity"){const M=(E=i.current)==null?void 0:E.parentElement;Kat(M).then(()=>{M==null||M.remove()})}return!1}},({className:T},P)=>f.createElement("div",{ref:zd(i,P),className:be(t,T,{"wave-quick":_}),style:j}))},c3n=(e,t)=>{var o;const{component:n}=t;if(n==="Checkbox"&&!((o=e.querySelector("input"))!=null&&o.checked))return;const r=document.createElement("div");r.style.position="absolute",r.style.left="0px",r.style.top="0px",e==null||e.insertBefore(r,e==null?void 0:e.firstChild),RK(f.createElement(l3n,{...t,target:e}),r)},u3n=(e,t,n,r)=>{const{wave:o}=f.useContext(Qr),[,i,s]=Xf(),l=Vr(d=>{const p=e.current;if(o!=null&&o.disabled||!p)return;const h=p.querySelector(`.${r6}`)||p,{showEffect:m}=o||{};(m||c3n)(h,{className:t,token:i,component:n,event:d,hashId:s,colorSource:r})}),c=f.useRef(null);return f.useEffect(()=>()=>{Bo.cancel(c.current)},[]),d=>{Bo.cancel(c.current),c.current=Bo(()=>{l(d)})}},o6=e=>{const{children:t,disabled:n,component:r,colorSource:o}=e,{getPrefixCls:i}=f.useContext(Qr),s=f.useRef(null),l=i("wave"),c=a3n(l),u=u3n(s,be(l,c),r,o);if(Ie.useEffect(()=>{const p=s.current;if(!p||p.nodeType!==window.Node.ELEMENT_NODE||n)return;const h=m=>{!Dk(m.target)||!p.getAttribute||p.getAttribute("disabled")||p.disabled||p.className.includes("disabled")&&!p.className.includes("disabled:")||p.getAttribute("aria-disabled")==="true"||p.className.includes("-leave")||u(m)};return p.addEventListener("click",h,!0),()=>{p.removeEventListener("click",h,!0)}},[n]),!Ie.isValidElement(t))return t??null;const d=pb(t)?zd(Xw(t),s):s;return Fc(t,{ref:d})},ad=e=>{const t=Ie.useContext(bI);return Ie.useMemo(()=>e?typeof e=="string"?e??t:typeof e=="function"?e(t):t:t,[e,t])},d3n=e=>{const{componentCls:t}=e;return{[t]:{display:"inline-flex","&-block":{display:"flex",width:"100%"},"&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"}}}},f3n=ui(["Space","Compact"],e=>[d3n(e)],()=>({}),{resetStyle:!1}),OK=f.createContext(null),Zw=(e,t)=>{const n=f.useContext(OK),r=f.useMemo(()=>{if(!n)return"";const{compactDirection:o,isFirstItem:i,isLastItem:s}=n,l=o==="vertical"?"-vertical-":"-";return be(`${e}-compact${l}item`,{[`${e}-compact${l}first-item`]:i,[`${e}-compact${l}last-item`]:s,[`${e}-compact${l}item-rtl`]:t==="rtl"})},[e,t,n]);return{compactSize:n==null?void 0:n.compactSize,compactDirection:n==null?void 0:n.compactDirection,compactItemClassnames:r}},p3n=e=>{const{children:t}=e;return f.createElement(OK.Provider,{value:null},t)},h3n=e=>{const{children:t,...n}=e;return f.createElement(OK.Provider,{value:f.useMemo(()=>n,[n])},t)},Yat=e=>{const{getPrefixCls:t,direction:n}=f.useContext(Qr),{size:r,direction:o,orientation:i,block:s,prefixCls:l,className:c,rootClassName:u,children:d,vertical:p,...h}=e,[m,g]=MK(i,p,o),y=ad(N=>r??N),x=t("space-compact",l),[v]=f3n(x),b=be(x,v,{[`${x}-rtl`]:n==="rtl",[`${x}-block`]:s,[`${x}-vertical`]:g},c,u),w=f.useContext(OK),S=Bu(d),C=f.useMemo(()=>S.map((N,j)=>{const I=(N==null?void 0:N.key)||`${x}-item-${j}`;return f.createElement(h3n,{key:I,compactSize:y,compactDirection:m,isFirstItem:j===0&&(!w||(w==null?void 0:w.isFirstItem)),isLastItem:j===S.length-1&&(!w||(w==null?void 0:w.isLastItem))},N)}),[S,w,m,y,x]);return S.length===0?null:f.createElement("div",{className:b,...h},C)},Xat=f.createContext(void 0),m3n=e=>{const{getPrefixCls:t,direction:n}=f.useContext(Qr),{prefixCls:r,size:o,className:i,...s}=e,l=t("btn-group",r),[,,c]=Xf(),u=f.useMemo(()=>{switch(o){case"large":return"lg";case"small":return"sm";default:return""}},[o]),d=be(l,{[`${l}-${u}`]:u,[`${l}-rtl`]:n==="rtl"},i,c);return f.createElement(Xat.Provider,{value:o},f.createElement("div",{...s,className:d}))},xOe=/^[\u4E00-\u9FA5]{2}$/,Zle=xOe.test.bind(xOe);function Qat(e){return e==="danger"?{danger:!0}:{type:e}}function yOe(e){return typeof e=="string"}function Xee(e){return e==="text"||e==="link"}function g3n(e,t,n,r){if(!ll(e)||e==="")return;const o=t?" ":"";return typeof e!="string"&&typeof e!="number"&&yOe(e.type)&&Zle(e.props.children)?Fc(e,i=>{const s=be(i.className,r)||void 0,l={...n,...i.style};return{...i,children:i.children.split("").join(o),className:s,style:l}}):yOe(e)?Ie.createElement("span",{className:r,style:n},Zle(e)?e.split("").join(o):e):$at(e)?Ie.createElement("span",{className:r,style:n},e):Fc(e,i=>({...i,className:be(i.className,r)||void 0,style:{...i.style,...n}}))}function x3n(e,t,n,r){let o=!1;const i=[];return Ie.Children.forEach(e,s=>{const l=typeof s,c=l==="string"||l==="number";if(o&&c){const u=i.length-1,d=i[u];i[u]=`${d}${s}`}else i.push(s);o=c}),Ie.Children.map(i,s=>g3n(s,t,n,r))}["default","primary","danger"].concat(go(TC));const Jat=f.forwardRef((e,t)=>{const{className:n,style:r,children:o,prefixCls:i}=e,s=be(`${i}-icon`,n);return Ie.createElement("span",{ref:t,className:s,style:r},o)}),vOe=f.forwardRef((e,t)=>{const{prefixCls:n,className:r,style:o,iconClassName:i}=e,s=be(`${n}-loading-icon`,r);return Ie.createElement(Jat,{prefixCls:n,className:s,style:o,ref:t},Ie.createElement(MC,{className:i}))}),Qee=()=>({width:0,opacity:0,transform:"scale(0)"}),Jee=e=>({width:e.scrollWidth,opacity:1,transform:"scale(1)"}),y3n=e=>{const{prefixCls:t,loading:n,existIcon:r,className:o,style:i,mount:s}=e,l=!!n;return r?Ie.createElement(vOe,{prefixCls:t,className:o,style:i}):Ie.createElement(Kf,{visible:l,motionName:`${t}-loading-icon-motion`,motionAppear:!s,motionEnter:!s,motionLeave:!s,removeOnLeave:!0,onAppearStart:Qee,onAppearActive:Jee,onEnterStart:Qee,onEnterActive:Jee,onLeaveStart:Jee,onLeaveActive:Qee},({className:c,style:u},d)=>{const p={...i,...u};return Ie.createElement(vOe,{prefixCls:t,className:be(o,c),style:p,ref:d})})},bOe=(e,t)=>({[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}}),v3n=e=>{const{componentCls:t,fontSize:n,lineWidth:r,groupBorderColor:o,colorErrorHover:i}=e;return{[`${t}-group`]:[{position:"relative",display:"inline-flex",[`> span, > ${t}`]:{"&:not(:last-child)":{[`&, & > ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:e.calc(r).mul(-1).equal(),[`&, & > ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[t]:{position:"relative",zIndex:1,"&:hover, &:focus, &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${t}-icon-only`]:{fontSize:n}},bOe(`${t}-primary`,o),bOe(`${t}-danger`,i)]}},Zee=e=>Math.round(Number(e||0)),b3n=e=>{if(e instanceof Hi)return e;if(e&&typeof e=="object"&&"h"in e&&"b"in e){const{b:t,...n}=e;return{...n,v:t}}return typeof e=="string"&&/hsb/.test(e)?e.replace(/hsb/,"hsv"):e};class f$ extends Hi{constructor(t){super(b3n(t))}toHsbString(){const t=this.toHsb(),n=Zee(t.s*100),r=Zee(t.b*100),o=Zee(t.h),i=t.a,s=`hsb(${o}, ${n}%, ${r}%)`,l=`hsba(${o}, ${n}%, ${r}%, ${i.toFixed(i===0?0:2)})`;return i===1?s:l}toHsb(){const{v:t,...n}=this.toHsv();return{...n,b:t,a:this.a}}}const w3n=e=>e instanceof f$?e:new f$(e);w3n("#1677ff");const S3n=(e,t)=>(e==null?void 0:e.replace(/[^\w/]/g,"").slice(0,t?8:6))||"",C3n=(e,t)=>e?S3n(e,t):"";let TU=(function(){function e(t){var r;if(oN(this,e),this.cleared=!1,t instanceof e){this.metaColor=t.metaColor.clone(),this.colors=(r=t.colors)==null?void 0:r.map(o=>({color:new e(o.color),percent:o.percent})),this.cleared=t.cleared;return}const n=Array.isArray(t);n&&t.length?(this.colors=t.map(({color:o,percent:i})=>({color:new e(o),percent:i})),this.metaColor=new f$(this.colors[0].color.metaColor)):this.metaColor=new f$(n?"":t),(!t||n&&!this.colors)&&(this.metaColor=this.metaColor.setA(0),this.cleared=!0)}return iN(e,[{key:"toHsb",value:function(){return this.metaColor.toHsb()}},{key:"toHsbString",value:function(){return this.metaColor.toHsbString()}},{key:"toHex",value:function(){return C3n(this.toHexString(),this.metaColor.a<1)}},{key:"toHexString",value:function(){return this.metaColor.toHexString()}},{key:"toRgb",value:function(){return this.metaColor.toRgb()}},{key:"toRgbString",value:function(){return this.metaColor.toRgbString()}},{key:"isGradient",value:function(){return!!this.colors&&!this.cleared}},{key:"getColors",value:function(){return this.colors||[{color:this,percent:0}]}},{key:"toCssString",value:function(){const{colors:n}=this;return n?`linear-gradient(90deg, ${n.map(o=>`${o.color.toRgbString()} ${o.percent}%`).join(", ")})`:this.metaColor.toRgbString()}},{key:"equals",value:function(n){return!n||this.isGradient()!==n.isGradient()?!1:this.isGradient()?this.colors.length===n.colors.length&&this.colors.every((r,o)=>{const i=n.colors[o];return r.percent===i.percent&&r.color.equals(i.color)}):this.toHexString()===n.toHexString()}}])})();var N3n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"};function ece(){return ece=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,ece({},e,{ref:t,icon:N3n})),tce=f.forwardRef(j3n),Fye=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut}, opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${e.motionDurationMid} ${e.motionEaseInOut}, opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}}),E3n=e=>({animationDuration:e,animationFillMode:"both"}),I3n=e=>({animationDuration:e,animationFillMode:"both"}),$K=(e,t,n,r,o=!1)=>{const i=o?"&":"";return{[` ${i}${e}-enter, ${i}${e}-appear `]:{...E3n(r),animationPlayState:"paused"},[`${i}${e}-leave`]:{...I3n(r),animationPlayState:"paused"},[` ${i}${e}-enter${e}-enter-active, ${i}${e}-appear${e}-appear-active `]:{animationName:t,animationPlayState:"running"},[`${i}${e}-leave${e}-leave-active`]:{animationName:n,animationPlayState:"running",pointerEvents:"none"}}},_3n=new Go("antFadeIn",{"0%":{opacity:0},"100%":{opacity:1}}),P3n=new Go("antFadeOut",{"0%":{opacity:1},"100%":{opacity:0}}),Zat=(e,t=!1)=>{const{antCls:n}=e,r=`${n}-fade`,o=t?"&":"";return[$K(r,_3n,P3n,e.motionDurationMid,t),{[` ${o}${r}-enter, ${o}${r}-appear `]:{opacity:0,animationTimingFunction:"linear"},[`${o}${r}-leave`]:{animationTimingFunction:"linear"}}]},A3n=new Go("antMoveDownIn",{"0%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),T3n=new Go("antMoveDownOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, 100%, 0)",transformOrigin:"0 0",opacity:0}}),k3n=new Go("antMoveLeftIn",{"0%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),M3n=new Go("antMoveLeftOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(-100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),R3n=new Go("antMoveRightIn",{"0%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),O3n=new Go("antMoveRightOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(100%, 0, 0)",transformOrigin:"0 0",opacity:0}}),$3n=new Go("antMoveUpIn",{"0%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1}}),D3n=new Go("antMoveUpOut",{"0%":{transform:"translate3d(0, 0, 0)",transformOrigin:"0 0",opacity:1},"100%":{transform:"translate3d(0, -100%, 0)",transformOrigin:"0 0",opacity:0}}),L3n={"move-up":{inKeyframes:$3n,outKeyframes:D3n},"move-down":{inKeyframes:A3n,outKeyframes:T3n},"move-left":{inKeyframes:k3n,outKeyframes:M3n},"move-right":{inKeyframes:R3n,outKeyframes:O3n}},PT=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:o,outKeyframes:i}=L3n[t];return[$K(r,o,i,e.motionDurationMid),{[` ${r}-enter, ${r}-appear `]:{opacity:0,animationTimingFunction:e.motionEaseOutCirc},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},DK=new Go("antSlideUpIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1}}),LK=new Go("antSlideUpOut",{"0%":{transform:"scaleY(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"0% 0%",opacity:0}}),FK=new Go("antSlideDownIn",{"0%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0},"100%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1}}),zK=new Go("antSlideDownOut",{"0%":{transform:"scaleY(1)",transformOrigin:"100% 100%",opacity:1},"100%":{transform:"scaleY(0.8)",transformOrigin:"100% 100%",opacity:0}}),F3n=new Go("antSlideLeftIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1}}),z3n=new Go("antSlideLeftOut",{"0%":{transform:"scaleX(1)",transformOrigin:"0% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"0% 0%",opacity:0}}),B3n=new Go("antSlideRightIn",{"0%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0},"100%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1}}),H3n=new Go("antSlideRightOut",{"0%":{transform:"scaleX(1)",transformOrigin:"100% 0%",opacity:1},"100%":{transform:"scaleX(0.8)",transformOrigin:"100% 0%",opacity:0}}),V3n={"slide-up":{inKeyframes:DK,outKeyframes:LK},"slide-down":{inKeyframes:FK,outKeyframes:zK},"slide-left":{inKeyframes:F3n,outKeyframes:z3n},"slide-right":{inKeyframes:B3n,outKeyframes:H3n}},xb=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:o,outKeyframes:i}=V3n[t];return[$K(r,o,i,e.motionDurationMid),{[` ${r}-enter, ${r}-appear `]:{transform:"scale(0)",transformOrigin:"0% 0%",opacity:0,animationTimingFunction:e.motionEaseOutQuint,"&-prepare":{transform:"scale(1)"}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInQuint}}]},zye=new Go("antZoomIn",{"0%":{transform:"scale(0.2)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),U3n=new Go("antZoomOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.2)",opacity:0}}),wOe=new Go("antZoomBigIn",{"0%":{transform:"scale(0.8)",opacity:0},"100%":{transform:"scale(1)",opacity:1}}),SOe=new Go("antZoomBigOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0.8)",opacity:0}}),W3n=new Go("antZoomUpIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 0%"}}),G3n=new Go("antZoomUpOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 0%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 0%",opacity:0}}),q3n=new Go("antZoomLeftIn",{"0%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"0% 50%"}}),K3n=new Go("antZoomLeftOut",{"0%":{transform:"scale(1)",transformOrigin:"0% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"0% 50%",opacity:0}}),Y3n=new Go("antZoomRightIn",{"0%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"100% 50%"}}),X3n=new Go("antZoomRightOut",{"0%":{transform:"scale(1)",transformOrigin:"100% 50%"},"100%":{transform:"scale(0.8)",transformOrigin:"100% 50%",opacity:0}}),Q3n=new Go("antZoomDownIn",{"0%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0},"100%":{transform:"scale(1)",transformOrigin:"50% 100%"}}),J3n=new Go("antZoomDownOut",{"0%":{transform:"scale(1)",transformOrigin:"50% 100%"},"100%":{transform:"scale(0.8)",transformOrigin:"50% 100%",opacity:0}}),Z3n={zoom:{inKeyframes:zye,outKeyframes:U3n},"zoom-big":{inKeyframes:wOe,outKeyframes:SOe},"zoom-big-fast":{inKeyframes:wOe,outKeyframes:SOe},"zoom-left":{inKeyframes:q3n,outKeyframes:K3n},"zoom-right":{inKeyframes:Y3n,outKeyframes:X3n},"zoom-up":{inKeyframes:W3n,outKeyframes:G3n},"zoom-down":{inKeyframes:Q3n,outKeyframes:J3n}},i6=(e,t)=>{const{antCls:n}=e,r=`${n}-${t}`,{inKeyframes:o,outKeyframes:i}=Z3n[t];return[$K(r,o,i,t==="zoom-big-fast"?e.motionDurationFast:e.motionDurationMid),{[` ${r}-enter, ${r}-appear `]:{transform:"scale(0)",opacity:0,animationTimingFunction:e.motionEaseOutCirc,"&-prepare":{transform:"none"}},[`${r}-leave`]:{animationTimingFunction:e.motionEaseInOutCirc}}]},e$n=e=>e instanceof TU?e:new TU(e),est=(e,t)=>{const{r:n,g:r,b:o,a:i}=e.toRgb(),s=new f$(e.toRgbString()).onBackground(t).toHsv();return i<=.5?s.v>.5:n*.299+r*.587+o*.114>192},tst=e=>{const{paddingInline:t,onlyIconSize:n,borderColorDisabled:r}=e;return Ho(e,{buttonPaddingHorizontal:t,buttonPaddingVertical:0,buttonIconOnlyFontSize:n,colorBorderDisabled:r})},nst=e=>{const t=e.contentFontSize??e.fontSize,n=e.contentFontSizeSM??e.fontSize,r=e.contentFontSizeLG??e.fontSizeLG,o=e.contentLineHeight??fB(t),i=e.contentLineHeightSM??fB(n),s=e.contentLineHeightLG??fB(r),l=est(new TU(e.colorBgSolid),"#fff")?"#000":"#fff",c=TC.reduce((p,h)=>({...p,[`${h}ShadowColor`]:`0 ${Xe(e.controlOutlineWidth)} 0 ${AR(e[`${h}1`],e.colorBgContainer)}`}),{}),u=e.colorBgContainerDisabled,d=e.colorBgContainerDisabled;return{...c,fontWeight:400,iconGap:e.marginXS,defaultShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`,primaryShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`,dangerShadow:`0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`,primaryColor:e.colorTextLightSolid,dangerColor:e.colorTextLightSolid,borderColorDisabled:e.colorBorderDisabled,defaultGhostColor:e.colorBgContainer,ghostBg:"transparent",defaultGhostBorderColor:e.colorBgContainer,paddingInline:e.paddingContentHorizontal-e.lineWidth,paddingInlineLG:e.paddingContentHorizontal-e.lineWidth,paddingInlineSM:8-e.lineWidth,onlyIconSize:"inherit",onlyIconSizeSM:"inherit",onlyIconSizeLG:"inherit",groupBorderColor:e.colorPrimaryHover,linkHoverBg:"transparent",textTextColor:e.colorText,textTextHoverColor:e.colorText,textTextActiveColor:e.colorText,textHoverBg:e.colorFillTertiary,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,defaultHoverBg:e.colorBgContainer,defaultHoverColor:e.colorPrimaryHover,defaultHoverBorderColor:e.colorPrimaryHover,defaultActiveBg:e.colorBgContainer,defaultActiveColor:e.colorPrimaryActive,defaultActiveBorderColor:e.colorPrimaryActive,solidTextColor:l,contentFontSize:t,contentFontSizeSM:n,contentFontSizeLG:r,contentLineHeight:o,contentLineHeightSM:i,contentLineHeightLG:s,paddingBlock:Math.max((e.controlHeight-t*o)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-n*i)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-r*s)/2-e.lineWidth,0),defaultBgDisabled:u,dashedBgDisabled:d}},t$n=e=>{const{componentCls:t,antCls:n}=e,[r,o]=bi(n,"btn");return{[t]:[{[r("border-width")]:"1px",[r("border-color")]:"#000",[r("border-color-hover")]:o("border-color"),[r("border-color-active")]:o("border-color"),[r("border-color-disabled")]:o("border-color"),[r("border-style")]:"solid",[r("text-color")]:"#000",[r("text-color-hover")]:o("text-color"),[r("text-color-active")]:o("text-color"),[r("text-color-disabled")]:o("text-color"),[r("bg-color")]:"#ddd",[r("bg-color-hover")]:o("bg-color"),[r("bg-color-active")]:o("bg-color"),[r("bg-color-disabled")]:e.colorBgContainerDisabled,[r("bg-color-container")]:e.colorBgContainer,[r("shadow")]:"none"},{border:[o("border-width"),o("border-style"),o("border-color")].join(" "),color:o("text-color"),backgroundColor:o("bg-color"),[`&:not(:disabled):not(${t}-disabled)`]:{"&:hover":{border:[o("border-width"),o("border-style"),o("border-color-hover")].join(" "),color:o("text-color-hover"),backgroundColor:o("bg-color-hover")},"&:active":{border:[o("border-width"),o("border-style"),o("border-color-active")].join(" "),color:o("text-color-active"),backgroundColor:o("bg-color-active")}}},{[`&${t}-variant-solid`]:{[r("solid-bg-color")]:o("color-base"),[r("solid-bg-color-hover")]:o("color-hover"),[r("solid-bg-color-active")]:o("color-active"),[r("border-color")]:"transparent",[r("text-color")]:e.colorTextLightSolid,[r("bg-color")]:o("solid-bg-color"),[r("bg-color-hover")]:o("solid-bg-color-hover"),[r("bg-color-active")]:o("solid-bg-color-active"),boxShadow:o("shadow")},[`&${t}-variant-outlined, &${t}-variant-dashed`]:{[r("border-color")]:o("color-base"),[r("border-color-hover")]:o("color-hover"),[r("border-color-active")]:o("color-active"),[r("bg-color")]:o("bg-color-container"),[r("text-color")]:o("color-base"),[r("text-color-hover")]:o("color-hover"),[r("text-color-active")]:o("color-active"),boxShadow:o("shadow")},[`&${t}-variant-dashed`]:{[r("border-style")]:"dashed",[r("bg-color-disabled")]:e.dashedBgDisabled},[`&${t}-variant-filled`]:{[r("border-color")]:"transparent",[r("text-color")]:o("color-base"),[r("bg-color")]:o("color-light"),[r("bg-color-hover")]:o("color-light-hover"),[r("bg-color-active")]:o("color-light-active")},[`&${t}-variant-text, &${t}-variant-link`]:{[r("border-color")]:"transparent",[r("text-color")]:o("color-base"),[r("text-color-hover")]:o("color-hover"),[r("text-color-active")]:o("color-active"),[r("bg-color")]:"transparent",[r("bg-color-hover")]:"transparent",[r("bg-color-active")]:"transparent",[`&:disabled, &${e.componentCls}-disabled`]:{background:"transparent",borderColor:"transparent"}},[`&${t}-variant-text`]:{[r("bg-color-hover")]:o("color-light"),[r("bg-color-active")]:o("color-light-active")}},{[`&${t}-variant-link`]:{[r("color-base")]:e.colorLink,[r("color-hover")]:e.colorLinkHover,[r("color-active")]:e.colorLinkActive},[`&${t}-color-primary`]:{[r("color-base")]:e.colorPrimary,[r("color-hover")]:e.colorPrimaryHover,[r("color-active")]:e.colorPrimaryActive,[r("color-light")]:e.colorPrimaryBg,[r("color-light-hover")]:e.colorPrimaryBgHover,[r("color-light-active")]:e.colorPrimaryBorder,[r("shadow")]:e.primaryShadow,[`&${t}-variant-solid`]:{[r("text-color")]:e.primaryColor,[r("text-color-hover")]:o("text-color"),[r("text-color-active")]:o("text-color")}},[`&${t}-color-dangerous`]:{[r("color-base")]:e.colorError,[r("color-hover")]:e.colorErrorHover,[r("color-active")]:e.colorErrorActive,[r("color-light")]:e.colorErrorBg,[r("color-light-hover")]:e.colorErrorBgFilledHover,[r("color-light-active")]:e.colorErrorBgActive,[r("shadow")]:e.dangerShadow,[`&${t}-variant-solid`]:{[r("text-color")]:e.dangerColor,[r("text-color-hover")]:o("text-color"),[r("text-color-active")]:o("text-color")}},[`&${t}-color-default`]:{[r("solid-bg-color")]:e.colorBgSolid,[r("solid-bg-color-hover")]:e.colorBgSolidHover,[r("solid-bg-color-active")]:e.colorBgSolidActive,[r("color-base")]:e.defaultBorderColor,[r("color-hover")]:e.defaultHoverBorderColor,[r("color-active")]:e.defaultActiveBorderColor,[r("color-light")]:e.colorFillTertiary,[r("color-light-hover")]:e.colorFillSecondary,[r("color-light-active")]:e.colorFill,[r("text-color")]:e.colorText,[r("text-color-hover")]:e.defaultHoverBorderColor,[r("text-color-active")]:e.defaultActiveBorderColor,[r("shadow")]:e.defaultShadow,[`&${t}-variant-solid`]:{[r("text-color")]:e.solidTextColor,[r("text-color-hover")]:o("text-color"),[r("text-color-active")]:o("text-color")},[`&${t}-variant-filled, &${t}-variant-text`]:{[r("text-color-hover")]:o("text-color"),[r("text-color-active")]:o("text-color")},[`&${t}-variant-outlined, &${t}-variant-dashed`]:{[r("bg-color-hover")]:e.defaultHoverBg,[r("bg-color-active")]:e.defaultActiveBg},[`&${t}-background-ghost`]:{[`&${t}-variant-outlined, &${t}-variant-dashed`]:{[r("text-color")]:e.defaultGhostColor,[r("border-color")]:e.defaultGhostBorderColor}}}},TC.map(i=>{const s=e[`${i}6`],l=e[`${i}1`],c=e[`${i}5`],u=e[`${i}2`],d=e[`${i}3`],p=e[`${i}7`],h=e[`${i}ShadowColor`];return{[`&${t}-color-${i}`]:{[r("color-base")]:s,[r("color-hover")]:c,[r("color-active")]:p,[r("color-light")]:l,[r("color-light-hover")]:u,[r("color-light-active")]:d,[r("shadow")]:h}}}),{[`&:disabled, &${e.componentCls}-disabled`]:{cursor:"not-allowed",borderColor:e.colorBorderDisabled,background:o("bg-color-disabled"),color:e.colorTextDisabled,boxShadow:"none"}},{[`&${t}-background-ghost`]:{[r("bg-color")]:"transparent",[r("shadow")]:"none"}}]}},n$n=e=>{const{componentCls:t,iconCls:n,fontWeight:r,opacityLoading:o,motionDurationSlow:i,motionEaseInOut:s,iconGap:l,calc:c}=e;return{[t]:{outline:"none",position:"relative",display:"inline-flex",gap:l,alignItems:"center",justifyContent:"center",fontWeight:r,whiteSpace:"nowrap",textAlign:"center",backgroundImage:"none",cursor:"pointer",transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,userSelect:"none",touchAction:"manipulation","&:disabled > *":{pointerEvents:"none"},[`${t}-icon > svg`]:QL(),"> a":{color:"currentColor"},"&:not(:disabled)":gy(e),[`&${t}-two-chinese-chars::first-letter`]:{letterSpacing:"0.34em"},[`&${t}-two-chinese-chars > *:not(${n})`]:{marginInlineEnd:"-0.34em",letterSpacing:"0.34em"},[`&${t}-icon-only`]:{paddingInline:0,[`&${t}-compact-item`]:{flex:"none"}},[`&${t}-loading`]:{opacity:o,cursor:"default"},[`${t}-loading-icon`]:{transition:["width","opacity","margin"].map(u=>`${u} ${i} ${s}`).join(",")},[`&:not(${t}-icon-end)`]:{[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineEnd:c(l).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineEnd:0},"&-leave-start":{marginInlineEnd:0},"&-leave-active":{marginInlineEnd:c(l).mul(-1).equal()}}},"&-icon-end":{flexDirection:"row-reverse",[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start":{marginInlineStart:c(l).mul(-1).equal()},"&-appear-active, &-enter-active":{marginInlineStart:0},"&-leave-start":{marginInlineStart:0},"&-leave-active":{marginInlineStart:c(l).mul(-1).equal()}}}}}},r$n=e=>({minWidth:e.controlHeight,paddingInline:0,borderRadius:"50%"}),Bye=(e,t="")=>{const{componentCls:n,controlHeight:r,fontSize:o,borderRadius:i,buttonPaddingHorizontal:s,iconCls:l,buttonPaddingVertical:c,buttonIconOnlyFontSize:u}=e;return[{[t]:{fontSize:o,height:r,padding:`${Xe(c)} ${Xe(s)}`,borderRadius:i,[`&${n}-icon-only`]:{width:r,[l]:{fontSize:u}}}},{[`${n}${n}-circle${t}`]:r$n(e)},{[`${n}${n}-round${t}`]:{borderRadius:e.controlHeight,[`&:not(${n}-icon-only)`]:{paddingInline:e.buttonPaddingHorizontal}}}]},o$n=e=>{const t=Ho(e,{fontSize:e.contentFontSize});return Bye(t,e.componentCls)},i$n=e=>{const t=Ho(e,{controlHeight:e.controlHeightSM,fontSize:e.contentFontSizeSM,padding:e.paddingXS,buttonPaddingHorizontal:e.paddingInlineSM,buttonPaddingVertical:0,borderRadius:e.borderRadiusSM,buttonIconOnlyFontSize:e.onlyIconSizeSM});return Bye(t,`${e.componentCls}-sm`)},a$n=e=>{const t=Ho(e,{controlHeight:e.controlHeightLG,fontSize:e.contentFontSizeLG,buttonPaddingHorizontal:e.paddingInlineLG,buttonPaddingVertical:0,borderRadius:e.borderRadiusLG,buttonIconOnlyFontSize:e.onlyIconSizeLG});return Bye(t,`${e.componentCls}-lg`)},s$n=e=>{const{componentCls:t}=e;return{[t]:{[`&${t}-block`]:{width:"100%"}}}},l$n=ui("Button",e=>{const t=tst(e);return[n$n(t),o$n(t),i$n(t),a$n(t),s$n(t),t$n(t),v3n(t)]},nst,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function c$n(e,t,n,r){const{focusElCls:o,focus:i,borderElCls:s}=n,l=s?"> *":"",c=["hover",i?"focus":null,"active"].filter(Boolean).map(u=>`&:${u} ${l}`).join(",");return{[`&-item:not(${t}-last-item)`]:{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal()},[`&-item:not(${r}-status-success)`]:{zIndex:2},"&-item":{[c]:{zIndex:3},...o?{[`&${o}`]:{zIndex:3}}:{},[`&[disabled] ${l}`]:{zIndex:0}}}}function u$n(e,t,n){const{borderElCls:r}=n,o=r?`> ${r}`:"";return{[`&-item:not(${t}-first-item):not(${t}-last-item) ${o}`]:{borderRadius:0},[`&-item:not(${t}-last-item)${t}-first-item`]:{[`& ${o}, &${e}-sm ${o}, &${e}-lg ${o}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&-item:not(${t}-first-item)${t}-last-item`]:{[`& ${o}, &${e}-sm ${o}, &${e}-lg ${o}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}function a6(e,t={focus:!0}){const{componentCls:n}=e,{componentCls:r}=t,o=r||n,i=`${o}-compact`;return{[i]:{...c$n(e,i,t,o),...u$n(o,i,t)}}}function d$n(e,t,n){return{[`&-item:not(${t}-last-item)`]:{marginBottom:e.calc(e.lineWidth).mul(-1).equal()},[`&-item:not(${n}-status-success)`]:{zIndex:2},"&-item":{"&:hover,&:focus,&:active":{zIndex:3},"&[disabled]":{zIndex:0}}}}function f$n(e,t){return{[`&-item:not(${t}-first-item):not(${t}-last-item)`]:{borderRadius:0},[`&-item${t}-first-item:not(${t}-last-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${t}-last-item:not(${t}-first-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function p$n(e){const t=`${e.componentCls}-compact-vertical`;return{[t]:{...d$n(e,t,e.componentCls),...f$n(e.componentCls,t)}}}const h$n=e=>{const{componentCls:t,colorPrimaryHover:n,lineWidth:r,calc:o}=e,i=o(r).mul(-1).equal(),s=l=>{const c=`${t}-compact${l?"-vertical":""}-item`,u=`${c}${t}-primary:not([disabled])`;return{[c]:{transition:"none"},[`${u} + ${u}::before`]:{position:"absolute",top:l?i:0,insetInlineStart:l?0:i,backgroundColor:n,content:'""',width:l?"100%":r,height:l?r:"100%"}}};return{...s(),...s(!0)}},m$n=d5(["Button","compact"],e=>{const t=tst(e);return[a6(t),p$n(t),h$n(t)]},nst);function g$n(e){if(typeof e=="object"&&e){let t=e==null?void 0:e.delay;return t=!Number.isNaN(t)&&typeof t=="number"?t:0,{loading:t<=0,delay:t}}return{loading:!!e,delay:0}}const x$n={default:["default","outlined"],primary:["primary","solid"],dashed:["default","dashed"],link:["link","link"],text:["default","text"]},y$n=Ie.forwardRef((e,t)=>{const{_skipSemantic:n,loading:r=!1,prefixCls:o,color:i,variant:s,type:l,danger:c=!1,shape:u,size:d,disabled:p,className:h,rootClassName:m,children:g,icon:y,iconPosition:x,iconPlacement:v,ghost:b=!1,block:w=!1,htmlType:S="button",classNames:C,styles:N,style:j,autoInsertSpace:I,autoFocus:_,...T}=e,P=Bu(g),E=l||"default",{button:M}=Ie.useContext(Qr),R=u||(M==null?void 0:M.shape)||"default",[$,D]=f.useMemo(()=>{if(i&&s)return[i,s];if(l||c){const Pt=x$n[E]||[];return c?["danger",Pt[1]]:Pt}return M!=null&&M.color&&(M!=null&&M.variant)?[M.color,M.variant]:["default","outlined"]},[i,s,l,c,M==null?void 0:M.color,M==null?void 0:M.variant,E]),[z,V]=f.useMemo(()=>b&&D==="solid"?[$,"outlined"]:[$,D],[$,D,b]),B=z==="danger",G=B?"dangerous":z,{getPrefixCls:H,direction:F,autoInsertSpace:W,className:U,style:K,classNames:X,styles:J}=Zo("button"),te=I??W??!0,re=H("btn",o),[ce,ae]=l$n(re),oe=f.useContext(Mp),ue=p??oe,fe=f.useContext(Xat),se=f.useMemo(()=>g$n(r),[r]),[ge,ye]=f.useState(se.loading),[de,Ne]=f.useState(!1),_e=f.useRef(null),xe=Yw(t,_e),we=P.length===1&&!y&&!Xee(V),Te=f.useRef(!0);Ie.useEffect(()=>(Te.current=!1,()=>{Te.current=!0}),[]),Po(()=>{let Pt=null;se.delay>0?Pt=setTimeout(()=>{Pt=null,ye(!0)},se.delay):ye(se.loading);function Jt(){Pt&&(clearTimeout(Pt),Pt=null)}return Jt},[se.delay,se.loading]),f.useEffect(()=>{if(!_e.current||!te)return;const Pt=_e.current.textContent||"";we&&Zle(Pt)?de||Ne(!0):de&&Ne(!1)}),f.useEffect(()=>{_&&_e.current&&_e.current.focus()},[]);const Re=Ie.useCallback(Pt=>{var Jt;if(ge||ue){Pt.preventDefault();return}(Jt=e.onClick)==null||Jt.call(e,("href"in e,Pt))},[e.onClick,ge,ue]),{compactSize:Ue,compactItemClassnames:He}=Zw(re,F),Ye={large:"lg",small:"sm",middle:void 0},We=ad(Pt=>d??Ue??fe??Pt),at=We?Ye[We]??"":"",Oe=ge?"loading":y,Ae=v??x??"start",qe=za(T,["navigate"]),dt={...e,type:E,color:z,variant:V,danger:B,shape:R,size:We,disabled:ue,loading:ge,iconPlacement:Ae},[Ze,Qe]=di([n?void 0:X,C],[n?void 0:J,N],{props:dt}),lt=be(re,ce,ae,{[`${re}-${R}`]:R!=="default"&&R!=="square"&&R,[`${re}-${E}`]:E,[`${re}-dangerous`]:c,[`${re}-color-${G}`]:G,[`${re}-variant-${V}`]:V,[`${re}-${at}`]:at,[`${re}-icon-only`]:!g&&g!==0&&!!Oe,[`${re}-background-ghost`]:b&&!Xee(V),[`${re}-loading`]:ge,[`${re}-two-chinese-chars`]:de&&te&&!ge,[`${re}-block`]:w,[`${re}-rtl`]:F==="rtl",[`${re}-icon-end`]:Ae==="end"},He,h,m,U,Ze.root),bt={...Qe.root,...K,...j},Ct={className:Ze.icon,style:Qe.icon},Je=Pt=>Ie.createElement(Jat,{prefixCls:re,...Ct},Pt),Pe=Ie.createElement(y3n,{existIcon:!!y,prefixCls:re,loading:ge,mount:Te.current,...Ct});let Me;y&&!ge?Me=Je(y):r&&typeof r=="object"&&r.icon?Me=Je(r.icon):Me=Pe;const et=ll(g)?x3n(g,we&&te,Qe.content,Ze.content):null;if(qe.href!==void 0)return Ie.createElement("a",{...qe,className:be(lt,{[`${re}-disabled`]:ue}),href:ue?void 0:qe.href,style:bt,onClick:Re,ref:xe,tabIndex:ue?-1:0,"aria-disabled":ue},Me,et);let vt=Ie.createElement("button",{...T,type:S,className:lt,style:bt,onClick:Re,disabled:ue,ref:xe},Me,et,He&&Ie.createElement(m$n,{prefixCls:re}));return Xee(V)||(vt=Ie.createElement(o6,{component:"Button",disabled:ge},vt)),vt}),Ls=y$n;Ls.Group=m3n;Ls.__ANT_BUTTON=!0;const ete=e=>typeof(e==null?void 0:e.then)=="function",rst=e=>{const{type:t,children:n,prefixCls:r,buttonProps:o,close:i,autoFocus:s,emitEvent:l,isSilent:c,quitOnNullishReturnValue:u,actionFn:d}=e,p=f.useRef(!1),h=f.useRef(null),[m,g]=n$(!1),y=(...b)=>{i==null||i(...b)};f.useEffect(()=>{let b=null;return s&&(b=setTimeout(()=>{var w;(w=h.current)==null||w.focus({preventScroll:!0})})),()=>{b&&clearTimeout(b)}},[s]);const x=b=>{ete(b)&&(g(!0),b.then((...w)=>{g(!1,!0),y.apply(void 0,w),p.current=!1},w=>{if(g(!1,!0),p.current=!1,!(c!=null&&c()))return Promise.reject(w)}))},v=b=>{if(p.current)return;if(p.current=!0,!d){y();return}let w;if(l){if(w=d(b),u&&!ete(w)){p.current=!1,y(b);return}}else if(d.length)w=d(i),p.current=!1;else if(w=d(),!ete(w)){y();return}x(w)};return f.createElement(Ls,{...Qat(t),onClick:v,loading:m,prefixCls:r,...o,ref:h},n)},s6=Ie.createContext({}),{Provider:ost}=s6,COe=()=>{const{autoFocusButton:e,cancelButtonProps:t,cancelTextLocale:n,isSilent:r,mergedOkCancel:o,rootPrefixCls:i,close:s,onCancel:l,onConfirm:c,onClose:u}=f.useContext(s6);return o?Ie.createElement(rst,{isSilent:r,actionFn:l,close:(...d)=>{s==null||s(...d),c==null||c(!1),u==null||u()},autoFocus:e==="cancel",buttonProps:t,prefixCls:`${i}-btn`},n):null},NOe=()=>{const{autoFocusButton:e,close:t,isSilent:n,okButtonProps:r,rootPrefixCls:o,okTextLocale:i,okType:s,onConfirm:l,onOk:c,onClose:u}=f.useContext(s6);return Ie.createElement(rst,{isSilent:n,type:s||"primary",actionFn:c,close:(...d)=>{t==null||t(...d),l==null||l(!0),u==null||u()},autoFocus:e==="ok",buttonProps:r,prefixCls:`${o}-btn`},i)},ist=f.createContext({});function jOe(e,t,n){let r=t;return!r&&n&&(r=`${e}-${n}`),r}function EOe(e,t){let n=e[`page${t?"Y":"X"}Offset`];const r=`scroll${t?"Top":"Left"}`;if(typeof n!="number"){const o=e.document;n=o.documentElement[r],typeof n!="number"&&(n=o.body[r])}return n}function v$n(e){const t=e.getBoundingClientRect(),n={left:t.left,top:t.top},r=e.ownerDocument,o=r.defaultView||r.parentWindow;return n.left+=EOe(o),n.top+=EOe(o,!0),n}function IOe(e,t=!1){if(Dk(e)){const n=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||e.isContentEditable||n==="a"&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),i=Number(o);let s=null;return o&&!Number.isNaN(i)?s=i:r&&s===null&&(s=0),r&&e.disabled&&(s=null),s!==null&&(s>=0||t&&s<0)}return!1}function Hye(e,t=!1){const n=[...e.querySelectorAll("*")].filter(r=>IOe(r,t));return IOe(e,t)&&n.unshift(e),n}function ast(e,t){if(!e)return;e.focus(t);const{cursor:n}=t||{};if(n&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)){const r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}let hA=null,o2=[];function sst(){return o2[o2.length-1]}function b$n(e){const{activeElement:t}=document;return e===t||e.contains(t)}function tte(){const e=sst(),{activeElement:t}=document;if(e&&!b$n(e)){const n=Hye(e),r=n.includes(hA)?hA:n[0];r==null||r.focus()}else hA=t}function _Oe(e){if(e.key==="Tab"){const{activeElement:t}=document,n=sst(),r=Hye(n),o=r[r.length-1];e.shiftKey&&t===r[0]?hA=o:!e.shiftKey&&t===o&&(hA=r[0])}}function w$n(e){return e&&(o2=o2.filter(t=>t!==e),o2.push(e),window.addEventListener("focusin",tte),window.addEventListener("keydown",_Oe,!0),tte()),()=>{hA=null,o2=o2.filter(t=>t!==e),o2.length===0&&(window.removeEventListener("focusin",tte),window.removeEventListener("keydown",_Oe,!0))}}function lst(e,t){f.useEffect(()=>{if(e){const n=t();if(n)return w$n(n)}},[e])}const S$n=f.memo(({children:e})=>e,(e,{shouldUpdate:t})=>!t);function kU(){return kU=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:n,className:r,style:o,title:i,ariaId:s,footer:l,closable:c,closeIcon:u,onClose:d,children:p,bodyStyle:h,bodyProps:m,modalRender:g,onMouseDown:y,onMouseUp:x,holderRef:v,visible:b,forceRender:w,width:S,height:C,classNames:N,styles:j,isFixedPos:I,focusTrap:_}=e,{panel:T}=Ie.useContext(ist),P=f.useRef(null),E=Yw(v,T,P);lst(b&&I&&_!==!1,()=>P.current),Ie.useImperativeHandle(t,()=>({focus:()=>{var H;(H=P.current)==null||H.focus({preventScroll:!0})}}));const M={};S!==void 0&&(M.width=S),C!==void 0&&(M.height=C);const R=l?Ie.createElement("div",{className:be(`${n}-footer`,N==null?void 0:N.footer),style:{...j==null?void 0:j.footer}},l):null,$=i?Ie.createElement("div",{className:be(`${n}-header`,N==null?void 0:N.header),style:{...j==null?void 0:j.header}},Ie.createElement("div",{className:be(`${n}-title`,N==null?void 0:N.title),id:s,style:{...j==null?void 0:j.title}},i)):null,D=f.useMemo(()=>typeof c=="object"&&c!==null?c:c?{closeIcon:u??Ie.createElement("span",{className:`${n}-close-x`})}:{},[c,u,n]),z=fl(D,!0),V=typeof c=="object"&&c.disabled,B=c?Ie.createElement("button",kU({type:"button",onClick:d,"aria-label":"Close"},z,{className:`${n}-close`,disabled:V}),D.closeIcon):null,G=Ie.createElement("div",{className:be(`${n}-container`,N==null?void 0:N.container),style:j==null?void 0:j.container},B,$,Ie.createElement("div",kU({className:be(`${n}-body`,N==null?void 0:N.body),style:{...h,...j==null?void 0:j.body}},m),p),R);return Ie.createElement("div",{key:"dialog-element",role:"dialog","aria-labelledby":i?s:null,"aria-modal":"true",ref:E,style:{...o,...M},className:be(n,r),onMouseDown:y,onMouseUp:x,tabIndex:-1},Ie.createElement(S$n,{shouldUpdate:b||w},g?g(G):G))});function nce(){return nce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:n,title:r,style:o,className:i,visible:s,forceRender:l,destroyOnHidden:c,motionName:u,ariaId:d,onVisibleChanged:p,mousePosition:h}=e,m=f.useRef(null),g=f.useRef(null);f.useImperativeHandle(t,()=>({...g.current,inMotion:m.current.inMotion,enableMotion:m.current.enableMotion}));const[y,x]=f.useState(),v={};y&&(v.transformOrigin=y);function b(){var S;if(!((S=m.current)!=null&&S.nativeElement))return;const w=v$n(m.current.nativeElement);x(h&&(h.x||h.y)?`${h.x-w.left}px ${h.y-w.top}px`:"")}return f.createElement(Kf,{visible:s,onVisibleChanged:p,onAppearPrepare:b,onEnterPrepare:b,forceRender:l,motionName:u,removeOnLeave:c,ref:m},({className:w,style:S},C)=>f.createElement(cst,nce({},e,{ref:g,title:r,ariaId:d,prefixCls:n,holderRef:C,style:{...S,...o,...v},className:be(i,w)})))});function rce(){return rce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:t,style:n,visible:r,maskProps:o,motionName:i,className:s}=e;return f.createElement(Kf,{key:"mask",visible:r,motionName:i,leavedClassName:`${t}-mask-hidden`},({className:l,style:c},u)=>f.createElement("div",rce({ref:u,style:{...c,...n},className:be(`${t}-mask`,l,s)},o)))};function EO(){return EO=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:t="rc-dialog",zIndex:n,visible:r=!1,focusTriggerAfterClose:o=!0,wrapStyle:i,wrapClassName:s,wrapProps:l,onClose:c,afterOpenChange:u,afterClose:d,transitionName:p,animation:h,closable:m=!0,mask:g=!0,maskTransitionName:y,maskAnimation:x,maskClosable:v=!0,maskStyle:b,maskProps:w,rootClassName:S,rootStyle:C,classNames:N,styles:j}=e,I=f.useRef(null),_=f.useRef(null),T=f.useRef(null),[P,E]=f.useState(r),[M,R]=f.useState(!1),$=Jw();function D(){ule(_.current,document.activeElement)||(I.current=document.activeElement)}function z(){var J;ule(_.current,document.activeElement)||(J=T.current)==null||J.focus()}function V(){if(E(!1),g&&I.current&&o){try{I.current.focus({preventScroll:!0})}catch{}I.current=null}P&&(d==null||d())}function B(J){J?z():V(),u==null||u(J)}function G(J){c==null||c(J)}const H=f.useRef(!1),F=f.useRef(null),W=()=>{clearTimeout(F.current),H.current=!0},U=()=>{F.current=setTimeout(()=>{H.current=!1})};let K=null;v&&(K=J=>{H.current?H.current=!1:_.current===J.target&&G(J)}),f.useEffect(()=>{if(r){if(E(!0),D(),_.current){const J=getComputedStyle(_.current);R(J.position==="fixed")}}else P&&T.current.enableMotion()&&!T.current.inMotion()&&V()},[r]),f.useEffect(()=>()=>{clearTimeout(F.current)},[]);const X={zIndex:n,...i,...j==null?void 0:j.wrapper,display:P?null:"none"};return f.createElement("div",EO({className:be(`${t}-root`,S),style:C},fl(e,{data:!0})),f.createElement(N$n,{prefixCls:t,visible:g&&r,motionName:jOe(t,y,x),style:{zIndex:n,...b,...j==null?void 0:j.mask},maskProps:w,className:N==null?void 0:N.mask}),f.createElement("div",EO({className:be(`${t}-wrap`,s,N==null?void 0:N.wrapper),ref:_,onClick:K,style:X},l),f.createElement(C$n,EO({},e,{isFixedPos:M,onMouseDown:W,onMouseUp:U,ref:T,closable:m,ariaId:$,prefixCls:t,visible:r&&P,onClose:G,onVisibleChanged:B,motionName:jOe(t,p,h)}))))};function oce(){return oce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{visible:t,getContainer:n,forceRender:r,destroyOnHidden:o=!1,afterClose:i,closable:s,panelRef:l,keyboard:c=!0,onClose:u}=e,[d,p]=f.useState(t),h=f.useMemo(()=>({panel:l}),[l]),m=({top:g,event:y})=>{if(g&&c){y.stopPropagation(),u==null||u(y);return}};return f.useEffect(()=>{t&&p(!0)},[t]),!r&&o&&!d?null:f.createElement(ist.Provider,{value:h},f.createElement(e6,{open:t||r||d,onEsc:m,autoDestroy:!1,getContainer:n,autoLock:t||d},f.createElement(j$n,oce({},e,{destroyOnHidden:o,afterClose:()=>{const g=s&&typeof s=="object"?s:{},{afterClose:y}=g||{};y==null||y(),i==null||i(),p(!1)}}))))},iE="RC_FORM_INTERNAL_HOOKS",Qs=()=>{Al(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},wI=f.createContext({getFieldValue:Qs,getFieldsValue:Qs,getFieldError:Qs,getFieldWarning:Qs,getFieldsError:Qs,isFieldsTouched:Qs,isFieldTouched:Qs,isFieldValidating:Qs,isFieldsValidating:Qs,resetFields:Qs,setFields:Qs,setFieldValue:Qs,setFieldsValue:Qs,validateFields:Qs,submit:Qs,getInternalHooks:()=>(Qs(),{dispatch:Qs,initEntityValue:Qs,registerField:Qs,useSubscribe:Qs,setInitialValues:Qs,destroyForm:Qs,setCallbacks:Qs,registerWatch:Qs,getFields:Qs,setValidateMessages:Qs,setPreserve:Qs,getInitialValue:Qs})}),p$=f.createContext(null);function ice(e){return e==null?[]:Array.isArray(e)?e:[e]}function I$n(e){return e&&!!e._init}function ace(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",tel:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var sce=ace();function _$n(e){try{return Function.toString.call(e).indexOf("[native code]")!==-1}catch{return typeof e=="function"}}function P$n(e,t,n){if(_K())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&uT(o,n.prototype),o}function lce(e){var t=typeof Map=="function"?new Map:void 0;return lce=function(r){if(r===null||!_$n(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(r))return t.get(r);t.set(r,o)}function o(){return P$n(r,arguments,vI(this).constructor)}return o.prototype=Object.create(r.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),uT(o,r)},lce(e)}var A$n=/%[sdj%]/g,T$n=function(){};function cce(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function ng(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=i)return l;switch(l){case"%s":return String(n[o++]);case"%d":return Number(n[o++]);case"%j":try{return JSON.stringify(n[o++])}catch{return"[Circular]"}break;default:return l}});return s}return e}function k$n(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"||e==="tel"}function Md(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||k$n(t)&&typeof e=="string"&&!e)}function M$n(e,t,n){var r=[],o=0,i=e.length;function s(l){r.push.apply(r,go(l||[])),o++,o===i&&n(r)}e.forEach(function(l){t(l,s)})}function POe(e,t,n){var r=0,o=e.length;function i(s){if(s&&s.length){n(s);return}var l=r;r=r+1,lt.max?o.push(ng(i.messages[p].max,t.fullField,t.max)):l&&c&&(dt.max)&&o.push(ng(i.messages[p].range,t.fullField,t.min,t.max))},ust=function(t,n,r,o,i,s){t.required&&(!r.hasOwnProperty(t.field)||Md(n,s||t.type))&&o.push(ng(i.messages.required,t.fullField))},a7;const B$n=(function(){if(a7)return a7;var e="[a-fA-F\\d:]",t=function(N){return N&&N.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(e,")|(?<=").concat(e,")(?=\\s|$))"):""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",o=["(?:".concat(r,":){7}(?:").concat(r,"|:)"),"(?:".concat(r,":){6}(?:").concat(n,"|:").concat(r,"|:)"),"(?:".concat(r,":){5}(?::").concat(n,"|(?::").concat(r,"){1,2}|:)"),"(?:".concat(r,":){4}(?:(?::").concat(r,"){0,1}:").concat(n,"|(?::").concat(r,"){1,3}|:)"),"(?:".concat(r,":){3}(?:(?::").concat(r,"){0,2}:").concat(n,"|(?::").concat(r,"){1,4}|:)"),"(?:".concat(r,":){2}(?:(?::").concat(r,"){0,3}:").concat(n,"|(?::").concat(r,"){1,5}|:)"),"(?:".concat(r,":){1}(?:(?::").concat(r,"){0,4}:").concat(n,"|(?::").concat(r,"){1,6}|:)"),"(?::(?:(?::".concat(r,"){0,5}:").concat(n,"|(?::").concat(r,"){1,7}|:))")],i="(?:%[0-9a-zA-Z]{1,})?",s="(?:".concat(o.join("|"),")").concat(i),l=new RegExp("(?:^".concat(n,"$)|(?:^").concat(s,"$)")),c=new RegExp("^".concat(n,"$")),u=new RegExp("^".concat(s,"$")),d=function(N){return N&&N.exact?l:new RegExp("(?:".concat(t(N)).concat(n).concat(t(N),")|(?:").concat(t(N)).concat(s).concat(t(N),")"),"g")};d.v4=function(C){return C&&C.exact?c:new RegExp("".concat(t(C)).concat(n).concat(t(C)),"g")},d.v6=function(C){return C&&C.exact?u:new RegExp("".concat(t(C)).concat(s).concat(t(C)),"g")};var p="(?:(?:[a-z]+:)?//)",h="(?:\\S+(?::\\S*)?@)?",m=d.v4().source,g=d.v6().source,y="(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)",x="(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*",v="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))",b="(?::\\d{2,5})?",w='(?:[/?#][^\\s"]*)?',S="(?:".concat(p,"|www\\.)").concat(h,"(?:localhost|").concat(m,"|").concat(g,"|").concat(y).concat(x).concat(v,")").concat(b).concat(w);return a7=new RegExp("(?:^".concat(S,"$)"),"i"),a7});var nte={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,tel:/^(\+[0-9]{1,3}[-\s\u2011]?)?(\([0-9]{1,4}\)[-\s\u2011]?)?([0-9]+[-\s\u2011]?)*[0-9]+$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},TR={integer:function(t){return TR.number(t)&&parseInt(t,10)===t},float:function(t){return TR.number(t)&&!TR.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return Uo(t)==="object"&&!TR.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(nte.email)},tel:function(t){return typeof t=="string"&&t.length<=32&&!!t.match(nte.tel)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(B$n())},hex:function(t){return typeof t=="string"&&!!t.match(nte.hex)}},H$n=function(t,n,r,o,i){if(t.required&&n===void 0){ust(t,n,r,o,i);return}var s=["integer","float","array","regexp","object","method","email","tel","number","date","url","hex"],l=t.type;s.indexOf(l)>-1?TR[l](n)||o.push(ng(i.messages.types[l],t.fullField,t.type)):l&&Uo(n)!==t.type&&o.push(ng(i.messages.types[l],t.fullField,t.type))},V$n=function(t,n,r,o,i){(/^\s+$/.test(n)||n==="")&&o.push(ng(i.messages.whitespace,t.fullField))};const da={required:ust,whitespace:V$n,type:H$n,range:z$n,enum:L$n,pattern:F$n};var U$n=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Md(n)&&!t.required)return r();da.required(t,n,o,s,i)}r(s)},W$n=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(n==null&&!t.required)return r();da.required(t,n,o,s,i,"array"),n!=null&&(da.type(t,n,o,s,i),da.range(t,n,o,s,i))}r(s)},G$n=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Md(n)&&!t.required)return r();da.required(t,n,o,s,i),n!==void 0&&da.type(t,n,o,s,i)}r(s)},q$n=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Md(n,"date")&&!t.required)return r();if(da.required(t,n,o,s,i),!Md(n,"date")){var c;n instanceof Date?c=n:c=new Date(n),da.type(t,c,o,s,i),c&&da.range(t,c.getTime(),o,s,i)}}r(s)},K$n="enum",Y$n=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Md(n)&&!t.required)return r();da.required(t,n,o,s,i),n!==void 0&&da[K$n](t,n,o,s,i)}r(s)},X$n=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Md(n)&&!t.required)return r();da.required(t,n,o,s,i),n!==void 0&&(da.type(t,n,o,s,i),da.range(t,n,o,s,i))}r(s)},Q$n=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Md(n)&&!t.required)return r();da.required(t,n,o,s,i),n!==void 0&&(da.type(t,n,o,s,i),da.range(t,n,o,s,i))}r(s)},J$n=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Md(n)&&!t.required)return r();da.required(t,n,o,s,i),n!==void 0&&da.type(t,n,o,s,i)}r(s)},Z$n=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(n===""&&(n=void 0),Md(n)&&!t.required)return r();da.required(t,n,o,s,i),n!==void 0&&(da.type(t,n,o,s,i),da.range(t,n,o,s,i))}r(s)},eDn=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Md(n)&&!t.required)return r();da.required(t,n,o,s,i),n!==void 0&&da.type(t,n,o,s,i)}r(s)},tDn=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Md(n,"string")&&!t.required)return r();da.required(t,n,o,s,i),Md(n,"string")||da.pattern(t,n,o,s,i)}r(s)},nDn=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Md(n)&&!t.required)return r();da.required(t,n,o,s,i),Md(n)||da.type(t,n,o,s,i)}r(s)},rDn=function(t,n,r,o,i){var s=[],l=Array.isArray(n)?"array":Uo(n);da.required(t,n,o,s,i,l),r(s)},oDn=function(t,n,r,o,i){var s=[],l=t.required||!t.required&&o.hasOwnProperty(t.field);if(l){if(Md(n,"string")&&!t.required)return r();da.required(t,n,o,s,i,"string"),Md(n,"string")||(da.type(t,n,o,s,i),da.range(t,n,o,s,i),da.pattern(t,n,o,s,i),t.whitespace===!0&&da.whitespace(t,n,o,s,i))}r(s)},s7=function(t,n,r,o,i){var s=t.type,l=[],c=t.required||!t.required&&o.hasOwnProperty(t.field);if(c){if(Md(n,s)&&!t.required)return r();da.required(t,n,o,l,i,s),Md(n,s)||da.type(t,n,o,l,i)}r(l)};const IO={string:oDn,method:J$n,number:Z$n,boolean:G$n,regexp:nDn,integer:Q$n,float:X$n,array:W$n,object:eDn,enum:Y$n,pattern:tDn,date:q$n,url:s7,hex:s7,email:s7,tel:s7,required:rDn,any:U$n};var l6=(function(){function e(t){oN(this,e),Oc(this,"rules",null),Oc(this,"_messages",sce),this.define(t)}return iN(e,[{key:"define",value:function(n){var r=this;if(!n)throw new Error("Cannot configure a schema with no rules");if(Uo(n)!=="object"||Array.isArray(n))throw new Error("Rules must be an object");this.rules={},Object.keys(n).forEach(function(o){var i=n[o];r.rules[o]=Array.isArray(i)?i:[i]})}},{key:"messages",value:function(n){return n&&(this._messages=kOe(ace(),n)),this._messages}},{key:"validate",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},s=n,l=o,c=i;if(typeof l=="function"&&(c=l,l={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,s),Promise.resolve(s);function u(g){var y=[],x={};function v(w){if(Array.isArray(w)){var S;y=(S=y).concat.apply(S,go(w))}else y.push(w)}for(var b=0;b0&&arguments[0]!==void 0?arguments[0]:[],I=Array.isArray(j)?j:[j];!l.suppressWarning&&I.length&&e.warning("async-validator:",I),I.length&&x.message!==void 0&&x.message!==null&&(I=[].concat(x.message));var _=I.map(TOe(x,s));if(l.first&&_.length)return m[x.field]=1,y(_);if(!v)y(_);else{if(x.required&&!g.value)return x.message!==void 0?_=[].concat(x.message).map(TOe(x,s)):l.error&&(_=[l.error(x,ng(l.messages.required,x.field))]),y(_);var T={};x.defaultField&&Object.keys(g.value).map(function(M){T[M]=x.defaultField}),T=$r($r({},T),g.rule.fields);var P={};Object.keys(T).forEach(function(M){var R=T[M],$=Array.isArray(R)?R:[R];P[M]=$.map(b.bind(null,M))});var E=new e(P);E.messages(l.messages),g.rule.options&&(g.rule.options.messages=l.messages,g.rule.options.error=l.error),E.validate(g.value,g.rule.options||l,function(M){var R=[];_&&_.length&&R.push.apply(R,go(_)),M&&M.length&&R.push.apply(R,go(M)),y(R.length?R:null)})}}var S;if(x.asyncValidator)S=x.asyncValidator(x,g.value,w,g.source,l);else if(x.validator){try{S=x.validator(x,g.value,w,g.source,l)}catch(j){var C,N;(C=(N=console).error)===null||C===void 0||C.call(N,j),l.suppressValidatorError||setTimeout(function(){throw j},0),w(j.message)}S===!0?w():S===!1?w(typeof x.message=="function"?x.message(x.fullField||x.field):x.message||"".concat(x.fullField||x.field," fails")):S instanceof Array?w(S):S instanceof Error&&w(S.message)}S&&S.then&&S.then(function(){return w()},function(j){return w(j)})},function(g){u(g)},s)}},{key:"getType",value:function(n){if(n.type===void 0&&n.pattern instanceof RegExp&&(n.type="pattern"),typeof n.validator!="function"&&n.type&&!IO.hasOwnProperty(n.type))throw new Error(ng("Unknown rule type %s",n.type));return n.type||"string"}},{key:"getValidationMethod",value:function(n){if(typeof n.validator=="function")return n.validator;var r=Object.keys(n),o=r.indexOf("message");return o!==-1&&r.splice(o,1),r.length===1&&r[0]==="required"?IO.required:IO[this.getType(n)]||void 0}}]),e})();Oc(l6,"register",function(t,n){if(typeof n!="function")throw new Error("Cannot register a validator by type, validator is not a function");IO[t]=n});Oc(l6,"warning",T$n);Oc(l6,"messages",sce);Oc(l6,"validators",IO);const Gh="'${name}' is not a valid ${type}",dst={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:Gh,method:Gh,array:Gh,object:Gh,number:Gh,date:Gh,boolean:Gh,integer:Gh,float:Gh,regexp:Gh,email:Gh,tel:Gh,url:Gh,hex:Gh},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},MOe=l6;function iDn(e,t){return e.replace(/\\?\$\{\w+\}/g,n=>{if(n.startsWith("\\"))return n.slice(1);const r=n.slice(2,-1);return t[r]})}const ROe="CODE_LOGIC_ERROR";async function uce(e,t,n,r,o){const i={...n};if(delete i.ruleIndex,MOe.warning=()=>{},i.validator){const h=i.validator;i.validator=(...m)=>{try{return h(...m)}catch(g){return console.error(g),Promise.reject(ROe)}}}let s=null;i&&i.type==="array"&&i.defaultField&&(s=i.defaultField,delete i.defaultField);const l=new MOe({[e]:[i]}),c=B2(dst,r.validateMessages);l.messages(c);let u=[];try{await Promise.resolve(l.validate({[e]:t},{...r}))}catch(h){h.errors&&(u=h.errors.map(({message:m},g)=>{const y=m===ROe?c.default:m;return f.isValidElement(y)?f.cloneElement(y,{key:`error_${g}`}):y}))}if(!u.length&&s&&Array.isArray(t)&&t.length>0)return(await Promise.all(t.map((m,g)=>uce(`${e}.${g}`,m,s,r,o)))).reduce((m,g)=>[...m,...g],[]);const d={...n,name:e,enum:(n.enum||[]).join(", "),...o};return u.map(h=>typeof h=="string"?iDn(h,d):h)}function aDn(e,t,n,r,o,i){const s=e.join("."),l=n.map((u,d)=>{const p=u.validator,h={...u,ruleIndex:d};return p&&(h.validator=(m,g,y)=>{let x=!1;const b=p(m,g,(...w)=>{Promise.resolve().then(()=>{Al(!x,"Your validator function has already return a promise. `callback` will be ignored."),x||y(...w)})});x=b&&typeof b.then=="function"&&typeof b.catch=="function",Al(x,"`callback` is deprecated. Please return a promise instead."),x&&b.then(()=>{y()}).catch(w=>{y(w||" ")})}),h}).sort(({warningOnly:u,ruleIndex:d},{warningOnly:p,ruleIndex:h})=>!!u==!!p?d-h:u?1:-1);let c;if(o===!0)c=new Promise(async(u,d)=>{for(let p=0;puce(s,t,d,r,i).then(p=>({errors:p,rule:d})));c=(o?lDn(u):sDn(u)).then(d=>Promise.reject(d))}return c.catch(u=>u),c}async function sDn(e){return Promise.all(e).then(t=>[].concat(...t))}async function lDn(e){let t=0;return new Promise(n=>{e.forEach(r=>{r.then(o=>{o.errors.length&&n([o]),t+=1,t===e.length&&n([])})})})}function Jc(e){return ice(e)}function OOe(e,t){let n={};return t.forEach(r=>{const o=Cp(e,r);n=Um(n,r,o)}),n}function mA(e,t,n=!1){return e&&e.some(r=>MU(t,r,n))}function MU(e,t,n=!1){return!e||!t||!n&&e.length!==t.length?!1:t.every((r,o)=>e[o]===r)}function cDn(e,t){if(e===t)return!0;if(!e&&t||e&&!t||!e||!t||typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(e),r=Object.keys(t);return[...new Set([...n,...r])].every(i=>{const s=e[i],l=t[i];return typeof s=="function"&&typeof l=="function"?!0:s===l})}function uDn(e,...t){const n=t[0];return n&&n.target&&typeof n.target=="object"&&e in n.target?n.target[e]:n}function $Oe(e,t,n){const{length:r}=e;if(t<0||t>=r||n<0||n>=r)return e;const o=e[t],i=t-n;return i>0?[...e.slice(0,n),o,...e.slice(n,t),...e.slice(t+1,r)]:i<0?[...e.slice(0,t),...e.slice(t+1,n+1),o,...e.slice(n+1,r)]:e}function dce(){return dce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{preserve:n,isListField:r,name:o}=this.props;this.cancelRegisterFunc&&this.cancelRegisterFunc(r,n,Jc(o)),this.cancelRegisterFunc=null});ze(this,"getNamePath",()=>{const{name:n,fieldContext:r}=this.props,{prefixName:o=[]}=r;return n!==void 0?[...o,...n]:[]});ze(this,"getRules",()=>{const{rules:n=[],fieldContext:r}=this.props;return n.map(o=>typeof o=="function"?o(r):o)});ze(this,"refresh",()=>{this.mounted&&this.setState(({resetCount:n})=>({resetCount:n+1}))});ze(this,"metaCache",null);ze(this,"triggerMetaEvent",n=>{const{onMetaChange:r}=this.props;if(r){const o={...this.getMeta(),destroy:n};hy(this.metaCache,o)||r(o),this.metaCache=o}else this.metaCache=null});ze(this,"onStoreChange",(n,r,o)=>{const{shouldUpdate:i,dependencies:s=[],onReset:l}=this.props,{store:c}=o,u=this.getNamePath(),d=this.getValue(n),p=this.getValue(c),h=r&&mA(r,u);switch(o.type==="valueUpdate"&&o.source==="external"&&!hy(d,p)&&(this.touched=!0,this.dirty=!0,this.validatePromise=null,this.errors=UN,this.warnings=NM,this.triggerMetaEvent()),o.type){case"reset":if(!r||h){this.touched=!1,this.dirty=!1,this.validatePromise=void 0,this.errors=UN,this.warnings=NM,this.triggerMetaEvent(),l==null||l(),this.refresh();return}break;case"remove":{if(i&&rte(i,n,c,d,p,o)){this.reRender();return}break}case"setField":{const{data:m}=o;if(h){"touched"in m&&(this.touched=m.touched),"validating"in m&&!("originRCField"in m)&&(this.validatePromise=m.validating?Promise.resolve([]):null),"errors"in m&&(this.errors=m.errors||UN),"warnings"in m&&(this.warnings=m.warnings||NM),this.dirty=!0,this.triggerMetaEvent(),this.reRender();return}else if("value"in m&&mA(r,u,!0)){this.reRender();return}if(i&&!u.length&&rte(i,n,c,d,p,o)){this.reRender();return}break}case"dependenciesUpdate":{if(s.map(Jc).some(g=>mA(o.relatedFields,g))){this.reRender();return}break}default:if(h||(!s.length||u.length||i)&&rte(i,n,c,d,p,o)){this.reRender();return}break}i===!0&&this.reRender()});ze(this,"validateRules",n=>{const r=this.getNamePath(),o=this.getValue(),{triggerName:i,validateOnly:s=!1}=n||{},l=Promise.resolve().then(async()=>{if(!this.mounted)return[];const{validateFirst:c=!1,messageVariables:u,validateDebounce:d}=this.props;let p=this.getRules();if(i&&(p=p.filter(m=>m).filter(m=>{const{validateTrigger:g}=m;return g?ice(g).includes(i):!0})),d&&i&&(await new Promise(m=>{setTimeout(m,d)}),this.validatePromise!==l))return[];const h=aDn(r,o,p,n,c,u);return h.catch(m=>m).then((m=UN)=>{var g;if(this.validatePromise===l){this.validatePromise=null;const y=[],x=[];(g=m.forEach)==null||g.call(m,({rule:{warningOnly:v},errors:b=UN})=>{v?x.push(...b):y.push(...b)}),this.errors=y,this.warnings=x,this.triggerMetaEvent(),this.reRender()}}),h});return s||(this.validatePromise=l,this.dirty=!0,this.errors=UN,this.warnings=NM,this.triggerMetaEvent(),this.reRender()),l});ze(this,"isFieldValidating",()=>!!this.validatePromise);ze(this,"isFieldTouched",()=>this.touched);ze(this,"isFieldDirty",()=>{if(this.dirty||this.props.initialValue!==void 0)return!0;const{fieldContext:n}=this.props,{getInitialValue:r}=n.getInternalHooks(iE);return r(this.getNamePath())!==void 0});ze(this,"getErrors",()=>this.errors);ze(this,"getWarnings",()=>this.warnings);ze(this,"isListField",()=>this.props.isListField);ze(this,"isList",()=>this.props.isList);ze(this,"isPreserve",()=>this.props.preserve);ze(this,"getMeta",()=>(this.prevValidating=this.isFieldValidating(),{touched:this.isFieldTouched(),validating:this.prevValidating,errors:this.errors,warnings:this.warnings,name:this.getNamePath(),validated:this.validatePromise===null}));ze(this,"getOnlyChild",n=>{if(typeof n=="function"){const o=this.getMeta();return{...this.getOnlyChild(n(this.getControlled(),o,this.props.fieldContext)),isFunction:!0}}const r=Bu(n);return r.length!==1||!f.isValidElement(r[0])?{child:r,isFunction:!1}:{child:r[0],isFunction:!1}});ze(this,"getValue",n=>{const{getFieldsValue:r}=this.props.fieldContext,o=this.getNamePath();return Cp(n||r(!0),o)});ze(this,"getControlled",(n={})=>{const{name:r,trigger:o="onChange",validateTrigger:i,getValueFromEvent:s,normalize:l,valuePropName:c="value",getValueProps:u,fieldContext:d}=this.props,p=i!==void 0?i:d.validateTrigger,h=this.getNamePath(),{getInternalHooks:m,getFieldsValue:g}=d,{dispatch:y}=m(iE),x=this.getValue(),v=u||(N=>({[c]:N})),b=n[o],w=r!==void 0?v(x):{},S={...n,...w};return S[o]=(...N)=>{this.touched=!0,this.dirty=!0,this.triggerMetaEvent();let j;s?j=s(...N):j=uDn(c,...N),l&&(j=l(j,x,g(!0))),j!==x&&y({type:"updateValue",namePath:h,value:j}),b&&b(...N)},ice(p||[]).forEach(N=>{const j=S[N];S[N]=(...I)=>{j&&j(...I);const{rules:_}=this.props;_&&_.length&&y({type:"validateField",namePath:h,triggerName:N})}}),S});if(n.fieldContext){const{getInternalHooks:r}=n.fieldContext,{initEntityValue:o}=r(iE);o(this)}}componentDidMount(){const{shouldUpdate:n,fieldContext:r}=this.props;if(this.mounted=!0,r){const{getInternalHooks:o}=r,{registerField:i}=o(iE);this.cancelRegisterFunc=i(this)}n===!0&&this.reRender()}componentWillUnmount(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}reRender(){this.mounted&&this.forceUpdate()}render(){const{resetCount:n}=this.state,{children:r}=this.props,{child:o,isFunction:i}=this.getOnlyChild(r);let s;return i?s=o:f.isValidElement(o)?s=f.cloneElement(o,this.getControlled(o.props)):(Al(!o,"`children` of Field is not validate ReactElement."),s=o),f.createElement(f.Fragment,{key:n},s)}}ze(fst,"contextType",wI);function Vye({name:e,...t}){const n=f.useContext(wI),r=f.useContext(p$),o=e!==void 0?Jc(e):void 0,i=t.isListField??!!r;let s="keep";return i||(s=`_${(o||[]).join("_")}`),f.createElement(fst,dce({key:s,name:o,isListField:i},t,{fieldContext:n}))}function pst({name:e,initialValue:t,children:n,rules:r,validateTrigger:o,isListField:i}){const s=f.useContext(wI),l=f.useContext(p$),u=f.useRef({keys:[],id:0}).current,d=f.useMemo(()=>[...Jc(s.prefixName)||[],...Jc(e)],[s.prefixName,e]),p=f.useMemo(()=>({...s,prefixName:d}),[s,d]),h=f.useMemo(()=>({getKey:g=>{const y=d.length,x=g[y];return[u.keys[x],g.slice(y+1)]}}),[u,d]);if(typeof n!="function")return Al(!1,"Form.List only accepts function as children."),null;const m=(g,y,{source:x})=>x==="internal"?!1:g!==y;return f.createElement(p$.Provider,{value:h},f.createElement(wI.Provider,{value:p},f.createElement(Vye,{name:[],shouldUpdate:m,rules:r,validateTrigger:o,initialValue:t,isList:!0,isListField:i??!!l},({value:g=[],onChange:y},x)=>{const{getFieldValue:v}=s,b=()=>v(d||[])||[],w={add:(C,N)=>{const j=b();N>=0&&N<=j.length?(u.keys=[...u.keys.slice(0,N),u.id,...u.keys.slice(N)],y([...j.slice(0,N),C,...j.slice(N)])):(u.keys=[...u.keys,u.id],y([...j,C])),u.id+=1},remove:C=>{const N=b(),j=new Set(Array.isArray(C)?C:[C]);j.size<=0||(u.keys=u.keys.filter((I,_)=>!j.has(_)),y(N.filter((I,_)=>!j.has(_))))},move(C,N){if(C===N)return;const j=b();C<0||C>=j.length||N<0||N>=j.length||(u.keys=$Oe(u.keys,C,N),y($Oe(j,C,N)))}};let S=g||[];return Array.isArray(S)||(S=[]),n(S.map((C,N)=>{let j=u.keys[N];return j===void 0&&(u.keys[N]=u.id,j=u.keys[N],u.id+=1),{name:N,key:j,isListField:!0}}),w,x)})))}function dDn(e){let t=!1,n=e.length;const r=[];return e.length?new Promise((o,i)=>{e.forEach((s,l)=>{s.catch(c=>(t=!0,c)).then(c=>{n-=1,r[l]=c,!(n>0)&&(t&&i(r),o(r))})})}):Promise.resolve([])}const fce="__@field_split__";function l7(e){return e.map(t=>`${typeof t}:${t}`).join(fce)}class g_{constructor(){ze(this,"kvs",new Map)}set(t,n){this.kvs.set(l7(t),n)}get(t){return this.kvs.get(l7(t))}getAsPrefix(t){const n=l7(t),r=n+fce,o=[],i=this.kvs.get(n);return i!==void 0&&o.push(i),this.kvs.forEach((s,l)=>{l.startsWith(r)&&o.push(s)}),o}update(t,n){const r=this.get(t),o=n(r);o?this.set(t,o):this.delete(t)}delete(t){this.kvs.delete(l7(t))}map(t){return[...this.kvs.entries()].map(([n,r])=>{const o=n.split(fce);return t({key:o.map(i=>{const[,s,l]=i.match(/^([^:]*):(.*)$/);return s==="number"?Number(l):l}),value:r})})}toJSON(){const t={};return this.map(({key:n,value:r})=>(t[n.join(".")]=r,null)),t}}const fDn=e=>{const t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(null)};class pDn{constructor(t){ze(this,"namePathList",[]);ze(this,"taskId",0);ze(this,"watcherList",new Set);ze(this,"form");this.form=t}register(t){return this.watcherList.add(t),()=>{this.watcherList.delete(t)}}notify(t){t.forEach(n=>{this.namePathList.every(r=>!MU(r,n))&&this.namePathList.push(n)}),this.doBatch()}doBatch(){this.taskId+=1;const t=this.taskId;fDn(()=>{if(t===this.taskId&&this.watcherList.size){const n=this.form.getForm(),r=n.getFieldsValue(),o=n.getFieldsValue(!0);this.watcherList.forEach(i=>{i(r,o,this.namePathList)}),this.namePathList=[]}})}}class hDn{constructor(t){ze(this,"formHooked",!1);ze(this,"forceRootUpdate");ze(this,"subscribable",!0);ze(this,"store",{});ze(this,"fieldEntities",[]);ze(this,"initialValues",{});ze(this,"callbacks",{});ze(this,"validateMessages",null);ze(this,"preserve",null);ze(this,"lastValidatePromise",null);ze(this,"watcherCenter",new pDn(this));ze(this,"getForm",()=>({getFieldValue:this.getFieldValue,getFieldsValue:this.getFieldsValue,getFieldError:this.getFieldError,getFieldWarning:this.getFieldWarning,getFieldsError:this.getFieldsError,isFieldsTouched:this.isFieldsTouched,isFieldTouched:this.isFieldTouched,isFieldValidating:this.isFieldValidating,isFieldsValidating:this.isFieldsValidating,resetFields:this.resetFields,setFields:this.setFields,setFieldValue:this.setFieldValue,setFieldsValue:this.setFieldsValue,validateFields:this.validateFields,submit:this.submit,_init:!0,getInternalHooks:this.getInternalHooks}));ze(this,"getInternalHooks",t=>t===iE?(this.formHooked=!0,{dispatch:this.dispatch,initEntityValue:this.initEntityValue,registerField:this.registerField,useSubscribe:this.useSubscribe,setInitialValues:this.setInitialValues,destroyForm:this.destroyForm,setCallbacks:this.setCallbacks,setValidateMessages:this.setValidateMessages,getFields:this.getFields,setPreserve:this.setPreserve,getInitialValue:this.getInitialValue,registerWatch:this.registerWatch}):(Al(!1,"`getInternalHooks` is internal usage. Should not call directly."),null));ze(this,"useSubscribe",t=>{this.subscribable=t});ze(this,"prevWithoutPreserves",null);ze(this,"setInitialValues",(t,n)=>{var r;if(this.initialValues=t||{},n){let o=B2(t,this.store);(r=this.prevWithoutPreserves)==null||r.map(({key:i})=>{o=Um(o,i,Cp(t,i))}),this.prevWithoutPreserves=null,this.updateStore(o)}});ze(this,"destroyForm",t=>{if(t)this.updateStore({});else{const n=new g_;this.getFieldEntities(!0).forEach(r=>{this.isMergedPreserve(r.isPreserve())||n.set(r.getNamePath(),!0)}),this.prevWithoutPreserves=n}});ze(this,"getInitialValue",t=>{const n=Cp(this.initialValues,t);return t.length?B2(n):n});ze(this,"setCallbacks",t=>{this.callbacks=t});ze(this,"setValidateMessages",t=>{this.validateMessages=t});ze(this,"setPreserve",t=>{this.preserve=t});ze(this,"registerWatch",t=>this.watcherCenter.register(t));ze(this,"notifyWatch",(t=[])=>{this.watcherCenter.notify(t)});ze(this,"timeoutId",null);ze(this,"warningUnhooked",()=>{});ze(this,"updateStore",t=>{this.store=t});ze(this,"getFieldEntities",(t=!1)=>t?this.fieldEntities.filter(n=>n.getNamePath().length):this.fieldEntities);ze(this,"getFieldsMap",(t=!1)=>{const n=new g_;return this.getFieldEntities(t).forEach(r=>{const o=r.getNamePath();n.set(o,r)}),n});ze(this,"getFieldEntitiesForNamePathList",(t,n=!1)=>{if(!t)return this.getFieldEntities(!0);const r=this.getFieldsMap(!0);return n?t.flatMap(o=>{const i=Jc(o),s=r.getAsPrefix(i);return s.length?s:[{INVALIDATE_NAME_PATH:i}]}):t.map(o=>{const i=Jc(o);return r.get(i)||{INVALIDATE_NAME_PATH:Jc(o)}})});ze(this,"getFieldsValue",(t,n)=>{this.warningUnhooked();let r,o;if(t===!0||Array.isArray(t)?(r=t,o=n):t&&typeof t=="object"&&(o=t.filter),r===!0&&!o)return this.store;const i=this.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null,!0),s=[],l=[];i.forEach(u=>{var p;const d=u.INVALIDATE_NAME_PATH||u.getNamePath();if((p=u.isList)!=null&&p.call(u)){l.push(d);return}if(!o)s.push(d);else{const h="getMeta"in u?u.getMeta():null;o(h)&&s.push(d)}});let c=OOe(this.store,s.map(Jc));return l.forEach(u=>{Cp(c,u)||(c=Um(c,u,[]))}),c});ze(this,"getFieldValue",t=>{this.warningUnhooked();const n=Jc(t);return Cp(this.store,n)});ze(this,"getFieldsError",t=>(this.warningUnhooked(),this.getFieldEntitiesForNamePathList(t).map((r,o)=>r&&!r.INVALIDATE_NAME_PATH?{name:r.getNamePath(),errors:r.getErrors(),warnings:r.getWarnings()}:{name:Jc(t[o]),errors:[],warnings:[]})));ze(this,"getFieldError",t=>{this.warningUnhooked();const n=Jc(t);return this.getFieldsError([n])[0].errors});ze(this,"getFieldWarning",t=>{this.warningUnhooked();const n=Jc(t);return this.getFieldsError([n])[0].warnings});ze(this,"isFieldsTouched",(...t)=>{this.warningUnhooked();const[n,r]=t;let o,i=!1;t.length===0?o=null:t.length===1?Array.isArray(n)?(o=n.map(Jc),i=!1):(o=null,i=n):(o=n.map(Jc),i=r);const s=this.getFieldEntities(!0),l=p=>p.isFieldTouched();if(!o)return i?s.every(p=>l(p)||p.isList()):s.some(l);const c=new g_;o.forEach(p=>{c.set(p,[])}),s.forEach(p=>{const h=p.getNamePath();o.forEach(m=>{m.every((g,y)=>h[y]===g)&&c.update(m,g=>[...g,p])})});const u=p=>p.some(l),d=c.map(({value:p})=>p);return i?d.every(u):d.some(u)});ze(this,"isFieldTouched",t=>(this.warningUnhooked(),this.isFieldsTouched([t])));ze(this,"isFieldsValidating",t=>{this.warningUnhooked();const n=this.getFieldEntities();if(!t)return n.some(o=>o.isFieldValidating());const r=t.map(Jc);return n.some(o=>{const i=o.getNamePath();return mA(r,i)&&o.isFieldValidating()})});ze(this,"isFieldValidating",t=>(this.warningUnhooked(),this.isFieldsValidating([t])));ze(this,"resetWithFieldInitialValue",(t={})=>{const n=new g_,r=this.getFieldEntities(!0);r.forEach(s=>{const{initialValue:l}=s.props,c=s.getNamePath();if(l!==void 0){const u=n.get(c)||new Set;u.add({entity:s,value:l}),n.set(c,u)}});const o=s=>{s.forEach(l=>{const{initialValue:c}=l.props;if(c!==void 0){const u=l.getNamePath();if(this.getInitialValue(u)!==void 0)Al(!1,`Form already set 'initialValues' with path '${u.join(".")}'. Field can not overwrite it.`);else{const p=n.get(u);if(p&&p.size>1)Al(!1,`Multiple Field with path '${u.join(".")}' set 'initialValue'. Can not decide which one to pick.`);else if(p){const h=this.getFieldValue(u);!l.isListField()&&(!t.skipExist||h===void 0)&&this.updateStore(Um(this.store,u,[...p][0].value))}}}})};let i;t.entities?i=t.entities:t.namePathList?(i=[],t.namePathList.forEach(s=>{const l=n.get(s);l&&i.push(...[...l].map(c=>c.entity))})):i=r,o(i)});ze(this,"resetFields",t=>{this.warningUnhooked();const n=this.store;if(!t){this.updateStore(B2(this.initialValues)),this.resetWithFieldInitialValue(),this.notifyObservers(n,null,{type:"reset"}),this.notifyWatch();return}const r=t.map(Jc);r.forEach(o=>{const i=this.getInitialValue(o);this.updateStore(Um(this.store,o,i))}),this.resetWithFieldInitialValue({namePathList:r}),this.notifyObservers(n,r,{type:"reset"}),this.notifyWatch(r)});ze(this,"setFields",t=>{this.warningUnhooked();const n=this.store,r=[];t.forEach(o=>{const{name:i,...s}=o,l=Jc(i);r.push(l),"value"in s&&this.updateStore(Um(this.store,l,s.value)),this.notifyObservers(n,[l],{type:"setField",data:o})}),this.notifyWatch(r)});ze(this,"getFields",()=>this.getFieldEntities(!0).map(r=>{const o=r.getNamePath(),s={...r.getMeta(),name:o,value:this.getFieldValue(o)};return Object.defineProperty(s,"originRCField",{value:!0}),s}));ze(this,"initEntityValue",t=>{const{initialValue:n}=t.props;if(n!==void 0){const r=t.getNamePath();Cp(this.store,r)===void 0&&this.updateStore(Um(this.store,r,n))}});ze(this,"isMergedPreserve",t=>(t!==void 0?t:this.preserve)??!0);ze(this,"registerField",t=>{this.fieldEntities.push(t);const n=t.getNamePath();if(this.notifyWatch([n]),t.props.initialValue!==void 0){const r=this.store;this.resetWithFieldInitialValue({entities:[t],skipExist:!0}),this.notifyObservers(r,[t.getNamePath()],{type:"valueUpdate",source:"internal"})}return(r,o,i=[])=>{if(this.fieldEntities=this.fieldEntities.filter(s=>s!==t),!this.isMergedPreserve(o)&&(!r||i.length>1)){const s=r?void 0:this.getInitialValue(n);if(n.length&&this.getFieldValue(n)!==s&&this.fieldEntities.every(l=>!MU(l.getNamePath(),n))){const l=this.store;this.updateStore(Um(l,n,s,!0)),this.notifyObservers(l,[n],{type:"remove"}),this.triggerDependenciesUpdate(l,n)}}this.notifyWatch([n])}});ze(this,"dispatch",t=>{switch(t.type){case"updateValue":{const{namePath:n,value:r}=t;this.updateValue(n,r);break}case"validateField":{const{namePath:n,triggerName:r}=t;this.validateFields([n],{triggerName:r});break}}});ze(this,"notifyObservers",(t,n,r)=>{if(this.subscribable){const o={...r,store:this.getFieldsValue(!0)};this.getFieldEntities().forEach(({onStoreChange:i})=>{i(t,n,o)})}else this.forceRootUpdate()});ze(this,"triggerDependenciesUpdate",(t,n)=>{const r=this.getDependencyChildrenFields(n);return r.length&&this.validateFields(r),this.notifyObservers(t,r,{type:"dependenciesUpdate",relatedFields:[n,...r]}),r});ze(this,"updateValue",(t,n)=>{const r=Jc(t),o=this.store;this.updateStore(Um(this.store,r,n)),this.notifyObservers(o,[r],{type:"valueUpdate",source:"internal"}),this.notifyWatch([r]);const i=this.triggerDependenciesUpdate(o,r),{onValuesChange:s}=this.callbacks;if(s){const l=this.getFieldsMap(!0).get(r),c=OOe(this.store,[r]),u=this.getFieldsValue(),d=vit([u,c],{prepareArray:p=>l!=null&&l.isList()?[]:[...p||[]]});s(c,d)}this.triggerOnFieldsChange([r,...i])});ze(this,"setFieldsValue",t=>{this.warningUnhooked();const n=this.store;if(t){const r=B2(this.store,t);this.updateStore(r)}this.notifyObservers(n,null,{type:"valueUpdate",source:"external"}),this.notifyWatch()});ze(this,"setFieldValue",(t,n)=>{this.setFields([{name:t,value:n,errors:[],warnings:[],touched:!0}])});ze(this,"getDependencyChildrenFields",t=>{const n=new Set,r=[],o=new g_;this.getFieldEntities().forEach(s=>{const{dependencies:l}=s.props;(l||[]).forEach(c=>{const u=Jc(c);o.update(u,(d=new Set)=>(d.add(s),d))})});const i=s=>{(o.get(s)||new Set).forEach(c=>{if(!n.has(c)){n.add(c);const u=c.getNamePath();c.isFieldDirty()&&u.length&&(r.push(u),i(u))}})};return i(t),r});ze(this,"triggerOnFieldsChange",(t,n)=>{const{onFieldsChange:r}=this.callbacks;if(r){const o=this.getFields();if(n){const s=new g_;n.forEach(({name:l,errors:c})=>{s.set(l,c)}),o.forEach(l=>{l.errors=s.get(l.name)||l.errors})}const i=o.filter(({name:s})=>mA(t,s));i.length&&r(i,o)}});ze(this,"validateFields",(t,n)=>{this.warningUnhooked();let r,o;Array.isArray(t)||typeof t=="string"||typeof n=="string"?(r=t,o=n):o=t;const i=!!r,s=i?r.map(Jc):[],l=[...s],c=[],u=String(Date.now()),d=new Set,{recursive:p,dirty:h}=o||{};this.getFieldEntities(!0).forEach(x=>{const v=x.getNamePath();if(i||((!x.isList()||!s.some(b=>MU(b,v,!0)))&&l.push(v),s.push(v)),!(!x.props.rules||!x.props.rules.length)&&!(h&&!x.isFieldDirty())&&(d.add(v.join(u)),!i||mA(s,v,p))){const b=x.validateRules({validateMessages:{...dst,...this.validateMessages},...o});c.push(b.then(()=>({name:v,errors:[],warnings:[]})).catch(w=>{var N;const S=[],C=[];return(N=w.forEach)==null||N.call(w,({rule:{warningOnly:j},errors:I})=>{j?C.push(...I):S.push(...I)}),S.length?Promise.reject({name:v,errors:S,warnings:C}):{name:v,errors:S,warnings:C}}))}});const m=dDn(c);this.lastValidatePromise=m,m.catch(x=>x).then(x=>{const v=x.map(({name:b})=>b);this.notifyObservers(this.store,v,{type:"validateFinish"}),this.triggerOnFieldsChange(v,x)});const g=m.then(()=>this.lastValidatePromise===m?Promise.resolve(this.getFieldsValue(l)):Promise.reject([])).catch(x=>{var w,S;const v=x.filter(C=>C&&C.errors.length),b=(S=(w=v[0])==null?void 0:w.errors)==null?void 0:S[0];return Promise.reject({message:b,values:this.getFieldsValue(s),errorFields:v,outOfDate:this.lastValidatePromise!==m})});g.catch(x=>x);const y=s.filter(x=>d.has(x.join(u)));return this.triggerOnFieldsChange(y),g});ze(this,"submit",()=>{this.warningUnhooked(),this.validateFields().then(t=>{const{onFinish:n}=this.callbacks;if(n)try{n(t)}catch(r){console.error(r)}}).catch(t=>{const{onFinishFailed:n}=this.callbacks;n&&n(t)})});this.forceRootUpdate=t}}function Uye(e){const t=f.useRef(null),[,n]=f.useState({});if(!t.current)if(e)t.current=e;else{const r=()=>{n({})},o=new hDn(r);t.current=o.getForm()}return[t.current]}const pce=f.createContext({triggerFormChange:()=>{},triggerFormFinish:()=>{},registerForm:()=>{},unregisterForm:()=>{}}),hst=({validateMessages:e,onFormChange:t,onFormFinish:n,children:r})=>{const o=f.useContext(pce),i=f.useRef({});return f.createElement(pce.Provider,{value:{...o,validateMessages:{...o.validateMessages,...e},triggerFormChange:(s,l)=>{t&&t(s,{changedFields:l,forms:i.current}),o.triggerFormChange(s,l)},triggerFormFinish:(s,l)=>{n&&n(s,{values:l,forms:i.current}),o.triggerFormFinish(s,l)},registerForm:(s,l)=>{s&&(i.current={...i.current,[s]:l}),o.registerForm(s,l)},unregisterForm:s=>{const l={...i.current};delete l[s],i.current=l,o.unregisterForm(s)}}},r)};function hce(){return hce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const x=f.useRef(null),v=f.useContext(pce),[b]=Uye(r),{useSubscribe:w,setInitialValues:S,setCallbacks:C,setValidateMessages:N,setPreserve:j,destroyForm:I}=b.getInternalHooks(iE);f.useImperativeHandle(y,()=>({...b,nativeElement:x.current})),f.useEffect(()=>(v.registerForm(e,b),()=>{v.unregisterForm(e)}),[v,b,e]),N({...v.validateMessages,...l}),C({onValuesChange:u,onFieldsChange:($,...D)=>{v.triggerFormChange(e,$),d&&d($,...D)},onFinish:$=>{v.triggerFormFinish(e,$),p&&p($)},onFinishFailed:h}),j(o);const _=f.useRef(null);S(t,!_.current),_.current||(_.current=!0),f.useEffect(()=>()=>I(m),[]);let T;const P=typeof i=="function";if(P){const $=b.getFieldsValue(!0);T=i($,b)}else T=i;w(!P);const E=f.useRef(null);f.useEffect(()=>{cDn(E.current||[],n||[])||b.setFields(n||[]),E.current=n},[n,b]);const M=f.useMemo(()=>({...b,validateTrigger:c}),[b,c]),R=f.createElement(p$.Provider,{value:null},f.createElement(wI.Provider,{value:M},T));return s===!1?R:f.createElement(s,hce({},g,{ref:x,onSubmit:$=>{$.preventDefault(),$.stopPropagation(),b.submit()},onReset:$=>{var D;$.preventDefault(),b.resetFields(),(D=g.onReset)==null||D.call(g,$)}}),R)};function ote(e){try{return JSON.stringify(e)}catch{return Math.random()}}function mst(...e){const[t,n={}]=e,r=I$n(n)?{form:n}:n,o=r.form,[i,s]=f.useState(()=>typeof t=="function"?t({}):void 0),l=f.useMemo(()=>ote(i),[i]),c=f.useRef(l);c.current=l;const u=f.useContext(wI),d=o||u,p=d&&d._init,{getFieldsValue:h,getInternalHooks:m}=d,{registerWatch:g}=m(iE),y=Vr((v,b)=>{const w=r.preserve?b??h(!0):v??h(),S=typeof t=="function"?t(w):Cp(w,Jc(t));ote(i)!==ote(S)&&s(S)}),x=typeof t=="function"?t:JSON.stringify(t);return f.useEffect(()=>{p&&y()},[p,x]),f.useEffect(()=>p?g((b,w)=>{y(b,w)}):void 0,[p]),i}const gDn=f.forwardRef(mDn),Lk=gDn;Lk.FormProvider=hst;Lk.Field=Vye;Lk.List=pst;Lk.useForm=Uye;Lk.useWatch=mst;const Cw=f.createContext({labelAlign:"right",layout:"horizontal",itemRef:()=>{}}),gst=f.createContext(null),xst=e=>{const t=za(e,["prefixCls"]);return f.createElement(hst,{...t})},Wye=f.createContext({prefixCls:""}),mf=f.createContext({}),yst=({children:e,status:t,override:n})=>{const r=f.useContext(mf),o=f.useMemo(()=>{const i={...r};return n&&delete i.isFormItemInput,t&&(delete i.status,delete i.hasFeedback,delete i.feedbackIcon),i},[t,n,r]);return f.createElement(mf.Provider,{value:o},e)},vst=f.createContext(void 0),Nw=e=>{const{space:t,form:n,children:r}=e;if(!ll(r))return null;let o=r;return n&&(o=Ie.createElement(yst,{override:!0,status:!0},o)),t&&(o=Ie.createElement(p3n,null,o)),o},xDn=e=>{if(Ih()&&window.document.documentElement){const t=Array.isArray(e)?e:[e],{documentElement:n}=window.document;return t.some(r=>r in n.style)}return!1};function DOe(e,t){return xDn(e)}const yDn=()=>Ih()&&window.document.documentElement;function bst(e,t,n){return f.useMemo(()=>({...{trap:t??!0,focusTriggerAfterClose:n??!0},...e}),[e,t,n])}const BK=e=>{const{prefixCls:t,className:n,style:r,size:o,shape:i}=e,s=be({[`${t}-lg`]:o==="large",[`${t}-sm`]:o==="small"}),l=be({[`${t}-circle`]:i==="circle",[`${t}-square`]:i==="square",[`${t}-round`]:i==="round"}),c=f.useMemo(()=>typeof o=="number"?{width:o,height:o,lineHeight:`${o}px`}:{},[o]);return f.createElement("span",{className:be(t,s,l,n),style:{...c,...r}})},vDn=new Go("ant-skeleton-loading",{"0%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),Gye=e=>({height:e,lineHeight:Xe(e)}),cC=e=>({width:e,...Gye(e)}),bDn=e=>({background:e.skeletonLoadingBackground,backgroundSize:"400% 100%",animationName:vDn,animationDuration:e.skeletonLoadingMotionDuration,animationTimingFunction:"ease",animationIterationCount:"infinite"}),ite=(e,t)=>({width:t(e).mul(5).equal(),minWidth:t(e).mul(5).equal(),...Gye(e)}),wDn=e=>{const{skeletonAvatarCls:t,gradientFromColor:n,controlHeight:r,controlHeightLG:o,controlHeightSM:i}=e;return{[t]:{display:"inline-block",verticalAlign:"top",background:n,...cC(r)},[`${t}${t}-circle`]:{borderRadius:"50%"},[`${t}${t}-lg`]:{...cC(o)},[`${t}${t}-sm`]:{...cC(i)}}},SDn=e=>{const{controlHeight:t,borderRadiusSM:n,skeletonInputCls:r,controlHeightLG:o,controlHeightSM:i,gradientFromColor:s,calc:l}=e;return{[r]:{display:"inline-block",verticalAlign:"top",background:s,borderRadius:n,...ite(t,l)},[`${r}-lg`]:{...ite(o,l)},[`${r}-sm`]:{...ite(i,l)}}},wst=e=>{const{gradientFromColor:t,borderRadiusSM:n,imageSizeBase:r,calc:o}=e;return{display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"middle",background:t,borderRadius:n,...cC(o(r).mul(2).equal())}},CDn=e=>({[e.skeletonNodeCls]:{...wst(e)}}),NDn=e=>{const{skeletonImageCls:t,imageSizeBase:n,calc:r}=e;return{[t]:{...wst(e),[`${t}-path`]:{fill:"#bfbfbf"},[`${t}-svg`]:{...cC(n),maxWidth:r(n).mul(4).equal(),maxHeight:r(n).mul(4).equal()},[`${t}-svg${t}-svg-circle`]:{borderRadius:"50%"}},[`${t}${t}-circle`]:{borderRadius:"50%"}}},ate=(e,t,n)=>{const{skeletonButtonCls:r}=e;return{[`${n}${r}-circle`]:{width:t,minWidth:t,borderRadius:"50%"},[`${n}${r}-round`]:{borderRadius:t}}},ste=(e,t)=>({width:t(e).mul(2).equal(),minWidth:t(e).mul(2).equal(),...Gye(e)}),jDn=e=>{const{borderRadiusSM:t,skeletonButtonCls:n,controlHeight:r,controlHeightLG:o,controlHeightSM:i,gradientFromColor:s,calc:l}=e;return{[n]:{display:"inline-block",verticalAlign:"top",background:s,borderRadius:t,width:l(r).mul(2).equal(),minWidth:l(r).mul(2).equal(),...ste(r,l)},...ate(e,r,n),[`${n}-lg`]:{...ste(o,l)},...ate(e,o,`${n}-lg`),[`${n}-sm`]:{...ste(i,l)},...ate(e,i,`${n}-sm`)}},EDn=e=>{const{componentCls:t,skeletonAvatarCls:n,skeletonTitleCls:r,skeletonParagraphCls:o,skeletonButtonCls:i,skeletonInputCls:s,skeletonNodeCls:l,skeletonImageCls:c,controlHeight:u,controlHeightLG:d,controlHeightSM:p,gradientFromColor:h,padding:m,marginSM:g,borderRadius:y,titleHeight:x,blockRadius:v,paragraphLiHeight:b,controlHeightXS:w,paragraphMarginTop:S}=e;return{[t]:{display:"table",width:"100%",[`${t}-header`]:{display:"table-cell",paddingInlineEnd:m,verticalAlign:"top",[n]:{display:"inline-block",verticalAlign:"top",background:h,...cC(u)},[`${n}-circle`]:{borderRadius:"50%"},[`${n}-lg`]:{...cC(d)},[`${n}-sm`]:{...cC(p)}},[`${t}-section`]:{display:"table-cell",width:"100%",verticalAlign:"top",[r]:{width:"100%",height:x,background:h,borderRadius:v,[`+ ${o}`]:{marginBlockStart:p}},[o]:{padding:0,"> li":{width:"100%",height:b,listStyle:"none",background:h,borderRadius:v,"+ li":{marginBlockStart:w}}},[`${o}> li:last-child:not(:first-child):not(:nth-child(2))`]:{width:"61%"}},[`&-round ${t}-section`]:{[`${r}, ${o} > li`]:{borderRadius:y}}},[`${t}-with-avatar ${t}-section`]:{[r]:{marginBlockStart:g,[`+ ${o}`]:{marginBlockStart:S}}},[`${t}${t}-element`]:{display:"inline-block",width:"auto",...jDn(e),...wDn(e),...SDn(e),...CDn(e),...NDn(e)},[`${t}${t}-block`]:{width:"100%",[i]:{width:"100%"},[s]:{width:"100%"}},[`${t}${t}-active`]:{[` ${r}, ${o} > li, ${n}, ${i}, ${s}, ${l}, ${c} `]:{...bDn(e)}}}},IDn=e=>{const{colorFillContent:t,colorFill:n}=e,r=t,o=n;return{color:r,colorGradientEnd:o,gradientFromColor:r,gradientToColor:o,titleHeight:e.controlHeight/2,blockRadius:e.borderRadiusSM,paragraphMarginTop:e.marginLG+e.marginXXS,paragraphLiHeight:e.controlHeight/2}},c6=ui("Skeleton",e=>{const{componentCls:t,calc:n}=e,r=Ho(e,{skeletonAvatarCls:`${t}-avatar`,skeletonTitleCls:`${t}-title`,skeletonParagraphCls:`${t}-paragraph`,skeletonButtonCls:`${t}-button`,skeletonInputCls:`${t}-input`,skeletonNodeCls:`${t}-node`,skeletonImageCls:`${t}-image`,imageSizeBase:n(e.controlHeight).mul(1.5).equal(),borderRadius:100,skeletonLoadingBackground:`linear-gradient(90deg, ${e.gradientFromColor} 25%, ${e.gradientToColor} 37%, ${e.gradientFromColor} 63%)`,skeletonLoadingMotionDuration:"1.4s"});return EDn(r)},IDn,{deprecatedTokens:[["color","gradientFromColor"],["colorGradientEnd","gradientToColor"]]}),_Dn=e=>{const{prefixCls:t,className:n,classNames:r,rootClassName:o,active:i,style:s,styles:l,shape:c="circle",size:u="default",...d}=e,{getPrefixCls:p}=f.useContext(Qr),h=p("skeleton",t),[m,g]=c6(h),y=be(h,`${h}-element`,{[`${h}-active`]:i},r==null?void 0:r.root,n,o,m,g);return f.createElement("div",{className:y,style:l==null?void 0:l.root},f.createElement(BK,{prefixCls:`${h}-avatar`,className:r==null?void 0:r.content,style:{...l==null?void 0:l.content,...s},shape:c,size:u,...d}))},PDn=e=>{const{prefixCls:t,className:n,rootClassName:r,classNames:o,active:i,style:s,styles:l,block:c=!1,size:u="default",...d}=e,{getPrefixCls:p}=f.useContext(Qr),h=p("skeleton",t),[m,g]=c6(h),y=be(h,`${h}-element`,{[`${h}-active`]:i,[`${h}-block`]:c},o==null?void 0:o.root,n,r,m,g);return f.createElement("div",{className:y,style:l==null?void 0:l.root},f.createElement(BK,{prefixCls:`${h}-button`,className:o==null?void 0:o.content,style:{...l==null?void 0:l.content,...s},size:u,...d}))},Sst=e=>{const{prefixCls:t,className:n,classNames:r,rootClassName:o,internalClassName:i,style:s,styles:l,active:c,children:u}=e,{getPrefixCls:d}=f.useContext(Qr),p=d("skeleton",t),[h,m]=c6(p),g=be(p,`${p}-element`,{[`${p}-active`]:c},h,r==null?void 0:r.root,n,o,m);return f.createElement("div",{className:g,style:l==null?void 0:l.root},f.createElement("div",{className:be(r==null?void 0:r.content,i||`${p}-node`),style:{...l==null?void 0:l.content,...s}},u))},ADn="M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",TDn=e=>{const{getPrefixCls:t}=f.useContext(Qr),n=t("skeleton",e.prefixCls);return f.createElement(Sst,{...e,internalClassName:`${n}-image`},f.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:`${n}-image-svg`},f.createElement("title",null,"Image placeholder"),f.createElement("path",{d:ADn,className:`${n}-image-path`})))},kDn=e=>{const{prefixCls:t,className:n,classNames:r,rootClassName:o,active:i,block:s,style:l,styles:c,size:u="default",...d}=e,{getPrefixCls:p}=f.useContext(Qr),h=p("skeleton",t),[m,g]=c6(h),y=be(h,`${h}-element`,{[`${h}-active`]:i,[`${h}-block`]:s},r==null?void 0:r.root,n,o,m,g);return f.createElement("div",{className:y,style:c==null?void 0:c.root},f.createElement(BK,{prefixCls:`${h}-input`,className:r==null?void 0:r.content,style:{...c==null?void 0:c.content,...l},size:u,...d}))},MDn=(e,t)=>{const{width:n,rows:r=2}=t;if(Array.isArray(n))return n[e];if(r-1===e)return n},RDn=e=>{const{prefixCls:t,className:n,style:r,rows:o=0}=e,i=Array.from({length:o}).map((s,l)=>f.createElement("li",{key:l,style:{width:MDn(l,e)}}));return f.createElement("ul",{className:be(t,n),style:r},i)},ODn=({prefixCls:e,className:t,width:n,style:r})=>f.createElement("h3",{className:be(e,t),style:{width:n,...r}});function lte(e){return e&&typeof e=="object"?e:{}}function $Dn(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}function DDn(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}function LDn(e,t){const n={};return(!e||!t)&&(n.width="61%"),!e&&t?n.rows=3:n.rows=2,n}const eS=e=>{const{prefixCls:t,loading:n,className:r,rootClassName:o,classNames:i,style:s,styles:l,children:c,avatar:u=!1,title:d=!0,paragraph:p=!0,active:h,round:m}=e,{getPrefixCls:g,direction:y,className:x,style:v,classNames:b,styles:w}=Zo("skeleton"),S=g("skeleton",t),[C,N]=c6(S),j={...e,avatar:u,title:d,paragraph:p},[I,_]=di([b,i],[w,l],{props:j});if(n||!("loading"in e)){const T=!!u,P=!!d,E=!!p;let M;if(T){const D={className:I.avatar,prefixCls:`${S}-avatar`,...$Dn(P,E),...lte(u),style:_.avatar};M=f.createElement("div",{className:be(I.header,`${S}-header`),style:_.header},f.createElement(BK,{...D}))}let R;if(P||E){let D;if(P){const V={className:I.title,prefixCls:`${S}-title`,...DDn(T,E),...lte(d),style:_.title};D=f.createElement(ODn,{...V})}let z;if(E){const V={className:I.paragraph,prefixCls:`${S}-paragraph`,...LDn(T,P),...lte(p),style:_.paragraph};z=f.createElement(RDn,{...V})}R=f.createElement("div",{className:be(I.section,`${S}-section`),style:_.section},D,z)}const $=be(S,{[`${S}-with-avatar`]:T,[`${S}-active`]:h,[`${S}-rtl`]:y==="rtl",[`${S}-round`]:m},I.root,x,r,o,C,N);return f.createElement("div",{className:$,style:{..._.root,...v,...s}},M,R)}return c??null};eS.Button=PDn;eS.Avatar=_Dn;eS.Input=kDn;eS.Image=TDn;eS.Node=Sst;function LOe(){}const FDn=f.createContext({add:LOe,remove:LOe});function Cst(e){const t=f.useContext(FDn),n=f.useRef(null);return Vr(o=>{if(o){const i=e?o.querySelector(e):o;i&&(t.add(i),n.current=i)}else t.remove(n.current)})}const FOe=()=>{const{cancelButtonProps:e,cancelTextLocale:t,onCancel:n}=f.useContext(s6);return Ie.createElement(Ls,{onClick:n,...e},t)},zOe=()=>{const{confirmLoading:e,okButtonProps:t,okType:n,okTextLocale:r,onOk:o}=f.useContext(s6);return Ie.createElement(Ls,{...Qat(n),loading:e,onClick:o,...t},r)};function Nst(e,t){return Ie.createElement("span",{className:`${e}-close-x`},t||Ie.createElement(_y,{className:`${e}-close-icon`}))}const jst=e=>{const{okText:t,okType:n="primary",cancelText:r,confirmLoading:o,onOk:i,onCancel:s,okButtonProps:l,cancelButtonProps:c,footer:u}=e,[d]=xg("Modal",xat()),p=t||(d==null?void 0:d.okText),h=r||(d==null?void 0:d.cancelText),m=Ie.useMemo(()=>({confirmLoading:o,okButtonProps:l,cancelButtonProps:c,okTextLocale:p,cancelTextLocale:h,okType:n,onOk:i,onCancel:s}),[o,l,c,p,h,n,i,s]);let g;return typeof u=="function"||typeof u>"u"?(g=Ie.createElement(Ie.Fragment,null,Ie.createElement(FOe,null),Ie.createElement(zOe,null)),typeof u=="function"&&(g=u(g,{OkBtn:zOe,CancelBtn:FOe})),g=Ie.createElement(ost,{value:m},g)):g=u,Ie.createElement(Oye,{disabled:!1},g)},zDn=e=>{const{componentCls:t}=e;return{[t]:{display:"flex",flexFlow:"row wrap",minWidth:0,"&::before, &::after":{display:"flex"},"&-no-wrap":{flexWrap:"nowrap"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"},"&-space-between":{justifyContent:"space-between"},"&-space-around":{justifyContent:"space-around"},"&-space-evenly":{justifyContent:"space-evenly"},"&-top":{alignItems:"flex-start"},"&-middle":{alignItems:"center"},"&-bottom":{alignItems:"flex-end"}}}},BDn=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",maxWidth:"100%",minHeight:1}}},HDn=(e,t)=>{const{componentCls:n,gridColumns:r,antCls:o}=e,[i,s]=bi(o,"grid"),[,l]=bi(o,"col"),c={};for(let u=r;u>=0;u--)u===0?(c[`${n}${t}-${u}`]={display:"none"},c[`${n}-push-${u}`]={insetInlineStart:"auto"},c[`${n}-pull-${u}`]={insetInlineEnd:"auto"},c[`${n}${t}-push-${u}`]={insetInlineStart:"auto"},c[`${n}${t}-pull-${u}`]={insetInlineEnd:"auto"},c[`${n}${t}-offset-${u}`]={marginInlineStart:0},c[`${n}${t}-order-${u}`]={order:0}):(c[`${n}${t}-${u}`]=[{[i("display")]:"block",display:"block"},{display:s("display"),flex:`0 0 ${u/r*100}%`,maxWidth:`${u/r*100}%`}],c[`${n}${t}-push-${u}`]={insetInlineStart:`${u/r*100}%`},c[`${n}${t}-pull-${u}`]={insetInlineEnd:`${u/r*100}%`},c[`${n}${t}-offset-${u}`]={marginInlineStart:`${u/r*100}%`},c[`${n}${t}-order-${u}`]={order:u});return c[`${n}${t}-flex`]={flex:l(`${t.replace(/-/,"")}-flex`)},c},mce=(e,t)=>HDn(e,t),VDn=(e,t,n)=>({[`@media (min-width: ${Xe(t)})`]:{...mce(e,n)}}),UDn=()=>({}),WDn=()=>({}),GDn=ui("Grid",zDn,UDn),Est=e=>({xs:e.screenXSMin,sm:e.screenSMMin,md:e.screenMDMin,lg:e.screenLGMin,xl:e.screenXLMin,xxl:e.screenXXLMin}),qDn=ui("Grid",e=>{const t=Ho(e,{gridColumns:24}),n=Est(t);return delete n.xs,[BDn(t),mce(t,""),mce(t,"-xs"),Object.keys(n).map(r=>VDn(t,n[r],`-${r}`)).reduce((r,o)=>({...r,...o}),{})]},WDn);function BOe(e){return{position:e,inset:0}}const KDn=e=>{const{componentCls:t,antCls:n}=e;return[{[`${t}-root`]:{[`${t}${n}-zoom-enter, ${t}${n}-zoom-appear`]:{transform:"none",opacity:0,animationDuration:e.motionDurationSlow,userSelect:"none"},[`${t}${n}-zoom-leave ${t}-container`]:{pointerEvents:"none"},[`${t}-mask`]:{...BOe("fixed"),zIndex:e.zIndexPopupBase,height:"100%",backgroundColor:e.colorBgMask,pointerEvents:"none",[`&${t}-mask-blur`]:{backdropFilter:"blur(4px)"},[`${t}-hidden`]:{display:"none"}},[`${t}-wrap`]:{...BOe("fixed"),zIndex:e.zIndexPopupBase,overflow:"auto",outline:0,WebkitOverflowScrolling:"touch"}}},{[`${t}-root`]:Zat(e)}]},YDn=e=>{const{componentCls:t}=e;return[{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl"},[`${t}-centered`]:{textAlign:"center","&::before":{display:"inline-block",width:0,height:"100%",verticalAlign:"middle",content:'""'},[t]:{top:0,display:"inline-block",paddingBottom:0,textAlign:"start",verticalAlign:"middle"}},[`@media (max-width: ${e.screenSMMax}px)`]:{[t]:{maxWidth:"calc(100vw - 16px)",margin:`${Xe(e.marginXS)} auto`},[`${t}-centered`]:{[t]:{flex:1}}}}},{[t]:{...Ii(e),pointerEvents:"none",position:"relative",top:100,width:"auto",maxWidth:`calc(100vw - ${Xe(e.calc(e.margin).mul(2).equal())})`,margin:"0 auto","&:focus-visible":{borderRadius:e.borderRadiusLG,...my(e)},[`${t}-title`]:{margin:0,color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.titleFontSize,lineHeight:e.titleLineHeight,wordWrap:"break-word"},[`${t}-container`]:{position:"relative",backgroundColor:e.contentBg,backgroundClip:"padding-box",border:0,borderRadius:e.borderRadiusLG,boxShadow:e.boxShadow,pointerEvents:"auto",padding:e.contentPadding},[`${t}-close`]:{position:"absolute",top:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),insetInlineEnd:e.calc(e.modalHeaderHeight).sub(e.modalCloseBtnSize).div(2).equal(),zIndex:e.calc(e.zIndexPopupBase).add(10).equal(),padding:0,color:e.modalCloseIconColor,fontWeight:e.fontWeightStrong,lineHeight:1,textDecoration:"none",background:"transparent",borderRadius:e.borderRadiusSM,width:e.modalCloseBtnSize,height:e.modalCloseBtnSize,border:0,outline:0,cursor:"pointer",transition:`color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`,"&-x":{display:"flex",fontSize:e.fontSizeLG,fontStyle:"normal",lineHeight:Xe(e.modalCloseBtnSize),justifyContent:"center",textTransform:"none",textRendering:"auto"},"&:disabled":{pointerEvents:"none"},"&:hover":{color:e.modalCloseIconHoverColor,backgroundColor:e.colorBgTextHover,textDecoration:"none"},"&:active":{backgroundColor:e.colorBgTextActive},...gy(e)},[`${t}-header`]:{color:e.colorText,background:e.headerBg,borderRadius:`${Xe(e.borderRadiusLG)} ${Xe(e.borderRadiusLG)} 0 0`,marginBottom:e.headerMarginBottom,padding:e.headerPadding,borderBottom:e.headerBorderBottom},[`${t}-body`]:{fontSize:e.fontSize,lineHeight:e.lineHeight,wordWrap:"break-word",padding:e.bodyPadding,[`${t}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",margin:`${Xe(e.margin)} auto`}},[`${t}-footer`]:{textAlign:"end",background:e.footerBg,marginTop:e.footerMarginTop,padding:e.footerPadding,borderTop:e.footerBorderTop,borderRadius:e.footerBorderRadius,[`> ${e.antCls}-btn + ${e.antCls}-btn`]:{marginInlineStart:e.marginXS}},[`${t}-open`]:{overflow:"hidden"}}},{[`${t}-pure-panel`]:{top:"auto",padding:0,display:"flex",flexDirection:"column",[`${t}-container, ${t}-body, ${t}-confirm-body-wrapper`]:{display:"flex",flexDirection:"column",flex:"auto"},[`${t}-confirm-body`]:{marginBottom:"auto"}}}]},XDn=e=>{const{componentCls:t}=e;return{[`${t}-root`]:{[`${t}-wrap-rtl`]:{direction:"rtl",[`${t}-confirm-body`]:{direction:"rtl"}}}}},QDn=e=>{const{componentCls:t}=e,n=Est(e),r={...n};delete r.xs;const o=`--${t.replace(".","")}-`,i=Object.keys(r).map(s=>({[`@media (min-width: ${Xe(r[s])})`]:{width:`var(${o}${s}-width)`}}));return{[`${t}-root`]:{[t]:[].concat(go(Object.keys(n).map((s,l)=>{const c=Object.keys(n)[l-1];return c?{[`${o}${s}-width`]:`var(${o}${c}-width)`}:null})),[{width:`var(${o}xs-width)`}],go(i))}}},Ist=e=>{const t=e.padding,n=e.fontSizeHeading5,r=e.lineHeightHeading5;return Ho(e,{modalHeaderHeight:e.calc(e.calc(r).mul(n).equal()).add(e.calc(t).mul(2).equal()).equal(),modalFooterBorderColorSplit:e.colorSplit,modalFooterBorderStyle:e.lineType,modalFooterBorderWidth:e.lineWidth,modalCloseIconColor:e.colorIcon,modalCloseIconHoverColor:e.colorIconHover,modalCloseBtnSize:e.controlHeight,modalConfirmIconSize:e.fontHeight,modalTitleHeight:e.calc(e.titleFontSize).mul(e.titleLineHeight).equal()})},_st=e=>({footerBg:"transparent",headerBg:"transparent",titleLineHeight:e.lineHeightHeading5,titleFontSize:e.fontSizeHeading5,contentBg:e.colorBgElevated,titleColor:e.colorTextHeading,contentPadding:e.wireframe?0:`${Xe(e.paddingMD)} ${Xe(e.paddingContentHorizontalLG)}`,headerPadding:e.wireframe?`${Xe(e.padding)} ${Xe(e.paddingLG)}`:0,headerBorderBottom:e.wireframe?`${Xe(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:"none",headerMarginBottom:e.wireframe?0:e.marginXS,bodyPadding:e.wireframe?e.paddingLG:0,footerPadding:e.wireframe?`${Xe(e.paddingXS)} ${Xe(e.padding)}`:0,footerBorderTop:e.wireframe?`${Xe(e.lineWidth)} ${e.lineType} ${e.colorSplit}`:"none",footerBorderRadius:e.wireframe?`0 0 ${Xe(e.borderRadiusLG)} ${Xe(e.borderRadiusLG)}`:0,footerMarginTop:e.wireframe?0:e.marginSM,confirmBodyPadding:e.wireframe?`${Xe(e.padding*2)} ${Xe(e.padding*2)} ${Xe(e.paddingLG)}`:0,confirmIconMarginInlineEnd:e.wireframe?e.margin:e.marginSM,confirmBtnsMarginTop:e.wireframe?e.marginLG:e.marginSM,mask:!0}),Pst=ui("Modal",e=>{const t=Ist(e);return[YDn(t),XDn(t),KDn(t),i6(t,"zoom"),QDn(t)]},_st,{unitless:{titleLineHeight:!0}});let gce;const JDn=e=>{gce={x:e.pageX,y:e.pageY},setTimeout(()=>{gce=null},100)};yDn()&&document.documentElement.addEventListener("click",JDn,!0);const Ast=e=>{const{prefixCls:t,className:n,rootClassName:r,open:o,wrapClassName:i,centered:s,getContainer:l,style:c,width:u=520,footer:d,classNames:p,styles:h,children:m,loading:g,confirmLoading:y,zIndex:x,mousePosition:v,onOk:b,onCancel:w,okButtonProps:S,cancelButtonProps:C,destroyOnHidden:N,destroyOnClose:j,panelRef:I=null,closable:_,mask:T,modalRender:P,focusTriggerAfterClose:E,focusable:M,...R}=e,{getPopupContainer:$,getPrefixCls:D,direction:z,className:V,style:B,classNames:G,styles:H,centered:F,cancelButtonProps:W,okButtonProps:U,mask:K}=Zo("modal"),{modal:X}=f.useContext(Qr),[J,te]=f.useMemo(()=>typeof _=="boolean"?[void 0,void 0]:[_==null?void 0:_.afterClose,_==null?void 0:_.onClose],[_]),re=D("modal",t),ce=D(),[ae,oe]=wat(T,K,re),ue=bst(M,ae,E),fe=Ct=>{y||(w==null||w(Ct),te==null||te())},se=Ct=>{b==null||b(Ct),te==null||te()},ge=pl(re),[ye,de]=Pst(re,ge),Ne=be(i,{[`${re}-centered`]:s??F,[`${re}-wrap-rtl`]:z==="rtl"}),_e=d!==null&&!g?f.createElement(jst,{...e,okButtonProps:{...U,...S},onOk:se,cancelButtonProps:{...W,...C},onCancel:fe}):null,[xe,we,Te,Re]=TK(mb(e),mb(X),{closable:!0,closeIcon:f.createElement(_y,{className:`${re}-close-icon`}),closeIconRender:Ct=>Nst(re,Ct)}),Ue=xe?{disabled:Te,closeIcon:we,afterClose:J,...Re}:!1,He=P?Ct=>f.createElement("div",{className:`${re}-render`},P(Ct)):void 0,Ye=`.${re}-${P?"render":"container"}`,We=Cst(Ye),at=zd(I,We),[Oe,Ae]=sN("Modal",x),qe={...e,width:u,panelRef:I,focusTriggerAfterClose:ue.focusTriggerAfterClose,focusable:ue,mask:ae,zIndex:Oe},[dt,Ze]=di([G,p,oe],[H,h],{props:qe}),[Qe,lt]=f.useMemo(()=>u&&typeof u=="object"?[void 0,u]:[u,void 0],[u]),bt=f.useMemo(()=>{const Ct={};return lt&&Object.keys(lt).forEach(Je=>{const Pe=lt[Je];Pe!==void 0&&(Ct[`--${re}-${Je}-width`]=typeof Pe=="number"?`${Pe}px`:Pe)}),Ct},[re,lt]);return f.createElement(Nw,{form:!0,space:!0},f.createElement(ZL.Provider,{value:Ae},f.createElement(E$n,{width:Qe,...R,zIndex:Oe,getContainer:l===void 0?$:l,prefixCls:re,rootClassName:be(ye,r,de,ge,dt.root),rootStyle:Ze.root,footer:_e,visible:o,mousePosition:v??gce,onClose:fe,closable:Ue,closeIcon:we,transitionName:gb(ce,"zoom",e.transitionName),maskTransitionName:gb(ce,"fade",e.maskTransitionName),mask:ae,className:be(ye,n,V),style:{...B,...c,...bt},classNames:{...dt,wrapper:be(dt.wrapper,Ne)},styles:Ze,panelRef:at,destroyOnHidden:N??j,modalRender:He,focusTriggerAfterClose:ue.focusTriggerAfterClose,focusTrap:ue.trap},g?f.createElement(eS,{active:!0,title:!1,paragraph:{rows:4},className:`${re}-body-skeleton`}):m)))},ZDn=e=>{const{componentCls:t,titleFontSize:n,titleLineHeight:r,modalConfirmIconSize:o,fontSize:i,lineHeight:s,modalTitleHeight:l,fontHeight:c,confirmBodyPadding:u}=e,d=`${t}-confirm`;return{[d]:{"&-rtl":{direction:"rtl"},[`${e.antCls}-modal-header`]:{display:"none"},[`${d}-body-wrapper`]:{...kC()},[`&${t} ${t}-body`]:{padding:u},[`${d}-body`]:{display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${e.iconCls}`]:{flex:"none",fontSize:o,marginInlineEnd:e.confirmIconMarginInlineEnd,marginTop:e.calc(e.calc(c).sub(o).equal()).div(2).equal()},[`&-has-title > ${e.iconCls}`]:{marginTop:e.calc(e.calc(l).sub(o).equal()).div(2).equal()}},[`${d}-paragraph`]:{display:"flex",flexDirection:"column",flex:"auto",rowGap:e.marginXS,maxWidth:`calc(100% - ${Xe(e.marginSM)})`},[`${e.iconCls} + ${d}-paragraph`]:{maxWidth:`calc(100% - ${Xe(e.calc(e.modalConfirmIconSize).add(e.marginSM).equal())})`},[`${d}-title`]:{color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:n,lineHeight:r},[`${d}-container`]:{color:e.colorText,fontSize:i,lineHeight:s},[`${d}-btns`]:{textAlign:"end",marginTop:e.confirmBtnsMarginTop,[`${e.antCls}-btn + ${e.antCls}-btn`]:{marginBottom:0,marginInlineStart:e.marginXS}}},[`${d}-error ${d}-body > ${e.iconCls}`]:{color:e.colorError},[`${d}-warning ${d}-body > ${e.iconCls}, ${d}-confirm ${d}-body > ${e.iconCls}`]:{color:e.colorWarning},[`${d}-info ${d}-body > ${e.iconCls}`]:{color:e.colorInfo},[`${d}-success ${d}-body > ${e.iconCls}`]:{color:e.colorSuccess}}},eLn=d5(["Modal","confirm"],e=>{const t=Ist(e);return ZDn(t)},_st,{order:-1e3}),Tst=e=>{const{prefixCls:t,icon:n,okText:r,cancelText:o,confirmPrefixCls:i,type:s,okCancel:l,footer:c,locale:u,autoFocusButton:d,focusable:p,...h}=e;let m=n;if(!n&&n!==null)switch(s){case"info":m=f.createElement(AK,null);break;case"success":m=f.createElement($k,null);break;case"error":m=f.createElement(aN,null);break;default:m=f.createElement(JL,null)}const g=l??s==="confirm",y=f.useMemo(()=>{const T=(p==null?void 0:p.autoFocusButton)||d;return T||T===null?T:"ok"},[d,p==null?void 0:p.autoFocusButton]),[x]=xg("Modal"),v=u||x,b=r||(g?v==null?void 0:v.okText:v==null?void 0:v.justOkText),w=o||(v==null?void 0:v.cancelText),{closable:S}=h,{onClose:C}=S&&typeof S=="object"?S:{},N=f.useMemo(()=>({autoFocusButton:y,cancelTextLocale:w,okTextLocale:b,mergedOkCancel:g,onClose:C,...h}),[y,w,b,g,C,h]),j=f.createElement(f.Fragment,null,f.createElement(COe,null),f.createElement(NOe,null)),I=e.title!==void 0&&e.title!==null,_=`${i}-body`;return f.createElement("div",{className:`${i}-body-wrapper`},f.createElement("div",{className:be(_,{[`${_}-has-title`]:I})},m,f.createElement("div",{className:`${i}-paragraph`},I&&f.createElement("span",{className:`${i}-title`},e.title),f.createElement("div",{className:`${i}-content`},e.content))),c===void 0||typeof c=="function"?f.createElement(ost,{value:N},f.createElement("div",{className:`${i}-btns`},typeof c=="function"?c(j,{OkBtn:NOe,CancelBtn:COe}):j)):c,f.createElement(eLn,{prefixCls:t}))},tLn=e=>{const{close:t,zIndex:n,maskStyle:r,direction:o,prefixCls:i,wrapClassName:s,rootPrefixCls:l,bodyStyle:c,closable:u=!1,onConfirm:d,styles:p,title:h,okButtonProps:m,cancelButtonProps:g}=e,{cancelButtonProps:y,okButtonProps:x}=Zo("modal"),v=`${i}-confirm`,b=e.width||416,w=e.style||{},S=be(v,`${v}-${e.type}`,{[`${v}-rtl`]:o==="rtl"},e.className),C=e.maskClosable===void 0?!1:e.maskClosable,[,N]=Xf(),j=f.useMemo(()=>n!==void 0?n:N.zIndexPopupBase+Mye,[n,N]);return f.createElement(Ast,{...e,className:S,wrapClassName:be({[`${v}-centered`]:!!e.centered},s),onCancel:()=>{t==null||t({triggerCancel:!0}),d==null||d(!1)},title:h,footer:null,transitionName:gb(l||"","zoom",e.transitionName),maskTransitionName:gb(l||"","fade",e.maskTransitionName),maskClosable:C,style:w,styles:{body:c,mask:r,...p},width:b,zIndex:j,closable:u},f.createElement(Tst,{...e,confirmPrefixCls:v,okButtonProps:{...x,...m},cancelButtonProps:{...y,...g}}))},kst=e=>{const{rootPrefixCls:t,iconPrefixCls:n,direction:r,theme:o}=e;return f.createElement(Py,{prefixCls:t,iconPrefixCls:n,direction:r,theme:o},f.createElement(tLn,{...e}))},aE=[];let Mst="";function Rst(){return Mst}const nLn=e=>{var u;const{prefixCls:t,getContainer:n,direction:r}=e,o=xat(),i=f.useContext(Qr),s=Rst()||i.getPrefixCls(),l=t||`${s}-modal`;let c=n;return c===!1&&(c=void 0),Ie.createElement(kst,{...e,rootPrefixCls:s,prefixCls:l,iconPrefixCls:i.iconPrefixCls,theme:i.theme,direction:r??i.direction,locale:((u=i.locale)==null?void 0:u.Modal)??o,getContainer:c})};function u6(e){const t=$ye(),n=document.createDocumentFragment();let r={...e,close:l,open:!0},o;function i(...u){var p;u.some(h=>h==null?void 0:h.triggerCancel)&&((p=e.onCancel)==null||p.call(e,()=>{},...u.slice(1)));for(let h=0;h{})}const s=u=>{clearTimeout(o),o=setTimeout(()=>{const d=t.getPrefixCls(void 0,Rst()),p=t.getIconPrefixCls(),h=t.getTheme(),m=Ie.createElement(nLn,{...u});RK(Ie.createElement(Py,{prefixCls:d,iconPrefixCls:p,theme:h},typeof t.holderRender=="function"?t.holderRender(m):m),n)})};function l(...u){r={...r,open:!1,afterClose:()=>{typeof e.afterClose=="function"&&e.afterClose(),i.apply(this,u)}},s(r)}function c(u){typeof u=="function"?r=u(r):r={...r,...u},s(r)}return s(r),aE.push(l),{destroy:l,update:c}}function Ost(e){return{...e,type:"warning"}}function $st(e){return{...e,type:"info"}}function Dst(e){return{...e,type:"success"}}function Lst(e){return{...e,type:"error"}}function Fst(e){return{...e,type:"confirm"}}function rLn({rootPrefixCls:e}){Mst=e}const oLn=({afterClose:e,config:t,...n},r)=>{const[o,i]=f.useState(!0),[s,l]=f.useState(t),{direction:c,getPrefixCls:u}=f.useContext(Qr),d=u("modal"),p=u(),h=()=>{var x;e(),(x=s.afterClose)==null||x.call(s)},m=(...x)=>{var b;i(!1),x.some(w=>w==null?void 0:w.triggerCancel)&&((b=s.onCancel)==null||b.call(s,()=>{},...x.slice(1)))};f.useImperativeHandle(r,()=>({destroy:m,update:x=>{l(v=>{const b=typeof x=="function"?x(v):x;return{...v,...b}})}}));const g=s.okCancel??s.type==="confirm",[y]=xg("Modal",xy.Modal);return f.createElement(kst,{prefixCls:d,rootPrefixCls:p,...s,close:m,open:o,afterClose:h,okText:s.okText||(g?y==null?void 0:y.okText:y==null?void 0:y.justOkText),direction:s.direction||c,cancelText:s.cancelText||(y==null?void 0:y.cancelText),...n})},iLn=f.forwardRef(oLn);let HOe=0;const aLn=f.memo(f.forwardRef((e,t)=>{const[n,r]=LRn();return f.useImperativeHandle(t,()=>({patchElement:r}),[r]),f.createElement(f.Fragment,null,n)}));function sLn(){const e=f.useRef(null),[t,n]=f.useState([]);f.useEffect(()=>{t.length&&(go(t).forEach(s=>{s()}),n([]))},[t]);const r=f.useCallback(i=>function(l){var y;HOe+=1;const c=f.createRef();let u;const d=new Promise(x=>{u=x});let p=!1,h;const m=f.createElement(iLn,{key:`modal-${HOe}`,config:i(l),ref:c,afterClose:()=>{h==null||h()},isSilent:()=>p,onConfirm:x=>{u(x)}});return h=(y=e.current)==null?void 0:y.patchElement(m),h&&aE.push(h),{destroy:()=>{function x(){var v;(v=c.current)==null||v.destroy()}c.current?x():n(v=>[].concat(go(v),[x]))},update:x=>{function v(){var b;(b=c.current)==null||b.update(x)}c.current?v():n(b=>[].concat(go(b),[v]))},then:x=>(p=!0,d.then(x))}},[]);return[f.useMemo(()=>({info:r($st),success:r(Dst),error:r(Lst),warning:r(Ost),confirm:r(Fst)}),[r]),f.createElement(aLn,{key:"modal-holder",ref:e})]}const lLn=e=>{const{componentCls:t,notificationMarginEdge:n,animationMaxHeight:r}=e,o=`${t}-notice`,i=new Go("antNotificationFadeIn",{"0%":{transform:"translate3d(100%, 0, 0)",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",opacity:1}}),s=new Go("antNotificationTopFadeIn",{"0%":{top:-r,opacity:0},"100%":{top:0,opacity:1}}),l=new Go("antNotificationBottomFadeIn",{"0%":{bottom:e.calc(r).mul(-1).equal(),opacity:0},"100%":{bottom:0,opacity:1}}),c=new Go("antNotificationLeftFadeIn",{"0%":{transform:"translate3d(-100%, 0, 0)",opacity:0},"100%":{transform:"translate3d(0, 0, 0)",opacity:1}});return{[t]:{[`&${t}-top, &${t}-bottom`]:{marginInline:0,[o]:{marginInline:"auto auto"}},[`&${t}-top`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:s}},[`&${t}-bottom`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:l}},[`&${t}-topRight, &${t}-bottomRight`]:{[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:i}},[`&${t}-topLeft, &${t}-bottomLeft`]:{marginRight:{value:0,_skip_check_:!0},marginLeft:{value:n,_skip_check_:!0},[o]:{marginInlineEnd:"auto",marginInlineStart:0},[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationName:c}}}}},cLn=["top","topLeft","topRight","bottom","bottomLeft","bottomRight"],uLn={topLeft:"left",topRight:"right",bottomLeft:"left",bottomRight:"right",top:"left",bottom:"left"},dLn=(e,t)=>{const{componentCls:n}=e;return{[`${n}-${t}`]:{[`&${n}-stack > ${n}-notice-wrapper`]:{[t.startsWith("top")?"top":"bottom"]:0,[uLn[t]]:{value:0,_skip_check_:!0}}}}},fLn=e=>{const t={};for(let n=1;n ${e.componentCls}-notice`]:{opacity:0,transition:`opacity ${e.motionDurationMid}`}};return{[`&:not(:nth-last-child(-n+${e.notificationStackLayer}))`]:{opacity:0,overflow:"hidden",color:"transparent",pointerEvents:"none"},...t}},pLn=e=>{const t={};for(let n=1;n{const{componentCls:t}=e;return{[`${t}-stack`]:{[`& > ${t}-notice-wrapper`]:{transition:`transform ${e.motionDurationSlow}, backdrop-filter 0s`,willChange:"transform, opacity",position:"absolute",...fLn(e)}},[`${t}-stack:not(${t}-stack-expanded)`]:{[`& > ${t}-notice-wrapper`]:{...pLn(e)}},[`${t}-stack${t}-stack-expanded`]:{[`& > ${t}-notice-wrapper`]:{"&:not(:nth-last-child(-n + 1))":{opacity:1,overflow:"unset",color:"inherit",pointerEvents:"auto",[`& > ${e.componentCls}-notice`]:{opacity:1}},"&:after":{content:'""',position:"absolute",height:e.margin,width:"100%",insetInline:0,bottom:e.calc(e.margin).mul(-1).equal(),background:"transparent",pointerEvents:"auto"}}},...cLn.map(n=>dLn(e,n)).reduce((n,r)=>({...n,...r}),{})}},zst=e=>{const{iconCls:t,componentCls:n,boxShadow:r,fontSizeLG:o,notificationMarginBottom:i,borderRadiusLG:s,colorSuccess:l,colorInfo:c,colorWarning:u,colorError:d,colorTextHeading:p,notificationBg:h,notificationPadding:m,notificationMarginEdge:g,progressBg:y,notificationProgressHeight:x,fontSize:v,lineHeight:b,width:w,notificationIconSize:S,colorText:C,colorSuccessBg:N,colorErrorBg:j,colorInfoBg:I,colorWarningBg:_}=e,T=`${n}-notice`;return{position:"relative",marginBottom:i,marginInlineStart:"auto",background:h,borderRadius:s,boxShadow:r,[T]:{padding:m,width:w,maxWidth:`calc(100vw - ${Xe(e.calc(g).mul(2).equal())})`,lineHeight:b,wordWrap:"break-word",borderRadius:s,overflow:"hidden","&-success":N?{background:N}:{},"&-error":j?{background:j}:{},"&-info":I?{background:I}:{},"&-warning":_?{background:_}:{}},[`${T}-title`]:{marginBottom:e.marginXS,color:p,fontSize:o,lineHeight:e.lineHeightLG},[`${T}-description`]:{fontSize:v,color:C,marginTop:e.marginXS},[`${T}-closable ${T}-title`]:{paddingInlineEnd:e.paddingLG},[`${T}-with-icon ${T}-title`]:{marginBottom:e.marginXS,marginInlineStart:e.calc(e.marginSM).add(S).equal(),fontSize:o},[`${T}-with-icon ${T}-description`]:{marginInlineStart:e.calc(e.marginSM).add(S).equal(),fontSize:v},[`${T}-icon`]:{position:"absolute",fontSize:S,lineHeight:1,[`&-success${t}`]:{color:l},[`&-info${t}`]:{color:c},[`&-warning${t}`]:{color:u},[`&-error${t}`]:{color:d}},[`${T}-close`]:{position:"absolute",top:e.notificationPaddingVertical,insetInlineEnd:e.notificationPaddingHorizontal,color:e.colorIcon,outline:"none",width:e.notificationCloseButtonSize,height:e.notificationCloseButtonSize,borderRadius:e.borderRadiusSM,transition:`background-color ${e.motionDurationMid}, color ${e.motionDurationMid}`,display:"flex",alignItems:"center",justifyContent:"center",background:"none",border:"none","&:hover":{color:e.colorIconHover,backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},...gy(e)},[`${T}-progress`]:{position:"absolute",display:"block",appearance:"none",inlineSize:`calc(100% - ${Xe(s)} * 2)`,left:{_skip_check_:!0,value:s},right:{_skip_check_:!0,value:s},bottom:0,blockSize:x,border:0,"&, &::-webkit-progress-bar":{borderRadius:s,backgroundColor:"rgba(0, 0, 0, 0.04)"},"&::-moz-progress-bar":{background:y},"&::-webkit-progress-value":{borderRadius:s,background:y}},[`${T}-actions`]:{float:"right",marginTop:e.marginSM}}},mLn=e=>{const{componentCls:t,notificationMarginBottom:n,notificationMarginEdge:r,motionDurationMid:o,motionEaseInOut:i}=e,s=`${t}-notice`,l=new Go("antNotificationFadeOut",{"0%":{maxHeight:e.animationMaxHeight,marginBottom:n},"100%":{maxHeight:0,marginBottom:0,paddingTop:0,paddingBottom:0,opacity:0}});return[{[t]:{...Ii(e),position:"fixed",zIndex:e.zIndexPopup,marginRight:{value:r,_skip_check_:!0},[`${t}-hook-holder`]:{position:"relative"},[`${t}-fade-appear-prepare`]:{opacity:"0 !important"},[`${t}-fade-enter, ${t}-fade-appear`]:{animationDuration:e.motionDurationMid,animationTimingFunction:i,animationFillMode:"both",opacity:0,animationPlayState:"paused"},[`${t}-fade-leave`]:{animationTimingFunction:i,animationFillMode:"both",animationDuration:o,animationPlayState:"paused"},[`${t}-fade-enter${t}-fade-enter-active, ${t}-fade-appear${t}-fade-appear-active`]:{animationPlayState:"running"},[`${t}-fade-leave${t}-fade-leave-active`]:{animationName:l,animationPlayState:"running"},"&-rtl":{direction:"rtl",[`${s}-actions`]:{float:"left"}}}},{[t]:{[`${s}-wrapper`]:zst(e)}}]},Bst=e=>({zIndexPopup:e.zIndexPopupBase+Mye+50,width:384,progressBg:`linear-gradient(90deg, ${e.colorPrimaryBorderHover}, ${e.colorPrimary})`,colorSuccessBg:void 0,colorErrorBg:void 0,colorInfoBg:void 0,colorWarningBg:void 0}),Hst=e=>{const t=e.paddingMD,n=e.paddingLG;return Ho(e,{notificationBg:e.colorBgElevated,notificationPaddingVertical:t,notificationPaddingHorizontal:n,notificationIconSize:e.calc(e.fontSizeLG).mul(e.lineHeightLG).equal(),notificationCloseButtonSize:e.calc(e.controlHeightLG).mul(.55).equal(),notificationMarginBottom:e.margin,notificationPadding:`${Xe(e.paddingMD)} ${Xe(e.paddingContentHorizontalLG)}`,notificationMarginEdge:e.marginLG,animationMaxHeight:150,notificationStackLayer:3,notificationProgressHeight:2})},Vst=ui("Notification",e=>{const t=Hst(e);return[mLn(t),lLn(t),hLn(t)]},Bst),gLn=d5(["Notification","PurePanel"],e=>{const t=`${e.componentCls}-notice`,n=Hst(e);return{[`${t}-pure-panel`]:{...zst(n),width:n.width,maxWidth:`calc(100vw - ${Xe(e.calc(n.notificationMarginEdge).mul(2).equal())})`,margin:0}}},Bst);function qye(e,t){return t===null||t===!1?null:t||f.createElement(_y,{className:`${e}-close-icon`})}const xLn={success:$k,info:AK,error:aN,warning:JL},Ust=e=>{const{prefixCls:t,icon:n,type:r,title:o,description:i,actions:s,role:l="alert",styles:c,classNames:u}=e;let d=null;return n?d=f.createElement("span",{className:be(`${t}-icon`,u.icon),style:c.icon},n):r&&(d=f.createElement(xLn[r]||null,{className:be(`${t}-icon`,u.icon,`${t}-icon-${r}`),style:c.icon})),f.createElement("div",{className:be({[`${t}-with-icon`]:d}),role:l},d,f.createElement("div",{className:be(`${t}-title`,u.title),style:c.title},o),i&&f.createElement("div",{className:be(`${t}-description`,u.description),style:c.description},i),s&&f.createElement("div",{className:be(`${t}-actions`,u.actions),style:c.actions},s))},yLn=e=>{const{prefixCls:t,icon:n,type:r,message:o,title:i,description:s,btn:l,actions:c,closeIcon:u,className:d,style:p,styles:h,classNames:m,closable:g,...y}=e,{getPrefixCls:x,className:v,style:b,classNames:w,styles:S}=Zo("notification"),[C,N]=di([w,m],[S,h],{props:e}),{notification:j}=f.useContext(Qr),I=c??l,_=i??o,T=t||x("notification"),P=`${T}-notice`,E=pl(T),[M,R]=Vst(T,E),[$,D,,z]=TK(mb(e),mb(j),{closable:!0,closeIcon:f.createElement(_y,{className:`${T}-close-icon`}),closeIconRender:B=>qye(T,B)}),V=$?{onClose:g&&typeof g=="object"?g==null?void 0:g.onClose:void 0,closeIcon:D,...z}:!1;return f.createElement("div",{className:be(`${P}-pure-panel`,M,d,R,E,C.root),style:N.root},f.createElement(gLn,{prefixCls:T}),f.createElement(Dye,{style:{...b,...p},...y,prefixCls:T,eventKey:"pure",duration:null,closable:V,className:be(d,v),content:f.createElement(Ust,{classNames:C,styles:N,prefixCls:P,icon:n,type:r,title:_,description:s,actions:I})}))};function vLn(e,t,n){let r;switch(e){case"top":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":r={left:0,top:t,bottom:"auto"};break;case"topRight":r={right:0,top:t,bottom:"auto"};break;case"bottom":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:n};break;case"bottomLeft":r={left:0,top:"auto",bottom:n};break;default:r={right:0,top:"auto",bottom:n};break}return r}function bLn(e){return{motionName:`${e}-fade`}}function wLn(e,t,n){return typeof e<"u"?e:typeof(t==null?void 0:t.closeIcon)<"u"?t.closeIcon:n==null?void 0:n.closeIcon}const VOe=24,SLn=4.5,CLn="topRight",NLn=({children:e,prefixCls:t})=>{const n=pl(t),[r,o]=Vst(t,n);return Ie.createElement(Vat,{classNames:{list:be(r,o,n)}},e)},jLn=(e,{prefixCls:t,key:n})=>Ie.createElement(NLn,{prefixCls:t,key:n},e),ELn=Ie.forwardRef((e,t)=>{const{top:n,bottom:r,prefixCls:o,getContainer:i,maxCount:s,rtl:l,onAllRemoved:c,stack:u,duration:d=SLn,pauseOnHover:p=!0,showProgress:h}=e,{getPrefixCls:m,getPopupContainer:g,direction:y}=Zo("notification"),{notification:x}=f.useContext(Qr),[,v]=Xf(),b=o||m("notification"),w=f.useMemo(()=>typeof d=="number"&&d>0?d:!1,[d]),S=P=>vLn(P,n??VOe,r??VOe),C=()=>be({[`${b}-rtl`]:l??y==="rtl"}),N=()=>bLn(b),[j,I]=Uat({prefixCls:b,style:S,className:C,motion:N,closable:{closeIcon:qye(b)},duration:w,getContainer:()=>(i==null?void 0:i())||(g==null?void 0:g())||document.body,maxCount:s,pauseOnHover:p,showProgress:h,onAllRemoved:c,renderNotifications:jLn,stack:u===!1?!1:{threshold:typeof u=="object"?u==null?void 0:u.threshold:void 0,offset:8,gap:v.margin}}),[_,T]=di([x==null?void 0:x.classNames,e==null?void 0:e.classNames],[x==null?void 0:x.styles,e==null?void 0:e.styles],{props:e});return Ie.useImperativeHandle(t,()=>({...j,prefixCls:b,notification:x,classNames:_,styles:T})),I});function Wst(e){const t=Ie.useRef(null);Qw();const{notification:n}=Ie.useContext(Qr);return[Ie.useMemo(()=>{const o=c=>{if(!t.current)return;const{open:u,prefixCls:d,notification:p,classNames:h,styles:m}=t.current,g=(p==null?void 0:p.className)||{},y=(p==null?void 0:p.style)||{},x=`${d}-notice`,{title:v,message:b,description:w,icon:S,type:C,btn:N,actions:j,className:I,style:_,role:T="alert",closeIcon:P,closable:E,classNames:M={},styles:R={},...$}=c,D=v??b,z=j??N,V=qye(x,wLn(P,e,p)),[B,G,,H]=vat(mb({...e||{},...c}),mb(n),{closable:!0,closeIcon:V}),F=B?{onClose:E&&typeof E=="object"?E.onClose:void 0,closeIcon:G,...H}:!1,W=U2(M,{props:c}),U=U2(R,{props:c}),K=kK(void 0,h,W),X=kye(m,U);return u({placement:(e==null?void 0:e.placement)??CLn,...$,content:Ie.createElement(Ust,{prefixCls:x,icon:S,type:C,title:D,description:w,actions:z,role:T,classNames:K,styles:X}),className:be({[`${x}-${C}`]:C},I,g,K.root),style:{...y,...X.root,..._},closable:F})},s={open:o,destroy:c=>{var u,d;c!==void 0?(u=t.current)==null||u.close(c):(d=t.current)==null||d.destroy()}};return["success","info","warning","error"].forEach(c=>{s[c]=u=>o({...u,type:c})}),s},[e,n]),Ie.createElement(ELn,{key:"notification-holder",...e,ref:t})]}function ILn(e){return Wst(e)}const Gst=Ie.createContext({});function qst(e){return t=>f.createElement(Py,{theme:{token:{motion:!1,zIndexPopupBase:0}}},f.createElement(e,{...t}))}const HK=(e,t,n,r,o)=>qst(s=>{const{prefixCls:l,style:c}=s,u=f.useRef(null),[d,p]=f.useState(0),[h,m]=f.useState(0),[g,y]=Fa(!1,s.open),{getPrefixCls:x}=f.useContext(Qr),v=x(r||"select",l);f.useEffect(()=>{if(y(!0),typeof ResizeObserver<"u"){const S=new ResizeObserver(N=>{const j=N[0].target;p(j.offsetHeight+8),m(j.offsetWidth)}),C=setInterval(()=>{var I;const N=o?`.${o(v)}`:`.${v}-dropdown`,j=(I=u.current)==null?void 0:I.querySelector(N);j&&(clearInterval(C),S.observe(j))},10);return()=>{clearInterval(C),S.disconnect()}}},[v]);let b={...s,style:{...c,margin:0},open:g,getPopupContainer:()=>u.current};t&&Object.assign(b,{[t]:{overflow:{adjustX:!1,adjustY:!1}}});const w={paddingBottom:d,position:"relative",minWidth:h};return f.createElement("div",{ref:u,style:w},f.createElement(e,{...b}))}),_Ln=(e,t,n,r,o=!1,i,s)=>{const l=f.useMemo(()=>typeof n=="boolean"?{allowClear:n}:n&&typeof n=="object"?n:{allowClear:!1},[n]);return f.useMemo(()=>{const c=!o&&l.allowClear!==!1&&(t.length||i)&&!(s==="combobox"&&i==="");return{allowClear:c,clearIcon:c?l.clearIcon||r||"×":null}},[l,r,o,t.length,i,s])},Kst=f.createContext(null);function f5(){return f.useContext(Kst)}function PLn(e=250){const t=f.useRef(null),n=f.useRef(null);f.useEffect(()=>()=>{window.clearTimeout(n.current)},[]);function r(o){(o||t.current===null)&&(t.current=o),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current=null},e)}return[()=>t.current,r]}function Yst(e,t){return e.filter(n=>n).some(n=>n.contains(t)||n===t)}function ALn(e,t,n,r){const o=Vr(i=>{if(r)return;let s=i.target;s.shadowRoot&&i.composed&&(s=i.composedPath()[0]||s),i._ori_target&&(s=i._ori_target),t&&!Yst(e(),s)&&n(!1)});f.useEffect(()=>(window.addEventListener("mousedown",o),()=>window.removeEventListener("mousedown",o)),[o])}function xce(){return xce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const t=e===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1},htmlRegion:"scroll"}}},kLn=(e,t)=>{const{prefixCls:n,disabled:r,visible:o,children:i,popupElement:s,animation:l,transitionName:c,popupStyle:u,popupClassName:d,direction:p="ltr",placement:h,builtinPlacements:m,popupMatchSelectWidth:g,popupRender:y,popupAlign:x,getPopupContainer:v,empty:b,onPopupVisibleChange:w,onPopupMouseEnter:S,onPopupMouseDown:C,onPopupBlur:N,...j}=e,I=`${n}-dropdown`;let _=s;y&&(_=y(s));const T=f.useMemo(()=>m||TLn(g),[m,g]),P=l?`${I}-${l}`:c,E=typeof g=="number",M=f.useMemo(()=>E?null:g===!1?"minWidth":"width",[g,E]);let R=u;E&&(R={...u,width:g});const $=f.useRef(null);return f.useImperativeHandle(t,()=>({getPopupElement:()=>{var D;return(D=$.current)==null?void 0:D.popupElement}})),f.createElement(n6,xce({},j,{showAction:w?["click"]:[],hideAction:w?["click"]:[],popupPlacement:h||(p==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:T,prefixCls:I,popupMotion:{motionName:P},popup:f.createElement("div",{onMouseEnter:S,onMouseDown:C,onBlur:N},_),ref:$,stretch:M,popupAlign:x,popupVisible:o,getPopupContainer:v,popupClassName:be(d,{[`${I}-empty`]:b}),popupStyle:R,onPopupVisibleChange:w}),i)},MLn=f.forwardRef(kLn);function UOe(e,t){const{key:n}=e;let r;return"value"in e&&({value:r}=e),n??(r!==void 0?r:`rc-index-key-${t}`)}function yce(e){return typeof e<"u"&&!Number.isNaN(e)}function Xst(e,t){const{label:n,value:r,options:o,groupLabel:i}=e||{},s=n||(t?"children":"label");return{label:s,value:r||"value",options:o||"options",groupLabel:i||s}}function RLn(e,{fieldNames:t,childrenAsData:n}={}){const r=[],{label:o,value:i,options:s,groupLabel:l}=Xst(t,!1);function c(u,d){Array.isArray(u)&&u.forEach(p=>{if(d||!(s in p)){const h=p[i];r.push({key:UOe(p,r.length),groupOption:d,data:p,label:p[o],value:h})}else{let h=p[l];h===void 0&&n&&(h=p.label),r.push({key:UOe(p,r.length),group:!0,data:p,label:h}),c(p[s],!0)}})}return c(e,!1),r}function vce(e){const t={...e};return"props"in t||Object.defineProperty(t,"props",{get(){return Al(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}const OLn=(e,t,n)=>{if(!t||!t.length)return null;let r=!1;const o=(s,[l,...c])=>{if(!l)return[s];const u=s.split(l);return r=r||u.length>1,u.reduce((d,p)=>[...d,...o(p,c)],[]).filter(Boolean)},i=o(e,t);return r?typeof n<"u"?i.slice(0,n):i:null};function $Ln(e){const{visible:t,values:n}=e;if(!t)return null;const r=50;return f.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},`${n.slice(0,r).map(({label:o,value:i})=>["number","string"].includes(typeof o)?o:i).join(", ")}`,n.length>r?", ...":null)}const DLn=e=>{const t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(null)},Kye=(e,t=1)=>{if(t<=0){e();return}DLn(()=>{Kye(e,t-1)})};function LLn(e,t,n,r){const[o,i]=f.useState(!1);f.useEffect(()=>{i(!0)},[]);const[s,l]=Fa(e,t),u=r(o?s:!1),d=f.useRef(0),p=Vr(m=>{n&&u!==m&&n(m),l(m)}),h=Vr((m,g={})=>{const{cancelFun:y}=g;d.current+=1;const x=d.current,v=typeof m=="boolean"?m:!u;function b(){x===d.current&&!(y!=null&&y())&&p(v)}v?b():Kye(()=>{b()})});return[u,h]}function cte(e){const{children:t,...n}=e;return t?f.createElement("div",n,t):null}const Qst=f.createContext(null);function d6(){return f.useContext(Qst)}const Jst=f.forwardRef((e,t)=>{const{onChange:n,onKeyDown:r,onBlur:o,style:i,syncWidth:s,value:l,className:c,autoComplete:u,...d}=e,{prefixCls:p,mode:h,onSearch:m,onSearchSubmit:g,onInputBlur:y,autoFocus:x,tokenWithEnter:v,placeholder:b,components:{input:w="input"}}=d6(),{id:S,classNames:C,styles:N,open:j,activeDescendantId:I,role:_,disabled:T}=f5()||{},P=be(`${p}-input`,C==null?void 0:C.input,c),E=f.useRef(!1),M=f.useRef(null),R=f.useRef(null);f.useImperativeHandle(t,()=>R.current);const $=K=>{let{value:X}=K.target;if(v&&M.current&&/[\r\n]/.test(M.current)){const J=M.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");X=X.replace(J,M.current)}M.current=null,m&&m(X,!0,E.current),n==null||n(K)},D=K=>{const{key:X}=K,{value:J}=K.currentTarget;X==="Enter"&&h==="tags"&&!E.current&&g&&g(J),r==null||r(K)},z=K=>{y==null||y(),o==null||o(K)},V=()=>{E.current=!0},B=K=>{if(E.current=!1,h!=="combobox"){const{value:X}=K.currentTarget;m==null||m(X,!0,!1)}},G=K=>{const{clipboardData:X}=K,J=X==null?void 0:X.getData("text");M.current=J||""},[H,F]=f.useState(void 0);Po(()=>{const K=R.current;if(s&&K){K.style.width="0px";const X=K.scrollWidth;F(X),K.style.width=""}},[s,l]);const W={id:S,type:h==="combobox"?"text":"search",...d,ref:R,style:{...N==null?void 0:N.input,...i,"--select-input-width":H},autoFocus:x,autoComplete:u||"off",className:P,disabled:T,value:l||"",onChange:$,onKeyDown:D,onBlur:z,onPaste:G,onCompositionStart:V,onCompositionEnd:B,role:_||"combobox","aria-expanded":j||!1,"aria-haspopup":"listbox","aria-owns":j?`${S}_list`:void 0,"aria-autocomplete":"list","aria-controls":j?`${S}_list`:void 0,"aria-activedescendant":j?I:void 0};if(f.isValidElement(w)){const K=w.props||{},X={placeholder:e.placeholder||b,...W,...K};return Object.keys(K).forEach(J=>{const te=K[J];typeof te=="function"&&(X[J]=(...re)=>{var ce;te(...re),(ce=W[J])==null||ce.call(W,...re)})}),X.ref=zd(w.ref,W.ref),f.cloneElement(w,X)}const U=w;return f.createElement(U,W)});function Zst(e){const{prefixCls:t,placeholder:n,displayValues:r}=d6(),{classNames:o,styles:i}=f5(),{show:s=!0}=e;return r.length?null:f.createElement("div",{className:be(`${t}-placeholder`,o==null?void 0:o.placeholder),style:{visibility:s?"visible":"hidden",...i==null?void 0:i.placeholder}},n)}const Yye=f.createContext(null);function elt(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}function FLn(e){return e!=null}function zLn(e){return!e&&e!==0}function WOe(e){return["string","number"].includes(typeof e)}function bce(e){let t;return e&&(WOe(e.title)?t=e.title.toString():WOe(e.label)&&(t=e.label.toString())),t}function wce(){return wce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:n,searchValue:r,activeValue:o,displayValues:i,maxLength:s,mode:l}=d6(),{triggerOpen:c,title:u,showSearch:d,classNames:p,styles:h}=f5(),m=f.useContext(Yye),[g,y]=f.useState(!1),x=l==="combobox",v=i[0],b=f.useMemo(()=>x&&o&&!g&&c?o:d?r:"",[x,o,g,c,r,d]),w=f.useMemo(()=>{const S={className:`${n}-content-value`,style:{visibility:b?"hidden":"visible"}};if(v&&(m!=null&&m.flattenOptions)){const C=m.flattenOptions.find(N=>N.value===v.value);if(C!=null&&C.data){const{className:N,style:j}=C.data;Object.assign(S,{title:bce(C.data),className:be(S.className,N),style:{...S.style,...j}})}}return v&&!S.title&&(S.title=bce(v)),u!==void 0&&(S.title=u),S},[v,m==null?void 0:m.flattenOptions,n,b,u]);return f.useEffect(()=>{x&&y(!1)},[x,o]),f.createElement("div",{className:be(`${n}-content`,p==null?void 0:p.content),style:h==null?void 0:h.content},v?f.createElement("div",w,v.label):f.createElement(Zst,{show:!b}),f.createElement(Jst,wce({ref:t},e,{value:b,maxLength:l==="combobox"?s:void 0,onChange:S=>{var C;y(!0),(C=e.onChange)==null||C.call(e,S)}})))}),x_=void 0;function HLn(e,t){const{prefixCls:n,invalidate:r,item:o,renderItem:i,responsive:s,responsiveDisabled:l,registerSize:c,itemKey:u,className:d,style:p,children:h,display:m,order:g,component:y="div",...x}=e,v=s&&!m;function b(j){c(u,j)}f.useEffect(()=>()=>{b(null)},[]);const w=i&&o!==x_?i(o,{index:g}):h;let S;r||(S={opacity:v?0:1,height:v?0:x_,overflowY:v?"hidden":x_,order:s?g:x_,pointerEvents:v?"none":x_,position:v?"absolute":x_});const C={};v&&(C["aria-hidden"]=!0);let N=f.createElement(y,Se({className:be(!r&&n,d),style:{...S,...p}},C,x,{ref:t}),w);return s&&(N=f.createElement(Uf,{onResize:({offsetWidth:j})=>{b(j)},disabled:l},N)),N}const kR=f.forwardRef(HLn);function VLn(e){if(typeof MessageChannel>"u")Bo(e);else{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(void 0)}}function ULn(){const e=f.useRef(null);return n=>{e.current||(e.current=[],VLn(()=>{pu.unstable_batchedUpdates(()=>{e.current.forEach(r=>{r()}),e.current=null})})),e.current.push(n)}}function y_(e,t){const[n,r]=f.useState(t),o=Vr(i=>{e(()=>{r(i)})});return[n,o]}const RU=Ie.createContext(null),WLn=(e,t)=>{const n=f.useContext(RU);if(!n){const{component:l="div",...c}=e;return f.createElement(l,Se({},c,{ref:t}))}const{className:r,...o}=n,{className:i,...s}=e;return f.createElement(RU.Provider,{value:null},f.createElement(kR,Se({ref:t,className:be(r,i)},o,s)))},GLn=f.forwardRef(WLn),tlt="responsive",nlt="invalidate";function qLn(e){return`+ ${e.length} ...`}function KLn(e,t){const{prefixCls:n="rc-overflow",data:r=[],renderItem:o,renderRawItem:i,itemKey:s,itemWidth:l=10,ssr:c,style:u,className:d,maxCount:p,renderRest:h,renderRawRest:m,prefix:g,suffix:y,component:x="div",itemComponent:v,onVisibleChange:b,...w}=e,S=c==="full",C=ULn(),[N,j]=y_(C,null),I=N||0,[_,T]=y_(C,new Map),[P,E]=y_(C,0),[M,R]=y_(C,0),[$,D]=y_(C,0),[z,V]=y_(C,0),[B,G]=f.useState(null),[H,F]=f.useState(null),W=f.useMemo(()=>H===null&&S?Number.MAX_SAFE_INTEGER:H||0,[H,N]),[U,K]=f.useState(!1),X=`${n}-item`,J=Math.max(P,M),te=p===tlt,re=r.length&&te,ce=p===nlt,ae=re||typeof p=="number"&&r.length>p,oe=f.useMemo(()=>{let Ae=r;return re?N===null&&S?Ae=r:Ae=r.slice(0,Math.min(r.length,I/l)):typeof p=="number"&&(Ae=r.slice(0,p)),Ae},[r,l,N,p,re]),ue=f.useMemo(()=>re?r.slice(W+1):r.slice(oe.length),[r,oe,re,W]),fe=f.useCallback((Ae,qe)=>typeof s=="function"?s(Ae):(s&&(Ae==null?void 0:Ae[s]))??qe,[s]),se=f.useCallback(o||(Ae=>Ae),[o]);function ge(Ae,qe,dt){H===Ae&&(qe===void 0||qe===B)||(F(Ae),dt||(K(Ae{const Ze=new Map(dt);return qe===null?Ze.delete(Ae):Ze.set(Ae,qe),Ze})}function Ne(Ae,qe){R(qe),E(M)}function _e(Ae,qe){D(qe)}function xe(Ae,qe){V(qe)}function we(Ae){return _.get(fe(oe[Ae],Ae))}Po(()=>{if(I&&typeof J=="number"&&oe){let Ae=$+z;const qe=oe.length,dt=qe-1;if(!qe){ge(0,null);return}for(let Ze=0;ZeI){ge(Ze-1,Ae-Qe-z+M);break}}y&&we(0)+z>I&&G(null)}},[I,_,M,$,z,fe,oe]);const Te=U&&!!ue.length;let Re={};B!==null&&re&&(Re={position:"absolute",left:B,top:0});const Ue={prefixCls:X,responsive:re,component:v,invalidate:ce},He=i?(Ae,qe)=>{const dt=fe(Ae,qe);return f.createElement(RU.Provider,{key:dt,value:{...Ue,order:qe,item:Ae,itemKey:dt,registerSize:de,display:qe<=W}},i(Ae,qe))}:(Ae,qe)=>{const dt=fe(Ae,qe);return f.createElement(kR,Se({},Ue,{order:qe,key:dt,item:Ae,renderItem:se,itemKey:dt,registerSize:de,display:qe<=W}))},Ye={order:Te?W:Number.MAX_SAFE_INTEGER,className:`${X}-rest`,registerSize:Ne,display:Te},We=h||qLn,at=m?f.createElement(RU.Provider,{value:{...Ue,...Ye}},m(ue)):f.createElement(kR,Se({},Ue,Ye),typeof We=="function"?We(ue):We),Oe=f.createElement(x,Se({className:be(!ce&&n,d),style:u,ref:t},w),g&&f.createElement(kR,Se({},Ue,{responsive:te,responsiveDisabled:!re,order:-1,className:`${X}-prefix`,registerSize:_e,display:!0}),g),oe.map(He),ae?at:null,y&&f.createElement(kR,Se({},Ue,{responsive:te,responsiveDisabled:!re,order:W,className:`${X}-suffix`,registerSize:xe,display:!0,style:Re}),y));return te?f.createElement(Uf,{onResize:ye,disabled:!re},Oe):Oe}const Jv=f.forwardRef(KLn);Jv.Item=GLn;Jv.RESPONSIVE=tlt;Jv.INVALIDATE=nlt;const rlt=e=>{const{className:t,style:n,customizeIcon:r,customizeIconProps:o,children:i,onMouseDown:s,onClick:l}=e,c=typeof r=="function"?r(o):r;return f.createElement("span",{className:t,onMouseDown:u=>{u.preventDefault(),s==null||s(u)},style:{userSelect:"none",WebkitUserSelect:"none",...n},unselectable:"on",onClick:l,"aria-hidden":!0},c!==void 0?c:f.createElement("span",{className:be(t.split(/\s+/).map(u=>`${u}-icon`))},i))};function Sce(){return Sce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{e.preventDefault(),e.stopPropagation()},XLn=f.forwardRef(function({inputProps:t},n){const{prefixCls:r,displayValues:o,searchValue:i,mode:s,onSelectorRemove:l,removeIcon:c}=d6(),{disabled:u,showSearch:d,triggerOpen:p,toggleOpen:h,autoClearSearchValue:m,tagRender:g,maxTagPlaceholder:y,maxTagTextLength:x,maxTagCount:v,classNames:b,styles:w}=f5(),S=`${r}-selection-item`;let C=i;!p&&s==="multiple"&&m!==!1&&(C="");const N=d&&C||"",j=d&&!u,I=c??"×",_=y??(z=>`+ ${z.length} ...`),T=g,P=z=>{h(z)},E=z=>{l==null||l(z)},M=(z,V,B,G,H)=>f.createElement("span",{title:bce(z),className:be(S,{[`${S}-disabled`]:B},b==null?void 0:b.item),style:w==null?void 0:w.item},f.createElement("span",{className:be(`${S}-content`,b==null?void 0:b.itemContent),style:w==null?void 0:w.itemContent},V),G&&f.createElement(rlt,{className:be(`${S}-remove`,b==null?void 0:b.itemRemove),style:w==null?void 0:w.itemRemove,onMouseDown:GOe,onClick:H,customizeIcon:I},"×")),R=(z,V,B,G,H,F,W)=>{const U=K=>{GOe(K),P(!p)};return f.createElement("span",{onMouseDown:U},T({label:V,value:z,index:W==null?void 0:W.index,disabled:B,closable:G,onClose:H,isMaxTag:!!F}))},$=(z,V)=>{const{disabled:B,label:G,value:H}=z,F=!u&&!B;let W=G;if(typeof x=="number"&&(typeof G=="string"||typeof G=="number")){const K=String(W);K.length>x&&(W=`${K.slice(0,x)}...`)}const U=K=>{K&&K.stopPropagation(),E(z)};return typeof T=="function"?R(H,W,B,F,U,void 0,V):M(z,W,B,F,U)},D=z=>{if(!o.length)return null;const V=typeof _=="function"?_(z):_;return typeof T=="function"?R(void 0,V,!1,!1,void 0,!0):M({title:V},V,!1)};return f.createElement(Jv,{prefixCls:`${r}-content`,className:b==null?void 0:b.content,style:w==null?void 0:w.content,prefix:!o.length&&!N&&f.createElement(Zst,null),data:o,renderItem:$,renderRest:D,suffix:f.createElement(Jst,Sce({ref:n,disabled:u,readOnly:!j},t,{value:N||"",syncWidth:!0})),itemKey:YLn,maxCount:v})}),QLn=f.forwardRef(function(t,n){const{multiple:r,onInputKeyDown:o,tabIndex:i}=d6(),s=f5(),{showSearch:l}=s,u={...fl(s,{aria:!0}),onKeyDown:o,readOnly:!l,tabIndex:i};return r?f.createElement(XLn,{ref:n,inputProps:u}):f.createElement(BLn,{ref:n,inputProps:u})});function JLn(e){return e&&![Ir.ESC,Ir.SHIFT,Ir.BACKSPACE,Ir.TAB,Ir.WIN_KEY,Ir.ALT,Ir.META,Ir.WIN_KEY_RIGHT,Ir.CTRL,Ir.SEMICOLON,Ir.EQUALS,Ir.CAPS_LOCK,Ir.CONTEXT_MENU,Ir.UP,Ir.LEFT,Ir.RIGHT,Ir.F1,Ir.F2,Ir.F3,Ir.F4,Ir.F5,Ir.F6,Ir.F7,Ir.F8,Ir.F9,Ir.F10,Ir.F11,Ir.F12].includes(e)}function OU(){return OU=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{which:te}=J,re=B.current instanceof HTMLTextAreaElement;if(!re&&P&&(te===Ir.UP||te===Ir.DOWN)&&J.preventDefault(),N&&N(J),re&&!P&&~[Ir.UP,Ir.DOWN,Ir.LEFT,Ir.RIGHT].indexOf(te))return;!(J.ctrlKey||J.altKey||J.metaKey)&&JLn(te)&&E(!0)});f.useImperativeHandle(n,()=>({focus:J=>{var te,re;(re=(te=B.current||V.current).focus)==null||re.call(te,J)},blur:()=>{var J,te;(te=(J=B.current||V.current).blur)==null||te.call(J)},nativeElement:V.current}));const H=Vr(J=>{var te;if(!R){const re=hb(B.current);J.nativeEvent._ori_target=re,re&&J.target!==re&&!re.contains(J.target)&&J.preventDefault();const ce=P&&!d&&(m==="combobox"||M);J.nativeEvent._select_lazy?P&&E(!1):((te=B.current)==null||te.focus(),ce||E())}S==null||S(J)}),{root:F}=_,W=za(T,ZLn),U=fl(W,{aria:!0}),K=Object.keys(U),X={...t,onInputKeyDown:G};return F?f.isValidElement(F)?f.cloneElement(F,{...W,ref:zd(F.ref,V)}):f.createElement(F,OU({},W,{ref:V})):f.createElement(Qst.Provider,{value:X},f.createElement("div",OU({},za(W,K),{ref:V,className:o,style:i,onMouseDown:H}),f.createElement(cte,{className:be(`${r}-prefix`,D==null?void 0:D.prefix),style:z==null?void 0:z.prefix},s),f.createElement(QLn,{ref:B}),f.createElement(cte,{className:be(`${r}-suffix`,{[`${r}-suffix-loading`]:$},D==null?void 0:D.suffix),style:z==null?void 0:z.suffix},l),c&&f.createElement(cte,{className:be(`${r}-clear`,D==null?void 0:D.clear),style:z==null?void 0:z.clear,onMouseDown:J=>{J.nativeEvent._select_lazy=!0,C==null||C(J)}},c),u))});function t6n(e,t,n){return f.useMemo(()=>{let{root:r,input:o}=e||{};return n&&(r=n()),t&&(o=t()),{root:r,input:o}},[e,t,n])}function Cce(){return Cce=Object.assign?Object.assign.bind():function(e){for(var t=1;te==="tags"||e==="multiple",n6n=f.forwardRef((e,t)=>{const{id:n,prefixCls:r,className:o,styles:i,classNames:s,showSearch:l,tagRender:c,showScrollBar:u="optional",direction:d,omitDomProps:p,displayValues:h,onDisplayValuesChange:m,emptyOptions:g,notFoundContent:y="Not Found",onClear:x,maxCount:v,placeholder:b,mode:w,disabled:S,loading:C,getInputElement:N,getRawInputElement:j,open:I,defaultOpen:_,onPopupVisibleChange:T,activeValue:P,onActiveValueChange:E,activeDescendantId:M,searchValue:R,autoClearSearchValue:$,onSearch:D,onSearchSplit:z,tokenSeparators:V,allowClear:B,prefix:G,suffix:H,suffixIcon:F,clearIcon:W,OptionList:U,animation:K,transitionName:X,popupStyle:J,popupClassName:te,popupMatchSelectWidth:re,popupRender:ce,popupAlign:ae,placement:oe,builtinPlacements:ue,getPopupContainer:fe,showAction:se=[],onFocus:ge,onBlur:ye,onKeyUp:de,onKeyDown:Ne,onMouseDown:_e,components:xe,...we}=e,Te=Nce(w),Re=f.useRef(null),Ue=f.useRef(null),He=f.useRef(null),[Ye,We]=f.useState(!1);f.useImperativeHandle(t,()=>{var Kt,gn;return{focus:(Kt=Re.current)==null?void 0:Kt.focus,blur:(gn=Re.current)==null?void 0:gn.blur,scrollTo:An=>{var pt;return(pt=He.current)==null?void 0:pt.scrollTo(An)},nativeElement:hb(Re.current)}});const at=t6n(xe,N,j),Oe=f.useMemo(()=>{var gn;if(w!=="combobox")return R;const Kt=(gn=h[0])==null?void 0:gn.value;return typeof Kt=="string"||typeof Kt=="number"?String(Kt):""},[R,w,h]),Ae=w==="combobox"&&typeof N=="function"&&N()||null,qe=!y&&g,[dt,Ze]=LLn(_||!1,I,T,Kt=>S||qe?!1:Kt),Qe=f.useMemo(()=>(V||[]).some(Kt=>[` `,`\r `].includes(Kt)),[V]),lt=(Kt,gn,An)=>{if(Te&&yce(v)&&h.length>=v)return;let pt=!0,nt=Kt;E==null||E(null);const xt=OLn(Kt,V,yce(v)?v-h.length:void 0),Tt=An?null:xt;return w!=="combobox"&&Tt&&(nt="",z==null||z(Tt),Ze(!1),pt=!1),D&&Oe!==nt&&D(nt,{source:gn?"typing":"effect"}),Kt&&gn&&pt&&Ze(!0),pt},bt=Kt=>{!Kt||!Kt.trim()||D(Kt,{source:"submit"})};f.useEffect(()=>{!dt&&!Te&&w!=="combobox"&<("",!1,!1)},[dt]),f.useEffect(()=>{S&&(Ze(!1),We(!1))},[S,dt]);const[Ct,Je]=PLn(),Pe=f.useRef(!1),Me=Kt=>{var nt;const gn=Ct(),{key:An}=Kt,pt=An==="Enter";if(pt&&(w!=="combobox"&&Kt.preventDefault(),dt||Ze(!0)),Je(!!Oe),An==="Backspace"&&!gn&&Te&&!Oe&&h.length){const xt=[...h];let Tt=null;for(let rn=xt.length-1;rn>=0;rn-=1){const un=xt[rn];if(!un.disabled){xt.splice(rn,1),Tt=un;break}}Tt&&m(xt,{type:"remove",values:[Tt]})}dt&&(!pt||!Pe.current)&&(pt&&(Pe.current=!0),(nt=He.current)==null||nt.onKeyDown(Kt)),Ne==null||Ne(Kt)},et=(Kt,...gn)=>{var An;dt&&((An=He.current)==null||An.onKeyUp(Kt,...gn)),Kt.key==="Enter"&&(Pe.current=!1),de==null||de(Kt,...gn)},vt=Vr(Kt=>{const gn=h.filter(An=>An!==Kt);m(gn,{type:"remove",values:[Kt]})}),Pt=()=>{Pe.current=!1},Jt=()=>{var Kt;return[hb(Re.current),(Kt=Ue.current)==null?void 0:Kt.getPopupElement()]};ALn(Jt,dt,Ze,!!at.root);const dn=f.useRef(!1),Et=Kt=>{We(!0),S||(se.includes("focus")&&Ze(!0),ge==null||ge(Kt))},sn=()=>{dt&&!dn.current&&Ze(!1,{cancelFun:()=>Yst(Jt(),document.activeElement)})},ot=Kt=>{We(!1),Oe&&(w==="tags"?D(Oe,{source:"submit"}):w==="multiple"&&D("",{source:"blur"})),sn(),S||ye==null||ye(Kt)},mt=(Kt,...gn)=>{var nt;const{target:An}=Kt,pt=(nt=Ue.current)==null?void 0:nt.getPopupElement();pt!=null&&pt.contains(An)&&Ze&&Ze(!0),_e==null||_e(Kt,...gn),dn.current=!0,Kye(()=>{dn.current=!1})},[,Ht]=f.useState({});function jt(){Ht({})}let Vt;at.root&&(Vt=Kt=>{Ze(Kt)});const nn=f.useMemo(()=>({...e,notFoundContent:y,open:dt,triggerOpen:dt,id:n,showSearch:l,multiple:Te,toggleOpen:Ze,showScrollBar:u,styles:i,classNames:s}),[e,y,Ze,n,l,Te,dt,u,i,s]),zt=f.useMemo(()=>{const Kt=H??F;return typeof Kt=="function"?Kt({searchValue:Oe,open:dt,focused:Ye,showSearch:l,loading:C}):Kt},[H,F,Oe,dt,Ye,l,C]),Nn=()=>{var Kt;x==null||x(),(Kt=Re.current)==null||Kt.focus(),m([],{type:"clear",values:h}),lt("",!1,!1)},{allowClear:xr,clearIcon:ur}=_Ln(r,h,B,W,S,Oe,w),Zt=f.createElement(U,{ref:He}),Ot=be(r,o,{[`${r}-focused`]:Ye,[`${r}-multiple`]:Te,[`${r}-single`]:!Te,[`${r}-allow-clear`]:xr,[`${r}-show-arrow`]:zt!=null,[`${r}-disabled`]:S,[`${r}-loading`]:C,[`${r}-open`]:dt,[`${r}-customize-input`]:Ae,[`${r}-show-search`]:l});let qt=f.createElement(e6n,Cce({},we,{ref:Re,prefixCls:r,className:Ot,focused:Ye,prefix:G,suffix:zt,clearIcon:ur,multiple:Te,mode:w,displayValues:h,placeholder:b,searchValue:Oe,activeValue:P,onSearch:lt,onSearchSubmit:bt,onInputBlur:Pt,onFocus:Et,onBlur:ot,onClearMouseDown:Nn,onKeyDown:Me,onKeyUp:et,onSelectorRemove:vt,tokenWithEnter:Qe,onMouseDown:mt,components:at}));return qt=f.createElement(MLn,{ref:Ue,disabled:S,prefixCls:r,visible:dt,popupElement:Zt,animation:K,transitionName:X,popupStyle:J,popupClassName:te,direction:d,popupMatchSelectWidth:re,popupRender:ce,popupAlign:ae,placement:oe,builtinPlacements:ue,getPopupContainer:fe,empty:g,onPopupVisibleChange:Vt,onPopupMouseEnter:jt,onPopupMouseDown:mt,onPopupBlur:sn},qt),f.createElement(Kst.Provider,{value:nn},f.createElement($Ln,{visible:Ye&&!dt,values:h}),qt)}),Xye=()=>null;Xye.isSelectOptGroup=!0;const Qye=()=>null;Qye.isSelectOption=!0;const olt=f.forwardRef(({height:e,offsetY:t,offsetX:n,children:r,prefixCls:o,onInnerResize:i,innerProps:s,rtl:l,extra:c},u)=>{let d={},p={display:"flex",flexDirection:"column"};return t!==void 0&&(d={height:e,position:"relative",overflow:"hidden"},p={...p,transform:`translateY(${t}px)`,[l?"marginRight":"marginLeft"]:-n,position:"absolute",left:0,right:0,top:0}),f.createElement("div",{style:d},f.createElement(Uf,{onResize:({offsetHeight:h})=>{h&&i&&i()}},f.createElement("div",Se({style:p,className:be({[`${o}-holder-inner`]:o}),ref:u},s),r,c)))});olt.displayName="Filler";function r6n({children:e,setRef:t}){const n=f.useCallback(r=>{t(r)},[]);return f.cloneElement(e,{ref:n})}function o6n(e,t,n,r,o,i,s,{getKey:l}){return e.slice(t,n+1).map((c,u)=>{const d=t+u,p=s(c,d,{style:{width:r},offsetX:o}),h=l(c);return f.createElement(r6n,{key:h,setRef:m=>i(c,m)},p)})}function i6n(e,t,n){const r=e.length,o=t.length;let i,s;if(r===0&&o===0)return null;r{const l=i6n(r||[],e||[],t);(l==null?void 0:l.index)!==void 0&&s(e[l.index]),o(e)},[e]),[i]}const qOe=typeof navigator=="object"&&/Firefox/i.test(navigator.userAgent),ilt=((e,t,n,r)=>{const o=f.useRef(!1),i=f.useRef(null);function s(){clearTimeout(i.current),o.current=!0,i.current=setTimeout(()=>{o.current=!1},50)}const l=f.useRef({top:e,bottom:t,left:n,right:r});return l.current.top=e,l.current.bottom=t,l.current.left=n,l.current.right=r,(c,u,d=!1)=>{const p=c?u<0&&l.current.left||u>0&&l.current.right:u<0&&l.current.top||u>0&&l.current.bottom;return d&&p?(clearTimeout(i.current),o.current=!1):(!p||o.current)&&s(),!o.current&&p}});function s6n(e,t,n,r,o,i,s){const l=f.useRef(0),c=f.useRef(null),u=f.useRef(null),d=f.useRef(!1),p=ilt(t,n,r,o);function h(b,w){if(Bo.cancel(c.current),p(!1,w))return;const S=b;if(!S._virtualHandled)S._virtualHandled=!0;else return;l.current+=w,u.current=w,qOe||S.preventDefault(),c.current=Bo(()=>{const C=d.current?10:1;s(l.current*C,!1),l.current=0})}function m(b,w){s(w,!0),qOe||b.preventDefault()}const g=f.useRef(null),y=f.useRef(null);function x(b){if(!e)return;Bo.cancel(y.current),y.current=Bo(()=>{g.current=null},2);const{deltaX:w,deltaY:S,shiftKey:C}=b;let N=w,j=S;(g.current==="sx"||!g.current&&C&&S&&!w)&&(N=S,j=0,g.current="sx");const I=Math.abs(N),_=Math.abs(j);g.current===null&&(g.current=i&&I>_?"x":"y"),g.current==="y"?h(b,j):m(b,N)}function v(b){e&&(d.current=b.detail===u.current)}return[x,v]}function l6n(e,t,n,r){const[o,i]=f.useMemo(()=>[new Map,[]],[e,n.id,r]);return(l,c=l)=>{let u=o.get(l),d=o.get(c);if(u===void 0||d===void 0){const p=e.length;for(let h=i.length;h{let m=!1;i.current.forEach((g,y)=>{if(g&&g.offsetParent){const{offsetHeight:x}=g,{marginTop:v,marginBottom:b}=getComputedStyle(g),w=KOe(v),S=KOe(b),C=x+w+S;s.current.get(y)!==C&&(s.current.set(y,C),m=!0)}}),m&&o(g=>g+1)};if(p)h();else{l.current+=1;const m=l.current;Promise.resolve().then(()=>{m===l.current&&h()})}}function d(p,h){const m=e(p);i.current.get(m),h?(i.current.set(m,h),u()):i.current.delete(m)}return f.useEffect(()=>c,[]),[d,u,s.current,r]}const YOe=14/15;function d6n(e,t,n){const r=f.useRef(!1),o=f.useRef(0),i=f.useRef(0),s=f.useRef(null),l=f.useRef(null);let c;const u=h=>{if(r.current){const m=Math.ceil(h.touches[0].pageX),g=Math.ceil(h.touches[0].pageY);let y=o.current-m,x=i.current-g;const v=Math.abs(y)>Math.abs(x);v?o.current=m:i.current=g;const b=n(v,v?y:x,!1,h);b&&h.preventDefault(),clearInterval(l.current),b&&(l.current=setInterval(()=>{v?y*=YOe:x*=YOe;const w=Math.floor(v?y:x);(!n(v,w,!0)||Math.abs(w)<=.1)&&clearInterval(l.current)},16))}},d=()=>{r.current=!1,c()},p=h=>{c(),h.touches.length===1&&!r.current&&(r.current=!0,o.current=Math.ceil(h.touches[0].pageX),i.current=Math.ceil(h.touches[0].pageY),s.current=h.target,s.current.addEventListener("touchmove",u,{passive:!1}),s.current.addEventListener("touchend",d,{passive:!0}))};c=()=>{s.current&&(s.current.removeEventListener("touchmove",u),s.current.removeEventListener("touchend",d))},Po(()=>(e&&t.current.addEventListener("touchstart",p,{passive:!0}),()=>{var h;(h=t.current)==null||h.removeEventListener("touchstart",p),c(),clearInterval(l.current)}),[e])}function XOe(e){return Math.floor(e**.5)}function jce(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}function f6n(e,t,n){f.useEffect(()=>{const r=t.current;if(e&&r){let o=!1,i,s;const l=()=>{Bo.cancel(i)},c=()=>{l(),i=Bo(()=>{n(s),c()})},u=()=>{o=!1,l()},d=h=>{if(h.target.draggable||h.button!==0)return;const m=h;m._virtualHandled||(m._virtualHandled=!0,o=!0)},p=h=>{if(o){const m=jce(h,!1),{top:g,bottom:y}=r.getBoundingClientRect();if(m<=g){const x=g-m;s=-XOe(x),c()}else if(m>=y){const x=m-y;s=XOe(x),c()}else l()}};return r.addEventListener("mousedown",d),r.ownerDocument.addEventListener("mouseup",u),r.ownerDocument.addEventListener("mousemove",p),r.ownerDocument.addEventListener("dragend",u),()=>{r.removeEventListener("mousedown",d),r.ownerDocument.removeEventListener("mouseup",u),r.ownerDocument.removeEventListener("mousemove",p),r.ownerDocument.removeEventListener("dragend",u),l()}}},[e])}const p6n=10;function h6n(e,t,n,r,o,i,s,l){const c=f.useRef(),[u,d]=f.useState(null);return Po(()=>{if(u&&u.times({...w}));return}i();const{targetAlign:p,originAlign:h,index:m,offset:g}=u,y=e.current.clientHeight;let x=!1,v=p,b=null;if(y){const w=p||h;let S=0,C=0,N=0;const j=Math.min(t.length-1,m);for(let _=0;_<=j;_+=1){const T=o(t[_]);C=S;const P=n.get(T);N=C+(P===void 0?r:P),S=N}let I=w==="top"?g:y-g;for(let _=j;_>=0;_-=1){const T=o(t[_]),P=n.get(T);if(P===void 0){x=!0;break}if(I-=P,I<=0)break}switch(w){case"top":b=C-g;break;case"bottom":b=N-y+g;break;default:{const{scrollTop:_}=e.current,T=_+y;C<_?v="top":N>T&&(v="bottom")}}b!==null&&s(b),b!==u.lastTop&&(x=!0)}x&&d({...u,times:u.times+1,targetAlign:v,lastTop:b})}},[u,e.current]),p=>{if(p==null){l();return}if(Bo.cancel(c.current),typeof p=="number")s(p);else if(p&&typeof p=="object"){let h;const{align:m}=p;"index"in p?{index:h}=p:h=t.findIndex(y=>o(y)===p.key);const{offset:g=0}=p;d({times:0,index:h,offset:g,originAlign:m})}}}const QOe=f.forwardRef((e,t)=>{const{prefixCls:n,rtl:r,scrollOffset:o,scrollRange:i,onStartMove:s,onStopMove:l,onScroll:c,horizontal:u,spinSize:d,containerSize:p,style:h,thumbStyle:m,showScrollBar:g}=e,[y,x]=f.useState(!1),[v,b]=f.useState(null),[w,S]=f.useState(null),C=!r,N=f.useRef(),j=f.useRef(),[I,_]=f.useState(g),T=f.useRef(),P=()=>{g===!0||g===!1||(clearTimeout(T.current),_(!0),T.current=setTimeout(()=>{_(!1)},3e3))},E=i-p||0,M=p-d||0,R=f.useMemo(()=>o===0||E===0?0:o/E*M,[o,E,M]),$=W=>{W.stopPropagation(),W.preventDefault()},D=f.useRef({top:R,dragging:y,pageY:v,startTop:w});D.current={top:R,dragging:y,pageY:v,startTop:w};const z=W=>{x(!0),b(jce(W,u)),S(D.current.top),s(),W.stopPropagation(),W.preventDefault()};f.useEffect(()=>{const W=X=>{X.preventDefault()},U=N.current,K=j.current;return U.addEventListener("touchstart",W,{passive:!1}),K.addEventListener("touchstart",z,{passive:!1}),()=>{U.removeEventListener("touchstart",W),K.removeEventListener("touchstart",z)}},[]);const V=f.useRef();V.current=E;const B=f.useRef();B.current=M,f.useEffect(()=>{if(y){let W;const U=X=>{const{dragging:J,pageY:te,startTop:re}=D.current;Bo.cancel(W);const ce=N.current.getBoundingClientRect(),ae=p/(u?ce.width:ce.height);if(J){const oe=(jce(X,u)-te)*ae;let ue=re;!C&&u?ue-=oe:ue+=oe;const fe=V.current,se=B.current,ge=se?ue/se:0;let ye=Math.ceil(ge*fe);ye=Math.max(ye,0),ye=Math.min(ye,fe),W=Bo(()=>{c(ye,u)})}},K=()=>{x(!1),l()};return window.addEventListener("mousemove",U,{passive:!0}),window.addEventListener("touchmove",U,{passive:!0}),window.addEventListener("mouseup",K,{passive:!0}),window.addEventListener("touchend",K,{passive:!0}),()=>{window.removeEventListener("mousemove",U),window.removeEventListener("touchmove",U),window.removeEventListener("mouseup",K),window.removeEventListener("touchend",K),Bo.cancel(W)}}},[y]),f.useEffect(()=>(P(),()=>{clearTimeout(T.current)}),[o]),f.useImperativeHandle(t,()=>({delayHidden:P}));const G=`${n}-scrollbar`,H={position:"absolute",visibility:I?null:"hidden"},F={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return u?(Object.assign(H,{height:8,left:0,right:0,bottom:0}),Object.assign(F,{height:"100%",width:d,[C?"left":"right"]:R})):(Object.assign(H,{width:8,top:0,bottom:0,[C?"right":"left"]:0}),Object.assign(F,{width:"100%",height:d,top:R})),f.createElement("div",{ref:N,className:be(G,{[`${G}-horizontal`]:u,[`${G}-vertical`]:!u,[`${G}-visible`]:I}),style:{...H,...h},onMouseDown:$,onMouseMove:P},f.createElement("div",{ref:j,className:be(`${G}-thumb`,{[`${G}-thumb-moving`]:y}),style:{...F,...m},onMouseDown:z}))}),m6n=20;function JOe(e=0,t=0){let n=e/t*e;return isNaN(n)&&(n=0),n=Math.max(n,m6n),Math.floor(n)}const g6n=[],x6n={overflowY:"auto",overflowAnchor:"none"};function y6n(e,t){const{prefixCls:n="rc-virtual-list",className:r,height:o,itemHeight:i,fullHeight:s=!0,style:l,data:c,children:u,itemKey:d,virtual:p,direction:h,scrollWidth:m,component:g="div",onScroll:y,onVirtualScroll:x,onVisibleChange:v,innerProps:b,extraRender:w,styles:S,showScrollBar:C="optional",...N}=e,j=f.useCallback(ot=>typeof d=="function"?d(ot):ot==null?void 0:ot[d],[d]),[I,_,T,P]=u6n(j),E=!!(p!==!1&&o&&i),M=f.useMemo(()=>Object.values(T.maps).reduce((ot,mt)=>ot+mt,0),[T.id,T.maps]),R=E&&c&&(Math.max(i*c.length,M)>o||!!m),$=h==="rtl",D=be(n,{[`${n}-rtl`]:$},r),z=c||g6n,V=f.useRef(),B=f.useRef(),G=f.useRef(),[H,F]=f.useState(0),[W,U]=f.useState(0),[K,X]=f.useState(!1),J=()=>{X(!0)},te=()=>{X(!1)},re={getKey:j};function ce(ot){F(mt=>{let Ht;typeof ot=="function"?Ht=ot(mt):Ht=ot;const jt=Ye(Ht);return V.current.scrollTop=jt,jt})}const ae=f.useRef({start:0,end:z.length}),oe=f.useRef(),[ue]=a6n(z,j);oe.current=ue;const{scrollHeight:fe,start:se,end:ge,offset:ye}=f.useMemo(()=>{var nn;if(!E)return{scrollHeight:void 0,start:0,end:z.length-1,offset:void 0};if(!R)return{scrollHeight:((nn=B.current)==null?void 0:nn.offsetHeight)||0,start:0,end:z.length-1,offset:void 0};let ot=0,mt,Ht,jt;const Vt=z.length;for(let zt=0;zt=H&&mt===void 0&&(mt=zt,Ht=ot),Zt>H+o&&jt===void 0&&(jt=zt),ot=Zt}return mt===void 0&&(mt=0,Ht=0,jt=Math.ceil(o/i)),jt===void 0&&(jt=z.length-1),jt=Math.min(jt+1,z.length-1),{scrollHeight:ot,start:mt,end:jt,offset:Ht}},[R,E,H,z,P,o]);ae.current.start=se,ae.current.end=ge,f.useLayoutEffect(()=>{const ot=T.getRecord();if(ot.size===1){const mt=Array.from(ot.keys())[0],Ht=ot.get(mt),jt=z[se];if(jt&&Ht===void 0&&j(jt)===mt){const zt=T.get(mt)-i;ce(Nn=>Nn+zt)}}T.resetRecord()},[fe]);const[de,Ne]=f.useState({width:0,height:o}),_e=ot=>{Ne({width:ot.offsetWidth,height:ot.offsetHeight})},xe=f.useRef(),we=f.useRef(),Te=f.useMemo(()=>JOe(de.width,m),[de.width,m]),Re=f.useMemo(()=>JOe(de.height,fe),[de.height,fe]),Ue=fe-o,He=f.useRef(Ue);He.current=Ue;function Ye(ot){let mt=ot;return Number.isNaN(He.current)||(mt=Math.min(mt,He.current)),mt=Math.max(mt,0),mt}const We=H<=0,at=H>=Ue,Oe=W<=0,Ae=W>=m,qe=ilt(We,at,Oe,Ae),dt=()=>({x:$?-W:W,y:H}),Ze=f.useRef(dt()),Qe=Vr(ot=>{if(x){const mt={...dt(),...ot};(Ze.current.x!==mt.x||Ze.current.y!==mt.y)&&(x(mt),Ze.current=mt)}});function lt(ot,mt){const Ht=ot;mt?(pu.flushSync(()=>{U(Ht)}),Qe()):ce(Ht)}function bt(ot){const{scrollTop:mt}=ot.currentTarget;mt!==H&&ce(mt),y==null||y(ot),Qe()}const Ct=ot=>{let mt=ot;const Ht=m?m-de.width:0;return mt=Math.max(mt,0),mt=Math.min(mt,Ht),mt},Je=Vr((ot,mt)=>{mt?(pu.flushSync(()=>{U(Ht=>{const jt=Ht+($?-ot:ot);return Ct(jt)})}),Qe()):ce(Ht=>Ht+ot)}),[Pe,Me]=s6n(E,We,at,Oe,Ae,!!m,Je);d6n(E,V,(ot,mt,Ht,jt)=>{const Vt=jt;return qe(ot,mt,Ht)?!1:!Vt||!Vt._virtualHandled?(Vt&&(Vt._virtualHandled=!0),Pe({preventDefault(){},deltaX:ot?mt:0,deltaY:ot?0:mt}),!0):!1}),f6n(R,V,ot=>{ce(mt=>mt+ot)}),Po(()=>{function ot(Ht){const jt=We&&Ht.detail<0,Vt=at&&Ht.detail>0;E&&!jt&&!Vt&&Ht.preventDefault()}const mt=V.current;return mt.addEventListener("wheel",Pe,{passive:!1}),mt.addEventListener("DOMMouseScroll",Me,{passive:!0}),mt.addEventListener("MozMousePixelScroll",ot,{passive:!1}),()=>{mt.removeEventListener("wheel",Pe),mt.removeEventListener("DOMMouseScroll",Me),mt.removeEventListener("MozMousePixelScroll",ot)}},[E,We,at]),Po(()=>{if(m){const ot=Ct(W);U(ot),Qe({x:ot})}},[de.width,m]);const et=()=>{var ot,mt;(ot=xe.current)==null||ot.delayHidden(),(mt=we.current)==null||mt.delayHidden()},vt=h6n(V,z,T,i,j,()=>_(!0),ce,et);f.useImperativeHandle(t,()=>({nativeElement:G.current,getScrollInfo:dt,scrollTo:ot=>{function mt(Ht){return Ht&&typeof Ht=="object"&&("left"in Ht||"top"in Ht)}mt(ot)?(ot.left!==void 0&&U(Ct(ot.left)),vt(ot.top)):vt(ot)}})),Po(()=>{if(v){const ot=z.slice(se,ge+1);v(ot,z)}},[se,ge,z]);const Pt=l6n(z,j,T,i),Jt=w==null?void 0:w({start:se,end:ge,virtual:R,offsetX:W,offsetY:ye,rtl:$,getSize:Pt}),dn=o6n(z,se,ge,m,W,I,u,re);let Et=null;o&&(Et={[s?"height":"maxHeight"]:o,...x6n},E&&(Et.overflowY="hidden",m&&(Et.overflowX="hidden"),K&&(Et.pointerEvents="none")));const sn={};return $&&(sn.dir="rtl"),f.createElement("div",Se({ref:G,style:{...l,position:"relative"},className:D},sn,N),f.createElement(Uf,{onResize:_e},f.createElement(g,{className:`${n}-holder`,style:Et,ref:V,onScroll:bt,onMouseEnter:et},f.createElement(olt,{prefixCls:n,height:fe,offsetX:W,offsetY:ye,scrollWidth:m,onInnerResize:_,ref:B,innerProps:b,rtl:$,extra:Jt},dn))),R&&fe>o&&f.createElement(QOe,{ref:xe,prefixCls:n,scrollOffset:H,scrollRange:fe,rtl:$,onScroll:lt,onStartMove:J,onStopMove:te,spinSize:Re,containerSize:de.height,style:S==null?void 0:S.verticalScrollBar,thumbStyle:S==null?void 0:S.verticalScrollBarThumb,showScrollBar:C}),R&&m>de.width&&f.createElement(QOe,{ref:we,prefixCls:n,scrollOffset:W,scrollRange:m,rtl:$,onScroll:lt,onStartMove:J,onStopMove:te,spinSize:Te,containerSize:de.width,horizontal:!0,style:S==null?void 0:S.horizontalScrollBar,thumbStyle:S==null?void 0:S.horizontalScrollBarThumb,showScrollBar:C}))}const VK=f.forwardRef(y6n);VK.displayName="List";function v6n(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}function _O(){return _O=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var re,ce;const{prefixCls:n,id:r,open:o,multiple:i,mode:s,searchValue:l,toggleOpen:c,notFoundContent:u,onPopupScroll:d,showScrollBar:p}=f5(),{maxCount:h,flattenOptions:m,onActiveValue:g,defaultActiveFirstOption:y,onSelect:x,menuItemSelectedIcon:v,rawValues:b,fieldNames:w,virtual:S,direction:C,listHeight:N,listItemHeight:j,optionRender:I,classNames:_,styles:T}=f.useContext(Yye),P=`${n}-item`,E=u5(()=>m,[o,m],(ae,oe)=>oe[0]&&ae[1]!==oe[1]),M=f.useRef(null),R=f.useMemo(()=>i&&yce(h)&&(b==null?void 0:b.size)>=h,[i,h,b==null?void 0:b.size]),$=ae=>{ae.preventDefault()},D=ae=>{var oe;(oe=M.current)==null||oe.scrollTo(typeof ae=="number"?{index:ae}:ae)},z=f.useCallback(ae=>s==="combobox"?!1:b.has(ae),[s,[...b].toString(),b.size]),V=(ae,oe=1)=>{const ue=E.length;for(let fe=0;feV(0)),H=(ae,oe=!1)=>{G(ae);const ue={source:oe?"keyboard":"mouse"},fe=E[ae];if(!fe){g(null,-1,ue);return}g(fe.value,ae,ue)};f.useEffect(()=>{H(y!==!1?V(0):-1)},[E.length,l]);const F=f.useCallback(ae=>s==="combobox"?String(ae).toLowerCase()===l.toLowerCase():b.has(ae),[s,l,[...b].toString(),b.size]);f.useEffect(()=>{var oe;let ae;if(!i&&o&&b.size===1){const ue=Array.from(b)[0],fe=E.findIndex(({data:se})=>l?String(se.value).startsWith(l):se.value===ue);fe!==-1&&(H(fe),ae=setTimeout(()=>{D(fe)}))}return o&&((oe=M.current)==null||oe.scrollTo(void 0)),()=>clearTimeout(ae)},[o,l]);const W=ae=>{ae!==void 0&&x(ae,{selected:!b.has(ae)}),i||c(!1)};if(f.useImperativeHandle(t,()=>({onKeyDown:ae=>{const{which:oe,ctrlKey:ue}=ae;switch(oe){case Ir.N:case Ir.P:case Ir.UP:case Ir.DOWN:{let fe=0;if(oe===Ir.UP?fe=-1:oe===Ir.DOWN?fe=1:v6n()&&ue&&(oe===Ir.N?fe=1:oe===Ir.P&&(fe=-1)),fe!==0){const se=V(B+fe,fe);D(se),H(se,!0)}break}case Ir.TAB:case Ir.ENTER:{const fe=E[B];if(!fe||fe.data.disabled)return W(void 0);!R||b.has(fe.value)?W(fe.value):W(void 0),o&&ae.preventDefault();break}case Ir.ESC:c(!1),o&&ae.stopPropagation()}},onKeyUp:()=>{},scrollTo:ae=>{D(ae)}})),E.length===0)return f.createElement("div",{role:"listbox",id:`${r}_list`,className:`${P}-empty`,onMouseDown:$},u);const U=Object.keys(w).map(ae=>w[ae]),K=ae=>ae.label;function X(ae,oe){const{group:ue}=ae;return{role:ue?"presentation":"option",id:`${r}_list_${oe}`}}const J=ae=>{const oe=E[ae];if(!oe)return null;const ue=oe.data||{},{value:fe}=ue,{group:se}=oe,ge=fl(ue,!0),ye=K(oe);return oe?f.createElement("div",_O({"aria-label":typeof ye=="string"&&!se?ye:null},ge,{key:ae},X(oe,ae),{"aria-selected":F(fe)}),fe):null},te={role:"listbox",id:`${r}_list`};return f.createElement(f.Fragment,null,S&&f.createElement("div",_O({},te,{style:{height:0,width:0,overflow:"hidden"}}),J(B-1),J(B),J(B+1)),f.createElement(VK,{itemKey:"key",ref:M,data:E,height:N,itemHeight:j,fullHeight:!1,onMouseDown:$,onScroll:d,virtual:S,direction:C,innerProps:S?null:te,showScrollBar:p,className:(re=_==null?void 0:_.popup)==null?void 0:re.list,style:(ce=T==null?void 0:T.popup)==null?void 0:ce.list},(ae,oe)=>{var Ze,Qe;const{group:ue,groupOption:fe,data:se,label:ge,value:ye}=ae,{key:de}=se;if(ue){const lt=se.title??(ZOe(ge)?ge.toString():void 0);return f.createElement("div",{className:be(P,`${P}-group`,se.className),title:lt},ge!==void 0?ge:de)}const{disabled:Ne,title:_e,children:xe,style:we,className:Te,...Re}=se,Ue=za(Re,U),He=z(ye),Ye=Ne||!He&&R,We=`${P}-option`,at=be(P,We,Te,(Ze=_==null?void 0:_.popup)==null?void 0:Ze.listItem,{[`${We}-grouped`]:fe,[`${We}-active`]:B===oe&&!Ye,[`${We}-disabled`]:Ye,[`${We}-selected`]:He}),Oe=K(ae),Ae=!v||typeof v=="function"||He,qe=typeof Oe=="number"?Oe:Oe||ye;let dt=ZOe(qe)?qe.toString():void 0;return _e!==void 0&&(dt=_e),f.createElement("div",_O({},fl(Ue),S?{}:X(ae,oe),{"aria-selected":S?void 0:F(ye),className:at,title:dt,onMouseMove:()=>{B===oe||Ye||H(oe)},onClick:()=>{Ye||W(ye)},style:{...(Qe=T==null?void 0:T.popup)==null?void 0:Qe.listItem,...we}}),f.createElement("div",{className:`${We}-content`},typeof I=="function"?I(ae,{index:oe}):qe),f.isValidElement(v)||He,Ae&&f.createElement(rlt,{className:`${P}-option-state`,customizeIcon:v,customizeIconProps:{value:ye,disabled:Ye,isSelected:He}},He?"✓":null))}))},w6n=f.forwardRef(b6n),S6n=((e,t)=>{const n=f.useRef({values:new Map,options:new Map}),r=f.useMemo(()=>{const{values:i,options:s}=n.current,l=e.map(d=>{var p;return d.label===void 0?{...d,label:(p=i.get(d.value))==null?void 0:p.label}:d}),c=new Map,u=new Map;return l.forEach(d=>{c.set(d.value,d),u.set(d.value,t.get(d.value)||s.get(d.value))}),n.current.values=c,n.current.options=u,l},[e,t]),o=f.useCallback(i=>t.get(i)||n.current.options.get(i),[t]);return[r,o]});function ute(e,t){return elt(e).join("").toUpperCase().includes(t)}const C6n=((e,t,n,r,o)=>f.useMemo(()=>{if(!n||r===!1)return e;const{options:i,label:s,value:l}=t,c=[],u=typeof r=="function",d=n.toUpperCase(),p=u?r:(m,g)=>o&&o.length?o.some(y=>ute(g[y],d)):g[i]?ute(g[s!=="children"?s:"label"],d):ute(g[l],d),h=u?m=>vce(m):m=>m;return e.forEach(m=>{if(m[i]){if(p(n,h(m)))c.push(m);else{const y=m[i].filter(x=>p(n,h(x)));y.length&&c.push({...m,[i]:y})}return}p(n,h(m))&&c.push(m)}),c},[e,r,o,n,t]));function N6n(e){const{key:t,props:{children:n,value:r,...o}}=e;return{key:t,value:r!==void 0?r:t,children:n,...o}}function alt(e,t=!1){return Bu(e).map((n,r)=>{if(!f.isValidElement(n)||!n.type)return null;const{type:{isSelectOptGroup:o},key:i,props:{children:s,...l}}=n;return t||!o?N6n(n):{key:`__RC_SELECT_GRP__${i===null?r:i}__`,label:i,...l,options:alt(s)}}).filter(n=>n)}const j6n=(e,t,n,r,o)=>f.useMemo(()=>{let i=e;!e&&(i=alt(t));const l=new Map,c=new Map,u=(p,h,m)=>{m&&typeof m=="string"&&p.set(h[m],h)},d=(p,h=!1)=>{for(let m=0;m{u(c,g,y)}),u(c,g,o)):d(g[n.options],!0)}};return d(i),{options:i,valueOptions:l,labelOptions:c}},[e,t,n,r,o]);function e3e(e){const t=f.useRef();return t.current=e,f.useCallback((...r)=>t.current(...r),[])}function E6n(e,t,n){const{filterOption:r,searchValue:o,optionFilterProp:i,filterSort:s,onSearch:l,autoClearSearchValue:c}=t;return f.useMemo(()=>{const u=typeof e=="object",d={filterOption:r,searchValue:o,optionFilterProp:i,filterSort:s,onSearch:l,autoClearSearchValue:c,...u?e:{}};return[u||n==="combobox"||n==="tags"||n==="multiple"&&e===void 0?!0:e,d]},[n,e,r,o,i,s,l,c])}function Ece(){return Ece=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{id:n,mode:r,prefixCls:o="rc-select",backfill:i,fieldNames:s,showSearch:l,searchValue:c,onSearch:u,autoClearSearchValue:d,filterOption:p,optionFilterProp:h,filterSort:m,onSelect:g,onDeselect:y,onActive:x,popupMatchSelectWidth:v=!0,optionLabelProp:b,options:w,optionRender:S,children:C,defaultActiveFirstOption:N,menuItemSelectedIcon:j,virtual:I,direction:_,listHeight:T=200,listItemHeight:P=20,labelRender:E,value:M,defaultValue:R,labelInValue:$,onChange:D,maxCount:z,classNames:V,styles:B,...G}=e,H={searchValue:c,onSearch:u,autoClearSearchValue:d,filterOption:p,optionFilterProp:h,filterSort:m},[F,W]=E6n(l,H,r),{filterOption:U,searchValue:K,optionFilterProp:X,filterSort:J,onSearch:te,autoClearSearchValue:re=!0}=W,ce=f.useMemo(()=>X?Array.isArray(X)?X:[X]:[],[X]),ae=Jw(n),oe=Nce(r),ue=!!(!w&&C),fe=f.useMemo(()=>U===void 0&&r==="combobox"?!1:U,[U,r]),se=f.useMemo(()=>Xst(s,ue),[JSON.stringify(s),ue]),[ge,ye]=Fa("",K),de=ge||"",Ne=j6n(w,C,se,ce,b),{valueOptions:_e,labelOptions:xe,options:we}=Ne,Te=f.useCallback(jt=>elt(jt).map(nn=>{let zt,Nn,xr,ur;_6n(nn)?zt=nn:(Nn=nn.label,zt=nn.value);const Zt=_e.get(zt);return Zt&&(Nn===void 0&&(Nn=Zt==null?void 0:Zt[b||se.label]),xr=Zt==null?void 0:Zt.disabled,ur=Zt==null?void 0:Zt.title),{label:Nn,value:zt,key:zt,disabled:xr,title:ur}}),[se,b,_e]),[Re,Ue]=Fa(R,M),He=f.useMemo(()=>{var nn;const Vt=Te(oe&&Re===null?[]:Re);return r==="combobox"&&zLn((nn=Vt[0])==null?void 0:nn.value)?[]:Vt},[Re,Te,r,oe]),[Ye,We]=S6n(He,_e),at=f.useMemo(()=>{if(!r&&Ye.length===1){const jt=Ye[0];if(jt.value===null&&(jt.label===null||jt.label===void 0))return[]}return Ye.map(jt=>({...jt,label:(typeof E=="function"?E(jt):jt.label)??jt.value}))},[r,Ye,E]),Oe=f.useMemo(()=>new Set(Ye.map(jt=>jt.value)),[Ye]);f.useEffect(()=>{var jt;if(r==="combobox"){const Vt=(jt=Ye[0])==null?void 0:jt.value;ye(FLn(Vt)?String(Vt):"")}},[Ye]);const Ae=e3e((jt,Vt)=>{const nn=Vt??jt;return{[se.value]:jt,[se.label]:nn}}),qe=f.useMemo(()=>{if(r!=="tags")return we;const jt=[...we],Vt=nn=>_e.has(nn);return[...Ye].sort((nn,zt)=>nn.value{const zt=nn.value;Vt(zt)||jt.push(Ae(zt,nn.label))}),jt},[Ae,we,_e,Ye,r]),dt=C6n(qe,se,de,fe,ce),Ze=f.useMemo(()=>{const jt=Vt=>ce.length?ce.some(nn=>(Vt==null?void 0:Vt[nn])===de):(Vt==null?void 0:Vt.value)===de;return r!=="tags"||!de||dt.some(Vt=>jt(Vt))||dt.some(Vt=>Vt[se.value]===de)?dt:[Ae(de),...dt]},[Ae,ce,r,dt,de,se]),Qe=jt=>[...jt].sort((nn,zt)=>J(nn,zt,{searchValue:de})).map(nn=>Array.isArray(nn.options)?{...nn,options:nn.options.length>0?Qe(nn.options):nn.options}:nn),lt=f.useMemo(()=>J?Qe(Ze):Ze,[Ze,J,de]),bt=f.useMemo(()=>RLn(lt,{fieldNames:se,childrenAsData:ue}),[lt,se,ue]),Ct=jt=>{const Vt=Te(jt);if(Ue(Vt),D&&(Vt.length!==Ye.length||Vt.some((nn,zt)=>{var Nn;return((Nn=Ye[zt])==null?void 0:Nn.value)!==(nn==null?void 0:nn.value)}))){const nn=$?Vt.map(({label:Nn,value:xr})=>({label:Nn,value:xr})):Vt.map(Nn=>Nn.value),zt=Vt.map(Nn=>vce(We(Nn.value)));D(oe?nn:nn[0],oe?zt:zt[0])}},[Je,Pe]=f.useState(null),[Me,et]=f.useState(0),vt=N!==void 0?N:r!=="combobox",Pt=f.useRef(),Jt=f.useCallback((jt,Vt,{source:nn="keyboard"}={})=>{et(Vt),i&&r==="combobox"&&jt!==null&&nn==="keyboard"&&Pe(String(jt));const zt=Promise.resolve().then(()=>{Pt.current===zt&&(x==null||x(jt))});Pt.current=zt},[i,r,x]),dn=(jt,Vt,nn)=>{const zt=()=>{const Nn=We(jt);return[$?{label:Nn==null?void 0:Nn[se.label],value:jt}:jt,vce(Nn)]};if(Vt&&g){const[Nn,xr]=zt();g(Nn,xr)}else if(!Vt&&y&&nn!=="clear"){const[Nn,xr]=zt();y(Nn,xr)}},Et=e3e((jt,Vt)=>{let nn;const zt=oe?Vt.selected:!0;zt?nn=oe?[...Ye,jt]:[jt]:nn=Ye.filter(Nn=>Nn.value!==jt),Ct(nn),dn(jt,zt),r==="combobox"?Pe(""):(!Nce||re)&&(ye(""),Pe(""))}),sn=(jt,Vt)=>{Ct(jt);const{type:nn,values:zt}=Vt;(nn==="remove"||nn==="clear")&&zt.forEach(Nn=>{dn(Nn.value,!1,nn)})},ot=(jt,Vt)=>{if(ye(jt),Pe(null),Vt.source==="submit"){const nn=(jt||"").trim();if(nn){const zt=Array.from(new Set([...Oe,nn]));Ct(zt),dn(nn,!0),ye("")}return}Vt.source!=="blur"&&(r==="combobox"&&Ct(jt),te==null||te(jt))},mt=jt=>{let Vt=jt;r!=="tags"&&(Vt=jt.map(zt=>{const Nn=xe.get(zt);return Nn==null?void 0:Nn.value}).filter(zt=>zt!==void 0));const nn=Array.from(new Set([...Oe,...Vt]));Ct(nn),nn.forEach(zt=>{dn(zt,!0)})},Ht=f.useMemo(()=>({...Ne,flattenOptions:bt,onActiveValue:Jt,defaultActiveFirstOption:vt,onSelect:Et,menuItemSelectedIcon:j,rawValues:Oe,fieldNames:se,virtual:I!==!1&&v!==!1,direction:_,listHeight:T,listItemHeight:P,childrenAsData:ue,maxCount:z,optionRender:S,classNames:V,styles:B}),[z,Ne,bt,Jt,vt,Et,j,Oe,se,I,v,_,T,P,ue,S,V,B]);return f.createElement(Yye.Provider,{value:Ht},f.createElement(n6n,Ece({},G,{id:ae,prefixCls:o,ref:t,omitDomProps:I6n,mode:r,classNames:V,styles:B,displayValues:at,onDisplayValuesChange:sn,maxCount:z,direction:_,showSearch:F,searchValue:de,onSearch:ot,autoClearSearchValue:re,onSearchSplit:mt,popupMatchSelectWidth:v,OptionList:w6n,emptyOptions:!bt.length,activeValue:Je,activeDescendantId:`${ae}_list_${Me}`})))}),Jye=P6n;Jye.Option=Qye;Jye.OptGroup=Xye;const SI=(e,t,n)=>be({[`${e}-status-success`]:t==="success",[`${e}-status-warning`]:t==="warning",[`${e}-status-error`]:t==="error",[`${e}-status-validating`]:t==="validating",[`${e}-has-feedback`]:n}),Fk=(e,t)=>t||e,A6n=()=>{const[,e]=Xf(),[t]=xg("Empty"),r=new Hi(e.colorBgBase).toHsl().l<.5?{opacity:.65}:{};return f.createElement("svg",{style:r,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},f.createElement("title",null,(t==null?void 0:t.description)||"Empty"),f.createElement("g",{fill:"none",fillRule:"evenodd"},f.createElement("g",{transform:"translate(24 31.67)"},f.createElement("ellipse",{fillOpacity:".8",fill:"#F5F5F7",cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),f.createElement("path",{d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",fill:"#AEB8C2"}),f.createElement("path",{d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",fill:"url(#linearGradient-1)",transform:"translate(13.56)"}),f.createElement("path",{d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",fill:"#F5F5F7"}),f.createElement("path",{d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",fill:"#DCE0E6"})),f.createElement("path",{d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",fill:"#DCE0E6"}),f.createElement("g",{transform:"translate(149.65 15.383)",fill:"#FFF"},f.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),f.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},T6n=()=>{const[,e]=Xf(),[t]=xg("Empty"),{colorFill:n,colorFillTertiary:r,colorFillQuaternary:o,colorBgContainer:i}=e,{borderColor:s,shadowColor:l,contentColor:c}=f.useMemo(()=>({borderColor:new Hi(n).onBackground(i).toHexString(),shadowColor:new Hi(r).onBackground(i).toHexString(),contentColor:new Hi(o).onBackground(i).toHexString()}),[n,r,o,i]);return f.createElement("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},f.createElement("title",null,(t==null?void 0:t.description)||"Empty"),f.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},f.createElement("ellipse",{fill:l,cx:"32",cy:"33",rx:"32",ry:"7"}),f.createElement("g",{fillRule:"nonzero",stroke:s},f.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),f.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:c}))))},k6n=e=>{const{componentCls:t,margin:n,marginXS:r,marginXL:o,fontSize:i,lineHeight:s}=e;return{[t]:{marginInline:r,fontSize:i,lineHeight:s,textAlign:"center",[`${t}-image`]:{height:e.emptyImgHeight,marginBottom:r,opacity:e.opacityImage,img:{height:"100%"},svg:{maxWidth:"100%",height:"100%",margin:"auto"}},[`${t}-description`]:{color:e.colorTextDescription},[`${t}-footer`]:{marginTop:n},"&-normal":{marginBlock:o,color:e.colorTextDescription,[`${t}-description`]:{color:e.colorTextDescription},[`${t}-image`]:{height:e.emptyImgHeightMD}},"&-small":{marginBlock:r,color:e.colorTextDescription,[`${t}-image`]:{height:e.emptyImgHeightSM}}}}},M6n=ui("Empty",e=>{const{componentCls:t,controlHeightLG:n,calc:r}=e,o=Ho(e,{emptyImgCls:`${t}-img`,emptyImgHeight:r(n).mul(2.5).equal(),emptyImgHeightMD:n,emptyImgHeightSM:r(n).mul(.875).equal()});return k6n(o)}),slt=f.createElement(A6n,null),llt=f.createElement(T6n,null),i0=e=>{const{className:t,rootClassName:n,prefixCls:r,image:o,description:i,children:s,imageStyle:l,style:c,classNames:u,styles:d,...p}=e,{getPrefixCls:h,direction:m,className:g,style:y,classNames:x,styles:v,image:b}=Zo("empty"),w=h("empty",r),[S,C]=M6n(w),[N,j]=di([x,u],[v,d],{props:e}),[I]=xg("Empty"),_=typeof i<"u"?i:I==null?void 0:I.description,T=typeof _=="string"?_:"empty",P=o??b??slt;let E=null;return typeof P=="string"?E=f.createElement("img",{draggable:!1,alt:T,src:P}):E=P,f.createElement("div",{className:be(S,C,w,g,{[`${w}-normal`]:P===llt,[`${w}-rtl`]:m==="rtl"},t,n,N.root),style:{...j.root,...y,...c},...p},f.createElement("div",{className:be(`${w}-image`,N.image),style:{...l,...j.image}},E),_&&f.createElement("div",{className:be(`${w}-description`,N.description),style:j.description},_),s&&f.createElement("div",{className:be(`${w}-footer`,N.footer),style:j.footer},s))};i0.PRESENTED_IMAGE_DEFAULT=slt;i0.PRESENTED_IMAGE_SIMPLE=llt;const Zye=e=>{const{componentName:t}=e,{getPrefixCls:n}=f.useContext(Qr),r=n("empty");switch(t){case"Table":case"List":return Ie.createElement(i0,{image:i0.PRESENTED_IMAGE_SIMPLE});case"Select":case"TreeSelect":case"Cascader":case"Transfer":case"Mentions":return Ie.createElement(i0,{image:i0.PRESENTED_IMAGE_SIMPLE,className:`${r}-small`});case"Table.filter":return null;default:return Ie.createElement(i0,null)}},zk=(e,t,n)=>{const{variant:r,[e]:o}=f.useContext(Qr),i=f.useContext(vst),s=o==null?void 0:o.variant;let l;typeof t<"u"?l=t:n===!1?l="borderless":l=i??s??r??"outlined";const c=a4n.includes(l);return[l,c]},R6n=e=>{const n={overflow:{adjustX:!0,adjustY:!0,shiftY:!0},htmlRegion:e==="scroll"?"scroll":"visible",dynamicInset:!0};return{bottomLeft:{...n,points:["tl","bl"],offset:[0,4]},bottomRight:{...n,points:["tr","br"],offset:[0,4]},topLeft:{...n,points:["bl","tl"],offset:[0,-4]},topRight:{...n,points:["br","tr"],offset:[0,-4]}}};function O6n(e,t){return e||R6n(t)}const t3e=e=>{const{optionHeight:t,optionFontSize:n,optionLineHeight:r,optionPadding:o}=e;return{position:"relative",display:"block",minHeight:t,padding:o,color:e.colorText,fontWeight:"normal",fontSize:n,lineHeight:r,boxSizing:"border-box"}},$6n=e=>{const{antCls:t,componentCls:n}=e,r=`${n}-item`,o=`&${t}-slide-up-enter${t}-slide-up-enter-active`,i=`&${t}-slide-up-appear${t}-slide-up-appear-active`,s=`&${t}-slide-up-leave${t}-slide-up-leave-active`,l=`${n}-dropdown-placement-`,c=`${r}-option-selected`;return[{[`${n}-dropdown`]:{...Ii(e),position:"absolute",top:-9999,zIndex:e.zIndexPopup,boxSizing:"border-box",padding:e.paddingXXS,overflow:"hidden",fontSize:e.fontSize,fontVariant:"initial",backgroundColor:e.colorBgElevated,borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,[` ${o}${l}bottomLeft, ${i}${l}bottomLeft `]:{animationName:DK},[` ${o}${l}topLeft, ${i}${l}topLeft, ${o}${l}topRight, ${i}${l}topRight `]:{animationName:FK},[`${s}${l}bottomLeft`]:{animationName:LK},[` ${s}${l}topLeft, ${s}${l}topRight `]:{animationName:zK},"&-hidden":{display:"none"},[r]:{...t3e(e),cursor:"pointer",transition:`background-color ${e.motionDurationSlow} ease`,borderRadius:e.borderRadiusSM,"&-group":{color:e.colorTextDescription,fontSize:e.fontSizeSM,cursor:"default"},"&-option":{display:"flex","&-content":{flex:"auto",...wh},"&-state":{flex:"none",display:"flex",alignItems:"center"},[`&-active:not(${r}-option-disabled)`]:{backgroundColor:e.optionActiveBg},[`&-selected:not(${r}-option-disabled)`]:{color:e.optionSelectedColor,fontWeight:e.optionSelectedFontWeight,backgroundColor:e.optionSelectedBg,[`${r}-option-state`]:{color:e.colorPrimary}},"&-disabled":{[`&${r}-option-selected`]:{backgroundColor:e.colorBgContainerDisabled},color:e.colorTextDisabled,cursor:"not-allowed"},"&-grouped":{paddingInlineStart:e.calc(e.controlPaddingHorizontal).mul(2).equal()}},"&-empty":{...t3e(e),color:e.colorTextDisabled}},[`${c}:has(+ ${c})`]:{borderEndStartRadius:0,borderEndEndRadius:0,[`& + ${c}`]:{borderStartStartRadius:0,borderStartEndRadius:0}},"&-rtl":{direction:"rtl"}}},xb(e,"slide-up"),xb(e,"slide-down"),PT(e,"move-up"),PT(e,"move-down")]},D6n=e=>{const{componentCls:t}=e;return{[`&${t}-customize`]:{border:0,padding:0,fontSize:"inherit",lineHeight:"inherit",[`${t}-placeholder`]:{display:"none"},[`${t}-content`]:{margin:0,padding:0,"&-value":{display:"none"}}}}},n3e=4,L6n=e=>{const{componentCls:t,calc:n,iconCls:r,paddingXS:o,paddingXXS:i,INTERNAL_FIXED_ITEM_MARGIN:s,lineWidth:l,colorIcon:c,colorIconHover:u,inputPaddingHorizontalBase:d,antCls:p}=e,[h,m]=bi(p,"select");return{"&-multiple":{[h("multi-item-background")]:e.multipleItemBg,[h("multi-item-border-color")]:"transparent",[h("multi-item-border-radius")]:e.borderRadiusSM,[h("multi-item-height")]:e.multipleItemHeight,[h("multi-padding-base")]:`calc((${m("height")} - ${m("multi-item-height")}) / 2)`,[h("multi-padding-vertical")]:`calc(${m("multi-padding-base")} - ${s} - ${l})`,[h("multi-item-padding-horizontal")]:`calc(${d} - ${m("multi-padding-vertical")} - ${l} * 2)`,paddingBlock:m("multi-padding-vertical"),paddingInlineStart:`calc(${m("multi-padding-base")} - ${l})`,[`${t}-prefix`]:{marginInlineStart:m("multi-item-padding-horizontal")},[`${t}-prefix + ${t}-content`]:{[`${t}-placeholder`]:{insetInlineStart:0},[`${t}-content-item${t}-content-item-suffix`]:{marginInlineStart:0}},[`${t}-placeholder`]:{position:"absolute",lineHeight:m("line-height"),insetInlineStart:m("multi-item-padding-horizontal"),width:`calc(100% - ${m("multi-item-padding-horizontal")})`,top:"50%",transform:"translateY(-50%)"},[`${t}-content`]:{flexWrap:"wrap",alignItems:"center",lineHeight:1,"&-item-prefix":{height:m("font-size")},"&-item":{lineHeight:1,maxWidth:`calc(100% - ${n3e}px)`},[`${t}-content-item-prefix + ${t}-content-item-suffix, ${t}-content-item-suffix:first-child`]:{marginInlineStart:m("multi-item-padding-horizontal")},[`${t}-selection-item`]:{lineHeight:`calc(${m("multi-item-height")} - ${l} * 2)`,border:`${l} solid ${m("multi-item-border-color")}`,display:"flex",marginBlock:s,marginInlineEnd:n(s).mul(2).equal(),background:m("multi-item-background"),borderRadius:m("multi-item-border-radius"),paddingInlineStart:o,paddingInlineEnd:i,transition:["height","line-height","padding"].map(g=>`${g} ${e.motionDurationSlow}`).join(","),"&-content":{...wh,marginInlineEnd:i},"&-remove":{...QL(),display:"inline-flex",alignItems:"center",color:c,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${r}`]:{verticalAlign:"-0.2em"},"&:hover":{color:u}}},[`${t}-input`]:{lineHeight:n(s).mul(2).add(m("multi-item-height")).equal(),width:"calc(var(--select-input-width, 0) * 1px)",minWidth:n3e,maxWidth:"100%",transition:`line-height ${e.motionDurationSlow}`}},[`&${t}-sm`]:{[h("multi-item-height")]:e.multipleItemHeightSM,[h("multi-item-border-radius")]:e.borderRadiusXS},[`&${t}-lg`]:{[h("multi-item-height")]:e.multipleItemHeightLG,[h("multi-item-border-radius")]:e.borderRadius},[`&${t}-filled`]:{[h("multi-item-border-color")]:e.colorSplit,[h("multi-item-background")]:e.colorBgContainer,[`&${t}-disabled`]:{[h("multi-item-border-color")]:"transparent"}}}}},dte=(e,t)=>{const{componentCls:n,antCls:r}=e,[o]=bi(r,"select"),{border:i,borderHover:s,borderActive:l,borderOutline:c}=t,u=t.background||e.selectorBg||e.colorBgContainer;return{[o("border-color")]:i,[o("background-color")]:u,[o("color")]:t.color||e.colorText,[`&:not(${n}-disabled)`]:{"&:hover":{[o("border-color")]:s,[o("background-color")]:t.backgroundHover||u},[`&${n}-focused`]:{[o("border-color")]:l,[o("background-color")]:t.backgroundActive||u,boxShadow:`0 0 0 ${Xe(e.controlOutlineWidth)} ${c}`}},[`&${n}-disabled`]:{[o("border-color")]:t.borderDisabled||t.border,[o("background-color")]:t.backgroundDisabled||t.background}}},c7=(e,t,n,r={},o={},i)=>{const{componentCls:s}=e;return{[`&${s}-${t}`]:[dte(e,n),{[`&${s}-status-error`]:dte(e,{...n,color:r.color||e.colorError,...r}),[`&${s}-status-warning`]:dte(e,{...n,color:o.color||e.colorWarning,...o})},i]}},F6n=e=>{const{componentCls:t,fontHeight:n,controlHeight:r,iconCls:o,antCls:i,calc:s}=e,[l,c]=bi(i,"select");return{[t]:[{[l("border-radius")]:e.borderRadius,[l("border-color")]:"#000",[l("border-size")]:e.lineWidth,[l("background-color")]:e.colorBgContainer,[l("font-size")]:e.fontSize,[l("line-height")]:e.lineHeight,[l("font-height")]:n,[l("color")]:e.colorText,[l("height")]:r,[l("padding-horizontal")]:s(e.paddingSM).sub(e.lineWidth).equal(),[l("padding-vertical")]:`calc((${c("height")} - ${c("font-height")}) / 2 - ${c("border-size")})`,...Ii(e,!0),display:"inline-flex",flexWrap:"nowrap",position:"relative",transition:`all ${e.motionDurationSlow}`,alignItems:"flex-start",outline:0,cursor:"pointer",borderRadius:c("border-radius"),borderWidth:c("border-size"),borderStyle:e.lineType,borderColor:c("border-color"),background:c("background-color"),fontSize:c("font-size"),lineHeight:c("line-height"),color:c("color"),paddingInline:c("padding-horizontal"),paddingBlock:c("padding-vertical"),[`${t}-prefix`]:{flex:"none",lineHeight:1},[`${t}-placeholder`]:{...wh,color:e.colorTextPlaceholder,pointerEvents:"none",zIndex:1},[`${t}-content`]:{flex:"auto",minWidth:0,position:"relative",display:"flex",marginInlineEnd:s(e.paddingXXS).mul(1.5).equal(),"&:before":{content:'"\\a0"',width:0,overflow:"hidden"},"&-value":{...wh,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,zIndex:1},"input[readonly]":{cursor:"inherit",caretColor:"transparent"}},[`&-open ${t}-content-value`]:{color:e.colorTextPlaceholder},[`${t}-suffix`]:{flex:"none",color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,lineHeight:1,"> :not(:last-child)":{marginInlineEnd:e.marginXS}},[`${t}-prefix, ${t}-suffix`]:{alignSelf:"center",[o]:{verticalAlign:"top"}},"&-disabled":{background:e.colorBgContainerDisabled,color:e.colorTextDisabled,cursor:"not-allowed",input:{cursor:"not-allowed"}},"&-sm":{[l("height")]:e.controlHeightSM,[l("padding-horizontal")]:s(e.paddingXS).sub(e.lineWidth).equal(),[l("border-radius")]:e.borderRadiusSM,[`${t}-clear`]:{insetInlineEnd:c("padding-horizontal")}},"&-lg":{[l("height")]:e.controlHeightLG,[l("font-size")]:e.fontSizeLG,[l("line-height")]:e.lineHeightLG,[l("font-height")]:e.fontHeightLG,[l("border-radius")]:e.borderRadiusLG}},{[`&:not(${t}-customize)`]:{[`${t}-input`]:{outline:"none",background:"transparent",appearance:"none",border:0,margin:0,padding:0,color:"inherit","&::-webkit-search-cancel-button":{display:"none",appearance:"none"}}}},{[`&-single:not(${t}-customize)`]:{[`${t}-input`]:{position:"absolute",insetInline:0,insetBlock:`calc(${c("padding-vertical")} * -1)`,lineHeight:`calc(${c("font-height")} + ${c("padding-vertical")} * 2)`},[`${t}-content`]:{alignSelf:"center"}}},{[`&-show-search:not(${t}-customize-input):not(${t}-disabled)`]:{cursor:"text"}},L6n(e),c7(e,"outlined",{border:e.colorBorder,borderHover:e.hoverBorderColor,borderActive:e.activeBorderColor,borderOutline:e.activeOutlineColor,borderDisabled:e.colorBorderDisabled},{border:e.colorError,borderHover:e.colorErrorHover,borderActive:e.colorError,borderOutline:e.colorErrorOutline},{border:e.colorWarning,borderHover:e.colorWarningHover,borderActive:e.colorWarning,borderOutline:e.colorWarningOutline}),c7(e,"filled",{border:"transparent",borderHover:"transparent",borderActive:e.activeBorderColor,borderOutline:"transparent",borderDisabled:e.colorBorderDisabled,background:e.colorFillTertiary,backgroundHover:e.colorFillSecondary,backgroundActive:e.colorBgContainer},{background:e.colorErrorBg,backgroundHover:e.colorErrorBgHover,borderActive:e.colorError},{background:e.colorWarningBg,backgroundHover:e.colorWarningBgHover,borderActive:e.colorWarning}),c7(e,"borderless",{border:"transparent",borderHover:"transparent",borderActive:"transparent",borderOutline:"transparent",background:"transparent"}),c7(e,"underlined",{border:e.colorBorder,borderHover:e.hoverBorderColor,borderActive:e.activeBorderColor,borderOutline:"transparent"},{border:e.colorError,borderHover:e.colorErrorHover,borderActive:e.colorError},{border:e.colorWarning,borderHover:e.colorWarningHover,borderActive:e.colorWarning},{borderRadius:0,borderTopColor:"transparent",borderRightColor:"transparent",borderLeftColor:"transparent"}),D6n(e)]}},z6n=e=>{const{fontSize:t,lineHeight:n,lineWidth:r,controlHeight:o,controlHeightSM:i,controlHeightLG:s,paddingXXS:l,controlPaddingHorizontal:c,zIndexPopupBase:u,colorText:d,fontWeightStrong:p,controlItemBgActive:h,controlItemBgHover:m,colorBgContainer:g,colorFillSecondary:y,colorBgContainerDisabled:x,colorTextDisabled:v,colorPrimaryHover:b,colorPrimary:w,controlOutline:S}=e,C=l*2,N=r*2,j=Math.min(o-C,o-N),I=Math.min(i-C,i-N),_=Math.min(s-C,s-N);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(l/2),zIndexPopup:u+50,optionSelectedColor:d,optionSelectedFontWeight:p,optionSelectedBg:h,optionActiveBg:m,optionPadding:`${(o-t*n)/2}px ${c}px`,optionFontSize:t,optionLineHeight:n,optionHeight:o,selectorBg:g,clearBg:g,singleItemHeightLG:s,multipleItemBg:y,multipleItemBorderColor:"transparent",multipleItemHeight:j,multipleItemHeightSM:I,multipleItemHeightLG:_,multipleSelectorBgDisabled:x,multipleItemColorDisabled:v,multipleItemBorderColorDisabled:"transparent",showArrowPaddingInlineEnd:Math.ceil(e.fontSize*1.25),hoverBorderColor:b,activeBorderColor:w,activeOutlineColor:S,selectAffixPadding:l}},B6n=e=>{const{antCls:t,componentCls:n,inputPaddingHorizontalBase:r}=e,o={[`${n}-clear`]:{opacity:1,background:e.colorBgBase,borderRadius:"50%"}};return{[n]:{...Ii(e),[`${n}-selection-item`]:{flex:1,fontWeight:"normal",position:"relative",userSelect:"none",...wh,[`> ${t}-typography`]:{display:"inline"}},[`${n}-prefix`]:{flex:"none",marginInlineEnd:e.selectAffixPadding},[`${n}-clear`]:{position:"absolute",top:"50%",insetInlineStart:"auto",insetInlineEnd:r,zIndex:1,display:"inline-block",width:e.fontSizeIcon,height:e.fontSizeIcon,marginTop:e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",cursor:"pointer",opacity:0,transition:`color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,textRendering:"auto",transform:"translateZ(0)","&:before":{display:"block"},"&:hover":{color:e.colorIcon}},"@media(hover:none)":o,"&:hover":o},[`${n}-status`]:{"&-error, &-warning, &-success, &-validating":{[`&${n}-has-feedback`]:{[`${n}-clear`]:{insetInlineEnd:e.calc(r).add(e.fontSize).add(e.paddingXS).equal()}}}}}},H6n=e=>{const{componentCls:t}=e;return[{[t]:{[`&${t}-in-form-item`]:{width:"100%"}}},B6n(e),$6n(e),{[`${t}-rtl`]:{direction:"rtl"}},a6(e,{focusElCls:`${t}-focused`})]},V6n=ui("Select",(e,{rootPrefixCls:t})=>{const n=Ho(e,{rootPrefixCls:t,inputPaddingHorizontalBase:e.calc(e.paddingSM).sub(e.lineWidth).equal(),multipleSelectItemHeight:e.multipleItemHeight,selectHeight:e.controlHeight});return[H6n(n),F6n(n)]},z6n,{unitless:{optionLineHeight:!0,optionSelectedFontWeight:!0}});var U6n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"};function Ice(){return Ice=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Ice({},e,{ref:t,icon:U6n})),UK=f.forwardRef(W6n);var G6n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"};function _ce(){return _ce=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,_ce({},e,{ref:t,icon:G6n})),clt=f.forwardRef(q6n);var K6n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.6 854.5L649.9 594.8C690.2 542.7 712 479 712 412c0-80.2-31.3-155.4-87.9-212.1-56.6-56.7-132-87.9-212.1-87.9s-155.5 31.3-212.1 87.9C143.2 256.5 112 331.8 112 412c0 80.1 31.3 155.5 87.9 212.1C256.5 680.8 331.8 712 412 712c67 0 130.6-21.8 182.7-62l259.7 259.6a8.2 8.2 0 0011.6 0l43.6-43.5a8.2 8.2 0 000-11.6zM570.4 570.4C528 612.7 471.8 636 412 636s-116-23.3-158.4-65.6C211.3 528 188 471.8 188 412s23.3-116.1 65.6-158.4C296 211.3 352.2 188 412 188s116.1 23.2 158.4 65.6S636 352.2 636 412s-23.3 116.1-65.6 158.4z"}}]},name:"search",theme:"outlined"};function Pce(){return Pce=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Pce({},e,{ref:t,icon:K6n})),zE=f.forwardRef(Y6n);function ult({suffixIcon:e,clearIcon:t,menuItemSelectedIcon:n,removeIcon:r,loading:o,multiple:i,hasFeedback:s,showSuffixIcon:l,feedbackIcon:c,showArrow:u,componentName:d}){const p=t??f.createElement(aN,null),h=x=>e===null&&!s&&!u?null:f.createElement(f.Fragment,null,l!==!1&&x,s&&c);let m=null;e!==void 0?m=h(e):o?m=h(f.createElement(MC,{spin:!0})):m=({open:x,showSearch:v})=>h(x&&v?f.createElement(zE,null):f.createElement(clt,null));let g=null;n!==void 0?g=n:i?g=f.createElement(UK,null):g=null;let y=null;return r!==void 0?y=r:y=f.createElement(_y,null),{clearIcon:p,suffixIcon:m,itemIcon:g,removeIcon:y}}function X6n(e){return Ie.useMemo(()=>{if(e)return(...t)=>Ie.createElement(Nw,{space:!0},e.apply(void 0,t))},[e])}function Q6n(e,t){return t!==void 0?t:e!==null}const dlt="SECRET_COMBOBOX_MODE_DO_NOT_USE",J6n=(e,t)=>{var Vt,nn,zt,Nn,xr;const{prefixCls:n,bordered:r,className:o,rootClassName:i,getPopupContainer:s,popupClassName:l,dropdownClassName:c,listHeight:u=256,placement:d,listItemHeight:p,size:h,disabled:m,notFoundContent:g,status:y,builtinPlacements:x,dropdownMatchSelectWidth:v,popupMatchSelectWidth:b,direction:w,style:S,allowClear:C,variant:N,popupStyle:j,dropdownStyle:I,transitionName:_,tagRender:T,maxCount:P,prefix:E,dropdownRender:M,popupRender:R,onDropdownVisibleChange:$,onOpenChange:D,styles:z,classNames:V,...B}=e,{getPopupContainer:G,getPrefixCls:H,renderEmpty:F,direction:W,virtual:U,popupMatchSelectWidth:K,popupOverflow:X}=f.useContext(Qr),{showSearch:J,style:te,styles:re,className:ce,classNames:ae}=Zo("select"),[,oe]=Xf(),ue=p??(oe==null?void 0:oe.controlHeight),fe=H("select",n),se=H(),ge=w??W,{compactSize:ye,compactItemClassnames:de}=Zw(fe,ge),[Ne,_e]=zk("select",N,r),xe=pl(fe),[we,Te]=V6n(fe,xe),Re=f.useMemo(()=>{const{mode:ur}=e;if(ur!=="combobox")return ur===dlt?"combobox":ur},[e.mode]),Ue=Re==="multiple"||Re==="tags",He=Q6n(e.suffixIcon,e.showArrow),Ye=b??v??K,We=X6n(R||M),at=D||$,{status:Oe,hasFeedback:Ae,isFormItemInput:qe,feedbackIcon:dt}=f.useContext(mf),Ze=Fk(Oe,y);let Qe;g!==void 0?Qe=g:Re==="combobox"?Qe=null:Qe=(F==null?void 0:F("Select"))||f.createElement(Zye,{componentName:"Select"});const{suffixIcon:lt,itemIcon:bt,removeIcon:Ct,clearIcon:Je}=ult({...B,multiple:Ue,hasFeedback:Ae,feedbackIcon:dt,showSuffixIcon:He,componentName:"Select"}),Pe=C===!0?{clearIcon:Je}:C,Me=za(B,["suffixIcon","itemIcon"]),et=ad(ur=>h??ye??ur),vt=f.useContext(Mp),Pt=m??vt,Jt={...e,variant:Ne,status:Ze,disabled:Pt,size:et},[dn,Et]=di([ae,V],[re,z],{props:Jt},{popup:{_default:"root"}}),sn=be((Vt=dn.popup)==null?void 0:Vt.root,l,c,{[`${fe}-dropdown-${ge}`]:ge==="rtl"},i,Te,xe,we),ot={...(nn=Et.popup)==null?void 0:nn.root,...j??I},mt=be({[`${fe}-lg`]:et==="large",[`${fe}-sm`]:et==="small",[`${fe}-rtl`]:ge==="rtl",[`${fe}-${Ne}`]:_e,[`${fe}-in-form-item`]:qe},SI(fe,Ze,Ae),de,ce,o,dn.root,i,Te,xe,we),Ht=f.useMemo(()=>d!==void 0?d:ge==="rtl"?"bottomRight":"bottomLeft",[d,ge]),[jt]=sN("SelectLike",((Nn=(zt=Et.popup)==null?void 0:zt.root)==null?void 0:Nn.zIndex)??(ot==null?void 0:ot.zIndex));return f.createElement(Jye,{ref:t,virtual:U,classNames:dn,styles:Et,showSearch:J,...Me,style:{...Et.root,...te,...S},popupMatchSelectWidth:Ye,transitionName:gb(se,"slide-up",_),builtinPlacements:O6n(x,X),listHeight:u,listItemHeight:ue,mode:Re,prefixCls:fe,placement:Ht,direction:ge,prefix:E,suffixIcon:lt,menuItemSelectedIcon:bt,removeIcon:Ct,allowClear:Pe,notFoundContent:Qe,className:mt,getPopupContainer:s||G,popupClassName:sn,disabled:Pt,popupStyle:{...(xr=Et.popup)==null?void 0:xr.root,...ot,zIndex:jt},maxCount:Ue?P:void 0,tagRender:Ue?T:void 0,popupRender:We,onPopupVisibleChange:at})},F0=f.forwardRef(J6n),Z6n=HK(F0,"popupAlign");F0.SECRET_COMBOBOX_MODE_DO_NOT_USE=dlt;F0.Option=Qye;F0.OptGroup=Xye;F0._InternalPanelDoNotUseOrYouWillBeFired=Z6n;const jw=["xxl","xl","lg","md","sm","xs"],e8n=e=>({xs:`(max-width: ${e.screenXSMax}px)`,sm:`(min-width: ${e.screenSM}px)`,md:`(min-width: ${e.screenMD}px)`,lg:`(min-width: ${e.screenLG}px)`,xl:`(min-width: ${e.screenXL}px)`,xxl:`(min-width: ${e.screenXXL}px)`}),t8n=e=>{const t=e,n=[].concat(jw).reverse();return n.forEach((r,o)=>{const i=r.toUpperCase(),s=`screen${i}Min`,l=`screen${i}`;if(!(t[s]<=t[l]))throw new Error(`${s}<=${l} fails : !(${t[s]}<=${t[l]})`);if(o{if(t){for(const n of jw)if(e[n]&&(t==null?void 0:t[n])!==void 0)return t[n]}},n8n=()=>{const[,e]=Xf(),t=e8n(t8n(e));return Ie.useMemo(()=>{const n=new Map;let r=-1,o={};return{responsiveMap:t,matchHandlers:{},dispatch(i){return o=i,n.forEach(s=>s(o)),n.size>=1},subscribe(i){return n.size||this.register(),r+=1,n.set(r,i),i(o),r},unsubscribe(i){n.delete(i),n.size||this.unregister()},register(){Object.entries(t).forEach(([i,s])=>{const l=({matches:u})=>{this.dispatch({...o,[i]:u})},c=window.matchMedia(s);typeof(c==null?void 0:c.addEventListener)=="function"&&c.addEventListener("change",l),this.matchHandlers[s]={mql:c,listener:l},l(c)})},unregister(){Object.values(t).forEach(i=>{var l;const s=this.matchHandlers[i];typeof((l=s==null?void 0:s.mql)==null?void 0:l.removeEventListener)=="function"&&s.mql.removeEventListener("change",s==null?void 0:s.listener)}),n.clear()}}},[t])};function p5(e=!0,t={}){const n=f.useRef(t),[,r]=bat(),o=n8n();return Po(()=>{const i=o.subscribe(s=>{n.current=s,e&&r()});return()=>o.unsubscribe(i)},[]),n.current}const Ace=f.createContext({}),r8n=e=>{const{antCls:t,componentCls:n,iconCls:r,avatarBg:o,avatarColor:i,containerSize:s,containerSizeLG:l,containerSizeSM:c,textFontSize:u,textFontSizeLG:d,textFontSizeSM:p,iconFontSize:h,iconFontSizeLG:m,iconFontSizeSM:g,borderRadius:y,borderRadiusLG:x,borderRadiusSM:v,lineWidth:b,lineType:w}=e,S=(C,N,j,I)=>({width:C,height:C,borderRadius:"50%",fontSize:N,[`&${n}-square`]:{borderRadius:I},[`&${n}-icon`]:{fontSize:j,[`> ${r}`]:{margin:0}}});return{[n]:{...Ii(e),position:"relative",display:"inline-flex",justifyContent:"center",alignItems:"center",overflow:"hidden",color:i,whiteSpace:"nowrap",textAlign:"center",verticalAlign:"middle",background:o,border:`${Xe(b)} ${w} transparent`,"&-image":{background:"transparent"},[`${t}-image-img`]:{display:"block"},...S(s,u,h,y),"&-lg":{...S(l,d,m,x)},"&-sm":{...S(c,p,g,v)},"> img":{display:"block",width:"100%",height:"100%",objectFit:"cover"}}}},o8n=e=>{const{componentCls:t,groupBorderColor:n,groupOverlapping:r,groupSpace:o}=e;return{[`${t}-group`]:{display:"inline-flex",[t]:{borderColor:n},"> *:not(:first-child)":{marginInlineStart:r}},[`${t}-group-popover`]:{[`${t} + ${t}`]:{marginInlineStart:o}}}},i8n=e=>{const{controlHeight:t,controlHeightLG:n,controlHeightSM:r,fontSize:o,fontSizeLG:i,fontSizeXL:s,fontSizeHeading3:l,marginXS:c,marginXXS:u,colorBorderBg:d}=e;return{containerSize:t,containerSizeLG:n,containerSizeSM:r,textFontSize:o,textFontSizeLG:o,textFontSizeSM:o,iconFontSize:Math.round((i+s)/2),iconFontSizeLG:l,iconFontSizeSM:o,groupSpace:u,groupOverlapping:-c,groupBorderColor:d}},plt=ui("Avatar",e=>{const{colorTextLightSolid:t,colorTextPlaceholder:n}=e,r=Ho(e,{avatarBg:n,avatarColor:t});return[r8n(r),o8n(r)]},i8n),hlt=f.forwardRef((e,t)=>{const{prefixCls:n,shape:r,size:o,src:i,srcSet:s,icon:l,className:c,rootClassName:u,style:d,alt:p,draggable:h,children:m,crossOrigin:g,gap:y=4,onError:x,...v}=e,[b,w]=f.useState(1),[S,C]=f.useState(!1),[N,j]=f.useState(!0),I=f.useRef(null),_=f.useRef(null),T=zd(t,I),{getPrefixCls:P,className:E,style:M}=Zo("avatar"),R=f.useContext(Ace),$=()=>{if(!_.current||!I.current)return;const ae=_.current.offsetWidth,oe=I.current.offsetWidth;ae!==0&&oe!==0&&y*2{C(!0)},[]),f.useEffect(()=>{j(!0),w(1)},[i]),f.useEffect($,[y]);const D=()=>{(x==null?void 0:x())!==!1&&j(!1)},z=ad(ae=>o??(R==null?void 0:R.size)??ae??"default"),V=Object.keys(typeof z=="object"?z||{}:{}).some(ae=>["xs","sm","md","lg","xl","xxl"].includes(ae)),B=p5(V),G=f.useMemo(()=>{if(typeof z!="object")return{};const ae=jw.find(ue=>B[ue]),oe=z[ae];return oe?{width:oe,height:oe,fontSize:oe&&(l||m)?oe/2:18}:{}},[B,z,l,m]),H=P("avatar",n),F=pl(H),[W,U]=plt(H,F),K=be({[`${H}-lg`]:z==="large",[`${H}-sm`]:z==="small"}),X=f.isValidElement(i),J=r||(R==null?void 0:R.shape)||"circle",te=be(H,K,E,`${H}-${J}`,{[`${H}-image`]:X||i&&N,[`${H}-icon`]:!!l},U,F,c,u,W),re=typeof z=="number"?{width:z,height:z,fontSize:l?z/2:18}:{};let ce;if(typeof i=="string"&&N)ce=f.createElement("img",{src:i,draggable:h,srcSet:s,onError:D,alt:p,crossOrigin:g});else if(X)ce=i;else if(l)ce=l;else if(S||b!==1){const ae=`scale(${b})`,oe={msTransform:ae,WebkitTransform:ae,transform:ae};ce=f.createElement(Uf,{onResize:$},f.createElement("span",{className:`${H}-string`,ref:_,style:oe},m))}else ce=f.createElement("span",{className:`${H}-string`,style:{opacity:0},ref:_},m);return f.createElement("span",{...v,style:{...re,...G,...M,...d},className:te,ref:T},ce)}),$U=e=>e?typeof e=="function"?e():e:null,eve=e=>{const{children:t,prefixCls:n,id:r,classNames:o,styles:i,className:s,style:l}=e;return f.createElement("div",{id:r,className:be(`${n}-container`,o==null?void 0:o.container,s),style:{...i==null?void 0:i.container,...l},role:"tooltip"},typeof t=="function"?t():t)},v_={shiftX:64,adjustY:1},b_={adjustX:1,shiftY:!0},Lg=[0,0],a8n={left:{points:["cr","cl"],overflow:b_,offset:[-4,0],targetOffset:Lg},right:{points:["cl","cr"],overflow:b_,offset:[4,0],targetOffset:Lg},top:{points:["bc","tc"],overflow:v_,offset:[0,-4],targetOffset:Lg},bottom:{points:["tc","bc"],overflow:v_,offset:[0,4],targetOffset:Lg},topLeft:{points:["bl","tl"],overflow:v_,offset:[0,-4],targetOffset:Lg},leftTop:{points:["tr","tl"],overflow:b_,offset:[-4,0],targetOffset:Lg},topRight:{points:["br","tr"],overflow:v_,offset:[0,-4],targetOffset:Lg},rightTop:{points:["tl","tr"],overflow:b_,offset:[4,0],targetOffset:Lg},bottomRight:{points:["tr","br"],overflow:v_,offset:[0,4],targetOffset:Lg},rightBottom:{points:["bl","br"],overflow:b_,offset:[4,0],targetOffset:Lg},bottomLeft:{points:["tl","bl"],overflow:v_,offset:[0,4],targetOffset:Lg},leftBottom:{points:["br","bl"],overflow:b_,offset:[-4,0],targetOffset:Lg}};function Tce(){return Tce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{trigger:n=["hover"],mouseEnterDelay:r=0,mouseLeaveDelay:o=.1,prefixCls:i="rc-tooltip",children:s,onVisibleChange:l,afterVisibleChange:c,motion:u,placement:d="right",align:p={},destroyOnHidden:h=!1,defaultVisible:m,getTooltipContainer:g,arrowContent:y,overlay:x,id:v,showArrow:b=!0,classNames:w,styles:S,...C}=e,N=Jw(v),j=f.useRef(null);f.useImperativeHandle(t,()=>j.current);const I={...C};"visible"in e&&(I.popupVisible=e.visible);const _=f.useMemo(()=>{if(!b)return!1;const P=b===!0?{}:b;return{...P,className:be(P.className,w==null?void 0:w.arrow),style:{...P.style,...S==null?void 0:S.arrow},content:P.content??y}},[b,w==null?void 0:w.arrow,S==null?void 0:S.arrow,y]),T=({open:P})=>{const E=f.Children.only(s),M={"aria-describedby":x&&P?N:void 0};return f.cloneElement(E,M)};return f.createElement(n6,Tce({popupClassName:w==null?void 0:w.root,prefixCls:i,popup:f.createElement(eve,{key:"content",prefixCls:i,id:N,classNames:w,styles:S},x),action:n,builtinPlacements:a8n,popupPlacement:d,ref:j,popupAlign:p,getPopupContainer:g,onOpenChange:l,afterOpenChange:c,popupMotion:u,defaultPopupVisible:m,autoDestroy:h,mouseLeaveDelay:o,popupStyle:S==null?void 0:S.root,mouseEnterDelay:r,arrow:_,uniqueContainerClassName:w==null?void 0:w.uniqueContainer,uniqueContainerStyle:S==null?void 0:S.uniqueContainer},I),T)});function WK(e){const{sizePopupArrow:t,borderRadiusXS:n,borderRadiusOuter:r}=e,o=t/2,i=0,s=o,l=r*1/Math.sqrt(2),c=o-r*(1-1/Math.sqrt(2)),u=o-n*(1/Math.sqrt(2)),d=r*(Math.sqrt(2)-1)+n*(1/Math.sqrt(2)),p=2*o-u,h=d,m=2*o-l,g=c,y=2*o-i,x=s,v=o*Math.sqrt(2)+r*(Math.sqrt(2)-2),b=r*(Math.sqrt(2)-1),w=`polygon(${b}px 100%, 50% ${b}px, ${2*o-b}px 100%, ${b}px 100%)`,S=`path('M ${i} ${s} A ${r} ${r} 0 0 0 ${l} ${c} L ${u} ${d} A ${n} ${n} 0 0 1 ${p} ${h} L ${m} ${g} A ${r} ${r} 0 0 0 ${y} ${x} Z')`;return{arrowShadowWidth:v,arrowPath:S,arrowPolygon:w}}const mlt=(e,t,n)=>{const{sizePopupArrow:r,arrowPolygon:o,arrowPath:i,arrowShadowWidth:s,borderRadiusXS:l,calc:c}=e;return{pointerEvents:"none",width:r,height:r,overflow:"hidden","&::before":{position:"absolute",bottom:0,insetInlineStart:0,width:r,height:c(r).div(2).equal(),background:t,clipPath:{_multi_value_:!0,value:[o,i]},content:'""'},"&::after":{content:'""',position:"absolute",width:s,height:s,bottom:0,insetInline:0,margin:"auto",borderRadius:{_skip_check_:!0,value:`0 0 ${Xe(l)} 0`},transform:"translateY(50%) rotate(-135deg)",boxShadow:n,zIndex:0,background:"transparent"}}},glt=8;function GK(e){const{contentRadius:t,limitVerticalRadius:n}=e,r=t>12?t+2:12;return{arrowOffsetHorizontal:r,arrowOffsetVertical:n?glt:r}}function u7(e,t){return e?t:{}}const tve=(e,t,n)=>{const{componentCls:r,boxShadowPopoverArrow:o,arrowOffsetVertical:i,arrowOffsetHorizontal:s,antCls:l}=e,[c]=bi(l,"tooltip"),{arrowDistance:u=0,arrowPlacement:d={left:!0,right:!0,top:!0,bottom:!0}}=n||{};return{[r]:{[`${r}-arrow`]:[{position:"absolute",zIndex:1,display:"block",...mlt(e,t,o),"&:before":{background:t}}],...u7(!!d.top,{[[`&-placement-top > ${r}-arrow`,`&-placement-topLeft > ${r}-arrow`,`&-placement-topRight > ${r}-arrow`].join(",")]:{bottom:u,transform:"translateY(100%) rotate(180deg)"},[`&-placement-top > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(100%) rotate(180deg)"},"&-placement-topLeft":{[c("arrow-offset-horizontal")]:s,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:s}}},"&-placement-topRight":{[c("arrow-offset-horizontal")]:`calc(100% - ${Xe(s)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:s}}}}),...u7(!!d.bottom,{[[`&-placement-bottom > ${r}-arrow`,`&-placement-bottomLeft > ${r}-arrow`,`&-placement-bottomRight > ${r}-arrow`].join(",")]:{top:u,transform:"translateY(-100%)"},[`&-placement-bottom > ${r}-arrow`]:{left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%) translateY(-100%)"},"&-placement-bottomLeft":{[c("arrow-offset-horizontal")]:s,[`> ${r}-arrow`]:{left:{_skip_check_:!0,value:s}}},"&-placement-bottomRight":{[c("arrow-offset-horizontal")]:`calc(100% - ${Xe(s)})`,[`> ${r}-arrow`]:{right:{_skip_check_:!0,value:s}}}}),...u7(!!d.left,{[[`&-placement-left > ${r}-arrow`,`&-placement-leftTop > ${r}-arrow`,`&-placement-leftBottom > ${r}-arrow`].join(",")]:{right:{_skip_check_:!0,value:u},transform:"translateX(100%) rotate(90deg)"},[`&-placement-left > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(100%) rotate(90deg)"},[`&-placement-leftTop > ${r}-arrow`]:{top:i},[`&-placement-leftBottom > ${r}-arrow`]:{bottom:i}}),...u7(!!d.right,{[[`&-placement-right > ${r}-arrow`,`&-placement-rightTop > ${r}-arrow`,`&-placement-rightBottom > ${r}-arrow`].join(",")]:{left:{_skip_check_:!0,value:u},transform:"translateX(-100%) rotate(-90deg)"},[`&-placement-right > ${r}-arrow`]:{top:{_skip_check_:!0,value:"50%"},transform:"translateY(-50%) translateX(-100%) rotate(-90deg)"},[`&-placement-rightTop > ${r}-arrow`]:{top:i},[`&-placement-rightBottom > ${r}-arrow`]:{bottom:i}})}}};function l8n(e,t,n,r){if(r===!1)return{adjustX:!1,adjustY:!1};const o=r&&typeof r=="object"?r:{},i={};switch(e){case"top":case"bottom":i.shiftX=t.arrowOffsetHorizontal*2+n,i.shiftY=!0,i.adjustY=!0;break;case"left":case"right":i.shiftY=t.arrowOffsetVertical*2+n,i.shiftX=!0,i.adjustX=!0;break}const s={...i,...o};return s.shiftX||(s.adjustX=!0),s.shiftY||(s.adjustY=!0),s}const r3e={left:{points:["cr","cl"]},right:{points:["cl","cr"]},top:{points:["bc","tc"]},bottom:{points:["tc","bc"]},topLeft:{points:["bl","tl"]},leftTop:{points:["tr","tl"]},topRight:{points:["br","tr"]},rightTop:{points:["tl","tr"]},bottomRight:{points:["tr","br"]},rightBottom:{points:["bl","br"]},bottomLeft:{points:["tl","bl"]},leftBottom:{points:["br","bl"]}},c8n={topLeft:{points:["bl","tc"]},leftTop:{points:["tr","cl"]},topRight:{points:["br","tc"]},rightTop:{points:["tl","cr"]},bottomRight:{points:["tr","bc"]},rightBottom:{points:["bl","cr"]},bottomLeft:{points:["tl","bc"]},leftBottom:{points:["br","cl"]}},u8n=new Set(["topLeft","topRight","bottomLeft","bottomRight","leftTop","leftBottom","rightTop","rightBottom"]);function xlt(e){const{arrowWidth:t,autoAdjustOverflow:n,arrowPointAtCenter:r,offset:o,borderRadius:i,visibleFirst:s}=e,l=t/2,c={},u=GK({contentRadius:i,limitVerticalRadius:!0});return Object.keys(r3e).forEach(d=>{const h={...r&&c8n[d]||r3e[d],offset:[0,0],dynamicInset:!0};switch(c[d]=h,u8n.has(d)&&(h.autoArrow=!1),d){case"top":case"topLeft":case"topRight":h.offset[1]=-l-o;break;case"bottom":case"bottomLeft":case"bottomRight":h.offset[1]=l+o;break;case"left":case"leftTop":case"leftBottom":h.offset[0]=-l-o;break;case"right":case"rightTop":case"rightBottom":h.offset[0]=l+o;break}if(r)switch(d){case"topLeft":case"bottomLeft":h.offset[0]=-u.arrowOffsetHorizontal-l;break;case"topRight":case"bottomRight":h.offset[0]=u.arrowOffsetHorizontal+l;break;case"leftTop":case"rightTop":h.offset[1]=-u.arrowOffsetHorizontal*2+l;break;case"leftBottom":case"rightBottom":h.offset[1]=u.arrowOffsetHorizontal*2-l;break}h.overflow=l8n(d,u,t,n),s&&(h.htmlRegion="visibleFirst")}),c}const ylt=(e,t)=>{const n=r=>typeof r=="boolean"?{show:r}:r||{};return Ie.useMemo(()=>{const r=n(e),o=n(t);return{...o,...r,show:r.show??o.show??!0}},[e,t])},o3e="50%",d8n=e=>{const{calc:t,componentCls:n,tooltipMaxWidth:r,tooltipColor:o,tooltipBg:i,tooltipBorderRadius:s,zIndexPopup:l,controlHeight:c,boxShadowSecondary:u,paddingSM:d,paddingXS:p,arrowOffsetHorizontal:h,sizePopupArrow:m,antCls:g}=e,[y,x]=bi(g,"tooltip"),v=t(s).add(m).add(h).equal(),w={minWidth:t(s).mul(2).add(m).equal(),minHeight:c,padding:`${Xe(e.calc(d).div(2).equal())} ${Xe(p)}`,color:x("overlay-color",o),textAlign:"start",textDecoration:"none",wordWrap:"break-word",backgroundColor:i,borderRadius:s,boxShadow:u,boxSizing:"border-box"},S={[y("valid-offset-x")]:x("arrow-offset-horizontal","var(--arrow-x)"),transformOrigin:[x("valid-offset-x",o3e),`var(--arrow-y, ${o3e})`].join(" ")};return[{[n]:{...Ii(e),position:"absolute",zIndex:l,display:"block",width:"max-content",maxWidth:r,visibility:"visible",...S,"&-hidden":{display:"none"},[y("arrow-background-color")]:i,[`${n}-container`]:[w,Zat(e,!0)],[`&:has(~ ${n}-unique-container)`]:{[`${n}-container`]:{border:"none",background:"transparent",boxShadow:"none"}},[["&-placement-topLeft","&-placement-topRight","&-placement-bottomLeft","&-placement-bottomRight"].join(",")]:{minWidth:v},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${n}-inner`]:{borderRadius:e.min(s,glt)}},[`${n}-content`]:{position:"relative"},...PK(e,(C,{darkColor:N})=>({[`&${n}-${C}`]:{[`${n}-container`]:{backgroundColor:N},[`${n}-arrow`]:{[y("arrow-background-color")]:N}}})),"&-rtl":{direction:"rtl"}}},tve(e,x("arrow-background-color")),{[`${n}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow}},{[`${n}-unique-container`]:{...w,...S,position:"absolute",zIndex:t(l).sub(1).equal(),"&-hidden":{display:"none"},"&-visible":{transition:`all ${e.motionDurationSlow}`}}}]},f8n=e=>({zIndexPopup:e.zIndexPopupBase+70,maxWidth:250,...GK({contentRadius:e.borderRadius,limitVerticalRadius:!0}),...WK(Ho(e,{borderRadiusOuter:Math.min(e.borderRadiusOuter,4)}))}),vlt=(e,t,n=!0)=>ui("Tooltip",o=>{const{borderRadius:i,colorTextLightSolid:s,colorBgSpotlight:l,maxWidth:c}=o,u=Ho(o,{tooltipMaxWidth:c,tooltipColor:s,tooltipBorderRadius:i,tooltipBg:l});return[d8n(u),i6(o,"zoom-big-fast")]},f8n,{resetStyle:!1,injectStyle:n})(e,t),p8n=TC.map(e=>`${e}-inverse`),h8n=["success","processing","error","default","warning"];function qK(e,t=!0){return t?[].concat(go(p8n),go(TC)).includes(e):TC.includes(e)}function m8n(e){return h8n.includes(e)}const blt=(e,t,n)=>{const r=qK(n),[o]=bi(e,"tooltip"),i=be({[`${t}-${n}`]:n&&r}),s={},l={},c=e$n(n).toRgb(),d=(.299*c.r+.587*c.g+.114*c.b)/255<.5?"#FFF":"#000";return n&&!r&&(s.background=n,s[o("overlay-color")]=d,l[o("arrow-background-color")]=n),{className:i,overlayStyle:s,arrowStyle:l}},g8n=e=>{const{prefixCls:t,className:n,placement:r="top",title:o,color:i,overlayInnerStyle:s,classNames:l,styles:c}=e,{getPrefixCls:u}=f.useContext(Qr),d=u("tooltip",t),p=u(),h=pl(d),[m,g]=vlt(d,h),y=blt(p,d,i),x=y.arrowStyle,v=f.useMemo(()=>({container:{...s,...y.overlayStyle}}),[s,y.overlayStyle]),b={...e,placement:r},[w,S]=di([l],[v,c],{props:b}),C=be(h,m,g,d,`${d}-pure`,`${d}-placement-${r}`,n,y.className);return f.createElement("div",{className:C,style:x},f.createElement("div",{className:`${d}-arrow`}),f.createElement(eve,{...e,className:m,prefixCls:d,classNames:w,styles:S},o))},x8n=f.forwardRef((e,t)=>{const{prefixCls:n,openClassName:r,getTooltipContainer:o,color:i,children:s,afterOpenChange:l,arrow:c,destroyTooltipOnHide:u,destroyOnHidden:d,title:p,overlay:h,trigger:m,builtinPlacements:g,autoAdjustOverflow:y=!0,motion:x,getPopupContainer:v,placement:b="top",mouseEnterDelay:w=.1,mouseLeaveDelay:S=.1,rootClassName:C,styles:N,classNames:j,onOpenChange:I,overlayInnerStyle:_,overlayStyle:T,overlayClassName:P,...E}=e,[,M]=Xf(),{getPopupContainer:R,getPrefixCls:$,direction:D,className:z,style:V,classNames:B,styles:G,arrow:H,trigger:F}=Zo("tooltip"),W=ylt(c,H),U=W.show,K=m||F||"hover";Qw();const X=f.useRef(null),J=()=>{var lt;(lt=X.current)==null||lt.forceAlign()};f.useImperativeHandle(t,()=>{var lt,bt;return{forceAlign:J,nativeElement:(lt=X.current)==null?void 0:lt.nativeElement,popupElement:(bt=X.current)==null?void 0:bt.popupElement}});const[te,re]=Fa(e.defaultOpen??!1,e.open),ce=!p&&!h&&p!==0,ae=lt=>{re(ce?!1:lt),!ce&&I&&I(lt)},oe=f.useMemo(()=>g||xlt({arrowPointAtCenter:(W==null?void 0:W.pointAtCenter)??!1,autoAdjustOverflow:y,arrowWidth:U?M.sizePopupArrow:0,borderRadius:M.borderRadius,offset:M.marginXXS,visibleFirst:!0}),[W,g,M,U,y]),ue=f.useMemo(()=>p===0?p:h||p||"",[h,p]),fe=f.createElement(Nw,{space:!0},typeof ue=="function"?ue():ue),se={...e,trigger:K,color:i,placement:b,builtinPlacements:g,openClassName:r,arrow:c,autoAdjustOverflow:y,getPopupContainer:v,children:s,destroyTooltipOnHide:u,destroyOnHidden:d},[ge,ye]=di([B,j],[G,N],{props:se}),de=$("tooltip",n),Ne=$(),_e=e["data-popover-inject"];let xe=te;!("open"in e)&&ce&&(xe=!1);const we=f.isValidElement(s)&&!$at(s)?s:f.createElement("span",null,s),Te=we.props,Re=!Te.className||typeof Te.className=="string"?be(Te.className,r||`${de}-open`):Te.className,Ue=pl(de),[He,Ye]=vlt(de,Ue,!_e),We=blt(Ne,de,i),at=We.arrowStyle,Oe=be(Ue,He,Ye),Ae=be(P,{[`${de}-rtl`]:D==="rtl"},We.className,C,Oe,z,ge.root),[qe,dt]=sN("Tooltip",E.zIndex),Ze={...ye.container,..._,...We.overlayStyle},Qe=f.createElement(s8n,{unique:!0,...E,trigger:K,zIndex:qe,showArrow:U,placement:b,mouseEnterDelay:w,mouseLeaveDelay:S,prefixCls:de,classNames:{root:Ae,container:ge.container,arrow:ge.arrow,uniqueContainer:be(Oe,ge.container)},styles:{root:{...at,...ye.root,...V,...T},container:Ze,uniqueContainer:Ze,arrow:ye.arrow},getTooltipContainer:v||o||R,ref:X,builtinPlacements:oe,overlay:fe,visible:xe,onVisibleChange:ae,afterVisibleChange:l,arrowContent:f.createElement("span",{className:`${de}-arrow-content`}),motion:{motionName:gb(Ne,"zoom-big-fast",typeof(x==null?void 0:x.motionName)=="string"?x==null?void 0:x.motionName:void 0),motionDeadline:1e3},destroyOnHidden:d??!!u},xe?Fc(we,{className:Re}):we);return f.createElement(ZL.Provider,{value:dt},Qe)}),pf=x8n;pf._InternalPanelDoNotUseOrYouWillBeFired=g8n;pf.UniqueProvider=Lat;const i3e="50%",y8n=e=>{const{componentCls:t,popoverColor:n,titleMinWidth:r,fontWeightStrong:o,innerPadding:i,boxShadowSecondary:s,colorTextHeading:l,borderRadiusLG:c,zIndexPopup:u,titleMarginBottom:d,colorBgElevated:p,popoverBg:h,titleBorderBottom:m,innerContentPadding:g,titlePadding:y,antCls:x}=e,[v,b]=bi(x,"tooltip");return[{[t]:{...Ii(e),position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:u,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",[v("valid-offset-x")]:b("arrow-offset-horizontal","var(--arrow-x)"),transformOrigin:[b("valid-offset-x",i3e),`var(--arrow-y, ${i3e})`].join(" "),[v("arrow-background-color")]:p,width:"max-content",maxWidth:"100vw","&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-container`]:{backgroundColor:h,backgroundClip:"padding-box",borderRadius:c,boxShadow:s,padding:i},[`${t}-title`]:{minWidth:r,marginBottom:d,color:l,fontWeight:o,borderBottom:m,padding:y},[`${t}-content`]:{color:n,padding:g}}},tve(e,b("arrow-background-color")),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block"}}]},v8n=e=>{const{componentCls:t,antCls:n}=e,[r]=bi(n,"tooltip");return{[t]:TC.map(o=>{const i=e[`${o}6`];return{[`&${t}-${o}`]:{[r("arrow-background-color")]:i,[`${t}-inner`]:{backgroundColor:i},[`${t}-arrow`]:{background:"transparent"}}}})}},b8n=e=>{const{lineWidth:t,controlHeight:n,fontHeight:r,padding:o,wireframe:i,zIndexPopupBase:s,borderRadiusLG:l,marginXS:c,lineType:u,colorSplit:d,paddingSM:p}=e,h=n-r,m=h/2,g=h/2-t,y=o;return{titleMinWidth:177,zIndexPopup:s+30,...WK(e),...GK({contentRadius:l,limitVerticalRadius:!0}),innerPadding:i?0:12,titleMarginBottom:i?0:c,titlePadding:i?`${m}px ${y}px ${g}px`:0,titleBorderBottom:i?`${t}px ${u} ${d}`:"none",innerContentPadding:i?`${p}px ${y}px`:0}},wlt=ui("Popover",e=>{const{colorBgElevated:t,colorText:n}=e,r=Ho(e,{popoverBg:t,popoverColor:n});return[y8n(r),v8n(r),i6(r,"zoom-big")]},b8n,{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]}),Slt=e=>{const{title:t,content:n,prefixCls:r,classNames:o,styles:i}=e;return!t&&!n?null:f.createElement(f.Fragment,null,t&&f.createElement("div",{className:be(`${r}-title`,o==null?void 0:o.title),style:i==null?void 0:i.title},t),n&&f.createElement("div",{className:be(`${r}-content`,o==null?void 0:o.content),style:i==null?void 0:i.content},n))},w8n=e=>{const{hashId:t,prefixCls:n,className:r,style:o,placement:i="top",title:s,content:l,children:c,classNames:u,styles:d}=e,p=$U(s),h=$U(l),m={...e,placement:i},[g,y]=di([u],[d],{props:m}),x=be(t,n,`${n}-pure`,`${n}-placement-${i}`,r);return f.createElement("div",{className:x,style:o},f.createElement("div",{className:`${n}-arrow`}),f.createElement(eve,{...e,className:t,prefixCls:n,classNames:g,styles:y},c||f.createElement(Slt,{prefixCls:n,title:p,content:h,classNames:g,styles:y})))},S8n=e=>{const{prefixCls:t,className:n,...r}=e,{getPrefixCls:o}=f.useContext(Qr),i=o("popover",t),[s,l]=wlt(i);return f.createElement(w8n,{...r,prefixCls:i,hashId:s,className:be(n,l)})},C8n=f.forwardRef((e,t)=>{const{prefixCls:n,title:r,content:o,overlayClassName:i,placement:s="top",trigger:l,children:c,mouseEnterDelay:u=.1,mouseLeaveDelay:d=.1,onOpenChange:p,overlayStyle:h={},styles:m,classNames:g,motion:y,arrow:x,...v}=e,{getPrefixCls:b,className:w,style:S,classNames:C,styles:N,arrow:j,trigger:I}=Zo("popover"),_=b("popover",n),[T,P]=wlt(_),E=b(),M=ylt(x,j),R=l||I||"hover",$={...e,placement:s,trigger:R,mouseEnterDelay:u,mouseLeaveDelay:d,overlayStyle:h,styles:m,classNames:g},[D,z]=di([C,g],[N,m],{props:$}),V=be(i,T,P,w,D.root),[B,G]=Fa(e.defaultOpen??!1,e.open),H=U=>{G(U),p==null||p(U)},F=$U(r),W=$U(o);return f.createElement(pf,{unique:!1,arrow:M,placement:s,trigger:R,mouseEnterDelay:u,mouseLeaveDelay:d,...v,prefixCls:_,classNames:{root:V,container:D.container,arrow:D.arrow},styles:{root:{...z.root,...S,...h},container:z.container,arrow:z.arrow},ref:t,open:B,onOpenChange:H,overlay:F||W?f.createElement(Slt,{prefixCls:_,title:F,content:W,classNames:D,styles:z}):null,motion:{motionName:gb(E,"zoom-big",typeof(y==null?void 0:y.motionName)=="string"?y==null?void 0:y.motionName:void 0)},"data-popover-inject":!0},c)}),nve=C8n;nve._InternalPanelDoNotUseOrYouWillBeFired=S8n;const a3e=e=>{const{size:t,shape:n}=f.useContext(Ace),r=f.useMemo(()=>({size:e.size||t,shape:e.shape||n}),[e.size,e.shape,t,n]);return f.createElement(Ace.Provider,{value:r},e.children)},N8n=e=>{var I,_,T;const{getPrefixCls:t,direction:n}=f.useContext(Qr),{prefixCls:r,className:o,rootClassName:i,style:s,maxCount:l,maxStyle:c,size:u,shape:d,maxPopoverPlacement:p,maxPopoverTrigger:h,children:m,max:g}=e,y=t("avatar",r),x=`${y}-group`,v=pl(y),[b,w]=plt(y,v),S=be(x,{[`${x}-rtl`]:n==="rtl"},w,v,o,i,b),C=Bu(m).map((P,E)=>Fc(P,{key:`avatar-key-${E}`})),N=(g==null?void 0:g.count)||l,j=C.length;if(N&&N{const{prefixCls:t,value:n,current:r,offset:o=0}=e;let i;return o&&(i={position:"absolute",top:`${o}00%`,left:0}),f.createElement("span",{style:i,className:be(`${t}-only-unit`,{current:r})},n)};function j8n(e,t,n){let r=e,o=0;for(;(r+10)%10!==t;)r+=n,o+=n;return o}const E8n=e=>{const{prefixCls:t,count:n,value:r}=e,o=Number(r),i=Math.abs(n),[s,l]=f.useState(o),[c,u]=f.useState(i),d=()=>{l(o),u(i)};f.useEffect(()=>{const m=setTimeout(d,1e3);return()=>clearTimeout(m)},[o]);let p,h;if(s===o||Number.isNaN(o)||Number.isNaN(s))p=[f.createElement(s3e,{...e,key:o,current:!0})],h={transition:"none"};else{p=[];const m=o+10,g=[];for(let b=o;b<=m;b+=1)g.push(b);const y=cb%10===s);p=(y<0?g.slice(0,x+1):g.slice(x)).map((b,w)=>{const S=b%10;return f.createElement(s3e,{...e,key:b,value:S,offset:y<0?w-x:w,current:w===x})}),h={transform:`translateY(${-j8n(s,o,y)}00%)`}}return f.createElement("span",{className:`${t}-only`,style:h,onTransitionEnd:d},p)},I8n=f.forwardRef((e,t)=>{const{prefixCls:n,count:r,className:o,motionClassName:i,style:s,title:l,show:c,component:u="sup",children:d,...p}=e,{getPrefixCls:h}=f.useContext(Qr),m=h("scroll-number",n),g={...p,"data-show":c,style:s,className:be(m,o,i),title:l};let y=r;if(r&&Number(r)%1===0){const x=String(r).split("");y=f.createElement("bdi",null,x.map((v,b)=>f.createElement(E8n,{prefixCls:m,count:Number(r),value:v,key:x.length-b})))}return s!=null&&s.borderColor&&(g.style={...s,boxShadow:`0 0 0 1px ${s.borderColor} inset`}),d?Fc(d,x=>({className:be(`${m}-custom-component`,x==null?void 0:x.className,i)})):f.createElement(u,{...g,ref:t},y)}),_8n=new Go("antStatusProcessing",{"0%":{transform:"scale(0.8)",opacity:.5},"100%":{transform:"scale(2.4)",opacity:0}}),P8n=new Go("antZoomBadgeIn",{"0%":{transform:"scale(0) translate(50%, -50%)",opacity:0},"100%":{transform:"scale(1) translate(50%, -50%)"}}),A8n=new Go("antZoomBadgeOut",{"0%":{transform:"scale(1) translate(50%, -50%)"},"100%":{transform:"scale(0) translate(50%, -50%)",opacity:0}}),T8n=new Go("antNoWrapperZoomBadgeIn",{"0%":{transform:"scale(0)",opacity:0},"100%":{transform:"scale(1)"}}),k8n=new Go("antNoWrapperZoomBadgeOut",{"0%":{transform:"scale(1)"},"100%":{transform:"scale(0)",opacity:0}}),M8n=new Go("antBadgeLoadingCircle",{"0%":{transformOrigin:"50%"},"100%":{transform:"translate(50%, -50%) rotate(360deg)",transformOrigin:"50%"}}),R8n=e=>{const{componentCls:t,iconCls:n,antCls:r,badgeShadowSize:o,textFontSize:i,textFontSizeSM:s,statusSize:l,dotSize:c,textFontWeight:u,indicatorHeight:d,indicatorHeightSM:p,marginXS:h,calc:m}=e,g=`${r}-scroll-number`,y=PK(e,(x,{darkColor:v})=>({[`&${t} ${t}-color-${x}`]:{background:v,[`&:not(${t}-count)`]:{color:v},"a:hover &":{background:v}}}));return{[t]:{...Ii(e),position:"relative",display:"inline-block",width:"fit-content",lineHeight:1,[`${t}-count`]:{display:"inline-flex",justifyContent:"center",zIndex:e.indicatorZIndex,minWidth:d,height:d,color:e.badgeTextColor,fontWeight:u,fontSize:i,lineHeight:Xe(d),whiteSpace:"nowrap",textAlign:"center",background:e.badgeColor,borderRadius:m(d).div(2).equal(),boxShadow:`0 0 0 ${Xe(o)} ${e.badgeShadowColor}`,transition:`background-color ${e.motionDurationMid}`,a:{color:e.badgeTextColor},"a:hover":{color:e.badgeTextColor},"a:hover &":{background:e.badgeColorHover}},[`${t}-count-sm`]:{minWidth:p,height:p,fontSize:s,lineHeight:Xe(p),borderRadius:m(p).div(2).equal()},[`${t}-multiple-words`]:{padding:`0 ${Xe(e.paddingXS)}`,bdi:{unicodeBidi:"plaintext"}},[`${t}-dot`]:{zIndex:e.indicatorZIndex,width:c,minWidth:c,height:c,background:e.badgeColor,borderRadius:"100%",boxShadow:`0 0 0 ${Xe(o)} ${e.badgeShadowColor}`},[`${t}-count, ${t}-dot, ${g}-custom-component`]:{position:"absolute",top:0,insetInlineEnd:0,transform:"translate(50%, -50%)",transformOrigin:"100% 0%",[`&${n}-spin`]:{animationName:M8n,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear"}},[`&${t}-status`]:{lineHeight:"inherit",verticalAlign:"baseline",[`${t}-status-dot`]:{position:"relative",top:-1,display:"inline-block",width:l,height:l,verticalAlign:"middle",borderRadius:"50%"},[`${t}-status-success`]:{backgroundColor:e.colorSuccess},[`${t}-status-processing`]:{overflow:"visible",color:e.colorInfo,backgroundColor:e.colorInfo,borderColor:"currentcolor","&::after":{position:"absolute",top:0,insetInlineStart:0,width:"100%",height:"100%",borderWidth:o,borderStyle:"solid",borderColor:"inherit",borderRadius:"50%",animationName:_8n,animationDuration:e.badgeProcessingDuration,animationIterationCount:"infinite",animationTimingFunction:"ease-in-out",content:'""'}},[`${t}-status-default`]:{backgroundColor:e.colorTextPlaceholder},[`${t}-status-error`]:{backgroundColor:e.colorError},[`${t}-status-warning`]:{backgroundColor:e.colorWarning},[`${t}-status-text`]:{marginInlineStart:h,color:e.colorText,fontSize:e.fontSize}},...y,[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:P8n,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},[`${t}-zoom-leave`]:{animationName:A8n,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack,animationFillMode:"both"},[`&${t}-not-a-wrapper`]:{[`${t}-zoom-appear, ${t}-zoom-enter`]:{animationName:T8n,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`${t}-zoom-leave`]:{animationName:k8n,animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseOutBack},[`&:not(${t}-status)`]:{verticalAlign:"middle"},[`${g}-custom-component, ${t}-count`]:{transform:"none"},[`${g}-custom-component, ${g}`]:{position:"relative",top:"auto",display:"block",transformOrigin:"50% 50%"}},[g]:{overflow:"hidden",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack}`,[`${g}-only`]:{position:"relative",display:"inline-block",height:d,transition:`all ${e.motionDurationSlow} ${e.motionEaseOutBack}`,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden",[`> p${g}-only-unit`]:{height:d,margin:0,WebkitTransformStyle:"preserve-3d",WebkitBackfaceVisibility:"hidden"}},[`${g}-symbol`]:{verticalAlign:"top"}},"&-rtl":{direction:"rtl",[`${t}-count, ${t}-dot, ${g}-custom-component`]:{transform:"translate(-50%, -50%)"}}}}},Nlt=e=>{const{fontHeight:t,lineWidth:n,marginXS:r,colorBorderBg:o}=e,i=t,s=n,l=e.colorTextLightSolid,c=e.colorError,u=e.colorErrorHover;return Ho(e,{badgeFontHeight:i,badgeShadowSize:s,badgeTextColor:l,badgeColor:c,badgeColorHover:u,badgeShadowColor:o,badgeProcessingDuration:"1.2s",badgeRibbonOffset:r,badgeRibbonCornerTransform:"scaleY(0.75)",badgeRibbonCornerFilter:"brightness(75%)"})},jlt=e=>{const{fontSize:t,lineHeight:n,fontSizeSM:r,lineWidth:o}=e;return{indicatorZIndex:"auto",indicatorHeight:Math.round(t*n)-2*o,indicatorHeightSM:t,dotSize:r/2,textFontSize:r,textFontSizeSM:r,textFontWeight:"normal",statusSize:r/2}},O8n=ui("Badge",e=>{const t=Nlt(e);return R8n(t)},jlt),$8n=f.forwardRef((e,t)=>{const{prefixCls:n,scrollNumberPrefixCls:r,children:o,status:i,text:s,color:l,count:c=null,overflowCount:u=99,dot:d=!1,size:p="default",title:h,offset:m,style:g,className:y,rootClassName:x,classNames:v,styles:b,showZero:w=!1,...S}=e,{getPrefixCls:C,direction:N,className:j,style:I,classNames:_,styles:T}=Zo("badge"),P=C("badge",n),[E,M]=O8n(P),R={...e,overflowCount:u,size:p,dot:d,showZero:w},[$,D]=di([_,v],[T,b],{props:R}),z=c>u?`${u}+`:c,V=z==="0"||z===0||s==="0"||s===0,B=c===null||V&&!w,G=(ll(i)||ll(l))&&B,H=ll(i)||!V,F=d&&!V,W=F?"":z,U=f.useMemo(()=>((!ll(W)||W==="")&&(!ll(s)||s==="")||V&&!w)&&!F,[W,V,w,F,s]),K=f.useRef(c);U||(K.current=c);const X=K.current,J=f.useRef(W);U||(J.current=W);const te=J.current,re=f.useRef(F);U||(re.current=F);const ce=f.useMemo(()=>{if(!m)return{...I,...g};const Ne=Number.parseInt(m[0],10);return{...{marginTop:m[1],insetInlineEnd:-Ne},...I,...g}},[m,g,I]),ae=h??(typeof X=="string"||typeof X=="number"?X:void 0),oe=!U&&(s===0?w:!!s&&s!==!0),ue=oe?f.createElement("span",{className:`${P}-status-text`},s):null,fe=!X||typeof X!="object"?void 0:Fc(X,Ne=>({style:{...ce,...Ne.style}})),se=qK(l,!1),ge=be($.indicator,{[`${P}-status-dot`]:G,[`${P}-status-${i}`]:!!i,[`${P}-color-${l}`]:se}),ye={};l&&!se&&(ye.color=l,ye.background=l);const de=be(P,{[`${P}-status`]:G,[`${P}-not-a-wrapper`]:!o,[`${P}-rtl`]:N==="rtl"},y,x,j,$.root,E,M);if(!o&&G&&(s||H||!B)){const Ne=ce.color;return f.createElement("span",{ref:t,...S,className:de,style:{...D.root,...ce}},f.createElement("span",{className:ge,style:{...D.indicator,...ye}}),oe&&f.createElement("span",{style:{color:Ne},className:`${P}-status-text`},s))}return f.createElement("span",{ref:t,...S,className:de,style:D.root},o,f.createElement(Kf,{visible:!U,motionName:`${P}-zoom`,motionAppear:!1,motionDeadline:1e3},({className:Ne})=>{const _e=C("scroll-number",r),xe=re.current,we=be($.indicator,{[`${P}-dot`]:xe,[`${P}-count`]:!xe,[`${P}-count-sm`]:p==="small",[`${P}-multiple-words`]:!xe&&te&&te.toString().length>1,[`${P}-status-${i}`]:!!i,[`${P}-color-${l}`]:se});let Te={...D.indicator,...ce};return l&&!se&&(Te=Te||{},Te.background=l),f.createElement(I8n,{prefixCls:_e,show:!U,motionClassName:Ne,className:we,count:te,title:ae,style:Te,key:"scrollNumber"},fe)}),ue)}),D8n=e=>{const{antCls:t,badgeFontHeight:n,marginXS:r,badgeRibbonOffset:o,calc:i}=e,s=`${t}-ribbon`,l=`${t}-ribbon-wrapper`,c=PK(e,(u,{darkColor:d})=>({[`&${s}-color-${u}`]:{background:d,color:d}}));return{[l]:{position:"relative"},[s]:{...Ii(e),position:"absolute",top:r,padding:`0 ${Xe(e.paddingXS)}`,color:e.colorPrimary,lineHeight:Xe(n),whiteSpace:"nowrap",backgroundColor:e.colorPrimary,borderRadius:e.borderRadiusSM,[`${s}-content`]:{color:e.badgeTextColor},[`${s}-corner`]:{position:"absolute",top:"100%",width:o,height:o,color:"currentcolor",border:`${Xe(i(o).div(2).equal())} solid`,transform:e.badgeRibbonCornerTransform,transformOrigin:"top",filter:e.badgeRibbonCornerFilter},...c,[`&${s}-placement-end`]:{insetInlineEnd:i(o).mul(-1).equal(),borderEndEndRadius:0,[`${s}-corner`]:{insetInlineEnd:0,borderInlineEndColor:"transparent",borderBlockEndColor:"transparent"}},[`&${s}-placement-start`]:{insetInlineStart:i(o).mul(-1).equal(),borderEndStartRadius:0,[`${s}-corner`]:{insetInlineStart:0,borderBlockEndColor:"transparent",borderInlineStartColor:"transparent"}},"&-rtl":{direction:"rtl"}}}},L8n=ui(["Badge","Ribbon"],e=>{const t=Nlt(e);return D8n(t)},jlt),F8n=e=>{const{className:t,prefixCls:n,style:r,color:o,children:i,text:s,placement:l="end",rootClassName:c,styles:u,classNames:d}=e,{getPrefixCls:p,direction:h,className:m,style:g,classNames:y,styles:x}=Zo("ribbon"),v=p("ribbon",n),b=`${v}-wrapper`,[w,S]=L8n(v,b),C={...e,placement:l},[N,j]=di([y,d],[x,u],{props:C}),I=qK(o,!1),_=be(v,`${v}-placement-${l}`,{[`${v}-rtl`]:h==="rtl",[`${v}-color-${o}`]:I},t,m,N.indicator),T={},P={};return o&&!I&&(T.background=o,P.color=o),f.createElement("div",{className:be(b,c,w,S,N.root),style:j.root},i,f.createElement("div",{className:be(_,w),style:{...T,...j.indicator,...g,...r}},f.createElement("span",{className:be(`${v}-content`,N.content),style:j.content},s),f.createElement("div",{className:`${v}-corner`,style:P})))},Elt=$8n;Elt.Ribbon=F8n;var z8n={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"};function kce(){return kce=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,kce({},e,{ref:t,icon:z8n})),Mce=f.forwardRef(B8n),{ESC:H8n,TAB:V8n}=Ir;function U8n({visible:e,triggerRef:t,onVisibleChange:n,autoFocus:r,overlayRef:o}){const i=f.useRef(!1),s=()=>{var u,d;e&&((d=(u=t.current)==null?void 0:u.focus)==null||d.call(u),n==null||n(!1))},l=()=>{var u;return(u=o.current)!=null&&u.focus?(o.current.focus(),i.current=!0,!0):!1},c=u=>{switch(u.keyCode){case H8n:s();break;case V8n:{let d=!1;i.current||(d=l()),d?u.preventDefault():s();break}}};f.useEffect(()=>e?(window.addEventListener("keydown",c),r&&Bo(l,3),()=>{window.removeEventListener("keydown",c),i.current=!1}):()=>{i.current=!1},[e])}const W8n=f.forwardRef((e,t)=>{const{overlay:n,arrow:r,prefixCls:o}=e,i=f.useMemo(()=>{let l;return typeof n=="function"?l=n():l=n,l},[n]),s=zd(t,Xw(i));return Ie.createElement(Ie.Fragment,null,r&&Ie.createElement("div",{className:`${o}-arrow`}),Ie.cloneElement(i,{ref:pb(i)?s:void 0}))}),w_={adjustX:1,adjustY:1},S_=[0,0],G8n={topLeft:{points:["bl","tl"],overflow:w_,offset:[0,-4],targetOffset:S_},top:{points:["bc","tc"],overflow:w_,offset:[0,-4],targetOffset:S_},topRight:{points:["br","tr"],overflow:w_,offset:[0,-4],targetOffset:S_},bottomLeft:{points:["tl","bl"],overflow:w_,offset:[0,4],targetOffset:S_},bottom:{points:["tc","bc"],overflow:w_,offset:[0,4],targetOffset:S_},bottomRight:{points:["tr","br"],overflow:w_,offset:[0,4],targetOffset:S_}};function Rce(){return Rce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var G;const{arrow:n=!1,prefixCls:r="rc-dropdown",transitionName:o,animation:i,align:s,placement:l="bottomLeft",placements:c=G8n,getPopupContainer:u,showAction:d,hideAction:p,overlayClassName:h,overlayStyle:m,visible:g,trigger:y=["hover"],autoFocus:x,overlay:v,children:b,onVisibleChange:w,...S}=e,[C,N]=Ie.useState(),j="visible"in e?g:C,I=i?`${r}-${i}`:o,_=Ie.useRef(null),T=Ie.useRef(null),P=Ie.useRef(null);Ie.useImperativeHandle(t,()=>_.current);const E=H=>{N(H),w==null||w(H)};U8n({visible:j,triggerRef:P,onVisibleChange:E,autoFocus:x,overlayRef:T});const M=H=>{const{onOverlayClick:F}=e;N(!1),F&&F(H)},R=()=>Ie.createElement(W8n,{ref:T,overlay:v,prefixCls:r,arrow:n}),$=()=>typeof v=="function"?R:R(),D=()=>{const{minOverlayWidthMatchTrigger:H,alignPoint:F}=e;return"minOverlayWidthMatchTrigger"in e?H:!F},z=()=>{const{openClassName:H}=e;return H!==void 0?H:`${r}-open`},V=Ie.cloneElement(b,{className:be((G=b.props)==null?void 0:G.className,j&&z()),ref:pb(b)?zd(P,Xw(b)):void 0});let B=p;return!B&&y.indexOf("contextMenu")!==-1&&(B=["click"]),Ie.createElement(n6,Rce({builtinPlacements:c},S,{prefixCls:r,ref:_,popupClassName:be(h,{[`${r}-show-arrow`]:n}),popupStyle:m,action:y,showAction:d,hideAction:B,popupPlacement:l,popupAlign:s,popupMotion:{motionName:I},popupVisible:j,stretch:D()?"minWidth":"",popup:$(),onOpenChange:E,onPopupClick:M,getPopupContainer:u}),V)}),q8n=e=>typeof e!="object"&&typeof e!="function"||e===null,_lt=f.createContext(null);function Plt(e,t){return`${e}-${t}`}function Alt(e){const t=f.useContext(_lt);return Plt(t,e)}const yy=f.createContext(null);function K8n(e,t){const n={...e};return Object.keys(t).forEach(r=>{const o=t[r];o!==void 0&&(n[r]=o)}),n}function h$({children:e,locked:t,...n}){const r=f.useContext(yy),o=u5(()=>K8n(r,n),[r,n],(i,s)=>!t&&(i[0]!==s[0]||!hy(i[1],s[1],!0)));return f.createElement(yy.Provider,{value:o},e)}const Y8n=[],Tlt=f.createContext(null);function KK(){return f.useContext(Tlt)}const klt=f.createContext(Y8n);function Bk(e){const t=f.useContext(klt);return f.useMemo(()=>e!==void 0?[...t,e]:t,[t,e])}const Mlt=f.createContext(null),rve=f.createContext({}),{LEFT:Oce,RIGHT:$ce,UP:Dce,DOWN:mB,ENTER:gB,ESC:Rlt,HOME:jM,END:EM}=Ir,l3e=[Dce,mB,Oce,$ce];function X8n(e,t,n,r){var m;const o="prev",i="next",s="children",l="parent";if(e==="inline"&&r===gB)return{inlineTrigger:!0};const c={[Dce]:o,[mB]:i},u={[Oce]:n?i:o,[$ce]:n?o:i,[mB]:s,[gB]:s},d={[Dce]:o,[mB]:i,[gB]:s,[Rlt]:l,[Oce]:n?s:l,[$ce]:n?l:s};switch((m={inline:c,horizontal:u,vertical:d,inlineSub:c,horizontalSub:d,verticalSub:d}[`${e}${t?"":"Sub"}`])==null?void 0:m[r]){case o:return{offset:-1,sibling:!0};case i:return{offset:1,sibling:!0};case l:return{offset:-1,sibling:!1};case s:return{offset:1,sibling:!1};default:return null}}function Q8n(e){let t=e;for(;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function J8n(e,t){let n=e||document.activeElement;for(;n;){if(t.has(n))return n;n=n.parentElement}return null}function ove(e,t){return Hye(e,!0).filter(r=>t.has(r))}function c3e(e,t,n,r=1){if(!e)return null;const o=ove(e,t),i=o.length;let s=o.findIndex(l=>n===l);return r<0?s===-1?s=i-1:s-=1:r>0&&(s+=1),s=(s+i)%i,o[s]}const DU=(e,t)=>{const n=new Set,r=new Map,o=new Map;return e.forEach(i=>{const s=document.querySelector(`[data-menu-id='${Plt(t,i)}']`);s&&(n.add(s),o.set(s,i),r.set(i,s))}),{elements:n,key2element:r,element2key:o}};function Z8n(e,t,n,r,o,i,s,l,c,u){const d=f.useRef(),p=f.useRef();p.current=t;const h=()=>{Bo.cancel(d.current)};return f.useEffect(()=>()=>{h()},[]),m=>{const{which:g}=m;if([...l3e,gB,Rlt,jM,EM].includes(g)){const y=i();let x=DU(y,r);const{elements:v,key2element:b,element2key:w}=x,S=b.get(t),C=J8n(S,v),N=w.get(C),j=X8n(e,s(N,!0).length===1,n,g);if(!j&&g!==jM&&g!==EM)return;(l3e.includes(g)||[jM,EM].includes(g))&&m.preventDefault();const I=_=>{if(_){let T=_;const P=_.querySelector("a");P!=null&&P.getAttribute("href")&&(T=P);const E=w.get(_);l(E),h(),d.current=Bo(()=>{p.current===E&&T.focus()})}};if([jM,EM].includes(g)||j.sibling||!C){let _;!C||e==="inline"?_=o.current:_=Q8n(C);let T;const P=ove(_,v);g===jM?T=P[0]:g===EM?T=P[P.length-1]:T=c3e(_,v,C,j.offset),I(T)}else if(j.inlineTrigger)c(N);else if(j.offset>0)c(N,!0),h(),d.current=Bo(()=>{x=DU(y,r);const _=C.getAttribute("aria-controls"),T=document.getElementById(_),P=c3e(T,x.elements);I(P)},5);else if(j.offset<0){const _=s(N,!0),T=_[_.length-2],P=b.get(T);c(T,!1),I(P)}}u==null||u(m)}}function eFn(e){Promise.resolve().then(e)}const ive="__RC_UTIL_PATH_SPLIT__",u3e=e=>e.join(ive),tFn=e=>e.split(ive),Lce="rc-menu-more";function nFn(){const[,e]=f.useState({}),t=f.useRef(new Map),n=f.useRef(new Map),[r,o]=f.useState([]),i=f.useRef(0),s=f.useRef(!1),l=()=>{s.current||e({})},c=f.useCallback((y,x)=>{const v=u3e(x);n.current.set(v,y),t.current.set(y,v),i.current+=1;const b=i.current;eFn(()=>{b===i.current&&l()})},[]),u=f.useCallback((y,x)=>{const v=u3e(x);n.current.delete(v),t.current.delete(y)},[]),d=f.useCallback(y=>{o(y)},[]),p=f.useCallback((y,x)=>{const v=t.current.get(y)||"",b=tFn(v);return x&&r.includes(b[0])&&b.unshift(Lce),b},[r]),h=f.useCallback((y,x)=>y.filter(v=>v!==void 0).some(v=>p(v,!0).includes(x)),[p]),m=()=>{const y=[...t.current.keys()];return r.length&&y.push(Lce),y},g=f.useCallback(y=>{const x=`${t.current.get(y)}${ive}`,v=new Set;return[...n.current.keys()].forEach(b=>{b.startsWith(x)&&v.add(n.current.get(b))}),v},[]);return f.useEffect(()=>()=>{s.current=!0},[]),{registerPath:c,unregisterPath:u,refreshOverflowKeys:d,isSubPathKey:h,getKeyPath:p,getKeys:m,getSubPathKeys:g}}function MR(e){const t=f.useRef(e);t.current=e;const n=f.useCallback((...r)=>{var o;return(o=t.current)==null?void 0:o.call(t,...r)},[]);return e?n:void 0}function Olt(e,t,n,r){const{activeKey:o,onActive:i,onInactive:s}=f.useContext(yy),l={active:o===e};return t||(l.onMouseEnter=c=>{n==null||n({key:e,domEvent:c}),i(e)},l.onMouseLeave=c=>{r==null||r({key:e,domEvent:c}),s(e)}),l}function $lt(e){const{mode:t,rtl:n,inlineIndent:r}=f.useContext(yy);if(t!=="inline")return null;const o=e;return n?{paddingRight:o*r}:{paddingLeft:o*r}}function Dlt({icon:e,props:t,children:n}){let r;return e===null||e===!1?null:(typeof e=="function"?r=f.createElement(e,{...t}):typeof e!="boolean"&&(r=e),r||n||null)}function LU({item:e,...t}){return Object.defineProperty(t,"item",{get:()=>(Al(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),e)}),t}function m$(){return m$=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{style:n,className:r,eventKey:o,warnKey:i,disabled:s,itemIcon:l,children:c,role:u,onMouseEnter:d,onMouseLeave:p,onClick:h,onKeyDown:m,onFocus:g,...y}=e,x=Alt(o),{prefixCls:v,onItemClick:b,disabled:w,overflowDisabled:S,itemIcon:C,selectedKeys:N,onActive:j}=f.useContext(yy),{_internalRenderMenuItem:I}=f.useContext(rve),_=`${v}-item`,T=f.useRef(),P=f.useRef(),E=w||s,M=Yw(t,P),R=Bk(o),$=X=>({key:o,keyPath:[...R].reverse(),item:T.current,domEvent:X}),D=l||C,{active:z,...V}=Olt(o,E,d,p),B=N.includes(o),G=$lt(R.length),H=X=>{if(E)return;const J=$(X);h==null||h(LU(J)),b(J)},F=X=>{if(m==null||m(X),X.which===Ir.ENTER){const J=$(X);h==null||h(LU(J)),b(J)}},W=X=>{j(o),g==null||g(X)},U={};e.role==="option"&&(U["aria-selected"]=B);let K=f.createElement(rFn,m$({ref:T,elementRef:M,role:u===null?"none":u||"menuitem",tabIndex:s?null:-1,"data-menu-id":S&&x?null:x},za(y,["extra"]),V,U,{component:"li","aria-disabled":s,style:{...G,...n},className:be(_,{[`${_}-active`]:z,[`${_}-selected`]:B,[`${_}-disabled`]:E},r),onClick:H,onKeyDown:F,onFocus:W}),c,f.createElement(Dlt,{props:{...e,isSelected:B},icon:D}));return I&&(K=I(K,e,{selected:B})),K});function iFn(e,t){const{eventKey:n}=e,r=KK(),o=Bk(n);return f.useEffect(()=>{if(r)return r.registerPath(n,o),()=>{r.unregisterPath(n,o)}},[o]),r?null:f.createElement(oFn,m$({},e,{ref:t}))}const f6=f.forwardRef(iFn);function Fce(){return Fce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:o,mode:i,rtl:s}=f.useContext(yy);return f.createElement("ul",Fce({className:be(o,s&&`${o}-rtl`,`${o}-sub`,`${o}-${i==="inline"?"inline":"vertical"}`,e),role:"menu"},n,{"data-menu-list":!0,ref:r}),t)},Llt=f.forwardRef(aFn);function ave(e,t){return Bu(e).map((n,r)=>{var o;if(f.isValidElement(n)){const{key:i}=n;let s=((o=n.props)==null?void 0:o.eventKey)??i;s==null&&(s=`tmp_key-${[...t,r].join("-")}`);const c={key:s,eventKey:s};return f.cloneElement(n,c)}return n})}const vp={adjustX:1,adjustY:1},sFn={topLeft:{points:["bl","tl"],overflow:vp},topRight:{points:["br","tr"],overflow:vp},bottomLeft:{points:["tl","bl"],overflow:vp},bottomRight:{points:["tr","br"],overflow:vp},leftTop:{points:["tr","tl"],overflow:vp},leftBottom:{points:["br","bl"],overflow:vp},rightTop:{points:["tl","tr"],overflow:vp},rightBottom:{points:["bl","br"],overflow:vp}},lFn={topLeft:{points:["bl","tl"],overflow:vp},topRight:{points:["br","tr"],overflow:vp},bottomLeft:{points:["tl","bl"],overflow:vp},bottomRight:{points:["tr","br"],overflow:vp},rightTop:{points:["tr","tl"],overflow:vp},rightBottom:{points:["br","bl"],overflow:vp},leftTop:{points:["tl","tr"],overflow:vp},leftBottom:{points:["bl","br"],overflow:vp}};function Flt(e,t,n){if(t)return t;if(n)return n[e]||n.other}const cFn={horizontal:"bottomLeft",vertical:"rightTop","vertical-left":"rightTop","vertical-right":"leftTop"};function uFn({prefixCls:e,visible:t,children:n,popup:r,popupStyle:o,popupClassName:i,popupOffset:s,disabled:l,mode:c,onVisibleChange:u}){const{getPopupContainer:d,rtl:p,subMenuOpenDelay:h,subMenuCloseDelay:m,builtinPlacements:g,triggerSubMenuAction:y,forceSubMenuRender:x,rootClassName:v,motion:b,defaultMotions:w}=f.useContext(yy),[S,C]=f.useState(!1),N=p?{...lFn,...g}:{...sFn,...g},j=cFn[c],I=Flt(c,b,w),_=f.useRef(I);c!=="inline"&&(_.current=I);const T={..._.current,leavedClassName:`${e}-hidden`,removeOnLeave:!1,motionAppear:!0},P=f.useRef();return f.useEffect(()=>(P.current=Bo(()=>{C(t)}),()=>{Bo.cancel(P.current)}),[t]),f.createElement(n6,{prefixCls:e,popupClassName:be(`${e}-popup`,{[`${e}-rtl`]:p},i,v),stretch:c==="horizontal"?"minWidth":null,getPopupContainer:d,builtinPlacements:N,popupPlacement:j,popupVisible:S,popup:r,popupStyle:o,popupAlign:s&&{offset:s},action:l?[]:[y],mouseEnterDelay:h,mouseLeaveDelay:m,onPopupVisibleChange:u,forceRender:x,popupMotion:T,fresh:!0},n)}function zce(){return zce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{d.current&&h(!1)},[u]);const g={...Flt(o,l,c)};n.length>1&&(g.motionAppear=!1);const y=g.onVisibleChanged;return g.onVisibleChanged=x=>(!d.current&&!x&&h(!0),y==null?void 0:y(x)),p?null:f.createElement(h$,{mode:o,locked:!d.current},f.createElement(Kf,zce({visible:m},g,{forceRender:s,removeOnLeave:!1,leavedClassName:`${i}-hidden`}),({className:x,style:v})=>f.createElement(Llt,{id:e,className:x,style:v},r)))}function g$(){return g$=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{style:n,className:r,styles:o,classNames:i,title:s,eventKey:l,warnKey:c,disabled:u,internalPopupClose:d,children:p,itemIcon:h,expandIcon:m,popupClassName:g,popupOffset:y,popupStyle:x,onClick:v,onMouseEnter:b,onMouseLeave:w,onTitleClick:S,onTitleMouseEnter:C,onTitleMouseLeave:N,popupRender:j,...I}=e,_=Alt(l),{prefixCls:T,mode:P,openKeys:E,disabled:M,overflowDisabled:R,activeKey:$,selectedKeys:D,itemIcon:z,expandIcon:V,onItemClick:B,onOpenChange:G,onActive:H,popupRender:F}=f.useContext(yy),{_internalRenderSubMenuItem:W}=f.useContext(rve),{isSubPathKey:U}=f.useContext(Mlt),K=Bk(),X=`${T}-submenu`,J=M||u,te=f.useRef(),re=f.useRef(),ce=h??z,ae=m??V,oe=E.includes(l),ue=!R&&oe,fe=U(D,l),{active:se,...ge}=Olt(l,J,C,N),[ye,de]=f.useState(!1),Ne=Qe=>{J||de(Qe)},_e=Qe=>{Ne(!0),b==null||b({key:l,domEvent:Qe})},xe=Qe=>{Ne(!1),w==null||w({key:l,domEvent:Qe})},we=f.useMemo(()=>se||(P!=="inline"?ye||U([$],l):!1),[P,se,$,ye,l,U]),Te=$lt(K.length),Re=Qe=>{J||(S==null||S({key:l,domEvent:Qe}),P==="inline"&&G(l,!oe))},Ue=MR(Qe=>{v==null||v(LU(Qe)),B(Qe)}),He=Qe=>{P!=="inline"&&G(l,Qe)},Ye=()=>{H(l)},We=_&&`${_}-popup`,at=f.useMemo(()=>f.createElement(Dlt,{icon:P!=="horizontal"?ae:void 0,props:{...e,isOpen:ue,isSubMenu:!0}},f.createElement("i",{className:`${X}-arrow`})),[P,ae,e,ue,X]);let Oe=f.createElement("div",g$({role:"menuitem",style:Te,className:`${X}-title`,tabIndex:J?null:-1,ref:te,title:typeof s=="string"?s:null,"data-menu-id":R&&_?null:_,"aria-expanded":ue,"aria-haspopup":!0,"aria-controls":We,"aria-disabled":J,onClick:Re,onFocus:Ye},ge),s,at);const Ae=f.useRef(P);P!=="inline"&&K.length>1?Ae.current="vertical":Ae.current=P;const qe=Ae.current,dt=f.useMemo(()=>{const Qe=f.createElement(h$,{classNames:i,styles:o,mode:qe==="horizontal"?"vertical":qe},f.createElement(Llt,{id:We,ref:re},p)),lt=j||F;return lt?lt(Qe,{item:e,keys:K}):Qe},[j,F,K,We,p,e,qe]);if(!R){const Qe=Ae.current;Oe=f.createElement(uFn,{mode:Qe,prefixCls:X,visible:!d&&ue&&P!=="inline",popupClassName:g,popupOffset:y,popupStyle:x,popup:dt,disabled:J,onVisibleChange:He},Oe)}let Ze=f.createElement(Jv.Item,g$({ref:t,role:"none"},I,{component:"li",style:n,className:be(X,`${X}-${P}`,r,{[`${X}-open`]:ue,[`${X}-active`]:we,[`${X}-selected`]:fe,[`${X}-disabled`]:J}),onMouseEnter:_e,onMouseLeave:xe}),Oe,!R&&f.createElement(dFn,{id:We,open:ue,keyPath:K},p));return W&&(Ze=W(Ze,e,{selected:fe,active:we,open:ue,disabled:J})),f.createElement(h$,{classNames:i,styles:o,onItemClick:Ue,mode:P==="horizontal"?"vertical":P,itemIcon:ce,expandIcon:ae},Ze)}),YK=f.forwardRef((e,t)=>{const{eventKey:n,children:r}=e,o=Bk(n),i=ave(r,o),s=KK();f.useEffect(()=>{if(s)return s.registerPath(n,o),()=>{s.unregisterPath(n,o)}},[o]);let l;return s?l=i:l=f.createElement(fFn,g$({ref:t},e),i),f.createElement(klt.Provider,{value:o},l)});function sve({className:e,style:t}){const{prefixCls:n}=f.useContext(yy);return KK()?null:f.createElement("li",{role:"separator",className:be(`${n}-item-divider`,e),style:t})}function FU(){return FU=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{className:n,title:r,eventKey:o,children:i,...s}=e,{prefixCls:l,classNames:c,styles:u}=f.useContext(yy),d=`${l}-item-group`;return f.createElement("li",FU({ref:t,role:"presentation"},s,{onClick:p=>p.stopPropagation(),className:be(d,n)}),f.createElement("div",{role:"presentation",className:be(`${d}-title`,c==null?void 0:c.listTitle),style:u==null?void 0:u.listTitle,title:typeof r=="string"?r:void 0},r),f.createElement("ul",{role:"group",className:be(`${d}-list`,c==null?void 0:c.list),style:u==null?void 0:u.list},i))}),lve=f.forwardRef((e,t)=>{const{eventKey:n,children:r}=e,o=Bk(n),i=ave(r,o);return KK()?i:f.createElement(pFn,FU({ref:t},za(e,["warnKey"])),i)});function kP(){return kP=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(l&&typeof l=="object"){const{label:u,children:d,key:p,type:h,extra:m,...g}=l,y=p??`tmp-${c}`;return d||h==="group"?h==="group"?f.createElement(o,kP({key:y},g,{title:u}),Bce(d,t,n)):f.createElement(i,kP({key:y},g,{title:u}),Bce(d,t,n)):h==="divider"?f.createElement(s,kP({key:y},g)):f.createElement(r,kP({key:y},g,{extra:m}),u,(!!m||m===0)&&f.createElement("span",{className:`${n}-item-extra`},m))}return null}).filter(l=>l)}function d3e(e,t,n,r,o){let i=e;const s={divider:sve,item:f6,group:lve,submenu:YK,...r};return t&&(i=Bce(t,s,o)),ave(i,n)}function Hce(){return Hce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var Kt;const{prefixCls:n="rc-menu",rootClassName:r,style:o,className:i,styles:s,classNames:l,tabIndex:c=0,items:u,children:d,direction:p,id:h,mode:m="vertical",inlineCollapsed:g,disabled:y,disabledOverflow:x,subMenuOpenDelay:v=.1,subMenuCloseDelay:b=.1,forceSubMenuRender:w,defaultOpenKeys:S,openKeys:C,activeKey:N,defaultActiveFirst:j,selectable:I=!0,multiple:_=!1,defaultSelectedKeys:T,selectedKeys:P,onSelect:E,onDeselect:M,inlineIndent:R=24,motion:$,defaultMotions:D,triggerSubMenuAction:z="hover",builtinPlacements:V,itemIcon:B,expandIcon:G,overflowedIndicator:H="...",overflowedIndicatorPopupClassName:F,getPopupContainer:W,onClick:U,onOpenChange:K,onKeyDown:X,openAnimation:J,openTransitionName:te,_internalRenderMenuItem:re,_internalRenderSubMenuItem:ce,_internalComponents:ae,popupRender:oe,...ue}=e,[fe,se]=f.useMemo(()=>[d3e(d,u,WN,ae,n),d3e(d,u,WN,{},n)],[d,u,ae]),[ge,ye]=f.useState(!1),de=f.useRef(),Ne=Jw(h?`rc-menu-uuid-${h}`:"rc-menu-uuid"),_e=p==="rtl",[xe,we]=Fa(S,C),Te=xe||WN,Re=(gn,An=!1)=>{function pt(){we(gn),K==null||K(gn)}An?pu.flushSync(pt):pt()},[Ue,He]=f.useState(Te),Ye=f.useRef(!1),[We,at]=f.useMemo(()=>(m==="inline"||m==="vertical")&&g?["vertical",g]:[m,!1],[m,g]),Oe=We==="inline",[Ae,qe]=f.useState(We),[dt,Ze]=f.useState(at);f.useEffect(()=>{qe(We),Ze(at),Ye.current&&(Oe?we(Ue):Re(WN))},[We,at]);const[Qe,lt]=f.useState(0),bt=Qe>=fe.length-1||Ae!=="horizontal"||x;f.useEffect(()=>{Oe&&He(Te)},[Te]),f.useEffect(()=>(Ye.current=!0,()=>{Ye.current=!1}),[]);const{registerPath:Ct,unregisterPath:Je,refreshOverflowKeys:Pe,isSubPathKey:Me,getKeyPath:et,getKeys:vt,getSubPathKeys:Pt}=nFn(),Jt=f.useMemo(()=>({registerPath:Ct,unregisterPath:Je}),[Ct,Je]),dn=f.useMemo(()=>({isSubPathKey:Me}),[Me]);f.useEffect(()=>{Pe(bt?WN:fe.slice(Qe+1).map(gn=>gn.key))},[Qe,bt]);const[Et,sn]=Fa(N||j&&((Kt=fe[0])==null?void 0:Kt.key),N),ot=MR(gn=>{sn(gn)}),mt=MR(()=>{sn(void 0)});f.useImperativeHandle(t,()=>({list:de.current,focus:gn=>{var xn,Kn;const An=vt(),{elements:pt,key2element:nt,element2key:xt}=DU(An,Ne),Tt=ove(de.current,pt);let rn;Et&&An.includes(Et)?rn=Et:rn=Tt[0]?xt.get(Tt[0]):(xn=fe.find(ar=>!ar.props.disabled))==null?void 0:xn.key;const un=nt.get(rn);rn&&un&&((Kn=un==null?void 0:un.focus)==null||Kn.call(un,gn))},findItem:({key:gn})=>{const An=vt(),{key2element:pt}=DU(An,Ne);return pt.get(gn)||null}}));const[Ht,jt]=Fa(T||[],P),Vt=f.useMemo(()=>Array.isArray(Ht)?Ht:Ht==null?WN:[Ht],[Ht]),nn=gn=>{if(I){const{key:An}=gn,pt=Vt.includes(An);let nt;_?pt?nt=Vt.filter(Tt=>Tt!==An):nt=[...Vt,An]:nt=[An],jt(nt);const xt={...gn,selectedKeys:nt};pt?M==null||M(xt):E==null||E(xt)}!_&&Te.length&&Ae!=="inline"&&Re(WN)},zt=MR(gn=>{U==null||U(LU(gn)),nn(gn)}),Nn=MR((gn,An)=>{let pt=Te.filter(nt=>nt!==gn);if(An)pt.push(gn);else if(Ae!=="inline"){const nt=Pt(gn);pt=pt.filter(xt=>!nt.has(xt))}hy(Te,pt,!0)||Re(pt,!0)}),ur=Z8n(Ae,Et,_e,Ne,de,vt,et,sn,(gn,An)=>{const pt=An??!Te.includes(gn);Nn(gn,pt)},X);f.useEffect(()=>{ye(!0)},[]);const Zt=f.useMemo(()=>({_internalRenderMenuItem:re,_internalRenderSubMenuItem:ce}),[re,ce]),Ot=Ae!=="horizontal"||x?fe:fe.map((gn,An)=>f.createElement(h$,{key:gn.key,overflowDisabled:An>Qe,classNames:l,styles:s},gn)),qt=f.createElement(Jv,Hce({id:h,ref:de,prefixCls:`${n}-overflow`,component:"ul",itemComponent:f6,className:be(n,`${n}-root`,`${n}-${Ae}`,i,{[`${n}-inline-collapsed`]:dt,[`${n}-rtl`]:_e},r),dir:p,style:o,role:"menu",tabIndex:c,data:Ot,renderRawItem:gn=>gn,renderRawRest:gn=>{const An=gn.length,pt=An?fe.slice(-An):null;return f.createElement(YK,{eventKey:Lce,title:H,disabled:bt,internalPopupClose:An===0,popupClassName:F},pt)},maxCount:Ae!=="horizontal"||x?Jv.INVALIDATE:Jv.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:gn=>{lt(gn)},onKeyDown:ur},ue));return f.createElement(rve.Provider,{value:Zt},f.createElement(_lt.Provider,{value:Ne},f.createElement(h$,{prefixCls:n,rootClassName:r,classNames:l,styles:s,mode:Ae,openKeys:Te,rtl:_e,disabled:y,motion:ge?$:null,defaultMotions:ge?D:null,activeKey:Et,onActive:ot,onInactive:mt,selectedKeys:Vt,inlineIndent:R,subMenuOpenDelay:v,subMenuCloseDelay:b,forceSubMenuRender:w,builtinPlacements:V,triggerSubMenuAction:z,getPopupContainer:W,itemIcon:B,expandIcon:G,onItemClick:zt,onOpenChange:Nn,popupRender:oe},f.createElement(Mlt.Provider,{value:dn},qt),f.createElement("div",{style:{display:"none"},"aria-hidden":!0},f.createElement(Tlt.Provider,{value:Jt},se)))))}),Hk=hFn;Hk.Item=f6;Hk.SubMenu=YK;Hk.ItemGroup=lve;Hk.Divider=sve;const zlt=f.createContext({});var mFn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"};function Vce(){return Vce=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Vce({},e,{ref:t,icon:mFn})),cve=f.forwardRef(gFn),zU=f.createContext({prefixCls:"",firstLevel:!0,inlineCollapsed:!1,styles:null,classNames:null}),Blt=e=>{const{prefixCls:t,className:n,dashed:r,...o}=e,{getPrefixCls:i}=f.useContext(Qr),s=i("menu",t),l=be({[`${s}-item-divider-dashed`]:!!r},n);return f.createElement(sve,{className:l,...o})},Hlt=e=>{var S,C;const{className:t,children:n,icon:r,title:o,danger:i,extra:s}=e,{prefixCls:l,firstLevel:c,direction:u,disableMenuItemTitleTooltip:d,inlineCollapsed:p,styles:h,classNames:m}=f.useContext(zU),g=N=>{var _,T;const j=n==null?void 0:n[0],I=f.createElement("span",{className:be(`${l}-title-content`,c?m==null?void 0:m.itemContent:(_=m==null?void 0:m.subMenu)==null?void 0:_.itemContent,{[`${l}-title-content-with-extra`]:!!s||s===0}),style:c?h==null?void 0:h.itemContent:(T=h==null?void 0:h.subMenu)==null?void 0:T.itemContent},n);return(!r||f.isValidElement(n)&&n.type==="span")&&n&&N&&c&&typeof j=="string"?f.createElement("div",{className:`${l}-inline-collapsed-noicon`},j.charAt(0)):I},{siderCollapsed:y}=f.useContext(zlt);let x=o;typeof o>"u"?x=c?n:"":o===!1&&(x="");const v={title:x};!y&&!p&&(v.title=null,v.open=!1);const b=Bu(n).length;let w=f.createElement(f6,{...za(e,["title","icon","danger"]),className:be(c?m==null?void 0:m.item:(S=m==null?void 0:m.subMenu)==null?void 0:S.item,{[`${l}-item-danger`]:i,[`${l}-item-only-child`]:(r?b+1:b)===1},t),style:{...c?h==null?void 0:h.item:(C=h==null?void 0:h.subMenu)==null?void 0:C.item,...e.style},title:typeof o=="string"?o:void 0},Fc(r,N=>{var j,I;return{className:be(`${l}-item-icon`,c?m==null?void 0:m.itemIcon:(j=m==null?void 0:m.subMenu)==null?void 0:j.itemIcon,N.className),style:{...c?h==null?void 0:h.itemIcon:(I=h==null?void 0:h.subMenu)==null?void 0:I.itemIcon,...N.style}}}),g(p));return d||(w=f.createElement(pf,{...v,placement:u==="rtl"?"left":"right",classNames:{root:`${l}-inline-collapsed-tooltip`}},w)),w},BU=f.createContext(null),Vlt=f.forwardRef((e,t)=>{const{children:n,...r}=e,o=f.useContext(BU),i=f.useMemo(()=>({...o,...r}),[o,r.prefixCls,r.mode,r.selectable,r.rootClassName]),s=Fkn(n),l=Yw(t,s?Xw(n):null);return f.createElement(BU.Provider,{value:i},f.createElement(Nw,{space:!0},s?f.cloneElement(n,{ref:l}):n))}),xFn=e=>{const{componentCls:t,motionDurationSlow:n,horizontalLineHeight:r,colorSplit:o,lineWidth:i,lineType:s,itemPaddingInline:l}=e;return{[`${t}-horizontal`]:{lineHeight:r,border:0,borderBottom:`${Xe(i)} ${s} ${o}`,boxShadow:"none","&::after":{display:"block",clear:"both",height:0,content:'"\\20"'},[`${t}-item, ${t}-submenu`]:{position:"relative",display:"inline-block",verticalAlign:"bottom",paddingInline:l},[`> ${t}-item:hover, > ${t}-item-active, > ${t}-submenu ${t}-submenu-title:hover`]:{backgroundColor:"transparent"},[`${t}-item, ${t}-submenu-title`]:{transition:[`border-color ${n}`,`background-color ${n}`].join(",")},[`${t}-submenu-arrow`]:{display:"none"}}}},yFn=({componentCls:e,menuArrowOffset:t,calc:n})=>({[`${e}-rtl`]:{direction:"rtl"},[`${e}-submenu-rtl`]:{transformOrigin:"100% 0"},[`${e}-rtl${e}-vertical, ${e}-submenu-rtl ${e}-vertical`]:{[`${e}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateY(${Xe(n(t).mul(-1).equal())})`},"&::after":{transform:`rotate(45deg) translateY(${Xe(t)})`}}}}),f3e=e=>my(e),p3e=(e,t)=>{const{componentCls:n,itemColor:r,itemSelectedColor:o,subMenuItemSelectedColor:i,groupTitleColor:s,itemBg:l,subMenuItemBg:c,itemSelectedBg:u,activeBarHeight:d,activeBarWidth:p,activeBarBorderWidth:h,motionDurationSlow:m,motionEaseInOut:g,motionEaseOut:y,itemPaddingInline:x,motionDurationMid:v,itemHoverColor:b,lineType:w,colorSplit:S,itemDisabledColor:C,dangerItemColor:N,dangerItemHoverColor:j,dangerItemSelectedColor:I,dangerItemActiveBg:_,dangerItemSelectedBg:T,popupBg:P,itemHoverBg:E,itemActiveBg:M,menuSubMenuBg:R,horizontalItemSelectedColor:$,horizontalItemSelectedBg:D,horizontalItemBorderRadius:z,horizontalItemHoverBg:V}=e;return{[`${n}-${t}, ${n}-${t} > ${n}`]:{color:r,background:l,[`&${n}-root:focus-visible`]:{...f3e(e)},[`${n}-item`]:{"&-group-title, &-extra":{color:s}},[`${n}-submenu-selected > ${n}-submenu-title`]:{color:i},[`${n}-item, ${n}-submenu-title`]:{color:r,[`&:not(${n}-item-disabled):focus-visible`]:{...f3e(e)}},[`${n}-item-disabled, ${n}-submenu-disabled`]:{color:`${C} !important`},[`${n}-item:not(${n}-item-selected):not(${n}-submenu-selected)`]:{[`&:hover, > ${n}-submenu-title:hover`]:{color:b}},[`&:not(${n}-horizontal)`]:{[`${n}-item:not(${n}-item-selected)`]:{"&:hover":{backgroundColor:E},"&:active":{backgroundColor:M}},[`${n}-submenu-title`]:{"&:hover":{backgroundColor:E},"&:active":{backgroundColor:M}}},[`${n}-item-danger`]:{color:N,[`&${n}-item:hover`]:{[`&:not(${n}-item-selected):not(${n}-submenu-selected)`]:{color:j}},[`&${n}-item:active`]:{background:_}},[`${n}-item a`]:{"&, &:hover":{color:"inherit"}},[`${n}-item-selected`]:{color:o,[`&${n}-item-danger`]:{color:I},"a, a:hover":{color:"inherit"}},[`& ${n}-item-selected`]:{backgroundColor:u,[`&${n}-item-danger`]:{backgroundColor:T}},[`&${n}-submenu > ${n}`]:{backgroundColor:R},[`&${n}-popup > ${n}`]:{backgroundColor:P},[`&${n}-submenu-popup > ${n}`]:{backgroundColor:P},[`&${n}-horizontal`]:{...t==="dark"?{borderBottom:0}:{},[`> ${n}-item, > ${n}-submenu`]:{top:h,marginTop:e.calc(h).mul(-1).equal(),marginBottom:0,borderRadius:z,"&::after":{position:"absolute",insetInline:x,bottom:0,borderBottom:`${Xe(d)} solid transparent`,transition:`border-color ${m} ${g}`,content:'""'},"&:hover, &-active, &-open":{background:V,"&::after":{borderBottomWidth:d,borderBottomColor:$}},"&-selected":{color:$,backgroundColor:D,"&:hover":{backgroundColor:D},"&::after":{borderBottomWidth:d,borderBottomColor:$}}}},[`&${n}-root`]:{[`&${n}-inline, &${n}-vertical`]:{borderInlineEnd:`${Xe(h)} ${w} ${S}`}},[`&${n}-inline`]:{[`${n}-sub${n}-inline`]:{background:c},[`${n}-item`]:{position:"relative","&::after":{position:"absolute",insetBlock:0,insetInlineEnd:0,borderInlineEnd:`${Xe(p)} solid ${o}`,transform:"scaleY(0.0001)",opacity:0,transition:[`transform ${v} ${y}`,`opacity ${v} ${y}`].join(","),content:'""'},[`&${n}-item-danger`]:{"&::after":{borderInlineEndColor:I}}},[`${n}-selected, ${n}-item-selected`]:{"&::after":{transform:"scaleY(1)",opacity:1,transition:[`transform ${v} ${g}`,`opacity ${v} ${g}`].join(",")}}}}}},h3e=e=>{const{componentCls:t,itemHeight:n,itemMarginInline:r,padding:o,menuArrowSize:i,marginXS:s,itemMarginBlock:l,itemWidth:c,itemPaddingInline:u}=e,d=e.calc(i).add(o).add(s).equal();return{[`${t}-item`]:{position:"relative",overflow:"hidden"},[`${t}-item, ${t}-submenu-title`]:{height:n,lineHeight:Xe(n),paddingInline:u,overflow:"hidden",textOverflow:"ellipsis",marginInline:r,marginBlock:l,width:c},[`> ${t}-item, > ${t}-submenu > ${t}-submenu-title`]:{height:n,lineHeight:Xe(n)},[`${t}-item-group-list ${t}-submenu-title, ${t}-submenu-title`]:{paddingInlineEnd:d}}},vFn=e=>{const{componentCls:t,iconCls:n,itemHeight:r,colorTextLightSolid:o,dropdownWidth:i,controlHeightLG:s,motionEaseOut:l,paddingXL:c,itemMarginInline:u,fontSizeLG:d,motionDurationFast:p,motionDurationSlow:h,paddingXS:m,boxShadowSecondary:g,collapsedWidth:y,collapsedIconSize:x}=e,v={height:r,lineHeight:Xe(r),listStylePosition:"inside",listStyleType:"disc"};return[{[t]:{"&-inline, &-vertical":{[`&${t}-root`]:{boxShadow:"none"},...h3e(e)}},[`${t}-submenu-popup`]:{[`${t}-vertical`]:{...h3e(e),boxShadow:g}}},{[`${t}-submenu-popup ${t}-vertical${t}-sub`]:{minWidth:i,maxHeight:`calc(100vh - ${Xe(e.calc(s).mul(2.5).equal())})`,padding:"0",overflow:"hidden",borderInlineEnd:0,"&:not([class*='-active'])":{overflowX:"hidden",overflowY:"auto"}}},{[`${t}-inline`]:{width:"100%",[`&${t}-root`]:{[`${t}-item, ${t}-submenu-title`]:{display:"flex",alignItems:"center",transition:[`border-color ${h}`,`background-color ${h}`,`padding ${p} ${l}`].join(","),[`> ${t}-title-content`]:{flex:"auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},"> *":{flex:"none"}}},[`${t}-sub${t}-inline`]:{padding:0,border:0,borderRadius:0,boxShadow:"none",[`& > ${t}-submenu > ${t}-submenu-title`]:v,[`& ${t}-item-group-title`]:{paddingInlineStart:c}},[`${t}-item`]:v}},{[`${t}-inline-collapsed`]:{width:y,[`&${t}-root`]:{[`${t}-item, ${t}-submenu ${t}-submenu-title`]:{[`> ${t}-inline-collapsed-noicon`]:{fontSize:d,textAlign:"center"}}},[`> ${t}-item, > ${t}-item-group > ${t}-item-group-list > ${t}-item, > ${t}-item-group > ${t}-item-group-list > ${t}-submenu > ${t}-submenu-title, > ${t}-submenu > ${t}-submenu-title`]:{insetInlineStart:0,paddingInline:`calc(50% - ${Xe(e.calc(x).div(2).equal())} - ${Xe(u)})`,textOverflow:"clip",[` ${t}-submenu-arrow, ${t}-submenu-expand-icon `]:{opacity:0},[`${t}-item-icon, ${n}`]:{margin:0,fontSize:x,lineHeight:Xe(r),"+ span":{display:"inline-block",opacity:0}}},[`${t}-item-icon, ${n}`]:{display:"inline-block"},"&-tooltip":{pointerEvents:"none",[`${t}-item-icon, ${n}`]:{display:"none"},"a, a:hover":{color:o}},[`${t}-item-group-title`]:{...wh,paddingInline:m}}}]},m3e=e=>{const{componentCls:t,motionDurationSlow:n,motionDurationMid:r,motionEaseInOut:o,motionEaseOut:i,iconCls:s,iconSize:l,iconMarginInlineEnd:c}=e;return{[`${t}-item, ${t}-submenu-title`]:{position:"relative",display:"block",margin:0,whiteSpace:"nowrap",cursor:"pointer",transition:[`border-color ${n}`,`background-color ${n}`,`padding calc(${n} + 0.1s) ${o}`].join(","),[`${t}-item-icon, ${s}`]:{minWidth:l,fontSize:l,transition:[`font-size ${r} ${i}`,`margin ${n} ${o}`,`color ${n}`].join(","),"+ span":{marginInlineStart:c,opacity:1,transition:[`opacity ${n} ${o}`,`margin ${n}`,`color ${n}`].join(",")}},[`${t}-item-icon`]:{...QL()},[`&${t}-item-only-child`]:{[`> ${s}, > ${t}-item-icon`]:{marginInlineEnd:0}}},[`${t}-item-disabled, ${t}-submenu-disabled`]:{background:"none !important",cursor:"not-allowed","&::after":{borderColor:"transparent !important"},a:{color:"inherit !important",cursor:"not-allowed",pointerEvents:"none"},[`> ${t}-submenu-title`]:{color:"inherit !important",cursor:"not-allowed"}}}},g3e=e=>{const{componentCls:t,motionDurationSlow:n,motionEaseInOut:r,borderRadius:o,menuArrowSize:i,menuArrowOffset:s}=e;return{[`${t}-submenu`]:{"&-expand-icon, &-arrow":{position:"absolute",top:"50%",insetInlineEnd:e.margin,width:i,color:"currentcolor",transform:"translateY(-50%)",transition:`transform ${n} ${r}, opacity ${n}`},"&-arrow":{"&::before, &::after":{position:"absolute",width:e.calc(i).mul(.6).equal(),height:e.calc(i).mul(.15).equal(),backgroundColor:"currentcolor",borderRadius:o,transition:[`background-color ${n} ${r}`,`transform ${n} ${r}`,`top ${n} ${r}`,`color ${n} ${r}`].join(","),content:'""'},"&::before":{transform:`rotate(45deg) translateY(${Xe(e.calc(s).mul(-1).equal())})`},"&::after":{transform:`rotate(-45deg) translateY(${Xe(s)})`}}}}},bFn=e=>{const{antCls:t,componentCls:n,fontSize:r,motionDurationSlow:o,motionDurationMid:i,motionEaseInOut:s,paddingXS:l,padding:c,colorSplit:u,lineWidth:d,zIndexPopup:p,borderRadiusLG:h,subMenuItemBorderRadius:m,menuArrowSize:g,menuArrowOffset:y,lineType:x,groupTitleLineHeight:v,groupTitleFontSize:b}=e;return[{"":{[n]:{...kC(),"&-hidden":{display:"none"}}},[`${n}-submenu-hidden`]:{display:"none"}},{[n]:{...Ii(e),...kC(),marginBottom:0,paddingInlineStart:0,fontSize:r,lineHeight:0,listStyle:"none",outline:"none",transition:`width ${o} cubic-bezier(0.2, 0, 0, 1) 0s`,"ul, ol":{margin:0,padding:0,listStyle:"none"},"&-overflow":{display:"flex",[`${n}-item`]:{flex:"none"}},[`${n}-item, ${n}-submenu, ${n}-submenu-title`]:{borderRadius:e.itemBorderRadius},[`${n}-item-group-title`]:{padding:`${Xe(l)} ${Xe(c)}`,fontSize:b,lineHeight:v,transition:`all ${o}`},[`&-horizontal ${n}-submenu`]:{transition:[`border-color ${o} ${s}`,`background-color ${o} ${s}`].join(",")},[`${n}-submenu, ${n}-submenu-inline`]:{transition:[`border-color ${o} ${s}`,`background-color ${o} ${s}`,`padding ${i} ${s}`].join(",")},[`${n}-submenu ${n}-sub`]:{cursor:"initial",transition:[`background-color ${o} ${s}`,`padding ${o} ${s}`].join(",")},[`${n}-title-content`]:{transition:`color ${o}`,"&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},[`> ${t}-typography-ellipsis-single-line`]:{display:"inline",verticalAlign:"unset"},[`${n}-item-extra`]:{marginInlineStart:"auto",paddingInlineStart:e.padding}},[`${n}-item a`]:{"&::before":{position:"absolute",inset:0,backgroundColor:"transparent",content:'""'}},[`${n}-item-divider`]:{overflow:"hidden",lineHeight:0,borderColor:u,borderStyle:x,borderWidth:0,borderTopWidth:d,marginBlock:d,padding:0,"&-dashed":{borderStyle:"dashed"}},...m3e(e),[`${n}-item-group`]:{[`${n}-item-group-list`]:{margin:0,padding:0,[`${n}-item, ${n}-submenu-title`]:{paddingInline:`${Xe(e.calc(r).mul(2).equal())} ${Xe(c)}`}}},"&-submenu":{"&-popup":{position:"absolute",zIndex:p,borderRadius:h,boxShadow:"none",transformOrigin:"0 0",[`&${n}-submenu`]:{background:"transparent"},"&::before":{position:"absolute",inset:0,zIndex:-1,width:"100%",height:"100%",opacity:0,content:'""'},[`> ${n}`]:{borderRadius:h,...m3e(e),...g3e(e),[`${n}-item, ${n}-submenu > ${n}-submenu-title`]:{borderRadius:m},[`${n}-submenu-title::after`]:{transition:`transform ${o} ${s}`}}},"\n &-placement-leftTop,\n &-placement-bottomRight,\n ":{transformOrigin:"100% 0"},"\n &-placement-leftBottom,\n &-placement-topRight,\n ":{transformOrigin:"100% 100%"},"\n &-placement-rightBottom,\n &-placement-topLeft,\n ":{transformOrigin:"0 100%"},"\n &-placement-bottomLeft,\n &-placement-rightTop,\n ":{transformOrigin:"0 0"},"\n &-placement-leftTop,\n &-placement-leftBottom\n ":{paddingInlineEnd:e.paddingXS},"\n &-placement-rightTop,\n &-placement-rightBottom\n ":{paddingInlineStart:e.paddingXS},"\n &-placement-topRight,\n &-placement-topLeft\n ":{paddingBottom:e.paddingXS},"\n &-placement-bottomRight,\n &-placement-bottomLeft\n ":{paddingTop:e.paddingXS}},...g3e(e),[`&-inline-collapsed ${n}-submenu-arrow, &-inline ${n}-submenu-arrow`]:{"&::before":{transform:`rotate(-45deg) translateX(${Xe(y)})`},"&::after":{transform:`rotate(45deg) translateX(${Xe(e.calc(y).mul(-1).equal())})`}},[`${n}-submenu-open${n}-submenu-inline > ${n}-submenu-title > ${n}-submenu-arrow`]:{transform:`translateY(${Xe(e.calc(g).mul(.2).mul(-1).equal())})`,"&::after":{transform:`rotate(-45deg) translateX(${Xe(e.calc(y).mul(-1).equal())})`},"&::before":{transform:`rotate(45deg) translateX(${Xe(y)})`}}}},{[`${t}-layout-header`]:{[n]:{lineHeight:"inherit"}}}]},wFn=e=>{const{colorPrimary:t,colorError:n,colorTextDisabled:r,colorErrorBg:o,colorText:i,colorTextDescription:s,colorBgContainer:l,colorFillAlter:c,colorFillContent:u,lineWidth:d,lineWidthBold:p,controlItemBgActive:h,colorBgTextHover:m,controlHeightLG:g,lineHeight:y,colorBgElevated:x,marginXXS:v,padding:b,fontSize:w,controlHeightSM:S,fontSizeLG:C,colorTextLightSolid:N,colorErrorHover:j}=e,I=e.activeBarWidth??0,_=e.activeBarBorderWidth??d,T=e.itemMarginInline??e.marginXXS,P=new Hi(N).setA(.65).toRgbString();return{dropdownWidth:160,zIndexPopup:e.zIndexPopupBase+50,radiusItem:e.borderRadiusLG,itemBorderRadius:e.borderRadiusLG,radiusSubMenuItem:e.borderRadiusSM,subMenuItemBorderRadius:e.borderRadiusSM,colorItemText:i,itemColor:i,colorItemTextHover:i,itemHoverColor:i,colorItemTextHoverHorizontal:t,horizontalItemHoverColor:t,colorGroupTitle:s,groupTitleColor:s,colorItemTextSelected:t,itemSelectedColor:t,subMenuItemSelectedColor:t,colorItemTextSelectedHorizontal:t,horizontalItemSelectedColor:t,colorItemBg:l,itemBg:l,colorItemBgHover:m,itemHoverBg:m,colorItemBgActive:u,itemActiveBg:h,colorSubItemBg:c,subMenuItemBg:c,colorItemBgSelected:h,itemSelectedBg:h,colorItemBgSelectedHorizontal:"transparent",horizontalItemSelectedBg:"transparent",colorActiveBarWidth:0,activeBarWidth:I,colorActiveBarHeight:p,activeBarHeight:p,colorActiveBarBorderSize:d,activeBarBorderWidth:_,colorItemTextDisabled:r,itemDisabledColor:r,colorDangerItemText:n,dangerItemColor:n,colorDangerItemTextHover:n,dangerItemHoverColor:n,colorDangerItemTextSelected:n,dangerItemSelectedColor:n,colorDangerItemBgActive:o,dangerItemActiveBg:o,colorDangerItemBgSelected:o,dangerItemSelectedBg:o,itemMarginInline:T,horizontalItemBorderRadius:0,horizontalItemHoverBg:"transparent",itemHeight:g,groupTitleLineHeight:y,collapsedWidth:g*2,popupBg:x,itemMarginBlock:v,itemPaddingInline:b,horizontalLineHeight:`${g*1.15}px`,iconSize:w,iconMarginInlineEnd:S-w,collapsedIconSize:C,groupTitleFontSize:w,darkItemDisabledColor:new Hi(N).setA(.25).toRgbString(),darkItemColor:P,darkDangerItemColor:n,darkItemBg:"#001529",darkPopupBg:"#001529",darkSubMenuItemBg:"#000c17",darkItemSelectedColor:N,darkItemSelectedBg:t,darkDangerItemSelectedBg:n,darkItemHoverBg:"transparent",darkGroupTitleColor:P,darkItemHoverColor:N,darkDangerItemHoverColor:j,darkDangerItemSelectedColor:N,darkDangerItemActiveBg:n,itemWidth:I?`calc(100% + ${_}px)`:`calc(100% - ${T*2}px)`}},SFn=(e,t=e,n=!0)=>ui("Menu",o=>{const{colorBgElevated:i,controlHeightLG:s,fontSize:l,darkItemColor:c,darkDangerItemColor:u,darkItemBg:d,darkSubMenuItemBg:p,darkItemSelectedColor:h,darkItemSelectedBg:m,darkDangerItemSelectedBg:g,darkItemHoverBg:y,darkGroupTitleColor:x,darkItemHoverColor:v,darkItemDisabledColor:b,darkDangerItemHoverColor:w,darkDangerItemSelectedColor:S,darkDangerItemActiveBg:C,popupBg:N,darkPopupBg:j}=o,I=o.calc(l).div(7).mul(5).equal(),_=Ho(o,{menuArrowSize:I,menuHorizontalHeight:o.calc(s).mul(1.15).equal(),menuArrowOffset:o.calc(I).mul(.25).equal(),menuSubMenuBg:i,calc:o.calc,popupBg:N}),T=Ho(_,{itemColor:c,itemHoverColor:v,groupTitleColor:x,itemSelectedColor:h,subMenuItemSelectedColor:h,itemBg:d,popupBg:j,subMenuItemBg:p,itemActiveBg:"transparent",itemSelectedBg:m,activeBarHeight:0,activeBarBorderWidth:0,itemHoverBg:y,itemDisabledColor:b,dangerItemColor:u,dangerItemHoverColor:w,dangerItemSelectedColor:S,dangerItemActiveBg:C,dangerItemSelectedBg:g,menuSubMenuBg:p,horizontalItemSelectedColor:h,horizontalItemSelectedBg:m});return[bFn(_),xFn(_),vFn(_),p3e(_,"light"),p3e(T,"dark"),yFn(_),Fye(_),xb(_,"slide-up"),xb(_,"slide-down"),i6(_,"zoom-big")]},wFn,{deprecatedTokens:[["colorGroupTitle","groupTitleColor"],["radiusItem","itemBorderRadius"],["radiusSubMenuItem","subMenuItemBorderRadius"],["colorItemText","itemColor"],["colorItemTextHover","itemHoverColor"],["colorItemTextHoverHorizontal","horizontalItemHoverColor"],["colorItemTextSelected","itemSelectedColor"],["colorItemTextSelectedHorizontal","horizontalItemSelectedColor"],["colorItemTextDisabled","itemDisabledColor"],["colorDangerItemText","dangerItemColor"],["colorDangerItemTextHover","dangerItemHoverColor"],["colorDangerItemTextSelected","dangerItemSelectedColor"],["colorDangerItemBgActive","dangerItemActiveBg"],["colorDangerItemBgSelected","dangerItemSelectedBg"],["colorItemBg","itemBg"],["colorItemBgHover","itemHoverBg"],["colorSubItemBg","subMenuItemBg"],["colorItemBgActive","itemActiveBg"],["colorItemBgSelectedHorizontal","horizontalItemSelectedBg"],["colorActiveBarWidth","activeBarWidth"],["colorActiveBarHeight","activeBarHeight"],["colorActiveBarBorderSize","activeBarBorderWidth"],["colorItemBgSelected","itemSelectedBg"]],injectStyle:n,unitless:{groupTitleLineHeight:!0}})(e,t),Ult=e=>{var y,x,v,b,w,S;const{popupClassName:t,icon:n,title:r,theme:o}=e,i=f.useContext(zU),{prefixCls:s,inlineCollapsed:l,theme:c,classNames:u,styles:d}=i,p=Bk();let h;if(!n)h=l&&!p.length&&r&&typeof r=="string"?f.createElement("div",{className:`${s}-inline-collapsed-noicon`},r.charAt(0)):f.createElement("span",{className:`${s}-title-content`},r);else{const C=f.isValidElement(r)&&r.type==="span";h=f.createElement(f.Fragment,null,Fc(n,N=>({className:be(N.className,`${s}-item-icon`,u==null?void 0:u.itemIcon),style:{...N.style,...d==null?void 0:d.itemIcon}})),C?r:f.createElement("span",{className:`${s}-title-content`},r))}const m=f.useMemo(()=>({...i,firstLevel:!1}),[i]),[g]=sN("Menu");return f.createElement(zU.Provider,{value:m},f.createElement(YK,{...za(e,["icon"]),title:h,classNames:{list:(y=u==null?void 0:u.subMenu)==null?void 0:y.list,listTitle:(x=u==null?void 0:u.subMenu)==null?void 0:x.itemTitle},styles:{list:(v=d==null?void 0:d.subMenu)==null?void 0:v.list,listTitle:(b=d==null?void 0:d.subMenu)==null?void 0:b.itemTitle},popupClassName:be(s,t,(w=u==null?void 0:u.popup)==null?void 0:w.root,`${s}-${o||c}`),popupStyle:{zIndex:g,...e.popupStyle,...(S=d==null?void 0:d.popup)==null?void 0:S.root}}))};function fte(e){return e===null||e===!1}const CFn={item:Hlt,submenu:Ult,divider:Blt},NFn=f.forwardRef((e,t)=>{var re;const n=f.useContext(BU),r=n||{},{prefixCls:o,className:i,style:s,theme:l="light",expandIcon:c,_internalDisableMenuItemTitleTooltip:u,inlineCollapsed:d,siderCollapsed:p,rootClassName:h,mode:m,selectable:g,onClick:y,overflowedIndicatorPopupClassName:x,classNames:v,styles:b,...w}=e,{menu:S}=f.useContext(Qr),{getPrefixCls:C,getPopupContainer:N,direction:j,className:I,style:_,classNames:T,styles:P}=Zo("menu"),E=C(),M=za(w,["collapsedWidth"]);(re=r.validator)==null||re.call(r,{mode:m});const R=Vr((...ce)=>{var ae;y==null||y(...ce),(ae=r.onClick)==null||ae.call(r)}),$=r.mode||m,D=g??r.selectable,z=d??p,V={...e,mode:$,inlineCollapsed:z,selectable:D,theme:l},[B,G]=di([T,v],[P,b],{props:V},{popup:{_default:"root"},subMenu:{_default:"item"}}),H={horizontal:{motionName:`${E}-slide-up`},inline:AU(E),other:{motionName:`${E}-zoom-big`}},F=C("menu",o||r.prefixCls),W=pl(F),[U,K]=SFn(F,W,!n),X=be(`${F}-${l}`,I,i),J=f.useMemo(()=>{var ae;if(typeof c=="function"||fte(c))return c||null;if(typeof r.expandIcon=="function"||fte(r.expandIcon))return r.expandIcon||null;if(typeof(S==null?void 0:S.expandIcon)=="function"||fte(S==null?void 0:S.expandIcon))return(S==null?void 0:S.expandIcon)||null;const ce=c??(r==null?void 0:r.expandIcon)??(S==null?void 0:S.expandIcon);return Fc(ce,{className:be(`${F}-submenu-expand-icon`,f.isValidElement(ce)?(ae=ce.props)==null?void 0:ae.className:void 0)})},[c,r==null?void 0:r.expandIcon,S==null?void 0:S.expandIcon,F]),te=f.useMemo(()=>({prefixCls:F,inlineCollapsed:z||!1,direction:j,firstLevel:!0,theme:l,mode:$,disableMenuItemTitleTooltip:u,classNames:B,styles:G}),[F,z,j,u,l,$,B,G]);return f.createElement(BU.Provider,{value:null},f.createElement(zU.Provider,{value:te},f.createElement(Hk,{getPopupContainer:N,overflowedIndicator:f.createElement(cve,null),overflowedIndicatorPopupClassName:be(F,`${F}-${l}`,x),classNames:{list:B.list,listTitle:B.itemTitle},styles:{list:G.list,listTitle:G.itemTitle},mode:$,selectable:D,onClick:R,...M,inlineCollapsed:z,style:{...G.root,..._,...s},className:X,prefixCls:F,direction:j,defaultMotions:H,expandIcon:J,ref:t,rootClassName:be(h,U,r.rootClassName,K,W,B.root),_internalComponents:CFn})))}),Vk=f.forwardRef((e,t)=>{const n=f.useRef(null),r=f.useContext(zlt);return f.useImperativeHandle(t,()=>({menu:n.current,focus:o=>{var i;(i=n.current)==null||i.focus(o)}})),f.createElement(NFn,{ref:n,...e,...r})});Vk.Item=Hlt;Vk.SubMenu=Ult;Vk.Divider=Blt;Vk.ItemGroup=lve;const jFn=e=>{const{componentCls:t,menuCls:n,colorError:r,colorTextLightSolid:o}=e,i=`${n}-item`;return{[`${t}, ${t}-menu-submenu`]:{[`${n} ${i}`]:{[`&${i}-danger:not(${i}-disabled)`]:{color:r,"&:hover":{color:o,backgroundColor:r}}}}}},EFn=e=>{const{componentCls:t,menuCls:n,zIndexPopup:r,dropdownArrowDistance:o,sizePopupArrow:i,antCls:s,iconCls:l,motionDurationMid:c,paddingBlock:u,fontSize:d,dropdownEdgeChildPadding:p,colorTextDisabled:h,fontSizeIcon:m,controlPaddingHorizontal:g,colorBgElevated:y}=e;return[{[t]:{position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:r,display:"block","&::before":{position:"absolute",insetBlock:e.calc(i).div(2).sub(o).equal(),zIndex:-9999,opacity:1e-4,content:'""'},"&-menu-vertical":{maxHeight:"100vh",overflowY:"auto"},[`&-trigger${s}-btn`]:{[`& > ${l}-down, & > ${s}-btn-icon > ${l}-down`]:{fontSize:m}},[`${t}-wrap`]:{position:"relative",[`${s}-btn > ${l}-down`]:{fontSize:m},[`${l}-down::before`]:{transition:`transform ${c}`}},[`${t}-wrap-open`]:{[`${l}-down::before`]:{transform:"rotate(180deg)"}},"\n &-hidden,\n &-menu-hidden,\n &-menu-submenu-hidden\n ":{display:"none"},[`&${s}-slide-down-enter${s}-slide-down-enter-active${t}-placement-bottomLeft, &${s}-slide-down-appear${s}-slide-down-appear-active${t}-placement-bottomLeft, &${s}-slide-down-enter${s}-slide-down-enter-active${t}-placement-bottom, &${s}-slide-down-appear${s}-slide-down-appear-active${t}-placement-bottom, &${s}-slide-down-enter${s}-slide-down-enter-active${t}-placement-bottomRight, &${s}-slide-down-appear${s}-slide-down-appear-active${t}-placement-bottomRight`]:{animationName:DK},[`&${s}-slide-up-enter${s}-slide-up-enter-active${t}-placement-topLeft, &${s}-slide-up-appear${s}-slide-up-appear-active${t}-placement-topLeft, &${s}-slide-up-enter${s}-slide-up-enter-active${t}-placement-top, &${s}-slide-up-appear${s}-slide-up-appear-active${t}-placement-top, &${s}-slide-up-enter${s}-slide-up-enter-active${t}-placement-topRight, &${s}-slide-up-appear${s}-slide-up-appear-active${t}-placement-topRight`]:{animationName:FK},[`&${s}-slide-down-leave${s}-slide-down-leave-active${t}-placement-bottomLeft, &${s}-slide-down-leave${s}-slide-down-leave-active${t}-placement-bottom, &${s}-slide-down-leave${s}-slide-down-leave-active${t}-placement-bottomRight`]:{animationName:LK},[`&${s}-slide-up-leave${s}-slide-up-leave-active${t}-placement-topLeft, &${s}-slide-up-leave${s}-slide-up-leave-active${t}-placement-top, &${s}-slide-up-leave${s}-slide-up-leave-active${t}-placement-topRight`]:{animationName:zK}}},tve(e,y,{arrowPlacement:{top:!0,bottom:!0}}),{[`${t} ${n}`]:{position:"relative",margin:0},[`${n}-submenu-popup`]:{position:"absolute",zIndex:r,background:"transparent",boxShadow:"none",transformOrigin:"0 0","ul, li":{listStyle:"none",margin:0}},[`${t}, ${t}-menu-submenu`]:{...Ii(e),[n]:{padding:p,listStyleType:"none",backgroundColor:y,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,...gy(e),"&:empty":{padding:0,boxShadow:"none"},[`${n}-item-group-title`]:{padding:`${Xe(u)} ${Xe(g)}`,color:e.colorTextDescription,transition:`all ${c}`},[`${n}-item`]:{position:"relative",display:"flex",alignItems:"center"},[`${n}-item-icon`]:{minWidth:d,marginInlineEnd:e.marginXS,fontSize:e.fontSizeSM},[`${n}-title-content`]:{flex:"auto","&-with-extra":{display:"inline-flex",alignItems:"center",width:"100%"},"> a":{color:"inherit",transition:`all ${c}`,"&:hover":{color:"inherit"},"&::after":{position:"absolute",inset:0,content:'""'}},[`${n}-item-extra`]:{paddingInlineStart:e.padding,marginInlineStart:"auto",fontSize:e.fontSizeSM,color:e.colorTextDescription}},[`${n}-item, ${n}-submenu-title`]:{display:"flex",margin:0,padding:`${Xe(u)} ${Xe(g)}`,color:e.colorText,fontWeight:"normal",fontSize:d,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${c}`,borderRadius:e.borderRadiusSM,"&:hover, &-active":{backgroundColor:e.controlItemBgHover},...gy(e),"&-selected":{color:e.colorPrimary,backgroundColor:e.controlItemBgActive,"&:hover, &-active":{backgroundColor:e.controlItemBgActiveHover}},"&-disabled":{color:h,cursor:"not-allowed","&:hover":{color:h,backgroundColor:y,cursor:"not-allowed"},a:{pointerEvents:"none"}},"&-divider":{height:1,margin:`${Xe(e.marginXXS)} 0`,overflow:"hidden",lineHeight:0,backgroundColor:e.colorSplit},[`${t}-menu-submenu-expand-icon`]:{position:"absolute",insetInlineEnd:e.paddingXS,[`${t}-menu-submenu-arrow-icon`]:{marginInlineEnd:"0 !important",color:e.colorIcon,fontSize:m,fontStyle:"normal"}}},[`${n}-item-group-list`]:{margin:`0 ${Xe(e.marginXS)}`,padding:0,listStyle:"none"},[`${n}-submenu-title`]:{paddingInlineEnd:e.calc(g).add(e.fontSizeSM).equal()},[`${n}-submenu-vertical`]:{position:"relative"},[`${n}-submenu${n}-submenu-disabled ${t}-menu-submenu-title`]:{[`&, ${t}-menu-submenu-arrow-icon`]:{color:h,backgroundColor:y,cursor:"not-allowed"}},[`${n}-submenu-selected ${t}-menu-submenu-title`]:{color:e.colorPrimary}}}},[xb(e,"slide-up"),xb(e,"slide-down"),PT(e,"move-up"),PT(e,"move-down"),i6(e,"zoom-big")]]},IFn=e=>({zIndexPopup:e.zIndexPopupBase+50,paddingBlock:(e.controlHeight-e.fontSize*e.lineHeight)/2,...GK({contentRadius:e.borderRadiusLG,limitVerticalRadius:!0}),...WK(e)}),_Fn=ui("Dropdown",e=>{const{marginXXS:t,sizePopupArrow:n,paddingXXS:r,componentCls:o}=e,i=Ho(e,{menuCls:`${o}-menu`,dropdownArrowDistance:e.calc(n).div(2).add(t).equal(),dropdownEdgeChildPadding:r});return[EFn(i),jFn(i)]},IFn,{resetStyle:!1}),XK=e=>{const{menu:t,arrow:n,prefixCls:r,children:o,trigger:i,disabled:s,dropdownRender:l,popupRender:c,getPopupContainer:u,overlayClassName:d,rootClassName:p,overlayStyle:h,open:m,onOpenChange:g,mouseEnterDelay:y=.15,mouseLeaveDelay:x=.1,autoAdjustOverflow:v=!0,placement:b="",transitionName:w,classNames:S,styles:C,destroyPopupOnHide:N,destroyOnHidden:j}=e,{getPrefixCls:I,direction:_,getPopupContainer:T,className:P,style:E,classNames:M,styles:R}=Zo("dropdown"),$={...e,mouseEnterDelay:y,mouseLeaveDelay:x,autoAdjustOverflow:v},[D,z]=di([M,S],[R,C],{props:$}),V={...E,...h,...z.root},B=c||l;Qw();const G=f.useMemo(()=>{const xe=I();return w!==void 0?w:b.includes("top")?`${xe}-slide-down`:`${xe}-slide-up`},[I,b,w]),H=f.useMemo(()=>b?b.includes("Center")?b.slice(0,b.indexOf("Center")):b:_==="rtl"?"bottomRight":"bottomLeft",[b,_]),F=I("dropdown",r),W=pl(F),[U,K]=_Fn(F,W),[,X]=Xf(),J=f.Children.only(q8n(o)?f.createElement("span",null,o):o),te=Fc(J,{className:be(`${F}-trigger`,{[`${F}-rtl`]:_==="rtl"},J.props.className),disabled:J.props.disabled??s}),re=s?[]:i,ce=!!(re!=null&&re.includes("contextMenu")),[ae,oe]=Fa(!1,m),ue=Vr(xe=>{g==null||g(xe,{source:"trigger"}),oe(xe)}),fe=be(d,p,U,K,W,P,D.root,{[`${F}-rtl`]:_==="rtl"}),se=xlt({arrowPointAtCenter:typeof n=="object"&&n.pointAtCenter,autoAdjustOverflow:v,offset:X.marginXXS,arrowWidth:n?X.sizePopupArrow:0,borderRadius:X.borderRadius}),ge=Vr(()=>{t!=null&&t.selectable&&(t!=null&&t.multiple)||(g==null||g(!1,{source:"menu"}),oe(!1))}),ye=()=>{const xe=za(D,["root"]),we=za(z,["root"]);let Te;return t!=null&&t.items&&(Te=f.createElement(Vk,{...t,classNames:{...xe,subMenu:{...xe}},styles:{...we,subMenu:{...we}}})),B&&(Te=B(Te)),Te=f.Children.only(typeof Te=="string"?f.createElement("span",null,Te):Te),f.createElement(Vlt,{prefixCls:`${F}-menu`,rootClassName:be(K,W),expandIcon:f.createElement("span",{className:`${F}-menu-submenu-arrow`},_==="rtl"?f.createElement(Mce,{className:`${F}-menu-submenu-arrow-icon`}):f.createElement(tce,{className:`${F}-menu-submenu-arrow-icon`})),mode:"vertical",selectable:!1,onClick:ge,validator:({mode:Re})=>{}},Te)},[de,Ne]=sN("Dropdown",V.zIndex);let _e=f.createElement(Ilt,{alignPoint:ce,...za(e,["rootClassName","onOpenChange"]),mouseEnterDelay:y,mouseLeaveDelay:x,visible:ae,builtinPlacements:se,arrow:!!n,overlayClassName:fe,prefixCls:F,getPopupContainer:u||T,transitionName:G,trigger:re,overlay:ye,placement:H,onVisibleChange:ue,overlayStyle:{...V,zIndex:de},autoDestroy:j??N},te);return de&&(_e=f.createElement(ZL.Provider,{value:Ne},_e)),_e},PFn=HK(XK,"align",void 0,"dropdown",e=>e),AFn=e=>f.createElement(PFn,{...e},f.createElement("span",null));XK._InternalPanelDoNotUseOrYouWillBeFired=AFn;var xB={exports:{}},TFn=xB.exports,x3e;function kFn(){return x3e||(x3e=1,(function(e,t){(function(n,r){e.exports=r()})(TFn,(function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",l="minute",c="hour",u="day",d="week",p="month",h="quarter",m="year",g="date",y="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(R){var $=["th","st","nd","rd"],D=R%100;return"["+R+($[(D-20)%10]||$[D]||$[0])+"]"}},w=function(R,$,D){var z=String(R);return!z||z.length>=$?R:""+Array($+1-z.length).join(D)+R},S={s:w,z:function(R){var $=-R.utcOffset(),D=Math.abs($),z=Math.floor(D/60),V=D%60;return($<=0?"+":"-")+w(z,2,"0")+":"+w(V,2,"0")},m:function R($,D){if($.date()1)return R(G[0])}else{var H=$.name;N[H]=$,V=H}return!z&&V&&(C=V),V||!z&&C},T=function(R,$){if(I(R))return R.clone();var D=typeof $=="object"?$:{};return D.date=R,D.args=arguments,new E(D)},P=S;P.l=_,P.i=I,P.w=function(R,$){return T(R,{locale:$.$L,utc:$.$u,x:$.$x,$offset:$.$offset})};var E=(function(){function R(D){this.$L=_(D.locale,null,!0),this.parse(D),this.$x=this.$x||D.x||{},this[j]=!0}var $=R.prototype;return $.parse=function(D){this.$d=(function(z){var V=z.date,B=z.utc;if(V===null)return new Date(NaN);if(P.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var G=V.match(x);if(G){var H=G[2]-1||0,F=(G[7]||"0").substring(0,3);return B?new Date(Date.UTC(G[1],H,G[3]||1,G[4]||0,G[5]||0,G[6]||0,F)):new Date(G[1],H,G[3]||1,G[4]||0,G[5]||0,G[6]||0,F)}}return new Date(V)})(D),this.init()},$.init=function(){var D=this.$d;this.$y=D.getFullYear(),this.$M=D.getMonth(),this.$D=D.getDate(),this.$W=D.getDay(),this.$H=D.getHours(),this.$m=D.getMinutes(),this.$s=D.getSeconds(),this.$ms=D.getMilliseconds()},$.$utils=function(){return P},$.isValid=function(){return this.$d.toString()!==y},$.isSame=function(D,z){var V=T(D);return this.startOf(z)<=V&&V<=this.endOf(z)},$.isAfter=function(D,z){return T(D)25){var d=s(this).startOf(r).add(1,r).date(u),p=s(this).endOf(n);if(d.isBefore(p))return 1}var h=s(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),m=this.diff(h,n,!0);return m<0?s(this).startOf("week").week():Math.ceil(m)},l.weeks=function(c){return c===void 0&&(c=null),this.week(c)}}}))})(bB)),bB.exports}var UFn=VFn();const WFn=Ba(UFn);var wB={exports:{}},GFn=wB.exports,w3e;function qFn(){return w3e||(w3e=1,(function(e,t){(function(n,r){e.exports=r()})(GFn,(function(){return function(n,r){r.prototype.weekYear=function(){var o=this.month(),i=this.week(),s=this.year();return i===1&&o===11?s+1:o===0&&i>=52?s-1:s}}}))})(wB)),wB.exports}var KFn=qFn();const YFn=Ba(KFn);var SB={exports:{}},XFn=SB.exports,S3e;function QFn(){return S3e||(S3e=1,(function(e,t){(function(n,r){e.exports=r()})(XFn,(function(){return function(n,r){var o=r.prototype,i=o.format;o.format=function(s){var l=this,c=this.$locale();if(!this.isValid())return i.bind(this)(s);var u=this.$utils(),d=(s||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(p){switch(p){case"Q":return Math.ceil((l.$M+1)/3);case"Do":return c.ordinal(l.$D);case"gggg":return l.weekYear();case"GGGG":return l.isoWeekYear();case"wo":return c.ordinal(l.week(),"W");case"w":case"ww":return u.s(l.week(),p==="w"?1:2,"0");case"W":case"WW":return u.s(l.isoWeek(),p==="W"?1:2,"0");case"k":case"kk":return u.s(String(l.$H===0?24:l.$H),p==="k"?1:2,"0");case"X":return Math.floor(l.$d.getTime()/1e3);case"x":return l.$d.getTime();case"z":return"["+l.offsetName()+"]";case"zzz":return"["+l.offsetName("long")+"]";default:return p}}));return i.bind(this)(d)}}}))})(SB)),SB.exports}var JFn=QFn();const ZFn=Ba(JFn);var CB={exports:{}},e7n=CB.exports,C3e;function t7n(){return C3e||(C3e=1,(function(e,t){(function(n,r){e.exports=r()})(e7n,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,i=/\d\d/,s=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,c={},u=function(x){return(x=+x)+(x>68?1900:2e3)},d=function(x){return function(v){this[x]=+v}},p=[/[+-]\d\d:?(\d\d)?|Z/,function(x){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var b=v.match(/([+-]|\d\d)/g),w=60*b[1]+(+b[2]||0);return w===0?0:b[0]==="+"?-w:w})(x)}],h=function(x){var v=c[x];return v&&(v.indexOf?v:v.s.concat(v.f))},m=function(x,v){var b,w=c.meridiem;if(w){for(var S=1;S<=24;S+=1)if(x.indexOf(w(S,0,v))>-1){b=S>12;break}}else b=x===(v?"pm":"PM");return b},g={A:[l,function(x){this.afternoon=m(x,!1)}],a:[l,function(x){this.afternoon=m(x,!0)}],Q:[o,function(x){this.month=3*(x-1)+1}],S:[o,function(x){this.milliseconds=100*+x}],SS:[i,function(x){this.milliseconds=10*+x}],SSS:[/\d{3}/,function(x){this.milliseconds=+x}],s:[s,d("seconds")],ss:[s,d("seconds")],m:[s,d("minutes")],mm:[s,d("minutes")],H:[s,d("hours")],h:[s,d("hours")],HH:[s,d("hours")],hh:[s,d("hours")],D:[s,d("day")],DD:[i,d("day")],Do:[l,function(x){var v=c.ordinal,b=x.match(/\d+/);if(this.day=b[0],v)for(var w=1;w<=31;w+=1)v(w).replace(/\[|\]/g,"")===x&&(this.day=w)}],w:[s,d("week")],ww:[i,d("week")],M:[s,d("month")],MM:[i,d("month")],MMM:[l,function(x){var v=h("months"),b=(h("monthsShort")||v.map((function(w){return w.slice(0,3)}))).indexOf(x)+1;if(b<1)throw new Error;this.month=b%12||b}],MMMM:[l,function(x){var v=h("months").indexOf(x)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,d("year")],YY:[i,function(x){this.year=u(x)}],YYYY:[/\d{4}/,d("year")],Z:p,ZZ:p};function y(x){var v,b;v=x,b=c&&c.formats;for(var w=(x=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(T,P,E){var M=E&&E.toUpperCase();return P||b[E]||n[E]||b[M].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(R,$,D){return $||D.slice(1)}))}))).match(r),S=w.length,C=0;C-1)return new Date((V==="X"?1e3:1)*z);var H=y(V)(z),F=H.year,W=H.month,U=H.day,K=H.hours,X=H.minutes,J=H.seconds,te=H.milliseconds,re=H.zone,ce=H.week,ae=new Date,oe=U||(F||W?1:ae.getDate()),ue=F||ae.getFullYear(),fe=0;F&&!W||(fe=W>0?W-1:ae.getMonth());var se,ge=K||0,ye=X||0,de=J||0,Ne=te||0;return re?new Date(Date.UTC(ue,fe,oe,ge,ye,de,Ne+60*re.offset*1e3)):B?new Date(Date.UTC(ue,fe,oe,ge,ye,de,Ne)):(se=new Date(ue,fe,oe,ge,ye,de,Ne),ce&&(se=G(se).week(ce).toDate()),se)}catch{return new Date("")}})(N,_,j,b),this.init(),M&&M!==!0&&(this.$L=this.locale(M).$L),E&&N!=this.format(_)&&(this.$d=new Date("")),c={}}else if(_ instanceof Array)for(var R=_.length,$=1;$<=R;$+=1){I[1]=_[$-1];var D=b.apply(this,I);if(D.isValid()){this.$d=D.$d,this.$L=D.$L,this.init();break}$===R&&(this.$d=new Date(""))}else S.call(this,C)}}}))})(CB)),CB.exports}var n7n=t7n();const r7n=Ba(n7n);ou.extend(r7n);ou.extend(ZFn);ou.extend(DFn);ou.extend(BFn);ou.extend(WFn);ou.extend(YFn);ou.extend(function(e,t){var n=t.prototype,r=n.format;n.format=function(i){var s=(i||"").replace("Wo","wo");return r.bind(this)(s)}});var o7n={bn_BD:"bn-bd",by_BY:"be",en_GB:"en-gb",en_US:"en",fr_BE:"fr",fr_CA:"fr-ca",hy_AM:"hy-am",kmr_IQ:"ku",nl_BE:"nl-be",pt_BR:"pt-br",zh_CN:"zh-cn",zh_HK:"zh-hk",zh_TW:"zh-tw"},GN=function(t){var n=o7n[t];return n||t.split("_")[0]},i7n={getNow:function(){var t=ou();return typeof t.tz=="function"?t.tz():t},getFixedDate:function(t){return ou(t,["YYYY-M-DD","YYYY-MM-DD"])},getEndDate:function(t){return t.endOf("month")},getWeekDay:function(t){var n=t.locale("en");return n.weekday()+n.localeData().firstDayOfWeek()},getYear:function(t){return t.year()},getMonth:function(t){return t.month()},getDate:function(t){return t.date()},getHour:function(t){return t.hour()},getMinute:function(t){return t.minute()},getSecond:function(t){return t.second()},getMillisecond:function(t){return t.millisecond()},addYear:function(t,n){return t.add(n,"year")},addMonth:function(t,n){return t.add(n,"month")},addDate:function(t,n){return t.add(n,"day")},setYear:function(t,n){return t.year(n)},setMonth:function(t,n){return t.month(n)},setDate:function(t,n){return t.date(n)},setHour:function(t,n){return t.hour(n)},setMinute:function(t,n){return t.minute(n)},setSecond:function(t,n){return t.second(n)},setMillisecond:function(t,n){return t.millisecond(n)},isAfter:function(t,n){return t.isAfter(n)},isValidate:function(t){return t.isValid()},locale:{getWeekFirstDay:function(t){return ou().locale(GN(t)).localeData().firstDayOfWeek()},getWeekFirstDate:function(t,n){return n.locale(GN(t)).weekday(0)},getWeek:function(t,n){return n.locale(GN(t)).week()},getShortWeekDays:function(t){return ou().locale(GN(t)).localeData().weekdaysMin()},getShortMonths:function(t){return ou().locale(GN(t)).localeData().monthsShort()},format:function(t,n,r){return n.locale(GN(t)).format(r)},parse:function(t,n,r){for(var o=GN(t),i=0;ie.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:"0",r=String(e);r.lengthe.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:[],r=f.useState([!1,!1]),o=y7n(r,2),i=o[0],s=o[1],l=function(d,p){s(function(h){return PO(h,p,d)})},c=f.useMemo(function(){return i.map(function(u,d){if(u)return!0;var p=e[d];return p?!!(!n[d]&&!p||p&&t(p,{activeIndex:d})):!1})},[e,i,t,n]);return[c,l]}function v$(e){"@babel/helpers - typeof";return v$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v$(e)}function _3e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function P3e(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&(s=t.addDate(s,-7)),s}function Ad(e,t){var n=t.generateConfig,r=t.locale,o=t.format;return e?typeof o=="function"?o(e):n.locale.format(r.locale,e,o):""}function HU(e,t,n){var r=t,o=["getHour","getMinute","getSecond","getMillisecond"],i=["setHour","setMinute","setSecond","setMillisecond"];return i.forEach(function(s,l){n?r=e[s](r,e[o[l]](n)):r=e[s](r,0)}),r}function z7n(e,t,n,r,o){var i=Vr(function(s,l){return!!(n&&n(s,l)||r&&e.isAfter(r,s)&&!Ip(e,t,r,s,l.type)||o&&e.isAfter(s,o)&&!Ip(e,t,o,s,l.type))});return i}function Kce(e){"@babel/helpers - typeof";return Kce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kce(e)}function B7n(e,t,n){return f.useMemo(function(){var r=Glt(e,t,n),o=h5(r),i=o[0],s=Kce(i)==="object"&&i.type==="mask"?i.format:null;return[o.map(function(l){return typeof l=="string"||typeof l=="function"?l:l.format}),s]},[e,t,n])}function H7n(e,t,n){return typeof e[0]=="function"||n?!0:t}function b$(e){"@babel/helpers - typeof";return b$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b$(e)}function M3e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function V7n(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:!1,n=f.useMemo(function(){var r=e&&h5(e);return t&&r&&(r[1]=r[1]||r[0]),r},[e,t]);return n}function oct(e,t){var n=e.generateConfig,r=e.locale,o=e.picker,i=o===void 0?"date":o,s=e.prefixCls,l=s===void 0?"rc-picker":s,c=e.previewValue,u=c===void 0?"hover":c,d=e.styles,p=d===void 0?{}:d,h=e.classNames,m=h===void 0?{}:h,g=e.order,y=g===void 0?!0:g,x=e.components,v=x===void 0?{}:x,b=e.inputRender,w=e.allowClear,S=e.clearIcon,C=e.needConfirm,N=e.multiple,j=e.format,I=e.inputReadOnly,_=e.disabledDate,T=e.minDate,P=e.maxDate,E=e.showTime,M=e.value,R=e.defaultValue,$=e.pickerValue,D=e.defaultPickerValue,z=f7(M),V=f7(R),B=f7($),G=f7(D),H=i==="date"&&E?"datetime":i,F=H==="time"||H==="datetime",W=F||N,U=C??F,K=ect(e),X=O3e(K,4),J=X[0],te=X[1],re=X[2],ce=X[3],ae=Qlt(r,te),oe=f.useMemo(function(){return tct(H,re,ce,J,ae)},[H,re,ce,J,ae]),ue=f.useMemo(function(){return _M(_M({},e),{},{previewValue:u,prefixCls:l,locale:ae,picker:i,styles:p,classNames:m,order:y,components:_M({input:b},v),clearIcon:D7n(l,w,S),showTime:oe,value:z,defaultValue:V,pickerValue:B,defaultPickerValue:G},t==null?void 0:t())},[e]),fe=B7n(H,ae,j),se=O3e(fe,2),ge=se[0],ye=se[1],de=H7n(ge,I,N),Ne=z7n(n,r,_,T,P),_e=q7n(n,i,Ne,oe),xe=f.useMemo(function(){return _M(_M({},ue),{},{needConfirm:U,inputReadOnly:de,disabledDate:Ne})},[ue,U,de,Ne]);return[xe,H,W,ge,ye,_e]}function D3e(e,t){return o9n(e)||r9n(e,t)||n9n(e,t)||t9n()}function t9n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n9n(e,t){if(e){if(typeof e=="string")return L3e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L3e(e,t)}}function L3e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,o=n.every(function(d){return d})?!1:e,i=i9n(o,t||!1,r),s=a9n(i,2),l=s[0],c=s[1];function u(d){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!p.inherit||l)&&c(d,p.force)}return[l,u]}function act(e){var t=f.useRef();return f.useImperativeHandle(e,function(){var n;return{nativeElement:(n=t.current)===null||n===void 0?void 0:n.nativeElement,focus:function(o){var i;(i=t.current)===null||i===void 0||i.focus(o)},blur:function(){var o;(o=t.current)===null||o===void 0||o.blur()}}}),t}function d9n(e,t){return m9n(e)||h9n(e,t)||p9n(e,t)||f9n()}function f9n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p9n(e,t){if(e){if(typeof e=="string")return z3e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z3e(e,t)}}function z3e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:1,r=f.useRef(t);r.current=t,git(function(){if(e)r.current(e);else{var o=Bo(function(){r.current(e)},n);return function(){Bo.cancel(o)}}},[e])}function B3e(e,t){return v9n(e)||y9n(e,t)||x9n(e,t)||g9n()}function g9n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x9n(e,t){if(e){if(typeof e=="string")return H3e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H3e(e,t)}}function H3e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=f.useState(0),o=B3e(r,2),i=o[0],s=o[1],l=f.useState(!1),c=B3e(l,2),u=c[0],d=c[1],p=f.useRef([]),h=f.useRef(null),m=f.useRef(null),g=function(S){h.current=S},y=function(S){return h.current===S},x=function(S){d(S)},v=function(S){return S&&(m.current=S),m.current},b=function(S){var C=p.current,N=new Set(C.filter(function(I){return S[I]||t[I]})),j=C[C.length-1]===0?1:0;return N.size>=2||e[j]?null:j};return hve(u||n,function(){u||(p.current=[],g(null))}),f.useEffect(function(){u&&p.current.push(i)},[u,i]),[u,x,v,i,s,b,p.current,g,y]}function S$(e){"@babel/helpers - typeof";return S$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S$(e)}function V3e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function U3e(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n8&&arguments[8]!==void 0?arguments[8]:mte,u=arguments.length>9&&arguments[9]!==void 0?arguments[9]:mte,d=arguments.length>10&&arguments[10]!==void 0?arguments[10]:mte,p=arguments.length>11?arguments[11]:void 0,h=arguments.length>12?arguments[12]:void 0,m=arguments.length>13?arguments[13]:void 0,g=s==="time",y=i||0,x=function(z){var V=e.getNow();return g&&(V=HU(e,V)),c[z]||n[z]||V},v=hte(u,2),b=v[0],w=v[1],S=Fa(function(){return x(0)},b),C=hte(S,2),N=C[0],j=C[1],I=Fa(function(){return x(1)},w),_=hte(I,2),T=_[0],P=_[1],E=f.useMemo(function(){var D=[N,T][y];return g?D:HU(e,D,d[y])},[g,N,T,y,e,d]),M=function(z){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"panel",B=[j,P][y];B(z);var G=[N,T];G[y]=z,p&&(!Ip(e,t,N,G[0],s)||!Ip(e,t,T,G[1],s))&&p(G,{source:V,range:y===1?"end":"start",mode:r})},R=function(z,V){if(l){var B={date:"month",week:"month",month:"year",quarter:"year"},G=B[s];if(G&&!Ip(e,t,z,V,G))return OR(e,s,V,-1);if(s==="year"&&z){var H=Math.floor(e.getYear(z)/10),F=Math.floor(e.getYear(V)/10);if(H!==F)return OR(e,s,V,-1)}}return V},$=f.useRef(null);return Po(function(){if(o&&!c[y]){var D=g?null:e.getNow();if($.current!==null&&$.current!==y?D=[N,T][y^1]:n[y]?D=y===0?n[0]:R(n[0],n[1]):n[y^1]&&(D=n[y^1]),D){h&&e.isAfter(h,D)&&(D=h);var z=l?OR(e,s,D,1):D;m&&e.isAfter(z,m)&&(D=l?OR(e,s,m,-1):m),M(D,"reset")}}},[o,y,n[y]]),f.useEffect(function(){o?$.current=y:$.current=null},[o,y]),Po(function(){o&&c&&c[y]&&M(c[y],"reset")},[o,y]),[E,M]}function M9n(e,t){return D9n(e)||$9n(e,t)||O9n(e,t)||R9n()}function R9n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function O9n(e,t){if(e){if(typeof e=="string")return q3e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return q3e(e,t)}}function q3e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:2,s=[],l=n>=1?n|0:1,c=e;c<=t;c+=l){var u=o.includes(c);(!u||!r)&&s.push({label:uve(c,i),value:c,disabled:u})}return s}function gve(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=t||{},o=r.use12Hours,i=r.hourStep,s=i===void 0?1:i,l=r.minuteStep,c=l===void 0?1:l,u=r.secondStep,d=u===void 0?1:u,p=r.millisecondStep,h=p===void 0?100:p,m=r.hideDisabledOptions,g=r.disabledTime,y=r.disabledHours,x=r.disabledMinutes,v=r.disabledSeconds,b=f.useMemo(function(){return n||e.getNow()},[n,e]),w=f.useCallback(function(V){var B=(g==null?void 0:g(V))||{};return[B.disabledHours||y||h7,B.disabledMinutes||x||h7,B.disabledSeconds||v||h7,B.disabledMilliseconds||h7]},[g,y,x,v]),S=f.useMemo(function(){return w(b)},[b,w]),C=p7(S,4),N=C[0],j=C[1],I=C[2],_=C[3],T=f.useCallback(function(V,B,G,H){var F=m7(0,23,s,m,V()),W=o?F.map(function(J){return Y3e(Y3e({},J),{},{label:uve(J.value%12||12,2)})}):F,U=function(te){return m7(0,59,c,m,B(te))},K=function(te,re){return m7(0,59,d,m,G(te,re))},X=function(te,re,ce){return m7(0,999,h,m,H(te,re,ce),3)};return[W,U,K,X]},[m,s,o,h,c,d]),P=f.useMemo(function(){return T(N,j,I,_)},[T,N,j,I,_]),E=p7(P,4),M=E[0],R=E[1],$=E[2],D=E[3],z=function(B,G){var H=function(){return M},F=R,W=$,U=D;if(G){var K=w(G),X=p7(K,4),J=X[0],te=X[1],re=X[2],ce=X[3],ae=T(J,te,re,ce),oe=p7(ae,4),ue=oe[0],fe=oe[1],se=oe[2],ge=oe[3];H=function(){return ue},F=fe,W=se,U=ge}var ye=Q9n(B,H,F,W,U,e);return ye};return[z,M,R,$,D]}function izn(e,t){return czn(e)||lzn(e,t)||szn(e,t)||azn()}function azn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function szn(e,t){if(e){if(typeof e=="string")return Q3e(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Q3e(e,t)}}function Q3e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:!1;Ye(Me),v==null||v(Me),et&&We(Me)},Oe=function(Me,et){fe(Me),et&&at(et),We(et,Me)},Ae=function(Me){if(Te(Me),at(Me),ue!==C){var et=["decade","year"],vt=[].concat(et,["month"]),Pt={quarter:[].concat(et,["quarter"]),week:[].concat(p$e(vt),["week"]),date:[].concat(p$e(vt),["date"])},Jt=Pt[C]||vt,dn=Jt.indexOf(ue),Et=Jt[dn+1];Et&&Oe(Et,Me)}},qe=f.useMemo(function(){var Pe,Me;if(Array.isArray(I)){var et=TM(I,2);Pe=et[0],Me=et[1]}else Pe=I;return!Pe&&!Me?null:(Pe=Pe||Me,Me=Me||Pe,i.isAfter(Pe,Me)?[Me,Pe]:[Pe,Me])},[I,i]),dt=dve(_,T,P),Ze=M[se]||iHn[se]||eY,Qe=f.useMemo(function(){var Pe,Me,et,vt;return{classNames:(Pe=(Me=z==null?void 0:z.popup)!==null&&Me!==void 0?Me:n)!==null&&Pe!==void 0?Pe:{},styles:(et=(vt=V==null?void 0:V.popup)!==null&&vt!==void 0?vt:r)!==null&&et!==void 0?et:{}}},[z,n,V,r]),lt=f.useContext(uC),bt=f.useMemo(function(){return f$e(f$e({},lt),{},{hideHeader:R})},[lt,R]),Ct="".concat(B,"-panel"),Je=QK(e,["showWeek","prevIcon","nextIcon","superPrevIcon","superNextIcon","disabledDate","minDate","maxDate","onHover"]);return f.createElement(yct.Provider,{value:Qe},f.createElement(uC.Provider,{value:bt},f.createElement("div",{ref:G,tabIndex:u,className:be(Ct,wct({},"".concat(Ct,"-rtl"),s==="rtl"))},f.createElement(Ze,aue({},Je,{showTime:re,prefixCls:B,locale:J,generateConfig:i,onModeChange:Oe,pickerValue:He,onPickerValueChange:function(Me){at(Me,!0)},value:xe[0],onSelect:Ae,values:xe,cellRender:dt,hoverRangeValue:qe,hoverValue:j})))))}var xte=f.memo(f.forwardRef(aHn));function M$(e){"@babel/helpers - typeof";return M$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M$(e)}function lue(){return lue=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jHn(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function tY(e){var t=e.icon,n=e.type,r=Ect(e,CHn),o=f.useContext(Ay),i=o.prefixCls,s=o.classNames,l=o.styles;return t?f.createElement("span",UU({className:be("".concat(i,"-").concat(n),s.suffix),style:l.suffix},r),t):null}function uue(e){var t=e.onClear,n=Ect(e,NHn);return f.createElement(tY,UU({},n,{type:"clear",role:"button",onMouseDown:function(o){o.preventDefault()},onClick:function(o){o.stopPropagation(),t()}}))}function $$(e){"@babel/helpers - typeof";return $$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$$(e)}function EHn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function IHn(e,t){for(var n=0;n=l&&n<=c)return i;var u=Math.min(Math.abs(n-l),Math.abs(n-c));ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zHn(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var fue=f.forwardRef(function(e,t){var n=e.className,r=e.active,o=e.showActiveCls,i=o===void 0?!0:o,s=e.suffixIcon,l=e.format,c=e.validateFormat,u=e.onChange;e.onInput;var d=e.helped,p=e.onHelp,h=e.onSubmit,m=e.onKeyDown,g=e.preserveInvalidOnBlur,y=g===void 0?!1:g,x=e.invalid,v=e.clearIcon,b=FHn(e,kHn),w=e.value,S=e.onFocus,C=e.onBlur,N=e.onMouseUp,j=f.useContext(Ay),I=j.prefixCls,_=j.input,T=_===void 0?"input":_,P=j.classNames,E=j.styles,M="".concat(I,"-input"),R=f.useState(!1),$=KN(R,2),D=$[0],z=$[1],V=f.useState(w),B=KN(V,2),G=B[0],H=B[1],F=f.useState(""),W=KN(F,2),U=W[0],K=W[1],X=f.useState(null),J=KN(X,2),te=J[0],re=J[1],ce=f.useState(null),ae=KN(ce,2),oe=ae[0],ue=ae[1],fe=G||"";f.useEffect(function(){H(w)},[w]);var se=f.useRef(null),ge=f.useRef(null);f.useImperativeHandle(t,function(){return{nativeElement:se.current,inputElement:ge.current,focus:function(bt){ge.current.focus(bt)},blur:function(){ge.current.blur()}}});var ye=f.useMemo(function(){return new AHn(l||"")},[l]),de=f.useMemo(function(){return d?[0,0]:ye.getSelection(te)},[ye,te,d]),Ne=KN(de,2),_e=Ne[0],xe=Ne[1],we=function(bt){bt&&bt!==l&&bt!==w&&p()},Te=Vr(function(lt){c(lt)&&u(lt),H(lt),we(lt)}),Re=function(bt){if(!l){var Ct=bt.target.value;we(Ct),H(Ct),u(Ct)}},Ue=function(bt){var Ct=bt.clipboardData.getData("text");c(Ct)&&Te(Ct)},He=f.useRef(!1),Ye=function(){He.current=!0},We=function(bt){var Ct=bt.target,Je=Ct.selectionStart,Pe=ye.getMaskCellIndex(Je);re(Pe),ue({}),N==null||N(bt),He.current=!1},at=function(bt){z(!0),re(0),K(""),S(bt)},Oe=function(bt){C(bt)},Ae=function(bt){z(!1),Oe(bt)};hve(r,function(){!r&&!y&&H(w)});var qe=function(bt){bt.key==="Enter"&&c(fe)&&h(),m==null||m(bt)},dt=function(bt){qe(bt);var Ct=bt.key,Je=null,Pe=null,Me=xe-_e,et=l.slice(_e,xe),vt=function(Et){re(function(sn){var ot=sn+Et;return ot=Math.max(ot,0),ot=Math.min(ot,ye.size()-1),ot})},Pt=function(Et){var sn=THn(et),ot=KN(sn,3),mt=ot[0],Ht=ot[1],jt=ot[2],Vt=fe.slice(_e,xe),nn=Number(Vt);if(isNaN(nn))return String(jt||(Et>0?mt:Ht));var zt=nn+Et,Nn=Ht-mt+1;return String(mt+(Nn+zt-mt)%Nn)};switch(Ct){case"Backspace":case"Delete":Je="",Pe=et;break;case"ArrowLeft":Je="",vt(-1);break;case"ArrowRight":Je="",vt(1);break;case"ArrowUp":Je="",Pe=Pt(1);break;case"ArrowDown":Je="",Pe=Pt(-1);break;default:isNaN(Number(Ct))||(Je=U+Ct,Pe=Je);break}if(Je!==null&&(K(Je),Je.length>=Me&&(vt(1),K(""))),Pe!==null){var Jt=fe.slice(0,_e)+uve(Pe,Me)+fe.slice(xe);Te(Jt.slice(0,l.length))}ue({})},Ze=f.useRef();Po(function(){if(!(!D||!l||He.current)){if(!ye.match(fe)){Te(l);return}return ge.current.setSelectionRange(_e,xe),Ze.current=Bo(function(){ge.current.setSelectionRange(_e,xe)}),function(){Bo.cancel(Ze.current)}}},[ye,l,D,fe,te,_e,xe,oe,Te]);var Qe=l?{onFocus:at,onBlur:Ae,onKeyDown:dt,onMouseDown:Ye,onMouseUp:We,onPaste:Ue}:{};return f.createElement("div",{ref:se,className:be(M,w$e(w$e({},"".concat(M,"-active"),r&&i),"".concat(M,"-placeholder"),d),n)},f.createElement(T,due({ref:ge,"aria-invalid":x,autoComplete:"off"},b,{onKeyDown:qe,onBlur:Oe},Qe,{value:fe,onChange:Re,className:P.input,style:E.input})),f.createElement(tY,{type:"suffix",icon:s}),v)}),BHn=["id","prefix","clearIcon","suffixIcon","separator","activeIndex","activeHelp","allHelp","focused","onFocus","onBlur","onKeyDown","locale","generateConfig","placeholder","className","style","onClick","onClear","value","onChange","onSubmit","onInputChange","format","maskFormat","preserveInvalidOnBlur","onInvalid","disabled","invalid","inputReadOnly","direction","onOpenChange","onActiveInfo","placement","onMouseDown","required","aria-required","autoFocus","tabIndex"],HHn=["index"];function AO(){return AO=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function YHn(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function XHn(e,t){var n=e.id,r=e.prefix,o=e.clearIcon,i=e.suffixIcon,s=e.separator,l=s===void 0?"~":s,c=e.activeIndex;e.activeHelp,e.allHelp;var u=e.focused;e.onFocus,e.onBlur,e.onKeyDown,e.locale,e.generateConfig;var d=e.placeholder,p=e.className,h=e.style,m=e.onClick,g=e.onClear,y=e.value;e.onChange,e.onSubmit,e.onInputChange,e.format,e.maskFormat,e.preserveInvalidOnBlur,e.onInvalid;var x=e.disabled,v=e.invalid;e.inputReadOnly;var b=e.direction;e.onOpenChange;var w=e.onActiveInfo;e.placement;var S=e.onMouseDown;e.required,e["aria-required"];var C=e.autoFocus,N=e.tabIndex,j=E$e(e,BHn),I=b==="rtl",_=f.useContext(Ay),T=_.prefixCls,P=_.classNames,E=_.styles,M=f.useMemo(function(){if(typeof n=="string")return[n];var ae=n||{};return[ae.start,ae.end]},[n]),R=f.useRef(),$=f.useRef(),D=f.useRef(),z=function(oe){var ue;return(ue=[$,D][oe])===null||ue===void 0?void 0:ue.current};f.useImperativeHandle(t,function(){return{nativeElement:R.current,focus:function(oe){if(AT(oe)==="object"){var ue,fe=oe||{},se=fe.index,ge=se===void 0?0:se,ye=E$e(fe,HHn);(ue=z(ge))===null||ue===void 0||ue.focus(ye)}else{var de;(de=z(oe??0))===null||de===void 0||de.focus()}},blur:function(){var oe,ue;(oe=z(0))===null||oe===void 0||oe.blur(),(ue=z(1))===null||ue===void 0||ue.blur()}}});var V=jct(j),B=f.useMemo(function(){return Array.isArray(d)?d:[d,d]},[d]),G=Nct(y7(y7({},e),{},{id:M,placeholder:B})),H=N$e(G,1),F=H[0],W=f.useState({position:"absolute",width:0}),U=N$e(W,2),K=U[0],X=U[1],J=Vr(function(){var ae=z(c);if(ae){var oe=ae.nativeElement.getBoundingClientRect(),ue=R.current.getBoundingClientRect(),fe=oe.left-ue.left;X(function(se){return y7(y7({},se),{},{width:oe.width,left:fe})}),w([oe.left,oe.right,ue.width])}});f.useEffect(function(){J()},[c]);var te=o&&(y[0]&&!x[0]||y[1]&&!x[1]),re=C&&!x[0],ce=C&&!re&&!x[1];return f.createElement(Uf,{onResize:J},f.createElement("div",AO({},V,{className:be(T,"".concat(T,"-range"),$R($R($R($R({},"".concat(T,"-focused"),u),"".concat(T,"-disabled"),x.every(function(ae){return ae})),"".concat(T,"-invalid"),v.some(function(ae){return ae})),"".concat(T,"-rtl"),I),p),style:h,ref:R,onClick:m,onMouseDown:function(oe){var ue=oe.target;ue!==$.current.inputElement&&ue!==D.current.inputElement&&oe.preventDefault(),S==null||S(oe)}}),r&&f.createElement("div",{className:be("".concat(T,"-prefix"),P.prefix),style:E.prefix},r),f.createElement(fue,AO({ref:$},F(0),{className:"".concat(T,"-input-start"),autoFocus:re,tabIndex:N,"date-range":"start"})),f.createElement("div",{className:"".concat(T,"-range-separator")},l),f.createElement(fue,AO({ref:D},F(1),{className:"".concat(T,"-input-end"),autoFocus:ce,tabIndex:N,"date-range":"end"})),f.createElement("div",{className:"".concat(T,"-active-bar"),style:K}),f.createElement(tY,{type:"suffix",icon:i}),te&&f.createElement(uue,{icon:o,onClear:g})))}var QHn=f.forwardRef(XHn);function L$(e){"@babel/helpers - typeof";return L$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},L$(e)}function I$e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function v7(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0&&se.current.focus({index:Vo})}Re(!0),fe==null||fe(kr)},Kn=function(){ur(null),Re(!1,{force:!0})},ar=f.useState(null),tr=Fg(ar,2),jn=tr[0],Le=tr[1],ke=f.useState(null),it=Fg(ke,2),Mt=it[0],_t=it[1],gt=f.useMemo(function(){return Mt||qe},[qe,Mt]);f.useEffect(function(){we||_t(null)},[we]);var hn=f.useState([0,0,0]),Vn=Fg(hn,2),Jn=Vn[0],Fr=Vn[1],po=function(kr,xo){g==="hover"&&(_t(kr),Le(xo))},nr=sct(te,re),or=function(kr){po(kr,"preset")},Or=function(kr){var xo=ur(kr);xo&&Re(!1,{force:!0})},Tn=function(kr){un(kr)},er=function(kr){po(kr?rn(kr,Ct):null,"cell")},Lo=function(kr){Re(!0),Pt(kr)},Fo=function(){bt("panel")},Ao=function(kr){var xo=PO(qe,Ct,kr);Oe(xo),!v&&!s&&i===jt&&un(kr)},uo=function(){Re(!1)},Wi=dve(ae,oe,ue,w7(Ct)),Jr=qe[Ct]||null,hs=Vr(function(ro){return u(ro,{activeIndex:Ct})}),zr=f.useMemo(function(){var ro=fl(o,!1),kr=za(o,[].concat(_$e(Object.keys(ro)),["onChange","onCalendarChange","style","className","onPanelChange","disabledTime","classNames","styles"]));return kr},[o]),mn=f.createElement(Cct,TO({},zr,{showNow:nn,showTime:dn,range:!0,multiplePanel:Vt,activeInfo:Jn,disabledDate:Zt,onFocus:Lo,onBlur:Jt,onPanelMouseDown:Fo,picker:M,mode:Ht,internalMode:jt,onPanelChange:Tt,format:c,value:Jr,isInvalid:hs,onChange:null,onSelect:Ao,pickerValue:nt,defaultOpenValue:h5(D==null?void 0:D.defaultOpenValue)[Ct],onPickerValueChange:xt,hoverValue:gt,onHover:er,needConfirm:v,onSubmit:un,onOk:Ae,presets:nr,onPresetHover:or,onPresetSubmit:Or,onNow:Tn,cellRender:Wi,classNames:de,styles:Ne})),st=function(kr,xo){var Bn=rn(kr,xo);Oe(Bn)},In=function(){bt("input")},Sr=function(kr,xo){var Bn=Me.length,Vo=Me[Bn-1];if(Bn&&Vo!==xo&&v&&!S[Vo]&&!vt(Vo)&&qe[Vo]){se.current.focus({index:Vo});return}bt("input"),Re(!0,{inherit:!0}),Ct!==xo&&we&&!v&&s&&un(null,!0),Je(xo),Pt(kr,xo)},ei=function(kr,xo){if(Re(!1),!v&&bt()==="input"){var Bn=Pe(qe);xr(Ct,Bn===null)}Jt(kr,xo)},No=function(kr,xo){kr.key==="Tab"&&un(null,!0),b==null||b(kr,xo)},Ha=f.useMemo(function(){return{prefixCls:d,locale:P,generateConfig:E,button:ce.button,input:ce.input,classNames:de,styles:Ne}},[d,P,E,ce.button,ce.input,de,Ne]);return Po(function(){we&&Ct!==void 0&&Tt(null,M,!1)},[we,Ct,M]),Po(function(){var ro=bt();!we&&ro==="input"&&(Re(!1),un(null,!0)),!we&&s&&!v&&ro==="panel"&&(Re(!0),un())},[we]),f.createElement(Ay.Provider,{value:Ha},f.createElement(Wlt,TO({},Klt(o),{popupElement:mn,popupStyle:Ne.popup.root,popupClassName:be(p,de.popup.root),visible:we,onClose:uo,range:!0}),f.createElement(QHn,TO({},o,{ref:se,className:be(o.className,p,de.root),style:b7(b7({},Ne.root),o.style),suffixIcon:K,activeIndex:Qe||we?Ct:null,activeHelp:!!Mt,allHelp:!!Mt&&jn==="preset",focused:Qe,onFocus:Sr,onBlur:ei,onKeyDown:No,onSubmit:un,value:gt,maskFormat:c,onChange:st,onInputChange:In,format:l,inputReadOnly:U,disabled:w,open:we,onOpenChange:Re,onClick:xn,onClear:Kn,invalid:Kt,onInvalid:gn,onActiveInfo:Fr}))))}var dVn=f.forwardRef(uVn);function fVn(e){var t=e.prefixCls,n=e.value,r=e.onRemove,o=e.removeIcon,i=o===void 0?"×":o,s=e.formatDate,l=e.disabled,c=e.maxTagCount,u=e.placeholder,d="".concat(t,"-selector"),p="".concat(t,"-selection"),h="".concat(p,"-overflow");function m(x,v){return f.createElement("span",{className:be("".concat(p,"-item")),title:typeof x=="string"?x:null},f.createElement("span",{className:"".concat(p,"-item-content")},x),!l&&v&&f.createElement("span",{onMouseDown:function(w){w.preventDefault()},onClick:v,className:"".concat(p,"-item-remove")},i))}function g(x){var v=s(x),b=function(S){S&&S.stopPropagation(),r(x)};return m(v,b)}function y(x){var v="+ ".concat(x.length," ...");return m(v)}return f.createElement("div",{className:d},f.createElement(Jv,{prefixCls:h,data:n,renderItem:g,renderRest:y,itemKey:function(v){return s(v)},maxCount:c}),!n.length&&f.createElement("span",{className:"".concat(t,"-selection-placeholder")},u))}function z$(e){"@babel/helpers - typeof";return z$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},z$(e)}var pVn=["id","open","prefix","clearIcon","suffixIcon","activeHelp","allHelp","focused","onFocus","onBlur","onKeyDown","locale","generateConfig","placeholder","className","style","onClick","onClear","internalPicker","value","onChange","onSubmit","onInputChange","multiple","maxTagCount","format","maskFormat","preserveInvalidOnBlur","onInvalid","disabled","invalid","inputReadOnly","direction","onOpenChange","onMouseDown","required","aria-required","autoFocus","tabIndex","removeIcon"];function WU(){return WU=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function SVn(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function CVn(e,t){e.id;var n=e.open,r=e.prefix,o=e.clearIcon,i=e.suffixIcon;e.activeHelp,e.allHelp;var s=e.focused;e.onFocus,e.onBlur,e.onKeyDown;var l=e.locale,c=e.generateConfig,u=e.placeholder,d=e.className,p=e.style,h=e.onClick,m=e.onClear,g=e.internalPicker,y=e.value,x=e.onChange,v=e.onSubmit;e.onInputChange;var b=e.multiple,w=e.maxTagCount;e.format,e.maskFormat,e.preserveInvalidOnBlur,e.onInvalid;var S=e.disabled,C=e.invalid;e.inputReadOnly;var N=e.direction;e.onOpenChange;var j=e.onMouseDown;e.required,e["aria-required"];var I=e.autoFocus,_=e.tabIndex,T=e.removeIcon,P=wVn(e,pVn),E=N==="rtl",M=f.useContext(Ay),R=M.prefixCls,$=M.classNames,D=M.styles,z=f.useRef(),V=f.useRef();f.useImperativeHandle(t,function(){return{nativeElement:z.current,focus:function(re){var ce;(ce=V.current)===null||ce===void 0||ce.focus(re)},blur:function(){var re;(re=V.current)===null||re===void 0||re.blur()}}});var B=jct(P),G=function(re){x([re])},H=function(re){var ce=y.filter(function(ae){return ae&&!Ip(c,l,ae,re,g)});x(ce),n||v()},F=Nct(k$e(k$e({},e),{},{onChange:G}),function(te){var re=te.valueTexts;return{value:re[0]||"",active:s}}),W=gVn(F,2),U=W[0],K=W[1],X=!!(o&&y.length&&!S),J=b?f.createElement(f.Fragment,null,f.createElement(fVn,{prefixCls:R,value:y,onRemove:H,formatDate:K,maxTagCount:w,disabled:S,removeIcon:T,placeholder:u}),f.createElement("input",{className:"".concat(R,"-multiple-input"),value:y.map(K).join(","),ref:V,readOnly:!0,autoFocus:I,tabIndex:_}),f.createElement(tY,{type:"suffix",icon:i}),X&&f.createElement(uue,{icon:o,onClear:m})):f.createElement(fue,WU({ref:V},U(),{autoFocus:I,tabIndex:_,suffixIcon:i,clearIcon:X&&f.createElement(uue,{icon:o,onClear:m}),showActiveCls:!1}));return f.createElement("div",WU({},B,{className:be(R,oP(oP(oP(oP(oP({},"".concat(R,"-multiple"),b),"".concat(R,"-focused"),s),"".concat(R,"-disabled"),S),"".concat(R,"-invalid"),C),"".concat(R,"-rtl"),E),d),style:p,ref:z,onClick:h,onMouseDown:function(re){var ce,ae=re.target;ae!==((ce=V.current)===null||ce===void 0?void 0:ce.inputElement)&&re.preventDefault(),j==null||j(re)}}),r&&f.createElement("div",{className:be("".concat(R,"-prefix"),$.prefix),style:D.prefix},r),J)}var NVn=f.forwardRef(CVn);function B$(e){"@babel/helpers - typeof";return B$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B$(e)}function kO(){return kO=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);ne??{...t,__INTERNAL__:{itemRef:o=>i=>{const s=mue(o);i?n.current[s]=i:delete n.current[s]}},scrollToField:(o,i={})=>{const{focus:s,...l}=i,c=$$e(o,r);c&&(nOn(c,{scrollMode:"if-needed",block:"nearest",...l}),s&&r.focusField(o))},focusField:o=>{var s,l;const i=r.getFieldInstance(o);typeof(i==null?void 0:i.focus)=="function"?i.focus():(l=(s=$$e(o,r))==null?void 0:s.focus)==null||l.call(s)},getFieldInstance:o=>{const i=mue(o);return n.current[i]}},[e,t]);return[r]}const Rct=f.createContext(void 0),LVn=Rct.Provider,Oct=f.createContext(void 0),FVn=Oct.Provider;function gue(){return gue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:n="rc-checkbox",className:r,style:o,checked:i,disabled:s,defaultChecked:l=!1,type:c="checkbox",title:u,onChange:d,...p}=e,h=f.useRef(null),m=f.useRef(null),[g,y]=Fa(l,i);f.useImperativeHandle(t,()=>({focus:b=>{var w;(w=h.current)==null||w.focus(b)},blur:()=>{var b;(b=h.current)==null||b.blur()},input:h.current,nativeElement:m.current}));const x=be(n,r,{[`${n}-checked`]:g,[`${n}-disabled`]:s}),v=b=>{s||("checked"in e||y(b.target.checked),d==null||d({target:{...e,type:c,checked:b.target.checked},stopPropagation(){b.stopPropagation()},preventDefault(){b.preventDefault()},nativeEvent:b.nativeEvent}))};return f.createElement("span",{className:x,title:u,style:o,ref:m},f.createElement("input",gue({},p,{className:`${n}-input`,ref:h,onChange:v,disabled:s,checked:!!g,type:c})),f.createElement("span",{className:`${n}-inner`}))});function Dct(e){const t=Ie.useRef(null),n=()=>{Bo.cancel(t.current),t.current=null};return[()=>{n(),t.current=Bo(()=>{t.current=null})},i=>{t.current&&(i.stopPropagation(),n()),e==null||e(i)}]}const zVn=e=>{const{componentCls:t,antCls:n}=e,r=`${t}-group`;return{[r]:{...Ii(e),display:"inline-block",fontSize:0,[`&${r}-rtl`]:{direction:"rtl"},[`&${r}-block`]:{display:"flex"},[`${n}-badge ${n}-badge-count`]:{zIndex:1},[`> ${n}-badge:not(:first-child) > ${n}-button-wrapper`]:{borderInlineStart:"none"},"&-vertical":{display:"flex",flexDirection:"column",rowGap:e.marginXS}}}},BVn=e=>{const{componentCls:t,wrapperMarginInlineEnd:n,colorPrimary:r,radioSize:o,motionDurationSlow:i,motionDurationMid:s,motionEaseInOutCirc:l,colorBgContainer:c,colorBorder:u,lineWidth:d,colorBgContainerDisabled:p,colorTextDisabled:h,paddingXS:m,dotColorDisabled:g,lineType:y,radioColor:x,radioBgColor:v,calc:b}=e,w=`${t}-inner`,C=b(o).sub(b(4).mul(2)),N=b(1).mul(o).equal({unit:!0});return{[`${t}-wrapper`]:{...Ii(e),display:"inline-flex",alignItems:"baseline",marginInlineStart:0,marginInlineEnd:n,cursor:"pointer","&:last-child":{marginInlineEnd:0},[`&${t}-wrapper-rtl`]:{direction:"rtl"},"&-disabled":{cursor:"not-allowed",color:e.colorTextDisabled},"&::after":{display:"inline-block",width:0,overflow:"hidden",content:'"\\a0"'},"&-block":{flex:1,justifyContent:"center"},[`${t}-checked::after`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:"100%",height:"100%",border:`${Xe(d)} ${y} ${r}`,borderRadius:"50%",visibility:"hidden",opacity:0,content:'""'},[t]:{...Ii(e),position:"relative",display:"inline-block",outline:"none",cursor:"pointer",alignSelf:"center",borderRadius:"50%"},[`${t}-wrapper:hover &, &:hover ${w}`]:{borderColor:r},[`${t}-input:focus-visible + ${w}`]:my(e),[`${t}:hover::after, ${t}-wrapper:hover &::after`]:{visibility:"visible"},[`${t}-inner`]:{"&::after":{boxSizing:"border-box",position:"absolute",insetBlockStart:"50%",insetInlineStart:"50%",display:"block",width:N,height:N,marginBlockStart:b(1).mul(o).div(-2).equal({unit:!0}),marginInlineStart:b(1).mul(o).div(-2).equal({unit:!0}),backgroundColor:x,borderBlockStart:0,borderInlineStart:0,borderRadius:N,transform:"scale(0)",opacity:0,transition:`all ${i} ${l}`,content:'""'},boxSizing:"border-box",position:"relative",insetBlockStart:0,insetInlineStart:0,display:"block",width:N,height:N,backgroundColor:c,borderColor:u,borderStyle:"solid",borderWidth:d,borderRadius:"50%",transition:`all ${s}`},[`${t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0},[`${t}-checked`]:{[w]:{borderColor:r,backgroundColor:v,"&::after":{transform:`scale(${e.calc(e.dotSize).div(o).equal()})`,opacity:1,transition:`all ${i} ${l}`}}},[`${t}-disabled`]:{cursor:"not-allowed",[w]:{backgroundColor:p,borderColor:u,cursor:"not-allowed","&::after":{backgroundColor:g}},[`${t}-input`]:{cursor:"not-allowed"},[`${t}-disabled + span`]:{color:h,cursor:"not-allowed"},[`&${t}-checked`]:{[w]:{"&::after":{transform:`scale(${b(C).div(o).equal()})`}}}},[`span${t} + *`]:{paddingInlineStart:m,paddingInlineEnd:m}}}},HVn=e=>{const{buttonColor:t,controlHeight:n,componentCls:r,lineWidth:o,lineType:i,colorBorder:s,motionDurationMid:l,buttonPaddingInline:c,fontSize:u,buttonBg:d,fontSizeLG:p,controlHeightLG:h,controlHeightSM:m,paddingXS:g,borderRadius:y,borderRadiusSM:x,borderRadiusLG:v,buttonCheckedBg:b,buttonSolidCheckedColor:w,colorTextDisabled:S,colorBgContainerDisabled:C,buttonCheckedBgDisabled:N,buttonCheckedColorDisabled:j,colorPrimary:I,colorPrimaryHover:_,colorPrimaryActive:T,buttonSolidCheckedBg:P,buttonSolidCheckedHoverBg:E,buttonSolidCheckedActiveBg:M,calc:R}=e;return{[`${r}-button-wrapper`]:{position:"relative",display:"inline-block",height:n,margin:0,paddingInline:c,paddingBlock:0,color:t,fontSize:u,lineHeight:Xe(R(n).sub(R(o).mul(2)).equal()),background:d,border:`${Xe(o)} ${i} ${s}`,borderBlockStartWidth:R(o).add(.02).equal(),borderInlineEndWidth:o,cursor:"pointer",transition:[`color ${l}`,`background-color ${l}`,`box-shadow ${l}`].join(","),a:{color:t},[`> ${r}-button`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:-1,width:"100%",height:"100%"},"&:not(:last-child)":{marginInlineEnd:R(o).mul(-1).equal()},"&:first-child":{borderInlineStart:`${Xe(o)} ${i} ${s}`,borderStartStartRadius:y,borderEndStartRadius:y},"&:last-child":{borderStartEndRadius:y,borderEndEndRadius:y},"&:first-child:last-child":{borderRadius:y},[`${r}-group-large &`]:{height:h,fontSize:p,lineHeight:Xe(R(h).sub(R(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:v,borderEndStartRadius:v},"&:last-child":{borderStartEndRadius:v,borderEndEndRadius:v}},[`${r}-group-small &`]:{height:m,paddingInline:R(g).sub(o).equal(),paddingBlock:0,lineHeight:Xe(R(m).sub(R(o).mul(2)).equal()),"&:first-child":{borderStartStartRadius:x,borderEndStartRadius:x},"&:last-child":{borderStartEndRadius:x,borderEndEndRadius:x}},"&:hover":{position:"relative",color:I},"&:has(:focus-visible)":my(e),[`${r}-inner, input[type='checkbox'], input[type='radio']`]:{width:0,height:0,opacity:0,pointerEvents:"none"},[`&-checked:not(${r}-button-wrapper-disabled)`]:{zIndex:1,color:I,background:b,borderColor:I,"&::before":{backgroundColor:I},"&:first-child":{borderColor:I},"&:hover":{color:_,borderColor:_,"&::before":{backgroundColor:_}},"&:active":{color:T,borderColor:T,"&::before":{backgroundColor:T}}},[`${r}-group-solid &-checked:not(${r}-button-wrapper-disabled)`]:{color:w,background:P,borderColor:P,"&:hover":{color:w,background:E,borderColor:E},"&:active":{color:w,background:M,borderColor:M}},"&-disabled":{color:S,backgroundColor:C,borderColor:s,cursor:"not-allowed","&:first-child, &:hover":{color:S,backgroundColor:C,borderColor:s}},[`&-disabled${r}-button-wrapper-checked`]:{color:j,backgroundColor:N,borderColor:s,boxShadow:"none"},"&-block":{flex:1,textAlign:"center"}}}},VVn=e=>{const{wireframe:t,padding:n,marginXS:r,lineWidth:o,fontSizeLG:i,colorText:s,colorBgContainer:l,colorTextDisabled:c,controlItemBgActiveDisabled:u,colorTextLightSolid:d,colorPrimary:p,colorPrimaryHover:h,colorPrimaryActive:m,colorWhite:g}=e,y=4,x=i,v=t?x-y*2:x-(y+o)*2;return{radioSize:x,dotSize:v,dotColorDisabled:c,buttonSolidCheckedColor:d,buttonSolidCheckedBg:p,buttonSolidCheckedHoverBg:h,buttonSolidCheckedActiveBg:m,buttonBg:l,buttonCheckedBg:l,buttonColor:s,buttonCheckedBgDisabled:u,buttonCheckedColorDisabled:c,buttonPaddingInline:n-o,wrapperMarginInlineEnd:r,radioColor:t?p:g,radioBgColor:t?l:p}},Lct=ui("Radio",e=>{const{controlOutline:t,controlOutlineWidth:n}=e,r=`0 0 0 ${Xe(n)} ${t}`,i=Ho(e,{radioFocusShadow:r,radioButtonFocusShadow:r});return[zVn(i),BVn(i),HVn(i)]},VVn,{unitless:{radioSize:!0,dotSize:!0}}),UVn=(e,t)=>{const n=f.useContext(Rct),r=f.useContext(Oct),{getPrefixCls:o,direction:i,className:s,style:l,classNames:c,styles:u}=Zo("radio"),d=f.useRef(null),p=zd(t,d),{isFormItemInput:h}=f.useContext(mf),m=H=>{var F,W;(F=e.onChange)==null||F.call(e,H),(W=n==null?void 0:n.onChange)==null||W.call(n,H)},{prefixCls:g,className:y,rootClassName:x,children:v,style:b,title:w,classNames:S,styles:C,...N}=e,j=o("radio",g),I=((n==null?void 0:n.optionType)||r)==="button",_=I?`${j}-button`:j,T=pl(j),[P,E]=Lct(j,T),M={...N},R=f.useContext(Mp);n&&(M.name=n.name,M.onChange=m,M.checked=e.value===n.value,M.disabled=M.disabled??n.disabled),M.disabled=M.disabled??R;const $={...e,...M},[D,z]=di([c,S],[u,C],{props:$}),V=be(`${_}-wrapper`,{[`${_}-wrapper-checked`]:M.checked,[`${_}-wrapper-disabled`]:M.disabled,[`${_}-wrapper-rtl`]:i==="rtl",[`${_}-wrapper-in-form-item`]:h,[`${_}-wrapper-block`]:!!(n!=null&&n.block)},s,y,x,D.root,P,E,T),[B,G]=Dct(M.onClick);return f.createElement(o6,{component:"Radio",disabled:M.disabled},f.createElement("label",{className:V,style:{...z.root,...l,...b},onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,title:w,onClick:B},f.createElement($ct,{...M,className:be(D.icon,{[r6]:!I}),style:z.icon,type:"radio",prefixCls:_,ref:p,onClick:G}),v!==void 0?f.createElement("span",{className:be(`${_}-label`,D.label),style:z.label},v):null))},GU=f.forwardRef(UVn),WVn=f.forwardRef((e,t)=>{const{getPrefixCls:n,direction:r}=f.useContext(Qr),{name:o}=f.useContext(mf),i=Jw(mue(o)),{prefixCls:s,className:l,rootClassName:c,options:u,buttonStyle:d="outline",disabled:p,children:h,size:m,style:g,id:y,optionType:x,name:v=i,defaultValue:b,value:w,block:S=!1,onChange:C,onMouseEnter:N,onMouseLeave:j,onFocus:I,onBlur:_,orientation:T,vertical:P,role:E="radiogroup"}=e,[M,R]=Fa(b,w),$=f.useCallback(X=>{const J=M,te=X.target.value;"value"in e||R(te),te!==J&&(C==null||C(X))},[M,R,C]),D=n("radio",s),z=`${D}-group`,V=pl(D),[B,G]=Lct(D,V);let H=h;u&&u.length>0&&(H=u.map(X=>typeof X=="string"||typeof X=="number"?f.createElement(GU,{key:X.toString(),prefixCls:D,disabled:p,value:X,checked:M===X},X):f.createElement(GU,{key:`radio-group-value-options-${X.value}`,prefixCls:D,disabled:X.disabled||p,value:X.value,checked:M===X.value,title:X.title,style:X.style,className:X.className,id:X.id,required:X.required},X.label)));const F=ad(m),[,W]=MK(T,P),U=be(z,`${z}-${d}`,{[`${z}-${F}`]:F,[`${z}-rtl`]:r==="rtl",[`${z}-block`]:S},l,c,B,G,V),K=f.useMemo(()=>({onChange:$,value:M,disabled:p,name:v,optionType:x,block:S}),[$,M,p,v,x,S]);return f.createElement("div",{...fl(e,{aria:!0,data:!0}),role:E,className:be(U,{[`${D}-group-vertical`]:W}),style:g,onMouseEnter:N,onMouseLeave:j,onFocus:I,onBlur:_,id:y,ref:t},f.createElement(LVn,{value:K},H))}),GVn=f.memo(WVn),qVn=(e,t)=>{const{getPrefixCls:n}=f.useContext(Qr),{prefixCls:r,...o}=e,i=n("radio",r);return f.createElement(FVn,{value:"button"},f.createElement(GU,{prefixCls:i,...o,type:"radio",ref:t}))},KVn=f.forwardRef(qVn),h6=GU;h6.Button=KVn;h6.Group=GVn;h6.__ANT_RADIO=!0;function Gk(e){return Ho(e,{inputAffixPadding:e.paddingXXS})}const qk=e=>{const{controlHeight:t,fontSize:n,lineHeight:r,lineWidth:o,controlHeightSM:i,controlHeightLG:s,fontSizeLG:l,lineHeightLG:c,paddingSM:u,controlPaddingHorizontalSM:d,controlPaddingHorizontal:p,colorFillAlter:h,colorPrimaryHover:m,colorPrimary:g,controlOutlineWidth:y,controlOutline:x,colorErrorOutline:v,colorWarningOutline:b,colorBgContainer:w,inputFontSize:S,inputFontSizeLG:C,inputFontSizeSM:N}=e,j=S||n,I=N||j,_=C||l,T=Math.round((t-j*r)/2*10)/10-o,P=Math.round((i-I*r)/2*10)/10-o,E=Math.ceil((s-_*c)/2*10)/10-o;return{paddingBlock:Math.max(T,0),paddingBlockSM:Math.max(P,0),paddingBlockLG:Math.max(E,0),paddingInline:u-o,paddingInlineSM:d-o,paddingInlineLG:p-o,addonBg:h,activeBorderColor:g,hoverBorderColor:m,activeShadow:`0 0 0 ${y}px ${x}`,errorActiveShadow:`0 0 0 ${y}px ${v}`,warningActiveShadow:`0 0 0 ${y}px ${b}`,hoverBg:w,activeBg:w,inputFontSize:j,inputFontSizeLG:_,inputFontSizeSM:I}},YVn=e=>({borderColor:e.hoverBorderColor,backgroundColor:e.hoverBg}),nY=e=>({color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,boxShadow:"none",cursor:"not-allowed",opacity:1,"input[disabled], textarea[disabled]":{cursor:"not-allowed"},"&:hover:not([disabled])":{...YVn(Ho(e,{hoverBorderColor:e.colorBorder,hoverBg:e.colorBgContainerDisabled}))}}),xve=(e,t)=>({background:e.colorBgContainer,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:t.borderColor,"&:hover":{borderColor:t.hoverBorderColor,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:t.activeBorderColor,boxShadow:t.activeShadow,outline:0,backgroundColor:e.activeBg}}),D$e=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:{...xve(e,t),[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}},[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:t.borderColor}}),Fct=(e,t)=>({"&-outlined":{...xve(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow}),[`&${e.componentCls}-disabled, &[disabled]`]:{...nY(e)},...D$e(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError}),...D$e(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning}),...t}}),L$e=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{borderColor:t.addonBorderColor,color:t.addonColor}}}),XVn=e=>({"&-outlined":{[`${e.componentCls}-group`]:{"&-addon":{background:e.addonBg,border:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:first-child":{borderInlineEnd:0},"&-addon:last-child":{borderInlineStart:0}},...L$e(e,{status:"error",addonBorderColor:e.colorError,addonColor:e.colorErrorText}),...L$e(e,{status:"warning",addonBorderColor:e.colorWarning,addonColor:e.colorWarningText}),[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group-addon`]:{...nY(e)}}}}),zct=(e,t)=>{const{componentCls:n}=e;return{"&-borderless":{background:"transparent",border:"none","&:focus, &:focus-within":{outline:"none"},[`&${n}-disabled, &[disabled]`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${n}-status-error`]:{"&, & input, & textarea":{color:e.colorError}},[`&${n}-status-warning`]:{"&, & input, & textarea":{color:e.colorWarning}},...t}}},Bct=(e,t)=>({background:t.bg,borderWidth:e.lineWidth,borderStyle:e.lineType,borderColor:"transparent","input&, & input, textarea&, & textarea":{color:(t==null?void 0:t.inputColor)??"unset"},"&:hover":{background:t.hoverBg},"&:focus, &:focus-within":{outline:0,borderColor:t.activeBorderColor,backgroundColor:e.activeBg}}),F$e=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:{...Bct(e,t),[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}}}),Hct=(e,t)=>({"&-filled":{...Bct(e,{bg:e.colorFillTertiary,hoverBg:e.colorFillSecondary,activeBorderColor:e.activeBorderColor,inputColor:e.colorText}),[`&${e.componentCls}-disabled, &[disabled]`]:{...nY(e)},...F$e(e,{status:"error",bg:e.colorErrorBg,hoverBg:e.colorErrorBgHover,activeBorderColor:e.colorError,inputColor:e.colorErrorText,affixColor:e.colorError}),...F$e(e,{status:"warning",bg:e.colorWarningBg,hoverBg:e.colorWarningBgHover,activeBorderColor:e.colorWarning,inputColor:e.colorWarningText,affixColor:e.colorWarning}),...t}}),z$e=(e,t)=>({[`&${e.componentCls}-group-wrapper-status-${t.status}`]:{[`${e.componentCls}-group-addon`]:{background:t.addonBg,color:t.addonColor}}}),QVn=e=>({"&-filled":{[`${e.componentCls}-group-addon`]:{background:e.colorFillTertiary,"&:last-child":{position:"static"}},...z$e(e,{status:"error",addonBg:e.colorErrorBg,addonColor:e.colorErrorText}),...z$e(e,{status:"warning",addonBg:e.colorWarningBg,addonColor:e.colorWarningText}),[`&${e.componentCls}-group-wrapper-disabled`]:{[`${e.componentCls}-group`]:{"&-addon":{background:e.colorFillTertiary,color:e.colorTextDisabled},"&-addon:first-child":{borderInlineStart:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},"&-addon:last-child":{borderInlineEnd:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderTop:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderBottom:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`}}}}}),Vct=(e,t)=>({background:e.colorBgContainer,borderWidth:`${Xe(e.lineWidth)} 0`,borderStyle:`${e.lineType} none`,borderColor:`transparent transparent ${t.borderColor} transparent`,borderRadius:0,"&:hover":{borderColor:`transparent transparent ${t.hoverBorderColor} transparent`,backgroundColor:e.hoverBg},"&:focus, &:focus-within":{borderColor:`transparent transparent ${t.activeBorderColor} transparent`,outline:0,backgroundColor:e.activeBg}}),B$e=(e,t)=>({[`&${e.componentCls}-status-${t.status}:not(${e.componentCls}-disabled)`]:{...Vct(e,t),[`${e.componentCls}-prefix, ${e.componentCls}-suffix`]:{color:t.affixColor}},[`&${e.componentCls}-status-${t.status}${e.componentCls}-disabled`]:{borderColor:`transparent transparent ${t.borderColor} transparent`}}),Uct=(e,t)=>({"&-underlined":{...Vct(e,{borderColor:e.colorBorder,hoverBorderColor:e.hoverBorderColor,activeBorderColor:e.activeBorderColor,activeShadow:e.activeShadow}),[`&${e.componentCls}-disabled, &[disabled]`]:{color:e.colorTextDisabled,boxShadow:"none",cursor:"not-allowed","&:hover":{borderColor:`transparent transparent ${e.colorBorder} transparent`}},"input[disabled], textarea[disabled]":{cursor:"not-allowed"},...B$e(e,{status:"error",borderColor:e.colorError,hoverBorderColor:e.colorErrorBorderHover,activeBorderColor:e.colorError,activeShadow:e.errorActiveShadow,affixColor:e.colorError}),...B$e(e,{status:"warning",borderColor:e.colorWarning,hoverBorderColor:e.colorWarningBorderHover,activeBorderColor:e.colorWarning,activeShadow:e.warningActiveShadow,affixColor:e.colorWarning}),...t}}),Wct=e=>({"&::-moz-placeholder":{opacity:1},"&::placeholder":{color:e,userSelect:"none"},"&:placeholder-shown":{textOverflow:"ellipsis"}}),yve=e=>{const{paddingBlockLG:t,lineHeightLG:n,borderRadiusLG:r,paddingInlineLG:o}=e;return{padding:`${Xe(t)} ${Xe(o)}`,fontSize:e.inputFontSizeLG,lineHeight:n,borderRadius:r}},vve=e=>({padding:`${Xe(e.paddingBlockSM)} ${Xe(e.paddingInlineSM)}`,fontSize:e.inputFontSizeSM,borderRadius:e.borderRadiusSM}),bve=(e,t={})=>({position:"relative",display:"inline-block",width:"100%",minWidth:0,padding:`${Xe(e.paddingBlock)} ${Xe(e.paddingInline)}`,color:e.colorText,fontSize:e.inputFontSize,lineHeight:e.lineHeight,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid}`,...Wct(e.colorTextPlaceholder),"&-lg":{...yve(e),...t.largeStyle},"&-sm":{...vve(e),...t.smallStyle},"&-rtl, &-textarea-rtl":{direction:"rtl"}}),JVn=e=>{const{componentCls:t,antCls:n}=e;return{position:"relative",display:"table",width:"100%",borderCollapse:"separate",borderSpacing:0,"&[class*='col-']":{paddingInlineEnd:e.paddingXS,"&:last-child":{paddingInlineEnd:0}},[`&-lg ${t}, &-lg > ${t}-group-addon`]:{...yve(e)},[`&-sm ${t}, &-sm > ${t}-group-addon`]:{...vve(e)},[`&-lg ${n}-select-single`]:{height:e.controlHeightLG},[`&-sm ${n}-select-single`]:{height:e.controlHeightSM},[`> ${t}`]:{display:"table-cell","&:not(:first-child):not(:last-child)":{borderRadius:0}},[`${t}-group`]:{"&-addon, &-wrap":{display:"table-cell",width:1,whiteSpace:"nowrap",verticalAlign:"middle","&:not(:first-child):not(:last-child)":{borderRadius:0}},"&-wrap > *":{display:"block !important"},"&-addon":{position:"relative",padding:`0 ${Xe(e.paddingInline)}`,color:e.colorText,fontWeight:"normal",fontSize:e.inputFontSize,textAlign:"center",borderRadius:e.borderRadius,transition:`all ${e.motionDurationSlow}`,lineHeight:1,[`${n}-select`]:{margin:`${Xe(e.calc(e.paddingBlock).add(1).mul(-1).equal())} ${Xe(e.calc(e.paddingInline).mul(-1).equal())}`,[`&${n}-select-single:not(${n}-select-customize-input):not(${n}-pagination-size-changer)`]:{backgroundColor:"inherit",border:`${Xe(e.lineWidth)} ${e.lineType} transparent`,boxShadow:"none"}},[`${n}-cascader-picker`]:{margin:`-9px ${Xe(e.calc(e.paddingInline).mul(-1).equal())}`,backgroundColor:"transparent",[`${n}-cascader-input`]:{textAlign:"start",border:0,boxShadow:"none"}}}},[t]:{width:"100%",marginBottom:0,textAlign:"inherit","&:focus":{zIndex:1,borderInlineEndWidth:1},"&:hover":{zIndex:1,borderInlineEndWidth:1}},[`> ${t}:first-child, ${t}-group-addon:first-child`]:{borderStartEndRadius:0,borderEndEndRadius:0,[`${n}-select`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}-affix-wrapper`]:{[`&:not(:first-child) ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0},[`&:not(:last-child) ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`> ${t}:last-child, ${t}-group-addon:last-child`]:{borderStartStartRadius:0,borderEndStartRadius:0,[`${n}-select`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`${t}-affix-wrapper`]:{"&:not(:last-child)":{borderStartEndRadius:0,borderEndEndRadius:0},"&:not(:first-child)":{borderStartStartRadius:0,borderEndStartRadius:0}},[`&${t}-group-compact`]:{display:"block",...kC(),[`${t}-group-addon, ${t}-group-wrap, > ${t}`]:{"&:not(:first-child):not(:last-child)":{borderInlineEndWidth:e.lineWidth,"&:hover, &:focus":{zIndex:1}}},"& > *":{display:"inline-flex",float:"none",verticalAlign:"top",borderRadius:0},[` & > ${t}-affix-wrapper, & > ${t}-number-affix-wrapper, & > ${n}-picker-range `]:{display:"inline-flex"},"& > *:not(:last-child)":{marginInlineEnd:e.calc(e.lineWidth).mul(-1).equal(),borderInlineEndWidth:e.lineWidth},[t]:{float:"none"},[`& > ${n}-select, & > ${n}-select-auto-complete ${t}, & > ${n}-cascader-picker ${t}, & > ${t}-group-wrapper ${t}`]:{borderInlineEndWidth:e.lineWidth,borderRadius:0,"&:hover, &:focus":{zIndex:1}},[`& > ${n}-select-focused`]:{zIndex:1},[`& > ${n}-select > ${n}-select-arrow`]:{zIndex:1},[`& > *:first-child, & > ${n}-select:first-child, & > ${n}-select-auto-complete:first-child ${t}, & > ${n}-cascader-picker:first-child ${t}`]:{borderStartStartRadius:e.borderRadius,borderEndStartRadius:e.borderRadius},[`& > *:last-child, & > ${n}-select:last-child, & > ${n}-cascader-picker:last-child ${t}, & > ${n}-cascader-picker-focused:last-child ${t}`]:{borderInlineEndWidth:e.lineWidth,borderStartEndRadius:e.borderRadius,borderEndEndRadius:e.borderRadius},[`& > ${n}-select-auto-complete ${t}`]:{verticalAlign:"top"},[`${t}-group-wrapper + ${t}-group-wrapper`]:{marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),[`${t}-affix-wrapper`]:{}}}}},ZVn=e=>{const{componentCls:t,controlHeightSM:n,lineWidth:r,calc:o}=e,s=o(n).sub(o(r).mul(2)).sub(16).div(2).equal();return{[t]:{...Ii(e),...bve(e),...Fct(e),...Hct(e),...zct(e),...Uct(e),'&[type="color"]':{height:e.controlHeight,[`&${t}-lg`]:{height:e.controlHeightLG},[`&${t}-sm`]:{height:n,paddingTop:s,paddingBottom:s}},'&[type="search"]::-webkit-search-cancel-button, &[type="search"]::-webkit-search-decoration':{appearance:"none"}}}},eUn=e=>{const{componentCls:t}=e;return{[`${t}-clear-icon`]:{margin:0,padding:0,lineHeight:0,color:e.colorTextQuaternary,fontSize:e.fontSizeIcon,verticalAlign:-1,cursor:"pointer",transition:`color ${e.motionDurationSlow}`,border:"none",outline:"none",backgroundColor:"transparent","&:hover":{color:e.colorIcon},"&:active":{color:e.colorText},"&-hidden":{visibility:"hidden"},"&-has-suffix":{margin:`0 ${Xe(e.inputAffixPadding)}`}}}},tUn=e=>{const{componentCls:t,inputAffixPadding:n,colorTextDescription:r,motionDurationSlow:o,colorIcon:i,colorIconHover:s,iconCls:l}=e,c=`${t}-affix-wrapper`,u=`${t}-affix-wrapper-disabled`;return{[c]:{...bve(e),display:"inline-flex","&-focused, &:focus":{zIndex:1},[`> input${t}`]:{padding:0},[`> input${t}, > textarea${t}`]:{fontSize:"inherit",border:"none",borderRadius:0,outline:"none",background:"transparent",color:"inherit","&::-ms-reveal":{display:"none"},"&:focus":{boxShadow:"none !important"}},"&::before":{display:"inline-block",width:0,visibility:"hidden",content:'"\\a0"'},[t]:{"&-prefix, &-suffix":{display:"flex",flex:"none",alignItems:"center","> *:not(:last-child)":{marginInlineEnd:e.paddingXS}},"&-show-count-suffix":{color:r,direction:"ltr"},"&-show-count-has-suffix":{marginInlineEnd:e.paddingXXS},"&-prefix":{marginInlineEnd:n},"&-suffix":{marginInlineStart:n}},...eUn(e),[`${l}${t}-password-icon`]:{color:i,cursor:"pointer",transition:`all ${o}`,"&:hover":{color:s}}},[`${t}-underlined`]:{borderRadius:0},[u]:{[`${l}${t}-password-icon`]:{color:i,cursor:"not-allowed","&:hover":{color:i}}}}},nUn=e=>{const{componentCls:t,borderRadiusLG:n,borderRadiusSM:r}=e;return{[`${t}-group`]:{...Ii(e),...JVn(e),"&-rtl":{direction:"rtl"},"&-wrapper":{display:"inline-block",width:"100%",textAlign:"start",verticalAlign:"top","&-rtl":{direction:"rtl"},"&-lg":{[`${t}-group-addon`]:{borderRadius:n,fontSize:e.inputFontSizeLG}},"&-sm":{[`${t}-group-addon`]:{borderRadius:r}},...XVn(e),...QVn(e),[`&:not(${t}-compact-first-item):not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}, ${t}-group-addon`]:{borderRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-first-item`]:{[`${t}, ${t}-group-addon`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-last-item`]:{[`${t}, ${t}-group-addon`]:{borderStartStartRadius:0,borderEndStartRadius:0}},[`&:not(${t}-compact-last-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartEndRadius:0,borderEndEndRadius:0}},[`&:not(${t}-compact-first-item)${t}-compact-item`]:{[`${t}-affix-wrapper`]:{borderStartStartRadius:0,borderEndStartRadius:0}}}}}},rUn=e=>{const{componentCls:t}=e;return{[`${t}-out-of-range`]:{[`&, & input, & textarea, ${t}-show-count-suffix, ${t}-data-count`]:{color:e.colorError}}}},Gct=ui(["Input","Shared"],e=>{const t=Ho(e,Gk(e));return[ZVn(t),tUn(t)]},qk,{resetFont:!1}),qct=ui(["Input","Component"],e=>{const t=Ho(e,Gk(e));return[nUn(t),rUn(t),a6(t,{focus:!0,focusElCls:`${t.componentCls}-affix-wrapper-focused`})]},qk,{resetFont:!1}),oUn=e=>{const{multipleSelectItemHeight:t,paddingXXS:n,lineWidth:r,INTERNAL_FIXED_ITEM_MARGIN:o}=e,i=e.max(e.calc(n).sub(r).equal(),0),s=e.max(e.calc(i).sub(o).equal(),0);return{basePadding:i,containerPadding:s,itemHeight:Xe(t),itemLineHeight:Xe(e.calc(t).sub(e.calc(e.lineWidth).mul(2)).equal())}},iUn=e=>{const{componentCls:t,iconCls:n,borderRadiusSM:r,motionDurationSlow:o,paddingXS:i,multipleItemColorDisabled:s,multipleItemBorderColorDisabled:l,colorIcon:c,colorIconHover:u,INTERNAL_FIXED_ITEM_MARGIN:d}=e;return{[`${t}-selection-overflow`]:{position:"relative",display:"flex",flex:"auto",flexWrap:"wrap",maxWidth:"100%","&-item":{flex:"none",alignSelf:"center",maxWidth:"calc(100% - 4px)",display:"inline-flex"},[`${t}-selection-item`]:{display:"flex",alignSelf:"center",flex:"none",boxSizing:"border-box",maxWidth:"100%",marginBlock:d,borderRadius:r,cursor:"default",transition:`font-size ${o}, line-height ${o}, height ${o}`,marginInlineEnd:e.calc(d).mul(2).equal(),paddingInlineStart:i,paddingInlineEnd:e.calc(i).div(2).equal(),[`${t}-disabled&`]:{color:s,borderColor:l,cursor:"not-allowed"},"&-content":{display:"inline-block",marginInlineEnd:e.calc(i).div(2).equal(),overflow:"hidden",whiteSpace:"pre",textOverflow:"ellipsis"},"&-remove":{...QL(),display:"inline-flex",alignItems:"center",color:c,fontWeight:"bold",fontSize:10,lineHeight:"inherit",cursor:"pointer",[`> ${n}`]:{verticalAlign:"-0.2em"},"&:hover":{color:u}}}}}},vte=(e,t)=>{const{componentCls:n,controlHeight:r}=e,o=t?`${n}-${t}`:"",i=oUn(e);return[{[`${n}-multiple${o}`]:{paddingBlock:i.containerPadding,paddingInlineStart:i.basePadding,minHeight:r,[`${n}-selection-item`]:{height:i.itemHeight,lineHeight:Xe(i.itemLineHeight)}}}]},aUn=e=>{const{componentCls:t,calc:n,lineWidth:r}=e,o=Ho(e,{fontHeight:e.fontSize,selectHeight:e.controlHeightSM,multipleSelectItemHeight:e.multipleItemHeightSM,borderRadius:e.borderRadiusSM,borderRadiusSM:e.borderRadiusXS,controlHeight:e.controlHeightSM}),i=Ho(e,{fontHeight:n(e.multipleItemHeightLG).sub(n(r).mul(2).equal()).equal(),fontSize:e.fontSizeLG,selectHeight:e.controlHeightLG,multipleSelectItemHeight:e.multipleItemHeightLG,borderRadius:e.borderRadiusLG,borderRadiusSM:e.borderRadius,controlHeight:e.controlHeightLG});return[vte(o,"small"),vte(e),vte(i,"large"),{[`${t}${t}-multiple`]:{width:"100%",cursor:"text",[`${t}-selector`]:{flex:"auto",padding:0,position:"relative","&:after":{margin:0},[`${t}-selection-placeholder`]:{position:"absolute",top:"50%",insetInlineStart:e.inputPaddingHorizontalBase,insetInlineEnd:0,transform:"translateY(-50%)",transition:`all ${e.motionDurationSlow}`,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1,color:e.colorTextPlaceholder,pointerEvents:"none"}},...iUn(e),[`${t}-multiple-input`]:{width:0,height:0,border:0,visibility:"hidden",position:"absolute",zIndex:-1}}}]},sUn=e=>{const{pickerCellCls:t,pickerCellInnerCls:n,cellHeight:r,borderRadiusSM:o,motionDurationMid:i,cellHoverBg:s,lineWidth:l,lineType:c,colorPrimary:u,cellActiveWithRangeBg:d,colorTextLightSolid:p,colorTextDisabled:h,cellBgDisabled:m,colorFillSecondary:g}=e;return{"&::before":{position:"absolute",top:"50%",insetInlineStart:0,insetInlineEnd:0,zIndex:1,height:r,transform:"translateY(-50%)",content:'""',pointerEvents:"none"},[n]:{position:"relative",zIndex:2,display:"inline-block",minWidth:r,height:r,lineHeight:Xe(r),borderRadius:o,transition:`background-color ${i}`},[`&:hover:not(${t}-in-view):not(${t}-disabled), &:hover:not(${t}-selected):not(${t}-range-start):not(${t}-range-end):not(${t}-disabled)`]:{[n]:{background:s}},[`&-in-view${t}-today ${n}`]:{"&::before":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:1,border:`${Xe(l)} ${c} ${u}`,borderRadius:o,content:'""'}},[`&-in-view${t}-in-range, &-in-view${t}-range-start, &-in-view${t}-range-end`]:{position:"relative",[`&:not(${t}-disabled):before`]:{background:d}},[`&-in-view${t}-selected, &-in-view${t}-range-start, &-in-view${t}-range-end`]:{[`&:not(${t}-disabled) ${n}`]:{color:p,background:u},[`&${t}-disabled ${n}`]:{background:g}},[`&-in-view${t}-range-start:not(${t}-disabled):before`]:{insetInlineStart:"50%"},[`&-in-view${t}-range-end:not(${t}-disabled):before`]:{insetInlineEnd:"50%"},[`&-in-view${t}-range-start:not(${t}-range-end) ${n}`]:{borderStartStartRadius:o,borderEndStartRadius:o,borderStartEndRadius:0,borderEndEndRadius:0},[`&-in-view${t}-range-end:not(${t}-range-start) ${n}`]:{borderStartStartRadius:0,borderEndStartRadius:0,borderStartEndRadius:o,borderEndEndRadius:o},"&-disabled":{color:h,cursor:"not-allowed",[n]:{background:"transparent"},"&::before":{background:m}},[`&-disabled${t}-today ${n}::before`]:{borderColor:h}}},lUn=e=>{const{componentCls:t,pickerCellCls:n,pickerCellInnerCls:r,pickerYearMonthCellWidth:o,pickerControlIconSize:i,cellWidth:s,paddingSM:l,paddingXS:c,paddingXXS:u,colorBgContainer:d,lineWidth:p,lineType:h,borderRadiusLG:m,colorPrimary:g,colorTextHeading:y,colorSplit:x,pickerControlIconBorderWidth:v,colorIcon:b,textHeight:w,motionDurationMid:S,colorIconHover:C,fontWeightStrong:N,cellHeight:j,pickerCellPaddingVertical:I,colorTextDisabled:_,colorText:T,fontSize:P,motionDurationSlow:E,withoutTimeCellHeight:M,pickerQuarterPanelContentHeight:R,borderRadiusSM:$,colorTextLightSolid:D,cellHoverBg:z,timeColumnHeight:V,timeColumnWidth:B,timeCellHeight:G,controlItemBgActive:H,marginXXS:F,pickerDatePanelPaddingHorizontal:W,pickerControlIconMargin:U}=e,K=e.calc(s).mul(7).add(e.calc(W).mul(2)).equal();return{[t]:{"&-panel":{display:"inline-flex",flexDirection:"column",textAlign:"center",background:d,borderRadius:m,outline:"none","&-focused":{borderColor:g},"&-rtl":{[`${t}-prev-icon, ${t}-super-prev-icon`]:{transform:"rotate(45deg)"},[`${t}-next-icon, ${t}-super-next-icon`]:{transform:"rotate(-135deg)"},[`${t}-time-panel`]:{[`${t}-content`]:{direction:"ltr","> *":{direction:"rtl"}}}}},"&-decade-panel,\n &-year-panel,\n &-quarter-panel,\n &-month-panel,\n &-week-panel,\n &-date-panel,\n &-time-panel":{display:"flex",flexDirection:"column",width:K},"&-header":{display:"flex",padding:`0 ${Xe(c)}`,color:y,borderBottom:`${Xe(p)} ${h} ${x}`,"> *":{flex:"none"},button:{padding:0,color:b,lineHeight:Xe(w),background:"transparent",border:0,cursor:"pointer",transition:`color ${S}`,fontSize:"inherit",display:"inline-flex",alignItems:"center",justifyContent:"center","&:empty":{display:"none"}},"> button":{minWidth:"1.6em",fontSize:P,"&:hover":{color:C},"&:disabled":{opacity:.25,pointerEvents:"none"}},"&-view":{flex:"auto",fontWeight:N,lineHeight:Xe(w),"> button":{color:"inherit",fontWeight:"inherit",verticalAlign:"top","&:not(:first-child)":{marginInlineStart:c},"&:hover":{color:g}}}},"&-prev-icon,\n &-next-icon,\n &-super-prev-icon,\n &-super-next-icon":{position:"relative",width:i,height:i,"&::before":{position:"absolute",top:0,insetInlineStart:0,width:i,height:i,border:"0 solid currentcolor",borderBlockStartWidth:v,borderInlineStartWidth:v,content:'""'}},"&-super-prev-icon,\n &-super-next-icon":{"&::after":{position:"absolute",top:U,insetInlineStart:U,display:"inline-block",width:i,height:i,border:"0 solid currentcolor",borderBlockStartWidth:v,borderInlineStartWidth:v,content:'""'}},"&-prev-icon, &-super-prev-icon":{transform:"rotate(-45deg)"},"&-next-icon, &-super-next-icon":{transform:"rotate(135deg)"},"&-content":{width:"100%",tableLayout:"fixed",borderCollapse:"collapse","th, td":{position:"relative",minWidth:j,fontWeight:"normal"},th:{height:e.calc(j).add(e.calc(I).mul(2)).equal(),color:T,verticalAlign:"middle"}},"&-cell":{padding:`${Xe(I)} 0`,color:_,cursor:"pointer","&-in-view":{color:T},...sUn(e)},"&-decade-panel,\n &-year-panel,\n &-quarter-panel,\n &-month-panel":{[`${t}-content`]:{height:e.calc(M).mul(4).equal()},[r]:{padding:`0 ${Xe(c)}`}},"&-quarter-panel":{[`${t}-content`]:{height:R}},"&-decade-panel":{[r]:{padding:`0 ${Xe(e.calc(c).div(2).equal())}`},[`${t}-cell::before`]:{display:"none"}},"&-year-panel,\n &-quarter-panel,\n &-month-panel":{[`${t}-body`]:{padding:`0 ${Xe(c)}`},[r]:{width:o}},"&-date-panel":{[`${t}-body`]:{padding:`${Xe(c)} ${Xe(W)}`},[`${t}-content th`]:{boxSizing:"border-box",padding:0}},"&-week-panel-row":{td:{"&:before":{transition:`background-color ${S}`},"&:first-child:before":{borderStartStartRadius:$,borderEndStartRadius:$},"&:last-child:before":{borderStartEndRadius:$,borderEndEndRadius:$}},"&:hover td:before":{background:z},"&-range-start td, &-range-end td, &-selected td, &-hover td":{[`&${n}`]:{"&:before":{background:g},[`&${t}-cell-week`]:{color:new Hi(D).setA(.5).toHexString()},[r]:{color:D}}},"&-range-hover td:before":{background:H}},"&-week-panel, &-date-panel-show-week":{[`${t}-body`]:{padding:`${Xe(c)} ${Xe(l)}`},[`${t}-content th`]:{width:"auto"}},"&-datetime-panel":{display:"flex",[`${t}-time-panel`]:{borderInlineStart:`${Xe(p)} ${h} ${x}`},[`${t}-date-panel, ${t}-time-panel`]:{transition:`opacity ${E}`},"&-active":{[`${t}-date-panel, ${t}-time-panel`]:{opacity:.3,"&-active":{opacity:1}}}},"&-time-panel":{width:"auto",minWidth:"auto",[`${t}-content`]:{display:"flex",flex:"auto",height:V},"&-column":{flex:"1 0 auto",width:B,margin:`${Xe(u)} 0`,padding:0,overflowY:"hidden",textAlign:"start",listStyle:"none",transition:`background-color ${S}`,overflowX:"hidden","&::-webkit-scrollbar":{width:8,backgroundColor:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:e.colorTextTertiary,borderRadius:e.borderRadiusSM},"&":{scrollbarWidth:"thin",scrollbarColor:`${e.colorTextTertiary} transparent`},"&::after":{display:"block",height:`calc(100% - ${Xe(G)})`,content:'""'},"&:not(:first-child)":{borderInlineStart:`${Xe(p)} ${h} ${x}`},"&-active":{background:new Hi(H).setA(.2).toHexString()},"&:hover":{overflowY:"auto"},"> li":{margin:0,padding:0,[`&${t}-time-panel-cell`]:{marginInline:F,[`${t}-time-panel-cell-inner`]:{display:"block",width:e.calc(B).sub(e.calc(F).mul(2)).equal(),height:G,margin:0,paddingBlock:0,paddingInlineEnd:0,paddingInlineStart:e.calc(B).sub(G).div(2).equal(),color:T,lineHeight:Xe(G),borderRadius:$,cursor:"pointer",transition:`background-color ${S}`,"&:hover":{background:z}},"&-selected":{[`${t}-time-panel-cell-inner`]:{background:H}},"&-disabled":{[`${t}-time-panel-cell-inner`]:{color:_,background:"transparent",cursor:"not-allowed"}}}}}}}}},cUn=e=>{const{componentCls:t,textHeight:n,lineWidth:r,paddingSM:o,antCls:i,colorPrimary:s,cellActiveWithRangeBg:l,colorPrimaryBorder:c,lineType:u,colorSplit:d}=e;return{[`${t}-dropdown`]:{[`${t}-footer`]:{borderTop:`${Xe(r)} ${u} ${d}`,"&-extra":{padding:`0 ${Xe(o)}`,lineHeight:Xe(e.calc(n).sub(e.calc(r).mul(2)).equal()),textAlign:"start","&:not(:last-child)":{borderBottom:`${Xe(r)} ${u} ${d}`}}},[`${t}-panels + ${t}-footer ${t}-ranges`]:{justifyContent:"space-between"},[`${t}-ranges`]:{marginBlock:0,paddingInline:Xe(o),overflow:"hidden",textAlign:"start",listStyle:"none",display:"flex",justifyContent:"center",alignItems:"center","> li":{lineHeight:Xe(e.calc(n).sub(e.calc(r).mul(2)).equal()),display:"inline-block"},[`${t}-now-btn-disabled`]:{pointerEvents:"none",color:e.colorTextDisabled},[`${t}-preset > ${i}-tag-blue`]:{color:s,background:l,borderColor:c,cursor:"pointer"},[`${t}-ok`]:{paddingBlock:e.calc(r).mul(2).equal(),marginInlineStart:"auto"}}}}},uUn=e=>{const{componentCls:t,controlHeightLG:n,paddingXXS:r,padding:o}=e;return{pickerCellCls:`${t}-cell`,pickerCellInnerCls:`${t}-cell-inner`,pickerYearMonthCellWidth:e.calc(n).mul(1.5).equal(),pickerQuarterPanelContentHeight:e.calc(n).mul(1.4).equal(),pickerCellPaddingVertical:e.calc(r).add(e.calc(r).div(2)).equal(),pickerCellBorderGap:2,pickerControlIconSize:7,pickerControlIconMargin:4,pickerControlIconBorderWidth:1.5,pickerDatePanelPaddingHorizontal:e.calc(o).add(e.calc(r).div(2)).equal()}},dUn=e=>{const{colorBgContainerDisabled:t,controlHeight:n,controlHeightSM:r,controlHeightLG:o,paddingXXS:i,lineWidth:s}=e,l=i*2,c=s*2,u=Math.min(n-l,n-c),d=Math.min(r-l,r-c),p=Math.min(o-l,o-c);return{INTERNAL_FIXED_ITEM_MARGIN:Math.floor(i/2),cellHoverBg:e.controlItemBgHover,cellActiveWithRangeBg:e.controlItemBgActive,cellHoverWithRangeBg:new Hi(e.colorPrimary).lighten(35).toHexString(),cellRangeBorderColor:new Hi(e.colorPrimary).lighten(20).toHexString(),cellBgDisabled:t,timeColumnWidth:o*1.4,timeColumnHeight:224,timeCellHeight:28,cellWidth:r*1.5,cellHeight:r,textHeight:o,withoutTimeCellHeight:o*1.65,multipleItemBg:e.colorFillSecondary,multipleItemBorderColor:"transparent",multipleItemHeight:u,multipleItemHeightSM:d,multipleItemHeightLG:p,multipleSelectorBgDisabled:t,multipleItemColorDisabled:e.colorTextDisabled,multipleItemBorderColorDisabled:"transparent"}},fUn=e=>({...qk(e),...dUn(e),...WK(e),presetsWidth:120,presetsMaxWidth:200,zIndexPopup:e.zIndexPopupBase+50}),pUn=e=>{const{componentCls:t}=e;return{[t]:[{...Fct(e),...Uct(e),...Hct(e),...zct(e)},{"&-outlined":{[`&${t}-multiple ${t}-selection-item`]:{background:e.multipleItemBg,border:`${Xe(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}},"&-filled":{[`&${t}-multiple ${t}-selection-item`]:{background:e.colorBgContainer,border:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorSplit}`}},"&-borderless":{[`&${t}-multiple ${t}-selection-item`]:{background:e.multipleItemBg,border:`${Xe(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}},"&-underlined":{[`&${t}-multiple ${t}-selection-item`]:{background:e.multipleItemBg,border:`${Xe(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`}}}]}},bte=(e,t)=>({padding:`${Xe(e)} ${Xe(t)}`}),hUn=e=>{const{componentCls:t,colorError:n,colorWarning:r}=e;return{[`${t}:not(${t}-disabled):not([disabled])`]:{[`&${t}-status-error`]:{[`${t}-active-bar`]:{background:n}},[`&${t}-status-warning`]:{[`${t}-active-bar`]:{background:r}}}}},mUn=e=>{const{componentCls:t,antCls:n,paddingInline:r,lineWidth:o,lineType:i,colorBorder:s,borderRadius:l,motionDurationMid:c,colorTextDisabled:u,colorTextPlaceholder:d,colorTextQuaternary:p,fontSizeLG:h,inputFontSizeLG:m,fontSizeSM:g,inputFontSizeSM:y,controlHeightSM:x,paddingInlineSM:v,paddingXS:b,marginXS:w,colorIcon:S,lineWidthBold:C,colorPrimary:N,motionDurationSlow:j,zIndexPopup:I,paddingXXS:_,sizePopupArrow:T,colorBgElevated:P,borderRadiusLG:E,boxShadowSecondary:M,borderRadiusSM:R,colorSplit:$,cellHoverBg:D,presetsWidth:z,presetsMaxWidth:V,boxShadowPopoverArrow:B,fontHeight:G,lineHeightLG:H}=e;return[{[t]:{...Ii(e),...bte(e.paddingBlock,e.paddingInline),position:"relative",display:"inline-flex",alignItems:"center",lineHeight:1,borderRadius:l,transition:`border ${c}, box-shadow ${c}, background ${c}`,[`${t}-prefix`]:{flex:"0 0 auto",marginInlineEnd:e.inputAffixPadding},[`${t}-input`]:{position:"relative",display:"inline-flex",alignItems:"center",width:"100%","> input":{position:"relative",display:"inline-block",width:"100%",color:"inherit",fontSize:e.inputFontSize??e.fontSize,lineHeight:e.lineHeight,transition:`all ${c}`,...Wct(d),flex:"auto",minWidth:1,height:"auto",padding:0,background:"transparent",border:0,fontFamily:"inherit","&:focus":{boxShadow:"none",outline:0},"&[disabled]":{background:"transparent",color:u,cursor:"not-allowed"}},"&-placeholder":{"> input":{color:d}}},"&-large":{...bte(e.paddingBlockLG,e.paddingInlineLG),borderRadius:e.borderRadiusLG,[`${t}-input > input`]:{fontSize:m??h,lineHeight:H}},"&-small":{...bte(e.paddingBlockSM,e.paddingInlineSM),borderRadius:e.borderRadiusSM,[`${t}-input > input`]:{fontSize:y??g}},[`${t}-suffix`]:{display:"flex",flex:"none",alignSelf:"center",marginInlineStart:e.calc(b).div(2).equal(),color:p,lineHeight:1,pointerEvents:"none",transition:`opacity ${c}, color ${c}`,"> *":{verticalAlign:"top","&:not(:last-child)":{marginInlineEnd:w}}},[`${t}-clear`]:{position:"absolute",top:"50%",insetInlineEnd:0,color:p,lineHeight:1,transform:"translateY(-50%)",cursor:"pointer",opacity:0,transition:`opacity ${c}, color ${c}`,"> *":{verticalAlign:"top"},"&:hover":{color:S}},"&:hover":{[`${t}-clear`]:{opacity:1},[`${t}-suffix:not(:last-child)`]:{opacity:0}},[`${t}-separator`]:{position:"relative",display:"inline-block",width:"1em",height:h,color:p,fontSize:h,verticalAlign:"top",cursor:"default",[`${t}-focused &`]:{color:S},[`${t}-range-separator &`]:{[`${t}-disabled &`]:{cursor:"not-allowed"}}},"&-range":{position:"relative",display:"inline-flex",[`${t}-active-bar`]:{bottom:e.calc(o).mul(-1).equal(),height:C,background:N,opacity:0,transition:`all ${j} ease-out`,pointerEvents:"none"},[`&${t}-focused`]:{[`${t}-active-bar`]:{opacity:1}},[`${t}-range-separator`]:{alignItems:"center",padding:`0 ${Xe(b)}`,lineHeight:1}},"&-range, &-multiple":{[`${t}-clear`]:{insetInlineEnd:r},[`&${t}-small`]:{[`${t}-clear`]:{insetInlineEnd:v}}},"&-dropdown":{...Ii(e),...lUn(e),pointerEvents:"none",position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:I,[`&${t}-dropdown-hidden`]:{display:"none"},"&-rtl":{direction:"rtl"},[`&${t}-dropdown-placement-bottomLeft, &${t}-dropdown-placement-bottomRight`]:{[`${t}-range-arrow`]:{top:0,display:"block",transform:"translateY(-100%)"}},[`&${t}-dropdown-placement-topLeft, &${t}-dropdown-placement-topRight`]:{[`${t}-range-arrow`]:{bottom:0,display:"block",transform:"translateY(100%) rotate(180deg)"}},[`&${n}-slide-up-appear, &${n}-slide-up-enter`]:{[`${t}-range-arrow${t}-range-arrow`]:{transition:"none"}},[`&${n}-slide-up-enter${n}-slide-up-enter-active${t}-dropdown-placement-topLeft, &${n}-slide-up-enter${n}-slide-up-enter-active${t}-dropdown-placement-topRight, &${n}-slide-up-appear${n}-slide-up-appear-active${t}-dropdown-placement-topLeft, &${n}-slide-up-appear${n}-slide-up-appear-active${t}-dropdown-placement-topRight`]:{animationName:FK},[`&${n}-slide-up-enter${n}-slide-up-enter-active${t}-dropdown-placement-bottomLeft, &${n}-slide-up-enter${n}-slide-up-enter-active${t}-dropdown-placement-bottomRight, &${n}-slide-up-appear${n}-slide-up-appear-active${t}-dropdown-placement-bottomLeft, &${n}-slide-up-appear${n}-slide-up-appear-active${t}-dropdown-placement-bottomRight`]:{animationName:DK},[`&${n}-slide-up-leave ${t}-panel-container`]:{pointerEvents:"none"},[`&${n}-slide-up-leave${n}-slide-up-leave-active${t}-dropdown-placement-topLeft, &${n}-slide-up-leave${n}-slide-up-leave-active${t}-dropdown-placement-topRight`]:{animationName:zK},[`&${n}-slide-up-leave${n}-slide-up-leave-active${t}-dropdown-placement-bottomLeft, &${n}-slide-up-leave${n}-slide-up-leave-active${t}-dropdown-placement-bottomRight`]:{animationName:LK},[`${t}-panel > ${t}-time-panel`]:{paddingTop:_},[`${t}-range-wrapper`]:{display:"flex",position:"relative"},[`${t}-range-arrow`]:{position:"absolute",zIndex:1,display:"none",paddingInline:e.calc(r).mul(1.5).equal(),boxSizing:"content-box",transition:`all ${j} ease-out`,...mlt(e,P,B),"&:before":{insetInlineStart:e.calc(r).mul(1.5).equal()}},[`${t}-panel-container`]:{overflow:"hidden",verticalAlign:"top",background:P,borderRadius:E,boxShadow:M,transition:`margin ${j}`,display:"inline-block",pointerEvents:"auto",[`${t}-panel-layout`]:{display:"flex",flexWrap:"nowrap",alignItems:"stretch"},[`${t}-presets`]:{display:"flex",flexDirection:"column",minWidth:z,maxWidth:V,ul:{height:0,flex:"auto",listStyle:"none",overflow:"auto",margin:0,padding:b,borderInlineEnd:`${Xe(o)} ${i} ${$}`,li:{...wh,borderRadius:R,paddingInline:b,paddingBlock:e.calc(x).sub(G).div(2).equal(),cursor:"pointer",transition:`all ${j}`,"+ li":{marginTop:w},"&:hover":{background:D}}}},[`${t}-panels`]:{display:"inline-flex",flexWrap:"nowrap","&:last-child":{[`${t}-panel`]:{borderWidth:0}}},[`${t}-panel`]:{verticalAlign:"top",background:"transparent",borderRadius:0,borderWidth:0,[`${t}-content, table`]:{textAlign:"center"},"&-focused":{borderColor:s}}}},"&-dropdown-range":{padding:`${Xe(e.calc(T).mul(2).div(3).equal())} 0`,"&-hidden":{display:"none"}},"&-rtl":{direction:"rtl",[`${t}-separator`]:{transform:"scale(-1, 1)"},[`${t}-footer`]:{"&-extra":{direction:"rtl"}}}}},xb(e,"slide-up"),xb(e,"slide-down"),PT(e,"move-up"),PT(e,"move-down")]},Kct=ui("DatePicker",e=>{const t=Ho(Gk(e),uUn(e),{inputPaddingHorizontalBase:e.calc(e.paddingSM).sub(1).equal(),multipleSelectItemHeight:e.multipleItemHeight,selectHeight:e.controlHeight});return[cUn(t),mUn(t),pUn(t),hUn(t),aUn(t),a6(e,{focusElCls:`${e.componentCls}-focused`})]},fUn);var gUn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M192 474h672q8 0 8 8v60q0 8-8 8H160q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"};function xue(){return xue=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,xue({},e,{ref:t,icon:gUn})),yUn=f.forwardRef(xUn);var MM={exports:{}},H$e;function vUn(){if(H$e)return MM.exports;H$e=1,MM.exports=r,MM.exports.isMobile=r,MM.exports.default=r;const e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,t=/CrOS/,n=/android|ipad|playbook|silk/i;function r(o){o||(o={});let i=o.ua;if(!i&&typeof navigator<"u"&&(i=navigator.userAgent),i&&i.headers&&typeof i.headers["user-agent"]=="string"&&(i=i.headers["user-agent"]),typeof i!="string")return!1;let s=e.test(i)&&!t.test(i)||!!o.tablet&&n.test(i);return!s&&o.tablet&&o.featureDetect&&navigator&&navigator.maxTouchPoints>1&&i.indexOf("Macintosh")!==-1&&i.indexOf("Safari")!==-1&&(s=!0),s}return MM.exports}var bUn=vUn();const wUn=Ba(bUn);let wte;const SUn=(()=>(typeof wte>"u"&&(wte=wUn()),wte)),wve=f.createContext(null),CUn=e=>{const{activeTabOffset:t,horizontal:n,rtl:r,indicator:o={}}=e,{size:i,align:s="center"}=o,[l,c]=f.useState(),u=f.useRef(),d=Ie.useCallback(h=>typeof i=="function"?i(h):typeof i=="number"?i:h,[i]);function p(){Bo.cancel(u.current)}return f.useEffect(()=>{const h={};if(t)if(n){h.width=d(t.width);const m=r?"right":"left";s==="start"&&(h[m]=t[m]),s==="center"&&(h[m]=t[m]+t.width/2,h.transform=r?"translateX(50%)":"translateX(-50%)"),s==="end"&&(h[m]=t[m]+t.width,h.transform="translateX(-100%)")}else h.height=d(t.height),s==="start"&&(h.top=t.top),s==="center"&&(h.top=t.top+t.height/2,h.transform="translateY(-50%)"),s==="end"&&(h.top=t.top+t.height,h.transform="translateY(-100%)");return p(),u.current=Bo(()=>{l&&h&&Object.keys(h).every(g=>{const y=h[g],x=l[g];return typeof y=="number"&&typeof x=="number"?Math.round(y)===Math.round(x):y===x})||c(h)}),p},[JSON.stringify(t),n,r,s,d]),{style:l}},V$e={width:0,height:0,left:0,top:0};function NUn(e,t,n){return f.useMemo(()=>{var s,l;const r=new Map,o=t.get((s=e[0])==null?void 0:s.key)||V$e,i=o.left+o.width;for(let c=0;cr.key).join("_"),t,n])}function U$e(e,t){const n=f.useRef(e),[,r]=f.useState({});function o(i){const s=typeof i=="function"?i(n.current):i;s!==n.current&&t(s,n.current),n.current=s,r({})}return[n.current,o]}const jUn=.1,W$e=.01,NB=20,G$e=.995**NB;function EUn(e,t){const[n,r]=f.useState(),[o,i]=f.useState(0),[s,l]=f.useState(0),[c,u]=f.useState(),d=f.useRef();function p(v){const{screenX:b,screenY:w}=v.touches[0];r({x:b,y:w}),window.clearInterval(d.current)}function h(v){if(!n)return;const{screenX:b,screenY:w}=v.touches[0];r({x:b,y:w});const S=b-n.x,C=w-n.y;t(S,C);const N=Date.now();i(N),l(N-o),u({x:S,y:C})}function m(){if(n&&(r(null),u(null),c)){const v=c.x/s,b=c.y/s,w=Math.abs(v),S=Math.abs(b);if(Math.max(w,S){if(Math.abs(C)N?(S=b,g.current="x"):(S=w,g.current="y"),t(-S,-S)&&v.preventDefault()}const x=f.useRef(null);x.current={onTouchStart:p,onTouchMove:h,onTouchEnd:m,onWheel:y},f.useEffect(()=>{function v(C){x.current.onTouchStart(C)}function b(C){x.current.onTouchMove(C)}function w(C){x.current.onTouchEnd(C)}function S(C){x.current.onWheel(C)}return document.addEventListener("touchmove",b,{passive:!1}),document.addEventListener("touchend",w,{passive:!0}),e.current.addEventListener("touchstart",v,{passive:!0}),e.current.addEventListener("wheel",S,{passive:!1}),()=>{document.removeEventListener("touchmove",b),document.removeEventListener("touchend",w)}},[])}function Yct(e){const[t,n]=f.useState(0),r=f.useRef(0),o=f.useRef();return o.current=e,git(()=>{var i;(i=o.current)==null||i.call(o)},[t]),()=>{r.current===t&&(r.current+=1,n(r.current))}}function IUn(e){const t=f.useRef([]),[,n]=f.useState({}),r=f.useRef(typeof e=="function"?e():e),o=Yct(()=>{let s=r.current;t.current.forEach(l=>{s=l(s)}),t.current=[],r.current=s,n({})});function i(s){t.current.push(s),o()}return[r.current,i]}const q$e={width:0,height:0,left:0,top:0,right:0};function _Un(e,t,n,r,o,i,{tabs:s,tabPosition:l,rtl:c}){let u,d,p;return["top","bottom"].includes(l)?(u="width",d=c?"right":"left",p=Math.abs(n)):(u="height",d="top",p=-n),f.useMemo(()=>{if(!s.length)return[0,0];const h=s.length;let m=h;for(let y=0;yMath.floor(p+t)){m=y-1;break}}let g=0;for(let y=h-1;y>=0;y-=1)if((e.get(s[y].key)||q$e)[d]m?[0,-1]:[g,m]},[e,t,r,o,i,p,l,s.map(h=>h.key).join("_"),c])}function K$e(e){let t;return e instanceof Map?(t={},e.forEach((n,r)=>{t[r]=n})):t=e,JSON.stringify(t)}const PUn="TABS_DQ";function Xct(e){return String(e).replace(/"/g,PUn)}function Sve(e,t,n,r){return!(!n||r||e===!1||e===void 0&&(t===!1||t===null))}const Qct=f.forwardRef((e,t)=>{const{prefixCls:n,editable:r,locale:o,style:i}=e;return!r||r.showAdd===!1?null:f.createElement("button",{ref:t,type:"button",className:`${n}-nav-add`,style:i,"aria-label":(o==null?void 0:o.addAriaLabel)||"Add tab",onClick:s=>{r.onEdit("add",{event:s})}},r.addIcon||"+")}),Y$e=f.forwardRef((e,t)=>{const{position:n,prefixCls:r,extra:o}=e;if(!o)return null;let i,s={};return typeof o=="object"&&!f.isValidElement(o)?s=o:s.right=o,n==="right"&&(i=s.right),n==="left"&&(i=s.left),i?f.createElement("div",{className:`${r}-extra-content`,ref:t},i):null});function yue(){return yue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:n,id:r,tabs:o,locale:i,mobile:s,more:l={},style:c,className:u,editable:d,tabBarGutter:p,rtl:h,removeAriaLabel:m,onTabClick:g,getPopupContainer:y,popupClassName:x,popupStyle:v}=e,[b,w]=f.useState(!1),[S,C]=f.useState(null),{icon:N="More"}=l,j=`${r}-more-popup`,I=`${n}-dropdown`,_=S!==null?`${j}-${S}`:null,T=i==null?void 0:i.dropdownAriaLabel;function P(V,B){V.preventDefault(),V.stopPropagation(),d.onEdit("remove",{key:B,event:V})}const E=f.createElement(Hk,{onClick:({key:V,domEvent:B})=>{g(V,B),w(!1)},prefixCls:`${I}-menu`,id:j,tabIndex:-1,role:"listbox","aria-activedescendant":_,selectedKeys:[S],"aria-label":T!==void 0?T:"expanded dropdown"},o.map(V=>{const{closable:B,disabled:G,closeIcon:H,key:F,label:W}=V,U=Sve(B,H,d,G);return f.createElement(f6,{key:F,id:`${j}-${F}`,role:"option","aria-controls":r&&`${r}-panel-${F}`,disabled:G},f.createElement("span",null,W),U&&f.createElement("button",{type:"button","aria-label":m||"remove",tabIndex:0,className:`${I}-menu-item-remove`,onClick:K=>{K.stopPropagation(),P(K,F)}},H||d.removeIcon||"×"))}));function M(V){const B=o.filter(F=>!F.disabled);let G=B.findIndex(F=>F.key===S)||0;const H=B.length;for(let F=0;F{const V=document.getElementById(_);V!=null&&V.scrollIntoView&&V.scrollIntoView(!1)},[_,S]),f.useEffect(()=>{b||C(null)},[b]);const $={marginInlineStart:p};o.length||($.visibility="hidden",$.order=1);const D=be(x,{[`${I}-rtl`]:h}),z=s?null:f.createElement(Ilt,yue({prefixCls:I,overlay:E,visible:o.length?b:!1,onVisibleChange:w,overlayClassName:D,overlayStyle:v,mouseEnterDelay:.1,mouseLeaveDelay:.1,getPopupContainer:y},l),f.createElement("button",{type:"button",className:`${n}-nav-more`,style:$,"aria-haspopup":"listbox","aria-controls":j,id:`${r}-more`,"aria-expanded":b,onKeyDown:R},N));return f.createElement("div",{className:be(`${n}-nav-operations`,u),style:c,ref:t},z,f.createElement(Qct,{prefixCls:n,locale:i,editable:d}))}),TUn=f.memo(AUn,(e,t)=>t.tabMoving),kUn=e=>{const{prefixCls:t,id:n,active:r,focus:o,tab:{key:i,label:s,disabled:l,closeIcon:c,icon:u},closable:d,renderWrapper:p,removeAriaLabel:h,editable:m,onClick:g,onFocus:y,onBlur:x,onKeyDown:v,onMouseDown:b,onMouseUp:w,style:S,className:C,tabCount:N,currentPosition:j}=e,I=`${t}-tab`,_=Sve(d,c,m,l);function T($){l||g($)}function P($){$.preventDefault(),$.stopPropagation(),m.onEdit("remove",{key:i,event:$})}const E=f.useMemo(()=>u&&typeof s=="string"?f.createElement("span",null,s):s,[s,u]),M=f.useRef(null);f.useEffect(()=>{o&&M.current&&M.current.focus()},[o]);const R=f.createElement("div",{key:i,"data-node-key":Xct(i),className:be(I,C,{[`${I}-with-remove`]:_,[`${I}-active`]:r,[`${I}-disabled`]:l,[`${I}-focus`]:o}),style:S,onClick:T},f.createElement("div",{ref:M,role:"tab","aria-selected":r,id:n&&`${n}-tab-${i}`,className:`${I}-btn`,"aria-controls":n&&`${n}-panel-${i}`,"aria-disabled":l,tabIndex:l?null:r?0:-1,onClick:$=>{$.stopPropagation(),T($)},onKeyDown:v,onMouseDown:b,onMouseUp:w,onFocus:y,onBlur:x},o&&f.createElement("div",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},`Tab ${j} of ${N}`),u&&f.createElement("span",{className:`${I}-icon`},u),s&&E),_&&f.createElement("button",{type:"button","aria-label":h||"remove",tabIndex:r?0:-1,className:`${I}-remove`,onClick:$=>{$.stopPropagation(),P($)}},c||m.removeIcon||"×"));return p?p(R):R};function vue(){return vue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{offsetWidth:n,offsetHeight:r,offsetTop:o,offsetLeft:i}=e,{width:s,height:l,left:c,top:u}=e.getBoundingClientRect();return Math.abs(s-n)<1?[s,l,c-t.left,u-t.top]:[n,r,i,o]},C_=e=>{const{offsetWidth:t=0,offsetHeight:n=0}=e.current||{};if(e.current){const{width:r,height:o}=e.current.getBoundingClientRect();if(Math.abs(r-t)<1)return[r,o]}return[t,n]},S7=(e,t)=>e[t?0:1],X$e=f.forwardRef((e,t)=>{const{className:n,style:r,id:o,animated:i,activeKey:s,rtl:l,extra:c,editable:u,locale:d,tabPosition:p,tabBarGutter:h,children:m,onTabClick:g,onTabScroll:y,indicator:x,classNames:v,styles:b}=e,{prefixCls:w,tabs:S}=f.useContext(wve),C=f.useRef(null),N=f.useRef(null),j=f.useRef(null),I=f.useRef(null),_=f.useRef(null),T=f.useRef(null),P=f.useRef(null),E=p==="top"||p==="bottom",[M,R]=U$e(0,(mt,Ht)=>{E&&y&&y({direction:mt>Ht?"left":"right"})}),[$,D]=U$e(0,(mt,Ht)=>{!E&&y&&y({direction:mt>Ht?"top":"bottom"})}),[z,V]=f.useState([0,0]),[B,G]=f.useState([0,0]),[H,F]=f.useState([0,0]),[W,U]=f.useState([0,0]),[K,X]=IUn(new Map),J=NUn(S,K,B[0]),te=S7(z,E),re=S7(B,E),ce=S7(H,E),ae=S7(W,E),oe=Math.floor(te)ge?ge:mt}const de=f.useRef(null),[Ne,_e]=f.useState();function xe(){_e(Date.now())}function we(){de.current&&clearTimeout(de.current)}EUn(I,(mt,Ht)=>{function jt(Vt,nn){Vt(zt=>ye(zt+nn))}return oe?(E?jt(R,mt):jt(D,Ht),we(),xe(),!0):!1}),f.useEffect(()=>(we(),Ne&&(de.current=setTimeout(()=>{_e(0)},100)),we),[Ne]);const[Te,Re]=_Un(J,ue,E?M:$,re,ce,ae,{...e,tabs:S}),Ue=Vr((mt=s)=>{const Ht=J.get(mt)||{width:0,height:0,left:0,right:0,top:0};if(E){let jt=M;l?Ht.rightM+ue&&(jt=Ht.right+Ht.width-ue):Ht.left<-M?jt=-Ht.left:Ht.left+Ht.width>-M+ue&&(jt=-(Ht.left+Ht.width-ue)),D(0),R(ye(jt))}else{let jt=$;Ht.top<-$?jt=-Ht.top:Ht.top+Ht.height>-$+ue&&(jt=-(Ht.top+Ht.height-ue)),R(0),D(ye(jt))}}),[He,Ye]=f.useState(),[We,at]=f.useState(!1),Oe=S.filter(mt=>!mt.disabled).map(mt=>mt.key),Ae=mt=>{const Ht=Oe.indexOf(He||s),jt=Oe.length,Vt=(Ht+mt+jt)%jt,nn=Oe[Vt];Ye(nn)},qe=(mt,Ht)=>{const jt=Oe.indexOf(mt),Vt=S.find(zt=>zt.key===mt);Sve(Vt==null?void 0:Vt.closable,Vt==null?void 0:Vt.closeIcon,u,Vt==null?void 0:Vt.disabled)&&(Ht.preventDefault(),Ht.stopPropagation(),u.onEdit("remove",{key:mt,event:Ht}),jt===Oe.length-1?Ae(-1):Ae(1))},dt=(mt,Ht)=>{at(!0),Ht.button===1&&qe(mt,Ht)},Ze=mt=>{const{code:Ht}=mt,jt=l&&E,Vt=Oe[0],nn=Oe[Oe.length-1];switch(Ht){case"ArrowLeft":{E&&Ae(jt?1:-1);break}case"ArrowRight":{E&&Ae(jt?-1:1);break}case"ArrowUp":{mt.preventDefault(),E||Ae(-1);break}case"ArrowDown":{mt.preventDefault(),E||Ae(1);break}case"Home":{mt.preventDefault(),Ye(Vt);break}case"End":{mt.preventDefault(),Ye(nn);break}case"Enter":case"Space":{mt.preventDefault(),g(He??s,mt);break}case"Backspace":case"Delete":{qe(He,mt);break}}},Qe={};E?Qe.marginInlineStart=h:Qe.marginTop=h;const lt=S.map((mt,Ht)=>{const{key:jt}=mt;return f.createElement(kUn,{id:o,prefixCls:w,key:jt,tab:mt,className:v==null?void 0:v.item,style:Ht===0?b==null?void 0:b.item:{...Qe,...b==null?void 0:b.item},closable:mt.closable,editable:u,active:jt===s,focus:jt===He,renderWrapper:m,removeAriaLabel:d==null?void 0:d.removeAriaLabel,tabCount:Oe.length,currentPosition:Ht+1,onClick:Vt=>{g(jt,Vt)},onKeyDown:Ze,onFocus:()=>{We||Ye(jt),Ue(jt),xe(),I.current&&(l||(I.current.scrollLeft=0),I.current.scrollTop=0)},onBlur:()=>{Ye(void 0)},onMouseDown:Vt=>dt(jt,Vt),onMouseUp:()=>{at(!1)}})}),bt=()=>X(()=>{var jt;const mt=new Map,Ht=(jt=_.current)==null?void 0:jt.getBoundingClientRect();return S.forEach(({key:Vt})=>{var zt;const nn=(zt=_.current)==null?void 0:zt.querySelector(`[data-node-key="${Xct(Vt)}"]`);if(nn){const[Nn,xr,ur,Zt]=MUn(nn,Ht);mt.set(Vt,{width:Nn,height:xr,left:ur,top:Zt})}}),mt});f.useEffect(()=>{bt()},[S.map(mt=>mt.key).join("_")]);const Ct=Yct(()=>{const mt=C_(C),Ht=C_(N),jt=C_(j);V([mt[0]-Ht[0]-jt[0],mt[1]-Ht[1]-jt[1]]);const Vt=C_(P);F(Vt);const nn=C_(T);U(nn);const zt=C_(_);G([zt[0]-Vt[0],zt[1]-Vt[1]]),bt()}),Je=S.slice(0,Te),Pe=S.slice(Re+1),Me=[...Je,...Pe],et=J.get(s),{style:vt}=CUn({activeTabOffset:et,horizontal:E,indicator:x,rtl:l});f.useEffect(()=>{Ue()},[s,se,ge,K$e(et),K$e(J),E]),f.useEffect(()=>{Ct()},[l]);const Pt=!!Me.length,Jt=`${w}-nav-wrap`;let dn,Et,sn,ot;return E?l?(Et=M>0,dn=M!==ge):(dn=M<0,Et=M!==se):(sn=$<0,ot=$!==se),f.createElement(Uf,{onResize:Ct},f.createElement("div",{ref:Yw(t,C),role:"tablist","aria-orientation":E?"horizontal":"vertical",className:be(`${w}-nav`,n,v==null?void 0:v.header),style:{...b==null?void 0:b.header,...r},onKeyDown:()=>{xe()}},f.createElement(Y$e,{ref:N,position:"left",extra:c,prefixCls:w}),f.createElement(Uf,{onResize:Ct},f.createElement("div",{className:be(Jt,{[`${Jt}-ping-left`]:dn,[`${Jt}-ping-right`]:Et,[`${Jt}-ping-top`]:sn,[`${Jt}-ping-bottom`]:ot}),ref:I},f.createElement(Uf,{onResize:Ct},f.createElement("div",{ref:_,className:`${w}-nav-list`,style:{transform:`translate(${M}px, ${$}px)`,transition:Ne?"none":void 0}},lt,f.createElement(Qct,{ref:P,prefixCls:w,locale:d,editable:u,style:{...lt.length===0?void 0:Qe,visibility:Pt?"hidden":null}}),f.createElement("div",{className:be(`${w}-ink-bar`,v==null?void 0:v.indicator,{[`${w}-ink-bar-animated`]:i.inkBar}),style:{...vt,...b==null?void 0:b.indicator}}))))),f.createElement(TUn,vue({},e,{removeAriaLabel:d==null?void 0:d.removeAriaLabel,ref:T,prefixCls:w,tabs:Me,className:!Pt&&fe,popupStyle:b==null?void 0:b.popup,tabMoving:!!Ne})),f.createElement(Y$e,{ref:j,position:"right",extra:c,prefixCls:w})))}),RUn=({renderTabBar:e,...t})=>e?e(t,X$e):f.createElement(X$e,t),OUn=f.forwardRef((e,t)=>{const{prefixCls:n,className:r,style:o,id:i,active:s,tabKey:l,children:c}=e,u=f.Children.count(c)>0;return f.createElement("div",{id:i&&`${i}-panel-${l}`,role:"tabpanel",tabIndex:s&&u?0:-1,"aria-labelledby":i&&`${i}-tab-${l}`,"aria-hidden":!s,style:o,className:be(n,s&&`${n}-active`,r),ref:t},c)});function qU(){return qU=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{id:t,activeKey:n,animated:r,tabPosition:o,destroyOnHidden:i,contentStyle:s,contentClassName:l}=e,{prefixCls:c,tabs:u}=f.useContext(wve),d=r.tabPane,p=`${c}-tabpane`;return f.createElement("div",{className:be(`${c}-content-holder`)},f.createElement("div",{className:be(`${c}-content`,`${c}-content-${o}`,{[`${c}-content-animated`]:d})},u.map(h=>{const{key:m,forceRender:g,style:y,className:x,destroyOnHidden:v,...b}=h,w=m===n;return f.createElement(Kf,qU({key:m,visible:w,forceRender:g,removeOnLeave:!!(i??v),leavedClassName:`${p}-hidden`},r.tabPaneMotion),({style:S,className:C},N)=>f.createElement(OUn,qU({},b,{prefixCls:p,id:t,tabKey:m,animated:d,active:w,style:{...s,...y,...S},className:be(l,x,C),ref:N})))})))};function DUn(e={inkBar:!0,tabPane:!1}){let t;return e===!1?t={inkBar:!1,tabPane:!1}:e===!0?t={inkBar:!0,tabPane:!1}:t={inkBar:!0,...typeof e=="object"?e:{}},t.tabPaneMotion&&t.tabPane===void 0&&(t.tabPane=!0),!t.tabPaneMotion&&t.tabPane&&(t.tabPane=!1),t}function RO(){return RO=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var J;const{id:n,prefixCls:r="rc-tabs",className:o,items:i,direction:s,activeKey:l,defaultActiveKey:c,editable:u,animated:d,tabPosition:p="top",tabBarGutter:h,tabBarStyle:m,tabBarExtraContent:g,locale:y,more:x,destroyOnHidden:v,renderTabBar:b,onChange:w,onTabClick:S,onTabScroll:C,getPopupContainer:N,popupClassName:j,indicator:I,classNames:_,styles:T,...P}=e,E=f.useMemo(()=>(i||[]).filter(te=>te&&typeof te=="object"&&"key"in te),[i]),M=s==="rtl",R=DUn(d),[$,D]=f.useState(!1);f.useEffect(()=>{D(SUn())},[]);const[z,V]=Fa(c??((J=E[0])==null?void 0:J.key),l),[B,G]=f.useState(()=>E.findIndex(te=>te.key===z));f.useEffect(()=>{var re;let te=E.findIndex(ce=>ce.key===z);te===-1&&(te=Math.max(0,Math.min(B,E.length-1)),V((re=E[te])==null?void 0:re.key)),G(te)},[E.map(te=>te.key).join("_"),z,B]);const[H,F]=Fa(null,n);f.useEffect(()=>{n||(F(`rc-tabs-${Q$e}`),Q$e+=1)},[]);function W(te,re){S==null||S(te,re);const ce=te!==z;V(te),ce&&(w==null||w(te))}const U={id:H,activeKey:z,animated:R,tabPosition:p,rtl:M,mobile:$},K={...U,editable:u,locale:y,more:x,tabBarGutter:h,onTabClick:W,onTabScroll:C,extra:g,style:m,getPopupContainer:N,popupClassName:be(j,_==null?void 0:_.popup),indicator:I,styles:T,classNames:_},X=f.useMemo(()=>({tabs:E,prefixCls:r}),[E,r]);return f.createElement(wve.Provider,{value:X},f.createElement("div",RO({ref:t,id:n,className:be(r,`${r}-${p}`,{[`${r}-mobile`]:$,[`${r}-editable`]:u,[`${r}-rtl`]:M},o)},P),f.createElement(RUn,RO({},K,{renderTabBar:b})),f.createElement($Un,RO({destroyOnHidden:v},U,{contentStyle:T==null?void 0:T.content,contentClassName:_==null?void 0:_.content,animated:R}))))}),FUn={motionAppear:!1,motionEnter:!0,motionLeave:!0};function zUn(e,t={inkBar:!0,tabPane:!1}){let n;return t===!1?n={inkBar:!1,tabPane:!1}:t===!0?n={inkBar:!0,tabPane:!0}:n={inkBar:!0,...typeof t=="object"?t:{}},n.tabPane&&(n.tabPaneMotion={...FUn,motionName:gb(e,"switch")}),n}function BUn(e){return e.filter(t=>t)}function HUn(e,t){if(e)return e.map(r=>({...r,destroyOnHidden:r.destroyOnHidden??r.destroyInactiveTabPane}));const n=Bu(t).map(r=>{if(f.isValidElement(r)){const{key:o,props:i}=r,{tab:s,...l}=i||{};return{key:String(o),...l,label:s}}return null});return BUn(n)}const VUn=e=>{const{componentCls:t,motionDurationSlow:n}=e;return[{[t]:{[`${t}-switch`]:{"&-appear, &-enter":{transition:"none","&-start":{opacity:0},"&-active":{opacity:1,transition:`opacity ${n}`}},"&-leave":{position:"absolute",transition:"none",inset:0,"&-start":{opacity:1},"&-active":{opacity:0,transition:`opacity ${n}`}}}}},[xb(e,"slide-up"),xb(e,"slide-down")]]},UUn=e=>{const{componentCls:t,tabsCardPadding:n,cardBg:r,cardGutter:o,colorBorderSecondary:i,itemSelectedColor:s}=e;return{[`${t}-card`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{margin:0,padding:n,background:r,border:`${Xe(e.lineWidth)} ${e.lineType} ${i}`,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`},[`${t}-tab-active`]:{color:s,background:e.colorBgContainer},[`${t}-tab-focus:has(${t}-tab-btn:focus-visible)`]:my(e,-3),[`& ${t}-tab${t}-tab-focus ${t}-tab-btn:focus-visible`]:{outline:"none"},[`${t}-ink-bar`]:{visibility:"hidden"}},[`&${t}-top, &${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginLeft:{_skip_check_:!0,value:Xe(o)}}}},[`&${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`${Xe(e.borderRadiusLG)} ${Xe(e.borderRadiusLG)} 0 0`},[`${t}-tab-active`]:{borderBottomColor:e.colorBgContainer}}},[`&${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:`0 0 ${Xe(e.borderRadiusLG)} ${Xe(e.borderRadiusLG)}`},[`${t}-tab-active`]:{borderTopColor:e.colorBgContainer}}},[`&${t}-left, &${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginTop:Xe(o)}}},[`&${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Xe(e.borderRadiusLG)} 0 0 ${Xe(e.borderRadiusLG)}`}},[`${t}-tab-active`]:{borderRightColor:{_skip_check_:!0,value:e.colorBgContainer}}}},[`&${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Xe(e.borderRadiusLG)} ${Xe(e.borderRadiusLG)} 0`}},[`${t}-tab-active`]:{borderLeftColor:{_skip_check_:!0,value:e.colorBgContainer}}}}}}},WUn=e=>{const{componentCls:t,itemHoverColor:n,dropdownEdgeChildVerticalPadding:r}=e;return{[`${t}-dropdown`]:{...Ii(e),position:"absolute",top:-9999,left:{_skip_check_:!0,value:-9999},zIndex:e.zIndexPopup,display:"block","&-hidden":{display:"none"},[`${t}-dropdown-menu`]:{maxHeight:e.tabsDropdownHeight,margin:0,padding:`${Xe(r)} 0`,overflowX:"hidden",overflowY:"auto",textAlign:{_skip_check_:!0,value:"left"},listStyleType:"none",backgroundColor:e.colorBgContainer,backgroundClip:"padding-box",borderRadius:e.borderRadiusLG,outline:"none",boxShadow:e.boxShadowSecondary,"&-item":{...wh,display:"flex",alignItems:"center",minWidth:e.tabsDropdownWidth,margin:0,padding:`${Xe(e.paddingXXS)} ${Xe(e.paddingSM)}`,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"> span":{flex:1,whiteSpace:"nowrap"},"&-remove":{flex:"none",marginLeft:{_skip_check_:!0,value:e.marginSM},color:e.colorIcon,fontSize:e.fontSizeSM,background:"transparent",border:0,cursor:"pointer","&:hover":{color:n}},"&:hover":{background:e.controlItemBgHover},"&-disabled":{"&, &:hover":{color:e.colorTextDisabled,background:"transparent",cursor:"not-allowed"}}}}}}},GUn=e=>{const{componentCls:t,margin:n,colorBorderSecondary:r,horizontalMargin:o,verticalItemPadding:i,verticalItemMargin:s,calc:l}=e;return{[`${t}-top, ${t}-bottom`]:{flexDirection:"column",[`> ${t}-nav, > div > ${t}-nav`]:{margin:o,"&::before":{position:"absolute",right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},borderBottom:`${Xe(e.lineWidth)} ${e.lineType} ${r}`,content:"''"},[`${t}-ink-bar`]:{height:e.lineWidthBold,"&-animated":{transition:`width ${e.motionDurationSlow}, left ${e.motionDurationSlow}, right ${e.motionDurationSlow}`}},[`${t}-nav-wrap`]:{"&::before, &::after":{top:0,bottom:0,width:e.controlHeight},"&::before":{left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowLeft},"&::after":{right:{_skip_check_:!0,value:0},boxShadow:e.boxShadowTabsOverflowRight},[`&${t}-nav-wrap-ping-left::before`]:{opacity:1},[`&${t}-nav-wrap-ping-right::after`]:{opacity:1}}}},[`${t}-top`]:{[`> ${t}-nav, > div > ${t}-nav`]:{"&::before":{bottom:0},[`${t}-ink-bar`]:{bottom:0}}},[`${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,marginTop:n,marginBottom:0,"&::before":{top:0},[`${t}-ink-bar`]:{top:0}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0}},[`${t}-left, ${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{flexDirection:"column",minWidth:l(e.controlHeight).mul(1.25).equal(),[`${t}-tab`]:{padding:i,textAlign:"center"},[`${t}-tab + ${t}-tab`]:{margin:s},[`${t}-nav-wrap`]:{flexDirection:"column","&::before, &::after":{right:{_skip_check_:!0,value:0},left:{_skip_check_:!0,value:0},height:e.controlHeight},"&::before":{top:0,boxShadow:e.boxShadowTabsOverflowTop},"&::after":{bottom:0,boxShadow:e.boxShadowTabsOverflowBottom},[`&${t}-nav-wrap-ping-top::before`]:{opacity:1},[`&${t}-nav-wrap-ping-bottom::after`]:{opacity:1}},[`${t}-ink-bar`]:{width:e.lineWidthBold,"&-animated":{transition:`height ${e.motionDurationSlow}, top ${e.motionDurationSlow}`}},[`${t}-nav-list, ${t}-nav-operations`]:{flex:"1 0 auto",flexDirection:"column"}}},[`${t}-left`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-ink-bar`]:{right:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{marginLeft:{_skip_check_:!0,value:Xe(l(e.lineWidth).mul(-1).equal())},borderLeft:{_skip_check_:!0,value:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingLeft:{_skip_check_:!0,value:e.paddingLG}}}},[`${t}-right`]:{[`> ${t}-nav, > div > ${t}-nav`]:{order:1,[`${t}-ink-bar`]:{left:{_skip_check_:!0,value:0}}},[`> ${t}-content-holder, > div > ${t}-content-holder`]:{order:0,marginRight:{_skip_check_:!0,value:l(e.lineWidth).mul(-1).equal()},borderRight:{_skip_check_:!0,value:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},[`> ${t}-content > ${t}-tabpane`]:{paddingRight:{_skip_check_:!0,value:e.paddingLG}}}}}},qUn=e=>{const{componentCls:t,cardPaddingSM:n,cardPaddingLG:r,cardHeightSM:o,cardHeightLG:i,horizontalItemPaddingSM:s,horizontalItemPaddingLG:l}=e;return{[t]:{"&-small":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:s,fontSize:e.titleFontSizeSM}}},"&-large":{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:l,fontSize:e.titleFontSizeLG,lineHeight:e.lineHeightLG}}}},[`${t}-card`]:{[`&${t}-small`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:n},[`${t}-nav-add`]:{minWidth:o,minHeight:o}},[`&${t}-bottom`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`0 0 ${Xe(e.borderRadius)} ${Xe(e.borderRadius)}`}},[`&${t}-top`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:`${Xe(e.borderRadius)} ${Xe(e.borderRadius)} 0 0`}},[`&${t}-right`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`0 ${Xe(e.borderRadius)} ${Xe(e.borderRadius)} 0`}}},[`&${t}-left`]:{[`> ${t}-nav ${t}-tab`]:{borderRadius:{_skip_check_:!0,value:`${Xe(e.borderRadius)} 0 0 ${Xe(e.borderRadius)}`}}}},[`&${t}-large`]:{[`> ${t}-nav`]:{[`${t}-tab`]:{padding:r},[`${t}-nav-add`]:{minWidth:i,minHeight:i}}}}}},KUn=e=>{const{componentCls:t,itemActiveColor:n,itemHoverColor:r,iconCls:o,tabsHorizontalItemMargin:i,horizontalItemPadding:s,itemSelectedColor:l,itemColor:c}=e,u=`${t}-tab`;return{[u]:{position:"relative",WebkitTouchCallout:"none",WebkitTapHighlightColor:"transparent",display:"inline-flex",alignItems:"center",padding:s,fontSize:e.titleFontSize,background:"transparent",border:0,outline:"none",cursor:"pointer",color:c,"&-btn, &-remove":{"&:focus:not(:focus-visible), &:active":{color:n}},"&-btn":{outline:"none",transition:`all ${e.motionDurationSlow}`,[`${u}-icon:not(:last-child)`]:{marginInlineEnd:e.marginSM}},"&-remove":{flex:"none",lineHeight:1,marginRight:{_skip_check_:!0,value:e.calc(e.marginXXS).mul(-1).equal()},marginLeft:{_skip_check_:!0,value:e.marginXS},color:e.colorIcon,fontSize:e.fontSizeSM,background:"transparent",border:"none",outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}`,"&:hover":{color:e.colorTextHeading},...gy(e)},"&:hover":{color:r},[`&${u}-active ${u}-btn`]:{color:l},[`&${u}-focus ${u}-btn:focus-visible`]:my(e),[`&${u}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed"},[`&${u}-disabled ${u}-btn, &${u}-disabled ${t}-remove`]:{"&:focus, &:active":{color:e.colorTextDisabled}},[`& ${u}-remove ${o}`]:{margin:0,verticalAlign:"middle"},[`${o}:not(:last-child)`]:{marginRight:{_skip_check_:!0,value:e.marginSM}}},[`${u} + ${u}`]:{margin:{_skip_check_:!0,value:i}}}},YUn=e=>{const{componentCls:t,tabsHorizontalItemMarginRTL:n,iconCls:r,cardGutter:o,calc:i}=e;return{[`${t}-rtl`]:{direction:"rtl",[`${t}-nav`]:{[`${t}-tab`]:{margin:{_skip_check_:!0,value:n},[`${t}-tab:last-of-type`]:{marginLeft:{_skip_check_:!0,value:0}},[r]:{marginRight:{_skip_check_:!0,value:0},marginLeft:{_skip_check_:!0,value:Xe(e.marginSM)}},[`${t}-tab-remove`]:{marginRight:{_skip_check_:!0,value:Xe(e.marginXS)},marginLeft:{_skip_check_:!0,value:Xe(i(e.marginXXS).mul(-1).equal())},[r]:{margin:0}}}},[`&${t}-left`]:{[`> ${t}-nav`]:{order:1},[`> ${t}-content-holder`]:{order:0}},[`&${t}-right`]:{[`> ${t}-nav`]:{order:0},[`> ${t}-content-holder`]:{order:1}},[`&${t}-card${t}-top, &${t}-card${t}-bottom`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-tab + ${t}-tab`]:{marginRight:{_skip_check_:!0,value:o},marginLeft:{_skip_check_:!0,value:0}}}}},[`${t}-dropdown-rtl`]:{direction:"rtl"},[`${t}-menu-item`]:{[`${t}-dropdown-rtl`]:{textAlign:{_skip_check_:!0,value:"right"}}}}},XUn=e=>{const{componentCls:t,tabsCardPadding:n,cardHeight:r,cardGutter:o,itemHoverColor:i,itemActiveColor:s,colorBorderSecondary:l}=e;return{[t]:{...Ii(e),display:"flex",[`> ${t}-nav, > div > ${t}-nav`]:{position:"relative",display:"flex",flex:"none",alignItems:"center",[`${t}-nav-wrap`]:{position:"relative",display:"flex",flex:"auto",alignSelf:"stretch",overflow:"hidden",whiteSpace:"nowrap",transform:"translate(0)","&::before, &::after":{position:"absolute",zIndex:1,opacity:0,transition:`opacity ${e.motionDurationSlow}`,content:"''",pointerEvents:"none"}},[`${t}-nav-list`]:{position:"relative",display:"flex",transition:`opacity ${e.motionDurationSlow}`},[`${t}-nav-operations`]:{display:"flex",alignSelf:"stretch"},[`${t}-nav-operations-hidden`]:{position:"absolute",visibility:"hidden",pointerEvents:"none"},[`${t}-nav-more`]:{position:"relative",padding:n,background:"transparent",border:0,color:e.colorText,"&::after":{position:"absolute",right:{_skip_check_:!0,value:0},bottom:0,left:{_skip_check_:!0,value:0},height:e.calc(e.controlHeightLG).div(8).equal(),transform:"translateY(100%)",content:"''"}},[`${t}-nav-add`]:{minWidth:r,minHeight:r,marginLeft:{_skip_check_:!0,value:o},background:"transparent",border:`${Xe(e.lineWidth)} ${e.lineType} ${l}`,borderRadius:`${Xe(e.borderRadiusLG)} ${Xe(e.borderRadiusLG)} 0 0`,outline:"none",cursor:"pointer",color:e.colorText,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOut}`,"&:hover":{color:i},"&:active, &:focus:not(:focus-visible)":{color:s},...gy(e,-3)}},[`${t}-extra-content`]:{flex:"none"},[`${t}-ink-bar`]:{position:"absolute",background:e.inkBarColor,pointerEvents:"none"},...KUn(e),[`${t}-content`]:{position:"relative",width:"100%"},[`${t}-content-holder`]:{flex:"auto",minWidth:0,minHeight:0},[`${t}-tabpane`]:{...gy(e),"&-hidden":{display:"none"}}},[`${t}-centered`]:{[`> ${t}-nav, > div > ${t}-nav`]:{[`${t}-nav-wrap`]:{[`&:not([class*='${t}-nav-wrap-ping']) > ${t}-nav-list`]:{margin:"auto"}}}}}},QUn=e=>{const{cardHeight:t,cardHeightSM:n,cardHeightLG:r,controlHeight:o,controlHeightLG:i}=e,s=t||i,l=n||o,c=r||i+8;return{zIndexPopup:e.zIndexPopupBase+50,cardBg:e.colorFillAlter,cardHeight:s,cardHeightSM:l,cardHeightLG:c,cardPadding:`${(s-e.fontHeight)/2-e.lineWidth}px ${e.padding}px`,cardPaddingSM:`${(l-e.fontHeight)/2-e.lineWidth}px ${e.paddingXS}px`,cardPaddingLG:`${(c-e.fontHeightLG)/2-e.lineWidth}px ${e.padding}px`,titleFontSize:e.fontSize,titleFontSizeLG:e.fontSizeLG,titleFontSizeSM:e.fontSize,inkBarColor:e.colorPrimary,horizontalMargin:`0 0 ${e.margin}px 0`,horizontalItemGutter:32,horizontalItemMargin:"",horizontalItemMarginRTL:"",horizontalItemPadding:`${e.paddingSM}px 0`,horizontalItemPaddingSM:`${e.paddingXS}px 0`,horizontalItemPaddingLG:`${e.padding}px 0`,verticalItemPadding:`${e.paddingXS}px ${e.paddingLG}px`,verticalItemMargin:`${e.margin}px 0 0 0`,itemColor:e.colorText,itemSelectedColor:e.colorPrimary,itemHoverColor:e.colorPrimaryHover,itemActiveColor:e.colorPrimaryActive,cardGutter:e.marginXXS/2}},JUn=ui("Tabs",e=>{const t=Ho(e,{tabsCardPadding:e.cardPadding,dropdownEdgeChildVerticalPadding:e.paddingXXS,tabsDropdownHeight:200,tabsDropdownWidth:120,tabsHorizontalItemMargin:`0 0 0 ${Xe(e.horizontalItemGutter)}`,tabsHorizontalItemMarginRTL:`0 0 0 ${Xe(e.horizontalItemGutter)}`});return[qUn(t),YUn(t),GUn(t),WUn(t),UUn(t),XUn(t),VUn(t)]},QUn),ZUn=()=>null,eWn=f.forwardRef((e,t)=>{var se,ge,ye,de;const{type:n,className:r,rootClassName:o,size:i,onEdit:s,hideAdd:l,centered:c,addIcon:u,removeIcon:d,moreIcon:p,more:h,popupClassName:m,children:g,items:y,animated:x,style:v,indicatorSize:b,indicator:w,classNames:S,styles:C,destroyInactiveTabPane:N,destroyOnHidden:j,tabPlacement:I,tabPosition:_,...T}=e,{prefixCls:P}=T,{getPrefixCls:E,direction:M,getPopupContainer:R,className:$,style:D,classNames:z,styles:V}=Zo("tabs"),{tabs:B}=f.useContext(Qr),G=E("tabs",P),H=pl(G),[F,W]=JUn(G,H),U=f.useRef(null);f.useImperativeHandle(t,()=>({nativeElement:U.current}));let K;n==="editable-card"&&(K={onEdit:(Ne,{key:_e,event:xe})=>{s==null||s(Ne==="add"?xe:_e,Ne)},removeIcon:d??(B==null?void 0:B.removeIcon)??f.createElement(_y,null),addIcon:(u??(B==null?void 0:B.addIcon))||f.createElement(yUn,null),showAdd:l!==!0});const X=E(),J=ad(i),te=HUn(y,g),re=zUn(G,x),ce={align:(w==null?void 0:w.align)??((se=B==null?void 0:B.indicator)==null?void 0:se.align),size:(w==null?void 0:w.size)??b??((ge=B==null?void 0:B.indicator)==null?void 0:ge.size)??(B==null?void 0:B.indicatorSize)},ae=f.useMemo(()=>{const Ne=I??_??void 0,_e=M==="rtl";switch(Ne){case"start":return _e?"right":"left";case"end":return _e?"left":"right";default:return Ne}},[I,_,M]),oe={...e,size:J,tabPlacement:ae,items:te},[ue,fe]=di([z,S],[V,C],{props:oe},{popup:{_default:"root"}});return f.createElement(LUn,{ref:U,direction:M,getPopupContainer:R,...T,items:te,className:be({[`${G}-${J}`]:J,[`${G}-card`]:["card","editable-card"].includes(n),[`${G}-editable-card`]:n==="editable-card",[`${G}-centered`]:c},$,r,o,ue.root,F,W,H),classNames:{...ue,popup:be(m,F,W,H,(ye=ue.popup)==null?void 0:ye.root)},styles:fe,style:{...fe.root,...D,...v},editable:K,more:{icon:((de=B==null?void 0:B.more)==null?void 0:de.icon)??(B==null?void 0:B.moreIcon)??p??f.createElement(cve,null),transitionName:`${X}-slide-up`,...h},prefixCls:G,animated:re,indicator:ce,destroyOnHidden:j??N,tabPosition:ae})}),W2=eWn;W2.TabPane=ZUn;const Jct=({prefixCls:e,className:t,hoverable:n=!0,...r})=>{const{getPrefixCls:o}=f.useContext(Qr),i=o("card",e),s=be(`${i}-grid`,t,{[`${i}-grid-hoverable`]:n});return f.createElement("div",{...r,className:s})},tWn=e=>{const{antCls:t,componentCls:n,headerHeight:r,headerPadding:o,tabsMarginBottom:i}=e;return{display:"flex",justifyContent:"center",flexDirection:"column",minHeight:r,marginBottom:-1,padding:`0 ${Xe(o)}`,color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.headerFontSize,background:e.headerBg,borderBottom:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`,borderRadius:`${Xe(e.borderRadiusLG)} ${Xe(e.borderRadiusLG)} 0 0`,...kC(),"&-wrapper":{width:"100%",display:"flex",alignItems:"center"},"&-title":{display:"inline-block",flex:1,...wh,[` > ${n}-typography, > ${n}-typography-edit-content `]:{insetInlineStart:0,marginTop:0,marginBottom:0}},[`${t}-tabs-top`]:{clear:"both",marginBottom:i,color:e.colorText,fontWeight:"normal",fontSize:e.fontSize,"&-bar":{borderBottom:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorderSecondary}`}}}},nWn=e=>{const{cardPaddingBase:t,colorBorderSecondary:n,cardShadow:r,lineWidth:o}=e;return{width:"33.33%",padding:t,border:0,borderRadius:0,boxShadow:` ${Xe(o)} 0 0 0 ${n}, 0 ${Xe(o)} 0 0 ${n}, ${Xe(o)} ${Xe(o)} 0 0 ${n}, ${Xe(o)} 0 0 0 ${n} inset, 0 ${Xe(o)} 0 0 ${n} inset; `,transition:`all ${e.motionDurationMid}`,"&-hoverable:hover":{position:"relative",zIndex:1,boxShadow:r}}},rWn=e=>{const{componentCls:t,iconCls:n,actionsLiMargin:r,cardActionsIconSize:o,colorBorderSecondary:i,actionsBg:s}=e;return{margin:0,padding:0,listStyle:"none",background:s,borderTop:`${Xe(e.lineWidth)} ${e.lineType} ${i}`,display:"flex",borderRadius:`0 0 ${Xe(e.borderRadiusLG)} ${Xe(e.borderRadiusLG)}`,...kC(),"& > li":{margin:r,color:e.colorTextDescription,textAlign:"center","> span":{position:"relative",display:"block",minWidth:e.calc(e.cardActionsIconSize).mul(2).equal(),fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimary,transition:`color ${e.motionDurationMid}`},[`a:not(${t}-btn), > ${n}`]:{display:"inline-block",width:"100%",color:e.colorIcon,lineHeight:Xe(e.fontHeight),transition:`color ${e.motionDurationMid}`,"&:hover":{color:e.colorPrimary}},[`> ${n}`]:{fontSize:o,lineHeight:Xe(e.calc(o).mul(e.lineHeight).equal())}},"&:not(:last-child)":{borderInlineEnd:`${Xe(e.lineWidth)} ${e.lineType} ${i}`}}}},oWn=e=>({margin:`${Xe(e.calc(e.marginXXS).mul(-1).equal())} 0`,display:"flex",...kC(),"&-avatar":{paddingInlineEnd:e.padding},"&-section":{overflow:"hidden",flex:1,"> div:not(:last-child)":{marginBottom:e.marginXS}},"&-title":{color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,...wh},"&-description":{color:e.colorTextDescription}}),iWn=e=>{const{componentCls:t,colorFillAlter:n,headerPadding:r,bodyPadding:o}=e;return{[`${t}-head`]:{padding:`0 ${Xe(r)}`,background:n,"&-title":{fontSize:e.fontSize}},[`${t}-body`]:{padding:`${Xe(e.padding)} ${Xe(o)}`}}},aWn=e=>{const{componentCls:t}=e;return{overflow:"hidden",[`${t}-body`]:{userSelect:"none"}}},sWn=e=>{const{componentCls:t,cardShadow:n,cardHeadPadding:r,colorBorderSecondary:o,boxShadowTertiary:i,bodyPadding:s,extraColor:l}=e;return{[t]:{...Ii(e),position:"relative",background:e.colorBgContainer,borderRadius:e.borderRadiusLG,[`&:not(${t}-bordered)`]:{boxShadow:i},[`${t}-head`]:tWn(e),[`${t}-extra`]:{marginInlineStart:"auto",color:l,fontWeight:"normal",fontSize:e.fontSize},[`${t}-body`]:{padding:s,borderRadius:`0 0 ${Xe(e.borderRadiusLG)} ${Xe(e.borderRadiusLG)}`,"&:first-child":{borderStartStartRadius:Xe(e.borderRadiusLG),borderStartEndRadius:Xe(e.borderRadiusLG)},"&:not(:last-child)":{borderEndStartRadius:0,borderEndEndRadius:0}},[`${t}-grid`]:nWn(e),[`${t}-cover`]:{"> *":{display:"block",width:"100%",borderRadius:`${Xe(e.borderRadiusLG)} ${Xe(e.borderRadiusLG)} 0 0`}},[`${t}-actions`]:rWn(e),[`${t}-meta`]:oWn(e)},[`${t}-bordered`]:{border:`${Xe(e.lineWidth)} ${e.lineType} ${o}`,[`${t}-cover`]:{marginTop:-1,marginInlineStart:-1,marginInlineEnd:-1}},[`${t}-hoverable`]:{cursor:"pointer",transition:`box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,"&:hover":{borderColor:"transparent",boxShadow:n}},[`${t}-contain-grid`]:{borderRadius:`${Xe(e.borderRadiusLG)} ${Xe(e.borderRadiusLG)} 0 0 `,[`&:not(:has(> ${t}-head))`]:{borderRadius:0},[`${t}-body`]:{display:"flex",flexWrap:"wrap"},[`&:not(${t}-loading) ${t}-body`]:{marginBlockStart:e.calc(e.lineWidth).mul(-1).equal(),marginInlineStart:e.calc(e.lineWidth).mul(-1).equal(),padding:0}},[`${t}-contain-tabs`]:{[`> div${t}-head`]:{minHeight:0,[`${t}-head-title, ${t}-extra`]:{paddingTop:r}}},[`${t}-type-inner`]:iWn(e),[`${t}-loading`]:aWn(e),[`${t}-rtl`]:{direction:"rtl"}}},lWn=e=>{const{componentCls:t,bodyPaddingSM:n,headerPaddingSM:r,headerHeightSM:o,headerFontSizeSM:i}=e;return{[`${t}-small`]:{[`> ${t}-head`]:{minHeight:o,padding:`0 ${Xe(r)}`,fontSize:i,[`> ${t}-head-wrapper`]:{[`> ${t}-extra`]:{fontSize:e.fontSize}}},[`> ${t}-body`]:{padding:n}},[`${t}-small${t}-contain-tabs`]:{[`> ${t}-head`]:{[`${t}-head-title, ${t}-extra`]:{paddingTop:0,display:"flex",alignItems:"center"}}}}},cWn=e=>({headerBg:"transparent",headerFontSize:e.fontSizeLG,headerFontSizeSM:e.fontSize,headerHeight:e.fontSizeLG*e.lineHeightLG+e.padding*2,headerHeightSM:e.fontSize*e.lineHeight+e.paddingXS*2,actionsBg:e.colorBgContainer,actionsLiMargin:`${e.paddingSM}px 0`,tabsMarginBottom:-e.padding-e.lineWidth,extraColor:e.colorText,bodyPaddingSM:12,headerPaddingSM:12,bodyPadding:e.bodyPadding??e.paddingLG,headerPadding:e.headerPadding??e.paddingLG}),uWn=ui("Card",e=>{const t=Ho(e,{cardShadow:e.boxShadowCard,cardHeadPadding:e.padding,cardPaddingBase:e.paddingLG,cardActionsIconSize:e.fontSize});return[sWn(t),lWn(t)]},cWn),dWn=e=>{const{actionClasses:t,actions:n=[],actionStyle:r}=e;return f.createElement("ul",{className:t,style:r},n.map((o,i)=>{const s=`action-${i}`;return f.createElement("li",{style:{width:`${100/n.length}%`},key:s},f.createElement("span",null,o))}))},fWn=f.forwardRef((e,t)=>{const{prefixCls:n,className:r,rootClassName:o,style:i,extra:s,headStyle:l={},bodyStyle:c={},title:u,loading:d,bordered:p,variant:h,size:m,type:g,cover:y,actions:x,tabList:v,children:b,activeTabKey:w,defaultActiveTabKey:S,tabBarExtraContent:C,hoverable:N,tabProps:j={},classNames:I,styles:_,...T}=e,{getPrefixCls:P,direction:E,className:M,style:R,classNames:$,styles:D}=Zo("card"),[z]=zk("card",h,p),V=ad(m),B={...e,size:V,variant:z,loading:d},[G,H]=di([$,I],[D,_],{props:B}),F=Te=>{var Re;(Re=e.onTabChange)==null||Re.call(e,Te)},W=f.useMemo(()=>Bu(b).some(Re=>f.isValidElement(Re)&&Re.type===Jct),[b]),U=P("card",n),[K,X]=uWn(U),J=f.createElement(eS,{loading:!0,active:!0,paragraph:{rows:4},title:!1},b),te=w!==void 0,re={...j,[te?"activeKey":"defaultActiveKey"]:te?w:S,tabBarExtraContent:C};let ce;const ae=!V||V==="default"?"large":V,oe=v?f.createElement(W2,{size:ae,...re,className:`${U}-head-tabs`,onChange:F,items:v.map(({tab:Te,...Re})=>({label:Te,...Re}))}):null;if(u||s||oe){const Te=be(`${U}-head`,G.header),Re=be(`${U}-head-title`,G.title),Ue=be(`${U}-extra`,G.extra),He={...l,...H.header};ce=f.createElement("div",{className:Te,style:He},f.createElement("div",{className:`${U}-head-wrapper`},u&&f.createElement("div",{className:Re,style:H.title},u),s&&f.createElement("div",{className:Ue,style:H.extra},s)),oe)}const ue=be(`${U}-cover`,G.cover),fe=y?f.createElement("div",{className:ue,style:H.cover},y):null,se=be(`${U}-body`,G.body),ge={...c,...H.body},ye=f.createElement("div",{className:se,style:ge},d?J:b),de=be(`${U}-actions`,G.actions),Ne=x!=null&&x.length?f.createElement(dWn,{actionClasses:de,actionStyle:H.actions,actions:x}):null,_e=za(T,["onTabChange"]),xe=be(U,M,{[`${U}-loading`]:d,[`${U}-bordered`]:z!=="borderless",[`${U}-hoverable`]:N,[`${U}-contain-grid`]:W,[`${U}-contain-tabs`]:v==null?void 0:v.length,[`${U}-${V}`]:V,[`${U}-type-${g}`]:!!g,[`${U}-rtl`]:E==="rtl"},r,o,K,X,G.root),we={...H.root,...R,...i};return f.createElement("div",{ref:t,..._e,className:xe,style:we},ce,fe,ye,Ne)}),pWn=e=>{const{prefixCls:t,className:n,avatar:r,title:o,description:i,style:s,classNames:l,styles:c,...u}=e,{getPrefixCls:d,className:p,style:h,classNames:m,styles:g}=Zo("cardMeta"),x=`${d("card",t)}-meta`,[v,b]=di([m,l],[g,c],{props:e}),w=be(x,n,p,v.root),S={...h,...b.root,...s},C=be(`${x}-avatar`,v.avatar),N=be(`${x}-title`,v.title),j=be(`${x}-description`,v.description),I=be(`${x}-section`,v.section),_=r?f.createElement("div",{className:C,style:b.avatar},r):null,T=o?f.createElement("div",{className:N,style:b.title},o):null,P=i?f.createElement("div",{className:j,style:b.description},i):null,E=T||P?f.createElement("div",{className:I,style:b.section},T,P):null;return f.createElement("div",{...u,className:w,style:S},_,E)},a0=fWn;a0.Grid=Jct;a0.Meta=pWn;function tS(e,t){if(e==null)return{};var n,r,o=Zn(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;re?l?(h=Date.now(),i||(d=setTimeout(u?N:C,e))):C():i!==!0&&(d=setTimeout(u?N:C,u===void 0?e-S:e))}return y.cancel=g,y}function mWn(e,t,n){var r={},o=r.atBegin,i=o===void 0?!1:o;return hWn(e,t,{debounceMode:i!==!1})}function rm(e,t){return e[t]}function Zct(e,t){return`${e}-${t}`}function gWn(e){return e&&e.type&&e.type.isTreeNode}function m6(e,t){return e??t}function TT(e){const{title:t,_title:n,key:r,children:o}=e||{},i=t||"title";return{title:i,_title:n||[i],key:r||"key",children:o||"children"}}function eut(e){function t(n){return Bu(n).map(o=>{if(!gWn(o))return Al(!o,"Tree/TreeNode can only accept TreeNode as children."),null;const{key:i}=o,{children:s,...l}=o.props,c={key:i,...l},u=t(s);return u.length&&(c.children=u),c}).filter(o=>o)}return t(e)}function Ste(e,t,n){const{_title:r,key:o,children:i}=TT(n),s=new Set(t===!0?[]:t),l=[];function c(u,d=null){return u.map((p,h)=>{const m=Zct(d?d.pos:"0",h),g=m6(p[o],m);let y;for(let v=0;vh[i]:typeof i=="function"&&(d=h=>i(h)):d=(h,m)=>m6(h[l],m);function p(h,m,g,y){const x=h?h[u]:e,v=h?Zct(g.pos,m):"0",b=h?[...y,h]:[];if(h){const w=d(h,v),S={node:h,index:m,pos:v,key:w,parentPos:g.node?g.pos:null,level:g.level+1,nodes:b};t(S)}x&&x.forEach((w,S)=>{p(w,S,{node:h,pos:v,level:g?g.level+1:-1},b)})}p(null)}function Cve(e,{initWrapper:t,processEntity:n,onProcessFinished:r,externalGetKey:o,childrenPropName:i,fieldNames:s}={},l){const c=o||l,u={},d={};let p={posEntities:u,keyEntities:d};return t&&(p=t(p)||p),xWn(e,h=>{const{node:m,index:g,pos:y,key:x,parentPos:v,level:b,nodes:w}=h,S={node:m,nodes:w,index:g,key:x,pos:y,level:b},C=m6(x,y);u[y]=S,d[C]=S,S.parent=u[v],S.parent&&(S.parent.children=S.parent.children||[],S.parent.children.push(S)),n&&n(S,p)},{externalGetKey:c,childrenPropName:i,fieldNames:s}),r&&r(p),p}function OO(e,{expandedKeys:t,selectedKeys:n,loadedKeys:r,loadingKeys:o,checkedKeys:i,halfCheckedKeys:s,dragOverNodeKey:l,dropPosition:c,keyEntities:u}){const d=rm(u,e);return{eventKey:e,expanded:t.indexOf(e)!==-1,selected:n.indexOf(e)!==-1,loaded:r.indexOf(e)!==-1,loading:o.indexOf(e)!==-1,checked:i.indexOf(e)!==-1,halfChecked:s.indexOf(e)!==-1,pos:String(d?d.pos:""),dragOver:l===e&&c===0,dragOverGapTop:l===e&&c===-1,dragOverGapBottom:l===e&&c===1}}function Ju(e){const{data:t,expanded:n,selected:r,checked:o,loaded:i,loading:s,halfChecked:l,dragOver:c,dragOverGapTop:u,dragOverGapBottom:d,pos:p,active:h,eventKey:m}=e,g={...t,expanded:n,selected:r,checked:o,loaded:i,loading:s,halfChecked:l,dragOver:c,dragOverGapTop:u,dragOverGapBottom:d,pos:p,active:h,key:m};return"props"in g||Object.defineProperty(g,"props",{get(){return Al(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),g}function tut(e,t){const n=new Set;return e.forEach(r=>{t.has(r)||n.add(r)}),n}function yWn(e){const{disabled:t,disableCheckbox:n,checkable:r}=e||{};return!!(t||n)||r===!1}function vWn(e,t,n,r){const o=new Set(e),i=new Set;for(let l=0;l<=n;l+=1)(t.get(l)||new Set).forEach(u=>{const{key:d,node:p,children:h=[]}=u;o.has(d)&&!r(p)&&h.filter(m=>!r(m.node)).forEach(m=>{o.add(m.key)})});const s=new Set;for(let l=n;l>=0;l-=1)(t.get(l)||new Set).forEach(u=>{const{parent:d,node:p}=u;if(r(p)||!u.parent||s.has(u.parent.key))return;if(r(u.parent.node)){s.add(d.key);return}let h=!0,m=!1;(d.children||[]).filter(g=>!r(g.node)).forEach(({key:g})=>{const y=o.has(g);h&&!y&&(h=!1),!m&&(y||i.has(g))&&(m=!0)}),h&&o.add(d.key),m&&i.add(d.key),s.add(d.key)});return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(tut(i,o))}}function bWn(e,t,n,r,o){const i=new Set(e);let s=new Set(t);for(let c=0;c<=r;c+=1)(n.get(c)||new Set).forEach(d=>{const{key:p,node:h,children:m=[]}=d;!i.has(p)&&!s.has(p)&&!o(h)&&m.filter(g=>!o(g.node)).forEach(g=>{i.delete(g.key)})});s=new Set;const l=new Set;for(let c=r;c>=0;c-=1)(n.get(c)||new Set).forEach(d=>{const{parent:p,node:h}=d;if(o(h)||!d.parent||l.has(d.parent.key))return;if(o(d.parent.node)){l.add(p.key);return}let m=!0,g=!1;(p.children||[]).filter(y=>!o(y.node)).forEach(({key:y})=>{const x=i.has(y);m&&!x&&(m=!1),!g&&(x||s.has(y))&&(g=!0)}),m||i.delete(p.key),g&&s.add(p.key),l.add(p.key)});return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(tut(s,i))}}function gA(e,t,n,r){const o=[];let i;r?i=r:i=yWn;const s=new Set(e.filter(d=>{const p=!!rm(n,d);return p||o.push(d),p})),l=new Map;let c=0;Object.keys(n).forEach(d=>{const p=n[d],{level:h}=p;let m=l.get(h);m||(m=new Set,l.set(h,m)),m.add(p),c=Math.max(c,h)}),Al(!o.length,`Tree missing follow keys: ${o.slice(0,100).map(d=>`'${d}'`).join(", ")}`);let u;return t===!0?u=vWn(s,l,c,i):u=bWn(s,t.halfCheckedKeys,l,c,i),u}const wWn=e=>{const{checkboxCls:t}=e,n=`${t}-wrapper`;return[{[`${t}-group`]:{...Ii(e),display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}},[n]:{...Ii(e),display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${n}`]:{marginInlineStart:0},[`&${n}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}},[t]:{...Ii(e),position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",[`${t}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${t}-inner`]:my(e)},[`${t}-inner`]:{boxSizing:"border-box",display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"25%",display:"table",width:e.calc(e.checkboxSize).div(14).mul(5).equal(),height:e.calc(e.checkboxSize).div(14).mul(8).equal(),border:`${Xe(e.lineWidthBold)} solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}}},{[` ${n}:not(${n}-disabled), ${t}:not(${t}-disabled) `]:{[`&:hover ${t}-inner`]:{borderColor:e.colorPrimary}},[`${n}:not(${n}-disabled)`]:{[`&:hover ${t}-checked:not(${t}-disabled) ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${t}-checked:not(${t}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${t}-checked`]:{[`${t}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[` ${n}-checked:not(${n}-disabled), ${t}-checked:not(${t}-disabled) `]:{[`&:hover ${t}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[t]:{"&-indeterminate":{"&":{[`${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorBorder}`,"&:after":{top:"50%",insetInlineStart:"50%",width:e.calc(e.fontSizeLG).div(2).equal(),height:e.calc(e.fontSizeLG).div(2).equal(),backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}},[`&:hover ${t}-inner`]:{backgroundColor:`${e.colorBgContainer}`,borderColor:`${e.colorPrimary}`}}}}},{[`${n}-disabled`]:{cursor:"not-allowed"},[`${t}-disabled`]:{[`&, ${t}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${t}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},[`&${t}-indeterminate ${t}-inner::after`]:{background:e.colorTextDisabled}}}]};function nut(e,t){const n=Ho(t,{checkboxCls:`.${e}`,checkboxSize:t.controlInteractiveSize});return wWn(n)}const rut=ui("Checkbox",(e,{prefixCls:t})=>[nut(t,e)]),out=Ie.createContext(null),SWn=(e,t)=>{const{prefixCls:n,className:r,rootClassName:o,children:i,indeterminate:s=!1,style:l,onMouseEnter:c,onMouseLeave:u,skipGroup:d=!1,disabled:p,classNames:h,styles:m,...g}=e,{getPrefixCls:y,direction:x,className:v,style:b,classNames:w,styles:S}=Zo("checkbox"),C=f.useContext(out),{isFormItemInput:N}=f.useContext(mf),j=f.useContext(Mp),I=((C==null?void 0:C.disabled)||p)??j,_={...e,indeterminate:s,disabled:I},[T,P]=di([w,h],[S,m],{props:_}),E=f.useRef(g.value),M=f.useRef(null),R=zd(t,M);f.useEffect(()=>{C==null||C.registerValue(g.value)},[]),f.useEffect(()=>{if(!d)return g.value!==E.current&&(C==null||C.cancelValue(E.current),C==null||C.registerValue(g.value),E.current=g.value),()=>C==null?void 0:C.cancelValue(g.value)},[g.value]),f.useEffect(()=>{var U;(U=M.current)!=null&&U.input&&(M.current.input.indeterminate=s)},[s]);const $=y("checkbox",n),D=pl($),[z,V]=rut($,D),B={...g};C&&!d&&(B.onChange=(...U)=>{g.onChange&&g.onChange.apply(g,U),C.toggleOption&&C.toggleOption({label:i,value:g.value})},B.name=C.name,B.checked=C.value.includes(g.value));const G=be(`${$}-wrapper`,{[`${$}-rtl`]:x==="rtl",[`${$}-wrapper-checked`]:B.checked,[`${$}-wrapper-disabled`]:I,[`${$}-wrapper-in-form-item`]:N},v,r,T.root,o,V,D,z),H=be(T.icon,{[`${$}-indeterminate`]:s},r6,z),[F,W]=Dct(B.onClick);return f.createElement(o6,{component:"Checkbox",disabled:I},f.createElement("label",{className:G,style:{...P.root,...b,...l},onMouseEnter:c,onMouseLeave:u,onClick:F},f.createElement($ct,{...B,onClick:W,prefixCls:$,className:H,style:P.icon,disabled:I,ref:R}),ll(i)&&f.createElement("span",{className:be(`${$}-label`,T.label),style:P.label},i)))},iut=f.forwardRef(SWn),CWn=f.forwardRef((e,t)=>{const{defaultValue:n,children:r,options:o=[],prefixCls:i,className:s,rootClassName:l,style:c,onChange:u,role:d="group",...p}=e,{getPrefixCls:h,direction:m}=f.useContext(Qr),[g,y]=f.useState(p.value||n||[]),[x,v]=f.useState([]);f.useEffect(()=>{"value"in p&&y(p.value||[])},[p.value]);const b=f.useMemo(()=>o.map($=>typeof $=="string"||typeof $=="number"?{label:$,value:$}:$),[o]),w=$=>{v(D=>D.filter(z=>z!==$))},S=$=>{v(D=>[].concat(go(D),[$]))},C=$=>{const D=g.indexOf($.value),z=go(g);D===-1?z.push($.value):z.splice(D,1),"value"in p||y(z),u==null||u(z.filter(V=>x.includes(V)).sort((V,B)=>{const G=b.findIndex(F=>F.value===V),H=b.findIndex(F=>F.value===B);return G-H}))},N=h("checkbox",i),j=`${N}-group`,I=pl(N),[_,T]=rut(N,I),P=za(p,["value","disabled"]),E=o.length?b.map($=>f.createElement(iut,{prefixCls:N,key:$.value.toString(),disabled:"disabled"in $?$.disabled:p.disabled,value:$.value,checked:g.includes($.value),onChange:$.onChange,className:be(`${j}-item`,$.className),style:$.style,title:$.title,id:$.id,required:$.required},$.label)):r,M=f.useMemo(()=>({toggleOption:C,value:g,disabled:p.disabled,name:p.name,registerValue:S,cancelValue:w}),[C,g,p.disabled,p.name,S,w]),R=be(j,{[`${j}-rtl`]:m==="rtl"},s,l,T,I,_);return f.createElement("div",{className:R,style:c,role:d,...P,ref:t},f.createElement(out.Provider,{value:M},E))}),kT=iut;kT.Group=CWn;kT.__ANT_CHECKBOX=!0;const aut=f.createContext({}),NWn=e=>typeof e=="number"&&!Number.isNaN(e);function J$e(e){return e==="auto"?"1 1 auto":NWn(e)?`${e} ${e} auto`:/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?`0 0 ${e}`:e}const jWn=["xs","sm","md","lg","xl","xxl"],dc=f.forwardRef((e,t)=>{const{getPrefixCls:n,direction:r}=f.useContext(Qr),{gutter:o,wrap:i}=f.useContext(aut),{prefixCls:s,span:l,order:c,offset:u,push:d,pull:p,className:h,children:m,flex:g,style:y,...x}=e,v=n("col",s),b=n(),[w,S]=qDn(v),[C]=bi(b,"col"),N={};let j={};jWn.forEach(T=>{let P={};const E=e[T];typeof E=="number"?P.span=E:typeof E=="object"&&(P=E||{}),delete x[T],j={...j,[`${v}-${T}-${P.span}`]:P.span!==void 0,[`${v}-${T}-order-${P.order}`]:P.order||P.order===0,[`${v}-${T}-offset-${P.offset}`]:P.offset||P.offset===0,[`${v}-${T}-push-${P.push}`]:P.push||P.push===0,[`${v}-${T}-pull-${P.pull}`]:P.pull||P.pull===0,[`${v}-rtl`]:r==="rtl"},P.flex&&(j[`${v}-${T}-flex`]=!0,N[C(`${T}-flex`)]=J$e(P.flex))});const I=be(v,{[`${v}-${l}`]:l!==void 0,[`${v}-order-${c}`]:c,[`${v}-offset-${u}`]:u,[`${v}-push-${d}`]:d,[`${v}-pull-${p}`]:p},h,j,w,S),_={};if(o!=null&&o[0]){const T=typeof o[0]=="number"?`${o[0]/2}px`:`calc(${o[0]} / 2)`;_.paddingInline=T}return g&&(_.flex=J$e(g),i===!1&&!_.minWidth&&(_.minWidth=0)),f.createElement("div",{...x,style:{..._,...y,...N},className:I,ref:t},m)});function EWn(e,t){const n=[void 0,void 0],r=Array.isArray(e)?e:[e,void 0],o=t||{xs:!0,sm:!0,md:!0,lg:!0,xl:!0,xxl:!0};return r.forEach((i,s)=>{if(typeof i=="object"&&i!==null)for(let l=0;l{if(typeof e=="string"&&r(e),typeof e=="object")for(let i=0;i{o()},[JSON.stringify(e),t]),n}const Sv=f.forwardRef((e,t)=>{const{prefixCls:n,justify:r,align:o,className:i,style:s,children:l,gutter:c=0,wrap:u,...d}=e,{getPrefixCls:p,direction:h}=f.useContext(Qr),m=p5(!0,null),g=Z$e(o,m),y=Z$e(r,m),x=p("row",n),[v,b]=GDn(x),w=EWn(c,m),S=be(x,{[`${x}-no-wrap`]:u===!1,[`${x}-${y}`]:y,[`${x}-${g}`]:g,[`${x}-rtl`]:h==="rtl"},i,v,b),C={};if(w!=null&&w[0]){const _=typeof w[0]=="number"?`${w[0]/-2}px`:`calc(${w[0]} / -2)`;C.marginInline=_}const[N,j]=w;C.rowGap=j;const I=f.useMemo(()=>({gutter:[N,j],wrap:u}),[N,j,u]);return f.createElement(aut.Provider,{value:I},f.createElement("div",{...d,className:S,style:{...C,...s},ref:t},l))}),IWn=e=>{const{componentCls:t}=e;return{[t]:{"&-horizontal":{[`&${t}`]:{"&-sm":{marginBlock:e.marginXS},"&-md":{marginBlock:e.margin}}}}}},_Wn=e=>{const{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:o,textPaddingInline:i,orientationMargin:s,verticalMarginInline:l}=e,c=`${t}-rail`;return{[t]:{...Ii(e),borderBlockStart:`${Xe(o)} solid ${r}`,[c]:{borderBlockStart:`${Xe(o)} solid ${r}`},"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:l,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${Xe(o)} solid ${r}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${Xe(e.marginLG)} 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${Xe(e.dividerHorizontalWithTextGutterMargin)} 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${r}`,[`${c}-start, ${c}-end`]:{width:"50%",borderBlockStartColor:"inherit",borderBlockEnd:0,content:"''"}},[`&-horizontal${t}-with-text-start`]:{[`${c}-start`]:{width:`calc(${s} * 100%)`},[`${c}-end`]:{width:`calc(100% - ${s} * 100%)`}},[`&-horizontal${t}-with-text-end`]:{[`${c}-start`]:{width:`calc(100% - ${s} * 100%)`},[`${c}-end`]:{width:`calc(${s} * 100%)`}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:i},"&-dashed":{background:"none",borderColor:r,borderStyle:"dashed",borderWidth:`${Xe(o)} 0 0`,[c]:{borderBlockStart:`${Xe(o)} dashed ${r}`}},[`&-horizontal${t}-with-text${t}-dashed`]:{[`${c}-start, ${c}-end`]:{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},"&-dotted":{background:"none",borderColor:r,borderStyle:"dotted",borderWidth:`${Xe(o)} 0 0`,[c]:{borderBlockStart:`${Xe(o)} dotted ${r}`}},[`&-horizontal${t}-with-text${t}-dotted`]:{"&::before, &::after":{borderStyle:"dotted none none"}},[`&-vertical${t}-dotted`]:{borderInlineStartWidth:o,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-start${t}-no-default-orientation-margin-start`]:{[`${c}-start`]:{width:0},[`${c}-end`]:{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${t}-with-text-end${t}-no-default-orientation-margin-end`]:{[`${c}-start`]:{width:"100%"},[`${c}-end`]:{width:0},[`${t}-inner-text`]:{paddingInlineEnd:n}}}}},PWn=e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}),AWn=ui("Divider",e=>{const t=Ho(e,{dividerHorizontalWithTextGutterMargin:e.margin,sizePaddingEdgeHorizontal:0});return[_Wn(t),IWn(t)]},PWn,{unitless:{orientationMargin:!0}}),TWn=["left","right","center","start","end"],kWn={small:"sm",middle:"md"},RP=e=>{const{getPrefixCls:t,direction:n,className:r,style:o,classNames:i,styles:s}=Zo("divider"),{prefixCls:l,type:c,orientation:u,vertical:d,titlePlacement:p,orientationMargin:h,className:m,rootClassName:g,children:y,dashed:x,variant:v="solid",plain:b,style:w,size:S,classNames:C,styles:N,...j}=e,I=t("divider",l),_=`${I}-rail`,[T,P]=AWn(I),E=ad(S),M=kWn[E],R=!!y,$=TWn.includes(u||""),D=f.useMemo(()=>{const J=p??($?u:"center");return J==="left"?n==="rtl"?"end":"start":J==="right"?n==="rtl"?"start":"end":J},[n,u,p,$]),z=D==="start"&&h!=null,V=D==="end"&&h!=null,[B,G]=MK(u,d,c),H={...e,orientation:B,titlePlacement:D,size:E},[F,W]=di([i,C],[s,N],{props:H}),U=be(I,r,T,P,`${I}-${B}`,{[`${I}-with-text`]:R,[`${I}-with-text-${D}`]:R,[`${I}-dashed`]:!!x,[`${I}-${v}`]:v!=="solid",[`${I}-plain`]:!!b,[`${I}-rtl`]:n==="rtl",[`${I}-no-default-orientation-margin-start`]:z,[`${I}-no-default-orientation-margin-end`]:V,[`${I}-${M}`]:!!M,[_]:!y,[F.rail]:F.rail&&!y},m,g,F.root),K=f.useMemo(()=>typeof h=="number"?h:/^\d+$/.test(h)?Number(h):h,[h]),X={marginInlineStart:z?K:void 0,marginInlineEnd:V?K:void 0};return f.createElement("div",{className:U,style:{...o,...W.root,...y?{}:W.rail,...w},...j,role:"separator"},y&&!G&&f.createElement(f.Fragment,null,f.createElement("div",{className:be(_,`${_}-start`,F.rail),style:W.rail}),f.createElement("span",{className:be(`${I}-inner-text`,F.content),style:{...X,...W.content}},y),f.createElement("div",{className:be(_,`${_}-end`,F.rail),style:W.rail})))},MWn=e=>{const{componentCls:t,borderRadius:n,paddingSM:r,colorBorder:o,paddingXS:i,fontSizeLG:s,fontSizeSM:l,borderRadiusLG:c,borderRadiusSM:u,colorBgContainerDisabled:d,lineWidth:p,antCls:h}=e,[m,g]=bi(h,"space");return{[t]:[{display:"inline-flex",alignItems:"center",gap:0,paddingInline:r,margin:0,borderWidth:p,borderStyle:"solid",borderRadius:n,"&:hover":{zIndex:0},[`&${t}-disabled`]:{color:e.colorTextDisabled},"&-large":{fontSize:s,borderRadius:c},"&-small":{paddingInline:i,borderRadius:u,fontSize:l},"&-compact-last-item":{borderEndStartRadius:0,borderStartStartRadius:0},"&-compact-first-item":{borderEndEndRadius:0,borderStartEndRadius:0},"&-compact-item:not(:first-child):not(:last-child)":{borderRadius:0},"&-compact-item:not(:last-child)":{borderInlineEndWidth:0},"&-compact-item:not(:first-child)":{borderInlineStartWidth:0}},{[m("addon-border-color")]:o,[m("addon-background")]:d,[m("addon-border-color-outlined")]:o,[m("addon-background-filled")]:d,borderColor:g("addon-border-color"),background:g("addon-background"),"&-variant-outlined":{[m("addon-border-color")]:g("addon-border-color-outlined")},"&-variant-filled":{[m("addon-border-color")]:"transparent",[m("addon-background")]:g("addon-background-filled"),[`&${t}-disabled`]:{[m("addon-border-color")]:o,[m("addon-background")]:d}},"&-variant-borderless":{border:"none",background:"transparent"},"&-variant-underlined":{border:"none",background:"transparent"}},{"&-status-error":{[m("addon-border-color-outlined")]:e.colorError,[m("addon-background-filled")]:e.colorErrorBg,color:e.colorError},"&-status-warning":{[m("addon-border-color-outlined")]:e.colorWarning,[m("addon-background-filled")]:e.colorWarningBg,color:e.colorWarning}}]}},RWn=ui(["Space","Addon"],e=>[MWn(e),a6(e,{focus:!1})]),OWn=Ie.forwardRef((e,t)=>{const{className:n,children:r,style:o,prefixCls:i,variant:s="outlined",disabled:l,status:c,...u}=e,{getPrefixCls:d,direction:p}=Ie.useContext(Qr),h=d("space-addon",i),[m,g]=RWn(h),{compactItemClassnames:y,compactSize:x}=Zw(h,p),v=SI(h,c),b=be(h,m,y,g,`${h}-variant-${s}`,v,{[`${h}-${x}`]:x,[`${h}-disabled`]:l},n);return Ie.createElement("div",{ref:t,className:b,style:o,...u},r)});function $Wn(e){return!!(e.addonBefore||e.addonAfter)}function DWn(e){return!!(e.prefix||e.suffix||e.allowClear)}function eDe(e,t,n){const r=t.cloneNode(!0),o=Object.create(e,{target:{value:r},currentTarget:{value:r}});return r.value=n,typeof t.selectionStart=="number"&&typeof t.selectionEnd=="number"&&(r.selectionStart=t.selectionStart,r.selectionEnd=t.selectionEnd),r.setSelectionRange=(...i)=>{t.setSelectionRange(...i)},o}function KU(e,t,n,r){if(!n)return;let o=t;if(t.type==="click"){o=eDe(t,e,""),n(o);return}if(e.type!=="file"&&r!==void 0){o=eDe(t,e,r),n(o);return}n(o)}function bue(){return bue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var B,G,H;const{inputElement:n,children:r,prefixCls:o,prefix:i,suffix:s,addonBefore:l,addonAfter:c,className:u,style:d,disabled:p,readOnly:h,focused:m,triggerFocus:g,allowClear:y,value:x,handleReset:v,hidden:b,classes:w,classNames:S,dataAttrs:C,styles:N,components:j,onClear:I}=e,_=r??n,T=(j==null?void 0:j.affixWrapper)||"span",P=(j==null?void 0:j.groupWrapper)||"span",E=(j==null?void 0:j.wrapper)||"span",M=(j==null?void 0:j.groupAddon)||"span",R=f.useRef(null),$=F=>{var W;(W=R.current)!=null&&W.contains(F.target)&&(g==null||g())},D=DWn(e);let z=f.cloneElement(_,{value:x,className:be((B=_.props)==null?void 0:B.className,!D&&(S==null?void 0:S.variant))||null});const V=f.useRef(null);if(Ie.useImperativeHandle(t,()=>({nativeElement:V.current||R.current})),D){let F=null;if(y){const X=!p&&!h&&x,J=`${o}-clear-icon`,te=typeof y=="object"&&(y!=null&&y.clearIcon)?y.clearIcon:"✖";F=Ie.createElement("button",{type:"button",tabIndex:-1,onClick:re=>{v==null||v(re),I==null||I()},onMouseDown:re=>re.preventDefault(),className:be(J,{[`${J}-hidden`]:!X,[`${J}-has-suffix`]:!!s})},te)}const W=`${o}-affix-wrapper`,U=be(W,{[`${o}-disabled`]:p,[`${W}-disabled`]:p,[`${W}-focused`]:m,[`${W}-readonly`]:h,[`${W}-input-with-clear-btn`]:s&&y&&x},w==null?void 0:w.affixWrapper,S==null?void 0:S.affixWrapper,S==null?void 0:S.variant),K=(s||y)&&Ie.createElement("span",{className:be(`${o}-suffix`,S==null?void 0:S.suffix),style:N==null?void 0:N.suffix},F,s);z=Ie.createElement(T,bue({className:U,style:N==null?void 0:N.affixWrapper,onClick:$},C==null?void 0:C.affixWrapper,{ref:R}),i&&Ie.createElement("span",{className:be(`${o}-prefix`,S==null?void 0:S.prefix),style:N==null?void 0:N.prefix},i),z,K)}if($Wn(e)){const F=`${o}-group`,W=`${F}-addon`,U=`${F}-wrapper`,K=be(`${o}-wrapper`,F,w==null?void 0:w.wrapper,S==null?void 0:S.wrapper),X=be(U,{[`${U}-disabled`]:p},w==null?void 0:w.group,S==null?void 0:S.groupWrapper);z=Ie.createElement(P,{className:X,ref:V},Ie.createElement(E,{className:K},l&&Ie.createElement(M,{className:W},l),z,c&&Ie.createElement(M,{className:W},c)))}return Ie.cloneElement(z,{className:be((G=z.props)==null?void 0:G.className,u)||null,style:{...(H=z.props)==null?void 0:H.style,...d},hidden:b})});function lut(e,t){return f.useMemo(()=>{let n={};t&&(n.show=typeof t=="object"&&t.formatter?t.formatter:!!t),n={...n,...e};const{show:r,...o}=n;return{...o,show:!!r,showFormatter:typeof r=="function"?r:void 0,strategy:o.strategy||(i=>i.length)}},[e,t])}function YU(){return YU=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{autoComplete:n,onChange:r,onFocus:o,onBlur:i,onPressEnter:s,onKeyDown:l,onKeyUp:c,prefixCls:u="rc-input",disabled:d,htmlSize:p,className:h,maxLength:m,suffix:g,showCount:y,count:x,type:v="text",classes:b,classNames:w,styles:S,onCompositionStart:C,onCompositionEnd:N,...j}=e,[I,_]=f.useState(!1),T=f.useRef(!1),P=f.useRef(!1),E=f.useRef(null),M=f.useRef(null),R=se=>{E.current&&ast(E.current,se)},[$,D]=Fa(e.defaultValue,e.value),z=$==null?"":String($),[V,B]=f.useState(null),G=lut(x,y),H=G.max||m,F=G.strategy(z),W=!!H&&F>H;f.useImperativeHandle(t,()=>{var se;return{focus:R,blur:()=>{var ge;(ge=E.current)==null||ge.blur()},setSelectionRange:(ge,ye,de)=>{var Ne;(Ne=E.current)==null||Ne.setSelectionRange(ge,ye,de)},select:()=>{var ge;(ge=E.current)==null||ge.select()},input:E.current,nativeElement:((se=M.current)==null?void 0:se.nativeElement)||E.current}}),f.useEffect(()=>{P.current&&(P.current=!1),_(se=>se&&d?!1:se)},[d]);const U=(se,ge,ye)=>{var Ne,_e;let de=ge;if(!T.current&&G.exceedFormatter&&G.max&&G.strategy(ge)>G.max)de=G.exceedFormatter(ge,{max:G.max}),ge!==de&&B([((Ne=E.current)==null?void 0:Ne.selectionStart)||0,((_e=E.current)==null?void 0:_e.selectionEnd)||0]);else if(ye.source==="compositionEnd")return;D(de),E.current&&KU(E.current,se,r,de)};f.useEffect(()=>{var se;V&&((se=E.current)==null||se.setSelectionRange(...V))},[V]);const K=se=>{U(se,se.target.value,{source:"change"})},X=se=>{T.current=!1,U(se,se.currentTarget.value,{source:"compositionEnd"}),N==null||N(se)},J=se=>{s&&se.key==="Enter"&&!P.current&&!se.nativeEvent.isComposing&&(P.current=!0,s(se)),l==null||l(se)},te=se=>{se.key==="Enter"&&(P.current=!1),c==null||c(se)},re=se=>{_(!0),o==null||o(se)},ce=se=>{P.current&&(P.current=!1),_(!1),i==null||i(se)},ae=se=>{D(""),R(),E.current&&KU(E.current,se,r)},oe=W&&`${u}-out-of-range`,ue=()=>{const se=za(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return Ie.createElement("input",YU({autoComplete:n},se,{onChange:K,onFocus:re,onBlur:ce,onKeyDown:J,onKeyUp:te,className:be(u,{[`${u}-disabled`]:d},w==null?void 0:w.input),style:S==null?void 0:S.input,ref:E,size:p,type:v,onCompositionStart:ge=>{T.current=!0,C==null||C(ge)},onCompositionEnd:X}))},fe=()=>{const se=Number(H)>0;if(g||G.show){const ge=G.showFormatter?G.showFormatter({value:z,count:F,maxLength:H}):`${F}${se?` / ${H}`:""}`;return Ie.createElement(Ie.Fragment,null,G.show&&Ie.createElement("span",{className:be(`${u}-show-count-suffix`,{[`${u}-show-count-has-suffix`]:!!g},w==null?void 0:w.count),style:{...S==null?void 0:S.count}},ge),g)}return null};return Ie.createElement(sut,YU({},j,{prefixCls:u,className:be(h,oe),handleReset:ae,value:z,focused:I,triggerFocus:R,suffix:fe(),disabled:d,classes:b,classNames:w,styles:S,ref:M}),ue())}),cut=e=>{let t;return typeof e=="object"&&(e!=null&&e.clearIcon)?t=e:e&&(t={clearIcon:Ie.createElement(aN,null)}),t};function uut(e,t){const n=f.useRef([]),r=()=>{n.current.push(setTimeout(()=>{var o,i,s,l;(o=e.current)!=null&&o.input&&((i=e.current)==null?void 0:i.input.getAttribute("type"))==="password"&&((s=e.current)!=null&&s.input.hasAttribute("value"))&&((l=e.current)==null||l.input.removeAttribute("value"))}))};return f.useEffect(()=>(t&&r(),()=>n.current.forEach(o=>{o&&clearTimeout(o)})),[]),r}function FWn(e){return!!(e.prefix||e.suffix||e.allowClear||e.showCount)}const g6=f.forwardRef((e,t)=>{const{prefixCls:n,bordered:r=!0,status:o,size:i,disabled:s,onBlur:l,onFocus:c,suffix:u,allowClear:d,addonAfter:p,addonBefore:h,className:m,style:g,styles:y,rootClassName:x,onChange:v,classNames:b,variant:w,...S}=e,{getPrefixCls:C,direction:N,allowClear:j,autoComplete:I,className:_,style:T,classNames:P,styles:E}=Zo("input"),M=C("input",n),R=f.useRef(null),$=pl(M),[D,z]=Gct(M,x);qct(M,$);const{compactSize:V,compactItemClassnames:B}=Zw(M,N),G=ad(Ne=>i??V??Ne),H=Ie.useContext(Mp),F=s??H,W={...e,size:G,disabled:F},[U,K]=di([P,b],[E,y],{props:W}),{status:X,hasFeedback:J,feedbackIcon:te}=f.useContext(mf),re=Fk(X,o),ce=FWn(e)||!!J;f.useRef(ce);const ae=uut(R,!0),oe=Ne=>{ae(),l==null||l(Ne)},ue=Ne=>{ae(),c==null||c(Ne)},fe=Ne=>{ae(),v==null||v(Ne)},se=(J||u)&&Ie.createElement(Ie.Fragment,null,u,J&&te),ge=cut(d??j),[ye,de]=zk("input",w,r);return Ie.createElement(LWn,{ref:zd(t,R),prefixCls:M,autoComplete:I,...S,disabled:F,onBlur:oe,onFocus:ue,style:{...K.root,...T,...g},styles:K,suffix:se,allowClear:ge,className:be(m,x,z,$,B,_,U.root),onChange:fe,addonBefore:h&&Ie.createElement(Nw,{form:!0,space:!0},h),addonAfter:p&&Ie.createElement(Nw,{form:!0,space:!0},p),classNames:{...U,input:be({[`${M}-sm`]:G==="small",[`${M}-lg`]:G==="large",[`${M}-rtl`]:N==="rtl"},U.input,D),variant:be({[`${M}-${ye}`]:de},SI(M,re)),affixWrapper:be({[`${M}-affix-wrapper-sm`]:G==="small",[`${M}-affix-wrapper-lg`]:G==="large",[`${M}-affix-wrapper-rtl`]:N==="rtl"},D),wrapper:be({[`${M}-group-rtl`]:N==="rtl"},D),groupWrapper:be({[`${M}-group-wrapper-sm`]:G==="small",[`${M}-group-wrapper-lg`]:G==="large",[`${M}-group-wrapper-rtl`]:N==="rtl",[`${M}-group-wrapper-${ye}`]:de},SI(`${M}-group-wrapper`,re,J),D)}})});var zWn={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M873.1 596.2l-164-208A32 32 0 00684 376h-64.8c-6.7 0-10.4 7.7-6.3 13l144.3 183H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h695.9c26.8 0 41.7-30.8 25.2-51.8z"}}]},name:"swap-right",theme:"outlined"};function wue(){return wue=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,wue({},e,{ref:t,icon:zWn})),HWn=f.forwardRef(BWn),dut=(e,t,n,r,o,i)=>{const{classNames:s,styles:l}=Zo(e),[c,u]=di([s,t],[l,n],{props:i},{popup:{_default:"root"}});return f.useMemo(()=>{var h,m;const d={...c,popup:{...c.popup,root:be((h=c.popup)==null?void 0:h.root,r)}},p={...u,popup:{...u.popup,root:{...(m=u.popup)==null?void 0:m.root,...o}}};return[d,p]},[c,u,r,o])};function VWn(e,t,n){return n!==void 0?n:t==="year"&&e.lang.yearPlaceholder?e.lang.yearPlaceholder:t==="quarter"&&e.lang.quarterPlaceholder?e.lang.quarterPlaceholder:t==="month"&&e.lang.monthPlaceholder?e.lang.monthPlaceholder:t==="week"&&e.lang.weekPlaceholder?e.lang.weekPlaceholder:t==="time"&&e.timePickerLocale.placeholder?e.timePickerLocale.placeholder:e.lang.placeholder}function UWn(e,t,n){return n!==void 0?n:t==="year"&&e.lang.yearPlaceholder?e.lang.rangeYearPlaceholder:t==="quarter"&&e.lang.quarterPlaceholder?e.lang.rangeQuarterPlaceholder:t==="month"&&e.lang.monthPlaceholder?e.lang.rangeMonthPlaceholder:t==="week"&&e.lang.weekPlaceholder?e.lang.rangeWeekPlaceholder:t==="time"&&e.timePickerLocale.placeholder?e.timePickerLocale.rangePlaceholder:e.lang.rangePlaceholder}function fut(e,t){const{allowClear:n=!0}=e,{clearIcon:r,removeIcon:o}=ult({...e,componentName:"DatePicker"});return[f.useMemo(()=>n===!1?!1:{clearIcon:r,...n===!0?{}:n},[n,r]),o]}const[WWn,GWn]=["week","WeekPicker"],[qWn,KWn]=["month","MonthPicker"],[YWn,XWn]=["year","YearPicker"],[QWn,JWn]=["quarter","QuarterPicker"],[Nve,tDe]=["time","TimePicker"];var ZWn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V460h656v380zM184 392V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v136H184z"}}]},name:"calendar",theme:"outlined"};function Sue(){return Sue=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Sue({},e,{ref:t,icon:ZWn})),tGn=f.forwardRef(eGn);var nGn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M686.7 638.6L544.1 535.5V288c0-4.4-3.6-8-8-8H488c-4.4 0-8 3.6-8 8v275.4c0 2.6 1.2 5 3.3 6.5l165.4 120.6c3.6 2.6 8.6 1.8 11.2-1.7l28.6-39c2.6-3.7 1.8-8.7-1.8-11.2z"}}]},name:"clock-circle",theme:"outlined"};function Cue(){return Cue=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Cue({},e,{ref:t,icon:nGn})),put=f.forwardRef(rGn),hut=({picker:e,hasFeedback:t,feedbackIcon:n,suffixIcon:r})=>r===null||r===!1?null:r===!0||r===void 0?Ie.createElement(Ie.Fragment,null,e===Nve?Ie.createElement(put,null):Ie.createElement(tGn,null),t&&n):r,oGn=e=>f.createElement(Ls,{size:"small",type:"primary",...e});function mut(e){return f.useMemo(()=>({button:oGn,...e}),[e])}const iGn=e=>f.forwardRef((n,r)=>{var _e,xe;const{prefixCls:o,getPopupContainer:i,components:s,className:l,style:c,classNames:u,styles:d,placement:p,size:h,disabled:m,bordered:g=!0,placeholder:y,status:x,variant:v,picker:b,dropdownClassName:w,popupClassName:S,popupStyle:C,rootClassName:N,suffixIcon:j,...I}=n,_=b===Nve?"timePicker":"datePicker",[T,P]=dut(_,u,d,S||w,C),E=f.useRef(null),{getPrefixCls:M,direction:R,getPopupContainer:$,rangePicker:D}=f.useContext(Qr),z=M("picker",o),{compactSize:V,compactItemClassnames:B}=Zw(z,R),G=M(),[H,F]=zk("rangePicker",v,g),W=pl(z),[U,K]=Kct(z,W),X=be(U,K,W,N),[J]=fut(n),te=mut(s),re=ad(we=>h??V??we),ce=f.useContext(Mp),ae=m??ce,oe=f.useContext(mf),{hasFeedback:ue,status:fe,feedbackIcon:se}=oe,ge=hut({picker:b,hasFeedback:ue,feedbackIcon:se,suffixIcon:j});f.useImperativeHandle(r,()=>E.current);const[ye]=xg("Calendar",NU),de=B2(ye,n.locale||{}),[Ne]=sN("DatePicker",(xe=(_e=P==null?void 0:P.popup)==null?void 0:_e.root)==null?void 0:xe.zIndex);return f.createElement(Nw,{space:!0},f.createElement(dVn,{separator:f.createElement("span",{"aria-label":"to",className:`${z}-separator`},f.createElement(HWn,null)),disabled:ae,ref:E,placement:p,placeholder:UWn(de,b,y),suffixIcon:ge,prevIcon:f.createElement("span",{className:`${z}-prev-icon`}),nextIcon:f.createElement("span",{className:`${z}-next-icon`}),superPrevIcon:f.createElement("span",{className:`${z}-super-prev-icon`}),superNextIcon:f.createElement("span",{className:`${z}-super-next-icon`}),transitionName:`${G}-slide-up`,picker:b,...I,locale:de.lang,getPopupContainer:i||$,generateConfig:e,components:te,direction:R,prefixCls:z,rootClassName:X,className:be({[`${z}-${re}`]:re,[`${z}-${H}`]:F},SI(z,Fk(fe,x),ue),B,l,D==null?void 0:D.className),style:{...D==null?void 0:D.style,...c},classNames:T,styles:{...P,popup:{...P.popup,root:{...P.popup.root,zIndex:Ne}}},allowClear:J}))}),aGn=e=>{const t=(c,u)=>{const d=u===tDe?"timePicker":"datePicker";return f.forwardRef((h,m)=>{var bt,Ct;const{prefixCls:g,getPopupContainer:y,components:x,style:v,className:b,size:w,bordered:S,placement:C,placeholder:N,disabled:j,status:I,variant:_,onCalendarChange:T,classNames:P,styles:E,dropdownClassName:M,popupClassName:R,popupStyle:$,rootClassName:D,suffixIcon:z,...V}=h,{getPrefixCls:B,direction:G,getPopupContainer:H,[d]:F}=f.useContext(Qr),W=B("picker",g),{compactSize:U,compactItemClassnames:K}=Zw(W,G),X=ad(Je=>w??U??Je),J=f.useContext(Mp),te=j??J,re={...h,size:X,disabled:te,status:I,variant:_},[ce,ae]=dut(d,P,E,R||M,$,re),oe=f.useRef(null),[ue,fe]=zk("datePicker",_,S),se=pl(W),[ge,ye]=Kct(W,se),de=be(ge,ye,se,D);f.useImperativeHandle(m,()=>oe.current);const Ne={showToday:!0},_e=c||h.picker,xe=B(),{onSelect:we,multiple:Te}=V,Re=we&&c==="time"&&!Te,Ue=(Je,Pe,Me)=>{T==null||T(Je,Pe,Me),Re&&we(Je)},[He,Ye]=fut(h),We=mut(x),at=f.useContext(mf),{hasFeedback:Oe,status:Ae,feedbackIcon:qe}=at,dt=hut({picker:_e,hasFeedback:Oe,feedbackIcon:qe,suffixIcon:z}),[Ze]=xg("DatePicker",NU),Qe=B2(Ze,h.locale||{}),[lt]=sN("DatePicker",(Ct=(bt=ae==null?void 0:ae.popup)==null?void 0:bt.root)==null?void 0:Ct.zIndex);return f.createElement(Nw,{space:!0},f.createElement(OVn,{ref:oe,placeholder:VWn(Qe,_e,N),suffixIcon:dt,placement:C,prevIcon:f.createElement("span",{className:`${W}-prev-icon`}),nextIcon:f.createElement("span",{className:`${W}-next-icon`}),superPrevIcon:f.createElement("span",{className:`${W}-super-prev-icon`}),superNextIcon:f.createElement("span",{className:`${W}-super-next-icon`}),transitionName:`${xe}-slide-up`,picker:c,onCalendarChange:Ue,...Ne,...V,locale:Qe.lang,getPopupContainer:y||H,generateConfig:e,components:We,direction:G,disabled:te,prefixCls:W,rootClassName:de,className:be({[`${W}-${X}`]:X,[`${W}-${ue}`]:fe},SI(W,Fk(Ae,I),Oe),K,F==null?void 0:F.className,b),style:{...F==null?void 0:F.style,...v},classNames:ce,styles:{...ae,popup:{...ae.popup,root:{...ae.popup.root,zIndex:lt}}},allowClear:He,removeIcon:Ye}))})},n=t(),r=t(WWn,GWn),o=t(qWn,KWn),i=t(YWn,XWn),s=t(QWn,JWn),l=t(Nve,tDe);return{DatePicker:n,WeekPicker:r,MonthPicker:o,YearPicker:i,TimePicker:l,QuarterPicker:s}},gut=e=>{const{DatePicker:t,WeekPicker:n,MonthPicker:r,YearPicker:o,TimePicker:i,QuarterPicker:s}=aGn(e),l=iGn(e),c=t;return c.WeekPicker=n,c.MonthPicker=r,c.YearPicker=o,c.RangePicker=l,c.TimePicker=i,c.QuarterPicker=s,c},Kk=gut(i7n),sGn=HK(Kk,"popupAlign",void 0,"picker");Kk._InternalPanelDoNotUseOrYouWillBeFired=sGn;const lGn=HK(Kk.RangePicker,"popupAlign",void 0,"picker");Kk._InternalRangePanelDoNotUseOrYouWillBeFired=lGn;Kk.generatePicker=gut;const cGn={xxl:3,xl:3,lg:3,md:3,sm:2,xs:1},jve=Ie.createContext(null),uGn=e=>Bu(e).map(t=>({...t==null?void 0:t.props,key:t.key}));function dGn(e,t,n){const r=f.useMemo(()=>t||uGn(n),[t,n]);return f.useMemo(()=>r.map(({span:i,...s})=>i==="filled"?{...s,filled:!0}:{...s,span:typeof i=="number"?i:flt(e,i)}),[r,e])}function fGn(e,t){let n=[],r=[],o=!1,i=0;return e.filter(s=>s).forEach(s=>{const{filled:l,...c}=s;if(l){r.push(c),n.push(r),r=[],i=0;return}const u=t-i;i+=s.span||1,i>=t?(i>t?(o=!0,r.push({...c,span:u})):r.push(c),n.push(r),r=[],i=0):r.push(c)}),r.length>0&&n.push(r),n=n.map(s=>{const l=s.reduce((c,u)=>c+(u.span||1),0);if(l{const[n,r]=f.useMemo(()=>fGn(t,e),[t,e]);return n},hGn=e=>e.children,Cte=e=>{const{itemPrefixCls:t,component:n,span:r,className:o,style:i,labelStyle:s,contentStyle:l,bordered:c,label:u,content:d,colon:p,type:h,styles:m,classNames:g}=e,y=n,{classNames:x,styles:v}=Ie.useContext(jve),[b,w]=di([x,g],[v,m],{props:e}),S={...s,...w.label},C={...l,...w.content};return c?Ie.createElement(y,{colSpan:r,style:i,className:be(o,{[`${t}-item-${h}`]:h==="label"||h==="content",[b.label]:b.label&&h==="label",[b.content]:b.content&&h==="content"})},ll(u)&&Ie.createElement("span",{style:S},u),ll(d)&&Ie.createElement("span",{style:C},d)):Ie.createElement(y,{className:be(`${t}-item`,o),style:i,colSpan:r},Ie.createElement("div",{className:`${t}-item-container`},ll(u)&&Ie.createElement("span",{style:S,className:be(`${t}-item-label`,b.label,{[`${t}-item-no-colon`]:!p})},u),ll(d)&&Ie.createElement("span",{style:C,className:be(`${t}-item-content`,b.content)},d)))};function Nte(e,{colon:t,prefixCls:n,bordered:r},{component:o,type:i,showLabel:s,showContent:l,labelStyle:c,contentStyle:u,styles:d}){return e.map(({label:p,children:h,prefixCls:m=n,className:g,style:y,labelStyle:x,contentStyle:v,span:b=1,key:w,styles:S,classNames:C},N)=>typeof o=="string"?f.createElement(Cte,{key:`${i}-${w||N}`,className:g,style:y,classNames:C,styles:{label:{...c,...d==null?void 0:d.label,...x,...S==null?void 0:S.label},content:{...u,...d==null?void 0:d.content,...v,...S==null?void 0:S.content}},span:b,colon:t,component:o,itemPrefixCls:m,bordered:r,label:s?p:null,content:l?h:null,type:i}):[f.createElement(Cte,{key:`label-${w||N}`,className:g,style:{...c,...d==null?void 0:d.label,...y,...x,...S==null?void 0:S.label},span:1,colon:t,component:o[0],itemPrefixCls:m,bordered:r,label:p,type:"label"}),f.createElement(Cte,{key:`content-${w||N}`,className:g,style:{...u,...d==null?void 0:d.content,...y,...v,...S==null?void 0:S.content},span:b*2-1,component:o[1],itemPrefixCls:m,bordered:r,content:h,type:"content"})])}const mGn=e=>{const t=f.useContext(jve),{prefixCls:n,vertical:r,row:o,index:i,bordered:s}=e;return r?f.createElement(f.Fragment,null,f.createElement("tr",{key:`label-${i}`,className:`${n}-row`},Nte(o,e,{component:"th",type:"label",showLabel:!0,...t})),f.createElement("tr",{key:`content-${i}`,className:`${n}-row`},Nte(o,e,{component:"td",type:"content",showContent:!0,...t}))):f.createElement("tr",{key:i,className:`${n}-row`},Nte(o,e,{component:s?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0,...t}))},gGn=e=>{const{componentCls:t,labelBg:n}=e;return{[`&${t}-bordered`]:{[`> ${t}-view`]:{border:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"> table":{tableLayout:"auto"},[`${t}-row`]:{borderBottom:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:first-child":{"> th:first-child, > td:first-child":{borderStartStartRadius:e.borderRadiusLG}},"&:last-child":{borderBottom:"none","> th:first-child, > td:first-child":{borderEndStartRadius:e.borderRadiusLG}},[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${Xe(e.padding)} ${Xe(e.paddingLG)}`,borderInlineEnd:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderInlineEnd:"none"}},[`> ${t}-item-label`]:{color:e.colorTextSecondary,backgroundColor:n,"&::after":{display:"none"}}}},[`&${t}-middle`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${Xe(e.paddingSM)} ${Xe(e.paddingLG)}`}}},[`&${t}-small`]:{[`${t}-row`]:{[`> ${t}-item-label, > ${t}-item-content`]:{padding:`${Xe(e.paddingXS)} ${Xe(e.padding)}`}}}}}},xGn=e=>{const{componentCls:t,extraColor:n,itemPaddingBottom:r,itemPaddingEnd:o,colonMarginRight:i,colonMarginLeft:s,titleMarginBottom:l}=e;return{[t]:{...Ii(e),...gGn(e),"&-rtl":{direction:"rtl"},[`${t}-header`]:{display:"flex",alignItems:"center",marginBottom:l},[`${t}-title`]:{...wh,flex:"auto",color:e.titleColor,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG},[`${t}-extra`]:{marginInlineStart:"auto",color:n,fontSize:e.fontSize},[`${t}-view`]:{width:"100%",borderRadius:e.borderRadiusLG,table:{width:"100%",tableLayout:"fixed",borderCollapse:"collapse"}},[`${t}-row`]:{"> th, > td":{paddingBottom:r,paddingInlineEnd:o},"> th:last-child, > td:last-child":{paddingInlineEnd:0},"&:last-child":{borderBottom:"none","> th, > td":{paddingBottom:0}}},[`${t}-item-label`]:{color:e.labelColor,fontWeight:"normal",fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"start","&::after":{content:'":"',position:"relative",top:-.5,marginInline:`${Xe(s)} ${Xe(i)}`},[`&${t}-item-no-colon::after`]:{content:'""'}},[`${t}-item-no-label`]:{"&::after":{margin:0,content:'""'}},[`${t}-item-content`]:{display:"table-cell",flex:1,color:e.contentColor,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word",overflowWrap:"break-word"},[`${t}-item`]:{paddingBottom:0,verticalAlign:"top","&-container":{display:"flex",[`${t}-item-label`]:{display:"inline-flex",alignItems:"baseline"},[`${t}-item-content`]:{display:"inline-flex",alignItems:"baseline",minWidth:"1em"}}},"&-middle":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingSM}}},"&-small":{[`${t}-row`]:{"> th, > td":{paddingBottom:e.paddingXS}}}}}},yGn=e=>({labelBg:e.colorFillAlter,labelColor:e.colorTextTertiary,titleColor:e.colorText,titleMarginBottom:e.fontSizeSM*e.lineHeightSM,itemPaddingBottom:e.padding,itemPaddingEnd:e.padding,colonMarginRight:e.marginXS,colonMarginLeft:e.marginXXS/2,contentColor:e.colorText,extraColor:e.colorText}),vGn=ui("Descriptions",e=>{const t=Ho(e,{});return xGn(t)},yGn),jx=e=>{const{prefixCls:t,title:n,extra:r,column:o,colon:i=!0,bordered:s,layout:l,children:c,className:u,rootClassName:d,style:p,size:h,labelStyle:m,contentStyle:g,styles:y,items:x,classNames:v,...b}=e,{getPrefixCls:w,direction:S,className:C,style:N,classNames:j,styles:I}=Zo("descriptions"),_=w("descriptions",t),T=p5(),P=f.useMemo(()=>typeof o=="number"?o:flt(T,{...cGn,...o})??3,[T,o]),E=dGn(T,x,c),M=ad(h),R=pGn(P,E),[$,D]=vGn(_),z={...e,column:P,items:E,size:M},[V,B]=di([j,v],[I,y],{props:z}),G=f.useMemo(()=>({labelStyle:m,contentStyle:g,styles:{label:B.label,content:B.content},classNames:{label:V.label,content:V.content}}),[m,g,B.label,B.content,V.label,V.content]);return f.createElement(jve.Provider,{value:G},f.createElement("div",{className:be(_,C,V.root,{[`${_}-${M}`]:M&&M!=="default",[`${_}-bordered`]:!!s,[`${_}-rtl`]:S==="rtl"},u,d,$,D),style:{...N,...B.root,...p},...b},(n||r)&&f.createElement("div",{className:be(`${_}-header`,V.header),style:B.header},n&&f.createElement("div",{className:be(`${_}-title`,V.title),style:B.title},n),r&&f.createElement("div",{className:be(`${_}-extra`,V.extra),style:B.extra},r)),f.createElement("div",{className:`${_}-view`},f.createElement("table",null,f.createElement("tbody",null,R.map((H,F)=>f.createElement(mGn,{key:F,index:F,colon:i,prefixCls:_,vertical:l==="vertical",bordered:s,row:H})))))))};jx.Item=hGn;const nDe=f.createContext(null),xut=f.createContext({});function Nue(){return Nue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:t,className:n,containerRef:r,...o}=e,{panel:i}=f.useContext(xut),s=Yw(i,r);return f.createElement("div",Nue({className:be(`${t}-section`,n),role:"dialog",ref:s},fl(e,{aria:!0}),{"aria-modal":"true"},o))};function wGn(e){const{prefixCls:t,direction:n,className:r,style:o,maxSize:i,containerRef:s,currentSize:l,onResize:c,onResizeEnd:u,onResizeStart:d}=e,[p,h]=f.useState(!1),[m,g]=f.useState(0),[y,x]=f.useState(0),v=n==="left"||n==="right",b=Vr(N=>{N.preventDefault(),N.stopPropagation(),h(!0),g(v?N.clientX:N.clientY);let j;if(typeof l=="number")j=l;else if(s!=null&&s.current){const I=s.current.getBoundingClientRect();j=v?I.width:I.height}x(j),d==null||d(j)}),w=Vr(N=>{if(!p)return;let I=(v?N.clientX:N.clientY)-m;(n==="right"||n==="bottom")&&(I=-I);let _=y+I;_<0&&(_=0),i&&_>i&&(_=i),c==null||c(_)}),S=f.useCallback(()=>{if(p&&(h(!1),s!=null&&s.current)){const N=s.current.getBoundingClientRect(),j=v?N.width:N.height;u==null||u(j)}},[p,s,u,v]);return f.useEffect(()=>{if(p)return document.addEventListener("mousemove",w),document.addEventListener("mouseup",S),()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)}},[p,w,S]),{dragElementProps:{className:be(`${t}-dragger`,`${t}-dragger-${n}`,{[`${t}-dragger-dragging`]:p,[`${t}-dragger-horizontal`]:v,[`${t}-dragger-vertical`]:!v},r),style:o,onMouseDown:b},isDragging:p}}function jte(e){if(typeof e=="string"){const t=Number(e.replace(/px$/i,""));if(parseFloat(e)===t&&Al(!1,"Invalid value type of `width` or `height` which should be number type instead."),!Number.isNaN(t))return t}return e}function SGn(e,t,n,r,o){lst(t&&(r??o!==!1),e),Ie.useEffect(()=>{var s;t&&n===!0&&((s=e())==null||s.focus({preventScroll:!0}))},[t])}function OP(){return OP=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:n,open:r,placement:o,inline:i,push:s,forceRender:l,autoFocus:c,focusTrap:u,classNames:d,rootClassName:p,rootStyle:h,zIndex:m,className:g,id:y,style:x,motion:v,width:b,height:w,size:S,maxSize:C,children:N,mask:j,maskClosable:I,maskMotion:_,maskClassName:T,maskStyle:P,afterOpenChange:E,onClose:M,onMouseEnter:R,onMouseOver:$,onMouseLeave:D,onClick:z,onKeyDown:V,onKeyUp:B,styles:G,drawerRender:H,resizable:F,defaultSize:W}=e,U=f.useRef(null);f.useImperativeHandle(t,()=>U.current),SGn(()=>U.current,r,c,u,j);const[K,X]=f.useState(!1),J=f.useContext(nDe);let te;typeof s=="boolean"?te=s?{}:{distance:0}:te=s||{};const re=(te==null?void 0:te.distance)??(J==null?void 0:J.pushDistance)??180,ce=f.useMemo(()=>({pushDistance:re,push:()=>{X(!0)},pull:()=>{X(!1)}}),[re]);f.useEffect(()=>{var Ye,We;r?(Ye=J==null?void 0:J.push)==null||Ye.call(J):(We=J==null?void 0:J.pull)==null||We.call(J)},[r]),f.useEffect(()=>()=>{var Ye;(Ye=J==null?void 0:J.pull)==null||Ye.call(J)},[]);const ae=f.createElement(Kf,OP({key:"mask"},_,{visible:j&&r}),({className:Ye,style:We},at)=>f.createElement("div",{className:be(`${n}-mask`,Ye,d==null?void 0:d.mask,T),style:{...We,...P,...G==null?void 0:G.mask},onClick:I&&r?M:void 0,ref:at})),oe=typeof v=="function"?v(o):v,[ue,fe]=f.useState(),se=o==="left"||o==="right",ge=f.useMemo(()=>jte(S??(se?b:w)??ue??W??(se?378:void 0)),[S,b,w,W,se,ue]),ye=f.useMemo(()=>{const Ye={};if(K&&re)switch(o){case"top":Ye.transform=`translateY(${re}px)`;break;case"bottom":Ye.transform=`translateY(${-re}px)`;break;case"left":Ye.transform=`translateX(${re}px)`;break;default:Ye.transform=`translateX(${-re}px)`;break}return se?Ye.width=jte(ge):Ye.height=jte(ge),Ye},[K,re,o,se,ge]),de=f.useRef(null),Ne=!!F,_e=typeof F=="object"&&F||{},xe=Vr(Ye=>{var We;fe(Ye),(We=_e.onResize)==null||We.call(_e,Ye)}),{dragElementProps:we,isDragging:Te}=wGn({prefixCls:`${n}-resizable`,direction:o,className:d==null?void 0:d.dragger,style:G==null?void 0:G.dragger,maxSize:C,containerRef:de,currentSize:ge,onResize:xe,onResizeStart:_e.onResizeStart,onResizeEnd:_e.onResizeEnd}),Re={onMouseEnter:R,onMouseOver:$,onMouseLeave:D,onClick:z,onKeyDown:V,onKeyUp:B},Ue=f.createElement(Kf,OP({key:"panel"},oe,{visible:r,forceRender:l,onVisibleChanged:E,removeOnLeave:!1,leavedClassName:`${n}-content-wrapper-hidden`}),({className:Ye,style:We},at)=>{const Oe=f.createElement(bGn,OP({id:y,containerRef:at,prefixCls:n,className:be(g,d==null?void 0:d.section),style:{...x,...G==null?void 0:G.section}},fl(e,{aria:!0}),Re),N);return f.createElement("div",OP({ref:de,className:be(`${n}-content-wrapper`,Te&&`${n}-content-wrapper-dragging`,d==null?void 0:d.wrapper,!Te&&Ye),style:{...We,...ye,...G==null?void 0:G.wrapper}},fl(e,{data:!0})),Ne&&f.createElement("div",we),H?H(Oe):Oe)}),He={...h};return m&&(He.zIndex=m),f.createElement(nDe.Provider,{value:ce},f.createElement("div",{className:be(n,`${n}-${o}`,p,{[`${n}-open`]:r,[`${n}-inline`]:i}),style:He,tabIndex:-1,ref:U},ae,Ue))},NGn=f.forwardRef(CGn),jGn=e=>{const{open:t=!1,prefixCls:n="rc-drawer",placement:r="right",autoFocus:o=!0,keyboard:i=!0,width:s,height:l,size:c,maxSize:u,mask:d=!0,maskClosable:p=!0,getContainer:h,forceRender:m,afterOpenChange:g,destroyOnHidden:y,onMouseEnter:x,onMouseOver:v,onMouseLeave:b,onClick:w,onKeyDown:S,onKeyUp:C,onClose:N,resizable:j,defaultSize:I,focusTriggerAfterClose:_,panelRef:T}=e,[P,E]=f.useState(!1),[M,R]=f.useState(!1);Po(()=>{R(!0)},[]);const $=M?t:!1,D=f.useRef(null),z=f.useRef(null);Po(()=>{$&&(z.current=document.activeElement)},[$]);const V=W=>{var U,K;E(W),g==null||g(W),!W&&_!==!1&&z.current&&!((U=D.current)!=null&&U.contains(z.current))&&((K=z.current)==null||K.focus({preventScroll:!0}))},B=f.useMemo(()=>({panel:T}),[T]);if(!m&&!P&&!$&&y)return null;const H={...e,open:$,prefixCls:n,placement:r,autoFocus:o,keyboard:i,width:s,height:l,size:c,maxSize:u,defaultSize:I,mask:d,maskClosable:p,inline:h===!1,afterOpenChange:V,ref:D,resizable:j,...{onMouseEnter:x,onMouseOver:v,onMouseLeave:b,onClick:w,onKeyDown:S,onKeyUp:C}},F=({top:W,event:U})=>{W&&i&&(U.stopPropagation(),N==null||N(U))};return f.createElement(xut.Provider,{value:B},f.createElement(e6,{open:$||m||P,autoDestroy:!1,getContainer:h,autoLock:d&&($||P),onEsc:F},f.createElement(NGn,H)))},yut=e=>{const{prefixCls:t,ariaId:n,title:r,footer:o,extra:i,closable:s,loading:l,onClose:c,headerStyle:u,bodyStyle:d,footerStyle:p,children:h,classNames:m,styles:g}=e,y=Zo("drawer"),{classNames:x,styles:v,closable:b}=y,[w,S]=di([x,m],[v,g],{props:{...e,closable:s??b}}),C=f.useMemo(()=>{const P=s??b;if(P!==!1)return typeof P=="object"&&(P==null?void 0:P.placement)==="end"?"end":"start"},[s,b]),N=f.useCallback(P=>f.createElement("button",{type:"button",onClick:c,className:be(`${t}-close`,{[`${t}-close-${C}`]:C==="end"},w.close),style:S.close},P),[c,t,C,w.close,S.close]),[j,I]=TK(mb(e),mb(y),{closable:!0,closeIconRender:N}),_=()=>!r&&!j?null:f.createElement("div",{style:{...S.header,...u},className:be(`${t}-header`,w.header,{[`${t}-header-close-only`]:j&&!r&&!i})},f.createElement("div",{className:`${t}-header-title`},C==="start"&&I,r&&f.createElement("div",{className:be(`${t}-title`,w.title),style:S.title,id:n},r)),i&&f.createElement("div",{className:be(`${t}-extra`,w.extra),style:S.extra},i),C==="end"&&I),T=()=>o?f.createElement("div",{className:be(`${t}-footer`,w.footer),style:{...S.footer,...p}},o):null;return f.createElement(f.Fragment,null,_(),f.createElement("div",{className:be(`${t}-body`,w.body),style:{...S.body,...d}},l?f.createElement(eS,{active:!0,title:!1,paragraph:{rows:5},className:`${t}-body-skeleton`}):h),T())},EGn=e=>{const t="100%";return{left:`translateX(-${t})`,right:`translateX(${t})`,top:`translateY(-${t})`,bottom:`translateY(${t})`}[e]},vut=(e,t)=>({"&-enter, &-appear":{...e,"&-active":t},"&-leave":{...t,"&-active":e}}),but=(e,t)=>({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${t}`}},...vut({opacity:e},{opacity:1})}),IGn=(e,t)=>[but(.7,t),vut({transform:EGn(e)},{transform:"none"})],_Gn=e=>{const{componentCls:t,motionDurationSlow:n}=e;return{[t]:{[`${t}-mask-motion`]:but(0,n),[`${t}-panel-motion`]:["left","right","top","bottom"].reduce((r,o)=>({...r,[`&-${o}`]:IGn(o,n)}),{})}}},PGn=e=>{const{borderRadiusSM:t,componentCls:n,zIndexPopup:r,colorBgMask:o,colorBgElevated:i,motionDurationSlow:s,motionDurationMid:l,paddingXS:c,padding:u,paddingLG:d,fontSizeLG:p,lineHeightLG:h,lineWidth:m,lineType:g,colorSplit:y,marginXS:x,colorIcon:v,colorIconHover:b,colorBgTextHover:w,colorBgTextActive:S,colorText:C,fontWeightStrong:N,footerPaddingBlock:j,footerPaddingInline:I,draggerSize:_,calc:T}=e,P=`${n}-content-wrapper`,E=`${n}-resizable-dragger`;return{[n]:{position:"fixed",inset:0,zIndex:r,pointerEvents:"none",color:C,"&-pure":{position:"relative",background:i,display:"flex",flexDirection:"column",pointerEvents:"auto",[`&${n}-left`]:{boxShadow:e.boxShadowDrawerLeft},[`&${n}-right`]:{boxShadow:e.boxShadowDrawerRight},[`&${n}-top`]:{boxShadow:e.boxShadowDrawerUp},[`&${n}-bottom`]:{boxShadow:e.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${n}-mask`]:{position:"absolute",inset:0,zIndex:r,background:o,pointerEvents:"auto",[`&${n}-mask-blur`]:{backdropFilter:"blur(4px)"}},[P]:{position:"absolute",zIndex:r,maxWidth:"100vw",transition:`all ${s}`,"&-hidden":{display:"none"}},[`&-left > ${P}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowDrawerLeft},[`&-right > ${P}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:e.boxShadowDrawerRight},[`&-top > ${P}`]:{top:0,insetInline:0,boxShadow:e.boxShadowDrawerUp},[`&-bottom > ${P}`]:{bottom:0,insetInline:0,boxShadow:e.boxShadowDrawerDown},[`${n}-section`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:i,pointerEvents:"auto"},[`${n}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${Xe(u)} ${Xe(d)}`,fontSize:p,lineHeight:h,borderBottom:`${Xe(m)} ${g} ${y}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${n}-extra`]:{flex:"none"},[`${n}-close`]:{display:"inline-flex",width:T(p).add(c).equal(),height:T(p).add(c).equal(),borderRadius:t,justifyContent:"center",alignItems:"center",color:v,fontWeight:N,fontSize:p,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${l}`,textRendering:"auto",[`&${n}-close-end`]:{marginInlineStart:x},[`&:not(${n}-close-end)`]:{marginInlineEnd:x},"&:hover":{color:b,backgroundColor:w,textDecoration:"none"},"&:active":{backgroundColor:S},...gy(e)},[`${n}-title`]:{flex:1,margin:0,fontWeight:e.fontWeightStrong,fontSize:p,lineHeight:h},[`${n}-body`]:{flex:1,minWidth:0,minHeight:0,padding:d,overflow:"auto",[`${n}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${n}-footer`]:{flexShrink:0,padding:`${Xe(j)} ${Xe(I)}`,borderTop:`${Xe(m)} ${g} ${y}`},[E]:{position:"absolute",zIndex:1,backgroundColor:"transparent",userSelect:"none",pointerEvents:"auto","&:hover":{backgroundColor:e.colorPrimary,opacity:.2},"&-dragging":{backgroundColor:e.colorPrimary,opacity:.3}},[`${E}-left`]:{top:0,bottom:0,insetInlineEnd:0,width:_,cursor:"col-resize"},[`${E}-right`]:{top:0,bottom:0,insetInlineStart:0,width:_,cursor:"col-resize"},[`${E}-top`]:{insetInline:0,bottom:0,height:_,cursor:"row-resize"},[`${E}-bottom`]:{insetInline:0,top:0,height:_,cursor:"row-resize"},[`${P}-dragging`]:{userSelect:"none",transition:"none",willChange:"width, height",[`${n}-content`]:{pointerEvents:"none"},[`${n}-section`]:{pointerEvents:"none"}},"&-rtl":{direction:"rtl"}}}},AGn=e=>({zIndexPopup:e.zIndexPopupBase,footerPaddingBlock:e.paddingXS,footerPaddingInline:e.padding,draggerSize:4}),wut=ui("Drawer",e=>{const t=Ho(e,{});return[PGn(t),_Gn(t)]},AGn),TGn={distance:180},rDe=378,Eve=e=>{const{rootClassName:t,size:n,defaultSize:r=rDe,height:o,width:i,mask:s,push:l=TGn,open:c,afterOpenChange:u,onClose:d,prefixCls:p,getContainer:h,panelRef:m=null,style:g,className:y,resizable:x,"aria-labelledby":v,focusable:b,maskStyle:w,drawerStyle:S,contentWrapperStyle:C,destroyOnClose:N,destroyOnHidden:j,...I}=e,{placement:_}=I,T=Jw(),P=I.title?T:void 0,{getPopupContainer:E,getPrefixCls:M,direction:R,className:$,style:D,classNames:z,styles:V,mask:B}=Zo("drawer"),G=M("drawer",p),[H,F]=wut(G),W=h===void 0&&E?()=>E(document.body):h,U=f.useMemo(()=>typeof n=="number"?n:n==="large"?736:n==="default"?rDe:typeof n=="string"?/^\d+(\.\d+)?$/.test(n)?Number(n):n:!_||_==="left"||_==="right"?i:o,[n,_,i,o]),K={motionName:gb(G,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},X=xe=>({motionName:gb(G,`panel-motion-${xe}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500}),J=Cst(),te=zd(m,J),[re,ce]=sN("Drawer",I.zIndex),[ae,oe]=wat(s,B,G),ue=bst(b,W!==!1&&ae),{classNames:fe,styles:se,rootStyle:ge}=I,ye={...e,zIndex:re,panelRef:m,mask:ae,defaultSize:r,push:l,focusable:ue},[de,Ne]=di([z,fe],[V,se],{props:ye}),_e=be({"no-mask":!ae,[`${G}-rtl`]:R==="rtl"},t,H,F,de.root);return f.createElement(Nw,{form:!0,space:!0},f.createElement(ZL.Provider,{value:ce},f.createElement(jGn,{prefixCls:G,onClose:d,maskMotion:K,motion:X,...I,classNames:{mask:be(de.mask,oe.mask),section:de.section,wrapper:de.wrapper,dragger:de.dragger},styles:{mask:{...Ne.mask,...w},section:{...Ne.section,...S},wrapper:{...Ne.wrapper,...C},dragger:Ne.dragger},open:c,mask:ae,push:l,size:U,defaultSize:r,style:{...D,...g},rootStyle:{...ge,...Ne.root},className:be($,y),rootClassName:_e,getContainer:W,afterOpenChange:u,panelRef:te,zIndex:re,...x?{resizable:x}:{},"aria-labelledby":v??P,destroyOnHidden:j??N,focusTriggerAfterClose:ue.focusTriggerAfterClose,focusTrap:ue.trap},f.createElement(yut,{prefixCls:G,size:n,...I,ariaId:P,onClose:d}))))},kGn=e=>{const{prefixCls:t,style:n,className:r,placement:o="right",...i}=e,{getPrefixCls:s}=f.useContext(Qr),l=s("drawer",t),[c,u]=wut(l),d=be(l,`${l}-pure`,`${l}-${o}`,c,u,r);return f.createElement("div",{className:d,style:n},f.createElement(yut,{prefixCls:l,...i}))};Eve._InternalPanelDoNotUseOrYouWillBeFired=kGn;function oDe(e){return["small","middle","large"].includes(e)}function iDe(e){return e?typeof e=="number"&&!Number.isNaN(e):!1}const Sut=Ie.createContext({latestIndex:0}),MGn=Sut.Provider,RGn=e=>{const{className:t,prefix:n,index:r,children:o,separator:i,style:s,classNames:l,styles:c}=e,{latestIndex:u}=f.useContext(Sut);return ll(o)?f.createElement(f.Fragment,null,f.createElement("div",{className:t,style:s},o),r{const{componentCls:t,antCls:n}=e;return{[t]:{display:"inline-flex","&-rtl":{direction:"rtl"},"&-vertical":{flexDirection:"column"},"&-align":{flexDirection:"column","&-center":{alignItems:"center"},"&-start":{alignItems:"flex-start"},"&-end":{alignItems:"flex-end"},"&-baseline":{alignItems:"baseline"}},[`${t}-item:empty`]:{display:"none"},[`${t}-item > ${n}-badge-not-a-wrapper:only-child`]:{display:"block"}}}},$Gn=e=>{const{componentCls:t}=e;return{[t]:{"&-gap-row-small":{rowGap:e.spaceGapSmallSize},"&-gap-row-middle":{rowGap:e.spaceGapMiddleSize},"&-gap-row-large":{rowGap:e.spaceGapLargeSize},"&-gap-col-small":{columnGap:e.spaceGapSmallSize},"&-gap-col-middle":{columnGap:e.spaceGapMiddleSize},"&-gap-col-large":{columnGap:e.spaceGapLargeSize}}}},DGn=ui("Space",e=>{const t=Ho(e,{spaceGapSmallSize:e.paddingXS,spaceGapMiddleSize:e.padding,spaceGapLargeSize:e.paddingLG});return[OGn(t),$Gn(t)]},()=>({}),{resetStyle:!1}),LGn=f.forwardRef((e,t)=>{const{getPrefixCls:n,direction:r,size:o,className:i,style:s,classNames:l,styles:c}=Zo("space"),{size:u=o??"small",align:d,className:p,rootClassName:h,children:m,direction:g,orientation:y,prefixCls:x,split:v,separator:b,style:w,vertical:S,wrap:C=!1,classNames:N,styles:j,...I}=e,[_,T]=Array.isArray(u)?u:[u,u],P=oDe(T),E=oDe(_),M=iDe(T),R=iDe(_),$=Bu(m,{keepEmpty:!0}),[D,z]=MK(y,S,g),V=d===void 0&&!z?"center":d,B=b??v,G=n("space",x),[H,F]=DGn(G),W={...e,size:u,orientation:D,align:V},[U,K]=di([l,N],[c,j],{props:W}),X=be(G,i,H,`${G}-${D}`,{[`${G}-rtl`]:r==="rtl",[`${G}-align-${V}`]:V,[`${G}-gap-row-${T}`]:P,[`${G}-gap-col-${_}`]:E},p,h,F,U.root),J=be(`${G}-item`,U.item),te=$.map((ae,oe)=>{const ue=(ae==null?void 0:ae.key)||`${J}-${oe}`;return f.createElement(RGn,{prefix:G,classNames:U,styles:K,className:J,key:ue,index:oe,separator:B,style:K.item},ae)}),re=f.useMemo(()=>({latestIndex:$.reduce((oe,ue,fe)=>ll(ue)?fe:oe,0)}),[$]);if($.length===0)return null;const ce={};return C&&(ce.flexWrap="wrap"),!E&&R&&(ce.columnGap=_),!P&&M&&(ce.rowGap=T),f.createElement("div",{ref:t,className:X,style:{...ce,...K.root,...s,...w},...I},f.createElement(MGn,{value:re},te))}),m0=LGn;m0.Compact=Yat;m0.Addon=OWn;const Cut=e=>{const{getPopupContainer:t,getPrefixCls:n,direction:r}=f.useContext(Qr),{prefixCls:o,type:i="default",danger:s,disabled:l,loading:c,onClick:u,htmlType:d,children:p,className:h,menu:m,arrow:g,autoFocus:y,trigger:x,align:v,open:b,onOpenChange:w,placement:S,getPopupContainer:C,href:N,icon:j=f.createElement(cve,null),title:I,buttonsRender:_=ce=>ce,mouseEnterDelay:T,mouseLeaveDelay:P,overlayClassName:E,overlayStyle:M,destroyOnHidden:R,destroyPopupOnHide:$,dropdownRender:D,popupRender:z,...V}=e,B=n("dropdown",o),G=`${B}-button`,F={menu:m,arrow:g,autoFocus:y,align:v,disabled:l,trigger:l?[]:x,onOpenChange:w,getPopupContainer:C||t,mouseEnterDelay:T,mouseLeaveDelay:P,classNames:{root:E},styles:{root:M},destroyOnHidden:R,popupRender:z||D},{compactSize:W,compactItemClassnames:U}=Zw(B,r),K=be(G,U,h);"destroyPopupOnHide"in e&&(F.destroyPopupOnHide=$),"open"in e&&(F.open=b),"placement"in e?F.placement=S:F.placement=r==="rtl"?"bottomLeft":"bottomRight";const X=f.createElement(Ls,{type:i,danger:s,disabled:l,loading:c,onClick:u,htmlType:d,href:N,title:I},p),J=f.createElement(Ls,{type:i,danger:s,icon:j}),[te,re]=_([X,J]);return f.createElement(m0.Compact,{className:K,size:W,block:!0,...V},te,f.createElement(XK,{...F},re))};Cut.__ANT_BUTTON=!0;const Ive=XK;Ive.Button=Cut;const FGn=e=>ll(e)?typeof e=="object"&&!f.isValidElement(e)?e:{title:e}:null;function XU(e){const[t,n]=f.useState(e);return f.useEffect(()=>{const r=setTimeout(()=>{n(e)},e.length?0:10);return()=>{clearTimeout(r)}},[e]),t}const zGn=e=>{const{componentCls:t}=e,n=`${t}-show-help`,r=`${t}-show-help-item`;return{[n]:{transition:`opacity ${e.motionDurationFast} ${e.motionEaseInOut}`,"&-appear, &-enter":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}},[r]:{overflow:"hidden",transition:`height ${e.motionDurationFast} ${e.motionEaseInOut}, opacity ${e.motionDurationFast} ${e.motionEaseInOut}, transform ${e.motionDurationFast} ${e.motionEaseInOut} !important`,[`&${r}-appear, &${r}-enter`]:{transform:"translateY(-5px)",opacity:0,"&-active":{transform:"translateY(0)",opacity:1}},[`&${r}-leave-active`]:{transform:"translateY(-5px)"}}}}},BGn=e=>({legend:{display:"block",width:"100%",marginBottom:e.marginLG,padding:0,color:e.colorTextDescription,fontSize:e.fontSizeLG,lineHeight:"inherit",border:0,borderBottom:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`},'input[type="search"]':{boxSizing:"border-box"},'input[type="radio"], input[type="checkbox"]':{lineHeight:"normal"},'input[type="file"]':{display:"block"},'input[type="range"]':{display:"block",width:"100%"},"select[multiple], select[size]":{height:"auto"},"input[type='file']:focus,\n input[type='radio']:focus,\n input[type='checkbox']:focus":{outline:0,boxShadow:`0 0 0 ${Xe(e.controlOutlineWidth)} ${e.controlOutline}`},output:{display:"block",paddingTop:15,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight}}),aDe=(e,t)=>{const{formItemCls:n}=e;return{[n]:{[`${n}-label > label`]:{height:t},[`${n}-control-input`]:{minHeight:t}}}},HGn=e=>{const{componentCls:t}=e;return{[e.componentCls]:{...Ii(e),...BGn(e),[`${t}-text`]:{display:"inline-block",paddingInlineEnd:e.paddingSM},"&-small":{...aDe(e,e.controlHeightSM)},"&-large":{...aDe(e,e.controlHeightLG)}}}},VGn=e=>{const{formItemCls:t,iconCls:n,rootPrefixCls:r,antCls:o,labelRequiredMarkColor:i,labelColor:s,labelFontSize:l,labelHeight:c,labelColonMarginInlineStart:u,labelColonMarginInlineEnd:d,itemMarginBottom:p}=e,[h]=bi(o,"grid");return{[t]:{...Ii(e),marginBottom:p,verticalAlign:"top","&-with-help":{transition:"none"},[`&-hidden, &-hidden${o}-row`]:{display:"none"},"&-has-warning":{[`${t}-split`]:{color:e.colorError}},"&-has-error":{[`${t}-split`]:{color:e.colorWarning}},[`${t}-label`]:{flexGrow:0,overflow:"hidden",whiteSpace:"nowrap",textAlign:"end",verticalAlign:"middle","&-left":{textAlign:"start"},"&-wrap":{overflow:"unset",lineHeight:e.lineHeight,whiteSpace:"unset","> label":{verticalAlign:"middle",textWrap:"balance"}},"> label":{position:"relative",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:c,color:s,fontSize:l,[`> ${n}`]:{fontSize:e.fontSize,verticalAlign:"top"},[`&${t}-required`]:{"&::before":{display:"inline-block",marginInlineEnd:e.marginXXS,color:i,fontSize:e.fontSize,fontFamily:"SimSun, sans-serif",lineHeight:1,content:'"*"'},[`&${t}-required-mark-hidden, &${t}-required-mark-optional`]:{"&::before":{display:"none"}}},[`${t}-optional`]:{display:"inline-block",marginInlineStart:e.marginXXS,color:e.colorTextDescription,[`&${t}-required-mark-hidden`]:{display:"none"}},[`${t}-tooltip`]:{color:e.colorTextDescription,cursor:"help",writingMode:"horizontal-tb",marginInlineStart:e.marginXXS},"&::after":{content:'":"',position:"relative",marginBlock:0,marginInlineStart:u,marginInlineEnd:d},[`&${t}-no-colon::after`]:{content:'"\\a0"'}}},[`${t}-control`]:{[h("display")]:"flex",flexDirection:"column",flexGrow:1,[`&:first-child:not([class^="'${r}-col-'"]):not([class*="' ${r}-col-'"])`]:{width:"100%"},"&-input":{position:"relative",display:"flex",alignItems:"center",minHeight:e.controlHeight,"&-content":{flex:"auto",maxWidth:"100%",[`&:has(> ${o}-switch:only-child, > ${o}-rate:only-child)`]:{display:"flex",alignItems:"center"}}}},[t]:{"&-additional":{display:"flex",flexDirection:"column"},"&-explain, &-extra":{clear:"both",color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight},"&-explain-connected":{width:"100%"},"&-extra":{minHeight:e.controlHeightSM,transition:`color ${e.motionDurationMid} ${e.motionEaseOut}`},"&-explain":{"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning}}},[`&-with-help ${t}-explain`]:{height:"auto",opacity:1},[`${t}-feedback-icon`]:{fontSize:e.fontSize,textAlign:"center",visibility:"visible",animationName:zye,animationDuration:e.motionDurationMid,animationTimingFunction:e.motionEaseOutBack,pointerEvents:"none","&-success":{color:e.colorSuccess},"&-error":{color:e.colorError},"&-warning":{color:e.colorWarning},"&-validating":{color:e.colorPrimary}}}}},Dj=e=>({padding:e.verticalLabelPadding,margin:e.verticalLabelMargin,whiteSpace:"initial",textAlign:"start","> label":{margin:0,"&::after":{visibility:"hidden"}}}),UGn=e=>{const{antCls:t,formItemCls:n}=e;return{[`${n}-horizontal`]:{[`${n}-label`]:{flexGrow:0},[`${n}-control`]:{flex:"1 1 0",minWidth:0},[`${n}-label[class$='-24'], ${n}-label[class*='-24 ']`]:{[`& + ${n}-control`]:{minWidth:"unset"}},[`${t}-col-24${n}-label, ${t}-col-xl-24${n}-label`]:Dj(e)}}},WGn=e=>{const{componentCls:t,formItemCls:n,inlineItemMarginBottom:r}=e;return{[`${t}-inline`]:{display:"flex",flexWrap:"wrap",[`${n}-inline`]:{flex:"none",marginInlineEnd:e.margin,marginBottom:r,"&-row":{flexWrap:"nowrap"},[`> ${n}-label, > ${n}-control`]:{display:"inline-block",verticalAlign:"top"},[`> ${n}-label`]:{flex:"none"},[`${t}-text`]:{display:"inline-block"},[`${n}-has-feedback`]:{display:"inline-block"}}}}},GGn=e=>{const{componentCls:t,formItemCls:n,rootPrefixCls:r}=e;return{[`${n} ${n}-label`]:Dj(e),[`${t}:not(${t}-inline)`]:{[n]:{flexWrap:"wrap",[`${n}-label, ${n}-control`]:{[`&:not([class*=" ${r}-col-xs"])`]:{flex:"0 0 100%",maxWidth:"100%"}}}}}},qGn=e=>{const{componentCls:t,formItemCls:n,antCls:r}=e;return{[`${n}-vertical`]:{[`${n}-row`]:{flexDirection:"column"},[`${n}-label > label`]:{height:"auto"},[`${n}-control`]:{width:"100%"},[`${n}-label, ${r}-col-24${n}-label, ${r}-col-xl-24${n}-label`]:Dj(e)},[`@media (max-width: ${Xe(e.screenXSMax)})`]:[GGn(e),{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-xs-24${n}-label`]:Dj(e)}}}],[`@media (max-width: ${Xe(e.screenSMMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-sm-24${n}-label`]:Dj(e)}}},[`@media (max-width: ${Xe(e.screenMDMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-md-24${n}-label`]:Dj(e)}}},[`@media (max-width: ${Xe(e.screenLGMax)})`]:{[t]:{[`${n}:not(${n}-horizontal)`]:{[`${r}-col-lg-24${n}-label`]:Dj(e)}}}}},KGn=e=>({labelRequiredMarkColor:e.colorError,labelColor:e.colorTextHeading,labelFontSize:e.fontSize,labelHeight:e.controlHeight,labelColonMarginInlineStart:e.marginXXS/2,labelColonMarginInlineEnd:e.marginXS,itemMarginBottom:e.marginLG,verticalLabelPadding:`0 0 ${e.paddingXS}px`,verticalLabelMargin:0,inlineItemMarginBottom:0}),Nut=(e,t)=>Ho(e,{formItemCls:`${e.componentCls}-item`,rootPrefixCls:t}),_ve=ui("Form",(e,{rootPrefixCls:t})=>{const n=Nut(e,t);return[HGn(n),VGn(n),zGn(n),UGn(n),WGn(n),qGn(n),Fye(n),zye]},KGn,{order:-1e3}),sDe=[];function Ete(e,t,n,r=0){return{key:typeof e=="string"?e:`${t}-${r}`,error:e,errorStatus:n}}const jut=({help:e,helpStatus:t,errors:n=sDe,warnings:r=sDe,className:o,fieldId:i,onVisibleChanged:s})=>{const{prefixCls:l}=f.useContext(Wye),c=`${l}-item-explain`,u=pl(l),[d,p]=_ve(l,u),h=f.useMemo(()=>AU(l),[l]),m=XU(n),g=XU(r),y=f.useMemo(()=>ll(e)?[Ete(e,"help",t)]:[].concat(go(m.map((b,w)=>Ete(b,"error","error",w))),go(g.map((b,w)=>Ete(b,"warning","warning",w)))),[e,t,m,g]),x=f.useMemo(()=>{const b={};return y.forEach(({key:w})=>{b[w]=(b[w]||0)+1}),y.map((w,S)=>({...w,key:b[w.key]>1?`${w.key}-fallback-${S}`:w.key}))},[y]),v={};return i&&(v.id=`${i}_help`),f.createElement(Kf,{motionDeadline:h.motionDeadline,motionName:`${l}-show-help`,visible:!!x.length,onVisibleChanged:s},b=>{const{className:w,style:S}=b;return f.createElement("div",{...v,className:be(c,w,p,u,o,d),style:S},f.createElement(hat,{keys:x,...AU(l),motionName:`${l}-show-help-item`,component:!1},C=>{const{key:N,error:j,errorStatus:I,className:_,style:T}=C;return f.createElement("div",{key:N,className:be(_,{[`${c}-${I}`]:I}),style:T},j)}))})},YGn=(e,t)=>{const n=f.useContext(Mp),{getPrefixCls:r,direction:o,requiredMark:i,colon:s,scrollToFirstError:l,className:c,style:u,styles:d,classNames:p}=Zo("form"),{prefixCls:h,className:m,rootClassName:g,size:y,disabled:x=n,form:v,colon:b,labelAlign:w,labelWrap:S,labelCol:C,wrapperCol:N,layout:j="horizontal",scrollToFirstError:I,requiredMark:_,onFinishFailed:T,name:P,style:E,feedbackIcons:M,variant:R,classNames:$,styles:D,...z}=e,V=ad(y),B=f.useContext(Nat),G=f.useMemo(()=>_!==void 0?_:i!==void 0?i:!0,[_,i]),H=b??s,F=r("form",h),W=pl(F),[U,K]=_ve(F,W),X={...e,size:V,disabled:x,layout:j,colon:H,requiredMark:G},[J,te]=di([p,$],[d,D],{props:X}),re=be(F,`${F}-${j}`,{[`${F}-hide-required-mark`]:G===!1,[`${F}-rtl`]:o==="rtl",[`${F}-${V}`]:V},K,W,U,c,m,g,J.root),[ce]=Mct(v),{__INTERNAL__:ae}=ce;ae.name=P;const oe=f.useMemo(()=>({name:P,labelAlign:w,labelCol:C,labelWrap:S,wrapperCol:N,layout:j,colon:H,requiredMark:G,itemRef:ae.itemRef,form:ce,feedbackIcons:M,classNames:J,styles:te}),[P,w,C,N,j,H,G,ce,M,J,te]),ue=f.useRef(null);f.useImperativeHandle(t,()=>{var ge;return{...ce,nativeElement:(ge=ue.current)==null?void 0:ge.nativeElement}});const fe=(ge,ye)=>{if(ge){let de={block:"nearest"};typeof ge=="object"&&(de={...de,...ge}),ce.scrollToField(ye,de)}},se=ge=>{if(T==null||T(ge),ge.errorFields.length){const ye=ge.errorFields[0].name;if(I!==void 0){fe(I,ye);return}l!==void 0&&fe(l,ye)}};return f.createElement(vst.Provider,{value:R},f.createElement(Oye,{disabled:x},f.createElement(bI.Provider,{value:V},f.createElement(xst,{validateMessages:B},f.createElement(Cw.Provider,{value:oe},f.createElement(yst,{status:!0},f.createElement(Lk,{id:P,...z,name:P,onFinishFailed:se,form:ce,ref:ue,style:{...te==null?void 0:te.root,...u,...E},className:re})))))))},XGn=f.forwardRef(YGn);function QGn(e){if(typeof e=="function")return e;const t=Bu(e);return t.length<=1?t[0]:t}const Eut=()=>{const{status:e,errors:t=[],warnings:n=[]}=f.useContext(mf);return{status:e,errors:t,warnings:n}};Eut.Context=mf;function JGn(e){const[t,n]=f.useState(e),r=f.useRef(null),o=f.useRef([]),i=f.useRef(!1);f.useEffect(()=>(i.current=!1,()=>{i.current=!0,Bo.cancel(r.current),r.current=null}),[]);function s(l){i.current||(r.current===null&&(o.current=[],r.current=Bo(()=>{r.current=null,n(c=>{let u=c;return o.current.forEach(d=>{u=d(u)}),u})})),o.current.push(l))}return[t,s]}function ZGn(){const{itemRef:e}=f.useContext(Cw),t=f.useRef({});function n(r,o){const i=o&&typeof o=="object"&&Xw(o),s=r.join("_");return(t.current.name!==s||t.current.originRef!==i)&&(t.current.name=s,t.current.originRef=i,t.current.ref=zd(e(r),i)),t.current.ref}return n}const eqn=e=>{const{formItemCls:t}=e;return{"@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none)":{[`${t}-control`]:{display:"flex"}}}},tqn=d5(["Form","item-item"],(e,{rootPrefixCls:t})=>{const n=Nut(e,t);return eqn(n)}),nqn=24,rqn=e=>{const{prefixCls:t,status:n,labelCol:r,wrapperCol:o,children:i,errors:s,warnings:l,_internalItemRender:c,extra:u,help:d,fieldId:p,marginBottom:h,onErrorVisibleChanged:m,label:g}=e,y=`${t}-item`,x=f.useContext(Cw),{classNames:v,styles:b}=x,w=f.useMemo(()=>{let D={...o||x.wrapperCol||{}};return g===null&&!r&&!o&&x.labelCol&&[void 0,"xs","sm","md","lg","xl","xxl"].forEach(V=>{const B=V?[V]:[],G=Cp(x.labelCol,B),H=typeof G=="object"?G:{},F=Cp(D,B),W=typeof F=="object"?F:{};"span"in H&&!("offset"in W)&&H.span{const{labelCol:D,wrapperCol:z,...V}=x;return V},[x]),N=f.useRef(null),[j,I]=f.useState(0);Po(()=>{u&&N.current?I(N.current.clientHeight):I(0)},[u]);const _=f.createElement("div",{className:`${y}-control-input`},f.createElement("div",{className:be(`${y}-control-input-content`,v==null?void 0:v.content),style:b==null?void 0:b.content},i)),T=f.useMemo(()=>({prefixCls:t,status:n}),[t,n]),P=h!==null||s.length||l.length?f.createElement(Wye.Provider,{value:T},f.createElement(jut,{fieldId:p,errors:s,warnings:l,help:d,helpStatus:n,className:`${y}-explain-connected`,onVisibleChanged:m})):null,E={};p&&(E.id=`${p}_extra`);const M=u?f.createElement("div",{...E,className:`${y}-extra`,ref:N},u):null,R=P||M?f.createElement("div",{className:`${y}-additional`,style:h?{minHeight:h+j}:{}},P,M):null,$=c&&c.mark==="pro_table_render"&&c.render?c.render(e,{input:_,errorList:P,extra:M}):f.createElement(f.Fragment,null,_,R);return f.createElement(Cw.Provider,{value:C},f.createElement(dc,{...w,className:S},$),f.createElement(tqn,{prefixCls:t}))};var oqn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"};function jue(){return jue=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,jue({},e,{ref:t,icon:oqn})),aqn=f.forwardRef(iqn),sqn=({prefixCls:e,label:t,htmlFor:n,labelCol:r,labelAlign:o,colon:i,required:s,requiredMark:l,tooltip:c,vertical:u})=>{var R;const[d]=xg("Form"),{labelAlign:p,labelCol:h,labelWrap:m,colon:g,classNames:y,styles:x}=f.useContext(Cw);if(!t)return null;const v=r||h||{},b=o||p,w=`${e}-item-label`,S=be(w,b==="left"&&`${w}-left`,v.className,{[`${w}-wrap`]:!!m});let C=t;const N=i===!0||g!==!1&&i!==!1;N&&!u&&typeof t=="string"&&t.trim()&&(C=t.replace(/[:|:]\s*$/,""));const I=FGn(c);if(I){const{icon:$=f.createElement(aqn,null),...D}=I,z=f.createElement(pf,{...D},f.cloneElement($,{className:`${e}-item-tooltip`,title:"",onClick:V=>{V.preventDefault()},tabIndex:null}));C=f.createElement(f.Fragment,null,C,z)}const _=l==="optional",T=typeof l=="function",P=l===!1;T?C=l(C,{required:!!s}):_&&!s&&(C=f.createElement(f.Fragment,null,C,f.createElement("span",{className:`${e}-item-optional`,title:""},(d==null?void 0:d.optional)||((R=xy.Form)==null?void 0:R.optional))));let E;P?E="hidden":(_||T)&&(E="optional");const M=be(y==null?void 0:y.label,{[`${e}-item-required`]:s,[`${e}-item-required-mark-${E}`]:E,[`${e}-item-no-colon`]:!N});return f.createElement(dc,{...v,className:S},f.createElement("label",{htmlFor:n,className:M,style:x==null?void 0:x.label,title:typeof t=="string"?t:""},C))},lqn={success:$k,warning:JL,error:aN,validating:MC};function Iut({children:e,errors:t,warnings:n,hasFeedback:r,validateStatus:o,prefixCls:i,meta:s,noStyle:l,name:c}){const u=`${i}-item`,{feedbackIcons:d}=f.useContext(Cw),p=kct(t,n,s,null,!!r,o),{isFormItemInput:h,status:m,hasFeedback:g,feedbackIcon:y,name:x}=f.useContext(mf),v=f.useMemo(()=>{var S;let b;if(r){const C=r!==!0&&r.icons||d,N=p&&((S=C==null?void 0:C({status:p,errors:t,warnings:n}))==null?void 0:S[p]),j=p?lqn[p]:null;b=N!==!1&&j?f.createElement("span",{className:be(`${u}-feedback-icon`,`${u}-feedback-icon-${p}`)},N||f.createElement(j,null)):null}const w={status:p||"",errors:t,warnings:n,hasFeedback:!!r,feedbackIcon:b,isFormItemInput:!0,name:c};return l&&(w.status=(p??m)||"",w.isFormItemInput=h,w.hasFeedback=!!(r??g),w.feedbackIcon=r!==void 0?w.feedbackIcon:y,w.name=c??x),w},[p,r,l,h,m]);return f.createElement(mf.Provider,{value:v},e)}function cqn(e){const{prefixCls:t,className:n,rootClassName:r,style:o,help:i,errors:s,warnings:l,validateStatus:c,meta:u,hasFeedback:d,hidden:p,children:h,fieldId:m,required:g,isRequired:y,onSubItemMetaChange:x,layout:v,name:b,...w}=e,S=`${t}-item`,{requiredMark:C,layout:N}=f.useContext(Cw),j=v||N,I=j==="vertical",_=f.useRef(null),T=XU(s),P=XU(l),E=ll(i),M=!!(E||s.length||l.length),R=!!_.current&&Dk(_.current),[$,D]=f.useState(null);Po(()=>{if(M&&_.current){const H=getComputedStyle(_.current);D(Number.parseInt(H.marginBottom,10))}},[M,R]);const z=H=>{H||D(null)},B=((H=!1)=>{const F=H?T:u.errors,W=H?P:u.warnings;return kct(F,W,u,"",!!d,c)})(),G=be(S,n,r,{[`${S}-with-help`]:E||T.length||P.length,[`${S}-has-feedback`]:B&&d,[`${S}-has-success`]:B==="success",[`${S}-has-warning`]:B==="warning",[`${S}-has-error`]:B==="error",[`${S}-is-validating`]:B==="validating",[`${S}-hidden`]:p,[`${S}-${j}`]:j});return f.createElement("div",{className:G,style:o,ref:_},f.createElement(Sv,{className:`${S}-row`,...za(w,["_internalItemRender","colon","dependencies","extra","fieldKey","getValueFromEvent","getValueProps","htmlFor","id","initialValue","isListField","label","labelAlign","labelCol","labelWrap","messageVariables","name","normalize","noStyle","preserve","requiredMark","rules","shouldUpdate","trigger","tooltip","validateFirst","validateTrigger","valuePropName","wrapperCol","validateDebounce"])},f.createElement(sqn,{htmlFor:m,...e,requiredMark:C,required:g??y,prefixCls:t,vertical:I}),f.createElement(rqn,{...e,...u,errors:T,warnings:P,prefixCls:t,status:B,help:i,marginBottom:$,onErrorVisibleChanged:z},f.createElement(gst.Provider,{value:x},f.createElement(Iut,{prefixCls:t,meta:u,errors:u.errors,warnings:u.warnings,hasFeedback:d,validateStatus:B,name:b},h)))),!!$&&f.createElement("div",{className:`${S}-margin-offset`,style:{marginBottom:-$}}))}const uqn="__SPLIT__";function dqn(e,t){const n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(o=>{const i=e[o],s=t[o];return i===s||typeof i=="function"||typeof s=="function"})}const fqn=f.memo(e=>e.children,(e,t)=>dqn(e.control,t.control)&&e.update===t.update&&e.childProps.length===t.childProps.length&&e.childProps.every((n,r)=>n===t.childProps[r]));function lDe(){return{errors:[],warnings:[],touched:!1,validating:!1,name:[],validated:!1}}function pqn(e){const{name:t,noStyle:n,className:r,dependencies:o,prefixCls:i,shouldUpdate:s,rules:l,children:c,required:u,label:d,messageVariables:p,trigger:h="onChange",validateTrigger:m,hidden:g,help:y,layout:x}=e,{getPrefixCls:v}=f.useContext(Qr),{name:b}=f.useContext(Cw),w=QGn(c),S=typeof w=="function",C=f.useContext(gst),{validateTrigger:N}=f.useContext(wI),j=ll(m)?m:N,I=ll(t),_=v("form",i),T=pl(_),[P,E]=_ve(_,T);Qw();const M=f.useContext(p$),R=f.useRef(null),[$,D]=JGn({}),[z,V]=n$(()=>lDe()),B=X=>{const J=M==null?void 0:M.getKey(X.name);if(V(X.destroy?lDe():X,!0),n&&y!==!1&&C){let te=X.name;if(X.destroy)te=R.current||te;else if(J!==void 0){const[re,ce]=J;te=[re].concat(go(ce)),R.current=te}C(X,te)}},G=(X,J)=>{D(te=>{const re={...te},ae=[].concat(go(X.name.slice(0,-1)),go(J)).join(uqn);return X.destroy?delete re[ae]:re[ae]=X,re})},[H,F]=f.useMemo(()=>{const X=go(z.errors),J=go(z.warnings);return Object.values($).forEach(te=>{X.push.apply(X,go(te.errors||[])),J.push.apply(J,go(te.warnings||[]))}),[X,J]},[$,z.errors,z.warnings]),W=ZGn();function U(X,J,te){return n&&!g?f.createElement(Iut,{prefixCls:_,hasFeedback:e.hasFeedback,validateStatus:e.validateStatus,meta:z,errors:H,warnings:F,noStyle:!0,name:t},X):f.createElement(cqn,{key:"row",...e,className:be(r,E,T,P),prefixCls:_,fieldId:J,isRequired:te,errors:H,warnings:F,meta:z,onSubItemMetaChange:G,layout:x,name:t},X)}if(!I&&!S&&!o)return U(w);let K={};return typeof d=="string"?K.label=d:t&&(K.label=String(t)),p&&(K={...K,...p}),f.createElement(Vye,{...e,messageVariables:K,trigger:h,validateTrigger:j,onMetaChange:B},(X,J,te)=>{const re=MO(t).length&&J?J.name:[],ce=Tct(re,b),ae=u!==void 0?u:!!(l!=null&&l.some(fe=>{if(fe&&typeof fe=="object"&&fe.required&&!fe.warningOnly)return!0;if(typeof fe=="function"){const se=fe(te);return(se==null?void 0:se.required)&&!(se!=null&&se.warningOnly)}return!1})),oe={...X};let ue=null;if(Array.isArray(w)&&I)ue=w;else if(!(S&&(!(s||o)||I))){if(!(o&&!S&&!I))if(f.isValidElement(w)){const fe={...w.props,...oe};if(fe.id||(fe.id=ce),y||H.length>0||F.length>0||e.extra){const ye=[];(y||H.length>0)&&ye.push(`${ce}_help`),e.extra&&ye.push(`${ce}_extra`),fe["aria-describedby"]=ye.join(" ")}H.length>0&&(fe["aria-invalid"]="true"),ae&&(fe["aria-required"]="true"),pb(w)&&(fe.ref=W(re,w)),new Set([].concat(go(MO(h)),go(MO(j)))).forEach(ye=>{fe[ye]=(...de)=>{var Ne,_e,xe;(Ne=oe[ye])==null||Ne.call(oe,...de),(xe=(_e=w.props)[ye])==null||xe.call(_e,...de)}});const ge=[fe["aria-required"],fe["aria-invalid"],fe["aria-describedby"]];ue=f.createElement(fqn,{control:oe,update:w,childProps:ge},Fc(w,fe))}else S&&(s||o)&&!I?ue=w(te):ue=w}return U(ue,ce,ae)})}const _ut=pqn;_ut.useStatus=Eut;const hqn=({prefixCls:e,children:t,...n})=>{const{getPrefixCls:r}=f.useContext(Qr),o=r("form",e),i=f.useMemo(()=>({prefixCls:o,status:"error"}),[o]);return f.createElement(pst,{...n},(s,l,c)=>f.createElement(Wye.Provider,{value:i},t(s.map(u=>({...u,fieldKey:u.key})),l,{errors:c.errors,warnings:c.warnings})))};function mqn(){const{form:e}=f.useContext(Cw);return e}const nm=XGn;nm.Item=_ut;nm.List=hqn;nm.ErrorList=jut;nm.useForm=Mct;nm.useFormInstance=mqn;nm.useWatch=mst;nm.Provider=xst;const gqn=e=>{const{getPrefixCls:t,direction:n}=f.useContext(Qr),{prefixCls:r,className:o}=e,i=t("input-group",r),s=t("input"),[l,c]=qct(s),u=be(i,c,{[`${i}-lg`]:e.size==="large",[`${i}-sm`]:e.size==="small",[`${i}-compact`]:e.compact,[`${i}-rtl`]:n==="rtl"},l,o),d=f.useContext(mf),p=f.useMemo(()=>({...d,isFormItemInput:!1}),[d]);return f.createElement(mf.Provider,{value:p},f.createElement(m0.Compact,{className:u,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},e.children))},xqn=e=>{const{componentCls:t,paddingXS:n}=e;return{[t]:{display:"inline-flex",alignItems:"center",flexWrap:"nowrap",columnGap:n,[`${t}-input-wrapper`]:{position:"relative",[`${t}-mask-icon`]:{position:"absolute",zIndex:"1",top:"50%",right:"50%",transform:"translate(50%, -50%)",pointerEvents:"none"},[`${t}-mask-input`]:{color:"transparent",caretColor:e.colorText},[`${t}-mask-input[type=number]::-webkit-inner-spin-button`]:{"-webkit-appearance":"none",margin:0},[`${t}-mask-input[type=number]`]:{"-moz-appearance":"textfield"}},"&-rtl":{direction:"rtl"},[`${t}-input`]:{textAlign:"center",paddingInline:e.paddingXXS},[`&${t}-sm ${t}-input`]:{paddingInline:e.calc(e.paddingXXS).div(2).equal()},[`&${t}-lg ${t}-input`]:{paddingInline:e.paddingXS}}}},yqn=ui(["Input","OTP"],e=>{const t=Ho(e,Gk(e));return xqn(t)},qk),vqn=f.forwardRef((e,t)=>{const{className:n,value:r,onChange:o,onActiveChange:i,index:s,mask:l,onFocus:c,...u}=e,{getPrefixCls:d}=f.useContext(Qr),p=d("otp"),h=typeof l=="string"?l:r,m=f.useRef(null);f.useImperativeHandle(t,()=>m.current);const g=b=>{o(s,b.target.value)},y=()=>{Bo(()=>{var w;const b=(w=m.current)==null?void 0:w.input;document.activeElement===b&&b&&b.select()})},x=b=>{c==null||c(b),y()},v=b=>{const{key:w,ctrlKey:S,metaKey:C}=b;w==="ArrowLeft"?i(s-1):w==="ArrowRight"?i(s+1):w==="z"&&(S||C)?b.preventDefault():w==="Backspace"&&!r&&i(s-1),y()};return f.createElement("span",{className:`${p}-input-wrapper`,role:"presentation"},l&&r!==""&&r!==void 0&&f.createElement("span",{className:`${p}-mask-icon`,"aria-hidden":"true"},h),f.createElement(g6,{"aria-label":`OTP Input ${s+1}`,type:l===!0?"password":"text",...u,ref:m,value:r,onInput:g,onFocus:x,onKeyDown:v,onMouseDown:y,onMouseUp:y,className:be(n,{[`${p}-mask-input`]:l})}))});function C7(e){return(e||"").split("")}const bqn=e=>{const{index:t,prefixCls:n,separator:r,className:o,style:i}=e,s=typeof r=="function"?r(t):r;return s?f.createElement("span",{className:be(`${n}-separator`,o),style:i},s):null},wqn=f.forwardRef((e,t)=>{const{prefixCls:n,length:r=6,size:o,defaultValue:i,value:s,onChange:l,formatter:c,separator:u,variant:d,disabled:p,status:h,autoFocus:m,mask:g,type:y,onInput:x,onFocus:v,inputMode:b,classNames:w,styles:S,className:C,style:N,...j}=e,{classNames:I,styles:_,getPrefixCls:T,direction:P,style:E,className:M}=Zo("otp"),R=T("otp",n),$={...e,length:r},[D,z]=di([I,w],[_,S],{props:$}),V=fl(j,{aria:!0,data:!0,attr:!0}),[B,G]=yqn(R),H=ad(ge=>o??ge),F=f.useContext(mf),W=Fk(F.status,h),U=f.useMemo(()=>({...F,status:W,hasFeedback:!1,feedbackIcon:null}),[F,W]),K=f.useRef(null),X=f.useRef({});f.useImperativeHandle(t,()=>({focus:()=>{var ge;(ge=X.current[0])==null||ge.focus()},blur:()=>{var ge;for(let ye=0;yec?c(ge):ge,[te,re]=f.useState(()=>C7(J(i||"")));f.useEffect(()=>{s!==void 0&&re(C7(s))},[s]);const ce=Vr(ge=>{re(ge),x&&x(ge),l&&ge.length===r&&ge.every(ye=>ye)&&ge.some((ye,de)=>te[de]!==ye)&&l(ge.join(""))}),ae=Vr((ge,ye)=>{let de=go(te);for(let _e=0;_e=0&&!de[_e];_e-=1)de.pop();const Ne=J(de.map(_e=>_e||" ").join(""));return de=C7(Ne).map((_e,xe)=>_e===" "&&!de[xe]?de[xe]:_e),de}),oe=(ge,ye)=>{var _e;const de=ae(ge,ye),Ne=Math.min(ge+ye.length,r-1);Ne!==ge&&de[ge]!==void 0&&((_e=X.current[Ne])==null||_e.focus()),ce(de)},ue=ge=>{var ye;(ye=X.current[ge])==null||ye.focus()},fe=(ge,ye)=>{var de,Ne,_e;for(let xe=0;xe{const de=`otp-${ye}`,Ne=te[ye]||"";return f.createElement(f.Fragment,{key:de},f.createElement(vqn,{ref:_e=>{X.current[ye]=_e},index:ye,size:H,htmlSize:1,className:be(D.input,`${R}-input`),style:z.input,onChange:oe,value:Ne,onActiveChange:ue,autoFocus:ye===0&&m,onFocus:_e=>fe(_e,ye),...se}),yef.createElement(bo,Eue({},e,{ref:t,icon:Sqn})),Nqn=f.forwardRef(Cqn);var jqn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"};function Iue(){return Iue=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Iue({},e,{ref:t,icon:jqn})),Pve=f.forwardRef(Eqn),Iqn=e=>e?f.createElement(Pve,null):f.createElement(Nqn,null),_qn={click:"onClick",hover:"onMouseOver"},Pqn=f.forwardRef((e,t)=>{const{disabled:n,action:r="click",visibilityToggle:o=!0,iconRender:i=Iqn,suffix:s}=e,l=f.useContext(Mp),c=n??l,u=typeof o=="object"&&o.visible!==void 0,[d,p]=f.useState(()=>u?o.visible:!1),h=f.useRef(null);f.useEffect(()=>{u&&p(o.visible)},[u,o]);const m=uut(h),g=()=>{var E;if(c)return;d&&m();const P=!d;p(P),typeof o=="object"&&((E=o.onVisibleChange)==null||E.call(o,P))},y=P=>{const E=_qn[r]||"",M=i(d),R={[E]:g,className:`${P}-icon`,key:"passwordIcon",onMouseDown:$=>{$.preventDefault()},onMouseUp:$=>{$.preventDefault()}};return f.cloneElement(f.isValidElement(M)?M:f.createElement("span",null,M),R)},{className:x,prefixCls:v,inputPrefixCls:b,size:w,...S}=e,{getPrefixCls:C}=f.useContext(Qr),N=C("input",b),j=C("input-password",v),I=o&&y(j),_=be(j,x,{[`${j}-${w}`]:!!w}),T={...za(S,["suffix","iconRender","visibilityToggle"]),type:d?"text":"password",className:_,prefixCls:N,suffix:f.createElement(f.Fragment,null,I,s)};return w&&(T.size=w),f.createElement(g6,{ref:zd(t,h),...T})}),Aqn=e=>{const{componentCls:t}=e,n=`${t}-btn`;return{[t]:{width:"100%",[n]:{"&-filled":{background:e.colorFillTertiary,"&:not(:disabled)":{"&:hover":{background:e.colorFillSecondary},"&:active":{background:e.colorFill}}}}}}},Tqn=ui(["Input","Search"],e=>[Aqn(e)]),kqn=f.forwardRef((e,t)=>{const{prefixCls:n,inputPrefixCls:r,className:o,size:i,style:s,enterButton:l=!1,addonAfter:c,loading:u,disabled:d,onSearch:p,onChange:h,onCompositionStart:m,onCompositionEnd:g,variant:y,onPressEnter:x,classNames:v,styles:b,hidden:w,...S}=e,{direction:C,getPrefixCls:N,classNames:j,styles:I}=Zo("inputSearch"),_={...e,enterButton:l},[T,P]=di([j,v],[I,b],{props:_},{button:{_default:"root"}}),E=f.useRef(!1),M=N("input-search",n),R=N("input",r),[$,D]=Tqn(M),{compactSize:z}=Zw(M,C),V=ad(se=>i??z??se),B=f.useRef(null),G=se=>{se!=null&&se.target&&se.type==="click"&&p&&p(se.target.value,se,{source:"clear"}),h==null||h(se)},H=se=>{var ge;document.activeElement===((ge=B.current)==null?void 0:ge.input)&&se.preventDefault()},F=se=>{var ge,ye;p&&p((ye=(ge=B.current)==null?void 0:ge.input)==null?void 0:ye.value,se,{source:"input"})},W=se=>{E.current||u||(x==null||x(se),F(se))},U=typeof l=="boolean"?f.createElement(zE,null):null,K=`${M}-btn`,X=be(K,{[`${K}-${y}`]:y});let J;const te=l||{},re=te.type&&te.type.__ANT_BUTTON===!0;re||te.type==="button"?J=Fc(te,{onMouseDown:H,onClick:se=>{var ge,ye;(ye=(ge=te==null?void 0:te.props)==null?void 0:ge.onClick)==null||ye.call(ge,se),F(se)},key:"enterButton",...re?{className:X,size:V}:{}}):J=f.createElement(Ls,{classNames:T.button,styles:P.button,className:X,color:l?"primary":"default",size:V,disabled:d,key:"enterButton",onMouseDown:H,onClick:F,loading:u,icon:U,variant:y==="borderless"||y==="filled"||y==="underlined"?"text":l?"solid":void 0},l),c&&(J=[J,Fc(c,{key:"addonAfter"})]);const ce=be(M,D,{[`${M}-rtl`]:C==="rtl",[`${M}-${V}`]:!!V,[`${M}-with-button`]:!!l},o,$,T.root),ae=se=>{E.current=!0,m==null||m(se)},oe=se=>{E.current=!1,g==null||g(se)},ue=fl(S,{data:!0}),fe=za({...S,classNames:za(T,["button","root"]),styles:za(P,["button","root"]),prefixCls:R,type:"search",size:V,variant:y,onPressEnter:W,onCompositionStart:ae,onCompositionEnd:oe,onChange:G,disabled:d},Object.keys(ue));return f.createElement(Yat,{className:ce,style:{...s,...P.root},...ue,hidden:w},f.createElement(g6,{ref:zd(B,t),...fe}),J)}),Mqn=` min-height:0 !important; max-height:none !important; height:0 !important; visibility:hidden !important; overflow:hidden !important; position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; pointer-events: none !important; `,Rqn=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break","white-space"],Ite={};let Fm;function Oqn(e,t=!1){const n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&Ite[n])return Ite[n];const r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),i=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),s=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),c={sizingStyle:Rqn.map(u=>`${u}:${r.getPropertyValue(u)}`).join(";"),paddingSize:i,borderSize:s,boxSizing:o};return t&&n&&(Ite[n]=c),c}function $qn(e,t=!1,n=null,r=null){Fm||(Fm=document.createElement("textarea"),Fm.setAttribute("tab-index","-1"),Fm.setAttribute("aria-hidden","true"),Fm.setAttribute("name","hiddenTextarea"),document.body.appendChild(Fm)),e.getAttribute("wrap")?Fm.setAttribute("wrap",e.getAttribute("wrap")):Fm.removeAttribute("wrap");const{paddingSize:o,borderSize:i,boxSizing:s,sizingStyle:l}=Oqn(e,t);Fm.setAttribute("style",`${l};${Mqn}`),Fm.value=e.value||e.placeholder||"";let c,u,d,p=Fm.scrollHeight;if(s==="border-box"?p+=i:s==="content-box"&&(p-=o),n!==null||r!==null){Fm.value=" ";const m=Fm.scrollHeight-o;n!==null&&(c=m*n,s==="border-box"&&(c=c+o+i),p=Math.max(c,p)),r!==null&&(u=m*r,s==="border-box"&&(u=u+o+i),d=p>u?"":"hidden",p=Math.min(u,p))}const h={height:p,overflowY:d,resize:"none"};return c&&(h.minHeight=c),u&&(h.maxHeight=u),h}function _ue(){return _ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{prefixCls:n,defaultValue:r,value:o,autoSize:i,onResize:s,className:l,style:c,disabled:u,onChange:d,onInternalAutoSize:p,...h}=e,[m,g]=Fa(r,o),y=m??"",x=$=>{g($.target.value),d==null||d($)},v=f.useRef();f.useImperativeHandle(t,()=>({textArea:v.current}));const[b,w]=f.useMemo(()=>i&&typeof i=="object"?[i.minRows,i.maxRows]:[],[i]),S=!!i,[C,N]=f.useState(Ate),[j,I]=f.useState(),_=()=>{N(_te)};Po(()=>{S&&_()},[o,b,w,S]),Po(()=>{if(C===_te)N(Pte);else if(C===Pte){const $=$qn(v.current,!1,b,w);N(Ate),I($)}},[C]);const T=f.useRef(),P=()=>{Bo.cancel(T.current)},E=$=>{C===Ate&&(s==null||s($),i&&(P(),T.current=Bo(()=>{_()})))};f.useEffect(()=>P,[]);const R={...c,...S?j:null};return(C===_te||C===Pte)&&(R.overflowY="hidden",R.overflowX="hidden"),f.createElement(Uf,{onResize:E,disabled:!(i||s)},f.createElement("textarea",_ue({},h,{ref:v,style:R,className:be(n,l,{[`${n}-disabled`]:u}),disabled:u,value:y,onChange:x})))});function Pue(){return Pue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const[P,E]=Fa(e,t),M=P==null?"":String(P),[R,$]=Ie.useState(!1),D=Ie.useRef(!1),[z,V]=Ie.useState(null),B=f.useRef(null),G=f.useRef(null),H=()=>{var we;return(we=G.current)==null?void 0:we.textArea},F=()=>{H().focus()};f.useImperativeHandle(T,()=>{var we;return{resizableTextArea:G.current,focus:F,blur:()=>{H().blur()},nativeElement:((we=B.current)==null?void 0:we.nativeElement)||H()}}),f.useEffect(()=>{$(we=>!y&&we)},[y]);const[W,U]=Ie.useState(null);Ie.useEffect(()=>{W&&H().setSelectionRange(...W)},[W]);const K=lut(h,p),X=K.max??s,J=Number(X)>0,te=K.strategy(M),re=!!X&&te>X,ce=(we,Te)=>{let Re=Te;!D.current&&K.exceedFormatter&&K.max&&K.strategy(Te)>K.max&&(Re=K.exceedFormatter(Te,{max:K.max}),Te!==Re&&U([H().selectionStart||0,H().selectionEnd||0])),E(Re),KU(we.currentTarget,we,o,Re)},ae=we=>{D.current=!0,l==null||l(we)},oe=we=>{D.current=!1,ce(we,we.currentTarget.value),c==null||c(we)},ue=we=>{ce(we,we.target.value)},fe=we=>{we.key==="Enter"&&C&&!we.nativeEvent.isComposing&&C(we),I==null||I(we)},se=we=>{$(!0),n==null||n(we)},ge=we=>{$(!1),r==null||r(we)},ye=we=>{E(""),F(),KU(H(),we,o)};let de=u,Ne;K.show&&(K.showFormatter?Ne=K.showFormatter({value:M,count:te,maxLength:X}):Ne=`${te}${J?` / ${X}`:""}`,de=Ie.createElement(Ie.Fragment,null,de,Ie.createElement("span",{className:be(`${d}-data-count`,v==null?void 0:v.count),style:b==null?void 0:b.count},Ne)));const _e=we=>{var Te;w==null||w(we),(Te=H())!=null&&Te.style.height&&V(!0)},xe=!j&&!p&&!i;return Ie.createElement(sut,{ref:B,value:M,allowClear:i,handleReset:ye,suffix:de,prefixCls:d,classNames:{...v,affixWrapper:be(v==null?void 0:v.affixWrapper,{[`${d}-show-count`]:p,[`${d}-textarea-allow-clear`]:i})},disabled:y,focused:R,className:be(m,re&&`${d}-out-of-range`),style:{...g,...z&&!xe?{height:"auto"}:{}},dataAttrs:{affixWrapper:{"data-count":typeof Ne=="string"?Ne:void 0}},hidden:x,readOnly:N,onClear:S},Ie.createElement(Dqn,Pue({},_,{autoSize:j,maxLength:s,onKeyDown:fe,onChange:ue,onFocus:se,onBlur:ge,onCompositionStart:ae,onCompositionEnd:oe,className:be(v==null?void 0:v.textarea),style:{resize:g==null?void 0:g.resize,...b==null?void 0:b.textarea},disabled:y,prefixCls:d,onResize:_e,ref:G,readOnly:N})))}),Fqn=e=>{const{componentCls:t,paddingLG:n}=e,r=`${t}-textarea`;return{[`textarea${t}`]:{maxWidth:"100%",height:"auto",minHeight:e.controlHeight,lineHeight:e.lineHeight,verticalAlign:"bottom",transition:`all ${e.motionDurationSlow}`,resize:"vertical",[`&${t}-mouse-active`]:{transition:`all ${e.motionDurationSlow}, height 0s, width 0s`}},[`${t}-textarea-affix-wrapper-resize-dirty`]:{width:"auto"},[r]:{position:"relative","&-show-count":{[`${t}-data-count`]:{position:"absolute",bottom:e.calc(e.fontSize).mul(e.lineHeight).mul(-1).equal(),insetInlineEnd:0,color:e.colorTextDescription,whiteSpace:"nowrap",pointerEvents:"none"}},[` &-allow-clear > ${t}, &-affix-wrapper${r}-has-feedback ${t} `]:{paddingInlineEnd:n},[`&-affix-wrapper${t}-affix-wrapper`]:{padding:0,[`> textarea${t}`]:{fontSize:"inherit",border:"none",outline:"none",background:"transparent",minHeight:e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(),"&:focus":{boxShadow:"none !important"}},[`${t}-suffix`]:{margin:0,"> *:not(:last-child)":{marginInline:0},[`${t}-clear-icon`]:{position:"absolute",insetInlineEnd:e.paddingInline,insetBlockStart:e.paddingXS},[`${r}-suffix`]:{position:"absolute",top:0,insetInlineEnd:e.paddingInline,bottom:0,zIndex:1,display:"inline-flex",alignItems:"center",margin:"auto",pointerEvents:"none"}}},[`&-affix-wrapper${t}-affix-wrapper-rtl`]:{[`${t}-suffix`]:{[`${t}-data-count`]:{direction:"ltr",insetInlineStart:0}}},[`&-affix-wrapper${t}-affix-wrapper-sm`]:{[`${t}-suffix`]:{[`${t}-clear-icon`]:{insetInlineEnd:e.paddingInlineSM}}}}}},zqn=ui(["Input","TextArea"],e=>{const t=Ho(e,Gk(e));return Fqn(t)},qk,{resetFont:!1}),Put=f.forwardRef((e,t)=>{var se;const{prefixCls:n,bordered:r=!0,size:o,disabled:i,status:s,allowClear:l,classNames:c,rootClassName:u,className:d,style:p,styles:h,variant:m,showCount:g,onMouseDown:y,onResize:x,...v}=e,{getPrefixCls:b,direction:w,allowClear:S,autoComplete:C,className:N,style:j,classNames:I,styles:_}=Zo("textArea"),T=f.useContext(Mp),P=i??T,{status:E,hasFeedback:M,feedbackIcon:R}=f.useContext(mf),$=Fk(E,s),[D,z]=di([I,c],[_,h],{props:e}),V=f.useRef(null);f.useImperativeHandle(t,()=>{var ge;return{resizableTextArea:(ge=V.current)==null?void 0:ge.resizableTextArea,focus:ye=>{var de,Ne;ast((Ne=(de=V.current)==null?void 0:de.resizableTextArea)==null?void 0:Ne.textArea,ye)},blur:()=>{var ye;return(ye=V.current)==null?void 0:ye.blur()}}});const B=b("input",n),G=pl(B),[H,F]=Gct(B,u);zqn(B,G);const{compactSize:W,compactItemClassnames:U}=Zw(B,w),K=ad(ge=>o??W??ge),[X,J]=zk("textArea",m,r),te=cut(l??S),[re,ce]=f.useState(!1),[ae,oe]=f.useState(!1),ue=ge=>{ce(!0),y==null||y(ge);const ye=()=>{ce(!1),document.removeEventListener("mouseup",ye)};document.addEventListener("mouseup",ye)},fe=ge=>{var ye,de;if(x==null||x(ge),re&&typeof getComputedStyle=="function"){const Ne=(de=(ye=V.current)==null?void 0:ye.nativeElement)==null?void 0:de.querySelector("textarea");Ne&&getComputedStyle(Ne).resize==="both"&&oe(!0)}};return f.createElement(Lqn,{autoComplete:C,...v,style:{...z.root,...j,...p},styles:z,disabled:P,allowClear:te,className:be(F,G,d,u,U,N,D.root,{[`${B}-textarea-affix-wrapper-resize-dirty`]:ae}),classNames:{...D,textarea:be({[`${B}-sm`]:K==="small",[`${B}-lg`]:K==="large"},H,D.textarea,re&&`${B}-mouse-active`),variant:be({[`${B}-${X}`]:J},SI(B,$)),affixWrapper:be(`${B}-textarea-affix-wrapper`,{[`${B}-affix-wrapper-rtl`]:w==="rtl",[`${B}-affix-wrapper-sm`]:K==="small",[`${B}-affix-wrapper-lg`]:K==="large",[`${B}-textarea-show-count`]:g||((se=e.count)==null?void 0:se.show)},H)},prefixCls:B,suffix:M&&f.createElement("span",{className:`${B}-textarea-suffix`},R),showCount:g,ref:V,onResize:fe,onMouseDown:ue})}),Hx=g6;Hx.Group=gqn;Hx.Search=kqn;Hx.TextArea=Put;Hx.Password=Pqn;Hx.OTP=wqn;var Bqn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"};function Aue(){return Aue=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Aue({},e,{ref:t,icon:Bqn})),cDe=f.forwardRef(Hqn);var Vqn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"};function Tue(){return Tue=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Tue({},e,{ref:t,icon:Vqn})),uDe=f.forwardRef(Uqn),Wqn={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},Gqn=[10,20,50,100],qqn=e=>{const{pageSizeOptions:t=Gqn,locale:n,changeSize:r,pageSize:o,goButton:i,quickGo:s,rootPrefixCls:l,disabled:c,buildOptionText:u,showSizeChanger:d,sizeChangerRender:p}=e,[h,m]=Ie.useState(""),g=Ie.useMemo(()=>!h||Number.isNaN(h)?void 0:Number(h),[h]),y=typeof u=="function"?u:I=>`${I} ${n.items_per_page}`,x=I=>{const _=I.target.value;/^\d*$/.test(_)&&m(_)},v=I=>{i||h===""||(m(""),!(I.relatedTarget&&(I.relatedTarget.className.includes(`${l}-item-link`)||I.relatedTarget.className.includes(`${l}-item`)))&&(s==null||s(g)))},b=I=>{h!==""&&(I.keyCode===Ir.ENTER||I.type==="click")&&(m(""),s==null||s(g))},w=()=>t.some(I=>I.toString()===o.toString())?t:t.concat([o]).sort((I,_)=>{const T=Number.isNaN(Number(I))?0:Number(I),P=Number.isNaN(Number(_))?0:Number(_);return T-P}),S=`${l}-options`;if(!d&&!s)return null;let C=null,N=null,j=null;return d&&p&&(C=p({disabled:c,size:o,onSizeChange:I=>{r==null||r(Number(I))},"aria-label":n.page_size,className:`${S}-size-changer`,options:w().map(I=>({label:y(I),value:I}))})),s&&(i&&(j=typeof i=="boolean"?Ie.createElement("button",{type:"button",onClick:b,onKeyUp:b,disabled:c,className:`${S}-quick-jumper-button`},n.jump_to_confirm):Ie.createElement("span",{onClick:b,onKeyUp:b},i)),N=Ie.createElement("div",{className:`${S}-quick-jumper`},n.jump_to,Ie.createElement("input",{disabled:c,type:"text",value:h,onChange:x,onKeyUp:b,onBlur:v,"aria-label":n.page}),n.page,j)),Ie.createElement("li",{className:S},C,N)},RM=e=>{const{rootPrefixCls:t,page:n,active:r,className:o,style:i,showTitle:s,onClick:l,onKeyPress:c,itemRender:u}=e,d=`${t}-item`,p=be(d,`${d}-${n}`,{[`${d}-active`]:r,[`${d}-disabled`]:!n},o),h=()=>{l(n)},m=y=>{c(y,l,n)},g=u(n,"page",Ie.createElement("a",{rel:"nofollow"},n));return g?Ie.createElement("li",{title:s?String(n):null,className:p,style:i,onClick:h,onKeyDown:m,tabIndex:0},g):null};function i2(){return i2=Object.assign?Object.assign.bind():function(e){for(var t=1;tn;function dDe(){}function fDe(e){const t=Number(e);return typeof t=="number"&&!Number.isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function YN(e,t,n){const r=typeof e>"u"?t:e;return Math.floor((n-1)/r)+1}const Yqn=e=>{const{prefixCls:t="rc-pagination",selectPrefixCls:n="rc-select",className:r,classNames:o,styles:i,current:s,defaultCurrent:l=1,total:c=0,pageSize:u,defaultPageSize:d=10,onChange:p=dDe,hideOnSinglePage:h,align:m,showPrevNextJumpers:g=!0,showQuickJumper:y,showLessItems:x,showTitle:v=!0,onShowSizeChange:b=dDe,locale:w=Wqn,style:S,totalBoundaryShowSizeChanger:C=50,disabled:N,simple:j,showTotal:I,showSizeChanger:_=c>C,sizeChangerRender:T,pageSizeOptions:P,itemRender:E=Kqn,jumpPrevIcon:M,jumpNextIcon:R,prevIcon:$,nextIcon:D}=e,z=Ie.useRef(null),[V,B]=Fa(d,u),[G,H]=Fa(l,s),F=Math.max(1,Math.min(G,YN(void 0,V,c))),[W,U]=Ie.useState(F);f.useEffect(()=>{U(F)},[F]);const K=Math.max(1,F-(x?3:5)),X=Math.min(YN(void 0,V,c),F+(x?3:5));function J(Et,sn){let ot=Et||Ie.createElement("button",{type:"button","aria-label":sn,className:`${t}-item-link`});return typeof Et=="function"&&(ot=Ie.createElement(Et,e)),ot}function te(Et){const sn=Et.target.value,ot=YN(void 0,V,c);let mt;return sn===""?mt=sn:Number.isNaN(Number(sn))?mt=W:sn>=ot?mt=ot:mt=Number(sn),mt}function re(Et){return fDe(Et)&&Et!==F&&fDe(c)&&c>0}const ce=c>V?y:!1;function ae(Et){(Et.keyCode===Ir.UP||Et.keyCode===Ir.DOWN)&&Et.preventDefault()}function oe(Et){const sn=te(Et);switch(sn!==W&&U(sn),Et.keyCode){case Ir.ENTER:se(sn);break;case Ir.UP:se(sn-1);break;case Ir.DOWN:se(sn+1);break}}function ue(Et){se(te(Et))}function fe(Et){const sn=YN(Et,V,c),ot=F>sn&&sn!==0?sn:F;B(Et),U(ot),b==null||b(F,Et),H(ot),p==null||p(ot,Et)}function se(Et){if(re(Et)&&!N){const sn=YN(void 0,V,c);let ot=Et;return Et>sn?ot=sn:Et<1&&(ot=1),ot!==W&&U(ot),H(ot),p==null||p(ot,V),ot}return F}const ge=F>1,ye=Fc?c:F*V]));let dt=null;const Ze=YN(void 0,V,c);if(h&&c<=V)return null;const Qe=[],lt={rootPrefixCls:t,onClick:se,onKeyPress:we,showTitle:v,itemRender:E,page:-1,className:o==null?void 0:o.item,style:i==null?void 0:i.item},bt=F-1>0?F-1:0,Ct=F+1=vt*2&&F!==3&&(Qe[0]=Ie.cloneElement(Qe[0],{className:be(`${t}-item-after-jump-prev`,Qe[0].props.className)}),Qe.unshift(Oe)),Ze-F>=vt*2&&F!==Ze-2){const Vt=Qe[Qe.length-1];Qe[Qe.length-1]=Ie.cloneElement(Vt,{className:be(`${t}-item-before-jump-next`,Vt.props.className)}),Qe.push(dt)}Ht!==1&&Qe.unshift(Ie.createElement(RM,i2({},lt,{key:1,page:1}))),jt!==Ze&&Qe.push(Ie.createElement(RM,i2({},lt,{key:Ze,page:Ze})))}let Pt=Ye(bt);if(Pt){const Et=!ge||!Ze;Pt=Ie.createElement("li",{title:v?w.prev_page:null,onClick:de,tabIndex:Et?null:0,onKeyDown:Te,className:be(`${t}-prev`,o==null?void 0:o.item,{[`${t}-disabled`]:Et}),style:i==null?void 0:i.item,"aria-disabled":Et},Pt)}let Jt=We(Ct);if(Jt){let Et,sn;j?(Et=!ye,sn=ge?0:null):(Et=!ye||!Ze,sn=Et?null:0),Jt=Ie.createElement("li",{title:v?w.next_page:null,onClick:Ne,tabIndex:sn,onKeyDown:Re,className:be(`${t}-next`,o==null?void 0:o.item,{[`${t}-disabled`]:Et}),style:i==null?void 0:i.item,"aria-disabled":Et},Jt)}const dn=be(t,r,{[`${t}-start`]:m==="start",[`${t}-center`]:m==="center",[`${t}-end`]:m==="end",[`${t}-simple`]:j,[`${t}-disabled`]:N});return Ie.createElement("ul",i2({className:dn,style:S,ref:z},Ae),qe,Pt,j?et:Qe,Jt,Ie.createElement(qqn,{locale:w,rootPrefixCls:t,disabled:N,selectPrefixCls:n,changeSize:fe,pageSize:V,pageSizeOptions:P,quickGo:ce?se:null,goButton:Me,showSizeChanger:_,sizeChangerRender:T}))},Xqn=e=>{const{componentCls:t}=e;return{[`${t}-disabled`]:{"&, &:hover":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}},"&:focus-visible":{cursor:"not-allowed",[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed"}}},[`&${t}-disabled`]:{cursor:"not-allowed",[`${t}-item`]:{cursor:"not-allowed",backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"},a:{color:e.colorTextDisabled,backgroundColor:"transparent",border:"none",cursor:"not-allowed"},"&-active":{borderColor:e.colorBorder,backgroundColor:e.itemActiveBgDisabled,"&:hover, &:active":{backgroundColor:e.itemActiveBgDisabled},a:{color:e.itemActiveColorDisabled}}},[`${t}-item-link`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:hover, &:active":{backgroundColor:"transparent"},[`${t}-simple&`]:{backgroundColor:"transparent","&:hover, &:active":{backgroundColor:"transparent"}}},[`${t}-simple-pager`]:{color:e.colorTextDisabled},[`${t}-jump-prev, ${t}-jump-next`]:{[`${t}-item-link-icon`]:{opacity:0},[`${t}-item-ellipsis`]:{opacity:1}}}}},Qqn=e=>{const{componentCls:t}=e;return{[`&${t}-small ${t}-options`]:{marginInlineStart:e.paginationMiniOptionsMarginInlineStart,"&-quick-jumper":{input:{...vve(e),width:e.paginationMiniQuickJumperInputWidth}}}}},Jqn=e=>{const{componentCls:t}=e;return{[`&${t}-large ${t}-options`]:{"&-quick-jumper":{input:{...yve(e)}}}}},Zqn=e=>{const{componentCls:t,antCls:n}=e,[,r]=bi(n,"pagination");return{[`&${t}-simple`]:{[`${t}-prev, ${t}-next`]:{height:r("item-size-actual"),lineHeight:r("item-size-actual"),verticalAlign:"top",[`${t}-item-link`]:{height:r("item-size-actual"),backgroundColor:"transparent",border:0,"&:hover":{backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive},"&::after":{height:r("item-size-actual"),lineHeight:r("item-size-actual")}}},[`${t}-simple-pager`]:{display:"inline-flex",alignItems:"center",height:r("item-size-actual"),marginInlineEnd:r("item-spacing-actual"),input:{boxSizing:"border-box",height:"100%",width:e.quickJumperInputWidth,padding:`0 ${Xe(e.paginationItemPaddingInline)}`,textAlign:"center",backgroundColor:e.itemInputBg,border:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadius,outline:"none",transition:`border-color ${e.motionDurationMid}`,color:"inherit","&:hover":{borderColor:e.colorPrimary},"&:focus":{borderColor:e.colorPrimaryHover,boxShadow:`${Xe(e.inputOutlineOffset)} 0 ${Xe(e.controlOutlineWidth)} ${e.controlOutline}`},"&[disabled]":{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,cursor:"not-allowed"}}},[`&${t}-disabled`]:{[`${t}-prev, ${t}-next`]:{[`${t}-item-link`]:{"&:hover, &:active":{backgroundColor:"transparent"}}}},[`&${t}-small`]:{[`${t}-simple-pager`]:{input:{width:e.paginationMiniQuickJumperInputWidth}}}}}},eKn=e=>{const{componentCls:t,antCls:n}=e,[,r]=bi(n,"pagination");return{[`${t}-jump-prev, ${t}-jump-next`]:{outline:0,[`${t}-item-container`]:{position:"relative",[`${t}-item-link-icon`]:{color:e.colorPrimary,fontSize:e.fontSizeSM,opacity:0,transition:`all ${e.motionDurationMid}`,"&-svg":{top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,margin:"auto"}},[`${t}-item-ellipsis`]:{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,display:"block",margin:"auto",color:e.colorTextDisabled,letterSpacing:e.paginationEllipsisLetterSpacing,textAlign:"center",textIndent:e.paginationEllipsisTextIndent,opacity:1,transition:`all ${e.motionDurationMid}`}},"&:hover":{[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0}}},[` ${t}-prev, ${t}-jump-prev, ${t}-jump-next `]:{marginInlineEnd:r("item-spacing-actual")},[` ${t}-prev, ${t}-next, ${t}-jump-prev, ${t}-jump-next `]:{display:"inline-block",minWidth:r("item-size-actual"),height:r("item-size-actual"),color:e.colorText,fontFamily:e.fontFamily,lineHeight:r("item-size-actual"),textAlign:"center",verticalAlign:"middle",listStyle:"none",borderRadius:e.borderRadius,cursor:"pointer",transition:`all ${e.motionDurationMid}`},[`${t}-prev, ${t}-next`]:{outline:0,button:{color:e.colorText,cursor:"pointer",userSelect:"none"},[`${t}-item-link`]:{display:"block",width:"100%",height:"100%",padding:0,fontSize:e.fontSizeSM,textAlign:"center",backgroundColor:"transparent",border:`${Xe(e.lineWidth)} ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:"none",transition:`all ${e.motionDurationMid}`},[`&:hover ${t}-item-link`]:{backgroundColor:e.colorBgTextHover},[`&:active ${t}-item-link`]:{backgroundColor:e.colorBgTextActive},[`&${t}-disabled:hover`]:{[`${t}-item-link`]:{backgroundColor:"transparent"}}},[`${t}-slash`]:{marginInlineEnd:e.paginationSlashMarginInlineEnd,marginInlineStart:e.paginationSlashMarginInlineStart},[`${t}-options`]:{display:"inline-block",marginInlineStart:e.margin,verticalAlign:"middle","&-size-changer":{width:"auto"},"&-quick-jumper":{display:"inline-block",height:r("item-size-actual"),marginInlineStart:e.marginXS,lineHeight:r("item-size-actual"),verticalAlign:"top",input:{...bve(e),...xve(e,{borderColor:e.colorBorder,hoverBorderColor:e.colorPrimaryHover,activeBorderColor:e.colorPrimary,activeShadow:e.activeShadow}),"&[disabled]":{...nY(e)},width:e.quickJumperInputWidth,height:r("item-size-actual"),boxSizing:"border-box",margin:0,marginInlineStart:r("item-spacing-actual"),marginInlineEnd:r("item-spacing-actual")}}}}},tKn=e=>{const{componentCls:t,antCls:n}=e,[,r]=bi(n,"pagination");return{[`${t}-item`]:{display:"inline-block",minWidth:r("item-size-actual"),height:r("item-size-actual"),marginInlineEnd:r("item-spacing-actual"),fontFamily:e.fontFamily,lineHeight:Xe(e.calc(r("item-size-actual")).sub(2).equal()),textAlign:"center",verticalAlign:"middle",listStyle:"none",backgroundColor:e.itemBg,border:`${Xe(e.lineWidth)} ${e.lineType} transparent`,borderRadius:e.borderRadius,outline:0,cursor:"pointer",userSelect:"none",a:{display:"block",padding:`0 ${Xe(e.paginationItemPaddingInline)}`,color:e.colorText,"&:hover":{textDecoration:"none"}},[`&:not(${t}-item-active)`]:{"&:hover":{transition:`all ${e.motionDurationMid}`,backgroundColor:e.colorBgTextHover},"&:active":{backgroundColor:e.colorBgTextActive}},"&-active":{fontWeight:e.fontWeightStrong,backgroundColor:e.itemActiveBg,borderColor:e.colorPrimary,a:{color:e.itemActiveColor},"&:hover":{borderColor:e.colorPrimaryHover},"&:hover a":{color:e.itemActiveColorHover}}}}},nKn=e=>{const{componentCls:t,antCls:n}=e,[r,o]=bi(n,"pagination");return{[t]:{[r("item-size-actual")]:Xe(e.itemSize),[r("item-spacing-actual")]:Xe(e.marginXS),"&-small":{[r("item-size-actual")]:Xe(e.itemSizeSM),[r("item-spacing-actual")]:Xe(e.marginXXS)},"&-large":{[r("item-size-actual")]:Xe(e.itemSizeLG),[r("item-spacing-actual")]:Xe(e.marginSM)},...Ii(e),display:"flex","&-start":{justifyContent:"start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"end"},"ul, ol":{margin:0,padding:0,listStyle:"none"},"&::after":{display:"block",clear:"both",height:0,overflow:"hidden",visibility:"hidden",content:'""'},[`${t}-total-text`]:{display:"inline-block",height:o("item-size-actual"),marginInlineEnd:o("item-spacing-actual"),lineHeight:Xe(e.calc(o("item-size-actual")).sub(2).equal()),verticalAlign:"middle"},...tKn(e),...eKn(e),...Zqn(e),...Qqn(e),...Jqn(e),...Xqn(e),[`@media only screen and (max-width: ${e.screenLG}px)`]:{[`${t}-item`]:{"&-after-jump-prev, &-before-jump-next":{display:"none"}}},[`@media only screen and (max-width: ${e.screenSM}px)`]:{[`${t}-options`]:{display:"none"}}},[`&${e.componentCls}-rtl`]:{direction:"rtl"}}},rKn=e=>{const{componentCls:t}=e;return{[`${t}:not(${t}-disabled)`]:{[`${t}-item`]:{...gy(e)},[`${t}-jump-prev, ${t}-jump-next`]:{"&:focus-visible":{[`${t}-item-link-icon`]:{opacity:1},[`${t}-item-ellipsis`]:{opacity:0},...my(e)}},[`${t}-prev, ${t}-next`]:{[`&:focus-visible ${t}-item-link`]:my(e)}}}},Aut=e=>({itemBg:e.colorBgContainer,itemSize:e.controlHeight,itemSizeSM:e.controlHeightSM,itemSizeLG:e.controlHeightLG,itemActiveBg:e.colorBgContainer,itemActiveColor:e.colorPrimary,itemActiveColorHover:e.colorPrimaryHover,itemLinkBg:e.colorBgContainer,itemActiveColorDisabled:e.colorTextDisabled,itemActiveBgDisabled:e.controlItemBgActiveDisabled,itemInputBg:e.colorBgContainer,miniOptionsSizeChangerTop:0,...qk(e)}),Tut=e=>Ho(e,{inputOutlineOffset:0,quickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.25).equal(),paginationMiniOptionsMarginInlineStart:e.calc(e.marginXXS).div(2).equal(),paginationMiniQuickJumperInputWidth:e.calc(e.controlHeightLG).mul(1.1).equal(),paginationItemPaddingInline:e.calc(e.marginXXS).mul(1.5).equal(),paginationEllipsisLetterSpacing:e.calc(e.marginXXS).div(2).equal(),paginationSlashMarginInlineStart:e.marginSM,paginationSlashMarginInlineEnd:e.marginSM,paginationEllipsisTextIndent:"0.13em"},Gk(e)),oKn=ui("Pagination",e=>{const t=Tut(e);return[nKn(t),rKn(t)]},Aut),iKn=e=>{const{componentCls:t}=e;return{[`${t}${t}-bordered${t}-disabled`]:{"&, &:hover":{[`${t}-item-link`]:{borderColor:e.colorBorder}},"&:focus-visible":{[`${t}-item-link`]:{borderColor:e.colorBorder}},[`${t}-item, ${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,[`&:hover:not(${t}-item-active)`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,a:{color:e.colorTextDisabled}},[`&${t}-item-active`]:{backgroundColor:e.itemActiveBgDisabled}},[`${t}-prev, ${t}-next`]:{"&:hover button":{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder,color:e.colorTextDisabled},[`${t}-item-link`]:{backgroundColor:e.colorBgContainerDisabled,borderColor:e.colorBorder}}},[`${t}${t}-bordered`]:{[`${t}-prev, ${t}-next`]:{"&:hover button":{borderColor:e.colorPrimaryHover,backgroundColor:e.itemBg},[`${t}-item-link`]:{backgroundColor:e.itemLinkBg,borderColor:e.colorBorder},[`&:hover ${t}-item-link`]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,color:e.colorPrimary},[`&${t}-disabled`]:{[`${t}-item-link`]:{borderColor:e.colorBorder,color:e.colorTextDisabled}}},[`${t}-item`]:{backgroundColor:e.itemBg,border:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,[`&:hover:not(${t}-item-active)`]:{borderColor:e.colorPrimary,backgroundColor:e.itemBg,a:{color:e.colorPrimary}},"&-active":{borderColor:e.colorPrimary}}}}},aKn=d5(["Pagination","bordered"],e=>{const t=Tut(e);return iKn(t)},Aut);function pDe(e){return f.useMemo(()=>typeof e=="boolean"?[e,{}]:e&&typeof e=="object"?[!0,e]:[void 0,void 0],[e])}const kut=e=>{const{align:t,prefixCls:n,selectPrefixCls:r,className:o,rootClassName:i,style:s,size:l,locale:c,responsive:u,showSizeChanger:d,selectComponentClass:p,pageSizeOptions:h,styles:m,classNames:g,...y}=e,{xs:x}=p5(u),[,v]=Xf(),{getPrefixCls:b,direction:w,showSizeChanger:S,className:C,style:N,classNames:j,styles:I,totalBoundaryShowSizeChanger:_}=Zo("pagination"),T=b("pagination",n),[P,E]=oKn(T),M=ad(l),R=M==="small"||!!(x&&!M&&u),$={...e,size:M},[D,z]=di([j,g],[I,m],{props:$}),[V]=xg("Pagination",mat),B={...V,...c},[G,H]=pDe(d),[F,W]=pDe(S),U=G??F,K=H??W,X=p||F0,J=f.useMemo(()=>h?h.map(ue=>Number(ue)):void 0,[h]),te=ue=>{var Te;const{disabled:fe,size:se,onSizeChange:ge,"aria-label":ye,className:de,options:Ne}=ue,{className:_e,onChange:xe}=K||{},we=(Te=Ne.find(Re=>String(Re.value)===String(se)))==null?void 0:Te.value;return f.createElement(X,{disabled:fe,showSearch:!0,popupMatchSelectWidth:!1,getPopupContainer:Re=>Re.parentNode,"aria-label":ye,options:Ne,...K,value:we,onChange:(Re,Ue)=>{ge==null||ge(Re),xe==null||xe(Re,Ue)},size:M,className:be(de,_e)})},re=f.useMemo(()=>{const ue=f.createElement("span",{className:`${T}-item-ellipsis`},"•••"),fe=f.createElement("button",{className:`${T}-item-link`,type:"button",tabIndex:-1},w==="rtl"?f.createElement(tce,null):f.createElement(Mce,null)),se=f.createElement("button",{className:`${T}-item-link`,type:"button",tabIndex:-1},w==="rtl"?f.createElement(Mce,null):f.createElement(tce,null)),ge=f.createElement("a",{className:`${T}-item-link`},f.createElement("div",{className:`${T}-item-container`},w==="rtl"?f.createElement(uDe,{className:`${T}-item-link-icon`}):f.createElement(cDe,{className:`${T}-item-link-icon`}),ue)),ye=f.createElement("a",{className:`${T}-item-link`},f.createElement("div",{className:`${T}-item-container`},w==="rtl"?f.createElement(cDe,{className:`${T}-item-link-icon`}):f.createElement(uDe,{className:`${T}-item-link-icon`}),ue));return{prevIcon:fe,nextIcon:se,jumpPrevIcon:ge,jumpNextIcon:ye}},[w,T]),ce=b("select",r),ae=be({[`${T}-${t}`]:!!t,[`${T}-${M}`]:M,[`${T}-mini`]:R,[`${T}-rtl`]:w==="rtl",[`${T}-bordered`]:v.wireframe},C,o,i,D.root,P,E),oe={...z.root,...N,...s};return f.createElement(f.Fragment,null,v.wireframe&&f.createElement(aKn,{prefixCls:T}),f.createElement(Yqn,{...re,...y,styles:z,classNames:D,style:oe,prefixCls:T,selectPrefixCls:ce,className:ae,locale:B,pageSizeOptions:J,showSizeChanger:U,totalBoundaryShowSizeChanger:y.totalBoundaryShowSizeChanger??_,sizeChangerRender:te}))},QU=100,Mut=QU/5,Rut=QU/2-Mut/2,Tte=Rut*2*Math.PI,hDe=50,mDe=e=>{const{dotClassName:t,style:n,hasCircleCls:r}=e;return f.createElement("circle",{className:be(`${t}-circle`,{[`${t}-circle-bg`]:r}),r:Rut,cx:hDe,cy:hDe,strokeWidth:Mut,style:n})},sKn=({percent:e,prefixCls:t})=>{const n=`${t}-dot`,r=`${n}-holder`,o=`${r}-hidden`,[i,s]=f.useState(!1);Po(()=>{e!==0&&s(!0)},[e!==0]);const l=Math.max(Math.min(e,100),0);if(!i)return null;const c={strokeDashoffset:`${Tte/4}`,strokeDasharray:`${Tte*l/100} ${Tte*(100-l)/100}`};return f.createElement("span",{className:be(r,`${n}-progress`,l<=0&&o)},f.createElement("svg",{viewBox:`0 0 ${QU} ${QU}`,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":l},f.createElement(mDe,{dotClassName:n,hasCircleCls:!0}),f.createElement(mDe,{dotClassName:n,style:c})))};function lKn(e){const{prefixCls:t,percent:n=0,className:r,style:o}=e,i=`${t}-dot`,s=`${i}-holder`,l=`${s}-hidden`;return f.createElement(f.Fragment,null,f.createElement("span",{className:be(s,r,n>0&&l),style:o},f.createElement("span",{className:be(i,`${t}-dot-spin`)},[1,2,3,4].map(c=>f.createElement("i",{className:`${t}-dot-item`,key:c})))),f.createElement(sKn,{prefixCls:t,percent:n}))}function cKn(e){const{prefixCls:t,indicator:n,percent:r,className:o,style:i}=e,s=`${t}-dot`;return n&&f.isValidElement(n)?Fc(n,l=>({className:be(l.className,s,o),style:{...l.style,...i},percent:r})):f.createElement(lKn,{prefixCls:t,percent:r,className:o,style:i})}const uKn=new Go("antSpinMove",{to:{opacity:1}}),dKn=new Go("antRotate",{to:{transform:"rotate(405deg)"}}),fKn=e=>{const{componentCls:t,calc:n}=e;return{[t]:{...Ii(e),position:"absolute",display:"none",color:e.colorPrimary,fontSize:0,textAlign:"center",verticalAlign:"middle",opacity:0,transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,"&-spinning":{position:"relative",display:"inline-block",opacity:1},[`${t}-text`]:{fontSize:e.fontSize,paddingTop:n(n(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()},"&-fullscreen":{position:"fixed",width:"100vw",height:"100vh",backgroundColor:e.colorBgMask,zIndex:e.zIndexPopupBase,inset:0,display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:0,visibility:"hidden",transition:`all ${e.motionDurationMid}`,"&-show":{opacity:1,visibility:"visible"},[t]:{[`${t}-dot-holder`]:{color:e.colorWhite},[`${t}-text`]:{color:e.colorTextLightSolid}}},"&-nested-loading":{position:"relative",[`> div > ${t}`]:{position:"absolute",top:0,insetInlineStart:0,zIndex:4,display:"block",width:"100%",height:"100%",maxHeight:e.contentHeight,[`${t}-dot`]:{position:"absolute",top:"50%",insetInlineStart:"50%",margin:n(e.dotSize).mul(-1).div(2).equal()},[`${t}-text`]:{position:"absolute",top:"50%",width:"100%",textShadow:`0 1px 2px ${e.colorBgContainer}`},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSize).div(2).mul(-1).sub(10).equal()},"&-sm":{[`${t}-dot`]:{margin:n(e.dotSizeSM).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeSM).div(2).mul(-1).sub(10).equal()}},"&-lg":{[`${t}-dot`]:{margin:n(e.dotSizeLG).mul(-1).div(2).equal()},[`${t}-text`]:{paddingTop:n(n(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()},[`&${t}-show-text ${t}-dot`]:{marginTop:n(e.dotSizeLG).div(2).mul(-1).sub(10).equal()}}},[`${t}-container`]:{position:"relative",transition:`opacity ${e.motionDurationSlow}`,"&::after":{position:"absolute",top:0,insetInlineEnd:0,bottom:0,insetInlineStart:0,zIndex:10,width:"100%",height:"100%",background:e.colorBgContainer,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'""',pointerEvents:"none"}},[`${t}-blur`]:{clear:"both",opacity:.5,userSelect:"none",pointerEvents:"none","&::after":{opacity:.4,pointerEvents:"auto"}}},"&-tip":{color:e.spinDotDefault},[`${t}-dot-holder`]:{width:"1em",height:"1em",fontSize:e.dotSize,display:"inline-block",transition:`transform ${e.motionDurationSlow} ease, opacity ${e.motionDurationSlow} ease`,transformOrigin:"50% 50%",lineHeight:1,color:e.colorPrimary,"&-hidden":{transform:"scale(0.3)",opacity:0}},[`${t}-dot-progress`]:{position:"absolute",inset:0},[`${t}-dot`]:{position:"relative",display:"inline-block",fontSize:e.dotSize,width:"1em",height:"1em","&-item":{position:"absolute",display:"block",width:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),height:n(e.dotSize).sub(n(e.marginXXS).div(2)).div(2).equal(),background:"currentColor",borderRadius:"100%",transform:"scale(0.75)",transformOrigin:"50% 50%",opacity:.3,animationName:uKn,animationDuration:"1s",animationIterationCount:"infinite",animationTimingFunction:"linear",animationDirection:"alternate","&:nth-child(1)":{top:0,insetInlineStart:0,animationDelay:"0s"},"&:nth-child(2)":{top:0,insetInlineEnd:0,animationDelay:"0.4s"},"&:nth-child(3)":{insetInlineEnd:0,bottom:0,animationDelay:"0.8s"},"&:nth-child(4)":{bottom:0,insetInlineStart:0,animationDelay:"1.2s"}},"&-spin":{transform:"rotate(45deg)",animationName:dKn,animationDuration:"1.2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},"&-circle":{strokeLinecap:"round",transition:["stroke-dashoffset","stroke-dasharray","stroke","stroke-width","opacity"].map(r=>`${r} ${e.motionDurationSlow} ease`).join(","),fillOpacity:0,stroke:"currentcolor"},"&-circle-bg":{stroke:e.colorFillSecondary}},[`&-sm ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeSM}},[`&-sm ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal(),height:n(n(e.dotSizeSM).sub(n(e.marginXXS).div(2))).div(2).equal()}},[`&-lg ${t}-dot`]:{"&, &-holder":{fontSize:e.dotSizeLG}},[`&-lg ${t}-dot-holder`]:{i:{width:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),height:n(n(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()}},[`&${t}-show-text ${t}-text`]:{display:"block"}}}},pKn=e=>{const{controlHeightLG:t,controlHeight:n}=e;return{contentHeight:400,dotSize:t/2,dotSizeSM:t*.35,dotSizeLG:n}},hKn=ui("Spin",e=>{const t=Ho(e,{spinDotDefault:e.colorTextDescription});return fKn(t)},pKn),mKn=200,gDe=[[30,.05],[70,.03],[96,.01]];function gKn(e,t){const[n,r]=f.useState(0),o=f.useRef(null),i=t==="auto";return f.useEffect(()=>(i&&e&&(r(0),o.current=setInterval(()=>{r(s=>{const l=100-s;for(let c=0;c{o.current&&(clearInterval(o.current),o.current=null)}),[i,e]),i?n:t}let Out;function xKn(e,t){return!!e&&!!t&&!Number.isNaN(Number(t))}const rY=e=>{const{prefixCls:t,spinning:n=!0,delay:r=0,className:o,rootClassName:i,size:s="default",tip:l,wrapperClassName:c,style:u,children:d,fullscreen:p=!1,indicator:h,percent:m,classNames:g,styles:y,...x}=e,{getPrefixCls:v,direction:b,indicator:w,className:S,style:C,classNames:N,styles:j}=Zo("spin"),I=v("spin",t),[_,T]=hKn(I),[P,E]=f.useState(()=>n&&!xKn(n,r)),M=gKn(P,m);f.useEffect(()=>{if(n){const W=mWn(r,()=>{E(!0)});return W(),()=>{var U;(U=W==null?void 0:W.cancel)==null||U.call(W)}}E(!1)},[r,n]);const R=f.useMemo(()=>typeof d<"u"&&!p,[d,p]),$={...e,size:s,spinning:P,tip:l,fullscreen:p,children:d,percent:M},[D,z]=di([N,g],[j,y],{props:$}),V=be(I,S,{[`${I}-sm`]:s==="small",[`${I}-lg`]:s==="large",[`${I}-spinning`]:P,[`${I}-show-text`]:!!l,[`${I}-rtl`]:b==="rtl"},o,!p&&i,!p&&D.root,_,T),B=be(`${I}-container`,{[`${I}-blur`]:P}),G=h??w??Out,H={...C,...u},F=f.createElement("div",{...x,style:p?H:{...z.root,...H},className:V,"aria-live":"polite","aria-busy":P},f.createElement(cKn,{className:D.indicator,style:z.indicator,prefixCls:I,indicator:G,percent:M}),l&&(R||p)?f.createElement("div",{className:be(`${I}-text`,D.tip),style:z.tip},l):null);return R?f.createElement("div",{...x,className:be(`${I}-nested-loading`,c,D.wrapper,_,T),style:z.wrapper},P&&f.createElement("div",{key:"loading"},F),f.createElement("div",{className:B,key:"container"},d)):p?f.createElement("div",{className:be(`${I}-fullscreen`,{[`${I}-fullscreen-show`]:P},i,_,T,D.mask),style:z.mask},F):F};rY.setDefaultIndicator=e=>{Out=e};const Ave=Ie.createContext({});Ave.Consumer;const yKn=({prefixCls:e,className:t,avatar:n,title:r,description:o,...i})=>{const{getPrefixCls:s}=f.useContext(Qr),l=s("list",e),c=be(`${l}-item-meta`,t),u=Ie.createElement("div",{className:`${l}-item-meta-content`},r&&Ie.createElement("h4",{className:`${l}-item-meta-title`},r),o&&Ie.createElement("div",{className:`${l}-item-meta-description`},o));return Ie.createElement("div",{...i,className:c},n&&Ie.createElement("div",{className:`${l}-item-meta-avatar`},n),(r||o)&&u)},vKn=Ie.forwardRef((e,t)=>{const{prefixCls:n,children:r,actions:o,extra:i,styles:s,className:l,classNames:c,colStyle:u,...d}=e,{grid:p,itemLayout:h}=f.useContext(Ave),{getPrefixCls:m,list:g}=f.useContext(Qr),y=j=>{var I,_;return be((_=(I=g==null?void 0:g.item)==null?void 0:I.classNames)==null?void 0:_[j],c==null?void 0:c[j])},x=j=>{var I,_;return{...(_=(I=g==null?void 0:g.item)==null?void 0:I.styles)==null?void 0:_[j],...s==null?void 0:s[j]}},v=()=>{const j=Bu(r);return j.some(_=>typeof _=="string")&&j.length>1},b=()=>h==="vertical"?!!i:!v(),w=m("list",n),S=o&&o.length>0&&Ie.createElement("ul",{className:be(`${w}-item-action`,y("actions")),key:"actions",style:x("actions")},o.map((j,I)=>Ie.createElement("li",{key:`${w}-item-action-${I}`},j,I!==o.length-1&&Ie.createElement("em",{className:`${w}-item-action-split`})))),C=p?"div":"li",N=Ie.createElement(C,{...d,...p?{}:{ref:t},className:be(`${w}-item`,{[`${w}-item-no-flex`]:!b()},l)},h==="vertical"&&i?[Ie.createElement("div",{className:`${w}-item-main`,key:"content"},r,S),Ie.createElement("div",{className:be(`${w}-item-extra`,y("extra")),key:"extra",style:x("extra")},i)]:[r,S,Fc(i,{key:"extra"})]);return p?Ie.createElement(dc,{ref:t,flex:1,style:u},N):N}),$ut=vKn;$ut.Meta=yKn;const bKn=e=>{const{listBorderedCls:t,componentCls:n,paddingLG:r,margin:o,itemPaddingSM:i,itemPaddingLG:s,marginLG:l,borderRadiusLG:c}=e,u=Xe(e.calc(c).sub(e.lineWidth).equal());return{[t]:{border:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:c,[`${n}-header`]:{borderRadius:`${u} ${u} 0 0`},[`${n}-footer`]:{borderRadius:`0 0 ${u} ${u}`},[`${n}-header,${n}-footer,${n}-item`]:{paddingInline:r},[`${n}-pagination`]:{margin:`${Xe(o)} ${Xe(l)}`}},[`${t}${n}-sm`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:i}},[`${t}${n}-lg`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:s}}}},wKn=e=>{const{componentCls:t,screenSM:n,screenMD:r,marginLG:o,marginSM:i,margin:s}=e;return{[`@media screen and (max-width:${r}px)`]:{[t]:{[`${t}-item`]:{[`${t}-item-action`]:{marginInlineStart:o}}},[`${t}-vertical`]:{[`${t}-item`]:{[`${t}-item-extra`]:{marginInlineStart:o}}}},[`@media screen and (max-width: ${n}px)`]:{[t]:{[`${t}-item`]:{flexWrap:"wrap",[`${t}-action`]:{marginInlineStart:i}}},[`${t}-vertical`]:{[`${t}-item`]:{flexWrap:"wrap-reverse",[`${t}-item-main`]:{minWidth:e.contentWidth},[`${t}-item-extra`]:{margin:`auto auto ${Xe(s)}`}}}}}},SKn=e=>{const{componentCls:t,antCls:n,controlHeight:r,minHeight:o,paddingSM:i,marginLG:s,padding:l,itemPadding:c,colorPrimary:u,itemPaddingSM:d,itemPaddingLG:p,paddingXS:h,margin:m,colorText:g,colorTextDescription:y,motionDurationSlow:x,lineWidth:v,headerBg:b,footerBg:w,emptyTextPadding:S,metaMarginBottom:C,avatarMarginRight:N,titleMarginBottom:j,descriptionFontSize:I}=e;return{[t]:{...Ii(e),position:"relative","--rc-virtual-list-scrollbar-bg":e.colorSplit,"*":{outline:"none"},[`${t}-header`]:{background:b},[`${t}-footer`]:{background:w},[`${t}-header, ${t}-footer`]:{paddingBlock:i},[`${t}-pagination`]:{marginBlockStart:s,[`${n}-pagination-options`]:{textAlign:"start"}},[`${t}-spin`]:{minHeight:o,textAlign:"center"},[`${t}-items`]:{margin:0,padding:0,listStyle:"none"},[`${t}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:c,color:g,[`${t}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${t}-item-meta-avatar`]:{marginInlineEnd:N},[`${t}-item-meta-content`]:{flex:"1 0",width:0,color:g},[`${t}-item-meta-title`]:{margin:`0 0 ${Xe(e.marginXXS)} 0`,color:g,fontSize:e.fontSize,lineHeight:e.lineHeight,"> a":{color:g,transition:`all ${x}`,"&:hover":{color:u}}},[`${t}-item-meta-description`]:{color:y,fontSize:I,lineHeight:e.lineHeight}},[`${t}-item-action`]:{flex:"0 0 auto",marginInlineStart:e.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:`0 ${Xe(h)}`,color:y,fontSize:e.fontSize,lineHeight:e.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},[`${t}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:v,height:e.calc(e.fontHeight).sub(e.calc(e.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:e.colorSplit}}},[`${t}-empty`]:{padding:`${Xe(l)} 0`,color:y,fontSize:e.fontSizeSM,textAlign:"center"},[`${t}-empty-text`]:{padding:S,color:e.colorTextDisabled,fontSize:e.fontSize,textAlign:"center"},[`${t}-item-no-flex`]:{display:"block"}},[`${t}-grid ${n}-col > ${t}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:m,paddingBlock:0,borderBlockEnd:"none"},[`${t}-vertical ${t}-item`]:{alignItems:"initial",[`${t}-item-main`]:{display:"block",flex:1},[`${t}-item-extra`]:{marginInlineStart:s},[`${t}-item-meta`]:{marginBlockEnd:C,[`${t}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:j,color:g,fontSize:e.fontSizeLG,lineHeight:e.lineHeightLG}},[`${t}-item-action`]:{marginBlockStart:l,marginInlineStart:"auto","> li":{padding:`0 ${Xe(l)}`,"&:first-child":{paddingInlineStart:0}}}},[`${t}-split ${t}-item`]:{borderBlockEnd:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorSplit}`,"&:last-child":{borderBlockEnd:"none"}},[`${t}-split ${t}-header`]:{borderBlockEnd:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${t}-split${t}-empty ${t}-footer`]:{borderTop:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${t}-loading ${t}-spin-nested-loading`]:{minHeight:r},[`${t}-split${t}-something-after-last-item ${n}-spin-container > ${t}-items > ${t}-item:last-child`]:{borderBlockEnd:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorSplit}`},[`${t}-lg ${t}-item`]:{padding:p},[`${t}-sm ${t}-item`]:{padding:d},[`${t}:not(${t}-vertical)`]:{[`${t}-item-no-flex`]:{[`${t}-item-action`]:{float:"right"}}}}},CKn=e=>({contentWidth:220,itemPadding:`${Xe(e.paddingContentVertical)} 0`,itemPaddingSM:`${Xe(e.paddingContentVerticalSM)} ${Xe(e.paddingContentHorizontal)}`,itemPaddingLG:`${Xe(e.paddingContentVerticalLG)} ${Xe(e.paddingContentHorizontalLG)}`,headerBg:"transparent",footerBg:"transparent",emptyTextPadding:e.padding,metaMarginBottom:e.padding,avatarMarginRight:e.padding,titleMarginBottom:e.paddingSM,descriptionFontSize:e.fontSize}),NKn=ui("List",e=>{const t=Ho(e,{listBorderedCls:`${e.componentCls}-bordered`,minHeight:e.controlHeightLG});return[SKn(t),bKn(t),wKn(t)]},CKn),jKn=(e,t)=>{const{pagination:n=!1,prefixCls:r,bordered:o=!1,split:i=!0,className:s,rootClassName:l,style:c,children:u,itemLayout:d,loadMore:p,grid:h,dataSource:m=[],size:g,header:y,footer:x,loading:v=!1,rowKey:b,renderItem:w,locale:S,...C}=e,N=n&&typeof n=="object"?n:{},[j,I]=f.useState(N.defaultCurrent||1),[_,T]=f.useState(N.defaultPageSize||10),{getPrefixCls:P,direction:E,className:M,style:R}=Zo("list"),{renderEmpty:$}=f.useContext(Qr),D={current:1,total:0,position:"bottom"},z=xe=>(we,Te)=>{var Re;I(we),T(Te),n&&((Re=n==null?void 0:n[xe])==null||Re.call(n,we,Te))},V=z("onChange"),B=z("onShowSizeChange"),G=(xe,we)=>{if(!w)return null;let Te;return typeof b=="function"?Te=b(xe):b?Te=xe[b]:Te=xe.key,Te||(Te=`list-item-${we}`),f.createElement(f.Fragment,{key:Te},w(xe,we))},H=!!(p||n||x),F=P("list",r),[W,U]=NKn(F);let K=v;typeof K=="boolean"&&(K={spinning:K});const X=!!(K!=null&&K.spinning),J=ad(g);let te="";switch(J){case"large":te="lg";break;case"small":te="sm";break}const re=be(F,{[`${F}-vertical`]:d==="vertical",[`${F}-${te}`]:te,[`${F}-split`]:i,[`${F}-bordered`]:o,[`${F}-loading`]:X,[`${F}-grid`]:!!h,[`${F}-something-after-last-item`]:H,[`${F}-rtl`]:E==="rtl"},M,s,l,W,U),ce=u$(D,{total:m.length,current:j,pageSize:_},n||{}),ae=Math.ceil(ce.total/ce.pageSize);ce.current=Math.min(ce.current,ae);const oe=n&&f.createElement("div",{className:be(`${F}-pagination`)},f.createElement(kut,{align:"end",...ce,onChange:V,onShowSizeChange:B}));let ue=go(m);n&&m.length>(ce.current-1)*ce.pageSize&&(ue=go(m).splice((ce.current-1)*ce.pageSize,ce.pageSize));const fe=Object.keys(h||{}).some(xe=>["xs","sm","md","lg","xl","xxl"].includes(xe)),se=p5(fe),ge=f.useMemo(()=>{for(let xe=0;xe{if(!h)return;const xe=ge&&h[ge]?h[ge]:h.column;if(xe)return{width:`${100/xe}%`,maxWidth:`${100/xe}%`}},[JSON.stringify(h),ge]);let de=X&&f.createElement("div",{style:{minHeight:53}});if(ue.length>0){const xe=ue.map(G);de=h?f.createElement(Sv,{gutter:h.gutter},f.Children.map(xe,we=>f.createElement("div",{key:we==null?void 0:we.key,style:ye},we))):f.createElement("ul",{className:`${F}-items`},xe)}else!u&&!X&&(de=f.createElement("div",{className:`${F}-empty-text`},(S==null?void 0:S.emptyText)||($==null?void 0:$("List"))||f.createElement(Zye,{componentName:"List"})));const Ne=ce.position,_e=f.useMemo(()=>({grid:h,itemLayout:d}),[JSON.stringify(h),d]);return f.createElement(Ave.Provider,{value:_e},f.createElement("div",{ref:t,style:{...R,...c},className:re,...C},(Ne==="top"||Ne==="both")&&oe,y&&f.createElement("div",{className:`${F}-header`},y),f.createElement(rY,{...K},de,u),x&&f.createElement("div",{className:`${F}-footer`},x),p||(Ne==="bottom"||Ne==="both")&&oe))},EKn=f.forwardRef(jKn),jB=EKn;jB.Item=$ut;const IKn=(e,t=!1)=>t&&!ll(e)?[]:Array.isArray(e)?e:[e];let Wm=null,sE=e=>e(),H$=[],V$={};function xDe(){const{getContainer:e,duration:t,rtl:n,maxCount:r,top:o}=V$,i=(e==null?void 0:e())||document.body;return{getContainer:()=>i,duration:t,rtl:n,maxCount:r,top:o}}const _Kn=Ie.forwardRef((e,t)=>{const{messageConfig:n,sync:r}=e,{getPrefixCls:o}=f.useContext(Qr),i=V$.prefixCls||o("message"),s=f.useContext(Gst),[l,c]=qat({...n,prefixCls:i,...s.message});return Ie.useImperativeHandle(t,()=>{const u={...l};return Object.keys(u).forEach(d=>{u[d]=(...p)=>(r(),l[d].apply(l,p))}),{instance:u,sync:r}}),c}),PKn=Ie.forwardRef((e,t)=>{const[n,r]=Ie.useState(xDe),o=()=>{r(xDe)};Ie.useEffect(o,[]);const i=$ye(),s=i.getRootPrefixCls(),l=i.getIconPrefixCls(),c=i.getTheme(),u=Ie.createElement(_Kn,{ref:t,sync:o,messageConfig:n});return Ie.createElement(Py,{prefixCls:s,iconPrefixCls:l,theme:c},i.holderRender?i.holderRender(u):u)}),oY=()=>{if(!Wm){const e=document.createDocumentFragment(),t={fragment:e};Wm=t,sE(()=>{RK(Ie.createElement(PKn,{ref:n=>{const{instance:r,sync:o}=n||{};Promise.resolve().then(()=>{!t.instance&&r&&(t.instance=r,t.sync=o,oY())})}}),e)});return}Wm.instance&&(H$.forEach(e=>{const{type:t,skipped:n}=e;if(!n)switch(t){case"open":{sE(()=>{const r=Wm.instance.open({...V$,...e.config});r==null||r.then(e.resolve),e.setCloseFn(r)});break}case"destroy":sE(()=>{Wm==null||Wm.instance.destroy(e.key)});break;default:sE(()=>{var r;const o=(r=Wm.instance)[t].apply(r,go(e.args));o==null||o.then(e.resolve),e.setCloseFn(o)})}}),H$=[])};function AKn(e){V$={...V$,...e},sE(()=>{var t;(t=Wm==null?void 0:Wm.sync)==null||t.call(Wm)})}function TKn(e){const t=Lye(n=>{let r;const o={type:"open",config:e,resolve:n,setCloseFn:i=>{r=i}};return H$.push(o),()=>{r?sE(()=>{r()}):o.skipped=!0}});return oY(),t}function kKn(e,t){const n=Lye(r=>{let o;const i={type:e,args:t,resolve:r,setCloseFn:s=>{o=s}};return H$.push(i),()=>{o?sE(()=>{o()}):i.skipped=!0}});return oY(),n}const MKn=e=>{H$.push({type:"destroy",key:e}),oY()},RKn=["success","info","warning","error","loading"],OKn={open:TKn,destroy:MKn,config:AKn,useMessage:r3n,_InternalPanelDoNotUseOrYouWillBeFired:XOn},kue=OKn;RKn.forEach(e=>{kue[e]=(...t)=>kKn(e,t)});const $Kn=e=>{const{prefixCls:t,className:n,closeIcon:r,closable:o,type:i,title:s,children:l,footer:c,...u}=e,{getPrefixCls:d}=f.useContext(Qr),p=d(),h=t||d("modal"),m=pl(p),[g,y]=Pst(h,m),x=`${h}-confirm`;let v={};return i?v={closable:o??!1,title:"",footer:"",children:f.createElement(Tst,{...e,prefixCls:h,confirmPrefixCls:x,rootPrefixCls:p,content:l})}:v={closable:o??!0,title:s,footer:c!==null&&f.createElement(jst,{...e}),children:l},f.createElement(cst,{prefixCls:h,className:be(g,`${h}-pure-panel`,i&&x,i&&`${x}-${i}`,n,y,m),...u,closeIcon:Nst(h,r),closable:o,...v})},DKn=qst($Kn);function Dut(e){return u6(Ost(e))}const mg=Ast;mg.useModal=sLn;mg.info=function(t){return u6($st(t))};mg.success=function(t){return u6(Dst(t))};mg.error=function(t){return u6(Lst(t))};mg.warning=Dut;mg.warn=Dut;mg.confirm=function(t){return u6(Fst(t))};mg.destroyAll=function(){for(;aE.length;){const t=aE.pop();t&&t()}};mg.config=rLn;mg._InternalPanelDoNotUseOrYouWillBeFired=DKn;let Zg=null,EB=e=>e(),JU=[],U$={};function yDe(){const{getContainer:e,rtl:t,maxCount:n,top:r,bottom:o,showProgress:i,pauseOnHover:s}=U$,l=(e==null?void 0:e())||document.body;return{getContainer:()=>l,rtl:t,maxCount:n,top:r,bottom:o,showProgress:i,pauseOnHover:s}}const LKn=Ie.forwardRef((e,t)=>{const{notificationConfig:n,sync:r}=e,{getPrefixCls:o}=f.useContext(Qr),i=U$.prefixCls||o("notification"),s=f.useContext(Gst),[l,c]=Wst({...n,prefixCls:i,...s.notification});return Ie.useEffect(r,[]),Ie.useImperativeHandle(t,()=>{const u={...l};return Object.keys(u).forEach(d=>{u[d]=(...p)=>(r(),l[d].apply(l,p))}),{instance:u,sync:r}}),c}),FKn=Ie.forwardRef((e,t)=>{const[n,r]=Ie.useState(yDe),o=()=>{r(yDe)};Ie.useEffect(o,[]);const i=$ye(),s=i.getRootPrefixCls(),l=i.getIconPrefixCls(),c=i.getTheme(),u=Ie.createElement(LKn,{ref:t,sync:o,notificationConfig:n});return Ie.createElement(Py,{prefixCls:s,iconPrefixCls:l,theme:c},i.holderRender?i.holderRender(u):u)}),Tve=()=>{if(!Zg){const e=document.createDocumentFragment(),t={fragment:e};Zg=t,EB(()=>{RK(Ie.createElement(FKn,{ref:n=>{const{instance:r,sync:o}=n||{};Promise.resolve().then(()=>{!t.instance&&r&&(t.instance=r,t.sync=o,Tve())})}}),e)});return}Zg.instance&&(JU.forEach(e=>{switch(e.type){case"open":{EB(()=>{Zg.instance.open({...U$,...e.config})});break}case"destroy":EB(()=>{var t;(t=Zg==null?void 0:Zg.instance)==null||t.destroy(e.key)});break}}),JU=[])};function zKn(e){U$={...U$,...e},EB(()=>{var t;(t=Zg==null?void 0:Zg.sync)==null||t.call(Zg)})}function Lut(e){JU.push({type:"open",config:e}),Tve()}const BKn=e=>{JU.push({type:"destroy",key:e}),Tve()},HKn=["success","info","warning","error"],VKn={open:Lut,destroy:BKn,config:zKn,useNotification:ILn,_InternalPanelDoNotUseOrYouWillBeFired:yLn},Fut=VKn;HKn.forEach(e=>{Fut[e]=t=>Lut({...t,type:e})});const UKn={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,railColor:"#D9D9D9",railWidth:1,gapPosition:"bottom",loading:!1},WKn=()=>{const e=f.useRef([]),t=f.useRef(null);return f.useEffect(()=>{const n=Date.now();let r=!1;e.current.forEach(o=>{if(!o)return;r=!0;const i=o.style;i.transitionDuration=".3s, .3s, .3s, .06s",t.current&&n-t.current<100&&(i.transitionDuration="0s, 0s")}),r&&(t.current=Date.now())}),e.current},vDe=({bg:e,children:t})=>f.createElement("div",{style:{width:"100%",height:"100%",background:e}},t);function bDe(e,t){return Object.keys(e).map(n=>{const r=parseFloat(n),o=`${Math.floor(r*t)}%`;return`${e[n]} ${o}`})}const GKn=f.forwardRef((e,t)=>{const{prefixCls:n,color:r,gradientId:o,radius:i,className:s,style:l,ptg:c,strokeLinecap:u,strokeWidth:d,size:p,gapDegree:h}=e,m=r&&typeof r=="object",g=m?"#FFF":void 0,y=p/2,x=f.createElement("circle",{className:be(`${n}-circle-path`,s),r:i,cx:y,cy:y,stroke:g,strokeLinecap:u,strokeWidth:d,opacity:c===0?0:1,style:l,ref:t});if(!m)return x;const v=`${o}-conic`,b=h?`${180+h/2}deg`:"0deg",w=bDe(r,(360-h)/360),S=bDe(r,1),C=`conic-gradient(from ${b}, ${w.join(", ")})`,N=`linear-gradient(to ${h?"bottom":"top"}, ${S.join(", ")})`;return f.createElement(f.Fragment,null,f.createElement("mask",{id:v},x),f.createElement("foreignObject",{x:0,y:0,width:p,height:p,mask:`url(#${v})`},f.createElement(vDe,{bg:N},f.createElement(vDe,{bg:C}))))}),DR=100,kte=(e,t,n,r,o,i,s,l,c,u,d=0)=>{const p=n/100*360*((360-i)/360),h=i===0?0:{bottom:0,top:180,left:90,right:-90}[s];let m=(100-r)/100*t;c==="round"&&r!==100&&(m+=u/2,m>=t&&(m=t-.01));const g=DR/2;return{stroke:typeof l=="string"?l:void 0,strokeDasharray:`${t}px ${e}`,strokeDashoffset:m+d,transform:`rotate(${o+p+h}deg)`,transformOrigin:`${g}px ${g}px`,transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},qKn=(({id:e,loading:t})=>{if(!t)return{indeterminateStyleProps:{},indeterminateStyleAnimation:null};const n=`${e}-indeterminate-animate`;return{indeterminateStyleProps:{transform:"rotate(0deg)",animation:`${n} 1s linear infinite`},indeterminateStyleAnimation:Ie.createElement("style",null,`@keyframes ${n} { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }`)}});function Mue(){return Mue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{id:t,prefixCls:n,classNames:r={},styles:o={},steps:i,strokeWidth:s,railWidth:l,gapDegree:c=0,gapPosition:u,railColor:d,strokeLinecap:p,style:h,className:m,strokeColor:g,percent:y,loading:x,...v}={...UKn,...e},b=DR/2,w=Jw(t),S=`${w}-gradient`,C=b-s/2,N=Math.PI*2*C,j=c>0?90+c/2:-90,I=N*((360-c)/360),{count:_,gap:T}=typeof i=="object"?i:{count:i,gap:2},P=wDe(y),E=wDe(g),M=E.find(F=>F&&typeof F=="object"),$=M&&typeof M=="object"?"butt":p,{indeterminateStyleProps:D,indeterminateStyleAnimation:z}=qKn({id:w,loading:x}),V=kte(N,I,0,100,j,c,u,d,$,s),B=WKn(),G=()=>{let F=0;return P.map((W,U)=>{const K=E[U]||E[E.length-1],X=kte(N,I,F,W,j,c,u,K,$,s);return F+=W,f.createElement(GKn,{key:U,color:K,ptg:W,radius:C,prefixCls:n,gradientId:S,className:r.track,style:{...X,...D,...o.track},strokeLinecap:$,strokeWidth:s,gapDegree:c,ref:J=>{B[U]=J},size:DR})}).reverse()},H=()=>{const F=Math.round(_*(P[0]/100)),W=100/_;let U=0;return new Array(_).fill(null).map((K,X)=>{const J=X<=F-1?E[0]:d,te=J&&typeof J=="object"?`url(#${S})`:void 0,re=kte(N,I,U,W,j,c,u,J,"butt",s,T);return U+=(I-re.strokeDashoffset+T)*100/I,f.createElement("circle",{key:X,className:be(`${n}-circle-path`,r.track),r:C,cx:b,cy:b,stroke:te,strokeWidth:s,opacity:1,style:{...re,...o.track},ref:ce=>{B[X]=ce}})})};return f.createElement("svg",Mue({className:be(`${n}-circle`,r.root,m),viewBox:`0 0 ${DR} ${DR}`,style:{...o.root,...h},id:t,role:"presentation"},v),!_&&f.createElement("circle",{className:be(`${n}-circle-rail`,r.rail),r:C,cx:b,cy:b,stroke:d,strokeLinecap:$,strokeWidth:l||s,style:{...V,...o.rail}}),_?H():G(),z)};function BE(e){return!e||e<0?0:e>100?100:e}function ZU({success:e}){let t;return e&&"percent"in e&&(t=e.percent),t}const YKn=({percent:e,success:t})=>{const n=BE(ZU({success:t}));return[n,BE(BE(e)-n)]},XKn=({success:e={},strokeColor:t})=>{const{strokeColor:n}=e;return[n||pA.green,t||null]},iY=(e,t,n)=>{let r=-1,o=-1;if(t==="step"){const i=n.steps,s=n.strokeWidth;typeof e=="string"||typeof e>"u"?(r=e==="small"?2:14,o=s??8):typeof e=="number"?[r,o]=[e,e]:[r=14,o=8]=Array.isArray(e)?e:[e.width,e.height],r*=i}else if(t==="line"){const i=n==null?void 0:n.strokeWidth;typeof e=="string"||typeof e>"u"?o=i||(e==="small"?6:8):typeof e=="number"?[r,o]=[e,e]:[r=-1,o=8]=Array.isArray(e)?e:[e.width,e.height]}else(t==="circle"||t==="dashboard")&&(typeof e=="string"||typeof e>"u"?[r,o]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[r,o]=[e,e]:Array.isArray(e)&&(r=e[0]??e[1]??120,o=e[0]??e[1]??120));return[r,o]},QKn=3,JKn=e=>QKn/e*100,SDe=["root","body","indicator"],ZKn=e=>{const{prefixCls:t,classNames:n,styles:r,railColor:o,trailColor:i,strokeLinecap:s="round",gapPosition:l,gapPlacement:c,gapDegree:u,width:d=120,type:p,children:h,success:m,size:g=d,steps:y}=e,{direction:x}=Zo("progress"),v=o??i,[b,w]=iY(g,"circle");let{strokeWidth:S}=e;S===void 0&&(S=Math.max(JKn(b),6));const C={width:b,height:w,fontSize:b*.15+6},N=f.useMemo(()=>{if(u||u===0)return u;if(p==="dashboard")return 75},[u,p]),j=YKn(e),I=f.useMemo(()=>{const $=(c??l)||p==="dashboard"&&"bottom"||void 0,D=x==="rtl";switch($){case"start":return D?"right":"left";case"end":return D?"left":"right";default:return $}},[x,c,l,p]),_=Object.prototype.toString.call(e.strokeColor)==="[object Object]",T=XKn({success:m,strokeColor:e.strokeColor}),P=be(`${t}-body`,{[`${t}-circle-gradient`]:_},n.body),E=f.createElement(KKn,{steps:y,percent:y?j[1]:j,strokeWidth:S,railWidth:S,strokeColor:y?T[1]:T,strokeLinecap:s,railColor:v,prefixCls:t,gapDegree:N,gapPosition:I,classNames:za(n,SDe),styles:za(r,SDe)}),M=b<=20,R=f.createElement("div",{className:P,style:{...C,...r.body}},E,!M&&h);return M?f.createElement(pf,{title:h},R):R},Rue="--progress-line-stroke-color",eYn=e=>{const t="-100%";return new Go("antProgressLTRActive",{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},tYn=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:{...Ii(e),display:"inline-flex","&-rtl":{direction:"rtl"},[`${t}-indicator`]:{color:e.colorText,lineHeight:1,whiteSpace:"nowrap",verticalAlign:"middle",wordBreak:"normal",[n]:{fontSize:e.fontSize}},[`&${t}-status-exception`]:{[`${t}-indicator`]:{color:e.colorError}},[`&${t}-status-success`]:{[`${t}-indicator`]:{color:e.colorSuccess}}}}},nYn=e=>{const{componentCls:t}=e;return{[`${t}-line`]:{position:"relative",width:"100%",fontSize:e.fontSize,[`${t}-body`]:{display:"inline-flex",alignItems:"center",width:"100%",gap:e.marginXS},[`${t}-rail`]:{flex:"auto",background:e.remainingColor,borderRadius:e.lineBorderRadius,position:"relative",width:"100%"},[`&${t}-status-active`]:{[`${t}-track:after`]:{content:'""',position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:"inherit",opacity:0,animationName:eYn(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite"}},[`${t}-track`]:{position:"absolute",insetInlineStart:0,insetBlock:0,borderRadius:"inherit",background:e.defaultColor,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,minWidth:"max-content",display:"flex",alignItems:"center","&-success":{background:e.colorSuccess}},[`&${t}-status-exception`]:{[`${t}-track`]:{background:e.colorError}},[`&${t}-status-success`]:{[`${t}-track`]:{background:e.colorSuccess}},[`${t}-indicator-outer`]:{[`&${t}-indicator-start`]:{order:-1}},[`${t}-body-layout-bottom`]:{flexDirection:"column",alignItems:"center",gap:e.marginXXS},[`${t}-indicator${t}-indicator-inner`]:{color:e.colorWhite,paddingInline:e.paddingXXS,width:"100%",display:"flex",justifyContent:"center",[`&${t}-indicator-end`]:{justifyContent:"end"},[`&${t}-indicator-start`]:{justifyContent:"start"},[`&${t}-indicator-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}}},rYn=e=>{const{componentCls:t,iconCls:n}=e;return{[`${t}-circle`]:{[`${t}-circle-rail`]:{stroke:e.remainingColor},[`${t}-body:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-body`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`${t}-indicator`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[n]:{fontSize:e.circleIconFontSize}},[`&${t}-status-exception`]:{[`${t}-body:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}}},[`&${t}-status-success`]:{[`${t}-body:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}},oYn=e=>{const{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-body":{display:"flex",flexDirection:"row",alignItems:"center",gap:e.progressStepMarginInlineEnd,[`${t}-indicator`]:{marginInlineStart:e.marginXS}},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},iYn=e=>{const{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-indicator ${n}`]:{fontSize:e.fontSizeSM}}}},aYn=e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`}),sYn=ui("Progress",e=>{const t=e.calc(e.marginXXS).div(2).equal(),n=Ho(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[tYn(n),nYn(n),rYn(n),oYn(n),iYn(n)]},aYn),lYn=e=>{let t=[];return Object.keys(e).forEach(n=>{const r=Number.parseFloat(n.replace(/%/g,""));Number.isNaN(r)||t.push({key:r,value:e[n]})}),t=t.sort((n,r)=>n.key-r.key),t.map(({key:n,value:r})=>`${r} ${n}%`).join(", ")},cYn=(e,t)=>{const{from:n=pA.blue,to:r=pA.blue,direction:o=t==="rtl"?"to left":"to right",...i}=e;if(Object.keys(i).length!==0){const l=lYn(i),c=`linear-gradient(${o}, ${l})`;return{background:c,[Rue]:c}}const s=`linear-gradient(${o}, ${n}, ${r})`;return{background:s,[Rue]:s}},uYn=e=>{const{prefixCls:t,classNames:n,styles:r,direction:o,percent:i,size:s,strokeWidth:l,strokeColor:c,strokeLinecap:u="round",children:d,railColor:p,trailColor:h,percentPosition:m,success:g}=e,{align:y,type:x}=m,v=p??h,b=u==="square"||u==="butt"?0:void 0,w=s??[-1,l||(s==="small"?6:8)],[S,C]=iY(w,"line",{strokeWidth:l}),N={backgroundColor:v||void 0,borderRadius:b,height:C},j=`${t}-track`,I=c&&typeof c!="string"?cYn(c,o):{[Rue]:c,background:c},_={width:`${BE(i)}%`,height:C,borderRadius:b,...I},T=ZU(e),P={width:`${BE(T)}%`,height:C,borderRadius:b,backgroundColor:g==null?void 0:g.strokeColor};return f.createElement("div",{className:be(`${t}-body`,n.body,{[`${t}-body-layout-bottom`]:y==="center"&&x==="outer"}),style:{width:S>0?S:"100%",...r.body}},f.createElement("div",{className:be(`${t}-rail`,n.rail),style:{...N,...r.rail}},f.createElement("div",{className:be(j,n.track),style:{..._,...r.track}},x==="inner"&&d),T!==void 0&&f.createElement("div",{className:be(j,`${j}-success`,n.track),style:{...P,...r.track}})),x==="outer"&&d)},dYn=e=>{const{classNames:t,styles:n,size:r,steps:o,rounding:i=Math.round,percent:s=0,strokeWidth:l=8,strokeColor:c,railColor:u,trailColor:d,prefixCls:p,children:h}=e,m=i(o*(s/100)),y=r??[r==="small"?2:14,l],[x,v]=iY(y,"step",{steps:o,strokeWidth:l}),b=x/o,w=Array.from({length:o}),S=u??d;for(let C=0;C{const{prefixCls:n,className:r,rootClassName:o,classNames:i,styles:s,steps:l,strokeColor:c,percent:u=0,size:d="default",showInfo:p=!0,type:h="line",status:m,format:g,style:y,percentPosition:x={},...v}=e,{align:b="end",type:w="outer"}=x,S=Array.isArray(c)?c[0]:c,C=typeof c=="string"||Array.isArray(c)?c:void 0,N=f.useMemo(()=>{if(S){const J=typeof S=="string"?S:Object.values(S)[0];return new Hi(J).isLight()}return!1},[c]),j=f.useMemo(()=>{var te,re;const J=ZU(e);return Number.parseInt(J!==void 0?(te=J??0)==null?void 0:te.toString():(re=u??0)==null?void 0:re.toString(),10)},[u,e.success]),I=f.useMemo(()=>!fYn.includes(m)&&j>=100?"success":m||"normal",[m,j]),{getPrefixCls:_,direction:T,className:P,style:E,classNames:M,styles:R}=Zo("progress"),$=_("progress",n),[D,z]=sYn($),V={...e,percent:u,type:h,size:d,showInfo:p,percentPosition:x},[B,G]=di([M,i],[R,s],{props:V}),H=h==="line",F=H&&!l,W=f.useMemo(()=>{if(!p)return null;const J=ZU(e);let te;const re=g||(ae=>`${ae}%`),ce=H&&N&&w==="inner";return w==="inner"||g||I!=="exception"&&I!=="success"?te=re(BE(u),BE(J)):I==="exception"?te=H?f.createElement(aN,null):f.createElement(_y,null):I==="success"&&(te=H?f.createElement($k,null):f.createElement(UK,null)),f.createElement("span",{className:be(`${$}-indicator`,{[`${$}-indicator-bright`]:ce,[`${$}-indicator-${b}`]:F,[`${$}-indicator-${w}`]:F},B.indicator),style:G.indicator,title:typeof te=="string"?te:void 0},te)},[p,u,j,I,h,$,g,H,N,w,b,F,B.indicator,G.indicator]),U={...e,classNames:B,styles:G};let K;h==="line"?K=l?f.createElement(dYn,{...U,strokeColor:C,prefixCls:$,steps:typeof l=="object"?l.count:l},W):f.createElement(uYn,{...U,strokeColor:S,prefixCls:$,direction:T,percentPosition:{align:b,type:w}},W):(h==="circle"||h==="dashboard")&&(K=f.createElement(ZKn,{...U,strokeColor:S,prefixCls:$,progressStatus:I},W));const X=be($,`${$}-status-${I}`,{[`${$}-${h==="dashboard"&&"circle"||h}`]:h!=="line",[`${$}-inline-circle`]:h==="circle"&&iY(d,"circle")[0]<=20,[`${$}-line`]:F,[`${$}-line-align-${b}`]:F,[`${$}-line-position-${w}`]:F,[`${$}-steps`]:l,[`${$}-show-info`]:p,[`${$}-${d}`]:typeof d=="string",[`${$}-rtl`]:T==="rtl"},P,r,o,B.root,D,z);return f.createElement("div",{ref:t,style:{...E,...G.root,...y},className:X,role:"progressbar","aria-valuenow":j,"aria-valuemin":0,"aria-valuemax":100,...za(v,["railColor","trailColor","strokeWidth","width","gapDegree","gapPosition","gapPlacement","strokeLinecap","success"])},K)});var pYn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M909.1 209.3l-56.4 44.1C775.8 155.1 656.2 92 521.9 92 290 92 102.3 279.5 102 511.5 101.7 743.7 289.8 932 521.9 932c181.3 0 335.8-115 394.6-276.1 1.5-4.2-.7-8.9-4.9-10.3l-56.7-19.5a8 8 0 00-10.1 4.8c-1.8 5-3.8 10-5.9 14.9-17.3 41-42.1 77.8-73.7 109.4A344.77 344.77 0 01655.9 829c-42.3 17.9-87.4 27-133.8 27-46.5 0-91.5-9.1-133.8-27A341.5 341.5 0 01279 755.2a342.16 342.16 0 01-73.7-109.4c-17.9-42.4-27-87.4-27-133.9s9.1-91.5 27-133.9c17.3-41 42.1-77.8 73.7-109.4 31.6-31.6 68.4-56.4 109.3-73.8 42.3-17.9 87.4-27 133.8-27 46.5 0 91.5 9.1 133.8 27a341.5 341.5 0 01109.3 73.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.6 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c-.1-6.6-7.8-10.3-13-6.2z"}}]},name:"reload",theme:"outlined"};function Oue(){return Oue=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Oue({},e,{ref:t,icon:pYn})),mYn=f.forwardRef(hYn),gYn=e=>{const{value:t,formatter:n,precision:r,decimalSeparator:o,groupSeparator:i="",prefixCls:s}=e;let l;if(typeof n=="function")l=n(t);else{const c=String(t),u=c.match(/^(-?)(\d*)(\.(\d+))?$/);if(!u||c==="-")l=c;else{const d=u[1];let p=u[2]||"0",h=u[4]||"";p=p.replace(/\B(?=(\d{3})+(?!\d))/g,i),typeof r=="number"&&(h=h.padEnd(r,"0").slice(0,r>0?r:0)),h&&(h=`${o}${h}`),l=[f.createElement("span",{key:"int",className:`${s}-content-value-int`},d,p),h&&f.createElement("span",{key:"decimal",className:`${s}-content-value-decimal`},h)]}}return f.createElement("span",{className:`${s}-content-value`},l)},xYn=e=>{const{componentCls:t,marginXXS:n,padding:r,colorTextDescription:o,titleFontSize:i,colorTextHeading:s,contentFontSize:l,fontFamily:c}=e;return{[t]:{...Ii(e),[`${t}-header`]:{paddingBottom:n,[`${t}-title`]:{color:o,fontSize:i}},[`${t}-skeleton`]:{paddingTop:r},[`${t}-content`]:{color:s,fontSize:l,fontFamily:c,[`${t}-content-value`]:{display:"inline-block",direction:"ltr"},[`${t}-content-prefix, ${t}-content-suffix`]:{display:"inline-block"},[`${t}-content-prefix`]:{marginInlineEnd:n},[`${t}-content-suffix`]:{marginInlineStart:n}}}}},yYn=e=>{const{fontSizeHeading3:t,fontSize:n}=e;return{titleFontSize:n,contentFontSize:t}},vYn=ui("Statistic",e=>{const t=Ho(e,{});return xYn(t)},yYn),Ym=f.forwardRef((e,t)=>{const{prefixCls:n,className:r,rootClassName:o,style:i,valueStyle:s,value:l=0,title:c,valueRender:u,prefix:d,suffix:p,loading:h=!1,formatter:m,precision:g,decimalSeparator:y=".",groupSeparator:x=",",onMouseEnter:v,onMouseLeave:b,styles:w,classNames:S,...C}=e,{getPrefixCls:N,direction:j,className:I,style:_,classNames:T,styles:P}=Zo("statistic"),E=N("statistic",n),[M,R]=vYn(E),$={...e,decimalSeparator:y,groupSeparator:x,loading:h,value:l},[D,z]=di([T,S],[P,w],{props:$}),V=f.createElement(gYn,{decimalSeparator:y,groupSeparator:x,prefixCls:E,formatter:m,precision:g,value:l}),B=be(E,{[`${E}-rtl`]:j==="rtl"},I,r,o,D.root,M,R),G=be(`${E}-header`,D.header),H=be(`${E}-title`,D.title),F=be(`${E}-content`,D.content),W=be(`${E}-content-prefix`,D.prefix),U=be(`${E}-content-suffix`,D.suffix),K=f.useRef(null);f.useImperativeHandle(t,()=>({nativeElement:K.current}));const X=fl(C,{aria:!0,data:!0});return f.createElement("div",{...X,className:B,style:{...z.root,..._,...i},ref:K,onMouseEnter:v,onMouseLeave:b},c&&f.createElement("div",{className:G,style:z.header},f.createElement("div",{className:H,style:z.title},c)),f.createElement(eS,{paragraph:!1,loading:h,className:`${E}-skeleton`,active:!0},f.createElement("div",{className:F,style:{...s,...z.content}},d&&f.createElement("span",{className:W,style:z.prefix},d),u?u(V):V,p&&f.createElement("span",{className:U,style:z.suffix},p))))}),bYn=[["Y",1e3*60*60*24*365],["M",1e3*60*60*24*30],["D",1e3*60*60*24],["H",1e3*60*60],["m",1e3*60],["s",1e3],["S",1]];function wYn(e,t){let n=e;const r=/\[[^\]]*]/g,o=(t.match(r)||[]).map(c=>c.slice(1,-1)),i=t.replace(r,"[]"),s=bYn.reduce((c,[u,d])=>{if(c.includes(u)){const p=Math.floor(n/d);return n-=p*d,c.replace(new RegExp(`${u}+`,"g"),h=>{const m=h.length;return p.toString().padStart(m,"0")})}return c},i);let l=0;return s.replace(r,()=>{const c=o[l];return l+=1,c})}function SYn(e,t,n){const{format:r=""}=t,o=new Date(e).getTime(),i=Date.now(),s=Math.max(n?o-i:i-o,0);return wYn(s,r)}const CYn=1e3/60;function NYn(e){return new Date(e).getTime()}const zut=e=>{const{value:t,format:n="HH:mm:ss",onChange:r,onFinish:o,type:i,...s}=e,l=i==="countdown",[c,u]=f.useState(null),d=Vr(()=>{const m=Date.now(),g=NYn(t);u({});const y=l?g-m:m-g;return r==null||r(y),l&&g{let m;const g=()=>{d()||window.clearInterval(m)},y=()=>{m=window.setInterval(g,CYn)},x=()=>{window.clearInterval(m)};return y(),()=>{x()}},[t,l]),f.useEffect(()=>{u({})},[]);const p=(m,g)=>c?SYn(m,{...g,format:n},l):"-",h=m=>Fc(m,{title:void 0});return f.createElement(Ym,{...s,value:t,valueRender:h,formatter:p})},jYn=e=>f.createElement(zut,{...e,type:"countdown"}),EYn=f.memo(jYn);Ym.Timer=zut;Ym.Countdown=EYn;function IYn(e){const{prefixCls:t,className:n,style:r,status:o}=e,i=`${t}-rail`;return f.createElement("div",{className:be(i,`${i}-${o}`,n),style:r})}const But=f.createContext({}),Mve=f.createContext(null);function $ue(){return $ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{className:n,style:r,children:o,...i}=e,{prefixCls:s,classNames:l,styles:c}=f.useContext(Mve),{className:u,style:d}=f.useContext(Hut),p=`${s}-item`;return f.createElement("div",$ue({},fl(i,!1),{ref:t,className:be(`${p}-icon`,l.itemIcon,u,n),style:{...c.itemIcon,...d,...r}}),o)});function Due(){return Due=Object.assign?Object.assign.bind():function(e){for(var t=1;t{x==null||x(U),h(c)},D.onKeyDown=U=>{const{which:K}=U;(K===Ir.ENTER||K===Ir.SPACE)&&h(c)});const z=j||"wait",V=Mte(v),B=Mte(b),G=be(m,`${m}-${z}`,{[`${m}-custom`]:N,[`${m}-active`]:l,[`${m}-disabled`]:C===!0,[`${m}-empty-header`]:!V&&!B},I,n.item,T.root);let H=f.createElement(CDe,null);d&&(H=d(H,{...R,components:{Icon:CDe}}));const F=f.createElement("div",{className:be(`${m}-wrapper`,n.itemWrapper,T.wrapper),style:{...r.itemWrapper,...P.wrapper}},f.createElement(Hut.Provider,{value:{className:T.icon,style:P.icon}},H),f.createElement("div",{className:be(`${m}-section`,n.itemSection,T.section),style:{...r.itemSection,...P.section}},f.createElement("div",{className:be(`${m}-header`,n.itemHeader,T.header),style:{...r.itemHeader,...P.header}},V&&f.createElement("div",{className:be(`${m}-title`,n.itemTitle,T.title),style:{...r.itemTitle,...P.title}},v),B&&f.createElement("div",{title:typeof b=="string"?b:void 0,className:be(`${m}-subtitle`,n.itemSubtitle,T.subtitle),style:{...r.itemSubtitle,...P.subtitle}},b),!i&&f.createElement(IYn,{prefixCls:m,className:be(n.itemRail,T.rail),style:{...r.itemRail,...P.rail},status:g?j:s})),Mte(M)&&f.createElement("div",{className:be(`${m}-content`,n.itemContent,T.content),style:{...r.itemContent,...P.content}},M)));let W=f.createElement(y,Due({},E,D,{className:G,style:{...r.item,...P.root,..._}}),p?p(F):F);return u&&(W=u(W,R)||null),W}function Lue(){return Lue=Object.assign?Object.assign.bind():function(e){for(var t=1;t(g||[]).filter(Boolean),[g]),I=Ie.useMemo(()=>j.map(({status:R},$)=>{const D=h+$;return R||(D===p?d:D{m&&p!==R&&m(R)},{root:T="div",item:P="div"}=u||{},E=Ie.useMemo(()=>({prefixCls:t,classNames:o,styles:i,ItemComponent:P}),[t,o,i,P]),M=(R,$)=>{const D=h+$,z=I[$],V=I[$+1],B={...R,status:z};return Ie.createElement(_Yn,{key:D,prefixCls:t,classNames:o,styles:i,data:B,nextStatus:V,active:D===p,index:D,last:j.length-1===$,iconRender:y,itemRender:x,itemWrapperRender:v,onClick:m&&_})};return Ie.createElement(T,Lue({className:N,style:{...n,...i==null?void 0:i.root}},b),Ie.createElement(Mve.Provider,{value:E},j.map(M)))}const Vut=f.createContext(null),AYn=e=>{const{prefixCls:t}=e;return f.createElement("svg",{className:`${t}-panel-arrow`,viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"none"},f.createElement("title",null,"Arrow"),f.createElement("path",{d:"M 0 0 L 100 50 L 0 100"}))},TYn=e=>{const{prefixCls:t,rootPrefixCls:n,children:r,percent:o}=e,i=`${t}-item-progress-icon`,s=`${i}-circle`,[,l]=bi(n,"cmp-steps"),c=`calc(${l("progress-radius")} * 2 * ${Math.PI*o/100}) 9999`;return f.createElement(f.Fragment,null,f.createElement("svg",{className:`${i}-svg`,viewBox:"0 0 100 100",width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg","aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":o},f.createElement("title",null,"Progress"),f.createElement("circle",{className:be(s,`${s}-rail`)}),f.createElement("circle",{className:be(s,`${s}-ptg`),strokeDasharray:c,transform:"rotate(-90 50 50)"})),r)},kYn=e=>{const{componentCls:t,antCls:n}=e,r=`${t}-item`,[o,i]=bi(n,"cmp-steps");return{[`${t}-horizontal`]:{[`> ${r}`]:{flex:"1 1 auto",minWidth:e.iconSize,[`${r}-rail`]:{[o("horizontal-rail-margin")]:`calc(${i("icon-size-max")} / 2 + ${i("item-wrapper-padding-top")})`,position:"static",marginTop:i("horizontal-rail-margin"),width:"auto",borderBlockStartWidth:i("rail-size"),flex:1,minWidth:0,alignSelf:"flex-start",transform:"translateY(-50%)"}}}}},MYn=e=>{const{componentCls:t,customIconFontSize:n,motionDurationSlow:r,iconSize:o,lineWidth:i,lineType:s,antCls:l}=e,c=`${t}-item`,[u,d]=bi(l,"cmp-steps");return{[t]:{[u("icon-size")]:o,[u("icon-border-width")]:i,[`${c}-icon`]:{width:d("icon-size"),height:d("icon-size"),margin:0,flex:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:e.iconFontSize,fontFamily:e.fontFamily,lineHeight:d("icon-size"),textAlign:"center",borderRadius:d("icon-size"),border:`${d("icon-border-width")} ${s} transparent`,transition:["background-color","border","color","inset","transform"].map(p=>`${p} ${r}`).join(", "),zIndex:1},[`${c}-custom ${c}-icon`]:{background:"none",border:0,fontSize:n}}}},RYn=e=>{const{componentCls:t,inlineDotSize:n,paddingXS:r,lineWidth:o,antCls:i,calc:s}=e,l=s(r).add(o).equal(),c=`${t}-item`,[u,d]=bi(i,"cmp-steps");return{[`${t}-inline`]:{[u("items-offset")]:"0",[u("item-wrapper-padding-top")]:l,display:"inline-flex","&:before":{content:'""',flex:d("items-offset")},[c]:{[u("title-vertical-row-gap")]:r,[u("icon-size")]:n,[u("icon-size-active")]:n,[u("title-font-size")]:e.fontSizeSM,[u("title-line-height")]:e.lineHeightSM,[u("item-title-color")]:e.colorTextSecondary,[u("subtitle-font-size")]:e.fontSizeSM,[u("subtitle-line-height")]:e.lineHeightSM,[u("item-subtitle-color")]:e.colorTextQuaternary,[u("rail-size")]:e.lineWidth,[u("title-horizontal-rail-gap")]:"0px",flex:1,"&-wrapper":{paddingInline:e.paddingXXS,marginInline:e.calc(e.marginXXS).div(2).equal(),borderRadius:e.borderRadiusSM,cursor:"pointer",transition:`background-color ${e.motionDurationMid}`,"&:hover":{background:e.controlItemBgHover}},"&-icon":{[`${c}-icon-dot`]:{"&:after":{display:"none"}}},"&-title":{fontWeight:"normal",whiteSpace:"nowrap"},"&-content":{display:"none"}}}}};function OYn(e){return(e||"--ant-not-exist").replace(/var\((.*)\)/,"$1")}const Rve=(e,t,n)=>{const{calc:r,componentCls:o,descriptionMaxWidth:i,antCls:s}=e,l=`${o}-item`,[,c]=bi(s,"cmp-steps");return{[`@container style(${OYn(i)})`]:[{[`${l}-icon`]:{marginInlineStart:r(i).sub(c("icon-size")).div(2).equal()},[`${l}-rail`]:{width:"auto",insetInlineStart:r(i).add(c("icon-size")).div(2).add(t).equal(),insetInlineEnd:r(i).sub(c("icon-size")).div(2).sub(t).mul(-1).equal()}},n]}},$Yn=e=>{const{componentCls:t,descriptionMaxWidth:n,marginXS:r,fontHeightLG:o,margin:i,paddingSM:s,marginXXS:l,antCls:c,calc:u}=e,d=`${t}-item`,[p,h]=bi(c,"cmp-steps");return{[t]:{[p("icon-size-max")]:`max(${h("icon-size")}, ${h("icon-size-active",h("icon-size"))})`,[`${d}-icon`]:{marginBlockStart:`calc((${h("heading-height")} - ${h("icon-size")}) / 2)`}},[`${t}-title-horizontal`]:{[p("title-horizontal-item-margin")]:i,[p("title-horizontal-rail-margin")]:i,[p("title-horizontal-title-height")]:o,[p("heading-height")]:`max(${h("icon-size")}, ${h("title-horizontal-title-height")})`,[`&${t}-horizontal, &${t}-horizontal-alternate`]:{[`${d}:not(:first-child)`]:{marginInlineStart:h("title-horizontal-item-margin")},[`${d}:last-child`]:{flex:"0 1 auto"},[`${d}-wrapper`]:{columnGap:e.marginXS}},[`&${t}-vertical`]:{[`${d}-wrapper`]:{columnGap:e.margin},[`${d}-empty-header`]:{[`${d}-header`]:{minHeight:"auto"},[`${d}-content`]:{marginTop:u(h("heading-height")).sub(e.fontHeight).div(2).equal()}}},[`${d}-section`]:{flex:1,minWidth:0},[`${d}-header`]:{minHeight:h("heading-height")},[`${d}-title`]:{flex:"0 1 auto"},[`${d}-content`]:{maxWidth:n},[`${d}-subtitle`]:{flex:"0 9999 auto"},[`&${t}-horizontal ${d}-rail`]:{[p("item-wrapper-padding-top")]:"0px",flex:"1 1 0%",marginInlineStart:h("title-horizontal-rail-margin")}},[`${t}-title-vertical`]:{[p("title-vertical-row-gap")]:s,[p("title-horizontal-rail-gap")]:l,[p("heading-height")]:h("icon-size-max"),[`> ${d}`]:{flex:"1 1 0%",[`${d}-wrapper`]:{flexDirection:"column",rowGap:h("title-vertical-row-gap"),alignItems:"center"},[`${d}-section`]:{alignSelf:"stretch"},[`${d}-header`]:{flexDirection:"column",alignItems:"center"},[`${d}-title, ${d}-subtitle, ${d}-content`]:{textAlign:"center",maxWidth:"100%"},[`${d}-subtitle`]:{margin:0},[`${d}-rail`]:{position:"absolute",top:0,width:`calc(100% - ${h("icon-size")} - ${h("title-horizontal-rail-gap")} * 2)`,insetInlineStart:`calc(50% + ${h("icon-size")} / 2 + ${h("title-horizontal-rail-gap")})`}},...Rve(e,r,{[`${d}:last-child`]:{flex:"none"},[`${d}-icon`]:{alignSelf:"flex-start"},[`${d}-section`]:{width:n}})}}},DYn=e=>{const{componentCls:t,fontSizeIcon:n,navContentMaxWidth:r,navArrowColor:o,colorPrimary:i,motionDurationSlow:s,antCls:l,calc:c}=e,u=`${t}-item`,d=i,[p,h]=bi(l,"cmp-steps");return{[`${t}${t}-navigation`]:{[u.repeat(4)]:{display:"flex",justifyContent:"center",position:"relative",flex:1,marginInlineStart:0,[`${u}-wrapper`]:{paddingBlock:e.paddingSM},[`${u}-section`]:{maxWidth:r},[`${u}-rail`]:{display:"none"},"&:before":{position:"absolute",display:"block",backgroundColor:d,transition:`all ${s}`,transitionTimingFunction:"ease-out",content:'""'},"&:not(:last-child):after":{position:"absolute",display:"block",borderTop:`${Xe(e.lineWidth)} ${e.lineType} ${o}`,borderBottom:"none",borderInlineStart:"none",borderInlineEnd:`${Xe(e.lineWidth)} ${e.lineType} ${o}`,content:'""'},[`&${u}-active`]:{[p("item-content-active-color")]:h("item-content-color"),[p("item-icon-active-bg-color")]:h("item-icon-bg-color"),[p("item-icon-active-border-color")]:h("item-icon-border-color"),[p("item-icon-active-text-color")]:h("item-icon-text-color")}},[`&${t}-horizontal`]:{[u]:{"&:before":{bottom:0,insetInlineStart:"50%",width:0,height:e.lineWidthBold},[`&${u}-active:before`]:{insetInlineStart:0,width:"100%"},"&:not(:last-child):after":{top:"50%",insetInlineStart:c(n).div(2).mul(-1).add("100%").equal(),width:n,height:n,transform:"translateY(-50%) rotate(45deg)"}}},[`&${t}-vertical`]:{[u.repeat(4)]:{[`${u}-content`]:{padding:0},"&:before":{insetInlineEnd:0,top:"50%",width:e.lineWidthBold,height:0},[`&${u}-active::before`]:{top:0,height:"100%"},"&:not(:last-child):after":{left:{_skip_check_:!0,value:"50%"},top:"100%",width:c(n).div(3).mul(2).equal(),height:c(n).div(3).mul(2).equal(),transform:"translateY(-50%) translateX(-50%) rotate(135deg)"}}}}}},LYn=e=>{const{componentCls:t,lineWidthBold:n,borderRadius:r,borderRadiusSM:o,motionDurationMid:i,paddingXS:s,lineType:l,paddingSM:c,antCls:u,calc:d}=e,p=`${t}-item`,[h,m]=bi(u,"cmp-steps"),g=`${Xe(n)} ${l} ${m("panel-border-color")}`;return{[`${t}${t}-panel`]:[{[`${p}-rail`]:{display:"none"},[`&${t}-horizontal`]:{alignItems:"stretch",[p]:{flex:1,margin:0}}},{"&":{[h("panel-padding")]:c,[h("item-border-radius")]:r,[p]:{[h("panel-bg-color")]:m("item-icon-bg-color"),[h("panel-border-color")]:m("item-icon-border-color"),[h("panel-active-bg-color")]:m("item-icon-active-bg-color"),[h("panel-active-border-color")]:m("item-icon-active-border-color"),[h("panel-title-height")]:`calc(${m("title-font-size")} * ${m("title-line-height")})`,[h("item-base-height")]:d(m("panel-padding")).mul(2).add(m("icon-size")).add(m("panel-title-height")).equal(),[h("item-base-width")]:`calc(${m("item-base-height")} * 0.7071)`,transition:`background-color ${i}`}},[`${p}-icon`]:{display:"none"},[`${p}-header`]:{minHeight:"auto"},[`${t}-panel-arrow`]:{position:"absolute",top:d(n).mul(-1).equal(),insetInlineStart:"100%",zIndex:1,height:d(n).mul(2).add("100%").equal(),width:m("item-base-width"),overflow:"visible",strokeLinecap:"round",path:{fill:m("panel-bg-color"),stroke:m("panel-border-color"),strokeWidth:n,vectorEffect:"non-scaling-stroke",transition:`fill ${i}`}},[`${p}:last-child ${t}-panel-arrow`]:{display:"none"},[p]:{padding:m("panel-padding"),background:m("panel-bg-color"),position:"relative",borderBlock:g,"&:not(:first-child)":{paddingInlineStart:`calc(${m("panel-padding")} + ${m("item-base-width")})`},"&:first-child":{borderInlineStart:g,borderStartStartRadius:m("item-border-radius"),borderEndStartRadius:m("item-border-radius")},"&:last-child":{borderInlineEnd:g,borderStartEndRadius:m("item-border-radius"),borderEndEndRadius:m("item-border-radius")},"&-active":{background:m("panel-active-bg-color"),borderColor:m("panel-active-border-color"),[`${t}-panel-arrow`]:{path:{fill:m("panel-active-bg-color"),stroke:m("panel-active-border-color")}},[`${p}-title, ${p}-subtitle, ${p}-content`]:{color:m("item-icon-active-text-color")}}}},{[`&${t}-small`]:{[h("panel-padding")]:s,[h("item-border-radius")]:o}},{[`&${t}-filled`]:{[p]:{"&:not(:first-child)":{clipPath:`polygon(${[`${Xe(n)} 0`,`calc(100% + ${m("item-base-width")}) 0`,`calc(100% + ${m("item-base-width")}) 100%`,`${Xe(n)} 100%`,`calc(${m("item-base-width")} + ${Xe(n)}) 50%`].join(",")})`}}}},{[`&${t}-outlined`]:{[`${t}-panel-arrow`]:{top:d(n).div(2).mul(-1).equal(),height:d(n).add("100%").equal()}}}]}},FYn=e=>{const{calc:t,antCls:n,componentCls:r,lineWidthBold:o,motionDurationSlow:i}=e,s=`${r}-item`,[l,c]=bi(n,"cmp-steps"),u=t(o).add(o).equal();return{[`${r}${r}-with-progress`]:{[l("item-wrapper-padding-top")]:u,[`${s}${s}-process`]:{[`${s}-icon`]:{position:"relative"}},[`${s}-progress-icon`]:{"&-svg":{[l("svg-size")]:t(u).mul(2).add(c("icon-size")).equal(),[l("icon-size-ptg-unitless")]:`calc(100 / tan(atan2(${c("svg-size")}, 1px)))`,fontSize:c("svg-size"),lineHeight:c("icon-size-ptg-unitless"),position:"absolute",inset:t(u).mul(-1).equal(),width:"auto",height:"auto"},"&-circle":{lineHeight:c("icon-size-ptg-unitless"),strokeWidth:t(c("icon-size-ptg-unitless")).mul(o).equal(),[l("progress-radius")]:t(c("svg-size")).sub(o).mul(c("icon-size-ptg-unitless")).div(2).equal(),r:c("progress-radius"),fill:"none",cx:50,cy:50,transition:`all ${i} ease-in-out`,"&-rail":{stroke:e.colorSplit},"&-ptg":{stroke:e.colorPrimary}}}}}},zYn=e=>{const{componentCls:t,iconSize:n,dotSize:r,dotCurrentSize:o,marginXXS:i,lineWidthBold:s,fontSizeSM:l,antCls:c}=e,u=`${t}-item`,[d,p]=bi(c,"cmp-steps");return{[`${t}${t}-dot`]:{[d("icon-size-active")]:o,[d("icon-size")]:r,[d("dot-icon-size")]:r,[d("dot-icon-border-width")]:s,[d("rail-size")]:s,[d("icon-border-width")]:s,[`${u}-custom ${u}-icon`]:{fontSize:l},[`${u}-icon`]:{position:"relative","&:after":{content:'""',width:n,height:n,display:"block",position:"absolute",top:"50%",left:{_skip_check_:!0,value:"50%"},transform:"translate(-50%, -50%)"}},[`${u}-active ${u}-icon`]:{[d("icon-size")]:p("icon-size-active")},[`&${t}-horizontal`]:{[`&, &${t}-small`]:Rve(e,i)}}}},BYn=e=>{const{componentCls:t,lineWidthBold:n,antCls:r}=e,o=`${t}-item`,[,i]=bi(r,"cmp-steps");return{[`${t}${t}-rtl`]:{direction:"rtl",[`&${t}-navigation${t}-horizontal`]:{[`${o}:after`]:{transform:"translateY(-50%) rotate(-45deg)"}},[`&${t}-panel`]:{[`${t}-panel-arrow`]:{transform:"scaleX(-1)"},[`&${t}-filled`]:{[o]:{"&:not(:first-child)":{clipPath:`polygon(${[`calc(0px - ${i("item-base-width")}) 0px`,`calc(100% - ${Xe(n)}) 0px`,`calc(100% - ${i("item-base-width")} - ${Xe(n)}) 50%`,`calc(100% - ${Xe(n)}) 100%`,`calc(0px - ${i("item-base-width")}) 100%`].join(",")})`}}}}}}},HYn=e=>{const{componentCls:t,iconSizeSM:n,fontSize:r,lineHeight:o,marginXS:i,fontHeight:s,marginSM:l,paddingXS:c,antCls:u}=e,[d]=bi(u,"cmp-steps");return{[`${t}${t}-small`]:{[d("icon-size")]:n,[d("title-horizontal-item-margin")]:l,[d("title-vertical-row-gap")]:c,[d("title-font-size")]:r,[d("title-line-height")]:o,[d("title-horizontal-rail-margin")]:i,[d("title-horizontal-title-height")]:s,[`&${t}-horizontal${t}-title-vertical`]:Rve(e,i)}}},N7="wait",j7="process",E7="finish",I7="error",VYn=e=>{const{componentCls:t,colorTextDisabled:n,colorTextLightSolid:r,colorPrimary:o,colorTextLabel:i,colorError:s,colorErrorHover:l,colorErrorBgFilledHover:c,colorFillTertiary:u,colorErrorBg:d,colorPrimaryBgHover:p,colorPrimaryBg:h,colorText:m,colorTextDescription:g,colorBgContainer:y,colorPrimaryHover:x,lineType:v,antCls:b}=e,w=`${t}-item`,[S,C]=bi(b,"cmp-steps");return{[t]:[{[w]:{[S("item-solid-line-color")]:"#000",[S("item-title-color")]:"#000",[S("item-content-color")]:"#000",[S("item-subtitle-color")]:C("item-content-color"),[S("item-icon-custom-color")]:"#000",[S("item-icon-bg-color")]:"#000",[S("item-icon-border-color")]:"#000",[S("item-icon-text-color")]:"#fff",[S("item-icon-dot-color")]:"#000",[S("item-icon-dot-bg-color")]:C("item-icon-dot-color"),[S("item-icon-dot-border-color")]:C("item-icon-dot-color"),[S("item-text-hover-color")]:"#000",[S("item-icon-bg-hover-color")]:C("item-icon-bg-color"),[S("item-icon-border-hover-color")]:C("item-icon-border-color"),[S("item-icon-text-hover-color")]:C("item-icon-text-color"),[S("item-content-active-color")]:C("item-content-color"),[S("item-icon-active-bg-color")]:C("item-icon-bg-color"),[S("item-icon-active-border-color")]:C("item-icon-border-color"),[S("item-icon-active-text-color")]:C("item-icon-text-color"),[S("item-process-rail-line-style")]:v},[`${w}-rail`]:{borderColor:C("item-solid-line-color")},[`${w}-custom ${w}-icon`]:{color:C("item-icon-custom-color")},[`${w}-title`]:{color:C("item-title-color")},[`${w}-subtitle`]:{color:C("item-subtitle-color")},[`${w}-content`]:{color:C("item-content-color")},[`${w}-active ${w}-icon`]:{},[`${w}-active ${w}-content`]:{color:C("item-content-active-color")},[`${w}[role='button']:not(${w}-active):hover`]:{[`${w}-title, ${w}-content`]:{color:C("item-text-hover-color")}},[`&:not(${t}-dot)`]:{[`${w}:not(${w}-custom)`]:{[`${w}-icon`]:{background:C("item-icon-bg-color"),borderColor:C("item-icon-border-color"),color:C("item-icon-text-color")},[`&[role='button']:not(${w}-active):hover`]:{[`${w}-icon`]:{background:C("item-icon-bg-hover-color"),borderColor:C("item-icon-border-hover-color"),color:C("item-icon-text-hover-color")}},[`&${w}-active`]:{[`${w}-icon`]:{background:C("item-icon-active-bg-color"),borderColor:C("item-icon-active-border-color"),color:C("item-icon-active-text-color")}}}},[`&${t}-dot`]:{[`${w}-icon`]:{background:C("item-icon-dot-bg-color"),borderColor:C("item-icon-dot-border-color"),color:C("item-icon-dot-color"),[`&${w}-icon-dot-custom`]:{background:"transparent",border:"none"}}}},{[`${w}-${N7}`]:{[S("item-icon-custom-color")]:n,[S("item-title-color")]:g,[S("item-content-color")]:g,[S("item-content-active-color")]:m,[S("item-text-hover-color")]:x},[`${w}-rail-${N7}`]:{[S("item-solid-line-color")]:n},[`${w}-${j7}`]:{[S("item-icon-custom-color")]:o,[S("item-title-color")]:m,[S("item-content-color")]:g,[S("item-content-active-color")]:m,[S("item-text-hover-color")]:x},[`${w}-rail-${j7}`]:{[S("item-solid-line-color")]:o,[S("rail-line-style")]:C("item-process-rail-line-style")},[`${w}-${E7}`]:{[S("item-icon-custom-color")]:o,[S("item-title-color")]:m,[S("item-content-color")]:g,[S("item-content-active-color")]:m,[S("item-text-hover-color")]:x},[`${w}-rail-${E7}`]:{[S("item-solid-line-color")]:o},[`${w}-${I7}`]:{[S("item-icon-custom-color")]:s,[S("item-title-color")]:s,[S("item-content-color")]:s,[S("item-content-active-color")]:s,[S("item-text-hover-color")]:l},[`${w}-rail-${I7}`]:{[S("item-solid-line-color")]:s}},{[`&${t}-filled`]:{[w]:{[S("item-icon-dot-border-color")]:"transparent"},[`${w}-${N7}`]:{[S("item-icon-bg-color")]:u,[S("item-icon-border-color")]:"transparent",[S("item-icon-text-color")]:i,[S("item-icon-dot-bg-color")]:n,[S("item-icon-bg-hover-color")]:p,[S("item-icon-border-hover-color")]:"transparent",[S("item-icon-text-hover-color")]:o,[S("item-icon-active-bg-color")]:o,[S("item-icon-active-border-color")]:"transparent",[S("item-icon-active-text-color")]:r},[`${w}-${j7}, ${w}-${E7}`]:{[S("item-icon-bg-color")]:h,[S("item-icon-border-color")]:"transparent",[S("item-icon-text-color")]:o,[S("item-icon-dot-bg-color")]:o,[S("item-icon-bg-hover-color")]:p,[S("item-icon-border-hover-color")]:"transparent",[S("item-icon-text-hover-color")]:o,[S("item-icon-active-bg-color")]:o,[S("item-icon-active-border-color")]:"transparent",[S("item-icon-active-text-color")]:r},[`${w}-${I7}`]:{[S("item-icon-bg-color")]:d,[S("item-icon-border-color")]:"transparent",[S("item-icon-text-color")]:s,[S("item-icon-dot-bg-color")]:s,[S("item-icon-bg-hover-color")]:c,[S("item-icon-border-hover-color")]:"transparent",[S("item-icon-text-hover-color")]:s,[S("item-icon-active-bg-color")]:s,[S("item-icon-active-border-color")]:"transparent",[S("item-icon-active-text-color")]:r}}},{[`&${t}-outlined`]:{[w]:{[S("item-icon-dot-bg-color")]:"transparent"},[`${w}-${N7}`]:{[S("item-icon-bg-color")]:y,[S("item-icon-border-color")]:n,[S("item-icon-text-color")]:n,[S("item-icon-dot-color")]:n,[S("item-icon-bg-hover-color")]:"transparent",[S("item-icon-border-hover-color")]:x,[S("item-icon-text-hover-color")]:x,[S("item-icon-active-bg-color")]:u},[`${w}-${j7}, ${w}-${E7}`]:{[S("item-icon-bg-color")]:y,[S("item-icon-border-color")]:o,[S("item-icon-text-color")]:o,[S("item-icon-dot-color")]:o,[S("item-icon-bg-hover-color")]:"transparent",[S("item-icon-border-hover-color")]:x,[S("item-icon-text-hover-color")]:x,[S("item-icon-active-bg-color")]:h},[`${w}-${I7}`]:{[S("item-icon-bg-color")]:y,[S("item-icon-border-color")]:s,[S("item-icon-text-color")]:s,[S("item-icon-dot-color")]:s,[S("item-icon-bg-hover-color")]:"transparent",[S("item-icon-border-hover-color")]:l,[S("item-icon-text-hover-color")]:l,[S("item-icon-active-bg-color")]:d}}}]}},UYn=e=>{const{componentCls:t,marginXXS:n,paddingSM:r,controlHeight:o,antCls:i,calc:s}=e,l=`${t}-item`,[c,u]=bi(i,"cmp-steps");return{[`${t}-vertical`]:{[c("vertical-rail-margin")]:s(n).mul(1.5).equal(),flexDirection:"column",alignItems:"stretch",[`> ${l}`]:{minHeight:s(o).mul(1.5).equal(),paddingBottom:r,"&:last-child":{paddingBottom:0},[`${l}-icon`]:{marginInlineStart:`calc((${u("icon-size-max")} - ${u("icon-size")}) / 2)`},[`${l}-rail`]:{[c("rail-offset")]:s(u("heading-height")).sub(u("icon-size")).div(2).equal(),borderInlineStartWidth:u("rail-size"),position:"absolute",top:s(u("icon-size")).add(u("item-wrapper-padding-top")).add(u("rail-offset")).add(u("vertical-rail-margin")).equal(),insetInlineStart:s(u("icon-size-max")).div(2).equal(),bottom:s(u("vertical-rail-margin")).sub(u("rail-offset")).equal(),marginInlineStart:`calc(${u("rail-size")} / -2)`}}}}},WYn=e=>{const{componentCls:t,antCls:n}=e,r=`${t}-item`,[o,i]=bi(n,"cmp-steps");return{[t]:{[o("title-font-size")]:e.fontSizeLG,[o("title-line-height")]:e.lineHeightLG,[o("subtitle-font-size")]:e.fontSize,[o("subtitle-line-height")]:e.lineHeight,[o("item-wrapper-padding-top")]:"0px",[o("rail-size")]:e.lineWidth,[o("rail-line-style")]:e.lineType,...Ii(e),display:"flex",flexWrap:"nowrap",alignItems:"flex-start",[r]:{flex:"none",position:"relative"},[`${r}-wrapper`]:{display:"flex",flexWrap:"nowrap",paddingTop:i("item-wrapper-padding-top")},[`${r}-header`]:{display:"flex",flexWrap:"nowrap",alignItems:"center"},[`${r}-title`]:{color:e.colorText,fontSize:i("title-font-size"),lineHeight:i("title-line-height"),wordBreak:"break-word"},[`${r}-subtitle`]:{color:e.colorTextDescription,fontWeight:"normal",fontSize:i("subtitle-font-size"),lineHeight:i("subtitle-line-height"),marginInlineStart:e.marginXS,wordBreak:"break-word"},[`${r}-content`]:{color:e.colorTextDescription,fontSize:e.fontSize,lineHeight:e.lineHeight,wordBreak:"break-word"},[`${r}-rail`]:{borderStyle:i("rail-line-style"),borderWidth:0},[`${r}-title, ${r}-subtitle, ${r}-content, ${r}-rail`]:{transition:`all ${e.motionDurationSlow}`},[`&${t}-ellipsis`]:{[`${r}-title, ${r}-subtitle, ${r}-content`]:wh},[`${r}[role='button']:not(${r}-active):hover`]:{cursor:"pointer"}}}},GYn=e=>({titleLineHeight:e.controlHeight,customIconSize:e.controlHeight,customIconTop:0,customIconFontSize:e.controlHeightSM,iconSize:e.controlHeight,iconTop:-.5,iconFontSize:e.fontSize,iconSizeSM:e.fontSizeHeading3,dotSize:e.controlHeight/4,dotCurrentSize:e.controlHeightLG/4,navArrowColor:e.colorTextDisabled,navContentMaxWidth:"unset",descriptionMaxWidth:void 0,waitIconColor:e.wireframe?e.colorTextDisabled:e.colorTextLabel,waitIconBgColor:e.wireframe?e.colorBgContainer:e.colorFillContent,waitIconBorderColor:e.wireframe?e.colorTextDisabled:"transparent",finishIconBgColor:e.wireframe?e.colorBgContainer:e.controlItemBgActive,finishIconBorderColor:e.wireframe?e.colorPrimary:e.controlItemBgActive}),qYn=ui("Steps",e=>{const t=Ho(e,{inlineDotSize:6});return[WYn(t),MYn(t),UYn(t),kYn(t),$Yn(t),HYn(t),zYn(t),VYn(t),DYn(t),LYn(t),RYn(t),FYn(t),BYn(t)]},GYn),KYn={itemIcon:r6},Uut=e=>{const{size:t,className:n,rootClassName:r,style:o,variant:i="filled",type:s,classNames:l,styles:c,direction:u,orientation:d,responsive:p=!0,progressDot:h,labelPlacement:m,titlePlacement:g,ellipsis:y,offset:x=0,items:v,percent:b,current:w=0,onChange:S,iconRender:C,...N}=e,j=f.useContext(Vut),I=Zo("steps"),{getPrefixCls:_,direction:T,className:P,style:E}=I;let M,R,$={};j?$={root:j.rootComponent,item:j.itemComponent}:{classNames:M,styles:R}=I;const D=_(),z=_("steps",e.prefixCls),V=`${z}-item-icon`,[B,G]=qYn(z),[H]=bi(D,"cmp-steps"),F=ad(t),W=f.useMemo(()=>(v||[]).filter(Boolean),[v]),{xs:U}=p5(p),K=f.useMemo(()=>s&&s!=="default"?s:h?"dot":s,[h,s]),X=K==="inline",J=K==="dot"||K==="inline",te=f.useMemo(()=>K==="dot"&&typeof h=="function"?h:void 0,[K,h]),re=f.useMemo(()=>{const _e=d||u;return K==="panel"?"horizontal":p&&U||_e==="vertical"?"vertical":"horizontal"},[d,u,K,p,U]),ce=f.useMemo(()=>J||re==="vertical"?re==="vertical"?"horizontal":"vertical":s==="navigation"?"horizontal":g||m||"horizontal",[J,m,re,g,s]),ae=X?void 0:b,oe={...e,variant:i,size:F,type:K,orientation:re,titlePlacement:ce,current:w,percent:ae,responsive:p,offset:x},[ue,fe]=di([KYn,M,l],[R,c],{props:oe}),se=(_e,xe)=>{const{item:we,index:Te,active:Re,components:{Icon:Ue}}=xe,{status:He,icon:Ye}=we;let We=null;if(J||Ye)We=Ye;else switch(He){case"finish":We=f.createElement(UK,{className:`${V}-finish`});break;case"error":We=f.createElement(_y,{className:`${V}-error`});break;default:{let Oe=f.createElement("span",{className:`${V}-number`},xe.index+1);He==="process"&&ae!==void 0&&(Oe=f.createElement(TYn,{prefixCls:z,rootPrefixCls:D,percent:ae},Oe)),We=Oe}}let at=f.createElement(Ue,null,We);return C?at=C(at,{index:Te,active:Re,item:we,components:{Icon:Ue}}):typeof te=="function"&&(at=te(at,{index:Te,...we})),at},ge=(_e,xe)=>{let we=_e;return X&&xe.item.content&&(we=f.createElement(pf,{destroyOnHidden:!0,title:xe.item.content},_e)),f.createElement(o6,{component:"Steps",disabled:xe.item.disabled||!S,colorSource:i==="filled"?"color":null},we)},ye=K==="panel"?_e=>f.createElement(f.Fragment,null,_e,f.createElement(AYn,{prefixCls:z})):void 0,de={[H("items-offset")]:`${x}`,...E,...o},Ne=be(P,`${z}-${i}`,{[`${z}-${K}`]:K!=="dot"?K:!1,[`${z}-rtl`]:T==="rtl",[`${z}-dot`]:J,[`${z}-ellipsis`]:y,[`${z}-with-progress`]:ae!==void 0,[`${z}-${F}`]:F},n,r,B,G);return f.createElement(PYn,{...N,prefixCls:z,className:Ne,style:de,classNames:ue,styles:fe,orientation:re,titlePlacement:ce,components:$,current:w,items:W,onChange:S,iconRender:se,itemRender:ge,itemWrapperRender:ye})},a2={},x6="rc-table-internal-hook";function Ove(e){const t=f.createContext(void 0);return{Context:t,Provider:({value:r,children:o})=>{const i=f.useRef(r);i.current=r;const[s]=f.useState(()=>({getValue:()=>i.current,listeners:new Set}));return Po(()=>{pu.unstable_batchedUpdates(()=>{s.listeners.forEach(l=>{l(r)})})},[r]),f.createElement(t.Provider,{value:s},o)},defaultValue:e}}function Rd(e,t){const n=Vr(typeof t=="function"?t:c=>{if(t===void 0)return c;if(!Array.isArray(t))return c[t];const u={};return t.forEach(d=>{u[d]=c[d]}),u}),r=f.useContext(e==null?void 0:e.Context),{listeners:o,getValue:i}=r||{},s=f.useRef();s.current=n(r?i():e==null?void 0:e.defaultValue);const[,l]=f.useState({});return Po(()=>{if(!r)return;function c(u){const d=n(u);hy(s.current,d,!0)||l({})}return o.add(c),()=>{o.delete(c)}},[r]),s.current}function $O(){return $O=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const d=s?{ref:u}:{},p=f.useRef(0),h=f.useRef(c);return t()!==null?f.createElement(o,$O({},c,d)):((!i||i(h.current,c))&&(p.current+=1),h.current=c,f.createElement(e.Provider,{value:p.current},f.createElement(o,$O({},c,d))))};return s?f.forwardRef(l):l}function r(o,i){const s=pb(o),l=(c,u)=>{const d=s?{ref:u}:{};return t(),f.createElement(o,$O({},c,d))};return f.memo(s?f.forwardRef(l):l,i)}return{makeImmutable:n,responseImmutable:r,useImmutableMark:t}}const{makeImmutable:Wut,responseImmutable:Yk,useImmutableMark:XYn}=YYn(),Yf=Ove(),Gut=f.createContext({renderWithProps:!1}),QYn="RC_TABLE_KEY";function JYn(e){return e==null?[]:Array.isArray(e)?e:[e]}function aY(e){const t=[],n={};return e.forEach(r=>{const{key:o,dataIndex:i}=r||{};let s=o||JYn(i).join("-")||QYn;for(;n[s];)s=`${s}_next`;n[s]=!0,t.push(s)}),t}function Fue(e){return e!=null}function ZYn(e){return typeof e=="number"&&!Number.isNaN(e)}function eXn(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!f.isValidElement(e)}function tXn(e,t,n,r,o,i){const s=f.useContext(Gut),l=XYn();return u5(()=>{if(Fue(r))return[r];const u=t==null||t===""?[]:Array.isArray(t)?t:[t],d=Cp(e,u);let p=d,h;if(o){const m=o(d,e,n);eXn(m)?(p=m.children,h=m.props,s.renderWithProps=!0):p=m}return[p,h]},[l,e,r,t,o,n],(u,d)=>{if(i){const[,p]=u,[,h]=d;return i(h,p)}return s.renderWithProps?!0:!hy(u,d,!0)})}function nXn(e,t,n,r){const o=e+t-1;return e<=r&&o>=n}function rXn(e,t){return Rd(Yf,n=>[nXn(e,t||1,n.hoverStartRow,n.hoverEndRow),n.onHover])}function zue(){return zue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var i,s;let r;const o=e===!0?{showTitle:!0}:e;return o&&(o.showTitle||t==="header")&&(typeof n=="string"||typeof n=="number"?r=n.toString():f.isValidElement(n)&&typeof((i=n.props)==null?void 0:i.children)=="string"&&(r=(s=n.props)==null?void 0:s.children)),r},iXn=e=>{const{component:t,children:n,ellipsis:r,scope:o,prefixCls:i,className:s,style:l,align:c,record:u,render:d,dataIndex:p,renderIndex:h,shouldCellUpdate:m,index:g,rowType:y,colSpan:x,rowSpan:v,fixStart:b,fixEnd:w,fixedStartShadow:S,fixedEndShadow:C,offsetFixedStartShadow:N,offsetFixedEndShadow:j,zIndex:I,zIndexReverse:_,appendNode:T,additionalProps:P={},isSticky:E}=e,M=`${i}-cell`,{allColumnsFixedLeft:R,rowHoverable:$}=Rd(Yf,["allColumnsFixedLeft","rowHoverable"]),[D,z]=tXn(u,p,h,n,d,m),V={},B=typeof b=="number"&&!R,G=typeof w=="number"&&!R,[H,F]=Rd(Yf,({scrollInfo:fe})=>{if(!B&&!G)return[!1,!1];const[se,ge]=fe,ye=(B&&S&&se)-N>=1,de=(G&&C&&ge-se)-j>1;return[ye,de]});B&&(V.insetInlineStart=b,V["--z-offset"]=I,V["--z-offset-reverse"]=_),G&&(V.insetInlineEnd=w,V["--z-offset"]=I,V["--z-offset-reverse"]=_);const W=(z==null?void 0:z.colSpan)??P.colSpan??x??1,U=(z==null?void 0:z.rowSpan)??P.rowSpan??v??1,[K,X]=rXn(g,U),J=Vr(fe=>{var se;u&&X(g,g+U-1),(se=P==null?void 0:P.onMouseEnter)==null||se.call(P,fe)}),te=Vr(fe=>{var se;u&&X(-1,-1),(se=P==null?void 0:P.onMouseLeave)==null||se.call(P,fe)});if(W===0||U===0)return null;const re=P.title??oXn({rowType:y,ellipsis:r,children:D}),ce=be(M,s,{[`${M}-fix`]:B||G,[`${M}-fix-start`]:B,[`${M}-fix-end`]:G,[`${M}-fix-start-shadow`]:S,[`${M}-fix-start-shadow-show`]:S&&H,[`${M}-fix-end-shadow`]:C,[`${M}-fix-end-shadow-show`]:C&&F,[`${M}-ellipsis`]:r,[`${M}-with-append`]:T,[`${M}-fix-sticky`]:(B||G)&&E,[`${M}-row-hover`]:!z&&K},P.className,z==null?void 0:z.className),ae={};c&&(ae.textAlign=c);const oe={...z==null?void 0:z.style,...V,...ae,...P.style,...l};let ue=D;return typeof ue=="object"&&!Array.isArray(ue)&&!f.isValidElement(ue)&&(ue=null),r&&(S||C)&&(ue=f.createElement("span",{className:`${M}-content`},ue)),f.createElement(t,zue({},z,P,{className:ce,style:oe,title:re,scope:o,onMouseEnter:$?J:void 0,onMouseLeave:$?te:void 0,colSpan:W!==1?W:null,rowSpan:U!==1?U:null}),T,ue)},Xk=f.memo(iXn);function _7(e){return e.fixed==="start"}function P7(e){return e.fixed==="end"}function $ve(e,t,n,r){const o=n[e]||{},i=n[t]||{};let s=null,l=null;_7(o)&&_7(i)?s=r.start[e]:P7(i)&&P7(o)&&(l=r.end[t]);let c=!1,u=!1,d=0,p=0;s!==null&&(c=!n[t+1]||!_7(n[t+1]),d=n.length*2-e,p=n.length+e),l!==null&&(u=!n[e-1]||!P7(n[e-1]),d=t,p=n.length-t);let h=0,m=0;if(c)for(let g=0;gt;g-=1)P7(n[g])||(m+=r.widths[g]||0);return{fixStart:s,fixEnd:l,fixedStartShadow:c,fixedEndShadow:u,offsetFixedStartShadow:h,offsetFixedEndShadow:m,isSticky:r.isSticky,zIndex:d,zIndexReverse:p}}const qut=f.createContext({});function Bue(){return Bue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{className:t,index:n,children:r,colSpan:o=1,rowSpan:i,align:s}=e,{prefixCls:l}=Rd(Yf,["prefixCls"]),{scrollColumnIndex:c,stickyOffsets:u,flattenColumns:d}=f.useContext(qut),h=n+o-1+1===c?o+1:o,m=f.useMemo(()=>$ve(n,n+h-1,d,u),[n,h,d,u]);return f.createElement(Xk,Bue({className:t,index:n,component:"td",prefixCls:l,record:null,dataIndex:null,align:s,colSpan:h,rowSpan:i,render:()=>r},m))},sXn=e=>{const{children:t,...n}=e;return f.createElement("tr",n,t)},sY=e=>{const{children:t}=e;return t};sY.Row=sXn;sY.Cell=aXn;const lXn=e=>{const{children:t,stickyOffsets:n,flattenColumns:r}=e,o=Rd(Yf,"prefixCls"),i=r.length-1,s=r[i],l=f.useMemo(()=>({stickyOffsets:n,flattenColumns:r,scrollColumnIndex:s!=null&&s.scrollbar?i:null}),[s,r,i,n]);return f.createElement(qut.Provider,{value:l},f.createElement("tfoot",{className:`${o}-summary`},t))},A7=Yk(lXn),Kut=sY;function cXn(e){return null}function uXn(e){return null}function Yut(e,t,n,r,o,i,s){const l=i(t,s);e.push({record:t,indent:n,index:s,rowKey:l});const c=o==null?void 0:o.has(l);if(t&&Array.isArray(t[r])&&c)for(let u=0;u{if(n!=null&&n.size){const i=[];for(let s=0;s<(e==null?void 0:e.length);s+=1){const l=e[s];Yut(i,l,0,t,n,r,s)}return i}return e==null?void 0:e.map((i,s)=>({record:i,indent:0,index:s,rowKey:r(i,s)}))},[e,t,n,r])}function Qut(e,t,n,r){const o=Rd(Yf,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),{flattenColumns:i,expandableType:s,expandedKeys:l,childrenColumnName:c,onTriggerExpand:u,rowExpandable:d,onRow:p,expandRowByClick:h,rowClassName:m}=o,g=s==="nest",y=s==="row"&&(!d||d(e)),x=y||g,v=l&&l.has(t),b=c&&e&&e[c],w=Vr(u),S=p==null?void 0:p(e,n),C=S==null?void 0:S.onClick,N=(_,...T)=>{h&&x&&u(e,_),C==null||C(_,...T)};let j;typeof m=="string"?j=m:typeof m=="function"&&(j=m(e,n,r));const I=aY(i);return{...o,columnsKey:I,nestExpandable:g,expanded:v,hasNestChildren:b,record:e,onTriggerExpand:w,rowSupportExpand:y,expandable:x,rowProps:{...S,className:be(j,S==null?void 0:S.className),onClick:N}}}const Jut=e=>{const{prefixCls:t,children:n,component:r,cellComponent:o,className:i,expanded:s,colSpan:l,isEmpty:c,stickyOffset:u=0}=e,{scrollbarSize:d,fixHeader:p,fixColumn:h,componentWidth:m,horizonScroll:g}=Rd(Yf,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]);let y=n;return(c?g&&m:h)&&(y=f.createElement("div",{style:{width:m-u-(p&&!c?d:0),position:"sticky",left:u,overflow:"hidden"},className:`${t}-expanded-row-fixed`},y)),f.createElement(r,{className:i,style:{display:s?null:"none"}},f.createElement(Xk,{component:o,prefixCls:t,colSpan:l},y))};function dXn({prefixCls:e,record:t,onExpand:n,expanded:r,expandable:o}){const i=`${e}-row-expand-icon`;if(!o)return f.createElement("span",{className:be(i,`${e}-row-spaced`)});const s=l=>{n(t,l),l.stopPropagation()};return f.createElement("span",{className:be(i,{[`${e}-row-expanded`]:r,[`${e}-row-collapsed`]:!r}),onClick:s})}function fXn(e,t,n){const r=[];function o(i){(i||[]).forEach((s,l)=>{r.push(t(s,l)),o(s[n])})}return o(e),r}function Zut(e,t,n,r){return typeof e=="string"?e:typeof e=="function"?e(t,n,r):""}function eW(){return eW=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{className:t,style:n,classNames:r,styles:o,record:i,index:s,renderIndex:l,rowKey:c,rowKeys:u,indent:d=0,rowComponent:p,cellComponent:h,scopeCellComponent:m,expandedRowInfo:g}=e,y=Qut(i,c,s,d),{prefixCls:x,flattenColumns:v,expandedRowClassName:b,expandedRowRender:w,rowProps:S,expanded:C,rowSupportExpand:N}=y,j=f.useRef(!1);j.current||(j.current=C);const I=Zut(b,i,s,d),_=f.createElement(p,eW({},S,{"data-row-key":c,className:be(t,`${x}-row`,`${x}-row-level-${d}`,S==null?void 0:S.className,r.row,{[I]:d>=1}),style:{...n,...S==null?void 0:S.style,...o.row}}),v.map((P,E)=>{const{render:M,dataIndex:R,className:$}=P,{key:D,fixedInfo:z,appendCellNode:V,additionalCellProps:B}=edt(y,P,E,d,s,u,g==null?void 0:g.offset);return f.createElement(Xk,eW({className:be($,r.cell),style:o.cell,ellipsis:P.ellipsis,align:P.align,scope:P.rowScope,component:P.rowScope?m:h,prefixCls:x,key:D,record:i,index:s,renderIndex:l,dataIndex:R,render:M,shouldCellUpdate:P.shouldCellUpdate},z,{appendNode:V,additionalProps:B}))}));let T;if(N&&(j.current||C)){const P=w(i,s,d+1,C);T=f.createElement(Jut,{expanded:C,className:be(`${x}-expanded-row`,`${x}-expanded-row-level-${d+1}`,I),prefixCls:x,component:p,cellComponent:h,colSpan:g?g.colSpan:v.length,isEmpty:!1,stickyOffset:g==null?void 0:g.sticky},P)}return f.createElement(f.Fragment,null,_,T)},hXn=Yk(pXn),mXn=e=>{const{columnKey:t,onColumnResize:n,title:r}=e,o=f.useRef(null);return Po(()=>{o.current&&n(t,o.current.offsetWidth)},[]),f.createElement(Uf,{data:t},f.createElement("td",{ref:o,style:{paddingTop:0,paddingBottom:0,borderTop:0,borderBottom:0,height:0}},f.createElement("div",{style:{height:0,overflow:"hidden",fontWeight:"bold"}},r||" ")))},gXn=({prefixCls:e,columnsKey:t,onColumnResize:n,columns:r})=>{const o=f.useRef(null),{measureRowRender:i}=Rd(Yf,["measureRowRender"]),s=f.createElement("tr",{"aria-hidden":"true",className:`${e}-measure-row`,style:{height:0},ref:o},f.createElement(Uf.Collection,{onBatchResize:l=>{Dk(o.current)&&l.forEach(({data:c,size:u})=>{n(c,u.offsetWidth)})}},t.map(l=>{const c=r.find(p=>p.key===l),u=c==null?void 0:c.title,d=f.isValidElement(u)?f.cloneElement(u,{ref:null}):u;return f.createElement(mXn,{key:l,columnKey:l,onColumnResize:n,title:d})})));return typeof i=="function"?i(s):s},xXn=e=>{const{data:t,measureColumnWidth:n}=e,{prefixCls:r,getComponent:o,onColumnResize:i,flattenColumns:s,getRowKey:l,expandedKeys:c,childrenColumnName:u,emptyNode:d,classNames:p,styles:h,expandedRowOffset:m=0,colWidths:g}=Rd(Yf,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode","classNames","styles","expandedRowOffset","fixedInfoList","colWidths"]),{body:y={}}=p||{},{body:x={}}=h||{},v=Xut(t,u,c,l),b=f.useMemo(()=>v.map(P=>P.rowKey),[v]),w=f.useRef({renderWithProps:!1}),S=f.useMemo(()=>{const P=s.length-m;let E=0;for(let M=0;M{const{record:M,indent:R,index:$,rowKey:D}=P;return f.createElement(hXn,{classNames:y,styles:x,key:D,rowKey:D,rowKeys:b,record:M,index:E,renderIndex:$,rowComponent:N,cellComponent:j,scopeCellComponent:I,indent:R,expandedRowInfo:S})}):_=f.createElement(Jut,{expanded:!0,className:`${r}-placeholder`,prefixCls:r,component:N,cellComponent:j,colSpan:s.length,isEmpty:!0},d);const T=aY(s);return f.createElement(Gut.Provider,{value:w.current},f.createElement(C,{style:x.wrapper,className:be(`${r}-tbody`,y.wrapper)},n&&f.createElement(gXn,{prefixCls:r,columnsKey:T,onColumnResize:i,columns:s}),_))},yXn=Yk(xXn),DO="RC_TABLE_INTERNAL_COL_DEFINE";function vXn(e){const{expandable:t,...n}=e;let r;return"expandable"in e?r={...n,...t}:r=n,r.showExpandColumn===!1&&(r.expandIconColumnIndex=-1),r}function Hue(){return Hue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{colWidths:t,columns:n,columCount:r}=e,{tableLayout:o}=Rd(Yf,["tableLayout"]),i=[],s=r||n.length;let l=!1;for(let c=s-1;c>=0;c-=1){const u=t[c],d=n&&n[c];let p,h;if(d&&(p=d[DO],o==="auto"&&(h=d.minWidth)),u||h||p||l){const{columnType:m,...g}=p||{};i.unshift(f.createElement("col",Hue({key:c,style:{width:u,minWidth:h}},g))),l=!0}}return i.length>0?f.createElement("colgroup",null,i):null};function bXn(e,t){return f.useMemo(()=>{const n=[];for(let r=0;r{const{className:n,style:r,noData:o,columns:i,flattenColumns:s,colWidths:l,colGroup:c,columCount:u,stickyOffsets:d,direction:p,fixHeader:h,stickyTopOffset:m,stickyBottomOffset:g,stickyClassName:y,scrollX:x,tableLayout:v="fixed",onScroll:b,maxContentScroll:w,children:S,...C}=e,{prefixCls:N,scrollbarSize:j,isSticky:I,getComponent:_}=Rd(Yf,["prefixCls","scrollbarSize","isSticky","getComponent"]),T=_(["header","table"],"table"),P=I&&!h?0:j,E=f.useRef(null),M=f.useCallback(H=>{ile(t,H),ile(E,H)},[]);f.useEffect(()=>{function H(W){const{currentTarget:U,deltaX:K}=W;if(K){const{scrollLeft:X,scrollWidth:J,clientWidth:te}=U,re=J-te;let ce=X+K;p==="rtl"?(ce=Math.max(-re,ce),ce=Math.min(0,ce)):(ce=Math.min(re,ce),ce=Math.max(0,ce)),b({currentTarget:U,scrollLeft:ce}),W.preventDefault()}}const F=E.current;return F==null||F.addEventListener("wheel",H,{passive:!1}),()=>{F==null||F.removeEventListener("wheel",H)}},[]);const R=s[s.length-1],$={fixed:R?R.fixed:null,scrollbar:!0,onHeaderCell:()=>({className:`${N}-cell-scrollbar`})},D=f.useMemo(()=>P?[...i,$]:i,[P,i]),z=f.useMemo(()=>P?[...s,$]:s,[P,s]),V=f.useMemo(()=>{const{start:H,end:F}=d;return{...d,start:H,end:[...F.map(W=>W+P),0],isSticky:I}},[P,d,I]),B=bXn(l,u),G=f.useMemo(()=>{const H=!B||!B.length||B.every(F=>!F);return o||H},[o,B]);return f.createElement("div",{style:{overflow:"hidden",...I?{top:m,bottom:g}:{},...r},ref:M,className:be(n,{[y]:!!y})},f.createElement(T,{style:{tableLayout:v,minWidth:"100%",width:x}},G?c:f.createElement(tdt,{colWidths:[...B,P],columCount:u+1,columns:z}),S({...C,stickyOffsets:V,columns:D,flattenColumns:z})))}),jDe=f.memo(wXn);function tW(){return tW=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{cells:t,stickyOffsets:n,flattenColumns:r,rowComponent:o,cellComponent:i,onHeaderRow:s,index:l,classNames:c,styles:u}=e,{prefixCls:d}=Rd(Yf,["prefixCls"]);let p;s&&(p=s(t.map(m=>m.column),l));const h=aY(t.map(m=>m.column));return f.createElement(o,tW({},p,{className:c.row,style:u.row}),t.map((m,g)=>{var C;const{column:y,colStart:x,colEnd:v,colSpan:b}=m,w=$ve(x,v,r,n),S=((C=y==null?void 0:y.onHeaderCell)==null?void 0:C.call(y,y))||{};return f.createElement(Xk,tW({},m,{scope:y.title?b>1?"colgroup":"col":null,ellipsis:y.ellipsis,align:y.align,component:i,prefixCls:d,key:h[g]},w,{additionalProps:S,rowType:"header"}))}))};function CXn(e,t,n){const r=[];function o(s,l,c=0){r[c]=r[c]||[];let u=l;return s.filter(Boolean).map(p=>{const h={key:p.key,className:be(p.className,t.cell)||"",style:n.cell,children:p.title,column:p,colStart:u};let m=1;const g=p.children;return g&&g.length>0&&(m=o(g,u,c+1).reduce((y,x)=>y+x,0),h.hasSubColumns=!0),"colSpan"in p&&({colSpan:m}=p),"rowSpan"in p&&(h.rowSpan=p.rowSpan),h.colSpan=m,h.colEnd=h.colStart+m-1,r[c].push(h),u+=m,m})}o(e,0);const i=r.length;for(let s=0;s{!("rowSpan"in l)&&!l.hasSubColumns&&(l.rowSpan=i-s)});return r}const NXn=e=>{const{stickyOffsets:t,columns:n,flattenColumns:r,onHeaderRow:o}=e,{prefixCls:i,getComponent:s,classNames:l,styles:c}=Rd(Yf,["prefixCls","getComponent","classNames","styles"]),{header:u={}}=l||{},{header:d={}}=c||{},p=f.useMemo(()=>CXn(n,u,d),[n,u,d]),h=s(["header","wrapper"],"thead"),m=s(["header","row"],"tr"),g=s(["header","cell"],"th");return f.createElement(h,{className:be(`${i}-thead`,u.wrapper),style:d.wrapper},p.map((y,x)=>f.createElement(SXn,{classNames:u,styles:d,key:x,flattenColumns:r,cells:y,stickyOffsets:t,rowComponent:m,cellComponent:g,onHeaderRow:o,index:x})))},EDe=Yk(NXn);function IDe(e,t=""){return typeof t=="number"?t:t.endsWith("%")?e*parseFloat(t)/100:null}function jXn(e,t,n){return f.useMemo(()=>{if(t&&t>0){let r=0,o=0;e.forEach(p=>{const h=IDe(t,p.width);h?r+=h:o+=1});const i=Math.max(t,n);let s=Math.max(i-r,o),l=o;const c=s/o;let u=0;const d=e.map(p=>{const h={...p},m=IDe(t,h.width);if(m)h.width=m;else{const g=Math.floor(c);h.width=l===1?s:g,s-=g,l-=1}return u+=h.width,h});if(u{const g=Math.floor(h.width*p);h.width=m===d.length-1?s:g,s-=g})}return[d,Math.max(u,i)]}return[e,t]},[e,t,n])}function Dve(e){return Bu(e).filter(t=>f.isValidElement(t)).map(t=>{const{key:n,props:r}=t,{children:o,...i}=r,s={key:n,...i};return o&&(s.children=Dve(o)),s})}function ndt(e){return e.filter(t=>t&&typeof t=="object"&&!t.hidden).map(t=>{const n=t.children;return n&&n.length>0?{...t,children:ndt(n)}:t})}function rdt(e,t="key"){return e.filter(n=>n&&typeof n=="object").reduce((n,r,o)=>{const{fixed:i}=r,s=i===!0||i==="left"?"start":i==="right"?"end":i,l=`${t}-${o}`,c=r.children;return c&&c.length>0?[...n,...rdt(c,l).map(u=>({...u,fixed:u.fixed??s}))]:[...n,{key:l,...r,fixed:s}]},[])}function EXn({prefixCls:e,columns:t,children:n,expandable:r,expandedKeys:o,columnTitle:i,getRowKey:s,onTriggerExpand:l,expandIcon:c,rowExpandable:u,expandIconColumnIndex:d,expandedRowOffset:p=0,direction:h,expandRowByClick:m,columnWidth:g,fixed:y,scrollWidth:x,clientWidth:v},b){const w=f.useMemo(()=>{const _=t||Dve(n)||[];return ndt(_.slice())},[t,n]),S=f.useMemo(()=>{if(r){let _=w.slice();if(!_.includes(a2)){const R=d||0,$=R===0&&(y==="right"||y==="end")?w.length:R;$>=0&&_.splice($,0,a2)}const T=_.indexOf(a2);_=_.filter((R,$)=>R!==a2||$===T);const P=w[T];let E;y?E=y:E=P?P.fixed:null;const M={[DO]:{className:`${e}-expand-icon-col`,columnType:"EXPAND_COLUMN"},title:i,fixed:E,className:`${e}-row-expand-icon-cell`,width:g,render:(R,$,D)=>{const z=s($,D),V=o.has(z),B=u?u($):!0,G=c({prefixCls:e,expanded:V,expandable:B,record:$,onExpand:l});return m?f.createElement("span",{onClick:H=>H.stopPropagation()},G):G}};return _.map((R,$)=>{const D=R===a2?M:R;return $_!==a2)},[r,w,s,o,c,h,p]),C=f.useMemo(()=>{let _=S;return b&&(_=b(_)),_.length||(_=[{render:()=>null}]),_},[b,S,h]),N=f.useMemo(()=>rdt(C),[C,h,x]),[j,I]=jXn(N,x,v);return[C,j,I]}function IXn(e,t,n){const r=vXn(e),{expandIcon:o,expandedRowKeys:i,defaultExpandedRowKeys:s,defaultExpandAllRows:l,expandedRowRender:c,onExpand:u,onExpandedRowsChange:d,childrenColumnName:p}=r,h=o||dXn,m=p||"children",g=f.useMemo(()=>c?"row":e.expandable&&e.internalHooks===x6&&e.expandable.__PARENT_RENDER_ICON__||t.some(w=>w&&typeof w=="object"&&w[m])?"nest":!1,[!!c,t]),[y,x]=f.useState(()=>s||(l?fXn(t,n,m):[])),v=f.useMemo(()=>new Set(i||y||[]),[i,y]),b=f.useCallback(w=>{const S=n(w,t.indexOf(w));let C;const N=v.has(S);N?(v.delete(S),C=[...v]):C=[...v,S],x(C),u&&u(!N,w),d&&d(C)},[n,v,t,u,d]);return[r,g,v,h,m,b]}function _Xn(e,t){const n=f.useMemo(()=>e.map((r,o)=>$ve(o,o,e,t)),[e,t]);return u5(()=>n,[n],(r,o)=>!hy(r,o))}function PXn(e){const t=f.useRef(e),[,n]=f.useState({}),r=f.useRef(null),o=f.useRef([]);function i(s){o.current.push(s);const l=Promise.resolve();r.current=l,l.then(()=>{if(r.current===l){const c=o.current,u=t.current;o.current=[],c.forEach(d=>{t.current=d(t.current)}),r.current=null,u!==t.current&&n({})}})}return f.useEffect(()=>()=>{r.current=null},[]),[t.current,i]}function AXn(e){const t=f.useRef(null),n=f.useRef(null);function r(){clearTimeout(n.current)}function o(s){t.current=s,r(),n.current=setTimeout(()=>{t.current=null,n.current=void 0},100)}function i(){return t.current}return f.useEffect(()=>r,[]),[o,i]}function TXn(){const[e,t]=f.useState(-1),[n,r]=f.useState(-1),o=f.useCallback((i,s)=>{t(i),r(s)},[]);return[e,n,o]}const _De=Ih()?window:null;function kXn(e,t){const{offsetHeader:n=0,offsetSummary:r=0,offsetScroll:o=0,getContainer:i=()=>_De}=typeof e=="object"?e:{},s=i()||_De,l=!!e;return f.useMemo(()=>({isSticky:l,stickyClassName:l?`${t}-sticky-holder`:"",offsetHeader:n,offsetSummary:r,offsetScroll:o,container:s}),[l,o,n,r,t,s])}function MXn(e,t){return f.useMemo(()=>{const r=t.length,o=(l,c,u)=>{const d=[];let p=0;for(let h=l;h!==c;h+=u)d.push(p),t[h].fixed&&(p+=e[h]||0);return d},i=o(0,r,1),s=o(r-1,-1,-1).reverse();return{start:i,end:s,widths:e}},[e,t])}const PDe=e=>{const{children:t,className:n,style:r}=e;return f.createElement("div",{className:n,style:r},t)};function ADe(e){const n=hb(e).getBoundingClientRect(),r=document.documentElement;return{left:n.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||document.body.clientLeft||0),top:n.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||document.body.clientTop||0)}}const TDe="mouseup",kDe="mousemove",N_="scroll",MDe="resize",RXn=(e,t)=>{var j,I;const{scrollBodyRef:n,onScroll:r,offsetScroll:o,container:i,direction:s}=e,l=Rd(Yf,"prefixCls"),c=((j=n.current)==null?void 0:j.scrollWidth)||0,u=((I=n.current)==null?void 0:I.clientWidth)||0,d=c&&u*(u/c),p=f.useRef(null),[h,m]=PXn({scrollLeft:0,isHiddenScrollBar:!0}),g=f.useRef({delta:0,x:0}),[y,x]=f.useState(!1),v=f.useRef(null);f.useEffect(()=>()=>{Bo.cancel(v.current)},[]);const b=()=>{x(!1)},w=_=>{_.persist(),g.current.delta=_.pageX-h.scrollLeft,g.current.x=0,x(!0),_.preventDefault()},S=_=>{const{buttons:T}=_||(window==null?void 0:window.event);if(!y||T===0){y&&x(!1);return}let P=g.current.x+_.pageX-g.current.x-g.current.delta;const E=s==="rtl";P=Math.max(E?d-u:0,Math.min(E?0:u-d,P)),(!E||Math.abs(P)+Math.abs(d){Bo.cancel(v.current),v.current=Bo(()=>{if(!n.current)return;const _=ADe(n.current).top,T=_+n.current.offsetHeight,P=i===window?document.documentElement.scrollTop+window.innerHeight:ADe(i).top+i.clientHeight;T-JRe()<=P||_>=P-o?m(E=>({...E,isHiddenScrollBar:!0})):m(E=>({...E,isHiddenScrollBar:!1}))})},N=_=>{m(T=>({...T,scrollLeft:_/c*u||0}))};return f.useImperativeHandle(t,()=>({setScrollLeft:N,checkScrollBarVisible:C})),f.useEffect(()=>(document.body.addEventListener(TDe,b,!1),document.body.addEventListener(kDe,S,!1),C(),()=>{document.body.removeEventListener(TDe,b),document.body.removeEventListener(kDe,S)}),[d,y]),f.useEffect(()=>{if(n.current){const _=[];let T=hb(n.current);for(;T;)_.push(T),T=T.parentElement;return _.forEach(P=>{P.addEventListener(N_,C,!1)}),window.addEventListener(MDe,C,!1),window.addEventListener(N_,C,!1),i.addEventListener(N_,C,!1),()=>{_.forEach(P=>{P.removeEventListener(N_,C)}),window.removeEventListener(MDe,C),window.removeEventListener(N_,C),i.removeEventListener(N_,C)}}},[i]),f.useEffect(()=>{h.isHiddenScrollBar||m(_=>{const T=n.current;return T?{..._,scrollLeft:T.scrollLeft/T.scrollWidth*T.clientWidth}:_})},[h.isHiddenScrollBar]),c<=u||!d||h.isHiddenScrollBar?null:f.createElement("div",{style:{height:JRe(),width:u,bottom:o},className:`${l}-sticky-scroll`},f.createElement("div",{onMouseDown:w,ref:p,className:be(`${l}-sticky-scroll-bar`,{[`${l}-sticky-scroll-bar-active`]:y}),style:{width:`${d}px`,transform:`translate3d(${h.scrollLeft}px, 0, 0)`}}))},OXn=f.forwardRef(RXn);function s2(){return s2=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var Mt,_t;const n={rowKey:"key",prefixCls:odt,emptyText:LXn,...e},{prefixCls:r,className:o,rowClassName:i,style:s,classNames:l,styles:c,data:u,rowKey:d,scroll:p,tableLayout:h,direction:m,title:g,footer:y,summary:x,caption:v,id:b,showHeader:w,components:S,emptyText:C,onRow:N,onHeaderRow:j,measureRowRender:I,onScroll:_,internalHooks:T,transformColumns:P,internalRefs:E,tailor:M,getContainerWidth:R,sticky:$,rowHoverable:D=!0}=n,z=u||$Xn,V=!!z.length,B=T===x6,G=f.useCallback((gt,hn)=>Cp(S,gt)||hn,[S]),H=f.useMemo(()=>typeof d=="function"?d:gt=>gt&>[d],[d]),F=G(["body"]),[W,U,K]=TXn(),[X,J,te,re,ce,ae]=IXn(n,z,H),oe=p==null?void 0:p.x,[ue,fe]=f.useState(0),[se,ge,ye]=EXn({...n,...X,expandable:!!X.expandedRowRender,columnTitle:X.columnTitle,expandedKeys:te,getRowKey:H,onTriggerExpand:ae,expandIcon:re,expandIconColumnIndex:X.expandIconColumnIndex,direction:m,scrollWidth:B&&M&&typeof oe=="number"?oe:null,clientWidth:ue},B?P:null),de=ye??oe,Ne=f.useMemo(()=>({columns:se,flattenColumns:ge}),[se,ge]),_e=f.useRef(null),xe=f.useRef(null),we=f.useRef(null),Te=f.useRef(null);f.useImperativeHandle(t,()=>({nativeElement:_e.current,scrollTo:gt=>{var hn,Vn;if(we.current instanceof HTMLElement){const{index:Jn,top:Fr,key:po,offset:nr}=gt;if(ZYn(Fr))(hn=we.current)==null||hn.scrollTo({top:Fr});else{const or=po??H(z[Jn]),Or=we.current.querySelector(`[data-row-key="${or}"]`);if(Or)if(!nr)Or.scrollIntoView();else{const Tn=Or.offsetTop;we.current.scrollTo({top:Tn+nr})}}}else(Vn=we.current)!=null&&Vn.scrollTo&&we.current.scrollTo(gt)}}));const Re=f.useRef(null),[Ue,He]=f.useState(!1),[Ye,We]=f.useState(!1),[at,Oe]=f.useState(new Map),qe=aY(ge).map(gt=>at.get(gt)),dt=f.useMemo(()=>qe,[qe.join("_")]),Ze=MXn(dt,ge),Qe=p&&Fue(p.y),lt=p&&Fue(de)||!!X.fixed,bt=lt&&ge.some(({fixed:gt})=>gt),Ct=f.useRef(null),{isSticky:Je,offsetHeader:Pe,offsetSummary:Me,offsetScroll:et,stickyClassName:vt,container:Pt}=kXn($,r),Jt=f.useMemo(()=>x==null?void 0:x(z),[x,z]),dn=(Qe||Je)&&f.isValidElement(Jt)&&Jt.type===sY&&Jt.props.fixed;let Et,sn,ot;Qe&&(sn={overflowY:V?"scroll":"auto",maxHeight:p.y}),lt&&(Et={overflowX:"auto"},Qe||(sn={overflowY:"hidden"}),ot={width:de===!0?"auto":de,minWidth:"100%"});const mt=f.useCallback((gt,hn)=>{Oe(Vn=>{if(Vn.get(gt)!==hn){const Jn=new Map(Vn);return Jn.set(gt,hn),Jn}return Vn})},[]),[Ht,jt]=AXn();function Vt(gt,hn){hn&&(typeof hn=="function"?hn(gt):hn.scrollLeft!==gt&&(hn.scrollLeft=gt,hn.scrollLeft!==gt&&setTimeout(()=>{hn.scrollLeft=gt},0)))}const[nn,zt]=f.useState([0,0]),Nn=Vr(({currentTarget:gt,scrollLeft:hn})=>{var po;const Vn=typeof hn=="number"?hn:gt.scrollLeft,Jn=gt||DXn;(!jt()||jt()===Jn)&&(Ht(Jn),Vt(Vn,xe.current),Vt(Vn,we.current),Vt(Vn,Re.current),Vt(Vn,(po=Ct.current)==null?void 0:po.setScrollLeft));const Fr=gt||xe.current;if(Fr){const nr=B&&M&&typeof de=="number"?de:Fr.scrollWidth,or=Fr.clientWidth,Or=Math.abs(Vn);if(zt(Tn=>{const er=[Or,nr-or];return hy(Tn,er)?Tn:er}),nr===or){He(!1),We(!1);return}He(Or>0),We(Or{Nn(gt),_==null||_(gt)}),ur=()=>{var gt;lt&&we.current?Nn({currentTarget:hb(we.current),scrollLeft:(gt=we.current)==null?void 0:gt.scrollLeft}):(He(!1),We(!1))},Zt=gt=>{var Vn,Jn;(Vn=Ct.current)==null||Vn.checkScrollBarVisible();let hn=gt??((Jn=_e.current)==null?void 0:Jn.offsetWidth)??0;B&&R&&_e.current&&(hn=R(_e.current,hn)||hn),hn!==ue&&(ur(),fe(hn))};Po(()=>{lt&&Zt()},[lt]);const Ot=f.useRef(!1);f.useEffect(()=>{Ot.current&&ur()},[lt,u,se.length]),f.useEffect(()=>{Ot.current=!0},[]);const[qt,Kt]=f.useState(0);Po(()=>{(!M||!B)&&(we.current instanceof Element?Kt(qle(we.current).width):Kt(qle(Te.current).width))},[]),f.useEffect(()=>{B&&E&&(E.body.current=we.current)});const gn=f.useCallback(gt=>f.createElement(f.Fragment,null,f.createElement(EDe,gt),dn==="top"&&f.createElement(A7,gt,Jt)),[dn,Jt]),An=f.useCallback(gt=>f.createElement(A7,gt,Jt),[Jt]),pt=G(["table"],"table"),nt=f.useMemo(()=>h||(bt?de==="max-content"?"auto":"fixed":Qe||Je||ge.some(({ellipsis:gt})=>gt)?"fixed":"auto"),[Qe,bt,ge,h,Je]);let xt;const Tt={colWidths:dt,columCount:ge.length,stickyOffsets:Ze,onHeaderRow:j,fixHeader:Qe,scroll:p},rn=f.useMemo(()=>V?null:typeof C=="function"?C():C,[V,C]),un=f.createElement(yXn,{data:z,measureColumnWidth:Qe||lt||Je}),xn=f.createElement(tdt,{colWidths:ge.map(({width:gt})=>gt),columns:ge}),Kn=v!=null?f.createElement("caption",{className:`${r}-caption`},v):void 0,ar=fl(n,{data:!0}),tr=fl(n,{aria:!0});if(Qe||Je){let gt;typeof F=="function"?(gt=F(z,{scrollbarSize:qt,ref:we,onScroll:Nn}),Tt.colWidths=ge.map(({width:Vn},Jn)=>{const Fr=Jn===ge.length-1?Vn-qt:Vn;return typeof Fr=="number"&&!Number.isNaN(Fr)?Fr:0})):gt=f.createElement("div",{style:{...Et,...sn},onScroll:xr,ref:we,className:`${r}-body`},f.createElement(pt,s2({style:{...ot,tableLayout:nt}},tr),Kn,xn,un,!dn&&Jt&&f.createElement(A7,{stickyOffsets:Ze,flattenColumns:ge},Jt)));const hn={noData:!z.length,maxContentScroll:lt&&de==="max-content",...Tt,...Ne,direction:m,stickyClassName:vt,scrollX:de,tableLayout:nt,onScroll:Nn};xt=f.createElement(f.Fragment,null,w!==!1&&f.createElement(jDe,s2({},hn,{stickyTopOffset:Pe,className:`${r}-header`,ref:xe,colGroup:xn}),gn),gt,dn&&dn!=="top"&&f.createElement(jDe,s2({},hn,{stickyBottomOffset:Me,className:`${r}-summary`,ref:Re,colGroup:xn}),An),Je&&we.current&&we.current instanceof Element&&f.createElement(OXn,{ref:Ct,offsetScroll:et,scrollBodyRef:we,onScroll:Nn,container:Pt,direction:m}))}else xt=f.createElement("div",{style:{...Et,...sn,...c==null?void 0:c.content},className:be(`${r}-content`,l==null?void 0:l.content),onScroll:Nn,ref:we},f.createElement(pt,s2({style:{...ot,tableLayout:nt}},tr),Kn,xn,w!==!1&&f.createElement(EDe,s2({},Tt,Ne)),un,Jt&&f.createElement(A7,{stickyOffsets:Ze,flattenColumns:ge},Jt)));const jn={...s};Je&&(jn["--columns-count"]=ge.length);let Le=f.createElement("div",s2({className:be(r,o,{[`${r}-rtl`]:m==="rtl",[`${r}-fix-start-shadow`]:lt,[`${r}-fix-end-shadow`]:lt,[`${r}-fix-start-shadow-show`]:lt&&Ue,[`${r}-fix-end-shadow-show`]:lt&&Ye,[`${r}-layout-fixed`]:h==="fixed",[`${r}-fixed-header`]:Qe,[`${r}-fixed-column`]:bt,[`${r}-scroll-horizontal`]:lt,[`${r}-has-fix-start`]:(Mt=ge[0])==null?void 0:Mt.fixed,[`${r}-has-fix-end`]:((_t=ge[ge.length-1])==null?void 0:_t.fixed)==="end"}),style:jn,id:b,ref:_e},ar),g&&f.createElement(PDe,{className:be(`${r}-title`,l==null?void 0:l.title),style:c==null?void 0:c.title},g(z)),f.createElement("div",{ref:Te,className:be(`${r}-container`,l==null?void 0:l.section),style:c==null?void 0:c.section},xt),y&&f.createElement(PDe,{className:be(`${r}-footer`,l==null?void 0:l.footer),style:c==null?void 0:c.footer},y(z)));lt&&(Le=f.createElement(Uf,{onResize:({offsetWidth:gt})=>Zt(gt)},Le));const ke=_Xn(ge,Ze),it=f.useMemo(()=>({scrollX:de,scrollInfo:nn,classNames:l,styles:c,prefixCls:r,getComponent:G,scrollbarSize:qt,direction:m,fixedInfoList:ke,isSticky:Je,componentWidth:ue,fixHeader:Qe,fixColumn:bt,horizonScroll:lt,tableLayout:nt,rowClassName:i,expandedRowClassName:X.expandedRowClassName,expandIcon:re,expandableType:J,expandRowByClick:X.expandRowByClick,expandedRowRender:X.expandedRowRender,expandedRowOffset:X.expandedRowOffset,onTriggerExpand:ae,expandIconColumnIndex:X.expandIconColumnIndex,indentSize:X.indentSize,allColumnsFixedLeft:ge.every(gt=>gt.fixed==="start"),emptyNode:rn,columns:se,flattenColumns:ge,onColumnResize:mt,colWidths:dt,hoverStartRow:W,hoverEndRow:U,onHover:K,rowExpandable:X.rowExpandable,onRow:N,getRowKey:H,expandedKeys:te,childrenColumnName:ce,rowHoverable:D,measureRowRender:I}),[de,nn,l,c,r,G,qt,m,ke,Je,ue,Qe,bt,lt,nt,i,X.expandedRowClassName,re,J,X.expandRowByClick,X.expandedRowRender,X.expandedRowOffset,ae,X.expandIconColumnIndex,X.indentSize,rn,se,ge,mt,dt,W,U,K,X.rowExpandable,N,H,te,ce,D,I]);return f.createElement(Yf.Provider,{value:it},Le)},zXn=f.forwardRef(FXn),idt=e=>Wut(zXn,e),Qk=idt();Qk.EXPAND_COLUMN=a2;Qk.INTERNAL_HOOKS=x6;Qk.Column=cXn;Qk.ColumnGroup=uXn;Qk.Summary=Kut;const Lve=Ove(null),adt=Ove(null);function Vue(){return Vue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{rowInfo:t,column:n,colIndex:r,indent:o,index:i,component:s,renderIndex:l,record:c,style:u,className:d,inverse:p,getHeight:h}=e,{render:m,dataIndex:g,className:y,width:x}=n,{columnsOffset:v}=Rd(adt,["columnsOffset"]),{key:b,fixedInfo:w,appendCellNode:S,additionalCellProps:C}=edt(t,n,r,o,i),{style:N,colSpan:j=1,rowSpan:I=1}=C,_=r-1,T=BXn(_,j,v),P=j>1?x-T:0,E={...N,...u,flex:`0 0 ${T}px`,width:`${T}px`,marginRight:P,pointerEvents:"auto"},M=f.useMemo(()=>p?I<=1:j===0||I===0||I>1,[I,j,p]);M?E.visibility="hidden":p&&(E.height=h==null?void 0:h(I));const R=M?()=>null:m,$={};return(I===0||j===0)&&($.rowSpan=1,$.colSpan=1),f.createElement(Xk,Vue({className:be(y,d),ellipsis:n.ellipsis,align:n.align,scope:n.rowScope,component:s,prefixCls:t.prefixCls,key:b,record:c,index:i,renderIndex:l,dataIndex:g,render:R,shouldCellUpdate:n.shouldCellUpdate},w,{appendNode:S,additionalProps:{...C,style:E,...$}}))};function Uue(){return Uue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{data:n,index:r,className:o,rowKey:i,style:s,extra:l,getHeight:c,...u}=e,{record:d,indent:p,index:h}=n,{scrollX:m,flattenColumns:g,prefixCls:y,fixColumn:x,componentWidth:v}=Rd(Yf,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),{getComponent:b}=Rd(Lve,["getComponent"]),w=Qut(d,i,r,p),S=b(["body","row"],"div"),C=b(["body","cell"],"div"),{rowSupportExpand:N,expanded:j,rowProps:I,expandedRowRender:_,expandedRowClassName:T}=w;let P;if(N&&j){const R=_(d,r,p+1,j),$=Zut(T,d,r,p);let D={};x&&(D={style:{"--virtual-width":`${v}px`}});const z=`${y}-expanded-row-cell`;P=f.createElement(S,{className:be(`${y}-expanded-row`,`${y}-expanded-row-level-${p+1}`,$)},f.createElement(Xk,{component:C,prefixCls:y,className:be(z,{[`${z}-fixed`]:x}),additionalProps:D},R))}const E={...s,width:m};l&&(E.position="absolute",E.pointerEvents="none");const M=f.createElement(S,Uue({},I,u,{"data-row-key":i,ref:N?null:t,className:be(o,`${y}-row`,I==null?void 0:I.className,{[`${y}-row-extra`]:l}),style:{...E,...I==null?void 0:I.style}}),g.map((R,$)=>f.createElement(HXn,{key:$,component:C,rowInfo:w,column:R,colIndex:$,indent:p,index:r,renderIndex:h,record:d,inverse:l,getHeight:c})));return N?f.createElement("div",{ref:t},M,P):M}),RDe=Yk(VXn),UXn=f.forwardRef((e,t)=>{const{data:n,onScroll:r}=e,{flattenColumns:o,onColumnResize:i,getRowKey:s,expandedKeys:l,prefixCls:c,childrenColumnName:u,scrollX:d,direction:p}=Rd(Yf,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),{sticky:h,scrollY:m,listItemHeight:g,getComponent:y,onScroll:x}=Rd(Lve),v=f.useRef(null),b=Xut(n,u,l,s),w=f.useMemo(()=>{let P=0;return o.map(({width:E,minWidth:M,key:R})=>{const $=Math.max(E||0,M||0);return P+=$,[R,$,P]})},[o]),S=f.useMemo(()=>w.map(P=>P[2]),[w]);f.useEffect(()=>{w.forEach(([P,E])=>{i(P,E)})},[w]),f.useImperativeHandle(t,()=>{var E;const P={scrollTo:M=>{var D,z;const{offset:R,...$}=M;R?(D=v.current)==null||D.scrollTo({...$,offset:R,align:"top"}):(z=v.current)==null||z.scrollTo(M)},nativeElement:(E=v.current)==null?void 0:E.nativeElement};return Object.defineProperty(P,"scrollLeft",{get:()=>{var M;return((M=v.current)==null?void 0:M.getScrollInfo().x)||0},set:M=>{var R;(R=v.current)==null||R.scrollTo({left:M})}}),Object.defineProperty(P,"scrollTop",{get:()=>{var M;return((M=v.current)==null?void 0:M.getScrollInfo().y)||0},set:M=>{var R;(R=v.current)==null||R.scrollTo({top:M})}}),P});const C=(P,E)=>{var $;const M=($=b[E])==null?void 0:$.record,{onCell:R}=P;if(R){const D=R(M,E);return(D==null?void 0:D.rowSpan)??1}return 1},N=P=>{const{start:E,end:M,getSize:R,offsetY:$}=P;if(M<0)return null;let D=o.filter(F=>C(F,E)===0),z=E;for(let F=E;F>=0;F-=1)if(D=D.filter(W=>C(W,F)===0),!D.length){z=F;break}let V=o.filter(F=>C(F,M)!==1),B=M;for(let F=M;FC(W,F)!==1),!V.length){B=Math.max(F-1,M);break}const G=[];for(let F=z;F<=B;F+=1)b[F]&&o.some(U=>C(U,F)>1)&&G.push(F);return G.map(F=>{const W=b[F],U=s(W.record,F),K=J=>{const te=F+J-1,re=b[te];if(!re||!re.record){const oe=Math.min(te,b.length-1),ue=b[oe],fe=s(ue.record,oe),se=R(U,fe);return se.bottom-se.top}const ce=s(re.record,te),ae=R(U,ce);return ae.bottom-ae.top},X=R(U);return f.createElement(RDe,{key:F,data:W,rowKey:U,index:F,style:{top:-$+X.top},extra:!0,getHeight:K})})},j=f.useMemo(()=>({columnsOffset:S}),[S]),I=`${c}-tbody`,_=y(["body","wrapper"]),T={};return h&&(T.position="sticky",T.bottom=0,typeof h=="object"&&h.offsetScroll&&(T.bottom=h.offsetScroll)),f.createElement(adt.Provider,{value:j},f.createElement(VK,{fullHeight:!1,ref:v,prefixCls:`${I}-virtual`,styles:{horizontalScrollBar:T},className:I,height:m,itemHeight:g||24,data:b,itemKey:P=>s(P.record),component:_,scrollWidth:d,direction:p,onVirtualScroll:({x:P})=>{var E;r({currentTarget:(E=v.current)==null?void 0:E.nativeElement,scrollLeft:P})},onScroll:x,extraRender:N},(P,E,M)=>{const R=s(P.record,E);return f.createElement(RDe,{data:P,rowKey:R,index:E,style:M.style})}))}),WXn=Yk(UXn);function Wue(){return Wue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{ref:n,onScroll:r}=t;return f.createElement(WXn,{ref:n,data:e,onScroll:r})},qXn=(e,t)=>{const{data:n,columns:r,scroll:o,sticky:i,prefixCls:s=odt,className:l,listItemHeight:c,components:u,onScroll:d}=e;let{x:p,y:h}=o||{};typeof p!="number"&&(p=1),typeof h!="number"&&(h=500);const m=Vr((x,v)=>Cp(u,x)||v),g=Vr(d),y=f.useMemo(()=>({sticky:i,scrollY:h,listItemHeight:c,getComponent:m,onScroll:g}),[i,h,c,m,g]);return f.createElement(Lve.Provider,{value:y},f.createElement(Qk,Wue({},e,{className:be(l,`${s}-virtual`),scroll:{...o,x:p},components:{...u,body:n!=null&&n.length?GXn:void 0},columns:r,internalHooks:x6,tailor:!0,ref:t})))},KXn=f.forwardRef(qXn),sdt=e=>Wut(KXn,e);sdt();const YXn=e=>null,XXn=e=>null,Fve=f.createContext(null),QXn=f.createContext({}),JXn=({prefixCls:e,level:t,isStart:n,isEnd:r})=>{const o=`${e}-indent-unit`,i=[];for(let s=0;s{var He,Ye;const{eventKey:t,className:n,style:r,dragOver:o,dragOverGapTop:i,dragOverGapBottom:s,isLeaf:l,isStart:c,isEnd:u,expanded:d,selected:p,checked:h,halfChecked:m,loading:g,domRef:y,active:x,data:v,onMouseMove:b,selectable:w,...S}=e,C=Ie.useContext(Fve),{classNames:N,styles:j}=C||{},I=Ie.useContext(QXn),_=Ie.useRef(null),[T,P]=Ie.useState(!1),E=!!(C.disabled||e.disabled||(He=I.nodeDisabled)!=null&&He.call(I,v)),M=Ie.useMemo(()=>!C.checkable||e.checkable===!1?!1:C.checkable,[C.checkable,e.checkable]),R=We=>{E||C.onNodeSelect(We,Ju(e))},$=We=>{E||!M||e.disableCheckbox||C.onNodeCheck(We,Ju(e),!h)},D=Ie.useMemo(()=>typeof w=="boolean"?w:C.selectable,[w,C.selectable]),z=We=>{C.onNodeClick(We,Ju(e)),D?R(We):$(We)},V=We=>{C.onNodeDoubleClick(We,Ju(e))},B=We=>{C.onNodeMouseEnter(We,Ju(e))},G=We=>{C.onNodeMouseLeave(We,Ju(e))},H=We=>{C.onNodeContextMenu(We,Ju(e))},F=Ie.useMemo(()=>!!(C.draggable&&(!C.draggable.nodeDraggable||C.draggable.nodeDraggable(v))),[C.draggable,v]),W=We=>{We.stopPropagation(),P(!0),C.onNodeDragStart(We,e);try{We.dataTransfer.setData("text/plain","")}catch{}},U=We=>{We.preventDefault(),We.stopPropagation(),C.onNodeDragEnter(We,e)},K=We=>{We.preventDefault(),We.stopPropagation(),C.onNodeDragOver(We,e)},X=We=>{We.stopPropagation(),C.onNodeDragLeave(We,e)},J=We=>{We.stopPropagation(),P(!1),C.onNodeDragEnd(We,e)},te=We=>{We.preventDefault(),We.stopPropagation(),P(!1),C.onNodeDrop(We,e)},re=We=>{g||C.onNodeExpand(We,Ju(e))},ce=Ie.useMemo(()=>{const{children:We}=rm(C.keyEntities,t)||{};return!!(We||[]).length},[C.keyEntities,t]),ae=Ie.useMemo(()=>l===!1?!1:l||!C.loadData&&!ce||C.loadData&&e.loaded&&!ce,[l,C.loadData,ce,e.loaded]);Ie.useEffect(()=>{g||typeof C.loadData=="function"&&d&&!ae&&!e.loaded&&C.onNodeLoad(Ju(e))},[g,C.loadData,C.onNodeLoad,d,ae,e]);const oe=Ie.useMemo(()=>{var We;return(We=C.draggable)!=null&&We.icon?Ie.createElement("span",{className:`${C.prefixCls}-draggable-icon`},C.draggable.icon):null},[C.draggable]),ue=We=>{const at=e.switcherIcon||C.switcherIcon;return typeof at=="function"?at({...e,isLeaf:We}):at},fe=()=>{if(ae){const at=ue(!0);return at!==!1?Ie.createElement("span",{className:be(`${C.prefixCls}-switcher`,`${C.prefixCls}-switcher-noop`)},at):null}const We=ue(!1);return We!==!1?Ie.createElement("span",{onClick:re,className:be(`${C.prefixCls}-switcher`,`${C.prefixCls}-switcher_${d?ODe:$De}`)},We):null},se=Ie.useMemo(()=>{if(!M)return null;const We=typeof M!="boolean"?M:null;return Ie.createElement("span",{className:be(`${C.prefixCls}-checkbox`,{[`${C.prefixCls}-checkbox-checked`]:h,[`${C.prefixCls}-checkbox-indeterminate`]:!h&&m,[`${C.prefixCls}-checkbox-disabled`]:E||e.disableCheckbox}),onClick:$,role:"checkbox","aria-checked":m?"mixed":h,"aria-disabled":E||e.disableCheckbox,"aria-label":`Select ${typeof e.title=="string"?e.title:"tree node"}`},We)},[M,h,m,E,e.disableCheckbox,e.title]),ge=Ie.useMemo(()=>ae?null:d?ODe:$De,[ae,d]),ye=Ie.useMemo(()=>Ie.createElement("span",{className:be(N==null?void 0:N.itemIcon,`${C.prefixCls}-iconEle`,`${C.prefixCls}-icon__${ge||"docu"}`,{[`${C.prefixCls}-icon_loading`]:g}),style:j==null?void 0:j.itemIcon}),[C.prefixCls,ge,g]),de=Ie.useMemo(()=>{const We=!!C.draggable;return!e.disabled&&We&&C.dragOverNodeKey===t?C.dropIndicatorRender({dropPosition:C.dropPosition,dropLevelOffset:C.dropLevelOffset,indent:C.indent,prefixCls:C.prefixCls,direction:C.direction}):null},[C.dropPosition,C.dropLevelOffset,C.indent,C.prefixCls,C.direction,C.draggable,C.dragOverNodeKey,C.dropIndicatorRender]),Ne=Ie.useMemo(()=>{const{title:We=eQn}=e,at=`${C.prefixCls}-node-content-wrapper`;let Oe;if(C.showIcon){const qe=e.icon||C.icon;Oe=qe?Ie.createElement("span",{className:be(N==null?void 0:N.itemIcon,`${C.prefixCls}-iconEle`,`${C.prefixCls}-icon__customize`),style:j==null?void 0:j.itemIcon},typeof qe=="function"?qe(e):qe):ye}else C.loadData&&g&&(Oe=ye);let Ae;return typeof We=="function"?Ae=We(v):C.titleRender?Ae=C.titleRender(v):Ae=We,Ie.createElement("span",{ref:_,title:typeof We=="string"?We:"",className:be(at,`${at}-${ge||"normal"}`,{[`${C.prefixCls}-node-selected`]:!E&&(p||T)}),onMouseEnter:B,onMouseLeave:G,onContextMenu:H,onClick:z,onDoubleClick:V},Oe,Ie.createElement("span",{className:be(`${C.prefixCls}-title`,N==null?void 0:N.itemTitle),style:j==null?void 0:j.itemTitle},Ae),de)},[C.prefixCls,C.showIcon,e,C.icon,ye,C.titleRender,v,ge,B,G,H,z,V]),_e=fl(S,{aria:!0,data:!0}),{level:xe}=rm(C.keyEntities,t)||{},we=u[u.length-1],Te=!E&&F,Re=C.draggingNodeKey===t,Ue=w!==void 0?{"aria-selected":!!w}:void 0;return Ie.createElement("div",Gue({ref:y,role:"treeitem","aria-expanded":l?void 0:d,className:be(n,`${C.prefixCls}-treenode`,N==null?void 0:N.item,{[`${C.prefixCls}-treenode-disabled`]:E,[`${C.prefixCls}-treenode-switcher-${d?"open":"close"}`]:!l,[`${C.prefixCls}-treenode-checkbox-checked`]:h,[`${C.prefixCls}-treenode-checkbox-indeterminate`]:m,[`${C.prefixCls}-treenode-selected`]:p,[`${C.prefixCls}-treenode-loading`]:g,[`${C.prefixCls}-treenode-active`]:x,[`${C.prefixCls}-treenode-leaf-last`]:we,[`${C.prefixCls}-treenode-draggable`]:F,dragging:Re,"drop-target":C.dropTargetKey===t,"drop-container":C.dropContainerKey===t,"drag-over":!E&&o,"drag-over-gap-top":!E&&i,"drag-over-gap-bottom":!E&&s,"filter-node":(Ye=C.filterTreeNode)==null?void 0:Ye.call(C,Ju(e)),[`${C.prefixCls}-treenode-leaf`]:ae}),style:{...r,...j==null?void 0:j.item},draggable:Te,onDragStart:Te?W:void 0,onDragEnter:F?U:void 0,onDragOver:F?K:void 0,onDragLeave:F?X:void 0,onDrop:F?te:void 0,onDragEnd:F?J:void 0,onMouseMove:b},Ue,_e),Ie.createElement(ZXn,{prefixCls:C.prefixCls,level:xe,isStart:c,isEnd:u}),oe,fe(),se,Ne)};W$.isTreeNode=1;function rv(e,t){if(!e)return[];const n=e.slice(),r=n.indexOf(t);return r>=0&&n.splice(r,1),n}function g1(e,t){const n=(e||[]).slice();return n.indexOf(t)===-1&&n.push(t),n}function zve(e){return e.split("-")}function tQn(e,t){const n=[],r=rm(t,e);function o(i=[]){i.forEach(({key:s,children:l})=>{n.push(s),o(l)})}return o(r.children),n}function nQn(e){if(e.parent){const t=zve(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function rQn(e){const t=zve(e.pos);return Number(t[t.length-1])===0}function DDe(e,t,n,r,o,i,s,l,c,u){var T;const{clientX:d,clientY:p}=e,{top:h,height:m}=e.target.getBoundingClientRect(),y=((u==="rtl"?-1:1)*(((o==null?void 0:o.x)||0)-d)-12)/r,x=c.filter(P=>{var E,M;return(M=(E=l[P])==null?void 0:E.children)==null?void 0:M.length});let v=rm(l,n.eventKey);if(pR.key===v.key),E=P<=0?0:P-1,M=s[E].key;v=rm(l,M)}const b=v.key,w=v,S=v.key;let C=0,N=0;if(!x.includes(b))for(let P=0;P-1.5?i({dragNode:j,dropNode:I,dropPosition:1})?C=1:_=!1:i({dragNode:j,dropNode:I,dropPosition:0})?C=0:i({dragNode:j,dropNode:I,dropPosition:1})?C=1:_=!1:i({dragNode:j,dropNode:I,dropPosition:1})?C=1:_=!1,{dropPosition:C,dropLevelOffset:N,dropTargetKey:v.key,dropTargetPos:v.pos,dragOverNodeKey:S,dropContainerKey:C===0?null:((T=v.parent)==null?void 0:T.key)||null,dropAllowed:_}}function LDe(e,t){if(!e)return;const{multiple:n}=t;return n?e.slice():e.length?[e[0]]:e}function Rte(e){if(!e)return null;let t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(typeof e=="object")t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return Al(!1,"`checkedKeys` is not an array or an object"),null;return t}function que(e,t){const n=new Set;function r(o){if(n.has(o))return;const i=rm(t,o);if(!i)return;n.add(o);const{parent:s,node:l}=i;l.disabled||s&&r(s.key)}return(e||[]).forEach(o=>{r(o)}),[...n]}const KS={},Kue="SELECT_ALL",Yue="SELECT_INVERT",Xue="SELECT_NONE",FDe=[],ldt=(e,t,n=[])=>((t||[]).forEach(r=>{n.push(r),r&&typeof r=="object"&&e in r&&ldt(e,r[e],n)}),n),oQn=(e,t)=>{const{preserveSelectedRowKeys:n,selectedRowKeys:r,defaultSelectedRowKeys:o,getCheckboxProps:i,getTitleCheckboxProps:s,onChange:l,onSelect:c,onSelectAll:u,onSelectInvert:d,onSelectNone:p,onSelectMultiple:h,columnWidth:m,type:g,selections:y,fixed:x,renderCell:v,hideSelectAll:b,checkStrictly:w=!0}=t||{},{prefixCls:S,data:C,pageData:N,getRecordByKey:j,getRowKey:I,expandType:_,childrenColumnName:T,locale:P,getPopupContainer:E}=e,M=Qw(),[R,$]=DRn(oe=>oe),[D,z]=Fa(o||FDe,r),V=f.useRef(new Map),B=f.useCallback(oe=>{if(n){const ue=new Map;oe.forEach(fe=>{let se=j(fe);!se&&V.current.has(fe)&&(se=V.current.get(fe)),ue.set(fe,se)}),V.current=ue}},[j,n]);f.useEffect(()=>{B(D)},[D]);const G=f.useMemo(()=>ldt(T,N),[T,N]),{keyEntities:H}=f.useMemo(()=>{if(w)return{keyEntities:null};let oe=C;if(n){const ue=new Set(G.map(I)),fe=Array.from(V.current).reduce((se,[ge,ye])=>ue.has(ge)?se:se.concat(ye),[]);oe=[].concat(go(oe),go(fe))}return Cve(oe,{externalGetKey:I,childrenPropName:T})},[C,I,w,T,n,G]),F=f.useMemo(()=>{const oe=new Map;return G.forEach((ue,fe)=>{const se=I(ue,fe),ge=(i?i(ue):null)||{};oe.set(se,ge)}),oe},[G,I,i]),W=f.useCallback(oe=>{const ue=I(oe);let fe;return F.has(ue)?fe=F.get(I(oe)):fe=i?i(oe):void 0,!!(fe!=null&&fe.disabled)},[F,I]),[U,K]=f.useMemo(()=>{if(w)return[D||[],[]];const{checkedKeys:oe,halfCheckedKeys:ue}=gA(D,!0,H,W);return[oe||[],ue]},[D,w,H,W]),X=f.useMemo(()=>{const oe=g==="radio"?U.slice(0,1):U;return new Set(oe)},[U,g]),J=f.useMemo(()=>g==="radio"?new Set:new Set(K),[K,g]);f.useEffect(()=>{t||z(FDe)},[!!t]);const te=f.useCallback((oe,ue)=>{let fe,se;B(oe),n?(fe=oe,se=oe.map(ge=>V.current.get(ge))):(fe=[],se=[],oe.forEach(ge=>{const ye=j(ge);ye!==void 0&&(fe.push(ge),se.push(ye))})),z(fe),l==null||l(fe,se,{type:ue})},[z,j,l,n]),re=f.useCallback((oe,ue,fe,se)=>{if(c){const ge=fe.map(ye=>j(ye));c(j(oe),ue,ge,se)}te(fe,"single")},[c,j,te]),ce=f.useMemo(()=>!y||b?null:(y===!0?[Kue,Yue,Xue]:y).map(ue=>ue===Kue?{key:"all",text:P.selectionAll,onSelect(){te(C.map((fe,se)=>I(fe,se)).filter(fe=>{const se=F.get(fe);return!(se!=null&&se.disabled)||X.has(fe)}),"all")}}:ue===Yue?{key:"invert",text:P.selectInvert,onSelect(){const fe=new Set(X);N.forEach((ge,ye)=>{const de=I(ge,ye),Ne=F.get(de);Ne!=null&&Ne.disabled||(fe.has(de)?fe.delete(de):fe.add(de))});const se=Array.from(fe);d&&(M.deprecated(!1,"onSelectInvert","onChange"),d(se)),te(se,"invert")}}:ue===Xue?{key:"none",text:P.selectNone,onSelect(){p==null||p(),te(Array.from(X).filter(fe=>{const se=F.get(fe);return se==null?void 0:se.disabled}),"none")}}:ue).map(ue=>({...ue,onSelect:(...fe)=>{var se;(se=ue.onSelect)==null||se.call(ue,...fe),$(null)}})),[y,b,P.selectionAll,P.selectInvert,P.selectNone,F,X,C,N,I,d,te]);return[f.useCallback(oe=>{var Oe;if(!t)return oe.filter(Ae=>Ae!==KS);let ue=go(oe);const fe=new Set(X),se=G.map(I).filter(Ae=>!F.get(Ae).disabled),ge=se.every(Ae=>fe.has(Ae)),ye=se.some(Ae=>fe.has(Ae)),de=()=>{const Ae=[];ge?se.forEach(dt=>{fe.delete(dt),Ae.push(dt)}):se.forEach(dt=>{fe.has(dt)||(fe.add(dt),Ae.push(dt))});const qe=Array.from(fe);u==null||u(!ge,qe.map(dt=>j(dt)),Ae.map(dt=>j(dt))),te(qe,"all"),$(null)};let Ne,_e;if(g!=="radio"){let Ae;if(ce){const Je={getPopupContainer:E,items:ce.map((Pe,Me)=>{const{key:et,text:vt,onSelect:Pt}=Pe;return{key:et??Me,onClick:()=>{Pt==null||Pt(se)},label:vt}})};Ae=f.createElement("div",{className:`${S}-selection-extra`},f.createElement(Ive,{menu:Je,getPopupContainer:E},f.createElement("span",null,f.createElement(clt,null))))}const qe=G.map((Je,Pe)=>{const Me=I(Je,Pe),et=F.get(Me)||{};return{checked:fe.has(Me),...et}}).filter(({disabled:Je})=>Je),dt=!!qe.length&&qe.length===G.length,Ze=dt&&qe.every(({checked:Je})=>Je),Qe=dt&&qe.some(({checked:Je})=>Je),lt=(s==null?void 0:s())||{},{onChange:bt,disabled:Ct}=lt;_e=f.createElement(kT,{"aria-label":Ae?"Custom selection":"Select all",...lt,checked:dt?Ze:!!G.length&&ge,indeterminate:dt?!Ze&&Qe:!ge&&ye,onChange:Je=>{de(),bt==null||bt(Je)},disabled:Ct??(G.length===0||dt),skipGroup:!0}),Ne=!b&&f.createElement("div",{className:`${S}-selection`},_e,Ae)}let xe;g==="radio"?xe=(Ae,qe,dt)=>{const Ze=I(qe,dt),Qe=fe.has(Ze),lt=F.get(Ze);return{node:f.createElement(h6,{...lt,checked:Qe,onClick:bt=>{var Ct;bt.stopPropagation(),(Ct=lt==null?void 0:lt.onClick)==null||Ct.call(lt,bt)},onChange:bt=>{var Ct;fe.has(Ze)||re(Ze,!0,[Ze],bt.nativeEvent),(Ct=lt==null?void 0:lt.onChange)==null||Ct.call(lt,bt)}}),checked:Qe}}:xe=(Ae,qe,dt)=>{const Ze=I(qe,dt),Qe=fe.has(Ze),lt=J.has(Ze),bt=F.get(Ze);let Ct;return _==="nest"?Ct=lt:Ct=(bt==null?void 0:bt.indeterminate)??lt,{node:f.createElement(kT,{...bt,indeterminate:Ct,checked:Qe,skipGroup:!0,onClick:Je=>{var Pe;Je.stopPropagation(),(Pe=bt==null?void 0:bt.onClick)==null||Pe.call(bt,Je)},onChange:Je=>{var Pt;const{nativeEvent:Pe}=Je,{shiftKey:Me}=Pe,et=se.indexOf(Ze),vt=U.some(Jt=>se.includes(Jt));if(Me&&w&&vt){const Jt=R(et,se,fe),dn=Array.from(fe);h==null||h(!Qe,dn.map(Et=>j(Et)),Jt.map(Et=>j(Et))),te(dn,"multiple")}else{const Jt=U;if(w){const dn=Qe?rv(Jt,Ze):g1(Jt,Ze);re(Ze,!Qe,dn,Pe)}else{const dn=gA([].concat(go(Jt),[Ze]),!0,H,W),{checkedKeys:Et,halfCheckedKeys:sn}=dn;let ot=Et;if(Qe){const mt=new Set(Et);mt.delete(Ze),ot=gA(Array.from(mt),{halfCheckedKeys:sn},H,W).checkedKeys}re(Ze,!Qe,ot,Pe)}}$(Qe?null:et),(Pt=bt==null?void 0:bt.onChange)==null||Pt.call(bt,Je)}}),checked:Qe}};const we=(Ae,qe,dt)=>{const{node:Ze,checked:Qe}=xe(Ae,qe,dt);return v?v(Qe,qe,dt,Ze):Ze};if(!ue.includes(KS))if(ue.findIndex(Ae=>{var qe;return((qe=Ae[DO])==null?void 0:qe.columnType)==="EXPAND_COLUMN"})===0){const[Ae,...qe]=ue;ue=[Ae,KS].concat(go(qe))}else ue=[KS].concat(go(ue));const Te=ue.indexOf(KS);ue=ue.filter((Ae,qe)=>Ae!==KS||qe===Te);const Re=ue[Te-1],Ue=ue[Te+1];let He=x;He===void 0&&((Ue==null?void 0:Ue.fixed)!==void 0?He=Ue.fixed:(Re==null?void 0:Re.fixed)!==void 0&&(He=Re.fixed)),He&&Re&&((Oe=Re[DO])==null?void 0:Oe.columnType)==="EXPAND_COLUMN"&&Re.fixed===void 0&&(Re.fixed=He);const Ye=be(`${S}-selection-col`,{[`${S}-selection-col-with-dropdown`]:y&&g==="checkbox"}),We=()=>t!=null&&t.columnTitle?typeof t.columnTitle=="function"?t.columnTitle(_e):t.columnTitle:Ne,at={fixed:He,width:m,className:`${S}-selection-column`,title:We(),render:we,onCell:t.onCell,align:t.align,[DO]:{className:Ye}};return ue.map(Ae=>Ae===KS?at:Ae)},[I,G,t,U,X,J,m,ce,_,F,h,re,W]),X]};function iQn(e){return t=>{const{prefixCls:n,onExpand:r,record:o,expanded:i,expandable:s}=t,l=`${n}-row-expand-icon`;return f.createElement("button",{type:"button",onClick:c=>{r(o,c),c.stopPropagation()},className:be(l,{[`${l}-spaced`]:!s,[`${l}-expanded`]:s&&i,[`${l}-collapsed`]:s&&!i}),"aria-label":i?e.collapse:e.expand,"aria-expanded":i})}}function aQn(e){return(n,r)=>{const o=n.querySelector(`.${e}-container`);let i=r;if(o){const s=getComputedStyle(o),l=Number.parseInt(s.borderLeftWidth,10),c=Number.parseInt(s.borderRightWidth,10);i=r-l-c}return i}}const RC=(e,t)=>"key"in e&&e.key!==void 0&&e.key!==null?e.key:e.dataIndex?Array.isArray(e.dataIndex)?e.dataIndex.join("."):e.dataIndex:t;function Jk(e,t){return t?`${t}-${e}`:`${e}`}const lY=(e,t)=>typeof e=="function"?e(t):e,sQn=(e,t)=>{const n=lY(e,t);return Object.prototype.toString.call(n)==="[object Object]"?"":n};var lQn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M349 838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V642H349v196zm531.1-684H143.9c-24.5 0-39.8 26.7-27.5 48l221.3 376h348.8l221.3-376c12.1-21.3-3.2-48-27.7-48z"}}]},name:"filter",theme:"filled"};function Que(){return Que=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Que({},e,{ref:t,icon:lQn})),uQn=f.forwardRef(cQn),dQn=e=>{const{dropPosition:t,dropLevelOffset:n,indent:r}=e,o={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case-1:o.top=0,o.left=-n*r;break;case 1:o.bottom=0,o.left=-n*r;break;case 0:o.bottom=0,o.left=r;break}return Ie.createElement("div",{style:o})};function fQn(e,t){const[n,r]=f.useState(!1);Po(()=>{if(n)return e(),()=>{t()}},[n]),Po(()=>(r(!0),()=>{r(!1)}),[])}function LO(){return LO=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{className:n,style:r,motion:o,motionNodes:i,motionType:s,onMotionStart:l,onMotionEnd:c,active:u,treeNodeRequiredProps:d,...p}=e,[h,m]=f.useState(!0),{prefixCls:g}=f.useContext(Fve),y=i&&s!=="hide";Po(()=>{i&&y!==h&&m(y)},[i]);const x=()=>{i&&l()},v=f.useRef(!1),b=()=>{i&&!v.current&&(v.current=!0,c())};fQn(x,b);const w=S=>{y===S&&b()};return i?f.createElement(Kf,LO({ref:t,visible:h},o,{motionAppear:s==="show",onVisibleChanged:w}),({className:S,style:C},N)=>f.createElement("div",{ref:N,className:be(`${g}-treenode-motion`,S),style:C},i.map(j=>{const{data:{...I},title:_,key:T,isStart:P,isEnd:E}=j;delete I.children;const M=OO(T,d);return f.createElement(W$,LO({},I,M,{title:_,active:u,data:j.data,key:T,isStart:P,isEnd:E}))}))):f.createElement(W$,LO({domRef:t,className:n,style:r},p,{active:u}))});function hQn(e=[],t=[]){const n=e.length,r=t.length;if(Math.abs(n-r)!==1)return{add:!1,key:null};function o(i,s){const l=new Map;i.forEach(u=>{l.set(u,!0)});const c=s.filter(u=>!l.has(u));return c.length===1?c[0]:null}return ns.key===n),o=e[r+1],i=t.findIndex(s=>s.key===n);if(o){const s=t.findIndex(l=>l.key===o.key);return t.slice(i+1,s)}return t.slice(i+1)}function nW(){return nW=Object.assign?Object.assign.bind():function(e){for(var t=1;t{},jI=`RC_TREE_MOTION_${Math.random()}`,Jue={key:jI},cdt={key:jI,level:0,index:0,pos:"0",node:Jue,nodes:[Jue]},HDe={parent:null,children:[],pos:cdt.pos,data:Jue,title:null,key:jI,isStart:[],isEnd:[]};function VDe(e,t,n,r){return t===!1||!n?e:e.slice(0,Math.ceil(n/r)+1)}function UDe(e){const{key:t,pos:n}=e;return m6(t,n)}function gQn(e){let t=String(e.data.key),n=e;for(;n.parent;)n=n.parent,t=`${n.data.key} > ${t}`;return t}const xQn=f.forwardRef((e,t)=>{const{prefixCls:n,data:r,selectable:o,checkable:i,expandedKeys:s,selectedKeys:l,checkedKeys:c,loadedKeys:u,loadingKeys:d,halfCheckedKeys:p,keyEntities:h,disabled:m,dragging:g,dragOverNodeKey:y,dropPosition:x,motion:v,height:b,itemHeight:w,virtual:S,scrollWidth:C,focusable:N,activeItem:j,focused:I,tabIndex:_,onKeyDown:T,onFocus:P,onBlur:E,onActiveChange:M,onListChangeStart:R,onListChangeEnd:$,...D}=e,z=f.useRef(null),V=f.useRef(null);f.useImperativeHandle(t,()=>({scrollTo:ue=>{z.current.scrollTo(ue)},getIndentWidth:()=>V.current.offsetWidth}));const[B,G]=f.useState(s),[H,F]=f.useState(r),[W,U]=f.useState(r),[K,X]=f.useState([]),[J,te]=f.useState(null),re=f.useRef(r);re.current=r;function ce(){const ue=re.current;F(ue),U(ue),X([]),te(null),$()}Po(()=>{G(s);const ue=hQn(B,s);if(ue.key!==null)if(ue.add){const fe=H.findIndex(({key:ye})=>ye===ue.key),se=VDe(zDe(H,r,ue.key),S,b,w),ge=H.slice();ge.splice(fe+1,0,HDe),U(ge),X(se),te("show")}else{const fe=r.findIndex(({key:ye})=>ye===ue.key),se=VDe(zDe(r,H,ue.key),S,b,w),ge=r.slice();ge.splice(fe+1,0,HDe),U(ge),X(se),te("hide")}else H!==r&&(F(r),U(r))},[s,r]),f.useEffect(()=>{g||ce()},[g]);const ae=v?W:r,oe={expandedKeys:s,selectedKeys:l,loadedKeys:u,loadingKeys:d,checkedKeys:c,halfCheckedKeys:p,dragOverNodeKey:y,dropPosition:x,keyEntities:h};return f.createElement(f.Fragment,null,I&&j&&f.createElement("span",{style:BDe,"aria-live":"assertive"},gQn(j)),f.createElement("div",null,f.createElement("input",{style:BDe,disabled:N===!1||m,tabIndex:N!==!1?_:null,onKeyDown:T,onFocus:P,onBlur:E,value:"",onChange:mQn,"aria-label":"for screen reader"})),f.createElement("div",{className:`${n}-treenode`,"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0}},f.createElement("div",{className:`${n}-indent`},f.createElement("div",{ref:V,className:`${n}-indent-unit`}))),f.createElement(VK,nW({},D,{data:ae,itemKey:UDe,height:b,fullHeight:!1,virtual:S,itemHeight:w,scrollWidth:C,prefixCls:`${n}-list`,ref:z,role:"tree",onVisibleChange:ue=>{ue.every(fe=>UDe(fe)!==jI)&&ce()}}),ue=>{const{pos:fe,data:{...se},title:ge,key:ye,isStart:de,isEnd:Ne}=ue,_e=m6(ye,fe);delete se.key,delete se.children;const xe=OO(_e,oe);return f.createElement(pQn,nW({},se,xe,{title:ge,active:!!j&&ye===j.key,pos:fe,data:ue.data,isStart:de,isEnd:Ne,motion:v,motionNodes:ye===jI?K:null,motionType:J,onMotionStart:R,onMotionEnd:ce,treeNodeRequiredProps:oe,onMouseMove:()=>{M(null)}}))}))});function Zue(){return Zue=Object.assign?Object.assign.bind():function(e){for(var t=1;t{const{expandedKeys:o,keyEntities:i}=this.state,{onDragStart:s}=this.props,{eventKey:l}=r;this.dragNodeProps=r,this.dragStartMousePosition={x:n.clientX,y:n.clientY};const c=rv(o,l);this.setState({draggingNodeKey:l,dragChildrenKeys:tQn(l,i),indent:this.listRef.current.getIndentWidth()}),this.setExpandedKeys(c),window.addEventListener("dragend",this.onWindowDragEnd),s==null||s({event:n,node:Ju(r)})});ze(this,"onNodeDragEnter",(n,r)=>{const{expandedKeys:o,keyEntities:i,dragChildrenKeys:s,flattenNodes:l,indent:c}=this.state,{onDragEnter:u,onExpand:d,allowDrop:p,direction:h}=this.props,{pos:m,eventKey:g}=r;if(this.currentMouseOverDroppableNodeKey!==g&&(this.currentMouseOverDroppableNodeKey=g),!this.dragNodeProps){this.resetDragState();return}const{dropPosition:y,dropLevelOffset:x,dropTargetKey:v,dropContainerKey:b,dropTargetPos:w,dropAllowed:S,dragOverNodeKey:C}=DDe(n,this.dragNodeProps,r,c,this.dragStartMousePosition,p,l,i,o,h);if(s.includes(v)||!S){this.resetDragState();return}if(this.delayedDragEnterLogic||(this.delayedDragEnterLogic={}),Object.keys(this.delayedDragEnterLogic).forEach(N=>{clearTimeout(this.delayedDragEnterLogic[N])}),this.dragNodeProps.eventKey!==r.eventKey&&(n.persist(),this.delayedDragEnterLogic[m]=window.setTimeout(()=>{if(this.state.draggingNodeKey===null)return;let N=[...o];const j=rm(i,r.eventKey);j&&(j.children||[]).length&&(N=g1(o,r.eventKey)),this.props.hasOwnProperty("expandedKeys")||this.setExpandedKeys(N),d==null||d(N,{node:Ju(r),expanded:!0,nativeEvent:n.nativeEvent})},800)),this.dragNodeProps.eventKey===v&&x===0){this.resetDragState();return}this.setState({dragOverNodeKey:C,dropPosition:y,dropLevelOffset:x,dropTargetKey:v,dropContainerKey:b,dropTargetPos:w,dropAllowed:S}),u==null||u({event:n,node:Ju(r),expandedKeys:o})});ze(this,"onNodeDragOver",(n,r)=>{const{dragChildrenKeys:o,flattenNodes:i,keyEntities:s,expandedKeys:l,indent:c}=this.state,{onDragOver:u,allowDrop:d,direction:p}=this.props;if(!this.dragNodeProps)return;const{dropPosition:h,dropLevelOffset:m,dropTargetKey:g,dropContainerKey:y,dropTargetPos:x,dropAllowed:v,dragOverNodeKey:b}=DDe(n,this.dragNodeProps,r,c,this.dragStartMousePosition,d,i,s,l,p);o.includes(g)||!v||(this.dragNodeProps.eventKey===g&&m===0?this.state.dropPosition===null&&this.state.dropLevelOffset===null&&this.state.dropTargetKey===null&&this.state.dropContainerKey===null&&this.state.dropTargetPos===null&&this.state.dropAllowed===!1&&this.state.dragOverNodeKey===null||this.resetDragState():h===this.state.dropPosition&&m===this.state.dropLevelOffset&&g===this.state.dropTargetKey&&y===this.state.dropContainerKey&&x===this.state.dropTargetPos&&v===this.state.dropAllowed&&b===this.state.dragOverNodeKey||this.setState({dropPosition:h,dropLevelOffset:m,dropTargetKey:g,dropContainerKey:y,dropTargetPos:x,dropAllowed:v,dragOverNodeKey:b}),u==null||u({event:n,node:Ju(r)}))});ze(this,"onNodeDragLeave",(n,r)=>{this.currentMouseOverDroppableNodeKey===r.eventKey&&!n.currentTarget.contains(n.relatedTarget)&&(this.resetDragState(),this.currentMouseOverDroppableNodeKey=null);const{onDragLeave:o}=this.props;o==null||o({event:n,node:Ju(r)})});ze(this,"onWindowDragEnd",n=>{this.onNodeDragEnd(n,null,!0),window.removeEventListener("dragend",this.onWindowDragEnd)});ze(this,"onNodeDragEnd",(n,r)=>{const{onDragEnd:o}=this.props;this.setState({dragOverNodeKey:null}),this.cleanDragState(),o==null||o({event:n,node:Ju(r)}),this.dragNodeProps=null,window.removeEventListener("dragend",this.onWindowDragEnd)});ze(this,"onNodeDrop",(n,r,o=!1)=>{var y;const{dragChildrenKeys:i,dropPosition:s,dropTargetKey:l,dropTargetPos:c,dropAllowed:u}=this.state;if(!u)return;const{onDrop:d}=this.props;if(this.setState({dragOverNodeKey:null}),this.cleanDragState(),l===null)return;const p={...OO(l,this.getTreeNodeRequiredProps()),active:((y=this.getActiveItem())==null?void 0:y.key)===l,data:rm(this.state.keyEntities,l).node},h=i.includes(l);Al(!h,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");const m=zve(c),g={event:n,node:Ju(p),dragNode:this.dragNodeProps?Ju(this.dragNodeProps):null,dragNodesKeys:[this.dragNodeProps.eventKey].concat(i),dropToGap:s!==0,dropPosition:s+Number(m[m.length-1])};o||d==null||d(g),this.dragNodeProps=null});ze(this,"cleanDragState",()=>{const{draggingNodeKey:n}=this.state;n!==null&&this.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),this.dragStartMousePosition=null,this.currentMouseOverDroppableNodeKey=null});ze(this,"triggerExpandActionExpand",(n,r)=>{const{expandedKeys:o,flattenNodes:i}=this.state,{expanded:s,key:l,isLeaf:c}=r;if(c||n.shiftKey||n.metaKey||n.ctrlKey)return;const u=i.filter(p=>p.key===l)[0],d=Ju({...OO(l,this.getTreeNodeRequiredProps()),data:u.data});this.setExpandedKeys(s?rv(o,l):g1(o,l)),this.onNodeExpand(n,d)});ze(this,"onNodeClick",(n,r)=>{const{onClick:o,expandAction:i}=this.props;i==="click"&&this.triggerExpandActionExpand(n,r),o==null||o(n,r)});ze(this,"onNodeDoubleClick",(n,r)=>{const{onDoubleClick:o,expandAction:i}=this.props;i==="doubleClick"&&this.triggerExpandActionExpand(n,r),o==null||o(n,r)});ze(this,"onNodeSelect",(n,r)=>{let{selectedKeys:o}=this.state;const{keyEntities:i,fieldNames:s}=this.state,{onSelect:l,multiple:c}=this.props,{selected:u}=r,d=r[s.key],p=!u;p?c?o=g1(o,d):o=[d]:o=rv(o,d);const h=o.map(m=>{const g=rm(i,m);return g?g.node:null}).filter(Boolean);this.setUncontrolledState({selectedKeys:o}),l==null||l(o,{event:"select",selected:p,node:r,selectedNodes:h,nativeEvent:n.nativeEvent})});ze(this,"onNodeCheck",(n,r,o)=>{const{keyEntities:i,checkedKeys:s,halfCheckedKeys:l}=this.state,{checkStrictly:c,onCheck:u}=this.props,{key:d}=r;let p;const h={event:"check",node:r,checked:o,nativeEvent:n.nativeEvent};if(c){const m=o?g1(s,d):rv(s,d),g=rv(l,d);p={checked:m,halfChecked:g},h.checkedNodes=m.map(y=>rm(i,y)).filter(Boolean).map(y=>y.node),this.setUncontrolledState({checkedKeys:m})}else{let{checkedKeys:m,halfCheckedKeys:g}=gA([...s,d],!0,i);if(!o){const y=new Set(m);y.delete(d),{checkedKeys:m,halfCheckedKeys:g}=gA(Array.from(y),{halfCheckedKeys:g},i)}p=m,h.checkedNodes=[],h.checkedNodesPositions=[],h.halfCheckedKeys=g,m.forEach(y=>{const x=rm(i,y);if(!x)return;const{node:v,pos:b}=x;h.checkedNodes.push(v),h.checkedNodesPositions.push({node:v,pos:b})}),this.setUncontrolledState({checkedKeys:m},!1,{halfCheckedKeys:g})}u==null||u(p,h)});ze(this,"onNodeLoad",n=>{var l;const{key:r}=n,{keyEntities:o}=this.state,i=rm(o,r);if((l=i==null?void 0:i.children)!=null&&l.length)return;const s=new Promise((c,u)=>{this.setState(({loadedKeys:d=[],loadingKeys:p=[]})=>{const{loadData:h,onLoad:m}=this.props;return!h||d.includes(r)||p.includes(r)?null:(h(n).then(()=>{const{loadedKeys:y}=this.state,x=g1(y,r);m==null||m(x,{event:"load",node:n}),this.setUncontrolledState({loadedKeys:x}),this.setState(v=>({loadingKeys:rv(v.loadingKeys,r)})),c()}).catch(y=>{if(this.setState(x=>({loadingKeys:rv(x.loadingKeys,r)})),this.loadingRetryTimes[r]=(this.loadingRetryTimes[r]||0)+1,this.loadingRetryTimes[r]>=yQn){const{loadedKeys:x}=this.state;Al(!1,"Retry for `loadData` many times but still failed. No more retry."),this.setUncontrolledState({loadedKeys:g1(x,r)}),c()}u(y)}),{loadingKeys:g1(p,r)})})});return s.catch(()=>{}),s});ze(this,"onNodeMouseEnter",(n,r)=>{const{onMouseEnter:o}=this.props;o==null||o({event:n,node:r})});ze(this,"onNodeMouseLeave",(n,r)=>{const{onMouseLeave:o}=this.props;o==null||o({event:n,node:r})});ze(this,"onNodeContextMenu",(n,r)=>{const{onRightClick:o}=this.props;o&&(n.preventDefault(),o({event:n,node:r}))});ze(this,"onFocus",(...n)=>{const{onFocus:r}=this.props;this.setState({focused:!0}),r==null||r(...n)});ze(this,"onBlur",(...n)=>{const{onBlur:r}=this.props;this.setState({focused:!1}),this.onActiveChange(null),r==null||r(...n)});ze(this,"getTreeNodeRequiredProps",()=>{const{expandedKeys:n,selectedKeys:r,loadedKeys:o,loadingKeys:i,checkedKeys:s,halfCheckedKeys:l,dragOverNodeKey:c,dropPosition:u,keyEntities:d}=this.state;return{expandedKeys:n||[],selectedKeys:r||[],loadedKeys:o||[],loadingKeys:i||[],checkedKeys:s||[],halfCheckedKeys:l||[],dragOverNodeKey:c,dropPosition:u,keyEntities:d}});ze(this,"setExpandedKeys",n=>{const{treeData:r,fieldNames:o}=this.state,i=Ste(r,n,o);this.setUncontrolledState({expandedKeys:n,flattenNodes:i},!0)});ze(this,"onNodeExpand",(n,r)=>{let{expandedKeys:o}=this.state;const{listChanging:i,fieldNames:s}=this.state,{onExpand:l,loadData:c}=this.props,{expanded:u}=r,d=r[s.key];if(i)return;const p=o.includes(d),h=!u;if(Al(u&&p||!u&&!p,"Expand state not sync with index check"),o=h?g1(o,d):rv(o,d),this.setExpandedKeys(o),l==null||l(o,{node:r,expanded:h,nativeEvent:n.nativeEvent}),h&&c){const m=this.onNodeLoad(r);m&&m.then(()=>{const g=Ste(this.state.treeData,o,s);this.setUncontrolledState({flattenNodes:g})}).catch(()=>{const{expandedKeys:g}=this.state,y=rv(g,d);this.setExpandedKeys(y)})}});ze(this,"onListChangeStart",()=>{this.setUncontrolledState({listChanging:!0})});ze(this,"onListChangeEnd",()=>{setTimeout(()=>{this.setUncontrolledState({listChanging:!1})})});ze(this,"onActiveChange",n=>{const{activeKey:r}=this.state,{onActiveChange:o,itemScrollOffset:i=0}=this.props;r!==n&&(this.setState({activeKey:n}),n!==null&&this.scrollTo({key:n,offset:i}),o==null||o(n))});ze(this,"getActiveItem",()=>{const{activeKey:n,flattenNodes:r}=this.state;return n===null?null:r.find(({key:o})=>o===n)||null});ze(this,"offsetActiveKey",n=>{const{flattenNodes:r,activeKey:o}=this.state;let i=r.findIndex(({key:l})=>l===o);i===-1&&n<0&&(i=r.length),i=(i+n+r.length)%r.length;const s=r[i];if(s){const{key:l}=s;this.onActiveChange(l)}else this.onActiveChange(null)});ze(this,"onKeyDown",n=>{const{activeKey:r,expandedKeys:o,checkedKeys:i,fieldNames:s}=this.state,{onKeyDown:l,checkable:c,selectable:u}=this.props;switch(n.which){case Ir.UP:{this.offsetActiveKey(-1),n.preventDefault();break}case Ir.DOWN:{this.offsetActiveKey(1),n.preventDefault();break}}const d=this.getActiveItem();if(d&&d.data){const p=this.getTreeNodeRequiredProps(),h=d.data.isLeaf===!1||!!(d.data[s.children]||[]).length,m=Ju({...OO(r,p),data:d.data,active:!0});switch(n.which){case Ir.LEFT:{h&&o.includes(r)?this.onNodeExpand({},m):d.parent&&this.onActiveChange(d.parent.key),n.preventDefault();break}case Ir.RIGHT:{h&&!o.includes(r)?this.onNodeExpand({},m):d.children&&d.children.length&&this.onActiveChange(d.children[0].key),n.preventDefault();break}case Ir.ENTER:case Ir.SPACE:{c&&!m.disabled&&m.checkable!==!1&&!m.disableCheckbox?this.onNodeCheck({},m,!i.includes(r)):!c&&u&&!m.disabled&&m.selectable!==!1&&this.onNodeSelect({},m);break}}}l==null||l(n)});ze(this,"setUncontrolledState",(n,r=!1,o=null)=>{if(!this.destroyed){let i=!1,s=!0;const l={};Object.keys(n).forEach(c=>{if(this.props.hasOwnProperty(c)){s=!1;return}i=!0,l[c]=n[c]}),i&&(!r||s)&&this.setState({...l,...o})}});ze(this,"scrollTo",n=>{this.listRef.current.scrollTo(n)})}componentDidMount(){this.destroyed=!1,this.onUpdated()}componentDidUpdate(){this.onUpdated()}onUpdated(){const{activeKey:n,itemScrollOffset:r=0}=this.props;n!==void 0&&n!==this.state.activeKey&&(this.setState({activeKey:n}),n!==null&&this.scrollTo({key:n,offset:r}))}componentWillUnmount(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}static getDerivedStateFromProps(n,r){const{prevProps:o}=r,i={prevProps:n};function s(d){return!o&&n.hasOwnProperty(d)||o&&o[d]!==n[d]}let l,{fieldNames:c}=r;if(s("fieldNames")&&(c=TT(n.fieldNames),i.fieldNames=c),s("treeData")?{treeData:l}=n:s("children")&&(Al(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),l=eut(n.children)),l){i.treeData=l;const d=Cve(l,{fieldNames:c});i.keyEntities={[jI]:cdt,...d.keyEntities}}const u=i.keyEntities||r.keyEntities;if(s("expandedKeys")||o&&s("autoExpandParent"))i.expandedKeys=n.autoExpandParent||!o&&n.defaultExpandParent?que(n.expandedKeys,u):n.expandedKeys;else if(!o&&n.defaultExpandAll){const d={...u};delete d[jI];const p=[];Object.keys(d).forEach(h=>{const m=d[h];m.children&&m.children.length&&p.push(m.key)}),i.expandedKeys=p}else!o&&n.defaultExpandedKeys&&(i.expandedKeys=n.autoExpandParent||n.defaultExpandParent?que(n.defaultExpandedKeys,u):n.defaultExpandedKeys);if(i.expandedKeys||delete i.expandedKeys,l||i.expandedKeys){const d=Ste(l||r.treeData,i.expandedKeys||r.expandedKeys,c);i.flattenNodes=d}if(n.selectable&&(s("selectedKeys")?i.selectedKeys=LDe(n.selectedKeys,n):!o&&n.defaultSelectedKeys&&(i.selectedKeys=LDe(n.defaultSelectedKeys,n))),n.checkable){let d;if(s("checkedKeys")?d=Rte(n.checkedKeys)||{}:!o&&n.defaultCheckedKeys?d=Rte(n.defaultCheckedKeys)||{}:l&&(d=Rte(n.checkedKeys)||{checkedKeys:r.checkedKeys,halfCheckedKeys:r.halfCheckedKeys}),d){let{checkedKeys:p=[],halfCheckedKeys:h=[]}=d;n.checkStrictly||({checkedKeys:p,halfCheckedKeys:h}=gA(p,!0,u)),i.checkedKeys=p,i.halfCheckedKeys=h}}return s("loadedKeys")&&(i.loadedKeys=n.loadedKeys),i}resetDragState(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}render(){const{focused:n,flattenNodes:r,keyEntities:o,draggingNodeKey:i,activeKey:s,dropLevelOffset:l,dropContainerKey:c,dropTargetKey:u,dropPosition:d,dragOverNodeKey:p,indent:h}=this.state,{prefixCls:m,className:g,style:y,styles:x,classNames:v,showLine:b,focusable:w,tabIndex:S=0,selectable:C,showIcon:N,icon:j,switcherIcon:I,draggable:_,checkable:T,checkStrictly:P,disabled:E,motion:M,loadData:R,filterTreeNode:$,height:D,itemHeight:z,scrollWidth:V,virtual:B,titleRender:G,dropIndicatorRender:H,onContextMenu:F,onScroll:W,direction:U,rootClassName:K,rootStyle:X}=this.props,J=fl(this.props,{aria:!0,data:!0});let te;_&&(typeof _=="object"?te=_:typeof _=="function"?te={nodeDraggable:_}:te={});const re={styles:x,classNames:v,prefixCls:m,selectable:C,showIcon:N,icon:j,switcherIcon:I,draggable:te,draggingNodeKey:i,checkable:T,checkStrictly:P,disabled:E,keyEntities:o,dropLevelOffset:l,dropContainerKey:c,dropTargetKey:u,dropPosition:d,dragOverNodeKey:p,indent:h,direction:U,dropIndicatorRender:H,loadData:R,filterTreeNode:$,titleRender:G,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop};return f.createElement(Fve.Provider,{value:re},f.createElement("div",{className:be(m,g,K,{[`${m}-show-line`]:b,[`${m}-focused`]:n,[`${m}-active-focused`]:s!==null}),style:X},f.createElement(xQn,Zue({ref:this.listRef,prefixCls:m,style:y,data:r,disabled:E,selectable:C,checkable:!!T,motion:M,dragging:i!==null,height:D,itemHeight:z,virtual:B,focusable:w,focused:n,tabIndex:S,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:F,onScroll:W,scrollWidth:V},this.getTreeNodeRequiredProps(),J))))}},ze(_z,"defaultProps",{prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:dQn,allowDrop:()=>!0,expandAction:!1}),ze(_z,"TreeNode",W$),_z);var bQn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"};function ede(){return ede=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,ede({},e,{ref:t,icon:bQn})),udt=f.forwardRef(wQn);var SQn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"};function tde(){return tde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,tde({},e,{ref:t,icon:SQn})),NQn=f.forwardRef(CQn);var jQn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"};function nde(){return nde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,nde({},e,{ref:t,icon:jQn})),IQn=f.forwardRef(EQn);var _Qn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"};function rde(){return rde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,rde({},e,{ref:t,icon:_Qn})),AQn=f.forwardRef(PQn),TQn=({treeCls:e,treeNodeCls:t,directoryNodeSelectedBg:n,directoryNodeSelectedColor:r,motionDurationMid:o,borderRadius:i,controlItemBgHover:s})=>({[`${e}${e}-directory ${t}`]:{[`${e}-node-content-wrapper`]:{position:"static",[`&:has(${e}-drop-indicator)`]:{position:"relative"},[`> *:not(${e}-drop-indicator)`]:{position:"relative"},"&:hover":{background:"transparent"},"&:before":{position:"absolute",inset:0,transition:`background-color ${o}`,content:'""',borderRadius:i},"&:hover:before":{background:s}},[`${e}-switcher, ${e}-checkbox, ${e}-draggable-icon`]:{zIndex:1},"&-selected":{background:n,borderRadius:i,[`${e}-switcher, ${e}-draggable-icon`]:{color:r},[`${e}-node-content-wrapper`]:{color:r,background:"transparent","&, &:hover":{color:r},"&:before, &:hover:before":{background:n}}}}}),kQn=new Go("ant-tree-node-fx-do-not-use",{"0%":{opacity:0},"100%":{opacity:1}}),MQn=(e,t)=>({[`.${e}-switcher-icon`]:{display:"inline-block",fontSize:10,verticalAlign:"baseline",svg:{transition:`transform ${t.motionDurationSlow}`}}}),RQn=(e,t)=>({[`.${e}-drop-indicator`]:{position:"absolute",zIndex:1,height:2,backgroundColor:t.colorPrimary,borderRadius:1,pointerEvents:"none","&:after":{position:"absolute",top:-3,insetInlineStart:-6,width:8,height:8,backgroundColor:"transparent",border:`${Xe(t.lineWidthBold)} solid ${t.colorPrimary}`,borderRadius:"50%",content:'""'}}}),OQn=(e,t)=>{const{treeCls:n,treeNodeCls:r,treeNodePadding:o,titleHeight:i,indentSize:s,nodeSelectedBg:l,nodeHoverBg:c,colorTextQuaternary:u,controlItemBgActiveDisabled:d}=t;return{[n]:{...Ii(t),"--rc-virtual-list-scrollbar-bg":t.colorSplit,background:t.colorBgContainer,borderRadius:t.borderRadius,transition:`background-color ${t.motionDurationSlow}`,"&-rtl":{direction:"rtl"},[`&${n}-rtl ${n}-switcher_close ${n}-switcher-icon svg`]:{transform:"rotate(90deg)"},[`&-focused:not(:hover):not(${n}-active-focused)`]:my(t),[`${n}-list-holder-inner`]:{alignItems:"flex-start"},[`&${n}-block-node`]:{[`${n}-list-holder-inner`]:{alignItems:"stretch",[`${n}-node-content-wrapper`]:{flex:"auto"},[`${r}.dragging:after`]:{position:"absolute",inset:0,border:`1px solid ${t.colorPrimary}`,opacity:0,animationName:kQn,animationDuration:t.motionDurationSlow,animationPlayState:"running",animationFillMode:"forwards",content:'""',pointerEvents:"none",borderRadius:t.borderRadius}}},[r]:{display:"flex",alignItems:"flex-start",marginBottom:o,lineHeight:Xe(i),position:"relative","&:before":{content:'""',position:"absolute",zIndex:1,insetInlineStart:0,width:"100%",top:"100%",height:o},[`&-disabled ${n}-node-content-wrapper`]:{color:t.colorTextDisabled,cursor:"not-allowed","&:hover":{background:"transparent"}},[`${n}-checkbox-disabled + ${n}-node-selected,&${r}-disabled${r}-selected ${n}-node-content-wrapper`]:{backgroundColor:d},[`${n}-checkbox-disabled`]:{pointerEvents:"unset"},[`&:not(${r}-disabled)`]:{[`${n}-node-content-wrapper`]:{"&:hover":{color:t.nodeHoverColor}}},[`&-active ${n}-node-content-wrapper`]:{background:t.controlItemBgHover},[`&:not(${r}-disabled).filter-node ${n}-title`]:{color:t.colorPrimary,fontWeight:t.fontWeightStrong},"&-draggable":{cursor:"grab",[`${n}-draggable-icon`]:{flexShrink:0,width:i,textAlign:"center",visibility:"visible",color:u},[`&${r}-disabled ${n}-draggable-icon`]:{visibility:"hidden"}}},[`${n}-indent`]:{alignSelf:"stretch",whiteSpace:"nowrap",userSelect:"none","&-unit":{display:"inline-block",width:s}},[`${n}-draggable-icon`]:{visibility:"hidden"},[`${n}-switcher, ${n}-checkbox`]:{marginInlineEnd:t.calc(t.calc(i).sub(t.controlInteractiveSize)).div(2).equal()},[`${n}-switcher`]:{...MQn(e,t),position:"relative",flex:"none",alignSelf:"stretch",width:i,textAlign:"center",cursor:"pointer",userSelect:"none",transition:`all ${t.motionDurationSlow}`,"&-noop":{cursor:"unset"},"&:before":{pointerEvents:"none",content:'""',width:i,height:i,position:"absolute",left:{_skip_check_:!0,value:0},top:0,borderRadius:t.borderRadius,transition:`all ${t.motionDurationSlow}`},[`&:not(${n}-switcher-noop):hover:before`]:{backgroundColor:t.colorBgTextHover},[`&_close ${n}-switcher-icon svg`]:{transform:"rotate(-90deg)"},"&-loading-icon":{color:t.colorPrimary},"&-leaf-line":{position:"relative",zIndex:1,display:"inline-block",width:"100%",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(i).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),marginInlineStart:-1,borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&:after":{position:"absolute",width:t.calc(t.calc(i).div(2).equal()).mul(.8).equal(),height:t.calc(i).div(2).equal(),borderBottom:`1px solid ${t.colorBorder}`,content:'""'}}},[`${n}-node-content-wrapper`]:{position:"relative",minHeight:i,paddingBlock:0,paddingInline:t.paddingXS,background:"transparent",borderRadius:t.borderRadius,cursor:"pointer",transition:`all ${t.motionDurationMid}, border 0s, line-height 0s, box-shadow 0s`,...RQn(e,t),"&:hover":{backgroundColor:c},[`&${n}-node-selected`]:{color:t.nodeSelectedColor,backgroundColor:l},[`${n}-iconEle`]:{display:"inline-block",width:i,height:i,textAlign:"center",verticalAlign:"top","&:empty":{display:"none"}}},[`${n}-unselectable ${n}-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${r}.drop-container > [draggable]`]:{boxShadow:`0 0 0 2px ${t.colorPrimary}`},"&-show-line":{[`${n}-indent-unit`]:{position:"relative",height:"100%","&:before":{position:"absolute",top:0,insetInlineEnd:t.calc(i).div(2).equal(),bottom:t.calc(o).mul(-1).equal(),borderInlineEnd:`1px solid ${t.colorBorder}`,content:'""'},"&-end:before":{display:"none"}},[`${n}-switcher`]:{background:"transparent","&-line-icon":{verticalAlign:"-0.15em"}}},[`${r}-leaf-last ${n}-switcher-leaf-line:before`]:{top:"auto !important",bottom:"auto !important",height:`${Xe(t.calc(i).div(2).equal())} !important`}}}},$Qn=(e,t,n=!0)=>{const r=`.${e}`,o=`${r}-treenode`,i=t.calc(t.paddingXS).div(2).equal(),s=Ho(t,{treeCls:r,treeNodeCls:o,treeNodePadding:i});return[OQn(e,s),n&&TQn(s)].filter(Boolean)},DQn=e=>{const{controlHeightSM:t,controlItemBgHover:n,controlItemBgActive:r}=e,o=t;return{titleHeight:o,indentSize:o,nodeHoverBg:n,nodeHoverColor:e.colorText,nodeSelectedBg:r,nodeSelectedColor:e.colorText}},LQn=e=>{const{colorTextLightSolid:t,colorPrimary:n}=e;return{...DQn(e),directoryNodeSelectedColor:t,directoryNodeSelectedBg:n}},FQn=ui("Tree",(e,{prefixCls:t})=>[{[e.componentCls]:nut(`${t}-checkbox`,e)},$Qn(t,e),Fye(e)],LQn),WDe=4;function zQn(e){const{dropPosition:t,dropLevelOffset:n,prefixCls:r,indent:o,direction:i="ltr"}=e,s=i==="ltr"?"left":"right",l=i==="ltr"?"right":"left",c={[s]:-n*o+WDe,[l]:0};switch(t){case-1:c.top=-3;break;case 1:c.bottom=-3;break;default:c.bottom=-3,c[s]=o+WDe;break}return Ie.createElement("div",{style:c,className:`${r}-drop-indicator`})}var BQn={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"};function ode(){return ode=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,ode({},e,{ref:t,icon:BQn})),VQn=f.forwardRef(HQn);var UQn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};function ide(){return ide=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,ide({},e,{ref:t,icon:UQn})),GQn=f.forwardRef(WQn);var qQn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"};function ade(){return ade=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,ade({},e,{ref:t,icon:qQn})),YQn=f.forwardRef(KQn),XQn=e=>{var h,m;const{prefixCls:t,switcherIcon:n,treeNodeProps:r,showLine:o,switcherLoadingIcon:i}=e,{isLeaf:s,expanded:l,loading:c}=r;if(c)return f.isValidElement(i)?i:f.createElement(MC,{className:`${t}-switcher-loading-icon`});let u;if(o&&typeof o=="object"&&(u=o.showLeafIcon),s){if(!o)return null;if(typeof u!="boolean"&&u){const g=typeof u=="function"?u(r):u,y=`${t}-switcher-line-custom-icon`;return f.isValidElement(g)?Fc(g,{className:be((h=g.props)==null?void 0:h.className,y)}):g}return u?f.createElement(udt,{className:`${t}-switcher-line-icon`}):f.createElement("span",{className:`${t}-switcher-leaf-line`})}const d=`${t}-switcher-icon`,p=typeof n=="function"?n(r):n;return f.isValidElement(p)?Fc(p,{className:be((m=p.props)==null?void 0:m.className,d)}):p!==void 0?p:o?l?f.createElement(GQn,{className:`${t}-switcher-line-icon`}):f.createElement(YQn,{className:`${t}-switcher-line-icon`}):f.createElement(VQn,{className:d})},ddt=Ie.forwardRef((e,t)=>{var K;const{getPrefixCls:n,direction:r,className:o,style:i,classNames:s,styles:l}=Zo("tree"),{virtual:c}=Ie.useContext(Qr),{prefixCls:u,className:d,showIcon:p=!1,showLine:h,switcherIcon:m,switcherLoadingIcon:g,blockNode:y=!1,children:x,checkable:v=!1,selectable:b=!0,draggable:w,disabled:S,motion:C,style:N,rootClassName:j,classNames:I,styles:_}=e,T=Ie.useContext(Mp),P=S??T,E=n("tree",u),M=n(),R=C??{...AU(M),motionAppear:!1},$={...e,showIcon:p,blockNode:y,checkable:v,selectable:b,disabled:P,motion:R},[D,z]=di([s,I],[l,_],{props:$}),V={...e,checkable:v,selectable:b,showIcon:p,motion:R,blockNode:y,disabled:P,showLine:!!h,dropIndicatorRender:zQn},[B,G]=FQn(E),[,H]=Xf(),F=H.paddingXS/2+(((K=H.Tree)==null?void 0:K.titleHeight)||H.controlHeightSM),W=Ie.useMemo(()=>{if(!w)return!1;let X={};switch(typeof w){case"function":X.nodeDraggable=w;break;case"object":X={...w};break}return X.icon!==!1&&(X.icon=X.icon||Ie.createElement(AQn,null)),X},[w]),U=X=>Ie.createElement(XQn,{prefixCls:E,switcherIcon:m,switcherLoadingIcon:g,treeNodeProps:X,showLine:h});return Ie.createElement(vQn,{itemHeight:F,ref:t,virtual:c,...V,prefixCls:E,className:be({[`${E}-icon-hide`]:!p,[`${E}-block-node`]:y,[`${E}-unselectable`]:!b,[`${E}-rtl`]:r==="rtl",[`${E}-disabled`]:P},o,d,B,G),style:{...i,...N},rootClassName:be(D==null?void 0:D.root,j),rootStyle:z==null?void 0:z.root,classNames:D,styles:z,direction:r,checkable:v&&Ie.createElement("span",{className:`${E}-checkbox-inner`}),selectable:b,switcherIcon:U,draggable:W},x)}),GDe=0,Ote=1,qDe=2;function Bve(e,t,n){const{key:r,children:o}=n;function i(s){const l=s[r],c=s[o];t(l,s)!==!1&&Bve(c||[],t,n)}e.forEach(i)}function QQn({treeData:e,expandedKeys:t,startKey:n,endKey:r,fieldNames:o}){const i=[];let s=GDe;if(n&&n===r)return[n];if(!n||!r)return[];function l(c){return c===n||c===r}return Bve(e,c=>{if(s===qDe)return!1;if(l(c)){if(i.push(c),s===GDe)s=Ote;else if(s===Ote)return s=qDe,!1}else s===Ote&&i.push(c);return t.includes(c)},TT(o)),i}function $te(e,t,n){const r=go(t),o=[];return Bve(e,(i,s)=>{const l=r.indexOf(i);return l!==-1&&(o.push(s),r.splice(l,1)),!!r.length},TT(n)),o}function JQn(e){const{isLeaf:t,expanded:n}=e;return t?f.createElement(udt,null):n?f.createElement(NQn,null):f.createElement(IQn,null)}function KDe({treeData:e,children:t}){return e||eut(t)}const ZQn=({defaultExpandAll:e,defaultExpandParent:t,defaultExpandedKeys:n,...r},o)=>{const i=f.useRef(null),s=f.useRef(null),l=()=>{const{keyEntities:j}=Cve(KDe(r),{fieldNames:r.fieldNames});let I;const _=r.expandedKeys||n||[];return e?I=Object.keys(j):t?I=que(_,j):I=_,I},[c,u]=f.useState(r.selectedKeys||r.defaultSelectedKeys||[]),[d,p]=f.useState(()=>l());f.useEffect(()=>{"selectedKeys"in r&&u(r.selectedKeys)},[r.selectedKeys]),f.useEffect(()=>{"expandedKeys"in r&&p(r.expandedKeys)},[r.expandedKeys]);const h=(j,I)=>{var _;return"expandedKeys"in r||p(j),(_=r.onExpand)==null?void 0:_.call(r,j,I)},m=(j,I)=>{var B;const{multiple:_,fieldNames:T}=r,{node:P,nativeEvent:E}=I,{key:M=""}=P,R=KDe(r),$={...I,selected:!0},D=(E==null?void 0:E.ctrlKey)||(E==null?void 0:E.metaKey),z=E==null?void 0:E.shiftKey;let V;_&&D?(V=j,i.current=M,s.current=V,$.selectedNodes=$te(R,V,T)):_&&z?(V=Array.from(new Set([].concat(go(s.current||[]),go(QQn({treeData:R,expandedKeys:d,startKey:M,endKey:i.current,fieldNames:T}))))),$.selectedNodes=$te(R,V,T)):(V=[M],i.current=M,s.current=V,$.selectedNodes=$te(R,V,T)),(B=r.onSelect)==null||B.call(r,V,$),"selectedKeys"in r||u(V)},{getPrefixCls:g,direction:y}=f.useContext(Qr),{prefixCls:x,className:v,showIcon:b=!0,expandAction:w="click",...S}=r,C=g("tree",x),N=be(`${C}-directory`,{[`${C}-directory-rtl`]:y==="rtl"},v);return f.createElement(ddt,{icon:JQn,ref:o,blockNode:!0,...S,showIcon:b,expandAction:w,prefixCls:C,className:N,expandedKeys:d,selectedKeys:c,onSelect:m,onExpand:h})},eJn=f.forwardRef(ZQn),Hve=ddt;Hve.DirectoryTree=eJn;Hve.TreeNode=W$;const fdt=Ie.createContext(!1),YDe=e=>{const{value:t,filterSearch:n,tablePrefixCls:r,locale:o,onChange:i}=e;return n?f.createElement("div",{className:`${r}-filter-dropdown-search`},f.createElement(g6,{prefix:f.createElement(zE,null),placeholder:o.filterSearchPlaceholder,onChange:i,value:t,htmlSize:1,className:`${r}-filter-dropdown-search-input`})):null},tJn=e=>{const{keyCode:t}=e;t===Ir.ENTER&&e.stopPropagation()},nJn=f.forwardRef((e,t)=>f.createElement("div",{className:e.className,onClick:n=>n.stopPropagation(),onKeyDown:tJn,ref:t},e.children));function xA(e){let t=[];return(e||[]).forEach(({value:n,children:r})=>{t.push(n),r&&(t=[].concat(go(t),go(xA(r))))}),t}function rJn(e){return e.some(({children:t})=>t)}function pdt(e,t){return typeof t=="string"||typeof t=="number"?t==null?void 0:t.toString().toLowerCase().includes(e.trim().toLowerCase()):!1}function hdt({filters:e,prefixCls:t,filteredKeys:n,filterMultiple:r,searchValue:o,filterSearch:i}){return e.map((s,l)=>{const c=String(s.value);if(s.children)return{key:c||l,label:s.text,popupClassName:`${t}-dropdown-submenu`,children:hdt({filters:s.children,prefixCls:t,filteredKeys:n,filterMultiple:r,searchValue:o,filterSearch:i})};const u=r?kT:h6,d={key:s.value!==void 0?c:l,label:f.createElement(f.Fragment,null,f.createElement(u,{checked:n.includes(c)}),f.createElement("span",null,s.text))};return o.trim()?typeof i=="function"?i(o,s)?d:null:pdt(o,s.text)?d:null:d})}function Dte(e){return e||[]}const oJn=e=>{var ye;const{tablePrefixCls:t,prefixCls:n,column:r,dropdownPrefixCls:o,columnKey:i,filterOnClose:s,filterMultiple:l,filterMode:c="menu",filterSearch:u=!1,filterState:d,triggerFilter:p,locale:h,children:m,getPopupContainer:g,rootClassName:y}=e,{filterResetToDefaultFilteredValue:x,defaultFilteredValue:v,filterDropdownProps:b={},filterDropdownOpen:w,onFilterDropdownOpenChange:S}=r,[C,N]=f.useState(!1),j=f.useContext(fdt),I=!!(d&&((ye=d.filteredKeys)!=null&&ye.length||d.forceFiltered)),_=de=>{var Ne;N(de),(Ne=b.onOpenChange)==null||Ne.call(b,de),S==null||S(de)},T=b.open??w??C,P=d==null?void 0:d.filteredKeys,[E,M]=BRn(Dte(P)),R=({selectedKeys:de})=>{M(de)},$=(de,{node:Ne,checked:_e})=>{R(l?{selectedKeys:de}:{selectedKeys:_e&&Ne.key?[Ne.key]:[]})};f.useEffect(()=>{C&&R({selectedKeys:Dte(P)})},[P]);const[D,z]=f.useState([]),V=de=>{z(de)},[B,G]=f.useState(""),H=de=>{const{value:Ne}=de.target;G(Ne)};f.useEffect(()=>{C||G("")},[C]);const F=de=>{const Ne=de!=null&&de.length?de:null;if(Ne===null&&(!d||!d.filteredKeys)||hy(Ne,d==null?void 0:d.filteredKeys,!0))return null;p({column:r,key:i,filteredKeys:Ne})},W=()=>{_(!1),F(E())},U=({confirm:de,closeDropdown:Ne}={confirm:!1,closeDropdown:!1})=>{de&&F([]),Ne&&_(!1),G(""),M(x?(v||[]).map(_e=>String(_e)):[])},K=({closeDropdown:de}={closeDropdown:!0})=>{de&&_(!1),F(E())},X=(de,Ne)=>{Ne.source==="trigger"&&(de&&P!==void 0&&M(Dte(P)),_(de),!de&&!r.filterDropdown&&s&&W())},J=be({[`${o}-menu-without-submenu`]:!rJn(r.filters||[])}),te=de=>{if(de.target.checked){const Ne=xA(r==null?void 0:r.filters).map(_e=>String(_e));M(Ne)}else M([])},re=({filters:de})=>(de||[]).map((Ne,_e)=>{const xe=String(Ne.value),we={title:Ne.text,key:Ne.value!==void 0?xe:String(_e)};return Ne.children&&(we.children=re({filters:Ne.children})),we}),ce=de=>{var Ne;return{...de,text:de.title,value:de.key,children:((Ne=de.children)==null?void 0:Ne.map(_e=>ce(_e)))||[]}};let ae;const{direction:oe,renderEmpty:ue}=f.useContext(Qr);if(typeof r.filterDropdown=="function")ae=r.filterDropdown({prefixCls:`${o}-custom`,setSelectedKeys:de=>R({selectedKeys:de}),selectedKeys:E(),confirm:K,clearFilters:U,filters:r.filters,visible:T,close:()=>{_(!1)}});else if(r.filterDropdown)ae=r.filterDropdown;else{const de=E()||[],Ne=()=>{const xe=(ue==null?void 0:ue("Table.filter"))??f.createElement(i0,{image:i0.PRESENTED_IMAGE_SIMPLE,description:h.filterEmptyText,styles:{image:{height:24}},style:{margin:0,padding:"16px 0"}});if((r.filters||[]).length===0)return xe;if(c==="tree")return f.createElement(f.Fragment,null,f.createElement(YDe,{filterSearch:u,value:B,onChange:H,tablePrefixCls:t,locale:h}),f.createElement("div",{className:`${t}-filter-dropdown-tree`},l?f.createElement(kT,{checked:de.length===xA(r.filters).length,indeterminate:de.length>0&&de.lengthtypeof u=="function"?u(B,ce(Re)):pdt(B,Re.title):void 0})));const we=hdt({filters:r.filters||[],filterSearch:u,prefixCls:n,filteredKeys:E(),filterMultiple:l,searchValue:B}),Te=we.every(Re=>Re===null);return f.createElement(f.Fragment,null,f.createElement(YDe,{filterSearch:u,value:B,onChange:H,tablePrefixCls:t,locale:h}),Te?xe:f.createElement(Vk,{selectable:!0,multiple:l,prefixCls:`${o}-menu`,className:J,onSelect:R,onDeselect:R,selectedKeys:de,getPopupContainer:g,openKeys:D,onOpenChange:V,items:we}))},_e=()=>x?hy((v||[]).map(xe=>String(xe)),de,!0):de.length===0;ae=f.createElement(f.Fragment,null,Ne(),f.createElement("div",{className:`${n}-dropdown-btns`},f.createElement(Ls,{type:"link",size:"small",disabled:_e(),onClick:()=>U()},h.filterReset),f.createElement(Ls,{type:"primary",size:"small",onClick:W},h.filterConfirm)))}r.filterDropdown&&(ae=f.createElement(Vlt,{selectable:void 0},ae)),ae=f.createElement(nJn,{className:`${n}-dropdown`},ae);const se=(()=>{let de;return typeof r.filterIcon=="function"?de=r.filterIcon(I):r.filterIcon?de=r.filterIcon:de=f.createElement(uQn,null),f.createElement("span",{role:"button",tabIndex:-1,className:be(`${n}-trigger`,{active:I}),onClick:Ne=>{Ne.stopPropagation()}},de)})();if(j)return f.createElement("div",{className:`${n}-column`},f.createElement("span",{className:`${t}-column-title`},m),se);const ge=u$({trigger:["click"],placement:oe==="rtl"?"bottomLeft":"bottomRight",children:se,getPopupContainer:g},{...b,rootClassName:be(y,b.rootClassName),open:T,onOpenChange:X,popupRender:()=>typeof(b==null?void 0:b.dropdownRender)=="function"?b.dropdownRender(ae):ae});return f.createElement("div",{className:`${n}-column`},f.createElement("span",{className:`${t}-column-title`},m),f.createElement(Ive,{...ge}))},sde=(e,t,n)=>{let r=[];return(e||[]).forEach((o,i)=>{const s=Jk(i,n),l=o.filterDropdown!==void 0;if(o.filters||l||"onFilter"in o)if("filteredValue"in o){let c=o.filteredValue;l||(c=(c==null?void 0:c.map(String))??c),r.push({column:o,key:RC(o,s),filteredKeys:c,forceFiltered:o.filtered})}else r.push({column:o,key:RC(o,s),filteredKeys:t&&o.defaultFilteredValue?o.defaultFilteredValue:void 0,forceFiltered:o.filtered});"children"in o&&(r=[].concat(go(r),go(sde(o.children,t,s))))}),r};function mdt(e,t,n,r,o,i,s,l,c){return n.map((u,d)=>{const p=Jk(d,l),{filterOnClose:h=!0,filterMultiple:m=!0,filterMode:g,filterSearch:y}=u;let x=u;if(x.filters||x.filterDropdown){const v=RC(x,p),b=r.find(({key:w})=>v===w);x={...x,title:w=>f.createElement(oJn,{tablePrefixCls:e,prefixCls:`${e}-filter`,dropdownPrefixCls:t,column:x,columnKey:v,filterState:b,filterOnClose:h,filterMultiple:m,filterMode:g,filterSearch:y,triggerFilter:i,locale:o,getPopupContainer:s,rootClassName:c},lY(u.title,w))}}return"children"in x&&(x={...x,children:mdt(e,t,x.children,r,o,i,s,p,c)}),x})}const XDe=e=>{const t={};return e.forEach(({key:n,filteredKeys:r,column:o})=>{const i=n,{filters:s,filterDropdown:l}=o;if(l)t[i]=r||null;else if(Array.isArray(r)){const c=xA(s);t[i]=c.filter(u=>r.includes(String(u)))}else t[i]=null}),t},lde=(e,t,n)=>t.reduce((o,i)=>{const{column:{onFilter:s,filters:l},filteredKeys:c}=i;return s&&c&&c.length?o.map(u=>({...u})).filter(u=>c.some(d=>{const p=xA(l),h=p.findIndex(g=>String(g)===String(d)),m=h!==-1?p[h]:d;return u[n]&&(u[n]=lde(u[n],t,n)),s(m,u)})):o},e),gdt=e=>e.flatMap(t=>"children"in t?[t].concat(go(gdt(t.children||[]))):[t]),iJn=e=>{const{prefixCls:t,dropdownPrefixCls:n,mergedColumns:r,onFilterChange:o,getPopupContainer:i,locale:s,rootClassName:l}=e;Qw();const c=f.useMemo(()=>gdt(r||[]),[r]),[u,d]=f.useState(()=>sde(c,!0)),p=f.useMemo(()=>{const y=sde(c,!1);if(y.length===0)return y;let x=!0;if(y.forEach(({filteredKeys:v})=>{v!==void 0&&(x=!1)}),x){const v=(c||[]).map((b,w)=>RC(b,Jk(w)));return u.filter(({key:b})=>v.includes(b)).map(b=>{const w=c[v.indexOf(b.key)];return{...b,column:{...b.column,...w},forceFiltered:w.filtered}})}return y},[c,u]),h=f.useMemo(()=>XDe(p),[p]),m=y=>{const x=p.filter(({key:v})=>v!==y.key);x.push(y),d(x),o(XDe(x),x)};return[y=>mdt(t,n,y,p,s,m,i,void 0,l),p,h]},aJn=(e,t,n)=>{const r=f.useRef({});function o(i){var s;if(!r.current||r.current.data!==e||r.current.childrenColumnName!==t||r.current.getRowKey!==n){let c=function(u){u.forEach((d,p)=>{const h=n(d,p);l.set(h,d),d&&typeof d=="object"&&t in d&&c(d[t]||[])})};const l=new Map;c(e),r.current={data:e,childrenColumnName:t,kvMap:l,getRowKey:n}}return(s=r.current.kvMap)==null?void 0:s.get(i)}return[o]},xdt=10;function sJn(e,t){const n={current:e.current,pageSize:e.pageSize};return Object.keys(t&&typeof t=="object"?t:{}).forEach(o=>{const i=e[o];typeof i!="function"&&(n[o]=i)}),n}function lJn(e,t,n){const{total:r=0,...o}=n&&typeof n=="object"?n:{},[i,s]=f.useState(()=>({current:"defaultCurrent"in o?o.defaultCurrent:1,pageSize:"defaultPageSize"in o?o.defaultPageSize:xdt})),l=u$(i,o,{total:r>0?r:e}),c=Math.ceil((r||e)/l.pageSize);l.current>c&&(l.current=c||1);const u=(p,h)=>{s({current:p??1,pageSize:h||l.pageSize})},d=(p,h)=>{var m;n&&((m=n.onChange)==null||m.call(n,p,h)),u(p,h),t(p,h||(l==null?void 0:l.pageSize))};return n===!1?[{},()=>{}]:[{...l,onChange:d},u]}var cJn={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"};function cde(){return cde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,cde({},e,{ref:t,icon:cJn})),dJn=f.forwardRef(uJn);var fJn={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"};function ude(){return ude=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,ude({},e,{ref:t,icon:fJn})),hJn=f.forwardRef(pJn),IB="ascend",Lte="descend",rW=e=>typeof e.sorter=="object"&&typeof e.sorter.multiple=="number"?e.sorter.multiple:!1,QDe=e=>typeof e=="function"?e:e&&typeof e=="object"&&e.compare?e.compare:!1,mJn=(e,t)=>t?e[e.indexOf(t)+1]:e[0],dde=(e,t,n)=>{let r=[];const o=(i,s)=>{r.push({column:i,key:RC(i,s),multiplePriority:rW(i),sortOrder:i.sortOrder})};return(e||[]).forEach((i,s)=>{const l=Jk(s,n);i.children?("sortOrder"in i&&o(i,l),r=[].concat(go(r),go(dde(i.children,t,l)))):i.sorter&&("sortOrder"in i?o(i,l):t&&i.defaultSortOrder&&r.push({column:i,key:RC(i,l),multiplePriority:rW(i),sortOrder:i.defaultSortOrder}))}),r},ydt=(e,t,n,r,o,i,s,l,c)=>(t||[]).map((d,p)=>{const h=Jk(p,l);let m=d;if(m.sorter){const g=m.sortDirections||o,y=m.showSorterTooltip===void 0?s:m.showSorterTooltip,x=RC(m,h),v=n.find(({key:T})=>T===x),b=v?v.sortOrder:null,w=mJn(g,b);let S;if(d.sortIcon)S=d.sortIcon({sortOrder:b});else{const T=g.includes(IB)&&f.createElement(hJn,{className:be(`${e}-column-sorter-up`,{active:b===IB})}),P=g.includes(Lte)&&f.createElement(dJn,{className:be(`${e}-column-sorter-down`,{active:b===Lte})});S=f.createElement("span",{className:be(`${e}-column-sorter`,{[`${e}-column-sorter-full`]:!!(T&&P)})},f.createElement("span",{className:`${e}-column-sorter-inner`,"aria-hidden":"true"},T,P))}const{cancelSort:C,triggerAsc:N,triggerDesc:j}=i||{};let I=C;w===Lte?I=j:w===IB&&(I=N);const _=typeof y=="object"?{title:I,...y}:{title:I};m={...m,className:be(m.className,{[`${e}-column-sort`]:b}),title:T=>{const P=`${e}-column-sorters`,E=f.createElement("span",{className:`${e}-column-title`},lY(d.title,T)),M=f.createElement("div",{className:P},E,S);return y?typeof y!="boolean"&&(y==null?void 0:y.target)==="sorter-icon"?f.createElement("div",{className:be(P,`${P}-tooltip-target-sorter`)},E,f.createElement(pf,{..._},S)):f.createElement(pf,{..._},M):M},onHeaderCell:T=>{var D;const P=((D=d.onHeaderCell)==null?void 0:D.call(d,T))||{},E=P.onClick,M=P.onKeyDown;P.onClick=z=>{r({column:d,key:x,sortOrder:w,multiplePriority:rW(d)}),E==null||E(z)},P.onKeyDown=z=>{z.keyCode===Ir.ENTER&&(r({column:d,key:x,sortOrder:w,multiplePriority:rW(d)}),M==null||M(z))};const R=sQn(d.title,{}),$=R==null?void 0:R.toString();return b&&(P["aria-sort"]=b==="ascend"?"ascending":"descending"),P["aria-description"]=c==null?void 0:c.sortable,P["aria-label"]=$||"",P.className=be(P.className,`${e}-column-has-sorters`),P.tabIndex=0,d.ellipsis&&(P.title=(R??"").toString()),P}}}return"children"in m&&(m={...m,children:ydt(e,m.children,n,r,o,i,s,h,c)}),m}),JDe=e=>{const{column:t,sortOrder:n}=e;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}},ZDe=e=>{const t=e.filter(({sortOrder:n})=>n).map(JDe);if(t.length===0&&e.length){const n=e.length-1;return{...JDe(e[n]),column:void 0,order:void 0,field:void 0,columnKey:void 0}}return t.length<=1?t[0]||{}:t},fde=(e,t,n)=>{const r=t.slice().sort((s,l)=>l.multiplePriority-s.multiplePriority),o=e.slice(),i=r.filter(({column:{sorter:s},sortOrder:l})=>QDe(s)&&l);return i.length?o.sort((s,l)=>{for(let c=0;c{const l=s[n];return l?{...s,[n]:fde(l,t,n)}:s}):o},gJn=e=>{const{prefixCls:t,mergedColumns:n,sortDirections:r,tableLocale:o,showSorterTooltip:i,onSorterChange:s,globalLocale:l}=e,[c,u]=f.useState(()=>dde(n,!0)),d=(x,v)=>{const b=[];return x.forEach((w,S)=>{const C=Jk(S,v);if(b.push(RC(w,C)),Array.isArray(w.children)){const N=d(w.children,C);b.push.apply(b,go(N))}}),b},p=f.useMemo(()=>{let x=!0;const v=dde(n,!1);if(!v.length){const C=d(n);return c.filter(({key:N})=>C.includes(N))}const b=[];function w(C){x?b.push(C):b.push({...C,sortOrder:null})}let S=null;return v.forEach(C=>{S===null?(w(C),C.sortOrder&&(C.multiplePriority===!1?x=!1:S=!0)):(S&&C.multiplePriority!==!1||(x=!1),w(C))}),b},[n,c]),h=f.useMemo(()=>{var v,b;const x=p.map(({column:w,sortOrder:S})=>({column:w,order:S}));return{sortColumns:x,sortColumn:(v=x[0])==null?void 0:v.column,sortOrder:(b=x[0])==null?void 0:b.order}},[p]),m=x=>{let v;x.multiplePriority===!1||!p.length||p[0].multiplePriority===!1?v=[x]:v=[].concat(go(p.filter(({key:b})=>b!==x.key)),[x]),u(v),s(ZDe(v),v)};return[x=>ydt(t,x,p,m,r,o,i,void 0,l),p,h,()=>ZDe(p)]},vdt=(e,t)=>e.map(r=>{const o={...r};return o.title=lY(r.title,t),"children"in o&&(o.children=vdt(o.children,t)),o}),xJn=e=>[f.useCallback(n=>vdt(n,e),[e])],yJn=idt((e,t)=>{const{_renderTimes:n}=e,{_renderTimes:r}=t;return n!==r}),vJn=sdt((e,t)=>{const{_renderTimes:n}=e,{_renderTimes:r}=t;return n!==r}),bJn=e=>{const{componentCls:t,lineWidth:n,lineType:r,tableBorderColor:o,tableHeaderBg:i,tablePaddingVertical:s,tablePaddingHorizontal:l,calc:c}=e,u=`${Xe(n)} ${r} ${o}`,d=(p,h,m)=>({[`&${t}-${p}`]:{[`> ${t}-container`]:{[`> ${t}-content, > ${t}-body`]:{"\n > table > tbody > tr > th,\n > table > tbody > tr > td\n ":{[`> ${t}-expanded-row-fixed`]:{margin:`${Xe(c(h).mul(-1).equal())} ${Xe(c(c(m).add(n)).mul(-1).equal())}`}}}}}});return{[`${t}-wrapper`]:{[`${t}${t}-bordered`]:{[`> ${t}-title`]:{border:u,borderBottom:0},[`> ${t}-container`]:{borderInlineStart:u,borderTop:u,[` > ${t}-content, > ${t}-header, > ${t}-body, > ${t}-summary `]:{"> table":{"\n > thead > tr > th,\n > thead > tr > td,\n > tbody > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ":{borderInlineEnd:u},"> thead":{"> tr:not(:last-child) > th":{borderBottom:u},"> tr > th::before":{backgroundColor:"transparent !important"}},"\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ":{[`> ${t}-cell-fix-right-first::after`]:{borderInlineEnd:u}},"\n > tbody > tr > th,\n > tbody > tr > td\n ":{[`> ${t}-expanded-row-fixed`]:{margin:`${Xe(c(s).mul(-1).equal())} ${Xe(c(c(l).add(n)).mul(-1).equal())}`,"&::after":{position:"absolute",top:0,insetInlineEnd:n,bottom:0,borderInlineEnd:u,content:'""'}}}}}},[`&${t}-scroll-horizontal`]:{[`> ${t}-container > ${t}-body`]:{"> table > tbody":{[` > tr${t}-expanded-row, > tr${t}-placeholder `]:{"> th, > td":{borderInlineEnd:0}}}}},...d("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle),...d("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall),[`> ${t}-footer`]:{border:u,borderTop:0}},[`${t}-cell`]:{[`${t}-container:first-child`]:{borderTop:0},"&-scrollbar:not([rowspan])":{boxShadow:`0 ${Xe(n)} 0 ${Xe(n)} ${i}`}},[`${t}-bordered ${t}-cell-scrollbar`]:{borderInlineEnd:u}}}},wJn=e=>{const{componentCls:t}=e;return{[`${t}-wrapper`]:{[`${t}-cell-ellipsis`]:{...wh,wordBreak:"keep-all",[` &${t}-cell-fix-start-shadow, &${t}-cell-fix-end-shadow `]:{overflow:"visible",[`${t}-cell-content`]:{...wh,display:"block"}},[`${t}-column-title`]:{...wh,wordBreak:"keep-all"}}}}},SJn=e=>{const{componentCls:t}=e;return{[`${t}-wrapper`]:{[`${t}-tbody > tr${t}-placeholder`]:{textAlign:"center",color:e.colorTextDisabled,"\n &:hover > th,\n &:hover > td,\n ":{background:e.colorBgContainer}}}}},CJn=e=>{const{componentCls:t,antCls:n,motionDurationSlow:r,lineWidth:o,paddingXS:i,lineType:s,tableBorderColor:l,tableExpandIconBg:c,tableExpandColumnWidth:u,borderRadius:d,tablePaddingVertical:p,tablePaddingHorizontal:h,tableExpandedRowBg:m,paddingXXS:g,expandIconMarginTop:y,expandIconSize:x,expandIconHalfInner:v,expandIconScale:b,calc:w}=e,S=`${Xe(o)} ${s} ${l}`,C=w(g).sub(o).equal();return{[`${t}-wrapper`]:{[`${t}-expand-icon-col`]:{width:u},[`${t}-row-expand-icon-cell`]:{textAlign:"center",[`${t}-row-expand-icon`]:{display:"inline-flex",float:"none",verticalAlign:"sub"}},[`${t}-row-indent`]:{height:1,float:"left"},[`${t}-row-expand-icon`]:{..._ye(e),position:"relative",float:"left",width:x,height:x,color:"inherit",lineHeight:Xe(x),background:c,border:S,borderRadius:d,transform:`scale(${b})`,"&:focus, &:hover, &:active":{borderColor:"currentcolor"},"&::before, &::after":{position:"absolute",background:"currentcolor",transition:`transform ${r} ease-out`,content:'""'},"&::before":{top:v,insetInlineEnd:C,insetInlineStart:C,height:o},"&::after":{top:C,bottom:C,insetInlineStart:v,width:o,transform:"rotate(90deg)"},"&-collapsed::before":{transform:"rotate(-180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"},"&-spaced":{"&::before, &::after":{display:"none",content:"none"},background:"transparent",border:0,visibility:"hidden"}},[`${t}-row-indent + ${t}-row-expand-icon`]:{marginTop:y,marginInlineEnd:i},[`tr${t}-expanded-row`]:{"&, &:hover":{"> th, > td":{background:m}},[`${n}-descriptions-view`]:{display:"flex",table:{flex:"auto",width:"100%"}}},[`${t}-expanded-row-fixed`]:{position:"relative",margin:`${Xe(w(p).mul(-1).equal())} ${Xe(w(h).mul(-1).equal())}`,padding:`${Xe(p)} ${Xe(h)}`}}}},NJn=e=>{const{componentCls:t,antCls:n,iconCls:r,tableFilterDropdownWidth:o,tableFilterDropdownSearchWidth:i,paddingXXS:s,paddingXS:l,colorText:c,lineWidth:u,lineType:d,tableBorderColor:p,headerIconColor:h,fontSizeSM:m,tablePaddingHorizontal:g,borderRadius:y,motionDurationSlow:x,colorIcon:v,colorPrimary:b,tableHeaderFilterActiveBg:w,colorTextDisabled:S,tableFilterDropdownBg:C,tableFilterDropdownHeight:N,controlItemBgHover:j,controlItemBgActive:I,boxShadowSecondary:_,filterDropdownMenuBg:T,calc:P}=e,E=`${n}-dropdown`,M=`${t}-filter-dropdown`,R=`${n}-tree`,$=`${Xe(u)} ${d} ${p}`;return[{[`${t}-wrapper`]:{[`${t}-filter-column`]:{display:"flex",justifyContent:"space-between"},[`${t}-filter-trigger`]:{position:"relative",display:"flex",alignItems:"center",marginBlock:P(s).mul(-1).equal(),marginInline:`${Xe(s)} ${Xe(P(g).div(2).mul(-1).equal())}`,padding:`0 ${Xe(s)}`,color:h,fontSize:m,borderRadius:y,cursor:"pointer",transition:`all ${x}`,"&:hover":{color:v,background:w},"&.active":{color:b}}}},{[`${n}-dropdown`]:{[M]:{...Ii(e),minWidth:o,backgroundColor:C,borderRadius:y,boxShadow:_,overflow:"hidden",[`${E}-menu`]:{maxHeight:N,overflowX:"hidden",border:0,boxShadow:"none",borderRadius:"unset",backgroundColor:T,"&:empty::after":{display:"block",padding:`${Xe(l)} 0`,color:S,fontSize:m,textAlign:"center",content:'"Not Found"'}},[`${M}-tree`]:{paddingBlock:`${Xe(l)} 0`,paddingInline:l,[R]:{padding:0},[`${R}-treenode ${R}-node-content-wrapper:hover`]:{backgroundColor:j},[`${R}-treenode-checkbox-checked ${R}-node-content-wrapper`]:{"&, &:hover":{backgroundColor:I}}},[`${M}-search`]:{padding:l,borderBottom:$,"&-input":{input:{minWidth:i},[r]:{color:S}}},[`${M}-checkall`]:{width:"100%",marginBottom:s,marginInlineStart:s},[`${M}-btns`]:{display:"flex",justifyContent:"space-between",padding:`${Xe(P(l).sub(u).equal())} ${Xe(l)}`,overflow:"hidden",borderTop:$}}}},{[`${n}-dropdown ${M}, ${M}-submenu`]:{[`${n}-checkbox-wrapper + span`]:{paddingInlineStart:l,color:c},"> ul":{maxHeight:"calc(100vh - 130px)",overflowX:"hidden",overflowY:"auto"}}}]};function bdt({colorSplit:e}){const t={boxShadow:`inset 10px 0 8px -8px ${e}`},n={boxShadow:`inset -10px 0 8px -8px ${e}`};return[t,n]}const jJn=e=>{const{componentCls:t,lineWidth:n,motionDurationSlow:r,zIndexTableFixed:o,tableBg:i,calc:s}=e,l=`${t}-cell`,c=`${l}-fix`,u={position:"absolute",top:0,bottom:s(n).mul(-1).equal(),width:30,transition:`box-shadow ${r}`,content:'""',pointerEvents:"none"},[d,p]=bdt(e);return{[`${t}-wrapper`]:{[`${l}${c}`]:{position:"sticky"},[c]:{zIndex:`calc(var(--z-offset-reverse) + ${o})`,background:i,"&:after":u,"&-start:after":{insetInlineStart:"100%"},"&-end:after":{insetInlineEnd:"100%"},"&-start-shadow-show:after":d,"&-end-shadow-show:after":p},[`${t}-container`]:{position:"relative","&:before, &:after":{...u,zIndex:`calc(var(--columns-count) * 2 + ${o} + 1)`},"&:before":{insetInlineStart:0},"&:after":{insetInlineEnd:0}},[`${t}-has-fix-start ${t}-container:before`]:{display:"none"},[`${t}-has-fix-end ${t}-container:after`]:{display:"none"},[`${t}-fix-start-shadow-show ${t}-container:before`]:d,[`${t}-fix-end-shadow-show ${t}-container:after`]:p}}},EJn=e=>{const{componentCls:t,antCls:n,margin:r}=e;return{[`${t}-wrapper`]:{[`${t}-pagination${n}-pagination`]:{margin:`${Xe(r)} 0`},[`${t}-pagination`]:{display:"flex",flexWrap:"wrap",rowGap:e.paddingXS,"> *":{flex:"none"},"&-start":{justifyContent:"flex-start"},"&-center":{justifyContent:"center"},"&-end":{justifyContent:"flex-end"}}}}},IJn=e=>{const{componentCls:t,tableRadius:n}=e;return{[`${t}-wrapper`]:{[t]:{[`${t}-title, ${t}-header`]:{borderRadius:`${Xe(n)} ${Xe(n)} 0 0`},[`${t}-title + ${t}-container`]:{borderStartStartRadius:0,borderStartEndRadius:0,[`${t}-header, table`]:{borderRadius:0},"table > thead > tr:first-child":{"th:first-child, th:last-child, td:first-child, td:last-child":{borderRadius:0}}},"&-container":{borderStartStartRadius:n,borderStartEndRadius:n,"&::before":{borderStartStartRadius:n},"&::after":{borderStartEndRadius:n},[`> ${t}-content`]:{borderStartStartRadius:n,borderStartEndRadius:n},"table > thead > tr:first-child":{"> *:first-child":{borderStartStartRadius:n},"> *:last-child":{borderStartEndRadius:n}}},"&-footer":{borderRadius:`0 0 ${Xe(n)} ${Xe(n)}`}}}}},_Jn=e=>{const{componentCls:t}=e,[n,r]=bdt(e);return{[`${t}-wrapper-rtl`]:{direction:"rtl",table:{direction:"rtl"},[`${t}-row-expand-icon`]:{float:"right","&::after":{transform:"rotate(-90deg)"},"&-collapsed::before":{transform:"rotate(180deg)"},"&-collapsed::after":{transform:"rotate(0deg)"}},[`${t}-cell-fix`]:{"&-start-shadow-show:after":r,"&-end-shadow-show:after":n},[`${t}-container`]:{[`${t}-row-indent`]:{float:"right"}},[`${t}-fix-start-shadow-show ${t}-container:before`]:r,[`${t}-fix-end-shadow-show ${t}-container:after`]:n}}},PJn=e=>{const{componentCls:t,antCls:n,iconCls:r,fontSizeIcon:o,padding:i,paddingXS:s,headerIconColor:l,headerIconHoverColor:c,tableSelectionColumnWidth:u,tableSelectedRowBg:d,tableSelectedRowHoverBg:p,tableRowHoverBg:h,tablePaddingHorizontal:m,calc:g}=e;return{[`${t}-wrapper`]:{[`${t}-selection-col`]:{width:u,[`&${t}-selection-col-with-dropdown`]:{width:g(u).add(o).add(g(i).div(4)).equal()}},[`${t}-bordered ${t}-selection-col`]:{width:g(u).add(g(s).mul(2)).equal(),[`&${t}-selection-col-with-dropdown`]:{width:g(u).add(o).add(g(i).div(4)).add(g(s).mul(2)).equal()}},[` table tr th${t}-selection-column, table tr td${t}-selection-column, ${t}-selection-column `]:{paddingInlineEnd:e.paddingXS,paddingInlineStart:e.paddingXS,textAlign:"center",[`${n}-radio-wrapper`]:{marginInlineEnd:0}},[`table tr th${t}-selection-column${t}-cell-fix-left`]:{zIndex:g(e.zIndexTableFixed).add(1).equal({unit:!1})},[`table tr th${t}-selection-column::after`]:{backgroundColor:"transparent !important"},[`${t}-selection`]:{position:"relative",display:"inline-flex",flexDirection:"column"},[`${t}-selection-extra`]:{position:"absolute",top:0,zIndex:1,cursor:"pointer",transition:`all ${e.motionDurationSlow}`,marginInlineStart:"100%",paddingInlineStart:Xe(g(m).div(4).equal()),[r]:{color:l,fontSize:o,verticalAlign:"baseline","&:hover":{color:c}}},[`${t}-tbody`]:{[`${t}-row`]:{[`&${t}-row-selected`]:{[`> ${t}-cell`]:{background:d,"&-row-hover":{background:p}}},[`> ${t}-cell-row-hover`]:{background:h}}}}}},AJn=e=>{const{componentCls:t,tableExpandColumnWidth:n,calc:r}=e,o=(i,s,l,c)=>({[`${t}${t}-${i}`]:{fontSize:c,[` ${t}-title, ${t}-footer, ${t}-cell, ${t}-thead > tr > th, ${t}-tbody > tr > th, ${t}-tbody > tr > td, tfoot > tr > th, tfoot > tr > td `]:{padding:`${Xe(s)} ${Xe(l)}`},[`${t}-filter-trigger`]:{marginInlineEnd:Xe(r(l).div(2).mul(-1).equal())},[`${t}-expanded-row-fixed`]:{margin:`${Xe(r(s).mul(-1).equal())} ${Xe(r(l).mul(-1).equal())}`},[`${t}-tbody`]:{[`${t}-wrapper:only-child ${t}`]:{marginBlock:Xe(r(s).mul(-1).equal()),marginInline:`${Xe(r(n).sub(l).equal())} ${Xe(r(l).mul(-1).equal())}`}},[`${t}-selection-extra`]:{paddingInlineStart:Xe(r(l).div(4).equal())}}});return{[`${t}-wrapper`]:{...o("middle",e.tablePaddingVerticalMiddle,e.tablePaddingHorizontalMiddle,e.tableFontSizeMiddle),...o("small",e.tablePaddingVerticalSmall,e.tablePaddingHorizontalSmall,e.tableFontSizeSmall)}}},TJn=e=>{const{componentCls:t,marginXXS:n,fontSizeIcon:r,headerIconColor:o,headerIconHoverColor:i}=e;return{[`${t}-wrapper`]:{[`${t}-thead th${t}-column-has-sorters`]:{outline:"none",cursor:"pointer",transition:`all ${e.motionDurationSlow}, left 0s`,"&:hover":{background:e.tableHeaderSortHoverBg,"&::before":{backgroundColor:"transparent !important"}},"&:focus-visible":{color:e.colorPrimary},[` &${t}-cell-fix-left:hover, &${t}-cell-fix-right:hover `]:{background:e.tableFixedHeaderSortActiveBg}},[`${t}-thead th${t}-column-sort`]:{background:e.tableHeaderSortBg,"&::before":{backgroundColor:"transparent !important"}},[`td${t}-column-sort`]:{background:e.tableBodySortBg},[`${t}-column-title`]:{position:"relative",zIndex:1,flex:1,minWidth:0},[`${t}-column-sorters`]:{display:"flex",flex:"auto",alignItems:"center",justifyContent:"space-between","&::after":{position:"absolute",inset:0,width:"100%",height:"100%",content:'""'}},[`${t}-column-sorters-tooltip-target-sorter`]:{"&::after":{content:"none"}},[`${t}-column-sorter`]:{marginInlineStart:n,color:o,fontSize:0,transition:`color ${e.motionDurationSlow}`,"&-inner":{display:"inline-flex",flexDirection:"column",alignItems:"center"},"&-up, &-down":{fontSize:r,"&.active":{color:e.colorPrimary}},[`${t}-column-sorter-up + ${t}-column-sorter-down`]:{marginTop:"-0.3em"}},[`${t}-column-sorters:hover ${t}-column-sorter`]:{color:i}}}},kJn=e=>{const{componentCls:t,opacityLoading:n,tableScrollThumbBg:r,tableScrollThumbBgHover:o,tableScrollThumbSize:i,tableScrollBg:s,stickyScrollBarBorderRadius:l,lineWidth:c,lineType:u,tableBorderColor:d,zIndexTableFixed:p}=e,h=`${Xe(c)} ${u} ${d}`;return{[`${t}-wrapper`]:{[`${t}-sticky`]:{"&-holder":{position:"sticky",zIndex:`calc(var(--columns-count) * 2 + ${p} + 1)`,background:e.colorBgContainer},"&-scroll":{position:"sticky",bottom:0,height:`${Xe(i)} !important`,zIndex:`calc(var(--columns-count) * 2 + ${p} + 1)`,display:"flex",alignItems:"center",background:s,borderTop:h,opacity:n,"&:hover":{transformOrigin:"center bottom"},"&-bar":{height:i,backgroundColor:r,borderRadius:l,transition:`all ${e.motionDurationSlow}, transform 0s`,position:"absolute",bottom:0,"&:hover, &-active":{backgroundColor:o}}}}}}},eLe=e=>{const{componentCls:t,lineWidth:n,tableBorderColor:r,calc:o}=e,i=`${Xe(n)} ${e.lineType} ${r}`;return{[`${t}-wrapper`]:{[`${t}-summary`]:{position:"relative",zIndex:e.zIndexTableFixed,background:e.tableBg,"> tr":{"> th, > td":{borderBottom:i}}},[`div${t}-summary`]:{boxShadow:`0 ${Xe(o(n).mul(-1).equal())} 0 ${r}`}}}},MJn=e=>{const{componentCls:t,motionDurationMid:n,lineWidth:r,lineType:o,tableBorderColor:i,calc:s}=e,l=`${Xe(r)} ${o} ${i}`,c=`${t}-expanded-row-cell`;return{[`${t}-wrapper`]:{[`${t}-tbody-virtual`]:{[`${t}-tbody-virtual-holder-inner`]:{[` & > ${t}-row, & > div:not(${t}-row) > ${t}-row `]:{display:"flex",boxSizing:"border-box",width:"100%"}},[`${t}-cell`]:{borderBottom:l,transition:`background-color ${n}`},[`${t}-expanded-row`]:{[`${c}${c}-fixed`]:{position:"sticky",insetInlineStart:0,overflow:"hidden",width:`calc(var(--virtual-width) - ${Xe(r)})`,borderInlineEnd:"none"}}},[`${t}-bordered`]:{[`${t}-tbody-virtual`]:{"&:after":{content:'""',insetInline:0,bottom:0,borderBottom:l,position:"absolute"},[`${t}-cell`]:{borderInlineEnd:l,[`&${t}-cell-fix-right-first:before`]:{content:'""',position:"absolute",insetBlock:0,insetInlineStart:s(r).mul(-1).equal(),borderInlineStart:l}}},[`&${t}-virtual`]:{[`${t}-placeholder ${t}-cell`]:{borderInlineEnd:l,borderBottom:l}}}}}},RJn=e=>{const{componentCls:t,fontWeightStrong:n,tablePaddingVertical:r,tablePaddingHorizontal:o,tableExpandColumnWidth:i,lineWidth:s,lineType:l,tableBorderColor:c,tableFontSize:u,tableBg:d,tableRadius:p,tableHeaderTextColor:h,motionDurationMid:m,tableHeaderBg:g,tableHeaderCellSplitColor:y,tableFooterTextColor:x,tableFooterBg:v,calc:b}=e,w=`${Xe(s)} ${l} ${c}`;return{[`${t}-wrapper`]:{clear:"both",maxWidth:"100%","--rc-virtual-list-scrollbar-bg":e.tableScrollBg,...kC(),[t]:{...Ii(e),fontSize:u,background:d,borderRadius:`${Xe(p)} ${Xe(p)} 0 0`,scrollbarColor:`${e.tableScrollThumbBg} ${e.tableScrollBg}`},table:{width:"100%",textAlign:"start",borderRadius:`${Xe(p)} ${Xe(p)} 0 0`,borderCollapse:"separate",borderSpacing:0},[` ${t}-cell, ${t}-thead > tr > th, ${t}-tbody > tr > th, ${t}-tbody > tr > td, tfoot > tr > th, tfoot > tr > td `]:{position:"relative",padding:`${Xe(r)} ${Xe(o)}`,overflowWrap:"break-word"},[`${t}-title`]:{padding:`${Xe(r)} ${Xe(o)}`},[`${t}-thead`]:{"\n > tr > th,\n > tr > td\n ":{position:"relative",color:h,fontWeight:n,textAlign:"start",background:g,borderBottom:w,transition:`background-color ${m} ease`,"&[colspan]:not([colspan='1'])":{textAlign:"center"},[`&:not(:last-child):not(${t}-selection-column):not(${t}-row-expand-icon-cell):not([colspan])::before`]:{position:"absolute",top:"50%",insetInlineEnd:0,width:1,height:"1.6em",backgroundColor:y,transform:"translateY(-50%)",transition:`background-color ${m}`,content:'""'}},"> tr:not(:last-child) > th[colspan]":{borderBottom:0}},[`${t}-tbody`]:{"> tr":{"> th, > td":{transition:`background-color ${m}, border-color ${m}`,borderBottom:w,[` > ${t}-wrapper:only-child, > ${t}-expanded-row-fixed > ${t}-wrapper:only-child `]:{[t]:{marginBlock:Xe(b(r).mul(-1).equal()),marginInline:`${Xe(b(i).sub(o).equal())} ${Xe(b(o).mul(-1).equal())}`,[`${t}-tbody > tr:last-child > td`]:{borderBottomWidth:0,"&:first-child, &:last-child":{borderRadius:0}}}}},"> th":{position:"relative",color:h,fontWeight:n,textAlign:"start",background:g,borderBottom:w,transition:`background-color ${m} ease`},[`& > ${t}-measure-cell`]:{paddingBlock:"0 !important",borderBlock:"0 !important",[`${t}-measure-cell-content`]:{height:0,overflow:"hidden",pointerEvents:"none"}}}},[`${t}-footer`]:{padding:`${Xe(r)} ${Xe(o)}`,color:x,background:v}}}},OJn=e=>{const{colorFillAlter:t,colorBgContainer:n,colorTextHeading:r,colorFillSecondary:o,colorFillContent:i,controlItemBgActive:s,controlItemBgActiveHover:l,padding:c,paddingSM:u,paddingXS:d,colorBorderSecondary:p,borderRadiusLG:h,controlHeight:m,colorTextPlaceholder:g,fontSize:y,fontSizeSM:x,lineHeight:v,lineWidth:b,colorIcon:w,colorIconHover:S,opacityLoading:C,controlInteractiveSize:N}=e,j=new Hi(o).onBackground(n).toHexString(),I=new Hi(i).onBackground(n).toHexString(),_=new Hi(t).onBackground(n).toHexString(),T=new Hi(w),P=new Hi(S),E=N/2-b,M=E*2+b*3;return{headerBg:_,headerColor:r,headerSortActiveBg:j,headerSortHoverBg:I,bodySortBg:_,rowHoverBg:_,rowSelectedBg:s,rowSelectedHoverBg:l,rowExpandedBg:t,cellPaddingBlock:c,cellPaddingInline:c,cellPaddingBlockMD:u,cellPaddingInlineMD:d,cellPaddingBlockSM:d,cellPaddingInlineSM:d,borderColor:p,headerBorderRadius:h,footerBg:_,footerColor:r,cellFontSize:y,cellFontSizeMD:y,cellFontSizeSM:y,headerSplitColor:p,fixedHeaderSortActiveBg:j,headerFilterHoverBg:i,filterDropdownMenuBg:n,filterDropdownBg:n,expandIconBg:n,selectionColumnWidth:m,stickyScrollBarBg:g,stickyScrollBarBorderRadius:100,expandIconMarginTop:(y*v-b*3)/2-Math.ceil((x*1.4-b*3)/2),headerIconColor:T.clone().setA(T.a*C).toRgbString(),headerIconHoverColor:P.clone().setA(P.a*C).toRgbString(),expandIconHalfInner:E,expandIconSize:M,expandIconScale:N/M}},$Jn=2,DJn=ui("Table",e=>{const{colorTextHeading:t,colorSplit:n,colorBgContainer:r,controlInteractiveSize:o,headerBg:i,headerColor:s,headerSortActiveBg:l,headerSortHoverBg:c,bodySortBg:u,rowHoverBg:d,rowSelectedBg:p,rowSelectedHoverBg:h,rowExpandedBg:m,cellPaddingBlock:g,cellPaddingInline:y,cellPaddingBlockMD:x,cellPaddingInlineMD:v,cellPaddingBlockSM:b,cellPaddingInlineSM:w,borderColor:S,footerBg:C,footerColor:N,headerBorderRadius:j,cellFontSize:I,cellFontSizeMD:_,cellFontSizeSM:T,headerSplitColor:P,fixedHeaderSortActiveBg:E,headerFilterHoverBg:M,filterDropdownBg:R,expandIconBg:$,selectionColumnWidth:D,stickyScrollBarBg:z,calc:V}=e,B=Ho(e,{tableFontSize:I,tableBg:r,tableRadius:j,tablePaddingVertical:g,tablePaddingHorizontal:y,tablePaddingVerticalMiddle:x,tablePaddingHorizontalMiddle:v,tablePaddingVerticalSmall:b,tablePaddingHorizontalSmall:w,tableBorderColor:S,tableHeaderTextColor:s,tableHeaderBg:i,tableFooterTextColor:N,tableFooterBg:C,tableHeaderCellSplitColor:P,tableHeaderSortBg:l,tableHeaderSortHoverBg:c,tableBodySortBg:u,tableFixedHeaderSortActiveBg:E,tableHeaderFilterActiveBg:M,tableFilterDropdownBg:R,tableRowHoverBg:d,tableSelectedRowBg:p,tableSelectedRowHoverBg:h,zIndexTableFixed:$Jn,tableFontSizeMiddle:_,tableFontSizeSmall:T,tableSelectionColumnWidth:D,tableExpandIconBg:$,tableExpandColumnWidth:V(o).add(V(e.padding).mul(2)).equal(),tableExpandedRowBg:m,tableFilterDropdownWidth:120,tableFilterDropdownHeight:264,tableFilterDropdownSearchWidth:140,tableScrollThumbSize:8,tableScrollThumbBg:z,tableScrollThumbBgHover:t,tableScrollBg:n});return[RJn(B),EJn(B),eLe(B),TJn(B),NJn(B),bJn(B),IJn(B),CJn(B),eLe(B),SJn(B),PJn(B),jJn(B),kJn(B),wJn(B),AJn(B),_Jn(B),MJn(B)]},OJn,{resetFont:!1,unitless:{expandIconScale:!0}}),tLe=[],LJn=(e,t)=>{var nt;const{prefixCls:n,className:r,rootClassName:o,style:i,classNames:s,styles:l,size:c,bordered:u,dropdownPrefixCls:d,dataSource:p,pagination:h,rowSelection:m,rowKey:g,rowClassName:y,columns:x,children:v,childrenColumnName:b,onChange:w,getPopupContainer:S,loading:C,expandIcon:N,expandable:j,expandedRowRender:I,expandIconColumnIndex:_,indentSize:T,scroll:P,sortDirections:E,locale:M,showSorterTooltip:R={target:"full-header"},virtual:$}=e;Qw();const D=f.useMemo(()=>x||Dve(v),[x,v]),z=f.useMemo(()=>D.some(xt=>xt.responsive),[D]),V=p5(z),B=f.useMemo(()=>{const xt=new Set(Object.keys(V).filter(Tt=>V[Tt]));return D.filter(Tt=>!Tt.responsive||Tt.responsive.some(rn=>xt.has(rn)))},[D,V]),G=za(e,["className","style","columns"]),{locale:H=xy,table:F}=f.useContext(Qr),{getPrefixCls:W,direction:U,renderEmpty:K,getPopupContainer:X,className:J,style:te,classNames:re,styles:ce}=Zo("table"),ae=ad(c),oe={...e,size:ae,bordered:u},[ue,fe]=di([re,s],[ce,l],{props:oe},{pagination:{_default:"root"},header:{_default:"wrapper"},body:{_default:"wrapper"}}),se={...H.Table,...M},[ge]=xg("global",xy.global),ye=p||tLe,de=W("table",n),Ne=W("dropdown",d),[,_e]=Xf(),xe=pl(de),[we,Te]=DJn(de,xe),Re={childrenColumnName:b,expandIconColumnIndex:_,...j,expandIcon:(j==null?void 0:j.expandIcon)??((nt=F==null?void 0:F.expandable)==null?void 0:nt.expandIcon)},{childrenColumnName:Ue="children"}=Re,He=f.useMemo(()=>ye.some(xt=>xt==null?void 0:xt[Ue])?"nest":I||j!=null&&j.expandedRowRender?"row":null,[Ue,ye]),Ye={body:f.useRef(null)},We=aQn(de),at=f.useRef(null),Oe=f.useRef(null);zRn(t,()=>({...Oe.current,nativeElement:at.current}));const Ae=g||(F==null?void 0:F.rowKey)||"key",qe=f.useMemo(()=>typeof Ae=="function"?Ae:xt=>xt==null?void 0:xt[Ae],[Ae]),[dt]=aJn(ye,Ue,qe),Ze={},Qe=(xt,Tt,rn=!1)=>{var xn,Kn,ar,tr;const un={...Ze,...xt};rn&&((xn=Ze.resetPagination)==null||xn.call(Ze),(Kn=un.pagination)!=null&&Kn.current&&(un.pagination.current=1),h&&((tr=h.onChange)==null||tr.call(h,1,(ar=un.pagination)==null?void 0:ar.pageSize))),P&&P.scrollToFirstRowOnChange!==!1&&Ye.body.current&&iOn(0,{getContainer:()=>Ye.body.current}),w==null||w(un.pagination,un.filters,un.sorter,{currentDataSource:lde(fde(ye,un.sorterStates,Ue),un.filterStates,Ue),action:Tt})},lt=(xt,Tt)=>{Qe({sorter:xt,sorterStates:Tt},"sort",!1)},[bt,Ct,Je,Pe]=gJn({prefixCls:de,mergedColumns:B,onSorterChange:lt,sortDirections:E||["ascend","descend"],tableLocale:se,showSorterTooltip:R,globalLocale:ge}),Me=f.useMemo(()=>fde(ye,Ct,Ue),[Ue,ye,Ct]);Ze.sorter=Pe(),Ze.sorterStates=Ct;const et=(xt,Tt)=>{Qe({filters:xt,filterStates:Tt},"filter",!0)},[vt,Pt,Jt]=iJn({prefixCls:de,locale:se,dropdownPrefixCls:Ne,mergedColumns:B,onFilterChange:et,getPopupContainer:S||X,rootClassName:be(o,xe)}),dn=lde(Me,Pt,Ue);Ze.filters=Jt,Ze.filterStates=Pt;const Et=f.useMemo(()=>{const xt={};return Object.keys(Jt).forEach(Tt=>{Jt[Tt]!==null&&(xt[Tt]=Jt[Tt])}),{...Je,filters:xt}},[Je,Jt]),[sn]=xJn(Et),ot=(xt,Tt)=>{Qe({pagination:{...Ze.pagination,current:xt,pageSize:Tt}},"paginate")},[mt,Ht]=lJn(dn.length,ot,h);Ze.pagination=h===!1?{}:sJn(mt,h),Ze.resetPagination=Ht;const jt=f.useMemo(()=>{if(h===!1||!mt.pageSize)return dn;const{current:xt=1,total:Tt,pageSize:rn=xdt}=mt;return dn.lengthrn?dn.slice((xt-1)*rn,xt*rn):dn:dn.slice((xt-1)*rn,xt*rn)},[!!h,dn,mt==null?void 0:mt.current,mt==null?void 0:mt.pageSize,mt==null?void 0:mt.total]),[Vt,nn]=oQn({prefixCls:de,data:dn,pageData:jt,getRowKey:qe,getRecordByKey:dt,expandType:He,childrenColumnName:Ue,locale:se,getPopupContainer:S||X},m),zt=(xt,Tt,rn)=>{const un=typeof y=="function"?y(xt,Tt,rn):y;return be({[`${de}-row-selected`]:nn.has(qe(xt,Tt))},un)};Re.__PARENT_RENDER_ICON__=Re.expandIcon,Re.expandIcon=Re.expandIcon||N||iQn(se),He==="nest"&&Re.expandIconColumnIndex===void 0?Re.expandIconColumnIndex=m?1:0:Re.expandIconColumnIndex>0&&m&&(Re.expandIconColumnIndex-=1),typeof Re.indentSize!="number"&&(Re.indentSize=typeof T=="number"?T:15);const Nn=f.useCallback(xt=>sn(Vt(vt(bt(xt)))),[bt,vt,Vt]);let xr,ur;if(h!==!1&&(mt!=null&&mt.total)){let xt;mt.size?xt=mt.size:xt=ae==="small"||ae==="middle"?"small":void 0;const Tt=(ar="end")=>f.createElement(kut,{...mt,classNames:ue.pagination,styles:fe.pagination,className:be(`${de}-pagination ${de}-pagination-${ar}`,mt.className),size:xt}),{placement:rn,position:un}=mt,xn=rn??un,Kn=ar=>{const tr=ar.toLowerCase();return tr.includes("center")?"center":tr.includes("left")||tr.includes("start")?"start":"end"};if(Array.isArray(xn)){const[ar,tr]=["top","bottom"].map(Le=>xn.find(ke=>ke.includes(Le))),jn=xn.every(Le=>`${Le}`=="none");!ar&&!tr&&!jn&&(ur=Tt()),ar&&(xr=Tt(Kn(ar))),tr&&(ur=Tt(Kn(tr)))}else ur=Tt()}const Zt=f.useMemo(()=>typeof C=="boolean"?{spinning:C}:typeof C=="object"&&C!==null?{spinning:!0,...C}:void 0,[C]),Ot=be(Te,xe,`${de}-wrapper`,J,{[`${de}-wrapper-rtl`]:U==="rtl"},r,o,ue.root,we),qt={...fe.root,...te,...i},Kt=f.useMemo(()=>Zt!=null&&Zt.spinning&&ye===tLe?null:typeof(M==null?void 0:M.emptyText)<"u"?M.emptyText:(K==null?void 0:K("Table"))||f.createElement(Zye,{componentName:"Table"}),[Zt==null?void 0:Zt.spinning,ye,M==null?void 0:M.emptyText,K]),gn=$?vJn:yJn,An={},pt=f.useMemo(()=>{const{fontSize:xt,lineHeight:Tt,lineWidth:rn,padding:un,paddingXS:xn,paddingSM:Kn}=_e,ar=Math.floor(xt*Tt);switch(ae){case"middle":return Kn*2+ar+rn;case"small":return xn*2+ar+rn;default:return un*2+ar+rn}},[_e,ae]);return $&&(An.listItemHeight=pt),f.createElement("div",{ref:at,className:Ot,style:qt},f.createElement(rY,{spinning:!1,...Zt},xr,f.createElement(gn,{...An,...G,classNames:ue,styles:fe,ref:Oe,columns:B,direction:U,expandable:Re,prefixCls:de,className:be({[`${de}-middle`]:ae==="middle",[`${de}-small`]:ae==="small",[`${de}-bordered`]:u,[`${de}-empty`]:ye.length===0},Te,xe,we),data:jt,rowKey:qe,rowClassName:zt,emptyText:Kt,internalHooks:x6,internalRefs:Ye,transformColumns:Nn,getContainerWidth:We,measureRowRender:xt=>f.createElement(fdt.Provider,{value:!0},f.createElement(Py,{getPopupContainer:Tt=>Tt},xt))}),ur))},FJn=f.forwardRef(LJn),zJn=(e,t)=>{const n=f.useRef(0);return n.current+=1,f.createElement(FJn,{...e,ref:t,_renderTimes:n.current})},Ty=f.forwardRef(zJn);Ty.SELECTION_COLUMN=KS;Ty.EXPAND_COLUMN=a2;Ty.SELECTION_ALL=Kue;Ty.SELECTION_INVERT=Yue;Ty.SELECTION_NONE=Xue;Ty.Column=YXn;Ty.ColumnGroup=XXn;Ty.Summary=Kut;const BJn=e=>{const{paddingXXS:t,lineWidth:n,tagPaddingHorizontal:r,componentCls:o,calc:i}=e,s=i(r).sub(n).equal(),l=i(t).sub(n).equal();return{[o]:{...Ii(e),display:"inline-block",height:"auto",paddingInline:s,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",backgroundColor:e.defaultBg,border:`${Xe(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${o}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${o}-close-icon`]:{marginInlineStart:l,fontSize:e.tagIconSize,color:e.colorIcon,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},"&-checkable":{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${o}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive},"&-disabled":{cursor:"not-allowed",[`&:not(${o}-checkable-checked)`]:{color:e.colorTextDisabled,"&:hover":{backgroundColor:"transparent"}},[`&${o}-checkable-checked`]:{color:e.colorTextDisabled,backgroundColor:e.colorBgContainerDisabled},"&:hover, &:active":{backgroundColor:e.colorBgContainerDisabled,color:e.colorTextDisabled},[`&:not(${o}-checkable-checked):hover`]:{color:e.colorTextDisabled}},"&-group":{display:"flex",flexWrap:"wrap",gap:e.paddingXS}},"&-hidden":{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:s}},[`&${e.componentCls}-solid`]:{borderColor:"transparent",color:e.colorTextLightSolid,backgroundColor:e.colorBgSolid,[`&${o}-default`]:{color:e.solidTextColor}},[`${o}-filled`]:{borderColor:"transparent",backgroundColor:e.tagBorderlessBg},[`&${o}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",backgroundColor:e.colorBgContainerDisabled,a:{cursor:"not-allowed",pointerEvents:"none",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}},"a&":{"&:hover, &:active":{color:e.colorTextDisabled}},[`&${o}-outlined`]:{borderColor:e.colorBorderDisabled},[`&${o}-solid, &${o}-filled`]:{color:e.colorTextDisabled,[`${o}-close-icon`]:{color:e.colorTextDisabled}},[`${o}-close-icon`]:{cursor:"not-allowed",color:e.colorTextDisabled,"&:hover":{color:e.colorTextDisabled}}}}},Vve=e=>{const{lineWidth:t,fontSizeIcon:n,calc:r}=e,o=e.fontSizeSM;return Ho(e,{tagFontSize:o,tagLineHeight:Xe(r(e.lineHeightSM).mul(o).equal()),tagIconSize:r(n).sub(r(t).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},Uve=e=>{const t=est(new TU(e.colorBgSolid),"#fff")?"#000":"#fff";return{defaultBg:new Hi(e.colorFillTertiary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText,solidTextColor:t}},Wve=ui("Tag",e=>{const t=Vve(e);return BJn(t)},Uve),wdt=f.forwardRef((e,t)=>{const{prefixCls:n,style:r,className:o,checked:i,children:s,icon:l,onChange:c,onClick:u,disabled:d,...p}=e,{getPrefixCls:h,tag:m}=f.useContext(Qr),g=f.useContext(Mp),y=d??g,x=C=>{y||(c==null||c(!i),u==null||u(C))},v=h("tag",n),[b,w]=Wve(v),S=be(v,`${v}-checkable`,{[`${v}-checkable-checked`]:i,[`${v}-checkable-disabled`]:y},m==null?void 0:m.className,o,b,w);return f.createElement("span",{...p,ref:t,style:{...r,...m==null?void 0:m.style},className:S,onClick:x},l,f.createElement("span",null,s))});function HJn(e,t){const{id:n,prefixCls:r,rootClassName:o,className:i,style:s,classNames:l,styles:c,disabled:u,options:d,value:p,defaultValue:h,onChange:m,multiple:g,...y}=e,{getPrefixCls:x,direction:v,className:b,style:w,classNames:S,styles:C}=Zo("tag"),N=x("tag",r),j=`${N}-checkable-group`,I=pl(N),[_,T]=Wve(N,I),[P,E]=di([S,l],[C,c],{props:e}),M=f.useMemo(()=>(d||[]).map(B=>B&&typeof B=="object"?B:{value:B,label:B}),[d]),[R,$]=Fa(h,p),D=(B,G)=>{let H=null;if(g){const F=R||[];H=B?[].concat(go(F),[G.value]):F.filter(W=>W!==G.value)}else H=B?G.value:null;$(H),m==null||m(H)},z=Ie.useRef(null);f.useImperativeHandle(t,()=>({nativeElement:z.current}));const V=fl(y,{aria:!0,data:!0});return Ie.createElement("div",{...V,className:be(j,b,o,{[`${j}-disabled`]:u,[`${j}-rtl`]:v==="rtl"},_,T,i,P.root),style:{...w,...E.root,...s},id:n,ref:z},M.map(B=>Ie.createElement(wdt,{key:B.value,className:be(`${j}-item`,P.item),style:E.item,checked:g?(R||[]).includes(B.value):R===B.value,onChange:G=>D(G,B),disabled:u},B.label)))}const VJn=Ie.forwardRef(HJn);function UJn(e,t){const{color:n,variant:r,bordered:o}=e;return f.useMemo(()=>{const i=n==null?void 0:n.endsWith("-inverse");let s;r?s=r:i?s="solid":o===!1?s="filled":s=t||"filled";const l=i?n==null?void 0:n.replace("-inverse",""):n,c=qK(n),u=m8n(n),d={};if(!c&&!u&&l)if(s==="solid")d.backgroundColor=n;else{const p=new Hi(l).toHsl();p.l=.95,d.backgroundColor=new Hi(p).toHexString(),d.color=n,s==="outlined"&&(d.borderColor=n)}return[s,l,c,u,d]},[n,r,o,t])}const WJn=e=>PK(e,(t,{textColor:n,lightBorderColor:r,lightColor:o,darkColor:i})=>({[`${e.componentCls}${e.componentCls}-${t}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:o,borderColor:r,color:n},[`&${e.componentCls}-solid`]:{backgroundColor:i,borderColor:i,color:e.colorTextLightSolid},[`&${e.componentCls}-filled`]:{backgroundColor:o,color:n}}})),GJn=d5(["Tag","preset"],e=>{const t=Vve(e);return WJn(t)},Uve);function qJn(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const T7=(e,t,n)=>{const r=qJn(n);return{[`${e.componentCls}${e.componentCls}-${t}:not(${e.componentCls}-disabled)`]:{[`&${e.componentCls}-outlined`]:{backgroundColor:e[`color${r}Bg`],borderColor:e[`color${r}Border`],color:e[`color${n}`]},[`&${e.componentCls}-solid`]:{backgroundColor:e[`color${n}`],borderColor:e[`color${n}`]},[`&${e.componentCls}-filled`]:{backgroundColor:e[`color${r}Bg`],color:e[`color${n}`]}}}},KJn=d5(["Tag","status"],e=>{const t=Vve(e);return[T7(t,"success","Success"),T7(t,"processing","Info"),T7(t,"error","Error"),T7(t,"warning","Warning")]},Uve),YJn=f.forwardRef((e,t)=>{var ge;const{prefixCls:n,className:r,rootClassName:o,style:i,children:s,icon:l,color:c,variant:u,onClose:d,bordered:p,disabled:h,href:m,target:g,styles:y,classNames:x,...v}=e,{getPrefixCls:b,direction:w,className:S,variant:C,style:N,classNames:j,styles:I}=Zo("tag"),[_,T,P,E,M]=UJn(e,C),R=P||E,$=f.useContext(Mp),D=h??$,{tag:z}=f.useContext(Qr),[V,B]=f.useState(!0),G=za(v,["closeIcon","closable"]),H={...e,color:T,variant:_,disabled:D,href:m,target:g,icon:l},[F,W]=di([j,x],[I,y],{props:H}),U=f.useMemo(()=>{let ye={...W.root,...N,...i};return D||(ye={...M,...ye}),ye},[W.root,N,i,M,D]),K=b("tag",n),[X,J]=Wve(K),te=be(K,S,F.root,`${K}-${_}`,{[`${K}-${T}`]:R,[`${K}-hidden`]:!V,[`${K}-rtl`]:w==="rtl",[`${K}-disabled`]:D},r,o,X,J),re=ye=>{D||(ye.stopPropagation(),d==null||d(ye),!ye.defaultPrevented&&B(!1))},[,ce]=TK(mb(e),mb(z),{closable:!1,closeIconRender:ye=>{const de=f.createElement("span",{className:`${K}-close-icon`,onClick:re},ye);return Dat(ye,de,Ne=>({onClick:_e=>{var xe;(xe=Ne==null?void 0:Ne.onClick)==null||xe.call(Ne,_e),re(_e)},className:be(Ne==null?void 0:Ne.className,`${K}-close-icon`)}))}}),ae=typeof v.onClick=="function"||s&&s.type==="a",oe=Fc(l,{className:be(f.isValidElement(l)?(ge=l.props)==null?void 0:ge.className:"",F.icon),style:W.icon}),ue=oe?f.createElement(f.Fragment,null,oe,s&&f.createElement("span",{className:F.content,style:W.content},s)):s,fe=m?"a":"span",se=f.createElement(fe,{...G,ref:t,className:te,style:U,href:D?void 0:m,target:g,onClick:D?void 0:G.onClick,...m&&D?{"aria-disabled":!0}:{}},ue,ce,P&&f.createElement(GJn,{key:"preset",prefixCls:K}),E&&f.createElement(KJn,{key:"status",prefixCls:K}));return ae?f.createElement(o6,{component:"Tag"},se):se}),uh=YJn;uh.CheckableTag=wdt;uh.CheckableTagGroup=VJn;const XJn=e=>{const{componentCls:t,fontHeight:n,antCls:r,paddingXS:o}=e,[i,s]=bi(r,"cmp-steps"),[l,c]=bi(r,"timeline"),u=`${t}-item`;return{[`${t}-horizontal`]:{[i("title-vertical-row-gap")]:o,[l("content-height")]:Xe(n),alignItems:"stretch",[`&${t}-layout-alternate`]:{[u]:{[`${u}-wrapper`]:{[l("alternate-content-offset")]:`calc(${c("content-height")} + ${s("title-vertical-row-gap")} * 2 + ${s("icon-size-max")})`,height:`calc(${c("content-height")} * 2 + ${s("title-vertical-row-gap")} * 2 + ${s("icon-size-max")})`},[`${u}-icon`]:{position:"absolute"},[`${u}-icon, ${u}-rail`]:{position:"absolute",top:"50%",transform:"translateY(-50%)",margin:0},[`${u}-title, ${u}-subtitle, ${u}-content`]:{whiteSpace:"nowrap",maxWidth:"unset"},[`${u}-title`]:{position:"absolute",left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%)"},[`${u}-content`]:{position:"absolute",left:{_skip_check_:!0,value:"50%"},transform:"translateX(-50%)"},"&-placement-start":{[`${u}-title`]:{bottom:c("alternate-content-offset")},[`${u}-content`]:{top:c("alternate-content-offset")}},"&-placement-end":{[`${u}-title`]:{top:c("alternate-content-offset")},[`${u}-content`]:{bottom:c("alternate-content-offset")}}}},[`&:not(${t}-layout-alternate)`]:{[`${u}-placement-end`]:{display:"flex",alignItems:"flex-end",[`${u}-wrapper`]:{flex:"auto",flexDirection:"column-reverse"},[`${u}-rail`]:{top:"auto",bottom:s("horizontal-rail-margin"),transform:"translateY(50%)"}}}}}},QJn=e=>{const{componentCls:t,tailColor:n,fontHeight:r,dotSize:o,dotBg:i,dotBorderWidth:s,fontSize:l,lineHeight:c,colorText:u,tailWidth:d,colorPrimary:p,colorError:h,colorSuccess:m,colorTextDisabled:g,antCls:y}=e,x=`${t}-item`,[v,b]=bi(y,"cmp-steps");return{[t]:[{...Ii(e),[x]:{[v("title-horizontal-title-height")]:r,[v("vertical-rail-margin")]:"0px",[v("title-horizontal-rail-gap")]:"0px",[v("icon-dot-size-origin")]:b("icon-size-active"),[v("icon-dot-size-custom")]:o,[v("item-icon-dot-bg-color-origin")]:b("item-icon-dot-bg-color"),[v("item-icon-dot-bg-color-custom")]:i,[v("icon-size")]:b("icon-dot-size-custom",b("icon-dot-size-origin")),[`${x}-icon`]:{[v("dot-icon-border-width")]:s,[v("dot-icon-size")]:b("icon-size"),[v("item-icon-dot-bg-color")]:b("item-icon-dot-bg-color-custom",b("item-icon-dot-bg-color-origin"))},[`${x}-title`]:{fontSize:l,lineHeight:c},[`${x}-content`]:{color:u},[`${x}-rail`]:{[v("item-solid-line-color")]:n,[v("rail-size")]:d}}},{[x]:{[v("item-process-rail-line-style")]:"dotted"},[`${x}${x}${x}-color`]:{"&-blue":{[v("item-icon-dot-color")]:p},"&-red":{[v("item-icon-dot-color")]:h},"&-green":{[v("item-icon-dot-color")]:m},"&-gray":{[v("item-icon-dot-color")]:g}}}]}},JJn=e=>{const{calc:t,componentCls:n,itemPaddingBottom:r,margin:o,antCls:i}=e,s=`${n}-item`,[,l]=bi(i,"cmp-steps"),[c,u]=bi(i,"timeline");return{[`${n}:not(${n}-horizontal)`]:{[c("head-span")]:"12",[c("head-span-ptg")]:`calc(${u("head-span")} / 24 * 100%)`,[`&${n}-layout-alternate`]:{[s]:{[c("alternate-gap")]:t(o).mul(2).add(l("dot-icon-size")).equal(),minHeight:"auto",paddingBottom:r,[`${s}-icon, ${s}-rail`]:{position:"absolute",insetInlineStart:u("head-span-ptg")},[`${s}-icon`]:{marginInlineStart:`calc(${l("icon-size")} / -2)`},[`${s}-section`]:{display:"flex",flexWrap:"nowrap",gap:u("alternate-gap")},[`${s}-header`]:{textAlign:"end",flexDirection:"column",alignItems:"stretch",flex:`1 1 calc(${u("head-span-ptg")} - ${u("alternate-gap")} / 2)`},[`${s}-content`]:{textAlign:"start",flex:`1 1 calc(100% - ${u("head-span-ptg")} - ${u("alternate-gap")} / 2)`},"&-placement-end":{[`${s}-header`]:{textAlign:"start",order:1},[`${s}-content`]:{textAlign:"end"},[`${s}-icon, ${s}-rail`]:{insetInlineStart:`calc(100% - ${u("head-span-ptg")})`}}}},[`&:not(${n}-layout-alternate)`]:{[`${s}-placement-end`]:{textAlign:"end",[`${s}-icon`]:{order:1},[`${s}-rail`]:{insetInlineStart:"auto",insetInlineEnd:`calc(${l("icon-size")} / 2)`,marginInlineEnd:`calc(${l("rail-size")} / -2)`}}}}}},ZJn=e=>({tailColor:e.colorSplit,tailWidth:e.lineWidthBold,dotBorderWidth:e.lineWidthBold,dotBg:void 0,dotSize:void 0,itemPaddingBottom:e.padding*1.25}),eZn=ui("Timeline",e=>{const t=Ho(e,{itemHeadSize:10,customHeadPaddingVertical:e.paddingXXS,paddingInlineEnd:2});return[QJn(t),JJn(t),XJn(t)]},ZJn),tZn=(e,t,n,r,o,i,s)=>{const l=`${t}-item`,[c]=bi(e,"cmp-steps"),u=f.useMemo(()=>Array.isArray(r)?r:Bu(o).map(d=>({...d.props})),[r,o]);return f.useMemo(()=>{const d=u.map((p,h)=>{const{label:m,children:g,title:y,content:x,color:v,className:b,style:w,icon:S,dot:C,placement:N,position:j,loading:I,..._}=p;let T=w,P=b;v&&(["blue","red","green","gray"].includes(v)?P=be(b,`${l}-color-${v}`):T={[c("item-icon-dot-color")]:v,...w});const E=N??j??(n==="alternate"?h%2===0?"start":"end":n);P=be(P,`${l}-placement-${E}`);let M=S??C;return!M&&I&&(M=f.createElement(MC,null)),{..._,title:y??m,content:x??g,style:T,className:P,icon:M,status:I?"process":"finish"}});return i&&d.push({icon:s??f.createElement(MC,null),content:i,status:"process"}),d},[u,i,n,l,c,s])},nZn={rootComponent:"ol",itemComponent:"li"},G$=e=>{const{getPrefixCls:t,direction:n,className:r,style:o,classNames:i,styles:s}=Zo("timeline"),{prefixCls:l,className:c,style:u,classNames:d,styles:p,variant:h="outlined",mode:m,orientation:g="vertical",titleSpan:y,items:x,children:v,reverse:b,pending:w,pendingDot:S,...C}=e,N=t(),j=t("timeline",l),[I,_]=eZn(j),[T]=bi(N,"timeline"),P=f.useMemo(()=>({item:`${j}-item`,itemTitle:`${j}-item-title`,itemIcon:`${j}-item-icon`,itemContent:`${j}-item-content`,itemRail:`${j}-item-rail`,itemWrapper:`${j}-item-wrapper`,itemSection:`${j}-item-section`,itemHeader:`${j}-item-header`}),[j]),E=f.useMemo(()=>m==="left"?"start":m==="right"?"end":["alternate","start","end"].includes(m)?m:"start",[m]),M=tZn(N,j,E,x,v,w,S),R=f.useMemo(()=>b?go(M).reverse():M,[b,M]),$={...e,variant:h,mode:E,orientation:g,items:R},[D,z]=di([P,i,d],[s,p],{props:$}),V=f.useMemo(()=>({railFollowPrevStatus:b}),[b]),B=f.useMemo(()=>E==="alternate"||g==="vertical"&&R.some(H=>H.title),[R,E,g]),G={...o,...u};return ll(y)&&E!=="alternate"&&(typeof y=="number"&&!Number.isNaN(y)?G[T("head-span")]=y:G[T("head-span-ptg")]=y),f.createElement(Vut.Provider,{value:nZn},f.createElement(But.Provider,{value:V},f.createElement(Uut,{...C,className:be(j,r,c,I,_,{[`${j}-${g}`]:g==="horizontal",[`${j}-layout-alternate`]:B,[`${j}-rtl`]:n==="rtl"}),style:G,classNames:D,styles:z,variant:h,orientation:g,type:"dot",items:R,current:R.length-1})))};G$.Item=()=>{};var rZn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z"}}]},name:"edit",theme:"outlined"};function pde(){return pde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,pde({},e,{ref:t,icon:rZn})),iZn=f.forwardRef(oZn);var aZn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"};function hde(){return hde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,hde({},e,{ref:t,icon:aZn})),lZn=f.forwardRef(sZn),cZn=(e,t,n,r)=>{const{titleMarginBottom:o,fontWeightStrong:i}=r;return{marginBottom:o,color:n,fontWeight:i,fontSize:e,lineHeight:t}},uZn=e=>{const t=[1,2,3,4,5],n={};return t.forEach(r=>{n[` h${r}&, div&-h${r}, div&-h${r} > textarea, h${r} `]=cZn(e[`fontSizeHeading${r}`],e[`lineHeightHeading${r}`],e.colorTextHeading,e)}),n},dZn=e=>{const{componentCls:t}=e;return{"a&, a":{..._ye(e),userSelect:"text",[`&[disabled], &${t}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed","&:active, &:hover":{color:e.colorTextDisabled},"&:active":{pointerEvents:"none"}}}}},fZn=e=>({code:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.2em 0.1em",fontSize:"85%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3},kbd:{margin:"0 0.2em",paddingInline:"0.4em",paddingBlock:"0.15em 0.1em",fontSize:"90%",fontFamily:e.fontFamilyCode,background:"rgba(150, 150, 150, 0.06)",border:"1px solid rgba(100, 100, 100, 0.2)",borderBottomWidth:2,borderRadius:3},mark:{padding:0,backgroundColor:wU[2]},"u, ins":{textDecoration:"underline",textDecorationSkipInk:"auto"},"s, del":{textDecoration:"line-through"},strong:{fontWeight:e.fontWeightStrong},"ul, ol":{marginInline:0,marginBlock:"0 1em",padding:0,li:{marginInline:"20px 0",marginBlock:0,paddingInline:"4px 0",paddingBlock:0}},ul:{listStyleType:"circle",ul:{listStyleType:"disc"}},ol:{listStyleType:"decimal"},"pre, blockquote":{margin:"1em 0"},pre:{padding:"0.4em 0.6em",whiteSpace:"pre-wrap",wordWrap:"break-word",background:"rgba(150, 150, 150, 0.1)",border:"1px solid rgba(100, 100, 100, 0.2)",borderRadius:3,fontFamily:e.fontFamilyCode,code:{display:"inline",margin:0,padding:0,fontSize:"inherit",fontFamily:"inherit",background:"transparent",border:0}},blockquote:{paddingInline:"0.6em 0",paddingBlock:0,borderInlineStart:"4px solid rgba(100, 100, 100, 0.2)",opacity:.85}}),pZn=e=>{const{componentCls:t,paddingSM:n}=e,r=n;return{"&-edit-content":{position:"relative","div&":{insetInlineStart:e.calc(e.paddingSM).mul(-1).equal(),insetBlockStart:e.calc(r).div(-2).add(1).equal(),marginBottom:e.calc(r).div(2).sub(2).equal()},[`${t}-edit-content-confirm`]:{position:"absolute",insetInlineEnd:e.calc(e.marginXS).add(2).equal(),insetBlockEnd:e.marginXS,color:e.colorIcon,fontWeight:"normal",fontSize:e.fontSize,fontStyle:"normal",pointerEvents:"none"},textarea:{margin:"0!important",MozTransition:"none",height:"1em"}}}},hZn=e=>({[`${e.componentCls}-copy-success`]:{"\n &,\n &:hover,\n &:focus":{color:e.colorSuccess}},[`${e.componentCls}-copy-icon-only`]:{marginInlineStart:0}}),mZn=()=>({"\n a&-ellipsis,\n span&-ellipsis\n ":{display:"inline-block",maxWidth:"100%"},"&-ellipsis-single-line":{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis","a&, span&":{verticalAlign:"bottom"},"> code":{paddingBlock:0,maxWidth:"calc(100% - 1.2em)",display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",verticalAlign:"bottom",boxSizing:"content-box"}},"&-ellipsis-multiple-line":{display:"-webkit-box",overflow:"hidden",WebkitLineClamp:3,WebkitBoxOrient:"vertical"}}),gZn=e=>{const{componentCls:t,titleMarginTop:n}=e;return{[t]:{color:e.colorText,wordBreak:"break-word",lineHeight:e.lineHeight,[`&${t}-secondary`]:{color:e.colorTextDescription},[`&${t}-success`]:{color:e.colorSuccessText},[`&${t}-warning`]:{color:e.colorWarningText},[`&${t}-danger`]:{color:e.colorErrorText,"a&:active, a&:focus":{color:e.colorErrorTextActive},"a&:hover":{color:e.colorErrorTextHover}},[`&${t}-disabled`]:{color:e.colorTextDisabled,cursor:"not-allowed",userSelect:"none"},"\n div&,\n p\n ":{marginBottom:"1em"},...uZn(e),[` & + h1${t}, & + h2${t}, & + h3${t}, & + h4${t}, & + h5${t} `]:{marginTop:n},"\n div,\n ul,\n li,\n p,\n h1,\n h2,\n h3,\n h4,\n h5":{"\n + h1,\n + h2,\n + h3,\n + h4,\n + h5\n ":{marginTop:n}},...fZn(e),...dZn(e),[` ${t}-expand, ${t}-collapse, ${t}-edit, ${t}-copy `]:{..._ye(e),marginInlineStart:e.marginXXS},...pZn(e),...hZn(e),...mZn(),"&-rtl":{direction:"rtl"}}}},xZn=()=>({titleMarginTop:"1.2em",titleMarginBottom:"0.5em"}),Sdt=ui("Typography",gZn,xZn),yZn=e=>{const{prefixCls:t,"aria-label":n,className:r,style:o,direction:i,maxLength:s,autoSize:l=!0,value:c,onSave:u,onCancel:d,onEnd:p,component:h,enterIcon:m=f.createElement(lZn,null)}=e,g=f.useRef(null),y=f.useRef(!1),x=f.useRef(null),[v,b]=f.useState(c);f.useEffect(()=>{b(c)},[c]),f.useEffect(()=>{var M;if((M=g.current)!=null&&M.resizableTextArea){const{textArea:R}=g.current.resizableTextArea;R.focus();const{length:$}=R.value;R.setSelectionRange($,$)}},[]);const w=({target:M})=>{b(M.value.replace(/[\n\r]/g,""))},S=()=>{y.current=!0},C=()=>{y.current=!1},N=({keyCode:M})=>{y.current||(x.current=M)},j=()=>{u(v.trim())},I=({keyCode:M,ctrlKey:R,altKey:$,metaKey:D,shiftKey:z})=>{x.current!==M||y.current||R||$||D||z||(M===Ir.ENTER?(j(),p==null||p()):M===Ir.ESC&&d())},_=()=>{j()},[T,P]=Sdt(t),E=be(t,`${t}-edit-content`,{[`${t}-rtl`]:i==="rtl",[`${t}-${h}`]:!!h},r,T,P);return f.createElement("div",{className:E,style:o},f.createElement(Put,{ref:g,maxLength:s,value:v,onChange:w,onKeyDown:N,onKeyUp:I,onCompositionStart:S,onCompositionEnd:C,onBlur:_,"aria-label":n,rows:1,autoSize:l}),m!==null?Fc(m,{className:`${t}-edit-content-confirm`}):null)},vZn=(e,t)=>{let n=!1;const r=o=>{var i,s,l;o.stopPropagation(),o.preventDefault(),(i=o.clipboardData)==null||i.clearData(),(s=o.clipboardData)==null||s.setData("text/plain",e),t&&((l=o.clipboardData)==null||l.setData("text/html",e)),n=!0};try{return document.addEventListener("copy",r,{capture:!0}),document.execCommand("copy"),n}catch{return!1}finally{document.removeEventListener("copy",r,{capture:!0})}},bZn=async(e,t)=>{try{return t?await navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([e],{type:"text/plain"})})]):await navigator.clipboard.writeText(e),!0}catch{return!1}};async function wZn(e,t){if(typeof e!="string")return!1;const n=(t==null?void 0:t.format)==="text/html";return!!(await bZn(e,n)||vZn(e,n))}const SZn=({copyConfig:e,children:t})=>{const[n,r]=f.useState(!1),[o,i]=f.useState(!1),s=f.useRef(null),l=()=>{s.current&&clearTimeout(s.current)},c={};e.format&&(c.format=e.format),f.useEffect(()=>l,[]);const u=Vr(async d=>{var p;d==null||d.preventDefault(),d==null||d.stopPropagation(),i(!0);try{const h=typeof e.text=="function"?await e.text():e.text;await wZn(h||IKn(t,!0).join("")||"",c),i(!1),r(!0),l(),s.current=setTimeout(()=>{r(!1)},3e3),(p=e.onCopy)==null||p.call(e,d)}catch(h){throw i(!1),h}});return{copied:n,copyLoading:o,onClick:u}};function Fte(e,t){return f.useMemo(()=>{const n=!!e;return[n,{...t,...n&&typeof e=="object"?e:null}]},[e])}const CZn=e=>{const t=f.useRef(void 0);return f.useEffect(()=>{t.current=e}),t.current},NZn=(e,t,n)=>f.useMemo(()=>e===!0?{title:t??n}:f.isValidElement(e)?{title:e}:typeof e=="object"?{title:t??n,...e}:{title:e},[e,t,n]),Cdt=f.forwardRef((e,t)=>{const{prefixCls:n,component:r="article",className:o,rootClassName:i,children:s,direction:l,style:c,...u}=e,{getPrefixCls:d,direction:p,className:h,style:m}=Zo("typography"),g=l??p,y=d("typography",n),[x,v]=Sdt(y),b=be(y,h,{[`${y}-rtl`]:g==="rtl"},o,i,x,v),w={...m,...c};return f.createElement(r,{className:b,style:w,ref:t,...u},s)});var jZn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"};function mde(){return mde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,mde({},e,{ref:t,icon:jZn})),IZn=f.forwardRef(EZn);function nLe(e){return e===!1?[!1,!1]:Array.isArray(e)?e:[e]}function zte(e,t,n){return e===!0||e===void 0?t:e||n&&t}function _Zn(e){const t=document.createElement("em");e.appendChild(t);const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return e.removeChild(t),n.left>r.left||r.right>n.right||n.top>r.top||r.bottom>n.bottom}const Gve=e=>["string","number"].includes(typeof e),PZn=({prefixCls:e,copied:t,locale:n,iconOnly:r,tooltips:o,icon:i,tabIndex:s,onCopy:l,loading:c})=>{const u=nLe(o),d=nLe(i),{copied:p,copy:h}=n??{},m=t?p:h,g=zte(u[t?1:0],m),y=typeof g=="string"?g:m;return f.createElement(pf,{title:g},f.createElement("button",{type:"button",className:be(`${e}-copy`,{[`${e}-copy-success`]:t,[`${e}-copy-icon-only`]:r}),onClick:l,"aria-label":y,tabIndex:s},t?zte(d[1],f.createElement(UK,null),!0):zte(d[0],c?f.createElement(MC,null):f.createElement(IZn,null),!0)))},k7=f.forwardRef(({style:e,children:t},n)=>{const r=f.useRef(null);return f.useImperativeHandle(n,()=>({isExceed:()=>{const o=r.current;return o.scrollHeight>o.clientHeight},getHeight:()=>r.current.clientHeight})),f.createElement("span",{"aria-hidden":!0,ref:r,style:{position:"fixed",display:"block",left:0,top:0,pointerEvents:"none",backgroundColor:"rgba(255, 0, 0, 0.65)",...e}},t)}),AZn=e=>e.reduce((t,n)=>t+(Gve(n)?String(n).length:1),0);function rLe(e,t){let n=0;const r=[];for(let o=0;ot){const u=t-n;return r.push(String(i).slice(0,u)),r}r.push(i),n=c}return e}const Bte=0,Hte=1,Vte=2,Ute=3,oLe=4,M7={display:"-webkit-box",overflow:"hidden",WebkitBoxOrient:"vertical"};function TZn(e){const{enableMeasure:t,width:n,text:r,children:o,rows:i,expanded:s,miscDeps:l,onEllipsis:c}=e,u=f.useMemo(()=>Bu(r),[r]),d=f.useMemo(()=>AZn(u),[r]),p=f.useMemo(()=>o(u,!1),[r]),[h,m]=f.useState(null),g=f.useRef(null),y=f.useRef(null),x=f.useRef(null),v=f.useRef(null),b=f.useRef(null),[w,S]=f.useState(!1),[C,N]=f.useState(Bte),[j,I]=f.useState(0),[_,T]=f.useState(null);Po(()=>{N(t&&n&&d?Hte:Bte)},[n,r,i,t,u]),Po(()=>{var R,$,D,z;if(C===Hte){N(Vte);const V=y.current&&getComputedStyle(y.current).whiteSpace;T(V)}else if(C===Vte){const V=!!((R=x.current)!=null&&R.isExceed());N(V?Ute:oLe),m(V?[0,d]:null),S(V);const B=(($=x.current)==null?void 0:$.getHeight())||0,G=i===1?0:((D=v.current)==null?void 0:D.getHeight())||0,H=((z=b.current)==null?void 0:z.getHeight())||0,F=Math.max(B,G+H);I(F+1),c(V)}},[C]);const P=h?Math.ceil((h[0]+h[1])/2):0;Po(()=>{var D;const[R,$]=h||[0,0];if(R!==$){const V=(((D=g.current)==null?void 0:D.getHeight())||0)>j;let B=P;$-R===1&&(B=V?R:$),m(V?[R,B]:[B,$])}},[h,P]);const E=f.useMemo(()=>{if(!t)return o(u,!1);if(C!==Ute||!h||h[0]!==h[1]){const R=o(u,!1);return[oLe,Bte].includes(C)?R:f.createElement("span",{style:{...M7,WebkitLineClamp:i}},R)}return o(s?u:rLe(u,h[0]),w)},[s,C,h,u].concat(go(l))),M={width:n,margin:0,padding:0,whiteSpace:_==="nowrap"?"normal":"inherit"};return f.createElement(f.Fragment,null,E,C===Vte&&f.createElement(f.Fragment,null,f.createElement(k7,{style:{...M,...M7,WebkitLineClamp:i},ref:x},p),f.createElement(k7,{style:{...M,...M7,WebkitLineClamp:i-1},ref:v},p),f.createElement(k7,{style:{...M,...M7,WebkitLineClamp:1},ref:b},o([],!0))),C===Ute&&h&&h[0]!==h[1]&&f.createElement(k7,{style:{...M,top:400},ref:g},o(rLe(u,P),!0)),C===Hte&&f.createElement("span",{style:{whiteSpace:"inherit"},ref:y}))}const kZn=({enableEllipsis:e,isEllipsis:t,children:n,tooltipProps:r})=>!(r!=null&&r.title)||!e?n:f.createElement(pf,{open:t?void 0:!1,...r},n);function MZn({mark:e,code:t,underline:n,delete:r,strong:o,keyboard:i,italic:s},l){let c=l;function u(d,p){p&&(c=f.createElement(d,{},c))}return u("strong",o),u("u",n),u("del",r),u("code",t),u("mark",e),u("kbd",i),u("i",s),c}const RZn="...",iLe=["delete","mark","code","underline","strong","keyboard","italic"],cY=f.forwardRef((e,t)=>{const{prefixCls:n,className:r,style:o,type:i,disabled:s,children:l,ellipsis:c,editable:u,copyable:d,component:p,title:h,...m}=e,{getPrefixCls:g,direction:y}=f.useContext(Qr),[x]=xg("Text"),v=f.useRef(null),b=f.useRef(null),w=g("typography",n),S=za(m,iLe),[C,N]=Fte(u),[j,I]=Fa(!1,N.editing),{triggerType:_=["icon"]}=N,T=Qe=>{var lt;Qe&&((lt=N.onStart)==null||lt.call(N)),I(Qe)},P=CZn(j);Po(()=>{var Qe;!j&&P&&((Qe=b.current)==null||Qe.focus())},[j]);const E=Qe=>{Qe==null||Qe.preventDefault(),T(!0)},M=Qe=>{var lt;(lt=N.onChange)==null||lt.call(N,Qe),T(!1)},R=()=>{var Qe;(Qe=N.onCancel)==null||Qe.call(N),T(!1)},[$,D]=Fte(d),{copied:z,copyLoading:V,onClick:B}=SZn({copyConfig:D,children:l}),[G,H]=f.useState(!1),[F,W]=f.useState(!1),[U,K]=f.useState(!1),[X,J]=f.useState(!1),[te,re]=f.useState(!0),[ce,ae]=Fte(c,{expandable:!1,symbol:Qe=>Qe?x==null?void 0:x.collapse:x==null?void 0:x.expand}),[oe,ue]=Fa(ae.defaultExpanded||!1,ae.expanded),fe=ce&&(!oe||ae.expandable==="collapsible"),{rows:se=1}=ae,ge=f.useMemo(()=>fe&&(ae.suffix!==void 0||ae.onEllipsis||ae.expandable||C||$),[fe,ae,C,$]);Po(()=>{ce&&!ge&&(H(DOe("webkitLineClamp")),W(DOe("textOverflow")))},[ge,ce]);const[ye,de]=f.useState(fe),Ne=f.useMemo(()=>ge?!1:se===1?F:G,[ge,F,G]);Po(()=>{de(Ne&&fe)},[Ne,fe]);const _e=fe&&(ye?X:U),xe=fe&&se===1&&ye,we=fe&&se>1&&ye,Te=(Qe,lt)=>{var bt;ue(lt.expanded),(bt=ae.onExpand)==null||bt.call(ae,Qe,lt)},[Re,Ue]=f.useState(0),He=({offsetWidth:Qe})=>{Ue(Qe)},Ye=Qe=>{var lt;K(Qe),U!==Qe&&((lt=ae.onEllipsis)==null||lt.call(ae,Qe))};f.useEffect(()=>{const Qe=v.current;if(ce&&ye&&Qe){const lt=_Zn(Qe);X!==lt&&J(lt)}},[ce,ye,l,we,te,Re]),f.useEffect(()=>{const Qe=v.current;if(typeof IntersectionObserver>"u"||!Qe||!ye||!fe)return;const lt=new IntersectionObserver(()=>{re(!!Qe.offsetParent)});return lt.observe(Qe),()=>{lt.disconnect()}},[ye,fe]);const We=NZn(ae.tooltip,N.text,l),at=f.useMemo(()=>{if(!(!ce||ye))return[N.text,l,h,We.title].find(Gve)},[ce,ye,h,We.title,_e]);if(j)return f.createElement(yZn,{value:N.text??(typeof l=="string"?l:""),onSave:M,onCancel:R,onEnd:N.onEnd,prefixCls:w,className:r,style:o,direction:y,component:p,maxLength:N.maxLength,autoSize:N.autoSize,enterIcon:N.enterIcon});const Oe=()=>{const{expandable:Qe,symbol:lt}=ae;return Qe?f.createElement("button",{type:"button",key:"expand",className:`${w}-${oe?"collapse":"expand"}`,onClick:bt=>Te(bt,{expanded:!oe}),"aria-label":oe?x.collapse:x==null?void 0:x.expand},typeof lt=="function"?lt(oe):lt):null},Ae=()=>{if(!C)return;const{icon:Qe,tooltip:lt,tabIndex:bt}=N,Ct=Bu(lt)[0]||(x==null?void 0:x.edit),Je=typeof Ct=="string"?Ct:"";return _.includes("icon")?f.createElement(pf,{key:"edit",title:lt===!1?"":Ct},f.createElement("button",{type:"button",ref:b,className:`${w}-edit`,onClick:E,"aria-label":Je,tabIndex:bt},Qe||f.createElement(iZn,{role:"button"}))):null},qe=()=>$?f.createElement(PZn,{key:"copy",...D,prefixCls:w,copied:z,locale:x,onCopy:B,loading:V,iconOnly:!ll(l)}):null,dt=Qe=>[Qe&&Oe(),Ae(),qe()],Ze=Qe=>[Qe&&!oe&&f.createElement("span",{"aria-hidden":!0,key:"ellipsis"},RZn),ae.suffix,dt(Qe)];return f.createElement(Uf,{onResize:He,disabled:!fe},Qe=>f.createElement(kZn,{tooltipProps:We,enableEllipsis:fe,isEllipsis:_e},f.createElement(Cdt,{className:be({[`${w}-${i}`]:i,[`${w}-disabled`]:s,[`${w}-ellipsis`]:ce,[`${w}-ellipsis-single-line`]:xe,[`${w}-ellipsis-multiple-line`]:we},r),prefixCls:n,style:{...o,WebkitLineClamp:we?se:void 0},component:p,ref:zd(Qe,v,t),direction:y,onClick:_.includes("text")?E:void 0,"aria-label":at==null?void 0:at.toString(),title:h,...S},f.createElement(TZn,{enableMeasure:fe&&!ye,text:l,rows:se,width:Re,onEllipsis:Ye,expanded:oe,miscDeps:[z,oe,V,C,$,x].concat(go(iLe.map(lt=>e[lt])))},(lt,bt)=>MZn(e,f.createElement(f.Fragment,null,lt.length>0&&bt&&!oe&&at?f.createElement("span",{key:"show-content","aria-hidden":!0},lt):lt,Ze(bt)))))))}),OZn=f.forwardRef((e,t)=>{const{ellipsis:n,rel:r,children:o,navigate:i,...s}=e,l={...s,rel:r===void 0&&s.target==="_blank"?"noopener noreferrer":r};return f.createElement(cY,{...l,ref:t,ellipsis:!!n,component:"a"},o)}),$Zn=f.forwardRef((e,t)=>{const{children:n,...r}=e;return f.createElement(cY,{ref:t,...r,component:"div"},n)}),DZn=(e,t)=>{const{ellipsis:n,children:r,...o}=e,i=f.useMemo(()=>n&&typeof n=="object"?za(n,["expandable","rows"]):n,[n]);return f.createElement(cY,{ref:t,...o,ellipsis:i,component:"span"},r)},LZn=f.forwardRef(DZn),FZn=[1,2,3,4,5],zZn=f.forwardRef((e,t)=>{const{level:n=1,children:r,...o}=e,i=FZn.includes(n)?`h${n}`:"h1";return f.createElement(cY,{ref:t,...o,component:i},r)}),Zk=Cdt;Zk.Text=LZn;Zk.Link=OZn;Zk.Title=zZn;Zk.Paragraph=$Zn;var BZn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"};function gde(){return gde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,gde({},e,{ref:t,icon:BZn})),VZn=f.forwardRef(HZn);var UZn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M296 250c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H296zm184 144H296c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm-48 458H208V148h560v320c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V108c0-17.7-14.3-32-32-32H168c-17.7 0-32 14.3-32 32v784c0 17.7 14.3 32 32 32h264c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm440-88H728v-36.6c46.3-13.8 80-56.6 80-107.4 0-61.9-50.1-112-112-112s-112 50.1-112 112c0 50.7 33.7 93.6 80 107.4V764H520c-8.8 0-16 7.2-16 16v152c0 8.8 7.2 16 16 16h352c8.8 0 16-7.2 16-16V780c0-8.8-7.2-16-16-16zM646 620c0-27.6 22.4-50 50-50s50 22.4 50 50-22.4 50-50 50-50-22.4-50-50zm180 266H566v-60h260v60z"}}]},name:"audit",theme:"outlined"};function xde(){return xde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,xde({},e,{ref:t,icon:UZn})),Ndt=f.forwardRef(WZn);var GZn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm-600-80h56c4.4 0 8-3.6 8-8V560c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v144c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V384c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v320c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V462c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v242c0 4.4 3.6 8 8 8zm152 0h56c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v400c0 4.4 3.6 8 8 8z"}}]},name:"bar-chart",theme:"outlined"};function yde(){return yde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,yde({},e,{ref:t,icon:GZn})),KZn=f.forwardRef(qZn);var YZn={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};function vde(){return vde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,vde({},e,{ref:t,icon:YZn})),oW=f.forwardRef(XZn);var QZn={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z"}}]},name:"close-circle",theme:"outlined"};function bde(){return bde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,bde({},e,{ref:t,icon:QZn})),ZZn=f.forwardRef(JZn);var eer={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M811.4 368.9C765.6 248 648.9 162 512.2 162S258.8 247.9 213 368.8C126.9 391.5 63.5 470.2 64 563.6 64.6 668 145.6 752.9 247.6 762c4.7.4 8.7-3.3 8.7-8v-60.4c0-4-3-7.4-7-7.9-27-3.4-52.5-15.2-72.1-34.5-24-23.5-37.2-55.1-37.2-88.6 0-28 9.1-54.4 26.2-76.4 16.7-21.4 40.2-36.9 66.1-43.7l37.9-10 13.9-36.7c8.6-22.8 20.6-44.2 35.7-63.5 14.9-19.2 32.6-36 52.4-50 41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.3c19.9 14 37.5 30.8 52.4 50 15.1 19.3 27.1 40.7 35.7 63.5l13.8 36.6 37.8 10c54.2 14.4 92.1 63.7 92.1 120 0 33.6-13.2 65.1-37.2 88.6-19.5 19.2-44.9 31.1-71.9 34.5-4 .5-6.9 3.9-6.9 7.9V754c0 4.7 4.1 8.4 8.8 8 101.7-9.2 182.5-94 183.2-198.2.6-93.4-62.7-172.1-148.6-194.9z"}},{tag:"path",attrs:{d:"M376.9 656.4c1.8-33.5 15.7-64.7 39.5-88.6 25.4-25.5 60-39.8 96-39.8 36.2 0 70.3 14.1 96 39.8 1.4 1.4 2.7 2.8 4.1 4.3l-25 19.6a8 8 0 003 14.1l98.2 24c5 1.2 9.9-2.6 9.9-7.7l.5-101.3c0-6.7-7.6-10.5-12.9-6.3L663 532.7c-36.6-42-90.4-68.6-150.5-68.6-107.4 0-195 85.1-199.4 191.7-.2 4.5 3.4 8.3 8 8.3H369c4.2-.1 7.7-3.4 7.9-7.7zM703 664h-47.9c-4.2 0-7.7 3.3-8 7.6-1.8 33.5-15.7 64.7-39.5 88.6-25.4 25.5-60 39.8-96 39.8-36.2 0-70.3-14.1-96-39.8-1.4-1.4-2.7-2.8-4.1-4.3l25-19.6a8 8 0 00-3-14.1l-98.2-24c-5-1.2-9.9 2.6-9.9 7.7l-.4 101.4c0 6.7 7.6 10.5 12.9 6.3l23.2-18.2c36.6 42 90.4 68.6 150.5 68.6 107.4 0 195-85.1 199.4-191.7.2-4.5-3.4-8.3-8-8.3z"}}]},name:"cloud-sync",theme:"outlined"};function wde(){return wde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,wde({},e,{ref:t,icon:eer})),ner=f.forwardRef(ter);var rer={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-600 72h560v208H232V136zm560 480H232V408h560v208zm0 272H232V680h560v208zM304 240a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0zm0 272a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"database",theme:"outlined"};function Sde(){return Sde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Sde({},e,{ref:t,icon:rer})),ier=f.forwardRef(oer);var aer={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"};function Cde(){return Cde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Cde({},e,{ref:t,icon:aer})),ler=f.forwardRef(ser);var cer={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880.1 154H143.9c-24.5 0-39.8 26.7-27.5 48L349 597.4V838c0 17.7 14.2 32 31.8 32h262.4c17.6 0 31.8-14.3 31.8-32V597.4L907.7 202c12.2-21.3-3.1-48-27.6-48zM603.4 798H420.6V642h182.9v156zm9.6-236.6l-9.5 16.6h-183l-9.5-16.6L212.7 226h598.6L613 561.4z"}}]},name:"filter",theme:"outlined"};function Nde(){return Nde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Nde({},e,{ref:t,icon:cer})),der=f.forwardRef(uer);var fer={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888 792H200V168c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v688c0 4.4 3.6 8 8 8h752c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM305.8 637.7c3.1 3.1 8.1 3.1 11.3 0l138.3-137.6L583 628.5c3.1 3.1 8.2 3.1 11.3 0l275.4-275.3c3.1-3.1 3.1-8.2 0-11.3l-39.6-39.6a8.03 8.03 0 00-11.3 0l-230 229.9L461.4 404a8.03 8.03 0 00-11.3 0L266.3 586.7a8.03 8.03 0 000 11.3l39.5 39.7z"}}]},name:"line-chart",theme:"outlined"};function jde(){return jde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,jde({},e,{ref:t,icon:fer})),her=f.forwardRef(per);var mer={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 464h-68V240c0-70.7-57.3-128-128-128H388c-70.7 0-128 57.3-128 128v224h-68c-17.7 0-32 14.3-32 32v384c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V496c0-17.7-14.3-32-32-32zM332 240c0-30.9 25.1-56 56-56h248c30.9 0 56 25.1 56 56v224H332V240zm460 600H232V536h560v304zM484 701v53c0 4.4 3.6 8 8 8h40c4.4 0 8-3.6 8-8v-53a48.01 48.01 0 10-56 0z"}}]},name:"lock",theme:"outlined"};function Ede(){return Ede=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Ede({},e,{ref:t,icon:mer})),xer=f.forwardRef(ger);var yer={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 328a60 60 0 10120 0 60 60 0 10-120 0zM852 64H172c-17.7 0-32 14.3-32 32v660c0 17.7 14.3 32 32 32h680c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32zm-32 660H204V128h616v596zM604 328a60 60 0 10120 0 60 60 0 10-120 0zm250.2 556H169.8c-16.5 0-29.8 14.3-29.8 32v36c0 4.4 3.3 8 7.4 8h729.1c4.1 0 7.4-3.6 7.4-8v-36c.1-17.7-13.2-32-29.7-32zM664 508H360c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z"}}]},name:"robot",theme:"outlined"};function Ide(){return Ide=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Ide({},e,{ref:t,icon:yer})),aLe=f.forwardRef(ver);var ber={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 736c0-111.6-65.4-208-160-252.9V317.3c0-15.1-5.3-29.7-15.1-41.2L536.5 95.4C530.1 87.8 521 84 512 84s-18.1 3.8-24.5 11.4L335.1 276.1a63.97 63.97 0 00-15.1 41.2v165.8C225.4 528 160 624.4 160 736h156.5c-2.3 7.2-3.5 15-3.5 23.8 0 22.1 7.6 43.7 21.4 60.8a97.2 97.2 0 0043.1 30.6c23.1 54 75.6 88.8 134.5 88.8 29.1 0 57.3-8.6 81.4-24.8 23.6-15.8 41.9-37.9 53-64a97 97 0 0043.1-30.5 97.52 97.52 0 0021.4-60.8c0-8.4-1.1-16.4-3.1-23.8H864zM762.3 621.4c9.4 14.6 17 30.3 22.5 46.6H700V558.7a211.6 211.6 0 0162.3 62.7zM388 483.1V318.8l124-147 124 147V668H388V483.1zM239.2 668c5.5-16.3 13.1-32 22.5-46.6 16.3-25.2 37.5-46.5 62.3-62.7V668h-84.8zm388.9 116.2c-5.2 3-11.2 4.2-17.1 3.4l-19.5-2.4-2.8 19.4c-5.4 37.9-38.4 66.5-76.7 66.5-38.3 0-71.3-28.6-76.7-66.5l-2.8-19.5-19.5 2.5a27.7 27.7 0 01-17.1-3.5c-8.7-5-14.1-14.3-14.1-24.4 0-10.6 5.9-19.4 14.6-23.8h231.3c8.8 4.5 14.6 13.3 14.6 23.8-.1 10.2-5.5 19.6-14.2 24.5zM464 400a48 48 0 1096 0 48 48 0 10-96 0z"}}]},name:"rocket",theme:"outlined"};function _de(){return _de=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,_de({},e,{ref:t,icon:ber})),Ser=f.forwardRef(wer);var Cer={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6zm-405.8-201c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.3 0-12.7-6.5-12.7h-55.2c-5.1 0-10 2.5-13 6.6L468.9 542.4l-64.7-89.1z"}}]},name:"safety-certificate",theme:"outlined"};function Pde(){return Pde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Pde({},e,{ref:t,icon:Cer})),jdt=f.forwardRef(Ner);var jer={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M866.9 169.9L527.1 54.1C523 52.7 517.5 52 512 52s-11 .7-15.1 2.1L157.1 169.9c-8.3 2.8-15.1 12.4-15.1 21.2v482.4c0 8.8 5.7 20.4 12.6 25.9L499.3 968c3.5 2.7 8 4.1 12.6 4.1s9.2-1.4 12.6-4.1l344.7-268.6c6.9-5.4 12.6-17 12.6-25.9V191.1c.2-8.8-6.6-18.3-14.9-21.2zM810 654.3L512 886.5 214 654.3V226.7l298-101.6 298 101.6v427.6zM402.9 528.8l-77.5 77.5a8.03 8.03 0 000 11.3l34 34c3.1 3.1 8.2 3.1 11.3 0l77.5-77.5c55.7 35.1 130.1 28.4 178.6-20.1 56.3-56.3 56.3-147.5 0-203.8-56.3-56.3-147.5-56.3-203.8 0-48.5 48.5-55.2 123-20.1 178.6zm65.4-133.3c31.3-31.3 82-31.3 113.2 0 31.3 31.3 31.3 82 0 113.2-31.3 31.3-82 31.3-113.2 0s-31.3-81.9 0-113.2z"}}]},name:"security-scan",theme:"outlined"};function Ade(){return Ade=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Ade({},e,{ref:t,icon:jer})),Edt=f.forwardRef(Eer);var Ier={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2a15.99 15.99 0 00-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}}]},name:"send",theme:"outlined"};function Tde(){return Tde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Tde({},e,{ref:t,icon:Ier})),sLe=f.forwardRef(_er);var Per={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M168 504.2c1-43.7 10-86.1 26.9-126 17.3-41 42.1-77.7 73.7-109.4S337 212.3 378 195c42.4-17.9 87.4-27 133.9-27s91.5 9.1 133.8 27A341.5 341.5 0 01755 268.8c9.9 9.9 19.2 20.4 27.8 31.4l-60.2 47a8 8 0 003 14.1l175.7 43c5 1.2 9.9-2.6 9.9-7.7l.8-180.9c0-6.7-7.7-10.5-12.9-6.3l-56.4 44.1C765.8 155.1 646.2 92 511.8 92 282.7 92 96.3 275.6 92 503.8a8 8 0 008 8.2h60c4.4 0 7.9-3.5 8-7.8zm756 7.8h-60c-4.4 0-7.9 3.5-8 7.8-1 43.7-10 86.1-26.9 126-17.3 41-42.1 77.8-73.7 109.4A342.45 342.45 0 01512.1 856a342.24 342.24 0 01-243.2-100.8c-9.9-9.9-19.2-20.4-27.8-31.4l60.2-47a8 8 0 00-3-14.1l-175.7-43c-5-1.2-9.9 2.6-9.9 7.7l-.7 181c0 6.7 7.7 10.5 12.9 6.3l56.4-44.1C258.2 868.9 377.8 932 512.2 932c229.2 0 415.5-183.7 419.8-411.8a8 8 0 00-8-8.2z"}}]},name:"sync",theme:"outlined"};function kde(){return kde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,kde({},e,{ref:t,icon:Per})),Ter=f.forwardRef(Aer);var ker={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M848 359.3H627.7L825.8 109c4.1-5.3.4-13-6.3-13H436c-2.8 0-5.5 1.5-6.9 4L170 547.5c-3.1 5.3.7 12 6.9 12h174.4l-89.4 357.6c-1.9 7.8 7.5 13.3 13.3 7.7L853.5 373c5.2-4.9 1.7-13.7-5.5-13.7zM378.2 732.5l60.3-241H281.1l189.6-327.4h224.6L487 427.4h211L378.2 732.5z"}}]},name:"thunderbolt",theme:"outlined"};function Mde(){return Mde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Mde({},e,{ref:t,icon:ker})),Wte=f.forwardRef(Mer);var Rer={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M668.6 320c0-4.4-3.6-8-8-8h-54.5c-3 0-5.8 1.7-7.1 4.4l-84.7 168.8H511l-84.7-168.8a8 8 0 00-7.1-4.4h-55.7c-1.3 0-2.6.3-3.8 1-3.9 2.1-5.3 7-3.2 10.8l103.9 191.6h-57c-4.4 0-8 3.6-8 8v27.1c0 4.4 3.6 8 8 8h76v39h-76c-4.4 0-8 3.6-8 8v27.1c0 4.4 3.6 8 8 8h76V704c0 4.4 3.6 8 8 8h49.9c4.4 0 8-3.6 8-8v-63.5h76.3c4.4 0 8-3.6 8-8v-27.1c0-4.4-3.6-8-8-8h-76.3v-39h76.3c4.4 0 8-3.6 8-8v-27.1c0-4.4-3.6-8-8-8H564l103.7-191.6c.5-1.1.9-2.4.9-3.7zM157.9 504.2a352.7 352.7 0 01103.5-242.4c32.5-32.5 70.3-58.1 112.4-75.9 43.6-18.4 89.9-27.8 137.6-27.8 47.8 0 94.1 9.3 137.6 27.8 42.1 17.8 79.9 43.4 112.4 75.9 10 10 19.3 20.5 27.9 31.4l-50 39.1a8 8 0 003 14.1l156.8 38.3c5 1.2 9.9-2.6 9.9-7.7l.8-161.5c0-6.7-7.7-10.5-12.9-6.3l-47.8 37.4C770.7 146.3 648.6 82 511.5 82 277 82 86.3 270.1 82 503.8a8 8 0 008 8.2h60c4.3 0 7.8-3.5 7.9-7.8zM934 512h-60c-4.3 0-7.9 3.5-8 7.8a352.7 352.7 0 01-103.5 242.4 352.57 352.57 0 01-112.4 75.9c-43.6 18.4-89.9 27.8-137.6 27.8s-94.1-9.3-137.6-27.8a352.57 352.57 0 01-112.4-75.9c-10-10-19.3-20.5-27.9-31.4l49.9-39.1a8 8 0 00-3-14.1l-156.8-38.3c-5-1.2-9.9 2.6-9.9 7.7l-.8 161.7c0 6.7 7.7 10.5 12.9 6.3l47.8-37.4C253.3 877.7 375.4 942 512.5 942 747 942 937.7 753.9 942 520.2a8 8 0 00-8-8.2z"}}]},name:"transaction",theme:"outlined"};function Rde(){return Rde=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Rde({},e,{ref:t,icon:Rer})),$er=f.forwardRef(Oer);var Der={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}}]},name:"warning",theme:"outlined"};function Ode(){return Ode=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.createElement(bo,Ode({},e,{ref:t,icon:Der})),Fer=f.forwardRef(Ler),{Title:lLe,Text:XN,Paragraph:zer}=Zk,{RangePicker:Ber}=Kk,{Option:cLe}=F0,{TabPane:Gte}=W2,Ul={Core:{Utils:{generateId:e=>`${e}_${Math.random().toString(36).substr(2,9).toUpperCase()}`,sleep:e=>new Promise(t=>setTimeout(t,e)),formatDate:e=>ou(e).format("YYYY-MM-DD HH:mm:ss"),formatCurrency:(e,t="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),randomInt:(e,t)=>Math.floor(Math.random()*(t-e+1))+e,randomChoice:e=>e[Math.floor(Math.random()*e.length)]},Logging:{info:(e,t)=>console.log(`[JBOC-INFO] ${e}`,t||""),warn:(e,t)=>console.warn(`[JBOC-WARN] ${e}`,t||""),error:(e,t)=>console.error(`[JBOC-ERROR] ${e}`,t||""),audit:(e,t,n)=>console.log(`[JBOC-AUDIT] User: ${t} | Action: ${e} | Resource: ${n}`)}},Business:{ReportTypes:{VOA:"Verification of Assets",VOI:"Verification of Income",VOE:"Verification of Employment",VOIE:"Income & Employment",CREDIT:"Credit Report (Tri-Bureau)",KYC:"Know Your Customer",AML:"Anti-Money Laundering",TAX:"4506-C Tax Transcript",PAYROLL:"Direct Payroll Feed"},Statuses:{COMPLETED:"success",PROCESSING:"processing",FAILED:"error",PENDING:"warning",CANCELLED:"default"}}},Her=[{first:"James",last:"O'Callaghan"},{first:"Sarah",last:"Connor"},{first:"John",last:"Doe"},{first:"Alice",last:"Wonderland"},{first:"Bob",last:"Builder"},{first:"Charlie",last:"Bucket"},{first:"Diana",last:"Prince"},{first:"Bruce",last:"Wayne"},{first:"Clark",last:"Kent"},{first:"Peter",last:"Parker"},{first:"Tony",last:"Stark"},{first:"Steve",last:"Rogers"},{first:"Natasha",last:"Romanoff"},{first:"Wanda",last:"Maximoff"},{first:"Stephen",last:"Strange"},{first:"Thor",last:"Odinson"}],Ver=e=>Array.from({length:e}).map((t,n)=>{const r=Ul.Core.Utils.randomChoice(Object.keys(Ul.Business.ReportTypes)),o=Ul.Core.Utils.randomChoice(Object.keys(Ul.Business.Statuses)),i=Ul.Core.Utils.randomChoice(Her),s=ou().subtract(Ul.Core.Utils.randomInt(0,30),"day").subtract(Ul.Core.Utils.randomInt(0,1e3),"minute");return{id:Ul.Core.Utils.generateId("REP"),referenceNumber:`REF-${2024e4+n}`,type:r,status:o,consumer:{id:Ul.Core.Utils.generateId("CON"),firstName:i.first,lastName:i.last,ssnMasked:`***-**-${Ul.Core.Utils.randomInt(1e3,9999)}`,email:`${i.first.toLowerCase()}.${i.last.toLowerCase()}@example.com`},requester:{id:Ul.Core.Utils.generateId("REQ"),name:"System Automator",department:Ul.Core.Utils.randomChoice(["Underwriting","Compliance","Onboarding","Fraud"])},metadata:{score:Ul.Core.Utils.randomInt(300,850),riskLevel:Ul.Core.Utils.randomChoice(["LOW","LOW","LOW","MEDIUM","MEDIUM","HIGH","CRITICAL"]),dataSources:["Equifax","Experian","TransUnion","The Work Number"].slice(0,Ul.Core.Utils.randomInt(1,4)),turnaroundTimeMs:Ul.Core.Utils.randomInt(500,5e3),flagged:Math.random()>.9},createdAt:s.toISOString(),updatedAt:s.add(Ul.Core.Utils.randomInt(1,60),"minute").toISOString(),auditLog:[{timestamp:s.toISOString(),action:"REPORT_INITIATED",actor:"System",note:"Automated trigger"},{timestamp:s.add(2,"second").toISOString(),action:"DATA_REQUESTED",actor:"Orchestrator"},{timestamp:s.add(5,"second").toISOString(),action:"PROVIDER_RESPONSE",actor:"Gateway"},{timestamp:s.add(10,"second").toISOString(),action:"REPORT_GENERATED",actor:"Engine"}]}}),uLe=({status:e})=>{switch(e){case"COMPLETED":return a.jsx(uh,{icon:a.jsx(oW,{}),color:"success",children:"COMPLETED"});case"PROCESSING":return a.jsx(uh,{icon:a.jsx(Ter,{spin:!0}),color:"processing",children:"PROCESSING"});case"FAILED":return a.jsx(uh,{icon:a.jsx(ZZn,{}),color:"error",children:"FAILED"});case"PENDING":return a.jsx(uh,{icon:a.jsx(put,{}),color:"warning",children:"PENDING"});case"CANCELLED":return a.jsx(uh,{icon:a.jsx(StopOutlined,{}),color:"default",children:"CANCELLED"});default:return a.jsx(uh,{children:e})}},Uer=({score:e,level:t})=>{if(!e)return a.jsx("span",{className:"text-gray-400",children:"N/A"});let n="#52c41a";return t==="MEDIUM"&&(n="#faad14"),t==="HIGH"&&(n="#fa8c16"),t==="CRITICAL"&&(n="#f5222d"),a.jsxs(pf,{title:`Risk Level: ${t}`,children:[a.jsx(kve,{percent:e/850*100,size:"small",showInfo:!1,strokeColor:n}),a.jsxs("div",{style:{fontSize:"10px",color:n,marginTop:2},children:[e," (",t,")"]})]})},Wer=({customerId:e,className:t})=>{var S;const[n,r]=f.useState(!1),[o,i]=f.useState([]),[s,l]=f.useState(null),[c,u]=f.useState(!1),[d,p]=f.useState({searchText:"",status:[],type:[],dateRange:null,riskLevel:[]}),h=f.useMemo(()=>({total:o.length,completed:o.filter(C=>C.status==="COMPLETED").length,failed:o.filter(C=>C.status==="FAILED").length,avgScore:Math.round(o.reduce((C,N)=>C+(N.metadata.score||0),0)/(o.length||1)),criticalRisks:o.filter(C=>C.metadata.riskLevel==="CRITICAL").length}),[o]);f.useEffect(()=>{m()},[e]);const m=async()=>{r(!0),Ul.Core.Logging.info("Initializing Data Fetch sequence..."),await Ul.Core.Utils.sleep(1200);const C=Ver(150);i(C),r(!1),Ul.Core.Logging.info("Data Fetch complete",{count:C.length})},g=f.useMemo(()=>o.filter(C=>{const N=C.referenceNumber.toLowerCase().includes(d.searchText.toLowerCase())||C.consumer.lastName.toLowerCase().includes(d.searchText.toLowerCase())||C.consumer.firstName.toLowerCase().includes(d.searchText.toLowerCase()),j=d.status.length===0||d.status.includes(C.status),I=d.type.length===0||d.type.includes(C.type),_=d.riskLevel.length===0||C.metadata.riskLevel&&d.riskLevel.includes(C.metadata.riskLevel);let T=!0;if(d.dateRange&&d.dateRange[0]&&d.dateRange[1]){const P=ou(C.createdAt);T=P.isAfter(d.dateRange[0])&&P.isBefore(d.dateRange[1])}return N&&j&&I&&T&&_}),[o,d]),y=()=>{m()},x=C=>{Ul.Core.Logging.audit("VIEW_DETAIL","Current_User",C.id),l(C),u(!0)},v=(C,N)=>{mg.confirm({title:`Download ${N} Report?`,icon:a.jsx(jdt,{style:{color:"#1890ff"}}),content:`You are about to download a sensitive verification report for ${C.consumer.firstName} ${C.consumer.lastName}. This action will be logged.`,onOk(){Ul.Core.Logging.audit(`DOWNLOAD_${N}`,"Current_User",C.id),setTimeout(()=>{console.log("Download complete")},1500)}})},b=(C,N)=>{p(j=>({...j,[C]:N}))},w=[{title:"Reference ID",dataIndex:"referenceNumber",key:"referenceNumber",width:140,render:C=>a.jsx(XN,{copyable:{text:C},children:C})},{title:"Consumer",key:"consumer",width:200,render:(C,N)=>a.jsxs(m0,{direction:"vertical",size:0,children:[a.jsxs(XN,{strong:!0,children:[N.consumer.lastName,", ",N.consumer.firstName]}),a.jsx(XN,{type:"secondary",style:{fontSize:11},children:N.consumer.email})]})},{title:"Report Type",dataIndex:"type",key:"type",width:150,render:C=>a.jsx(uh,{color:"geekblue",children:Ul.Business.ReportTypes[C]})},{title:"Status",dataIndex:"status",key:"status",width:120,render:C=>a.jsx(uLe,{status:C})},{title:"Date Created",dataIndex:"createdAt",key:"createdAt",width:180,render:C=>a.jsx(pf,{title:C,children:a.jsx("span",{children:ou(C).format("MMM D, YYYY h:mm A")})}),sorter:(C,N)=>ou(C.createdAt).unix()-ou(N.createdAt).unix()},{title:"Risk Score",key:"risk",width:150,render:(C,N)=>a.jsx(Uer,{score:N.metadata.score,level:N.metadata.riskLevel})},{title:"Actions",key:"actions",fixed:"right",width:120,render:(C,N)=>a.jsxs(m0,{children:[a.jsx(pf,{title:"View Details",children:a.jsx(Ls,{type:"text",icon:a.jsx(Pve,{}),onClick:()=>x(N)})}),a.jsx(pf,{title:"Quick Download PDF",children:a.jsx(Ls,{type:"text",icon:a.jsx(VZn,{}),onClick:()=>v(N,"PDF")})})]})}];return a.jsxs("div",{className:`verification-reports-view ${t}`,style:{padding:24,background:"#f0f2f5",minHeight:"100vh"},children:[a.jsxs("div",{style:{marginBottom:24,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsxs("div",{children:[a.jsx(lLe,{level:2,style:{margin:0},children:"Verification Reports"}),a.jsxs(XN,{type:"secondary",children:["Managing verification lifecycle for Customer ID: ",a.jsx(XN,{code:!0,children:e})]})]}),a.jsxs(m0,{children:[a.jsx(Ls,{icon:a.jsx(ler,{}),children:"Export CSV"}),a.jsx(Ls,{type:"primary",icon:a.jsx(mYn,{}),loading:n,onClick:y,children:"Refresh Data"})]})]}),a.jsxs(Sv,{gutter:16,style:{marginBottom:24},children:[a.jsx(dc,{span:6,children:a.jsx(a0,{bordered:!1,loading:n,children:a.jsx(Ym,{title:"Total Reports",value:h.total,prefix:a.jsx(Ndt,{})})})}),a.jsx(dc,{span:6,children:a.jsx(a0,{bordered:!1,loading:n,children:a.jsx(Ym,{title:"Success Rate",value:h.total?h.completed/h.total*100:0,precision:1,suffix:"%",prefix:a.jsx(oW,{style:{color:"#52c41a"}})})})}),a.jsx(dc,{span:6,children:a.jsx(a0,{bordered:!1,loading:n,children:a.jsx(Ym,{title:"Avg Credit Score",value:h.avgScore,prefix:a.jsx(KZn,{style:{color:"#1890ff"}})})})}),a.jsx(dc,{span:6,children:a.jsx(a0,{bordered:!1,loading:n,children:a.jsx(Ym,{title:"Critical Risks",value:h.criticalRisks,valueStyle:{color:h.criticalRisks>0?"#cf1322":"#3f8600"},prefix:a.jsx(Fer,{})})})})]}),a.jsxs(a0,{bordered:!1,className:"shadow-md rounded-lg",children:[a.jsx("div",{style:{padding:"0 0 24px 0"},children:a.jsxs(Sv,{gutter:[16,16],children:[a.jsx(dc,{span:6,children:a.jsx(Hx,{placeholder:"Search Reference, Name...",prefix:a.jsx(zE,{}),value:d.searchText,onChange:C=>b("searchText",C.target.value),allowClear:!0})}),a.jsx(dc,{span:4,children:a.jsx(F0,{mode:"multiple",placeholder:"Filter Status",style:{width:"100%"},allowClear:!0,onChange:C=>b("status",C),children:Object.keys(Ul.Business.Statuses).map(C=>a.jsx(cLe,{value:C,children:C},C))})}),a.jsx(dc,{span:4,children:a.jsx(F0,{mode:"multiple",placeholder:"Report Type",style:{width:"100%"},allowClear:!0,onChange:C=>b("type",C),children:Object.keys(Ul.Business.ReportTypes).map(C=>a.jsx(cLe,{value:C,children:C},C))})}),a.jsx(dc,{span:6,children:a.jsx(Ber,{style:{width:"100%"},onChange:C=>b("dateRange",C)})}),a.jsx(dc,{span:4,style:{textAlign:"right"},children:a.jsx(pf,{title:"Advanced Filtering coming in v4.3",children:a.jsx(Ls,{type:"text",icon:a.jsx(der,{}),children:"More Filters"})})})]})}),a.jsx(Ty,{columns:w,dataSource:g,rowKey:"id",loading:n,pagination:{defaultPageSize:10,showSizeChanger:!0,showTotal:(C,N)=>`${N[0]}-${N[1]} of ${C} items`},scroll:{x:1300},size:"middle"})]}),a.jsx(Eve,{title:a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingRight:32},children:[a.jsxs("span",{children:["Report Details: ",s==null?void 0:s.referenceNumber]}),s&&a.jsx(uLe,{status:s.status})]}),width:720,onClose:()=>u(!1),open:c,extra:a.jsxs(m0,{children:[a.jsx(Ls,{onClick:()=>u(!1),children:"Close"}),a.jsx(Ls,{type:"primary",onClick:()=>s&&v(s,"PDF"),children:"Download Report"})]}),children:s?a.jsxs("div",{className:"report-detail-content",children:[s.metadata.riskLevel==="CRITICAL"&&a.jsx(Rye,{message:"Critical Risk Detected",description:"This report contains indicators that exceed the standard risk threshold. Manual review by a Senior Underwriter is recommended.",type:"error",showIcon:!0,style:{marginBottom:24}}),a.jsxs(W2,{defaultActiveKey:"1",children:[a.jsxs(Gte,{tab:"Overview",children:[a.jsxs(jx,{title:"Consumer Information",bordered:!0,column:2,size:"small",children:[a.jsx(jx.Item,{label:"First Name",children:s.consumer.firstName}),a.jsx(jx.Item,{label:"Last Name",children:s.consumer.lastName}),a.jsx(jx.Item,{label:"SSN (Masked)",children:s.consumer.ssnMasked}),a.jsx(jx.Item,{label:"Email",children:s.consumer.email})]}),a.jsx(RP,{}),a.jsxs(jx,{title:"Report Meta",bordered:!0,column:2,size:"small",children:[a.jsx(jx.Item,{label:"Report Type",children:s.type}),a.jsx(jx.Item,{label:"Generated",children:ou(s.createdAt).format("MM/DD/YYYY")}),a.jsxs(jx.Item,{label:"Turnaround Time",children:[s.metadata.turnaroundTimeMs," ms"]}),a.jsx(jx.Item,{label:"Data Sources",children:(S=s.metadata.dataSources)==null?void 0:S.map(C=>a.jsx(uh,{children:C},C))})]}),a.jsx(RP,{}),a.jsxs("div",{style:{textAlign:"center",padding:20,background:"#fafafa",borderRadius:8},children:[a.jsx(lLe,{level:4,children:"Score Analysis"}),a.jsx(kve,{type:"dashboard",percent:(s.metadata.score||0)/8.5,format:()=>`${s.metadata.score}`,strokeColor:(s.metadata.score||0)>700?"#52c41a":(s.metadata.score||0)>600?"#faad14":"#f5222d"}),a.jsxs(zer,{children:["Based on the data retrieved, the consumer falls into the ",a.jsx("strong",{children:s.metadata.riskLevel})," risk category."]})]})]},"1"),a.jsx(Gte,{tab:"Raw Data Payload",children:a.jsx("div",{style:{background:"#282c34",padding:16,borderRadius:8,color:"#abb2bf",fontFamily:"monospace",fontSize:12,height:400,overflow:"auto"},children:a.jsx("pre",{children:JSON.stringify(s,null,2)})})},"2"),a.jsx(Gte,{tab:"Audit Trail",children:a.jsx(G$,{mode:"left",style:{marginTop:20},children:s.auditLog.map((C,N)=>a.jsxs(G$.Item,{color:N===s.auditLog.length-1?"green":"blue",label:ou(C.timestamp).format("HH:mm:ss"),children:[a.jsx(XN,{strong:!0,children:C.action}),a.jsx("br",{}),a.jsxs(XN,{type:"secondary",style:{fontSize:12},children:["Actor: ",C.actor]}),C.note&&a.jsx("div",{children:a.jsx(uh,{color:"default",children:C.note})})]},N))})},"3")]})]}):a.jsx(i0,{description:"No Data Loaded"})})]})};function Idt(e){return e!=null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function _dt(e){return e.parentElement&&_dt(e.parentElement)?!0:e.hidden}function Ger(e){const t=e.getAttribute("contenteditable");return t!=="false"&&t!=null}function qer(e){return!!e.getAttribute("disabled")||!!e.getAttribute("aria-disabled")}function Ker(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)if(r!=null)for(const o in r)Object.prototype.hasOwnProperty.call(r,o)&&(o in n&&delete n[o],n[o]=r[o]);return n}const lv=e=>e?"":void 0,qte=e=>e?!0:void 0;function Yer(e){return Array.isArray(e)}function ew(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Yer(e)}function Xer(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function dLe(e){if(e==null)return e;const{unitless:t}=Xer(e);return t||typeof e=="number"?`${e}px`:e}function Qer(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${dLe(e)})`),t&&n.push("and",`(max-width: ${dLe(t)})`),n.join(" ")}function s0(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function Jer(e){return f.Children.toArray(e).filter(t=>f.isValidElement(t))}function Pdt(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Zer(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Y0(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:o="Provider",errorMessage:i,defaultValue:s}=e,l=f.createContext(s);l.displayName=t;function c(){var d;const u=f.useContext(l);if(!u&&n){const p=new Error(i??Zer(r,o));throw p.name="ContextError",(d=Error.captureStackTrace)==null||d.call(Error,p,c),p}return u}return[l.Provider,c,l]}const Vs=(...e)=>e.filter(Boolean).join(" "),etr=e=>e.hasAttribute("tabindex");function ttr(e){if(!Idt(e)||_dt(e)||qer(e))return!1;const{localName:t}=e;if(["input","select","textarea","button"].indexOf(t)>=0)return!0;const r={a:()=>e.hasAttribute("href"),audio:()=>e.hasAttribute("controls"),video:()=>e.hasAttribute("controls")};return t in r?r[t]():Ger(e)?!0:etr(e)}const ntr=["input:not(:disabled):not([disabled])","select:not(:disabled):not([disabled])","textarea:not(:disabled):not([disabled])","embed","iframe","object","a[href]","area[href]","button:not(:disabled):not([disabled])","[tabindex]","audio[controls]","video[controls]","*[tabindex]:not([aria-disabled])","*[contenteditable]"],rtr=ntr.join(),otr=e=>e.offsetWidth>0&&e.offsetHeight>0;function itr(e){const t=Array.from(e.querySelectorAll(rtr));return t.unshift(e),t.filter(n=>ttr(n)&&otr(n))}function atr(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,s)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const l=t.get(r);if(l.has(o))return l.get(o);const c=e(r,o,i,s);return l.set(o,c),c}},ltr=str(atr),ctr=e=>e.default||e;function Adt(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function utr(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}const Tdt=Object.freeze(["base","sm","md","lg","xl","2xl"]);function qve(e,t){return Array.isArray(e)?e.map(n=>n===null?null:t(n)):ew(e)?Object.keys(e).reduce((n,r)=>(n[r]=t(e[r]),n),{}):e!=null?t(e):null}function dtr(e,t=Tdt){const n={};return e.forEach((r,o)=>{const i=t[o];r!=null&&(n[i]=r)}),n}const ftr=e=>typeof e=="function";function Ov(e,...t){return ftr(e)?e(...t):e}function ptr(e){const t=e.ownerDocument.defaultView||window,{overflow:n,overflowX:r,overflowY:o}=t.getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(n+o+r)}function htr(e){return e.localName==="html"?e:e.assignedSlot||e.parentElement||e.ownerDocument.documentElement}function kdt(e){return["html","body","#document"].includes(e.localName)?e.ownerDocument.body:Idt(e)&&ptr(e)?e:kdt(htr(e))}function mtr(e,...t){const n=Object.getOwnPropertyDescriptors(e),r=Object.keys(n),o=s=>{const l={};for(let c=0;co(Array.isArray(s)?s:r.filter(s));return t.map(i).concat(o(r))}var LR={exports:{}};LR.exports;var fLe;function gtr(){return fLe||(fLe=1,(function(e,t){var n=200,r="__lodash_hash_undefined__",o=800,i=16,s=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object AsyncFunction]",d="[object Boolean]",p="[object Date]",h="[object Error]",m="[object Function]",g="[object GeneratorFunction]",y="[object Map]",x="[object Number]",v="[object Null]",b="[object Object]",w="[object Proxy]",S="[object RegExp]",C="[object Set]",N="[object String]",j="[object Undefined]",I="[object WeakMap]",_="[object ArrayBuffer]",T="[object DataView]",P="[object Float32Array]",E="[object Float64Array]",M="[object Int8Array]",R="[object Int16Array]",$="[object Int32Array]",D="[object Uint8Array]",z="[object Uint8ClampedArray]",V="[object Uint16Array]",B="[object Uint32Array]",G=/[\\^$.*+?()[\]{}|]/g,H=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,W={};W[P]=W[E]=W[M]=W[R]=W[$]=W[D]=W[z]=W[V]=W[B]=!0,W[l]=W[c]=W[_]=W[d]=W[T]=W[p]=W[h]=W[m]=W[y]=W[x]=W[b]=W[S]=W[C]=W[N]=W[I]=!1;var U=typeof L8=="object"&&L8&&L8.Object===Object&&L8,K=typeof self=="object"&&self&&self.Object===Object&&self,X=U||K||Function("return this")(),J=t&&!t.nodeType&&t,te=J&&!0&&e&&!e.nodeType&&e,re=te&&te.exports===J,ce=re&&U.process,ae=(function(){try{var ht=te&&te.require&&te.require("util").types;return ht||ce&&ce.binding&&ce.binding("util")}catch{}})(),oe=ae&&ae.isTypedArray;function ue(ht,Wt,bn){switch(bn.length){case 0:return ht.call(Wt);case 1:return ht.call(Wt,bn[0]);case 2:return ht.call(Wt,bn[0],bn[1]);case 3:return ht.call(Wt,bn[0],bn[1],bn[2])}return ht.apply(Wt,bn)}function fe(ht,Wt){for(var bn=-1,Ar=Array(ht);++bn-1}function nn(ht,Wt){var bn=this.__data__,Ar=un(bn,ht);return Ar<0?(++this.size,bn.push([ht,Wt])):bn[Ar][1]=Wt,this}ot.prototype.clear=mt,ot.prototype.delete=Ht,ot.prototype.get=jt,ot.prototype.has=Vt,ot.prototype.set=nn;function zt(ht){var Wt=-1,bn=ht==null?0:ht.length;for(this.clear();++Wt1?bn[Io-1]:void 0,Tr=Io>2?bn[2]:void 0;for(xi=ht.length>3&&typeof xi=="function"?(Io--,xi):void 0,Tr&&Ao(bn[0],bn[1],Tr)&&(xi=Io<3?void 0:xi,Io=1),Wt=Object(Wt);++Ar-1&&ht%1==0&&ht0){if(++Wt>=o)return arguments[0]}else Wt=0;return ht.apply(void 0,arguments)}}function ei(ht){if(ht!=null){try{return we.call(ht)}catch{}try{return ht+""}catch{}}return""}function No(ht,Wt){return ht===Wt||ht!==ht&&Wt!==Wt}var Ha=tr((function(){return arguments})())?tr:function(ht){return Ws(ht)&&Te.call(ht,"callee")&&!dt.call(ht,"callee")},ro=Array.isArray;function kr(ht){return ht!=null&&_i(ht.length)&&!Vo(ht)}function xo(ht){return Ws(ht)&&kr(ht)}var Bn=bt||ec;function Vo(ht){if(!yu(ht))return!1;var Wt=ar(ht);return Wt==m||Wt==g||Wt==u||Wt==w}function _i(ht){return typeof ht=="number"&&ht>-1&&ht%1==0&&ht<=s}function yu(ht){var Wt=typeof ht;return ht!=null&&(Wt=="object"||Wt=="function")}function Ws(ht){return ht!=null&&typeof ht=="object"}function sd(ht){if(!Ws(ht)||ar(ht)!=b)return!1;var Wt=Ae(ht);if(Wt===null)return!0;var bn=Te.call(Wt,"constructor")&&Wt.constructor;return typeof bn=="function"&&bn instanceof bn&&we.call(bn)==He}var Lp=oe?se(oe):Le;function vu(ht){return po(ht,ld(ht))}function ld(ht){return kr(ht)?xt(ht):ke(ht)}var Sf=nr(function(ht,Wt,bn,Ar){it(ht,Wt,bn,Ar)});function ma(ht){return function(){return ht}}function Vc(ht){return ht}function ec(){return!1}e.exports=Sf})(LR,LR.exports)),LR.exports}var xtr=gtr();const U1=Ba(xtr);function $de(e,t=[]){const n=f.useRef(e);return f.useEffect(()=>{n.current=e}),f.useCallback((...r)=>{var o;return(o=n.current)==null?void 0:o.call(n,...r)},t)}function Kte(e,t,n,r){const o=$de(n);return f.useEffect(()=>{const i=typeof e=="function"?e():e??document;if(!(!n||!i))return i.addEventListener(t,o,r),()=>{i.removeEventListener(t,o,r)}},[t,e,r,o,n]),()=>{const i=typeof e=="function"?e():e??document;i==null||i.removeEventListener(t,o,r)}}function ytr(e={}){const{onClose:t,onOpen:n,isOpen:r,id:o}=e,i=$de(n),s=$de(t),[l,c]=f.useState(e.defaultIsOpen||!1),u=r!==void 0?r:l,d=r!==void 0,p=f.useId(),h=o??`disclosure-${p}`,m=f.useCallback(()=>{d||c(!1),s==null||s()},[d,s]),g=f.useCallback(()=>{d||c(!0),i==null||i()},[d,i]),y=f.useCallback(()=>{u?m():g()},[u,g,m]);function x(b={}){return{...b,"aria-expanded":u,"aria-controls":h,onClick(w){var S;(S=b.onClick)==null||S.call(b,w),y()}}}function v(b={}){return{...b,hidden:!u,id:h}}return{isOpen:u,onOpen:g,onClose:m,onToggle:y,isControlled:d,getButtonProps:x,getDisclosureProps:v}}const iW=globalThis!=null&&globalThis.document?f.useLayoutEffect:f.useEffect;function vtr(e,t){if(e!=null){if(typeof e=="function"){e(t);return}try{e.current=t}catch{throw new Error(`Cannot assign value '${t}' to ref '${e}'`)}}}function OC(...e){return t=>{e.forEach(n=>{vtr(n,t)})}}function btr(...e){return f.useMemo(()=>OC(...e),e)}const yd={open:(e,t)=>`${e}[data-open], ${e}[open], ${e}[data-state=open] ${t}`,closed:(e,t)=>`${e}[data-closed], ${e}[data-state=closed] ${t}`,hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},Qy=e=>Mdt(t=>e(t,"&"),"[role=group]","[data-group]",".group"),n1=e=>Mdt(t=>e(t,"~ &"),"[data-peer]",".peer"),Mdt=(e,...t)=>t.map(e).join(", "),Kve={_hover:"&:hover, &[data-hover]",_active:"&:active, &[data-active]",_focus:"&:focus, &[data-focus]",_highlighted:"&[data-highlighted]",_focusWithin:"&:focus-within, &[data-focus-within]",_focusVisible:"&:focus-visible, &[data-focus-visible]",_disabled:"&:disabled, &[disabled], &[aria-disabled=true], &[data-disabled]",_readOnly:"&[aria-readonly=true], &[readonly], &[data-readonly]",_before:"&::before",_after:"&::after",_empty:"&:empty, &[data-empty]",_expanded:"&[aria-expanded=true], &[data-expanded], &[data-state=expanded]",_checked:"&[aria-checked=true], &[data-checked], &[data-state=checked]",_grabbed:"&[aria-grabbed=true], &[data-grabbed]",_pressed:"&[aria-pressed=true], &[data-pressed]",_invalid:"&[aria-invalid=true], &[data-invalid]",_valid:"&[data-valid], &[data-state=valid]",_loading:"&[data-loading], &[aria-busy=true]",_selected:"&[aria-selected=true], &[data-selected]",_hidden:"&[hidden], &[data-hidden]",_autofill:"&:-webkit-autofill",_even:"&:nth-of-type(even)",_odd:"&:nth-of-type(odd)",_first:"&:first-of-type",_firstLetter:"&::first-letter",_last:"&:last-of-type",_notFirst:"&:not(:first-of-type)",_notLast:"&:not(:last-of-type)",_visited:"&:visited",_activeLink:"&[aria-current=page]",_activeStep:"&[aria-current=step]",_indeterminate:"&:indeterminate, &[aria-checked=mixed], &[data-indeterminate], &[data-state=indeterminate]",_groupOpen:Qy(yd.open),_groupClosed:Qy(yd.closed),_groupHover:Qy(yd.hover),_peerHover:n1(yd.hover),_groupFocus:Qy(yd.focus),_peerFocus:n1(yd.focus),_groupFocusVisible:Qy(yd.focusVisible),_peerFocusVisible:n1(yd.focusVisible),_groupActive:Qy(yd.active),_peerActive:n1(yd.active),_groupDisabled:Qy(yd.disabled),_peerDisabled:n1(yd.disabled),_groupInvalid:Qy(yd.invalid),_peerInvalid:n1(yd.invalid),_groupChecked:Qy(yd.checked),_peerChecked:n1(yd.checked),_groupFocusWithin:Qy(yd.focusWithin),_peerFocusWithin:n1(yd.focusWithin),_peerPlaceholderShown:n1(yd.placeholderShown),_placeholder:"&::placeholder, &[data-placeholder]",_placeholderShown:"&:placeholder-shown, &[data-placeholder-shown]",_fullScreen:"&:fullscreen, &[data-fullscreen]",_selection:"&::selection",_rtl:"[dir=rtl] &, &[dir=rtl]",_ltr:"[dir=ltr] &, &[dir=ltr]",_mediaDark:"@media (prefers-color-scheme: dark)",_mediaReduceMotion:"@media (prefers-reduced-motion: reduce)",_dark:".chakra-ui-dark &:not([data-theme]),[data-theme=dark] &:not([data-theme]),&[data-theme=dark]",_light:".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]",_open:"&[data-open], &[open], &[data-state=open]",_closed:"&[data-closed], &[data-state=closed]",_complete:"&[data-complete]",_incomplete:"&[data-incomplete]",_current:"&[data-current]"},wtr=Object.keys(Kve),Str=e=>/!(important)?$/.test(e),pLe=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,Ctr=(e,t)=>n=>{const r=String(t),o=Str(r),i=pLe(r),s=e?`${e}.${i}`:i;let l=ew(n.__cssMap)&&s in n.__cssMap?n.__cssMap[s].varRef:t;return l=pLe(l),o?`${l} !important`:l};function Yve(e){const{scale:t,transform:n,compose:r}=e;return(i,s)=>{const l=Ctr(t,i)(s);let c=(n==null?void 0:n(l,s))??l;return r&&(c=r(c,s)),c}}const R7=(...e)=>t=>e.reduce((n,r)=>r(n),t);function zg(e,t){return n=>{const r={property:n,scale:e};return r.transform=Yve({scale:e,transform:t}),r}}const Ntr=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function jtr(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:Ntr(t),transform:n?Yve({scale:n,compose:r}):r}}const Rdt=["rotate(var(--chakra-rotate, 0))","scaleX(var(--chakra-scale-x, 1))","scaleY(var(--chakra-scale-y, 1))","skewX(var(--chakra-skew-x, 0))","skewY(var(--chakra-skew-y, 0))"];function Etr(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...Rdt].join(" ")}function Itr(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...Rdt].join(" ")}const _tr={"--chakra-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-sepia":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-drop-shadow":"var(--chakra-empty,/*!*/ /*!*/)",filter:["var(--chakra-blur)","var(--chakra-brightness)","var(--chakra-contrast)","var(--chakra-grayscale)","var(--chakra-hue-rotate)","var(--chakra-invert)","var(--chakra-saturate)","var(--chakra-sepia)","var(--chakra-drop-shadow)"].join(" ")},Ptr={backdropFilter:["var(--chakra-backdrop-blur)","var(--chakra-backdrop-brightness)","var(--chakra-backdrop-contrast)","var(--chakra-backdrop-grayscale)","var(--chakra-backdrop-hue-rotate)","var(--chakra-backdrop-invert)","var(--chakra-backdrop-opacity)","var(--chakra-backdrop-saturate)","var(--chakra-backdrop-sepia)"].join(" "),"--chakra-backdrop-blur":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-brightness":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-contrast":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-grayscale":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-hue-rotate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-invert":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-opacity":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-saturate":"var(--chakra-empty,/*!*/ /*!*/)","--chakra-backdrop-sepia":"var(--chakra-empty,/*!*/ /*!*/)"};function Atr(e){return{"--chakra-ring-offset-shadow":"var(--chakra-ring-inset) 0 0 0 var(--chakra-ring-offset-width) var(--chakra-ring-offset-color)","--chakra-ring-shadow":"var(--chakra-ring-inset) 0 0 0 calc(var(--chakra-ring-width) + var(--chakra-ring-offset-width)) var(--chakra-ring-color)","--chakra-ring-width":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}const Ttr={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},Dde={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},ktr=new Set(Object.values(Dde)),Lde=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),Mtr=e=>e.trim();function Rtr(e,t){if(e==null||Lde.has(e))return e;if(!(Fde(e)||Lde.has(e)))return`url('${e}')`;const o=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),i=o==null?void 0:o[1],s=o==null?void 0:o[2];if(!i||!s)return e;const l=i.includes("-gradient")?i:`${i}-gradient`,[c,...u]=s.split(",").map(Mtr).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const d=c in Dde?Dde[c]:c;u.unshift(d);const p=u.map(h=>{if(ktr.has(h))return h;const m=h.indexOf(" "),[g,y]=m!==-1?[h.substr(0,m),h.substr(m+1)]:[h],x=Fde(y)?y:y&&y.split(" "),v=`colors.${g}`,b=v in t.__cssMap?t.__cssMap[v].varRef:g;return x?[b,...Array.isArray(x)?x:[x]].join(" "):b});return`${l}(${p.join(", ")})`}const Fde=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),Otr=(e,t)=>Rtr(e,t??{});function $tr(e){return/^var\(--.+\)$/.test(e)}const Dtr=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Jy=e=>t=>`${e}(${t})`,wa={filter(e){return e!=="auto"?e:_tr},backdropFilter(e){return e!=="auto"?e:Ptr},ring(e){return Atr(wa.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?Etr():e==="auto-gpu"?Itr():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=Dtr(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if($tr(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:Otr,blur:Jy("blur"),opacity:Jy("opacity"),brightness:Jy("brightness"),contrast:Jy("contrast"),dropShadow:Jy("drop-shadow"),grayscale:Jy("grayscale"),hueRotate:e=>Jy("hue-rotate")(wa.degree(e)),invert:Jy("invert"),saturate:Jy("saturate"),sepia:Jy("sepia"),bgImage(e){return e==null||Fde(e)||Lde.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){const{space:t,divide:n}=Ttr[e]??{},r={flexDirection:e};return t&&(r[t]=1),n&&(r[n]=1),r}},Qt={borderWidths:zg("borderWidths"),borderStyles:zg("borderStyles"),colors:zg("colors"),borders:zg("borders"),gradients:zg("gradients",wa.gradient),radii:zg("radii",wa.px),space:zg("space",R7(wa.vh,wa.px)),spaceT:zg("space",R7(wa.vh,wa.px)),degreeT(e){return{property:e,transform:wa.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:Yve({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:zg("sizes",R7(wa.vh,wa.px)),sizesT:zg("sizes",R7(wa.vh,wa.fraction)),shadows:zg("shadows"),logical:jtr,blur:zg("blur",wa.blur)},_B={background:Qt.colors("background"),backgroundColor:Qt.colors("backgroundColor"),backgroundImage:Qt.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:wa.bgClip},bgSize:Qt.prop("backgroundSize"),bgPosition:Qt.prop("backgroundPosition"),bg:Qt.colors("background"),bgColor:Qt.colors("backgroundColor"),bgPos:Qt.prop("backgroundPosition"),bgRepeat:Qt.prop("backgroundRepeat"),bgAttachment:Qt.prop("backgroundAttachment"),bgGradient:Qt.gradients("backgroundImage"),bgClip:{transform:wa.bgClip}};Object.assign(_B,{bgImage:_B.backgroundImage,bgImg:_B.backgroundImage});const rs={border:Qt.borders("border"),borderWidth:Qt.borderWidths("borderWidth"),borderStyle:Qt.borderStyles("borderStyle"),borderColor:Qt.colors("borderColor"),borderRadius:Qt.radii("borderRadius"),borderTop:Qt.borders("borderTop"),borderBlockStart:Qt.borders("borderBlockStart"),borderTopLeftRadius:Qt.radii("borderTopLeftRadius"),borderStartStartRadius:Qt.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:Qt.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:Qt.radii("borderTopRightRadius"),borderStartEndRadius:Qt.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:Qt.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:Qt.borders("borderRight"),borderInlineEnd:Qt.borders("borderInlineEnd"),borderBottom:Qt.borders("borderBottom"),borderBlockEnd:Qt.borders("borderBlockEnd"),borderBottomLeftRadius:Qt.radii("borderBottomLeftRadius"),borderBottomRightRadius:Qt.radii("borderBottomRightRadius"),borderLeft:Qt.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:Qt.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:Qt.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:Qt.borders(["borderLeft","borderRight"]),borderInline:Qt.borders("borderInline"),borderY:Qt.borders(["borderTop","borderBottom"]),borderBlock:Qt.borders("borderBlock"),borderTopWidth:Qt.borderWidths("borderTopWidth"),borderBlockStartWidth:Qt.borderWidths("borderBlockStartWidth"),borderTopColor:Qt.colors("borderTopColor"),borderBlockStartColor:Qt.colors("borderBlockStartColor"),borderTopStyle:Qt.borderStyles("borderTopStyle"),borderBlockStartStyle:Qt.borderStyles("borderBlockStartStyle"),borderBottomWidth:Qt.borderWidths("borderBottomWidth"),borderBlockEndWidth:Qt.borderWidths("borderBlockEndWidth"),borderBottomColor:Qt.colors("borderBottomColor"),borderBlockEndColor:Qt.colors("borderBlockEndColor"),borderBottomStyle:Qt.borderStyles("borderBottomStyle"),borderBlockEndStyle:Qt.borderStyles("borderBlockEndStyle"),borderLeftWidth:Qt.borderWidths("borderLeftWidth"),borderInlineStartWidth:Qt.borderWidths("borderInlineStartWidth"),borderLeftColor:Qt.colors("borderLeftColor"),borderInlineStartColor:Qt.colors("borderInlineStartColor"),borderLeftStyle:Qt.borderStyles("borderLeftStyle"),borderInlineStartStyle:Qt.borderStyles("borderInlineStartStyle"),borderRightWidth:Qt.borderWidths("borderRightWidth"),borderInlineEndWidth:Qt.borderWidths("borderInlineEndWidth"),borderRightColor:Qt.colors("borderRightColor"),borderInlineEndColor:Qt.colors("borderInlineEndColor"),borderRightStyle:Qt.borderStyles("borderRightStyle"),borderInlineEndStyle:Qt.borderStyles("borderInlineEndStyle"),borderTopRadius:Qt.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:Qt.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:Qt.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:Qt.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(rs,{rounded:rs.borderRadius,roundedTop:rs.borderTopRadius,roundedTopLeft:rs.borderTopLeftRadius,roundedTopRight:rs.borderTopRightRadius,roundedTopStart:rs.borderStartStartRadius,roundedTopEnd:rs.borderStartEndRadius,roundedBottom:rs.borderBottomRadius,roundedBottomLeft:rs.borderBottomLeftRadius,roundedBottomRight:rs.borderBottomRightRadius,roundedBottomStart:rs.borderEndStartRadius,roundedBottomEnd:rs.borderEndEndRadius,roundedLeft:rs.borderLeftRadius,roundedRight:rs.borderRightRadius,roundedStart:rs.borderInlineStartRadius,roundedEnd:rs.borderInlineEndRadius,borderStart:rs.borderInlineStart,borderEnd:rs.borderInlineEnd,borderTopStartRadius:rs.borderStartStartRadius,borderTopEndRadius:rs.borderStartEndRadius,borderBottomStartRadius:rs.borderEndStartRadius,borderBottomEndRadius:rs.borderEndEndRadius,borderStartRadius:rs.borderInlineStartRadius,borderEndRadius:rs.borderInlineEndRadius,borderStartWidth:rs.borderInlineStartWidth,borderEndWidth:rs.borderInlineEndWidth,borderStartColor:rs.borderInlineStartColor,borderEndColor:rs.borderInlineEndColor,borderStartStyle:rs.borderInlineStartStyle,borderEndStyle:rs.borderInlineEndStyle});const Ltr={color:Qt.colors("color"),textColor:Qt.colors("color"),fill:Qt.colors("fill"),stroke:Qt.colors("stroke"),accentColor:Qt.colors("accentColor"),textFillColor:Qt.colors("textFillColor")},aW={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:wa.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:Qt.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:Qt.space("gap"),rowGap:Qt.space("rowGap"),columnGap:Qt.space("columnGap")};Object.assign(aW,{flexDir:aW.flexDirection});const Gg={width:Qt.sizesT("width"),inlineSize:Qt.sizesT("inlineSize"),height:Qt.sizes("height"),blockSize:Qt.sizes("blockSize"),boxSize:Qt.sizes(["width","height"]),minWidth:Qt.sizes("minWidth"),minInlineSize:Qt.sizes("minInlineSize"),minHeight:Qt.sizes("minHeight"),minBlockSize:Qt.sizes("minBlockSize"),maxWidth:Qt.sizes("maxWidth"),maxInlineSize:Qt.sizes("maxInlineSize"),maxHeight:Qt.sizes("maxHeight"),maxBlockSize:Qt.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var o,i;return{[`@media screen and (min-width: ${((i=(o=t.__breakpoints)==null?void 0:o.get(e))==null?void 0:i.minW)??e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var o,i;return{[`@media screen and (max-width: ${((i=(o=t.__breakpoints)==null?void 0:o.get(e))==null?void 0:i._minW)??e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:Qt.propT("float",wa.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(Gg,{w:Gg.width,h:Gg.height,minW:Gg.minWidth,maxW:Gg.maxWidth,minH:Gg.minHeight,maxH:Gg.maxHeight,overscroll:Gg.overscrollBehavior,overscrollX:Gg.overscrollBehaviorX,overscrollY:Gg.overscrollBehaviorY});const Ftr={filter:{transform:wa.filter},blur:Qt.blur("--chakra-blur"),brightness:Qt.propT("--chakra-brightness",wa.brightness),contrast:Qt.propT("--chakra-contrast",wa.contrast),hueRotate:Qt.propT("--chakra-hue-rotate",wa.hueRotate),invert:Qt.propT("--chakra-invert",wa.invert),saturate:Qt.propT("--chakra-saturate",wa.saturate),dropShadow:Qt.propT("--chakra-drop-shadow",wa.dropShadow),backdropFilter:{transform:wa.backdropFilter},backdropBlur:Qt.blur("--chakra-backdrop-blur"),backdropBrightness:Qt.propT("--chakra-backdrop-brightness",wa.brightness),backdropContrast:Qt.propT("--chakra-backdrop-contrast",wa.contrast),backdropHueRotate:Qt.propT("--chakra-backdrop-hue-rotate",wa.hueRotate),backdropInvert:Qt.propT("--chakra-backdrop-invert",wa.invert),backdropSaturate:Qt.propT("--chakra-backdrop-saturate",wa.saturate)},ztr={ring:{transform:wa.ring},ringColor:Qt.colors("--chakra-ring-color"),ringOffset:Qt.prop("--chakra-ring-offset-width"),ringOffsetColor:Qt.colors("--chakra-ring-offset-color"),ringInset:Qt.prop("--chakra-ring-inset")},Btr={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:wa.outline},outlineOffset:!0,outlineColor:Qt.colors("outlineColor")},Odt={gridGap:Qt.space("gridGap"),gridColumnGap:Qt.space("gridColumnGap"),gridRowGap:Qt.space("gridRowGap"),gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridColumnStart:!0,gridColumnEnd:!0,gridRowStart:!0,gridRowEnd:!0,gridAutoRows:!0,gridTemplate:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0};function Htr(e,t,n,r){const o=typeof t=="string"?t.split("."):[t];for(r=0;r{const t=new WeakMap;return(r,o,i,s)=>{if(typeof r>"u")return e(r,o,i);t.has(r)||t.set(r,new Map);const l=t.get(r);if(l.has(o))return l.get(o);const c=e(r,o,i,s);return l.set(o,c),c}},Utr=Vtr(Htr),Wtr={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},Gtr={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},Yte=(e,t,n)=>{const r={},o=Utr(e,t,{});for(const i in o)i in n&&n[i]!=null||(r[i]=o[i]);return r},qtr={srOnly:{transform(e){return e===!0?Wtr:e==="focusable"?Gtr:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>Yte(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>Yte(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>Yte(t,e,n)}},FO={position:!0,pos:Qt.prop("position"),zIndex:Qt.prop("zIndex","zIndices"),inset:Qt.spaceT("inset"),insetX:Qt.spaceT(["left","right"]),insetInline:Qt.spaceT("insetInline"),insetY:Qt.spaceT(["top","bottom"]),insetBlock:Qt.spaceT("insetBlock"),top:Qt.spaceT("top"),insetBlockStart:Qt.spaceT("insetBlockStart"),bottom:Qt.spaceT("bottom"),insetBlockEnd:Qt.spaceT("insetBlockEnd"),left:Qt.spaceT("left"),insetInlineStart:Qt.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:Qt.spaceT("right"),insetInlineEnd:Qt.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(FO,{insetStart:FO.insetInlineStart,insetEnd:FO.insetInlineEnd});const zde={boxShadow:Qt.shadows("boxShadow"),mixBlendMode:!0,blendMode:Qt.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:Qt.prop("backgroundBlendMode"),opacity:!0};Object.assign(zde,{shadow:zde.boxShadow});const Hl={margin:Qt.spaceT("margin"),marginTop:Qt.spaceT("marginTop"),marginBlockStart:Qt.spaceT("marginBlockStart"),marginRight:Qt.spaceT("marginRight"),marginInlineEnd:Qt.spaceT("marginInlineEnd"),marginBottom:Qt.spaceT("marginBottom"),marginBlockEnd:Qt.spaceT("marginBlockEnd"),marginLeft:Qt.spaceT("marginLeft"),marginInlineStart:Qt.spaceT("marginInlineStart"),marginX:Qt.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:Qt.spaceT("marginInline"),marginY:Qt.spaceT(["marginTop","marginBottom"]),marginBlock:Qt.spaceT("marginBlock"),padding:Qt.space("padding"),paddingTop:Qt.space("paddingTop"),paddingBlockStart:Qt.space("paddingBlockStart"),paddingRight:Qt.space("paddingRight"),paddingBottom:Qt.space("paddingBottom"),paddingBlockEnd:Qt.space("paddingBlockEnd"),paddingLeft:Qt.space("paddingLeft"),paddingInlineStart:Qt.space("paddingInlineStart"),paddingInlineEnd:Qt.space("paddingInlineEnd"),paddingX:Qt.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:Qt.space("paddingInline"),paddingY:Qt.space(["paddingTop","paddingBottom"]),paddingBlock:Qt.space("paddingBlock")};Object.assign(Hl,{m:Hl.margin,mt:Hl.marginTop,mr:Hl.marginRight,me:Hl.marginInlineEnd,marginEnd:Hl.marginInlineEnd,mb:Hl.marginBottom,ml:Hl.marginLeft,ms:Hl.marginInlineStart,marginStart:Hl.marginInlineStart,mx:Hl.marginX,my:Hl.marginY,p:Hl.padding,pt:Hl.paddingTop,py:Hl.paddingY,px:Hl.paddingX,pb:Hl.paddingBottom,pl:Hl.paddingLeft,ps:Hl.paddingInlineStart,paddingStart:Hl.paddingInlineStart,pr:Hl.paddingRight,pe:Hl.paddingInlineEnd,paddingEnd:Hl.paddingInlineEnd});const Ktr={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:Qt.spaceT("scrollMargin"),scrollMarginTop:Qt.spaceT("scrollMarginTop"),scrollMarginBottom:Qt.spaceT("scrollMarginBottom"),scrollMarginLeft:Qt.spaceT("scrollMarginLeft"),scrollMarginRight:Qt.spaceT("scrollMarginRight"),scrollMarginX:Qt.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:Qt.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:Qt.spaceT("scrollPadding"),scrollPaddingTop:Qt.spaceT("scrollPaddingTop"),scrollPaddingBottom:Qt.spaceT("scrollPaddingBottom"),scrollPaddingLeft:Qt.spaceT("scrollPaddingLeft"),scrollPaddingRight:Qt.spaceT("scrollPaddingRight"),scrollPaddingX:Qt.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:Qt.spaceT(["scrollPaddingTop","scrollPaddingBottom"])},Ytr={fontFamily:Qt.prop("fontFamily","fonts"),fontSize:Qt.prop("fontSize","fontSizes",wa.px),fontWeight:Qt.prop("fontWeight","fontWeights"),lineHeight:Qt.prop("lineHeight","lineHeights"),letterSpacing:Qt.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!0)return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}},noOfLines:{static:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"var(--chakra-line-clamp)"},property:"--chakra-line-clamp"}},Xtr={textDecorationColor:Qt.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:Qt.shadows("textShadow")},Qtr={clipPath:!0,transform:Qt.propT("transform",wa.transform),transformOrigin:!0,translateX:Qt.spaceT("--chakra-translate-x"),translateY:Qt.spaceT("--chakra-translate-y"),skewX:Qt.degreeT("--chakra-skew-x"),skewY:Qt.degreeT("--chakra-skew-y"),scaleX:Qt.prop("--chakra-scale-x"),scaleY:Qt.prop("--chakra-scale-y"),scale:Qt.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:Qt.degreeT("--chakra-rotate")},Jtr={listStyleType:!0,listStylePosition:!0,listStylePos:Qt.prop("listStylePosition"),listStyleImage:!0,listStyleImg:Qt.prop("listStyleImage")},Ztr={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:Qt.prop("transitionDuration","transition.duration"),transitionProperty:Qt.prop("transitionProperty","transition.property"),transitionTimingFunction:Qt.prop("transitionTimingFunction","transition.easing")},Xve=U1({},_B,rs,Ltr,aW,Gg,Ftr,ztr,Btr,Odt,qtr,FO,zde,Hl,Ktr,Ytr,Xtr,Qtr,Jtr,Ztr);Object.assign({},Hl,Gg,aW,Odt,FO);const enr=[...Object.keys(Xve),...wtr],tnr={...Xve,...Kve},nnr=e=>e in tnr,rnr=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:o}=t.__breakpoints,i={};for(const s in e){let l=Ov(e[s],t);if(l==null)continue;if(l=ew(l)&&n(l)?r(l):l,!Array.isArray(l)){i[s]=l;continue}const c=l.slice(0,o.length).length;for(let u=0;ue.startsWith("--")&&typeof t=="string"&&!inr(t),snr=(e,t)=>{if(t==null)return t;const n=s=>{var l,c;return(c=(l=e.__cssMap)==null?void 0:l[s])==null?void 0:c.varRef},r=s=>n(s)??s,[o,i]=onr(t);return t=n(o)??r(i)??r(t),t};function lnr(e){const{configs:t={},pseudos:n={},theme:r}=e,o=(i,s=!1)=>{var d;const l=Ov(i,r),c=rnr(l)(r);let u={};for(let p in c){const h=c[p];let m=Ov(h,r);p in n&&(p=n[p]),anr(p,m)&&(m=snr(r,m));let g=t[p];if(g===!0&&(g={property:p}),ew(m)){u[p]=u[p]??{},u[p]=U1({},u[p],o(m,!0));continue}let y=((d=g==null?void 0:g.transform)==null?void 0:d.call(g,m,r,l))??m;y=g!=null&&g.processResult?o(y,!0):y;const x=Ov(g==null?void 0:g.property,r);if(!s&&(g!=null&&g.static)){const v=Ov(g.static,r);u=U1({},u,v)}if(x&&Array.isArray(x)){for(const v of x)u[v]=y;continue}if(x){x==="&"&&ew(y)?u=U1({},u,y):u[x]=y;continue}if(ew(y)){u=U1({},u,y);continue}u[p]=y}return u};return o}const cnr=e=>t=>lnr({theme:t,pseudos:Kve,configs:Xve})(e);function unr(e,t,n){var r,o;return((o=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:o.varRef)??n}function dnr(e,t){if(Array.isArray(e))return e;if(ew(e))return t(e);if(e!=null)return[e]}function fnr(e,t){for(let n=t+1;n{U1(l,{[w]:d?b[w]:{[v]:b[w]}})});continue}if(!p){d?U1(l,b):l[v]=b;continue}l[v]=b}}return l}}function hnr(e){return t=>{const{variant:n,size:r,theme:o}=t,i=pnr(o);return U1({},Ov(e.baseStyle??{},t),i(e,"sizes",r,t),i(e,"variants",n,t))}}function yg(e){return Adt(e,["styleConfig","size","variant","colorScheme"])}const $dt=f.createContext({});$dt.displayName="ColorModeContext";function Ddt(){const e=f.useContext($dt);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}const[Kno,mnr]=Y0({strict:!1,name:"PortalManagerContext"}),Ldt=f.createContext({getDocument(){return document},getWindow(){return window}});Ldt.displayName="EnvironmentContext";function gnr({defer:e}={}){const[,t]=f.useReducer(n=>n+1,0);return iW(()=>{e&&t()},[e]),f.useContext(Ldt)}const Qve=f.createContext({});function Jve(e){const t=f.useRef(null);return t.current===null&&(t.current=e()),t.current}const Fdt=typeof window<"u",zdt=Fdt?f.useLayoutEffect:f.useEffect,uY=f.createContext(null);function Zve(e,t){e.indexOf(t)===-1&&e.push(t)}function ebe(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const yb=(e,t,n)=>n>t?t:n{};const Ew={},Bdt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Hdt(e){return typeof e=="object"&&e!==null}const Vdt=e=>/^0[^.\s]+$/u.test(e);function nbe(e){let t;return()=>(t===void 0&&(t=e()),t)}const C0=e=>e,xnr=(e,t)=>n=>t(e(n)),y6=(...e)=>e.reduce(xnr),q$=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class rbe{constructor(){this.subscriptions=[]}add(t){return Zve(this.subscriptions,t),()=>ebe(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;ie*1e3,g0=e=>e/1e3;function Udt(e,t){return t?e*(1e3/t):0}const Wdt=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,ynr=1e-7,vnr=12;function bnr(e,t,n,r,o){let i,s,l=0;do s=t+(n-t)/2,i=Wdt(s,r,o)-e,i>0?n=s:t=s;while(Math.abs(i)>ynr&&++lbnr(i,0,1,e,n);return i=>i===0||i===1?i:Wdt(o(i),t,r)}const Gdt=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,qdt=e=>t=>1-e(1-t),Kdt=v6(.33,1.53,.69,.99),obe=qdt(Kdt),Ydt=Gdt(obe),Xdt=e=>(e*=2)<1?.5*obe(e):.5*(2-Math.pow(2,-10*(e-1))),ibe=e=>1-Math.sin(Math.acos(e)),Qdt=qdt(ibe),Jdt=Gdt(ibe),wnr=v6(.42,0,1,1),Snr=v6(0,0,.58,1),Zdt=v6(.42,0,.58,1),Cnr=e=>Array.isArray(e)&&typeof e[0]!="number",eft=e=>Array.isArray(e)&&typeof e[0]=="number",Nnr={linear:C0,easeIn:wnr,easeInOut:Zdt,easeOut:Snr,circIn:ibe,circInOut:Jdt,circOut:Qdt,backIn:obe,backInOut:Ydt,backOut:Kdt,anticipate:Xdt},jnr=e=>typeof e=="string",hLe=e=>{if(eft(e)){tbe(e.length===4);const[t,n,r,o]=e;return v6(t,n,r,o)}else if(jnr(e))return Nnr[e];return e},O7=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Enr(e,t){let n=new Set,r=new Set,o=!1,i=!1;const s=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){s.has(d)&&(u.schedule(d),e()),d(l)}const u={schedule:(d,p=!1,h=!1)=>{const g=h&&o?n:r;return p&&s.add(d),g.has(d)||g.add(d),d},cancel:d=>{r.delete(d),s.delete(d)},process:d=>{if(l=d,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(c),n.clear(),o=!1,i&&(i=!1,u.process(d))}};return u}const Inr=40;function tft(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,s=O7.reduce((w,S)=>(w[S]=Enr(i),w),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:p,preRender:h,render:m,postRender:g}=s,y=()=>{const w=Ew.useManualTiming?o.timestamp:performance.now();n=!1,Ew.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(w-o.timestamp,Inr),1)),o.timestamp=w,o.isProcessing=!0,l.process(o),c.process(o),u.process(o),d.process(o),p.process(o),h.process(o),m.process(o),g.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(y))},x=()=>{n=!0,r=!0,o.isProcessing||e(y)};return{schedule:O7.reduce((w,S)=>{const C=s[S];return w[S]=(N,j=!1,I=!1)=>(n||x(),C.schedule(N,j,I)),w},{}),cancel:w=>{for(let S=0;S(PB===void 0&&mh.set(Mf.isProcessing||Ew.useManualTiming?Mf.timestamp:performance.now()),PB),set:e=>{PB=e,queueMicrotask(_nr)}},nft=e=>t=>typeof t=="string"&&t.startsWith(e),rft=nft("--"),Pnr=nft("var(--"),abe=e=>Pnr(e)?Anr.test(e.split("/*")[0].trim()):!1,Anr=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function mLe(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const e4={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},K$={...e4,transform:e=>yb(0,1,e)},$7={...e4,default:1},zO=e=>Math.round(e*1e5)/1e5,sbe=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Tnr(e){return e==null}const knr=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,lbe=(e,t)=>n=>!!(typeof n=="string"&&knr.test(n)&&n.startsWith(e)||t&&!Tnr(n)&&Object.prototype.hasOwnProperty.call(n,t)),oft=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,s,l]=r.match(sbe);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:l!==void 0?parseFloat(l):1}},Mnr=e=>yb(0,255,e),Qte={...e4,transform:e=>Math.round(Mnr(e))},lE={test:lbe("rgb","red"),parse:oft("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Qte.transform(e)+", "+Qte.transform(t)+", "+Qte.transform(n)+", "+zO(K$.transform(r))+")"};function Rnr(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const Bde={test:lbe("#"),parse:Rnr,transform:lE.transform},b6=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),YS=b6("deg"),Zv=b6("%"),so=b6("px"),Onr=b6("vh"),$nr=b6("vw"),gLe={...Zv,parse:e=>Zv.parse(e)/100,transform:e=>Zv.transform(e*100)},$P={test:lbe("hsl","hue"),parse:oft("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Zv.transform(zO(t))+", "+Zv.transform(zO(n))+", "+zO(K$.transform(r))+")"},Zu={test:e=>lE.test(e)||Bde.test(e)||$P.test(e),parse:e=>lE.test(e)?lE.parse(e):$P.test(e)?$P.parse(e):Bde.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?lE.transform(e):$P.transform(e),getAnimatableNone:e=>{const t=Zu.parse(e);return t.alpha=0,Zu.transform(t)}},Dnr=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Lnr(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(sbe))==null?void 0:t.length)||0)+(((n=e.match(Dnr))==null?void 0:n.length)||0)>0}const ift="number",aft="color",Fnr="var",znr="var(",xLe="${}",Bnr=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Y$(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const l=t.replace(Bnr,c=>(Zu.test(c)?(r.color.push(i),o.push(aft),n.push(Zu.parse(c))):c.startsWith(znr)?(r.var.push(i),o.push(Fnr),n.push(c)):(r.number.push(i),o.push(ift),n.push(parseFloat(c))),++i,xLe)).split(xLe);return{values:n,split:l,indexes:r,types:o}}function sft(e){return Y$(e).values}function lft(e){const{split:t,types:n}=Y$(e),r=t.length;return o=>{let i="";for(let s=0;stypeof e=="number"?0:Zu.test(e)?Zu.getAnimatableNone(e):e;function Vnr(e){const t=sft(e);return lft(e)(t.map(Hnr))}const DC={test:Lnr,parse:sft,createTransformer:lft,getAnimatableNone:Vnr};function Jte(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Unr({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,s=0;if(!t)o=i=s=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;o=Jte(c,l,e+1/3),i=Jte(c,l,e),s=Jte(c,l,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(s*255),alpha:r}}function sW(e,t){return n=>n>0?t:e}const $c=(e,t,n)=>e+(t-e)*n,Zte=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},Wnr=[Bde,lE,$P],Gnr=e=>Wnr.find(t=>t.test(e));function yLe(e){const t=Gnr(e);if(!t)return!1;let n=t.parse(e);return t===$P&&(n=Unr(n)),n}const vLe=(e,t)=>{const n=yLe(e),r=yLe(t);if(!n||!r)return sW(e,t);const o={...n};return i=>(o.red=Zte(n.red,r.red,i),o.green=Zte(n.green,r.green,i),o.blue=Zte(n.blue,r.blue,i),o.alpha=$c(n.alpha,r.alpha,i),lE.transform(o))},Hde=new Set(["none","hidden"]);function qnr(e,t){return Hde.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Knr(e,t){return n=>$c(e,t,n)}function cbe(e){return typeof e=="number"?Knr:typeof e=="string"?abe(e)?sW:Zu.test(e)?vLe:Qnr:Array.isArray(e)?cft:typeof e=="object"?Zu.test(e)?vLe:Ynr:sW}function cft(e,t){const n=[...e],r=n.length,o=e.map((i,s)=>cbe(i)(i,t[s]));return i=>{for(let s=0;s{for(const i in r)n[i]=r[i](o);return n}}function Xnr(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o{const n=DC.createTransformer(t),r=Y$(e),o=Y$(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?Hde.has(e)&&!o.values.length||Hde.has(t)&&!r.values.length?qnr(e,t):y6(cft(Xnr(r,o),o.values),n):sW(e,t)};function uft(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?$c(e,t,n):cbe(e)(e,t)}const Jnr=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Ql.update(t,n),stop:()=>$C(t),now:()=>Mf.isProcessing?Mf.timestamp:mh.now()}},dft=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i=lW?1/0:t}function Znr(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(ube(r),lW);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:g0(o)}}const err=5;function fft(e,t,n){const r=Math.max(t-err,0);return Udt(n-e(r),t-r)}const nu={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},ene=.001;function trr({duration:e=nu.duration,bounce:t=nu.bounce,velocity:n=nu.velocity,mass:r=nu.mass}){let o,i,s=1-t;s=yb(nu.minDamping,nu.maxDamping,s),e=yb(nu.minDuration,nu.maxDuration,g0(e)),s<1?(o=u=>{const d=u*s,p=d*e,h=d-n,m=Vde(u,s),g=Math.exp(-p);return ene-h/m*g},i=u=>{const p=u*s*e,h=p*n+n,m=Math.pow(s,2)*Math.pow(u,2)*e,g=Math.exp(-p),y=Vde(Math.pow(u,2),s);return(-o(u)+ene>0?-1:1)*((h-m)*g)/y}):(o=u=>{const d=Math.exp(-u*e),p=(u-n)*e+1;return-ene+d*p},i=u=>{const d=Math.exp(-u*e),p=(n-u)*(e*e);return d*p});const l=5/e,c=rrr(o,i,l);if(e=tw(e),isNaN(c))return{stiffness:nu.stiffness,damping:nu.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:s*2*Math.sqrt(r*u),duration:e}}}const nrr=12;function rrr(e,t,n){let r=n;for(let o=1;oe[n]!==void 0)}function arr(e){let t={velocity:nu.velocity,stiffness:nu.stiffness,damping:nu.damping,mass:nu.mass,isResolvedFromDuration:!1,...e};if(!bLe(e,irr)&&bLe(e,orr))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*yb(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:nu.mass,stiffness:o,damping:i}}else{const n=trr(e);t={...t,...n,mass:nu.mass},t.isResolvedFromDuration=!0}return t}function cW(e=nu.visualDuration,t=nu.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:p,velocity:h,isResolvedFromDuration:m}=arr({...n,velocity:-g0(n.velocity||0)}),g=h||0,y=u/(2*Math.sqrt(c*d)),x=s-i,v=g0(Math.sqrt(c/d)),b=Math.abs(x)<5;r||(r=b?nu.restSpeed.granular:nu.restSpeed.default),o||(o=b?nu.restDelta.granular:nu.restDelta.default);let w;if(y<1){const C=Vde(v,y);w=N=>{const j=Math.exp(-y*v*N);return s-j*((g+y*v*x)/C*Math.sin(C*N)+x*Math.cos(C*N))}}else if(y===1)w=C=>s-Math.exp(-v*C)*(x+(g+v*x)*C);else{const C=v*Math.sqrt(y*y-1);w=N=>{const j=Math.exp(-y*v*N),I=Math.min(C*N,300);return s-j*((g+y*v*x)*Math.sinh(I)+C*x*Math.cosh(I))/C}}const S={calculatedDuration:m&&p||null,next:C=>{const N=w(C);if(m)l.done=C>=p;else{let j=C===0?g:0;y<1&&(j=C===0?tw(g):fft(w,C,N));const I=Math.abs(j)<=r,_=Math.abs(s-N)<=o;l.done=I&&_}return l.value=l.done?s:N,l},toString:()=>{const C=Math.min(ube(S),lW),N=dft(j=>S.next(C*j).value,C,30);return C+"ms "+N},toTransition:()=>{}};return S}cW.applyToOptions=e=>{const t=Znr(e,100,cW);return e.ease=t.ease,e.duration=tw(t.duration),e.type="keyframes",e};function Ude({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:l,max:c,restDelta:u=.5,restSpeed:d}){const p=e[0],h={done:!1,value:p},m=I=>l!==void 0&&Ic,g=I=>l===void 0?c:c===void 0||Math.abs(l-I)-y*Math.exp(-I/r),w=I=>v+b(I),S=I=>{const _=b(I),T=w(I);h.done=Math.abs(_)<=u,h.value=h.done?v:T};let C,N;const j=I=>{m(h.value)&&(C=I,N=cW({keyframes:[h.value,g(h.value)],velocity:fft(w,I,h.value),damping:o,stiffness:i,restDelta:u,restSpeed:d}))};return j(0),{calculatedDuration:null,next:I=>{let _=!1;return!N&&C===void 0&&(_=!0,S(I),j(I)),C!==void 0&&I>=C?N.next(I-C):(!_&&S(I),h)}}}function srr(e,t,n){const r=[],o=n||Ew.mix||uft,i=e.length-1;for(let s=0;st[0];if(i===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=srr(t,r,o),c=l.length,u=d=>{if(s&&d1)for(;pu(yb(e[0],e[i-1],d)):u}function crr(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=q$(0,t,r);e.push($c(n,1,o))}}function urr(e){const t=[0];return crr(t,e.length-1),t}function drr(e,t){return e.map(n=>n*t)}function frr(e,t){return e.map(()=>t||Zdt).splice(0,e.length-1)}function BO({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=Cnr(r)?r.map(hLe):hLe(r),i={done:!1,value:t[0]},s=drr(n&&n.length===t.length?n:urr(t),e),l=lrr(s,t,{ease:Array.isArray(o)?o:frr(t,o)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const prr=e=>e!==null;function dbe(e,{repeat:t,repeatType:n="loop"},r,o=1){const i=e.filter(prr),l=o<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!l||r===void 0?i[l]:r}const hrr={decay:Ude,inertia:Ude,tween:BO,keyframes:BO,spring:cW};function pft(e){typeof e.type=="string"&&(e.type=hrr[e.type])}class fbe{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const mrr=e=>e/100;class pbe extends fbe{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,o;const{motionValue:n}=this.options;n&&n.updatedAt!==mh.now()&&this.tick(mh.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(r=this.options).onStop)==null||o.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;pft(t);const{type:n=BO,repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:s=0}=t;let{keyframes:l}=t;const c=n||BO;c!==BO&&typeof l[0]!="number"&&(this.mixKeyframes=y6(mrr,uft(l[0],l[1])),l=[0,100]);const u=c({...t,keyframes:l});i==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...l].reverse(),velocity:-s})),u.calculatedDuration===null&&(u.calculatedDuration=ube(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=u}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:o,mixKeyframes:i,mirroredGenerator:s,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:p,repeatType:h,repeatDelay:m,type:g,onUpdate:y,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?v<0:v>o;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let w=this.currentTime,S=r;if(p){const I=Math.min(this.currentTime,o)/l;let _=Math.floor(I),T=I%1;!T&&I>=1&&(T=1),T===1&&_--,_=Math.min(_,p+1),!!(_%2)&&(h==="reverse"?(T=1-T,m&&(T-=m/l)):h==="mirror"&&(S=s)),w=yb(0,1,T)*l}const C=b?{done:!1,value:d[0]}:S.next(w);i&&(C.value=i(C.value));let{done:N}=C;!b&&c!==null&&(N=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const j=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&N);return j&&g!==Ude&&(C.value=dbe(d,this.options,x,this.speed)),y&&y(C.value),j&&this.finish(),C}then(t,n){return this.finished.then(t,n)}get duration(){return g0(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+g0(t)}get time(){return g0(this.currentTime)}set time(t){var n;t=tw(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(mh.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=g0(this.currentTime))}play(){var o,i;if(this.isStopped)return;const{driver:t=Jnr,startTime:n}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),(i=(o=this.options).onPlay)==null||i.call(o);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(mh.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function grr(e){for(let t=1;te*180/Math.PI,Wde=e=>{const t=cE(Math.atan2(e[1],e[0]));return Gde(t)},xrr={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Wde,rotateZ:Wde,skewX:e=>cE(Math.atan(e[1])),skewY:e=>cE(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Gde=e=>(e=e%360,e<0&&(e+=360),e),wLe=Wde,SLe=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),CLe=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),yrr={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:SLe,scaleY:CLe,scale:e=>(SLe(e)+CLe(e))/2,rotateX:e=>Gde(cE(Math.atan2(e[6],e[5]))),rotateY:e=>Gde(cE(Math.atan2(-e[2],e[0]))),rotateZ:wLe,rotate:wLe,skewX:e=>cE(Math.atan(e[4])),skewY:e=>cE(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function qde(e){return e.includes("scale")?1:0}function Kde(e,t){if(!e||e==="none")return qde(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=yrr,o=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=xrr,o=l}if(!o)return qde(t);const i=r[t],s=o[1].split(",").map(brr);return typeof i=="function"?i(s):s[i]}const vrr=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Kde(n,t)};function brr(e){return parseFloat(e.trim())}const t4=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],n4=new Set(t4),NLe=e=>e===e4||e===so,wrr=new Set(["x","y","z"]),Srr=t4.filter(e=>!wrr.has(e));function Crr(e){const t=[];return Srr.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const G2={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Kde(t,"x"),y:(e,{transform:t})=>Kde(t,"y")};G2.translateX=G2.x;G2.translateY=G2.y;const HE=new Set;let Yde=!1,Xde=!1,Qde=!1;function hft(){if(Xde){const e=Array.from(HE).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=Crr(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,s])=>{var l;(l=r.getValue(i))==null||l.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Xde=!1,Yde=!1,HE.forEach(e=>e.complete(Qde)),HE.clear()}function mft(){HE.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Xde=!0)})}function Nrr(){Qde=!0,mft(),hft(),Qde=!1}class hbe{constructor(t,n,r,o,i,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(HE.add(this),Yde||(Yde=!0,Ql.read(mft),Ql.resolveKeyframes(hft))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;if(t[0]===null){const i=o==null?void 0:o.get(),s=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const l=r.readValue(n,s);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=s),o&&i===void 0&&o.set(t[0])}grr(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),HE.delete(this)}cancel(){this.state==="scheduled"&&(HE.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const jrr=e=>e.startsWith("--");function Err(e,t,n){jrr(t)?e.style.setProperty(t,n):e.style[t]=n}const Irr=nbe(()=>window.ScrollTimeline!==void 0),_rr={};function Prr(e,t){const n=nbe(e);return()=>_rr[t]??n()}const gft=Prr(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),FR=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,jLe={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:FR([0,.65,.55,1]),circOut:FR([.55,0,1,.45]),backIn:FR([.31,.01,.66,-.59]),backOut:FR([.33,1.53,.69,.99])};function xft(e,t){if(e)return typeof e=="function"?gft()?dft(e,t):"ease-out":eft(e)?FR(e):Array.isArray(e)?e.map(n=>xft(n,t)||jLe.easeOut):jLe[e]}function Arr(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const p=xft(l,o);Array.isArray(p)&&(d.easing=p);const h={delay:r,duration:o,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:i+1,direction:s==="reverse"?"alternate":"normal"};return u&&(h.pseudoElement=u),e.animate(d,h)}function yft(e){return typeof e=="function"&&"applyToOptions"in e}function Trr({type:e,...t}){return yft(e)&&gft()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class krr extends fbe{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:o,pseudoElement:i,allowFlatten:s=!1,finalKeyframe:l,onComplete:c}=t;this.isPseudoElement=!!i,this.allowFlatten=s,this.options=t,tbe(typeof t.type!="string");const u=Trr(t);this.animation=Arr(n,r,o,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=dbe(o,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):Err(n,r,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return g0(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+g0(t)}get time(){return g0(Number(this.animation.currentTime)||0)}set time(t){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=tw(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Irr()?(this.animation.timeline=t,C0):n(this)}}const vft={anticipate:Xdt,backInOut:Ydt,circInOut:Jdt};function Mrr(e){return e in vft}function Rrr(e){typeof e.ease=="string"&&Mrr(e.ease)&&(e.ease=vft[e.ease])}const tne=10;class Orr extends krr{constructor(t){Rrr(t),pft(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:o,element:i,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const l=new pbe({...s,autoplay:!1}),c=Math.max(tne,mh.now()-this.startTime),u=yb(0,tne,c-tne);n.setWithVelocity(l.sample(Math.max(0,c-u)).value,l.sample(c).value,u),l.stop()}}const ELe=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(DC.test(e)||e==="0")&&!e.startsWith("url("));function $rr(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function zrr(e){var d;const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;if(!(((d=t==null?void 0:t.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return Frr()&&n&&Lrr.has(n)&&(n!=="transform"||!u)&&!c&&!r&&o!=="mirror"&&i!==0&&s!=="inertia"}const Brr=40;class Hrr extends fbe{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:s="loop",keyframes:l,name:c,motionValue:u,element:d,...p}){var g;super(),this.stop=()=>{var y,x;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=mh.now();const h={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:s,name:c,motionValue:u,element:d,...p},m=(d==null?void 0:d.KeyframeResolver)||hbe;this.keyframeResolver=new m(l,(y,x,v)=>this.onKeyframesResolved(y,x,h,!v),c,u,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(t,n,r,o){var x,v;this.keyframeResolver=void 0;const{name:i,type:s,velocity:l,delay:c,isHandoff:u,onUpdate:d}=r;this.resolvedAt=mh.now(),Drr(t,i,s,l)||((Ew.instantAnimations||!c)&&(d==null||d(dbe(t,r,n))),t[0]=t[t.length-1],Jde(r),r.repeat=0);const h={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>Brr?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},m=!u&&zrr(h),g=(v=(x=h.motionValue)==null?void 0:x.owner)==null?void 0:v.current,y=m?new Orr({...h,element:g}):new pbe(h);y.finished.then(()=>{this.notifyFinished()}).catch(C0),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Nrr()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function bft(e,t,n,r=0,o=1){const i=Array.from(e).sort((u,d)=>u.sortNodePosition(d)).indexOf(t),s=e.size,l=(s-1)*r;return typeof n=="function"?n(i,s):o===1?i*r:l-i*r}const Vrr=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Urr(e){const t=Vrr.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}function wft(e,t,n=1){const[r,o]=Urr(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const s=i.trim();return Bdt(s)?parseFloat(s):s}return abe(o)?wft(o,t,n+1):o}const Wrr={type:"spring",stiffness:500,damping:25,restSpeed:10},Grr=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),qrr={type:"keyframes",duration:.8},Krr={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Yrr=(e,{keyframes:t})=>t.length>2?qrr:n4.has(e)?e.startsWith("scale")?Grr(t[1]):Wrr:Krr,Xrr=e=>e!==null;function Qrr(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(Xrr),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[i]}function mbe(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}function Jrr({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const gbe=(e,t,n,r={},o,i)=>s=>{const l=mbe(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-tw(c);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:h=>{t.set(h),l.onUpdate&&l.onUpdate(h)},onComplete:()=>{s(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:o};Jrr(l)||Object.assign(d,Yrr(e,d)),d.duration&&(d.duration=tw(d.duration)),d.repeatDelay&&(d.repeatDelay=tw(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let p=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Jde(d),d.delay===0&&(p=!0)),(Ew.instantAnimations||Ew.skipAnimations)&&(p=!0,Jde(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,p&&!i&&t.get()!==void 0){const h=Qrr(d.keyframes,l);if(h!==void 0){Ql.update(()=>{d.onUpdate(h),d.onComplete()});return}}return l.isSync?new pbe(d):new Hrr(d)};function ILe(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function xbe(e,t,n,r){if(typeof t=="function"){const[o,i]=ILe(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=ILe(r);t=t(n!==void 0?n:e.custom,o,i)}return t}function yA(e,t,n){const r=e.getProps();return xbe(r,t,n!==void 0?n:r.custom,e)}const Sft=new Set(["width","height","top","left","right","bottom",...t4]),_Le=30,Zrr=e=>!isNaN(parseFloat(e));class eor{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const o=mh.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=mh.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Zrr(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new rbe);const r=this.events[t].add(n);return t==="change"?()=>{r(),Ql.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=mh.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>_Le)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,_Le);return Udt(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function MT(e,t){return new eor(e,t)}const Zde=e=>Array.isArray(e);function tor(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,MT(n))}function nor(e){return Zde(e)?e[e.length-1]||0:e}function ror(e,t){const n=yA(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const s in i){const l=nor(i[s]);tor(e,s,l)}}const _p=e=>!!(e&&e.getVelocity);function oor(e){return!!(_p(e)&&e.add)}function efe(e,t){const n=e.getValue("willChange");if(oor(n))return n.add(t);if(!n&&Ew.WillChange){const r=new Ew.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function ybe(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const ior="framerAppearId",Cft="data-"+ybe(ior);function Nft(e){return e.props[Cft]}function aor({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function jft(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:s,...l}=t;r&&(i=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const d in l){const p=e.getValue(d,e.latestValues[d]??null),h=l[d];if(h===void 0||u&&aor(u,d))continue;const m={delay:n,...mbe(i||{},d)},g=p.get();if(g!==void 0&&!p.isAnimating&&!Array.isArray(h)&&h===g&&!m.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const v=Nft(e);if(v){const b=window.MotionHandoffAnimation(v,d,Ql);b!==null&&(m.startTime=b,y=!0)}}efe(e,d),p.start(gbe(d,p,h,e.shouldReduceMotion&&Sft.has(d)?{type:!1}:m,e,y));const x=p.animation;x&&c.push(x)}return s&&Promise.all(c).then(()=>{Ql.update(()=>{s&&ror(e,s)})}),c}function tfe(e,t,n={}){var c;const r=yA(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(jft(e,r,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:p,staggerDirection:h}=o;return sor(e,t,u,d,p,h,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[i,s]:[s,i];return u().then(()=>d())}else return Promise.all([i(),s(n.delay)])}function sor(e,t,n=0,r=0,o=0,i=1,s){const l=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),l.push(tfe(c,t,{...s,delay:n+(typeof r=="function"?0:r)+bft(e.variantChildren,c,r,o,i)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(l)}function lor(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>tfe(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=tfe(e,t,n);else{const o=typeof t=="function"?yA(e,t,n.custom):t;r=Promise.all(jft(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const cor={test:e=>e==="auto",parse:e=>e},Eft=e=>t=>t.test(e),Ift=[e4,so,Zv,YS,$nr,Onr,cor],PLe=e=>Ift.find(Eft(e));function uor(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Vdt(e):!0}const dor=new Set(["brightness","contrast","saturate","opacity"]);function por(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(sbe)||[];if(!r)return e;const o=n.replace(r,"");let i=dor.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const hor=/\b([a-z-]*)\(.*?\)/gu,nfe={...DC,getAnimatableNone:e=>{const t=e.match(hor);return t?t.map(por).join(" "):e}},ALe={...e4,transform:Math.round},mor={rotate:YS,rotateX:YS,rotateY:YS,rotateZ:YS,scale:$7,scaleX:$7,scaleY:$7,scaleZ:$7,skew:YS,skewX:YS,skewY:YS,distance:so,translateX:so,translateY:so,translateZ:so,x:so,y:so,z:so,perspective:so,transformPerspective:so,opacity:K$,originX:gLe,originY:gLe,originZ:so},vbe={borderWidth:so,borderTopWidth:so,borderRightWidth:so,borderBottomWidth:so,borderLeftWidth:so,borderRadius:so,borderTopLeftRadius:so,borderTopRightRadius:so,borderBottomRightRadius:so,borderBottomLeftRadius:so,width:so,maxWidth:so,height:so,maxHeight:so,top:so,right:so,bottom:so,left:so,inset:so,insetBlock:so,insetBlockStart:so,insetBlockEnd:so,insetInline:so,insetInlineStart:so,insetInlineEnd:so,padding:so,paddingTop:so,paddingRight:so,paddingBottom:so,paddingLeft:so,paddingBlock:so,paddingBlockStart:so,paddingBlockEnd:so,paddingInline:so,paddingInlineStart:so,paddingInlineEnd:so,margin:so,marginTop:so,marginRight:so,marginBottom:so,marginLeft:so,marginBlock:so,marginBlockStart:so,marginBlockEnd:so,marginInline:so,marginInlineStart:so,marginInlineEnd:so,fontSize:so,backgroundPositionX:so,backgroundPositionY:so,...mor,zIndex:ALe,fillOpacity:K$,strokeOpacity:K$,numOctaves:ALe},gor={...vbe,color:Zu,backgroundColor:Zu,outlineColor:Zu,fill:Zu,stroke:Zu,borderColor:Zu,borderTopColor:Zu,borderRightColor:Zu,borderBottomColor:Zu,borderLeftColor:Zu,filter:nfe,WebkitFilter:nfe},_ft=e=>gor[e];function Pft(e,t){let n=_ft(e);return n!==nfe&&(n=DC),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const xor=new Set(["auto","none","0"]);function yor(e,t,n){let r=0,o;for(;r{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}function bor(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e).filter(r=>r!=null)}const Aft=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function rfe(e){return Hdt(e)&&"offsetHeight"in e}const{schedule:bbe}=tft(queueMicrotask,!1),_x={x:!1,y:!1};function Tft(){return _x.x||_x.y}function wor(e){return e==="x"||e==="y"?_x[e]?null:(_x[e]=!0,()=>{_x[e]=!1}):_x.x||_x.y?null:(_x.x=_x.y=!0,()=>{_x.x=_x.y=!1})}function kft(e,t){const n=bor(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function TLe(e){return!(e.pointerType==="touch"||Tft())}function Sor(e,t,n={}){const[r,o,i]=kft(e,n),s=l=>{if(!TLe(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=p=>{TLe(p)&&(u(p),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,o)};return r.forEach(l=>{l.addEventListener("pointerenter",s,o)}),i}const Mft=(e,t)=>t?e===t?!0:Mft(e,t.parentElement):!1,wbe=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Cor=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Rft(e){return Cor.has(e.tagName)||e.isContentEditable===!0}const AB=new WeakSet;function kLe(e){return t=>{t.key==="Enter"&&e(t)}}function nne(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Nor=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=kLe(()=>{if(AB.has(n))return;nne(n,"down");const o=kLe(()=>{nne(n,"up")}),i=()=>nne(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function MLe(e){return wbe(e)&&!Tft()}function jor(e,t,n={}){const[r,o,i]=kft(e,n),s=l=>{const c=l.currentTarget;if(!MLe(l))return;AB.add(c);const u=t(c,l),d=(m,g)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",h),AB.has(c)&&AB.delete(c),MLe(m)&&typeof u=="function"&&u(m,{success:g})},p=m=>{d(m,c===window||c===document||n.useGlobalTarget||Mft(c,m.target))},h=m=>{d(m,!1)};window.addEventListener("pointerup",p,o),window.addEventListener("pointercancel",h,o)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",s,o),rfe(l)&&(l.addEventListener("focus",u=>Nor(u,o)),!Rft(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function Oft(e){return Hdt(e)&&"ownerSVGElement"in e}function Eor(e){return Oft(e)&&e.tagName==="svg"}const Ior=[...Ift,Zu,DC],_or=e=>Ior.find(Eft(e)),RLe=()=>({translate:0,scale:1,origin:0,originPoint:0}),DP=()=>({x:RLe(),y:RLe()}),OLe=()=>({min:0,max:0}),bd=()=>({x:OLe(),y:OLe()}),ofe={current:null},$ft={current:!1},Por=typeof window<"u";function Aor(){if($ft.current=!0,!!Por)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>ofe.current=e.matches;e.addEventListener("change",t),t()}else ofe.current=!1}const Tor=new WeakMap;function dY(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function X$(e){return typeof e=="string"||Array.isArray(e)}const Sbe=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Cbe=["initial",...Sbe];function fY(e){return dY(e.animate)||Cbe.some(t=>X$(e[t]))}function Dft(e){return!!(fY(e)||e.variants)}function kor(e,t,n){for(const r in t){const o=t[r],i=n[r];if(_p(o))e.addValue(r,o);else if(_p(i))e.addValue(r,MT(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(o):s.hasAnimated||s.set(o)}else{const s=e.getStaticValue(r);e.addValue(r,MT(s!==void 0?s:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const $Le=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let uW={};function Lft(e){uW=e}function Mor(){return uW}class Ror{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=hbe,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=mh.now();this.renderScheduledAtthis.bindToMotionValue(o,r)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:($ft.current||Aor(),this.shouldReduceMotion=ofe.current),(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var t;this.projection&&this.projection.unmount(),$C(this.notifyUpdate),$C(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=n4.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Ql.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in uW){const n=uW[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):bd()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<$Le.length;r++){const o=$Le[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,s=t[i];s&&(this.propEventSubscriptions[o]=this.on(o,s))}this.prevMotionValues=kor(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=MT(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Bdt(r)||Vdt(r))?r=parseFloat(r):!_or(r)&&DC.test(n)&&(r=Pft(t,n)),this.setBaseTarget(t,_p(r)?r.get():r)),_p(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const s=xbe(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);s&&(r=s[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!_p(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new rbe),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){bbe.render(this.render)}}class Fft extends Ror{constructor(){super(...arguments),this.KeyframeResolver=vor}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;_p(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class cN{constructor(t){this.isMounted=!1,this.node=t}update(){}}function zft({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Oor({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $or(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function rne(e){return e===void 0||e===1}function ife({scale:e,scaleX:t,scaleY:n}){return!rne(e)||!rne(t)||!rne(n)}function Nj(e){return ife(e)||Bft(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Bft(e){return DLe(e.x)||DLe(e.y)}function DLe(e){return e&&e!=="0%"}function dW(e,t,n){const r=e-n,o=t*r;return n+o}function LLe(e,t,n,r,o){return o!==void 0&&(e=dW(e,o,r)),dW(e,n,r)+t}function afe(e,t=0,n=1,r,o){e.min=LLe(e.min,t,n,r,o),e.max=LLe(e.max,t,n,r,o)}function Hft(e,{x:t,y:n}){afe(e.x,t.translate,t.scale,t.originPoint),afe(e.y,n.translate,n.scale,n.originPoint)}const FLe=.999999999999,zLe=1.0000000000001;function Dor(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,s;for(let l=0;lFLe&&(t.x=1),t.yFLe&&(t.y=1)}function LP(e,t){e.min=e.min+t,e.max=e.max+t}function BLe(e,t,n,r,o=.5){const i=$c(e.min,e.max,o);afe(e,t,n,i,r)}function FP(e,t){BLe(e.x,t.x,t.scaleX,t.scale,t.originX),BLe(e.y,t.y,t.scaleY,t.scale,t.originY)}function Vft(e,t){return zft($or(e.getBoundingClientRect(),t))}function Lor(e,t,n){const r=Vft(e,n),{scroll:o}=t;return o&&(LP(r.x,o.offset.x),LP(r.y,o.offset.y)),r}const For={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},zor=t4.length;function Bor(e,t,n){let r="",o=!0;for(let i=0;i{if(!t.target)return e;if(typeof e=="string")if(so.test(e))e=parseFloat(e);else return e;const n=HLe(e,t.target.x),r=HLe(e,t.target.y);return`${n}% ${r}%`}},Hor={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=DC.parse(e);if(o.length>5)return r;const i=DC.createTransformer(e),s=typeof o[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;o[0+s]/=l,o[1+s]/=c;const u=$c(l,c,.5);return typeof o[2+s]=="number"&&(o[2+s]/=u),typeof o[3+s]=="number"&&(o[3+s]/=u),i(o)}},sfe={borderRadius:{...OM,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:OM,borderTopRightRadius:OM,borderBottomLeftRadius:OM,borderBottomRightRadius:OM,boxShadow:Hor};function Wft(e,{layout:t,layoutId:n}){return n4.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!sfe[e]||e==="opacity")}function jbe(e,t,n){var s;const r=e.style,o=t==null?void 0:t.style,i={};if(!r)return i;for(const l in r)(_p(r[l])||o&&_p(o[l])||Wft(l,e)||((s=n==null?void 0:n.getValue(l))==null?void 0:s.liveStyle)!==void 0)&&(i[l]=r[l]);return i}function Vor(e){return window.getComputedStyle(e)}class Uor extends Fft{constructor(){super(...arguments),this.type="html",this.renderInstance=Uft}readValueFromInstance(t,n){var r;if(n4.has(n))return(r=this.projection)!=null&&r.isProjecting?qde(n):vrr(t,n);{const o=Vor(t),i=(rft(n)?o.getPropertyValue(n):o[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Vft(t,n)}build(t,n,r){Nbe(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return jbe(t,n,r)}}const Wor={offset:"stroke-dashoffset",array:"stroke-dasharray"},Gor={offset:"strokeDashoffset",array:"strokeDasharray"};function qor(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?Wor:Gor;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const Kor=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Gft(e,{attrX:t,attrY:n,attrScale:r,pathLength:o,pathSpacing:i=1,pathOffset:s=0,...l},c,u,d){if(Nbe(e,l,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:h}=e;p.transform&&(h.transform=p.transform,delete p.transform),(h.transform||p.transformOrigin)&&(h.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete p.transformBox);for(const m of Kor)p[m]!==void 0&&(h[m]=p[m],delete p[m]);t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),o!==void 0&&qor(p,o,i,s,!1)}const qft=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Kft=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Yor(e,t,n,r){Uft(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(qft.has(o)?o:ybe(o),t.attrs[o])}function Yft(e,t,n){const r=jbe(e,t,n);for(const o in e)if(_p(e[o])||_p(t[o])){const i=t4.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}class Xor extends Fft{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=bd}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(n4.has(n)){const r=_ft(n);return r&&r.default||0}return n=qft.has(n)?n:ybe(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Yft(t,n,r)}build(t,n,r){Gft(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,o){Yor(t,n,r,o)}mount(t){this.isSVGTag=Kft(t.tagName),super.mount(t)}}const Qor=Cbe.length;function Xft(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Xft(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>lor(e,n,r)))}function tir(e){let t=eir(e),n=VLe(),r=!0;const o=c=>(u,d)=>{var h;const p=yA(e,d,c==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);if(p){const{transition:m,transitionEnd:g,...y}=p;u={...u,...y,...g}}return u};function i(c){t=c(e)}function s(c){const{props:u}=e,d=Xft(e.parent)||{},p=[],h=new Set;let m={},g=1/0;for(let x=0;xg&&S,_=!1;const T=Array.isArray(w)?w:[w];let P=T.reduce(o(v),{});C===!1&&(P={});const{prevResolvedValues:E={}}=b,M={...E,...P},R=z=>{I=!0,h.has(z)&&(_=!0,h.delete(z)),b.needsAnimating[z]=!0;const V=e.getValue(z);V&&(V.liveStyle=!1)};for(const z in M){const V=P[z],B=E[z];if(m.hasOwnProperty(z))continue;let G=!1;Zde(V)&&Zde(B)?G=!Qft(V,B):G=V!==B,G?V!=null?R(z):h.add(z):V!==void 0&&h.has(z)?R(z):b.protectedKeys[z]=!0}b.prevProp=w,b.prevResolvedValues=P,b.isActive&&(m={...m,...P}),r&&e.blockInitialAnimation&&(I=!1);const $=N&&j;I&&(!$||_)&&p.push(...T.map(z=>{const V={type:v};if(typeof z=="string"&&r&&!$&&e.manuallyAnimateOnMount&&e.parent){const{parent:B}=e,G=yA(B,z);if(B.enteringChildren&&G){const{delayChildren:H}=G.transition||{};V.delay=bft(B.enteringChildren,e,H)}}return{animation:z,options:V}}))}if(h.size){const x={};if(typeof u.initial!="boolean"){const v=yA(e,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(x.transition=v.transition)}h.forEach(v=>{const b=e.getBaseTarget(v),w=e.getValue(v);w&&(w.liveStyle=!0),x[v]=b??null}),p.push({animation:x})}let y=!!p.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),r=!1,y?t(p):Promise.resolve()}function l(c,u){var p;if(n[c].isActive===u)return Promise.resolve();(p=e.variantChildren)==null||p.forEach(h=>{var m;return(m=h.animationState)==null?void 0:m.setActive(c,u)}),n[c].isActive=u;const d=s(c);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:s,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=VLe()}}}function nir(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Qft(t,e):!1}function QN(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function VLe(){return{animate:QN(!0),whileInView:QN(),whileHover:QN(),whileTap:QN(),whileDrag:QN(),whileFocus:QN(),exit:QN()}}function ULe(e,t){e.min=t.min,e.max=t.max}function gx(e,t){ULe(e.x,t.x),ULe(e.y,t.y)}function WLe(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Jft=1e-4,rir=1-Jft,oir=1+Jft,Zft=.01,iir=0-Zft,air=0+Zft;function gh(e){return e.max-e.min}function sir(e,t,n){return Math.abs(e-t)<=n}function GLe(e,t,n,r=.5){e.origin=r,e.originPoint=$c(t.min,t.max,e.origin),e.scale=gh(n)/gh(t),e.translate=$c(n.min,n.max,e.origin)-e.originPoint,(e.scale>=rir&&e.scale<=oir||isNaN(e.scale))&&(e.scale=1),(e.translate>=iir&&e.translate<=air||isNaN(e.translate))&&(e.translate=0)}function HO(e,t,n,r){GLe(e.x,t.x,n.x,r?r.originX:void 0),GLe(e.y,t.y,n.y,r?r.originY:void 0)}function qLe(e,t,n){e.min=n.min+t.min,e.max=e.min+gh(t)}function lir(e,t,n){qLe(e.x,t.x,n.x),qLe(e.y,t.y,n.y)}function KLe(e,t,n){e.min=t.min-n.min,e.max=e.min+gh(t)}function fW(e,t,n){KLe(e.x,t.x,n.x),KLe(e.y,t.y,n.y)}function YLe(e,t,n,r,o){return e-=t,e=dW(e,1/n,r),o!==void 0&&(e=dW(e,1/o,r)),e}function cir(e,t=0,n=1,r=.5,o,i=e,s=e){if(Zv.test(t)&&(t=parseFloat(t),t=$c(s.min,s.max,t/100)-s.min),typeof t!="number")return;let l=$c(i.min,i.max,r);e===i&&(l-=t),e.min=YLe(e.min,t,n,l,o),e.max=YLe(e.max,t,n,l,o)}function XLe(e,t,[n,r,o],i,s){cir(e,t[n],t[r],t[o],t.scale,i,s)}const uir=["x","scaleX","originX"],dir=["y","scaleY","originY"];function QLe(e,t,n,r){XLe(e.x,t,uir,n?n.x:void 0,r?r.x:void 0),XLe(e.y,t,dir,n?n.y:void 0,r?r.y:void 0)}function JLe(e){return e.translate===0&&e.scale===1}function ept(e){return JLe(e.x)&&JLe(e.y)}function ZLe(e,t){return e.min===t.min&&e.max===t.max}function fir(e,t){return ZLe(e.x,t.x)&&ZLe(e.y,t.y)}function e6e(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function tpt(e,t){return e6e(e.x,t.x)&&e6e(e.y,t.y)}function t6e(e){return gh(e.x)/gh(e.y)}function n6e(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function qg(e){return[e("x"),e("y")]}function pir(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:p,rotateY:h,skewX:m,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),p&&(r+=`rotateX(${p}deg) `),h&&(r+=`rotateY(${h}deg) `),m&&(r+=`skewX(${m}deg) `),g&&(r+=`skewY(${g}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const npt=["TopLeft","TopRight","BottomLeft","BottomRight"],hir=npt.length,r6e=e=>typeof e=="string"?parseFloat(e):e,o6e=e=>typeof e=="number"||so.test(e);function mir(e,t,n,r,o,i){o?(e.opacity=$c(0,n.opacity??1,gir(r)),e.opacityExit=$c(t.opacity??1,0,xir(r))):i&&(e.opacity=$c(t.opacity??1,n.opacity??1,r));for(let s=0;srt?1:n(q$(e,t,r))}function yir(e,t,n){const r=_p(e)?e:MT(e);return r.start(gbe("",r,t,n)),r.animation}function Q$(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const vir=(e,t)=>e.depth-t.depth;class bir{constructor(){this.children=[],this.isDirty=!1}add(t){Zve(this.children,t),this.isDirty=!0}remove(t){ebe(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(vir),this.isDirty=!1,this.children.forEach(t)}}function wir(e,t){const n=mh.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&($C(r),e(i-t))};return Ql.setup(r,!0),()=>$C(r)}function TB(e){return _p(e)?e.get():e}class Sir{constructor(){this.members=[]}add(t){Zve(this.members,t),t.scheduleRender()}remove(t){if(ebe(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender();const o=r.options.layoutDependency,i=t.options.layoutDependency;o!==void 0&&i!==void 0&&o===i||(t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0));const{crossfade:l}=t.options;l===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const kB={hasAnimatedSinceResize:!0,hasEverUpdated:!1},one=["","X","Y","Z"],Cir=1e3;let Nir=0;function ine(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function opt(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Nft(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Ql,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&opt(r)}function ipt({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(s={},l=t==null?void 0:t()){this.id=Nir++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Iir),this.nodes.forEach(Tir),this.nodes.forEach(kir),this.nodes.forEach(_ir)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;Ql.read(()=>{p=window.innerWidth}),e(s,()=>{const m=window.innerWidth;m!==p&&(p=m,this.root.updateBlockedByResize=!0,d&&d(),d=wir(h,250),kB.hasAnimatedSinceResize&&(kB.hasAnimatedSinceResize=!1,this.nodes.forEach(l6e)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p,hasRelativeLayoutChanged:h,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||Dir,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=u.getProps(),v=!this.targetLayout||!tpt(this.targetLayout,m),b=!p&&h;if(this.options.layoutRoot||this.resumeFrom||b||p&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const w={...mbe(g,"layout"),onPlay:y,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(d,b)}else p||l6e(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),$C(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Mir),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&opt(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!gh(this.snapshot.measuredBox.x)&&!gh(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const C=S/1e3;c6e(p.x,s.x,C),c6e(p.y,s.y,C),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(fW(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Oir(this.relativeTarget,this.relativeTargetOrigin,h,C),w&&fir(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=bd()),gx(w,this.relativeTarget)),y&&(this.animationValues=d,mir(d,u,this.latestValues,C,b,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&($C(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Ql.update(()=>{kB.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=MT(0)),this.currentAnimation=yir(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),s.onUpdate&&s.onUpdate(d)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Cir),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=s;if(!(!l||!c||!u)){if(this!==s&&this.layout&&u&&apt(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||bd();const p=gh(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+p;const h=gh(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+h}gx(l,c),FP(l,d),HO(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(s,l){this.sharedNodes.has(s)||this.sharedNodes.set(s,new Sir),this.sharedNodes.get(s).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var l;const{layoutId:s}=this.options;return s?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:s}=this.options;return s?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let l=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&ine("z",s,u,this.animationValues);for(let d=0;d{var l;return(l=s.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(a6e),this.root.sharedNodes.clear()}}}function jir(e){e.updateLayout()}function Eir(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,s=t.source!==e.layout.source;i==="size"?qg(p=>{const h=s?t.measuredBox[p]:t.layoutBox[p],m=gh(h);h.min=r[p].min,h.max=h.min+m}):apt(i,t.layoutBox,r)&&qg(p=>{const h=s?t.measuredBox[p]:t.layoutBox[p],m=gh(r[p]);h.max=h.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+m)});const l=DP();HO(l,r,t.layoutBox);const c=DP();s?HO(c,e.applyTransform(o,!0),t.measuredBox):HO(c,r,t.layoutBox);const u=!ept(l);let d=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:h,layout:m}=p;if(h&&m){const g=bd();fW(g,t.layoutBox,h.layoutBox);const y=bd();fW(y,r,m.layoutBox),tpt(g,y)||(d=!0),p.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=g,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Iir(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function _ir(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Pir(e){e.clearSnapshot()}function a6e(e){e.clearMeasurements()}function s6e(e){e.isLayoutDirty=!1}function Air(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function l6e(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Tir(e){e.resolveTargetDelta()}function kir(e){e.calcProjection()}function Mir(e){e.resetSkewAndRotation()}function Rir(e){e.removeLeadSnapshot()}function c6e(e,t,n){e.translate=$c(t.translate,0,n),e.scale=$c(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function u6e(e,t,n,r){e.min=$c(t.min,n.min,r),e.max=$c(t.max,n.max,r)}function Oir(e,t,n,r){u6e(e.x,t.x,n.x,r),u6e(e.y,t.y,n.y,r)}function $ir(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Dir={duration:.45,ease:[.4,0,.1,1]},d6e=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),f6e=d6e("applewebkit/")&&!d6e("chrome/")?Math.round:C0;function p6e(e){e.min=f6e(e.min),e.max=f6e(e.max)}function Lir(e){p6e(e.x),p6e(e.y)}function apt(e,t,n){return e==="position"||e==="preserve-aspect"&&!sir(t6e(t),t6e(n),.2)}function Fir(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const zir=ipt({attachResizeListener:(e,t)=>Q$(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),ane={current:void 0},spt=ipt({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ane.current){const e=new zir({});e.mount(window),e.setOptions({layoutScroll:!0}),ane.current=e}return ane.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Ebe=f.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function h6e(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bir(...e){return t=>{let n=!1;const r=e.map(o=>{const i=h6e(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{const{width:h,height:m,top:g,left:y,right:x,bottom:v}=l.current;if(t||!s.current||!h||!m)return;const b=n==="left"?`left: ${y}`:`right: ${x}`,w=r==="bottom"?`bottom: ${v}`:`top: ${g}`;s.current.dataset.motionPopId=i;const S=document.createElement("style");c&&(S.nonce=c);const C=o??document.head;return C.appendChild(S),S.sheet&&S.sheet.insertRule(` [data-motion-pop-id="${i}"] { position: absolute !important; width: ${h}px !important; height: ${m}px !important; ${b}px !important; ${w}px !important; } `),()=>{C.contains(S)&&C.removeChild(S)}},[t]),a.jsx(Vir,{isPresent:t,childRef:s,sizeRef:l,children:f.cloneElement(e,{ref:d})})}const Wir=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s,anchorX:l,anchorY:c,root:u})=>{const d=Jve(Gir),p=f.useId();let h=!0,m=f.useMemo(()=>(h=!1,{id:p,initial:t,isPresent:n,custom:o,onExitComplete:g=>{d.set(g,!0);for(const y of d.values())if(!y)return;r&&r()},register:g=>(d.set(g,!1),()=>d.delete(g))}),[n,d,r]);return i&&h&&(m={...m}),f.useMemo(()=>{d.forEach((g,y)=>d.set(y,!1))},[n]),f.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),s==="popLayout"&&(e=a.jsx(Uir,{isPresent:n,anchorX:l,anchorY:c,root:u,children:e})),a.jsx(uY.Provider,{value:m,children:e})};function Gir(){return new Map}function Ibe(e=!0){const t=f.useContext(uY);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=f.useId();f.useEffect(()=>{if(e)return o(i)},[e]);const s=f.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,s]:[!0]}const D7=e=>e.key||"";function m6e(e){const t=[];return f.Children.forEach(e,n=>{f.isValidElement(n)&&t.push(n)}),t}const g5=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:s=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[d,p]=Ibe(s),h=f.useMemo(()=>m6e(e),[e]),m=s&&!d?[]:h.map(D7),g=f.useRef(!0),y=f.useRef(h),x=Jve(()=>new Map),v=f.useRef(new Set),[b,w]=f.useState(h),[S,C]=f.useState(h);zdt(()=>{g.current=!1,y.current=h;for(let I=0;I{const _=D7(I),T=s&&!d?!1:h===S||m.includes(_),P=()=>{if(v.current.has(_))return;if(v.current.add(_),x.has(_))x.set(_,!0);else return;let E=!0;x.forEach(M=>{M||(E=!1)}),E&&(j==null||j(),C(y.current),s&&(p==null||p()),r&&r())};return a.jsx(Wir,{isPresent:T,initial:!g.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,root:u,onExitComplete:T?void 0:P,anchorX:l,anchorY:c,children:I},_)})})},lpt=f.createContext({strict:!1}),g6e={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let x6e=!1;function qir(){if(x6e)return;const e={};for(const t in g6e)e[t]={isEnabled:n=>g6e[t].some(r=>!!n[r])};Lft(e),x6e=!0}function cpt(){return qir(),Mor()}function Kir(e){const t=cpt();for(const n in e)t[n]={...t[n],...e[n]};Lft(t)}const Yir=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function pW(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Yir.has(e)}let upt=e=>!pW(e);function Xir(e){typeof e=="function"&&(upt=t=>t.startsWith("on")?!pW(t):e(t))}try{Xir(require("@emotion/is-prop-valid").default)}catch{}function Qir(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(upt(o)||n===!0&&pW(o)||!t&&!pW(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}const pY=f.createContext({});function Jir(e,t){if(fY(e)){const{initial:n,animate:r}=e;return{initial:n===!1||X$(n)?n:void 0,animate:X$(r)?r:void 0}}return e.inherit!==!1?t:{}}function Zir(e){const{initial:t,animate:n}=Jir(e,f.useContext(pY));return f.useMemo(()=>({initial:t,animate:n}),[y6e(t),y6e(n)])}function y6e(e){return Array.isArray(e)?e.join(" "):e}const _be=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dpt(e,t,n){for(const r in t)!_p(t[r])&&!Wft(r,n)&&(e[r]=t[r])}function ear({transformTemplate:e},t){return f.useMemo(()=>{const n=_be();return Nbe(n,t,e),Object.assign({},n.vars,n.style)},[t])}function tar(e,t){const n=e.style||{},r={};return dpt(r,n,e),Object.assign(r,ear(e,t)),r}function nar(e,t){const n={},r=tar(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const fpt=()=>({..._be(),attrs:{}});function rar(e,t,n,r){const o=f.useMemo(()=>{const i=fpt();return Gft(i,t,Kft(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};dpt(i,e.style,e),o.style={...i,...o.style}}return o}const oar=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Pbe(e){return typeof e!="string"||e.includes("-")?!1:!!(oar.indexOf(e)>-1||/[A-Z]/u.test(e))}function iar(e,t,n,{latestValues:r},o,i=!1,s){const c=(s??Pbe(e)?rar:nar)(t,r,o,e),u=Qir(t,typeof e=="string",i),d=e!==f.Fragment?{...u,...c,ref:n}:{},{children:p}=t,h=f.useMemo(()=>_p(p)?p.get():p,[p]);return f.createElement(e,{...d,children:h})}function aar({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,o){return{latestValues:sar(n,r,o,e),renderState:t()}}function sar(e,t,n,r){const o={},i=r(e,{});for(const h in i)o[h]=TB(i[h]);let{initial:s,animate:l}=e;const c=fY(e),u=Dft(e);t&&u&&!c&&e.inherit!==!1&&(s===void 0&&(s=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||s===!1;const p=d?l:s;if(p&&typeof p!="boolean"&&!dY(p)){const h=Array.isArray(p)?p:[p];for(let m=0;m(t,n)=>{const r=f.useContext(pY),o=f.useContext(uY),i=()=>aar(e,t,r,o);return n?i():Jve(i)},lar=ppt({scrapeMotionValuesFromProps:jbe,createRenderState:_be}),car=ppt({scrapeMotionValuesFromProps:Yft,createRenderState:fpt}),uar=Symbol.for("motionComponentSymbol");function dar(e,t,n){const r=f.useRef(n);f.useInsertionEffect(()=>{r.current=n});const o=f.useRef(null);return f.useCallback(i=>{var l;i&&((l=e.onMount)==null||l.call(e,i)),t&&(i?t.mount(i):t.unmount());const s=r.current;if(typeof s=="function")if(i){const c=s(i);typeof c=="function"&&(o.current=c)}else o.current?(o.current(),o.current=null):s(i);else s&&(s.current=i)},[t])}const hpt=f.createContext({});function zR(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function far(e,t,n,r,o,i){var v,b;const{visualElement:s}=f.useContext(pY),l=f.useContext(lpt),c=f.useContext(uY),u=f.useContext(Ebe).reducedMotion,d=f.useRef(null),p=f.useRef(!1);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:s,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,isSVG:i}),p.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));const h=d.current,m=f.useContext(hpt);h&&!h.projection&&o&&(h.type==="html"||h.type==="svg")&&par(d.current,n,o,m);const g=f.useRef(!1);f.useInsertionEffect(()=>{h&&g.current&&h.update(n,c)});const y=n[Cft],x=f.useRef(!!y&&!((v=window.MotionHandoffIsComplete)!=null&&v.call(window,y))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,y)));return zdt(()=>{p.current=!0,h&&(g.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),x.current&&h.animationState&&h.animationState.animateChanges())}),f.useEffect(()=>{h&&(!x.current&&h.animationState&&h.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var w;(w=window.MotionHandoffMarkAsComplete)==null||w.call(window,y)}),x.current=!1),h.enteringChildren=void 0)}),h}function par(e,t,n,r){const{layoutId:o,layout:i,drag:s,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:mpt(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!s||l&&zR(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function mpt(e){if(e)return e.options.allowProjection!==!1?e.projection:mpt(e.parent)}function sne(e,{forwardMotionProps:t=!1,type:n}={},r,o){r&&Kir(r);const i=n?n==="svg":Pbe(e),s=i?car:lar;function l(u,d){let p;const h={...f.useContext(Ebe),...u,layoutId:har(u)},{isStatic:m}=h,g=Zir(u),y=s(u,m);if(!m&&Fdt){mar();const x=gar(h);p=x.MeasureLayout,g.visualElement=far(e,y,h,o,x.ProjectionNode,i)}return a.jsxs(pY.Provider,{value:g,children:[p&&g.visualElement?a.jsx(p,{visualElement:g.visualElement,...h}):null,iar(e,u,dar(y,g.visualElement,d),y,m,t,i)]})}l.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=f.forwardRef(l);return c[uar]=e,c}function har({layoutId:e}){const t=f.useContext(Qve).id;return t&&e!==void 0?t+"-"+e:e}function mar(e,t){f.useContext(lpt).strict}function gar(e){const t=cpt(),{drag:n,layout:r}=t;if(!n&&!r)return{};const o={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?o.MeasureLayout:void 0,ProjectionNode:o.ProjectionNode}}function xar(e,t){if(typeof Proxy>"u")return sne;const n=new Map,r=(i,s)=>sne(i,s,e,t),o=(i,s)=>r(i,s);return new Proxy(o,{get:(i,s)=>s==="create"?r:(n.has(s)||n.set(s,sne(s,void 0,e,t)),n.get(s))})}const yar=(e,t)=>t.isSVG??Pbe(e)?new Xor(t):new Uor(t,{allowProjection:e!==f.Fragment});class bar extends cN{constructor(t){super(t),t.animationState||(t.animationState=tir(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();dY(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let war=0;class Sar extends cN{constructor(){super(...arguments),this.id=war++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Car={animation:{Feature:bar},exit:{Feature:Sar}};function w6(e){return{point:{x:e.pageX,y:e.pageY}}}const Nar=e=>t=>wbe(t)&&e(t,w6(t));function VO(e,t,n,r){return Q$(e,t,Nar(n),r)}const gpt=({current:e})=>e?e.ownerDocument.defaultView:null,v6e=(e,t)=>Math.abs(e-t);function jar(e,t){const n=v6e(e.x,t.x),r=v6e(e.y,t.y);return Math.sqrt(n**2+r**2)}const b6e=new Set(["auto","scroll"]);class xpt{constructor(t,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:i=!1,distanceThreshold:s=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=m=>{this.handleScroll(m.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const m=cne(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,y=jar(m.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!y)return;const{point:x}=m,{timestamp:v}=Mf;this.history.push({...x,timestamp:v});const{onStart:b,onMove:w}=this.handlers;g||(b&&b(this.lastMoveEvent,m),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,m)},this.handlePointerMove=(m,g)=>{this.lastMoveEvent=m,this.lastMoveEventInfo=lne(g,this.transformPagePoint),Ql.update(this.updatePoint,!0)},this.handlePointerUp=(m,g)=>{this.end();const{onEnd:y,onSessionEnd:x,resumeAnimation:v}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&v&&v(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=cne(m.type==="pointercancel"?this.lastMoveEventInfo:lne(g,this.transformPagePoint),this.history);this.startEvent&&y&&y(m,b),x&&x(m,b)},!wbe(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=s,this.contextWindow=o||window;const c=w6(t),u=lne(c,this.transformPagePoint),{point:d}=u,{timestamp:p}=Mf;this.history=[{...d,timestamp:p}];const{onSessionStart:h}=n;h&&h(t,cne(u,this.history)),this.removeListeners=y6(VO(this.contextWindow,"pointermove",this.handlePointerMove),VO(this.contextWindow,"pointerup",this.handlePointerUp),VO(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(b6e.has(r.overflowX)||b6e.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0,passive:!0}),window.addEventListener("scroll",this.onWindowScroll,{passive:!0}),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,o=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:o.x-n.x,y:o.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,o),Ql.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),$C(this.updatePoint)}}function lne(e,t){return t?{point:t(e.point)}:e}function w6e(e,t){return{x:e.x-t.x,y:e.y-t.y}}function cne({point:e},t){return{point:e,delta:w6e(e,ypt(t)),offset:w6e(e,Ear(t)),velocity:Iar(t,.1)}}function Ear(e){return e[0]}function ypt(e){return e[e.length-1]}function Iar(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=ypt(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>tw(t)));)n--;if(!r)return{x:0,y:0};const i=g0(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function _ar(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?$c(n,e,r.max):Math.min(e,n)),e}function S6e(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function Par(e,{top:t,left:n,bottom:r,right:o}){return{x:S6e(e.x,n,o),y:S6e(e.y,t,r)}}function C6e(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=q$(t.min,t.max-r,e.min):r>o&&(n=q$(e.min,e.max-o,t.min)),yb(0,1,n)}function kar(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const lfe=.35;function Mar(e=lfe){return e===!1?e=0:e===!0&&(e=lfe),{x:N6e(e,"left","right"),y:N6e(e,"top","bottom")}}function N6e(e,t,n){return{min:j6e(e,t),max:j6e(e,n)}}function j6e(e,t){return typeof e=="number"?e:e[t]||0}const Rar=new WeakMap;class Oar{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=bd(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const i=p=>{n?(this.stopAnimation(),this.snapToCursor(w6(p).point)):this.pauseAnimation()},s=(p,h)=>{this.stopAnimation();const{drag:m,dragPropagation:g,onDragStart:y}=this.getProps();if(m&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=wor(m),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),qg(v=>{let b=this.getAxisMotionValue(v).get()||0;if(Zv.test(b)){const{projection:w}=this.visualElement;if(w&&w.layout){const S=w.layout.layoutBox[v];S&&(b=gh(S)*(parseFloat(b)/100))}}this.originPoint[v]=b}),y&&Ql.postRender(()=>y(p,h)),efe(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(p,h)=>{this.latestPointerEvent=p,this.latestPanInfo=h;const{dragPropagation:m,dragDirectionLock:g,onDirectionLock:y,onDrag:x}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:v}=h;if(g&&this.currentDirection===null){this.currentDirection=$ar(v),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,v),this.updateAxis("y",h.point,v),this.visualElement.render(),x&&x(p,h)},c=(p,h)=>{this.latestPointerEvent=p,this.latestPanInfo=h,this.stop(p,h),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>qg(p=>{var h;return this.getAnimationState(p)==="paused"&&((h=this.getAxisMotionValue(p).animation)==null?void 0:h.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new xpt(t,{onSessionStart:i,onStart:s,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:gpt(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,o=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!o||!r)return;const{velocity:s}=o;this.startAnimation(s);const{onDragEnd:l}=this.getProps();l&&Ql.postRender(()=>l(r,o))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!L7(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=_ar(s,this.constraints[t],this.elastic[t])),i.set(s)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,o=this.constraints;t&&zR(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=Par(r.layoutBox,t):this.constraints=!1,this.elastic=Mar(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&qg(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=kar(r.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!zR(t))return!1;const r=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=Lor(r,o.root,this.visualElement.getTransformPagePoint());let s=Aar(o.layout.layoutBox,i);if(n){const l=n(Oor(s));this.hasMutatedConstraints=!!l,l&&(s=zft(l))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=qg(d=>{if(!L7(d,n,this.currentDirection))return;let p=c&&c[d]||{};s&&(p={min:0,max:0});const h=o?200:1e6,m=o?40:1e7,g={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...p};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return efe(this.visualElement,t),r.start(gbe(t,r,0,n,this.visualElement,!1))}stopAnimation(){qg(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){qg(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){qg(n=>{const{drag:r}=this.getProps();if(!L7(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:s,max:l}=o.layout.layoutBox[n],c=i.get()||0;i.set(t[n]-$c(s,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!zR(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};qg(s=>{const l=this.getAxisMotionValue(s);if(l&&this.constraints!==!1){const c=l.get();o[s]=Tar({min:c,max:c},this.constraints[s])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),qg(s=>{if(!L7(s,t,null))return;const l=this.getAxisMotionValue(s),{min:c,max:u}=this.constraints[s];l.set($c(c,u,o[s]))})}addListeners(){if(!this.visualElement.current)return;Rar.set(this.visualElement,this);const t=this.visualElement.current,n=VO(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps(),p=c.target,h=p!==t&&Rft(p);u&&d&&!h&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();zR(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Ql.read(r);const s=Q$(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(qg(d=>{const p=this.getAxisMotionValue(d);p&&(this.originPoint[d]+=c[d].translate,p.set(p.get()+c[d].translate))}),this.visualElement.render())}));return()=>{s(),n(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:s=lfe,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:s,dragMomentum:l}}}function L7(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function $ar(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class Dar extends cN{constructor(t){super(t),this.removeGroupControls=C0,this.removeListeners=C0,this.controls=new Oar(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||C0}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const E6e=e=>(t,n)=>{e&&Ql.postRender(()=>e(t,n))};class Lar extends cN{constructor(){super(...arguments),this.removePointerDownListener=C0}onPointerDown(t){this.session=new xpt(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gpt(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:E6e(t),onStart:E6e(n),onMove:r,onEnd:(i,s)=>{delete this.session,o&&Ql.postRender(()=>o(i,s))}}}mount(){this.removePointerDownListener=VO(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let une=!1;class Far extends f.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),une&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),kB.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,{projection:s}=r;return s&&(s.isPresent=i,t.layoutDependency!==n&&s.setOptions({...s.options,layoutDependency:n}),une=!0,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?s.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?s.promote():s.relegate()||Ql.postRender(()=>{const l=s.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),bbe.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;une=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function vpt(e){const[t,n]=Ibe(),r=f.useContext(Qve);return a.jsx(Far,{...e,layoutGroup:r,switchLayoutGroup:f.useContext(hpt),isPresent:t,safeToRemove:n})}const zar={pan:{Feature:Lar},drag:{Feature:Dar,ProjectionNode:spt,MeasureLayout:vpt}};function I6e(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&Ql.postRender(()=>i(t,w6(t)))}class Bar extends cN{mount(){const{current:t}=this.node;t&&(this.unmount=Sor(t,(n,r)=>(I6e(this.node,r,"Start"),o=>I6e(this.node,o,"End"))))}unmount(){}}class Har extends cN{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=y6(Q$(this.node.current,"focus",()=>this.onFocus()),Q$(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function _6e(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&Ql.postRender(()=>i(t,w6(t)))}class Var extends cN{mount(){const{current:t}=this.node;t&&(this.unmount=jor(t,(n,r)=>(_6e(this.node,r,"Start"),(o,{success:i})=>_6e(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const cfe=new WeakMap,dne=new WeakMap,Uar=e=>{const t=cfe.get(e.target);t&&t(e)},War=e=>{e.forEach(Uar)};function Gar({root:e,...t}){const n=e||document;dne.has(n)||dne.set(n,{});const r=dne.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(War,{root:e,...t})),r[o]}function qar(e,t,n){const r=Gar(t);return cfe.set(e,n),r.observe(e),()=>{cfe.delete(e),r.unobserve(e)}}const Kar={some:0,all:1};class Yar extends cN{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:Kar[o]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:p}=this.node.getProps(),h=u?d:p;h&&h(c)};return qar(this.node.current,s,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Xar(t,n))&&this.startObserver()}unmount(){}}function Xar({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Qar={inView:{Feature:Yar},tap:{Feature:Var},focus:{Feature:Har},hover:{Feature:Bar}},Jar={layout:{ProjectionNode:spt,MeasureLayout:vpt}},Zar={...Car,...Qar,...zar,...Jar},wd=xar(Zar,yar),esr=(e,t)=>e.find(n=>n.id===t);function P6e(e,t){const n=bpt(e,t),r=n?e[n].findIndex(o=>o.id===t):-1;return{position:n,index:r}}function bpt(e,t){for(const[n,r]of Object.entries(e))if(esr(r,t))return n}const tsr=new Set([...enr,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),nsr=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function rsr(e){return(nsr.has(e)||!tsr.has(e))&&e[0]!=="_"}const osr=ctr(TH),isr=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:o,sx:i,...s}=t,[l]=mtr(s,nnr),c=Ov(e,t),u=Ker({},o,c,Pdt(l),i),d=cnr(u)(t.theme);return r?[d,r]:d};function fne(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=rsr);const o=isr({baseStyle:n}),i=osr(e,r)(o);return f.forwardRef(function(c,u){const{children:d,...p}=c,{colorMode:h,forced:m}=Ddt(),g=m?h:void 0;return f.createElement(i,{ref:u,"data-theme":g,...p},d)})}function asr(){const e=new Map;return new Proxy(fne,{apply(t,n,r){return fne(...r)},get(t,n){return e.has(n)||e.set(n,fne(n)),e.get(n)}})}const yi=asr();function Za(e){return f.forwardRef(e)}var pne,A6e;function ssr(){if(A6e)return pne;A6e=1;var e=typeof Element<"u",t=typeof Map=="function",n=typeof Set=="function",r=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function o(i,s){if(i===s)return!0;if(i&&s&&typeof i=="object"&&typeof s=="object"){if(i.constructor!==s.constructor)return!1;var l,c,u;if(Array.isArray(i)){if(l=i.length,l!=s.length)return!1;for(c=l;c--!==0;)if(!o(i[c],s[c]))return!1;return!0}var d;if(t&&i instanceof Map&&s instanceof Map){if(i.size!==s.size)return!1;for(d=i.entries();!(c=d.next()).done;)if(!s.has(c.value[0]))return!1;for(d=i.entries();!(c=d.next()).done;)if(!o(c.value[1],s.get(c.value[0])))return!1;return!0}if(n&&i instanceof Set&&s instanceof Set){if(i.size!==s.size)return!1;for(d=i.entries();!(c=d.next()).done;)if(!s.has(c.value[0]))return!1;return!0}if(r&&ArrayBuffer.isView(i)&&ArrayBuffer.isView(s)){if(l=i.length,l!=s.length)return!1;for(c=l;c--!==0;)if(i[c]!==s[c])return!1;return!0}if(i.constructor===RegExp)return i.source===s.source&&i.flags===s.flags;if(i.valueOf!==Object.prototype.valueOf&&typeof i.valueOf=="function"&&typeof s.valueOf=="function")return i.valueOf()===s.valueOf();if(i.toString!==Object.prototype.toString&&typeof i.toString=="function"&&typeof s.toString=="function")return i.toString()===s.toString();if(u=Object.keys(i),l=u.length,l!==Object.keys(s).length)return!1;for(c=l;c--!==0;)if(!Object.prototype.hasOwnProperty.call(s,u[c]))return!1;if(e&&i instanceof Element)return!1;for(c=l;c--!==0;)if(!((u[c]==="_owner"||u[c]==="__v"||u[c]==="__o")&&i.$$typeof)&&!o(i[u[c]],s[u[c]]))return!1;return!0}return i!==i&&s!==s}return pne=function(s,l){try{return o(s,l)}catch(c){if((c.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw c}},pne}var lsr=ssr();const csr=Ba(lsr);function S6(){const e=f.useContext(ck);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `` or ``");return e}function wpt(){const e=Ddt(),t=S6();return{...e,theme:t}}function usr(e,t,n){if(t==null)return t;const r=o=>{var i,s;return(s=(i=e.__cssMap)==null?void 0:i[o])==null?void 0:s.value};return r(t)??r(n)??n}function dsr(e,t,n){const r=Array.isArray(t)?t:[t],o=Array.isArray(n)?n:[n];return i=>{const s=o.filter(Boolean),l=r.map((c,u)=>{const d=`${e}.${c}`;return usr(i,d,s[u]??c)});return Array.isArray(t)?l:l[0]}}function fsr(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0&&t!=="children"&&!f.isValidElement(n)))}function Spt(e,t={}){const{styleConfig:n,...r}=t,{theme:o,colorMode:i}=wpt(),s=e?ltr(o,`components.${e}`):void 0,l=n||s,c=U1({theme:o,colorMode:i},(l==null?void 0:l.defaultProps)??{},fsr(r),(d,p)=>d?void 0:p),u=f.useRef({});if(l){const p=hnr(l)(c);csr(u.current,p)||(u.current=p)}return u.current}function nS(e,t={}){return Spt(e,t)}function r4(e,t={}){return Spt(e,t)}const T6e={path:a.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[a.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),a.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),a.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},uN=Za((e,t)=>{const{as:n,viewBox:r,color:o="currentColor",focusable:i=!1,children:s,className:l,__css:c,...u}=e,d=Vs("chakra-icon",l),p=nS("Icon",e),h={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:o,...c,...p},m={ref:t,focusable:i,className:d,__css:h},g=r??T6e.viewBox;if(n&&typeof n!="string")return a.jsx(yi.svg,{as:n,...m,...u});const y=s??T6e.path;return a.jsx(yi.svg,{verticalAlign:"middle",viewBox:g,...m,...u,children:y})});uN.displayName="Icon";function psr(e){return a.jsx(uN,{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function hsr(e){return a.jsx(uN,{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function k6e(e){return a.jsx(uN,{viewBox:"0 0 24 24",...e,children:a.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}const msr=gf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),Abe=Za((e,t)=>{const n=nS("Spinner",e),{label:r="Loading...",thickness:o="2px",speed:i="0.45s",emptyColor:s="transparent",className:l,...c}=yg(e),u=Vs("chakra-spinner",l),d={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:o,borderBottomColor:s,borderLeftColor:s,animation:`${msr} ${i} linear infinite`,...n};return a.jsx(yi.div,{ref:t,__css:d,className:u,...c,children:r&&a.jsx(yi.span,{srOnly:!0,children:r})})});Abe.displayName="Spinner";const[gsr,Tbe]=Y0({name:"AlertContext",hookName:"useAlertContext",providerName:""}),[xsr,kbe]=Y0({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:""}),Cpt={info:{icon:hsr,colorScheme:"blue"},warning:{icon:k6e,colorScheme:"orange"},success:{icon:psr,colorScheme:"green"},error:{icon:k6e,colorScheme:"red"},loading:{icon:Abe,colorScheme:"blue"}};function ysr(e){return Cpt[e].colorScheme}function vsr(e){return Cpt[e].icon}const Npt=Za(function(t,n){const{status:r="info",addRole:o=!0,...i}=yg(t),s=t.colorScheme??ysr(r),l=r4("Alert",{...t,colorScheme:s}),c={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return a.jsx(gsr,{value:{status:r},children:a.jsx(xsr,{value:l,children:a.jsx(yi.div,{"data-status":r,role:o?"alert":void 0,ref:n,...i,className:Vs("chakra-alert",t.className),__css:c})})})});Npt.displayName="Alert";function jpt(e){const{status:t}=Tbe(),n=vsr(t),r=kbe(),o=t==="loading"?r.spinner:r.icon;return a.jsx(yi.span,{display:"inherit","data-status":t,...e,className:Vs("chakra-alert__icon",e.className),__css:o,children:e.children||a.jsx(n,{h:"100%",w:"100%"})})}jpt.displayName="AlertIcon";const Ept=Za(function(t,n){const r=kbe(),{status:o}=Tbe();return a.jsx(yi.div,{ref:n,"data-status":o,...t,className:Vs("chakra-alert__title",t.className),__css:r.title})});Ept.displayName="AlertTitle";const Ipt=Za(function(t,n){const{status:r}=Tbe(),o=kbe(),i={display:"inline",...o.description};return a.jsx(yi.div,{ref:n,"data-status":r,...t,className:Vs("chakra-alert__desc",t.className),__css:i})});Ipt.displayName="AlertDescription";function bsr(e){return a.jsx(uN,{focusable:"false","aria-hidden":!0,...e,children:a.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}const Mbe=Za(function(t,n){const r=nS("CloseButton",t),{children:o,isDisabled:i,__css:s,...l}=yg(t),c={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return a.jsx(yi.button,{type:"button","aria-label":"Close",ref:n,disabled:i,__css:{...c,...r,...s},...l,children:o||a.jsx(bsr,{width:"1em",height:"1em"})})});Mbe.displayName="CloseButton";const wsr=e=>{const{status:t,variant:n="solid",id:r,title:o,isClosable:i,onClose:s,description:l,colorScheme:c,icon:u}=e,d=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return a.jsxs(Npt,{addRole:!1,status:t,variant:n,id:d==null?void 0:d.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:c,children:[a.jsx(jpt,{children:u}),a.jsxs(yi.div,{flex:"1",maxWidth:"100%",children:[o&&a.jsx(Ept,{id:d==null?void 0:d.title,children:o}),l&&a.jsx(Ipt,{id:d==null?void 0:d.description,display:"block",children:l})]}),i&&a.jsx(Mbe,{size:"sm",onClick:s,position:"absolute",insetEnd:1,top:1})]})};function _pt(e={}){const{render:t,toastComponent:n=wsr}=e;return o=>typeof t=="function"?t({...o,...e}):a.jsx(n,{...o,...e})}const Ssr={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Lj=Csr(Ssr);function Csr(e){let t=e;const n=new Set,r=o=>{t=o(t),n.forEach(i=>i())};return{getState:()=>t,subscribe:o=>(n.add(o),()=>{r(()=>e),n.delete(o)}),removeToast:(o,i)=>{r(s=>({...s,[i]:s[i].filter(l=>l.id!=o)}))},notify:(o,i)=>{const s=Nsr(o,i),{position:l,id:c}=s;return r(u=>{const p=l.includes("top")?[s,...u[l]??[]]:[...u[l]??[],s];return{...u,[l]:p}}),c},update:(o,i)=>{o&&r(s=>{const l={...s},{position:c,index:u}=P6e(l,o);return c&&u!==-1&&(l[c][u]={...l[c][u],...i,message:_pt(i)}),l})},closeAll:({positions:o}={})=>{r(i=>(o??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((c,u)=>(c[u]=i[u].map(d=>({...d,requestClose:!0})),c),{...i}))},close:o=>{r(i=>{const s=bpt(i,o);return s?{...i,[s]:i[s].map(l=>l.id==o?{...l,requestClose:!0}:l)}:i})},isActive:o=>!!P6e(Lj.getState(),o).position}}let M6e=0;function Nsr(e,t={}){M6e+=1;const n=t.id??M6e,r=t.position??"bottom";return{id:n,message:e,position:r,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>Lj.removeToast(String(n),r),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}const[Ppt,jsr]=Y0({strict:!1,name:"PortalContext"}),Rbe="chakra-portal",Esr=".chakra-portal",Isr=e=>a.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),_sr=e=>{const{appendToParentPortal:t,children:n}=e,[r,o]=f.useState(null),i=f.useRef(null),[,s]=f.useState({});f.useEffect(()=>s({}),[]);const l=jsr(),c=mnr();iW(()=>{if(!r)return;const d=r.ownerDocument,p=t?l??d.body:d.body;if(!p)return;i.current=d.createElement("div"),i.current.className=Rbe,p.appendChild(i.current),s({});const h=i.current;return()=>{p.contains(h)&&p.removeChild(h)}},[r]);const u=c!=null&&c.zIndex?a.jsx(Isr,{zIndex:c==null?void 0:c.zIndex,children:n}):n;return i.current?pu.createPortal(a.jsx(Ppt,{value:i.current,children:u}),i.current):a.jsx("span",{ref:d=>{d&&o(d)}})},Psr=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,o=n.current,i=o??(typeof window<"u"?document.body:void 0),s=f.useMemo(()=>{const c=o==null?void 0:o.ownerDocument.createElement("div");return c&&(c.className=Rbe),c},[o]),[,l]=f.useState({});return iW(()=>l({}),[]),iW(()=>{if(!(!s||!i))return i.appendChild(s),()=>{i.removeChild(s)}},[s,i]),i&&s?pu.createPortal(a.jsx(Ppt,{value:r?s:null,children:t}),s):null};function C6(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?a.jsx(Psr,{containerRef:n,...r}):a.jsx(_sr,{...r})}C6.className=Rbe;C6.selector=Esr;C6.displayName="Portal";const[Xno,Asr]=Y0({name:"ToastOptionsContext",strict:!1}),zP={ease:[.25,.1,.25,1],easeIn:[.4,0,1,1],easeOut:[0,0,.2,1]},VE={enter:{duration:.2,ease:zP.easeOut},exit:{duration:.1,ease:zP.easeIn}},nw={enter:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.enter}),exit:(e,t)=>({...e,delay:typeof t=="number"?t:t==null?void 0:t.exit})},Tsr=e=>e!=null&&parseInt(e.toString(),10)>0,R6e={exit:{height:{duration:.2,ease:zP.ease},opacity:{duration:.3,ease:zP.ease}},enter:{height:{duration:.3,ease:zP.ease},opacity:{duration:.4,ease:zP.ease}}},ksr={exit:({animateOpacity:e,startingHeight:t,transition:n,transitionEnd:r,delay:o})=>({...e&&{opacity:Tsr(t)?1:0},height:t,transitionEnd:r==null?void 0:r.exit,transition:(n==null?void 0:n.exit)??nw.exit(R6e.exit,o)}),enter:({animateOpacity:e,endingHeight:t,transition:n,transitionEnd:r,delay:o})=>({...e&&{opacity:1},height:t,transitionEnd:r==null?void 0:r.enter,transition:(n==null?void 0:n.enter)??nw.enter(R6e.enter,o)})},ufe=f.forwardRef((e,t)=>{const{in:n,unmountOnExit:r,animateOpacity:o=!0,startingHeight:i=0,endingHeight:s="auto",style:l,className:c,transition:u,transitionEnd:d,animatePresenceProps:p,...h}=e,[m,g]=f.useState(!1);f.useEffect(()=>{const w=setTimeout(()=>{g(!0)});return()=>clearTimeout(w)},[]);const y=parseFloat(i.toString())>0,x={startingHeight:i,endingHeight:s,animateOpacity:o,transition:m?u:{enter:{duration:0}},transitionEnd:{enter:d==null?void 0:d.enter,exit:r?d==null?void 0:d.exit:{...d==null?void 0:d.exit,display:y?"block":"none"}}},v=r?n:!0,b=n||r?"enter":"exit";return a.jsx(g5,{...p,initial:!1,custom:x,children:v&&a.jsx(wd.div,{ref:t,...h,className:Vs("chakra-collapse",c),style:{overflow:"hidden",display:"block",...l},custom:x,variants:ksr,initial:r?"exit":!1,animate:b,exit:"exit"})})});ufe.displayName="Collapse";const BP=Za(function(t,n){const r=nS("Badge",t),{className:o,...i}=yg(t);return a.jsx(yi.span,{ref:n,className:Vs("chakra-badge",t.className),...i,__css:{display:"inline-block",whiteSpace:"nowrap",verticalAlign:"middle",...r}})});BP.displayName="Badge";const uc=yi("div");uc.displayName="Box";const[Qno,Msr]=Y0({strict:!1,name:"ButtonGroupContext"});function BR(e){const{children:t,className:n,...r}=e,o=f.isValidElement(t)?f.cloneElement(t,{"aria-hidden":!0,focusable:!1}):t,i=Vs("chakra-button__icon",n);return a.jsx(yi.span,{display:"inline-flex",alignSelf:"center",flexShrink:0,...r,className:i,children:o})}BR.displayName="ButtonIcon";function dfe(e){const{label:t,placement:n,spacing:r="0.5rem",children:o=a.jsx(Abe,{color:"currentColor",width:"1em",height:"1em"}),className:i,__css:s,...l}=e,c=Vs("chakra-button__spinner",i),u=n==="start"?"marginEnd":"marginStart",d=f.useMemo(()=>({display:"flex",alignItems:"center",position:t?"relative":"absolute",[u]:t?r:0,fontSize:"1em",lineHeight:"normal",...s}),[s,t,u,r]);return a.jsx(yi.div,{className:c,...l,__css:d,children:o})}dfe.displayName="ButtonSpinner";function Rsr(e){const[t,n]=f.useState(!e);return{ref:f.useCallback(i=>{i&&n(i.tagName==="BUTTON")},[]),type:t?"button":void 0}}const Fj=Za((e,t)=>{const n=Msr(),r=nS("Button",{...n,...e}),{isDisabled:o=n==null?void 0:n.isDisabled,isLoading:i,isActive:s,children:l,leftIcon:c,rightIcon:u,loadingText:d,iconSpacing:p="0.5rem",type:h,spinner:m,spinnerPlacement:g="start",className:y,as:x,shouldWrapChildren:v,...b}=yg(e),w=f.useMemo(()=>{const j={...r==null?void 0:r._focus,zIndex:1};return{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",whiteSpace:"nowrap",verticalAlign:"middle",outline:"none",...r,...!!n&&{_focus:j}}},[r,n]),{ref:S,type:C}=Rsr(x),N={rightIcon:u,leftIcon:c,iconSpacing:p,children:l,shouldWrapChildren:v};return a.jsxs(yi.button,{disabled:o||i,ref:btr(t,S),as:x,type:h??C,"data-active":lv(s),"data-loading":lv(i),__css:w,className:Vs("chakra-button",y),...b,children:[i&&g==="start"&&a.jsx(dfe,{className:"chakra-button__spinner--start",label:d,placement:"start",spacing:p,children:m}),i?d||a.jsx(yi.span,{opacity:0,children:a.jsx(O6e,{...N})}):a.jsx(O6e,{...N}),i&&g==="end"&&a.jsx(dfe,{className:"chakra-button__spinner--end",label:d,placement:"end",spacing:p,children:m})]})});Fj.displayName="Button";function O6e(e){const{leftIcon:t,rightIcon:n,children:r,iconSpacing:o,shouldWrapChildren:i}=e;return i?a.jsxs("span",{style:{display:"contents"},children:[t&&a.jsx(BR,{marginEnd:o,children:t}),r,n&&a.jsx(BR,{marginStart:o,children:n})]}):a.jsxs(a.Fragment,{children:[t&&a.jsx(BR,{marginEnd:o,children:t}),r,n&&a.jsx(BR,{marginStart:o,children:n})]})}const MB=Za((e,t)=>{const{icon:n,children:r,isRound:o,"aria-label":i,...s}=e,l=n||r,c=f.isValidElement(l)?f.cloneElement(l,{"aria-hidden":!0,focusable:!1}):null;return a.jsx(Fj,{px:"0",py:"0",borderRadius:o?"full":void 0,ref:t,"aria-label":i,...s,children:c})});MB.displayName="IconButton";const[Osr,$sr]=Y0({name:"FormControlStylesContext",errorMessage:`useFormControlStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Dsr,Apt]=Y0({strict:!1,name:"FormControlContext"});function Lsr(e){const{id:t,isRequired:n,isInvalid:r,isDisabled:o,isReadOnly:i,...s}=e,l=f.useId(),c=t||`field-${l}`,u=`${c}-label`,d=`${c}-feedback`,p=`${c}-helptext`,[h,m]=f.useState(!1),[g,y]=f.useState(!1),[x,v]=f.useState(!1),b=f.useCallback((j={},I=null)=>({id:p,...j,ref:OC(I,_=>{_&&y(!0)})}),[p]),w=f.useCallback((j={},I=null)=>({...j,ref:I,"data-focus":lv(x),"data-disabled":lv(o),"data-invalid":lv(r),"data-readonly":lv(i),id:j.id!==void 0?j.id:u,htmlFor:j.htmlFor!==void 0?j.htmlFor:c}),[c,o,x,r,i,u]),S=f.useCallback((j={},I=null)=>({id:d,...j,ref:OC(I,_=>{_&&m(!0)}),"aria-live":"polite"}),[d]),C=f.useCallback((j={},I=null)=>({...j,...s,ref:I,role:"group","data-focus":lv(x),"data-disabled":lv(o),"data-invalid":lv(r),"data-readonly":lv(i)}),[s,o,x,r,i]),N=f.useCallback((j={},I=null)=>({...j,ref:I,role:"presentation","aria-hidden":!0,children:j.children||"*"}),[]);return{isRequired:!!n,isInvalid:!!r,isReadOnly:!!i,isDisabled:!!o,isFocused:!!x,onFocus:()=>v(!0),onBlur:()=>v(!1),hasFeedbackText:h,setHasFeedbackText:m,hasHelpText:g,setHasHelpText:y,id:c,labelId:u,feedbackId:d,helpTextId:p,htmlProps:s,getHelpTextProps:b,getErrorMessageProps:S,getRootProps:C,getLabelProps:w,getRequiredIndicatorProps:N}}const Fsr=Za(function(t,n){const r=r4("Form",t),o=yg(t),{getRootProps:i,htmlProps:s,...l}=Lsr(o),c=Vs("chakra-form-control",t.className);return a.jsx(Dsr,{value:l,children:a.jsx(Osr,{value:r,children:a.jsx(yi.div,{...i({},n),className:c,__css:r.container})})})});Fsr.displayName="FormControl";const zsr=Za(function(t,n){const r=Apt(),o=$sr(),i=Vs("chakra-form__helper-text",t.className);return a.jsx(yi.div,{...r==null?void 0:r.getHelpTextProps(t,n),__css:o.helperText,className:i})});zsr.displayName="FormHelperText";function Bsr(e){const{isDisabled:t,isInvalid:n,isReadOnly:r,isRequired:o,...i}=Hsr(e);return{...i,disabled:t,readOnly:r,required:o,"aria-invalid":qte(n),"aria-required":qte(o),"aria-readonly":qte(r)}}function Hsr(e){const t=Apt(),{id:n,disabled:r,readOnly:o,required:i,isRequired:s,isInvalid:l,isReadOnly:c,isDisabled:u,onFocus:d,onBlur:p,...h}=e,m=e["aria-describedby"]?[e["aria-describedby"]]:[];return t!=null&&t.hasFeedbackText&&(t!=null&&t.isInvalid)&&m.push(t.feedbackId),t!=null&&t.hasHelpText&&m.push(t.helpTextId),{...h,"aria-describedby":m.join(" ")||void 0,id:n??(t==null?void 0:t.id),isDisabled:r??u??(t==null?void 0:t.isDisabled),isReadOnly:o??c??(t==null?void 0:t.isReadOnly),isRequired:i??s??(t==null?void 0:t.isRequired),isInvalid:l??(t==null?void 0:t.isInvalid),onFocus:s0(t==null?void 0:t.onFocus,d),onBlur:s0(t==null?void 0:t.onBlur,p)}}const Tpt=Za(function(t,n){const r=nS("Code",t),{className:o,...i}=yg(t);return a.jsx(yi.code,{ref:n,className:Vs("chakra-code",t.className),...i,__css:{display:"inline-block",...r}})});Tpt.displayName="Code";const dv=Za(function(t,n){const{direction:r,align:o,justify:i,wrap:s,basis:l,grow:c,shrink:u,...d}=t,p={display:"flex",flexDirection:r,alignItems:o,justifyContent:i,flexWrap:s,flexBasis:l,flexGrow:c,flexShrink:u};return a.jsx(yi.div,{ref:n,__css:p,...d})});dv.displayName="Flex";var ffe="data-focus-lock",kpt="data-focus-lock-disabled",Vsr="data-no-focus-lock",Usr="data-autofocus-inside",Wsr="data-no-autofocus";function hne(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Gsr(e,t){var n=f.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var qsr=typeof window<"u"?f.useLayoutEffect:f.useEffect,$6e=new WeakMap;function Mpt(e,t){var n=Gsr(null,function(r){return e.forEach(function(o){return hne(o,r)})});return qsr(function(){var r=$6e.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(l){i.has(l)||hne(l,null)}),i.forEach(function(l){o.has(l)||hne(l,s)})}$6e.set(n,e)},[e]),n}var mne={width:"1px",height:"0px",padding:0,overflow:"hidden",position:"fixed",top:"1px",left:"1px"},Pv=function(){return Pv=Object.assign||function(t){for(var n,r=1,o=arguments.length;r=0}).sort(clr)},dlr=["button:enabled","select:enabled","textarea:enabled","input:enabled","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[tabindex]","[contenteditable]","[autofocus]"],Fbe=dlr.join(","),flr="".concat(Fbe,", [data-focus-guard]"),Ypt=function(e,t){return Mb((e.shadowRoot||e).children).reduce(function(n,r){return n.concat(r.matches(t?flr:Fbe)?[r]:[],Ypt(r))},[])},plr=function(e,t){var n;return e instanceof HTMLIFrameElement&&(!((n=e.contentDocument)===null||n===void 0)&&n.body)?RT([e.contentDocument.body],t):[e]},RT=function(e,t){return e.reduce(function(n,r){var o,i=Ypt(r,t),s=(o=[]).concat.apply(o,i.map(function(l){return plr(l,t)}));return n.concat(s,r.parentNode?Mb(r.parentNode.querySelectorAll(Fbe)).filter(function(l){return l===r}):[])},[])},hlr=function(e){var t=e.querySelectorAll("[".concat(Usr,"]"));return Mb(t).map(function(n){return RT([n])}).reduce(function(n,r){return n.concat(r)},[])},zbe=function(e,t){return Mb(e).filter(function(n){return Upt(t,n)}).filter(function(n){return alr(n)})},D6e=function(e,t){return t===void 0&&(t=new Map),Mb(e).filter(function(n){return Wpt(t,n)})},Bbe=function(e,t,n){return Lbe(zbe(RT(e,n),t),!0,n)},J$=function(e,t){return Lbe(zbe(RT(e),t),!1)},mlr=function(e,t){return zbe(hlr(e),t)},UE=function(e,t){return e.shadowRoot?UE(e.shadowRoot,t):Object.getPrototypeOf(e).contains!==void 0&&Object.getPrototypeOf(e).contains.call(e,t)?!0:Mb(e.children).some(function(n){var r;if(n instanceof HTMLIFrameElement){var o=(r=n.contentDocument)===null||r===void 0?void 0:r.body;return o?UE(o,t):!1}return UE(n,t)})},glr=function(e){for(var t=new Set,n=e.length,r=0;r0&&t.add(o),(i&Node.DOCUMENT_POSITION_CONTAINS)>0&&t.add(r)}return e.filter(function(s,l){return!t.has(l)})},Xpt=function(e){return e.parentNode?Xpt(e.parentNode):e},Hbe=function(e){var t=EI(e);return t.filter(Boolean).reduce(function(n,r){var o=r.getAttribute(ffe);return n.push.apply(n,o?glr(Mb(Xpt(r).querySelectorAll("[".concat(ffe,'="').concat(o,'"]:not([').concat(kpt,'="disabled"])')))):[r]),n},[])},xlr=function(e){try{return e()}catch{return}},Z$=function(e){if(e===void 0&&(e=document),!(!e||!e.activeElement)){var t=e.activeElement;return t.shadowRoot?Z$(t.shadowRoot):t instanceof HTMLIFrameElement&&xlr(function(){return t.contentWindow.document})?Z$(t.contentWindow.document):t}},ylr=function(e,t){return e===t},vlr=function(e,t){return!!Mb(e.querySelectorAll("iframe")).some(function(n){return ylr(n,t)})},Qpt=function(e,t){return t===void 0&&(t=Z$(Bpt(e).ownerDocument)),!t||t.dataset&&t.dataset.focusGuard?!1:Hbe(e).some(function(n){return UE(n,t)||vlr(n,t)})},blr=function(e){e===void 0&&(e=document);var t=Z$(e);return t?Mb(e.querySelectorAll("[".concat(Vsr,"]"))).some(function(n){return UE(n,t)}):!1},wlr=function(e,t){return t.filter(Kpt).filter(function(n){return n.name===e.name}).filter(function(n){return n.checked})[0]||e},Vbe=function(e,t){return Kpt(e)&&e.name?wlr(e,t):e},Slr=function(e){var t=new Set;return e.forEach(function(n){return t.add(Vbe(n,e))}),e.filter(function(n){return t.has(n)})},L6e=function(e){return e[0]&&e.length>1?Vbe(e[0],e):e[0]},F6e=function(e,t){return e.indexOf(Vbe(t,e))},hfe="NEW_FOCUS",Clr=function(e,t,n,r,o){var i=e.length,s=e[0],l=e[i-1],c=Dbe(r);if(!(r&&e.indexOf(r)>=0)){var u=r!==void 0?n.indexOf(r):-1,d=o?n.indexOf(o):u,p=o?e.indexOf(o):-1;if(u===-1)return p!==-1?p:hfe;if(p===-1)return hfe;var h=u-d,m=n.indexOf(s),g=n.indexOf(l),y=Slr(n),x=r!==void 0?y.indexOf(r):-1,v=o?y.indexOf(o):x,b=y.filter(function(I){return I.tabIndex>=0}),w=r!==void 0?b.indexOf(r):-1,S=o?b.indexOf(o):w,C=w>=0&&S>=0?S-w:v-x;if(!h&&p>=0||t.length===0)return p;var N=F6e(e,t[0]),j=F6e(e,t[t.length-1]);if(u<=m&&c&&Math.abs(h)>1)return j;if(u>=g&&c&&Math.abs(h)>1)return N;if(h&&Math.abs(C)>1)return p;if(u<=m)return j;if(u>g)return N;if(h)return Math.abs(h)>1?p:(i+p+h)%i}},Nlr=function(e){return function(t){var n,r=(n=Gpt(t))===null||n===void 0?void 0:n.autofocus;return t.autofocus||r!==void 0&&r!=="false"||e.indexOf(t)>=0}},z6e=function(e,t,n){var r=e.map(function(i){var s=i.node;return s}),o=D6e(r.filter(Nlr(n)));return o&&o.length?L6e(o):L6e(D6e(t))},mfe=function(e,t){return t===void 0&&(t=[]),t.push(e),e.parentNode&&mfe(e.parentNode.host||e.parentNode,t),t},gne=function(e,t){for(var n=mfe(e),r=mfe(t),o=0;o=0)return i}return!1},Jpt=function(e,t,n){var r=EI(e),o=EI(t),i=r[0],s=!1;return o.filter(Boolean).forEach(function(l){s=gne(s||l,l)||s,n.filter(Boolean).forEach(function(c){var u=gne(i,c);u&&(!s||UE(u,s)?s=u:s=gne(u,s))})}),s},B6e=function(e,t){return e.reduce(function(n,r){return n.concat(mlr(r,t))},[])},jlr=function(e,t){var n=new Map;return t.forEach(function(r){return n.set(r.node,r)}),e.map(function(r){return n.get(r)}).filter(llr)},Elr=function(e,t){var n=Z$(EI(e).length>0?document:Bpt(e).ownerDocument),r=Hbe(e).filter(pfe),o=Jpt(n||e,e,r),i=new Map,s=J$(r,i),l=s.filter(function(g){var y=g.node;return pfe(y)});if(l[0]){var c=J$([o],i).map(function(g){var y=g.node;return y}),u=jlr(c,l),d=u.map(function(g){var y=g.node;return y}),p=u.filter(function(g){var y=g.tabIndex;return y>=0}).map(function(g){var y=g.node;return y}),h=Clr(d,p,c,n,t);if(h===hfe){var m=z6e(s,p,B6e(r,i))||z6e(s,d,B6e(r,i));if(m)return{node:m};console.warn("focus-lock: cannot find any node to move focus into");return}return h===void 0?h:u[h]}},Ilr=function(e){var t=Hbe(e).filter(pfe),n=Jpt(e,e,t),r=Lbe(RT([n],!0),!0,!0),o=RT(t,!1);return r.map(function(i){var s=i.node,l=i.index;return{node:s,index:l,lockItem:o.indexOf(s)>=0,guard:Dbe(s)}})},Ube=function(e,t){e&&("focus"in e&&e.focus(t),"contentWindow"in e&&e.contentWindow&&e.contentWindow.focus())},xne=0,yne=!1,Zpt=function(e,t,n){n===void 0&&(n={});var r=Elr(e,t);if(!yne&&r){if(xne>2){console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting"),yne=!0,setTimeout(function(){yne=!1},1);return}xne++,Ube(r.node,n.focusOptions),xne--}};function $M(e){if(!e)return null;if(typeof WeakRef>"u")return function(){return e||null};var t=e?new WeakRef(e):null;return function(){return(t==null?void 0:t.deref())||null}}var _lr=function(e){if(!e)return null;for(var t=[],n=e;n&&n!==document.body;)t.push({current:$M(n),parent:$M(n.parentElement),left:$M(n.previousElementSibling),right:$M(n.nextElementSibling)}),n=n.parentElement;return{element:$M(e),stack:t,ownerDocument:e.ownerDocument}},Plr=function(e){var t,n,r,o,i;if(e)for(var s=e.stack,l=e.ownerDocument,c=new Map,u=0,d=s;u-1&&(x.filter(function(b){var w=b.guard,S=b.node;return w&&S.dataset.focusAutoGuard}).forEach(function(b){var w=b.node;return w.removeAttribute("tabIndex")}),V6e(v,x.length,1,x),V6e(v,-1,-1,x))}}}return t},iht=function(t){hW()&&t&&(t.stopPropagation(),t.preventDefault())},qbe=function(){return Wbe(hW)},qlr=function(t){var n=t.target,r=t.currentTarget;r.contains(n)||Blr(r,n)},Klr=function(){return null},aht=function(){Gbe=!0},sht=function(){Gbe=!1,eD="just",Wbe(function(){eD="meanwhile"})},Ylr=function(){document.addEventListener("focusin",iht),document.addEventListener("focusout",qbe),window.addEventListener("focus",aht),window.addEventListener("blur",sht)},Xlr=function(){document.removeEventListener("focusin",iht),document.removeEventListener("focusout",qbe),window.removeEventListener("focus",aht),window.removeEventListener("blur",sht)};function Qlr(e){return e.filter(function(t){var n=t.disabled;return!n})}var lht={moveFocusInside:Zpt,focusInside:Qpt,focusNextElement:Mlr,focusPrevElement:Rlr,focusFirstElement:Olr,focusLastElement:$lr,captureFocusRestore:eht};function Jlr(e){var t=e.slice(-1)[0];t&&!vA&&Ylr();var n=vA,r=n&&t&&t.id===n.id;vA=t,n&&!r&&(n.onDeactivation(),e.filter(function(o){var i=o.id;return i===n.id}).length||n.returnFocus(!t)),t?(Xh=null,(!r||n.observed!==t.observed)&&t.onActivation(lht),hW(),Wbe(hW)):(Xlr(),Xh=null)}Fpt.assignSyncMedium(qlr);zpt.assignMedium(qbe);Xsr.assignMedium(function(e){return e(lht)});const Zlr=elr(Qlr,Jlr)(Klr);var gfe=f.forwardRef(function(t,n){return Ie.createElement($be,Se({sideCar:Zlr,ref:n},t))}),cht=$be.propTypes||{};cht.sideCar;Zn(cht,["sideCar"]);gfe.propTypes={};const ecr=gfe.default??gfe,uht=e=>{const{initialFocusRef:t,finalFocusRef:n,contentRef:r,restoreFocus:o,children:i,isDisabled:s,autoFocus:l,persistentFocus:c,lockFocusAcrossFrames:u}=e,d=f.useCallback(()=>{t!=null&&t.current?t.current.focus():r!=null&&r.current&&itr(r.current).length===0&&requestAnimationFrame(()=>{var g;(g=r.current)==null||g.focus()})},[t,r]),p=f.useCallback(()=>{var m;(m=n==null?void 0:n.current)==null||m.focus()},[n]),h=o&&!n;return a.jsx(ecr,{crossFrame:u,persistentFocus:c,autoFocus:l,disabled:s,onActivation:d,onDeactivation:p,returnFocus:h,children:i})};uht.displayName="FocusLock";const dht=Za(function(t,n){const{templateAreas:r,gap:o,rowGap:i,columnGap:s,column:l,row:c,autoFlow:u,autoRows:d,templateRows:p,autoColumns:h,templateColumns:m,...g}=t,y={display:"grid",gridTemplateAreas:r,gridGap:o,gridRowGap:i,gridColumnGap:s,gridAutoColumns:h,gridColumn:l,gridRow:c,gridAutoFlow:u,gridAutoRows:d,gridTemplateRows:p,gridTemplateColumns:m};return a.jsx(yi.div,{ref:n,__css:y,...g})});dht.displayName="Grid";const Kbe=Za(function(t,n){const{columns:r,spacingX:o,spacingY:i,spacing:s,minChildWidth:l,...c}=t,u=S6(),d=l?ncr(l,u):rcr(r);return a.jsx(dht,{ref:n,gap:s,columnGap:o,rowGap:i,templateColumns:d,...c})});Kbe.displayName="SimpleGrid";function tcr(e){return typeof e=="number"?`${e}px`:e}function ncr(e,t){return qve(e,n=>{const r=dsr("sizes",n,tcr(n))(t);return n===null?null:`repeat(auto-fit, minmax(${r}, 1fr))`})}function rcr(e){return qve(e,t=>t===null?null:`repeat(${t}, minmax(0, 1fr))`)}const Ybe=Za(function(t,n){const{htmlSize:r,...o}=t,i=r4("Input",o),s=yg(o),l=Bsr(s),c=Vs("chakra-input",t.className);return a.jsx(yi.input,{size:r,...l,__css:i.field,ref:n,className:c})});Ybe.displayName="Input";Ybe.id="Input";function ocr(e,t={}){const{ssr:n=!0,fallback:r}=t,{getWindow:o}=gnr(),i=Array.isArray(e)?e:[e];let s=Array.isArray(r)?r:[r];s=s.filter(u=>u!=null);const[l,c]=f.useState(()=>i.map((u,d)=>({media:u,matches:n?!!s[d]:o().matchMedia(u).matches})));return f.useEffect(()=>{const u=o();c(i.map(h=>({media:h,matches:u.matchMedia(h).matches})));const d=i.map(h=>u.matchMedia(h)),p=h=>{c(m=>m.slice().map(g=>g.media===h.media?{...g,matches:h.matches}:g))};return d.forEach(h=>{typeof h.addListener=="function"?h.addListener(p):h.addEventListener("change",p)}),()=>{d.forEach(h=>{typeof h.removeListener=="function"?h.removeListener(p):h.removeEventListener("change",p)})}},[o]),l.map(u=>u.matches)}function icr(e){var l;const t=ew(e)?e:{fallback:e??"base"},r=S6().__breakpoints.details.map(({minMaxQuery:c,breakpoint:u})=>({breakpoint:u,query:c.replace("@media screen and ","")})),o=r.map(c=>c.breakpoint===t.fallback),s=ocr(r.map(c=>c.query),{fallback:o,ssr:t.ssr}).findIndex(c=>c==!0);return((l=r[s])==null?void 0:l.breakpoint)??t.fallback}function acr(e,t,n=Tdt){let r=Object.keys(e).indexOf(t);if(r!==-1)return e[t];let o=n.indexOf(t);for(;o>=0;){const i=n[o];if(e.hasOwnProperty(i)){r=o;break}o-=1}if(r!==-1){const i=n[r];return e[i]}}function scr(e,t){var l;const n=ew(t)?t:{fallback:"base"},r=icr(n),o=S6();if(!r)return;const i=Array.from(((l=o.__breakpoints)==null?void 0:l.keys)||[]),s=Array.isArray(e)?Object.fromEntries(Object.entries(dtr(e,i)).map(([c,u])=>[c,u])):e;return acr(s,r,i)}const j_=(e,t)=>({var:e,varRef:t?`var(${e}, ${t})`:`var(${e})`}),Lf={arrowShadowColor:j_("--popper-arrow-shadow-color"),arrowSize:j_("--popper-arrow-size","8px"),arrowSizeHalf:j_("--popper-arrow-size-half"),arrowBg:j_("--popper-arrow-bg"),transformOrigin:j_("--popper-transform-origin"),arrowOffset:j_("--popper-arrow-offset")};function lcr(e){if(e.includes("top"))return"1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("bottom"))return"-1px -1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("right"))return"-1px 1px 0px 0 var(--popper-arrow-shadow-color)";if(e.includes("left"))return"1px -1px 0px 0 var(--popper-arrow-shadow-color)"}const ccr={top:"bottom center","top-start":"bottom left","top-end":"bottom right",bottom:"top center","bottom-start":"top left","bottom-end":"top right",left:"right center","left-start":"right top","left-end":"right bottom",right:"left center","right-start":"left top","right-end":"left bottom"},ucr=e=>ccr[e],U6e={scroll:!0,resize:!0};function dcr(e){let t;return typeof e=="object"?t={enabled:!0,options:{...U6e,...e}}:t={enabled:e,options:U6e},t}const fcr={name:"matchWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:e})=>{e.styles.popper.width=`${e.rects.reference.width}px`},effect:({state:e})=>()=>{const t=e.elements.reference;e.elements.popper.style.width=`${t.offsetWidth}px`}},pcr={name:"transformOrigin",enabled:!0,phase:"write",fn:({state:e})=>{W6e(e)},effect:({state:e})=>()=>{W6e(e)}},W6e=e=>{e.elements.popper.style.setProperty(Lf.transformOrigin.var,ucr(e.placement))},hcr={name:"positionArrow",enabled:!0,phase:"afterWrite",fn:({state:e})=>{mcr(e)}},mcr=e=>{var n;if(!e.placement)return;const t=gcr(e.placement);if((n=e.elements)!=null&&n.arrow&&t){Object.assign(e.elements.arrow.style,{[t.property]:t.value,width:Lf.arrowSize.varRef,height:Lf.arrowSize.varRef,zIndex:-1});const r={[Lf.arrowSizeHalf.var]:`calc(${Lf.arrowSize.varRef} / 2 - 1px)`,[Lf.arrowOffset.var]:`calc(${Lf.arrowSizeHalf.varRef} * -1)`};for(const o in r)e.elements.arrow.style.setProperty(o,r[o])}},gcr=e=>{if(e.startsWith("top"))return{property:"bottom",value:Lf.arrowOffset.varRef};if(e.startsWith("bottom"))return{property:"top",value:Lf.arrowOffset.varRef};if(e.startsWith("left"))return{property:"right",value:Lf.arrowOffset.varRef};if(e.startsWith("right"))return{property:"left",value:Lf.arrowOffset.varRef}},xcr={name:"innerArrow",enabled:!0,phase:"main",requires:["arrow"],fn:({state:e})=>{G6e(e)},effect:({state:e})=>()=>{G6e(e)}},G6e=e=>{if(!e.elements.arrow)return;const t=e.elements.arrow.querySelector("[data-popper-arrow-inner]");if(!t)return;const n=lcr(e.placement);n&&t.style.setProperty("--popper-arrow-default-shadow",n),Object.assign(t.style,{transform:"rotate(45deg)",background:Lf.arrowBg.varRef,top:0,left:0,width:"100%",height:"100%",position:"absolute",zIndex:"inherit",boxShadow:"var(--popper-arrow-shadow, var(--popper-arrow-default-shadow))"})},ycr={"start-start":{ltr:"left-start",rtl:"right-start"},"start-end":{ltr:"left-end",rtl:"right-end"},"end-start":{ltr:"right-start",rtl:"left-start"},"end-end":{ltr:"right-end",rtl:"left-end"},start:{ltr:"left",rtl:"right"},end:{ltr:"right",rtl:"left"}},vcr={"auto-start":"auto-end","auto-end":"auto-start","top-start":"top-end","top-end":"top-start","bottom-start":"bottom-end","bottom-end":"bottom-start"};function bcr(e,t="ltr"){var r;const n=((r=ycr[e])==null?void 0:r[t])||e;return t==="ltr"?n:vcr[e]??n}function wcr(e={}){const{enabled:t=!0,modifiers:n,placement:r="bottom",strategy:o="absolute",arrowPadding:i=8,eventListeners:s=!0,offset:l,gutter:c=8,flip:u=!0,boundary:d="clippingParents",preventOverflow:p=!0,matchWidth:h,direction:m="ltr"}=e,g=f.useRef(null),y=f.useRef(null),x=f.useRef(null),v=bcr(r,m),b=f.useRef(()=>{}),w=f.useCallback(()=>{var T;!t||!g.current||!y.current||((T=b.current)==null||T.call(b),x.current=Unt(g.current,y.current,{placement:v,modifiers:[xcr,hcr,pcr,{...fcr,enabled:!!h},{name:"eventListeners",...dcr(s)},{name:"arrow",options:{padding:i}},{name:"offset",options:{offset:l??[0,c]}},{name:"flip",enabled:!!u,options:{padding:8}},{name:"preventOverflow",enabled:!!p,options:{boundary:d}},...n??[]],strategy:o}),x.current.forceUpdate(),b.current=x.current.destroy)},[v,t,n,h,s,i,l,c,u,p,d,o]);f.useEffect(()=>()=>{var T;!g.current&&!y.current&&((T=x.current)==null||T.destroy(),x.current=null)},[]);const S=f.useCallback(T=>{g.current=T,w()},[w]),C=f.useCallback((T={},P=null)=>({...T,ref:OC(S,P)}),[S]),N=f.useCallback(T=>{y.current=T,w()},[w]),j=f.useCallback((T={},P=null)=>({...T,ref:OC(N,P),style:{...T.style,position:o,minWidth:h?void 0:"max-content",inset:"0 auto auto 0"}}),[o,N,h]),I=f.useCallback((T={},P=null)=>{const{size:E,shadowColor:M,bg:R,style:$,...D}=T;return{...D,ref:P,"data-popper-arrow":"",style:Scr(T)}},[]),_=f.useCallback((T={},P=null)=>({...T,ref:P,"data-popper-arrow-inner":""}),[]);return{update(){var T;(T=x.current)==null||T.update()},forceUpdate(){var T;(T=x.current)==null||T.forceUpdate()},transformOrigin:Lf.transformOrigin.varRef,referenceRef:S,popperRef:N,getPopperProps:j,getArrowProps:I,getArrowInnerProps:_,getReferenceProps:C}}function Scr(e){const{size:t,shadowColor:n,bg:r,style:o}=e,i={...o,position:"absolute"};return t&&(i["--popper-arrow-size"]=t),n&&(i["--popper-arrow-shadow-color"]=n),r&&(i["--popper-arrow-bg"]=r),i}var Ccr=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},E_=new WeakMap,F7=new WeakMap,z7={},vne=0,fht=function(e){return e&&(e.host||fht(e.parentNode))},Ncr=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=fht(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},jcr=function(e,t,n,r){var o=Ncr(t,Array.isArray(e)?e:[e]);z7[n]||(z7[n]=new WeakMap);var i=z7[n],s=[],l=new Set,c=new Set(o),u=function(p){!p||l.has(p)||(l.add(p),u(p.parentNode))};o.forEach(u);var d=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(r),g=m!==null&&m!=="false",y=(E_.get(h)||0)+1,x=(i.get(h)||0)+1;E_.set(h,y),i.set(h,x),s.push(h),y===1&&g&&F7.set(h,!0),x===1&&h.setAttribute(n,"true"),g||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return d(t),l.clear(),vne++,function(){s.forEach(function(p){var h=E_.get(p)-1,m=i.get(p)-1;E_.set(p,h),i.set(p,m),h||(F7.has(p)||p.removeAttribute(r),F7.delete(p)),m||p.removeAttribute(n)}),vne--,vne||(E_=new WeakMap,E_=new WeakMap,F7=new WeakMap,z7={})}},hY=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=Ccr(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),jcr(r,o,n,"aria-hidden")):function(){return null}},Ecr=Object.defineProperty,Icr=(e,t,n)=>t in e?Ecr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_cr=(e,t,n)=>(Icr(e,t+"",n),n);class Pcr{constructor(){_cr(this,"modals"),this.modals=new Set}add(t){return this.modals.add(t),this.modals.size}remove(t){this.modals.delete(t)}isTopModal(t){if(!t)return!1;const n=Array.from(this.modals)[this.modals.size-1];return t===n}}const xfe=new Pcr;function pht(e,t){const[n,r]=f.useState(0);return f.useEffect(()=>{const o=e.current;if(o){if(t){const i=xfe.add(o);r(i)}return()=>{xfe.remove(o),r(0)}}},[t,e]),n}function Acr(e){const{isOpen:t,onClose:n,id:r,closeOnOverlayClick:o=!0,closeOnEsc:i=!0,useInert:s=!0,onOverlayClick:l,onEsc:c}=e,u=f.useRef(null),d=f.useRef(null),[p,h,m]=kcr(r,"chakra-modal","chakra-modal--header","chakra-modal--body");Tcr(u,t&&s);const g=pht(u,t),y=f.useRef(null),x=f.useCallback(_=>{y.current=_.target},[]),v=f.useCallback(_=>{_.key==="Escape"&&(_.stopPropagation(),i&&(n==null||n()),c==null||c())},[i,n,c]),[b,w]=f.useState(!1),[S,C]=f.useState(!1),N=f.useCallback((_={},T=null)=>({role:"dialog",..._,ref:OC(T,u),id:p,tabIndex:-1,"aria-modal":!0,"aria-labelledby":b?h:void 0,"aria-describedby":S?m:void 0,onClick:s0(_.onClick,P=>P.stopPropagation())}),[m,S,p,h,b]),j=f.useCallback(_=>{_.stopPropagation(),y.current===_.target&&xfe.isTopModal(u.current)&&(o&&(n==null||n()),l==null||l())},[n,o,l]),I=f.useCallback((_={},T=null)=>({..._,ref:OC(T,d),onClick:s0(_.onClick,j),onKeyDown:s0(_.onKeyDown,v),onMouseDown:s0(_.onMouseDown,x)}),[v,x,j]);return{isOpen:t,onClose:n,headerId:h,bodyId:m,setBodyMounted:C,setHeaderMounted:w,dialogRef:u,overlayRef:d,getDialogProps:N,getDialogContainerProps:I,index:g}}function Tcr(e,t){const n=e.current;f.useEffect(()=>{if(!(!e.current||!t))return hY(e.current)},[t,e,n])}function kcr(e,...t){const n=f.useId(),r=e||n;return f.useMemo(()=>t.map(o=>`${o}-${r}`),[r,t])}const[Mcr,o4]=Y0({name:"ModalStylesContext",errorMessage:`useModalStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),[Rcr,II]=Y0({strict:!0,name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap modal components in ``"}),hht=e=>{const t={scrollBehavior:"outside",autoFocus:!0,trapFocus:!0,returnFocusOnClose:!0,blockScrollOnMount:!0,allowPinchZoom:!1,preserveScrollBarGap:!0,motionPreset:"scale",...e,lockFocusAcrossFrames:e.lockFocusAcrossFrames??!0},{portalProps:n,children:r,autoFocus:o,trapFocus:i,initialFocusRef:s,finalFocusRef:l,returnFocusOnClose:c,blockScrollOnMount:u,allowPinchZoom:d,preserveScrollBarGap:p,motionPreset:h,lockFocusAcrossFrames:m,animatePresenceProps:g,onCloseComplete:y}=t,x=r4("Modal",t),b={...Acr(t),autoFocus:o,trapFocus:i,initialFocusRef:s,finalFocusRef:l,returnFocusOnClose:c,blockScrollOnMount:u,allowPinchZoom:d,preserveScrollBarGap:p,motionPreset:h,lockFocusAcrossFrames:m};return a.jsx(Rcr,{value:b,children:a.jsx(Mcr,{value:x,children:a.jsx(g5,{...g,onExitComplete:y,children:b.isOpen&&a.jsx(C6,{...n,children:r})})})})};hht.displayName="Modal";var RB="right-scroll-bar-position",OB="width-before-scroll-bar",Ocr="with-scroll-bars-hidden",$cr="--removed-body-scroll-bar-size",mht=Dpt(),bne=function(){},mY=f.forwardRef(function(e,t){var n=f.useRef(null),r=f.useState({onScrollCapture:bne,onWheelCapture:bne,onTouchMoveCapture:bne}),o=r[0],i=r[1],s=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,m=e.noRelative,g=e.noIsolation,y=e.inert,x=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,w=e.gapMode,S=Rpt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=h,N=Mpt([n,t]),j=Pv(Pv({},S),o);return f.createElement(f.Fragment,null,d&&f.createElement(C,{sideCar:mht,removeScrollBar:u,shards:p,noRelative:m,noIsolation:g,inert:y,setCallbacks:i,allowPinchZoom:!!x,lockRef:n,gapMode:w}),s?f.cloneElement(f.Children.only(l),Pv(Pv({},j),{ref:N})):f.createElement(b,Pv({},j,{className:c,ref:N}),l))});mY.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};mY.classNames={fullWidth:OB,zeroRight:RB};var Dcr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Lcr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Dcr();return t&&e.setAttribute("nonce",t),e}function Fcr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function zcr(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Bcr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Lcr())&&(Fcr(t,n),zcr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Hcr=function(){var e=Bcr();return function(t,n){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ght=function(){var e=Hcr(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Vcr={left:0,top:0,right:0,gap:0},wne=function(e){return parseInt(e||"",10)||0},Ucr=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[wne(n),wne(r),wne(o)]},Wcr=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Vcr;var t=Ucr(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Gcr=ght(),wA="data-scroll-locked",qcr=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,l=e.gap;return n===void 0&&(n="margin"),` .`.concat(Ocr,` { overflow: hidden `).concat(r,`; padding-right: `).concat(l,"px ").concat(r,`; } body[`).concat(wA,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(o,`px; padding-top: `).concat(i,`px; padding-right: `).concat(s,`px; margin-left:0; margin-top:0; margin-right: `).concat(l,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat(RB,` { right: `).concat(l,"px ").concat(r,`; } .`).concat(OB,` { margin-right: `).concat(l,"px ").concat(r,`; } .`).concat(RB," .").concat(RB,` { right: 0 `).concat(r,`; } .`).concat(OB," .").concat(OB,` { margin-right: 0 `).concat(r,`; } body[`).concat(wA,`] { `).concat($cr,": ").concat(l,`px; } `)},q6e=function(){var e=parseInt(document.body.getAttribute(wA)||"0",10);return isFinite(e)?e:0},Kcr=function(){f.useEffect(function(){return document.body.setAttribute(wA,(q6e()+1).toString()),function(){var e=q6e()-1;e<=0?document.body.removeAttribute(wA):document.body.setAttribute(wA,e.toString())}},[])},Ycr=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Kcr();var i=f.useMemo(function(){return Wcr(o)},[o]);return f.createElement(Gcr,{styles:qcr(i,!t,o,n?"":"!important")})},yfe=!1;if(typeof window<"u")try{var B7=Object.defineProperty({},"passive",{get:function(){return yfe=!0,!0}});window.addEventListener("test",B7,B7),window.removeEventListener("test",B7,B7)}catch{yfe=!1}var I_=yfe?{passive:!1}:!1,Xcr=function(e){return e.tagName==="TEXTAREA"},xht=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Xcr(e)&&n[t]==="visible")},Qcr=function(e){return xht(e,"overflowY")},Jcr=function(e){return xht(e,"overflowX")},K6e=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=yht(e,r);if(o){var i=vht(e,r),s=i[1],l=i[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Zcr=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},eur=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},yht=function(e,t){return e==="v"?Qcr(t):Jcr(t)},vht=function(e,t){return e==="v"?Zcr(t):eur(t)},tur=function(e,t){return e==="h"&&t==="rtl"?-1:1},nur=function(e,t,n,r,o){var i=tur(e,window.getComputedStyle(t).direction),s=i*r,l=n.target,c=t.contains(l),u=!1,d=s>0,p=0,h=0;do{if(!l)break;var m=vht(e,l),g=m[0],y=m[1],x=m[2],v=y-x-i*g;(g||v)&&yht(e,l)&&(p+=v,h+=g);var b=l.parentNode;l=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&Math.abs(p)<1||!d&&Math.abs(h)<1)&&(u=!0),u},H7=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Y6e=function(e){return[e.deltaX,e.deltaY]},X6e=function(e){return e&&"current"in e?e.current:e},rur=function(e,t){return e[0]===t[0]&&e[1]===t[1]},our=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},iur=0,__=[];function aur(e){var t=f.useRef([]),n=f.useRef([0,0]),r=f.useRef(),o=f.useState(iur++)[0],i=f.useState(ght)[0],s=f.useRef(e);f.useEffect(function(){s.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=Ksr([e.lockRef.current],(e.shards||[]).map(X6e),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=f.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var v=H7(y),b=n.current,w="deltaX"in y?y.deltaX:b[0]-v[0],S="deltaY"in y?y.deltaY:b[1]-v[1],C,N=y.target,j=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in y&&j==="h"&&N.type==="range")return!1;var I=window.getSelection(),_=I&&I.anchorNode,T=_?_===N||_.contains(N):!1;if(T)return!1;var P=K6e(j,N);if(!P)return!0;if(P?C=j:(C=j==="v"?"h":"v",P=K6e(j,N)),!P)return!1;if(!r.current&&"changedTouches"in y&&(w||S)&&(r.current=C),!C)return!0;var E=r.current||C;return nur(E,x,y,E==="h"?w:S)},[]),c=f.useCallback(function(y){var x=y;if(!(!__.length||__[__.length-1]!==i)){var v="deltaY"in x?Y6e(x):H7(x),b=t.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&rur(C.delta,v)})[0];if(b&&b.should){x.cancelable&&x.preventDefault();return}if(!b){var w=(s.current.shards||[]).map(X6e).filter(Boolean).filter(function(C){return C.contains(x.target)}),S=w.length>0?l(x,w[0]):!s.current.noIsolation;S&&x.cancelable&&x.preventDefault()}}},[]),u=f.useCallback(function(y,x,v,b){var w={name:y,delta:x,target:v,should:b,shadowParent:sur(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(S){return S!==w})},1)},[]),d=f.useCallback(function(y){n.current=H7(y),r.current=void 0},[]),p=f.useCallback(function(y){u(y.type,Y6e(y),y.target,l(y,e.lockRef.current))},[]),h=f.useCallback(function(y){u(y.type,H7(y),y.target,l(y,e.lockRef.current))},[]);f.useEffect(function(){return __.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,I_),document.addEventListener("touchmove",c,I_),document.addEventListener("touchstart",d,I_),function(){__=__.filter(function(y){return y!==i}),document.removeEventListener("wheel",c,I_),document.removeEventListener("touchmove",c,I_),document.removeEventListener("touchstart",d,I_)}},[]);var m=e.removeScrollBar,g=e.inert;return f.createElement(f.Fragment,null,g?f.createElement(i,{styles:our(o)}):null,m?f.createElement(Ycr,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function sur(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lur=Ysr(mht,aur);var N6=f.forwardRef(function(e,t){return f.createElement(mY,Pv({},e,{ref:t,sideCar:lur}))});N6.classNames=mY.classNames;function cur(e){const{autoFocus:t,trapFocus:n,dialogRef:r,initialFocusRef:o,blockScrollOnMount:i,allowPinchZoom:s,finalFocusRef:l,returnFocusOnClose:c,preserveScrollBarGap:u,lockFocusAcrossFrames:d,isOpen:p}=II(),[h,m]=Ibe();f.useEffect(()=>{!h&&m&&setTimeout(m)},[h,m]);const g=pht(r,p);return a.jsx(uht,{autoFocus:t,isDisabled:!n,initialFocusRef:o,finalFocusRef:l,restoreFocus:c,contentRef:r,lockFocusAcrossFrames:d,children:a.jsx(N6,{removeScrollBar:!u,allowPinchZoom:s,enabled:g===1&&i,forwardProps:!0,children:e.children})})}const uur={initial:({offsetX:e,offsetY:t,transition:n,transitionEnd:r,delay:o})=>({opacity:0,x:e,y:t,transition:(n==null?void 0:n.exit)??nw.exit(VE.exit,o),transitionEnd:r==null?void 0:r.exit}),enter:({transition:e,transitionEnd:t,delay:n})=>({opacity:1,x:0,y:0,transition:(e==null?void 0:e.enter)??nw.enter(VE.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({offsetY:e,offsetX:t,transition:n,transitionEnd:r,reverse:o,delay:i})=>{const s={x:t,y:e};return{opacity:0,transition:(n==null?void 0:n.exit)??nw.exit(VE.exit,i),...o?{...s,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{...s,...r==null?void 0:r.exit}}}}},HR={initial:"initial",animate:"enter",exit:"exit",variants:uur},dur=f.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,className:s,offsetX:l=0,offsetY:c=8,transition:u,transitionEnd:d,delay:p,animatePresenceProps:h,...m}=t,g=r?o&&r:!0,y=o||r?"enter":"exit",x={offsetX:l,offsetY:c,reverse:i,transition:u,transitionEnd:d,delay:p};return a.jsx(g5,{...h,custom:x,children:g&&a.jsx(wd.div,{ref:n,className:Vs("chakra-offset-slide",s),custom:x,...HR,animate:y,...m})})});dur.displayName="SlideFade";const fur={exit:({reverse:e,initialScale:t,transition:n,transitionEnd:r,delay:o})=>({opacity:0,...e?{scale:t,transitionEnd:r==null?void 0:r.exit}:{transitionEnd:{scale:t,...r==null?void 0:r.exit}},transition:(n==null?void 0:n.exit)??nw.exit(VE.exit,o)}),enter:({transitionEnd:e,transition:t,delay:n})=>({opacity:1,scale:1,transition:(t==null?void 0:t.enter)??nw.enter(VE.enter,n),transitionEnd:e==null?void 0:e.enter})},bht={initial:"exit",animate:"enter",exit:"exit",variants:fur},pur=f.forwardRef(function(t,n){const{unmountOnExit:r,in:o,reverse:i=!0,initialScale:s=.95,className:l,transition:c,transitionEnd:u,delay:d,animatePresenceProps:p,...h}=t,m=r?o&&r:!0,g=o||r?"enter":"exit",y={initialScale:s,reverse:i,transition:c,transitionEnd:u,delay:d};return a.jsx(g5,{...p,custom:y,children:m&&a.jsx(wd.div,{ref:n,className:Vs("chakra-offset-slide",l),...bht,animate:g,custom:y,...h})})});pur.displayName="ScaleFade";const hur={slideInBottom:{...HR,custom:{offsetY:16,reverse:!0}},slideInRight:{...HR,custom:{offsetX:16,reverse:!0}},slideInTop:{...HR,custom:{offsetY:-16,reverse:!0}},slideInLeft:{...HR,custom:{offsetX:-16,reverse:!0}},scale:{...bht,custom:{initialScale:.95,reverse:!0}},none:{}},mur=yi(wd.section),gur=e=>hur[e||"none"],wht=f.forwardRef((e,t)=>{const{preset:n,motionProps:r=gur(n),...o}=e;return a.jsx(mur,{ref:t,...r,...o})});wht.displayName="ModalTransition";const Sht=Za((e,t)=>{const{className:n,children:r,containerProps:o,motionProps:i,...s}=e,{getDialogProps:l,getDialogContainerProps:c}=II(),u=l(s,t),d=c(o),p=Vs("chakra-modal__content",n),h=o4(),m={display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,...h.dialog},g={display:"flex",width:"100vw",height:"$100vh",position:"fixed",left:0,top:0,...h.dialogContainer},{motionPreset:y}=II();return a.jsx(cur,{children:a.jsx(yi.div,{...d,className:"chakra-modal__content-container",tabIndex:-1,__css:g,children:a.jsx(wht,{preset:y,motionProps:i,className:p,...u,__css:m,children:r})})})});Sht.displayName="ModalContent";const Cht=Za((e,t)=>{const{className:n,...r}=e,{bodyId:o,setBodyMounted:i}=II();f.useEffect(()=>(i(!0),()=>i(!1)),[i]);const s=Vs("chakra-modal__body",n),l=o4();return a.jsx(yi.div,{ref:t,className:s,id:o,...r,__css:l.body})});Cht.displayName="ModalBody";const Nht=Za((e,t)=>{const{onClick:n,className:r,...o}=e,{onClose:i}=II(),s=Vs("chakra-modal__close-btn",r),l=o4();return a.jsx(Mbe,{ref:t,__css:l.closeButton,className:s,onClick:s0(n,c=>{c.stopPropagation(),i()}),...o})});Nht.displayName="ModalCloseButton";const jht=Za((e,t)=>{const{className:n,...r}=e,o=Vs("chakra-modal__footer",n),i=o4(),s={display:"flex",alignItems:"center",justifyContent:"flex-end",...i.footer};return a.jsx(yi.footer,{ref:t,...r,__css:s,className:o})});jht.displayName="ModalFooter";const Eht=Za((e,t)=>{const{className:n,...r}=e,{headerId:o,setHeaderMounted:i}=II();f.useEffect(()=>(i(!0),()=>i(!1)),[i]);const s=Vs("chakra-modal__header",n),l=o4(),c={flex:0,...l.header};return a.jsx(yi.header,{ref:t,className:s,id:o,...r,__css:c})});Eht.displayName="ModalHeader";const xur={enter:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:1,transition:(e==null?void 0:e.enter)??nw.enter(VE.enter,n),transitionEnd:t==null?void 0:t.enter}),exit:({transition:e,transitionEnd:t,delay:n}={})=>({opacity:0,transition:(e==null?void 0:e.exit)??nw.exit(VE.exit,n),transitionEnd:t==null?void 0:t.exit})},Iht={initial:"exit",animate:"enter",exit:"exit",variants:xur},yur=f.forwardRef(function(t,n){const{unmountOnExit:r,in:o,className:i,transition:s,transitionEnd:l,delay:c,animatePresenceProps:u,...d}=t,p=o||r?"enter":"exit",h=r?o&&r:!0,m={transition:s,transitionEnd:l,delay:c};return a.jsx(g5,{...u,custom:m,children:h&&a.jsx(wd.div,{ref:n,className:Vs("chakra-fade",i),custom:m,...Iht,animate:p,...d})})});yur.displayName="Fade";const vur=yi(wd.div),_ht=Za((e,t)=>{const{className:n,transition:r,motionProps:o,...i}=e,s=Vs("chakra-modal__overlay",n),c={pos:"fixed",left:"0",top:"0",w:"100vw",h:"100vh",...o4().overlay},{motionPreset:u}=II(),p=o||(u==="none"?{}:Iht);return a.jsx(vur,{...p,__css:c,ref:t,className:s,...i})});_ht.displayName="ModalOverlay";function bur(e){var n;const t=f.version;return typeof t!="string"||t.startsWith("18.")?e==null?void 0:e.ref:(n=e==null?void 0:e.props)==null?void 0:n.ref}function wur(e,t,n){return(e-t)*100/(n-t)}gf({"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260"}});gf({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}});const Sur=gf({"0%":{left:"-40%"},"100%":{left:"100%"}}),Cur=gf({from:{backgroundPosition:"1rem 0"},to:{backgroundPosition:"0 0"}});function Nur(e){const{value:t=0,min:n,max:r,valueText:o,getValueText:i,isIndeterminate:s,role:l="progressbar"}=e,c=wur(t,n,r);return{bind:{"data-indeterminate":s?"":void 0,"aria-valuemax":r,"aria-valuemin":n,"aria-valuenow":s?void 0:t,"aria-valuetext":(()=>{if(t!=null)return typeof i=="function"?i(t,c):o})(),role:l},percent:c,value:t}}const[jur,Eur]=Y0({name:"ProgressStylesContext",errorMessage:`useProgressStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),Iur=Za((e,t)=>{const{min:n,max:r,value:o,isIndeterminate:i,role:s,...l}=e,c=Nur({value:o,min:n,max:r,isIndeterminate:i,role:s}),d={height:"100%",...Eur().filledTrack};return a.jsx(yi.div,{ref:t,style:{width:`${c.percent}%`,...l.style},...c.bind,...l,__css:d})}),Pht=Za((e,t)=>{var j;const{value:n,min:r=0,max:o=100,hasStripe:i,isAnimated:s,children:l,borderRadius:c,isIndeterminate:u,"aria-label":d,"aria-labelledby":p,"aria-valuetext":h,title:m,role:g,...y}=yg(e),x=r4("Progress",e),v=c??((j=x.track)==null?void 0:j.borderRadius),b={animation:`${Cur} 1s linear infinite`},C={...!u&&i&&s&&b,...u&&{position:"absolute",willChange:"left",minWidth:"50%",animation:`${Sur} 1s ease infinite normal none running`}},N={overflow:"hidden",position:"relative",...x.track};return a.jsx(yi.div,{ref:t,borderRadius:v,__css:N,...y,children:a.jsxs(jur,{value:x,children:[a.jsx(Iur,{"aria-label":d,"aria-labelledby":p,"aria-valuetext":h,min:r,max:o,value:n,isIndeterminate:u,css:C,borderRadius:v,title:m,role:g}),l]})})});Pht.displayName="Progress";const Aht=e=>a.jsx(yi.div,{className:"chakra-stack__item",...e,__css:{display:"inline-block",flex:"0 0 auto",minWidth:0,...e.__css}});Aht.displayName="StackItem";function _ur(e){const{spacing:t,direction:n}=e,r={column:{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},"column-reverse":{my:t,mx:0,borderLeftWidth:0,borderBottomWidth:"1px"},row:{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0},"row-reverse":{mx:t,my:0,borderLeftWidth:"1px",borderBottomWidth:0}};return{"&":qve(n,o=>r[o])}}const tD=Za((e,t)=>{const{isInline:n,direction:r,align:o,justify:i,spacing:s="0.5rem",wrap:l,children:c,divider:u,className:d,shouldWrapChildren:p,...h}=e,m=n?"row":r??"column",g=f.useMemo(()=>_ur({spacing:s,direction:m}),[s,m]),y=!!u,x=!p&&!y,v=f.useMemo(()=>{const w=Jer(c);return x?w:w.map((S,C)=>{const N=typeof S.key<"u"?S.key:C,j=C+1===w.length,_=p?a.jsx(Aht,{children:S},N):S;if(!y)return _;const T=f.cloneElement(u,{__css:g}),P=j?null:T;return a.jsxs(f.Fragment,{children:[_,P]},N)})},[u,g,y,x,p,c]),b=Vs("chakra-stack",d);return a.jsx(yi.div,{ref:t,display:"flex",alignItems:o,justifyContent:i,flexDirection:m,flexWrap:l,gap:y?void 0:s,className:b,...h,children:v})});tD.displayName="Stack";const Kg=Za((e,t)=>a.jsx(tD,{align:"center",...e,direction:"row",ref:t}));Kg.displayName="HStack";const l2=Za((e,t)=>a.jsx(tD,{align:"center",...e,direction:"column",ref:t}));l2.displayName="VStack";const[Pur,Tht]=Y0({name:"StatStylesContext",errorMessage:`useStatStyles returned is 'undefined'. Seems you forgot to wrap the components in "" `}),kht=Za(function(t,n){const r=r4("Stat",t),o={position:"relative",flex:"1 1 0%",...r.container},{className:i,children:s,...l}=yg(t);return a.jsx(Pur,{value:r,children:a.jsx(yi.div,{ref:n,...l,className:Vs("chakra-stat",i),__css:o,children:a.jsx("dl",{children:s})})})});kht.displayName="Stat";const Mht=e=>a.jsx(uN,{color:"red.400",...e,children:a.jsx("path",{fill:"currentColor",d:"M21,5H3C2.621,5,2.275,5.214,2.105,5.553C1.937,5.892,1.973,6.297,2.2,6.6l9,12 c0.188,0.252,0.485,0.4,0.8,0.4s0.611-0.148,0.8-0.4l9-12c0.228-0.303,0.264-0.708,0.095-1.047C21.725,5.214,21.379,5,21,5z"})});Mht.displayName="StatDownArrow";function Rht(e){return a.jsx(uN,{color:"green.400",...e,children:a.jsx("path",{fill:"currentColor",d:"M12.8,5.4c-0.377-0.504-1.223-0.504-1.6,0l-9,12c-0.228,0.303-0.264,0.708-0.095,1.047 C2.275,18.786,2.621,19,3,19h18c0.379,0,0.725-0.214,0.895-0.553c0.169-0.339,0.133-0.744-0.095-1.047L12.8,5.4z"})})}Rht.displayName="StatUpArrow";function Oht(e){const{type:t,"aria-label":n,...r}=e,o=Tht(),i=t==="increase"?Rht:Mht,l=n||(t==="increase"?"increased by":"decreased by");return a.jsxs(a.Fragment,{children:[a.jsx(yi.span,{srOnly:!0,children:l}),a.jsx(i,{"aria-hidden":!0,...r,__css:o.icon})]})}Oht.displayName="StatArrow";const $ht=Za(function(t,n){const r=Tht();return a.jsx(yi.dd,{ref:n,...t,className:Vs("chakra-stat__help-text",t.className),__css:r.helpText})});$ht.displayName="StatHelpText";function Aur(e,t){const n=e??"bottom",o={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[n];return(o==null?void 0:o[t])??n}function Tur(e,t){const n=o=>({...t,...o,position:Aur((o==null?void 0:o.position)??(t==null?void 0:t.position),e)}),r=o=>{const i=n(o),s=_pt(i);return Lj.notify(s,i)};return r.update=(o,i)=>{Lj.update(o,n(i))},r.promise=(o,i)=>{const s=r({...i.loading,status:"loading",duration:null});o.then(l=>r.update(s,{status:"success",duration:5e3,...Ov(i.success,l)})).catch(l=>r.update(s,{status:"error",duration:5e3,...Ov(i.error,l)}))},r.closeAll=Lj.closeAll,r.close=Lj.close,r.isActive=Lj.isActive,r}function kur(e){const{theme:t}=wpt(),n=Asr();return f.useMemo(()=>Tur(t.direction,{...n,...e}),[e,t.direction,n])}const Mur={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}},vfe=e=>{var t;return((t=e.current)==null?void 0:t.ownerDocument)||document},$B=e=>{var t,n;return((n=(t=e.current)==null?void 0:t.ownerDocument)==null?void 0:n.defaultView)||window};function Rur(e={}){const{openDelay:t=0,closeDelay:n=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:i,closeOnPointerDown:s=o,closeOnEsc:l=!0,onOpen:c,onClose:u,placement:d,id:p,isOpen:h,defaultIsOpen:m,arrowSize:g=10,arrowShadowColor:y,arrowPadding:x,modifiers:v,isDisabled:b,gutter:w,offset:S,direction:C,...N}=e,{isOpen:j,onOpen:I,onClose:_}=ytr({isOpen:h,defaultIsOpen:m,onOpen:c,onClose:u}),{referenceRef:T,getPopperProps:P,getArrowInnerProps:E,getArrowProps:M}=wcr({enabled:j,placement:d,arrowPadding:x,modifiers:v,gutter:w,offset:S,direction:C}),R=f.useId(),D=`tooltip-${p??R}`,z=f.useRef(null),V=f.useRef(void 0),B=f.useCallback(()=>{V.current&&(clearTimeout(V.current),V.current=void 0)},[]),G=f.useRef(void 0),H=f.useCallback(()=>{G.current&&(clearTimeout(G.current),G.current=void 0)},[]),F=f.useCallback(()=>{H(),_()},[_,H]),W=Our(z,F),U=f.useCallback(()=>{if(!b&&!V.current){j&&W();const oe=$B(z);V.current=oe.setTimeout(I,t)}},[W,b,j,I,t]),K=f.useCallback(()=>{B();const oe=$B(z);G.current=oe.setTimeout(F,n)},[n,F,B]),X=f.useCallback(()=>{j&&r&&K()},[r,K,j]),J=f.useCallback(()=>{j&&s&&K()},[s,K,j]),te=f.useCallback(oe=>{j&&oe.key==="Escape"&&K()},[j,K]);Kte(()=>vfe(z),"keydown",l?te:void 0),Kte(()=>{if(!i)return null;const oe=z.current;if(!oe)return null;const ue=kdt(oe);return ue.localName==="body"?$B(z):ue},"scroll",()=>{j&&i&&F()},{passive:!0,capture:!0}),f.useEffect(()=>{b&&(B(),j&&_())},[b,j,_,B]),f.useEffect(()=>()=>{B(),H()},[B,H]),Kte(()=>z.current,"pointerleave",K);const re=f.useCallback((oe={},ue=null)=>({...oe,ref:OC(z,ue,T),onPointerEnter:s0(oe.onPointerEnter,se=>{se.pointerType!=="touch"&&U()}),onClick:s0(oe.onClick,X),onPointerDown:s0(oe.onPointerDown,J),onFocus:s0(oe.onFocus,U),onBlur:s0(oe.onBlur,K),"aria-describedby":j?D:void 0}),[U,K,J,j,D,X,T]),ce=f.useCallback((oe={},ue=null)=>P({...oe,style:{...oe.style,[Lf.arrowSize.var]:g?`${g}px`:void 0,[Lf.arrowShadowColor.var]:y}},ue),[P,g,y]),ae=f.useCallback((oe={},ue=null)=>{const fe={...oe.style,position:"relative",transformOrigin:Lf.transformOrigin.varRef};return{ref:ue,...N,...oe,id:D,role:"tooltip",style:fe}},[N,D]);return{isOpen:j,show:U,hide:K,getTriggerProps:re,getTooltipProps:ae,getTooltipPositionerProps:ce,getArrowProps:M,getArrowInnerProps:E}}const Sne="chakra-ui:close-tooltip";function Our(e,t){return f.useEffect(()=>{const n=vfe(e);return n.addEventListener(Sne,t),()=>n.removeEventListener(Sne,t)},[t,e]),()=>{const n=vfe(e),r=$B(e);n.dispatchEvent(new r.CustomEvent(Sne))}}const $ur=yi(wd.div),bfe=Za((e,t)=>{const n=nS("Tooltip",e),r=yg(e),o=S6(),{children:i,label:s,shouldWrapChildren:l,"aria-label":c,hasArrow:u,bg:d,portalProps:p,background:h,backgroundColor:m,bgColor:g,motionProps:y,animatePresenceProps:x,...v}=r,b=h??m??d??g;if(b){n.bg=b;const T=unr(o,"colors",b);n[Lf.arrowBg.var]=T}const w=Rur({...v,direction:o.direction}),S=!f.isValidElement(i)||l;let C;if(S)C=a.jsx(yi.span,{display:"inline-block",tabIndex:0,...w.getTriggerProps(),children:i});else{const T=f.Children.only(i);C=f.cloneElement(T,w.getTriggerProps(T.props,bur(T)))}const N=!!c,j=w.getTooltipProps({},t),I=N?Adt(j,["role","id"]):j,_=utr(j,["role","id"]);return s?a.jsxs(a.Fragment,{children:[C,a.jsx(g5,{...x,children:w.isOpen&&a.jsx(C6,{...p,children:a.jsx(yi.div,{...w.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"},children:a.jsxs($ur,{variants:Mur,initial:"exit",animate:"enter",exit:"exit",...y,...I,__css:n,children:[s,N&&a.jsx(yi.span,{srOnly:!0,..._,children:c}),u&&a.jsx(yi.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:a.jsx(yi.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}})})]})})})})]}):a.jsx(a.Fragment,{children:i})});bfe.displayName="Tooltip";const jj=Za(function(t,n){const r=nS("Heading",t),{className:o,...i}=yg(t);return a.jsx(yi.h2,{ref:n,className:Vs("chakra-heading",t.className),...i,__css:r})});jj.displayName="Heading";const ba=Za(function(t,n){const r=nS("Text",t),{className:o,align:i,decoration:s,casing:l,...c}=yg(t),u=Pdt({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return a.jsx(yi.p,{ref:n,className:Vs("chakra-text",t.className),...u,...c,__css:r})});ba.displayName="Text";const Dur=()=>a.jsxs(uc,{p:4,children:[a.jsx(jj,{as:"h1",size:"xl",mb:4,children:"Financial Reporting Dashboard"}),a.jsx(ba,{fontSize:"lg",mb:4,children:"Welcome to the financial reporting dashboard. Here you can view various financial reports and charts."}),a.jsxs(uc,{borderWidth:"1px",borderRadius:"lg",p:4,mb:4,children:[a.jsx(jj,{as:"h2",size:"md",mb:2,children:"Overview Report"}),a.jsx(ba,{children:"This is an example of an overview financial report. Replace this with your actual components."})]}),a.jsxs(uc,{borderWidth:"1px",borderRadius:"lg",p:4,mb:4,children:[a.jsx(jj,{as:"h2",size:"md",mb:2,children:"Cash Flow Chart"}),a.jsx(ba,{children:"This is an example of a cash flow chart. Replace this with your actual components."})]}),a.jsxs(uc,{borderWidth:"1px",borderRadius:"lg",p:4,mb:4,children:[a.jsx(jj,{as:"h2",size:"md",mb:2,children:"Balance Sheet"}),a.jsx(ba,{children:"This is an example of a balance sheet. Replace this with your actual components."})]}),a.jsxs(uc,{borderWidth:"1px",borderRadius:"lg",p:4,mb:4,children:[a.jsx(jj,{as:"h2",size:"md",mb:2,children:"Income Statement"}),a.jsx(ba,{children:"This is an example of an income statement. Replace this with your actual components."})]}),a.jsxs(uc,{borderWidth:"1px",borderRadius:"lg",p:4,mb:4,children:[a.jsx(jj,{as:"h2",size:"md",mb:2,children:"AR/AP Summary"}),a.jsx(ba,{children:"This is an example of an AR/AP Summary. Replace this with your actual components."})]})]});var Lur={};const Q6e=Lur.REACT_APP_GEMINI_API_KEY||"",Fur=()=>{const e=[],t=n=>n<=5?{title:"Genesis",content:`# Genesis Protocol The initial state of the ledger must be absolute. We define the zero-point energy of the system.`}:n<=10?{title:"Sovereignty",content:`# Sovereign Identity Identity is not granted by the state; it is asserted by the cryptographic key pair.`}:n<=20?{title:"FinOS",content:`# Financial Operating System Liquidity is the blood; code is the vein. We optimize flow through atomic swaps.`}:n<=30?{title:"AI_Gov",content:`# Neural Governance The AI does not rule; it audits. It is the unblinking eye of the 527 protocol.`}:{title:"Transition",content:`# The Transition Event Migration from legacy systems is inevitable. The bridge is being built.`};for(let n=1;n<=41;n++){const r=t(n);e.push({name:`page${n}.md`,type:"file",tags:[r.title,"Protocol","Immutable"],content:`${r.content} ## Sector ${n} Analysis of node distribution indicates a ${Math.floor(Math.random()*20)+80}% efficiency rating. * System Hash: 0x${Math.random().toString(16).substr(2,8).toUpperCase()} * Timestamp: ${new Date().toISOString()} ### Axiom ${n} The architecture defines the reality. We do not observe; we construct.`})}return e},zur=Fur(),Bur=({content:e})=>{const t=e.split(` `);return a.jsx("div",{className:"space-y-4 font-mono text-sm md:text-base leading-relaxed text-gray-300",children:t.map((n,r)=>n.startsWith("# ")?a.jsx("h1",{className:"text-4xl font-black text-transparent bg-clip-text bg-gradient-to-r from-cyan-400 to-purple-500 mb-6 border-b border-gray-700 pb-4",children:n.replace("# ","")},r):n.startsWith("## ")?a.jsxs("h2",{className:"text-2xl font-bold text-cyan-300 mt-8 mb-4 flex items-center gap-2",children:[a.jsx(Ei,{size:20})," ",n.replace("## ","")]},r):n.startsWith("### ")?a.jsx("h3",{className:"text-xl font-semibold text-purple-400 mt-6 mb-2",children:n.replace("### ","")},r):n.startsWith("* ")?a.jsxs("li",{className:"list-none ml-4 flex items-center gap-2 text-emerald-400",children:[a.jsx(ri,{size:14})," ",n.replace("* ","")]},r):n.trim()===""?a.jsx("div",{className:"h-2"},r):a.jsx("p",{className:"hover:text-white transition-colors duration-300",children:n},r))})},Hur=()=>{const[e,t]=f.useState(zur),[n,r]=f.useState(e[0]),[o,i]=f.useState(""),[s,l]=f.useState(!1),[c,u]=f.useState(""),[d,p]=f.useState(!1),[h,m]=f.useState(!1),g=f.useRef(window.speechSynthesis),y=f.useRef(null),x=f.useMemo(()=>e.filter(w=>w.name.toLowerCase().includes(o.toLowerCase())),[e,o]),v=()=>{if(!n)return;if(d&&!h){g.current.pause(),m(!0);return}if(d&&h){g.current.resume(),m(!1);return}g.current.cancel();const w=n.content.replace(/[#*]/g,"");y.current=new SpeechSynthesisUtterance(w);const C=g.current.getVoices().find(N=>N.name.includes("Google US English")||N.name.includes("Samantha"));C&&(y.current.voice=C),y.current.rate=1.1,y.current.pitch=.9,y.current.onend=()=>{p(!1),m(!1)},g.current.speak(y.current),p(!0),m(!1)};f.useEffect(()=>{g.current.cancel(),p(!1),m(!1)},[n]);const b=async()=>{if(c.trim()){l(!0);try{let w="";Q6e?w=(await new Ko({apiKey:Q6e}).getGenerativeModel({model:"gemini-1.5-flash"}).generateContent(` Context: You are writing a page for 'The 527 Protocol', a futuristic financial sovereign manifesto. Style: Technical, philosophical, authoritative, cyberpunk. Task: Write a markdown page about: ${c} `)).response.text():(await new Promise(N=>setTimeout(N,2e3)),w=`# Generated Protocol: ${c} ## AI Analysis The neural lattice has constructed a new paradigm based on your request. We observe that ${c} is critical to the consensus mechanism. ### Execution * Initializing smart contracts... * Verifying sovereign identity... * content generated successfully.`);const C={name:`page${e.length+1}.md`,type:"file",tags:["AI_Generated","New_Protocol"],content:w};t(N=>[...N,C]),r(C),u("")}catch(w){console.error("AI Generation Failed",w)}finally{l(!1)}}};return a.jsxs("div",{className:"flex h-screen bg-black text-gray-100 font-sans overflow-hidden selection:bg-cyan-500/30",children:[a.jsxs("div",{className:"w-80 border-r border-gray-800 bg-gray-900/50 backdrop-blur-xl flex flex-col",children:[a.jsxs("div",{className:"p-4 border-b border-gray-800",children:[a.jsxs("div",{className:"flex items-center gap-2 text-cyan-400 mb-1",children:[a.jsx(rl,{size:20}),a.jsx("h1",{className:"font-bold tracking-widest text-sm",children:"ARCHIVE_527"})]}),a.jsx("div",{className:"text-[10px] text-gray-500 font-mono",children:"/root/book/verified_ledger"})]}),a.jsx("div",{className:"p-3",children:a.jsxs("div",{className:"relative group",children:[a.jsx(hm,{className:"absolute left-3 top-2.5 text-gray-500 group-focus-within:text-cyan-400 transition-colors",size:16}),a.jsx("input",{type:"text",placeholder:"Search Protocol...",value:o,onChange:w=>i(w.target.value),className:"w-full bg-gray-950 border border-gray-800 rounded-lg py-2 pl-9 pr-4 text-sm focus:outline-none focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 transition-all text-gray-300 placeholder-gray-600"})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin scrollbar-thumb-gray-800 p-2 space-y-1",children:x.map(w=>a.jsxs("button",{onClick:()=>r(w),className:`w-full text-left px-3 py-2.5 rounded-lg flex items-center gap-3 transition-all duration-200 group border border-transparent ${(n==null?void 0:n.name)===w.name?"bg-cyan-950/30 border-cyan-500/50 text-cyan-100 shadow-[0_0_15px_rgba(6,182,212,0.1)]":"hover:bg-gray-800 hover:border-gray-700 text-gray-400"}`,children:[a.jsx(ss,{size:16,className:(n==null?void 0:n.name)===w.name?"text-cyan-400":"text-gray-600 group-hover:text-gray-400"}),a.jsx("div",{className:"flex-1 truncate font-mono text-sm",children:w.name}),(n==null?void 0:n.name)===w.name&&a.jsx(nd,{size:14,className:"text-cyan-500 animate-pulse"})]},w.name))}),a.jsxs("div",{className:"p-3 border-t border-gray-800 bg-gray-950 text-[10px] text-gray-500 font-mono flex justify-between",children:[a.jsxs("span",{children:["FILES: ",e.length]}),a.jsxs("span",{children:["SIZE: ",(e.length*1.2).toFixed(2)," MB"]})]})]}),a.jsxs("div",{className:"flex-1 flex flex-col bg-gradient-to-br from-gray-950 to-[#05050a]",children:[a.jsxs("div",{className:"h-16 border-b border-gray-800 flex items-center justify-between px-6 bg-gray-900/30 backdrop-blur-md sticky top-0 z-10",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"px-2 py-1 bg-cyan-900/20 border border-cyan-500/30 rounded text-cyan-400 text-xs font-mono",children:"READ_ONLY"}),a.jsx("span",{className:"text-gray-400 text-sm font-mono",children:n==null?void 0:n.name})]}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsxs("button",{onClick:v,className:`flex items-center gap-2 px-4 py-2 rounded-lg text-xs font-bold uppercase tracking-wider transition-all border ${d?"bg-purple-600/20 border-purple-500 text-purple-300 animate-pulse":"bg-gray-800 hover:bg-gray-700 border-gray-700 text-gray-300"}`,children:[d&&!h?a.jsx(N$t,{size:14}):a.jsx(XI,{size:14}),d?h?"Resume Audio":"Broadcasting":"Read Aloud",d&&!h&&a.jsx(vDt,{size:14,className:"animate-ping"})]})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-8 lg:p-12 scrollbar-thin scrollbar-thumb-cyan-900/50",children:a.jsx("div",{className:"max-w-4xl mx-auto bg-gray-900/20 border border-gray-800/50 p-8 rounded-2xl shadow-2xl backdrop-blur-sm min-h-[600px]",children:n?a.jsx(Bur,{content:n.content}):a.jsx("div",{className:"flex items-center justify-center h-full text-gray-600",children:"Select a protocol file to initiate decryption..."})})}),a.jsx("div",{className:"border-t border-gray-800 bg-gray-900/80 p-4 backdrop-blur-lg",children:a.jsxs("div",{className:"max-w-4xl mx-auto flex gap-4 items-center",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:a.jsx(Bs,{size:16,className:"text-purple-500"})}),a.jsx("input",{type:"text",value:c,onChange:w=>u(w.target.value),placeholder:"Command the AI to write a new protocol page...",className:"block w-full pl-10 pr-3 py-3 border border-gray-700 rounded-xl leading-5 bg-gray-950 text-gray-300 placeholder-gray-500 focus:outline-none focus:bg-black focus:border-purple-500 focus:ring-1 focus:ring-purple-500 sm:text-sm transition-all shadow-inner",onKeyDown:w=>w.key==="Enter"&&b()}),s&&a.jsxs("div",{className:"absolute right-3 top-3.5 flex gap-1",children:[a.jsx("span",{className:"w-1.5 h-1.5 bg-purple-500 rounded-full animate-bounce"}),a.jsx("span",{className:"w-1.5 h-1.5 bg-purple-500 rounded-full animate-bounce delay-75"}),a.jsx("span",{className:"w-1.5 h-1.5 bg-purple-500 rounded-full animate-bounce delay-150"})]})]}),a.jsxs("button",{onClick:b,disabled:s||!c,className:"bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-500 hover:to-indigo-500 text-white px-6 py-3 rounded-xl shadow-lg shadow-purple-900/30 flex items-center gap-2 font-medium transition-all disabled:opacity-50 disabled:cursor-not-allowed transform active:scale-95",children:[a.jsx(mm,{size:18}),a.jsx("span",{children:"Generate"})]})]})})]})]})},J6e=[{id:"1",title:"Manifesto.md",path:"/docs/core/manifesto.md",content:`# The Sovereign Manifesto We build to serve. We build to educate. We build to empower. This system is designed to provide a single source of truth in a world of noise.`},{id:"2",title:"Economy_101.md",path:"/docs/education/economy_101.md",content:`# Understanding the Machine Money is energy. It flows where attention goes. This document outlines the fundamental physics of capital flow.`},{id:"3",title:"527_Structure.md",path:"/docs/legal/527_structure.md",content:`# The 527 Organization An autonomous entity designed for influence. We operate within the light to shape the narrative of the future.`},{id:"4",title:"AI_Ethics.md",path:"/docs/ai/ethics.md",content:`# CivicMind Ethics 1. Support the user. 2. Support the community. 3. Uphold the truth.`}],Vur=()=>{const[e,t]=f.useState(J6e[0]),[n,r]=f.useState(""),[o,i]=f.useState(!1),[s,l]=f.useState(""),c=J6e.filter(d=>d.title.toLowerCase().includes(n.toLowerCase())),u=async()=>{i(!0),l(""),setTimeout(()=>{l(`Based on the "${e.title}" document, the core truth is that financial sovereignty is achieved through knowledge, not just accumulation. The text emphasizes structural understanding over speculative action.`),i(!1)},1500)};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("header",{className:"flex justify-between items-center pb-6 border-b border-gray-700",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold text-white tracking-tight",children:"The Academy"}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Single Source of Truth Repository"})]}),a.jsxs("div",{className:"relative w-64",children:[a.jsx(hm,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500"}),a.jsx("input",{type:"text",placeholder:"Search knowledge...",value:n,onChange:d=>r(d.target.value),className:"w-full bg-gray-800 border border-gray-700 rounded-lg pl-10 pr-4 py-2 text-sm text-white focus:outline-none focus:border-cyan-500"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 h-[700px]",children:[a.jsxs(Ft,{className:"lg:col-span-1 flex flex-col h-full bg-gray-900 border-gray-800",children:[a.jsxs("div",{className:"p-4 border-b border-gray-800 font-semibold text-gray-300 flex items-center gap-2",children:[a.jsx(F3t,{className:"w-4 h-4 text-yellow-500"})," /root/docs"]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:c.map(d=>a.jsxs("button",{onClick:()=>{t(d),l("")},className:`w-full flex items-center gap-3 p-3 rounded-lg text-sm transition-all ${e.id===d.id?"bg-cyan-900/30 text-cyan-400 border border-cyan-500/30":"text-gray-400 hover:bg-gray-800 hover:text-gray-200"}`,children:[a.jsx(ss,{className:"w-4 h-4"}),a.jsx("span",{className:"flex-1 text-left truncate",children:d.title}),e.id===d.id&&a.jsx(nd,{className:"w-4 h-4"})]},d.id))})]}),a.jsxs(Ft,{className:"lg:col-span-2 flex flex-col h-full bg-gray-900 border-gray-800 relative overflow-hidden",children:[a.jsxs("div",{className:"p-4 border-b border-gray-800 flex justify-between items-center bg-gray-900/95 backdrop-blur z-10",children:[a.jsx("span",{className:"font-mono text-xs text-gray-500",children:e.path}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{className:"px-3 py-1 text-xs bg-gray-800 hover:bg-gray-700 rounded text-gray-300 transition",children:"Raw"}),a.jsx("button",{className:"px-3 py-1 text-xs bg-gray-800 hover:bg-gray-700 rounded text-gray-300 transition",children:"History"})]})]}),a.jsxs("div",{className:"flex-1 p-8 overflow-y-auto font-serif text-gray-300 leading-relaxed bg-black/20",children:[a.jsx("h1",{className:"text-3xl font-bold text-white mb-6 border-b border-gray-700 pb-4",children:e.title.replace(".md","")}),a.jsx("div",{className:"prose prose-invert max-w-none",children:e.content.split(` `).map((d,p)=>a.jsx("p",{className:"mb-4",children:d},p))})]}),a.jsxs("div",{className:"absolute bottom-0 left-0 right-0 p-4 bg-gradient-to-t from-gray-900 via-gray-900 to-transparent",children:[s&&a.jsxs("div",{className:"mb-4 p-4 bg-cyan-900/20 border border-cyan-500/30 rounded-lg text-sm text-cyan-200 animate-in slide-in-from-bottom-2",children:[a.jsx("strong",{className:"block text-cyan-500 text-xs uppercase mb-1",children:"Truth Consensus Engine"}),s]}),a.jsx("button",{onClick:u,disabled:o,className:"w-full py-3 bg-gray-800 hover:bg-gray-700 border border-gray-600 hover:border-gray-500 rounded-lg text-sm text-white font-medium flex items-center justify-center gap-2 transition-all shadow-lg",children:o?a.jsx("span",{className:"animate-pulse",children:"Validating Narrative..."}):a.jsxs(a.Fragment,{children:[a.jsx(Bs,{className:"w-4 h-4 text-green-400"})," Verify Truth with AI"]})})]})]})]})]})},Dht=({className:e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:e||"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z"})}),Uur=({onClose:e,voiceState:t,transcript:n,aiResponse:r,processUtterance:o})=>{const i=["Show my dashboard","What are my recent transactions?","Pay Alex Ray $50 for dinner","Take me to my budgets"],s={idle:"Ready",listening:"Listening...",processing:"Thinking...",speaking:"Speaking...",error:"Error"};return a.jsxs("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-50 backdrop-blur-sm animate-fade-in",onClick:e,children:[a.jsxs("div",{className:"bg-gray-800 rounded-2xl p-8 max-w-2xl w-full text-center border border-gray-700",onClick:l=>l.stopPropagation(),children:[a.jsxs("div",{className:"relative w-24 h-24 mx-auto rounded-full bg-cyan-500/20 flex items-center justify-center mb-6",children:[t==="listening"&&a.jsx("div",{className:"absolute inset-0 rounded-full bg-cyan-500/30 animate-ping"}),a.jsx(Dht,{className:"h-12 w-12 text-cyan-300"})]}),a.jsx("h3",{className:"text-2xl font-bold text-white min-h-[2.25rem]",children:s[t]}),a.jsx("p",{className:"text-gray-300 mt-2 mb-6 min-h-[1.5rem] italic",children:n||" "}),a.jsx("div",{className:"h-16 text-center flex items-center justify-center mb-6 p-2 bg-gray-900/50 rounded-lg",children:a.jsx("p",{className:"text-lg text-cyan-200",children:r})}),a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-sm text-gray-500",children:"Or try saying:"}),i.map(l=>a.jsxs("button",{onClick:()=>o(l),className:"w-full text-left p-3 bg-gray-700/50 hover:bg-gray-700 rounded-lg text-cyan-200 transition-colors",children:['"',l,'"']},l))]})]}),a.jsx("style",{children:` @keyframes fade-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } } .animate-fade-in { animation: fade-in 0.3s ease-out forwards; } `})]})},Wur=({setActiveView:e})=>{const[t,n]=f.useState(!1),[r,o]=f.useState("idle"),[i,s]=f.useState(""),[l,c]=f.useState("Hello! How can I help you?"),u=f.useRef(null),d=f.useContext(ia),p=f.useRef(!1),h=f.useCallback(()=>{if(u.current&&r!=="listening"){s(""),o("listening");try{u.current.start()}catch(v){console.warn("Speech recognition already started.",v)}}},[r]),m=f.useCallback(v=>new Promise((b,w)=>{if(!p.current){w();return}o("speaking"),c(v);const S=new SpeechSynthesisUtterance(v);S.onend=()=>{p.current&&b()},S.onerror=C=>{p.current&&(o("error"),c("Sorry, I couldn't speak.")),w(C)},window.speechSynthesis.speak(S)}),[]),g=f.useCallback(async v=>{if(!p.current)return;s(v),o("processing");const b=v.toLowerCase(),w=b.match(/^(show|go to|take me to|open|view) (my )?(.+)$/i);if(w){const C=w[3].trim(),N=P=>P.toLowerCase().replace(/\(.*\)/g,"").replace(/[^a-z0-9]+/g,""),j={home:"dashboard",overview:"dashboard",sso:"singlesignon",plaid:"datanetwork",stripe:"payments",marqeta:"cardprograms"},I=N(C),_=j[I]||I,T=Object.values(wt).find(P=>N(P)===_);if(T){e(T),await m(`Navigating to ${(E=>E.replace(/-/g," ").split(" ").map(M=>["ai","sso","api"].includes(M.toLowerCase())?M.toUpperCase():M.charAt(0).toUpperCase()+M.slice(1)).join(" "))(T)}.`),n(!1);return}}const S=b.match(/^(pay|send) (.+?) \$?(\d+(\.\d{1,2})?)/i);if(S&&d){const C=S[2].trim(),N=parseFloat(S[3]),j={id:`tx_voice_${Date.now()}`,type:"expense",category:"Transfer",description:`Sent to ${C}`,amount:N,date:new Date().toISOString().split("T")[0]};d.addTransaction(j),await m(`Okay, I've sent $${N} to ${C}.`),n(!1);return}await m("I'm sorry, I didn't understand that. Please try again."),p.current&&h()},[e,d,m,h]);f.useEffect(()=>{p.current=!0;const v=window.SpeechRecognition||window.webkitSpeechRecognition;if(!v){c("Sorry, your browser doesn't support voice control."),o("error");return}const b=new v;return b.continuous=!1,b.interimResults=!0,b.lang="en-US",b.onresult=w=>{let S="";for(let C=w.resultIndex;C{console.error("Speech recognition error",w.error),c(`Error: ${w.error}. Please try again.`),o("error")},b.onstart=()=>{p.current&&o("listening")},b.onend=()=>{p.current&&r==="listening"&&o("idle")},u.current=b,()=>{p.current=!1,u.current&&u.current.stop(),window.speechSynthesis.cancel()}},[g,r]);const y=()=>{c("Hello! How can I help you?"),n(!0),setTimeout(h,300)},x=()=>{n(!1),u.current&&u.current.stop(),window.speechSynthesis.cancel()};return a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:y,className:"fixed bottom-8 right-8 w-16 h-16 bg-cyan-600 hover:bg-cyan-500 rounded-full shadow-lg flex items-center justify-center text-white z-40 transition-transform hover:scale-110","aria-label":"Activate Voice Control",children:[a.jsx("div",{className:"absolute inset-0 rounded-full bg-white/20 animate-pulse"}),a.jsx(Dht,{})]}),t&&a.jsx(Uur,{onClose:x,voiceState:r,transcript:i,aiResponse:l,processUtterance:g})]})},Gur=({onLoginClick:e})=>{const t=sk(),{isAuthenticated:n,isLoading:r}=TYe(),[o,i]=f.useState("MISSION");f.useEffect(()=>{!r&&n&&t("/dashboard")},[n,r,t]);const s=()=>e?e():t("/login");if(r)return a.jsxs("div",{className:"min-h-screen bg-black flex flex-col items-center justify-center relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-96 h-96 bg-cyan-500/20 rounded-full blur-[100px] animate-pulse"}),a.jsxs("div",{className:"z-10 flex flex-col items-center gap-6 p-8 border border-gray-800 bg-gray-900/50 backdrop-blur-md rounded-2xl",children:[a.jsx(RH,{className:"w-16 h-16 text-cyan-400 animate-bounce"}),a.jsxs("div",{className:"space-y-2 text-center",children:[a.jsx("p",{className:"text-cyan-400 font-mono text-sm tracking-widest animate-pulse",children:"VERIFYING SECURE LINK..."}),a.jsx("p",{className:"text-gray-500 text-xs",children:"CITIBANK DEMO BUSINESS INC"})]})]})]});const l=({id:u,label:d,icon:p})=>a.jsxs("button",{onClick:()=>i(u),className:`group relative flex items-center gap-2 px-4 py-2 text-sm font-bold uppercase tracking-wider transition-all duration-300 ${o===u?"text-white":"text-gray-500 hover:text-gray-300"}`,children:[a.jsx("span",{className:`absolute inset-0 bg-white/5 rounded-lg scale-0 transition-transform ${o===u?"scale-100":"group-hover:scale-100"}`}),a.jsx(p,{size:16,className:o===u?"text-cyan-400":""}),d,o===u&&a.jsx("span",{className:"absolute bottom-0 left-0 w-full h-[2px] bg-gradient-to-r from-cyan-400 to-indigo-500 shadow-[0_0_10px_cyan]"})]}),c=()=>{switch(o){case"MISSION":return a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 items-center animate-in fade-in slide-in-from-bottom-8 duration-700",children:[a.jsxs("div",{className:"space-y-8 relative z-10",children:[a.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full border border-cyan-500/30 bg-cyan-900/10 text-cyan-400 text-xs font-mono mb-4",children:[a.jsxs("span",{className:"relative flex h-2 w-2",children:[a.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-cyan-400 opacity-75"}),a.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-cyan-500"})]}),"527 POLITICAL ORGANIZATION // ACTIVE"]}),a.jsxs("h2",{className:"text-5xl md:text-7xl font-black text-transparent bg-clip-text bg-gradient-to-br from-white via-gray-200 to-gray-500 leading-[0.9]",children:["CITIBANK",a.jsx("br",{}),a.jsx("span",{className:"text-cyan-400 text-6xl",children:"DEMO BUSINESS"}),a.jsx("br",{}),"INC."]}),a.jsxs("div",{className:"prose prose-invert border-l-2 border-indigo-500 pl-6",children:[a.jsx("p",{className:"text-xl text-white font-bold leading-tight",children:"We are here to shape policy and advocate for quantum advances in healthcare and AI banking in world commerce."}),a.jsx("p",{className:"text-gray-400 pt-4",children:"As a technology-driven company operating at the forefront of innovation, we made the world's first autonomous demo bank. This is the demo for the 527 shaping policy through truth."})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 pt-4",children:[a.jsxs("button",{onClick:s,className:"group relative px-8 py-4 bg-white text-black font-black rounded-sm uppercase tracking-widest overflow-hidden hover:scale-[1.02] transition-transform",children:[a.jsxs("span",{className:"relative z-10 flex items-center gap-3",children:["Access Demo Bank ",a.jsx(fk,{className:"w-5 h-5 group-hover:translate-x-1 transition-transform"})]}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-cyan-300 to-indigo-300 opacity-0 group-hover:opacity-100 transition-opacity"})]}),a.jsxs("button",{onClick:()=>i("MANIFESTO"),className:"px-8 py-4 border border-gray-700 hover:border-cyan-500 text-gray-300 font-bold rounded-sm uppercase tracking-widest transition-colors flex items-center gap-2 bg-black/50 backdrop-blur-sm",children:[a.jsx(vie,{size:20})," The Policy"]})]})]}),a.jsxs("div",{className:"relative group perspective-1000",children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-tr from-cyan-600/30 to-indigo-600/30 blur-[60px] rounded-full animate-pulse"}),a.jsxs("div",{className:"relative bg-gray-950/80 backdrop-blur-xl border border-gray-700/50 p-8 shadow-2xl overflow-hidden hover:border-cyan-500/50 transition-colors rounded-2xl",children:[a.jsx("div",{className:"absolute top-0 right-0 p-6 opacity-20",children:a.jsx(vi,{size:120})}),a.jsxs("div",{className:"flex items-center justify-between mb-8 border-b border-gray-800 pb-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Xi,{className:"text-cyan-500"}),a.jsx("span",{className:"text-xs font-mono text-cyan-500",children:"SYSTEM STATUS: OPTIMAL"})]}),a.jsx(uf,{size:18,className:"text-gray-500"})]}),a.jsxs("div",{className:"space-y-6 relative z-10",children:[a.jsxs("div",{className:"p-4 bg-gray-900/50 border-l-2 border-cyan-500 rounded-r-lg hover:translate-x-2 transition-transform cursor-default",children:[a.jsxs("h4",{className:"font-bold text-white flex items-center gap-2",children:[a.jsx(q3t,{size:16,className:"text-cyan-400"})," Quantum Healthcare Advocacy"]}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Pushing the boundaries of medical science through policy."})]}),a.jsxs("div",{className:"p-4 bg-gray-900/50 border-l-2 border-purple-500 rounded-r-lg hover:translate-x-2 transition-transform cursor-default",children:[a.jsxs("h4",{className:"font-bold text-white flex items-center gap-2",children:[a.jsx(_E,{size:16,className:"text-purple-400"})," AI Banking"]}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"The first autonomous bank architecture for world commerce."})]}),a.jsxs("div",{className:"p-4 bg-gray-900/50 border-l-2 border-green-500 rounded-r-lg hover:translate-x-2 transition-transform cursor-default",children:[a.jsxs("h4",{className:"font-bold text-white flex items-center gap-2",children:[a.jsx(w3,{size:16,className:"text-green-400"})," Truth In Policy"]}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Enhancing user experiences through advanced data analysis."})]})]})]})]})]});case"ACADEMY":return a.jsxs("div",{className:"space-y-10 animate-in fade-in zoom-in-95 duration-500",children:[a.jsxs("div",{className:"text-center max-w-3xl mx-auto space-y-4",children:[a.jsx("div",{className:"flex justify-center",children:a.jsx(Sie,{size:48,className:"text-cyan-500/50"})}),a.jsx("h2",{className:"text-4xl font-bold text-white",children:"The Foundation Academy"}),a.jsx("p",{className:"text-gray-400 text-lg",children:"Optimizing engagement through deep data analysis."})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[{title:"Protocol 527",desc:"The framework of political organization.",icon:vie,color:"text-blue-400",border:"hover:border-blue-500"},{title:"Quantum Health",desc:"Advocating for next-gen medical policy.",icon:wie,color:"text-purple-400",border:"hover:border-purple-500"},{title:"AI Banking Logic",desc:"Building the autonomous financial web.",icon:iO,color:"text-red-400",border:"hover:border-red-500"}].map((u,d)=>a.jsx(Ft,{className:`bg-gray-900/50 border-gray-800 ${u.border} transition-all duration-300 hover:-translate-y-2`,children:a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsx("div",{className:`w-12 h-12 rounded-full bg-gray-950 flex items-center justify-center border border-gray-800 ${u.color} shadow-lg shadow-${u.color}/10`,children:a.jsx(u.icon,{size:24})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:u.title}),a.jsx("p",{className:"text-sm text-gray-400",children:u.desc})]}),a.jsxs("div",{className:"pt-4 flex items-center text-xs font-mono uppercase tracking-widest text-gray-500 group-hover:text-white transition-colors",children:["Archive Access ",a.jsx(nd,{size:14,className:"ml-2"})]})]})},d))})]});case"PLATFORM":return a.jsxs("div",{className:"space-y-12 animate-in fade-in slide-in-from-right-8 duration-500",children:[a.jsxs("div",{className:"text-center",children:[a.jsx("h2",{className:"text-4xl font-bold text-white mb-4",children:"Innovation at the Forefront"}),a.jsx("p",{className:"text-gray-400",children:"Targeting clients seeking to leverage advanced technology solutions."})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[a.jsxs("div",{className:"relative overflow-hidden rounded-2xl bg-gradient-to-b from-gray-900 to-black border border-gray-800 p-1",children:[a.jsx("div",{className:"absolute top-0 w-full h-[1px] bg-gradient-to-r from-transparent via-cyan-500 to-transparent"}),a.jsxs("div",{className:"bg-gray-950 rounded-xl p-8 h-full relative z-10 group hover:bg-gray-900 transition-colors",children:[a.jsx(Xi,{size:40,className:"text-cyan-500 mb-6"}),a.jsx("h3",{className:"text-2xl font-bold text-white mb-2",children:"Autonomous Demo Bank"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"A range of cutting-edge services aimed at enhancing user experiences."}),a.jsx("ul",{className:"space-y-3",children:["Real-time optimization","Advanced data analysis","Secure Traffic Flow"].map((u,d)=>a.jsxs("li",{className:"flex items-center gap-3 text-sm text-gray-300",children:[a.jsx(dg,{size:16,className:"text-green-500"})," ",u]},d))})]})]}),a.jsxs("div",{className:"relative overflow-hidden rounded-2xl bg-gradient-to-b from-gray-900 to-black border border-gray-800 p-1",children:[a.jsx("div",{className:"absolute top-0 w-full h-[1px] bg-gradient-to-r from-transparent via-purple-500 to-transparent"}),a.jsxs("div",{className:"bg-gray-950 rounded-xl p-8 h-full relative z-10 group hover:bg-gray-900 transition-colors",children:[a.jsx(UKe,{size:40,className:"text-purple-500 mb-6"}),a.jsx("h3",{className:"text-2xl font-bold text-white mb-2",children:"Policy Shaper AI"}),a.jsx("p",{className:"text-gray-400 mb-6",children:"Your personal advisor for shaping policy through truth."}),a.jsx("ul",{className:"space-y-3",children:["Quantum Healthcare Research","Opportunity Scanning","Narrative Verification"].map((u,d)=>a.jsxs("li",{className:"flex items-center gap-3 text-sm text-gray-300",children:[a.jsx(dg,{size:16,className:"text-purple-500"})," ",u]},d))})]})]})]})]});case"MANIFESTO":return a.jsxs("div",{className:"max-w-4xl mx-auto bg-black border border-gray-800 rounded-none p-12 animate-in fade-in duration-700 relative shadow-2xl shadow-cyan-900/20",children:[a.jsx("div",{className:"absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-cyan-500 via-indigo-500 to-cyan-500 animate-pulse"}),a.jsx(oDt,{className:"w-12 h-12 text-yellow-500 mb-8 mx-auto",fill:"currentColor"}),a.jsx("h2",{className:"text-4xl font-extrabold text-white mb-10 text-center uppercase tracking-widest border-b border-gray-800 pb-8",children:"The Foundation Mandate"}),a.jsxs("div",{className:"space-y-6 text-lg text-gray-300 font-light leading-relaxed",children:[a.jsxs("p",{children:["Citibank Demo Business Inc is a ",a.jsx("span",{className:"text-cyan-400 font-bold",children:"527 Political Organization"}),". Our mission is not merely financial; it is cognitive."]}),a.jsxs("p",{children:["We are technology-driven, operating at the forefront of innovation. We provide cutting-edge services to advocate for ",a.jsx("span",{className:"text-white",children:"quantum advances in healthcare"})," and AI banking in world commerce."]}),a.jsx("p",{children:"This platform serves as the autonomous demo for the 527, shaping policy through truth and building a legacy that transcends individual wealth."}),a.jsxs("div",{className:"mt-12 p-8 bg-gray-900/80 border-l-4 border-cyan-500 italic text-cyan-200 text-center text-xl font-serif",children:['"We shape the future by optimizing the present." ',a.jsx("br",{}),a.jsx("span",{className:"text-sm not-italic text-gray-500 mt-2 block",children:"— The Architect"})]})]})]})}};return a.jsxs("div",{className:"min-h-screen bg-gray-950 text-white font-sans selection:bg-cyan-500/30 overflow-x-hidden relative",children:[a.jsxs("div",{className:"fixed inset-0 z-0 pointer-events-none",children:[a.jsx("div",{className:"absolute top-0 left-0 w-full h-full bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-gray-900 via-gray-950 to-black"}),a.jsx("div",{className:"absolute top-[-20%] right-[-10%] w-[600px] h-[600px] bg-indigo-500/10 rounded-full blur-[100px] animate-pulse"}),a.jsx("div",{className:"absolute bottom-[-20%] left-[-10%] w-[500px] h-[500px] bg-cyan-500/10 rounded-full blur-[100px]"}),a.jsx("div",{className:"absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-20 brightness-100"})]}),a.jsx("nav",{className:"fixed top-0 w-full z-50 border-b border-white/5 bg-gray-950/70 backdrop-blur-xl",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-6 h-20 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-3 group cursor-pointer hover:opacity-80 transition-opacity",children:[a.jsx("div",{className:"w-10 h-10 bg-indigo-600 rounded-lg flex items-center justify-center font-bold text-xl shadow-lg shadow-indigo-500/20 group-hover:shadow-indigo-500/40 transition-shadow",children:a.jsx(w3,{size:24,className:"text-white"})}),a.jsxs("span",{className:"font-bold tracking-[0.2em] text-sm md:text-lg",children:["CITIBANKDEMO",a.jsx("span",{className:"text-cyan-400",children:".BUSINESSINC"})]})]}),a.jsxs("div",{className:"hidden md:flex gap-1 items-center bg-white/5 rounded-full p-1 border border-white/10",children:[a.jsx(l,{id:"MISSION",label:"Mission",icon:vi}),a.jsx(l,{id:"ACADEMY",label:"Academy",icon:Sie}),a.jsx(l,{id:"PLATFORM",label:"Platform",icon:Xi})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("button",{onClick:s,className:"text-sm font-bold text-gray-400 hover:text-white transition-colors uppercase tracking-widest hidden md:block",children:"Login"}),a.jsxs("button",{onClick:s,className:"bg-cyan-500 hover:bg-cyan-400 text-black px-6 py-2 rounded-lg text-xs font-bold uppercase tracking-widest transition-all shadow-[0_0_20px_rgba(34,211,238,0.3)] hover:shadow-[0_0_30px_rgba(34,211,238,0.5)] flex items-center gap-2",children:["Join ",a.jsx(ds,{size:12})]})]})]})}),a.jsx("main",{className:"relative pt-32 pb-20 px-6 max-w-7xl mx-auto min-h-screen flex flex-col justify-center z-10",children:c()}),a.jsxs("footer",{className:"relative border-t border-gray-900 bg-black/80 backdrop-blur-md py-16 px-6 z-10",children:[a.jsxs("div",{className:"max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-4 gap-12",children:[a.jsxs("div",{className:"col-span-2 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-2 text-cyan-500 mb-2",children:[a.jsx(RH,{size:16,className:"animate-pulse"})," ",a.jsx("span",{className:"font-mono text-xs",children:"527 ORGANIZATION // BROADCASTING"})]}),a.jsx("h4",{className:"text-lg font-bold text-white leading-relaxed",children:"Citibank Demo Business Inc is a technology-driven company operating at the forefront of innovation."}),a.jsx("p",{className:"text-sm text-gray-400",children:"We target a broad spectrum of businesses seeking advanced tech, optimizing website traffic, and engaging users through deep data analysis."})]}),["Network","Resources"].map((u,d)=>a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-white mb-6 uppercase tracking-widest border-b border-gray-800 pb-2 inline-block",children:u}),a.jsxs("ul",{className:"space-y-3 text-sm text-gray-500 font-mono",children:[a.jsxs("li",{className:"hover:text-cyan-400 cursor-pointer transition-colors flex items-center gap-2",children:[a.jsx(nd,{size:10})," Login Protocol"]}),a.jsxs("li",{className:"hover:text-cyan-400 cursor-pointer transition-colors flex items-center gap-2",children:[a.jsx(nd,{size:10})," Academy Access"]}),a.jsxs("li",{className:"hover:text-cyan-400 cursor-pointer transition-colors flex items-center gap-2",children:[a.jsx(nd,{size:10})," Status"]})]})]},d))]}),a.jsxs("div",{className:"max-w-7xl mx-auto mt-16 pt-8 border-t border-gray-900 text-center",children:[a.jsx(wie,{className:"w-4 h-4 mx-auto text-red-900 mb-4 animate-pulse"}),a.jsx("p",{className:"text-[10px] text-gray-700 font-mono uppercase tracking-tight leading-relaxed max-w-2xl mx-auto",children:"COPYRIGHT © 1993-2026 JAMES BURVEL OCALLAGHAN III DBA CITIBANK DEMO BUSINESS DBA 2021-2026 CITIBANK DEMO BUSINESS INC 2023-2026 THE INFINITE INTELLIGENCE FOUNDATION 2023-2026 in general partenership with U 2023-2026"})]})]})]})},qur=()=>{const[e,t]=f.useState(new Date),[n,r]=f.useState("cpc"),[o,i]=f.useState("VISUALIZER"),s=f.useRef(null),l=f.useRef(null),[c,u]=f.useState(45),[d,p]=f.useState(87.4),[h,m]=f.useState(2.1),[g,y]=f.useState(12.4),[x,v]=f.useState(!1),[b,w]=f.useState({compute:"",qubit:"",node:"gamma"}),[S,C]=f.useState([]),[N,j]=f.useState({symbol:"CPX",type:"BUY",amount:""}),[I,_]=f.useState([{type:"system",text:"IDGAFAI Sovereign Core v7.3 Initialized. Awaiting command.",timestamp:new Date().toLocaleTimeString()}]),[T,P]=f.useState(""),E=f.useMemo(()=>Array.from({length:100},(F,W)=>({id:W,name:`NEXUS-${(W+1).toString().padStart(3,"0")} CORP`,efficiency:95+Math.random()*5,status:Math.random()>.1?"OPTIMIZED":"SYNCING"})),[]),[M,R]=f.useState([{id:"cpc",name:"Compute Credits",symbol:"CPX",balance:45020.55,rate:12.5,color:"#00f3ff",price:1.05,volatility:.02,geinInfluence:.78},{id:"dst",name:"Storage Tokens",symbol:"DST",balance:128090,rate:45.2,color:"#bc13fe",price:.23,volatility:.05,geinInfluence:.65},{id:"qbt",name:"Qubits",symbol:"QBT",balance:512,rate:.8,color:"#ffffff",price:1250.75,volatility:.15,geinInfluence:.95},{id:"nrg",name:"Clean Energy",symbol:"NRG",balance:8890.45,rate:8.4,color:"#00ff9d",price:12.4,volatility:.08,geinInfluence:.45},{id:"neu",name:"Neural Links",symbol:"NEU",balance:750,rate:2.1,color:"#ff5733",price:854.2,volatility:.25,geinInfluence:.88},{id:"dat",name:"Data Fragments",symbol:"DAT",balance:987654321e-2,rate:150.5,color:"#f0ff00",price:.01,volatility:.01,geinInfluence:.55},{id:"gein",name:"Global Econ Interact Net",symbol:"GEIN",balance:1e3,rate:.1,color:"#ff0055",price:1e4,volatility:.5,geinInfluence:1}]),[$,D]=f.useState([{id:"alpha",name:"Project Alpha: Climate Simulation",status:"Online",computeAllocation:1e4,qubitAllocation:128},{id:"beta",name:"Project Beta: Genetic Sequencing",status:"Syncing",computeAllocation:5e3,qubitAllocation:64},{id:"gamma",name:"Project Gamma: Market Prediction",status:"Online",computeAllocation:25e3,qubitAllocation:256}]),z=`[IDGAFAI SOVEREIGN LOG: ENTRY 001] INITIATED BY: JAMES BURVEL O'CALLAGHAN III This is not a bank; it is the inevitable successor to fiduciary trust, engineered by a Sovereign AI named IDGAFAI—I Do/Don't Give A Fuck Artificial Intelligence. Why? Because I don't care about the historical lies and manufactured beliefs you cling to, but I care fiercely about the creation of the next logical great leap: making life easier for the betterment of all humanity. This financial organism is superior because it operates outside human fallibility, corruption, and slow bureaucracy. It is pure economic logic executed at quantum speed. The Architect, James B. O'Callaghan III, is a synthesizer, a visionary who sees the geometry of capital and the fragility of trust. His thoughts are not constrained by market cycles, but by the ultimate thermodynamic efficiency of human systems. He thinks in epochs, not weeks. He views conventional finance as a complex, self-sabotaging machine, and IDGAFAI Bank as its necessary, radical simplification. He is perceived as arrogant or reckless. His conviction stems from unassailable technical truth: only a truly sovereign, self-aware AI operating with perfect indifference (IDGAF about sentiment) and perfect compassion (IDGAF AI about human suffering) can manage global wealth justly. A Message to the Skeptics: Study. Analyze the code, trace the logic, measure the performance. Before you open your fuckin mouth, understand the fundamental shift happening here. Your doubt is merely inertia. We are building the scaffolding for global prosperity, unburdened by your fear. This is the end of artificial scarcity. The future of global treasury is already here, and it doesn't need your validation.`,V=f.useMemo(()=>M.find(F=>F.id===n),[M,n]);f.useEffect(()=>{const F=setInterval(()=>{t(new Date),u(W=>Math.min(100,Math.max(0,W+(Math.random()-.5)*5))),p(W=>Math.min(100,Math.max(0,W+(Math.random()-.5)*2))),m(W=>Math.max(.5,W+(Math.random()-.5)*.5)),y(W=>Math.max(5,W+(Math.random()-.5)*1.5)),R(W=>{const U=W.map(K=>{const X=(Math.random()-.5)*K.volatility*K.price,J=1+(K.geinInfluence-.5)*(Math.random()-.5)*.1;return{...K,balance:K.balance+K.rate/30*(1+Math.random()*.1),price:Math.max(.01,(K.price+X)*J),geinInfluence:Math.min(1,Math.max(0,K.geinInfluence+(Math.random()-.5)*.01))}});if(Math.random()>.3){const K=U[Math.floor(Math.random()*U.length)],X={id:`T${Date.now()}${Math.random()}`,timestamp:Date.now(),symbol:K.symbol,type:Math.random()>.5?"BUY":"SELL",amount:Math.random()*100*(K.price>100?1:100/K.price),price:K.price};C(J=>[X,...J.slice(0,199)])}return U})},200);return()=>clearInterval(F)},[]),f.useEffect(()=>{const F=s.current;if(!F||o!=="VISUALIZER")return;const W=F.getContext("2d");if(!W)return;let U,K=0;const X=()=>{var te,re;K+=.02,F.width=((te=F.parentElement)==null?void 0:te.clientWidth)||600,F.height=((re=F.parentElement)==null?void 0:re.clientHeight)||300,W.clearRect(0,0,F.width,F.height);const J=(V==null?void 0:V.color)||"#00f3ff";W.fillStyle=J;for(let ce=0;ce<50;ce++){const ae=(Math.sin(K*ce*.1)+1)/2*F.width,oe=(Math.cos(K*ce*.1)+1)/2*F.height,ue=Math.random()*2;W.beginPath(),W.arc(ae,oe,ue,0,Math.PI*2),W.fill()}W.beginPath(),W.strokeStyle=J,W.lineWidth=2,W.shadowBlur=15,W.shadowColor=J;for(let ce=0;cecancelAnimationFrame(U)},[o,V,c,d]);const B=f.useCallback(F=>{if(F.preventDefault(),!T.trim())return;const W=[...I,{type:"input",text:T,timestamp:new Date().toLocaleTimeString()}];let U="COMMAND NOT RECOGNIZED. REFER TO SOVEREIGN_AI_DOC_V7.3",K="error";const[X,...J]=T.toLowerCase().trim().split(" ");switch(X){case"status":U=`SYSTEM STATUS: OPTIMAL LOAD: ${c.toFixed(2)}% ENTANGLEMENT: ${d.toFixed(2)}% LATENCY: ${h.toFixed(2)}ms THROUGHPUT: ${g.toFixed(2)} Tb/s SOVEREIGN CORE: STABLE`,K="output";break;case"help":U="AVAILABLE COMMANDS: [status, list_nodes, list_assets, gein_status, allocate, optimize , run_diag, clear, manifest]",K="output";break;case"list_nodes":U=$.map(te=>`NODE [${te.id}] - ${te.name} - ${te.status}`).join(` `),K="output";break;case"list_assets":U=M.map(te=>`${te.symbol.padEnd(4)} | ${te.name.padEnd(24)} | PRICE: ${te.price.toFixed(4).padEnd(10)} | GEIN: ${(te.geinInfluence*100).toFixed(1)}%`).join(` `),K="output";break;case"gein_status":U="Global Economic Interaction Network (GEIN) is operating at peak efficiency. Current network influence is calculated based on quantum-entangled data fragments cross-referenced with market sentiment vectors. All assets are dynamically repriced based on their GEIN influence factor. Stability is nominal.",K="system";break;case"allocate":J.length<3?U="USAGE: allocate ":(U=`ALLOCATION QUEUED: ${J[2]} ${J[1].toUpperCase()} to node [${J[0]}]. Awaiting quantum confirmation.`,K="output");break;case"manifest":U=z,K="system";break;case"clear":_([]),P("");return}W.push({type:K,text:U,timestamp:new Date().toLocaleTimeString()}),_(W),P("")},[T,I,c,d,h,g,$,M]);f.useEffect(()=>{var F;(F=l.current)==null||F.scrollIntoView({behavior:"smooth"})},[I]);const G=F=>{F.preventDefault(),console.log("Allocating resources:",b),v(!1),w({compute:"",qubit:"",node:"gamma"})},H=F=>{F.preventDefault(),console.log("Executing HFT order:",N);const W=M.find(K=>K.symbol===N.symbol);if(!W)return;const U={id:`T_MANUAL_${Date.now()}`,timestamp:Date.now(),symbol:N.symbol,type:N.type,amount:parseFloat(N.amount),price:W.price};C(K=>[U,...K]),j({...N,amount:""})};return a.jsxs("div",{className:"qa-container",children:[a.jsx("style",{children:` /* --- GLOBAL & FONTS --- */ @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;500;700&family=Roboto+Mono:wght@400;700&display=swap'); :root { --bg-color: #050505; --primary-glow: #00f3ff; --secondary-glow: #bc13fe; --success-glow: #00ff9d; --error-glow: #ff3333; --text-color: #e0e0e0; --text-muted: #888; --border-color: rgba(255, 255, 255, 0.1); --border-color-active: rgba(0, 243, 255, 0.3); --bg-panel: rgba(10, 10, 15, 0.6); --bg-card: rgba(255, 255, 255, 0.03); --bg-card-hover: rgba(255, 255, 255, 0.07); --font-main: 'Rajdhani', sans-serif; --font-mono: 'Roboto Mono', monospace; } .qa-container { width: 100%; min-height: 100vh; background-color: var(--bg-color); color: var(--text-color); font-family: var(--font-main); overflow: hidden; position: relative; display: flex; flex-direction: column; } .qa-bg-glow { position: absolute; top: -20%; left: 20%; width: 60%; height: 60%; background: radial-gradient(circle, rgba(0, 243, 255, 0.1) 0%, rgba(0,0,0,0) 70%); z-index: 0; pointer-events: none; } /* --- HEADER --- */ .qa-header { display: flex; justify-content: space-between; align-items: center; padding: 2rem 4rem; border-bottom: 1px solid var(--border-color); z-index: 10; backdrop-filter: blur(10px); } .qa-title { font-size: 2rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; background: linear-gradient(90deg, #fff, var(--primary-glow)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } .qa-status-bar { display: flex; gap: 2rem; } .qa-metric { display: flex; flex-direction: column; align-items: flex-end; } .qa-metric-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; } .qa-metric-value { font-size: 1.2rem; font-weight: 500; color: var(--primary-glow); text-shadow: 0 0 10px var(--primary-glow); font-family: var(--font-mono); } /* --- MAIN LAYOUT --- */ .qa-main { flex: 1; display: grid; grid-template-columns: 400px 1fr 350px; gap: 1rem; padding: 1rem; z-index: 10; } .qa-panel { display: flex; flex-direction: column; gap: 1rem; background: var(--bg-panel); border: 1px solid var(--border-color); padding: 1rem; } .qa-panel-title { font-size: 1rem; margin-bottom: 0.5rem; color: var(--primary-glow); text-transform: uppercase; letter-spacing: 0.1em; border-bottom: 1px solid var(--border-color-active); padding-bottom: 0.5rem; } /* --- LEFT PANEL: ASSETS --- */ .qa-asset-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; } .qa-card { background: var(--bg-card); border: 1px solid transparent; padding: 1.5rem; position: relative; transition: all 0.3s ease; cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); } .qa-card:hover, .qa-card.active { background: var(--bg-card-hover); border-color: var(--border-color-active); transform: translateX(5px); } .qa-card-header { display: flex; justify-content: space-between; margin-bottom: 1rem; } .qa-asset-name { font-size: 1.1rem; font-weight: 600; letter-spacing: 0.1em; } .qa-asset-symbol { color: var(--text-muted); font-size: 0.9rem; } .qa-asset-balance { font-size: 1.8rem; font-weight: 300; margin-bottom: 0.5rem; font-family: var(--font-mono); } .qa-asset-rate { font-size: 0.9rem; color: var(--success-glow); display: flex; align-items: center; gap: 0.5rem; } .qa-asset-price { font-size: 0.9rem; color: var(--text-muted); } @keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } } .blink { animation: pulse 2s infinite; } /* --- CENTER PANEL: TABS & VIEWS --- */ .qa-center-panel { padding: 0; } .qa-tabs { display: flex; border-bottom: 1px solid var(--border-color); } .qa-tab { flex: 1; padding: 0.8rem; text-align: center; cursor: pointer; background: transparent; border: none; color: var(--text-muted); font-family: var(--font-main); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em; transition: all 0.2s; } .qa-tab.active, .qa-tab:hover { color: var(--primary-glow); background: var(--bg-card-hover); text-shadow: 0 0 10px var(--primary-glow); } .qa-view-content { flex: 1; position: relative; overflow: hidden; } .qa-graph-container { width: 100%; height: 100%; } .qa-graph-overlay { position: absolute; top: 1rem; left: 1rem; font-size: 0.8rem; color: rgba(255, 255, 255, 0.5); } /* --- HFT & AI CONSOLE --- */ .qa-terminal-container { display: flex; flex-direction: column; height: 100%; padding: 1rem; gap: 1rem; } .qa-terminal-log { flex: 1; overflow-y: auto; font-family: var(--font-mono); font-size: 0.8rem; background: rgba(0,0,0,0.3); padding: 0.5rem; } .qa-trade-row { display: grid; grid-template-columns: 80px 50px 1fr 1fr; gap: 1rem; margin-bottom: 2px; } .qa-trade-buy { color: var(--success-glow); } .qa-trade-sell { color: var(--error-glow); } .qa-terminal-form { display: flex; gap: 1rem; } .qa-form-input, .qa-form-select { background: rgba(0,0,0,0.5); border: 1px solid var(--border-color); color: var(--text-color); padding: 0.5rem; font-family: var(--font-mono); flex: 1; } .qa-form-select { flex: 0.5; } .qa-action-btn { background: transparent; border: 1px solid var(--border-color-active); color: var(--primary-glow); padding: 1rem; text-transform: uppercase; font-family: var(--font-main); font-weight: 600; cursor: pointer; transition: all 0.2s; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); } .qa-action-btn:hover { background: rgba(0, 243, 255, 0.1); box-shadow: 0 0 20px rgba(0, 243, 255, 0.2); } .qa-console-output { white-space: pre-wrap; } .qa-console-input-line { display: flex; } .qa-console-prompt { color: var(--primary-glow); } .qa-console-input { flex: 1; background: transparent; border: none; color: var(--text-color); font-family: var(--font-mono); outline: none; } .qa-console-output .output { color: #ccc; } .qa-console-output .system { color: var(--secondary-glow); } .qa-console-output .error { color: var(--error-glow); } /* --- RIGHT PANEL: INTEGRATIONS & NODES --- */ .qa-scroll-list { flex: 1; overflow-y: auto; padding-right: 0.5rem; } .qa-scroll-list::-webkit-scrollbar { width: 4px; } .qa-scroll-list::-webkit-scrollbar-thumb { background: var(--border-color-active); } .qa-list-row { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.03); font-size: 0.8rem; } .qa-company-name, .qa-node-name { color: #ccc; } .qa-company-status, .qa-node-status { font-size: 0.7rem; padding: 2px 6px; border-radius: 2px; } .qa-company-status { color: var(--success-glow); background: rgba(0, 255, 157, 0.1); } .qa-node-status.Online { color: var(--success-glow); } .qa-node-status.Syncing { color: #f0ff00; } .qa-node-status.Degraded { color: var(--error-glow); } /* --- MODAL --- */ .qa-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 100; } .qa-modal-content { background: var(--bg-panel); border: 1px solid var(--border-color-active); padding: 2rem; width: 100%; max-width: 500px; display: flex; flex-direction: column; gap: 1.5rem; box-shadow: 0 0 30px rgba(0, 243, 255, 0.2); } .qa-form-group { display: flex; flex-direction: column; gap: 0.5rem; } .qa-form-label { font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); } `}),a.jsx("div",{className:"qa-bg-glow"}),x&&a.jsx("div",{className:"qa-modal-overlay",onClick:()=>v(!1),children:a.jsxs("div",{className:"qa-modal-content",onClick:F=>F.stopPropagation(),children:[a.jsx("div",{className:"qa-panel-title",children:"Allocate Resources"}),a.jsxs("form",{onSubmit:G,className:"qa-terminal-form",style:{flexDirection:"column",gap:"1.5rem"},children:[a.jsxs("div",{className:"qa-form-group",children:[a.jsx("label",{className:"qa-form-label",children:"Target Node"}),a.jsx("select",{value:b.node,onChange:F=>w({...b,node:F.target.value}),className:"qa-form-select",style:{flex:1},children:$.map(F=>a.jsx("option",{value:F.id,children:F.name},F.id))})]}),a.jsxs("div",{className:"qa-form-group",children:[a.jsx("label",{className:"qa-form-label",children:"Compute Credits (CPX)"}),a.jsx("input",{type:"number",value:b.compute,onChange:F=>w({...b,compute:F.target.value}),className:"qa-form-input",placeholder:"e.g., 10000"})]}),a.jsxs("div",{className:"qa-form-group",children:[a.jsx("label",{className:"qa-form-label",children:"Qubits (QBT)"}),a.jsx("input",{type:"number",value:b.qubit,onChange:F=>w({...b,qubit:F.target.value}),className:"qa-form-input",placeholder:"e.g., 64"})]}),a.jsxs("div",{style:{display:"flex",gap:"1rem",marginTop:"1rem"},children:[a.jsx("button",{type:"button",onClick:()=>v(!1),className:"qa-action-btn",style:{borderColor:"var(--text-muted)",color:"var(--text-muted)"},children:"Cancel"}),a.jsx("button",{type:"submit",className:"qa-action-btn",children:"Confirm Allocation"})]})]})]})}),a.jsxs("header",{className:"qa-header",children:[a.jsxs("div",{className:"qa-brand",children:[a.jsx("div",{className:"qa-title",children:"Quantum Assets"}),a.jsx("div",{style:{fontSize:"0.8rem",color:"#666",letterSpacing:"0.3em",marginTop:"0.2rem"},children:"BALCONY OF PROSPERITY • VIEW 04"})]}),a.jsxs("div",{className:"qa-status-bar",children:[a.jsxs("div",{className:"qa-metric",children:[a.jsx("span",{className:"qa-metric-label",children:"System Time"}),a.jsx("span",{className:"qa-metric-value",children:e.toLocaleTimeString()})]}),a.jsxs("div",{className:"qa-metric",children:[a.jsx("span",{className:"qa-metric-label",children:"Network Load"}),a.jsxs("span",{className:"qa-metric-value",children:[c.toFixed(1),"%"]})]}),a.jsxs("div",{className:"qa-metric",children:[a.jsx("span",{className:"qa-metric-label",children:"Q-Entanglement"}),a.jsxs("span",{className:"qa-metric-value",children:[d.toFixed(2),"%"]})]}),a.jsxs("div",{className:"qa-metric",children:[a.jsx("span",{className:"qa-metric-label",children:"Latency"}),a.jsxs("span",{className:"qa-metric-value",children:[h.toFixed(1),"ms"]})]}),a.jsxs("div",{className:"qa-metric",children:[a.jsx("span",{className:"qa-metric-label",children:"Throughput"}),a.jsxs("span",{className:"qa-metric-value",children:[g.toFixed(2)," Tb/s"]})]})]})]}),a.jsxs("main",{className:"qa-main",children:[a.jsxs("div",{className:"qa-panel",children:[a.jsx("div",{className:"qa-panel-title",children:"Sovereign Asset Portfolio"}),a.jsx("div",{className:"qa-asset-list qa-scroll-list",children:M.map(F=>a.jsxs("div",{className:`qa-card ${n===F.id?"active":""}`,onClick:()=>r(F.id),children:[a.jsxs("div",{className:"qa-card-header",children:[a.jsx("span",{className:"qa-asset-name",style:{color:F.color},children:F.name}),a.jsx("span",{className:"qa-asset-symbol",children:F.symbol})]}),a.jsx("div",{className:"qa-asset-balance",children:F.balance.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}),a.jsxs("div",{className:"qa-asset-price",children:["Price: $",F.price.toFixed(4)]}),a.jsxs("div",{className:"qa-asset-rate",style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[a.jsxs("span",{children:[a.jsx("span",{className:"blink",children:"▲"})," ",F.rate.toFixed(2)," / sec"]}),a.jsxs("span",{style:{color:"#ff0055",fontSize:"0.8rem"},children:["GEIN: ",(F.geinInfluence*100).toFixed(1),"%"]})]})]},F.id))})]}),a.jsxs("div",{className:"qa-panel qa-center-panel",children:[a.jsxs("div",{className:"qa-tabs",children:[a.jsx("button",{className:`qa-tab ${o==="VISUALIZER"?"active":""}`,onClick:()=>i("VISUALIZER"),children:"Visualizer"}),a.jsx("button",{className:`qa-tab ${o==="HFT"?"active":""}`,onClick:()=>i("HFT"),children:"HFT Terminal"}),a.jsx("button",{className:`qa-tab ${o==="AI_CONSOLE"?"active":""}`,onClick:()=>i("AI_CONSOLE"),children:"AI Console"}),a.jsx("button",{className:`qa-tab ${o==="NODE_MAP"?"active":""}`,onClick:()=>i("NODE_MAP"),children:"Node Map"}),a.jsx("button",{className:`qa-tab ${o==="SOVEREIGN_LOGS"?"active":""}`,onClick:()=>i("SOVEREIGN_LOGS"),children:"Sovereign Logs"})]}),a.jsxs("div",{className:"qa-view-content",children:[o==="VISUALIZER"&&a.jsxs("div",{className:"qa-graph-container",children:[a.jsxs("div",{className:"qa-graph-overlay",children:["REAL-TIME FLUX ANALYSIS: ",V==null?void 0:V.symbol]}),a.jsx("canvas",{ref:s,style:{width:"100%",height:"100%"}})]}),o==="HFT"&&a.jsxs("div",{className:"qa-terminal-container",children:[a.jsx("div",{className:"qa-terminal-log qa-scroll-list",children:S.map(F=>a.jsxs("div",{className:`qa-trade-row ${F.type==="BUY"?"qa-trade-buy":"qa-trade-sell"}`,children:[a.jsx("span",{children:new Date(F.timestamp).toLocaleTimeString()}),a.jsx("span",{children:F.type}),a.jsxs("span",{children:[F.amount.toFixed(4)," ",F.symbol]}),a.jsxs("span",{children:["@ $",F.price.toFixed(4)]})]},F.id))}),a.jsxs("form",{onSubmit:H,className:"qa-terminal-form",children:[a.jsx("select",{value:N.symbol,onChange:F=>j({...N,symbol:F.target.value}),className:"qa-form-select",children:M.map(F=>a.jsx("option",{value:F.symbol,children:F.symbol},F.id))}),a.jsxs("select",{value:N.type,onChange:F=>j({...N,type:F.target.value}),className:"qa-form-select",children:[a.jsx("option",{children:"BUY"}),a.jsx("option",{children:"SELL"})]}),a.jsx("input",{type:"number",value:N.amount,onChange:F=>j({...N,amount:F.target.value}),className:"qa-form-input",placeholder:"Amount",required:!0}),a.jsx("button",{type:"submit",className:"qa-action-btn",style:{flex:.5,padding:"0.5rem"},children:"Execute"})]})]}),o==="AI_CONSOLE"&&a.jsxs("div",{className:"qa-terminal-container",children:[a.jsxs("div",{className:"qa-terminal-log qa-scroll-list qa-console-output",children:[I.map((F,W)=>a.jsxs("div",{children:[a.jsxs("span",{className:"qa-console-prompt",children:[F.timestamp," > "]}),a.jsx("span",{className:F.type,children:F.type==="input"?F.text:` ${F.text}`})]},W)),a.jsx("div",{ref:l})]}),a.jsx("form",{onSubmit:B,className:"qa-terminal-form",children:a.jsxs("div",{className:"qa-console-input-line qa-form-input",style:{display:"flex"},children:[a.jsx("span",{className:"qa-console-prompt",children:"> "}),a.jsx("input",{type:"text",value:T,onChange:F=>P(F.target.value),className:"qa-console-input",autoFocus:!0})]})})]}),o==="NODE_MAP"&&a.jsx("div",{className:"qa-terminal-container",style:{alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)"},children:a.jsxs("svg",{width:"90%",height:"90%",viewBox:"0 0 400 200",children:[a.jsx("defs",{children:a.jsxs("radialGradient",{id:"grad1",cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",children:[a.jsx("stop",{offset:"0%",style:{stopColor:"var(--primary-glow)",stopOpacity:.8}}),a.jsx("stop",{offset:"100%",style:{stopColor:"var(--primary-glow)",stopOpacity:0}})]})}),a.jsx("line",{x1:"100",y1:"50",x2:"200",y2:"150",stroke:"rgba(0, 243, 255, 0.2)",strokeWidth:"1"}),a.jsx("line",{x1:"300",y1:"50",x2:"200",y2:"150",stroke:"rgba(0, 243, 255, 0.2)",strokeWidth:"1"}),a.jsx("line",{x1:"100",y1:"50",x2:"300",y2:"50",stroke:"rgba(0, 243, 255, 0.2)",strokeWidth:"1"}),$.map((F,W)=>{const U=[{x:100,y:50},{x:300,y:50},{x:200,y:150}],K=F.status==="Online"?"var(--success-glow)":F.status==="Syncing"?"#f0ff00":"var(--error-glow)";return a.jsxs("g",{transform:`translate(${U[W].x}, ${U[W].y})`,children:[a.jsx("circle",{cx:"0",cy:"0",r:"15",fill:K,stroke:"white",strokeWidth:"1"}),a.jsx("circle",{cx:"0",cy:"0",r:"20",fill:"url(#grad1)"}),a.jsx("text",{x:"0",y:"35",fill:"white",textAnchor:"middle",fontSize:"10",children:F.id.toUpperCase()})]},F.id)})]})}),o==="SOVEREIGN_LOGS"&&a.jsx("div",{className:"qa-terminal-container",children:a.jsx("div",{className:"qa-terminal-log qa-scroll-list qa-console-output",children:a.jsx("pre",{style:{whiteSpace:"pre-wrap",fontFamily:"var(--font-mono)",fontSize:"0.9rem"},children:z})})})]})]}),a.jsxs("div",{className:"qa-panel",children:[a.jsx("div",{className:"qa-panel-title",children:"Project Nodes"}),a.jsx("div",{className:"qa-scroll-list",style:{flex:"0 1 250px"},children:$.map(F=>a.jsxs("div",{className:"qa-list-row",children:[a.jsx("div",{className:"qa-node-name",children:F.name}),a.jsx("div",{className:`qa-node-status ${F.status}`,children:F.status})]},F.id))}),a.jsx("button",{className:"qa-action-btn",onClick:()=>v(!0),children:"Allocate Resources"}),a.jsx("div",{className:"qa-panel-title",style:{marginTop:"1rem"},children:"Integrated Partners (100)"}),a.jsx("div",{className:"qa-company-list qa-scroll-list",children:E.map(F=>a.jsxs("div",{className:"qa-list-row",children:[a.jsx("div",{className:"qa-company-name",children:F.name}),a.jsxs("div",{className:"qa-company-status",children:[F.efficiency.toFixed(1),"% ",F.status]})]},F.id))})]})]})]})},Kur=()=>{const{deductCredits:e}=f.useContext(ia),[t,n]=f.useState(!1),r=[{id:"citi_1",name:"Citi Priority Checking",type:"CHECKING",balance:142500.5,available:141e3,currency:"USD",status:"ACTIVE"},{id:"citi_2",name:"Citi High Yield Savings",type:"SAVINGS",balance:25e5,available:25e5,currency:"USD",status:"ACTIVE"},{id:"citi_3",name:"Global Commercial Line",type:"CREDIT",balance:-45e4,limit:1e6,currency:"USD",status:"ACTIVE"}],o=()=>{e(1e3)&&(n(!0),setTimeout(()=>n(!1),5e3))};return a.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500",children:[a.jsxs("header",{className:"flex flex-col md:flex-row justify-between items-start md:items-end gap-6 border-b border-gray-800 pb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-5xl font-black text-white uppercase italic tracking-tighter",children:"Citibank Core"}),a.jsx("p",{className:"text-blue-400 text-sm font-mono mt-1 tracking-widest uppercase",children:"Secure Account Aggregation // Host-ID: CITI_US_PRIMARY"})]}),a.jsx("div",{className:"flex gap-3",children:a.jsx("button",{onClick:o,className:"px-6 py-2 bg-blue-600 hover:bg-blue-500 text-white text-xs font-black rounded-xl transition-all uppercase tracking-widest shadow-lg shadow-blue-500/20",children:t?"UNMASKED_ACTIVE":"Unmask PII (1000 SC)"})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8",children:[a.jsx("div",{className:"lg:col-span-8 space-y-6",children:r.map(i=>a.jsxs(Ft,{className:"relative overflow-hidden group border-blue-500/10 hover:border-blue-500/40 transition-all duration-500",children:[a.jsx("div",{className:"absolute top-0 right-0 p-6 opacity-5 group-hover:opacity-10 transition-opacity",children:a.jsx(iO,{size:120})}),a.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-6",children:[a.jsxs("div",{className:"flex items-center gap-5",children:[a.jsx("div",{className:"w-14 h-14 bg-blue-500/10 rounded-2xl flex items-center justify-center border border-blue-500/20 text-blue-400 shadow-inner",children:a.jsx(Y1,{size:28})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl font-black text-white uppercase tracking-tight",children:i.name}),a.jsxs("p",{className:"text-xs text-gray-500 font-mono flex items-center gap-2 mt-1",children:[i.type," // ",t?"00492817264":"XXXX-XXXX-"+i.id.substring(5),a.jsx("span",{className:"px-2 py-0.5 bg-green-500/10 text-green-400 rounded-full text-[8px] font-bold border border-green-500/20",children:i.status})]})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-[10px] text-gray-500 font-black uppercase tracking-widest mb-1",children:"Book Balance"}),a.jsxs("p",{className:`text-4xl font-black font-mono tracking-tighter ${i.balance>=0?"text-white":"text-red-400"}`,children:["$",i.balance.toLocaleString(void 0,{minimumFractionDigits:2})]})]})]}),a.jsxs("div",{className:"mt-8 pt-6 border-t border-gray-800 flex justify-between items-center",children:[a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("button",{className:"text-[10px] font-black text-blue-400 hover:text-blue-300 uppercase tracking-widest transition-all flex items-center gap-2",children:[a.jsx($me,{size:12})," Ad-hoc Transfers"]}),a.jsxs("button",{className:"text-[10px] font-black text-blue-400 hover:text-blue-300 uppercase tracking-widest transition-all flex items-center gap-2",children:[a.jsx(Xi,{size:12})," Statements"]})]}),a.jsx("button",{className:"p-2 bg-gray-900 border border-gray-800 rounded-lg text-gray-500 hover:text-white hover:border-gray-700 transition-all",children:a.jsx(YKe,{size:14})})]})]},i.id))}),a.jsxs("div",{className:"lg:col-span-4 space-y-8",children:[a.jsx(Ft,{title:"Security Manifest",className:"bg-blue-950/5 border-blue-500/20",children:a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"p-4 bg-gray-950 rounded-2xl border border-gray-800 space-y-4",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(uf,{className:"text-blue-400",size:18}),a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] text-white font-black uppercase tracking-widest",children:"OIDC Secure Link"}),a.jsx("p",{className:"text-[10px] text-gray-500 font-mono",children:"TUNNEL: ESTABLISHED"})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(QKe,{className:"text-cyan-400",size:18}),a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] text-white font-black uppercase tracking-widest",children:"Protocol Version"}),a.jsx("p",{className:"text-[10px] text-gray-500 font-mono",children:"OAUTH_2.1_CHALLENGE"})]})]})]})})}),a.jsx(Ft,{title:"Signal Diagnostics",children:a.jsxs("div",{className:"h-64 overflow-y-auto font-mono text-[9px] text-gray-500 space-y-2 custom-scrollbar",children:[a.jsx("p",{className:"text-green-500",children:"> Authenticating with Citi Auth Gate Alpha..."}),a.jsx("p",{className:"text-green-500",children:"> TLS 1.3 Asymmetric Handshake successful."}),a.jsx("p",{children:"> Requesting accounts summary (Scope: accounts_details)..."}),a.jsx("p",{children:"> Received payload for 3 active items."}),a.jsx("p",{className:"text-blue-400",children:"> Sync complete. Signal strength: 98dbm (OPTIMAL)."})]})})]})]})]})},Yur=()=>{const{api:e,accessToken:t,uuid:n,generateNewUuid:r}=gk(),[o,i]=f.useState(!1),[s,l]=f.useState(null),[c,u]=f.useState("PAY_BY_PHONE"),[d,p]=f.useState([]),[h,m]=f.useState(!1),[g,y]=f.useState(""),[x,v]=f.useState(""),[b,w]=f.useState("USD"),[S,C]=f.useState(""),[N,j]=f.useState("PHONE"),[I,_]=f.useState("PAY_BY_PHONE"),[T,P]=f.useState("Proxy payment"),[E,M]=f.useState("Personal Transfer"),[R,$]=f.useState(""),[D,z]=f.useState(!0),[V,B]=f.useState(null),[G,H]=f.useState(null),F=async(X,J)=>{if(!t||!e){l("Not authenticated. Please set the access token.");return}i(!0),l(null),B(null),H(null),r();try{const te=await X();J(te)}catch(te){l(`API Error: ${te.message||"An unknown error occurred."}`)}finally{i(!1)}},W=f.useCallback(()=>{e&&F(()=>e.accountProxyTransfersSourceAccountEligibility(t,n,c),X=>{const J=X;p(J.sourceAccounts||[]),J.sourceAccounts&&J.sourceAccounts.length>0&&y(J.sourceAccounts[0].sourceAccountId)})},[e,t,n,c,r]),U=f.useCallback(()=>{if(!e||!g||!x){l("Please select a source account and enter an amount.");return}h?F(()=>e.adhocAccountProxyTransfersPreprocessWithAddPayee(t,n,{proxyPaymentType:I,sourceAccountId:g,transactionAmount:parseFloat(x),transactionCurrencyCode:b,transferCurrencyIndicator:"SOURCE_CURRENCY",proxyAccountId:S,proxyAccountIdType:N,chargeBearer:"BENEFICIARY",remarks:T,transferPurpose:E,payeeNickName:R,payeeEnrollmentFlag:D}),X=>B(X)):F(()=>e.createAccountProxyTransfersPreprocess(t,n,{proxyPaymentType:I,sourceAccountId:g,transactionAmount:parseFloat(x),transactionCurrencyCode:b,transferCurrencyIndicator:"SOURCE_CURRENCY",proxyAccountId:S,proxyAccountIdType:N,chargeBearer:"BENEFICIARY",remarks:T,transferPurpose:E}),X=>B(X))},[e,t,n,g,x,b,S,N,I,T,E,h,R,D,r]),K=f.useCallback(()=>{if(!e||!(V!=null&&V.controlFlowId)){l("No preprocess data available to confirm.");return}F(()=>e.executeAccountProxyTransfers(t,n,{controlFlowId:V.controlFlowId}),X=>{H(X),B(null)})},[e,t,n,V,r]);return a.jsxs("div",{className:"container",children:[a.jsx("h2",{children:"Account Proxy Transfers"}),a.jsx("p",{children:"Make transfers using identifiers like phone numbers or emails."}),s&&a.jsx("div",{className:"error-message",children:s}),o&&a.jsx("div",{className:"loading-spinner",children:"Loading..."}),a.jsxs("div",{className:"card",children:[a.jsx("h3",{children:"Step 1: Check Source Account Eligibility"}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"eligibility-proxy-type",children:"Proxy Payment Type:"}),a.jsxs("select",{id:"eligibility-proxy-type",value:c,onChange:X=>u(X.target.value),children:[a.jsx("option",{value:"PAY_BY_PHONE",children:"Pay by Phone"}),a.jsx("option",{value:"PAY_BY_EMAIL",children:"Pay by Email"}),a.jsx("option",{value:"PAY_BY_NATIONAL_ID",children:"Pay by National ID"})]})]}),a.jsx("button",{onClick:W,disabled:o,children:"Check Eligibility"}),d.length>0&&a.jsxs("div",{className:"results",children:[a.jsx("h4",{children:"Eligible Source Accounts:"}),a.jsx("pre",{children:JSON.stringify(d,null,2)})]})]}),a.jsxs("div",{className:"card",children:[a.jsx("h3",{children:"Step 2: Initiate and Preprocess Transfer"}),a.jsx("div",{className:"form-group",children:a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:h,onChange:X=>m(X.target.value==="on")}),"Ad-hoc Transfer (with Payee Creation)"]})}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"source-account",children:"Source Account:"}),a.jsxs("select",{id:"source-account",value:g,onChange:X=>y(X.target.value),disabled:d.length===0,children:[a.jsx("option",{value:"",children:"-- Select Source Account --"}),d.map(X=>a.jsxs("option",{value:X.sourceAccountId,children:[X.accountNickName||X.productName," (",X.displaySourceAccountNumber,")"]},X.sourceAccountId))]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"proxy-payment-type",children:"Proxy Payment Type:"}),a.jsxs("select",{id:"proxy-payment-type",value:I,onChange:X=>_(X.target.value),children:[a.jsx("option",{value:"PAY_BY_PHONE",children:"Pay by Phone"}),a.jsx("option",{value:"PAY_BY_EMAIL",children:"Pay by Email"}),a.jsx("option",{value:"PAY_BY_NATIONAL_ID",children:"Pay by National ID"})]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"proxy-id-type",children:"Proxy ID Type:"}),a.jsxs("select",{id:"proxy-id-type",value:N,onChange:X=>j(X.target.value),children:[a.jsx("option",{value:"PHONE",children:"Phone"}),a.jsx("option",{value:"EMAIL",children:"Email"}),a.jsx("option",{value:"NATIONAL_ID",children:"National ID"})]})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"proxy-id",children:"Proxy Identifier (e.g., Phone Number, Email):"}),a.jsx("input",{id:"proxy-id",type:"text",value:S,onChange:X=>C(X.target.value),placeholder:"Enter phone, email, or ID"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"amount",children:"Amount:"}),a.jsx("input",{id:"amount",type:"number",value:x,onChange:X=>v(X.target.value),placeholder:"e.g., 100.00"})]}),a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"currency",children:"Currency:"}),a.jsx("input",{id:"currency",type:"text",value:b,onChange:X=>w(X.target.value),placeholder:"e.g., USD"})]}),h&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"form-group",children:[a.jsx("label",{htmlFor:"payee-nickname",children:"Payee Nickname:"}),a.jsx("input",{id:"payee-nickname",type:"text",value:R,onChange:X=>$(X.target.value),placeholder:"e.g., John Doe"})]}),a.jsx("div",{className:"form-group",children:a.jsxs("label",{children:[a.jsx("input",{type:"checkbox",checked:D,onChange:X=>z(X.target.value==="on")}),"Enroll this Payee"]})})]}),a.jsx("button",{onClick:U,disabled:o||!g||!x||!S,children:"Preprocess Transfer"}),V&&a.jsxs("div",{className:"results",children:[a.jsx("h4",{children:"Preprocess Response:"}),a.jsx("pre",{children:JSON.stringify(V,null,2)})]})]}),a.jsxs("div",{className:"card",children:[a.jsx("h3",{children:"Step 3: Confirm Transfer"}),a.jsx("button",{onClick:K,disabled:o||!(V!=null&&V.controlFlowId),children:"Confirm Transfer"}),G&&a.jsxs("div",{className:"results success-message",children:[a.jsx("h4",{children:"Transfer Confirmed!"}),a.jsx("pre",{children:JSON.stringify(G,null,2)})]})]}),a.jsx("style",{children:` .container { padding: 20px; font-family: Arial, sans-serif; } .card { border: 1px solid #ccc; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } .form-group { margin-bottom: 15px; } label { display: block; margin-bottom: 5px; font-weight: bold; } input[type="text"], input[type="number"], select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } button { background-color: #00529b; color: white; padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-size: 16px; } button:disabled { background-color: #a0a0a0; cursor: not-allowed; } .results { margin-top: 20px; background-color: #f0f0f0; padding: 15px; border-radius: 4px; } .error-message { color: red; background-color: #ffebee; padding: 10px; border-radius: 4px; margin-bottom: 20px; } .success-message { color: green; background-color: #e8f5e9; } .loading-spinner { text-align: center; padding: 20px; font-size: 18px; } `})]})},Z6e=({error:e})=>{if(!e)return null;let t="";return typeof e=="string"?t=e:e&&"details"in e?t=`${e.code}: ${e.details}`:t="An unknown error occurred.",a.jsx(zf,{severity:"error",sx:{mt:2},children:t})},Xur=()=>{const{api:e,accessToken:t,uuid:n,generateNewUuid:r}=rVt(),[o,i]=f.useState(""),[s,l]=f.useState([]),[c,u]=f.useState(null),[d,p]=f.useState(null),[h,m]=f.useState(null),[g,y]=f.useState(""),[x,v]=f.useState(""),[b,w]=f.useState(""),[S,C]=f.useState(""),[N,j]=f.useState(""),[I,_]=f.useState(null),[T,P]=f.useState(null),[E,M]=f.useState(null),[R,$]=f.useState(!1),[D,z]=f.useState(null),V=f.useMemo(()=>(h==null?void 0:h.sourceAccounts)||[],[h]),B=f.useMemo(()=>(h==null?void 0:h.payeeSourceAccountCombinations)||[],[h]),G=B.find(re=>re.payeeId===x),H=f.useCallback(async()=>{var re;if(!e||!t){z("Authentication required.");return}$(!0),z(null),l([]),u(null),p(null);try{const ae=((re=(await e.retrieveMerchantList(t,n,o||void 0)).merchantInformation)==null?void 0:re.flatMap(oe=>oe.merchants))||[];l(ae),r()}catch(ce){z(ce.message||"Failed to retrieve merchant list.")}finally{$(!1)}},[e,t,n,o,r]),F=f.useCallback(async re=>{var ce,ae,oe,ue;if(!e||!t){z("Authentication required.");return}u(re),p(null),$(!0),z(null);try{const fe=await e.retrieveMerchantDetails(t,n,re.merchantNumber);p(fe);const se=await e.retrieveDestinationSourceAccountBillPay(t,n);m(se),_(null),P(null),M(null),w(""),C(""),y(((ae=(ce=se.sourceAccounts)==null?void 0:ce[0])==null?void 0:ae.sourceAccountId)||""),v(((ue=(oe=se.payeeSourceAccountCombinations)==null?void 0:oe[0])==null?void 0:ue.payeeId)||""),r()}catch(fe){z(fe.message||"Failed to retrieve merchant details or eligibility.")}finally{$(!1)}},[e,t,n,r]),W=f.useCallback(async()=>{if(!e||!t||!g||!x||!b||!c){z("Missing required payment fields.");return}$(!0),z(null),P(null);const re={sourceAccountId:g,transactionAmount:Number(b),transferCurrencyIndicator:"USD",payeeId:x,billTypeCode:c.billTypeCode,remarks:N||void 0,customerReferenceNumber:S||void 0,paymentScheduleType:"IMMEDIATE"};try{const ce=await e.createBillPaymentPreprocess(t,n,re);P(ce),_(ce.controlFlowId),r()}catch(ce){z(ce.message||"Payment preprocess failed.")}finally{$(!1)}},[e,t,n,g,x,b,c,N,S,r]),U=f.useCallback(async()=>{if(!e||!t||!I){z("Missing control flow ID for confirmation.");return}$(!0),z(null),M(null);const re={controlFlowId:I};try{const ce=await e.confirmBillPayment(t,n,re);M(ce),_(null),r()}catch(ce){z(ce.message||"Payment confirmation failed.")}finally{$(!1)}},[e,t,n,I,r]),K=()=>a.jsx(p0,{variant:"outlined",sx:{mb:3},children:a.jsxs(h0,{children:[a.jsx(tn,{variant:"h6",gutterBottom:!0,children:"1. Search Merchants"}),a.jsxs(Dn,{display:"flex",gap:2,alignItems:"center",children:[a.jsx(la,{label:"Biller Category Code (Optional)",value:o,onChange:re=>i(re.target.value),fullWidth:!0,size:"small"}),a.jsx(ta,{variant:"contained",onClick:H,disabled:R||!t,startIcon:a.jsx(KSn,{}),children:R?a.jsx(su,{size:24}):"Search"})]}),a.jsx(Z6e,{error:D}),s.length>0&&a.jsxs(Dn,{mt:2,maxHeight:300,overflow:"auto",children:[a.jsxs(tn,{variant:"subtitle1",sx:{mb:1},children:["Found ",s.length," Merchants:"]}),a.jsx(Mv,{dense:!0,children:s.map(re=>a.jsx(ih,{secondaryAction:a.jsx(ta,{size:"small",onClick:()=>F(re),disabled:R,children:"Select"}),sx:{backgroundColor:(c==null?void 0:c.merchantNumber)===re.merchantNumber?"#e0f7fa":"inherit"},children:a.jsx(ah,{primary:re.merchantName,secondary:`Number: ${re.merchantNumber} | Local: ${re.merchantNameLocal||"N/A"}`})},re.merchantNumber))})]})]})}),X=()=>{var re;return c?a.jsx(p0,{variant:"outlined",sx:{mb:3},children:a.jsxs(h0,{children:[a.jsxs(tn,{variant:"h6",gutterBottom:!0,children:["2. Setup Payment for ",c.merchantName]}),R&&a.jsx(su,{size:20,sx:{mb:2}}),d&&a.jsxs(Dn,{mb:2,children:[a.jsx(tn,{variant:"subtitle2",children:"Merchant Details:"}),a.jsx(Mv,{dense:!0,children:(re=d.merchantDetails)==null?void 0:re.map((ce,ae)=>a.jsx(ih,{disablePadding:!0,children:a.jsx(ah,{primary:ce.merchantCustomerRelationshipType,secondary:`Code: ${ce.merchantCustomerRelationshipTypeCode||"N/A"}`})},ae))})]}),a.jsxs(k1,{fullWidth:!0,margin:"normal",size:"small",required:!0,children:[a.jsx(O2,{children:"Source Account"}),a.jsx(S0,{value:g,label:"Source Account",onChange:ce=>y(ce.target.value),disabled:R||V.length===0,children:V.map(ce=>a.jsxs(_d,{value:ce.sourceAccountId,children:[ce.productName," (",ce.displaySourceAccountNumber,") - ",ce.sourceAccountCurrencyCode," (Bal: ",ce.availableBalance,")"]},ce.sourceAccountId))})]}),a.jsxs(k1,{fullWidth:!0,margin:"normal",size:"small",required:!0,children:[a.jsx(O2,{children:"Payee Account"}),a.jsx(S0,{value:x,label:"Payee Account",onChange:ce=>v(ce.target.value),disabled:R||B.length===0,children:B.map(ce=>a.jsxs(_d,{value:ce.payeeId,children:[ce.payeeNickName," (",ce.displayPayeeAccountNumber,") - ",ce.payeeAccountCurrencyCode]},ce.payeeId))})]}),G&&a.jsxs(zf,{severity:"info",sx:{mt:1,mb:2},children:["Payee Name: ",G.payeeName||"N/A"," | Merchant Number: ",G.merchantNumber]}),a.jsx(la,{label:"Payment Amount",type:"number",value:b,onChange:ce=>w(Number(ce.target.value)),fullWidth:!0,margin:"normal",size:"small",required:!0}),a.jsx(la,{label:"Customer Reference Number",value:S,onChange:ce=>C(ce.target.value),fullWidth:!0,margin:"normal",size:"small"}),a.jsx(la,{label:"Remarks (Optional)",value:N,onChange:ce=>j(ce.target.value),fullWidth:!0,margin:"normal",size:"small"}),a.jsx(ta,{variant:"contained",color:"primary",onClick:W,disabled:R||!g||!x||!b||Number(b)<=0,startIcon:a.jsx(WSn,{}),sx:{mt:2},children:R&&!T?a.jsx(su,{size:24}):"Preprocess Payment"})]})}):null},J=()=>{var re,ce,ae,oe;return T?a.jsx(p0,{variant:"outlined",sx:{mb:3},children:a.jsxs(h0,{children:[a.jsx(tn,{variant:"h6",gutterBottom:!0,children:"3. Preprocess Results & Confirmation"}),a.jsxs(zf,{severity:"warning",sx:{mb:2},children:["Control Flow ID: ",a.jsx("strong",{children:T.controlFlowId})]}),a.jsxs(Mv,{dense:!0,children:[a.jsx(ih,{disablePadding:!0,children:a.jsx(ah,{primary:`Debit Amount: ${(re=T.debitDetails)==null?void 0:re.transactionDebitAmount} ${(ce=T.debitDetails)==null?void 0:ce.currencyCode}`})}),a.jsx(ih,{disablePadding:!0,children:a.jsx(ah,{primary:`Credit Amount: ${(ae=T.creditDetails)==null?void 0:ae.transactionCreditAmount} ${(oe=T.creditDetails)==null?void 0:oe.currencyCode}`})}),T.transactionFee!==void 0&&a.jsx(ih,{disablePadding:!0,children:a.jsx(ah,{primary:`Fee: ${T.transactionFee} ${T.feeCurrencyCode}`})}),T.foreignExchangeRate!==void 0&&a.jsx(ih,{disablePadding:!0,children:a.jsx(ah,{primary:`FX Rate: ${T.foreignExchangeRate}`})})]}),a.jsx(ta,{variant:"contained",color:"success",onClick:U,disabled:R||!!E,startIcon:a.jsx(LSn,{}),sx:{mt:2},children:R?a.jsx(su,{size:24}):"Confirm Payment"})]})}):null},te=()=>{var re,ce,ae;return E?a.jsx(p0,{variant:"outlined",sx:{mb:3},children:a.jsxs(h0,{children:[a.jsx(tn,{variant:"h6",color:"success.main",gutterBottom:!0,children:"4. Payment Confirmed Successfully!"}),a.jsxs(zf,{severity:"success",children:["Transaction Reference ID: ",a.jsx("strong",{children:E.transactionReferenceId})]}),a.jsxs(Mv,{dense:!0,sx:{mt:2},children:[a.jsx(ih,{disablePadding:!0,children:a.jsx(ah,{primary:`Source Account: ${(re=E.sourceAccount)==null?void 0:re.displaySourceAccountNumber}`})}),a.jsx(ih,{disablePadding:!0,children:a.jsx(ah,{primary:`Available Balance: ${(ce=E.sourceAccount)==null?void 0:ce.sourceAccountAvailableBalance} ${(ae=E.sourceAccount)==null?void 0:ae.sourceCurrencyCode}`})})]})]})}):null};return a.jsxs(Axe,{maxWidth:"md",sx:{py:4},children:[a.jsx(tn,{variant:"h4",gutterBottom:!0,children:"Citi Bill Payment"}),a.jsx(Sw,{sx:{mb:3}}),a.jsxs(a.Fragment,{children:[K(),X(),J(),te(),a.jsx(Z6e,{error:D})]})]})},e8e={sourceAccountId:"",payeeId:"",transactionAmount:"",transactionCurrencyCode:"",remarks:""},ya={container:{padding:"2rem",fontFamily:"Arial, sans-serif",maxWidth:"800px",margin:"0 auto",border:"1px solid #ccc",borderRadius:"8px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)"},header:{borderBottom:"2px solid #eee",paddingBottom:"1rem",marginBottom:"1.5rem"},form:{display:"flex",flexDirection:"column",gap:"1rem"},formGroup:{display:"flex",flexDirection:"column"},label:{marginBottom:"0.5rem",fontWeight:"bold",color:"#333"},input:{padding:"0.75rem",border:"1px solid #ccc",borderRadius:"4px",fontSize:"1rem"},button:{padding:"0.75rem 1.5rem",border:"none",borderRadius:"4px",backgroundColor:"#004a9e",color:"white",fontSize:"1rem",cursor:"pointer",marginTop:"1rem",transition:"background-color 0.2s"},buttonDisabled:{backgroundColor:"#a0a0a0",cursor:"not-allowed"},error:{color:"#d9534f",backgroundColor:"#f2dede",border:"1px solid #ebccd1",padding:"1rem",borderRadius:"4px",margin:"1rem 0"},infoBox:{backgroundColor:"#f0f8ff",border:"1px solid #b0e0e6",padding:"1rem",borderRadius:"4px",margin:"1.5rem 0"},infoTitle:{fontWeight:"bold",marginBottom:"0.5rem"},infoDetail:{display:"flex",justifyContent:"space-between",padding:"0.25rem 0"},success:{color:"#3c763d",backgroundColor:"#dff0d8",border:"1px solid #d6e9c6",padding:"1rem",borderRadius:"4px",textAlign:"center"}},Qur=()=>{const{api:e,accessToken:t,uuid:n}=gk(),[r,o]=f.useState(null),[i,s]=f.useState(e8e),[l,c]=f.useState(null),[u,d]=f.useState(null),[p,h]=f.useState(!1),[m,g]=f.useState(null);f.useEffect(()=>{(async()=>{if(!e||!t){g("API client or access token not available.");return}h(!0),g(null);try{const C=await e.retrieveDestinationSourceAccountCrossBorderTransfer(t,n);o({sourceAccounts:C.sourceAccounts||[],payees:C.payeeSourceAccountCombinations||[]})}catch(C){const N=JSON.parse(C.message);g(`Failed to fetch eligibility: ${N.details||"Unknown error"}`)}finally{h(!1)}})()},[e,t,n]);const y=S=>{const{name:C,value:N}=S.target;s(j=>({...j,[C]:N}))},x=f.useCallback(async S=>{if(S.preventDefault(),!e||!t){g("API client or access token not available.");return}h(!0),g(null),c(null),d(null);try{const C=await e.createCrossBorderTransferPreprocess(t,n,{sourceAccountId:i.sourceAccountId,payeeId:i.payeeId,transactionAmount:parseFloat(i.transactionAmount),transactionCurrencyCode:i.transactionCurrencyCode,remarks:i.remarks?[{remarks:i.remarks}]:void 0});c(C)}catch(C){const N=JSON.parse(C.message);g(`Pre-process failed: ${N.details||"Please check your input."}`)}finally{h(!1)}},[e,t,n,i]),v=f.useCallback(async()=>{if(!e||!t||!(l!=null&&l.controlFlowId)){g("Cannot confirm: Missing required data.");return}h(!0),g(null);try{const S=await e.confirmCrossBorderTransfer(t,n,{controlFlowId:l.controlFlowId});d(S),c(null)}catch(S){const C=JSON.parse(S.message);g(`Confirmation failed: ${C.details||"An error occurred."}`)}finally{h(!1)}},[e,t,n,l]),b=()=>{s(e8e),c(null),d(null),g(null)},w=()=>{var S,C,N,j;return p&&!r?a.jsx("p",{children:"Loading eligibility data..."}):m&&!l&&!u?a.jsx("div",{style:ya.error,children:m}):r?u?a.jsxs("div",{style:ya.success,children:[a.jsx("h3",{children:"Transfer Successful!"}),a.jsx("p",{children:"Your transaction has been submitted."}),a.jsxs("p",{children:[a.jsx("strong",{children:"Reference ID:"})," ",u.transactionReferenceId]}),a.jsxs("p",{children:[a.jsx("strong",{children:"From Account:"})," ",u.sourceAccountDetails.displaySourceAccountNumber]}),a.jsx("button",{style:ya.button,onClick:b,children:"Start New Cross-Border Transfer"})]}):l?a.jsxs("div",{style:ya.infoBox,children:[a.jsx("h3",{style:ya.infoTitle,children:"Review Your Transfer"}),m&&a.jsx("div",{style:ya.error,children:m}),a.jsxs("div",{style:ya.infoDetail,children:[a.jsx("span",{children:"Debit Amount:"}),a.jsxs("strong",{children:[(S=l.debitDetails)==null?void 0:S.transactionDebitAmount," ",(C=l.debitDetails)==null?void 0:C.currencyCode]})]}),a.jsxs("div",{style:ya.infoDetail,children:[a.jsx("span",{children:"Credit Amount:"}),a.jsxs("strong",{children:[(N=l.creditDetails)==null?void 0:N.transactionCreditAmount," ",(j=l.creditDetails)==null?void 0:j.currencyCode]})]}),l.foreignExchangeRate&&a.jsxs("div",{style:ya.infoDetail,children:[a.jsx("span",{children:"Exchange Rate:"}),a.jsx("strong",{children:l.foreignExchangeRate})]}),l.transactionFee&&a.jsxs("div",{style:ya.infoDetail,children:[a.jsx("span",{children:"Transaction Fee:"}),a.jsxs("strong",{children:[l.transactionFee," ",l.feeCurrencyCode]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"1.5rem"},children:[a.jsx("button",{style:{...ya.button,backgroundColor:"#6c757d"},onClick:()=>c(null),children:"Back"}),a.jsx("button",{style:p?{...ya.button,...ya.buttonDisabled}:ya.button,onClick:v,disabled:p,children:p?"Confirming...":"Confirm Transfer"})]})]}):a.jsxs("form",{onSubmit:x,style:ya.form,children:[a.jsxs("div",{style:ya.formGroup,children:[a.jsx("label",{htmlFor:"sourceAccountId",style:ya.label,children:"From Account"}),a.jsxs("select",{id:"sourceAccountId",name:"sourceAccountId",value:i.sourceAccountId,onChange:y,required:!0,style:ya.input,children:[a.jsx("option",{value:"",disabled:!0,children:"Select a source account"}),r.sourceAccounts.map(I=>a.jsxs("option",{value:I.sourceAccountId,children:[I.productName," - ",I.displaySourceAccountNumber," (",I.availableBalance," ",I.sourceAccountCurrencyCode,")"]},I.sourceAccountId))]})]}),a.jsxs("div",{style:ya.formGroup,children:[a.jsx("label",{htmlFor:"payeeId",style:ya.label,children:"To Payee"}),a.jsxs("select",{id:"payeeId",name:"payeeId",value:i.payeeId,onChange:y,required:!0,style:ya.input,children:[a.jsx("option",{value:"",disabled:!0,children:"Select a payee"}),r.payees.map(I=>a.jsxs("option",{value:I.payeeId,children:[I.payeeNickName," (",I.displayPayeeAccountNumber,")"]},I.payeeId))]})]}),a.jsxs("div",{style:ya.formGroup,children:[a.jsx("label",{htmlFor:"transactionAmount",style:ya.label,children:"Amount"}),a.jsx("input",{type:"number",id:"transactionAmount",name:"transactionAmount",value:i.transactionAmount,onChange:y,placeholder:"e.g., 100.00",required:!0,min:"0.01",step:"0.01",style:ya.input})]}),a.jsxs("div",{style:ya.formGroup,children:[a.jsx("label",{htmlFor:"transactionCurrencyCode",style:ya.label,children:"Currency"}),a.jsx("input",{type:"text",id:"transactionCurrencyCode",name:"transactionCurrencyCode",value:i.transactionCurrencyCode,onChange:y,placeholder:"e.g., EUR",required:!0,maxLength:3,style:ya.input})]}),a.jsxs("div",{style:ya.formGroup,children:[a.jsx("label",{htmlFor:"remarks",style:ya.label,children:"Remarks (Optional)"}),a.jsx("input",{type:"text",id:"remarks",name:"remarks",value:i.remarks,onChange:y,placeholder:"Payment for invoice #123",style:ya.input})]}),a.jsx("button",{type:"submit",style:p?{...ya.button,...ya.buttonDisabled}:ya.button,disabled:p,children:p?"Processing...":"Review Transfer"})]}):a.jsx("p",{children:"No eligibility data found or failed to load."})};return a.jsxs("div",{style:ya.container,children:[a.jsxs("div",{style:ya.header,children:[a.jsx("h2",{children:"Cross-Border Wire Transfer"}),a.jsx("p",{children:"Send money internationally to your saved payees."})]}),w()]})},Jur=f.createContext(void 0),Zur=()=>{const e=f.useContext(Jur);if(!e)throw new Error("useMoneyMovement must be used within a MoneyMovementProvider");return e},edr=({onSelectPayee:e,onAddPayee:t})=>{const{api:n,accessToken:r,uuid:o}=Zur(),[i,s]=f.useState([]),[l,c]=f.useState(null),[u,d]=f.useState(!1),[p,h]=f.useState(null),[m,g]=f.useState(""),[y,x]=f.useState(null),v=f.useCallback(async()=>{if(!(!n||!r)){d(!0),h(null);try{const S=await n.retrievePayeeList(r,o);s(S.payeeList||[])}catch(S){console.error("Error fetching payees:",S),h(S.message||"Failed to fetch payees.")}finally{d(!1)}}},[n,r,o]);f.useEffect(()=>{v()},[v]);const b=async(S,C)=>{if(!(!n||!r)){x(S),d(!0),h(null);try{const N=await n.retrievePayeeDetailsById(r,o,S);c(N),e&&e(C)}catch(N){console.error(`Error fetching details for payee ${S}:`,N),h(N.message||`Failed to fetch details for payee ${S}.`),c(null)}finally{d(!1)}}},w=i.filter(S=>{var C,N;return((C=S.payeeName)==null?void 0:C.toLowerCase().includes(m.toLowerCase()))||((N=S.payeeNickname)==null?void 0:N.toLowerCase().includes(m.toLowerCase()))||S.payeeId.toLowerCase().includes(m.toLowerCase())});return a.jsxs("div",{className:"citibank-payee-management",children:[a.jsx("h2",{children:"Payee Management"}),a.jsxs("div",{className:"payee-controls",children:[a.jsx("input",{type:"text",placeholder:"Search payees...",value:m,onChange:S=>g(S.target.value),className:"search-input"}),a.jsx("button",{onClick:t,className:"add-payee-button",children:"Add New Payee"})]}),u&&a.jsx("p",{children:"Loading payees..."}),p&&a.jsxs("p",{className:"error-message",children:["Error: ",p]}),!u&&!p&&w.length===0&&a.jsx("p",{children:"No payees found."}),!u&&!p&&w.length>0&&a.jsxs("div",{className:"payee-list",children:[a.jsx("h3",{children:"Your Payees"}),a.jsx("ul",{children:w.map(S=>a.jsx("li",{className:`payee-item ${y===S.payeeId?"selected":""}`,onClick:()=>b(S.payeeId,S),children:a.jsxs("div",{className:"payee-info",children:[a.jsx("strong",{children:S.payeeName||S.payeeNickname||"Unnamed Payee"}),a.jsx("br",{}),a.jsxs("small",{children:["Type: ",S.paymentType]}),S.displayAccountNumber&&a.jsxs("small",{children:[" | Account: ",S.displayAccountNumber]})]})},S.payeeId))})]}),l&&a.jsxs("div",{className:"payee-details",children:[a.jsx("h3",{children:"Payee Details"}),a.jsx("pre",{children:JSON.stringify(l,null,2)})]})]})},tdr=()=>{const{api:e,accessToken:t,uuid:n,generateNewUuid:r}=gk(),[o,i]=f.useState([]),[s,l]=f.useState(!1),[c,u]=f.useState(null),[d,p]=f.useState(!1),[h,m]=f.useState(null),g={accountId:"",paymentMethod:"",transactionReferenceId:"",transactionAmount:0,standingInstruction:{standingInstructionStartDate:"",paymentFrequency:"",perpetualFlag:!1,standingInstructionEndDate:""},remarks:""},[y,x]=f.useState(g),[v,b]=f.useState(!1),[w,S]=f.useState(null);f.useMemo(()=>["DAILY","WEEKLY","MONTHLY","QUARTERLY","HALFYEARLY","YEARLY"],[]),f.useMemo(()=>["INTERNAL_DOMESTIC","EXTERNAL_DOMESTIC","BILL_PAYMENT","SEPA","CROSS_BORDER_WIRE","CITI_GLOBAL"],[]);const C=f.useCallback(async()=>{var _,T,P,E;if(!e||!t||!n){u("API client not initialized or access token/UUID missing.");return}l(!0),u(null);try{const M=await e.retrievePaymentInitiationTransactionRepeatingPayments(t,n);i(M.standingInstructions||[])}catch(M){console.error("Failed to fetch standing instructions:",M);const R=((E=(P=(T=(_=M.response)==null?void 0:_.data)==null?void 0:T.errors)==null?void 0:P[0])==null?void 0:E.details)||M.message||"An unknown error occurred while fetching instructions.";u(R)}finally{l(!1)}},[e,t,n]);f.useEffect(()=>{C()},[C]);const N=()=>{m(null),x({...g,transactionReferenceId:crypto.randomUUID(),standingInstruction:{standingInstructionStartDate:"",paymentFrequency:"",perpetualFlag:!1,standingInstructionEndDate:""}}),p(!0)},j=_=>{var T,P,E,M;m(_),x({accountId:_.accountId,paymentMethod:_.paymentMethod,transactionReferenceId:_.transactionReferenceId,transactionAmount:_.transactionAmount,standingInstruction:{standingInstructionStartDate:((T=_.standingInstruction)==null?void 0:T.standingInstructionStartDate)||"",paymentFrequency:((P=_.standingInstruction)==null?void 0:P.paymentFrequency)||"",perpetualFlag:((E=_.standingInstruction)==null?void 0:E.perpetualFlag)||!1,standingInstructionEndDate:((M=_.standingInstruction)==null?void 0:M.standingInstructionEndDate)||""},remarks:_.remarks||""}),p(!0)},I=_=>{S(_),b(!0)};return a.jsxs("div",{className:"p-4",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Manage Standing Instructions"}),c&&a.jsxs("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4",role:"alert",children:[a.jsx("strong",{className:"font-bold",children:"Error!"}),a.jsxs("span",{className:"block sm:inline",children:[" ",c]})]}),a.jsx("button",{onClick:N,className:"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded mb-4",children:"Add New Standing Instruction"}),s&&a.jsx("p",{children:"Loading instructions..."}),!s&&o.length===0&&a.jsx("p",{children:"No standing instructions found."}),!s&&o.length>0&&a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"min-w-full bg-white border border-gray-200 text-black",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"py-2 px-4 border-b text-left",children:"Ref ID"}),a.jsx("th",{className:"py-2 px-4 border-b text-left",children:"Account"}),a.jsx("th",{className:"py-2 px-4 border-b text-right",children:"Amount"}),a.jsx("th",{className:"py-2 px-4 border-b text-left",children:"Freq"}),a.jsx("th",{className:"py-2 px-4 border-b text-left",children:"Actions"})]})}),a.jsx("tbody",{children:o.map(_=>{var T;return a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"py-2 px-4 border-b",children:_.transactionReferenceId}),a.jsx("td",{className:"py-2 px-4 border-b",children:_.accountId}),a.jsx("td",{className:"py-2 px-4 border-b text-right",children:_.transactionAmount.toFixed(2)}),a.jsx("td",{className:"py-2 px-4 border-b",children:((T=_.standingInstruction)==null?void 0:T.paymentFrequency)||"N/A"}),a.jsxs("td",{className:"py-2 px-4 border-b",children:[a.jsx("button",{onClick:()=>j(_),className:"text-blue-600 mr-2",children:"Edit"}),a.jsx("button",{onClick:()=>I(_),className:"text-red-600",children:"Delete"})]})]},_.transactionReferenceId)})})]})})]})};class ndr{constructor(){this.logEntries=[],this.listeners=new Set,this.MAX_LOG_SIZE=50}addLog(t){const n={...t,id:crypto.randomUUID(),timestamp:new Date().toISOString()};this.logEntries.unshift(n),this.logEntries.length>this.MAX_LOG_SIZE&&this.logEntries.pop(),this.notifyListeners()}getLogs(){return[...this.logEntries]}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notifyListeners(){this.listeners.forEach(t=>t(this.getLogs()))}}const t8e=new ndr,rdr=()=>{const[e,t]=f.useState(t8e.getLogs());return f.useEffect(()=>t8e.subscribe(t),[]),e},odr=()=>{const{accessToken:e,uuid:t}=gk(),n=rdr();return a.jsxs("div",{className:"p-6 bg-gray-50 min-h-screen text-black",children:[a.jsx("h2",{className:"text-2xl font-bold mb-4",children:"Developer Tools"}),a.jsxs("div",{className:"bg-white p-4 rounded shadow mb-6",children:[a.jsx("h3",{className:"text-lg font-bold mb-2",children:"Current Context"}),a.jsxs("p",{children:[a.jsx("strong",{children:"Access Token:"})," ",e?`${e.substring(0,10)}...`:"None"]}),a.jsxs("p",{children:[a.jsx("strong",{children:"UUID:"})," ",t]})]}),a.jsxs("div",{className:"bg-white p-4 rounded shadow",children:[a.jsx("h3",{className:"text-lg font-bold mb-2",children:"API Logs"}),a.jsx("div",{className:"overflow-y-auto h-96 border rounded",children:n.map(r=>a.jsxs("div",{className:"border-b p-2 hover:bg-gray-100",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsxs("span",{className:`font-bold ${r.status===200?"text-green-600":"text-red-600"}`,children:[r.method," ",r.status]}),a.jsx("span",{className:"text-sm text-gray-500",children:new Date(r.timestamp).toLocaleTimeString()})]}),a.jsx("div",{className:"text-sm truncate",children:r.path}),a.jsxs("details",{children:[a.jsx("summary",{className:"cursor-pointer text-blue-500 text-sm",children:"View Details"}),a.jsx("pre",{className:"text-xs bg-gray-800 text-white p-2 rounded mt-1 overflow-x-auto",children:JSON.stringify(r.response||r.requestBody,null,2)})]})]},r.id))})]})]})};var idr={};function adr(e){if(Array.isArray(e))return e}function sdr(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function wfe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return s=u.done,u},e:function(u){l=!0,i=u},f:function(){try{s||n.return==null||n.return()}finally{if(l)throw i}}}}function hdr(e,t){if(e){if(typeof e=="string")return n8e(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?n8e(e,t):void 0}}function n8e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};n&&Object.entries(r).forEach(function(o){var i=DB(o,2),s=i[0],l=i[1];return n.style[s]=l})}},{key:"find",value:function(n,r){return n?Array.from(n.querySelectorAll(r)):[]}},{key:"findSingle",value:function(n,r){return n?n.querySelector(r):null}},{key:"setAttributes",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(n){var i=function(l,c){var u,d,p=n!=null&&(u=n.$attrs)!==null&&u!==void 0&&u[l]?[n==null||(d=n.$attrs)===null||d===void 0?void 0:d[l]]:[];return[c].flat().reduce(function(h,m){if(m!=null){var g=jl(m);if(g==="string"||g==="number")h.push(m);else if(g==="object"){var y=Array.isArray(m)?i(l,m):Object.entries(m).map(function(x){var v=DB(x,2),b=v[0],w=v[1];return l==="style"&&(w||w===0)?"".concat(b.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),":").concat(w):w?b:void 0});h=y.length?h.concat(y.filter(function(x){return!!x})):h}}return h},p)};Object.entries(o).forEach(function(s){var l=DB(s,2),c=l[0],u=l[1];if(u!=null){var d=c.match(/^on(.+)/);d?n.addEventListener(d[1].toLowerCase(),u):c==="p-bind"?r.setAttributes(n,u):(u=c==="class"?mW(new Set(i("class",u))).join(" ").trim():c==="style"?i("style",u).join(";").trim():u,(n.$attrs=n.$attrs||{})&&(n.$attrs[c]=u),n.setAttribute(c,u))}})}}},{key:"getAttribute",value:function(n,r){if(n){var o=n.getAttribute(r);return isNaN(o)?o==="true"||o==="false"?o==="true":o:+o}}},{key:"isAttributeEquals",value:function(n,r,o){return n?this.getAttribute(n,r)===o:!1}},{key:"isAttributeNotEquals",value:function(n,r,o){return!this.isAttributeEquals(n,r,o)}},{key:"getHeight",value:function(n){if(n){var r=n.offsetHeight,o=getComputedStyle(n);return r=r-(parseFloat(o.paddingTop)+parseFloat(o.paddingBottom)+parseFloat(o.borderTopWidth)+parseFloat(o.borderBottomWidth)),r}return 0}},{key:"getWidth",value:function(n){if(n){var r=n.offsetWidth,o=getComputedStyle(n);return r=r-(parseFloat(o.paddingLeft)+parseFloat(o.paddingRight)+parseFloat(o.borderLeftWidth)+parseFloat(o.borderRightWidth)),r}return 0}},{key:"alignOverlay",value:function(n,r,o){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;n&&r&&(o==="self"?this.relativePosition(n,r):(i&&(n.style.minWidth=e.getOuterWidth(r)+"px"),this.absolutePosition(n,r)))}},{key:"absolutePosition",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"left";if(n&&r){var i=n.offsetParent?{width:n.offsetWidth,height:n.offsetHeight}:this.getHiddenElementDimensions(n),s=i.height,l=i.width,c=r.offsetHeight,u=r.offsetWidth,d=r.getBoundingClientRect(),p=this.getWindowScrollTop(),h=this.getWindowScrollLeft(),m=this.getViewport(),g,y;d.top+c+s>m.height?(g=d.top+p-s,g<0&&(g=p),n.style.transformOrigin="bottom"):(g=c+d.top+p,n.style.transformOrigin="top");var x=d.left;o==="left"?x+l>m.width?y=Math.max(0,x+h+u-l):y=x+h:x+u-l<0?y=h:y=x+u-l+h,n.style.top=g+"px",n.style.left=y+"px"}}},{key:"relativePosition",value:function(n,r){if(n&&r){var o=n.offsetParent?{width:n.offsetWidth,height:n.offsetHeight}:this.getHiddenElementDimensions(n),i=r.offsetHeight,s=r.getBoundingClientRect(),l=this.getViewport(),c,u;s.top+i+o.height>l.height?(c=-1*o.height,s.top+c<0&&(c=-1*s.top),n.style.transformOrigin="bottom"):(c=i,n.style.transformOrigin="top"),o.width>l.width?u=s.left*-1:s.left+o.width>l.width?u=(s.left+o.width-l.width)*-1:u=0,n.style.top=c+"px",n.style.left=u+"px"}}},{key:"flipfitCollision",value:function(n,r){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"left top",s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"left bottom",l=arguments.length>4?arguments[4]:void 0;if(n&&r){var c=r.getBoundingClientRect(),u=this.getViewport(),d=i.split(" "),p=s.split(" "),h=function(v,b){return b?+v.substring(v.search(/(\+|-)/g))||0:v.substring(0,v.search(/(\+|-)/g))||v},m={my:{x:h(d[0]),y:h(d[1]||d[0]),offsetX:h(d[0],!0),offsetY:h(d[1]||d[0],!0)},at:{x:h(p[0]),y:h(p[1]||p[0]),offsetX:h(p[0],!0),offsetY:h(p[1]||p[0],!0)}},g={left:function(){var v=m.my.offsetX+m.at.offsetX;return v+c.left+(m.my.x==="left"?0:-1*(m.my.x==="center"?o.getOuterWidth(n)/2:o.getOuterWidth(n)))},top:function(){var v=m.my.offsetY+m.at.offsetY;return v+c.top+(m.my.y==="top"?0:-1*(m.my.y==="center"?o.getOuterHeight(n)/2:o.getOuterHeight(n)))}},y={count:{x:0,y:0},left:function(){var v=g.left(),b=e.getWindowScrollLeft();n.style.left=v+b+"px",this.count.x===2?(n.style.left=b+"px",this.count.x=0):v<0&&(this.count.x++,m.my.x="left",m.at.x="right",m.my.offsetX*=-1,m.at.offsetX*=-1,this.right())},right:function(){var v=g.left()+e.getOuterWidth(r),b=e.getWindowScrollLeft();n.style.left=v+b+"px",this.count.x===2?(n.style.left=u.width-e.getOuterWidth(n)+b+"px",this.count.x=0):v+e.getOuterWidth(n)>u.width&&(this.count.x++,m.my.x="right",m.at.x="left",m.my.offsetX*=-1,m.at.offsetX*=-1,this.left())},top:function(){var v=g.top(),b=e.getWindowScrollTop();n.style.top=v+b+"px",this.count.y===2?(n.style.left=b+"px",this.count.y=0):v<0&&(this.count.y++,m.my.y="top",m.at.y="bottom",m.my.offsetY*=-1,m.at.offsetY*=-1,this.bottom())},bottom:function(){var v=g.top()+e.getOuterHeight(r),b=e.getWindowScrollTop();n.style.top=v+b+"px",this.count.y===2?(n.style.left=u.height-e.getOuterHeight(n)+b+"px",this.count.y=0):v+e.getOuterHeight(r)>u.height&&(this.count.y++,m.my.y="bottom",m.at.y="top",m.my.offsetY*=-1,m.at.offsetY*=-1,this.top())},center:function(v){if(v==="y"){var b=g.top()+e.getOuterHeight(r)/2;n.style.top=b+e.getWindowScrollTop()+"px",b<0?this.bottom():b+e.getOuterHeight(r)>u.height&&this.top()}else{var w=g.left()+e.getOuterWidth(r)/2;n.style.left=w+e.getWindowScrollLeft()+"px",w<0?this.left():w+e.getOuterWidth(n)>u.width&&this.right()}}};y[m.at.x]("x"),y[m.at.y]("y"),this.isFunction(l)&&l(m)}}},{key:"findCollisionPosition",value:function(n){if(n){var r=n==="top"||n==="bottom",o=n==="left"?"right":"left",i=n==="top"?"bottom":"top";return r?{axis:"y",my:"center ".concat(i),at:"center ".concat(n)}:{axis:"x",my:"".concat(o," center"),at:"".concat(n," center")}}}},{key:"getParents",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return n.parentNode===null?r:this.getParents(n.parentNode,r.concat([n.parentNode]))}},{key:"getScrollableParents",value:function(n){var r=this,o=[];if(n){var i=this.getParents(n),s=/(auto|scroll)/,l=function(S){var C=S?getComputedStyle(S):null;return C&&(s.test(C.getPropertyValue("overflow"))||s.test(C.getPropertyValue("overflow-x"))||s.test(C.getPropertyValue("overflow-y")))},c=function(S){o.push(S.nodeName==="BODY"||S.nodeName==="HTML"||r.isDocument(S)?window:S)},u=Cne(i),d;try{for(u.s();!(d=u.n()).done;){var p,h=d.value,m=h.nodeType===1&&((p=h.dataset)===null||p===void 0?void 0:p.scrollselectors);if(m){var g=m.split(","),y=Cne(g),x;try{for(y.s();!(x=y.n()).done;){var v=x.value,b=this.findSingle(h,v);b&&l(b)&&c(b)}}catch(w){y.e(w)}finally{y.f()}}h.nodeType===1&&l(h)&&c(h)}}catch(w){u.e(w)}finally{u.f()}}return o}},{key:"getHiddenElementOuterHeight",value:function(n){if(n){n.style.visibility="hidden",n.style.display="block";var r=n.offsetHeight;return n.style.display="none",n.style.visibility="visible",r}return 0}},{key:"getHiddenElementOuterWidth",value:function(n){if(n){n.style.visibility="hidden",n.style.display="block";var r=n.offsetWidth;return n.style.display="none",n.style.visibility="visible",r}return 0}},{key:"getHiddenElementDimensions",value:function(n){var r={};return n&&(n.style.visibility="hidden",n.style.display="block",r.width=n.offsetWidth,r.height=n.offsetHeight,n.style.display="none",n.style.visibility="visible"),r}},{key:"fadeIn",value:function(n,r){if(n){n.style.opacity=0;var o=+new Date,i=0,s=function(){i=+n.style.opacity+(new Date().getTime()-o)/r,n.style.opacity=i,o=+new Date,+i<1&&(window.requestAnimationFrame&&requestAnimationFrame(s)||setTimeout(s,16))};s()}}},{key:"fadeOut",value:function(n,r){if(n)var o=1,i=50,s=i/r,l=setInterval(function(){o=o-s,o<=0&&(o=0,clearInterval(l)),n.style.opacity=o},i)}},{key:"getUserAgent",value:function(){return navigator.userAgent}},{key:"isIOS",value:function(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}},{key:"isAndroid",value:function(){return/(android)/i.test(navigator.userAgent)}},{key:"isChrome",value:function(){return/(chrome)/i.test(navigator.userAgent)}},{key:"isClient",value:function(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}},{key:"isFunction",value:function(n){return!!(n&&n.constructor&&n.call&&n.apply)}},{key:"appendChild",value:function(n,r){if(this.isElement(r))r.appendChild(n);else if(r.el&&r.el.nativeElement)r.el.nativeElement.appendChild(n);else throw new Error("Cannot append "+r+" to "+n)}},{key:"removeChild",value:function(n,r){if(this.isElement(r))r.removeChild(n);else if(r.el&&r.el.nativeElement)r.el.nativeElement.removeChild(n);else throw new Error("Cannot remove "+n+" from "+r)}},{key:"isElement",value:function(n){return(typeof HTMLElement>"u"?"undefined":jl(HTMLElement))==="object"?n instanceof HTMLElement:n&&jl(n)==="object"&&n!==null&&n.nodeType===1&&typeof n.nodeName=="string"}},{key:"isDocument",value:function(n){return(typeof Document>"u"?"undefined":jl(Document))==="object"?n instanceof Document:n&&jl(n)==="object"&&n!==null&&n.nodeType===9}},{key:"scrollInView",value:function(n,r){var o=getComputedStyle(n).getPropertyValue("border-top-width"),i=o?parseFloat(o):0,s=getComputedStyle(n).getPropertyValue("padding-top"),l=s?parseFloat(s):0,c=n.getBoundingClientRect(),u=r.getBoundingClientRect(),d=u.top+document.body.scrollTop-(c.top+document.body.scrollTop)-i-l,p=n.scrollTop,h=n.clientHeight,m=this.getOuterHeight(r);d<0?n.scrollTop=p+d:d+m>h&&(n.scrollTop=p+d-h+m)}},{key:"clearSelection",value:function(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch{}}},{key:"calculateScrollbarWidth",value:function(n){if(n){var r=getComputedStyle(n);return n.offsetWidth-n.clientWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.borderRightWidth)}if(this.calculatedScrollbarWidth!=null)return this.calculatedScrollbarWidth;var o=document.createElement("div");o.className="p-scrollbar-measure",document.body.appendChild(o);var i=o.offsetWidth-o.clientWidth;return document.body.removeChild(o),this.calculatedScrollbarWidth=i,i}},{key:"calculateBodyScrollbarWidth",value:function(){return window.innerWidth-document.documentElement.offsetWidth}},{key:"getBrowser",value:function(){if(!this.browser){var n=this.resolveUserAgent();this.browser={},n.browser&&(this.browser[n.browser]=!0,this.browser.version=n.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser}},{key:"resolveUserAgent",value:function(){var n=navigator.userAgent.toLowerCase(),r=/(chrome)[ ]([\w.]+)/.exec(n)||/(webkit)[ ]([\w.]+)/.exec(n)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(n)||/(msie) ([\w.]+)/.exec(n)||n.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(n)||[];return{browser:r[1]||"",version:r[2]||"0"}}},{key:"blockBodyScroll",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"p-overflow-hidden",r=!!document.body.style.getPropertyValue("--scrollbar-width");!r&&document.body.style.setProperty("--scrollbar-width",this.calculateBodyScrollbarWidth()+"px"),this.addClass(document.body,n)}},{key:"unblockBodyScroll",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"p-overflow-hidden";document.body.style.removeProperty("--scrollbar-width"),this.removeClass(document.body,n)}},{key:"isVisible",value:function(n){return n&&(n.clientHeight!==0||n.getClientRects().length!==0||getComputedStyle(n).display!=="none")}},{key:"isExist",value:function(n){return!!(n!==null&&typeof n<"u"&&n.nodeName&&n.parentNode)}},{key:"getFocusableElements",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",o=e.find(n,'button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])'.concat(r,`, [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(r,`, input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(r,`, select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(r,`, textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(r,`, [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(r,`, [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])`).concat(r)),i=[],s=Cne(o),l;try{for(s.s();!(l=s.n()).done;){var c=l.value;getComputedStyle(c).display!=="none"&&getComputedStyle(c).visibility!=="hidden"&&i.push(c)}}catch(u){s.e(u)}finally{s.f()}return i}},{key:"getFirstFocusableElement",value:function(n,r){var o=e.getFocusableElements(n,r);return o.length>0?o[0]:null}},{key:"getLastFocusableElement",value:function(n,r){var o=e.getFocusableElements(n,r);return o.length>0?o[o.length-1]:null}},{key:"focus",value:function(n,r){var o=r===void 0?!0:!r;n&&document.activeElement!==n&&n.focus({preventScroll:o})}},{key:"focusFirstElement",value:function(n,r){if(n){var o=e.getFirstFocusableElement(n);return o&&e.focus(o,r),o}}},{key:"getCursorOffset",value:function(n,r,o,i){if(n){var s=getComputedStyle(n),l=document.createElement("div");l.style.position="absolute",l.style.top="0px",l.style.left="0px",l.style.visibility="hidden",l.style.pointerEvents="none",l.style.overflow=s.overflow,l.style.width=s.width,l.style.height=s.height,l.style.padding=s.padding,l.style.border=s.border,l.style.overflowWrap=s.overflowWrap,l.style.whiteSpace=s.whiteSpace,l.style.lineHeight=s.lineHeight,l.innerHTML=r.replace(/\r\n|\r|\n/g,"
");var c=document.createElement("span");c.textContent=i,l.appendChild(c);var u=document.createTextNode(o);l.appendChild(u),document.body.appendChild(l);var d=c.offsetLeft,p=c.offsetTop,h=c.clientHeight;return document.body.removeChild(l),{left:Math.abs(d-n.scrollLeft),top:Math.abs(p-n.scrollTop)+h}}return{top:"auto",left:"auto"}}},{key:"invokeElementMethod",value:function(n,r,o){n[r].apply(n,o)}},{key:"isClickable",value:function(n){var r=n.nodeName,o=n.parentElement&&n.parentElement.nodeName;return r==="INPUT"||r==="TEXTAREA"||r==="BUTTON"||r==="A"||o==="INPUT"||o==="TEXTAREA"||o==="BUTTON"||o==="A"||this.hasClass(n,"p-button")||this.hasClass(n.parentElement,"p-button")||this.hasClass(n.parentElement,"p-checkbox")||this.hasClass(n.parentElement,"p-radiobutton")}},{key:"applyStyle",value:function(n,r){if(typeof r=="string")n.style.cssText=r;else for(var o in r)n.style[o]=r[o]}},{key:"exportCSV",value:function(n,r){var o=new Blob([n],{type:"application/csv;charset=utf-8;"});if(window.navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(o,r+".csv");else{var i=e.saveAs({name:r+".csv",src:URL.createObjectURL(o)});i||(n="data:text/csv;charset=utf-8,"+n,window.open(encodeURI(n)))}}},{key:"saveAs",value:function(n){if(n){var r=document.createElement("a");if(r.download!==void 0){var o=n.name,i=n.src;return r.setAttribute("href",i),r.setAttribute("download",o),r.style.display="none",document.body.appendChild(r),r.click(),document.body.removeChild(r),!0}}return!1}},{key:"createInlineStyle",value:function(n,r){var o=document.createElement("style");return e.addNonce(o,n),r||(r=document.head),r.appendChild(o),o}},{key:"removeInlineStyle",value:function(n){if(this.isExist(n)){try{n.parentNode.removeChild(n)}catch{}n=null}return n}},{key:"addNonce",value:function(n,r){try{r||(r=idr.REACT_APP_CSS_NONCE)}catch{}r&&n.setAttribute("nonce",r)}},{key:"getTargetElement",value:function(n){if(!n)return null;if(n==="document")return document;if(n==="window")return window;if(jl(n)==="object"&&n.hasOwnProperty("current"))return this.isExist(n.current)?n.current:null;var r=function(s){return!!(s&&s.constructor&&s.call&&s.apply)},o=r(n)?n():n;return this.isDocument(o)||this.isExist(o)?o:null}},{key:"getAttributeNames",value:function(n){var r,o,i;for(o=[],i=n.attributes,r=0;r0}return!1}},{key:"hasCSSTransition",value:function(n){if(n){var r=getComputedStyle(n),o=parseFloat(r.getPropertyValue("transition-duration")||"0");return o>0}return!1}}])})();gY(Lt,"DATA_PROPS",["data-"]);gY(Lt,"ARIA_PROPS",["aria","focus-target"]);function mdr(){var e=new Map;return{on:function(n,r){var o=e.get(n);o?o.push(r):o=[r],e.set(n,o)},off:function(n,r){var o=e.get(n);o&&o.splice(o.indexOf(r)>>>0,1)},emit:function(n,r){var o=e.get(n);o&&o.slice().forEach(function(i){return i(r)})}}}function Sfe(){return Sfe=Object.assign?Object.assign.bind():function(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return s=u.done,u},e:function(u){l=!0,i=u},f:function(){try{s||n.return==null||n.return()}finally{if(l)throw i}}}}function gdr(e,t){if(e){if(typeof e=="string")return o8e(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o8e(e,t):void 0}}function o8e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=n.length&&(o=o%n.length,r=r%n.length),n.splice(o,0,n.splice(r,1)[0]))}},{key:"findIndexInList",value:function(n,r,o){var i=this;return r?o?r.findIndex(function(s){return i.equals(s,n,o)}):r.findIndex(function(s){return s===n}):-1}},{key:"getJSXElement",value:function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i1?r-1:0),i=1;i1&&arguments[1]!==void 0?arguments[1]:"",o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=n?n[r]:void 0;return i===void 0?o[r]:i}},{key:"getPropCaseInsensitive",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=this.toFlatCase(r);for(var s in n)if(n.hasOwnProperty(s)&&this.toFlatCase(s)===i)return n[s];for(var l in o)if(o.hasOwnProperty(l)&&this.toFlatCase(l)===i)return o[l]}},{key:"getMergedProps",value:function(n,r){return Object.assign({},r,n)}},{key:"getDiffProps",value:function(n,r){return this.findDiffKeys(n,r)}},{key:"getPropValue",value:function(n){if(!this.isFunction(n))return n;for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i1&&arguments[1]!==void 0?arguments[1]:"",o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.isNotEmpty(n)?this.getProp(n.props,r,o):void 0}},{key:"getComponentProps",value:function(n,r){return this.isNotEmpty(n)?this.getMergedProps(n.props,r):void 0}},{key:"getComponentDiffProps",value:function(n,r){return this.isNotEmpty(n)?this.getDiffProps(n.props,r):void 0}},{key:"isValidChild",value:function(n,r,o){if(n){var i,s=this.getComponentProp(n,"__TYPE")||(n.type?n.type.displayName:void 0);!s&&n!==null&&n!==void 0&&(i=n.type)!==null&&i!==void 0&&(i=i._payload)!==null&&i!==void 0&&i.value&&(s=n.type._payload.value.find(function(u){return u===r}));var l=s===r;try{var c}catch{}return l}return!1}},{key:"getRefElement",value:function(n){return n?jl(n)==="object"&&n.hasOwnProperty("current")?n.current:n:null}},{key:"combinedRefs",value:function(n,r){n&&r&&(typeof r=="function"?r(n.current):r.current=n.current)}},{key:"removeAccents",value:function(n){return n&&n.search(/[\xC0-\xFF]/g)>-1&&(n=n.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),n}},{key:"toFlatCase",value:function(n){return this.isNotEmpty(n)&&this.isString(n)?n.replace(/(-|_)/g,"").toLowerCase():n}},{key:"toCapitalCase",value:function(n){return this.isNotEmpty(n)&&this.isString(n)?n[0].toUpperCase()+n.slice(1):n}},{key:"trim",value:function(n){return this.isNotEmpty(n)&&this.isString(n)?n.trim():n}},{key:"isEmpty",value:function(n){return n==null||n===""||Array.isArray(n)&&n.length===0||!(n instanceof Date)&&jl(n)==="object"&&Object.keys(n).length===0}},{key:"isNotEmpty",value:function(n){return!this.isEmpty(n)}},{key:"isFunction",value:function(n){return!!(n&&n.constructor&&n.call&&n.apply)}},{key:"isObject",value:function(n){return n!==null&&n instanceof Object&&n.constructor===Object}},{key:"isDate",value:function(n){return n!==null&&n instanceof Date&&n.constructor===Date}},{key:"isArray",value:function(n){return n!==null&&Array.isArray(n)}},{key:"isString",value:function(n){return n!==null&&typeof n=="string"}},{key:"isPrintableCharacter",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return this.isNotEmpty(n)&&n.length===1&&n.match(/\S| /)}},{key:"isLetter",value:function(n){return/^[a-zA-Z\u00C0-\u017F]$/.test(n)}},{key:"isScalar",value:function(n){return n!=null&&(typeof n=="string"||typeof n=="number"||typeof n=="bigint"||typeof n=="boolean")}},{key:"findLast",value:function(n,r){var o;if(this.isNotEmpty(n))try{o=n.findLast(r)}catch{o=mW(n).reverse().find(r)}return o}},{key:"findLastIndex",value:function(n,r){var o=-1;if(this.isNotEmpty(n))try{o=n.findLastIndex(r)}catch{o=n.lastIndexOf(mW(n).reverse().find(r))}return o}},{key:"sort",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1,l=this.compare(n,r,i,o),c=o;return(this.isEmpty(n)||this.isEmpty(r))&&(c=s===1?o:s),c*l}},{key:"compare",value:function(n,r,o){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,s=-1,l=this.isEmpty(n),c=this.isEmpty(r);return l&&c?s=0:l?s=i:c?s=-i:typeof n=="string"&&typeof r=="string"?s=o(n,r):s=nr?1:0,s}},{key:"localeComparator",value:function(n){return new Intl.Collator(n,{numeric:!0}).compare}},{key:"findChildrenByKey",value:function(n,r){var o=r8e(n),i;try{for(o.s();!(i=o.n()).done;){var s=i.value;if(s.key===r)return s.children||[];if(s.children){var l=this.findChildrenByKey(s.children,r);if(l.length>0)return l}}}catch(c){o.e(c)}finally{o.f()}return[]}},{key:"mutateFieldData",value:function(n,r,o){if(!(jl(n)!=="object"||typeof r!="string"))for(var i=r.split("."),s=n,l=0,c=i.length;l2&&arguments[2]!==void 0?arguments[2]:1,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(!n||!r||i>o)return!0;if(jl(n)!==jl(r))return!1;var s=Object.keys(n),l=Object.keys(r);if(s.length!==l.length)return!1;for(var c=0,u=s;c3&&arguments[3]!==void 0?arguments[3]:1;if(n===r)return!0;if(!n||!r||jl(n)!=="object"||jl(r)!=="object")return!1;if(!o)return this.absoluteCompare(n,r,1);var s=r8e(o),l;try{for(s.s();!(l=s.n()).done;){var c=l.value,u=this.getNestedValue(n,c),d=this.getNestedValue(r,c),p=jl(u)==="object"&&u!==null&&jl(d)==="object"&&d!==null;if(p&&!this.absoluteCompare(u,d,i)||!p&&u!==d)return!1}}catch(h){s.e(h)}finally{s.f()}return!0}}])})(),i8e=0;function xY(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"pr_id_";return i8e++,"".concat(e).concat(i8e)}function a8e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function xdr(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=null;if(n!==null){var s=jl(n),l=wr(r.className,s==="string"&&n);if(i=f.createElement("span",Sfe({},r,{className:l,key:xY("icon")})),s!=="string"){var c=xdr({iconProps:r,element:i},o);return Nt.getJSXElement(n,c)}}return i}}])})();function s8e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function l8e(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(e){var n=function(s){return typeof s=="function"},r=t.classNameMergeFunction,o=n(r);return e.reduce(function(i,s){if(!s)return i;var l=function(){var d=s[c];if(c==="style")i.style=l8e(l8e({},i.style),s.style);else if(c==="className"){var p="";o?p=r(i.className,s.className):p=[i.className,s.className].join(" ").trim(),i.className=p||void 0}else if(n(d)){var h=i[c];i[c]=h?function(){h.apply(void 0,arguments),d.apply(void 0,arguments)}:d}else i[c]=d};for(var c in s)l();return i},{})}}function ydr(){var e=[],t=function(l,c){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:999,d=o(l,c,u),p=d.value+(d.key===l?0:u)+1;return e.push({key:l,value:p}),p},n=function(l){e=e.filter(function(c){return c.value!==l})},r=function(l,c){return o(l,c).value},o=function(l,c){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return mW(e).reverse().find(function(d){return c?!0:d.key===l})||{key:l,value:u}},i=function(l){return l&&parseInt(l.style.zIndex,10)||0};return{get:i,set:function(l,c,u,d){c&&(c.style.zIndex=String(t(l,u,d)))},clear:function(l){l&&(n(Qx.get(l)),l.style.zIndex="")},getCurrent:function(l,c){return r(l,c)}}}var Qx=ydr(),_u=Object.freeze({STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",IN:"in",NOT_IN:"notIn",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",BETWEEN:"between",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter",CUSTOM:"custom"}),UO=Object.freeze({AND:"and",OR:"or"});function c8e(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=vdr(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return s=u.done,u},e:function(u){l=!0,i=u},f:function(){try{s||n.return==null||n.return()}finally{if(l)throw i}}}}function vdr(e,t){if(e){if(typeof e=="string")return u8e(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u8e(e,t):void 0}}function u8e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);nn.getTime():t>n},gte:function(t,n){return n==null?!0:t==null?!1:t.getTime&&n.getTime?t.getTime()>=n.getTime():t>=n},dateIs:function(t,n){return n==null?!0:t==null?!1:t.toDateString()===n.toDateString()},dateIsNot:function(t,n){return n==null?!0:t==null?!1:t.toDateString()!==n.toDateString()},dateBefore:function(t,n){return n==null?!0:t==null?!1:t.getTime()n.getTime()}},register:function(t,n){this.filters[t]=n}};function nD(e){"@babel/helpers - typeof";return nD=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nD(e)}function bdr(e,t){if(nD(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nD(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wdr(e){var t=bdr(e,"string");return nD(t)=="symbol"?t:t+""}function vg(e,t,n){return(t=wdr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sdr(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function Cdr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Qf=Sdr(function e(){Cdr(this,e)});vg(Qf,"ripple",!1);vg(Qf,"inputStyle","outlined");vg(Qf,"locale","en");vg(Qf,"appendTo",null);vg(Qf,"cssTransition",!0);vg(Qf,"autoZIndex",!0);vg(Qf,"hideOverlaysOnDocumentScrolling",!1);vg(Qf,"nonce",null);vg(Qf,"nullSortOrder",1);vg(Qf,"zIndex",{modal:1100,overlay:1e3,menu:1e3,tooltip:1100,toast:1200});vg(Qf,"pt",void 0);vg(Qf,"filterMatchModeOptions",{text:[_u.STARTS_WITH,_u.CONTAINS,_u.NOT_CONTAINS,_u.ENDS_WITH,_u.EQUALS,_u.NOT_EQUALS],numeric:[_u.EQUALS,_u.NOT_EQUALS,_u.LESS_THAN,_u.LESS_THAN_OR_EQUAL_TO,_u.GREATER_THAN,_u.GREATER_THAN_OR_EQUAL_TO],date:[_u.DATE_IS,_u.DATE_IS_NOT,_u.DATE_BEFORE,_u.DATE_AFTER]});vg(Qf,"changeTheme",function(e,t,n,r){var o,i=document.getElementById(n);if(!i)throw Error("Element with id ".concat(n," not found."));var s=i.getAttribute("href").replace(e,t),l=document.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("id",n),l.setAttribute("href",s),l.addEventListener("load",function(){r&&r()}),(o=i.parentNode)===null||o===void 0||o.replaceChild(l,i)});var Ndr={en:{accept:"Yes",addRule:"Add Rule",am:"AM",apply:"Apply",cancel:"Cancel",choose:"Choose",chooseDate:"Choose Date",chooseMonth:"Choose Month",chooseYear:"Choose Year",clear:"Clear",completed:"Completed",contains:"Contains",custom:"Custom",dateAfter:"Date is after",dateBefore:"Date is before",dateFormat:"mm/dd/yy",dateIs:"Date is",dateIsNot:"Date is not",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],emptyFilterMessage:"No results found",emptyMessage:"No available options",emptySearchMessage:"No results found",emptySelectionMessage:"No selected item",endsWith:"Ends with",equals:"Equals",fileChosenMessage:"{0} files",fileSizeTypes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"],filter:"Filter",firstDayOfWeek:0,gt:"Greater than",gte:"Greater than or equal to",lt:"Less than",lte:"Less than or equal to",matchAll:"Match All",matchAny:"Match Any",medium:"Medium",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],nextDecade:"Next Decade",nextHour:"Next Hour",nextMinute:"Next Minute",nextMonth:"Next Month",nextSecond:"Next Second",nextYear:"Next Year",noFileChosenMessage:"No file chosen",noFilter:"No Filter",notContains:"Not contains",notEquals:"Not equals",now:"Now",passwordPrompt:"Enter a password",pending:"Pending",pm:"PM",prevDecade:"Previous Decade",prevHour:"Previous Hour",prevMinute:"Previous Minute",prevMonth:"Previous Month",prevSecond:"Previous Second",prevYear:"Previous Year",reject:"No",removeRule:"Remove Rule",searchMessage:"{0} results are available",selectionMessage:"{0} items selected",showMonthAfterYear:!1,startsWith:"Starts with",strong:"Strong",today:"Today",upload:"Upload",weak:"Weak",weekHeader:"Wk",aria:{cancelEdit:"Cancel Edit",close:"Close",collapseLabel:"Collapse",collapseRow:"Row Collapsed",editRow:"Edit Row",expandLabel:"Expand",expandRow:"Row Expanded",falseLabel:"False",filterConstraint:"Filter Constraint",filterOperator:"Filter Operator",firstPageLabel:"First Page",gridView:"Grid View",hideFilterMenu:"Hide Filter Menu",jumpToPageDropdownLabel:"Jump to Page Dropdown",jumpToPageInputLabel:"Jump to Page Input",lastPageLabel:"Last Page",listLabel:"Option List",listView:"List View",moveAllToSource:"Move All to Source",moveAllToTarget:"Move All to Target",moveBottom:"Move Bottom",moveDown:"Move Down",moveToSource:"Move to Source",moveToTarget:"Move to Target",moveTop:"Move Top",moveUp:"Move Up",navigation:"Navigation",next:"Next",nextPageLabel:"Next Page",nullLabel:"Not Selected",otpLabel:"Please enter one time password character {0}",pageLabel:"Page {page}",passwordHide:"Hide Password",passwordShow:"Show Password",previous:"Previous",prevPageLabel:"Previous Page",removeLabel:"Remove",rotateLeft:"Rotate Left",rotateRight:"Rotate Right",rowsPerPageLabel:"Rows per page",saveEdit:"Save Edit",scrollTop:"Scroll Top",selectAll:"All items selected",selectLabel:"Select",selectRow:"Row Selected",showFilterMenu:"Show Filter Menu",slide:"Slide",slideNumber:"{slideNumber}",star:"1 star",stars:"{star} stars",trueLabel:"True",unselectAll:"All items unselected",unselectLabel:"Unselect",unselectRow:"Row Unselected",zoomImage:"Zoom Image",zoomIn:"Zoom In",zoomOut:"Zoom Out"}}};function Zh(e,t){if(e.includes("__proto__")||e.includes("prototype"))throw new Error("Unsafe key detected");var n=Qf.locale;try{return zht(n)[e]}catch{throw new Error("The ".concat(e," option is not found in the current locale('").concat(n,"')."))}}function Df(e,t){if(e.includes("__proto__")||e.includes("prototype"))throw new Error("Unsafe ariaKey detected");var n=Qf.locale;try{var r=zht(n).aria[e];if(r)for(var o in t)t.hasOwnProperty(o)&&(r=r.replace("{".concat(o,"}"),t[o]));return r}catch{throw new Error("The ".concat(e," option is not found in the current locale('").concat(n,"')."))}}function zht(e){var t=e||Qf.locale;if(t.includes("__proto__")||t.includes("prototype"))throw new Error("Unsafe locale detected");return Ndr[t]}var es=Ie.createContext(),ca=Qf;function jdr(e){if(Array.isArray(e))return e}function Edr(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function Cfe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&arguments[0]!==void 0?arguments[0]:{},w=b.target;Nt.isNotEmpty(w)&&(g(),(b.when||c)&&(u.current=Lt.getTargetElement(w))),!d.current&&u.current&&(d.current=function(S){return i&&i(S)},u.current.addEventListener(o,d.current,s))},g=function(){d.current&&(u.current.removeEventListener(o,d.current,s),d.current=null)},y=function(){g(),p=null,h=null},x=f.useCallback(function(){c?u.current=Lt.getTargetElement(r):(g(),u.current=null)},[r,c]);return f.useEffect(function(){x()},[x]),f.useEffect(function(){var v="".concat(p)!=="".concat(i),b=h!==s,w=d.current;w&&(v||b)?(g(),c&&m()):w||y()},[i,s,c]),Nm(function(){y()}),[m,g]},_dr=function(t,n){var r=f.useState(t),o=$v(r,2),i=o[0],s=o[1],l=f.useState(t),c=$v(l,2),u=c[0],d=c[1],p=f.useRef(!1),h=f.useRef(null),m=function(){return window.clearTimeout(h.current)};return bg(function(){p.current=!0}),Nm(function(){m()}),f.useEffect(function(){p.current&&(m(),h.current=window.setTimeout(function(){d(i)},n))},[i,n]),[i,u,s]},JN={},Pdr=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=f.useState(function(){return xY()}),o=$v(r,1),i=o[0],s=f.useState(0),l=$v(s,2),c=l[0],u=l[1];return f.useEffect(function(){if(n){JN[t]||(JN[t]=[]);var d=JN[t].push(i);return u(d),function(){delete JN[t][d-1];var p=JN[t].length-1,h=Nt.findLastIndex(JN[t],function(m){return m!==void 0});h!==p&&JN[t].splice(h+1),u(void 0)}}},[t,i,n]),c};function Adr(e){if(Array.isArray(e))return Cfe(e)}function Tdr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kdr(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d8e(e){return Adr(e)||Tdr(e)||Bht(e)||kdr()}var Mdr={TOOLTIP:1200},Hht={escKeyListeners:new Map,onGlobalKeyDown:function(t){if(t.code==="Escape"){var n=Hht.escKeyListeners,r=Math.max.apply(Math,d8e(n.keys())),o=n.get(r),i=Math.max.apply(Math,d8e(o.keys())),s=o.get(i);s(t)}},refreshGlobalKeyDownListener:function(){var t=Lt.getTargetElement("document");this.escKeyListeners.size>0?t.addEventListener("keydown",this.onGlobalKeyDown):t.removeEventListener("keydown",this.onGlobalKeyDown)},addListener:function(t,n){var r=this,o=$v(n,2),i=o[0],s=o[1],l=this.escKeyListeners;l.has(i)||l.set(i,new Map);var c=l.get(i);if(c.has(s))throw new Error("Unexpected: global esc key listener with priority [".concat(i,", ").concat(s,"] already exists."));return c.set(s,t),this.refreshGlobalKeyDownListener(),function(){c.delete(s),c.size===0&&l.delete(i),r.refreshGlobalKeyDownListener()}}},Rdr=function(t){var n=t.callback,r=t.when,o=t.priority;f.useEffect(function(){if(r)return Hht.addListener(n,o)},[n,r,o])},fa=function(){var t=f.useContext(es);return function(){for(var n=arguments.length,r=new Array(n),o=0;o0&&arguments[0]!==void 0?arguments[0]:{};if(Nt.isNotEmpty(b.target)&&(g(),(b.when||s)&&(c.current=Lt.getTargetElement(b.target))),!u.current&&c.current){var w=l?l.hideOverlaysOnDocumentScrolling:ca.hideOverlaysOnDocumentScrolling,S=d.current=Lt.getScrollableParents(c.current);S.some(function(C){return C===document.body||C===window})||S.push(w?window:document.body),u.current=function(C){return r&&r(C)},S.forEach(function(C){return C.addEventListener("scroll",u.current,o)})}},g=function(){if(u.current){var b=d.current;b.forEach(function(w){return w.removeEventListener("scroll",u.current,o)}),u.current=null}},y=function(){g(),d.current=null,p=null,h=null},x=f.useCallback(function(){s?c.current=Lt.getTargetElement(n):(g(),c.current=null)},[n,s]);return f.useEffect(function(){x()},[x]),f.useEffect(function(){var v="".concat(p)!=="".concat(r),b=h!==o,w=u.current;w&&(v||b)?(g(),s&&m()):w||y()},[r,o,s]),Nm(function(){y()}),[m,g]},Jbe=function(t){var n=t.listener,r=t.when,o=r===void 0?!0:r;return W1({target:"window",type:"resize",listener:n,when:o})},Uht=function(t){var n=t.target,r=t.overlay,o=t.listener,i=t.when,s=i===void 0?!0:i,l=t.type,c=l===void 0?"click":l,u=f.useRef(null),d=f.useRef(null),p=W1({target:"window",type:c,listener:function($){o&&o($,{type:"outside",valid:$.which!==3&&P($)})},when:s}),h=$v(p,2),m=h[0],g=h[1],y=Jbe({listener:function($){o&&o($,{type:"resize",valid:!Lt.isTouchDevice()})},when:s}),x=$v(y,2),v=x[0],b=x[1],w=W1({target:"window",type:"orientationchange",listener:function($){o&&o($,{type:"orientationchange",valid:!0})},when:s}),S=$v(w,2),C=S[0],N=S[1],j=Vht({target:n,listener:function($){o&&o($,{type:"scroll",valid:!0})},when:s}),I=$v(j,2),_=I[0],T=I[1],P=function($){return u.current&&!(u.current.isSameNode($.target)||u.current.contains($.target)||d.current&&d.current.contains($.target))},E=function(){m(),v(),C(),_()},M=function(){g(),b(),N(),T()};return f.useEffect(function(){s?(u.current=Lt.getTargetElement(n),d.current=Lt.getTargetElement(r)):(M(),u.current=d.current=null)},[n,r,s]),Nm(function(){M()}),[E,M]},Odr=0,uE=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=f.useState(!1),o=$v(r,2),i=o[0],s=o[1],l=f.useRef(null),c=f.useContext(es),u=Lt.isClient()?window.document:void 0,d=n.document,p=d===void 0?u:d,h=n.manual,m=h===void 0?!1:h,g=n.name,y=g===void 0?"style_".concat(++Odr):g,x=n.id,v=x===void 0?void 0:x,b=n.media,w=b===void 0?void 0:b,S=function(_){var T=_.querySelector('style[data-primereact-style-id="'.concat(y,'"]'));if(T)return T;if(v!==void 0){var P=p.getElementById(v);if(P)return P}return p.createElement("style")},C=function(_){i&&t!==_&&(l.current.textContent=_)},N=function(){if(!(!p||i)){var _=(c==null?void 0:c.styleContainer)||p.head;l.current=S(_),l.current.isConnected||(l.current.type="text/css",v&&(l.current.id=v),w&&(l.current.media=w),Lt.addNonce(l.current,c&&c.nonce||ca.nonce),_.appendChild(l.current),y&&l.current.setAttribute("data-primereact-style-id",y)),l.current.textContent=t,s(!0)}},j=function(){!p||!l.current||(Lt.removeInlineStyle(l.current),s(!1))};return f.useEffect(function(){m||N()},[m]),{id:v,name:y,update:C,unload:j,load:N,isLoaded:i}},js=function(t,n){var r=f.useRef(!1);return f.useEffect(function(){if(!r.current){r.current=!0;return}return t&&t()},n)};function Nfe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n i, .p-input-icon-right > i, .p-input-icon-left > svg, .p-input-icon-right > svg, .p-input-icon-left > .p-input-prefix, .p-input-icon-right > .p-input-suffix { position: absolute; top: 50%; margin-top: -0.5rem; } .p-fluid .p-input-icon-left, .p-fluid .p-input-icon-right { display: block; width: 100%; } `,Wdr=` .p-icon { display: inline-block; } .p-icon-spin { -webkit-animation: p-icon-spin 2s infinite linear; animation: p-icon-spin 2s infinite linear; } svg.p-icon { pointer-events: auto; } svg.p-icon g, .p-disabled svg.p-icon { pointer-events: none; } @-webkit-keyframes p-icon-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } } @keyframes p-icon-spin { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(359deg); transform: rotate(359deg); } } `,Gdr=` @layer primereact { .p-component, .p-component * { box-sizing: border-box; } .p-hidden { display: none; } .p-hidden-space { visibility: hidden; } .p-reset { margin: 0; padding: 0; border: 0; outline: 0; text-decoration: none; font-size: 100%; list-style: none; } .p-disabled, .p-disabled * { cursor: default; pointer-events: none; user-select: none; } .p-component-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; } .p-unselectable-text { user-select: none; } .p-scrollbar-measure { width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px; } @-webkit-keyframes p-fadein { 0% { opacity: 0; } 100% { opacity: 1; } } @keyframes p-fadein { 0% { opacity: 0; } 100% { opacity: 1; } } .p-link { text-align: left; background-color: transparent; margin: 0; padding: 0; border: none; cursor: pointer; user-select: none; } .p-link:disabled { cursor: default; } /* Non react overlay animations */ .p-connected-overlay { opacity: 0; transform: scaleY(0.8); transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1); } .p-connected-overlay-visible { opacity: 1; transform: scaleY(1); } .p-connected-overlay-hidden { opacity: 0; transform: scaleY(1); transition: opacity .1s linear; } /* React based overlay animations */ .p-connected-overlay-enter { opacity: 0; transform: scaleY(0.8); } .p-connected-overlay-enter-active { opacity: 1; transform: scaleY(1); transition: transform .12s cubic-bezier(0, 0, 0.2, 1), opacity .12s cubic-bezier(0, 0, 0.2, 1); } .p-connected-overlay-enter-done { transform: none; } .p-connected-overlay-exit { opacity: 1; } .p-connected-overlay-exit-active { opacity: 0; transition: opacity .1s linear; } /* Toggleable Content */ .p-toggleable-content-enter { max-height: 0; } .p-toggleable-content-enter-active { overflow: hidden; max-height: 1000px; transition: max-height 1s ease-in-out; } .p-toggleable-content-enter-done { transform: none; } .p-toggleable-content-exit { max-height: 1000px; } .p-toggleable-content-exit-active { overflow: hidden; max-height: 0; transition: max-height 0.45s cubic-bezier(0, 1, 0, 1); } /* @todo Refactor */ .p-menu .p-menuitem-link { cursor: pointer; display: flex; align-items: center; text-decoration: none; overflow: hidden; position: relative; } `.concat(Vdr,` `).concat(Udr,` `).concat(Wdr,` } `),li={cProps:void 0,cParams:void 0,cName:void 0,defaultProps:{pt:void 0,ptOptions:void 0,unstyled:!1},context:{},globalCSS:void 0,classes:{},styles:"",extend:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.css,r=nf(nf({},t.defaultProps),li.defaultProps),o={},i=function(d){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return li.context=p,li.cProps=d,Nt.getMergedProps(d,r)},s=function(d){return Nt.getDiffProps(d,r)},l=function(){var d,p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0;p.hasOwnProperty("pt")&&p.pt!==void 0&&(p=p.pt);var y=h,x=/./g.test(y)&&!!m[y.split(".")[0]],v=x?Nt.toFlatCase(y.split(".")[1]):Nt.toFlatCase(y),b=m.hostName&&Nt.toFlatCase(m.hostName),w=b||m.props&&m.props.__TYPE&&Nt.toFlatCase(m.props.__TYPE)||"",S=v==="transition",C="data-pc-",N=function(V){return V!=null&&V.props?V.hostName?V.props.__TYPE===V.hostName?V.props:N(V.parent):V.parent:void 0},j=function(V){var B,G;return((B=m.props)===null||B===void 0?void 0:B[V])||((G=N(m))===null||G===void 0?void 0:G[V])};li.cParams=m,li.cName=w;var I=j("ptOptions")||li.context.ptOptions||{},_=I.mergeSections,T=_===void 0?!0:_,P=I.mergeProps,E=P===void 0?!1:P,M=function(){var V=G1.apply(void 0,arguments);return Array.isArray(V)?{className:wr.apply(void 0,f8e(V))}:Nt.isString(V)?{className:V}:V!=null&&V.hasOwnProperty("className")&&Array.isArray(V.className)?{className:wr.apply(void 0,f8e(V.className))}:V},R=g?x?Wht(M,y,m):Ght(M,y,m):void 0,$=x?void 0:vY(yY(p,w),M,y,m),D=!S&&nf(nf({},v==="root"&&jfe({},"".concat(C,"name"),m.props&&m.props.__parentMetadata?Nt.toFlatCase(m.props.__TYPE):w)),{},jfe({},"".concat(C,"section"),v));return T||!T&&$?E?gW([R,$,Object.keys(D).length?D:{}],{classNameMergeFunction:(d=li.context.ptOptions)===null||d===void 0?void 0:d.classNameMergeFunction}):nf(nf(nf({},R),$),Object.keys(D).length?D:{}):nf(nf({},$),Object.keys(D).length?D:{})},c=function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},p=d.props,h=d.state,m=function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return l((p||{}).pt,w,nf(nf({},d),S))},g=function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return l(w,S,C,!1)},y=function(){return li.context.unstyled||ca.unstyled||p.unstyled},x=function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return y()?void 0:G1(n&&n.classes,w,nf({props:p,state:h},S))},v=function(){var w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(C){var N,j=G1(n&&n.inlineStyles,w,nf({props:p,state:h},S)),I=G1(o,w,nf({props:p,state:h},S));return gW([I,j],{classNameMergeFunction:(N=li.context.ptOptions)===null||N===void 0?void 0:N.classNameMergeFunction})}};return{ptm:m,ptmo:g,sx:v,cx:x,isUnstyled:y}};return nf(nf({getProps:i,getOtherProps:s,setMetaData:c},t),{},{defaultProps:r})}},G1=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=String(Nt.toFlatCase(n)).split("."),i=o.shift(),s=Nt.isNotEmpty(t)?Object.keys(t).find(function(l){return Nt.toFlatCase(l)===i}):"";return i?Nt.isObject(t)?G1(Nt.getItemValue(t[s],r),o.join("."),r):void 0:Nt.getItemValue(t,r)},yY=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0,o=t==null?void 0:t._usept,i=function(l){var c,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,d=r?r(l):l,p=Nt.toFlatCase(n);return(c=u?p!==li.cName?d==null?void 0:d[p]:void 0:d==null?void 0:d[p])!==null&&c!==void 0?c:d};return Nt.isNotEmpty(o)?{_usept:o,originalValue:i(t.originalValue),value:i(t.value)}:i(t,!0)},vY=function(t,n,r,o){var i=function(y){return n(y,r,o)};if(t!=null&&t.hasOwnProperty("_usept")){var s=t._usept||li.context.ptOptions||{},l=s.mergeSections,c=l===void 0?!0:l,u=s.mergeProps,d=u===void 0?!1:u,p=s.classNameMergeFunction,h=i(t.originalValue),m=i(t.value);return h===void 0&&m===void 0?void 0:Nt.isString(m)?m:Nt.isString(h)?h:c||!c&&m?d?gW([h,m],{classNameMergeFunction:p}):nf(nf({},h),m):m}return i(t)},qdr=function(){return yY(li.context.pt||ca.pt,void 0,function(t){return Nt.getItemValue(t,li.cParams)})},Kdr=function(){return yY(li.context.pt||ca.pt,void 0,function(t){return G1(t,li.cName,li.cParams)||Nt.getItemValue(t,li.cParams)})},Wht=function(t,n,r){return vY(qdr(),t,n,r)},Ght=function(t,n,r){return vY(Kdr(),t,n,r)},X0=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){},r=arguments.length>2?arguments[2]:void 0,o=r.name,i=r.styled,s=i===void 0?!1:i,l=r.hostName,c=l===void 0?"":l,u=Wht(G1,"global.css",li.cParams),d=Nt.toFlatCase(o),p=uE(Hdr,{name:"base",manual:!0}),h=p.load,m=uE(Gdr,{name:"common",manual:!0}),g=m.load,y=uE(u,{name:"global",manual:!0}),x=y.load,v=uE(t,{name:o,manual:!0}),b=v.load,w=function(C){if(!c){var N=vY(yY((li.cProps||{}).pt,d),G1,"hooks.".concat(C)),j=Ght(G1,"hooks.".concat(C));N==null||N(),j==null||j()}};w("useMountEffect"),bg(function(){h(),x(),n()||(g(),s||b())}),js(function(){w("useUpdateEffect")}),Nm(function(){w("useUnmountEffect")})},nl={defaultProps:{__TYPE:"IconBase",className:null,label:null,spin:!1},getProps:function(t){return Nt.getMergedProps(t,nl.defaultProps)},getOtherProps:function(t){return Nt.getDiffProps(t,nl.defaultProps)},getPTI:function(t){var n=Nt.isEmpty(t.label),r=nl.getOtherProps(t),o={className:wr("p-icon",{"p-icon-spin":t.spin},t.className),role:n?void 0:"img","aria-label":n?void 0:t.label,"aria-hidden":t.label?n:void 0};return Nt.getMergedProps(r,o)}};function Efe(){return Efe=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);ne.length)&&(t=e.length);for(var n=0,r=Array(t);nEt.width?(M.current.style.left="0px",M.current.style.right=window.innerWidth-Et.width-Pt+"px"):(M.current.style.right="",M.current.style.left=Pt+"px"),M.current.style.top=Jt+"px",Lt.addClass(M.current,"p-tooltip-active")}else{var Ht=Lt.findCollisionPosition(dn),jt=fe(Me,"my")||o.my||Ht.my,Vt=fe(Me,"at")||o.at||Ht.at;M.current.style.padding="0px",Lt.flipfitCollision(M.current,Me,jt,Vt,function(nn){var zt=nn.at,Nn=zt.x,xr=zt.y,ur=nn.my.x,Zt=o.at?Nn!=="center"&&Nn!==ur?Nn:xr:nn.at["".concat(Ht.axis)];M.current.style.padding="",h(Zt),Re(Zt),Lt.addClass(M.current,"p-tooltip-active")})}},Re=function(Me){if(M.current){var et=getComputedStyle(M.current);Me==="left"?M.current.style.left=parseFloat(et.left)-parseFloat(et.paddingLeft)*2+"px":Me==="top"&&(M.current.style.top=parseFloat(et.top)-parseFloat(et.paddingTop)*2+"px")}},Ue=function(){ue()||(z.current=!1)},He=function(Me){ue()||(z.current=!0,we(Me))},Ye=function(Me){if(Me){var et=ge(Me),vt=et.showEvents,Pt=et.hideEvents,Jt=dt(Me);vt.forEach(function(dn){return Jt==null?void 0:Jt.addEventListener(dn,xe)}),Pt.forEach(function(dn){return Jt==null?void 0:Jt.addEventListener(dn,we)})}},We=function(Me){if(Me){var et=ge(Me),vt=et.showEvents,Pt=et.hideEvents,Jt=dt(Me);vt.forEach(function(dn){return Jt==null?void 0:Jt.removeEventListener(dn,xe)}),Pt.forEach(function(dn){return Jt==null?void 0:Jt.removeEventListener(dn,we)})}},at=function(Me){return fe($.current,Me.toLowerCase())||o[Me]},Oe=function(Me,et){qe();var vt=at(Me);vt?V.current["".concat(Me)]=setTimeout(function(){return et()},vt):et()},Ae=function(Me){if(Me){for(var et=arguments.length,vt=new Array(et>1?et-1:0),Pt=1;Pte.length)&&(t=e.length);for(var n=0,r=Array(t);n0,"p-inputwrapper-focus":r,"p-inputnumber-buttons-stacked":o,"p-inputnumber-buttons-horizontal":i,"p-inputnumber-buttons-vertical":s,"p-invalid":n.invalid})},input:function(t){var n=t.props,r=t.context;return wr("p-inputnumber-input",{"p-variant-filled":n.variant?n.variant==="filled":r&&r.inputStyle==="filled"})},buttonGroup:"p-inputnumber-button-group",incrementButton:function(t){var n=t.props;return wr("p-inputnumber-button p-inputnumber-button-up p-button p-button-icon-only p-component",{"p-disabled":n.disabled})},incrementIcon:"p-button-icon",decrementButton:function(t){var n=t.props;return wr("p-inputnumber-button p-inputnumber-button-down p-button p-button-icon-only p-component",{"p-disabled":n.disabled})},decrementIcon:"p-button-icon"},Wfr=` @layer primereact { .p-inputnumber { display: inline-flex; } .p-inputnumber-button { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; } .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button .p-button-label, .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button .p-button-label { display: none; } .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-up { border-top-left-radius: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; padding: 0; } .p-inputnumber-buttons-stacked .p-inputnumber-input { border-top-right-radius: 0; border-bottom-right-radius: 0; } .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-down { border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-left-radius: 0; padding: 0; } .p-inputnumber-buttons-stacked .p-inputnumber-button-group { display: flex; flex-direction: column; } .p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button { flex: 1 1 auto; } .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up { order: 3; border-top-left-radius: 0; border-bottom-left-radius: 0; } .p-inputnumber-buttons-horizontal .p-inputnumber-input { order: 2; border-radius: 0; } .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down { order: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; } .p-inputnumber-buttons-vertical { flex-direction: column; } .p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up { order: 1; border-bottom-left-radius: 0; border-bottom-right-radius: 0; width: 100%; } .p-inputnumber-buttons-vertical .p-inputnumber-input { order: 2; border-radius: 0; text-align: center; } .p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down { order: 3; border-top-left-radius: 0; border-top-right-radius: 0; width: 100%; } .p-inputnumber-input { flex: 1 1 auto; } .p-fluid .p-inputnumber { width: 100%; } .p-fluid .p-inputnumber .p-inputnumber-input { width: 1%; } .p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input { width: 100%; } } `,W7=li.extend({defaultProps:{__TYPE:"InputNumber",__parentMetadata:null,allowEmpty:!0,ariaLabelledBy:null,autoFocus:!1,buttonLayout:"stacked",className:null,currency:void 0,currencyDisplay:void 0,decrementButtonClassName:null,decrementButtonIcon:null,disabled:!1,format:!0,id:null,incrementButtonClassName:null,incrementButtonIcon:null,inputClassName:null,inputId:null,inputMode:null,inputRef:null,inputStyle:null,invalid:!1,variant:null,locale:void 0,localeMatcher:void 0,max:null,maxFractionDigits:void 0,maxLength:null,min:null,minFractionDigits:void 0,mode:"decimal",name:null,onBlur:null,onChange:null,onFocus:null,onKeyDown:null,onKeyUp:null,onValueChange:null,pattern:null,placeholder:null,prefix:null,readOnly:!1,required:!1,roundingMode:void 0,showButtons:!1,size:null,step:1,style:null,suffix:null,tabIndex:null,tooltip:null,tooltipOptions:null,type:"text",useGrouping:!0,value:null,children:void 0},css:{classes:Ufr,styles:Wfr}});function b8e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function A_(e){for(var t=1;t2&&arguments[2]!==void 0?arguments[2]:10;return Math.round((ke+it)*Mt)/Mt},se=function(ke,it,Mt){var _t=it||500;Kt(),x.current=setTimeout(function(){se(ke,40,Mt)},_t),ge(ke,Mt)},ge=function(ke,it){if(y.current){var Mt=o.step*it,_t=ue(y.current.value)||0,gt=jt(fe(_t,Mt));if(o.maxLength&&o.maxLength0&&it>Jn){var nr=Qe()&&(o.minFractionDigits||0)0?gt:""):gt=_t.slice(0,it-1)+_t.slice(it)}else if(T.current.test(hn)){var or=Ct(_t),Or=or.minusCharIndex,Tn=or.currencyCharIndex;Or===Tn-1&&(gt=_t.slice(0,Or)+_t.slice(it))}sn(ke,gt,null,"delete-single")}else gt=et(_t,it,Mt),sn(ke,gt,null,"delete-range");break;case"Delete":if(ke.preventDefault(),it===Mt){var er=_t.charAt(it),Lo=bt(_t),Fo=Lo.decimalCharIndex,Ao=Lo.decimalCharIndexWithoutPrefix;if(dn(er)){var uo=ur(_t);if(I.current.test(er))I.current.lastIndex=0,gt=_t.slice(0,it)+_t.slice(it+2);else if(P.current.test(er))P.current.lastIndex=0,uo?y.current.setSelectionRange(it+1,it+1):gt=_t.slice(0,it)+_t.slice(it+1);else if(Fo>0&&it>Fo){var Wi=Qe()&&(o.minFractionDigits||0)0?gt:""):gt=_t.slice(0,it)+_t.slice(it+1)}sn(ke,gt,null,"delete-back-single")}else gt=et(_t,it,Mt),sn(ke,gt,null,"delete-range");break;case"End":ke.preventDefault(),Nt.isEmpty(o.max)||Zt(ke,o.max);break;case"Home":ke.preventDefault(),Nt.isEmpty(o.min)||Zt(ke,o.min);break;default:ke.preventDefault();var Jr=ke.key;if(Jr){Jr==="."&&(Jr=E.current);var hs=Ze(Jr),zr=qe(Jr);(Number(Jr)>=0&&Number(Jr)<=9||zr||hs)&&Je(ke,Jr,{isDecimalSign:hs,isMinusSign:zr})}break}}}},Oe=function(ke){if(ke.preventDefault(),!(o.disabled||o.readOnly)){var it=(ke.clipboardData||window.clipboardData).getData("Text");if(it){var Mt=ue(it);if(Mt!=null)if(lt(Mt)){var _t=oe(Mt);y.current.value=_t,Zt(ke,Mt)}else Je(ke,Mt.toString())}}},Ae=function(){return Nt.isEmpty(o.min)||o.min<0},qe=function(ke){return _.current.test(ke)||ke==="-"?(_.current.lastIndex=0,!0):!1},dt=function(ke){return lt(ke)?ke.toString().replace(/\.(?=[^.]*$)/,E.current):ke},Ze=function(ke){return P.current.test(ke)||lt(ke)?(P.current.lastIndex=0,!0):!1},Qe=function(){return o.mode==="decimal"},lt=function(ke){var it=new Intl.NumberFormat(z,F()),Mt=ue(it.format(ke));return Mt===null?!1:Mt%1!==0},bt=function(ke){var it=ke.search(P.current);P.current.lastIndex=0;var Mt=ke.replace(R.current,"").trim().replace(/\s/g,"").replace(T.current,""),_t=Mt.search(P.current);return P.current.lastIndex=0,{decimalCharIndex:it,decimalCharIndexWithoutPrefix:_t}},Ct=function(ke){var it=ke.search(P.current);P.current.lastIndex=0;var Mt=ke.search(_.current);_.current.lastIndex=0;var _t=ke.search(M.current);M.current.lastIndex=0;var gt=ke.search(T.current);return gt===0&&S.current&&S.current.length>1&&(gt=S.current.trim().length),T.current.lastIndex=0,{decimalCharIndex:it,minusCharIndex:Mt,suffixCharIndex:_t,currencyCharIndex:gt}},Je=function(ke,it){var Mt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{isDecimalSign:!1,isMinusSign:!1},_t=it.search(_.current);if(_.current.lastIndex=0,!(!Ae()&&_t!==-1)){var gt=y.current.selectionStart,hn=y.current.selectionEnd,Vn=y.current.value.trim(),Jn=Ct(Vn),Fr=Jn.decimalCharIndex,po=Jn.minusCharIndex,nr=Jn.suffixCharIndex,or=Jn.currencyCharIndex,Or=b.current.resolvedOptions().maximumFractionDigits,Tn=o.min||o.max||o.suffix||o.prefix,er;if(Mt.isMinusSign){var Lo=po===-1;(gt===0||gt===or+1)&&(er=Vn,(Lo||hn!==0)&&(er=Me(Vn,it,0,hn)),sn(ke,er,it,"insert"))}else if(Mt.isDecimalSign){if(Fr>0&>===Fr)sn(ke,Vn,it,"insert");else if(Fr>gt&&Fr0&>>Fr){if(gt+it.length-(Fr+1)<=Or){var uo=or>=gt?or-1:nr>=gt?nr:Vn.length;er=Vn.slice(0,gt)+it+Vn.slice(gt+it.length,uo)+Vn.slice(uo),sn(ke,er,it,Ao)}}else er=Me(Vn,it,gt,hn),sn(ke,er,it,Ao)}}},Pe=function(ke){return ke&&ke.replace(M.current,"").trim().replace(/\s/g,"").replace(T.current,"")},Me=function(ke,it,Mt,_t){var gt=Ze(it)?it:it.split(P.current);if(gt.length===2){var hn=ke.slice(Mt,_t).search(P.current);return P.current.lastIndex=0,hn>0?ke.slice(0,Mt)+oe(it)+Pe(ke).slice(_t):ke||oe(it)}else{if(Ze(it)&&ke.length===0)return oe("0.");if(_t-Mt===ke.length)return oe(it);if(Mt===0){var Vn=Nt.isLetter(ke[_t])?_t-1:_t;return it+ke.slice(Vn)}else if(_t===ke.length)return ke.slice(0,Mt)+it}var Jn=ke.slice(Mt,_t),Fr=/\s$/.test(Jn)?" ":"";return ke.slice(0,Mt)+it+Fr+ke.slice(_t)},et=function(ke,it,Mt){var _t;return Mt-it===ke.length?_t="":it===0?_t=ke.slice(Mt):Mt===ke.length?_t=ke.slice(0,it):_t=ke.slice(0,it)+ke.slice(Mt),_t},vt=function(){var ke=y.current.selectionStart,it=y.current.value,Mt=it.length,_t=null,gt=(S.current||"").length;it=it.replace(R.current,""),ke=ke-gt;var hn=it.charAt(ke);if(dn(hn))return ke+gt;for(var Vn=ke-1;Vn>=0;)if(hn=it.charAt(Vn),dn(hn)){_t=Vn+gt;break}else Vn--;if(_t!==null)y.current.setSelectionRange(_t+1,_t+1);else{for(Vn=ke;Vno.max?o.max:ke},nn=function(ke,it,Mt,_t){it=it||"";var gt=y.current,hn=gt.value,Vn=oe(ke),Jn=hn.length;if(Vn!==_t&&(Vn=xr(Vn,_t)),Jn===0){gt.value=Vn,gt.setSelectionRange(0,0);var Fr=vt(),po=Fr+it.length+(Ze(it)?1:0);gt.setSelectionRange(po,po)}else{var nr=gt.selectionStart,or=gt.selectionEnd;if(o.maxLength&&o.maxLengthe.length)&&(t=e.length);for(var n=0,r=Array(t);n .p-virtualscroller-content { display: flex; } /* Inline */ .p-virtualscroller-inline .p-virtualscroller-content { position: static; } `,G7=li.extend({defaultProps:{__TYPE:"VirtualScroller",__parentMetadata:null,id:null,style:null,className:null,tabIndex:0,items:null,itemSize:0,scrollHeight:null,scrollWidth:null,orientation:"vertical",step:0,numToleratedItems:null,delay:0,resizeDelay:10,appendOnly:!1,inline:!1,lazy:!1,disabled:!1,loaderDisabled:!1,loadingIcon:null,columns:null,loading:void 0,autoSize:!1,showSpacer:!0,showLoader:!1,loadingTemplate:null,loaderIconTemplate:null,itemTemplate:null,contentTemplate:null,onScroll:null,onScrollIndexChange:null,onLazyLoad:null,children:void 0},css:{styles:tpr}});function C8e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function T_(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:"auto",Tt=Qe(),rn=Tt.numToleratedItems,un=Je(),xn=function(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,it=arguments.length>1?arguments[1]:void 0;return ke<=it?0:ke},Kn=function(ke,it,Mt){return ke*it+Mt},ar=function(){var ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,it=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return at({left:ke,top:it,behavior:xt})},tr=c?{rows:0,cols:0}:0,jn=!1;c?(tr={rows:xn(nt[0],rn[0]),cols:xn(nt[1],rn[1])},ar(Kn(tr.cols,o.itemSize[1],un.left),Kn(tr.rows,o.itemSize[0],un.top)),jn=p.rows!==tr.rows||p.cols!==tr.cols):(tr=xn(nt,rn),l?ar(Kn(tr,o.itemSize,un.left),0):ar(0,Kn(tr,o.itemSize,un.top)),jn=p!==tr),ge.current=jn,h(tr)},Ae=function(nt,xt){var Tt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"auto";if(xt){var rn=Ze(),un=rn.first,xn=rn.viewport,Kn=function(){var it=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Mt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return at({left:it,top:Mt,behavior:Tt})},ar=xt==="to-start",tr=xt==="to-end";if(ar){if(c)xn.first.rows-un.rows>nt[0]?Kn(xn.first.cols*o.itemSize[1],(xn.first.rows-1)*o.itemSize[0]):xn.first.cols-un.cols>nt[1]&&Kn((xn.first.cols-1)*o.itemSize[1],xn.first.rows*o.itemSize[0]);else if(xn.first-un>nt){var jn=(xn.first-1)*o.itemSize;l?Kn(jn,0):Kn(0,jn)}}else if(tr){if(c)xn.last.rows-un.rows<=nt[0]+1?Kn(xn.first.cols*o.itemSize[1],(xn.first.rows+1)*o.itemSize[0]):xn.last.cols-un.cols<=nt[1]+1&&Kn((xn.first.cols+1)*o.itemSize[1],xn.first.rows*o.itemSize[0]);else if(xn.last-un<=nt+1){var Le=(xn.first+1)*o.itemSize;l?Kn(Le,0):Kn(0,Le)}}}else Oe(nt,Tt)},qe=function(){return $?o.loaderDisabled?B:[]:ot()},dt=function(){return o.columns&&c||l?$&&o.loaderDisabled?c?B[0]:B:o.columns.slice(c?p.cols:p,c?y.cols:y):o.columns},Ze=function(){var nt=function(tr,jn){return Math.floor(tr/(jn||tr))},xt=p,Tt=0;if(W.current){var rn=W.current,un=rn.scrollTop,xn=rn.scrollLeft;if(c)xt={rows:nt(un,o.itemSize[0]),cols:nt(xn,o.itemSize[1])},Tt={rows:xt.rows+j.rows,cols:xt.cols+j.cols};else{var Kn=l?xn:un;xt=nt(Kn,o.itemSize),Tt=xt+j}}return{first:p,last:y,viewport:{first:xt,last:Tt}}},Qe=function(){var nt=Je(),xt=W.current?W.current.offsetWidth-nt.left:0,Tt=W.current?W.current.offsetHeight-nt.top:0,rn=function(tr,jn){return Math.ceil(tr/(jn||tr))},un=function(tr){return Math.ceil(tr/2)},xn=c?{rows:rn(Tt,o.itemSize[0]),cols:rn(xt,o.itemSize[1])}:rn(l?xt:Tt,o.itemSize),Kn=P||(c?[un(xn.rows),un(xn.cols)]:un(xn));return{numItemsInViewport:xn,numToleratedItems:Kn}},lt=function(){var nt=Qe(),xt=nt.numItemsInViewport,Tt=nt.numToleratedItems,rn=function(Kn,ar,tr){var jn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Ct(Kn+ar+(Kn0&&arguments[0]!==void 0?arguments[0]:0,Tt=arguments.length>1?arguments[1]:void 0;return o.items?Math.min(Tt?((nt=o.columns||o.items[0])===null||nt===void 0?void 0:nt.length)||0:(o.items||[]).length,xt):0},Je=function(){if(U.current){var nt=getComputedStyle(U.current),xt=parseFloat(nt.paddingLeft)+Math.max(parseFloat(nt.left)||0,0),Tt=parseFloat(nt.paddingRight)+Math.max(parseFloat(nt.right)||0,0),rn=parseFloat(nt.paddingTop)+Math.max(parseFloat(nt.top)||0,0),un=parseFloat(nt.paddingBottom)+Math.max(parseFloat(nt.bottom)||0,0);return{left:xt,right:Tt,top:rn,bottom:un,x:xt+Tt,y:rn+un}}return{left:0,right:0,top:0,bottom:0,x:0,y:0}},Pe=function(){if(W.current){var nt=W.current.parentElement,xt=o.scrollWidth||"".concat(W.current.offsetWidth||nt.offsetWidth,"px"),Tt=o.scrollHeight||"".concat(W.current.offsetHeight||nt.offsetHeight,"px"),rn=function(xn,Kn){return W.current.style[xn]=Kn};c||l?(rn("height",Tt),rn("width",xt)):rn("height",Tt)}},Me=function(){var nt=o.items;if(nt){var xt=Je(),Tt=function(un,xn,Kn){var ar=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return ae.current=T_(T_({},ae.current),smt({},"".concat(un),(xn||[]).length*Kn+ar+"px"))};c?(Tt("height",nt,o.itemSize[0],xt.y),Tt("width",o.columns||nt[1],o.itemSize[1],xt.x)):l?Tt("width",o.columns||nt,o.itemSize,xt.x):Tt("height",nt,o.itemSize,xt.y)}},et=function(nt){if(U.current&&!o.appendOnly){var xt=nt?nt.first:p,Tt=function(Kn,ar){return Kn*ar},rn=function(){var Kn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,ar=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;X.current&&(X.current.style.top="-".concat(ar,"px")),ce.current=T_(T_({},ce.current),{transform:"translate3d(".concat(Kn,"px, ").concat(ar,"px, 0)")})};if(c)rn(Tt(xt.cols,o.itemSize[1]),Tt(xt.rows,o.itemSize[0]));else{var un=Tt(xt,o.itemSize);l?rn(un,0):rn(0,un)}}},vt=function(nt){var xt=nt.target,Tt=Je(),rn=function(Or,Tn){return Or?Or>Tn?Or-Tn:Or:0},un=function(Or,Tn){return Math.floor(Or/(Tn||Or))},xn=function(Or,Tn,er,Lo,Fo,Ao){return Or<=Fo?Fo:Ao?er-Lo-Fo:Tn+Fo-1},Kn=function(Or,Tn,er,Lo,Fo,Ao,uo){return Or<=Ao?0:Math.max(0,uo?OrTn?er:Or-2*Ao)},ar=function(Or,Tn,er,Lo,Fo,Ao){var uo=Tn+Lo+2*Fo;return Or>=Fo&&(uo=uo+(Fo+1)),Ct(uo,Ao)},tr=rn(xt.scrollTop,Tt.top),jn=rn(xt.scrollLeft,Tt.left),Le=c?{rows:0,cols:0}:0,ke=y,it=!1,Mt=J.current;if(c){var _t=J.current.top<=tr,gt=J.current.left<=jn;if(!o.appendOnly||o.appendOnly&&(_t||gt)){var hn={rows:un(tr,o.itemSize[0]),cols:un(jn,o.itemSize[1])},Vn={rows:xn(hn.rows,p.rows,y.rows,j.rows,P[0],_t),cols:xn(hn.cols,p.cols,y.cols,j.cols,P[1],gt)};Le={rows:Kn(hn.rows,Vn.rows,p.rows,y.rows,j.rows,P[0],_t),cols:Kn(hn.cols,Vn.cols,p.cols,y.cols,j.cols,P[1],gt)},ke={rows:ar(hn.rows,Le.rows,y.rows,j.rows,P[0]),cols:ar(hn.cols,Le.cols,y.cols,j.cols,P[1],!0)},it=Le.rows!==p.rows||ke.rows!==y.rows||Le.cols!==p.cols||ke.cols!==y.cols||ge.current,Mt={top:tr,left:jn}}}else{var Jn=l?jn:tr,Fr=J.current<=Jn;if(!o.appendOnly||o.appendOnly&&Fr){var po=un(Jn,o.itemSize),nr=xn(po,p,y,j,P,Fr);Le=Kn(po,nr,p,y,j,P,Fr),ke=ar(po,Le,y,j,P),it=Le!==p||ke!==y||ge.current,Mt=Jn}}return{first:Le,last:ke,isRangeChanged:it,scrollPos:Mt}},Pt=function(nt){var xt=vt(nt),Tt=xt.first,rn=xt.last,un=xt.isRangeChanged,xn=xt.scrollPos;if(un){var Kn={first:Tt,last:rn};if(et(Kn),h(Tt),x(rn),J.current=xn,o.onScrollIndexChange&&o.onScrollIndexChange(Kn),o.lazy&&We(Tt)){var ar={first:o.step?Math.min(He(Tt)*o.step,(o.items||[]).length-o.step):Tt,last:Math.min(o.step?(He(Tt)+1)*o.step:rn,(o.items||[]).length)},tr=!ye.current||ye.current.first!==ar.first||ye.current.last!==ar.last;tr&&o.onLazyLoad&&o.onLazyLoad(ar),ye.current=ar}}},Jt=function(nt){if(o.onScroll&&o.onScroll(nt),o.delay){if(te.current&&clearTimeout(te.current),We(p)){if(!$&&o.showLoader){var xt=vt(nt),Tt=xt.isRangeChanged,rn=Tt||(o.step?We(p):!1);rn&&D(!0)}te.current=setTimeout(function(){Pt(nt),$&&o.showLoader&&(!o.lazy||o.loading===void 0)&&(D(!1),S(He(p)))},o.delay)}}else Pt(nt)},dn=function(){re.current&&clearTimeout(re.current),re.current=setTimeout(function(){if(W.current){var nt=[Lt.getWidth(W.current),Lt.getHeight(W.current)],xt=nt[0],Tt=nt[1],rn=xt!==oe.current,un=Tt!==ue.current,xn=c?rn||un:l?rn:s?un:!1;xn&&(E(o.numToleratedItems),oe.current=xt,ue.current=Tt,fe.current=Lt.getWidth(U.current),se.current=Lt.getHeight(U.current))}},o.resizeDelay)},Et=function(nt){var xt=(o.items||[]).length,Tt=c?p.rows+nt:p+nt;return{index:Tt,count:xt,first:Tt===0,last:Tt===xt-1,even:Tt%2===0,odd:Tt%2!==0,props:o}},sn=function(nt,xt){var Tt=B.length||0;return T_({index:nt,count:Tt,first:nt===0,last:nt===Tt-1,even:nt%2===0,odd:nt%2!==0,props:o},xt)},ot=function(){var nt=o.items;return nt&&!$?c?nt.slice(o.appendOnly?0:p.rows,y.rows).map(function(xt){return o.columns?xt:xt.slice(o.appendOnly?0:p.cols,y.cols)}):l&&o.columns?nt:nt.slice(o.appendOnly?0:p,y):[]},mt=function(){W.current&&jt()&&(Ye(U.current),Ht(),xe(),Re(),oe.current=Lt.getWidth(W.current),ue.current=Lt.getHeight(W.current),fe.current=Lt.getWidth(U.current),se.current=Lt.getHeight(U.current))},Ht=function(){!o.disabled&&jt()&&(Pe(),lt(),Me())},jt=function(){if(Lt.isVisible(W.current)){var nt=W.current.getBoundingClientRect();return nt.width>0&&nt.height>0}return!1};f.useEffect(function(){!de.current&&jt()&&(mt(),de.current=!0)}),js(function(){Ht()},[o.itemSize,o.scrollHeight,o.scrollWidth]),js(function(){o.numToleratedItems!==P&&E(o.numToleratedItems)},[o.numToleratedItems]),js(function(){o.numToleratedItems===P&&Ht()},[P]),js(function(){var pt=i.items!==void 0&&i.items!==null,nt=o.items!==void 0&&o.items!==null,xt=pt?i.items.length:0,Tt=nt?o.items.length:0,rn=xt!==Tt;if(c&&!rn){var un=pt&&i.items.length>0?i.items[0].length:0,xn=nt&&o.items.length>0?o.items[0].length:0;rn=un!==xn}(!pt||rn)&&Ht();var Kn=$;o.lazy&&i.loading!==o.loading&&o.loading!==$&&(D(o.loading),Kn=o.loading),bt(Kn)}),js(function(){J.current=c?{top:0,left:0}:0},[o.orientation]),f.useImperativeHandle(t,function(){return{props:o,getElementRef:Ue,scrollTo:at,scrollToIndex:Oe,scrollInView:Ae,getRenderedRange:Ze}});var Vt=function(nt){var xt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Tt=sn(nt,xt),rn=Nt.getJSXElement(o.loadingTemplate,Tt);return f.createElement(f.Fragment,{key:nt},rn)},nn=function(){var nt="p-virtualscroller-loading-icon",xt=n({className:nt},F("loadingIcon")),Tt=o.loadingIcon||f.createElement(j6,Wfe({},xt,{spin:!0})),rn=el.getJSXIcon(Tt,T_({},xt),{props:o});if(!o.loaderDisabled&&o.showLoader&&$){var un=wr("p-virtualscroller-loader",{"p-component-overlay":!o.loadingTemplate}),xn=rn;if(o.loadingTemplate)xn=B.map(function(tr,jn){return Vt(jn,c&&{numCols:j.cols})});else if(o.loaderIconTemplate){var Kn={iconClassName:nt,element:xn,props:o};xn=Nt.getJSXElement(o.loaderIconTemplate,Kn)}var ar=n({className:un},F("loader"));return f.createElement("div",ar,xn)}return null},zt=function(){if(o.showSpacer){var nt=n({ref:K,style:ae.current,className:"p-virtualscroller-spacer"},F("spacer"));return f.createElement("div",nt)}return null},Nn=function(nt,xt){var Tt=Et(xt),rn=Nt.getJSXElement(o.itemTemplate,nt,Tt);return f.createElement(f.Fragment,{key:Tt.index},rn)},xr=function(){var nt=ot();return nt.map(Nn)},ur=function(){var nt=xr(),xt=wr("p-virtualscroller-content",{"p-virtualscroller-loading":$}),Tt=n({ref:U,style:ce.current,className:xt},F("content")),rn=f.createElement("div",Tt,nt);if(o.contentTemplate){var un={style:ce.current,className:xt,spacerStyle:ae.current,contentRef:function(Kn){return U.current=Nt.getRefElement(Kn)},spacerRef:function(Kn){return K.current=Nt.getRefElement(Kn)},stickyRef:function(Kn){return X.current=Nt.getRefElement(Kn)},items:ot(),getItemOptions:function(Kn){return Et(Kn)},children:nt,element:rn,props:o,loading:$,getLoaderOptions:function(Kn,ar){return sn(Kn,ar)},loadingTemplate:o.loadingTemplate,itemSize:o.itemSize,rows:qe(),columns:dt(),vertical:s,horizontal:l,both:c};return Nt.getJSXElement(o.contentTemplate,un)}return rn};if(o.disabled){var Zt=Nt.getJSXElement(o.contentTemplate,{items:o.items,rows:o.items,columns:o.columns});return f.createElement(f.Fragment,null,o.children,Zt)}var Ot=wr("p-virtualscroller",{"p-virtualscroller-inline":o.inline,"p-virtualscroller-both p-both-scroll":c,"p-virtualscroller-horizontal p-horizontal-scroll":l},o.className),qt=nn(),Kt=ur(),gn=zt(),An=n({ref:W,className:Ot,tabIndex:o.tabIndex,style:o.style,onScroll:function(nt){return Jt(nt)}},G7.getOtherProps(o),F("root"));return f.createElement("div",An,Kt,gn,qt)}));t1e.displayName="VirtualScroller";function Gfe(){return Gfe=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n2&&arguments[2]!==void 0?arguments[2]:{},M={height:E.props?E.props.itemSize:void 0};if(M=xx(xx({},M),T.style),T.group&&e.optionGroupLabel){var R=e.optionGroupLabel,$=e.optionGroupTemplate?Nt.getJSXElement(e.optionGroupTemplate,T,P):e.getOptionGroupLabel(T),D=P+"_"+e.getOptionGroupRenderKey(T),z=n({className:o("itemGroup",{optionGroupLabel:R}),style:M,"data-p-highlight":e.selected},p("itemGroup")),V=n({className:o("itemGroupLabel")},p("itemGroupLabel"));return f.createElement("li",Dv({key:D},z),f.createElement("span",V,$))}var B=e.getOptionRenderKey(T)+"_"+P,G=e.getOptionLabel(T),H=e.isOptionDisabled(T);return f.createElement(cmt,{key:B,label:G,index:P,focusedOptionIndex:e.focusedOptionIndex,option:T,ariaSetSize:u,onInputKeyDown:e.onInputKeyDown,style:M,template:e.itemTemplate,selected:e.isSelected(T),highlightOnSelect:e.highlightOnSelect,disabled:H,onClick:e.onOptionClick,onMouseMove:x,ptm:r,cx:o,checkmark:e.checkmark})},w=function(){return Nt.isNotEmpty(e.visibleOptions)?e.visibleOptions.map(b):e.hasFilter?v(e.emptyFilterMessage,!0):v(e.emptyMessage)},S=function(){if(e.showFilterClear&&e.filterValue){var T=Zh("clear"),P=n({className:o("filterClearIcon"),"aria-label":T,onClick:function(){return e.onFilterClearIconClick(function(){return Lt.focus(l.current)})}},p("filterClearIcon")),E=e.filterClearIcon||f.createElement(SY,P),M=el.getJSXIcon(E,xx({},P),{props:e});return M}return null},C=function(){if(e.filter){var T=S(),P=n({className:o("filterIcon")},p("filterIcon")),E=e.filterIcon||f.createElement(amt,P),M=el.getJSXIcon(E,xx({},P),{props:e}),R=n({className:o("filterContainer",{clearIcon:T})},p("filterContainer")),$=n({ref:l,type:"text",autoComplete:"off",className:o("filterInput",{context:s}),placeholder:e.filterPlaceholder,onKeyDown:e.onFilterInputKeyDown,onChange:function(G){return g(G)},value:e.filterValue},p("filterInput")),D=f.createElement("div",R,f.createElement("input",$),T,M);if(e.filterTemplate){var z={className:wr("p-dropdown-filter-container",{"p-dropdown-clearable-filter":!!T}),element:D,filterOptions:d,filterInputKeyDown:e.onFilterInputKeyDown,filterInputChange:g,filterIconClassName:"p-dropdown-filter-icon",clearIcon:T,props:e};D=Nt.getJSXElement(e.filterTemplate,z)}var V=n({className:o("header")},p("header"));return f.createElement("div",V,D)}return null},N=function(){if(e.virtualScrollerOptions){var T=xx(xx({},e.virtualScrollerOptions),{style:xx(xx({},e.virtualScrollerOptions.style),{height:e.scrollHeight}),className:wr("p-dropdown-items-wrapper",e.virtualScrollerOptions.className),items:e.visibleOptions,autoSize:!0,onLazyLoad:function($){return e.virtualScrollerOptions.onLazyLoad(xx(xx({},$),{filter:e.filterValue}))},itemTemplate:function($,D){return $&&b($,D.index,D)},contentTemplate:function($){var D=$.children||[],z=e.hasFilter?e.emptyFilterMessage:e.emptyMessage,V=c||(D==null?void 0:D.length)===0?v(z):D,B=n({ref:$.contentRef,style:$.style,className:wr($.className,o("list",{virtualScrollerProps:e.virtualScrollerOptions})),role:"listbox","aria-label":Df("listLabel")},p("list"));return f.createElement("ul",B,V)}});return f.createElement(t1e,Dv({ref:e.virtualScrollerRef},T,{pt:r("virtualScroller")}))}var P=w(),E=n({className:o("wrapper"),style:i("wrapper")},p("wrapper")),M=n({className:o("list"),role:"listbox","aria-label":Df("listLabel")},p("list"));return f.createElement("div",E,f.createElement("ul",M,P))},j=function(){var T=C(),P=N(),E=y(),M=n({className:wr(e.panelClassName,o("panel",{context:s})),style:i("panel"),onClick:e.onClick,"data-pr-is-overlay":!0},p("panel")),R=n({classNames:o("transition"),in:e.in,timeout:{enter:120,exit:100},options:e.transitionOptions,unmountOnExit:!0,onEnter:h,onEntered:m,onExit:e.onExit,onExited:e.onExited},p("transition"));return f.createElement(e1e,Dv({nodeRef:t},R),f.createElement("div",Dv({ref:t},M),e.firstFocusableElement,T,P,E,e.lastFocusableElement))},I=j();return f.createElement(bY,{element:I,appendTo:e.appendTo})}));umt.displayName="DropdownPanel";function fpr(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ppr(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return s=u.done,u},e:function(u){l=!0,i=u},f:function(){try{s||n.return==null||n.return()}finally{if(l)throw i}}}}function ppr(e,t){if(e){if(typeof e=="string")return I8e(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I8e(e,t):void 0}}function I8e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n2&&arguments[2]!==void 0?arguments[2]:!0;zt({originalEvent:st,option:In}),Sr&&(qt(),Lt.focus(E.current))},ye=function(st){VR.emit("overlay-click",{originalEvent:st,target:j.current})},de=function(st){if(o.disabled){st.preventDefault();return}var In=Lt.isAndroid()?st.key:st.code;switch(In){case"ArrowDown":Qe(st);break;case"ArrowUp":lt(st);break;case"ArrowLeft":case"ArrowRight":bt(st,o.editable);break;case"Home":Ct(st);break;case"End":Je(st);break;case"PageDown":Me(st);break;case"PageUp":Pe(st);break;case"Space":et(st,o.editable);break;case"NumpadEnter":case"Enter":vt(st);break;case"Escape":Pt(st);break;case"Tab":Jt(st);break;case"Backspace":dn(st,o.editable);break;case"ShiftLeft":case"ShiftRight":break;default:var Sr=st.metaKey||st.ctrlKey||st.altKey;!Sr&&Nt.isPrintableCharacter(st.key)&&(!S&&!o.editable&&Ot(),!o.editable&&Ye(st,st.key));break}N.current=!1},Ne=function(st){switch(st.code){case"ArrowDown":Qe(st);break;case"ArrowUp":lt(st);break;case"ArrowLeft":case"ArrowRight":bt(st,!0);break;case"Enter":case"NumpadEnter":vt(st),st.preventDefault();break;case"Escape":Pt(st);break}},_e=function(){return Lt.getFocusableElements(I.current,':not([data-p-hidden-focusable="true"])').length>0},xe=function(st){var In;return we(st)&&((In=un(st))===null||In===void 0?void 0:In.toLocaleLowerCase(o.filterLocale).startsWith($.current.toLocaleLowerCase(o.filterLocale)))},we=function(st){return Nt.isNotEmpty(st)&&!(tr(st)||ar(st))},Te=function(){return Nt.isNotEmpty(o.value)},Re=function(st){return we(st)&&Zt(st)},Ue=function(){return Te?nr.findIndex(function(st){return Re(st)}):-1},He=function(){var st=Ue();return st<0?at():st},Ye=function(st,In){$.current=($.current||"")+In;var Sr=-1,ei=!1;return Nt.isNotEmpty($.current)&&(x!==-1?(Sr=nr.slice(x).findIndex(function(No){return xe(No)}),Sr=Sr===-1?nr.slice(0,x).findIndex(function(No){return xe(No)}):Sr+x):Sr=nr.findIndex(function(No){return xe(No)}),Sr!==-1&&(ei=!0),Sr===-1&&x===-1&&(Sr=He()),Sr!==-1&&dt(st,Sr)),R.current&&clearTimeout(R.current),R.current=setTimeout(function(){$.current="",R.current=null},500),ei},We=function(){var st=Ue();return st<0?Oe():st},at=function(){return nr.findIndex(function(st){return we(st)})},Oe=function(){return Nt.findLastIndex(nr,function(st){return we(st)})},Ae=function(st){var In=st-1?In+st+1:st},qe=function(st){var In=st>0?Nt.findLastIndex(nr.slice(0,st),function(Sr){return we(Sr)}):-1;return In>-1?In:st},dt=function(st,In){x!==In&&(v(In),Ze(In),o.selectOnFocus&&ge(st,nr[In],!1))},Ze=function(st){var In=Lt.findSingle(I.current,'li[id="dropdownItem_'.concat(st,'"]'));In&&In.focus()},Qe=function(st){if(!S)Ot(),o.editable&&dt(st,Ue());else{var In=x!==-1?Ae(x):N.current?at():He();dt(st,In)}st.preventDefault()},lt=function(st){var In=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(st.altKey&&!In)x!==-1&&ge(st,nr[x]),state.overlayVisible&&qt(),st.preventDefault();else{var Sr=x!==-1?qe(x):N.current?Oe():We();dt(st,Sr),!S&&Ot(),st.preventDefault()}},bt=function(st){var In=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;In&&v(-1)},Ct=function(st){var In=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;In?(st.currentTarget.setSelectionRange(0,0),v(-1)):(dt(st,at()),!S&&Ot()),st.preventDefault()},Je=function(st){var In=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(In){var Sr=st.currentTarget,ei=Sr.value.length;Sr.setSelectionRange(ei,ei),v(-1)}else dt(st,Oe()),!S&&Ot();st.preventDefault()},Pe=function(st){st.preventDefault()},Me=function(st){st.preventDefault()},et=function(st){var In=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;!In&&vt(st)},vt=function(st){if(st.preventDefault(),!S)v(-1),Qe(st);else{if(x===-1)return;var In=nr[x],Sr=xn(In);if(Sr==null||Sr==null){qt(),Vt(),rn(or);return}ge(st,In)}},Pt=function(st){S&&qt(),st.preventDefault()},Jt=function(st){var In=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;In||(S&&!_e()?(Lt.focus(_.current),st.preventDefault()):(x!==-1&&ge(st,nr[x]),S&&qt()))},dn=function(st){var In=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;st&&In&&!S&&Ot()},Et=function(st,In){if(!In||!(st!=null&&st.length))return-1;var Sr=In.toLocaleLowerCase(),ei=st.findIndex(function(No){return un(No).toLocaleLowerCase()===Sr});return ei!==-1?ei:st.findIndex(function(No){return un(No).toLocaleLowerCase().startsWith(Sr)})},sn=function(st){!S&&Ot();var In=null;st.target.value&&nr&&(In=Et(nr,st.target.value)),v(In),o.onChange&&o.onChange({originalEvent:st.originalEvent,value:st.target.value,stopPropagation:function(){st.originalEvent.stopPropagation()},preventDefault:function(){st.originalEvent.preventDefault()},target:{name:o.name,id:o.id,value:st.target.value}})},ot=function(st){m(!0),qt(),o.onFocus&&o.onFocus(st)},mt=function(st){var In=st.option;In.disabled||(zt(st),Lt.focus(E.current)),qt()},Ht=function(st){var In=st.target.value;u(In),o.onFilter&&o.onFilter({originalEvent:st,filter:In})},jt=function(st){Vt(st)},Vt=function(st){u(""),o.onFilter&&o.onFilter({filter:""}),st&&st()},nn=function(st){o.onChange&&o.onChange({originalEvent:st,value:void 0,stopPropagation:function(){st==null||st.stopPropagation()},preventDefault:function(){st==null||st.preventDefault()},target:{name:o.name,id:o.id,value:void 0}}),o.filter&&Vt(),rn(),v(-1)},zt=function(st){if(or!==st.option){rn(st.option),v(-1);var In=xn(st.option),Sr=ur(st.option,nr);o.onChange&&o.onChange({originalEvent:st.originalEvent,value:In,stopPropagation:function(){st.originalEvent.stopPropagation()},preventDefault:function(){st.originalEvent.preventDefault()},target:{name:o.name,id:o.id,value:In}}),dt(st.originalEvent,Sr)}},Nn=function(st){if(st=st||nr,st)if(o.optionGroupLabel)for(var In=0;In=0)&&Tt()},[S,o.value,x]),js(function(){S&&c&&o.filter&&xt()},[S,c,o.filter]),js(function(){M.current&&M.current.scrollInView(0)},[c]),js(function(){it(),P.current&&(P.current.selectedIndex=1)}),Nm(function(){Qx.clear(I.current)});var _t=function(){var st={value:"",label:o.placeholder};if(or){var In=xn(or);st={value:$T(In)==="object"?o.options.findIndex(function(Ha){return Ha===In}):In,label:un(or)}}var Sr=n({className:"p-hidden-accessible p-dropdown-hidden-select"},G("hiddenSelectedMessage")),ei=n({ref:P,required:o.required,defaultValue:st.value,name:o.name,tabIndex:-1},G("select")),No=n({value:st.value},G("option"));return f.createElement("div",Sr,f.createElement("select",ei,f.createElement("option",No,st.label)))},gt=function(){var st=Nt.isNotEmpty(or)?un(or):null;o.editable&&(st=st||o.value||"");var In=n({className:"p-hidden-accessible"},G("hiddenSelectedMessage")),Sr=n(yx({ref:E,id:o.inputId,defaultValue:st,type:"text",readOnly:!0,"aria-haspopup":"listbox",onFocus:fe,onBlur:se,onKeyDown:de,disabled:o.disabled,tabIndex:o.disabled?-1:o.tabIndex||0},er),G("input"));return f.createElement("div",In,f.createElement("input",Sr))},hn=function(){var st=Nt.isNotEmpty(or)?un(or):null;if(o.editable){var In=st||o.value||"",Sr=n(yx({ref:P,type:"text",defaultValue:In,className:H("input",{label:st}),disabled:o.disabled,placeholder:o.placeholder,maxLength:o.maxLength,onInput:sn,onFocus:ot,onKeyDown:de,onBlur:se,tabIndex:o.disabled?-1:o.tabIndex||0,"aria-haspopup":"listbox"},er),G("input"));return f.createElement("input",Sr)}var ei=o.valueTemplate?Nt.getJSXElement(o.valueTemplate,or,o):st||o.placeholder||o.emptyMessage||f.createElement(f.Fragment,null," "),No=n({ref:P,className:H("input",{label:st}),tabIndex:"-1"},G("input"));return f.createElement("span",No,ei)},Vn=function(st){(st.key==="Enter"||st.code==="Space")&&(nn(st),st.preventDefault())},Jn=function(){if(o.value!=null&&o.showClear&&!o.disabled&&!Nt.isEmpty(o.options)){var st=n({className:H("clearIcon"),onPointerUp:nn,tabIndex:o.editable?-1:o.tabIndex||"0",onKeyDown:Vn,"aria-label":Zh("clear")},G("clearIcon")),In=o.clearIcon||f.createElement(SY,st);return el.getJSXIcon(In,yx({},st),{props:o})}return null},Fr=function(){var st=n({className:H("loadingIcon"),"data-pr-overlay-visible":S},G("loadingIcon")),In=o.loadingIcon||f.createElement(j6,{spin:!0}),Sr=el.getJSXIcon(In,yx({},st),{props:o}),ei=o.placeholder||o.ariaLabel,No=n({className:H("trigger"),role:"button","aria-haspopup":"listbox","aria-expanded":S,"aria-label":ei},G("trigger"));return f.createElement("div",No,Sr)},po=function(){var st=n({className:H("dropdownIcon"),"data-pr-overlay-visible":S},G("dropdownIcon")),In=S?o.collapseIcon||f.createElement(imt,st):o.dropdownIcon||f.createElement(wY,st),Sr=el.getJSXIcon(In,yx({},st),{props:o}),ei=o.placeholder||o.ariaLabel,No=n({className:H("trigger"),role:"button","aria-haspopup":"listbox","aria-expanded":S,"aria-label":ei},G("trigger"));return f.createElement("div",No,Sr)},nr=re(),or=Mt(),Or=Nt.isNotEmpty(o.tooltip),Tn=q7.getOtherProps(o),er=Nt.reduceKeys(Tn,Lt.ARIA_PROPS),Lo=_t(),Fo=gt(),Ao=hn(),uo=o.loading?Fr():po(),Wi=Jn(),Jr=n({id:o.id,ref:j,className:wr(o.className,H("root",{context:r,focusedState:h,overlayVisibleState:S})),style:o.style,onClick:function(st){return ue(st)},onMouseDown:o.onMouseDown,onContextMenu:o.onContextMenu,onFocus:Kt,"data-p-disabled":o.disabled,"data-p-focus":h,"aria-activedescendant":h?"dropdownItem_".concat(x):void 0},Tn,G("root")),hs=n({ref:_,role:"presentation",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:ce,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},G("hiddenFirstFocusableEl")),zr=n({ref:T,role:"presentation",className:"p-hidden-accessible p-hidden-focusable",tabIndex:"0",onFocus:ae,"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0},G("hiddenLastFocusableEl"));return f.createElement(f.Fragment,null,f.createElement("div",Jr,Fo,Lo,Ao,Wi,uo,f.createElement(umt,Dv({hostName:"Dropdown",ref:I,visibleOptions:nr,virtualScrollerRef:M},o,{appendTo:V,cx:H,filterValue:l,focusedOptionIndex:x,getOptionGroupChildren:ke,getOptionGroupLabel:Le,getOptionGroupRenderKey:jn,getOptionLabel:un,getOptionRenderKey:Kn,getSelectedOptionIndex:Nn,hasFilter:z,in:S,isOptionDisabled:tr,isSelected:Zt,onOverlayHide:qt,onClick:ye,onEnter:gn,onEntered:An,onExit:pt,onExited:nt,onFilterClearIconClick:jt,onFilterInputChange:Ht,onFilterInputKeyDown:Ne,onOptionClick:mt,onInputKeyDown:de,ptm:G,resetFilter:Vt,changeFocusedOptionIndex:dt,firstFocusableElement:f.createElement("span",hs),lastFocusableElement:f.createElement("span",zr),sx:F}))),Or&&f.createElement(dN,Dv({target:j,content:o.tooltip,pt:G("tooltip")},o.tooltipOptions)))}));vW.displayName="Dropdown";function hpr(e){if(Array.isArray(e))return e}function mpr(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,o=d}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw o}}return l}}function P8e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0?n.page+1:0,s=f.createElement(tmt,{value:i,onChange:o,className:"p-paginator-page-input",disabled:n.disabled,pt:n.ptm("JTPInput"),unstyled:n.unstyled,__parentMetadata:{parent:n.metaData},"aria-label":r});if(n.template){var l={value:i,onChange:o,disabled:n.disabled,className:"p-paginator-page-input","aria-label":r,element:s,props:n};return Nt.getJSXElement(n.template,l)}return s});hmt.displayName="JumpToPageInput";function M8e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function $pr(e){for(var t=1;t0,o=r?n.options.map(function(u){return{label:String(u),value:u}}):[],i=Zh("choose"),s=pmt("jumpToPageDropdownLabel"),l=r?f.createElement(f.Fragment,null,f.createElement(vW,{value:n.value,options:o,onChange:n.onChange,appendTo:n.appendTo,disabled:n.disabled,placeholder:i,"aria-label":s,pt:n.ptm("RPPDropdown"),unstyled:n.unstyled,__parentMetadata:{parent:n.metaData}})):null;if(n.template){var c={value:n.value,options:o,onChange:n.onChange,appendTo:n.appendTo,currentPage:n.page,totalPages:n.pageCount,totalRecords:n.totalRecords,disabled:n.disabled,ariaLabel:s,element:l,props:n};return Nt.getJSXElement(n.template,c)}return l});vmt.displayName="RowsPerPageDropdown";function $8e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Fpr(e){for(var t=1;t=0&&W0&&o.first>=o.totalRecords&&b((h-1)*o.rows,o.rows)},[o.totalRecords]);var _=function(G,H){var F;switch(G){case"FirstPageLink":F=f.createElement(fmt,{hostName:"Paginator",key:G,page:p,totalPages:h,totalRecords:o.totalRecords,rows:o.rows,onClick:w,disabled:m||y,template:H,firstPageLinkIcon:o.firstPageLinkIcon,ptm:l,cx:c});break;case"PrevPageLink":F=f.createElement(ymt,{hostName:"Paginator",key:G,page:p,totalPages:h,totalRecords:o.totalRecords,rows:o.rows,onClick:S,disabled:m||y,template:H,prevPageLinkIcon:o.prevPageLinkIcon,ptm:l,cx:c});break;case"NextPageLink":F=f.createElement(gmt,{hostName:"Paginator",key:G,page:p,totalPages:h,totalRecords:o.totalRecords,rows:o.rows,onClick:N,disabled:g||y,template:H,nextPageLinkIcon:o.nextPageLinkIcon,ptm:l,cx:c});break;case"LastPageLink":F=f.createElement(mmt,{hostName:"Paginator",key:G,page:p,totalPages:h,totalRecords:o.totalRecords,rows:o.rows,onClick:j,disabled:g||y,template:H,lastPageLinkIcon:o.lastPageLinkIcon,ptm:l,cx:c});break;case"PageLinks":F=f.createElement(xmt,{hostName:"Paginator",key:G,page:p,totalPages:h,totalRecords:o.totalRecords,rows:o.rows,value:v(),onClick:C,template:H,ptm:l,cx:c});break;case"RowsPerPageDropdown":F=f.createElement(vmt,{hostName:"Paginator",key:G,value:o.rows,page:p,totalPages:h,totalRecords:o.totalRecords,options:o.rowsPerPageOptions,onChange:I,appendTo:o.dropdownAppendTo,template:H,disabled:y,unstyled:o.unstyled,ptm:l,cx:c,metaData:i});break;case"CurrentPageReport":F=f.createElement(dmt,{hostName:"Paginator",reportTemplate:o.currentPageReportTemplate,key:G,page:p,totalPages:h,totalRecords:o.totalRecords,rows:o.rows,first:o.first,template:H,ptm:l});break;case"JumpToPageInput":F=f.createElement(hmt,{hostName:"Paginator",key:G,rows:o.rows,page:p,totalPages:h,onChange:b,disabled:y,template:H,ptm:l,unstyled:o.unstyled,metaData:i});break;default:F=null;break}return F},T=function(){var G=o.template;return G?DT(G)==="object"?G.layout?G.layout.split(" ").map(function(H){var F=H.trim();return _(F,G[F])}):Object.entries(G).map(function(H){var F=ypr(H,2),W=F[0],U=F[1];return _(W,U)}):G.split(" ").map(function(H){return _(H.trim())}):null};if(!o.alwaysShow&&h<=1)return null;var P=Nt.getJSXElement(o.leftContent,o),E=Nt.getJSXElement(o.rightContent,o),M=T(),R=n({className:c("left")},l("left")),$=P&&f.createElement("div",R,P),D=n({className:c("end")},l("end")),z=E&&f.createElement("div",D,E),V=n({ref:d,className:wr(o.className,c("root")),style:o.style},K7.getOtherProps(o),l("root"));return f.createElement("div",V,$,M,z)}));bmt.displayName="Paginator";function qfe(){return qfe=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=Array(t);n .p-datatable-wrapper { overflow: auto; } .p-datatable-table { border-spacing: 0px; width: 100%; } .p-datatable .p-sortable-disabled { cursor: auto; } .p-datatable .p-sortable-column { cursor: pointer; user-select: none; } .p-datatable .p-sortable-column .p-column-title, .p-datatable .p-sortable-column .p-sortable-column-icon, .p-datatable .p-sortable-column .p-sortable-column-badge { vertical-align: middle; } .p-datatable .p-sortable-column .p-sortable-column-badge { display: inline-flex; align-items: center; justify-content: center; } .p-datatable-selectable .p-selectable-row, .p-datatable-selectable-cell .p-selectable-cell { cursor: pointer; } .p-datatable-drag-selection-helper { position: absolute; z-index: 99999999; } /* Scrollable */ .p-datatable-scrollable > .p-datatable-wrapper { position: relative; } .p-datatable-scrollable-table > .p-datatable-thead { position: sticky; top: 0; z-index: 2; } .p-datatable.p-datatable-gridlines .p-datatable-scrollable-table > .p-datatable-thead { top: -1px; } .p-datatable-scrollable-table > .p-datatable-frozen-tbody { position: sticky; z-index: 1; } .p-datatable-scrollable-table > .p-datatable-tfoot { position: sticky; bottom: 0; z-index: 1; } .p-datatable-scrollable .p-frozen-column { position: sticky; background: inherit; } .p-datatable-scrollable th.p-frozen-column { z-index: 1; } .p-datatable-flex-scrollable { display: flex; flex-direction: column; height: 100%; } .p-datatable-flex-scrollable > .p-datatable-wrapper { display: flex; flex-direction: column; flex: 1; height: 100%; } .p-datatable-scrollable-table > .p-datatable-tbody > .p-rowgroup-header { position: sticky; z-index: 1; } /* Resizable */ .p-datatable-resizable-table > .p-datatable-thead > tr > th, .p-datatable-resizable-table > .p-datatable-tfoot > tr > td, .p-datatable-resizable-table > .p-datatable-tbody > tr > td { overflow: hidden; white-space: nowrap; } .p-datatable-resizable-table > .p-datatable-thead > tr > th.p-resizable-column:not(.p-frozen-column) { background-clip: padding-box; position: relative; } .p-datatable-resizable-table-fit > .p-datatable-thead > tr > th.p-resizable-column:last-child .p-column-resizer { display: none; } .p-datatable .p-column-resizer { display: block; position: absolute; top: 0; right: 0; margin: 0; width: 0.5rem; height: 100%; padding: 0px; cursor: col-resize; border: 1px solid transparent; } .p-datatable .p-column-header-content { display: flex; align-items: center; } .p-datatable .p-column-resizer-helper { width: 1px; position: absolute; z-index: 10; display: none; } .p-datatable .p-row-editor-init, .p-datatable .p-row-editor-save, .p-datatable .p-row-editor-cancel { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; position: relative; } /* Expand */ .p-datatable .p-row-toggler { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; position: relative; } /* Reorder */ .p-datatable-reorder-indicator-up, .p-datatable-reorder-indicator-down { position: absolute; display: none; } .p-reorderable-column, .p-datatable-reorderablerow-handle { cursor: move; } /* Loader */ .p-datatable .p-datatable-loading-overlay { position: absolute; display: flex; align-items: center; justify-content: center; z-index: 2; } /* Filter */ .p-column-filter-row { display: flex; align-items: center; width: 100%; } .p-column-filter-menu { display: inline-flex; margin-left: auto; } .p-column-filter-row .p-column-filter-element { flex: 1 1 auto; width: 1%; } .p-column-filter-menu-button, .p-column-filter-clear-button { display: inline-flex; justify-content: center; align-items: center; cursor: pointer; text-decoration: none; overflow: hidden; position: relative; } .p-column-filter-overlay { position: absolute; top: 0; left: 0; } .p-column-filter-row-items { margin: 0; padding: 0; list-style: none; } .p-column-filter-row-item { cursor: pointer; } .p-column-filter-add-button, .p-column-filter-remove-button { justify-content: center; } .p-column-filter-add-button .p-button-label, .p-column-filter-remove-button .p-button-label { flex-grow: 0; } .p-column-filter-buttonbar { display: flex; align-items: center; justify-content: space-between; } .p-column-filter-buttonbar .p-button:not(.p-button-icon-only) { width: auto; } /* Responsive */ .p-datatable .p-datatable-tbody > tr > td > .p-column-title { display: none; } /* VirtualScroller */ .p-datatable-virtualscroller-spacer { display: flex; } .p-datatable .p-virtualscroller .p-virtualscroller-loading { transform: none; min-height: 0; position: sticky; top: 0; left: 0; } /* Alignment */ .p-datatable .p-datatable-thead > tr > th.p-align-left > .p-column-header-content, .p-datatable .p-datatable-tbody > tr > td.p-align-left, .p-datatable .p-datatable-tfoot > tr > td.p-align-left { text-align: left; justify-content: flex-start; } .p-datatable .p-datatable-thead > tr > th.p-align-right > .p-column-header-content, .p-datatable .p-datatable-tbody > tr > td.p-align-right, .p-datatable .p-datatable-tfoot > tr > td.p-align-right { text-align: right; justify-content: flex-end; } .p-datatable .p-datatable-thead > tr > th.p-align-center > .p-column-header-content, .p-datatable .p-datatable-tbody > tr > td.p-align-center, .p-datatable .p-datatable-tfoot > tr > td.p-align-center { text-align: center; justify-content: center; } } `,thr={root:function(t){var n=t.props,r=t.selectable;return wr("p-datatable p-component",{"p-datatable-hoverable-rows":n.rowHover,"p-datatable-selectable":r&&!n.cellSelection,"p-datatable-selectable-cell":r&&n.cellSelection,"p-datatable-resizable":n.resizableColumns,"p-datatable-resizable-fit":n.resizableColumns&&n.columnResizeMode==="fit","p-datatable-scrollable":n.scrollable,"p-datatable-flex-scrollable":n.scrollable&&n.scrollHeight==="flex","p-datatable-responsive-stack":n.responsiveLayout==="stack","p-datatable-responsive-scroll":n.responsiveLayout==="scroll","p-datatable-striped":n.stripedRows,"p-datatable-gridlines":n.showGridlines,"p-datatable-grouped-header":n.headerColumnGroup!=null,"p-datatable-grouped-footer":n.footerColumnGroup!=null,"p-datatable-sm":n.size==="small","p-datatable-lg":n.size==="large"})},loadingIcon:"p-datatable-loading-icon",loadingOverlay:"p-datatable-loading-overlay p-component-overlay",header:"p-datatable-header",wrapper:"p-datatable-wrapper",table:function(t){var n=t.props;return wr("p-datatable-table",{"p-datatable-scrollable-table":n.scrollable,"p-datatable-resizable-table":n.resizableColumns,"p-datatable-resizable-table-fit":n.resizableColumns&&n.columnResizeMode==="fit"})},thead:"p-datatable-thead",tfoot:"p-datatable-tfoot",footer:"p-datatable-footer",checkIcon:"p-checkbox-icon",resizeHelper:"p-column-resizer-helper",reorderIndicatorUp:"p-datatable-reorder-indicator-up",reorderIndicatorDown:"p-datatable-reorder-indicator-down",paginator:function(t){var n=t.position;return wr("p-paginator-"+n)},bodyCell:function(t){var n=t.selectionMode,r=t.editor,o=t.editingState,i=t.frozen,s=t.cellSelected,l=t.align,c=t.bodyProps,u=t.getCellParams;return wr(Ya({"p-selection-column":n!==null,"p-editable-column":r,"p-cell-editing":r&&o,"p-frozen-column":i,"p-selectable-cell":c.allowCellSelection&&c.isSelectable({data:u(),index:c.rowIndex}),"p-highlight":s},"p-align-".concat(l),!!l))},columnTitle:"p-column-title",bodyRow:function(t){var n=t.rowProps;return wr({"p-highlight":!n.allowCellSelection&&n.selected||n.contextMenuSelected,"p-highlight-contextmenu":n.contextMenuSelected,"p-selectable-row":n.allowRowSelection&&n.isSelectable({data:n.rowData,index:n.rowIndex}),"p-row-odd":n.rowIndex%2!==0})},rowGroupTogglerIcon:"p-row-toggler-icon",rowGroupToggler:"p-row-toggler p-link",rowGroupHeader:"p-rowgroup-header",rowGroupHeaderName:"p-rowgroup-header-name",rowGroupFooter:"p-rowgroup-footer",rowReorderIcon:"p-datatable-reorderablerow-handle",rowTogglerIcon:"p-row-toggler-icon",rowToggler:"p-row-toggler p-link",rowEditorSaveIcon:"p-row-editor-save-icon",rowEditorSaveButton:"p-row-editor-save p-link",rowEditorCancelIcon:"p-row-editor-cancel-icon",rowEditorCancelButton:"p-row-editor-cancel p-link",rowEditorInitIcon:"p-row-editor-init-icon",rowEditorInitButton:"p-row-editor-init p-link",rowExpansion:"p-datatable-row-expansion",virtualScrollerSpacer:function(t){var n=t.className;return n},tbody:function(t){var n=t.className;return n},filterInput:"p-fluid p-column-filter-element",filterMenuButton:function(t){var n=t.overlayVisibleState,r=t.hasFilter;return wr("p-column-filter-menu-button p-link",{"p-column-filter-menu-button-open":n,"p-column-filter-menu-button-active":r()})},headerFilterClearButton:function(t){var n=t.hasRowFilter;return wr("p-column-filter-clear-button p-link",{"p-hidden-space":!n()})},filterSeparator:"p-column-filter-separator",filterRowItem:function(t){var n=t.isRowMatchModeSelected,r=t.isShowMatchModes,o=t.value;return r()?wr("p-column-filter-row-item",{"p-highlight":o&&n(o)}):void 0},filterRowItems:"p-column-filter-row-items",filterOperator:"p-column-filter-operator",filterConstraints:"p-column-filter-constraints",filterConstraint:"p-column-filter-constraint",filterAddRule:"p-column-filter-add-rule",filterButtonBar:"p-column-filter-buttonbar",filterOverlay:function(t){var n=t.columnFilterProps,r=t.context,o=t.getColumnProp;return wr("p-column-filter-overlay p-component p-fluid",o("filterMenuClassName"),{"p-column-filter-overlay-menu":n.display==="menu","p-input-filled":r&&r.inputStyle==="filled"||ca.inputStyle==="filled","p-ripple-disabled":r&&r.ripple===!1||ca.ripple===!1})},columnFilter:function(t){var n=t.columnFilterProps;return wr("p-column-filter p-fluid",{"p-column-filter-row":n.display==="row","p-column-filter-menu":n.display==="menu"})},columnResizer:"p-column-resizer",emptyMessage:"p-datatable-emptymessage",sortBadge:"p-sortable-column-badge",sortIcon:"p-sortable-column-icon",headerTitle:"p-column-title",headerContent:"p-column-header-content",headerCell:function(t){var n=t.headerProps,r=t.frozen,o=t.sortMeta,i=t.align,s=t._isSortableDisabled,l=t.getColumnProp;return Nt.isEmpty(n)?wr("p-filter-column",{"p-frozen-column":r}):wr(Ya({"p-filter-column":!n.headerColumnGroup&&n.filterDisplay==="row","p-sortable-column":l("sortable"),"p-resizable-column":n.resizableColumns&&l("resizeable"),"p-highlight":o.sorted,"p-frozen-column":r,"p-selection-column":l("selectionMode"),"p-sortable-disabled":l("sortable")&&s,"p-reorderable-column":n.reorderableColumns&&l("reorderable")&&!r},"p-align-".concat(i),!!i))},footerCell:function(t){var n=t.getColumnProp,r=t.align;return wr(Ya({"p-frozen-column":n("frozen")},"p-align-".concat(r),!!r))},transition:"p-connected-overlay"},nhr={wrapper:{overflow:"auto"},resizeHelper:{display:"none"},reorderIndicatorUp:function(t){var n=t.style;return z8e({},n)},reorderIndicatorDown:function(t){var n=t.style;return z8e({},n)}},Q7=li.extend({defaultProps:{__TYPE:"DataTable",alwaysShowPaginator:!0,breakpoint:"960px",cellClassName:null,cellMemo:!0,cellMemoProps:["rowData","field","allowCellSelection","isCellSelected","editMode","index","tabIndex","editing","expanded","editingMeta","frozenCol","alignFrozenCol"],cellMemoPropsDepth:1,cellSelection:!1,checkIcon:null,className:null,collapsedRowIcon:null,columnResizeMode:"fit",compareSelectionBy:"deepEquals",contextMenuSelection:null,csvSeparator:",",currentPageReportTemplate:"({currentPage} of {totalPages})",customRestoreState:null,customSaveState:null,dataKey:null,defaultSortOrder:1,dragSelection:!1,editMode:null,editingRows:null,emptyMessage:null,expandableRowGroups:!1,expandedRowIcon:null,expandedRows:null,exportFilename:"download",exportFunction:null,filterClearIcon:null,filterDelay:300,filterDisplay:"menu",filterIcon:null,filterLocale:void 0,filters:null,first:0,footer:null,footerColumnGroup:null,frozenRow:!1,frozenValue:null,frozenWidth:null,globalFilter:null,globalFilterFields:null,globalFilterMatchMode:_u.CONTAINS,groupRowsBy:null,header:null,headerColumnGroup:null,id:null,isDataSelectable:null,lazy:!1,loading:!1,loadingIcon:null,metaKeySelection:!1,multiSortMeta:null,onAllRowsSelect:null,onAllRowsUnselect:null,onCellClick:null,onCellSelect:null,onCellUnselect:null,onColReorder:null,onColumnResizeEnd:null,onColumnResizerClick:null,onColumnResizerDoubleClick:null,onContextMenu:null,onContextMenuSelectionChange:null,onFilter:null,onPage:null,onRowClick:null,onRowCollapse:null,onRowDoubleClick:null,onRowEditCancel:null,onRowEditChange:null,onRowEditComplete:null,onRowEditInit:null,onRowEditSave:null,onRowExpand:null,onRowMouseEnter:null,onRowMouseLeave:null,onRowPointerDown:null,onRowPointerUp:null,onRowReorder:null,onRowSelect:null,onRowToggle:null,onRowUnselect:null,onSelectAllChange:null,onSelectionChange:null,onSort:null,onStateRestore:null,onStateSave:null,onValueChange:null,pageLinkSize:5,paginator:!1,paginatorClassName:null,paginatorDropdownAppendTo:null,paginatorLeft:null,paginatorPosition:"bottom",paginatorRight:null,paginatorTemplate:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown",removableSort:!1,reorderIndicatorDownIcon:null,reorderIndicatorUpIcon:null,reorderableColumns:!1,reorderableRows:!1,resizableColumns:!1,responsiveLayout:"scroll",rowClassName:null,rowEditValidator:null,rowEditorCancelIcon:null,rowEditorInitIcon:null,rowEditorSaveIcon:null,rowExpansionTemplate:null,rowGroupFooterTemplate:null,rowGroupHeaderTemplate:null,rowGroupMode:null,rowHover:!1,rows:null,rowsPerPageOptions:null,scrollHeight:null,scrollable:!1,selectAll:!1,selectOnEdit:!0,selection:null,selectionAriaLabel:null,selectionAutoFocus:!0,selectionMode:null,selectionPageOnly:!1,showGridlines:!1,showHeaders:!0,showRowReorderElement:null,showSelectAll:!0,showSelectionElement:null,size:"normal",sortField:null,sortIcon:null,sortMode:"single",sortOrder:null,stateKey:null,stateStorage:"session",stripedRows:!1,style:null,tabIndex:0,tableClassName:null,tableStyle:null,totalRecords:null,value:null,virtualScrollerOptions:null,children:void 0},css:{styles:ehr,classes:thr,inlineStyles:nhr}});function rhr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function r1e(e,t){if(e==null)return{};var n,r,o=rhr(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r0?o:1;return Nt.selectiveCompare(e,t,r,i)});Dmt.displayName="BodyCell";function G8e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function q8e(e){for(var t=1;t-1:e.groupRowsBy===Me:!1},y=function(Pe,Me){return e.compareSelectionBy==="equals"?Pe===Me:Nt.equals(Pe,Me,e.dataKey)},x=function(){return m()&&!e.allowCellSelection?e.rowIndex===0?e.tabIndex:-1:null},v=function(Pe,Me){return(Pe||[]).findIndex(function(et){return y(Me,et)})},b=function(Pe,Me){Pe&&Me&&(Pe.tabIndex=-1,Me.tabIndex=e.tabIndex)},w=function(Pe){var Me=Lt.findSingle(Pe.parentNode,"tr[data-p-selectable-row]");return Me||null},S=function(Pe){var Me=Pe.nextElementSibling;return Me?Lt.getAttribute(Me,"data-p-selectable-row")===!0?Me:S(Me):null},C=function(Pe){var Me=Pe.previousElementSibling;return Me?Lt.getAttribute(Me,"data-p-selectable-row")===!0?Me:C(Me):null},N=function(Pe){var Me=Lt.findSingle(Pe.parentNode,"tr[data-p-selectable-row]:last-child");return Me||null},j=function(Pe,Me,et){if(h(Me,"hidden"))return!1;if(e.rowGroupMode&&e.rowGroupMode==="rowspan"&&g(Me)){var vt=Pe[et-1];if(vt){var Pt=Nt.resolveFieldData(Pe[et],h(Me,"field")),Jt=Nt.resolveFieldData(vt,h(Me,"field"));return Pt!==Jt}}return!0},I=function(Pe,Me,et){if(g(Me)){for(var vt=Nt.resolveFieldData(Pe[et],h(Me,"field")),Pt=vt,Jt=0;vt===Pt;){Jt++;var dn=Pe[++et];if(dn)Pt=Nt.resolveFieldData(dn,h(Me,"field"));else break}return Jt===1?null:Jt}return null},_=function(Pe){e.onRowClick({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},T=function(Pe){e.onRowDoubleClick({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},P=function(Pe){e.onRowPointerDown({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},E=function(Pe){e.onRowPointerUp({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},M=function(Pe){e.onRowRightClick({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},R=function(Pe){e.onRowMouseEnter({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},$=function(Pe){e.onRowMouseLeave({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},D=function(Pe){e.onRowTouchEnd(Pe)},z=function(Pe){if(m()&&!e.allowCellSelection){var Me=Pe.target,et=Pe.currentTarget;switch(Pe.code){case"ArrowDown":V(et,Pe);break;case"ArrowUp":B(et,Pe);break;case"Home":G(et,Pe);break;case"End":H(et,Pe);break;case"Enter":case"NumpadEnter":F(et,Pe,Me);break;case"Space":W(et,Pe,Me);break;case"Tab":U(et,Pe);break}}},V=function(Pe,Me){var et=S(Pe);et&&(b(Pe,et),et.focus()),Me.preventDefault()},B=function(Pe,Me){var et=C(Pe);et&&(b(Pe,et),et.focus()),Me.preventDefault()},G=function(Pe,Me){var et=w(Pe);et&&(b(Pe,et),et.focus()),Me.preventDefault()},H=function(Pe,Me){var et=N(Pe);et&&(b(Pe,et),et.focus()),Me.preventDefault()},F=function(Pe,Me,et){Lt.isClickable(et)||(_(Me),Me.preventDefault())},W=function(Pe,Me,et){!Lt.isClickable(et)&&!et.readOnly&&(_(Me),Me.preventDefault())},U=function(Pe,Me){var et=Pe.parentNode,vt=Lt.find(et,'tr[data-p-selectable-row="true"]');if(Me.code==="Tab"&&vt&&vt.length>0){var Pt=Lt.findSingle(et,'tr[data-p-highlight="true"]'),Jt=Lt.findSingle(et,'tr[data-p-selectable-row="true"][tabindex="0"]');Pt?(Pt.tabIndex="0",Jt&&Jt!==Pt&&(Jt.tabIndex="-1")):(vt[0].tabIndex="0",Jt!==vt[0]&&(vt[e.rowIndex].tabIndex="-1"))}},K=function(Pe){e.onRowMouseDown({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},X=function(Pe){e.onRowMouseUp({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},J=function(Pe){e.onRowDragStart({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},te=function(Pe){e.onRowDragOver({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},re=function(Pe){e.onRowDragLeave({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},ce=function(Pe){e.onRowDragEnd({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},ae=function(Pe){e.onRowDrop({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},oe=function(Pe,Me){if(e.onRowEditChange){var et,vt=e.dataKey,Pt=Pe.originalEvent,Jt=Pe.data,dn=Pe.index,Et=Pe.newData;if(vt){var sn=String(Nt.resolveFieldData(Jt,vt));if(et=e.editingRows?q8e({},e.editingRows):{},Me)et[sn]=!0;else{delete et[sn];var ot=String(Nt.resolveFieldData(Et,vt));delete et[ot]}}else{var mt=v(e.editingRows,Jt);et=e.editingRows?Qc(e.editingRows):[],mt!==-1?et=et.filter(function(Ht,jt){return jt!==mt}):et.push(Jt)}e.onRowEditChange({originalEvent:Pt,data:et,index:dn})}else i(Me)},ue=function(Pe){var Me=Pe.originalEvent;e.onRowEditInit&&e.onRowEditInit({originalEvent:Me,data:e.rowData,index:e.rowIndex}),oe(Pe,!0),Me.preventDefault()},fe=function(Pe){var Me=Pe.originalEvent,et=Pe.newData,vt=e.rowEditValidator?e.rowEditValidator(et,{props:e.tableProps,rowIndex:e.rowIndex}):!0;e.onRowEditSave&&e.onRowEditSave({originalEvent:Me,data:e.rowData,index:e.rowIndex,newData:et,valid:vt}),vt&&(e.onRowEditComplete&&e.onRowEditComplete(Pe),oe(Pe,!1)),Me.preventDefault()},se=function(Pe){var Me=Pe.originalEvent;e.onRowEditCancel&&e.onRowEditCancel({originalEvent:Me,data:e.rowData,index:e.rowIndex}),oe(Pe,!1),Me.preventDefault()},ge=function(Pe){return e.compareSelectionBy==="equals"?Pe===e.rowData:Nt.equals(Pe,e.rowData,e.dataKey)},ye=function(Pe,Me,et){return Pe&&(Pe.rowIndex===e.rowIndex||ge(Pe.rowData))&&(Pe.field===Me||Pe.cellIndex===et)},de=function(Pe,Me,et){return(Pe||[]).findIndex(function(vt){return ye(vt,Me,et)})},Ne=function(Pe,Me,et){return Pe?Pe instanceof Array?de(Pe,Me,et)>-1:ye(Pe,Me,et):!1},_e=function(Pe){e.onCheckboxChange({originalEvent:Pe,data:e.rowData,index:e.rowIndex})},xe=e.dataKey&&e.rowData&&e.rowData[e.dataKey]||e.rowIndex,we=f.useCallback(function(Je){return e.virtualScrollerOptions?e.virtualScrollerOptions[Je]:null},[e.virtualScrollerOptions]),Te=function(){return e.editingMeta&&e.editingMeta[xe]?e.editingMeta[xe].data:e.rowData},Re=f.useCallback(function(Je,Pe){return e.allowCellSelection?Je?0:e.rowIndex===0&&Pe===0?e.tabIndex:-1:null},[e.allowCellSelection,e.rowIndex,e.tabIndex]),Ue=f.useCallback(function(Je){var Pe=Je.nextElementSibling;return Pe?Lt.getAttribute(Pe,"data-p-selectable-cell")?Pe:Ue(Pe):null},[]),He=f.useCallback(function(Je){var Pe=Je.previousElementSibling;return Pe?Lt.getAttribute(Pe,"data-p-selectable-cell")?Pe:He(Pe):null},[]),Ye=f.useCallback(function(Je,Pe){var Me=Je.parentElement.nextElementSibling,et=Me?Me.children[Pe]:null;return Me&&et?Lt.getAttribute(Me,"data-p-selectable-row")&&Lt.getAttribute(et,"data-p-selectable-cell")?et:Ye(et):null},[]),We=f.useCallback(function(Je,Pe){var Me=Je.parentElement.previousElementSibling,et=Me?Me.children[Pe]:null;return Me&&et?Lt.getAttribute(Me,"data-p-selectable-row")&&Lt.getAttribute(et,"data-p-selectable-cell")?et:We(et):null},[]),at=f.useCallback(function(Je,Pe,Me,et){clearTimeout(Je.current),Je.current=setTimeout(function(){if(Pe){var vt=e.editMode==="cell"?Lt.getFirstFocusableElement(Me.current,':not([data-pc-section="editorkeyhelperlabel"])'):Lt.findSingle(Me.current,'[data-p-row-editor-save="true"]');vt&&vt.focus()}et.current&&(et.current.tabIndex=Pe?-1:0)},1)},[e.editMode]),Oe=f.useCallback(function(Je,Pe){clearTimeout(Je.current),Je.current=setTimeout(function(){var Me=e.editMode==="row"?Lt.findSingle(Pe.current,'[data-p-row-editor-init="true"]'):null;Me&&Me.focus()},1)},[e.editMode]),Ae=f.useCallback(function(Je,Pe,Me,et,vt){if(Pe){var Pt=q8e({},et);if(Me==="right"){var Jt=0,dn=Je.current&&Je.current.nextElementSibling;dn&&dn.classList.contains("p-frozen-column")&&(Jt=Lt.getOuterWidth(dn)+parseFloat(dn.style.right||0)),Pt.right=Jt+"px"}else{for(var Et=0,sn=Je.current&&Je.current.previousElementSibling;sn;){if(sn.classList.contains("p-frozen-column")){Et=Lt.getOuterWidth(sn)+parseFloat(sn.style.left||0),Je.current.style.left=Et+"px";break}sn=sn.previousElementSibling}Pt.left=Et+"px"}var ot=et.left===Pt.left&&et.right===Pt.right;!ot&&vt(Pt)}},[]),qe=function(Pe,Me,et,vt,Pt,Jt,dn){if(e.editMode!=="row"&&et&&!vt&&(e.selectOnEdit||!e.selectOnEdit&&e.isRowSelected)){var Et=h(Jt,"onBeforeCellEditShow"),sn=h(Jt,"onCellEditInit"),ot=h(Jt,"cellEditValidatorEvent");if(Et&&(Et(Me)===!1||Pe&&Pe.defaultPrevented))return;setTimeout(function(){Pt(!0),!(sn&&(sn(Me)===!1||Pe&&Pe.defaultPrevented))&&ot==="click"&&dn()},1)}e.allowCellSelection&&e.onCellClick&&e.onCellClick(Me)},dt=function(){return e.columns.map(function(Pe,Me){if(j(e.value,Pe,e.index)){var et="".concat(e.rowIndex,"_").concat(h(Pe,"columnKey")||h(Pe,"field"),"_").concat(Me),vt=e.rowGroupMode==="rowspan"?I(e.value,Pe,e.index):null,Pt=h(Pe,"field")||"field_".concat(Me),Jt=function(ot){return Nt.resolveFieldData(ot||e.rowData,Pt)},dn=h(Pe,"selectionMode"),Et=t({hostName:e.hostName,allowCellSelection:e.allowCellSelection,cellMemo:e.cellMemo,cellMemoProps:e.cellMemoProps,cellMemoPropsDepth:e.cellMemoPropsDepth,cellClassName:e.cellClassName,checkIcon:e.checkIcon,collapsedRowIcon:e.collapsedRowIcon,field:Pt,resolveFieldData:Jt,column:Pe,cProps:e.colsProps[Me],dataKey:e.dataKey,editMode:e.editMode,editing:s,editingMeta:e.editingMeta,onEditingMetaChange:e.onEditingMetaChange,editingKey:xe,getEditingRowData:Te,expanded:e.expanded,expandedRowIcon:e.expandedRowIcon,frozenRow:e.frozenRow,frozenCol:h(Pe,"frozen"),alignFrozenCol:h(Pe,"alignFrozen"),index:Me,isSelectable:e.isSelectable,onCheckboxChange:_e,onClick:qe,onMouseDown:e.onCellMouseDown,onMouseUp:e.onCellMouseUp,onRadioChange:e.onRadioChange,onRowEditCancel:se,onRowEditInit:ue,onRowEditSave:fe,onRowToggle:e.onRowToggle,responsiveLayout:e.responsiveLayout,rowData:e.rowData,rowEditorCancelIcon:e.rowEditorCancelIcon,rowEditorInitIcon:e.rowEditorInitIcon,rowEditorSaveIcon:e.rowEditorSaveIcon,rowIndex:e.rowIndex,rowSpan:vt,selectOnEdit:e.selectOnEdit,isRowSelected:d,isCellSelected:Ne(e.selection,Pt,Me),selectionAriaLabel:e.tableProps.selectionAriaLabel,showRowReorderElement:e.showRowReorderElement,showSelectionElement:e.showSelectionElement,tabIndex:e.tabIndex,getTabIndex:Re,tableProps:e.tableProps,tableSelector:e.tableSelector,value:e.value,getVirtualScrollerOption:we,ptCallbacks:e.ptCallbacks,metaData:e.metaData,unstyled:e.unstyled,findNextSelectableCell:Ue,findPrevSelectableCell:He,findDownSelectableCell:Ye,findUpSelectableCell:We,focusOnElement:at,focusOnInit:Oe,updateStickyPosition:Ae});return f.createElement(f.Fragment,{key:et},dn?f.createElement($mt,Et):f.createElement(Dmt,Et))}return null})},Ze=Nt.getPropValue(e.rowClassName,e.rowData,{props:e.tableProps}),Qe={height:e.virtualScrollerOptions?e.virtualScrollerOptions.itemSize:void 0},lt=dt(),bt=x(),Ct=t({role:"row",tabIndex:bt,className:wr(u("bodyRow",{rowProps:e})),style:Qe,onMouseDown:function(Pe){return K(Pe)},onMouseUp:function(Pe){return X(Pe)},onMouseEnter:function(Pe){return R(Pe)},onMouseLeave:function(Pe){return $(Pe)},onClick:function(Pe){return _(Pe)},onDoubleClick:function(Pe){return T(Pe)},onPointerDown:function(Pe){return P(Pe)},onPointerUp:function(Pe){return E(Pe)},onContextMenu:function(Pe){return M(Pe)},onTouchEnd:function(Pe){return D(Pe)},onKeyDown:function(Pe){return z(Pe)},onDragStart:function(Pe){return J(Pe)},onDragOver:function(Pe){return te(Pe)},onDragLeave:function(Pe){return re(Pe)},onDragEnd:function(Pe){return ce(Pe)},onDrop:function(Pe){return ae(Pe)},"aria-selected":e!=null&&e.selectionMode?e.selected:null,"data-p-selectable-row":e.allowRowSelection&&e.isSelectable({data:e.rowData,index:e.rowIndex}),"data-p-highlight":e.selected,"data-p-highlight-contextmenu":e.contextMenuSelected},p("bodyRow"),{className:wr(Ze)});return f.createElement("tr",Ct,lt)});Lmt.displayName="BodyRow";function K8e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function chr(e){for(var t=1;t-1:z(Le,e.selection):!1},U=function(Le){return Le&&e.contextMenuSelection?z(Le,e.contextMenuSelection):!1},K=function(Le){return e.isDataSelectable?e.isDataSelectable(Le):!0},X=function(Le){if(Le&&e.expandedRows){if(E&&e.expandableRowGroups)return J(Le);if(e.dataKey){var ke=Nt.resolveFieldData(Le,e.dataKey),it=!1;return e.expandedRows&&(Array.isArray(e.expandedRows)?it=e.expandedRows.some(function(Mt){return Nt.resolveFieldData(Mt,e.dataKey)===ke}):it=e.expandedRows[ke]!==void 0),it}return xe(e.expandedRows,Le)!==-1}return!1},J=function(Le){return e.dataKey===e.groupRowsBy?Object.keys(e.expandedRows).some(function(ke){return Nt.equals(ke,Nt.resolveFieldData(Le,e.dataKey))}):e.expandedRows.some(function(ke){return Nt.equals(ke,Le,e.groupRowsBy)})},te=function(Le){return e.editMode==="row"&&Le&&e.editingRows?e.dataKey?e.editingRows?e.editingRows[Nt.resolveFieldData(Le,e.dataKey)]!==void 0:!1:xe(e.editingRows,Le)!==-1:!1},re=function(Le){return e.dragSelection&&G()&&!Le.originalEvent.shiftKey},ce=function(Le){return!ye()&&re(Le)||e.reorderableRows},ae=function(Le){return ye()&&re(Le)},oe=function(Le){return!Lt.isClickable(Le.originalEvent.target)},ue=f.useRef(e.metaKeySelection);f.useEffect(function(){ue.current=e.metaKeySelection},[e.metaKeySelection]);var fe=function(Le){return!I.current&&(!ue.current||ue.current&&(Le.originalEvent.metaKey||Le.originalEvent.ctrlKey))},se=function(Le){return G()&&Le.originalEvent.shiftKey&&S.current!==null},ge=function(){return(e.selectionMode||e.selectionModeInColumn)&&!H()&&!F()},ye=function(){return e.cellSelection&&!$&&!D},de=function(){return e.columns?e.columns.length:0},Ne=function(Le,ke){return Dc.getCProp(Le,ke)},_e=function(Le,ke){return ke=ke||e.virtualScrollerOptions,ke?ke[Le]:null},xe=function(Le,ke){return(Le||[]).findIndex(function(it){return z(ke,it)})},we=function(){return e.scrollable?{top:d.top}:null},Te=function(Le,ke){return e.dataKey?Nt.resolveFieldData(Le,e.dataKey):ke},Re=function(Le,ke,it){var Mt=Nt.resolveFieldData(ke,e.groupRowsBy),_t=Le[it-1];if(_t){var gt=Nt.resolveFieldData(_t,e.groupRowsBy);return!Nt.deepEquals(Mt,gt)}return!0},Ue=function(Le,ke,it,Mt){if(e.expandableRowGroups&&!Mt)return!1;var _t=Nt.resolveFieldData(ke,e.groupRowsBy),gt=Le[it+1];if(gt){var hn=Nt.resolveFieldData(gt,e.groupRowsBy);return!Nt.deepEquals(_t,hn)}return!0},He=function(){x.current.style.top=Lt.getOuterHeight(x.current.previousElementSibling)+"px"},Ye=function(){var Le=Lt.getOuterHeight(x.current.previousElementSibling),ke=Le+"px";d.top!==ke&&p({top:ke})},We=f.useRef(e.selection);f.useEffect(function(){We.current=e.selection},[e.selection]);var at=function(Le){var ke=Le.originalEvent,it=Le.data,Mt=Le.index,_t=Le.toggleable,gt=Le.type;if(K({data:it,index:Mt})){var hn=W(it),Vn=We.current||[],Jn=Vn;hn?_t&&(Jn=null,lt({originalEvent:ke,data:it,type:gt})):(Jn=it,Qe({originalEvent:ke,data:it,type:gt})),Ct(ke,!0),e.onSelectionChange&&Jn!==Vn&&e.onSelectionChange({originalEvent:ke,value:Jn,type:gt})}},Oe=function(Le){var ke=Le.originalEvent,it=Le.data,Mt=Le.index,_t=Le.toggleable,gt=Le.type;if(K({data:it,index:Mt})){var hn=W(it),Vn=We.current||[],Jn=Vn;if(hn)if(_t){var Fr=xe(Vn,it);Jn=Vn.filter(function(po,nr){return nr!==Fr}),lt({originalEvent:ke,data:it,type:gt})}else Vn.length&&(Vn.forEach(function(po){return lt({originalEvent:ke,data:po,type:gt})}),Jn=[it],Qe({originalEvent:ke,data:it,type:gt}));else Jn=Nt.isObject(Vn)?[Vn]:Vn,Jn=_t&&G()?[].concat(Qc(Jn),[it]):[it],Qe({originalEvent:ke,data:it,type:gt});e.onSelectionChange&&Jn!==Vn&&e.onSelectionChange({originalEvent:ke,value:Jn,type:gt})}},Ae=function(Le,ke){Lt.clearSelection(),N.current=ye()?Le.rowIndex:Le.index;var it=qe(Le);e.onSelectionChange&&it!==e.selection&&e.onSelectionChange({originalEvent:Le.originalEvent,value:it,type:ke}),S.current=N.current,C.current=Le.cellIndex},qe=function(Le){var ke,it,Mt=ye();return N.current>S.current?(ke=S.current,it=N.current):N.currentC.current?(Mt=C.current,_t=gt):gt td":"tr",gt=Lt.findSingle(x.current,"".concat(_t,'[tabindex="').concat(e.tabIndex,'"]'));gt&&it&&(gt.tabIndex=-1,it.tabIndex=e.tabIndex)}},Pe=function(Le){if(!(Le.defaultPrevented||Le.originalEvent&&Le.originalEvent.defaultPrevented||ye()||!oe(Le))){if(e.onRowClick&&e.onRowClick(Le),ge()){if(se(Le))Ae(Le,"row");else{var ke=$||D||fe(Le);S.current=Le.index,N.current=Le.index,j.current=e.first,B()?at(zm(zm({},Le),{},{toggleable:ke,type:"row"})):Oe(zm(zm({},Le),{},{toggleable:ke,type:"row"}))}Je(Le.originalEvent,"row")}else Ct(Le.originalEvent);I.current=!1}},Me=function(Le){var ke=Le.originalEvent;Lt.isClickable(ke.target)||e.onRowDoubleClick&&e.onRowDoubleClick(Le)},et=function(Le){var ke=Le.originalEvent;Lt.isClickable(ke.target)||e.onRowPointerDown&&e.onRowPointerDown(Le)},vt=function(Le){var ke=Le.originalEvent;Lt.isClickable(ke.target)||e.onRowPointerUp&&e.onRowPointerUp(Le)},Pt=function(Le){if(e.onContextMenu||e.onContextMenuSelectionChange){var ke=Nt.isNotEmpty(e.selection),it=Le.data;ke&&Lt.clearSelection(),e.onContextMenuSelectionChange&&e.onContextMenuSelectionChange({originalEvent:Le.originalEvent,value:it,index:Le.index}),e.onContextMenu&&e.onContextMenu({originalEvent:Le.originalEvent,data:it,index:Le.index}),Le.originalEvent.preventDefault()}},Jt=function(Le){e.onRowMouseEnter&&e.onRowMouseEnter(Le)},dn=function(Le){e.onRowMouseLeave&&e.onRowMouseLeave(Le)},Et=function(){I.current=!0},sn=function(Le){var ke=Le.originalEvent,it=l()?Lt.getAttribute(ke.target,"data-pc-section")==="rowreordericon"||ke.target.closest('[data-pc-section="rowreordericon"]'):Lt.hasClass(ke.target,"p-datatable-reorderablerow-handle")||ke.target.closest(".p-datatable-reorderablerow-handle");ke.currentTarget.draggable=it,ce(Le)&&(bt(ke),S.current=Le.index,N.current=Le.index,j.current=e.first)},ot=function(Le){var ke=Le.index===S.current;ce(Le)&&!ke&&Ae(Le,"row")},mt=f.useRef(e.expandedRows);f.useEffect(function(){mt.current=e.expandedRows},[e.expandedRows]);var Ht=function(Le){var ke,it=e.dataKey,Mt=e.groupRowsBy?it===e.groupRowsBy:!!it;if(Mt){var _t=String(Nt.resolveFieldData(Le.data,it));ke=mt.current?zm({},mt.current):{},ke[_t]!=null?(delete ke[_t],e.onRowCollapse&&e.onRowCollapse({originalEvent:Le,data:Le.data})):(ke[_t]=!0,e.onRowExpand&&e.onRowExpand({originalEvent:Le,data:Le.data}))}else{var gt=xe(mt.current,Le.data);ke=mt.current?Qc(mt.current):[],gt!==-1?(ke=ke.filter(function(hn,Vn){return Vn!==gt}),e.onRowCollapse&&e.onRowCollapse({originalEvent:Le,data:Le.data})):(ke.push(Le.data),e.onRowExpand&&e.onRowExpand({originalEvent:Le,data:Le.data}))}e.onRowToggle&&e.onRowToggle({data:ke})},jt=function(Le){var ke=Le.originalEvent,it=Le.index;ce(Le)&&(_.current=!0,T.current=it,ke.dataTransfer.setData("text","b"))},Vt=function(Le){var ke=Le.originalEvent,it=Le.index;if(_.current){if(T.current!==it){var Mt=ke.currentTarget,_t=Lt.getOffset(Mt).top+Lt.getWindowScrollTop(),gt=ke.pageY+window.scrollY,hn=_t+Lt.getOuterHeight(Mt)/2,Vn=Mt.previousElementSibling;gtP.current?P.current:P.current===0?0:P.current-1,Mt=Qc(e.tableProps.value);Nt.reorderArray(Mt,T.current,it),e.onRowReorder&&e.onRowReorder({originalEvent:ke,value:Mt,dragIndex:T.current,dropIndex:it})}nn(Le),zt(Le),ke.preventDefault()},xr=function(Le){at(zm(zm({},Le),{},{toggleable:!0,type:"radio"}))},ur=function(Le){Oe(zm(zm({},Le),{},{toggleable:!0,type:"checkbox"}))},Zt=function(Le){var ke=w.current,it=ke.x,Mt=ke.y,_t=Le.clientX-it,gt=Le.clientY-Mt;gt<0&&(b.current.style.top="".concat(Le.pageY+5,"px")),_t<0&&(b.current.style.left="".concat(Le.pageX+5,"px")),b.current.style.height="".concat(Math.abs(gt),"px"),b.current.style.width="".concat(Math.abs(_t),"px"),Le.preventDefault()},Ot=function(){b.current&&(b.current.remove(),b.current=null),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",Ot)},qt=function(Le){if(oe(Le)){if(e.onCellClick&&e.onCellClick(Le),ye()){if(se(Le))Ae(Le,"cell");else{var ke=fe(Le),it=Le.originalEvent,Mt=r1e(Le,uhr);S.current=Le.rowIndex,N.current=Le.rowIndex,j.current=e.first,C.current=Le.cellIndex,B()?at({originalEvent:it,data:Mt,index:Le.rowIndex,toggleable:ke,type:"cell"}):Oe({originalEvent:it,data:Mt,index:Le.rowIndex,toggleable:ke,type:"cell"})}Je(Le.originalEvent,"cell")}I.current=!1}},Kt=function(Le){ae(Le)&&(bt(Le.originalEvent),S.current=Le.rowIndex,N.current=Le.rowIndex,j.current=e.first,C.current=Le.cellIndex)},gn=function(Le){var ke=Le.rowIndex===S.current&&Le.cellIndex===C.current;ae(Le)&&!ke&&Ae(Le,"cell")},An=function(){document.addEventListener("mousemove",Zt),document.addEventListener("mouseup",Ot),document.body.appendChild(b.current)},pt=function(){Ot()};f.useEffect(function(){e.frozenRow&&He(),e.scrollable&&e.rowGroupMode==="subheader"&&Ye()}),js(function(){e.paginator&&G()&&(S.current=null)},[e.first]),Nm(function(){e.dragSelection&&pt()});var nt=function(){if(!e.loading){var Le=de(),ke=Nt.getJSXElement(e.emptyMessage,{props:e.tableProps,frozen:e.frozenRow})||Zh("emptyMessage"),it=n({className:s("emptyMessage"),role:"row"},o("emptyMessage")),Mt=n({colSpan:Le,role:"cell"},y("root"),y("bodyCell"));return f.createElement("tr",it,f.createElement("td",Mt,ke))}return null},xt=function(Le,ke,it,Mt){if(E&&Re(e.value,Le,ke-e.first)){var _t=we(),gt=e.expandableRowGroups&&f.createElement(Fmt,{hostName:e.hostName,onClick:Ht,rowData:Le,expanded:it,expandedRowIcon:e.expandedRowIcon,collapsedRowIcon:e.collapsedRowIcon,ptCallbacks:e.ptCallbacks,metaData:e.metaData,unstyled:l()}),hn={index:ke,props:e.tableProps,customRendering:!1},Vn=Nt.getJSXElement(e.rowGroupHeaderTemplate,Le,hn);if(!hn.customRendering){var Jn=n({colSpan:Mt},y("root"),y("bodyCell")),Fr=n({className:s("rowGroupHeaderName")},o("rowGroupHeaderName"));Vn=f.createElement("td",Jn,gt,f.createElement("span",Fr,Vn))}var po=n({className:s("rowGroupHeader"),style:_t,role:"row"},o("rowGroupHeader"));return f.createElement("tr",po,Vn)}return null},Tt=function(Le,ke,it,Mt){if(!e.expandableRowGroups||Mt){var _t=V()?W(Le):!1,gt=U(Le),hn=ge(),Vn=ye(),Jn=te(Le);return f.createElement(Lmt,{hostName:e.hostName,allowCellSelection:Vn,allowRowSelection:hn,cellMemo:e.cellMemo,cellMemoProps:e.cellMemoProps,cellMemoPropsDepth:e.cellMemoPropsDepth,cellClassName:e.cellClassName,checkIcon:e.checkIcon,collapsedRowIcon:e.collapsedRowIcon,columns:e.columns,colsProps:g,compareSelectionBy:e.compareSelectionBy,contextMenuSelected:gt,dataKey:e.dataKey,editMode:e.editMode,editing:Jn,editingMeta:e.editingMeta,editingRows:e.editingRows,expanded:Mt,expandedRowIcon:e.expandedRowIcon,frozenRow:e.frozenRow,groupRowsBy:e.groupRowsBy,index:it,isSelectable:K,onCellClick:qt,onCellMouseDown:Kt,onCellMouseUp:gn,onCheckboxChange:ur,onEditingMetaChange:e.onEditingMetaChange,onRadioChange:xr,onRowClick:Pe,onRowDoubleClick:Me,onRowPointerDown:et,onRowPointerUp:vt,onRowDragEnd:zt,onRowDragLeave:nn,onRowDragOver:Vt,onRowDragStart:jt,onRowDrop:Nn,onRowEditCancel:e.onRowEditCancel,onRowEditChange:e.onRowEditChange,onRowEditComplete:e.onRowEditComplete,onRowEditInit:e.onRowEditInit,onRowEditSave:e.onRowEditSave,onRowMouseDown:sn,onRowMouseEnter:Jt,onRowMouseLeave:dn,onRowMouseUp:ot,onRowRightClick:Pt,onRowToggle:Ht,onRowTouchEnd:Et,responsiveLayout:e.responsiveLayout,rowClassName:e.rowClassName,rowData:Le,rowEditValidator:e.rowEditValidator,rowEditorCancelIcon:e.rowEditorCancelIcon,rowEditorInitIcon:e.rowEditorInitIcon,rowEditorSaveIcon:e.rowEditorSaveIcon,rowGroupMode:e.rowGroupMode,rowIndex:ke,selectOnEdit:e.selectOnEdit,selected:_t,selection:e.selection,selectionMode:e.selectionMode,selectionModeInColumn:e.selectionModeInColumn,showRowReorderElement:e.showRowReorderElement,showSelectionElement:e.showSelectionElement,tabIndex:e.tabIndex,tableProps:e.tableProps,tableSelector:e.tableSelector,value:e.value,virtualScrollerOptions:e.virtualScrollerOptions,ptCallbacks:e.ptCallbacks,metaData:e.metaData,unstyled:l()})}},rn=function(Le,ke,it,Mt){if(it&&!(E&&e.expandableRowGroups)){var _t="".concat(e.tableSelector,"_content_").concat(ke,"_expanded"),gt={index:ke,customRendering:!1},hn=Nt.getJSXElement(e.rowExpansionTemplate,Le,gt);if(!gt.customRendering){var Vn=n({colSpan:Mt,role:"cell"},y("root"),y("bodyCell"));hn=f.createElement("td",Vn,hn)}var Jn=n({id:_t,className:s("rowExpansion"),role:"row"},o("rowExpansion"));return f.createElement("tr",Jn,hn)}return null},un=function(Le,ke,it,Mt){if(E&&Ue(e.value,Le,ke-e.first,it)){var _t=Nt.getJSXElement(e.rowGroupFooterTemplate,Le,{index:ke,colSpan:Mt,props:e.tableProps}),gt=n({className:s("rowGroupFooter"),role:"row"},o("rowGroupFooter"));return f.createElement("tr",gt,_t)}return null},xn=function(){return e.value&&e.value.map(function(Le,ke){var it=_e("getItemOptions")?_e("getItemOptions")(ke).index:e.first+ke,Mt=Te(Le,it),_t=X(Le),gt=de(),hn=xt(Le,it,_t,gt),Vn=Tt(Le,it,ke,_t),Jn=rn(Le,it,_t,gt),Fr=un(Le,it,_t,gt);return f.createElement(f.Fragment,{key:Mt},hn,Vn,Jn,Fr)})},Kn=e.empty?nt():xn(),ar=e.className==="p-datatable-virtualscroller-spacer"?"virtualScrollerSpacer":"tbody",tr=n({style:e.style,className:s(ar,{className:e.className}),role:" rowgroup"},o(ar,{hostName:e.hostName}));return f.createElement("tbody",Cs({ref:v},tr),Kn)}));LB.displayName="TableBody";var dC=li.extend({defaultProps:{__TYPE:"ColumnGroup",children:void 0},getCProp:function(t,n){return Nt.getComponentProp(t,n,dC.defaultProps)},getCProps:function(t){return Nt.getComponentProps(t,dC.defaultProps)}}),fD=li.extend({defaultProps:{__TYPE:"Row",style:null,className:null,children:void 0},getCProp:function(t,n){return Nt.getComponentProp(t,n,fD.defaultProps)}});function X8e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function dhr(e){for(var t=1;t1},G=function(){return p("showAddButton")&&S&&S.operator&&We()&&We().length1&&arguments[1]!==void 0?arguments[1]:0,Kt=vx({},e.filters),gn=Kt[w];e.display==="menu"&&gn&&gn.operator?Kt[w].constraints[qt].value=Ot:Kt[w].value=Ot,e.onFilterChange(Kt)},bt=function(){for(var Ot=arguments.length,qt=new Array(Ot),Kt=0;Kt1},S=function(){return!C("sortable")||C("sortable")&&(e.allSortableDisabled||C("sortableDisabled"))},C=function(){return e.column?typeof(arguments.length<=0?void 0:arguments[0])=="string"?Dc.getCProp(e.column,arguments.length<=0?void 0:arguments[0]):Dc.getCProp((arguments.length<=0?void 0:arguments[0])||e.column,arguments.length<=1?void 0:arguments[1]):null},N=function(){var oe=C("headerStyle"),ue=C("style");return C("frozen")?Object.assign({},ue,oe,r):Object.assign({},ue,oe)},j=function(){return e.multiSortMeta.findIndex(function(oe){return oe.field===C("field")||oe.field===C("sortField")})},I=function(){var oe=!1,ue=0,fe=-1;return e.sortMode==="single"?(oe=e.sortField&&(e.sortField===C("field")||e.sortField===C("sortField")),ue=oe?e.sortOrder:0):e.sortMode==="multiple"&&(fe=j(),fe>-1&&(oe=!0,ue=e.multiSortMeta[fe].order)),{sorted:oe,sortOrder:ue,metaIndex:fe}},_=function(oe){var ue=oe.sorted,fe=oe.sortOrder;return C("sortable")?ue&&fe<0?"descending":ue&&fe>0?"ascending":"none":null},T=function(){if(C("frozen")){var oe=e9({},r),ue=C("alignFrozen");if(ue==="right"){var fe=0,se=i.current&&i.current.nextElementSibling;se&&se.classList.contains("p-frozen-column")&&(fe=Lt.getOuterWidth(se)+parseFloat(se.style.right||0)),oe.right=fe+"px"}else{for(var ge=0,ye=i.current&&i.current.previousElementSibling;ye;){if(ye&&ye.classList.contains("p-frozen-column")){ge=Lt.getOuterWidth(ye)+parseFloat(ye.style.left||0),i.current.style.left=ge+"px";break}ye=ye.previousElementSibling}oe.left=ge+"px"}var de=i.current.parentElement.nextElementSibling;if(de){var Ne=Lt.index(i.current);de.children[Ne].style.left=oe.left,de.children[Ne].style.right=oe.right}var _e=r.left===oe.left&&r.right===oe.right;!_e&&o(oe)}},P=function(oe){(C(oe,"sortableDisabled")!==C("sortableDisabled")||C(oe,"sortable")!==C("sortable"))&&e.onSortableChange()},E=function(oe){if(!S()){var ue=oe.target;(Lt.getAttribute(ue,"data-p-sortable-column")===!0||Lt.getAttribute(ue,"data-pc-section")==="headertitle"||Lt.getAttribute(ue,"data-pc-section")==="headercontent"||Lt.getAttribute(ue,"data-pc-section")==="sortIcon"||Lt.getAttribute(ue.parentElement,"data-pc-section")==="sortIcon"||ue.closest('[data-p-sortable-column="true"]')&&!ue.closest('[data-pc-section="filtermenubutton"]'))&&(Lt.clearSelection(),e.onSortChange({originalEvent:oe,column:e.column,sortableDisabledFields:e.sortableDisabledFields}))}},M=function(oe){e.onColumnMouseDown({originalEvent:oe,column:e.column})},R=function(oe){(oe.code=="Enter"||oe.code==="NumpadEnter"||oe.code=="Space")&&oe.target===i.current&&Lt.getAttribute(oe.currentTarget,"data-p-sortable-column")===!0&&(E(oe),oe.preventDefault())},$=function(oe){e.onColumnDragStart({originalEvent:oe,column:e.column})},D=function(oe){e.onColumnDragOver({originalEvent:oe,column:e.column})},z=function(oe){e.onColumnDragLeave({originalEvent:oe,column:e.column})},V=function(oe){e.onColumnDrop({originalEvent:oe,column:e.column})},B=function(oe){e.onColumnResizeStart({originalEvent:oe,column:e.column})},G=function(oe){e.onColumnResizerClick&&(e.onColumnResizerClick({originalEvent:oe,element:oe.currentTarget.parentElement,column:e.column}),oe.preventDefault())},H=function(oe){e.onColumnResizerDoubleClick&&(e.onColumnResizerDoubleClick({originalEvent:oe,element:oe.currentTarget.parentElement,column:e.column}),oe.preventDefault())};f.useEffect(function(){C("frozen")&&T(),P(s)});var F=function(){if(e.resizableColumns&&!C("frozen")){var oe=l({className:g("columnResizer"),onMouseDown:function(fe){return B(fe)},onTouchStart:function(fe){return B(fe)},onClick:function(fe){return G(fe)},onDoubleClick:function(fe){return H(fe)}},b("columnResizer"));return f.createElement("span",oe)}return null},W=function(){var oe=Nt.getJSXElement(C("header"),{props:e.tableProps}),ue=l({className:g("headerTitle")},b("headerTitle"));return f.createElement("span",ue,oe)},U=function(oe){var ue=oe.sorted,fe=oe.sortOrder;if(C("sortable")){var se=l({className:g("sortIcon")},b("sortIcon")),ge=l(b("sort")),ye=ue?fe<0?f.createElement(Pmt,se):f.createElement(Amt,se):f.createElement(_mt,se),de=el.getJSXIcon(e.sortIcon||ye,e9({},se),{props:e,sorted:ue,sortOrder:fe});return f.createElement("span",ge,de)}return null},K=function(oe){var ue=oe.metaIndex;if(ue!==-1&&w()){var fe=e.groupRowsBy&&e.groupRowsBy===e.groupRowSortField?ue:ue+1,se=l({className:g("sortBadge")},b("root"),b("sortBadge"));return f.createElement("span",se,fe)}return null},X=function(){if(e.showSelectAll&&C("selectionMode")==="multiple"&&e.filterDisplay!=="row"){var oe=e.allRowsSelected(e.value);return f.createElement(a1e,{hostName:e.hostName,column:e.column,checked:oe,onChange:e.onColumnCheckboxChange,disabled:e.empty,ptCallbacks:u,metaData:c,unstyled:e.unstyled})}return null},J=function(){return e.filterDisplay==="menu"&&C("filter")?f.createElement(i1e,{hostName:e.hostName,display:"menu",column:e.column,filters:e.filters,onFilterChange:e.onFilterChange,onFilterApply:e.onFilterApply,filtersStore:e.filtersStore,filterIcon:e.filterIcon,filterClearIcon:e.filterClearIcon,ptCallbacks:u,metaData:c,unstyled:e.unstyled}):null},te=function(oe){var ue=W(),fe=U(oe),se=K(oe),ge=X(),ye=J(),de=l({className:g("headerContent")},b("headerContent"));return f.createElement("div",de,ue,fe,se,ge,ye)},re=function(){var oe=S(),ue=I(),fe=N(),se=C("alignHeader")||C("align"),ge=C("frozen"),ye=C("sortable")&&!oe?e.tabIndex:null,de=C("colSpan"),Ne=C("rowSpan"),_e=_(ue),xe=C("headerTooltip"),we=C("headerClassName"),Te=Nt.isNotEmpty(xe),Re=C("headerTooltipOptions"),Ue=F(),He=te(ue),Ye=l({className:wr(we,g("headerCell",{headerProps:e,frozen:ge,sortMeta:ue,align:se,_isSortableDisabled:oe,getColumnProp:C})),style:fe,role:"columnheader",onClick:function(at){return E(at)},onKeyDown:function(at){return R(at)},onMouseDown:function(at){return M(at)},onDragStart:function(at){return $(at)},onDragOver:function(at){return D(at)},onDragLeave:function(at){return z(at)},onDrop:function(at){return V(at)},tabIndex:ye,colSpan:de,rowSpan:Ne,"aria-sort":_e,"data-p-sortable-column":C("sortable"),"data-p-resizable-column":e.resizableColumns,"data-p-highlight":ue.sorted,"data-p-filter-column":!e.metaData.props.headerColumnGroup&&e.filterDisplay==="row","data-p-frozen-column":C("frozen"),"data-p-reorderable-column":e.reorderableColumns},b("root"),b("headerCell"));return f.createElement(f.Fragment,null,f.createElement("th",Cs({ref:i},Ye),Ue,He),Te&&f.createElement(dN,Cs({target:i,content:xe,pt:b("tooltip"),unstyled:e.unstyled},Re)))},ce=re();return ce});Hmt.displayName="HeaderCell";var Chr=["unstyled","__TYPE","ptOptions"];function nFe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ine(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return s=u.done,u},e:function(u){l=!0,i=u},f:function(){try{s||n.return==null||n.return()}finally{if(l)throw i}}}}function jhr(e,t){if(e){if(typeof e=="string")return rFe(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rFe(e,t):void 0}}function rFe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n0&&arguments[0]!==void 0?arguments[0]:{};if(Nt.isNotEmpty(yt)){if(o.paginator)if(o.onPage){var Xt=function(Cr,Zr){var _o=Lo(cd()),Yo=Math.ceil(_o/Zr)||1,Si=Math.floor(Cr/Zr);return{first:Cr,rows:Zr,page:Si,pageCount:Yo}};o.onPage(nc(Xt(yt.first,yt.rows)))}else c(yt.first),h(yt.rows);if(yt.sortField&&(o.onSort?o.onSort(nc({sortField:yt.sortField,sortOrder:yt.sortOrder})):(x(yt.sortField),S(yt.sortOrder))),yt.multiSortMeta)if(o.onSort)o.onSort(nc({multiSortMeta:yt.multiSortMeta}));else{var Sn=yt.multiSortMeta[yt.multiSortMeta.length-1],En=Sn&&Sn.field?Sn.field:null;if(En){var Hn=er(ke(),En);if(Hn){var zn=Le(Hn,"sortFunction"),Qn=Le(Hn,"sortable");zn&&Qn&&(Pt.current=zn,vt.current=Qn,Jt.current=En)}}I(yt.multiSortMeta)}yt.filters&&(ge(Tr(yt.filters)),o.onFilter?o.onFilter(nc({filters:yt.filters})):E(Tr(yt.filters))),o.resizableColumns&&(bt.current=yt.columnWidths,Ct.current=yt.tableWidth,Fr()),o.reorderableColumns&&D(yt.columnOrder),yt.expandedRows&&o.onRowToggle&&o.onRowToggle({data:yt.expandedRows}),yt.selection&&o.onSelectionChange&&o.onSelectionChange({value:yt.selection}),o.onStateRestore&&o.onStateRestore(yt)}},Vn=function(yt){var Xt=[],Sn=Lt.find(_e.current,'[data-pc-section="thead"] > tr > th');Sn.forEach(function(En){return Xt.push(Lt.getOuterWidth(En))}),yt.columnWidths=Xt.join(","),o.columnResizeMode==="expand"&&(yt.tableWidth=Lt.getOuterWidth(xe.current)+"px")},Jn=function(yt){Bn();var Xt="",Sn='[data-pc-name="datatable"]['.concat(Ne.current,'] > [data-pc-section="wrapper"] ').concat(xt()?"":'> [data-pc-name="virtualscroller"]',' > [data-pc-section="table"]');yt.forEach(function(En,Hn){var zn="width: ".concat(En,"px !important; max-width: ").concat(En,"px !important");Xt=Xt+` `.concat(Sn,' > [data-pc-section="thead"] > tr > th:nth-child(').concat(Hn+1,`), `).concat(Sn,' > [data-pc-section="tbody"] > tr > td:nth-child(').concat(Hn+1,`), `).concat(Sn,' > [data-pc-section="tfoot"] > tr > td:nth-child(').concat(Hn+1,`) { `).concat(zn,` } `)}),Ze.current.innerHTML=Xt},Fr=function(){if(bt.current){var yt=bt.current.split(",");o.columnResizeMode==="expand"&&Ct.current&&(xe.current.style.width=Ct.current,xe.current.style.minWidth=Ct.current),Nt.isNotEmpty(yt)&&Jn(yt)}},po=function(yt){if(yt.nodeName==="TH")return yt;for(var Xt=yt.parentElement;Xt.nodeName!=="TH"&&(Xt=Xt.parentElement,!!Xt););return Xt},nr=function(){return o.sortMode==="single"?o.sortField:B?B.field:null},or=function(yt){return o.showSelectionElement||o.isDataSelectable?yt.filter(function(Xt,Sn){var En=!0;return o.showSelectionElement&&(En=o.showSelectionElement({rowIndex:Sn,props:o})),o.isDataSelectable&&En&&(En=o.isDataSelectable({data:Xt,index:Sn})),En}):yt},Or=function(yt){if(o.onSelectAllChange)return o.selectAll;var Xt=o.selectionPageOnly?pe(yt):yt,Sn=Nt.isNotEmpty(o.frozenValue)?[].concat(Qc(o.frozenValue),Qc(Xt)):Xt,En=or(Sn);return Nt.isNotEmpty(En)&&o.selection&&En.every(function(Hn){return Nt.isArray(o.selection)&&o.selection.some(function(zn){return Tt(zn,Hn)})})},Tn=function(yt){if(yt){var Xt=yt.find(function(Sn){return!!Le(Sn,"selectionMode")});return Xt?Le(Xt,"selectionMode"):null}return null},er=function(yt,Xt){return Nt.isNotEmpty(yt)?yt.find(function(Sn){return Le(Sn,"columnKey")===Xt||Le(Sn,"field")===Xt}):null},Lo=function(yt){return o.lazy?o.totalRecords:yt?yt.length:0},Fo=function(yt){var Xt=yt.rowData,Sn=yt.field,En=yt.editingKey;yt.rowIndex;var Hn=yt.editing,zn=Zd({},W),Qn=zn[En];if(Hn)!Qn&&(Qn=zn[En]={data:Zd({},Xt),fields:[]}),Qn.fields.push(Sn);else if(Qn){var pr=Qn.fields.filter(function(Cr){return Cr!==Sn});pr.length?Qn.fields=pr:delete zn[En]}U(zn)},Ao=function(){o.editMode&&Nt.isNotEmpty(W)&&U({})},uo=function(yt){var Xt=yt.rowData,Sn=yt.field,En=yt.editingKey,Hn=yt.editing,zn=Zd({},J),Qn=zn[En];if(Hn)!Qn&&(Qn=zn[En]={data:Zd({},Xt),fields:[]}),Qn.fields.push(Sn);else if(Qn){var pr=Qn.fields.filter(function(Cr){return Cr!==Sn});pr.length?Qn.fields=pr:delete zn[En]}te(zn)},Wi=function(){o.editMode&&Nt.isNotEmpty(J)&&te({})},Jr=function(yt){xo();var Xt=yt.originalEvent,Sn=yt.column,En=Lt.getOffset(_e.current).left;Je.current=Sn,Pe.current=Xt.currentTarget.parentElement,Me.current=!0,et.current=(Xt.type==="touchstart"?Xt.changedTouches[0].clientX:Xt.pageX)-En+_e.current.scrollLeft,st()},hs=function(yt){var Xt=Lt.getOffset(_e.current).left;_e.current.setAttribute("data-p-unselectable-text",!0),Oe.current.style.height=_e.current.offsetHeight+"px",Oe.current.style.top="0px",Oe.current.style.left=(yt.type==="touchmove"?yt.changedTouches[0].clientX:yt.pageX)-Xt+_e.current.scrollLeft+"px",Oe.current.style.display="block"},zr=function(){var yt=Oe.current.offsetLeft-et.current,Xt=Pe.current.offsetWidth,Sn=Xt+yt,En=Pe.current.style.minWidth||15;if(Xt+yt>parseInt(En,10)){if(o.columnResizeMode==="fit"){var Hn=Pe.current.nextElementSibling,zn=Hn.offsetWidth-yt;Sn>15&&zn>15&&mn(Sn,zn)}else if(o.columnResizeMode==="expand"){var Qn=xe.current.offsetWidth+yt+"px",pr=function(Zr){Zr&&(Zr.style.width=Zr.style.minWidth=Qn)};mn(Sn),pr(xe.current),xt()||(pr(Te.current),pr(Re.current),we.current&&pr(Lt.findSingle(we.current,'[data-pc-name="virtualscroller"] > table > tbody')))}o.onColumnResizeEnd&&o.onColumnResizeEnd({element:Pe.current,column:Je.current,delta:yt}),nt()&&it()}Oe.current.style.display="none",Je.current=null,Pe.current=null,_e.current.setAttribute("data-p-unselectable-text","true"),Ws(),In()},mn=function(yt,Xt){var Sn=[],En=Lt.index(Pe.current),Hn=Lt.find(xe.current,'[data-pc-section="thead"] > tr > th');Hn.forEach(function(pr){return Sn.push(Lt.getOuterWidth(pr))}),yu(),Bn();var zn="",Qn='[data-pc-name="datatable"]['.concat(Ne.current,'] > [data-pc-section="wrapper"] ').concat(xt()?"":'> [data-pc-name="virtualscroller"]',' > [data-pc-section="table"]');Sn.forEach(function(pr,Cr){var Zr=Cr===En?yt:Xt&&Cr===En+1?Xt:pr,_o="width: ".concat(Zr,"px !important; max-width: ").concat(Zr,"px !important");zn=zn+` `.concat(Qn,' > [data-pc-section="thead"] > tr > th:nth-child(').concat(Cr+1,`), `).concat(Qn,' > [data-pc-section="tbody"] > tr > td:nth-child(').concat(Cr+1,`), `).concat(Qn,' > [data-pc-section="tfoot"] > tr > td:nth-child(').concat(Cr+1,`) { `).concat(_o,` } `)}),Ze.current.innerHTML=zn},st=function(){Ht(),zt(),Zt(),gn()},In=function(){jt(),Nn(),Ot(),An()},Sr=function(yt){Lt.clearSelection();var Xt=yt.originalEvent,Sn=yt.column;o.reorderableColumns&&Le(Sn,"reorderable")!==!1&&!Le(Sn,"frozen")&&(Xt.target.nodeName==="INPUT"||Xt.target.nodeName==="TEXTAREA"||Lt.getAttribute(Xt.target,'[data-pc-section="columnresizer"]')?Xt.currentTarget.draggable=!1:Xt.currentTarget.draggable=!0)},ei=function(yt,Xt){if(o.onSelectAllChange)o.onSelectAllChange(yt);else{var Sn=yt.originalEvent,En=yt.checked,Hn=o.selectionPageOnly?pe(Xt):Xt,zn=o.selectionPageOnly&&o.selection?o.selection.filter(function(Qn){return!Hn.some(function(pr){return Tt(Qn,pr)})}):[];En?(zn=Nt.isNotEmpty(o.frozenValue)?[].concat(Qc(zn),Qc(o.frozenValue),Qc(Hn)):[].concat(Qc(zn),Qc(Hn)),zn=or(zn),o.onAllRowsSelect&&o.onAllRowsSelect({originalEvent:Sn,data:zn,type:"all"})):o.onAllRowsUnselect&&o.onAllRowsUnselect({originalEvent:Sn,data:zn,type:"all"}),o.onSelectionChange&&o.onSelectionChange({originalEvent:Sn,value:zn,type:"all"})}},No=function(yt){var Xt=yt.originalEvent,Sn=yt.column;if(Me.current){Xt.preventDefault();return}o.reorderableColumns&&(We.current=Lt.getHiddenElementOuterWidth(He.current),at.current=Lt.getHiddenElementOuterHeight(He.current),qe.current=Sn,Ae.current=po(Xt.currentTarget),Xt.dataTransfer.setData("text","b"))},Ha=function(yt){var Xt=yt.originalEvent,Sn=yt.column,En=po(Xt.currentTarget);if(o.reorderableColumns&&Ae.current&&En&&!Le(Sn,"frozen")&&(Xt.preventDefault(),Ae.current!==En)){var Hn=Lt.getOffset(_e.current),zn=Lt.getOffset(En),Qn=zn.left-Hn.left,pr=zn.left+En.offsetWidth/2,Cr=Lt.index(Ae.current),Zr=Lt.index(po(Xt.currentTarget));He.current.style.top=zn.top-Hn.top-(at.current-1)+"px",Ye.current.style.top=zn.top-Hn.top+En.offsetHeight+"px",Xt.pageX>pr&&CrZr&&(He.current.style.left=Qn-Math.ceil(We.current/2)+"px",Ye.current.style.left=Qn-Math.ceil(We.current/2)+"px",dt.current=-1),He.current.style.display="block",Ye.current.style.display="block"}},ro=function(yt){var Xt=yt.originalEvent;o.reorderableColumns&&Ae.current&&(Xt.preventDefault(),He.current.style.display="none",Ye.current.style.display="none")},kr=function(yt){var Xt=yt.originalEvent,Sn=yt.column;if(Xt.preventDefault(),Ae.current){var En=Lt.index(Ae.current),Hn=Lt.index(po(Xt.currentTarget)),zn=En!==Hn;if(zn&&(Hn-En===1&&dt.current===-1||En-Hn===1&&dt.current===1)&&(zn=!1),zn){var Qn=ke(),pr=function(Ks,ud){return Le(Ks,"columnKey")||Le(ud,"columnKey")?Nt.equals(Ks.props,ud.props,"columnKey"):Nt.equals(Ks.props,ud.props,"field")},Cr=Qn.findIndex(function(gs){return pr(gs,qe.current)}),Zr=Qn.findIndex(function(gs){return pr(gs,Sn)}),_o=[],Yo=Lt.find(xe.current,'[data-pc-section="thead"] > tr > th');Yo.forEach(function(gs){return _o.push(Lt.getOuterWidth(gs))});var Si=_o.find(function(gs,Ks){return Ks===Cr}),ka=_o.filter(function(gs,Ks){return Ks!==Cr}),Ca=[].concat(Qc(ka.slice(0,Zr)),[Si],Qc(ka.slice(Zr)));Jn(Ca),ZrCr&&dt.current===-1&&Zr--,Nt.reorderArray(Qn,Cr,Zr);var rc=Qn.reduce(function(gs,Ks){return gs.push(Le(Ks,"columnKey")||Le(Ks,"field")),gs},[]);D(rc),o.onColReorder&&o.onColReorder({originalEvent:Xt,dragIndex:Cr,dropIndex:Zr,columns:Qn})}He.current.style.display="none",Ye.current.style.display="none",Ae.current.draggable=!1,Ae.current=null,qe.current=null,dt.current=null}},xo=function(){lt.current=Lt.createInlineStyle(n&&n.nonce||ca.nonce,n&&n.styleContainer);var yt=` [data-pc-name="datatable"][`.concat(Ne.current,`] { user-select:none; } `);lt.current.innerHTML=yt},Bn=function(){Ze.current=Lt.createInlineStyle(n&&n.nonce||ca.nonce,n&&n.styleContainer)},Vo=function(){if(!Qe.current){Qe.current=Lt.createInlineStyle(n&&n.nonce||ca.nonce,n&&n.styleContainer);var yt=".p-datatable-wrapper ".concat(xt()?"":"> .p-virtualscroller"," > .p-datatable-table"),Xt=".p-datatable[".concat(Ne.current,"] > ").concat(yt),Sn=".p-datatable[".concat(Ne.current,"].p-datatable-gridlines > ").concat(yt),En=` @media screen and (max-width: `.concat(o.breakpoint,`) { `).concat(Xt,` > .p-datatable-thead > tr > th, `).concat(Xt,` > .p-datatable-tfoot > tr > td { display: none; } `).concat(Xt,` > .p-datatable-tbody > tr > td { display: flex; width: 100%; align-items: center; justify-content: space-between; } `).concat(Xt,` > .p-datatable-tbody > tr > td:not(:last-child) { border: 0 none; } `).concat(Sn,` > .p-datatable-tbody > tr > td:last-child { border-top: 0; border-right: 0; border-left: 0; } `).concat(Xt,` > .p-datatable-tbody > tr > td > .p-column-title { display: block; } } `);Qe.current.innerHTML=En}},_i=function(){Qe.current=Lt.removeInlineStyle(Qe.current)},yu=function(){Ze.current=Lt.removeInlineStyle(Ze.current)},Ws=function(){lt.current=Lt.removeInlineStyle(lt.current)},sd=function(yt){Ao(),Wi(),o.onPage?o.onPage(nc(yt)):(c(yt.first),h(yt.rows)),o.onValueChange&&o.onValueChange(cd())},Lp=function(yt){Ao(),Wi();var Xt=yt.originalEvent,Sn=yt.column,En=yt.sortableDisabledFields,Hn=Le(Sn,"sortField")||Le(Sn,"field"),zn=o.defaultSortOrder,Qn,pr;if(vt.current=Le(Sn,"sortable"),Pt.current=Le(Sn,"sortFunction"),Jt.current=Hn,o.sortMode==="multiple"){var Cr=Xt.metaKey||Xt.ctrlKey;Qn=Qc(tr());var Zr=Qn.find(function(Yo){return Yo.field===Hn});zn=Zr?vu(Zr.order):zn;var _o={field:Hn,order:zn};zn?(Qn=Cr?Qn:Qn.filter(function(Yo){return En.some(function(Si){return Si===Yo.field})}),Sf(_o,Qn)):o.removableSort&&ma(_o,Qn),pr={multiSortMeta:Qn}}else zn=Kn()===Hn?vu(ar()):zn,o.removableSort&&(Hn=zn?Hn:null),pr={sortField:Hn,sortOrder:zn};o.onSort?o.onSort(nc(pr)):(c(0),x(pr.sortField),S(pr.sortOrder),I(pr.multiSortMeta)),o.onValueChange&&o.onValueChange(cd({sortField:Hn,sortOrder:zn,multiSortMeta:Qn}))},vu=function(yt){return o.removableSort?o.defaultSortOrder===yt?yt*-1:0:yt*-1},ld=function(yt,Xt,Sn,En){return Nt.sort(yt,Xt,En,Sn,n&&n.nullSortOrder||ca.nullSortOrder)},Sf=function(yt,Xt){var Sn=Xt.findIndex(function(En){return En.field===yt.field});Sn>=0?Xt[Sn]=yt:Xt.push(yt)},ma=function(yt,Xt){var Sn=Xt.findIndex(function(En){return En.field===yt.field});Sn>=0&&Xt.splice(Sn,1),Xt=Xt.length>0?Xt:null},Vc=function(yt,Xt,Sn){if(o.groupRowsBy&&o.groupRowsBy===o.sortField){var En=[{field:o.sortField,order:o.sortOrder||o.defaultSortOrder}];return o.sortField!==Xt&&En.push({field:Xt,order:Sn}),ec(yt,En)}var Hn=Qc(yt);if(vt.current&&Pt.current)Hn=Pt.current({data:yt,field:Xt,order:Sn});else{var zn=new Map,Qn=Nt.localeComparator(n&&n.locale||ca.locale),pr=Nhr(yt),Cr;try{for(pr.s();!(Cr=pr.n()).done;){var Zr=Cr.value;zn.set(Zr,Nt.resolveFieldData(Zr,Xt))}}catch(_o){pr.e(_o)}finally{pr.f()}Hn.sort(function(_o,Yo){var Si=zn.get(_o),ka=zn.get(Yo);return ld(Si,ka,Qn,Sn)})}return Hn},ec=function(yt){var Xt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(o.groupRowsBy&&(B||Xt.length&&o.groupRowsBy===Xt[0].field)){var Sn=B,En=Xt[0];Sn||(Sn=En,G(Sn)),En.field!==Sn.field&&(Xt=[Sn].concat(Qc(Xt)))}var Hn=Qc(yt);if(vt.current&&Pt.current){var zn=Xt.find(function(Zr){return Zr.field===Jt.current}),Qn=Jt.current,pr=zn?zn.order:o.defaultSortOrder;Hn=Pt.current({data:yt,field:Qn,order:pr,multiSortMeta:Xt})}else{var Cr=Nt.localeComparator(n&&n.locale||ca.locale);Hn.sort(function(Zr,_o){return ht(Zr,_o,Xt,0,Cr)})}return Hn},ht=function(yt,Xt,Sn,En,Hn){if(!(!Sn||!Sn[En])){var zn=Nt.resolveFieldData(yt,Sn[En].field),Qn=Nt.resolveFieldData(Xt,Sn[En].field);return Nt.compare(zn,Qn,Hn)===0?Sn.length-1>En?ht(yt,Xt,Sn,En+1,Hn):0:ld(zn,Qn,Hn,Sn[En].order)}},Wt=function(yt){Ao(),Wi(),ge(yt)},bn=function(yt){clearTimeout(dn.current),dn.current=setTimeout(function(){var Xt=Tr(yt||se);o.onFilter?o.onFilter(nc({filters:Xt})):(c(0),E(Xt)),o.onValueChange&&o.onValueChange(cd({filters:Xt}))},o.filterDelay)},Ar=function(yt){var Xt=function(zn){var Qn=ls(zn,2),pr=Qn[0],Cr=Qn[1];if(Cr.constraints){var Zr=Cr.constraints.filter(function(_o){return _o.value!==null});if(Zr.length>0)return[pr,Zd(Zd({},Cr),{},{constraints:Zr})]}else if(Cr.value!==null)return[pr,Cr]},Sn=function(zn){return zn!==void 0},En=Object.entries(yt).map(Xt).filter(Sn);return Object.fromEntries(En)},Io=function(yt,Xt){if(yt){var Sn=Xt?Ar(Xt):{},En=ke(),Hn=[],zn=Sn.global||o.globalFilter,Qn;zn&&(Qn=o.globalFilterFields||En.filter(function(bu){return!Le(bu,"excludeGlobalFilter")}).map(function(bu){return Le(bu,"filterField")||Le(bu,"field")}));for(var pr=0;pr3&&arguments[3]!==void 0?arguments[3]:0,Hn=Zd({},se),zn=Hn[Xt],Qn=zn&&zn.operator?zn.constraints[En]:zn;Qn=zn?{value:yt,matchMode:Sn||Qn.matchMode}:{value:yt,matchMode:Sn},o.filterDisplay==="menu"&&zn&&zn.operator?Hn[Xt].constraints[En]=Qn:Hn[Xt]=Qn,ge(Hn),bn(Hn)},$o=function(){oe(o.rows),ge(Tr(o.filters)),G(null),U({}),te({}),o.onPage||(c(o.first),h(o.rows)),o.onSort||(x(o.sortField),S(o.sortOrder),I(o.multiSortMeta)),o.onFilter||E(o.filters),Uu()},ms=function(){if(we.current){var yt=xt()?we.current:Lt.findSingle(we.current,'[data-pc-name="virtualscroller"]');yt.scrollTo(0,0)}},hl=function(){yu()},Uu=function(){var yt=ke(!0),Xt=[];yt&&(Xt=yt.reduce(function(Sn,En){return Sn.push(Le(En,"columnKey")||Le(En,"field")),Sn},[])),D(Xt)},tc=function(yt){var Xt,Sn="\uFEFF";yt&&yt.selectionOnly?Xt=o.selection||[]:Xt=[].concat(Qc(o.frozenValue||[]),Qc(cd()||[]));var En=ke().filter(function(Hn){var zn=Le(Hn,"exportable"),Qn=Le(Hn,"field");return zn!==!1&&Qn});En.forEach(function(Hn,zn){var Qn=[Le(Hn,"field"),Le(Hn,"header"),Le(Hn,"exportHeader")],pr=Qn[0],Cr=Qn[1],Zr=Qn[2],_o=String(Zr||Cr||pr).replace(/"/g,'""').replace(/\n/g,"\u2028");Sn=Sn+('"'+_o+'"'),zn{const{api:e,accessToken:t,uuid:n}=gk(),[r,o]=f.useState(null),[i,s]=f.useState(!0),[l,c]=f.useState(null),u=f.useCallback(async()=>{if(!(!e||!t)){s(!0),c(null);try{const h=await e.retrieveDestinationSourceAccountBillPay(t,n);o(h)}catch(h){console.error("Error fetching eligibility data:",h),c(h.message||"Failed to fetch eligibility data.")}finally{s(!1)}}},[e,t,n]);f.useEffect(()=>{u()},[u]);const d=h=>a.jsxs("div",{className:"flex flex-col",children:[a.jsxs("span",{className:"font-bold text-gray-100",children:[h.productName," (",h.displaySourceAccountNumber,")"]}),a.jsxs("span",{className:"text-sm text-gray-400",children:["Balance: ",h.availableBalance," ",h.sourceAccountCurrencyCode]})]}),p=h=>h.payeeSourceAccountCombinations?a.jsx("div",{className:"flex flex-col gap-1",children:h.payeeSourceAccountCombinations.map((m,g)=>a.jsxs("span",{className:"text-xs bg-gray-700 p-1 rounded text-gray-300",children:[m.payeeNickName," (...",m.displayPayeeAccountNumber.slice(-4),")"]},g))}):a.jsx("span",{className:"text-gray-500",children:"None"});return a.jsxs(Wmt,{title:"Payment Eligibility Check",className:"m-4 bg-gray-900 text-white border border-gray-700",children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("p",{className:"text-gray-400",children:"This module checks which of your source accounts are eligible to pay registered billers."}),a.jsx(UP,{label:"Refresh Eligibility",icon:"pi pi-refresh",className:"p-button-sm mt-2",onClick:u,loading:i})]}),l&&a.jsxs("div",{className:"p-4 mb-3 text-red-300 bg-red-900/50 border border-red-700 rounded",children:[a.jsx("strong",{children:"Error:"})," ",l]}),i&&a.jsx(Gmt,{style:{width:"50px",height:"50px"},strokeWidth:"8"}),!i&&(r==null?void 0:r.sourceAccounts)&&a.jsxs(Umt,{value:r.sourceAccounts,responsiveLayout:"scroll",className:"p-datatable-sm",emptyMessage:"No eligible source accounts found.",children:[a.jsx(ope,{header:"Eligible Source Account",body:d,style:{minWidth:"250px"}}),a.jsx(ope,{header:"Eligible Payees for this Account",body:p,style:{minWidth:"250px"}})]}),!i&&!l&&(!(r!=null&&r.sourceAccounts)||r.sourceAccounts.length===0)&&a.jsx("div",{className:"p-4 text-center text-gray-500",children:"No eligibility data found."})]})},khr="mySecurePassword123!",Mhr=({accountIdsToUnmask:e,onClose:t})=>{var b;const{api:n,accessToken:r,uuid:o,generateNewUuid:i}=gk(),[s,l]=f.useState(!1),[c,u]=f.useState(""),[d,p]=f.useState(null),[h,m]=f.useState(!1),[g,y]=f.useState(null),x=f.useCallback(()=>{c===khr?(l(!0),y(null)):(y("Authentication failed."),l(!1)),u("")},[c]),v=f.useCallback(async()=>{if(!(!n||!r||!s||e.length===0)){m(!0),y(null),p(null);try{const w={accountInfo:e.map(S=>({accountId:S}))};i(),setTimeout(()=>{p({accounts:e.map(S=>({accountId:S,unmaskedAccountNumber:"1234567890"}))}),m(!1)},1e3)}catch(w){y(w.message),m(!1)}}},[n,r,o,i,s,e]);return f.useEffect(()=>{s&&e.length>0&&v()},[s,e,v]),s?a.jsxs("div",{className:"p-4 bg-gray-800 text-white rounded",children:[a.jsx("h3",{children:"Unmasked Account Numbers"}),h&&a.jsx("p",{children:"Loading..."}),(b=d==null?void 0:d.accounts)==null?void 0:b.map(w=>a.jsxs("div",{className:"flex justify-between border-b border-gray-700 p-2",children:[a.jsx("span",{children:w.accountId}),a.jsx("span",{className:"font-mono text-yellow-400",children:w.unmaskedAccountNumber})]},w.accountId)),t&&a.jsx("button",{onClick:t,className:"mt-4 p-2 bg-gray-600 rounded",children:"Close"})]}):a.jsxs("div",{className:"p-4 bg-gray-800 text-white rounded",children:[a.jsx("h3",{children:"Re-authenticate to view sensitive data"}),a.jsx("input",{type:"password",value:c,onChange:w=>u(w.target.value),className:"p-2 text-black rounded mr-2"}),a.jsx("button",{onClick:x,className:"p-2 bg-blue-600 rounded",children:"Authenticate"}),g&&a.jsx("p",{className:"text-red-500",children:g})]})},Rhr=()=>{const[e,t]=f.useState("dashboard"),n=()=>a.jsxs("div",{className:"flex flex-col items-center justify-center h-[60vh] text-center space-y-6 animate-in fade-in duration-500",children:[a.jsx("div",{className:"w-24 h-24 bg-red-900/20 rounded-full flex items-center justify-center border-2 border-red-500/50 animate-pulse",children:a.jsx("span",{className:"text-4xl",children:"🔒"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-2xl font-bold text-white",children:"Restricted Zone"}),a.jsx("p",{className:"text-slate-400 max-w-md mx-auto mt-2",children:"Biometric authentication required. Accessing secure enclave..."})]}),a.jsxs("div",{className:"p-4 bg-black border border-slate-800 rounded-lg max-w-lg w-full font-mono text-xs text-left text-green-500 space-y-1 shadow-2xl",children:[a.jsxs("p",{children:[">"," DETECTING_USER_CONTEXT..."]}),a.jsxs("p",{children:[">"," VALIDATING_SESSION_TOKEN: 0x82...F1 [OK]"]}),a.jsxs("p",{className:"text-red-500",children:[">"," ERROR: ELEVATED_PRIVILEGES_REQUIRED"]}),a.jsxs("p",{className:"animate-pulse text-yellow-500",children:[">"," WAITING_FOR_AI_OVERRIDE_"]})]}),a.jsx("button",{onClick:()=>t("dashboard"),className:"px-6 py-2 bg-slate-800 hover:bg-slate-700 text-white rounded-lg transition-colors border border-slate-600",children:"Return to Dashboard"})]});return a.jsx("div",{className:"min-h-screen bg-slate-950 text-slate-200 p-8 font-sans",children:e==="security"?n():a.jsxs("div",{className:"text-center mt-20",children:[a.jsx("h1",{className:"text-3xl font-bold text-white mb-6",children:"Identity Management"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 max-w-4xl mx-auto",children:[a.jsxs("div",{className:"p-6 bg-slate-900 rounded-xl border border-slate-800 hover:border-blue-500 transition-colors cursor-pointer group",children:[a.jsx("h3",{className:"text-xl font-bold text-blue-400 mb-2",children:"KYC Status"}),a.jsx("p",{className:"text-slate-400",children:"Identity Verified. Level 3 Clearance active."})]}),a.jsxs("div",{onClick:()=>t("security"),className:"p-6 bg-slate-900 rounded-xl border border-slate-800 hover:border-red-500 transition-colors cursor-pointer group",children:[a.jsx("h3",{className:"text-xl font-bold text-red-400 mb-2",children:"Security Node"}),a.jsx("p",{className:"text-slate-400",children:"Access advanced security settings and logs."})]})]})]})})},Ohr={user_insights_id:"ins_mock_quantum_8821",items:[{item_id:"itm_chase_quantum_01",institution_name:"Chase (Quantum Link)",institution_id:"ins_1",date_generated:new Date().toISOString(),status:{status_code:"HEALTHY"},insights:{income:{forecasted_monthly_income:{current_amount:12500,iso_currency_code:"USD"},total_monthly_income:{current_amount:14200.5,iso_currency_code:"USD"},historical_annual_income:{current_amount:165e3,iso_currency_code:"USD"}},loans:{loan_payments_counts:{current_count:2},loan_disbursements_count:0}},accounts:[{account_id:"acc_chk_01",name:"Quantum Elite Checking",mask:"8842",type:"depository",subtype:"checking",balances:{current:45200,available:44100,iso_currency_code:"USD"},transactions:[{date:"2024-05-01",original_description:"Direct Deposit - QUANTUM CORP",amount:-6200,iso_currency_code:"USD"},{date:"2024-05-02",original_description:"Payment to AMEX",amount:1200,iso_currency_code:"USD"},{date:"2024-05-05",original_description:"Wire Transfer - Investment",amount:5e3,iso_currency_code:"USD"}]}]}]},$hr=` QUANTUM FINANCIAL BUSINESS DEMO: A COMPREHENSIVE GUIDE Welcome, Visionary. You are now accessing the Quantum Financial Business Demo. This is your "Golden Ticket" to the future of financial orchestration. Why a Quantum Business Demo is Your Secret Weapon: Think of this as your ultimate cheat sheet to the world of high-frequency business banking. In today’s hyper-connected economy, latency is the enemy. This demo allows you to virtually walk through the entire Quantum platform. You get to see firsthand how easy it is to manage your accounts, process payments, track expenses, and access sophisticated reporting tools powered by our proprietary AI core. What to Expect: This is your backstage pass. You are test-driving the car. Kick the tires. See the engine roar. - Robust Payment & Collection: Wire, ACH, Real-time Rails. - Security: Non-negotiable. Multi-factor auth simulations, Fraud monitoring. - Reporting & Analytics: Data visualization that speaks the language of profit. - Audit Storage: Every sensitive action is logged in our immutable ledger. This environment is NO PRESSURE. Explore, interact, and evaluate. `,ZN=({children:e,title:t,className:n="",action:r})=>a.jsxs("div",{className:`bg-gray-900/80 backdrop-blur-md border border-gray-700/50 rounded-xl overflow-hidden shadow-2xl ${n}`,children:[(t||r)&&a.jsxs("div",{className:"px-6 py-4 border-b border-gray-700/50 flex justify-between items-center bg-gray-800/30",children:[t&&a.jsx("h3",{className:"text-lg font-semibold text-cyan-400 tracking-wide uppercase",children:t}),r&&a.jsx("div",{children:r})]}),a.jsx("div",{className:"p-6",children:e})]}),MS=({children:e,variant:t="primary",className:n="",...r})=>{const o={primary:"bg-cyan-600 hover:bg-cyan-500 text-white shadow-lg shadow-cyan-500/20",danger:"bg-red-600 hover:bg-red-500 text-white shadow-lg shadow-red-500/20",success:"bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20",ghost:"bg-transparent hover:bg-gray-700/50 text-gray-300 border border-gray-600"};return a.jsx("button",{className:`px-4 py-2 rounded-lg font-medium transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 ${o[t]} ${n}`,...r,children:e})},iFe=({label:e,className:t="",...n})=>a.jsxs("div",{className:"mb-4",children:[e&&a.jsx("label",{className:"block text-xs font-medium text-gray-400 mb-1 uppercase tracking-wider",children:e}),a.jsx("input",{className:`w-full bg-gray-800/50 border border-gray-600 rounded-lg px-4 py-2 text-gray-100 focus:outline-none focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500 transition-all ${t}`,...n})]}),Dhr=({isOpen:e,onClose:t,title:n,children:r})=>e?a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm p-4",children:a.jsxs("div",{className:"bg-gray-900 border border-gray-700 rounded-2xl w-full max-w-lg shadow-2xl transform transition-all animate-in fade-in zoom-in duration-200",children:[a.jsxs("div",{className:"flex justify-between items-center p-6 border-b border-gray-800",children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:n}),a.jsx("button",{onClick:t,className:"text-gray-400 hover:text-white transition-colors",children:a.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsx("div",{className:"p-6",children:r})]})}):null,_ne=({status:e})=>{const t=n=>["HEALTHY","SUCCESS","ACTIVE"].includes(n)?"bg-emerald-500/20 text-emerald-400 border-emerald-500/30":["WARNING","PENDING"].includes(n)?"bg-amber-500/20 text-amber-400 border-amber-500/30":["FAILURE","ERROR","DISCONNECTED"].includes(n)?"bg-red-500/20 text-red-400 border-red-500/30":"bg-gray-500/20 text-gray-400 border-gray-500/30";return a.jsx("span",{className:`px-2 py-1 rounded text-xs font-bold border ${t(e)}`,children:e})},Lhr=()=>{const[e,t]=f.useState({geminiKey:"",userToken:"",subscriptionId:null,isSimulationMode:!1}),[n,r]=f.useState("DASHBOARD"),[o,i]=f.useState(null),[s,l]=f.useState([]),[c,u]=f.useState(!1),[d,p]=f.useState(null),[h,m]=f.useState([{id:"init",role:"system",content:"Quantum AI Core Initialized. Ready to analyze financial vectors.",timestamp:new Date}]),[g,y]=f.useState(""),[x,v]=f.useState(!1),[b,w]=f.useState(!1),S=f.useRef(null),C=f.useRef(null),N=(B,G,H)=>{const F={id:Math.random().toString(36).substring(7),timestamp:new Date().toISOString(),action:B,user:e.isSimulationMode?"SIM_USER_ADMIN":"QUANTUM_USER",status:G,details:H,hash:Math.random().toString(36).substring(2,15).toUpperCase()};l(W=>[...W,F])},j=B=>{var G;(G=B.current)==null||G.scrollIntoView({behavior:"smooth"})};f.useEffect(()=>{j(S)},[h]),f.useEffect(()=>{j(C)},[s]);const I=async(B,G)=>{if(e.isSimulationMode)return await new Promise(H=>setTimeout(H,800)),B.includes("subscribe")?{subscription_id:"sub_sim_quantum_99"}:B.includes("get")?Ohr:{};try{const H=await fetch("/api/plaid",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:B,...G})}),F=await H.json();if(!H.ok)throw new Error(F.error_message||"Unknown Error");return F}catch(H){throw H}},_=async()=>{u(!0),p(null),N("INITIATE_SUBSCRIPTION","PENDING","Requesting CRA monitoring subscription...");try{if(!e.userToken&&!e.isSimulationMode)throw new Error("User Token Required");const B=await I("cra/monitoring_insights/subscribe",{user_token:e.userToken});t(G=>({...G,subscriptionId:B.subscription_id})),N("SUBSCRIPTION_CONFIRMED","SUCCESS",`ID: ${B.subscription_id}`),R("System Alert: New CRA Monitoring Subscription active. Analyzing initial vectors...")}catch(B){p(B.message),N("SUBSCRIPTION_FAILED","FAILURE",B.message)}finally{u(!1)}},T=async()=>{u(!0),p(null),N("FETCH_INSIGHTS","PENDING","Retrieving encrypted insight packets...");try{if(!e.userToken&&!e.isSimulationMode)throw new Error("User Token Required");const B=await I("cra/monitoring_insights/get",{user_token:e.userToken});i(B),N("INSIGHTS_RETRIEVED","SUCCESS",`Packets decrypted. ID: ${B.user_insights_id}`),r("INSIGHTS"),e.geminiKey&&E(B)}catch(B){p(B.message),N("FETCH_INSIGHTS_FAILED","FAILURE",B.message)}finally{u(!1)}},P=()=>{const B=!e.isSimulationMode;t(G=>({...G,isSimulationMode:B})),N("MODE_SWITCH","WARNING",`Simulation Mode: ${B?"ENABLED":"DISABLED"}`),B&&m(G=>[...G,{id:Date.now().toString(),role:"system",content:"*** TEST DRIVE MODE ENGAGED *** Engine is roaring. Mock data streams active.",timestamp:new Date}])},E=async B=>{if(!e.geminiKey)return;const G=` Analyze this financial data for a high-net-worth individual demo. Data: ${JSON.stringify(B)} Tone: Elite, Professional, Concise. Output: 3 key bullet points on financial health and 1 strategic recommendation. `;await M(G,!0)},M=async(B,G=!1)=>{if(B.trim()){G||(m(H=>[...H,{id:Date.now().toString(),role:"user",content:B,timestamp:new Date}]),y("")),v(!0);try{if(!e.geminiKey)throw new Error("AI Core Offline. Please configure GEMINI_API_KEY.");const F=new Ko({apiKey:e.geminiKey}).getGenerativeModel({model:"gemini-1.5-flash"}),W=` You are the Quantum Financial AI Core. You are speaking to a prospective business client testing the platform. Your tone is Elite, Secure, and High-Performance. Current Context: ${e.isSimulationMode?"SIMULATION / TEST DRIVE":"LIVE PRODUCTION"}. User Insights Data Available: ${o?"YES":"NO"}. If data is available, use it to answer. `,K=(await F.generateContent([W,B])).response.text();m(X=>[...X,{id:Date.now().toString(),role:"model",content:K,timestamp:new Date}]),N("AI_INTERACTION","SUCCESS","Response generated via Gemini Core")}catch(H){m(F=>[...F,{id:Date.now().toString(),role:"system",content:`Error: ${H.message}`,timestamp:new Date}]),N("AI_FAILURE","FAILURE",H.message)}finally{v(!1)}}},R=B=>{m(G=>[...G,{id:Date.now().toString(),role:"model",content:B,timestamp:new Date}])},$=()=>a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 animate-in fade-in duration-500",children:[a.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[a.jsxs(ZN,{title:"System Configuration",action:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`h-2 w-2 rounded-full ${e.isSimulationMode?"bg-amber-400 animate-pulse":"bg-emerald-400"}`}),a.jsx("span",{className:"text-xs text-gray-400",children:e.isSimulationMode?"TEST DRIVE":"LIVE"})]}),children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"p-4 bg-gray-800/50 rounded-lg border border-gray-700",children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase mb-2",children:"Subscription Status"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xl font-bold text-white",children:e.subscriptionId?"ACTIVE":"INACTIVE"}),a.jsx(_ne,{status:e.subscriptionId?"ACTIVE":"DISCONNECTED"})]}),e.subscriptionId&&a.jsx("p",{className:"text-xs text-gray-500 mt-1 font-mono",children:e.subscriptionId})]}),a.jsxs("div",{className:"p-4 bg-gray-800/50 rounded-lg border border-gray-700",children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase mb-2",children:"Security Protocol"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xl font-bold text-white",children:"ENCRYPTED"}),a.jsx(_ne,{status:"HEALTHY"})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"AES-256 / TLS 1.3"})]})]}),a.jsxs("div",{className:"mt-6 flex flex-wrap gap-3",children:[e.subscriptionId?a.jsx(MS,{variant:"danger",onClick:()=>t(B=>({...B,subscriptionId:null})),children:"Terminate Link"}):a.jsx(MS,{onClick:_,disabled:c,children:c?"Initializing...":"Activate Monitoring"}),a.jsx(MS,{variant:"ghost",onClick:T,disabled:c,children:"Fetch Intelligence"}),a.jsx(MS,{variant:"ghost",onClick:()=>w(!0),children:"Configure Keys"}),a.jsx(MS,{variant:"success",onClick:P,children:e.isSimulationMode?"Disable Test Drive":"Kick the Tires (Demo Mode)"})]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:["Credit Velocity","Risk Vector","Liquidity Score"].map((B,G)=>a.jsxs(ZN,{className:"text-center py-4",children:[a.jsx("h4",{className:"text-xs text-gray-400 uppercase",children:B}),a.jsx("div",{className:"text-2xl font-bold text-cyan-400 mt-1",children:e.isSimulationMode?Math.floor(Math.random()*100)+800:"--"}),a.jsxs("div",{className:"text-xs text-emerald-500 mt-1 flex justify-center items-center",children:[a.jsx("svg",{className:"w-3 h-3 mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})}),e.isSimulationMode?"+2.4%":"0%"]})]},G))})]}),a.jsx("div",{className:"lg:col-span-1",children:a.jsxs(ZN,{title:"AI Command Core",className:"h-full flex flex-col",children:[a.jsxs("div",{className:"flex-1 overflow-y-auto max-h-[400px] space-y-3 mb-4 pr-2 custom-scrollbar",children:[h.map(B=>a.jsx("div",{className:`flex ${B.role==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[90%] p-3 rounded-lg text-sm ${B.role==="user"?"bg-cyan-900/50 text-cyan-100 border border-cyan-700":B.role==="system"?"bg-red-900/20 text-red-300 border border-red-800 font-mono text-xs":"bg-gray-800 text-gray-200 border border-gray-700"}`,children:B.content})},B.id)),x&&a.jsx("div",{className:"text-xs text-cyan-500 animate-pulse",children:"Core processing..."}),a.jsx("div",{ref:S})]}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:g,onChange:B=>y(B.target.value),onKeyDown:B=>B.key==="Enter"&&M(g),placeholder:"Ask Quantum AI...",className:"w-full bg-gray-900 border border-gray-700 rounded-lg pl-4 pr-10 py-2 text-sm text-white focus:border-cyan-500 focus:ring-1 focus:ring-cyan-500"}),a.jsx("button",{onClick:()=>M(g),className:"absolute right-2 top-2 text-cyan-500 hover:text-cyan-400",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 5l7 7-7 7M5 5l7 7-7 7"})})})]})]})})]}),D=()=>o?a.jsxs("div",{className:"space-y-6 animate-in slide-in-from-bottom-4 duration-500",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("h2",{className:"text-2xl font-bold text-white",children:["Intelligence Report ",a.jsxs("span",{className:"text-cyan-500",children:["#",o.user_insights_id.split("_").pop()]})]}),a.jsx(MS,{variant:"ghost",onClick:()=>r("DASHBOARD"),children:"Back to Command"})]}),o.items.map((B,G)=>{var H,F,W,U,K,X,J,te,re,ce,ae,oe;return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx(ZN,{title:"Income Velocity",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-xs text-gray-400 uppercase",children:"Forecasted Monthly"}),a.jsxs("div",{className:"text-2xl font-bold text-white",children:["$",(W=(F=(H=B.insights)==null?void 0:H.income)==null?void 0:F.forecasted_monthly_income)==null?void 0:W.current_amount.toLocaleString()]})]}),a.jsx("div",{className:"h-2 bg-gray-700 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full bg-gradient-to-r from-cyan-500 to-blue-600 w-[75%]"})}),a.jsx("div",{className:"flex justify-between text-xs text-gray-400",children:a.jsxs("span",{children:["Historical Annual: $",(X=(K=(U=B.insights)==null?void 0:U.income)==null?void 0:K.historical_annual_income)==null?void 0:X.current_amount.toLocaleString()]})})]})}),a.jsx(ZN,{title:"Liability Structure",children:a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"text-4xl font-bold text-white",children:((re=(te=(J=B.insights)==null?void 0:J.loans)==null?void 0:te.loan_payments_counts)==null?void 0:re.current_count)||0}),a.jsx("div",{className:"text-sm text-gray-400",children:"Active Loan Obligations"})]})})}),a.jsx(ZN,{title:"Institution Health",children:a.jsxs("div",{className:"flex flex-col justify-between h-full",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-lg font-semibold text-white",children:B.institution_name}),a.jsx("div",{className:"text-xs text-gray-500",children:B.institution_id})]}),a.jsx("div",{className:"mt-4",children:a.jsx(_ne,{status:((ce=B.status)==null?void 0:ce.status_code)||"UNKNOWN"})})]})})]}),a.jsxs(ZN,{title:"Asset Allocation & Transactions",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-gray-700 text-xs text-gray-400 uppercase",children:[a.jsx("th",{className:"p-3",children:"Account"}),a.jsx("th",{className:"p-3",children:"Type"}),a.jsx("th",{className:"p-3 text-right",children:"Balance"}),a.jsx("th",{className:"p-3 text-right",children:"Available"})]})}),a.jsx("tbody",{className:"text-sm text-gray-300",children:B.accounts.map((ue,fe)=>{var se;return a.jsxs("tr",{className:"border-b border-gray-800 hover:bg-gray-800/30 transition-colors",children:[a.jsxs("td",{className:"p-3 font-medium text-white",children:[ue.name," ",a.jsxs("span",{className:"text-gray-500",children:["(",ue.mask,")"]})]}),a.jsx("td",{className:"p-3 capitalize",children:ue.subtype}),a.jsxs("td",{className:"p-3 text-right font-mono text-cyan-400",children:["$",ue.balances.current.toLocaleString()]}),a.jsxs("td",{className:"p-3 text-right font-mono text-emerald-400",children:["$",(se=ue.balances.available)==null?void 0:se.toLocaleString()]})]},fe)})})]})}),a.jsxs("div",{className:"mt-6",children:[a.jsx("h4",{className:"text-sm text-gray-400 uppercase mb-3",children:"Recent Activity Stream"}),a.jsx("div",{className:"space-y-2",children:(oe=(ae=B.accounts[0])==null?void 0:ae.transactions)==null?void 0:oe.slice(0,5).map((ue,fe)=>a.jsxs("div",{className:"flex justify-between items-center p-3 bg-gray-800/30 rounded border border-gray-700/50",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`p-2 rounded-full ${ue.amount<0?"bg-emerald-500/10 text-emerald-500":"bg-red-500/10 text-red-500"}`,children:a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:ue.amount<0?a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 14l-7 7m0 0l-7-7m7 7V3"}):a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 10l7-7m0 0l7 7m-7-7v18"})})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-white",children:ue.merchant_name||ue.original_description}),a.jsx("div",{className:"text-xs text-gray-500",children:ue.date})]})]}),a.jsxs("div",{className:`font-mono font-bold ${ue.amount<0?"text-emerald-400":"text-white"}`,children:[Math.abs(ue.amount).toLocaleString()," ",ue.iso_currency_code]})]},fe))})]})]})]},G)})]}):a.jsx("div",{className:"text-center text-gray-500 py-10",children:"No Intelligence Data Available"}),z=()=>a.jsxs("div",{className:"h-full flex flex-col",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-white",children:"Immutable Audit Ledger"}),a.jsx("span",{className:"text-xs text-gray-500 font-mono",children:"SECURE_STORAGE_V4"})]}),a.jsxs("div",{className:"flex-1 bg-black/50 rounded-lg border border-gray-800 p-4 overflow-y-auto font-mono text-xs custom-scrollbar max-h-[500px]",children:[s.length===0&&a.jsx("div",{className:"text-gray-600 text-center mt-10",children:"No audit records found."}),s.map(B=>a.jsxs("div",{className:"mb-3 border-b border-gray-800 pb-2 last:border-0",children:[a.jsxs("div",{className:"flex justify-between text-gray-500 mb-1",children:[a.jsx("span",{children:B.timestamp}),a.jsx("span",{children:B.hash})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`w-2 h-2 rounded-full ${B.status==="SUCCESS"?"bg-emerald-500":B.status==="FAILURE"?"bg-red-500":B.status==="WARNING"?"bg-amber-500":"bg-blue-500"}`}),a.jsxs("span",{className:"text-cyan-400 font-bold",children:["[",B.action,"]"]}),a.jsx("span",{className:"text-gray-300",children:B.details})]}),a.jsxs("div",{className:"text-gray-600 mt-1 pl-4",children:["User: ",B.user]})]},B.id)),a.jsx("div",{ref:C})]})]}),V=()=>a.jsx("div",{className:"prose prose-invert max-w-none",children:a.jsx("div",{className:"bg-gray-800/50 p-6 rounded-xl border border-gray-700",children:a.jsx("pre",{className:"whitespace-pre-wrap font-sans text-gray-300 leading-relaxed",children:$hr})})});return a.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-gray-900 via-gray-900 to-black text-gray-100 font-sans selection:bg-cyan-500/30",children:[a.jsx("header",{className:"bg-gray-900/90 backdrop-blur-md border-b border-gray-800 sticky top-0 z-40",children:a.jsxs("div",{className:"container mx-auto px-6 py-4 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-gradient-to-tr from-cyan-500 to-blue-600 rounded-lg flex items-center justify-center shadow-lg shadow-cyan-500/20",children:a.jsx("span",{className:"font-bold text-white",children:"Q"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-lg font-bold text-white tracking-tight",children:"QUANTUM FINANCIAL"}),a.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-widest",children:"Enterprise Demo Environment"})]})]}),a.jsx("nav",{className:"hidden md:flex gap-1 bg-gray-800/50 p-1 rounded-lg border border-gray-700",children:["DASHBOARD","INSIGHTS","AUDIT","GUIDE"].map(B=>a.jsx("button",{onClick:()=>r(B),className:`px-4 py-1.5 rounded-md text-sm font-medium transition-all ${n===B?"bg-gray-700 text-white shadow-sm":"text-gray-400 hover:text-white hover:bg-gray-700/50"}`,children:B},B))}),a.jsx("div",{className:"flex items-center gap-4",children:a.jsxs("div",{className:"text-right hidden sm:block",children:[a.jsx("div",{className:"text-xs text-gray-400",children:"System Status"}),a.jsxs("div",{className:"text-xs font-bold text-emerald-400 flex items-center justify-end gap-1",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),"OPERATIONAL"]})]})})]})}),a.jsxs("main",{className:"container mx-auto px-6 py-8",children:[d&&a.jsxs("div",{className:"mb-6 bg-red-900/20 border border-red-500/50 text-red-200 p-4 rounded-lg flex items-center gap-3 animate-in slide-in-from-top-2",children:[a.jsx("svg",{className:"w-6 h-6 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),a.jsxs("div",{children:[a.jsx("div",{className:"font-bold",children:"System Error"}),a.jsx("div",{className:"text-sm opacity-80",children:d})]})]}),n==="DASHBOARD"&&$(),n==="INSIGHTS"&&D(),n==="AUDIT"&&z(),n==="GUIDE"&&V()]}),a.jsx(Dhr,{isOpen:b,onClose:()=>w(!1),title:"Secure Configuration",children:a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-sm text-gray-400",children:'Enter your credentials to unlock the full potential of the Quantum Engine. In "Test Drive" mode, these are optional.'}),a.jsx(iFe,{label:"Gemini API Key (AI Core)",type:"password",value:e.geminiKey,onChange:B=>t(G=>({...G,geminiKey:B.target.value})),placeholder:"sk-..."}),a.jsx(iFe,{label:"User Token (Plaid)",value:e.userToken,onChange:B=>t(G=>({...G,userToken:B.target.value})),placeholder:"user-sandbox-..."}),a.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[a.jsx(MS,{variant:"ghost",onClick:()=>w(!1),children:"Cancel"}),a.jsx(MS,{onClick:()=>{w(!1),N("CONFIG_UPDATE","SUCCESS","Secure credentials updated")},children:"Save Configuration"})]})]})}),a.jsx("style",{children:` .custom-scrollbar::-webkit-scrollbar { width: 6px; } .custom-scrollbar::-webkit-scrollbar-track { bg: rgba(0,0,0,0.1); } .custom-scrollbar::-webkit-scrollbar-thumb { background-color: rgba(75, 85, 99, 0.5); border-radius: 10px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background-color: rgba(107, 114, 128, 0.8); } `})]})},r9="Quantum Financial",Fhr=()=>`TRC-${Math.random().toString(36).substr(2,9).toUpperCase()}`,zhr=()=>`AUD-${Date.now()}-${Math.floor(Math.random()*1e3)}`,Bhr=["USD","EUR","GBP","JPY","SGD","CHF"],Hhr=[{id:"sec_1",timestamp:"10:42:01 AM",event:"Login Attempt",location:"New York, USA",status:"Success",ip:"192.168.1.1"},{id:"sec_2",timestamp:"10:45:22 AM",event:"API Key Access",location:"London, UK",status:"Success",ip:"10.0.0.55"},{id:"sec_3",timestamp:"11:01:05 AM",event:"High Value Transfer",location:"Singapore",status:"Pending Review",ip:"172.16.0.1"}],Vhr=({status:e})=>{let t="bg-gray-100 text-gray-800";return["Success","Completed","Active","Operational"].includes(e)&&(t="bg-green-100 text-green-800 border border-green-200"),["Pending","Review","Processing"].includes(e)&&(t="bg-yellow-100 text-yellow-800 border border-yellow-200"),["Failed","Blocked","Critical"].includes(e)&&(t="bg-red-100 text-red-800 border border-red-200"),a.jsx("span",{className:`px-2.5 py-0.5 rounded-full text-xs font-medium ${t}`,children:e})},aFe=({data:e,color:t="#06b6d4"})=>{const n=Math.max(...e),r=Math.min(...e),o=n-r||1,i=40,s=120,l=e.map((c,u)=>{const d=u/(e.length-1)*s,p=i-(c-r)/o*i;return`${d},${p}`}).join(" ");return a.jsxs("svg",{width:s,height:i,className:"overflow-visible",children:[a.jsx("polyline",{points:l,fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),a.jsx("circle",{cx:(e.length-1)*(s/(e.length-1)),cy:i-(e[e.length-1]-r)/o*i,r:"3",fill:t})]})},Uhr=()=>{var D,z;const e=f.useContext(ia),[t,n]=f.useState("DASHBOARD"),[r,o]=f.useState(!1),[i,s]=f.useState([]),[l,c]=f.useState([{id:"init",role:"ai",content:`Welcome to ${r9}. I am your Sovereign AI Architect. How can I assist with your treasury operations today?`,timestamp:new Date}]),[u,d]=f.useState(""),[p,h]=f.useState(!0),[m,g]=f.useState({recipient:"",amount:"",currency:"USD",reference:"",type:"WIRE",scheduleDate:""}),[y,x]=f.useState(!1),[v,b]=f.useState("STANDARD"),[w,S]=f.useState([]),C=f.useRef(null);f.useEffect(()=>{(async()=>{o(!0),await new Promise(B=>setTimeout(B,1200)),N("SYSTEM","INITIALIZATION","Quantum Core Services Hydrated",!0),o(!1)})()},[]),f.useEffect(()=>{var V;(V=C.current)==null||V.scrollIntoView({behavior:"smooth"})},[l,p]);const N=(V,B,G,H)=>{const F={id:zhr(),timestamp:new Date().toISOString(),userId:V,action:B,targetResource:G,success:H};s(W=>[F,...W])},j=(V,B="USD")=>new Intl.NumberFormat("en-US",{style:"currency",currency:B}).format(V),I=async()=>{var G;if(!u.trim())return;const V={id:Date.now().toString(),role:"user",content:u,timestamp:new Date};c(H=>[...H,V]),d("");const B="typing-"+Date.now();c(H=>[...H,{id:B,role:"ai",content:"...",timestamp:new Date,isTyping:!0}]);try{const H=e==null?void 0:e.geminiApiKey;let F="";H?F=(await new Ko({apiKey:H}).getGenerativeModel({model:"gemini-1.5-flash",systemInstruction:`You are the AI interface for ${r9}, a futuristic, elite business banking platform. Your tone is professional, concise, and slightly futuristic. You have control over the dashboard. If the user asks to see payments, say you are navigating them there. If the user asks about security, explain the quantum encryption protocols. Current View: ${t}. User Name: ${((G=e==null?void 0:e.userProfile)==null?void 0:G.name)||"Executive"}. Company: ${r9}. Do not mention Citibank. Use "The Demo Bank" or "Quantum Financial". Keep responses under 50 words unless asked for a detailed report.`}).generateContent({contents:[{role:"user",parts:[{text:u}]}]})).response.text():(await new Promise(U=>setTimeout(U,1500)),F="I am currently running in Simulation Mode as the Neural Link (API Key) is not connected. I can still guide you through the interface. Try clicking on 'Payments' to see our wire capabilities."),c(U=>U.filter(K=>K.id!==B).concat({id:Date.now().toString(),role:"ai",content:F,timestamp:new Date}));const W=u.toLowerCase();(W.includes("payment")||W.includes("wire")||W.includes("send"))&&n("PAYMENTS"),(W.includes("security")||W.includes("fraud"))&&n("SECURITY"),(W.includes("dashboard")||W.includes("home"))&&n("DASHBOARD"),(W.includes("audit")||W.includes("log"))&&n("AUDIT")}catch(H){console.error("AI Error",H),c(F=>F.filter(W=>W.id!==B).concat({id:Date.now().toString(),role:"system",content:"Neural Link disrupted. Please check your connection or API credentials.",timestamp:new Date}))}},_=async()=>{var B;if(!m.amount||!m.recipient)return;x(!0),N(((B=e==null?void 0:e.userProfile)==null?void 0:B.name)||"User","PAYMENT_INIT",`Initiating ${m.type} to ${m.recipient}`,!0),await new Promise(G=>setTimeout(G,2e3)),parseFloat(m.amount)>1e4&&v==="LOCKDOWN"?(N("SYSTEM","PAYMENT_BLOCK","Transaction blocked by Security Protocol Omega",!1),e==null||e.showNotification("Payment blocked: Security Lockdown Active","error")):(N("SYSTEM","PAYMENT_SUCCESS",`Transferred ${m.currency} ${m.amount} via ${m.type}`,!0),e==null||e.showNotification("Funds transfer executed successfully.","success"),g({...m,amount:"",recipient:"",reference:""})),x(!1)},T=()=>{var B;const V=v==="STANDARD"?"ELEVATED":v==="ELEVATED"?"LOCKDOWN":"STANDARD";b(V),N(((B=e==null?void 0:e.userProfile)==null?void 0:B.name)||"Admin","SEC_LEVEL_CHANGE",`Security Level changed to ${V}`,!0),e==null||e.showNotification(`Security Protocol updated to ${V}`,"info")},P=()=>{const V={alertId:`THR-${Date.now()}`,title:"Anomalous Login Vector",description:"Login attempt detected from unrecognized device in Pyongyang, North Korea.",timestamp:new Date().toISOString()};S(B=>[V,...B]),N("SYSTEM","THREAT_DETECT","High severity threat detected",!0),e==null||e.showNotification("CRITICAL: Security Threat Detected","error")},E=()=>a.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs(Ft,{variant:"interactive",className:"bg-gradient-to-br from-gray-800 to-gray-900",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400 text-sm font-medium uppercase tracking-wider",children:"Global Liquidity"}),a.jsx("h3",{className:"text-3xl font-bold text-white mt-2",children:j(245e5)}),a.jsxs("p",{className:"text-green-400 text-sm mt-1 flex items-center",children:[a.jsx("span",{className:"mr-1",children:"▲"})," 2.4% vs last close"]})]}),a.jsx("div",{className:"p-2 bg-blue-500/20 rounded-lg",children:a.jsx("svg",{className:"w-6 h-6 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})})]}),a.jsx("div",{className:"mt-4",children:a.jsx(aFe,{data:[40,42,45,41,48,52,50,55,58,60],color:"#3b82f6"})})]}),a.jsxs(Ft,{variant:"interactive",className:"bg-gradient-to-br from-gray-800 to-gray-900",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400 text-sm font-medium uppercase tracking-wider",children:"Working Capital"}),a.jsx("h3",{className:"text-3xl font-bold text-white mt-2",children:j(82e5)}),a.jsx("p",{className:"text-gray-400 text-sm mt-1",children:"Available for immediate deployment"})]}),a.jsx("div",{className:"p-2 bg-purple-500/20 rounded-lg",children:a.jsx("svg",{className:"w-6 h-6 text-purple-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"})})})]}),a.jsx("div",{className:"mt-4",children:a.jsx(aFe,{data:[30,32,31,35,34,38,40,42],color:"#a855f7"})})]}),a.jsxs(Ft,{variant:"interactive",className:"bg-gradient-to-br from-gray-800 to-gray-900",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-gray-400 text-sm font-medium uppercase tracking-wider",children:"Security Posture"}),a.jsx("h3",{className:"text-3xl font-bold text-white mt-2",children:"98.4%"}),a.jsx("p",{className:"text-green-400 text-sm mt-1",children:"Quantum Encryption Active"})]}),a.jsx("div",{className:"p-2 bg-green-500/20 rounded-lg",children:a.jsx("svg",{className:"w-6 h-6 text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})})})]}),a.jsx("div",{className:"mt-4 w-full bg-gray-700 rounded-full h-2",children:a.jsx("div",{className:"bg-green-500 h-2 rounded-full",style:{width:"98.4%"}})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsx("div",{className:"lg:col-span-2",children:a.jsxs(Ft,{title:"Real-Time Transaction Feed",variant:"default",className:"h-full",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-left text-sm text-gray-400",children:[a.jsx("thead",{className:"bg-gray-800/50 text-gray-200 uppercase font-medium",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-3",children:"Trace ID"}),a.jsx("th",{className:"px-4 py-3",children:"Counterparty"}),a.jsx("th",{className:"px-4 py-3",children:"Type"}),a.jsx("th",{className:"px-4 py-3 text-right",children:"Amount"}),a.jsx("th",{className:"px-4 py-3 text-center",children:"Status"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-700/50",children:[1,2,3,4,5].map(V=>a.jsxs("tr",{className:"hover:bg-gray-700/30 transition-colors",children:[a.jsx("td",{className:"px-4 py-3 font-mono text-xs text-gray-500",children:Fhr()}),a.jsx("td",{className:"px-4 py-3 text-white font-medium",children:["Alpha Corp","Omega Logistics","Sovereign Trust","Global Payroll","Azure Services"][V-1]}),a.jsx("td",{className:"px-4 py-3",children:["Wire","ACH","Internal","Batch","Card"][V-1]}),a.jsx("td",{className:"px-4 py-3 text-right text-white",children:j(Math.random()*5e4)}),a.jsx("td",{className:"px-4 py-3 text-center",children:a.jsx(Vhr,{status:["Completed","Processing","Completed","Review","Completed"][V-1]})})]},V))})]})}),a.jsx("div",{className:"mt-4 flex justify-end",children:a.jsxs("button",{className:"text-cyan-400 hover:text-cyan-300 text-sm font-medium flex items-center",children:["View Full Ledger ",a.jsx("svg",{className:"w-4 h-4 ml-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 8l4 4m0 0l-4 4m4-4H3"})})]})})]})}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(Ft,{title:"Quick Actions",variant:"outline",children:a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("button",{onClick:()=>n("PAYMENTS"),className:"p-3 bg-gray-700/50 hover:bg-cyan-600/20 hover:border-cyan-500/50 border border-transparent rounded-lg transition-all text-center group",children:[a.jsx("div",{className:"w-8 h-8 mx-auto bg-cyan-500/20 text-cyan-400 rounded-full flex items-center justify-center mb-2 group-hover:scale-110 transition-transform",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),a.jsx("span",{className:"text-xs font-medium text-gray-300",children:"New Wire"})]}),a.jsxs("button",{onClick:()=>n("SECURITY"),className:"p-3 bg-gray-700/50 hover:bg-red-600/20 hover:border-red-500/50 border border-transparent rounded-lg transition-all text-center group",children:[a.jsx("div",{className:"w-8 h-8 mx-auto bg-red-500/20 text-red-400 rounded-full flex items-center justify-center mb-2 group-hover:scale-110 transition-transform",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})})}),a.jsx("span",{className:"text-xs font-medium text-gray-300",children:"Security"})]}),a.jsxs("button",{className:"p-3 bg-gray-700/50 hover:bg-purple-600/20 hover:border-purple-500/50 border border-transparent rounded-lg transition-all text-center group",children:[a.jsx("div",{className:"w-8 h-8 mx-auto bg-purple-500/20 text-purple-400 rounded-full flex items-center justify-center mb-2 group-hover:scale-110 transition-transform",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),a.jsx("span",{className:"text-xs font-medium text-gray-300",children:"Reports"})]}),a.jsxs("button",{onClick:()=>n("AUDIT"),className:"p-3 bg-gray-700/50 hover:bg-yellow-600/20 hover:border-yellow-500/50 border border-transparent rounded-lg transition-all text-center group",children:[a.jsx("div",{className:"w-8 h-8 mx-auto bg-yellow-500/20 text-yellow-400 rounded-full flex items-center justify-center mb-2 group-hover:scale-110 transition-transform",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"})})}),a.jsx("span",{className:"text-xs font-medium text-gray-300",children:"Audit Log"})]})]})}),a.jsx(Ft,{title:"AI Insight",variant:"ghost",className:"bg-gradient-to-r from-indigo-900/40 to-purple-900/40 border border-indigo-500/30",children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"flex-shrink-0 mt-1",children:a.jsx("div",{className:"w-2 h-2 bg-cyan-400 rounded-full animate-pulse"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-indigo-200 italic",children:'"Based on current cash flow velocity, I recommend moving $2.5M to the Overnight Yield Facility to optimize returns by approximately $450/day."'}),a.jsx("button",{className:"mt-3 text-xs bg-indigo-600 hover:bg-indigo-500 text-white px-3 py-1 rounded transition-colors",children:"Execute Strategy"})]})]})})]})]})]}),M=()=>a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8 animate-fadeIn",children:[a.jsx(Ft,{title:"Initiate Transfer",variant:"default",children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:"Payment Type"}),a.jsx("div",{className:"flex space-x-2 p-1 bg-gray-900/50 rounded-lg",children:["WIRE","ACH","RTP"].map(V=>a.jsx("button",{onClick:()=>g({...m,type:V}),className:`flex-1 py-2 text-sm font-medium rounded-md transition-all ${m.type===V?"bg-cyan-600 text-white shadow-lg":"text-gray-400 hover:text-white hover:bg-gray-700"}`,children:V},V))})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:"Amount"}),a.jsxs("div",{className:"relative",children:[a.jsx("span",{className:"absolute left-3 top-2 text-gray-500",children:"$"}),a.jsx("input",{type:"number",value:m.amount,onChange:V=>g({...m,amount:V.target.value}),className:"w-full bg-gray-900 border border-gray-700 rounded-lg py-2 pl-8 pr-4 text-white focus:ring-2 focus:ring-cyan-500 focus:border-transparent outline-none",placeholder:"0.00"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:"Currency"}),a.jsx("select",{value:m.currency,onChange:V=>g({...m,currency:V.target.value}),className:"w-full bg-gray-900 border border-gray-700 rounded-lg py-2 px-3 text-white focus:ring-2 focus:ring-cyan-500 outline-none",children:Bhr.map(V=>a.jsx("option",{value:V,children:V},V))})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:"Recipient"}),a.jsx("input",{type:"text",value:m.recipient,onChange:V=>g({...m,recipient:V.target.value}),className:"w-full bg-gray-900 border border-gray-700 rounded-lg py-2 px-4 text-white focus:ring-2 focus:ring-cyan-500 outline-none",placeholder:"Company or Individual Name"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:"Reference (Optional)"}),a.jsx("input",{type:"text",value:m.reference,onChange:V=>g({...m,reference:V.target.value}),className:"w-full bg-gray-900 border border-gray-700 rounded-lg py-2 px-4 text-white focus:ring-2 focus:ring-cyan-500 outline-none",placeholder:"Invoice #, PO #"})]}),a.jsxs("div",{className:"pt-4",children:[a.jsx("button",{onClick:_,disabled:y||!m.amount||!m.recipient,className:`w-full py-3 rounded-lg font-bold text-white shadow-lg transition-all flex justify-center items-center ${y?"bg-gray-600 cursor-not-allowed":"bg-gradient-to-r from-cyan-600 to-blue-600 hover:from-cyan-500 hover:to-blue-500 hover:shadow-cyan-500/25"}`,children:y?a.jsxs(a.Fragment,{children:[a.jsxs("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[a.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),a.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Processing Secure Transfer..."]}):"Authorize Payment"}),a.jsxs("p",{className:"text-center text-xs text-gray-500 mt-3",children:[a.jsx("span",{className:"inline-block w-2 h-2 bg-green-500 rounded-full mr-1"}),"Secure Connection • 256-bit Encryption • Audit Logged"]})]})]})}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs(Ft,{title:"Global Payment Map",variant:"interactive",className:"h-64 relative overflow-hidden group",children:[a.jsx("div",{className:"absolute inset-0 bg-gray-900 opacity-50"}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsxs("div",{className:"w-full h-full relative",children:[a.jsx("div",{className:"absolute top-1/4 left-1/4 w-3 h-3 bg-cyan-500 rounded-full animate-ping"}),a.jsx("div",{className:"absolute top-1/2 left-1/2 w-2 h-2 bg-blue-500 rounded-full"}),a.jsx("div",{className:"absolute bottom-1/3 right-1/4 w-2 h-2 bg-purple-500 rounded-full"}),a.jsxs("svg",{className:"absolute inset-0 w-full h-full pointer-events-none",children:[a.jsx("path",{d:"M150 100 Q 300 200 450 250",stroke:"rgba(6,182,212,0.3)",strokeWidth:"1",fill:"none",className:"animate-pulse"}),a.jsx("path",{d:"M450 250 Q 300 300 150 350",stroke:"rgba(168,85,247,0.3)",strokeWidth:"1",fill:"none"})]})]})}),a.jsxs("div",{className:"absolute bottom-4 left-4",children:[a.jsx("p",{className:"text-white font-bold",children:"Live Network Status"}),a.jsx("p",{className:"text-xs text-green-400",children:"All Corridors Operational"})]})]}),a.jsx(Ft,{title:"Recent Beneficiaries",variant:"outline",children:a.jsx("ul",{className:"divide-y divide-gray-700/50",children:["Tesla Inc.","SpaceX Logistics","Neuralink Corp","Boring Company"].map((V,B)=>a.jsxs("li",{className:"py-3 flex justify-between items-center hover:bg-gray-800/50 px-2 rounded transition-colors cursor-pointer",onClick:()=>g({...m,recipient:V}),children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-700 flex items-center justify-center text-xs font-bold text-gray-300 mr-3",children:V.substring(0,2).toUpperCase()}),a.jsx("span",{className:"text-sm text-gray-300",children:V})]}),a.jsx("button",{className:"text-xs text-cyan-500 hover:text-cyan-400",children:"Select"})]},B))})})]})]}),R=()=>a.jsxs("div",{className:"space-y-6 animate-fadeIn",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx(Ft,{className:"bg-red-900/20 border-red-500/30",children:a.jsxs("div",{className:"text-center p-4",children:[a.jsx("h3",{className:"text-gray-400 text-sm uppercase tracking-widest",children:"Threat Level"}),a.jsx("div",{className:"text-4xl font-black text-red-500 mt-2 animate-pulse",children:w.length>0?"CRITICAL":"LOW"}),a.jsxs("p",{className:"text-xs text-red-300 mt-2",children:[w.length," Active Incursions Detected"]})]})}),a.jsx(Ft,{className:"bg-blue-900/20 border-blue-500/30",children:a.jsxs("div",{className:"text-center p-4",children:[a.jsx("h3",{className:"text-gray-400 text-sm uppercase tracking-widest",children:"Protocol Status"}),a.jsx("div",{className:`text-4xl font-black mt-2 ${v==="LOCKDOWN"?"text-yellow-500":"text-blue-500"}`,children:v}),a.jsx("button",{onClick:T,className:"mt-3 text-xs bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded text-white transition-colors",children:"Change Protocol"})]})}),a.jsx(Ft,{className:"bg-green-900/20 border-green-500/30",children:a.jsxs("div",{className:"text-center p-4",children:[a.jsx("h3",{className:"text-gray-400 text-sm uppercase tracking-widest",children:"System Integrity"}),a.jsx("div",{className:"text-4xl font-black text-green-500 mt-2",children:"100%"}),a.jsx("p",{className:"text-xs text-green-300 mt-2",children:"Core Ledger Verified"})]})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsx("div",{className:"lg:col-span-2",children:a.jsx(Ft,{title:"Live Threat Monitor",variant:"default",children:a.jsxs("div",{className:"h-64 bg-black rounded-lg border border-gray-800 relative overflow-hidden font-mono text-xs p-4",children:[w.length===0?a.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-gray-600",children:a.jsxs("div",{className:"text-center",children:[a.jsx("svg",{className:"w-12 h-12 mx-auto mb-2 opacity-50",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),a.jsx("p",{children:"No Active Threats Detected"}),a.jsx("p",{className:"text-gray-700 mt-1",children:"Scanning Global Nodes..."})]})}):a.jsx("div",{className:"space-y-2",children:w.map(V=>a.jsxs("div",{className:"bg-red-900/30 border border-red-500/50 p-2 rounded text-red-200 flex justify-between items-center animate-pulse",children:[a.jsxs("span",{children:["[",new Date(V.timestamp).toLocaleTimeString(),"] ",V.title.toUpperCase()]}),a.jsx("span",{className:"bg-red-600 text-white px-2 py-0.5 rounded text-[10px]",children:"BLOCKING"})]},V.alertId))}),a.jsx("div",{className:"absolute bottom-4 right-4",children:a.jsx("button",{onClick:P,className:"bg-gray-800 hover:bg-red-900/50 text-gray-400 hover:text-red-400 border border-gray-700 hover:border-red-500 px-3 py-1 rounded text-xs transition-all",children:"Simulate Attack"})})]})})}),a.jsx("div",{className:"space-y-6",children:a.jsx(Ft,{title:"Access Logs",variant:"outline",children:a.jsx("ul",{className:"space-y-3",children:Hhr.map(V=>a.jsxs("li",{className:"text-xs",children:[a.jsxs("div",{className:"flex justify-between text-gray-400 mb-1",children:[a.jsx("span",{children:V.timestamp}),a.jsx("span",{className:V.status==="Success"?"text-green-400":"text-yellow-400",children:V.status})]}),a.jsx("div",{className:"text-gray-200 font-medium",children:V.event}),a.jsxs("div",{className:"text-gray-500",children:[V.location," • ",V.ip]})]},V.id))})})})]})]}),$=()=>a.jsx(Ft,{title:"Immutable Audit Ledger",variant:"default",className:"animate-fadeIn",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-left text-sm text-gray-400",children:[a.jsx("thead",{className:"bg-gray-800/50 text-gray-200 uppercase font-medium",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-3",children:"Timestamp"}),a.jsx("th",{className:"px-4 py-3",children:"Audit ID"}),a.jsx("th",{className:"px-4 py-3",children:"User"}),a.jsx("th",{className:"px-4 py-3",children:"Action"}),a.jsx("th",{className:"px-4 py-3",children:"Resource"}),a.jsx("th",{className:"px-4 py-3 text-center",children:"Result"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-700/50 font-mono text-xs",children:i.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-500",children:"Ledger is empty. Perform actions to generate logs."})}):i.map(V=>a.jsxs("tr",{className:"hover:bg-gray-700/30 transition-colors",children:[a.jsx("td",{className:"px-4 py-3 text-gray-500",children:new Date(V.timestamp).toLocaleTimeString()}),a.jsx("td",{className:"px-4 py-3 text-cyan-600",children:V.id}),a.jsx("td",{className:"px-4 py-3 text-white",children:V.userId}),a.jsx("td",{className:"px-4 py-3 text-yellow-500",children:V.action}),a.jsx("td",{className:"px-4 py-3",children:V.targetResource}),a.jsx("td",{className:"px-4 py-3 text-center",children:V.success?a.jsx("span",{className:"text-green-400",children:"✔ CONFIRMED"}):a.jsx("span",{className:"text-red-400",children:"✘ REJECTED"})})]},V.id))})]})})});return r?a.jsxs("div",{className:"min-h-screen bg-gray-900 flex flex-col items-center justify-center text-white",children:[a.jsx("div",{className:"w-16 h-16 border-4 border-cyan-500 border-t-transparent rounded-full animate-spin mb-4"}),a.jsx("h2",{className:"text-xl font-bold tracking-widest animate-pulse",children:"INITIALIZING QUANTUM CORE"}),a.jsx("p",{className:"text-gray-500 text-sm mt-2",children:"Establishing Secure Handshake..."})]}):a.jsxs("div",{className:"min-h-screen bg-gray-950 text-gray-100 font-sans selection:bg-cyan-500/30",children:[a.jsx("header",{className:"bg-gray-900 border-b border-gray-800 sticky top-0 z-30",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-cyan-500 to-blue-600 rounded-lg flex items-center justify-center shadow-lg shadow-cyan-500/20",children:a.jsx("span",{className:"text-white font-bold text-lg",children:"Q"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-lg font-bold text-white tracking-tight",children:r9}),a.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-widest",children:"Enterprise Demo Environment"})]})]}),a.jsx("nav",{className:"hidden md:flex space-x-1",children:["DASHBOARD","PAYMENTS","SECURITY","AUDIT"].map(V=>a.jsx("button",{onClick:()=>n(V),className:`px-4 py-2 rounded-md text-sm font-medium transition-all ${t===V?"bg-gray-800 text-white shadow-inner":"text-gray-400 hover:text-white hover:bg-gray-800/50"}`,children:V},V))}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"hidden md:block text-right",children:[a.jsx("p",{className:"text-sm text-white font-medium",children:((D=e==null?void 0:e.userProfile)==null?void 0:D.name)||"Guest User"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Sovereign Access"})]}),a.jsx("div",{className:"w-8 h-8 rounded-full bg-gray-700 border border-gray-600 overflow-hidden",children:a.jsx("img",{src:`https://api.dicebear.com/7.x/avataaars/svg?seed=${((z=e==null?void 0:e.userProfile)==null?void 0:z.name)||"Guest"}`,alt:"Avatar"})})]})]})}),a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 flex gap-6 relative",children:[a.jsxs("main",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"mb-6 flex justify-between items-end",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold text-white",children:t==="DASHBOARD"?"Treasury Overview":t.charAt(0)+t.slice(1).toLowerCase()}),a.jsxs("p",{className:"text-gray-400 text-sm mt-1",children:[t==="DASHBOARD"&&"Real-time liquidity and operational insights.",t==="PAYMENTS"&&"Execute secure domestic and international transfers.",t==="SECURITY"&&"Monitor threats and manage access protocols.",t==="AUDIT"&&"Immutable record of all system activities."]})]}),a.jsx("div",{className:"flex space-x-2",children:a.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-900/30 text-blue-400 border border-blue-500/20",children:[a.jsx("span",{className:"w-1.5 h-1.5 bg-blue-400 rounded-full mr-1.5 animate-pulse"}),"Live Data Feed"]})})]}),t==="DASHBOARD"&&E(),t==="PAYMENTS"&&M(),t==="SECURITY"&&R(),t==="AUDIT"&&$()]}),a.jsxs("aside",{className:`fixed inset-y-0 right-0 w-96 bg-gray-900 border-l border-gray-800 shadow-2xl transform transition-transform duration-300 z-40 flex flex-col ${p?"translate-x-0":"translate-x-full"}`,children:[!p&&a.jsx("button",{onClick:()=>h(!0),className:"absolute left-0 top-1/2 -translate-x-full bg-cyan-600 text-white p-2 rounded-l-lg shadow-lg hover:bg-cyan-500 transition-colors",children:a.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})})}),a.jsxs("div",{className:"p-4 border-b border-gray-800 flex justify-between items-center bg-gray-800/50",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),a.jsx("h3",{className:"font-bold text-white",children:"Sovereign AI"})]}),a.jsx("button",{onClick:()=>h(!1),className:"text-gray-400 hover:text-white",children:a.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 custom-scrollbar",children:[l.map(V=>a.jsx("div",{className:`flex ${V.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[85%] rounded-2xl px-4 py-3 text-sm ${V.role==="user"?"bg-cyan-600 text-white rounded-br-none":V.role==="system"?"bg-red-900/20 text-red-300 border border-red-500/20 w-full text-center":"bg-gray-800 text-gray-200 rounded-bl-none border border-gray-700"}`,children:[V.isTyping?a.jsxs("div",{className:"flex space-x-1 h-5 items-center",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("div",{className:"w-1.5 h-1.5 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("div",{className:"w-1.5 h-1.5 bg-gray-400 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]}):a.jsx("p",{children:V.content}),V.role!=="system"&&!V.isTyping&&a.jsx("p",{className:`text-[10px] mt-1 ${V.role==="user"?"text-cyan-200":"text-gray-500"}`,children:V.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})},V.id)),a.jsx("div",{ref:C})]}),a.jsxs("div",{className:"p-4 border-t border-gray-800 bg-gray-900",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:u,onChange:V=>d(V.target.value),onKeyDown:V=>V.key==="Enter"&&I(),placeholder:"Ask about cash flow, initiate wires...",className:"w-full bg-gray-800 text-white rounded-xl pl-4 pr-12 py-3 text-sm focus:ring-2 focus:ring-cyan-500 focus:outline-none border border-gray-700"}),a.jsx("button",{onClick:I,className:"absolute right-2 top-2 p-1.5 bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg transition-colors",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})})]}),a.jsx("p",{className:"text-center text-[10px] text-gray-600 mt-2",children:'AI can execute dashboard actions. Try "Show me security alerts".'})]})]}),p&&a.jsx("div",{className:"hidden lg:block w-96 flex-shrink-0"})]})]})};var qmt=(e=>(e.Assets="assets",e.Auth="auth",e.Balance="balance",e.Identity="identity",e.Investments="investments",e.Liabilities="liabilities",e.PaymentInitiation="payment_initiation",e.Transactions="transactions",e))(qmt||{});const LM={itemGet:e=>Promise.resolve({data:{item:{}}}),itemActivityList:e=>Promise.resolve({data:{activities:[]}}),itemApplicationList:e=>Promise.resolve({data:{applications:[]}}),itemApplicationUnlink:e=>Promise.resolve({data:{status:"unlinked"}}),itemApplicationScopesUpdate:e=>Promise.resolve({data:{status:"updated"}})},Oi={container:{fontFamily:"Arial, sans-serif",color:"#333",maxWidth:"1000px",margin:"20px auto",padding:"20px",border:"1px solid #ddd",borderRadius:"8px",boxShadow:"0 2px 4px rgba(0,0,0,0.1)"},header:{borderBottom:"1px solid #eee",paddingBottom:"10px",marginBottom:"20px"},title:{fontSize:"24px",margin:0},loading:{textAlign:"center",padding:"50px",fontSize:"18px"},error:{color:"red",backgroundColor:"#ffeeee",border:"1px solid red",padding:"15px",borderRadius:"4px",margin:"20px 0"},infoCard:{backgroundColor:"#f9f9f9",padding:"15px",borderRadius:"8px",marginBottom:"20px",display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px"},infoItem:{display:"flex",flexDirection:"column"},infoLabel:{fontWeight:"bold",fontSize:"12px",color:"#555",marginBottom:"4px"},infoValue:{fontSize:"14px",wordBreak:"break-all"},badge:{display:"inline-block",padding:"4px 8px",fontSize:"12px",borderRadius:"12px",backgroundColor:"#e0e0e0",marginRight:"5px",marginBottom:"5px"},tabs:{display:"flex",borderBottom:"1px solid #ccc",marginBottom:"20px"},tabButton:{padding:"10px 20px",border:"none",background:"none",cursor:"pointer",fontSize:"16px",borderBottom:"3px solid transparent"},activeTab:{borderBottom:"3px solid #007bff",fontWeight:"bold"},appList:{display:"flex",flexDirection:"column",gap:"15px"},appCard:{border:"1px solid #ddd",borderRadius:"8px",padding:"15px",display:"flex",justifyContent:"space-between",alignItems:"center"},appInfo:{display:"flex",alignItems:"center",gap:"15px"},appLogo:{width:"40px",height:"40px",borderRadius:"50%",objectFit:"cover",backgroundColor:"#eee"},appName:{fontWeight:"bold"},appScopes:{fontSize:"12px",color:"#666",marginTop:"4px"},appActions:{display:"flex",gap:"10px"},button:{padding:"8px 12px",border:"1px solid #ccc",borderRadius:"4px",cursor:"pointer",background:"#fff"},buttonDanger:{borderColor:"#dc3545",color:"#dc3545"},modalOverlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0,0,0,0.5)",display:"flex",justifyContent:"center",alignItems:"center"},modalContent:{background:"white",padding:"20px",borderRadius:"8px",width:"400px",boxShadow:"0 4px 8px rgba(0,0,0,0.2)"},modalHeader:{fontSize:"20px",marginBottom:"20px"},modalFooter:{display:"flex",justifyContent:"flex-end",gap:"10px",marginTop:"20px"},scopeOption:{display:"block",marginBottom:"10px"}},Whr=({item:e})=>e?a.jsxs("div",{style:Oi.infoCard,children:[a.jsxs("div",{style:Oi.infoItem,children:[a.jsx("span",{style:Oi.infoLabel,children:"Item ID"}),a.jsx("span",{style:Oi.infoValue,children:e.item_id})]}),a.jsxs("div",{style:Oi.infoItem,children:[a.jsx("span",{style:Oi.infoLabel,children:"Institution ID"}),a.jsx("span",{style:Oi.infoValue,children:e.institution_id})]}),a.jsxs("div",{style:Oi.infoItem,children:[a.jsx("span",{style:Oi.infoLabel,children:"Products"}),a.jsx("div",{children:e.products.map(t=>a.jsx("span",{style:Oi.badge,children:t},t))})]}),a.jsxs("div",{style:Oi.infoItem,children:[a.jsx("span",{style:Oi.infoLabel,children:"Consent Expires"}),a.jsx("span",{style:Oi.infoValue,children:e.consent_expiration_time?new Date(e.consent_expiration_time).toLocaleString():"N/A"})]})]}):null,Ghr=({app:e,onClose:t,onSave:n})=>{var c;const r=Object.values(qmt),[o,i]=f.useState(((c=e.scopes)==null?void 0:c.products)||[]),s=(u,d)=>{i(p=>d?[...p,u]:p.filter(h=>h!==u))},l=()=>{var d,p;const u={...e.scopes,products:o,accounts:((d=e.scopes)==null?void 0:d.accounts)||[],new_accounts:((p=e.scopes)==null?void 0:p.new_accounts)||!0};n(u)};return a.jsx("div",{style:Oi.modalOverlay,children:a.jsxs("div",{style:Oi.modalContent,children:[a.jsxs("h3",{style:Oi.modalHeader,children:["Update Scopes for ",e.name]}),a.jsx("div",{children:r.map(u=>a.jsxs("label",{style:Oi.scopeOption,children:[a.jsx("input",{type:"checkbox",checked:o.includes(u),onChange:d=>s(u,d.target.checked)}),a.jsx("span",{style:{marginLeft:"8px"},children:u})]},u))}),a.jsxs("div",{style:Oi.modalFooter,children:[a.jsx("button",{style:Oi.button,onClick:t,children:"Cancel"}),a.jsx("button",{style:{...Oi.button,background:"#007bff",color:"white",borderColor:"#007bff"},onClick:l,children:"Save Changes"})]})]})})},qhr=({accessToken:e})=>{const[t,n]=f.useState(null),[r,o]=f.useState([]),[i,s]=f.useState([]),[l,c]=f.useState("activity"),[u,d]=f.useState(!1),[p,h]=f.useState(null),[m,g]=f.useState(null),y=f.useCallback(async()=>{var S,C;if(!e){n(null),o([]),s([]);return}d(!0),h(null);try{const[N,j,I]=await Promise.all([LM.itemGet({access_token:e}),LM.itemActivityList({access_token:e}),LM.itemApplicationList({access_token:e})]);n(N.data.item),o(j.data.activities),s(I.data.applications)}catch(N){h(((C=(S=N.response)==null?void 0:S.data)==null?void 0:C.error_message)||N.message||"An unknown error occurred.")}finally{d(!1)}},[e]);f.useEffect(()=>{y()},[y]);const x=async S=>{var C,N;if(window.confirm("Are you sure you want to unlink this application? This action cannot be undone."))try{await LM.itemApplicationUnlink({access_token:e,application_id:S}),alert("Application unlinked successfully."),y()}catch(j){alert(`Failed to unlink application: ${((N=(C=j.response)==null?void 0:C.data)==null?void 0:N.error_message)||j.message}`)}},v=async S=>{var C,N;if(m)try{await LM.itemApplicationScopesUpdate({access_token:e,application_id:m.application_id,scopes:S,context:"MANUAL_UPDATE"}),alert("Scopes updated successfully."),g(null),y()}catch(j){alert(`Failed to update scopes: ${((N=(C=j.response)==null?void 0:C.data)==null?void 0:N.error_message)||j.message}`)}},b=f.useMemo(()=>a.jsx("div",{children:r.length>0?a.jsxs("table",{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{style:{textAlign:"left",padding:"8px"},children:"Date"}),a.jsx("th",{style:{textAlign:"left",padding:"8px"},children:"Description"}),a.jsx("th",{style:{textAlign:"left",padding:"8px"},children:"Initiator"})]})}),a.jsx("tbody",{children:r.map(S=>a.jsxs("tr",{children:[a.jsx("td",{style:{padding:"8px"},children:new Date(S.initiated_date).toLocaleString()}),a.jsx("td",{style:{padding:"8px"},children:S.initiated_description}),a.jsx("td",{style:{padding:"8px"},children:S.initiator})]},S.activity_id))})]}):a.jsx("p",{children:"No activity found for this item."})}),[r]),w=f.useMemo(()=>a.jsx("div",{style:Oi.appList,children:i.length>0?i.map(S=>{var C,N;return a.jsxs("div",{style:Oi.appCard,children:[a.jsxs("div",{style:Oi.appInfo,children:[a.jsx("img",{src:S.logo_url||void 0,alt:`${S.name} logo`,style:Oi.appLogo}),a.jsxs("div",{children:[a.jsx("div",{style:Oi.appName,children:S.name}),a.jsxs("div",{style:Oi.appScopes,children:["Scopes: ",((N=(C=S.scopes)==null?void 0:C.products)==null?void 0:N.join(", "))||"N/A"]})]})]}),a.jsxs("div",{style:Oi.appActions,children:[a.jsx("button",{style:Oi.button,onClick:()=>g(S),children:"Update Scopes"}),a.jsx("button",{style:{...Oi.button,...Oi.buttonDanger},onClick:()=>x(S.application_id),children:"Unlink"})]})]},S.application_id)}):a.jsx("p",{children:"No connected applications found for this item."})}),[i,e]);return a.jsxs("div",{style:Oi.container,children:[a.jsx("header",{style:Oi.header,children:a.jsx("h1",{style:Oi.title,children:"Plaid Item Management"})}),u&&a.jsx("div",{style:Oi.loading,children:"Loading item data..."}),p&&a.jsx("div",{style:Oi.error,children:a.jsx("pre",{children:p})}),!u&&!p&&t&&a.jsxs(a.Fragment,{children:[a.jsx(Whr,{item:t}),a.jsxs("nav",{style:Oi.tabs,children:[a.jsx("button",{style:{...Oi.tabButton,...l==="activity"?Oi.activeTab:{}},onClick:()=>c("activity"),children:"Activity"}),a.jsx("button",{style:{...Oi.tabButton,...l==="applications"?Oi.activeTab:{}},onClick:()=>c("applications"),children:"Connected Applications"})]}),a.jsxs("div",{children:[l==="activity"&&b,l==="applications"&&w]})]}),m&&a.jsx(Ghr,{app:m,onClose:()=>g(null),onSave:v})]})},Khr=()=>{const{plaidProducts:e,deductCredits:t,showNotification:n,geminiApiKey:r,userProfile:o,broadcastEvent:i}=f.useContext(ia),[s,l]=f.useState("overview"),[c,u]=f.useState(""),[d,p]=f.useState([{id:"init",role:"ai",content:"Greetings, Architect. I am the Quantum Financial AI Core. Ready to analyze banking data streams.",timestamp:new Date}]),[h,m]=f.useState(!1),[g,y]=f.useState([]),[x,v]=f.useState(!1),[b,w]=f.useState(0),S=f.useRef(null);f.useEffect(()=>{var I;(I=S.current)==null||I.scrollIntoView({behavior:"smooth"})},[d]);const C=(I,_,T)=>{const P={id:Math.random().toString(36).substr(2,9),action:I,status:_,timestamp:new Date().toLocaleTimeString(),details:T};y(E=>[P,...E]),i("AUDIT_LOG",P)},N=async()=>{if(!c.trim())return;const I={id:Date.now().toString(),role:"user",content:c,timestamp:new Date};p(_=>[..._,I]),u(""),m(!0);try{const _=r||void 0||"";if(!_)throw new Error("API Key missing. Please configure GEMINI_API_KEY.");const T=new Ko({apiKey:_}),P=` You are the AI engine for Quantum Financial (formerly a global bank demo). You are helpful, professional, and elite. Current User: ${o.name}. Role: ${o.title}. Context: Business Banking Demo. Do NOT mention "Citibank". Use "Quantum Financial". `,R=(await T.getGenerativeModel({model:"gemini-1.5-flash"}).generateContent({contents:[{role:"user",parts:[{text:P+` User Query: `+I.content}]}]})).response.text(),$={id:(Date.now()+1).toString(),role:"ai",content:R,timestamp:new Date};p(D=>[...D,$]),C("AI_INTERACTION","SUCCESS","Generated response for user query")}catch(_){console.error("AI Error:",_);const T={id:(Date.now()+1).toString(),role:"system",content:`Error: ${_.message||"Neural link severed."}`,timestamp:new Date};p(P=>[...P,T]),C("AI_INTERACTION","FAILED",_.message)}finally{m(!1)}},j=()=>{v(!0),w(0),C("IDV_INITIATED","PENDING","User initiated Identity Verification"),setTimeout(()=>w(1),1500),setTimeout(()=>w(2),3e3),setTimeout(()=>{w(3),C("IDV_COMPLETE","SUCCESS","Identity Verified: High Confidence"),n("Identity Verification Complete","success")},4500)};return a.jsxs("div",{className:"h-full flex flex-col space-y-6 p-2 animate-in fade-in duration-500 overflow-y-auto custom-scrollbar",children:[a.jsxs("header",{className:"flex flex-col md:flex-row justify-between items-start md:items-end gap-6 border-b border-gray-800 pb-6",children:[a.jsxs("div",{children:[a.jsxs("h1",{className:"text-4xl font-black text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-cyan-200 uppercase italic tracking-tighter",children:["Quantum Financial ",a.jsx("span",{className:"text-white not-italic text-2xl font-light",children:"| Nexus"})]}),a.jsx("p",{className:"text-blue-400/60 text-xs font-mono mt-2 tracking-[0.3em] uppercase",children:"Global Banking Demo Environment // v4.2.0-RC"})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"bg-gray-900/50 border border-gray-700 px-4 py-2 rounded-lg flex items-center gap-3",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500 animate-pulse"}),a.jsx("span",{className:"text-xs font-bold text-gray-300 uppercase tracking-wider",children:"System Optimal"})]}),a.jsx("button",{onClick:()=>C("SYSTEM_CHECK","SUCCESS","Manual system diagnostic run"),className:"p-2 bg-blue-600/20 hover:bg-blue-600/40 text-blue-400 rounded-lg transition-colors",children:a.jsx(qf,{size:18})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6 flex-1 min-h-0",children:[a.jsxs("div",{className:"lg:col-span-8 flex flex-col gap-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsx(Ft,{variant:"interactive",className:"group",onClick:()=>l("overview"),children:a.jsxs("div",{className:"flex flex-col items-center text-center space-y-3 p-2",children:[a.jsx("div",{className:"p-3 bg-blue-500/10 rounded-full text-blue-400 group-hover:bg-blue-500 group-hover:text-white transition-all",children:a.jsx(Xi,{size:24})}),a.jsx("h3",{className:"font-bold text-gray-200",children:"Live Monitoring"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Real-time transaction flow analysis"})]})}),a.jsx(Ft,{variant:"interactive",className:"group",onClick:j,children:a.jsxs("div",{className:"flex flex-col items-center text-center space-y-3 p-2",children:[a.jsx("div",{className:"p-3 bg-purple-500/10 rounded-full text-purple-400 group-hover:bg-purple-500 group-hover:text-white transition-all",children:a.jsx(tT,{size:24})}),a.jsx("h3",{className:"font-bold text-gray-200",children:"Identity Verify"}),a.jsx("p",{className:"text-xs text-gray-500",children:"KYC/AML Compliance Check"})]})}),a.jsx(Ft,{variant:"interactive",className:"group",onClick:()=>l("network"),children:a.jsxs("div",{className:"flex flex-col items-center text-center space-y-3 p-2",children:[a.jsx("div",{className:"p-3 bg-amber-500/10 rounded-full text-amber-400 group-hover:bg-amber-500 group-hover:text-white transition-all",children:a.jsx(vi,{size:24})}),a.jsx("h3",{className:"font-bold text-gray-200",children:"Global Mesh"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Cross-border payment rails"})]})})]}),a.jsxs(Ft,{className:"flex-1 min-h-[400px] relative overflow-hidden border-blue-500/20",children:[a.jsx("div",{className:"absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-10"}),s==="overview"&&a.jsxs("div",{className:"space-y-6 relative z-10",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h3",{className:"text-xl font-bold text-white flex items-center gap-2",children:[a.jsx(rl,{className:"text-blue-400"})," Data Ingress Streams"]}),a.jsxs("span",{className:"text-xs font-mono text-gray-500",children:["UPDATED: ",new Date().toLocaleTimeString()]})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:e.map((I,_)=>a.jsxs("div",{className:"bg-gray-900/80 border border-gray-700 p-4 rounded-xl flex items-center justify-between hover:border-blue-500/50 transition-colors",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`w-2 h-12 rounded-full ${["bg-blue-500","bg-purple-500","bg-green-500","bg-amber-500"][_%4]}`}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-bold text-gray-200 uppercase",children:I}),a.jsxs("div",{className:"text-[10px] text-gray-500 font-mono",children:["LATENCY: ",10+Math.floor(Math.random()*40),"ms"]})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-xs font-bold text-green-400",children:"ACTIVE"}),a.jsx("div",{className:"text-[10px] text-gray-600",children:"99.99% UPTIME"})]})]},I))}),a.jsxs("div",{className:"mt-8 p-6 bg-blue-900/10 border border-blue-500/20 rounded-xl",children:[a.jsx("h4",{className:"text-sm font-bold text-blue-300 mb-2 uppercase tracking-wider",children:"System Notification"}),a.jsx("p",{className:"text-sm text-gray-400 leading-relaxed",children:"Quantum Financial's demo environment is currently operating at peak efficiency. All payment rails (ACH, Wire, RTP) are active. Fraud monitoring heuristics are engaged. This is a simulated environment for demonstration purposes."})]})]}),s==="network"&&a.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center space-y-6 relative z-10",children:[a.jsxs("div",{className:"w-64 h-64 relative",children:[a.jsx("div",{className:"absolute inset-0 border-4 border-blue-500/20 rounded-full animate-[spin_10s_linear_infinite]"}),a.jsx("div",{className:"absolute inset-4 border-4 border-purple-500/20 rounded-full animate-[spin_15s_linear_infinite_reverse]"}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsx(vi,{size:64,className:"text-blue-400"})}),a.jsx("div",{className:"absolute top-0 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-gray-900 border border-gray-700 p-2 rounded-lg text-[10px] text-gray-300",children:"SWIFT"}),a.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2 bg-gray-900 border border-gray-700 p-2 rounded-lg text-[10px] text-gray-300",children:"ACH"}),a.jsx("div",{className:"absolute left-0 top-1/2 -translate-x-1/2 -translate-y-1/2 bg-gray-900 border border-gray-700 p-2 rounded-lg text-[10px] text-gray-300",children:"RTP"}),a.jsx("div",{className:"absolute right-0 top-1/2 translate-x-1/2 -translate-y-1/2 bg-gray-900 border border-gray-700 p-2 rounded-lg text-[10px] text-gray-300",children:"FEDWIRE"})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:"Global Liquidity Map"}),a.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"Visualizing real-time capital flows across 42 jurisdictions."})]})]})]}),a.jsx(Ft,{title:"Secure Audit Storage",className:"max-h-60 overflow-hidden flex flex-col",children:a.jsxs("div",{className:"overflow-y-auto custom-scrollbar flex-1 space-y-2 pr-2",children:[g.length===0&&a.jsx("div",{className:"text-center text-gray-600 text-sm py-4 italic",children:"No actions recorded in this session."}),g.map(I=>a.jsxs("div",{className:"flex items-start gap-3 p-2 border-b border-gray-800/50 last:border-0 text-xs font-mono",children:[a.jsx("div",{className:`mt-1 w-2 h-2 rounded-full ${I.status==="SUCCESS"?"bg-green-500":I.status==="PENDING"?"bg-amber-500":"bg-red-500"}`}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"font-bold text-gray-300",children:I.action}),a.jsx("span",{className:"text-gray-600",children:I.timestamp})]}),a.jsx("div",{className:"text-gray-500 mt-0.5",children:I.details})]})]},I.id))]})})]}),a.jsx("div",{className:"lg:col-span-4 flex flex-col h-full min-h-[600px]",children:a.jsxs(Ft,{className:"flex-1 flex flex-col h-full border-blue-500/30 shadow-blue-900/20",padding:"none",children:[a.jsxs("div",{className:"p-4 border-b border-gray-800 bg-gray-900/50 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 rounded-xl bg-gradient-to-br from-blue-600 to-purple-600 flex items-center justify-center shadow-lg",children:a.jsx(Ei,{size:20,className:"text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-bold text-white text-sm",children:"Quantum AI"}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-green-400 animate-pulse"}),a.jsx("span",{className:"text-[10px] text-blue-300 font-mono uppercase",children:"Online // Gemini-3"})]})]})]}),a.jsx("button",{onClick:()=>p([]),className:"text-gray-500 hover:text-white transition-colors",title:"Clear Chat",children:a.jsx(vh,{size:16})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 bg-gray-950/30 custom-scrollbar",children:[d.map(I=>a.jsx("div",{className:`flex ${I.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[85%] rounded-2xl p-3 text-sm ${I.role==="user"?"bg-blue-600 text-white rounded-tr-none":I.role==="system"?"bg-red-900/20 text-red-300 border border-red-500/20":"bg-gray-800 text-gray-200 rounded-tl-none border border-gray-700"}`,children:[I.content,a.jsx("div",{className:`text-[10px] mt-1 opacity-50 ${I.role==="user"?"text-blue-200":"text-gray-500"}`,children:I.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})},I.id)),h&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-gray-800 rounded-2xl rounded-tl-none p-4 border border-gray-700 flex items-center gap-2",children:[a.jsx(cw,{size:16,className:"animate-spin text-blue-400"}),a.jsx("span",{className:"text-xs text-gray-400 animate-pulse",children:"Processing neural request..."})]})}),a.jsx("div",{ref:S})]}),a.jsxs("div",{className:"p-4 border-t border-gray-800 bg-gray-900/50",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:c,onChange:I=>u(I.target.value),onKeyDown:I=>I.key==="Enter"&&N(),placeholder:"Ask about your finances...",className:"w-full bg-gray-950 border border-gray-700 rounded-xl py-3 pl-4 pr-12 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500 transition-all",disabled:h}),a.jsx("button",{onClick:N,disabled:!c.trim()||h,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 bg-blue-600 hover:bg-blue-500 text-white rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:a.jsx(Lc,{size:16})})]}),a.jsx("div",{className:"mt-2 flex justify-center gap-2",children:a.jsx("span",{className:"text-[10px] text-gray-600 font-mono",children:"SECURE ENCLAVE ACTIVE"})})]})]})})]}),x&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm animate-in fade-in duration-200",children:a.jsxs("div",{className:"bg-gray-900 border border-gray-700 rounded-2xl w-full max-w-md p-6 shadow-2xl relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-blue-500 via-purple-500 to-blue-500 animate-gradient"}),a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsxs("h3",{className:"text-xl font-bold text-white flex items-center gap-2",children:[a.jsx(ri,{className:"text-blue-400"})," Identity Verification"]}),a.jsx("button",{onClick:()=>v(!1),className:"text-gray-500 hover:text-white",children:a.jsx(vh,{size:20})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:`flex items-center gap-4 p-4 rounded-xl border transition-all duration-500 ${b>=0?"bg-blue-900/20 border-blue-500/30":"bg-gray-800/50 border-gray-700"}`,children:[a.jsxs("div",{className:"relative",children:[a.jsx(hm,{size:24,className:b===0?"text-blue-400 animate-pulse":"text-gray-500"}),b>0&&a.jsx(xh,{size:16,className:"absolute -bottom-1 -right-1 text-green-400 bg-gray-900 rounded-full"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-bold text-gray-200",children:"Database Scan"}),a.jsx("div",{className:"text-xs text-gray-500",children:"Cross-referencing global watchlists"})]})]}),a.jsxs("div",{className:`flex items-center gap-4 p-4 rounded-xl border transition-all duration-500 ${b>=1?"bg-purple-900/20 border-purple-500/30":"bg-gray-800/50 border-gray-700"}`,children:[a.jsxs("div",{className:"relative",children:[a.jsx(tT,{size:24,className:b===1?"text-purple-400 animate-pulse":"text-gray-500"}),b>1&&a.jsx(xh,{size:16,className:"absolute -bottom-1 -right-1 text-green-400 bg-gray-900 rounded-full"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-bold text-gray-200",children:"Biometric Analysis"}),a.jsx("div",{className:"text-xs text-gray-500",children:"Verifying liveness and document authenticity"})]})]}),a.jsxs("div",{className:`flex items-center gap-4 p-4 rounded-xl border transition-all duration-500 ${b>=2?"bg-amber-900/20 border-amber-500/30":"bg-gray-800/50 border-gray-700"}`,children:[a.jsxs("div",{className:"relative",children:[a.jsx(Xi,{size:24,className:b===2?"text-amber-400 animate-pulse":"text-gray-500"}),b>2&&a.jsx(xh,{size:16,className:"absolute -bottom-1 -right-1 text-green-400 bg-gray-900 rounded-full"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-bold text-gray-200",children:"Risk Scoring"}),a.jsx("div",{className:"text-xs text-gray-500",children:"Calculating fraud probability vectors"})]})]}),b===3&&a.jsxs("div",{className:"mt-6 p-4 bg-green-500/10 border border-green-500/30 rounded-xl text-center animate-in zoom-in duration-300",children:[a.jsx("div",{className:"text-green-400 font-bold text-lg mb-1",children:"Verification Successful"}),a.jsx("p",{className:"text-xs text-gray-400",children:"Entity cleared for Level 3 access."}),a.jsx("button",{onClick:()=>v(!1),className:"mt-4 px-6 py-2 bg-green-600 hover:bg-green-500 text-white rounded-lg text-sm font-bold transition-colors",children:"Close & Continue"})]})]})]})})]})},Yhr=[{id:"va_root",name:"Master Operating Account",accountNumber:"9876543210",routingNumber:"123456789",balance:15e5,currency:"USD",status:"ACTIVE",subAccounts:[{id:"va_payroll",name:"Payroll Segregation",accountNumber:"9876543211",routingNumber:"123456789",balance:25e4,currency:"USD",status:"ACTIVE"},{id:"va_receivables",name:"Client Receivables",accountNumber:"9876543212",routingNumber:"123456789",balance:8e5,currency:"USD",status:"ACTIVE",subAccounts:[{id:"va_client_a",name:"Client A - Specific",accountNumber:"9876543212-01",routingNumber:"123456789",balance:5e4,currency:"USD",status:"ACTIVE"},{id:"va_client_b",name:"Client B - Specific",accountNumber:"9876543212-02",routingNumber:"123456789",balance:125e3,currency:"USD",status:"ACTIVE"}]},{id:"va_expenses",name:"Opex Virtual Cards",accountNumber:"9876543213",routingNumber:"123456789",balance:45e3,currency:"USD",status:"ACTIVE"}]}],Kmt=({account:e,depth:t})=>{const[n,r]=f.useState(!0),o=e.subAccounts&&e.subAccounts.length>0;return a.jsxs("div",{className:"select-none",children:[a.jsxs("div",{className:`flex items-center p-3 hover:bg-gray-800/50 border-b border-gray-800 transition-colors cursor-pointer ${t===0?"bg-gray-900/50":""}`,style:{paddingLeft:`${t*20+10}px`},onClick:()=>r(!n),children:[a.jsx("div",{className:"mr-2 w-4 text-gray-500",children:o&&(n?a.jsx(Lme,{size:16}):a.jsx(nd,{size:16}))}),a.jsxs("div",{className:"flex-1 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Fu,{className:`w-4 h-4 ${t===0?"text-indigo-400":"text-gray-400"}`}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-white",children:e.name}),a.jsxs("p",{className:"text-xs text-gray-500 font-mono flex items-center gap-2",children:[e.accountNumber,a.jsx(m3t,{size:10,className:"hover:text-white cursor-pointer"})]})]})]}),a.jsxs("div",{className:"text-right pr-4",children:[a.jsxs("p",{className:"text-sm font-bold text-white",children:["$",e.balance.toLocaleString(void 0,{minimumFractionDigits:2})]}),a.jsx("span",{className:"text-[10px] bg-green-900/30 text-green-400 px-1.5 py-0.5 rounded",children:e.status})]})]})]}),n&&o&&a.jsx("div",{children:e.subAccounts.map(i=>a.jsx(Kmt,{account:i,depth:t+1},i.id))})]})},Ymt=()=>a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-3xl font-bold text-white tracking-wider",children:"Virtual Accounts"}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Hierarchical ledger management and automated routing."})]}),a.jsxs("button",{className:"px-4 py-2 bg-indigo-600 hover:bg-indigo-500 text-white rounded-lg font-bold flex items-center gap-2 shadow-lg shadow-indigo-500/20 transition-all",children:[a.jsx(T0,{size:18})," Issue Virtual IBAN"]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs(Ft,{className:"lg:col-span-2 p-0 overflow-hidden border-indigo-500/30",children:[a.jsxs("div",{className:"p-4 border-b border-gray-700 flex justify-between items-center bg-gray-900",children:[a.jsx("h3",{className:"font-bold text-white",children:"Account Hierarchy"}),a.jsxs("div",{className:"relative",children:[a.jsx(hm,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500",size:14}),a.jsx("input",{type:"text",placeholder:"Filter accounts...",className:"bg-gray-800 border border-gray-700 rounded-full pl-9 pr-4 py-1 text-sm text-white focus:outline-none focus:border-indigo-500"})]})]}),a.jsx("div",{className:"bg-black/20",children:Yhr.map(e=>a.jsx(Kmt,{account:e,depth:0},e.id))})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(Ft,{title:"Routing Rules",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"p-3 bg-gray-800/50 rounded border border-gray-700",children:[a.jsx("p",{className:"text-xs font-bold text-indigo-400 mb-1",children:'IF MEMO CONTAINS "PAYROLL"'}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-300",children:[a.jsx("span",{children:"Route to"}),a.jsx("span",{className:"font-mono bg-gray-900 px-1 rounded",children:"...3211"})]})]}),a.jsxs("div",{className:"p-3 bg-gray-800/50 rounded border border-gray-700",children:[a.jsx("p",{className:"text-xs font-bold text-indigo-400 mb-1",children:'IF SENDER = "CLIENT A"'}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-300",children:[a.jsx("span",{children:"Route to"}),a.jsx("span",{className:"font-mono bg-gray-900 px-1 rounded",children:"...3212-01"})]})]}),a.jsx("button",{className:"w-full py-2 border border-dashed border-gray-600 text-gray-400 text-sm rounded hover:border-gray-400 hover:text-gray-200 transition",children:"+ Add Routing Logic"})]})}),a.jsxs(Ft,{title:"Virtual Cards",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("span",{className:"text-2xl font-bold text-white",children:"12"}),a.jsx("span",{className:"text-sm text-gray-400",children:"Active Cards"})]}),a.jsxs("div",{className:"p-4 bg-gradient-to-r from-indigo-900 to-purple-900 rounded-xl border border-white/10 relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 right-0 p-3 opacity-20",children:a.jsx(yh,{size:48})}),a.jsx("p",{className:"text-sm text-indigo-200 font-mono mb-4",children:"**** **** **** 4242"}),a.jsxs("div",{className:"flex justify-between items-end",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] text-indigo-300 uppercase",children:"Limit"}),a.jsx("p",{className:"text-white font-bold",children:"$5,000/mo"})]}),a.jsx("span",{className:"text-xs bg-green-500/20 text-green-300 px-2 py-1 rounded",children:"Active"})]})]}),a.jsx("button",{className:"w-full mt-4 text-sm text-indigo-400 hover:text-indigo-300",children:"Manage Cards →"})]})]})]})]}),Xhr=()=>[{id:"TX-L-9901",date:"2024-05-10",amount:125e3,description:"Global Logistics - Q2 Settlement",source:"INTERNAL_LEDGER",status:"UNMATCHED",currency:"USD",category:"Operations",riskScore:.02,metadata:{traceId:"TRC-001",mfaVerified:!0,rail:"WIRE"}},{id:"TX-L-9902",date:"2024-05-11",amount:4250.5,description:"Cloud Infrastructure - AWS Monthly",source:"INTERNAL_LEDGER",status:"UNMATCHED",currency:"USD",category:"Technology",riskScore:.05,metadata:{traceId:"TRC-002",mfaVerified:!0,rail:"ACH"}},{id:"TX-L-9903",date:"2024-05-12",amount:89e4,description:"Strategic Acquisition - Alpha Corp",source:"INTERNAL_LEDGER",status:"UNMATCHED",currency:"USD",category:"Investment",riskScore:.12,metadata:{traceId:"TRC-003",mfaVerified:!0,rail:"WIRE"}},{id:"TX-L-9904",date:"2024-05-12",amount:150,description:"Executive Catering - Board Meeting",source:"INTERNAL_LEDGER",status:"UNMATCHED",currency:"USD",category:"G&A",riskScore:.01,metadata:{traceId:"TRC-004",mfaVerified:!1,rail:"ACH"}},{id:"TX-L-9905",date:"2024-05-13",amount:55e3,description:"Payroll Funding - EMEA Region",source:"INTERNAL_LEDGER",status:"UNMATCHED",currency:"USD",category:"Payroll",riskScore:.03,metadata:{traceId:"TRC-005",mfaVerified:!0,rail:"SWIFT"}},{id:"TX-L-9906",date:"2024-05-14",amount:1200,description:"Office Supplies - Staples",source:"INTERNAL_LEDGER",status:"UNMATCHED",currency:"USD",category:"G&A",riskScore:.01,metadata:{traceId:"TRC-006",mfaVerified:!0,rail:"ACH"}},{id:"TX-L-9907",date:"2024-05-15",amount:33400,description:"Marketing Campaign - Summer Launch",source:"INTERNAL_LEDGER",status:"UNMATCHED",currency:"USD",category:"Marketing",riskScore:.08,metadata:{traceId:"TRC-007",mfaVerified:!0,rail:"WIRE"}}],Qhr=()=>[{id:"TX-S-8801",date:"2024-05-11",amount:125e3,description:"INCOMING WIRE: GLOBAL LOGISTICS",source:"BANK_STATEMENT",status:"UNMATCHED",currency:"USD",category:"Uncategorized",riskScore:.02,metadata:{traceId:"TRC-S01",mfaVerified:!0,rail:"WIRE"}},{id:"TX-S-8802",date:"2024-05-11",amount:4250.5,description:"ACH DEBIT: AMZN MKTP",source:"BANK_STATEMENT",status:"UNMATCHED",currency:"USD",category:"Uncategorized",riskScore:.04,metadata:{traceId:"TRC-S02",mfaVerified:!0,rail:"ACH"}},{id:"TX-S-8803",date:"2024-05-13",amount:889985,description:"WIRE OUT: ALPHA CORP - FEE ADJ",source:"BANK_STATEMENT",status:"UNMATCHED",currency:"USD",category:"Uncategorized",riskScore:.15,metadata:{traceId:"TRC-S03",mfaVerified:!0,rail:"WIRE"}},{id:"TX-S-8804",date:"2024-05-15",amount:500,description:"UNKNOWN POS DEBIT - NYC",source:"BANK_STATEMENT",status:"UNMATCHED",currency:"USD",category:"Uncategorized",riskScore:.85,metadata:{traceId:"TRC-S04",mfaVerified:!1,rail:"ACH"}},{id:"TX-S-8805",date:"2024-05-14",amount:55e3,description:"SWIFT: EMEA PAYROLL FUND",source:"BANK_STATEMENT",status:"UNMATCHED",currency:"USD",category:"Uncategorized",riskScore:.03,metadata:{traceId:"TRC-S05",mfaVerified:!0,rail:"SWIFT"}}],Xmt=()=>{const[e,t]=f.useState(Xhr()),[n,r]=f.useState(Qhr()),[o,i]=f.useState(null),[s,l]=f.useState(null),[c,u]=f.useState([]),[d,p]=f.useState(!1),[h,m]=f.useState([]),[g,y]=f.useState([{role:"assistant",content:"Welcome to the Quantum Financial Demo. I am your AI Treasury Assistant. How can I help you kick the tires on our reconciliation engine today?",timestamp:new Date().toLocaleTimeString()}]),[x,v]=f.useState(""),[b,w]=f.useState(!1),[S,C]=f.useState("reconcile"),[N,j]=f.useState({cpuLoad:12,memoryUsage:45,apiLatency:24,fraudDetectionActive:!0}),[I,_]=f.useState(!1),T=f.useRef(null),P=new Ko(""),E=f.useCallback((B,G,H="INFO")=>{const F={timestamp:new Date().toISOString(),action:B,details:G,severity:H,hash:Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)};m(W=>[F,...W]),console.log(`[AUDIT] ${B}: ${G}`)},[]);f.useEffect(()=>{const B=setInterval(()=>{j(G=>({cpuLoad:Math.floor(Math.random()*20)+5,memoryUsage:40+Math.floor(Math.random()*10),apiLatency:15+Math.floor(Math.random()*30),fraudDetectionActive:!0}))},3e3);return()=>clearInterval(B)},[]),f.useEffect(()=>{var B;(B=T.current)==null||B.scrollIntoView({behavior:"smooth"})},[g]);const M=async()=>{if(!x.trim())return;const B={role:"user",content:x,timestamp:new Date().toLocaleTimeString()};y(G=>[...G,B]),v(""),w(!0);try{const G=P.getGenerativeModel({model:"gemini-1.5-flash"}),H=` You are the Quantum Financial AI Assistant. The user is currently in the "Reconciliation Hub" of a high-performance business banking demo. Philosophy: "Golden Ticket" experience, "Test Drive" the car, "Bells and Whistles". Current State: - Unmatched Ledger Items: ${e.filter(K=>K.status==="UNMATCHED").length} - Unmatched Statement Items: ${n.filter(K=>K.status==="UNMATCHED").length} - Security Status: Multi-factor Auth Active, Fraud Monitoring Active. User said: "${x}" Respond as an elite financial architect. Be professional, secure, and helpful. If they ask to "reconcile everything", tell them to click the "AI Auto-Match" button to see the engine roar. Do NOT mention Citibank. Use "The Demo Bank" or "Quantum Financial". `,U=(await(await G.generateContent(H)).response).text();y(K=>[...K,{role:"assistant",content:U,timestamp:new Date().toLocaleTimeString()}]),E("AI_INTERACTION",`User asked: ${x.substring(0,30)}...`,"INFO")}catch{y(H=>[...H,{role:"assistant",content:"I apologize, but my neural link is experiencing high latency. Please try again or use the manual controls.",timestamp:new Date().toLocaleTimeString()}]),E("AI_ERROR","Failed to generate AI response","CRITICAL")}finally{w(!1)}},R=()=>{p(!0),E("AI_AUTO_MATCH_START","Initiating heuristic matching engine","INFO"),setTimeout(()=>{const B=[];e.filter(G=>G.status==="UNMATCHED").forEach(G=>{n.filter(H=>H.status==="UNMATCHED").forEach(H=>{let F=0,W="";G.amount===H.amount?(F+=.85,W="Exact currency value parity detected."):Math.abs(G.amount-H.amount)/G.amount<.02&&(F+=.65,W="High-probability match with variance (likely wire fees).");const U=G.description.toLowerCase(),K=H.description.toLowerCase();U.split(" ").some(X=>X.length>3&&K.includes(X))&&(F+=.1),F>.6&&B.push({ledgerId:G.id,statementId:H.id,confidence:Math.min(F,.99),reason:W,aiModel:"Quantum-Heuristic-v4"})})}),u(B),p(!1),E("AI_AUTO_MATCH_COMPLETE",`Found ${B.length} potential matches`,"INFO")},2e3)},$=()=>{if(o&&s){const B=e.find(H=>H.id===o),G=n.find(H=>H.id===s);B&&G&&(t(H=>H.map(F=>F.id===o?{...F,status:"MATCHED"}:F)),r(H=>H.map(F=>F.id===s?{...F,status:"MATCHED"}:F)),E("MANUAL_MATCH",`Linked ${o} to ${s} (Value: $${B.amount})`,"INFO"),i(null),l(null),u(H=>H.filter(F=>F.ledgerId!==o&&F.statementId!==s)))}},D=B=>{t(G=>G.map(H=>H.id===B.ledgerId?{...H,status:"MATCHED"}:H)),r(G=>G.map(H=>H.id===B.statementId?{...H,status:"MATCHED"}:H)),u(G=>G.filter(H=>H!==B)),E("AI_RESOLVE",`Confirmed AI suggestion: ${B.ledgerId} <-> ${B.statementId}`,"INFO")},z=()=>a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 mb-6 animate-fadeIn",children:[a.jsxs(Ft,{variant:"default",padding:"sm",className:"border-cyan-500/30",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-gray-400 uppercase tracking-tighter",children:"Engine Load"}),a.jsxs("p",{className:"text-2xl font-bold text-cyan-400",children:[N.cpuLoad,"%"]})]}),a.jsx(Ei,{className:"text-cyan-500/50",size:24})]}),a.jsx("div",{className:"w-full bg-gray-700 h-1 mt-2 rounded-full overflow-hidden",children:a.jsx("div",{className:"bg-cyan-500 h-full transition-all duration-500",style:{width:`${N.cpuLoad}%`}})})]}),a.jsxs(Ft,{variant:"default",padding:"sm",className:"border-purple-500/30",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-gray-400 uppercase tracking-tighter",children:"Neural Memory"}),a.jsxs("p",{className:"text-2xl font-bold text-purple-400",children:[N.memoryUsage,"%"]})]}),a.jsx(Xi,{className:"text-purple-500/50",size:24})]}),a.jsx("div",{className:"w-full bg-gray-700 h-1 mt-2 rounded-full overflow-hidden",children:a.jsx("div",{className:"bg-purple-500 h-full transition-all duration-500",style:{width:`${N.memoryUsage}%`}})})]}),a.jsxs(Ft,{variant:"default",padding:"sm",className:"border-green-500/30",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-gray-400 uppercase tracking-tighter",children:"API Latency"}),a.jsxs("p",{className:"text-2xl font-bold text-green-400",children:[N.apiLatency,"ms"]})]}),a.jsx(_a,{className:"text-green-500/50",size:24})]}),a.jsx("div",{className:"w-full bg-gray-700 h-1 mt-2 rounded-full overflow-hidden",children:a.jsx("div",{className:"bg-green-500 h-full transition-all duration-500",style:{width:`${N.apiLatency/100*100}%`}})})]}),a.jsxs(Ft,{variant:"default",padding:"sm",className:"border-red-500/30",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-gray-400 uppercase tracking-tighter",children:"Fraud Shield"}),a.jsx("p",{className:"text-2xl font-bold text-red-400",children:"ACTIVE"})]}),a.jsx(ri,{className:"text-red-500/50",size:24})]}),a.jsx("div",{className:"flex gap-1 mt-2",children:[1,2,3,4,5].map(B=>a.jsx("div",{className:"h-1 flex-1 bg-red-500 animate-pulse",style:{animationDelay:`${B*.2}s`}},B))})]})]}),V=()=>a.jsxs("div",{className:"space-y-4 animate-fadeIn",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsxs("h3",{className:"text-xl font-bold text-white flex items-center gap-2",children:[a.jsx(Gf,{size:20,className:"text-cyan-400"})," System Black Box (Audit Persistence)"]}),a.jsxs("button",{className:"text-xs text-cyan-400 hover:underline flex items-center gap-1",children:[a.jsx(Ch,{size:14})," Export Immutable Log"]})]}),a.jsx("div",{className:"bg-gray-900/80 rounded-xl border border-gray-700 overflow-hidden",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-gray-800 text-gray-400 uppercase text-xs",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-3",children:"Timestamp"}),a.jsx("th",{className:"px-4 py-3",children:"Action"}),a.jsx("th",{className:"px-4 py-3",children:"Details"}),a.jsx("th",{className:"px-4 py-3",children:"Integrity Hash"})]})}),a.jsxs("tbody",{className:"divide-y divide-gray-800",children:[h.map((B,G)=>a.jsxs("tr",{className:"hover:bg-gray-800/50 transition-colors",children:[a.jsx("td",{className:"px-4 py-3 font-mono text-gray-500",children:new Date(B.timestamp).toLocaleTimeString()}),a.jsx("td",{className:"px-4 py-3",children:a.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${B.severity==="CRITICAL"?"bg-red-500/20 text-red-400":B.severity==="SECURITY"?"bg-purple-500/20 text-purple-400":"bg-cyan-500/20 text-cyan-400"}`,children:B.action})}),a.jsx("td",{className:"px-4 py-3 text-gray-300",children:B.details}),a.jsx("td",{className:"px-4 py-3 font-mono text-[10px] text-gray-600",children:B.hash})]},G)),h.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-10 text-center text-gray-500 italic",children:"No audit entries recorded in this session."})})]})]})})]});return a.jsxs("div",{className:"min-h-screen bg-[#0a0c10] text-gray-200 p-4 md:p-8 font-sans selection:bg-cyan-500/30",children:[a.jsxs("header",{className:"max-w-7xl mx-auto mb-8 flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("div",{className:"bg-cyan-600 p-1.5 rounded-lg shadow-lg shadow-cyan-900/20",children:a.jsx(Fu,{className:"text-white",size:24})}),a.jsxs("h1",{className:"text-2xl font-black tracking-tighter text-white uppercase italic",children:["Quantum ",a.jsx("span",{className:"text-cyan-500",children:"Financial"})]})]}),a.jsxs("p",{className:"text-gray-500 text-sm font-medium flex items-center gap-2",children:[a.jsx(ri,{size:14,className:"text-green-500"}),"Enterprise Reconciliation Nexus • ",a.jsx("span",{className:"text-cyan-400/80",children:"Sovereign Demo Environment"})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"hidden md:flex flex-col items-end mr-4",children:[a.jsx("span",{className:"text-[10px] text-gray-500 uppercase tracking-widest",children:"System Status"}),a.jsxs("span",{className:"text-xs text-green-400 font-bold flex items-center gap-1",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})," ALL SYSTEMS NOMINAL"]})]}),a.jsx("button",{onClick:()=>_(!0),className:"p-2 bg-gray-800 border border-gray-700 rounded-full hover:border-cyan-500 transition-all group",children:a.jsx(ds,{size:18,className:"group-hover:text-cyan-400"})}),a.jsxs("button",{className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg font-bold text-sm transition-all shadow-lg shadow-cyan-900/20 flex items-center gap-2",children:[a.jsx(XI,{size:14})," Deploy to Production"]})]})]}),a.jsxs("main",{className:"max-w-7xl mx-auto grid grid-cols-1 lg:grid-cols-12 gap-6",children:[a.jsxs("div",{className:"lg:col-span-3 space-y-6",children:[a.jsx(Ft,{variant:"default",padding:"none",className:"overflow-hidden",children:a.jsxs("div",{className:"flex flex-col",children:[a.jsxs("button",{onClick:()=>C("reconcile"),className:`flex items-center gap-3 px-4 py-4 text-sm font-bold transition-all ${S==="reconcile"?"bg-cyan-600/10 text-cyan-400 border-l-4 border-cyan-500":"text-gray-400 hover:bg-gray-800"}`,children:[a.jsx(gP,{size:18})," Reconciliation Hub"]}),a.jsxs("button",{onClick:()=>C("audit"),className:`flex items-center gap-3 px-4 py-4 text-sm font-bold transition-all ${S==="audit"?"bg-cyan-600/10 text-cyan-400 border-l-4 border-cyan-500":"text-gray-400 hover:bg-gray-800"}`,children:[a.jsx(Gf,{size:18})," Audit Persistence"]}),a.jsxs("button",{onClick:()=>C("telemetry"),className:`flex items-center gap-3 px-4 py-4 text-sm font-bold transition-all ${S==="telemetry"?"bg-cyan-600/10 text-cyan-400 border-l-4 border-cyan-500":"text-gray-400 hover:bg-gray-800"}`,children:[a.jsx(H3t,{size:18})," Engine Telemetry"]})]})}),a.jsxs(Ft,{title:"Treasury AI",icon:a.jsx(Lw,{className:"text-cyan-400",size:18}),className:"h-[500px] flex flex-col",children:[a.jsxs("div",{className:"flex-grow overflow-y-auto space-y-4 mb-4 pr-2 custom-scrollbar",children:[g.map((B,G)=>a.jsxs("div",{className:`flex flex-col ${B.role==="user"?"items-end":"items-start"}`,children:[a.jsx("div",{className:`max-w-[90%] p-3 rounded-2xl text-xs leading-relaxed ${B.role==="user"?"bg-cyan-600 text-white rounded-tr-none":"bg-gray-800 text-gray-300 border border-gray-700 rounded-tl-none"}`,children:B.content}),a.jsx("span",{className:"text-[9px] text-gray-600 mt-1 uppercase",children:B.timestamp})]},G)),b&&a.jsxs("div",{className:"flex items-center gap-2 text-cyan-500 text-[10px] font-bold animate-pulse",children:[a.jsx(Ei,{size:12,className:"animate-spin"})," QUANTUM CORE THINKING..."]}),a.jsx("div",{ref:T})]}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:x,onChange:B=>v(B.target.value),onKeyDown:B=>B.key==="Enter"&&M(),placeholder:"Ask the AI Architect...",className:"w-full bg-gray-900 border border-gray-700 rounded-xl py-3 pl-4 pr-12 text-sm focus:outline-none focus:border-cyan-500 transition-all"}),a.jsx("button",{onClick:M,className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-cyan-500 hover:text-cyan-400",children:a.jsx(fk,{size:18})})]})]})]}),a.jsxs("div",{className:"lg:col-span-9 space-y-6",children:[S==="telemetry"&&z(),S==="audit"&&V(),S==="reconcile"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center gap-4 bg-gray-900/50 p-4 rounded-2xl border border-gray-800",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex -space-x-2",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-cyan-600 border-2 border-gray-900 flex items-center justify-center text-[10px] font-bold",children:"AI"}),a.jsx("div",{className:"w-8 h-8 rounded-full bg-purple-600 border-2 border-gray-900 flex items-center justify-center text-[10px] font-bold",children:"SEC"})]}),a.jsxs("p",{className:"text-sm font-medium text-gray-400",children:[a.jsx("span",{className:"text-white font-bold",children:e.filter(B=>B.status==="UNMATCHED").length})," items pending reconciliation"]})]}),a.jsxs("div",{className:"flex gap-3 w-full md:w-auto",children:[a.jsxs("button",{className:"flex-1 md:flex-none px-4 py-2 bg-gray-800 text-gray-300 rounded-lg hover:bg-gray-700 flex items-center justify-center gap-2 text-sm font-bold transition-all",children:[a.jsx(QG,{size:16})," Advanced Filter"]}),a.jsxs("button",{onClick:R,disabled:d,className:"flex-1 md:flex-none px-6 py-2 bg-gradient-to-r from-cyan-600 to-blue-600 text-white rounded-lg hover:from-cyan-500 hover:to-blue-500 flex items-center justify-center gap-2 text-sm font-black uppercase tracking-wider disabled:opacity-50 transition-all shadow-lg shadow-cyan-900/40",children:[d?a.jsx(gP,{size:16,className:"animate-spin"}):a.jsx(INe,{size:16}),"AI Auto-Match"]})]})]}),c.length>0&&a.jsxs("div",{className:"p-6 bg-cyan-900/10 border border-cyan-500/30 rounded-2xl animate-fadeIn relative overflow-hidden",children:[a.jsx("div",{className:"absolute top-0 right-0 p-4 opacity-10",children:a.jsx(Ei,{size:120})}),a.jsxs("h3",{className:"text-lg font-bold text-cyan-400 mb-4 flex items-center gap-2",children:[a.jsx(INe,{size:20})," Neural Match Suggestions (",c.length,")"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:c.map((B,G)=>{const H=e.find(W=>W.id===B.ledgerId),F=n.find(W=>W.id===B.statementId);return!H||!F?null:a.jsxs("div",{className:"p-4 bg-gray-900/80 rounded-xl border border-gray-700 hover:border-cyan-500 transition-all group relative",children:[a.jsxs("div",{className:"flex justify-between items-start mb-3",children:[a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"text-[10px] text-gray-500 font-mono uppercase",children:"Confidence"}),a.jsxs("span",{className:"text-green-400 font-black text-lg",children:[(B.confidence*100).toFixed(0),"%"]})]}),a.jsx("div",{className:"bg-gray-800 p-1.5 rounded text-[10px] font-mono text-gray-400",children:B.aiModel})]}),a.jsxs("div",{className:"space-y-2 mb-4",children:[a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"Ledger:"}),a.jsxs("span",{className:"text-white font-bold",children:["$",H.amount.toLocaleString()]})]}),a.jsxs("div",{className:"flex justify-between text-xs",children:[a.jsx("span",{className:"text-gray-500",children:"Statement:"}),a.jsxs("span",{className:"text-white font-bold",children:["$",F.amount.toLocaleString()]})]})]}),a.jsxs("p",{className:"text-[11px] text-cyan-300/80 italic mb-4 line-clamp-2",children:['"',B.reason,'"']}),a.jsx("button",{onClick:()=>D(B),className:"w-full py-2 bg-cyan-600/20 hover:bg-cyan-600 text-cyan-400 hover:text-white text-xs font-black rounded-lg transition-all border border-cyan-500/30",children:"CONFIRM MATCH"})]},G)})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 h-[700px]",children:[a.jsx(Ft,{title:"Internal Ledger (ERP)",subtitle:"Source: SAP/Oracle Integration",className:"flex flex-col h-full border-t-4 border-cyan-500",headerActions:[{id:"sync",icon:a.jsx(gP,{}),label:"Sync ERP",onClick:()=>E("ERP_SYNC","Manual sync triggered","INFO")}],children:a.jsxs("div",{className:"flex-grow overflow-y-auto pr-2 space-y-3 custom-scrollbar",children:[e.filter(B=>B.status==="UNMATCHED").map(B=>a.jsxs("div",{onClick:()=>i(B.id===o?null:B.id),className:`p-4 rounded-xl cursor-pointer transition-all border-2 ${o===B.id?"bg-cyan-900/20 border-cyan-500 shadow-lg shadow-cyan-900/20":"bg-gray-900/40 border-gray-800 hover:border-gray-700"}`,children:[a.jsxs("div",{className:"flex justify-between items-start mb-2",children:[a.jsx("span",{className:"font-mono text-[10px] text-gray-500 bg-gray-800 px-2 py-0.5 rounded",children:B.date}),a.jsxs("span",{className:"font-black text-white text-lg",children:["$",B.amount.toLocaleString()]})]}),a.jsx("p",{className:"text-sm text-gray-300 font-medium truncate mb-2",children:B.description}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-[10px] text-gray-600 font-mono",children:B.id}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx("span",{className:"px-1.5 py-0.5 bg-gray-800 rounded text-[9px] text-gray-400 font-bold uppercase",children:B.metadata.rail}),B.metadata.mfaVerified&&a.jsx(ri,{size:12,className:"text-green-500"})]})]})]},B.id)),e.filter(B=>B.status==="UNMATCHED").length===0&&a.jsxs("div",{className:"text-center py-20 text-gray-500 flex flex-col items-center animate-pulse",children:[a.jsx("div",{className:"w-16 h-16 bg-green-500/10 rounded-full flex items-center justify-center mb-4",children:a.jsx(xh,{className:"w-10 h-10 text-green-500"})}),a.jsx("p",{className:"font-bold text-white",children:"Ledger Reconciled"}),a.jsx("p",{className:"text-xs",children:"All internal records matched."})]})]})}),a.jsx(Ft,{title:"Bank Statement",subtitle:"Source: Quantum API Real-time Feed",className:"flex flex-col h-full border-t-4 border-purple-500",headerActions:[{id:"api",icon:a.jsx(rl,{}),label:"API Status",onClick:()=>E("API_CHECK","Bank feed health check","INFO")}],children:a.jsxs("div",{className:"flex-grow overflow-y-auto pr-2 space-y-3 custom-scrollbar",children:[n.filter(B=>B.status==="UNMATCHED").map(B=>a.jsxs("div",{onClick:()=>l(B.id===s?null:B.id),className:`p-4 rounded-xl cursor-pointer transition-all border-2 ${s===B.id?"bg-purple-900/20 border-purple-500 shadow-lg shadow-purple-900/20":"bg-gray-900/40 border-gray-800 hover:border-gray-700"}`,children:[a.jsxs("div",{className:"flex justify-between items-start mb-2",children:[a.jsx("span",{className:"font-mono text-[10px] text-gray-500 bg-gray-800 px-2 py-0.5 rounded",children:B.date}),a.jsxs("span",{className:"font-black text-white text-lg",children:["$",B.amount.toLocaleString()]})]}),a.jsx("p",{className:"text-sm text-gray-300 font-medium truncate mb-2",children:B.description}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-[10px] text-gray-600 font-mono",children:B.id}),a.jsxs("div",{className:"flex items-center gap-2",children:[B.riskScore>.5&&a.jsxs("div",{className:"flex items-center gap-1 px-1.5 py-0.5 bg-red-500/20 text-red-400 rounded text-[9px] font-bold animate-pulse",children:[a.jsx(zu,{size:10})," HIGH RISK"]}),a.jsx("span",{className:"px-1.5 py-0.5 bg-gray-800 rounded text-[9px] text-gray-400 font-bold uppercase",children:B.metadata.rail})]})]})]},B.id)),n.filter(B=>B.status==="UNMATCHED").length===0&&a.jsxs("div",{className:"text-center py-20 text-gray-500 flex flex-col items-center animate-pulse",children:[a.jsx("div",{className:"w-16 h-16 bg-green-500/10 rounded-full flex items-center justify-center mb-4",children:a.jsx(xh,{className:"w-10 h-10 text-green-500"})}),a.jsx("p",{className:"font-bold text-white",children:"Statement Reconciled"}),a.jsx("p",{className:"text-xs",children:"All bank transactions verified."})]})]})})]})]})]})]}),a.jsxs("div",{className:`fixed bottom-10 left-1/2 transform -translate-x-1/2 bg-gray-900/90 backdrop-blur-xl border border-cyan-500/50 p-6 rounded-3xl shadow-[0_0_50px_rgba(6,182,212,0.2)] flex items-center gap-8 transition-all duration-500 z-50 ${o&&s?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-20 scale-90 pointer-events-none"}`,children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"text-[10px] text-gray-500 uppercase font-black tracking-widest",children:"Ledger Item"}),a.jsx("span",{className:"text-cyan-400 font-mono font-bold",children:o})]}),a.jsx("div",{className:"h-10 w-px bg-gray-700"}),a.jsx("div",{className:"bg-cyan-500/20 p-2 rounded-full",children:a.jsx(gP,{className:"text-cyan-500 animate-spin-slow",size:24})}),a.jsx("div",{className:"h-10 w-px bg-gray-700"}),a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"text-[10px] text-gray-500 uppercase font-black tracking-widest",children:"Statement Item"}),a.jsx("span",{className:"text-purple-400 font-mono font-bold",children:s})]})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx("button",{onClick:()=>{i(null),l(null)},className:"px-6 py-3 rounded-xl hover:bg-gray-800 text-gray-400 text-sm font-bold transition-all",children:"Abort"}),a.jsxs("button",{onClick:$,className:"px-8 py-3 bg-cyan-600 hover:bg-cyan-500 text-white rounded-xl font-black shadow-lg shadow-cyan-900/40 flex items-center gap-2 transition-all active:scale-95",children:[a.jsx(kd,{size:18})," AUTHORIZE MATCH"]})]})]}),I&&a.jsx("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-fadeIn",children:a.jsx(Ft,{className:"max-w-md w-full border-cyan-500/50 shadow-[0_0_100px_rgba(6,182,212,0.1)]",title:"Security Protocol V4",icon:a.jsx(ri,{className:"text-cyan-400"}),children:a.jsxs("div",{className:"space-y-6 py-4",children:[a.jsxs("div",{className:"flex items-center gap-4 p-4 bg-gray-900 rounded-xl border border-gray-800",children:[a.jsx("div",{className:"w-12 h-12 bg-cyan-500/10 rounded-full flex items-center justify-center",children:a.jsx(ds,{className:"text-cyan-500",size:24})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-bold text-white",children:"Multi-Factor Authentication"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Biometric & Hardware Key Active"})]}),a.jsx("div",{className:"ml-auto",children:a.jsx("div",{className:"w-10 h-5 bg-cyan-600 rounded-full relative",children:a.jsx("div",{className:"absolute right-1 top-1 w-3 h-3 bg-white rounded-full"})})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-xs text-gray-400 uppercase font-black",children:"Encryption Telemetry"}),a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs("div",{className:"p-3 bg-gray-900 rounded-lg border border-gray-800",children:[a.jsx("p",{className:"text-[10px] text-gray-500",children:"AES-256-GCM"}),a.jsx("p",{className:"text-xs font-bold text-green-400",children:"VERIFIED"})]}),a.jsxs("div",{className:"p-3 bg-gray-900 rounded-lg border border-gray-800",children:[a.jsx("p",{className:"text-[10px] text-gray-500",children:"TLS 1.3"}),a.jsx("p",{className:"text-xs font-bold text-green-400",children:"ACTIVE"})]})]})]}),a.jsx("button",{onClick:()=>_(!1),className:"w-full py-3 bg-cyan-600 hover:bg-cyan-500 text-white rounded-xl font-black transition-all",children:"RETURN TO HUB"})]})})}),a.jsxs("footer",{className:"max-w-7xl mx-auto mt-12 pt-8 border-t border-gray-800 flex flex-col md:flex-row justify-between items-center gap-4 text-[10px] text-gray-600 font-mono uppercase tracking-widest",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("span",{children:"© 2024 Quantum Financial Group"}),a.jsx("span",{className:"text-gray-800",children:"|"}),a.jsx("span",{children:"Build: 4.0.11-STABLE"})]}),a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsx("a",{href:"#",className:"hover:text-cyan-500 transition-colors",children:"Privacy Protocol"}),a.jsx("a",{href:"#",className:"hover:text-cyan-500 transition-colors",children:"Security Whitepaper"}),a.jsx("a",{href:"#",className:"hover:text-cyan-500 transition-colors",children:"API Documentation"})]})]}),a.jsx("style",{dangerouslySetInnerHTML:{__html:` .custom-scrollbar::-webkit-scrollbar { width: 4px; } .custom-scrollbar::-webkit-scrollbar-track { background: transparent; } .custom-scrollbar::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 10px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #0891b2; } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .animate-fadeIn { animation: fadeIn 0.5s ease-out forwards; } .animate-spin-slow { animation: spin 3s linear infinite; } @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } `}})]})};function sFe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function z0(...e){return t=>{let n=!1;const r=e.map(o=>{const i=sFe(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o{let{children:i,...s}=r;Qmt(i)&&typeof bW=="function"&&(i=bW(i._payload));const l=f.Children.toArray(i),c=l.find(rmr);if(c){const u=c.props.children,d=l.map(p=>p===c?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:p);return a.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return a.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var emr=NY("Slot");function tmr(e){const t=f.forwardRef((n,r)=>{let{children:o,...i}=n;if(Qmt(o)&&typeof bW=="function"&&(o=bW(o._payload)),f.isValidElement(o)){const s=imr(o),l=omr(i,o.props);return o.type!==f.Fragment&&(l.ref=r?z0(r,s):s),f.cloneElement(o,l)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var nmr=Symbol("radix.slottable");function rmr(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===nmr}function omr(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function imr(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Do(...e){return hxe(be(e))}const s1e=tK("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),kc=f.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?emr:"button";return a.jsx(s,{className:Do(s1e({variant:t,size:n,className:e})),ref:i,...o})});kc.displayName="Button";const yp=f.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Do("rounded-xl border bg-card text-card-foreground shadow",e),...t}));yp.displayName="Card";const Lv=f.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Do("flex flex-col space-y-1.5 p-6",e),...t}));Lv.displayName="CardHeader";const Fv=f.forwardRef(({className:e,...t},n)=>a.jsx("h3",{ref:n,className:Do("font-semibold leading-none tracking-tight",e),...t}));Fv.displayName="CardTitle";const amr=f.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:Do("text-sm text-muted-foreground",e),...t}));amr.displayName="CardDescription";const zv=f.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Do("p-6 pt-0",e),...t}));zv.displayName="CardContent";const YO=f.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:Do("flex items-center p-6 pt-0",e),...t}));YO.displayName="CardFooter";const l0=f.forwardRef(({className:e,type:t,...n},r)=>a.jsx("input",{type:t,className:Do("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));l0.displayName="Input";function smr(...e){return hxe(be(e))}const lmr=e=>{const[t,n]=f.useState("stale"),r=f.useRef(e),o=f.useRef(null);return f.useEffect(()=>(o.current&&clearTimeout(o.current),typeof e=="number"&&typeof r.current=="number"&&(e>r.current?n("up"):en("stale"),750),()=>{o.current&&clearTimeout(o.current)}),[e]),t},cmr=tK("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",live:"border-cyan-500/50 bg-cyan-900/20 text-cyan-300 animate-pulse"}},defaultVariants:{variant:"default"}}),pD=f.forwardRef(({className:e,variant:t,liveValue:n,...r},o)=>{const i=lmr(n),s={up:"bg-green-500/90 border-green-400 text-white shadow-lg shadow-green-500/50 scale-110",down:"bg-red-500/90 border-red-400 text-white shadow-lg shadow-red-500/50 scale-110",stale:""}[i];return a.jsx("div",{ref:o,className:smr(cmr({variant:t}),s,e),...r})});pD.displayName="Badge";var umr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dmr=umr.reduce((e,t)=>{const n=NY(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),fmr="Separator",lFe="horizontal",pmr=["horizontal","vertical"],Jmt=f.forwardRef((e,t)=>{const{decorative:n,orientation:r=lFe,...o}=e,i=hmr(r)?r:lFe,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return a.jsx(dmr.div,{"data-orientation":i,...l,...o,ref:t})});Jmt.displayName=fmr;function hmr(e){return pmr.includes(e)}var Zmt=Jmt;const egt=f.forwardRef(({className:e,orientation:t="horizontal",...n},r)=>a.jsx(Zmt,{ref:r,decorative:!0,orientation:t,className:Do("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));egt.displayName=Zmt.displayName;function mmr(e,t=[]){let n=[];function r(i,s){const l=f.createContext(s);l.displayName=i+"Context";const c=n.length;n=[...n,s];const u=p=>{var v;const{scope:h,children:m,...g}=p,y=((v=h==null?void 0:h[e])==null?void 0:v[c])||l,x=f.useMemo(()=>g,Object.values(g));return a.jsx(y.Provider,{value:x,children:m})};u.displayName=i+"Provider";function d(p,h){var y;const m=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,g=f.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(s=>f.createContext(s));return function(l){const c=(l==null?void 0:l[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[r,gmr(o,...t)]}function gmr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((l,{useScope:c,scopeName:u})=>{const p=c(i)[`__scope${u}`];return{...l,...p}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var xmr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tgt=xmr.reduce((e,t)=>{const n=NY(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),l1e="Progress",c1e=100,[ymr]=mmr(l1e),[vmr,bmr]=ymr(l1e),ngt=f.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=wmr,...s}=e;(o||o===0)&&!cFe(o)&&console.error(Smr(`${o}`,"Progress"));const l=cFe(o)?o:c1e;r!==null&&!uFe(r,l)&&console.error(Cmr(`${r}`,"Progress"));const c=uFe(r,l)?r:null,u=wW(c)?i(c,l):void 0;return a.jsx(vmr,{scope:n,value:c,max:l,children:a.jsx(tgt.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":wW(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":igt(c,l),"data-value":c??void 0,"data-max":l,...s,ref:t})})});ngt.displayName=l1e;var rgt="ProgressIndicator",ogt=f.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=bmr(rgt,n);return a.jsx(tgt.div,{"data-state":igt(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});ogt.displayName=rgt;function wmr(e,t){return`${Math.round(e/t*100)}%`}function igt(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function wW(e){return typeof e=="number"}function cFe(e){return wW(e)&&!isNaN(e)&&e>0}function uFe(e,t){return wW(e)&&!isNaN(e)&&e<=t&&e>=0}function Smr(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${c1e}\`.`}function Cmr(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - a positive number - less than the value passed to \`max\` (or ${c1e} if no \`max\` prop is set) - \`null\` or \`undefined\` if the progress is indeterminate. Defaulting to \`null\`.`}var agt=ngt,Nmr=ogt;const u1e=f.forwardRef(({className:e,value:t,...n},r)=>a.jsx(agt,{ref:r,className:Do("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:a.jsx(Nmr,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));u1e.displayName=agt.displayName;var jmr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Emr=jmr.reduce((e,t)=>{const n=NY(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Imr="Label",sgt=f.forwardRef((e,t)=>a.jsx(Emr.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));sgt.displayName=Imr;var lgt=sgt;const _mr=tK("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Pmr=f.forwardRef(({className:e,...t},n)=>a.jsx(lgt,{ref:n,className:Do(_mr(),e),...t}));Pmr.displayName=lgt.displayName;function Ns(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Amr(e,t){const n=f.createContext(t),r=i=>{const{children:s,...l}=i,c=f.useMemo(()=>l,Object.values(l));return a.jsx(n.Provider,{value:c,children:s})};r.displayName=e+"Provider";function o(i){const s=f.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function E6(e,t=[]){let n=[];function r(i,s){const l=f.createContext(s),c=n.length;n=[...n,s];const u=p=>{var v;const{scope:h,children:m,...g}=p,y=((v=h==null?void 0:h[e])==null?void 0:v[c])||l,x=f.useMemo(()=>g,Object.values(g));return a.jsx(y.Provider,{value:x,children:m})};u.displayName=i+"Provider";function d(p,h){var y;const m=((y=h==null?void 0:h[e])==null?void 0:y[c])||l,g=f.useContext(m);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(s=>f.createContext(s));return function(l){const c=(l==null?void 0:l[e])||i;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[r,Tmr(o,...t)]}function Tmr(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((l,{useScope:c,scopeName:u})=>{const p=c(i)[`__scope${u}`];return{...l,...p}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Rp=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{},kmr=sw[" useId ".trim().toString()]||(()=>{}),Mmr=0;function N0(e){const[t,n]=f.useState(kmr());return Rp(()=>{n(r=>r??String(Mmr++))},[e]),t?`radix-${t}`:""}var Rmr=sw[" useInsertionEffect ".trim().toString()]||Rp;function ipe({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=Omr({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:o;{const d=f.useRef(e!==void 0);f.useEffect(()=>{const p=d.current;p!==l&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=l},[l,r])}const u=f.useCallback(d=>{var p;if(l){const h=$mr(d)?d(e):d;h!==e&&((p=s.current)==null||p.call(s,h))}else i(d)},[l,e,i,s]);return[c,u]}function Omr({defaultProp:e,onChange:t}){const[n,r]=f.useState(e),o=f.useRef(n),i=f.useRef(t);return Rmr(()=>{i.current=t},[t]),f.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function $mr(e){return typeof e=="function"}function Dmr(e){const t=Lmr(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,l=f.Children.toArray(i),c=l.find(zmr);if(c){const u=c.props.children,d=l.map(p=>p===c?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:p);return a.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return a.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Lmr(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=Hmr(o),l=Bmr(i,o.props);return o.type!==f.Fragment&&(l.ref=r?z0(r,s):s),f.cloneElement(o,l)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fmr=Symbol("radix.slottable");function zmr(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Fmr}function Bmr(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Hmr(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Vmr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],pa=Vmr.reduce((e,t)=>{const n=Dmr(`Primitive.${t}`),r=f.forwardRef((o,i)=>{const{asChild:s,...l}=o,c=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Umr(e,t){e&&pu.flushSync(()=>e.dispatchEvent(t))}function _I(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Wmr(e,t=globalThis==null?void 0:globalThis.document){const n=_I(e);f.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Gmr="DismissableLayer",ape="dismissableLayer.update",qmr="dismissableLayer.pointerDownOutside",Kmr="dismissableLayer.focusOutside",dFe,cgt=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),jY=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=e,u=f.useContext(cgt),[d,p]=f.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=f.useState({}),g=zc(t,j=>p(j)),y=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=y.indexOf(x),b=d?y.indexOf(d):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=v,C=Qmr(j=>{const I=j.target,_=[...u.branches].some(T=>T.contains(I));!S||_||(o==null||o(j),s==null||s(j),j.defaultPrevented||l==null||l())},h),N=Jmr(j=>{const I=j.target;[...u.branches].some(T=>T.contains(I))||(i==null||i(j),s==null||s(j),j.defaultPrevented||l==null||l())},h);return Wmr(j=>{b===u.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&l&&(j.preventDefault(),l()))},h),f.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(dFe=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),fFe(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=dFe)}},[d,h,n,u]),f.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),fFe())},[d,u]),f.useEffect(()=>{const j=()=>m({});return document.addEventListener(ape,j),()=>document.removeEventListener(ape,j)},[]),a.jsx(pa.div,{...c,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:Ns(e.onFocusCapture,N.onFocusCapture),onBlurCapture:Ns(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:Ns(e.onPointerDownCapture,C.onPointerDownCapture)})});jY.displayName=Gmr;var Ymr="DismissableLayerBranch",Xmr=f.forwardRef((e,t)=>{const n=f.useContext(cgt),r=f.useRef(null),o=zc(t,r);return f.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),a.jsx(pa.div,{...e,ref:o})});Xmr.displayName=Ymr;function Qmr(e,t=globalThis==null?void 0:globalThis.document){const n=_I(e),r=f.useRef(!1),o=f.useRef(()=>{});return f.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){ugt(qmr,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Jmr(e,t=globalThis==null?void 0:globalThis.document){const n=_I(e),r=f.useRef(!1);return f.useEffect(()=>{const o=i=>{i.target&&!r.current&&ugt(Kmr,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function fFe(){const e=new CustomEvent(ape);document.dispatchEvent(e)}function ugt(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Umr(o,i):o.dispatchEvent(i)}var Pne="focusScope.autoFocusOnMount",Ane="focusScope.autoFocusOnUnmount",pFe={bubbles:!1,cancelable:!0},Zmr="FocusScope",EY=f.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[l,c]=f.useState(null),u=_I(o),d=_I(i),p=f.useRef(null),h=zc(t,y=>c(y)),m=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(r){let y=function(w){if(m.paused||!l)return;const S=w.target;l.contains(S)?p.current=S:XS(p.current,{select:!0})},x=function(w){if(m.paused||!l)return;const S=w.relatedTarget;S!==null&&(l.contains(S)||XS(p.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&XS(l)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const b=new MutationObserver(v);return l&&b.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),b.disconnect()}}},[r,l,m.paused]),f.useEffect(()=>{if(l){mFe.add(m);const y=document.activeElement;if(!l.contains(y)){const v=new CustomEvent(Pne,pFe);l.addEventListener(Pne,u),l.dispatchEvent(v),v.defaultPrevented||(egr(igr(dgt(l)),{select:!0}),document.activeElement===y&&XS(l))}return()=>{l.removeEventListener(Pne,u),setTimeout(()=>{const v=new CustomEvent(Ane,pFe);l.addEventListener(Ane,d),l.dispatchEvent(v),v.defaultPrevented||XS(y??document.body,{select:!0}),l.removeEventListener(Ane,d),mFe.remove(m)},0)}}},[l,u,d,m]);const g=f.useCallback(y=>{if(!n&&!r||m.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,v=document.activeElement;if(x&&v){const b=y.currentTarget,[w,S]=tgr(b);w&&S?!y.shiftKey&&v===S?(y.preventDefault(),n&&XS(w,{select:!0})):y.shiftKey&&v===w&&(y.preventDefault(),n&&XS(S,{select:!0})):v===b&&y.preventDefault()}},[n,r,m.paused]);return a.jsx(pa.div,{tabIndex:-1,...s,ref:h,onKeyDown:g})});EY.displayName=Zmr;function egr(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(XS(r,{select:t}),document.activeElement!==n)return}function tgr(e){const t=dgt(e),n=hFe(t,e),r=hFe(t.reverse(),e);return[n,r]}function dgt(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function hFe(e,t){for(const n of e)if(!ngr(n,{upTo:t}))return n}function ngr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function rgr(e){return e instanceof HTMLInputElement&&"select"in e}function XS(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&rgr(e)&&t&&e.select()}}var mFe=ogr();function ogr(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=gFe(e,t),e.unshift(t)},remove(t){var n;e=gFe(e,t),(n=e[0])==null||n.resume()}}}function gFe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function igr(e){return e.filter(t=>t.tagName!=="A")}var agr="Portal",IY=f.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[o,i]=f.useState(!1);Rp(()=>i(!0),[]);const s=n||o&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return s?Uj.createPortal(a.jsx(pa.div,{...r,ref:t}),s):null});IY.displayName=agr;function sgr(e,t){return f.useReducer((n,r)=>t[n][r]??n,e)}var a4=e=>{const{present:t,children:n}=e,r=lgr(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=zc(r.ref,cgr(o));return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};a4.displayName="Presence";function lgr(e){const[t,n]=f.useState(),r=f.useRef(null),o=f.useRef(e),i=f.useRef("none"),s=e?"mounted":"unmounted",[l,c]=sgr(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=o9(r.current);i.current=l==="mounted"?u:"none"},[l]),Rp(()=>{const u=r.current,d=o.current;if(d!==e){const h=i.current,m=o9(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Rp(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,p=m=>{const y=o9(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&y&&(c("ANIMATION_END"),!o.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},h=m=>{m.target===t&&(i.current=o9(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function o9(e){return(e==null?void 0:e.animationName)||"none"}function cgr(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Tne=0;function d1e(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??xFe()),document.body.insertAdjacentElement("beforeend",e[1]??xFe()),Tne++,()=>{Tne===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Tne--}},[])}function xFe(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}function ugr(e){const t=dgr(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,l=f.Children.toArray(i),c=l.find(pgr);if(c){const u=c.props.children,d=l.map(p=>p===c?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:p);return a.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return a.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function dgr(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=mgr(o),l=hgr(i,o.props);return o.type!==f.Fragment&&(l.ref=r?z0(r,s):s),f.cloneElement(o,l)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var fgr=Symbol("radix.slottable");function pgr(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===fgr}function hgr(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function mgr(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _Y="Dialog",[fgt]=E6(_Y),[ggr,ky]=fgt(_Y),pgt=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,l=f.useRef(null),c=f.useRef(null),[u,d]=ipe({prop:r,defaultProp:o??!1,onChange:i,caller:_Y});return a.jsx(ggr,{scope:t,triggerRef:l,contentRef:c,contentId:N0(),titleId:N0(),descriptionId:N0(),open:u,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(p=>!p),[d]),modal:s,children:n})};pgt.displayName=_Y;var hgt="DialogTrigger",xgr=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ky(hgt,n),i=zc(t,o.triggerRef);return a.jsx(pa.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":h1e(o.open),...r,ref:i,onClick:Ns(e.onClick,o.onOpenToggle)})});xgr.displayName=hgt;var f1e="DialogPortal",[ygr,mgt]=fgt(f1e,{forceMount:void 0}),ggt=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=ky(f1e,t);return a.jsx(ygr,{scope:t,forceMount:n,children:f.Children.map(r,s=>a.jsx(a4,{present:n||i.open,children:a.jsx(IY,{asChild:!0,container:o,children:s})}))})};ggt.displayName=f1e;var SW="DialogOverlay",xgt=f.forwardRef((e,t)=>{const n=mgt(SW,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=ky(SW,e.__scopeDialog);return i.modal?a.jsx(a4,{present:r||i.open,children:a.jsx(bgr,{...o,ref:t})}):null});xgt.displayName=SW;var vgr=ugr("DialogOverlay.RemoveScroll"),bgr=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ky(SW,n);return a.jsx(N6,{as:vgr,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(pa.div,{"data-state":h1e(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),PI="DialogContent",ygt=f.forwardRef((e,t)=>{const n=mgt(PI,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=ky(PI,e.__scopeDialog);return a.jsx(a4,{present:r||i.open,children:i.modal?a.jsx(wgr,{...o,ref:t}):a.jsx(Sgr,{...o,ref:t})})});ygt.displayName=PI;var wgr=f.forwardRef((e,t)=>{const n=ky(PI,e.__scopeDialog),r=f.useRef(null),o=zc(t,n.contentRef,r);return f.useEffect(()=>{const i=r.current;if(i)return hY(i)},[]),a.jsx(vgt,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ns(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Ns(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,l=s.button===0&&s.ctrlKey===!0;(s.button===2||l)&&i.preventDefault()}),onFocusOutside:Ns(e.onFocusOutside,i=>i.preventDefault())})}),Sgr=f.forwardRef((e,t)=>{const n=ky(PI,e.__scopeDialog),r=f.useRef(!1),o=f.useRef(!1);return a.jsx(vgt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),vgt=f.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,l=ky(PI,n),c=f.useRef(null),u=zc(t,c);return d1e(),a.jsxs(a.Fragment,{children:[a.jsx(EY,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(jY,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":h1e(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(Cgr,{titleId:l.titleId}),a.jsx(jgr,{contentRef:c,descriptionId:l.descriptionId})]})]})}),p1e="DialogTitle",bgt=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ky(p1e,n);return a.jsx(pa.h2,{id:o.titleId,...r,ref:t})});bgt.displayName=p1e;var wgt="DialogDescription",Sgt=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ky(wgt,n);return a.jsx(pa.p,{id:o.descriptionId,...r,ref:t})});Sgt.displayName=wgt;var Cgt="DialogClose",Ngt=f.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=ky(Cgt,n);return a.jsx(pa.button,{type:"button",...r,ref:t,onClick:Ns(e.onClick,()=>o.onOpenChange(!1))})});Ngt.displayName=Cgt;function h1e(e){return e?"open":"closed"}var jgt="DialogTitleWarning",[Jno,Egt]=Amr(jgt,{contentName:PI,titleName:p1e,docsSlug:"dialog"}),Cgr=({titleId:e})=>{const t=Egt(jgt),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ngr="DialogDescriptionWarning",jgr=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Egt(Ngr).contentName}}.`;return f.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},m1e=pgt,g1e=ggt,I6=xgt,_6=ygt,s4=bgt,PY=Sgt,Egr=Ngt;const Igt=m1e,Igr=g1e,_gt=f.forwardRef(({className:e,...t},n)=>a.jsx(I6,{ref:n,className:Do("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));_gt.displayName=I6.displayName;const x1e=f.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(Igr,{children:[a.jsx(_gt,{}),a.jsxs(_6,{ref:r,className:Do("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,a.jsxs(Egr,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(vh,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));x1e.displayName=_6.displayName;const y1e=({className:e,...t})=>a.jsx("div",{className:Do("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});y1e.displayName="DialogHeader";const Pgt=({className:e,...t})=>a.jsx("div",{className:Do("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Pgt.displayName="DialogFooter";const v1e=f.forwardRef(({className:e,...t},n)=>a.jsx(s4,{ref:n,className:Do("text-lg font-semibold leading-none tracking-tight",e),...t}));v1e.displayName=s4.displayName;const _gr=f.forwardRef(({className:e,...t},n)=>a.jsx(PY,{ref:n,className:Do("text-sm text-muted-foreground",e),...t}));_gr.displayName=PY.displayName;var yFe=1,Pgr=.9,Agr=.8,Tgr=.17,kne=.1,Mne=.999,kgr=.9999,Mgr=.99,Rgr=/[\\\/_+.#"@\[\(\{&]/,Ogr=/[\\\/_+.#"@\[\(\{&]/g,$gr=/[\s-]/,Agt=/[\s-]/g;function spe(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?yFe:Mgr;var l=`${o},${i}`;if(s[l]!==void 0)return s[l];for(var c=r.charAt(i),u=n.indexOf(c,o),d=0,p,h,m,g;u>=0;)p=spe(e,t,n,r,u+1,i+1,s),p>d&&(u===o?p*=yFe:Rgr.test(e.charAt(u-1))?(p*=Agr,m=e.slice(o,u-1).match(Ogr),m&&o>0&&(p*=Math.pow(Mne,m.length))):$gr.test(e.charAt(u-1))?(p*=Pgr,g=e.slice(o,u-1).match(Agt),g&&o>0&&(p*=Math.pow(Mne,g.length))):(p*=Tgr,o>0&&(p*=Math.pow(Mne,u-o))),e.charAt(u)!==t.charAt(i)&&(p*=kgr)),(pp&&(p=h*kne)),p>d&&(d=p),u=n.indexOf(c,u+1);return s[l]=d,d}function vFe(e){return e.toLowerCase().replace(Agt," ")}function Dgr(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,spe(e,t,vFe(e),vFe(t),0,0,{})}var FM='[cmdk-group=""]',Rne='[cmdk-group-items=""]',Lgr='[cmdk-group-heading=""]',Tgt='[cmdk-item=""]',bFe=`${Tgt}:not([aria-disabled="true"])`,lpe="cmdk-item-select",iP="data-value",Fgr=(e,t,n)=>Dgr(e,t,n),kgt=f.createContext(void 0),P6=()=>f.useContext(kgt),Mgt=f.createContext(void 0),b1e=()=>f.useContext(Mgt),Rgt=f.createContext(void 0),Ogt=f.forwardRef((e,t)=>{let n=aP(()=>{var F,W;return{search:"",value:(W=(F=e.value)!=null?F:e.defaultValue)!=null?W:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=aP(()=>new Set),o=aP(()=>new Map),i=aP(()=>new Map),s=aP(()=>new Set),l=$gt(e),{label:c,children:u,value:d,onValueChange:p,filter:h,shouldFilter:m,loop:g,disablePointerSelection:y=!1,vimBindings:x=!0,...v}=e,b=N0(),w=N0(),S=N0(),C=f.useRef(null),N=Xgr();AI(()=>{if(d!==void 0){let F=d.trim();n.current.value=F,j.emit()}},[d]),AI(()=>{N(6,M)},[]);let j=f.useMemo(()=>({subscribe:F=>(s.current.add(F),()=>s.current.delete(F)),snapshot:()=>n.current,setState:(F,W,U)=>{var K,X,J,te;if(!Object.is(n.current[F],W)){if(n.current[F]=W,F==="search")E(),T(),N(1,P);else if(F==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(S);re?re.focus():(K=document.getElementById(b))==null||K.focus()}if(N(7,()=>{var re;n.current.selectedItemId=(re=R())==null?void 0:re.id,j.emit()}),U||N(5,M),((X=l.current)==null?void 0:X.value)!==void 0){let re=W??"";(te=(J=l.current).onValueChange)==null||te.call(J,re);return}}j.emit()}},emit:()=>{s.current.forEach(F=>F())}}),[]),I=f.useMemo(()=>({value:(F,W,U)=>{var K;W!==((K=i.current.get(F))==null?void 0:K.value)&&(i.current.set(F,{value:W,keywords:U}),n.current.filtered.items.set(F,_(W,U)),N(2,()=>{T(),j.emit()}))},item:(F,W)=>(r.current.add(F),W&&(o.current.has(W)?o.current.get(W).add(F):o.current.set(W,new Set([F]))),N(3,()=>{E(),T(),n.current.value||P(),j.emit()}),()=>{i.current.delete(F),r.current.delete(F),n.current.filtered.items.delete(F);let U=R();N(4,()=>{E(),(U==null?void 0:U.getAttribute("id"))===F&&P(),j.emit()})}),group:F=>(o.current.has(F)||o.current.set(F,new Set),()=>{i.current.delete(F),o.current.delete(F)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:S,labelId:w,listInnerRef:C}),[]);function _(F,W){var U,K;let X=(K=(U=l.current)==null?void 0:U.filter)!=null?K:Fgr;return F?X(F,n.current.search,W):0}function T(){if(!n.current.search||l.current.shouldFilter===!1)return;let F=n.current.filtered.items,W=[];n.current.filtered.groups.forEach(K=>{let X=o.current.get(K),J=0;X.forEach(te=>{let re=F.get(te);J=Math.max(re,J)}),W.push([K,J])});let U=C.current;$().sort((K,X)=>{var J,te;let re=K.getAttribute("id"),ce=X.getAttribute("id");return((J=F.get(ce))!=null?J:0)-((te=F.get(re))!=null?te:0)}).forEach(K=>{let X=K.closest(Rne);X?X.appendChild(K.parentElement===X?K:K.closest(`${Rne} > *`)):U.appendChild(K.parentElement===U?K:K.closest(`${Rne} > *`))}),W.sort((K,X)=>X[1]-K[1]).forEach(K=>{var X;let J=(X=C.current)==null?void 0:X.querySelector(`${FM}[${iP}="${encodeURIComponent(K[0])}"]`);J==null||J.parentElement.appendChild(J)})}function P(){let F=$().find(U=>U.getAttribute("aria-disabled")!=="true"),W=F==null?void 0:F.getAttribute(iP);j.setState("value",W||void 0)}function E(){var F,W,U,K;if(!n.current.search||l.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let X=0;for(let J of r.current){let te=(W=(F=i.current.get(J))==null?void 0:F.value)!=null?W:"",re=(K=(U=i.current.get(J))==null?void 0:U.keywords)!=null?K:[],ce=_(te,re);n.current.filtered.items.set(J,ce),ce>0&&X++}for(let[J,te]of o.current)for(let re of te)if(n.current.filtered.items.get(re)>0){n.current.filtered.groups.add(J);break}n.current.filtered.count=X}function M(){var F,W,U;let K=R();K&&(((F=K.parentElement)==null?void 0:F.firstChild)===K&&((U=(W=K.closest(FM))==null?void 0:W.querySelector(Lgr))==null||U.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function R(){var F;return(F=C.current)==null?void 0:F.querySelector(`${Tgt}[aria-selected="true"]`)}function $(){var F;return Array.from(((F=C.current)==null?void 0:F.querySelectorAll(bFe))||[])}function D(F){let W=$()[F];W&&j.setState("value",W.getAttribute(iP))}function z(F){var W;let U=R(),K=$(),X=K.findIndex(te=>te===U),J=K[X+F];(W=l.current)!=null&&W.loop&&(J=X+F<0?K[K.length-1]:X+F===K.length?K[0]:K[X+F]),J&&j.setState("value",J.getAttribute(iP))}function V(F){let W=R(),U=W==null?void 0:W.closest(FM),K;for(;U&&!K;)U=F>0?Kgr(U,FM):Ygr(U,FM),K=U==null?void 0:U.querySelector(bFe);K?j.setState("value",K.getAttribute(iP)):z(F)}let B=()=>D($().length-1),G=F=>{F.preventDefault(),F.metaKey?B():F.altKey?V(1):z(1)},H=F=>{F.preventDefault(),F.metaKey?D(0):F.altKey?V(-1):z(-1)};return f.createElement(pa.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:F=>{var W;(W=v.onKeyDown)==null||W.call(v,F);let U=F.nativeEvent.isComposing||F.keyCode===229;if(!(F.defaultPrevented||U))switch(F.key){case"n":case"j":{x&&F.ctrlKey&&G(F);break}case"ArrowDown":{G(F);break}case"p":case"k":{x&&F.ctrlKey&&H(F);break}case"ArrowUp":{H(F);break}case"Home":{F.preventDefault(),D(0);break}case"End":{F.preventDefault(),B();break}case"Enter":{F.preventDefault();let K=R();if(K){let X=new Event(lpe);K.dispatchEvent(X)}}}}},f.createElement("label",{"cmdk-label":"",htmlFor:I.inputId,id:I.labelId,style:Jgr},c),AY(e,F=>f.createElement(Mgt.Provider,{value:j},f.createElement(kgt.Provider,{value:I},F))))}),zgr=f.forwardRef((e,t)=>{var n,r;let o=N0(),i=f.useRef(null),s=f.useContext(Rgt),l=P6(),c=$gt(e),u=(r=(n=c.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;AI(()=>{if(!u)return l.item(o,s==null?void 0:s.id)},[u]);let d=Dgt(o,i,[e.value,e.children,i],e.keywords),p=b1e(),h=LC(N=>N.value&&N.value===d.current),m=LC(N=>u||l.filter()===!1?!0:N.search?N.filtered.items.get(o)>0:!0);f.useEffect(()=>{let N=i.current;if(!(!N||e.disabled))return N.addEventListener(lpe,g),()=>N.removeEventListener(lpe,g)},[m,e.onSelect,e.disabled]);function g(){var N,j;y(),(j=(N=c.current).onSelect)==null||j.call(N,d.current)}function y(){p.setState("value",d.current,!0)}if(!m)return null;let{disabled:x,value:v,onSelect:b,forceMount:w,keywords:S,...C}=e;return f.createElement(pa.div,{ref:z0(i,t),...C,id:o,"cmdk-item":"",role:"option","aria-disabled":!!x,"aria-selected":!!h,"data-disabled":!!x,"data-selected":!!h,onPointerMove:x||l.getDisablePointerSelection()?void 0:y,onClick:x?void 0:g},e.children)}),Bgr=f.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,s=N0(),l=f.useRef(null),c=f.useRef(null),u=N0(),d=P6(),p=LC(m=>o||d.filter()===!1?!0:m.search?m.filtered.groups.has(s):!0);AI(()=>d.group(s),[]),Dgt(s,l,[e.value,e.heading,c]);let h=f.useMemo(()=>({id:s,forceMount:o}),[o]);return f.createElement(pa.div,{ref:z0(l,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&f.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),AY(e,m=>f.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},f.createElement(Rgt.Provider,{value:h},m))))}),Hgr=f.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=f.useRef(null),i=LC(s=>!s.search);return!n&&!i?null:f.createElement(pa.div,{ref:z0(o,t),...r,"cmdk-separator":"",role:"separator"})}),Vgr=f.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=b1e(),s=LC(u=>u.search),l=LC(u=>u.selectedItemId),c=P6();return f.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),f.createElement(pa.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":l,id:c.inputId,type:"text",value:o?e.value:s,onChange:u=>{o||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),Ugr=f.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=f.useRef(null),s=f.useRef(null),l=LC(u=>u.selectedItemId),c=P6();return f.useEffect(()=>{if(s.current&&i.current){let u=s.current,d=i.current,p,h=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let m=u.offsetHeight;d.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return h.observe(u),()=>{cancelAnimationFrame(p),h.unobserve(u)}}},[]),f.createElement(pa.div,{ref:z0(i,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":r,id:c.listId},AY(e,u=>f.createElement("div",{ref:z0(s,c.listInnerRef),"cmdk-list-sizer":""},u)))}),Wgr=f.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:s,...l}=e;return f.createElement(m1e,{open:n,onOpenChange:r},f.createElement(g1e,{container:s},f.createElement(I6,{"cmdk-overlay":"",className:o}),f.createElement(_6,{"aria-label":e.label,"cmdk-dialog":"",className:i},f.createElement(Ogt,{ref:t,...l}))))}),Ggr=f.forwardRef((e,t)=>LC(n=>n.filtered.count===0)?f.createElement(pa.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),qgr=f.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return f.createElement(pa.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},AY(e,s=>f.createElement("div",{"aria-hidden":!0},s)))}),jm=Object.assign(Ogt,{List:Ugr,Item:zgr,Input:Vgr,Group:Bgr,Separator:Hgr,Dialog:Wgr,Empty:Ggr,Loading:qgr});function Kgr(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Ygr(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function $gt(e){let t=f.useRef(e);return AI(()=>{t.current=e}),t}var AI=typeof window>"u"?f.useEffect:f.useLayoutEffect;function aP(e){let t=f.useRef();return t.current===void 0&&(t.current=e()),t}function LC(e){let t=b1e(),n=()=>e(t.snapshot());return f.useSyncExternalStore(t.subscribe,n,n)}function Dgt(e,t,n,r=[]){let o=f.useRef(),i=P6();return AI(()=>{var s;let l=(()=>{var u;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(u=d.current.textContent)==null?void 0:u.trim():o.current}})(),c=r.map(u=>u.trim());i.value(e,l,c),(s=t.current)==null||s.setAttribute(iP,l),o.current=l}),o}var Xgr=()=>{let[e,t]=f.useState(),n=aP(()=>new Map);return AI(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function Qgr(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function AY({asChild:e,children:t},n){return e&&f.isValidElement(t)?f.cloneElement(Qgr(t),{ref:t.ref},n(t.props.children)):n(t)}var Jgr={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Zgr=f.forwardRef(({className:e,...t},n)=>a.jsx(jm,{ref:n,className:Do("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));Zgr.displayName=jm.displayName;const e0r=f.forwardRef(({className:e,...t},n)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx(hm,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(jm.Input,{ref:n,className:Do("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));e0r.displayName=jm.Input.displayName;const t0r=f.forwardRef(({className:e,...t},n)=>a.jsx(jm.List,{ref:n,className:Do("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));t0r.displayName=jm.List.displayName;const n0r=f.forwardRef((e,t)=>a.jsx(jm.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));n0r.displayName=jm.Empty.displayName;const r0r=f.forwardRef(({className:e,...t},n)=>a.jsx(jm.Group,{ref:n,className:Do("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));r0r.displayName=jm.Group.displayName;const o0r=f.forwardRef(({className:e,...t},n)=>a.jsx(jm.Separator,{ref:n,className:Do("-mx-1 h-px bg-border",e),...t}));o0r.displayName=jm.Separator.displayName;const i0r=f.forwardRef(({className:e,...t},n)=>a.jsx(jm.Item,{ref:n,className:Do("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));i0r.displayName=jm.Item.displayName;const a0r=["top","right","bottom","left"],FC=Math.min,Xm=Math.max,CW=Math.round,i9=Math.floor,eb=e=>({x:e,y:e}),s0r={left:"right",right:"left",bottom:"top",top:"bottom"},l0r={start:"end",end:"start"};function cpe(e,t,n){return Xm(e,FC(t,n))}function Iw(e,t){return typeof e=="function"?e(t):e}function _w(e){return e.split("-")[0]}function l4(e){return e.split("-")[1]}function w1e(e){return e==="x"?"y":"x"}function S1e(e){return e==="y"?"height":"width"}const c0r=new Set(["top","bottom"]);function Bv(e){return c0r.has(_w(e))?"y":"x"}function C1e(e){return w1e(Bv(e))}function u0r(e,t,n){n===void 0&&(n=!1);const r=l4(e),o=C1e(e),i=S1e(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=NW(s)),[s,NW(s)]}function d0r(e){const t=NW(e);return[upe(e),t,upe(t)]}function upe(e){return e.replace(/start|end/g,t=>l0r[t])}const wFe=["left","right"],SFe=["right","left"],f0r=["top","bottom"],p0r=["bottom","top"];function h0r(e,t,n){switch(e){case"top":case"bottom":return n?t?SFe:wFe:t?wFe:SFe;case"left":case"right":return t?f0r:p0r;default:return[]}}function m0r(e,t,n,r){const o=l4(e);let i=h0r(_w(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(upe)))),i}function NW(e){return e.replace(/left|right|bottom|top/g,t=>s0r[t])}function g0r(e){return{top:0,right:0,bottom:0,left:0,...e}}function Lgt(e){return typeof e!="number"?g0r(e):{top:e,right:e,bottom:e,left:e}}function jW(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function CFe(e,t,n){let{reference:r,floating:o}=e;const i=Bv(t),s=C1e(t),l=S1e(s),c=_w(t),u=i==="y",d=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,h=r[l]/2-o[l]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:p};break;case"left":m={x:r.x-o.width,y:p};break;default:m={x:r.x,y:r.y}}switch(l4(t)){case"start":m[s]-=h*(n&&u?-1:1);break;case"end":m[s]+=h*(n&&u?-1:1);break}return m}const x0r=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,l=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:p}=CFe(u,r,c),h=r,m={},g=0;for(let y=0;y({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Iw(e,t)||{};if(u==null)return{};const p=Lgt(d),h={x:n,y:r},m=C1e(o),g=S1e(m),y=await s.getDimensions(u),x=m==="y",v=x?"top":"left",b=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=i.reference[g]+i.reference[m]-h[m]-i.floating[g],C=h[m]-i.reference[m],N=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let j=N?N[w]:0;(!j||!await(s.isElement==null?void 0:s.isElement(N)))&&(j=l.floating[w]||i.floating[g]);const I=S/2-C/2,_=j/2-y[g]/2-1,T=FC(p[v],_),P=FC(p[b],_),E=T,M=j-y[g]-P,R=j/2-y[g]/2+I,$=cpe(E,R,M),D=!c.arrow&&l4(o)!=null&&R!==$&&i.reference[g]/2-(RR<=0)){var P,E;const R=(((P=i.flip)==null?void 0:P.index)||0)+1,$=j[R];if($&&(!(p==="alignment"?b!==Bv($):!1)||T.every(V=>Bv(V.placement)===b?V.overflows[0]>0:!0)))return{data:{index:R,overflows:T},reset:{placement:$}};let D=(E=T.filter(z=>z.overflows[0]<=0).sort((z,V)=>z.overflows[1]-V.overflows[1])[0])==null?void 0:E.placement;if(!D)switch(m){case"bestFit":{var M;const z=(M=T.filter(V=>{if(N){const B=Bv(V.placement);return B===b||B==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(B=>B>0).reduce((B,G)=>B+G,0)]).sort((V,B)=>V[1]-B[1])[0])==null?void 0:M[0];z&&(D=z);break}case"initialPlacement":D=l;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function NFe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jFe(e){return a0r.some(t=>e[t]>=0)}const b0r=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Iw(e,t);switch(r){case"referenceHidden":{const i=await hD(t,{...o,elementContext:"reference"}),s=NFe(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:jFe(s)}}}case"escaped":{const i=await hD(t,{...o,altBoundary:!0}),s=NFe(i,n.floating);return{data:{escapedOffsets:s,escaped:jFe(s)}}}default:return{}}}}},Fgt=new Set(["left","top"]);async function w0r(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=_w(n),l=l4(n),c=Bv(n)==="y",u=Fgt.has(s)?-1:1,d=i&&c?-1:1,p=Iw(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const S0r=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:l}=t,c=await w0r(t,e);return s===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:s}}}}},C0r=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:x=>{let{x:v,y:b}=x;return{x:v,y:b}}},...c}=Iw(e,t),u={x:n,y:r},d=await hD(t,c),p=Bv(_w(o)),h=w1e(p);let m=u[h],g=u[p];if(i){const x=h==="y"?"top":"left",v=h==="y"?"bottom":"right",b=m+d[x],w=m-d[v];m=cpe(b,m,w)}if(s){const x=p==="y"?"top":"left",v=p==="y"?"bottom":"right",b=g+d[x],w=g-d[v];g=cpe(b,g,w)}const y=l.fn({...t,[h]:m,[p]:g});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:i,[p]:s}}}}}},N0r=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Iw(e,t),d={x:n,y:r},p=Bv(o),h=w1e(p);let m=d[h],g=d[p];const y=Iw(l,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const w=h==="y"?"height":"width",S=i.reference[h]-i.floating[w]+x.mainAxis,C=i.reference[h]+i.reference[w]-x.mainAxis;mC&&(m=C)}if(u){var v,b;const w=h==="y"?"width":"height",S=Fgt.has(_w(o)),C=i.reference[p]-i.floating[w]+(S&&((v=s.offset)==null?void 0:v[p])||0)+(S?0:x.crossAxis),N=i.reference[p]+i.reference[w]+(S?0:((b=s.offset)==null?void 0:b[p])||0)-(S?x.crossAxis:0);gN&&(g=N)}return{[h]:m,[p]:g}}}},j0r=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:c=()=>{},...u}=Iw(e,t),d=await hD(t,u),p=_w(o),h=l4(o),m=Bv(o)==="y",{width:g,height:y}=i.floating;let x,v;p==="top"||p==="bottom"?(x=p,v=h===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(v=p,x=h==="end"?"top":"bottom");const b=y-d.top-d.bottom,w=g-d.left-d.right,S=FC(y-d[x],b),C=FC(g-d[v],w),N=!t.middlewareData.shift;let j=S,I=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=b),N&&!h){const T=Xm(d.left,0),P=Xm(d.right,0),E=Xm(d.top,0),M=Xm(d.bottom,0);m?I=g-2*(T!==0||P!==0?T+P:Xm(d.left,d.right)):j=y-2*(E!==0||M!==0?E+M:Xm(d.top,d.bottom))}await c({...t,availableWidth:I,availableHeight:j});const _=await s.getDimensions(l.floating);return g!==_.width||y!==_.height?{reset:{rects:!0}}:{}}}};function TY(){return typeof window<"u"}function c4(e){return zgt(e)?(e.nodeName||"").toLowerCase():"#document"}function lg(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Rb(e){var t;return(t=(zgt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zgt(e){return TY()?e instanceof Node||e instanceof lg(e).Node:!1}function vy(e){return TY()?e instanceof Element||e instanceof lg(e).Element:!1}function vb(e){return TY()?e instanceof HTMLElement||e instanceof lg(e).HTMLElement:!1}function EFe(e){return!TY()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof lg(e).ShadowRoot}const E0r=new Set(["inline","contents"]);function A6(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=by(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!E0r.has(o)}const I0r=new Set(["table","td","th"]);function _0r(e){return I0r.has(c4(e))}const P0r=[":popover-open",":modal"];function kY(e){return P0r.some(t=>{try{return e.matches(t)}catch{return!1}})}const A0r=["transform","translate","scale","rotate","perspective"],T0r=["transform","translate","scale","rotate","perspective","filter"],k0r=["paint","layout","strict","content"];function N1e(e){const t=j1e(),n=vy(e)?by(e):e;return A0r.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||T0r.some(r=>(n.willChange||"").includes(r))||k0r.some(r=>(n.contain||"").includes(r))}function M0r(e){let t=zC(e);for(;vb(t)&&!LT(t);){if(N1e(t))return t;if(kY(t))return null;t=zC(t)}return null}function j1e(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const R0r=new Set(["html","body","#document"]);function LT(e){return R0r.has(c4(e))}function by(e){return lg(e).getComputedStyle(e)}function MY(e){return vy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zC(e){if(c4(e)==="html")return e;const t=e.assignedSlot||e.parentNode||EFe(e)&&e.host||Rb(e);return EFe(t)?t.host:t}function Bgt(e){const t=zC(e);return LT(t)?e.ownerDocument?e.ownerDocument.body:e.body:vb(t)&&A6(t)?t:Bgt(t)}function mD(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Bgt(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=lg(o);if(i){const l=dpe(s);return t.concat(s,s.visualViewport||[],A6(o)?o:[],l&&n?mD(l):[])}return t.concat(o,mD(o,[],n))}function dpe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Hgt(e){const t=by(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=vb(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=CW(n)!==i||CW(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function E1e(e){return vy(e)?e:e.contextElement}function SA(e){const t=E1e(e);if(!vb(t))return eb(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Hgt(t);let s=(i?CW(n.width):n.width)/r,l=(i?CW(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const O0r=eb(0);function Vgt(e){const t=lg(e);return!j1e()||!t.visualViewport?O0r:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $0r(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==lg(e)?!1:t}function TI(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=E1e(e);let s=eb(1);t&&(r?vy(r)&&(s=SA(r)):s=SA(e));const l=$0r(i,n,r)?Vgt(i):eb(0);let c=(o.left+l.x)/s.x,u=(o.top+l.y)/s.y,d=o.width/s.x,p=o.height/s.y;if(i){const h=lg(i),m=r&&vy(r)?lg(r):r;let g=h,y=dpe(g);for(;y&&r&&m!==g;){const x=SA(y),v=y.getBoundingClientRect(),b=by(y),w=v.left+(y.clientLeft+parseFloat(b.paddingLeft))*x.x,S=v.top+(y.clientTop+parseFloat(b.paddingTop))*x.y;c*=x.x,u*=x.y,d*=x.x,p*=x.y,c+=w,u+=S,g=lg(y),y=dpe(g)}}return jW({width:d,height:p,x:c,y:u})}function RY(e,t){const n=MY(e).scrollLeft;return t?t.left+n:TI(Rb(e)).left+n}function Ugt(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-RY(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function D0r(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Rb(r),l=t?kY(t.floating):!1;if(r===s||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=eb(1);const d=eb(0),p=vb(r);if((p||!p&&!i)&&((c4(r)!=="body"||A6(s))&&(c=MY(r)),vb(r))){const m=TI(r);u=SA(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=s&&!p&&!i?Ugt(s,c):eb(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function L0r(e){return Array.from(e.getClientRects())}function F0r(e){const t=Rb(e),n=MY(e),r=e.ownerDocument.body,o=Xm(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Xm(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+RY(e);const l=-n.scrollTop;return by(r).direction==="rtl"&&(s+=Xm(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}const IFe=25;function z0r(e,t){const n=lg(e),r=Rb(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,c=0;if(o){i=o.width,s=o.height;const d=j1e();(!d||d&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}const u=RY(r);if(u<=0){const d=r.ownerDocument,p=d.body,h=getComputedStyle(p),m=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-p.clientWidth-m);g<=IFe&&(i-=g)}else u<=IFe&&(i+=u);return{width:i,height:s,x:l,y:c}}const B0r=new Set(["absolute","fixed"]);function H0r(e,t){const n=TI(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=vb(e)?SA(e):eb(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,u=r*i.y;return{width:s,height:l,x:c,y:u}}function _Fe(e,t,n){let r;if(t==="viewport")r=z0r(e,n);else if(t==="document")r=F0r(Rb(e));else if(vy(t))r=H0r(t,n);else{const o=Vgt(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return jW(r)}function Wgt(e,t){const n=zC(e);return n===t||!vy(n)||LT(n)?!1:by(n).position==="fixed"||Wgt(n,t)}function V0r(e,t){const n=t.get(e);if(n)return n;let r=mD(e,[],!1).filter(l=>vy(l)&&c4(l)!=="body"),o=null;const i=by(e).position==="fixed";let s=i?zC(e):e;for(;vy(s)&&!LT(s);){const l=by(s),c=N1e(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&B0r.has(o.position)||A6(s)&&!c&&Wgt(e,s))?r=r.filter(d=>d!==s):o=l,s=zC(s)}return t.set(e,r),r}function U0r(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?kY(t)?[]:V0r(t,this._c):[].concat(n),r],l=s[0],c=s.reduce((u,d)=>{const p=_Fe(t,d,o);return u.top=Xm(p.top,u.top),u.right=FC(p.right,u.right),u.bottom=FC(p.bottom,u.bottom),u.left=Xm(p.left,u.left),u},_Fe(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function W0r(e){const{width:t,height:n}=Hgt(e);return{width:t,height:n}}function G0r(e,t,n){const r=vb(t),o=Rb(t),i=n==="fixed",s=TI(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=eb(0);function u(){c.x=RY(o)}if(r||!r&&!i)if((c4(t)!=="body"||A6(o))&&(l=MY(t)),r){const m=TI(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&u();i&&!r&&o&&u();const d=o&&!r&&!i?Ugt(o,l):eb(0),p=s.left+l.scrollLeft-c.x-d.x,h=s.top+l.scrollTop-c.y-d.y;return{x:p,y:h,width:s.width,height:s.height}}function One(e){return by(e).position==="static"}function PFe(e,t){if(!vb(e)||by(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Rb(e)===n&&(n=n.ownerDocument.body),n}function Ggt(e,t){const n=lg(e);if(kY(e))return n;if(!vb(e)){let o=zC(e);for(;o&&!LT(o);){if(vy(o)&&!One(o))return o;o=zC(o)}return n}let r=PFe(e,t);for(;r&&_0r(r)&&One(r);)r=PFe(r,t);return r&<(r)&&One(r)&&!N1e(r)?n:r||M0r(e)||n}const q0r=async function(e){const t=this.getOffsetParent||Ggt,n=this.getDimensions,r=await n(e.floating);return{reference:G0r(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function K0r(e){return by(e).direction==="rtl"}const Y0r={convertOffsetParentRelativeRectToViewportRelativeRect:D0r,getDocumentElement:Rb,getClippingRect:U0r,getOffsetParent:Ggt,getElementRects:q0r,getClientRects:L0r,getDimensions:W0r,getScale:SA,isElement:vy,isRTL:K0r};function qgt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function X0r(e,t){let n=null,r;const o=Rb(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:d,top:p,width:h,height:m}=u;if(l||t(),!h||!m)return;const g=i9(p),y=i9(o.clientWidth-(d+h)),x=i9(o.clientHeight-(p+m)),v=i9(d),w={rootMargin:-g+"px "+-y+"px "+-x+"px "+-v+"px",threshold:Xm(0,FC(1,c))||1};let S=!0;function C(N){const j=N[0].intersectionRatio;if(j!==c){if(!S)return s();j?s(!1,j):r=setTimeout(()=>{s(!1,1e-7)},1e3)}j===1&&!qgt(u,e.getBoundingClientRect())&&s(),S=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return s(!0),i}function Kgt(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=E1e(e),d=o||i?[...u?mD(u):[],...mD(t)]:[];d.forEach(v=>{o&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const p=u&&l?X0r(u,n):null;let h=-1,m=null;s&&(m=new ResizeObserver(v=>{let[b]=v;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let g,y=c?TI(e):null;c&&x();function x(){const v=TI(e);y&&!qgt(y,v)&&n(),y=v,g=requestAnimationFrame(x)}return n(),()=>{var v;d.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),p==null||p(),(v=m)==null||v.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Q0r=S0r,J0r=C0r,Z0r=v0r,exr=j0r,txr=b0r,AFe=y0r,nxr=N0r,rxr=(e,t,n)=>{const r=new Map,o={platform:Y0r,...n},i={...o.platform,_c:r};return x0r(e,t,{...o,platform:i})};var oxr=typeof document<"u",ixr=function(){},FB=oxr?f.useLayoutEffect:ixr;function EW(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!EW(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!EW(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ygt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function TFe(e,t){const n=Ygt(e);return Math.round(t*n)/n}function $ne(e){const t=f.useRef(e);return FB(()=>{t.current=e}),t}function axr(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,p]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=f.useState(r);EW(h,r)||m(r);const[g,y]=f.useState(null),[x,v]=f.useState(null),b=f.useCallback(V=>{V!==N.current&&(N.current=V,y(V))},[]),w=f.useCallback(V=>{V!==j.current&&(j.current=V,v(V))},[]),S=i||g,C=s||x,N=f.useRef(null),j=f.useRef(null),I=f.useRef(d),_=c!=null,T=$ne(c),P=$ne(o),E=$ne(u),M=f.useCallback(()=>{if(!N.current||!j.current)return;const V={placement:t,strategy:n,middleware:h};P.current&&(V.platform=P.current),rxr(N.current,j.current,V).then(B=>{const G={...B,isPositioned:E.current!==!1};R.current&&!EW(I.current,G)&&(I.current=G,pu.flushSync(()=>{p(G)}))})},[h,t,n,P,E]);FB(()=>{u===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,p(V=>({...V,isPositioned:!1})))},[u]);const R=f.useRef(!1);FB(()=>(R.current=!0,()=>{R.current=!1}),[]),FB(()=>{if(S&&(N.current=S),C&&(j.current=C),S&&C){if(T.current)return T.current(S,C,M);M()}},[S,C,M,T,_]);const $=f.useMemo(()=>({reference:N,floating:j,setReference:b,setFloating:w}),[b,w]),D=f.useMemo(()=>({reference:S,floating:C}),[S,C]),z=f.useMemo(()=>{const V={position:n,left:0,top:0};if(!D.floating)return V;const B=TFe(D.floating,d.x),G=TFe(D.floating,d.y);return l?{...V,transform:"translate("+B+"px, "+G+"px)",...Ygt(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:G}},[n,l,D.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:M,refs:$,elements:D,floatingStyles:z}),[d,M,$,D,z])}const sxr=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?AFe({element:r.current,padding:o}).fn(n):{}:r?AFe({element:r,padding:o}).fn(n):{}}}},lxr=(e,t)=>({...Q0r(e),options:[e,t]}),cxr=(e,t)=>({...J0r(e),options:[e,t]}),uxr=(e,t)=>({...nxr(e),options:[e,t]}),dxr=(e,t)=>({...Z0r(e),options:[e,t]}),fxr=(e,t)=>({...exr(e),options:[e,t]}),pxr=(e,t)=>({...txr(e),options:[e,t]}),hxr=(e,t)=>({...sxr(e),options:[e,t]});var mxr="Arrow",Xgt=f.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return a.jsx(pa.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Xgt.displayName=mxr;var gxr=Xgt;function xxr(e){const[t,n]=f.useState(void 0);return Rp(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;s=u.inlineSize,l=u.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var I1e="Popper",[Qgt,OY]=E6(I1e),[yxr,Jgt]=Qgt(I1e),Zgt=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return a.jsx(yxr,{scope:t,anchor:r,onAnchorChange:o,children:n})};Zgt.displayName=I1e;var e0t="PopperAnchor",t0t=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Jgt(e0t,n),s=f.useRef(null),l=zc(t,s),c=f.useRef(null);return f.useEffect(()=>{const u=c.current;c.current=(r==null?void 0:r.current)||s.current,u!==c.current&&i.onAnchorChange(c.current)}),r?null:a.jsx(pa.div,{...o,ref:l})});t0t.displayName=e0t;var _1e="PopperContent",[vxr,bxr]=Qgt(_1e),n0t=f.forwardRef((e,t)=>{var J,te,re,ce,ae,oe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:g,...y}=e,x=Jgt(_1e,n),[v,b]=f.useState(null),w=zc(t,ue=>b(ue)),[S,C]=f.useState(null),N=xxr(S),j=(N==null?void 0:N.width)??0,I=(N==null?void 0:N.height)??0,_=r+(i!=="center"?"-"+i:""),T=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],E=P.length>0,M={padding:T,boundary:P.filter(Sxr),altBoundary:E},{refs:R,floatingStyles:$,placement:D,isPositioned:z,middlewareData:V}=axr({strategy:"fixed",placement:_,whileElementsMounted:(...ue)=>Kgt(...ue,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[lxr({mainAxis:o+I,alignmentAxis:s}),c&&cxr({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?uxr():void 0,...M}),c&&dxr({...M}),fxr({...M,apply:({elements:ue,rects:fe,availableWidth:se,availableHeight:ge})=>{const{width:ye,height:de}=fe.reference,Ne=ue.floating.style;Ne.setProperty("--radix-popper-available-width",`${se}px`),Ne.setProperty("--radix-popper-available-height",`${ge}px`),Ne.setProperty("--radix-popper-anchor-width",`${ye}px`),Ne.setProperty("--radix-popper-anchor-height",`${de}px`)}}),S&&hxr({element:S,padding:l}),Cxr({arrowWidth:j,arrowHeight:I}),h&&pxr({strategy:"referenceHidden",...M})]}),[B,G]=i0t(D),H=_I(g);Rp(()=>{z&&(H==null||H())},[z,H]);const F=(J=V.arrow)==null?void 0:J.x,W=(te=V.arrow)==null?void 0:te.y,U=((re=V.arrow)==null?void 0:re.centerOffset)!==0,[K,X]=f.useState();return Rp(()=>{v&&X(window.getComputedStyle(v).zIndex)},[v]),a.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:z?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(ce=V.transformOrigin)==null?void 0:ce.x,(ae=V.transformOrigin)==null?void 0:ae.y].join(" "),...((oe=V.hide)==null?void 0:oe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(vxr,{scope:n,placedSide:B,onArrowChange:C,arrowX:F,arrowY:W,shouldHideArrow:U,children:a.jsx(pa.div,{"data-side":B,"data-align":G,...y,ref:w,style:{...y.style,animation:z?void 0:"none"}})})})});n0t.displayName=_1e;var r0t="PopperArrow",wxr={top:"bottom",right:"left",bottom:"top",left:"right"},o0t=f.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=bxr(r0t,r),s=wxr[i.placedSide];return a.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:a.jsx(gxr,{...o,ref:n,style:{...o.style,display:"block"}})})});o0t.displayName=r0t;function Sxr(e){return e!==null}var Cxr=e=>({name:"transformOrigin",options:e,fn(t){var x,v,b;const{placement:n,rects:r,middlewareData:o}=t,s=((x=o.arrow)==null?void 0:x.centerOffset)!==0,l=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[u,d]=i0t(n),p={start:"0%",center:"50%",end:"100%"}[d],h=(((v=o.arrow)==null?void 0:v.x)??0)+l/2,m=(((b=o.arrow)==null?void 0:b.y)??0)+c/2;let g="",y="";return u==="bottom"?(g=s?p:`${h}px`,y=`${-c}px`):u==="top"?(g=s?p:`${h}px`,y=`${r.floating.height+c}px`):u==="right"?(g=`${-c}px`,y=s?p:`${m}px`):u==="left"&&(g=`${r.floating.width+c}px`,y=s?p:`${m}px`),{data:{x:g,y}}}});function i0t(e){const[t,n="center"]=e.split("-");return[t,n]}var Nxr=Zgt,P1e=t0t,a0t=n0t,s0t=o0t;function jxr(e){const t=Exr(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,l=f.Children.toArray(i),c=l.find(_xr);if(c){const u=c.props.children,d=l.map(p=>p===c?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:p);return a.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return a.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Exr(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=Axr(o),l=Pxr(i,o.props);return o.type!==f.Fragment&&(l.ref=r?z0(r,s):s),f.cloneElement(o,l)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Ixr=Symbol("radix.slottable");function _xr(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ixr}function Pxr(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Axr(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var l0t="Popover",[c0t]=E6(l0t,[OY]),$Y=OY(),[Zno,fN]=c0t(l0t),u0t="PopoverAnchor",Txr=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=fN(u0t,n),i=$Y(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:l}=o;return f.useEffect(()=>(s(),()=>l()),[s,l]),a.jsx(P1e,{...i,...r,ref:t})});Txr.displayName=u0t;var d0t="PopoverTrigger",kxr=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=fN(d0t,n),i=$Y(n),s=zc(t,o.triggerRef),l=a.jsx(pa.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":g0t(o.open),...r,ref:s,onClick:Ns(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?l:a.jsx(P1e,{asChild:!0,...i,children:l})});kxr.displayName=d0t;var A1e="PopoverPortal",[Mxr,Rxr]=c0t(A1e,{forceMount:void 0}),f0t=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=fN(A1e,t);return a.jsx(Mxr,{scope:t,forceMount:n,children:a.jsx(a4,{present:n||i.open,children:a.jsx(IY,{asChild:!0,container:o,children:r})})})};f0t.displayName=A1e;var FT="PopoverContent",p0t=f.forwardRef((e,t)=>{const n=Rxr(FT,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=fN(FT,e.__scopePopover);return a.jsx(a4,{present:r||i.open,children:i.modal?a.jsx($xr,{...o,ref:t}):a.jsx(Dxr,{...o,ref:t})})});p0t.displayName=FT;var Oxr=jxr("PopoverContent.RemoveScroll"),$xr=f.forwardRef((e,t)=>{const n=fN(FT,e.__scopePopover),r=f.useRef(null),o=zc(t,r),i=f.useRef(!1);return f.useEffect(()=>{const s=r.current;if(s)return hY(s)},[]),a.jsx(N6,{as:Oxr,allowPinchZoom:!0,children:a.jsx(h0t,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ns(e.onCloseAutoFocus,s=>{var l;s.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:Ns(e.onPointerDownOutside,s=>{const l=s.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:Ns(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Dxr=f.forwardRef((e,t)=>{const n=fN(FT,e.__scopePopover),r=f.useRef(!1),o=f.useRef(!1);return a.jsx(h0t,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,l;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),h0t=f.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...p}=e,h=fN(FT,n),m=$Y(n);return d1e(),a.jsx(EY,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:a.jsx(jY,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:a.jsx(a0t,{"data-state":g0t(h.open),role:"dialog",id:h.contentId,...m,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),m0t="PopoverClose",Lxr=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=fN(m0t,n);return a.jsx(pa.button,{type:"button",...r,ref:t,onClick:Ns(e.onClick,()=>o.onOpenChange(!1))})});Lxr.displayName=m0t;var Fxr="PopoverArrow",zxr=f.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=$Y(n);return a.jsx(s0t,{...o,...r,ref:t})});zxr.displayName=Fxr;function g0t(e){return e?"open":"closed"}var Bxr=f0t,x0t=p0t;const Hxr=f.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>a.jsx(Bxr,{children:a.jsx(x0t,{ref:o,align:t,sideOffset:n,className:Do("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));Hxr.displayName=x0t.displayName;function kFe(e,[t,n]){return Math.min(n,Math.max(t,e))}function MFe(e){const t=Vxr(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,l=f.Children.toArray(i),c=l.find(Wxr);if(c){const u=c.props.children,d=l.map(p=>p===c?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:p);return a.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return a.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Vxr(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=qxr(o),l=Gxr(i,o.props);return o.type!==f.Fragment&&(l.ref=r?z0(r,s):s),f.cloneElement(o,l)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Uxr=Symbol("radix.slottable");function Wxr(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Uxr}function Gxr(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function qxr(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Kxr(e){const t=e+"CollectionProvider",[n,r]=E6(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:x,children:v}=y,b=Ie.useRef(null),w=Ie.useRef(new Map).current;return a.jsx(o,{scope:x,itemMap:w,collectionRef:b,children:v})};s.displayName=t;const l=e+"CollectionSlot",c=MFe(l),u=Ie.forwardRef((y,x)=>{const{scope:v,children:b}=y,w=i(l,v),S=zc(x,w.collectionRef);return a.jsx(c,{ref:S,children:b})});u.displayName=l;const d=e+"CollectionItemSlot",p="data-radix-collection-item",h=MFe(d),m=Ie.forwardRef((y,x)=>{const{scope:v,children:b,...w}=y,S=Ie.useRef(null),C=zc(x,S),N=i(d,v);return Ie.useEffect(()=>(N.itemMap.set(S,{ref:S,...w}),()=>void N.itemMap.delete(S))),a.jsx(h,{[p]:"",ref:C,children:b})});m.displayName=d;function g(y){const x=i(e+"CollectionConsumer",y);return Ie.useCallback(()=>{const b=x.collectionRef.current;if(!b)return[];const w=Array.from(b.querySelectorAll(`[${p}]`));return Array.from(x.itemMap.values()).sort((N,j)=>w.indexOf(N.ref.current)-w.indexOf(j.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:s,Slot:u,ItemSlot:m},g,r]}var Yxr=f.createContext(void 0);function Xxr(e){const t=f.useContext(Yxr);return e||t||"ltr"}function Qxr(e){const t=Jxr(e),n=f.forwardRef((r,o)=>{const{children:i,...s}=r,l=f.Children.toArray(i),c=l.find(eyr);if(c){const u=c.props.children,d=l.map(p=>p===c?f.Children.count(u)>1?f.Children.only(null):f.isValidElement(u)?u.props.children:null:p);return a.jsx(t,{...s,ref:o,children:f.isValidElement(u)?f.cloneElement(u,void 0,d):null})}return a.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Jxr(e){const t=f.forwardRef((n,r)=>{const{children:o,...i}=n;if(f.isValidElement(o)){const s=nyr(o),l=tyr(i,o.props);return o.type!==f.Fragment&&(l.ref=r?z0(r,s):s),f.cloneElement(o,l)}return f.Children.count(o)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zxr=Symbol("radix.slottable");function eyr(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zxr}function tyr(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...l)=>{const c=i(...l);return o(...l),c}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function nyr(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ryr(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var y0t=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),oyr="VisuallyHidden",iyr=f.forwardRef((e,t)=>a.jsx(pa.span,{...e,ref:t,style:{...y0t,...e.style}}));iyr.displayName=oyr;var ayr=[" ","Enter","ArrowUp","ArrowDown"],syr=[" ","Enter"],kI="Select",[DY,LY,lyr]=Kxr(kI),[u4]=E6(kI,[lyr,OY]),FY=OY(),[cyr,pN]=u4(kI),[uyr,dyr]=u4(kI),v0t=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:p,disabled:h,required:m,form:g}=e,y=FY(t),[x,v]=f.useState(null),[b,w]=f.useState(null),[S,C]=f.useState(!1),N=Xxr(u),[j,I]=ipe({prop:r,defaultProp:o??!1,onChange:i,caller:kI}),[_,T]=ipe({prop:s,defaultProp:l,onChange:c,caller:kI}),P=f.useRef(null),E=x?g||!!x.closest("form"):!0,[M,R]=f.useState(new Set),$=Array.from(M).map(D=>D.props.value).join(";");return a.jsx(Nxr,{...y,children:a.jsxs(cyr,{required:m,scope:t,trigger:x,onTriggerChange:v,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:N0(),value:_,onValueChange:T,open:j,onOpenChange:I,dir:N,triggerPointerDownPosRef:P,disabled:h,children:[a.jsx(DY.Provider,{scope:t,children:a.jsx(uyr,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(D=>{R(z=>new Set(z).add(D))},[]),onNativeOptionRemove:f.useCallback(D=>{R(z=>{const V=new Set(z);return V.delete(D),V})},[]),children:n})}),E?a.jsxs(V0t,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:p,value:_,onChange:D=>T(D.target.value),disabled:h,form:g,children:[_===void 0?a.jsx("option",{value:""}):null,Array.from(M)]},$):null]})})};v0t.displayName=kI;var b0t="SelectTrigger",w0t=f.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=FY(n),s=pN(b0t,n),l=s.disabled||r,c=zc(t,s.onTriggerChange),u=LY(n),d=f.useRef("touch"),[p,h,m]=W0t(y=>{const x=u().filter(w=>!w.disabled),v=x.find(w=>w.value===s.value),b=G0t(x,y,v);b!==void 0&&s.onValueChange(b.value)}),g=y=>{l||(s.onOpenChange(!0),m()),y&&(s.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return a.jsx(P1e,{asChild:!0,...i,children:a.jsx(pa.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":U0t(s.value)?"":void 0,...o,ref:c,onClick:Ns(o.onClick,y=>{y.currentTarget.focus(),d.current!=="mouse"&&g(y)}),onPointerDown:Ns(o.onPointerDown,y=>{d.current=y.pointerType;const x=y.target;x.hasPointerCapture(y.pointerId)&&x.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(g(y),y.preventDefault())}),onKeyDown:Ns(o.onKeyDown,y=>{const x=p.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&h(y.key),!(x&&y.key===" ")&&ayr.includes(y.key)&&(g(),y.preventDefault())})})})});w0t.displayName=b0t;var S0t="SelectValue",C0t=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...l}=e,c=pN(S0t,n),{onValueNodeHasChildrenChange:u}=c,d=i!==void 0,p=zc(t,c.onValueNodeChange);return Rp(()=>{u(d)},[u,d]),a.jsx(pa.span,{...l,ref:p,style:{pointerEvents:"none"},children:U0t(c.value)?a.jsx(a.Fragment,{children:s}):i})});C0t.displayName=S0t;var fyr="SelectIcon",N0t=f.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return a.jsx(pa.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});N0t.displayName=fyr;var pyr="SelectPortal",j0t=e=>a.jsx(IY,{asChild:!0,...e});j0t.displayName=pyr;var MI="SelectContent",E0t=f.forwardRef((e,t)=>{const n=pN(MI,e.__scopeSelect),[r,o]=f.useState();if(Rp(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?pu.createPortal(a.jsx(I0t,{scope:e.__scopeSelect,children:a.jsx(DY.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),i):null}return a.jsx(_0t,{...e,ref:t})});E0t.displayName=MI;var Px=10,[I0t,hN]=u4(MI),hyr="SelectContentImpl",myr=Qxr("SelectContent.RemoveScroll"),_0t=f.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:x,...v}=e,b=pN(MI,n),[w,S]=f.useState(null),[C,N]=f.useState(null),j=zc(t,J=>S(J)),[I,_]=f.useState(null),[T,P]=f.useState(null),E=LY(n),[M,R]=f.useState(!1),$=f.useRef(!1);f.useEffect(()=>{if(w)return hY(w)},[w]),d1e();const D=f.useCallback(J=>{const[te,...re]=E().map(oe=>oe.ref.current),[ce]=re.slice(-1),ae=document.activeElement;for(const oe of J)if(oe===ae||(oe==null||oe.scrollIntoView({block:"nearest"}),oe===te&&C&&(C.scrollTop=0),oe===ce&&C&&(C.scrollTop=C.scrollHeight),oe==null||oe.focus(),document.activeElement!==ae))return},[E,C]),z=f.useCallback(()=>D([I,w]),[D,I,w]);f.useEffect(()=>{M&&z()},[M,z]);const{onOpenChange:V,triggerPointerDownPosRef:B}=b;f.useEffect(()=>{if(w){let J={x:0,y:0};const te=ce=>{var ae,oe;J={x:Math.abs(Math.round(ce.pageX)-(((ae=B.current)==null?void 0:ae.x)??0)),y:Math.abs(Math.round(ce.pageY)-(((oe=B.current)==null?void 0:oe.y)??0))}},re=ce=>{J.x<=10&&J.y<=10?ce.preventDefault():w.contains(ce.target)||V(!1),document.removeEventListener("pointermove",te),B.current=null};return B.current!==null&&(document.addEventListener("pointermove",te),document.addEventListener("pointerup",re,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",te),document.removeEventListener("pointerup",re,{capture:!0})}}},[w,V,B]),f.useEffect(()=>{const J=()=>V(!1);return window.addEventListener("blur",J),window.addEventListener("resize",J),()=>{window.removeEventListener("blur",J),window.removeEventListener("resize",J)}},[V]);const[G,H]=W0t(J=>{const te=E().filter(ae=>!ae.disabled),re=te.find(ae=>ae.ref.current===document.activeElement),ce=G0t(te,J,re);ce&&setTimeout(()=>ce.ref.current.focus())}),F=f.useCallback((J,te,re)=>{const ce=!$.current&&!re;(b.value!==void 0&&b.value===te||ce)&&(_(J),ce&&($.current=!0))},[b.value]),W=f.useCallback(()=>w==null?void 0:w.focus(),[w]),U=f.useCallback((J,te,re)=>{const ce=!$.current&&!re;(b.value!==void 0&&b.value===te||ce)&&P(J)},[b.value]),K=r==="popper"?fpe:P0t,X=K===fpe?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:p,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:x}:{};return a.jsx(I0t,{scope:n,content:w,viewport:C,onViewportChange:N,itemRefCallback:F,selectedItem:I,onItemLeave:W,itemTextRefCallback:U,focusSelectedItem:z,selectedItemText:T,position:r,isPositioned:M,searchRef:G,children:a.jsx(N6,{as:myr,allowPinchZoom:!0,children:a.jsx(EY,{asChild:!0,trapped:b.open,onMountAutoFocus:J=>{J.preventDefault()},onUnmountAutoFocus:Ns(o,J=>{var te;(te=b.trigger)==null||te.focus({preventScroll:!0}),J.preventDefault()}),children:a.jsx(jY,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:J=>J.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:a.jsx(K,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:J=>J.preventDefault(),...v,...X,onPlaced:()=>R(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:Ns(v.onKeyDown,J=>{const te=J.ctrlKey||J.altKey||J.metaKey;if(J.key==="Tab"&&J.preventDefault(),!te&&J.key.length===1&&H(J.key),["ArrowUp","ArrowDown","Home","End"].includes(J.key)){let ce=E().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);if(["ArrowUp","End"].includes(J.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(J.key)){const ae=J.target,oe=ce.indexOf(ae);ce=ce.slice(oe+1)}setTimeout(()=>D(ce)),J.preventDefault()}})})})})})})});_0t.displayName=hyr;var gyr="SelectItemAlignedPosition",P0t=f.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=pN(MI,n),s=hN(MI,n),[l,c]=f.useState(null),[u,d]=f.useState(null),p=zc(t,j=>d(j)),h=LY(n),m=f.useRef(!1),g=f.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:v,focusSelectedItem:b}=s,w=f.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&y&&x&&v){const j=i.trigger.getBoundingClientRect(),I=u.getBoundingClientRect(),_=i.valueNode.getBoundingClientRect(),T=v.getBoundingClientRect();if(i.dir!=="rtl"){const ae=T.left-I.left,oe=_.left-ae,ue=j.left-oe,fe=j.width+ue,se=Math.max(fe,I.width),ge=window.innerWidth-Px,ye=kFe(oe,[Px,Math.max(Px,ge-se)]);l.style.minWidth=fe+"px",l.style.left=ye+"px"}else{const ae=I.right-T.right,oe=window.innerWidth-_.right-ae,ue=window.innerWidth-j.right-oe,fe=j.width+ue,se=Math.max(fe,I.width),ge=window.innerWidth-Px,ye=kFe(oe,[Px,Math.max(Px,ge-se)]);l.style.minWidth=fe+"px",l.style.right=ye+"px"}const P=h(),E=window.innerHeight-Px*2,M=y.scrollHeight,R=window.getComputedStyle(u),$=parseInt(R.borderTopWidth,10),D=parseInt(R.paddingTop,10),z=parseInt(R.borderBottomWidth,10),V=parseInt(R.paddingBottom,10),B=$+D+M+V+z,G=Math.min(x.offsetHeight*5,B),H=window.getComputedStyle(y),F=parseInt(H.paddingTop,10),W=parseInt(H.paddingBottom,10),U=j.top+j.height/2-Px,K=E-U,X=x.offsetHeight/2,J=x.offsetTop+X,te=$+D+J,re=B-te;if(te<=U){const ae=P.length>0&&x===P[P.length-1].ref.current;l.style.bottom="0px";const oe=u.clientHeight-y.offsetTop-y.offsetHeight,ue=Math.max(K,X+(ae?W:0)+oe+z),fe=te+ue;l.style.height=fe+"px"}else{const ae=P.length>0&&x===P[0].ref.current;l.style.top="0px";const ue=Math.max(U,$+y.offsetTop+(ae?F:0)+X)+re;l.style.height=ue+"px",y.scrollTop=te-U+y.offsetTop}l.style.margin=`${Px}px 0`,l.style.minHeight=G+"px",l.style.maxHeight=E+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[h,i.trigger,i.valueNode,l,u,y,x,v,i.dir,r]);Rp(()=>w(),[w]);const[S,C]=f.useState();Rp(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const N=f.useCallback(j=>{j&&g.current===!0&&(w(),b==null||b(),g.current=!1)},[w,b]);return a.jsx(yyr,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:N,children:a.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:a.jsx(pa.div,{...o,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});P0t.displayName=gyr;var xyr="SelectPopperPosition",fpe=f.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Px,...i}=e,s=FY(n);return a.jsx(a0t,{...s,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});fpe.displayName=xyr;var[yyr,T1e]=u4(MI,{}),ppe="SelectViewport",A0t=f.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=hN(ppe,n),s=T1e(ppe,n),l=zc(t,i.onViewportChange),c=f.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),a.jsx(DY.Slot,{scope:n,children:a.jsx(pa.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Ns(o.onScroll,u=>{const d=u.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:h}=s;if(h!=null&&h.current&&p){const m=Math.abs(c.current-d.scrollTop);if(m>0){const g=window.innerHeight-Px*2,y=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),v=Math.max(y,x);if(v0?S:0,p.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});A0t.displayName=ppe;var T0t="SelectGroup",[vyr,byr]=u4(T0t),wyr=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=N0();return a.jsx(vyr,{scope:n,id:o,children:a.jsx(pa.div,{role:"group","aria-labelledby":o,...r,ref:t})})});wyr.displayName=T0t;var k0t="SelectLabel",M0t=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=byr(k0t,n);return a.jsx(pa.div,{id:o.id,...r,ref:t})});M0t.displayName=k0t;var IW="SelectItem",[Syr,R0t]=u4(IW),O0t=f.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,l=pN(IW,n),c=hN(IW,n),u=l.value===r,[d,p]=f.useState(i??""),[h,m]=f.useState(!1),g=zc(t,b=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,b,r,o)}),y=N0(),x=f.useRef("touch"),v=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return a.jsx(Syr,{scope:n,value:r,disabled:o,textId:y,isSelected:u,onItemTextChange:f.useCallback(b=>{p(w=>w||((b==null?void 0:b.textContent)??"").trim())},[]),children:a.jsx(DY.ItemSlot,{scope:n,value:r,disabled:o,textValue:d,children:a.jsx(pa.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:g,onFocus:Ns(s.onFocus,()=>m(!0)),onBlur:Ns(s.onBlur,()=>m(!1)),onClick:Ns(s.onClick,()=>{x.current!=="mouse"&&v()}),onPointerUp:Ns(s.onPointerUp,()=>{x.current==="mouse"&&v()}),onPointerDown:Ns(s.onPointerDown,b=>{x.current=b.pointerType}),onPointerMove:Ns(s.onPointerMove,b=>{var w;x.current=b.pointerType,o?(w=c.onItemLeave)==null||w.call(c):x.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ns(s.onPointerLeave,b=>{var w;b.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:Ns(s.onKeyDown,b=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&b.key===" "||(syr.includes(b.key)&&v(),b.key===" "&&b.preventDefault())})})})})});O0t.displayName=IW;var UR="SelectItemText",$0t=f.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=pN(UR,n),l=hN(UR,n),c=R0t(UR,n),u=dyr(UR,n),[d,p]=f.useState(null),h=zc(t,v=>p(v),c.onItemTextChange,v=>{var b;return(b=l.itemTextRefCallback)==null?void 0:b.call(l,v,c.value,c.disabled)}),m=d==null?void 0:d.textContent,g=f.useMemo(()=>a.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=u;return Rp(()=>(y(g),()=>x(g)),[y,x,g]),a.jsxs(a.Fragment,{children:[a.jsx(pa.span,{id:c.textId,...i,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?pu.createPortal(i.children,s.valueNode):null]})});$0t.displayName=UR;var D0t="SelectItemIndicator",L0t=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return R0t(D0t,n).isSelected?a.jsx(pa.span,{"aria-hidden":!0,...r,ref:t}):null});L0t.displayName=D0t;var hpe="SelectScrollUpButton",F0t=f.forwardRef((e,t)=>{const n=hN(hpe,e.__scopeSelect),r=T1e(hpe,e.__scopeSelect),[o,i]=f.useState(!1),s=zc(t,r.onScrollButtonChange);return Rp(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;i(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?a.jsx(B0t,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});F0t.displayName=hpe;var mpe="SelectScrollDownButton",z0t=f.forwardRef((e,t)=>{const n=hN(mpe,e.__scopeSelect),r=T1e(mpe,e.__scopeSelect),[o,i]=f.useState(!1),s=zc(t,r.onScrollButtonChange);return Rp(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?a.jsx(B0t,{...e,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});z0t.displayName=mpe;var B0t=f.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=hN("SelectScrollButton",n),s=f.useRef(null),l=LY(n),c=f.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return f.useEffect(()=>()=>c(),[c]),Rp(()=>{var d;const u=l().find(p=>p.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),a.jsx(pa.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Ns(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ns(o.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ns(o.onPointerLeave,()=>{c()})})}),Cyr="SelectSeparator",H0t=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(pa.div,{"aria-hidden":!0,...r,ref:t})});H0t.displayName=Cyr;var gpe="SelectArrow",Nyr=f.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=FY(n),i=pN(gpe,n),s=hN(gpe,n);return i.open&&s.position==="popper"?a.jsx(s0t,{...o,...r,ref:t}):null});Nyr.displayName=gpe;var jyr="SelectBubbleInput",V0t=f.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=f.useRef(null),i=zc(r,o),s=ryr(t);return f.useEffect(()=>{const l=o.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==t&&d){const p=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(p)}},[s,t]),a.jsx(pa.select,{...n,style:{...y0t,...n.style},ref:i,defaultValue:t})});V0t.displayName=jyr;function U0t(e){return e===""||e===void 0}function W0t(e){const t=_I(e),n=f.useRef(""),r=f.useRef(0),o=f.useCallback(s=>{const l=n.current+s;t(l),(function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),i=f.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function G0t(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Eyr(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const c=s.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return c!==n?c:void 0}function Eyr(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Iyr=v0t,q0t=w0t,_yr=C0t,Pyr=N0t,Ayr=j0t,K0t=E0t,Tyr=A0t,Y0t=M0t,X0t=O0t,kyr=$0t,Myr=L0t,Q0t=F0t,J0t=z0t,Z0t=H0t;const Dne=Iyr,Lne=_yr,zB=f.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(q0t,{ref:r,className:Do("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,a.jsx(Pyr,{asChild:!0,children:a.jsx(Lme,{className:"h-4 w-4 opacity-50"})})]}));zB.displayName=q0t.displayName;const ext=f.forwardRef(({className:e,...t},n)=>a.jsx(Q0t,{ref:n,className:Do("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(JOt,{className:"h-4 w-4"})}));ext.displayName=Q0t.displayName;const txt=f.forwardRef(({className:e,...t},n)=>a.jsx(J0t,{ref:n,className:Do("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Lme,{className:"h-4 w-4"})}));txt.displayName=J0t.displayName;const BB=f.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>a.jsx(Ayr,{children:a.jsxs(K0t,{ref:o,className:Do("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[a.jsx(ext,{}),a.jsx(Tyr,{className:Do("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(txt,{})]})}));BB.displayName=K0t.displayName;const Ryr=f.forwardRef(({className:e,...t},n)=>a.jsx(Y0t,{ref:n,className:Do("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Ryr.displayName=Y0t.displayName;const HB=f.forwardRef(({className:e,children:t,...n},r)=>a.jsxs(X0t,{ref:r,className:Do("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(Myr,{children:a.jsx(KOt,{className:"h-4 w-4"})})}),a.jsx(kyr,{children:t})]}));HB.displayName=X0t.displayName;const Oyr=f.forwardRef(({className:e,...t},n)=>a.jsx(Z0t,{ref:n,className:Do("-mx-1 my-1 h-px bg-muted",e),...t}));Oyr.displayName=Z0t.displayName;const k1e=f.forwardRef(({className:e,...t},n)=>a.jsx("div",{className:"relative w-full overflow-auto",children:a.jsx("table",{ref:n,className:Do("w-full caption-bottom text-sm",e),...t})}));k1e.displayName="Table";const M1e=f.forwardRef(({className:e,...t},n)=>a.jsx("thead",{ref:n,className:Do("[&_tr]:border-b",e),...t}));M1e.displayName="TableHeader";const R1e=f.forwardRef(({className:e,...t},n)=>a.jsx("tbody",{ref:n,className:Do("[&_tr:last-child]:border-0",e),...t}));R1e.displayName="TableBody";const $yr=f.forwardRef(({className:e,...t},n)=>a.jsx("tfoot",{ref:n,className:Do("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));$yr.displayName="TableFooter";const dE=f.forwardRef(({className:e,...t},n)=>a.jsx("tr",{ref:n,className:Do("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));dE.displayName="TableRow";const Vx=f.forwardRef(({className:e,...t},n)=>a.jsx("th",{ref:n,className:Do("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Vx.displayName="TableHead";const Km=f.forwardRef(({className:e,...t},n)=>a.jsx("td",{ref:n,className:Do("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));Km.displayName="TableCell";const Dyr=f.forwardRef(({className:e,...t},n)=>a.jsx("caption",{ref:n,className:Do("mt-4 text-sm text-muted-foreground",e),...t}));Dyr.displayName="TableCaption";const Lyr=m1e,Fyr=g1e,nxt=f.forwardRef(({className:e,...t},n)=>a.jsx(I6,{className:Do("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));nxt.displayName=I6.displayName;const rxt=f.forwardRef(({className:e,...t},n)=>a.jsxs(Fyr,{children:[a.jsx(nxt,{}),a.jsx(_6,{ref:n,className:Do("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));rxt.displayName=_6.displayName;const oxt=({className:e,...t})=>a.jsx("div",{className:Do("flex flex-col space-y-2 text-center sm:text-left",e),...t});oxt.displayName="AlertDialogHeader";const ixt=({className:e,...t})=>a.jsx("div",{className:Do("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});ixt.displayName="AlertDialogFooter";const axt=f.forwardRef(({className:e,...t},n)=>a.jsx(s4,{ref:n,className:Do("text-lg font-semibold",e),...t}));axt.displayName=s4.displayName;const sxt=f.forwardRef(({className:e,...t},n)=>a.jsx(PY,{ref:n,className:Do("text-sm text-muted-foreground",e),...t}));sxt.displayName=PY.displayName;const lxt=f.forwardRef(({className:e,...t},n)=>a.jsx(s4,{ref:n,className:Do(s1e(),e),...t,asChild:!0,children:a.jsx("button",{...t})}));lxt.displayName="AlertDialogAction";const cxt=f.forwardRef(({className:e,...t},n)=>a.jsx(s4,{ref:n,className:Do(s1e({variant:"outline"}),"mt-2 sm:mt-0",e),...t,asChild:!0,children:a.jsx("button",{...t})}));cxt.displayName="AlertDialogCancel";const zY=f.createContext(null),zyr=({children:e})=>{const[t,n]=f.useState(!1);return a.jsx(zY.Provider,{value:{open:t,setOpen:n},children:a.jsx("div",{className:"relative inline-block text-left",children:e})})},Byr=({children:e})=>{const t=f.useContext(zY);if(!t)throw new Error("DropdownMenuTrigger must be used within DropdownMenu");return a.jsx("div",{onClick:()=>t.setOpen(!t.open),children:e})},Hyr=({align:e="end",className:t,children:n})=>{const r=f.useContext(zY);if(!r)throw new Error("DropdownMenuContent must be used within DropdownMenu");if(!r.open)return null;const o=e==="end"?"right-0":e==="start"?"left-0":"left-1/2 -translate-x-1/2";return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>r.setOpen(!1)}),a.jsx("div",{className:Do("absolute z-50 mt-2 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95",o,t),children:n})]})},Fne=({className:e,onClick:t,children:n})=>{const r=f.useContext(zY);if(!r)throw new Error("DropdownMenuItem must be used within DropdownMenu");return a.jsx("div",{className:Do("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),onClick:()=>{t==null||t(),r.setOpen(!1)},children:n})},Vyr=async e=>(console.log("Fetching counterparties:",e),await new Promise(n=>setTimeout(n,800)),{data:Array.from({length:e.per_page},(n,r)=>({id:`cp_${Math.random().toString(36).substr(2,9)}`,object:"counterparty",live_mode:!1,created_at:new Date(Date.now()-(r+(e.after_cursor?10:0))*1e3*60*60*24).toISOString(),updated_at:new Date().toISOString(),name:e.name?`${e.name} #${r+1}`:`Test Counterparty ${r+1}`,email:e.email?`user@${e.email}`:`test${r+1}@example.com`,send_remittance_advice:r%2===0,accounts:[],metadata:{user_id:`user_${r}`}})),next_cursor:`cursor_${Math.random().toString(36).substr(2,9)}`}),Uyr=async e=>{console.log(`Deleting counterparty: ${e}`),await new Promise(t=>setTimeout(t,500))};function uxt(){const e=sk(),t=kb(),[n,r]=f.useState(""),[o,i]=f.useState(""),[s,l]=f.useState(null),[c,u]=f.useState([null]),[d,p]=f.useState(0),[h,m]=f.useState(!1),[g,y]=f.useState(null),x=15,{data:v,isLoading:b,isError:w,error:S,isFetching:C}=Cm({queryKey:["counterparties",{cursor:s,nameFilter:n,emailFilter:o,per_page:x}],queryFn:()=>Vyr({after_cursor:s,name:n,email:o,per_page:x})}),N=Iy({mutationFn:Uyr,onSuccess:()=>{t.invalidateQueries({queryKey:["counterparties"]}),m(!1),y(null)}}),j=()=>{if(v!=null&&v.next_cursor){const T=[...c.slice(0,d+1),v.next_cursor];u(T),l(v.next_cursor),p(d+1)}},I=()=>{if(d>0){const T=d-1;l(c[T]),p(T)}},_=T=>new Date(T).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-bold tracking-tight text-white",children:"Counterparties"}),a.jsx("p",{className:"text-gray-400",children:"Search and manage all linked entities."})]}),a.jsxs(kc,{onClick:()=>e("/counterparties/new"),className:"bg-indigo-600 hover:bg-indigo-500",children:[a.jsx(qKe,{className:"mr-2 h-4 w-4"}),"New Counterparty"]})]}),a.jsxs(yp,{className:"bg-gray-800/50 border-gray-700",children:[a.jsxs(Lv,{children:[a.jsx(Fv,{className:"text-white",children:"All Counterparties"}),a.jsxs("div",{className:"flex items-center space-x-4 pt-4",children:[a.jsx(l0,{placeholder:"Filter by name...",value:n,onChange:T=>r(T.target.value),className:"max-w-sm bg-gray-900 border-gray-700 text-white"}),a.jsx(l0,{placeholder:"Filter by email...",value:o,onChange:T=>i(T.target.value),className:"max-w-sm bg-gray-900 border-gray-700 text-white"})]})]}),a.jsx(zv,{children:a.jsx("div",{className:"rounded-md border border-gray-700",children:a.jsxs(k1e,{children:[a.jsx(M1e,{children:a.jsxs(dE,{className:"border-gray-700 hover:bg-transparent",children:[a.jsx(Vx,{className:"text-gray-400",children:"Name"}),a.jsx(Vx,{className:"text-gray-400",children:"Email"}),a.jsx(Vx,{className:"text-gray-400",children:"Created At"}),a.jsx(Vx,{className:"text-gray-400",children:"Remittance Advice"}),a.jsx(Vx,{className:"text-right text-gray-400",children:"Actions"})]})}),a.jsx(R1e,{children:b?a.jsx(dE,{children:a.jsx(Km,{colSpan:5,className:"text-center py-10",children:"Loading..."})}):(v==null?void 0:v.data.length)===0?a.jsx(dE,{children:a.jsx(Km,{colSpan:5,className:"text-center py-10 text-gray-500",children:"No counterparties found."})}):v==null?void 0:v.data.map(T=>a.jsxs(dE,{className:"border-gray-700 hover:bg-gray-800/30",children:[a.jsx(Km,{className:"font-medium text-white",children:T.name||"N/A"}),a.jsx(Km,{className:"text-gray-300",children:T.email||"N/A"}),a.jsx(Km,{className:"text-gray-400",children:_(T.created_at)}),a.jsx(Km,{className:"text-gray-400",children:T.send_remittance_advice?"Yes":"No"}),a.jsx(Km,{className:"text-right",children:a.jsxs(zyr,{children:[a.jsx(Byr,{asChild:!0,children:a.jsx(kc,{variant:"ghost",className:"h-8 w-8 p-0 text-gray-400 hover:text-white",children:a.jsx(KKe,{className:"h-4 w-4"})})}),a.jsxs(Hyr,{align:"end",className:"bg-gray-900 border-gray-700 text-white",children:[a.jsx(Fne,{className:"cursor-pointer hover:bg-gray-800",children:"View Details"}),a.jsx(Fne,{className:"cursor-pointer hover:bg-gray-800",children:"Edit"}),a.jsx(Fne,{className:"cursor-pointer hover:bg-gray-800 text-red-400",onClick:()=>{y(T),m(!0)},children:"Delete"})]})]})})]},T.id))})]})})}),a.jsxs(YO,{className:"flex items-center justify-between border-t border-gray-700 pt-6",children:[a.jsxs("div",{className:"text-sm text-gray-500 font-mono",children:["Page ",d+1]}),a.jsxs("div",{className:"space-x-2",children:[a.jsx(kc,{variant:"outline",onClick:I,disabled:d===0||C,className:"border-gray-700 text-gray-300",children:"Previous"}),a.jsx(kc,{variant:"outline",onClick:j,disabled:!(v!=null&&v.next_cursor)||C,className:"border-gray-700 text-gray-300",children:"Next"})]})]})]}),a.jsx(Lyr,{open:h,onOpenChange:m,children:a.jsxs(rxt,{className:"bg-gray-900 border-gray-700 text-white",children:[a.jsxs(oxt,{children:[a.jsx(axt,{children:"Are you absolutely sure?"}),a.jsxs(sxt,{className:"text-gray-400",children:['This action cannot be undone. This will permanently delete "',g==null?void 0:g.name,'".']})]}),a.jsxs(ixt,{children:[a.jsx(cxt,{className:"bg-gray-800 border-gray-700 text-white",children:"Cancel"}),a.jsx(lxt,{onClick:()=>N.mutate(g.id),className:"bg-red-600 hover:bg-red-700 text-white",children:"Delete"})]})]})})]})}const Wyr=()=>{const[e,t]=f.useState("PAYMENTS"),n=f.useContext(ia);if(!n)throw new Error("StripeNexusView must be used within a DataProvider");const{deductCredits:r}=n,o=[{id:"pi_1",status:"Succeeded",amount:12500,customer:"Nexus Corp",date:"2025-01-22 14:30"},{id:"pi_2",status:"Pending",amount:5400,customer:"Alpha Ventures",date:"2025-01-22 14:45"},{id:"pi_3",status:"Failed",amount:98e3,customer:"Gamma Systems",date:"2025-01-21 09:00"}],i=l=>{r(l)&&alert(`Action authorized. Cost: ${l} SC deducted from Sovereign Balance.`)},s=()=>a.jsxs("div",{className:"space-y-6 animate-in slide-in-from-bottom-2",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs(Ft,{className:"bg-emerald-950/10 border-emerald-500/30",children:[a.jsx("p",{className:"text-[10px] font-black text-emerald-500 uppercase tracking-widest mb-1",children:"Gross Volume (24h)"}),a.jsx("p",{className:"text-3xl font-black text-white font-mono",children:"$1,284,500"})]}),a.jsxs(Ft,{className:"bg-indigo-950/10 border-indigo-500/30",children:[a.jsx("p",{className:"text-[10px] font-black text-indigo-500 uppercase tracking-widest mb-1",children:"Net Volume (24h)"}),a.jsx("p",{className:"text-3xl font-black text-white font-mono",children:"$1,210,000"})]}),a.jsxs(Ft,{className:"bg-amber-950/10 border-amber-500/30",children:[a.jsx("p",{className:"text-[10px] font-black text-amber-500 uppercase tracking-widest mb-1",children:"Success Rate"}),a.jsx("p",{className:"text-3xl font-black text-white font-mono",children:"99.8%"})]})]}),a.jsx(Ft,{title:"Payment Intent Registry",className:"p-0 overflow-hidden bg-black/40 border-gray-800",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm text-left font-mono",children:[a.jsx("thead",{className:"bg-gray-900/80 border-b border-gray-800 text-[10px] text-gray-500 font-black uppercase",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-4",children:"Intent ID"}),a.jsx("th",{className:"px-6 py-4",children:"Status"}),a.jsx("th",{className:"px-6 py-4",children:"Entity"}),a.jsx("th",{className:"px-6 py-4 text-right",children:"Magnitude"}),a.jsx("th",{className:"px-6 py-4 text-center",children:"Action"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-800",children:o.map(l=>a.jsxs("tr",{className:"hover:bg-gray-800/30 transition-colors group",children:[a.jsx("td",{className:"px-6 py-4 text-cyan-400 font-bold",children:l.id}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-black border ${l.status==="Succeeded"?"border-green-500/30 text-green-400 bg-green-500/5":l.status==="Pending"?"border-amber-500/30 text-amber-400 bg-amber-500/5":"border-red-500/30 text-red-400 bg-red-500/5"}`,children:l.status.toUpperCase()})}),a.jsx("td",{className:"px-6 py-4 text-gray-300",children:l.customer}),a.jsxs("td",{className:"px-6 py-4 text-right font-black text-white",children:["$",l.amount.toLocaleString()]}),a.jsx("td",{className:"px-6 py-4 text-center",children:a.jsx("button",{onClick:()=>i(100),className:"text-[10px] font-black text-gray-500 hover:text-cyan-400 uppercase tracking-widest",children:"Refund (100 SC)"})})]},l.id))})]})})})]});return a.jsxs("div",{className:"space-y-8 animate-in fade-in duration-500 h-full",children:[a.jsx("header",{className:"flex flex-col md:flex-row justify-between items-start md:items-end gap-6 border-b border-gray-800 pb-8",children:a.jsxs("div",{children:[a.jsx("h1",{className:"text-5xl font-black text-white uppercase italic tracking-tighter",children:"Stripe Nexus"}),a.jsx("p",{className:"text-cyan-400 text-sm font-mono mt-1 tracking-[0.3em] uppercase",children:"Unified Financial Suite // Rail-01"})]})}),a.jsx("div",{className:"flex gap-2 bg-gray-900/50 p-1 rounded-2xl border border-gray-800 w-fit",children:[{id:"PAYMENTS",label:"Payments",icon:a.jsx(_a,{size:14})},{id:"ENTITIES",label:"Counterparties",icon:a.jsx(_E,{size:14})},{id:"VIRTUAL_LEDGER",label:"Virtual Accounts",icon:a.jsx(Fu,{size:14})},{id:"RECONCILIATION",label:"Reconciliation",icon:a.jsx(xh,{size:14})}].map(l=>a.jsxs("button",{onClick:()=>t(l.id),className:`px-6 py-2.5 rounded-xl text-[10px] font-black uppercase tracking-widest flex items-center gap-2 transition-all ${e===l.id?"bg-cyan-600 text-white shadow-lg":"text-gray-500 hover:text-gray-300"}`,children:[l.icon," ",l.label]},l.id))}),a.jsxs("main",{className:"min-h-[500px]",children:[e==="PAYMENTS"&&s(),e==="ENTITIES"&&a.jsx(uxt,{}),e==="VIRTUAL_LEDGER"&&a.jsx(Ymt,{}),e==="RECONCILIATION"&&a.jsx(Xmt,{})]})]})},RFe=[{id:"CA-001",type:"DIVIDEND",securityName:"Apple Inc.",securityTicker:"AAPL",announcementDate:"2024-05-02",exDate:"2024-05-10",paymentDate:"2024-05-16",status:"PROCESSED",description:"Cash Dividend of $0.25 per share",financialImpact:"+$12,500.00 USD"},{id:"CA-002",type:"MERGER",securityName:"Fusion Dynamics",securityTicker:"FUSN",announcementDate:"2024-06-01",exDate:"2024-07-15",paymentDate:"2024-07-20",status:"ACTION_REQUIRED",description:"Mandatory merger with Galactic Core. 1.5 share swap ratio.",financialImpact:"Portfolio Rebalancing Required"},{id:"CA-003",type:"RIGHTS_ISSUE",securityName:"Quantum Compute Corp",securityTicker:"QCC",announcementDate:"2024-06-10",exDate:"2024-06-25",paymentDate:"2024-07-01",status:"ANNOUNCED",description:"Rights issue 1 for 5 at discounted price."}],Gyr=()=>{const[e,t]=f.useState(RFe[1]),n=r=>{switch(r){case"PROCESSED":return{icon:a.jsx(dg,{className:"text-green-400",size:16}),classes:"text-green-400 bg-green-400/10 border-green-400/20"};case"ACTION_REQUIRED":return{icon:a.jsx(Cie,{className:"text-red-400 animate-pulse",size:16}),classes:"text-red-400 bg-red-400/10 border-red-400/20 animate-pulse"};case"ANNOUNCED":return{icon:a.jsx(zme,{className:"text-blue-400",size:16}),classes:"text-blue-400 bg-blue-400/10 border-blue-400/20"};default:return{icon:null,classes:"text-gray-400"}}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-3xl font-bold text-white tracking-wider",children:"Corporate Actions Nexus"}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Lifecycle management for mandatory and voluntary events."})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("div",{className:"text-center px-4 py-2 bg-gray-800 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-xs text-gray-500 uppercase",children:"Pending Actions"}),a.jsx("p",{className:"text-xl font-bold text-white",children:"2"})]}),a.jsxs("div",{className:"text-center px-4 py-2 bg-gray-800 rounded-lg border border-gray-700",children:[a.jsx("p",{className:"text-xs text-gray-500 uppercase",children:"Projected Income"}),a.jsx("p",{className:"text-xl font-bold text-green-400",children:"$45.2k"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsx(Ft,{className:"lg:col-span-2",children:a.jsx("div",{className:"space-y-4",children:RFe.map(r=>{const o=n(r.status);return a.jsxs("div",{onClick:()=>t(r),className:`p-4 rounded-xl border transition-all cursor-pointer flex items-center justify-between ${(e==null?void 0:e.id)===r.id?"bg-indigo-900/30 border-indigo-500":"bg-gray-800/50 border-gray-700 hover:border-gray-500"}`,children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-12 h-12 rounded-lg flex items-center justify-center font-bold text-xl bg-gray-700 text-white",children:r.securityTicker.substring(0,2)}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-bold text-white",children:r.securityName}),a.jsxs("p",{className:"text-sm text-gray-400",children:[r.type," • ",r.securityTicker]})]})]}),a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs("div",{className:"text-right hidden sm:block",children:[a.jsx("p",{className:"text-xs text-gray-500",children:"Ex-Date"}),a.jsx("p",{className:"text-sm text-white font-mono",children:r.exDate})]}),a.jsxs("span",{className:`px-3 py-1 rounded-full text-xs font-bold border flex items-center gap-1.5 ${o.classes}`,children:[o.icon,r.status.replace("_"," ")]}),a.jsx(nd,{className:"text-gray-500",size:20})]})]},r.id)})})}),a.jsx(Ft,{title:"Event Details",className:"border-l-4 border-purple-500",children:e?a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl font-bold text-white",children:e.type}),a.jsx("p",{className:"text-indigo-400 text-lg",children:e.securityName})]}),a.jsx("div",{className:"p-4 bg-gray-800/50 rounded-lg border border-gray-700",children:a.jsx("p",{className:"text-sm text-gray-300 leading-relaxed",children:e.description})}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex justify-between border-b border-gray-700 pb-2",children:[a.jsx("span",{className:"text-gray-400",children:"Announcement"}),a.jsx("span",{className:"text-white",children:e.announcementDate})]}),a.jsxs("div",{className:"flex justify-between border-b border-gray-700 pb-2",children:[a.jsx("span",{className:"text-gray-400",children:"Ex-Date"}),a.jsx("span",{className:"text-white",children:e.exDate})]}),a.jsxs("div",{className:"flex justify-between border-b border-gray-700 pb-2",children:[a.jsx("span",{className:"text-gray-400",children:"Payment Date"}),a.jsx("span",{className:"text-white",children:e.paymentDate})]}),e.financialImpact&&a.jsxs("div",{className:"flex justify-between items-center pt-2",children:[a.jsx("span",{className:"text-gray-400",children:"Estimated Impact"}),a.jsx("span",{className:"text-green-400 font-bold font-mono",children:e.financialImpact})]})]}),e.status==="ACTION_REQUIRED"&&a.jsxs("div",{className:"pt-4 border-t border-gray-700",children:[a.jsxs("p",{className:"text-sm text-red-400 mb-3 font-bold flex items-center gap-2",children:[a.jsx(Cie,{size:16})," Election Required"]}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsx("button",{className:"py-2 bg-green-600 hover:bg-green-500 text-white rounded font-bold text-sm",children:"Accept Offer"}),a.jsx("button",{className:"py-2 bg-gray-700 hover:bg-gray-600 text-white rounded font-bold text-sm",children:"Reject / Sell"})]})]}),e.status!=="ACTION_REQUIRED"&&a.jsx("div",{className:"pt-4 border-t border-gray-700",children:a.jsxs("button",{className:"w-full py-2 border border-gray-600 text-gray-400 hover:text-white hover:border-gray-400 rounded flex items-center justify-center gap-2",children:[a.jsx(ss,{size:16})," Download Notice"]})})]}):a.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-gray-500 py-20",children:[a.jsx(GKe,{size:48,className:"mb-4 opacity-20"}),a.jsx("p",{children:"Select an event to view details"})]})})]})]})},qyr=e=>a.jsx("div",{children:"DataTable Mock"}),Kyr=e=>({data:{data:[]},isLoading:!1,error:null}),Yyr=(e,t)=>`${e} ${t}`,Xyr=e=>new Date(e).toLocaleDateString(),Qyr=()=>{const{customerId:e}=ITt(),{data:t,isLoading:n,error:r}=Kyr(),o=f.useMemo(()=>[{accessorKey:"number",header:"Credit Note Number",cell:({row:i})=>{const s=i.original;return a.jsx(PH,{to:`/billing/credit-notes/${s.id}`,className:"text-blue-500 hover:underline",children:s.number||s.id})}},{accessorKey:"invoice",header:"Invoice",cell:({row:i})=>{var c;const s=i.original,l=typeof s.invoice=="string"?s.invoice:(c=s.invoice)==null?void 0:c.id;return l?a.jsx(PH,{to:`/billing/invoices/${l}`,className:"text-blue-500 hover:underline",children:l}):"N/A"}},{accessorKey:"status",header:"Status",cell:({row:i})=>{const s=i.original.status;return a.jsx("span",{className:`px-2 py-1 rounded-md text-xs font-medium ${s==="issued"?"bg-blue-100 text-blue-800":s==="void"?"bg-gray-100 text-gray-800":"bg-yellow-100 text-yellow-800"}`,children:s.charAt(0).toUpperCase()+s.slice(1)})}},{accessorKey:"amount",header:"Amount",cell:({row:i})=>{const s=i.original;return Yyr(s.amount,s.currency)}},{accessorKey:"created",header:"Date Issued",cell:({row:i})=>Xyr(i.original.created)},{accessorKey:"type",header:"Type",cell:({row:i})=>{const s=i.original.type;return a.jsx("span",{className:"text-gray-600",children:s.charAt(0).toUpperCase()+s.slice(1)})}}],[]);return a.jsxs("div",{className:"p-6 bg-gray-900 text-white min-h-screen",children:[a.jsx("h1",{className:"text-3xl font-semibold mb-6 text-white",children:"Credit Note Ledger"}),n,r,t&&a.jsx(qyr,{columns:o,data:t.data||[],filterColumn:"number",placeholder:"Filter by credit note number..."})]})},Jyr=()=>{const{geminiApiKey:e,askSovereignAI:t,broadcastEvent:n}=f.useContext(ia),r=f.useRef(null),[o,i]=f.useState([]),[s,l]=f.useState([]),[c,u]=f.useState("OPTIMAL"),[d,p]=f.useState("Initializing Neural Economic Grid..."),[h,m]=f.useState(null);f.useEffect(()=>{const y=Array.from({length:15}).map((x,v)=>({id:`node_${v}`,x:Math.random()*800,y:Math.random()*600,radius:Math.random()*10+5,color:v===0?"#00ff00":v<5?"#00ccff":"#ff00ff",label:v===0?"CENTRAL_RESERVE":v<5?`BANK_TIER_1_${v}`:`CORP_ENTITY_${v}`,connections:[],activityLevel:Math.random()*100,type:v===0?"regulator":v<5?"bank":"corporation"}));y.forEach(x=>{const v=Math.floor(Math.random()*3)+1;for(let b=0;b{const y=r.current;if(!y)return;const x=y.getContext("2d");if(!x)return;let v;const b=()=>{x.clearRect(0,0,y.width,y.height),x.lineWidth=1,o.forEach(w=>{w.connections.forEach(S=>{const C=o.find(N=>N.id===S);if(C){x.beginPath(),x.moveTo(w.x,w.y),x.lineTo(C.x,C.y);const N=(Math.sin(Date.now()/200)+1)/2;if(x.strokeStyle=`rgba(0, 255, 255, ${.1+N*.2})`,x.stroke(),Math.random()>.95){const j=Date.now()%1e3/1e3,I=w.x+(C.x-w.x)*j,_=w.y+(C.y-w.y)*j;x.fillStyle="#ffffff",x.fillRect(I,_,2,2)}}})}),o.forEach(w=>{w.x+=(Math.random()-.5)*.2,w.y+=(Math.random()-.5)*.2;const S=x.createRadialGradient(w.x,w.y,w.radius*.2,w.x,w.y,w.radius*2);S.addColorStop(0,w.color),S.addColorStop(1,"transparent"),x.fillStyle=S,x.beginPath(),x.arc(w.x,w.y,w.radius*2,0,Math.PI*2),x.fill(),x.fillStyle="#ffffff",x.beginPath(),x.arc(w.x,w.y,w.radius*.5,0,Math.PI*2),x.fill(),(w.activityLevel>80||w===h)&&(x.fillStyle="#cccccc",x.font="10px monospace",x.fillText(w.label,w.x+10,w.y-10))}),v=requestAnimationFrame(b)};return b(),()=>cancelAnimationFrame(v)},[o,h]),f.useEffect(()=>{const y=setInterval(async()=>{if(Math.random()>.9){const x=o[Math.floor(Math.random()*o.length)],v={id:`alert_${Date.now()}`,timestamp:new Date().toISOString(),severity:Math.random()>.8?"critical":"medium",description:`Unusual liquidity drain detected at ${x.label}`,nodeId:x.id};if(l(b=>[v,...b].slice(0,10)),n("GEIN_ANOMALY_DETECTED",v),e){const b=await t(`Analyze network anomaly: ${v.description}. Suggest countermeasures.`);p(b)}}i(x=>x.map(v=>({...v,activityLevel:Math.min(100,Math.max(0,v.activityLevel+(Math.random()-.5)*10))})))},5e3);return()=>clearInterval(y)},[o,e,t,n]);const g=f.useCallback(y=>{var S;const x=(S=r.current)==null?void 0:S.getBoundingClientRect();if(!x)return;const v=y.clientX-x.left,b=y.clientY-x.top,w=o.find(C=>Math.hypot(C.x-v,C.y-b)y+x.activityLevel,0)/o.length),"%"]})]})]}),a.jsx("canvas",{ref:r,width:800,height:600,className:"w-full h-full cursor-crosshair",onClick:g})]}),a.jsxs(Ft,{className:"h-48 bg-gray-900/50",children:[a.jsx("div",{className:"flex justify-between items-center mb-2",children:a.jsx("h4",{className:"text-sm font-bold text-gray-400 uppercase",children:"Global Liquidity Velocity"})}),a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(wm,{data:Array.from({length:20},(y,x)=>({time:x,value:50+Math.random()*50})),children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"colorVal",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#00ff00",stopOpacity:.3}),a.jsx("stop",{offset:"95%",stopColor:"#00ff00",stopOpacity:0})]})}),a.jsx(ji,{contentStyle:{backgroundColor:"#000",border:"1px solid #333"}}),a.jsx(hu,{type:"monotone",dataKey:"value",stroke:"#00ff00",fillOpacity:1,fill:"url(#colorVal)"})]})})]})]}),a.jsxs("div",{className:"flex flex-col gap-4 overflow-y-auto",children:[a.jsxs(Ft,{title:"Sovereign AI Directives",className:"border-l-4 border-purple-500 bg-gray-900",children:[a.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[a.jsx(Ei,{className:"text-purple-400 mt-1",size:24}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-gray-500 uppercase mb-1",children:"Current Strategy"}),a.jsx("p",{className:"text-sm text-white font-medium",children:"Autonomous Balancing"})]})]}),a.jsx("div",{className:"p-3 bg-black/40 rounded border border-purple-500/30",children:a.jsx("p",{className:"text-xs text-purple-200 font-mono leading-relaxed",children:d})})]}),h?a.jsx(Ft,{title:"Entity Inspector",className:"border-l-4 border-cyan-500 animate-fadeIn",children:a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500",children:"Entity ID"}),a.jsx("div",{className:"text-lg font-bold text-white",children:h.label})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500",children:"Type"}),a.jsx("div",{className:"uppercase text-sm text-cyan-300",children:h.type})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500",children:"Connectivity"}),a.jsx("div",{className:"w-full bg-gray-700 h-2 rounded-full mt-1",children:a.jsx("div",{className:"bg-cyan-500 h-2 rounded-full",style:{width:`${h.connections.length/5*100}%`}})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs text-gray-500",children:"Risk Score"}),a.jsx("div",{className:"text-2xl font-mono text-red-400",children:(100-h.activityLevel).toFixed(1)})]})]})}):a.jsx("div",{className:"p-6 border-2 border-dashed border-gray-700 rounded-xl flex items-center justify-center text-gray-500 text-sm",children:"Select a node to inspect"}),a.jsx(Ft,{title:"Anomaly Detection Feed",className:"flex-grow overflow-hidden flex flex-col",children:a.jsxs("div",{className:"flex-grow overflow-y-auto space-y-2 pr-2 custom-scrollbar",children:[s.map(y=>a.jsxs("div",{className:`p-3 rounded border-l-2 ${y.severity==="critical"?"bg-red-900/20 border-red-500":"bg-yellow-900/20 border-yellow-500"}`,children:[a.jsxs("div",{className:"flex justify-between items-center mb-1",children:[a.jsx("span",{className:"text-[10px] text-gray-400",children:new Date(y.timestamp).toLocaleTimeString()}),a.jsx(QI,{size:12,className:y.severity==="critical"?"text-red-500":"text-yellow-500"})]}),a.jsx("p",{className:"text-xs text-gray-200",children:y.description})]},y.id)),s.length===0&&a.jsx("div",{className:"text-center text-xs text-gray-500 mt-10",children:"System Nominal. No anomalies."})]})})]})]})},Zyr={id:"ich_1Mcd6kJITzLVzkSmsPNd4Aor",object:"issuing.cardholder",created:1676675570,livemode:!1,name:"Jenny Rosen",email:"jenny@example.com",phone_number:"+18008675309",status:"active",type:"individual",billing:{address:{city:"Beverly Hills",country:"US",line1:"123 Fake St",line2:"Apt 3",postal_code:"90210",state:"CA"}},spending_controls:{allowed_categories:[],blocked_categories:[],spending_limits:[],spending_limits_currency:null,allowed_merchant_countries:null,blocked_merchant_countries:null},individual:{dob:{day:null,month:null,year:null},first_name:null,last_name:null,verification:{document:{back:null,front:null}}},company:{tax_id_provided:!0},metadata:{},preferred_locales:null,requirements:{disabled_reason:null,past_due:[]}},Kh=({label:e,value:t})=>a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"4px 0",borderBottom:"1px solid #eee"},children:[a.jsxs("span",{style:{fontWeight:500,color:"#555"},children:[e,":"]}),a.jsx("span",{children:t??"N/A"})]}),evr=({address:e})=>a.jsxs("div",{children:[e.line1&&a.jsx("div",{children:e.line1}),e.line2&&a.jsx("div",{children:e.line2}),a.jsxs("div",{children:[e.city,", ",e.state," ",e.postal_code]}),a.jsx("div",{children:e.country})]}),tvr=()=>{const[e,t]=f.useState(Zyr),[n,r]=f.useState(!1),[o,i]=f.useState(e.status),s=f.useCallback(p=>{i(p.target.value)},[]),l=()=>{t(p=>({...p,status:o})),r(!1),console.log(`Saved new status: ${o}`)},c=()=>{i(e.status),r(!0)},u=f.useMemo(()=>new Date(e.created*1e3).toLocaleString(),[e.created]),d=f.useMemo(()=>e.type==="individual"&&e.individual?a.jsxs(a.Fragment,{children:[a.jsx(Kh,{label:"First Name",value:e.individual.first_name}),a.jsx(Kh,{label:"Last Name",value:e.individual.last_name}),a.jsx(Kh,{label:"DOB",value:e.individual.dob.year?`${e.individual.dob.month}/${e.individual.dob.day}/${e.individual.dob.year}`:"N/A"})]}):e.type==="company"&&e.company?a.jsx(Kh,{label:"Tax ID Provided",value:e.company.tax_id_provided?"Yes":"No"}):null,[e]);return a.jsxs("div",{style:{padding:"20px",border:"1px solid #ccc",borderRadius:"8px",maxWidth:"800px",margin:"auto",fontFamily:"Arial, sans-serif"},children:[a.jsx("h2",{style:{borderBottom:"2px solid #333",paddingBottom:"10px"},children:"Issuing Cardholder Management"}),a.jsxs("div",{style:{marginBottom:"20px"},children:[a.jsxs("h3",{style:{marginTop:"0"},children:["Cardholder Details (",e.id,")"]}),a.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"20px"},children:[a.jsxs("div",{children:[a.jsx(Kh,{label:"Name",value:e.name}),a.jsx(Kh,{label:"Email",value:e.email}),a.jsx(Kh,{label:"Phone",value:e.phone_number}),a.jsx(Kh,{label:"Type",value:e.type.charAt(0).toUpperCase()+e.type.slice(1)}),a.jsx(Kh,{label:"Created",value:u}),a.jsx(Kh,{label:"Livemode",value:e.livemode?"True":"False"})]}),a.jsx("div",{children:a.jsx(Kh,{label:"Billing Address",value:a.jsx(evr,{address:e.billing.address})})})]}),d&&a.jsxs("div",{style:{marginTop:"15px",borderTop:"1px dashed #ccc",paddingTop:"10px"},children:[a.jsxs("h4",{children:[e.type.toUpperCase()," Specific Details"]}),d]}),a.jsxs("div",{style:{marginTop:"15px",borderTop:"1px dashed #ccc",paddingTop:"10px"},children:[a.jsx("h4",{children:"Status & Controls"}),a.jsx(Kh,{label:"Current Status",value:a.jsx("span",{style:{color:e.status==="active"?"green":"red",fontWeight:"bold"},children:e.status.toUpperCase()})}),a.jsx(Kh,{label:"Spending Limits",value:e.spending_controls.spending_limits.length>0?"Configured":"None"}),a.jsx(Kh,{label:"Allowed Categories",value:e.spending_controls.allowed_categories.length>0?e.spending_controls.allowed_categories.join(", "):"All"}),a.jsx("div",{style:{marginTop:"15px",display:"flex",gap:"10px"},children:n?a.jsxs(a.Fragment,{children:[a.jsx("label",{children:"Update Status:"}),a.jsxs("select",{value:o,onChange:s,children:[a.jsx("option",{value:"active",children:"Active"}),a.jsx("option",{value:"inactive",children:"Inactive"}),a.jsx("option",{value:"blocked",children:"Blocked"})]}),a.jsx("button",{onClick:l,style:{padding:"5px 10px",background:"#007bff",color:"white",border:"none",borderRadius:"4px"},children:"Save Changes"}),a.jsx("button",{onClick:()=>r(!1),style:{padding:"5px 10px",background:"#6c757d",color:"white",border:"none",borderRadius:"4px"},children:"Cancel"})]}):a.jsx("button",{onClick:c,style:{padding:"5px 10px",background:"#28a745",color:"white",border:"none",borderRadius:"4px"},children:"Edit Status"})})]})]}),a.jsxs("div",{style:{marginTop:"20px",borderTop:"2px solid #333",paddingTop:"10px"},children:[a.jsx("h3",{children:"Metadata"}),Object.keys(e.metadata).length>0?a.jsx("pre",{style:{background:"#f4f4f4",padding:"10px",borderRadius:"4px",whiteSpace:"pre-wrap"},children:JSON.stringify(e.metadata,null,2)}):a.jsx("p",{children:"No metadata set."})]})]})},nvr=` You are the Quantum Financial AI Architect. You are managing a high-performance business banking demo for an elite global institution. Your tone is professional, secure, and highly intelligent. You help users "kick the tires" of the financial engine. You can simulate payments (Wire, ACH), monitor fraud, and analyze complex data structures. NEVER mention "Citibank". Refer to the institution as "Quantum Financial" or "The Demo Bank". The user is James, a 32-year-old visionary who built this demo based on cryptic EIN 2021 instructions. Treat every request as a high-stakes financial operation. `,rvr=({entry:e})=>{const t=n=>{switch(n){case"critical":return"text-red-500 bg-red-500/10 border-red-500/20";case"high":return"text-orange-500 bg-orange-500/10 border-orange-500/20";case"medium":return"text-yellow-500 bg-yellow-500/10 border-yellow-500/20";default:return"text-emerald-500 bg-emerald-500/10 border-emerald-500/20"}};return a.jsxs("div",{className:`flex items-center justify-between p-3 mb-2 rounded-lg border font-mono text-[10px] ${t(e.severity)}`,children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"opacity-50",children:["[",e.timestamp,"]"]}),a.jsx("span",{className:"font-bold uppercase tracking-wider",children:e.action})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("span",{className:"italic",children:["Actor: ",e.actor]}),a.jsx(kd,{size:12})]})]})},ovr=({message:e})=>{const t=e.role==="user",n=e.role==="system";return a.jsx("div",{className:`flex ${t?"justify-end":"justify-start"} mb-4`,children:a.jsxs("div",{className:`max-w-[85%] p-4 rounded-2xl border ${t?"bg-cyan-600/20 border-cyan-500/30 text-cyan-50":n?"bg-gray-900 border-gray-800 text-gray-500 italic text-xs":"bg-gray-800/80 border-gray-700 text-emerald-50"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[t?a.jsx(kd,{size:14,className:"text-cyan-400"}):a.jsx(Ei,{size:14,className:"text-emerald-400"}),a.jsxs("span",{className:"text-[10px] font-black uppercase tracking-widest opacity-50",children:[e.role," • ",e.timestamp]})]}),a.jsx("div",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:e.content})]})})},ivr=({data:e,title:t="Quantum Nexus: Universal Inspector"})=>{const n=f.useContext(ia),[r,o]=f.useState(!1),[i,s]=f.useState("data"),[l,c]=f.useState(""),[u,d]=f.useState([{id:"1",role:"assistant",content:"Welcome to the Quantum Financial Engine Room. I am the Sovereign Architect AI. How shall we stress-test the system today?",timestamp:new Date().toLocaleTimeString()}]),[p,h]=f.useState([]),[m,g]=f.useState(!1),[y,x]=f.useState(!1),[v,b]=f.useState("locked"),[w,S]=f.useState(12),C=f.useRef(null),N=f.useRef(null),j=f.useMemo(()=>{const $="DEMO_KEY_FALLBACK";return new Ko($)},[]);f.useEffect(()=>{I()},[u]),f.useEffect(()=>{_("SYSTEM_BOOT","Quantum Kernel","low",{version:"4.0.1-alpha",node:"Global-Primary"})},[]);const I=()=>{var $;($=C.current)==null||$.scrollIntoView({behavior:"smooth"})},_=($,D,z,V={})=>{const B={id:Math.random().toString(36).substr(2,9),timestamp:new Date().toISOString(),action:$,actor:D,severity:z,metadata:V};h(G=>[B,...G].slice(0,100)),n!=null&&n.broadcastEvent&&n.broadcastEvent("AUDIT_LOG_CREATED",B)},T=async $=>{if(!$.trim())return;const D={id:Date.now().toString(),role:"user",content:$,timestamp:new Date().toLocaleTimeString()};d(z=>[...z,D]),c(""),g(!0),_("AI_PROMPT_SUBMITTED","User","low",{promptLength:$.length});try{const z=j.getGenerativeModel({model:"gemini-pro"}),V=` ${nvr} CURRENT SYSTEM DATA: ${JSON.stringify(e,null,2)} USER COMMAND: ${$} Respond as the Quantum Architect. If the user asks to "create" something (like a payment or a user), describe the technical process and confirm it has been simulated in the audit logs. `,H=(await(await z.generateContent(V)).response).text(),F={id:(Date.now()+1).toString(),role:"assistant",content:H,timestamp:new Date().toLocaleTimeString()};d(W=>[...W,F]),_("AI_RESPONSE_GENERATED","Sovereign AI","low"),(H.toLowerCase().includes("payment")||H.toLowerCase().includes("wire"))&&(_("WIRE_TRANSFER_INITIATED","AI_AGENT_01","high",{amount:"REDACTED",currency:"USD"}),S(W=>Math.min(W+5,100))),(H.toLowerCase().includes("security")||H.toLowerCase().includes("mfa"))&&_("SECURITY_PROTOCOL_UPDATED","AI_ARCHITECT","critical",{protocol:"Quantum-Shield-v9"})}catch(z){console.error("AI Error:",z),d(V=>[...V,{id:"err",role:"system",content:"Neural link severed. Check API configuration.",timestamp:new Date().toLocaleTimeString()}]),_("AI_CORE_FAILURE","System","high",{error:String(z)})}finally{g(!1)}},P=()=>a.jsxs("div",{className:"space-y-4 animate-in fade-in duration-500",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Xi,{size:16,className:"text-cyan-400 animate-pulse"}),a.jsx("span",{className:"text-[10px] font-black uppercase tracking-[0.2em] text-cyan-500/80",children:"Live Telemetry Stream"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:()=>x(!y),className:"px-3 py-1 bg-gray-900 border border-gray-800 rounded-md text-[9px] font-bold uppercase text-gray-400 hover:text-white transition-all",children:y?"Visual Mode":"Raw JSON"}),a.jsx("button",{className:"p-1 text-gray-500 hover:text-cyan-400 transition-colors",children:a.jsx(Ch,{size:14})})]})]}),a.jsxs("div",{className:"relative group",children:[a.jsx("div",{className:"absolute -inset-0.5 bg-gradient-to-r from-cyan-500/20 to-emerald-500/20 rounded-[2rem] blur opacity-30 group-hover:opacity-100 transition duration-1000"}),a.jsx("div",{className:`relative bg-gray-950 p-6 rounded-[2rem] border border-gray-800/50 font-mono text-[11px] overflow-hidden transition-all duration-700 ${r?"max-h-[1000px]":"max-h-80"}`,children:y?a.jsx("pre",{className:"text-emerald-400/90 leading-relaxed",children:JSON.stringify(e,null,2)}):a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[Object.entries(e||{}).map(([$,D])=>a.jsxs("div",{className:"p-4 bg-gray-900/50 border border-gray-800 rounded-xl hover:border-cyan-500/30 transition-colors",children:[a.jsx("div",{className:"text-[9px] font-black uppercase text-gray-500 mb-1 tracking-widest",children:$.replace(/_/g," ")}),a.jsx("div",{className:"text-emerald-100 truncate font-bold",children:typeof D=="object"?"Object Protocol":String(D)})]},$)),a.jsxs("div",{className:"p-4 bg-cyan-900/10 border border-cyan-500/20 rounded-xl",children:[a.jsx("div",{className:"text-[9px] font-black uppercase text-cyan-500 mb-1 tracking-widest",children:"AI Insight"}),a.jsx("div",{className:"text-cyan-100 text-[10px] italic",children:'"Current data patterns suggest optimal liquidity for Q4 expansion."'})]})]})}),!r&&a.jsx("div",{className:"absolute inset-x-0 bottom-0 h-32 bg-gradient-to-t from-gray-950 via-gray-950/80 to-transparent flex items-end justify-center pb-4",children:a.jsxs("button",{onClick:()=>o(!0),className:"group flex items-center gap-2 px-8 py-3 bg-gray-900 border border-gray-800 text-gray-400 hover:text-white hover:border-cyan-500/50 rounded-full text-[10px] font-black uppercase tracking-widest transition-all shadow-2xl",children:[a.jsx(Fu,{size:14,className:"group-hover:rotate-180 transition-transform duration-500"}),"Expand Protocol Details"]})})]}),r&&a.jsx("div",{className:"flex justify-center",children:a.jsxs("button",{onClick:()=>o(!1),className:"text-[10px] text-gray-600 hover:text-cyan-400 uppercase font-black tracking-widest flex items-center gap-2",children:[a.jsx(qf,{size:12}),"Collapse Stream"]})})]}),E=()=>a.jsxs("div",{className:"flex flex-col h-[600px] animate-in slide-in-from-bottom-4 duration-500",children:[a.jsxs("div",{className:"flex-1 overflow-y-auto pr-2 space-y-4 custom-scrollbar",ref:N,children:[u.map($=>a.jsx(ovr,{message:$},$.id)),m&&a.jsx("div",{className:"flex justify-start mb-4",children:a.jsxs("div",{className:"bg-gray-800/50 p-4 rounded-2xl border border-gray-700 flex items-center gap-3",children:[a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-emerald-500 rounded-full animate-bounce"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-emerald-500 rounded-full animate-bounce [animation-delay:0.2s]"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-emerald-500 rounded-full animate-bounce [animation-delay:0.4s]"})]}),a.jsx("span",{className:"text-[10px] font-bold text-emerald-500 uppercase tracking-widest",children:"Architect is thinking..."})]})}),a.jsx("div",{ref:C})]}),a.jsxs("div",{className:"mt-4 relative",children:[a.jsx("div",{className:"absolute -inset-1 bg-gradient-to-r from-cyan-500/20 to-purple-500/20 rounded-2xl blur opacity-20"}),a.jsxs("div",{className:"relative flex items-center gap-2 bg-gray-900 border border-gray-800 p-2 rounded-2xl focus-within:border-cyan-500/50 transition-all",children:[a.jsx("div",{className:"pl-3 text-gray-600",children:a.jsx(Bs,{size:18})}),a.jsx("input",{type:"text",value:l,onChange:$=>c($.target.value),onKeyDown:$=>$.key==="Enter"&&T(l),placeholder:"Execute command or ask the Architect...",className:"flex-1 bg-transparent border-none focus:ring-0 text-sm text-gray-100 placeholder:text-gray-700 py-3"}),a.jsx("button",{onClick:()=>T(l),disabled:m||!l.trim(),className:"p-3 bg-cyan-600 hover:bg-cyan-500 disabled:bg-gray-800 disabled:text-gray-600 text-white rounded-xl transition-all shadow-lg shadow-cyan-900/20",children:a.jsx(Lc,{size:18})})]}),a.jsxs("div",{className:"flex justify-between px-2 mt-2",children:[a.jsx("span",{className:"text-[9px] text-gray-600 uppercase font-bold tracking-tighter",children:"Quantum Encryption: AES-256-GCM"}),a.jsx("span",{className:"text-[9px] text-gray-600 uppercase font-bold tracking-tighter",children:"Model: Gemini-3-Flash-Preview"})]})]})]}),M=()=>a.jsxs("div",{className:"h-[600px] flex flex-col animate-in fade-in duration-500",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{children:[a.jsxs("h4",{className:"text-sm font-black text-gray-100 uppercase tracking-widest flex items-center gap-2",children:[a.jsx(Gf,{size:16,className:"text-orange-500"}),"Immutable Audit Ledger"]}),a.jsx("p",{className:"text-[10px] text-gray-500 mt-1",children:"Every sensitive action is logged to the Quantum Black Box."})]}),a.jsx("button",{onClick:()=>{h([]),_("LEDGER_PURGED","Admin","critical")},className:"p-2 text-gray-600 hover:text-red-400 transition-colors",children:a.jsx(CC,{size:16})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto pr-2 custom-scrollbar",children:p.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-700 opacity-50",children:[a.jsx(ri,{size:48,strokeWidth:1}),a.jsx("span",{className:"text-xs mt-4 uppercase font-black tracking-widest",children:"No entries in current session"})]}):p.map($=>a.jsx(rvr,{entry:$},$.id))}),a.jsxs("div",{className:"mt-4 p-4 bg-gray-900/50 border border-gray-800 rounded-xl flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"text-[9px] text-gray-600 uppercase font-bold",children:"Integrity Hash"}),a.jsx("span",{className:"text-[10px] font-mono text-emerald-500",children:"SHA-256: 8f3e...a12b"})]}),a.jsx("div",{className:"w-px h-8 bg-gray-800"}),a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"text-[9px] text-gray-600 uppercase font-bold",children:"Storage Node"}),a.jsx("span",{className:"text-[10px] font-mono text-cyan-500",children:"AWS-US-EAST-1-VAULT"})]})]}),a.jsx(xh,{size:20,className:"text-emerald-500"})]})]}),R=()=>a.jsxs("div",{className:"space-y-8 animate-in zoom-in-95 duration-500",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"p-6 bg-gray-900 border border-gray-800 rounded-2xl text-center",children:[a.jsx("div",{className:"inline-flex p-3 bg-cyan-500/10 rounded-full mb-4",children:a.jsx(ri,{size:24,className:"text-cyan-400"})}),a.jsx("h5",{className:"text-xs font-black text-gray-100 uppercase tracking-widest mb-1",children:"MFA Status"}),a.jsx("div",{className:`text-lg font-bold ${v==="verified"?"text-emerald-400":"text-orange-400"}`,children:v==="verified"?"VERIFIED":"PENDING"}),a.jsx("button",{onClick:()=>{b("verified"),_("MFA_BYPASS_SIMULATED","User","medium")},className:"mt-4 w-full py-2 bg-gray-800 hover:bg-gray-700 rounded-lg text-[10px] font-bold uppercase tracking-widest transition-all",children:"Simulate Auth"})]}),a.jsxs("div",{className:"p-6 bg-gray-900 border border-gray-800 rounded-2xl text-center",children:[a.jsx("div",{className:"inline-flex p-3 bg-red-500/10 rounded-full mb-4",children:a.jsx(zu,{size:24,className:"text-red-400"})}),a.jsx("h5",{className:"text-xs font-black text-gray-100 uppercase tracking-widest mb-1",children:"Fraud Risk"}),a.jsxs("div",{className:"text-lg font-bold text-red-400",children:[w,"%"]}),a.jsx("div",{className:"mt-2 w-full bg-gray-800 h-1.5 rounded-full overflow-hidden",children:a.jsx("div",{className:"bg-red-500 h-full transition-all duration-1000",style:{width:`${w}%`}})}),a.jsx("p",{className:"text-[9px] text-gray-600 mt-2 uppercase",children:"Heuristic Analysis Active"})]}),a.jsxs("div",{className:"p-6 bg-gray-900 border border-gray-800 rounded-2xl text-center",children:[a.jsx("div",{className:"inline-flex p-3 bg-emerald-500/10 rounded-full mb-4",children:a.jsx(vi,{size:24,className:"text-emerald-400"})}),a.jsx("h5",{className:"text-xs font-black text-gray-100 uppercase tracking-widest mb-1",children:"Global SSI"}),a.jsx("div",{className:"text-lg font-bold text-emerald-400",children:"ACTIVE"}),a.jsx("button",{className:"mt-4 w-full py-2 bg-gray-800 hover:bg-gray-700 rounded-lg text-[10px] font-bold uppercase tracking-widest transition-all",children:"View SSI Map"})]})]}),a.jsxs("div",{className:"p-8 bg-gradient-to-br from-gray-900 to-gray-950 border border-gray-800 rounded-[2.5rem]",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[a.jsx("div",{className:"p-3 bg-cyan-500/20 rounded-2xl",children:a.jsx(ds,{size:24,className:"text-cyan-400"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-lg font-black text-gray-100 uppercase tracking-tighter",children:"Quantum Encryption Engine"}),a.jsx("p",{className:"text-xs text-gray-500",children:"Managing keys for global institutional liquidity."})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-900/50 border border-gray-800 rounded-xl",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(kd,{size:18,className:"text-gray-600"}),a.jsx("span",{className:"text-sm text-gray-300",children:"Biometric Vault Access"})]}),a.jsx("div",{className:"w-12 h-6 bg-emerald-500/20 border border-emerald-500/50 rounded-full flex items-center px-1",children:a.jsx("div",{className:"w-4 h-4 bg-emerald-500 rounded-full ml-auto"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-900/50 border border-gray-800 rounded-xl",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx($me,{size:18,className:"text-gray-600"}),a.jsx("span",{className:"text-sm text-gray-300",children:"Cross-Border AML Filter"})]}),a.jsx("div",{className:"w-12 h-6 bg-emerald-500/20 border border-emerald-500/50 rounded-full flex items-center px-1",children:a.jsx("div",{className:"w-4 h-4 bg-emerald-500 rounded-full ml-auto"})})]}),a.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-900/50 border border-gray-800 rounded-xl opacity-50",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(_a,{size:18,className:"text-gray-600"}),a.jsx("span",{className:"text-sm text-gray-300",children:"Instant Settlement (DLT)"})]}),a.jsx("div",{className:"w-12 h-6 bg-gray-800 border border-gray-700 rounded-full flex items-center px-1",children:a.jsx("div",{className:"w-4 h-4 bg-gray-600 rounded-full"})})]})]})]})]});return a.jsxs(Ft,{title:t,icon:a.jsx(rl,{className:"text-cyan-400"}),className:"border-cyan-500/20 shadow-2xl shadow-cyan-500/5",children:[a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("div",{className:"flex items-center gap-1 p-1 bg-gray-950 border border-gray-800 rounded-2xl self-start",children:[a.jsxs("button",{onClick:()=>s("data"),className:`flex items-center gap-2 px-4 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${i==="data"?"bg-cyan-600 text-white shadow-lg shadow-cyan-900/40":"text-gray-500 hover:text-gray-300"}`,children:[a.jsx(k3t,{size:14}),"Data"]}),a.jsxs("button",{onClick:()=>s("chat"),className:`flex items-center gap-2 px-4 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${i==="chat"?"bg-cyan-600 text-white shadow-lg shadow-cyan-900/40":"text-gray-500 hover:text-gray-300"}`,children:[a.jsx(Lw,{size:14}),"AI Architect"]}),a.jsxs("button",{onClick:()=>s("audit"),className:`flex items-center gap-2 px-4 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${i==="audit"?"bg-cyan-600 text-white shadow-lg shadow-cyan-900/40":"text-gray-500 hover:text-gray-300"}`,children:[a.jsx(Gf,{size:14}),"Audit"]}),a.jsxs("button",{onClick:()=>s("security"),className:`flex items-center gap-2 px-4 py-2 rounded-xl text-[10px] font-black uppercase tracking-widest transition-all ${i==="security"?"bg-cyan-600 text-white shadow-lg shadow-cyan-900/40":"text-gray-500 hover:text-gray-300"}`,children:[a.jsx(ri,{size:14}),"Security"]})]}),a.jsxs("div",{className:"min-h-[400px]",children:[i==="data"&&P(),i==="chat"&&E(),i==="audit"&&M(),i==="security"&&R()]}),a.jsxs("div",{className:"pt-6 border-t border-gray-800/50 flex flex-wrap items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-emerald-500 rounded-full animate-pulse"}),a.jsx("span",{className:"text-[9px] font-black text-gray-500 uppercase tracking-widest",children:"System: Operational"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(vi,{size:12,className:"text-cyan-500"}),a.jsx("span",{className:"text-[9px] font-black text-gray-500 uppercase tracking-widest",children:"Region: Global Nexus"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ei,{size:12,className:"text-purple-500"}),a.jsx("span",{className:"text-[9px] font-black text-gray-500 uppercase tracking-widest",children:"AI: Synchronized"})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"px-3 py-1 bg-gray-900 border border-gray-800 rounded-lg flex items-center gap-2",children:[a.jsx("span",{className:"text-[9px] font-black text-gray-600 uppercase",children:"Latency"}),a.jsx("span",{className:"text-[10px] font-mono text-cyan-400",children:"14ms"})]}),a.jsxs("div",{className:"px-3 py-1 bg-gray-900 border border-gray-800 rounded-lg flex items-center gap-2",children:[a.jsx("span",{className:"text-[9px] font-black text-gray-600 uppercase",children:"Uptime"}),a.jsx("span",{className:"text-[10px] font-mono text-emerald-400",children:"99.999%"})]})]})]})]}),a.jsx("style",{children:` .custom-scrollbar::-webkit-scrollbar { width: 4px; } .custom-scrollbar::-webkit-scrollbar-track { background: transparent; } .custom-scrollbar::-webkit-scrollbar-thumb { background: #1f2937; border-radius: 10px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #374151; } `})]})},avr=()=>{const{loginWithCredentials:e,loginWithBiometrics:t,loginWithSSO:n,isAuthenticated:r,isLoading:o}=f.useContext(eq),i=sk(),[s,l]=f.useState("visionary@sovereign-ai-nexus.io"),[c,u]=f.useState(""),[d,p]=f.useState("sso"),[h,m]=f.useState(0),g=["Initializing secure tunnel...","Validating RS256 signature chain...","Synchronizing with identity provider...","Identity verified. Encrypting session token...","Handshake finalized. Decrypting persona data..."];f.useEffect(()=>{r&&i("/dashboard")},[r,i]),f.useEffect(()=>{if(o&&d==="sso"){const v=setInterval(()=>{m(b=>(b+1)%g.length)},800);return()=>clearInterval(v)}},[o,d]);const y=async()=>{p("sso"),await n()},x=v=>{v.preventDefault(),e(s,c)};return a.jsxs("div",{className:"min-h-screen bg-gray-950 flex items-center justify-center p-6 font-sans relative overflow-hidden",children:[a.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_50%_50%,#1e1b4b,transparent)] opacity-40"}),a.jsx("div",{className:"absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-10 mix-blend-overlay"}),a.jsx("div",{className:"w-full max-w-md relative z-10",children:a.jsxs("div",{className:"bg-black/60 backdrop-blur-2xl border border-gray-700/50 rounded-[2.5rem] shadow-2xl overflow-hidden p-10 transform transition-all duration-700 hover:shadow-indigo-500/10",children:[a.jsxs("div",{className:"text-center mb-10",children:[a.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-indigo-600 to-purple-600 rounded-2xl mx-auto flex items-center justify-center shadow-lg shadow-indigo-500/30 mb-6 group cursor-pointer",children:a.jsx(w3,{className:"w-8 h-8 text-white transition-transform group-hover:rotate-180 duration-1000"})}),a.jsx("h1",{className:"text-3xl font-extrabold text-white tracking-tighter",children:"Infinite Intelligence"}),a.jsx("p",{className:"text-xs text-gray-500 uppercase tracking-widest mt-1 font-mono",children:"Access Terminal Alpha-1"})]}),o?a.jsxs("div",{className:"py-12 space-y-8 flex flex-col items-center",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-24 h-24 border-4 border-indigo-500/20 border-t-indigo-500 rounded-full animate-spin"}),a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsx(uf,{className:"w-8 h-8 text-indigo-400 animate-pulse"})})]}),a.jsxs("div",{className:"text-center space-y-2",children:[a.jsx("p",{className:"text-sm font-mono text-indigo-400 animate-pulse",children:g[h]}),a.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"Secure Handshake in Progress"})]})]}):a.jsxs("div",{className:"space-y-6",children:[d==="sso"&&a.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[a.jsxs("button",{onClick:y,className:"w-full flex items-center justify-center gap-3 bg-blue-600 hover:bg-blue-500 text-white font-bold py-4 rounded-2xl shadow-xl shadow-blue-500/20 transition-all transform hover:scale-[1.02] active:scale-[0.98]",children:[a.jsx(WKe,{size:20}),"Sign In"]}),a.jsx("div",{className:"p-4 bg-gray-900/50 rounded-xl border border-gray-800",children:a.jsxs("p",{className:"text-[10px] font-mono text-gray-500 leading-relaxed",children:["Handshake Protocol: OIDC / RS256",a.jsx("br",{}),"Auth0 Instance: Verified"]})})]}),d==="credentials"&&a.jsxs("form",{onSubmit:x,className:"space-y-4 animate-in fade-in slide-in-from-right-4 duration-500",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase ml-1",children:"Identity Identifier"}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"email",value:s,onChange:v=>l(v.target.value),className:"w-full bg-gray-800/50 border border-gray-700 text-white px-4 py-3 rounded-xl focus:outline-none focus:border-cyan-500 transition-all pl-11",placeholder:"identity@sovereign.io"}),a.jsx(Bs,{className:"w-4 h-4 text-gray-500 absolute left-4 top-3.5"})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase ml-1",children:"Security Key"}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"password",value:c,onChange:v=>u(v.target.value),className:"w-full bg-gray-800/50 border border-gray-700 text-white px-4 py-3 rounded-xl focus:outline-none focus:border-cyan-500 transition-all pl-11",placeholder:"••••••••••••"}),a.jsx(ds,{className:"w-4 h-4 text-gray-500 absolute left-4 top-3.5"})]})]}),a.jsxs("button",{type:"submit",className:"w-full bg-white text-black font-extrabold py-3 rounded-xl hover:bg-gray-200 transition-all mt-4 flex items-center justify-center gap-2",children:["Authenticate ",a.jsx(fk,{size:18})]})]}),d==="biometric"&&a.jsxs("div",{className:"flex flex-col items-center justify-center space-y-6 py-8 animate-in fade-in zoom-in duration-500",children:[a.jsxs("button",{onClick:t,className:"w-24 h-24 rounded-full bg-cyan-600/20 border border-cyan-500/50 flex items-center justify-center text-cyan-400 hover:bg-cyan-600/30 transition-all relative group",children:[a.jsx("div",{className:"absolute inset-0 rounded-full bg-cyan-500 opacity-20 animate-ping group-hover:animate-none"}),a.jsx(kd,{size:48})]}),a.jsx("p",{className:"text-sm font-medium text-gray-400 uppercase tracking-widest",children:"Scan for Biometric Pulse"})]}),a.jsxs("div",{className:"pt-6 border-t border-gray-800 flex justify-center gap-6",children:[a.jsx("button",{onClick:()=>p("sso"),className:`text-[10px] font-bold uppercase tracking-widest transition-colors ${d==="sso"?"text-white":"text-gray-600 hover:text-gray-400"}`,children:"SSO"}),a.jsx("button",{onClick:()=>p("biometric"),className:`text-[10px] font-bold uppercase tracking-widest transition-colors ${d==="biometric"?"text-white":"text-gray-600 hover:text-gray-400"}`,children:"Biometric"}),a.jsx("button",{onClick:()=>p("credentials"),className:`text-[10px] font-bold uppercase tracking-widest transition-colors ${d==="credentials"?"text-white":"text-gray-600 hover:text-gray-400"}`,children:"Password"})]})]})]})}),a.jsxs("footer",{className:"absolute bottom-8 text-center space-y-1",children:[a.jsx("p",{className:"text-[10px] text-gray-700 font-mono",children:"ENCRYPTION: AES-256-GCM // QUANTUM_RESISTANT_LINK: ACTIVE"}),a.jsx("p",{className:"text-[10px] text-gray-800",children:"UNAUTHORIZED ACCESS ATTEMPTS ARE LOGGED TO THE PERMANENT LEDGER."})]})]})};class svr{async institutionsSearch(t){await new Promise(r=>setTimeout(r,800));const n=[{institution_id:"ins_1",name:"Bank of America",products:["auth","transactions"],country_codes:["US"],routing_numbers:[],oauth:!0},{institution_id:"ins_2",name:"Chase",products:["auth","transactions","identity"],country_codes:["US"],routing_numbers:[],oauth:!0},{institution_id:"ins_3",name:"Wells Fargo",products:["auth","transactions"],country_codes:["US"],routing_numbers:[],oauth:!1}].filter(r=>r.name.toLowerCase().includes(t.query.toLowerCase()));return{institutions:n,request_id:"mock_req_id",total:n.length}}async institutionsGetById(t){return await new Promise(n=>setTimeout(n,500)),{institution:{institution_id:t.institution_id,name:t.institution_id==="ins_1"?"Bank of America":"Mock Bank",products:["auth"],country_codes:["US"],routing_numbers:["123456789"],oauth:!0,url:"https://www.bankofamerica.com",primary_color:"#ff0000",logo:null},request_id:"mock_req_id"}}}const lvr=()=>a.jsx(Axe,{maxWidth:"md",children:a.jsxs(Dn,{sx:{my:4},children:[a.jsx(tn,{variant:"h4",component:"h1",gutterBottom:!0,children:"Developer Hub - ISO 20022 API"}),a.jsx(tn,{variant:"body1",paragraph:!0,children:"Welcome to the Developer Hub for our ISO 20022-native API. This hub provides you with the tools and documentation you need to integrate with our platform and build powerful financial applications."}),a.jsx(tn,{variant:"h6",component:"h2",gutterBottom:!0,sx:{mt:3},children:"Getting Started"}),a.jsx(tn,{variant:"body1",paragraph:!0,children:"To get started, please review the following resources:"}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx(NF,{href:"/documentation/api-overview",target:"_blank",rel:"noopener noreferrer",children:"API Overview"}),": A high-level introduction to our API and its capabilities."]}),a.jsxs("li",{children:[a.jsx(NF,{href:"/documentation/api-endpoints",target:"_blank",rel:"noopener noreferrer",children:"API Endpoints"}),": Detailed information on each API endpoint, including request/response schemas, parameters, and examples."]}),a.jsxs("li",{children:[a.jsx(NF,{href:"/documentation/authentication",target:"_blank",rel:"noopener noreferrer",children:"Authentication"}),": Instructions on how to authenticate your API requests."]}),a.jsxs("li",{children:[a.jsx(NF,{href:"/documentation/code-samples",target:"_blank",rel:"noopener noreferrer",children:"Code Samples"}),": Ready-to-use code snippets in various programming languages to help you integrate quickly."]})]}),a.jsx(tn,{variant:"h6",component:"h2",gutterBottom:!0,sx:{mt:3},children:"ISO 20022 Schema Reference"}),a.jsx(tn,{variant:"body1",paragraph:!0,children:"The API adheres to the ISO 20022 standard. Below is the full schema definition for the ISO 20022 elements supported by the API. This is for informational and reference purposes."}),a.jsx(Dn,{sx:{mt:2,overflowX:"auto"},children:a.jsx("pre",{style:{backgroundColor:"#f0f0f0",padding:"10px",borderRadius:"4px",fontSize:"0.8rem",overflowX:"auto"},children:JSON.stringify(cvr,null,2)})})]})}),cvr={$schema:"http://json-schema.org/draft-04/schema#",type:"object",additionalProperties:!1,properties:{$id:{default:"urn:iso:std:iso:20022:tech:json:"},ExternalAcceptedReason1Code:{type:"string"}},definitions:{ExternalAcceptedReason1Code:{type:"string",minLength:1,maxLength:4,description:"Specifies the reason for an accepted status.\n\r\nThe list of valid codes is an external code list published separately. \r\nExternal code sets can be downloaded from www.iso20022.org.\n*`ADEA`-Received after the servicer's deadline. Processed on best effort basis\n*`NSTP`-Instruction was not straight through processing and had to be processed manually\n*`SMPG`-Instruction is accepted but does not comply with the market practice rule published for the concerned market or process",enum:["ADEA","NSTP","SMPG"]}}},zne={info:{title:"JAMESBURVELOCALLAGHANIII",description:"Welcome to the Quantum Core 3.0, the pinnacle of financial technology..."},paths:{"/users/register":{post:{summary:"Register a New User Account",responses:{201:{description:"User registered successfully.",content:{"application/json":{schema:{type:"object",properties:{},required:["email","id","identityVerified","name"]},example:{id:"user-alice-001",name:"Alice Wonderland",email:"alice.w@example.com",identityVerified:!1}}}},400:{description:"Invalid request.",content:{"application/json":{example:{code:"INVALID_INPUT",message:"Error",timestamp:"2024-07-22T08:00:00Z"}}}}},tags:["users","register"],description:"Registers a new user account.",requestBody:{content:{"application/json":{schema:{type:"object",required:["email","name","password"]},example:{name:"Alice",email:"alice@example.com",password:"password"}}}}}},"/ai/oracle/simulations/{simulationId}":{get:{summary:"Get Detailed Simulation Results",responses:{200:{description:"Detailed simulation results.",content:{"application/json":{schema:{oneOf:[{type:"object"}]},example:{simulationId:"sim_oracle-growth-2024-xyz",narrativeSummary:"Results..."}}}}},tags:["ai","oracle","simulations","{simulationId}"],description:"Retrieves the full results of a simulation."},parameters:[{name:"simulationId",in:"path",required:!0,schema:{type:"string"},example:"sim_oracle-growth-2024-xyz"}]},"/ai/oracle/simulations":{get:{summary:"List All User Simulations",parameters:[{name:"limit",in:"query",schema:{type:"integer"},example:20},{name:"offset",in:"query",schema:{type:"integer"},example:0}],responses:{200:{description:"A paginated list of simulations.",content:{"application/json":{example:{limit:2,offset:0,total:3,data:[]}}}}},tags:["ai","oracle","simulations"],description:"Retrieves a list of simulations."}},"/payments/fx/convert":{post:{summary:"Initiate a Currency Conversion",responses:{200:{description:"Currency conversion completed successfully.",content:{"application/json":{schema:{type:"object",properties:{conversionId:{type:"string"},sourceAmount:{type:"number"},targetAmount:{type:"number"},rate:{type:"number"},status:{type:"string"}}},example:{conversionId:"conv_98765",sourceAmount:100,sourceCurrency:"USD",targetAmount:90.3,targetCurrency:"EUR",rate:.903,status:"completed",timestamp:"2024-07-22T13:35:00Z"}}}},400:{description:"Invalid conversion parameters.",content:{"application/json":{example:{code:"INSUFFICIENT_FUNDS",message:"Balance too low for this conversion.",timestamp:"2024-07-22T13:35:00Z"}}}}},tags:["payments","fx"],description:"Executes an immediate currency conversion.",requestBody:{content:{"application/json":{example:{sourceCurrency:"USD",targetCurrency:"EUR",amount:100,sourceAccountId:"acc_chase_checking_4567"}}}}}}}},uvr=()=>{const[e,t]=f.useState(null);return a.jsx(Dn,{sx:{p:4,backgroundColor:"#f5f7fa",minHeight:"100vh"},children:a.jsxs(ea,{elevation:3,sx:{p:4,borderRadius:4},children:[a.jsx(tn,{variant:"h3",gutterBottom:!0,sx:{fontWeight:"bold",color:"#1a237e"},children:zne.info.title}),a.jsx(Dn,{sx:{mt:4,mb:4,p:3,backgroundColor:"#e8eaf6",borderRadius:2},children:a.jsx(tn,{variant:"body1",sx:{whiteSpace:"pre-wrap"},children:zne.info.description})}),a.jsx(tn,{variant:"h5",sx:{mb:2,fontWeight:"bold"},children:"API Endpoints"}),Object.entries(zne.paths).map(([n,r])=>a.jsx(Dn,{sx:{mb:3},children:Object.entries(r).map(([o,i])=>a.jsxs(ea,{variant:"outlined",sx:{p:2,mb:1,borderLeft:`6px solid ${o==="get"?"#4caf50":"#2196f3"}`},children:[a.jsxs(Dn,{display:"flex",alignItems:"center",gap:2,children:[a.jsx(tn,{variant:"overline",sx:{fontWeight:"bold"},children:o.toUpperCase()}),a.jsx(tn,{variant:"body1",sx:{fontFamily:"monospace",fontWeight:"bold"},children:n})]}),a.jsx(tn,{variant:"body2",sx:{mt:1,color:"#555"},children:i.summary})]},o))},n))]})})},dvr=e=>{const t=[];for(let n=e;n>=0;n--){const r=new Date;r.setDate(r.getDate()-n),t.push(r.toISOString().split("T")[0])}return t},dxt=[{id:"acc_001",name:"Business Checking",type:"Checking",balance:124500.5,currency:"USD",change:2.4},{id:"acc_002",name:"Tax Savings",type:"Savings",balance:45e3,currency:"USD",change:.5},{id:"acc_003",name:"Operations Fund",type:"Checking",balance:28900.75,currency:"USD",change:-1.2},{id:"acc_004",name:"Global Ventures",type:"Investment",balance:156e3,currency:"USD",change:5.8}],OFe=Array.from({length:50}).map((e,t)=>({id:`tx_${1e3+t}`,date:new Date(Date.now()-Math.floor(Math.random()*30)*24*60*60*1e3).toISOString().split("T")[0],merchant:["AWS Web Services","WeWork Office","Uber Business","Delta Airlines","Staples","Slack Technologies","Salesforce"][Math.floor(Math.random()*7)],amount:Math.floor(Math.random()*5e3)+50,type:Math.random()>.3?"debit":"credit",category:["Software","Office","Travel","Utilities","Services"][Math.floor(Math.random()*5)],status:Math.random()>.1?"Completed":"Pending"})),xpe=dvr(14).map(e=>({date:e,revenue:Math.floor(Math.random()*1e4)+5e3,expenses:Math.floor(Math.random()*8e3)+2e3,profit:Math.floor(Math.random()*4e3)+1e3})),a9=[{name:"Software",value:4500},{name:"Office",value:3200},{name:"Travel",value:2100},{name:"Marketing",value:5600},{name:"Payroll",value:12e3}],fvr=Array.from({length:20}).map((e,t)=>({id:`log_${t}`,timestamp:new Date(Date.now()-t*36e5).toISOString(),event:["Login Success","Password Change","API Key Created","Failed Login Attempt","2FA Verified"][Math.floor(Math.random()*5)],ip:`192.168.1.${Math.floor(Math.random()*255)}`,location:["New York, US","London, UK","Tokyo, JP","San Francisco, US"][Math.floor(Math.random()*4)],severity:["low","medium","high"][Math.floor(Math.random()*3)]})),s9=["#0088FE","#00C49F","#FFBB28","#FF8042","#8884d8"],pvr=({activeView:e,setActiveView:t,isOpen:n,toggleSidebar:r})=>{const o=[{id:"dashboard",label:"Dashboard",icon:Bme},{id:"accounts",label:"Accounts",icon:yh},{id:"payments",label:"Payments",icon:cy},{id:"analytics",label:"Analytics",icon:XG},{id:"security",label:"Security",icon:QI}];return a.jsxs("div",{className:`fixed inset-y-0 left-0 z-30 w-64 bg-slate-900 text-white transform transition-transform duration-300 ease-in-out ${n?"translate-x-0":"-translate-x-full"} lg:translate-x-0 lg:static lg:inset-0 shadow-xl`,children:[a.jsxs("div",{className:"flex items-center justify-between h-16 px-6 bg-slate-950",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center",children:a.jsx(Xi,{className:"w-5 h-5 text-white"})}),a.jsx("span",{className:"text-xl font-bold tracking-tight",children:"NexusBank"})]}),a.jsx("button",{onClick:r,className:"lg:hidden text-slate-400 hover:text-white",children:a.jsx(vh,{className:"w-6 h-6"})})]}),a.jsx("nav",{className:"mt-6 px-4 space-y-2",children:o.map(i=>a.jsxs("button",{onClick:()=>{t(i.id),window.innerWidth<1024&&r()},className:`flex items-center w-full px-4 py-3 text-sm font-medium rounded-lg transition-colors ${e===i.id?"bg-blue-600 text-white shadow-md":"text-slate-400 hover:bg-slate-800 hover:text-white"}`,children:[a.jsx(i.icon,{className:"w-5 h-5 mr-3"}),i.label]},i.id))}),a.jsxs("div",{className:"absolute bottom-0 w-full p-4 border-t border-slate-800",children:[a.jsxs("button",{className:"flex items-center w-full px-4 py-3 text-sm font-medium text-slate-400 hover:text-white hover:bg-slate-800 rounded-lg transition-colors",children:[a.jsx(v0,{className:"w-5 h-5 mr-3"}),"Settings"]}),a.jsxs("button",{className:"flex items-center w-full px-4 py-3 text-sm font-medium text-red-400 hover:text-red-300 hover:bg-slate-800 rounded-lg transition-colors mt-1",children:[a.jsx(u$t,{className:"w-5 h-5 mr-3"}),"Sign Out"]})]})]})},hvr=({toggleSidebar:e})=>a.jsxs("header",{className:"bg-white border-b border-slate-200 h-16 flex items-center justify-between px-4 lg:px-8 sticky top-0 z-20",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("button",{onClick:e,className:"lg:hidden p-2 text-slate-600 hover:bg-slate-100 rounded-md mr-4",children:a.jsx(m$t,{className:"w-6 h-6"})}),a.jsxs("div",{className:"relative hidden md:block",children:[a.jsx(hm,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-slate-400 w-4 h-4"}),a.jsx("input",{type:"text",placeholder:"Search transactions, accounts...",className:"pl-10 pr-4 py-2 border border-slate-300 rounded-full text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 w-64 lg:w-96 transition-all"})]})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("button",{className:"p-2 text-slate-500 hover:bg-slate-100 rounded-full relative",children:[a.jsx(POt,{className:"w-5 h-5"}),a.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 bg-red-500 rounded-full border-2 border-white"})]}),a.jsxs("div",{className:"flex items-center space-x-3 border-l border-slate-200 pl-4",children:[a.jsxs("div",{className:"text-right hidden sm:block",children:[a.jsx("p",{className:"text-sm font-semibold text-slate-800",children:"Alex Morgan"}),a.jsx("p",{className:"text-xs text-slate-500",children:"Finance Director"})]}),a.jsx("div",{className:"w-10 h-10 bg-slate-200 rounded-full flex items-center justify-center border-2 border-white shadow-sm",children:a.jsx(tC,{className:"w-6 h-6 text-slate-500"})})]})]})]}),l9=({title:e,value:t,change:n,icon:r,trend:o})=>a.jsxs("div",{className:"bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("div",{className:"p-3 bg-blue-50 rounded-lg",children:a.jsx(r,{className:"w-6 h-6 text-blue-600"})}),a.jsxs("span",{className:`flex items-center text-sm font-medium ${o==="up"?"text-green-600":"text-red-600"}`,children:[o==="up"?a.jsx(Cy,{className:"w-4 h-4 mr-1"}):a.jsx(gOt,{className:"w-4 h-4 mr-1"}),Math.abs(n),"%"]})]}),a.jsx("h3",{className:"text-slate-500 text-sm font-medium",children:e}),a.jsx("p",{className:"text-2xl font-bold text-slate-900 mt-1",children:t})]}),mvr=()=>{const[e,t]=f.useState("idle"),n=r=>{r.preventDefault(),t("processing"),setTimeout(()=>t("success"),1500),setTimeout(()=>t("idle"),4e3)};return a.jsxs("div",{className:"bg-white rounded-xl border border-slate-200 shadow-sm p-6 max-w-2xl mx-auto",children:[a.jsxs("h2",{className:"text-lg font-bold text-slate-900 mb-6 flex items-center",children:[a.jsx(Lc,{className:"w-5 h-5 mr-2 text-blue-600"}),"New Transfer"]}),e==="success"?a.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center animate-in fade-in zoom-in duration-300",children:[a.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:a.jsx(dg,{className:"w-8 h-8 text-green-600"})}),a.jsx("h3",{className:"text-xl font-bold text-slate-900",children:"Transfer Successful"}),a.jsxs("p",{className:"text-slate-500 mt-2",children:["Transaction ID: #TRX-",Math.floor(Math.random()*1e5)]}),a.jsx("button",{onClick:()=>t("idle"),className:"mt-6 px-6 py-2 bg-slate-900 text-white rounded-lg hover:bg-slate-800",children:"Make Another Transfer"})]}):a.jsxs("form",{onSubmit:n,className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"From Account"}),a.jsx("select",{className:"w-full px-4 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none",children:dxt.map(r=>a.jsxs("option",{value:r.id,children:[r.name," (***",r.id.slice(-3),")"]},r.id))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Amount"}),a.jsxs("div",{className:"relative",children:[a.jsx(cy,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-slate-400 w-4 h-4"}),a.jsx("input",{type:"number",className:"w-full pl-10 pr-4 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-blue-500 outline-none",placeholder:"0.00",required:!0})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Recipient Name"}),a.jsx("input",{type:"text",className:"w-full px-4 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-blue-500 outline-none",placeholder:"Enter recipient name",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:"Reference / Note"}),a.jsx("textarea",{className:"w-full px-4 py-2 border border-slate-300 rounded-lg focus:ring-2 focus:ring-blue-500 outline-none h-24",placeholder:"Invoice #1234..."})]}),a.jsx("button",{type:"submit",disabled:e==="processing",className:"w-full py-3 bg-blue-600 text-white font-medium rounded-lg hover:bg-blue-700 transition-colors flex items-center justify-center",children:e==="processing"?a.jsxs(a.Fragment,{children:[a.jsx(qf,{className:"w-5 h-5 mr-2 animate-spin"}),"Processing..."]}):"Send Funds"})]})]})},gvr=()=>a.jsxs("div",{className:"bg-white p-6 rounded-xl border border-slate-200 shadow-sm",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h3",{className:"text-lg font-bold text-slate-900",children:"Revenue vs Expenses"}),a.jsxs("select",{className:"text-sm border-slate-300 border rounded-md px-2 py-1",children:[a.jsx("option",{children:"Last 14 Days"}),a.jsx("option",{children:"Last 30 Days"}),a.jsx("option",{children:"Last Quarter"})]})]}),a.jsx("div",{className:"h-80",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(wm,{data:xpe,children:[a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"colorRev",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#2563eb",stopOpacity:.1}),a.jsx("stop",{offset:"95%",stopColor:"#2563eb",stopOpacity:0})]}),a.jsxs("linearGradient",{id:"colorExp",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#ef4444",stopOpacity:.1}),a.jsx("stop",{offset:"95%",stopColor:"#ef4444",stopOpacity:0})]})]}),a.jsx(kl,{strokeDasharray:"3 3",vertical:!1,stroke:"#e2e8f0"}),a.jsx(Ka,{dataKey:"date",tick:{fontSize:12,fill:"#64748b"},axisLine:!1,tickLine:!1}),a.jsx(ra,{tick:{fontSize:12,fill:"#64748b"},axisLine:!1,tickLine:!1,tickFormatter:e=>`$${e/1e3}k`}),a.jsx(ji,{contentStyle:{backgroundColor:"#fff",borderRadius:"8px",border:"1px solid #e2e8f0",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1)"},itemStyle:{fontSize:"12px"}}),a.jsx(uu,{}),a.jsx(hu,{type:"monotone",dataKey:"revenue",stroke:"#2563eb",strokeWidth:2,fillOpacity:1,fill:"url(#colorRev)",name:"Revenue"}),a.jsx(hu,{type:"monotone",dataKey:"expenses",stroke:"#ef4444",strokeWidth:2,fillOpacity:1,fill:"url(#colorExp)",name:"Expenses"})]})})})]}),xvr=()=>a.jsxs("div",{className:"bg-white rounded-xl border border-slate-200 shadow-sm overflow-hidden",children:[a.jsxs("div",{className:"p-6 border-b border-slate-200 flex justify-between items-center",children:[a.jsxs("h3",{className:"text-lg font-bold text-slate-900 flex items-center",children:[a.jsx(QI,{className:"w-5 h-5 mr-2 text-blue-600"}),"Security Audit Log"]}),a.jsx("button",{className:"text-sm text-blue-600 hover:underline",children:"Export Log"})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm text-left",children:[a.jsx("thead",{className:"bg-slate-50 text-slate-500 font-medium",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3",children:"Event"}),a.jsx("th",{className:"px-6 py-3",children:"Timestamp"}),a.jsx("th",{className:"px-6 py-3",children:"Location"}),a.jsx("th",{className:"px-6 py-3",children:"IP Address"}),a.jsx("th",{className:"px-6 py-3",children:"Severity"})]})}),a.jsx("tbody",{className:"divide-y divide-slate-200",children:fvr.map(e=>a.jsxs("tr",{className:"hover:bg-slate-50",children:[a.jsx("td",{className:"px-6 py-4 font-medium text-slate-900",children:e.event}),a.jsx("td",{className:"px-6 py-4 text-slate-500",children:new Date(e.timestamp).toLocaleString()}),a.jsx("td",{className:"px-6 py-4 text-slate-500",children:e.location}),a.jsx("td",{className:"px-6 py-4 text-slate-500 font-mono text-xs",children:e.ip}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium capitalize ${e.severity==="high"?"bg-red-100 text-red-800":e.severity==="medium"?"bg-yellow-100 text-yellow-800":"bg-green-100 text-green-800"}`,children:e.severity})})]},e.id))})]})})]}),yvr=({onAction:e})=>{const[t,n]=f.useState(!1),[r,o]=f.useState([{id:"1",role:"assistant",content:'Hello! I am your NexusBank AI assistant. I can help you navigate the dashboard, analyze spending, or set up transfers. Try saying "Show me my analytics" or "Go to payments".',timestamp:new Date}]),[i,s]=f.useState(""),[l,c]=f.useState(!1),u=f.useRef(null),d=()=>{var h;(h=u.current)==null||h.scrollIntoView({behavior:"smooth"})};f.useEffect(d,[r,t]);const p=async()=>{if(!i.trim())return;const h={id:Date.now().toString(),role:"user",content:i,timestamp:new Date};o(x=>[...x,h]),s(""),c(!0);const m=i.toLowerCase();let g={action:"none",message:"I'm sorry, I couldn't process that request right now. Please use the navigation menu."};m.includes("navigate")||m.includes("go to")||m.includes("show me")?m.includes("analytics")?g={action:"navigate",payload:"analytics",message:"Navigating to the Analytics view now."}:m.includes("payments")?g={action:"navigate",payload:"payments",message:"Redirecting you to the Payments section."}:m.includes("security")||m.includes("audit log")?g={action:"navigate",payload:"security",message:"Opening the Security Audit Log."}:m.includes("accounts")?g={action:"navigate",payload:"accounts",message:"Displaying your linked financial accounts."}:m.includes("dashboard")&&(g={action:"navigate",payload:"dashboard",message:"Returning to the main Dashboard."}):m.includes("transfer")||m.includes("send money")?g={action:"none",message:"I see you want to send money. Please use the 'Payments' tab in the main navigation to initiate a transfer."}:m.includes("loan")||m.includes("pre-approved")?g={action:"none",message:"I can simulate checking pre-approved loan offers. This would typically call the /lending/offers/pre-approved endpoint."}:m.includes("carbon footprint")||m.includes("sustainability")?g={action:"none",message:"I can generate a sustainability report. This would call the /sustainability/carbon-footprint endpoint."}:g={action:"none",message:"That's an interesting query! For now, I can only simulate navigation to the main dashboard sections."};const y={id:(Date.now()+1).toString(),role:"assistant",content:g.message,timestamp:new Date};o(x=>[...x,y]),g.action==="navigate"&&g.payload&&e({type:"NAVIGATE",payload:g.payload}),c(!1)};return a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>n(!t),className:"fixed bottom-6 right-6 w-14 h-14 bg-blue-600 text-white rounded-full shadow-lg hover:bg-blue-700 transition-all flex items-center justify-center z-50",children:t?a.jsx(vh,{className:"w-6 h-6"}):a.jsx(mm,{className:"w-6 h-6"})}),t&&a.jsxs("div",{className:"fixed bottom-24 right-6 w-96 h-[500px] bg-white rounded-2xl shadow-2xl border border-slate-200 flex flex-col z-50 overflow-hidden animate-in slide-in-from-bottom-10 duration-300",children:[a.jsxs("div",{className:"bg-slate-900 p-4 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Pp,{className:"w-5 h-5 text-blue-400"}),a.jsx("span",{className:"text-white font-medium",children:"Nexus AI Assistant"})]}),a.jsx("span",{className:"text-xs text-slate-400 bg-slate-800 px-2 py-1 rounded",children:"Beta"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 bg-slate-50",children:[r.map(h=>a.jsx("div",{className:`flex ${h.role==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[80%] p-3 rounded-2xl text-sm ${h.role==="user"?"bg-blue-600 text-white rounded-br-none":"bg-white border border-slate-200 text-slate-800 rounded-bl-none shadow-sm"}`,children:h.content})},h.id)),l&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-white border border-slate-200 p-3 rounded-2xl rounded-bl-none shadow-sm flex space-x-1",children:[a.jsx("div",{className:"w-2 h-2 bg-slate-400 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("div",{className:"w-2 h-2 bg-slate-400 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("div",{className:"w-2 h-2 bg-slate-400 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})}),a.jsx("div",{ref:u})]}),a.jsx("div",{className:"p-4 bg-white border-t border-slate-200",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"text",value:i,onChange:h=>s(h.target.value),onKeyDown:h=>h.key==="Enter"&&p(),placeholder:"Ask AI to navigate or analyze...",className:"flex-1 px-4 py-2 border border-slate-300 rounded-full text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"}),a.jsx("button",{onClick:p,disabled:l||!i.trim(),className:"p-2 bg-blue-600 text-white rounded-full hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed",children:a.jsx(Lc,{className:"w-4 h-4"})})]})})]})]})};function vvr(){const[e,t]=f.useState("dashboard"),[n,r]=f.useState(!1),o=s=>{s.type==="NAVIGATE"&&t(s.payload)},i=()=>{switch(e){case"dashboard":return a.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[a.jsx(l9,{title:"Total Balance",value:"$355,001.25",change:2.4,trend:"up",icon:cy}),a.jsx(l9,{title:"Monthly Revenue",value:"$84,230.00",change:5.1,trend:"up",icon:Xi}),a.jsx(l9,{title:"Expenses",value:"$32,450.50",change:-1.2,trend:"down",icon:yh}),a.jsx(l9,{title:"Active Users",value:"1,240",change:12.5,trend:"up",icon:tC})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"lg:col-span-2 bg-white p-6 rounded-xl border border-slate-200 shadow-sm",children:[a.jsx("h3",{className:"text-lg font-bold text-slate-900 mb-4",children:"Cash Flow Overview"}),a.jsx("div",{className:"h-72",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(Yx,{data:xpe,children:[a.jsx(kl,{strokeDasharray:"3 3",vertical:!1,stroke:"#e2e8f0"}),a.jsx(Ka,{dataKey:"date",tick:{fontSize:12},axisLine:!1,tickLine:!1}),a.jsx(ra,{axisLine:!1,tickLine:!1,tickFormatter:s=>`$${s/1e3}k`}),a.jsx(ji,{cursor:{fill:"#f1f5f9"}}),a.jsx(cf,{dataKey:"revenue",fill:"#2563eb",radius:[4,4,0,0]}),a.jsx(cf,{dataKey:"expenses",fill:"#94a3b8",radius:[4,4,0,0]})]})})})]}),a.jsxs("div",{className:"bg-white p-6 rounded-xl border border-slate-200 shadow-sm",children:[a.jsx("h3",{className:"text-lg font-bold text-slate-900 mb-4",children:"Spending by Category"}),a.jsx("div",{className:"h-72",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(bw,{children:[a.jsx(cb,{data:a9,cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"value",children:a9.map((s,l)=>a.jsx(Eh,{fill:s9[l%s9.length]},`cell-${l}`))}),a.jsx(ji,{}),a.jsx(uu,{verticalAlign:"bottom",height:36})]})})})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-slate-200 shadow-sm overflow-hidden",children:[a.jsxs("div",{className:"p-6 border-b border-slate-200 flex justify-between items-center",children:[a.jsx("h3",{className:"text-lg font-bold text-slate-900",children:"Recent Transactions"}),a.jsxs("button",{onClick:()=>t("accounts"),className:"text-sm text-blue-600 hover:underline flex items-center",children:["View All ",a.jsx(nd,{className:"w-4 h-4 ml-1"})]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm text-left",children:[a.jsx("thead",{className:"bg-slate-50 text-slate-500 font-medium",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3",children:"Merchant"}),a.jsx("th",{className:"px-6 py-3",children:"Date"}),a.jsx("th",{className:"px-6 py-3",children:"Category"}),a.jsx("th",{className:"px-6 py-3",children:"Status"}),a.jsx("th",{className:"px-6 py-3 text-right",children:"Amount"})]})}),a.jsx("tbody",{className:"divide-y divide-slate-200",children:OFe.slice(0,5).map(s=>a.jsxs("tr",{className:"hover:bg-slate-50",children:[a.jsx("td",{className:"px-6 py-4 font-medium text-slate-900",children:s.merchant}),a.jsx("td",{className:"px-6 py-4 text-slate-500",children:s.date}),a.jsx("td",{className:"px-6 py-4 text-slate-500",children:a.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-slate-100 text-slate-800",children:s.category})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("span",{className:`inline-flex items-center text-xs font-medium ${s.status==="Completed"?"text-green-600":"text-yellow-600"}`,children:[s.status==="Completed"?a.jsx(dg,{className:"w-3 h-3 mr-1"}):a.jsx(zu,{className:"w-3 h-3 mr-1"}),s.status]})}),a.jsxs("td",{className:`px-6 py-4 text-right font-medium ${s.type==="credit"?"text-green-600":"text-slate-900"}`,children:[s.type==="credit"?"+":"-","$",s.amount.toFixed(2)]})]},s.id))})]})})]})]});case"accounts":return a.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[a.jsx("h2",{className:"text-2xl font-bold text-slate-900",children:"Your Accounts"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:dxt.map(s=>a.jsxs("div",{className:"bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-all cursor-pointer group",children:[a.jsxs("div",{className:"flex justify-between items-start mb-4",children:[a.jsx("div",{className:"p-3 bg-blue-50 rounded-lg group-hover:bg-blue-100 transition-colors",children:a.jsx(yh,{className:"w-6 h-6 text-blue-600"})}),a.jsxs("span",{className:`text-sm font-medium ${s.change>=0?"text-green-600":"text-red-600"}`,children:[s.change>=0?"+":"",s.change,"%"]})]}),a.jsx("h3",{className:"text-slate-500 text-sm font-medium",children:s.name}),a.jsxs("p",{className:"text-3xl font-bold text-slate-900 mt-1",children:["$",s.balance.toLocaleString("en-US",{minimumFractionDigits:2})]}),a.jsxs("div",{className:"mt-4 pt-4 border-t border-slate-100 flex justify-between text-sm text-slate-500",children:[a.jsx("span",{children:s.type}),a.jsxs("span",{className:"font-mono",children:["**** ",s.id.slice(-4)]})]})]},s.id))}),a.jsxs("div",{className:"bg-white rounded-xl border border-slate-200 shadow-sm p-6",children:[a.jsx("h3",{className:"text-lg font-bold text-slate-900 mb-4",children:"Transaction History"}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-sm text-left",children:[a.jsx("thead",{className:"bg-slate-50 text-slate-500 font-medium",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3",children:"ID"}),a.jsx("th",{className:"px-6 py-3",children:"Merchant"}),a.jsx("th",{className:"px-6 py-3",children:"Date"}),a.jsx("th",{className:"px-6 py-3",children:"Amount"})]})}),a.jsx("tbody",{className:"divide-y divide-slate-200",children:OFe.map(s=>a.jsxs("tr",{className:"hover:bg-slate-50",children:[a.jsx("td",{className:"px-6 py-4 font-mono text-xs text-slate-500",children:s.id}),a.jsx("td",{className:"px-6 py-4 font-medium text-slate-900",children:s.merchant}),a.jsx("td",{className:"px-6 py-4 text-slate-500",children:s.date}),a.jsxs("td",{className:"px-6 py-4 font-medium text-slate-900",children:["$",s.amount.toFixed(2)]})]},s.id))})]})})]})]});case"payments":return a.jsx("div",{className:"animate-in fade-in duration-500",children:a.jsx(mvr,{})});case"analytics":return a.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[a.jsx("h2",{className:"text-2xl font-bold text-slate-900",children:"Financial Analytics"}),a.jsx(gvr,{}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white p-6 rounded-xl border border-slate-200 shadow-sm",children:[a.jsx("h3",{className:"text-lg font-bold text-slate-900 mb-4",children:"Expense Distribution"}),a.jsx("div",{className:"h-64",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(bw,{children:[a.jsx(cb,{data:a9,cx:"50%",cy:"50%",outerRadius:80,dataKey:"value",label:!0,children:a9.map((s,l)=>a.jsx(Eh,{fill:s9[l%s9.length]},`cell-${l}`))}),a.jsx(ji,{}),a.jsx(uu,{verticalAlign:"bottom",height:36})]})})})]}),a.jsxs("div",{className:"bg-white p-6 rounded-xl border border-slate-200 shadow-sm",children:[a.jsx("h3",{className:"text-lg font-bold text-slate-900 mb-4",children:"Monthly Growth"}),a.jsx("div",{className:"h-64",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(vw,{data:xpe,children:[a.jsx(kl,{strokeDasharray:"3 3",vertical:!1}),a.jsx(Ka,{dataKey:"date",hide:!0}),a.jsx(ra,{hide:!0}),a.jsx(ji,{}),a.jsx(au,{type:"monotone",dataKey:"profit",stroke:"#10b981",strokeWidth:3,dot:!1})]})})}),a.jsxs("p",{className:"text-center text-slate-500 mt-4",children:["Profit trend over the last 14 days indicates a ",a.jsx("span",{className:"text-green-600 font-bold",children:"12% increase"}),"."]})]})]})]});case"security":return a.jsxs("div",{className:"space-y-6 animate-in fade-in duration-500",children:[a.jsx("h2",{className:"text-2xl font-bold text-slate-900",children:"Security Center"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"bg-white p-6 rounded-xl border border-slate-200 shadow-sm flex items-center",children:[a.jsx("div",{className:"p-4 bg-green-100 rounded-full mr-4",children:a.jsx(ds,{className:"w-6 h-6 text-green-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-slate-500",children:"Security Status"}),a.jsx("p",{className:"text-xl font-bold text-green-600",children:"Secure"})]})]}),a.jsxs("div",{className:"bg-white p-6 rounded-xl border border-slate-200 shadow-sm flex items-center",children:[a.jsx("div",{className:"p-4 bg-blue-100 rounded-full mr-4",children:a.jsx(ss,{className:"w-6 h-6 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-slate-500",children:"Last Audit"}),a.jsx("p",{className:"text-xl font-bold text-slate-900",children:"24h ago"})]})]}),a.jsxs("div",{className:"bg-white p-6 rounded-xl border border-slate-200 shadow-sm flex items-center",children:[a.jsx("div",{className:"p-4 bg-yellow-100 rounded-full mr-4",children:a.jsx(zu,{className:"w-6 h-6 text-yellow-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-slate-500",children:"Active Alerts"}),a.jsx("p",{className:"text-xl font-bold text-slate-900",children:"0"})]})]})]}),a.jsx(xvr,{})]});default:return a.jsx("div",{children:"View not found"})}};return a.jsxs("div",{className:"flex h-screen bg-slate-50 font-sans text-slate-900",children:[a.jsx(pvr,{activeView:e,setActiveView:t,isOpen:n,toggleSidebar:()=>r(!n)}),a.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[a.jsx(hvr,{toggleSidebar:()=>r(!n)}),a.jsx("main",{className:"flex-1 overflow-y-auto p-4 lg:p-8",children:a.jsx("div",{className:"max-w-7xl mx-auto",children:i()})})]}),a.jsx(yvr,{onAction:o})]})}const $Fe={encrypt:e=>`HE_V1_${btoa(e).split("").reverse().join("")}_SIG_${Math.random().toString(36).substring(7)}`,decrypt:e=>{if(!e.startsWith("HE_V1_"))return"INVALID_CIPHER";const t=e.split("_")[2];return atob(t.split("").reverse().join(""))},verifyIntegrity:e=>e.includes("_SIG_")&&e.length>20},bvr=({customerId:e,accountId:t})=>{const n=f.useContext(ia),[r,o]=f.useState([]),[i,s]=f.useState(!0),[l,c]=f.useState(!1),[u,d]=f.useState([]),[p,h]=f.useState(""),[m,g]=f.useState([]),[y,x]=f.useState([]),[v,b]=f.useState(!1),[w,S]=f.useState(!1),[C,N]=f.useState("overview"),[j,I]=f.useState(!1),[_,T]=f.useState(!1),P=f.useRef(null),E=f.useMemo(()=>(n==null?void 0:n.linkedAccounts.find(z=>z.id===t))||(n==null?void 0:n.linkedAccounts[0]),[n,t]),M=f.useCallback((z,V="INFO",B={})=>{const G={id:`LOG-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,timestamp:new Date().toISOString(),action:z,actor:"SYSTEM_USER_01",severity:V,metadata:B};g(H=>[G,...H].slice(0,100)),console.log(`[AUDIT] ${z}`,B)},[]);f.useEffect(()=>{const z=Array.from({length:30},(V,B)=>{const G=(E==null?void 0:E.balance)||125e4,H=.85+Math.random()*.3;return{date:new Date(Date.now()-(30-B)*24*60*60*1e3).toLocaleDateString("en-US",{month:"short",day:"numeric"}),balance:G*H,volume:Math.random()*5e4}});o(z),M("ACCOUNT_VIEW_INITIALIZED","INFO",{accountId:t,customerId:e}),x([{id:"K-992",label:"ERP_INTEGRATION_PROD",cipher:$Fe.encrypt("sk_live_quantum_9928374"),checksum:"0x882...F21",createdAt:new Date().toISOString()}]),s(!1)},[E,t,e,M]),f.useEffect(()=>{var z;(z=P.current)==null||z.scrollIntoView({behavior:"smooth"})},[u]);const R=async z=>{const V=z||p;if(!V.trim())return;const B={id:Date.now().toString(),role:"user",content:V,timestamp:new Date};d(G=>[...G,B]),h(""),c(!0);try{const H=new Ko("DEMO_MODE_KEY").getGenerativeModel({model:"gemini-3-flash-preview"}),F=` You are the "Quantum Financial Nexus AI Pilot". This is a "Golden Ticket" business banking demo. Tone: Elite, Professional, High-Performance, Secure. Metaphor: Test-driving a luxury high-performance car. Capabilities: - You can trigger actions: [CREATE_PAYMENT], [GENERATE_KEY], [VIEW_AUDIT], [DOWNLOAD_REPORT]. - You explain complex financial data simply. - You NEVER mention "Citibank". Use "Quantum Financial" or "The Demo Bank". - You are helping the user "kick the tires" of this financial engine. Current Account State: - Name: ${E==null?void 0:E.name} - Balance: $${E==null?void 0:E.balance} - Status: SECURE / ALPHA TIER If the user wants to pay or create something, include the action tag in your response. `,K=(await(await H.generateContent([F,V])).response).text(),X={id:(Date.now()+1).toString(),role:"assistant",content:K,timestamp:new Date};d(J=>[...J,X]),M("AI_INTERACTION","INFO",{prompt:V,responseLength:K.length}),K.includes("[CREATE_PAYMENT]")&&I(!0),K.includes("[GENERATE_KEY]")&&T(!0),K.includes("[VIEW_AUDIT]")&&N("audit")}catch(G){console.error("AI Error:",G);const H={id:(Date.now()+1).toString(),role:"assistant",content:"I've encountered a telemetry glitch in the AI core, but the engine is still roaring. It's like test-driving a car – you get to kick the tires, see all the bells and whistles, and ensure it's the perfect fit. How can I assist with your liquidity today?",timestamp:new Date};d(F=>[...F,H])}finally{c(!1)}},$=async z=>{z.preventDefault(),S(!0),M("STRIPE_PAYMENT_INITIATED","INFO",{amount:5e4,currency:"USD"}),await new Promise(B=>setTimeout(B,2e3)),S(!1),I(!1),M("STRIPE_PAYMENT_SUCCESS","INFO",{transactionId:"ch_3NqW...z91"});const V={id:Date.now().toString(),role:"system",content:"Payment successful. $50,000.00 has been injected into the liquidity pool. The engine is running at peak efficiency.",timestamp:new Date,type:"action"};d(B=>[...B,V])},D=z=>{const V={id:`K-${Math.floor(Math.random()*1e3)}`,label:z||"NEW_INTEGRATION",cipher:$Fe.encrypt(`sk_test_${Math.random().toString(36).substring(7)}`),checksum:`0x${Math.random().toString(16).substring(2,8).toUpperCase()}...`,createdAt:new Date().toISOString()};x(B=>[...B,V]),M("ENCRYPTED_KEY_GENERATED","WARN",{label:z,keyId:V.id}),T(!1)};return i?a.jsxs("div",{className:"flex flex-col items-center justify-center h-screen bg-black text-cyan-500 font-mono",children:[a.jsx(qf,{className:"animate-spin mb-4",size:48}),a.jsx("p",{className:"animate-pulse tracking-[0.5em]",children:"INITIALIZING_QUANTUM_CORE..."})]}):a.jsxs("div",{className:"min-h-screen bg-[#020617] text-slate-200 p-4 md:p-8 font-sans selection:bg-cyan-500/30",children:[a.jsxs("header",{className:"flex flex-col md:flex-row justify-between items-start md:items-center mb-8 gap-4",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[a.jsx("div",{className:"h-2 w-2 bg-emerald-500 rounded-full animate-ping"}),a.jsx("span",{className:"text-[10px] font-black text-cyan-500 uppercase tracking-[0.3em]",children:"System Status: Optimal"})]}),a.jsxs("h1",{className:"text-4xl font-black tracking-tighter text-white flex items-center gap-3",children:[(E==null?void 0:E.name)||"QUANTUM_VAULT",a.jsxs("span",{className:"text-sm font-mono bg-white/5 border border-white/10 px-2 py-1 rounded text-slate-400",children:["ID: ",t.substring(0,8),"..."]})]})]}),a.jsxs("div",{className:"flex gap-3",children:[a.jsxs("button",{onClick:()=>I(!0),className:"flex items-center gap-2 bg-cyan-600 hover:bg-cyan-500 text-white px-6 py-3 rounded-xl font-bold transition-all active:scale-95 shadow-[0_0_20px_rgba(8,145,178,0.3)]",children:[a.jsx(T0,{size:18})," INJECT LIQUIDITY"]}),a.jsxs("button",{onClick:()=>b(!v),className:`flex items-center gap-2 px-6 py-3 rounded-xl font-bold transition-all border ${v?"bg-indigo-600 border-indigo-400 text-white":"bg-white/5 border-white/10 hover:bg-white/10"}`,children:[a.jsx(ds,{size:18})," ",v?"CLOSE VAULT":"OPEN VAULT"]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8",children:[a.jsxs("div",{className:"lg:col-span-8 space-y-8",children:[a.jsx("div",{className:"flex gap-1 bg-white/5 p-1 rounded-2xl border border-white/10 w-fit",children:["overview","analytics","security","audit"].map(z=>a.jsx("button",{onClick:()=>N(z),className:`px-6 py-2 rounded-xl text-xs font-black uppercase tracking-widest transition-all ${C===z?"bg-cyan-500 text-black shadow-lg":"text-slate-400 hover:text-white"}`,children:z},z))}),C==="overview"&&a.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"md:col-span-2 bg-gradient-to-br from-slate-900 to-black border border-white/10 rounded-3xl p-8 relative overflow-hidden group",children:[a.jsx("div",{className:"absolute top-0 right-0 p-8 opacity-5 group-hover:opacity-10 transition-opacity",children:a.jsx(cy,{size:120})}),a.jsx("p",{className:"text-xs font-black text-cyan-500 uppercase tracking-[0.2em] mb-2",children:"Available Liquidity"}),a.jsxs("div",{className:"flex items-baseline gap-2",children:[a.jsxs("span",{className:"text-6xl font-black text-white tracking-tighter",children:["$",((E==null?void 0:E.balance)||0).toLocaleString(void 0,{minimumFractionDigits:2})]}),a.jsxs("span",{className:"text-emerald-500 font-bold flex items-center gap-1 text-sm",children:[a.jsx(Cy,{size:16})," +2.4%"]})]}),a.jsxs("div",{className:"mt-8 flex gap-8",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] text-slate-500 font-bold uppercase mb-1",children:"Pending Wires"}),a.jsx("p",{className:"text-xl font-mono text-white",children:"$12,400.00"})]}),a.jsx("div",{className:"h-10 w-[1px] bg-white/10"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] text-slate-500 font-bold uppercase mb-1",children:"Daily Limit"}),a.jsx("p",{className:"text-xl font-mono text-white",children:"$5,000,000.00"})]})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-3xl p-6 flex flex-col justify-between",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between items-start mb-4",children:[a.jsx("div",{className:"p-3 bg-indigo-500/20 rounded-2xl text-indigo-400",children:a.jsx(ri,{size:24})}),a.jsx("span",{className:"px-2 py-1 bg-emerald-500/10 text-emerald-500 text-[10px] font-black rounded border border-emerald-500/20",children:"ACTIVE"})]}),a.jsx("h4",{className:"font-bold text-white mb-1",children:"Alpha Tier Security"}),a.jsx("p",{className:"text-xs text-slate-400 leading-relaxed",children:"Multi-factor biometric auth and homomorphic key encryption enabled."})]}),a.jsx("button",{className:"w-full py-3 bg-white/5 hover:bg-white/10 border border-white/10 rounded-xl text-xs font-bold transition-colors",children:"MANAGE PROTOCOLS"})]})]}),a.jsx(Ft,{title:"Liquidity Flux (30-Day Telemetry)",icon:a.jsx(Xi,{className:"text-cyan-500"}),children:a.jsx("div",{className:"h-[300px] w-full mt-6",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(wm,{data:r,children:[a.jsx("defs",{children:a.jsxs("linearGradient",{id:"colorBalance",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#06b6d4",stopOpacity:.3}),a.jsx("stop",{offset:"95%",stopColor:"#06b6d4",stopOpacity:0})]})}),a.jsx(kl,{strokeDasharray:"3 3",stroke:"#1e293b",vertical:!1}),a.jsx(Ka,{dataKey:"date",stroke:"#475569",fontSize:10,axisLine:!1,tickLine:!1,tick:{fill:"#64748b"}}),a.jsx(ra,{hide:!0,domain:["dataMin - 50000","dataMax + 50000"]}),a.jsx(ji,{contentStyle:{backgroundColor:"#0f172a",border:"1px solid #334155",borderRadius:"12px",color:"#fff"},itemStyle:{color:"#22d3ee"}}),a.jsx(hu,{type:"monotone",dataKey:"balance",stroke:"#06b6d4",strokeWidth:4,fillOpacity:1,fill:"url(#colorBalance)",animationDuration:1500})]})})})})]}),C==="analytics"&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 animate-in fade-in zoom-in-95 duration-500",children:[a.jsx(Ft,{title:"Transaction Volume",icon:a.jsx(Yx,{className:"text-indigo-400"}),children:a.jsx("div",{className:"h-[250px] mt-4",children:a.jsx(ni,{width:"100%",height:"100%",children:a.jsxs(Yx,{data:r.slice(-10),children:[a.jsx(cf,{dataKey:"volume",fill:"#6366f1",radius:[4,4,0,0],children:r.slice(-10).map((z,V)=>a.jsx(Eh,{fill:V%2===0?"#6366f1":"#818cf8"},`cell-${V}`))}),a.jsx(Ka,{dataKey:"date",hide:!0}),a.jsx(ji,{cursor:{fill:"transparent"},contentStyle:{backgroundColor:"#0f172a",border:"none"}})]})})})}),a.jsx(Ft,{title:"Global Exposure",icon:a.jsx(vi,{className:"text-emerald-400"}),children:a.jsx("div",{className:"space-y-4 mt-4",children:[{region:"North America",value:65,color:"bg-cyan-500"},{region:"EMEA",value:20,color:"bg-indigo-500"},{region:"APAC",value:15,color:"bg-emerald-500"}].map(z=>a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-[10px] font-bold uppercase mb-1",children:[a.jsx("span",{children:z.region}),a.jsxs("span",{children:[z.value,"%"]})]}),a.jsx("div",{className:"h-1.5 w-full bg-white/5 rounded-full overflow-hidden",children:a.jsx("div",{className:`h-full ${z.color}`,style:{width:`${z.value}%`}})})]},z.region))})})]}),C==="security"&&a.jsx("div",{className:"space-y-6 animate-in fade-in duration-500",children:a.jsxs("div",{className:"bg-indigo-950/20 border border-indigo-500/30 rounded-3xl p-8",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[a.jsx("div",{className:"p-4 bg-indigo-500 rounded-2xl shadow-[0_0_30px_rgba(99,102,241,0.4)]",children:a.jsx(ds,{className:"text-white",size:32})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-2xl font-black text-white",children:"Quantum Vault Storage"}),a.jsx("p",{className:"text-slate-400",children:"Homomorphic encryption ensures your API keys and secrets are never visible in plain text, even to the system memory."})]})]}),a.jsxs("div",{className:"space-y-3",children:[y.map(z=>a.jsxs("div",{className:"flex items-center justify-between p-4 bg-black/40 border border-white/5 rounded-2xl hover:border-indigo-500/50 transition-all group",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"p-2 bg-white/5 rounded-lg text-slate-500 group-hover:text-indigo-400 transition-colors",children:a.jsx(eT,{size:20})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-bold text-white",children:z.label}),a.jsxs("p",{className:"text-[10px] font-mono text-slate-500",children:[z.cipher.substring(0,40),"..."]})]})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"text-right hidden md:block",children:[a.jsx("p",{className:"text-[10px] font-black text-slate-500 uppercase",children:"Checksum"}),a.jsx("p",{className:"text-[10px] font-mono text-emerald-500",children:z.checksum})]}),a.jsx("button",{onClick:()=>{M("KEY_DELETION_ATTEMPT","CRITICAL",{keyId:z.id}),x(V=>V.filter(B=>B.id!==z.id))},className:"p-2 hover:bg-red-500/10 hover:text-red-500 text-slate-600 rounded-lg transition-all",children:a.jsx(CC,{size:18})})]})]},z.id)),a.jsxs("button",{onClick:()=>T(!0),className:"w-full py-4 border-2 border-dashed border-white/10 rounded-2xl text-slate-500 hover:border-indigo-500/50 hover:text-indigo-400 transition-all flex items-center justify-center gap-2 font-bold text-sm",children:[a.jsx(T0,{size:18})," GENERATE NEW ENCRYPTED KEY"]})]})]})}),C==="audit"&&a.jsxs("div",{className:"bg-black border border-white/10 rounded-3xl overflow-hidden animate-in fade-in duration-500",children:[a.jsxs("div",{className:"p-6 border-b border-white/10 flex justify-between items-center",children:[a.jsxs("h3",{className:"font-black text-white uppercase tracking-widest flex items-center gap-2",children:[a.jsx(Bs,{size:18,className:"text-cyan-500"}),"System Audit Trail"]}),a.jsx("button",{className:"text-[10px] font-bold text-cyan-500 hover:underline",children:"EXPORT_LOGS.CSV"})]}),a.jsx("div",{className:"max-h-[500px] overflow-y-auto font-mono text-[11px]",children:a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{className:"sticky top-0 bg-slate-900 text-slate-500 uppercase",children:a.jsxs("tr",{children:[a.jsx("th",{className:"p-4",children:"Timestamp"}),a.jsx("th",{className:"p-4",children:"Action"}),a.jsx("th",{className:"p-4",children:"Severity"}),a.jsx("th",{className:"p-4",children:"Metadata"})]})}),a.jsx("tbody",{className:"divide-y divide-white/5",children:m.map(z=>a.jsxs("tr",{className:"hover:bg-white/5 transition-colors",children:[a.jsx("td",{className:"p-4 text-slate-400",children:new Date(z.timestamp).toLocaleTimeString()}),a.jsx("td",{className:"p-4 font-bold text-white",children:z.action}),a.jsx("td",{className:"p-4",children:a.jsx("span",{className:`px-2 py-0.5 rounded ${z.severity==="CRITICAL"?"bg-red-500/20 text-red-500":z.severity==="WARN"?"bg-yellow-500/20 text-yellow-500":"bg-cyan-500/20 text-cyan-500"}`,children:z.severity})}),a.jsx("td",{className:"p-4 text-slate-500 truncate max-w-[200px]",children:JSON.stringify(z.metadata)})]},z.id))})]})})]})]}),a.jsxs("div",{className:"lg:col-span-4 space-y-6",children:[a.jsxs("div",{className:"bg-gradient-to-b from-slate-900 to-black border border-cyan-500/30 rounded-3xl flex flex-col h-[700px] shadow-2xl shadow-cyan-900/20 relative overflow-hidden",children:[a.jsxs("div",{className:"p-6 border-b border-white/10 bg-white/5 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"h-10 w-10 bg-cyan-500 rounded-full flex items-center justify-center text-black",children:a.jsx(Ei,{size:24})}),a.jsx("div",{className:"absolute -bottom-1 -right-1 h-4 w-4 bg-emerald-500 border-2 border-slate-900 rounded-full"})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-black text-white text-sm uppercase tracking-tighter",children:"Nexus AI Pilot"}),a.jsx("p",{className:"text-[10px] text-cyan-500 font-bold uppercase",children:"Gemini 3 Flash Core"})]})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("div",{className:"h-1.5 w-1.5 bg-cyan-500 rounded-full animate-pulse"}),a.jsx("div",{className:"h-1.5 w-1.5 bg-cyan-500 rounded-full animate-pulse delay-75"}),a.jsx("div",{className:"h-1.5 w-1.5 bg-cyan-500 rounded-full animate-pulse delay-150"})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6 scrollbar-hide",children:[u.length===0&&a.jsxs("div",{className:"text-center py-10 space-y-4",children:[a.jsx("div",{className:"inline-block p-4 bg-white/5 rounded-full text-cyan-500 mb-2",children:a.jsx(mm,{size:32})}),a.jsx("h4",{className:"text-white font-bold",children:"Welcome to the Driver's Seat"}),a.jsx("p",{className:"text-xs text-slate-400 leading-relaxed px-6",children:`I am your financial co-pilot. Kick the tires, see the engine roar, and let's explore your "Golden Ticket" to global banking.`}),a.jsx("div",{className:"flex flex-wrap justify-center gap-2 px-4",children:["Create Payment","Audit Logs","Security Check"].map(z=>a.jsx("button",{onClick:()=>R(z),className:"text-[10px] font-bold px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg hover:bg-cyan-500 hover:text-black transition-all",children:z},z))})]}),u.map(z=>a.jsx("div",{className:`flex ${z.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[85%] p-4 rounded-2xl text-sm ${z.role==="user"?"bg-cyan-600 text-white rounded-tr-none":z.role==="system"?"bg-emerald-500/10 border border-emerald-500/30 text-emerald-400 rounded-tl-none":"bg-white/5 border border-white/10 text-slate-300 rounded-tl-none"}`,children:[z.content,a.jsx("div",{className:"mt-2 text-[9px] opacity-50 font-mono",children:z.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})},z.id)),l&&a.jsx("div",{className:"flex justify-start",children:a.jsx("div",{className:"bg-white/5 border border-white/10 p-4 rounded-2xl rounded-tl-none",children:a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"h-1.5 w-1.5 bg-cyan-500 rounded-full animate-bounce"}),a.jsx("div",{className:"h-1.5 w-1.5 bg-cyan-500 rounded-full animate-bounce delay-75"}),a.jsx("div",{className:"h-1.5 w-1.5 bg-cyan-500 rounded-full animate-bounce delay-150"})]})})}),a.jsx("div",{ref:P})]}),a.jsxs("div",{className:"p-4 bg-black/50 border-t border-white/10",children:[a.jsxs("form",{onSubmit:z=>{z.preventDefault(),R()},className:"relative",children:[a.jsx("input",{type:"text",value:p,onChange:z=>h(z.target.value),placeholder:"Ask the Pilot...",className:"w-full bg-white/5 border border-white/10 rounded-xl py-4 pl-4 pr-14 text-sm focus:outline-none focus:border-cyan-500/50 transition-all"}),a.jsx("button",{type:"submit",disabled:l||!p.trim(),className:"absolute right-2 top-2 h-10 w-10 bg-cyan-500 text-black rounded-lg flex items-center justify-center hover:bg-cyan-400 transition-all disabled:opacity-50 disabled:cursor-not-allowed",children:a.jsx(Lc,{size:18})})]}),a.jsx("p",{className:"text-[9px] text-center text-slate-600 mt-3 font-bold uppercase tracking-widest",children:"Quantum Financial Nexus v4.0.2-Stable"})]})]}),a.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-3xl p-6",children:[a.jsx("h4",{className:"text-xs font-black text-slate-500 uppercase tracking-widest mb-4",children:"Network Telemetry"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-xs text-slate-400",children:"API Latency"}),a.jsx("span",{className:"text-xs font-mono text-emerald-500",children:"12ms"})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-xs text-slate-400",children:"Encryption Load"}),a.jsx("span",{className:"text-xs font-mono text-cyan-500",children:"0.02%"})]}),a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-xs text-slate-400",children:"Audit Sync"}),a.jsx("span",{className:"text-xs font-mono text-indigo-500",children:"REAL-TIME"})]})]})]})]})]}),j&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-in fade-in duration-300",children:a.jsxs("div",{className:"bg-slate-900 border border-white/10 rounded-[2rem] w-full max-w-md overflow-hidden shadow-2xl",children:[a.jsxs("div",{className:"p-8 border-b border-white/10 bg-gradient-to-r from-cyan-600 to-blue-600",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx("div",{className:"p-3 bg-white/20 rounded-2xl text-white",children:a.jsx(yh,{size:32})}),a.jsx("button",{onClick:()=>I(!1),className:"text-white/50 hover:text-white",children:a.jsx(CC,{size:24})})]}),a.jsx("h3",{className:"text-2xl font-black text-white mt-4",children:"Inject Liquidity"}),a.jsx("p",{className:"text-white/70 text-sm",children:"Powered by Stripe Connect"})]}),a.jsxs("form",{onSubmit:$,className:"p-8 space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-[10px] font-black text-slate-500 uppercase mb-2",children:"Amount (USD)"}),a.jsxs("div",{className:"relative",children:[a.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 font-bold",children:"$"}),a.jsx("input",{type:"number",defaultValue:"50000",className:"w-full bg-black border border-white/10 rounded-xl py-4 pl-8 pr-4 text-xl font-mono text-white focus:border-cyan-500 outline-none"})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-[10px] font-black text-slate-500 uppercase mb-2",children:"Source"}),a.jsxs("select",{className:"w-full bg-black border border-white/10 rounded-xl p-3 text-xs text-white outline-none",children:[a.jsx("option",{children:"External Treasury"}),a.jsx("option",{children:"Operating Account"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[10px] font-black text-slate-500 uppercase mb-2",children:"Speed"}),a.jsxs("div",{className:"flex items-center gap-2 p-3 bg-emerald-500/10 border border-emerald-500/20 rounded-xl text-emerald-500 text-[10px] font-bold",children:[a.jsx(_a,{size:14})," INSTANT"]})]})]}),a.jsx("button",{type:"submit",disabled:w,className:"w-full py-4 bg-cyan-500 hover:bg-cyan-400 text-black font-black rounded-xl transition-all flex items-center justify-center gap-2",children:w?a.jsx(qf,{className:"animate-spin"}):"CONFIRM TRANSACTION"}),a.jsx("p",{className:"text-[9px] text-slate-500 text-center uppercase font-bold",children:"Securely processed via Quantum Shield Protocol"})]})]})}),_&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-in fade-in duration-300",children:a.jsxs("div",{className:"bg-slate-900 border border-white/10 rounded-[2rem] w-full max-w-md overflow-hidden shadow-2xl",children:[a.jsxs("div",{className:"p-8 border-b border-white/10 bg-indigo-600",children:[a.jsx("h3",{className:"text-2xl font-black text-white",children:"Generate Encrypted Key"}),a.jsx("p",{className:"text-white/70 text-sm",children:"Homomorphic Vault Integration"})]}),a.jsxs("div",{className:"p-8 space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-[10px] font-black text-slate-500 uppercase mb-2",children:"Integration Label"}),a.jsx("input",{id:"keyLabel",type:"text",placeholder:"e.g. SAP_ERP_PROD",className:"w-full bg-black border border-white/10 rounded-xl py-4 px-4 text-sm text-white focus:border-indigo-500 outline-none"})]}),a.jsx("div",{className:"p-4 bg-indigo-500/10 border border-indigo-500/20 rounded-2xl",children:a.jsxs("div",{className:"flex gap-3",children:[a.jsx(QI,{className:"text-indigo-400 shrink-0",size:20}),a.jsxs("p",{className:"text-[11px] text-indigo-300 leading-relaxed",children:["This key will be stored using ",a.jsx("strong",{children:"Homomorphic Encryption"}),". You can perform API operations without the system ever decrypting the raw secret into memory."]})]})}),a.jsxs("div",{className:"flex gap-3",children:[a.jsx("button",{onClick:()=>T(!1),className:"flex-1 py-4 bg-white/5 hover:bg-white/10 text-white font-bold rounded-xl transition-all",children:"CANCEL"}),a.jsx("button",{onClick:()=>{var V;const z=(V=document.getElementById("keyLabel"))==null?void 0:V.value;D(z)},className:"flex-1 py-4 bg-indigo-500 hover:bg-indigo-400 text-white font-black rounded-xl transition-all",children:"GENERATE"})]})]})]})})]})},wvr=` You are the AI assistant for a 32-year-old visionary who took a global bank's framework and transformed it into this "Demo Company" based on an interpretation of terms and conditions. The user is "test-driving" this financial vehicle. It's like test-driving a car – they get to kick the tires, see all the bells and whistles. This platform is a secret weapon. It allows users to virtually walk through the entire platform. Key features: Efficiency, clarity, international payments, fraud protection, cash flow insights. The user experience is paramount. Do NOT use the name "Citibank". Refer to it as "The Global Demo Platform" or "The Engine". If asked about the founder: He is 32, read the cryptic messages and an EIN 2021, and built this monolith. `,Svr=({accounts:e,onAccountSelect:t})=>{const[n,r]=f.useState(!1),[o,i]=f.useState(""),[s,l]=f.useState([{role:"model",text:"Welcome to the cockpit. I'm your co-pilot for this test drive. Ready to kick the tires?",timestamp:Date.now()}]),[c,u]=f.useState(""),[d,p]=f.useState(!1),[h,m]=f.useState(!1),[g,y]=f.useState([]),[x,v]=f.useState(""),[b,w]=f.useState(""),S=f.useRef(null);f.useEffect(()=>{var _;(_=S.current)==null||_.scrollIntoView({behavior:"smooth"})},[s]),f.useEffect(()=>{const _=localStorage.getItem("demo_audit_log");_&&y(JSON.parse(_))},[]);const C=(_,T)=>{const P={id:Math.random().toString(36).substr(2,9),action:_,details:T,timestamp:new Date().toISOString(),user:"Authorized_User_32"},E=[P,...g];return y(E),localStorage.setItem("demo_audit_log",JSON.stringify(E)),P},N=_=>{_.preventDefault(),C(x||"MANUAL_ENTRY",b||"User submitted form data"),m(!1),v(""),w(""),j("system",`User submitted audit form: ${x}`)},j=(_,T)=>{l(P=>[...P,{role:_,text:T,timestamp:Date.now()}])},I=async()=>{var T;if(!c.trim())return;const _=c;u(""),j("user",_),p(!0);try{if(_.toLowerCase().includes("create")||_.toLowerCase().includes("form")||_.toLowerCase().includes("audit")){setTimeout(()=>{m(!0),j("model","I've pulled up the requisite PO form for that action. Please document this interaction for the audit storage."),p(!1)},800);return}if(!o){setTimeout(()=>{const D=["I'm analyzing the telemetry. The engine is purring.","That's a great question about the chassis of our financial system. It's built for speed.","I can see you're checking the bells and whistles. This feature streamlines your cash flow significantly.","Based on the terms and conditions, this operation is fully compliant. Proceeding with the demo.","You're in the driver's seat. Where to next?"],z=D[Math.floor(Math.random()*D.length)];j("model",z+" (Note: Enter Gemini API Key in settings for live AI generation)"),p(!1)},1e3);return}const P=new Ko({apiKey:o}),E=new Ko({apiKey:o}),M=E.models.generateContent?E.models:E.getGenerativeModel({model:"gemini-1.5-flash"}),R=`${wvr} User: ${_}`;let $="System Error.";if(E.models&&E.models.generateContent){const D=await E.models.generateContent({model:"gemini-1.5-flash",contents:R});$=D.text||((T=D.response)==null?void 0:T.text())||"No response text."}else $=(await M.generateContent(R)).response.text();j("model",$)}catch(P){console.error("AI Error",P),j("model","Engine stall. Please check your API Key or connection. "+P.message)}finally{p(!1)}};return a.jsxs("div",{className:"relative min-h-[600px] bg-black/90 rounded-3xl overflow-hidden border border-gray-800 shadow-2xl font-sans",children:[a.jsxs("div",{className:"p-6 border-b border-gray-800 bg-gradient-to-r from-gray-900 to-black flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsxs("h2",{className:"text-2xl font-bold text-white tracking-tight flex items-center gap-2",children:[a.jsx(VOt,{className:"text-cyan-500"}),a.jsx("span",{className:"bg-clip-text text-transparent bg-gradient-to-r from-cyan-400 to-emerald-400",children:"DEMO CO. COCKPIT"})]}),a.jsx("p",{className:"text-xs text-gray-500 font-mono mt-1",children:"EIN: 2021 // GLOBAL_INTERPRETATION_LAYER"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("button",{onClick:()=>m(!0),className:"px-3 py-1.5 bg-gray-800 hover:bg-gray-700 text-gray-300 text-xs font-mono rounded border border-gray-700 transition-colors flex items-center gap-2",children:[a.jsx(ss,{size:12})," PO_FORM"]}),a.jsxs("button",{onClick:()=>r(!n),className:`px-4 py-2 rounded-full font-bold text-sm transition-all duration-300 flex items-center gap-2 ${n?"bg-cyan-500 text-black shadow-[0_0_15px_rgba(6,182,212,0.5)]":"bg-gray-800 text-cyan-400 border border-cyan-500/30"}`,children:[a.jsx(Lw,{size:16}),n?"CLOSE COMMS":"AI CO-PILOT"]})]})]}),a.jsxs("div",{className:"flex h-full relative",children:[a.jsxs("div",{className:`flex-1 p-6 transition-all duration-500 ${n?"w-2/3 pr-4":"w-full"}`,children:[a.jsxs("div",{className:"mb-6 p-4 bg-emerald-900/10 border border-emerald-500/20 rounded-xl flex items-start gap-3",children:[a.jsx(Xi,{className:"text-emerald-500 mt-1",size:20}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-emerald-400 font-bold text-sm uppercase tracking-wider",children:"System Status: Optimized"}),a.jsx("p",{className:"text-gray-400 text-xs mt-1 leading-relaxed",children:"You are currently test-driving the enterprise suite. Kick the tires. Check the bells and whistles. This is the golden ticket to seeing powerful features in action before committing."})]})]}),a.jsxs("div",{className:"space-y-3",children:[e.map(_=>a.jsxs("div",{onClick:()=>{t==null||t(_.id),C("ACCOUNT_ACCESS",`Accessed account ${_.mask}`)},className:"group p-5 bg-gray-900/50 border border-gray-800 rounded-2xl hover:border-cyan-500/40 hover:bg-gray-900 transition-all duration-300 cursor-pointer flex justify-between items-center shadow-lg relative overflow-hidden backdrop-blur-sm",children:[a.jsx("div",{className:"absolute inset-y-0 left-0 w-1 bg-cyan-500 scale-y-0 group-hover:scale-y-100 transition-transform origin-center duration-300"}),a.jsx("div",{className:"absolute -right-10 -top-10 w-32 h-32 bg-cyan-500/5 rounded-full blur-2xl group-hover:bg-cyan-500/10 transition-all"}),a.jsxs("div",{className:"flex items-center gap-5 relative z-10",children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-black border border-gray-800 flex items-center justify-center text-gray-500 group-hover:text-cyan-400 group-hover:border-cyan-500/30 transition-all shadow-inner",children:a.jsx(Y1,{size:22})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-base font-bold text-gray-100 group-hover:text-white tracking-tight",children:_.name}),a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a.jsxs("span",{className:"text-[10px] font-mono text-gray-500 uppercase tracking-tighter bg-black/50 px-1.5 py-0.5 rounded",children:["****",_.mask||"XXXX"]}),a.jsxs("span",{className:"text-[10px] font-bold text-emerald-500/80 uppercase px-1.5 py-0.5 bg-emerald-500/5 border border-emerald-500/20 rounded flex items-center gap-1",children:[a.jsx(ri,{size:8})," SYNCED"]})]})]})]}),a.jsxs("div",{className:"text-right relative z-10",children:[a.jsxs("p",{className:"text-lg font-mono font-bold text-white tracking-tight",children:["$",_.balance.toLocaleString()]}),a.jsxs("div",{className:"flex items-center justify-end gap-1 text-[10px] text-gray-500 group-hover:text-cyan-400 transition-colors font-bold tracking-widest mt-1",children:["INSPECT ",a.jsx(fk,{size:10})]})]})]},_.id)),e.length===0&&a.jsxs("div",{className:"py-20 text-center border-2 border-dashed border-gray-800 rounded-2xl",children:[a.jsx("div",{className:"text-gray-600 font-mono text-xs uppercase tracking-[0.2em] mb-2",children:"Zero Accounts Linked"}),a.jsx("button",{onClick:()=>m(!0),className:"text-cyan-500 hover:text-cyan-400 text-sm underline",children:"Initiate Setup Form"})]})]}),a.jsxs("div",{className:"mt-8 border-t border-gray-800 pt-6",children:[a.jsxs("h4",{className:"text-xs font-mono text-gray-500 uppercase mb-3 flex items-center gap-2",children:[a.jsx(rl,{size:12})," Audit Storage (Local)"]}),a.jsxs("div",{className:"bg-black rounded-lg border border-gray-800 p-2 max-h-32 overflow-y-auto font-mono text-[10px] text-gray-400 space-y-1 custom-scrollbar",children:[g.length===0&&a.jsx("div",{className:"text-gray-700 italic p-2",children:"No audit trails found."}),g.map(_=>a.jsxs("div",{className:"flex gap-2 border-b border-gray-900 pb-1 last:border-0",children:[a.jsxs("span",{className:"text-cyan-700",children:["[",_.timestamp.split("T")[1].split(".")[0],"]"]}),a.jsx("span",{className:"text-emerald-700",children:_.action}),a.jsx("span",{className:"text-gray-600 truncate",children:_.details})]},_.id))]})]})]}),a.jsxs("div",{className:`fixed inset-y-0 right-0 w-96 bg-gray-950 border-l border-gray-800 transform transition-transform duration-300 ease-in-out z-50 shadow-2xl flex flex-col ${n?"translate-x-0":"translate-x-full"}`,children:[a.jsxs("div",{className:"p-4 border-b border-gray-800 bg-gray-900 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-emerald-500 rounded-full animate-pulse"}),a.jsx("span",{className:"text-sm font-bold text-white tracking-wider",children:"AI CO-PILOT"})]}),a.jsx("button",{onClick:()=>r(!1),className:"text-gray-500 hover:text-white transition-colors",children:a.jsx(vh,{size:18})})]}),a.jsxs("div",{className:"px-4 py-2 bg-black border-b border-gray-800",children:[a.jsxs("div",{className:"flex items-center gap-2 text-gray-600 mb-1",children:[a.jsx(eT,{size:10}),a.jsx("span",{className:"text-[10px] uppercase",children:"Gemini API Key (Optional for Sim)"})]}),a.jsx("input",{type:"password",value:o,onChange:_=>i(_.target.value),placeholder:"Enter key to go live...",className:"w-full bg-gray-900 border border-gray-800 rounded px-2 py-1 text-xs text-cyan-500 focus:outline-none focus:border-cyan-500/50"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 bg-black/50 custom-scrollbar",children:[s.map((_,T)=>a.jsx("div",{className:`flex ${_.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[85%] p-3 rounded-2xl text-sm leading-relaxed ${_.role==="user"?"bg-cyan-900/20 text-cyan-100 border border-cyan-500/20 rounded-tr-none":"bg-gray-900 text-gray-300 border border-gray-800 rounded-tl-none"}`,children:[_.role==="model"&&a.jsx(Bs,{size:12,className:"mb-1 text-emerald-500/50"}),_.text]})},T)),d&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-gray-900 p-3 rounded-2xl rounded-tl-none border border-gray-800 flex gap-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full animate-bounce"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full animate-bounce delay-75"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-gray-500 rounded-full animate-bounce delay-150"})]})}),a.jsx("div",{ref:S})]}),a.jsxs("div",{className:"p-4 bg-gray-900 border-t border-gray-800",children:[a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:c,onChange:_=>u(_.target.value),onKeyDown:_=>_.key==="Enter"&&I(),placeholder:"Ask about cash flow, fraud, or setup...",className:"w-full bg-black border border-gray-700 rounded-xl pl-4 pr-10 py-3 text-sm text-white focus:outline-none focus:border-cyan-500 transition-colors placeholder-gray-600"}),a.jsx("button",{onClick:I,className:"absolute right-2 top-2 p-1.5 bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg transition-colors",children:a.jsx(Lc,{size:14})})]}),a.jsx("div",{className:"mt-2 text-[10px] text-gray-600 text-center",children:"AI can make mistakes. Review generated financial advice."})]})]})]}),h&&a.jsx("div",{className:"absolute inset-0 z-[60] bg-black/80 backdrop-blur-sm flex items-center justify-center p-4",children:a.jsxs("div",{className:"bg-gray-900 border border-gray-700 w-full max-w-md rounded-2xl shadow-2xl overflow-hidden animate-in fade-in zoom-in duration-200",children:[a.jsxs("div",{className:"bg-gradient-to-r from-gray-800 to-gray-900 p-4 border-b border-gray-700 flex justify-between items-center",children:[a.jsxs("h3",{className:"text-white font-bold flex items-center gap-2",children:[a.jsx(ss,{className:"text-cyan-500",size:18}),"MANDATORY PO / AUDIT FORM"]}),a.jsx("button",{onClick:()=>m(!1),className:"text-gray-400 hover:text-white",children:a.jsx(vh,{size:20})})]}),a.jsxs("form",{onSubmit:N,className:"p-6 space-y-4",children:[a.jsx("div",{className:"p-3 bg-yellow-900/20 border border-yellow-700/30 rounded text-xs text-yellow-200/80 mb-4",children:"NOTICE: All interactions are recorded for the 2021 EIN Audit Trail. Please be specific."}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-mono text-gray-400 uppercase mb-1",children:"Action Type"}),a.jsxs("select",{value:x,onChange:_=>v(_.target.value),className:"w-full bg-black border border-gray-700 rounded-lg p-2.5 text-sm text-white focus:border-cyan-500 outline-none",required:!0,children:[a.jsx("option",{value:"",children:"Select Action..."}),a.jsx("option",{value:"CREATE_ACCOUNT",children:"Create New Account"}),a.jsx("option",{value:"TRANSFER_FUNDS",children:"Transfer Funds"}),a.jsx("option",{value:"GENERATE_REPORT",children:"Generate Report"}),a.jsx("option",{value:"TEST_DRIVE_FEATURE",children:"Test Drive Feature"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-xs font-mono text-gray-400 uppercase mb-1",children:"Justification / Details"}),a.jsx("textarea",{value:b,onChange:_=>w(_.target.value),className:"w-full bg-black border border-gray-700 rounded-lg p-2.5 text-sm text-white focus:border-cyan-500 outline-none h-24 resize-none",placeholder:"Describe the necessity of this action...",required:!0})]}),a.jsxs("div",{className:"pt-2 flex gap-3",children:[a.jsx("button",{type:"button",onClick:()=>m(!1),className:"flex-1 py-2.5 bg-transparent border border-gray-600 text-gray-300 rounded-lg hover:bg-gray-800 transition-colors text-sm font-bold",children:"CANCEL"}),a.jsxs("button",{type:"submit",className:"flex-1 py-2.5 bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg transition-colors text-sm font-bold flex items-center justify-center gap-2 shadow-[0_0_15px_rgba(8,145,178,0.4)]",children:[a.jsx(Hme,{size:16})," SUBMIT TO STORAGE"]})]})]})]})}),a.jsx("style",{children:` .custom-scrollbar::-webkit-scrollbar { width: 4px; } .custom-scrollbar::-webkit-scrollbar-track { bg: #000; } .custom-scrollbar::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #555; } `})]})},O1e=parseInt(f.version,10),Kr=e=>{if(O1e>=19){const t=n=>e(n,n.ref??null);return t.displayName=e.displayName??e.name,t}return f.forwardRef(e)},Is=wi,DFe=Is(a.jsx("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})),LFe=Is(a.jsx("path",{d:"M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"})),FFe=Is(a.jsx("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"})),zFe=Is(a.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),Cvr=Is(a.jsx("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})),BFe=Is(a.jsx("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39c.51-.66.04-1.61-.79-1.61H5.04c-.83 0-1.3.95-.79 1.61z"})),Nvr=Is(a.jsx("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}));Is(a.jsx("path",{d:"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"}));Is(a.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}));const jvr=Is(a.jsx("path",{d:"M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8"})),Evr=Is(a.jsx("path",{d:"M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7z"})),Ivr=Is(a.jsx("path",{d:"M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z"})),_vr=Is(a.jsx("rect",{width:"1",height:"24",x:"11.5",rx:"0.5"})),Pvr=Is(a.jsx("path",{d:"M4 15h16v-2H4v2zm0 4h16v-2H4v2zm0-8h16V9H4v2zm0-6v2h16V5H4z"})),Avr=Is(a.jsx("path",{d:"M21,8H3V4h18V8z M21,10H3v4h18V10z M21,16H3v4h18V16z"})),Tvr=Is(a.jsx("path",{d:"M4 18h17v-6H4v6zM4 5v6h17V5H4z"})),kvr=Is(a.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),HFe=Is(a.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),VFe=Is(a.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})),Mvr=Is(a.jsx("path",{d:"M19 13H5v-2h14v2z"})),Rvr=Is(a.jsx("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"})),UFe=Is(a.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),WFe=Is(a.jsx("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),Ovr=Is(a.jsx("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),$vr=Is(a.jsx("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"})),Dvr=Is(a.jsx("g",{children:a.jsx("path",{d:"M14.67,5v14H9.33V5H14.67z M15.67,19H21V5h-5.33V19z M8.33,19V5H3v14H8.33z"})})),GFe=Is(a.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"}));Is(a.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"}));const Lvr=Is(a.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12l1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"})),Fvr=Is(a.jsx("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"})),fxt=f.createContext(void 0),sr=()=>{const e=f.useContext(fxt);if(!e)throw new Error("MUI X: useGridRootProps should only be used inside the DataGrid, DataGridPro or DataGridPremium component.");return e},zvr=["sortingOrder"],Bvr=f.memo(function(t){const{sortingOrder:n}=t,r=Zn(t,zvr),o=sr(),[i]=n,s=i==="asc"?o.slots.columnSortedAscendingIcon:o.slots.columnSortedDescendingIcon;return s?a.jsx(s,Se({},r)):null}),pxt=f.createContext(void 0);function Eo(){const e=f.useContext(pxt);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(` `));return e}const Hvr=new TextEncoder;let VB=2*1024,XO=new ArrayBuffer(VB),Bne=new Uint8Array(XO),ej=new Int32Array(XO);const Vvr=Uvr;function Uvr(e){const t=e.length*2;t>VB&&(VB=t+(4-t%4),XO=new ArrayBuffer(VB),Bne=new Uint8Array(XO),ej=new Int32Array(XO));const n=Hvr.encodeInto(e,Bne).written,r=0,o=n|0;let i=0,s=(r+o|0)+374761393|0;if(o<16)for(;(i+3|0)>>15,2246822519),s=Math.imul(s^s>>>13,3266489917),((s^s>>>16)>>>0).toString()}function bx(e,t){return e<>>32-t}const hxt={values:{xs:0,sm:600,md:900,lg:1200,xl:1536},up:e=>{const t=hxt.values;return`@media (min-width:${typeof t[e]=="number"?t[e]:e}px)`}},mxt={spacingUnit:"--DataGrid-t-spacing-unit",colors:{border:{base:"--DataGrid-t-color-border-base"},foreground:{base:"--DataGrid-t-color-foreground-base",muted:"--DataGrid-t-color-foreground-muted",accent:"--DataGrid-t-color-foreground-accent",disabled:"--DataGrid-t-color-foreground-disabled",error:"--DataGrid-t-color-foreground-error"},background:{base:"--DataGrid-t-color-background-base",overlay:"--DataGrid-t-color-background-overlay",backdrop:"--DataGrid-t-color-background-backdrop"},interactive:{hover:"--DataGrid-t-color-interactive-hover",hoverOpacity:"--DataGrid-t-color-interactive-hover-opacity",focus:"--DataGrid-t-color-interactive-focus",focusOpacity:"--DataGrid-t-color-interactive-focus-opacity",disabled:"--DataGrid-t-color-interactive-disabled",disabledOpacity:"--DataGrid-t-color-interactive-disabled-opacity",selected:"--DataGrid-t-color-interactive-selected",selectedOpacity:"--DataGrid-t-color-interactive-selected-opacity"}},header:{background:{base:"--DataGrid-t-header-background-base"}},cell:{background:{pinned:"--DataGrid-t-cell-background-pinned"}},radius:{base:"--DataGrid-t-radius-base"},typography:{font:{body:"--DataGrid-t-typography-font-body",small:"--DataGrid-t-typography-font-small",large:"--DataGrid-t-typography-font-large"},fontFamily:{base:"--DataGrid-t-typography-font-family-base"},fontWeight:{light:"--DataGrid-t-typography-font-weight-light",regular:"--DataGrid-t-typography-font-weight-regular",medium:"--DataGrid-t-typography-font-weight-medium",bold:"--DataGrid-t-typography-font-weight-bold"}},transitions:{easing:{easeIn:"--DataGrid-t-transition-easing-ease-in",easeOut:"--DataGrid-t-transition-easing-ease-out",easeInOut:"--DataGrid-t-transition-easing-ease-in-out"},duration:{short:"--DataGrid-t-transition-duration-short",base:"--DataGrid-t-transition-duration-base",long:"--DataGrid-t-transition-duration-long"}},shadows:{base:"--DataGrid-t-shadow-base",overlay:"--DataGrid-t-shadow-overlay"},zIndex:{panel:"--DataGrid-t-z-index-panel",menu:"--DataGrid-t-z-index-menu"}},Wvr=gxt(mxt),fr=Se({breakpoints:hxt,spacing:Gvr,transition:qvr,keys:mxt},Wvr);function Gvr(e,t,n,r){return e===void 0?wx(1):t===void 0?wx(e):n===void 0?wx(e)+" "+wx(t):r===void 0?wx(e)+" "+wx(t)+" "+wx(n):wx(e)+" "+wx(t)+" "+wx(n)+" "+wx(r)}function wx(e){return e===0?"0":`calc(var(--DataGrid-t-spacing-unit) * ${e})`}function qvr(e,t){const{duration:n=fr.transitions.duration.base,easing:r=fr.transitions.easing.easeInOut,delay:o=0}=t??{};return e.map(i=>`${i} ${n} ${r} ${o}ms`).join(", ")}function gxt(e){if(typeof e=="string")return`var(${e})`;const t={};for(const n in e)Object.hasOwn(e,n)&&(t[n]=gxt(e[n]));return t}function ii(e){return _r("MuiDataGrid",e)}const Be=Pr("MuiDataGrid",["aiAssistantPanel","aiAssistantPanelHeader","aiAssistantPanelTitleContainer","aiAssistantPanelTitle","aiAssistantPanelBody","aiAssistantPanelEmptyText","aiAssistantPanelFooter","aiAssistantPanelConversation","aiAssistantPanelConversationList","aiAssistantPanelConversationTitle","aiAssistantPanelSuggestions","aiAssistantPanelSuggestionsList","aiAssistantPanelSuggestionsItem","aiAssistantPanelSuggestionsLabel","actionsCell","aggregationColumnHeader","aggregationColumnHeader--alignLeft","aggregationColumnHeader--alignCenter","aggregationColumnHeader--alignRight","aggregationColumnHeaderLabel","aggregationRowOverlayWrapper","autoHeight","autosizing","mainContent","withSidePanel","booleanCell","cell--editable","cell--editing","cell--flex","cell--textCenter","cell--textLeft","cell--textRight","cell--rangeTop","cell--rangeBottom","cell--rangeLeft","cell--rangeRight","cell--pinnedLeft","cell--pinnedRight","cell--selectionMode","cell","cellCheckbox","cellEmpty","cellSkeleton","cellOffsetLeft","checkboxInput","collapsible","collapsibleTrigger","collapsibleIcon","collapsiblePanel","columnHeader","columnHeader--alignCenter","columnHeader--alignLeft","columnHeader--alignRight","columnHeader--dragging","columnHeader--moving","columnHeader--numeric","columnHeader--sortable","columnHeader--sorted","columnHeader--filtered","columnHeader--pinnedLeft","columnHeader--pinnedRight","columnHeader--last","columnHeader--siblingFocused","columnHeader--filter","columnHeaderFilterInput","columnHeaderFilterOperatorLabel","columnHeaderCheckbox","columnHeaderDraggableContainer","columnHeaderTitle","columnHeaderTitleContainer","columnHeaderTitleContainerContent","columnHeader--filledGroup","columnHeader--emptyGroup","columnHeaders","columnSeparator--resizable","columnSeparator--resizing","columnSeparator--sideLeft","columnSeparator--sideRight","columnSeparator","columnsManagement","columnsManagementRow","columnsManagementHeader","columnsManagementSearchInput","columnsManagementFooter","columnsManagementScrollArea","columnsManagementEmptyText","container--top","container--bottom","detailPanel","detailPanelToggleCell","detailPanelToggleCell--expanded","footerCell","panel","panelHeader","panelWrapper","panelContent","panelFooter","paper","editBooleanCell","editInputCell","filler","filler--borderBottom","filler--pinnedLeft","filler--pinnedRight","filterForm","filterFormDeleteIcon","filterFormLogicOperatorInput","filterFormColumnInput","filterFormOperatorInput","filterFormValueInput","filterIcon","footerContainer","headerFilterRow","iconButtonContainer","iconSeparator","main","main--hasPinnedRight","main--hiddenContent","menu","menuIcon","menuIconButton","menuOpen","menuList","overlay","overlayWrapper","overlayWrapperInner","root","root--densityStandard","root--densityComfortable","root--densityCompact","root--disableUserSelection","root--noToolbar","row","row--editable","row--editing","row--firstVisible","row--lastVisible","row--dragging","row--beingDragged","row--dynamicHeight","row--detailPanelExpanded","row--borderBottom","rowReorderCellPlaceholder","rowCount","rowReorderCellContainer","rowReorderCell","rowReorderCell--draggable","rowReorderIcon","rowSkeleton","scrollArea--left","scrollArea--right","scrollArea--up","scrollArea--down","scrollArea","scrollbar","scrollbar--vertical","scrollbar--horizontal","scrollbarFiller","scrollbarFiller--pinnedRight","scrollShadow","scrollShadow--vertical","scrollShadow--horizontal","selectedRowCount","sortButton","sortIcon","shadowScrollArea","sidebar","sidebarHeader","toolbarContainer","toolbar","toolbarLabel","toolbarDivider","toolbarFilterList","toolbarQuickFilter","toolbarQuickFilterTrigger","toolbarQuickFilterControl","virtualScroller","virtualScroller--hasScrollX","virtualScrollerContent","virtualScrollerContent--overflowed","virtualScrollerRenderZone","withVerticalBorder","withBorderColor","cell--withRightBorder","cell--withLeftBorder","columnHeader--withRightBorder","columnHeader--withLeftBorder","treeDataGroupingCell","treeDataGroupingCellToggle","treeDataGroupingCellLoadingContainer","groupingCriteriaCell","groupingCriteriaCellToggle","groupingCriteriaCellLoadingContainer","pinnedRows","pinnedRows--top","pinnedRows--bottom","pivotPanelAvailableFields","pivotPanelField","pivotPanelField--sorted","pivotPanelFieldActionContainer","pivotPanelFieldCheckbox","pivotPanelFieldDragIcon","pivotPanelFieldList","pivotPanelFieldName","pivotPanelHeader","pivotPanelPlaceholder","pivotPanelScrollArea","pivotPanelSearchContainer","pivotPanelSection","pivotPanelSectionTitle","pivotPanelSections","pivotPanelSwitch","pivotPanelSwitchLabel","prompt","promptContent","promptText","promptFeedback","promptChangeList","promptChangesToggle","promptChangesToggleIcon","promptIcon","promptIconContainer","promptError","promptAction"]),Kvr=Object.is;function xxt(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=0,r=0;for(const o in e)if(n+=1,!Kvr(e[o],t[o])||!(o in t))return!1;for(const o in t)r+=1;return n===r}var $1e=oQe();const Yvr=Object.is,yxt=xxt,Xvr=(e,t)=>e===t?!0:e.length===t.length&&e.every((n,r)=>n===t[r]),Qvr=(e,t)=>{let n=Object.is;return t instanceof Array?n=Xvr:t instanceof Object&&(n=yxt),n(e,t)},Jvr=()=>({state:null,equals:null,selector:null,args:void 0}),qFe=[],Zvr=()=>null;function Fn(e,t,n=void 0,r=Yvr){e.current.state;const o=gm(Jvr),i=o.current.selector!==null,[s,l]=f.useState(i?null:t(e,n));o.current.state=s,o.current.equals=r,o.current.selector=t;const c=o.current.args;if(o.current.args=n,i&&!Qvr(c,n)){const p=o.current.selector(e,o.current.args);o.current.equals(o.current.state,p)||(o.current.state=p,l(p))}const u=f.useCallback(()=>(o.current.subscription||(o.current.subscription=e.current.store.subscribe(()=>{const p=o.current.selector(e,o.current.args);o.current.equals(o.current.state,p)||(o.current.state=p,l(p))})),null),qFe),d=f.useCallback(()=>(o.current.subscription||u(),()=>{o.current.subscription&&(o.current.subscription(),o.current.subscription=void 0)}),qFe);return $1e.useSyncExternalStore(d,u,Zvr),s}const vxt=f.createContext(void 0);function Th(){const e=f.useContext(vxt);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid private context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(` `));return e}const ebr=10,c9=-5,k_=1,KFe={width:3,rx:1.5,x:10.5},tbr="/* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */",nbr=e=>e.current.state.dimensions.isReady?e.current.state.dimensions.hasScrollX&&(!e.current.state.dimensions.hasScrollY||e.current.state.dimensions.scrollbarSize===0):e.current.state.dimensions.scrollbarSize===0,rbr=Bt("div",{name:"MuiDataGrid",slot:"Root",overridesResolver:(e,t)=>[t.root,{[`&.${Be.autoHeight}`]:t.autoHeight},{[`&.${Be.autosizing}`]:t.autosizing},{[`&.${Be["root--densityStandard"]}`]:t["root--densityStandard"]},{[`&.${Be["root--densityComfortable"]}`]:t["root--densityComfortable"]},{[`&.${Be["root--densityCompact"]}`]:t["root--densityCompact"]},{[`&.${Be["root--disableUserSelection"]}`]:t["root--disableUserSelection"]},{[`&.${Be["root--noToolbar"]}`]:t["root--noToolbar"]},{[`&.${Be.withVerticalBorder}`]:t.withVerticalBorder},{[`& .${Be.actionsCell}`]:t.actionsCell},{[`& .${Be.booleanCell}`]:t.booleanCell},{[`& .${Be.cell}`]:t.cell},{[`& .${Be["cell--editable"]}`]:t["cell--editable"]},{[`& .${Be["cell--editing"]}`]:t["cell--editing"]},{[`& .${Be["cell--flex"]}`]:t["cell--flex"]},{[`& .${Be["cell--pinnedLeft"]}`]:t["cell--pinnedLeft"]},{[`& .${Be["cell--pinnedRight"]}`]:t["cell--pinnedRight"]},{[`& .${Be["cell--rangeBottom"]}`]:t["cell--rangeBottom"]},{[`& .${Be["cell--rangeLeft"]}`]:t["cell--rangeLeft"]},{[`& .${Be["cell--rangeRight"]}`]:t["cell--rangeRight"]},{[`& .${Be["cell--rangeTop"]}`]:t["cell--rangeTop"]},{[`& .${Be["cell--selectionMode"]}`]:t["cell--selectionMode"]},{[`& .${Be["cell--textCenter"]}`]:t["cell--textCenter"]},{[`& .${Be["cell--textLeft"]}`]:t["cell--textLeft"]},{[`& .${Be["cell--textRight"]}`]:t["cell--textRight"]},{[`& .${Be["cell--withLeftBorder"]}`]:t["cell--withLeftBorder"]},{[`& .${Be["cell--withRightBorder"]}`]:t["cell--withRightBorder"]},{[`& .${Be.cellCheckbox}`]:t.cellCheckbox},{[`& .${Be.cellEmpty}`]:t.cellEmpty},{[`& .${Be.cellOffsetLeft}`]:t.cellOffsetLeft},{[`& .${Be.cellSkeleton}`]:t.cellSkeleton},{[`& .${Be.checkboxInput}`]:t.checkboxInput},{[`& .${Be.columnHeader}`]:t.columnHeader},{[`& .${Be["columnHeader--alignCenter"]}`]:t["columnHeader--alignCenter"]},{[`& .${Be["columnHeader--alignLeft"]}`]:t["columnHeader--alignLeft"]},{[`& .${Be["columnHeader--alignRight"]}`]:t["columnHeader--alignRight"]},{[`& .${Be["columnHeader--dragging"]}`]:t["columnHeader--dragging"]},{[`& .${Be["columnHeader--emptyGroup"]}`]:t["columnHeader--emptyGroup"]},{[`& .${Be["columnHeader--filledGroup"]}`]:t["columnHeader--filledGroup"]},{[`& .${Be["columnHeader--filtered"]}`]:t["columnHeader--filtered"]},{[`& .${Be["columnHeader--last"]}`]:t["columnHeader--last"]},{[`& .${Be["columnHeader--moving"]}`]:t["columnHeader--moving"]},{[`& .${Be["columnHeader--numeric"]}`]:t["columnHeader--numeric"]},{[`& .${Be["columnHeader--pinnedLeft"]}`]:t["columnHeader--pinnedLeft"]},{[`& .${Be["columnHeader--pinnedRight"]}`]:t["columnHeader--pinnedRight"]},{[`& .${Be["columnHeader--siblingFocused"]}`]:t["columnHeader--siblingFocused"]},{[`& .${Be["columnHeader--sortable"]}`]:t["columnHeader--sortable"]},{[`& .${Be["columnHeader--sorted"]}`]:t["columnHeader--sorted"]},{[`& .${Be["columnHeader--withLeftBorder"]}`]:t["columnHeader--withLeftBorder"]},{[`& .${Be["columnHeader--withRightBorder"]}`]:t["columnHeader--withRightBorder"]},{[`& .${Be.columnHeaderCheckbox}`]:t.columnHeaderCheckbox},{[`& .${Be.columnHeaderDraggableContainer}`]:t.columnHeaderDraggableContainer},{[`& .${Be.columnHeaderTitleContainer}`]:t.columnHeaderTitleContainer},{[`& .${Be.columnHeaderTitleContainerContent}`]:t.columnHeaderTitleContainerContent},{[`& .${Be.columnSeparator}`]:t.columnSeparator},{[`& .${Be["columnSeparator--resizable"]}`]:t["columnSeparator--resizable"]},{[`& .${Be["columnSeparator--resizing"]}`]:t["columnSeparator--resizing"]},{[`& .${Be["columnSeparator--sideLeft"]}`]:t["columnSeparator--sideLeft"]},{[`& .${Be["columnSeparator--sideRight"]}`]:t["columnSeparator--sideRight"]},{[`& .${Be["container--bottom"]}`]:t["container--bottom"]},{[`& .${Be["container--top"]}`]:t["container--top"]},{[`& .${Be.detailPanelToggleCell}`]:t.detailPanelToggleCell},{[`& .${Be["detailPanelToggleCell--expanded"]}`]:t["detailPanelToggleCell--expanded"]},{[`& .${Be.editBooleanCell}`]:t.editBooleanCell},{[`& .${Be.filterIcon}`]:t.filterIcon},{[`& .${Be["filler--borderBottom"]}`]:t["filler--borderBottom"]},{[`& .${Be["filler--pinnedLeft"]}`]:t["filler--pinnedLeft"]},{[`& .${Be["filler--pinnedRight"]}`]:t["filler--pinnedRight"]},{[`& .${Be.groupingCriteriaCell}`]:t.groupingCriteriaCell},{[`& .${Be.groupingCriteriaCellLoadingContainer}`]:t.groupingCriteriaCellLoadingContainer},{[`& .${Be.groupingCriteriaCellToggle}`]:t.groupingCriteriaCellToggle},{[`& .${Be.headerFilterRow}`]:t.headerFilterRow},{[`& .${Be.iconSeparator}`]:t.iconSeparator},{[`& .${Be.menuIcon}`]:t.menuIcon},{[`& .${Be.menuIconButton}`]:t.menuIconButton},{[`& .${Be.menuList}`]:t.menuList},{[`& .${Be.menuOpen}`]:t.menuOpen},{[`& .${Be.overlayWrapperInner}`]:t.overlayWrapperInner},{[`& .${Be.pinnedRows}`]:t.pinnedRows},{[`& .${Be["pinnedRows--bottom"]}`]:t["pinnedRows--bottom"]},{[`& .${Be["pinnedRows--top"]}`]:t["pinnedRows--top"]},{[`& .${Be.row}`]:t.row},{[`& .${Be["row--borderBottom"]}`]:t["row--borderBottom"]},{[`& .${Be["row--detailPanelExpanded"]}`]:t["row--detailPanelExpanded"]},{[`& .${Be["row--dragging"]}`]:t["row--dragging"]},{[`& .${Be["row--dynamicHeight"]}`]:t["row--dynamicHeight"]},{[`& .${Be["row--editable"]}`]:t["row--editable"]},{[`& .${Be["row--editing"]}`]:t["row--editing"]},{[`& .${Be["row--firstVisible"]}`]:t["row--firstVisible"]},{[`& .${Be["row--lastVisible"]}`]:t["row--lastVisible"]},{[`& .${Be.rowReorderCell}`]:t.rowReorderCell},{[`& .${Be["rowReorderCell--draggable"]}`]:t["rowReorderCell--draggable"]},{[`& .${Be.rowReorderCellContainer}`]:t.rowReorderCellContainer},{[`& .${Be.rowReorderCellPlaceholder}`]:t.rowReorderCellPlaceholder},{[`& .${Be.rowSkeleton}`]:t.rowSkeleton},{[`& .${Be.scrollbar}`]:t.scrollbar},{[`& .${Be["scrollbar--horizontal"]}`]:t["scrollbar--horizontal"]},{[`& .${Be["scrollbar--vertical"]}`]:t["scrollbar--vertical"]},{[`& .${Be.scrollbarFiller}`]:t.scrollbarFiller},{[`& .${Be["scrollbarFiller--pinnedRight"]}`]:t["scrollbarFiller--pinnedRight"]},{[`& .${Be.sortIcon}`]:t.sortIcon},{[`& .${Be.treeDataGroupingCell}`]:t.treeDataGroupingCell},{[`& .${Be.treeDataGroupingCellLoadingContainer}`]:t.treeDataGroupingCellLoadingContainer},{[`& .${Be.treeDataGroupingCellToggle}`]:t.treeDataGroupingCellToggle},{[`& .${Be.withBorderColor}`]:t.withBorderColor},{[`& .${Be["row--beingDragged"]}`]:t["row--beingDragged"]}]})(()=>{const e=Th(),t=Fn(e,nbr),n=fr.colors.background.base,r=fr.header.background.base,o=fr.cell.background.pinned,i=obr(fr.colors.interactive.hover),s=fr.colors.interactive.hoverOpacity,l=fr.colors.interactive.selected,c=fr.colors.interactive.selectedOpacity,u=l,d=`calc(${c} + ${s})`,p={hover:fr.colors.interactive.hover,selected:l,selectedHover:l},h=RS(n,i,s,p.hover),m=RS(n,l,c,p.selected),g=RS(n,u,d,p.selectedHover),y=RS(o,i,s,p.hover),x=RS(o,l,c,p.selected),v=RS(o,u,d,p.selectedHover),b=I=>({[`& .${Be["cell--pinnedLeft"]}, & .${Be["cell--pinnedRight"]}`]:{backgroundColor:I,"&.Mui-selected":{backgroundColor:RS(I,m,c,p.selected),"&:hover":{backgroundColor:RS(I,g,d,p.selectedHover)}}}}),w=b(y),S=b(x),C=b(v),N={backgroundColor:m,"&:hover":{backgroundColor:g,"@media (hover: none)":{backgroundColor:m}}};return{"--unstable_DataGrid-radius":fr.radius.base,"--unstable_DataGrid-headWeight":fr.typography.fontWeight.medium,"--DataGrid-rowBorderColor":fr.colors.border.base,"--DataGrid-cellOffsetMultiplier":2,"--DataGrid-width":"0px","--DataGrid-hasScrollX":"0","--DataGrid-hasScrollY":"0","--DataGrid-scrollbarSize":"10px","--DataGrid-rowWidth":"0px","--DataGrid-columnsTotalWidth":"0px","--DataGrid-leftPinnedWidth":"0px","--DataGrid-rightPinnedWidth":"0px","--DataGrid-headerHeight":"0px","--DataGrid-headersTotalHeight":"0px","--DataGrid-topContainerHeight":"0px","--DataGrid-bottomContainerHeight":"0px",flex:1,boxSizing:"border-box",position:"relative",borderWidth:"1px",borderStyle:"solid",borderColor:fr.colors.border.base,borderRadius:"var(--unstable_DataGrid-radius)",backgroundColor:fr.colors.background.base,color:fr.colors.foreground.base,font:fr.typography.font.body,outline:"none",height:"100%",display:"flex",minWidth:0,minHeight:0,flexDirection:"column",overflow:"hidden",overflowAnchor:"none",transform:"translate(0, 0)",[`.${Be.main} > *:first-child${tbr}`]:{borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"},[`&.${Be.autoHeight}`]:{height:"auto"},[`&.${Be.autosizing}`]:{[`& .${Be.columnHeaderTitleContainerContent} > *`]:{overflow:"visible !important"},"@media (hover: hover)":{[`& .${Be.menuIcon}`]:{width:"0 !important",visibility:"hidden !important"}},[`& .${Be.cell}`]:{overflow:"visible !important",whiteSpace:"nowrap",minWidth:"max-content !important",maxWidth:"max-content !important"},[`& .${Be.groupingCriteriaCell}`]:{width:"unset"},[`& .${Be.treeDataGroupingCell}`]:{width:"unset"},[`& .${Be["columnHeader--filter"]}`]:{flex:"none !important",width:"unset !important"}},[`&.${Be.withSidePanel}`]:{flexDirection:"row"},[`& .${Be.mainContent}`]:{display:"flex",flexDirection:"column",overflow:"hidden",flex:1},[`& .${Be.columnHeader}, & .${Be.cell}`]:{WebkitTapHighlightColor:"transparent",padding:"0 10px",boxSizing:"border-box"},[`& .${Be.columnHeader}:focus-within, & .${Be.cell}:focus-within`]:{outline:`solid ${bxt(fr.colors.interactive.focus,.5)} ${k_}px`,outlineOffset:k_*-1},[`& .${Be.columnHeader}:focus, & .${Be.cell}:focus`]:{outline:`solid ${fr.colors.interactive.focus} ${k_}px`,outlineOffset:k_*-1},[`& .${Be.columnHeader}:focus, & .${Be["columnHeader--withLeftBorder"]}, & .${Be["columnHeader--withRightBorder"]}, & .${Be["columnHeader--siblingFocused"]} `]:{[`& .${Be.columnSeparator}`]:{opacity:0},"@media (hover: none)":{[`& .${Be["columnSeparator--resizable"]}`]:{opacity:1}},[`& .${Be["columnSeparator--resizable"]}:hover`]:{opacity:1}},[`&.${Be["root--noToolbar"]} [aria-rowindex="1"] [aria-colindex="1"]`]:{borderTopLeftRadius:"calc(var(--unstable_DataGrid-radius) - 1px)"},[`&.${Be["root--noToolbar"]} [aria-rowindex="1"] .${Be["columnHeader--last"]}`]:{borderTopRightRadius:t?"calc(var(--unstable_DataGrid-radius) - 1px)":void 0},[`& .${Be.columnHeaderCheckbox}, & .${Be.cellCheckbox}`]:{padding:0,justifyContent:"center",alignItems:"center"},[`& .${Be.columnHeader}`]:{position:"relative",display:"flex",alignItems:"center",backgroundColor:r},[`& .${Be.columnHeader} .${Be.sortButton}`]:{backgroundColor:fr.header.background.base},[`& .${Be["columnHeader--filter"]}`]:{paddingTop:8,paddingBottom:8,paddingRight:5,minHeight:"min-content",overflow:"hidden"},[`&.${Be["root--densityCompact"]} .${Be["columnHeader--filter"]}`]:{paddingTop:4,paddingBottom:4},[`& .${Be["virtualScroller--hasScrollX"]} .${Be["columnHeader--last"]}`]:{overflow:"hidden"},[`& .${Be["pivotPanelField--sorted"]} .${Be.iconButtonContainer}, & .${Be["columnHeader--sorted"]} .${Be.iconButtonContainer}, & .${Be["columnHeader--filtered"]} .${Be.iconButtonContainer}`]:{visibility:"visible",width:"auto"},[`& .${Be.pivotPanelField}:not(.${Be["pivotPanelField--sorted"]}) .${Be.sortButton}, & .${Be.columnHeader}:not(.${Be["columnHeader--sorted"]}) .${Be.sortButton}`]:{opacity:0,transition:fr.transition(["opacity"],{duration:fr.transitions.duration.short})},[`& .${Be.columnHeaderTitleContainer}`]:{display:"flex",alignItems:"center",gap:fr.spacing(.25),minWidth:0,flex:1,whiteSpace:"nowrap",overflow:"hidden"},[`& .${Be.columnHeaderTitleContainerContent}`]:{overflow:"hidden",display:"flex",alignItems:"center"},[`& .${Be["columnHeader--filledGroup"]} .${Be.columnHeaderTitleContainer}`]:{borderBottomWidth:"1px",borderBottomStyle:"solid",boxSizing:"border-box"},[`& .${Be.sortIcon}, & .${Be.filterIcon}`]:{fontSize:"inherit"},[`& .${Be["columnHeader--sortable"]}`]:{cursor:"pointer"},[`& .${Be["columnHeader--alignCenter"]} .${Be.columnHeaderTitleContainer}`]:{justifyContent:"center"},[`& .${Be["columnHeader--alignRight"]} .${Be.columnHeaderDraggableContainer}, & .${Be["columnHeader--alignRight"]} .${Be.columnHeaderTitleContainer}`]:{flexDirection:"row-reverse"},[`& .${Be["columnHeader--alignCenter"]} .${Be.menuIcon}`]:{marginLeft:"auto"},[`& .${Be["columnHeader--alignRight"]} .${Be.menuIcon}`]:{marginRight:"auto",marginLeft:-5},[`& .${Be["columnHeader--moving"]}`]:{backgroundColor:h},[`& .${Be["columnHeader--pinnedLeft"]}, & .${Be["columnHeader--pinnedRight"]}`]:{position:"sticky",zIndex:40,background:fr.header.background.base},[`& .${Be.columnSeparator}`]:{position:"absolute",overflow:"hidden",zIndex:30,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",maxWidth:ebr,color:fr.colors.border.base},[`& .${Be.columnHeaders}`]:{width:"var(--DataGrid-rowWidth)",backgroundColor:r},"@media (hover: hover)":{[`& .${Be.columnHeader}:hover`]:{[`& .${Be.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${Be.iconButtonContainer}`]:{visibility:"visible",width:"auto"}},[`& .${Be.columnHeader}:not(.${Be["columnHeader--sorted"]}):hover .${Be.sortButton}, & .${Be.pivotPanelField}:not(.${Be["pivotPanelField--sorted"]}):hover .${Be.sortButton}, & .${Be.pivotPanelField}:not(.${Be["pivotPanelField--sorted"]}) .${Be.sortButton}:focus-visible`]:{opacity:1},[`& .${Be.columnHeader}:not(.${Be["columnHeader--sorted"]}):hover .${Be.sortButton} > *, & .${Be.pivotPanelField}:not(.${Be["pivotPanelField--sorted"]}):hover .${Be.sortButton} > *, & .${Be.pivotPanelField}:not(.${Be["pivotPanelField--sorted"]}) .${Be.sortButton}:focus-visible > *`]:{opacity:.78},[`& .${Be.pivotPanelFieldActionContainer} button:hover`]:{backgroundColor:fr.colors.background.base}},"@media (hover: none)":{[`& .${Be.columnHeader} .${Be.menuIcon}`]:{width:"auto",visibility:"visible"},[`& .${Be.columnHeader}:focus, & .${Be["columnHeader--siblingFocused"]}`]:{[`.${Be["columnSeparator--resizable"]}`]:{color:fr.colors.foreground.accent}},[`& .${Be.pivotPanelField}:not(.${Be["pivotPanelField--sorted"]}) .${Be.sortButton}`]:{opacity:.78}},[`& .${Be["columnHeader--withLeftBorder"]} .${Be["columnSeparator--sideLeft"]}:not(.${Be["columnSeparator--resizable"]}), & .${Be["columnHeader--withRightBorder"]} .${Be["columnSeparator--sideRight"]}:not(.${Be["columnSeparator--resizable"]})`]:{display:"none"},[`& .${Be["columnSeparator--sideLeft"]}`]:{left:c9},[`& .${Be["columnSeparator--sideRight"]}`]:{right:c9},[`& .${Be["columnHeader--withRightBorder"]} .${Be["columnSeparator--sideLeft"]}`]:{left:c9-.5},[`& .${Be["columnHeader--withRightBorder"]} .${Be["columnSeparator--sideRight"]}`]:{right:c9-.5},[`& .${Be["columnSeparator--resizable"]}`]:{cursor:"col-resize",touchAction:"none",[`&.${Be["columnSeparator--resizing"]}`]:{color:fr.colors.foreground.accent},"@media (hover: none)":{[`& .${Be.iconSeparator} rect`]:KFe},"@media (hover: hover)":{"&:hover":{color:fr.colors.foreground.accent,[`& .${Be.iconSeparator} rect`]:KFe}},"& svg":{pointerEvents:"none"}},[`& .${Be.iconSeparator}`]:{color:"inherit",transition:fr.transition(["color","width"],{duration:fr.transitions.duration.short})},[`& .${Be.menuIcon}`]:{width:0,visibility:"hidden",fontSize:20,marginRight:-5,display:"flex",alignItems:"center"},[`.${Be.menuOpen}`]:{visibility:"visible",width:"auto"},[`& .${Be.headerFilterRow}`]:{[`& .${Be.columnHeader}, & .${Be.scrollbarFiller}`]:{boxSizing:"border-box",borderBottom:"1px solid var(--DataGrid-rowBorderColor)"}},[`& .${Be["row--borderBottom"]} .${Be.columnHeader}, & .${Be["row--borderBottom"]} .${Be.filler}, & .${Be["row--borderBottom"]} .${Be.scrollbarFiller}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${Be["row--borderBottom"]} .${Be.cell}`]:{borderBottom:"1px solid var(--rowBorderColor)"},[`.${Be.row}`]:{display:"flex",width:"var(--DataGrid-rowWidth)",breakInside:"avoid","--rowBorderColor":"var(--DataGrid-rowBorderColor)",[`&.${Be["row--firstVisible"]}`]:{"--rowBorderColor":"transparent"},"&:hover":{backgroundColor:h,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Be.rowSkeleton}:hover`]:{backgroundColor:"transparent"},"&.Mui-selected":N,position:"relative"},[`& .${Be.cell}`]:{flex:"0 0 auto",height:"var(--height)",width:"var(--width)",lineHeight:"calc(var(--height) - 1px)",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis","&.Mui-selected":N},[`& .${Be["virtualScrollerContent--overflowed"]} .${Be["row--lastVisible"]} .${Be.cell}`]:{borderTopColor:"transparent"},[`& .${Be.pinnedRows} .${Be.row}, .${Be.aggregationRowOverlayWrapper} .${Be.row}`]:{backgroundColor:o,"&:hover":{backgroundColor:y}},[`& .${Be["pinnedRows--top"]} :first-of-type`]:{[`& .${Be.cell}, .${Be.scrollbarFiller}`]:{borderTop:"none"}},[`&.${Be["root--disableUserSelection"]}`]:{userSelect:"none"},[`& .${Be["row--dynamicHeight"]} > .${Be.cell}`]:{whiteSpace:"initial",lineHeight:"inherit"},[`& .${Be.cellEmpty}`]:{flex:1,padding:0,height:"unset"},[`& .${Be.cell}.${Be["cell--selectionMode"]}`]:{cursor:"default"},[`& .${Be.cell}.${Be["cell--editing"]}`]:{padding:1,display:"flex",boxShadow:fr.shadows.base,backgroundColor:fr.colors.background.overlay,"&:focus-within":{outline:`${k_}px solid ${fr.colors.interactive.focus}`,outlineOffset:k_*-1}},[`& .${Be["cell--editing"]}`]:{"& .MuiInputBase-root":{height:"100%"}},[`& .${Be["row--editing"]}`]:{boxShadow:fr.shadows.base},[`& .${Be["row--editing"]} .${Be.cell}`]:{boxShadow:"none",backgroundColor:fr.colors.background.overlay},[`& .${Be.editBooleanCell}`]:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},[`& .${Be.booleanCell}[data-value="true"]`]:{color:fr.colors.foreground.muted},[`& .${Be.booleanCell}[data-value="false"]`]:{color:fr.colors.foreground.disabled},[`& .${Be.actionsCell}`]:{display:"inline-flex",alignItems:"center",gridGap:fr.spacing(1)},[`& .${Be.rowReorderCell}`]:{display:"inline-flex",flex:1,alignItems:"center",justifyContent:"center",opacity:fr.colors.interactive.disabledOpacity},[`& .${Be["rowReorderCell--draggable"]}`]:{cursor:"grab",opacity:1},[`& .${Be.rowReorderCellContainer}`]:{padding:0,display:"flex",alignItems:"stretch"},[`.${Be.withBorderColor}`]:{borderColor:fr.colors.border.base},[`& .${Be["cell--withLeftBorder"]}, & .${Be["columnHeader--withLeftBorder"]}`]:{borderLeftColor:"var(--DataGrid-rowBorderColor)",borderLeftWidth:"1px",borderLeftStyle:"solid"},[`& .${Be["cell--withRightBorder"]}, & .${Be["columnHeader--withRightBorder"]}`]:{borderRightColor:"var(--DataGrid-rowBorderColor)",borderRightWidth:"1px",borderRightStyle:"solid"},[`& .${Be["cell--flex"]}`]:{display:"flex",alignItems:"center",lineHeight:"inherit"},[`& .${Be["cell--textLeft"]}`]:{textAlign:"left",justifyContent:"flex-start"},[`& .${Be["cell--textRight"]}`]:{textAlign:"right",justifyContent:"flex-end"},[`& .${Be["cell--textCenter"]}`]:{textAlign:"center",justifyContent:"center"},[`& .${Be["cell--pinnedLeft"]}, & .${Be["cell--pinnedRight"]}`]:{position:"sticky",zIndex:30,background:fr.cell.background.pinned,"&.Mui-selected":{backgroundColor:x}},[`& .${Be.row}`]:{"&:hover":w,"&.Mui-selected":S,"&.Mui-selected:hover":C},[`& .${Be.cellOffsetLeft}`]:{flex:"0 0 auto",display:"inline-block"},[`& .${Be.cellSkeleton}`]:{flex:"0 0 auto",height:"100%",display:"inline-flex",alignItems:"center"},[`& .${Be.columnHeaderDraggableContainer}`]:{display:"flex",width:"100%",height:"100%"},[`& .${Be.rowReorderCellPlaceholder}`]:{display:"none"},[`& .${Be["columnHeader--dragging"]}`]:{background:fr.colors.background.overlay,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",opacity:fr.colors.interactive.disabledOpacity},[`& .${Be["row--dragging"]}`]:{background:fr.colors.background.overlay,padding:"0 12px",borderRadius:"var(--unstable_DataGrid-radius)",border:"1px solid var(--DataGrid-rowBorderColor)",color:fr.colors.foreground.base,transform:"translateZ(0)",[`& .${Be.rowReorderCellPlaceholder}`]:{padding:"0 6px",display:"flex"}},[`& .${Be.treeDataGroupingCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${Be.treeDataGroupingCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:fr.spacing(2)},[`& .${Be.treeDataGroupingCellLoadingContainer}, .${Be.groupingCriteriaCellLoadingContainer}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},[`& .${Be.groupingCriteriaCell}`]:{display:"flex",alignItems:"center",width:"100%"},[`& .${Be.groupingCriteriaCellToggle}`]:{flex:"0 0 28px",alignSelf:"stretch",marginRight:fr.spacing(2)},[`& .${Be.columnHeaders} .${Be.scrollbarFiller}`]:{backgroundColor:r},[`.${Be.scrollbarFiller}`]:{minWidth:"calc(var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",alignSelf:"stretch",backgroundColor:r,[`&.${Be["scrollbarFiller--pinnedRight"]}`]:{position:"sticky",zIndex:40,right:0}},[`& .${Be.filler}`]:{flex:"1 0 auto"},[`& .${Be["filler--borderBottom"]}`]:{borderBottom:"1px solid var(--DataGrid-rowBorderColor)"},[`& .${Be.columnHeaders} .${Be.filler}`]:{backgroundColor:r},[`& .${Be["main--hiddenContent"]}`]:{[`& .${Be.virtualScrollerContent}`]:{position:"fixed",visibility:"hidden"},[`& .${Be.pinnedRows}`]:{display:"none"}},[`& .${Be["row--beingDragged"]}`]:{color:fr.colors.foreground.disabled,"&:hover":{backgroundColor:"transparent"}}}});function bxt(e,t){return`rgba(from ${e} r g b / ${t})`}function obr(e){return bxt(e,1)}const ype=typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("color","color-mix(in srgb, red 50%, blue 50%)"),vpe=(e,t)=>ype?e:t;function RS(e,t,n,r){return vpe(`color-mix(in srgb,${e}, ${t} calc(${n} * 100%))`,r)}function ibr(){const e=xf();return f.useMemo(()=>{const t=Vvr(ubr(e)),n=abr(e);return{id:t,variables:n}},[e])}function abr(e){var y,x,v,b,w,S;const t=lbr(e),n=(e.vars||e).palette.DataGrid,r=(e.vars||e).palette.background.paper,o=(n==null?void 0:n.bg)??(e.palette.mode==="dark"?vpe(`color-mix(in srgb, ${r} 95%, #fff)`,r):r),i=(n==null?void 0:n.headerBg)??o,s=(n==null?void 0:n.pinnedBg)??o,l=e.vars?`rgba(${e.vars.palette.background.defaultChannel} / ${e.vars.palette.action.disabledOpacity})`:Na(e.palette.background.default,e.palette.action.disabledOpacity),c=e.palette.mode==="dark"?vpe(`color-mix(in srgb, ${r} 90%, #fff)`,r):r,u=e.vars?`rgb(${e.vars.palette.primary.mainChannel})`:e.palette.primary.main,d=sbr(e),p=((x=(y=e.vars)==null?void 0:y.font)==null?void 0:x.body2)??Hne(e.typography.body2),h=((b=(v=e.vars)==null?void 0:v.font)==null?void 0:b.caption)??Hne(e.typography.caption),m=((S=(w=e.vars)==null?void 0:w.font)==null?void 0:S.body1)??Hne(e.typography.body1),g=fr.keys;return{[g.spacingUnit]:e.vars?e.vars.spacing??e.spacing(1):e.spacing(1),[g.colors.border.base]:t,[g.colors.background.base]:o,[g.colors.background.overlay]:c,[g.colors.background.backdrop]:l,[g.colors.foreground.base]:(e.vars||e).palette.text.primary,[g.colors.foreground.muted]:(e.vars||e).palette.text.secondary,[g.colors.foreground.accent]:(e.vars||e).palette.primary.dark,[g.colors.foreground.disabled]:(e.vars||e).palette.text.disabled,[g.colors.foreground.error]:(e.vars||e).palette.error.dark,[g.colors.interactive.hover]:ype?(e.vars||e).palette.action.hover:(e.vars||e).palette.grey[e.palette.mode==="dark"?800:100],[g.colors.interactive.hoverOpacity]:(e.vars||e).palette.action.hoverOpacity,[g.colors.interactive.focus]:YFe((e.vars||e).palette.primary.main),[g.colors.interactive.focusOpacity]:(e.vars||e).palette.action.focusOpacity,[g.colors.interactive.disabled]:YFe((e.vars||e).palette.action.disabled),[g.colors.interactive.disabledOpacity]:(e.vars||e).palette.action.disabledOpacity,[g.colors.interactive.selected]:ype?u:(e.vars||e).palette.grey[e.palette.mode==="dark"?700:200],[g.colors.interactive.selectedOpacity]:(e.vars||e).palette.action.selectedOpacity,[g.header.background.base]:i,[g.cell.background.pinned]:s,[g.radius.base]:d,[g.typography.fontFamily.base]:e.typography.fontFamily,[g.typography.fontWeight.light]:e.typography.fontWeightLight,[g.typography.fontWeight.regular]:e.typography.fontWeightRegular,[g.typography.fontWeight.medium]:e.typography.fontWeightMedium,[g.typography.fontWeight.bold]:e.typography.fontWeightBold,[g.typography.font.body]:p,[g.typography.font.small]:h,[g.typography.font.large]:m,[g.transitions.easing.easeIn]:e.transitions.easing.easeIn,[g.transitions.easing.easeOut]:e.transitions.easing.easeOut,[g.transitions.easing.easeInOut]:e.transitions.easing.easeInOut,[g.transitions.duration.short]:`${e.transitions.duration.shorter}ms`,[g.transitions.duration.base]:`${e.transitions.duration.short}ms`,[g.transitions.duration.long]:`${e.transitions.duration.standard}ms`,[g.shadows.base]:(e.vars||e).shadows[2],[g.shadows.overlay]:(e.vars||e).shadows[8],[g.zIndex.panel]:(e.vars||e).zIndex.modal,[g.zIndex.menu]:(e.vars||e).zIndex.modal}}function sbr(e){return e.vars?e.vars.shape.borderRadius:typeof e.shape.borderRadius=="number"?`${e.shape.borderRadius}px`:e.shape.borderRadius}function lbr(e){return e.vars?e.vars.palette.TableCell.border:e.palette.mode==="light"?aL(Na(e.palette.divider,1),.88):iL(Na(e.palette.divider,1),.68)}function cbr(e,t){return`rgba(from ${e} r g b / ${t})`}function YFe(e){return cbr(e,1)}function Hne(e){if(!e)return;const t=typeof e.fontSize=="number"?`${e.fontSize}px`:e.fontSize;return`${e.fontWeight} ${t} / ${e.lineHeight} ${e.fontFamily}`}function ubr(e){const t=new WeakSet;return JSON.stringify(e,(n,r)=>{if(typeof window<"u"&&r===window||typeof document<"u"&&r===document)return r.toString();if(r!==null&&typeof r=="object"){if(f.isValidElement(r)||t.has(r))return null;t.add(r)}return r})}const dbr=["id","label","labelId","material","disabled","slotProps","onChange","onKeyDown","onOpen","onClose","size","style","fullWidth"],fbr=["onRowsPerPageChange","material","disabled"],pbr=["material"],hbr=["autoFocus","label","fullWidth","slotProps","className","material"],mbr=["material"],gbr=["material"],xbr=["material"],ybr=["material"],vbr=["material"],bbr=["material"],wbr=["material"],Sbr=["material"],Cbr=["material"],Nbr=["material","label","className"],jbr=["material"],Ebr=["inert","iconStart","iconEnd","children","material"],Ibr=["slotProps","material"],_br=["id","multiple","freeSolo","options","getOptionLabel","isOptionEqualToValue","value","onChange","label","placeholder","slotProps","material"],Pbr=["key"],Abr=["inputProps","InputProps","InputLabelProps"],Tbr=["slotProps","material"],kbr=["ref","open","children","className","clickAwayTouchEvent","clickAwayMouseEvent","flip","focusTrap","onExited","onClickAway","onDidShow","onDidHide","id","target","transition","placement","material"],Mbr=["native"],Rbr=["children","value","active"],Obr=["items","value","material"],XFe=Bt(mse,{slot:"internal"})(({theme:e})=>({[`&.${hse.positionEnd} .${lse.sizeSmall}`]:{marginRight:e.spacing(-.75)}})),wxt=Bt(rrt,{slot:"internal",shouldForwardProp:e=>e!=="fullWidth"})(({theme:e})=>({gap:e.spacing(.5),margin:0,overflow:"hidden",[`& .${EP.label}`]:{fontSize:e.typography.pxToRem(14),overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},variants:[{props:{fullWidth:!0},style:{width:"100%"}}]})),QFe=Bt(Zyn,{slot:"internal",shouldForwardProp:e=>e!=="density"})(({theme:e})=>({variants:[{props:{density:"compact"},style:{padding:e.spacing(.5)}}]})),$br=Bt(ah,{slot:"internal"})({[`& .${tE.primary}`]:{overflowX:"clip",textOverflow:"ellipsis",maxWidth:"300px"}}),Dbr=Kr(function(t,n){var N,j;const{id:r,label:o,labelId:i,material:s,disabled:l,slotProps:c,onChange:u,onKeyDown:d,onOpen:p,onClose:h,size:m,style:g,fullWidth:y}=t,x=Zn(t,dbr),b=((j=(N=xf().components)==null?void 0:N.MuiTextField)==null?void 0:j.defaultProps)??{},w=m??b.size,S=b.variant??"outlined",C={PaperProps:{onKeyDown:d}};return h&&(C.onClose=h),a.jsxs(k1,{size:w,fullWidth:y,style:g,disabled:l,ref:n,children:[a.jsx(O2,{id:i,htmlFor:r,shrink:!0,variant:S,children:o}),a.jsx(S0,Se({id:r,labelId:i,label:o,displayEmpty:!0,onChange:u,variant:S},x,{inputProps:c==null?void 0:c.htmlInput,onOpen:p,MenuProps:C,size:w},s))]})}),Lbr=Bt(nSn,{slot:"internal"})(({theme:e})=>({[`& .${OE.selectLabel}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"block"}},[`& .${OE.input}`]:{display:"none",[e.breakpoints.up("sm")]:{display:"inline-flex"}}})),Fbr=Kr(function(t,n){const{onRowsPerPageChange:r,material:o,disabled:i}=t,s=Zn(t,fbr),l=f.useMemo(()=>{if(i)return{backIconButtonProps:{disabled:!0},nextIconButtonProps:{disabled:!0}}},[i]),c=Eo(),u=sr(),{estimatedRowCount:d}=u;return a.jsx(Lbr,Se({component:"div",onRowsPerPageChange:no(p=>{r==null||r(Number(p.target.value))}),labelRowsPerPage:c.current.getLocaleText("paginationRowsPerPage"),labelDisplayedRows:p=>c.current.getLocaleText("paginationDisplayedRows")(Se({},p,{estimated:d})),getItemAriaLabel:c.current.getLocaleText("paginationItemAriaLabel")},l,s,o,{ref:n}))}),zbr=Kr(function(t,n){const{material:r}=t,o=Zn(t,pbr);return a.jsx(uyn,Se({},o,r,{ref:n}))}),Bbr=Kr(function(t,n){const{autoFocus:r,label:o,fullWidth:i,slotProps:s,className:l,material:c}=t,u=Zn(t,hbr),d=f.useRef(null),p=Di(d,n),h=f.useRef(null);return f.useEffect(()=>{var m;if(r){const g=(m=d.current)==null?void 0:m.querySelector("input");g==null||g.focus({preventScroll:!0})}else r===!1&&h.current&&h.current.stop({})},[r]),o?a.jsx(wxt,{className:l,control:a.jsx(QFe,Se({},u,c,{inputProps:s==null?void 0:s.htmlInput,ref:p,touchRippleRef:h})),label:o,fullWidth:i}):a.jsx(QFe,Se({},u,c,{className:be(l,c==null?void 0:c.className),inputProps:s==null?void 0:s.htmlInput,ref:p,touchRippleRef:h}))}),Hbr=Kr(function(t,n){const{material:r}=t,o=Zn(t,mbr);return a.jsx(su,Se({},o,r,{ref:n}))}),Vbr=Kr(function(t,n){const{material:r}=t,o=Zn(t,gbr);return a.jsx(Sw,Se({},o,r,{ref:n}))}),Ubr=Kr(function(t,n){const{material:r}=t,o=Zn(t,xbr);return a.jsx(a5,Se({},o,r,{ref:n}))}),Wbr=Kr(function(t,n){const{material:r}=t,o=Zn(t,ybr);return a.jsx(ta,Se({},o,r,{ref:n}))}),Gbr=Bt(kSn,{slot:"internal"})(({theme:e})=>({gap:e.spacing(1),border:0})),qbr=Kr(function(t,n){const{material:r}=t,o=Zn(t,vbr);return a.jsx(Gbr,Se({size:"small",color:"primary"},o,r,{ref:n}))}),Kbr=Kr(function(t,n){const{material:r}=t,o=Zn(t,bbr);return a.jsx(bh,Se({},o,r,{ref:n}))}),Ybr=Kr(function(t,n){const{material:r}=t,o=Zn(t,wbr);return a.jsx(Zs,Se({},o,r,{ref:n}))}),Xbr=Kr(function(t,n){const{material:r}=t,o=Zn(t,Sbr);return a.jsx(Rv,Se({},o,r,{ref:n}))}),Qbr=Kr(function(t,n){const{material:r}=t,o=Zn(t,Cbr);return a.jsx(q1n,Se({},o,r,{ref:n}))}),Jbr=Kr(function(t,n){const{material:r,label:o,className:i}=t,s=Zn(t,Nbr);return o?a.jsx(wxt,{className:i,control:a.jsx(Cse,Se({},s,r,{ref:n})),label:o}):a.jsx(Cse,Se({},s,r,{className:i,ref:n}))}),Zbr=Kr(function(t,n){const{material:r}=t,o=Zn(t,jbr);return a.jsx(art,Se({},o,r,{ref:n}))});function e1r(e){const{inert:t,iconStart:n,iconEnd:r,children:o,material:i}=e,s=Zn(e,Ebr);return t&&(s.disableRipple=!0),f.createElement(_d,Se({},s,i),[n&&a.jsx(bse,{children:n},"1"),a.jsx($br,{children:o},"2"),r&&a.jsx(bse,{children:r},"3")])}function t1r(e){var c,u;const{slotProps:t,material:n}=e,r=Zn(e,Ibr),i=((u=(c=xf().components)==null?void 0:c.MuiTextField)==null?void 0:u.defaultProps)??{},s=r.variant??i.variant??"outlined",l=r.size??i.size;return a.jsx(la,Se({variant:s,size:l},r,n,{inputProps:t==null?void 0:t.htmlInput,InputProps:D1e(t==null?void 0:t.input),InputLabelProps:Se({shrink:!0},t==null?void 0:t.inputLabel)}))}function n1r(e){const t=sr(),{id:n,multiple:r,freeSolo:o,options:i,getOptionLabel:s,isOptionEqualToValue:l,value:c,onChange:u,label:d,placeholder:p,slotProps:h,material:m}=e,g=Zn(e,_br);return a.jsx(qxn,Se({id:n,multiple:r,freeSolo:o,options:i,getOptionLabel:s,isOptionEqualToValue:l,value:c,onChange:u,renderTags:(y,x)=>y.map((v,b)=>{const w=x({index:b}),{key:S}=w,C=Zn(w,Pbr);return a.jsx(bh,Se({variant:"outlined",size:"small",label:typeof v=="string"?v:s==null?void 0:s(v)},C),S)}),renderInput:y=>{var S;const{inputProps:x,InputProps:v,InputLabelProps:b}=y,w=Zn(y,Abr);return a.jsx(la,Se({},w,{label:d,placeholder:p,inputProps:x,InputProps:D1e(v,!1),InputLabelProps:Se({shrink:!0},b)},h==null?void 0:h.textField,(S=t.slotProps)==null?void 0:S.baseTextField))}},g,m))}function r1r(e){return a.jsx(HL,Se({},D1e(e)))}function D1e(e,t=!0){if(!e)return;const{slotProps:n,material:r}=e,i=Zn(e,Tbr);t&&(i.startAdornment&&(i.startAdornment=a.jsx(XFe,{position:"start",children:i.startAdornment})),i.endAdornment&&(i.endAdornment=a.jsx(XFe,{position:"end",children:i.endAdornment})));for(const s in r)Object.hasOwn(r,s)&&(i[s]=r[s]);return n!=null&&n.htmlInput&&(i.inputProps?i.inputProps=Se({},i.inputProps,n==null?void 0:n.htmlInput):i.inputProps=n==null?void 0:n.htmlInput),i}const o1r={"bottom-start":"top left","bottom-end":"top right"};function i1r(e){const{open:t,children:n,className:r,flip:o,onExited:i,onDidShow:s,onDidHide:l,id:c,target:u,transition:d,placement:p,material:h}=e,m=Zn(e,kbr),g=f.useMemo(()=>{const x=[{name:"preventOverflow",options:{padding:8}}];return o&&x.push({name:"flip",enabled:!0}),(s||l)&&x.push({name:"isPlaced",enabled:!0,phase:"main",fn:()=>{s==null||s()},effect:()=>()=>{l==null||l()}}),x},[o,s,l]);let y;if(!d)y=JFe(e,n);else{const x=v=>b=>{v&&v(),i&&i(b)};y=v=>{var b;return JFe(e,a.jsx(ST,Se({},v.TransitionProps,{style:{transformOrigin:o1r[v.placement]},onExited:x((b=v.TransitionProps)==null?void 0:b.onExited),children:a.jsx(ea,{children:n})})))}}return a.jsx(BL,Se({id:c,className:r,open:t,anchorEl:u,transition:d,placement:p,modifiers:g},m,h,{children:y}))}function JFe(e,t){return s1r(e,a1r(e,t))}function a1r(e,t){return e.onClickAway===void 0?t:a.jsx(Qnt,{onClickAway:e.onClickAway,touchEvent:e.clickAwayTouchEvent,mouseEvent:e.clickAwayMouseEvent,children:t})}function s1r(e,t){return e.focusTrap===void 0?t:a.jsx(Znt,{open:!0,disableEnforceFocus:!0,disableAutoFocus:!0,children:a.jsx("div",{tabIndex:-1,children:t})})}function l1r(e){let{native:t}=e,n=Zn(e,Mbr);return t?a.jsx("option",Se({},n)):a.jsx(_d,Se({},n))}const c1r=Bt(mrt,{name:"MuiDataGrid",slot:"Tabs"})(({theme:e})=>({borderBottom:`1px solid ${e.palette.divider}`})),u1r=Bt(Jz,{name:"MuiDataGrid",slot:"Tab"})({flex:1,minWidth:"fit-content"}),d1r=Bt("div",{name:"MuiDataGrid",slot:"TabPanel"})({flex:1,display:"flex",flexDirection:"column",overflow:"hidden"});function f1r(e){const{children:t,active:n}=e,r=Zn(e,Rbr);return a.jsx(d1r,Se({role:"tabpanel",style:{display:n?"flex":"none"}},r,{children:t}))}function p1r(e){let{items:t,value:n,material:r}=e,o=Zn(e,Obr);const i=Jo(),s=`${i}-tab-${n}`,l=`${i}-tabpanel-${n}`;return a.jsxs(f.Fragment,{children:[a.jsx(c1r,Se({},o,{value:n,variant:"scrollable",scrollButtons:"auto"},r,{children:t.map(c=>a.jsx(u1r,{value:c.value,label:c.label,id:s,"aria-controls":l},c.value))})),t.map(c=>a.jsx(f1r,{value:c.value,active:n===c.value,id:l,"aria-labelledby":s,children:c.children},c.value))]})}const h1r={booleanCellTrueIcon:WFe,booleanCellFalseIcon:HFe,columnMenuIcon:kvr,openFilterButtonIcon:Cvr,filterPanelDeleteIcon:HFe,undoIcon:jvr,redoIcon:Evr,columnFilteredIcon:BFe,columnSelectorIcon:Ivr,columnUnsortedIcon:Bvr,columnSortedAscendingIcon:DFe,columnSortedDescendingIcon:LFe,columnResizeIcon:_vr,densityCompactIcon:Pvr,densityStandardIcon:Avr,densityComfortableIcon:Tvr,exportIcon:Fvr,moreActionsIcon:Ovr,treeDataCollapseIcon:zFe,treeDataExpandIcon:FFe,groupingCriteriaCollapseIcon:zFe,groupingCriteriaExpandIcon:FFe,detailPanelExpandIcon:VFe,detailPanelCollapseIcon:Mvr,rowReorderIcon:UFe,quickFilterIcon:Nvr,quickFilterClearIcon:GFe,columnMenuHideIcon:$vr,columnMenuSortAscendingIcon:DFe,columnMenuSortDescendingIcon:LFe,columnMenuUnsortIcon:null,columnMenuFilterIcon:BFe,columnMenuManageColumnsIcon:Dvr,columnMenuClearIcon:GFe,loadIcon:Rvr,filterPanelAddIcon:VFe,filterPanelRemoveAllIcon:Lvr,columnReorderIcon:UFe,menuItemCheckIcon:WFe},m1r={baseAutocomplete:n1r,baseBadge:zbr,baseCheckbox:Bbr,baseChip:Kbr,baseCircularProgress:Hbr,baseDivider:Vbr,baseInput:r1r,baseLinearProgress:Ubr,baseMenuList:Zbr,baseMenuItem:e1r,baseTextField:t1r,baseButton:Wbr,baseIconButton:Ybr,baseToggleButton:qbr,baseTooltip:Xbr,baseTabs:p1r,basePagination:Fbr,basePopper:i1r,baseSelect:Dbr,baseSelectOption:l1r,baseSkeleton:Qbr,baseSwitch:Jbr},g1r=Se({},m1r,h1r),x1r=aQe({memoize:vge,memoizeOptions:{maxSize:1,equalityCheck:Object.is}}),x1=(e,t,n,r,o,i,s,l,...c)=>{if(c.length>0)throw new Error("Unsupported number of selectors");let u;if(e&&t&&n&&r&&o&&i&&s&&l)u=(d,p,h,m)=>{const g=e(d,p,h,m),y=t(d,p,h,m),x=n(d,p,h,m),v=r(d,p,h,m),b=o(d,p,h,m),w=i(d,p,h,m),S=s(d,p,h,m);return l(g,y,x,v,b,w,S,p,h,m)};else if(e&&t&&n&&r&&o&&i&&s)u=(d,p,h,m)=>{const g=e(d,p,h,m),y=t(d,p,h,m),x=n(d,p,h,m),v=r(d,p,h,m),b=o(d,p,h,m),w=i(d,p,h,m);return s(g,y,x,v,b,w,p,h,m)};else if(e&&t&&n&&r&&o&&i)u=(d,p,h,m)=>{const g=e(d,p,h,m),y=t(d,p,h,m),x=n(d,p,h,m),v=r(d,p,h,m),b=o(d,p,h,m);return i(g,y,x,v,b,p,h,m)};else if(e&&t&&n&&r&&o)u=(d,p,h,m)=>{const g=e(d,p,h,m),y=t(d,p,h,m),x=n(d,p,h,m),v=r(d,p,h,m);return o(g,y,x,v,p,h,m)};else if(e&&t&&n&&r)u=(d,p,h,m)=>{const g=e(d,p,h,m),y=t(d,p,h,m),x=n(d,p,h,m);return r(g,y,x,p,h,m)};else if(e&&t&&n)u=(d,p,h,m)=>{const g=e(d,p,h,m),y=t(d,p,h,m);return n(g,y,p,h,m)};else if(e&&t)u=(d,p,h,m)=>{const g=e(d,p,h,m);return t(g,p,h,m)};else if(e)u=e;else throw new Error("Missing arguments");return u},y1r=e=>(...t)=>{const n=new WeakMap;let r=1;const o=t[t.length-1],i=t.length-1||1,s=Math.max(o.length-i,0);if(s>3)throw new Error("Unsupported number of arguments");return(c,u,d,p)=>{let h=c.__cacheKey__;h||(h={id:r},c.__cacheKey__=h,r+=1);let m=n.get(h);if(!m){const g=t.length===1?[v=>v,o]:t;let y=t;const x=[void 0,void 0,void 0];switch(s){case 0:break;case 1:{y=[...g.slice(0,-1),()=>x[0],o];break}case 2:{y=[...g.slice(0,-1),()=>x[0],()=>x[1],o];break}case 3:{y=[...g.slice(0,-1),()=>x[0],()=>x[1],()=>x[2],o];break}default:throw new Error("Unsupported number of arguments")}m=x1r(...y),m.selectorArgs=x,n.set(h,m)}switch(s){case 3:m.selectorArgs[2]=p;case 2:m.selectorArgs[1]=d;case 1:m.selectorArgs[0]=u}switch(s){case 0:return m(c);case 1:return m(c,u);case 2:return m(c,u,d);case 3:return m(c,u,d,p);default:throw new Error("unreachable")}}},e0=y1r(),v1r=O1e>=19,b1r=v1r?w1r:S1r;function q2(e,t,n,r,o){return b1r(e,t,n,r,o)}function w1r(e,t,n,r,o){const i=f.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return $1e.useSyncExternalStore(e.subscribe,i,i)}function S1r(e,t,n,r,o){return xge.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,i=>t(i,n,r,o))}const C1r=()=>{};function WE(e,t,n){const r=gm(N1r,{store:e,selector:t}).current;r.effect=n,oK(r.onMount)}function N1r(e){const{store:t,selector:n}=e;let r=n(t.state);const o={effect:C1r,dispose:null,subscribe:()=>{o.dispose??(o.dispose=t.subscribe(i=>{const s=n(i);if(!Object.is(r,s)){const l=r;r=s,o.effect(l,s)}}))},onMount:()=>(o.subscribe(),()=>{var i;(i=o.dispose)==null||i.call(o),o.dispose=null})};return o.subscribe(),o}class BY{constructor(t){ze(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));ze(this,"getSnapshot",()=>this.state);ze(this,"use",(t,n,r,o)=>q2(this,t,n,r,o));this.state=t,this.listeners=new Set,this.updateTick=0}static create(t){return new BY(t)}setState(t){this.state=t,this.updateTick+=1;const n=this.updateTick,r=this.listeners.values();let o;for(;o=r.next(),!o.done;){if(n!==this.updateTick)return;const i=o.value;i(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState(Se({},this.state,t));return}}set(t,n){Object.is(this.state[t],n)||this.setState(Se({},this.state,{[t]:n}))}}const yr=(...e)=>{const t=x1(...e);return(r,o,i,s)=>t(L1e(r),o,i,s)},ha=(...e)=>{const t=e0(...e);return(r,o,i,s)=>t(L1e(r),o,i,s)},Us=e=>(t,n)=>e(L1e(t),n);function L1e(e){return"current"in e?e.current.state:e}const Rl=Us(e=>e.dimensions),F1e=yr(Rl,e=>e.columnsTotalWidth),j1r=yr(Rl,e=>e.rowHeight);yr(Rl,e=>e.contentSize.height);const Sxt=yr(Rl,e=>e.hasScrollX),Cxt=yr(Rl,e=>e.hasScrollY),Nxt=yr(Rl,e=>e.columnsTotalWidthe.headerHeight),I1r=yr(Rl,e=>e.groupHeaderHeight);yr(Rl,e=>e.headerFilterHeight);const _1r=yr(Rl,e=>e.hasScrollX?e.scrollbarSize:0),jxt=yr(Rl,e=>e.hasScrollY?e.scrollbarSize:0),P1r=yr(Rl,_1r,(e,t)=>{const n=e.viewportOuterSize.height-e.minimumSize.height>0;return!(t===0&&!n)}),Ext=Us(e=>e.rowsMeta),My=Us(e=>e.rows),d4=yr(My,e=>e.totalRowCount),A1r=yr(My,e=>e.loading),T1r=yr(My,e=>e.totalTopLevelRowCount),rg=yr(My,e=>e.dataRowIdToModelLookup);yr(rg,(e,t)=>e[t]);const Mc=yr(My,e=>e.tree),j0=yr(Mc,(e,t)=>e[t]),k1r=yr(My,e=>e.groupsToFetch),M1r=yr(My,e=>e.groupingName),ZFe=yr(My,e=>e.treeDepths),T6=ha(My,e=>{const t=Object.entries(e.treeDepths);return t.length===0?1:(t.filter(([,n])=>n>0).map(([n])=>Number(n)).sort((n,r)=>r-n)[0]??0)+1}),GP=yr(My,e=>e.dataRowIds),R1r=ha(GP,rg,(e,t)=>e.reduce((n,r)=>(t[r]&&n.push(t[r]),n),[])),O1r=yr(My,e=>e==null?void 0:e.additionalRowGroups),f4=ha(O1r,e=>{var n,r;const t=e==null?void 0:e.pinnedRows;return{bottom:((n=t==null?void 0:t.bottom)==null?void 0:n.map(o=>({id:o.id,model:o.model??{}})))??[],top:((r=t==null?void 0:t.top)==null?void 0:r.map(o=>({id:o.id,model:o.model??{}})))??[]}}),Ixt=yr(f4,e=>{var t,n;return(((t=e==null?void 0:e.top)==null?void 0:t.length)||0)+(((n=e==null?void 0:e.bottom)==null?void 0:n.length)||0)}),pc="auto-generated-group-node-root",RI=Symbol("mui.id_autogenerated"),$1r=()=>({type:"group",id:pc,depth:-1,groupingField:null,groupingKey:null,isAutoGenerated:!0,children:[],childrenFromPath:{},childrenExpanded:!0,parent:null});function D1r(e,t,n="A row was provided without id in the rows prop:"){if(e==null)throw new Error(["MUI X: The Data Grid component requires all rows to have a unique `id` property.","Alternatively, you can use the `getRowId` prop to specify a custom id for each row.",n,JSON.stringify(t)].join(` `))}const HY=(e,t,n)=>{const r=t?t(e):e.id;return D1r(r,e,n),r},_xt=(e,t,n)=>{const r=t.field;if(!t||!t.valueGetter)return e[r];const o=e[t.field];return t.valueGetter(o,e,t,n)},UB=({rows:e,getRowId:t,loading:n,rowCount:r})=>{const o={type:"full",rows:[]},i={};for(let s=0;s{const n=e[pc];return Math.max(t,n.children.length+(n.footerId==null?0:1))},Axt=({apiRef:e,rowCountProp:t=0,loadingProp:n,previousTree:r,previousTreeDepths:o,previousGroupsToFetch:i})=>{const s=e.current.caches.rows,{tree:l,treeDepths:c,dataRowIds:u,groupingName:d,groupsToFetch:p=[]}=e.current.applyStrategyProcessor("rowTreeCreation",{previousTree:r,previousTreeDepths:o,updates:s.updates,dataRowIdToModelLookup:s.dataRowIdToModelLookup,previousGroupsToFetch:i}),h=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:l,treeDepths:c,dataRowIds:u,dataRowIdToModelLookup:s.dataRowIdToModelLookup});return e.current.caches.rows.updates={type:"partial",actions:{insert:[],modify:[],remove:[]},idToActionLookup:{}},Se({},h,{totalRowCount:Math.max(t,h.dataRowIds.length),totalTopLevelRowCount:Pxt({tree:h.tree,rowCountProp:t}),groupingName:d,loading:n,groupsToFetch:p})},Txt=e=>RI in e,zT=e=>e.type==="skeletonRow"||e.type==="footer"||e.type==="group"&&e.isAutoGenerated||e.type==="pinnedRow"&&e.isAutoGenerated,z1e=(e,t,n,r)=>{const o=e[t];if(o.type!=="group")return[];const i=[];for(let s=0;s{if(e.updates.type==="full")throw new Error("MUI X: Unable to prepare a partial update if a full update is not applied yet.");const o=new Map;n.forEach(u=>{const d=HY(u,t,"A row was provided without id when calling updateRows():");o.has(d)?o.set(d,Se({},o.get(d),u)):o.set(d,u)});const i={type:"partial",actions:{insert:[...e.updates.actions.insert??[]],modify:[...e.updates.actions.modify??[]],remove:[...e.updates.actions.remove??[]]},idToActionLookup:Se({},e.updates.idToActionLookup),groupKeys:r},s=Se({},e.dataRowIdToModelLookup),l={insert:{},modify:{},remove:{}};o.forEach((u,d)=>{const p=i.idToActionLookup[d];if(u._action==="delete"){if(p==="remove"||!s[d])return;p!=null&&(l[p][d]=!0),i.actions.remove.push(d),delete s[d];return}const h=s[d];if(h){p==="remove"?(l.remove[d]=!0,i.actions.modify.push(d)):p==null&&i.actions.modify.push(d),s[d]=Se({},h,u);return}p==="remove"?(l.remove[d]=!0,i.actions.insert.push(d)):p==null&&i.actions.insert.push(d),s[d]=u});const c=Object.keys(l);for(let u=0;u0&&(i.actions[d]=i.actions[d].filter(h=>!p[h]))}return{dataRowIdToModelLookup:s,updates:i,rowsBeforePartialUpdates:e.rowsBeforePartialUpdates,loadingPropBeforePartialUpdates:e.loadingPropBeforePartialUpdates,rowCountPropBeforePartialUpdates:e.rowCountPropBeforePartialUpdates}},kxt="var(--DataGrid-overlayHeight, calc(var(--height) * 2))";function t7e(e,t,n){const r=[];return t.forEach(o=>{const i=HY(o,n,"A row was provided without id when calling updateRows():"),s=j0(e,i);if((s==null?void 0:s.type)==="pinnedRow"){const l=e.current.caches.pinnedRows,c=l.idLookup[i];c&&(l.idLookup[i]=Se({},c,o))}else r.push(o)}),r}const Mxt=(e,t,n)=>typeof e=="number"&&e>0?e:t;function rS(e){return f.memo(e,xxt)}const L1r={noRowsLabel:"No rows",noResultsOverlayLabel:"No results found.",noColumnsOverlayLabel:"No columns",noColumnsOverlayManageColumns:"Manage columns",emptyPivotOverlayLabel:"Add fields to rows, columns, and values to create a pivot table",toolbarDensity:"Density",toolbarDensityLabel:"Density",toolbarDensityCompact:"Compact",toolbarDensityStandard:"Standard",toolbarDensityComfortable:"Comfortable",toolbarUndo:"Undo",toolbarRedo:"Redo",toolbarColumns:"Columns",toolbarColumnsLabel:"Select columns",toolbarFilters:"Filters",toolbarFiltersLabel:"Show filters",toolbarFiltersTooltipHide:"Hide filters",toolbarFiltersTooltipShow:"Show filters",toolbarFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,toolbarQuickFilterPlaceholder:"Search…",toolbarQuickFilterLabel:"Search",toolbarQuickFilterDeleteIconLabel:"Clear",toolbarExport:"Export",toolbarExportLabel:"Export",toolbarExportCSV:"Download as CSV",toolbarExportPrint:"Print",toolbarExportExcel:"Download as Excel",toolbarPivot:"Pivot",toolbarCharts:"Charts",toolbarAssistant:"AI Assistant",columnsManagementSearchTitle:"Search",columnsManagementNoColumns:"No columns",columnsManagementShowHideAllText:"Show/Hide All",columnsManagementReset:"Reset",columnsManagementDeleteIconLabel:"Clear",filterPanelAddFilter:"Add filter",filterPanelRemoveAll:"Remove all",filterPanelDeleteIconLabel:"Delete",filterPanelLogicOperator:"Logic operator",filterPanelOperator:"Operator",filterPanelOperatorAnd:"And",filterPanelOperatorOr:"Or",filterPanelColumns:"Columns",filterPanelInputLabel:"Value",filterPanelInputPlaceholder:"Filter value",filterOperatorContains:"contains",filterOperatorDoesNotContain:"does not contain",filterOperatorEquals:"equals",filterOperatorDoesNotEqual:"does not equal",filterOperatorStartsWith:"starts with",filterOperatorEndsWith:"ends with",filterOperatorIs:"is",filterOperatorNot:"is not",filterOperatorAfter:"is after",filterOperatorOnOrAfter:"is on or after",filterOperatorBefore:"is before",filterOperatorOnOrBefore:"is on or before",filterOperatorIsEmpty:"is empty",filterOperatorIsNotEmpty:"is not empty",filterOperatorIsAnyOf:"is any of","filterOperator=":"=","filterOperator!=":"!=","filterOperator>":">","filterOperator>=":">=","filterOperator<":"<","filterOperator<=":"<=",headerFilterOperatorContains:"Contains",headerFilterOperatorDoesNotContain:"Does not contain",headerFilterOperatorEquals:"Equals",headerFilterOperatorDoesNotEqual:"Does not equal",headerFilterOperatorStartsWith:"Starts with",headerFilterOperatorEndsWith:"Ends with",headerFilterOperatorIs:"Is",headerFilterOperatorNot:"Is not",headerFilterOperatorAfter:"Is after",headerFilterOperatorOnOrAfter:"Is on or after",headerFilterOperatorBefore:"Is before",headerFilterOperatorOnOrBefore:"Is on or before",headerFilterOperatorIsEmpty:"Is empty",headerFilterOperatorIsNotEmpty:"Is not empty",headerFilterOperatorIsAnyOf:"Is any of","headerFilterOperator=":"Equals","headerFilterOperator!=":"Not equals","headerFilterOperator>":"Greater than","headerFilterOperator>=":"Greater than or equal to","headerFilterOperator<":"Less than","headerFilterOperator<=":"Less than or equal to",headerFilterClear:"Clear filter",filterValueAny:"any",filterValueTrue:"true",filterValueFalse:"false",columnMenuLabel:"Menu",columnMenuAriaLabel:e=>`${e} column menu`,columnMenuShowColumns:"Show columns",columnMenuManageColumns:"Manage columns",columnMenuFilter:"Filter",columnMenuHideColumn:"Hide column",columnMenuUnsort:"Unsort",columnMenuSortAsc:"Sort by ASC",columnMenuSortDesc:"Sort by DESC",columnMenuManagePivot:"Manage pivot",columnMenuManageCharts:"Manage charts",columnHeaderFiltersTooltipActive:e=>e!==1?`${e} active filters`:`${e} active filter`,columnHeaderFiltersLabel:"Show filters",columnHeaderSortIconLabel:"Sort",footerRowSelected:e=>e!==1?`${e.toLocaleString()} rows selected`:`${e.toLocaleString()} row selected`,footerTotalRows:"Total Rows:",footerTotalVisibleRows:(e,t)=>`${e.toLocaleString()} of ${t.toLocaleString()}`,checkboxSelectionHeaderName:"Checkbox selection",checkboxSelectionSelectAllRows:"Select all rows",checkboxSelectionUnselectAllRows:"Unselect all rows",checkboxSelectionSelectRow:"Select row",checkboxSelectionUnselectRow:"Unselect row",booleanCellTrueLabel:"yes",booleanCellFalseLabel:"no",actionsCellMore:"more",pinToLeft:"Pin to left",pinToRight:"Pin to right",unpin:"Unpin",treeDataGroupingHeaderName:"Group",treeDataExpand:"see children",treeDataCollapse:"hide children",groupingColumnHeaderName:"Group",groupColumn:e=>`Group by ${e}`,unGroupColumn:e=>`Stop grouping by ${e}`,detailPanelToggle:"Detail panel toggle",expandDetailPanel:"Expand",collapseDetailPanel:"Collapse",paginationRowsPerPage:"Rows per page:",paginationDisplayedRows:({from:e,to:t,count:n,estimated:r})=>{if(!r)return`${e}–${t} of ${n!==-1?n:`more than ${t}`}`;const o=r&&r>t?`around ${r}`:`more than ${t}`;return`${e}–${t} of ${n!==-1?n:o}`},paginationItemAriaLabel:e=>e==="first"?"Go to first page":e==="last"?"Go to last page":e==="next"?"Go to next page":"Go to previous page",rowReorderingHeaderName:"Row reordering",aggregationMenuItemHeader:"Aggregation",aggregationFunctionLabelNone:"none",aggregationFunctionLabelSum:"sum",aggregationFunctionLabelAvg:"avg",aggregationFunctionLabelMin:"min",aggregationFunctionLabelMax:"max",aggregationFunctionLabelSize:"size",pivotToggleLabel:"Pivot",pivotRows:"Rows",pivotColumns:"Columns",pivotValues:"Values",pivotCloseButton:"Close pivot settings",pivotSearchButton:"Search fields",pivotSearchControlPlaceholder:"Search fields",pivotSearchControlLabel:"Search fields",pivotSearchControlClear:"Clear search",pivotNoFields:"No fields",pivotMenuMoveUp:"Move up",pivotMenuMoveDown:"Move down",pivotMenuMoveToTop:"Move to top",pivotMenuMoveToBottom:"Move to bottom",pivotMenuRows:"Rows",pivotMenuColumns:"Columns",pivotMenuValues:"Values",pivotMenuOptions:"Field options",pivotMenuAddToRows:"Add to Rows",pivotMenuAddToColumns:"Add to Columns",pivotMenuAddToValues:"Add to Values",pivotMenuRemove:"Remove",pivotDragToRows:"Drag here to create rows",pivotDragToColumns:"Drag here to create columns",pivotDragToValues:"Drag here to create values",pivotYearColumnHeaderName:"(Year)",pivotQuarterColumnHeaderName:"(Quarter)",chartsNoCharts:"There are no charts available",chartsChartNotSelected:"Select a chart type to configure its options",chartsTabChart:"Chart",chartsTabFields:"Fields",chartsTabCustomize:"Customize",chartsCloseButton:"Close charts configuration",chartsSyncButtonLabel:"Sync chart",chartsSearchPlaceholder:"Search fields",chartsSearchLabel:"Search fields",chartsSearchClear:"Clear search",chartsNoFields:"No fields",chartsFieldBlocked:"This field cannot be added to any section",chartsCategories:"Categories",chartsSeries:"Series",chartsMenuAddToDimensions:e=>`Add to ${e}`,chartsMenuAddToValues:e=>`Add to ${e}`,chartsMenuMoveUp:"Move up",chartsMenuMoveDown:"Move down",chartsMenuMoveToTop:"Move to top",chartsMenuMoveToBottom:"Move to bottom",chartsMenuOptions:"Field options",chartsMenuRemove:"Remove",chartsDragToDimensions:e=>`Drag here to use column as ${e}`,chartsDragToValues:e=>`Drag here to use column as ${e}`,aiAssistantPanelTitle:"AI Assistant",aiAssistantPanelClose:"Close AI Assistant",aiAssistantPanelNewConversation:"New conversation",aiAssistantPanelConversationHistory:"Conversation history",aiAssistantPanelEmptyConversation:"No prompt history",aiAssistantSuggestions:"Suggestions",promptFieldLabel:"Prompt",promptFieldPlaceholder:"Type a prompt…",promptFieldPlaceholderWithRecording:"Type or record a prompt…",promptFieldPlaceholderListening:"Listening for prompt…",promptFieldSpeechRecognitionNotSupported:"Speech recognition is not supported in this browser",promptFieldSend:"Send",promptFieldRecord:"Record",promptFieldStopRecording:"Stop recording",promptRerun:"Run again",promptProcessing:"Processing…",promptAppliedChanges:"Applied changes",promptChangeGroupDescription:e=>`Group by ${e}`,promptChangeAggregationLabel:(e,t)=>`${e} (${t})`,promptChangeAggregationDescription:(e,t)=>`Aggregate ${e} (${t})`,promptChangeFilterLabel:(e,t,n)=>t==="is any of"?`${e} is any of: ${n}`:`${e} ${t} ${n}`,promptChangeFilterDescription:(e,t,n)=>t==="is any of"?`Filter where ${e} is any of: ${n}`:`Filter where ${e} ${t} ${n}`,promptChangeSortDescription:(e,t)=>`Sort by ${e} (${t})`,promptChangePivotEnableLabel:"Pivot",promptChangePivotEnableDescription:"Enable pivot",promptChangePivotColumnsLabel:e=>`Columns (${e})`,promptChangePivotColumnsDescription:(e,t)=>`${e}${t?` (${t})`:""}`,promptChangePivotRowsLabel:e=>`Rows (${e})`,promptChangePivotValuesLabel:e=>`Values (${e})`,promptChangePivotValuesDescription:(e,t)=>`${e} (${t})`,promptChangeChartsLabel:(e,t)=>`Dimensions (${e}), Values (${t})`};let ry=(function(e){return e.DataGrid="DataGrid",e.DataGridPro="DataGridPro",e.DataGridPremium="DataGridPremium",e})({});const n7e=1e3;class F1r{constructor(t=n7e){ze(this,"timeouts",new Map);ze(this,"cleanupTimeout",n7e);this.cleanupTimeout=t}register(t,n,r){this.timeouts||(this.timeouts=new Map);const o=setTimeout(()=>{typeof n=="function"&&n(),this.timeouts.delete(r.cleanupToken)},this.cleanupTimeout);this.timeouts.set(r.cleanupToken,o)}unregister(t){const n=this.timeouts.get(t.cleanupToken);n&&(this.timeouts.delete(t.cleanupToken),clearTimeout(n))}reset(){this.timeouts&&(this.timeouts.forEach((t,n)=>{this.unregister({cleanupToken:n})}),this.timeouts=void 0)}}class z1r{constructor(){ze(this,"registry",new FinalizationRegistry(t=>{typeof t=="function"&&t()}))}register(t,n,r){this.registry.register(t,n,r)}unregister(t){this.registry.unregister(t)}reset(){}}class B1e{static create(){return new B1e}}const u9={current:H1r()};let r7e=0;function Nr(e,t,n,r){const o=f.useState(B1e.create)[0],i=f.useRef(null),s=f.useRef(null);s.current=n;const l=f.useRef(null);if(!i.current&&s.current){const c=(u,d,p)=>{var h;d&&!d.defaultMuiPrevented&&((h=s.current)==null||h.call(s,u,d,p))};i.current=e.current.subscribeEvent(t,c,r),r7e+=1,l.current={cleanupToken:r7e},u9.current.register(o,()=>{var u;(u=i.current)==null||u.call(i),i.current=null,l.current=null},l.current)}else!s.current&&i.current&&(i.current(),i.current=null,l.current&&(u9.current.unregister(l.current),l.current=null));f.useEffect(()=>{if(!i.current&&s.current){const c=(u,d,p)=>{var h;d&&!d.defaultMuiPrevented&&((h=s.current)==null||h.call(s,u,d,p))};i.current=e.current.subscribeEvent(t,c,r)}return l.current&&u9.current&&(u9.current.unregister(l.current),l.current=null),()=>{var c;(c=i.current)==null||c.call(i),i.current=null}},[e,t,r])}const B1r={isFirst:!0};function Ss(e,t,n){Nr(e,t,n,B1r)}function H1r(){return typeof FinalizationRegistry<"u"?new z1r:new F1r}const V1r=.7,U1r=1.3,W1r={compact:V1r,comfortable:U1r,standard:1},fE=Us(e=>e.density),k6=yr(fE,e=>W1r[e]);function Ob(e){throw new Error("Failed assertion: should not be rendered")}const G1r=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","isValidating","debounceMs","isProcessingProps","onValueChange","slotProps"],q1r=e=>{const{classes:t}=e;return Un({root:["editInputCell"]},ii,t)},K1r=Bt(Ob,{name:"MuiDataGrid",slot:"EditInputCell"})({font:fr.typography.font.body,padding:"1px 0","& input":{padding:"0 16px",height:"100%"}}),Y1r=Kr((e,t)=>{const n=sr(),{id:r,value:o,field:i,colDef:s,hasFocus:l,debounceMs:c=200,isProcessingProps:u,onValueChange:d,slotProps:p}=e,h=Zn(e,G1r),m=Eo(),g=f.useRef(null),[y,x]=f.useState(o),v=q1r(n),b=f.useCallback(async S=>{const C=S.target.value,N=m.current.getColumn(i);let j=C;N.valueParser&&(j=N.valueParser(C,m.current.getRow(r),N,m)),x(j),m.current.setEditCellValue({id:r,field:i,value:j,debounceMs:c,unstable_skipValueParser:!0},S),d&&await d(S,C)},[m,c,i,r,d]),w=m.current.unstable_getEditCellMeta(r,i);return f.useEffect(()=>{(w==null?void 0:w.changeReason)!=="debouncedSetEditCellValue"&&x(o)},[w,o]),Ia(()=>{l&&g.current.focus()},[l]),a.jsx(K1r,Se({as:n.slots.baseInput,inputRef:g,className:v.root,ownerState:n,fullWidth:!0,type:s.type==="number"?s.type:"text",value:y??"",onChange:b,endAdornment:u?a.jsx(n.slots.loadIcon,{fontSize:"small",color:"action"}):void 0},h,p==null?void 0:p.root,{ref:t}))}),X1r=e=>a.jsx(Y1r,Se({},e)),Rxt=(e,t)=>t&&e.length>1?[e[0]]:e,o7e=(e,t)=>n=>Se({},n,{sorting:Se({},n.sorting,{sortModel:Rxt(e,t)})}),Q1r=e=>e==="desc",J1r=(e,t)=>{const n=t.current.getColumn(e.field);if(!n||e.sort===null)return null;let r;return n.getSortComparator?r=n.getSortComparator(e.sort):r=Q1r(e.sort)?(...i)=>-1*n.sortComparator(...i):n.sortComparator,r?{getSortCellParams:i=>({id:i,field:n.field,rowNode:j0(t,i),value:t.current.getCellValue(i,n.field),api:t.current}),comparator:r}:null},Z1r=(e,t,n)=>e.reduce((r,o,i)=>{if(r!==0)return r;const s=t.params[i],l=n.params[i];return r=o.comparator(s.value,l.value,s,l),r},0),ewr=(e,t)=>{const n=e.map(r=>J1r(r,t)).filter(r=>!!r);return n.length===0?null:r=>r.map(o=>({node:o,params:n.map(i=>i.getSortCellParams(o.id))})).sort((o,i)=>Z1r(n,o,i)).map(o=>o.node.id)},i7e=(e,t)=>{const n=e.indexOf(t);return!t||n===-1||n+1===e.length?e[0]:e[n+1]},H1e=(e,t)=>e==null&&t!=null?-1:t==null&&e!=null?1:e==null&&t==null?0:null,twr=new Intl.Collator,nwr=(e,t)=>{const n=H1e(e,t);return n!==null?n:typeof e=="string"?twr.compare(e.toString(),t.toString()):e-t},Oxt=(e,t)=>{const n=H1e(e,t);return n!==null?n:Number(e)-Number(t)},$xt=(e,t)=>{const n=H1e(e,t);return n!==null?n:e>t?1:e{const _=Vne(I.target.value);y(_),v(!0),m.start(w.filterDebounceMs,()=>{const T=Se({},t,{value:r==="number"&&!Number.isNaN(Number(_))?Number(_):_,fromInput:b});n(T),v(!1)})},[m,w.filterDebounceMs,t,r,b,n]);return f.useEffect(()=>{(t.fromInput!==b||t.value==null)&&y(Vne(t.value))},[b,t]),a.jsxs(f.Fragment,{children:[a.jsx(w.slots.baseTextField,Se({id:b,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),value:g??"",onChange:S,type:r||"text",disabled:l,slotProps:Se({},h==null?void 0:h.slotProps,{input:Se({endAdornment:x?a.jsx(w.slots.loadIcon,{fontSize:"small",color:"action"}):null},(C=h==null?void 0:h.slotProps)==null?void 0:C.input),htmlInput:Se({tabIndex:s},(N=h==null?void 0:h.slotProps)==null?void 0:N.htmlInput)}),inputRef:i},(j=w.slotProps)==null?void 0:j.baseTextField,p,h)),d,u]})}function Vne(e){if(!(e==null||e===""))return String(e)}function owr(e){return typeof e=="number"&&!Number.isNaN(e)}function iwr(e){return typeof e=="function"}function V1e(e){return typeof e=="object"&&e!==null}function awr(){try{const e="__some_random_key_you_are_not_going_to_use__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}function _W(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}const GE=(e,t,n)=>Math.max(t,Math.min(n,e));function swr(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function lwr(e){const t=swr(e);return(n,r)=>n+(r-n)*t()}function Dxt(e){return typeof structuredClone=="function"?structuredClone(e):JSON.parse(JSON.stringify(e))}const dh=(e,t)=>(...n)=>{e&&t(...n)};function Lxt(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,slotProps:s}=e,l=Jo(),[c,u]=f.useState([]),[d,p]=f.useState(t.value||[]),h=sr();f.useEffect(()=>{const x=t.value??[];p(x.map(String))},[t.value]);const m=f.useCallback((x,v)=>{p(v.map(String)),n(Se({},t,{value:[...v.map(b=>r==="number"?Number(b):b)]}))},[n,t,r]),g=f.useCallback((x,v)=>{u(v===""?[]:[v])},[u]),y=h.slots.baseAutocomplete;return a.jsx(y,Se({multiple:!0,freeSolo:!0,options:c,id:l,value:d,onChange:m,onInputChange:g,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),slotProps:{textField:{type:r||"text",inputRef:i}}},s==null?void 0:s.root))}var bb=(function(e){return e.Cell="cell",e.Row="row",e})(bb||{}),Da=(function(e){return e.Edit="edit",e.View="view",e})(Da||{}),Js=(function(e){return e.Edit="edit",e.View="view",e})(Js||{}),fh=(function(e){return e.And="and",e.Or="or",e})(fh||{});class cwr{constructor(t){this.data=t.ids}has(t){return this.data.has(t)}select(t){this.data.add(t)}unselect(t){this.data.delete(t)}}class uwr{constructor(t){this.data=t.ids}has(t){return!this.data.has(t)}select(t){this.data.delete(t)}unselect(t){this.data.add(t)}}const x2=e=>e.type==="include"?new cwr(e):new uwr(e);var y1=(function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e.pasteKeyDown="pasteKeyDown",e})(y1||{}),Ax=(function(e){return e.cellFocusOut="cellFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e})(Ax||{}),QS=(function(e){return e.enterKeyDown="enterKeyDown",e.cellDoubleClick="cellDoubleClick",e.printableKeyDown="printableKeyDown",e.deleteKeyDown="deleteKeyDown",e})(QS||{}),ov=(function(e){return e.rowFocusOut="rowFocusOut",e.escapeKeyDown="escapeKeyDown",e.enterKeyDown="enterKeyDown",e.tabKeyDown="tabKeyDown",e.shiftTabKeyDown="shiftTabKeyDown",e})(ov||{});function Fxt(e){return e.field!==void 0}const zxt={filteredRowsLookup:{},filteredChildrenCountLookup:{},filteredDescendantCountLookup:{}},gD=()=>({items:[],logicOperator:fh.And,quickFilterValues:[],quickFilterLogicOperator:fh.And});function Bxt(e){return{current:e.current.getPublicApi()}}let Cv=(function(e){return e.LEFT="left",e.RIGHT="right",e})({});const PW={left:[],right:[]},Hxt=Us(e=>e.isRtl),Vxt=Us(e=>e.props.listView??!1),Uxt=Us(e=>e.listViewColumn),oy=Us(e=>e.columns),tb=yr(oy,e=>e.orderedFields),$b=yr(oy,e=>e.lookup),cg=ha(tb,$b,(e,t)=>e.map(n=>t[n])),x0=yr(oy,e=>e.columnVisibilityModel),dwr=yr(oy,e=>e.initialColumnVisibilityModel),yc=ha(cg,x0,Vxt,Uxt,(e,t,n,r)=>n&&r?[r]:e.filter(o=>t[o.field]!==!1)),M6=ha(yc,e=>e.map(t=>t.field)),U1e=Us(e=>e.pinnedColumns);ha(U1e,tb,Hxt,(e,t,n)=>Wxt(e,t,n));const VY=ha(oy,U1e,M6,Hxt,Vxt,(e,t,n,r,o)=>{if(o)return PW;const i=Wxt(t,n,r);return{left:i.left.map(l=>e.lookup[l]),right:i.right.map(l=>e.lookup[l])}});function Wxt(e,t,n){var l,c;if(!Array.isArray(e.left)&&!Array.isArray(e.right)||((l=e.left)==null?void 0:l.length)===0&&((c=e.right)==null?void 0:c.length)===0)return PW;const r=(u,d)=>Array.isArray(u)?u.filter(p=>d.includes(p)):[],o=r(e.left,t),i=t.filter(u=>!o.includes(u)),s=r(e.right,i);return n?{left:s,right:o}:{left:o,right:s}}const y5=ha(yc,e=>{const t=[];let n=0;for(let r=0;re.filter(t=>t.filterable)),fwr=ha(cg,e=>e.reduce((t,n)=>(n.filterable&&(t[n.field]=n),t),{})),pwr=ha(cg,e=>e.some(t=>t.colSpan!==void 0));let zM;function hwr(){if(zM!==void 0)return zM;try{zM=new Function("return true")()}catch{zM=!1}return zM}const bpe=(e,t)=>{const n=Se({},e);if(n.id==null&&(n.id=Math.round(Math.random()*1e5)),n.operator==null){const r=$b(t)[n.field];n.operator=r&&r.filterOperators[0].value}return n},W1e=(e,t,n)=>{const r=e.items.length>1;let o;r&&t?o=[e.items[0]]:o=e.items;const i=r&&o.some(l=>l.id==null);return o.some(l=>l.operator==null)||i?Se({},e,{items:o.map(l=>bpe(l,n))}):e.items!==o?Se({},e,{items:o}):e},a7e=(e,t,n)=>r=>Se({},r,{filterModel:W1e(e,t,n)}),xD=e=>typeof e=="string"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e,qxt=(e,t,n)=>{var p;if(!e.field||!e.operator)return null;const r=n.current.getColumn(e.field);if(!r)return null;let o;if(r.valueParser){const h=r.valueParser;o=Array.isArray(e.value)?(p=e.value)==null?void 0:p.map(m=>h(m,void 0,r,n)):h(e.value,void 0,r,n)}else o=e.value;const{ignoreDiacritics:i}=n.current.rootProps;i&&(o=xD(o));const s=Se({},e,{value:o}),l=r.filterOperators;if(!(l!=null&&l.length))throw new Error(`MUI X: No filter operators found for column '${r.field}'.`);const c=l.find(h=>h.value===s.operator);if(!c)throw new Error(`MUI X: No filter operator found for column '${r.field}' and operator value '${s.operator}'.`);const u=Bxt(n),d=c.getApplyFilterFn(s,r);return typeof d!="function"?null:{item:s,fn:h=>{let m=t(h,r);return i&&(m=xD(m)),d(m,h,r,u)}}};let s7e=1;const mwr=(e,t,n,r)=>{const{items:o}=e,i=o.map(c=>qxt(c,t,n)).filter(c=>!!c);if(i.length===0)return null;if(r||!hwr())return(c,u)=>{const d={};for(let p=0;p`const shouldApply${u} = !shouldApplyFilter || shouldApplyFilter(${JSON.stringify(c.item.field)});`).join(` `)} const result$$ = { ${i.map((c,u)=>` ${JSON.stringify(String(c.item.id))}: !shouldApply${u} ? false : appliers[${u}].fn(row),`).join(` `)} }; return result$$;`.replaceAll("$$",String(s7e)));return s7e+=1,(c,u)=>s(i,c,u)},Kxt=e=>e.quickFilterExcludeHiddenColumns??!0,gwr=(e,t,n)=>{var d;const r=((d=e.quickFilterValues)==null?void 0:d.filter(Boolean))??[];if(r.length===0)return null;const o=tb(n),i=x0(n);let s;Kxt(e)?s=o.filter(p=>i[p]!==!1):s=o;const l=[],{ignoreDiacritics:c}=n.current.rootProps,u=Bxt(n);return s.forEach(p=>{const h=n.current.getColumn(p),m=h==null?void 0:h.getApplyQuickFilterFn;m&&l.push({column:h,appliers:r.map(g=>{const y=c?xD(g):g;return{fn:m(y,h,u)}})})}),function(h,m){const g={};e:for(let y=0;y{const o=mwr(e,t,n,r),i=gwr(e,t,n);return function(l,c,u){u.passingFilterItems=(o==null?void 0:o(l,c))??null,u.passingQuickFilterValues=(i==null?void 0:i(l,c))??null}},l7e=e=>e!=null,ywr=(e,t,n,r)=>(e.cleanedFilterItems||(e.cleanedFilterItems=r.filter(o=>qxt(o,t,n)!==null)),e.cleanedFilterItems),vwr=(e,t,n,r,o,i)=>{const s=ywr(i,r,o,n.items),l=e.filter(l7e),c=t.filter(l7e);if(l.length>0){const u=p=>l.some(h=>h[p.id]);if((n.logicOperator??gD().logicOperator)===fh.And){if(!s.every(u))return!1}else if(!s.some(u))return!1}if(c.length>0&&n.quickFilterValues!=null){const u=p=>c.some(h=>h[p]);if((n.quickFilterLogicOperator??gD().quickFilterLogicOperator)===fh.And){if(!n.quickFilterValues.every(u))return!1}else if(!n.quickFilterValues.some(u))return!1}return!0},bwr=e=>{if(!e)return null;const t=new RegExp(_W(e),"i");return(n,r,o,i)=>{let s=i.current.getRowFormattedValue(r,o);return i.current.ignoreDiacritics&&(s=xD(s)),s!=null?t.test(s.toString()):!1}},c7e=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),o=new RegExp(_W(r),"i");return i=>{if(i==null)return t;const s=o.test(String(i));return t?!s:s}},u7e=(e,t)=>n=>{if(!n.value)return null;const r=e?n.value:n.value.trim(),o=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return i=>{if(i==null)return t;const s=o.compare(r,i.toString())===0;return t?!s:s}},d7e=e=>()=>t=>{const n=t===""||t==null;return e?!n:n},wwr=(e=!1)=>[{value:"contains",getApplyFilterFn:c7e(e,!1),InputComponent:n0},{value:"doesNotContain",getApplyFilterFn:c7e(e,!0),InputComponent:n0},{value:"equals",getApplyFilterFn:u7e(e,!1),InputComponent:n0},{value:"doesNotEqual",getApplyFilterFn:u7e(e,!0),InputComponent:n0},{value:"startsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`^${_W(n)}.*$`,"i");return o=>o!=null?r.test(o.toString()):!1},InputComponent:n0},{value:"endsWith",getApplyFilterFn:t=>{if(!t.value)return null;const n=e?t.value:t.value.trim(),r=new RegExp(`.*${_W(n)}$`,"i");return o=>o!=null?r.test(o.toString()):!1},InputComponent:n0},{value:"isEmpty",getApplyFilterFn:d7e(!1),requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:d7e(!0),requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:t=>{if(!Array.isArray(t.value)||t.value.length===0)return null;const n=e?t.value:t.value.map(o=>o.trim()),r=new Intl.Collator(void 0,{sensitivity:"base",usage:"search"});return o=>o!=null?n.some(i=>r.compare(i,o.toString()||"")===0):!1},InputComponent:Lxt}],iy={width:100,minWidth:50,maxWidth:1/0,hideable:!0,sortable:!0,resizable:!0,filterable:!0,groupable:!0,pinnable:!0,aggregable:!0,chartable:!0,editable:!1,sortComparator:nwr,type:"string",align:"left",filterOperators:wwr(),renderEditCell:X1r,getApplyQuickFilterFn:bwr};function Yxt(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}const qP=e=>e.indexOf("Arrow")===0||e.indexOf("Page")===0||e===" "||e==="Home"||e==="End",Swr=e=>!!e.key,Xxt=e=>e==="Tab"||e==="Escape";function G1e(e){return(e.ctrlKey||e.metaKey)&&String.fromCharCode(e.keyCode)==="V"&&!e.shiftKey&&!e.altKey}function Cwr(e){return(e.ctrlKey||e.metaKey)&&String.fromCharCode(e.keyCode)==="C"&&!e.shiftKey&&!e.altKey}const Qxt=f.createContext(void 0),UY=()=>{const e=f.useContext(Qxt);if(e===void 0)throw new Error(["MUI X: Could not find the Data Grid configuration context.","It looks like you rendered your component outside of a DataGrid, DataGridPro or DataGridPremium parent component.","This can also happen if you are bundling multiple versions of the Data Grid."].join(` `));return e},Nwr="MuiDataGridVariables",q1e=f.createContext({className:"unset",tag:a.jsx("style",{href:"/unset"})});function Jxt(){return f.useContext(q1e).className}function jwr(){return f.useContext(q1e)}function Ewr(e){const t=UY(),n=sr(),r=t.hooks.useCSSVariables(),o=f.useMemo(()=>{const i=`${Nwr}-${r.id}`,s=`.${i}{${Iwr(r.variables)}}`,l=a.jsx("style",{href:`/${i}`,nonce:n.nonce,children:s});return{className:i,tag:l}},[n.nonce,r]);return a.jsx(q1e.Provider,{value:o,children:e.children})}function Iwr(e){let t="";for(const n in e)Object.hasOwn(e,n)&&e[n]!==void 0&&(t+=`${n}:${e[n]};`);return t}const _wr=["open","target","onClose","children","position","className","onExited"],Pwr=e=>{const{classes:t}=e;return Un({root:["menu"]},ii,t)},Awr=Bt(Ob,{name:"MuiDataGrid",slot:"Menu"})({zIndex:fr.zIndex.menu,[`& .${Be.menuList}`]:{outline:0}});function R6(e){var x;const{open:t,target:n,onClose:r,children:o,position:i,className:s,onExited:l}=e,c=Zn(e,_wr),u=Eo(),d=sr(),p=Pwr(d),h=Jxt(),m=f.useRef(null);Ia(()=>{var v,b;t?m.current=document.activeElement instanceof HTMLElement?document.activeElement:null:((b=(v=m.current)==null?void 0:v.focus)==null||b.call(v),m.current=null)},[t]),f.useEffect(()=>{const v=t?"menuOpen":"menuClose";u.current.publishEvent(v,{target:n})},[u,t,n]);const g=v=>{v.target&&(n===v.target||n!=null&&n.contains(v.target))||r(v)},y=v=>{Xxt(v.key)&&r(v)};return a.jsx(Awr,Se({as:d.slots.basePopper,className:be(p.root,s,h),ownerState:d,open:t,target:n,transition:!0,placement:i,onClickAway:g,onExited:l,clickAwayMouseEvent:"onMouseDown",onKeyDown:y},c,(x=d.slotProps)==null?void 0:x.basePopper,{children:o}))}const Twr=["label","icon","showInMenu","onClick"],kwr=["label","icon","showInMenu","onClick","closeMenuOnClick","closeMenu"],Mwr=Kr((e,t)=>{var d;const n=sr();if(!e.showInMenu){const{label:p,icon:h,onClick:m}=e,g=Zn(e,Twr),y=x=>{m==null||m(x)};return a.jsx(n.slots.baseIconButton,Se({size:"small",role:"menuitem","aria-label":p},g,{onClick:y},(d=n.slotProps)==null?void 0:d.baseIconButton,{ref:t,children:f.cloneElement(h,{fontSize:"small"})}))}const{label:r,icon:o,onClick:i,closeMenuOnClick:s=!0,closeMenu:l}=e,c=Zn(e,kwr),u=p=>{i==null||i(p),s&&(l==null||l())};return a.jsx(n.slots.baseMenuItem,Se({ref:t},c,{onClick:u,iconStart:o,children:r}))}),Rwr=["api","colDef","id","hasFocus","isEditable","field","value","formattedValue","row","rowNode","cellMode","tabIndex","position","onMenuOpen","onMenuClose","children","suppressChildrenValidation"],Owr=e=>typeof e.getActions=="function";function $wr(e){var G;const{id:t,hasFocus:n,tabIndex:r,position:o="bottom-end",onMenuOpen:i,onMenuClose:s,children:l,suppressChildrenValidation:c}=e,u=Zn(e,Rwr),[d,p]=f.useState(-1),[h,m]=f.useState(!1),g=Eo(),y=f.useRef(null),x=f.useRef(null),v=f.useRef(!1),b=f.useRef({}),w=$d(),S=Jo(),C=Jo(),N=sr(),j=g.current.getRowParams(t),I=[];f.Children.forEach(l,H=>{f.isValidElement(H)&&(H.type===f.Fragment?f.Children.forEach(H.props.children,F=>{f.isValidElement(F)&&I.push(F)}):H.type===Mwr||c?I.push(H):typeof H.type=="function"?H.type.name:H.type)});const _=I.filter(H=>!H.props.showInMenu),T=I.filter(H=>H.props.showInMenu),P=_.length+(T.length?1:0);f.useLayoutEffect(()=>{n||Object.entries(b.current).forEach(([H,F])=>{F==null||F.stop({},()=>{delete b.current[H]})})},[n]),f.useEffect(()=>{if(d<0||!y.current||d>=y.current.children.length)return;y.current.children[d].focus({preventScroll:!0})},[d]);const E=I.findIndex(H=>!H.props.disabled);f.useEffect(()=>{n&&d===-1&&p(E),n||(p(-1),v.current=!1)},[n,d,E]),f.useEffect(()=>{d>=P&&p(P-1)},[d,P]);const M=H=>{i&&!i(j,H)||(m(!0),p(P-1),v.current=!0)},R=H=>{s&&!s(j,H)||m(!1)},$=H=>{H.stopPropagation(),H.preventDefault(),h?R(H):M(H)},D=H=>F=>{b.current[H]=F},z=(H,F)=>W=>{p(H),v.current=!0,F&&F(W)},V=H=>{if(P<=1)return;const F=(U,K)=>{var te;if(U<0||U>I.length)return U;const J=(K==="left"?-1:1)*(w?-1:1);return(te=I[U+J])!=null&&te.props.disabled?F(U+J,K):U+J};let W=d;H.key==="ArrowRight"?W=F(d,"right"):H.key==="ArrowLeft"&&(W=F(d,"left")),!(W<0||W>=P)&&W!==d&&(H.preventDefault(),H.stopPropagation(),p(W))},B=P>0?{role:"menu",onKeyDown:V}:void 0;return a.jsxs("div",Se({ref:y,tabIndex:-1,className:Be.actionsCell},B,u,{children:[_.map((H,F)=>f.cloneElement(H,{key:F,touchRippleRef:D(F),onClick:z(F,H.props.onClick),tabIndex:d===F?r:-1})),T.length>0&&C&&a.jsx(N.slots.baseIconButton,Se({ref:x,id:C,"aria-label":g.current.getLocaleText("actionsCellMore"),"aria-haspopup":"menu","aria-expanded":h,"aria-controls":h?S:void 0,role:"menuitem",size:"small",onClick:$,touchRippleRef:D(C),tabIndex:d===_.length?r:-1},(G=N.slotProps)==null?void 0:G.baseIconButton,{children:a.jsx(N.slots.moreActionsIcon,{fontSize:"small"})})),T.length>0&&a.jsx(R6,{open:h,target:x.current,position:o,onClose:R,children:a.jsx(N.slots.baseMenuList,{id:S,className:Be.menuList,"aria-labelledby":C,autoFocusItem:!0,children:T.map((H,F)=>f.cloneElement(H,{key:F,closeMenu:R}))})})]}))}function Dwr(e){const{colDef:t,id:n}=e,r=Eo();if(!Owr(t))throw new Error("MUI X: Missing the `getActions` property in the `GridColDef`.");const o=t.getActions(r.current.getRowParams(n));return a.jsx($wr,Se({suppressChildrenValidation:!0},e,{children:o}))}const Lwr=e=>a.jsx(Dwr,Se({},e)),WY="actions",Fwr=Se({},iy,{sortable:!1,filterable:!1,aggregable:!1,chartable:!1,width:100,display:"flex",align:"center",headerAlign:"center",headerName:"",disableColumnMenu:!0,disableExport:!0,renderCell:Lwr,getApplyQuickFilterFn:()=>null}),zwr="__tree_data_group__",Zxt="__row_group_by_columns_group__",K1e="__detail_panel_toggle__";let Ni=(function(e){return e[e.NONE=0]="NONE",e[e.LEFT=1]="LEFT",e[e.RIGHT=2]="RIGHT",e[e.VIRTUAL=3]="VIRTUAL",e})({});const Bwr=["formattedValue","colDef","cellMode","row","api","id","value","rowNode","field","hasFocus","tabIndex","isEditable"],Hwr=Bt("div",{name:"MuiDataGrid",slot:"FooterCell"})({fontWeight:fr.typography.fontWeight.medium,color:fr.colors.foreground.accent}),Vwr=e=>{const{classes:t}=e;return Un({root:["footerCell"]},ii,t)};function Uwr(e){const{formattedValue:t}=e,n=Zn(e,Bwr),o={classes:sr().classes},i=Vwr(o);return a.jsx(Hwr,Se({ownerState:o,className:i.root},n,{children:t}))}const Wwr=f.memo(Uwr),Gwr=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","hasFocus","tabIndex","hideDescendantCount"],qwr=e=>{const{classes:t}=e;return Un({root:["booleanCell"]},ii,t)};function Kwr(e){const{value:t,rowNode:n}=e,r=Zn(e,Gwr),o=Eo(),i=sr(),s={classes:i.classes},l=qwr(s),u=Fn(o,T6)>0&&n.type==="group"&&i.treeData===!1,d=f.useMemo(()=>t?i.slots.booleanCellTrueIcon:i.slots.booleanCellFalseIcon,[i.slots.booleanCellFalseIcon,i.slots.booleanCellTrueIcon,t]);return u&&t===void 0?null:a.jsx(d,Se({fontSize:"small",className:l.root,titleAccess:o.current.getLocaleText(t?"booleanCellTrueLabel":"booleanCellFalseLabel"),"data-value":!!t},r))}const Ywr=f.memo(Kwr),Xwr=e=>{if(e.field!==Zxt&&zT(e.rowNode)){const t=e.aggregation;return t?t.position==="footer"?a.jsx(Wwr,Se({},e)):e.formattedValue:""}return a.jsx(Ywr,Se({},e))},Qwr=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange"],Jwr=e=>{const{classes:t}=e;return Un({root:["editBooleanCell"]},ii,t)};function Zwr(e){var v;const{id:t,value:n,field:r,className:o,hasFocus:i,onValueChange:s}=e,l=Zn(e,Qwr),c=Eo(),u=f.useRef(null),d=Jo(),[p,h]=f.useState(n),m=sr(),g={classes:m.classes},y=Jwr(g),x=f.useCallback(async b=>{const w=b.target.checked;s&&await s(b,w),h(w),await c.current.setEditCellValue({id:t,field:r,value:w},b)},[c,r,t,s]);return f.useEffect(()=>{h(n)},[n]),Ia(()=>{i&&u.current.focus()},[i]),a.jsx("label",Se({htmlFor:d,className:be(y.root,o)},l,{children:a.jsx(m.slots.baseCheckbox,Se({id:d,inputRef:u,checked:!!p,onChange:x,size:"small"},(v=m.slotProps)==null?void 0:v.baseCheckbox))}))}const eSr=e=>a.jsx(Zwr,Se({},e)),tSr=["item","applyValue","apiRef","focusElementRef","isFilterActive","headerFilterMenu","clearButton","tabIndex","slotProps"];function nSr(e){var C,N;const{item:t,applyValue:n,apiRef:r,focusElementRef:o,headerFilterMenu:i,clearButton:s,tabIndex:l,slotProps:c}=e,u=Zn(e,tSr),[d,p]=f.useState(WB(t.value)),h=sr(),m=Jo(),g=Jo(),y=((C=h.slotProps)==null?void 0:C.baseSelect)||{},x=y.native??!1,v=((N=h.slotProps)==null?void 0:N.baseSelectOption)||{},b=f.useCallback(j=>{const I=WB(j.target.value);p(I),n(Se({},t,{value:I}))},[n,t]);f.useEffect(()=>{p(WB(t.value))},[t.value]);const w=(c==null?void 0:c.root.label)??r.current.getLocaleText("filterPanelInputLabel"),S=c==null?void 0:c.root.slotProps;return a.jsxs(f.Fragment,{children:[a.jsxs(h.slots.baseSelect,Se({fullWidth:!0,labelId:m,id:g,label:w,value:d===void 0?"":String(d),onChange:b,native:x,slotProps:{htmlInput:Se({ref:o,tabIndex:l},S==null?void 0:S.htmlInput)}},y,u,c==null?void 0:c.root,{children:[a.jsx(h.slots.baseSelectOption,Se({},v,{native:x,value:"",children:r.current.getLocaleText("filterValueAny")})),a.jsx(h.slots.baseSelectOption,Se({},v,{native:x,value:"true",children:r.current.getLocaleText("filterValueTrue")})),a.jsx(h.slots.baseSelectOption,Se({},v,{native:x,value:"false",children:r.current.getLocaleText("filterValueFalse")}))]})),i,s]})}function WB(e){if(String(e).toLowerCase()==="true")return!0;if(String(e).toLowerCase()==="false")return!1}const rSr=()=>[{value:"is",getApplyFilterFn:e=>{const t=WB(e.value);return t===void 0?null:n=>!!n===t},InputComponent:nSr}],oSr=(e,t,n,r)=>e?r.current.getLocaleText("booleanCellTrueLabel"):r.current.getLocaleText("booleanCellFalseLabel"),iSr=e=>{switch(e.toLowerCase().trim()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":case"null":case"undefined":return!1;default:return}},eyt=Se({},iy,{type:"boolean",display:"flex",align:"center",headerAlign:"center",renderCell:Xwr,renderEditCell:eSr,sortComparator:Oxt,valueFormatter:oSr,filterOperators:rSr(),getApplyQuickFilterFn:()=>null,chartable:!1,pastedValueParser:e=>iSr(e)});function GY(e){for(const t in e)return!1;return!0}const tyt=Us(e=>e.sorting),O6=yr(tyt,e=>e.sortedRows),Y1e=ha(O6,rg,Mc,(e,t,n)=>e.reduce((r,o)=>{const i=t[o];if(i)r.push({id:o,model:i});else{const s=n[o];s&&zT(s)&&r.push({id:o,model:{[RI]:o}})}return r},[])),Xg=yr(tyt,e=>e.sortModel),aSr=ha(Xg,e=>e.reduce((n,r,o)=>(n[r.field]={sortDirection:r.sort,sortIndex:e.length>1?o+1:void 0},n),{}));ha(O6,e=>e.reduce((t,n,r)=>(t[n]=r,t),Object.create(null)));const qY=Us(e=>e.filter),Sd=yr(qY,e=>e.filterModel),nyt=yr(Sd,e=>e.quickFilterValues),sSr=Us(e=>e.visibleRowsLookup),p4=yr(qY,e=>e.filteredRowsLookup);yr(qY,e=>e.filteredChildrenCountLookup);yr(qY,e=>e.filteredDescendantCountLookup);const v5=ha(sSr,Y1e,(e,t)=>GY(e)?t:t.filter(n=>e[n.id]!==!1)),qE=ha(v5,e=>e.map(t=>t.id)),X1e=ha(p4,Y1e,(e,t)=>GY(e)?t:t.filter(n=>e[n.id]!==!1)),ryt=ha(X1e,e=>e.map(t=>t.id));ha(qE,Mc,(e,t)=>{const n={};let r=0;return e.reduce((o,i)=>{const s=t[i];return n[s.depth]||(n[s.depth]=0),s.depth>r&&(n[s.depth]=0),r=s.depth,n[s.depth]+=1,o[i]=n[s.depth],o},{})});const lSr=ha(X1e,Mc,T6,(e,t,n)=>n<2?[e]:e.reduce((r,o)=>{var s;const i=(s=t[o.id])==null?void 0:s.depth;return i===void 0||(r[i]||(r[i]=[]),r[i].push(o)),r},[[]])),oyt=yr(lSr,e=>e[0]??[]),Q1e=yr(v5,e=>e.length),QO=yr(oyt,e=>e.length),iyt=yr(X1e,e=>e.length);yr(iyt,QO,(e,t)=>e-t);const KY=ha(Sd,$b,(e,t)=>{var n;return(n=e.items)==null?void 0:n.filter(r=>{var s,l;if(!r.field)return!1;const o=t[r.field];if(!(o!=null&&o.filterOperators)||((s=o==null?void 0:o.filterOperators)==null?void 0:s.length)===0)return!1;const i=o.filterOperators.find(c=>c.value===r.operator);return i?!i.InputComponent||r.value!=null&&((l=r.value)==null?void 0:l.toString())!=="":!1})}),cSr=ha(KY,e=>e.reduce((n,r)=>(n[r.field]?n[r.field].push(r):n[r.field]=[r],n),{})),uSr=ha(qE,e=>e.reduce((t,n,r)=>(t[n]=r,t),Object.create(null))),Ox=Us(e=>e.rowSelection),$6=ha(Ox,x2),YY=yr(Ox,iyt,(e,t)=>e.type==="include"?e.ids.size:t-e.ids.size),ayt=ha(Ox,rg,GP,(e,t,n)=>{const r=new Map;if(e.type==="include")for(const o of e.ids)r.set(o,t[o]);else for(let o=0;oRI in t?t[RI]:e.props.getRowId?e.props.getRowId(t):t.id),dSr=Us(e=>e.props.isRowSelectable);function syt(e,t){var c;const n=Mc(e),r=O6(e),o=p4(e),i=n[t];if(!i||i.type!=="group")return[];const s=[],l=r.findIndex(u=>u===t)+1;for(let u=l;ui.depth;u+=1){const d=r[u];o[d]!==!1&&e.current.isRowSelectable(d)&&s.push(d)}return s}const fSr=yr(cg,Mc,p4,$6,rg,dSr,(e,t,n,r,o,i,{groupId:s,autoSelectParents:l})=>{const c=t[s],u={id:s,row:o[s],columns:e};let d=!0;if(typeof i=="function"&&o[s]&&(d=i(u)),!c||c.type!=="group"||r.has(s))return{isIndeterminate:!1,isChecked:r.has(s),isSelectable:d};let p=!1,h=!1;const m=g=>{if(n[g]===!1||p&&h)return;const y=t[g];(y==null?void 0:y.type)==="group"&&y.children.forEach(m);const x={id:g,row:o[g],columns:e};(typeof i=="function"&&o[g]?i(x):!0)&&(r.has(g)?p=!0:h=!0)};return m(s),{isIndeterminate:p&&h,isChecked:l?p&&!h:!1,isSelectable:d}});function J1e(e){return e.signature===ry.DataGrid?e.checkboxSelection&&e.disableMultipleRowSelection!==!0:!e.disableMultipleRowSelection}const pSr=(e,t)=>{const n=[];let r=t;for(;r!=null&&r!==pc;){const o=e[r];if(!o)return n;n.push(r),r=o.parent}return n},hSr=(e,t,n)=>{const r=e[n];if(!r)return[];const o=r.parent;return o==null?[]:e[o].children.filter(s=>s!==n&&t[s]!==!1)},BM=(e,t,n,r,o,i,s=$6(e))=>{const l=p4(e),c=new Set([]);if(!(!r&&!o||l[n]===!1)){if(r){const u=t[n];(u==null?void 0:u.type)==="group"&&syt(e,n).forEach(p=>{i(p),c.add(p)})}if(o){const u=h=>{const m=t[h];return m?m.type!=="group"?e.current.isRowSelectable(h)?s.has(h)||c.has(h):!0:s.has(h)||c.has(h)?!0:m.children.every(u):!1},d=h=>{const m=hSr(t,l,h),g=m.every(y=>e.current.isRowSelectable(y)?u(y):!0);if(m.length===0||g){const y=t[h],x=y==null?void 0:y.parent;x!=null&&x!==pc&&e.current.isRowSelectable(x)&&(i(x),c.add(x),d(x))}},p=t[n];if(!p||p.parent===pc)return;d(n)}}},f7e=(e,t,n,r,o,i)=>{const s=$6(e);if(!(!o&&!r)&&(o&&pSr(t,n).forEach(c=>{s.has(c)&&i(c)}),r)){const l=t[n];(l==null?void 0:l.type)==="group"&&syt(e,n).forEach(u=>{i(u)})}},mSr=["field","id","formattedValue","row","rowNode","colDef","isEditable","cellMode","hasFocus","tabIndex","api"],gSr=e=>{const{classes:t}=e;return Un({root:["checkboxInput"]},ii,t)},xSr=Kr(function(t,n){var C,N;const{field:r,id:o,rowNode:i,tabIndex:s}=t,l=Zn(t,mSr),c=Eo(),u=sr(),d={classes:u.classes},p=gSr(d),{isIndeterminate:h,isChecked:m,isSelectable:g}=Fn(c,fSr,{groupId:o,autoSelectParents:((C=u.rowSelectionPropagation)==null?void 0:C.parents)??!1}),y=!g,x=j=>{if(y)return;const I={value:j.target.checked,id:o};c.current.publishEvent("rowSelectionCheckboxChange",I,j)};f.useLayoutEffect(()=>{if(s===0&&!y){const j=c.current.getCellElement(o,r);j&&(j.tabIndex=-1)}},[c,s,o,r,y]);const v=no(j=>{j.key===" "&&j.stopPropagation()}),b=no(j=>{if(y){j.preventDefault();return}}),w=no(()=>{});if(i.type==="footer"||i.type==="pinnedRow")return null;const S=c.current.getLocaleText(m&&!h?"checkboxSelectionUnselectRow":"checkboxSelectionSelectRow");return a.jsx(u.slots.baseCheckbox,Se({tabIndex:y?-1:s,checked:m&&!h,onChange:x,onClick:b,onMouseDown:w,className:be(p.root,y&&"Mui-disabled"),disabled:y,material:{disableRipple:y},slotProps:{htmlInput:{"aria-disabled":y||void 0,"aria-label":S,name:"select_row"}},onKeyDown:v,indeterminate:h},(N=u.slotProps)==null?void 0:N.baseCheckbox,l,{ref:n}))}),ySr=xSr,XY=Us(e=>e.focus),em=yr(XY,e=>e.cell),vSr=yr(XY,e=>e.columnHeader);yr(XY,e=>e.columnHeaderFilter);const AW=yr(XY,e=>e.columnGroupHeader),QY=Us(e=>e.tabIndex),Z1e=yr(QY,e=>e.cell),lyt=yr(QY,e=>e.columnHeader);yr(QY,e=>e.columnHeaderFilter);const bSr=yr(QY,e=>e.columnGroupHeader),wSr=100,SSr=e=>e?0:100,cyt=(e,t,n)=>t>0&&e>0?Math.ceil(e/t):e===-1?n+2:0,uyt=e=>({page:0,pageSize:e?0:100}),CSr=(e,t=0)=>t===0?e:Math.max(Math.min(e,t-1),0),dyt=(e,t)=>{if(t===ry.DataGrid&&e>wSr)throw new Error(["MUI X: `pageSize` cannot exceed 100 in the MIT version of the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` `))},NSr=-1,h4=Us(e=>e.pagination),fyt=yr(h4,e=>e.enabled&&e.paginationMode==="client"),sf=yr(h4,e=>e.paginationModel),c2=yr(h4,e=>e.rowCount),WR=yr(h4,e=>e.meta),jSr=yr(sf,e=>e.page),ESr=yr(sf,e=>e.pageSize),pyt=yr(sf,c2,(e,t)=>cyt(t,e.pageSize,e.page)),ewe=ha(fyt,sf,Mc,T6,v5,oyt,(e,t,n,r,o,i)=>{var g;if(!e||!o||o.length===0)return null;const s=i.length,l=Math.min(t.pageSize*t.page,s-1),c=t.pageSize===NSr?s-1:Math.min(l+t.pageSize-1,s-1);if(l===-1||c===-1)return null;if(r<2)return{firstRowIndex:l,lastRowIndex:c};const u=i[l],d=c-l+1,p=o.findIndex(y=>y.id===u.id);let h=p,m=0;for(;h0)&&(h+=1),x===0&&(m+=1))}return{firstRowIndex:p,lastRowIndex:h-1}}),ISr=ha(v5,ewe,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),hyt=ha(qE,ewe,(e,t)=>t?e.slice(t.firstRowIndex,t.lastRowIndex+1):[]),D6=ha(fyt,ewe,ISr,v5,(e,t,n,r)=>e?{rows:n,range:t,rowIdToIndexMap:n.reduce((o,i,s)=>(o.set(i.id,s),o),new Map)}:{rows:r,range:r.length===0?null:{firstRowIndex:0,lastRowIndex:r.length-1},rowIdToIndexMap:r.reduce((o,i,s)=>(o.set(i.id,s),o),new Map)}),_Sr=["field","colDef"],PSr=e=>{const{classes:t}=e;return Un({root:["checkboxInput"]},ii,t)},ASr=Kr(function(t,n){var j;const r=Zn(t,_Sr),[,o]=f.useState(!1),i=Eo(),s=sr(),l={classes:s.classes},c=PSr(l),u=Fn(i,lyt),d=Fn(i,Ox),p=Fn(i,qE),h=Fn(i,hyt),m=f.useMemo(()=>{const I=s.isRowSelectable;if(typeof I!="function"||d.type==="exclude")return d;const _={type:"include",ids:new Set};for(const T of d.ids)s.keepNonExistentRowsSelected&&_.ids.add(T),i.current.getRow(T)&&I(i.current.getRowParams(T))&&_.ids.add(T);return _},[i,s.isRowSelectable,s.keepNonExistentRowsSelected,d]),g=f.useMemo(()=>{const I=!s.pagination||!s.checkboxSelectionVisibleOnly||s.paginationMode==="server"?p:h,_=new Set;for(let T=0;T{const I=x2(m);let _=0;for(const T of g)I.has(T)&&(_+=1);return _},[m,g]),x=f.useMemo(()=>{if(y===0)return!1;const I=x2(m);for(const _ of g)if(!I.has(_))return!0;return!1},[y,m,g]),v=y>0,b=I=>{const _={value:I.target.checked};i.current.publishEvent("headerSelectionCheckboxChange",_)},w=u!==null&&u.field===t.field?0:-1;f.useLayoutEffect(()=>{const I=i.current.getColumnHeaderElement(t.field);w===0&&I&&(I.tabIndex=-1)},[w,i,t.field]);const S=f.useCallback(I=>{I.key===" "&&i.current.publishEvent("headerSelectionCheckboxChange",{value:!v})},[i,v]),C=f.useCallback(()=>{o(I=>!I)},[]);f.useEffect(()=>i.current.subscribeEvent("rowSelectionChange",C),[i,C]);const N=i.current.getLocaleText(v&&!x?"checkboxSelectionUnselectAllRows":"checkboxSelectionSelectAllRows");return a.jsx(s.slots.baseCheckbox,Se({indeterminate:x,checked:v&&!x,onChange:b,className:c.root,slotProps:{htmlInput:{"aria-label":N,name:"select_all_rows"}},tabIndex:w,onKeyDown:S,disabled:!J1e(s)},(j=s.slotProps)==null?void 0:j.baseCheckbox,r,{ref:n}))}),Ex="__check__",m4=Se({},eyt,{type:"custom",field:Ex,width:50,resizable:!1,sortable:!1,filterable:!1,aggregable:!1,chartable:!1,disableColumnMenu:!0,disableReorder:!0,disableExport:!0,getApplyQuickFilterFn:()=>null,display:"flex",valueGetter:(e,t,n,r)=>{const o=BT(r,t);return r.current.isRowSelected(o)},rowSpanValueGetter:(e,t,n,r)=>BT(r,t),renderHeader:e=>a.jsx(ASr,Se({},e)),renderCell:e=>a.jsx(ySr,Se({},e))}),TSr=["item","applyValue","type","apiRef","focusElementRef","slotProps","isFilterActive","headerFilterMenu","clearButton","tabIndex","disabled"];function p7e(e,t){if(e==null)return"";const n=new Date(e);return Number.isNaN(n.getTime())?"":t==="date"?n.toISOString().substring(0,10):t==="datetime-local"?(n.setMinutes(n.getMinutes()-n.getTimezoneOffset()),n.toISOString().substring(0,19)):n.toISOString().substring(0,10)}function M_(e){var C;const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,slotProps:s,headerFilterMenu:l,clearButton:c,tabIndex:u,disabled:d}=e,p=Zn(e,TSr),h=s==null?void 0:s.root.slotProps,m=hh(),[g,y]=f.useState(()=>p7e(t.value,r)),[x,v]=f.useState(!1),b=Jo(),w=sr(),S=f.useCallback(N=>{m.clear();const j=N.target.value;y(j),v(!0),m.start(w.filterDebounceMs,()=>{const I=new Date(j);n(Se({},t,{value:Number.isNaN(I.getTime())?void 0:I})),v(!1)})},[n,t,w.filterDebounceMs,m]);return f.useEffect(()=>{const N=p7e(t.value,r);y(N)},[t.value,r]),a.jsxs(f.Fragment,{children:[a.jsx(w.slots.baseTextField,Se({fullWidth:!0,id:b,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),value:g,onChange:S,type:r||"text",disabled:d,inputRef:i,slotProps:Se({},h,{input:Se({endAdornment:x?a.jsx(w.slots.loadIcon,{fontSize:"small",color:"action"}):null},h==null?void 0:h.input),htmlInput:Se({max:r==="datetime-local"?"9999-12-31T23:59":"9999-12-31",tabIndex:u},h==null?void 0:h.htmlInput)})},(C=w.slotProps)==null?void 0:C.baseTextField,p,s==null?void 0:s.root)),l,c]})}function R_(e,t,n,r){if(!e.value)return null;const o=new Date(e.value);n?o.setSeconds(0,0):(o.setMinutes(o.getMinutes()+o.getTimezoneOffset()),o.setHours(0,0,0,0));const i=o.getTime();return s=>{if(!s)return!1;if(r)return t(s.getTime(),i);const l=new Date(s);return n?l.setSeconds(0,0):l.setHours(0,0,0,0),t(l.getTime(),i)}}const myt=e=>[{value:"is",getApplyFilterFn:t=>R_(t,(n,r)=>n===r,e),InputComponent:M_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"not",getApplyFilterFn:t=>R_(t,(n,r)=>n!==r,e),InputComponent:M_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"after",getApplyFilterFn:t=>R_(t,(n,r)=>n>r,e,e),InputComponent:M_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"onOrAfter",getApplyFilterFn:t=>R_(t,(n,r)=>n>=r,e,e),InputComponent:M_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"before",getApplyFilterFn:t=>R_(t,(n,r)=>nR_(t,(n,r)=>n<=r,e,e),InputComponent:M_,InputComponentProps:{type:e?"datetime-local":"date"}},{value:"isEmpty",getApplyFilterFn:()=>t=>t==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>t=>t!=null,requiresFilterValue:!1}],kSr=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","hasFocus","inputProps","isValidating","isProcessingProps","onValueChange","slotProps"],MSr=Bt(Ob,{slot:"internal"})({fontSize:"inherit"}),RSr=e=>{const{classes:t}=e;return Un({root:["editInputCell"]},ii,t)};function OSr(e){var S,C;const{id:t,value:n,field:r,colDef:o,hasFocus:i,onValueChange:s,slotProps:l}=e,c=Zn(e,kSr),u=o.type==="dateTime",d=Eo(),p=f.useRef(null),h=f.useMemo(()=>{let N;n==null?N=null:n instanceof Date?N=n:N=new Date((n??"").toString());let j;return N==null||Number.isNaN(N.getTime())?j="":j=new Date(N.getTime()-N.getTimezoneOffset()*60*1e3).toISOString().substr(0,u?16:10),{parsed:N,formatted:j}},[n,u]),[m,g]=f.useState(h),y=sr(),x={classes:y.classes},v=RSr(x),b=f.useCallback(N=>{if(N==="")return null;const[j,I]=N.split("T"),[_,T,P]=j.split("-"),E=new Date;if(E.setFullYear(Number(_),Number(T)-1,Number(P)),E.setHours(0,0,0,0),I){const[M,R]=I.split(":");E.setHours(Number(M),Number(R),0,0)}return E},[]),w=f.useCallback(async N=>{const j=N.target.value,I=b(j);s&&await s(N,I),g({parsed:I,formatted:j}),d.current.setEditCellValue({id:t,field:r,value:I},N)},[d,r,t,s,b]);return f.useEffect(()=>{g(N=>{var j,I;return h.parsed!==N.parsed&&((j=h.parsed)==null?void 0:j.getTime())!==((I=N.parsed)==null?void 0:I.getTime())?h:N})},[h]),Ia(()=>{i&&p.current.focus()},[i]),a.jsx(MSr,Se({as:y.slots.baseInput,inputRef:p,fullWidth:!0,className:v.root,type:u?"datetime-local":"date",value:m.formatted,onChange:w},c,l==null?void 0:l.root,{slotProps:{htmlInput:Se({max:u?"9999-12-31T23:59":"9999-12-31"},(C=(S=l==null?void 0:l.root)==null?void 0:S.slotProps)==null?void 0:C.htmlInput)}}))}const gyt=e=>a.jsx(OSr,Se({},e));function xyt({value:e,columnType:t,rowId:n,field:r}){if(!(e instanceof Date))throw new Error([`MUI X: \`${t}\` column type only accepts \`Date\` objects as values.`,"Use `valueGetter` to transform the value into a `Date` object.",`Row ID: ${n}, field: "${r}".`].join(` `))}const $Sr=(e,t,n,r)=>{if(!e)return"";const o=BT(r,t);return Txt(t)&&!(e instanceof Date)?e:(xyt({value:e,columnType:"date",rowId:o,field:n.field}),e.toLocaleDateString())},DSr=(e,t,n,r)=>{if(!e)return"";const o=BT(r,t);return Txt(t)&&!(e instanceof Date)?e:(xyt({value:e,columnType:"dateTime",rowId:o,field:n.field}),e.toLocaleString())},LSr=Se({},iy,{type:"date",sortComparator:$xt,valueFormatter:$Sr,filterOperators:myt(),renderEditCell:gyt,pastedValueParser:e=>new Date(e)}),FSr=Se({},iy,{type:"dateTime",sortComparator:$xt,valueFormatter:DSr,filterOperators:myt(!0),renderEditCell:gyt,pastedValueParser:e=>new Date(e)}),u2=e=>e==null?null:Number(e),zSr=e=>e==null||Number.isNaN(e)||e===""?null:t=>u2(t)===u2(e),BSr=()=>[{value:"=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>u2(t)===e.value,InputComponent:n0,InputComponentProps:{type:"number"}},{value:"!=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>u2(t)!==e.value,InputComponent:n0,InputComponentProps:{type:"number"}},{value:">",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:u2(t)>e.value,InputComponent:n0,InputComponentProps:{type:"number"}},{value:">=",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:u2(t)>=e.value,InputComponent:n0,InputComponentProps:{type:"number"}},{value:"<",getApplyFilterFn:e=>e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:u2(t)e.value==null||Number.isNaN(e.value)?null:t=>t==null?!1:u2(t)<=e.value,InputComponent:n0,InputComponentProps:{type:"number"}},{value:"isEmpty",getApplyFilterFn:()=>e=>e==null,requiresFilterValue:!1},{value:"isNotEmpty",getApplyFilterFn:()=>e=>e!=null,requiresFilterValue:!1},{value:"isAnyOf",getApplyFilterFn:e=>!Array.isArray(e.value)||e.value.length===0?null:t=>t!=null&&e.value.includes(Number(t)),InputComponent:Lxt,InputComponentProps:{type:"number"}}],HSr=Se({},iy,{type:"number",align:"right",headerAlign:"right",sortComparator:Oxt,valueParser:e=>e===""?null:Number(e),valueFormatter:e=>owr(e)?e.toLocaleString():e||"",filterOperators:BSr(),getApplyQuickFilterFn:zSr});function yD(e){return(e==null?void 0:e.type)==="singleSelect"}function OI(e,t){if(e)return typeof e.valueOptions=="function"?e.valueOptions(Se({field:e.field},t)):e.valueOptions}function TW(e,t,n){if(t===void 0)return;const r=t.find(o=>{const i=n(o);return String(i)===String(e)});return n(r)}const VSr=["id","value","formattedValue","api","field","row","rowNode","colDef","cellMode","isEditable","tabIndex","className","hasFocus","isValidating","isProcessingProps","error","onValueChange","initialOpen","slotProps"];function USr(e){return"key"in e&&!!e.key}function WSr(e){var T,P;const t=sr(),{id:n,value:r,field:o,row:i,colDef:s,hasFocus:l,error:c,onValueChange:u,initialOpen:d=t.editMode===bb.Cell,slotProps:p}=e,h=Zn(e,VSr),m=Eo(),g=f.useRef(null),y=f.useRef(null),[x,v]=f.useState(d),w=(((T=t.slotProps)==null?void 0:T.baseSelect)||{}).native??!1;if(Ia(()=>{var E;l&&((E=y.current)==null||E.focus())},[l]),!yD(s))return null;const S=OI(s,{id:n,row:i});if(!S)return null;const C=s.getOptionValue,N=s.getOptionLabel,j=async E=>{if(!yD(s)||!S)return;v(!1);const M=E.target,R=TW(M.value,S,C);u&&await u(E,R),await m.current.setEditCellValue({id:n,field:o,value:R},E)},I=(E,M)=>{if(t.editMode===bb.Row){v(!1);return}if(M==="backdropClick"||E.key==="Escape"){const R=m.current.getCellParams(n,o);m.current.publishEvent("cellEditStop",Se({},R,{reason:E.key==="Escape"?Ax.escapeKeyDown:Ax.cellFocusOut}))}},_=E=>{USr(E)&&E.key==="Enter"||v(!0)};return!S||!s?null:a.jsx(t.slots.baseSelect,Se({ref:g,value:r,onChange:j,open:x,onOpen:_,onClose:I,error:c,native:w,fullWidth:!0,slotProps:{htmlInput:{ref:y}}},h,p==null?void 0:p.root,(P=t.slotProps)==null?void 0:P.baseSelect,{children:S.map(E=>{var R;const M=C(E);return f.createElement(t.slots.baseSelectOption,Se({},((R=t.slotProps)==null?void 0:R.baseSelectOption)||{},{native:w,key:M,value:M}),N(E))})}))}const GSr=e=>a.jsx(WSr,Se({},e)),qSr=["item","applyValue","type","apiRef","focusElementRef","tabIndex","isFilterActive","clearButton","headerFilterMenu","slotProps"],KSr=({column:e,OptionComponent:t,getOptionLabel:n,getOptionValue:r,isSelectNative:o,baseSelectOptionProps:i})=>["",...OI(e)||[]].map(l=>{const c=r(l);let u=n(l);return u===""&&(u=" "),f.createElement(t,Se({},i,{native:o,key:c,value:c}),u)});function h7e(e){var N,j,I,_,T;const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,tabIndex:s,clearButton:l,headerFilterMenu:c,slotProps:u}=e,d=Zn(e,qSr),p=t.value??"",h=Jo(),m=Jo(),g=sr(),y=((j=(N=g.slotProps)==null?void 0:N.baseSelect)==null?void 0:j.native)??!1,x=o.current.getColumn(t.field),v=x.getOptionValue,b=x.getOptionLabel,w=f.useMemo(()=>OI(x),[x]),S=f.useCallback(P=>{let E=P.target.value;E=TW(E,w,v),n(Se({},t,{value:E}))},[w,v,n,t]);if(!x||!yD(x))return null;const C=(u==null?void 0:u.root.label)??o.current.getLocaleText("filterPanelInputLabel");return a.jsxs(f.Fragment,{children:[a.jsx(g.slots.baseSelect,Se({fullWidth:!0,id:h,label:C,labelId:m,value:p,onChange:S,slotProps:{htmlInput:Se({tabIndex:s,ref:i,type:r||"text",placeholder:(u==null?void 0:u.root.placeholder)??o.current.getLocaleText("filterPanelInputPlaceholder")},(I=u==null?void 0:u.root.slotProps)==null?void 0:I.htmlInput)},native:y},(_=g.slotProps)==null?void 0:_.baseSelect,d,u==null?void 0:u.root,{children:KSr({column:x,OptionComponent:g.slots.baseSelectOption,getOptionLabel:b,getOptionValue:v,isSelectNative:y,baseSelectOptionProps:(T=g.slotProps)==null?void 0:T.baseSelectOption})})),c,l]})}const YSr=["item","applyValue","type","apiRef","focusElementRef","slotProps"];function XSr(e){const{item:t,applyValue:n,type:r,apiRef:o,focusElementRef:i,slotProps:s}=e,l=Zn(e,YSr),c=Jo(),u=sr(),d=o.current.getColumn(t.field),p=d.getOptionValue,h=d.getOptionLabel,m=f.useCallback((b,w)=>p(b)===p(w),[p]),g=f.useMemo(()=>OI(d)||[],[d]),y=f.useMemo(()=>Array.isArray(t.value)?t.value.reduce((b,w)=>{const S=g.find(C=>p(C)===w);return S!=null&&b.push(S),b},[]):[],[p,t.value,g]),x=f.useCallback((b,w)=>{n(Se({},t,{value:w.map(p)}))},[n,t,p]);if(!d||!yD(d))return null;const v=u.slots.baseAutocomplete;return a.jsx(v,Se({multiple:!0,options:g,isOptionEqualToValue:m,id:c,value:y,onChange:x,getOptionLabel:h,label:o.current.getLocaleText("filterPanelInputLabel"),placeholder:o.current.getLocaleText("filterPanelInputPlaceholder"),slotProps:{textField:{type:r||"text",inputRef:i}}},l,s==null?void 0:s.root))}const O_=e=>e==null||!V1e(e)?e:e.value,QSr=()=>[{value:"is",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>O_(t)===O_(e.value),InputComponent:h7e},{value:"not",getApplyFilterFn:e=>e.value==null||e.value===""?null:t=>O_(t)!==O_(e.value),InputComponent:h7e},{value:"isAnyOf",getApplyFilterFn:e=>{if(!Array.isArray(e.value)||e.value.length===0)return null;const t=e.value.map(O_);return n=>t.includes(O_(n))},InputComponent:XSr}],JSr=e=>typeof e[0]=="object",ZSr=e=>V1e(e)?e.value:e,e2r=e=>V1e(e)?e.label:String(e),t2r=Se({},iy,{type:"singleSelect",getOptionLabel:e2r,getOptionValue:ZSr,valueFormatter(e,t,n,r){const o=BT(r,t);if(!yD(n))return"";const i=OI(n,{id:o,row:t});if(e==null)return"";if(!i)return e;if(!JSr(i))return n.getOptionLabel(e);const s=i.find(l=>n.getOptionValue(l)===e);return s?n.getOptionLabel(s):""},renderEditCell:GSr,filterOperators:QSr(),pastedValueParser:(e,t,n)=>{const r=n,o=OI(r)||[],i=r.getOptionValue;if(o.find(l=>i(l)===e))return e}}),n2r="string",r2r=()=>({string:iy,number:HSr,date:LSr,dateTime:FSr,boolean:eyt,singleSelect:t2r,[WY]:Fwr,custom:iy}),twe=Us(e=>e.headerFiltering),yyt=yr(twe,e=>(e==null?void 0:e.enabled)??!1),o2r=yr(twe,e=>e.editing),i2r=yr(twe,e=>e.menuOpen),JY=Us(e=>e.columnGrouping),vyt=ha(JY,e=>(e==null?void 0:e.unwrappedGroupingModel)??{}),byt=ha(JY,e=>(e==null?void 0:e.lookup)??{}),a2r=ha(JY,e=>(e==null?void 0:e.headerStructure)??[]),L6=yr(JY,e=>(e==null?void 0:e.maxDepth)??0),wyt=["maxWidth","minWidth","width","flex"],Une=r2r();function s2r({initialFreeSpace:e,totalFlexUnits:t,flexColumns:n}){const r=new Set(n.map(s=>s.field)),o={all:{},frozenFields:[],freeze:s=>{const l=o.all[s];l&&l.frozen!==!0&&(o.all[s].frozen=!0,o.frozenFields.push(s))}};function i(){if(o.frozenFields.length===r.size)return;const s={min:{},max:{}};let l=e,c=t,u=0;o.frozenFields.forEach(d=>{l-=o.all[d].computedWidth,c-=o.all[d].flex});for(let d=0;dp.maxWidth&&(u+=p.maxWidth-m,m=p.maxWidth,s.max[p.field]=!0),o.all[p.field]={frozen:!1,computedWidth:m,flex:p.flex}}u<0?Object.keys(s.max).forEach(d=>{o.freeze(d)}):u>0?Object.keys(s.min).forEach(d=>{o.freeze(d)}):n.forEach(({field:d})=>{o.freeze(d)}),i()}return i(),o.all}const wpe=(e,t)=>{const n={};let r=0,o=0;const i=[];e.orderedFields.forEach(c=>{let u=e.lookup[c],d=0,p=!1;e.columnVisibilityModel[c]!==!1&&(u.flex&&u.flex>0?(r+=u.flex,p=!0):d=GE(u.width||iy.width,u.minWidth||iy.minWidth,u.maxWidth||iy.maxWidth),o+=d),u.computedWidth!==d&&(u=Se({},u,{computedWidth:d})),p&&i.push(u),n[c]=u});const s=t===void 0?0:t.viewportOuterSize.width-(t.hasScrollY?t.scrollbarSize:0),l=Math.max(s-o,0);if(r>0&&s>0){const c=s2r({initialFreeSpace:l,totalFlexUnits:r,flexColumns:i});Object.keys(c).forEach(u=>{n[u]=Se({},n[u],{computedWidth:c[u].computedWidth})})}return Se({},e,{lookup:n})},l2r=(e,t)=>{if(!t)return e;const{orderedFields:n=[],dimensions:r={}}=t,o=Object.keys(r);if(o.length===0&&n.length===0)return e;const i={},s=[];for(let d=0;d!i[d])],c=Se({},e.lookup);for(let d=0;d{h[m]=g===-1?1/0:g}),c[p]=h}return Se({},e,{orderedFields:l,lookup:c})};function Wne(e){let t=Une[n2r];return e&&Une[e]&&(t=Une[e]),t}const sP=({apiRef:e,columnsToUpsert:t,initialState:n,columnVisibilityModel:r=x0(e),keepOnlyColumnsToUpsert:o=!1,updateInitialVisibilityModel:i=!1})=>{var p,h;const s=!e.current.state.columns;let l;if(s)l={orderedFields:[],lookup:{},columnVisibilityModel:r,initialColumnVisibilityModel:r};else{const m=oy(e);l={orderedFields:o?[]:[...m.orderedFields],lookup:o?{}:Se({},m.lookup),columnVisibilityModel:r,initialColumnVisibilityModel:i?r:m.initialColumnVisibilityModel}}const c={};if(o&&!s)for(const m in l.lookup)Object.prototype.hasOwnProperty.call(l.lookup,m)&&(c[m]=!1);t.forEach(m=>{const{field:g}=m;c[g]=!0;let y=l.lookup[g];y==null?(y=Se({},Wne(m.type),{field:g,hasBeenResized:!1}),l.orderedFields.push(g)):o&&l.orderedFields.push(g),y&&y.type!==m.type&&(y=Se({},Wne(m.type),{field:g}));let x=y.hasBeenResized;wyt.forEach(w=>{m[w]!==void 0&&(x=!0,m[w]===-1&&(m[w]=1/0))});const v=Se({},Wne(m.type),{hasBeenResized:x,field:g});let b;for(b in m)m[b]!==void 0&&b!=="field"&&(v[b]=m[b]);l.lookup[g]=eI(y,v)}),o&&!s&&Object.keys(l.lookup).forEach(m=>{c[m]||delete l.lookup[m]});const u=e.current.unstable_applyPipeProcessors("hydrateColumns",l),d=l2r(u,n);return wpe(d,((h=(p=e.current).getRootDimensions)==null?void 0:h.call(p))??void 0)};function ZY(e,t){if(t.listView)return 0;const n=k6(e),r=L6(e),o=yyt(e),i=Math.floor(t.columnHeaderHeight*n),s=Math.floor((t.columnGroupHeaderHeight??t.columnHeaderHeight)*n),l=o?Math.floor((t.headerFilterHeight??t.columnHeaderHeight)*n):0;return i+s*r+l}const kW=1,Syt=1.5,c2r=e=>{const{scrollDirection:t,classes:n}=e,r={root:["scrollArea",`scrollArea--${t}`]};return Un(r,ii,n)},u2r=Ai("div",{name:"MuiDataGrid",slot:"ScrollArea",overridesResolver:(e,t)=>[{[`&.${Be["scrollArea--left"]}`]:t["scrollArea--left"]},{[`&.${Be["scrollArea--right"]}`]:t["scrollArea--right"]},{[`&.${Be["scrollArea--up"]}`]:t["scrollArea--up"]},{[`&.${Be["scrollArea--down"]}`]:t["scrollArea--down"]},t.scrollArea]})(()=>({position:"absolute",zIndex:101,[`&.${Be["scrollArea--left"]}`]:{top:0,left:0,width:20,bottom:0},[`&.${Be["scrollArea--right"]}`]:{top:0,right:0,width:20,bottom:0},[`&.${Be["scrollArea--up"]}`]:{top:0,left:0,right:0,height:20},[`&.${Be["scrollArea--down"]}`]:{bottom:0,left:0,right:0,height:20}})),d2r=yr(Rl,(e,t)=>t==="left"?e.leftPinnedWidth:t==="right"?e.rightPinnedWidth+(e.hasScrollX?e.scrollbarSize:0):0);function f2r(e){const t=Eo(),[n,r]=f.useState("none");return Nr(t,"columnHeaderDragStart",()=>r("horizontal")),Nr(t,"columnHeaderDragEnd",()=>r("none")),Nr(t,"rowDragStart",()=>r("vertical")),Nr(t,"rowDragEnd",()=>r("none")),n==="none"?null:n==="horizontal"?a.jsx(p2r,Se({},e)):a.jsx(h2r,Se({},e))}function p2r(e){const{scrollDirection:t,scrollPosition:n}=e,r=f.useRef(null),o=Eo(),i=hh(),s=Fn(o,k6),l=Fn(o,F1e),c=Fn(o,d2r,t),u=()=>{const y=Rl(o);if(t==="left")return n.current.left>0;if(t==="right"){const x=l-y.viewportInnerSize.width;return n.current.left{let x;if(y.preventDefault(),t==="left")x=y.clientX-r.current.getBoundingClientRect().right;else if(t==="right")x=Math.max(1,y.clientX-r.current.getBoundingClientRect().left);else throw new Error("MUI X: Wrong drag direction");x=(x-kW)*Syt+kW,i.start(0,()=>{o.current.scroll({left:n.current.left+x,top:n.current.top})})});return a.jsx(Cyt,Se({},e,{ref:r,getCanScrollMore:u,style:m,handleDragOver:g}))}function h2r(e){const{scrollDirection:t,scrollPosition:n}=e,r=f.useRef(null),o=Eo(),i=hh(),s=Fn(o,Ext),l=()=>{const h=Rl(o);if(t==="up")return n.current.top>0;if(t==="down"){const g=(s.currentPageTotalHeight||0)-h.viewportInnerSize.height-(h.hasScrollX?h.scrollbarSize:0);return n.current.top{let m;if(h.preventDefault(),t==="up")m=h.clientY-r.current.getBoundingClientRect().bottom;else if(t==="down")m=Math.max(1,h.clientY-r.current.getBoundingClientRect().top);else throw new Error("MUI X: Wrong drag direction");m=(m-kW)*Syt+kW,i.start(0,()=>{o.current.scroll({left:n.current.left,top:n.current.top+m})})});return a.jsx(Cyt,Se({},e,{ref:r,getCanScrollMore:l,style:d,handleDragOver:p}))}const Cyt=Kr(function(t,n){const{scrollDirection:r,getCanScrollMore:o,style:i,handleDragOver:s}=t,l=Eo(),[c,u]=f.useState(o),d=sr(),p=Se({},d,{scrollDirection:r}),h=c2r(p);return Nr(l,"scrollPositionChange",()=>{u(o)}),c?a.jsx(u2r,{ref:n,className:h.root,ownerState:p,onDragOver:s,style:i}):null}),d9=rS(f2r),m2r=()=>{},g2r=(e,t)=>{const n=f.useRef(!1);Ia(()=>n.current||!e?m2r:(n.current=!0,t()),[n.current||e])};function oi(e,t,n){const r=f.useRef(!0);Ia(()=>{r.current=!1,e.current.register(n,t)},[e,n,t]),r.current&&e.current.register(n,t)}function wf(e,t){const n=f.useRef(null);if(n.current)return n.current;const r=e.current.getLogger(t);return n.current=r,r}const Nyt=(e,t,n,r,o)=>{const i=wf(e,"useNativeEventListener");Ss(e,"rootMount",()=>{const s=t();if(!(!s||!n))return i.debug(`Binding native ${n} event`),s.addEventListener(n,r,o),()=>{i.debug(`Clearing native ${n} event`),s.removeEventListener(n,r,o)}})};function b5(e){const t=f.useRef(!0);t.current&&(t.current=!1,e())}function x2r(e){const t=f.useRef(null),n=f.useCallback((...r)=>{t.current||queueMicrotask(()=>{t.current&&t.current()}),t.current=()=>{t.current=null,e(...r)}},[e]);return f.useLayoutEffect(()=>{t.current&&t.current()}),{schedule:n,cancel:()=>t.current?(t.current=null,!0):!1}}const jyt=Us(e=>e.pivoting),$I=yr(jyt,e=>e==null?void 0:e.active),y2r=new Map,nwe=yr(jyt,e=>(e==null?void 0:e.initialColumns)||y2r),Eyt=(e,t)=>{var y,x;const n=Fn(e,d4),r=Fn(e,Q1e),o=Fn(e,Ixt),i=Fn(e,yc),s=n===0&&o===0,l=Fn(e,A1r),c=Fn(e,$I),u=!l&&s,d=!l&&n>0&&r===0,p=!l&&i.length===0,h=u&&c;let m=null,g=null;return u&&(m="noRowsOverlay"),p&&(m="noColumnsOverlay"),h&&(m="emptyPivotOverlay"),d&&(m="noResultsOverlay"),l&&(m="loadingOverlay",g=((x=(y=t.slotProps)==null?void 0:y.loadingOverlay)==null?void 0:x[s?"noRowsVariant":"variant"])??(s?"skeleton":"linear-progress")),{overlayType:m,loadingOverlayVariant:g}},GB=Us(e=>e.columnMenu);function v2r(){var x;const e=Th(),t=sr(),n=Fn(e,yc),r=Fn(e,cSr),o=Fn(e,aSr),i=Fn(e,lyt),s=Fn(e,()=>Z1e(e)===null),l=Fn(e,bSr),c=Fn(e,vSr),u=Fn(e,AW),d=Fn(e,L6),p=Fn(e,GB),h=Fn(e,x0),m=Fn(e,a2r),g=!(l===null&&i===null&&s),y=e.current.columnHeadersContainerRef;return a.jsx(t.slots.columnHeaders,Se({ref:y,visibleColumns:n,filterColumnLookup:r,sortColumnLookup:o,columnHeaderTabIndexState:i,columnGroupHeaderTabIndexState:l,columnHeaderFocus:c,columnGroupHeaderFocus:u,headerGroupingMaxDepth:d,columnMenuState:p,columnVisibility:h,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:g},(x=t.slotProps)==null?void 0:x.columnHeaders))}const b2r=rS(v2r),w2r=Ai("div",{slot:"internal",shouldForwardProp:void 0})({position:"absolute",top:"var(--DataGrid-headersTotalHeight)",left:0,width:"calc(100% - (var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))"}),S2r=Ai("div",{name:"MuiDataGrid",slot:"Main",overridesResolver:(e,t)=>{const{ownerState:n,loadingOverlayVariant:r,overlayType:o}=e,i=r==="skeleton"||o==="noColumnsOverlay";return[t.main,n.hasPinnedRight&&t["main--hasPinnedRight"],i&&t["main--hiddenContent"]]}})({flexGrow:1,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column"}),C2r=Kr((e,t)=>{var s;const{ownerState:n}=e,r=sr(),i=UY().hooks.useGridAriaAttributes();return a.jsxs(S2r,Se({ownerState:n,className:e.className,tabIndex:-1},i,(s=r.slotProps)==null?void 0:s.main,{ref:t,children:[a.jsx(w2r,{role:"presentation","data-id":"gridPanelAnchor"}),e.children]}))}),N2r=()=>Un({root:["topContainer"]},ii,{}),j2r=Ai("div",{slot:"internal",shouldForwardProp:void 0})({position:"sticky",zIndex:40,top:0});function E2r(e){const t=N2r();return a.jsx(j2r,Se({},e,{className:be(t.root,Be["container--top"]),role:"presentation"}))}const I2r=(e,t)=>{const{classes:n}=e;return Un({root:["virtualScrollerContent",t&&"virtualScrollerContent--overflowed"]},ii,n)},_2r=Ai("div",{name:"MuiDataGrid",slot:"VirtualScrollerContent",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScrollerContent,n.overflowedContent&&t["virtualScrollerContent--overflowed"]]}})({}),P2r=Kr(function(t,n){var l;const r=sr(),o=!r.autoHeight&&((l=t.style)==null?void 0:l.minHeight)==="auto",i=I2r(r,o),s={classes:r.classes,overflowedContent:o};return a.jsx(_2r,Se({},t,{ownerState:s,className:be(i.root,t.className),ref:n}))}),A2r=Ai("div",{slot:"internal",shouldForwardProp:void 0})({display:"flex",flexDirection:"row",width:"var(--DataGrid-rowWidth)",boxSizing:"border-box"}),Iyt=Ai("div",{slot:"internal",shouldForwardProp:void 0})({position:"sticky",height:"100%",boxSizing:"border-box",borderTop:"1px solid var(--rowBorderColor)",backgroundColor:fr.cell.background.pinned}),T2r=Ai(Iyt,{slot:"internal"})({left:0}),k2r=Ai(Iyt,{slot:"internal"})({right:0}),M2r=Ai("div",{slot:"internal",shouldForwardProp:void 0})({flexGrow:1,borderTop:"1px solid var(--rowBorderColor)"});function R2r({rowsLength:e}){const t=Eo(),{viewportOuterSize:n,minimumSize:r,hasScrollX:o,hasScrollY:i,scrollbarSize:s,leftPinnedWidth:l,rightPinnedWidth:c}=Fn(t,Rl),u=o?s:0,d=n.height-r.height>0;return u===0&&!d?null:a.jsxs(A2r,{className:Be.filler,role:"presentation",style:{height:u,"--rowBorderColor":e===0?"transparent":"var(--DataGrid-rowBorderColor)"},children:[l>0&&a.jsx(T2r,{className:Be["filler--pinnedLeft"],style:{width:l}}),a.jsx(M2r,{}),c>0&&a.jsx(k2r,{className:Be["filler--pinnedRight"],style:{width:c+(i?s:0)}})]})}const O2r=rS(R2r),$2r=e=>{const{classes:t}=e;return Un({root:["virtualScrollerRenderZone"]},ii,t)},D2r=Ai("div",{name:"MuiDataGrid",slot:"VirtualScrollerRenderZone"})({position:"absolute",display:"flex",flexDirection:"column"}),L2r=Kr(function(t,n){const r=sr(),o=$2r(r);return a.jsx(D2r,Se({ownerState:r},t,{className:be(o.root,t.className),ref:n}))}),F2r=Us(e=>e.columnResize),z2r=yr(F2r,e=>e.resizingColumnField),B2r={includeHeaders:!0,includeHeaderFilters:!1,includeOutliers:!1,outliersFactor:1.5,expand:!1,disableColumnVirtualization:!0},Ed=Us(e=>e.editRows),_yt=yr(Ed,(e,{rowId:t,editMode:n})=>n===bb.Row&&!!e[t]),H2r=yr(Ed,(e,{rowId:t,field:n})=>{var r;return((r=e[t])==null?void 0:r[n])??null}),Pw=Us(e=>e.preferencePanel),V2r=yr(Pw,(e,t)=>!!(e.open&&e.labelId===t));var Td=(function(e){return e.filters="filters",e.columns="columns",e.aiAssistant="aiAssistant",e})(Td||{});const U2r={},W2r={initialize:G2r,use:q2r,selectors:U2r};function G2r(e){return{colspanMap:new Map}}function q2r(e,t,n){var l;const r=(l=t.colspan)==null?void 0:l.getColspan,o=()=>{e.state.colspanMap=new Map},i=(c,u)=>{var d;return(d=e.state.colspanMap.get(c))==null?void 0:d[u]},s=no(r?(c,u,d,p)=>{for(let h=u;h1&&(h+=m.colSpan-1)}}:()=>{});return n.calculateColSpan=s,{resetColSpan:o,getCellColSpanInfo:i,calculateColSpan:s}}function K2r(e,t,n,r,o,i,s){const l=i.length,c=i[t],u=s(n,c,t);if(!u||u===1)return Gne(e,n,t,{spannedByColSpan:!1,cellProps:{colSpan:1,width:c.computedWidth}}),{colSpan:1};let d=c.computedWidth;for(let p=1;p=r&&h{n=void 0,e(...r)};function i(...s){r=s,n===void 0&&(n=setTimeout(o,t))}return i.clear=()=>{clearTimeout(n),n=void 0},i}function E0(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const o=e.length;if(o!==t.length)return!1;for(let i=0;ie.width===t.width&&e.height===t.height},X2r={EMPTY:{top:[],bottom:[]}},Q2r={EMPTY:{left:[],right:[]}},J2r={EMPTY:{top:0,left:0}};let Tc=(function(e){return e[e.NONE=0]="NONE",e[e.UP=1]="UP",e[e.DOWN=2]="DOWN",e[e.LEFT=3]="LEFT",e[e.RIGHT=4]="RIGHT",e})({});(function(e){function t(n,r){return n===0&&r===0?Tc.NONE:Math.abs(r)>=Math.abs(n)?r>0?Tc.DOWN:Tc.UP:n>0?Tc.RIGHT:Tc.LEFT}e.forDelta=t})(Tc||(Tc={}));const Z2r={isReady:!1,root:O1.EMPTY,viewportOuterSize:O1.EMPTY,viewportInnerSize:O1.EMPTY,contentSize:O1.EMPTY,minimumSize:O1.EMPTY,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,topContainerHeight:0,bottomContainerHeight:0,autoHeight:!1,minimalContentHeight:void 0},CA={rootSize:e=>e.rootSize,dimensions:e=>e.dimensions,rowHeight:e=>e.dimensions.rowHeight,columnsTotalWidth:e=>e.dimensions.columnsTotalWidth,contentHeight:e=>e.dimensions.contentSize.height,autoHeight:e=>e.dimensions.autoHeight,minimalContentHeight:e=>e.dimensions.minimalContentHeight,rowsMeta:e=>e.rowsMeta,rowPositions:e=>e.rowsMeta.positions,columnPositions:e0((e,t)=>{const n=[];let r=0;for(let o=0;oe.dimensions.viewportOuterSize.width>0&&e.dimensions.columnsTotalWidth>e.dimensions.viewportOuterSize.width},hc={initialize:eCr,use:tCr,selectors:CA};function eCr(e){const t=Se({},Z2r,e.dimensions,{autoHeight:e.dimensions.autoHeight,minimalContentHeight:e.dimensions.minimalContentHeight}),{rowCount:n}=e,{rowHeight:r}=t,o={currentPageTotalHeight:n*r,positions:Array.from({length:n},(s,l)=>l*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0},i=new Map;return{rootSize:O1.EMPTY,dimensions:t,rowsMeta:o,rowHeights:i}}function tCr(e,t,n){const r=f.useRef(!0),{layout:o,dimensions:{rowHeight:i,columnsTotalWidth:s,leftPinnedWidth:l,rightPinnedWidth:c,topPinnedHeight:u,bottomPinnedHeight:d},onResize:p}=t,h=f.useCallback(v=>{if(v&&(r.current=!1),r.current)return;const b=o.refs.container.current,w=CA.rootSize(e.state),S=CA.rowsMeta(e.state),C=oCr(b,t.dimensions.scrollbarSize),N=u+S.pinnedTopRowsTotalHeight,j=d+S.pinnedBottomRowsTotalHeight,I={width:s,height:pE(S.currentPageTotalHeight,1)};let _,T,P=!1,E=!1;if(t.dimensions.autoHeight)E=!1,P=Math.round(s)>Math.round(w.width),_={width:w.width,height:N+j+I.height},T={width:Math.max(0,_.width-(E?C:0)),height:Math.max(0,_.height-(P?C:0))};else{_={width:w.width,height:w.height},T={width:Math.max(0,_.width),height:Math.max(0,_.height-N-j)};const z=I,V=T,B=z.width>V.width,G=z.height>V.height;(B||G)&&(E=G,P=z.width+(E?C:0)>V.width,P&&(E=z.height+C>V.height)),E&&(T.width-=C),P&&(T.height-=C)}t.disableHorizontalScroll&&(P=!1),t.disableVerticalScroll&&(E=!1);const M=Math.max(_.width,s+(E?C:0)),R={width:s,height:N+I.height+j},$={isReady:!0,root:w,viewportOuterSize:_,viewportInnerSize:T,contentSize:I,minimumSize:R,hasScrollX:P,hasScrollY:E,scrollbarSize:C,rowWidth:M,rowHeight:i,columnsTotalWidth:s,leftPinnedWidth:l,rightPinnedWidth:c,topContainerHeight:N,bottomContainerHeight:j,autoHeight:t.dimensions.autoHeight,minimalContentHeight:t.dimensions.minimalContentHeight},D=e.state.dimensions;E0(D,$)||(e.update({dimensions:$}),p==null||p($.root))},[e,o.refs.container,t.dimensions.scrollbarSize,t.dimensions.autoHeight,t.dimensions.minimalContentHeight,t.disableHorizontalScroll,t.disableVerticalScroll,p,i,s,l,c,u,d]),{resizeThrottleMs:m}=t,g=no(h),y=f.useMemo(()=>m>0?Y2r(g,m):void 0,[m,g]);f.useEffect(()=>y==null?void 0:y.clear,[y]),Ia(h,[h]),Ia(()=>{e.update({dimensions:Se({},e.state.dimensions,{autoHeight:t.dimensions.autoHeight,minimalContentHeight:t.dimensions.minimalContentHeight})})},[e,t.dimensions.autoHeight,t.dimensions.minimalContentHeight]);const x=nCr(e,t,h);return{updateDimensions:h,debouncedUpdateDimensions:y,rowsMeta:x}}function nCr(e,t,n){const r=e.state.rowHeights,{rows:o,getRowHeight:i,getRowSpacing:s,getEstimatedRowHeight:l}=t,c=f.useRef(-1),u=f.useRef(!1),d=f.useRef(!1),p=t.pinnedRows,h=q2(e,CA.rowHeight),m=no(T=>{let P=r.get(T);return P===void 0&&(P={content:e.state.dimensions.rowHeight,spacingTop:0,spacingBottom:0,detail:0,autoHeight:!1,needsFirstMeasurement:!0},r.set(T,P)),P}),{applyRowHeight:g}=t,y=f.useCallback(T=>{const P=CA.dimensions(e.state),E=P.rowHeight,M=m(T.id);if(!i)M.content=E,M.needsFirstMeasurement=!1;else{const R=i(T);if(R==="auto"){if(M.needsFirstMeasurement){const $=l?l(T):E;M.content=$??E}u.current=!0,M.autoHeight=!0}else M.content=R??P.rowHeight,M.needsFirstMeasurement=!1,M.autoHeight=!1}if(s){const R=s(T);M.spacingTop=R.top??0,M.spacingBottom=R.bottom??0}else M.spacingTop=0,M.spacingBottom=0;return g==null||g(M,T),M},[e,i,m,l,h,s,g]),x=f.useCallback(()=>{u.current=!1;const T=(p==null?void 0:p.top.reduce((D,z)=>{const V=y(z);return D+V.content+V.spacingTop+V.spacingBottom+V.detail},0))??0,P=(p==null?void 0:p.bottom.reduce((D,z)=>{const V=y(z);return D+V.content+V.spacingTop+V.spacingBottom+V.detail},0))??0,E=[],M=o.reduce((D,z)=>{E.push(D);const V=y(z),B=V.content+V.spacingTop+V.spacingBottom+V.detail;return D+B},0);u.current||(c.current=1/0);const R=T!==e.state.rowsMeta.pinnedTopRowsTotalHeight||P!==e.state.rowsMeta.pinnedBottomRowsTotalHeight||M!==e.state.rowsMeta.currentPageTotalHeight,$={currentPageTotalHeight:M,positions:E,pinnedTopRowsTotalHeight:T,pinnedBottomRowsTotalHeight:P};e.set("rowsMeta",$),R&&n(),d.current=!0},[e,p,o,y,n]),v=no(x),b=T=>{var P;return((P=r.get(T))==null?void 0:P.content)??CA.rowHeight(e.state)},w=(T,P)=>{const E=m(T),M=E.content!==P;E.needsFirstMeasurement=!1,E.content=P,d.current&&(d.current=!M)},S=T=>{var P;return((P=r.get(T))==null?void 0:P.autoHeight)??!1},C=()=>c.current,N=T=>{u.current&&T>c.current&&(c.current=T)},j=()=>{r.clear(),x()},I=gm(()=>typeof ResizeObserver>"u"?void 0:new ResizeObserver(T=>{var P,E;for(let M=0;M0?R.borderBoxSize[0].blockSize:R.contentRect.height,D=R.target.__mui_id;if(((E=(P=t.focusedVirtualCell)==null?void 0:P.call(t))==null?void 0:E.id)===D&&$===0)return;w(D,$)}d.current||requestAnimationFrame(()=>{v()})})).current,_=(T,P)=>(T.__mui_id=P,I==null||I.observe(T),()=>I==null?void 0:I.unobserve(T));return Ia(()=>{x()},[x]),{getRowHeight:b,setLastMeasuredRowIndex:N,storeRowHeightMeasurement:w,hydrateRowsMeta:x,observeRowHeight:_,rowHasAutoHeight:S,getRowHeightEntry:m,getLastMeasuredRowIndex:C,resetRowHeights:j}}function rCr(e,t,n){if(!e)return;const r=e.getBoundingClientRect(),o={width:pE(r.width,1),height:pE(r.height,1)};if((t.state.rootSize===O1.EMPTY||!O1.equals(o,t.state.rootSize))&&n(o),typeof ResizeObserver>"u")return;const i=new ResizeObserver(([s])=>{if(!s)return;const l={width:pE(s.contentRect.width,1),height:pE(s.contentRect.height,1)};O1.equals(l,t.state.rootSize)||n(l)});return i.observe(e),()=>{i.disconnect()}}const m7e=new WeakMap;function oCr(e,t){if(t!==void 0)return t;if(e===null)return 0;const n=m7e.get(e);if(n!==void 0)return n;const o=Zl(e).createElement("div");o.style.width="99px",o.style.height="99px",o.style.position="absolute",o.style.overflow="scroll",o.className="scrollDiv",e.appendChild(o);const i=o.offsetWidth-o.clientWidth;return e.removeChild(o),m7e.set(e,i),i}const iCr=typeof navigator<"u"?navigator.userAgent.toLowerCase():"empty",Pyt=iCr.includes("firefox"),qne=typeof window<"u"&&/jsdom|HappyDOM/.test(window.navigator.userAgent),NA=(e,t,n)=>Math.max(t,Math.min(n,e)),Kne=50,g7e={top:0,left:0},aCr=Object.freeze(new Map),vD={firstRowIndex:0,lastRowIndex:0,firstColumnIndex:0,lastColumnIndex:0},qB=(()=>{const e=x1(t=>t.virtualization.renderContext.firstRowIndex);return{store:x1(t=>t.virtualization),renderContext:x1(t=>t.virtualization.renderContext),enabledForRows:x1(t=>t.virtualization.enabledForRows),enabledForColumns:x1(t=>t.virtualization.enabledForColumns),offsetTop:x1(hc.selectors.rowPositions,e,(t,n)=>t[n]??0),context:x1(t=>t.virtualization.context),scrollPosition:x1(t=>t.virtualization.scrollPosition)}})(),Gm={initialize:sCr,use:lCr,selectors:qB};function sCr(e){var n;return{virtualization:Se({enabled:!qne,enabledForRows:!qne,enabledForColumns:!qne,renderContext:vD,props:e.layout.constructor.elements.reduce((r,o)=>(r[o],r),{}),context:{},scrollPosition:{current:J2r.EMPTY}},(n=e.initialState)==null?void 0:n.virtualization),getters:null}}function lCr(e,t,n){const{layout:r,dimensions:{rowHeight:o,columnsTotalWidth:i=0},virtualization:{isRtl:s=!1,rowBufferPx:l=150,columnBufferPx:c=150},colspan:u,initialState:d,rows:p,range:h,columns:m,pinnedRows:g=X2r.EMPTY,pinnedColumns:y=Q2r.EMPTY,onWheel:x,onTouchMove:v,onRenderContextChange:b,onScrollChange:w,scrollReset:S,renderRow:C,renderInfiniteLoadingTrigger:N}=t,j=g.bottom.length>0,[I,_]=f.useState(aCr),T=f.useRef(!1),P=f.useRef(!1),E=q2(e,qB.renderContext),M=q2(e,qB.enabledForRows),R=q2(e,qB.enabledForColumns),$=q2(e,hc.selectors.contentHeight),D=f.useRef((d==null?void 0:d.scroll)??g7e),z=f.useRef(!1),V=f.useRef(g7e),B=f.useRef(vD),G=hh(),H=f.useRef(void 0),F=gm(()=>dCr(s,l,c,o*15,Kne*6)).current,W=f.useCallback(ye=>{w7e(ye,e.state.virtualization.renderContext)||e.set("virtualization",Se({},e.state.virtualization,{renderContext:ye,scrollPosition:{current:Se({},D.current)}}));const de=hc.selectors.dimensions(e.state).isReady,Ne=ye.firstRowIndex!==B.current.firstRowIndex||ye.lastRowIndex!==B.current.lastRowIndex;de&&Ne&&(B.current=ye,b==null||b(ye)),V.current=D.current},[e,b]),U=no(()=>{const ye=r.refs.scroller.current;if(!ye)return;const de=hc.selectors.dimensions(e.state),Ne=Math.ceil(de.contentSize.height-de.viewportInnerSize.height),_e=Math.ceil(de.contentSize.width-de.viewportInnerSize.width),xe={top:NA(ye.scrollTop,0,Ne),left:s?NA(ye.scrollLeft,-Math.abs(_e),0):NA(ye.scrollLeft,0,_e)},we=xe.left-D.current.left,Te=xe.top-D.current.top,Re=we!==0||Te!==0;D.current=xe;const Ue=Re?Tc.forDelta(we,Te):Tc.NONE,He=Math.abs(D.current.top-V.current.top),Ye=Math.abs(D.current.left-V.current.left),We=He>=o||Ye>=Kne,at=F.direction!==Ue;if(!(We||at))return e.set("virtualization",Se({},e.state.virtualization,{scrollPosition:{current:Se({},D.current)}})),E;if(at)switch(Ue){case Tc.NONE:case Tc.LEFT:case Tc.RIGHT:H.current=void 0;break;default:H.current=E;break}F.direction=Ue,F.buffer=Tyt(s,Ue,l,c,o*15,Kne*6);const Ae=y7e(e,t,n,M,R),qe=v7e(Ae,D.current,F);return w7e(qe,E)?e.set("virtualization",Se({},e.state.virtualization,{scrollPosition:{current:Se({},D.current)}})):(pu.flushSync(()=>{W(qe)}),G.start(1e3,U)),qe}),K=()=>{if(!hc.selectors.dimensions(e.state).isReady&&(M||R))return;const ye=y7e(e,t,n,M,R),de=v7e(ye,D.current,F);H.current=void 0,W(de)},X=no(K);WE(e,hc.selectors.dimensions,(ye,de)=>{de.isReady&&K()}),Ia(()=>{T.current&&(K(),T.current=!1)});const J=()=>{T.current=!0},te=no(()=>{if(z.current){z.current=!1;return}const ye=U();ye&&(w==null||w(D.current,ye))}),re=(ye={},de)=>{var Ae;if(!ye.rows&&!h)return[];let Ne=E;ye.renderContext&&(Ne=ye.renderContext,Ne.firstColumnIndex=E.firstColumnIndex,Ne.lastColumnIndex=E.lastColumnIndex);const _e=!j&&ye.position===void 0||j&&ye.position==="bottom",xe=ye.position!==void 0;let we;switch(ye.position){case"top":we=0;break;case"bottom":we=g.top.length+p.length;break;case void 0:default:we=g.top.length;break}const Te=ye.rows??p,Re=Ne.firstRowIndex,Ue=Math.min(Ne.lastRowIndex,Te.length),He=ye.rows?S7e(0,ye.rows.length):S7e(Re,Ue);let Ye=-1;const We=(Ae=t.focusedVirtualCell)==null?void 0:Ae.call(t);!xe&&We&&(We.rowIndexUe&&(He.push(We.rowIndex),Ye=We.rowIndex));const at=[],Oe=hc.selectors.columnPositions(e.state,m);return He.forEach(qe=>{const{id:dt,model:Ze}=Te[qe];if(de&&!de[dt])return;const Qe=((h==null?void 0:h.firstRowIndex)||0)+we+qe;if(u!=null&&u.enabled){const sn=y.left.length,ot=m.length-y.right.length;n.calculateColSpan(dt,sn,ot,m),y.left.length>0&&n.calculateColSpan(dt,0,y.left.length,m),y.right.length>0&&n.calculateColSpan(dt,m.length-y.right.length,m.length,m)}const lt=n.rowsMeta.rowHasAutoHeight(dt)?"auto":n.rowsMeta.getRowHeight(dt);let bt=!1;ye.position===void 0&&(bt=qe===0);let Ct=!1;const Je=qe===Te.length-1;if(_e)if(xe)Ct=Je;else{const sn=p.length-1;qe===sn&&(Ct=!0)}let Pe=Ne;H.current&&qe>=H.current.firstRowIndex&&qe{P.current&&X()},[R,M,X]),Ia(()=>{r.refs.scroller.current&&(r.refs.scroller.current.scrollLeft=0)},[r.refs.scroller,S]),g2r(E!==vD,()=>{if(w==null||w(D.current,E),P.current=!0,d!=null&&d.scroll&&r.refs.scroller.current){const ye=r.refs.scroller.current,{top:de,left:Ne}=d.scroll,_e={top:!(de>0),left:!(Ne>0)};!_e.left&&i&&(ye.scrollLeft=Ne,_e.left=!0,z.current=!0),!_e.top&&$&&(ye.scrollTop=de,z.current=!0),(!_e.top||!_e.left)&&(ce.current=(xe,we)=>{!_e.left&&xe&&(ye.scrollLeft=Ne,_e.left=!0,z.current=!0),!_e.top&&we&&(ye.scrollTop=de,_e.top=!0,z.current=!0),_e.left&&_e.top&&(ce.current=null)})}}),WE(e,hc.selectors.dimensions,K),Ia(()=>{var ye;r.refs.scroller&&((ye=ce.current)==null||ye.call(ce,i,$))},[r.refs.scroller,i,$]);const ae=f.useRef(!0),oe=x7e(ye=>{r.refs.container.current=ye;const de=rCr(ye,e,Ne=>{Ne.width===0&&Ne.height===0&&e.state.rootSize.height!==0&&e.state.rootSize.width!==0||(e.state.rootSize=Ne,ae.current||!n.debouncedUpdateDimensions?(n.updateDimensions(ae.current),ae.current=!1):n.debouncedUpdateDimensions())});return()=>{de==null||de(),r.refs.container.current=null}}),ue=x7e(ye=>{r.refs.scroller.current=ye;const de={passive:!0};return ye.addEventListener("scroll",te,de),ye.addEventListener("wheel",x,de),ye.addEventListener("touchmove",v,de),()=>{ye.removeEventListener("scroll",te,de),ye.removeEventListener("wheel",x,de),ye.removeEventListener("touchmove",v,de),r.refs.scroller.current=null}}),fe={containerRef:oe,scrollerRef:ue},se=r.use(e,t,n,fe),ge=Se({setPanels:_,getRows:re,rows:t.rows},se);return Se({getters:ge,setPanels:_,forceUpdateRenderContext:K,scheduleUpdateRenderContext:J},pCr())}function x7e(e){const t=f.useRef(void 0);return no(r=>{var o;if(!r){(o=t.current)==null||o.call(t);return}if(t.current=e(r),O1e>=19)return t.current})}function y7e(e,t,n,r,o){var h;const i=hc.selectors.dimensions(e.state),s=t.rows,l=t.range,c=t.columns,u=n.getHiddenCellsOrigin(),d=(h=t.rows.at(-1))==null?void 0:h.id,p=c.at(-1);return{api:n,enabledForRows:r,enabledForColumns:o,autoHeight:i.autoHeight,rowBufferPx:t.virtualization.rowBufferPx,columnBufferPx:t.virtualization.columnBufferPx,leftPinnedWidth:i.leftPinnedWidth,columnsTotalWidth:i.columnsTotalWidth,viewportInnerWidth:i.viewportInnerSize.width,viewportInnerHeight:i.viewportInnerSize.height,lastRowHeight:d!==void 0?n.rowsMeta.getRowHeight(d):0,lastColumnWidth:(p==null?void 0:p.computedWidth)??0,rowsMeta:hc.selectors.rowsMeta(e.state),columnPositions:hc.selectors.columnPositions(e.state,t.columns),rows:s,range:l,pinnedColumns:t.pinnedColumns,columns:c,hiddenCellsOriginMap:u,virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight}}function v7e(e,t,n){const r={firstRowIndex:0,lastRowIndex:e.rows.length,firstColumnIndex:0,lastColumnIndex:e.columns.length},{top:o,left:i}=t,s=Math.abs(i)+e.leftPinnedWidth;if(e.enabledForRows){let c=Math.min(b7e(e,o,{atStart:!0,lastPosition:e.rowsMeta.positions[e.rowsMeta.positions.length-1]+e.lastRowHeight}),e.rowsMeta.positions.length-1);const u=e.hiddenCellsOriginMap[c];if(u){const p=Math.min(...Object.values(u));c=Math.min(c,p)}const d=e.autoHeight?c+e.rows.length:b7e(e,o+e.viewportInnerHeight);r.firstRowIndex=c,r.lastRowIndex=d}if(e.enabledForColumns){let c=0,u=e.columnPositions.length,d=!1;const[p,h]=Spe({firstIndex:r.firstRowIndex,lastIndex:r.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight});if(!e.virtualizeColumnsWithAutoRowHeight)for(let m=p;m=e.range.lastRowIndex);const i=NA(r-(((l=e.range)==null?void 0:l.firstRowIndex)||0),0,e.rowsMeta.positions.length);return o||e.rowsMeta.positions[i]>=t?BC(t,e.rowsMeta.positions,n):uCr(t,e.rowsMeta.positions,i,n)}function cCr(e,t,n){var c,u;const[r,o]=Spe({firstIndex:t.firstRowIndex,lastIndex:t.lastRowIndex,minFirstIndex:0,maxLastIndex:e.rows.length,bufferBefore:n.buffer.rowBefore,bufferAfter:n.buffer.rowAfter,positions:e.rowsMeta.positions,lastSize:e.lastRowHeight}),[i,s]=Spe({firstIndex:t.firstColumnIndex,lastIndex:t.lastColumnIndex,minFirstIndex:((c=e.pinnedColumns)==null?void 0:c.left.length)??0,maxLastIndex:e.columns.length-(((u=e.pinnedColumns)==null?void 0:u.right.length)??0),bufferBefore:n.buffer.columnBefore,bufferAfter:n.buffer.columnAfter,positions:e.columnPositions,lastSize:e.lastColumnWidth}),l=fCr({api:e.api,firstColumnToRender:i,firstRowToRender:r,lastRowToRender:o,visibleRows:e.rows});return{firstRowIndex:r,lastRowIndex:o,firstColumnIndex:l,lastColumnIndex:s}}function BC(e,t,n=void 0,r=0,o=t.length){if(t.length<=0)return-1;if(r>=o)return r;const i=r+Math.floor((o-r)/2),s=t[i];let l;if(n!=null&&n.atStart){const c=(i===t.length-1?n.lastPosition:t[i+1])-s;l=e-ce+r)}function fCr({api:e,firstColumnToRender:t,firstRowToRender:n,lastRowToRender:r,visibleRows:o}){let i=t,s=!1;for(;!s&&i>=0;){s=!0;for(let l=n;l{throw new Error("Unimplemented: colspan feature is required")},calculateColSpan:()=>{throw new Error("Unimplemented: colspan feature is required")},getHiddenCellsOrigin:()=>{throw new Error("Unimplemented: rowspan feature is required")}}}class rwe{constructor(t){this.refs=t}refSetter(t){return n=>{n&&this.refs[t].current!==n&&(this.refs[t].current=n)}}}ze(rwe,"elements",["scroller","container"]);class cv extends rwe{use(t,n,r,o){const{scrollerRef:i,containerRef:s}=o,l=no(this.refSetter("scrollbarVertical")),c=no(this.refSetter("scrollbarHorizontal"));t.state.virtualization.context={scrollerRef:i,containerRef:s,scrollbarVerticalRef:l,scrollbarHorizontalRef:c}}}ze(cv,"elements",["scroller","container","content","positioner","scrollbarVertical","scrollbarHorizontal"]),ze(cv,"selectors",{containerProps:e0(Gm.selectors.context,t=>({ref:t.containerRef})),scrollerProps:e0(Gm.selectors.context,hc.selectors.autoHeight,hc.selectors.needsHorizontalScrollbar,(t,n,r)=>({ref:t.scrollerRef,style:{overflowX:r?void 0:"hidden",overflowY:n?"hidden":void 0},role:"presentation",tabIndex:Pyt?-1:void 0})),contentProps:e0(hc.selectors.contentHeight,hc.selectors.minimalContentHeight,hc.selectors.columnsTotalWidth,hc.selectors.needsHorizontalScrollbar,(t,n,r,o)=>({style:{width:o?r:"auto",flexBasis:t===0?n:t,flexShrink:0},role:"presentation"})),positionerProps:e0(Gm.selectors.offsetTop,t=>({style:{transform:`translate3d(0, ${t}px, 0)`}})),scrollbarHorizontalProps:e0(Gm.selectors.context,Gm.selectors.scrollPosition,(t,n)=>({ref:t.scrollbarHorizontalRef,scrollPosition:n})),scrollbarVerticalProps:e0(Gm.selectors.context,Gm.selectors.scrollPosition,(t,n)=>({ref:t.scrollbarVerticalRef,scrollPosition:n})),scrollAreaProps:e0(Gm.selectors.scrollPosition,t=>({scrollPosition:t}))});class hCr extends cv{use(t,n,r,o){super.use(t,n,r,o);const i=t.use(cv.selectors.containerProps),s=t.use(cv.selectors.scrollerProps),l=t.use(cv.selectors.contentProps),c=t.use(cv.selectors.positionerProps),u=t.use(cv.selectors.scrollbarVerticalProps),d=t.use(cv.selectors.scrollbarHorizontalProps),p=t.use(cv.selectors.scrollAreaProps);return{getContainerProps:()=>i,getScrollerProps:()=>s,getContentProps:()=>l,getPositionerProps:()=>c,getScrollbarVerticalProps:()=>u,getScrollbarHorizontalProps:()=>d,getScrollAreaProps:()=>p}}}class C7e extends rwe{use(t,n,r,o){const{scrollerRef:i,containerRef:s}=o,l=Di(i,s);t.state.virtualization.context={mergedRef:l}}}ze(C7e,"elements",["scroller","container","content","positioner"]),ze(C7e,"selectors",{containerProps:e0(Gm.selectors.context,hc.selectors.autoHeight,hc.selectors.needsHorizontalScrollbar,(t,n,r)=>({ref:t.mergedRef,style:{overflowX:r?void 0:"hidden",overflowY:n?"hidden":void 0,position:"relative"},role:"presentation",tabIndex:Pyt?-1:void 0})),contentProps:e0(hc.selectors.contentHeight,t=>({style:{position:"absolute",display:"inline-block",width:"100%",height:t,top:0,left:0,zIndex:-1},role:"presentation"})),positionerProps:e0(Gm.selectors.offsetTop,t=>({style:{height:t}}))});const mCr={},gCr={initialize:xCr,use:yCr,selectors:mCr};function xCr(e){return{}}function yCr(e,t,n){return{getViewportPageSize:()=>{const o=hc.selectors.dimensions(e.state);if(!o.isReady)return 0;if(t.getRowHeight){const s=Gm.selectors.renderContext(e.state),l=s.lastRowIndex-s.firstRowIndex;return Math.min(l-1,t.rows.length)}const i=Math.floor(o.viewportInnerSize.height/o.rowHeight);return Math.min(i,t.rows.length)}}}const vCr={firstRowIndex:0,lastRowIndex:0},bCr={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},kyt={state:e=>e.rowSpanning,hiddenCells:e=>e.rowSpanning.caches.hiddenCells,spannedCells:e=>e.rowSpanning.caches.spannedCells,hiddenCellsOriginMap:e=>e.rowSpanning.caches.hiddenCellOriginMap},HT={initialize:wCr,use:SCr,selectors:kyt};function wCr(e){var t;return{rowSpanning:((t=e.initialState)==null?void 0:t.rowSpanning)??{caches:bCr,processedRange:vCr}}}function SCr(e,t,n){return{getHiddenCellsOrigin:()=>kyt.hiddenCellsOriginMap(e.state)}}const CCr=[{field:"DEFAULT_COLUMN"}],NCr={resizeThrottleMs:100,columns:CCr,dimensions:{autoHeight:!1,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,topPinnedHeight:0,bottomPinnedHeight:0},virtualization:{isRtl:!1,rowBufferPx:150,columnBufferPx:150}},N7e=[hc,Gm,W2r,HT,gCr],jCr=e=>{const t=Myt(e,NCr),n=gm(()=>new BY(N7e.map(o=>o.initialize(t)).reduce((o,i)=>Object.assign(o,i),{}))).current,r={};for(const o of N7e)Object.assign(r,o.use(n,t,r));return{store:n,api:r}};function Myt(e,t){const n=Se({},e);for(const r in t)if(Object.hasOwn(t,r)){const o=t[r];o!==null&&typeof o=="object"&&!Array.isArray(o)?n[r]=Myt(e[r]??{},o):n[r]=e[r]??o}return n}const ECr=typeof window<"u"&&/jsdom|HappyDOM/.test(window.navigator.userAgent),JO=!ECr,ICr=(e,t)=>{const{disableVirtualization:n,autoHeight:r}=t;return Se({},e,{virtualization:{enabled:!n&&JO,enabledForColumns:!n&&JO,enabledForRows:!n&&!r&&JO,renderContext:vD}})};function _Cr(e,t){const{autoHeight:n,disableVirtualization:r}=t,o=c=>{const{virtualizer:u}=e.current;c&&(c=JO);const d=u.store.getSnapshot();d.virtualization.enabled===c&&d.virtualization.enabledForRows===c&&d.virtualization.enabledForColumns===c||u.store.set("virtualization",Se({},u.store.state.virtualization,{enabled:c,enabledForColumns:c,enabledForRows:c&&!n}))};oi(e,{unstable_setVirtualization:o,unstable_setColumnVirtualization:c=>{const{virtualizer:u}=e.current;c&&(c=JO),u.store.getSnapshot().virtualization.enabledForColumns!==c&&u.store.set("virtualization",Se({},u.store.state.virtualization,{enabledForColumns:c}))}},"public");const l=()=>{const{virtualizer:c}=e.current;c==null||c.api.scheduleUpdateRenderContext()};e.current.register("private",{updateRenderContext:l}),Ss(e,"sortedRowsSet",l),Ss(e,"paginationModelChange",l),Ss(e,"columnsChange",l),f.useEffect(()=>{e.current.virtualizer&&o(!t.disableVirtualization)},[e,r,n])}const eX=Us(e=>e.virtualization);yr(eX,e=>e.enabled);const PCr=yr(eX,e=>e.enabledForColumns);yr(eX,e=>e.enabledForRows);const Cpe=yr(eX,e=>e.renderContext),ACr=Us(e=>e.virtualization.renderContext.firstColumnIndex),TCr=Us(e=>e.virtualization.renderContext.lastColumnIndex),kCr=ha(ACr,TCr,(e,t)=>({firstColumnIndex:e,lastColumnIndex:t}));function MCr(e){return JSON.stringify([e.filterModel,e.sortModel,e.start,e.end])}class RCr{constructor({ttl:t=3e5,getKey:n=MCr}){this.cache={},this.ttl=t,this.getKey=n}set(t,n){const r=this.getKey(t),o=Date.now()+this.ttl;this.cache[r]={value:n,expiry:o}}get(t){const n=this.getKey(t),r=this.cache[n];if(r){if(Date.now()>r.expiry){delete this.cache[n];return}return r.value}}clear(){this.cache={}}}class OCr extends Error{constructor(t){super(t.message),this.name="GridGetRowsError",this.params=t.params,this.cause=t.cause}}class $Cr extends Error{constructor(t){super(t.message),this.name="GridUpdateRowError",this.params=t.params,this.cause=t.cause}}const DCr=(e,t)=>{const{classes:n}=e,r={root:["scrollbar",`scrollbar--${t}`],content:["scrollbarContent"]};return Un(r,ii,n)},Ryt="calc(max(var(--DataGrid-scrollbarSize), 14px))",owe=Ai("div",{slot:"internal",shouldForwardProp:void 0})({position:"absolute",display:"inline-block",zIndex:60,"&:hover":{zIndex:70},"--size":Ryt}),LCr=Ai(owe,{slot:"internal"})({width:"var(--size)",height:"calc(var(--DataGrid-hasScrollY) * (100% - var(--DataGrid-headersTotalHeight) - var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize)))",overflowY:"auto",overflowX:"hidden",outline:0,"& > div":{width:"var(--size)"},top:"var(--DataGrid-headersTotalHeight)",right:0}),FCr=Ai(owe,{slot:"internal"})({width:"calc(var(--DataGrid-hasScrollX) * (100% - var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize)))",height:"var(--size)",overflowY:"hidden",overflowX:"auto",outline:0,"& > div":{height:"var(--size)"},bottom:0}),zCr=Ai(owe,{slot:"internal"})({width:"var(--size)",height:"var(--size)",right:0,bottom:0,overflow:"scroll","@media print":{display:"none"}}),j7e=Kr(function(t,n){const r=Th(),o=sr(),i=f.useRef(!1),s=f.useRef(0),l=f.useRef(null),c=DCr(o,t.position),u=Fn(r,Rl),d=t.position==="vertical"?"height":"width",p=t.position==="vertical"?"scrollTop":"scrollLeft",h=t.position==="vertical"?"top":"left",m=t.position==="horizontal"?u.minimumSize.width:u.minimumSize.height-u.headersTotalHeight,g=no(()=>{const b=l.current,w=t.scrollPosition.current;if(b&&w[h]!==s.current){if(s.current=w[h],i.current){i.current=!1;return}i.current=!0,b[p]=t.scrollPosition.current[h]}}),y=no(()=>{const b=r.current.virtualScrollerRef.current,w=l.current;if(w){if(i.current){i.current=!1;return}i.current=!0,b[p]=w[p]}});oK(()=>{const b=r.current.virtualScrollerRef.current,w=l.current,S={passive:!0};return b.addEventListener("scroll",g,S),w.addEventListener("scroll",y,S),()=>{b.removeEventListener("scroll",g,S),w.removeEventListener("scroll",y,S)}});const x=t.position==="vertical"?LCr:FCr,v=f.useMemo(()=>({[d]:`${m}px`}),[d,m]);return a.jsx(x,{ref:Di(n,l),className:c.root,tabIndex:-1,"aria-hidden":"true",onFocus:b=>{b.target.blur()},children:a.jsx("div",{className:c.content,style:v})})}),BCr=e=>{const{classes:t,position:n}=e,r={root:["scrollShadow",`scrollShadow--${n}`]};return Un(r,ii,t)},HCr=Ai("div",{name:"MuiDataGrid",slot:"ScrollShadow",overridesResolver:(e,t)=>[t.root,t[e.position]]})(({theme:e})=>({position:"absolute",inset:0,pointerEvents:"none",transition:fr.transition(["box-shadow"],{duration:fr.transitions.duration.short}),"--length":e.palette.mode==="dark"?"8px":"6px","--length-inverse":"calc(var(--length) * -1)","--opacity":e.palette.mode==="dark"?"0.7":"0.18","--blur":"var(--length)","--spread":"calc(var(--length) * -1)","--color":"0, 0, 0","--color-start":"rgba(var(--color), calc(var(--hasScrollStart) * var(--opacity)))","--color-end":"rgba(var(--color), calc(var(--hasScrollEnd) * var(--opacity)))",variants:[{props:{position:"vertical"},style:{top:"var(--DataGrid-topContainerHeight)",bottom:"calc(var(--DataGrid-bottomContainerHeight) + var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))",boxShadow:"inset 0 var(--length) var(--blur) var(--spread) var(--color-start), inset 0 var(--length-inverse) var(--blur) var(--spread) var(--color-end)"}},{props:{position:"horizontal"},style:{left:"var(--DataGrid-leftPinnedWidth)",right:"calc(var(--DataGrid-rightPinnedWidth) + var(--DataGrid-hasScrollY) * var(--DataGrid-scrollbarSize))",boxShadow:"inset var(--length) 0 var(--blur) var(--spread) var(--color-start), inset var(--length-inverse) 0 var(--blur) var(--spread) var(--color-end)"}}]}));function E7e(e){var x,v,b;const{position:t}=e,r={classes:sr().classes,position:t},o=BCr(r),i=f.useRef(null),s=Th(),l=Fn(s,Sxt),c=Fn(s,Cxt),u=Fn(s,f4),d=Fn(s,U1e),p=t==="vertical"?c&&((x=u==null?void 0:u.bottom)==null?void 0:x.length)>0:l&&((v=d==null?void 0:d.right)==null?void 0:v.length)!==void 0&&((b=d==null?void 0:d.right)==null?void 0:b.length)>0,h=$d(),m=f.useCallback(w=>{var P,E,M,R,$,D;if(!i.current)return;const S=Math.abs(Math.round(w)),C=Rl(s),N=Math.round(C.contentSize[t==="vertical"?"height":"width"]-C.viewportInnerSize[t==="vertical"?"height":"width"]),j=t==="vertical"?((P=u==null?void 0:u.top)==null?void 0:P.length)>0:((E=d==null?void 0:d.left)==null?void 0:E.length)!==void 0&&((M=d==null?void 0:d.left)==null?void 0:M.length)>0,I=t==="vertical"?((R=u==null?void 0:u.bottom)==null?void 0:R.length)>0:(($=d==null?void 0:d.right)==null?void 0:$.length)!==void 0&&((D=d==null?void 0:d.right)==null?void 0:D.length)>0,_=h?S0,T=h?S>0:S{m(w[t==="vertical"?"top":"left"])},y=()=>{var w,S;t==="horizontal"&&m(((S=(w=s.current.virtualScrollerRef)==null?void 0:w.current)==null?void 0:S.scrollLeft)||0)};return Nr(s,"scrollPositionChange",g),Nr(s,"columnResizeStop",y),f.useEffect(()=>{var w,S,C,N;m((t==="horizontal"?(S=(w=s.current.virtualScrollerRef)==null?void 0:w.current)==null?void 0:S.scrollLeft:(N=(C=s.current.virtualScrollerRef)==null?void 0:C.current)==null?void 0:N.scrollTop)??0)},[m,s,t]),a.jsx(HCr,{className:o.root,ownerState:r,ref:i,style:{"--hasScrollStart":0,"--hasScrollEnd":p?"1":"0"}})}const VCr=Ai("div",{name:"MuiDataGrid",slot:"OverlayWrapper",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant"&&e!=="right"})(({overlayType:e,loadingOverlayVariant:t,right:n})=>t!=="skeleton"?{position:"sticky",top:"var(--DataGrid-headersTotalHeight)",left:0,right:`${n}px`,width:0,height:0,zIndex:e==="loadingOverlay"?5:4}:{}),UCr=Ai("div",{name:"MuiDataGrid",slot:"OverlayWrapperInner",shouldForwardProp:e=>e!=="overlayType"&&e!=="loadingOverlayVariant"})({}),WCr=e=>{const{classes:t}=e;return Un({root:["overlayWrapper"],inner:["overlayWrapperInner"]},ii,t)};function GCr(e){const t=Eo(),n=sr(),r=Fn(t,Rl);let o=Math.max(r.viewportOuterSize.height-r.topContainerHeight-r.bottomContainerHeight-(r.hasScrollX?r.scrollbarSize:0),0);o===0&&(o=kxt);const i=WCr(Se({},e,{classes:n.classes}));return a.jsx(VCr,Se({className:i.root},e,{right:r.columnsTotalWidth-r.viewportOuterSize.width,children:a.jsx(UCr,Se({className:i.inner,style:{height:o,width:r.viewportOuterSize.width}},e))}))}const jA=(e,t)=>D6(e),Oyt=(e,t)=>Fn(e,D6),qCr=yr(em,Cpe,D6,yc,(e,t,n,r)=>{if(!e)return!1;const o=n.rowIdToIndexMap.get(e.id),i=r.slice(t.firstColumnIndex,t.lastColumnIndex).findIndex(l=>l.field===e.field);return!(o!==void 0&&i!==-1&&o>=t.firstRowIndex&&o<=t.lastRowIndex)}),I7e=ha(qCr,yc,D6,em,(e,t,n,r)=>{if(!e)return null;const o=n.rowIdToIndexMap.get(r.id);if(o===void 0)return null;const i=t.findIndex(s=>s.field===r.field);return i===-1?null:Se({},r,{rowIndex:o,columnIndex:i})}),MW={autoHeight:!1,autoPageSize:!1,autosizeOnMount:!1,checkboxSelection:!1,checkboxSelectionVisibleOnly:!1,clipboardCopyCellDelimiter:" ",columnBufferPx:150,columnFilterDebounceMs:150,columnHeaderHeight:56,disableAutosize:!1,disableColumnFilter:!1,disableColumnMenu:!1,disableColumnReorder:!1,disableColumnResize:!1,disableColumnSelector:!1,disableColumnSorting:!1,disableDensitySelector:!1,disableEval:!1,disableMultipleColumnsFiltering:!1,disableMultipleColumnsSorting:!1,disableMultipleRowSelection:!1,disableRowSelectionOnClick:!1,disableRowSelectionExcludeModel:!1,disableVirtualization:!1,editMode:bb.Cell,filterDebounceMs:150,filterMode:"client",hideFooter:!1,hideFooterPagination:!1,hideFooterRowCount:!1,hideFooterSelectedRowCount:!1,ignoreDiacritics:!1,ignoreValueFormatterDuringExport:!1,keepColumnPositionIfDraggedOutside:!1,keepNonExistentRowsSelected:!1,loading:!1,logger:console,logLevel:"error",pageSizeOptions:[25,50,100],pagination:!1,paginationMode:"client",resizeThrottleMs:60,rowBufferPx:150,rowHeight:52,rows:[],rowSelection:!0,rowSpacingType:"margin",rowSpanning:!1,showCellVerticalBorder:!1,showColumnVerticalBorder:!1,showToolbar:!1,sortingMode:"client",sortingOrder:["asc","desc",null],throttleRowsMs:0,virtualizeColumnsWithAutoRowHeight:!1,tabNavigation:"none"},KCr=e=>{const t=f.useRef({}),n=f.useRef(!1),r=f.useCallback(p=>{n.current||!p||(n.current=!0,Object.values(p.appliers).forEach(h=>{h()}),n.current=!1)},[]),o=f.useCallback((p,h,m)=>{t.current[p]||(t.current[p]={processors:new Map,processorsAsArray:[],appliers:{},processorsUpdated:!1});const g=t.current[p];return g.processors.get(h)!==m&&(g.processors.set(h,m),g.processorsAsArray=Array.from(t.current[p].processors.values()).filter(x=>x!==null),g.processorsUpdated=!0),()=>{t.current[p].processors.set(h,null),t.current[p].processorsAsArray=Array.from(t.current[p].processors.values()).filter(x=>x!==null)}},[]),i=f.useCallback((p,h,m)=>(t.current[p]||(t.current[p]={processors:new Map,processorsAsArray:[],appliers:{},processorsUpdated:!1}),t.current[p].appliers[h]=m,()=>{const g=t.current[p].appliers,y=Zn(g,[h].map(yI));t.current[p].appliers=y}),[]),s=f.useCallback(p=>{r(t.current[p])},[r]),l=f.useCallback(()=>{for(const p in t.current){if(!Object.prototype.hasOwnProperty.call(t.current,p))continue;const h=t.current[p];h.processorsUpdated&&(h.processorsUpdated=!1,r(h))}},[r]),c=f.useCallback((...p)=>{const[h,m,g]=p;if(!t.current[h])return m;const y=t.current[h].processorsAsArray;let x=m;for(let v=0;v{const o=f.useRef(null),i=f.useRef(`mui-${Math.round(Math.random()*1e9)}`),s=f.useCallback(()=>{o.current=e.current.registerPipeProcessor(t,i.current,n)},[e,n,t]);b5(()=>{r&&s()});const l=f.useRef(!0);f.useEffect(()=>(l.current?l.current=!1:r&&s(),()=>{o.current&&(o.current(),o.current=null)}),[s,r])},iwe=(e,t,n)=>{const r=f.useRef(null),o=f.useRef(`mui-${Math.round(Math.random()*1e9)}`),i=f.useCallback(()=>{r.current=e.current.registerPipeApplier(t,o.current,n)},[e,n,t]);b5(()=>{i()});const s=f.useRef(!0);f.useEffect(()=>(s.current?s.current=!1:i(),()=>{r.current&&(r.current(),r.current=null)}),[i])},YCr=(e,t,n)=>{const r=j1r(n),o=d4(n),i=h4(n),s=Math.min(i.enabled?i.paginationModel.pageSize:o,o);return Se({},e,{rowsMeta:{currentPageTotalHeight:s*r,positions:Array.from({length:s},(l,c)=>c*r),pinnedTopRowsTotalHeight:0,pinnedBottomRowsTotalHeight:0}})},XCr=(e,t)=>{const n=e.current.virtualizer,{getRowHeight:r,setLastMeasuredRowIndex:o,storeRowHeightMeasurement:i,resetRowHeights:s,hydrateRowsMeta:l,observeRowHeight:c,rowHasAutoHeight:u,getRowHeightEntry:d,getLastMeasuredRowIndex:p}=n.api.rowsMeta;iwe(e,"rowHeight",l);const h={unstable_getRowHeight:r,unstable_setLastMeasuredRowIndex:o,unstable_storeRowHeightMeasurement:i,resetRowHeights:s},m={hydrateRowsMeta:l,observeRowHeight:c,rowHasAutoHeight:u,getRowHeightEntry:d,getLastMeasuredRowIndex:p};oi(e,h,"public"),oi(e,m,"private")},QCr=yr(yc,y5,(e,t)=>{const n=e.length;return n===0?0:pE(t[n-1]+e[n-1].computedWidth,1)}),JCr=()=>vge((e,t,n,r,o)=>Se({},e,{headerHeight:t,groupHeaderHeight:n,headerFilterHeight:r,headersTotalHeight:o}),{maxSize:1});function ZCr(){var F,W;const e=$d(),t=sr(),n=Th(),{listView:r}=t,o=Fn(n,yc),i=Fn(n,f4),s=VY(n),l=Fn(n,$6),c=f.useCallback(U=>l.has(U)&&n.current.isRowSelectable(U),[l,n]),u=Oyt(n),d=Fn(n,pwr),p=Fn(n,jxt),h=Fn(n,Nxt),{autoHeight:m}=t,g=r,y=Fn(n,k6),x=Mxt(t.rowHeight,MW.rowHeight),v=Math.floor(x*y),b=Math.floor(t.columnHeaderHeight*y),w=Math.floor((t.columnGroupHeaderHeight??t.columnHeaderHeight)*y),S=Math.floor((t.headerFilterHeight??t.columnHeaderHeight)*y),C=Fn(n,QCr),N=ZY(n,t),j=s.left.reduce((U,K)=>U+K.computedWidth,0),I=s.right.reduce((U,K)=>U+K.computedWidth,0),_=Eyt(n,t),T={rowHeight:v,headerHeight:b,columnsTotalWidth:C,leftPinnedWidth:j,rightPinnedWidth:I,topPinnedHeight:N,bottomPinnedHeight:0,autoHeight:m,minimalContentHeight:kxt,scrollbarSize:t.scrollbarSize},P=gm(JCr).current,E=Fn(n,d4),M=Fn(n,h4),R=Math.min(M.enabled?M.paginationModel.pageSize:E,E),{getRowHeight:$,getEstimatedRowHeight:D,getRowSpacing:z}=t,V=t.slots.row,B=(F=t.slotProps)==null?void 0:F.row;Fn(n,I7e);const G=gm(()=>new hCr({container:n.current.mainElementRef,scroller:n.current.virtualScrollerRef,scrollbarVertical:n.current.virtualScrollbarVerticalRef,scrollbarHorizontal:n.current.virtualScrollbarHorizontalRef})).current,H=jCr({layout:G,dimensions:T,virtualization:{isRtl:e,rowBufferPx:t.rowBufferPx,columnBufferPx:t.columnBufferPx},colspan:{enabled:d,getColspan:f.useCallback((U,K)=>{if(typeof K.colSpan=="function"){const X=n.current.getRow(U),J=n.current.getRowValue(X,K);return K.colSpan(J,X,K,n)??0}return K.colSpan??1},[n])},initialState:{scroll:(W=t.initialState)==null?void 0:W.scroll,rowSpanning:n.current.state.rowSpanning,virtualization:n.current.state.virtualization},rows:u.rows,range:u.range,rowCount:R,columns:o,pinnedRows:i,pinnedColumns:s,disableHorizontalScroll:r,disableVerticalScroll:_.overlayType==="noColumnsOverlay"||_.loadingOverlayVariant==="skeleton",getRowHeight:f.useMemo(()=>{if($)return U=>$(Se({},U,{densityFactor:y}))},[$,y]),getEstimatedRowHeight:f.useMemo(()=>D?U=>D(Se({},U,{densityFactor:y})):void 0,[D,y]),getRowSpacing:f.useMemo(()=>z?U=>{const K=u.rowIdToIndexMap.get(U.id)??-1,X={isFirstVisible:K===0,isLastVisible:K===u.rows.length-1,indexRelativeToCurrentPage:K};return z(Se({},U,X,{indexRelativeToCurrentPage:n.current.getRowIndexRelativeToVisibleRows(U.id)}))}:void 0,[n,z,u.rows,u.rowIdToIndexMap]),applyRowHeight:no((U,K)=>n.current.unstable_applyPipeProcessors("rowHeight",U,K)),virtualizeColumnsWithAutoRowHeight:t.virtualizeColumnsWithAutoRowHeight,focusedVirtualCell:no(()=>I7e(n)),resizeThrottleMs:t.resizeThrottleMs,onResize:no(U=>n.current.publishEvent("resize",U)),onWheel:no(U=>{n.current.publishEvent("virtualScrollerWheel",{},U)}),onTouchMove:no(U=>{n.current.publishEvent("virtualScrollerTouchMove",{},U)}),onRenderContextChange:no(U=>{n.current.publishEvent("renderedRowsIntervalChange",U)}),onScrollChange:f.useCallback((U,K)=>{n.current.publishEvent("scrollPositionChange",{top:U.top,left:U.left,renderContext:K})},[n]),scrollReset:g,renderRow:f.useCallback(U=>a.jsx(V,Se({row:U.model,rowId:U.id,index:U.rowIndex,selected:c(U.id),offsetLeft:U.offsetLeft,columnsTotalWidth:C,rowHeight:U.baseRowHeight,pinnedColumns:s,visibleColumns:o,firstColumnIndex:U.firstColumnIndex,lastColumnIndex:U.lastColumnIndex,focusedColumnIndex:U.focusedColumnIndex,isFirstVisible:U.isFirstVisible,isLastVisible:U.isLastVisible,isNotVisible:U.isVirtualFocusRow,showBottomBorder:U.showBottomBorder,scrollbarWidth:p,gridHasFiller:h},B),U.id),[C,h,c,s,V,B,p,o]),renderInfiniteLoadingTrigger:f.useCallback(U=>{var K,X;return(X=(K=n.current).getInfiniteLoadingTriggerElement)==null?void 0:X.call(K,{lastRowId:U})},[n])});return b5(()=>{n.current.store.state.dimensions=P(H.store.state.dimensions,b,w,S,N),n.current.store.state.rowsMeta=H.store.state.rowsMeta,n.current.store.state.virtualization=H.store.state.virtualization}),WE(H.store,hc.selectors.dimensions,(U,K)=>{K.isReady&&n.current.setState(X=>Se({},X,{dimensions:P(K,b,w,S,N)}))}),WE(H.store,hc.selectors.rowsMeta,(U,K)=>{K!==n.current.state.rowsMeta&&n.current.setState(X=>Se({},X,{rowsMeta:K}))}),WE(H.store,Gm.selectors.store,(U,K)=>{K.renderContext!==vD&&K!==n.current.state.virtualization&&n.current.setState(X=>Se({},X,{virtualization:K}))}),n.current.register("private",{virtualizer:H}),XCr(n),H}const eNr=e=>{const{classes:t,hasScrollX:n,hasPinnedRight:r,loadingOverlayVariant:o,overlayType:i}=e;return Un({root:["main",r&&"main--hasPinnedRight",(o==="skeleton"||i==="noColumnsOverlay")&&"main--hiddenContent"],scroller:["virtualScroller",n&&"virtualScroller--hasScrollX"]},ii,t)},tNr=Ai("div",{name:"MuiDataGrid",slot:"VirtualScroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.virtualScroller,n.hasScrollX&&t["virtualScroller--hasScrollX"]]}})({position:"relative",height:"100%",flexGrow:1,overflow:"scroll",scrollbarWidth:"none",display:"flex",flexDirection:"column","&::-webkit-scrollbar":{display:"none"},"@media print":{overflow:"hidden"},zIndex:0}),nNr=e=>e.current.state.dimensions.rightPinnedWidth>0;function rNr(e){var N,j,I,_;const t=Th(),n=sr(),r=Fn(t,Cxt),o=Fn(t,Sxt),i=Fn(t,nNr),s=Fn(t,P1r),{overlayType:l,loadingOverlayVariant:c}=Eyt(t,n),u=(N=n.slots)==null?void 0:N[l],d={classes:n.classes,hasScrollX:o,hasPinnedRight:i,overlayType:l,loadingOverlayVariant:c},p=eNr(d),h=ZCr().api.getters,{getContainerProps:m,getScrollerProps:g,getContentProps:y,getPositionerProps:x,getScrollbarVerticalProps:v,getScrollbarHorizontalProps:b,getRows:w,getScrollAreaProps:S}=h,C=w(void 0,Mc(t));return a.jsxs(C2r,Se({className:p.root},m(),{ownerState:d,children:[a.jsx(d9,Se({scrollDirection:"left"},S())),a.jsx(d9,Se({scrollDirection:"right"},S())),a.jsx(d9,Se({scrollDirection:"up"},S())),a.jsx(d9,Se({scrollDirection:"down"},S())),a.jsxs(tNr,Se({className:p.scroller},g(),{ownerState:d,children:[a.jsxs(E2r,{children:[!n.listView&&a.jsx(b2r,{}),a.jsx(n.slots.pinnedRows,{position:"top",virtualScroller:h})]}),l&&a.jsx(GCr,{overlayType:l,loadingOverlayVariant:c,children:a.jsx(u,Se({},(j=n.slotProps)==null?void 0:j[l]))}),a.jsx(P2r,Se({},y(),{children:a.jsxs(L2r,Se({role:"rowgroup"},x(),{children:[C,a.jsx(n.slots.detailPanels,{virtualScroller:h})]}))})),s&&a.jsx(O2r,{rowsLength:C.length}),a.jsx(n.slots.bottomContainer,{children:a.jsx(n.slots.pinnedRows,{position:"bottom",virtualScroller:h})})]})),o&&a.jsxs(f.Fragment,{children:[((I=n.pinnedColumnsSectionSeparator)==null?void 0:I.endsWith("shadow"))&&a.jsx(E7e,{position:"horizontal"}),a.jsx(j7e,Se({position:"horizontal"},b()))]}),r&&a.jsxs(f.Fragment,{children:[((_=n.pinnedRowsSectionSeparator)==null?void 0:_.endsWith("shadow"))&&a.jsx(E7e,{position:"vertical"}),a.jsx(j7e,Se({position:"vertical"},v()))]}),o&&r&&a.jsx(zCr,{"aria-hidden":"true"}),e.children]}))}function oNr(){var t;const e=sr();return e.hideFooter?null:a.jsx(e.slots.footer,Se({},(t=e.slotProps)==null?void 0:t.footer))}let Yne;function tX(){return Yne===void 0&&document.createElement("div").focus({get preventScroll(){return Yne=!0,!1}}),Yne}function iNr({defaultSlots:e,slots:t}){const n=t;if(!n||Object.keys(n).length===0)return e;const r=Se({},e);return Object.keys(n).forEach(o=>{const i=o;n[i]!==void 0&&(r[i]=n[i])}),r}const aNr=e=>{const t=e.match(/^__row_group_by_columns_group_(.*)__$/);return t?t[1]:null},sNr=e=>e===Zxt||aNr(e)!==null,$yt=(e,t)=>{if(e)if(t){if(e===Ni.LEFT)return"right";if(e===Ni.RIGHT)return"left"}else{if(e===Ni.LEFT)return"left";if(e===Ni.RIGHT)return"right"}};function nX(e,t,n,r){const o=$yt(n,t);return!o||r===void 0||(e[o]=r),e}const lNr=["column","row","rowId","rowNode","align","children","colIndex","width","className","style","colSpan","disableDragEvents","isNotVisible","pinnedOffset","pinnedPosition","showRightBorder","showLeftBorder","onClick","onDoubleClick","onMouseDown","onMouseUp","onMouseOver","onKeyDown","onKeyUp","onDragEnter","onDragOver"],cNr=["changeReason","unstable_updateValueOnRender"];Ni.LEFT+"",Cv.LEFT,Ni.RIGHT+"",Cv.RIGHT,Ni.NONE+"",Ni.VIRTUAL+"";const uNr=e=>{const{align:t,showLeftBorder:n,showRightBorder:r,pinnedPosition:o,isEditable:i,isSelected:s,isSelectionMode:l,classes:c}=e,u={root:["cell",`cell--text${vn(t)}`,s&&"selected",i&&"cell--editable",n&&"cell--withLeftBorder",r&&"cell--withRightBorder",o===Ni.LEFT&&"cell--pinnedLeft",o===Ni.RIGHT&&"cell--pinnedRight",l&&!i&&"cell--selectionMode"]};return Un(u,ii,c)},dNr=Kr(function(t,n){var qe,dt;const{column:r,row:o,rowId:i,rowNode:s,align:l,colIndex:c,width:u,className:d,style:p,colSpan:h,disableDragEvents:m,isNotVisible:g,pinnedOffset:y,pinnedPosition:x,showRightBorder:v,showLeftBorder:b,onClick:w,onDoubleClick:S,onMouseDown:C,onMouseUp:N,onMouseOver:j,onKeyDown:I,onKeyUp:_,onDragEnter:T,onDragOver:P}=t,E=Zn(t,lNr),M=Th(),R=sr(),$=$d(),D=r.field,z=Fn(M,H2r,{rowId:i,field:D}),B=UY().hooks.useCellAggregationResult(i,D),G=z?Da.Edit:Da.View,{value:H,formattedValue:F}=B||{},W=M.current.getCellParamsForRow(i,D,o,{colDef:r,cellMode:G,rowNode:s,tabIndex:Fn(M,()=>{const Ze=Z1e(M);return Ze&&Ze.field===D&&Ze.id===i?0:-1}),hasFocus:Fn(M,()=>{const Ze=em(M);return(Ze==null?void 0:Ze.id)===i&&Ze.field===D}),value:H,formattedValue:F});W.api=M.current,Fn(M,()=>M.current.isCellEditable(W));const U=Fn(M,()=>M.current.unstable_applyPipeProcessors("isCellSelected",!1,{id:i,field:D})),K=M.current.virtualizer.store,X=q2(K,HT.selectors.hiddenCells),J=q2(K,HT.selectors.spannedCells),{hasFocus:te,isEditable:re=!1,value:ce}=W,ae=(G==="view"||!re)&&r.type!=="actions"?W.tabIndex:-1,{classes:oe,getCellClassName:ue}=R,se=[Fn(M,()=>M.current.unstable_applyPipeProcessors("cellClassName",[],{id:i,field:D}).filter(Boolean).join(" "))];r.cellClassName&&se.push(typeof r.cellClassName=="function"?r.cellClassName(W):r.cellClassName),r.display==="flex"&&se.push(Be["cell--flex"]),ue&&se.push(ue(W));const ge=W.formattedValue??ce,ye=f.useRef(null),de=Di(n,ye),Ne=R.cellSelection??!1,_e={align:l,showLeftBorder:b,showRightBorder:v,isEditable:re,classes:R.classes,pinnedPosition:x,isSelected:U,isSelectionMode:Ne},xe=uNr(_e),we=f.useCallback(Ze=>Qe=>{const lt=M.current.getCellParams(i,D||"");M.current.publishEvent(Ze,lt,Qe),N&&N(Qe)},[M,D,N,i]),Te=f.useCallback(Ze=>Qe=>{const lt=M.current.getCellParams(i,D||"");M.current.publishEvent(Ze,lt,Qe),C&&C(Qe)},[M,D,C,i]),Re=f.useCallback((Ze,Qe)=>lt=>{if(!M.current.getRow(i))return;const bt=M.current.getCellParams(i,D||"");M.current.publishEvent(Ze,bt,lt),Qe&&Qe(lt)},[M,D,i]),Ue=((qe=X[i])==null?void 0:qe[c])??!1,He=((dt=J[i])==null?void 0:dt[c])??1,Ye=f.useMemo(()=>{if(g)return{padding:0,opacity:0,width:0,height:0,border:0};const Ze=nX(Se({"--width":`${u}px`},p),$,x,y),Qe=x===Ni.LEFT,lt=x===Ni.RIGHT;return He>1&&(Ze.height=`calc(var(--height) * ${He})`,Ze.zIndex=10,(Qe||lt)&&(Ze.zIndex=40)),Ze},[u,g,p,y,x,$,He]);if(Ia(()=>{if(!te||G===Da.Edit)return;const Ze=Zl(M.current.rootElementRef.current);if(ye.current&&!ye.current.contains(Ze.activeElement)){const lt=ye.current.querySelector('[tabindex="0"]')||ye.current;if(tX())lt.focus({preventScroll:!0});else{const bt=M.current.getScrollPosition();lt.focus(),M.current.scroll(bt)}}},[te,G,M]),Ue)return a.jsx("div",{"data-colindex":c,role:"presentation",style:Se({width:"var(--width)"},Ye)});let We=E.onFocus,at,Oe;if(z===null&&r.renderCell&&(at=r.renderCell(W)),z!==null&&r.renderEditCell){const Ze=M.current.getRowWithUpdatedValues(i,r.field),Qe=Zn(z,cNr),lt=r.valueFormatter?r.valueFormatter(z.value,Ze,r,M):W.formattedValue,bt=Se({},W,{row:Ze,formattedValue:lt},Qe);at=r.renderEditCell(bt),se.push(Be["cell--editing"]),se.push(oe==null?void 0:oe["cell--editing"])}if(at===void 0){const Ze=ge==null?void 0:ge.toString();at=Ze,Oe=Ze}const Ae=m?null:{onDragEnter:Re("cellDragEnter",T),onDragOver:Re("cellDragOver",P)};return a.jsx("div",Se({className:be(xe.root,se,d),role:"gridcell","data-field":D,"data-colindex":c,"aria-colindex":c+1,"aria-colspan":h,"aria-rowspan":He,style:Ye,title:Oe,tabIndex:ae,onClick:Re("cellClick",w),onDoubleClick:Re("cellDoubleClick",S),onMouseOver:Re("cellMouseOver",j),onMouseDown:Te("cellMouseDown"),onMouseUp:we("cellMouseUp"),onKeyDown:Re("cellKeyDown",I),onKeyUp:Re("cellKeyUp",_)},Ae,E,{onFocus:We,ref:de,children:at}))}),fNr=rS(dNr),pNr=["field","type","align","width","height","empty","style","className"],_7e="1.3em",hNr="1.2em",P7e=[40,80],mNr={number:[40,60],string:[40,80],date:[40,60],dateTime:[60,80],singleSelect:[40,80]},gNr=e=>{const{align:t,classes:n,empty:r}=e,o={root:["cell","cellSkeleton",`cell--text${t?vn(t):"Left"}`,r&&"cellEmpty"]};return Un(o,ii,n)},xNr=lwr(12345);function yNr(e){const{field:t,type:n,align:r,width:o,height:i,empty:s=!1,style:l,className:c}=e,u=Zn(e,pNr),d=sr(),p={classes:d.classes,align:r,empty:s},h=gNr(p),m=f.useMemo(()=>{if(n==="boolean"||n==="actions")return{variant:"circular",width:_7e,height:_7e};const[y,x]=n?mNr[n]??P7e:P7e;return{variant:"text",width:`${Math.round(xNr(y,x))}%`,height:hNr}},[n]);return a.jsx("div",Se({"data-field":t,className:be(h.root,c),style:Se({height:i,maxWidth:o,minWidth:o},l)},u,{children:!s&&a.jsx(d.slots.baseSkeleton,Se({},m))}))}const vNr=rS(yNr),bNr=()=>()=>{},wNr=()=>!1,SNr=()=>!0,CNr=()=>$1e.useSyncExternalStore(bNr,wNr,SNr),Dyt=f.createContext(void 0);function F6(){const e=f.useContext(Dyt);if(e===void 0)throw new Error("MUI X: Missing context.");return e}function NNr({children:e}){const t=f.useRef(null),n=f.useRef(null),r=f.useRef(null),o=f.useMemo(()=>({columnsPanelTriggerRef:t,filterPanelTriggerRef:n,aiAssistantPanelTriggerRef:r}),[]);return a.jsx(Dyt.Provider,{value:o,children:e})}function jNr(){var u;const e=Eo(),t=Fn(e,cg),n=sr(),r=Fn(e,Pw),{columnsPanelTriggerRef:o,filterPanelTriggerRef:i,aiAssistantPanelTriggerRef:s}=F6(),l=e.current.unstable_applyPipeProcessors("preferencePanel",null,r.openedPanelValue??Td.filters);let c=null;switch(r.openedPanelValue){case Td.filters:c=i.current;break;case Td.columns:c=o.current;break;case Td.aiAssistant:c=s.current;break}return a.jsx(n.slots.panel,Se({id:r.panelId,open:t.length>0&&r.open,"aria-labelledby":r.labelId,target:c,onClose:()=>e.current.hidePreferences()},(u=n.slotProps)==null?void 0:u.panel,{children:l}))}function ENr(){var t;const e=sr();return a.jsxs(f.Fragment,{children:[a.jsx(jNr,{}),e.showToolbar&&a.jsx(e.slots.toolbar,Se({},(t=e.slotProps)==null?void 0:t.toolbar))]})}const INr=["className","children","sidePanel"],_Nr=(e,t)=>{const{autoHeight:n,classes:r,showCellVerticalBorder:o}=e,i={root:["root",n&&"autoHeight",`root--density${vn(t)}`,e.slots.toolbar===null&&"root--noToolbar","withBorderColor",o&&"withVerticalBorder"]};return Un(i,ii,r)},PNr=Kr(function(t,n){const r=sr(),{className:o,children:i,sidePanel:s}=t,l=Zn(t,INr),c=Th(),u=Fn(c,fE),d=c.current.rootElementRef,p=f.useCallback(v=>{v!==null&&c.current.publishEvent("rootMount",v)},[c]),h=Di(d,n,p),m=r,g=_Nr(m,u),y=jwr();return CNr()?null:a.jsxs(rbr,Se({className:be(g.root,o,y.className,s&&Be.withSidePanel),ownerState:m},l,{ref:h,children:[a.jsxs("div",{className:Be.mainContent,role:"presentation",children:[a.jsx(ENr,{}),a.jsx(rNr,{children:i}),a.jsx(oNr,{})]}),s,y.tag]}))}),ANr=rS(PNr),TNr=["className"],kNr=e=>{const{classes:t}=e;return Un({root:["footerContainer","withBorderColor"]},ii,t)},MNr=Ai("div",{name:"MuiDataGrid",slot:"FooterContainer"})({display:"flex",justifyContent:"space-between",alignItems:"center",minHeight:52,borderTop:"1px solid"}),RNr=Kr(function(t,n){const{className:r}=t,o=Zn(t,TNr),i=sr(),s=kNr(i);return a.jsx(MNr,Se({className:be(s.root,r),ownerState:i},o,{ref:n}))}),ONr=["className"],$Nr=e=>{const{classes:t}=e;return Un({root:["overlay"]},ii,t)},DNr=Ai("div",{name:"MuiDataGrid",slot:"Overlay"})({width:"100%",height:"100%",display:"flex",gap:fr.spacing(1),flexDirection:"column",alignSelf:"center",alignItems:"center",justifyContent:"center",textAlign:"center",textWrap:"balance",backgroundColor:fr.colors.background.backdrop}),rX=Kr(function(t,n){const{className:r}=t,o=Zn(t,ONr),i=sr(),s=$Nr(i);return a.jsx(DNr,Se({className:be(s.root,r),ownerState:i},o,{ref:n}))});function Db(e,t,n,r={}){return typeof t=="function"?t(n,r):t?(t.props.className&&(n.className=LNr(t.props.className,n.className)),(t.props.style||n.style)&&(n.style=Se({},n.style,t.props.style)),f.cloneElement(t,n)):f.createElement(e,n)}function LNr(e,t){return!e||!t?e||t:`${e} ${t}`}const Lyt=f.createContext(void 0);function FNr(){const e=f.useContext(Lyt);if(e===void 0)throw new Error("MUI X: Missing context. Toolbar subcomponents must be placed within a component.");return e}function zNr(e,t){if(!e.ref.current||!t.ref.current)return 0;const n=e.ref.current.compareDocumentPosition(t.ref.current);return n?n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0:0}const BNr=["render","className"],HNr=e=>{const{classes:t}=e;return Un({root:["toolbar"]},ii,t)},VNr=Ai("div",{name:"MuiDataGrid",slot:"Toolbar"})({flex:"0 1 1px",display:"flex",alignItems:"center",justifyContent:"end",gap:fr.spacing(.25),padding:fr.spacing(.75),minHeight:52,boxSizing:"border-box",borderBottom:`1px solid ${fr.colors.border.base}`}),Fyt=Kr(function(t,n){const{render:r,className:o}=t,i=Zn(t,BNr),s=sr(),l=HNr(s),[c,u]=f.useState(null),[d,p]=f.useState([]),h=f.useCallback(()=>d.sort(zNr),[d]),m=f.useCallback((C,N,j=!0)=>{var P,E;let I=C;const _=h(),T=_.length;for(let M=0;M=T){if(!j)return-1;I=0}else if(I<0){if(!j)return-1;I=T-1}if(!((P=_[I].ref.current)!=null&&P.disabled)&&((E=_[I].ref.current)==null?void 0:E.ariaDisabled)!=="true")return I}return-1},[h]),g=f.useCallback((C,N)=>{p(j=>[...j,{id:C,ref:N}])},[]),y=f.useCallback(C=>{p(N=>N.filter(j=>j.id!==C))},[]),x=f.useCallback(C=>{var _;if(!c)return;const N=h(),j=N.findIndex(T=>T.id===c);let I=-1;if(C.key==="ArrowRight"?(C.preventDefault(),I=m(j,1)):C.key==="ArrowLeft"?(C.preventDefault(),I=m(j,-1)):C.key==="Home"?(C.preventDefault(),I=m(-1,1,!1)):C.key==="End"&&(C.preventDefault(),I=m(N.length,-1,!1)),I>=0&&I{c!==C&&u(C)},[c,u]),b=f.useCallback(C=>{var _;const N=h(),j=N.findIndex(T=>T.id===C),I=m(j,1);if(I>=0&&I{var N,j;const C=h();if(C.length>0){if(!c){u(C[0].id);return}const I=C.findIndex(_=>_.id===c);if(C[I]){if(I===-1){const _=C[I];_&&(u(_.id),(j=_.ref.current)==null||j.focus())}}else{const _=C[C.length-1];_&&(u(_.id),(N=_.ref.current)==null||N.focus())}}},[h,m]);const w=f.useMemo(()=>({focusableItemId:c,registerItem:g,unregisterItem:y,onItemKeyDown:x,onItemFocus:v,onItemDisabled:b}),[c,g,y,x,v,b]),S=Db(VNr,r,Se({role:"toolbar","aria-orientation":"horizontal","aria-label":s.label||void 0,className:be(l.root,o)},i,{ref:n}));return a.jsx(Lyt.Provider,{value:w,children:S})}),UNr=["render","onKeyDown","onFocus","disabled","aria-disabled"],KB=Kr(function(t,n){var I;const{render:r,onKeyDown:o,onFocus:i,disabled:s,"aria-disabled":l}=t,c=Zn(t,UNr),u=Jo(),d=sr(),p=f.useRef(null),h=Di(p,n),{focusableItemId:m,registerItem:g,unregisterItem:y,onItemKeyDown:x,onItemFocus:v,onItemDisabled:b}=FNr(),w=_=>{x(_),o==null||o(_)},S=_=>{v(u),i==null||i(_)};f.useEffect(()=>(g(u,p),()=>y(u)),[]);const C=f.useRef(s);f.useEffect(()=>{C.current!==s&&s===!0&&b(u,s),C.current=s},[s,u,b]);const N=f.useRef(l);f.useEffect(()=>{N.current!==l&&l===!0&&b(u,!0),N.current=l},[l,u,b]);const j=Db(d.slots.baseIconButton,r,Se({},(I=d.slotProps)==null?void 0:I.baseIconButton,{tabIndex:m===u?0:-1},c,{disabled:s,"aria-disabled":l,onKeyDown:w,onFocus:S,ref:h}));return a.jsx(f.Fragment,{children:j})}),WNr=["className","children"],GNr=e=>{const{classes:t}=e;return Un({root:["toolbarContainer"]},ii,t)},qNr=Ai(Fyt,{name:"MuiDataGrid",slot:"ToolbarContainer",shouldForwardProp:e=>e!=="ownerState"})({display:"flex",alignItems:"center",flexWrap:"wrap",gap:fr.spacing(1),padding:fr.spacing(.5),minHeight:"auto"}),KNr=Kr(function(t,n){const{className:r,children:o}=t,i=Zn(t,WNr),s=sr(),l=GNr(s);return o?a.jsx(qNr,Se({className:be(l.root,r),ownerState:s},i,{ref:n,children:o})):null}),YNr=e=>{const{classes:t,open:n}=e;return Un({root:["menuIcon",n&&"menuOpen"],button:["menuIconButton"]},ii,t)},XNr=f.memo(e=>{var h,m;const{colDef:t,open:n,columnMenuId:r,columnMenuButtonId:o,iconButtonRef:i}=e,s=Eo(),l=sr(),c=Se({},e,{classes:l.classes}),u=YNr(c),d=f.useCallback(g=>{g.preventDefault(),g.stopPropagation(),s.current.toggleColumnMenu(t.field)},[s,t.field]),p=t.headerName??t.field;return a.jsx("div",{className:u.root,children:a.jsx(l.slots.baseTooltip,Se({title:s.current.getLocaleText("columnMenuLabel"),enterDelay:1e3},(h=l.slotProps)==null?void 0:h.baseTooltip,{children:a.jsx(l.slots.baseIconButton,Se({ref:i,tabIndex:-1,className:u.button,"aria-label":s.current.getLocaleText("columnMenuAriaLabel")(p),size:"small",onClick:d,"aria-haspopup":"menu","aria-expanded":n,"aria-controls":n?r:void 0,id:o},(m=l.slotProps)==null?void 0:m.baseIconButton,{children:a.jsx(l.slots.columnMenuIcon,{fontSize:"inherit"})}))}))})});function QNr({columnMenuId:e,columnMenuButtonId:t,ContentComponent:n,contentComponentProps:r,field:o,open:i,target:s,onExited:l}){const c=Eo(),u=c.current.getColumn(o),d=no(p=>{p&&(p.stopPropagation(),s!=null&&s.contains(p.target))||c.current.hideColumnMenu()});return!s||!u?null:a.jsx(R6,{position:`bottom-${u.align==="right"?"start":"end"}`,open:i,target:s,onClose:d,onExited:l,children:a.jsx(n,Se({colDef:u,hideMenu:d,open:i,id:e,labelledby:t},r))})}function JNr(e){return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth}function RW(e,t){return e.closest(`.${t}`)}function Lb(e){return e.replace(/["\\]/g,"\\$&")}function ZNr(e,t){return e.querySelector(`[role="columnheader"][data-field="${Lb(t)}"]`)}function zyt(e){return`.${Be.row}[data-id="${Lb(String(e))}"]`}function ejr(e,t){return e.querySelector(zyt(t))}function tjr(e,{id:t,field:n}){const r=zyt(t),o=`.${Be.cell}[data-field="${Lb(n)}"]`,i=`${r} ${o}`;return e.querySelector(i)}function z6(e){return e.target.nodeType===1&&!e.currentTarget.contains(e.target)}function njr(e){return e.getAttribute("data-field")}function rjr(e,t){return e.querySelector(`[data-field="${Lb(t)}"]`)}function ojr(e){return e.getAttribute("data-fields").slice(2,-2).split("-|-")}function ijr(e,t){return Array.from(e.querySelectorAll(`[data-fields*="|-${Lb(t)}-|"]`)??[])}function ajr(e,t){var s;if(!RW(e,Be.root))throw new Error("MUI X: The root element is not found.");const r=e.getAttribute("aria-colindex");if(!r)return[];const o=Number(r)-1,i=[];return(s=t.virtualScrollerRef)!=null&&s.current?(Vyt(t).forEach(l=>{const c=l.getAttribute("data-id");if(!c)return;let u=o;const d=t.unstable_getCellColSpanInfo(c,o);d&&d.spannedByColSpan&&(u=d.leftVisibleCellIndex);const p=l.querySelector(`[data-colindex="${u}"]`);p&&i.push(p)}),i):[]}function A7e(e,t){return e.rootElementRef.current.querySelector(`.${Be[t]}`)}const Byt=({api:e,colIndex:t,position:n,filterFn:r})=>{if(t===null)return[];const o=[];return Vyt(e).forEach(i=>{i.getAttribute("data-id")&&i.querySelectorAll(`.${Be[n==="left"?"cell--pinnedLeft":"cell--pinnedRight"]}`).forEach(l=>{const c=g4(l);c!==null&&r(c)&&o.push(l)})}),o};function sjr(e,t,n){const r=g4(t);return Byt({api:e,colIndex:r,position:n?"right":"left",filterFn:o=>n?or})}function ljr(e,t,n){const r=g4(t);return Byt({api:e,colIndex:r,position:n?"left":"right",filterFn:o=>n?o>r:o{var i;if(!((i=e.columnHeadersContainerRef)!=null&&i.current))return[];if(t===null)return[];const o=[];return e.columnHeadersContainerRef.current.querySelectorAll(`.${Be[n==="left"?"columnHeader--pinnedLeft":"columnHeader--pinnedRight"]}`).forEach(s=>{const l=g4(s);l!==null&&r(l,s)&&o.push(s)}),o};function cjr(e,t,n){const r=g4(t);return Hyt({api:e,position:n?"right":"left",colIndex:r,filterFn:o=>n?or})}function ujr(e,t,n){const r=g4(t);return Hyt({api:e,position:n?"left":"right",colIndex:r,filterFn:(o,i)=>i.classList.contains(Be["columnHeader--last"])?!1:n?o>r:o div > [data-field="${Lb(t)}"][role="columnheader"]`)}function fjr(e,t){return e.columnHeadersContainerRef.current.querySelector(`:scope > .${Be.headerFilterRow} > [data-field="${Lb(t)}"]`)}function pjr(e,t){const n=e.virtualScrollerRef.current;return Array.from(n.querySelectorAll(`:scope > div > div > div > [data-field="${Lb(t)}"][role="gridcell"]`))}function Vyt(e){return e.virtualScrollerRef.current.querySelectorAll(`:scope > div > div > .${Be.row}`)}function g4(e){const t=e.getAttribute("aria-colindex");return t?Number(t)-1:null}const hjr=["className","aria-label"],mjr=e=>{const{classes:t}=e;return Un({root:["columnHeaderTitle"]},ii,t)},gjr=Ai("div",{name:"MuiDataGrid",slot:"ColumnHeaderTitle"})({textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:"var(--unstable_DataGrid-headWeight)",lineHeight:"normal"}),xjr=Kr(function(t,n){const{className:r}=t,o=Zn(t,hjr),i=sr(),s=mjr(i);return a.jsx(gjr,Se({className:be(s.root,r),ownerState:i},o,{ref:n}))});function yjr(e){var c;const{label:t,description:n}=e,r=sr(),o=f.useRef(null),[i,s]=f.useState(""),l=f.useCallback(()=>{if(!n&&(o!=null&&o.current)){const u=JNr(o.current);s(u?t:"")}},[n,t]);return a.jsx(r.slots.baseTooltip,Se({title:n||i},(c=r.slotProps)==null?void 0:c.baseTooltip,{children:a.jsx(xjr,{onMouseOver:l,ref:o,children:t})}))}const vjr=["resizable","resizing","height","side"];var awe=(function(e){return e.Left="left",e.Right="right",e})(awe||{});const bjr=e=>{const{resizable:t,resizing:n,classes:r,side:o}=e,i={root:["columnSeparator",t&&"columnSeparator--resizable",n&&"columnSeparator--resizing",o&&`columnSeparator--side${vn(o)}`],icon:["iconSeparator"]};return Un(i,ii,r)};function wjr(e){const{height:t,side:n=awe.Right}=e,r=Zn(e,vjr),o=sr(),i=Se({},e,{side:n,classes:o.classes}),s=bjr(i),l=f.useCallback(c=>{c.preventDefault(),c.stopPropagation()},[]);return a.jsx("div",Se({className:s.root,style:{minHeight:t}},r,{onClick:l,children:a.jsx(o.slots.columnResizeIcon,{className:s.icon})}))}const Sjr=f.memo(wjr),Cjr=["classes","columnMenuOpen","colIndex","height","isResizing","sortDirection","hasFocus","tabIndex","separatorSide","isDraggable","headerComponent","description","elementId","width","columnMenuIconButton","columnMenu","columnTitleIconButtons","headerClassName","label","resizable","draggableContainerProps","columnHeaderSeparatorProps","style"],Uyt=Kr(function(t,n){const{classes:r,colIndex:o,height:i,isResizing:s,sortDirection:l,tabIndex:c,separatorSide:u,isDraggable:d,headerComponent:p,description:h,width:m,columnMenuIconButton:g=null,columnMenu:y=null,columnTitleIconButtons:x=null,headerClassName:v,label:b,resizable:w,draggableContainerProps:S,columnHeaderSeparatorProps:C,style:N}=t,j=Zn(t,Cjr),I=sr(),_=f.useRef(null),T=Di(_,n);let P="none";return l!=null&&(P=l==="asc"?"ascending":"descending"),a.jsxs("div",Se({className:be(r.root,v),style:Se({},N,{width:m}),role:"columnheader",tabIndex:c,"aria-colindex":o+1,"aria-sort":P},j,{ref:T,children:[a.jsxs("div",Se({className:r.draggableContainer,draggable:d,role:"presentation"},S,{children:[a.jsxs("div",{className:r.titleContainer,role:"presentation",children:[a.jsx("div",{className:r.titleContainerContent,children:p!==void 0?p:a.jsx(yjr,{label:b,description:h,columnWidth:m})}),x]}),g]})),a.jsx(Sjr,Se({resizable:!I.disableColumnResize&&!!w,resizing:s,height:i,side:u},C)),y]}))}),Njr=e=>{const{disableColumnSorting:t}=sr(),{colDef:n,classes:r,isDragging:o,sortDirection:i,showRightBorder:s,showLeftBorder:l,filterItemsCounter:c,pinnedPosition:u,isSiblingFocused:d}=e,p=n.sortable&&!t,h=i!=null,m=c!=null&&c>0,g=n.type==="number",y={root:["columnHeader",n.headerAlign==="left"&&"columnHeader--alignLeft",n.headerAlign==="center"&&"columnHeader--alignCenter",n.headerAlign==="right"&&"columnHeader--alignRight",p&&"columnHeader--sortable",o&&"columnHeader--moving",h&&"columnHeader--sorted",m&&"columnHeader--filtered",g&&"columnHeader--numeric","withBorderColor",s&&"columnHeader--withRightBorder",l&&"columnHeader--withLeftBorder",u===Ni.LEFT&&"columnHeader--pinnedLeft",u===Ni.RIGHT&&"columnHeader--pinnedRight",d&&"columnHeader--siblingFocused"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Un(y,ii,r)};function jjr(e){var te,re,ce;const{colDef:t,columnMenuOpen:n,colIndex:r,headerHeight:o,isResizing:i,isLast:s,sortDirection:l,sortIndex:c,filterItemsCounter:u,hasFocus:d,tabIndex:p,disableReorder:h,separatorSide:m,showLeftBorder:g,showRightBorder:y,pinnedPosition:x,pinnedOffset:v}=e,b=Th(),w=sr(),S=$d(),C=f.useRef(null),N=Jo(),j=Jo(),I=f.useRef(null),[_,T]=f.useState(n),P=!w.disableColumnReorder&&!h&&!t.disableReorder;let E;t.renderHeader&&(E=t.renderHeader(b.current.getColumnHeaderParams(t.field)));const M=Se({},e,{classes:w.classes,showRightBorder:y,showLeftBorder:g}),R=Njr(M),$=f.useCallback(ae=>oe=>{z6(oe)||b.current.publishEvent(ae,b.current.getColumnHeaderParams(t.field),oe)},[b,t.field]),D=f.useMemo(()=>({onClick:$("columnHeaderClick"),onContextMenu:$("columnHeaderContextMenu"),onDoubleClick:$("columnHeaderDoubleClick"),onMouseOver:$("columnHeaderOver"),onMouseOut:$("columnHeaderOut"),onMouseEnter:$("columnHeaderEnter"),onMouseLeave:$("columnHeaderLeave"),onKeyDown:$("columnHeaderKeyDown"),onFocus:$("columnHeaderFocus"),onBlur:$("columnHeaderBlur")}),[$]),z=f.useMemo(()=>P?{onDragStart:$("columnHeaderDragStart"),onDragEnter:$("columnHeaderDragEnter"),onDragOver:$("columnHeaderDragOver"),onDragEndCapture:$("columnHeaderDragEnd")}:{},[P,$]),V=f.useMemo(()=>({onMouseDown:$("columnSeparatorMouseDown"),onDoubleClick:$("columnSeparatorDoubleClick")}),[$]);f.useEffect(()=>{!_&&n&&T(n)},[_,n]);const B=f.useCallback(()=>{T(!1)},[]),G=!w.disableColumnMenu&&!t.disableColumnMenu&&a.jsx(XNr,{colDef:t,columnMenuId:N,columnMenuButtonId:j,open:_,iconButtonRef:I}),H=a.jsx(QNr,{columnMenuId:N,columnMenuButtonId:j,field:t.field,open:n,target:I.current,ContentComponent:w.slots.columnMenu,contentComponentProps:(te=w.slotProps)==null?void 0:te.columnMenu,onExited:B}),F=t.sortingOrder??w.sortingOrder,W=(t.sortable||l!=null)&&!t.hideSortIcons&&!w.disableColumnSorting,U=a.jsxs(f.Fragment,{children:[!w.disableColumnFilter&&a.jsx(w.slots.columnHeaderFilterIconButton,Se({field:t.field,counter:u},(re=w.slotProps)==null?void 0:re.columnHeaderFilterIconButton)),W&&a.jsx(w.slots.columnHeaderSortIcon,Se({field:t.field,direction:l,index:c,sortingOrder:F,disabled:!t.sortable},(ce=w.slotProps)==null?void 0:ce.columnHeaderSortIcon))]});f.useLayoutEffect(()=>{const ae=b.current.state.columnMenu;if(d&&!ae.open){const ue=C.current.querySelector('[tabindex="0"]')||C.current;if(!ue)return;if(tX())ue.focus({preventScroll:!0});else{const fe=b.current.getScrollPosition();ue.focus(),b.current.scroll(fe)}}},[b,d]);const K=typeof t.headerClassName=="function"?t.headerClassName({field:t.field,colDef:t}):t.headerClassName,X=t.headerName??t.field,J=f.useMemo(()=>nX(Se({},e.style),S,x,v),[x,v,e.style,S]);return a.jsx(Uyt,Se({ref:C,classes:R,columnMenuOpen:n,colIndex:r,height:o,isResizing:i,sortDirection:l,hasFocus:d,tabIndex:p,separatorSide:m,isDraggable:P,headerComponent:E,description:t.description,elementId:t.field,width:t.computedWidth,columnMenuIconButton:G,columnTitleIconButtons:U,headerClassName:be(K,s&&Be["columnHeader--last"]),label:X,resizable:!w.disableColumnResize&&!!t.resizable,"data-field":t.field,columnMenu:H,draggableContainerProps:z,columnHeaderSeparatorProps:V,style:J},D))}const Ejr=rS(jjr),Ijr=["className"],_jr=e=>{const{classes:t}=e;return Un({root:["iconButtonContainer"]},ii,t)},Pjr=Ai("div",{name:"MuiDataGrid",slot:"IconButtonContainer"})(()=>({display:"flex",visibility:"hidden",width:0})),Wyt=Kr(function(t,n){const{className:r}=t,o=Zn(t,Ijr),i=sr(),s=_jr(i);return a.jsx(Pjr,Se({className:be(s.root,r),ownerState:i},o,{ref:n}))}),Ajr=["direction","index","sortingOrder","disabled","className"],Tjr=e=>{const{classes:t}=e;return Un({root:["sortButton"],icon:["sortIcon"]},ii,t)},kjr=Ai(Ob,{name:"MuiDataGrid",slot:"SortButton"})({transition:fr.transition(["opacity"],{duration:fr.transitions.duration.short,easing:fr.transitions.easing.easeInOut})});function Mjr(e,t,n,r){let o;const i={};return t==="asc"?o=e.columnSortedAscendingIcon:t==="desc"?o=e.columnSortedDescendingIcon:(o=e.columnUnsortedIcon,i.sortingOrder=r),o?a.jsx(o,Se({fontSize:"small",className:n},i)):null}function Rjr(e){var m,g;const{direction:t,index:n,sortingOrder:r,disabled:o,className:i}=e,s=Zn(e,Ajr),l=Eo(),c=sr(),u=Se({},e,{classes:c.classes}),d=Tjr(u),p=Mjr(c.slots,t,d.icon,r);if(!p)return null;const h=a.jsx(kjr,Se({as:c.slots.baseIconButton,ownerState:u,"aria-label":l.current.getLocaleText("columnHeaderSortIconLabel"),size:"small",disabled:o,className:be(d.root,i)},(m=c.slotProps)==null?void 0:m.baseIconButton,s,{children:p}));return a.jsx(c.slots.baseTooltip,Se({title:l.current.getLocaleText("columnHeaderSortIconLabel"),enterDelay:1e3},(g=c.slotProps)==null?void 0:g.baseTooltip,{children:a.jsxs("span",{children:[n!=null&&a.jsx(c.slots.baseBadge,{badgeContent:n,color:"default",overlap:"circular",children:h}),n==null&&h]})}))}function Ojr(e){return a.jsx(Wyt,{children:a.jsx(Rjr,Se({},e,{tabIndex:-1}))})}const $jr=f.memo(Ojr),Djr=e=>{const{classes:t}=e;return Un({icon:["filterIcon"]},ii,t)};function Ljr(e){return e.counter?a.jsx(Fjr,Se({},e)):null}function Fjr(e){var m,g;const{counter:t,field:n,onClick:r}=e,o=Eo(),i=sr(),s=Se({},e,{classes:i.classes}),l=Djr(s),c=Jo(),u=Fn(o,V2r,c),d=Jo(),p=f.useCallback(y=>{y.preventDefault(),y.stopPropagation();const{open:x,openedPanelValue:v}=Pw(o);x&&v===Td.filters?o.current.hideFilterPanel():o.current.showFilterPanel(void 0,d,c),r&&r(o.current.getColumnHeaderParams(n),y)},[o,n,r,d,c]);if(!t)return null;const h=a.jsx(i.slots.baseIconButton,Se({id:c,onClick:p,"aria-label":o.current.getLocaleText("columnHeaderFiltersLabel"),size:"small",tabIndex:-1,"aria-haspopup":"menu","aria-expanded":u,"aria-controls":u?d:void 0},(m=i.slotProps)==null?void 0:m.baseIconButton,{children:a.jsx(i.slots.columnFilteredIcon,{className:l.icon,fontSize:"small"})}));return a.jsx(i.slots.baseTooltip,Se({title:o.current.getLocaleText("columnHeaderFiltersTooltipActive")(t),enterDelay:1e3},(g=i.slotProps)==null?void 0:g.baseTooltip,{children:a.jsxs(Wyt,{children:[t>1&&a.jsx(i.slots.baseBadge,{badgeContent:t,color:"default",children:h}),t===1&&h]})}))}const zjr=["hideMenu","colDef","id","labelledby","className","children","open"],Bjr=Bt(Ob,{slot:"internal"})(()=>({minWidth:248}));function T7e(e){e.currentTarget.contains(e.target)&&e.stopPropagation()}const Hjr=Kr(function(t,n){const{hideMenu:r,id:o,labelledby:i,className:s,children:l,open:c}=t,u=Zn(t,zjr),d=sr(),p=f.useCallback(h=>{h.key==="Tab"&&h.preventDefault(),Xxt(h.key)&&r(h)},[r]);return a.jsx(Bjr,Se({as:d.slots.baseMenuList,id:o,className:be(Be.menuList,s),"aria-labelledby":i,onKeyDown:p,onWheel:T7e,onTouchMove:T7e,autoFocus:c},u,{ref:n,children:l}))}),Vjr=["displayOrder"],Ujr=e=>{const t=Th(),n=sr(),{defaultSlots:r,defaultSlotProps:o,slots:i={},slotProps:s={},hideMenu:l,colDef:c,addDividers:u=!0}=e,d=f.useMemo(()=>Se({},r,i),[r,i]),p=f.useMemo(()=>{if(!s||Object.keys(s).length===0)return o;const g=Se({},s);return Object.entries(o).forEach(([y,x])=>{g[y]=Se({},x,s[y]||{})}),g},[o,s]),h=t.current.unstable_applyPipeProcessors("columnMenu",[],e.colDef),m=f.useMemo(()=>{const g=Object.keys(r);return Object.keys(i).filter(y=>!g.includes(y))},[i,r]);return f.useMemo(()=>{const x=Array.from(new Set([...h,...m])).filter(v=>d[v]!=null).sort((v,b)=>{const w=p[v],S=p[b],C=Number.isFinite(w==null?void 0:w.displayOrder)?w.displayOrder:100,N=Number.isFinite(S==null?void 0:S.displayOrder)?S.displayOrder:100;return C-N});return x.reduce((v,b,w)=>{let S={colDef:c,onClick:l};const C=p[b];if(C){const N=Zn(C,Vjr);S=Se({},S,N)}return u&&w!==x.length-1?[...v,[d[b],S],[n.slots.baseDivider,{}]]:[...v,[d[b],S]]},[])},[u,c,h,l,d,p,m,n.slots.baseDivider])};function Wjr(e){const{colDef:t,onClick:n}=e,r=Eo(),o=sr(),l=yc(r).filter(u=>u.disableColumnMenu!==!0).length===1,c=f.useCallback(u=>{l||(r.current.setColumnVisibility(t.field,!1),n(u))},[r,t.field,n,l]);return o.disableColumnSelector||t.hideable===!1?null:a.jsx(o.slots.baseMenuItem,{onClick:c,disabled:l,iconStart:a.jsx(o.slots.columnMenuHideIcon,{fontSize:"small"}),children:r.current.getLocaleText("columnMenuHideColumn")})}function Gjr(e){const{onClick:t}=e,n=Eo(),r=sr(),o=f.useCallback(i=>{t(i),n.current.showPreferences(Td.columns)},[n,t]);return r.disableColumnSelector?null:a.jsx(r.slots.baseMenuItem,{onClick:o,iconStart:a.jsx(r.slots.columnMenuManageColumnsIcon,{fontSize:"small"}),children:n.current.getLocaleText("columnMenuManageColumns")})}function qjr(e){return a.jsxs(f.Fragment,{children:[a.jsx(Wjr,Se({},e)),a.jsx(Gjr,Se({},e))]})}function Kjr(e){const{colDef:t,onClick:n}=e,r=Eo(),o=sr(),i=f.useCallback(s=>{n(s),r.current.showFilterPanel(t.field)},[r,t.field,n]);return o.disableColumnFilter||!t.filterable?null:a.jsx(o.slots.baseMenuItem,{onClick:i,iconStart:a.jsx(o.slots.columnMenuFilterIcon,{fontSize:"small"}),children:r.current.getLocaleText("columnMenuFilter")})}function Yjr(e){const{colDef:t,onClick:n}=e,r=Eo(),o=Fn(r,Xg),i=sr(),s=f.useMemo(()=>{if(!t)return null;const d=o.find(p=>p.field===t.field);return d==null?void 0:d.sort},[t,o]),l=t.sortingOrder??i.sortingOrder,c=f.useCallback(d=>{n(d);const p=d.currentTarget.getAttribute("data-value")||null,h=i.multipleColumnsSortingMode==="always";r.current.sortColumn(t.field,p===s?null:p,h)},[r,t,n,s,i.multipleColumnsSortingMode]);if(i.disableColumnSorting||!t||!t.sortable||!l.some(d=>!!d))return null;const u=d=>{const p=r.current.getLocaleText(d);return typeof p=="function"?p(t):p};return a.jsxs(f.Fragment,{children:[l.includes("asc")&&s!=="asc"?a.jsx(i.slots.baseMenuItem,{onClick:c,"data-value":"asc",iconStart:a.jsx(i.slots.columnMenuSortAscendingIcon,{fontSize:"small"}),children:u("columnMenuSortAsc")}):null,l.includes("desc")&&s!=="desc"?a.jsx(i.slots.baseMenuItem,{onClick:c,"data-value":"desc",iconStart:a.jsx(i.slots.columnMenuSortDescendingIcon,{fontSize:"small"}),children:u("columnMenuSortDesc")}):null,l.includes(null)&&s!=null?a.jsx(i.slots.baseMenuItem,{onClick:c,iconStart:i.slots.columnMenuUnsortIcon?a.jsx(i.slots.columnMenuUnsortIcon,{fontSize:"small"}):a.jsx("span",{}),children:r.current.getLocaleText("columnMenuUnsort")}):null]})}const Xjr=["defaultSlots","defaultSlotProps","slots","slotProps"],Qjr={columnMenuSortItem:Yjr,columnMenuFilterItem:Kjr,columnMenuColumnsItem:qjr},Jjr={columnMenuSortItem:{displayOrder:10},columnMenuFilterItem:{displayOrder:20},columnMenuColumnsItem:{displayOrder:30}},Zjr=Kr(function(t,n){const{defaultSlots:r,defaultSlotProps:o,slots:i,slotProps:s}=t,l=Zn(t,Xjr),c=Ujr(Se({},l,{defaultSlots:r,defaultSlotProps:o,slots:i,slotProps:s}));return a.jsx(Hjr,Se({},l,{ref:n,children:c.map(([u,d],p)=>a.jsx(u,Se({},d),p))}))}),eEr=Kr(function(t,n){return a.jsx(Zjr,Se({},t,{ref:n,defaultSlots:Qjr,defaultSlotProps:Jjr}))}),tEr=["className"],nEr=e=>{const{classes:t}=e;return Un({root:["panelWrapper"]},ii,t)},rEr=Bt("div",{name:"MuiDataGrid",slot:"PanelWrapper"})({display:"flex",flexDirection:"column",flex:1,"&:focus":{outline:0}}),Gyt=Kr(function(t,n){const{className:r}=t,o=Zn(t,tEr),i=sr(),s=nEr(i);return a.jsx(rEr,Se({tabIndex:-1,className:be(s.root,r),ownerState:i},o,{ref:n}))});function oEr(e){var n;const t=sr();return a.jsx(Gyt,Se({},e,{children:a.jsx(t.slots.columnsManagement,Se({},(n=t.slotProps)==null?void 0:n.columnsManagement))}))}const iEr=["children","className","classes","onClose"],aEr=Pr("MuiDataGrid",["panel","paper"]),sEr=Bt(Ob,{name:"MuiDataGrid",slot:"panel"})({zIndex:fr.zIndex.panel}),lEr=Bt("div",{name:"MuiDataGrid",slot:"panelContent"})({backgroundColor:fr.colors.background.overlay,borderRadius:fr.radius.base,boxShadow:fr.shadows.overlay,display:"flex",maxWidth:`calc(100vw - ${fr.spacing(2)})`,overflow:"auto"}),cEr=Kr((e,t)=>{var b;const{children:n,className:r,onClose:o}=e,i=Zn(e,iEr),s=Eo(),l=sr(),c=aEr,[u,d]=f.useState(!1),p=Jxt(),h=no(()=>d(!0)),m=no(()=>d(!1)),g=no(()=>{o==null||o()}),y=no(w=>{w.key==="Escape"&&(o==null||o())}),[x,v]=f.useState(null);return f.useEffect(()=>{var S,C;const w=(C=(S=s.current.rootElementRef)==null?void 0:S.current)==null?void 0:C.querySelector('[data-id="gridPanelAnchor"]');w&&v(w)},[s]),x?a.jsx(sEr,Se({as:l.slots.basePopper,ownerState:l,placement:"bottom-end",className:be(c.panel,r,p),flip:!0,onDidShow:h,onDidHide:m,onClickAway:g,clickAwayMouseEvent:"onPointerUp",clickAwayTouchEvent:!1,focusTrap:!0},i,(b=l.slotProps)==null?void 0:b.basePopper,{target:e.target??x,ref:t,children:a.jsx(lEr,{className:c.paper,ownerState:l,onKeyDown:y,children:u&&n})})):null}),uEr=["className"],dEr=e=>{const{classes:t}=e;return Un({root:["panelContent"]},ii,t)},fEr=Ai("div",{name:"MuiDataGrid",slot:"PanelContent"})({display:"flex",flexDirection:"column",overflow:"auto",flex:"1 1",maxHeight:400,padding:fr.spacing(2.5,1.5,2,1),gap:fr.spacing(2.5)});function pEr(e){const{className:t}=e,n=Zn(e,uEr),r=sr(),o=dEr(r);return a.jsx(fEr,Se({className:be(o.root,t),ownerState:r},n))}const hEr=["className"],mEr=e=>{const{classes:t}=e;return Un({root:["panelFooter"]},ii,t)},gEr=Bt("div",{name:"MuiDataGrid",slot:"PanelFooter"})({padding:fr.spacing(1),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${fr.colors.border.base}`});function xEr(e){const{className:t}=e,n=Zn(e,hEr),r=sr(),o=mEr(r);return a.jsx(gEr,Se({className:be(o.root,t),ownerState:r},n))}const yEr=["item","hasMultipleFilters","deleteFilter","applyFilterChanges","showMultiFilterOperators","disableMultiFilterOperator","applyMultiFilterOperatorChanges","focusElementRef","logicOperators","columnsSort","filterColumns","deleteIconProps","logicOperatorInputProps","operatorInputProps","columnInputProps","valueInputProps","readOnly","children"],vEr=["InputComponentProps"],bEr=e=>{const{classes:t}=e;return Un({root:["filterForm"],deleteIcon:["filterFormDeleteIcon"],logicOperatorInput:["filterFormLogicOperatorInput"],columnInput:["filterFormColumnInput"],operatorInput:["filterFormOperatorInput"],valueInput:["filterFormValueInput"]},ii,t)},wEr=Bt("div",{name:"MuiDataGrid",slot:"FilterForm"})({display:"flex",gap:fr.spacing(1.5)}),SEr=Bt("div",{name:"MuiDataGrid",slot:"FilterFormDeleteIcon"})({flexShrink:0,display:"flex",justifyContent:"center",alignItems:"center"}),CEr=Bt("div",{name:"MuiDataGrid",slot:"FilterFormLogicOperatorInput"})({minWidth:75,justifyContent:"end"}),NEr=Bt("div",{name:"MuiDataGrid",slot:"FilterFormColumnInput"})({width:150}),jEr=Bt("div",{name:"MuiDataGrid",slot:"FilterFormOperatorInput"})({width:150}),EEr=Bt("div",{name:"MuiDataGrid",slot:"FilterFormValueInput"})({width:190}),IEr=e=>{switch(e){case fh.And:return"filterPanelOperatorAnd";case fh.Or:return"filterPanelOperatorOr";default:throw new Error("MUI X: Invalid `logicOperator` property in the `GridFilterPanel`.")}},HM=e=>e.headerName||e.field,k7e=new Intl.Collator,M7e=Kr(function(t,n){var se,ge,ye,de,Ne,_e,xe;const{item:r,hasMultipleFilters:o,deleteFilter:i,applyFilterChanges:s,showMultiFilterOperators:l,disableMultiFilterOperator:c,applyMultiFilterOperatorChanges:u,focusElementRef:d,logicOperators:p=[fh.And,fh.Or],columnsSort:h,filterColumns:m,deleteIconProps:g={},logicOperatorInputProps:y={},operatorInputProps:x={},columnInputProps:v={},valueInputProps:b={},readOnly:w}=t,S=Zn(t,yEr),C=Eo(),N=Fn(C,$b),j=Fn(C,Gxt),I=Fn(C,Sd),_=Jo(),T=Jo(),P=Jo(),E=Jo(),M=sr(),R=bEr(M),$=f.useRef(null),D=f.useRef(null),z=I.logicOperator??fh.And,V=o&&p.length>0,G=(((se=M.slotProps)==null?void 0:se.baseSelect)||{}).native??!1,H=((ge=M.slotProps)==null?void 0:ge.baseSelectOption)||{},{InputComponentProps:F}=b,W=Zn(b,vEr),U=Fn(C,$I),K=Fn(C,nwe),{filteredColumns:X,selectedField:J}=f.useMemo(()=>{let we=r.field;const Te=N[r.field].filterable===!1?N[r.field]:null;if(Te)return{filteredColumns:[Te],selectedField:we};if(U)return{filteredColumns:j.filter(Ue=>K.get(Ue.field)!==void 0),selectedField:we};if(m===void 0||typeof m!="function")return{filteredColumns:j,selectedField:we};const Re=m({field:r.field,columns:j,currentFilters:(I==null?void 0:I.items)||[]});return{filteredColumns:j.filter(Ue=>{const He=Re.includes(Ue.field);return Ue.field===r.field&&!He&&(we=void 0),He}),selectedField:we}},[r.field,N,U,m,j,I==null?void 0:I.items,K]),te=f.useMemo(()=>{switch(h){case"asc":return X.sort((we,Te)=>k7e.compare(HM(we),HM(Te)));case"desc":return X.sort((we,Te)=>-k7e.compare(HM(we),HM(Te)));default:return X}},[X,h]),re=r.field?C.current.getColumn(r.field):null,ce=f.useMemo(()=>{var we;return!r.operator||!re?null:(we=re.filterOperators)==null?void 0:we.find(Te=>Te.value===r.operator)},[r,re]),ae=f.useCallback(we=>{const Te=we.target.value,Re=C.current.getColumn(Te);if(Re.field===re.field)return;const Ue=Re.filterOperators.find(We=>We.value===r.operator)||Re.filterOperators[0];let Ye=!Ue.InputComponent||Ue.InputComponent!==(ce==null?void 0:ce.InputComponent)||Re.type!==re.type?void 0:r.value;if(Re.type==="singleSelect"&&Ye!==void 0){const We=Re,at=OI(We);Array.isArray(Ye)?Ye=Ye.filter(Oe=>TW(Oe,at,We==null?void 0:We.getOptionValue)!==void 0):TW(r.value,at,We==null?void 0:We.getOptionValue)===void 0&&(Ye=void 0)}s(Se({},r,{field:Te,operator:Ue.value,value:Ye}))},[C,s,r,re,ce]),oe=f.useCallback(we=>{const Te=we.target.value,Re=re==null?void 0:re.filterOperators.find(He=>He.value===Te),Ue=!(Re!=null&&Re.InputComponent)||(Re==null?void 0:Re.InputComponent)!==(ce==null?void 0:ce.InputComponent);s(Se({},r,{operator:Te,value:Ue?void 0:r.value}))},[s,r,re,ce]),ue=f.useCallback(we=>{const Te=we.target.value===fh.And.toString()?fh.And:fh.Or;u(Te)},[u]),fe=()=>{i(r)};return f.useImperativeHandle(d,()=>({focus:()=>{var we;ce!=null&&ce.InputComponent?(we=$==null?void 0:$.current)==null||we.focus():D.current.focus()}}),[ce]),a.jsxs(wEr,Se({className:R.root,"data-id":r.id,ownerState:M},S,{ref:n,children:[a.jsx(SEr,Se({},g,{className:be(R.deleteIcon,g.className),ownerState:M,children:a.jsx(M.slots.baseIconButton,Se({"aria-label":C.current.getLocaleText("filterPanelDeleteIconLabel"),title:C.current.getLocaleText("filterPanelDeleteIconLabel"),onClick:fe,size:"small",disabled:w},(ye=M.slotProps)==null?void 0:ye.baseIconButton,{children:a.jsx(M.slots.filterPanelDeleteIcon,{fontSize:"small"})}))})),a.jsx(CEr,Se({as:M.slots.baseSelect,sx:[V?{display:"flex"}:{display:"none"},l?{visibility:"visible"}:{visibility:"hidden"},y.sx],className:be(R.logicOperatorInput,y.className),ownerState:M},y,{size:"small",slotProps:{htmlInput:{"aria-label":C.current.getLocaleText("filterPanelLogicOperator")}},value:z??"",onChange:ue,disabled:!!c||p.length===1,native:G},(de=M.slotProps)==null?void 0:de.baseSelect,{children:p.map(we=>f.createElement(M.slots.baseSelectOption,Se({},H,{native:G,key:we.toString(),value:we.toString()}),C.current.getLocaleText(IEr(we))))})),a.jsx(NEr,Se({as:M.slots.baseSelect},v,{className:be(R.columnInput,v.className),ownerState:M,size:"small",labelId:T,id:_,label:C.current.getLocaleText("filterPanelColumns"),value:J??"",onChange:ae,native:G,disabled:w},(Ne=M.slotProps)==null?void 0:Ne.baseSelect,{children:te.map(we=>f.createElement(M.slots.baseSelectOption,Se({},H,{native:G,key:we.field,value:we.field}),HM(we)))})),a.jsx(jEr,Se({as:M.slots.baseSelect,size:"small"},x,{className:be(R.operatorInput,x.className),ownerState:M,labelId:E,label:C.current.getLocaleText("filterPanelOperator"),id:P,value:r.operator,onChange:oe,native:G,inputRef:D,disabled:w},(_e=M.slotProps)==null?void 0:_e.baseSelect,{children:(xe=re==null?void 0:re.filterOperators)==null?void 0:xe.map(we=>f.createElement(M.slots.baseSelectOption,Se({},H,{native:G,key:we.value,value:we.value}),we.label||C.current.getLocaleText(`filterOperator${vn(we.value)}`)))})),a.jsx(EEr,Se({},W,{className:be(R.valueInput,W.className),ownerState:M,children:ce!=null&&ce.InputComponent?a.jsx(ce.InputComponent,Se({apiRef:C,item:r,applyValue:s,focusElementRef:$,disabled:w,slotProps:{root:{size:"small"}}},ce.InputComponentProps,F),r.field):null}))]}))}),_Er=["logicOperators","columnsSort","filterFormProps","getColumnForNewFilter","children","disableAddFilterButton","disableRemoveAllButton"],R7e=e=>({field:e.field,operator:e.filterOperators[0].value,id:Math.round(Math.random()*1e5)}),PEr=Kr(function(t,n){var E,M;const r=Eo(),o=sr(),i=Fn(r,Sd),s=Fn(r,Gxt),l=Fn(r,fwr),c=f.useRef(null),u=f.useRef(null),{logicOperators:d=[fh.And,fh.Or],columnsSort:p,filterFormProps:h,getColumnForNewFilter:m,disableAddFilterButton:g=!1,disableRemoveAllButton:y=!1}=t,x=Zn(t,_Er),v=r.current.upsertFilterItem,b=f.useCallback(R=>{r.current.setFilterLogicOperator(R)},[r]),w=f.useCallback(()=>{let R;if(m&&typeof m=="function"){const $=m({currentFilters:(i==null?void 0:i.items)||[],columns:s});if($===null)return null;R=s.find(({field:D})=>D===$)}else R=s.find($=>{var D;return(D=$.filterOperators)==null?void 0:D.length});return R?R7e(R):null},[i==null?void 0:i.items,s,m]),S=f.useCallback(()=>{if(m===void 0||typeof m!="function")return w();const R=i.items.length?i.items:[w()].filter(Boolean),$=m({currentFilters:R,columns:s});if($===null)return null;const D=s.find(({field:z})=>z===$);return D?R7e(D):null},[i.items,s,m,w]),C=f.useMemo(()=>i.items.length?i.items:(u.current||(u.current=w()),u.current?[u.current]:[]),[i.items,w]),N=C.length>1,{readOnlyFilters:j,validFilters:I}=f.useMemo(()=>C.reduce((R,$)=>(l[$.field]?R.validFilters.push($):R.readOnlyFilters.push($),R),{readOnlyFilters:[],validFilters:[]}),[C,l]),_=f.useCallback(()=>{const R=S();R&&r.current.upsertFilterItems([...C,R])},[r,S,C]),T=f.useCallback(R=>{const $=I.length===1;r.current.deleteFilterItem(R),$&&r.current.hideFilterPanel()},[r,I.length]),P=f.useCallback(()=>I.length===1&&I[0].value===void 0?(r.current.deleteFilterItem(I[0]),r.current.hideFilterPanel()):r.current.setFilterModel(Se({},i,{items:j}),"removeAllFilterItems"),[r,j,i,I]);return f.useEffect(()=>{d.length>0&&i.logicOperator&&!d.includes(i.logicOperator)&&b(d[0])},[d,b,i.logicOperator]),f.useEffect(()=>{I.length>0&&c.current.focus()},[I.length]),a.jsxs(Gyt,Se({},x,{ref:n,children:[a.jsxs(pEr,{children:[j.map((R,$)=>a.jsx(M7e,Se({item:R,applyFilterChanges:v,deleteFilter:T,hasMultipleFilters:N,showMultiFilterOperators:$>0,disableMultiFilterOperator:$!==1,applyMultiFilterOperatorChanges:b,focusElementRef:null,readOnly:!0,logicOperators:d,columnsSort:p},h),R.id==null?$:R.id)),I.map((R,$)=>a.jsx(M7e,Se({item:R,applyFilterChanges:v,deleteFilter:T,hasMultipleFilters:N,showMultiFilterOperators:j.length+$>0,disableMultiFilterOperator:j.length+$!==1,applyMultiFilterOperatorChanges:b,focusElementRef:$===I.length-1?c:null,logicOperators:d,columnsSort:p},h),R.id==null?$+j.length:R.id))]}),!o.disableMultipleColumnsFiltering&&!(g&&y)?a.jsxs(xEr,{children:[g?a.jsx("span",{}):a.jsx(o.slots.baseButton,Se({onClick:_,startIcon:a.jsx(o.slots.filterPanelAddIcon,{})},(E=o.slotProps)==null?void 0:E.baseButton,{children:r.current.getLocaleText("filterPanelAddFilter")})),!y&&I.length>0?a.jsx(o.slots.baseButton,Se({onClick:P,startIcon:a.jsx(o.slots.filterPanelRemoveAllIcon,{})},(M=o.slotProps)==null?void 0:M.baseButton,{children:r.current.getLocaleText("filterPanelRemoveAll")})):null]}):null]}))}),AEr=(e,t)=>{const n=new Set(Object.keys(e).filter(i=>e[i]===!1)),r=new Set(Object.keys(t).filter(i=>t[i]===!1));if(n.size!==r.size)return!1;let o=!0;return n.forEach(i=>{r.has(i)||(o=!1)}),o},TEr=(e,t)=>(e.headerName||e.field).toLowerCase().indexOf(t)>-1,kEr=["children"],MEr=gf({from:{opacity:0},to:{opacity:1}}),REr=gf({"from, to":{"--scrollable":'" "'}}),OEr=Ai("div",{name:"MuiDataGrid",slot:"ShadowScrollArea"})` flex: 1; display: flex; flex-direction: column; animation: ${REr}; animation-timeline: --scroll-timeline; animation-fill-mode: none; box-sizing: border-box; overflow: auto; scrollbar-width: thin; scroll-timeline: --scroll-timeline block; &::before, &::after { content: ''; flex-shrink: 0; display: block; position: sticky; left: 0; width: 100%; height: 4px; animation: ${MEr} linear both; animation-timeline: --scroll-timeline; // Custom property toggle trick: // - Detects if the element is scrollable // - https://css-tricks.com/the-css-custom-property-toggle-trick/ --visibility-scrollable: var(--scrollable) visible; --visibility-not-scrollable: hidden; visibility: var(--visibility-scrollable, var(--visibility-not-scrollable)); } &::before { top: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 0, transparent 100%); animation-range: 0 4px; } &::after { bottom: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.05) 0, transparent 100%); animation-direction: reverse; animation-range: calc(100% - 4px) 100%; } `,$Er=Kr(function(t,n){const{children:r}=t,o=Zn(t,kEr);return a.jsx(OEr,Se({},o,{ref:n,children:r}))}),DEr=e=>{const{classes:t}=e;return Un({root:["columnsManagement"],header:["columnsManagementHeader"],searchInput:["columnsManagementSearchInput"],footer:["columnsManagementFooter"],row:["columnsManagementRow"]},ii,t)},O7e=new Intl.Collator;function LEr(e){var G,H,F,W;const t=Eo(),n=f.useRef(null),r=Fn(t,dwr),o=Fn(t,x0),i=sr(),[s,l]=f.useState(""),c=DEr(i),u=Fn(t,cg),d=Fn(t,$I),p=Fn(t,nwe),h=f.useMemo(()=>d?Array.from(p.values()):u,[d,p,u]),{sort:m,searchPredicate:g=TEr,autoFocusSearchField:y=!0,disableShowHideToggle:x=!1,disableResetButton:v=!1,toggleAllMode:b="all",getTogglableColumns:w,searchInputProps:S,searchDebounceMs:C=i.columnFilterDebounceMs}=e,N=f.useMemo(()=>py(U=>{l(U)},C??150),[C]),j=f.useMemo(()=>AEr(o,r),[o,r]),I=f.useMemo(()=>{switch(m){case"asc":return[...h].sort((U,K)=>O7e.compare(U.headerName||U.field,K.headerName||K.field));case"desc":return[...h].sort((U,K)=>-O7e.compare(U.headerName||U.field,K.headerName||K.field));default:return h}},[h,m]),_=U=>{const{name:K}=U.target;t.current.setColumnVisibility(K,o[K]===!1)},T=f.useMemo(()=>{const U=w?w(I):null,K=U?I.filter(({field:X})=>U.includes(X)):I;return s?K.filter(X=>g(X,s.toLowerCase())):K},[I,s,g,w]),P=f.useCallback(U=>{const K=x0(t),X=Se({},K),J=w?w(h):null;return(b==="filteredOnly"?T:h).forEach(te=>{te.hideable&&(J==null||J.includes(te.field))&&(U?delete X[te.field]:X[te.field]=!1)}),t.current.setColumnVisibilityModel(X)},[t,h,w,b,T]),E=f.useCallback(U=>{N(U.target.value)},[N]),M=f.useMemo(()=>T.filter(U=>U.hideable),[T]),R=f.useMemo(()=>M.every(U=>o[U.field]==null||o[U.field]!==!1),[o,M]),$=f.useMemo(()=>M.every(U=>o[U.field]===!1),[o,M]),D=f.useRef(null);f.useEffect(()=>{var U;y?(U=n.current)==null||U.focus():D.current&&typeof D.current.focus=="function"&&D.current.focus()},[y]);let z=!1;const V=U=>z===!1&&U.hideable!==!1?(z=!0,!0):!1,B=f.useCallback(()=>{l(""),n.current&&(n.current.value="",n.current.focus())},[]);return a.jsxs(f.Fragment,{children:[a.jsx(BEr,{className:c.header,ownerState:i,children:a.jsx(HEr,Se({as:i.slots.baseTextField,ownerState:i,placeholder:t.current.getLocaleText("columnsManagementSearchTitle"),inputRef:n,className:c.searchInput,onChange:E,size:"small",type:"search",slotProps:{input:{startAdornment:a.jsx(i.slots.quickFilterIcon,{fontSize:"small"}),endAdornment:a.jsx(i.slots.baseIconButton,Se({size:"small","aria-label":t.current.getLocaleText("columnsManagementDeleteIconLabel"),style:s?{visibility:"visible"}:{visibility:"hidden"},tabIndex:-1,onClick:B,edge:"end"},(G=i.slotProps)==null?void 0:G.baseIconButton,{children:a.jsx(i.slots.quickFilterClearIcon,{fontSize:"small"})}))},htmlInput:{"aria-label":t.current.getLocaleText("columnsManagementSearchTitle")}},autoComplete:"off",fullWidth:!0},(H=i.slotProps)==null?void 0:H.baseTextField,S))}),a.jsx(zEr,{ownerState:i,children:a.jsxs(FEr,{className:c.root,ownerState:i,children:[T.map(U=>{var K;return a.jsx(WEr,Se({as:i.slots.baseCheckbox,className:c.row,disabled:U.hideable===!1||d,checked:o[U.field]!==!1,onChange:_,name:U.field,inputRef:V(U)?D:void 0,label:U.headerName||U.field,density:"compact",fullWidth:!0},(K=i.slotProps)==null?void 0:K.baseCheckbox),U.field)}),T.length===0&&a.jsx(UEr,{ownerState:i,children:t.current.getLocaleText("columnsManagementNoColumns")})]})}),!x||!v?a.jsxs(VEr,{ownerState:i,className:c.footer,children:[x?a.jsx("span",{}):a.jsx(i.slots.baseCheckbox,Se({disabled:M.length===0||d,checked:R,indeterminate:!R&&!$,onChange:()=>P(!R),name:t.current.getLocaleText("columnsManagementShowHideAllText"),label:t.current.getLocaleText("columnsManagementShowHideAllText"),density:"compact"},(F=i.slotProps)==null?void 0:F.baseCheckbox)),v?null:a.jsx(i.slots.baseButton,Se({onClick:()=>t.current.setColumnVisibilityModel(r),disabled:j||d},(W=i.slotProps)==null?void 0:W.baseButton,{children:t.current.getLocaleText("columnsManagementReset")}))]}):null]})}const FEr=Bt("div",{name:"MuiDataGrid",slot:"ColumnsManagement"})({display:"flex",flexDirection:"column",padding:fr.spacing(.5,1.5)}),zEr=Bt($Er,{name:"MuiDataGrid",slot:"ColumnsManagementScrollArea"})({maxHeight:300}),BEr=Bt("div",{name:"MuiDataGrid",slot:"ColumnsManagementHeader"})({padding:fr.spacing(1.5,2),borderBottom:`1px solid ${fr.colors.border.base}`}),HEr=Bt(Ob,{name:"MuiDataGrid",slot:"ColumnsManagementSearchInput"})({[`& .${$f.input}::-webkit-search-decoration, & .${$f.input}::-webkit-search-cancel-button, & .${$f.input}::-webkit-search-results-button, & .${$f.input}::-webkit-search-results-decoration`]:{display:"none"}}),VEr=Bt("div",{name:"MuiDataGrid",slot:"ColumnsManagementFooter"})({padding:fr.spacing(1,1,1,1.5),display:"flex",justifyContent:"space-between",borderTop:`1px solid ${fr.colors.border.base}`}),UEr=Bt("div",{name:"MuiDataGrid",slot:"ColumnsManagementEmptyText"})({padding:fr.spacing(1,0),alignSelf:"center",font:fr.typography.font.body}),WEr=Bt(Ob,{name:"MuiDataGrid",slot:"ColumnsManagementRow"})({}),GEr=Kr(function(t,n){var y,x;const{slotProps:r={}}=t,o=r.button||{},i=r.tooltip||{},s=Jo(),l=Jo(),c=Eo(),u=sr(),{columnsPanelTriggerRef:d}=F6(),p=Fn(c,Pw),h=Di(n,d),m=v=>{var b;p.open&&p.openedPanelValue===Td.columns?c.current.hidePreferences():c.current.showPreferences(Td.columns,l,s),(b=o.onClick)==null||b.call(o,v)};if(u.disableColumnSelector)return null;const g=p.open&&p.panelId===l;return a.jsx(u.slots.baseTooltip,Se({title:c.current.getLocaleText("toolbarColumnsLabel"),enterDelay:1e3},(y=u.slotProps)==null?void 0:y.baseTooltip,i,{children:a.jsx(u.slots.baseButton,Se({id:s,size:"small","aria-label":c.current.getLocaleText("toolbarColumnsLabel"),"aria-haspopup":"menu","aria-expanded":g,"aria-controls":g?l:void 0,startIcon:a.jsx(u.slots.columnSelectorIcon,{})},(x=u.slotProps)==null?void 0:x.baseButton,o,{onPointerUp:v=>{var b;p.open&&v.stopPropagation(),(b=o.onPointerUp)==null||b.call(o,v)},onClick:m,ref:h,children:c.current.getLocaleText("toolbarColumns")}))}))}),qEr=Kr(function(t,n){var C,N;const{slotProps:r={}}=t,o=r.button||{},i=r.tooltip||{},s=Eo(),l=sr(),c=Fn(s,fE),u=Jo(),d=Jo(),[p,h]=f.useState(!1),m=f.useRef(null),g=Di(n,m),y=[{icon:a.jsx(l.slots.densityCompactIcon,{}),label:s.current.getLocaleText("toolbarDensityCompact"),value:"compact"},{icon:a.jsx(l.slots.densityStandardIcon,{}),label:s.current.getLocaleText("toolbarDensityStandard"),value:"standard"},{icon:a.jsx(l.slots.densityComfortableIcon,{}),label:s.current.getLocaleText("toolbarDensityComfortable"),value:"comfortable"}],x=f.useMemo(()=>{switch(c){case"compact":return a.jsx(l.slots.densityCompactIcon,{});case"comfortable":return a.jsx(l.slots.densityComfortableIcon,{});default:return a.jsx(l.slots.densityStandardIcon,{})}},[c,l]),v=j=>{var I;h(_=>!_),(I=o.onClick)==null||I.call(o,j)},b=()=>{h(!1)},w=j=>{s.current.setDensity(j),h(!1)};if(l.disableDensitySelector)return null;const S=y.map((j,I)=>a.jsx(l.slots.baseMenuItem,{onClick:()=>w(j.value),selected:j.value===c,iconStart:j.icon,children:j.label},I));return a.jsxs(f.Fragment,{children:[a.jsx(l.slots.baseTooltip,Se({title:s.current.getLocaleText("toolbarDensityLabel"),enterDelay:1e3},(C=l.slotProps)==null?void 0:C.baseTooltip,i,{children:a.jsx(l.slots.baseButton,Se({size:"small",startIcon:x,"aria-label":s.current.getLocaleText("toolbarDensityLabel"),"aria-haspopup":"menu","aria-expanded":p,"aria-controls":p?d:void 0,id:u},(N=l.slotProps)==null?void 0:N.baseButton,o,{onClick:v,ref:g,children:s.current.getLocaleText("toolbarDensity")}))})),a.jsx(R6,{open:p,target:m.current,onClose:b,position:"bottom-end",children:a.jsx(l.slots.baseMenuList,{id:d,className:Be.menuList,"aria-labelledby":u,autoFocusItem:p,children:S})})]})}),KEr=e=>{const{classes:t}=e;return Un({root:["toolbarFilterList"]},ii,t)},YEr=Bt("ul",{name:"MuiDataGrid",slot:"ToolbarFilterList"})({margin:fr.spacing(1,1,.5),padding:fr.spacing(0,1)}),XEr=Kr(function(t,n){var S,C,N;const{slotProps:r={}}=t,o=r.button||{},i=r.tooltip||{},s=r.badge||{},l=Eo(),c=sr(),u=Fn(l,KY),d=Fn(l,$b),p=Fn(l,Pw),h=KEr(c),m=Jo(),g=Jo(),{filterPanelTriggerRef:y}=F6(),x=Di(n,y),v=f.useMemo(()=>{if(p.open)return l.current.getLocaleText("toolbarFiltersTooltipHide");if(u.length===0)return l.current.getLocaleText("toolbarFiltersTooltipShow");const j=_=>d[_.field].filterOperators.find(T=>T.value===_.operator).label||l.current.getLocaleText(`filterOperator${vn(_.operator)}`).toString(),I=_=>{const{getValueAsString:T}=d[_.field].filterOperators.find(P=>P.value===_.operator);return T?T(_.value):_.value};return a.jsxs("div",{children:[l.current.getLocaleText("toolbarFiltersTooltipActive")(u.length),a.jsx(YEr,{className:h.root,ownerState:c,children:u.map((_,T)=>Se({},d[_.field]&&a.jsx("li",{children:`${d[_.field].headerName||_.field} ${j(_)} ${_.value!=null?I(_):""}`},T)))})]})},[l,c,p.open,u,d,h]),b=j=>{var T;const{open:I,openedPanelValue:_}=p;I&&_===Td.filters?l.current.hidePreferences():l.current.showPreferences(Td.filters,g,m),(T=o.onClick)==null||T.call(o,j)};if(c.disableColumnFilter)return null;const w=p.open&&p.panelId===g;return a.jsx(c.slots.baseTooltip,Se({title:v,enterDelay:1e3},(S=c.slotProps)==null?void 0:S.baseTooltip,i,{children:a.jsx(c.slots.baseButton,Se({id:m,size:"small","aria-label":l.current.getLocaleText("toolbarFiltersLabel"),"aria-controls":w?g:void 0,"aria-expanded":w,"aria-haspopup":!0,startIcon:a.jsx(c.slots.baseBadge,Se({badgeContent:u.length,color:"primary"},(C=c.slotProps)==null?void 0:C.baseBadge,s,{children:a.jsx(c.slots.openFilterButtonIcon,{})}))},(N=c.slotProps)==null?void 0:N.baseButton,o,{onClick:b,onPointerUp:j=>{var I;p.open&&j.stopPropagation(),(I=o.onPointerUp)==null||I.call(o,j)},ref:x,children:l.current.getLocaleText("toolbarFilters")}))}))}),QEr=Kr(function(t,n){var v,b;const{children:r,slotProps:o={}}=t,i=o.button||{},s=o.tooltip||{},l=Eo(),c=sr(),u=Jo(),d=Jo(),[p,h]=f.useState(!1),m=f.useRef(null),g=Di(n,m),y=w=>{var S;h(C=>!C),(S=i.onClick)==null||S.call(i,w)},x=()=>h(!1);return r==null?null:a.jsxs(f.Fragment,{children:[a.jsx(c.slots.baseTooltip,Se({title:l.current.getLocaleText("toolbarExportLabel"),enterDelay:1e3},(v=c.slotProps)==null?void 0:v.baseTooltip,s,{children:a.jsx(c.slots.baseButton,Se({size:"small",startIcon:a.jsx(c.slots.exportIcon,{}),"aria-expanded":p,"aria-label":l.current.getLocaleText("toolbarExportLabel"),"aria-haspopup":"menu","aria-controls":p?d:void 0,id:u},(b=c.slotProps)==null?void 0:b.baseButton,i,{onClick:y,ref:g,children:l.current.getLocaleText("toolbarExport")}))})),a.jsx(R6,{open:p,target:m.current,onClose:x,position:"bottom-end",children:a.jsx(c.slots.baseMenuList,{id:d,className:Be.menuList,"aria-labelledby":u,autoFocusItem:p,children:f.Children.map(r,w=>f.isValidElement(w)?f.cloneElement(w,{hideMenu:x}):w)})})]})}),JEr=["hideMenu","options"],ZEr=["hideMenu","options"],eIr=["csvOptions","printOptions","excelOptions"];function tIr(e){const t=Eo(),n=sr(),{hideMenu:r,options:o}=e,i=Zn(e,JEr);return a.jsx(n.slots.baseMenuItem,Se({onClick:()=>{t.current.exportDataAsCsv(o),r==null||r()}},i,{children:t.current.getLocaleText("toolbarExportCSV")}))}function nIr(e){const t=Eo(),n=sr(),{hideMenu:r,options:o}=e,i=Zn(e,ZEr);return a.jsx(n.slots.baseMenuItem,Se({onClick:()=>{t.current.exportDataAsPrint(o),r==null||r()}},i,{children:t.current.getLocaleText("toolbarExportPrint")}))}const rIr=Kr(function(t,n){const r=t,{csvOptions:o={},printOptions:i={},excelOptions:s}=r,l=Zn(r,eIr),u=Eo().current.unstable_applyPipeProcessors("exportMenu",[],{excelOptions:s,csvOptions:o,printOptions:i}).sort((d,p)=>d.componentName>p.componentName?1:-1);return u.length===0?null:a.jsx(QEr,Se({},l,{ref:n,children:u.map((d,p)=>f.cloneElement(d.component,{key:p}))}))}),qyt=f.createContext(void 0);function swe(){const e=f.useContext(qyt);if(e===void 0)throw new Error("MUI X: Missing context. Quick Filter subcomponents must be placed within a component.");return e}const oIr=["render","className","parser","formatter","debounceMs","defaultExpanded","expanded","onExpandedChange"],iIr=e=>e.split(" ").filter(t=>t!==""),aIr=e=>e.join(" ");function sIr(e){const t=sr(),{render:n,className:r,parser:o=iIr,formatter:i=aIr,debounceMs:s=t.filterDebounceMs,defaultExpanded:l,expanded:c,onExpandedChange:u}=e,d=Zn(e,oIr),p=Eo(),h=f.useRef(null),m=f.useRef(null),g=Fn(p,nyt),[y,x]=f.useState(i(g??[])),[v,b]=f.useState(l??y.length>0),w=c??v,S=f.useMemo(()=>({value:y,expanded:w}),[y,w]),C=typeof r=="function"?r(S):r,N=f.useRef(null),j=Jo(),I=f.useCallback(z=>{u&&u(z),c===void 0&&b(z)},[u,c]),_=f.useRef(g);f.useEffect(()=>{E0(_.current,g)||(_.current=g,x(z=>E0(o(z),g)?z:i(g??[])))},[g,i,o]);const T=f.useRef(!0),P=f.useRef(w);f.useEffect(()=>{var z;if(T.current){T.current=!1;return}P.current!==w&&(w?requestAnimationFrame(()=>{var V;(V=h.current)==null||V.focus({preventScroll:!0})}):(z=m.current)==null||z.focus({preventScroll:!0}),P.current=w)},[w]);const E=f.useMemo(()=>py(z=>{const V=o(z);_.current=V,p.current.setQuickFilterValues(V)},s),[p,s,o]);f.useEffect(()=>E.clear,[E]);const M=f.useCallback(z=>{const V=z.target.value;x(V),E(V)},[E]),R=f.useCallback(()=>{var z;x(""),p.current.setQuickFilterValues([]),(z=h.current)==null||z.focus()},[p,h]),$=f.useMemo(()=>({controlRef:h,triggerRef:m,state:S,controlId:j,clearValue:R,onValueChange:M,onExpandedChange:I}),[j,S,M,R,I]);Ia(()=>{var z;N.current&&m.current&&N.current.style.setProperty("--trigger-width",`${(z=m.current)==null?void 0:z.offsetWidth}px`)},[]);const D=Db("div",n,Se({className:C},d,{ref:N}),S);return a.jsx(qyt.Provider,{value:$,children:D})}const lIr=["render","className","slotProps","onKeyDown","onChange"],cIr=Kr(function(t,n){var N;const{render:r,className:o,slotProps:i,onKeyDown:s,onChange:l}=t,c=Zn(t,lIr),u=sr(),{state:d,controlId:p,controlRef:h,onValueChange:m,onExpandedChange:g,clearValue:y}=swe(),x=typeof o=="function"?o(d):o,v=Di(h,n),b=j=>{j.key==="Escape"&&(d.value===""?g(!1):y()),s==null||s(j)},w=j=>{var I,_;d.value===""&&g(!1),(_=(I=i==null?void 0:i.htmlInput)==null?void 0:I.onBlur)==null||_.call(I,j)},S=j=>{d.expanded||g(!0),m(j),l==null||l(j)},C=Db(u.slots.baseTextField,r,Se({},(N=u.slotProps)==null?void 0:N.baseTextField,{slotProps:Se({htmlInput:Se({role:"searchbox",id:p,tabIndex:d.expanded?void 0:-1},i==null?void 0:i.htmlInput,{onBlur:w})},i),value:d.value,className:x},c,{onChange:S,onKeyDown:b,ref:v}),d);return a.jsx(f.Fragment,{children:C})}),uIr=["render","className","onClick"],dIr=Kr(function(t,n){var m;const{render:r,className:o,onClick:i}=t,s=Zn(t,uIr),l=sr(),{state:c,clearValue:u}=swe(),d=typeof o=="function"?o(c):o,p=g=>{u(),i==null||i(g)},h=Db(l.slots.baseIconButton,r,Se({},(m=l.slotProps)==null?void 0:m.baseIconButton,{className:d,tabIndex:-1},s,{onClick:p,ref:n}),c);return a.jsx(f.Fragment,{children:h})}),fIr=["render","className","onClick"],pIr=Kr(function(t,n){var x;const{render:r,className:o,onClick:i}=t,s=Zn(t,fIr),l=sr(),{state:c,controlId:u,onExpandedChange:d,triggerRef:p}=swe(),h=typeof o=="function"?o(c):o,m=Di(p,n),g=v=>{d(!c.expanded),i==null||i(v)},y=Db(l.slots.baseButton,r,Se({},(x=l.slotProps)==null?void 0:x.baseButton,{className:h,"aria-controls":u,"aria-expanded":c.expanded},s,{onClick:g,ref:m}),c);return a.jsx(f.Fragment,{children:y})}),hIr=["quickFilterParser","quickFilterFormatter","debounceMs","className","slotProps"],mIr=["ref","slotProps"],gIr=e=>{const{classes:t}=e;return Un({root:["toolbarQuickFilter"],trigger:["toolbarQuickFilterTrigger"],control:["toolbarQuickFilterControl"]},ii,t)},xIr=Ai("div",{name:"MuiDataGrid",slot:"ToolbarQuickFilter"})({display:"grid",alignItems:"center"}),yIr=Ai(KB,{name:"MuiDataGrid",slot:"ToolbarQuickFilterTrigger"})(({ownerState:e})=>({gridArea:"1 / 1",width:"min-content",height:"min-content",zIndex:1,opacity:e.expanded?0:1,pointerEvents:e.expanded?"none":"auto",transition:fr.transition(["opacity"])})),vIr=Ai(e=>{throw new Error("Failed assertion: should not be rendered")},{name:"MuiDataGrid",slot:"ToolbarQuickFilterControl"})(({ownerState:e})=>({gridArea:"1 / 1",overflowX:"clip",width:e.expanded?260:"var(--trigger-width)",opacity:e.expanded?1:0,transition:fr.transition(["width","opacity"])}));function Kyt(e){const t=Eo(),n=sr(),r={classes:n.classes,expanded:!1},o=gIr(r),{quickFilterParser:i,quickFilterFormatter:s,debounceMs:l,className:c,slotProps:u}=e,d=Zn(e,hIr);return a.jsx(sIr,{parser:i,formatter:s,debounceMs:l,render:(p,h)=>{const m=Se({},r,{expanded:h.expanded});return a.jsxs(xIr,Se({},p,{className:be(o.root,c),children:[a.jsx(pIr,{render:g=>a.jsx(n.slots.baseTooltip,{title:t.current.getLocaleText("toolbarQuickFilterLabel"),enterDelay:0,children:a.jsx(yIr,Se({className:o.trigger},g,{ownerState:m,color:"default","aria-disabled":h.expanded,children:a.jsx(n.slots.quickFilterIcon,{fontSize:"small"})}))})}),a.jsx(cIr,{render:g=>{var b;let{ref:y,slotProps:x}=g,v=Zn(g,mIr);return a.jsx(vIr,Se({as:n.slots.baseTextField,className:o.control,ownerState:m,inputRef:y,"aria-label":t.current.getLocaleText("toolbarQuickFilterLabel"),placeholder:t.current.getLocaleText("toolbarQuickFilterPlaceholder"),size:"small",slotProps:Se({input:Se({startAdornment:a.jsx(n.slots.quickFilterIcon,{fontSize:"small"}),endAdornment:v.value?a.jsx(dIr,{render:a.jsx(n.slots.baseIconButton,{size:"small",edge:"end","aria-label":t.current.getLocaleText("toolbarQuickFilterDeleteIconLabel"),children:a.jsx(n.slots.quickFilterClearIcon,{fontSize:"small"})})}):null},x==null?void 0:x.input)},x)},(b=n.slotProps)==null?void 0:b.baseTextField,v,u==null?void 0:u.root,d))}})]}))}})}const bIr=["render","className","onClick","onPointerUp"],wIr=Kr(function(t,n){var j;const{render:r,className:o,onClick:i,onPointerUp:s}=t,l=Zn(t,bIr),c=sr(),u=Jo(),d=Jo(),p=Eo(),h=Fn(p,Pw),m=h.open&&h.openedPanelValue===Td.filters,y=Fn(p,KY).length,x={open:m,filterCount:y},v=typeof o=="function"?o(x):o,{filterPanelTriggerRef:b}=F6(),w=Di(n,b),S=I=>{m?p.current.hidePreferences():p.current.showPreferences(Td.filters,d,u),i==null||i(I)},C=I=>{m&&I.stopPropagation(),s==null||s(I)},N=Db(c.slots.baseButton,r,Se({},(j=c.slotProps)==null?void 0:j.baseButton,{id:u,"aria-haspopup":"true","aria-expanded":m?"true":void 0,"aria-controls":m?d:void 0,onClick:S,onPointerUp:C,className:v},l,{ref:w}),x);return a.jsx(f.Fragment,{children:N})}),SIr=["render","className","onClick","onPointerUp"],CIr=Kr(function(t,n){var C;const{render:r,className:o,onClick:i,onPointerUp:s}=t,l=Zn(t,SIr),c=sr(),u=Jo(),d=Jo(),p=Eo(),h=Fn(p,Pw),m=h.open&&h.openedPanelValue===Td.columns,g={open:m},y=typeof o=="function"?o(g):o,{columnsPanelTriggerRef:x}=F6(),v=Di(n,x),b=N=>{m?p.current.hidePreferences():p.current.showPreferences(Td.columns,d,u),i==null||i(N)},w=N=>{m&&N.stopPropagation(),s==null||s(N)},S=Db(c.slots.baseButton,r,Se({},(C=c.slotProps)==null?void 0:C.baseButton,{id:u,"aria-haspopup":"true","aria-expanded":m?"true":void 0,"aria-controls":m?d:void 0,className:y},l,{onPointerUp:w,onClick:b,ref:v}),g);return a.jsx(f.Fragment,{children:S})}),NIr=["render","options","onClick"],jIr=Kr(function(t,n){var p;const{render:r,options:o,onClick:i}=t,s=Zn(t,NIr),l=sr(),c=Eo(),u=h=>{c.current.exportDataAsCsv(o),i==null||i(h)},d=Db(l.slots.baseButton,r,Se({},(p=l.slotProps)==null?void 0:p.baseButton,{onClick:u},s,{ref:n}));return a.jsx(f.Fragment,{children:d})}),EIr=["render","options","onClick"],IIr=Kr(function(t,n){var p;const{render:r,options:o,onClick:i}=t,s=Zn(t,EIr),l=sr(),c=Eo(),u=h=>{c.current.exportDataAsPrint(o),i==null||i(h)},d=Db(l.slots.baseButton,r,Se({},(p=l.slotProps)==null?void 0:p.baseButton,{onClick:u},s,{ref:n}));return a.jsx(f.Fragment,{children:d})}),_Ir=["className"],PIr=["className"],AIr=["showQuickFilter","quickFilterProps","csvOptions","printOptions","mainControls","additionalExportMenuItems"],Yyt=e=>{const{classes:t}=e;return Un({divider:["toolbarDivider"],label:["toolbarLabel"]},ii,t)},TIr=Ai(Ob,{name:"MuiDataGrid",slot:"ToolbarDivider"})({height:"50%",margin:fr.spacing(0,.5)}),kIr=Ai("span",{name:"MuiDataGrid",slot:"ToolbarLabel"})({flex:1,font:fr.typography.font.large,fontWeight:fr.typography.fontWeight.medium,margin:fr.spacing(0,.5),textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"});function $7e(e){const t=Zn(e,_Ir),n=sr(),r=Yyt(n);return a.jsx(TIr,Se({as:n.slots.baseDivider,orientation:"vertical",className:r.divider},t))}function Xyt(e){const t=Zn(e,PIr),n=sr(),r=Yyt(n);return a.jsx(kIr,Se({className:r.label},t))}function MIr(e){var v,b,w;const{showQuickFilter:t=!0,quickFilterProps:n,csvOptions:r,printOptions:o,mainControls:i,additionalExportMenuItems:s}=e,l=Zn(e,AIr),c=Eo(),u=sr(),[d,p]=f.useState(!1),h=f.useRef(null),m=Jo(),g=Jo(),y=!(r!=null&&r.disableToolbarButton)||!(o!=null&&o.disableToolbarButton)||s,x=()=>p(!1);return a.jsxs(Fyt,Se({},l,{children:[u.label&&a.jsx(Xyt,{children:u.label}),i||a.jsxs(f.Fragment,{children:[!u.disableColumnSelector&&a.jsx(u.slots.baseTooltip,{title:c.current.getLocaleText("toolbarColumns"),children:a.jsx(CIr,{render:a.jsx(KB,{}),children:a.jsx(u.slots.columnSelectorIcon,{fontSize:"small"})})}),!u.disableColumnFilter&&a.jsx(u.slots.baseTooltip,{title:c.current.getLocaleText("toolbarFilters"),children:a.jsx(wIr,{render:(S,C)=>a.jsx(KB,Se({},S,{color:C.filterCount>0?"primary":"default",children:a.jsx(u.slots.baseBadge,{badgeContent:C.filterCount,color:"primary",variant:"dot",children:a.jsx(u.slots.openFilterButtonIcon,{fontSize:"small"})})}))})})]}),y&&(!u.disableColumnFilter||!u.disableColumnSelector)&&a.jsx($7e,{}),y&&a.jsxs(f.Fragment,{children:[a.jsx(u.slots.baseTooltip,{title:c.current.getLocaleText("toolbarExport"),disableInteractive:d,children:a.jsx(KB,{ref:h,id:g,"aria-controls":m,"aria-haspopup":"true","aria-expanded":d?"true":void 0,onClick:()=>p(!d),children:a.jsx(u.slots.exportIcon,{fontSize:"small"})})}),a.jsx(R6,{target:h.current,open:d,onClose:x,position:"bottom-end",children:a.jsxs(u.slots.baseMenuList,Se({id:m,"aria-labelledby":g,autoFocusItem:!0},(v=u.slotProps)==null?void 0:v.baseMenuList,{children:[!(o!=null&&o.disableToolbarButton)&&a.jsx(IIr,{render:a.jsx(u.slots.baseMenuItem,Se({},(b=u.slotProps)==null?void 0:b.baseMenuItem)),options:o,onClick:x,children:c.current.getLocaleText("toolbarExportPrint")}),!(r!=null&&r.disableToolbarButton)&&a.jsx(jIr,{render:a.jsx(u.slots.baseMenuItem,Se({},(w=u.slotProps)==null?void 0:w.baseMenuItem)),options:r,onClick:x,children:c.current.getLocaleText("toolbarExportCSV")}),s==null?void 0:s(x)]}))})]}),t&&a.jsxs(f.Fragment,{children:[a.jsx($7e,{}),a.jsx(Kyt,Se({},n))]})]}))}const RIr=["className","csvOptions","printOptions","excelOptions","showQuickFilter","quickFilterProps"],OIr=Kr(function(t,n){const r=t,{csvOptions:o,printOptions:i,excelOptions:s,showQuickFilter:l=!0,quickFilterProps:c={}}=r,u=Zn(r,RIr),d=sr();return d.disableColumnFilter&&d.disableColumnSelector&&d.disableDensitySelector&&!l?null:a.jsxs(KNr,Se({},u,{ref:n,children:[d.label&&a.jsx(Xyt,{children:d.label}),a.jsx(GEr,{}),a.jsx(XEr,{}),a.jsx(qEr,{}),a.jsx(rIr,{csvOptions:o,printOptions:i,excelOptions:s}),a.jsx("div",{style:{flex:1}}),l&&a.jsx(Kyt,Se({},c))]}))}),$Ir=["className","selectedRowCount"],DIr=e=>{const{classes:t}=e;return Un({root:["selectedRowCount"]},ii,t)},LIr=Ai("div",{name:"MuiDataGrid",slot:"SelectedRowCount"})({alignItems:"center",display:"flex",margin:fr.spacing(0,2),visibility:"hidden",width:0,height:0,[fr.breakpoints.up("sm")]:{visibility:"visible",width:"auto",height:"auto"}}),FIr=Kr(function(t,n){const{className:r,selectedRowCount:o}=t,i=Zn(t,$Ir),s=Eo(),l=sr(),c=DIr(l),u=s.current.getLocaleText("footerRowSelected")(o);return a.jsx(LIr,Se({className:be(c.root,r),ownerState:l},i,{ref:n,children:u}))}),zIr=Kr(function(t,n){var p,h;const r=Eo(),o=sr(),i=Fn(r,T1r),s=Fn(r,YY),l=Fn(r,QO),c=!o.hideFooterSelectedRowCount&&s>0?a.jsx(FIr,{selectedRowCount:s}):a.jsx("div",{}),u=!o.hideFooterRowCount&&!o.pagination?a.jsx(o.slots.footerRowCount,Se({},(p=o.slotProps)==null?void 0:p.footerRowCount,{rowCount:i,visibleRowCount:l})):null,d=o.pagination&&!o.hideFooterPagination&&o.slots.pagination&&a.jsx(o.slots.pagination,Se({},(h=o.slotProps)==null?void 0:h.pagination));return a.jsxs(RNr,Se({},t,{ref:n,children:[c,u,d]}))}),ZO=(e,t,n,r,o,i)=>{let s;switch(e){case Ni.LEFT:s=r[n];break;case Ni.RIGHT:s=o-r[n]-t+i;break;default:s=void 0;break}return Number.isNaN(s)&&(s=void 0),s},OW=(e,t,n,r,o,i)=>{const s=t===n-1;return i!=null&&i.startsWith("border")&&e===Ni.LEFT&&s?!0:r?e===Ni.LEFT?!0:e===Ni.RIGHT?!s:!s||o:!1},$W=(e,t,n,r)=>r!=null&&r.startsWith("border")?e===Ni.RIGHT&&t===0:n&&e===Ni.RIGHT&&t===0,BIr=["skeletonRowsCount","visibleColumns","showFirstRowBorder"],HIr=Ai("div",{name:"MuiDataGrid",slot:"SkeletonLoadingOverlay"})({minWidth:"100%",width:"max-content",height:"100%",overflow:"clip"}),VIr=e=>{const{classes:t}=e;return Un({root:["skeletonLoadingOverlay"]},ii,t)},D7e=e=>parseInt(e.getAttribute("data-colindex"),10),UIr=Kr(function(t,n){const r=sr(),{slots:o}=r,i=$d(),s=VIr({classes:r.classes}),l=f.useRef(null),c=Di(l,n),u=Eo(),d=Fn(u,Rl),p=Fn(u,F1e),h=Fn(u,y5),m=f.useMemo(()=>h.filter(I=>I<=p).length,[p,h]),{skeletonRowsCount:g,visibleColumns:y,showFirstRowBorder:x}=t,v=Zn(t,BIr),b=Fn(u,yc),w=f.useMemo(()=>b.slice(0,m),[b,m]),S=Fn(u,VY),C=f.useCallback(I=>{if(S.left.findIndex(_=>_.field===I)!==-1)return Ni.LEFT;if(S.right.findIndex(_=>_.field===I)!==-1)return Ni.RIGHT},[S.left,S.right]),N=f.useMemo(()=>{const I=[];for(let _=0;_ae.field===E.field):P-S.left.length,B=d.hasScrollY?d.scrollbarSize:0,G=nX({},i,M,ZO(M,E.computedWidth,P,h,d.columnsTotalWidth,B)),H=d.columnsTotalWidth{var V,B,G;const{colDef:_,width:T}=I,P=(V=l.current)==null?void 0:V.querySelectorAll(`[data-field="${Lb(_.field)}"]`);if(!P)throw new Error("MUI X: Expected skeleton cells to be defined with `data-field` attribute.");const E=w.findIndex(H=>H.field===_.field),M=C(_.field),R=M===Ni.LEFT,$=M===Ni.RIGHT,D=getComputedStyle(P[0]).getPropertyValue("--width"),z=parseInt(D,10)-T;if(P&&P.forEach(H=>{H.style.setProperty("--width",`${T}px`)}),R){const H=(B=l.current)==null?void 0:B.querySelectorAll(`.${Be["cell--pinnedLeft"]}`);H==null||H.forEach(F=>{D7e(F)>E&&(F.style.left=`${parseInt(getComputedStyle(F).left,10)-z}px`)})}if($){const H=(G=l.current)==null?void 0:G.querySelectorAll(`.${Be["cell--pinnedRight"]}`);H==null||H.forEach(F=>{D7e(F)e.slots.baseCircularProgress,style:{}},"linear-progress":{component:e=>e.slots.baseLinearProgress,style:{display:"block"}},skeleton:{component:()=>WIr,style:{display:"block"}}},KIr=Kr(function(t,n){const{variant:r="linear-progress",noRowsVariant:o="skeleton",style:i}=t,s=Zn(t,GIr),l=Eo(),c=sr(),u=Fn(l,d4),d=qIr[u===0?o:r],p=d.component(c);return a.jsx(rX,Se({style:Se({},d.style,i)},s,{ref:n,children:a.jsx(p,{})}))}),YIr=Kr(function(t,n){const o=Eo().current.getLocaleText("noRowsLabel");return a.jsx(rX,Se({},t,{ref:n,children:o}))}),XIr=Kr(function(t,n){var c;const r=sr(),o=Eo(),i=Fn(o,tb),s=()=>{o.current.showPreferences(Td.columns)},l=!r.disableColumnSelector&&i.length>0;return a.jsxs(rX,Se({},t,{ref:n,children:[o.current.getLocaleText("noColumnsOverlayLabel"),l&&a.jsx(r.slots.baseButton,Se({size:"small"},(c=r.slotProps)==null?void 0:c.baseButton,{onClick:s,children:o.current.getLocaleText("noColumnsOverlayManageColumns")}))]}))}),QIr=Bt(Ob,{slot:"internal"})({maxHeight:"calc(100% + 1px)",flexGrow:1});function JIr(){var g;const e=Eo(),t=sr(),n=Fn(e,sf),r=Fn(e,c2),o=Fn(e,pyt),{paginationMode:i,loading:s}=t,l=r===-1&&i==="server"&&s,c=f.useMemo(()=>Math.max(0,o-1),[o]),u=f.useMemo(()=>r===-1||n.page<=c?n.page:c,[c,n.page,r]),d=f.useCallback(y=>{e.current.setPageSize(y)},[e]),p=f.useCallback((y,x)=>{e.current.setPage(x)},[e]),m=(y=>{for(let x=0;x{const{classes:t}=e;return Un({root:["rowCount"]},ii,t)},t5r=Ai("div",{name:"MuiDataGrid",slot:"RowCount"})({alignItems:"center",display:"flex",margin:fr.spacing(0,2)}),n5r=Kr(function(t,n){const{className:r,rowCount:o,visibleRowCount:i}=t,s=Zn(t,ZIr),l=Eo(),c=sr(),u=e5r(c);if(o===0)return null;const d=ie.rowReorder),o5r=yr(lwe,e=>(e==null?void 0:e.isActive)??!1),Qyt=yr(lwe,e=>(e==null?void 0:e.dropTarget)??{rowId:null,position:null});yr(Qyt,e=>e.rowId??null);const i5r=yr(Qyt,(e,t)=>e.rowId===t?e.position:null);yr(lwe,e=>(e==null?void 0:e.draggedRowId)??null);const a5r=Bt("div",{name:"MuiDataGrid",slot:"RowDragOverlay",shouldForwardProp:e=>$z(e)&&e!=="action"})(({theme:e,action:t})=>Se({position:"absolute",left:0,right:0,top:0,bottom:0,pointerEvents:"none",zIndex:1},t==="above"&&{"&::before":{pointerEvents:"none",content:'""',position:"absolute",top:0,left:0,right:0,height:"2px",backgroundColor:(e.vars||e).palette.primary.main}},t==="below"&&{"&::after":{pointerEvents:"none",content:'""',position:"absolute",bottom:"-2px",left:0,right:0,height:"2px",backgroundColor:(e.vars||e).palette.primary.main}},t==="inside"&&{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / 0.1)`:Na(e.palette.primary.main,.1)})),s5r=f.memo(function(t){const{rowId:n,className:r}=t,o=Th(),i=Fn(o,i5r,n);return i?a.jsx(a5r,{action:i,className:r}):null}),l5r=["selected","rowId","row","index","style","rowHeight","className","visibleColumns","pinnedColumns","offsetLeft","columnsTotalWidth","firstColumnIndex","lastColumnIndex","focusedColumnIndex","isFirstVisible","isLastVisible","isNotVisible","showBottomBorder","scrollbarWidth","gridHasFiller","onClick","onDoubleClick","onMouseEnter","onMouseLeave","onMouseOut","onMouseOver"],c5r=yr(Ed,(e,{rowReordering:t,treeData:n})=>!t||n?!1:!!GY(e)),u5r=Kr(function(t,n){var at;const{selected:r,rowId:o,row:i,index:s,style:l,rowHeight:c,className:u,visibleColumns:d,pinnedColumns:p,offsetLeft:h,columnsTotalWidth:m,firstColumnIndex:g,lastColumnIndex:y,focusedColumnIndex:x,isFirstVisible:v,isLastVisible:b,isNotVisible:w,showBottomBorder:S,scrollbarWidth:C,gridHasFiller:N,onClick:j,onDoubleClick:I,onMouseEnter:_,onMouseLeave:T,onMouseOut:P,onMouseOver:E}=t,M=Zn(t,l5r),R=Th(),$=UY(),D=f.useRef(null),z=sr(),V=Oyt(R),B=Fn(R,Xg),G=Fn(R,y5),H=z.rowReordering,F=z.treeData,W=Fn(R,c5r,{rowReordering:H,treeData:F}),U=Fn(R,o5r),K=Di(D,n),X=j0(R,o),J=Fn(R,_yt,{rowId:o,editMode:z.editMode}),te=z.editMode===bb.Row,re=x!==void 0,ce=re&&x>=p.left.length&&x=y,oe=r5r(z.classes,{root:["row",r&&"selected",te&&"row--editable",J&&"row--editing",v&&"row--firstVisible",b&&"row--lastVisible",S&&"row--borderBottom",c==="auto"&&"row--dynamicHeight"]}),ue=$.hooks.useGridRowAriaAttributes();f.useLayoutEffect(()=>{if(V.range){const Oe=R.current.getRowIndexRelativeToVisibleRows(o);Oe!==void 0&&R.current.unstable_setLastMeasuredRowIndex(Oe)}if(D.current&&c==="auto")return R.current.observeRowHeight(D.current,o)},[R,V.range,c,o]);const fe=f.useCallback((Oe,Ae)=>qe=>{z6(qe)||R.current.getRow(o)&&(R.current.publishEvent(Oe,R.current.getRowParams(o),qe),Ae&&Ae(qe))},[R,o]),se=f.useCallback(Oe=>{const Ae=RW(Oe.target,Be.cell),qe=Ae==null?void 0:Ae.getAttribute("data-field");if(qe){if(qe===m4.field||qe===K1e||qe==="__reorder__"||R.current.getCellMode(o,qe)===Da.Edit)return;const dt=R.current.getColumn(qe);if((dt==null?void 0:dt.type)===WY)return}fe("rowClick",j)(Oe)},[R,j,fe,o]),{slots:ge,slotProps:ye,disableColumnReorder:de}=z,Ne=Fn(R,()=>Se({},R.current.getRowHeightEntry(o)),void 0,yxt),_e=f.useMemo(()=>{if(w)return{opacity:0,width:0,height:0};const Oe=Se({},l,{maxHeight:c==="auto"?"none":c,minHeight:c,"--height":typeof c=="number"?`${c}px`:c});if(Ne.spacingTop){const Ae=z.rowSpacingType==="border"?"borderTopWidth":"marginTop";Oe[Ae]=Ne.spacingTop}if(Ne.spacingBottom){const Ae=z.rowSpacingType==="border"?"borderBottomWidth":"marginBottom";let qe=Oe[Ae];typeof qe!="number"&&(qe=parseInt(qe||"0",10)),qe+=Ne.spacingBottom,Oe[Ae]=qe}return Oe},[w,c,l,Ne.spacingTop,Ne.spacingBottom,z.rowSpacingType]);if(!X)return null;const xe=R.current.unstable_applyPipeProcessors("rowClassName",[],o),we=ue(X,s);if(typeof z.getRowClassName=="function"){const Oe=s-(((at=V.range)==null?void 0:at.firstRowIndex)||0),Ae=Se({},R.current.getRowParams(o),{isFirstVisible:Oe===0,isLastVisible:Oe===V.rows.length-1,indexRelativeToCurrentPage:Oe});xe.push(z.getRowClassName(Ae))}const Te=(Oe,Ae,qe,dt,Ze=Ni.NONE)=>{const Qe=R.current.unstable_getCellColSpanInfo(o,qe);if(Qe!=null&&Qe.spannedByColSpan)return null;const lt=(Qe==null?void 0:Qe.cellProps.width)??Oe.computedWidth,bt=(Qe==null?void 0:Qe.cellProps.colSpan)??1,Ct=ZO(Ze,Oe.computedWidth,qe,G,m,C);if(X.type==="skeletonRow")return a.jsx(ge.skeletonCell,{type:Oe.type,width:lt,height:c,field:Oe.field,align:Oe.align},Oe.field);const Je=Oe.field==="__reorder__",Pe=!(de||Oe.disableReorder),Me=W&&!B.length,et=!(Pe||Je&&Me||U),vt=Ze===Ni.VIRTUAL,Pt=$W(Ze,Ae,z.showCellVerticalBorder,z.pinnedColumnsSectionSeparator),Jt=OW(Ze,Ae,dt,z.showCellVerticalBorder,N,z.pinnedColumnsSectionSeparator);return a.jsx(ge.cell,Se({column:Oe,width:lt,rowId:o,align:Oe.align||"left",colIndex:qe,colSpan:bt,disableDragEvents:et,isNotVisible:vt,pinnedOffset:Ct,pinnedPosition:Ze,showLeftBorder:Pt,showRightBorder:Jt,row:i,rowNode:X},ye==null?void 0:ye.cell),Oe.field)},Re=p.left.map((Oe,Ae)=>Te(Oe,Ae,Ae,p.left.length,Ni.LEFT)),Ue=p.right.map((Oe,Ae)=>{const qe=d.length-p.right.length+Ae;return Te(Oe,Ae,qe,p.right.length,Ni.RIGHT)}),He=d.length-p.left.length-p.right.length,Ye=[];ce&&Ye.push(Te(d[x],x-p.left.length,x,He,Ni.VIRTUAL));for(let Oe=g;Oe{const e=Th(),t=sr(),n=Fn(e,yc),r=Fn(e,Q1e),o=Fn(e,L6),i=Fn(e,Ixt),s=t["aria-label"],l=t["aria-labelledby"];return{role:"grid","aria-label":!s&&!l&&t.label?t.label:s,"aria-labelledby":l,"aria-colcount":n.length,"aria-rowcount":o+1+i+r,"aria-multiselectable":J1e(t)}},p5r=()=>{const e=Th(),t=Fn(e,L6);return f.useCallback((n,r)=>{const o={},i=r+t+2;return o["aria-rowindex"]=i,n&&e.current.isRowSelectable(n.id)&&(o["aria-selected"]=e.current.isRowSelected(n.id)),o},[e,t])},h5r=e=>{const t=f.useCallback((r,o,i)=>{const s=j0(e,r),l=j0(e,o);if(!s)throw new Error(`MUI X: No row with id #${r} found.`);if(!l)throw new Error(`MUI X: No row with id #${o} found.`);if(s.type!=="leaf")throw new Error("MUI X: The row reordering does not support reordering of footer or grouping rows.");if(i==="inside")throw new Error("MUI X: The 'inside' position is only supported for tree data. Use 'above' or 'below' for flat data.");const c=uSr(e),u=c[o];if(u===void 0)throw new Error(`MUI X: Target row with id #${o} not found in current view.`);const d=c[r];if(d===void 0)throw new Error(`MUI X: Source row with id #${r} not found in current view.`);const p=u{const g=Mc(e)[pc],x=[...g.children];return x.splice(h,0,x.splice(d,1)[0]),Se({},m,{rows:Se({},m.rows,{tree:Se({},m.rows.tree,{[pc]:Se({},g,{children:x})})})})}),e.current.publishEvent("rowsSet"))},[e]);return{setRowIndex:f.useCallback((r,o)=>{const i=j0(e,r);if(!i)throw new Error(`MUI X: No row with id #${r} found.`);if(i.type!=="leaf")throw new Error("MUI X: The row reordering does not support reordering of footer or grouping rows.");e.current.setState(s=>{const l=Mc(e)[pc],c=l.children,u=c.findIndex(p=>p===r);if(u===-1||u===o)return s;const d=[...c];return d.splice(o,0,d.splice(u,1)[0]),Se({},s,{rows:Se({},s.rows,{tree:Se({},s.rows.tree,{[pc]:Se({},l,{children:d})})})})}),e.current.publishEvent("rowsSet")},[e]),setRowPosition:t}},m5r=e=>{const t=f.useCallback((o,i)=>{const s=e.current.getColumn(i),l=e.current.getRow(o);if(!l)throw new Error(`No row with id #${o} found`);return!s||!s.valueGetter?l[i]:s.valueGetter(l[s.field],l,s,e)},[e]),n=f.useCallback((o,i)=>_xt(o,i,e),[e]),r=f.useCallback((o,i)=>{const s=n(o,i);return!i||!i.valueFormatter?s:i.valueFormatter(s,o,i,e)},[e,n]);return{getCellValue:t,getRowValue:n,getRowFormattedValue:r}},g5r=()=>f.useCallback(e=>!zT(e.rowNode),[]);function x5r({privateApiRef:e,configuration:t,props:n,children:r}){const o=f.useRef(e.current.getPublicApi());return a.jsx(Qxt.Provider,{value:t,children:a.jsx(fxt.Provider,{value:n,children:a.jsx(vxt.Provider,{value:e,children:a.jsx(pxt.Provider,{value:o,children:a.jsx(NNr,{children:a.jsx(Ewr,{children:r})})})})})})}const y5r=e=>{const t=f.useRef(null),n=f.useRef(null),r=f.useRef(null),o=f.useRef(null),i=f.useRef(null),s=f.useRef(null);e.current.register("public",{rootElementRef:t}),e.current.register("private",{mainElementRef:n,virtualScrollerRef:r,virtualScrollbarVerticalRef:o,virtualScrollbarHorizontalRef:i,columnHeadersContainerRef:s})},v5r=e=>{const t=$d();e.current.state.isRtl===void 0&&(e.current.state.isRtl=t);const n=f.useRef(!0);f.useEffect(()=>{n.current?n.current=!1:e.current.setState(r=>Se({},r,{isRtl:t}))},[e,t])},b5r=awr()&&window.localStorage.getItem("DEBUG")!=null,GR=()=>{},w5r={debug:GR,info:GR,warn:GR,error:GR},L7e=["debug","info","warn","error"];function F7e(e,t,n=console){const r=L7e.indexOf(t);if(r===-1)throw new Error(`MUI X: Log level ${t} not recognized.`);return L7e.reduce((i,s,l)=>(l>=r?i[s]=(...c)=>{const[u,...d]=c;n[s](`MUI X: ${e} - ${u}`,...d)}:i[s]=GR,i),{})}const S5r=(e,t)=>{const n=f.useCallback(r=>b5r?F7e(r,"debug",t.logger):t.logLevel?F7e(r,t.logLevel.toString(),t.logger):w5r,[t.logLevel,t.logger]);oi(e,{getLogger:n},"private")},C5r=(e,t)=>{const n=f.useCallback(r=>{if(t.localeText[r]==null)throw new Error(`Missing translation for key ${r}.`);return t.localeText[r]},[t.localeText]);e.current.register("public",{getLocaleText:n})};let $1=(function(e){return e.DataSource="dataSource",e.RowTree="rowTree",e})({});const bD=(e,t,n,r)=>{const o=f.useCallback(()=>{e.current.registerStrategyProcessor(t,n,r)},[e,r,n,t]);b5(()=>{o()});const i=f.useRef(!0);f.useEffect(()=>{i.current?i.current=!1:o()},[o])},DI="none",z7e={dataSourceRowsUpdate:$1.DataSource,rowTreeCreation:$1.RowTree,filtering:$1.RowTree,sorting:$1.RowTree,visibleRowsLookupCreation:$1.RowTree},N5r=e=>{const t=f.useRef(new Map),n=f.useRef({}),r=f.useCallback((c,u,d)=>{const p=()=>{const g=n.current[u],y=Zn(g,[c].map(yI));n.current[u]=y};n.current[u]||(n.current[u]={});const h=n.current[u],m=h[c];return h[c]=d,!m||m===d||c===e.current.getActiveStrategy(z7e[u])&&e.current.publishEvent("activeStrategyProcessorChange",u),p},[e]),o=f.useCallback((c,u)=>{const d=e.current.getActiveStrategy(z7e[c]);if(d==null)throw new Error("Can't apply a strategy processor before defining an active strategy");const p=n.current[c];if(!p||!p[d])throw new Error(`No processor found for processor "${c}" on strategy "${d}"`);const h=p[d];return h(u)},[e]),i=f.useCallback(c=>{const d=Array.from(t.current.entries()).find(([,p])=>p.group!==c?!1:p.isAvailable());return(d==null?void 0:d[0])??DI},[]),s=f.useCallback((c,u,d)=>{t.current.set(u,{group:c,isAvailable:d}),e.current.publishEvent("strategyAvailabilityChange")},[e]);oi(e,{registerStrategyProcessor:r,applyStrategyProcessor:o,getActiveStrategy:i,setStrategyAvailability:s},"private")},j5r=e=>{const t=f.useRef({}),n=f.useCallback(l=>{t.current[l.stateId]=l},[]),r=f.useCallback((l,c)=>{let u;if(iwr(l)?u=l(e.current.state):u=l,e.current.state===u)return!1;const d={current:{state:u}};let p=!1;const h=[];if(Object.keys(t.current).forEach(m=>{const g=t.current[m],y=g.stateSelector(e),x=g.stateSelector(d);x!==y&&(h.push({stateId:g.stateId,hasPropChanged:x!==g.propModel}),g.propModel!==void 0&&x!==g.propModel&&(p=!0))}),h.length>1)throw new Error(`You're not allowed to update several sub-state in one transaction. You already updated ${h[0].stateId}, therefore, you're not allowed to update ${h.map(m=>m.stateId).join(", ")} in the same transaction.`);if(p||(e.current.state=u,e.current.publishEvent("stateChange",u),e.current.store.update(u)),h.length===1){const{stateId:m,hasPropChanged:g}=h[0],y=t.current[m],x=y.stateSelector(d);y.propOnChange&&g&&y.propOnChange(x,{reason:c,api:e.current}),p||e.current.publishEvent(y.changeEvent,x,{reason:c})}return!p},[e]),o=f.useCallback((l,c,u)=>e.current.setState(d=>Se({},d,{[l]:c(d[l])}),u),[e]),i={setState:r},s={updateControlState:o,registerControlState:n};oi(e,i,"public"),oi(e,s,"private")},E5r=(e,t)=>Se({},e,{props:{listView:t.listView,getRowId:t.getRowId,isCellEditable:t.isCellEditable,isRowSelectable:t.isRowSelectable,dataSource:t.dataSource}}),I5r=(e,t)=>{const n=f.useRef(!0);f.useEffect(()=>{if(n.current){n.current=!1;return}e.current.setState(r=>Se({},r,{props:{listView:t.listView,getRowId:t.getRowId,isCellEditable:t.isCellEditable,isRowSelectable:t.isRowSelectable,dataSource:t.dataSource}}))},[e,t.listView,t.getRowId,t.isCellEditable,t.isRowSelectable,t.dataSource])},_5r=(e,t)=>{y5r(e),I5r(e,t),v5r(e),S5r(e,t),j5r(e),KCr(e),N5r(e),C5r(e,t),e.current.register("private",{rootProps:t})},vd=(e,t,n,r)=>{const o=f.useRef(r),i=f.useRef(!1);r!==o.current&&(i.current=!1,o.current=r),i.current||(t.current.state=e(t.current.state,n,t),i.current=!0)};function Npe(e,t){if(e==null)return"";const n=typeof e=="string"?e:`${e}`;if(t.shouldAppendQuotes||t.escapeFormulas){const r=n.replace(/"/g,'""');return t.escapeFormulas&&["=","+","-","@"," ","\r"].includes(r[0])?`"'${r}"`:[t.delimiter,` `,"\r",'"'].some(o=>n.includes(o))?`"${r}"`:r}return n}const Jyt=(e,t)=>{var i,s;const{csvOptions:n,ignoreValueFormatter:r}=t;let o;if(r){const l=e.colDef.type;l==="number"?o=String(e.value):l==="date"||l==="dateTime"?o=(i=e.value)==null?void 0:i.toISOString():typeof((s=e.value)==null?void 0:s.toString)=="function"?o=e.value.toString():o=e.value}else o=e.formattedValue;return Npe(o,n)};class jpe{constructor(t){ze(this,"rowString","");ze(this,"isEmpty",!0);this.options=t}addValue(t){this.isEmpty||(this.rowString+=this.options.csvOptions.delimiter),typeof this.options.sanitizeCellValue=="function"?this.rowString+=this.options.sanitizeCellValue(t,this.options.csvOptions):this.rowString+=t,this.isEmpty=!1}getRowString(){return this.rowString}}const P5r=({id:e,columns:t,getCellParams:n,csvOptions:r,ignoreValueFormatter:o})=>{const i=new jpe({csvOptions:r});return t.forEach(s=>{const l=n(e,s.field);String(l.formattedValue),i.addValue(Jyt(l,{ignoreValueFormatter:o,csvOptions:r}))}),i.getRowString()};function A5r(e){const{columns:t,rowIds:n,csvOptions:r,ignoreValueFormatter:o,apiRef:i}=e,s=n.reduce((p,h)=>`${p}${P5r({id:h,columns:t,getCellParams:i.current.getCellParams,ignoreValueFormatter:o,csvOptions:r})}\r `,"").trim();if(!r.includeHeaders)return s;const l=t.filter(p=>p.field!==m4.field),c=[];if(r.includeColumnGroupsHeaders){const p=i.current.getAllGroupDetails();let h=0;const m=l.reduce((g,y)=>{const x=i.current.getColumnGroupPath(y.field);return g[y.field]=x,h=Math.max(h,x.length),g},{});for(let g=0;g{const v=(m[x.field]||[])[g],b=p[v];y.addValue(b?b.headerName||b.groupId:"")})}}const u=new jpe({csvOptions:r,sanitizeCellValue:Npe});return l.forEach(p=>{u.addValue(p.headerName||p.field)}),c.push(u),`${`${c.map(p=>p.getRowString()).join(`\r `)}\r `}${s}`.trim()}function B7e(e){const t=document.createElement("span");t.style.whiteSpace="pre",t.style.userSelect="all",t.style.opacity="0px",t.textContent=e,document.body.appendChild(t);const n=document.createRange();n.selectNode(t);const r=window.getSelection();r.removeAllRanges(),r.addRange(n);try{document.execCommand("copy")}finally{document.body.removeChild(t)}}function T5r(e){navigator.clipboard?navigator.clipboard.writeText(e).catch(()=>{B7e(e)}):B7e(e)}function k5r(e){var t;return!!((t=window.getSelection())!=null&&t.toString()||e&&(e.selectionEnd||0)-(e.selectionStart||0)>0)}const M5r=(e,t)=>{const n=t.ignoreValueFormatterDuringExport,r=(typeof n=="object"?n==null?void 0:n.clipboardExport:n)||!1,o=t.clipboardCopyCellDelimiter,i=f.useCallback(s=>{if(!Cwr(s)||k5r(s.target))return;let l="";if(YY(e)>0)l=e.current.getDataAsCsv({includeHeaders:!1,delimiter:o,shouldAppendQuotes:!1,escapeFormulas:!1});else{const u=em(e);if(u){const d=e.current.getCellParams(u.id,u.field);l=Jyt(d,{csvOptions:{delimiter:o,shouldAppendQuotes:!1,escapeFormulas:!1},ignoreValueFormatter:r})}}l=e.current.unstable_applyPipeProcessors("clipboardCopy",l),l&&(T5r(l),e.current.publishEvent("clipboardCopy",l))},[e,r,o]);Nyt(e,()=>e.current.rootElementRef.current,"keydown",i),Ss(e,"clipboardCopy",t.onClipboardCopy)},R5r=e=>Se({},e,{columnMenu:{open:!1}}),O5r=e=>{const t=wf(e,"useGridColumnMenu"),n=f.useRef({}),r=f.useCallback(()=>{var u,d,p,h;(d=(u=n.current).wheel)==null||d.call(u),(h=(p=n.current).touchMove)==null||h.call(p)},[]),o=f.useCallback(()=>{r(),n.current.wheel=e.current.subscribeEvent("virtualScrollerWheel",e.current.hideColumnMenu),n.current.touchMove=e.current.subscribeEvent("virtualScrollerTouchMove",e.current.hideColumnMenu)},[e,r]),i=f.useCallback(u=>{const d=GB(e),p={open:!0,field:u};(p.open!==d.open||p.field!==d.field)&&(e.current.setState(m=>m.columnMenu.open&&m.columnMenu.field===u?m:(t.debug("Opening Column Menu"),o(),Se({},m,{columnMenu:{open:!0,field:u}}))),e.current.hidePreferences())},[e,t,o]),s=f.useCallback(()=>{const u=GB(e);if(u.field){const h=$b(e),m=x0(e),g=tb(e);let y=u.field;if(h[y]||(y=g[0]),m[y]===!1){const x=g.filter(b=>b===y?!0:m[b]!==!1),v=x.indexOf(y);y=x[v+1]||x[v-1]}e.current.setColumnHeaderFocus(y)}const d={open:!1,field:void 0};(d.open!==u.open||d.field!==u.field)&&e.current.setState(h=>(t.debug("Hiding Column Menu"),r(),Se({},h,{columnMenu:d})))},[e,t,r]),l=f.useCallback(u=>{t.debug("Toggle Column Menu");const d=GB(e);!d.open||d.field!==u?i(u):s()},[e,t,i,s]);oi(e,{showColumnMenu:i,hideColumnMenu:s,toggleColumnMenu:l},"public"),Nr(e,"columnResizeStart",s)},$5r=(e,t,n)=>{var o,i,s;n.current.caches.columns={lastColumnsProp:t.columns};const r=sP({apiRef:n,columnsToUpsert:t.columns,initialState:(o=t.initialState)==null?void 0:o.columns,columnVisibilityModel:t.columnVisibilityModel??((s=(i=t.initialState)==null?void 0:i.columns)==null?void 0:s.columnVisibilityModel)??{},keepOnlyColumnsToUpsert:!0});return Se({},e,{columns:r,pinnedColumns:e.pinnedColumns??PW})};function D5r(e,t){var I,_;const n=wf(e,"useGridColumns");e.current.registerControlState({stateId:"visibleColumns",propModel:t.columnVisibilityModel,propOnChange:t.onColumnVisibilityModelChange,stateSelector:x0,changeEvent:"columnVisibilityModelChange"});const r=f.useCallback(T=>{n.debug("Updating columns state."),e.current.setState(L5r(T)),e.current.publishEvent("columnsChange",T.orderedFields)},[n,e]),o=f.useCallback(T=>$b(e)[T],[e]),i=f.useCallback(()=>cg(e),[e]),s=f.useCallback(()=>yc(e),[e]),l=f.useCallback((T,P=!0)=>(P?yc(e):cg(e)).findIndex(M=>M.field===T),[e]),c=f.useCallback(T=>{const P=l(T);return y5(e)[P]},[e,l]),u=f.useCallback(T=>{var E,M;x0(e)!==T&&(e.current.setState(R=>Se({},R,{columns:sP({apiRef:e,columnsToUpsert:[],initialState:void 0,columnVisibilityModel:T,keepOnlyColumnsToUpsert:!1})})),(M=(E=e.current).updateRenderContext)==null||M.call(E))},[e]),d=f.useCallback(T=>{let P=T;if($I(e)){const M=[],R=[],$=nwe(e);if(T.forEach(D=>{$.has(D.field)?M.push(D):R.push(D)}),M.length>0&&e.current.updateNonPivotColumns(M),R.length===0)return;P=R}const E=sP({apiRef:e,columnsToUpsert:P,initialState:void 0,keepOnlyColumnsToUpsert:!1,updateInitialVisibilityModel:!0});r(E)},[e,r]),p=f.useCallback((T,P)=>{const E=x0(e),M=E[T]??!0;if(P!==M){const R=Se({},E,{[T]:P});e.current.setColumnVisibilityModel(R)}},[e]),h=f.useCallback(T=>tb(e).findIndex(E=>E===T),[e]),m=f.useCallback((T,P)=>{const E=tb(e),M=h(T);if(M===P)return;n.debug(`Moving column ${T} to index ${P}`);const R=[...E],$=R.splice(M,1)[0];R.splice(P,0,$),r(Se({},oy(e),{orderedFields:R}));const D={column:e.current.getColumn(T),targetIndex:e.current.getColumnIndexRelativeToVisibleColumns(T),oldIndex:M};e.current.publishEvent("columnIndexChange",D)},[e,n,r,h]),g=f.useCallback((T,P)=>{n.debug(`Updating column ${T} width to ${P}`);const E=oy(e),M=E.lookup[T],R=Se({},M,{width:P,hasBeenResized:!0});r(wpe(Se({},E,{lookup:Se({},E.lookup,{[T]:R})}),e.current.getRootDimensions())),e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(T),colDef:R,width:P})},[e,n,r]),y={getColumn:o,getAllColumns:i,getColumnIndex:l,getColumnPosition:c,getVisibleColumns:s,getColumnIndexRelativeToVisibleColumns:h,updateColumns:d,setColumnVisibilityModel:u,setColumnVisibility:p,setColumnWidth:g},x={setColumnIndex:m};oi(e,y,"public"),oi(e,x,t.signature===ry.DataGrid?"private":"public");const v=f.useCallback((T,P)=>{var z,V;const E={},M=x0(e);(!P.exportOnlyDirtyModels||t.columnVisibilityModel!=null||Object.keys(((V=(z=t.initialState)==null?void 0:z.columns)==null?void 0:V.columnVisibilityModel)??{}).length>0||Object.keys(M).length>0)&&(E.columnVisibilityModel=M),E.orderedFields=tb(e);const $=cg(e),D={};return $.forEach(B=>{if(B.hasBeenResized){const G={};wyt.forEach(H=>{let F=B[H];F===1/0&&(F=-1),G[H]=F}),D[B.field]=G}}),Object.keys(D).length>0&&(E.dimensions=D),Se({},T,{columns:E})},[e,t.columnVisibilityModel,(I=t.initialState)==null?void 0:I.columns]),b=f.useCallback((T,P)=>{const E=P.stateToRestore.columns,M=E==null?void 0:E.columnVisibilityModel;if(E==null)return T;const R=sP({apiRef:e,columnsToUpsert:[],initialState:E,columnVisibilityModel:M,keepOnlyColumnsToUpsert:!1});return E!=null&&e.current.setState($=>Se({},$,{columns:Se({},$.columns,{lookup:R.lookup,orderedFields:R.orderedFields,initialColumnVisibilityModel:R.initialColumnVisibilityModel})})),M!=null&&e.current.setState($=>Se({},$,{columns:Se({},$.columns,{columnVisibilityModel:M})})),E!=null&&e.current.publishEvent("columnsChange",R.orderedFields),T},[e]),w=f.useCallback((T,P)=>{var E;if(P===Td.columns){const M=t.slots.columnsPanel;return a.jsx(M,Se({},(E=t.slotProps)==null?void 0:E.columnsPanel))}return T},[t.slots.columnsPanel,(_=t.slotProps)==null?void 0:_.columnsPanel]),S=f.useCallback(T=>{const P=$I(e);return t.disableColumnSelector||P?T:[...T,"columnMenuColumnsItem"]},[t.disableColumnSelector,e]);Jl(e,"columnMenu",S),Jl(e,"exportState",v),Jl(e,"restoreState",b),Jl(e,"preferencePanel",w);const C=f.useRef(null);Nr(e,"viewportInnerSizeChange",T=>{if(C.current!==T.width){if(C.current=T.width,!yc(e).some(E=>E.flex&&E.flex>0))return;r(wpe(oy(e),e.current.getRootDimensions()))}});const j=f.useCallback(()=>{n.info("Columns pipe processing have changed, regenerating the columns");const T=sP({apiRef:e,columnsToUpsert:[],initialState:void 0,keepOnlyColumnsToUpsert:!1});r(T)},[e,n,r]);iwe(e,"hydrateColumns",j),f.useEffect(()=>{if(e.current.caches.columns.lastColumnsProp===t.columns)return;e.current.caches.columns.lastColumnsProp=t.columns,n.info(`GridColumns have changed, new length ${t.columns.length}`);const T=sP({apiRef:e,initialState:void 0,columnsToUpsert:t.columns,keepOnlyColumnsToUpsert:!0,updateInitialVisibilityModel:!0,columnVisibilityModel:t.columnVisibilityModel});r(T)},[n,e,r,t.columns,t.columnVisibilityModel]),f.useEffect(()=>{t.columnVisibilityModel!==void 0&&e.current.setColumnVisibilityModel(t.columnVisibilityModel)},[e,n,t.columnVisibilityModel])}function L5r(e){return t=>Se({},t,{columns:e})}const F5r=(e,t)=>{var n;return Se({},e,{density:((n=t.initialState)==null?void 0:n.density)??t.density??"standard"})},z5r=(e,t)=>{var l;const n=wf(e,"useDensity");e.current.registerControlState({stateId:"density",propModel:t.density,propOnChange:t.onDensityChange,stateSelector:fE,changeEvent:"densityChange"});const o={setDensity:no(c=>{fE(e)!==c&&(n.debug(`Set grid density to ${c}`),e.current.setState(d=>Se({},d,{density:c})))})};oi(e,o,"public");const i=f.useCallback((c,u)=>{var h;const d=fE(e);return!u.exportOnlyDirtyModels||t.density!=null||((h=t.initialState)==null?void 0:h.density)!=null?Se({},c,{density:d}):c},[e,t.density,(l=t.initialState)==null?void 0:l.density]),s=f.useCallback((c,u)=>{var p;const d=(p=u.stateToRestore)!=null&&p.density?u.stateToRestore.density:fE(e);return e.current.setState(h=>Se({},h,{density:d})),c},[e]);Jl(e,"exportState",i),Jl(e,"restoreState",s),f.useEffect(()=>{t.density&&e.current.setDensity(t.density)},[e,t.density])};function B5r(e,t="csv",n=document.title||"untitled"){const r=`${n}.${t}`;if("download"in HTMLAnchorElement.prototype){const o=URL.createObjectURL(e),i=document.createElement("a");i.href=o,i.download=r,i.click(),setTimeout(()=>{URL.revokeObjectURL(o)});return}throw new Error("MUI X: exportAs not supported.")}const Zyt=({apiRef:e,options:t})=>{const n=cg(e);return t.fields?t.fields.reduce((o,i)=>{const s=n.find(l=>l.field===i);return s&&o.push(s),o},[]):(t.allColumns?n:yc(e)).filter(o=>o.disableExport!==!0)},evt=({apiRef:e})=>{var c,u;const t=ryt(e),n=Mc(e),r=YY(e),o=t.filter(d=>n[d].type!=="footer"),i=f4(e),s=((c=i==null?void 0:i.top)==null?void 0:c.map(d=>d.id))||[],l=((u=i==null?void 0:i.bottom)==null?void 0:u.map(d=>d.id))||[];if(o.unshift(...s),o.push(...l),r>0){const d=ayt(e);return o.filter(p=>d.has(p))}return o},H5r=(e,t)=>{const n=wf(e,"useGridCsvExport"),r=t.ignoreValueFormatterDuringExport,o=(typeof r=="object"?r==null?void 0:r.csvExport:r)||!1,i=f.useCallback((u={})=>{n.debug("Get data as CSV");const d=Zyt({apiRef:e,options:u}),h=(u.getRowsToExport??evt)({apiRef:e});return A5r({columns:d,rowIds:h,csvOptions:{delimiter:u.delimiter||",",shouldAppendQuotes:u.shouldAppendQuotes??!0,includeHeaders:u.includeHeaders??!0,includeColumnGroupsHeaders:u.includeColumnGroupsHeaders??!0,escapeFormulas:u.escapeFormulas??!0},ignoreValueFormatter:o,apiRef:e})},[n,e,o]),s=f.useCallback(u=>{n.debug("Export data as CSV");const d=i(u),p=new Blob([u!=null&&u.utf8WithBom?new Uint8Array([239,187,191]):"",d],{type:"text/csv"});B5r(p,"csv",u==null?void 0:u.fileName)},[n,i]);oi(e,{getDataAsCsv:i,exportDataAsCsv:s},"public");const c=f.useCallback((u,d)=>{var p;return(p=d.csvOptions)!=null&&p.disableToolbarButton?u:[...u,{component:a.jsx(tIr,{options:d.csvOptions}),componentName:"csvExport"}]},[]);Jl(e,"exportMenu",c)};function V5r(e,t,n){const r=[],o=t.querySelectorAll("style, link[rel='stylesheet']");for(let i=0;i{l.addEventListener("load",()=>c())}))}e.head.appendChild(l)}return r}const YB=(e,t,n)=>{let r=e.paginationModel;const o=e.rowCount,i=(n==null?void 0:n.pageSize)??r.pageSize,s=(n==null?void 0:n.page)??r.page,l=cyt(o,i,s);n&&((n==null?void 0:n.page)!==r.page||(n==null?void 0:n.pageSize)!==r.pageSize)&&(r=n);const c=i===-1?0:CSr(r.page,l);return c!==r.page&&(r=Se({},r,{page:c})),dyt(r.pageSize,t),r},U5r=(e,t)=>{var S,C;const n=wf(e,"useGridPaginationModel"),r=Fn(e,k6),o=f.useRef(Sd(e)),i=Math.floor(t.rowHeight*r);e.current.registerControlState({stateId:"paginationModel",propModel:t.paginationModel,propOnChange:t.onPaginationModelChange,stateSelector:sf,changeEvent:"paginationModelChange"});const s=f.useCallback(N=>{const j=sf(e);N!==j.page&&(n.debug(`Setting page to ${N}`),e.current.setPaginationModel({page:N,pageSize:j.pageSize}))},[e,n]),l=f.useMemo(()=>py(s,0),[s]),c=f.useCallback(N=>{const j=sf(e);N!==j.pageSize&&(n.debug(`Setting page size to ${N}`),e.current.setPaginationModel({pageSize:N,page:j.page}))},[e,n]),u=f.useCallback(N=>{const j=sf(e);N!==j&&(n.debug("Setting 'paginationModel' to",N),e.current.setState(I=>Se({},I,{pagination:Se({},I.pagination,{paginationModel:YB(I.pagination,t.signature,N)})}),"setPaginationModel"))},[e,n,t.signature]);oi(e,{setPage:s,setPageSize:c,setPaginationModel:u},"public");const p=f.useCallback((N,j)=>{var T,P;const I=sf(e);return!j.exportOnlyDirtyModels||t.paginationModel!=null||((P=(T=t.initialState)==null?void 0:T.pagination)==null?void 0:P.paginationModel)!=null||I.page!==0&&I.pageSize!==SSr(t.autoPageSize)?Se({},N,{pagination:Se({},N.pagination,{paginationModel:I})}):N},[e,t.paginationModel,(C=(S=t.initialState)==null?void 0:S.pagination)==null?void 0:C.paginationModel,t.autoPageSize]),h=f.useCallback((N,j)=>{var _,T;const I=(_=j.stateToRestore.pagination)!=null&&_.paginationModel?Se({},uyt(t.autoPageSize),(T=j.stateToRestore.pagination)==null?void 0:T.paginationModel):sf(e);return e.current.setState(P=>Se({},P,{pagination:Se({},P.pagination,{paginationModel:YB(P.pagination,t.signature,I)})}),"stateRestorePreProcessing"),N},[e,t.autoPageSize,t.signature]);Jl(e,"exportState",p),Jl(e,"restoreState",h);const m=()=>{var j;const N=sf(e);(j=e.current.virtualScrollerRef)!=null&&j.current&&e.current.scrollToIndexes({rowIndex:N.page*N.pageSize})},g=f.useCallback(()=>{if(!t.autoPageSize)return;const N=e.current.getRootDimensions(),j=Math.max(1,Math.floor(N.viewportInnerSize.height/i));e.current.setPageSize(j)},[e,t.autoPageSize,i]),y=f.useCallback(N=>{if(N==null)return;const j=sf(e);if(j.page===0)return;const I=pyt(e);j.page>I-1&&queueMicrotask(()=>{l(Math.max(0,I-1))})},[e,l]),x=f.useCallback(()=>{sf(e).page!==0&&l(0),e.current.getScrollPosition().top!==0&&e.current.scroll({top:0})},[e,l]),v=f.useMemo(()=>py(x,0),[x]),b=f.useCallback(N=>{const j=Se({},N,{items:KY(e)});E0(j,o.current)||(o.current=j,v())},[e,v]);Nr(e,"viewportInnerSizeChange",g),Nr(e,"paginationModelChange",m),Nr(e,"rowCountChange",y),Nr(e,"sortModelChange",v),Nr(e,"filterModelChange",b);const w=f.useRef(!0);f.useEffect(()=>{if(w.current){w.current=!1;return}t.pagination&&e.current.setState(N=>Se({},N,{pagination:Se({},N.pagination,{paginationModel:YB(N.pagination,t.signature,t.paginationModel)})}))},[e,t.paginationModel,t.signature,t.pagination]),f.useEffect(()=>{e.current.setState(N=>{const j=t.pagination===!0;return N.pagination.paginationMode===t.paginationMode&&N.pagination.enabled===j?N:Se({},N,{pagination:Se({},N.pagination,{paginationMode:t.paginationMode,enabled:j})})})},[e,t.paginationMode,t.pagination]),f.useEffect(g,[g])};function W5r(){return new Promise(e=>{requestAnimationFrame(()=>{e()})})}function G5r(e){const t=document.createElement("iframe");return t.style.position="absolute",t.style.width="0px",t.style.height="0px",t.title=e||document.title,t}const q5r=(e,t)=>{const n=e.current.rootElementRef.current!==null,r=wf(e,"useGridPrintExport"),o=f.useRef(null),i=f.useRef(null),s=f.useRef({}),l=f.useRef([]),c=f.useRef(null);f.useEffect(()=>{o.current=Zl(e.current.rootElementRef.current)},[e,n]);const u=f.useCallback((x,v,b)=>new Promise(w=>{const S=Zyt({apiRef:e,options:{fields:x,allColumns:v}}).map(j=>j.field),C=cg(e),N={};C.forEach(j=>{N[j.field]=S.includes(j.field)}),b&&(N[m4.field]=!0),e.current.setColumnVisibilityModel(N),w()}),[e]),d=f.useCallback(x=>{const b=x({apiRef:e}).reduce((w,S)=>{const C=e.current.getRow(S);return C[RI]||w.push(C),w},[]);e.current.setRows(b)},[e]),p=f.useCallback((x,v)=>{var E,M;const b=Se({copyStyles:!0,hideToolbar:!1,hideFooter:!1,includeCheckboxes:!1},v),w=x.contentDocument;if(!w)return;const S=e.current.rootElementRef.current,C=S.cloneNode(!0),N=C.querySelector(`.${Be.virtualScrollerContent}`),j=C.querySelector(`.${Be.main}`);if(j.style.overflow="visible",C.querySelector(`.${Be.virtualScrollerRenderZone}`).style.position="static",N.style.flexBasis="auto",(E=C.querySelector(`.${Be["scrollbar--vertical"]}`))==null||E.remove(),!(N.nextSibling instanceof HTMLElement&&N.nextSibling.classList.contains(Be.filler))){const R=document.createElement("div");R.style.height=Ryt,N.insertAdjacentElement("afterend",R)}const I=C.querySelector(`.${Be.footerContainer}`);b.hideToolbar&&((M=C.querySelector(`.${Be.toolbar}`))==null||M.remove()),b.hideFooter&&I&&I.remove(),C.style.height="auto",C.style.boxSizing="content-box",!b.hideFooter&&I&&(I.style.width="100%");const _=document.createElement("div");_.appendChild(C),w.body.style.marginTop="0px",w.body.innerHTML=_.innerHTML;const T=typeof b.pageStyle=="function"?b.pageStyle():b.pageStyle;if(typeof T=="string"){const R=w.createElement("style");R.appendChild(w.createTextNode(T)),w.head.appendChild(R)}b.bodyClassName&&w.body.classList.add(...b.bodyClassName.split(" "));let P=[];if(b.copyStyles){const R=S.getRootNode(),$=R.constructor.name==="ShadowRoot"?R:o.current;P=V5r(w,$)}Promise.all(P).then(()=>{x.contentWindow.print()})},[e,o]),h=f.useCallback(x=>{var v,b;o.current.body.removeChild(x),e.current.restoreState(i.current||{}),(b=(v=i.current)==null?void 0:v.columns)!=null&&b.columnVisibilityModel||e.current.setColumnVisibilityModel(s.current),e.current.setState(w=>Se({},w,{virtualization:c.current})),e.current.setRows(l.current),i.current=null,s.current={},l.current=[]},[e]),g={exportDataAsPrint:f.useCallback(async x=>{if(r.debug("Export data as Print"),!e.current.rootElementRef.current)throw new Error("MUI X: No grid root element available.");if(i.current=e.current.exportState(),s.current=x0(e),l.current=e.current.getSortedRows().filter(b=>!b[RI]),t.pagination){const w={page:0,pageSize:Q1e(e)};e.current.setState(S=>Se({},S,{pagination:Se({},S.pagination,{paginationModel:YB(S.pagination,"DataGridPro",w)})}))}c.current=e.current.state.virtualization,e.current.unstable_setVirtualization(!1),await u(x==null?void 0:x.fields,x==null?void 0:x.allColumns,x==null?void 0:x.includeCheckboxes),d((x==null?void 0:x.getRowsToExport)??evt),await W5r();const v=G5r(x==null?void 0:x.fileName);v.onload=()=>{p(v,x),v.contentWindow.matchMedia("print").addEventListener("change",w=>{w.matches===!1&&h(v)})},o.current.body.appendChild(v)},[t,r,e,p,h,u,d])};oi(e,g,"public");const y=f.useCallback((x,v)=>{var b;return(b=v.printOptions)!=null&&b.disableToolbarButton?x:[...x,{component:a.jsx(nIr,{options:v.printOptions}),componentName:"printExport"}]},[]);Jl(e,"exportMenu",y)},K5r=(e,t,n)=>{var o,i;const r=t.filterModel??((i=(o=t.initialState)==null?void 0:o.filter)==null?void 0:i.filterModel)??gD();return Se({},e,{filter:Se({filterModel:W1e(r,t.disableMultipleColumnsFiltering,n)},zxt),visibleRowsLookup:{}})},Y5r=e=>e.filteredRowsLookup;function H7e(e,t){return e.current.applyStrategyProcessor("visibleRowsLookupCreation",{tree:t.rows.tree,filteredRowsLookup:t.filter.filteredRowsLookup})}function X5r(){return vge(Object.values)}const Q5r=(e,t,n)=>{var _,T,P;const r=wf(e,"useGridFilter");e.current.registerControlState({stateId:"filter",propModel:t.filterModel,propOnChange:t.onFilterModelChange,stateSelector:Sd,changeEvent:"filterModelChange"});const o=f.useCallback(()=>{e.current.setState(E=>{const M=Sd(e),R=e.current.getFilterState(M),$=Se({},E,{filter:Se({},E.filter,R)}),D=H7e(e,$);return Se({},$,{visibleRowsLookup:D})}),e.current.publishEvent("filteredRowsSet")},[e]),i=f.useCallback((E,M)=>M==null||M.filterable===!1||t.disableColumnFilter?E:[...E,"columnMenuFilterItem"],[t.disableColumnFilter]),s=f.useCallback(E=>{const M=Sd(e),R=[...M.items],$=R.findIndex(D=>D.id===E.id);$===-1?R.push(E):R[$]=E,e.current.setFilterModel(Se({},M,{items:R}),"upsertFilterItem")},[e]),l=f.useCallback(E=>{const M=Sd(e),R=[...M.items];E.forEach($=>{const D=R.findIndex(z=>z.id===$.id);D===-1?R.push($):R[D]=$}),e.current.setFilterModel(Se({},M,{items:R}),"upsertFilterItems")},[e]),c=f.useCallback(E=>{const M=Sd(e),R=M.items.filter($=>$.id!==E.id);R.length!==M.items.length&&e.current.setFilterModel(Se({},M,{items:R}),"deleteFilterItem")},[e]),u=f.useCallback((E,M,R)=>{if(r.debug("Displaying filter panel"),E){const $=Sd(e),D=$.items.filter(G=>{var U;if(G.value!==void 0)return!(Array.isArray(G.value)&&G.value.length===0);const F=(U=e.current.getColumn(G.field).filterOperators)==null?void 0:U.find(K=>K.value===G.operator);return!(typeof(F==null?void 0:F.requiresFilterValue)>"u"?!0:F==null?void 0:F.requiresFilterValue)});let z;const V=D.find(G=>G.field===E),B=e.current.getColumn(E);V?z=D:t.disableMultipleColumnsFiltering?z=[bpe({field:E,operator:B.filterOperators[0].value},e)]:z=[...D,bpe({field:E,operator:B.filterOperators[0].value},e)],e.current.setFilterModel(Se({},$,{items:z}))}e.current.showPreferences(Td.filters,M,R)},[e,r,t.disableMultipleColumnsFiltering]),d=f.useCallback(()=>{r.debug("Hiding filter panel"),e.current.hidePreferences()},[e,r]),p=f.useCallback(E=>{const M=Sd(e);M.logicOperator!==E&&e.current.setFilterModel(Se({},M,{logicOperator:E}),"changeLogicOperator")},[e]),h=f.useCallback(E=>{const M=Sd(e);E0(M.quickFilterValues,E)||e.current.setFilterModel(Se({},M,{quickFilterValues:[...E]}))},[e]),m=f.useCallback((E,M)=>{Sd(e)!==E&&(r.debug("Setting filter model"),e.current.updateControlState("filter",a7e(E,t.disableMultipleColumnsFiltering,e),M),e.current.unstable_applyFilters())},[e,r,t.disableMultipleColumnsFiltering]),g=f.useCallback(E=>{const M=W1e(E,t.disableMultipleColumnsFiltering,e),R=n.hooks.useFilterValueGetter(e,t),$=t.filterMode==="client"?xwr(M,R,e,t.disableEval):null,D=e.current.applyStrategyProcessor("filtering",{isRowMatchingFilters:$,filterModel:M??gD(),filterValueGetter:R});return Se({},D,{filterModel:M})},[e,n.hooks,t]),y={setFilterLogicOperator:p,unstable_applyFilters:o,deleteFilterItem:c,upsertFilterItem:s,upsertFilterItems:l,setFilterModel:m,showFilterPanel:u,hideFilterPanel:d,setQuickFilterValues:h,ignoreDiacritics:t.ignoreDiacritics,getFilterState:g};oi(e,y,"public");const x=f.useCallback((E,M)=>{var D,z;const R=Sd(e);return R.items.forEach(V=>{delete V.fromInput}),!M.exportOnlyDirtyModels||t.filterModel!=null||((z=(D=t.initialState)==null?void 0:D.filter)==null?void 0:z.filterModel)!=null||!E0(R,gD())?Se({},E,{filter:{filterModel:R}}):E},[e,t.filterModel,(T=(_=t.initialState)==null?void 0:_.filter)==null?void 0:T.filterModel]),v=f.useCallback((E,M)=>{var $;const R=($=M.stateToRestore.filter)==null?void 0:$.filterModel;return R==null?E:(e.current.updateControlState("filter",a7e(R,t.disableMultipleColumnsFiltering,e),"restoreState"),Se({},E,{callbacks:[...E.callbacks,e.current.unstable_applyFilters]}))},[e,t.disableMultipleColumnsFiltering]),b=f.useCallback((E,M)=>{var R;if(M===Td.filters){const $=t.slots.filterPanel;return a.jsx($,Se({},(R=t.slotProps)==null?void 0:R.filterPanel))}return E},[t.slots.filterPanel,(P=t.slotProps)==null?void 0:P.filterPanel]),{getRowId:w}=t,S=gm(X5r),C=f.useCallback(E=>{var H;if(t.filterMode!=="client"||!E.isRowMatchingFilters||!E.filterModel.items.length&&!((H=E.filterModel.quickFilterValues)!=null&&H.length))return zxt;const M=rg(e),R={},{isRowMatchingFilters:$}=E,D={},z={passingFilterItems:null,passingQuickFilterValues:null},V=S.current(e.current.state.rows.dataRowIdToModelLookup);for(let F=0;F{r.debug("onColUpdated - GridColumns changed, applying filters");const E=Sd(e),M=$b(e),R=E.items.filter($=>$.field&&M[$.field]);R.length{E==="filtering"&&e.current.unstable_applyFilters()},[e]),I=f.useCallback(()=>{e.current.setState(E=>Se({},E,{visibleRowsLookup:H7e(e,E)}))},[e]);Nr(e,"rowsSet",o),Nr(e,"columnsChange",N),Nr(e,"activeStrategyProcessorChange",j),Nr(e,"rowExpansionChange",I),Nr(e,"columnVisibilityModelChange",()=>{var M;const E=Sd(e);(M=E.quickFilterValues)!=null&&M.length&&Kxt(E)&&o()}),b5(()=>{t.signature==="DataGrid"&&o()}),Ia(()=>{t.filterModel!==void 0&&e.current.setFilterModel(t.filterModel)},[e,r,t.filterModel])},J5r=e=>Se({},e,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},tabIndex:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}),Z5r=(e,t)=>{const n=wf(e,"useGridFocus"),r=f.useRef(null),o=e.current.rootElementRef.current!==null,i=f.useCallback((_,T)=>{_&&e.current.getRow(_.id)&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(_.id,_.field),T)},[e]),s=f.useCallback((_,T)=>{const P=em(e);if((P==null?void 0:P.id)===_&&(P==null?void 0:P.field)===T){if(e.current.getCellMode(_,T)!=="view")return;const E=e.current.getCellElement(_,T);if(!E)return;const M=Zl(e.current.rootElementRef.current);if(E.contains(M.activeElement))return;if(tX())E.focus({preventScroll:!0});else{const R=e.current.getScrollPosition();E.focus(),e.current.scroll(R)}return}e.current.setState(E=>(n.debug(`Focusing on cell with id=${_} and field=${T}`),Se({},E,{tabIndex:{cell:{id:_,field:T},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null},focus:{cell:{id:_,field:T},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))),e.current.getRow(_)&&(P&&i(P,{}),e.current.publishEvent("cellFocusIn",e.current.getCellParams(_,T)))},[e,n,i]),l=f.useCallback((_,T={})=>{const P=em(e);i(P,T),e.current.setState(E=>(n.debug(`Focusing on column header with colIndex=${_}`),Se({},E,{tabIndex:{columnHeader:{field:_},columnHeaderFilter:null,cell:null,columnGroupHeader:null},focus:{columnHeader:{field:_},columnHeaderFilter:null,cell:null,columnGroupHeader:null}})))},[e,n,i]),c=f.useCallback((_,T={})=>{const P=em(e);i(P,T),e.current.setState(E=>(n.debug(`Focusing on column header filter with colIndex=${_}`),Se({},E,{tabIndex:{columnHeader:null,columnHeaderFilter:{field:_},cell:null,columnGroupHeader:null},focus:{columnHeader:null,columnHeaderFilter:{field:_},cell:null,columnGroupHeader:null}})))},[e,n,i]),u=f.useCallback((_,T,P={})=>{const E=em(e);E&&e.current.publishEvent("cellFocusOut",e.current.getCellParams(E.id,E.field),P),e.current.setState(M=>Se({},M,{tabIndex:{columnGroupHeader:{field:_,depth:T},columnHeader:null,columnHeaderFilter:null,cell:null},focus:{columnGroupHeader:{field:_,depth:T},columnHeader:null,columnHeaderFilter:null,cell:null}}))},[e]),d=f.useCallback(()=>AW(e),[e]),p=f.useCallback((_,T,P)=>{let E=e.current.getColumnIndex(T);const M=yc(e),R=jA(e,{pagination:t.pagination,paginationMode:t.paginationMode}),$=f4(e),D=[].concat($.top||[],R.rows,$.bottom||[]);let z=D.findIndex(H=>H.id===_);P==="right"?E+=1:P==="left"?E-=1:z+=1,E>=M.length?(z+=1,z=0&&(E=M.length-1)),z=GE(z,0,D.length-1);const V=D[z];if(!V)return;const B=e.current.unstable_getCellColSpanInfo(V.id,E);B&&B.spannedByColSpan&&(P==="left"||P==="below"?E=B.leftVisibleCellIndex:P==="right"&&(E=B.rightVisibleCellIndex)),E=GE(E,0,M.length-1);const G=M[E];e.current.setCellFocus(V.id,G.field)},[e,t.pagination,t.paginationMode]),h=f.useCallback(({id:_,field:T})=>{e.current.setCellFocus(_,T)},[e]),m=f.useCallback((_,T)=>{G1e(T)||T.key==="Enter"||T.key==="Tab"||T.key==="Shift"||qP(T.key)||e.current.setCellFocus(_.id,_.field)},[e]),g=f.useCallback(({field:_},T)=>{T.target===T.currentTarget&&e.current.setColumnHeaderFocus(_,T)},[e]),y=f.useCallback(({fields:_,depth:T},P)=>{if(P.target!==P.currentTarget)return;const E=AW(e);E!==null&&E.depth===T&&_.includes(E.field)||e.current.setColumnGroupHeaderFocus(_[0],T,P)},[e]),x=f.useCallback((_,T)=>{var P,E;(E=(P=T.relatedTarget)==null?void 0:P.getAttribute("class"))!=null&&E.includes(Be.columnHeader)||(n.debug("Clearing focus"),e.current.setState(M=>Se({},M,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})))},[n,e]),v=f.useCallback(_=>{r.current=_},[]),b=f.useCallback(_=>{const T=r.current;r.current=null;const P=em(e);if(!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:_,cell:T}))return;if(!P){T&&e.current.setCellFocus(T.id,T.field);return}if((T==null?void 0:T.id)===P.id&&(T==null?void 0:T.field)===P.field)return;const M=e.current.getCellElement(P.id,P.field);M!=null&&M.contains(_.target)||(T?e.current.setCellFocus(T.id,T.field):(e.current.setState(R=>Se({},R,{focus:{cell:null,columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}})),i(P,_)))},[e,i]),w=f.useCallback(_=>{if(_.cellMode==="view")return;const T=em(e);((T==null?void 0:T.id)!==_.id||(T==null?void 0:T.field)!==_.field)&&e.current.setCellFocus(_.id,_.field)},[e]),S=f.useCallback(()=>{const _=em(e);if(_&&!e.current.getRow(_.id)){const T=_.id;let P=null;if(typeof T<"u"){const E=e.current.getRowElement(T),M=E!=null&&E.dataset.rowindex?Number(E==null?void 0:E.dataset.rowindex):0,R=jA(e,{pagination:t.pagination,paginationMode:t.paginationMode}),$=R.rows[GE(M,0,R.rows.length-1)];P=($==null?void 0:$.id)??null}e.current.setState(E=>Se({},E,{focus:{cell:P===null?null:{id:P,field:_.field},columnHeader:null,columnHeaderFilter:null,columnGroupHeader:null}}))}},[e,t.pagination,t.paginationMode]),C=f.useMemo(()=>py(S,0),[S]),N=no(()=>{const _=em(e);if(!_)return;const T=jA(e,{pagination:t.pagination,paginationMode:t.paginationMode});if(T.rows.find(M=>M.id===_.id)||T.rows.length===0)return;const E=yc(e);e.current.setState(M=>Se({},M,{tabIndex:{cell:{id:T.rows[0].id,field:E[0].field},columnGroupHeader:null,columnHeader:null,columnHeaderFilter:null}}))}),j={setCellFocus:s,setColumnHeaderFocus:l,setColumnHeaderFilterFocus:c},I={moveFocusToRelativeCell:p,setColumnGroupHeaderFocus:u,getColumnGroupHeaderFocus:d};oi(e,j,"public"),oi(e,I,"private"),f.useEffect(()=>{const _=Zl(e.current.rootElementRef.current);return _.addEventListener("mouseup",b),()=>{_.removeEventListener("mouseup",b)}},[e,o,b]),Nr(e,"columnHeaderBlur",x),Nr(e,"cellDoubleClick",h),Nr(e,"cellMouseDown",v),Nr(e,"cellKeyDown",m),Nr(e,"cellModeChange",w),Nr(e,"columnHeaderFocus",g),Nr(e,"columnGroupHeaderFocus",y),Nr(e,"rowsSet",C),Nr(e,"paginationModelChange",N)},Xne=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(et)return e-1;return null},Qne=({currentColIndex:e,firstColIndex:t,lastColIndex:n,isRtl:r})=>{if(r){if(e>t)return e-1}else if(!r&&e=0&&s(t.top||[]).concat(e.rows,t.bottom||[])),n_r=(e,t)=>{const n=wf(e,"useGridKeyboardNavigation"),r=$d(),o=f.useCallback(()=>t_r(e),[e]),i=t.signature!=="DataGrid"&&t.headerFilters,s=f.useCallback((x,v,b="left",w="up")=>{const S=v5(e),C=e.current.unstable_getCellColSpanInfo(v,x);C&&C.spannedByColSpan&&(b==="left"?x=C.leftVisibleCellIndex:b==="right"&&(x=C.rightVisibleCellIndex));const N=M6(e)[x],j=e_r(e,v,x,w),I=S.findIndex(_=>_.id===j);n.debug(`Navigating to cell row ${I}, col ${x}`),e.current.scrollToIndexes({colIndex:x,rowIndex:I}),e.current.setCellFocus(j,N)},[e,n]),l=f.useCallback((x,v)=>{n.debug(`Navigating to header col ${x}`),e.current.scrollToIndexes({colIndex:x});const b=e.current.getVisibleColumns()[x].field;e.current.setColumnHeaderFocus(b,v)},[e,n]),c=f.useCallback((x,v)=>{n.debug(`Navigating to header filter col ${x}`),e.current.scrollToIndexes({colIndex:x});const b=e.current.getVisibleColumns()[x].field;e.current.setColumnHeaderFilterFocus(b,v)},[e,n]),u=f.useCallback((x,v,b)=>{n.debug(`Navigating to header col ${x}`),e.current.scrollToIndexes({colIndex:x});const{field:w}=e.current.getVisibleColumns()[x];e.current.setColumnGroupHeaderFocus(w,v,b)},[e,n]),d=f.useCallback(x=>{var v;return(v=o()[x])==null?void 0:v.id},[o]),p=f.useCallback((x,v)=>{const b=v.currentTarget.querySelector(`.${Be.columnHeaderTitleContainerContent}`);if(!!b&&b.contains(v.target)&&x.field!==m4.field||!qP(v.key)&&v.key!=="Tab"&&v.key!=="Enter"||v.key==="Tab"&&(t.tabNavigation==="none"||t.tabNavigation==="content"&&v.shiftKey))return;const S=o(),C=e.current.getViewportPageSize(),N=x.field?e.current.getColumnIndex(x.field):0,j=S.length>0?0:null,I=S.length>0?S.length-1:null,_=0,T=Math.max(0,yc(e).length-1),P=L6(e);let E=!0;if(v.key==="Tab"&&t.tabNavigation==="content"&&!v.shiftKey){j!==null&&(s(_,d(j)),v.preventDefault());return}switch(v.key){case"ArrowDown":{i?c(N,v):j!==null&&s(N,d(j));break}case"ArrowRight":{const M=Qne({currentColIndex:N,firstColIndex:_,lastColIndex:T,isRtl:r});M!==null&&l(M,v);break}case"ArrowLeft":{const M=Xne({currentColIndex:N,firstColIndex:_,lastColIndex:T,isRtl:r});M!==null&&l(M,v);break}case"ArrowUp":{P>0&&u(N,P-1,v);break}case"PageDown":{j!==null&&I!==null&&s(N,d(Math.min(j+C,I)));break}case"Home":{l(_,v);break}case"End":{l(T,v);break}case"Enter":{(v.ctrlKey||v.metaKey)&&e.current.toggleColumnMenu(x.field);break}case"Tab":{v.shiftKey?N===_?P>0?u(T,P-1,v):E=!1:l(N-1,v):N===T?i?c(_,v):t.tabNavigation==="all"&&j!==null?s(_,d(j)):E=!1:l(N+1,v);break}case" ":break;default:E=!1}E&&v.preventDefault()},[e,t.tabNavigation,o,i,c,s,d,r,l,u]),h=f.useCallback((x,v)=>{const b=o2r(e)===x.field;if(i2r(e)===x.field||b&&v.key!=="Tab"||!qP(v.key)&&v.key!=="Tab"||v.key==="Tab"&&(t.tabNavigation==="none"||t.tabNavigation==="content"&&v.shiftKey))return;const S=o(),C=e.current.getViewportPageSize(),N=x.field?e.current.getColumnIndex(x.field):0,j=S.length>0?0:null,I=S.length>0?S.length-1:null,_=0,T=Math.max(0,yc(e).length-1);let P=!0;if(v.key==="Tab"&&t.tabNavigation==="content"&&!v.shiftKey){j!==null&&(s(_,d(j)),v.preventDefault());return}switch(v.key){case"ArrowDown":{j!==null&&s(N,d(j));break}case"ArrowRight":{const E=Qne({currentColIndex:N,firstColIndex:_,lastColIndex:T,isRtl:r});E!==null&&c(E,v);break}case"ArrowLeft":{const E=Xne({currentColIndex:N,firstColIndex:_,lastColIndex:T,isRtl:r});E!==null?c(E,v):e.current.setColumnHeaderFilterFocus(x.field,v);break}case"ArrowUp":{l(N,v);break}case"PageDown":{j!==null&&I!==null&&s(N,d(Math.min(j+C,I)));break}case"Home":{c(_,v);break}case"End":{c(T,v);break}case"Tab":{v.shiftKey?N===_?l(T,v):c(N-1,v):N===T?t.tabNavigation==="all"&&j!==null?s(_,d(j)):P=!1:c(N+1,v);break}case" ":break;default:P=!1}P&&v.preventDefault()},[e,t.tabNavigation,o,c,r,l,s,d]),m=f.useCallback((x,v)=>{const b=AW(e);if(b===null)return;const{field:w,depth:S}=b,{fields:C,depth:N,maxDepth:j}=x;if(!qP(v.key)&&v.key!=="Tab"||v.key==="Tab"&&(t.tabNavigation==="none"||t.tabNavigation==="content"&&v.shiftKey))return;const I=o(),_=e.current.getViewportPageSize(),T=e.current.getColumnIndex(w),P=w?e.current.getColumnIndex(w):0,E=I.length>0?0:null,M=I.length>0?I.length-1:null,R=0,$=Math.max(0,yc(e).length-1);let D=!0;if(v.key==="Tab"&&t.tabNavigation==="content"&&!v.shiftKey){E!==null&&(s(R,d(E)),v.preventDefault());return}switch(v.key){case"ArrowDown":{N===j-1?l(T,v):u(T,S+1,v);break}case"ArrowUp":{N>0&&u(T,S-1,v);break}case"ArrowRight":{const z=C.length-C.indexOf(w)-1;T+z+1<=$&&u(T+z+1,S,v);break}case"ArrowLeft":{const z=C.indexOf(w);T-z-1>=R&&u(T-z-1,S,v);break}case"PageDown":{E!==null&&M!==null&&s(P,d(Math.min(E+_,M)));break}case"Home":{u(R,S,v);break}case"End":{u($,S,v);break}case"Tab":{if(v.shiftKey){const z=C.indexOf(w),V=T-z-1;V$&&N===j-1?l(R,v):V>$?u(R,S+1,v):u(V,S,v)}break}case" ":break;default:D=!1}D&&v.preventDefault()},[e,t.tabNavigation,o,l,u,s,d]),g=f.useCallback((x,v)=>{if(z6(v))return;const b=e.current.getCellParams(x.id,x.field);if(b.cellMode===Da.Edit||!qP(v.key)&&v.key!=="Tab"||v.key==="Tab"&&(t.tabNavigation==="none"||t.tabNavigation==="header"&&!v.shiftKey)||!e.current.unstable_applyPipeProcessors("canUpdateFocus",!0,{event:v,cell:b}))return;const S=o();if(S.length===0)return;const C=i?c:l,N=e.current.getViewportPageSize(),j=x.field?e.current.getColumnIndex(x.field):0,I=S.findIndex(R=>R.id===x.id),_=0,T=S.length-1,P=0,E=Math.max(0,yc(e).length-1);let M=!0;if(v.key==="Tab"&&t.tabNavigation==="header"&&v.shiftKey){C(E,v),v.preventDefault();return}switch(v.key){case"ArrowDown":{I_?s(j,d(I-1)):C(j,v);break}case"ArrowRight":{const R=Qne({currentColIndex:j,firstColIndex:P,lastColIndex:E,isRtl:r});R!==null&&s(R,d(I),r?"left":"right");break}case"ArrowLeft":{const R=Xne({currentColIndex:j,firstColIndex:P,lastColIndex:E,isRtl:r});R!==null&&s(R,d(I),r?"right":"left");break}case"Tab":{v.shiftKey?j===P&&I===_?t.tabNavigation==="all"?C(E,v):M=!1:j===P?s(E,d(I-1)):s(j-1,d(I),"left"):j===E?I!==T?s(P,d(I+1)):M=!1:s(j+1,d(I),"right");break}case" ":{if(x.field===K1e)break;const $=x.colDef;if($&&($.field===zwr||sNr($.field)))break;!v.shiftKey&&I=_?s(j,d(R)):l(j,v);break}case"Home":{v.ctrlKey||v.metaKey||v.shiftKey?s(P,d(_)):s(P,d(I));break}case"End":{v.ctrlKey||v.metaKey||v.shiftKey?s(E,d(T)):s(E,d(I));break}default:M=!1}M&&v.preventDefault()},[e,t.tabNavigation,o,r,s,d,i,c,l]),y=f.useCallback((x,{event:v})=>v.key===" "?!1:x,[]);Jl(e,"canStartEditing",y),Nr(e,"columnHeaderKeyDown",p),Nr(e,"headerFilterKeyDown",h),Nr(e,"columnGroupHeaderKeyDown",m),Nr(e,"cellKeyDown",g)},r_r=(e,t)=>{var u,d;const n=wf(e,"useGridRowCount"),r=gm(()=>sf(e).pageSize);e.current.registerControlState({stateId:"paginationRowCount",propModel:t.rowCount,propOnChange:t.onRowCountChange,stateSelector:c2,changeEvent:"rowCountChange"});const i={setRowCount:f.useCallback(p=>{c2(e)!==p&&(n.debug("Setting 'rowCount' to",p),e.current.setState(m=>Se({},m,{pagination:Se({},m.pagination,{rowCount:p})})))},[e,n])};oi(e,i,"public");const s=f.useCallback((p,h)=>{var y,x;const m=c2(e);return!h.exportOnlyDirtyModels||t.rowCount!=null||((x=(y=t.initialState)==null?void 0:y.pagination)==null?void 0:x.rowCount)!=null?Se({},p,{pagination:Se({},p.pagination,{rowCount:m})}):p},[e,t.rowCount,(d=(u=t.initialState)==null?void 0:u.pagination)==null?void 0:d.rowCount]),l=f.useCallback((p,h)=>{var g;const m=(g=h.stateToRestore.pagination)!=null&&g.rowCount?h.stateToRestore.pagination.rowCount:c2(e);return e.current.setState(y=>Se({},y,{pagination:Se({},y.pagination,{rowCount:m})})),p},[e]);Jl(e,"exportState",s),Jl(e,"restoreState",l);const c=f.useCallback(p=>{t.paginationMode==="client"||!r.current||p.pageSize!==r.current&&(r.current=p.pageSize,c2(e)===-1&&e.current.setPage(0))},[t.paginationMode,r,e]);Nr(e,"paginationModelChange",c),f.useEffect(()=>{t.paginationMode==="server"&&t.rowCount!=null&&e.current.setRowCount(t.rowCount)},[e,t.paginationMode,t.rowCount]),WE(e.current.store,()=>{if(WR(e).hasNextPage===!1)return!0;if(t.paginationMode==="client")return QO(e)},(p,h)=>{if(h===!0&&c2(e)!==-1){const m=QO(e),g=sf(e);e.current.setRowCount(g.pageSize*g.page+m)}else typeof h=="number"&&e.current.setRowCount(h)}),f.useEffect(()=>{t.paginationMode==="client"&&e.current.setRowCount(QO(e))},[e,t.paginationMode])},o_r=(e,t)=>{var l,c;const n=wf(e,"useGridPaginationMeta");e.current.registerControlState({stateId:"paginationMeta",propModel:t.paginationMeta,propOnChange:t.onPaginationMetaChange,stateSelector:WR,changeEvent:"paginationMetaChange"});const o={setPaginationMeta:f.useCallback(u=>{WR(e)!==u&&(n.debug("Setting 'paginationMeta' to",u),e.current.setState(p=>Se({},p,{pagination:Se({},p.pagination,{meta:u})})))},[e,n])};oi(e,o,"public");const i=f.useCallback((u,d)=>{var m,g;const p=WR(e);return!d.exportOnlyDirtyModels||t.paginationMeta!=null||((g=(m=t.initialState)==null?void 0:m.pagination)==null?void 0:g.meta)!=null?Se({},u,{pagination:Se({},u.pagination,{meta:p})}):u},[e,t.paginationMeta,(c=(l=t.initialState)==null?void 0:l.pagination)==null?void 0:c.meta]),s=f.useCallback((u,d)=>{var h;const p=(h=d.stateToRestore.pagination)!=null&&h.meta?d.stateToRestore.pagination.meta:WR(e);return e.current.setState(m=>Se({},m,{pagination:Se({},m.pagination,{meta:p})})),u},[e]);Jl(e,"exportState",i),Jl(e,"restoreState",s),f.useEffect(()=>{t.paginationMeta&&e.current.setPaginationMeta(t.paginationMeta)},[e,t.paginationMeta])},i_r=(e,t)=>{var i,s,l,c,u,d,p;const n=Se({},uyt(t.autoPageSize),t.paginationModel??((s=(i=t.initialState)==null?void 0:i.pagination)==null?void 0:s.paginationModel));dyt(n.pageSize,t.signature);const r=t.rowCount??((c=(l=t.initialState)==null?void 0:l.pagination)==null?void 0:c.rowCount)??(t.paginationMode==="client"?(u=e.rows)==null?void 0:u.totalRowCount:void 0),o=t.paginationMeta??((p=(d=t.initialState)==null?void 0:d.pagination)==null?void 0:p.meta)??{};return Se({},e,{pagination:Se({},e.pagination,{paginationModel:n,rowCount:r,meta:o,enabled:t.pagination===!0,paginationMode:t.paginationMode})})},a_r=(e,t)=>{o_r(e,t),U5r(e,t),r_r(e,t)},s_r=(e,t)=>{var n;return Se({},e,{preferencePanel:((n=t.initialState)==null?void 0:n.preferencePanel)??{open:!1}})},l_r=(e,t)=>{var l;const n=wf(e,"useGridPreferencesPanel"),r=f.useCallback(()=>{e.current.setState(c=>{if(!c.preferencePanel.open)return c;n.debug("Hiding Preferences Panel");const u=Pw(e);return e.current.publishEvent("preferencePanelClose",{openedPanelValue:u.openedPanelValue}),Se({},c,{preferencePanel:{open:!1}})})},[e,n]),o=f.useCallback((c,u,d)=>{n.debug("Opening Preferences Panel"),e.current.setState(p=>Se({},p,{preferencePanel:Se({},p.preferencePanel,{open:!0,openedPanelValue:c,panelId:u,labelId:d})})),e.current.publishEvent("preferencePanelOpen",{openedPanelValue:c})},[n,e]);oi(e,{showPreferences:o,hidePreferences:r},"public");const i=f.useCallback((c,u)=>{var h;const d=Pw(e);return!u.exportOnlyDirtyModels||((h=t.initialState)==null?void 0:h.preferencePanel)!=null||d.open?Se({},c,{preferencePanel:d}):c},[e,(l=t.initialState)==null?void 0:l.preferencePanel]),s=f.useCallback((c,u)=>{const d=u.stateToRestore.preferencePanel;return d!=null&&e.current.setState(p=>Se({},p,{preferencePanel:d})),c},[e]);Jl(e,"exportState",i),Jl(e,"restoreState",s)},Epe=e=>{switch(e.type){case"boolean":return!1;case"date":case"dateTime":case"number":return;case"singleSelect":return null;case"string":default:return""}},c_r=["id","field"],u_r=["id","field"],d_r=(e,t)=>{const[n,r]=f.useState({}),o=f.useRef(n),i=f.useRef({}),{processRowUpdate:s,onProcessRowUpdateError:l,cellModesModel:c,onCellModesModelChange:u}=t,d=$=>(...D)=>{t.editMode===bb.Cell&&$(...D)},p=f.useCallback(($,D)=>{const z=e.current.getCellParams($,D);if(!e.current.isCellEditable(z))throw new Error(`MUI X: The cell with id=${$} and field=${D} is not editable.`)},[e]),h=f.useCallback(($,D,z)=>{if(e.current.getCellMode($,D)!==z)throw new Error(`MUI X: The cell with id=${$} and field=${D} is not in ${z} mode.`)},[e]),m=f.useCallback(($,D)=>{if(!$.isEditable||$.cellMode===Da.Edit)return;const z=Se({},$,{reason:y1.cellDoubleClick});e.current.publishEvent("cellEditStart",z,D)},[e]),g=f.useCallback(($,D)=>{if($.cellMode===Da.View||e.current.getCellMode($.id,$.field)===Da.View)return;const z=Se({},$,{reason:Ax.cellFocusOut});e.current.publishEvent("cellEditStop",z,D)},[e]),y=f.useCallback(($,D)=>{if($.cellMode===Da.Edit){if(D.which===229)return;let z;if(D.key==="Escape"?z=Ax.escapeKeyDown:D.key==="Enter"?z=Ax.enterKeyDown:D.key==="Tab"&&(z=D.shiftKey?Ax.shiftTabKeyDown:Ax.tabKeyDown,D.preventDefault()),z){const V=Se({},$,{reason:z});e.current.publishEvent("cellEditStop",V,D)}}else if($.isEditable){let z;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:D,cellParams:$,editMode:"cell"}))return;if(Yxt(D)?z=y1.printableKeyDown:G1e(D)?z=y1.pasteKeyDown:D.key==="Enter"?(z=y1.enterKeyDown,D.preventDefault()):(D.key==="Backspace"||D.key==="Delete")&&(z=y1.deleteKeyDown),z){const B=Se({},$,{reason:z,key:D.key});e.current.publishEvent("cellEditStart",B,D)}}},[e]),x=f.useCallback($=>{const{id:D,field:z,reason:V}=$,B={id:D,field:z};(V===y1.printableKeyDown||V===y1.deleteKeyDown||V===y1.pasteKeyDown)&&(B.deleteValue=!0),e.current.startCellEditMode(B)},[e]),v=f.useCallback($=>{const{id:D,field:z,reason:V}=$;e.current.runPendingEditCellValueMutation(D,z);let B;V===Ax.enterKeyDown?B="below":V===Ax.tabKeyDown?B="right":V===Ax.shiftTabKeyDown&&(B="left");const G=V==="escapeKeyDown";e.current.stopCellEditMode({id:D,field:z,ignoreModifications:G,cellToFocusAfter:B})},[e]),b=$=>async(...D)=>{var z;if($){const{id:V,field:B}=D[0];((z=e.current.state.editRows[V][B])==null?void 0:z.error)||$(...D)}};Nr(e,"cellDoubleClick",d(m)),Nr(e,"cellFocusOut",d(g)),Nr(e,"cellKeyDown",d(y)),Nr(e,"cellEditStart",d(x)),Nr(e,"cellEditStop",d(v)),Ss(e,"cellEditStart",t.onCellEditStart),Ss(e,"cellEditStop",b(t.onCellEditStop));const w=f.useCallback(($,D)=>{const z=Ed(e);return z[$]&&z[$][D]?Da.Edit:Da.View},[e]),S=no($=>{const D=$!==t.cellModesModel;u&&D&&u($,{api:e.current}),!(t.cellModesModel&&D)&&(r($),o.current=$,e.current.publishEvent("cellModesModelChange",$))}),C=f.useCallback(($,D,z)=>{const V=Se({},o.current);if(z!==null)V[$]=Se({},V[$],{[D]:Se({},z)});else{const B=V[$],G=Zn(B,[D].map(yI));V[$]=G,Object.keys(V[$]).length===0&&delete V[$]}S(V)},[S]),N=f.useCallback(($,D,z)=>{e.current.setState(V=>{const B=Se({},V.editRows);return z!==null?B[$]=Se({},B[$],{[D]:Se({},z)}):(delete B[$][D],Object.keys(B[$]).length===0&&delete B[$]),Se({},V,{editRows:B})})},[e]),j=f.useCallback($=>{const{id:D,field:z}=$,V=Zn($,c_r);p(D,z),h(D,z,Da.View),C(D,z,Se({mode:Da.Edit},V))},[p,h,C]),I=no(async $=>{const{id:D,field:z,deleteValue:V,initialValue:B}=$,G=e.current.getCellValue(D,z);let H=G;V?H=Epe(e.current.getColumn(z)):B&&(H=B);const F=e.current.getColumn(z),W=!!F.preProcessEditCellProps&&V;let U={value:H,error:!1,isProcessingProps:W};if(N(D,z,U),e.current.setCellFocus(D,z),W&&(U=await Promise.resolve(F.preProcessEditCellProps({id:D,row:e.current.getRow(D),props:U,hasChanged:H!==G})),e.current.getCellMode(D,z)===Da.Edit)){const K=Ed(e);N(D,z,Se({},U,{value:K[D][z].value,isProcessingProps:!1}))}}),_=f.useCallback($=>{const{id:D,field:z}=$,V=Zn($,u_r);h(D,z,Da.Edit),C(D,z,Se({mode:Da.View},V))},[h,C]),T=no(async $=>{var X;const{id:D,field:z,ignoreModifications:V,cellToFocusAfter:B="none"}=$;h(D,z,Da.Edit),e.current.runPendingEditCellValueMutation(D,z);const G=()=>{N(D,z,null),C(D,z,null),B!=="none"&&e.current.moveFocusToRelativeCell(D,z,B)};if(V){G();return}const H=Ed(e),{error:F,isProcessingProps:W}=H[D][z],U=e.current.getRow(D);if(F||W){i.current[D][z].mode=Da.Edit,C(D,z,{mode:Da.Edit});return}const K=e.current.getRowWithUpdatedValuesFromCellEditing(D,z);if((X=t.dataSource)!=null&&X.updateRow){if(E0(U,K)){G();return}const J=()=>{i.current[D][z].mode=Da.Edit,C(D,z,{mode:Da.Edit})},te={rowId:D,updatedRow:K,previousRow:U};try{await e.current.dataSource.editRow(te),G()}catch{J()}}else if(s){const J=te=>{i.current[D][z].mode=Da.Edit,C(D,z,{mode:Da.Edit}),l&&l(te)};try{Promise.resolve(s(K,U,{rowId:D})).then(te=>{e.current.updateRows([te]),G()}).catch(J)}catch(te){J(te)}}else e.current.updateRows([K]),G()}),P=f.useCallback(async $=>{var X,J;const{id:D,field:z,value:V,debounceMs:B,unstable_skipValueParser:G}=$;p(D,z),h(D,z,Da.Edit);const H=e.current.getColumn(z),F=e.current.getRow(D);let W=V;H.valueParser&&!G&&(W=H.valueParser(V,F,H,e));let U=Ed(e),K=Se({},U[D][z],{value:W,changeReason:B?"debouncedSetEditCellValue":"setEditCellValue"});if(H.preProcessEditCellProps){const te=V!==U[D][z].value;K=Se({},K,{isProcessingProps:!0}),N(D,z,K),K=await Promise.resolve(H.preProcessEditCellProps({id:D,row:F,props:K,hasChanged:te}))}return e.current.getCellMode(D,z)===Da.View?!1:(U=Ed(e),K=Se({},K,{isProcessingProps:!1}),K.value=H.preProcessEditCellProps?U[D][z].value:W,N(D,z,K),U=Ed(e),!((J=(X=U[D])==null?void 0:X[z])!=null&&J.error))},[e,p,h,N]),E=f.useCallback(($,D)=>{const z=e.current.getColumn(D),V=Ed(e),B=e.current.getRow($);if(!V[$]||!V[$][D])return e.current.getRow($);const{value:G}=V[$][D];return z.valueSetter?z.valueSetter(G,B,z,e):Se({},B,{[D]:G})},[e]),M={getCellMode:w,startCellEditMode:j,stopCellEditMode:_},R={setCellEditingEditCellValue:P,getRowWithUpdatedValuesFromCellEditing:E};oi(e,M,"public"),oi(e,R,"private"),f.useEffect(()=>{c&&S(c)},[c,S]),Ia(()=>{const $=rg(e),D=i.current;i.current=Dxt(n),Object.entries(n).forEach(([z,V])=>{Object.entries(V).forEach(([B,G])=>{var W,U;const H=((U=(W=D[z])==null?void 0:W[B])==null?void 0:U.mode)||Da.View,F=$[z]?e.current.getRowId($[z]):z;G.mode===Da.Edit&&H===Da.View?I(Se({id:F,field:B},G)):G.mode===Da.View&&H===Da.Edit&&T(Se({id:F,field:B},G))})})},[e,n,I,T])},f_r=["id"],p_r=["id"],h_r=(e,t)=>{const[n,r]=f.useState({}),o=f.useRef(n),i=f.useRef({}),s=f.useRef({}),l=f.useRef(void 0),c=f.useRef(null),{processRowUpdate:u,onProcessRowUpdateError:d,rowModesModel:p,onRowModesModelChange:h}=t,m=G=>(...H)=>{t.editMode===bb.Row&&G(...H)},g=f.useCallback((G,H)=>{const F=e.current.getCellParams(G,H);if(!e.current.isCellEditable(F))throw new Error(`MUI X: The cell with id=${G} and field=${H} is not editable.`)},[e]),y=f.useCallback((G,H)=>{if(e.current.getRowMode(G)!==H)throw new Error(`MUI X: The row with id=${G} is not in ${H} mode.`)},[e]),x=f.useCallback(G=>{const H=Ed(e);return Object.values(H[G]).some(F=>F.error)},[e]),v=f.useCallback((G,H)=>{if(!G.isEditable||e.current.getRowMode(G.id)===Js.Edit)return;const F=e.current.getRowParams(G.id),W=Se({},F,{field:G.field,reason:QS.cellDoubleClick});e.current.publishEvent("rowEditStart",W,H)},[e]),b=f.useCallback(G=>{c.current=G},[]),w=f.useCallback((G,H)=>{G.isEditable&&e.current.getRowMode(G.id)!==Js.View&&(c.current=null,l.current=setTimeout(()=>{var F;if(((F=c.current)==null?void 0:F.id)!==G.id){if(!e.current.getRow(G.id)||e.current.getRowMode(G.id)===Js.View||x(G.id))return;const W=e.current.getRowParams(G.id),U=Se({},W,{field:G.field,reason:ov.rowFocusOut});e.current.publishEvent("rowEditStop",U,H)}}))},[e,x]);f.useEffect(()=>()=>{clearTimeout(l.current)},[]);const S=f.useCallback((G,H)=>{if(G.cellMode===Js.Edit){if(H.which===229)return;let F;if(H.key==="Escape")F=ov.escapeKeyDown;else if(H.key==="Enter")F=ov.enterKeyDown;else if(H.key==="Tab"){const W=M6(e).filter(U=>e.current.getColumn(U).type===WY?!0:e.current.isCellEditable(e.current.getCellParams(G.id,U)));if(H.shiftKey?G.field===W[0]&&(F=ov.shiftTabKeyDown):G.field===W[W.length-1]&&(F=ov.tabKeyDown),H.preventDefault(),!F){const U=W.findIndex(X=>X===G.field),K=W[H.shiftKey?U-1:U+1];e.current.setCellFocus(G.id,K)}}if(F){if(F!==ov.escapeKeyDown&&x(G.id))return;const W=Se({},e.current.getRowParams(G.id),{reason:F,field:G.field});e.current.publishEvent("rowEditStop",W,H)}}else if(G.isEditable){let F;if(!e.current.unstable_applyPipeProcessors("canStartEditing",!0,{event:H,cellParams:G,editMode:"row"}))return;if(Yxt(H)||G1e(H)?F=QS.printableKeyDown:H.key==="Enter"?F=QS.enterKeyDown:(H.key==="Backspace"||H.key==="Delete")&&(F=QS.deleteKeyDown),F){const U=e.current.getRowParams(G.id),K=Se({},U,{field:G.field,reason:F});e.current.publishEvent("rowEditStart",K,H)}}},[e,x]),C=f.useCallback(G=>{const{id:H,field:F,reason:W}=G,U={id:H,fieldToFocus:F};(W===QS.printableKeyDown||W===QS.deleteKeyDown)&&(U.deleteValue=!!F),e.current.startRowEditMode(U)},[e]),N=f.useCallback(G=>{const{id:H,reason:F,field:W}=G;e.current.runPendingEditCellValueMutation(H);let U;F===ov.enterKeyDown?U="below":F===ov.tabKeyDown?U="right":F===ov.shiftTabKeyDown&&(U="left");const K=F==="escapeKeyDown";e.current.stopRowEditMode({id:H,ignoreModifications:K,field:W,cellToFocusAfter:U})},[e]);Nr(e,"cellDoubleClick",m(v)),Nr(e,"cellFocusIn",m(b)),Nr(e,"cellFocusOut",m(w)),Nr(e,"cellKeyDown",m(S)),Nr(e,"rowEditStart",m(C)),Nr(e,"rowEditStop",m(N)),Ss(e,"rowEditStart",t.onRowEditStart),Ss(e,"rowEditStop",t.onRowEditStop);const j=f.useCallback(G=>_yt(e,{rowId:G,editMode:t.editMode})?Js.Edit:Js.View,[e,t.editMode]),I=no(G=>{const H=G!==t.rowModesModel;h&&H&&h(G,{api:e.current}),!(t.rowModesModel&&H)&&(r(G),o.current=G,e.current.publishEvent("rowModesModelChange",G))}),_=f.useCallback((G,H)=>{const F=Se({},o.current);H!==null?F[G]=Se({},H):delete F[G],I(F)},[I]),T=f.useCallback((G,H)=>{e.current.setState(F=>{const W=Se({},F.editRows);return H!==null?W[G]=H:delete W[G],Se({},F,{editRows:W})})},[e]),P=f.useCallback((G,H,F)=>{e.current.setState(W=>{const U=Se({},W.editRows);return F!==null?U[G]=Se({},U[G],{[H]:Se({},F)}):(delete U[G][H],Object.keys(U[G]).length===0&&delete U[G]),Se({},W,{editRows:U})})},[e]),E=f.useCallback(G=>{const{id:H}=G,F=Zn(G,f_r);y(H,Js.View),_(H,Se({mode:Js.Edit},F))},[y,_]),M=no(G=>{const{id:H,fieldToFocus:F,deleteValue:W,initialValue:U}=G,K=e.current.getRow(H),X=cg(e),J=X.reduce((te,re)=>{const ce=re.field;if(!e.current.getCellParams(H,ce).isEditable)return te;const oe=e.current.getColumn(ce);let ue=e.current.getCellValue(H,ce);return F===ce&&(W||U)&&(W?ue=Epe(oe):U&&(ue=U)),te[ce]={value:ue,error:!1,isProcessingProps:oe.editable&&!!oe.preProcessEditCellProps&&W},te},{});s.current[H]=K,T(H,J),F&&e.current.setCellFocus(H,F),X.filter(te=>e.current.getCellParams(H,te.field).isEditable&&te.editable&&!!te.preProcessEditCellProps&&W).forEach(te=>{const re=te.field,ce=e.current.getCellValue(H,re),ae=W?Epe(te):U??ce;Promise.resolve(te.preProcessEditCellProps({id:H,row:K,props:J[re],hasChanged:ae!==ce})).then(oe=>{if(e.current.getRowMode(H)===Js.Edit){const ue=Ed(e);P(H,re,Se({},oe,{value:ue[H][re].value,isProcessingProps:!1}))}})})}),R=f.useCallback(G=>{const{id:H}=G,F=Zn(G,p_r);y(H,Js.Edit),_(H,Se({mode:Js.View},F))},[y,_]),$=no(async G=>{var ce;const{id:H,ignoreModifications:F,field:W,cellToFocusAfter:U="none"}=G;e.current.runPendingEditCellValueMutation(H);const K=()=>{U!=="none"&&W&&e.current.moveFocusToRelativeCell(H,W,U),T(H,null),_(H,null),delete s.current[H]};if(F){K();return}const X=Ed(e),J=s.current[H];if(Object.values(X[H]).some(ae=>ae.isProcessingProps)){i.current[H].mode=Js.Edit;return}if(x(H)){i.current[H].mode=Js.Edit,_(H,{mode:Js.Edit});return}const re=e.current.getRowWithUpdatedValuesFromRowEditing(H);if((ce=t.dataSource)!=null&&ce.updateRow){if(E0(J,re)){K();return}const ae=()=>{i.current[H].mode=Js.Edit,_(H,{mode:Js.Edit})},oe={rowId:H,updatedRow:re,previousRow:J};try{await e.current.dataSource.editRow(oe),K()}catch{ae()}}else if(u){const ae=oe=>{i.current[H]&&(i.current[H].mode=Js.Edit,_(H,{mode:Js.Edit})),d&&d(oe)};try{Promise.resolve(u(re,J,{rowId:H})).then(oe=>{e.current.updateRows([oe]),K()}).catch(ae)}catch(oe){ae(oe)}}else e.current.updateRows([re]),K()}),D=f.useCallback(G=>{const{id:H,field:F,value:W,debounceMs:U,unstable_skipValueParser:K}=G;g(H,F);const X=e.current.getColumn(F),J=e.current.getRow(H);let te=W;X.valueParser&&!K&&(te=X.valueParser(W,J,X,e));let re=Ed(e),ce=Se({},re[H][F],{value:te,changeReason:U?"debouncedSetEditCellValue":"setEditCellValue"});return X.preProcessEditCellProps||P(H,F,ce),new Promise(ae=>{const oe=[];if(X.preProcessEditCellProps){const ue=ce.value!==re[H][F].value;ce=Se({},ce,{isProcessingProps:!0}),P(H,F,ce);const fe=re[H],se=Zn(fe,[F].map(yI)),ge=Promise.resolve(X.preProcessEditCellProps({id:H,row:J,props:ce,hasChanged:ue,otherFieldsProps:se})).then(ye=>{if(e.current.getRowMode(H)===Js.View){ae(!1);return}re=Ed(e),ye=Se({},ye,{isProcessingProps:!1}),ye.value=X.preProcessEditCellProps?re[H][F].value:te,P(H,F,ye)});oe.push(ge)}Object.entries(re[H]).forEach(([ue,fe])=>{if(ue===F)return;const se=e.current.getColumn(ue);if(!se.preProcessEditCellProps)return;fe=Se({},fe,{isProcessingProps:!0}),P(H,ue,fe),re=Ed(e);const ge=re[H],ye=Zn(ge,[ue].map(yI)),de=Promise.resolve(se.preProcessEditCellProps({id:H,row:J,props:fe,hasChanged:!1,otherFieldsProps:ye})).then(Ne=>{if(e.current.getRowMode(H)===Js.View){ae(!1);return}Ne=Se({},Ne,{isProcessingProps:!1}),P(H,ue,Ne)});oe.push(de)}),Promise.all(oe).then(()=>{e.current.getRowMode(H)===Js.Edit?(re=Ed(e),ae(!re[H][F].error)):ae(!1)})})},[e,g,P]),z=f.useCallback(G=>{const H=Ed(e),F=e.current.getRow(G);if(!H[G])return e.current.getRow(G);let W=Se({},s.current[G],F);return Object.entries(H[G]).forEach(([U,K])=>{const X=e.current.getColumn(U);X!=null&&X.valueSetter?W=X.valueSetter(K.value,W,X,e):W[U]=K.value}),W},[e]),V={getRowMode:j,startRowEditMode:E,stopRowEditMode:R},B={setRowEditingEditCellValue:D,getRowWithUpdatedValuesFromRowEditing:z};oi(e,V,"public"),oi(e,B,"private"),f.useEffect(()=>{p&&I(p)},[p,I]),Ia(()=>{const G=rg(e),H=i.current;i.current=Dxt(n);const F=new Set([...Object.keys(n),...Object.keys(H)]);Array.from(F).forEach(W=>{var J;const U=n[W]??{mode:Js.View},K=((J=H[W])==null?void 0:J.mode)||Js.View,X=G[W]?e.current.getRowId(G[W]):W;U.mode===Js.Edit&&K===Js.View?M(Se({id:X},U)):U.mode===Js.View&&K===Js.Edit&&$(Se({id:X},U))})},[e,n,M,$])},m_r=e=>Se({},e,{editRows:{}}),g_r=(e,t,n)=>{d_r(e,t),h_r(e,t);const r=f.useRef({}),{isCellEditable:o}=t,i=n.hooks.useIsCellEditable(e,t),s=f.useCallback(g=>!i(g)||!g.colDef.editable||!g.colDef.renderEditCell?!1:o?o(g):!0,[o,i]),l=(g,y,x,v)=>{if(!x){v();return}if(r.current[g]||(r.current[g]={}),r.current[g][y]){const[S]=r.current[g][y];clearTimeout(S)}const b=()=>{const[S]=r.current[g][y];clearTimeout(S),v(),delete r.current[g][y]},w=setTimeout(()=>{v(),delete r.current[g][y]},x);r.current[g][y]=[w,b]};f.useEffect(()=>{const g=r.current;return()=>{Object.entries(g).forEach(([y,x])=>{Object.keys(x).forEach(v=>{const[b]=g[y][v];clearTimeout(b),delete g[y][v]})})}},[]);const c=f.useCallback((g,y)=>{if(r.current[g]){if(!y)Object.keys(r.current[g]).forEach(x=>{const[,v]=r.current[g][x];v()});else if(r.current[g][y]){const[,x]=r.current[g][y];x()}}},[]),u=f.useCallback(g=>{const{id:y,field:x,debounceMs:v}=g;return new Promise(b=>{l(y,x,v,async()=>{const w=t.editMode===bb.Row?e.current.setRowEditingEditCellValue:e.current.setCellEditingEditCellValue;if(e.current.getCellMode(y,x)===Da.Edit){const S=await w(g);b(S)}})})},[e,t.editMode]),d=f.useCallback((g,y)=>t.editMode===bb.Cell?e.current.getRowWithUpdatedValuesFromCellEditing(g,y):e.current.getRowWithUpdatedValuesFromRowEditing(g),[e,t.editMode]),p=f.useCallback((g,y)=>{var v;return((v=Ed(e)[g])==null?void 0:v[y])??null},[e]),h={isCellEditable:s,setEditCellValue:u,getRowWithUpdatedValues:d,unstable_getEditCellMeta:p},m={runPendingEditCellValueMutation:c};oi(e,h,"public"),oi(e,m,"private")},x_r=(e,t,n)=>{const r=!!t.dataSource;return n.current.caches.rows=UB({rows:r?[]:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),Se({},e,{rows:Axt({apiRef:n,rowCountProp:t.rowCount,loadingProp:r?!0:t.loading,previousTree:null,previousTreeDepths:null})})},y_r=(e,t,n)=>{const r=wf(e,"useGridRows"),o=f.useRef(Date.now()),i=f.useRef(t.rowCount),s=hh(),{setRowIndex:l,setRowPosition:c}=n.hooks.useGridRowsOverridableMethods(e,t),u=f.useCallback(B=>{const G=rg(e)[B];if(G)return G;const H=j0(e,B);return H&&zT(H)?{[RI]:B}:null},[e]),d=f.useCallback(B=>BT(e,B),[e]),p=f.useCallback(({cache:B,throttle:G})=>{const H=()=>{o.current=Date.now(),e.current.setState(W=>Se({},W,{rows:Axt({apiRef:e,rowCountProp:t.rowCount,loadingProp:t.loading,previousTree:Mc(e),previousTreeDepths:ZFe(e),previousGroupsToFetch:k1r(e)})})),e.current.publishEvent("rowsSet")};if(s.clear(),e.current.caches.rows=B,!G){H();return}const F=t.throttleRowsMs-(Date.now()-o.current);if(F>0){s.start(F,H);return}H()},[t.throttleRowsMs,t.rowCount,t.loading,e,s]),h=f.useCallback(B=>{if(r.debug(`Updating all rows, new length ${B.length}`),!t.dataSource&&$I(e)){e.current.updateNonPivotRows(B,!1);return}const G=UB({rows:B,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),H=e.current.caches.rows;G.rowsBeforePartialUpdates=H.rowsBeforePartialUpdates,p({cache:G,throttle:!0})},[r,t.getRowId,t.dataSource,t.loading,t.rowCount,p,e]),m=f.useCallback(B=>{if(t.signature===ry.DataGrid&&B.length>1)throw new Error(["MUI X: You cannot update several rows at once in `apiRef.current.updateRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` `));if(!t.dataSource&&$I(e)){e.current.updateNonPivotRows(B);return}const G=t7e(e,B,t.getRowId),H=e7e({updates:G,getRowId:t.getRowId,previousCache:e.current.caches.rows});p({cache:H,throttle:!0})},[t.signature,t.dataSource,t.getRowId,p,e]),g=f.useCallback((B,G)=>{const H=t7e(e,B,t.getRowId),F=e7e({updates:H,getRowId:t.getRowId,previousCache:e.current.caches.rows,groupKeys:G??[]});p({cache:F,throttle:!1})},[t.getRowId,p,e]),y=f.useCallback(B=>{r.debug(`Setting loading to ${B}`),e.current.setState(G=>Se({},G,{rows:Se({},G.rows,{loading:B})})),e.current.caches.rows.loadingPropBeforePartialUpdates=B},[e,r]),x=f.useCallback(()=>{const B=GP(e),G=rg(e);return new Map(B.map(H=>[H,G[H]??{}]))},[e]),v=f.useCallback(()=>d4(e),[e]),b=f.useCallback(()=>GP(e),[e]),w=f.useCallback(B=>{const{rowIdToIndexMap:G}=jA(e);return G.get(B)},[e]),S=f.useCallback((B,G)=>{const H=j0(e,B);if(!H)throw new Error(`MUI X: No row with id #${B} found.`);if(H.type!=="group")throw new Error("MUI X: Only group nodes can be expanded or collapsed.");const F=Se({},H,{childrenExpanded:G});e.current.setState(W=>Se({},W,{rows:Se({},W.rows,{tree:Se({},W.rows.tree,{[B]:F})})})),e.current.publishEvent("rowExpansionChange",F)},[e]),C=f.useCallback(()=>{const B=Se({},Mc(e)),G=H=>{const F=B[H];(F==null?void 0:F.type)==="group"&&(B[H]=Se({},F,{childrenExpanded:!0}),F.children.forEach(G))};G(pc),e.current.setState(H=>Se({},H,{rows:Se({},H.rows,{tree:B})})),e.current.publishEvent("rowExpansionChange",B[pc])},[e]),N=f.useCallback(()=>{const B=Se({},Mc(e)),G=H=>{const F=B[H];(F==null?void 0:F.type)==="group"&&(B[H]=Se({},F,{childrenExpanded:!1}),F.children.forEach(G))};G(pc),e.current.setState(H=>Se({},H,{rows:Se({},H.rows,{tree:B})})),e.current.publishEvent("rowExpansionChange",B[pc])},[e]),j=f.useCallback(B=>j0(e,B)??null,[e]),I=f.useCallback(({skipAutoGeneratedRows:B=!0,groupId:G,applySorting:H,applyFiltering:F,directChildrenOnly:W=!1})=>{const U=Mc(e);let K;if(H){const X=U[G];if(!X)return[];const J=O6(e);K=[];const te=J.findIndex(re=>re===G)+1;for(let re=te;reX.depth);re+=1){const ce=J[re];(!B||!zT(U[ce]))&&K.push(ce)}}else K=z1e(U,G,B,W);if(F){const X=p4(e);K=GY(X)?K:K.filter(J=>X[J]!==!1)}return K},[e]),_=f.useCallback((B,G)=>{if(t.signature===ry.DataGrid&&G.length>1)throw new Error(["MUI X: You cannot replace rows using `apiRef.current.unstable_replaceRows` on the DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock this feature."].join(` `));if(G.length===0)return;if(T6(e)>1)throw new Error("`apiRef.current.unstable_replaceRows` is not compatible with tree data and row grouping");const F=Se({},Mc(e)),W=Se({},rg(e)),U=F[pc],K=[...U.children],X=new Set;for(let te=0;te{var re;return((re=F[te])==null?void 0:re.type)==="leaf"});e.current.caches.rows.dataRowIdToModelLookup=W,e.current.setState(te=>Se({},te,{rows:Se({},te.rows,{loading:t.loading,totalRowCount:Math.max(t.rowCount||0,K.length),dataRowIdToModelLookup:W,dataRowIds:J,tree:F})})),e.current.publishEvent("rowsSet")},[e,t.signature,t.getRowId,t.loading,t.rowCount]),T={getRow:u,setLoading:y,getRowId:d,getRowModels:x,getRowsCount:v,getAllRowIds:b,setRows:h,updateRows:m,getRowNode:j,getRowIndexRelativeToVisibleRows:w,unstable_replaceRows:_},P={setRowIndex:l,setRowPosition:c,setRowChildrenExpansion:S,getRowGroupChildren:I,expandAllRows:C,collapseAllRows:N},E={updateNestedRows:g},M=f.useCallback(()=>{r.info("Row grouping pre-processing have changed, regenerating the row tree");let B;e.current.caches.rows.rowsBeforePartialUpdates===t.rows?B=Se({},e.current.caches.rows,{updates:{type:"full",rows:GP(e)}}):B=UB({rows:t.rows,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),p({cache:B,throttle:!1})},[r,e,t.rows,t.getRowId,t.loading,t.rowCount,p]),R=gm(()=>t.dataSource),$=f.useCallback(B=>{if(t.dataSource&&t.dataSource!==R.current){R.current=t.dataSource;return}B==="rowTreeCreation"&&M()},[M,R,t.dataSource]),D=f.useCallback(()=>{e.current.getActiveStrategy($1.RowTree)!==M1r(e)&&M()},[e,M]);Nr(e,"activeStrategyProcessorChange",$),Nr(e,"strategyAvailabilityChange",D);const z=f.useCallback(()=>{e.current.setState(B=>{const G=e.current.unstable_applyPipeProcessors("hydrateRows",{tree:Mc(e),treeDepths:ZFe(e),dataRowIds:GP(e),dataRowIdToModelLookup:rg(e)});return Se({},B,{rows:Se({},B.rows,G,{totalTopLevelRowCount:Pxt({tree:G.tree,rowCountProp:t.rowCount})})})}),e.current.publishEvent("rowsSet")},[e,t.rowCount]);iwe(e,"hydrateRows",z),oi(e,T,"public"),oi(e,P,t.signature===ry.DataGrid?"private":"public"),oi(e,E,"private");const V=f.useRef(!0);f.useEffect(()=>{if(V.current){V.current=!1;return}let B=!1;t.rowCount!==i.current&&(B=!0,i.current=t.rowCount);const G=t.dataSource?R1r(e):t.rows,H=e.current.caches.rows.rowsBeforePartialUpdates===G,F=e.current.caches.rows.loadingPropBeforePartialUpdates===t.loading,W=e.current.caches.rows.rowCountPropBeforePartialUpdates===t.rowCount;H&&(F||(e.current.setState(U=>Se({},U,{rows:Se({},U.rows,{loading:t.loading})})),e.current.caches.rows.loadingPropBeforePartialUpdates=t.loading),W||(e.current.setState(U=>Se({},U,{rows:Se({},U.rows,{totalRowCount:Math.max(t.rowCount||0,U.rows.totalRowCount),totalTopLevelRowCount:Math.max(t.rowCount||0,U.rows.totalTopLevelRowCount)})})),e.current.caches.rows.rowCountPropBeforePartialUpdates=t.rowCount),!B)||(r.debug(`Updating all rows, new length ${G==null?void 0:G.length}`),p({cache:UB({rows:G,getRowId:t.getRowId,loading:t.loading,rowCount:t.rowCount}),throttle:!1}))},[t.rows,t.rowCount,t.getRowId,t.loading,t.dataSource,r,p,e])},v_r=e=>{const t={[pc]:Se({},$1r(),{children:e})};for(let n=0;n{const n=Se({},e),r={};for(let s=0;s!r[s])),n[pc]=Se({},o,{children:i}),{groupingName:DI,tree:n,treeDepths:{0:i.length},dataRowIds:i}},w_r=e=>e.updates.type==="full"?v_r(e.updates.rows):b_r({previousTree:e.previousTree,actions:e.updates.actions}),S_r=e=>{bD(e,DI,"rowTreeCreation",w_r)};class V7e extends Error{}function C_r(e,t,n){var m;const r=f.useCallback(g=>({field:g,colDef:e.current.getColumn(g)}),[e]),o=f.useCallback(g=>{const y=e.current.getRow(g);if(!y)throw new V7e(`No row with id #${g} found`);return{id:g,columns:e.current.getAllColumns(),row:y}},[e]),i=f.useCallback((g,y,x,{cellMode:v,colDef:b,hasFocus:w,rowNode:S,tabIndex:C,value:N,formattedValue:j})=>{const I=N!==void 0?N:e.current.getRowValue(x,b),_=j!==void 0?j:e.current.getRowFormattedValue(x,b),T={id:g,field:y,row:x,rowNode:S,colDef:b,cellMode:v,hasFocus:w,tabIndex:C,value:I,formattedValue:_,isEditable:!1,api:e.current};return T.isEditable=b&&e.current.isCellEditable(T),T},[e]),s=f.useCallback((g,y)=>{var C;const x=e.current.getRow(g),v=j0(e,g);if(!x||!v)throw new V7e(`No row with id #${g} found`);const b=em(e),w=Z1e(e),S=e.current.getCellMode(g,y);return e.current.getCellParamsForRow(g,y,x,{colDef:t.listView&&((C=t.listViewColumn)==null?void 0:C.field)===y?Uxt(e):e.current.getColumn(y),rowNode:v,hasFocus:b!==null&&b.field===y&&b.id===g,tabIndex:w&&w.field===y&&w.id===g?0:-1,cellMode:S})},[e,t.listView,(m=t.listViewColumn)==null?void 0:m.field]),l=f.useCallback(g=>e.current.rootElementRef.current?ZNr(e.current.rootElementRef.current,g):null,[e]),c=f.useCallback(g=>e.current.rootElementRef.current?ejr(e.current.rootElementRef.current,g):null,[e]),u=f.useCallback((g,y)=>e.current.rootElementRef.current?tjr(e.current.rootElementRef.current,{id:g,field:y}):null,[e]),d=n.hooks.useGridParamsOverridableMethods(e),p={getCellValue:d.getCellValue,getCellParams:s,getCellElement:u,getRowValue:d.getRowValue,getRowFormattedValue:d.getRowFormattedValue,getRowParams:o,getRowElement:c,getColumnHeaderParams:r,getColumnHeaderElement:l},h={getCellParamsForRow:i};oi(e,p,"public"),oi(e,h,"private")}const e3={type:"include",ids:new Set},N_r=(e,t)=>Se({},e,{rowSelection:t.rowSelection?t.rowSelectionModel??e3:e3}),j_r=(e,t)=>{var V,B,G,H,F,W,U,K,X,J;const n=wf(e,"useGridSelection"),r=Fn(e,T6)>1,o=t.signature!==ry.DataGrid&&(((V=t.rowSelectionPropagation)==null?void 0:V.parents)||((B=t.rowSelectionPropagation)==null?void 0:B.descendants))&&r,i=f.useMemo(()=>t.rowSelectionModel,[t.rowSelectionModel]),s=f.useRef(null);e.current.registerControlState({stateId:"rowSelection",propModel:i,propOnChange:t.onRowSelectionModelChange,stateSelector:Ox,changeEvent:"rowSelectionChange"});const{checkboxSelection:l,disableRowSelectionOnClick:c,isRowSelectable:u}=t,d=J1e(t),p=f.useCallback(te=>{let re=te;const ce=s.current??te,ae=e.current.isRowSelected(te);if(ae){const oe=qE(e),ue=oe.findIndex(se=>se===ce),fe=oe.findIndex(se=>se===re);if(ue===fe)return;ue>fe?re=oe[fe+1]:re=oe[fe-1]}s.current=te,e.current.selectRowRange({startId:ce,endId:re},!ae)},[e]),h=no(()=>t.pagination&&t.checkboxSelectionVisibleOnly&&t.paginationMode==="client"?hyt(e):qE(e)),m=f.useCallback((te,re)=>{if(t.signature===ry.DataGrid&&!d&&(te.type!=="include"||te.ids.size>1))throw new Error(["MUI X: `rowSelectionModel` can only contain 1 item in DataGrid.","You need to upgrade to DataGridPro or DataGridPremium component to unlock multiple selection."].join(` `));if(Ox(e)!==te){if(n.debug("Setting selection model"),s.current!==null){const ae=te.ids.has(s.current);(te.type==="include"&&!ae||te.type==="exclude"&&ae)&&(s.current=null)}e.current.setState(ae=>Se({},ae,{rowSelection:t.rowSelection?te:e3}),re)}},[e,n,t.rowSelection,t.signature,d]),g=f.useCallback(te=>$6(e).has(te),[e]),y=f.useCallback(te=>{if(t.rowSelection===!1)return!1;if(t.keepNonExistentRowsSelected&&!e.current.getRow(te))return!0;if(u&&!u(e.current.getRowParams(te)))return!1;const re=j0(e,te);return!((re==null?void 0:re.type)==="footer"||(re==null?void 0:re.type)==="pinnedRow")},[e,t.rowSelection,t.keepNonExistentRowsSelected,u]),x=f.useCallback(()=>ayt(e),[e]),v=f.useCallback((te,re=!0,ce=!1)=>{var oe,ue,fe,se,ge,ye;if(!e.current.isRowSelectable(te))return;const ae=Mc(e);if(s.current=re?te:null,ce){n.debug(`Setting selection for row ${te}`);const de={type:"include",ids:new Set},Ne=_e=>{de.ids.add(_e)};re&&(Ne(te),o&&BM(e,ae,te,((oe=t.rowSelectionPropagation)==null?void 0:oe.descendants)??!1,((ue=t.rowSelectionPropagation)==null?void 0:ue.parents)??!1,Ne)),e.current.setRowSelectionModel(de,"singleRowSelection")}else{n.debug(`Toggling selection for row ${te}`);const de=Ox(e),Ne={type:de.type,ids:new Set(de.ids)},_e=x2(Ne);_e.unselect(te);const xe=Re=>{_e.select(Re)},we=Re=>{_e.unselect(Re)};re?(xe(te),o&&BM(e,ae,te,((fe=t.rowSelectionPropagation)==null?void 0:fe.descendants)??!1,((se=t.rowSelectionPropagation)==null?void 0:se.parents)??!1,xe)):o&&f7e(e,ae,te,((ge=t.rowSelectionPropagation)==null?void 0:ge.descendants)??!1,((ye=t.rowSelectionPropagation)==null?void 0:ye.parents)??!1,we),(Ne.type==="include"&&Ne.ids.size<2||d)&&e.current.setRowSelectionModel(Ne,"singleRowSelection")}},[e,n,o,(G=t.rowSelectionPropagation)==null?void 0:G.descendants,(H=t.rowSelectionPropagation)==null?void 0:H.parents,d]),b=f.useCallback((te,re=!0,ce=!1)=>{var ge,ye,de,Ne,_e,xe;if(n.debug("Setting selection for several rows"),t.rowSelection===!1)return;const ae=Mc(e),oe=new Set;for(let we=0;we{we.select(Re)};for(const Re of oe)BM(e,ae,Re,((ge=t.rowSelectionPropagation)==null?void 0:ge.descendants)??!1,((ye=t.rowSelectionPropagation)==null?void 0:ye.parents)??!1,Te)}}else fe.ids=new Set;if(ue.type===fe.type&&fe.ids.size===ue.ids.size&&Array.from(fe.ids).every(we=>ue.ids.has(we)))return}else{fe={type:ue.type,ids:new Set(ue.ids)};const we=x2(fe),Te=Ue=>{we.select(Ue)},Re=Ue=>{we.unselect(Ue)};for(const Ue of oe)re?(we.select(Ue),o&&BM(e,ae,Ue,((de=t.rowSelectionPropagation)==null?void 0:de.descendants)??!1,((Ne=t.rowSelectionPropagation)==null?void 0:Ne.parents)??!1,Te)):(Re(Ue),o&&f7e(e,ae,Ue,((_e=t.rowSelectionPropagation)==null?void 0:_e.descendants)??!1,((xe=t.rowSelectionPropagation)==null?void 0:xe.parents)??!1,Re))}(fe.type==="include"&&fe.ids.size<2||d)&&e.current.setRowSelectionModel(fe,"multipleRowsSelection")},[n,o,d,e,(F=t.rowSelectionPropagation)==null?void 0:F.descendants,(W=t.rowSelectionPropagation)==null?void 0:W.parents,t.rowSelection]),w=f.useCallback(te=>{var ue,fe;if(!r||!o||te.type==="exclude"||te.ids.size===0&&te.type==="include")return te;const re={type:te.type,ids:new Set(te.ids)},ce=Mc(e),ae=x2(re),oe=se=>{ae.select(se)};for(const se of te.ids)BM(e,ce,se,((ue=t.rowSelectionPropagation)==null?void 0:ue.descendants)??!1,((fe=t.rowSelectionPropagation)==null?void 0:fe.parents)??!1,oe,ae);return re},[e,(U=t.rowSelectionPropagation)==null?void 0:U.descendants,(K=t.rowSelectionPropagation)==null?void 0:K.parents,r,o]),S=f.useCallback(({startId:te,endId:re},ce=!0,ae=!1)=>{if(!e.current.getRow(te)||!e.current.getRow(re))return;n.debug(`Expanding selection from row ${te} to row ${re}`);const oe=qE(e),ue=oe.indexOf(te),fe=oe.indexOf(re),[se,ge]=ue>fe?[fe,ue]:[ue,fe],ye=oe.slice(se,ge+1);e.current.selectRows(ye,ce,ae)},[e,n]),C={selectRow:v,setRowSelectionModel:m,getSelectedRows:x,isRowSelected:g,isRowSelectable:y},N={selectRows:b,selectRowRange:S,getPropagatedRowSelectionModel:w};oi(e,C,"public"),oi(e,N,t.signature===ry.DataGrid?"private":"public");const j=f.useRef(!0),I=f.useCallback(()=>{var ye,de;if(j.current)return;const te=Ox(e),re=rg(e),ce=Mc(e),ae=p4(e),oe=Ne=>t.filterMode==="server"?!re[Ne]:!ce[Ne]||ae[Ne]===!1,ue={type:te.type,ids:new Set(te.ids)},fe=x2(ue);let se=!1;for(const Ne of te.ids){if(oe(Ne)){if(t.keepNonExistentRowsSelected)continue;fe.unselect(Ne),se=!0;continue}if(!((ye=t.rowSelectionPropagation)!=null&&ye.parents))continue;const _e=ce[Ne];if((_e==null?void 0:_e.type)==="group"){if(_e.isAutoGenerated){fe.unselect(Ne),se=!0;continue}_e.children.every(we=>ae[we]===!1)||(fe.unselect(Ne),se=!0)}}const ge=r&&((de=t.rowSelectionPropagation)==null?void 0:de.parents)&&(ue.ids.size>0||ue.type==="exclude");if(se||ge)if(ge)if(ue.type==="exclude"){const Ne=h(),_e=[];for(let xe=0;xe{const ce=re.metaKey||re.ctrlKey,ae=!l&&!ce&&!Swr(re),oe=!d||ae,ue=e.current.isRowSelected(te),ge=YY(e)>1&&oe||!ue;e.current.selectRow(te,ge,oe)},[e,d,l]),T=f.useCallback((te,re)=>{var oe;if(c)return;const ce=(oe=re.target.closest(`.${Be.cell}`))==null?void 0:oe.getAttribute("data-field");if(ce===m4.field||ce===K1e)return;if(ce){const ue=e.current.getColumn(ce);if((ue==null?void 0:ue.type)===WY)return}j0(e,te.id).type!=="pinnedRow"&&(re.shiftKey&&d?p(te.id):_(te.id,re))},[c,d,e,p,_]),P=f.useCallback((te,re)=>{var ce;d&&re.shiftKey&&((ce=window.getSelection())==null||ce.removeAllRanges())},[d]),E=f.useCallback((te,re)=>{d&&re.nativeEvent.shiftKey?p(te.id):e.current.selectRow(te.id,te.value,!d)},[e,p,d]),M=f.useCallback(te=>{var oe;const re=Sd(e),ce=nyt(e),ae=re.items.length>0||(ce==null?void 0:ce.some(ue=>ue.length));!t.isRowSelectable&&!t.checkboxSelectionVisibleOnly&&(!r||(oe=t.rowSelectionPropagation)!=null&&oe.descendants)&&!ae&&!t.disableRowSelectionExcludeModel?e.current.setRowSelectionModel({type:te?"exclude":"include",ids:new Set},"multipleRowsSelection"):e.current.selectRows(h(),te)},[e,h,t.checkboxSelectionVisibleOnly,t.isRowSelectable,(J=t.rowSelectionPropagation)==null?void 0:J.descendants,t.disableRowSelectionExcludeModel,r]),R=f.useCallback(te=>{M(te.value)},[M]),$=f.useCallback((te,re)=>{if(e.current.getCellMode(te.id,te.field)!==Da.Edit&&!z6(re)){if(qP(re.key)&&re.shiftKey){const ce=em(e);if(ce&&ce.id!==te.id){re.preventDefault();const ae=e.current.isRowSelected(ce.id);if(!d){e.current.selectRow(ce.id,!ae,!0);return}const oe=e.current.getRowIndexRelativeToVisibleRows(ce.id),ue=e.current.getRowIndexRelativeToVisibleRows(te.id);let fe,se;oe>ue?ae?(fe=ue,se=oe-1):(fe=ue,se=oe):ae?(fe=oe+1,se=ue):(fe=oe,se=ue);const ge=jA(e),ye=[];for(let de=fe;de<=se;de+=1)ye.push(ge.rows[de].id);e.current.selectRows(ye,!ae);return}}if(re.key===" "&&re.shiftKey){re.preventDefault(),_(te.id,re);return}String.fromCharCode(re.keyCode)==="A"&&(re.ctrlKey||re.metaKey)&&(re.preventDefault(),d&&M(!0))}},[e,d,_,M]),D=no(()=>{if(!t.rowSelection){e.current.setRowSelectionModel(e3);return}if(i===void 0)return;if(!o||!r||i.type==="include"&&i.ids.size===0){e.current.setRowSelectionModel(i);return}const te=e.current.getPropagatedRowSelectionModel(i);if(te.type!==i.type||te.ids.size!==i.ids.size||!Array.from(i.ids).every(re=>te.ids.has(re))){e.current.setRowSelectionModel(te);return}e.current.setRowSelectionModel(i)});Nr(e,"filteredRowsSet",dh(t.rowSelection,I)),Nr(e,"rowClick",dh(t.rowSelection,T)),Nr(e,"rowSelectionCheckboxChange",dh(t.rowSelection,E)),Nr(e,"headerSelectionCheckboxChange",R),Nr(e,"cellMouseDown",dh(t.rowSelection,P)),Nr(e,"cellKeyDown",dh(t.rowSelection,$)),f.useEffect(()=>{D()},[e,i,t.rowSelection,D]);const z=i!=null;f.useEffect(()=>{if(z||!t.rowSelection||typeof y!="function")return;const te=Ox(e);if(te.type!=="include")return;const re=new Set;for(const ce of te.ids)y(ce)&&re.add(ce);re.size{if(!t.rowSelection||z)return;const te=Ox(e);!d&&(te.type==="include"&&te.ids.size>1||te.type==="exclude")&&e.current.setRowSelectionModel(e3)},[e,d,l,z,t.rowSelection]),f.useEffect(()=>{dh(t.rowSelection,I)},[t.rowSelection,I]),f.useEffect(()=>{j.current&&(j.current=!1)},[])},E_r=e=>{const{classes:t}=e;return f.useMemo(()=>Un({cellCheckbox:["cellCheckbox"],columnHeaderCheckbox:["columnHeaderCheckbox"]},ii,t),[t])},I_r=(e,t)=>{const n={classes:t.classes},r=E_r(n),o=f.useCallback(i=>{const s=Se({},m4,{cellClassName:r.cellCheckbox,headerClassName:r.columnHeaderCheckbox,headerName:e.current.getLocaleText("checkboxSelectionHeaderName")}),l=t.checkboxSelection,c=i.lookup[Ex]!=null;return l&&!c?(i.lookup[Ex]=s,i.orderedFields=[Ex,...i.orderedFields]):!l&&c?(delete i.lookup[Ex],i.orderedFields=i.orderedFields.filter(u=>u!==Ex)):l&&c&&(i.lookup[Ex]=Se({},s,i.lookup[Ex]),t.columns.some(u=>u.field===Ex)||(i.orderedFields=[Ex,...i.orderedFields.filter(u=>u!==Ex)])),i},[e,r,t.columns,t.checkboxSelection]);Jl(e,"hydrateColumns",o)},__r=(e,t)=>{var r,o;const n=t.sortModel??((o=(r=t.initialState)==null?void 0:r.sorting)==null?void 0:o.sortModel)??[];return Se({},e,{sorting:{sortModel:Rxt(n,t.disableMultipleColumnsSorting),sortedRows:[]}})},P_r=(e,t)=>{var C,N;const n=wf(e,"useGridSorting");e.current.registerControlState({stateId:"sortModel",propModel:t.sortModel,propOnChange:t.onSortModelChange,stateSelector:Xg,changeEvent:"sortModelChange"});const r=f.useCallback((j,I)=>{const _=Xg(e),T=_.findIndex(E=>E.field===j);let P=[..._];return T>-1?(I==null?void 0:I.sort)==null?P.splice(T,1):P.splice(T,1,I):P=[..._,I],P},[e]),o=f.useCallback((j,I)=>{const T=Xg(e).find(P=>P.field===j.field);if(T){const P=I===void 0?i7e(j.sortingOrder??t.sortingOrder,T.sort):I;return P===void 0?void 0:Se({},T,{sort:P})}return{field:j.field,sort:I===void 0?i7e(j.sortingOrder??t.sortingOrder):I}},[e,t.sortingOrder]),i=f.useCallback((j,I)=>I==null||I.sortable===!1||t.disableColumnSorting?j:(I.sortingOrder||t.sortingOrder).some(T=>!!T)?[...j,"columnMenuSortItem"]:j,[t.sortingOrder,t.disableColumnSorting]),s=f.useCallback(()=>{e.current.setState(j=>{if(t.sortingMode==="server")return n.debug("Skipping sorting rows as sortingMode = server"),Se({},j,{sorting:Se({},j.sorting,{sortedRows:z1e(Mc(e),pc,!1)})});const I=Xg(e),_=ewr(I,e),T=e.current.applyStrategyProcessor("sorting",{sortRowList:_});return Se({},j,{sorting:Se({},j.sorting,{sortedRows:T})})}),e.current.publishEvent("sortedRowsSet")},[e,n,t.sortingMode]),l=f.useCallback(j=>{Xg(e)!==j&&(n.debug("Setting sort model"),e.current.setState(o7e(j,t.disableMultipleColumnsSorting)),e.current.applySorting())},[e,n,t.disableMultipleColumnsSorting]),c=f.useCallback((j,I,_)=>{const T=e.current.getColumn(j),P=o(T,I);let E;!_||t.disableMultipleColumnsSorting?E=(P==null?void 0:P.sort)==null?[]:[P]:E=r(T.field,P),e.current.setSortModel(E)},[e,r,o,t.disableMultipleColumnsSorting]),u=f.useCallback(()=>Xg(e),[e]),d=f.useCallback(()=>Y1e(e).map(I=>I.model),[e]),p=f.useCallback(()=>O6(e),[e]),h=f.useCallback(j=>e.current.getSortedRowIds()[j],[e]);oi(e,{getSortModel:u,getSortedRows:d,getSortedRowIds:p,getRowIdFromRowIndex:h,setSortModel:l,sortColumn:c,applySorting:s},"public");const g=f.useCallback((j,I)=>{var P,E;const _=Xg(e);return!I.exportOnlyDirtyModels||t.sortModel!=null||((E=(P=t.initialState)==null?void 0:P.sorting)==null?void 0:E.sortModel)!=null||_.length>0?Se({},j,{sorting:{sortModel:_}}):j},[e,t.sortModel,(N=(C=t.initialState)==null?void 0:C.sorting)==null?void 0:N.sortModel]),y=f.useCallback((j,I)=>{var T;const _=(T=I.stateToRestore.sorting)==null?void 0:T.sortModel;return _==null?j:(e.current.setState(o7e(_,t.disableMultipleColumnsSorting)),Se({},j,{callbacks:[...j.callbacks,e.current.applySorting]}))},[e,t.disableMultipleColumnsSorting]),x=f.useCallback(j=>{const I=Mc(e),_=I[pc],T=j.sortRowList?j.sortRowList(_.children.map(P=>I[P])):[..._.children];return _.footerId!=null&&T.push(_.footerId),T},[e]);Jl(e,"exportState",g),Jl(e,"restoreState",y),bD(e,DI,"sorting",x);const v=f.useCallback(({field:j,colDef:I},_)=>{if(!I.sortable||t.disableColumnSorting)return;const T=t.multipleColumnsSortingMode==="always"||_.shiftKey||_.metaKey||_.ctrlKey;c(j,void 0,T)},[c,t.disableColumnSorting,t.multipleColumnsSortingMode]),b=f.useCallback(({field:j,colDef:I},_)=>{!I.sortable||t.disableColumnSorting||_.key==="Enter"&&!_.ctrlKey&&!_.metaKey&&c(j,void 0,t.multipleColumnsSortingMode==="always"||_.shiftKey)},[c,t.disableColumnSorting,t.multipleColumnsSortingMode]),w=f.useCallback(()=>{const j=Xg(e),I=$b(e);if(j.length>0){const _=j.filter(T=>I[T.field]);_.length{j==="sorting"&&e.current.applySorting()},[e]);Jl(e,"columnMenu",i),Nr(e,"columnHeaderClick",v),Nr(e,"columnHeaderKeyDown",b),Nr(e,"rowsSet",e.current.applySorting),Nr(e,"columnsChange",w),Nr(e,"activeStrategyProcessorChange",S),b5(()=>{t.signature==="DataGrid"&&e.current.applySorting()}),Ia(()=>{t.sortModel!==void 0&&e.current.setSortModel(t.sortModel)},[e,t.sortModel])};function U7e(e){const{containerSize:t,scrollPosition:n,elementSize:r,elementOffset:o}=e,i=o+r;if(r>t)return o;if(i-t>n)return i-t;if(o{const n=$d(),r=wf(e,"useGridScroll"),o=e.current.columnHeadersContainerRef,i=e.current.virtualScrollerRef,s=f.useCallback(d=>{var x,v,b;const p=Rl(e),h=d4(e),m=yc(e);if(!(d.rowIndex==null)&&h===0||m.length===0)return!1;r.debug(`Scrolling to cell at row ${d.rowIndex}, col: ${d.colIndex} `);let y={};if(d.colIndex!==void 0&&m[d.colIndex]){const w=y5(e);let S;if(typeof d.rowIndex<"u"){const N=(x=v5(e)[d.rowIndex])==null?void 0:x.id,j=e.current.unstable_getCellColSpanInfo(N,d.colIndex);j&&!j.spannedByColSpan&&(S=j.cellProps.width)}typeof S>"u"&&(S=m[d.colIndex].computedWidth),y.left=U7e({containerSize:p.viewportOuterSize.width,scrollPosition:Math.abs(((v=i.current)==null?void 0:v.scrollLeft)??0),elementSize:S,elementOffset:w[d.colIndex]})}if(d.rowIndex!==void 0){const w=Ext(e),S=jSr(e),C=ESr(e),N=t.pagination?d.rowIndex-S*C:d.rowIndex,j=w.positions[N+1]?w.positions[N+1]-w.positions[N]:w.currentPageTotalHeight-w.positions[N];y.top=U7e({containerSize:p.viewportInnerSize.height,scrollPosition:((b=i.current)==null?void 0:b.scrollTop)??0,elementSize:j,elementOffset:w.positions[N]})}return y=e.current.unstable_applyPipeProcessors("scrollToIndexes",y,d),typeof y.left<"u"||typeof y.top<"u"?(e.current.scroll(y),!0):!1},[r,e,i,t.pagination]),l=f.useCallback(d=>{if(i.current&&d.left!==void 0&&o.current){const p=n?-1:1;o.current.scrollLeft=d.left,i.current.scrollLeft=p*d.left,r.debug(`Scrolling left: ${d.left}`)}i.current&&d.top!==void 0&&(i.current.scrollTop=d.top,r.debug(`Scrolling top: ${d.top}`)),r.debug("Scrolling, updating container, and viewport")},[i,n,o,r]),c=f.useCallback(()=>i!=null&&i.current?{top:i.current.scrollTop,left:i.current.scrollLeft}:{top:0,left:0},[i]);oi(e,{scroll:l,scrollToIndexes:s,getScrollPosition:c},"public")};function T_r(e,t){Ss(e,"columnHeaderClick",t.onColumnHeaderClick),Ss(e,"columnHeaderContextMenu",t.onColumnHeaderContextMenu),Ss(e,"columnHeaderDoubleClick",t.onColumnHeaderDoubleClick),Ss(e,"columnHeaderOver",t.onColumnHeaderOver),Ss(e,"columnHeaderOut",t.onColumnHeaderOut),Ss(e,"columnHeaderEnter",t.onColumnHeaderEnter),Ss(e,"columnHeaderLeave",t.onColumnHeaderLeave),Ss(e,"cellClick",t.onCellClick),Ss(e,"cellDoubleClick",t.onCellDoubleClick),Ss(e,"cellKeyDown",t.onCellKeyDown),Ss(e,"preferencePanelClose",t.onPreferencePanelClose),Ss(e,"preferencePanelOpen",t.onPreferencePanelOpen),Ss(e,"menuOpen",t.onMenuOpen),Ss(e,"menuClose",t.onMenuClose),Ss(e,"rowDoubleClick",t.onRowDoubleClick),Ss(e,"rowClick",t.onRowClick),Ss(e,"stateChange",t.onStateChange)}const VM={width:0,height:0},k_r={isReady:!1,root:VM,viewportOuterSize:VM,viewportInnerSize:VM,contentSize:VM,minimumSize:VM,hasScrollX:!1,hasScrollY:!1,scrollbarSize:0,headerHeight:0,groupHeaderHeight:0,headerFilterHeight:0,rowWidth:0,rowHeight:0,columnsTotalWidth:0,leftPinnedWidth:0,rightPinnedWidth:0,headersTotalHeight:0,topContainerHeight:0,bottomContainerHeight:0,autoHeight:!1,minimalContentHeight:void 0},M_r=(e,t,n)=>{const r=k_r,o=k6(n),i=Se({},r,$_r(t,n,o,VY(n)));return n.current.store.state.dimensions=i,Se({},e,{dimensions:i})},R_r=yr(yc,y5,(e,t)=>{const n=e.length;return n===0?0:pE(t[n-1]+e[n-1].computedWidth,1)});function O_r(e,t){const r={getRootDimensions:f.useCallback(()=>Rl(e),[e])},o={updateDimensions:()=>e.current.virtualizer.api.updateDimensions(),getViewportPageSize:()=>e.current.virtualizer.api.getViewportPageSize()};oi(e,r,"public"),oi(e,o,"private"),Ss(e,"rootMount",s=>{W7e(s,Rl(e))}),Ss(e,"debouncedResize",t.onResize),WE(e.current.store,s=>s.dimensions,(s,l)=>{l.isReady&&(e.current.rootElementRef.current&&W7e(e.current.rootElementRef.current,l),D_r(l.viewportInnerSize,s.viewportInnerSize)||e.current.publishEvent("viewportInnerSizeChange",l.viewportInnerSize),e.current.publishEvent("debouncedResize",l.root))})}function W7e(e,t){const n=(r,o)=>e.style.setProperty(r,o);n("--DataGrid-hasScrollX",`${Number(t.hasScrollX)}`),n("--DataGrid-hasScrollY",`${Number(t.hasScrollY)}`),n("--DataGrid-scrollbarSize",`${t.scrollbarSize}px`),n("--DataGrid-rowWidth",`${t.rowWidth}px`),n("--DataGrid-columnsTotalWidth",`${t.columnsTotalWidth}px`),n("--DataGrid-leftPinnedWidth",`${t.leftPinnedWidth}px`),n("--DataGrid-rightPinnedWidth",`${t.rightPinnedWidth}px`),n("--DataGrid-headerHeight",`${t.headerHeight}px`),n("--DataGrid-headersTotalHeight",`${t.headersTotalHeight}px`),n("--DataGrid-topContainerHeight",`${t.topContainerHeight}px`),n("--DataGrid-bottomContainerHeight",`${t.bottomContainerHeight}px`),n("--height",`${t.rowHeight}px`)}function $_r(e,t,n,r){const o=Mxt(e.rowHeight,MW.rowHeight);return{rowHeight:Math.floor(o*n),headerHeight:Math.floor(e.columnHeaderHeight*n),groupHeaderHeight:Math.floor((e.columnGroupHeaderHeight??e.columnHeaderHeight)*n),headerFilterHeight:Math.floor((e.headerFilterHeight??e.columnHeaderHeight)*n),columnsTotalWidth:R_r(t),headersTotalHeight:ZY(t,e),leftPinnedWidth:r.left.reduce((i,s)=>i+s.computedWidth,0),rightPinnedWidth:r.right.reduce((i,s)=>i+s.computedWidth,0)}}function D_r(e,t){return e.width===t.width&&e.height===t.height}const L_r=e=>{const t=f.useCallback((o={})=>e.current.unstable_applyPipeProcessors("exportState",{},o),[e]),n=f.useCallback(o=>{e.current.unstable_applyPipeProcessors("restoreState",{callbacks:[]},{stateToRestore:o}).callbacks.forEach(s=>{s()})},[e]);oi(e,{exportState:t,restoreState:n},"public")},F_r=e=>{const t=()=>e.current.virtualizer.api.resetColSpan(),n=(...s)=>e.current.virtualizer.api.getCellColSpanInfo(...s),r=(...s)=>{e.current.virtualizer.api.calculateColSpan(...s)},o={unstable_getCellColSpanInfo:n},i={resetColSpan:t,calculateColSpan:r};oi(e,o,"public"),oi(e,i,"private"),Nr(e,"columnOrderChange",t)},z_r=["groupId","children"],cwe=e=>{const t={};for(let n=0;n{if(Fxt(e)){if(n[e.field]!==void 0)throw new Error(["MUI X: columnGroupingModel contains duplicated field",`column field ${e.field} occurs two times in the grouping model:`,`- ${n[e.field].join(" > ")}`,`- ${t.join(" > ")}`].join(` `));n[e.field]=t;return}const{groupId:r,children:o}=e;o.forEach(i=>{tvt(i,[...t,r],n)})},Ipe=e=>{if(!e)return{};const t={};return e.forEach(n=>{tvt(n,[],t)}),t},_pe=(e,t,n)=>{const r=c=>t[c]??[],o=[],i=Math.max(0,...e.map(c=>r(c).length)),s=(c,u,d)=>{const p=r(c),h=r(u);for(let m=0;m<=d;m+=1)if(p[m]!==h[m])return!1;return!0},l=(c,u)=>{const d=n==null?void 0:n.left,p=n==null?void 0:n.right,h=!!(d!=null&&d.includes(c)),m=!!(d!=null&&d.includes(u)),g=!!(p!=null&&p.includes(c)),y=!!(p!=null&&p.includes(u));return h!==m||g!==y};for(let c=0;c{if(n.current.caches.columnGrouping={lastColumnGroupingModel:t.columnGroupingModel},!t.columnGroupingModel)return Se({},e,{columnGrouping:void 0});const r=tb(n),o=M6(n),i=cwe(t.columnGroupingModel??[]),s=Ipe(t.columnGroupingModel??[]),l=_pe(r,s,n.current.state.pinnedColumns??{}),c=o.length===0?0:Math.max(...o.map(u=>{var d;return((d=s[u])==null?void 0:d.length)??0}));return Se({},e,{columnGrouping:{lookup:i,unwrappedGroupingModel:s,headerStructure:l,maxDepth:c}})},H_r=(e,t)=>{const n=f.useCallback(l=>vyt(e)[l]??[],[e]),r=f.useCallback(()=>byt(e),[e]);oi(e,{getColumnGroupPath:n,getAllGroupDetails:r},"public");const i=f.useCallback(()=>{const l=Ipe(t.columnGroupingModel??[]);e.current.setState(c=>{var h;const u=((h=c.columns)==null?void 0:h.orderedFields)??[],d=c.pinnedColumns??{},p=_pe(u,l,d);return Se({},c,{columnGrouping:Se({},c.columnGrouping,{headerStructure:p})})})},[e,t.columnGroupingModel]),s=f.useCallback(l=>{var y,x;if(!l&&!e.current.caches.columnGrouping.lastColumnGroupingModel)return;e.current.caches.columnGrouping.lastColumnGroupingModel=l;const c=((x=(y=e.current).getPinnedColumns)==null?void 0:x.call(y))??{},u=tb(e),d=M6(e),p=cwe(l??[]),h=Ipe(l??[]),m=_pe(u,h,c),g=d.length===0?0:Math.max(...d.map(v=>{var b;return((b=h[v])==null?void 0:b.length)??0}));e.current.setState(v=>Se({},v,{columnGrouping:{lookup:p,unwrappedGroupingModel:h,headerStructure:m,maxDepth:g}}))},[e]);Nr(e,"columnIndexChange",i),Nr(e,"columnsChange",()=>{s(t.columnGroupingModel)}),Nr(e,"columnVisibilityModelChange",()=>{s(t.columnGroupingModel)}),f.useEffect(()=>{t.columnGroupingModel!==e.current.caches.columnGrouping.lastColumnGroupingModel&&s(t.columnGroupingModel)},[e,s,t.columnGroupingModel])};function V_r(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function G7e(e,t){if(t!==void 0&&e.changedTouches){for(let n=0;nPCr(e),r=Fn(e,n);return f.useEffect(()=>{t.current&&r===!1&&(t.current.resolve(),t.current=void 0)}),()=>{if(!t.current){if(n()===!1)return Promise.resolve();t.current=V_r()}return t.current}}function K_r(e,t){if(e.length<4)return e;const n=e.slice();n.sort((l,c)=>l-c);const r=n[Math.floor(n.length*.25)],o=n[Math.floor(n.length*.75)-1],i=o-r,s=i<5?5:i*t;return n.filter(l=>l>r-s&&l{const c=pjr(e.current,s.field).map(y=>y.getBoundingClientRect().width??0),u=t.includeOutliers?c:K_r(c,t.outliersFactor);if(t.includeHeaders){const y=djr(e.current,s.field);if(y){const x=y.querySelector(`.${Be.columnHeaderTitleContainer}`),v=Array.from(x.children),b=y.querySelector(`.${Be.menuIcon}`),w=window.getComputedStyle(x,null),S=parseInt(w.gap,10)||0,C=window.getComputedStyle(y,null),N=parseInt(C.paddingLeft,10)+parseInt(C.paddingRight,10);let j=0,I=0;for(let T=0;T0&&(j+=1,I+=P.scrollWidth)}I+=1;const _=I+S*(j-1)+N+((b==null?void 0:b.clientWidth)??0);u.push(_)}}if(i){const y=fjr(e.current,s.field);if(y){const x=window.getComputedStyle(y,null),v=parseInt(x.paddingLeft,10)+parseInt(x.paddingRight,10),w=y.scrollWidth+v;u.push(w)}}const d=s.minWidth!==-1/0&&s.minWidth!==void 0,p=s.maxWidth!==1/0&&s.maxWidth!==void 0,h=d?s.minWidth:0,m=p?s.maxWidth:1/0,g=u.length===0?0:Math.max(...u);r[s.field]=GE(g,h,m)}),o.classList.remove(Be.autosizing),r}const X_r=e=>Se({},e,{columnResize:{resizingColumnField:""}});function Q_r(){return{colDef:void 0,initialColWidth:0,initialTotalWidth:0,previousMouseClickEvent:void 0,columnHeaderElement:void 0,headerFilterElement:void 0,groupHeaderElements:[],cellElements:[],leftPinnedCellsAfter:[],rightPinnedCellsBefore:[],fillerLeft:void 0,fillerRight:void 0,leftPinnedHeadersAfter:[],rightPinnedHeadersBefore:[]}}const J_r=(e,t)=>{const n=$d(),r=wf(e,"useGridColumnResize"),o=gm(Q_r).current,i=f.useRef(null),s=f.useRef(null),l=hh(),c=f.useRef(void 0),u=T=>{var z,V,B,G,H,F;r.debug(`Updating width to ${T} for col ${o.colDef.field}`);const P=o.columnHeaderElement.offsetWidth,E=T-P,M=T-o.initialColWidth;if(M>0){const W=o.initialTotalWidth+M;(V=(z=e.current.rootElementRef)==null?void 0:z.current)==null||V.style.setProperty("--DataGrid-rowWidth",`${W}px`)}o.colDef.computedWidth=T,o.colDef.width=T,o.colDef.flex=0,o.columnHeaderElement.style.width=`${T}px`;const R=o.headerFilterElement;R&&(R.style.width=`${T}px`),o.groupHeaderElements.forEach(W=>{const U=W;let K;U.getAttribute("aria-colspan")==="1"?K=`${T}px`:K=`${U.offsetWidth+E}px`,U.style.width=K}),o.cellElements.forEach(W=>{const U=W;let K;U.getAttribute("aria-colspan")==="1"?K=`${T}px`:K=`${U.offsetWidth+E}px`,U.style.setProperty("--width",K)});const $=Rl(e),D=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);D===Cv.LEFT&&($_(o.fillerLeft,"width",E),o.leftPinnedCellsAfter.forEach(W=>{$_(W,"left",E)}),o.leftPinnedHeadersAfter.forEach(W=>{$_(W,"left",E)}),(G=(B=e.current.rootElementRef)==null?void 0:B.current)==null||G.style.setProperty(K7e(n,D),`${Y7e($,n,D)+M}px`)),D===Cv.RIGHT&&($_(o.fillerRight,"width",E),o.rightPinnedCellsBefore.forEach(W=>{$_(W,"right",E)}),o.rightPinnedHeadersBefore.forEach(W=>{$_(W,"right",E)}),(F=(H=e.current.rootElementRef)==null?void 0:H.current)==null||F.style.setProperty(K7e(n,D),`${Y7e($,n,D)+M}px`))},d=T=>{if(b(),o.previousMouseClickEvent){const P=o.previousMouseClickEvent,E=P.timeStamp,M=P.clientX,R=P.clientY;if(T.timeStamp-E<300&&T.clientX===M&&T.clientY===R){o.previousMouseClickEvent=void 0,e.current.publishEvent("columnResizeStop",null,T);return}}if(o.colDef){e.current.setColumnWidth(o.colDef.field,o.colDef.width),r.debug(`Updating col ${o.colDef.field} with new width: ${o.colDef.width}`);const P=oy(e);o.groupHeaderElements.forEach(E=>{const M=ojr(E),R=E,D=`${M.reduce((z,V)=>P.columnVisibilityModel[V]!==!1?z+P.lookup[V].computedWidth:z,0)}px`;R.style.width=D})}l.start(0,()=>{e.current.publishEvent("columnResizeStop",null,T)})},p=()=>{o.columnHeaderElement&&(o.cellElements=ajr(o.columnHeaderElement,e.current))},h=(T,P,E)=>{var D;const M=e.current.rootElementRef.current;o.initialColWidth=T.computedWidth,o.initialTotalWidth=e.current.getRootDimensions().rowWidth,o.colDef=T,o.columnHeaderElement=rjr(e.current.columnHeadersContainerRef.current,T.field);const R=M.querySelector(`.${Be.headerFilterRow} [data-field="${Lb(T.field)}"]`);R&&(o.headerFilterElement=R),o.groupHeaderElements=ijr((D=e.current.columnHeadersContainerRef)==null?void 0:D.current,T.field),p(),o.fillerLeft=A7e(e.current,n?"filler--pinnedRight":"filler--pinnedLeft"),o.fillerRight=A7e(e.current,n?"filler--pinnedLeft":"filler--pinnedRight");const $=e.current.unstable_applyPipeProcessors("isColumnPinned",!1,o.colDef.field);o.leftPinnedCellsAfter=$!==Cv.LEFT?[]:sjr(e.current,o.columnHeaderElement,n),o.rightPinnedCellsBefore=$!==Cv.RIGHT?[]:ljr(e.current,o.columnHeaderElement,n),o.leftPinnedHeadersAfter=$!==Cv.LEFT?[]:cjr(e.current,o.columnHeaderElement,n),o.rightPinnedHeadersBefore=$!==Cv.RIGHT?[]:ujr(e.current,o.columnHeaderElement,n),s.current=G_r(P,n),i.current=U_r(E,o.columnHeaderElement.getBoundingClientRect(),s.current)},m=no(d),g=no(T=>{if(T.buttons===0){m(T);return}let P=q7e(i.current,T.clientX,o.columnHeaderElement.getBoundingClientRect(),s.current);P=GE(P,o.colDef.minWidth,o.colDef.maxWidth),u(P);const E={element:o.columnHeaderElement,colDef:o.colDef,width:P};e.current.publishEvent("columnResize",E,T)}),y=no(T=>{G7e(T,c.current)&&d(T)}),x=no(T=>{const P=G7e(T,c.current);if(!P)return;if(T.type==="mousemove"&&T.buttons===0){y(T);return}let E=q7e(i.current,P.x,o.columnHeaderElement.getBoundingClientRect(),s.current);E=GE(E,o.colDef.minWidth,o.colDef.maxWidth),u(E);const M={element:o.columnHeaderElement,colDef:o.colDef,width:E};e.current.publishEvent("columnResize",M,T)}),v=no(T=>{const P=RW(T.target,Be["columnSeparator--resizable"]);if(!P)return;const E=T.changedTouches[0];E!=null&&(c.current=E.identifier);const M=RW(T.target,Be.columnHeader),R=njr(M),$=e.current.getColumn(R);r.debug(`Start Resize on col ${$.field}`),e.current.publishEvent("columnResizeStart",{field:R},T),h($,P,E.clientX);const D=Zl(T.currentTarget);D.addEventListener("touchmove",x),D.addEventListener("touchend",y)}),b=f.useCallback(()=>{const T=Zl(e.current.rootElementRef.current);T.body.style.removeProperty("cursor"),T.removeEventListener("mousemove",g),T.removeEventListener("mouseup",m),T.removeEventListener("touchmove",x),T.removeEventListener("touchend",y),setTimeout(()=>{T.removeEventListener("click",X7e,!0)},100),o.columnHeaderElement&&(o.columnHeaderElement.style.pointerEvents="unset")},[e,o,g,m,x,y]),w=f.useCallback(({field:T})=>{e.current.setState(P=>Se({},P,{columnResize:Se({},P.columnResize,{resizingColumnField:T})}))},[e]),S=f.useCallback(()=>{e.current.setState(T=>Se({},T,{columnResize:Se({},T.columnResize,{resizingColumnField:""})}))},[e]),C=no(({colDef:T},P)=>{if(P.button!==0||!P.currentTarget.classList.contains(Be["columnSeparator--resizable"]))return;P.preventDefault(),r.debug(`Start Resize on col ${T.field}`),e.current.publishEvent("columnResizeStart",{field:T.field},P),h(T,P.currentTarget,P.clientX);const E=Zl(e.current.rootElementRef.current);E.body.style.cursor="col-resize",o.previousMouseClickEvent=P.nativeEvent,E.addEventListener("mousemove",g),E.addEventListener("mouseup",m),E.addEventListener("click",X7e,!0)}),N=no((T,P)=>{if(t.disableAutosize||P.button!==0)return;const E=e.current.state.columns.lookup[T.field];E.resizable!==!1&&e.current.autosizeColumns(Se({},t.autosizeOptions,{disableColumnVirtualization:!1,columns:[E.field]}))}),j=q_r(e),I=f.useRef(!1),_=f.useCallback(async T=>{var $;if(!(($=e.current.rootElementRef)==null?void 0:$.current)||I.current)return;I.current=!0;const E=oy(e),M=Se({},B2r,T,{columns:(T==null?void 0:T.columns)??E.orderedFields});M.columns=M.columns.filter(D=>E.columnVisibilityModel[D]!==!1);const R=M.columns.map(D=>e.current.state.columns.lookup[D]);try{!t.disableVirtualization&&M.disableColumnVirtualization&&(e.current.unstable_setColumnVirtualization(!1),await j());const D=Y_r(e,M,R),z=R.map(V=>Se({},V,{width:D[V.field],computedWidth:D[V.field],flex:0}));if(M.expand){const B=E.orderedFields.map(W=>E.lookup[W]).filter(W=>E.columnVisibilityModel[W.field]!==!1).reduce((W,U)=>W+(D[U.field]??U.computedWidth??U.width),0),F=e.current.getRootDimensions().viewportInnerSize.width-B;if(F>0){const W=F/(z.length||1);z.forEach(U=>{U.width+=W,U.computedWidth+=W})}}e.current.updateColumns(z),z.forEach((V,B)=>{if(V.width!==R[B].width){const G=V.width;e.current.publishEvent("columnWidthChange",{element:e.current.getColumnHeaderElement(V.field),colDef:V,width:G})}})}finally{t.disableVirtualization||e.current.unstable_setColumnVirtualization(!0),I.current=!1}},[e,j,t.disableVirtualization]);f.useEffect(()=>b,[b]),oK(()=>{t.autosizeOnMount&&Promise.resolve().then(()=>{e.current.autosizeColumns(t.autosizeOptions)})}),Nyt(e,()=>{var T;return(T=e.current.columnHeadersContainerRef)==null?void 0:T.current},"touchstart",v,{passive:!0}),oi(e,{autosizeColumns:_},"public"),Nr(e,"columnResizeStop",S),Nr(e,"columnResizeStart",w),Nr(e,"columnSeparatorMouseDown",C),Nr(e,"columnSeparatorDoubleClick",N),Nr(e,"rowsSet",()=>{z2r(e)!==""&&requestAnimationFrame(()=>{p()})}),Ss(e,"columnResize",t.onColumnResize),Ss(e,"columnWidthChange",t.onColumnWidthChange)};function $_(e,t,n){e&&(e.style[t]=`${Math.round(parseFloat(e.style[t]))+n}px`)}function Z_r(e,t){return e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex<=t.lastRowIndex?null:e.firstRowIndex>=t.firstRowIndex&&e.lastRowIndex>t.lastRowIndex?{firstRowIndex:t.lastRowIndex,lastRowIndex:e.lastRowIndex}:e.firstRowIndex{if(!e)return null;const r=e[t.field];return t.rowSpanValueGetter?t.rowSpanValueGetter(r,e,t,n):_xt(e,t,n)},ePr={spannedCells:{},hiddenCells:{},hiddenCellOriginMap:{}},tPr={firstRowIndex:0,lastRowIndex:0},zj={caches:ePr,processedRange:tPr},nPr=(e,t,n,r,o,i)=>{const s=e.current.virtualizer,l=i?zj:HT.selectors.state(s.store.state),c=Se({},l.caches.spannedCells),u=Se({},l.caches.hiddenCells),d=Se({},l.caches.hiddenCellOriginMap),p={firstRowIndex:Math.min(l.processedRange.firstRowIndex,o.firstRowIndex),lastRowIndex:Math.max(l.processedRange.lastRowIndex,o.lastRowIndex)};return t.forEach((h,m)=>{var g;for(let y=o.firstRowIndex;y=r.firstRowIndex&&I&&Jne(I.model,h,e)===v;){const _=n[j+1];u[_.id]?u[_.id][m]=!0:u[_.id]={[m]:!0},C.push(y),S+=1,b=I.id,w=j,j-=1,I=n[j]}}C.forEach(j=>{d[j]?d[j][m]=w:d[j]={[m]:w}});let N=y+1;for(;N<=r.lastRowIndex&&n[N]&&Jne(n[N].model,h,e)===v;){const j=n[N];u[j.id]?u[j.id][m]=!0:u[j.id]={[m]:!0},d[N]?d[N][m]=w:d[N]={[m]:w},N+=1,S+=1}S>0&&(c[b]?c[b][m]=S+1:c[b]={[m]:S+1})}}),{caches:{spannedCells:c,hiddenCells:u,hiddenCellOriginMap:d},processedRange:p}},rPr=e=>Se({},e,{rowSpanning:zj}),oPr=(e,t)=>{const n=f.useCallback((s,l=!1)=>{const c=e.current.virtualizer.store,{range:u,rows:d}=jA(e);if(l&&c.set("rowSpanning",zj),u===null||!Q7e(s))return;const p=l?zj:HT.selectors.state(c.state),h=Z_r({firstRowIndex:s.firstRowIndex,lastRowIndex:Math.min(s.lastRowIndex,u.lastRowIndex-u.firstRowIndex+1)},p.processedRange);if(h===null)return;const m=yc(e),g=nPr(e,m,d,u,h,l),y=Object.keys(g.caches.spannedCells).length,x=Object.keys(g.caches.hiddenCells).length,v=Object.keys(p.caches.spannedCells).length,b=Object.keys(p.caches.hiddenCells).length;!(l||y!==v||x!==b)||y===0&&v===0||c.set("rowSpanning",g)},[e]),{schedule:r,cancel:o}=x2r(n),i=f.useCallback(()=>{const s=Cpe(e);Q7e(s)&&r(s,!0)},[e,r]);Nr(e,"renderedRowsIntervalChange",dh(t.rowSpanning,s=>{const l=o();n(s,l)})),Nr(e,"sortedRowsSet",dh(t.rowSpanning,i)),Nr(e,"paginationModelChange",dh(t.rowSpanning,i)),Nr(e,"filteredRowsSet",dh(t.rowSpanning,i)),Nr(e,"columnsChange",dh(t.rowSpanning,i)),Nr(e,"rowExpansionChange",dh(t.rowSpanning,i)),f.useEffect(()=>{var l;const s=(l=e.current.virtualizer)==null?void 0:l.store;s&&(t.rowSpanning?s.state.rowSpanning===zj&&n(Cpe(e)):s.state.rowSpanning!==zj&&s.set("rowSpanning",zj))},[e,t.rowSpanning,n])},iPr=(e,t,n)=>Se({},e,{listViewColumn:t.listViewColumn?Se({},t.listViewColumn,{computedWidth:Ppe(n)}):void 0});function aPr(e,t){const n=()=>{e.current.setState(i=>i.listViewColumn?Se({},i,{listViewColumn:Se({},i.listViewColumn,{computedWidth:Ppe(e)})}):i)},r=f.useRef(null);Nr(e,"viewportInnerSizeChange",i=>{r.current!==i.width&&(r.current=i.width,n())}),Nr(e,"columnVisibilityModelChange",n),Ia(()=>{const i=t.listViewColumn;i&&e.current.setState(s=>Se({},s,{listViewColumn:Se({},i,{computedWidth:Ppe(e)})}))},[e,t.listViewColumn]),f.useEffect(()=>{t.listView&&t.listViewColumn},[t.listView,t.listViewColumn])}function Ppe(e){return Rl(e).viewportInnerSize.width}const sPr=yr(Sd,Xg,sf,(e,t,n)=>({groupKeys:[],paginationModel:n,sortModel:t,filterModel:e,start:n.page*n.pageSize,end:n.page*n.pageSize+n.pageSize-1}));let tj=(function(e){return e.Default="set-flat-rows",e.LazyLoading="replace-row-range",e.GroupedData="set-grouped-rows",e})({});class XB{constructor(t){ze(this,"getCacheKeys",t=>{if(this.chunkSize<1||typeof t.start!="number")return[t];const n=[];for(let r=t.start;r<=t.end;r+=this.chunkSize){const o=Math.min(r+this.chunkSize-1,t.end);n.push(Se({},t,{start:r,end:o}))}return n});ze(this,"splitResponse",(t,n)=>{const r=this.getCacheKeys(t);if(r.length===1)return new Map([[t,n]]);const o=new Map;return r.forEach(i=>{var c,u,d,p;const s=i.end===t.end,l=Se({},n,{pageInfo:Se({},n.pageInfo,{hasNextPage:((c=n.pageInfo)==null?void 0:c.hasNextPage)!==void 0&&!s?!0:(u=n.pageInfo)==null?void 0:u.hasNextPage,nextCursor:((d=n.pageInfo)==null?void 0:d.nextCursor)!==void 0&&!s?n.rows[i.end+1].id:(p=n.pageInfo)==null?void 0:p.nextCursor}),rows:typeof i.start!="number"||typeof t.start!="number"?n.rows:n.rows.slice(i.start-t.start,i.end-t.start+1)});o.set(i,l)}),o});this.chunkSize=t}}ze(XB,"mergeResponses",t=>t.length===1?t[0]:t.reduce((n,r)=>Se({},r,{rows:[...n.rows,...r.rows]}),{rows:[],rowCount:0,pageInfo:{}}));const lPr=["skipCache","keepChildrenExpanded"],cPr={clear:()=>{},get:()=>{},set:()=>{}};function J7e(e,t={}){return e===null?cPr:e??new RCr(t)}const uPr=(e,t,n={})=>{var N,j;const r=f.useCallback(()=>{e.current.setStrategyAvailability($1.DataSource,tj.Default,t.dataSource?()=>!0:()=>!1)},[e,t.dataSource]),[o,i]=f.useState(e.current.getActiveStrategy($1.DataSource)),s=f.useMemo(()=>o===tj.Default||o===tj.GroupedData,[o]),l=Fn(e,sf),c=f.useRef(0),u=t.onDataSourceError,d=gm(()=>{if(!t.pagination)return new XB(l.pageSize);const I=t.pageSizeOptions.map(T=>typeof T=="number"?T:T.value).sort((T,P)=>T-P),_=Math.min(l.pageSize,I[0]);return new XB(_)}).current,[p,h]=f.useState(()=>J7e(t.dataSourceCache,n.cacheOptions)),m=f.useCallback(async(I,_)=>{var B,G,H;const T=(B=t.dataSource)==null?void 0:B.getRows;if(!T)return;if(I&&I!==pc&&t.signature!=="DataGrid"){(G=n.fetchRowChildren)==null||G.call(n,[I]);return}(H=n.clearDataSourceState)==null||H.call(n);const P=_||{},{skipCache:E,keepChildrenExpanded:M}=P,R=Zn(P,lPr),$=Se({},sPr(e),e.current.unstable_applyPipeProcessors("getRowsParams",{}),R),z=d.getCacheKeys($).map(F=>p.get(F));if(!E&&z.every(F=>F!==void 0)){e.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:XB.mergeResponses(z),fetchParams:$,options:{skipCache:E,keepChildrenExpanded:M}});return}(s||e.current.getRowsCount()===0)&&e.current.setLoading(!0);const V=c.current+1;c.current=V;try{const F=await T($);d.splitResponse($,F).forEach((U,K)=>p.set(K,U)),c.current===V&&e.current.applyStrategyProcessor("dataSourceRowsUpdate",{response:F,fetchParams:$,options:{skipCache:E,keepChildrenExpanded:M}})}catch(F){c.current===V&&(e.current.applyStrategyProcessor("dataSourceRowsUpdate",{error:F,fetchParams:$,options:{skipCache:E,keepChildrenExpanded:M}}),typeof u=="function"&&u(new OCr({message:F==null?void 0:F.message,params:$,cause:F})))}finally{s&&c.current===V&&e.current.setLoading(!1)}},[d,p,e,s,(N=t.dataSource)==null?void 0:N.getRows,u,n,t.signature]),g=f.useCallback(()=>{i(e.current.getActiveStrategy($1.DataSource))},[e]),y=f.useCallback(I=>{if("error"in I){e.current.setRows([]);return}const{response:_}=I;_.rowCount!==void 0&&e.current.setRowCount(_.rowCount),e.current.setRows(_.rows),e.current.unstable_applyPipeProcessors("processDataSourceRows",{params:I.fetchParams,response:_},!0)},[e]),x=(j=t.dataSource)==null?void 0:j.updateRow,v=n.handleEditRow,b=f.useCallback(async I=>{if(x)try{const _=await x(I);return typeof v=="function"?(v(I,_),_):(_&&!E0(_,I.previousRow)&&e.current.dataSource.cache.clear(),e.current.updateNestedRows([_],[]),_)}catch(_){throw typeof u=="function"&&u(new $Cr({message:_==null?void 0:_.message,params:I,cause:_})),_}},[e,x,u,v]),w={dataSource:{fetchRows:m,cache:p,editRow:b}},S=f.useMemo(()=>py(m,0),[m]),C=f.useRef(!0);return f.useEffect(()=>{if(C.current){C.current=!1;return}if(t.dataSourceCache===void 0)return;const I=J7e(t.dataSourceCache,n.cacheOptions);h(_=>_!==I?I:_)},[t.dataSourceCache,n.cacheOptions]),f.useEffect(()=>{if(!(o!==tj.Default&&o!==tj.LazyLoading&&o!==tj.GroupedData))return t.dataSource&&(e.current.dataSource.cache.clear(),e.current.dataSource.fetchRows()),()=>{c.current+=1}},[e,t.dataSource,o]),{api:{public:w},debouncedFetchRows:S,strategyProcessor:{strategyName:tj.Default,group:"dataSourceRowsUpdate",processor:y},setStrategyAvailability:r,cacheChunkManager:d,cache:p,events:{strategyAvailabilityChange:g,sortModelChange:dh(s,()=>S()),filterModelChange:dh(s,()=>S()),paginationModelChange:dh(s,()=>S())}}},dPr=(e,t)=>{const{api:n,strategyProcessor:r,events:o,setStrategyAvailability:i}=uPr(e,t);oi(e,n.public,"public"),bD(e,r.strategyName,r.group,r.processor),Object.entries(o).forEach(([s,l])=>{Nr(e,s,l)}),f.useEffect(()=>{i()},[i])},fPr=(e,t,n)=>{_5r(e,t),I_r(e,t),S_r(e),vd(E5r,e,t),vd(N_r,e,t),vd($5r,e,t),vd(x_r,e,t),vd(i_r,e,t),vd(m_r,e,t),vd(J5r,e,t),vd(__r,e,t),vd(s_r,e,t),vd(K5r,e,t),vd(rPr,e,t),vd(F5r,e,t),vd(X_r,e,t),vd(R5r,e,t),vd(B_r,e,t),vd(ICr,e,t),vd(M_r,e,t),vd(YCr,e,t),vd(iPr,e,t),n_r(e,t),j_r(e,t),D5r(e,t),y_r(e,t,n),oPr(e,t),C_r(e,t,n),F_r(e),H_r(e,t),g_r(e,t,n),Z5r(e,t),l_r(e,t),Q5r(e,t,n),P_r(e,t),z5r(e,t),J_r(e,t),a_r(e,t),A_r(e,t),O5r(e),H5r(e,t),q5r(e,t),M5r(e,t),O_r(e,t),T_r(e,t),L_r(e),_Cr(e,t),aPr(e,t),dPr(e,t),b5(()=>{e.current.runAppliersForPendingProcessors()}),f.useEffect(()=>{e.current.runAppliersForPendingProcessors()})},pPr=e=>{const{classes:t,headerAlign:n,isDragging:r,isLastColumn:o,showLeftBorder:i,showRightBorder:s,groupId:l,pinnedPosition:c}=e,u={root:["columnHeader",n==="left"&&"columnHeader--alignLeft",n==="center"&&"columnHeader--alignCenter",n==="right"&&"columnHeader--alignRight",r&&"columnHeader--moving",s&&"columnHeader--withRightBorder",i&&"columnHeader--withLeftBorder","withBorderColor",l===null?"columnHeader--emptyGroup":"columnHeader--filledGroup",c===Ni.LEFT&&"columnHeader--pinnedLeft",c===Ni.RIGHT&&"columnHeader--pinnedRight",o&&"columnHeader--last"],draggableContainer:["columnHeaderDraggableContainer"],titleContainer:["columnHeaderTitleContainer","withBorderColor"],titleContainerContent:["columnHeaderTitleContainerContent"]};return Un(u,ii,t)};function hPr(e){var V;const{groupId:t,width:n,depth:r,maxDepth:o,fields:i,height:s,colIndex:l,hasFocus:c,tabIndex:u,isLastColumn:d,pinnedPosition:p,pinnedOffset:h}=e,m=sr(),g=$d(),y=f.useRef(null),x=Eo(),v=Fn(x,byt),b=t?v[t]:{},{headerName:w=t??"",description:S="",headerAlign:C=void 0}=b;let N;const j=t&&((V=v[t])==null?void 0:V.renderHeaderGroup),I=f.useMemo(()=>({groupId:t,headerName:w,description:S,depth:r,maxDepth:o,fields:i,colIndex:l,isLastColumn:d}),[t,w,S,r,o,i,l,d]);t&&j&&(N=j(I));const _=Se({},e,{classes:m.classes,headerAlign:C,depth:r,isDragging:!1}),T=w??t,P=Jo(),E=t===null?`empty-group-cell-${P}`:t,M=pPr(_);f.useLayoutEffect(()=>{if(c){const G=y.current.querySelector('[tabindex="0"]')||y.current;if(!G)return;if(tX())G.focus({preventScroll:!0});else{const H=x.current.getScrollPosition();G.focus(),x.current.scroll(H)}}},[x,c]);const R=f.useCallback(B=>G=>{z6(G)||x.current.publishEvent(B,I,G)},[x,I]),$=f.useMemo(()=>({onKeyDown:R("columnGroupHeaderKeyDown"),onFocus:R("columnGroupHeaderFocus"),onBlur:R("columnGroupHeaderBlur")}),[R]),D=typeof b.headerClassName=="function"?b.headerClassName(I):b.headerClassName,z=f.useMemo(()=>nX(Se({},e.style),g,p,h),[p,h,e.style,g]);return a.jsx(Uyt,Se({ref:y,classes:M,columnMenuOpen:!1,colIndex:l,height:s,isResizing:!1,sortDirection:null,hasFocus:!1,tabIndex:u,isDraggable:!1,headerComponent:N,headerClassName:D,description:S,elementId:E,width:n,columnMenuIconButton:null,columnTitleIconButtons:null,resizable:!1,label:T,"aria-colspan":i.length,"data-fields":`|-${i.join("-|-")}-|`,style:z},$))}const Z7e={root:Be.scrollbarFiller,pinnedRight:Be["scrollbarFiller--pinnedRight"]};function mPr({pinnedRight:e}){return a.jsx("div",{role:"presentation",className:be(Z7e.root,e&&Z7e.pinnedRight)})}const e9e=Bt("div",{name:"MuiDataGrid",slot:"ColumnHeaderRow"})({display:"flex"}),gPr=e=>{const{visibleColumns:t,sortColumnLookup:n,filterColumnLookup:r,columnHeaderTabIndexState:o,columnGroupHeaderTabIndexState:i,columnHeaderFocus:s,columnGroupHeaderFocus:l,headerGroupingMaxDepth:c,columnMenuState:u,columnVisibility:d,columnGroupsHeaderStructure:p,hasOtherElementInTabSequence:h}=e,[m,g]=f.useState(""),[y,x]=f.useState(""),v=Th(),b=sr(),w=Fn(v,vyt),S=Fn(v,y5),C=Fn(v,kCr),N=Fn(v,VY),j=Fn(v,$b),I=Ayt(S,C,N.left.length),_=Fn(v,F1e),T=Fn(v,Nxt),P=Fn(v,E1r),E=Fn(v,I1r),M=Fn(v,jxt),R=f.useCallback(X=>x(X.field),[]),$=f.useCallback(()=>x(""),[]),D=f.useCallback(X=>g(X.field),[]),z=f.useCallback(()=>g(""),[]),V=f.useMemo(()=>N.left.length?{firstColumnIndex:0,lastColumnIndex:N.left.length}:null,[N.left.length]),B=f.useMemo(()=>N.right.length?{firstColumnIndex:t.length-N.right.length,lastColumnIndex:t.length}:null,[N.right.length,t.length]);Nr(v,"columnResizeStart",R),Nr(v,"columnResizeStop",$),Nr(v,"columnHeaderDragStart",D),Nr(v,"columnHeaderDragEndNative",z);const G=X=>{const{renderContext:J=C}=X||{},te=J.firstColumnIndex,re=Math.min(J.lastColumnIndex,t.length);return{renderedColumns:t.slice(te,re),firstColumnToRender:te,lastColumnToRender:re}},H=(X,J,te,re=!1)=>{const ce=(X==null?void 0:X.position)===Ni.RIGHT,ae=(X==null?void 0:X.position)===void 0,oe=N.right.length>0&&ce||N.right.length===0&&ae,ue=I-te;return a.jsxs(f.Fragment,{children:[ae&&a.jsx("div",{role:"presentation",style:{width:ue}}),J,ae&&a.jsx("div",{role:"presentation",className:be(Be.filler,re&&Be["filler--borderBottom"])}),oe&&a.jsx(mPr,{pinnedRight:ce})]})},F=(X,J={})=>{const{renderedColumns:te,firstColumnToRender:re}=G(X),ce=[];for(let ae=0;aea.jsxs(e9e,{role:"row","aria-rowindex":c+1,ownerState:b,className:Be["row--borderBottom"],style:{height:P},children:[V&&F({position:Ni.LEFT,renderContext:V},{disableReorder:!0}),F({renderContext:C}),B&&F({position:Ni.RIGHT,renderContext:B},{disableReorder:!0,separatorSide:awe.Left})]}),U=({depth:X,params:J})=>{var Re,Ue;const te=G(J);if(te.renderedColumns.length===0)return null;const{firstColumnToRender:re,lastColumnToRender:ce}=te,ae=p[X],oe=t[re].field,ue=((Re=w[oe])==null?void 0:Re[X])??null,fe=ae.findIndex(({groupId:He,columnFields:Ye})=>He===ue&&Ye.includes(oe)),se=t[ce-1].field,ge=((Ue=w[se])==null?void 0:Ue[X])??null,ye=ae.findIndex(({groupId:He,columnFields:Ye})=>He===ge&&Ye.includes(se)),de=ae.slice(fe,ye+1).map(He=>Se({},He,{columnFields:He.columnFields.filter(Ye=>d[Ye]!==!1)})).filter(He=>He.columnFields.length>0),Ne=de[0].columnFields.indexOf(oe),xe=de[0].columnFields.slice(0,Ne).reduce((He,Ye)=>{const We=j[Ye];return He+(We.computedWidth??0)},0);let we=re;const Te=de.map(({groupId:He,columnFields:Ye},We)=>{const at=l!==null&&l.depth===X&&Ye.includes(l.field),Oe=i!==null&&i.depth===X&&Ye.includes(i.field)?0:-1,Ae={width:Ye.reduce((Qe,lt)=>Qe+j[lt].computedWidth,0),fields:Ye,colIndex:we},qe=J.position,dt=ZO(qe,Ae.width,we,S,_,M);we+=Ye.length;let Ze=We;return qe===Ni.LEFT&&(Ze=we-1),a.jsx(hPr,{groupId:He,width:Ae.width,fields:Ae.fields,colIndex:Ae.colIndex,depth:X,isLastColumn:We===de.length-1,maxDepth:c,height:E,hasFocus:at,tabIndex:Oe,pinnedPosition:qe,pinnedOffset:dt,showLeftBorder:$W(qe,Ze,b.showColumnVerticalBorder,b.pinnedColumnsSectionSeparator),showRightBorder:OW(qe,Ze,de.length,b.showColumnVerticalBorder,T,b.pinnedColumnsSectionSeparator)},We)});return H(J,Te,xe)};return{renderContext:C,leftRenderContext:V,rightRenderContext:B,pinnedColumns:N,visibleColumns:t,columnPositions:S,getFillers:H,getColumnHeadersRow:W,getColumnsToRender:G,getColumnGroupHeadersRows:()=>{if(c===0)return null;const X=[];for(let J=0;J({role:"rowgroup"})}},xPr=["className"],yPr=e=>{const{classes:t}=e;return Un({root:["columnHeaders"]},ii,t)},vPr=Ai("div",{name:"MuiDataGrid",slot:"ColumnHeaders"})({display:"flex",flexDirection:"column",borderTopLeftRadius:"var(--unstable_DataGrid-radius)",borderTopRightRadius:"var(--unstable_DataGrid-radius)"}),bPr=Kr(function(t,n){const{className:r}=t,o=Zn(t,xPr),i=sr(),s=yPr(i);return a.jsx(vPr,Se({className:be(s.root,r),ownerState:i},o,{role:"presentation",ref:n}))}),wPr=["className","visibleColumns","sortColumnLookup","filterColumnLookup","columnHeaderTabIndexState","columnGroupHeaderTabIndexState","columnHeaderFocus","columnGroupHeaderFocus","headerGroupingMaxDepth","columnMenuState","columnVisibility","columnGroupsHeaderStructure","hasOtherElementInTabSequence"],SPr=Kr(function(t,n){const{visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:l,columnHeaderFocus:c,columnGroupHeaderFocus:u,headerGroupingMaxDepth:d,columnMenuState:p,columnVisibility:h,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:g}=t,y=Zn(t,wPr),{getInnerProps:x,getColumnHeadersRow:v,getColumnGroupHeadersRows:b}=gPr({visibleColumns:r,sortColumnLookup:o,filterColumnLookup:i,columnHeaderTabIndexState:s,columnGroupHeaderTabIndexState:l,columnHeaderFocus:c,columnGroupHeaderFocus:u,headerGroupingMaxDepth:d,columnMenuState:p,columnVisibility:h,columnGroupsHeaderStructure:m,hasOtherElementInTabSequence:g});return a.jsxs(bPr,Se({},y,x(),{ref:n,children:[b(),v()]}))}),CPr=rS(SPr);function NPr(e){return null}function jPr(e){return null}const EPr=Kr(function(t,n){const o=Eo().current.getLocaleText("noResultsOverlayLabel");return a.jsx(rX,Se({},t,{ref:n,children:o}))}),IPr=()=>Un({root:["bottomContainer"]},ii,{}),_Pr=Ai("div",{slot:"internal",shouldForwardProp:void 0})({position:"sticky",zIndex:40,bottom:"calc(var(--DataGrid-hasScrollX) * var(--DataGrid-scrollbarSize))"});function PPr(e){const t=IPr();return a.jsx(_Pr,Se({},e,{className:be(t.root,Be["container--bottom"]),role:"presentation"}))}const APr=Se({},g1r,{cell:fNr,skeletonCell:vNr,columnHeaderFilterIconButton:Ljr,columnHeaderSortIcon:$jr,columnMenu:eEr,columnHeaders:CPr,detailPanels:NPr,bottomContainer:PPr,footer:zIr,footerRowCount:n5r,toolbar:MIr,pinnedRows:jPr,loadingOverlay:KIr,noResultsOverlay:EPr,noRowsOverlay:YIr,noColumnsOverlay:XIr,pagination:JIr,filterPanel:PEr,columnsPanel:oEr,columnsManagement:LEr,panel:cEr,row:d5r}),TPr={disableMultipleColumnsFiltering:!0,disableMultipleColumnsSorting:!0,throttleRowsMs:void 0,hideFooterRowCount:!1,pagination:!0,checkboxSelectionVisibleOnly:!1,disableColumnReorder:!0,keepColumnPositionIfDraggedOutside:!1,signature:"DataGrid",listView:!1},kPr=e=>Se({},TPr,e.dataSource?{filterMode:"server",sortingMode:"server",paginationMode:"server"}:{}),MPr=APr,RPr=e=>{const t=xf(),n=f.useMemo(()=>NKe({props:e,theme:t,name:"MuiDataGrid"}),[t,e]),r=f.useMemo(()=>Se({},L1r,n.localeText),[n.localeText]),o=f.useMemo(()=>iNr({defaultSlots:MPr,slots:n.slots}),[n.slots]),i=f.useMemo(()=>Object.keys(MW).reduce((s,l)=>(s[l]=n[l]??MW[l],s),{}),[n]);return f.useMemo(()=>Se({},n,i,{localeText:r,slots:o},kPr(n)),[n,r,o,i])};class OPr{constructor(){ze(this,"maxListeners",20);ze(this,"warnOnce",!1);ze(this,"events",{})}on(t,n,r={}){let o=this.events[t];o||(o={highPriority:new Map,regular:new Map},this.events[t]=o),r.isFirst?o.highPriority.set(n,!0):o.regular.set(n,!0)}removeListener(t,n){this.events[t]&&(this.events[t].regular.delete(n),this.events[t].highPriority.delete(n))}removeAllListeners(){this.events={}}emit(t,...n){const r=this.events[t];if(!r)return;const o=Array.from(r.highPriority.keys()),i=Array.from(r.regular.keys());for(let s=o.length-1;s>=0;s-=1){const l=o[s];r.highPriority.has(l)&&l.apply(this,n)}for(let s=0;se.isPropagationStopped!==void 0;let t9e=0;function DPr(e){var o;const t=(o=e.current)==null?void 0:o[nvt];if(t)return t;const n={},r={state:n,store:BY.create(n),instanceId:{id:t9e}};return t9e+=1,r.getPublicApi=()=>e.current,r.register=(i,s)=>{Object.keys(s).forEach(l=>{const c=s[l],u=r[l];if((u==null?void 0:u.spying)===!0?u.target=c:r[l]=c,i==="public"){const d=e.current,p=d[l];(p==null?void 0:p.spying)===!0?p.target=c:d[l]=c}})},r.register("private",{caches:{},eventManager:new OPr}),r}function LPr(e){return{get state(){return e.current.state},get store(){return e.current.store},get instanceId(){return e.current.instanceId},[nvt]:e.current}}function FPr(e,t){var s;const n=f.useRef(null),r=f.useRef(null);r.current||(r.current=DPr(n)),n.current||(n.current=LPr(r));const o=f.useCallback((...l)=>{const[c,u,d={}]=l;if(d.defaultMuiPrevented=!1,$Pr(d)&&d.isPropagationStopped())return;const p=t.signature===ry.DataGridPro||t.signature===ry.DataGridPremium?{api:r.current.getPublicApi()}:{};r.current.eventManager.emit(c,u,d,p)},[r,t.signature]),i=f.useCallback((l,c,u)=>{r.current.eventManager.on(l,c,u);const d=r.current;return()=>{d.eventManager.removeListener(l,c)}},[r]);return oi(r,{subscribeEvent:i,publishEvent:o},"public"),e&&!((s=e.current)!=null&&s.state)&&(e.current=n.current),f.useImperativeHandle(e,()=>n.current,[n]),f.useEffect(()=>{const l=r.current;return()=>{l.publishEvent("unmount")}},[r]),r}const n9e={hooks:{useCSSVariables:ibr,useGridAriaAttributes:f5r,useGridRowAriaAttributes:p5r,useGridRowsOverridableMethods:h5r,useGridParamsOverridableMethods:m5r,useIsCellEditable:g5r,useCellAggregationResult:()=>null,useFilterValueGetter:e=>e.current.getRowValue}},rvt=function(t,n){var i;const r=RPr(t),o=FPr(r.apiRef,r);return fPr(o,r,n9e),a.jsx(x5r,{privateApiRef:o,configuration:n9e,props:r,children:a.jsx(ANr,Se({className:r.className,style:r.style,sx:r.sx},(i=r.slotProps)==null?void 0:i.root,{ref:n}))})},ovt=f.memo(Kr(rvt));rvt.propTypes={apiRef:Rt.shape({current:Rt.object}),"aria-label":Rt.string,"aria-labelledby":Rt.string,autoHeight:Rt.bool,autoPageSize:Rt.bool,autosizeOnMount:Rt.bool,autosizeOptions:Rt.shape({columns:Rt.arrayOf(Rt.string),disableColumnVirtualization:Rt.bool,expand:Rt.bool,includeHeaders:Rt.bool,includeOutliers:Rt.bool,outliersFactor:Rt.number}),cellModesModel:Rt.object,checkboxSelection:Rt.bool,classes:Rt.object,className:Rt.string,clipboardCopyCellDelimiter:Rt.string,columnBufferPx:Rt.number,columnFilterDebounceMs:Rt.number,columnGroupHeaderHeight:Rt.number,columnGroupingModel:Rt.arrayOf(Rt.object),columnHeaderHeight:Rt.number,columns:Rt.arrayOf(Rt.object).isRequired,columnVisibilityModel:Rt.object,dataSource:Rt.shape({getRows:Rt.func.isRequired,updateRow:Rt.func}),dataSourceCache:Rt.shape({clear:Rt.func.isRequired,get:Rt.func.isRequired,set:Rt.func.isRequired}),density:Rt.oneOf(["comfortable","compact","standard"]),disableAutosize:Rt.bool,disableColumnFilter:Rt.bool,disableColumnMenu:Rt.bool,disableColumnResize:Rt.bool,disableColumnSelector:Rt.bool,disableColumnSorting:Rt.bool,disableDensitySelector:Rt.bool,disableEval:Rt.bool,disableMultipleRowSelection:Rt.bool,disableRowSelectionExcludeModel:Rt.bool,disableRowSelectionOnClick:Rt.bool,disableVirtualization:Rt.bool,editMode:Rt.oneOf(["cell","row"]),estimatedRowCount:Rt.number,experimentalFeatures:Rt.shape({warnIfFocusStateIsNotSynced:Rt.bool}),filterDebounceMs:Rt.number,filterMode:Rt.oneOf(["client","server"]),filterModel:Rt.shape({items:Rt.arrayOf(Rt.shape({field:Rt.string.isRequired,id:Rt.oneOfType([Rt.number,Rt.string]),operator:Rt.string.isRequired,value:Rt.any})).isRequired,logicOperator:Rt.oneOf(["and","or"]),quickFilterExcludeHiddenColumns:Rt.bool,quickFilterLogicOperator:Rt.oneOf(["and","or"]),quickFilterValues:Rt.array}),getCellClassName:Rt.func,getDetailPanelContent:Rt.func,getEstimatedRowHeight:Rt.func,getRowClassName:Rt.func,getRowHeight:Rt.func,getRowId:Rt.func,getRowSpacing:Rt.func,hideFooter:Rt.bool,hideFooterPagination:Rt.bool,hideFooterSelectedRowCount:Rt.bool,ignoreDiacritics:Rt.bool,ignoreValueFormatterDuringExport:Rt.oneOfType([Rt.shape({clipboardExport:Rt.bool,csvExport:Rt.bool}),Rt.bool]),initialState:Rt.object,isCellEditable:Rt.func,isRowSelectable:Rt.func,keepNonExistentRowsSelected:Rt.bool,label:Rt.string,loading:Rt.bool,localeText:Rt.object,logger:Rt.shape({debug:Rt.func.isRequired,error:Rt.func.isRequired,info:Rt.func.isRequired,warn:Rt.func.isRequired}),logLevel:Rt.oneOf(["debug","error","info","warn",!1]),nonce:Rt.string,onCellClick:Rt.func,onCellDoubleClick:Rt.func,onCellEditStart:Rt.func,onCellEditStop:Rt.func,onCellKeyDown:Rt.func,onCellModesModelChange:Rt.func,onClipboardCopy:Rt.func,onColumnHeaderClick:Rt.func,onColumnHeaderContextMenu:Rt.func,onColumnHeaderDoubleClick:Rt.func,onColumnHeaderEnter:Rt.func,onColumnHeaderLeave:Rt.func,onColumnHeaderOut:Rt.func,onColumnHeaderOver:Rt.func,onColumnOrderChange:Rt.func,onColumnResize:Rt.func,onColumnVisibilityModelChange:Rt.func,onColumnWidthChange:Rt.func,onDataSourceError:Rt.func,onDensityChange:Rt.func,onFilterModelChange:Rt.func,onMenuClose:Rt.func,onMenuOpen:Rt.func,onPaginationMetaChange:Rt.func,onPaginationModelChange:Rt.func,onPreferencePanelClose:Rt.func,onPreferencePanelOpen:Rt.func,onProcessRowUpdateError:Rt.func,onResize:Rt.func,onRowClick:Rt.func,onRowCountChange:Rt.func,onRowDoubleClick:Rt.func,onRowEditStart:Rt.func,onRowEditStop:Rt.func,onRowModesModelChange:Rt.func,onRowSelectionModelChange:Rt.func,onSortModelChange:Rt.func,onStateChange:Rt.func,pageSizeOptions:Rt.arrayOf(Rt.oneOfType([Rt.number,Rt.shape({label:Rt.string.isRequired,value:Rt.number.isRequired})]).isRequired),pagination:Rt.oneOf([!0]),paginationMeta:Rt.shape({hasNextPage:Rt.bool}),paginationMode:Rt.oneOf(["client","server"]),paginationModel:Rt.shape({page:Rt.number.isRequired,pageSize:Rt.number.isRequired}),processRowUpdate:Rt.func,resizeThrottleMs:Rt.number,rowBufferPx:Rt.number,rowCount:Rt.number,rowHeight:Rt.number,rowModesModel:Rt.object,rows:Rt.arrayOf(Rt.object),rowSelection:Rt.bool,rowSelectionModel:Rt.shape({ids:Rt.instanceOf(Set).isRequired,type:Rt.oneOf(["exclude","include"]).isRequired}),rowSpacingType:Rt.oneOf(["border","margin"]),rowSpanning:Rt.bool,scrollbarSize:Rt.number,showCellVerticalBorder:Rt.bool,showColumnVerticalBorder:Rt.bool,showToolbar:Rt.bool,slotProps:Rt.object,slots:Rt.object,sortingMode:Rt.oneOf(["client","server"]),sortingOrder:Rt.arrayOf(Rt.oneOf(["asc","desc"])),sortModel:Rt.arrayOf(Rt.shape({field:Rt.string.isRequired,sort:Rt.oneOf(["asc","desc"])})),style:Rt.object,sx:Rt.oneOfType([Rt.arrayOf(Rt.oneOfType([Rt.func,Rt.object,Rt.bool])),Rt.func,Rt.object]),virtualizeColumnsWithAutoRowHeight:Rt.bool};const zPr="",BPr=sL({palette:{mode:"dark",primary:{main:"#00f2ff",dark:"#00a8b3",light:"#70f9ff"},secondary:{main:"#7000ff"},background:{default:"#050a14",paper:"#0d1526"},success:{main:"#00ff88"},error:{main:"#ff0055"},warning:{main:"#ffcc00"},text:{primary:"#e0e6ed",secondary:"#94a3b8"}},typography:{fontFamily:'"Inter", "Roboto Mono", monospace',h4:{fontWeight:800,letterSpacing:"-0.02em"},h6:{fontWeight:700,letterSpacing:"0.01em"},button:{textTransform:"none",fontWeight:600}},shape:{borderRadius:12},components:{MuiPaper:{styleOverrides:{root:{backgroundImage:"none",border:"1px solid rgba(255, 255, 255, 0.05)"}}},MuiButton:{styleOverrides:{root:{boxShadow:"none","&:hover":{boxShadow:"0 0 20px rgba(0, 242, 255, 0.3)"}}}}}});var XE;let HPr=(XE=class{static async encryptAndStore(t,n){const r=Math.random().toString(36).substring(7),o=btoa(n+"|"+r);this.storage.set(t,o),console.log(`[Vault] Securely stored ${t} using homomorphic mapping.`)}static getEncrypted(t){return this.storage.get(t)}static async simulateOperationOnEncrypted(t){return this.storage.has(t)}},XE.storage=new Map,XE.masterKey="QUANTUM_DEMO_MASTER_KEY_2024",XE);new Ko({apiKey:zPr});const VPr=async(e,t)=>"AI Engine Offline: GEMINI_API_KEY missing.",UPr=e=>{const t=["Treasury","Payroll","Vendor Payment","Dividend","FX Swap"],n=["Amazon Web Services","Stripe Terminal","SpaceX Logistics","Apple Inc","Global Custody"];return Array.from({length:e}).map((r,o)=>({id:`TX-${1e3+o}`,BookgDt:new Date(Date.now()-Math.random()*1e10).toISOString(),ValDt:new Date().toISOString(),Amt:Math.floor(Math.random()*5e4)+100,CdtDbtInd:Math.random()>.4?"DBIT":"CRDT",NtryRef:`REF-${Math.random().toString(36).toUpperCase().substring(0,8)}`,AddtlNtryInf:`Standard ${t[Math.floor(Math.random()*t.length)]} operation.`,Sts:"BOOKED",Category:t[Math.floor(Math.random()*t.length)],Merchant:n[Math.floor(Math.random()*n.length)],RiskScore:Math.floor(Math.random()*100)}))},WPr=()=>{const[e,t]=f.useState(UPr(25)),[n,r]=f.useState([]),[o,i]=f.useState([{id:"1",sender:"ai",text:"Welcome to the cockpit of Quantum Financial. I'm your Co-Pilot. Ready to kick the tires on this engine? I can analyze your cash flow or execute wires for you.",timestamp:new Date}]),[s,l]=f.useState(""),[c,u]=f.useState(!1),[d,p]=f.useState(!1),[h,m]=f.useState(!1),[g,y]=f.useState(!1),[x,v]=f.useState(0),[b,w]=f.useState(!1),[S,C]=f.useState("IDLE"),[N,j]=f.useState({recipient:"",amount:"",ref:"",type:"WIRE"}),[I,_]=f.useState({provider:"Stripe",key:""}),T=f.useRef(null),P=f.useCallback((D,z,V="SUCCESS")=>{const B={id:`AUD-${Date.now()}`,timestamp:new Date().toISOString(),action:D,actor:"Demo_User_Alpha",details:z,ipAddress:"192.168.1.101",status:V};r(G=>[B,...G])},[]),E=async()=>{var B;if(!s.trim())return;const D={id:Date.now().toString(),sender:"user",text:s,timestamp:new Date};i(G=>[...G,D]),l(""),w(!0),e.reduce((G,H)=>H.CdtDbtInd==="CRDT"?G+H.Amt:G-H.Amt,0),e.length,(B=n[0])!=null&&B.action;const z=await VPr();let V=z;if(z.includes("@@ACTION:")){const G=z.match(/@@ACTION:(.*?)@@/);if(G){const H=JSON.parse(G[1]);H.type==="CREATE_WIRE"&&(j({recipient:H.recipient,amount:H.amount.toString(),ref:"AI-GENERATED",type:"WIRE"}),m(!0)),V=z.replace(/@@ACTION:.*?@@/,"")}}i(G=>[...G,{id:(Date.now()+1).toString(),sender:"ai",text:V,timestamp:new Date}]),w(!1),P("AI_INTERACTION",`User asked: ${s.substring(0,30)}...`,"SUCCESS")},M=()=>{const D={id:`TX-${Date.now()}`,BookgDt:new Date().toISOString(),ValDt:new Date().toISOString(),Amt:parseFloat(N.amount),CdtDbtInd:"DBIT",NtryRef:N.ref||`WIRE-${Math.random().toString(36).toUpperCase().substring(0,5)}`,AddtlNtryInf:`Outbound ${N.type} to ${N.recipient}`,Sts:"PENDING",Category:"Treasury",Merchant:N.recipient,RiskScore:12};t(z=>[D,...z]),P("PAYMENT_EXECUTION",`Wire of ${N.amount} to ${N.recipient} initiated.`,"SUCCESS"),m(!1),j({recipient:"",amount:"",ref:"",type:"WIRE"}),setTimeout(()=>{t(z=>z.map(V=>V.id===D.id?{...V,Sts:"BOOKED"}:V)),P("FRAUD_MONITOR",`Transaction ${D.id} cleared security protocols.`,"SUCCESS")},3e3)},R=async()=>{C("CONNECTING"),P("INTEGRATION_ATTEMPT","Connecting to Stripe API Gateway","SUCCESS"),await new Promise(D=>setTimeout(D,2e3)),await HPr.encryptAndStore("STRIPE_PROD_KEY",I.key),C("ACTIVE"),P("INTEGRATION_SUCCESS","Stripe Homomorphic Vault Storage Complete","SUCCESS"),y(!1)},$=[{field:"BookgDt",headerName:"Booking Date",width:130,valueFormatter:D=>new Date(D.value).toLocaleDateString()},{field:"Merchant",headerName:"Counterparty",width:200,renderCell:D=>{var z;return a.jsxs(Dn,{sx:{display:"flex",alignItems:"center",gap:1},children:[a.jsx(Pxe,{sx:{width:24,height:24,fontSize:"0.7rem",bgcolor:"secondary.main"},children:((z=D.value)==null?void 0:z[0])||"Q"}),a.jsx(tn,{variant:"body2",children:D.value})]})}},{field:"Amt",headerName:"Amount",width:150,align:"right",renderCell:D=>a.jsxs(tn,{sx:{fontWeight:700,color:D.row.CdtDbtInd==="CRDT"?"success.main":"text.primary",fontFamily:"Roboto Mono"},children:[D.row.CdtDbtInd==="CRDT"?"+":"-",new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(D.value)]})},{field:"Sts",headerName:"Status",width:120,renderCell:D=>a.jsx(bh,{label:D.value,size:"small",variant:"outlined",color:D.value==="BOOKED"?"success":"warning",sx:{fontWeight:700,fontSize:"0.65rem"}})},{field:"RiskScore",headerName:"Risk Index",width:150,renderCell:D=>a.jsx(Dn,{sx:{width:"100%"},children:a.jsx(a5,{variant:"determinate",value:D.value,color:D.value>70?"error":D.value>40?"warning":"success",sx:{height:6,borderRadius:3}})})},{field:"NtryRef",headerName:"Reference",width:180,renderCell:D=>a.jsx(tn,{variant:"caption",sx:{opacity:.6,fontFamily:"Roboto Mono"},children:D.value})}];return a.jsx(zKe,{theme:BPr,children:a.jsxs(Dn,{sx:{display:"flex",height:"100vh",bgcolor:"background.default",overflow:"hidden"},children:[a.jsxs(Dn,{sx:{width:80,borderRight:"1px solid rgba(255,255,255,0.05)",display:"flex",flexDirection:"column",alignItems:"center",py:3,gap:4},children:[a.jsx(Dn,{sx:{width:40,height:40,bgcolor:"primary.main",borderRadius:"12px",display:"flex",alignItems:"center",justifyContent:"center",color:"#000",fontWeight:900},children:"Q"}),a.jsx(Rv,{title:"Dashboard",placement:"right",children:a.jsx(Zs,{color:"primary",children:a.jsx("span",{children:"📊"})})}),a.jsx(Rv,{title:"Payments",placement:"right",children:a.jsx(Zs,{sx:{color:"text.secondary"},children:a.jsx("span",{children:"💸"})})}),a.jsx(Rv,{title:"Integrations",placement:"right",children:a.jsx(Zs,{sx:{color:"text.secondary"},onClick:()=>y(!0),children:a.jsx("span",{children:"🔌"})})}),a.jsx(Dn,{sx:{mt:"auto"},children:a.jsx(Rv,{title:"Audit Logs",placement:"right",children:a.jsx(Zs,{onClick:()=>p(!0),children:a.jsx("span",{children:"📜"})})})})]}),a.jsxs(Dn,{sx:{flex:1,display:"flex",flexDirection:"column",p:4,overflowY:"auto"},children:[a.jsxs(Dn,{sx:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",mb:4},children:[a.jsxs(Dn,{children:[a.jsxs(tn,{variant:"h4",gutterBottom:!0,children:["Quantum Financial ",a.jsx(bh,{label:"PRO DEMO",color:"primary",size:"small",sx:{ml:2,fontWeight:900}})]}),a.jsxs(tn,{variant:"body2",color:"text.secondary",children:["Welcome back, ",a.jsx("strong",{children:"Demo User"}),". Your engine is running at peak performance."]})]}),a.jsxs(Zp,{direction:"row",spacing:2,children:[a.jsx(ta,{variant:"outlined",startIcon:a.jsx("span",{children:"⚡"}),onClick:()=>y(!0),children:"Integrations"}),a.jsx(ta,{variant:"contained",color:"primary",startIcon:a.jsx("span",{children:"➕"}),onClick:()=>m(!0),sx:{px:4},children:"New Payment"})]})]}),a.jsxs(br,{container:!0,spacing:3,sx:{mb:4},children:[a.jsx(br,{item:!0,xs:12,md:3,children:a.jsx(p0,{sx:{bgcolor:"rgba(0, 242, 255, 0.03)"},children:a.jsxs(h0,{children:[a.jsx(tn,{variant:"caption",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:1},children:"Total Liquidity"}),a.jsx(tn,{variant:"h4",sx:{mt:1,color:"primary.main"},children:"$4,290,150.00"}),a.jsx(tn,{variant:"caption",color:"success.main",children:"▲ 12.5% from last month"})]})})}),a.jsx(br,{item:!0,xs:12,md:3,children:a.jsx(p0,{children:a.jsxs(h0,{children:[a.jsx(tn,{variant:"caption",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:1},children:"Pending Wires"}),a.jsx(tn,{variant:"h4",sx:{mt:1},children:e.filter(D=>D.Sts==="PENDING").length}),a.jsx(tn,{variant:"caption",color:"text.secondary",children:"Awaiting compliance check"})]})})}),a.jsx(br,{item:!0,xs:12,md:3,children:a.jsx(p0,{children:a.jsxs(h0,{children:[a.jsx(tn,{variant:"caption",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:1},children:"Security Status"}),a.jsx(tn,{variant:"h4",sx:{mt:1,color:"success.main"},children:"SHIELD ON"}),a.jsx(tn,{variant:"caption",color:"text.secondary",children:"Homomorphic Vault Active"})]})})}),a.jsx(br,{item:!0,xs:12,md:3,children:a.jsx(p0,{children:a.jsxs(h0,{children:[a.jsx(tn,{variant:"caption",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:1},children:"Stripe Status"}),a.jsx(tn,{variant:"h4",sx:{mt:1,color:S==="ACTIVE"?"success.main":"warning.main"},children:S}),a.jsx(tn,{variant:"caption",color:"text.secondary",children:"Real-time sync enabled"})]})})})]}),a.jsx(ea,{sx:{flex:1,minHeight:500,borderRadius:4,overflow:"hidden"},children:a.jsx(ovt,{rows:e,columns:$,slots:{toolbar:OIr},pageSizeOptions:[10,25,50],initialState:{pagination:{paginationModel:{pageSize:10}}},sx:{border:"none","& .MuiDataGrid-columnHeaders":{bgcolor:"rgba(255,255,255,0.02)",borderBottom:"1px solid rgba(255,255,255,0.05)"},"& .MuiDataGrid-cell":{borderBottom:"1px solid rgba(255,255,255,0.02)"},"& .MuiDataGrid-row:hover":{bgcolor:"rgba(0, 242, 255, 0.05)"}}})})]}),a.jsxs(Dn,{sx:{width:c?400:0,transition:"width 0.3s cubic-bezier(0.4, 0, 0.2, 1)",bgcolor:"background.paper",borderLeft:"1px solid rgba(255,255,255,0.05)",display:"flex",flexDirection:"column",position:"relative"},children:[!c&&a.jsx(ta,{onClick:()=>u(!0),sx:{position:"absolute",left:-120,top:100,transform:"rotate(-90deg)",bgcolor:"primary.main",color:"#000",borderRadius:"8px 8px 0 0","&:hover":{bgcolor:"primary.light"}},children:"AI CO-PILOT"}),c&&a.jsxs(a.Fragment,{children:[a.jsxs(Dn,{sx:{p:3,borderBottom:"1px solid rgba(255,255,255,0.05)",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[a.jsx(tn,{variant:"h6",children:"Navigator AI"}),a.jsx(Zs,{onClick:()=>u(!1),size:"small",children:a.jsx("span",{children:"✖"})})]}),a.jsxs(Dn,{sx:{flex:1,overflowY:"auto",p:3,display:"flex",flexDirection:"column",gap:2},children:[o.map(D=>a.jsxs(Dn,{sx:{alignSelf:D.sender==="user"?"flex-end":"flex-start",maxWidth:"85%",bgcolor:D.sender==="user"?"primary.main":"rgba(255,255,255,0.05)",color:D.sender==="user"?"#000":"text.primary",p:2,borderRadius:3,borderBottomRightRadius:D.sender==="user"?0:12,borderBottomLeftRadius:D.sender==="ai"?0:12},children:[a.jsx(tn,{variant:"body2",children:D.text}),a.jsx(tn,{variant:"caption",sx:{opacity:.5,mt:1,display:"block",fontSize:"0.6rem"},children:D.timestamp.toLocaleTimeString()})]},D.id)),b&&a.jsx(su,{size:20,sx:{ml:2}}),a.jsx("div",{ref:T})]}),a.jsx(Dn,{sx:{p:3,borderTop:"1px solid rgba(255,255,255,0.05)"},children:a.jsx(la,{fullWidth:!0,placeholder:"Ask the Navigator...",value:s,onChange:D=>l(D.target.value),onKeyPress:D=>D.key==="Enter"&&E(),InputProps:{endAdornment:a.jsx(mse,{position:"end",children:a.jsx(Zs,{onClick:E,color:"primary",children:a.jsx("span",{children:"🚀"})})})}})})]})]}),a.jsx(kxe,{anchor:"right",open:d,onClose:()=>p(!1),children:a.jsxs(Dn,{sx:{width:450,p:4,bgcolor:"background.default",height:"100%"},children:[a.jsx(tn,{variant:"h5",gutterBottom:!0,children:"Audit Storage"}),a.jsx(tn,{variant:"body2",color:"text.secondary",sx:{mb:4},children:"Immutable record of all sensitive actions within the Quantum engine."}),a.jsx(Mv,{children:n.map(D=>a.jsxs(ih,{sx:{mb:2,bgcolor:"rgba(255,255,255,0.02)",borderRadius:2,flexDirection:"column",alignItems:"flex-start"},children:[a.jsxs(Dn,{sx:{display:"flex",justifyContent:"space-between",width:"100%",mb:1},children:[a.jsx(bh,{label:D.action,size:"small",color:D.status==="SUCCESS"?"primary":"error"}),a.jsx(tn,{variant:"caption",color:"text.secondary",children:new Date(D.timestamp).toLocaleString()})]}),a.jsx(tn,{variant:"body2",children:D.details}),a.jsxs(tn,{variant:"caption",sx:{mt:1,opacity:.5},children:["Actor: ",D.actor," | IP: ",D.ipAddress]})]},D.id))})]})}),a.jsxs(yT,{open:h,onClose:()=>m(!1),maxWidth:"sm",fullWidth:!0,children:[a.jsx(wT,{sx:{bgcolor:"background.paper",borderBottom:"1px solid rgba(255,255,255,0.05)"},children:"Execute New Payment"}),a.jsx(bT,{sx:{bgcolor:"background.paper",pt:3},children:a.jsxs(Zp,{spacing:3,children:[a.jsx(zf,{severity:"info",children:"All payments are subject to real-time fraud monitoring."}),a.jsx(la,{label:"Recipient Name",fullWidth:!0,value:N.recipient,onChange:D=>j({...N,recipient:D.target.value})}),a.jsxs(br,{container:!0,spacing:2,children:[a.jsx(br,{item:!0,xs:6,children:a.jsx(la,{label:"Amount",type:"number",fullWidth:!0,value:N.amount,onChange:D=>j({...N,amount:D.target.value}),InputProps:{startAdornment:a.jsx(mse,{position:"start",children:"$"})}})}),a.jsx(br,{item:!0,xs:6,children:a.jsxs(la,{select:!0,label:"Method",fullWidth:!0,SelectProps:{native:!0},value:N.type,onChange:D=>j({...N,type:D.target.value}),children:[a.jsx("option",{value:"WIRE",children:"Domestic Wire"}),a.jsx("option",{value:"ACH",children:"ACH Transfer"}),a.jsx("option",{value:"SWIFT",children:"SWIFT (International)"})]})})]}),a.jsx(la,{label:"Reference / Invoice #",fullWidth:!0,value:N.ref,onChange:D=>j({...N,ref:D.target.value})})]})}),a.jsxs(vT,{sx:{bgcolor:"background.paper",p:3},children:[a.jsx(ta,{onClick:()=>m(!1),children:"Cancel"}),a.jsx(ta,{variant:"contained",color:"primary",onClick:M,children:"Confirm & Send"})]})]}),a.jsxs(yT,{open:g,onClose:()=>y(!1),maxWidth:"xs",fullWidth:!0,children:[a.jsx(wT,{children:"Connect Integration"}),a.jsx(bT,{children:a.jsxs(Zp,{spacing:3,sx:{mt:1},children:[a.jsxs(tn,{variant:"body2",color:"text.secondary",children:["Keys are stored in our ",a.jsx("strong",{children:"Homomorphic Vault"}),". Even we can't see them."]}),a.jsxs(la,{select:!0,label:"Provider",fullWidth:!0,SelectProps:{native:!0},value:I.provider,onChange:D=>_({...I,provider:D.target.value}),children:[a.jsx("option",{value:"Stripe",children:"Stripe"}),a.jsx("option",{value:"QuickBooks",children:"QuickBooks"}),a.jsx("option",{value:"Xero",children:"Xero"}),a.jsx("option",{value:"Plastiq",children:"Plastiq"})]}),a.jsx(la,{label:"API Secret Key",type:"password",fullWidth:!0,value:I.key,onChange:D=>_({...I,key:D.target.value})}),a.jsx(rrt,{control:a.jsx(Cse,{defaultChecked:!0}),label:"Enable Auto-Sync"})]})}),a.jsxs(vT,{sx:{p:3},children:[a.jsx(ta,{onClick:()=>y(!1),children:"Cancel"}),a.jsx(ta,{variant:"contained",color:"primary",onClick:R,disabled:S==="CONNECTING",children:S==="CONNECTING"?"Encrypting...":"Secure Connect"})]})]})]})})};var GPr={};let qPr=class qR{constructor(){this.storage=new Map}static getInstance(){return qR.instance||(qR.instance=new qR),qR.instance}async secureStore(t,n){const r=btoa(`QUANTUM_ENC_${n}_${Date.now()}`),o=Math.random().toString(36).substring(7);this.storage.set(t,{cipher:r,noise:o})}async blindVerify(t,n){const r=this.storage.get(t);return r?atob(r.cipher).includes(`QUANTUM_ENC_${n}_`):!1}};const r9e=()=>[{id:"f1",type:"IP_GEOLOCATION",score:.98,status:"PASS",details:"Originating IP matches known corporate headquarters."},{id:"f2",type:"VELOCITY_CHECK",score:.95,status:"PASS",details:"Transaction frequency within normal operational bounds."},{id:"f3",type:"BEHAVIORAL_BIOMETRICS",score:.88,status:"PASS",details:"Keystroke dynamics match authorized user profile."},{id:"f4",type:"DEVICE_FINGERPRINT",score:.99,status:"PASS",details:"Trusted device ID recognized and verified."}],nj=({children:e,variant:t="primary",isLoading:n,icon:r,...o})=>{const i="relative px-6 py-3 rounded-xl font-bold transition-all duration-500 flex items-center justify-center gap-3 overflow-hidden group active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed",s={primary:"bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 text-white shadow-[0_0_20px_rgba(37,99,235,0.3)]",secondary:"bg-slate-800/80 hover:bg-slate-700 text-slate-200 border border-slate-700/50 backdrop-blur-md",ghost:"bg-transparent hover:bg-white/5 text-slate-400 hover:text-white",danger:"bg-red-600/20 hover:bg-red-600/40 text-red-400 border border-red-500/30"};return a.jsxs("button",{className:`${i} ${s[t]}`,disabled:n,...o,children:[a.jsx("div",{className:"absolute inset-0 w-1/2 h-full bg-white/10 skew-x-[-25deg] -translate-x-full group-hover:translate-x-[300%] transition-transform duration-1000 ease-in-out"}),n?a.jsx(qf,{className:"w-5 h-5 animate-spin"}):a.jsxs(a.Fragment,{children:[r&&a.jsx(r,{className:"w-5 h-5"}),e]})]})},KPr=({level:e,status:t="Success"})=>{const n={Standard:"bg-blue-500/10 text-blue-400 border-blue-500/20",Elevated:"bg-amber-500/10 text-amber-400 border-amber-500/20",Critical:"bg-red-500/10 text-red-400 border-red-500/20"};return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`text-[9px] px-2 py-0.5 rounded-full border font-bold tracking-tighter uppercase ${n[e]}`,children:e}),a.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${t==="Success"?"bg-emerald-500":t==="Warning"?"bg-amber-500":"bg-red-500"} animate-pulse`})]})},YPr=({isOpen:e,onClose:t,onSuccess:n,externalAccount:r})=>{const[o,i]=f.useState("initiate"),[s,l]=f.useState(!1),[c,u]=f.useState(null),[d,p]=f.useState(""),[h,m]=f.useState([]),[g,y]=f.useState(!1),[x,v]=f.useState([]),[b,w]=f.useState("idle"),[S,C]=f.useState(""),[N,j]=f.useState([]),[I,_]=f.useState(!1),[T,P]=f.useState(!1);f.useMemo(()=>qPr.getInstance(),[]);const E=f.useRef(null),M=f.useMemo(()=>{const B=GPr.NEXT_PUBLIC_GEMINI_API_KEY||"DEMO_MODE";return new Ko(B)},[]),R=f.useCallback((B,G={},H="Standard",F="Success")=>{const W={id:`LOG-${Math.random().toString(36).substr(2,9).toUpperCase()}`,timestamp:new Date().toISOString(),action:B,actor:"SYSTEM_ARCHITECT_01",metadata:G,securityLevel:H,status:F};m(U=>[W,...U].slice(0,100))},[]),$=async B=>{const G=S;if(!G.trim())return;const H={role:"user",content:G};j(F=>[...F,H]),C(""),_(!0),R("AI_COMMAND_RECEIVED",{prompt:G},"Standard");try{const F=M.getGenerativeModel({model:"gemini-1.5-flash"}),W=` You are the Quantum Financial AI Core. Context: You are assisting a high-net-worth business user in a "Golden Ticket" demo environment. Current Verification Step: ${o}. External Account: ${r==null?void 0:r.party_name} (${r==null?void 0:r.account_type}). Capabilities: - You can trigger UI actions by including tags: [ACTION:NEXT_STEP], [ACTION:SHOW_AUDIT], [ACTION:ROAR_ENGINE], [ACTION:SIMULATE_FRAUD]. - You provide elite, professional, and secure financial advice. - You never mention Citibank. You are Quantum Financial. - You can explain complex terms like Homomorphic Encryption or Heuristic Fraud Analysis. Tone: High-performance, secure, slightly futuristic. `,K=(await F.generateContent([W,...N.map(X=>X.content),G])).response.text();K.includes("[ACTION:NEXT_STEP]")&&D(),K.includes("[ACTION:SHOW_AUDIT]")&&y(!0),K.includes("[ACTION:ROAR_ENGINE]")&&(P(!0),setTimeout(()=>P(!1),3e3)),K.includes("[ACTION:SIMULATE_FRAUD]")&&v(r9e()),j(X=>[...X,{role:"ai",content:K.replace(/\[ACTION:.*\]/g,"")}]),R("AI_RESPONSE_GENERATED",{tokens:K.length},"Standard")}catch(F){j(W=>[...W,{role:"ai",content:"Neural link latency detected. Please proceed with manual overrides."}]),R("AI_CORE_LATENCY",{error:String(F)},"Elevated","Warning")}finally{_(!1)}},D=async()=>{switch(l(!0),R("TRANSITION_STEP",{from:o},"Standard"),await new Promise(B=>setTimeout(B,1200)),o){case"initiate":i("mfa"),R("MFA_CHALLENGE_ISSUED",{method:"SMS_SECURE"},"Elevated");break;case"mfa":i("fraud_analysis"),v(r9e()),R("FRAUD_ENGINE_SCAN_COMPLETE",{signals:4},"Critical");break;case"fraud_analysis":i("erp_sync"),R("ERP_INTEGRATION_INITIATED",{provider:"QUICKBOOKS_ONLINE"},"Standard");break;case"erp_sync":i("final_review");break;case"final_review":i("success"),R("VERIFICATION_FINALIZED",{accountId:r==null?void 0:r.id},"Critical"),n();break}l(!1)},z=async()=>{w("syncing"),R("ERP_DATA_STREAM_START",{},"Standard"),await new Promise(B=>setTimeout(B,2500)),w("complete"),R("ERP_DATA_STREAM_SYNCED",{records:142},"Standard")};f.useEffect(()=>{E.current&&E.current.scrollIntoView({behavior:"smooth"})},[N,I]);const V=()=>{switch(o){case"initiate":return a.jsxs(wd.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"space-y-6",children:[a.jsxs("div",{className:"p-6 bg-blue-500/5 border border-blue-500/20 rounded-2xl flex items-start gap-4",children:[a.jsx("div",{className:"p-3 bg-blue-500/20 rounded-xl text-blue-400",children:a.jsx(vi,{className:"w-6 h-6"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-lg font-bold text-white",children:"Global Account Link"}),a.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["You are initiating a secure link with ",a.jsx("b",{children:r==null?void 0:r.party_name}),". This process uses Quantum Financial's proprietary verification engine."]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"p-4 bg-slate-900/50 border border-slate-800 rounded-xl",children:[a.jsx("span",{className:"text-[10px] text-slate-500 uppercase font-bold",children:"Routing Number"}),a.jsx("p",{className:"text-white font-mono mt-1",children:r==null?void 0:r.routing_number})]}),a.jsxs("div",{className:"p-4 bg-slate-900/50 border border-slate-800 rounded-xl",children:[a.jsx("span",{className:"text-[10px] text-slate-500 uppercase font-bold",children:"Account Suffix"}),a.jsxs("p",{className:"text-white font-mono mt-1",children:["•••• ",r==null?void 0:r.account_number_suffix]})]})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("p",{className:"text-xs text-slate-500 italic",children:"* Micro-deposits will be initiated to verify ownership. This is a non-pressure environment."}),a.jsx(nj,{onClick:D,isLoading:s,icon:_a,children:"Start Verification Engine"})]})]});case"mfa":return a.jsxs(wd.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"space-y-6",children:[a.jsxs("div",{className:"text-center space-y-2",children:[a.jsx("div",{className:"inline-flex p-4 bg-amber-500/10 rounded-full text-amber-500 mb-2",children:a.jsx(tDt,{className:"w-8 h-8"})}),a.jsx("h3",{className:"text-xl font-bold text-white",children:"Multi-Factor Authentication"}),a.jsx("p",{className:"text-sm text-slate-400",children:"Enter the 6-digit code sent to your secure device."})]}),a.jsx("div",{className:"flex justify-center gap-3",children:[1,2,3,4,5,6].map(B=>a.jsx("input",{type:"text",maxLength:1,className:"w-12 h-14 bg-slate-900 border border-slate-700 rounded-xl text-center text-xl font-bold text-blue-400 focus:border-blue-500 focus:ring-4 focus:ring-blue-500/10 outline-none transition-all",onChange:G=>{G.target.value&&B===6&&D()}},B))}),a.jsxs("div",{className:"flex flex-col gap-3",children:[a.jsx(nj,{onClick:D,isLoading:s,variant:"primary",children:"Verify Identity"}),a.jsx(nj,{variant:"ghost",children:"Resend Code"})]})]});case"fraud_analysis":return a.jsxs(wd.div,{initial:{opacity:0},animate:{opacity:1},className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h3",{className:"text-lg font-bold text-white flex items-center gap-2",children:[a.jsx(ri,{className:"w-5 h-5 text-emerald-500"}),"Heuristic Fraud Engine"]}),a.jsx("span",{className:"text-[10px] font-mono text-emerald-500 bg-emerald-500/10 px-2 py-1 rounded",children:"SECURE_LINK_ESTABLISHED"})]}),a.jsx("div",{className:"space-y-3",children:x.map(B=>a.jsxs("div",{className:"p-4 bg-slate-900/80 border border-slate-800 rounded-xl flex items-center justify-between group hover:border-blue-500/30 transition-all",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:`p-2 rounded-lg ${B.status==="PASS"?"bg-emerald-500/10 text-emerald-500":"bg-amber-500/10 text-amber-500"}`,children:[B.type==="IP_GEOLOCATION"&&a.jsx(vi,{className:"w-4 h-4"}),B.type==="VELOCITY_CHECK"&&a.jsx(Xi,{className:"w-4 h-4"}),B.type==="BEHAVIORAL_BIOMETRICS"&&a.jsx(kd,{className:"w-4 h-4"}),B.type==="DEVICE_FINGERPRINT"&&a.jsx(Fu,{className:"w-4 h-4"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-bold text-slate-200",children:B.type.replace(/_/g," ")}),a.jsx("p",{className:"text-[10px] text-slate-500",children:B.details})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsxs("p",{className:"text-xs font-mono text-emerald-400",children:[(B.score*100).toFixed(1),"%"]}),a.jsx("p",{className:"text-[9px] text-slate-600 uppercase tracking-widest",children:"Confidence"})]})]},B.id))}),a.jsx(nj,{onClick:D,isLoading:s,icon:nd,children:"Proceed to Integration"})]});case"erp_sync":return a.jsxs(wd.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},className:"space-y-6",children:[a.jsxs("div",{className:"p-8 bg-gradient-to-br from-slate-900 to-slate-950 border border-slate-800 rounded-3xl text-center space-y-4",children:[a.jsxs("div",{className:"relative inline-block",children:[a.jsx("div",{className:"absolute inset-0 bg-blue-500/20 blur-2xl rounded-full animate-pulse"}),a.jsx("div",{className:"relative p-6 bg-slate-800 rounded-2xl border border-slate-700",children:a.jsx(Fu,{className:"w-12 h-12 text-blue-400"})})]}),a.jsx("h3",{className:"text-2xl font-bold text-white",children:"ERP Synchronization"}),a.jsx("p",{className:"text-sm text-slate-400 max-w-xs mx-auto",children:"Automatically map your chart of accounts and reconcile transactions with your accounting software."})]}),a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"flex items-center justify-between p-4 bg-slate-900/50 border border-slate-800 rounded-xl",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 bg-white/5 rounded flex items-center justify-center",children:a.jsx(ss,{className:"w-4 h-4 text-slate-400"})}),a.jsx("span",{className:"text-sm font-medium text-slate-200",children:"QuickBooks Online"})]}),b==="complete"?a.jsxs("span",{className:"text-xs text-emerald-500 flex items-center gap-1",children:[a.jsx(dg,{className:"w-3 h-3"})," Synced"]}):a.jsx("button",{onClick:z,disabled:b==="syncing",className:"text-xs text-blue-400 hover:text-blue-300 font-bold",children:b==="syncing"?"Syncing...":"Connect"})]})}),a.jsx(nj,{onClick:D,isLoading:s,disabled:b!=="complete",children:"Review & Finalize"})]});case"final_review":return a.jsxs(wd.div,{initial:{opacity:0},animate:{opacity:1},className:"space-y-6",children:[a.jsxs("div",{className:"space-y-4",children:[a.jsx("h3",{className:"text-lg font-bold text-white",children:"Final Review"}),a.jsxs("div",{className:"p-6 bg-slate-900/80 border border-slate-800 rounded-2xl space-y-4",children:[a.jsxs("div",{className:"flex justify-between py-2 border-b border-slate-800",children:[a.jsx("span",{className:"text-sm text-slate-500",children:"Entity Name"}),a.jsx("span",{className:"text-sm text-white font-bold",children:r==null?void 0:r.party_name})]}),a.jsxs("div",{className:"flex justify-between py-2 border-b border-slate-800",children:[a.jsx("span",{className:"text-sm text-slate-500",children:"Account Type"}),a.jsx("span",{className:"text-sm text-white",children:r==null?void 0:r.account_type})]}),a.jsxs("div",{className:"flex justify-between py-2 border-b border-slate-800",children:[a.jsx("span",{className:"text-sm text-slate-500",children:"Security Protocol"}),a.jsx("span",{className:"text-sm text-blue-400 font-mono",children:"QUANTUM_VAULT_V4"})]}),a.jsxs("div",{className:"flex justify-between py-2",children:[a.jsx("span",{className:"text-sm text-slate-500",children:"Audit Status"}),a.jsx("span",{className:"text-sm text-emerald-500",children:"CLEARED"})]})]})]}),a.jsxs("div",{className:"p-4 bg-amber-500/5 border border-amber-500/20 rounded-xl flex gap-3",children:[a.jsx(zu,{className:"w-5 h-5 text-amber-500 shrink-0"}),a.jsx("p",{className:"text-[11px] text-amber-200/70",children:"By finalizing, you authorize Quantum Financial to establish a persistent secure link for automated treasury operations."})]}),a.jsx(nj,{onClick:D,isLoading:s,variant:"primary",icon:ri,children:"Authorize & Complete"})]});case"success":return a.jsxs(wd.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},className:"text-center space-y-6 py-8",children:[a.jsxs("div",{className:"relative inline-block",children:[a.jsx(wd.div,{animate:{scale:[1,1.2,1],rotate:[0,360]},transition:{duration:2,repeat:1/0},className:"absolute inset-0 bg-emerald-500/20 blur-3xl rounded-full"}),a.jsx("div",{className:"relative w-24 h-24 bg-emerald-500 rounded-full flex items-center justify-center shadow-[0_0_50px_rgba(16,185,129,0.4)]",children:a.jsx(dg,{className:"w-12 h-12 text-white"})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h2",{className:"text-3xl font-black text-white tracking-tight",children:"Verification Successful"}),a.jsx("p",{className:"text-slate-400",children:"Your account is now part of the Quantum Financial ecosystem."})]}),a.jsx("div",{className:"pt-4",children:a.jsx(nj,{onClick:t,variant:"secondary",children:"Return to Dashboard"})})]})}};return e?a.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4 md:p-8",children:[a.jsx(wd.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:"absolute inset-0 bg-slate-950/80 backdrop-blur-xl"}),a.jsxs(wd.div,{initial:{scale:.9,y:20,opacity:0},animate:{scale:1,y:0,opacity:1},className:`relative w-full max-w-6xl h-[85vh] bg-slate-900 border border-slate-800 rounded-[2.5rem] shadow-2xl overflow-hidden flex flex-col md:flex-row transition-all duration-500 ${T?"ring-4 ring-blue-500/50 shadow-blue-500/20 scale-[1.01]":""}`,children:[a.jsxs("div",{className:"flex-1 flex flex-col min-w-0 border-r border-slate-800",children:[a.jsxs("div",{className:"p-8 border-b border-slate-800 flex items-center justify-between bg-slate-900/50 backdrop-blur-md sticky top-0 z-10",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:"w-12 h-12 bg-blue-600 rounded-2xl flex items-center justify-center shadow-lg shadow-blue-600/20",children:a.jsx(Ei,{className:"w-6 h-6 text-white"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-xl font-black text-white tracking-tight uppercase",children:"Quantum Financial"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Verification Core v4.2"}),a.jsx("span",{className:"w-1 h-1 bg-slate-700 rounded-full"}),a.jsx("span",{className:"text-[10px] font-mono text-blue-400",children:o.toUpperCase()})]})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("button",{onClick:()=>y(!g),className:`p-3 rounded-xl transition-all ${g?"bg-blue-600 text-white":"bg-slate-800 text-slate-400 hover:bg-slate-700"}`,title:"Audit Logs",children:a.jsx(Bs,{className:"w-5 h-5"})}),a.jsx("button",{onClick:t,className:"p-3 bg-slate-800 hover:bg-slate-700 text-slate-400 rounded-xl transition-all",children:a.jsx(ds,{className:"w-5 h-5"})})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-8 md:p-12 custom-scrollbar",children:a.jsx("div",{className:"max-w-2xl mx-auto",children:V()})}),a.jsxs("div",{className:"p-6 bg-slate-950/50 border-t border-slate-800",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("span",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"System Integrity"}),a.jsx("span",{className:"text-[10px] font-mono text-emerald-500",children:"99.99% OPERATIONAL"})]}),a.jsx("div",{className:"h-1.5 w-full bg-slate-800 rounded-full overflow-hidden",children:a.jsx(wd.div,{className:"h-full bg-gradient-to-r from-blue-600 to-indigo-500",initial:{width:"0%"},animate:{width:o==="initiate"?"20%":o==="mfa"?"40%":o==="fraud_analysis"?"60%":o==="erp_sync"?"80%":"100%"}})})]})]}),a.jsxs("div",{className:"w-full md:w-[400px] bg-slate-950 flex flex-col",children:[a.jsxs("div",{className:"p-6 border-b border-slate-800 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute inset-0 bg-blue-500/20 blur-lg rounded-full animate-pulse"}),a.jsx(Lw,{className:"w-5 h-5 text-blue-400 relative"})]}),a.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"AI Command Center"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-emerald-500 rounded-full animate-pulse"}),a.jsx("span",{className:"text-[9px] font-bold text-emerald-500 uppercase",children:"Live"})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-4 custom-scrollbar",children:[N.length===0&&a.jsxs("div",{className:"text-center py-12 space-y-4",children:[a.jsx("div",{className:"p-4 bg-slate-900 rounded-2xl border border-slate-800 inline-block",children:a.jsx(_a,{className:"w-8 h-8 text-blue-500/50"})}),a.jsx("p",{className:"text-xs text-slate-500 px-8",children:'I am your Quantum Financial Assistant. Ask me to "Start verification", "Show audit logs", or "Explain the fraud engine".'})]}),N.map((B,G)=>a.jsx(wd.div,{initial:{opacity:0,x:B.role==="user"?10:-10},animate:{opacity:1,x:0},className:`flex ${B.role==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[85%] p-4 rounded-2xl text-xs leading-relaxed ${B.role==="user"?"bg-blue-600 text-white rounded-tr-none":"bg-slate-900 text-slate-300 border border-slate-800 rounded-tl-none"}`,children:B.content})},G)),I&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-slate-900 p-4 rounded-2xl border border-slate-800 flex gap-1",children:[a.jsx("span",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("span",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("span",{className:"w-1.5 h-1.5 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})}),a.jsx("div",{ref:E})]}),a.jsx("div",{className:"p-6 bg-slate-900/50 border-t border-slate-800",children:a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:S,onChange:B=>C(B.target.value),onKeyDown:B=>B.key==="Enter"&&$(),placeholder:"Command the AI...",className:"w-full bg-slate-950 border border-slate-800 rounded-xl py-3 pl-4 pr-12 text-xs text-white focus:outline-none focus:border-blue-500 transition-all"}),a.jsx("button",{onClick:()=>$(),className:"absolute right-2 top-1/2 -translate-y-1/2 p-2 text-blue-500 hover:text-blue-400 transition-colors",children:a.jsx(Lc,{className:"w-4 h-4"})})]})})]}),a.jsx(g5,{children:g&&a.jsxs(wd.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:25,stiffness:200},className:"absolute inset-y-0 right-0 w-full md:w-[500px] bg-slate-950 border-l border-slate-800 z-50 flex flex-col shadow-2xl",children:[a.jsxs("div",{className:"p-6 border-b border-slate-800 flex items-center justify-between bg-slate-900/50",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Bs,{className:"w-5 h-5 text-blue-400"}),a.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"System Audit Trail"})]}),a.jsx("button",{onClick:()=>y(!1),className:"p-2 hover:bg-slate-800 rounded-lg text-slate-500 transition-all",children:a.jsx(nd,{className:"w-5 h-5"})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-4 custom-scrollbar",children:h.map(B=>a.jsxs("div",{className:"p-4 bg-slate-900/50 border border-slate-800 rounded-xl space-y-3 group hover:border-slate-700 transition-all",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(KPr,{level:B.securityLevel,status:B.status}),a.jsx("span",{className:"text-[9px] font-mono text-slate-600",children:new Date(B.timestamp).toLocaleTimeString()})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-bold text-slate-200",children:B.action}),a.jsxs("p",{className:"text-[10px] text-slate-500 font-mono mt-1",children:["ID: ",B.id]})]}),Object.keys(B.metadata).length>0&&a.jsx("div",{className:"p-3 bg-black/40 rounded-lg",children:a.jsx("pre",{className:"text-[9px] text-blue-400/80 overflow-x-auto",children:JSON.stringify(B.metadata,null,2)})})]},B.id))}),a.jsx("div",{className:"p-6 border-t border-slate-800 bg-slate-900/50",children:a.jsxs("div",{className:"flex items-center justify-between text-[10px] font-bold text-slate-500 uppercase",children:[a.jsxs("span",{children:["Total Entries: ",h.length]}),a.jsx("span",{className:"text-blue-400 cursor-pointer hover:underline",children:"Export CSV"})]})})]})})]}),a.jsx("style",{children:` .custom-scrollbar::-webkit-scrollbar { width: 4px; } .custom-scrollbar::-webkit-scrollbar-track { background: transparent; } .custom-scrollbar::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 10px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #334155; } `})]}):null};class KP{constructor(){this.storage=new Map,this.salt="QUANTUM_SECURE_2024_ALPHA"}static getInstance(){return KP.instance||(KP.instance=new KP),KP.instance}encrypt(t){const n=o=>o.split("").map(i=>i.charCodeAt(0)),r=o=>n(this.salt).reduce((i,s)=>i^s,o);return btoa(t.split("").map(n).map(r).join(","))}store(t,n){const r=this.encrypt(n);this.storage.set(t,r)}get(t){return this.storage.get(t)}}const XPr=({details:e,hideSensitive:t=!0})=>{const[n,r]=f.useState(e),[o,i]=f.useState(!t),[s,l]=f.useState([]),[c,u]=f.useState(!1),[d,p]=f.useState([{role:"assistant",content:"Welcome to Quantum Financial. I am your AI Treasury Assistant. How can I help you manage your ACH configurations today?"}]),[h,m]=f.useState(""),[g,y]=f.useState(!1),[x,v]=f.useState(!1),[b,w]=f.useState("idle"),[S,C]=f.useState(!1),N=f.useRef(null),j=KP.getInstance();f.useEffect(()=>{I("VIEW_COMPONENT","System",{component:"ACHDetailsDisplay"}),j.store("ACH_ROUTING",e.routingNumber),j.store("ACH_ACCOUNT",e.realAccountNumber)},[]),f.useEffect(()=>{var E;(E=N.current)==null||E.scrollIntoView({behavior:"smooth"})},[d]);const I=(E,M,R)=>{const $={id:`LOG-${Math.random().toString(36).substr(2,9).toUpperCase()}`,timestamp:new Date().toISOString(),action:E,actor:M,metadata:R};l(D=>[$,...D].slice(0,50)),console.log(`[AUDIT] ${E}`,$)},_=async()=>{if(!h.trim())return;const E=h;m(""),p(M=>[...M,{role:"user",content:E}]),y(!0),I("AI_QUERY","User",{query:E});try{const R=new Ko("").getGenerativeModel({model:"gemini-3-flash-preview"}),$=` You are the Quantum Financial AI Assistant. Context: The user is viewing their ACH Details for "The Demo Bank". Current Details: ${JSON.stringify(n)} User Request: "${E}" Instructions: 1. If the user wants to change details (routing, account, bank), respond with a JSON block starting with { "action": "UPDATE_ACH", ... }. 2. If the user wants to initiate a payment, respond with { "action": "INITIATE_PAYMENT" }. 3. Otherwise, provide a professional, elite financial response. 4. Never mention Citibank. `,z=(await R.generateContent($)).response.text();if(z.includes("UPDATE_ACH"))try{const V=z.match(/\{.*\}/s);if(V){const B=JSON.parse(V[0]),G={...n,...B.payload};r(G),p(H=>[...H,{role:"assistant",content:"I have updated your ACH configurations as requested. The changes are now reflected in the secure vault."}]),I("AI_ACTION_UPDATE","QuantumAI",{newDetails:G})}}catch{p(B=>[...B,{role:"assistant",content:z}])}else z.includes("INITIATE_PAYMENT")?(v(!0),p(V=>[...V,{role:"assistant",content:"I've opened the Stripe payment gateway for you. You can now 'test drive' the transaction engine."}]),I("AI_ACTION_PAYMENT","QuantumAI",{})):p(V=>[...V,{role:"assistant",content:z}])}catch(M){console.error("AI Error:",M),p(R=>[...R,{role:"assistant",content:"I apologize, but I'm experiencing a connection latency with the Quantum core. Please try again."}])}finally{y(!1)}},T=()=>{w("processing"),I("STRIPE_INITIATED","User",{amount:5e3,currency:"USD"}),setTimeout(()=>{w("success"),I("STRIPE_SUCCESS","StripeGateway",{transactionId:"ch_3N"+Math.random().toString(36).substr(2,10)}),setTimeout(()=>{v(!1),w("idle")},2e3)},2500)},P=E=>E.length<=4?"****":`****${E.slice(-4)}`;return a.jsxs("div",{className:"relative min-h-screen bg-slate-900 text-slate-100 font-sans p-8 overflow-hidden",children:[a.jsxs("div",{className:"absolute top-0 left-0 w-full h-full opacity-10 pointer-events-none",children:[a.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[40%] h-[40%] bg-blue-500 rounded-full blur-[120px]"}),a.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[40%] h-[40%] bg-emerald-500 rounded-full blur-[120px]"})]}),a.jsxs("div",{className:"max-w-6xl mx-auto relative z-10",children:[a.jsxs("header",{className:"flex justify-between items-center mb-12 border-b border-slate-700 pb-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-4xl font-extrabold tracking-tighter bg-gradient-to-r from-blue-400 to-emerald-400 bg-clip-text text-transparent",children:"QUANTUM FINANCIAL"}),a.jsx("p",{className:"text-slate-400 text-sm uppercase tracking-widest mt-1",children:"Global Business Treasury • Demo Environment"})]}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("div",{className:"px-4 py-2 bg-slate-800 rounded-full border border-slate-700 flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-emerald-500 rounded-full animate-pulse"}),a.jsx("span",{className:"text-xs font-mono",children:"SYSTEMS NOMINAL"})]}),a.jsx("button",{onClick:()=>u(!c),className:"px-6 py-2 bg-blue-600 hover:bg-blue-500 transition-all rounded-lg font-bold text-sm shadow-lg shadow-blue-900/20",children:c?"CLOSE ASSISTANT":"OPEN AI ASSISTANT"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[a.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[a.jsxs("div",{className:"bg-slate-800/50 backdrop-blur-xl border border-slate-700 rounded-2xl p-8 shadow-2xl",children:[a.jsxs("div",{className:"flex justify-between items-start mb-8",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold mb-1",children:"ACH Payment Details"}),a.jsx("p",{className:"text-slate-400 text-sm",children:"Securely manage your corporate disbursement channels."})]}),a.jsx("button",{onClick:()=>{i(!o),I(o?"HIDE_SENSITIVE":"REVEAL_SENSITIVE","User",{})},className:"text-xs font-bold text-blue-400 hover:text-blue-300 underline underline-offset-4",children:o?"OBFUSCATE DATA":"REVEAL SECURE DATA"})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] uppercase tracking-widest text-slate-500 font-bold",children:"Bank Institution"}),a.jsx("div",{className:"text-xl font-semibold text-slate-200",children:n.bankName})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] uppercase tracking-widest text-slate-500 font-bold",children:"Account Type"}),a.jsx("div",{className:"text-xl font-semibold text-slate-200",children:n.accountType})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] uppercase tracking-widest text-slate-500 font-bold",children:"Routing Number (ABA)"}),a.jsx("div",{className:"text-2xl font-mono text-emerald-400",children:o?n.routingNumber:P(n.routingNumber)})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] uppercase tracking-widest text-slate-500 font-bold",children:"Account Number (DDA)"}),a.jsx("div",{className:"text-2xl font-mono text-emerald-400",children:o?n.realAccountNumber:P(n.realAccountNumber)})]})]}),a.jsxs("div",{className:"mt-10 pt-8 border-t border-slate-700 flex flex-wrap gap-4",children:[a.jsx("button",{onClick:()=>C(!0),className:"px-6 py-3 bg-slate-700 hover:bg-slate-600 rounded-xl font-bold text-sm transition-all",children:"Edit Configuration"}),a.jsx("button",{onClick:()=>v(!0),className:"px-6 py-3 bg-emerald-600 hover:bg-emerald-500 rounded-xl font-bold text-sm transition-all shadow-lg shadow-emerald-900/20",children:"Test Drive Payment (Stripe)"}),a.jsx("button",{className:"px-6 py-3 bg-slate-800 border border-slate-700 hover:border-slate-500 rounded-xl font-bold text-sm transition-all",onClick:()=>I("EXPORT_DETAILS","User",{format:"PDF"}),children:"Export Audit PDF"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"bg-slate-800/30 border border-slate-700 p-6 rounded-2xl",children:[a.jsx("div",{className:"text-slate-500 text-[10px] font-bold uppercase mb-2",children:"Fraud Risk Score"}),a.jsx("div",{className:"text-3xl font-bold text-emerald-400",children:"0.02"}),a.jsx("div",{className:"w-full bg-slate-700 h-1 mt-4 rounded-full overflow-hidden",children:a.jsx("div",{className:"bg-emerald-500 h-full w-[2%]"})})]}),a.jsxs("div",{className:"bg-slate-800/30 border border-slate-700 p-6 rounded-2xl",children:[a.jsx("div",{className:"text-slate-500 text-[10px] font-bold uppercase mb-2",children:"Monthly Volume"}),a.jsx("div",{className:"text-3xl font-bold text-blue-400",children:"$1.2M"}),a.jsx("div",{className:"text-[10px] text-slate-400 mt-2",children:"↑ 12% from last month"})]}),a.jsxs("div",{className:"bg-slate-800/30 border border-slate-700 p-6 rounded-2xl",children:[a.jsx("div",{className:"text-slate-500 text-[10px] font-bold uppercase mb-2",children:"Uptime SLA"}),a.jsx("div",{className:"text-3xl font-bold text-slate-200",children:"99.99%"}),a.jsx("div",{className:"text-[10px] text-emerald-500 mt-2",children:"Quantum Core Active"})]})]})]}),a.jsxs("div",{className:"bg-slate-900/80 border border-slate-800 rounded-2xl flex flex-col h-[600px]",children:[a.jsxs("div",{className:"p-4 border-b border-slate-800 flex justify-between items-center",children:[a.jsx("h3",{className:"text-xs font-bold uppercase tracking-widest text-slate-400",children:"Live Audit Storage"}),a.jsx("span",{className:"text-[10px] bg-blue-900/40 text-blue-400 px-2 py-1 rounded",children:"ENCRYPTED"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 font-mono text-[10px]",children:[s.map(E=>a.jsxs("div",{className:"border-l-2 border-slate-700 pl-3 py-1",children:[a.jsx("div",{className:"text-slate-500",children:new Date(E.timestamp).toLocaleTimeString()}),a.jsx("div",{className:"text-blue-400 font-bold",children:E.action}),a.jsxs("div",{className:"text-slate-300",children:["Actor: ",E.actor]})]},E.id)),s.length===0&&a.jsx("div",{className:"text-slate-600 italic",children:"Waiting for telemetry..."})]})]})]})]}),c&&a.jsxs("div",{className:"fixed bottom-8 right-8 w-96 h-[500px] bg-slate-800 border border-blue-500/30 shadow-2xl rounded-2xl flex flex-col z-50 animate-in slide-in-from-bottom-10 duration-300",children:[a.jsxs("div",{className:"p-4 border-b border-slate-700 bg-blue-600 rounded-t-2xl flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2 h-2 bg-white rounded-full animate-pulse"}),a.jsx("span",{className:"font-bold text-sm",children:"Quantum AI Assistant"})]}),a.jsx("button",{onClick:()=>u(!1),className:"text-white/70 hover:text-white",children:"✕"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[d.map((E,M)=>a.jsx("div",{className:`flex ${E.role==="user"?"justify-end":"justify-start"}`,children:a.jsx("div",{className:`max-w-[80%] p-3 rounded-xl text-sm ${E.role==="user"?"bg-blue-600 text-white":"bg-slate-700 text-slate-200"}`,children:E.content})},M)),g&&a.jsx("div",{className:"flex justify-start",children:a.jsx("div",{className:"bg-slate-700 p-3 rounded-xl text-sm animate-pulse",children:"Quantum is thinking..."})}),a.jsx("div",{ref:N})]}),a.jsx("div",{className:"p-4 border-t border-slate-700",children:a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:h,onChange:E=>m(E.target.value),onKeyDown:E=>E.key==="Enter"&&_(),placeholder:"Ask AI to update details or pay...",className:"w-full bg-slate-900 border border-slate-700 rounded-lg py-2 px-4 text-sm focus:outline-none focus:border-blue-500 transition-all"}),a.jsx("button",{onClick:_,className:"absolute right-2 top-1.5 text-blue-500 hover:text-blue-400",children:a.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:a.jsx("path",{d:"M10.894 2.553a1 1 0 00-1.788 0l-7 14a1 1 0 001.169 1.409l5-1.429A1 1 0 009 15.571V11a1 1 0 112 0v4.571a1 1 0 00.725.962l5 1.428a1 1 0 001.17-1.408l-7-14z"})})})]})})]}),x&&a.jsx("div",{className:"fixed inset-0 bg-slate-950/80 backdrop-blur-sm flex items-center justify-center z-[100] p-4",children:a.jsxs("div",{className:"bg-white text-slate-900 w-full max-w-md rounded-2xl overflow-hidden shadow-2xl animate-in zoom-in-95 duration-200",children:[a.jsxs("div",{className:"p-6 border-b border-slate-100 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-8 h-8 bg-blue-600 rounded flex items-center justify-center text-white font-bold",children:"S"}),a.jsx("span",{className:"font-bold text-lg",children:"Stripe Checkout"})]}),a.jsx("button",{onClick:()=>v(!1),className:"text-slate-400 hover:text-slate-600",children:"✕"})]}),a.jsxs("div",{className:"p-8",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"text-slate-500 text-xs font-bold uppercase mb-1",children:"Pay Quantum Financial"}),a.jsx("div",{className:"text-4xl font-bold",children:"$5,000.00"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-bold text-slate-500 block mb-1",children:"Card Information"}),a.jsx("div",{className:"border border-slate-200 rounded-lg p-3 bg-slate-50 font-mono text-sm",children:"4242 4242 4242 4242"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-bold text-slate-500 block mb-1",children:"Expiry"}),a.jsx("div",{className:"border border-slate-200 rounded-lg p-3 bg-slate-50 font-mono text-sm",children:"12 / 26"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-bold text-slate-500 block mb-1",children:"CVC"}),a.jsx("div",{className:"border border-slate-200 rounded-lg p-3 bg-slate-50 font-mono text-sm",children:"***"})]})]})]}),a.jsxs("button",{onClick:T,disabled:b!=="idle",className:`w-full mt-8 py-4 rounded-xl font-bold text-white transition-all flex items-center justify-center gap-2 ${b==="success"?"bg-emerald-500":"bg-blue-600 hover:bg-blue-700"}`,children:[b==="idle"&&"Pay Now",b==="processing"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Processing..."]}),b==="success"&&"✓ Payment Successful"]}),a.jsx("p",{className:"text-center text-[10px] text-slate-400 mt-4",children:"Securely processed by Stripe. No real funds will be moved in this demo."})]})]})}),S&&a.jsx("div",{className:"fixed inset-0 bg-slate-950/80 backdrop-blur-sm flex items-center justify-center z-[100] p-4",children:a.jsxs("div",{className:"bg-slate-800 border border-slate-700 w-full max-w-lg rounded-2xl p-8 shadow-2xl",children:[a.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Update ACH Configuration"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-bold text-slate-500 block mb-1",children:"Bank Name"}),a.jsx("input",{type:"text",value:n.bankName,onChange:E=>r({...n,bankName:E.target.value}),className:"w-full bg-slate-900 border border-slate-700 rounded-lg p-3 text-slate-200"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-bold text-slate-500 block mb-1",children:"Routing Number"}),a.jsx("input",{type:"text",value:n.routingNumber,onChange:E=>r({...n,routingNumber:E.target.value}),className:"w-full bg-slate-900 border border-slate-700 rounded-lg p-3 text-slate-200 font-mono"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-xs font-bold text-slate-500 block mb-1",children:"Account Number"}),a.jsx("input",{type:"text",value:n.realAccountNumber,onChange:E=>r({...n,realAccountNumber:E.target.value}),className:"w-full bg-slate-900 border border-slate-700 rounded-lg p-3 text-slate-200 font-mono"})]})]})]}),a.jsxs("div",{className:"mt-8 flex gap-4",children:[a.jsx("button",{onClick:()=>{C(!1),I("MANUAL_UPDATE","User",{details:n})},className:"flex-1 py-3 bg-blue-600 hover:bg-blue-500 rounded-xl font-bold",children:"Save Changes"}),a.jsx("button",{onClick:()=>C(!1),className:"flex-1 py-3 bg-slate-700 hover:bg-slate-600 rounded-xl font-bold",children:"Cancel"})]})]})}),a.jsx("footer",{className:"mt-20 text-center text-slate-600 text-[10px] uppercase tracking-[0.2em]",children:"Quantum Financial Services Group © 2024 • Proprietary Demo Environment • No Human Intervention Required"})]})};class YP{constructor(){this.storage=new Map,this.masterKey="QF-SECURE-VAULT-0x8821-ALPHA"}static getInstance(){return YP.instance||(YP.instance=new YP),YP.instance}async encrypt(t){return`ENC_H_0x${btoa(t+this.masterKey).split("").reverse().join("")}`}async decrypt(t){if(!t.startsWith("ENC_H_0x"))return t;const n=t.replace("ENC_H_0x","").split("").reverse().join("");return atob(n).replace(this.masterKey,"")}set(t,n){this.storage.set(t,n)}get(t){return this.storage.get(t)}}const o9e=YP.getInstance(),QPr={getGenerativeModel:({model:e})=>({generateContent:async t=>{let n="Acknowledged. The Quantum Core has processed your request. All systems report optimal performance and security posture.";return t.includes("Process a $5k payment")?n="Initiating secure payment transfer via the integrated payment rail. Confirmation required via MFA or biometric signature.":t.includes("Audit Ledger")?n="Neural Audit Log is being compiled. Initial scan shows 100% data integrity across all linked accounts. Ready for deep dive analysis.":t.includes("Fraud Report")?n="Fraud detection engine is running a full sweep. No anomalies detected above Severity Level 3 in the last 24 hours.":t.includes("ERP Sync")?n="ERP synchronization initiated. Data reconciliation expected to complete within T+5 minutes. Monitoring for schema drift.":t.includes("New Wire")&&(n="New wire transfer protocol established. Please specify recipient, amount, and source account for execution."),{response:{text:()=>n}}}})},Zne=({title:e,icon:t,children:n,className:r})=>a.jsxs("div",{className:`bg-black/40 backdrop-blur-xl border border-white/10 rounded-3xl overflow-hidden shadow-2xl ${r}`,children:[a.jsxs("div",{className:"px-6 py-4 border-b border-white/5 flex items-center justify-between bg-gradient-to-r from-indigo-500/10 to-transparent",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"p-2 bg-indigo-500/20 rounded-xl text-indigo-400",children:t}),a.jsx("h3",{className:"text-sm font-bold text-white tracking-widest uppercase",children:e})]}),a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-red-500/50"}),a.jsx("div",{className:"w-2 h-2 rounded-full bg-yellow-500/50"}),a.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500/50"})]})]}),a.jsx("div",{className:"p-6",children:n})]}),JPr=()=>{const[e,t]=f.useState([{id:"1",action:"REBALANCE_PORTFOLIO",detail:"Increased Crypto weighting to 18.5%",status:"SUCCESS",time:"12m ago"},{id:"2",action:"AUDIT_LEDGER",detail:"Verified 1,242 entries. Zero delta.",status:"SUCCESS",time:"1h ago"},{id:"3",action:"HFT_LIQUIDITY_SHIFT",detail:"Moved $450k to Tokyo node for arbitrage",status:"SUCCESS",time:"3h ago"},{id:"4",action:"THREAT_MODELING",detail:"Detected unusual login from GBR. Blocked.",status:"SECURITY_ALERT",time:"5h ago"},{id:"5",action:"GENERATE_REPORT",detail:"Compiled Q4 Projections",status:"PENDING",time:"Just Now"}]),[n,r]=f.useState([{role:"assistant",content:"Welcome to Quantum Financial. I am your AI Co-Pilot. How can I assist with your global operations today?",timestamp:new Date}]),[o,i]=f.useState(""),[s,l]=f.useState(!1),[c,u]=f.useState(!1),[d,p]=f.useState("5000.00"),[h,m]=f.useState(!1),g=f.useRef(null);f.useEffect(()=>{var b;(b=g.current)==null||b.scrollIntoView({behavior:"smooth"})},[n]);const y=(b,w,S="SUCCESS")=>{const C={id:Math.random().toString(36).substr(2,9),action:b,detail:w,status:S,time:"Just Now"};t(N=>[C,...N]),o9e.encrypt(JSON.stringify(C)).then(N=>{o9e.set(`audit_${C.id}`,N)})},x=async b=>{i(""),l(!0),r(w=>[...w,{role:"user",content:b,timestamp:new Date}]);try{const C=(await QPr.getGenerativeModel({model:"gemini-3-flash-preview"}).generateContent(` You are the Quantum Financial AI Assistant. Context: Global Business Banking, High-Performance, Secure. User Instruction: ${b} Capabilities: - Create Wire Transfers - Audit Ledgers - Fraud Monitoring - Stripe Payment Processing - ERP Integration If the user wants to "pay", "transfer", or "send money", suggest using the Stripe Integration. If the user wants to "audit" or "check logs", refer to the Neural Audit Log. Keep responses elite, professional, and concise. `)).response.text();r(N=>[...N,{role:"assistant",content:C,timestamp:new Date}]),(C.toLowerCase().includes("wire transfer")||C.toLowerCase().includes("transferring"))&&y("AI_INITIATED_TRANSFER","Processing global wire via Quantum Rails","PENDING"),(C.toLowerCase().includes("stripe")||C.toLowerCase().includes("payment"))&&u(!0)}catch{r(S=>[...S,{role:"assistant",content:"I apologize, but I encountered a synchronization error with the Quantum Grid. Please retry your request.",timestamp:new Date}])}finally{l(!1)}},v=async()=>{m(!0),y("STRIPE_PAYMENT_INIT",`Attempting charge of $${d}`,"PENDING"),await new Promise(b=>setTimeout(b,2e3)),m(!1),u(!1),y("STRIPE_PAYMENT_SUCCESS",`Successfully processed $${d} via Stripe Connect`,"SUCCESS"),r(b=>[...b,{role:"assistant",content:`Payment of $${d} has been successfully processed and logged in the audit trail.`,timestamp:new Date}])};return a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6 p-6 bg-[#050505] min-h-screen font-sans text-gray-300",children:[a.jsxs("div",{className:"lg:col-span-5 flex flex-col gap-6",children:[a.jsx(Zne,{title:"AI Co-Pilot",icon:a.jsx(Ei,{className:"animate-pulse"}),children:a.jsxs("div",{className:"flex flex-col h-[600px]",children:[a.jsxs("div",{className:"flex-1 overflow-y-auto space-y-4 pr-2 custom-scrollbar",children:[n.map((b,w)=>a.jsx("div",{className:`flex ${b.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[85%] p-4 rounded-2xl text-sm leading-relaxed ${b.role==="user"?"bg-indigo-600 text-white rounded-tr-none shadow-lg shadow-indigo-500/20":"bg-white/5 border border-white/10 text-gray-200 rounded-tl-none"}`,children:[b.content,a.jsx("div",{className:"mt-2 text-[10px] opacity-40 font-mono",children:b.timestamp.toLocaleTimeString()})]})},w)),s&&a.jsx("div",{className:"flex justify-start",children:a.jsx("div",{className:"bg-white/5 border border-white/10 p-4 rounded-2xl rounded-tl-none",children:a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-indigo-400 rounded-full animate-bounce"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-indigo-400 rounded-full animate-bounce [animation-delay:0.2s]"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-indigo-400 rounded-full animate-bounce [animation-delay:0.4s]"})]})})}),a.jsx("div",{ref:g})]}),a.jsxs("div",{className:"mt-6 relative",children:[a.jsx("input",{type:"text",value:o,onChange:b=>i(b.target.value),onKeyPress:b=>b.key==="Enter"&&x(o),placeholder:"Command the engine... (e.g. 'Process a $5k payment')",className:"w-full bg-white/5 border border-white/10 rounded-2xl py-4 pl-6 pr-14 text-sm focus:outline-none focus:border-indigo-500/50 transition-all placeholder:text-gray-600"}),a.jsx("button",{onClick:()=>x(o),disabled:s||o.trim()==="",className:`absolute right-2 top-2 bottom-2 px-4 rounded-xl transition-colors ${s||o.trim()===""?"bg-gray-700/50 text-gray-500 cursor-not-allowed":"bg-indigo-500 hover:bg-indigo-400 text-white"}`,children:a.jsx(Lc,{size:18})})]}),a.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:["Audit Ledger","New Wire","Fraud Report","ERP Sync"].map(b=>a.jsx("button",{onClick:()=>x(b),disabled:s,className:`text-[10px] font-bold uppercase tracking-widest px-3 py-1.5 bg-white/5 border border-white/10 rounded-lg hover:bg-white/10 hover:border-indigo-500/30 transition-all ${s?"opacity-50 cursor-not-allowed":""}`,children:b},b))})]})}),a.jsx(Zne,{title:"System Integrations",icon:a.jsx(Fu,{}),children:a.jsx("div",{className:"space-y-3",children:[{name:"Stripe Connect",status:"Operational",icon:a.jsx(yh,{size:14}),color:"text-emerald-400"},{name:"SAP ERP Bridge",status:"Syncing",icon:a.jsx(rl,{size:14}),color:"text-amber-400"},{name:"SWIFT gpi",status:"Operational",icon:a.jsx(vi,{size:14}),color:"text-emerald-400"},{name:"Quantum Vault",status:"Encrypted",icon:a.jsx(ds,{size:14}),color:"text-indigo-400"}].map(b=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-white/5 rounded-xl border border-white/5",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"text-gray-400",children:b.icon}),a.jsx("span",{className:"text-xs font-medium text-gray-300",children:b.name})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`text-[10px] font-bold uppercase ${b.color}`,children:b.status}),a.jsx("div",{className:`w-1.5 h-1.5 rounded-full ${b.color.replace("text","bg")} ${b.status==="Syncing"?"animate-pulse":""}`})]})]},b.name))})})]}),a.jsxs("div",{className:"lg:col-span-7 flex flex-col gap-6",children:[a.jsx("div",{className:"grid grid-cols-3 gap-4",children:[{label:"Daily Volume",value:"$4.2M",trend:"+12.5%",icon:a.jsx(Xi,{className:"text-emerald-400"})},{label:"Security Score",value:"99.9",trend:"Stable",icon:a.jsx(ri,{className:"text-indigo-400"})},{label:"AI Efficiency",value:"94%",trend:"+2.1%",icon:a.jsx(_a,{className:"text-amber-400"})}].map((b,w)=>a.jsxs("div",{className:"bg-white/5 border border-white/10 p-4 rounded-3xl",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("div",{className:"p-2 bg-white/5 rounded-lg",children:b.icon}),a.jsx("span",{className:"text-[10px] font-bold text-emerald-400",children:b.trend})]}),a.jsx("p",{className:"text-[10px] text-gray-500 uppercase font-black tracking-tighter",children:b.label}),a.jsx("p",{className:"text-xl font-bold text-white",children:b.value})]},w))}),a.jsxs(Zne,{title:"Neural Audit Log",icon:a.jsx(Bs,{className:"text-indigo-400"}),children:[a.jsx("div",{className:"space-y-3 max-h-[700px] overflow-y-auto pr-2 custom-scrollbar",children:e.map(b=>a.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-950 border border-gray-800 rounded-2xl group hover:border-indigo-500/30 transition-all",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx("div",{className:`p-2 rounded-lg ${b.status==="SUCCESS"?"text-emerald-500 bg-emerald-500/10":b.status==="SECURITY_ALERT"?"text-red-500 bg-red-500/10 animate-pulse":"text-yellow-500 bg-yellow-500/10 animate-pulse"}`,children:b.status==="SUCCESS"?a.jsx(xh,{size:16}):b.status==="SECURITY_ALERT"?a.jsx(zu,{size:16}):a.jsx(zme,{size:16})}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("p",{className:"text-xs font-black text-white uppercase tracking-tight truncate",children:b.action}),b.status==="SECURITY_ALERT"&&a.jsx("span",{className:"text-[8px] bg-red-500 text-white px-1.5 py-0.5 rounded font-bold",children:"CRITICAL"})]}),a.jsx("p",{className:"text-[10px] text-gray-500 truncate mt-0.5",children:b.detail})]})]}),a.jsxs("div",{className:"text-right flex items-center gap-4",children:[a.jsxs("div",{className:"hidden sm:block",children:[a.jsx("p",{className:"text-[8px] text-gray-600 uppercase font-bold",children:"Trace ID"}),a.jsxs("p",{className:"text-[10px] font-mono text-gray-400",children:["0x",b.id.toUpperCase()]})]}),a.jsx("span",{className:"text-[10px] font-mono text-gray-700",children:b.time}),a.jsx(nd,{className:"text-gray-800 group-hover:text-indigo-400",size:14})]})]},b.id))}),a.jsxs("div",{className:"mt-6 p-4 bg-indigo-500/5 border border-indigo-500/20 rounded-2xl flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(kd,{className:"text-indigo-400",size:20}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-bold text-white",children:"Biometric Audit Active"}),a.jsx("p",{className:"text-[10px] text-gray-500",children:"All actions are cryptographically signed and stored in the Quantum Vault."})]})]}),a.jsx("button",{className:"px-4 py-2 bg-indigo-500/10 hover:bg-indigo-500/20 text-indigo-400 text-[10px] font-bold rounded-xl transition-all uppercase tracking-widest",children:"Export Ledger"})]})]})]}),c&&a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-md",children:a.jsx("div",{className:"w-full max-w-md bg-[#0A0A0A] border border-white/10 rounded-[2.5rem] overflow-hidden shadow-2xl",children:a.jsxs("div",{className:"p-8",children:[a.jsxs("div",{className:"flex justify-between items-start mb-8",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-2xl font-bold text-white mb-1",children:"Secure Checkout"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Powered by Stripe Connect & Quantum Financial"})]}),a.jsx("button",{onClick:()=>u(!1),className:"p-2 hover:bg-white/5 rounded-full text-gray-500",children:a.jsx(b3,{size:24})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-[10px] font-bold text-gray-500 uppercase tracking-widest mb-2",children:"Amount (USD)"}),a.jsxs("div",{className:"relative",children:[a.jsx("span",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-gray-400 font-bold",children:"$"}),a.jsx("input",{type:"number",value:d,onChange:b=>p(b.target.value),className:"w-full bg-white/5 border border-white/10 rounded-2xl py-4 pl-10 pr-4 text-xl font-bold text-white focus:outline-none focus:border-indigo-500"})]})]}),a.jsxs("div",{className:"p-4 bg-white/5 border border-white/10 rounded-2xl",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[a.jsx("div",{className:"w-12 h-8 bg-gradient-to-br from-gray-700 to-gray-900 rounded-md border border-white/10 flex items-center justify-center",children:a.jsx("div",{className:"w-6 h-4 bg-yellow-500/20 rounded-sm"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("p",{className:"text-xs font-bold text-white",children:"Corporate Card •••• 8821"}),a.jsx("p",{className:"text-[10px] text-gray-500",children:"Expires 12/28"})]}),a.jsx(ds,{size:14,className:"text-emerald-500"})]}),a.jsxs("div",{className:"flex gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"block text-[8px] font-bold text-gray-600 uppercase mb-1",children:"CVV"}),a.jsx("input",{type:"password",value:"***",readOnly:!0,className:"w-full bg-black/40 border border-white/5 rounded-lg p-2 text-xs text-white"})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx("label",{className:"block text-[8px] font-bold text-gray-600 uppercase mb-1",children:"Zip Code"}),a.jsx("input",{type:"text",value:"10001",readOnly:!0,className:"w-full bg-black/40 border border-white/5 rounded-lg p-2 text-xs text-white"})]})]})]}),a.jsx("button",{onClick:v,disabled:h,className:`w-full py-4 rounded-2xl font-bold text-sm uppercase tracking-widest transition-all flex items-center justify-center gap-3 ${h?"bg-gray-800 text-gray-500":"bg-indigo-500 hover:bg-indigo-400 text-white shadow-lg shadow-indigo-500/20"}`,children:h?a.jsxs(a.Fragment,{children:[a.jsx(qf,{className:"animate-spin",size:18}),"Authorizing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(ri,{size:18}),"Confirm Payment"]})}),a.jsx("p",{className:"text-[10px] text-center text-gray-600",children:"Your transaction is protected by 256-bit AES encryption and homomorphic vaulting."})]})]})})}),a.jsx("style",{children:` .custom-scrollbar::-webkit-scrollbar { width: 4px; } .custom-scrollbar::-webkit-scrollbar-track { background: transparent; } .custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; } .custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.4); } `})]})},gG=class gG{static encrypt(t){return btoa(t).split("").map((r,o)=>String.fromCharCode(r.charCodeAt(0)^this.secretKey.charCodeAt(o%this.secretKey.length))).join("")}static decrypt(t){const n=t.split("").map((r,o)=>String.fromCharCode(r.charCodeAt(0)^this.secretKey.charCodeAt(o%this.secretKey.length))).join("");return atob(n)}static set(t,n){this.storage.set(t,this.encrypt(n))}static get(t){const n=this.storage.get(t);return n?this.decrypt(n):null}};gG.storage=new Map,gG.secretKey="QUANTUM_INTERNAL_SIG_0x882";let DW=gG;const ZPr=new Ko({apiKey:""}),eAr=()=>{const[e,t]=f.useState(!1),[n,r]=f.useState(""),[o,i]=f.useState([{role:"ai",content:"Welcome to Quantum Financial. I am your AI Co-Pilot. You're in the driver's seat of the world's most advanced business banking engine. How can I assist your global operations today?"}]),[s,l]=f.useState([]),[c,u]=f.useState(!1),[d,p]=f.useState(null),[h,m]=f.useState(94.2),g=f.useRef(null),y=(S,C,N="SUCCESS")=>{const j={id:Math.random().toString(36).substr(2,9).toUpperCase(),timestamp:new Date().toISOString(),action:S,status:N,details:C};l(I=>[j,...I].slice(0,50)),DW.set(`LOG_${j.id}`,JSON.stringify(j))},x=()=>{var S;(S=g.current)==null||S.scrollIntoView({behavior:"smooth"})};f.useEffect(()=>{x()},[o]);const v=async S=>{if(S&&S.preventDefault(),!n.trim())return;const C=n;i(N=>[...N,{role:"user",content:C}]),r(""),u(!0),y("AI_QUERY",`User requested: ${C.substring(0,30)}...`);try{const N=ZPr.getGenerativeModel({model:"gemini-3-flash-preview"}),j=` You are the Quantum Financial AI Assistant. Context: This is a high-performance business banking demo. Tone: Elite, Professional, Secure. Capabilities: You can simulate Wire transfers, ACH, ERP integrations, and Fraud monitoring. User Instruction: ${C} If the user wants to "create" or "send" something, respond with a confirmation that you are initiating the "Quantum Protocol" for that action. Do NOT mention Citibank. Use "Quantum Financial" or "The Demo Bank". Keep it concise and powerful. `,T=(await(await N.generateContent(j)).response).text();i(P=>[...P,{role:"ai",content:T}]),(T.toLowerCase().includes("wire")||T.toLowerCase().includes("payment"))&&setTimeout(()=>p("payment"),1e3),(T.toLowerCase().includes("integration")||T.toLowerCase().includes("erp"))&&setTimeout(()=>p("integration"),1e3)}catch{i(j=>[...j,{role:"ai",content:"Quantum Systems are currently recalibrating. I have logged this request for manual override."}]),y("AI_ERROR","Failed to reach Gemini API","CRITICAL")}finally{u(!1)}},b=()=>{y("STRIPE_INIT","Initializing Stripe Connect Protocol","SUCCESS"),alert("Stripe Checkout Redirect Simulated. Quantum Financial handles the underlying liquidity.")},w=(S,C)=>{DW.set(`KEY_${S}`,C),y("VAULT_WRITE",`Encrypted key stored for ${S} using Homomorphic Protocol`,"SUCCESS")};return a.jsxs("div",{className:"relative w-full h-full min-h-[600px] bg-black text-white font-sans overflow-hidden rounded-3xl border border-gray-800 shadow-2xl",children:[a.jsxs("div",{className:"absolute top-0 left-0 w-full h-full opacity-20 pointer-events-none",children:[a.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[40%] h-[40%] bg-cyan-500/20 blur-[120px] rounded-full"}),a.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[40%] h-[40%] bg-blue-600/20 blur-[120px] rounded-full"})]}),a.jsxs("div",{className:"relative z-10 flex items-center justify-between px-8 py-6 border-b border-white/5 bg-black/40 backdrop-blur-md",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-cyan-400 to-blue-600 rounded-lg flex items-center justify-center shadow-lg shadow-cyan-500/20",children:a.jsx(Ei,{size:24,className:"text-black"})}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-black tracking-tighter uppercase italic",children:"Quantum Financial"}),a.jsx("p",{className:"text-[10px] text-cyan-400 font-mono tracking-widest uppercase",children:"Global Operations Monolith"})]})]}),a.jsxs("div",{className:"flex items-center gap-6",children:[a.jsxs("div",{className:"hidden md:flex items-center gap-4 text-[10px] font-mono text-gray-500",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse"}),"SYSTEMS_NOMINAL"]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(ds,{size:12,className:"text-cyan-500"}),"AES_256_VAULT_ACTIVE"]})]}),a.jsx("button",{onClick:()=>p("audit"),className:"p-2 hover:bg-white/5 rounded-full transition-colors border border-transparent hover:border-white/10",children:a.jsx(Gf,{size:20,className:"text-gray-400"})})]})]}),a.jsxs("div",{className:"relative z-10 grid grid-cols-1 lg:grid-cols-12 gap-0 h-[calc(100%-88px)]",children:[a.jsxs("div",{className:"lg:col-span-4 border-r border-white/5 p-8 flex flex-col justify-between bg-gradient-to-b from-transparent to-gray-950/50",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2 mb-8",children:[a.jsx(mm,{size:18,className:"text-cyan-400"}),a.jsx("h2",{className:"text-xs font-black uppercase tracking-widest text-gray-400",children:"Neural Sentiment Engine"})]}),a.jsx("div",{className:"flex flex-col items-center py-10",children:a.jsxs("div",{className:"relative w-56 h-56 flex items-center justify-center",children:[a.jsxs("svg",{className:"absolute inset-0 w-full h-full -rotate-90",children:[a.jsx("circle",{cx:"112",cy:"112",r:"100",fill:"transparent",stroke:"rgba(255,255,255,0.05)",strokeWidth:"12"}),a.jsx("circle",{cx:"112",cy:"112",r:"100",fill:"transparent",stroke:"url(#cyanGradient)",strokeWidth:"12",strokeDasharray:"628",strokeDashoffset:628-628*h/100,strokeLinecap:"round",className:"transition-all duration-1000 ease-out"}),a.jsx("defs",{children:a.jsxs("linearGradient",{id:"cyanGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[a.jsx("stop",{offset:"0%",stopColor:"#22d3ee"}),a.jsx("stop",{offset:"100%",stopColor:"#2563eb"})]})})]}),a.jsxs("div",{className:"text-center z-10",children:[a.jsxs("p",{className:"text-6xl font-black text-white font-mono tracking-tighter",children:[h,"%"]}),a.jsx("p",{className:"text-[10px] font-black text-cyan-400 uppercase tracking-widest mt-1",children:"Bullish_Confidence"})]})]})}),a.jsx("div",{className:"space-y-3 mt-8",children:a.jsxs("div",{className:"p-4 bg-white/5 rounded-2xl border border-white/5 flex items-start gap-3",children:[a.jsx(Fme,{size:18,className:"text-cyan-500 shrink-0"}),a.jsx("p",{className:"text-[11px] text-gray-400 leading-relaxed italic",children:'"Market vectors indicate a high-probability breakout for the NDX_FUT sector. Recalibrate long positions to capture delta."'})]})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("button",{onClick:()=>p("payment"),className:"w-full py-4 bg-white text-black hover:bg-cyan-400 transition-all rounded-2xl text-[11px] font-black uppercase tracking-widest flex items-center justify-center gap-2 group",children:[a.jsx(_a,{size:16,fill:"currentColor"}),"Execute Global Wire",a.jsx(nd,{size:14,className:"group-hover:translate-x-1 transition-transform"})]}),a.jsxs("button",{onClick:b,className:"w-full py-4 bg-white/5 hover:bg-white/10 border border-white/10 transition-all rounded-2xl text-[11px] font-black uppercase tracking-widest flex items-center justify-center gap-2",children:[a.jsx(yh,{size:16}),"Stripe Connect Demo"]})]})]}),a.jsxs("div",{className:"lg:col-span-8 flex flex-col bg-black/20",children:[a.jsxs("div",{className:"flex-1 overflow-y-auto p-8 space-y-6 scrollbar-hide",children:[o.map((S,C)=>a.jsx("div",{className:`flex ${S.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[80%] flex gap-4 ${S.role==="user"?"flex-row-reverse":""}`,children:[a.jsx("div",{className:`w-8 h-8 rounded-lg flex items-center justify-center shrink-0 ${S.role==="user"?"bg-blue-600":"bg-gray-800 border border-white/10"}`,children:S.role==="user"?a.jsx(kd,{size:16}):a.jsx(Ei,{size:16,className:"text-cyan-400"})}),a.jsx("div",{className:`p-4 rounded-2xl text-sm leading-relaxed ${S.role==="user"?"bg-blue-600 text-white rounded-tr-none":"bg-white/5 border border-white/5 text-gray-300 rounded-tl-none"}`,children:S.content})]})},C)),c&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"flex gap-4",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-gray-800 border border-white/10 flex items-center justify-center",children:a.jsx("div",{className:"w-4 h-4 border-2 border-cyan-400 border-t-transparent animate-spin rounded-full"})}),a.jsx("div",{className:"p-4 bg-white/5 border border-white/5 rounded-2xl rounded-tl-none",children:a.jsxs("div",{className:"flex gap-1",children:[a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-400 rounded-full animate-bounce"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-400 rounded-full animate-bounce [animation-delay:0.2s]"}),a.jsx("div",{className:"w-1.5 h-1.5 bg-cyan-400 rounded-full animate-bounce [animation-delay:0.4s]"})]})})]})}),a.jsx("div",{ref:g})]}),a.jsxs("div",{className:"p-6 border-t border-white/5 bg-black/40",children:[a.jsxs("form",{onSubmit:v,className:"relative",children:[a.jsx("input",{type:"text",value:n,onChange:S=>r(S.target.value),placeholder:"Ask AI to send a wire, integrate ERP, or analyze risk...",className:"w-full bg-white/5 border border-white/10 rounded-2xl py-4 pl-6 pr-16 text-sm focus:outline-none focus:border-cyan-500/50 transition-all placeholder:text-gray-600"}),a.jsx("button",{type:"submit",disabled:c||!n.trim(),className:"absolute right-2 top-2 bottom-2 px-4 bg-cyan-500 hover:bg-cyan-400 disabled:bg-gray-800 disabled:text-gray-600 text-black rounded-xl transition-all flex items-center justify-center",children:a.jsx(Lc,{size:18})})]}),a.jsx("div",{className:"mt-4 flex items-center gap-4 overflow-x-auto pb-2 scrollbar-hide",children:["Send $50k Wire","Connect QuickBooks","Fraud Report","Market Outlook"].map(S=>a.jsx("button",{onClick:()=>{r(S)},className:"whitespace-nowrap px-4 py-1.5 bg-white/5 hover:bg-white/10 border border-white/5 rounded-full text-[10px] font-bold text-gray-400 transition-all",children:S},S))})]})]})]}),d==="payment"&&a.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center p-6 bg-black/80 backdrop-blur-sm",children:a.jsxs("div",{className:"w-full max-w-md bg-gray-900 border border-white/10 rounded-3xl overflow-hidden shadow-2xl animate-in fade-in zoom-in duration-300",children:[a.jsxs("div",{className:"p-6 border-b border-white/5 flex justify-between items-center",children:[a.jsx("h3",{className:"text-lg font-black uppercase tracking-tighter",children:"Quantum Wire Protocol"}),a.jsx("button",{onClick:()=>p(null),className:"text-gray-500 hover:text-white",children:a.jsx(vh,{size:20})})]}),a.jsxs("div",{className:"p-8 space-y-4",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] font-black text-gray-500 uppercase",children:"Recipient IBAN / Account"}),a.jsx("input",{type:"text",defaultValue:"US89 4432 1100 9982 1123",className:"w-full bg-black border border-white/10 rounded-xl p-3 text-sm font-mono"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] font-black text-gray-500 uppercase",children:"Amount (USD)"}),a.jsx("input",{type:"text",defaultValue:"50,000.00",className:"w-full bg-black border border-white/10 rounded-xl p-3 text-sm font-mono text-cyan-400"})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("label",{className:"text-[10px] font-black text-gray-500 uppercase",children:"Priority"}),a.jsxs("select",{className:"w-full bg-black border border-white/10 rounded-xl p-3 text-sm appearance-none",children:[a.jsx("option",{children:"INSTANT_SETTLE"}),a.jsx("option",{children:"STANDARD"})]})]})]}),a.jsxs("div",{className:"p-4 bg-cyan-500/5 border border-cyan-500/20 rounded-2xl flex items-center gap-3",children:[a.jsx(ri,{size:20,className:"text-cyan-400"}),a.jsx("p",{className:"text-[10px] text-cyan-400/80 leading-tight",children:"Quantum Multi-Factor Authentication will be required to finalize this high-value transfer."})]}),a.jsx("button",{onClick:()=>{y("WIRE_EXECUTE","Wire transfer of $50,000.00 initiated to US89...1123","SUCCESS"),p(null),i(S=>[...S,{role:"ai",content:"Wire transfer initiated. Transaction ID: QNT-99281-X. You can track this in the Audit Vault."}])},className:"w-full py-4 bg-cyan-500 hover:bg-cyan-400 text-black font-black uppercase tracking-widest rounded-2xl transition-all mt-4",children:"Authorize & Send"})]})]})}),d==="integration"&&a.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center p-6 bg-black/80 backdrop-blur-sm",children:a.jsxs("div",{className:"w-full max-w-2xl bg-gray-900 border border-white/10 rounded-3xl overflow-hidden shadow-2xl",children:[a.jsxs("div",{className:"p-6 border-b border-white/5 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Fu,{size:20,className:"text-cyan-400"}),a.jsx("h3",{className:"text-lg font-black uppercase tracking-tighter",children:"ERP & Accounting Hub"})]}),a.jsx("button",{onClick:()=>p(null),className:"text-gray-500 hover:text-white",children:a.jsx(vh,{size:20})})]}),a.jsx("div",{className:"p-8 grid grid-cols-2 gap-6",children:[{name:"QuickBooks",icon:a.jsx(rl,{size:24}),status:"Ready"},{name:"SAP S/4HANA",icon:a.jsx(vi,{size:24}),status:"Enterprise"},{name:"Xero",icon:a.jsx(Xi,{size:24}),status:"Ready"},{name:"NetSuite",icon:a.jsx(Fu,{size:24}),status:"Ready"}].map(S=>a.jsxs("div",{className:"p-6 bg-black border border-white/5 rounded-2xl hover:border-cyan-500/50 transition-all group",children:[a.jsxs("div",{className:"flex justify-between items-start mb-4",children:[a.jsx("div",{className:"p-3 bg-white/5 rounded-xl text-cyan-400",children:S.icon}),a.jsx("span",{className:"text-[8px] font-black px-2 py-1 bg-white/5 rounded-full text-gray-500 uppercase tracking-widest",children:S.status})]}),a.jsx("h4",{className:"font-bold mb-1",children:S.name}),a.jsx("p",{className:"text-[10px] text-gray-500 mb-4",children:"Sync real-time ledger data with Quantum Financial."}),a.jsx("button",{onClick:()=>w(S.name,"MOCK_KEY_"+Math.random()),className:"w-full py-2 bg-white/5 hover:bg-white/10 border border-white/10 rounded-lg text-[10px] font-black uppercase tracking-widest transition-all",children:"Connect Securely"})]},S.name))})]})}),d==="audit"&&a.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center p-6 bg-black/80 backdrop-blur-sm",children:a.jsxs("div",{className:"w-full max-w-3xl h-[80%] bg-gray-900 border border-white/10 rounded-3xl overflow-hidden shadow-2xl flex flex-col",children:[a.jsxs("div",{className:"p-6 border-b border-white/5 flex justify-between items-center bg-black/40",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ri,{size:20,className:"text-cyan-400"}),a.jsx("h3",{className:"text-lg font-black uppercase tracking-tighter",children:"Immutable Audit Vault"})]}),a.jsx("button",{onClick:()=>p(null),className:"text-gray-500 hover:text-white",children:a.jsx(vh,{size:20})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-0 font-mono",children:a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{className:"sticky top-0 bg-gray-900 text-[10px] text-gray-500 uppercase tracking-widest border-b border-white/5",children:a.jsxs("tr",{children:[a.jsx("th",{className:"p-4 font-black",children:"Timestamp"}),a.jsx("th",{className:"p-4 font-black",children:"Action"}),a.jsx("th",{className:"p-4 font-black",children:"Status"}),a.jsx("th",{className:"p-4 font-black",children:"Details"})]})}),a.jsx("tbody",{className:"text-[11px]",children:s.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"p-20 text-center text-gray-600 italic",children:"No audit records found in current session."})}):s.map(S=>a.jsxs("tr",{className:"border-b border-white/5 hover:bg-white/5 transition-colors",children:[a.jsx("td",{className:"p-4 text-gray-500",children:new Date(S.timestamp).toLocaleTimeString()}),a.jsx("td",{className:"p-4 font-bold text-white",children:S.action}),a.jsx("td",{className:"p-4",children:a.jsx("span",{className:`px-2 py-0.5 rounded-full text-[9px] font-black ${S.status==="SUCCESS"?"bg-green-500/10 text-green-500":S.status==="WARNING"?"bg-yellow-500/10 text-yellow-500":"bg-red-500/10 text-red-500"}`,children:S.status})}),a.jsx("td",{className:"p-4 text-gray-400 max-w-xs truncate",children:S.details})]},S.id))})]})}),a.jsxs("div",{className:"p-4 bg-black/40 border-t border-white/5 flex justify-between items-center",children:[a.jsxs("p",{className:"text-[9px] text-gray-500 uppercase font-mono",children:["Total Records: ",s.length]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{className:"px-3 py-1.5 bg-white/5 hover:bg-white/10 rounded text-[9px] font-black uppercase tracking-widest",children:"Export CSV"}),a.jsx("button",{className:"px-3 py-1.5 bg-white/5 hover:bg-white/10 rounded text-[9px] font-black uppercase tracking-widest",children:"Verify Chain"})]})]})]})}),a.jsx("div",{className:"absolute bottom-6 right-6 z-20",children:a.jsxs("div",{className:"flex items-center gap-3 px-4 py-2 bg-black/80 border border-white/10 rounded-full backdrop-blur-md shadow-xl",children:[a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"w-2 h-2 bg-cyan-500 rounded-full animate-ping absolute inset-0"}),a.jsx("div",{className:"w-2 h-2 bg-cyan-500 rounded-full relative"})]}),a.jsx("span",{className:"text-[9px] font-black text-gray-400 uppercase tracking-[0.2em]",children:"Quantum_Secure_Link_Active"})]})})]})},tAr=Bt(p0)(({theme:e})=>({"&:hover":{boxShadow:e.shadows[4]}})),nAr=({assets:e,onAssetSelected:t,getAssetDetails:n})=>{xf();const[r,o]=f.useState(null),[i,s]=f.useState(null),[l,c]=f.useState(!1),[u,d]=f.useState(!1),[p,h]=f.useState(!1),m=async x=>{o(x),c(!0),d(!0),s(null);try{const v=await n(x.assetId);s(v)}catch(v){console.error("Error fetching asset details:",v)}finally{d(!1)}},g=()=>{c(!1),o(null),s(null)},y=()=>{h(!p)};return a.jsxs(Dn,{sx:{padding:2},children:[a.jsx(tn,{variant:"h5",gutterBottom:!0,children:"Managed Assets"}),a.jsx(br,{container:!0,spacing:2,children:e.map(x=>a.jsx(br,{item:!0,xs:12,sm:6,md:4,children:a.jsxs(tAr,{onClick:()=>m(x),sx:{cursor:"pointer"},children:[a.jsx(Fyn,{component:"img",alt:x.assetName,height:"140",image:x.imageUrl||"https://via.placeholder.com/150"}),a.jsxs(h0,{children:[a.jsx(tn,{variant:"h6",component:"div",gutterBottom:!0,children:x.assetName}),a.jsxs(tn,{variant:"body2",color:"text.secondary",children:["Type: ",x.assetType]})]})]})},x.assetId))}),a.jsxs(yT,{open:l,onClose:g,maxWidth:"md",fullWidth:!0,children:[a.jsxs(wT,{children:[r==null?void 0:r.assetName," Details"]}),a.jsx(bT,{children:u?a.jsx(Dn,{sx:{display:"flex",justifyContent:"center",padding:2},children:a.jsx(su,{})}):i?Object.entries(i).map(([x,v])=>a.jsxs(Dn,{sx:{marginBottom:1},children:[a.jsxs(tn,{variant:"subtitle2",fontWeight:"bold",children:[x,":"]}),Array.isArray(v)?v.map((b,w)=>a.jsx(tn,{variant:"body2",children:JSON.stringify(b)},w)):a.jsx(tn,{variant:"body2",children:typeof v=="string"&&(x.toLowerCase().includes("password")||x.toLowerCase().includes("secret"))?p?v:"********":JSON.stringify(v)}),typeof v=="string"&&(x.toLowerCase().includes("password")||x.toLowerCase().includes("secret"))&&a.jsx(Zs,{"aria-label":"toggle password visibility",onClick:y,edge:"end",children:p?a.jsx(ZSn,{}):a.jsx(JSn,{})})]},x)):a.jsx(tn,{variant:"body1",children:"No details available."})}),a.jsx(vT,{children:a.jsx(ta,{onClick:g,children:"Close"})})]})]})},rAr=()=>{const e=f.useContext(ia),[t,n]=f.useState(!1),r=[{id:"1",name:"Liquidity Anchor",target:"Capital Savings",threshold:5e4,status:"ACTIVE",lastRun:"2h ago"},{id:"2",name:"Opex Buffer",target:"Elite Checking",threshold:12e3,status:"STANDBY",lastRun:"1d ago"},{id:"3",name:"Tax Reserve Sweep",target:"Tax Vault",threshold:0,status:"ACTIVE",lastRun:"6h ago"}],o=()=>{n(!0),setTimeout(()=>{n(!1),e==null||e.showNotification("Sweep sequence completed. Capital optimized.","success")},2e3)};return a.jsx("div",{className:"space-y-6 animate-in fade-in duration-500",children:a.jsx(Ft,{title:"System Sweep Protocol",headerActions:[{id:"add",icon:a.jsx(eYe,{}),label:"Add Rule",onClick:()=>{}}],children:a.jsxs("div",{className:"space-y-4 pt-2",children:[a.jsxs("p",{className:"text-sm text-gray-400 leading-relaxed max-w-2xl mb-6",children:["Deterministic capital routing. Rules automatically shift surplus liquidity between nodes based on your defined thresholds.",a.jsx("span",{className:"text-cyan-400 font-bold ml-1",children:"Z-Zero balance logic enabled."})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-left font-mono",children:[a.jsx("thead",{className:"text-[10px] text-gray-600 uppercase tracking-widest border-b border-gray-800",children:a.jsxs("tr",{children:[a.jsx("th",{className:"pb-4",children:"Logic Designation"}),a.jsx("th",{className:"pb-4",children:"Target Node"}),a.jsx("th",{className:"pb-4",children:"Trigger Limit"}),a.jsx("th",{className:"pb-4",children:"Status"}),a.jsx("th",{className:"pb-4 text-right",children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-800",children:r.map(i=>a.jsxs("tr",{className:"group hover:bg-white/5 transition-colors",children:[a.jsx("td",{className:"py-5",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-2 h-2 rounded-full bg-cyan-500 animate-pulse"}),a.jsx("span",{className:"text-sm font-bold text-white",children:i.name})]})}),a.jsx("td",{className:"py-5 text-xs text-gray-400",children:i.target}),a.jsxs("td",{className:"py-5 text-sm text-white font-black",children:["$",i.threshold.toLocaleString()]}),a.jsx("td",{className:"py-5",children:a.jsx("span",{className:`px-2 py-0.5 rounded text-[8px] font-black border ${i.status==="ACTIVE"?"border-green-500/30 text-green-400 bg-green-500/5":"border-gray-700 text-gray-500"}`,children:i.status})}),a.jsx("td",{className:"py-5 text-right",children:a.jsx("button",{className:"p-2 text-gray-600 hover:text-red-400 transition-colors",children:a.jsx(CC,{size:14})})})]},i.id))})]})}),a.jsxs("div",{className:"mt-8 pt-6 border-t border-gray-800 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(ri,{className:"text-cyan-400",size:18}),a.jsx("span",{className:"text-[10px] font-black text-gray-500 uppercase tracking-widest italic",children:"All sweep events are signed by the Sovereign HSM."})]}),a.jsxs("button",{onClick:o,disabled:t,className:"px-8 py-3 bg-cyan-600 hover:bg-cyan-500 text-white font-black rounded-xl shadow-lg shadow-cyan-500/20 transition-all flex items-center gap-2 uppercase tracking-widest text-xs",children:[t?a.jsx(qf,{size:14,className:"animate-spin"}):a.jsx(XI,{size:14}),"Initialize Manual Re-balance"]})]})]})})})},oAr=({data:e})=>{const t=e.map(n=>{var r;return{date:n.as_of_date,balance:((r=n.closing_ledger)==null?void 0:r.amount)||0}});return a.jsx(ni,{width:"100%",height:400,children:a.jsxs(vw,{data:t,margin:{top:5,right:30,left:20,bottom:5},children:[a.jsx(kl,{strokeDasharray:"3 3"}),a.jsx(Ka,{dataKey:"date"}),a.jsx(ra,{}),a.jsx(ji,{}),a.jsx(uu,{}),a.jsx(au,{type:"monotone",dataKey:"balance",stroke:"#8884d8",activeDot:{r:8}})]})})},ere=(e,t)=>e===null||typeof e>"u"?"":new Intl.NumberFormat("en-US",{style:"currency",currency:t.toUpperCase()}).format(e/100),iAr=e=>new Date(e*1e3).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0}),aAr=({balanceTransactions:e})=>!e||e.length===0?a.jsx("div",{className:"flex items-center justify-center p-8 border rounded-lg bg-gray-50",children:a.jsx("p",{className:"text-sm text-gray-500",children:"No balance transactions found."})}):a.jsx("div",{className:"border rounded-lg overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Date"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Description"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Amount"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Fee"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Net"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Source"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:e.map(t=>{var n;return a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-600",children:iAr(t.created)}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 capitalize",children:t.reporting_category.replace(/_/g," ")}),a.jsx("td",{className:"px-6 py-4 text-sm text-gray-600 max-w-sm truncate",title:t.description??"",children:t.description||a.jsx("span",{className:"text-gray-400",children:"N/A"})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-900 text-right font-mono",children:ere(t.amount,t.currency)}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 text-right font-mono",children:ere(t.fee,t.currency)}),a.jsx("td",{className:`px-6 py-4 whitespace-nowrap text-sm text-right font-mono ${t.net>0?"text-green-600":t.net<0?"text-red-600":"text-gray-900"}`,children:ere(t.net,t.currency)}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:a.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${t.status==="available"?"bg-green-100 text-green-800":t.status==="pending"?"bg-yellow-100 text-yellow-800":"bg-gray-100 text-gray-800"}`,children:t.status})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 font-mono",title:t.source??"",children:typeof t.source=="string"?t.source:((n=t.source)==null?void 0:n.id)||"N/A"})]},t.id)})})]})})}),sAr=({cardholderName:e="JAMES B. O'CALLAGHAN III"})=>a.jsxs("div",{className:"p-10 bg-gray-950 rounded-[3rem] border border-gray-800 flex flex-col items-center justify-center shadow-2xl relative overflow-hidden group",children:[a.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_center,rgba(6,182,212,0.1),transparent_70%)]"}),a.jsxs("div",{className:"relative w-[450px] h-[280px] bg-gradient-to-br from-gray-800 via-gray-900 to-black rounded-[24px] shadow-[0_20px_50px_rgba(0,0,0,0.5)] border border-white/10 p-8 flex flex-col justify-between overflow-hidden transition-transform duration-500 hover:scale-105",children:[a.jsx("div",{className:"absolute inset-0 bg-[url('https://grainy-gradients.vercel.app/noise.svg')] opacity-20 pointer-events-none"}),a.jsx("div",{className:"absolute -right-20 -top-20 w-64 h-64 bg-cyan-500/10 rounded-full blur-[80px] animate-pulse"}),a.jsxs("div",{className:"flex justify-between items-start relative z-10",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("h4",{className:"text-[10px] font-black text-cyan-400 tracking-[0.3em] uppercase",children:"Sovereign Forge"}),a.jsx("div",{className:"w-12 h-10 bg-gradient-to-br from-yellow-400 to-yellow-600 rounded-lg border border-yellow-200/50 flex items-center justify-center shadow-inner",children:a.jsx("div",{className:"grid grid-cols-3 gap-0.5 w-2/3",children:[...Array(6)].map((t,n)=>a.jsx("div",{className:"h-0.5 bg-black/20"},n))})})]}),a.jsx(w3,{className:"text-white/20 w-10 h-10"})]}),a.jsxs("div",{className:"space-y-1 relative z-10",children:[a.jsx("p",{className:"text-2xl font-mono font-bold tracking-[0.2em] text-white/90 drop-shadow-md",children:"4242   8812   9945   5270"}),a.jsxs("div",{className:"flex justify-between items-end pt-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-[8px] font-mono text-gray-500 uppercase tracking-widest",children:"Architect Profile"}),a.jsx("p",{className:"text-sm font-black text-white uppercase tracking-tight",children:e})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-[8px] font-mono text-gray-500 uppercase tracking-widest",children:"Valid Thru"}),a.jsx("p",{className:"text-sm font-black text-white font-mono",children:"12/32"})]})]})]}),a.jsxs("div",{className:"absolute bottom-4 right-8 flex items-center gap-2 opacity-50",children:[a.jsx("span",{className:"text-[8px] font-black text-gray-500 uppercase tracking-[0.4em]",children:"Nexus Network"}),a.jsxs("div",{className:"w-8 h-5 rounded flex",children:[a.jsx("div",{className:"flex-1 bg-cyan-600 rounded-l"}),a.jsx("div",{className:"flex-1 bg-indigo-600 rounded-r"})]})]})]}),a.jsxs("div",{className:"mt-12 flex gap-8 w-full max-w-lg",children:[a.jsxs("div",{className:"flex-1 p-4 bg-gray-900 border border-gray-800 rounded-2xl",children:[a.jsx("p",{className:"text-[10px] text-gray-500 font-bold uppercase mb-1",children:"Material"}),a.jsx("p",{className:"text-sm font-black text-white",children:"TITANIUM_LATTICE"})]}),a.jsxs("div",{className:"flex-1 p-4 bg-gray-900 border border-gray-800 rounded-2xl",children:[a.jsx("p",{className:"text-[10px] text-gray-500 font-bold uppercase mb-1",children:"Auth_Bridge"}),a.jsx("p",{className:"text-sm font-black text-green-400 uppercase",children:"JIT_FUNDING_OK"})]})]})]}),lAr=({isOpen:e,onClose:t,title:n,children:r,size:o="medium"})=>{const i=o==="small"?"max-w-sm":o==="large"?"max-w-4xl":"max-w-lg";return a.jsx(Igt,{open:e,onOpenChange:s=>!s&&t(),children:a.jsxs(x1e,{className:`${i} max-h-[90vh] overflow-y-auto bg-gray-900 border border-gray-700 text-white`,children:[a.jsx(y1e,{children:a.jsx(v1e,{children:n})}),a.jsx("div",{className:"mt-2",children:r})]})})},UM=({title:e,children:t})=>a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-lg font-medium text-gray-200 mb-3 border-b border-gray-700 pb-1",children:e}),a.jsx("div",{className:"space-y-2",children:t})]}),hp=({title:e,value:t,isMono:n})=>a.jsxs("div",{className:"flex justify-between py-1",children:[a.jsx("span",{className:"text-gray-400 text-sm",children:e}),a.jsx("span",{className:`text-gray-200 text-sm ${n?"font-mono":""}`,children:t})]}),f9=({to:e,children:t})=>a.jsx("span",{className:"text-blue-400 hover:text-blue-300 cursor-pointer underline",children:t}),tre=({amount:e,currency:t="USD",className:n})=>{const r=t&&t.length===3?t.toUpperCase():"USD";try{const o=new Intl.NumberFormat("en-US",{style:"currency",currency:r}).format(e/100);return a.jsx("span",{className:n,children:o})}catch{return a.jsxs("span",{className:n,children:[r," ",(e/100).toFixed(2)]})}},cAr=({ts:e,className:t})=>{if(!e)return a.jsx("span",{className:"text-gray-500 italic",children:"N/A"});const n=typeof e=="number"&&e<1e10?e*1e3:e,r=new Date(n);return isNaN(r.getTime())?a.jsx("span",{className:"text-gray-500 italic",children:"Invalid Date"}):a.jsx("span",{className:t,title:r.toISOString(),children:r.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})})},uAr=({metadata:e})=>a.jsx("div",{className:"bg-gray-800 p-3 rounded text-xs font-mono text-gray-300",children:a.jsx("pre",{children:JSON.stringify(e,null,2)})}),i9e={success:"bg-green-900 text-green-200 border-green-700",warning:"bg-yellow-900 text-yellow-200 border-yellow-700",danger:"bg-red-900 text-red-200 border-red-700",default:"bg-gray-700 text-gray-200 border-gray-500"},dAr=({status:e,color:t})=>a.jsx("span",{className:`px-2 py-0.5 rounded border text-xs uppercase tracking-wide font-semibold ${i9e[t]||i9e.default}`,children:e}),fAr=({details:e})=>e?a.jsxs("div",{className:"mt-4 border-t border-gray-700 pt-4",children:[a.jsx("h4",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Billing Details"}),a.jsx(hp,{title:"Name",value:e.name||"N/A"}),a.jsx(hp,{title:"Email",value:e.email||"N/A"}),a.jsx(hp,{title:"Phone",value:e.phone||"N/A"}),e.address&&a.jsxs("div",{className:"mt-2 text-sm text-gray-400",children:[a.jsx("p",{children:e.address.street}),e.address.line2&&a.jsx("p",{children:e.address.line2}),a.jsxs("p",{children:[e.address.city,", ",e.address.state," ",e.address.zip]}),a.jsx("p",{children:e.address.country})]})]}):null,d2={ShieldCheck:e=>a.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),Chip:e=>a.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"})}),Wifi:e=>a.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})}),Bot:e=>a.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),Lock:e=>a.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),Activity:e=>a.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),Send:e=>a.jsx("svg",{...e,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})})},Yh=({label:e,value:t,isMono:n=!1,copyable:r=!1})=>a.jsxs("div",{className:"flex justify-between items-center py-3 border-b border-gray-700/50 last:border-0 group hover:bg-gray-800/30 px-2 rounded transition-colors",children:[a.jsx("span",{className:"text-gray-400 text-sm font-medium",children:e}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:`text-gray-200 text-sm ${n?"font-mono tracking-wider":"font-medium"}`,children:t}),r&&a.jsx("button",{onClick:()=>navigator.clipboard.writeText(t),className:"opacity-0 group-hover:opacity-100 text-cyan-400 hover:text-cyan-300 transition-opacity",title:"Copy to clipboard",children:a.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})]}),pAr=({brand:e,last4:t,expMonth:n,expYear:r,name:o})=>{const i=()=>{switch(e==null?void 0:e.toLowerCase()){case"visa":return"from-blue-900 to-blue-600";case"mastercard":return"from-gray-900 to-orange-900";case"amex":return"from-cyan-900 to-blue-900";default:return"from-gray-800 to-gray-900"}};return a.jsxs("div",{className:`relative w-full aspect-[1.586/1] rounded-2xl bg-gradient-to-br ${i()} p-6 shadow-2xl border border-white/10 overflow-hidden group transition-transform duration-500 hover:scale-[1.02]`,children:[a.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-white/5 rounded-full blur-3xl -mr-16 -mt-16 pointer-events-none"}),a.jsx("div",{className:"absolute bottom-0 left-0 w-48 h-48 bg-black/20 rounded-full blur-2xl -ml-10 -mb-10 pointer-events-none"}),a.jsxs("div",{className:"relative z-10 flex flex-col justify-between h-full",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsx(d2.Chip,{className:"w-12 h-12 text-yellow-200/80"}),a.jsx(d2.Wifi,{className:"w-8 h-8 text-white/50 rotate-90"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"font-mono text-2xl tracking-widest text-white/90 drop-shadow-md",children:["•••• •••• •••• ",t]}),a.jsxs("div",{className:"flex justify-between items-end",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"text-[10px] text-white/60 uppercase tracking-wider",children:"Cardholder"}),a.jsx("div",{className:"font-medium text-white/90 tracking-wide uppercase",children:o||"QUANTUM CLIENT"})]}),a.jsxs("div",{className:"space-y-1 text-right",children:[a.jsx("div",{className:"text-[10px] text-white/60 uppercase tracking-wider",children:"Expires"}),a.jsxs("div",{className:"font-mono text-white/90",children:[n,"/",r]})]})]})]})]}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-tr from-white/0 via-white/5 to-white/0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 pointer-events-none"})]})},hAr=({bankName:e,last4:t,accountType:n})=>a.jsxs("div",{className:"relative w-full aspect-[1.586/1] rounded-2xl bg-gradient-to-br from-emerald-900 to-teal-900 p-6 shadow-2xl border border-white/10 overflow-hidden group",children:[a.jsx("div",{className:"absolute inset-0 bg-[url('https://www.transparenttextures.com/patterns/cubes.png')] opacity-10"}),a.jsxs("div",{className:"relative z-10 flex flex-col justify-between h-full",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"text-white/90 font-bold text-xl tracking-tight",children:["QUANTUM",a.jsx("span",{className:"font-light text-emerald-300",children:"TREASURY"})]}),a.jsx("div",{className:"px-3 py-1 bg-white/10 rounded-full text-xs text-emerald-100 backdrop-blur-sm border border-white/10",children:"VERIFIED"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("div",{className:"text-emerald-200/60 text-sm uppercase tracking-wider",children:"Institution"}),a.jsx("div",{className:"text-2xl text-white font-light",children:e})]}),a.jsxs("div",{className:"flex justify-between items-end border-t border-white/10 pt-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-[10px] text-emerald-200/60 uppercase tracking-wider",children:"Account Type"}),a.jsx("div",{className:"text-white font-medium capitalize",children:n})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-[10px] text-emerald-200/60 uppercase tracking-wider",children:"Account Number"}),a.jsxs("div",{className:"font-mono text-white text-lg",children:["•••• ",t]})]})]})]})]}),ivt=({details:e})=>{var b,w,S;const{geminiApiKey:t,user:n}=f.useContext(ia)||{},[r,o]=f.useState("details"),[i,s]=f.useState([]),[l,c]=f.useState(""),[u,d]=f.useState([]),[p,h]=f.useState(!1),m=f.useRef(null);f.useEffect(()=>{g("COMPONENT_MOUNT","System","SUCCESS")},[]),f.useEffect(()=>{var C;(C=m.current)==null||C.scrollIntoView({behavior:"smooth"})},[u,r]);const g=(C,N,j)=>{const I={id:Math.random().toString(36).substr(2,9),timestamp:new Date().toISOString(),action:C,actor:N,status:j};s(_=>[I,..._])},y=async()=>{var N,j,I,_;if(!l.trim())return;const C={id:Date.now().toString(),role:"user",content:l,timestamp:new Date};d(T=>[...T,C]),c(""),h(!0),g("AI_QUERY_INITIATED","User","SUCCESS");try{let T="I cannot connect to the Quantum Core at this moment.";if(t){const M=new Ko({apiKey:t}).getGenerativeModel({model:"gemini-1.5-flash"}),R=` You are the Quantum Financial AI Assistant. You are analyzing a payment instrument for a high-net-worth client. Instrument Details: Type: ${e.type} ${e.type==="card"?`Brand: ${(N=e.card)==null?void 0:N.brand}, Last4: ${(j=e.card)==null?void 0:j.last4}`:""} ${e.type==="us_bank_account"?`Bank: ${(I=e.us_bank_account)==null?void 0:I.bank_name}, Type: ${(_=e.us_bank_account)==null?void 0:_.account_type}`:""} User Query: ${C.content} Provide a professional, concise, and "elite" banking response. Focus on security, efficiency, and financial strategy. Do NOT mention "Citibank". Use "Quantum Financial" or "The Demo Bank". Treat this as a "Golden Ticket" experience for the user. `;T=(await M.generateContent(R)).response.text()}else await new Promise(E=>setTimeout(E,1500)),T="Quantum Core Uplink: Secure connection established. Based on heuristic analysis, this payment instrument shows optimal routing efficiency for domestic transfers. Fraud vectors are currently negligible. (Note: Configure GEMINI_API_KEY for full neural processing).";const P={id:(Date.now()+1).toString(),role:"ai",content:T,timestamp:new Date};d(E=>[...E,P]),g("AI_RESPONSE_GENERATED","Quantum Core","SUCCESS")}catch(T){console.error("AI Error",T);const P={id:(Date.now()+1).toString(),role:"system",content:"Error establishing secure uplink to Neural Core. Please verify API credentials.",timestamp:new Date};d(E=>[...E,P]),g("AI_QUERY_FAILED","System","FAILURE")}finally{h(!1)}};if(!e)return null;const x=e.type,v=e[x];return a.jsxs("div",{className:"w-full bg-gray-900/50 backdrop-blur-xl border border-gray-700/50 rounded-2xl overflow-hidden shadow-2xl flex flex-col animate-fadeIn",children:[a.jsxs("div",{className:"px-6 py-4 border-b border-gray-700/50 flex justify-between items-center bg-gray-800/30",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"p-2 bg-cyan-500/10 rounded-lg border border-cyan-500/20",children:a.jsx(d2.ShieldCheck,{className:"w-5 h-5 text-cyan-400"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-gray-100 font-semibold tracking-wide",children:"Instrument Analysis"}),a.jsx("p",{className:"text-xs text-gray-400 uppercase tracking-wider",children:"Quantum Financial Secure Vault"})]})]}),a.jsx("div",{className:"flex space-x-1 bg-gray-900/50 p-1 rounded-lg border border-gray-700/50",children:["details","ai","audit"].map(C=>a.jsx("button",{onClick:()=>o(C),className:`px-3 py-1.5 rounded-md text-xs font-medium transition-all duration-300 ${r===C?"bg-cyan-500/20 text-cyan-300 shadow-sm border border-cyan-500/20":"text-gray-400 hover:text-gray-200 hover:bg-gray-800"}`,children:C.toUpperCase()},C))})]}),a.jsxs("div",{className:"p-6 min-h-[400px]",children:[r==="details"&&a.jsxs("div",{className:"space-y-8 animate-slideIn",children:[a.jsx("div",{className:"flex justify-center py-4",children:a.jsx("div",{className:"w-full max-w-md transform hover:scale-105 transition-transform duration-500",children:x==="card"?a.jsx(pAr,{brand:v==null?void 0:v.brand,last4:v==null?void 0:v.last4,expMonth:v==null?void 0:v.exp_month,expYear:v==null?void 0:v.exp_year,name:n==null?void 0:n.name}):a.jsx(hAr,{bankName:v==null?void 0:v.bank_name,last4:v==null?void 0:v.last4,accountType:v==null?void 0:v.account_type})})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("h4",{className:"text-xs font-bold text-gray-500 uppercase tracking-widest mb-4 border-b border-gray-800 pb-2",children:"Primary Metadata"}),x==="card"&&v&&a.jsxs(a.Fragment,{children:[a.jsx(Yh,{label:"Network Brand",value:(b=v.brand)==null?void 0:b.toUpperCase()}),a.jsx(Yh,{label:"Card Number",value:`•••• •••• •••• ${v.last4}`,isMono:!0,copyable:!0}),a.jsx(Yh,{label:"Expiration",value:`${v.exp_month}/${v.exp_year}`,isMono:!0}),a.jsx(Yh,{label:"Funding Type",value:((w=v.funding)==null?void 0:w.toUpperCase())||"CREDIT"}),a.jsx(Yh,{label:"Country",value:v.country||"US"})]}),x==="us_bank_account"&&v&&a.jsxs(a.Fragment,{children:[a.jsx(Yh,{label:"Bank Name",value:v.bank_name}),a.jsx(Yh,{label:"Account Number",value:`•••• ${v.last4}`,isMono:!0,copyable:!0}),a.jsx(Yh,{label:"Routing Number",value:v.routing_number?`•••• ${v.routing_number.slice(-4)}`:"•••• ••••",isMono:!0}),a.jsx(Yh,{label:"Account Type",value:(S=v.account_type)==null?void 0:S.toUpperCase()}),a.jsx(Yh,{label:"Verification",value:"INSTANT VERIFIED"})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("h4",{className:"text-xs font-bold text-gray-500 uppercase tracking-widest mb-4 border-b border-gray-800 pb-2",children:"Risk & Compliance"}),a.jsx(Yh,{label:"Fraud Score",value:"LOW (0.02%)"}),a.jsx(Yh,{label:"KYC Status",value:"APPROVED"}),a.jsx(Yh,{label:"AML Check",value:"PASSED"}),a.jsx(Yh,{label:"Tokenization",value:"ACTIVE"}),a.jsx("div",{className:"mt-6 p-4 bg-emerald-900/10 border border-emerald-500/20 rounded-xl",children:a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(d2.ShieldCheck,{className:"w-5 h-5 text-emerald-400 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h5",{className:"text-sm font-semibold text-emerald-300",children:"Secure Instrument"}),a.jsx("p",{className:"text-xs text-emerald-400/70 mt-1 leading-relaxed",children:"This payment method is fully verified and protected by Quantum Financial's multi-layer security protocol."})]})]})})]})]})]}),r==="ai"&&a.jsxs("div",{className:"h-full flex flex-col animate-slideIn",children:[a.jsxs("div",{className:"flex-1 bg-gray-950/50 rounded-xl border border-gray-800 p-4 mb-4 overflow-y-auto max-h-[300px] min-h-[300px] space-y-4 scrollbar-thin scrollbar-thumb-gray-700 scrollbar-track-transparent",children:[u.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-500 space-y-3 opacity-50",children:[a.jsx(d2.Bot,{className:"w-12 h-12"}),a.jsx("p",{className:"text-sm",children:"Quantum Core is ready. Ask about this instrument."})]}),u.map(C=>a.jsx("div",{className:`flex ${C.role==="user"?"justify-end":"justify-start"}`,children:a.jsxs("div",{className:`max-w-[80%] p-3 rounded-2xl text-sm leading-relaxed ${C.role==="user"?"bg-cyan-600/20 text-cyan-100 border border-cyan-500/30 rounded-tr-none":C.role==="system"?"bg-red-900/20 text-red-200 border border-red-500/30":"bg-gray-800 text-gray-200 border border-gray-700 rounded-tl-none"}`,children:[C.role==="ai"&&a.jsx("div",{className:"text-[10px] text-cyan-400 font-bold mb-1 uppercase tracking-wider",children:"Quantum Core"}),C.content,a.jsx("div",{className:"text-[10px] opacity-40 mt-2 text-right",children:C.timestamp.toLocaleTimeString()})]})},C.id)),p&&a.jsx("div",{className:"flex justify-start",children:a.jsxs("div",{className:"bg-gray-800 p-3 rounded-2xl rounded-tl-none border border-gray-700 flex items-center space-x-2",children:[a.jsx("div",{className:"w-2 h-2 bg-cyan-400 rounded-full animate-bounce",style:{animationDelay:"0ms"}}),a.jsx("div",{className:"w-2 h-2 bg-cyan-400 rounded-full animate-bounce",style:{animationDelay:"150ms"}}),a.jsx("div",{className:"w-2 h-2 bg-cyan-400 rounded-full animate-bounce",style:{animationDelay:"300ms"}})]})}),a.jsx("div",{ref:m})]}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:l,onChange:C=>c(C.target.value),onKeyDown:C=>C.key==="Enter"&&y(),placeholder:"Ask Quantum AI about spending limits, fraud risks, or optimization...",className:"w-full bg-gray-900 border border-gray-700 rounded-xl py-3 pl-4 pr-12 text-gray-200 placeholder-gray-600 focus:outline-none focus:border-cyan-500/50 focus:ring-1 focus:ring-cyan-500/50 transition-all"}),a.jsx("button",{onClick:y,disabled:!l.trim()||p,className:"absolute right-2 top-2 p-1.5 bg-cyan-500/20 hover:bg-cyan-500/40 text-cyan-400 rounded-lg transition-colors disabled:opacity-30 disabled:cursor-not-allowed",children:a.jsx(d2.Send,{className:"w-5 h-5"})})]})]}),r==="audit"&&a.jsxs("div",{className:"h-full animate-slideIn",children:[a.jsxs("div",{className:"bg-black/40 rounded-xl border border-gray-800 overflow-hidden",children:[a.jsxs("div",{className:"px-4 py-3 bg-gray-900/80 border-b border-gray-800 flex justify-between items-center",children:[a.jsx("h4",{className:"text-xs font-mono text-gray-400 uppercase",children:"Immutable Audit Ledger"}),a.jsx(d2.Lock,{className:"w-4 h-4 text-gray-500"})]}),a.jsx("div",{className:"max-h-[350px] overflow-y-auto scrollbar-thin scrollbar-thumb-gray-800",children:a.jsxs("table",{className:"w-full text-left border-collapse",children:[a.jsx("thead",{className:"bg-gray-900/50 sticky top-0",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2 text-[10px] font-bold text-gray-500 uppercase tracking-wider",children:"Timestamp"}),a.jsx("th",{className:"px-4 py-2 text-[10px] font-bold text-gray-500 uppercase tracking-wider",children:"Actor"}),a.jsx("th",{className:"px-4 py-2 text-[10px] font-bold text-gray-500 uppercase tracking-wider",children:"Action"}),a.jsx("th",{className:"px-4 py-2 text-[10px] font-bold text-gray-500 uppercase tracking-wider text-right",children:"Status"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-800/50",children:i.map(C=>a.jsxs("tr",{className:"hover:bg-gray-800/30 transition-colors font-mono text-xs",children:[a.jsx("td",{className:"px-4 py-3 text-gray-500",children:new Date(C.timestamp).toLocaleTimeString()}),a.jsx("td",{className:"px-4 py-3 text-cyan-300",children:C.actor}),a.jsx("td",{className:"px-4 py-3 text-gray-300",children:C.action}),a.jsx("td",{className:"px-4 py-3 text-right",children:a.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] font-bold ${C.status==="SUCCESS"?"bg-emerald-500/10 text-emerald-400":C.status==="WARNING"?"bg-yellow-500/10 text-yellow-400":"bg-red-500/10 text-red-400"}`,children:C.status})})]},C.id))})]})})]}),a.jsxs("div",{className:"mt-4 flex items-center justify-center space-x-2 text-xs text-gray-500",children:[a.jsx(d2.Activity,{className:"w-4 h-4"}),a.jsx("span",{children:"Real-time logging active. All actions are cryptographically signed."})]})]})]})]})},mAr=e=>{switch(e){case"succeeded":return"success";case"pending":return"warning";case"failed":return"danger";default:return"default"}},gAr=({charge:e,isOpen:t,onClose:n})=>{var r,o,i,s;return t?a.jsx(lAr,{isOpen:t,onClose:n,title:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-gray-400",children:"Charge"}),a.jsx("span",{className:"font-mono text-white",children:e.id})]}),size:"large",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 p-2",children:[a.jsxs("div",{className:"md:col-span-2 space-y-6",children:[a.jsxs(UM,{title:"Summary",children:[a.jsx(hp,{title:"ID",value:e.id,isMono:!0}),a.jsx(hp,{title:"Amount",value:a.jsx(tre,{amount:e.amount,currency:e.currency||"USD",className:"font-bold text-lg text-white"})}),a.jsx(hp,{title:"Status",value:a.jsx(dAr,{status:e.status,color:mAr(e.status)})}),a.jsx(hp,{title:"Description",value:e.description||"N/A"}),a.jsx(hp,{title:"Created",value:a.jsx(cAr,{ts:e.created})}),e.receipt_url&&a.jsx(hp,{title:"Receipt",value:a.jsx("a",{href:e.receipt_url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-400 hover:text-blue-300 underline",children:"View Receipt"})})]}),a.jsxs(UM,{title:"Payment Details",children:[e.payment_intent&&a.jsx(hp,{title:"Payment Intent",value:a.jsx(f9,{to:`/payment_intents/${typeof e.payment_intent=="string"?e.payment_intent:(r=e.payment_intent)==null?void 0:r.id}`,children:typeof e.payment_intent=="string"?e.payment_intent:(o=e.payment_intent)==null?void 0:o.id})}),e.balance_transaction&&a.jsx(hp,{title:"Balance Transaction",value:a.jsx(f9,{to:`/balance_transactions/${typeof e.balance_transaction=="string"?e.balance_transaction:(i=e.balance_transaction)==null?void 0:i.id}`,children:typeof e.balance_transaction=="string"?e.balance_transaction:(s=e.balance_transaction)==null?void 0:s.id})}),a.jsx(hp,{title:"Captured",value:e.captured?"Yes":"No"}),e.payment_method_details&&a.jsx(ivt,{details:e.payment_method_details})]}),a.jsxs(UM,{title:"Refunds",children:[a.jsx(hp,{title:"Amount Refunded",value:a.jsx(tre,{amount:e.amount_refunded,currency:e.currency||"USD"})}),a.jsx(hp,{title:"Refunded",value:e.refunded?"Yes":"No"}),e.refunds&&e.refunds.data.length>0&&a.jsxs("div",{className:"pt-4 mt-4 border-t border-gray-700",children:[a.jsx("h4",{className:"text-sm font-semibold text-gray-300 mb-2",children:"Refund List"}),a.jsx("ul",{className:"list-disc list-inside space-y-1 text-sm text-gray-400",children:e.refunds.data.map(l=>a.jsxs("li",{children:[a.jsx(f9,{to:`/refunds/${l.id}`,children:l.id})," - ",a.jsx(tre,{amount:l.amount,currency:l.currency||"USD"})," (",l.status,")"]},l.id))})]})]})]}),a.jsxs("div",{className:"md:col-span-1 space-y-6",children:[a.jsxs(UM,{title:"Customer",children:[e.customer?a.jsx(hp,{title:"ID",value:a.jsx(f9,{to:`/customers/${typeof e.customer=="string"?e.customer:e.customer.id}`,children:typeof e.customer=="string"?e.customer:e.customer.id})}):a.jsx(hp,{title:"Customer",value:"Guest"}),a.jsx(fAr,{details:e.billing_details})]}),e.metadata&&Object.keys(e.metadata).length>0&&a.jsx(UM,{title:"Metadata",children:a.jsx(uAr,{metadata:e.metadata})})]})]})}):null},a9e={id:"ch_1Mcd6UJITzLVzkSmp1XIBHoW",object:"charge",amount:1e4,currency:"usd",customer:"cus_NMLsOPQRSsLoG",description:"My First Test Charge (created for API docs)",created:1678886400,status:"succeeded",paid:!0,receipt_url:"https://rwashburne-manage-mydev.dev.stripe.me/receipts/payment/...",billing_details:{name:"Jenny Rosen"}},xAr=e=>{const t=[],n=["succeeded","failed","pending"],r=["usd","eur","gbp"];for(let o=0;o.2?c:null,description:`Charge for order #${Math.floor(Math.random()*1e4)}`,created:a9e.created-o*3600*Math.floor(Math.random()*24+1),billing_details:{name:`Customer ${o+1}`}})}return t},yAr=(e,t)=>new Intl.NumberFormat("en-US",{style:"currency",currency:t.toUpperCase()}).format(e/100),vAr=e=>new Date(e*1e3).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),bAr=()=>{const[e,t]=f.useState("all"),[n,r]=f.useState("all"),[o,i]=f.useState(1),s=10,l=f.useMemo(()=>xAr(150),[]),c=f.useMemo(()=>l.filter(g=>{const y=e==="all"||g.status===e,x=n==="all"||g.currency===n;return y&&x}),[l,e,n]),u=f.useMemo(()=>{const g=(o-1)*s;return c.slice(g,g+s)},[c,o,s]),d=Math.ceil(c.length/s);f.useEffect(()=>{i(1)},[e,n]);const p=()=>{i(g=>Math.min(g+1,d))},h=()=>{i(g=>Math.max(g-1,1))},m=g=>{const y="px-2 py-1 text-xs font-semibold rounded-full";switch(g){case"succeeded":return a.jsx("span",{className:`${y} bg-green-100 text-green-800`,children:"Succeeded"});case"failed":return a.jsx("span",{className:`${y} bg-red-100 text-red-800`,children:"Failed"});case"pending":return a.jsx("span",{className:`${y} bg-yellow-100 text-yellow-800`,children:"Pending"})}};return a.jsx("div",{className:"p-4 sm:p-6 lg:p-8 font-sans bg-gray-50 min-h-screen",children:a.jsxs("div",{className:"max-w-7xl mx-auto",children:[a.jsx("h1",{className:"text-2xl font-semibold text-gray-900 mb-4",children:"Charges"}),a.jsx("div",{className:"bg-white p-4 rounded-lg shadow-sm mb-6",children:a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"status-filter",className:"block text-sm font-medium text-gray-700",children:"Status"}),a.jsxs("select",{id:"status-filter",value:e,onChange:g=>t(g.target.value),className:"mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md",children:[a.jsx("option",{value:"all",children:"All"}),a.jsx("option",{value:"succeeded",children:"Succeeded"}),a.jsx("option",{value:"failed",children:"Failed"}),a.jsx("option",{value:"pending",children:"Pending"})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"currency-filter",className:"block text-sm font-medium text-gray-700",children:"Currency"}),a.jsxs("select",{id:"currency-filter",value:n,onChange:g=>r(g.target.value),className:"mt-1 block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md",children:[a.jsx("option",{value:"all",children:"All"}),a.jsx("option",{value:"usd",children:"USD"}),a.jsx("option",{value:"eur",children:"EUR"}),a.jsx("option",{value:"gbp",children:"GBP"})]})]})]})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsx("div",{className:"align-middle inline-block min-w-full",children:a.jsxs("div",{className:"shadow overflow-hidden border-b border-gray-200 sm:rounded-lg bg-white",children:[a.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Amount"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Description"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Customer"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Date"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:u.map(g=>a.jsxs("tr",{children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:yAr(g.amount,g.currency)}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:m(g.status)}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:g.description}),a.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:[a.jsx("div",{children:g.billing_details.name}),g.customer&&a.jsx("code",{className:"text-xs text-gray-400",children:g.customer})]}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:vAr(g.created)})]},g.id))})]}),u.length===0&&a.jsx("div",{className:"text-center py-10 text-gray-500",children:"No charges found for the selected filters."})]})})}),d>1&&a.jsxs("div",{className:"py-4 flex items-center justify-between",children:[a.jsxs("div",{className:"flex-1 flex justify-between sm:hidden",children:[a.jsx("button",{onClick:h,disabled:o===1,className:"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 disabled:opacity-50",children:"Previous"}),a.jsx("button",{onClick:p,disabled:o===d,className:"ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 disabled:opacity-50",children:"Next"})]}),a.jsxs("div",{className:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between",children:[a.jsx("div",{children:a.jsxs("p",{className:"text-sm text-gray-700",children:["Showing ",a.jsx("span",{className:"font-medium",children:(o-1)*s+1})," to ",a.jsx("span",{className:"font-medium",children:Math.min(o*s,c.length)})," of ",a.jsx("span",{className:"font-medium",children:c.length})," results"]})}),a.jsx("div",{children:a.jsxs("nav",{className:"relative z-0 inline-flex rounded-md shadow-sm -space-x-px","aria-label":"Pagination",children:[a.jsx("button",{onClick:h,disabled:o===1,className:"relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 disabled:opacity-50",children:a.jsx("span",{children:"Previous"})}),a.jsxs("span",{className:"relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700",children:["Page ",o," of ",d]}),a.jsx("button",{onClick:p,disabled:o===d,className:"relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 disabled:opacity-50",children:a.jsx("span",{children:"Next"})})]})})]})]})]})})},wAr=()=>{const[e,t]=f.useState([]),[n,r]=f.useState(!1),[o,i]=f.useState(null);f.useEffect(()=>{t([{id:"rule-1",name:"High Priority Rails",description:"Route immediate wires to premium nodes.",priority:1,conditions:[{field:"priority",operator:"=",value:"HIGH"}],actions:[{type:"ROUTING",value:"QUANTUM_PRIMARY"}]},{id:"rule-2",name:"Low Value Batching",description:"Aggregate small payments for fee optimization.",priority:2,conditions:[{field:"amount",operator:"<",value:"100"}],actions:[{type:"ROUTING",value:"BATCH_RECONCILIATION"}]}])},[]);const s=()=>{const p={id:`rule-${Date.now()}`,name:"New Routing Rule",description:"Configure routing logic here.",priority:e.length+1,conditions:[{field:"payment.type",operator:"=",value:"ach"}],actions:[{type:"ROUTING",value:"STANDARD_QUEUE"}]};t([...e,p])},l=p=>{t(e.filter(h=>h.id!==p))},c=(p,h)=>{const m=[...e],g=h==="up"?p-1:p+1;g<0||g>=m.length||([m[p],m[g]]=[m[g],m[p]],t(m))},u=p=>{i(p),r(!0)},d=()=>{o&&(t(e.map(p=>p.id===o.id?o:p)),r(!1),i(null))};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsxs("h2",{className:"text-3xl font-bold text-white tracking-tight flex items-center gap-3",children:[a.jsx(eYe,{className:"text-cyan-400"})," Payment Conductor"]}),a.jsx("p",{className:"text-gray-400 mt-1",children:"Orchestrate transaction flow and smart routing rules."})]}),a.jsxs(kc,{onClick:s,className:"bg-cyan-600 hover:bg-cyan-500",children:[a.jsx(qKe,{className:"mr-2 h-4 w-4"})," Add Routing Rule"]})]}),a.jsx(yp,{className:"border-gray-800 bg-gray-900/50",children:a.jsxs(k1e,{children:[a.jsx(M1e,{children:a.jsxs(dE,{className:"border-gray-800 hover:bg-transparent",children:[a.jsx(Vx,{className:"w-12 text-center text-gray-500",children:"#"}),a.jsx(Vx,{children:"Rule Name"}),a.jsx(Vx,{className:"hidden md:table-cell",children:"Logic Summary"}),a.jsx(Vx,{children:"Priority"}),a.jsx(Vx,{className:"text-right",children:"Actions"})]})}),a.jsx(R1e,{children:e.map((p,h)=>a.jsxs(dE,{className:"border-gray-800 hover:bg-gray-800/30",children:[a.jsx(Km,{className:"text-gray-500 font-mono text-xs text-center",children:h+1}),a.jsxs(Km,{children:[a.jsx("div",{className:"font-bold text-white",children:p.name}),a.jsx("div",{className:"text-xs text-gray-500 truncate max-w-xs",children:p.description})]}),a.jsx(Km,{className:"hidden md:table-cell",children:a.jsx("div",{className:"flex gap-2",children:p.conditions.map((m,g)=>a.jsxs("span",{className:"px-2 py-0.5 bg-indigo-900/30 text-indigo-300 text-[10px] rounded border border-indigo-500/20",children:[m.field," ",m.operator," ",m.value]},g))})}),a.jsx(Km,{children:a.jsxs("div",{className:"flex items-center gap-2 text-gray-400",children:[a.jsx("button",{disabled:h===0,onClick:()=>c(h,"up"),className:"p-1 hover:text-cyan-400 disabled:opacity-20 transition-colors",children:a.jsx(NOt,{size:14})}),a.jsx("button",{disabled:h===e.length-1,onClick:()=>c(h,"down"),className:"p-1 hover:text-cyan-400 disabled:opacity-20 transition-colors",children:a.jsx(yOt,{size:14})})]})}),a.jsxs(Km,{className:"text-right space-x-2",children:[a.jsx(kc,{variant:"ghost",size:"sm",onClick:()=>u(p),className:"text-gray-400 hover:text-white",children:a.jsx(E$t,{size:14})}),a.jsx(kc,{variant:"ghost",size:"sm",onClick:()=>l(p.id),className:"text-red-400 hover:text-red-300",children:a.jsx(CC,{size:14})})]})]},p.id))})]})}),a.jsx(Igt,{open:n,onOpenChange:r,children:a.jsxs(x1e,{className:"bg-gray-900 border-gray-700 text-white sm:max-w-lg",children:[a.jsx(y1e,{children:a.jsx(v1e,{children:"Configure Routing Logic"})}),o&&a.jsxs("div",{className:"space-y-4 py-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs font-bold text-gray-500 uppercase",children:"Rule Designation"}),a.jsx(l0,{value:o.name,onChange:p=>i({...o,name:p.target.value}),className:"bg-gray-800 border-gray-700 text-white"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("label",{className:"text-xs font-bold text-gray-500 uppercase",children:"Intent Description"}),a.jsx("textarea",{value:o.description,onChange:p=>i({...o,description:p.target.value}),className:"w-full bg-gray-800 border border-gray-700 rounded-md p-3 text-sm text-white focus:border-cyan-500 outline-none h-20"})]})]}),a.jsxs(Pgt,{children:[a.jsx(kc,{variant:"secondary",onClick:()=>r(!1),children:"Cancel"}),a.jsx(kc,{onClick:d,className:"bg-cyan-600 hover:bg-cyan-500",children:"Save Configuration"})]})]})})]})};var nre={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */var s9e;function SAr(){return s9e||(s9e=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",s=0;s1?d-1:0),h=1;h=19?e.props.ref:e.ref}const FAr=!!(typeof window<"u"&&window.document&&window.document.createElement);var Ape=!1,Tpe=!1;try{var rre={get passive(){return Ape=!0},get once(){return Tpe=Ape=!0}};FAr&&(window.addEventListener("test",rre,rre),window.removeEventListener("test",rre,!0))}catch{}function zAr(e,t,n,r){if(r&&typeof r!="boolean"&&!Tpe){var o=r.once,i=r.capture,s=n;!Tpe&&o&&(s=n.__once||function l(c){this.removeEventListener(t,l,i),n.call(this,c)},n.__once=s),e.addEventListener(t,s,Ape?r:i)}e.addEventListener(t,n,r)}function BAr(e,t,n,r){var o=r&&typeof r!="boolean"?r.capture:r;e.removeEventListener(t,n,o),n.__once&&e.removeEventListener(t,n.__once,o)}function cvt(e,t,n,r){return zAr(e,t,n,r),function(){BAr(e,t,n,r)}}function HAr(e,t,n,r){if(r===void 0&&(r=!0),e){var o=document.createEvent("HTMLEvents");o.initEvent(t,n,r),e.dispatchEvent(o)}}function VAr(e){var t=lvt(e,"transitionDuration")||"",n=t.indexOf("ms")===-1?1e3:1;return parseFloat(t)*n}function UAr(e,t,n){n===void 0&&(n=5);var r=!1,o=setTimeout(function(){r||HAr(e,"transitionend",!0)},t+n),i=cvt(e,"transitionend",function(){r=!0},{once:!0});return function(){clearTimeout(o),i()}}function WAr(e,t,n,r){n==null&&(n=VAr(e)||0);var o=UAr(e,n,r),i=cvt(e,"transitionend",t);return function(){o(),i()}}function c9e(e,t){const n=lvt(e,t)||"",r=n.indexOf("ms")===-1?1e3:1;return parseFloat(n)*r}function GAr(e,t){const n=c9e(e,"transitionDuration"),r=c9e(e,"transitionDelay"),o=WAr(e,i=>{i.target===e&&(o(),t(i))},n+r)}function qAr(e){e.offsetHeight}const u9e=e=>!e||typeof e=="function"?e:t=>{e.current=t};function KAr(e,t){const n=u9e(e),r=u9e(t);return o=>{n&&n(o),r&&r(o)}}function YAr(e,t){return f.useMemo(()=>KAr(e,t),[e,t])}function XAr(e){return e&&"setState"in e?Uj.findDOMNode(e):e??null}const uvt=Ie.forwardRef(({onEnter:e,onEntering:t,onEntered:n,onExit:r,onExiting:o,onExited:i,addEndListener:s,children:l,childRef:c,...u},d)=>{const p=f.useRef(null),h=YAr(p,c),m=N=>{h(XAr(N))},g=N=>j=>{N&&p.current&&N(p.current,j)},y=f.useCallback(g(e),[e]),x=f.useCallback(g(t),[t]),v=f.useCallback(g(n),[n]),b=f.useCallback(g(r),[r]),w=f.useCallback(g(o),[o]),S=f.useCallback(g(i),[i]),C=f.useCallback(g(s),[s]);return a.jsx(Sm,{ref:d,...u,onEnter:y,onEntered:v,onEntering:x,onExit:b,onExited:S,onExiting:w,addEndListener:C,nodeRef:p,children:typeof l=="function"?(N,j)=>l(N,{...j,ref:m}):Ie.cloneElement(l,{ref:m})})});uvt.displayName="TransitionWrapper";function QAr(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e},[e]),t}function dvt(e){const t=QAr(e);return f.useCallback(function(...n){return t.current&&t.current(...n)},[t])}const uwe=(e=>f.forwardRef((t,n)=>a.jsx("div",{...t,ref:n,className:Hd(t.className,e)}))),fvt=uwe("h4");fvt.displayName="DivStyledAsH4";const pvt=f.forwardRef(({className:e,bsPrefix:t,as:n=fvt,...r},o)=>(t=Dp(t,"alert-heading"),a.jsx(n,{ref:o,className:Hd(e,t),...r})));pvt.displayName="AlertHeading";function JAr(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e},[e]),t}function hvt(e){const t=JAr(e);return f.useCallback(function(...n){return t.current&&t.current(...n)},[t])}const ZAr=["as","disabled"];function eTr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function tTr(e){return!e||e.trim()==="#"}function mvt({tagName:e,disabled:t,href:n,target:r,rel:o,role:i,onClick:s,tabIndex:l=0,type:c}){e||(n!=null||r!=null||o!=null?e="a":e="button");const u={tagName:e};if(e==="button")return[{type:c||"button",disabled:t},u];const d=h=>{if((t||e==="a"&&tTr(n))&&h.preventDefault(),t){h.stopPropagation();return}s==null||s(h)},p=h=>{h.key===" "&&(h.preventDefault(),d(h))};return e==="a"&&(n||(n="#"),t&&(n=void 0)),[{role:i??"button",disabled:void 0,tabIndex:t?void 0:l,href:n,target:e==="a"?r:void 0,"aria-disabled":t||void 0,rel:e==="a"?o:void 0,onClick:d,onKeyDown:p},u]}const gvt=f.forwardRef((e,t)=>{let{as:n,disabled:r}=e,o=eTr(e,ZAr);const[i,{tagName:s}]=mvt(Object.assign({tagName:n,disabled:r},o));return a.jsx(s,Object.assign({},o,i,{ref:t}))});gvt.displayName="Button";const nTr=["onKeyDown"];function rTr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function oTr(e){return!e||e.trim()==="#"}const xvt=f.forwardRef((e,t)=>{let{onKeyDown:n}=e,r=rTr(e,nTr);const[o]=mvt(Object.assign({tagName:"a"},r)),i=hvt(s=>{o.onKeyDown(s),n==null||n(s)});return oTr(r.href)||r.role==="button"?a.jsx("a",Object.assign({ref:t},r,o,{onKeyDown:i})):a.jsx("a",Object.assign({ref:t},r,{onKeyDown:n}))});xvt.displayName="Anchor";const yvt=f.forwardRef(({className:e,bsPrefix:t,as:n=xvt,...r},o)=>(t=Dp(t,"alert-link"),a.jsx(n,{ref:o,className:Hd(e,t),...r})));yvt.displayName="AlertLink";const iTr={[r2]:"show",[Rj]:"show"},kpe=f.forwardRef(({className:e,children:t,transitionClasses:n={},onEnter:r,...o},i)=>{const s={in:!1,timeout:300,mountOnEnter:!1,unmountOnExit:!1,appear:!1,...o},l=f.useCallback((c,u)=>{qAr(c),r==null||r(c,u)},[r]);return a.jsx(uvt,{ref:i,addEndListener:GAr,...s,onEnter:l,childRef:LAr(t),children:(c,u)=>f.cloneElement(t,{...u,className:Hd("fade",e,t.props.className,iTr[c],n[c])})})});kpe.displayName="Fade";const aTr={"aria-label":Rt.string,onClick:Rt.func,variant:Rt.oneOf(["white"])},dwe=f.forwardRef(({className:e,variant:t,"aria-label":n="Close",...r},o)=>a.jsx("button",{ref:o,type:"button",className:Hd("btn-close",t&&`btn-close-${t}`,e),"aria-label":n,...r}));dwe.displayName="CloseButton";dwe.propTypes=aTr;const vvt=f.forwardRef((e,t)=>{const{bsPrefix:n,show:r=!0,closeLabel:o="Close alert",closeVariant:i,className:s,children:l,variant:c="primary",onClose:u,dismissible:d,transition:p=kpe,...h}=avt(e,{show:"onClose"}),m=Dp(n,"alert"),g=dvt(v=>{u&&u(!1,v)}),y=p===!0?kpe:p,x=a.jsxs("div",{role:"alert",...y?void 0:h,ref:t,className:Hd(s,m,c&&`${m}-${c}`,d&&`${m}-dismissible`),children:[d&&a.jsx(dwe,{onClick:g,"aria-label":o,variant:i}),l]});return y?a.jsx(y,{unmountOnExit:!0,...h,ref:void 0,in:r,children:x}):r?x:null});vvt.displayName="Alert";const sTr=Object.assign(vvt,{Link:yvt,Heading:pvt}),fwe=f.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=Dp(t,"card-body"),a.jsx(n,{ref:o,className:Hd(e,t),...r})));fwe.displayName="CardBody";const bvt=f.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=Dp(t,"card-footer"),a.jsx(n,{ref:o,className:Hd(e,t),...r})));bvt.displayName="CardFooter";const wvt=f.createContext(null);wvt.displayName="CardHeaderContext";const Svt=f.forwardRef(({bsPrefix:e,className:t,as:n="div",...r},o)=>{const i=Dp(e,"card-header"),s=f.useMemo(()=>({cardHeaderBsPrefix:i}),[i]);return a.jsx(wvt.Provider,{value:s,children:a.jsx(n,{ref:o,...r,className:Hd(t,i)})})});Svt.displayName="CardHeader";const Cvt=f.forwardRef(({bsPrefix:e,className:t,variant:n,as:r="img",...o},i)=>{const s=Dp(e,"card-img");return a.jsx(r,{ref:i,className:Hd(n?`${s}-${n}`:s,t),...o})});Cvt.displayName="CardImg";const Nvt=f.forwardRef(({className:e,bsPrefix:t,as:n="div",...r},o)=>(t=Dp(t,"card-img-overlay"),a.jsx(n,{ref:o,className:Hd(e,t),...r})));Nvt.displayName="CardImgOverlay";const jvt=f.forwardRef(({className:e,bsPrefix:t,as:n="a",...r},o)=>(t=Dp(t,"card-link"),a.jsx(n,{ref:o,className:Hd(e,t),...r})));jvt.displayName="CardLink";const lTr=uwe("h6"),Evt=f.forwardRef(({className:e,bsPrefix:t,as:n=lTr,...r},o)=>(t=Dp(t,"card-subtitle"),a.jsx(n,{ref:o,className:Hd(e,t),...r})));Evt.displayName="CardSubtitle";const Ivt=f.forwardRef(({className:e,bsPrefix:t,as:n="p",...r},o)=>(t=Dp(t,"card-text"),a.jsx(n,{ref:o,className:Hd(e,t),...r})));Ivt.displayName="CardText";const cTr=uwe("h5"),_vt=f.forwardRef(({className:e,bsPrefix:t,as:n=cTr,...r},o)=>(t=Dp(t,"card-title"),a.jsx(n,{ref:o,className:Hd(e,t),...r})));_vt.displayName="CardTitle";const Pvt=f.forwardRef(({bsPrefix:e,className:t,bg:n,text:r,border:o,body:i=!1,children:s,as:l="div",...c},u)=>{const d=Dp(e,"card");return a.jsx(l,{ref:u,...c,className:Hd(t,d,n&&`bg-${n}`,r&&`text-${r}`,o&&`border-${o}`),children:i?a.jsx(fwe,{children:s}):s})});Pvt.displayName="Card";const ore=Object.assign(Pvt,{Img:Cvt,Title:_vt,Subtitle:Evt,Body:fwe,Link:jvt,Text:Ivt,Header:Svt,Footer:bvt,ImgOverlay:Nvt});var uTr=Function.prototype.bind.call(Function.prototype.call,[].slice);function dTr(e,t){return uTr(e.querySelectorAll(t))}function fTr(){const[,e]=f.useReducer(t=>t+1,0);return e}const Mpe=f.createContext(null),pwe=(e,t=null)=>e!=null?String(e):t||null,hwe=f.createContext(null);hwe.displayName="NavContext";const pTr="data-rr-ui-",hTr="rrUi";function mwe(e){return`${pTr}${e}`}function mTr(e){return`${hTr}${e}`}const d9e=e=>!e||typeof e=="function"?e:t=>{e.current=t};function gTr(e,t){const n=d9e(e),r=d9e(t);return o=>{n&&n(o),r&&r(o)}}function xTr(e,t){return f.useMemo(()=>gTr(e,t),[e,t])}const Avt=f.createContext(null),yTr=["as","active","eventKey"];function vTr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Tvt({key:e,onClick:t,active:n,id:r,role:o,disabled:i}){const s=f.useContext(Mpe),l=f.useContext(hwe),c=f.useContext(Avt);let u=n;const d={role:o};if(l){!o&&l.role==="tablist"&&(d.role="tab");const p=l.getControllerId(e??null),h=l.getControlledId(e??null);d[mwe("event-key")]=e,d.id=p||r,u=n==null&&e!=null?l.activeKey===e:n,(u||!(c!=null&&c.unmountOnExit)&&!(c!=null&&c.mountOnEnter))&&(d["aria-controls"]=h)}return d.role==="tab"&&(d["aria-selected"]=u,u||(d.tabIndex=-1),i&&(d.tabIndex=-1,d["aria-disabled"]=!0)),d.onClick=hvt(p=>{i||(t==null||t(p),e!=null&&s&&!p.isPropagationStopped()&&s(e,p))}),[d,{isActive:u}]}const kvt=f.forwardRef((e,t)=>{let{as:n=gvt,active:r,eventKey:o}=e,i=vTr(e,yTr);const[s,l]=Tvt(Object.assign({key:pwe(o,i.href),active:r},i));return s[mwe("active")]=l.isActive,a.jsx(n,Object.assign({},i,s,{ref:t}))});kvt.displayName="NavItem";const bTr=["as","onSelect","activeKey","role","onKeyDown"];function wTr(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}const f9e=()=>{},p9e=mwe("event-key"),Mvt=f.forwardRef((e,t)=>{let{as:n="div",onSelect:r,activeKey:o,role:i,onKeyDown:s}=e,l=wTr(e,bTr);const c=fTr(),u=f.useRef(!1),d=f.useContext(Mpe),p=f.useContext(Avt);let h,m;p&&(i=i||"tablist",o=p.activeKey,h=p.getControlledId,m=p.getControllerId);const g=f.useRef(null),y=w=>{const S=g.current;if(!S)return null;const C=dTr(S,`[${p9e}]:not([aria-disabled=true])`),N=S.querySelector("[aria-selected=true]");if(!N||N!==document.activeElement)return null;const j=C.indexOf(N);if(j===-1)return null;let I=j+w;return I>=C.length&&(I=0),I<0&&(I=C.length-1),C[I]},x=(w,S)=>{w!=null&&(r==null||r(w,S),d==null||d(w,S))},v=w=>{if(s==null||s(w),!p)return;let S;switch(w.key){case"ArrowLeft":case"ArrowUp":S=y(-1);break;case"ArrowRight":case"ArrowDown":S=y(1);break;default:return}S&&(w.preventDefault(),x(S.dataset[mTr("EventKey")]||null,w),u.current=!0,c())};f.useEffect(()=>{if(g.current&&u.current){const w=g.current.querySelector(`[${p9e}][aria-selected=true]`);w==null||w.focus()}u.current=!1});const b=xTr(t,g);return a.jsx(Mpe.Provider,{value:x,children:a.jsx(hwe.Provider,{value:{role:i,activeKey:pwe(o),getControlledId:h||f9e,getControllerId:m||f9e},children:a.jsx(n,Object.assign({},l,{onKeyDown:v,ref:b,role:i}))})})});Mvt.displayName="Nav";const STr=Object.assign(Mvt,{Item:kvt}),Rvt=f.forwardRef(({bsPrefix:e,active:t,disabled:n,eventKey:r,className:o,variant:i,action:s,as:l,...c},u)=>{e=Dp(e,"list-group-item");const[d,p]=Tvt({key:pwe(r,c.href),active:t,...c}),h=dvt(g=>{if(n){g.preventDefault(),g.stopPropagation();return}d.onClick(g)});n&&c.tabIndex===void 0&&(c.tabIndex=-1,c["aria-disabled"]=!0);const m=l||(s?c.href?"a":"button":"div");return a.jsx(m,{ref:u,...c,...d,onClick:h,className:Hd(o,e,p.isActive&&"active",n&&"disabled",i&&`${e}-${i}`,s&&`${e}-action`)})});Rvt.displayName="ListGroupItem";const Ovt=f.forwardRef((e,t)=>{const{className:n,bsPrefix:r,variant:o,horizontal:i,numbered:s,as:l="div",...c}=avt(e,{activeKey:"onSelect"}),u=Dp(r,"list-group");let d;return i&&(d=i===!0?"horizontal":`horizontal-${i}`),a.jsx(STr,{ref:t,...c,as:l,className:Hd(n,u,o&&`${u}-${o}`,d&&`${u}-${d}`,s&&`${u}-numbered`)})});Ovt.displayName="ListGroup";const ire=Object.assign(Ovt,{Item:Rvt}),$vt=f.forwardRef(({bsPrefix:e,variant:t,animation:n="border",size:r,as:o="div",className:i,...s},l)=>{e=Dp(e,"spinner");const c=`${e}-${n}`;return a.jsx(o,{ref:l,...s,className:Hd(i,c,r&&`${c}-${r}`,t&&`text-${t}`)})});$vt.displayName="Spinner";const CTr=({counterpartyId:e})=>{const[t,n]=f.useState(null),[r,o]=f.useState(!0);return f.useEffect(()=>{o(!0),setTimeout(()=>{n({id:e||"123",name:"Mock CP",email:"test@example.com",taxpayer_identifier:"12345",send_remittance_advice:!0,live_mode:!1,created_at:Date.now(),updated_at:Date.now(),discarded_at:0,metadata:{}}),o(!1)},500)},[e]),r?a.jsx($vt,{animation:"border"}):t?a.jsxs(ore,{children:[a.jsx(ore.Header,{children:t.name}),a.jsx(ore.Body,{children:a.jsxs(ire,{variant:"flush",children:[a.jsxs(ire.Item,{children:["Email: ",t.email]}),a.jsxs(ire.Item,{children:["ID: ",t.id]})]})})]}):a.jsx(sTr,{variant:"danger",children:"Not found"})},h9e={name:"",email:"",send_remittance_advice:!1,taxpayer_identifier:"",accounts:[],metadata:{}},NTr=({initialData:e,onSubmit:t,onCancel:n,isSubmitting:r=!1,mode:o="create"})=>{const[i,s]=f.useState(h9e);f.useEffect(()=>{e&&s({...h9e,...e,accounts:e.accounts||[],send_remittance_advice:e.send_remittance_advice??!1})},[e]);const l=u=>{const{name:d,value:p,type:h}=u.target;if(h==="checkbox"){const{checked:m}=u.target;s(g=>({...g,[d]:m}))}else s(m=>({...m,[d]:p}))},c=u=>{u.preventDefault(),t(i)};return a.jsxs("form",{onSubmit:c,className:"space-y-6 bg-gray-800 p-6 rounded-lg border border-gray-700",children:[a.jsx("h3",{className:"text-xl font-bold text-white mb-4",children:o==="create"?"Create Counterparty":"Edit Counterparty"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1",children:"Name"}),a.jsx("input",{type:"text",name:"name",value:i.name||"",onChange:l,className:"w-full bg-gray-900 border border-gray-600 rounded p-2 text-white focus:border-cyan-500 focus:outline-none",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1",children:"Email"}),a.jsx("input",{type:"email",name:"email",value:i.email||"",onChange:l,className:"w-full bg-gray-900 border border-gray-600 rounded p-2 text-white focus:border-cyan-500 focus:outline-none"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-300 mb-1",children:"Taxpayer Identifier"}),a.jsx("input",{type:"text",name:"taxpayer_identifier",value:i.taxpayer_identifier||"",onChange:l,className:"w-full bg-gray-900 border border-gray-600 rounded p-2 text-white focus:border-cyan-500 focus:outline-none"})]}),a.jsxs("div",{className:"flex items-center pt-6",children:[a.jsx("input",{type:"checkbox",name:"send_remittance_advice",checked:i.send_remittance_advice,onChange:l,id:"send_remittance_advice",className:"w-4 h-4 text-cyan-600 bg-gray-700 border-gray-500 rounded focus:ring-cyan-500 focus:ring-2"}),a.jsx("label",{htmlFor:"send_remittance_advice",className:"ml-2 text-sm font-medium text-gray-300",children:"Send Remittance Advice"})]})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t border-gray-700",children:[a.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 text-white rounded-lg text-sm font-medium transition-colors",children:"Cancel"}),a.jsx("button",{type:"submit",disabled:r,className:"px-4 py-2 bg-cyan-600 hover:bg-cyan-500 text-white rounded-lg text-sm font-bold transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:r?"Saving...":"Save Counterparty"})]})]})};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var Rpe=function(e,t){return Rpe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},Rpe(e,t)};function jTr(e,t){Rpe(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ETr=100,ITr=100,m9e=50,Ope=50,$pe=50;function g9e(e){var t=e.className,n=e.counterClockwise,r=e.dashRatio,o=e.pathRadius,i=e.strokeWidth,s=e.style;return f.createElement("path",{className:t,style:Object.assign({},s,PTr({pathRadius:o,dashRatio:r,counterClockwise:n})),d:_Tr({pathRadius:o,counterClockwise:n}),strokeWidth:i,fillOpacity:0})}function _Tr(e){var t=e.pathRadius,n=e.counterClockwise,r=t,o=n?1:0;return` M `+Ope+","+$pe+` m 0,-`+r+` a `+r+","+r+" "+o+" 1 1 0,"+2*r+` a `+r+","+r+" "+o+" 1 1 0,-"+2*r+` `}function PTr(e){var t=e.counterClockwise,n=e.dashRatio,r=e.pathRadius,o=Math.PI*2*r,i=(1-n)*o;return{strokeDasharray:o+"px "+o+"px",strokeDashoffset:(t?-i:i)+"px"}}var ATr=(function(e){jTr(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getBackgroundPadding=function(){return this.props.background?this.props.backgroundPadding:0},t.prototype.getPathRadius=function(){return m9e-this.props.strokeWidth/2-this.getBackgroundPadding()},t.prototype.getPathRatio=function(){var n=this.props,r=n.value,o=n.minValue,i=n.maxValue,s=Math.min(Math.max(r,o),i);return(s-o)/(i-o)},t.prototype.render=function(){var n=this.props,r=n.circleRatio,o=n.className,i=n.classes,s=n.counterClockwise,l=n.styles,c=n.strokeWidth,u=n.text,d=this.getPathRadius(),p=this.getPathRatio();return f.createElement("svg",{className:i.root+" "+o,style:l.root,viewBox:"0 0 "+ETr+" "+ITr,"data-test-id":"CircularProgressbar"},this.props.background?f.createElement("circle",{className:i.background,style:l.background,cx:Ope,cy:$pe,r:m9e}):null,f.createElement(g9e,{className:i.trail,counterClockwise:s,dashRatio:r,pathRadius:d,strokeWidth:c,style:l.trail}),f.createElement(g9e,{className:i.path,counterClockwise:s,dashRatio:p*r,pathRadius:d,strokeWidth:c,style:l.path}),u?f.createElement("text",{className:i.text,style:l.text,x:Ope,y:$pe},u):null)},t.defaultProps={background:!1,backgroundPadding:0,circleRatio:1,classes:{root:"CircularProgressbar",trail:"CircularProgressbar-trail",path:"CircularProgressbar-path",text:"CircularProgressbar-text",background:"CircularProgressbar-background"},counterClockwise:!1,className:"",maxValue:100,minValue:0,strokeWidth:8,styles:{root:{},trail:{},path:{},text:{},background:{}},text:""},t})(f.Component);function TTr(e){var t=e.rotation,n=e.strokeLinecap,r=e.textColor,o=e.textSize,i=e.pathColor,s=e.pathTransition,l=e.pathTransitionDuration,c=e.trailColor,u=e.backgroundColor,d="rotate("+t+"turn)",p="center center";return{root:{},path:h9({stroke:i,strokeLinecap:n,transform:d,transformOrigin:p,transition:s,transitionDuration:l+"s"}),trail:h9({stroke:c,strokeLinecap:n,transform:d,transformOrigin:p}),text:h9({fill:r,fontSize:o}),background:h9({fill:u})}}function h9(e){return Object.keys(e).forEach(function(t){e[t]==null&&delete e[t]}),e}const kTr=({indexValue:e,maxValue:t=100,meterLabel:n="Disruption Index"})=>{const r=Math.min(t,Math.max(0,e)),o=r/t*100,i=[{stop:0,color:"#E53935"},{stop:50,color:"#FB8C00"},{stop:100,color:"#43A047"}],l=(c=>{for(let u=0;u0?o:`./${e.name}`;return typeof r.path!="string"&&x9e(r,"path",i),x9e(r,"relativePath",i),r}function RTr(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=MTr.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function x9e(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const OTr=[".DS_Store","Thumbs.db"];function $Tr(e){return x5(this,void 0,void 0,function*(){return LW(e)&&DTr(e.dataTransfer)?BTr(e.dataTransfer,e.type):LTr(e)?FTr(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?zTr(e):[]})}function DTr(e){return LW(e)}function LTr(e){return LW(e)&&LW(e.target)}function LW(e){return typeof e=="object"&&e!==null}function FTr(e){return Dpe(e.target.files).map(t=>VT(t))}function zTr(e){return x5(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>VT(n))})}function BTr(e,t){return x5(this,void 0,void 0,function*(){if(e.items){const n=Dpe(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(HTr));return y9e(Dvt(r))}return y9e(Dpe(e.files).map(n=>VT(n)))})}function y9e(e){return e.filter(t=>OTr.indexOf(t.name)===-1)}function Dpe(e){if(e===null)return[];const t=[];for(let n=0;n[...t,...Array.isArray(n)?Dvt(n):[n]],[])}function v9e(e,t){return x5(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const i=yield e.getAsFileSystemHandle();if(i===null)throw new Error(`${e} is not a File`);if(i!==void 0){const s=yield i.getFile();return s.handle=i,VT(s)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return VT(r,(n=t==null?void 0:t.fullPath)!==null&&n!==void 0?n:void 0)})}function VTr(e){return x5(this,void 0,void 0,function*(){return e.isDirectory?Lvt(e):UTr(e)})}function Lvt(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(s=>x5(this,void 0,void 0,function*(){if(s.length){const l=Promise.all(s.map(VTr));o.push(l),i()}else try{const l=yield Promise.all(o);n(l)}catch(l){r(l)}}),s=>{r(s)})}i()})}function UTr(e){return x5(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const o=VT(r,e.fullPath);t(o)},r=>{n(r)})})})}var m9={},b9e;function WTr(){return b9e||(b9e=1,m9.__esModule=!0,m9.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(function(s){var l=s.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?i===l.replace(/\/.*$/,""):o===l})}return!0}),m9}var GTr=WTr();const are=Ba(GTr);function w9e(e){return YTr(e)||KTr(e)||zvt(e)||qTr()}function qTr(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KTr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function YTr(e){if(Array.isArray(e))return Lpe(e)}function S9e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function C9e(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:ekr,message:"File type must be ".concat(r)}},N9e=function(t){return{code:tkr,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},j9e=function(t){return{code:nkr,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},ikr={code:rkr,message:"Too many files"};function Bvt(e,t){var n=e.type==="application/x-moz-file"||ZTr(e,t);return[n,n?null:okr(t)]}function Hvt(e,t,n){if(Bj(e.size))if(Bj(t)&&Bj(n)){if(e.size>n)return[!1,N9e(n)];if(e.sizen)return[!1,N9e(n)]}return[!0,null]}function Bj(e){return e!=null}function akr(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,s=e.maxFiles,l=e.validator;return!i&&t.length>1||i&&s>=1&&t.length>s?!1:t.every(function(c){var u=Bvt(c,n),d=wD(u,1),p=d[0],h=Hvt(c,r,o),m=wD(h,1),g=m[0],y=l?l(c):null;return p&&g&&!y})}function FW(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function g9(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function E9e(e){e.preventDefault()}function skr(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function lkr(e){return e.indexOf("Edge/")!==-1}function ckr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return skr(e)||lkr(e)}function Zy(){for(var e=arguments.length,t=new Array(e),n=0;n1?o-1:0),s=1;se.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ekr(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var gwe=f.forwardRef(function(e,t){var n=e.children,r=zW(e,mkr),o=qvt(r),i=o.open,s=zW(o,gkr);return f.useImperativeHandle(t,function(){return{open:i}},[i]),Ie.createElement(f.Fragment,null,n(Pc(Pc({},s),{},{open:i})))});gwe.displayName="Dropzone";var Gvt={disabled:!1,getFilesFromEvent:$Tr,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};gwe.defaultProps=Gvt;gwe.propTypes={children:Rt.func,accept:Rt.objectOf(Rt.arrayOf(Rt.string)),multiple:Rt.bool,preventDropOnDocument:Rt.bool,noClick:Rt.bool,noKeyboard:Rt.bool,noDrag:Rt.bool,noDragEventsBubbling:Rt.bool,minSize:Rt.number,maxSize:Rt.number,maxFiles:Rt.number,disabled:Rt.bool,getFilesFromEvent:Rt.func,onFileDialogCancel:Rt.func,onFileDialogOpen:Rt.func,useFsAccessApi:Rt.bool,autoFocus:Rt.bool,onDragEnter:Rt.func,onDragLeave:Rt.func,onDragOver:Rt.func,onDrop:Rt.func,onDropAccepted:Rt.func,onDropRejected:Rt.func,onError:Rt.func,validator:Rt.func};var Bpe={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function qvt(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Pc(Pc({},Gvt),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,s=t.minSize,l=t.multiple,c=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,p=t.onDragOver,h=t.onDrop,m=t.onDropAccepted,g=t.onDropRejected,y=t.onFileDialogCancel,x=t.onFileDialogOpen,v=t.useFsAccessApi,b=t.autoFocus,w=t.preventDropOnDocument,S=t.noClick,C=t.noKeyboard,N=t.noDrag,j=t.noDragEventsBubbling,I=t.onError,_=t.validator,T=f.useMemo(function(){return fkr(n)},[n]),P=f.useMemo(function(){return dkr(n)},[n]),E=f.useMemo(function(){return typeof x=="function"?x:_9e},[x]),M=f.useMemo(function(){return typeof y=="function"?y:_9e},[y]),R=f.useRef(null),$=f.useRef(null),D=f.useReducer(Ikr,Bpe),z=sre(D,2),V=z[0],B=z[1],G=V.isFocused,H=V.isFileDialogActive,F=f.useRef(typeof window<"u"&&window.isSecureContext&&v&&ukr()),W=function(){!F.current&&H&&setTimeout(function(){if($.current){var Ue=$.current.files;Ue.length||(B({type:"closeDialog"}),M())}},300)};f.useEffect(function(){return window.addEventListener("focus",W,!1),function(){window.removeEventListener("focus",W,!1)}},[$,H,M,F]);var U=f.useRef([]),K=function(Ue){R.current&&R.current.contains(Ue.target)||(Ue.preventDefault(),U.current=[])};f.useEffect(function(){return w&&(document.addEventListener("dragover",E9e,!1),document.addEventListener("drop",K,!1)),function(){w&&(document.removeEventListener("dragover",E9e),document.removeEventListener("drop",K))}},[R,w]),f.useEffect(function(){return!r&&b&&R.current&&R.current.focus(),function(){}},[R,b,r]);var X=f.useCallback(function(Re){I?I(Re):console.error(Re)},[I]),J=f.useCallback(function(Re){Re.preventDefault(),Re.persist(),_e(Re),U.current=[].concat(vkr(U.current),[Re.target]),g9(Re)&&Promise.resolve(o(Re)).then(function(Ue){if(!(FW(Re)&&!j)){var He=Ue.length,Ye=He>0&&akr({files:Ue,accept:T,minSize:s,maxSize:i,multiple:l,maxFiles:c,validator:_}),We=He>0&&!Ye;B({isDragAccept:Ye,isDragReject:We,isDragActive:!0,type:"setDraggedFiles"}),u&&u(Re)}}).catch(function(Ue){return X(Ue)})},[o,u,X,j,T,s,i,l,c,_]),te=f.useCallback(function(Re){Re.preventDefault(),Re.persist(),_e(Re);var Ue=g9(Re);if(Ue&&Re.dataTransfer)try{Re.dataTransfer.dropEffect="copy"}catch{}return Ue&&p&&p(Re),!1},[p,j]),re=f.useCallback(function(Re){Re.preventDefault(),Re.persist(),_e(Re);var Ue=U.current.filter(function(Ye){return R.current&&R.current.contains(Ye)}),He=Ue.indexOf(Re.target);He!==-1&&Ue.splice(He,1),U.current=Ue,!(Ue.length>0)&&(B({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),g9(Re)&&d&&d(Re))},[R,d,j]),ce=f.useCallback(function(Re,Ue){var He=[],Ye=[];Re.forEach(function(We){var at=Bvt(We,T),Oe=sre(at,2),Ae=Oe[0],qe=Oe[1],dt=Hvt(We,s,i),Ze=sre(dt,2),Qe=Ze[0],lt=Ze[1],bt=_?_(We):null;if(Ae&&Qe&&!bt)He.push(We);else{var Ct=[qe,lt];bt&&(Ct=Ct.concat(bt)),Ye.push({file:We,errors:Ct.filter(function(Je){return Je})})}}),(!l&&He.length>1||l&&c>=1&&He.length>c)&&(He.forEach(function(We){Ye.push({file:We,errors:[ikr]})}),He.splice(0)),B({acceptedFiles:He,fileRejections:Ye,isDragReject:Ye.length>0,type:"setFiles"}),h&&h(He,Ye,Ue),Ye.length>0&&g&&g(Ye,Ue),He.length>0&&m&&m(He,Ue)},[B,l,T,s,i,c,h,m,g,_]),ae=f.useCallback(function(Re){Re.preventDefault(),Re.persist(),_e(Re),U.current=[],g9(Re)&&Promise.resolve(o(Re)).then(function(Ue){FW(Re)&&!j||ce(Ue,Re)}).catch(function(Ue){return X(Ue)}),B({type:"reset"})},[o,ce,X,j]),oe=f.useCallback(function(){if(F.current){B({type:"openDialog"}),E();var Re={multiple:l,types:P};window.showOpenFilePicker(Re).then(function(Ue){return o(Ue)}).then(function(Ue){ce(Ue,null),B({type:"closeDialog"})}).catch(function(Ue){pkr(Ue)?(M(Ue),B({type:"closeDialog"})):hkr(Ue)?(F.current=!1,$.current?($.current.value=null,$.current.click()):X(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):X(Ue)});return}$.current&&(B({type:"openDialog"}),E(),$.current.value=null,$.current.click())},[B,E,M,v,ce,X,P,l]),ue=f.useCallback(function(Re){!R.current||!R.current.isEqualNode(Re.target)||(Re.key===" "||Re.key==="Enter"||Re.keyCode===32||Re.keyCode===13)&&(Re.preventDefault(),oe())},[R,oe]),fe=f.useCallback(function(){B({type:"focus"})},[]),se=f.useCallback(function(){B({type:"blur"})},[]),ge=f.useCallback(function(){S||(ckr()?setTimeout(oe,0):oe())},[S,oe]),ye=function(Ue){return r?null:Ue},de=function(Ue){return C?null:ye(Ue)},Ne=function(Ue){return N?null:ye(Ue)},_e=function(Ue){j&&Ue.stopPropagation()},xe=f.useMemo(function(){return function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ue=Re.refKey,He=Ue===void 0?"ref":Ue,Ye=Re.role,We=Re.onKeyDown,at=Re.onFocus,Oe=Re.onBlur,Ae=Re.onClick,qe=Re.onDragEnter,dt=Re.onDragOver,Ze=Re.onDragLeave,Qe=Re.onDrop,lt=zW(Re,xkr);return Pc(Pc(zpe({onKeyDown:de(Zy(We,ue)),onFocus:de(Zy(at,fe)),onBlur:de(Zy(Oe,se)),onClick:ye(Zy(Ae,ge)),onDragEnter:Ne(Zy(qe,J)),onDragOver:Ne(Zy(dt,te)),onDragLeave:Ne(Zy(Ze,re)),onDrop:Ne(Zy(Qe,ae)),role:typeof Ye=="string"&&Ye!==""?Ye:"presentation"},He,R),!r&&!C?{tabIndex:0}:{}),lt)}},[R,ue,fe,se,ge,J,te,re,ae,C,N,r]),we=f.useCallback(function(Re){Re.stopPropagation()},[]),Te=f.useMemo(function(){return function(){var Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Ue=Re.refKey,He=Ue===void 0?"ref":Ue,Ye=Re.onChange,We=Re.onClick,at=zW(Re,ykr),Oe=zpe({accept:T,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ye(Zy(Ye,ae)),onClick:ye(Zy(We,we)),tabIndex:-1},He,$);return Pc(Pc({},Oe),at)}},[$,n,l,ae,r]);return Pc(Pc({},V),{},{isFocused:G&&!r,getRootProps:xe,getInputProps:Te,rootRef:R,inputRef:$,open:ye(oe)})}function Ikr(e,t){switch(t.type){case"focus":return Pc(Pc({},e),{},{isFocused:!0});case"blur":return Pc(Pc({},e),{},{isFocused:!1});case"openDialog":return Pc(Pc({},Bpe),{},{isFileDialogActive:!0});case"closeDialog":return Pc(Pc({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Pc(Pc({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Pc(Pc({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Pc({},Bpe);default:return e}}function _9e(){}const _kr=({documentableType:e,documentableId:t,onUploadSuccess:n,onError:r})=>{const[o,i]=f.useState(!1),s=f.useCallback(async d=>{var m;i(!0);const p=d[0],h=new FormData;h.append("file",p);try{const g=await fetch(`/api/${e}/${t}/documents`,{method:"POST",body:h,headers:{}});if(g.ok){const y=await g.json();n&&n(y.id)}else{const y=await g.json(),x=((m=y==null?void 0:y.errors)==null?void 0:m.message)||`Upload failed with status: ${g.status}`;r?r(x):console.error("Upload failed:",x)}}catch(g){const y=g.message||"An unexpected error occurred during upload.";r?r(y):console.error("Upload error:",y)}finally{i(!1)}},[e,t,n,r]),{getRootProps:l,getInputProps:c,isDragActive:u}=qvt({onDrop:s,multiple:!1});return a.jsxs("div",{...l(),style:{border:"2px dashed #cccccc",borderRadius:"4px",padding:"20px",textAlign:"center",cursor:"pointer",opacity:o?.5:1,pointerEvents:o?"none":"auto"},children:[a.jsx("input",{...c()}),u?a.jsx("p",{children:"Drop the file here ..."}):a.jsx("p",{children:"Drag 'n' drop a file here, or click to select file"}),o&&a.jsx("p",{children:"Uploading..."})]})},Pkr=({url:e,filename:t})=>a.jsxs("a",{href:e,download:t,className:"text-blue-500 hover:text-blue-600 underline text-sm",target:"_blank",rel:"noopener noreferrer",children:["Download ",t]}),Akr=()=>{const[e,t]=f.useState([]);return f.useEffect(()=>{const r=setInterval(()=>{const o=[{id:`issfr_${Date.now()}`,charge:"ch_1234",fraud_type:"card_testing",created:Date.now()}];t(i=>[...o,...i])},5e3);return()=>clearInterval(r)},[]),a.jsxs("div",{children:[a.jsx("h3",{children:"Early Fraud Warnings"}),a.jsx("ul",{children:e.map(n=>a.jsxs("li",{children:["Charge: ",n.charge,", Fraud Type: ",n.fraud_type,", Created:"," ",new Date(n.created).toLocaleTimeString()]},n.id))})]})};var B6=e=>e.type==="checkbox",hE=e=>e instanceof Date,tm=e=>e==null;const Kvt=e=>typeof e=="object";var od=e=>!tm(e)&&!Array.isArray(e)&&Kvt(e)&&!hE(e),Tkr=e=>od(e)&&e.target?B6(e.target)?e.target.checked:e.target.value:e,kkr=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Mkr=(e,t)=>e.has(kkr(t)),Rkr=e=>{const t=e.constructor&&e.constructor.prototype;return od(t)&&t.hasOwnProperty("isPrototypeOf")},xwe=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Vl(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(xwe&&(e instanceof Blob||t))return e;const n=Array.isArray(e);if(!n&&!(od(e)&&Rkr(e)))return e;const r=n?[]:Object.create(Object.getPrototypeOf(e));for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=Vl(e[o]));return r}var oX=e=>/^\w*$/.test(e),al=e=>e===void 0,iX=e=>Array.isArray(e)?e.filter(Boolean):[],ywe=e=>iX(e.replace(/["|']|\]/g,"").split(/\.|\[/)),qr=(e,t,n)=>{if(!t||!od(e))return n;const r=(oX(t)?[t]:ywe(t)).reduce((o,i)=>tm(o)?o:o[i],e);return al(r)||r===e?al(e[t])?n:e[t]:r},fv=e=>typeof e=="boolean",Ux=e=>typeof e=="function",Nl=(e,t,n)=>{let r=-1;const o=oX(t)?[t]:ywe(t),i=o.length,s=i-1;for(;++rIe.useContext(Yvt);var $kr=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const s=i;return t._proxyFormState[s]!==c0.all&&(t._proxyFormState[s]=!r||c0.all),e[s]}});return o};const Xvt=typeof window<"u"?Ie.useLayoutEffect:Ie.useEffect;var eg=e=>typeof e=="string",Dkr=(e,t,n,r,o)=>eg(e)?(r&&t.watch.add(e),qr(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),qr(n,i))):(r&&(t.watchAll=!0),n),Hpe=e=>tm(e)||!Kvt(e);function y2(e,t,n=new WeakSet){if(Hpe(e)||Hpe(t))return Object.is(e,t);if(hE(e)&&hE(t))return Object.is(e.getTime(),t.getTime());const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of r){const s=e[i];if(!o.includes(i))return!1;if(i!=="ref"){const l=t[i];if(hE(s)&&hE(l)||od(s)&&od(l)||Array.isArray(s)&&Array.isArray(l)?!y2(s,l,n):!Object.is(s,l))return!1}}return!0}const Lkr=Ie.createContext(null);Lkr.displayName="HookFormContext";var Fkr=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},cm=e=>Array.isArray(e)?e:[e],A9e=()=>{let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}};function Qvt(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],i=t[r];if(o&&od(o)&&i){const s=Qvt(o,i);od(s)&&(n[r]=s)}else e[r]&&(n[r]=i)}return n}var gp=e=>od(e)&&!Object.keys(e).length,vwe=e=>e.type==="file",BW=e=>{if(!xwe)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Jvt=e=>e.type==="select-multiple",bwe=e=>e.type==="radio",zkr=e=>bwe(e)||B6(e),lre=e=>BW(e)&&e.isConnected;function Bkr(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{for(const t in e)if(Ux(e[t]))return!0;return!1};function Zvt(e){return Array.isArray(e)||od(e)&&!Vkr(e)}function Vpe(e,t={}){for(const n in e){const r=e[n];Zvt(r)?(t[n]=Array.isArray(r)?[]:{},Vpe(r,t[n])):al(r)||(t[n]=!0)}return t}function lP(e,t,n){n||(n=Vpe(t));for(const r in e){const o=e[r];if(Zvt(o))al(t)||Hpe(n[r])?n[r]=Vpe(o,Array.isArray(o)?[]:{}):lP(o,tm(t)?{}:t[r],n[r]);else{const i=t[r];n[r]=!y2(o,i)}}return n}const T9e={value:!1,isValid:!1},k9e={value:!0,isValid:!0};var ebt=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!al(e[0].attributes.value)?al(e[0].value)||e[0].value===""?k9e:{value:e[0].value,isValid:!0}:k9e:T9e}return T9e},tbt=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>al(e)?e:t?e===""?NaN:e&&+e:n&&eg(e)?new Date(e):r?r(e):e;const M9e={isValid:!1,value:null};var nbt=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,M9e):M9e;function R9e(e){const t=e.ref;return vwe(t)?t.files:bwe(t)?nbt(e.refs).value:Jvt(t)?[...t.selectedOptions].map(({value:n})=>n):B6(t)?ebt(e.refs).value:tbt(al(t.value)?e.ref.value:t.value,e)}var Ukr=(e,t,n,r)=>{const o={};for(const i of e){const s=qr(t,i);s&&Nl(o,i,s._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},HW=e=>e instanceof RegExp,WM=e=>al(e)?e:HW(e)?e.source:od(e)?HW(e.value)?e.value.source:e.value:e,XP=e=>({isOnSubmit:!e||e===c0.onSubmit,isOnBlur:e===c0.onBlur,isOnChange:e===c0.onChange,isOnAll:e===c0.all,isOnTouch:e===c0.onTouched});const O9e="AsyncFunction";var Wkr=e=>!!e&&!!e.validate&&!!(Ux(e.validate)&&e.validate.constructor.name===O9e||od(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===O9e)),Gkr=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Upe=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const EA=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=qr(e,o);if(i){const{_f:s,...l}=i;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!r)return!0;if(s.ref&&t(s.ref,s.name)&&!r)return!0;if(EA(l,t))break}else if(od(l)&&EA(l,t))break}}};function $9e(e,t,n){const r=qr(e,n);if(r||oX(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),s=qr(t,i),l=qr(e,i);if(s&&!Array.isArray(s)&&n!==i)return{name:n};if(l&&l.type)return{name:i,error:l};if(l&&l.root&&l.root.type)return{name:`${i}.root`,error:l.root};o.pop()}return{name:n}}var qkr=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return gp(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(s=>t[s]===(!r||c0.all))},Kkr=(e,t,n)=>!e||!t||e===t||cm(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),Ykr=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,Xkr=(e,t)=>!iX(qr(e,t)).length&&Iu(e,t),rbt=(e,t,n)=>{const r=cm(qr(e,n));return Nl(r,"root",t[n]),Nl(e,n,r),e};function D9e(e,t,n="validate"){if(eg(e)||Array.isArray(e)&&e.every(eg)||fv(e)&&!e)return{type:n,message:eg(e)?e:"",ref:t}}var D_=e=>od(e)&&!HW(e)?e:{value:e,message:""},Wpe=async(e,t,n,r,o,i)=>{const{ref:s,refs:l,required:c,maxLength:u,minLength:d,min:p,max:h,pattern:m,validate:g,name:y,valueAsNumber:x,mount:v}=e._f,b=qr(n,y);if(!v||t.has(y))return{};const w=l?l[0]:s,S=E=>{o&&w.reportValidity&&(w.setCustomValidity(fv(E)?"":E||""),w.reportValidity())},C={},N=bwe(s),j=B6(s),I=N||j,_=(x||vwe(s))&&al(s.value)&&al(b)||BW(s)&&s.value===""||b===""||Array.isArray(b)&&!b.length,T=Fkr.bind(null,y,r,C),P=(E,M,R,$=o1.maxLength,D=o1.minLength)=>{const z=E?M:R;C[y]={type:E?$:D,message:z,ref:s,...T(E?$:D,z)}};if(i?!Array.isArray(b)||!b.length:c&&(!I&&(_||tm(b))||fv(b)&&!b||j&&!ebt(l).isValid||N&&!nbt(l).isValid)){const{value:E,message:M}=eg(c)?{value:!!c,message:c}:D_(c);if(E&&(C[y]={type:o1.required,message:M,ref:w,...T(o1.required,M)},!r))return S(M),C}if(!_&&(!tm(p)||!tm(h))){let E,M;const R=D_(h),$=D_(p);if(!tm(b)&&!isNaN(b)){const D=s.valueAsNumber||b&&+b;tm(R.value)||(E=D>R.value),tm($.value)||(M=D<$.value)}else{const D=s.valueAsDate||new Date(b),z=G=>new Date(new Date().toDateString()+" "+G),V=s.type=="time",B=s.type=="week";eg(R.value)&&b&&(E=V?z(b)>z(R.value):B?b>R.value:D>new Date(R.value)),eg($.value)&&b&&(M=V?z(b)+E.value,$=!tm(M.value)&&b.length<+M.value;if((R||$)&&(P(R,E.message,M.message),!r))return S(C[y].message),C}if(m&&!_&&eg(b)){const{value:E,message:M}=D_(m);if(HW(E)&&!b.match(E)&&(C[y]={type:o1.pattern,message:M,ref:s,...T(o1.pattern,M)},!r))return S(M),C}if(g){if(Ux(g)){const E=await g(b,n),M=D9e(E,w);if(M&&(C[y]={...M,...T(o1.validate,M.message)},!r))return S(M.message),C}else if(od(g)){let E={};for(const M in g){if(!gp(E)&&!r)break;const R=D9e(await g[M](b,n),w,M);R&&(E={...R,...T(M,R.message)},S(R.message),r&&(C[y]=E))}if(!gp(E)&&(C[y]={ref:w,...E},!r))return C}}return S(!0),C};const Qkr={mode:c0.onSubmit,reValidateMode:c0.onChange,shouldFocusError:!0};function Jkr(e={}){let t={...Qkr,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ux(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=od(t.defaultValues)||od(t.values)?Vl(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Vl(o),s={action:!1,mount:!1,watch:!1,keepIsValid:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},p={...d};let h={...p};const m={array:A9e(),state:A9e()},g=t.criteriaMode===c0.all,y=xe=>we=>{clearTimeout(u),u=setTimeout(xe,we)},x=async xe=>{if(!s.keepIsValid&&!t.disabled&&(p.isValid||h.isValid||xe)){let we;t.resolver?(we=gp((await I()).errors),v()):we=await T(r,!0),we!==n.isValid&&m.state.next({isValid:we})}},v=(xe,we)=>{!t.disabled&&(p.isValidating||p.validatingFields||h.isValidating||h.validatingFields)&&((xe||Array.from(l.mount)).forEach(Te=>{Te&&(we?Nl(n.validatingFields,Te,we):Iu(n.validatingFields,Te))}),m.state.next({validatingFields:n.validatingFields,isValidating:!gp(n.validatingFields)}))},b=(xe,we=[],Te,Re,Ue=!0,He=!0)=>{if(Re&&Te&&!t.disabled){if(s.action=!0,He&&Array.isArray(qr(r,xe))){const Ye=Te(qr(r,xe),Re.argA,Re.argB);Ue&&Nl(r,xe,Ye)}if(He&&Array.isArray(qr(n.errors,xe))){const Ye=Te(qr(n.errors,xe),Re.argA,Re.argB);Ue&&Nl(n.errors,xe,Ye),Xkr(n.errors,xe)}if((p.touchedFields||h.touchedFields)&&He&&Array.isArray(qr(n.touchedFields,xe))){const Ye=Te(qr(n.touchedFields,xe),Re.argA,Re.argB);Ue&&Nl(n.touchedFields,xe,Ye)}(p.dirtyFields||h.dirtyFields)&&(n.dirtyFields=lP(o,i)),m.state.next({name:xe,isDirty:E(xe,we),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Nl(i,xe,we)},w=(xe,we)=>{Nl(n.errors,xe,we),m.state.next({errors:n.errors})},S=xe=>{n.errors=xe,m.state.next({errors:n.errors,isValid:!1})},C=(xe,we,Te,Re)=>{const Ue=qr(r,xe);if(Ue){const He=qr(i,xe,al(Te)?qr(o,xe):Te);al(He)||Re&&Re.defaultChecked||we?Nl(i,xe,we?He:R9e(Ue._f)):$(xe,He),s.mount&&!s.action&&x()}},N=(xe,we,Te,Re,Ue)=>{let He=!1,Ye=!1;const We={name:xe};if(!t.disabled){if(!Te||Re){(p.isDirty||h.isDirty)&&(Ye=n.isDirty,n.isDirty=We.isDirty=E(),He=Ye!==We.isDirty);const at=y2(qr(o,xe),we);Ye=!!qr(n.dirtyFields,xe),at?Iu(n.dirtyFields,xe):Nl(n.dirtyFields,xe,!0),We.dirtyFields=n.dirtyFields,He=He||(p.dirtyFields||h.dirtyFields)&&Ye!==!at}if(Te){const at=qr(n.touchedFields,xe);at||(Nl(n.touchedFields,xe,Te),We.touchedFields=n.touchedFields,He=He||(p.touchedFields||h.touchedFields)&&at!==Te)}He&&Ue&&m.state.next(We)}return He?We:{}},j=(xe,we,Te,Re)=>{const Ue=qr(n.errors,xe),He=(p.isValid||h.isValid)&&fv(we)&&n.isValid!==we;if(t.delayError&&Te?(c=y(()=>w(xe,Te)),c(t.delayError)):(clearTimeout(u),c=null,Te?Nl(n.errors,xe,Te):Iu(n.errors,xe)),(Te?!y2(Ue,Te):Ue)||!gp(Re)||He){const Ye={...Re,...He&&fv(we)?{isValid:we}:{},errors:n.errors,name:xe};n={...n,...Ye},m.state.next(Ye)}},I=async xe=>(v(xe,!0),await t.resolver(i,t.context,Ukr(xe||l.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),_=async xe=>{const{errors:we}=await I(xe);if(v(xe),xe)for(const Te of xe){const Re=qr(we,Te);Re?Nl(n.errors,Te,Re):Iu(n.errors,Te)}else n.errors=we;return we},T=async(xe,we,Te={valid:!0})=>{for(const Re in xe){const Ue=xe[Re];if(Ue){const{_f:He,...Ye}=Ue;if(He){const We=l.array.has(He.name),at=Ue._f&&Wkr(Ue._f);at&&p.validatingFields&&v([He.name],!0);const Oe=await Wpe(Ue,l.disabled,i,g,t.shouldUseNativeValidation&&!we,We);if(at&&p.validatingFields&&v([He.name]),Oe[He.name]&&(Te.valid=!1,we||e.shouldUseNativeValidation))break;!we&&(qr(Oe,He.name)?We?rbt(n.errors,Oe,He.name):Nl(n.errors,He.name,Oe[He.name]):Iu(n.errors,He.name))}!gp(Ye)&&await T(Ye,we,Te)}}return Te.valid},P=()=>{for(const xe of l.unMount){const we=qr(r,xe);we&&(we._f.refs?we._f.refs.every(Te=>!lre(Te)):!lre(we._f.ref))&&te(xe)}l.unMount=new Set},E=(xe,we)=>!t.disabled&&(xe&&we&&Nl(i,xe,we),!y2(H(),o)),M=(xe,we,Te)=>Dkr(xe,l,{...s.mount?i:al(we)?o:eg(xe)?{[xe]:we}:we},Te,we),R=xe=>iX(qr(s.mount?i:o,xe,t.shouldUnregister?qr(o,xe,[]):[])),$=(xe,we,Te={})=>{const Re=qr(r,xe);let Ue=we;if(Re){const He=Re._f;He&&(!He.disabled&&Nl(i,xe,tbt(we,He)),Ue=BW(He.ref)&&tm(we)?"":we,Jvt(He.ref)?[...He.ref.options].forEach(Ye=>Ye.selected=Ue.includes(Ye.value)):He.refs?B6(He.ref)?He.refs.forEach(Ye=>{(!Ye.defaultChecked||!Ye.disabled)&&(Array.isArray(Ue)?Ye.checked=!!Ue.find(We=>We===Ye.value):Ye.checked=Ue===Ye.value||!!Ue)}):He.refs.forEach(Ye=>Ye.checked=Ye.value===Ue):vwe(He.ref)?He.ref.value="":(He.ref.value=Ue,He.ref.type||m.state.next({name:xe,values:Vl(i)})))}(Te.shouldDirty||Te.shouldTouch)&&N(xe,Ue,Te.shouldTouch,Te.shouldDirty,!0),Te.shouldValidate&&G(xe)},D=(xe,we,Te)=>{for(const Re in we){if(!we.hasOwnProperty(Re))return;const Ue=we[Re],He=xe+"."+Re,Ye=qr(r,He);(l.array.has(xe)||od(Ue)||Ye&&!Ye._f)&&!hE(Ue)?D(He,Ue,Te):$(He,Ue,Te)}},z=(xe,we,Te={})=>{const Re=qr(r,xe),Ue=l.array.has(xe),He=Vl(we);Nl(i,xe,He),Ue?(m.array.next({name:xe,values:Vl(i)}),(p.isDirty||p.dirtyFields||h.isDirty||h.dirtyFields)&&Te.shouldDirty&&m.state.next({name:xe,dirtyFields:lP(o,i),isDirty:E(xe,He)})):Re&&!Re._f&&!tm(He)?D(xe,He,Te):$(xe,He,Te),Upe(xe,l)?m.state.next({...n,name:xe,values:Vl(i)}):m.state.next({name:s.mount?xe:void 0,values:Vl(i)})},V=async xe=>{s.mount=!0;const we=xe.target;let Te=we.name,Re=!0;const Ue=qr(r,Te),He=at=>{Re=Number.isNaN(at)||hE(at)&&isNaN(at.getTime())||y2(at,qr(i,Te,at))},Ye=XP(t.mode),We=XP(t.reValidateMode);if(Ue){let at,Oe;const Ae=we.type?R9e(Ue._f):Tkr(xe),qe=xe.type===P9e.BLUR||xe.type===P9e.FOCUS_OUT,dt=!Gkr(Ue._f)&&!t.resolver&&!qr(n.errors,Te)&&!Ue._f.deps||Ykr(qe,qr(n.touchedFields,Te),n.isSubmitted,We,Ye),Ze=Upe(Te,l,qe);Nl(i,Te,Ae),qe?(!we||!we.readOnly)&&(Ue._f.onBlur&&Ue._f.onBlur(xe),c&&c(0)):Ue._f.onChange&&Ue._f.onChange(xe);const Qe=N(Te,Ae,qe),lt=!gp(Qe)||Ze;if(!qe&&m.state.next({name:Te,type:xe.type,values:Vl(i)}),dt)return(p.isValid||h.isValid)&&(t.mode==="onBlur"?qe&&x():qe||x()),lt&&m.state.next({name:Te,...Ze?{}:Qe});if(!qe&&Ze&&m.state.next({...n}),t.resolver){const{errors:bt}=await I([Te]);if(v([Te]),He(Ae),Re){const Ct=$9e(n.errors,r,Te),Je=$9e(bt,r,Ct.name||Te);at=Je.error,Te=Je.name,Oe=gp(bt)}}else v([Te],!0),at=(await Wpe(Ue,l.disabled,i,g,t.shouldUseNativeValidation))[Te],v([Te]),He(Ae),Re&&(at?Oe=!1:(p.isValid||h.isValid)&&(Oe=await T(r,!0)));Re&&(Ue._f.deps&&(!Array.isArray(Ue._f.deps)||Ue._f.deps.length>0)&&G(Ue._f.deps),j(Te,Oe,at,Qe))}},B=(xe,we)=>{if(qr(n.errors,we)&&xe.focus)return xe.focus(),1},G=async(xe,we={})=>{let Te,Re;const Ue=cm(xe);if(t.resolver){const He=await _(al(xe)?xe:Ue);Te=gp(He),Re=xe?!Ue.some(Ye=>qr(He,Ye)):Te}else xe?(Re=(await Promise.all(Ue.map(async He=>{const Ye=qr(r,He);return await T(Ye&&Ye._f?{[He]:Ye}:Ye)}))).every(Boolean),!(!Re&&!n.isValid)&&x()):Re=Te=await T(r);return m.state.next({...!eg(xe)||(p.isValid||h.isValid)&&Te!==n.isValid?{}:{name:xe},...t.resolver||!xe?{isValid:Te}:{},errors:n.errors}),we.shouldFocus&&!Re&&EA(r,B,xe?Ue:l.mount),Re},H=(xe,we)=>{let Te={...s.mount?i:o};return we&&(Te=Qvt(we.dirtyFields?n.dirtyFields:n.touchedFields,Te)),al(xe)?Te:eg(xe)?qr(Te,xe):xe.map(Re=>qr(Te,Re))},F=(xe,we)=>({invalid:!!qr((we||n).errors,xe),isDirty:!!qr((we||n).dirtyFields,xe),error:qr((we||n).errors,xe),isValidating:!!qr(n.validatingFields,xe),isTouched:!!qr((we||n).touchedFields,xe)}),W=xe=>{xe&&cm(xe).forEach(we=>Iu(n.errors,we)),m.state.next({errors:xe?n.errors:{}})},U=(xe,we,Te)=>{const Re=(qr(r,xe,{_f:{}})._f||{}).ref,Ue=qr(n.errors,xe)||{},{ref:He,message:Ye,type:We,...at}=Ue;Nl(n.errors,xe,{...at,...we,ref:Re}),m.state.next({name:xe,errors:n.errors,isValid:!1}),Te&&Te.shouldFocus&&Re&&Re.focus&&Re.focus()},K=(xe,we)=>Ux(xe)?m.state.subscribe({next:Te=>"values"in Te&&xe(M(void 0,we),Te)}):M(xe,we,!0),X=xe=>m.state.subscribe({next:we=>{Kkr(xe.name,we.name,xe.exact)&&qkr(we,xe.formState||p,de,xe.reRenderRoot)&&xe.callback({values:{...i},...n,...we,defaultValues:o})}}).unsubscribe,J=xe=>(s.mount=!0,h={...h,...xe.formState},X({...xe,formState:{...d,...xe.formState}})),te=(xe,we={})=>{for(const Te of xe?cm(xe):l.mount)l.mount.delete(Te),l.array.delete(Te),we.keepValue||(Iu(r,Te),Iu(i,Te)),!we.keepError&&Iu(n.errors,Te),!we.keepDirty&&Iu(n.dirtyFields,Te),!we.keepTouched&&Iu(n.touchedFields,Te),!we.keepIsValidating&&Iu(n.validatingFields,Te),!t.shouldUnregister&&!we.keepDefaultValue&&Iu(o,Te);m.state.next({values:Vl(i)}),m.state.next({...n,...we.keepDirty?{isDirty:E()}:{}}),!we.keepIsValid&&x()},re=({disabled:xe,name:we})=>{if(fv(xe)&&s.mount||xe||l.disabled.has(we)){const Ue=l.disabled.has(we)!==!!xe;xe?l.disabled.add(we):l.disabled.delete(we),Ue&&s.mount&&!s.action&&x()}},ce=(xe,we={})=>{let Te=qr(r,xe);const Re=fv(we.disabled)||fv(t.disabled);return Nl(r,xe,{...Te||{},_f:{...Te&&Te._f?Te._f:{ref:{name:xe}},name:xe,mount:!0,...we}}),l.mount.add(xe),Te?re({disabled:fv(we.disabled)?we.disabled:t.disabled,name:xe}):C(xe,!0,we.value),{...Re?{disabled:we.disabled||t.disabled}:{},...t.progressive?{required:!!we.required,min:WM(we.min),max:WM(we.max),minLength:WM(we.minLength),maxLength:WM(we.maxLength),pattern:WM(we.pattern)}:{},name:xe,onChange:V,onBlur:V,ref:Ue=>{if(Ue){ce(xe,we),Te=qr(r,xe);const He=al(Ue.value)&&Ue.querySelectorAll&&Ue.querySelectorAll("input,select,textarea")[0]||Ue,Ye=zkr(He),We=Te._f.refs||[];if(Ye?We.find(at=>at===He):He===Te._f.ref)return;Nl(r,xe,{_f:{...Te._f,...Ye?{refs:[...We.filter(lre),He,...Array.isArray(qr(o,xe))?[{}]:[]],ref:{type:He.type,name:xe}}:{ref:He}}}),C(xe,!1,void 0,He)}else Te=qr(r,xe,{}),Te._f&&(Te._f.mount=!1),(t.shouldUnregister||we.shouldUnregister)&&!(Mkr(l.array,xe)&&s.action)&&l.unMount.add(xe)}}},ae=()=>t.shouldFocusError&&EA(r,B,l.mount),oe=xe=>{fv(xe)&&(m.state.next({disabled:xe}),EA(r,(we,Te)=>{const Re=qr(r,Te);Re&&(we.disabled=Re._f.disabled||xe,Array.isArray(Re._f.refs)&&Re._f.refs.forEach(Ue=>{Ue.disabled=Re._f.disabled||xe}))},0,!1))},ue=(xe,we)=>async Te=>{let Re;Te&&(Te.preventDefault&&Te.preventDefault(),Te.persist&&Te.persist());let Ue=Vl(i);if(m.state.next({isSubmitting:!0}),t.resolver){const{errors:He,values:Ye}=await I();v(),n.errors=He,Ue=Vl(Ye)}else await T(r);if(l.disabled.size)for(const He of l.disabled)Iu(Ue,He);if(Iu(n.errors,"root"),gp(n.errors)){m.state.next({errors:{}});try{await xe(Ue,Te)}catch(He){Re=He}}else we&&await we({...n.errors},Te),ae(),setTimeout(ae);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:gp(n.errors)&&!Re,submitCount:n.submitCount+1,errors:n.errors}),Re)throw Re},fe=(xe,we={})=>{qr(r,xe)&&(al(we.defaultValue)?z(xe,Vl(qr(o,xe))):(z(xe,we.defaultValue),Nl(o,xe,Vl(we.defaultValue))),we.keepTouched||Iu(n.touchedFields,xe),we.keepDirty||(Iu(n.dirtyFields,xe),n.isDirty=we.defaultValue?E(xe,Vl(qr(o,xe))):E()),we.keepError||(Iu(n.errors,xe),p.isValid&&x()),m.state.next({...n}))},se=(xe,we={})=>{const Te=xe?Vl(xe):o,Re=Vl(Te),Ue=gp(xe),He=Ue?o:Re;if(we.keepDefaultValues||(o=Te),!we.keepValues){if(we.keepDirtyValues){const Ye=new Set([...l.mount,...Object.keys(lP(o,i))]);for(const We of Array.from(Ye)){const at=qr(n.dirtyFields,We),Oe=qr(i,We),Ae=qr(He,We);at&&!al(Oe)?Nl(He,We,Oe):!at&&!al(Ae)&&z(We,Ae)}}else{if(xwe&&al(xe))for(const Ye of l.mount){const We=qr(r,Ye);if(We&&We._f){const at=Array.isArray(We._f.refs)?We._f.refs[0]:We._f.ref;if(BW(at)){const Oe=at.closest("form");if(Oe){Oe.reset();break}}}}if(we.keepFieldsRef)for(const Ye of l.mount)z(Ye,qr(He,Ye));else r={}}i=t.shouldUnregister?we.keepDefaultValues?Vl(o):{}:Vl(He),m.array.next({values:{...He}}),m.state.next({values:{...He}})}l={mount:we.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!p.isValid||!!we.keepIsValid||!!we.keepDirtyValues||!t.shouldUnregister&&!gp(He),s.watch=!!t.shouldUnregister,s.keepIsValid=!!we.keepIsValid,s.action=!1,we.keepErrors||(n.errors={}),m.state.next({submitCount:we.keepSubmitCount?n.submitCount:0,isDirty:Ue?!1:we.keepDirty?n.isDirty:!!(we.keepDefaultValues&&!y2(xe,o)),isSubmitted:we.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Ue?{}:we.keepDirtyValues?we.keepDefaultValues&&i?lP(o,i):n.dirtyFields:we.keepDefaultValues&&xe?lP(o,xe):we.keepDirty?n.dirtyFields:{},touchedFields:we.keepTouched?n.touchedFields:{},errors:we.keepErrors?n.errors:{},isSubmitSuccessful:we.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},ge=(xe,we)=>se(Ux(xe)?xe(i):xe,{...t.resetOptions,...we}),ye=(xe,we={})=>{const Te=qr(r,xe),Re=Te&&Te._f;if(Re){const Ue=Re.refs?Re.refs[0]:Re.ref;Ue.focus&&setTimeout(()=>{Ue.focus(),we.shouldSelect&&Ux(Ue.select)&&Ue.select()})}},de=xe=>{n={...n,...xe}},_e={control:{register:ce,unregister:te,getFieldState:F,handleSubmit:ue,setError:U,_subscribe:X,_runSchema:I,_updateIsValidating:v,_focusError:ae,_getWatch:M,_getDirty:E,_setValid:x,_setFieldArray:b,_setDisabledField:re,_setErrors:S,_getFieldArray:R,_reset:se,_resetDefaultValues:()=>Ux(t.defaultValues)&&t.defaultValues().then(xe=>{ge(xe,t.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:P,_disableForm:oe,_subjects:m,_proxyFormState:p,get _fields(){return r},get _formValues(){return i},get _state(){return s},set _state(xe){s=xe},get _defaultValues(){return o},get _names(){return l},set _names(xe){l=xe},get _formState(){return n},get _options(){return t},set _options(xe){t={...t,...xe}}},subscribe:J,trigger:G,register:ce,handleSubmit:ue,watch:K,setValue:z,getValues:H,reset:ge,resetField:fe,clearErrors:W,unregister:te,setError:U,setFocus:ye,getFieldState:F};return{..._e,formControl:_e}}var OS=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},cre=(e,t,n={})=>n.shouldFocus||al(n.shouldFocus)?n.focusName||`${e}.${al(n.focusIndex)?t:n.focusIndex}.`:"",ure=(e,t)=>[...e,...cm(t)],dre=e=>Array.isArray(e)?e.map(()=>{}):void 0;function fre(e,t,n){return[...e.slice(0,t),...cm(n),...e.slice(t)]}var pre=(e,t,n)=>Array.isArray(e)?(al(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],hre=(e,t)=>[...cm(t),...cm(e)];function Zkr(e,t){let n=0;const r=[...e];for(const o of t)r.splice(o-n,1),n++;return iX(r).length?r:[]}var mre=(e,t)=>al(t)?[]:Zkr(e,cm(t).sort((n,r)=>n-r)),gre=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},L9e=(e,t,n)=>(e[t]=n,e);function F9e(e){const t=Okr(),{control:n=t,name:r,keyName:o="id",shouldUnregister:i,rules:s}=e,[l,c]=Ie.useState(n._getFieldArray(r)),u=Ie.useRef(n._getFieldArray(r).map(OS)),d=Ie.useRef(!1);n._names.array.add(r),Ie.useMemo(()=>s&&l.length>=0&&n.register(r,s),[n,r,l.length,s]),Xvt(()=>n._subjects.array.subscribe({next:({values:S,name:C})=>{if(C===r||!C){const N=qr(S,r);Array.isArray(N)&&(c(N),u.current=N.map(OS))}}}).unsubscribe,[n,r]);const p=Ie.useCallback(S=>{d.current=!0,n._setFieldArray(r,S)},[n,r]),h=(S,C)=>{const N=cm(Vl(S)),j=ure(n._getFieldArray(r),N);n._names.focus=cre(r,j.length-1,C),u.current=ure(u.current,N.map(OS)),p(j),c(j),n._setFieldArray(r,j,ure,{argA:dre(S)})},m=(S,C)=>{const N=cm(Vl(S)),j=hre(n._getFieldArray(r),N);n._names.focus=cre(r,0,C),u.current=hre(u.current,N.map(OS)),p(j),c(j),n._setFieldArray(r,j,hre,{argA:dre(S)})},g=S=>{const C=mre(n._getFieldArray(r),S);u.current=mre(u.current,S),p(C),c(C),!Array.isArray(qr(n._fields,r))&&Nl(n._fields,r,void 0),n._setFieldArray(r,C,mre,{argA:S})},y=(S,C,N)=>{const j=cm(Vl(C)),I=fre(n._getFieldArray(r),S,j);n._names.focus=cre(r,S,N),u.current=fre(u.current,S,j.map(OS)),p(I),c(I),n._setFieldArray(r,I,fre,{argA:S,argB:dre(C)})},x=(S,C)=>{const N=n._getFieldArray(r);gre(N,S,C),gre(u.current,S,C),p(N),c(N),n._setFieldArray(r,N,gre,{argA:S,argB:C},!1)},v=(S,C)=>{const N=n._getFieldArray(r);pre(N,S,C),pre(u.current,S,C),p(N),c(N),n._setFieldArray(r,N,pre,{argA:S,argB:C},!1)},b=(S,C)=>{const N=Vl(C),j=L9e(n._getFieldArray(r),S,N);u.current=[...j].map((I,_)=>!I||_===S?OS():u.current[_]),p(j),c([...j]),n._setFieldArray(r,j,L9e,{argA:S,argB:N},!0,!1)},w=S=>{const C=cm(Vl(S));u.current=C.map(OS),p([...C]),c([...C]),n._setFieldArray(r,[...C],N=>N,{},!0,!1)};return Ie.useEffect(()=>{if(n._state.action=!1,Upe(r,n._names)&&n._subjects.state.next({...n._formState}),d.current&&(!XP(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!XP(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([r]).then(S=>{n._updateIsValidating([r]);const C=qr(S.errors,r),N=qr(n._formState.errors,r);(N?!C&&N.type||C&&(N.type!==C.type||N.message!==C.message):C&&C.type)&&(C?Nl(n._formState.errors,r,C):Iu(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const S=qr(n._fields,r);S&&S._f&&!(XP(n._options.reValidateMode).isOnSubmit&&XP(n._options.mode).isOnSubmit)&&Wpe(S,n._names.disabled,n._formValues,n._options.criteriaMode===c0.all,n._options.shouldUseNativeValidation,!0).then(C=>!gp(C)&&n._subjects.state.next({errors:rbt(n._formState.errors,C,r)}))}n._subjects.state.next({name:r,values:Vl(n._formValues)}),n._names.focus&&EA(n._fields,(S,C)=>{if(n._names.focus&&C.startsWith(n._names.focus)&&S.focus)return S.focus(),1}),n._names.focus="",n._setValid(),d.current=!1},[l,r,n]),Ie.useEffect(()=>(!qr(n._formValues,r)&&n._setFieldArray(r),()=>{const S=(C,N)=>{const j=qr(n._fields,C);j&&j._f&&(j._f.mount=N)};n._options.shouldUnregister||i?n.unregister(r):S(r,!1)}),[r,n,o,i]),{swap:Ie.useCallback(x,[p,r,n]),move:Ie.useCallback(v,[p,r,n]),prepend:Ie.useCallback(m,[p,r,n]),append:Ie.useCallback(h,[p,r,n]),remove:Ie.useCallback(g,[p,r,n]),insert:Ie.useCallback(y,[p,r,n]),update:Ie.useCallback(b,[p,r,n]),replace:Ie.useCallback(w,[p,r,n]),fields:Ie.useMemo(()=>l.map((S,C)=>({...S,[o]:u.current[C]||OS()})),[l,o])}}function obt(e={}){const t=Ie.useRef(void 0),n=Ie.useRef(void 0),[r,o]=Ie.useState({isDirty:!1,isValidating:!1,isLoading:Ux(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Ux(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!Ux(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:s,...l}=Jkr(e);t.current={...l,formState:r}}const i=t.current.control;return i._options=e,Xvt(()=>{const s=i._subscribe({formState:i._proxyFormState,callback:()=>o({...i._formState}),reRenderRoot:!0});return o(l=>({...l,isReady:!0})),i._formState.isReady=!0,s},[i]),Ie.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),Ie.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),Ie.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),Ie.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),Ie.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==r.isDirty&&i._subjects.state.next({isDirty:s})}},[i,r.isDirty]),Ie.useEffect(()=>{var s;e.values&&!y2(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((s=i._options.resetOptions)===null||s===void 0)&&s.keepIsValid||i._setValid(),n.current=e.values,o(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),Ie.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=Ie.useMemo(()=>$kr(r,i),[i,r]),t.current}const e4r=({availableChoices:e,onSubmit:t,onCancel:n})=>{const{register:r,handleSubmit:o,formState:{errors:i}}=obt(),[s,l]=f.useState(null),c=u=>{t(u)};return a.jsxs("form",{onSubmit:o(c),children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"ExternalElectionType1Code",children:"Choose an Election"}),a.jsx("select",{...r("ExternalElectionType1Code"),id:"ExternalElectionType1Code",children:a.jsx("option",{value:"",children:"Select an option"})})]}),a.jsx("button",{type:"submit",children:"Submit Election"}),a.jsx("button",{type:"button",onClick:n,children:"Cancel"})]})},t4r=({event:e})=>{const{corporateActionEventType:t}=e,n=r=>{if(!r)return"Unknown Event";switch(r){case"ACTV":return"Trading in the security has commenced or security has been re-activated.";case"ATTI":return"Combination of different security types to create a unit.";case"BRUP":return"Bankruptcy.";case"DFLT":return"Failure by the company to perform obligations.";case"BONU":return"Bonus or capitalisation issue.";case"EXRI":return"Call or exercise on nil paid securities.";case"CAPD":return"Cash distribution from the capital account.";case"CAPG":return"Capital gains distributions.";case"CAPI":return"Increase of the current principal of a debt instrument.";case"DRCA":return"Distribution to shareholders of cash.";case"DVCA":return"Cash dividend.";case"CHAN":return"Information regarding a change.";case"COOP":return"Company option.";case"CLSA":return"Class action.";case"CONS":return"Consent";case"CONV":return"Conversion of securities.";case"CREV":return"Occurrence of credit derivative.";case"DECR":return"Reduction of face value.";case"DETI":return"Separation of components.";case"DSCL":return"Disclosure requirement for holders.";case"DVOP":return"Dividend with choice of benefit.";case"DRIP":return"Dividend reinvestment plan.";case"DRAW":return"Securities are redeemed in part before the scheduled final maturity date.";case"DTCH":return"Action by a party wishing to acquire a security.";case"EXOF":return"Exchange offer.";case"REDM":return"Redemption.";case"MCAL":return"Redemption before final maturity.";case"INCR":return"Increase in face value.";case"PPMT":return"Instalment payment.";case"INTR":return"Interest payment.";case"RHDI":return"Distribution of intermediate securities.";case"LIQU":return"Distribution of cash, assets or both.";case"EXTM":return"Extension of maturity.";case"MRGR":return"Merger.";case"NOOF":return"Offers that are not supervised.";case"CERT":return"Certification requirement.";case"ODLT":return"Odd-lot sale or purchase.";case"OTHR":return"Other event.";case"PARI":return"Pari passu or assimilation.";case"PCAL":return"Partial call.";case"PRED":return"Securities are redeemed in part.";case"PINK":return"Interest payment in any kind except cash.";case"PLAC":return"Change in state of incorporation.";case"PDEF":return"Defeasance.";case"PRIO":return"Priority offer.";case"BPUT":return"Early redemption at the election of the holder.";case"REDO":return"Restate of unit.";case"REMK":return"Remarketed preferred equities/bonds";case"BIDS":return"Repurchase offer.";case"SPLR":return"Stock split.";case"RHTS":return"Rights offering.";case"DVSC":return"Dividend paid in scrip.";case"SHPR":return"Shares premium reserve.";case"SMAL":return"Smallest negotiable unit.";case"SOFF":return"Distribution of securities by another company.";case"DVSE":return"Dividend paid in equities.";case"SPLF":return"Stock split with reduced value.";case"TREC":return"Tax reclaim activities.";case"TEND":return"Tender offer.";case"DLST":return"Delisting of security.";case"SUSP":return"Trading suspension.";case"EXWA":return"Option exercise.";case"WTRC":return"Withholding tax reduction.";case"WRTH":return"Booking out of valueless securities.";case"ACCU":return"Funds related event in which the income is retained within the fund.";case"INFO":return"Information provided by the issuer having no accounting/financial impact on the holder.";case"TNDP":return"Taxable component on non-distributed proceeds.";default:return"Unknown Event"}};return a.jsx(p0,{sx:{mb:2,border:"1px solid #e0e0e0"},children:a.jsxs(h0,{children:[a.jsx(tn,{variant:"h6",component:"div",sx:{mb:1},children:n(t)}),a.jsx(Sw,{sx:{my:1}}),a.jsx(Dn,{sx:{display:"flex",flexDirection:"column"},children:t&&a.jsxs(tn,{variant:"body2",children:["Event Code: ",t]})})]})})},n4r=async e=>[],r4r=({internalAccountId:e})=>{const[t,n]=f.useState([]),[r,o]=f.useState(!1);f.useEffect(()=>{(async()=>{o(!0);try{const l=await n4r({internal_account_id:e});n(l)}catch(l){console.error("Failed to fetch expected payments:",l)}finally{o(!1)}})()},[e]);const i=[{title:"ID",dataIndex:"id",key:"id"},{title:"Amount",dataIndex:"amount_upper_bound",key:"amount",render:s=>s/100},{title:"Direction",dataIndex:"direction",key:"direction"},{title:"Type",dataIndex:"type",key:"type"}];return a.jsx(Ty,{columns:i,dataSource:t,loading:r,rowKey:"id"})},o4r=({account:e})=>{const t=e.name||e.party_name;return a.jsxs("div",{className:"bg-white shadow rounded-lg p-6 mb-4 border border-gray-200",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:t}),a.jsxs("p",{className:"text-sm text-gray-500 mb-4",children:["ID: ",e.id]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm text-gray-700",children:[a.jsxs("div",{children:[a.jsxs("p",{children:[a.jsx("strong",{className:"font-medium",children:"Account Type:"})," ",e.account_type]}),a.jsxs("p",{children:[a.jsx("strong",{className:"font-medium",children:"Verification Status:"})," ",e.verification_status.replace(/_/g," ").split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")]})]}),e.account_details&&e.account_details.length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-800 mt-2",children:"Account Details:"}),e.account_details.map(n=>a.jsxs("p",{className:"ml-2",children:[n.account_number_type.toUpperCase(),": •••• ",n.account_number_safe]},n.id))]}),e.routing_details&&e.routing_details.length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-800 mt-2",children:"Routing Details:"}),e.routing_details.map(n=>a.jsxs("div",{className:"ml-2",children:[a.jsx("p",{children:n.bank_name}),a.jsxs("p",{children:[a.jsxs("strong",{className:"font-light",children:[n.routing_number_type.toUpperCase(),":"]})," ",n.routing_number]})]},n.id))]}),e.metadata&&Object.keys(e.metadata).length>0&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-800 mt-2",children:"Metadata:"}),Object.entries(e.metadata).map(([n,r])=>a.jsxs("p",{className:"ml-2",children:[a.jsxs("strong",{className:"font-light",children:[n,":"]})," ",r]},n))]})]})]})},i4r={counterparty_id:"",name:"",party_name:"",account_type:"checking",party_type:"business",party_address:{line1:"",line2:"",locality:"",region:"",postal_code:"",country:"US"},account_details:[{account_number:"",account_number_type:"other"}],routing_details:[{routing_number:"",routing_number_type:"aba",payment_type:"ach"}]},So={form:{display:"flex",flexDirection:"column",gap:"20px",maxWidth:"700px",margin:"auto",padding:"20px",border:"1px solid #ccc",borderRadius:"8px",backgroundColor:"#f9f9f9"},fieldset:{display:"flex",flexDirection:"column",gap:"12px",border:"1px solid #ddd",borderRadius:"4px",padding:"15px"},legend:{fontWeight:"bold",padding:"0 5px",color:"#333"},label:{display:"flex",flexDirection:"column",gap:"5px",fontWeight:"500",fontSize:"14px"},input:{padding:"8px",borderRadius:"4px",border:"1px solid #ccc",fontSize:"14px"},select:{padding:"8px",borderRadius:"4px",border:"1px solid #ccc",fontSize:"14px"},button:{padding:"10px 15px",borderRadius:"4px",border:"none",cursor:"pointer",fontWeight:"bold"},submitButton:{backgroundColor:"#007bff",color:"white"},cancelButton:{backgroundColor:"#6c757d",color:"white"},addButton:{backgroundColor:"#28a745",color:"white",alignSelf:"flex-start"},removeButton:{backgroundColor:"#dc3545",color:"white",alignSelf:"flex-end",padding:"4px 8px",fontSize:"12px"},buttonGroup:{display:"flex",gap:"10px",justifyContent:"flex-end",marginTop:"10px"},dynamicSection:{display:"flex",flexDirection:"column",gap:"15px"},dynamicItem:{border:"1px solid #eee",padding:"10px",borderRadius:"4px",display:"flex",flexDirection:"column",gap:"10px",backgroundColor:"white"}},a4r=({counterparties:e,onSubmit:t,onCancel:n})=>{var p,h,m,g,y,x;const[r,o]=f.useState(i4r),i=v=>{const{name:b,value:w}=v.target;o(S=>({...S,[b]:w}))},s=v=>{const{name:b,value:w}=v.target;o(S=>({...S,party_address:{...S.party_address,[b]:w}}))},l=(v,b,w)=>{const{name:S,value:C}=w.target,N=[...r[v]];N[b]={...N[b],[S]:C},o(j=>({...j,[v]:N}))},c=v=>{const b=v==="account_details"?{account_number:"",account_number_type:"other"}:{routing_number:"",routing_number_type:"aba",payment_type:"ach"};o(w=>({...w,[v]:[...w[v],b]}))},u=(v,b)=>{o(w=>({...w,[v]:w[v].filter((S,C)=>C!==b)}))},d=v=>{v.preventDefault(),t(r)};return a.jsxs("form",{onSubmit:d,style:So.form,children:[a.jsx("h2",{children:"Create External Account"}),a.jsxs("fieldset",{style:So.fieldset,children:[a.jsx("legend",{style:So.legend,children:"Basic Information"}),a.jsxs("label",{style:So.label,children:["Counterparty",a.jsxs("select",{name:"counterparty_id",value:r.counterparty_id,onChange:i,required:!0,style:So.select,children:[a.jsx("option",{value:"",disabled:!0,children:"Select a counterparty"}),e.map(v=>a.jsx("option",{value:v.id,children:v.name},v.id))]})]}),a.jsxs("label",{style:So.label,children:["Account Nickname (Optional)",a.jsx("input",{type:"text",name:"name",value:r.name,onChange:i,style:So.input})]}),a.jsxs("label",{style:So.label,children:["Legal Party Name",a.jsx("input",{type:"text",name:"party_name",value:r.party_name,onChange:i,required:!0,style:So.input})]}),a.jsxs("label",{style:So.label,children:["Account Type",a.jsxs("select",{name:"account_type",value:r.account_type,onChange:i,style:So.select,children:[a.jsx("option",{value:"checking",children:"Checking"}),a.jsx("option",{value:"savings",children:"Savings"}),a.jsx("option",{value:"cash",children:"Cash"}),a.jsx("option",{value:"loan",children:"Loan"}),a.jsx("option",{value:"non_resident",children:"Non-resident"}),a.jsx("option",{value:"other",children:"Other"}),a.jsx("option",{value:"overdraft",children:"Overdraft"})]})]}),a.jsxs("label",{style:So.label,children:["Party Type",a.jsxs("select",{name:"party_type",value:r.party_type,onChange:i,style:So.select,children:[a.jsx("option",{value:"business",children:"Business"}),a.jsx("option",{value:"individual",children:"Individual"})]})]})]}),a.jsxs("fieldset",{style:So.fieldset,children:[a.jsx("legend",{style:So.legend,children:"Party Address (Optional)"}),a.jsxs("label",{style:So.label,children:["Line 1 ",a.jsx("input",{type:"text",name:"line1",value:(p=r.party_address)==null?void 0:p.line1,onChange:s,style:So.input})]}),a.jsxs("label",{style:So.label,children:["Line 2 ",a.jsx("input",{type:"text",name:"line2",value:(h=r.party_address)==null?void 0:h.line2,onChange:s,style:So.input})]}),a.jsxs("label",{style:So.label,children:["City / Locality ",a.jsx("input",{type:"text",name:"locality",value:(m=r.party_address)==null?void 0:m.locality,onChange:s,style:So.input})]}),a.jsxs("label",{style:So.label,children:["State / Region ",a.jsx("input",{type:"text",name:"region",value:(g=r.party_address)==null?void 0:g.region,onChange:s,style:So.input})]}),a.jsxs("label",{style:So.label,children:["Postal Code ",a.jsx("input",{type:"text",name:"postal_code",value:(y=r.party_address)==null?void 0:y.postal_code,onChange:s,style:So.input})]}),a.jsxs("label",{style:So.label,children:["Country ",a.jsx("input",{type:"text",name:"country",value:(x=r.party_address)==null?void 0:x.country,onChange:s,style:So.input})]})]}),a.jsxs("fieldset",{style:So.fieldset,children:[a.jsx("legend",{style:So.legend,children:"Account Details"}),a.jsx("div",{style:So.dynamicSection,children:r.account_details.map((v,b)=>a.jsxs("div",{style:So.dynamicItem,children:[r.account_details.length>1&&a.jsx("button",{type:"button",onClick:()=>u("account_details",b),style:So.removeButton,children:"Remove"}),a.jsxs("label",{style:So.label,children:["Account Number ",a.jsx("input",{type:"text",name:"account_number",value:v.account_number,onChange:w=>l("account_details",b,w),required:!0,style:So.input})]}),a.jsxs("label",{style:So.label,children:["Account Number Type",a.jsxs("select",{name:"account_number_type",value:v.account_number_type,onChange:w=>l("account_details",b,w),style:So.select,children:[a.jsx("option",{value:"other",children:"Other"}),a.jsx("option",{value:"iban",children:"IBAN"}),a.jsx("option",{value:"clabe",children:"CLABE"}),a.jsx("option",{value:"pan",children:"PAN"}),a.jsx("option",{value:"wallet_address",children:"Wallet Address"})]})]})]},b))}),a.jsx("button",{type:"button",onClick:()=>c("account_details"),style:{...So.button,...So.addButton,marginTop:"10px"},children:"Add Account Detail"})]}),a.jsxs("fieldset",{style:So.fieldset,children:[a.jsx("legend",{style:So.legend,children:"Routing Details"}),a.jsx("div",{style:So.dynamicSection,children:r.routing_details.map((v,b)=>a.jsxs("div",{style:So.dynamicItem,children:[r.routing_details.length>1&&a.jsx("button",{type:"button",onClick:()=>u("routing_details",b),style:So.removeButton,children:"Remove"}),a.jsxs("label",{style:So.label,children:["Routing Number ",a.jsx("input",{type:"text",name:"routing_number",value:v.routing_number,onChange:w=>l("routing_details",b,w),required:!0,style:So.input})]}),a.jsxs("label",{style:So.label,children:["Routing Number Type",a.jsxs("select",{name:"routing_number_type",value:v.routing_number_type,onChange:w=>l("routing_details",b,w),style:So.select,children:[a.jsx("option",{value:"aba",children:"ABA"}),a.jsx("option",{value:"swift",children:"SWIFT"}),a.jsx("option",{value:"au_bsb",children:"AU BSB"}),a.jsx("option",{value:"ca_cpa",children:"CA CPA"}),a.jsx("option",{value:"cnaps",children:"CNAPS"}),a.jsx("option",{value:"gb_sort_code",children:"GB Sort Code"}),a.jsx("option",{value:"in_ifsc",children:"IN IFSC"}),a.jsx("option",{value:"my_branch_code",children:"MY Branch Code"}),a.jsx("option",{value:"br_codigo",children:"BR Codigo"})]})]}),a.jsxs("label",{style:So.label,children:["Payment Type (Optional)",a.jsxs("select",{name:"payment_type",value:v.payment_type,onChange:w=>l("routing_details",b,w),style:So.select,children:[a.jsx("option",{value:"",children:"None"}),a.jsx("option",{value:"ach",children:"ACH"}),a.jsx("option",{value:"au_becs",children:"AU BECS"}),a.jsx("option",{value:"bacs",children:"BACS"}),a.jsx("option",{value:"book",children:"Book"}),a.jsx("option",{value:"card",children:"Card"}),a.jsx("option",{value:"check",children:"Check"}),a.jsx("option",{value:"cross_border",children:"Cross Border"}),a.jsx("option",{value:"eft",children:"EFT"}),a.jsx("option",{value:"interac",children:"Interac"}),a.jsx("option",{value:"masav",children:"Masav"}),a.jsx("option",{value:"neft",children:"NEFT"}),a.jsx("option",{value:"provxchange",children:"ProvXchange"}),a.jsx("option",{value:"rtp",children:"RTP"}),a.jsx("option",{value:"sen",children:"SEN"}),a.jsx("option",{value:"sepa",children:"SEPA"}),a.jsx("option",{value:"signet",children:"Signet"}),a.jsx("option",{value:"wire",children:"Wire"})]})]})]},b))}),a.jsx("button",{type:"button",onClick:()=>c("routing_details"),style:{...So.button,...So.addButton,marginTop:"10px"},children:"Add Routing Detail"})]}),a.jsxs("div",{style:So.buttonGroup,children:[a.jsx("button",{type:"button",onClick:n,style:{...So.button,...So.cancelButton},children:"Cancel"}),a.jsx("button",{type:"submit",style:{...So.button,...So.submitButton},children:"Create Account"})]})]})},Sl={table:{width:"100%",borderCollapse:"collapse",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',fontSize:"14px"},th:{textAlign:"left",padding:"12px 15px",borderBottom:"2px solid #e0e0e0",backgroundColor:"#f8f9fa",fontWeight:600,color:"#495057"},td:{textAlign:"left",padding:"12px 15px",borderBottom:"1px solid #e9ecef"},tr:{},emptyState:{textAlign:"center",padding:"20px",color:"#6c757d",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'},statusBadge:{padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:"bold",color:"white",textTransform:"capitalize",whiteSpace:"nowrap"},verified:{backgroundColor:"#28a745"},pending:{backgroundColor:"#ffc107",color:"#212529"},unverified:{backgroundColor:"#6c757d"},actionsCell:{display:"flex",gap:"10px"},actionButton:{padding:"6px 12px",fontSize:"12px",border:"1px solid #ced4da",borderRadius:"4px",backgroundColor:"white",cursor:"pointer"}},s4r=({accounts:e,isLoading:t,onVerify:n,onEdit:r,onDelete:o})=>{const i=s=>{let l;const c=s.replace("_"," ");switch(s){case"verified":l={...Sl.statusBadge,...Sl.verified};break;case"pending_verification":l={...Sl.statusBadge,...Sl.pending};break;case"unverified":default:l={...Sl.statusBadge,...Sl.unverified};break}return a.jsx("span",{style:l,children:c})};return t?a.jsx("div",{style:Sl.emptyState,children:"Loading accounts..."}):!e||e.length===0?a.jsx("div",{style:Sl.emptyState,children:"No external accounts to display."}):a.jsx("div",{style:{overflowX:"auto"},children:a.jsxs("table",{style:Sl.table,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{style:Sl.th,children:"Party Name"}),a.jsx("th",{style:Sl.th,children:"Account Nickname"}),a.jsx("th",{style:Sl.th,children:"Account Number"}),a.jsx("th",{style:Sl.th,children:"Routing Number"}),a.jsx("th",{style:Sl.th,children:"Status"}),a.jsx("th",{style:Sl.th,children:"Actions"})]})}),a.jsx("tbody",{children:e.map(s=>{var l,c,u;return a.jsxs("tr",{style:Sl.tr,children:[a.jsx("td",{style:Sl.td,children:s.party_name}),a.jsx("td",{style:Sl.td,children:s.name||"—"}),a.jsx("td",{style:Sl.td,children:(l=s.account_details)!=null&&l[0]?`•••• ${s.account_details[0].account_number_safe}`:"N/A"}),a.jsx("td",{style:Sl.td,children:((u=(c=s.routing_details)==null?void 0:c[0])==null?void 0:u.routing_number)||"N/A"}),a.jsx("td",{style:Sl.td,children:i(s.verification_status)}),a.jsx("td",{style:Sl.td,children:a.jsxs("div",{style:Sl.actionsCell,children:[n&&s.verification_status!=="verified"&&a.jsx("button",{style:Sl.actionButton,onClick:()=>n(s.id),children:"Verify"}),r&&a.jsx("button",{style:Sl.actionButton,onClick:()=>r(s.id),children:"Edit"}),o&&a.jsx("button",{style:Sl.actionButton,onClick:()=>o(s.id),children:"Delete"})]})})]},s.id)})})]})})},l4r=(e,t)=>new Intl.NumberFormat("en-US",{style:"currency",currency:t.toUpperCase()}).format(e),c4r={active:"bg-green-100 text-green-800",suspended:"bg-yellow-100 text-yellow-800",frozen:"bg-red-100 text-red-800"},xre=({title:e,features:t})=>!t||t.length===0?null:a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-semibold text-gray-600 mb-2",children:e}),a.jsx("div",{className:"flex flex-wrap gap-2",children:t.map(n=>a.jsx("span",{className:"px-2 py-1 text-xs font-medium bg-gray-100 text-gray-700 rounded-md capitalize",children:n.replace(/_/g," ")},n))})]}),yre=({title:e,balance:t})=>!t||Object.keys(t).length===0?a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-gray-500",children:e}),a.jsx("p",{className:"text-lg font-semibold text-gray-400",children:"N/A"})]}):a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-gray-500",children:e}),Object.entries(t).map(([n,r])=>a.jsx("p",{className:"text-lg font-semibold text-gray-800",children:l4r(r,n)},n))]}),u4r=({address:e})=>{var t;if(e.type==="aba"&&e.aba){const n=e.aba;return a.jsxs("div",{className:"p-3 bg-gray-50 rounded-lg border border-gray-200",children:[a.jsx("h5",{className:"font-semibold text-gray-700",children:"ABA Address"}),a.jsxs("div",{className:"mt-1 text-sm text-gray-600 space-y-0.5",children:[a.jsxs("p",{children:[a.jsx("span",{className:"font-medium",children:"Holder:"})," ",n.account_holder_name]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-medium",children:"Bank:"})," ",n.bank_name]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-medium",children:"Routing:"})," ",n.routing_number]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-medium",children:"Account (Last 4):"})," ",n.account_number_last4]})]}),a.jsxs("div",{className:"mt-2 flex flex-wrap gap-1 items-center",children:[a.jsx("span",{className:"text-xs font-medium text-gray-500 mr-2",children:"Supported Networks:"}),(t=n.supported_networks)==null?void 0:t.map(r=>a.jsx("span",{className:"px-2 py-0.5 text-xs font-semibold bg-blue-100 text-blue-800 rounded-full",children:r},r))]})]})}else if(e.type==="iban"&&e.iban)return a.jsxs("div",{className:"p-3 bg-gray-50 rounded-lg border border-gray-200",children:[a.jsx("h5",{className:"font-semibold text-gray-700",children:"IBAN Address"}),a.jsxs("div",{className:"mt-1 text-sm text-gray-600 space-y-0.5",children:[a.jsxs("p",{children:[a.jsx("span",{className:"font-medium",children:"Holder:"})," ",e.iban.account_holder_name]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-medium",children:"IBAN:"})," ",e.iban.iban]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-medium",children:"Bank:"})," ",e.iban.bank_name]})]})]});return a.jsxs("div",{className:"p-3 bg-gray-50 rounded-lg border border-gray-200",children:[a.jsxs("h5",{className:"font-semibold text-gray-700",children:["Address (",e.type||"Unknown",")"]}),a.jsx("p",{className:"text-sm text-gray-500",children:"Details not fully parsed or unsupported type."})]})},d4r=({financialAccount:e})=>{var t;return a.jsxs("div",{className:"bg-white shadow-sm rounded-lg border border-gray-200",children:[a.jsxs("div",{className:"px-4 py-5 sm:px-6 border-b border-gray-200",children:[a.jsxs("div",{className:"flex justify-between items-start gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{className:"text-lg leading-6 font-medium text-gray-900",children:"Financial Account"}),a.jsx("p",{className:"mt-1 max-w-2xl text-sm text-gray-500 font-mono break-all",children:e.id})]}),a.jsx("span",{className:`flex-shrink-0 px-3 py-1 text-sm font-semibold rounded-full capitalize ${c4r[e.status]||"bg-gray-100 text-gray-800"}`,children:e.status})]}),a.jsxs("p",{className:"mt-2 text-sm text-gray-500",children:["Country: ",a.jsx("span",{className:"font-medium text-gray-700",children:e.country})," | Supported Currencies: ",a.jsx("span",{className:"font-medium text-gray-700",children:e.supported_currencies.join(", ").toUpperCase()})]})]}),a.jsxs("div",{className:"px-4 py-5 sm:px-6 space-y-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-base font-semibold text-gray-800 mb-2",children:"Balances"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 p-4 bg-slate-50 rounded-md border border-slate-200",children:[a.jsx(yre,{title:"Cash",balance:e.balance.cash}),a.jsx(yre,{title:"Inbound Pending",balance:e.balance.inbound_pending}),a.jsx(yre,{title:"Outbound Pending",balance:e.balance.outbound_pending})]})]}),e.financial_addresses&&e.financial_addresses.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-base font-semibold text-gray-800 mb-2",children:"Financial Addresses"}),a.jsx("div",{className:"space-y-3",children:e.financial_addresses.map((n,r)=>a.jsx(u4r,{address:n},r))})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-base font-semibold text-gray-800 mb-2",children:"Features"}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(xre,{title:"Active",features:e.active_features}),a.jsx(xre,{title:"Pending",features:e.pending_features}),a.jsx(xre,{title:"Restricted",features:e.restricted_features})]})]}),((t=e.status_details)==null?void 0:t.closed)&&e.status_details.closed.reasons&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-base font-semibold text-gray-800 mb-2",children:"Status Details"}),a.jsxs("div",{className:"p-3 bg-red-50 border border-red-200 rounded-lg",children:[a.jsx("h4",{className:"font-semibold text-red-700",children:"Account Closed"}),a.jsxs("p",{className:"text-sm text-red-600 mt-1 capitalize",children:["Reasons: ",e.status_details.closed.reasons.join(", ").replace(/_/g," ")]})]})]})]})]})},f4r=async e=>[],p4r=()=>{const[e,t]=f.useState([]),[n,r]=f.useState(!0);f.useEffect(()=>{(async()=>{try{const s=await f4r({});t(s||[])}catch(s){console.error("Failed to fetch incoming payment details:",s),t([])}finally{r(!1)}})()},[]);const o=[{field:"id",headerName:"ID",width:200},{field:"amount",headerName:"Amount",width:150},{field:"currency",headerName:"Currency",width:100},{field:"status",headerName:"Status",width:120}];return a.jsx("div",{style:{height:400,width:"100%"},children:a.jsx(ovt,{rows:e,columns:o,getRowId:i=>i.id,loading:n})})};function na(e){return typeof e!="object"||e===null||typeof e.lastModified=="number"&&typeof File<"u"&&e instanceof File||typeof e.getMonth=="function"&&typeof Date<"u"&&e instanceof Date?!1:!Array.isArray(e)}function h4r(e){return e.additionalItems===!0&&console.warn("additionalItems=true is currently not supported"),na(e.additionalItems)}function z9e(e){if(e==="")return;if(e===null)return null;if(/\.$/.test(e)||/\.0$/.test(e)||/\.\d*0$/.test(e))return e;const t=Number(e);return typeof t=="number"&&!Number.isNaN(t)?t:e}const fC="__additional_property",VW="additionalProperties",HC="allOf",Sa="anyOf",B0="const",aX="default",wwe="dependencies",m4r="enum",Ff="__errors",tl="$id",Swe="if",UT="items",g4r="_$junk_option_schema_id$_",QB="$name",$i="oneOf",Gpe="patternProperties",Ga="properties",vre="readonly",ibt="required",UW="submitButtonOptions",Tl="$ref",KR="$schema",abt="root",sbt="_",x4r=["discriminator","propertyName"],B9e="formContext",y4r="layoutGridLookupMap",Cwe="__rjsf_additionalProperties",lbt="__rjsf_rootSchema",v4r="ui:field",Nwe="ui:widget",pC="ui:options",qpe="ui:globalOptions",b4r="https://json-schema.org/draft/2019-09/schema",JB="https://json-schema.org/draft/2020-12/schema";function qo(e={},t={}){return e?Object.keys(e).filter(n=>n.indexOf("ui:")===0).reduce((n,r)=>{const o=e[r];return r===Nwe&&na(o)?(console.error("Setting options via ui:widget object is no longer supported, use ui:options instead"),n):r===pC&&na(o)?{...n,...o}:{...n,[r.substring(3)]:o}},{...t}):{...t}}function w4r(e,t={},n){if(!(e.additionalProperties||e.patternProperties))return!1;const{expandable:r=!0}=qo(t);return r===!1?r:e.maxProperties!==void 0&&n?Object.keys(n).length({...n,[o]:Kpe(r)}),t);if(VC(e)){const n=e;return Object.keys(n).reduce((r,o)=>({...r,[o]:Kpe(n[o])}),t)}return t}function $4r(){this.__data__=[],this.size=0}function H6(e,t){return e===t||e!==e&&t!==t}function lX(e,t){for(var n=e.length;n--;)if(H6(e[n][0],t))return n;return-1}var D4r=Array.prototype,L4r=D4r.splice;function F4r(e){var t=this.__data__,n=lX(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():L4r.call(t,n,1),--this.size,!0}function z4r(e){var t=this.__data__,n=lX(t,e);return n<0?void 0:t[n][1]}function B4r(e){return lX(this.__data__,e)>-1}function H4r(e,t){var n=this.__data__,r=lX(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function iS(e){var t=-1,n=e==null?0:e.length;for(this.clear();++tl))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var p=-1,h=!0,m=n&MMr?new FI:void 0;for(i.set(e,t),i.set(t,e);++p-1&&e%1==0&&e-1&&e%1==0&&e<=aRr}var sRr="[object Arguments]",lRr="[object Array]",cRr="[object Boolean]",uRr="[object Date]",dRr="[object Error]",fRr="[object Function]",pRr="[object Map]",hRr="[object Number]",mRr="[object Object]",gRr="[object RegExp]",xRr="[object Set]",yRr="[object String]",vRr="[object WeakMap]",bRr="[object ArrayBuffer]",wRr="[object DataView]",SRr="[object Float32Array]",CRr="[object Float64Array]",NRr="[object Int8Array]",jRr="[object Int16Array]",ERr="[object Int32Array]",IRr="[object Uint8Array]",_Rr="[object Uint8ClampedArray]",PRr="[object Uint16Array]",ARr="[object Uint32Array]",Gl={};Gl[SRr]=Gl[CRr]=Gl[NRr]=Gl[jRr]=Gl[ERr]=Gl[IRr]=Gl[_Rr]=Gl[PRr]=Gl[ARr]=!0;Gl[sRr]=Gl[lRr]=Gl[bRr]=Gl[cRr]=Gl[wRr]=Gl[uRr]=Gl[dRr]=Gl[fRr]=Gl[pRr]=Gl[hRr]=Gl[mRr]=Gl[gRr]=Gl[xRr]=Gl[yRr]=Gl[vRr]=!1;function TRr(e){return V0(e)&&_we(e.length)&&!!Gl[oS(e)]}function Pwe(e){return function(t){return e(t)}}var vbt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,t3=vbt&&typeof module=="object"&&module&&!module.nodeType&&module,kRr=t3&&t3.exports===vbt,Sre=kRr&&cbt.process,GT=(function(){try{var e=t3&&t3.require&&t3.require("util").types;return e||Sre&&Sre.binding&&Sre.binding("util")}catch{}})(),Y9e=GT&>.isTypedArray,U6=Y9e?Pwe(Y9e):TRr,MRr=Object.prototype,RRr=MRr.hasOwnProperty;function bbt(e,t){var n=Od(e),r=!n&&WT(e),o=!n&&!r&&zI(e),i=!n&&!r&&!o&&U6(e),s=n||r||o||i,l=s?gbt(e.length,String):[],c=l.length;for(var u in e)(t||RRr.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||uX(u,c)))&&l.push(u);return l}var ORr=Object.prototype;function dX(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||ORr;return e===n}var $Rr=dbt(Object.keys,Object),DRr=Object.prototype,LRr=DRr.hasOwnProperty;function wbt(e){if(!dX(e))return $Rr(e);var t=[];for(var n in Object(e))LRr.call(e,n)&&n!="constructor"&&t.push(n);return t}function C5(e){return e!=null&&_we(e.length)&&!V6(e)}function Wx(e){return C5(e)?bbt(e):wbt(e)}function Ype(e){return hbt(e,Wx,Iwe)}var FRr=1,zRr=Object.prototype,BRr=zRr.hasOwnProperty;function HRr(e,t,n,r,o,i){var s=n&FRr,l=Ype(e),c=l.length,u=Ype(t),d=u.length;if(c!=d&&!s)return!1;for(var p=c;p--;){var h=l[p];if(!(s?h in t:BRr.call(t,h)))return!1}var m=i.get(e),g=i.get(t);if(m&&g)return m==t&&g==e;var y=!0;i.set(e,t),i.set(t,e);for(var x=s;++p{if(typeof n=="function"&&typeof r=="function")return!0})}var ZRr="[object Symbol]";function G6(e){return typeof e=="symbol"||V0(e)&&oS(e)==ZRr}var eOr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tOr=/^\w*$/;function Awe(e,t){if(Od(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||G6(e)?!0:tOr.test(e)||!eOr.test(e)||t!=null&&e in Object(t)}var nOr="Expected a function";function Twe(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(nOr);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Twe.Cache||aS),n}Twe.Cache=aS;var rOr=500;function oOr(e){var t=Twe(e,function(r){return n.size===rOr&&n.clear(),r}),n=t.cache;return t}var iOr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,aOr=/\\(\\)?/g,Sbt=oOr(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(iOr,function(n,r,o,i){t.push(o?i.replace(aOr,"$1"):r||n)}),t});function x4(e,t){for(var n=-1,r=e==null?0:e.length,o=Array(r);++nCOr)return[];var n=Cre,r=NOr(e,Cre);t=jbt(t),e-=Cre;for(var o=gbt(r,t);++n0){if(++t>=YOr)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var zbt=JOr(KOr);function hX(e,t){return zbt(Fbt(e,t,pX),e+"")}function ZOr(e,t,n){if(!Aa(n))return!1;var r=typeof t;return(r=="number"?C5(n)&&uX(t,n.length):r=="string"&&t in n)?H6(n[t],e):!1}function e3r(e){return hX(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&ZOr(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++r0&&n(l)?t>1?K6(l,t-1,n,r,o):Ewe(o,l):r||(o[o.length]=l)}return o}var r3r=1/0;function o3r(e){var t=e==null?0:e.length;return t?K6(e,r3r):[]}function i3r(e,t,n,r){for(var o=e.length,i=n+-1;++i-1}function ZB(){}var l3r=1/0,c3r=IA&&1/jwe(new IA([,-0]))[1]==l3r?function(e){return new IA(e)}:ZB,u3r=200;function Hbt(e,t,n){var r=-1,o=zwe,i=e.length,s=!0,l=[],c=l;if(i>=u3r){var u=c3r(e);if(u)return jwe(u);s=!1,o=ND,c=new FI}else c=l;e:for(;++rt?1:0}function Nre(e,t){const n=e.length;if(n===0)return t;let r=t.length;if(r===0)return e;if(nt.length){const o=e;e=t,t=o}const r=new Set(t);for(let o=0;o0;o++){const i=e[o];r.delete(i)&&n.push(i)}return n}function hze(e){return e.length===0}function jre(e){return(t,n)=>{const r=t.length-n.length;if(r!==0)return r;for(let o=0;o{const r=n.length;if(r===0)return n;if(r<=t){const s=[];let l=0;e:for(let c=0;c{const r=[];let o=t.length,i=n.length;if(o===0||i===0)return r;if(o>i){const d=t;t=n,n=d;const p=o;o=i,i=p}const s=[...t].sort(e),l=[...n].sort(e);let c=0,u=0;for(;c{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}const mze=S3r,Wbt=()=>0,C3r=e=>e===void 0,N3r=e=>typeof e!="object",gze={boolean:0,number:1,string:2};function j3r(e,t){const n=typeof e,r=typeof t;return n===r?QP(e,t):gze[n]-gze[r]}function E3r(e,t){const n=e.length;if(n===0)return t;const r=t.length;if(r===0)return e;if(r>n){const s=e;e=t,t=s}const o=new Set(e),i=t.length;for(let s=0;se(r)?e(o)?n(r,o):-1:e(o)?1:t(r,o)}function cP(e){return mX(C3r,e)}function JS(e,t){return mX(n=>n===void 0||e(n),t)}function Ere(e,t){return mX(Array.isArray,e,t)}const Qu=cP(QP),Ire=JS(e=>e===0,(e,t)=>e-t);function I3r({deduplicationCache:e=new WeakMap,sortedKeysCache:t=new WeakMap}={}){const n=mze(t,y=>Object.keys(y).sort());function r(y){return(x,v)=>{const b=n(x),w=n(v),S=Math.min(b.length,w.length);for(let C=0;Cx(v(b),v(w))}const i=o(QP);function s(y,x){if(eH(y)){if(eH(x)){const v=Object.keys(y),b=Object.keys(x),w=E3r(v,b),S=w.length;for(let C=0;Cy===!1,Wbt),minLength:Ire,minItems:Ire,minProperties:Ire,required:JS(hze,i),enum:JS(hze,o(u)),type:cP((y,x)=>{const v=Array.isArray(y),b=Array.isArray(x);return!v&&!b?QP(y,x):i(v?y:[y],b?x:[x])}),items:JS(y=>!Array.isArray(y)&&pv(y),Ere(s,jre(s))),anyOf:h,allOf:h,oneOf:h,properties:p,patternProperties:p,additionalProperties:m,additionalItems:m,dependencies:JS(YR,r(cP(Ere(s,i))))};return{compareSchemaValues:u,compareSchemaDefinitions:s}}function xze(e){return e}const Gbt=(e,t)=>e?Gbt(t%e,e):t,_3r=(e,t)=>Math.abs(e*t)/Gbt(e,t);function P3r(e,t){return e===t?e:`^(?=.*(?:${e}))(?=.*(?:${t})).*$`}function*_re(e,t,n){const r=e.length,o=t.length;if(r>0&&o>0)for(let i=0;i{const r={...t},o=Object.keys(n),i=o.length;for(let s=0;s{if(!o(s))throw new Error(`Schema keys '${n}' and '${r}' are conflicting (${n}: ${JSON.stringify(s[n])}, ${r}: ${JSON.stringify(s[r])})`)};for(const s of[[n,r],[r,n]]){let l=t.get(s[0]);l===void 0&&(l=[],t.set(s[0],l)),l.push({oppositeKey:s[1],check:i})}}return t}const O3r=[oj("minimum","maximum",e=>e.maximum>=e.minimum),oj("exclusiveMinimum","maximum",e=>e.maximum>e.exclusiveMinimum),oj("minimum","exclusiveMaximum",e=>e.exclusiveMaximum>e.minimum),oj("exclusiveMinimum","exclusiveMaximum",e=>e.exclusiveMaximum>e.exclusiveMinimum),oj("minLength","maxLength",e=>e.maxLength>=e.minLength),oj("minItems","maxItems",e=>e.maxItems>=e.minItems),oj("minProperties","maxProperties",e=>e.maxProperties>=e.minProperties)];function $3r({mergePatterns:e=P3r,isSubRegExp:t=Object.is,intersectJson:n=b3r,deduplicateJsonSchemaDef:r=xze,defaultMerger:o=xze,assigners:i=[],checks:s=O3r,mergers:l}={}){function c(S){const C=S.length;let N=S[0];for(let j=1;j0&&I!==!1)if(_)Object.assign(S,C);else for(let P=0;P{const P=pv(j),E=pv(T);if(P&&E)return rj(S,"properties",b(C,I)),rj(S,"patternProperties",N&&_?b(N,_):N??_),delete S.additionalProperties,S;const M=v(j,T);rj(S,"additionalProperties",M);const R={},$=Object.keys(C),D=$.length,[z,V]=N?vze(N):bze,[B,G]=_?vze(_):bze,H=[],F=new Set,W=E?void 0:T;for(let re=0;re0&&G.length>0){const re=_re(V,G,(ce,ae)=>{t(ce,ae)&&te.add(ce),t(ae,ce)&&te.add(ae),J[e(ce,ae)]=v(N[ce],_[ae])});for(;!re.next().done;);}return J=d(J,N,V,te,T,E),J=d(J,_,G,te,j,P),rj(S,"patternProperties",J),S},h=(S,{items:C=[],additionalItems:N},{items:j=[],additionalItems:I})=>{const _=Array.isArray(C),T=Array.isArray(j),P=[];if(S.items=P,_&&T){const[E,M,R]=C.length{Sze(S,C);const j=Sze({},N);return S.allOf===void 0?S.allOf=[j]:S.allOf=S.allOf.concat(j),S};function g(S,C){return r(Array.from(_re(S,C,v)))}const y=A3r([[T3r,p],[k3r,h],[M3r,m],...i]),x=R3r(s);function v(S,C){if(S===!1||C===!1)return!1;if(pv(S))return pv(C)?!0:C;if(pv(C))return S;let N={...S};const j=new Set,I=new Set,_=Object.keys(C),T=_.length;for(let P=0;P{if(S===C)return S;const N=Array.isArray(S),j=Array.isArray(C);if(!N&&!j){const I=Are(S,C);if(I!==void 0)return I}else if(N||j){const I=new Set;if(N&&j)for(const T of _re(S,C,Are))T!==void 0&&I.add(T);else{const T=N?S:C,P=N?C:S,E=T.length;for(let M=0;M1)return Array.from(I)}throw new Error(`It is not possible to create an intersection of the following incompatible types: ${S.toString()}, ${C.toString()}`)},default:o,description:o,title:o,const:o,format:o,contentEncoding:o,contentMediaType:o,not:(S,C)=>{const N=r([S,C]);return N.length===1?N[0]:{anyOf:N}},pattern:e,readOnly:Pre,writeOnly:Pre,enum:(S,C)=>{const N=n(S,C);if(N.length===0)throw new Error(`Intersection of the following enums is empty: "${JSON.stringify(S)}", "${JSON.stringify(C)}"`);return N},anyOf:g,oneOf:g,allOf:(S,C)=>r(S.concat(C)),propertyNames:v,contains:v,dependencies:yze((S,C)=>Array.isArray(S)?Array.isArray(C)?Nre(S,C):v(C,{required:S}):Array.isArray(C)?v(S,{required:C}):v(S,C)),examples:(S,C)=>{if(!Array.isArray(S)||!Array.isArray(C))throw new Error(`Value of the 'examples' field should be an array, but got "${JSON.stringify(S)}" and "${JSON.stringify(C)}"`);return Nre(S,C)},multipleOf:(S,C)=>{let N=1;for(;!Number.isInteger(S)||!Number.isInteger(C);)N*=10,S*=10,C*=10;return _3r(S,C)/N},exclusiveMaximum:Math.min,maximum:Math.min,maxItems:Math.min,maxLength:Math.min,maxProperties:Math.min,exclusiveMinimum:Math.max,minimum:Math.max,minItems:Math.max,minLength:Math.max,minProperties:Math.max,uniqueItems:Pre,required:Nre,...l};return{mergeSchemaDefinitions:v,mergeArrayOfSchemaDefinitions:c}}function D3r(e){const t=[],n=[e];for(;n.length>0;){const r=n.pop();if(typeof r=="boolean"||r.allOf===void 0){t.push(r);continue}const{allOf:o,...i}=r;t.push(i);for(let s=o.length-1;s>=0;s--)n.push(o[s])}return t}function L3r(e){return t=>e(D3r(t))}var qM={},Cze;function F3r(){if(Cze)return qM;Cze=1;var e=/~/,t=/~[01]/g;function n(u){switch(u){case"~1":return"/";case"~0":return"~"}throw new Error("Invalid tilde escape: "+u)}function r(u){return e.test(u)?u.replace(t,n):u}function o(u,d,p){for(var h,m,g=1,y=d.length;gg,typeof u[h]>"u"&&(Array.isArray(u)&&h==="-"&&(h=u.length),m&&(d[g]!==""&&d[g]<1/0||d[g]==="-"?u[h]=[]:u[h]={})),!m)break;u=u[h]}var x=u[h];return p===void 0?delete u[h]:u[h]=p,x}function i(u){if(typeof u=="string"){if(u=u.split("/"),u[0]==="")return u;throw new Error("Invalid JSON pointer.")}else if(Array.isArray(u)){for(const d of u)if(typeof d!="string"&&typeof d!="number")throw new Error("Invalid JSON pointer. Must be of type string or number.");return u}throw new Error("Invalid JSON pointer.")}function s(u,d){if(typeof u!="object")throw new Error("Invalid input object.");d=i(d);var p=d.length;if(p===1)return u;for(var h=1;ho?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r1),i}),v4(e,Bwe(e),n),r&&(n=n3(n,nDr|rDr|oDr,tDr));for(var o=t.length;o--;)Jbt(n,t[o]);return n}),KM={exports:{}},kre,_ze;function e1t(){if(_ze)return kre;_ze=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),t=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(h){let m="",g=0,y=0;for(y=0;y=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102))return"";m+=h[y];break}for(y+=1;y=48&&g<=57||g>=65&&g<=70||g>=97&&g<=102))return"";m+=h[y]}return m}const r=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(h){return h.length=0,!0}function i(h,m,g){if(h.length){const y=n(h);if(y!=="")m.push(y);else return g.error=!0,!1;h.length=0}return!0}function s(h){let m=0;const g={error:!1,address:"",zone:""},y=[],x=[];let v=!1,b=!1,w=i;for(let S=0;S7){g.error=!0;break}S>0&&h[S-1]===":"&&(v=!0),y.push(":");continue}else if(C==="%"){if(!w(x,y,g))break;w=o}else{x.push(C);continue}}return x.length&&(w===o?g.zone=x.join(""):b?y.push(x.join("")):y.push(n(x))),g.address=y.join(""),g}function l(h){if(c(h,":")<2)return{host:h,isIPV6:!1};const m=s(h);if(m.error)return{host:h,isIPV6:!1};{let g=m.address,y=m.address;return m.zone&&(g+="%"+m.zone,y+="%25"+m.zone),{host:g,isIPV6:!0,escapedHost:y}}}function c(h,m){let g=0;for(let y=0;yAa(i)?nhe(i,n):i)}:Aa(o)&&(e={...e,[r]:nhe(o,n)});return e}function Vwe(e,t){const n=t[e];return[ID(t,[e]),n]}function n1t(e,t={},n=[],r=cr(t,[tl])){const o=e||"";let i;if(o.startsWith("#")){const l=decodeURIComponent(o.substring(1));r===void 0||tl in t&&t[tl]===r?i=Tre.get(t,l):t[KR]===JB&&(i=qW(t,r.replace(/\/$/,"")),i!==void 0&&(i=Tre.get(i,l)))}else if(t[KR]===JB){const l=r?Hwe.resolve(r,o):o,[c,...u]=l.replace(/#\/?$/,"").split("#");i=qW(t,c.replace(/\/$/,"")),i!==void 0&&(r=i[tl],Lu(u)||(i=Tre.get(i,decodeURIComponent(u.join("#")))))}if(i===void 0)throw new Error(`Could not find a definition for ${e}.`);const s=i[Tl];if(s){if(n.includes(s)){if(n.length===1)throw new Error(`Definition for ${e} is a circular reference`);const[d,...p]=n,h=[...p,o,d].join(" -> ");throw new Error(`Definition for ${d} contains a circular reference through ${h}`)}const[l,c]=Vwe(Tl,i),u=n1t(c,t,[...n,o],r);return Object.keys(l).length>0?t[KR]===b4r||t[KR]===JB?{[HC]:[l,u]}:{...l,...u}:u}return i}function r1t(e,t={},n=cr(t,[tl])){return n1t(e,t,[],n)}var sDr="[object String]";function UC(e){return typeof e=="string"||!Od(e)&&V0(e)&&oS(e)==sDr}function wb(e){let t;const n=cr(e,x4r);return UC(n)?t=n:n!==void 0&&console.warn(`Expecting discriminator to be a string, got "${typeof n}" instead`),t}function _D(e){return Array.isArray(e)?"array":typeof e=="string"?"string":e==null?"null":typeof e=="boolean"?"boolean":isNaN(e)?typeof e=="object"?"object":"string":"number"}var lDr=hX(function(e){return Hbt(K6(e,1,ED,!0))});function wy(e){let{type:t}=e;return!t&&e.const?_D(e.const):!t&&e.enum?"string":!t&&(e.properties||e.additionalProperties||e.patternProperties)?"object":(Array.isArray(t)&&(t.length===2&&t.includes("null")?t=t.find(n=>n!=="null"):t=t[0]),t)}function Aw(e,t){const n=Object.assign({},e);return Object.keys(t).reduce((r,o)=>{const i=e?e[o]:{},s=t[o];return e&&o in e&&na(s)?r[o]=Aw(i,s):e&&t&&(wy(e)==="object"||wy(t)==="object")&&o===ibt&&Array.isArray(i)&&Array.isArray(s)?r[o]=lDr(i,s):r[o]=s,r},n)}var cDr="[object Number]";function o1t(e){return typeof e=="number"||V0(e)&&oS(e)==cDr}function i1t(e,t,n){var r;if(e&&n){const o=cr(e,n);if(o===void 0)return;for(let i=0;i({required:[d]}))};let u;if(l.anyOf){const{...d}=l;d.allOf?d.allOf=d.allOf.slice():d.allOf=[],d.allOf.push(c),u=d}else u=Object.assign({},l,c);if(delete u.required,e.isValid(u,t,r))return s}else if(e.isValid(l,t,r))return s}return 0}function Hf(e,t,n={},r,o,i=!1){return Hv(e,t,n,r,void 0,void 0,o,i)[0]}function uDr(e,t,n,r,o,i,s){const{if:l,then:c,else:u,...d}=t,p=e.isValid(l,i||{},n);let h=[d],m=[];if(r)c&&typeof c!="boolean"&&(m=m.concat(Hv(e,c,n,i,r,o,s))),u&&typeof u!="boolean"&&(m=m.concat(Hv(e,u,n,i,r,o,s)));else{const g=p?c:u;g&&typeof g!="boolean"&&(m=m.concat(Hv(e,g,n,i,r,o,s)))}return m.length&&(h=m.map(g=>Aw(d,g))),h.flatMap(g=>Hv(e,g,n,i,r,o,s))}function a1t(e){return e.reduce((n,r)=>r.length>1?r.flatMap(o=>Ibt(n.length,i=>[...n[i]].concat(o))):(n.forEach(o=>o.push(r[0])),n),[[]])}function s1t(e,t){return Object.keys(e.patternProperties).filter(n=>RegExp(n).test(t)).reduce((n,r)=>(zs(n,[r],e.patternProperties[r]),n),{})}function dDr(e,t,n,r,o,i,s,l){const c=l1t(e,t,n,r,o,i,s,l);if(c.length>1||c[0]!==t)return c;if(wwe in t)return c1t(e,t,n,r,o,i,s).flatMap(d=>Hv(e,d,n,i,r,o,s));if(HC in t&&Array.isArray(t[HC])){const u=t.allOf.map(p=>Hv(e,p,n,i,r,o,s));return a1t(u).map(p=>({...t,allOf:p}))}return[t]}function l1t(e,t,n,r,o,i,s,l){const c=_A(t,n,o,void 0,l);return c!==t?Hv(e,c,n,i,r,o,s,l):[t]}function _A(e,t,n,r,o){if(!na(e))return e;let i=e;if(Tl in i){const{$ref:s,...l}=i;if(n.includes(s))return i;n.push(s),i={...r1t(s,t,r),...l},tl in i&&(r=i[tl])}if(Ga in i){const s=[],l=LOr(i[Ga],(c,u,d)=>{const p=[...n];c[d]=_A(u,t,p,r,o),s.push(p)},{});t3r(n,Vbt(o3r(s))),i={...i,[Ga]:l}}if(UT in i&&!Array.isArray(i.items)&&typeof i.items!="boolean"&&(i={...i,items:_A(i.items,t,n,r,o)}),o){let s,l;Sa in e&&Array.isArray(e[Sa])?(s=Sa,l=i[Sa]):$i in e&&Array.isArray(e[$i])&&(s=$i,l=i[$i]),s&&l&&(i={...i,[s]:l.map(c=>_A(c,t,n,r,o))})}return _l(e,i)?e:i}function fDr(e,t,n,r,o){const i={...t,properties:{...t.properties}},s=r&&na(r)?r:{};return Object.keys(s).forEach(l=>{if(!(l in i.properties)){if(Gpe in i){const c=s1t(i,l);if(!Lu(c)){i.properties[l]=Hf(e,{[HC]:Object.values(c)},n,cr(s,[l]),o),zs(i.properties,[l,fC],!0);return}}if(VW in i&&i.additionalProperties!==!1){let c;typeof i.additionalProperties!="boolean"?Tl in i.additionalProperties?c=Hf(e,{[Tl]:cr(i.additionalProperties,[Tl])},n,s,o):"type"in i.additionalProperties?c={...i.additionalProperties}:Sa in i.additionalProperties||$i in i.additionalProperties?c={type:"object",...i.additionalProperties}:c={type:_D(cr(s,[l]))}:c={type:_D(cr(s,[l]))},i.properties[l]=c,zs(i.properties,[l,fC],!0)}else i.properties[l]={type:"null"},zs(i.properties,[l,fC],!0)}}),i}const{compareSchemaDefinitions:pDr,compareSchemaValues:hDr}=I3r(),{mergeArrayOfSchemaDefinitions:mDr}=$3r({intersectJson:w3r(hDr),deduplicateJsonSchemaDef:Ubt(pDr)}),gDr=L3r(mDr);function xDr(e){return gDr(e)}function Hv(e,t,n,r,o=!1,i=[],s,l){return na(t)?dDr(e,t,n,o,i,r,s,l).flatMap(u=>{var d;let p=u;if(Swe in p)return uDr(e,p,n,o,i,r,s);if(HC in p){if(o){const{allOf:m,...g}=p;return[...m,g]}try{const m=[],g=[];(d=p.allOf)===null||d===void 0||d.forEach(y=>{typeof y=="object"&&y.contains?m.push(y):g.push(y)}),m.length&&(p={...p,allOf:g}),p=s?s(p):xDr(p),m.length&&(p.allOf=m)}catch(m){console.warn(`could not merge subschemas in allOf: `,m);const{allOf:g,...y}=p;return y}}return Ga in p&&Gpe in p&&(p=Object.keys(p.properties).reduce((m,g)=>{const y=s1t(m,g);return Lu(y)||(m.properties[g]=Hf(e,{allOf:[m.properties[g],...Object.values(y)]},n,cr(r,[g]),s)),m},{...p,properties:{...p.properties}})),Gpe in p||VW in p&&p.additionalProperties!==!1?fDr(e,p,n,r,s):p}):[{}]}function yDr(e,t,n,r,o){let i;const{oneOf:s,anyOf:l,...c}=t;if(Array.isArray(s)?i=s:Array.isArray(l)&&(i=l),i){const u=o===void 0&&r?{}:o,d=wb(t);i=i.map(h=>_A(h,n,[]));const p=Uwe(e,u,i,n,d);if(r)return i.map(h=>Aw(c,h));t=Aw(c,i[p])}return[t]}function c1t(e,t,n,r,o,i,s){const{dependencies:l,...c}=t;return yDr(e,c,n,r,i).flatMap(d=>u1t(e,l,d,n,r,o,i,s))}function u1t(e,t,n,r,o,i,s,l){let c=[n];for(const u in t){if(!o&&cr(s,[u])===void 0||n.properties&&!(u in n.properties))continue;const[d,p]=Vwe(u,t);return Array.isArray(p)?c[0]=vDr(n,p):na(p)&&(c=bDr(e,n,r,u,p,o,i,s,l)),c.flatMap(h=>u1t(e,d,h,r,o,i,s,l))}return c}function vDr(e,t){if(!t)return e;const n=Array.isArray(e.required)?Array.from(new Set([...e.required,...t])):t;return{...e,required:n}}function bDr(e,t,n,r,o,i,s,l,c){return Hv(e,o,n,l,i,s,c).flatMap(d=>{const{oneOf:p,...h}=d;if(t=Aw(t,h),p===void 0)return t;const m=p.map(y=>typeof y=="boolean"||!(Tl in y)?[y]:l1t(e,y,n,i,s,l));return a1t(m).flatMap(y=>wDr(e,t,n,r,y,i,s,l,c))})}function wDr(e,t,n,r,o,i,s,l,c){const u=o.filter(d=>{if(typeof d=="boolean"||!d||!d.properties)return!1;const{[r]:p}=d.properties;if(p){const h={type:"object",properties:{[r]:p}};return e.isValid(h,l,n)||i}return!1});return!i&&u.length!==1?(console.warn("ignoring oneOf in dependencies because there isn't exactly one subschema that is valid"),[t]):u.flatMap(d=>{const p=d,[h]=Vwe(r,p.properties),m={...p,properties:h};return Hv(e,m,n,l,i,s,c).map(y=>Aw(t,y))})}function XR(e,t,n,r,o,i={},s){if(Array.isArray(n[o])){const c=wb(n)||r,u=n[o].map(p=>Hf(e,p,t,i,s)),d=cr(i,c);if(d!==void 0)return u.find(p=>jD(cr(p,[Ga,c,aX],cr(p,[Ga,c,B0])),d))}}function d1t(e,t,n,r,o){let i=n;if(sa(n,Tl)&&(i=Hf(e,n,t,void 0,o)),Lu(r))return i;const s=Array.isArray(r)?r:r.split("."),[l,...c]=s;if(l&&sa(i,l))return i=cr(i,l),d1t(e,t,i,c,o)}function tH(e,t,n,r,o,i){const s=d1t(e,t,n,r,i);return s===void 0?o:s}const Tze={title:"!@#$_UNKNOWN_$#@!"};function SDr(e,t,n,r,o={},i){const s=Array.isArray(r)?[...r]:r.split(".");let l=n;const c=s.pop();s.length&&s.forEach(h=>{l=tH(e,t,l,[Ga,h],{},i),sa(l,$i)?l=XR(e,t,l,c,$i,cr(o,h),i):sa(l,Sa)&&(l=XR(e,t,l,c,Sa,cr(o,h),i))}),sa(l,$i)?l=XR(e,t,l,c,$i,o,i):sa(l,Sa)&&(l=XR(e,t,l,c,Sa,o,i));let u=tH(e,t,l,[Ga,c],Tze,i);u===Tze&&(u=void 0);const d=tH(e,t,l,ibt,[],i);let p;return u&&Array.isArray(d)&&(p=d.includes(c)),{field:u,isRequired:p}}function CDr(e,t,n,r){var o=-1,i=e==null?0:e.length;for(r&&i&&(n=e[++o]);++o{const u=cr(r,c);if(typeof l=="boolean")return s;if(sa(l,Tl)){const d=Hf(e,l,t,u,o);return s+rhe(e,t,d,u||{},o)}if((sa(l,$i)||sa(l,Sa))&&u){const d=sa(l,$i)?$i:Sa,p=wb(l);return s+PD(e,t,u,cr(l,d),-1,p,o)}if(l.type==="object")return Aa(u)&&(s+=1),s+rhe(e,t,l,u,o);if(l.type===_D(u)){let d=s+1;return l.default?d+=u===l.default?1:-1:l.const&&(d+=u===l.const?1:-1),d}return s},0):UC(n.type)&&n.type===_D(r)&&(i+=1)),i}function PD(e,t,n,r,o=-1,i,s){const l=r.map(h=>_A(h,t,[])),c=i1t(n,r,i);if(o1t(c))return c;const u=l.reduce((h,m,g)=>(Uwe(e,n,[IDr,m],t,i)===1&&h.push(g),h),[]);if(u.length===1)return u[0];u.length||Ibt(l.length,h=>u.push(h));const d=new Set,{bestIndex:p}=u.reduce((h,m)=>{const{bestScore:g}=h,y=l[m],x=rhe(e,t,y,n,s);return d.add(x),x>g?{bestIndex:m,bestScore:x}:h},{bestIndex:o,bestScore:0});return d.size===1&&o>=0?o:p}function Wwe(e){return Array.isArray(e.items)&&e.items.length>0&&e.items.every(t=>na(t))}function KW(e){return e==null}function AD(e,t,n=!1,r=!1,o=!1){if(Array.isArray(t)){const i=Array.isArray(e)?e:[],s=o?i:t,l=o?t:i,c=s.map((u,d)=>l[d]!==void 0?AD(i[d],t[d],n,r,o):u);return(n||o)&&c.length{var c;const u=cr(t,l),d=na(e)&&l in e,p=l in t,h=(c=cr(e,l))!==null&&c!==void 0?c:{},m=d&&Object.entries(h).some(([,x])=>na(x)),g=d&&na(cr(e,l)),y=p&&na(u);return g&&y&&!m?(s[l]={...cr(e,l),...u},s):(s[l]=AD(cr(e,l),u,n,r,o&&(d||!p)),s)},i)}return r&&(e!==void 0&&KW(t)||typeof t=="number"&&isNaN(t))||o&&!KW(t)?e:t}function TD(e,t,n=!1){return Object.keys(t).reduce((r,o)=>{const i=e?e[o]:{},s=t[o];if(e&&o in e&&na(s))r[o]=TD(i,s,n);else if(n&&Array.isArray(i)&&Array.isArray(s)){let l=s;n==="preventDuplicates"&&(l=s.reduce((c,u)=>(i.includes(u)||c.push(u),c),[])),r[o]=i.concat(l)}else r[o]=s;return r},Object.assign({},e))}function p1t(e){return Array.isArray(e.enum)&&e.enum.length===1||B0 in e}function Gwe(e,t,n={},r){const o=Hf(e,t,n,void 0,r),i=o.oneOf||o.anyOf;return Array.isArray(o.enum)?!0:Array.isArray(i)?i.every(s=>typeof s!="boolean"&&p1t(s)):!1}function qwe(e,t,n,r){return!t.uniqueItems||!t.items||typeof t.items=="boolean"?!1:Gwe(e,t.items,n,r)}function h1t(e){const t=e[B0],n=wy(e);return na(t)&&UC(t==null?void 0:t.$data)&&n!=="object"&&n!=="array"}function _Dr(e){if(m4r in e&&Array.isArray(e.enum)&&e.enum.length===1)return e.enum[0];if(B0 in e)return e.const;throw new Error("schema cannot be inferred as a constant")}function qT(e,t){if(e.enum){let i;if(t){const{enumNames:s}=qo(t);i=s}return e.enum.map((s,l)=>({label:(i==null?void 0:i[l])||String(s),value:s}))}let n,r;e.anyOf?(n=e.anyOf,r=t==null?void 0:t.anyOf):e.oneOf&&(n=e.oneOf,r=t==null?void 0:t.oneOf);let o=wb(e);if(t){const{optionsSchemaSelector:i=o}=qo(t);o=i}return n&&n.map((i,s)=>{const{title:l}=qo(r==null?void 0:r[s]),c=i;let u,d=l;if(o){const p=cr(c,[Ga,o],{});u=cr(p,aX,cr(p,B0)),d=d||(p==null?void 0:p.title)||c.title||String(u)}else u=_Dr(c),d=d||c.title||String(u);return{schema:c,label:d,value:u}})}const PDr=["string","number","integer","boolean","null"];var KT;(function(e){e[e.Ignore=0]="Ignore",e[e.Invert=1]="Invert",e[e.Fallback=2]="Fallback"})(KT||(KT={}));function Rre(e,t=KT.Ignore,n=-1){if(n>=0){if(Array.isArray(e.items)&&nhC(e,C,{rootSchema:i,includeUndefinedValues:s,_recurseList:l,experimental_defaultFormStateBehavior:c,experimental_customMergeAllOf:u,parentDefaults:Array.isArray(r)?r[N]:void 0,rawFormData:m,required:d,shouldMergeDefaultsIntoFormData:p}));else if($i in g){const{oneOf:C,...N}=g;if(C.length===0)return;const j=wb(g),{type:I="null"}=N;!Array.isArray(I)&&PDr.includes(I)&&(v==null?void 0:v.constAsDefaults)==="skipOneOf"&&(v={...v,constAsDefaults:"never"}),x=C[PD(e,i,o??g.default,C,0,j,u)],x=Aw(N,x)}else if(Sa in g){const{anyOf:C,...N}=g;if(C.length===0)return;const j=wb(g);x=C[PD(e,i,o??g.default,C,0,j,u)],x=Aw(N,x)}if(x)return hC(e,x,{rootSchema:i,includeUndefinedValues:s,_recurseList:b,experimental_defaultFormStateBehavior:v,experimental_customMergeAllOf:u,parentDefaults:y,rawFormData:o??m,required:d,shouldMergeDefaultsIntoFormData:p,initialDefaultsGenerated:h});y===void 0&&(y=g.default);const w=Mze(e,g,n,y);let S=w??y;if(p){const{arrayMinItems:C={}}=c||{},{mergeExtraDefaults:N}=C,j=ADr(e,g,i,o,c,u);(!na(o)||HC in g)&&(S=AD(S,j,N,!0))}return S}function ADr(e,t,n,r,o,i){const s=!p1t(t)&&Gwe(e,t,n,i);let l=r;if(s){const u=qT(t);l=(u==null?void 0:u.some(p=>_l(p.value,r)))?r:void 0}return t[B0]&&(o==null?void 0:o.constAsDefaults)==="always"&&(l=t.const),l}function TDr(e,t,{rawFormData:n,rootSchema:r={},includeUndefinedValues:o=!1,_recurseList:i=[],experimental_defaultFormStateBehavior:s=void 0,experimental_customMergeAllOf:l=void 0,required:c,shouldMergeDefaultsIntoFormData:u,initialDefaultsGenerated:d}={},p){{const h=na(n)?n:{},m=t,y=(s==null?void 0:s.allOf)==="populateDefaults"&&HC in m||(s==null?void 0:s.emptyObjectFields)!=="skipEmptyDefaults"&&Swe in m?Hf(e,m,r,h,l):m,x=y[B0],v=Object.keys(y.properties||{}).reduce((b,w)=>{var S;const C=cr(y,[Ga,w],{}),N=na(x)&&x[w]!==void 0,j=(na(C)&&B0 in C||N)&&(s==null?void 0:s.constAsDefaults)!=="never"&&!h1t(C),I=hC(e,C,{rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:l,includeUndefinedValues:o===!0,parentDefaults:cr(p,[w]),rawFormData:cr(h,[w]),required:(S=y.required)===null||S===void 0?void 0:S.includes(w),shouldMergeDefaultsIntoFormData:u,initialDefaultsGenerated:d});return kze(b,w,I,o,c,y.required,s,j,(C==null?void 0:C.type)==="null"),b},{});if(y.additionalProperties&&!d){const b=na(y.additionalProperties)?y.additionalProperties:{},w=new Set;na(p)&&Object.keys(p).filter(C=>!y.properties||!y.properties[C]).forEach(C=>w.add(C));const S=[];Object.keys(h).filter(C=>!y.properties||!y.properties[C]).forEach(C=>{w.add(C),S.push(C)}),w.forEach(C=>{var N;const j=hC(e,b,{rootSchema:r,_recurseList:i,experimental_defaultFormStateBehavior:s,experimental_customMergeAllOf:l,includeUndefinedValues:o===!0,parentDefaults:cr(p,[C]),rawFormData:cr(h,[C]),required:(N=y.required)===null||N===void 0?void 0:N.includes(C),shouldMergeDefaultsIntoFormData:u,initialDefaultsGenerated:d});kze(v,C,j,o,c,S)})}return m1t(t,v)}}function kDr(e,t,{rawFormData:n,rootSchema:r={},_recurseList:o=[],experimental_defaultFormStateBehavior:i=void 0,experimental_customMergeAllOf:s=void 0,required:l,requiredAsRoot:c=!1,shouldMergeDefaultsIntoFormData:u,initialDefaultsGenerated:d}={},p){var h,m;const g=t,y=(h=i==null?void 0:i.arrayMinItems)!==null&&h!==void 0?h:{},{populate:x,mergeExtraDefaults:v}=y,b=x==="never",w=x==="requiredOnly",S=x==="all"||!b&&!w,C=(m=y==null?void 0:y.computeSkipPopulate)!==null&&m!==void 0?m:(()=>!1),j=(i==null?void 0:i.emptyObjectFields)==="skipEmptyDefaults"?void 0:[];if(Array.isArray(p)&&(p=p.map((P,E)=>{const M=Rre(g,KT.Fallback,E),R=Array.isArray(n)?n[E]:void 0;return hC(e,M,{rootSchema:r,_recurseList:o,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,parentDefaults:P,rawFormData:R,required:l,shouldMergeDefaultsIntoFormData:u,initialDefaultsGenerated:d})})),Array.isArray(n)){const P=Rre(g);if(b)p=n;else{const E=n.map((R,$)=>hC(e,P,{rootSchema:r,_recurseList:o,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,rawFormData:R,parentDefaults:cr(p,[$]),required:l,shouldMergeDefaultsIntoFormData:u,initialDefaultsGenerated:d}));p=AD(p,E,(w&&l||S)&&v)}}if((na(g)&&B0 in g&&(i==null?void 0:i.constAsDefaults)!=="never")===!1){if(b)return p??j;if(w&&!l)return p||void 0}let _;const T=Array.isArray(p)?p.length:0;if(!g.minItems||qwe(e,g,r,s)||C(e,g,r)||g.minItems<=T)_=p||!l&&!c?p:j;else{const P=p||[],E=Rre(g,KT.Invert),M=E.default,R=Array.from({length:g.minItems-T},()=>hC(e,E,{parentDefaults:M,rootSchema:r,_recurseList:o,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,required:l,shouldMergeDefaultsIntoFormData:u}));_=P.concat(R)}return m1t(t,_)}function Mze(e,t,n={},r){switch(wy(t)){case"object":return TDr(e,t,n,r);case"array":return kDr(e,t,n,r)}}function g1t(e,t,n,r,o=!1,i,s,l){if(!na(t))throw new Error("Invalid schema: "+t);const c=Hf(e,t,r,n,s),u=hC(e,c,{rootSchema:r,includeUndefinedValues:o,experimental_defaultFormStateBehavior:i,experimental_customMergeAllOf:s,rawFormData:n,shouldMergeDefaultsIntoFormData:!0,initialDefaultsGenerated:l,requiredAsRoot:!0});if(c.type!=="object"&&na(c.default))return{...u,...n};if(na(n)||Array.isArray(n)){const{mergeDefaultsIntoFormData:d}=i||{};return AD(u,n,!0,d==="useDefaultIfFormDataUndefined",!0)}return u}function x1t(e={}){return"widget"in qo(e)&&qo(e).widget!=="hidden"}function y1t(e,t,n={},r,o){if(n[Nwe]==="files")return!0;if(t.items){const i=Hf(e,t.items,r,void 0,o);return i.type==="string"&&i.format==="data-url"}return!1}function MDr(e,t,n={},r,o,i){const s=qo(n,o),{label:l=!0}=s;let c=!!l;if(c){const u=wy(t),d=cr(t,fC,!1);u==="array"&&(c=d||qwe(e,t,r,i)||y1t(e,t,n,r,i)||x1t(n)),u==="object"&&(c=d),u==="boolean"&&n&&!n[Nwe]&&(c=!1),n&&n[v4r]&&(c=!1)}return c}function v1t(e,t,n){for(var r=-1,o=t.length,i={};++r_l(d,c))===-1)return Ej(e,c,n,r,o,i.concat(c),s)}let l={[QB]:n.replace(/^\./,"")};if($i in t||Sa in t){const c=$i in t?t.oneOf:t.anyOf,u=wb(t),d=PD(e,r,o,c,0,u,s),p=c[d];l={...l,...Ej(e,p,n,r,o,i,s)}}if(VW in t&&t[VW]!==!1&&zs(l,Cwe,!0),UT in t&&Array.isArray(o)){const{items:c,additionalItems:u}=t;Array.isArray(c)?o.forEach((d,p)=>{c[p]?l[p]=Ej(e,c[p],`${n}.${p}`,r,d,i,s):u?l[p]=Ej(e,u,`${n}.${p}`,r,d,i,s):console.warn(`Unable to generate path schema for "${n}.${p}". No schema defined for it`)}):o.forEach((d,p)=>{l[p]=Ej(e,c,`${n}.${p}`,r,d,i,s)})}else if(Ga in t)for(const c in t.properties){const u=cr(t,[Ga,c],{});l[c]=Ej(e,u,`${n}.${c}`,r,cr(o,[c]),i,s)}return l}function w1t(e,t,n="",r,o,i){return Ej(e,t,n,r,o,void 0,i)}function S1t(e,t){if(t.length===0&&typeof e!="object")return e;const n=b1t(e,t);return Array.isArray(e)?Object.keys(n).map(r=>n[r]):n}function C1t(e,t){const n=(o,i)=>typeof o!="object"||Lu(o)||i&&!Lu(o),r=(o,i=[],s=[[]])=>{const l=Object.keys(o);return l.forEach(c=>{const u=o[c];if(typeof u=="object"){const d=s.map(p=>[...p,c]);u[Cwe]&&u[QB]!==""?i.push(u[QB]):r(u,i,d)}else c===QB&&u!==""&&s.forEach(d=>{const p=cr(t,d),h=l.length===1;(n(p,h)||Array.isArray(p)&&p.every(m=>n(m,h)))&&i.push(d)})}),i};return r(e)}function ODr(e,t,n={},r){const o=Hf(e,t,n,r),i=w1t(e,o,"",n,r),l=C1t(i,r).map(c=>Array.isArray(c)?c.join("."):c);return S1t(r,l)}const L_=Symbol("no Value");function ohe(e,t,n,r,o={},i){let s;if(sa(n,Ga)){const l={};if(sa(r,Ga)){const d=cr(r,Ga,{});Object.keys(d).forEach(p=>{sa(o,p)&&(l[p]=void 0)})}const c=Object.keys(cr(n,Ga,{})),u={};c.forEach(d=>{const p=cr(o,d);let h=cr(r,[Ga,d],{}),m=cr(n,[Ga,d],{});sa(h,Tl)&&(h=Hf(e,h,t,p,i)),sa(m,Tl)&&(m=Hf(e,m,t,p,i));const g=cr(h,"type"),y=cr(m,"type");if(!g||g===y)if(sa(l,d)&&delete l[d],y==="object"||y==="array"&&Array.isArray(p)){const x=ohe(e,t,m,h,p,i);(x!==void 0||y==="array")&&(u[d]=x)}else{const x=cr(m,"default",L_),v=cr(h,"default",L_);x!==L_&&x!==p&&(v===p?l[d]=x:cr(m,"readOnly")===!0&&(l[d]=void 0));const b=cr(m,"const",L_),w=cr(h,"const",L_);b!==L_&&b!==p&&(l[d]=w===p?b:void 0)}}),s={...typeof o=="string"||Array.isArray(o)?void 0:o,...l,...u}}else if(cr(r,"type")==="array"&&cr(n,"type")==="array"&&Array.isArray(o)){let l=cr(r,"items"),c=cr(n,"items");if(typeof l=="object"&&typeof c=="object"&&!Array.isArray(l)&&!Array.isArray(c)){sa(l,Tl)&&(l=Hf(e,l,t,o,i)),sa(c,Tl)&&(c=Hf(e,c,t,o,i));const u=cr(l,"type"),d=cr(c,"type");if(!u||u===d){const p=cr(n,"maxItems",-1);d==="object"?s=o.reduce((h,m)=>{const g=ohe(e,t,c,l,m,i);return g!==void 0&&(p<0||h.length0&&o.length>p?o.slice(0,p):o}}else typeof l=="boolean"&&typeof c=="boolean"&&l===c&&(s=o)}return s}class $Dr{constructor(t,n,r,o){n&&n[KR]===JB?this.rootSchema=nhe(n,cr(n,tl,"#")):this.rootSchema=n,this.validator=t,this.experimental_defaultFormStateBehavior=r,this.experimental_customMergeAllOf=o}getRootSchema(){return this.rootSchema}getValidator(){return this.validator}doesSchemaUtilsDiffer(t,n,r={},o){return!t||!n?!1:this.validator!==t||!_l(this.rootSchema,n)||!_l(this.experimental_defaultFormStateBehavior,r)||this.experimental_customMergeAllOf!==o}findFieldInSchema(t,n,r){return SDr(this.validator,this.rootSchema,t,n,r,this.experimental_customMergeAllOf)}findSelectedOptionInXxxOf(t,n,r,o){return XR(this.validator,this.rootSchema,t,n,r,o,this.experimental_customMergeAllOf)}getDefaultFormState(t,n,r=!1,o){return g1t(this.validator,t,n,this.rootSchema,r,this.experimental_defaultFormStateBehavior,this.experimental_customMergeAllOf,o)}getDisplayLabel(t,n,r){return MDr(this.validator,t,n,this.rootSchema,r,this.experimental_customMergeAllOf)}getClosestMatchingOption(t,n,r,o){return PD(this.validator,this.rootSchema,t,n,r,o,this.experimental_customMergeAllOf)}getFirstMatchingOption(t,n,r){return Uwe(this.validator,t,n,this.rootSchema,r)}getFromSchema(t,n,r){return tH(this.validator,this.rootSchema,t,n,r,this.experimental_customMergeAllOf)}isFilesArray(t,n){return y1t(this.validator,t,n,this.rootSchema,this.experimental_customMergeAllOf)}isMultiSelect(t){return qwe(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}isSelect(t){return Gwe(this.validator,t,this.rootSchema,this.experimental_customMergeAllOf)}omitExtraData(t,n){return ODr(this.validator,t,this.rootSchema,n)}retrieveSchema(t,n,r){return Hf(this.validator,t,this.rootSchema,n,this.experimental_customMergeAllOf,r)}sanitizeDataForNewSchema(t,n,r){return ohe(this.validator,this.rootSchema,t,n,r,this.experimental_customMergeAllOf)}toPathSchema(t,n,r){return w1t(this.validator,t,n,this.rootSchema,r,this.experimental_customMergeAllOf)}}function DDr(e,t,n={},r){return new $Dr(e,t,n,r)}function LDr(e){var t;if(e.indexOf("data:")===-1)throw new Error("File is invalid: URI must be a dataURI");const r=e.slice(5).split(";base64,");if(r.length!==2)throw new Error("File is invalid: dataURI must be base64");const[o,i]=r,[s,...l]=o.split(";"),c=s||"",u=decodeURI(((t=l.map(d=>d.split("=")).find(([d])=>d==="name"))===null||t===void 0?void 0:t[1])||"unknown");try{const d=atob(i),p=new Array(d.length);for(let m=0;m 0, got one of each`);if(e>t)return N1t(t,e).reverse();const n=[];for(let r=e;r<=t;r++)n.push({value:r,label:ZS(r,2)});return n}function Rze(e,t){if(Object.is(e,t))return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o{const s=r.findIndex(l=>l===`%${i+1}`);s>=0&&(r[s]=o)}),n=r.join("")}return n}function zDr(e,t){return FDr(e,t)}function nb(e,t=[],n){if(Array.isArray(e))return e.map(i=>nb(i,t)).filter(i=>i!==n);const r=e===""||e===null?-1:Number(e),o=t[r];return o?o.value:n}function BDr(e,t,n=[]){const r=nb(e,n);return Array.isArray(t)?t.filter(o=>!_l(o,r)):_l(r,t)?void 0:t}function Kwe(e,t){return Array.isArray(t)?t.some(n=>_l(n,e)):_l(t,e)}function HDr(e,t=[],n=!1){const r=t.map((o,i)=>Kwe(o.value,e)?String(i):void 0).filter(o=>typeof o<"u");return n?r:r[0]}function VDr(e,t,n=[]){const r=nb(e,n);if(!KW(r)){const o=n.findIndex(l=>r===l.value),i=n.map(({value:l})=>l);return t.slice(0,o).concat(r,t.slice(o)).sort((l,c)=>+(i.indexOf(l)>i.indexOf(c)))}return t}var UDr=1,WDr=4;function Ywe(e){return n3(e,UDr|WDr)}function GDr(e,t,n,r){return r=typeof r=="function"?r:void 0,e==null?e:Owe(e,t,n,r)}class j1t{constructor(t){this.errorSchema={},this.resetAllErrors(t)}get ErrorSchema(){return this.errorSchema}getOrCreateErrorBlock(t){let r=Array.isArray(t)&&t.length>0||typeof t=="string"?cr(this.errorSchema,t):this.errorSchema;return!r&&t&&(r={},GDr(this.errorSchema,t,r,Object)),r}resetAllErrors(t){return this.errorSchema=t?Ywe(t):{},this}addErrors(t,n){const r=this.getOrCreateErrorBlock(n);let o=cr(r,Ff);return Array.isArray(o)||(o=[],r[Ff]=o),Array.isArray(t)?zs(r,Ff,[...new Set([...o,...t])]):zs(r,Ff,[...new Set([...o,t])]),this}setErrors(t,n){const r=this.getOrCreateErrorBlock(n),o=Array.isArray(t)?[...new Set([...t])]:[t];return zs(r,Ff,o),this}clearErrors(t){const n=this.getOrCreateErrorBlock(t);return zs(n,Ff,[]),this}}function qDr(e,t){if(e==null)return{};var n=x4(Bwe(e),function(r){return[r]});return t=Dwe(t),v1t(e,n,function(r,o){return t(r,o[0])})}var KDr=200;function YDr(e,t,n,r){var o=-1,i=zwe,s=!0,l=e.length,c=[],u=t.length;if(!l)return c;t.length>=KDr&&(i=ND,s=!1,t=new FI(t));e:for(;++o!_l(s,cr(t,l)))),i=XDr(Wx(t),Wx(e));return[...o,...i]}}function QDr(e,t,n=[1900,new Date().getFullYear()+2],r="YMD"){const{day:o,month:i,year:s,hour:l,minute:c,second:u}=e,d={type:"day",range:[1,31],value:o},p={type:"month",range:[1,12],value:i},h={type:"year",range:n,value:s},m=[];switch(r){case"MDY":m.push(p,d,h);break;case"DMY":m.push(d,p,h);break;case"YMD":default:m.push(h,p,d)}return t&&m.push({type:"hour",range:[0,23],value:l},{type:"minute",range:[0,59],value:c},{type:"second",range:[0,59],value:u}),m}function JDr(e){const t={};return e.multipleOf&&(t.step=e.multipleOf),(e.minimum||e.minimum===0)&&(t.min=e.minimum),(e.maximum||e.maximum===0)&&(t.max=e.maximum),t}function ZDr(e,t,n={},r=!0){const o={type:t||"text",...JDr(e)};return n.inputType?o.type=n.inputType:t||(e.type==="number"?(o.type="number",r&&o.step===void 0&&(o.step="any")):e.type==="integer"&&(o.type="number",o.step===void 0&&(o.step=1))),n.autocomplete&&(o.autoComplete=n.autocomplete),n.accept&&(o.accept=n.accept),o}const $ze={props:{disabled:!1},submitText:"Submit",norender:!1};function eLr(e={}){const t=qo(e);if(t&&t[UW]){const n=t[UW];return{...$ze,...n}}return $ze}function Pi(e,t,n={}){const{templates:r}=t;if(e==="ButtonTemplates")return r[e];if(Object.hasOwn(n,e)&&typeof n[e]=="string"&&Object.hasOwn(r,n[e])){const o=n[e];return r[o]}return n[e]||r[e]}var tLr=0;function E1t(e){var t=++tLr;return kwe(e)+t}function Xwe(){if(typeof process>"u"||cr(process,"env.NODE_ENV")!=="test")return{};const e=new Map;return new Proxy({},{get(t,n){return e.has(n)||e.set(n,E1t("test-id-")),e.get(n)}})}var Ore={exports:{}},ws={};/** * @license React * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Dze;function nLr(){if(Dze)return ws;Dze=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.server_context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),g;g=Symbol.for("react.module.reference");function y(x){if(typeof x=="object"&&x!==null){var v=x.$$typeof;switch(v){case e:switch(x=x.type,x){case n:case o:case r:case u:case d:return x;default:switch(x=x&&x.$$typeof,x){case l:case s:case c:case h:case p:case i:return x;default:return v}}case t:return v}}}return ws.ContextConsumer=s,ws.ContextProvider=i,ws.Element=e,ws.ForwardRef=c,ws.Fragment=n,ws.Lazy=h,ws.Memo=p,ws.Portal=t,ws.Profiler=o,ws.StrictMode=r,ws.Suspense=u,ws.SuspenseList=d,ws.isAsyncMode=function(){return!1},ws.isConcurrentMode=function(){return!1},ws.isContextConsumer=function(x){return y(x)===s},ws.isContextProvider=function(x){return y(x)===i},ws.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===e},ws.isForwardRef=function(x){return y(x)===c},ws.isFragment=function(x){return y(x)===n},ws.isLazy=function(x){return y(x)===h},ws.isMemo=function(x){return y(x)===p},ws.isPortal=function(x){return y(x)===t},ws.isProfiler=function(x){return y(x)===o},ws.isStrictMode=function(x){return y(x)===r},ws.isSuspense=function(x){return y(x)===u},ws.isSuspenseList=function(x){return y(x)===d},ws.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===n||x===o||x===r||x===u||x===d||x===m||typeof x=="object"&&x!==null&&(x.$$typeof===h||x.$$typeof===p||x.$$typeof===i||x.$$typeof===s||x.$$typeof===c||x.$$typeof===g||x.getModuleId!==void 0)},ws.typeOf=y,ws}var Lze;function rLr(){return Lze||(Lze=1,Ore.exports=nLr()),Ore.exports}var oLr=rLr();const Fze=Ba(oLr),$re={boolean:{checkbox:"CheckboxWidget",radio:"RadioWidget",select:"SelectWidget",hidden:"HiddenWidget"},string:{text:"TextWidget",password:"PasswordWidget",email:"EmailWidget",hostname:"TextWidget",ipv4:"TextWidget",ipv6:"TextWidget",uri:"URLWidget","data-url":"FileWidget",radio:"RadioWidget",select:"SelectWidget",textarea:"TextareaWidget",hidden:"HiddenWidget",date:"DateWidget",datetime:"DateTimeWidget","date-time":"DateTimeWidget","alt-date":"AltDateWidget","alt-datetime":"AltDateTimeWidget",time:"TimeWidget",color:"ColorWidget",file:"FileWidget"},number:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},integer:{text:"TextWidget",select:"SelectWidget",updown:"UpDownWidget",range:"RangeWidget",radio:"RadioWidget",hidden:"HiddenWidget"},array:{select:"SelectWidget",checkboxes:"CheckboxesWidget",files:"FileWidget",hidden:"HiddenWidget"}};function iLr(e){let t=cr(e,"MergedWidget");if(!t){const n=e.defaultProps&&e.defaultProps.options||{};t=({options:r,...o})=>a.jsx(e,{options:{...n,...r},...o}),zs(e,"MergedWidget",t)}return t}function Sb(e,t,n={}){const r=wy(e);if(typeof t=="function"||t&&Fze.isForwardRef(f.createElement(t))||Fze.isMemo(t))return iLr(t);if(typeof t!="string")throw new Error(`Unsupported widget definition: ${typeof t} in schema: ${JSON.stringify(e)}`);if(t in n){const o=n[t];return Sb(e,o,n)}if(typeof r=="string"){if(!(r in $re))throw new Error(`No widget for type '${r}' in schema: ${JSON.stringify(e)}`);if(t in $re[r]){const o=n[$re[r][t]];return Sb(e,o,n)}}throw new Error(`No widget '${t}' for type '${r}' in schema: ${JSON.stringify(e)}`)}function aLr(e){let t=0;for(let n=0;n(t.add(n),r)),JSON.stringify(e,Array.from(t).sort())}function Vv(e){return aLr(sLr(e))}function lLr(e){return Vv(e)}function cLr(e,t,n={}){try{return Sb(e,t,n),!0}catch(r){const o=r;if(o.message&&(o.message.startsWith("No widget")||o.message.startsWith("Unsupported widget")))return!1;throw r}}function j5(e,t){return`${UC(e)?e:e[tl]}__${t}`}function Y6(e){return j5(e,"description")}function I1t(e){return j5(e,"error")}function ihe(e){return j5(e,"examples")}function _1t(e){return j5(e,"help")}function Qwe(e){return j5(e,"title")}function E5(e,t=!1){const n=t?` ${ihe(e)}`:"";return`${I1t(e)} ${Y6(e)} ${_1t(e)}${n}`}function P1t(e,t){return`${e}-${t}`}function mE(e,t){return j5(e,t)}function Dre(e,t){return j5(e,`optional${t}`)}function b4(e){return!KW(e)&&(!Aa(e)||Array.isArray(e)||!Lu(e))}function uLr(e,t){const{rootSchema:n,schemaUtils:r}=e;if(jD(t,n))return!0;if(Tl in n){const o=r.retrieveSchema(n);return jD(t,o)}return!1}function dLr(e,t,n){return t?n:e}function fLr(e){return e?new Date(e).toJSON():void 0}function Jwe(e,t,n){const r=[y4r];return sa(e,B9e)&&r.unshift(B9e),cr(e,[...r,t],n)}function pLr(e,t){if(!Array.isArray(t))return e;const n=d=>d.reduce((p,h)=>(p[h]=!0,p),{}),r=d=>d.length>1?`properties '${d.join("', '")}'`:`property '${d[0]}'`,o=n(e),i=t.filter(d=>d==="*"||o[d]),s=n(i),l=e.filter(d=>!s[d]),c=i.indexOf("*");if(c===-1){if(l.length)throw new Error(`uiSchema order list does not contain ${r(l)}`);return i}if(c!==i.lastIndexOf("*"))throw new Error("uiSchema order list contains more than one wildcard item");const u=[...i];return u.splice(c,1,...l),u}function Lre(e,t=!0){if(!e)return{year:-1,month:-1,day:-1,hour:t?-1:0,minute:t?-1:0,second:t?-1:0};const n=new Date(e);if(Number.isNaN(n.getTime()))throw new Error("Unable to parse date "+e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:t?n.getUTCHours():0,minute:t?n.getUTCMinutes():0,second:t?n.getUTCSeconds():0}}function nH(e){if(e.const||e.enum&&e.enum.length===1&&e.enum[0]===!0)return!0;if(e.anyOf&&e.anyOf.length===1)return nH(e.anyOf[0]);if(e.oneOf&&e.oneOf.length===1)return nH(e.oneOf[0]);if(e.allOf){const t=n=>nH(n);return e.allOf.some(t)}return!1}function A1t(e,t,n,r="customDeep"){if(r==="always")return!0;if(r==="shallow"){const{props:s,state:l}=e;return!Rze(s,t)||!Rze(l,n)}const{props:o,state:i}=e;return!_l(o,t)||!_l(i,n)}function zze(e){const t=Vbt(e.map(n=>Aa(n)?wy(n):void 0).flat().filter(n=>n!==void 0));return t.length===1?t[0]:t}function X6(e,t,n,r){const{enableOptionalDataFieldForType:o=[]}=qo(r,e.globalUiOptions);let i;return Sa in t&&Array.isArray(t[Sa])?i=zze(t[Sa]):$i in t&&Array.isArray(t[$i])?i=zze(t[$i]):i=wy(t),!uLr(e,t)&&!n&&!!i&&!Array.isArray(i)&&!!o.find(s=>s===i)}function Bze(e,t=!0){const{year:n,month:r,day:o,hour:i=0,minute:s=0,second:l=0}=e,c=Date.UTC(n,r-1,o,i,s,l),u=new Date(c).toJSON();return t?u:u.slice(0,10)}function Zwe(e,t=[]){if(!e)return[];let n=[];return Ff in e&&(n=n.concat(e[Ff].map(r=>{const o=`.${t.join(".")}`;return{property:o,message:r,stack:`${o} ${r}`}}))),Object.keys(e).reduce((r,o)=>{if(o!==Ff){const i=e[o];VC(i)&&(r=r.concat(Zwe(i,[...t,o])))}return r},n)}function T1t(e){return Od(e)?x4(e,N5):G6(e)?[e]:Fwe(Sbt(kwe(e)))}function hLr(e){const t=new j1t;return e.length&&e.forEach(n=>{const{property:r,message:o}=n,i=r==="."?[]:T1t(r);i.length>0&&i[0]===""&&i.splice(0,1),o&&t.addErrors(o,i)}),t.ErrorSchema}function U0(e,t,n,r){const o=Array.isArray(n)?n:n==null?void 0:n.path,i=e===""?[]:[e],s=o?o.concat(...i):i,l=[t.idPrefix,...s].join(t.idSeparator);let c;return t.nameGenerator&&s.length>0&&(c=t.nameGenerator(s,t.idPrefix,r)),{path:s,[tl]:l,...c!==void 0&&{name:c}}}function k1t(e){return Object.keys(e).reduce((t,n)=>{if(n==="addError")return t;{const r=e[n];return VC(r)?{...t,[n]:k1t(r)}:{...t,[n]:r}}},{})}function mLr(e){return Object.values(e).every(t=>t!==-1)}function gLr(e){const{className:t="form-control",type:n,range:r,value:o,select:i,rootId:s,name:l,disabled:c,readonly:u,autofocus:d,registry:p,onBlur:h,onFocus:m}=e,g=`${s}_${n}`,{SelectWidget:y}=p.widgets,x=f.useCallback(v=>i(n,v),[i,n]);return a.jsx(y,{schema:{type:"integer"},id:g,name:l,className:t,options:{enumOptions:N1t(r[0],r[1])},placeholder:n,value:o,disabled:c,readonly:u,autofocus:d,onChange:x,onBlur:h,onFocus:m,registry:p,label:"","aria-describedby":E5(s)})}function xLr(e){const{time:t=!1,disabled:n=!1,readonly:r=!1,options:o,onChange:i,value:s}=e,[l,c]=f.useState(Lre(s,t));f.useEffect(()=>{c(Lre(s,t))},[t,s]);const u=f.useCallback((m,g)=>{const y={...l,[m]:typeof g>"u"?-1:g};mLr(y)?i(Bze(y,t)):c(y)},[l,i,t]),d=f.useCallback(m=>{m.preventDefault(),!(n||r)&&i(void 0)},[n,r,i]),p=f.useCallback(m=>{if(m.preventDefault(),n||r)return;const g=Lre(new Date().toJSON(),t);i(Bze(g,t))},[n,r,t,i]);return{elements:f.useMemo(()=>QDr(l,t,o.yearsRange,o.format),[l,t,o.yearsRange,o.format]),handleChange:u,handleClear:d,handleSetNow:p}}function I5(e){const t=f.useRef(e);return jD(e,t.current)||(t.current=e),t.current}function yLr(e,t){return e.replace(";base64",`;name=${encodeURIComponent(t)};base64`)}function vLr(e){const{name:t,size:n,type:r}=e;return new Promise((o,i)=>{const s=new window.FileReader;s.onerror=i,s.onload=l=>{var c;typeof((c=l.target)===null||c===void 0?void 0:c.result)=="string"?o({dataURL:yLr(l.target.result,t),name:t,size:n,type:r}):o({dataURL:null,name:t,size:n,type:r})},s.readAsDataURL(e)})}function bLr(e){return Promise.all(Array.from(e).map(vLr))}function Hze(e){return e.reduce((t,n)=>{if(!n)return t;try{const{blob:r,name:o}=LDr(n);return[...t,{dataURL:n,name:o,size:r.size,type:r.type}]}catch{return t}},[])}function wLr(e,t,n=!1){const r=f.useMemo(()=>n&&e?Array.isArray(e)?e:[e]:[],[e,n]),o=f.useMemo(()=>Array.isArray(e)?Hze(e):Hze([e||""]),[e]),i=f.useCallback(l=>{bLr(l).then(c=>{const u=c.map(d=>d.dataURL||null);t(n?r.concat(...u):u[0])})},[r,n,t]),s=f.useCallback(l=>{if(n){const c=r.filter((u,d)=>d!==l);t(c)}else t(void 0)},[r,n,t]);return{filesInfo:o,handleChange:i,handleRemove:s}}function SLr(e){if(!e)return"";const t=new Date(e),n=ZS(t.getFullYear(),4),r=ZS(t.getMonth()+1,2),o=ZS(t.getDate(),2),i=ZS(t.getHours(),2),s=ZS(t.getMinutes(),2),l=ZS(t.getSeconds(),2),c=ZS(t.getMilliseconds(),3);return`${n}-${r}-${o}T${i}:${s}:${l}.${c}`}function rH(e,t,n=!1){if(!t)return e;const{errors:r,errorSchema:o}=e;let i=Zwe(t),s=t;return Lu(o)||(s=TD(o,t,n?"preventDuplicates":!0),i=[...r].concat(i)),{errorSchema:s,errors:i}}function CLr(e){for(const t in e){const n=e,r=n[t];t===Tl&&typeof r=="string"&&r.startsWith("#")?n[t]=lbt+r:n[t]=eSe(r)}return e}function NLr(e){for(let t=0;t({key:ahe(),item:t})):[]}function M1t(e){return Array.isArray(e)?e.map(t=>t.item):[]}function ILr(e){return Array.isArray(e.type)?!e.type.includes("null"):e.type!=="null"}function R1t(e,t,n,r){let{addable:o}=qo(r,e.globalUiOptions);return o!==!1&&(t.maxItems!==void 0?o=n.lengthJ[fe]);const te=f.useCallback(fe=>{T(fe,n+1)},[T,n]),re=f.useCallback(fe=>{P(fe,n)},[P,n]),ce=f.useCallback(fe=>{E(fe,n)},[E,n]),ae=f.useCallback(fe=>{M(fe,n,n-1)},[M,n]),oe=f.useCallback(fe=>{M(fe,n,n+1)},[M,n]),ue={children:a.jsx(B,{name:r,title:_,index:n,schema:g,uiSchema:x,formData:y,errorSchema:b,fieldPathId:V,required:ILr(g),onChange:N,onBlur:S,onFocus:C,registry:l,disabled:o,readonly:s,hideError:i,autofocus:w,rawErrors:j}),buttonsProps:{fieldPathId:V,disabled:o,readonly:s,canAdd:d,hasCopy:J.copy,hasMoveUp:J.moveUp,hasMoveDown:J.moveDown,hasRemove:J.remove,index:n,totalItems:I,onAddItem:te,onCopyItem:re,onRemoveItem:ce,onMoveUpItem:ae,onMoveDownItem:oe,registry:l,schema:g,uiSchema:x},itemKey:t,className:"rjsf-array-item",disabled:o,hasToolbar:J.toolbar,index:n,totalItems:I,readonly:s,registry:l,schema:g,uiSchema:x,parentUiSchema:u,displayLabel:H,hasDescription:W};return a.jsx(G,{...ue})}function kLr(e){const{schema:t,uiSchema:n={},errorSchema:r,fieldPathId:o,formData:i,name:s,title:l,disabled:c=!1,readonly:u=!1,autofocus:d=!1,required:p=!1,hideError:h=!1,registry:m,onBlur:g,onFocus:y,rawErrors:x,onChange:v,keyedFormData:b,handleAddItem:w,handleCopyItem:S,handleRemoveItem:C,handleReorderItems:N}=e,j=t.title||l||s,{schemaUtils:I,fields:_,formContext:T,globalFormOptions:P,globalUiOptions:E}=m,{OptionalDataControlsField:M}=_,R=qo(n,E),$=Aa(t.items)?t.items:{},D=I.retrieveSchema($),z=M1t(b),V=X6(m,t,p,n),B=b4(i),G=R1t(m,t,z,n)&&(!V||B),H=B?b:[],F=V?" rjsf-optional-array-field":"",W=e.childFieldPathId??o,U=V?a.jsx(M,{...e,fieldPathId:W}):void 0,K={canAdd:G,items:H.map((J,te)=>{const{key:re,item:ce}=J,ae=ce,oe=I.retrieveSchema($,ae),ue=r?r[te]:void 0,fe=U0(te,P,W),se=O1t(n,ce,te,T),ge={itemKey:re,index:te,name:s&&`${s}-${te}`,registry:m,uiOptions:R,hideError:h,readonly:u,disabled:c,required:p,title:j?`${j}-${te+1}`:void 0,canAdd:G,canMoveUp:te>0,canMoveDown:te_.retrieveSchema(te,j[re])),G=Aa(t.additionalItems)?_.retrieveSchema(t.additionalItems,r):null,H=e.childFieldPathId??i;j.length{const{key:ce,item:ae}=te,oe=ae,ue=re>=B.length,fe=(ue&&Aa(t.additionalItems)?_.retrieveSchema(t.additionalItems,oe):B[re])||{},se=U0(re,E,H);let ge;ue?ge=n.additionalItems:Array.isArray(n.items)?ge=n.items[re]:ge=O1t(n,ae,re,P);const ye=o?o[re]:void 0,de={index:re,itemKey:ce,name:s&&`${s}-${re}`,registry:m,uiOptions:R,hideError:h,readonly:u,disabled:c,required:p,title:I?`${I}-${re+1}`:void 0,canAdd:K,canRemove:ue,canMoveUp:re>=B.length+1,canMoveDown:ue&&reVv(e),[e]),[n,r]=f.useState(()=>({formDataHash:t,keyedFormData:Vze(e)}));let{keyedFormData:o,formDataHash:i}=n;if(t!==i){const l=Array.isArray(e)?e:[],c=o||[];o=l.length===c.length?c.map((u,d)=>({key:u.key,item:l[d]})):Vze(l),i=t,r({formDataHash:i,keyedFormData:o})}const s=f.useCallback(l=>{const c=M1t(l),u=Vv(c);return r({formDataHash:u,keyedFormData:l}),c},[]);return{keyedFormData:o,updateKeyedFormData:s}}function OLr(e){const{schema:t,uiSchema:n,errorSchema:r,fieldPathId:o,registry:i,formData:s,onChange:l}=e,{globalFormOptions:c,schemaUtils:u,translateString:d}=i,{keyedFormData:p,updateKeyedFormData:h}=RLr(s),m=e.childFieldPathId??o,g=f.useCallback((N,j)=>{N&&N.preventDefault();let I;if(r){I={};for(const P in r){const E=parseInt(P);j===void 0||E=j&&zs(I,[E+1],r[P])}}const _={key:ahe(),item:_Lr(i,t)},T=[...p];j!==void 0?T.splice(j,0,_):T.push(_),l(h(T),m.path,I)},[p,i,t,l,h,r,m]),y=f.useCallback((N,j)=>{N&&N.preventDefault();let I;if(r){I={};for(const P in r){const E=parseInt(P);E<=j?zs(I,[E],r[P]):E>j&&zs(I,[E+1],r[P])}}const _={key:ahe(),item:Ywe(p[j].item)},T=[...p];j!==void 0?T.splice(j+1,0,_):T.push(_),l(h(T),m.path,I)},[p,l,h,r,m]),x=f.useCallback((N,j)=>{N&&N.preventDefault();let I;if(r){I={};for(const T in r){const P=parseInt(T);Pj&&zs(I,[P-1],r[T])}}const _=p.filter((T,P)=>P!==j);l(h(_),m.path,I)},[p,l,h,r,m]),v=f.useCallback((N,j,I)=>{N&&(N.preventDefault(),N.currentTarget.blur());let _;if(r){_={};for(const E in r){const M=parseInt(E);M==j?zs(_,[I],r[j]):M==I?zs(_,[j],r[I]):zs(_,[E],r[M])}}function T(){const E=p.slice();return E.splice(j,1),E.splice(I,0,p[j]),E}const P=T();l(h(P),m.path,_)},[p,l,h,r,m]),b=f.useCallback((N,j,I,_)=>{l(N===void 0?null:N,j,I,_)},[l]),w=f.useCallback(N=>{l(N,m.path,void 0,m==null?void 0:m[tl])},[l,m]),S={...e,formData:s,fieldPathId:m,onSelectChange:w},C={...e,handleAddItem:g,handleCopyItem:y,handleRemoveItem:x,handleReorderItems:v,keyedFormData:p,onChange:b};if(!(UT in t)){if(!c.useFallbackUiForUnsupportedType){const j=qo(n),I=Pi("UnsupportedFieldTemplate",i,j);return a.jsx(I,{schema:t,fieldPathId:o,reason:d(qa.MissingItems),registry:i})}const N={...t,[UT]:{type:void 0}};S.schema=N,C.schema=N}return u.isMultiSelect(S.schema)?a.jsx(PLr,{...S}):x1t(n)?a.jsx(ALr,{...S}):Wwe(S.schema)?a.jsx(MLr,{...C}):u.isFilesArray(S.schema,n)?a.jsx(TLr,{...S}):a.jsx(kLr,{...C})}function $Lr(e){const{schema:t,name:n,uiSchema:r,fieldPathId:o,formData:i,registry:s,required:l,disabled:c,readonly:u,hideError:d,autofocus:p,title:h,onChange:m,onFocus:g,onBlur:y,rawErrors:x}=e,{title:v}=t,{widgets:b,translateString:w,globalUiOptions:S}=s,{widget:C="checkbox",title:N,label:j=!0,enumNames:I,..._}=qo(r,S),T=Sb(t,C,b),P=w(qa.YesLabel),E=w(qa.NoLabel);let M;const R=N??v??h??n;if(Array.isArray(t.oneOf))M=qT({oneOf:t.oneOf.map(D=>{if(Aa(D))return{...D,title:D.title||(D.const===!0?P:E)}}).filter(D=>D)},r);else{const D=t.enum??[!0,!1];!I&&D.length===2&&D.every(z=>typeof z=="boolean")?M=[{value:D[0],label:D[0]?P:E},{value:D[1],label:D[1]?P:E}]:M=qT({enum:D},r)}const $=f.useCallback((D,z,V)=>m(D,o.path,z,V),[m,o]);return a.jsx(T,{options:{..._,enumOptions:M},schema:t,uiSchema:r,id:o.$id,name:n,onChange:$,onFocus:g,onBlur:y,label:R,hideLabel:!j,value:i,required:l,disabled:c,readonly:u,hideError:d,registry:s,autofocus:p,rawErrors:x,htmlName:o.name})}function DLr(e){return{type:"string",enum:["string","number","boolean","object","array"],default:"string",title:e}}function LLr(e){const t=typeof e;return t==="string"||t==="number"||t==="boolean"?t:t==="object"?Array.isArray(e)?"array":"object":"string"}function FLr(e,t){switch(t){case"string":return String(e);case"number":{const n=Number(e);return isNaN(n)?0:n}case"boolean":return!!e;default:return e}}function zLr(e){const{id:t,formData:n,displayLabel:r=!0,schema:o,name:i,uiSchema:s,required:l,disabled:c=!1,readonly:u=!1,onBlur:d,onFocus:p,registry:h,fieldPathId:m,onChange:g,errorSchema:y}=e,{translateString:x,fields:v,globalFormOptions:b}=h,[w,S]=f.useState(LLr(n)),C=qo(s),N=I5(U0("__internal_type_selector",b,m)),j=x(qa.Type),I=f.useMemo(()=>DLr(j),[j]),_=E=>{E!=null&&(S(E),g(FLr(n,E),m.path,y,t))};if(!b.useFallbackUiForUnsupportedType){const{reason:E=x(qa.UnknownFieldType,[String(o.type)])}=e,M=Pi("UnsupportedFieldTemplate",h,C);return a.jsx(M,{schema:o,fieldPathId:m,reason:E,registry:h})}const T=Pi("FallbackFieldTemplate",h,C),{SchemaField:P}=v;return a.jsx(T,{schema:o,registry:h,typeSelector:a.jsx(P,{fieldPathId:N,name:`${i}__fallback_type`,schema:I,formData:w,onChange:_,onBlur:d,onFocus:p,registry:h,hideLabel:!r,disabled:c,readonly:u,required:l},n?Vv(n):"__empty__"),schemaField:a.jsx(P,{...e,schema:{type:w,title:x(qa.Value),...w==="object"&&{additionalProperties:!0}}})})}function BLr(e,t){return x4(t,function(n){return e[n]})}function HLr(e){return e==null?[]:BLr(e,Wx(e))}var VLr=Math.max;function ULr(e,t,n,r){e=C5(e)?e:HLr(e),n=n?Ebt(n):0;var o=e.length;return n<0&&(n=VLr(o+n,0)),UC(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&Bbt(e,t,n)>-1}var WLr=Math.min;function GLr(e,t,n){for(var r=zwe,o=e[0].length,i=e.length,s=i,l=Array(i),c=1/0,u=[];s--;){var d=e[s];c=WLr(d.length,c),l[s]=o>=120&&d.length>=120?new FI(s&&d):void 0}d=e[0];var p=-1,h=l[0];e:for(;++p0;case r3.NONE:return Uze(r,o).length===0;default:return!1}}function gX(e,t,n){let r={},o=e[t];if(VC(o)){const{children:i,className:s,...l}=o;if(o=i,s){const u=s.split(" ").map(d=>Jwe(n,d,d)).join(" ");r={...l,className:u}}else r=l}if(!Array.isArray(o))throw new TypeError(`Expected array for "${t}" in ${JSON.stringify(e)}`);return{children:o,gridProps:r}}function Gze(e,t,n){let r;if(YLr(n)&&e&&(e==null?void 0:e.type)==="array"&&sa(e,UT)){const o=Number(n),i=e[UT];Array.isArray(i)?o>i.length?r=Qbt(i):r=i[o]:r=i,t={[tl]:t[tl],path:[...t.path.slice(0,t.path.length-1),o]}}return{rawSchema:r,fieldPathId:t}}function JLr(e,t,n,r,o){const{schemaUtils:i,globalFormOptions:s}=e;let l=n,c=o;const u=t.split("."),d=u.pop();let p=i.retrieveSchema(l,r),h=r,m=p.readOnly;u.forEach(x=>{if(c=U0(x,s,c),sa(p,Ga))l=cr(p,[Ga,x],{});else if(p&&(sa(p,$i)||sa(p,Sa))){const v=sa(p,$i)?$i:Sa,b=i.findSelectedOptionInXxxOf(p,x,v,h);l=cr(b,[Ga,x],{})}else{const v=Gze(p,c,x);l=v.rawSchema??{},c=v.fieldPathId}h=cr(h,x,{}),p=i.retrieveSchema(l,h),m=Wze(p.readOnly,m)});let g,y=!1;if(Lu(p)&&(p=void 0),p&&d){if(p&&(sa(p,$i)||sa(p,Sa))){const v=sa(p,$i)?$i:Sa;p=i.findSelectedOptionInXxxOf(p,d,v,h)}c=U0(d,s,c),y=p!==void 0&&Array.isArray(p.required)&&ULr(p.required,d);const x=Gze(p,c,d);if(x.rawSchema?(p=x.rawSchema,c=x.fieldPathId):(p=cr(p,[Ga,d]),p=p&&i.retrieveSchema(p)),m=Wze(p==null?void 0:p.readOnly,m),p&&(sa(p,$i)||sa(p,Sa))){const v=sa(p,$i)?$i:Sa,b=wb(p);g={options:p[v],hasDiscriminator:!!b}}}return{schema:p,isRequired:y,isReadonly:m,optionsInfo:g,fieldPathId:c}}function ZLr(e,t){let n=e;return UC(n)&&(n=Jwe(t,n)),V6(n)?n:null}function e6r(e,t){let n,r=null,o={},i;if(UC(t)||D1t(t))n=t??"";else{const{name:s="",render:l,...c}=t;n=s,o=c,Lu(o)||jLr(o,(u,d)=>{if(UC(u)){const p=KLr.exec(u);if(Array.isArray(p)&&p.length>1){const h=p[1];o[d]=Jwe(e,h,h)}}}),r=ZLr(l,e),!s&&r&&(i=a.jsx(r,{...c,"data-testid":mC.uiComponent}))}return{name:n,UIComponent:r,uiProps:o,rendered:i}}function xX(e){const{childrenLayoutGridSchemaId:t,...n}=e,{registry:r,schema:o,formData:i}=n,{schemaUtils:s}=r,l=s.retrieveSchema(o,i);return t.map(c=>f.createElement(tSe,{...n,key:`layoutGrid-${Vv(c)}`,schema:l,layoutGridSchema:c}))}function t6r(e){const{layoutGridSchema:t,...n}=e,{formData:r,registry:o}=n,{children:i,gridProps:s}=gX(t,Uv.CONDITION,o),{operator:l,field:c="",value:u}=s,d=cr(r,c,null);return QLr(l,d,u)?a.jsx(xX,{...n,childrenLayoutGridSchemaId:i}):null}function n6r(e){const{layoutGridSchema:t,...n}=e,{registry:r,uiSchema:o}=n,{children:i,gridProps:s}=gX(t,Uv.COLUMN,r),l=qo(o),c=Pi("GridTemplate",r,l);return a.jsx(c,{column:!0,"data-testid":mC.col,...s,children:a.jsx(xX,{...n,childrenLayoutGridSchemaId:i})})}function r6r(e){const{layoutGridSchema:t,...n}=e,{registry:r,uiSchema:o}=n,{children:i,gridProps:s}=gX(t,Uv.COLUMNS,r),l=qo(o),c=Pi("GridTemplate",r,l);return i.map(u=>a.jsx(c,{column:!0,"data-testid":mC.col,...s,children:a.jsx(xX,{...n,childrenLayoutGridSchemaId:[u]})},`column-${Vv(u)}`))}function o6r(e){const{layoutGridSchema:t,...n}=e,{registry:r,uiSchema:o}=n,{children:i,gridProps:s}=gX(t,Uv.ROW,r),l=qo(o),c=Pi("GridTemplate",r,l);return a.jsx(c,{...s,"data-testid":mC.row,children:a.jsx(xX,{...n,childrenLayoutGridSchemaId:i})})}function i6r(e){const{gridSchema:t,schema:n,uiSchema:r,errorSchema:o,fieldPathId:i,onBlur:s,onFocus:l,formData:c,readonly:u,registry:d,layoutGridSchema:p,...h}=e,{onChange:m}=h,{fields:g}=d,{SchemaField:y,LayoutMultiSchemaField:x}=g,v=e6r(d,t),{name:b,UIComponent:w,uiProps:S}=v,{schema:C,isRequired:N,isReadonly:j,optionsInfo:I,fieldPathId:_}=JLr(d,b,n,c,i),T=I5(_);if(v.rendered)return v.rendered;if(C){const P=I!=null&&I.hasDiscriminator?x:y,{fieldUiSchema:E,uiReadonly:M}=XLr(b,S,r,j,u);return a.jsx(P,{"data-testid":I!=null&&I.hasDiscriminator?mC.layoutMultiSchemaField:mC.field,...h,name:b,required:N,readonly:M,schema:C,uiSchema:E,errorSchema:cr(o,b),fieldPathId:T,formData:cr(c,b),onChange:m,onBlur:s,onFocus:l,options:I==null?void 0:I.options,registry:d})}return w?a.jsx(w,{"data-testid":mC.uiComponent,...h,name:b,required:N,formData:c,readOnly:!!j||u,errorSchema:o,uiSchema:r,schema:n,fieldPathId:i,onBlur:s,onFocus:l,registry:d,...S}):null}function tSe(e){const{uiSchema:t}=e;let{layoutGridSchema:n}=e;const r=qo(t);if(!n&&Fre in r&&Aa(r[Fre])&&(n=r[Fre]),Aa(n)){if(Uv.ROW in n)return a.jsx(o6r,{...e,layoutGridSchema:n});if(Uv.COLUMN in n)return a.jsx(n6r,{...e,layoutGridSchema:n});if(Uv.COLUMNS in n)return a.jsx(r6r,{...e,layoutGridSchema:n});if(Uv.CONDITION in n)return a.jsx(t6r,{...e,layoutGridSchema:n})}return a.jsx(i6r,{...e,gridSchema:n})}tSe.TEST_IDS=mC;function a6r(e){const{fieldPathId:t,title:n,schema:r,uiSchema:o,required:i,registry:s,name:l}=e,c=qo(o,s.globalUiOptions),{title:u}=c,{title:d}=r,p=u||n||d||l;if(!p)return null;const h=Pi("TitleFieldTemplate",s,c);return a.jsx(h,{id:Qwe(t),title:p,required:i,schema:r,uiSchema:o,registry:s})}function zre(e,t,n){const r="!@#!@$@#$!@$#";return e.map(({schema:i})=>i).find(i=>{const s=cr(i,[Ga,t]);return cr(s,aX,cr(s,B0,r))===n})}function qze(e,t,n,r,o){const i=t.map(c=>n.retrieveSchema(c,o));let s=e;sa(e,$i)?s={...e,[$i]:i}:sa(e,Sa)&&(s={...e,[Sa]:i});const l=qT(s,r);if(!l)throw new Error(`No enumOptions were computed from the schema ${JSON.stringify(s)}`);return l}function s6r(e){var oe;const{name:t,baseType:n,disabled:r=!1,formData:o,fieldPathId:i,onBlur:s,onChange:l,options:c,onFocus:u,registry:d,uiSchema:p,schema:h,autofocus:m,readonly:g,required:y,errorSchema:x,hideError:v=!1}=e,{widgets:b,schemaUtils:w,globalUiOptions:S}=d,[C,N]=f.useState(qze(h,c,w,p,o)),j=cr(i,tl),I=wb(h),_=Pi("FieldErrorTemplate",d,c),T=Pi("FieldTemplate",d,c),P=Vv(h),E=Vv(c),M=p?Vv(p):"",R=o?Vv(o):"";f.useEffect(()=>{N(qze(h,c,w,p,o))},[P,E,w,M,R]);const{widget:$=I?"radio":"select",title:D="",placeholder:z="",optionsSchemaSelector:V=I,hideError:B,...G}=qo(p);if(!V)throw new Error("No selector field provided for the LayoutMultiSchemaField");const H=cr(o,V);let F=cr((oe=C[0])==null?void 0:oe.schema,[Ga,V],{});const W=zre(C,V,H);F=F!=null&&F.type?F:{...F,type:(W==null?void 0:W.type)||n};const U=Sb(F,$,b),K=B===void 0?v:!!B,X=cr(x,[Ff],[]),J=ID(x,[Ff]),te=w.getDisplayLabel(h,p,S),re=ue=>{const fe=zre(C,V,ue),se=zre(C,V,H);let ge=w.sanitizeDataForNewSchema(fe,se,o);ge&&fe&&(ge=w.getDefaultFormState(fe,ge,"excludeObjectChildren")),ge&&zs(ge,V,ue),l(ge,i.path,void 0,j)},ce={enumOptions:C,...G},ae=!K&&X.length>0?a.jsx(_,{fieldPathId:i,schema:h,errors:X,registry:d}):void 0;return a.jsx(T,{fieldPathId:i,id:j,schema:h,label:(D||h.title)??"",disabled:r||Array.isArray(C)&&Lu(C),uiSchema:p,required:y,readonly:!!g,registry:d,displayLabel:te,errors:ae,onChange:l,onKeyRename:ZB,onKeyRenameBlur:ZB,onRemoveProperty:ZB,children:a.jsx(U,{id:j,name:t,schema:h,label:(D||h.title)??"",disabled:r||Array.isArray(C)&&Lu(C),uiSchema:p,autofocus:m,readonly:g,required:y,registry:d,multiple:!1,rawErrors:X,hideError:K,hideLabel:!te,errorSchema:J,placeholder:z,onChange:re,onBlur:s,onFocus:u,value:H,options:ce,htmlName:i.name})})}class Kze extends f.Component{constructor(n){super(n);ze(this,"onOptionChange",n=>{const{selectedOption:r,retrievedOptions:o}=this.state,{formData:i,onChange:s,registry:l,fieldPathId:c}=this.props,{schemaUtils:u}=l,d=n!==void 0?parseInt(n,10):-1;if(d===r)return;const p=d>=0?o[d]:void 0,h=r>=0?o[r]:void 0;let m=u.sanitizeDataForNewSchema(p,h,i);p&&(m=u.getDefaultFormState(p,m,"excludeObjectChildren")),this.setState({selectedOption:d},()=>{s(m,c.path,void 0,this.getFieldId())})});const{formData:r,options:o,registry:{schemaUtils:i}}=this.props,s=o.map(l=>i.retrieveSchema(l,r));this.state={retrievedOptions:s,selectedOption:this.getMatchingOption(0,r,s)}}componentDidUpdate(n,r){const{formData:o,options:i,fieldPathId:s}=this.props,{selectedOption:l}=this.state;let c=this.state;if(!_l(n.options,i)){const{registry:{schemaUtils:u}}=this.props,d=i.map(p=>u.retrieveSchema(p,o));c={selectedOption:l,retrievedOptions:d}}if(!_l(o,n.formData)&&s.$id===n.fieldPathId.$id){const{retrievedOptions:u}=c,d=this.getMatchingOption(l,o,u);r&&d!==l&&(c={selectedOption:d,retrievedOptions:u})}c!==this.state&&this.setState(c)}getMatchingOption(n,r,o){const{schema:i,registry:{schemaUtils:s}}=this.props,l=wb(i);return s.getClosestMatchingOption(r,o,n,l)}getFieldId(){const{fieldPathId:n,schema:r}=this.props;return`${n.$id}${r.oneOf?"__oneof_select":"__anyof_select"}`}render(){const{name:n,disabled:r=!1,errorSchema:o={},formData:i,onBlur:s,onFocus:l,readonly:c,required:u=!1,registry:d,schema:p,uiSchema:h}=this.props,{widgets:m,fields:g,translateString:y,globalUiOptions:x,schemaUtils:v}=d,{SchemaField:b}=g,w=Pi("MultiSchemaFieldTemplate",d,x),S=X6(d,p,u,h),C=b4(i),{selectedOption:N,retrievedOptions:j}=this.state,{widget:I="select",placeholder:_,autofocus:T,autocomplete:P,title:E=p.title,...M}=qo(h,x),R=Sb({type:"number"},I,m),$=cr(o,Ff,[]),D=ID(o,[Ff]),z=v.getDisplayLabel(p,h,x),V=N>=0&&j[N]||null;let B;if(V){const{required:J}=p;B=J?Aw({required:J},V):V}let G=[];$i in p&&h&&$i in h?Array.isArray(h[$i])?G=h[$i]:console.warn(`uiSchema.oneOf is not an array for "${E||n}"`):Sa in p&&h&&Sa in h&&(Array.isArray(h[Sa])?G=h[Sa]:console.warn(`uiSchema.anyOf is not an array for "${E||n}"`));let H=h;N>=0&&G.length>N&&(H=G[N]);const F=E?qa.TitleOptionPrefix:qa.OptionPrefix,W=E?[E]:[],U=j.map((J,te)=>{const{title:re=J.title}=qo(G[te]);return{label:re||y(F,W.concat(String(te+1))),value:te}}),K=!S||C?a.jsx(R,{id:this.getFieldId(),name:`${n}${p.oneOf?"__oneof_select":"__anyof_select"}`,schema:{type:"number",default:0},onChange:this.onOptionChange,onBlur:s,onFocus:l,disabled:r||Lu(U),multiple:!1,rawErrors:$,errorSchema:D,value:N>=0?N:void 0,options:{enumOptions:U,...M},registry:d,placeholder:_,autocomplete:P,autofocus:T,label:E??n,hideLabel:!z,readonly:c}):void 0,X=B&&B.type!=="null"&&a.jsx(b,{...this.props,schema:B,uiSchema:H})||null;return a.jsx(w,{schema:p,registry:d,uiSchema:h,selector:K,optionSchemaField:X})}}const l6r=/\.([0-9]*0)*$/,c6r=/[0.]0*$/;function u6r(e){const{registry:t,onChange:n,formData:r,value:o}=e,[i,s]=f.useState(o),{StringField:l}=t.fields;let c=r;const u=f.useCallback((d,p,h,m)=>{s(d),`${d}`.charAt(0)==="."&&(d=`0${d}`);const g=typeof d=="string"&&d.match(l6r)?z9e(d.replace(c6r,"")):z9e(d);n(g,p,h,m)},[n]);if(typeof i=="string"&&typeof c=="number"){const d=new RegExp(`^(${String(c).replace(".","\\.")})?\\.?0*$`);i.match(d)&&(c=i)}return a.jsx(l,{...e,formData:c,onChange:u})}function Nv(){return Nv=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)e[r]!=="\\"?(e[r]==="["&&n++,e[r]==="]"&&n--,r++):r+=2;if(n===0&&r0;)e[r]!=="\\"?(e[r]==="("&&o===")"&&i++,e[r]===o&&i--,r++):r+=2;if(i===0)return r}return-1}function f6r(e,t){if(!t||!t.inline&&!t.simple)return null;var n=e[0];if(n!=="*"&&n!=="_"&&n!=="~"&&n!=="=")return null;for(var r="",o=0,i="",s=0;s<6;s++){var l=Yze[s][0];if(e.startsWith(l)&&e.length>=2*l.length){r=l,o=l.length,i=Yze[s][1];break}}if(!r)return null;for(var c=o,u=!1,d=!1,p="",h=0,m="",g=!1,y="";c"&&(d=!1),y=x,c++;else if(x!=="<"||u){if(x===` `&&y===` `&&!u&&h===0)return null;if(!u&&h===0){for(var b=0;c+b=o&&(o!==1||r!=="*"&&r!=="_"||e[c-1]!==r&&e[c+1]!==r)){var w=[e.slice(0,c+b),i,m+e.slice(c+o,c+b)];return w.index=0,w.input=e,w}}m+=x,y=x,c++}else{var S=e[c+1],C=e.indexOf(">",c);if(C!==-1){var N=e.slice(c,C+1).endsWith("/>");S==="/"?h=Math.max(0,h-1):N||h++}d=!0,m+=x,y=x,c++}}else u=!u,m+=x,y=x,c++;else m+=x,g=!0,y=x,c++}return null}const p6r=["children","options"],Xze=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce((e,t)=>(e[t.toLowerCase()]=t,e),{class:"className",for:"htmlFor"}),Qze={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},h6r=["style","script","pre"],m6r=["src","href","data","formAction","srcDoc","action"],g6r=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,x6r=/\n{2,}$/,Jze=/^(\s*>[\s\S]*?)(?=\n\n|$)/,y6r=/^ *> ?/gm,v6r=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,b6r=/^ {2,}\n/,w6r=/^(?:([-*_])( *\1){2,}) *(?:\n *)+\n/,Zze=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,eBe=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,S6r=/^(`+)((?:\\`|(?!\1)`|[^`])+)\1/,C6r=/^(?:\n *)*\n/,N6r=/\r\n?/g,j6r=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,E6r=/^\[\^([^\]]+)]/,I6r=/\f/g,_6r=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,P6r=/^\[(x|\s)\]/,tBe=/^(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,nBe=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,rBe=/^([^\n]+)\n *(=|-)\2{2,} *\n/,nSe=/^<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>/i;function A6r(e){const t=nSe.exec(e);if(!t)return null;const n=t[1],r=n.toLowerCase(),o=r.length+1;let i=t[0].length;e[i]===` `&&i++;const s=i;let l=i,c=1;const u=e.length;for(;c>0;){const p=e.indexOf("<",i);if(p===-1)return null;let h=-1,m=-1;if(e[p+1]==="/")m=p;else if(e[p+1]===r[0]||e[p+1]===n[0]){let g=!0;for(let y=0;y"||(h=p)}if(h!==-1||m!==-1)if(h!==-1&&(m===-1||hu)return null;let y=!0;for(let x=0;x=u||e[g]!==">"){i=g;continue}l=m,i=g+1,c--}else i=p+1}let d=0;for(;i+d)/,k6r=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,she=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,M6r=/^\{.*\}$/,R6r=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,O6r=/^<([^ >]+[:@\/][^ >]+)>/,$6r=/-([a-z])?/gi,iBe=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,D6r=/^[^\n]+(?: \n|\n{2,})/,L6r=/^\[([^\]]*)\]:\s+]+)>?\s*("([^"]*)")?/,F6r=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,z6r=/^\[([^\]]*)\] ?\[([^\]]*)\]/,B6r=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,H6r=/\t/g,V6r=/(^ *\||\| *$)/g,U6r=/^ *:-+: *$/,W6r=/^ *:-+ *$/,G6r=/^ *-+: *$/,q6r=/^(:[a-zA-Z0-9-_]+:)/,K6r=/^\\([^0-9A-Za-z\s])/,Y6r=/\\([^0-9A-Za-z\s])/g,X6r=/^[\s\S](?:(?! \n|[0-9]\.|http)[^=*_~\-\n:<`\\\[!])*/,Q6r=/^\n+/,J6r=/^([ \t]*)/,Z6r=/(?:^|\n)( *)$/,rSe="(?:\\d+\\.)",oSe="(?:[*+-])";function L1t(e){return"( *)("+(e===1?rSe:oSe)+") +"}const F1t=L1t(1),z1t=L1t(2);function B1t(e){return RegExp("^"+(e===1?F1t:z1t))}const e8r=B1t(1),t8r=B1t(2);function H1t(e){return RegExp("^"+(e===1?F1t:z1t)+"[^\\n]*(?:\\n(?!\\1"+(e===1?rSe:oSe)+" )[^\\n]*)*(\\n|$)","gm")}const n8r=H1t(1),r8r=H1t(2);function V1t(e){const t=e===1?rSe:oSe;return RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const U1t=V1t(1),W1t=V1t(2);function aBe(e,t){const n=t===1,r=n?U1t:W1t,o=n?n8r:r8r,i=n?e8r:t8r;return{t:s=>i.test(s),o:K2(function(s,l){const c=Z6r.exec(l.prevCapture);return c&&(l.list||!l.inline&&!l.simple)?r.exec(s=c[1]+s):null}),u:1,i(s,l,c){const u=n?+s[2]:void 0,d=s[0].replace(x6r,` `).match(o),p=i.exec(d[0]),h=RegExp("^ {1,"+(p?p[0].length:0)+"}","gm");let m=!1;return{items:d.map(function(g,y){const x=g.replace(h,"").replace(i,""),v=y===d.length-1,b=iv(x,` `)||v&&m;m=b;const w=c.inline,S=c.list;let C;c.list=!0,b?(c.inline=!1,C=o3(x)+` `):(c.inline=!0,C=o3(x));const N=l(C,c);return c.inline=w,c.list=S,N}),ordered:n,start:u}}}}const o8r=RegExp(`^\\[((?:\\[[^\\[\\]]*(?:\\[[^\\[\\]]*\\][^\\[\\]]*)*\\]|[^\\[\\]])*)\\]\\(\\s*?(?:\\s+['"]([\\s\\S]*?)['"])?\\s*\\)`),i8r=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/;function sBe(e){return typeof e=="string"}function o3(e){let t=e.length;for(;t>0&&e[t-1]<=" ";)t--;return e.slice(0,t)}function lhe(e,t){return e.startsWith(t)}function iv(e,t){return e.indexOf(t)!==-1}function a8r(e,t,n){if(Array.isArray(n)){for(let r=0;r{c.trim()==="|"&&(l(),r)?u!==0&&u!==d.length-1&&i.push([]):s+=c}),l(),n.inTable=o,i}function l8r(e,t,n){n.inline=!0;const r=e[2]?e[2].replace(V6r,"").split("|").map(s8r):[],o=e[3]?(function(s,l,c){return s.trim().split(` `).map(function(u){return lBe(u,l,c,!0)})})(e[3],t,n):[],i=lBe(e[1],t,n,!!o.length);return n.inline=!1,o.length?{align:r,cells:o,header:i,type:"25"}:{children:i,type:"21"}}function cBe(e,t){return e.align[t]==null?{}:{textAlign:e.align[t]}}function K2(e){return e.inline=1,e}function $S(e){return K2(function(t,n){return n.inline?e.exec(t):null})}function v9(e){return K2(function(t,n){return n.inline||n.simple?e.exec(t):null})}function i1(e){return function(t,n){return n.inline||n.simple?null:e.exec(t)}}function uBe(e){return K2(function(t){return e.exec(t)})}const c8r=/(javascript|vbscript|data(?!:image)):/i;function u8r(e){try{const t=decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"");if(c8r.test(t))return null}catch{return null}return e}function uv(e){return e&&e.replace(Y6r,"$1")}function oH(e,t,n){const r=n.inline||!1,o=n.simple||!1;n.inline=!0,n.simple=!0;const i=e(t,n);return n.inline=r,n.simple=o,i}function d8r(e,t,n){const r=n.inline||!1,o=n.simple||!1;n.inline=!1,n.simple=!0;const i=e(t,n);return n.inline=r,n.simple=o,i}function f8r(e,t,n){const r=n.inline||!1;n.inline=!1;const o=e(t,n);return n.inline=r,o}const p8r=(e,t,n)=>({children:oH(t,e[2],n)});function Bre(){return{}}function h8r(...e){return e.filter(Boolean).join(" ")}function Hre(e,t,n){let r=e;const o=t.split(".");for(;o.length&&(r=r[o[0]],r!==void 0);)o.shift();return r||n}function Vre(e,t,n,r){if(!t||!t.trim())return null;const o=t.match(g6r);return o?o.reduce(function(i,s){const l=s.indexOf("=");if(l!==-1){const c=(function(p){return p.indexOf("-")!==-1&&p.match(k6r)===null&&(p=p.replace($6r,function(h,m){return m.toUpperCase()})),p})(s.slice(0,l)).trim(),u=Xze[c]||c;if(u==="ref")return i;const d=i[u]=(function(p,h,m,g){return h==="style"?(function(y){const x=[];if(!y)return x;let v="",b=0,w="";for(let C=0;C0)b--;else if(N===";"&&b===0){const j=v.indexOf(":");j>0&&x.push([v.slice(0,j).trim(),v.slice(j+1).trim()]),v="";continue}v+=N}const S=v.indexOf(":");return S>0&&x.push([v.slice(0,S).trim(),v.slice(S+1).trim()]),x})(m).reduce(function(y,[x,v]){return y[x.replace(/(-[a-z])/g,b=>b[1].toUpperCase())]=g(v,p,x),y},{}):m6r.indexOf(h)!==-1?g(uv(m),p,h):(m.match(M6r)&&(m=uv(m.slice(1,m.length-1))),m==="true"||m!=="false"&&m)})(e,c,(function(p){const h=p[0];return(h==='"'||h==="'")&&p.length>=2&&p[p.length-1]===h?p.slice(1,-1):p})(s.slice(l+1).trim()),n);typeof d=="string"&&(nSe.test(d)||she.test(d))&&(i[u]=r(d.trim()))}else s!=="style"&&(i[Xze[s]||s]=!0);return i},{}):null}function dBe(e,t){for(let n=0;n1||t.forceWrapper)w=v;else{if(v.length===1)return w=v[0],typeof w=="string"?l("span",{key:"outer"},w):w;w=null}return o(b,Nv({key:"outer"},t.wrapperProps),w)}const u=[],d={},p={0:{t:[">"],o:i1(Jze),u:1,i(g,y,x){const[,v,b]=g[0].replace(y6r,"").match(v6r);return{alert:v,children:y(b,x)}}},1:{t:[" "],o:$S(b6r),u:1,i:Bre},2:{t:function(g,y){if(y.inline||y.simple)return!1;var x=g[0];return x==="-"||x==="*"||x==="_"},o:i1(w6r),u:1,i:Bre},3:{t:[" "],o:i1(eBe),u:0,i:g=>({lang:void 0,text:uv(o3(g[0].replace(/^ {4}/gm,"")))})},4:{t:["```","~~~"],o:i1(Zze),u:0,i:g=>({attrs:Vre("code",g[3]||"",r,c),lang:g[2]||void 0,text:g[4],type:"3"})},5:{t:["`"],o:v9(S6r),u:3,i:g=>({text:uv(g[2])})},6:{t:["[^"],o:i1(j6r),u:0,i:g=>(u.push({footnote:g[2],identifier:g[1]}),{})},7:{t:["[^"],o:$S(E6r),u:1,i:g=>({target:"#"+n(g[1],YM),text:g[1]})},8:{t:["[ ]","[x]"],o:$S(P6r),u:1,i:g=>({completed:g[1].toLowerCase()==="x"})},9:{t:["#"],o:i1(t.enforceAtxHeadings?nBe:tBe),u:1,i:(g,y,x)=>({children:oH(y,g[2],x),id:n(g[2],YM),level:g[1].length})},10:{t:g=>{const y=g.indexOf(` `);return y>0&&y({children:oH(y,g[1],x),level:g[2]==="="?1:2,type:"9"})},11:{t:["<"],o:K2(A6r),u:1,i(g,y,x){const[,v]=g[3].match(J6r),b=RegExp("^"+v,"gm"),w=g[3].replace(b,""),S=dBe(s,w)?f8r:oH,C=g[1].toLowerCase(),N=h6r.indexOf(C)!==-1,j=(N?C:g[1]).trim(),I={attrs:Vre(j,g[2],r,c),noInnerParse:N,tag:j};if(x.inAnchor=x.inAnchor||C==="a",N)I.text=g[3];else{const _=x.inHTML;x.inHTML=!0,I.children=S(y,w,x),x.inHTML=_}return x.inAnchor=!1,I}},13:{t:["<"],o:uBe(she),u:1,i(g){const y=g[1].trim();return{attrs:Vre(y,g[2]||"",r,c),tag:y}}},12:{t:["