diff --git a/美国版/Food Labeling Management Platform/build/assets/index-1_5dt1NK.js b/美国版/Food Labeling Management Platform/build/assets/index-1_5dt1NK.js new file mode 100644 index 0000000..5a7222a --- /dev/null +++ b/美国版/Food Labeling Management Platform/build/assets/index-1_5dt1NK.js @@ -0,0 +1,453 @@ +function u8(e,t){for(var r=0;rn[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var Rf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var dy={exports:{}},Ic={},fy={exports:{}},nt={};/** + * @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 ZC;function d8(){if(ZC)return nt;ZC=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(I){return I===null||typeof I!="object"?null:(I=p&&I[p]||I["@@iterator"],typeof I=="function"?I:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,y={};function S(I,D,J){this.props=I,this.context=D,this.refs=y,this.updater=J||v}S.prototype.isReactComponent={},S.prototype.setState=function(I,D){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,D,"setState")},S.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function j(){}j.prototype=S.prototype;function N(I,D,J){this.props=I,this.context=D,this.refs=y,this.updater=J||v}var E=N.prototype=new j;E.constructor=N,x(E,S.prototype),E.isPureReactComponent=!0;var A=Array.isArray,C=Object.prototype.hasOwnProperty,O={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function R(I,D,J){var ae,ie={},ne=null,X=null;if(D!=null)for(ae in D.ref!==void 0&&(X=D.ref),D.key!==void 0&&(ne=""+D.key),D)C.call(D,ae)&&!T.hasOwnProperty(ae)&&(ie[ae]=D[ae]);var Y=arguments.length-2;if(Y===1)ie.children=J;else if(1>>1,D=$[I];if(0>>1;Ia(ie,k))nea(X,ie)?($[I]=X,$[ne]=k,I=ne):($[I]=ie,$[ae]=k,I=ae);else if(nea(X,k))$[I]=X,$[ne]=k,I=ne;else break e}}return Z}function a($,Z){var k=$.sortIndex-Z.sortIndex;return k!==0?k:$.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var d=[],c=[],h=1,p=null,m=3,v=!1,x=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E($){for(var Z=r(c);Z!==null;){if(Z.callback===null)n(c);else if(Z.startTime<=$)n(c),Z.sortIndex=Z.expirationTime,t(d,Z);else break;Z=r(c)}}function A($){if(y=!1,E($),!x)if(r(d)!==null)x=!0,H(C);else{var Z=r(c);Z!==null&&U(A,Z.startTime-$)}}function C($,Z){x=!1,y&&(y=!1,j(R),R=-1),v=!0;var k=m;try{for(E(Z),p=r(d);p!==null&&(!(p.expirationTime>Z)||$&&!F());){var I=p.callback;if(typeof I=="function"){p.callback=null,m=p.priorityLevel;var D=I(p.expirationTime<=Z);Z=e.unstable_now(),typeof D=="function"?p.callback=D:p===r(d)&&n(d),E(Z)}else n(d);p=r(d)}if(p!==null)var J=!0;else{var ae=r(c);ae!==null&&U(A,ae.startTime-Z),J=!1}return J}finally{p=null,m=k,v=!1}}var O=!1,T=null,R=-1,L=5,q=-1;function F(){return!(e.unstable_now()-q$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(d)},e.unstable_next=function($){switch(m){case 1:case 2:case 3:var Z=3;break;default:Z=m}var k=m;m=Z;try{return $()}finally{m=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,Z){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var k=m;m=$;try{return Z()}finally{m=k}},e.unstable_scheduleCallback=function($,Z,k){var I=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0I?($.sortIndex=k,t(c,$),r(d)===null&&$===r(c)&&(y?(j(R),R=-1):y=!0,U(A,k-I))):($.sortIndex=D,t(d,$),x||v||(x=!0,H(C))),$},e.unstable_shouldYield=F,e.unstable_wrapCallback=function($){var Z=m;return function(){var k=m;m=Z;try{return $.apply(this,arguments)}finally{m=k}}}})(my)),my}var aE;function m8(){return aE||(aE=1,py.exports=p8()),py.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 iE;function g8(){if(iE)return Hr;iE=1;var e=lm(),t=m8();function r(l){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+l,g=1;g"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,c=/^[: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]*$/,h={},p={};function m(l){return d.call(p,l)?!0:d.call(h,l)?!1:c.test(l)?p[l]=!0:(h[l]=!0,!1)}function v(l,f,g,w){if(g!==null&&g.type===0)return!1;switch(typeof f){case"function":case"symbol":return!0;case"boolean":return w?!1:g!==null?!g.acceptsBooleans:(l=l.toLowerCase().slice(0,5),l!=="data-"&&l!=="aria-");default:return!1}}function x(l,f,g,w){if(f===null||typeof f>"u"||v(l,f,g,w))return!0;if(w)return!1;if(g!==null)switch(g.type){case 3:return!f;case 4:return f===!1;case 5:return isNaN(f);case 6:return isNaN(f)||1>f}return!1}function y(l,f,g,w,_,P,M){this.acceptsBooleans=f===2||f===3||f===4,this.attributeName=w,this.attributeNamespace=_,this.mustUseProperty=g,this.propertyName=l,this.type=f,this.sanitizeURL=P,this.removeEmptyString=M}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(l){S[l]=new y(l,0,!1,l,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(l){var f=l[0];S[f]=new y(f,1,!1,l[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(l){S[l]=new y(l,2,!1,l.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(l){S[l]=new y(l,2,!1,l,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(l){S[l]=new y(l,3,!1,l.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(l){S[l]=new y(l,3,!0,l,null,!1,!1)}),["capture","download"].forEach(function(l){S[l]=new y(l,4,!1,l,null,!1,!1)}),["cols","rows","size","span"].forEach(function(l){S[l]=new y(l,6,!1,l,null,!1,!1)}),["rowSpan","start"].forEach(function(l){S[l]=new y(l,5,!1,l.toLowerCase(),null,!1,!1)});var j=/[\-:]([a-z])/g;function N(l){return l[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(l){var f=l.replace(j,N);S[f]=new y(f,1,!1,l,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(l){var f=l.replace(j,N);S[f]=new y(f,1,!1,l,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(l){var f=l.replace(j,N);S[f]=new y(f,1,!1,l,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(l){S[l]=new y(l,1,!1,l.toLowerCase(),null,!1,!1)}),S.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(l){S[l]=new y(l,1,!1,l.toLowerCase(),null,!0,!0)});function E(l,f,g,w){var _=S.hasOwnProperty(f)?S[f]:null;(_!==null?_.type!==0:w||!(2Q||_[M]!==P[Q]){var te=` +`+_[M].replace(" at new "," at ");return l.displayName&&te.includes("")&&(te=te.replace("",l.displayName)),te}while(1<=M&&0<=Q);break}}}finally{J=!1,Error.prepareStackTrace=g}return(l=l?l.displayName||l.name:"")?D(l):""}function ie(l){switch(l.tag){case 5:return D(l.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return l=ae(l.type,!1),l;case 11:return l=ae(l.type.render,!1),l;case 1:return l=ae(l.type,!0),l;default:return""}}function ne(l){if(l==null)return null;if(typeof l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case T:return"Fragment";case O:return"Portal";case L:return"Profiler";case R:return"StrictMode";case V:return"Suspense";case G:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case F:return(l.displayName||"Context")+".Consumer";case q:return(l._context.displayName||"Context")+".Provider";case B:var f=l.render;return l=l.displayName,l||(l=f.displayName||f.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case W:return f=l.displayName||null,f!==null?f:ne(l.type)||"Memo";case H:f=l._payload,l=l._init;try{return ne(l(f))}catch{}}return null}function X(l){var f=l.type;switch(l.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return l=f.render,l=l.displayName||l.name||"",f.displayName||(l!==""?"ForwardRef("+l+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ne(f);case 8:return f===R?"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 f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function Y(l){switch(typeof l){case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function ee(l){var f=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function le(l){var f=ee(l)?"checked":"value",g=Object.getOwnPropertyDescriptor(l.constructor.prototype,f),w=""+l[f];if(!l.hasOwnProperty(f)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var _=g.get,P=g.set;return Object.defineProperty(l,f,{configurable:!0,get:function(){return _.call(this)},set:function(M){w=""+M,P.call(this,M)}}),Object.defineProperty(l,f,{enumerable:g.enumerable}),{getValue:function(){return w},setValue:function(M){w=""+M},stopTracking:function(){l._valueTracker=null,delete l[f]}}}}function pe(l){l._valueTracker||(l._valueTracker=le(l))}function K(l){if(!l)return!1;var f=l._valueTracker;if(!f)return!0;var g=f.getValue(),w="";return l&&(w=ee(l)?l.checked?"true":"false":l.value),l=w,l!==g?(f.setValue(l),!0):!1}function je(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}function Ce(l,f){var g=f.checked;return k({},f,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:g??l._wrapperState.initialChecked})}function Le(l,f){var g=f.defaultValue==null?"":f.defaultValue,w=f.checked!=null?f.checked:f.defaultChecked;g=Y(f.value!=null?f.value:g),l._wrapperState={initialChecked:w,initialValue:g,controlled:f.type==="checkbox"||f.type==="radio"?f.checked!=null:f.value!=null}}function De(l,f){f=f.checked,f!=null&&E(l,"checked",f,!1)}function tt(l,f){De(l,f);var g=Y(f.value),w=f.type;if(g!=null)w==="number"?(g===0&&l.value===""||l.value!=g)&&(l.value=""+g):l.value!==""+g&&(l.value=""+g);else if(w==="submit"||w==="reset"){l.removeAttribute("value");return}f.hasOwnProperty("value")?ft(l,f.type,g):f.hasOwnProperty("defaultValue")&&ft(l,f.type,Y(f.defaultValue)),f.checked==null&&f.defaultChecked!=null&&(l.defaultChecked=!!f.defaultChecked)}function _t(l,f,g){if(f.hasOwnProperty("value")||f.hasOwnProperty("defaultValue")){var w=f.type;if(!(w!=="submit"&&w!=="reset"||f.value!==void 0&&f.value!==null))return;f=""+l._wrapperState.initialValue,g||f===l.value||(l.value=f),l.defaultValue=f}g=l.name,g!==""&&(l.name=""),l.defaultChecked=!!l._wrapperState.initialChecked,g!==""&&(l.name=g)}function ft(l,f,g){(f!=="number"||je(l.ownerDocument)!==l)&&(g==null?l.defaultValue=""+l._wrapperState.initialValue:l.defaultValue!==""+g&&(l.defaultValue=""+g))}var Zt=Array.isArray;function At(l,f,g,w){if(l=l.options,f){f={};for(var _=0;_"+f.valueOf().toString()+"",f=Da.firstChild;l.firstChild;)l.removeChild(l.firstChild);for(;f.firstChild;)l.appendChild(f.firstChild)}});function Br(l,f){if(f){var g=l.firstChild;if(g&&g===l.lastChild&&g.nodeType===3){g.nodeValue=f;return}}l.textContent=f}var yn={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},ca=["Webkit","ms","Moz","O"];Object.keys(yn).forEach(function(l){ca.forEach(function(f){f=f+l.charAt(0).toUpperCase()+l.substring(1),yn[f]=yn[l]})});function rs(l,f,g){return f==null||typeof f=="boolean"||f===""?"":g||typeof f!="number"||f===0||yn.hasOwnProperty(l)&&yn[l]?(""+f).trim():f+"px"}function ns(l,f){l=l.style;for(var g in f)if(f.hasOwnProperty(g)){var w=g.indexOf("--")===0,_=rs(g,f[g],w);g==="float"&&(g="cssFloat"),w?l.setProperty(g,_):l[g]=_}}var as=k({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 be(l,f){if(f){if(as[l]&&(f.children!=null||f.dangerouslySetInnerHTML!=null))throw Error(r(137,l));if(f.dangerouslySetInnerHTML!=null){if(f.children!=null)throw Error(r(60));if(typeof f.dangerouslySetInnerHTML!="object"||!("__html"in f.dangerouslySetInnerHTML))throw Error(r(61))}if(f.style!=null&&typeof f.style!="object")throw Error(r(62))}}function ut(l,f){if(l.indexOf("-")===-1)return typeof f.is=="string";switch(l){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 Ut=null;function xn(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Ql=null,pi=null,$a=null;function Zl(l){if(l=xc(l)){if(typeof Ql!="function")throw Error(r(280));var f=l.stateNode;f&&(f=Gd(f),Ql(l.stateNode,l.type,f))}}function Qe(l){pi?$a?$a.push(l):$a=[l]:pi=l}function Vt(){if(pi){var l=pi,f=$a;if($a=pi=null,Zl(l),f)for(l=0;l>>=0,l===0?32:31-(CB(l)/EB|0)|0}var Pd=64,Ad=4194304;function tc(l){switch(l&-l){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 l&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return l&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return l}}function Td(l,f){var g=l.pendingLanes;if(g===0)return 0;var w=0,_=l.suspendedLanes,P=l.pingedLanes,M=g&268435455;if(M!==0){var Q=M&~_;Q!==0?w=tc(Q):(P&=M,P!==0&&(w=tc(P)))}else M=g&~_,M!==0?w=tc(M):P!==0&&(w=tc(P));if(w===0)return 0;if(f!==0&&f!==w&&(f&_)===0&&(_=w&-w,P=f&-f,_>=P||_===16&&(P&4194240)!==0))return f;if((w&4)!==0&&(w|=g&16),f=l.entangledLanes,f!==0)for(l=l.entanglements,f&=w;0g;g++)f.push(l);return f}function rc(l,f,g){l.pendingLanes|=f,f!==536870912&&(l.suspendedLanes=0,l.pingedLanes=0),l=l.eventTimes,f=31-Bn(f),l[f]=g}function TB(l,f){var g=l.pendingLanes&~f;l.pendingLanes=f,l.suspendedLanes=0,l.pingedLanes=0,l.expiredLanes&=f,l.mutableReadLanes&=f,l.entangledLanes&=f,f=l.entanglements;var w=l.eventTimes;for(l=l.expirationTimes;0=uc),W_=" ",G_=!1;function K_(l,f){switch(l){case"keyup":return iF.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function X_(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var ss=!1;function sF(l,f){switch(l){case"compositionend":return X_(f);case"keypress":return f.which!==32?null:(G_=!0,W_);case"textInput":return l=f.data,l===W_&&G_?null:l;default:return null}}function lF(l,f){if(ss)return l==="compositionend"||!Hg&&K_(l,f)?(l=F_(),Dd=Bg=Si=null,ss=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1=f)return{node:g,offset:f-l};l=w}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=rN(g)}}function aN(l,f){return l&&f?l===f?!0:l&&l.nodeType===3?!1:f&&f.nodeType===3?aN(l,f.parentNode):"contains"in l?l.contains(f):l.compareDocumentPosition?!!(l.compareDocumentPosition(f)&16):!1:!1}function iN(){for(var l=window,f=je();f instanceof l.HTMLIFrameElement;){try{var g=typeof f.contentWindow.location.href=="string"}catch{g=!1}if(g)l=f.contentWindow;else break;f=je(l.document)}return f}function Kg(l){var f=l&&l.nodeName&&l.nodeName.toLowerCase();return f&&(f==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||f==="textarea"||l.contentEditable==="true")}function vF(l){var f=iN(),g=l.focusedElem,w=l.selectionRange;if(f!==g&&g&&g.ownerDocument&&aN(g.ownerDocument.documentElement,g)){if(w!==null&&Kg(g)){if(f=w.start,l=w.end,l===void 0&&(l=f),"selectionStart"in g)g.selectionStart=f,g.selectionEnd=Math.min(l,g.value.length);else if(l=(f=g.ownerDocument||document)&&f.defaultView||window,l.getSelection){l=l.getSelection();var _=g.textContent.length,P=Math.min(w.start,_);w=w.end===void 0?P:Math.min(w.end,_),!l.extend&&P>w&&(_=w,w=P,P=_),_=nN(g,P);var M=nN(g,w);_&&M&&(l.rangeCount!==1||l.anchorNode!==_.node||l.anchorOffset!==_.offset||l.focusNode!==M.node||l.focusOffset!==M.offset)&&(f=f.createRange(),f.setStart(_.node,_.offset),l.removeAllRanges(),P>w?(l.addRange(f),l.extend(M.node,M.offset)):(f.setEnd(M.node,M.offset),l.addRange(f)))}}for(f=[],l=g;l=l.parentNode;)l.nodeType===1&&f.push({element:l,left:l.scrollLeft,top:l.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g=document.documentMode,ls=null,Xg=null,pc=null,Yg=!1;function oN(l,f,g){var w=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;Yg||ls==null||ls!==je(w)||(w=ls,"selectionStart"in w&&Kg(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),pc&&hc(pc,w)||(pc=w,w=Vd(Xg,"onSelect"),0hs||(l.current=lv[hs],lv[hs]=null,hs--)}function Nt(l,f){hs++,lv[hs]=l.current,l.current=f}var Ci={},Sr=Ni(Ci),Fr=Ni(!1),so=Ci;function ps(l,f){var g=l.type.contextTypes;if(!g)return Ci;var w=l.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===f)return w.__reactInternalMemoizedMaskedChildContext;var _={},P;for(P in g)_[P]=f[P];return w&&(l=l.stateNode,l.__reactInternalMemoizedUnmaskedChildContext=f,l.__reactInternalMemoizedMaskedChildContext=_),_}function zr(l){return l=l.childContextTypes,l!=null}function Kd(){kt(Fr),kt(Sr)}function wN(l,f,g){if(Sr.current!==Ci)throw Error(r(168));Nt(Sr,f),Nt(Fr,g)}function SN(l,f,g){var w=l.stateNode;if(f=f.childContextTypes,typeof w.getChildContext!="function")return g;w=w.getChildContext();for(var _ in w)if(!(_ in f))throw Error(r(108,X(l)||"Unknown",_));return k({},g,w)}function Xd(l){return l=(l=l.stateNode)&&l.__reactInternalMemoizedMergedChildContext||Ci,so=Sr.current,Nt(Sr,l),Nt(Fr,Fr.current),!0}function jN(l,f,g){var w=l.stateNode;if(!w)throw Error(r(169));g?(l=SN(l,f,so),w.__reactInternalMemoizedMergedChildContext=l,kt(Fr),kt(Sr),Nt(Sr,l)):kt(Fr),Nt(Fr,g)}var Fa=null,Yd=!1,cv=!1;function _N(l){Fa===null?Fa=[l]:Fa.push(l)}function PF(l){Yd=!0,_N(l)}function Ei(){if(!cv&&Fa!==null){cv=!0;var l=0,f=gt;try{var g=Fa;for(gt=1;l>=M,_-=M,za=1<<32-Bn(f)+_|g<<_|w,qa=P+l}else za=1<Ve?(fr=Be,Be=null):fr=Be.sibling;var st=ve(oe,Be,se[Ve],Se);if(st===null){Be===null&&(Be=fr);break}l&&Be&&st.alternate===null&&f(oe,Be),re=P(st,re,Ve),$e===null?Me=st:$e.sibling=st,$e=st,Be=fr}if(Ve===se.length)return g(oe,Be),It&&co(oe,Ve),Me;if(Be===null){for(;VeVe?(fr=Be,Be=null):fr=Be.sibling;var Di=ve(oe,Be,st.value,Se);if(Di===null){Be===null&&(Be=fr);break}l&&Be&&Di.alternate===null&&f(oe,Be),re=P(Di,re,Ve),$e===null?Me=Di:$e.sibling=Di,$e=Di,Be=fr}if(st.done)return g(oe,Be),It&&co(oe,Ve),Me;if(Be===null){for(;!st.done;Ve++,st=se.next())st=we(oe,st.value,Se),st!==null&&(re=P(st,re,Ve),$e===null?Me=st:$e.sibling=st,$e=st);return It&&co(oe,Ve),Me}for(Be=w(oe,Be);!st.done;Ve++,st=se.next())st=Ee(Be,oe,Ve,st.value,Se),st!==null&&(l&&st.alternate!==null&&Be.delete(st.key===null?Ve:st.key),re=P(st,re,Ve),$e===null?Me=st:$e.sibling=st,$e=st);return l&&Be.forEach(function(c8){return f(oe,c8)}),It&&co(oe,Ve),Me}function Wt(oe,re,se,Se){if(typeof se=="object"&&se!==null&&se.type===T&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case C:e:{for(var Me=se.key,$e=re;$e!==null;){if($e.key===Me){if(Me=se.type,Me===T){if($e.tag===7){g(oe,$e.sibling),re=_($e,se.props.children),re.return=oe,oe=re;break e}}else if($e.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===H&&AN(Me)===$e.type){g(oe,$e.sibling),re=_($e,se.props),re.ref=bc(oe,$e,se),re.return=oe,oe=re;break e}g(oe,$e);break}else f(oe,$e);$e=$e.sibling}se.type===T?(re=yo(se.props.children,oe.mode,Se,se.key),re.return=oe,oe=re):(Se=Nf(se.type,se.key,se.props,null,oe.mode,Se),Se.ref=bc(oe,re,se),Se.return=oe,oe=Se)}return M(oe);case O:e:{for($e=se.key;re!==null;){if(re.key===$e)if(re.tag===4&&re.stateNode.containerInfo===se.containerInfo&&re.stateNode.implementation===se.implementation){g(oe,re.sibling),re=_(re,se.children||[]),re.return=oe,oe=re;break e}else{g(oe,re);break}else f(oe,re);re=re.sibling}re=oy(se,oe.mode,Se),re.return=oe,oe=re}return M(oe);case H:return $e=se._init,Wt(oe,re,$e(se._payload),Se)}if(Zt(se))return Te(oe,re,se,Se);if(Z(se))return Ie(oe,re,se,Se);ef(oe,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,re!==null&&re.tag===6?(g(oe,re.sibling),re=_(re,se),re.return=oe,oe=re):(g(oe,re),re=iy(se,oe.mode,Se),re.return=oe,oe=re),M(oe)):g(oe,re)}return Wt}var ys=TN(!0),kN=TN(!1),tf=Ni(null),rf=null,xs=null,mv=null;function gv(){mv=xs=rf=null}function vv(l){var f=tf.current;kt(tf),l._currentValue=f}function yv(l,f,g){for(;l!==null;){var w=l.alternate;if((l.childLanes&f)!==f?(l.childLanes|=f,w!==null&&(w.childLanes|=f)):w!==null&&(w.childLanes&f)!==f&&(w.childLanes|=f),l===g)break;l=l.return}}function bs(l,f){rf=l,mv=xs=null,l=l.dependencies,l!==null&&l.firstContext!==null&&((l.lanes&f)!==0&&(qr=!0),l.firstContext=null)}function jn(l){var f=l._currentValue;if(mv!==l)if(l={context:l,memoizedValue:f,next:null},xs===null){if(rf===null)throw Error(r(308));xs=l,rf.dependencies={lanes:0,firstContext:l}}else xs=xs.next=l;return f}var uo=null;function xv(l){uo===null?uo=[l]:uo.push(l)}function RN(l,f,g,w){var _=f.interleaved;return _===null?(g.next=g,xv(f)):(g.next=_.next,_.next=g),f.interleaved=g,Ua(l,w)}function Ua(l,f){l.lanes|=f;var g=l.alternate;for(g!==null&&(g.lanes|=f),g=l,l=l.return;l!==null;)l.childLanes|=f,g=l.alternate,g!==null&&(g.childLanes|=f),g=l,l=l.return;return g.tag===3?g.stateNode:null}var Oi=!1;function bv(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function IN(l,f){l=l.updateQueue,f.updateQueue===l&&(f.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,effects:l.effects})}function Va(l,f){return{eventTime:l,lane:f,tag:0,payload:null,callback:null,next:null}}function Pi(l,f,g){var w=l.updateQueue;if(w===null)return null;if(w=w.shared,(ot&2)!==0){var _=w.pending;return _===null?f.next=f:(f.next=_.next,_.next=f),w.pending=f,Ua(l,g)}return _=w.interleaved,_===null?(f.next=f,xv(w)):(f.next=_.next,_.next=f),w.interleaved=f,Ua(l,g)}function nf(l,f,g){if(f=f.updateQueue,f!==null&&(f=f.shared,(g&4194240)!==0)){var w=f.lanes;w&=l.pendingLanes,g|=w,f.lanes=g,Ig(l,g)}}function MN(l,f){var g=l.updateQueue,w=l.alternate;if(w!==null&&(w=w.updateQueue,g===w)){var _=null,P=null;if(g=g.firstBaseUpdate,g!==null){do{var M={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};P===null?_=P=M:P=P.next=M,g=g.next}while(g!==null);P===null?_=P=f:P=P.next=f}else _=P=f;g={baseState:w.baseState,firstBaseUpdate:_,lastBaseUpdate:P,shared:w.shared,effects:w.effects},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=f:l.next=f,g.lastBaseUpdate=f}function af(l,f,g,w){var _=l.updateQueue;Oi=!1;var P=_.firstBaseUpdate,M=_.lastBaseUpdate,Q=_.shared.pending;if(Q!==null){_.shared.pending=null;var te=Q,ce=te.next;te.next=null,M===null?P=ce:M.next=ce,M=te;var xe=l.alternate;xe!==null&&(xe=xe.updateQueue,Q=xe.lastBaseUpdate,Q!==M&&(Q===null?xe.firstBaseUpdate=ce:Q.next=ce,xe.lastBaseUpdate=te))}if(P!==null){var we=_.baseState;M=0,xe=ce=te=null,Q=P;do{var ve=Q.lane,Ee=Q.eventTime;if((w&ve)===ve){xe!==null&&(xe=xe.next={eventTime:Ee,lane:0,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null});e:{var Te=l,Ie=Q;switch(ve=f,Ee=g,Ie.tag){case 1:if(Te=Ie.payload,typeof Te=="function"){we=Te.call(Ee,we,ve);break e}we=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Ie.payload,ve=typeof Te=="function"?Te.call(Ee,we,ve):Te,ve==null)break e;we=k({},we,ve);break e;case 2:Oi=!0}}Q.callback!==null&&Q.lane!==0&&(l.flags|=64,ve=_.effects,ve===null?_.effects=[Q]:ve.push(Q))}else Ee={eventTime:Ee,lane:ve,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},xe===null?(ce=xe=Ee,te=we):xe=xe.next=Ee,M|=ve;if(Q=Q.next,Q===null){if(Q=_.shared.pending,Q===null)break;ve=Q,Q=ve.next,ve.next=null,_.lastBaseUpdate=ve,_.shared.pending=null}}while(!0);if(xe===null&&(te=we),_.baseState=te,_.firstBaseUpdate=ce,_.lastBaseUpdate=xe,f=_.shared.interleaved,f!==null){_=f;do M|=_.lane,_=_.next;while(_!==f)}else P===null&&(_.shared.lanes=0);po|=M,l.lanes=M,l.memoizedState=we}}function DN(l,f,g){if(l=f.effects,f.effects=null,l!==null)for(f=0;fg?g:4,l(!0);var w=Nv.transition;Nv.transition={};try{l(!1),f()}finally{gt=g,Nv.transition=w}}function tC(){return _n().memoizedState}function RF(l,f,g){var w=Ri(l);if(g={lane:w,action:g,hasEagerState:!1,eagerState:null,next:null},rC(l))nC(f,g);else if(g=RN(l,f,g,w),g!==null){var _=Ar();Hn(g,l,w,_),aC(g,f,w)}}function IF(l,f,g){var w=Ri(l),_={lane:w,action:g,hasEagerState:!1,eagerState:null,next:null};if(rC(l))nC(f,_);else{var P=l.alternate;if(l.lanes===0&&(P===null||P.lanes===0)&&(P=f.lastRenderedReducer,P!==null))try{var M=f.lastRenderedState,Q=P(M,g);if(_.hasEagerState=!0,_.eagerState=Q,Fn(Q,M)){var te=f.interleaved;te===null?(_.next=_,xv(f)):(_.next=te.next,te.next=_),f.interleaved=_;return}}catch{}finally{}g=RN(l,f,_,w),g!==null&&(_=Ar(),Hn(g,l,w,_),aC(g,f,w))}}function rC(l){var f=l.alternate;return l===$t||f!==null&&f===$t}function nC(l,f){_c=lf=!0;var g=l.pending;g===null?f.next=f:(f.next=g.next,g.next=f),l.pending=f}function aC(l,f,g){if((g&4194240)!==0){var w=f.lanes;w&=l.pendingLanes,g|=w,f.lanes=g,Ig(l,g)}}var df={readContext:jn,useCallback:jr,useContext:jr,useEffect:jr,useImperativeHandle:jr,useInsertionEffect:jr,useLayoutEffect:jr,useMemo:jr,useReducer:jr,useRef:jr,useState:jr,useDebugValue:jr,useDeferredValue:jr,useTransition:jr,useMutableSource:jr,useSyncExternalStore:jr,useId:jr,unstable_isNewReconciler:!1},MF={readContext:jn,useCallback:function(l,f){return ha().memoizedState=[l,f===void 0?null:f],l},useContext:jn,useEffect:GN,useImperativeHandle:function(l,f,g){return g=g!=null?g.concat([l]):null,cf(4194308,4,YN.bind(null,f,l),g)},useLayoutEffect:function(l,f){return cf(4194308,4,l,f)},useInsertionEffect:function(l,f){return cf(4,2,l,f)},useMemo:function(l,f){var g=ha();return f=f===void 0?null:f,l=l(),g.memoizedState=[l,f],l},useReducer:function(l,f,g){var w=ha();return f=g!==void 0?g(f):f,w.memoizedState=w.baseState=f,l={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:f},w.queue=l,l=l.dispatch=RF.bind(null,$t,l),[w.memoizedState,l]},useRef:function(l){var f=ha();return l={current:l},f.memoizedState=l},useState:HN,useDebugValue:kv,useDeferredValue:function(l){return ha().memoizedState=l},useTransition:function(){var l=HN(!1),f=l[0];return l=kF.bind(null,l[1]),ha().memoizedState=l,[f,l]},useMutableSource:function(){},useSyncExternalStore:function(l,f,g){var w=$t,_=ha();if(It){if(g===void 0)throw Error(r(407));g=g()}else{if(g=f(),dr===null)throw Error(r(349));(ho&30)!==0||FN(w,f,g)}_.memoizedState=g;var P={value:g,getSnapshot:f};return _.queue=P,GN(qN.bind(null,w,P,l),[l]),w.flags|=2048,Ec(9,zN.bind(null,w,P,g,f),void 0,null),g},useId:function(){var l=ha(),f=dr.identifierPrefix;if(It){var g=qa,w=za;g=(w&~(1<<32-Bn(w)-1)).toString(32)+g,f=":"+f+"R"+g,g=Nc++,0<\/script>",l=l.removeChild(l.firstChild)):typeof w.is=="string"?l=M.createElement(g,{is:w.is}):(l=M.createElement(g),g==="select"&&(M=l,w.multiple?M.multiple=!0:w.size&&(M.size=w.size))):l=M.createElementNS(l,g),l[da]=f,l[yc]=w,_C(l,f,!1,!1),f.stateNode=l;e:{switch(M=ut(g,w),g){case"dialog":Tt("cancel",l),Tt("close",l),_=w;break;case"iframe":case"object":case"embed":Tt("load",l),_=w;break;case"video":case"audio":for(_=0;_Ns&&(f.flags|=128,w=!0,Oc(P,!1),f.lanes=4194304)}else{if(!w)if(l=of(M),l!==null){if(f.flags|=128,w=!0,g=l.updateQueue,g!==null&&(f.updateQueue=g,f.flags|=4),Oc(P,!0),P.tail===null&&P.tailMode==="hidden"&&!M.alternate&&!It)return _r(f),null}else 2*Ht()-P.renderingStartTime>Ns&&g!==1073741824&&(f.flags|=128,w=!0,Oc(P,!1),f.lanes=4194304);P.isBackwards?(M.sibling=f.child,f.child=M):(g=P.last,g!==null?g.sibling=M:f.child=M,P.last=M)}return P.tail!==null?(f=P.tail,P.rendering=f,P.tail=f.sibling,P.renderingStartTime=Ht(),f.sibling=null,g=Lt.current,Nt(Lt,w?g&1|2:g&1),f):(_r(f),null);case 22:case 23:return ry(),w=f.memoizedState!==null,l!==null&&l.memoizedState!==null!==w&&(f.flags|=8192),w&&(f.mode&1)!==0?(en&1073741824)!==0&&(_r(f),f.subtreeFlags&6&&(f.flags|=8192)):_r(f),null;case 24:return null;case 25:return null}throw Error(r(156,f.tag))}function UF(l,f){switch(dv(f),f.tag){case 1:return zr(f.type)&&Kd(),l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 3:return ws(),kt(Fr),kt(Sr),_v(),l=f.flags,(l&65536)!==0&&(l&128)===0?(f.flags=l&-65537|128,f):null;case 5:return Sv(f),null;case 13:if(kt(Lt),l=f.memoizedState,l!==null&&l.dehydrated!==null){if(f.alternate===null)throw Error(r(340));vs()}return l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 19:return kt(Lt),null;case 4:return ws(),null;case 10:return vv(f.type._context),null;case 22:case 23:return ry(),null;case 24:return null;default:return null}}var mf=!1,Nr=!1,VF=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function js(l,f){var g=l.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(w){Bt(l,f,w)}else g.current=null}function Vv(l,f,g){try{g()}catch(w){Bt(l,f,w)}}var EC=!1;function HF(l,f){if(rv=Id,l=iN(),Kg(l)){if("selectionStart"in l)var g={start:l.selectionStart,end:l.selectionEnd};else e:{g=(g=l.ownerDocument)&&g.defaultView||window;var w=g.getSelection&&g.getSelection();if(w&&w.rangeCount!==0){g=w.anchorNode;var _=w.anchorOffset,P=w.focusNode;w=w.focusOffset;try{g.nodeType,P.nodeType}catch{g=null;break e}var M=0,Q=-1,te=-1,ce=0,xe=0,we=l,ve=null;t:for(;;){for(var Ee;we!==g||_!==0&&we.nodeType!==3||(Q=M+_),we!==P||w!==0&&we.nodeType!==3||(te=M+w),we.nodeType===3&&(M+=we.nodeValue.length),(Ee=we.firstChild)!==null;)ve=we,we=Ee;for(;;){if(we===l)break t;if(ve===g&&++ce===_&&(Q=M),ve===P&&++xe===w&&(te=M),(Ee=we.nextSibling)!==null)break;we=ve,ve=we.parentNode}we=Ee}g=Q===-1||te===-1?null:{start:Q,end:te}}else g=null}g=g||{start:0,end:0}}else g=null;for(nv={focusedElem:l,selectionRange:g},Id=!1,Oe=f;Oe!==null;)if(f=Oe,l=f.child,(f.subtreeFlags&1028)!==0&&l!==null)l.return=f,Oe=l;else for(;Oe!==null;){f=Oe;try{var Te=f.alternate;if((f.flags&1024)!==0)switch(f.tag){case 0:case 11:case 15:break;case 1:if(Te!==null){var Ie=Te.memoizedProps,Wt=Te.memoizedState,oe=f.stateNode,re=oe.getSnapshotBeforeUpdate(f.elementType===f.type?Ie:qn(f.type,Ie),Wt);oe.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var se=f.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Se){Bt(f,f.return,Se)}if(l=f.sibling,l!==null){l.return=f.return,Oe=l;break}Oe=f.return}return Te=EC,EC=!1,Te}function Pc(l,f,g){var w=f.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var _=w=w.next;do{if((_.tag&l)===l){var P=_.destroy;_.destroy=void 0,P!==void 0&&Vv(f,g,P)}_=_.next}while(_!==w)}}function gf(l,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&l)===l){var w=g.create;g.destroy=w()}g=g.next}while(g!==f)}}function Hv(l){var f=l.ref;if(f!==null){var g=l.stateNode;switch(l.tag){case 5:l=g;break;default:l=g}typeof f=="function"?f(l):f.current=l}}function OC(l){var f=l.alternate;f!==null&&(l.alternate=null,OC(f)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(f=l.stateNode,f!==null&&(delete f[da],delete f[yc],delete f[sv],delete f[EF],delete f[OF])),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function PC(l){return l.tag===5||l.tag===3||l.tag===4}function AC(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||PC(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Wv(l,f,g){var w=l.tag;if(w===5||w===6)l=l.stateNode,f?g.nodeType===8?g.parentNode.insertBefore(l,f):g.insertBefore(l,f):(g.nodeType===8?(f=g.parentNode,f.insertBefore(l,g)):(f=g,f.appendChild(l)),g=g._reactRootContainer,g!=null||f.onclick!==null||(f.onclick=Wd));else if(w!==4&&(l=l.child,l!==null))for(Wv(l,f,g),l=l.sibling;l!==null;)Wv(l,f,g),l=l.sibling}function Gv(l,f,g){var w=l.tag;if(w===5||w===6)l=l.stateNode,f?g.insertBefore(l,f):g.appendChild(l);else if(w!==4&&(l=l.child,l!==null))for(Gv(l,f,g),l=l.sibling;l!==null;)Gv(l,f,g),l=l.sibling}var vr=null,Un=!1;function Ai(l,f,g){for(g=g.child;g!==null;)TC(l,f,g),g=g.sibling}function TC(l,f,g){if(ua&&typeof ua.onCommitFiberUnmount=="function")try{ua.onCommitFiberUnmount(Od,g)}catch{}switch(g.tag){case 5:Nr||js(g,f);case 6:var w=vr,_=Un;vr=null,Ai(l,f,g),vr=w,Un=_,vr!==null&&(Un?(l=vr,g=g.stateNode,l.nodeType===8?l.parentNode.removeChild(g):l.removeChild(g)):vr.removeChild(g.stateNode));break;case 18:vr!==null&&(Un?(l=vr,g=g.stateNode,l.nodeType===8?ov(l.parentNode,g):l.nodeType===1&&ov(l,g),sc(l)):ov(vr,g.stateNode));break;case 4:w=vr,_=Un,vr=g.stateNode.containerInfo,Un=!0,Ai(l,f,g),vr=w,Un=_;break;case 0:case 11:case 14:case 15:if(!Nr&&(w=g.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){_=w=w.next;do{var P=_,M=P.destroy;P=P.tag,M!==void 0&&((P&2)!==0||(P&4)!==0)&&Vv(g,f,M),_=_.next}while(_!==w)}Ai(l,f,g);break;case 1:if(!Nr&&(js(g,f),w=g.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=g.memoizedProps,w.state=g.memoizedState,w.componentWillUnmount()}catch(Q){Bt(g,f,Q)}Ai(l,f,g);break;case 21:Ai(l,f,g);break;case 22:g.mode&1?(Nr=(w=Nr)||g.memoizedState!==null,Ai(l,f,g),Nr=w):Ai(l,f,g);break;default:Ai(l,f,g)}}function kC(l){var f=l.updateQueue;if(f!==null){l.updateQueue=null;var g=l.stateNode;g===null&&(g=l.stateNode=new VF),f.forEach(function(w){var _=e8.bind(null,l,w);g.has(w)||(g.add(w),w.then(_,_))})}}function Vn(l,f){var g=f.deletions;if(g!==null)for(var w=0;w_&&(_=M),w&=~P}if(w=_,w=Ht()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*GF(w/1960))-w,10l?16:l,ki===null)var w=!1;else{if(l=ki,ki=null,wf=0,(ot&6)!==0)throw Error(r(331));var _=ot;for(ot|=4,Oe=l.current;Oe!==null;){var P=Oe,M=P.child;if((Oe.flags&16)!==0){var Q=P.deletions;if(Q!==null){for(var te=0;teHt()-Yv?go(l,0):Xv|=g),Vr(l,f)}function HC(l,f){f===0&&((l.mode&1)===0?f=1:(f=Ad,Ad<<=1,(Ad&130023424)===0&&(Ad=4194304)));var g=Ar();l=Ua(l,f),l!==null&&(rc(l,f,g),Vr(l,g))}function ZF(l){var f=l.memoizedState,g=0;f!==null&&(g=f.retryLane),HC(l,g)}function e8(l,f){var g=0;switch(l.tag){case 13:var w=l.stateNode,_=l.memoizedState;_!==null&&(g=_.retryLane);break;case 19:w=l.stateNode;break;default:throw Error(r(314))}w!==null&&w.delete(f),HC(l,g)}var WC;WC=function(l,f,g){if(l!==null)if(l.memoizedProps!==f.pendingProps||Fr.current)qr=!0;else{if((l.lanes&g)===0&&(f.flags&128)===0)return qr=!1,zF(l,f,g);qr=(l.flags&131072)!==0}else qr=!1,It&&(f.flags&1048576)!==0&&NN(f,Qd,f.index);switch(f.lanes=0,f.tag){case 2:var w=f.type;pf(l,f),l=f.pendingProps;var _=ps(f,Sr.current);bs(f,g),_=Ev(null,f,w,l,_,g);var P=Ov();return f.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,zr(w)?(P=!0,Xd(f)):P=!1,f.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,bv(f),_.updater=ff,f.stateNode=_,_._reactInternals=f,Iv(f,w,l,g),f=$v(null,f,w,!0,P,g)):(f.tag=0,It&&P&&uv(f),Pr(null,f,_,g),f=f.child),f;case 16:w=f.elementType;e:{switch(pf(l,f),l=f.pendingProps,_=w._init,w=_(w._payload),f.type=w,_=f.tag=r8(w),l=qn(w,l),_){case 0:f=Lv(null,f,w,l,g);break e;case 1:f=yC(null,f,w,l,g);break e;case 11:f=hC(null,f,w,l,g);break e;case 14:f=pC(null,f,w,qn(w.type,l),g);break e}throw Error(r(306,w,""))}return f;case 0:return w=f.type,_=f.pendingProps,_=f.elementType===w?_:qn(w,_),Lv(l,f,w,_,g);case 1:return w=f.type,_=f.pendingProps,_=f.elementType===w?_:qn(w,_),yC(l,f,w,_,g);case 3:e:{if(xC(f),l===null)throw Error(r(387));w=f.pendingProps,P=f.memoizedState,_=P.element,IN(l,f),af(f,w,null,g);var M=f.memoizedState;if(w=M.element,P.isDehydrated)if(P={element:w,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},f.updateQueue.baseState=P,f.memoizedState=P,f.flags&256){_=Ss(Error(r(423)),f),f=bC(l,f,w,g,_);break e}else if(w!==_){_=Ss(Error(r(424)),f),f=bC(l,f,w,g,_);break e}else for(Zr=_i(f.stateNode.containerInfo.firstChild),Qr=f,It=!0,zn=null,g=kN(f,null,w,g),f.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(vs(),w===_){f=Ha(l,f,g);break e}Pr(l,f,w,g)}f=f.child}return f;case 5:return LN(f),l===null&&hv(f),w=f.type,_=f.pendingProps,P=l!==null?l.memoizedProps:null,M=_.children,av(w,_)?M=null:P!==null&&av(w,P)&&(f.flags|=32),vC(l,f),Pr(l,f,M,g),f.child;case 6:return l===null&&hv(f),null;case 13:return wC(l,f,g);case 4:return wv(f,f.stateNode.containerInfo),w=f.pendingProps,l===null?f.child=ys(f,null,w,g):Pr(l,f,w,g),f.child;case 11:return w=f.type,_=f.pendingProps,_=f.elementType===w?_:qn(w,_),hC(l,f,w,_,g);case 7:return Pr(l,f,f.pendingProps,g),f.child;case 8:return Pr(l,f,f.pendingProps.children,g),f.child;case 12:return Pr(l,f,f.pendingProps.children,g),f.child;case 10:e:{if(w=f.type._context,_=f.pendingProps,P=f.memoizedProps,M=_.value,Nt(tf,w._currentValue),w._currentValue=M,P!==null)if(Fn(P.value,M)){if(P.children===_.children&&!Fr.current){f=Ha(l,f,g);break e}}else for(P=f.child,P!==null&&(P.return=f);P!==null;){var Q=P.dependencies;if(Q!==null){M=P.child;for(var te=Q.firstContext;te!==null;){if(te.context===w){if(P.tag===1){te=Va(-1,g&-g),te.tag=2;var ce=P.updateQueue;if(ce!==null){ce=ce.shared;var xe=ce.pending;xe===null?te.next=te:(te.next=xe.next,xe.next=te),ce.pending=te}}P.lanes|=g,te=P.alternate,te!==null&&(te.lanes|=g),yv(P.return,g,f),Q.lanes|=g;break}te=te.next}}else if(P.tag===10)M=P.type===f.type?null:P.child;else if(P.tag===18){if(M=P.return,M===null)throw Error(r(341));M.lanes|=g,Q=M.alternate,Q!==null&&(Q.lanes|=g),yv(M,g,f),M=P.sibling}else M=P.child;if(M!==null)M.return=P;else for(M=P;M!==null;){if(M===f){M=null;break}if(P=M.sibling,P!==null){P.return=M.return,M=P;break}M=M.return}P=M}Pr(l,f,_.children,g),f=f.child}return f;case 9:return _=f.type,w=f.pendingProps.children,bs(f,g),_=jn(_),w=w(_),f.flags|=1,Pr(l,f,w,g),f.child;case 14:return w=f.type,_=qn(w,f.pendingProps),_=qn(w.type,_),pC(l,f,w,_,g);case 15:return mC(l,f,f.type,f.pendingProps,g);case 17:return w=f.type,_=f.pendingProps,_=f.elementType===w?_:qn(w,_),pf(l,f),f.tag=1,zr(w)?(l=!0,Xd(f)):l=!1,bs(f,g),oC(f,w,_),Iv(f,w,_,g),$v(null,f,w,!0,l,g);case 19:return jC(l,f,g);case 22:return gC(l,f,g)}throw Error(r(156,f.tag))};function GC(l,f){return C_(l,f)}function t8(l,f,g,w){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Cn(l,f,g,w){return new t8(l,f,g,w)}function ay(l){return l=l.prototype,!(!l||!l.isReactComponent)}function r8(l){if(typeof l=="function")return ay(l)?1:0;if(l!=null){if(l=l.$$typeof,l===B)return 11;if(l===W)return 14}return 2}function Mi(l,f){var g=l.alternate;return g===null?(g=Cn(l.tag,f,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=f,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&14680064,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,f=l.dependencies,g.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g}function Nf(l,f,g,w,_,P){var M=2;if(w=l,typeof l=="function")ay(l)&&(M=1);else if(typeof l=="string")M=5;else e:switch(l){case T:return yo(g.children,_,P,f);case R:M=8,_|=8;break;case L:return l=Cn(12,g,f,_|2),l.elementType=L,l.lanes=P,l;case V:return l=Cn(13,g,f,_),l.elementType=V,l.lanes=P,l;case G:return l=Cn(19,g,f,_),l.elementType=G,l.lanes=P,l;case U:return Cf(g,_,P,f);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case q:M=10;break e;case F:M=9;break e;case B:M=11;break e;case W:M=14;break e;case H:M=16,w=null;break e}throw Error(r(130,l==null?l:typeof l,""))}return f=Cn(M,g,f,_),f.elementType=l,f.type=w,f.lanes=P,f}function yo(l,f,g,w){return l=Cn(7,l,w,f),l.lanes=g,l}function Cf(l,f,g,w){return l=Cn(22,l,w,f),l.elementType=U,l.lanes=g,l.stateNode={isHidden:!1},l}function iy(l,f,g){return l=Cn(6,l,null,f),l.lanes=g,l}function oy(l,f,g){return f=Cn(4,l.children!==null?l.children:[],l.key,f),f.lanes=g,f.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},f}function n8(l,f,g,w,_){this.tag=f,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rg(0),this.expirationTimes=Rg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rg(0),this.identifierPrefix=w,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function sy(l,f,g,w,_,P,M,Q,te){return l=new n8(l,f,g,Q,te),f===1?(f=1,P===!0&&(f|=8)):f=0,P=Cn(3,null,null,f),l.current=P,P.stateNode=l,P.memoizedState={element:w,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},bv(P),l}function a8(l,f,g){var w=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),hy.exports=g8(),hy.exports}var sE;function v8(){if(sE)return If;sE=1;var e=tM();return If.createRoot=e.createRoot,If.hydrateRoot=e.hydrateRoot,If}var y8=v8(),b=lm();const z=dt(b),DS=u8({__proto__:null,default:z},[b]);var Ju=tM();const rM=dt(Ju);function x8(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const b8=e=>{switch(e){case"success":return j8;case"info":return N8;case"warning":return _8;case"error":return C8;default:return null}},w8=Array(12).fill(0),S8=({visible:e,className:t})=>z.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},z.createElement("div",{className:"sonner-spinner"},w8.map((r,n)=>z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),j8=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),_8=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),N8=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),C8=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),E8=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),O8=()=>{const[e,t]=z.useState(document.hidden);return z.useEffect(()=>{const r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e};let W1=1;class P8{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...a}=t,i=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:W1++,o=this.toasts.find(d=>d.id===i),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(d=>d.id===i?(this.publish({...d,...t,id:i,title:n}),{...d,...t,id:i,dismissible:u,title:n}):d):this.addToast({title:n,...a,dismissible:u,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let i=n!==void 0,o;const u=a.then(async c=>{if(o=["resolve",c],z.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(T8(c)&&!c.ok){i=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${c.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${c.status}`):r.description,x=typeof p=="object"&&!z.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:m,...x})}else if(c instanceof Error){i=!1;const p=typeof r.error=="function"?await r.error(c):r.error,m=typeof r.description=="function"?await r.description(c):r.description,x=typeof p=="object"&&!z.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:m,...x})}else if(r.success!==void 0){i=!1;const p=typeof r.success=="function"?await r.success(c):r.success,m=typeof r.description=="function"?await r.description(c):r.description,x=typeof p=="object"&&!z.isValidElement(p)?p:{message:p};this.create({id:n,type:"success",description:m,...x})}}).catch(async c=>{if(o=["reject",c],r.error!==void 0){i=!1;const h=typeof r.error=="function"?await r.error(c):r.error,p=typeof r.description=="function"?await r.description(c):r.description,v=typeof h=="object"&&!z.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:p,...v})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),d=()=>new Promise((c,h)=>u.then(()=>o[0]==="reject"?h(o[1]):c(o[1])).catch(h));return typeof n!="string"&&typeof n!="number"?{unwrap:d}:Object.assign(n,{unwrap:d})},this.custom=(t,r)=>{const n=r?.id||W1++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Wr=new P8,A8=(e,t)=>{const r=t?.id||W1++;return Wr.addToast({title:e,...t,id:r}),r},T8=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",k8=A8,R8=()=>Wr.toasts,I8=()=>Wr.getActiveToasts(),ge=Object.assign(k8,{success:Wr.success,info:Wr.info,warning:Wr.warning,error:Wr.error,custom:Wr.custom,message:Wr.message,promise:Wr.promise,dismiss:Wr.dismiss,loading:Wr.loading},{getHistory:R8,getToasts:I8});x8("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-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;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Mf(e){return e.label!==void 0}const M8=3,D8="24px",L8="16px",lE=4e3,$8=356,B8=14,F8=45,z8=200;function ma(...e){return e.filter(Boolean).join(" ")}function q8(e){const[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}const U8=e=>{var t,r,n,a,i,o,u,d,c;const{invert:h,toast:p,unstyled:m,interacting:v,setHeights:x,visibleToasts:y,heights:S,index:j,toasts:N,expanded:E,removeToast:A,defaultRichColors:C,closeButton:O,style:T,cancelButtonStyle:R,actionButtonStyle:L,className:q="",descriptionClassName:F="",duration:B,position:V,gap:G,expandByDefault:W,classNames:H,icons:U,closeButtonAriaLabel:$="Close toast"}=e,[Z,k]=z.useState(null),[I,D]=z.useState(null),[J,ae]=z.useState(!1),[ie,ne]=z.useState(!1),[X,Y]=z.useState(!1),[ee,le]=z.useState(!1),[pe,K]=z.useState(!1),[je,Ce]=z.useState(0),[Le,De]=z.useState(0),tt=z.useRef(p.duration||B||lE),_t=z.useRef(null),ft=z.useRef(null),Zt=j===0,At=j+1<=y,St=p.type,br=p.dismissible!==!1,Ia=p.className||"",la=p.descriptionClassName||"",Ma=z.useMemo(()=>S.findIndex(Qe=>Qe.toastId===p.id)||0,[S,p.id]),hi=z.useMemo(()=>{var Qe;return(Qe=p.closeButton)!=null?Qe:O},[p.closeButton,O]),Da=z.useMemo(()=>p.duration||B||lE,[p.duration,B]),La=z.useRef(0),Br=z.useRef(0),yn=z.useRef(0),ca=z.useRef(null),[rs,ns]=V.split("-"),as=z.useMemo(()=>S.reduce((Qe,Vt,er)=>er>=Ma?Qe:Qe+Vt.height,0),[S,Ma]),be=O8(),ut=p.invert||h,Ut=St==="loading";Br.current=z.useMemo(()=>Ma*G+as,[Ma,as]),z.useEffect(()=>{tt.current=Da},[Da]),z.useEffect(()=>{ae(!0)},[]),z.useEffect(()=>{const Qe=ft.current;if(Qe){const Vt=Qe.getBoundingClientRect().height;return De(Vt),x(er=>[{toastId:p.id,height:Vt,position:p.position},...er]),()=>x(er=>er.filter(wr=>wr.toastId!==p.id))}},[x,p.id]),z.useLayoutEffect(()=>{if(!J)return;const Qe=ft.current,Vt=Qe.style.height;Qe.style.height="auto";const er=Qe.getBoundingClientRect().height;Qe.style.height=Vt,De(er),x(wr=>wr.find(Kt=>Kt.toastId===p.id)?wr.map(Kt=>Kt.toastId===p.id?{...Kt,height:er}:Kt):[{toastId:p.id,height:er,position:p.position},...wr])},[J,p.title,p.description,x,p.id,p.jsx,p.action,p.cancel]);const xn=z.useCallback(()=>{ne(!0),Ce(Br.current),x(Qe=>Qe.filter(Vt=>Vt.toastId!==p.id)),setTimeout(()=>{A(p)},z8)},[p,A,x,Br]);z.useEffect(()=>{if(p.promise&&St==="loading"||p.duration===1/0||p.type==="loading")return;let Qe;return E||v||be?(()=>{if(yn.current{tt.current!==1/0&&(La.current=new Date().getTime(),Qe=setTimeout(()=>{p.onAutoClose==null||p.onAutoClose.call(p,p),xn()},tt.current))})(),()=>clearTimeout(Qe)},[E,v,p,St,be,xn]),z.useEffect(()=>{p.delete&&(xn(),p.onDismiss==null||p.onDismiss.call(p,p))},[xn,p.delete]);function Ql(){var Qe;if(U?.loading){var Vt;return z.createElement("div",{className:ma(H?.loader,p==null||(Vt=p.classNames)==null?void 0:Vt.loader,"sonner-loader"),"data-visible":St==="loading"},U.loading)}return z.createElement(S8,{className:ma(H?.loader,p==null||(Qe=p.classNames)==null?void 0:Qe.loader),visible:St==="loading"})}const pi=p.icon||U?.[St]||b8(St);var $a,Zl;return z.createElement("li",{tabIndex:0,ref:ft,className:ma(q,Ia,H?.toast,p==null||(t=p.classNames)==null?void 0:t.toast,H?.default,H?.[St],p==null||(r=p.classNames)==null?void 0:r[St]),"data-sonner-toast":"","data-rich-colors":($a=p.richColors)!=null?$a:C,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":J,"data-promise":!!p.promise,"data-swiped":pe,"data-removed":ie,"data-visible":At,"data-y-position":rs,"data-x-position":ns,"data-index":j,"data-front":Zt,"data-swiping":X,"data-dismissible":br,"data-type":St,"data-invert":ut,"data-swipe-out":ee,"data-swipe-direction":I,"data-expanded":!!(E||W&&J),"data-testid":p.testId,style:{"--index":j,"--toasts-before":j,"--z-index":N.length-j,"--offset":`${ie?je:Br.current}px`,"--initial-height":W?"auto":`${Le}px`,...T,...p.style},onDragEnd:()=>{Y(!1),k(null),ca.current=null},onPointerDown:Qe=>{Qe.button!==2&&(Ut||!br||(_t.current=new Date,Ce(Br.current),Qe.target.setPointerCapture(Qe.pointerId),Qe.target.tagName!=="BUTTON"&&(Y(!0),ca.current={x:Qe.clientX,y:Qe.clientY})))},onPointerUp:()=>{var Qe,Vt,er;if(ee||!br)return;ca.current=null;const wr=Number(((Qe=ft.current)==null?void 0:Qe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),mi=Number(((Vt=ft.current)==null?void 0:Vt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Kt=new Date().getTime()-((er=_t.current)==null?void 0:er.getTime()),cr=Z==="x"?wr:mi,gi=Math.abs(cr)/Kt;if(Math.abs(cr)>=F8||gi>.11){Ce(Br.current),p.onDismiss==null||p.onDismiss.call(p,p),D(Z==="x"?wr>0?"right":"left":mi>0?"down":"up"),xn(),le(!0);return}else{var gr,Yr;(gr=ft.current)==null||gr.style.setProperty("--swipe-amount-x","0px"),(Yr=ft.current)==null||Yr.style.setProperty("--swipe-amount-y","0px")}K(!1),Y(!1),k(null)},onPointerMove:Qe=>{var Vt,er,wr;if(!ca.current||!br||((Vt=window.getSelection())==null?void 0:Vt.toString().length)>0)return;const Kt=Qe.clientY-ca.current.y,cr=Qe.clientX-ca.current.x;var gi;const gr=(gi=e.swipeDirections)!=null?gi:q8(V);!Z&&(Math.abs(cr)>1||Math.abs(Kt)>1)&&k(Math.abs(cr)>Math.abs(Kt)?"x":"y");let Yr={x:0,y:0};const vi=bn=>1/(1.5+Math.abs(bn)/20);if(Z==="y"){if(gr.includes("top")||gr.includes("bottom"))if(gr.includes("top")&&Kt<0||gr.includes("bottom")&&Kt>0)Yr.y=Kt;else{const bn=Kt*vi(Kt);Yr.y=Math.abs(bn)0)Yr.x=cr;else{const bn=cr*vi(cr);Yr.x=Math.abs(bn)0||Math.abs(Yr.y)>0)&&K(!0),(er=ft.current)==null||er.style.setProperty("--swipe-amount-x",`${Yr.x}px`),(wr=ft.current)==null||wr.style.setProperty("--swipe-amount-y",`${Yr.y}px`)}},hi&&!p.jsx&&St!=="loading"?z.createElement("button",{"aria-label":$,"data-disabled":Ut,"data-close-button":!0,onClick:Ut||!br?()=>{}:()=>{xn(),p.onDismiss==null||p.onDismiss.call(p,p)},className:ma(H?.closeButton,p==null||(n=p.classNames)==null?void 0:n.closeButton)},(Zl=U?.close)!=null?Zl:E8):null,(St||p.icon||p.promise)&&p.icon!==null&&(U?.[St]!==null||p.icon)?z.createElement("div",{"data-icon":"",className:ma(H?.icon,p==null||(a=p.classNames)==null?void 0:a.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Ql():null,p.type!=="loading"?pi:null):null,z.createElement("div",{"data-content":"",className:ma(H?.content,p==null||(i=p.classNames)==null?void 0:i.content)},z.createElement("div",{"data-title":"",className:ma(H?.title,p==null||(o=p.classNames)==null?void 0:o.title)},p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title),p.description?z.createElement("div",{"data-description":"",className:ma(F,la,H?.description,p==null||(u=p.classNames)==null?void 0:u.description)},typeof p.description=="function"?p.description():p.description):null),z.isValidElement(p.cancel)?p.cancel:p.cancel&&Mf(p.cancel)?z.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||R,onClick:Qe=>{Mf(p.cancel)&&br&&(p.cancel.onClick==null||p.cancel.onClick.call(p.cancel,Qe),xn())},className:ma(H?.cancelButton,p==null||(d=p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,z.isValidElement(p.action)?p.action:p.action&&Mf(p.action)?z.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||L,onClick:Qe=>{Mf(p.action)&&(p.action.onClick==null||p.action.onClick.call(p.action,Qe),!Qe.defaultPrevented&&xn())},className:ma(H?.actionButton,p==null||(c=p.classNames)==null?void 0:c.actionButton)},p.action.label):null)};function cE(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function V8(e,t){const r={};return[e,t].forEach((n,a)=>{const i=a===1,o=i?"--mobile-offset":"--offset",u=i?L8:D8;function d(c){["top","right","bottom","left"].forEach(h=>{r[`${o}-${h}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?d(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?r[`${o}-${c}`]=u:r[`${o}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):d(u)}),r}const H8=z.forwardRef(function(t,r){const{id:n,invert:a,position:i="bottom-right",hotkey:o=["altKey","KeyT"],expand:u,closeButton:d,className:c,offset:h,mobileOffset:p,theme:m="light",richColors:v,duration:x,style:y,visibleToasts:S=M8,toastOptions:j,dir:N=cE(),gap:E=B8,icons:A,containerAriaLabel:C="Notifications"}=t,[O,T]=z.useState([]),R=z.useMemo(()=>n?O.filter(J=>J.toasterId===n):O.filter(J=>!J.toasterId),[O,n]),L=z.useMemo(()=>Array.from(new Set([i].concat(R.filter(J=>J.position).map(J=>J.position)))),[R,i]),[q,F]=z.useState([]),[B,V]=z.useState(!1),[G,W]=z.useState(!1),[H,U]=z.useState(m!=="system"?m:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=z.useRef(null),Z=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=z.useRef(null),I=z.useRef(!1),D=z.useCallback(J=>{T(ae=>{var ie;return(ie=ae.find(ne=>ne.id===J.id))!=null&&ie.delete||Wr.dismiss(J.id),ae.filter(({id:ne})=>ne!==J.id)})},[]);return z.useEffect(()=>Wr.subscribe(J=>{if(J.dismiss){requestAnimationFrame(()=>{T(ae=>ae.map(ie=>ie.id===J.id?{...ie,delete:!0}:ie))});return}setTimeout(()=>{rM.flushSync(()=>{T(ae=>{const ie=ae.findIndex(ne=>ne.id===J.id);return ie!==-1?[...ae.slice(0,ie),{...ae[ie],...J},...ae.slice(ie+1)]:[J,...ae]})})})}),[O]),z.useEffect(()=>{if(m!=="system"){U(m);return}if(m==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;const J=window.matchMedia("(prefers-color-scheme: dark)");try{J.addEventListener("change",({matches:ae})=>{U(ae?"dark":"light")})}catch{J.addListener(({matches:ie})=>{try{U(ie?"dark":"light")}catch(ne){console.error(ne)}})}},[m]),z.useEffect(()=>{O.length<=1&&V(!1)},[O]),z.useEffect(()=>{const J=ae=>{var ie;if(o.every(Y=>ae[Y]||ae.code===Y)){var X;V(!0),(X=$.current)==null||X.focus()}ae.code==="Escape"&&(document.activeElement===$.current||(ie=$.current)!=null&&ie.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",J),()=>document.removeEventListener("keydown",J)},[o]),z.useEffect(()=>{if($.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,I.current=!1)}},[$.current]),z.createElement("section",{ref:r,"aria-label":`${C} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},L.map((J,ae)=>{var ie;const[ne,X]=J.split("-");return R.length?z.createElement("ol",{key:J,dir:N==="auto"?cE():N,tabIndex:-1,ref:$,className:c,"data-sonner-toaster":!0,"data-sonner-theme":H,"data-y-position":ne,"data-x-position":X,style:{"--front-toast-height":`${((ie=q[0])==null?void 0:ie.height)||0}px`,"--width":`${$8}px`,"--gap":`${E}px`,...y,...V8(h,p)},onBlur:Y=>{I.current&&!Y.currentTarget.contains(Y.relatedTarget)&&(I.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||I.current||(I.current=!0,k.current=Y.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{G||V(!1)},onDragEnd:()=>V(!1),onPointerDown:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||W(!0)},onPointerUp:()=>W(!1)},R.filter(Y=>!Y.position&&ae===0||Y.position===J).map((Y,ee)=>{var le,pe;return z.createElement(U8,{key:Y.id,icons:A,index:ee,toast:Y,defaultRichColors:v,duration:(le=j?.duration)!=null?le:x,className:j?.className,descriptionClassName:j?.descriptionClassName,invert:a,visibleToasts:S,closeButton:(pe=j?.closeButton)!=null?pe:d,interacting:G,position:J,style:j?.style,unstyled:j?.unstyled,classNames:j?.classNames,cancelButtonStyle:j?.cancelButtonStyle,actionButtonStyle:j?.actionButtonStyle,closeButtonAriaLabel:j?.closeButtonAriaLabel,removeToast:D,toasts:R.filter(K=>K.position==Y.position),heights:q.filter(K=>K.position==Y.position),setHeights:F,expandByDefault:u,gap:E,expanded:B,swipeDirections:t.swipeDirections})})):null}))});/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),G8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),uE=e=>{const t=G8(e);return t.charAt(0).toUpperCase()+t.slice(1)},nM=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var K8={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.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const X8=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...u},d)=>b.createElement("svg",{ref:d,...K8,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:nM("lucide",a),...u},[...o.map(([c,h])=>b.createElement(c,h)),...Array.isArray(i)?i:[i]]));/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qe=(e,t)=>{const r=b.forwardRef(({className:n,...a},i)=>b.createElement(X8,{ref:i,iconNode:t,className:nM(`lucide-${W8(uE(e))}`,`lucide-${e}`,n),...a}));return r.displayName=uE(e),r};/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Y8=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]],J8=qe("arrow-down-a-z",Y8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Q8=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],Z8=qe("arrow-down-right",Q8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ez=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],tz=qe("arrow-left",ez);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rz=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],nz=qe("arrow-up-down",rz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const az=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],aM=qe("arrow-up-right",az);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iz=[["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"}]],oz=qe("calendar",iz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sz=[["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"}]],lz=qe("chart-column",sz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cz=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],iM=qe("check",cz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uz=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],el=qe("chevron-down",uz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dz=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],oM=qe("chevron-left",dz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],tl=qe("chevron-right",fz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hz=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],pz=qe("chevron-up",hz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mz=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],sM=qe("chevrons-up-down",mz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gz=[["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"}]],Vh=qe("circle-help",gz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],yz=qe("circle-user",vz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xz=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],bz=qe("coffee",xz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wz=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],LS=qe("download",wz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Sz=[["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"}]],Ji=qe("ellipsis",Sz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jz=[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]],lM=qe("file-box",jz);/** + * @license lucide-react v0.487.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=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],rl=qe("file-text",_z);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nz=[["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"}]],Cz=qe("grid-3x3",Nz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ez=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Oz=qe("image",Ez);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pz=[["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"}]],cM=qe("layers",Pz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Az=[["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"}]],uM=qe("layout-dashboard",Az);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tz=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],kz=qe("list",Tz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rz=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],Iz=qe("log-out",Rz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mz=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Il=qe("map-pin",Mz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dz=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],Lz=qe("menu",Dz);/** + * @license lucide-react v0.487.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=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],uu=qe("package",$z);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bz=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Bh=qe("pencil",Bz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fz=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],zz=qe("pin",Fz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qz=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],In=qe("plus",qz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uz=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],dM=qe("printer",Uz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vz=[["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"}]],Hz=qe("refresh-cw",Vz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Wz=[["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"}]],Gz=qe("save",Wz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Kz=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],cm=qe("search",Kz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xz=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Hh=qe("settings",Xz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Yz=[["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"}]],Jz=qe("shield",Yz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qz=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],kn=qe("square-pen",Qz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Zz=[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]],e6=qe("store",Zz);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const t6=[["path",{d:"m18 2 4 4",key:"22kx64"}],["path",{d:"m17 7 3-3",key:"1w1zoj"}],["path",{d:"M19 9 8.7 19.3c-1 1-2.5 1-3.4 0l-.6-.6c-1-1-1-2.5 0-3.4L15 5",key:"1exhtz"}],["path",{d:"m9 11 4 4",key:"rovt3i"}],["path",{d:"m5 19-3 3",key:"59f2uf"}],["path",{d:"m14 4 6 6",key:"yqp9t2"}]],gy=qe("syringe",t6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const r6=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]],n6=qe("tablet",r6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const a6=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Wh=qe("tag",a6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const i6=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],o6=qe("timer",i6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const s6=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],du=qe("trash-2",s6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const l6=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],c6=qe("trending-up",l6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const u6=[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],fM=qe("type",u6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const d6=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],f6=qe("upload",d6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const h6=[["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"}]],p6=qe("user",h6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const m6=[["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"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],$S=qe("users",m6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const g6=[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]],v6=qe("utensils",g6);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const y6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ko=qe("x",y6);function hM(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const r=new Array(e.length+t.length);for(let n=0;n({classGroupId:e,validator:t}),pM=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Gh="-",dE=[],w6="arbitrary..",S6=e=>{const t=_6(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return j6(o);const u=o.split(Gh),d=u[0]===""&&u.length>1?1:0;return mM(u,d,t)},getConflictingClassGroupIds:(o,u)=>{if(u){const d=n[o],c=r[o];return d?c?x6(c,d):d:c||dE}return r[o]||dE}}},mM=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const a=e[t],i=r.nextPart.get(a);if(i){const c=mM(e,t+1,i);if(c)return c}const o=r.validators;if(o===null)return;const u=t===0?e.join(Gh):e.slice(t).join(Gh),d=o.length;for(let c=0;ce.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?w6+n:void 0})(),_6=e=>{const{theme:t,classGroups:r}=e;return N6(r,t)},N6=(e,t)=>{const r=pM();for(const n in e){const a=e[n];BS(a,r,n,t)}return r},BS=(e,t,r,n)=>{const a=e.length;for(let i=0;i{if(typeof e=="string"){E6(e,t,r);return}if(typeof e=="function"){O6(e,t,r,n);return}P6(e,t,r,n)},E6=(e,t,r)=>{const n=e===""?t:gM(t,e);n.classGroupId=r},O6=(e,t,r,n)=>{if(A6(e)){BS(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(b6(r,e))},P6=(e,t,r,n)=>{const a=Object.entries(e),i=a.length;for(let o=0;o{let r=e;const n=t.split(Gh),a=n.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,T6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const a=(i,o)=>{r[i]=o,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let o=r[i];if(o!==void 0)return o;if((o=n[i])!==void 0)return a(i,o),o},set(i,o){i in r?r[i]=o:a(i,o)}}},G1="!",fE=":",k6=[],hE=(e,t,r,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),R6=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const i=[];let o=0,u=0,d=0,c;const h=a.length;for(let y=0;yd?c-d:void 0;return hE(i,v,m,x)};if(t){const a=t+fE,i=n;n=o=>o.startsWith(a)?i(o.slice(a.length)):hE(k6,!1,o,void 0,!0)}if(r){const a=n;n=i=>r({className:i,parseClassName:a})}return n},I6=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let a=[];for(let i=0;i0&&(a.sort(),n.push(...a),a=[]),n.push(o)):a.push(o)}return a.length>0&&(a.sort(),n.push(...a)),n}},M6=e=>({cache:T6(e.cacheSize),parseClassName:R6(e),sortModifiers:I6(e),...S6(e)}),D6=/\s+/,L6=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=t,o=[],u=e.trim().split(D6);let d="";for(let c=u.length-1;c>=0;c-=1){const h=u[c],{isExternal:p,modifiers:m,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:y}=r(h);if(p){d=h+(d.length>0?" "+d:d);continue}let S=!!y,j=n(S?x.substring(0,y):x);if(!j){if(!S){d=h+(d.length>0?" "+d:d);continue}if(j=n(x),!j){d=h+(d.length>0?" "+d:d);continue}S=!1}const N=m.length===0?"":m.length===1?m[0]:i(m).join(":"),E=v?N+G1:N,A=E+j;if(o.indexOf(A)>-1)continue;o.push(A);const C=a(j,S);for(let O=0;O0?" "+d:d)}return d},$6=(...e)=>{let t=0,r,n,a="";for(;t{if(typeof e=="string")return e;let t,r="";for(let n=0;n{let r,n,a,i;const o=d=>{const c=t.reduce((h,p)=>p(h),e());return r=M6(c),n=r.cache.get,a=r.cache.set,i=u,u(d)},u=d=>{const c=n(d);if(c)return c;const h=L6(d,r);return a(d,h),h};return i=o,(...d)=>i($6(...d))},F6=[],nr=e=>{const t=r=>r[e]||F6;return t.isThemeGetter=!0,t},yM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,z6=/^\d+\/\d+$/,q6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,U6=/\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$/,V6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,H6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Es=e=>z6.test(e),rt=e=>!!e&&!Number.isNaN(Number(e)),Li=e=>!!e&&Number.isInteger(Number(e)),vy=e=>e.endsWith("%")&&rt(e.slice(0,-1)),Ga=e=>q6.test(e),G6=()=>!0,K6=e=>U6.test(e)&&!V6.test(e),bM=()=>!1,X6=e=>H6.test(e),Y6=e=>W6.test(e),J6=e=>!ke(e)&&!Re(e),Q6=e=>Ml(e,jM,bM),ke=e=>yM.test(e),xo=e=>Ml(e,_M,K6),yy=e=>Ml(e,nq,rt),pE=e=>Ml(e,wM,bM),Z6=e=>Ml(e,SM,Y6),Df=e=>Ml(e,NM,X6),Re=e=>xM.test(e),Mc=e=>Dl(e,_M),eq=e=>Dl(e,aq),mE=e=>Dl(e,wM),tq=e=>Dl(e,jM),rq=e=>Dl(e,SM),Lf=e=>Dl(e,NM,!0),Ml=(e,t,r)=>{const n=yM.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Dl=(e,t,r=!1)=>{const n=xM.exec(e);return n?n[1]?t(n[1]):r:!1},wM=e=>e==="position"||e==="percentage",SM=e=>e==="image"||e==="url",jM=e=>e==="length"||e==="size"||e==="bg-size",_M=e=>e==="length",nq=e=>e==="number",aq=e=>e==="family-name",NM=e=>e==="shadow",iq=()=>{const e=nr("color"),t=nr("font"),r=nr("text"),n=nr("font-weight"),a=nr("tracking"),i=nr("leading"),o=nr("breakpoint"),u=nr("container"),d=nr("spacing"),c=nr("radius"),h=nr("shadow"),p=nr("inset-shadow"),m=nr("text-shadow"),v=nr("drop-shadow"),x=nr("blur"),y=nr("perspective"),S=nr("aspect"),j=nr("ease"),N=nr("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...A(),Re,ke],O=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],R=()=>[Re,ke,d],L=()=>[Es,"full","auto",...R()],q=()=>[Li,"none","subgrid",Re,ke],F=()=>["auto",{span:["full",Li,Re,ke]},Li,Re,ke],B=()=>[Li,"auto",Re,ke],V=()=>["auto","min","max","fr",Re,ke],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...R()],U=()=>[Es,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],$=()=>[e,Re,ke],Z=()=>[...A(),mE,pE,{position:[Re,ke]}],k=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",tq,Q6,{size:[Re,ke]}],D=()=>[vy,Mc,xo],J=()=>["","none","full",c,Re,ke],ae=()=>["",rt,Mc,xo],ie=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[rt,vy,mE,pE],Y=()=>["","none",x,Re,ke],ee=()=>["none",rt,Re,ke],le=()=>["none",rt,Re,ke],pe=()=>[rt,Re,ke],K=()=>[Es,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ga],breakpoint:[Ga],color:[G6],container:[Ga],"drop-shadow":[Ga],ease:["in","out","in-out"],font:[J6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ga],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ga],shadow:[Ga],spacing:["px",rt],text:[Ga],"text-shadow":[Ga],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Es,ke,Re,S]}],container:["container"],columns:[{columns:[rt,ke,Re,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"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:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[Li,"auto",Re,ke]}],basis:[{basis:[Es,"full","auto",u,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[rt,Es,"auto","initial","none",ke]}],grow:[{grow:["",rt,Re,ke]}],shrink:[{shrink:["",rt,Re,ke]}],order:[{order:[Li,"first","last","none",Re,ke]}],"grid-cols":[{"grid-cols":q()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":q()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[u,"screen",...U()]}],"min-w":[{"min-w":[u,"screen","none",...U()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[o]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",r,Mc,xo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Re,yy]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",vy,ke]}],"font-family":[{font:[eq,ke,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:[a,Re,ke]}],"line-clamp":[{"line-clamp":[rt,"none",Re,yy]}],leading:[{leading:[i,...R()]}],"list-image":[{"list-image":["none",Re,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Re,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[rt,"from-font","auto",Re,xo]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[rt,"auto",Re,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re,ke]}],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",Re,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:k()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Li,Re,ke],radial:["",Re,ke],conic:[Li,Re,ke]},rq,Z6]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:J()}],"rounded-s":[{"rounded-s":J()}],"rounded-e":[{"rounded-e":J()}],"rounded-t":[{"rounded-t":J()}],"rounded-r":[{"rounded-r":J()}],"rounded-b":[{"rounded-b":J()}],"rounded-l":[{"rounded-l":J()}],"rounded-ss":[{"rounded-ss":J()}],"rounded-se":[{"rounded-se":J()}],"rounded-ee":[{"rounded-ee":J()}],"rounded-es":[{"rounded-es":J()}],"rounded-tl":[{"rounded-tl":J()}],"rounded-tr":[{"rounded-tr":J()}],"rounded-br":[{"rounded-br":J()}],"rounded-bl":[{"rounded-bl":J()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[rt,Re,ke]}],"outline-w":[{outline:["",rt,Mc,xo]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",h,Lf,Df]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",p,Lf,Df]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[rt,xo]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",m,Lf,Df]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[rt,Re,ke]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"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":[rt]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Re,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[rt]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:k()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Re,ke]}],filter:[{filter:["","none",Re,ke]}],blur:[{blur:Y()}],brightness:[{brightness:[rt,Re,ke]}],contrast:[{contrast:[rt,Re,ke]}],"drop-shadow":[{"drop-shadow":["","none",v,Lf,Df]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",rt,Re,ke]}],"hue-rotate":[{"hue-rotate":[rt,Re,ke]}],invert:[{invert:["",rt,Re,ke]}],saturate:[{saturate:[rt,Re,ke]}],sepia:[{sepia:["",rt,Re,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Re,ke]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[rt,Re,ke]}],"backdrop-contrast":[{"backdrop-contrast":[rt,Re,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",rt,Re,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[rt,Re,ke]}],"backdrop-invert":[{"backdrop-invert":["",rt,Re,ke]}],"backdrop-opacity":[{"backdrop-opacity":[rt,Re,ke]}],"backdrop-saturate":[{"backdrop-saturate":[rt,Re,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",rt,Re,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Re,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[rt,"initial",Re,ke]}],ease:[{ease:["linear","initial",j,Re,ke]}],delay:[{delay:[rt,Re,ke]}],animate:[{animate:["none",N,Re,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Re,ke]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ee()}],"rotate-x":[{"rotate-x":ee()}],"rotate-y":[{"rotate-y":ee()}],"rotate-z":[{"rotate-z":ee()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":["scale-3d"],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[Re,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:K()}],"translate-x":[{"translate-x":K()}],"translate-y":[{"translate-y":K()}],"translate-z":[{"translate-z":K()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"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",Re,ke]}],"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":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",Re,ke]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[rt,Mc,xo,yy]}],stroke:[{stroke:["none",...$()]}],"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"]}},oq=B6(iq);function Ae(...e){return oq(et(e))}function gE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Mn(...e){return t=>{let r=!1;const n=e.map(a=>{const i=gE(a,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a{const{children:i,...o}=n,u=b.Children.toArray(i),d=u.find(uq);if(d){const c=d.props.children,h=u.map(p=>p===d?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:p);return s.jsx(t,{...o,ref:a,children:b.isValidElement(c)?b.cloneElement(c,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function lq(e){const t=b.forwardRef((r,n)=>{const{children:a,...i}=r;if(b.isValidElement(a)){const o=fq(a),u=dq(i,a.props);return a.type!==b.Fragment&&(u.ref=n?Mn(n,o):o),b.cloneElement(a,u)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cq=Symbol("radix.slottable");function uq(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cq}function dq(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function fq(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var hq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ye=hq.reduce((e,t)=>{const r=sq(`Primitive.${t}`),n=b.forwardRef((a,i)=>{const{asChild:o,...u}=a,d=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function pq(e,t){e&&Ju.flushSync(()=>e.dispatchEvent(t))}var Qt=globalThis?.document?b.useLayoutEffect:()=>{};function mq(e,t){return b.useReducer((r,n)=>t[r][n]??r,e)}var mn=e=>{const{present:t,children:r}=e,n=gq(t),a=typeof r=="function"?r({present:n.isPresent}):b.Children.only(r),i=it(n.ref,vq(a));return typeof r=="function"||n.isPresent?b.cloneElement(a,{ref:i}):null};mn.displayName="Presence";function gq(e){const[t,r]=b.useState(),n=b.useRef(null),a=b.useRef(e),i=b.useRef("none"),o=e?"mounted":"unmounted",[u,d]=mq(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const c=$f(n.current);i.current=u==="mounted"?c:"none"},[u]),Qt(()=>{const c=n.current,h=a.current;if(h!==e){const m=i.current,v=$f(c);e?d("MOUNT"):v==="none"||c?.display==="none"?d("UNMOUNT"):d(h&&m!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Qt(()=>{if(t){let c;const h=t.ownerDocument.defaultView??window,p=v=>{const y=$f(n.current).includes(CSS.escape(v.animationName));if(v.target===t&&y&&(d("ANIMATION_END"),!a.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",c=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},m=v=>{v.target===t&&(i.current=$f(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:b.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function $f(e){return e?.animationName||"none"}function vq(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function yq(e,t){const r=b.createContext(t),n=i=>{const{children:o,...u}=i,d=b.useMemo(()=>u,Object.values(u));return s.jsx(r.Provider,{value:d,children:o})};n.displayName=e+"Provider";function a(i){const o=b.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,a]}function li(e,t=[]){let r=[];function n(i,o){const u=b.createContext(o),d=r.length;r=[...r,o];const c=p=>{const{scope:m,children:v,...x}=p,y=m?.[e]?.[d]||u,S=b.useMemo(()=>x,Object.values(x));return s.jsx(y.Provider,{value:S,children:v})};c.displayName=i+"Provider";function h(p,m){const v=m?.[e]?.[d]||u,x=b.useContext(v);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[c,h]}const a=()=>{const i=r.map(o=>b.createContext(o));return function(u){const d=u?.[e]||i;return b.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[n,xq(a,...t)]}function xq(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((u,{useScope:d,scopeName:c})=>{const p=d(i)[`__scope${c}`];return{...u,...p}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function kr(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...r)=>t.current?.(...r),[])}var bq=b.createContext(void 0);function CM(e){const t=b.useContext(bq);return e||t||"ltr"}function K1(e,[t,r]){return Math.min(r,Math.max(t,e))}function Je(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),r===!1||!a.defaultPrevented)return t?.(a)}}function wq(e,t){return b.useReducer((r,n)=>t[r][n]??r,e)}var FS="ScrollArea",[EM]=li(FS),[Sq,Ln]=EM(FS),OM=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:a,scrollHideDelay:i=600,...o}=e,[u,d]=b.useState(null),[c,h]=b.useState(null),[p,m]=b.useState(null),[v,x]=b.useState(null),[y,S]=b.useState(null),[j,N]=b.useState(0),[E,A]=b.useState(0),[C,O]=b.useState(!1),[T,R]=b.useState(!1),L=it(t,F=>d(F)),q=CM(a);return s.jsx(Sq,{scope:r,type:n,dir:q,scrollHideDelay:i,scrollArea:u,viewport:c,onViewportChange:h,content:p,onContentChange:m,scrollbarX:v,onScrollbarXChange:x,scrollbarXEnabled:C,onScrollbarXEnabledChange:O,scrollbarY:y,onScrollbarYChange:S,scrollbarYEnabled:T,onScrollbarYEnabledChange:R,onCornerWidthChange:N,onCornerHeightChange:A,children:s.jsx(Ye.div,{dir:q,...o,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});OM.displayName=FS;var PM="ScrollAreaViewport",AM=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:a,...i}=e,o=Ln(PM,r),u=b.useRef(null),d=it(t,u,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(Ye.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});AM.displayName=PM;var Ea="ScrollAreaScrollbar",TM=b.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=Ln(Ea,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,u=e.orientation==="horizontal";return b.useEffect(()=>(u?i(!0):o(!0),()=>{u?i(!1):o(!1)}),[u,i,o]),a.type==="hover"?s.jsx(jq,{...n,ref:t,forceMount:r}):a.type==="scroll"?s.jsx(_q,{...n,ref:t,forceMount:r}):a.type==="auto"?s.jsx(kM,{...n,ref:t,forceMount:r}):a.type==="always"?s.jsx(zS,{...n,ref:t}):null});TM.displayName=Ea;var jq=b.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=Ln(Ea,e.__scopeScrollArea),[i,o]=b.useState(!1);return b.useEffect(()=>{const u=a.scrollArea;let d=0;if(u){const c=()=>{window.clearTimeout(d),o(!0)},h=()=>{d=window.setTimeout(()=>o(!1),a.scrollHideDelay)};return u.addEventListener("pointerenter",c),u.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",c),u.removeEventListener("pointerleave",h)}}},[a.scrollArea,a.scrollHideDelay]),s.jsx(mn,{present:r||i,children:s.jsx(kM,{"data-state":i?"visible":"hidden",...n,ref:t})})}),_q=b.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=Ln(Ea,e.__scopeScrollArea),i=e.orientation==="horizontal",o=dm(()=>d("SCROLL_END"),100),[u,d]=wq("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(u==="idle"){const c=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(c)}},[u,a.scrollHideDelay,d]),b.useEffect(()=>{const c=a.viewport,h=i?"scrollLeft":"scrollTop";if(c){let p=c[h];const m=()=>{const v=c[h];p!==v&&(d("SCROLL"),o()),p=v};return c.addEventListener("scroll",m),()=>c.removeEventListener("scroll",m)}},[a.viewport,i,d,o]),s.jsx(mn,{present:r||u!=="hidden",children:s.jsx(zS,{"data-state":u==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:Je(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Je(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),kM=b.forwardRef((e,t)=>{const r=Ln(Ea,e.__scopeScrollArea),{forceMount:n,...a}=e,[i,o]=b.useState(!1),u=e.orientation==="horizontal",d=dm(()=>{if(r.viewport){const c=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,a=Ln(Ea,e.__scopeScrollArea),i=b.useRef(null),o=b.useRef(0),[u,d]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=LM(u.viewport,u.content),h={...n,sizes:u,onSizesChange:d,hasThumb:c>0&&c<1,onThumbChange:m=>i.current=m,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:m=>o.current=m};function p(m,v){return Aq(m,o.current,u,v)}return r==="horizontal"?s.jsx(Nq,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const m=a.viewport.scrollLeft,v=vE(m,u,a.dir);i.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollLeft=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollLeft=p(m,a.dir))}}):r==="vertical"?s.jsx(Cq,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const m=a.viewport.scrollTop,v=vE(m,u);i.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollTop=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollTop=p(m))}}):null}),Nq=b.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...a}=e,i=Ln(Ea,e.__scopeScrollArea),[o,u]=b.useState(),d=b.useRef(null),c=it(t,d,i.onScrollbarXChange);return b.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),s.jsx(IM,{"data-orientation":"horizontal",...a,ref:c,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":um(r)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const m=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(m),BM(m,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Xh(o.paddingLeft),paddingEnd:Xh(o.paddingRight)}})}})}),Cq=b.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...a}=e,i=Ln(Ea,e.__scopeScrollArea),[o,u]=b.useState(),d=b.useRef(null),c=it(t,d,i.onScrollbarYChange);return b.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),s.jsx(IM,{"data-orientation":"vertical",...a,ref:c,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":um(r)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const m=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(m),BM(m,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Xh(o.paddingTop),paddingEnd:Xh(o.paddingBottom)}})}})}),[Eq,RM]=EM(Ea),IM=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:c,onWheelScroll:h,onResize:p,...m}=e,v=Ln(Ea,r),[x,y]=b.useState(null),S=it(t,L=>y(L)),j=b.useRef(null),N=b.useRef(""),E=v.viewport,A=n.content-n.viewport,C=kr(h),O=kr(d),T=dm(p,10);function R(L){if(j.current){const q=L.clientX-j.current.left,F=L.clientY-j.current.top;c({x:q,y:F})}}return b.useEffect(()=>{const L=q=>{const F=q.target;x?.contains(F)&&C(q,A)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[E,x,A,C]),b.useEffect(O,[n,O]),nl(x,T),nl(v.content,T),s.jsx(Eq,{scope:r,scrollbar:x,hasThumb:a,onThumbChange:kr(i),onThumbPointerUp:kr(o),onThumbPositionChange:O,onThumbPointerDown:kr(u),children:s.jsx(Ye.div,{...m,ref:S,style:{position:"absolute",...m.style},onPointerDown:Je(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),j.current=x.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),R(L))}),onPointerMove:Je(e.onPointerMove,R),onPointerUp:Je(e.onPointerUp,L=>{const q=L.target;q.hasPointerCapture(L.pointerId)&&q.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=N.current,v.viewport&&(v.viewport.style.scrollBehavior=""),j.current=null})})})}),Kh="ScrollAreaThumb",MM=b.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=RM(Kh,e.__scopeScrollArea);return s.jsx(mn,{present:r||a.hasThumb,children:s.jsx(Oq,{ref:t,...n})})}),Oq=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...a}=e,i=Ln(Kh,r),o=RM(Kh,r),{onThumbPositionChange:u}=o,d=it(t,p=>o.onThumbChange(p)),c=b.useRef(void 0),h=dm(()=>{c.current&&(c.current(),c.current=void 0)},100);return b.useEffect(()=>{const p=i.viewport;if(p){const m=()=>{if(h(),!c.current){const v=Tq(p,u);c.current=v,u()}};return u(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[i.viewport,h,u]),s.jsx(Ye.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Je(e.onPointerDownCapture,p=>{const v=p.target.getBoundingClientRect(),x=p.clientX-v.left,y=p.clientY-v.top;o.onThumbPointerDown({x,y})}),onPointerUp:Je(e.onPointerUp,o.onThumbPointerUp)})});MM.displayName=Kh;var qS="ScrollAreaCorner",DM=b.forwardRef((e,t)=>{const r=Ln(qS,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?s.jsx(Pq,{...e,ref:t}):null});DM.displayName=qS;var Pq=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,a=Ln(qS,r),[i,o]=b.useState(0),[u,d]=b.useState(0),c=!!(i&&u);return nl(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),nl(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),c?s.jsx(Ye.div,{...n,ref:t,style:{width:i,height:u,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Xh(e){return e?parseInt(e,10):0}function LM(e,t){const r=e/t;return isNaN(r)?0:r}function um(e){const t=LM(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Aq(e,t,r,n="ltr"){const a=um(r),i=a/2,o=t||i,u=a-o,d=r.scrollbar.paddingStart+o,c=r.scrollbar.size-r.scrollbar.paddingEnd-u,h=r.content-r.viewport,p=n==="ltr"?[0,h]:[h*-1,0];return $M([d,c],p)(e)}function vE(e,t,r="ltr"){const n=um(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,u=i-n,d=r==="ltr"?[0,o]:[o*-1,0],c=K1(e,d);return $M([0,o],[0,u])(c)}function $M(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function BM(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function a(){const i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,u=r.top!==i.top;(o||u)&&t(),r=i,n=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(n)};function dm(e,t){const r=kr(e),n=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(n.current),[]),b.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function nl(e,t){const r=kr(t);Qt(()=>{let n=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return a.observe(e),()=>{window.cancelAnimationFrame(n),a.unobserve(e)}}},[e,r])}var kq=OM,Rq=AM,Iq=DM;function al({className:e,children:t,...r}){return s.jsxs(kq,{"data-slot":"scroll-area",className:Ae("relative",e),...r,children:[s.jsx(Rq,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),s.jsx(Mq,{}),s.jsx(Iq,{})]})}function Mq({className:e,orientation:t="vertical",...r}){return s.jsx(TM,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Ae("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:s.jsx(MM,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const Dq="/assets/773f0c39e1986271e9144596caac519f934a6ae6-Cou8J2R8.png";function Lq({currentView:e,setCurrentView:t}){const[r,n]=b.useState(!0),a=[{name:"Dashboard",icon:uM,type:"item"},{type:"header",name:"MODULES"},{name:"Labeling",icon:Wh,type:"sub",isOpen:r,toggle:()=>n(!r),children:[{name:"Labels",icon:Wh},{name:"Label Categories",icon:cM},{name:"Label Types",icon:fM},{name:"Label Templates",icon:lM},{name:"Multiple Options",icon:Hh}]},{type:"header",name:"MANAGEMENT"},{name:"Location Manager",icon:Il,type:"item"},{type:"header",name:"SYSTEM MANAGEMENT"},{name:"Account Management",icon:$S,type:"item"},{name:"Menu Management",icon:uu,type:"item"},{name:"System Menu",icon:Hh,type:"item"},{name:"Reports",icon:rl,type:"item"},{name:"Support",icon:Vh,type:"item"},{name:"Log Out",icon:Iz,type:"item"}];return s.jsxs("div",{className:"w-64 bg-[#1e3a8a] text-white flex flex-col h-screen border-r border-blue-800 shadow-xl z-20 shrink-0",children:[s.jsx("div",{className:"flex items-center justify-center border-b border-blue-800/50 bg-white px-4 shrink-0",style:{height:90},children:s.jsx("img",{src:Dq,alt:"MedVantage",className:"h-16 w-auto object-contain"})}),s.jsx(al,{className:"flex-1 py-4",children:s.jsx("div",{className:"px-3 space-y-1",children:a.map((i,o)=>i.type==="header"?s.jsx("div",{className:"px-4 py-2 mt-4 text-xs font-semibold text-blue-300 uppercase tracking-wider",children:i.name},o):i.type==="sub"?s.jsxs("div",{className:"space-y-1",children:[s.jsxs("button",{onClick:i.toggle,className:Ae("w-full flex items-center justify-between px-4 py-2.5 text-sm font-medium rounded-lg transition-colors","hover:bg-blue-800/50 text-blue-100"),children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(i.icon,{className:"w-4 h-4"}),i.name]}),i.isOpen?s.jsx(el,{className:"w-4 h-4"}):s.jsx(tl,{className:"w-4 h-4"})]}),i.isOpen&&s.jsx("div",{className:"pl-4 space-y-1",children:i.children?.map((u,d)=>s.jsxs("button",{onClick:()=>t(u.name),className:Ae("w-full flex items-center gap-3 px-4 py-2 text-sm font-medium rounded-lg transition-colors border-l-2",e===u.name?"bg-blue-800 border-blue-400 text-white":"border-transparent hover:bg-blue-800/30 text-blue-200 hover:text-white"),children:[s.jsx("div",{className:"w-1 h-1 rounded-full bg-current"}),u.name]},d))})]},o):s.jsxs("button",{onClick:()=>t(i.name),className:Ae("w-full flex items-center gap-3 px-4 py-2.5 text-sm font-medium rounded-lg transition-colors",e===i.name?"bg-blue-700 text-white shadow-md shadow-blue-900/20":i.name==="Log Out"?"text-red-300 hover:bg-red-900/20 hover:text-red-200":"text-blue-100 hover:bg-blue-800 hover:text-white"),children:[s.jsx(i.icon,{className:"w-4 h-4"}),i.name]},o))})})]})}function me({className:e,type:t,...r}){return s.jsx("input",{type:t,"data-slot":"input",className:Ae("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var $q=Symbol.for("react.lazy"),Yh=DS[" use ".trim().toString()];function Bq(e){return typeof e=="object"&&e!==null&&"then"in e}function FM(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===$q&&"_payload"in e&&Bq(e._payload)}function US(e){const t=Fq(e),r=b.forwardRef((n,a)=>{let{children:i,...o}=n;FM(i)&&typeof Yh=="function"&&(i=Yh(i._payload));const u=b.Children.toArray(i),d=u.find(qq);if(d){const c=d.props.children,h=u.map(p=>p===d?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:p);return s.jsx(t,{...o,ref:a,children:b.isValidElement(c)?b.cloneElement(c,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}var zM=US("Slot");function Fq(e){const t=b.forwardRef((r,n)=>{let{children:a,...i}=r;if(FM(a)&&typeof Yh=="function"&&(a=Yh(a._payload)),b.isValidElement(a)){const o=Vq(a),u=Uq(i,a.props);return a.type!==b.Fragment&&(u.ref=n?Mn(n,o):o),b.cloneElement(a,u)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zq=Symbol("radix.slottable");function qq(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zq}function Uq(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function Vq(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const yE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,xE=et,qM=(e,t)=>r=>{var n;if(t?.variants==null)return xE(e,r?.class,r?.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(c=>{const h=r?.[c],p=i?.[c];if(h===null)return null;const m=yE(h)||yE(p);return a[c][m]}),u=r&&Object.entries(r).reduce((c,h)=>{let[p,m]=h;return m===void 0||(c[p]=m),c},{}),d=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,h)=>{let{class:p,className:m,...v}=h;return Object.entries(v).every(x=>{let[y,S]=x;return Array.isArray(S)?S.includes({...i,...u}[y]):{...i,...u}[y]===S})?[...c,p,m]:c},[]);return xE(e,o,d,r?.class,r?.className)},UM=qM("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),fe=b.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},i)=>{const o=n?zM:"button";return s.jsx(o,{ref:i,"data-slot":"button",className:Ae(UM({variant:t,size:r,className:e})),...a})});fe.displayName="Button";function Hq(e,t=[]){let r=[];function n(i,o){const u=b.createContext(o);u.displayName=i+"Context";const d=r.length;r=[...r,o];const c=p=>{const{scope:m,children:v,...x}=p,y=m?.[e]?.[d]||u,S=b.useMemo(()=>x,Object.values(x));return s.jsx(y.Provider,{value:S,children:v})};c.displayName=i+"Provider";function h(p,m){const v=m?.[e]?.[d]||u,x=b.useContext(v);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[c,h]}const a=()=>{const i=r.map(o=>b.createContext(o));return function(u){const d=u?.[e]||i;return b.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[n,Wq(a,...t)]}function Wq(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((u,{useScope:d,scopeName:c})=>{const p=d(i)[`__scope${c}`];return{...u,...p}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Gq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],VS=Gq.reduce((e,t)=>{const r=US(`Primitive.${t}`),n=b.forwardRef((a,i)=>{const{asChild:o,...u}=a,d=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),xy={exports:{}},by={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var bE;function Kq(){if(bE)return by;bE=1;var e=lm();function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,a=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function u(p,m){var v=m(),x=n({inst:{value:v,getSnapshot:m}}),y=x[0].inst,S=x[1];return i(function(){y.value=v,y.getSnapshot=m,d(y)&&S({inst:y})},[p,v,m]),a(function(){return d(y)&&S({inst:y}),p(function(){d(y)&&S({inst:y})})},[p]),o(v),v}function d(p){var m=p.getSnapshot;p=p.value;try{var v=m();return!r(p,v)}catch{return!0}}function c(p,m){return m()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:u;return by.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,by}var wE;function Xq(){return wE||(wE=1,xy.exports=Kq()),xy.exports}var Yq=Xq();function Jq(){return Yq.useSyncExternalStore(Qq,()=>!0,()=>!1)}function Qq(){return()=>{}}var HS="Avatar",[Zq]=Hq(HS),[eU,VM]=Zq(HS),HM=b.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[a,i]=b.useState("idle");return s.jsx(eU,{scope:r,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:s.jsx(VS.span,{...n,ref:t})})});HM.displayName=HS;var WM="AvatarImage",GM=b.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:a=()=>{},...i}=e,o=VM(WM,r),u=tU(n,i),d=kr(c=>{a(c),o.onImageLoadingStatusChange(c)});return Qt(()=>{u!=="idle"&&d(u)},[u,d]),u==="loaded"?s.jsx(VS.img,{...i,ref:t,src:n}):null});GM.displayName=WM;var KM="AvatarFallback",XM=b.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...a}=e,i=VM(KM,r),[o,u]=b.useState(n===void 0);return b.useEffect(()=>{if(n!==void 0){const d=window.setTimeout(()=>u(!0),n);return()=>window.clearTimeout(d)}},[n]),o&&i.imageLoadingStatus!=="loaded"?s.jsx(VS.span,{...a,ref:t}):null});XM.displayName=KM;function SE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function tU(e,{referrerPolicy:t,crossOrigin:r}){const n=Jq(),a=b.useRef(null),i=n?(a.current||(a.current=new window.Image),a.current):null,[o,u]=b.useState(()=>SE(i,e));return Qt(()=>{u(SE(i,e))},[i,e]),Qt(()=>{const d=p=>()=>{u(p)};if(!i)return;const c=d("loaded"),h=d("error");return i.addEventListener("load",c),i.addEventListener("error",h),t&&(i.referrerPolicy=t),typeof r=="string"&&(i.crossOrigin=r),()=>{i.removeEventListener("load",c),i.removeEventListener("error",h)}},[i,r,t]),o}var rU=HM,nU=GM,aU=XM;function iU({className:e,...t}){return s.jsx(rU,{"data-slot":"avatar",className:Ae("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function oU({className:e,...t}){return s.jsx(nU,{"data-slot":"avatar-image",className:Ae("aspect-square size-full",e),...t})}function sU({className:e,...t}){return s.jsx(aU,{"data-slot":"avatar-fallback",className:Ae("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function lU({title:e}){const t=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});return s.jsxs("header",{className:"bg-white border-b border-gray-200 px-8 flex items-center justify-between shadow-sm sticky top-0 z-10 shrink-0",style:{height:90},children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl font-bold",style:{color:"rgb(43, 50, 143)"},children:[e," Overview"]}),s.jsxs("p",{className:"text-sm text-gray-500 mt-1 flex items-center gap-2",children:[t," | Last updated: Just now"]})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"flex items-center w-64 h-9 rounded-md border border-gray-200 bg-gray-50 focus-within:bg-white focus-within:ring-2 focus-within:ring-ring/50 focus-within:border-ring transition-colors overflow-hidden",children:[s.jsx(cm,{className:"h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none"}),s.jsx(me,{type:"search",placeholder:"Search...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full"})]}),s.jsx(fe,{variant:"ghost",size:"icon",className:"text-gray-500 hover:text-gray-700",children:s.jsx(Hh,{className:"w-5 h-5"})}),s.jsx("div",{className:"h-8 w-px bg-gray-200 mx-2"}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"text-right hidden md:block",children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Admin User"}),s.jsx("div",{className:"text-xs text-gray-500",children:"Administrator"})]}),s.jsxs(iU,{className:"h-10 w-10 border border-gray-200",children:[s.jsx(oU,{src:"https://github.com/shadcn.png"}),s.jsx(sU,{children:"AD"})]})]})]})]})}function cU({children:e,currentView:t,setCurrentView:r}){return s.jsxs("div",{className:"flex h-screen bg-gray-50 overflow-hidden font-sans",children:[s.jsx(Lq,{currentView:t,setCurrentView:r}),s.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[s.jsx(lU,{title:t}),s.jsx("div",{className:"px-8 mt-8 shrink-0",children:s.jsxs("nav",{className:"flex items-center gap-2 text-sm font-normal","aria-label":"Breadcrumb",children:[s.jsx("button",{type:"button",onClick:()=>r("Dashboard"),className:"text-gray-500 hover:text-gray-700 transition-colors",children:"Home"}),s.jsx(tl,{className:"w-4 h-4 text-gray-500 shrink-0"}),s.jsx("span",{style:{color:"rgb(43, 50, 143)"},children:t})]})}),s.jsx("main",{className:"flex-1 overflow-y-auto p-8",children:s.jsx("div",{className:"w-full h-full",children:e})})]})]})}function sn({className:e,...t}){return s.jsx("div",{"data-slot":"card",className:Ae("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border",e),...t})}function Yn({className:e,...t}){return s.jsx("div",{"data-slot":"card-header",className:Ae("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function Jn({className:e,...t}){return s.jsx("h4",{"data-slot":"card-title",className:Ae("leading-none",e),...t})}function Jh({className:e,...t}){return s.jsx("p",{"data-slot":"card-description",className:Ae("text-muted-foreground",e),...t})}function An({className:e,...t}){return s.jsx("div",{"data-slot":"card-content",className:Ae("px-6 [&:last-child]:pb-6",e),...t})}const uU=qM("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Or({className:e,variant:t,asChild:r=!1,...n}){const a=r?zM:"span";return s.jsx(a,{"data-slot":"badge",className:Ae(uU({variant:t}),e),...n})}var wy,jE;function Xr(){if(jE)return wy;jE=1;var e=Array.isArray;return wy=e,wy}var Sy,_E;function YM(){if(_E)return Sy;_E=1;var e=typeof Rf=="object"&&Rf&&Rf.Object===Object&&Rf;return Sy=e,Sy}var jy,NE;function Oa(){if(NE)return jy;NE=1;var e=YM(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return jy=r,jy}var _y,CE;function Qu(){if(CE)return _y;CE=1;var e=Oa(),t=e.Symbol;return _y=t,_y}var Ny,EE;function dU(){if(EE)return Ny;EE=1;var e=Qu(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,a=e?e.toStringTag:void 0;function i(o){var u=r.call(o,a),d=o[a];try{o[a]=void 0;var c=!0}catch{}var h=n.call(o);return c&&(u?o[a]=d:delete o[a]),h}return Ny=i,Ny}var Cy,OE;function fU(){if(OE)return Cy;OE=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Cy=r,Cy}var Ey,PE;function ci(){if(PE)return Ey;PE=1;var e=Qu(),t=dU(),r=fU(),n="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function o(u){return u==null?u===void 0?a:n:i&&i in Object(u)?t(u):r(u)}return Ey=o,Ey}var Oy,AE;function ui(){if(AE)return Oy;AE=1;function e(t){return t!=null&&typeof t=="object"}return Oy=e,Oy}var Py,TE;function Ll(){if(TE)return Py;TE=1;var e=ci(),t=ui(),r="[object Symbol]";function n(a){return typeof a=="symbol"||t(a)&&e(a)==r}return Py=n,Py}var Ay,kE;function WS(){if(kE)return Ay;kE=1;var e=Xr(),t=Ll(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(e(i))return!1;var u=typeof i;return u=="number"||u=="symbol"||u=="boolean"||i==null||t(i)?!0:n.test(i)||!r.test(i)||o!=null&&i in Object(o)}return Ay=a,Ay}var Ty,RE;function Qi(){if(RE)return Ty;RE=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Ty=e,Ty}var ky,IE;function GS(){if(IE)return ky;IE=1;var e=ci(),t=Qi(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(u){if(!t(u))return!1;var d=e(u);return d==n||d==a||d==r||d==i}return ky=o,ky}var Ry,ME;function hU(){if(ME)return Ry;ME=1;var e=Oa(),t=e["__core-js_shared__"];return Ry=t,Ry}var Iy,DE;function pU(){if(DE)return Iy;DE=1;var e=hU(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Iy=r,Iy}var My,LE;function JM(){if(LE)return My;LE=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return My=r,My}var Dy,$E;function mU(){if($E)return Dy;$E=1;var e=GS(),t=pU(),r=Qi(),n=JM(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,d=o.toString,c=u.hasOwnProperty,h=RegExp("^"+d.call(c).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(m){if(!r(m)||t(m))return!1;var v=e(m)?h:i;return v.test(n(m))}return Dy=p,Dy}var Ly,BE;function gU(){if(BE)return Ly;BE=1;function e(t,r){return t?.[r]}return Ly=e,Ly}var $y,FE;function Yo(){if(FE)return $y;FE=1;var e=mU(),t=gU();function r(n,a){var i=t(n,a);return e(i)?i:void 0}return $y=r,$y}var By,zE;function fm(){if(zE)return By;zE=1;var e=Yo(),t=e(Object,"create");return By=t,By}var Fy,qE;function vU(){if(qE)return Fy;qE=1;var e=fm();function t(){this.__data__=e?e(null):{},this.size=0}return Fy=t,Fy}var zy,UE;function yU(){if(UE)return zy;UE=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return zy=e,zy}var qy,VE;function xU(){if(VE)return qy;VE=1;var e=fm(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var o=this.__data__;if(e){var u=o[i];return u===t?void 0:u}return n.call(o,i)?o[i]:void 0}return qy=a,qy}var Uy,HE;function bU(){if(HE)return Uy;HE=1;var e=fm(),t=Object.prototype,r=t.hasOwnProperty;function n(a){var i=this.__data__;return e?i[a]!==void 0:r.call(i,a)}return Uy=n,Uy}var Vy,WE;function wU(){if(WE)return Vy;WE=1;var e=fm(),t="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=e&&a===void 0?t:a,this}return Vy=r,Vy}var Hy,GE;function SU(){if(GE)return Hy;GE=1;var e=vU(),t=yU(),r=xU(),n=bU(),a=wU();function i(o){var u=-1,d=o==null?0:o.length;for(this.clear();++u-1}return Jy=t,Jy}var Qy,eO;function EU(){if(eO)return Qy;eO=1;var e=hm();function t(r,n){var a=this.__data__,i=e(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return Qy=t,Qy}var Zy,tO;function pm(){if(tO)return Zy;tO=1;var e=jU(),t=_U(),r=NU(),n=CU(),a=EU();function i(o){var u=-1,d=o==null?0:o.length;for(this.clear();++u0?1:-1},Oo=function(t){return Mo(t)&&t.indexOf("%")===t.length-1},Ne=function(t){return YU(t)&&!Zu(t)},JU=function(t){return Ze(t)},sr=function(t){return Ne(t)||Mo(t)},QU=0,Bl=function(t){var r=++QU;return"".concat(t||"").concat(r)},Ir=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ne(t)&&!Mo(t))return n;var i;if(Oo(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return Zu(i)&&(i=n),a&&i>r&&(i=r),i},Fi=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},ZU=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function o9(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Y1(e){"@babel/helpers - typeof";return Y1=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},Y1(e)}var PO={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},ei=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},AO=null,N0=null,ej=function e(t){if(t===AO&&Array.isArray(N0))return N0;var r=[];return b.Children.forEach(t,function(n){Ze(n)||(WU.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),N0=r,AO=t,r};function hn(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return ei(a)}):n=[ei(t)],ej(e).forEach(function(a){var i=fn(a,"type.displayName")||fn(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function on(e,t){var r=hn(e,t);return r&&r[0]}var TO=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!Ne(n)||n<=0||!Ne(a)||a<=0)},s9=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],l9=function(t){return t&&t.type&&Mo(t.type)&&s9.indexOf(t.type)>=0},c9=function(t){return t&&Y1(t)==="object"&&"clipDot"in t},u9=function(t,r,n,a){var i,o=(i=_0?.[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!He(t)&&(a&&o.includes(r)||r9.includes(r))||n&&ZS.includes(r)},ze=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(b.isValidElement(t)&&(a=t.props),!$l(a))return null;var i={};return Object.keys(a).forEach(function(o){var u;u9((u=a)===null||u===void 0?void 0:u[o],o,r,n)&&(i[o]=a[o])}),i},J1=function e(t,r){if(t===r)return!0;var n=b.Children.count(t);if(n!==b.Children.count(r))return!1;if(n===0)return!0;if(n===1)return kO(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function m9(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Z1(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,o=e.style,u=e.title,d=e.desc,c=p9(e,h9),h=a||{width:r,height:n,x:0,y:0},p=et("recharts-surface",i);return z.createElement("svg",Q1({},ze(c,!0,"svg"),{className:p,width:r,height:n,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),z.createElement("title",null,u),z.createElement("desc",null,d),t)}var g9=["children","className"];function ew(){return ew=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function y9(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var lt=z.forwardRef(function(e,t){var r=e.children,n=e.className,a=v9(e,g9),i=et("recharts-layer",n);return z.createElement("g",ew({className:i},ze(a,!0),{ref:t}),r)}),na=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;ii?0:i+r),n=n>i?i:n,n<0&&(n+=i),i=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(i);++a=i?r:e(r,n,a)}return E0=t,E0}var O0,DO;function nD(){if(DO)return O0;DO=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,i="\\ufe0e\\ufe0f",o="\\u200d",u=RegExp("["+o+e+a+i+"]");function d(c){return u.test(c)}return O0=d,O0}var P0,LO;function w9(){if(LO)return P0;LO=1;function e(t){return t.split("")}return P0=e,P0}var A0,$O;function S9(){if($O)return A0;$O=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,i="\\ufe0e\\ufe0f",o="["+e+"]",u="["+a+"]",d="\\ud83c[\\udffb-\\udfff]",c="(?:"+u+"|"+d+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",x=c+"?",y="["+i+"]?",S="(?:"+v+"(?:"+[h,p,m].join("|")+")"+y+x+")*",j=y+x+S,N="(?:"+[h+u+"?",u,p,m,o].join("|")+")",E=RegExp(d+"(?="+d+")|"+N+j,"g");function A(C){return C.match(E)||[]}return A0=A,A0}var T0,BO;function j9(){if(BO)return T0;BO=1;var e=w9(),t=nD(),r=S9();function n(a){return t(a)?r(a):e(a)}return T0=n,T0}var k0,FO;function _9(){if(FO)return k0;FO=1;var e=b9(),t=nD(),r=j9(),n=ZM();function a(i){return function(o){o=n(o);var u=t(o)?r(o):void 0,d=u?u[0]:o.charAt(0),c=u?e(u,1).join(""):o.slice(1);return d[i]()+c}}return k0=a,k0}var R0,zO;function N9(){if(zO)return R0;zO=1;var e=_9(),t=e("toUpperCase");return R0=t,R0}var C9=N9();const vm=dt(C9);function Et(e){return function(){return e}}const aD=Math.cos,ep=Math.sin,oa=Math.sqrt,tp=Math.PI,ym=2*tp,tw=Math.PI,rw=2*tw,No=1e-6,E9=rw-No;function iD(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return iD;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;aNo)if(!(Math.abs(p*d-c*h)>No)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let v=n-o,x=a-u,y=d*d+c*c,S=v*v+x*x,j=Math.sqrt(y),N=Math.sqrt(m),E=i*Math.tan((tw-Math.acos((y+m-S)/(2*j*N)))/2),A=E/N,C=E/j;Math.abs(A-1)>No&&this._append`L${t+A*h},${r+A*p}`,this._append`A${i},${i},0,0,${+(p*v>h*x)},${this._x1=t+C*d},${this._y1=r+C*c}`}}arc(t,r,n,a,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(a),d=n*Math.sin(a),c=t+u,h=r+d,p=1^o,m=o?a-i:i-a;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>No||Math.abs(this._y1-h)>No)&&this._append`L${c},${h}`,n&&(m<0&&(m=m%rw+rw),m>E9?this._append`A${n},${n},0,1,${p},${t-u},${r-d}A${n},${n},0,1,${p},${this._x1=c},${this._y1=h}`:m>No&&this._append`A${n},${n},0,${+(m>=tw)},${p},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function tj(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new P9(t)}function rj(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function oD(e){this._context=e}oD.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 xm(e){return new oD(e)}function sD(e){return e[0]}function lD(e){return e[1]}function cD(e,t){var r=Et(!0),n=null,a=xm,i=null,o=tj(u);e=typeof e=="function"?e:e===void 0?sD:Et(e),t=typeof t=="function"?t:t===void 0?lD:Et(t);function u(d){var c,h=(d=rj(d)).length,p,m=!1,v;for(n==null&&(i=a(v=o())),c=0;c<=h;++c)!(c=v;--x)u.point(E[x],A[x]);u.lineEnd(),u.areaEnd()}j&&(E[m]=+e(S,m,p),A[m]=+t(S,m,p),u.point(n?+n(S,m,p):E[m],r?+r(S,m,p):A[m]))}if(N)return u=null,N+""||null}function h(){return cD().defined(a).curve(o).context(i)}return c.x=function(p){return arguments.length?(e=typeof p=="function"?p:Et(+p),n=null,c):e},c.x0=function(p){return arguments.length?(e=typeof p=="function"?p:Et(+p),c):e},c.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:Et(+p),c):n},c.y=function(p){return arguments.length?(t=typeof p=="function"?p:Et(+p),r=null,c):t},c.y0=function(p){return arguments.length?(t=typeof p=="function"?p:Et(+p),c):t},c.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:Et(+p),c):r},c.lineX0=c.lineY0=function(){return h().x(e).y(t)},c.lineY1=function(){return h().x(e).y(r)},c.lineX1=function(){return h().x(n).y(t)},c.defined=function(p){return arguments.length?(a=typeof p=="function"?p:Et(!!p),c):a},c.curve=function(p){return arguments.length?(o=p,i!=null&&(u=o(i)),c):o},c.context=function(p){return arguments.length?(p==null?i=u=null:u=o(i=p),c):i},c}class uD{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function A9(e){return new uD(e,!0)}function T9(e){return new uD(e,!1)}const nj={draw(e,t){const r=oa(t/tp);e.moveTo(r,0),e.arc(0,0,r,0,ym)}},k9={draw(e,t){const r=oa(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},dD=oa(1/3),R9=dD*2,I9={draw(e,t){const r=oa(t/R9),n=r*dD;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},M9={draw(e,t){const r=oa(t),n=-r/2;e.rect(n,n,r,r)}},D9=.8908130915292852,fD=ep(tp/10)/ep(7*tp/10),L9=ep(ym/10)*fD,$9=-aD(ym/10)*fD,B9={draw(e,t){const r=oa(t*D9),n=L9*r,a=$9*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const o=ym*i/5,u=aD(o),d=ep(o);e.lineTo(d*r,-u*r),e.lineTo(u*n-d*a,d*n+u*a)}e.closePath()}},I0=oa(3),F9={draw(e,t){const r=-oa(t/(I0*3));e.moveTo(0,r*2),e.lineTo(-I0*r,-r),e.lineTo(I0*r,-r),e.closePath()}},En=-.5,On=oa(3)/2,nw=1/oa(12),z9=(nw/2+1)*3,q9={draw(e,t){const r=oa(t/z9),n=r/2,a=r*nw,i=n,o=r*nw+r,u=-i,d=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(u,d),e.lineTo(En*n-On*a,On*n+En*a),e.lineTo(En*i-On*o,On*i+En*o),e.lineTo(En*u-On*d,On*u+En*d),e.lineTo(En*n+On*a,En*a-On*n),e.lineTo(En*i+On*o,En*o-On*i),e.lineTo(En*u+On*d,En*d-On*u),e.closePath()}};function U9(e,t){let r=null,n=tj(a);e=typeof e=="function"?e:Et(e||nj),t=typeof t=="function"?t:Et(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:Et(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:Et(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function rp(){}function np(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function hD(e){this._context=e}hD.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:np(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:np(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function V9(e){return new hD(e)}function pD(e){this._context=e}pD.prototype={areaStart:rp,areaEnd:rp,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:np(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function H9(e){return new pD(e)}function mD(e){this._context=e}mD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:np(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function W9(e){return new mD(e)}function gD(e){this._context=e}gD.prototype={areaStart:rp,areaEnd:rp,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 G9(e){return new gD(e)}function qO(e){return e<0?-1:1}function UO(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),u=(i*a+o*n)/(n+a);return(qO(i)+qO(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(u))||0}function VO(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function M0(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,u=(i-n)/3;e._context.bezierCurveTo(n+u,a+u*t,i-u,o-u*r,i,o)}function ap(e){this._context=e}ap.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:M0(this,this._t0,VO(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,M0(this,VO(this,r=UO(this,e,t)),r);break;default:M0(this,this._t0,r=UO(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function vD(e){this._context=new yD(e)}(vD.prototype=Object.create(ap.prototype)).point=function(e,t){ap.prototype.point.call(this,t,e)};function yD(e){this._context=e}yD.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function K9(e){return new ap(e)}function X9(e){return new vD(e)}function xD(e){this._context=e}xD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=HO(e),a=HO(t),i=0,o=1;o=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function J9(e){return new bm(e,.5)}function Q9(e){return new bm(e,0)}function Z9(e){return new bm(e,1)}function il(e,t){if((o=e.length)>1)for(var r=1,n,a,i=e[t[0]],o,u=i.length;r=0;)r[t]=t;return r}function e7(e,t){return e[t]}function t7(e){const t=[];return t.key=e,t}function r7(){var e=Et([]),t=aw,r=il,n=e7;function a(i){var o=Array.from(e.apply(this,arguments),t7),u,d=o.length,c=-1,h;for(const p of i)for(u=0,++c;u0){for(var r,n,a=0,i=e[0].length,o;a0){for(var r=0,n=e[t[0]],a,i=n.length;r0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function d7(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var bD={symbolCircle:nj,symbolCross:k9,symbolDiamond:I9,symbolSquare:M9,symbolStar:B9,symbolTriangle:F9,symbolWye:q9},f7=Math.PI/180,h7=function(t){var r="symbol".concat(vm(t));return bD[r]||nj},p7=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*f7;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},m7=function(t,r){bD["symbol".concat(vm(t))]=r},aj=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,o=t.sizeType,u=o===void 0?"area":o,d=u7(t,o7),c=GO(GO({},d),{},{type:n,size:i,sizeType:u}),h=function(){var S=h7(n),j=U9().type(S).size(p7(i,u,n));return j()},p=c.className,m=c.cx,v=c.cy,x=ze(c,!0);return m===+m&&v===+v&&i===+i?z.createElement("path",iw({},x,{className:et("recharts-symbols",p),transform:"translate(".concat(m,", ").concat(v,")"),d:h()})):null};aj.registerSymbol=m7;function ol(e){"@babel/helpers - typeof";return ol=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},ol(e)}function ow(){return ow=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var N=v.inactive?c:v.color;return z.createElement("li",ow({className:S,style:p,key:"legend-item-".concat(x)},Do(n.props,v,x)),z.createElement(Z1,{width:o,height:o,viewBox:h,style:m},n.renderIcon(v)),z.createElement("span",{className:"recharts-legend-item-text",style:{color:N}},y?y(j,v,x):j))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,o=n.align;if(!a||!a.length)return null;var u={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return z.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(b.PureComponent);hu(ij,"displayName","Legend");hu(ij,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var D0,XO;function N7(){if(XO)return D0;XO=1;var e=pm();function t(){this.__data__=new e,this.size=0}return D0=t,D0}var L0,YO;function C7(){if(YO)return L0;YO=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return L0=e,L0}var $0,JO;function E7(){if(JO)return $0;JO=1;function e(t){return this.__data__.get(t)}return $0=e,$0}var B0,QO;function O7(){if(QO)return B0;QO=1;function e(t){return this.__data__.has(t)}return B0=e,B0}var F0,ZO;function P7(){if(ZO)return F0;ZO=1;var e=pm(),t=XS(),r=YS(),n=200;function a(i,o){var u=this.__data__;if(u instanceof e){var d=u.__data__;if(!t||d.lengthv))return!1;var y=p.get(o),S=p.get(u);if(y&&S)return y==u&&S==o;var j=-1,N=!0,E=d&a?new e:void 0;for(p.set(o,u),p.set(u,o);++j-1&&n%1==0&&n-1&&r%1==0&&r<=e}return lx=t,lx}var cx,jP;function q7(){if(jP)return cx;jP=1;var e=ci(),t=cj(),r=ui(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",u="[object Error]",d="[object Function]",c="[object Map]",h="[object Number]",p="[object Object]",m="[object RegExp]",v="[object Set]",x="[object String]",y="[object WeakMap]",S="[object ArrayBuffer]",j="[object DataView]",N="[object Float32Array]",E="[object Float64Array]",A="[object Int8Array]",C="[object Int16Array]",O="[object Int32Array]",T="[object Uint8Array]",R="[object Uint8ClampedArray]",L="[object Uint16Array]",q="[object Uint32Array]",F={};F[N]=F[E]=F[A]=F[C]=F[O]=F[T]=F[R]=F[L]=F[q]=!0,F[n]=F[a]=F[S]=F[i]=F[j]=F[o]=F[u]=F[d]=F[c]=F[h]=F[p]=F[m]=F[v]=F[x]=F[y]=!1;function B(V){return r(V)&&t(V.length)&&!!F[e(V)]}return cx=B,cx}var ux,_P;function AD(){if(_P)return ux;_P=1;function e(t){return function(r){return t(r)}}return ux=e,ux}var Zc={exports:{}};Zc.exports;var NP;function U7(){return NP||(NP=1,(function(e,t){var r=YM(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&r.process,u=(function(){try{var d=a&&a.require&&a.require("util").types;return d||o&&o.binding&&o.binding("util")}catch{}})();e.exports=u})(Zc,Zc.exports)),Zc.exports}var dx,CP;function TD(){if(CP)return dx;CP=1;var e=q7(),t=AD(),r=U7(),n=r&&r.isTypedArray,a=n?t(n):e;return dx=a,dx}var fx,EP;function V7(){if(EP)return fx;EP=1;var e=B7(),t=sj(),r=Xr(),n=PD(),a=lj(),i=TD(),o=Object.prototype,u=o.hasOwnProperty;function d(c,h){var p=r(c),m=!p&&t(c),v=!p&&!m&&n(c),x=!p&&!m&&!v&&i(c),y=p||m||v||x,S=y?e(c.length,String):[],j=S.length;for(var N in c)(h||u.call(c,N))&&!(y&&(N=="length"||v&&(N=="offset"||N=="parent")||x&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||a(N,j)))&&S.push(N);return S}return fx=d,fx}var hx,OP;function H7(){if(OP)return hx;OP=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return hx=t,hx}var px,PP;function kD(){if(PP)return px;PP=1;function e(t,r){return function(n){return t(r(n))}}return px=e,px}var mx,AP;function W7(){if(AP)return mx;AP=1;var e=kD(),t=e(Object.keys,Object);return mx=t,mx}var gx,TP;function G7(){if(TP)return gx;TP=1;var e=H7(),t=W7(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!e(i))return t(i);var o=[];for(var u in Object(i))n.call(i,u)&&u!="constructor"&&o.push(u);return o}return gx=a,gx}var vx,kP;function ed(){if(kP)return vx;kP=1;var e=GS(),t=cj();function r(n){return n!=null&&t(n.length)&&!e(n)}return vx=r,vx}var yx,RP;function wm(){if(RP)return yx;RP=1;var e=V7(),t=G7(),r=ed();function n(a){return r(a)?e(a):t(a)}return yx=n,yx}var xx,IP;function K7(){if(IP)return xx;IP=1;var e=M7(),t=$7(),r=wm();function n(a){return e(a,r,t)}return xx=n,xx}var bx,MP;function X7(){if(MP)return bx;MP=1;var e=K7(),t=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,o,u,d,c,h){var p=u&t,m=e(i),v=m.length,x=e(o),y=x.length;if(v!=y&&!p)return!1;for(var S=v;S--;){var j=m[S];if(!(p?j in o:n.call(o,j)))return!1}var N=h.get(i),E=h.get(o);if(N&&E)return N==o&&E==i;var A=!0;h.set(i,o),h.set(o,i);for(var C=p;++S-1}return Wx=t,Wx}var Gx,lA;function mV(){if(lA)return Gx;lA=1;function e(t,r,n){for(var a=-1,i=t==null?0:t.length;++a=o){var j=c?null:a(d);if(j)return i(j);x=!1,m=n,S=new e}else S=c?[]:y;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function AV(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function TV(e){return e.value}function kV(e,t){if(z.isValidElement(e))return z.cloneElement(e,t);if(typeof e=="function")return z.createElement(e,t);t.ref;var r=PV(t,wV);return z.createElement(ij,r)}var gA=1,Xs=(function(e){function t(){var r;SV(this,t);for(var n=arguments.length,a=new Array(n),i=0;igA||Math.abs(a.height-this.lastBoundingBox.height)>gA)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ka({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,o=a.align,u=a.verticalAlign,d=a.margin,c=a.chartWidth,h=a.chartHeight,p,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var v=this.getBBoxSnapshot();p={left:((c||0)-v.width)/2}}else p=o==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var x=this.getBBoxSnapshot();m={top:((h||0)-x.height)/2}}else m=u==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Ka(Ka({},p),m)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,o=a.width,u=a.height,d=a.wrapperStyle,c=a.payloadUniqBy,h=a.payload,p=Ka(Ka({position:"absolute",width:o||"auto",height:u||"auto"},this.getDefaultPosition(d)),d);return z.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(v){n.wrapperNode=v}},kV(i,Ka(Ka({},this.props),{},{payload:LD(h,c,TV)})))}}],[{key:"getWithHeight",value:function(n,a){var i=Ka(Ka({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&Ne(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||a}:null}}])})(b.PureComponent);Sm(Xs,"displayName","Legend");Sm(Xs,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Qx,vA;function RV(){if(vA)return Qx;vA=1;var e=Qu(),t=sj(),r=Xr(),n=e?e.isConcatSpreadable:void 0;function a(i){return r(i)||t(i)||!!(n&&i&&i[n])}return Qx=a,Qx}var Zx,yA;function FD(){if(yA)return Zx;yA=1;var e=OD(),t=RV();function r(n,a,i,o,u){var d=-1,c=n.length;for(i||(i=t),u||(u=[]);++d0&&i(h)?a>1?r(h,a-1,i,o,u):e(u,h):o||(u[u.length]=h)}return u}return Zx=r,Zx}var eb,xA;function IV(){if(xA)return eb;xA=1;function e(t){return function(r,n,a){for(var i=-1,o=Object(r),u=a(r),d=u.length;d--;){var c=u[t?d:++i];if(n(o[c],c,o)===!1)break}return r}}return eb=e,eb}var tb,bA;function MV(){if(bA)return tb;bA=1;var e=IV(),t=e();return tb=t,tb}var rb,wA;function zD(){if(wA)return rb;wA=1;var e=MV(),t=wm();function r(n,a){return n&&e(n,a,t)}return rb=r,rb}var nb,SA;function DV(){if(SA)return nb;SA=1;var e=ed();function t(r,n){return function(a,i){if(a==null)return a;if(!e(a))return r(a,i);for(var o=a.length,u=n?o:-1,d=Object(a);(n?u--:++un||u&&d&&h&&!c&&!p||i&&d&&h||!a&&h||!o)return 1;if(!i&&!u&&!p&&r=c)return h;var p=a[i];return h*(p=="desc"?-1:1)}}return r.index-n.index}return lb=t,lb}var cb,OA;function FV(){if(OA)return cb;OA=1;var e=JS(),t=QS(),r=Pa(),n=qD(),a=LV(),i=AD(),o=BV(),u=Fl(),d=Xr();function c(h,p,m){p.length?p=e(p,function(y){return d(y)?function(S){return t(S,y.length===1?y[0]:y)}:y}):p=[u];var v=-1;p=e(p,i(r));var x=n(h,function(y,S,j){var N=e(p,function(E){return E(y)});return{criteria:N,index:++v,value:y}});return a(x,function(y,S){return o(y,S,m)})}return cb=c,cb}var ub,PA;function zV(){if(PA)return ub;PA=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return ub=e,ub}var db,AA;function qV(){if(AA)return db;AA=1;var e=zV(),t=Math.max;function r(n,a,i){return a=t(a===void 0?n.length-1:a,0),function(){for(var o=arguments,u=-1,d=t(o.length-a,0),c=Array(d);++u0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return mb=n,mb}var gb,MA;function WV(){if(MA)return gb;MA=1;var e=VV(),t=HV(),r=t(e);return gb=r,gb}var vb,DA;function GV(){if(DA)return vb;DA=1;var e=Fl(),t=qV(),r=WV();function n(a,i){return r(t(a,i,e),a+"")}return vb=n,vb}var yb,LA;function jm(){if(LA)return yb;LA=1;var e=KS(),t=ed(),r=lj(),n=Qi();function a(i,o,u){if(!n(u))return!1;var d=typeof o;return(d=="number"?t(u)&&r(o,u.length):d=="string"&&o in u)?e(u[o],i):!1}return yb=a,yb}var xb,$A;function KV(){if($A)return xb;$A=1;var e=FD(),t=FV(),r=GV(),n=jm(),a=r(function(i,o){if(i==null)return[];var u=o.length;return u>1&&n(i,o[0],o[1])?o=[]:u>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(i,e(o,1),[])});return xb=a,xb}var XV=KV();const fj=dt(XV);function pu(e){"@babel/helpers - typeof";return pu=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},pu(e)}function cw(){return cw=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Dc,"-left"),Ne(r)&&t&&Ne(t.x)&&r=t.y),"".concat(Dc,"-top"),Ne(n)&&t&&Ne(t.y)&&ny?Math.max(h,d[n]):Math.max(p,d[n])}function uH(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function dH(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,u=e.useTranslate3d,d=e.viewBox,c,h,p;return o.height>0&&o.width>0&&r?(h=zA({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=zA({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),c=uH({translateX:h,translateY:p,useTranslate3d:u})):c=lH,{cssProperties:c,cssClasses:cH({translateX:h,translateY:p,coordinate:r})}}function ll(e){"@babel/helpers - typeof";return ll=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},ll(e)}function qA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function UA(e){for(var t=1;tVA||Math.abs(n.height-this.state.lastBoundingBox.height)>VA)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,u=a.animationDuration,d=a.animationEasing,c=a.children,h=a.coordinate,p=a.hasPayload,m=a.isAnimationActive,v=a.offset,x=a.position,y=a.reverseDirection,S=a.useTranslate3d,j=a.viewBox,N=a.wrapperStyle,E=dH({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:v,position:x,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:S,viewBox:j}),A=E.cssClasses,C=E.cssProperties,O=UA(UA({transition:m&&i?"transform ".concat(u,"ms ").concat(d):void 0},C),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},N);return z.createElement("div",{tabIndex:-1,className:A,style:O,ref:function(R){n.wrapperNode=R}},c)}}])})(b.PureComponent),wH=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Jo={isSsr:wH()};function cl(e){"@babel/helpers - typeof";return cl=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},cl(e)}function HA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function WA(e){for(var t=1;t0;return z.createElement(bH,{allowEscapeViewBox:o,animationDuration:u,animationEasing:d,isAnimationActive:m,active:i,coordinate:h,hasPayload:O,offset:v,position:S,reverseDirection:j,useTranslate3d:N,viewBox:E,wrapperStyle:A},TH(c,WA(WA({},this.props),{},{payload:C})))}}])})(b.PureComponent);hj(ln,"displayName","Tooltip");hj(ln,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Jo.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var wb,GA;function kH(){if(GA)return wb;GA=1;var e=Oa(),t=function(){return e.Date.now()};return wb=t,wb}var Sb,KA;function RH(){if(KA)return Sb;KA=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Sb=t,Sb}var jb,XA;function IH(){if(XA)return jb;XA=1;var e=RH(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return jb=r,jb}var _b,YA;function KD(){if(YA)return _b;YA=1;var e=IH(),t=Qi(),r=Ll(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,u=parseInt;function d(c){if(typeof c=="number")return c;if(r(c))return n;if(t(c)){var h=typeof c.valueOf=="function"?c.valueOf():c;c=t(h)?h+"":h}if(typeof c!="string")return c===0?c:+c;c=e(c);var p=i.test(c);return p||o.test(c)?u(c.slice(2),p?2:8):a.test(c)?n:+c}return _b=d,_b}var Nb,JA;function MH(){if(JA)return Nb;JA=1;var e=Qi(),t=kH(),r=KD(),n="Expected a function",a=Math.max,i=Math.min;function o(u,d,c){var h,p,m,v,x,y,S=0,j=!1,N=!1,E=!0;if(typeof u!="function")throw new TypeError(n);d=r(d)||0,e(c)&&(j=!!c.leading,N="maxWait"in c,m=N?a(r(c.maxWait)||0,d):m,E="trailing"in c?!!c.trailing:E);function A(V){var G=h,W=p;return h=p=void 0,S=V,v=u.apply(W,G),v}function C(V){return S=V,x=setTimeout(R,d),j?A(V):v}function O(V){var G=V-y,W=V-S,H=d-G;return N?i(H,m-W):H}function T(V){var G=V-y,W=V-S;return y===void 0||G>=d||G<0||N&&W>=m}function R(){var V=t();if(T(V))return L(V);x=setTimeout(R,O(V))}function L(V){return x=void 0,E&&h?A(V):(h=p=void 0,v)}function q(){x!==void 0&&clearTimeout(x),S=0,h=y=p=x=void 0}function F(){return x===void 0?v:L(t())}function B(){var V=t(),G=T(V);if(h=arguments,p=this,y=V,G){if(x===void 0)return C(y);if(N)return clearTimeout(x),x=setTimeout(R,d),A(y)}return x===void 0&&(x=setTimeout(R,d)),v}return B.cancel=q,B.flush=F,B}return Nb=o,Nb}var Cb,QA;function DH(){if(QA)return Cb;QA=1;var e=MH(),t=Qi(),r="Expected a function";function n(a,i,o){var u=!0,d=!0;if(typeof a!="function")throw new TypeError(r);return t(o)&&(u="leading"in o?!!o.leading:u,d="trailing"in o?!!o.trailing:d),e(a,i,{leading:u,maxWait:i,trailing:d})}return Cb=n,Cb}var LH=DH();const XD=dt(LH);function gu(e){"@babel/helpers - typeof";return gu=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},gu(e)}function ZA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function zf(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(V=XD(V,y,{trailing:!0,leading:!1}));var G=new ResizeObserver(V),W=C.current.getBoundingClientRect(),H=W.width,U=W.height;return F(H,U),G.observe(C.current),function(){G.disconnect()}},[F,y]);var B=b.useMemo(function(){var V=L.containerWidth,G=L.containerHeight;if(V<0||G<0)return null;na(Oo(o)||Oo(d),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,o,d),na(!r||r>0,"The aspect(%s) must be greater than zero.",r);var W=Oo(o)?V:o,H=Oo(d)?G:d;r&&r>0&&(W?H=W/r:H&&(W=H*r),m&&H>m&&(H=m)),na(W>0||H>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.`,W,H,o,d,h,p,r);var U=!Array.isArray(v)&&ei(v.type).endsWith("Chart");return z.Children.map(v,function($){return z.isValidElement($)?b.cloneElement($,zf({width:W,height:H},U?{style:zf({height:"100%",width:"100%",maxHeight:H,maxWidth:W},$.props.style)}:{})):$})},[r,v,d,m,p,h,L,o]);return z.createElement("div",{id:S?"".concat(S):void 0,className:et("recharts-responsive-container",j),style:zf(zf({},A),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:m}),ref:C},B)}),_m=function(t){return null};_m.displayName="Cell";function vu(e){"@babel/helpers - typeof";return vu=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},vu(e)}function t2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function hw(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Jo.isSsr)return{width:0,height:0};var n=JH(r),a=JSON.stringify({text:t,copyStyle:n});if(Os.widthCache[a])return Os.widthCache[a];try{var i=document.getElementById(r2);i||(i=document.createElement("span"),i.setAttribute("id",r2),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=hw(hw({},YH),n);Object.assign(i.style,o),i.textContent="".concat(t);var u=i.getBoundingClientRect(),d={width:u.width,height:u.height};return Os.widthCache[a]=d,++Os.cacheCount>XH&&(Os.cacheCount=0,Os.widthCache={}),d}catch{return{width:0,height:0}}},QH=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function yu(e){"@babel/helpers - typeof";return yu=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},yu(e)}function up(e,t){return rW(e)||tW(e,t)||eW(e,t)||ZH()}function ZH(){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 eW(e,t){if(e){if(typeof e=="string")return n2(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n2(e,t)}}function n2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function c2(e,t){return bW(e)||xW(e,t)||yW(e,t)||vW()}function vW(){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 yW(e,t){if(e){if(typeof e=="string")return u2(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u2(e,t)}}function u2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return W.reduce(function(H,U){var $=U.word,Z=U.width,k=H[H.length-1];if(k&&(a==null||i||k.width+Z+nU.width?H:U})};if(!h)return v;for(var y="…",S=function(W){var H=p.slice(0,W),U=ZD({breakAll:c,style:d,children:H+y}).wordsWithComputedWidth,$=m(U),Z=$.length>o||x($).width>Number(a);return[Z,$]},j=0,N=p.length-1,E=0,A;j<=N&&E<=p.length-1;){var C=Math.floor((j+N)/2),O=C-1,T=S(O),R=c2(T,2),L=R[0],q=R[1],F=S(C),B=c2(F,1),V=B[0];if(!L&&!V&&(j=C+1),L&&V&&(N=C-1),!L&&V){A=q;break}E++}return A||v},d2=function(t){var r=Ze(t)?[]:t.toString().split(QD);return[{words:r}]},SW=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,u=t.maxLines;if((r||n)&&!Jo.isSsr){var d,c,h=ZD({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,m=h.spaceWidth;d=p,c=m}else return d2(a);return wW({breakAll:o,children:a,maxLines:u,style:i},d,c,r,n)}return d2(a)},f2="#808080",Lo=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.lineHeight,u=o===void 0?"1em":o,d=t.capHeight,c=d===void 0?"0.71em":d,h=t.scaleToFit,p=h===void 0?!1:h,m=t.textAnchor,v=m===void 0?"start":m,x=t.verticalAnchor,y=x===void 0?"end":x,S=t.fill,j=S===void 0?f2:S,N=l2(t,pW),E=b.useMemo(function(){return SW({breakAll:N.breakAll,children:N.children,maxLines:N.maxLines,scaleToFit:p,style:N.style,width:N.width})},[N.breakAll,N.children,N.maxLines,p,N.style,N.width]),A=N.dx,C=N.dy,O=N.angle,T=N.className,R=N.breakAll,L=l2(N,mW);if(!sr(n)||!sr(i))return null;var q=n+(Ne(A)?A:0),F=i+(Ne(C)?C:0),B;switch(y){case"start":B=Eb("calc(".concat(c,")"));break;case"middle":B=Eb("calc(".concat((E.length-1)/2," * -").concat(u," + (").concat(c," / 2))"));break;default:B=Eb("calc(".concat(E.length-1," * -").concat(u,")"));break}var V=[];if(p){var G=E[0].width,W=N.width;V.push("scale(".concat((Ne(W)?W/G:1)/G,")"))}return O&&V.push("rotate(".concat(O,", ").concat(q,", ").concat(F,")")),V.length&&(L.transform=V.join(" ")),z.createElement("text",pw({},ze(L,!0),{x:q,y:F,className:et("recharts-text",T),textAnchor:v,fill:j.includes("url")?f2:j}),E.map(function(H,U){var $=H.words.join(R?"":" ");return z.createElement("tspan",{x:q,dy:U===0?B:u,key:"".concat($,"-").concat(U)},$)}))};function qi(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function jW(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function pj(e){let t,r,n;e.length!==2?(t=qi,r=(u,d)=>qi(e(u),d),n=(u,d)=>e(u)-d):(t=e===qi||e===jW?e:_W,r=e,n=e);function a(u,d,c=0,h=u.length){if(c>>1;r(u[p],d)<0?c=p+1:h=p}while(c>>1;r(u[p],d)<=0?c=p+1:h=p}while(cc&&n(u[p-1],d)>-n(u[p],d)?p-1:p}return{left:a,center:o,right:i}}function _W(){return 0}function eL(e){return e===null?NaN:+e}function*NW(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const CW=pj(qi),td=CW.right;pj(eL).center;class h2 extends Map{constructor(t,r=PW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(p2(this,t))}has(t){return super.has(p2(this,t))}set(t,r){return super.set(EW(this,t),r)}delete(t){return super.delete(OW(this,t))}}function p2({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function EW({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function OW({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function PW(e){return e!==null&&typeof e=="object"?e.valueOf():e}function AW(e=qi){if(e===qi)return tL;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function tL(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const TW=Math.sqrt(50),kW=Math.sqrt(10),RW=Math.sqrt(2);function dp(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=TW?10:i>=kW?5:i>=RW?2:1;let u,d,c;return a<0?(c=Math.pow(10,-a)/o,u=Math.round(e*c),d=Math.round(t*c),u/ct&&--d,c=-c):(c=Math.pow(10,a)*o,u=Math.round(e/c),d=Math.round(t/c),u*ct&&--d),d0))return[];if(e===t)return[e];const n=t=a))return[];const u=i-a+1,d=new Array(u);if(n)if(o<0)for(let c=0;c=n)&&(r=n);return r}function g2(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function rL(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?tL:AW(a);n>r;){if(n-r>600){const d=n-r+1,c=t-r+1,h=Math.log(d),p=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*p*(d-p)/d)*(c-d/2<0?-1:1),v=Math.max(r,Math.floor(t-c*p/d+m)),x=Math.min(n,Math.floor(t+(d-c)*p/d+m));rL(e,t,v,x,a)}const i=e[t];let o=r,u=n;for(Lc(e,r,t),a(e[n],i)>0&&Lc(e,r,n);o0;)--u}a(e[r],i)===0?Lc(e,r,u):(++u,Lc(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function Lc(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function IW(e,t,r){if(e=Float64Array.from(NW(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return g2(e);if(t>=1)return m2(e);var n,a=(n-1)*t,i=Math.floor(a),o=m2(rL(e,i).subarray(0,i+1)),u=g2(e.subarray(i+1));return o+(u-o)*(a-i)}}function MW(e,t,r=eL){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e),u=+r(e[i+1],i+1,e);return o+(u-o)*(a-i)}}function DW(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Uf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Uf(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=$W.exec(e))?new Gr(t[1],t[2],t[3],1):(t=BW.exec(e))?new Gr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=FW.exec(e))?Uf(t[1],t[2],t[3],t[4]):(t=zW.exec(e))?Uf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=qW.exec(e))?j2(t[1],t[2]/100,t[3]/100,1):(t=UW.exec(e))?j2(t[1],t[2]/100,t[3]/100,t[4]):v2.hasOwnProperty(e)?b2(v2[e]):e==="transparent"?new Gr(NaN,NaN,NaN,0):null}function b2(e){return new Gr(e>>16&255,e>>8&255,e&255,1)}function Uf(e,t,r,n){return n<=0&&(e=t=r=NaN),new Gr(e,t,r,n)}function WW(e){return e instanceof rd||(e=Su(e)),e?(e=e.rgb(),new Gr(e.r,e.g,e.b,e.opacity)):new Gr}function xw(e,t,r,n){return arguments.length===1?WW(e):new Gr(e,t,r,n??1)}function Gr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}gj(Gr,xw,aL(rd,{brighter(e){return e=e==null?fp:Math.pow(fp,e),new Gr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?bu:Math.pow(bu,e),new Gr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Gr(Ro(this.r),Ro(this.g),Ro(this.b),hp(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:w2,formatHex:w2,formatHex8:GW,formatRgb:S2,toString:S2}));function w2(){return`#${Po(this.r)}${Po(this.g)}${Po(this.b)}`}function GW(){return`#${Po(this.r)}${Po(this.g)}${Po(this.b)}${Po((isNaN(this.opacity)?1:this.opacity)*255)}`}function S2(){const e=hp(this.opacity);return`${e===1?"rgb(":"rgba("}${Ro(this.r)}, ${Ro(this.g)}, ${Ro(this.b)}${e===1?")":`, ${e})`}`}function hp(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ro(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Po(e){return e=Ro(e),(e<16?"0":"")+e.toString(16)}function j2(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new ta(e,t,r,n)}function iL(e){if(e instanceof ta)return new ta(e.h,e.s,e.l,e.opacity);if(e instanceof rd||(e=Su(e)),!e)return new ta;if(e instanceof ta)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,u=i-a,d=(i+a)/2;return u?(t===i?o=(r-n)/u+(r0&&d<1?0:o,new ta(o,u,d,e.opacity)}function KW(e,t,r,n){return arguments.length===1?iL(e):new ta(e,t,r,n??1)}function ta(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}gj(ta,KW,aL(rd,{brighter(e){return e=e==null?fp:Math.pow(fp,e),new ta(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bu:Math.pow(bu,e),new ta(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Gr(Ob(e>=240?e-240:e+120,a,n),Ob(e,a,n),Ob(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new ta(_2(this.h),Vf(this.s),Vf(this.l),hp(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=hp(this.opacity);return`${e===1?"hsl(":"hsla("}${_2(this.h)}, ${Vf(this.s)*100}%, ${Vf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _2(e){return e=(e||0)%360,e<0?e+360:e}function Vf(e){return Math.max(0,Math.min(1,e||0))}function Ob(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const vj=e=>()=>e;function XW(e,t){return function(r){return e+r*t}}function YW(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function JW(e){return(e=+e)==1?oL:function(t,r){return r-t?YW(t,r,e):vj(isNaN(t)?r:t)}}function oL(e,t){var r=t-e;return r?XW(e,r):vj(isNaN(e)?t:e)}const N2=(function e(t){var r=JW(t);function n(a,i){var o=r((a=xw(a)).r,(i=xw(i)).r),u=r(a.g,i.g),d=r(a.b,i.b),c=oL(a.opacity,i.opacity);return function(h){return a.r=o(h),a.g=u(h),a.b=d(h),a.opacity=c(h),a+""}}return n.gamma=e,n})(1);function QW(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;ar&&(i=t.slice(r,i),u[o]?u[o]+=i:u[++o]=i),(n=n[0])===(a=a[0])?u[o]?u[o]+=a:u[++o]=a:(u[++o]=null,d.push({i:o,x:pp(n,a)})),r=Pb.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function cG(e,t,r){var n=e[0],a=e[1],i=t[0],o=t[1];return a2?uG:cG,d=c=null,p}function p(m){return m==null||isNaN(m=+m)?i:(d||(d=u(e.map(n),t,r)))(n(o(m)))}return p.invert=function(m){return o(a((c||(c=u(t,e.map(n),pp)))(m)))},p.domain=function(m){return arguments.length?(e=Array.from(m,mp),h()):e.slice()},p.range=function(m){return arguments.length?(t=Array.from(m),h()):t.slice()},p.rangeRound=function(m){return t=Array.from(m),r=yj,h()},p.clamp=function(m){return arguments.length?(o=m?!0:Mr,h()):o!==Mr},p.interpolate=function(m){return arguments.length?(r=m,h()):r},p.unknown=function(m){return arguments.length?(i=m,p):i},function(m,v){return n=m,a=v,h()}}function xj(){return Nm()(Mr,Mr)}function dG(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function gp(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ul(e){return e=gp(Math.abs(e)),e?e[1]:NaN}function fG(e,t){return function(r,n){for(var a=r.length,i=[],o=0,u=e[0],d=0;a>0&&u>0&&(d+u+1>n&&(u=Math.max(1,n-d)),i.push(r.substring(a-=u,a+u)),!((d+=u+1)>n));)u=e[o=(o+1)%e.length];return i.reverse().join(t)}}function hG(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var pG=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ju(e){if(!(t=pG.exec(e)))throw new Error("invalid format: "+e);var t;return new bj({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]})}ju.prototype=bj.prototype;function bj(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+""}bj.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 mG(e){e:for(var t=e.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var vp;function gG(e,t){var r=gp(e,t);if(!r)return vp=void 0,e.toPrecision(t);var n=r[0],a=r[1],i=a-(vp=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+gp(e,Math.max(0,t+i-1))[0]}function E2(e,t){var r=gp(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const O2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:dG,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)=>E2(e*100,t),r:E2,s:gG,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function P2(e){return e}var A2=Array.prototype.map,T2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vG(e){var t=e.grouping===void 0||e.thousands===void 0?P2:fG(A2.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?P2:hG(A2.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function c(p,m){p=ju(p);var v=p.fill,x=p.align,y=p.sign,S=p.symbol,j=p.zero,N=p.width,E=p.comma,A=p.precision,C=p.trim,O=p.type;O==="n"?(E=!0,O="g"):O2[O]||(A===void 0&&(A=12),C=!0,O="g"),(j||v==="0"&&x==="=")&&(j=!0,v="0",x="=");var T=(m&&m.prefix!==void 0?m.prefix:"")+(S==="$"?r:S==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),R=(S==="$"?n:/[%p]/.test(O)?o:"")+(m&&m.suffix!==void 0?m.suffix:""),L=O2[O],q=/[defgprs%]/.test(O);A=A===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function F(B){var V=T,G=R,W,H,U;if(O==="c")G=L(B)+G,B="";else{B=+B;var $=B<0||1/B<0;if(B=isNaN(B)?d:L(Math.abs(B),A),C&&(B=mG(B)),$&&+B==0&&y!=="+"&&($=!1),V=($?y==="("?y:u:y==="-"||y==="("?"":y)+V,G=(O==="s"&&!isNaN(B)&&vp!==void 0?T2[8+vp/3]:"")+G+($&&y==="("?")":""),q){for(W=-1,H=B.length;++WU||U>57){G=(U===46?a+B.slice(W+1):B.slice(W))+G,B=B.slice(0,W);break}}}E&&!j&&(B=t(B,1/0));var Z=V.length+B.length+G.length,k=Z>1)+V+B+G+k.slice(Z);break;default:B=k+V+B+G;break}return i(B)}return F.toString=function(){return p+""},F}function h(p,m){var v=Math.max(-8,Math.min(8,Math.floor(ul(m)/3)))*3,x=Math.pow(10,-v),y=c((p=ju(p),p.type="f",p),{suffix:T2[8+v/3]});return function(S){return y(x*S)}}return{format:c,formatPrefix:h}}var Hf,wj,sL;yG({thousands:",",grouping:[3],currency:["$",""]});function yG(e){return Hf=vG(e),wj=Hf.format,sL=Hf.formatPrefix,Hf}function xG(e){return Math.max(0,-ul(Math.abs(e)))}function bG(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ul(t)/3)))*3-ul(Math.abs(e)))}function wG(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ul(t)-ul(e))+1}function lL(e,t,r,n){var a=vw(e,t,r),i;switch(n=ju(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=bG(a,o))&&(n.precision=i),sL(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=wG(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=xG(a))&&(n.precision=i-(n.type==="%")*2);break}}return wj(n)}function Zi(e){var t=e.domain;return e.ticks=function(r){var n=t();return mw(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return lL(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,o=n[a],u=n[i],d,c,h=10;for(u0;){if(c=gw(o,u,r),c===d)return n[a]=o,n[i]=u,t(n);if(c>0)o=Math.floor(o/c)*c,u=Math.ceil(u/c)*c;else if(c<0)o=Math.ceil(o*c)/c,u=Math.floor(u*c)/c;else break;d=c}return e},e}function yp(){var e=xj();return e.copy=function(){return nd(e,yp())},$n.apply(e,arguments),Zi(e)}function cL(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,mp),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return cL(e).unknown(t)},e=arguments.length?Array.from(e,mp):[0,1],Zi(r)}function uL(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],o;return iMath.pow(e,t)}function CG(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 I2(e){return(t,r)=>-e(-t,r)}function Sj(e){const t=e(k2,R2),r=t.domain;let n=10,a,i;function o(){return a=CG(n),i=NG(n),r()[0]<0?(a=I2(a),i=I2(i),e(SG,jG)):e(k2,R2),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const d=r();let c=d[0],h=d[d.length-1];const p=h0){for(;m<=v;++m)for(x=1;xh)break;j.push(y)}}else for(;m<=v;++m)for(x=n-1;x>=1;--x)if(y=m>0?x/i(-m):x*i(m),!(yh)break;j.push(y)}j.length*2{if(u==null&&(u=10),d==null&&(d=n===10?"s":","),typeof d!="function"&&(!(n%1)&&(d=ju(d)).precision==null&&(d.trim=!0),d=wj(d)),u===1/0)return d;const c=Math.max(1,n*u/t.ticks().length);return h=>{let p=h/i(Math.round(a(h)));return p*nr(uL(r(),{floor:u=>i(Math.floor(a(u))),ceil:u=>i(Math.ceil(a(u)))})),t}function dL(){const e=Sj(Nm()).domain([1,10]);return e.copy=()=>nd(e,dL()).base(e.base()),$n.apply(e,arguments),e}function M2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function D2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function jj(e){var t=1,r=e(M2(t),D2(t));return r.constant=function(n){return arguments.length?e(M2(t=+n),D2(t)):t},Zi(r)}function fL(){var e=jj(Nm());return e.copy=function(){return nd(e,fL()).constant(e.constant())},$n.apply(e,arguments)}function L2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function EG(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function OG(e){return e<0?-e*e:e*e}function _j(e){var t=e(Mr,Mr),r=1;function n(){return r===1?e(Mr,Mr):r===.5?e(EG,OG):e(L2(r),L2(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Zi(t)}function Nj(){var e=_j(Nm());return e.copy=function(){return nd(e,Nj()).exponent(e.exponent())},$n.apply(e,arguments),e}function PG(){return Nj.apply(null,arguments).exponent(.5)}function $2(e){return Math.sign(e)*e*e}function AG(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function hL(){var e=xj(),t=[0,1],r=!1,n;function a(i){var o=AG(e(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return e.invert($2(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,mp)).map($2)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return hL(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},$n.apply(a,arguments),Zi(a)}function pL(){var e=[],t=[],r=[],n;function a(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[c-1],n[c]]},o.unknown=function(d){return arguments.length&&(i=d),o},o.thresholds=function(){return n.slice()},o.copy=function(){return mL().domain([e,t]).range(a).unknown(i)},$n.apply(Zi(o),arguments)}function gL(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[td(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return gL().domain(e).range(t).unknown(r)},$n.apply(a,arguments)}const Ab=new Date,Tb=new Date;function lr(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),u=a.ceil(i);return i-o(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,u)=>{const d=[];if(i=a.ceil(i),u=u==null?1:Math.floor(u),!(i0))return d;let c;do d.push(c=new Date(+i)),t(i,u),e(i);while(clr(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!i(o););else for(;--u>=0;)for(;t(o,1),!i(o););}),r&&(a.count=(i,o)=>(Ab.setTime(+i),Tb.setTime(+o),e(Ab),e(Tb),Math.floor(r(Ab,Tb))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const xp=lr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);xp.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?lr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):xp);xp.range;const Ja=1e3,Rn=Ja*60,Qa=Rn*60,ni=Qa*24,Cj=ni*7,B2=ni*30,kb=ni*365,Ao=lr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ja)},(e,t)=>(t-e)/Ja,e=>e.getUTCSeconds());Ao.range;const Ej=lr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ja)},(e,t)=>{e.setTime(+e+t*Rn)},(e,t)=>(t-e)/Rn,e=>e.getMinutes());Ej.range;const Oj=lr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Rn)},(e,t)=>(t-e)/Rn,e=>e.getUTCMinutes());Oj.range;const Pj=lr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ja-e.getMinutes()*Rn)},(e,t)=>{e.setTime(+e+t*Qa)},(e,t)=>(t-e)/Qa,e=>e.getHours());Pj.range;const Aj=lr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Qa)},(e,t)=>(t-e)/Qa,e=>e.getUTCHours());Aj.range;const ad=lr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Rn)/ni,e=>e.getDate()-1);ad.range;const Cm=lr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ni,e=>e.getUTCDate()-1);Cm.range;const vL=lr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ni,e=>Math.floor(e/ni));vL.range;function Qo(e){return lr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Rn)/Cj)}const Em=Qo(0),bp=Qo(1),TG=Qo(2),kG=Qo(3),dl=Qo(4),RG=Qo(5),IG=Qo(6);Em.range;bp.range;TG.range;kG.range;dl.range;RG.range;IG.range;function Zo(e){return lr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Cj)}const Om=Zo(0),wp=Zo(1),MG=Zo(2),DG=Zo(3),fl=Zo(4),LG=Zo(5),$G=Zo(6);Om.range;wp.range;MG.range;DG.range;fl.range;LG.range;$G.range;const Tj=lr(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());Tj.range;const kj=lr(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());kj.range;const ai=lr(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());ai.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:lr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});ai.range;const ii=lr(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());ii.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:lr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ii.range;function yL(e,t,r,n,a,i){const o=[[Ao,1,Ja],[Ao,5,5*Ja],[Ao,15,15*Ja],[Ao,30,30*Ja],[i,1,Rn],[i,5,5*Rn],[i,15,15*Rn],[i,30,30*Rn],[a,1,Qa],[a,3,3*Qa],[a,6,6*Qa],[a,12,12*Qa],[n,1,ni],[n,2,2*ni],[r,1,Cj],[t,1,B2],[t,3,3*B2],[e,1,kb]];function u(c,h,p){const m=hS).right(o,m);if(v===o.length)return e.every(vw(c/kb,h/kb,p));if(v===0)return xp.every(Math.max(vw(c,h,p),1));const[x,y]=o[m/o[v-1][2]53)return null;"w"in K||(K.w=1),"Z"in K?(Ce=Ib($c(K.y,0,1)),Le=Ce.getUTCDay(),Ce=Le>4||Le===0?wp.ceil(Ce):wp(Ce),Ce=Cm.offset(Ce,(K.V-1)*7),K.y=Ce.getUTCFullYear(),K.m=Ce.getUTCMonth(),K.d=Ce.getUTCDate()+(K.w+6)%7):(Ce=Rb($c(K.y,0,1)),Le=Ce.getDay(),Ce=Le>4||Le===0?bp.ceil(Ce):bp(Ce),Ce=ad.offset(Ce,(K.V-1)*7),K.y=Ce.getFullYear(),K.m=Ce.getMonth(),K.d=Ce.getDate()+(K.w+6)%7)}else("W"in K||"U"in K)&&("w"in K||(K.w="u"in K?K.u%7:"W"in K?1:0),Le="Z"in K?Ib($c(K.y,0,1)).getUTCDay():Rb($c(K.y,0,1)).getDay(),K.m=0,K.d="W"in K?(K.w+6)%7+K.W*7-(Le+5)%7:K.w+K.U*7-(Le+6)%7);return"Z"in K?(K.H+=K.Z/100|0,K.M+=K.Z%100,Ib(K)):Rb(K)}}function R(ee,le,pe,K){for(var je=0,Ce=le.length,Le=pe.length,De,tt;je=Le)return-1;if(De=le.charCodeAt(je++),De===37){if(De=le.charAt(je++),tt=C[De in F2?le.charAt(je++):De],!tt||(K=tt(ee,pe,K))<0)return-1}else if(De!=pe.charCodeAt(K++))return-1}return K}function L(ee,le,pe){var K=c.exec(le.slice(pe));return K?(ee.p=h.get(K[0].toLowerCase()),pe+K[0].length):-1}function q(ee,le,pe){var K=v.exec(le.slice(pe));return K?(ee.w=x.get(K[0].toLowerCase()),pe+K[0].length):-1}function F(ee,le,pe){var K=p.exec(le.slice(pe));return K?(ee.w=m.get(K[0].toLowerCase()),pe+K[0].length):-1}function B(ee,le,pe){var K=j.exec(le.slice(pe));return K?(ee.m=N.get(K[0].toLowerCase()),pe+K[0].length):-1}function V(ee,le,pe){var K=y.exec(le.slice(pe));return K?(ee.m=S.get(K[0].toLowerCase()),pe+K[0].length):-1}function G(ee,le,pe){return R(ee,t,le,pe)}function W(ee,le,pe){return R(ee,r,le,pe)}function H(ee,le,pe){return R(ee,n,le,pe)}function U(ee){return o[ee.getDay()]}function $(ee){return i[ee.getDay()]}function Z(ee){return d[ee.getMonth()]}function k(ee){return u[ee.getMonth()]}function I(ee){return a[+(ee.getHours()>=12)]}function D(ee){return 1+~~(ee.getMonth()/3)}function J(ee){return o[ee.getUTCDay()]}function ae(ee){return i[ee.getUTCDay()]}function ie(ee){return d[ee.getUTCMonth()]}function ne(ee){return u[ee.getUTCMonth()]}function X(ee){return a[+(ee.getUTCHours()>=12)]}function Y(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var le=O(ee+="",E);return le.toString=function(){return ee},le},parse:function(ee){var le=T(ee+="",!1);return le.toString=function(){return ee},le},utcFormat:function(ee){var le=O(ee+="",A);return le.toString=function(){return ee},le},utcParse:function(ee){var le=T(ee+="",!0);return le.toString=function(){return ee},le}}}var F2={"-":"",_:" ",0:"0"},mr=/^\s*\d+/,VG=/^%/,HG=/[\\^$*+?|[\]().{}]/g;function ct(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i[t.toLowerCase(),r]))}function GG(e,t,r){var n=mr.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function KG(e,t,r){var n=mr.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function XG(e,t,r){var n=mr.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function YG(e,t,r){var n=mr.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function JG(e,t,r){var n=mr.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function z2(e,t,r){var n=mr.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function q2(e,t,r){var n=mr.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function QG(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function ZG(e,t,r){var n=mr.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function eK(e,t,r){var n=mr.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function U2(e,t,r){var n=mr.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function tK(e,t,r){var n=mr.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function V2(e,t,r){var n=mr.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function rK(e,t,r){var n=mr.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function nK(e,t,r){var n=mr.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function aK(e,t,r){var n=mr.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function iK(e,t,r){var n=mr.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function oK(e,t,r){var n=VG.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function sK(e,t,r){var n=mr.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function lK(e,t,r){var n=mr.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function H2(e,t){return ct(e.getDate(),t,2)}function cK(e,t){return ct(e.getHours(),t,2)}function uK(e,t){return ct(e.getHours()%12||12,t,2)}function dK(e,t){return ct(1+ad.count(ai(e),e),t,3)}function xL(e,t){return ct(e.getMilliseconds(),t,3)}function fK(e,t){return xL(e,t)+"000"}function hK(e,t){return ct(e.getMonth()+1,t,2)}function pK(e,t){return ct(e.getMinutes(),t,2)}function mK(e,t){return ct(e.getSeconds(),t,2)}function gK(e){var t=e.getDay();return t===0?7:t}function vK(e,t){return ct(Em.count(ai(e)-1,e),t,2)}function bL(e){var t=e.getDay();return t>=4||t===0?dl(e):dl.ceil(e)}function yK(e,t){return e=bL(e),ct(dl.count(ai(e),e)+(ai(e).getDay()===4),t,2)}function xK(e){return e.getDay()}function bK(e,t){return ct(bp.count(ai(e)-1,e),t,2)}function wK(e,t){return ct(e.getFullYear()%100,t,2)}function SK(e,t){return e=bL(e),ct(e.getFullYear()%100,t,2)}function jK(e,t){return ct(e.getFullYear()%1e4,t,4)}function _K(e,t){var r=e.getDay();return e=r>=4||r===0?dl(e):dl.ceil(e),ct(e.getFullYear()%1e4,t,4)}function NK(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ct(t/60|0,"0",2)+ct(t%60,"0",2)}function W2(e,t){return ct(e.getUTCDate(),t,2)}function CK(e,t){return ct(e.getUTCHours(),t,2)}function EK(e,t){return ct(e.getUTCHours()%12||12,t,2)}function OK(e,t){return ct(1+Cm.count(ii(e),e),t,3)}function wL(e,t){return ct(e.getUTCMilliseconds(),t,3)}function PK(e,t){return wL(e,t)+"000"}function AK(e,t){return ct(e.getUTCMonth()+1,t,2)}function TK(e,t){return ct(e.getUTCMinutes(),t,2)}function kK(e,t){return ct(e.getUTCSeconds(),t,2)}function RK(e){var t=e.getUTCDay();return t===0?7:t}function IK(e,t){return ct(Om.count(ii(e)-1,e),t,2)}function SL(e){var t=e.getUTCDay();return t>=4||t===0?fl(e):fl.ceil(e)}function MK(e,t){return e=SL(e),ct(fl.count(ii(e),e)+(ii(e).getUTCDay()===4),t,2)}function DK(e){return e.getUTCDay()}function LK(e,t){return ct(wp.count(ii(e)-1,e),t,2)}function $K(e,t){return ct(e.getUTCFullYear()%100,t,2)}function BK(e,t){return e=SL(e),ct(e.getUTCFullYear()%100,t,2)}function FK(e,t){return ct(e.getUTCFullYear()%1e4,t,4)}function zK(e,t){var r=e.getUTCDay();return e=r>=4||r===0?fl(e):fl.ceil(e),ct(e.getUTCFullYear()%1e4,t,4)}function qK(){return"+0000"}function G2(){return"%"}function K2(e){return+e}function X2(e){return Math.floor(+e/1e3)}var Ps,jL,_L;UK({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 UK(e){return Ps=UG(e),jL=Ps.format,Ps.parse,_L=Ps.utcFormat,Ps.utcParse,Ps}function VK(e){return new Date(e)}function HK(e){return e instanceof Date?+e:+new Date(+e)}function Rj(e,t,r,n,a,i,o,u,d,c){var h=xj(),p=h.invert,m=h.domain,v=c(".%L"),x=c(":%S"),y=c("%I:%M"),S=c("%I %p"),j=c("%a %d"),N=c("%b %d"),E=c("%B"),A=c("%Y");function C(O){return(d(O)t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>IW(e,i/n))},r.copy=function(){return OL(t).domain(e)},di.apply(r,arguments)}function Am(){var e=0,t=.5,r=1,n=1,a,i,o,u,d,c=Mr,h,p=!1,m;function v(y){return isNaN(y=+y)?m:(y=.5+((y=+h(y))-i)*(n*yr}return Db=e,Db}var Lb,Z2;function YK(){if(Z2)return Lb;Z2=1;var e=Tm(),t=kL(),r=Fl();function n(a){return a&&a.length?e(a,r,t):void 0}return Lb=n,Lb}var JK=YK();const km=dt(JK);var $b,eT;function RL(){if(eT)return $b;eT=1;function e(t,r){return te.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=ne.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};Pe.decimalPlaces=Pe.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Rt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Pe.dividedBy=Pe.div=function(e){return ti(this,new this.constructor(e))};Pe.dividedToIntegerBy=Pe.idiv=function(e){var t=this,r=t.constructor;return jt(ti(t,new r(e),0,1),r.precision)};Pe.equals=Pe.eq=function(e){return!this.cmp(e)};Pe.exponent=function(){return Jt(this)};Pe.greaterThan=Pe.gt=function(e){return this.cmp(e)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(e){return this.cmp(e)>=0};Pe.isInteger=Pe.isint=function(){return this.e>this.d.length-2};Pe.isNegative=Pe.isneg=function(){return this.s<0};Pe.isPositive=Pe.ispos=function(){return this.s>0};Pe.isZero=function(){return this.s===0};Pe.lessThan=Pe.lt=function(e){return this.cmp(e)<0};Pe.lessThanOrEqualTo=Pe.lte=function(e){return this.cmp(e)<1};Pe.logarithm=Pe.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(dn))throw Error(Dn+"NaN");if(r.s<1)throw Error(Dn+(r.s?"NaN":"-Infinity"));return r.eq(dn)?new n(0):(Dt=!1,t=ti(_u(r,i),_u(e,i),i),Dt=!0,jt(t,a))};Pe.minus=Pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?LL(t,e):ML(t,(e.s=-e.s,e))};Pe.modulo=Pe.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(Dn+"NaN");return r.s?(Dt=!1,t=ti(r,e,0,1).times(e),Dt=!0,r.minus(t)):jt(new n(r),a)};Pe.naturalExponential=Pe.exp=function(){return DL(this)};Pe.naturalLogarithm=Pe.ln=function(){return _u(this)};Pe.negated=Pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Pe.plus=Pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ML(t,e):LL(t,(e.s=-e.s,e))};Pe.precision=Pe.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Io+e);if(t=Jt(a)+1,n=a.d.length-1,r=n*Rt+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Pe.squareRoot=Pe.sqrt=function(){var e,t,r,n,a,i,o,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Dn+"NaN")}for(e=Jt(u),Dt=!1,a=Math.sqrt(+u),a==0||a==1/0?(t=va(u.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Ul((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new d(t)):n=new d(a.toString()),r=d.precision,a=o=r+3;;)if(i=n,n=i.plus(ti(u,i,o+2)).times(.5),va(i.d).slice(0,o)===(t=va(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(jt(i,r+1,0),i.times(i).eq(u)){n=i;break}}else if(t!="9999")break;o+=4}return Dt=!0,jt(n,r)};Pe.times=Pe.mul=function(e){var t,r,n,a,i,o,u,d,c,h=this,p=h.constructor,m=h.d,v=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,r=h.e+e.e,d=m.length,c=v.length,d=0;){for(t=0,a=d+n;a>n;)u=i[a]+v[n]*m[a-n-1]+t,i[a--]=u%hr|0,t=u/hr|0;i[a]=(i[a]+t)%hr|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,Dt?jt(e,p.precision):e};Pe.toDecimalPlaces=Pe.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ja(e,0,ql),t===void 0?t=n.rounding:ja(t,0,8),jt(r,e+Jt(r)+1,t))};Pe.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=$o(n,!0):(ja(e,0,ql),t===void 0?t=a.rounding:ja(t,0,8),n=jt(new a(n),e+1,t),r=$o(n,!0,e+1)),r};Pe.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?$o(a):(ja(e,0,ql),t===void 0?t=i.rounding:ja(t,0,8),n=jt(new i(a),e+Jt(a)+1,t),r=$o(n.abs(),!1,e+Jt(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};Pe.toInteger=Pe.toint=function(){var e=this,t=e.constructor;return jt(new t(e),Jt(e)+1,t.rounding)};Pe.toNumber=function(){return+this};Pe.toPower=Pe.pow=function(e){var t,r,n,a,i,o,u=this,d=u.constructor,c=12,h=+(e=new d(e));if(!e.s)return new d(dn);if(u=new d(u),!u.s){if(e.s<1)throw Error(Dn+"Infinity");return u}if(u.eq(dn))return u;if(n=d.precision,e.eq(dn))return jt(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=u.s,o){if((r=h<0?-h:h)<=IL){for(a=new d(dn),t=Math.ceil(n/Rt+4),Dt=!1;r%2&&(a=a.times(u),oT(a.d,t)),r=Ul(r/2),r!==0;)u=u.times(u),oT(u.d,t);return Dt=!0,e.s<0?new d(dn).div(a):jt(a,n)}}else if(i<0)throw Error(Dn+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,Dt=!1,a=e.times(_u(u,n+c)),Dt=!0,a=DL(a),a.s=i,a};Pe.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=Jt(a),n=$o(a,r<=i.toExpNeg||r>=i.toExpPos)):(ja(e,1,ql),t===void 0?t=i.rounding:ja(t,0,8),a=jt(new i(a),e,t),r=Jt(a),n=$o(a,e<=r||r<=i.toExpNeg,e)),n};Pe.toSignificantDigits=Pe.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ja(e,1,ql),t===void 0?t=n.rounding:ja(t,0,8)),jt(new n(r),e,t)};Pe.toString=Pe.valueOf=Pe.val=Pe.toJSON=Pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Jt(e),r=e.constructor;return $o(e,t<=r.toExpNeg||t>=r.toExpPos)};function ML(e,t){var r,n,a,i,o,u,d,c,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),Dt?jt(t,p):t;if(d=e.d,c=t.d,o=e.e,a=t.e,d=d.slice(),i=o-a,i){for(i<0?(n=d,i=-i,u=c.length):(n=c,a=o,u=d.length),o=Math.ceil(p/Rt),u=o>u?o+1:u+1,i>u&&(i=u,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(u=d.length,i=c.length,u-i<0&&(i=u,n=c,c=d,d=n),r=0;i;)r=(d[--i]=d[i]+c[i]+r)/hr|0,d[i]%=hr;for(r&&(d.unshift(r),++a),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=a,Dt?jt(t,p):t}function ja(e,t,r){if(e!==~~e||er)throw Error(Io+e)}function va(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;to?1:-1;else for(u=d=0;ua[u]?1:-1;break}return d}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]1;)n.shift()}return function(n,a,i,o){var u,d,c,h,p,m,v,x,y,S,j,N,E,A,C,O,T,R,L=n.constructor,q=n.s==a.s?1:-1,F=n.d,B=a.d;if(!n.s)return new L(n);if(!a.s)throw Error(Dn+"Division by zero");for(d=n.e-a.e,T=B.length,C=F.length,v=new L(q),x=v.d=[],c=0;B[c]==(F[c]||0);)++c;if(B[c]>(F[c]||0)&&--d,i==null?N=i=L.precision:o?N=i+(Jt(n)-Jt(a))+1:N=i,N<0)return new L(0);if(N=N/Rt+2|0,c=0,T==1)for(h=0,B=B[0],N++;(c1&&(B=e(B,h),F=e(F,h),T=B.length,C=F.length),A=T,y=F.slice(0,T),S=y.length;S=hr/2&&++O;do h=0,u=t(B,y,T,S),u<0?(j=y[0],T!=S&&(j=j*hr+(y[1]||0)),h=j/O|0,h>1?(h>=hr&&(h=hr-1),p=e(B,h),m=p.length,S=y.length,u=t(p,y,m,S),u==1&&(h--,r(p,T16)throw Error(Dj+Jt(e));if(!e.s)return new h(dn);for(Dt=!1,u=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),c+=5;for(n=Math.log(Co(2,c))/Math.LN10*2+5|0,u+=n,r=a=i=new h(dn),h.precision=u;;){if(a=jt(a.times(e),u),r=r.times(++d),o=i.plus(ti(a,r,u)),va(o.d).slice(0,u)===va(i.d).slice(0,u)){for(;c--;)i=jt(i.times(i),u);return h.precision=p,t==null?(Dt=!0,jt(i,p)):i}i=o}}function Jt(e){for(var t=e.e*Rt,r=e.d[0];r>=10;r/=10)t++;return t}function Ub(e,t,r){if(t>e.LN10.sd())throw Dt=!0,r&&(e.precision=r),Error(Dn+"LN10 precision limit exceeded");return jt(new e(e.LN10),t)}function Bi(e){for(var t="";e--;)t+="0";return t}function _u(e,t){var r,n,a,i,o,u,d,c,h,p=1,m=10,v=e,x=v.d,y=v.constructor,S=y.precision;if(v.s<1)throw Error(Dn+(v.s?"NaN":"-Infinity"));if(v.eq(dn))return new y(0);if(t==null?(Dt=!1,c=S):c=t,v.eq(10))return t==null&&(Dt=!0),Ub(y,c);if(c+=m,y.precision=c,r=va(x),n=r.charAt(0),i=Jt(v),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=va(v.d),n=r.charAt(0),p++;i=Jt(v),n>1?(v=new y("0."+r),i++):v=new y(n+"."+r.slice(1))}else return d=Ub(y,c+2,S).times(i+""),v=_u(new y(n+"."+r.slice(1)),c-m).plus(d),y.precision=S,t==null?(Dt=!0,jt(v,S)):v;for(u=o=v=ti(v.minus(dn),v.plus(dn),c),h=jt(v.times(v),c),a=3;;){if(o=jt(o.times(h),c),d=u.plus(ti(o,new y(a),c)),va(d.d).slice(0,c)===va(u.d).slice(0,c))return u=u.times(2),i!==0&&(u=u.plus(Ub(y,c+2,S).times(i+""))),u=ti(u,new y(p),c),y.precision=S,t==null?(Dt=!0,jt(u,S)):u;u=d,a+=2}}function iT(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Ul(r/Rt),e.d=[],n=(r+1)%Rt,r<0&&(n+=Rt),nSp||e.e<-Sp))throw Error(Dj+r)}else e.s=0,e.e=0,e.d=[0];return e}function jt(e,t,r){var n,a,i,o,u,d,c,h,p=e.d;for(o=1,i=p[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=Rt,a=t,c=p[h=0];else{if(h=Math.ceil((n+1)/Rt),i=p.length,h>=i)return e;for(c=i=p[h],o=1;i>=10;i/=10)o++;n%=Rt,a=n-Rt+o}if(r!==void 0&&(i=Co(10,o-a-1),u=c/i%10|0,d=t<0||p[h+1]!==void 0||c%i,d=r<4?(u||d)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||d||r==6&&(n>0?a>0?c/Co(10,o-a):0:p[h-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return d?(i=Jt(e),p.length=1,t=t-i-1,p[0]=Co(10,(Rt-t%Rt)%Rt),e.e=Ul(-t/Rt)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(n==0?(p.length=h,i=1,h--):(p.length=h+1,i=Co(10,Rt-n),p[h]=a>0?(c/Co(10,o-a)%Co(10,a)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==hr&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=hr)break;p[h--]=0,i=1}for(n=p.length;p[--n]===0;)p.pop();if(Dt&&(e.e>Sp||e.e<-Sp))throw Error(Dj+Jt(e));return e}function LL(e,t){var r,n,a,i,o,u,d,c,h,p,m=e.constructor,v=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Dt?jt(t,v):t;if(d=e.d,p=t.d,n=t.e,c=e.e,d=d.slice(),o=c-n,o){for(h=o<0,h?(r=d,o=-o,u=p.length):(r=p,n=c,u=d.length),a=Math.max(Math.ceil(v/Rt),u)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=d.length,u=p.length,h=a0;--a)d[u++]=0;for(a=p.length;a>o;){if(d[--a]0?i=i.charAt(0)+"."+i.slice(1)+Bi(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Bi(-a-1)+i,r&&(n=r-o)>0&&(i+=Bi(n))):a>=o?(i+=Bi(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+Bi(n))):((n=a+1)0&&(a+1===o&&(i+="."),i+=Bi(n))),e.s<0?"-"+i:i}function oT(e,t){if(e.length>t)return e.length=t,!0}function $L(e){var t,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Io+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return iT(o,i.toString())}else if(typeof i!="string")throw Error(Io+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,sX.test(i))iT(o,i);else throw Error(Io+i)}if(a.prototype=Pe,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=$L,a.config=a.set=lX,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(Io+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Io+r+": "+n);return this}var Lj=$L(oX);dn=new Lj(1);const bt=Lj;function cX(e){return hX(e)||fX(e)||dX(e)||uX()}function uX(){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 dX(e,t){if(e){if(typeof e=="string")return Sw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Sw(e,t)}}function fX(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function hX(e){if(Array.isArray(e))return Sw(e)}function Sw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,a):e(t-o,sT(function(){for(var u=arguments.length,d=new Array(u),c=0;ce.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),u;!(n=(u=o.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(d){a=!0,i=d}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return r}}function OX(e){if(Array.isArray(e))return e}function UL(e){var t=Nu(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function VL(e,t,r){if(e.lte(0))return new bt(0);var n=Mm.getDigitCount(e.toNumber()),a=new bt(10).pow(n),i=e.div(a),o=n!==1?.05:.1,u=new bt(Math.ceil(i.div(o).toNumber())).add(r).mul(o),d=u.mul(a);return t?d:new bt(Math.ceil(d))}function PX(e,t,r){var n=1,a=new bt(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new bt(10).pow(Mm.getDigitCount(e)-1),a=new bt(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new bt(Math.floor(e)))}else e===0?a=new bt(Math.floor((t-1)/2)):r||(a=new bt(Math.floor(e)));var o=Math.floor((t-1)/2),u=vX(gX(function(d){return a.add(new bt(d-o).mul(n)).toNumber()}),jw);return u(0,t)}function HL(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new bt(0),tickMin:new bt(0),tickMax:new bt(0)};var i=VL(new bt(t).sub(e).div(r-1),n,a),o;e<=0&&t>=0?o=new bt(0):(o=new bt(e).add(t).div(2),o=o.sub(new bt(o).mod(i)));var u=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new bt(t).sub(o).div(i).toNumber()),c=u+d+1;return c>r?HL(e,t,r,n,a+1):(c0?d+(r-c):d,u=t>0?u:u+(r-c)),{step:i,tickMin:o.sub(new bt(u).mul(i)),tickMax:o.add(new bt(d).mul(i))})}function AX(e){var t=Nu(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),u=UL([r,n]),d=Nu(u,2),c=d[0],h=d[1];if(c===-1/0||h===1/0){var p=h===1/0?[c].concat(Nw(jw(0,a-1).map(function(){return 1/0}))):[].concat(Nw(jw(0,a-1).map(function(){return-1/0})),[h]);return r>n?_w(p):p}if(c===h)return PX(c,a,i);var m=HL(c,h,o,i),v=m.step,x=m.tickMin,y=m.tickMax,S=Mm.rangeStep(x,y.add(new bt(.1).mul(v)),v);return r>n?_w(S):S}function TX(e,t){var r=Nu(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=UL([n,a]),u=Nu(o,2),d=u[0],c=u[1];if(d===-1/0||c===1/0)return[n,a];if(d===c)return[d];var h=Math.max(t,2),p=VL(new bt(c).sub(d).div(h-1),i,0),m=[].concat(Nw(Mm.rangeStep(new bt(d),new bt(c).sub(new bt(.99).mul(p)),p)),[c]);return n>a?_w(m):m}var kX=zL(AX),RX=zL(TX),IX="Invariant failed";function Bo(e,t){throw new Error(IX)}var MX=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function hl(e){"@babel/helpers - typeof";return hl=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},hl(e)}function jp(){return jp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function UX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VX(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,u=(r=n?.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var d=i.range,c=0;c0?a[c-1].coordinate:a[u-1].coordinate,p=a[c].coordinate,m=c>=u-1?a[0].coordinate:a[c+1].coordinate,v=void 0;if(Rr(p-h)!==Rr(m-p)){var x=[];if(Rr(m-p)===Rr(d[1]-d[0])){v=m;var y=p+d[1]-d[0];x[0]=Math.min(y,(y+h)/2),x[1]=Math.max(y,(y+h)/2)}else{v=h;var S=m+d[1]-d[0];x[0]=Math.min(p,(S+p)/2),x[1]=Math.max(p,(S+p)/2)}var j=[Math.min(p,(v+p)/2),Math.max(p,(v+p)/2)];if(t>j[0]&&t<=j[1]||t>=x[0]&&t<=x[1]){o=a[c].index;break}}else{var N=Math.min(h,m),E=Math.max(h,m);if(t>(N+p)/2&&t<=(E+p)/2){o=a[c].index;break}}}else for(var A=0;A0&&A(n[A].coordinate+n[A-1].coordinate)/2&&t<=(n[A].coordinate+n[A+1].coordinate)/2||A===u-1&&t>(n[A].coordinate+n[A-1].coordinate)/2){o=n[A].index;break}return o},$j=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?qt(qt({},t.type.defaultProps),t.props):t.props,o=i.stroke,u=i.fill,d;switch(a){case"Line":d=o;break;case"Area":case"Radar":d=o&&o!=="none"?o:u;break;default:d=u;break}return d},sY=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},u=Object.keys(i),d=0,c=u.length;d=0});if(j&&j.length){var N=j[0].type.defaultProps,E=N!==void 0?qt(qt({},N),j[0].props):j[0].props,A=E.barSize,C=E[S];o[C]||(o[C]=[]);var O=Ze(A)?r:A;o[C].push({item:j[0],stackList:j.slice(1),barSize:Ze(O)?void 0:Ir(O,n,0)})}}return o},lY=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,u=t.maxBarSize,d=o.length;if(d<1)return null;var c=Ir(r,a,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var m=!1,v=a/d,x=o.reduce(function(A,C){return A+C.barSize||0},0);x+=(d-1)*c,x>=a&&(x-=(d-1)*c,c=0),x>=a&&v>0&&(m=!0,v*=.9,x=d*v);var y=(a-x)/2>>0,S={offset:y-c,size:0};h=o.reduce(function(A,C){var O={item:C.item,position:{offset:S.offset+S.size+c,size:m?v:C.barSize}},T=[].concat(uT(A),[O]);return S=T[T.length-1].position,C.stackList&&C.stackList.length&&C.stackList.forEach(function(R){T.push({item:R,position:S})}),T},p)}else{var j=Ir(n,a,0,!0);a-2*j-(d-1)*c<=0&&(c=0);var N=(a-2*j-(d-1)*c)/d;N>1&&(N>>=0);var E=u===+u?Math.min(N,u):N;h=o.reduce(function(A,C,O){var T=[].concat(uT(A),[{item:C.item,position:{offset:j+(N+c)*O+(N-E)/2,size:E}}]);return C.stackList&&C.stackList.length&&C.stackList.forEach(function(R){T.push({item:R,position:T[T.length-1].position})}),T},p)}return h},cY=function(t,r,n,a){var i=n.children,o=n.width,u=n.margin,d=o-(u.left||0)-(u.right||0),c=XL({children:i,legendWidth:d});if(c){var h=a||{},p=h.width,m=h.height,v=c.align,x=c.verticalAlign,y=c.layout;if((y==="vertical"||y==="horizontal"&&x==="middle")&&v!=="center"&&Ne(t[v]))return qt(qt({},t),{},Js({},v,t[v]+(p||0)));if((y==="horizontal"||y==="vertical"&&v==="center")&&x!=="middle"&&Ne(t[x]))return qt(qt({},t),{},Js({},x,t[x]+(m||0)))}return t},uY=function(t,r,n){return Ze(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},YL=function(t,r,n,a,i){var o=r.props.children,u=hn(o,od).filter(function(c){return uY(a,i,c.props.direction)});if(u&&u.length){var d=u.map(function(c){return c.props.dataKey});return t.reduce(function(c,h){var p=or(h,n);if(Ze(p))return c;var m=Array.isArray(p)?[Rm(p),km(p)]:[p,p],v=d.reduce(function(x,y){var S=or(h,y,0),j=m[0]-Math.abs(Array.isArray(S)?S[0]:S),N=m[1]+Math.abs(Array.isArray(S)?S[1]:S);return[Math.min(j,x[0]),Math.max(N,x[1])]},[1/0,-1/0]);return[Math.min(v[0],c[0]),Math.max(v[1],c[1])]},[1/0,-1/0])}return null},dY=function(t,r,n,a,i){var o=r.map(function(u){return YL(t,u,n,i,a)}).filter(function(u){return!Ze(u)});return o&&o.length?o.reduce(function(u,d){return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]):null},JL=function(t,r,n,a,i){var o=r.map(function(d){var c=d.props.dataKey;return n==="number"&&c&&YL(t,d,c,a)||au(t,c,n,i)});if(n==="number")return o.reduce(function(d,c){return[Math.min(d[0],c[0]),Math.max(d[1],c[1])]},[1/0,-1/0]);var u={};return o.reduce(function(d,c){for(var h=0,p=c.length;h=2?Rr(u[0]-u[1])*2*c:c,r&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var m=i?i.indexOf(p):p;return{coordinate:a(m)+c,value:p,offset:c}});return h.filter(function(p){return!Zu(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,m){return{coordinate:a(p)+c,value:p,index:m,offset:c}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(p){return{coordinate:a(p)+c,value:p,offset:c}}):a.domain().map(function(p,m){return{coordinate:a(p)+c,value:i?i[p]:p,index:m,offset:c}})},Vb=new WeakMap,Wf=function(t,r){if(typeof r!="function")return t;Vb.has(t)||Vb.set(t,new WeakMap);var n=Vb.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},e$=function(t,r,n){var a=t.scale,i=t.type,o=t.layout,u=t.axisType;if(a==="auto")return o==="radial"&&u==="radiusAxis"?{scale:xu(),realScaleType:"band"}:o==="radial"&&u==="angleAxis"?{scale:yp(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:nu(),realScaleType:"point"}:i==="category"?{scale:xu(),realScaleType:"band"}:{scale:yp(),realScaleType:"linear"};if(Mo(a)){var d="scale".concat(vm(a));return{scale:(Y2[d]||nu)(),realScaleType:Y2[d]?d:"point"}}return He(a)?{scale:a}:{scale:nu(),realScaleType:"point"}},fT=1e-4,t$=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-fT,o=Math.max(a[0],a[1])+fT,u=t(r[0]),d=t(r[n-1]);(uo||do)&&t.domain([r[0],r[n-1]])}},fY=function(t,r){if(!t)return null;for(var n=0,a=t.length;na)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]=0?(t[u][n][0]=i,t[u][n][1]=i+d,i=t[u][n][1]):(t[u][n][0]=o,t[u][n][1]=o+d,o=t[u][n][1])}},mY=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n=0?(t[o][n][0]=i,t[o][n][1]=i+u,i=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},gY={sign:pY,expand:n7,none:il,silhouette:a7,wiggle:i7,positive:mY},vY=function(t,r,n){var a=r.map(function(u){return u.props.dataKey}),i=gY[n],o=r7().keys(a).value(function(u,d){return+or(u,d,0)}).order(aw).offset(i);return o(t)},yY=function(t,r,n,a,i,o){if(!t)return null;var u=o?r.reverse():r,d={},c=u.reduce(function(p,m){var v,x=(v=m.type)!==null&&v!==void 0&&v.defaultProps?qt(qt({},m.type.defaultProps),m.props):m.props,y=x.stackId,S=x.hide;if(S)return p;var j=x[n],N=p[j]||{hasStack:!1,stackGroups:{}};if(sr(y)){var E=N.stackGroups[y]||{numericAxisId:n,cateAxisId:a,items:[]};E.items.push(m),N.hasStack=!0,N.stackGroups[y]=E}else N.stackGroups[Bl("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[m]};return qt(qt({},p),{},Js({},j,N))},d),h={};return Object.keys(c).reduce(function(p,m){var v=c[m];if(v.hasStack){var x={};v.stackGroups=Object.keys(v.stackGroups).reduce(function(y,S){var j=v.stackGroups[S];return qt(qt({},y),{},Js({},S,{numericAxisId:n,cateAxisId:a,items:j.items,stackedData:vY(t,j.items,i)}))},x)}return qt(qt({},p),{},Js({},m,v))},h)},r$=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,o=r.originalDomain,u=r.allowDecimals,d=n||r.scale;if(d!=="auto"&&d!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var c=t.domain();if(!c.length)return null;var h=kX(c,i,u);return t.domain([Rm(h),km(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),m=RX(p,i,u);return{niceTicks:m}}return null};function hT(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ze(a[t.dataKey])){var u=Qh(r,"value",a[t.dataKey]);if(u)return u.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var d=or(a,Ze(o)?t.dataKey:o);return Ze(d)?null:t.scale(d)}var pT=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+a:null;var d=or(o,r.dataKey,r.domain[u]);return Ze(d)?null:r.scale(d)-i/2+a},xY=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},bY=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?qt(qt({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(sr(i)){var o=r[i];if(o){var u=o.items.indexOf(t);return u>=0?o.stackedData[u]:null}}return null},wY=function(t){return t.reduce(function(r,n){return[Rm(n.concat([r[0]]).filter(Ne)),km(n.concat([r[1]]).filter(Ne))]},[1/0,-1/0])},n$=function(t,r,n){return Object.keys(t).reduce(function(a,i){var o=t[i],u=o.stackedData,d=u.reduce(function(c,h){var p=wY(h.slice(r,n+1));return[Math.min(c[0],p[0]),Math.max(c[1],p[1])]},[1/0,-1/0]);return[Math.min(d[0],a[0]),Math.max(d[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},mT=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,gT=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Pw=function(t,r,n){if(He(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(Ne(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(mT.test(t[0])){var i=+mT.exec(t[0])[1];a[0]=r[0]-i}else He(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(Ne(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(gT.test(t[1])){var o=+gT.exec(t[1])[1];a[1]=r[1]+o}else He(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},Np=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=fj(r,function(p){return p.coordinate}),o=1/0,u=1,d=i.length;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},AY=function(t,r,n,a,i){var o=t.width,u=t.height,d=t.startAngle,c=t.endAngle,h=Ir(t.cx,o,o/2),p=Ir(t.cy,u,u/2),m=o$(o,u,n),v=Ir(t.innerRadius,m,0),x=Ir(t.outerRadius,m,m*.8),y=Object.keys(r);return y.reduce(function(S,j){var N=r[j],E=N.domain,A=N.reversed,C;if(Ze(N.range))a==="angleAxis"?C=[d,c]:a==="radiusAxis"&&(C=[v,x]),A&&(C=[C[1],C[0]]);else{C=N.range;var O=C,T=_Y(O,2);d=T[0],c=T[1]}var R=e$(N,i),L=R.realScaleType,q=R.scale;q.domain(E).range(C),t$(q);var F=r$(q,Ya(Ya({},N),{},{realScaleType:L})),B=Ya(Ya(Ya({},N),F),{},{range:C,radius:x,realScaleType:L,scale:q,cx:h,cy:p,innerRadius:v,outerRadius:x,startAngle:d,endAngle:c});return Ya(Ya({},S),{},i$({},j,B))},{})},TY=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-o,2))},kY=function(t,r){var n=t.x,a=t.y,i=r.cx,o=r.cy,u=TY({x:n,y:a},{x:i,y:o});if(u<=0)return{radius:u};var d=(n-i)/u,c=Math.acos(d);return a>o&&(c=2*Math.PI-c),{radius:u,angle:PY(c),angleInRadian:c}},RY=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return{startAngle:r-o*360,endAngle:n-o*360}},IY=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),o=Math.floor(a/360),u=Math.min(i,o);return t+u*360},bT=function(t,r){var n=t.x,a=t.y,i=kY({x:n,y:a},r),o=i.radius,u=i.angle,d=r.innerRadius,c=r.outerRadius;if(oc)return!1;if(o===0)return!0;var h=RY(r),p=h.startAngle,m=h.endAngle,v=u,x;if(p<=m){for(;v>m;)v-=360;for(;v=p&&v<=m}else{for(;v>p;)v-=360;for(;v=m&&v<=p}return x?Ya(Ya({},r),{},{radius:o,angle:IY(v,r)}):null},s$=function(t){return!b.isValidElement(t)&&!He(t)&&typeof t!="boolean"?t.className:""};function Pu(e){"@babel/helpers - typeof";return Pu=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},Pu(e)}var MY=["offset"];function DY(e){return FY(e)||BY(e)||$Y(e)||LY()}function LY(){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 $Y(e,t){if(e){if(typeof e=="string")return Aw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Aw(e,t)}}function BY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function FY(e){if(Array.isArray(e))return Aw(e)}function Aw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ir(e){for(var t=1;t=0?1:-1,E,A;a==="insideStart"?(E=v+N*o,A=y):a==="insideEnd"?(E=x-N*o,A=!y):a==="end"&&(E=x+N*o,A=y),A=j<=0?A:!A;var C=Ot(c,h,S,E),O=Ot(c,h,S,E+(A?1:-1)*359),T="M".concat(C.x,",").concat(C.y,` + A`).concat(S,",").concat(S,",0,1,").concat(A?0:1,`, + `).concat(O.x,",").concat(O.y),R=Ze(t.id)?Bl("recharts-radial-line-"):t.id;return z.createElement("text",Au({},n,{dominantBaseline:"central",className:et("recharts-radial-bar-label",u)}),z.createElement("defs",null,z.createElement("path",{id:R,d:T})),z.createElement("textPath",{xlinkHref:"#".concat(R)},r))},XY=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,o=i.cx,u=i.cy,d=i.innerRadius,c=i.outerRadius,h=i.startAngle,p=i.endAngle,m=(h+p)/2;if(a==="outside"){var v=Ot(o,u,c+n,m),x=v.x,y=v.y;return{x,y,textAnchor:x>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"end"};var S=(d+c)/2,j=Ot(o,u,S,m),N=j.x,E=j.y;return{x:N,y:E,textAnchor:"middle",verticalAnchor:"middle"}},YY=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,o=r,u=o.x,d=o.y,c=o.width,h=o.height,p=h>=0?1:-1,m=p*a,v=p>0?"end":"start",x=p>0?"start":"end",y=c>=0?1:-1,S=y*a,j=y>0?"end":"start",N=y>0?"start":"end";if(i==="top"){var E={x:u+c/2,y:d-p*a,textAnchor:"middle",verticalAnchor:v};return ir(ir({},E),n?{height:Math.max(d-n.y,0),width:c}:{})}if(i==="bottom"){var A={x:u+c/2,y:d+h+m,textAnchor:"middle",verticalAnchor:x};return ir(ir({},A),n?{height:Math.max(n.y+n.height-(d+h),0),width:c}:{})}if(i==="left"){var C={x:u-S,y:d+h/2,textAnchor:j,verticalAnchor:"middle"};return ir(ir({},C),n?{width:Math.max(C.x-n.x,0),height:h}:{})}if(i==="right"){var O={x:u+c+S,y:d+h/2,textAnchor:N,verticalAnchor:"middle"};return ir(ir({},O),n?{width:Math.max(n.x+n.width-O.x,0),height:h}:{})}var T=n?{width:c,height:h}:{};return i==="insideLeft"?ir({x:u+S,y:d+h/2,textAnchor:N,verticalAnchor:"middle"},T):i==="insideRight"?ir({x:u+c-S,y:d+h/2,textAnchor:j,verticalAnchor:"middle"},T):i==="insideTop"?ir({x:u+c/2,y:d+m,textAnchor:"middle",verticalAnchor:x},T):i==="insideBottom"?ir({x:u+c/2,y:d+h-m,textAnchor:"middle",verticalAnchor:v},T):i==="insideTopLeft"?ir({x:u+S,y:d+m,textAnchor:N,verticalAnchor:x},T):i==="insideTopRight"?ir({x:u+c-S,y:d+m,textAnchor:j,verticalAnchor:x},T):i==="insideBottomLeft"?ir({x:u+S,y:d+h-m,textAnchor:N,verticalAnchor:v},T):i==="insideBottomRight"?ir({x:u+c-S,y:d+h-m,textAnchor:j,verticalAnchor:v},T):$l(i)&&(Ne(i.x)||Oo(i.x))&&(Ne(i.y)||Oo(i.y))?ir({x:u+Ir(i.x,c),y:d+Ir(i.y,h),textAnchor:"end",verticalAnchor:"end"},T):ir({x:u+c/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},T)},JY=function(t){return"cx"in t&&Ne(t.cx)};function pr(e){var t=e.offset,r=t===void 0?5:t,n=zY(e,MY),a=ir({offset:r},n),i=a.viewBox,o=a.position,u=a.value,d=a.children,c=a.content,h=a.className,p=h===void 0?"":h,m=a.textBreakAll;if(!i||Ze(u)&&Ze(d)&&!b.isValidElement(c)&&!He(c))return null;if(b.isValidElement(c))return b.cloneElement(c,a);var v;if(He(c)){if(v=b.createElement(c,a),b.isValidElement(v))return v}else v=WY(a);var x=JY(i),y=ze(a,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return KY(a,v,y);var S=x?XY(a):YY(a);return z.createElement(Lo,Au({className:et("recharts-label",p)},y,S,{breakAll:m}),v)}pr.displayName="Label";var l$=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,u=t.r,d=t.radius,c=t.innerRadius,h=t.outerRadius,p=t.x,m=t.y,v=t.top,x=t.left,y=t.width,S=t.height,j=t.clockWise,N=t.labelViewBox;if(N)return N;if(Ne(y)&&Ne(S)){if(Ne(p)&&Ne(m))return{x:p,y:m,width:y,height:S};if(Ne(v)&&Ne(x))return{x:v,y:x,width:y,height:S}}return Ne(p)&&Ne(m)?{x:p,y:m,width:0,height:0}:Ne(r)&&Ne(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:o||a||0,innerRadius:c||0,outerRadius:h||d||u||0,clockWise:j}:t.viewBox?t.viewBox:{}},QY=function(t,r){return t?t===!0?z.createElement(pr,{key:"label-implicit",viewBox:r}):sr(t)?z.createElement(pr,{key:"label-implicit",viewBox:r,value:t}):b.isValidElement(t)?t.type===pr?b.cloneElement(t,{key:"label-implicit",viewBox:r}):z.createElement(pr,{key:"label-implicit",content:t,viewBox:r}):He(t)?z.createElement(pr,{key:"label-implicit",content:t,viewBox:r}):$l(t)?z.createElement(pr,Au({viewBox:r},t,{key:"label-implicit"})):null:null},ZY=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=l$(t),o=hn(a,pr).map(function(d,c){return b.cloneElement(d,{viewBox:r||i,key:"label-".concat(c)})});if(!n)return o;var u=QY(t.label,r||i);return[u].concat(DY(o))};pr.parseViewBox=l$;pr.renderCallByParent=ZY;var Hb,ST;function eJ(){if(ST)return Hb;ST=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Hb=e,Hb}var tJ=eJ();const rJ=dt(tJ);function Tu(e){"@babel/helpers - typeof";return Tu=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},Tu(e)}var nJ=["valueAccessor"],aJ=["data","dataKey","clockWise","id","textBreakAll"];function iJ(e){return cJ(e)||lJ(e)||sJ(e)||oJ()}function oJ(){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 sJ(e,t){if(e){if(typeof e=="string")return Tw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tw(e,t)}}function lJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function cJ(e){if(Array.isArray(e))return Tw(e)}function Tw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var pJ=function(t){return Array.isArray(t.value)?rJ(t.value):t.value};function ri(e){var t=e.valueAccessor,r=t===void 0?pJ:t,n=NT(e,nJ),a=n.data,i=n.dataKey,o=n.clockWise,u=n.id,d=n.textBreakAll,c=NT(n,aJ);return!a||!a.length?null:z.createElement(lt,{className:"recharts-label-list"},a.map(function(h,p){var m=Ze(i)?r(h,p):or(h&&h.payload,i),v=Ze(u)?{}:{id:"".concat(u,"-").concat(p)};return z.createElement(pr,Ep({},ze(h,!0),c,v,{parentViewBox:h.parentViewBox,value:m,textBreakAll:d,viewBox:pr.parseViewBox(Ze(o)?h:_T(_T({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}ri.displayName="LabelList";function mJ(e,t){return e?e===!0?z.createElement(ri,{key:"labelList-implicit",data:t}):z.isValidElement(e)||He(e)?z.createElement(ri,{key:"labelList-implicit",data:t,content:e}):$l(e)?z.createElement(ri,Ep({data:t},e,{key:"labelList-implicit"})):null:null}function gJ(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=hn(n,ri).map(function(o,u){return b.cloneElement(o,{data:t,key:"labelList-".concat(u)})});if(!r)return a;var i=mJ(e.label,t);return[i].concat(iJ(a))}ri.renderCallByParent=gJ;function ku(e){"@babel/helpers - typeof";return ku=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},ku(e)}function kw(){return kw=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>c),`, + `).concat(p.x,",").concat(p.y,` + `);if(a>0){var v=Ot(r,n,a,o),x=Ot(r,n,a,c);m+="L ".concat(x.x,",").concat(x.y,` + A `).concat(a,",").concat(a,`,0, + `).concat(+(Math.abs(d)>180),",").concat(+(o<=c),`, + `).concat(v.x,",").concat(v.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},wJ=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,u=t.forceCornerRadius,d=t.cornerIsExternal,c=t.startAngle,h=t.endAngle,p=Rr(h-c),m=Gf({cx:r,cy:n,radius:i,angle:c,sign:p,cornerRadius:o,cornerIsExternal:d}),v=m.circleTangency,x=m.lineTangency,y=m.theta,S=Gf({cx:r,cy:n,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:d}),j=S.circleTangency,N=S.lineTangency,E=S.theta,A=d?Math.abs(c-h):Math.abs(c-h)-y-E;if(A<0)return u?"M ".concat(x.x,",").concat(x.y,` + a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 + a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 + `):c$({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:c,endAngle:h});var C="M ".concat(x.x,",").concat(x.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(v.x,",").concat(v.y,` + A`).concat(i,",").concat(i,",0,").concat(+(A>180),",").concat(+(p<0),",").concat(j.x,",").concat(j.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(N.x,",").concat(N.y,` + `);if(a>0){var O=Gf({cx:r,cy:n,radius:a,angle:c,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),T=O.circleTangency,R=O.lineTangency,L=O.theta,q=Gf({cx:r,cy:n,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),F=q.circleTangency,B=q.lineTangency,V=q.theta,G=d?Math.abs(c-h):Math.abs(c-h)-L-V;if(G<0&&o===0)return"".concat(C,"L").concat(r,",").concat(n,"Z");C+="L".concat(B.x,",").concat(B.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(F.x,",").concat(F.y,` + A`).concat(a,",").concat(a,",0,").concat(+(G>180),",").concat(+(p>0),",").concat(T.x,",").concat(T.y,` + A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(R.x,",").concat(R.y,"Z")}else C+="L".concat(r,",").concat(n,"Z");return C},SJ={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},u$=function(t){var r=ET(ET({},SJ),t),n=r.cx,a=r.cy,i=r.innerRadius,o=r.outerRadius,u=r.cornerRadius,d=r.forceCornerRadius,c=r.cornerIsExternal,h=r.startAngle,p=r.endAngle,m=r.className;if(o0&&Math.abs(h-p)<360?S=wJ({cx:n,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(y,x/2),forceCornerRadius:d,cornerIsExternal:c,startAngle:h,endAngle:p}):S=c$({cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),z.createElement("path",kw({},ze(r,!0),{className:v,d:S,role:"img"}))};function Ru(e){"@babel/helpers - typeof";return Ru=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},Ru(e)}function Rw(){return Rw=Object.assign?Object.assign.bind():function(e){for(var t=1;tIJ.call(e,t));function es(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const LJ="__v",$J="__o",BJ="_owner",{getOwnPropertyDescriptor:MT,keys:DT}=Object;function FJ(e,t){return e.byteLength===t.byteLength&&Pp(new Uint8Array(e),new Uint8Array(t))}function zJ(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function qJ(e,t){return e.byteLength===t.byteLength&&Pp(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function UJ(e,t){return es(e.getTime(),t.getTime())}function VJ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function HJ(e,t){return e===t}function LT(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.entries();let o,u,d=0;for(;(o=i.next())&&!o.done;){const c=t.entries();let h=!1,p=0;for(;(u=c.next())&&!u.done;){if(a[p]){p++;continue}const m=o.value,v=u.value;if(r.equals(m[0],v[0],d,p,e,t,r)&&r.equals(m[1],v[1],m[0],v[0],e,t,r)){h=a[p]=!0;break}p++}if(!h)return!1;d++}return!0}const WJ=es;function GJ(e,t,r){const n=DT(e);let a=n.length;if(DT(t).length!==a)return!1;for(;a-- >0;)if(!d$(e,t,r,n[a]))return!1;return!0}function Uc(e,t,r){const n=IT(e);let a=n.length;if(IT(t).length!==a)return!1;let i,o,u;for(;a-- >0;)if(i=n[a],!d$(e,t,r,i)||(o=MT(e,i),u=MT(t,i),(o||u)&&(!o||!u||o.configurable!==u.configurable||o.enumerable!==u.enumerable||o.writable!==u.writable)))return!1;return!0}function KJ(e,t){return es(e.valueOf(),t.valueOf())}function XJ(e,t){return e.source===t.source&&e.flags===t.flags}function $T(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.values();let o,u;for(;(o=i.next())&&!o.done;){const d=t.values();let c=!1,h=0;for(;(u=d.next())&&!u.done;){if(!a[h]&&r.equals(o.value,u.value,o.value,u.value,e,t,r)){c=a[h]=!0;break}h++}if(!c)return!1}return!0}function Pp(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function YJ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function d$(e,t,r,n){return(n===BJ||n===$J||n===LJ)&&(e.$$typeof||t.$$typeof)?!0:DJ(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const JJ="[object ArrayBuffer]",QJ="[object Arguments]",ZJ="[object Boolean]",eQ="[object DataView]",tQ="[object Date]",rQ="[object Error]",nQ="[object Map]",aQ="[object Number]",iQ="[object Object]",oQ="[object RegExp]",sQ="[object Set]",lQ="[object String]",cQ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},uQ="[object URL]",dQ=Object.prototype.toString;function fQ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:u,areObjectsEqual:d,arePrimitiveWrappersEqual:c,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:m,areUrlsEqual:v,unknownTagComparators:x}){return function(S,j,N){if(S===j)return!0;if(S==null||j==null)return!1;const E=typeof S;if(E!==typeof j)return!1;if(E!=="object")return E==="number"?u(S,j,N):E==="function"?i(S,j,N):!1;const A=S.constructor;if(A!==j.constructor)return!1;if(A===Object)return d(S,j,N);if(Array.isArray(S))return t(S,j,N);if(A===Date)return n(S,j,N);if(A===RegExp)return h(S,j,N);if(A===Map)return o(S,j,N);if(A===Set)return p(S,j,N);const C=dQ.call(S);if(C===tQ)return n(S,j,N);if(C===oQ)return h(S,j,N);if(C===nQ)return o(S,j,N);if(C===sQ)return p(S,j,N);if(C===iQ)return typeof S.then!="function"&&typeof j.then!="function"&&d(S,j,N);if(C===uQ)return v(S,j,N);if(C===rQ)return a(S,j,N);if(C===QJ)return d(S,j,N);if(cQ[C])return m(S,j,N);if(C===JJ)return e(S,j,N);if(C===eQ)return r(S,j,N);if(C===ZJ||C===aQ||C===lQ)return c(S,j,N);if(x){let O=x[C];if(!O){const T=MJ(S);T&&(O=x[T])}if(O)return O(S,j,N)}return!1}}function hQ({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:FJ,areArraysEqual:r?Uc:zJ,areDataViewsEqual:qJ,areDatesEqual:UJ,areErrorsEqual:VJ,areFunctionsEqual:HJ,areMapsEqual:r?Xb(LT,Uc):LT,areNumbersEqual:WJ,areObjectsEqual:r?Uc:GJ,arePrimitiveWrappersEqual:KJ,areRegExpsEqual:XJ,areSetsEqual:r?Xb($T,Uc):$T,areTypedArraysEqual:r?Xb(Pp,Uc):Pp,areUrlsEqual:YJ,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=Xf(n.areArraysEqual),i=Xf(n.areMapsEqual),o=Xf(n.areObjectsEqual),u=Xf(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:u})}return n}function pQ(e){return function(t,r,n,a,i,o,u){return e(t,r,u)}}function mQ({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(u,d){const{cache:c=e?new WeakMap:void 0,meta:h}=r();return t(u,d,{cache:c,equals:n,meta:h,strict:a})};if(e)return function(u,d){return t(u,d,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const i={cache:void 0,equals:n,meta:void 0,strict:a};return function(u,d){return t(u,d,i)}}const gQ=to();to({strict:!0});to({circular:!0});to({circular:!0,strict:!0});to({createInternalComparator:()=>es});to({strict:!0,createInternalComparator:()=>es});to({circular:!0,createInternalComparator:()=>es});to({circular:!0,createInternalComparator:()=>es,strict:!0});function to(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,i=hQ(e),o=fQ(i),u=r?r(o):pQ(o);return mQ({circular:t,comparator:o,createState:n,equals:u,strict:a})}function vQ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function BT(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):vQ(a)};requestAnimationFrame(n)}function Iw(e){"@babel/helpers - typeof";return Iw=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},Iw(e)}function yQ(e){return SQ(e)||wQ(e)||bQ(e)||xQ()}function xQ(){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 bQ(e,t){if(e){if(typeof e=="string")return FT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return FT(e,t)}}function FT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:j<0?0:j},y=function(j){for(var N=j>1?1:j,E=N,A=0;A<8;++A){var C=p(E)-N,O=v(E);if(Math.abs(C-N)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,o=t.dt,u=o===void 0?17:o,d=function(h,p,m){var v=-(h-p)*n,x=m*i,y=m+(v-x)*u/1e3,S=m*u/1e3+h;return Math.abs(S-p)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ZQ(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i=0)&&(r[a]=e[a]);return r}function Yb(e){return nZ(e)||rZ(e)||tZ(e)||eZ()}function eZ(){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 tZ(e,t){if(e){if(typeof e=="string")return Bw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bw(e,t)}}function rZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function nZ(e){if(Array.isArray(e))return Bw(e)}function Bw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function kp(e){return kp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},kp(e)}var _a=(function(e){lZ(r,e);var t=cZ(r);function r(n,a){var i;aZ(this,r),i=t.call(this,n,a);var o=i.props,u=o.isActive,d=o.attributeName,c=o.from,h=o.to,p=o.steps,m=o.children,v=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(qw(i)),i.changeStyle=i.changeStyle.bind(qw(i)),!u||v<=0)return i.state={style:{}},typeof m=="function"&&(i.state={style:h}),zw(i);if(p&&p.length)i.state={style:p[0].style};else if(c){if(typeof m=="function")return i.state={style:c},zw(i);i.state={style:d?eu({},d,c):c}}else i.state={style:{}};return i}return oZ(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,u=i.canBegin,d=i.attributeName,c=i.shouldReAnimate,h=i.to,p=i.from,m=this.state.style;if(u){if(!o){var v={style:d?eu({},d,h):h};this.state&&m&&(d&&m[d]!==h||!d&&m!==h)&&this.setState(v);return}if(!(gQ(a.to,h)&&a.canBegin&&a.isActive)){var x=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=x||c?p:a.to;if(this.state&&m){var S={style:d?eu({},d,y):y};(d&&m[d]!==y||!d&&m!==y)&&this.setState(S)}this.runAnimation(Wn(Wn({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,u=a.to,d=a.duration,c=a.easing,h=a.begin,p=a.onAnimationEnd,m=a.onAnimationStart,v=YQ(o,u,BQ(c),d,this.changeStyle),x=function(){i.stopJSAnimation=v()};this.manager.start([m,h,x,d,p])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,u=a.begin,d=a.onAnimationStart,c=o[0],h=c.style,p=c.duration,m=p===void 0?0:p,v=function(y,S,j){if(j===0)return y;var N=S.duration,E=S.easing,A=E===void 0?"ease":E,C=S.style,O=S.properties,T=S.onAnimationEnd,R=j>0?o[j-1]:S,L=O||Object.keys(C);if(typeof A=="function"||A==="spring")return[].concat(Yb(y),[i.runJSAnimation.bind(i,{from:R.style,to:C,duration:N,easing:A}),N]);var q=UT(L,N,A),F=Wn(Wn(Wn({},R.style),C),{},{transition:q});return[].concat(Yb(y),[F,N,T]).filter(EQ)};return this.manager.start([d].concat(Yb(o.reduce(v,[h,Math.max(m,u)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=jQ());var i=a.begin,o=a.duration,u=a.attributeName,d=a.to,c=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,m=a.steps,v=a.children,x=this.manager;if(this.unSubscribe=x.subscribe(this.handleStyleChange),typeof c=="function"||typeof v=="function"||c==="spring"){this.runJSAnimation(a);return}if(m.length>1){this.runStepAnimation(a);return}var y=u?eu({},u,d):d,S=UT(Object.keys(y),o,c);x.start([h,i,Wn(Wn({},y),{},{transition:S}),o,p])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var u=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=QQ(a,JQ),c=b.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!u||c===0||o<=0)return i;var p=function(v){var x=v.props,y=x.style,S=y===void 0?{}:y,j=x.className,N=b.cloneElement(v,Wn(Wn({},d),{},{style:Wn(Wn({},S),h),className:j}));return N};return c===1?p(b.Children.only(i)):z.createElement("div",null,b.Children.map(i,function(m){return p(m)}))}}]),r})(b.PureComponent);_a.displayName="Animate";_a.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};_a.propTypes={from:pt.oneOfType([pt.object,pt.string]),to:pt.oneOfType([pt.object,pt.string]),attributeName:pt.string,duration:pt.number,begin:pt.number,easing:pt.oneOfType([pt.string,pt.func]),steps:pt.arrayOf(pt.shape({duration:pt.number.isRequired,style:pt.object.isRequired,easing:pt.oneOfType([pt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),pt.func]),properties:pt.arrayOf("string"),onAnimationEnd:pt.func})),children:pt.oneOfType([pt.node,pt.func]),isActive:pt.bool,canBegin:pt.bool,onAnimationEnd:pt.func,shouldReAnimate:pt.bool,onAnimationStart:pt.func,onAnimationReStart:pt.func};function Du(e){"@babel/helpers - typeof";return Du=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},Du(e)}function Rp(){return Rp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,d=n>=0?1:-1,c=a>=0&&n>=0||a<0&&n<0?1:0,h;if(o>0&&i instanceof Array){for(var p=[0,0,0,0],m=0,v=4;mo?o:i[m];h="M".concat(t,",").concat(r+u*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(c,",").concat(t+d*p[0],",").concat(r)),h+="L ".concat(t+n-d*p[1],",").concat(r),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(c,`, + `).concat(t+n,",").concat(r+u*p[1])),h+="L ".concat(t+n,",").concat(r+a-u*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(c,`, + `).concat(t+n-d*p[2],",").concat(r+a)),h+="L ".concat(t+d*p[3],",").concat(r+a),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(c,`, + `).concat(t,",").concat(r+a-u*p[3])),h+="Z"}else if(o>0&&i===+i&&i>0){var x=Math.min(o,i);h="M ".concat(t,",").concat(r+u*x,` + A `).concat(x,",").concat(x,",0,0,").concat(c,",").concat(t+d*x,",").concat(r,` + L `).concat(t+n-d*x,",").concat(r,` + A `).concat(x,",").concat(x,",0,0,").concat(c,",").concat(t+n,",").concat(r+u*x,` + L `).concat(t+n,",").concat(r+a-u*x,` + A `).concat(x,",").concat(x,",0,0,").concat(c,",").concat(t+n-d*x,",").concat(r+a,` + L `).concat(t+d*x,",").concat(r+a,` + A `).concat(x,",").concat(x,",0,0,").concat(c,",").concat(t,",").concat(r+a-u*x," Z")}else h="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return h},xZ=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,o=r.y,u=r.width,d=r.height;if(Math.abs(u)>0&&Math.abs(d)>0){var c=Math.min(i,i+u),h=Math.max(i,i+u),p=Math.min(o,o+d),m=Math.max(o,o+d);return n>=c&&n<=h&&a>=p&&a<=m}return!1},bZ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Bj=function(t){var r=JT(JT({},bZ),t),n=b.useRef(),a=b.useState(-1),i=dZ(a,2),o=i[0],u=i[1];b.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var A=n.current.getTotalLength();A&&u(A)}catch{}},[]);var d=r.x,c=r.y,h=r.width,p=r.height,m=r.radius,v=r.className,x=r.animationEasing,y=r.animationDuration,S=r.animationBegin,j=r.isAnimationActive,N=r.isUpdateAnimationActive;if(d!==+d||c!==+c||h!==+h||p!==+p||h===0||p===0)return null;var E=et("recharts-rectangle",v);return N?z.createElement(_a,{canBegin:o>0,from:{width:h,height:p,x:d,y:c},to:{width:h,height:p,x:d,y:c},duration:y,animationEasing:x,isActive:N},function(A){var C=A.width,O=A.height,T=A.x,R=A.y;return z.createElement(_a,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:S,duration:y,isActive:j,easing:x},z.createElement("path",Rp({},ze(r,!0),{className:E,d:QT(T,R,C,O,m),ref:n})))}):z.createElement("path",Rp({},ze(r,!0),{className:E,d:QT(d,c,h,p,m)}))},wZ=["points","className","baseLinePoints","connectNulls"];function Us(){return Us=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ZT(e){return EZ(e)||CZ(e)||NZ(e)||_Z()}function _Z(){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 NZ(e,t){if(e){if(typeof e=="string")return Uw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uw(e,t)}}function CZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function EZ(e){if(Array.isArray(e))return Uw(e)}function Uw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){ek(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),ek(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},ou=function(t,r){var n=OZ(t);r&&(n=[n.reduce(function(i,o){return[].concat(ZT(i),ZT(o))},[])]);var a=n.map(function(i){return i.reduce(function(o,u,d){return"".concat(o).concat(d===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},PZ=function(t,r,n){var a=ou(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(ou(r.reverse(),n).slice(1))},AZ=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,o=SZ(t,wZ);if(!r||!r.length)return null;var u=et("recharts-polygon",n);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",c=PZ(r,a,i);return z.createElement("g",{className:u},z.createElement("path",Us({},ze(o,!0),{fill:c.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:c})),d?z.createElement("path",Us({},ze(o,!0),{fill:"none",d:ou(r,i)})):null,d?z.createElement("path",Us({},ze(o,!0),{fill:"none",d:ou(a,i)})):null)}var h=ou(r,i);return z.createElement("path",Us({},ze(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:u,d:h}))};function Vw(){return Vw=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var $Z=function(t,r,n,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(r,"h").concat(n)},BZ=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.top,u=o===void 0?0:o,d=t.left,c=d===void 0?0:d,h=t.width,p=h===void 0?0:h,m=t.height,v=m===void 0?0:m,x=t.className,y=DZ(t,TZ),S=kZ({x:n,y:i,top:u,left:c,width:p,height:v},y);return!Ne(n)||!Ne(i)||!Ne(p)||!Ne(v)||!Ne(u)||!Ne(c)?null:z.createElement("path",Hw({},ze(S,!0),{className:et("recharts-cross",x),d:$Z(n,i,p,v,u,c)}))},Jb,rk;function FZ(){if(rk)return Jb;rk=1;var e=Tm(),t=kL(),r=Pa();function n(a,i){return a&&a.length?e(a,r(i,2),t):void 0}return Jb=n,Jb}var zZ=FZ();const qZ=dt(zZ);var Qb,nk;function UZ(){if(nk)return Qb;nk=1;var e=Tm(),t=Pa(),r=RL();function n(a,i){return a&&a.length?e(a,t(i,2),r):void 0}return Qb=n,Qb}var VZ=UZ();const HZ=dt(VZ);var WZ=["cx","cy","angle","ticks","axisLine"],GZ=["ticks","tick","angle","tickFormatter","stroke"];function ml(e){"@babel/helpers - typeof";return ml=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},ml(e)}function su(){return su=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function XZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ok(e,t){for(var r=0;rck?o=a==="outer"?"start":"end":i<-ck?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.radius,u=n.axisLine,d=n.axisLineType,c=So(So({},ze(this.props,!1)),{},{fill:"none"},ze(u,!1));if(d==="circle")return z.createElement(Dm,Eo({className:"recharts-polar-angle-axis-line"},c,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(m){return Ot(a,i,o,m.coordinate)});return z.createElement(AZ,Eo({className:"recharts-polar-angle-axis-line"},c,{points:p}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,u=a.tickLine,d=a.tickFormatter,c=a.stroke,h=ze(this.props,!1),p=ze(o,!1),m=So(So({},h),{},{fill:"none"},ze(u,!1)),v=i.map(function(x,y){var S=n.getTickLineCoord(x),j=n.getTickTextAnchor(x),N=So(So(So({textAnchor:j},h),{},{stroke:"none",fill:c},p),{},{index:y,payload:x,x:S.x2,y:S.y2});return z.createElement(lt,Eo({className:et("recharts-polar-angle-axis-tick",s$(o)),key:"tick-".concat(x.coordinate)},Do(n.props,x,y)),u&&z.createElement("line",Eo({className:"recharts-polar-angle-axis-tick-line"},m,S)),o&&t.renderTickItem(o,N,d?d(x.value,y):x.value))});return z.createElement(lt,{className:"recharts-polar-angle-axis-ticks"},v)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,o=n.axisLine;return i<=0||!a||!a.length?null:z.createElement(lt,{className:et("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var o;return z.isValidElement(n)?o=z.cloneElement(n,a):He(n)?o=n(a):o=z.createElement(Lo,Eo({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(b.PureComponent);Bm(Fm,"displayName","PolarAngleAxis");Bm(Fm,"axisType","angleAxis");Bm(Fm,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Zb,uk;function uee(){if(uk)return Zb;uk=1;var e=kD(),t=e(Object.getPrototypeOf,Object);return Zb=t,Zb}var e1,dk;function dee(){if(dk)return e1;dk=1;var e=ci(),t=uee(),r=ui(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,u=i.hasOwnProperty,d=o.call(Object);function c(h){if(!r(h)||e(h)!=n)return!1;var p=t(h);if(p===null)return!0;var m=u.call(p,"constructor")&&p.constructor;return typeof m=="function"&&m instanceof m&&o.call(m)==d}return e1=c,e1}var fee=dee();const hee=dt(fee);var t1,fk;function pee(){if(fk)return t1;fk=1;var e=ci(),t=ui(),r="[object Boolean]";function n(a){return a===!0||a===!1||t(a)&&e(a)==r}return t1=n,t1}var mee=pee();const gee=dt(mee);function $u(e){"@babel/helpers - typeof";return $u=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},$u(e)}function Dp(){return Dp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:m,x:d,y:c},to:{upperWidth:h,lowerWidth:p,height:m,x:d,y:c},duration:y,animationEasing:x,isActive:j},function(E){var A=E.upperWidth,C=E.lowerWidth,O=E.height,T=E.x,R=E.y;return z.createElement(_a,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:S,duration:y,easing:x},z.createElement("path",Dp({},ze(r,!0),{className:N,d:gk(T,R,A,C,O),ref:n})))}):z.createElement("g",null,z.createElement("path",Dp({},ze(r,!0),{className:N,d:gk(d,c,h,p,m)})))},Eee=["option","shapeType","propTransformer","activeClassName","isActive"];function Bu(e){"@babel/helpers - typeof";return Bu=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},Bu(e)}function Oee(e,t){if(e==null)return{};var r=Pee(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function vk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Lp(e){for(var t=1;t0?fn(E,"paddingAngle",0):0;if(C){var T=cn(C.endAngle-C.startAngle,E.endAngle-E.startAngle),R=Ct(Ct({},E),{},{startAngle:N+O,endAngle:N+T(y)+O});S.push(R),N=R.endAngle}else{var L=E.endAngle,q=E.startAngle,F=cn(0,L-q),B=F(y),V=Ct(Ct({},E),{},{startAngle:N+O,endAngle:N+B+O});S.push(V),N=V.endAngle}}),z.createElement(lt,null,n.renderSectorsStatically(S))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var u=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[u].focus(),a.setState({sectorToFocus:u});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!id(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,o=a.sectors,u=a.className,d=a.label,c=a.cx,h=a.cy,p=a.innerRadius,m=a.outerRadius,v=a.isAnimationActive,x=this.state.isAnimationFinished;if(i||!o||!o.length||!Ne(c)||!Ne(h)||!Ne(p)||!Ne(m))return null;var y=et("recharts-pie",u);return z.createElement(lt,{tabIndex:this.props.rootTabIndex,className:y,ref:function(j){n.pieRef=j}},this.renderSectors(),d&&this.renderLabels(o),pr.renderCallByParent(this.props,null,!1),(!v||x)&&ri.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n=360?N:N-1)*d,A=S-N*v-E,C=a.reduce(function(R,L){var q=or(L,j,0);return R+(Ne(q)?q:0)},0),O;if(C>0){var T;O=a.map(function(R,L){var q=or(R,j,0),F=or(R,h,L),B=(Ne(q)?q:0)/C,V;L?V=T.endAngle+Rr(y)*d*(q!==0?1:0):V=o;var G=V+Rr(y)*((q!==0?v:0)+B*A),W=(V+G)/2,H=(x.innerRadius+x.outerRadius)/2,U=[{name:F,value:q,payload:R,dataKey:j,type:m}],$=Ot(x.cx,x.cy,H,W);return T=Ct(Ct(Ct({percent:B,cornerRadius:i,name:F,tooltipPayload:U,midAngle:W,middleRadius:H,tooltipPosition:$},R),x),{},{value:or(R,j),startAngle:V,endAngle:G,payload:R,paddingAngle:Rr(y)*d}),T})}return Ct(Ct({},x),{},{sectors:O,data:a})});var r1,wk;function Yee(){if(wk)return r1;wk=1;var e=Math.ceil,t=Math.max;function r(n,a,i,o){for(var u=-1,d=t(e((a-n)/(i||1)),0),c=Array(d);d--;)c[o?d:++u]=n,n+=i;return c}return r1=r,r1}var n1,Sk;function N$(){if(Sk)return n1;Sk=1;var e=KD(),t=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*r}return a===a?a:0}return n1=n,n1}var a1,jk;function Jee(){if(jk)return a1;jk=1;var e=Yee(),t=jm(),r=N$();function n(a){return function(i,o,u){return u&&typeof u!="number"&&t(i,o,u)&&(o=u=void 0),i=r(i),o===void 0?(o=i,i=0):o=r(o),u=u===void 0?i0&&n.handleDrag(a.changedTouches[0])}),an(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,o=a.onDragEnd,u=a.startIndex;o?.({endIndex:i,startIndex:u})}),n.detachDragEndListener()}),an(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),an(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),an(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),an(n,"handleSlideDragStart",function(a){var i=Pk(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return cte(t,e),ite(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,o=this.state.scaleValues,u=this.props,d=u.gap,c=u.data,h=c.length-1,p=Math.min(a,i),m=Math.max(a,i),v=t.getIndexInRange(o,p),x=t.getIndexInRange(o,m);return{startIndex:v-v%d,endIndex:x===h?h:x-x%d}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,o=a.tickFormatter,u=a.dataKey,d=or(i[n],u,n);return He(o)?o(d,n):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,o=a.startX,u=a.endX,d=this.props,c=d.x,h=d.width,p=d.travellerWidth,m=d.startIndex,v=d.endIndex,x=d.onChange,y=n.pageX-i;y>0?y=Math.min(y,c+h-p-u,c+h-p-o):y<0&&(y=Math.max(y,c-o,c-u));var S=this.getIndex({startX:o+y,endX:u+y});(S.startIndex!==m||S.endIndex!==v)&&x&&x(S),this.setState({startX:o+y,endX:u+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=Pk(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,u=a.endX,d=a.startX,c=this.state[o],h=this.props,p=h.x,m=h.width,v=h.travellerWidth,x=h.onChange,y=h.gap,S=h.data,j={startX:this.state.startX,endX:this.state.endX},N=n.pageX-i;N>0?N=Math.min(N,p+m-v-c):N<0&&(N=Math.max(N,p-c)),j[o]=c+N;var E=this.getIndex(j),A=E.startIndex,C=E.endIndex,O=function(){var R=S.length-1;return o==="startX"&&(u>d?A%y===0:C%y===0)||ud?C%y===0:A%y===0)||u>d&&C===R};this.setState(an(an({},o,c+N),"brushMoveStartX",n.pageX),function(){x&&O()&&x(E)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,o=this.state,u=o.scaleValues,d=o.startX,c=o.endX,h=this.state[a],p=u.indexOf(h);if(p!==-1){var m=p+n;if(!(m===-1||m>=u.length)){var v=u[m];a==="startX"&&v>=c||a==="endX"&&v<=d||this.setState(an({},a,v),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,u=n.height,d=n.fill,c=n.stroke;return z.createElement("rect",{stroke:c,fill:d,x:a,y:i,width:o,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,u=n.height,d=n.data,c=n.children,h=n.padding,p=b.Children.only(c);return p?z.cloneElement(p,{x:a,y:i,width:o,height:u,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,o,u=this,d=this.props,c=d.y,h=d.travellerWidth,p=d.height,m=d.traveller,v=d.ariaLabel,x=d.data,y=d.startIndex,S=d.endIndex,j=Math.max(n,this.props.x),N=o1(o1({},ze(this.props,!1)),{},{x:j,y:c,width:h,height:p}),E=v||"Min value: ".concat((i=x[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=x[S])===null||o===void 0?void 0:o.name);return z.createElement(lt,{tabIndex:0,role:"slider","aria-label":E,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(C){["ArrowLeft","ArrowRight"].includes(C.key)&&(C.preventDefault(),C.stopPropagation(),u.handleTravellerMoveKeyboard(C.key==="ArrowRight"?1:-1,a))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,N))}},{key:"renderSlide",value:function(n,a){var i=this.props,o=i.y,u=i.height,d=i.stroke,c=i.travellerWidth,h=Math.min(n,a)+c,p=Math.max(Math.abs(a-n)-c,0);return z.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:h,y:o,width:p,height:u})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,o=n.y,u=n.height,d=n.travellerWidth,c=n.stroke,h=this.state,p=h.startX,m=h.endX,v=5,x={pointerEvents:"none",fill:c};return z.createElement(lt,{className:"recharts-brush-texts"},z.createElement(Lo,Fp({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,m)-v,y:o+u/2},x),this.getTextOfTick(a)),z.createElement(Lo,Fp({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,m)+d+v,y:o+u/2},x),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,o=n.children,u=n.x,d=n.y,c=n.width,h=n.height,p=n.alwaysShowText,m=this.state,v=m.startX,x=m.endX,y=m.isTextActive,S=m.isSlideMoving,j=m.isTravellerMoving,N=m.isTravellerFocused;if(!a||!a.length||!Ne(u)||!Ne(d)||!Ne(c)||!Ne(h)||c<=0||h<=0)return null;var E=et("recharts-brush",i),A=z.Children.count(o)===1,C=nte("userSelect","none");return z.createElement(lt,{className:E,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:C},this.renderBackground(),A&&this.renderPanorama(),this.renderSlide(v,x),this.renderTravellerLayer(v,"startX"),this.renderTravellerLayer(x,"endX"),(y||S||j||N||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,o=n.width,u=n.height,d=n.stroke,c=Math.floor(i+u/2)-1;return z.createElement(z.Fragment,null,z.createElement("rect",{x:a,y:i,width:o,height:u,fill:d,stroke:"none"}),z.createElement("line",{x1:a+1,y1:c,x2:a+o-1,y2:c,fill:"none",stroke:"#fff"}),z.createElement("line",{x1:a+1,y1:c+2,x2:a+o-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return z.isValidElement(n)?i=z.cloneElement(n,a):He(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,o=n.width,u=n.x,d=n.travellerWidth,c=n.updateId,h=n.startIndex,p=n.endIndex;if(i!==a.prevData||c!==a.prevUpdateId)return o1({prevData:i,prevTravellerWidth:d,prevUpdateId:c,prevX:u,prevWidth:o},i&&i.length?dte({data:i,width:o,x:u,travellerWidth:d,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||u!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([u,u+o-d]);var m=a.scale.domain().map(function(v){return a.scale(v)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:c,prevX:u,prevWidth:o,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,o=0,u=i-1;u-o>1;){var d=Math.floor((o+u)/2);n[d]>a?u=d:o=d}return a>=n[u]?u:o}}])})(b.PureComponent);an(xl,"displayName","Brush");an(xl,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var s1,Ak;function fte(){if(Ak)return s1;Ak=1;var e=dj();function t(r,n){var a;return e(r,function(i,o,u){return a=n(i,o,u),!a}),!!a}return s1=t,s1}var l1,Tk;function hte(){if(Tk)return l1;Tk=1;var e=ND(),t=Pa(),r=fte(),n=Xr(),a=jm();function i(o,u,d){var c=n(o)?e:r;return d&&a(o,u,d)&&(u=void 0),c(o,t(u,3))}return l1=i,l1}var pte=hte();const mte=dt(pte);var wa=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},c1,kk;function gte(){if(kk)return c1;kk=1;var e=UD();function t(r,n,a){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return c1=t,c1}var u1,Rk;function vte(){if(Rk)return u1;Rk=1;var e=gte(),t=zD(),r=Pa();function n(a,i){var o={};return i=r(i,3),t(a,function(u,d,c){e(o,d,i(u,d,c))}),o}return u1=n,u1}var yte=vte();const xte=dt(yte);var d1,Ik;function bte(){if(Ik)return d1;Ik=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ate(e,t){var r=e.x,n=e.y,a=Ote(e,_te),i="".concat(r),o=parseInt(i,10),u="".concat(n),d=parseInt(u,10),c="".concat(t.height||a.height),h=parseInt(c,10),p="".concat(t.width||a.width),m=parseInt(p,10);return Vc(Vc(Vc(Vc(Vc({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:m,name:t.name,radius:t.radius})}function $k(e){return z.createElement(S$,Yw({shapeType:"rectangle",propTransformer:Ate,activeClassName:"recharts-active-bar"},e))}var Tte=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=Ne(n)||JU(n);return i?t(n,a):(i||Bo(),r)}},kte=["value","background"],A$;function bl(e){"@babel/helpers - typeof";return bl=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},bl(e)}function Rte(e,t){if(e==null)return{};var r=Ite(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ite(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function qp(){return qp=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(W)0&&Math.abs(G)0&&(V=Math.min((ae||0)-(G[ie-1]||0),V))}),Number.isFinite(V)){var W=V/B,H=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(T=W*H/2),y.padding==="no-gap"){var U=Ir(t.barCategoryGap,W*H),$=W*H/2;T=$-U-($-U)/H*U}}}a==="xAxis"?R=[n.left+(E.left||0)+(T||0),n.left+n.width-(E.right||0)-(T||0)]:a==="yAxis"?R=d==="horizontal"?[n.top+n.height-(E.bottom||0),n.top+(E.top||0)]:[n.top+(E.top||0)+(T||0),n.top+n.height-(E.bottom||0)-(T||0)]:R=y.range,C&&(R=[R[1],R[0]]);var Z=e$(y,i,m),k=Z.scale,I=Z.realScaleType;k.domain(j).range(R),t$(k);var D=r$(k,Qn(Qn({},y),{},{realScaleType:I}));a==="xAxis"?(F=S==="top"&&!A||S==="bottom"&&A,L=n.left,q=p[O]-F*y.height):a==="yAxis"&&(F=S==="left"&&!A||S==="right"&&A,L=p[O]-F*y.width,q=n.top);var J=Qn(Qn(Qn({},y),D),{},{realScaleType:I,x:L,y:q,scale:k,width:a==="xAxis"?n.width:y.width,height:a==="yAxis"?n.height:y.height});return J.bandSize=Np(J,D),!y.hide&&a==="xAxis"?p[O]+=(F?-1:1)*J.height:y.hide||(p[O]+=(F?-1:1)*J.width),Qn(Qn({},v),{},Um({},x,J))},{})},M$=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(a,o),width:Math.abs(i-n),height:Math.abs(o-a)}},Hte=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return M$({x:r,y:n},{x:a,y:i})},D$=(function(){function e(t){qte(this,e),this.scale=t}return Ute(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(a){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+d}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])})();Um(D$,"EPS",1e-4);var Fj=function(t){var r=Object.keys(t).reduce(function(n,a){return Qn(Qn({},n),{},Um({},a,D$.create(t[a])))},{});return Qn(Qn({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,u=i.position;return xte(a,function(d,c){return r[c].apply(d,{bandAware:o,position:u})})},isInRange:function(a){return P$(a,function(i,o){return r[o].isInRange(i)})}})};function Wte(e){return(e%180+180)%180}var Gte=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Wte(a),o=i*Math.PI/180,u=Math.atan(n/r),d=o>u&&o-1?d[c?i[h]:h]:void 0}}return p1=n,p1}var m1,Vk;function Xte(){if(Vk)return m1;Vk=1;var e=N$();function t(r){var n=e(r),a=n%1;return n===n?a?n-a:n:0}return m1=t,m1}var g1,Hk;function Yte(){if(Hk)return g1;Hk=1;var e=DD(),t=Pa(),r=Xte(),n=Math.max;function a(i,o,u){var d=i==null?0:i.length;if(!d)return-1;var c=u==null?0:r(u);return c<0&&(c=n(d+c,0)),e(i,t(o,3),c)}return g1=a,g1}var v1,Wk;function Jte(){if(Wk)return v1;Wk=1;var e=Kte(),t=Yte(),r=e(t);return v1=r,v1}var Qte=Jte();const Zte=dt(Qte);var ere=QM();const tre=dt(ere);var rre=tre(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),zj=b.createContext(void 0),qj=b.createContext(void 0),L$=b.createContext(void 0),$$=b.createContext({}),B$=b.createContext(void 0),F$=b.createContext(0),z$=b.createContext(0),Gk=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,o=t.clipPathId,u=t.children,d=t.width,c=t.height,h=rre(i);return z.createElement(zj.Provider,{value:n},z.createElement(qj.Provider,{value:a},z.createElement($$.Provider,{value:i},z.createElement(L$.Provider,{value:h},z.createElement(B$.Provider,{value:o},z.createElement(F$.Provider,{value:c},z.createElement(z$.Provider,{value:d},u)))))))},nre=function(){return b.useContext(B$)},q$=function(t){var r=b.useContext(zj);r==null&&Bo();var n=r[t];return n==null&&Bo(),n},are=function(){var t=b.useContext(zj);return Fi(t)},ire=function(){var t=b.useContext(qj),r=Zte(t,function(n){return P$(n.domain,Number.isFinite)});return r||Fi(t)},U$=function(t){var r=b.useContext(qj);r==null&&Bo();var n=r[t];return n==null&&Bo(),n},ore=function(){var t=b.useContext(L$);return t},sre=function(){return b.useContext($$)},Uj=function(){return b.useContext(z$)},Vj=function(){return b.useContext(F$)};function wl(e){"@babel/helpers - typeof";return wl=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},wl(e)}function lre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cre(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function Vre(e,t){return Y$(e,t+1)}function Hre(e,t,r,n,a){for(var i=(n||[]).slice(),o=t.start,u=t.end,d=0,c=1,h=o,p=function(){var x=n?.[d];if(x===void 0)return{v:Y$(n,c)};var y=d,S,j=function(){return S===void 0&&(S=r(x,y)),S},N=x.coordinate,E=d===0||Gp(e,N,j,h,u);E||(d=0,h=o,c+=1),E&&(h=N+e*(j()/2+a),d+=c)},m;c<=i.length;)if(m=p(),m)return m.v;return[]}function Vu(e){"@babel/helpers - typeof";return Vu=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},Vu(e)}function tR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Cr(e){for(var t=1;t0?v.coordinate-S*e:v.coordinate})}else i[m]=v=Cr(Cr({},v),{},{tickCoord:v.coordinate});var j=Gp(e,v.tickCoord,y,u,d);j&&(d=v.tickCoord-e*(y()/2+a),i[m]=Cr(Cr({},v),{},{isShow:!0}))},h=o-1;h>=0;h--)c(h);return i}function Yre(e,t,r,n,a,i){var o=(n||[]).slice(),u=o.length,d=t.start,c=t.end;if(i){var h=n[u-1],p=r(h,u-1),m=e*(h.coordinate+e*p/2-c);o[u-1]=h=Cr(Cr({},h),{},{tickCoord:m>0?h.coordinate-m*e:h.coordinate});var v=Gp(e,h.tickCoord,function(){return p},d,c);v&&(c=h.tickCoord-e*(p/2+a),o[u-1]=Cr(Cr({},h),{},{isShow:!0}))}for(var x=i?u-1:u,y=function(N){var E=o[N],A,C=function(){return A===void 0&&(A=r(E,N)),A};if(N===0){var O=e*(E.coordinate-e*C()/2-d);o[N]=E=Cr(Cr({},E),{},{tickCoord:O<0?E.coordinate-O*e:E.coordinate})}else o[N]=E=Cr(Cr({},E),{},{tickCoord:E.coordinate});var T=Gp(e,E.tickCoord,C,d,c);T&&(d=E.tickCoord+e*(C()/2+a),o[N]=Cr(Cr({},E),{},{isShow:!0}))},S=0;S=2?Rr(a[1].coordinate-a[0].coordinate):1,j=Ure(i,S,v);return d==="equidistantPreserveStart"?Hre(S,j,y,a,o):(d==="preserveStart"||d==="preserveStartEnd"?m=Yre(S,j,y,a,o,d==="preserveStartEnd"):m=Xre(S,j,y,a,o),m.filter(function(N){return N.isShow}))}var Jre=["viewBox"],Qre=["viewBox"],Zre=["ticks"];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 Hs(){return Hs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ene(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function tne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nR(e,t){for(var r=0;r0?d(this.props):d(v)),o<=0||u<=0||!x||!x.length?null:z.createElement(lt,{className:et("recharts-cartesian-axis",c),ref:function(S){n.layerReference=S}},i&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),pr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var o,u=et(a.className,"recharts-cartesian-axis-tick-value");return z.isValidElement(n)?o=z.cloneElement(n,ar(ar({},a),{},{className:u})):He(n)?o=n(ar(ar({},a),{},{className:u})):o=z.createElement(Lo,Hs({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(b.Component);Kj(Vl,"displayName","CartesianAxis");Kj(Vl,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var lne=["x1","y1","x2","y2","key"],cne=["offset"];function Fo(e){"@babel/helpers - typeof";return Fo=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},Fo(e)}function aR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Er(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var pne=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,o=t.width,u=t.height,d=t.ry;return z.createElement("rect",{x:a,y:i,ry:d,width:o,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Z$(e,t){var r;if(z.isValidElement(e))r=z.cloneElement(e,t);else if(He(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,o=t.y2,u=t.key,d=iR(t,lne),c=ze(d,!1);c.offset;var h=iR(c,cne);r=z.createElement("line",To({},h,{x1:n,y1:a,x2:i,y2:o,fill:"none",key:u}))}return r}function mne(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(u,d){var c=Er(Er({},e),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return Z$(a,c)});return z.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function gne(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(u,d){var c=Er(Er({},e),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return Z$(a,c)});return z.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function vne(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,o=e.height,u=e.horizontalPoints,d=e.horizontal,c=d===void 0?!0:d;if(!c||!t||!t.length)return null;var h=u.map(function(m){return Math.round(m+a-a)}).sort(function(m,v){return m-v});a!==h[0]&&h.unshift(0);var p=h.map(function(m,v){var x=!h[v+1],y=x?a+o-m:h[v+1]-m;if(y<=0)return null;var S=v%t.length;return z.createElement("rect",{key:"react-".concat(v),y:m,x:n,height:y,width:i,stroke:"none",fill:t[S],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return z.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function yne(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,o=e.y,u=e.width,d=e.height,c=e.verticalPoints;if(!r||!n||!n.length)return null;var h=c.map(function(m){return Math.round(m+i-i)}).sort(function(m,v){return m-v});i!==h[0]&&h.unshift(0);var p=h.map(function(m,v){var x=!h[v+1],y=x?i+u-m:h[v+1]-m;if(y<=0)return null;var S=v%n.length;return z.createElement("rect",{key:"react-".concat(v),x:m,y:o,width:y,height:d,stroke:"none",fill:n[S],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return z.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var xne=function(t,r){var n=t.xAxis,a=t.width,i=t.height,o=t.offset;return ZL(Gj(Er(Er(Er({},Vl.defaultProps),n),{},{ticks:Za(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,r)},bne=function(t,r){var n=t.yAxis,a=t.width,i=t.height,o=t.offset;return ZL(Gj(Er(Er(Er({},Vl.defaultProps),n),{},{ticks:Za(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,r)},As={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Xp(e){var t,r,n,a,i,o,u=Uj(),d=Vj(),c=sre(),h=Er(Er({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:As.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:As.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:As.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:As.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:As.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:As.verticalFill,x:Ne(e.x)?e.x:c.left,y:Ne(e.y)?e.y:c.top,width:Ne(e.width)?e.width:c.width,height:Ne(e.height)?e.height:c.height}),p=h.x,m=h.y,v=h.width,x=h.height,y=h.syncWithTicks,S=h.horizontalValues,j=h.verticalValues,N=are(),E=ire();if(!Ne(v)||v<=0||!Ne(x)||x<=0||!Ne(p)||p!==+p||!Ne(m)||m!==+m)return null;var A=h.verticalCoordinatesGenerator||xne,C=h.horizontalCoordinatesGenerator||bne,O=h.horizontalPoints,T=h.verticalPoints;if((!O||!O.length)&&He(C)){var R=S&&S.length,L=C({yAxis:E?Er(Er({},E),{},{ticks:R?S:E.ticks}):void 0,width:u,height:d,offset:c},R?!0:y);na(Array.isArray(L),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Fo(L),"]")),Array.isArray(L)&&(O=L)}if((!T||!T.length)&&He(A)){var q=j&&j.length,F=A({xAxis:N?Er(Er({},N),{},{ticks:q?j:N.ticks}):void 0,width:u,height:d,offset:c},q?!0:y);na(Array.isArray(F),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Fo(F),"]")),Array.isArray(F)&&(T=F)}return z.createElement("g",{className:"recharts-cartesian-grid"},z.createElement(pne,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),z.createElement(mne,To({},h,{offset:c,horizontalPoints:O,xAxis:N,yAxis:E})),z.createElement(gne,To({},h,{offset:c,verticalPoints:T,xAxis:N,yAxis:E})),z.createElement(vne,To({},h,{horizontalPoints:O})),z.createElement(yne,To({},h,{verticalPoints:T})))}Xp.displayName="CartesianGrid";var wne=["type","layout","connectNulls","ref"],Sne=["key"];function Nl(e){"@babel/helpers - typeof";return Nl=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},Nl(e)}function oR(e,t){if(e==null)return{};var r=jne(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function lu(){return lu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rp){v=[].concat(Ts(d.slice(0,x)),[p-y]);break}var S=v.length%2===0?[0,m]:[m];return[].concat(Ts(t.repeat(d,h)),Ts(v),S).map(function(j){return"".concat(j,"px")}).join(", ")}),Zn(r,"id",Bl("recharts-line-")),Zn(r,"pathRef",function(o){r.mainCurve=o}),Zn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Zn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Rne(t,e),Pne(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,u=i.xAxis,d=i.yAxis,c=i.layout,h=i.children,p=hn(h,od);if(!p)return null;var m=function(y,S){return{x:y.x,y:y.y,value:y.value,errorVal:or(y.payload,S)}},v={clipPath:n?"url(#clipPath-".concat(a,")"):null};return z.createElement(lt,v,p.map(function(x){return z.cloneElement(x,{key:"bar-".concat(x.props.dataKey),data:o,xAxis:u,yAxis:d,layout:c,dataPointFormatter:m})}))}},{key:"renderDots",value:function(n,a,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var u=this.props,d=u.dot,c=u.points,h=u.dataKey,p=ze(this.props,!1),m=ze(d,!0),v=c.map(function(y,S){var j=nn(nn(nn({key:"dot-".concat(S),r:3},p),m),{},{index:S,cx:y.x,cy:y.y,value:y.value,dataKey:h,payload:y.payload,points:c});return t.renderDotItem(d,j)}),x={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return z.createElement(lt,lu({className:"recharts-line-dots",key:"dots"},x),v)}},{key:"renderCurveStatically",value:function(n,a,i,o){var u=this.props,d=u.type,c=u.layout,h=u.connectNulls;u.ref;var p=oR(u,wne),m=nn(nn(nn({},ze(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:n},o),{},{type:d,layout:c,connectNulls:h});return z.createElement(Op,lu({},m,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,a){var i=this,o=this.props,u=o.points,d=o.strokeDasharray,c=o.isAnimationActive,h=o.animationBegin,p=o.animationDuration,m=o.animationEasing,v=o.animationId,x=o.animateNewValues,y=o.width,S=o.height,j=this.state,N=j.prevPoints,E=j.totalLength;return z.createElement(_a,{begin:h,duration:p,isActive:c,easing:m,from:{t:0},to:{t:1},key:"line-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(A){var C=A.t;if(N){var O=N.length/u.length,T=u.map(function(B,V){var G=Math.floor(V*O);if(N[G]){var W=N[G],H=cn(W.x,B.x),U=cn(W.y,B.y);return nn(nn({},B),{},{x:H(C),y:U(C)})}if(x){var $=cn(y*2,B.x),Z=cn(S/2,B.y);return nn(nn({},B),{},{x:$(C),y:Z(C)})}return nn(nn({},B),{},{x:B.x,y:B.y})});return i.renderCurveStatically(T,n,a)}var R=cn(0,E),L=R(C),q;if(d){var F="".concat(d).split(/[,\s]+/gim).map(function(B){return parseFloat(B)});q=i.getStrokeDasharray(L,E,F)}else q=i.generateSimpleStrokeDasharray(E,L);return i.renderCurveStatically(u,n,a,{strokeDasharray:q})})}},{key:"renderCurve",value:function(n,a){var i=this.props,o=i.points,u=i.isAnimationActive,d=this.state,c=d.prevPoints,h=d.totalLength;return u&&o&&o.length&&(!c&&h>0||!id(c,o))?this.renderCurveWithAnimation(n,a):this.renderCurveStatically(o,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,u=a.points,d=a.className,c=a.xAxis,h=a.yAxis,p=a.top,m=a.left,v=a.width,x=a.height,y=a.isAnimationActive,S=a.id;if(i||!u||!u.length)return null;var j=this.state.isAnimationFinished,N=u.length===1,E=et("recharts-line",d),A=c&&c.allowDataOverflow,C=h&&h.allowDataOverflow,O=A||C,T=Ze(S)?this.id:S,R=(n=ze(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},L=R.r,q=L===void 0?3:L,F=R.strokeWidth,B=F===void 0?2:F,V=c9(o)?o:{},G=V.clipDot,W=G===void 0?!0:G,H=q*2+B;return z.createElement(lt,{className:E},A||C?z.createElement("defs",null,z.createElement("clipPath",{id:"clipPath-".concat(T)},z.createElement("rect",{x:A?m:m-v/2,y:C?p:p-x/2,width:A?v:v*2,height:C?x:x*2})),!W&&z.createElement("clipPath",{id:"clipPath-dots-".concat(T)},z.createElement("rect",{x:m-H/2,y:p-H/2,width:v+H,height:x+H}))):null,!N&&this.renderCurve(O,T),this.renderErrorBar(O,T),(N||o)&&this.renderDots(O,W,T),(!y||j)&&ri.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:a.curPoints}:n.points!==a.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,a){for(var i=n.length%2!==0?[].concat(Ts(n),[0]):n,o=[],u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function _ae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nae(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&Ne(a)&&Ne(i)?t.slice(a,i+1):[]};function p4(e){return e==="number"?[0,"auto"]:void 0}var mS=function(t,r,n,a){var i=t.graphicalItems,o=t.tooltipAxis,u=Km(r,t);return n<0||!i||!i.length||n>=u.length?null:i.reduce(function(d,c){var h,p=(h=c.props.data)!==null&&h!==void 0?h:r;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(o.dataKey&&!o.allowDuplicatedCategory){var v=p===void 0?u:p;m=Qh(v,o.dataKey,a)}else m=p&&p[n]||u[n];return m?[].concat(Pl(d),[a$(c,m)]):d},[])},mR=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},o=Lae(i,n),u=t.orderedTooltipTicks,d=t.tooltipAxis,c=t.tooltipTicks,h=oY(o,u,c,d);if(h>=0&&c){var p=c[h]&&c[h].value,m=mS(t,r,h,p),v=$ae(n,u,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:m,activeCoordinate:v}}return null},Bae=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,o=r.axisIdKey,u=r.stackGroups,d=r.dataStartIndex,c=r.dataEndIndex,h=t.layout,p=t.children,m=t.stackOffset,v=QL(h,i);return n.reduce(function(x,y){var S,j=y.type.defaultProps!==void 0?he(he({},y.type.defaultProps),y.props):y.props,N=j.type,E=j.dataKey,A=j.allowDataOverflow,C=j.allowDuplicatedCategory,O=j.scale,T=j.ticks,R=j.includeHidden,L=j[o];if(x[L])return x;var q=Km(t.data,{graphicalItems:a.filter(function(D){var J,ae=o in D.props?D.props[o]:(J=D.type.defaultProps)===null||J===void 0?void 0:J[o];return ae===L}),dataStartIndex:d,dataEndIndex:c}),F=q.length,B,V,G;dae(j.domain,A,N)&&(B=Pw(j.domain,null,A),v&&(N==="number"||O!=="auto")&&(G=au(q,E,"category")));var W=p4(N);if(!B||B.length===0){var H,U=(H=j.domain)!==null&&H!==void 0?H:W;if(E){if(B=au(q,E,N),N==="category"&&v){var $=ZU(B);C&&$?(V=B,B=Bp(0,F)):C||(B=vT(U,B,y).reduce(function(D,J){return D.indexOf(J)>=0?D:[].concat(Pl(D),[J])},[]))}else if(N==="category")C?B=B.filter(function(D){return D!==""&&!Ze(D)}):B=vT(U,B,y).reduce(function(D,J){return D.indexOf(J)>=0||J===""||Ze(J)?D:[].concat(Pl(D),[J])},[]);else if(N==="number"){var Z=dY(q,a.filter(function(D){var J,ae,ie=o in D.props?D.props[o]:(J=D.type.defaultProps)===null||J===void 0?void 0:J[o],ne="hide"in D.props?D.props.hide:(ae=D.type.defaultProps)===null||ae===void 0?void 0:ae.hide;return ie===L&&(R||!ne)}),E,i,h);Z&&(B=Z)}v&&(N==="number"||O!=="auto")&&(G=au(q,E,"category"))}else v?B=Bp(0,F):u&&u[L]&&u[L].hasStack&&N==="number"?B=m==="expand"?[0,1]:n$(u[L].stackGroups,d,c):B=JL(q,a.filter(function(D){var J=o in D.props?D.props[o]:D.type.defaultProps[o],ae="hide"in D.props?D.props.hide:D.type.defaultProps.hide;return J===L&&(R||!ae)}),N,h,!0);if(N==="number")B=fS(p,B,L,i,T),U&&(B=Pw(U,B,A));else if(N==="category"&&U){var k=U,I=B.every(function(D){return k.indexOf(D)>=0});I&&(B=k)}}return he(he({},x),{},Ue({},L,he(he({},j),{},{axisType:i,domain:B,categoricalDomain:G,duplicateDomain:V,originalDomain:(S=j.domain)!==null&&S!==void 0?S:W,isCategorical:v,layout:h})))},{})},Fae=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,o=r.axisIdKey,u=r.stackGroups,d=r.dataStartIndex,c=r.dataEndIndex,h=t.layout,p=t.children,m=Km(t.data,{graphicalItems:n,dataStartIndex:d,dataEndIndex:c}),v=m.length,x=QL(h,i),y=-1;return n.reduce(function(S,j){var N=j.type.defaultProps!==void 0?he(he({},j.type.defaultProps),j.props):j.props,E=N[o],A=p4("number");if(!S[E]){y++;var C;return x?C=Bp(0,v):u&&u[E]&&u[E].hasStack?(C=n$(u[E].stackGroups,d,c),C=fS(p,C,E,i)):(C=Pw(A,JL(m,n.filter(function(O){var T,R,L=o in O.props?O.props[o]:(T=O.type.defaultProps)===null||T===void 0?void 0:T[o],q="hide"in O.props?O.props.hide:(R=O.type.defaultProps)===null||R===void 0?void 0:R.hide;return L===E&&!q}),"number",h),a.defaultProps.allowDataOverflow),C=fS(p,C,E,i)),he(he({},S),{},Ue({},E,he(he({axisType:i},a.defaultProps),{},{hide:!0,orientation:fn(Mae,"".concat(i,".").concat(y%2),null),domain:C,originalDomain:A,isCategorical:x,layout:h})))}return S},{})},zae=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,u=r.stackGroups,d=r.dataStartIndex,c=r.dataEndIndex,h=t.children,p="".concat(a,"Id"),m=hn(h,i),v={};return m&&m.length?v=Bae(t,{axes:m,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:c}):o&&o.length&&(v=Fae(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:c})),v},qae=function(t){var r=Fi(t),n=Za(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:fj(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Np(r,n)}},gR=function(t){var r=t.children,n=t.defaultShowTooltip,a=on(r,xl),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},Uae=function(t){return!t||!t.length?!1:t.some(function(r){var n=ei(r&&r.type);return n&&n.indexOf("Bar")>=0})},vR=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Vae=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,u=t.yAxisMap,d=u===void 0?{}:u,c=n.width,h=n.height,p=n.children,m=n.margin||{},v=on(p,xl),x=on(p,Xs),y=Object.keys(d).reduce(function(C,O){var T=d[O],R=T.orientation;return!T.mirror&&!T.hide?he(he({},C),{},Ue({},R,C[R]+T.width)):C},{left:m.left||0,right:m.right||0}),S=Object.keys(o).reduce(function(C,O){var T=o[O],R=T.orientation;return!T.mirror&&!T.hide?he(he({},C),{},Ue({},R,fn(C,"".concat(R))+T.height)):C},{top:m.top||0,bottom:m.bottom||0}),j=he(he({},S),y),N=j.bottom;v&&(j.bottom+=v.props.height||xl.defaultProps.height),x&&r&&(j=cY(j,a,n,r));var E=c-j.left-j.right,A=h-j.top-j.bottom;return he(he({brushBottom:N},j),{},{width:Math.max(E,0),height:Math.max(A,0)})},Hae=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},Xj=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,u=o===void 0?["axis"]:o,d=t.axisComponents,c=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,m=function(j,N){var E=N.graphicalItems,A=N.stackGroups,C=N.offset,O=N.updateId,T=N.dataStartIndex,R=N.dataEndIndex,L=j.barSize,q=j.layout,F=j.barGap,B=j.barCategoryGap,V=j.maxBarSize,G=vR(q),W=G.numericAxisName,H=G.cateAxisName,U=Uae(E),$=[];return E.forEach(function(Z,k){var I=Km(j.data,{graphicalItems:[Z],dataStartIndex:T,dataEndIndex:R}),D=Z.type.defaultProps!==void 0?he(he({},Z.type.defaultProps),Z.props):Z.props,J=D.dataKey,ae=D.maxBarSize,ie=D["".concat(W,"Id")],ne=D["".concat(H,"Id")],X={},Y=d.reduce(function(At,St){var br=N["".concat(St.axisType,"Map")],Ia=D["".concat(St.axisType,"Id")];br&&br[Ia]||St.axisType==="zAxis"||Bo();var la=br[Ia];return he(he({},At),{},Ue(Ue({},St.axisType,la),"".concat(St.axisType,"Ticks"),Za(la)))},X),ee=Y[H],le=Y["".concat(H,"Ticks")],pe=A&&A[ie]&&A[ie].hasStack&&bY(Z,A[ie].stackGroups),K=ei(Z.type).indexOf("Bar")>=0,je=Np(ee,le),Ce=[],Le=U&&sY({barSize:L,stackGroups:A,totalSize:Hae(Y,H)});if(K){var De,tt,_t=Ze(ae)?V:ae,ft=(De=(tt=Np(ee,le,!0))!==null&&tt!==void 0?tt:_t)!==null&&De!==void 0?De:0;Ce=lY({barGap:F,barCategoryGap:B,bandSize:ft!==je?ft:je,sizeList:Le[ne],maxBarSize:_t}),ft!==je&&(Ce=Ce.map(function(At){return he(he({},At),{},{position:he(he({},At.position),{},{offset:At.position.offset-ft/2})})}))}var Zt=Z&&Z.type&&Z.type.getComposedData;Zt&&$.push({props:he(he({},Zt(he(he({},Y),{},{displayedData:I,props:j,dataKey:J,item:Z,bandSize:je,barPosition:Ce,offset:C,stackedData:pe,layout:q,dataStartIndex:T,dataEndIndex:R}))),{},Ue(Ue(Ue({key:Z.key||"item-".concat(k)},W,Y[W]),H,Y[H]),"animationId",O)),childIndex:f9(Z,j.children),item:Z})}),$},v=function(j,N){var E=j.props,A=j.dataStartIndex,C=j.dataEndIndex,O=j.updateId;if(!TO({props:E}))return null;var T=E.children,R=E.layout,L=E.stackOffset,q=E.data,F=E.reverseStackOrder,B=vR(R),V=B.numericAxisName,G=B.cateAxisName,W=hn(T,n),H=yY(q,W,"".concat(V,"Id"),"".concat(G,"Id"),L,F),U=d.reduce(function(D,J){var ae="".concat(J.axisType,"Map");return he(he({},D),{},Ue({},ae,zae(E,he(he({},J),{},{graphicalItems:W,stackGroups:J.axisType===V&&H,dataStartIndex:A,dataEndIndex:C}))))},{}),$=Vae(he(he({},U),{},{props:E,graphicalItems:W}),N?.legendBBox);Object.keys(U).forEach(function(D){U[D]=h(E,U[D],$,D.replace("Map",""),r)});var Z=U["".concat(G,"Map")],k=qae(Z),I=m(E,he(he({},U),{},{dataStartIndex:A,dataEndIndex:C,updateId:O,graphicalItems:W,stackGroups:H,offset:$}));return he(he({formattedGraphicalItems:I,graphicalItems:W,offset:$,stackGroups:H},k),U)},x=(function(S){function j(N){var E,A,C;return _ae(this,j),C=Eae(this,j,[N]),Ue(C,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ue(C,"accessibilityManager",new uae),Ue(C,"handleLegendBBoxUpdate",function(O){if(O){var T=C.state,R=T.dataStartIndex,L=T.dataEndIndex,q=T.updateId;C.setState(he({legendBBox:O},v({props:C.props,dataStartIndex:R,dataEndIndex:L,updateId:q},he(he({},C.state),{},{legendBBox:O}))))}}),Ue(C,"handleReceiveSyncEvent",function(O,T,R){if(C.props.syncId===O){if(R===C.eventEmitterSymbol&&typeof C.props.syncMethod!="function")return;C.applySyncEvent(T)}}),Ue(C,"handleBrushChange",function(O){var T=O.startIndex,R=O.endIndex;if(T!==C.state.dataStartIndex||R!==C.state.dataEndIndex){var L=C.state.updateId;C.setState(function(){return he({dataStartIndex:T,dataEndIndex:R},v({props:C.props,dataStartIndex:T,dataEndIndex:R,updateId:L},C.state))}),C.triggerSyncEvent({dataStartIndex:T,dataEndIndex:R})}}),Ue(C,"handleMouseEnter",function(O){var T=C.getMouseInfo(O);if(T){var R=he(he({},T),{},{isTooltipActive:!0});C.setState(R),C.triggerSyncEvent(R);var L=C.props.onMouseEnter;He(L)&&L(R,O)}}),Ue(C,"triggeredAfterMouseMove",function(O){var T=C.getMouseInfo(O),R=T?he(he({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};C.setState(R),C.triggerSyncEvent(R);var L=C.props.onMouseMove;He(L)&&L(R,O)}),Ue(C,"handleItemMouseEnter",function(O){C.setState(function(){return{isTooltipActive:!0,activeItem:O,activePayload:O.tooltipPayload,activeCoordinate:O.tooltipPosition||{x:O.cx,y:O.cy}}})}),Ue(C,"handleItemMouseLeave",function(){C.setState(function(){return{isTooltipActive:!1}})}),Ue(C,"handleMouseMove",function(O){O.persist(),C.throttleTriggeredAfterMouseMove(O)}),Ue(C,"handleMouseLeave",function(O){C.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};C.setState(T),C.triggerSyncEvent(T);var R=C.props.onMouseLeave;He(R)&&R(T,O)}),Ue(C,"handleOuterEvent",function(O){var T=d9(O),R=fn(C.props,"".concat(T));if(T&&He(R)){var L,q;/.*touch.*/i.test(T)?q=C.getMouseInfo(O.changedTouches[0]):q=C.getMouseInfo(O),R((L=q)!==null&&L!==void 0?L:{},O)}}),Ue(C,"handleClick",function(O){var T=C.getMouseInfo(O);if(T){var R=he(he({},T),{},{isTooltipActive:!0});C.setState(R),C.triggerSyncEvent(R);var L=C.props.onClick;He(L)&&L(R,O)}}),Ue(C,"handleMouseDown",function(O){var T=C.props.onMouseDown;if(He(T)){var R=C.getMouseInfo(O);T(R,O)}}),Ue(C,"handleMouseUp",function(O){var T=C.props.onMouseUp;if(He(T)){var R=C.getMouseInfo(O);T(R,O)}}),Ue(C,"handleTouchMove",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&C.throttleTriggeredAfterMouseMove(O.changedTouches[0])}),Ue(C,"handleTouchStart",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&C.handleMouseDown(O.changedTouches[0])}),Ue(C,"handleTouchEnd",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&C.handleMouseUp(O.changedTouches[0])}),Ue(C,"handleDoubleClick",function(O){var T=C.props.onDoubleClick;if(He(T)){var R=C.getMouseInfo(O);T(R,O)}}),Ue(C,"handleContextMenu",function(O){var T=C.props.onContextMenu;if(He(T)){var R=C.getMouseInfo(O);T(R,O)}}),Ue(C,"triggerSyncEvent",function(O){C.props.syncId!==void 0&&b1.emit(w1,C.props.syncId,O,C.eventEmitterSymbol)}),Ue(C,"applySyncEvent",function(O){var T=C.props,R=T.layout,L=T.syncMethod,q=C.state.updateId,F=O.dataStartIndex,B=O.dataEndIndex;if(O.dataStartIndex!==void 0||O.dataEndIndex!==void 0)C.setState(he({dataStartIndex:F,dataEndIndex:B},v({props:C.props,dataStartIndex:F,dataEndIndex:B,updateId:q},C.state)));else if(O.activeTooltipIndex!==void 0){var V=O.chartX,G=O.chartY,W=O.activeTooltipIndex,H=C.state,U=H.offset,$=H.tooltipTicks;if(!U)return;if(typeof L=="function")W=L($,O);else if(L==="value"){W=-1;for(var Z=0;Z<$.length;Z++)if($[Z].value===O.activeLabel){W=Z;break}}var k=he(he({},U),{},{x:U.left,y:U.top}),I=Math.min(V,k.x+k.width),D=Math.min(G,k.y+k.height),J=$[W]&&$[W].value,ae=mS(C.state,C.props.data,W),ie=$[W]?{x:R==="horizontal"?$[W].coordinate:I,y:R==="horizontal"?D:$[W].coordinate}:h4;C.setState(he(he({},O),{},{activeLabel:J,activeCoordinate:ie,activePayload:ae,activeTooltipIndex:W}))}else C.setState(O)}),Ue(C,"renderCursor",function(O){var T,R=C.state,L=R.isTooltipActive,q=R.activeCoordinate,F=R.activePayload,B=R.offset,V=R.activeTooltipIndex,G=R.tooltipAxisBandSize,W=C.getTooltipEventType(),H=(T=O.props.active)!==null&&T!==void 0?T:L,U=C.props.layout,$=O.key||"_recharts-cursor";return z.createElement(vae,{key:$,activeCoordinate:q,activePayload:F,activeTooltipIndex:V,chartName:r,element:O,isActive:H,layout:U,offset:B,tooltipAxisBandSize:G,tooltipEventType:W})}),Ue(C,"renderPolarAxis",function(O,T,R){var L=fn(O,"type.axisType"),q=fn(C.state,"".concat(L,"Map")),F=O.type.defaultProps,B=F!==void 0?he(he({},F),O.props):O.props,V=q&&q[B["".concat(L,"Id")]];return b.cloneElement(O,he(he({},V),{},{className:et(L,V.className),key:O.key||"".concat(T,"-").concat(R),ticks:Za(V,!0)}))}),Ue(C,"renderPolarGrid",function(O){var T=O.props,R=T.radialLines,L=T.polarAngles,q=T.polarRadius,F=C.state,B=F.radiusAxisMap,V=F.angleAxisMap,G=Fi(B),W=Fi(V),H=W.cx,U=W.cy,$=W.innerRadius,Z=W.outerRadius;return b.cloneElement(O,{polarAngles:Array.isArray(L)?L:Za(W,!0).map(function(k){return k.coordinate}),polarRadius:Array.isArray(q)?q:Za(G,!0).map(function(k){return k.coordinate}),cx:H,cy:U,innerRadius:$,outerRadius:Z,key:O.key||"polar-grid",radialLines:R})}),Ue(C,"renderLegend",function(){var O=C.state.formattedGraphicalItems,T=C.props,R=T.children,L=T.width,q=T.height,F=C.props.margin||{},B=L-(F.left||0)-(F.right||0),V=XL({children:R,formattedGraphicalItems:O,legendWidth:B,legendContent:c});if(!V)return null;var G=V.item,W=hR(V,yae);return b.cloneElement(G,he(he({},W),{},{chartWidth:L,chartHeight:q,margin:F,onBBoxUpdate:C.handleLegendBBoxUpdate}))}),Ue(C,"renderTooltip",function(){var O,T=C.props,R=T.children,L=T.accessibilityLayer,q=on(R,ln);if(!q)return null;var F=C.state,B=F.isTooltipActive,V=F.activeCoordinate,G=F.activePayload,W=F.activeLabel,H=F.offset,U=(O=q.props.active)!==null&&O!==void 0?O:B;return b.cloneElement(q,{viewBox:he(he({},H),{},{x:H.left,y:H.top}),active:U,label:W,payload:U?G:[],coordinate:V,accessibilityLayer:L})}),Ue(C,"renderBrush",function(O){var T=C.props,R=T.margin,L=T.data,q=C.state,F=q.offset,B=q.dataStartIndex,V=q.dataEndIndex,G=q.updateId;return b.cloneElement(O,{key:O.key||"_recharts-brush",onChange:Wf(C.handleBrushChange,O.props.onChange),data:L,x:Ne(O.props.x)?O.props.x:F.left,y:Ne(O.props.y)?O.props.y:F.top+F.height+F.brushBottom-(R.bottom||0),width:Ne(O.props.width)?O.props.width:F.width,startIndex:B,endIndex:V,updateId:"brush-".concat(G)})}),Ue(C,"renderReferenceElement",function(O,T,R){if(!O)return null;var L=C,q=L.clipPathId,F=C.state,B=F.xAxisMap,V=F.yAxisMap,G=F.offset,W=O.type.defaultProps||{},H=O.props,U=H.xAxisId,$=U===void 0?W.xAxisId:U,Z=H.yAxisId,k=Z===void 0?W.yAxisId:Z;return b.cloneElement(O,{key:O.key||"".concat(T,"-").concat(R),xAxis:B[$],yAxis:V[k],viewBox:{x:G.left,y:G.top,width:G.width,height:G.height},clipPathId:q})}),Ue(C,"renderActivePoints",function(O){var T=O.item,R=O.activePoint,L=O.basePoint,q=O.childIndex,F=O.isRange,B=[],V=T.props.key,G=T.item.type.defaultProps!==void 0?he(he({},T.item.type.defaultProps),T.item.props):T.item.props,W=G.activeDot,H=G.dataKey,U=he(he({index:q,dataKey:H,cx:R.x,cy:R.y,r:4,fill:$j(T.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},ze(W,!1)),Zh(W));return B.push(j.renderActiveDot(W,U,"".concat(V,"-activePoint-").concat(q))),L?B.push(j.renderActiveDot(W,he(he({},U),{},{cx:L.x,cy:L.y}),"".concat(V,"-basePoint-").concat(q))):F&&B.push(null),B}),Ue(C,"renderGraphicChild",function(O,T,R){var L=C.filterFormatItem(O,T,R);if(!L)return null;var q=C.getTooltipEventType(),F=C.state,B=F.isTooltipActive,V=F.tooltipAxis,G=F.activeTooltipIndex,W=F.activeLabel,H=C.props.children,U=on(H,ln),$=L.props,Z=$.points,k=$.isRange,I=$.baseLine,D=L.item.type.defaultProps!==void 0?he(he({},L.item.type.defaultProps),L.item.props):L.item.props,J=D.activeDot,ae=D.hide,ie=D.activeBar,ne=D.activeShape,X=!!(!ae&&B&&U&&(J||ie||ne)),Y={};q!=="axis"&&U&&U.props.trigger==="click"?Y={onClick:Wf(C.handleItemMouseEnter,O.props.onClick)}:q!=="axis"&&(Y={onMouseLeave:Wf(C.handleItemMouseLeave,O.props.onMouseLeave),onMouseEnter:Wf(C.handleItemMouseEnter,O.props.onMouseEnter)});var ee=b.cloneElement(O,he(he({},L.props),Y));function le(St){return typeof V.dataKey=="function"?V.dataKey(St.payload):null}if(X)if(G>=0){var pe,K;if(V.dataKey&&!V.allowDuplicatedCategory){var je=typeof V.dataKey=="function"?le:"payload.".concat(V.dataKey.toString());pe=Qh(Z,je,W),K=k&&I&&Qh(I,je,W)}else pe=Z?.[G],K=k&&I&&I[G];if(ne||ie){var Ce=O.props.activeIndex!==void 0?O.props.activeIndex:G;return[b.cloneElement(O,he(he(he({},L.props),Y),{},{activeIndex:Ce})),null,null]}if(!Ze(pe))return[ee].concat(Pl(C.renderActivePoints({item:L,activePoint:pe,basePoint:K,childIndex:G,isRange:k})))}else{var Le,De=(Le=C.getItemByXY(C.state.activeCoordinate))!==null&&Le!==void 0?Le:{graphicalItem:ee},tt=De.graphicalItem,_t=tt.item,ft=_t===void 0?O:_t,Zt=tt.childIndex,At=he(he(he({},L.props),Y),{},{activeIndex:Zt});return[b.cloneElement(ft,At),null,null]}return k?[ee,null,null]:[ee,null]}),Ue(C,"renderCustomized",function(O,T,R){return b.cloneElement(O,he(he({key:"recharts-customized-".concat(R)},C.props),C.state))}),Ue(C,"renderMap",{CartesianGrid:{handler:Jf,once:!0},ReferenceArea:{handler:C.renderReferenceElement},ReferenceLine:{handler:Jf},ReferenceDot:{handler:C.renderReferenceElement},XAxis:{handler:Jf},YAxis:{handler:Jf},Brush:{handler:C.renderBrush,once:!0},Bar:{handler:C.renderGraphicChild},Line:{handler:C.renderGraphicChild},Area:{handler:C.renderGraphicChild},Radar:{handler:C.renderGraphicChild},RadialBar:{handler:C.renderGraphicChild},Scatter:{handler:C.renderGraphicChild},Pie:{handler:C.renderGraphicChild},Funnel:{handler:C.renderGraphicChild},Tooltip:{handler:C.renderCursor,once:!0},PolarGrid:{handler:C.renderPolarGrid,once:!0},PolarAngleAxis:{handler:C.renderPolarAxis},PolarRadiusAxis:{handler:C.renderPolarAxis},Customized:{handler:C.renderCustomized}}),C.clipPathId="".concat((E=N.id)!==null&&E!==void 0?E:Bl("recharts"),"-clip"),C.throttleTriggeredAfterMouseMove=XD(C.triggeredAfterMouseMove,(A=N.throttleDelay)!==null&&A!==void 0?A:1e3/60),C.state={},C}return Aae(j,S),Cae(j,[{key:"componentDidMount",value:function(){var E,A;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var E=this.props,A=E.children,C=E.data,O=E.height,T=E.layout,R=on(A,ln);if(R){var L=R.props.defaultIndex;if(!(typeof L!="number"||L<0||L>this.state.tooltipTicks.length-1)){var q=this.state.tooltipTicks[L]&&this.state.tooltipTicks[L].value,F=mS(this.state,C,L,q),B=this.state.tooltipTicks[L].coordinate,V=(this.state.offset.top+O)/2,G=T==="horizontal",W=G?{x:B,y:V}:{y:B,x:V},H=this.state.formattedGraphicalItems.find(function($){var Z=$.item;return Z.type.name==="Scatter"});H&&(W=he(he({},W),H.props.points[L].tooltipPosition),F=H.props.points[L].tooltipPayload);var U={activeTooltipIndex:L,isTooltipActive:!0,activeLabel:q,activePayload:F,activeCoordinate:W};this.setState(U),this.renderCursor(R),this.accessibilityManager.setIndex(L)}}}},{key:"getSnapshotBeforeUpdate",value:function(E,A){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==A.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==E.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==E.margin){var C,O;this.accessibilityManager.setDetails({offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0}})}return null}},{key:"componentDidUpdate",value:function(E){J1([on(E.children,ln)],[on(this.props.children,ln)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var E=on(this.props.children,ln);if(E&&typeof E.props.shared=="boolean"){var A=E.props.shared?"axis":"item";return u.indexOf(A)>=0?A:i}return i}},{key:"getMouseInfo",value:function(E){if(!this.container)return null;var A=this.container,C=A.getBoundingClientRect(),O=QH(C),T={chartX:Math.round(E.pageX-O.left),chartY:Math.round(E.pageY-O.top)},R=C.width/A.offsetWidth||1,L=this.inRange(T.chartX,T.chartY,R);if(!L)return null;var q=this.state,F=q.xAxisMap,B=q.yAxisMap,V=this.getTooltipEventType(),G=mR(this.state,this.props.data,this.props.layout,L);if(V!=="axis"&&F&&B){var W=Fi(F).scale,H=Fi(B).scale,U=W&&W.invert?W.invert(T.chartX):null,$=H&&H.invert?H.invert(T.chartY):null;return he(he({},T),{},{xValue:U,yValue:$},G)}return G?he(he({},T),G):null}},{key:"inRange",value:function(E,A){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=this.props.layout,T=E/C,R=A/C;if(O==="horizontal"||O==="vertical"){var L=this.state.offset,q=T>=L.left&&T<=L.left+L.width&&R>=L.top&&R<=L.top+L.height;return q?{x:T,y:R}:null}var F=this.state,B=F.angleAxisMap,V=F.radiusAxisMap;if(B&&V){var G=Fi(B);return bT({x:T,y:R},G)}return null}},{key:"parseEventsOfWrapper",value:function(){var E=this.props.children,A=this.getTooltipEventType(),C=on(E,ln),O={};C&&A==="axis"&&(C.props.trigger==="click"?O={onClick:this.handleClick}:O={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=Zh(this.props,this.handleOuterEvent);return he(he({},T),O)}},{key:"addListener",value:function(){b1.on(w1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){b1.removeListener(w1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(E,A,C){for(var O=this.state.formattedGraphicalItems,T=0,R=O.length;Ts.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg border border-gray-100 hover:bg-gray-100 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 font-bold text-xs",children:e.template.substring(0,2)}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-semibold text-gray-900",children:e.product}),s.jsxs("p",{className:"text-xs text-gray-500",children:[e.id," • ",e.user]})]})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("span",{className:"text-xs text-gray-500 font-medium",children:e.time}),s.jsx(Or,{variant:"secondary",className:e.status==="expired"?"bg-red-100 text-red-700":"bg-green-100 text-green-700",children:e.status})]})]},e.id))})})]})]}),s.jsx("div",{className:"space-y-6",children:s.jsxs(sn,{className:"shadow-sm border-gray-200",children:[s.jsx(Yn,{children:s.jsxs(Jn,{className:"text-base font-bold text-gray-800 flex items-center gap-2",children:[s.jsx(uu,{className:"w-5 h-5 text-gray-500"}),"By Category"]})}),s.jsxs(An,{children:[s.jsxs("div",{className:"h-[200px] relative",children:[s.jsx(cp,{width:"100%",height:"100%",children:s.jsxs(Gae,{children:[s.jsx(fi,{data:j1,cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"value",children:j1.map((e,t)=>s.jsx(_m,{fill:e.color},`cell-${t}`))}),s.jsx(ln,{})]})}),s.jsxs("div",{className:"absolute inset-0 flex items-center justify-center flex-col pointer-events-none",children:[s.jsx("span",{className:"text-2xl font-bold text-gray-900",children:"1000"}),s.jsx("span",{className:"text-xs text-gray-500",children:"Total"})]})]}),s.jsx("div",{className:"mt-4 space-y-2",children:j1.map(e=>s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),s.jsx("span",{className:"text-gray-600",children:e.name})]}),s.jsx("span",{className:"font-medium text-gray-900",children:e.value})]},e.name))})]})]})})]})]})}function ks({title:e,value:t,trend:r,trendUp:n,icon:a,color:i,bgColor:o}){return s.jsx(sn,{className:"border-gray-200 shadow-sm hover:shadow-md transition-shadow",children:s.jsxs(An,{className:"p-6",children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-500 mb-1",children:e}),s.jsx("h3",{className:"text-2xl font-bold text-gray-900",children:t})]}),s.jsx("div",{className:`p-2 rounded-lg ${o}`,children:s.jsx(a,{className:`w-5 h-5 ${i}`})})]}),s.jsxs("div",{className:"mt-4 flex items-center text-sm",children:[n?s.jsx(aM,{className:"w-4 h-4 text-green-500 mr-1"}):s.jsx(Z8,{className:"w-4 h-4 text-red-500 mr-1"}),s.jsx("span",{className:n?"text-green-600 font-medium":"text-red-600 font-medium",children:r}),s.jsx("span",{className:"text-gray-400 ml-1",children:"Vs. last period"})]})]})})}function Jae({title:e}){return s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[1,2,3,4].map(t=>s.jsxs(sn,{children:[s.jsx(Yn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:s.jsxs(Jn,{className:"text-sm font-medium",children:["Metric ",t]})}),s.jsxs(An,{children:[s.jsx("div",{className:"text-2xl font-bold",children:"000"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"+0.0% from last month"})]})]},t))}),s.jsx(sn,{className:"min-h-[400px] flex items-center justify-center border-dashed",children:s.jsxs("div",{className:"text-center text-muted-foreground",children:[s.jsxs("h3",{className:"text-lg font-medium",children:[e," Module"]}),s.jsx("p",{children:"This module is currently under development."})]})})]})}function Dr({className:e,...t}){return s.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:s.jsx("table",{"data-slot":"table",className:Ae("w-full caption-bottom text-sm",e),...t})})}function Lr({className:e,...t}){return s.jsx("thead",{"data-slot":"table-header",className:Ae("[&_tr]:border-b",e),...t})}function $r({className:e,...t}){return s.jsx("tbody",{"data-slot":"table-body",className:Ae("[&_tr:last-child]:border-0",e),...t})}function Fe({className:e,...t}){return s.jsx("tr",{"data-slot":"table-row",className:Ae("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function ye({className:e,...t}){return s.jsx("th",{"data-slot":"table-head",className:Ae("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function de({className:e,...t}){return s.jsx("td",{"data-slot":"table-cell",className:Ae("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function yR(e){const t=Qae(e),r=b.forwardRef((n,a)=>{const{children:i,...o}=n,u=b.Children.toArray(i),d=u.find(eie);if(d){const c=d.props.children,h=u.map(p=>p===d?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:p);return s.jsx(t,{...o,ref:a,children:b.isValidElement(c)?b.cloneElement(c,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function Qae(e){const t=b.forwardRef((r,n)=>{const{children:a,...i}=r;if(b.isValidElement(a)){const o=rie(a),u=tie(i,a.props);return a.type!==b.Fragment&&(u.ref=n?Mn(n,o):o),b.cloneElement(a,u)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zae=Symbol("radix.slottable");function eie(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zae}function tie(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function rie(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function nie(e){const t=e+"CollectionProvider",[r,n]=li(t),[a,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=y=>{const{scope:S,children:j}=y,N=z.useRef(null),E=z.useRef(new Map).current;return s.jsx(a,{scope:S,itemMap:E,collectionRef:N,children:j})};o.displayName=t;const u=e+"CollectionSlot",d=yR(u),c=z.forwardRef((y,S)=>{const{scope:j,children:N}=y,E=i(u,j),A=it(S,E.collectionRef);return s.jsx(d,{ref:A,children:N})});c.displayName=u;const h=e+"CollectionItemSlot",p="data-radix-collection-item",m=yR(h),v=z.forwardRef((y,S)=>{const{scope:j,children:N,...E}=y,A=z.useRef(null),C=it(S,A),O=i(h,j);return z.useEffect(()=>(O.itemMap.set(A,{ref:A,...E}),()=>void O.itemMap.delete(A))),s.jsx(m,{[p]:"",ref:C,children:N})});v.displayName=h;function x(y){const S=i(e+"CollectionConsumer",y);return z.useCallback(()=>{const N=S.collectionRef.current;if(!N)return[];const E=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(S.itemMap.values()).sort((O,T)=>E.indexOf(O.ref.current)-E.indexOf(T.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:o,Slot:c,ItemSlot:v},x,n]}function aie(e,t=globalThis?.document){const r=kr(e);b.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var iie="DismissableLayer",gS="dismissableLayer.update",oie="dismissableLayer.pointerDownOutside",sie="dismissableLayer.focusOutside",xR,g4=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),sd=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:u,...d}=e,c=b.useContext(g4),[h,p]=b.useState(null),m=h?.ownerDocument??globalThis?.document,[,v]=b.useState({}),x=it(t,T=>p(T)),y=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),j=y.indexOf(S),N=h?y.indexOf(h):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,A=N>=j,C=uie(T=>{const R=T.target,L=[...c.branches].some(q=>q.contains(R));!A||L||(a?.(T),o?.(T),T.defaultPrevented||u?.())},m),O=die(T=>{const R=T.target;[...c.branches].some(q=>q.contains(R))||(i?.(T),o?.(T),T.defaultPrevented||u?.())},m);return aie(T=>{N===c.layers.size-1&&(n?.(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},m),b.useEffect(()=>{if(h)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(xR=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),bR(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=xR)}},[h,m,r,c]),b.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),bR())},[h,c]),b.useEffect(()=>{const T=()=>v({});return document.addEventListener(gS,T),()=>document.removeEventListener(gS,T)},[]),s.jsx(Ye.div,{...d,ref:x,style:{pointerEvents:E?A?"auto":"none":void 0,...e.style},onFocusCapture:Je(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Je(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Je(e.onPointerDownCapture,C.onPointerDownCapture)})});sd.displayName=iie;var lie="DismissableLayerBranch",cie=b.forwardRef((e,t)=>{const r=b.useContext(g4),n=b.useRef(null),a=it(t,n);return b.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),s.jsx(Ye.div,{...e,ref:a})});cie.displayName=lie;function uie(e,t=globalThis?.document){const r=kr(e),n=b.useRef(!1),a=b.useRef(()=>{});return b.useEffect(()=>{const i=u=>{if(u.target&&!n.current){let d=function(){v4(oie,r,c,{discrete:!0})};const c={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function die(e,t=globalThis?.document){const r=kr(e),n=b.useRef(!1);return b.useEffect(()=>{const a=i=>{i.target&&!n.current&&v4(sie,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function bR(){const e=new CustomEvent(gS);document.dispatchEvent(e)}function v4(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?pq(a,i):a.dispatchEvent(i)}var _1=0;function Yj(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??wR()),document.body.insertAdjacentElement("beforeend",e[1]??wR()),_1++,()=>{_1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_1--}},[])}function wR(){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}var N1="focusScope.autoFocusOnMount",C1="focusScope.autoFocusOnUnmount",SR={bubbles:!1,cancelable:!0},fie="FocusScope",Xm=b.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[u,d]=b.useState(null),c=kr(a),h=kr(i),p=b.useRef(null),m=it(t,y=>d(y)),v=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(n){let y=function(E){if(v.paused||!u)return;const A=E.target;u.contains(A)?p.current=A:$i(p.current,{select:!0})},S=function(E){if(v.paused||!u)return;const A=E.relatedTarget;A!==null&&(u.contains(A)||$i(p.current,{select:!0}))},j=function(E){if(document.activeElement===document.body)for(const C of E)C.removedNodes.length>0&&$i(u)};document.addEventListener("focusin",y),document.addEventListener("focusout",S);const N=new MutationObserver(j);return u&&N.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",S),N.disconnect()}}},[n,u,v.paused]),b.useEffect(()=>{if(u){_R.add(v);const y=document.activeElement;if(!u.contains(y)){const j=new CustomEvent(N1,SR);u.addEventListener(N1,c),u.dispatchEvent(j),j.defaultPrevented||(hie(yie(y4(u)),{select:!0}),document.activeElement===y&&$i(u))}return()=>{u.removeEventListener(N1,c),setTimeout(()=>{const j=new CustomEvent(C1,SR);u.addEventListener(C1,h),u.dispatchEvent(j),j.defaultPrevented||$i(y??document.body,{select:!0}),u.removeEventListener(C1,h),_R.remove(v)},0)}}},[u,c,h,v]);const x=b.useCallback(y=>{if(!r&&!n||v.paused)return;const S=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,j=document.activeElement;if(S&&j){const N=y.currentTarget,[E,A]=pie(N);E&&A?!y.shiftKey&&j===A?(y.preventDefault(),r&&$i(E,{select:!0})):y.shiftKey&&j===E&&(y.preventDefault(),r&&$i(A,{select:!0})):j===N&&y.preventDefault()}},[r,n,v.paused]);return s.jsx(Ye.div,{tabIndex:-1,...o,ref:m,onKeyDown:x})});Xm.displayName=fie;function hie(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if($i(n,{select:t}),document.activeElement!==r)return}function pie(e){const t=y4(e),r=jR(t,e),n=jR(t.reverse(),e);return[r,n]}function y4(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function jR(e,t){for(const r of e)if(!mie(r,{upTo:t}))return r}function mie(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 gie(e){return e instanceof HTMLInputElement&&"select"in e}function $i(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&gie(e)&&t&&e.select()}}var _R=vie();function vie(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=NR(e,t),e.unshift(t)},remove(t){e=NR(e,t),e[0]?.resume()}}}function NR(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function yie(e){return e.filter(t=>t.tagName!=="A")}var xie=DS[" useId ".trim().toString()]||(()=>{}),bie=0;function Kr(e){const[t,r]=b.useState(xie());return Qt(()=>{r(n=>n??String(bie++))},[e]),e||(t?`radix-${t}`:"")}const wie=["top","right","bottom","left"],Vi=Math.min,un=Math.max,em=Math.round,Qf=Math.floor,Sa=e=>({x:e,y:e}),Sie={left:"right",right:"left",bottom:"top",top:"bottom"},jie={start:"end",end:"start"};function vS(e,t,r){return un(e,Vi(t,r))}function oi(e,t){return typeof e=="function"?e(t):e}function si(e){return e.split("-")[0]}function Wl(e){return e.split("-")[1]}function Jj(e){return e==="x"?"y":"x"}function Qj(e){return e==="y"?"height":"width"}const _ie=new Set(["top","bottom"]);function ya(e){return _ie.has(si(e))?"y":"x"}function Zj(e){return Jj(ya(e))}function Nie(e,t,r){r===void 0&&(r=!1);const n=Wl(e),a=Zj(e),i=Qj(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=tm(o)),[o,tm(o)]}function Cie(e){const t=tm(e);return[yS(e),t,yS(t)]}function yS(e){return e.replace(/start|end/g,t=>jie[t])}const CR=["left","right"],ER=["right","left"],Eie=["top","bottom"],Oie=["bottom","top"];function Pie(e,t,r){switch(e){case"top":case"bottom":return r?t?ER:CR:t?CR:ER;case"left":case"right":return t?Eie:Oie;default:return[]}}function Aie(e,t,r,n){const a=Wl(e);let i=Pie(si(e),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(yS)))),i}function tm(e){return e.replace(/left|right|bottom|top/g,t=>Sie[t])}function Tie(e){return{top:0,right:0,bottom:0,left:0,...e}}function x4(e){return typeof e!="number"?Tie(e):{top:e,right:e,bottom:e,left:e}}function rm(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function OR(e,t,r){let{reference:n,floating:a}=e;const i=ya(t),o=Zj(t),u=Qj(o),d=si(t),c=i==="y",h=n.x+n.width/2-a.width/2,p=n.y+n.height/2-a.height/2,m=n[u]/2-a[u]/2;let v;switch(d){case"top":v={x:h,y:n.y-a.height};break;case"bottom":v={x:h,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:p};break;case"left":v={x:n.x-a.width,y:p};break;default:v={x:n.x,y:n.y}}switch(Wl(t)){case"start":v[o]-=m*(r&&c?-1:1);break;case"end":v[o]+=m*(r&&c?-1:1);break}return v}async function kie(e,t){var r;t===void 0&&(t={});const{x:n,y:a,platform:i,rects:o,elements:u,strategy:d}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:v=0}=oi(t,e),x=x4(v),S=u[m?p==="floating"?"reference":"floating":p],j=rm(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(S)))==null||r?S:S.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:c,rootBoundary:h,strategy:d})),N=p==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),A=await(i.isElement==null?void 0:i.isElement(E))?await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1}:{x:1,y:1},C=rm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:N,offsetParent:E,strategy:d}):N);return{top:(j.top-C.top+x.top)/A.y,bottom:(C.bottom-j.bottom+x.bottom)/A.y,left:(j.left-C.left+x.left)/A.x,right:(C.right-j.right+x.right)/A.x}}const Rie=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,u=i.filter(Boolean),d=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=OR(c,n,d),m=n,v={},x=0;for(let S=0;S({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:i,platform:o,elements:u,middlewareData:d}=t,{element:c,padding:h=0}=oi(e,t)||{};if(c==null)return{};const p=x4(h),m={x:r,y:n},v=Zj(a),x=Qj(v),y=await o.getDimensions(c),S=v==="y",j=S?"top":"left",N=S?"bottom":"right",E=S?"clientHeight":"clientWidth",A=i.reference[x]+i.reference[v]-m[v]-i.floating[x],C=m[v]-i.reference[v],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let T=O?O[E]:0;(!T||!await(o.isElement==null?void 0:o.isElement(O)))&&(T=u.floating[E]||i.floating[x]);const R=A/2-C/2,L=T/2-y[x]/2-1,q=Vi(p[j],L),F=Vi(p[N],L),B=q,V=T-y[x]-F,G=T/2-y[x]/2+R,W=vS(B,G,V),H=!d.arrow&&Wl(a)!=null&&G!==W&&i.reference[x]/2-(GG<=0)){var F,B;const G=(((F=i.flip)==null?void 0:F.index)||0)+1,W=T[G];if(W&&(!(p==="alignment"?N!==ya(W):!1)||q.every($=>ya($.placement)===N?$.overflows[0]>0:!0)))return{data:{index:G,overflows:q},reset:{placement:W}};let H=(B=q.filter(U=>U.overflows[0]<=0).sort((U,$)=>U.overflows[1]-$.overflows[1])[0])==null?void 0:B.placement;if(!H)switch(v){case"bestFit":{var V;const U=(V=q.filter($=>{if(O){const Z=ya($.placement);return Z===N||Z==="y"}return!0}).map($=>[$.placement,$.overflows.filter(Z=>Z>0).reduce((Z,k)=>Z+k,0)]).sort(($,Z)=>$[1]-Z[1])[0])==null?void 0:V[0];U&&(H=U);break}case"initialPlacement":H=u;break}if(a!==H)return{reset:{placement:H}}}return{}}}};function PR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function AR(e){return wie.some(t=>e[t]>=0)}const Die=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...i}=oi(e,t);switch(a){case"referenceHidden":{const o=await n.detectOverflow(t,{...i,elementContext:"reference"}),u=PR(o,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:AR(u)}}}case"escaped":{const o=await n.detectOverflow(t,{...i,altBoundary:!0}),u=PR(o,r.floating);return{data:{escapedOffsets:u,escaped:AR(u)}}}default:return{}}}}},b4=new Set(["left","top"]);async function Lie(e,t){const{placement:r,platform:n,elements:a}=e,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=si(r),u=Wl(r),d=ya(r)==="y",c=b4.has(o)?-1:1,h=i&&d?-1:1,p=oi(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof x=="number"&&(v=u==="end"?x*-1:x),d?{x:v*h,y:m*c}:{x:m*c,y:v*h}}const $ie=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:i,placement:o,middlewareData:u}=t,d=await Lie(t,e);return o===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:a+d.x,y:i+d.y,data:{...d,placement:o}}}}},Bie=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:u=!1,limiter:d={fn:j=>{let{x:N,y:E}=j;return{x:N,y:E}}},...c}=oi(e,t),h={x:r,y:n},p=await i.detectOverflow(t,c),m=ya(si(a)),v=Jj(m);let x=h[v],y=h[m];if(o){const j=v==="y"?"top":"left",N=v==="y"?"bottom":"right",E=x+p[j],A=x-p[N];x=vS(E,x,A)}if(u){const j=m==="y"?"top":"left",N=m==="y"?"bottom":"right",E=y+p[j],A=y-p[N];y=vS(E,y,A)}const S=d.fn({...t,[v]:x,[m]:y});return{...S,data:{x:S.x-r,y:S.y-n,enabled:{[v]:o,[m]:u}}}}}},Fie=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=t,{offset:u=0,mainAxis:d=!0,crossAxis:c=!0}=oi(e,t),h={x:r,y:n},p=ya(a),m=Jj(p);let v=h[m],x=h[p];const y=oi(u,t),S=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(d){const E=m==="y"?"height":"width",A=i.reference[m]-i.floating[E]+S.mainAxis,C=i.reference[m]+i.reference[E]-S.mainAxis;vC&&(v=C)}if(c){var j,N;const E=m==="y"?"width":"height",A=b4.has(si(a)),C=i.reference[p]-i.floating[E]+(A&&((j=o.offset)==null?void 0:j[p])||0)+(A?0:S.crossAxis),O=i.reference[p]+i.reference[E]+(A?0:((N=o.offset)==null?void 0:N[p])||0)-(A?S.crossAxis:0);xO&&(x=O)}return{[m]:v,[p]:x}}}},zie=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:i,platform:o,elements:u}=t,{apply:d=()=>{},...c}=oi(e,t),h=await o.detectOverflow(t,c),p=si(a),m=Wl(a),v=ya(a)==="y",{width:x,height:y}=i.floating;let S,j;p==="top"||p==="bottom"?(S=p,j=m===(await(o.isRTL==null?void 0:o.isRTL(u.floating))?"start":"end")?"left":"right"):(j=p,S=m==="end"?"top":"bottom");const N=y-h.top-h.bottom,E=x-h.left-h.right,A=Vi(y-h[S],N),C=Vi(x-h[j],E),O=!t.middlewareData.shift;let T=A,R=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(R=E),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=N),O&&!m){const q=un(h.left,0),F=un(h.right,0),B=un(h.top,0),V=un(h.bottom,0);v?R=x-2*(q!==0||F!==0?q+F:un(h.left,h.right)):T=y-2*(B!==0||V!==0?B+V:un(h.top,h.bottom))}await d({...t,availableWidth:R,availableHeight:T});const L=await o.getDimensions(u.floating);return x!==L.width||y!==L.height?{reset:{rects:!0}}:{}}}};function Ym(){return typeof window<"u"}function Gl(e){return w4(e)?(e.nodeName||"").toLowerCase():"#document"}function pn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Aa(e){var t;return(t=(w4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function w4(e){return Ym()?e instanceof Node||e instanceof pn(e).Node:!1}function aa(e){return Ym()?e instanceof Element||e instanceof pn(e).Element:!1}function Na(e){return Ym()?e instanceof HTMLElement||e instanceof pn(e).HTMLElement:!1}function TR(e){return!Ym()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pn(e).ShadowRoot}const qie=new Set(["inline","contents"]);function ld(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=ia(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!qie.has(a)}const Uie=new Set(["table","td","th"]);function Vie(e){return Uie.has(Gl(e))}const Hie=[":popover-open",":modal"];function Jm(e){return Hie.some(t=>{try{return e.matches(t)}catch{return!1}})}const Wie=["transform","translate","scale","rotate","perspective"],Gie=["transform","translate","scale","rotate","perspective","filter"],Kie=["paint","layout","strict","content"];function e_(e){const t=t_(),r=aa(e)?ia(e):e;return Wie.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||Gie.some(n=>(r.willChange||"").includes(n))||Kie.some(n=>(r.contain||"").includes(n))}function Xie(e){let t=Hi(e);for(;Na(t)&&!Al(t);){if(e_(t))return t;if(Jm(t))return null;t=Hi(t)}return null}function t_(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Yie=new Set(["html","body","#document"]);function Al(e){return Yie.has(Gl(e))}function ia(e){return pn(e).getComputedStyle(e)}function Qm(e){return aa(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hi(e){if(Gl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||TR(e)&&e.host||Aa(e);return TR(t)?t.host:t}function S4(e){const t=Hi(e);return Al(t)?e.ownerDocument?e.ownerDocument.body:e.body:Na(t)&&ld(t)?t:S4(t)}function Gu(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=S4(e),i=a===((n=e.ownerDocument)==null?void 0:n.body),o=pn(a);if(i){const u=xS(o);return t.concat(o,o.visualViewport||[],ld(a)?a:[],u&&r?Gu(u):[])}return t.concat(a,Gu(a,[],r))}function xS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function j4(e){const t=ia(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Na(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,u=em(r)!==i||em(n)!==o;return u&&(r=i,n=o),{width:r,height:n,$:u}}function r_(e){return aa(e)?e:e.contextElement}function Qs(e){const t=r_(e);if(!Na(t))return Sa(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:i}=j4(t);let o=(i?em(r.width):r.width)/n,u=(i?em(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!u||!Number.isFinite(u))&&(u=1),{x:o,y:u}}const Jie=Sa(0);function _4(e){const t=pn(e);return!t_()||!t.visualViewport?Jie:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Qie(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==pn(e)?!1:t}function Uo(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),i=r_(e);let o=Sa(1);t&&(n?aa(n)&&(o=Qs(n)):o=Qs(e));const u=Qie(i,r,n)?_4(i):Sa(0);let d=(a.left+u.x)/o.x,c=(a.top+u.y)/o.y,h=a.width/o.x,p=a.height/o.y;if(i){const m=pn(i),v=n&&aa(n)?pn(n):n;let x=m,y=xS(x);for(;y&&n&&v!==x;){const S=Qs(y),j=y.getBoundingClientRect(),N=ia(y),E=j.left+(y.clientLeft+parseFloat(N.paddingLeft))*S.x,A=j.top+(y.clientTop+parseFloat(N.paddingTop))*S.y;d*=S.x,c*=S.y,h*=S.x,p*=S.y,d+=E,c+=A,x=pn(y),y=xS(x)}}return rm({width:h,height:p,x:d,y:c})}function Zm(e,t){const r=Qm(e).scrollLeft;return t?t.left+r:Uo(Aa(e)).left+r}function N4(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Zm(e,r),a=r.top+t.scrollTop;return{x:n,y:a}}function Zie(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const i=a==="fixed",o=Aa(n),u=t?Jm(t.floating):!1;if(n===o||u&&i)return r;let d={scrollLeft:0,scrollTop:0},c=Sa(1);const h=Sa(0),p=Na(n);if((p||!p&&!i)&&((Gl(n)!=="body"||ld(o))&&(d=Qm(n)),Na(n))){const v=Uo(n);c=Qs(n),h.x=v.x+n.clientLeft,h.y=v.y+n.clientTop}const m=o&&!p&&!i?N4(o,d):Sa(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-d.scrollLeft*c.x+h.x+m.x,y:r.y*c.y-d.scrollTop*c.y+h.y+m.y}}function eoe(e){return Array.from(e.getClientRects())}function toe(e){const t=Aa(e),r=Qm(e),n=e.ownerDocument.body,a=un(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=un(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Zm(e);const u=-r.scrollTop;return ia(n).direction==="rtl"&&(o+=un(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:u}}const kR=25;function roe(e,t){const r=pn(e),n=Aa(e),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,u=0,d=0;if(a){i=a.width,o=a.height;const h=t_();(!h||h&&t==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}const c=Zm(n);if(c<=0){const h=n.ownerDocument,p=h.body,m=getComputedStyle(p),v=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(n.clientWidth-p.clientWidth-v);x<=kR&&(i-=x)}else c<=kR&&(i+=c);return{width:i,height:o,x:u,y:d}}const noe=new Set(["absolute","fixed"]);function aoe(e,t){const r=Uo(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=Na(e)?Qs(e):Sa(1),o=e.clientWidth*i.x,u=e.clientHeight*i.y,d=a*i.x,c=n*i.y;return{width:o,height:u,x:d,y:c}}function RR(e,t,r){let n;if(t==="viewport")n=roe(e,r);else if(t==="document")n=toe(Aa(e));else if(aa(t))n=aoe(t,r);else{const a=_4(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return rm(n)}function C4(e,t){const r=Hi(e);return r===t||!aa(r)||Al(r)?!1:ia(r).position==="fixed"||C4(r,t)}function ioe(e,t){const r=t.get(e);if(r)return r;let n=Gu(e,[],!1).filter(u=>aa(u)&&Gl(u)!=="body"),a=null;const i=ia(e).position==="fixed";let o=i?Hi(e):e;for(;aa(o)&&!Al(o);){const u=ia(o),d=e_(o);!d&&u.position==="fixed"&&(a=null),(i?!d&&!a:!d&&u.position==="static"&&!!a&&noe.has(a.position)||ld(o)&&!d&&C4(e,o))?n=n.filter(h=>h!==o):a=u,o=Hi(o)}return t.set(e,n),n}function ooe(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[...r==="clippingAncestors"?Jm(t)?[]:ioe(t,this._c):[].concat(r),n],u=o[0],d=o.reduce((c,h)=>{const p=RR(t,h,a);return c.top=un(p.top,c.top),c.right=Vi(p.right,c.right),c.bottom=Vi(p.bottom,c.bottom),c.left=un(p.left,c.left),c},RR(t,u,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function soe(e){const{width:t,height:r}=j4(e);return{width:t,height:r}}function loe(e,t,r){const n=Na(t),a=Aa(t),i=r==="fixed",o=Uo(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const d=Sa(0);function c(){d.x=Zm(a)}if(n||!n&&!i)if((Gl(t)!=="body"||ld(a))&&(u=Qm(t)),n){const v=Uo(t,!0,i,t);d.x=v.x+t.clientLeft,d.y=v.y+t.clientTop}else a&&c();i&&!n&&a&&c();const h=a&&!n&&!i?N4(a,u):Sa(0),p=o.left+u.scrollLeft-d.x-h.x,m=o.top+u.scrollTop-d.y-h.y;return{x:p,y:m,width:o.width,height:o.height}}function E1(e){return ia(e).position==="static"}function IR(e,t){if(!Na(e)||ia(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Aa(e)===r&&(r=r.ownerDocument.body),r}function E4(e,t){const r=pn(e);if(Jm(e))return r;if(!Na(e)){let a=Hi(e);for(;a&&!Al(a);){if(aa(a)&&!E1(a))return a;a=Hi(a)}return r}let n=IR(e,t);for(;n&&Vie(n)&&E1(n);)n=IR(n,t);return n&&Al(n)&&E1(n)&&!e_(n)?r:n||Xie(e)||r}const coe=async function(e){const t=this.getOffsetParent||E4,r=this.getDimensions,n=await r(e.floating);return{reference:loe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function uoe(e){return ia(e).direction==="rtl"}const doe={convertOffsetParentRelativeRectToViewportRelativeRect:Zie,getDocumentElement:Aa,getClippingRect:ooe,getOffsetParent:E4,getElementRects:coe,getClientRects:eoe,getDimensions:soe,getScale:Qs,isElement:aa,isRTL:uoe};function O4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function foe(e,t){let r=null,n;const a=Aa(e);function i(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function o(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const c=e.getBoundingClientRect(),{left:h,top:p,width:m,height:v}=c;if(u||t(),!m||!v)return;const x=Qf(p),y=Qf(a.clientWidth-(h+m)),S=Qf(a.clientHeight-(p+v)),j=Qf(h),E={rootMargin:-x+"px "+-y+"px "+-S+"px "+-j+"px",threshold:un(0,Vi(1,d))||1};let A=!0;function C(O){const T=O[0].intersectionRatio;if(T!==d){if(!A)return o();T?o(!1,T):n=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!O4(c,e.getBoundingClientRect())&&o(),A=!1}try{r=new IntersectionObserver(C,{...E,root:a.ownerDocument})}catch{r=new IntersectionObserver(C,E)}r.observe(e)}return o(!0),i}function hoe(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,c=r_(e),h=a||i?[...c?Gu(c):[],...Gu(t)]:[];h.forEach(j=>{a&&j.addEventListener("scroll",r,{passive:!0}),i&&j.addEventListener("resize",r)});const p=c&&u?foe(c,r):null;let m=-1,v=null;o&&(v=new ResizeObserver(j=>{let[N]=j;N&&N.target===c&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=v)==null||E.observe(t)})),r()}),c&&!d&&v.observe(c),v.observe(t));let x,y=d?Uo(e):null;d&&S();function S(){const j=Uo(e);y&&!O4(y,j)&&r(),y=j,x=requestAnimationFrame(S)}return r(),()=>{var j;h.forEach(N=>{a&&N.removeEventListener("scroll",r),i&&N.removeEventListener("resize",r)}),p?.(),(j=v)==null||j.disconnect(),v=null,d&&cancelAnimationFrame(x)}}const poe=$ie,moe=Bie,goe=Mie,voe=zie,yoe=Die,MR=Iie,xoe=Fie,boe=(e,t,r)=>{const n=new Map,a={platform:doe,...r},i={...a.platform,_c:n};return Rie(e,t,{...a,platform:i})};var woe=typeof document<"u",Soe=function(){},zh=woe?b.useLayoutEffect:Soe;function nm(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 r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!nm(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&e.$$typeof)&&!nm(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function P4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function DR(e,t){const r=P4(e);return Math.round(t*r)/r}function O1(e){const t=b.useRef(e);return zh(()=>{t.current=e}),t}function joe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:u=!0,whileElementsMounted:d,open:c}=e,[h,p]=b.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=b.useState(n);nm(m,n)||v(n);const[x,y]=b.useState(null),[S,j]=b.useState(null),N=b.useCallback($=>{$!==O.current&&(O.current=$,y($))},[]),E=b.useCallback($=>{$!==T.current&&(T.current=$,j($))},[]),A=i||x,C=o||S,O=b.useRef(null),T=b.useRef(null),R=b.useRef(h),L=d!=null,q=O1(d),F=O1(a),B=O1(c),V=b.useCallback(()=>{if(!O.current||!T.current)return;const $={placement:t,strategy:r,middleware:m};F.current&&($.platform=F.current),boe(O.current,T.current,$).then(Z=>{const k={...Z,isPositioned:B.current!==!1};G.current&&!nm(R.current,k)&&(R.current=k,Ju.flushSync(()=>{p(k)}))})},[m,t,r,F,B]);zh(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[c]);const G=b.useRef(!1);zh(()=>(G.current=!0,()=>{G.current=!1}),[]),zh(()=>{if(A&&(O.current=A),C&&(T.current=C),A&&C){if(q.current)return q.current(A,C,V);V()}},[A,C,V,q,L]);const W=b.useMemo(()=>({reference:O,floating:T,setReference:N,setFloating:E}),[N,E]),H=b.useMemo(()=>({reference:A,floating:C}),[A,C]),U=b.useMemo(()=>{const $={position:r,left:0,top:0};if(!H.floating)return $;const Z=DR(H.floating,h.x),k=DR(H.floating,h.y);return u?{...$,transform:"translate("+Z+"px, "+k+"px)",...P4(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Z,top:k}},[r,u,H.floating,h.x,h.y]);return b.useMemo(()=>({...h,update:V,refs:W,elements:H,floatingStyles:U}),[h,V,W,H,U])}const _oe=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?MR({element:n.current,padding:a}).fn(r):{}:n?MR({element:n,padding:a}).fn(r):{}}}},Noe=(e,t)=>({...poe(e),options:[e,t]}),Coe=(e,t)=>({...moe(e),options:[e,t]}),Eoe=(e,t)=>({...xoe(e),options:[e,t]}),Ooe=(e,t)=>({...goe(e),options:[e,t]}),Poe=(e,t)=>({...voe(e),options:[e,t]}),Aoe=(e,t)=>({...yoe(e),options:[e,t]}),Toe=(e,t)=>({..._oe(e),options:[e,t]});var koe="Arrow",A4=b.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...i}=e;return s.jsx(Ye.svg,{...i,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});A4.displayName=koe;var Roe=A4;function n_(e){const[t,r]=b.useState(void 0);return Qt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,u;if("borderBoxSize"in i){const d=i.borderBoxSize,c=Array.isArray(d)?d[0]:d;o=c.inlineSize,u=c.blockSize}else o=e.offsetWidth,u=e.offsetHeight;r({width:o,height:u})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var a_="Popper",[T4,Kl]=li(a_),[Ioe,k4]=T4(a_),R4=e=>{const{__scopePopper:t,children:r}=e,[n,a]=b.useState(null);return s.jsx(Ioe,{scope:t,anchor:n,onAnchorChange:a,children:r})};R4.displayName=a_;var I4="PopperAnchor",M4=b.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,i=k4(I4,r),o=b.useRef(null),u=it(t,o),d=b.useRef(null);return b.useEffect(()=>{const c=d.current;d.current=n?.current||o.current,c!==d.current&&i.onAnchorChange(d.current)}),n?null:s.jsx(Ye.div,{...a,ref:u})});M4.displayName=I4;var i_="PopperContent",[Moe,Doe]=T4(i_),D4=b.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:c=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:x,...y}=e,S=k4(i_,r),[j,N]=b.useState(null),E=it(t,X=>N(X)),[A,C]=b.useState(null),O=n_(A),T=O?.width??0,R=O?.height??0,L=n+(i!=="center"?"-"+i:""),q=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},F=Array.isArray(c)?c:[c],B=F.length>0,V={padding:q,boundary:F.filter($oe),altBoundary:B},{refs:G,floatingStyles:W,placement:H,isPositioned:U,middlewareData:$}=joe({strategy:"fixed",placement:L,whileElementsMounted:(...X)=>hoe(...X,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[Noe({mainAxis:a+R,alignmentAxis:o}),d&&Coe({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Eoe():void 0,...V}),d&&Ooe({...V}),Poe({...V,apply:({elements:X,rects:Y,availableWidth:ee,availableHeight:le})=>{const{width:pe,height:K}=Y.reference,je=X.floating.style;je.setProperty("--radix-popper-available-width",`${ee}px`),je.setProperty("--radix-popper-available-height",`${le}px`),je.setProperty("--radix-popper-anchor-width",`${pe}px`),je.setProperty("--radix-popper-anchor-height",`${K}px`)}}),A&&Toe({element:A,padding:u}),Boe({arrowWidth:T,arrowHeight:R}),m&&Aoe({strategy:"referenceHidden",...V})]}),[Z,k]=B4(H),I=kr(x);Qt(()=>{U&&I?.()},[U,I]);const D=$.arrow?.x,J=$.arrow?.y,ae=$.arrow?.centerOffset!==0,[ie,ne]=b.useState();return Qt(()=>{j&&ne(window.getComputedStyle(j).zIndex)},[j]),s.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:U?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(Moe,{scope:r,placedSide:Z,onArrowChange:C,arrowX:D,arrowY:J,shouldHideArrow:ae,children:s.jsx(Ye.div,{"data-side":Z,"data-align":k,...y,ref:E,style:{...y.style,animation:U?void 0:"none"}})})})});D4.displayName=i_;var L4="PopperArrow",Loe={top:"bottom",right:"left",bottom:"top",left:"right"},$4=b.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,i=Doe(L4,n),o=Loe[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]: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:s.jsx(Roe,{...a,ref:r,style:{...a.style,display:"block"}})})});$4.displayName=L4;function $oe(e){return e!==null}var Boe=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,u=o?0:e.arrowWidth,d=o?0:e.arrowHeight,[c,h]=B4(r),p={start:"0%",center:"50%",end:"100%"}[h],m=(a.arrow?.x??0)+u/2,v=(a.arrow?.y??0)+d/2;let x="",y="";return c==="bottom"?(x=o?p:`${m}px`,y=`${-d}px`):c==="top"?(x=o?p:`${m}px`,y=`${n.floating.height+d}px`):c==="right"?(x=`${-d}px`,y=o?p:`${v}px`):c==="left"&&(x=`${n.floating.width+d}px`,y=o?p:`${v}px`),{data:{x,y}}}});function B4(e){const[t,r="center"]=e.split("-");return[t,r]}var o_=R4,eg=M4,s_=D4,l_=$4,Foe="Portal",cd=b.forwardRef((e,t)=>{const{container:r,...n}=e,[a,i]=b.useState(!1);Qt(()=>i(!0),[]);const o=r||a&&globalThis?.document?.body;return o?rM.createPortal(s.jsx(Ye.div,{...n,ref:t}),o):null});cd.displayName=Foe;function zoe(e){const t=qoe(e),r=b.forwardRef((n,a)=>{const{children:i,...o}=n,u=b.Children.toArray(i),d=u.find(Voe);if(d){const c=d.props.children,h=u.map(p=>p===d?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:p);return s.jsx(t,{...o,ref:a,children:b.isValidElement(c)?b.cloneElement(c,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function qoe(e){const t=b.forwardRef((r,n)=>{const{children:a,...i}=r;if(b.isValidElement(a)){const o=Woe(a),u=Hoe(i,a.props);return a.type!==b.Fragment&&(u.ref=n?Mn(n,o):o),b.cloneElement(a,u)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Uoe=Symbol("radix.slottable");function Voe(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Uoe}function Hoe(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function Woe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Goe=DS[" useInsertionEffect ".trim().toString()]||Qt;function Vo({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,i,o]=Koe({defaultProp:t,onChange:r}),u=e!==void 0,d=u?e:a;{const h=b.useRef(e!==void 0);b.useEffect(()=>{const p=h.current;p!==u&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${u?"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.`),h.current=u},[u,n])}const c=b.useCallback(h=>{if(u){const p=Xoe(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[u,e,i,o]);return[d,c]}function Koe({defaultProp:e,onChange:t}){const[r,n]=b.useState(e),a=b.useRef(r),i=b.useRef(t);return Goe(()=>{i.current=t},[t]),b.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,n,i]}function Xoe(e){return typeof e=="function"}function c_(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var F4=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"}),Yoe="VisuallyHidden",z4=b.forwardRef((e,t)=>s.jsx(Ye.span,{...e,ref:t,style:{...F4,...e.style}}));z4.displayName=Yoe;var Joe=z4,Qoe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rs=new WeakMap,Zf=new WeakMap,eh={},P1=0,q4=function(e){return e&&(e.host||q4(e.parentNode))},Zoe=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=q4(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},ese=function(e,t,r,n){var a=Zoe(t,Array.isArray(e)?e:[e]);eh[r]||(eh[r]=new WeakMap);var i=eh[r],o=[],u=new Set,d=new Set(a),c=function(p){!p||u.has(p)||(u.add(p),c(p.parentNode))};a.forEach(c);var h=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(m){if(u.has(m))h(m);else try{var v=m.getAttribute(n),x=v!==null&&v!=="false",y=(Rs.get(m)||0)+1,S=(i.get(m)||0)+1;Rs.set(m,y),i.set(m,S),o.push(m),y===1&&x&&Zf.set(m,!0),S===1&&m.setAttribute(r,"true"),x||m.setAttribute(n,"true")}catch(j){console.error("aria-hidden: cannot operate on ",m,j)}})};return h(t),u.clear(),P1++,function(){o.forEach(function(p){var m=Rs.get(p)-1,v=i.get(p)-1;Rs.set(p,m),i.set(p,v),m||(Zf.has(p)||p.removeAttribute(n),Zf.delete(p)),v||p.removeAttribute(r)}),P1--,P1||(Rs=new WeakMap,Rs=new WeakMap,Zf=new WeakMap,eh={})}},u_=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=Qoe(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),ese(n,a,r,"aria-hidden")):function(){return null}},ga=function(){return ga=Object.assign||function(t){for(var r,n=1,a=arguments.length;n"u")return vse;var t=yse(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},bse=W4(),Zs="data-scroll-locked",wse=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,u=e.gap;return r===void 0&&(r="margin"),` + .`.concat(rse,` { + overflow: hidden `).concat(n,`; + padding-right: `).concat(u,"px ").concat(n,`; + } + body[`).concat(Zs,`] { + overflow: hidden `).concat(n,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` + padding-left: `.concat(a,`px; + padding-top: `).concat(i,`px; + padding-right: `).concat(o,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(n,`; + `),r==="padding"&&"padding-right: ".concat(u,"px ").concat(n,";")].filter(Boolean).join(""),` + } + + .`).concat(qh,` { + right: `).concat(u,"px ").concat(n,`; + } + + .`).concat(Uh,` { + margin-right: `).concat(u,"px ").concat(n,`; + } + + .`).concat(qh," .").concat(qh,` { + right: 0 `).concat(n,`; + } + + .`).concat(Uh," .").concat(Uh,` { + margin-right: 0 `).concat(n,`; + } + + body[`).concat(Zs,`] { + `).concat(nse,": ").concat(u,`px; + } +`)},$R=function(){var e=parseInt(document.body.getAttribute(Zs)||"0",10);return isFinite(e)?e:0},Sse=function(){b.useEffect(function(){return document.body.setAttribute(Zs,($R()+1).toString()),function(){var e=$R()-1;e<=0?document.body.removeAttribute(Zs):document.body.setAttribute(Zs,e.toString())}},[])},jse=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;Sse();var i=b.useMemo(function(){return xse(a)},[a]);return b.createElement(bse,{styles:wse(i,!t,a,r?"":"!important")})},bS=!1;if(typeof window<"u")try{var th=Object.defineProperty({},"passive",{get:function(){return bS=!0,!0}});window.addEventListener("test",th,th),window.removeEventListener("test",th,th)}catch{bS=!1}var Is=bS?{passive:!1}:!1,_se=function(e){return e.tagName==="TEXTAREA"},G4=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!_se(e)&&r[t]==="visible")},Nse=function(e){return G4(e,"overflowY")},Cse=function(e){return G4(e,"overflowX")},BR=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=K4(e,n);if(a){var i=X4(e,n),o=i[1],u=i[2];if(o>u)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Ese=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Ose=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},K4=function(e,t){return e==="v"?Nse(t):Cse(t)},X4=function(e,t){return e==="v"?Ese(t):Ose(t)},Pse=function(e,t){return e==="h"&&t==="rtl"?-1:1},Ase=function(e,t,r,n,a){var i=Pse(e,window.getComputedStyle(t).direction),o=i*n,u=r.target,d=t.contains(u),c=!1,h=o>0,p=0,m=0;do{if(!u)break;var v=X4(e,u),x=v[0],y=v[1],S=v[2],j=y-S-i*x;(x||j)&&K4(e,u)&&(p+=j,m+=x);var N=u.parentNode;u=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(h&&Math.abs(p)<1||!h&&Math.abs(m)<1)&&(c=!0),c},rh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},FR=function(e){return[e.deltaX,e.deltaY]},zR=function(e){return e&&"current"in e?e.current:e},Tse=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kse=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},Rse=0,Ms=[];function Ise(e){var t=b.useRef([]),r=b.useRef([0,0]),n=b.useRef(),a=b.useState(Rse++)[0],i=b.useState(W4)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var y=tse([e.lockRef.current],(e.shards||[]).map(zR),!0).filter(Boolean);return y.forEach(function(S){return S.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),y.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=b.useCallback(function(y,S){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var j=rh(y),N=r.current,E="deltaX"in y?y.deltaX:N[0]-j[0],A="deltaY"in y?y.deltaY:N[1]-j[1],C,O=y.target,T=Math.abs(E)>Math.abs(A)?"h":"v";if("touches"in y&&T==="h"&&O.type==="range")return!1;var R=window.getSelection(),L=R&&R.anchorNode,q=L?L===O||L.contains(O):!1;if(q)return!1;var F=BR(T,O);if(!F)return!0;if(F?C=T:(C=T==="v"?"h":"v",F=BR(T,O)),!F)return!1;if(!n.current&&"changedTouches"in y&&(E||A)&&(n.current=C),!C)return!0;var B=n.current||C;return Ase(B,S,y,B==="h"?E:A)},[]),d=b.useCallback(function(y){var S=y;if(!(!Ms.length||Ms[Ms.length-1]!==i)){var j="deltaY"in S?FR(S):rh(S),N=t.current.filter(function(C){return C.name===S.type&&(C.target===S.target||S.target===C.shadowParent)&&Tse(C.delta,j)})[0];if(N&&N.should){S.cancelable&&S.preventDefault();return}if(!N){var E=(o.current.shards||[]).map(zR).filter(Boolean).filter(function(C){return C.contains(S.target)}),A=E.length>0?u(S,E[0]):!o.current.noIsolation;A&&S.cancelable&&S.preventDefault()}}},[]),c=b.useCallback(function(y,S,j,N){var E={name:y,delta:S,target:j,should:N,shadowParent:Mse(j)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(A){return A!==E})},1)},[]),h=b.useCallback(function(y){r.current=rh(y),n.current=void 0},[]),p=b.useCallback(function(y){c(y.type,FR(y),y.target,u(y,e.lockRef.current))},[]),m=b.useCallback(function(y){c(y.type,rh(y),y.target,u(y,e.lockRef.current))},[]);b.useEffect(function(){return Ms.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",d,Is),document.addEventListener("touchmove",d,Is),document.addEventListener("touchstart",h,Is),function(){Ms=Ms.filter(function(y){return y!==i}),document.removeEventListener("wheel",d,Is),document.removeEventListener("touchmove",d,Is),document.removeEventListener("touchstart",h,Is)}},[]);var v=e.removeScrollBar,x=e.inert;return b.createElement(b.Fragment,null,x?b.createElement(i,{styles:kse(a)}):null,v?b.createElement(jse,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Mse(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Dse=use(H4,Ise);var rg=b.forwardRef(function(e,t){return b.createElement(tg,ga({},e,{ref:t,sideCar:Dse}))});rg.classNames=tg.classNames;var Lse=[" ","Enter","ArrowUp","ArrowDown"],$se=[" ","Enter"],Ho="Select",[ng,ag,Bse]=nie(Ho),[Xl]=li(Ho,[Bse,Kl]),ig=Kl(),[Fse,ro]=Xl(Ho),[zse,qse]=Xl(Ho),Y4=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:a,onOpenChange:i,value:o,defaultValue:u,onValueChange:d,dir:c,name:h,autoComplete:p,disabled:m,required:v,form:x}=e,y=ig(t),[S,j]=b.useState(null),[N,E]=b.useState(null),[A,C]=b.useState(!1),O=CM(c),[T,R]=Vo({prop:n,defaultProp:a??!1,onChange:i,caller:Ho}),[L,q]=Vo({prop:o,defaultProp:u,onChange:d,caller:Ho}),F=b.useRef(null),B=S?x||!!S.closest("form"):!0,[V,G]=b.useState(new Set),W=Array.from(V).map(H=>H.props.value).join(";");return s.jsx(o_,{...y,children:s.jsxs(Fse,{required:v,scope:t,trigger:S,onTriggerChange:j,valueNode:N,onValueNodeChange:E,valueNodeHasChildren:A,onValueNodeHasChildrenChange:C,contentId:Kr(),value:L,onValueChange:q,open:T,onOpenChange:R,dir:O,triggerPointerDownPosRef:F,disabled:m,children:[s.jsx(ng.Provider,{scope:t,children:s.jsx(zse,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(H=>{G(U=>new Set(U).add(H))},[]),onNativeOptionRemove:b.useCallback(H=>{G(U=>{const $=new Set(U);return $.delete(H),$})},[]),children:r})}),B?s.jsxs(y3,{"aria-hidden":!0,required:v,tabIndex:-1,name:h,autoComplete:p,value:L,onChange:H=>q(H.target.value),disabled:m,form:x,children:[L===void 0?s.jsx("option",{value:""}):null,Array.from(V)]},W):null]})})};Y4.displayName=Ho;var J4="SelectTrigger",Q4=b.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...a}=e,i=ig(r),o=ro(J4,r),u=o.disabled||n,d=it(t,o.onTriggerChange),c=ag(r),h=b.useRef("touch"),[p,m,v]=b3(y=>{const S=c().filter(E=>!E.disabled),j=S.find(E=>E.value===o.value),N=w3(S,y,j);N!==void 0&&o.onValueChange(N.value)}),x=y=>{u||(o.onOpenChange(!0),v()),y&&(o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return s.jsx(eg,{asChild:!0,...i,children:s.jsx(Ye.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":x3(o.value)?"":void 0,...a,ref:d,onClick:Je(a.onClick,y=>{y.currentTarget.focus(),h.current!=="mouse"&&x(y)}),onPointerDown:Je(a.onPointerDown,y=>{h.current=y.pointerType;const S=y.target;S.hasPointerCapture(y.pointerId)&&S.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(x(y),y.preventDefault())}),onKeyDown:Je(a.onKeyDown,y=>{const S=p.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&m(y.key),!(S&&y.key===" ")&&Lse.includes(y.key)&&(x(),y.preventDefault())})})})});Q4.displayName=J4;var Z4="SelectValue",e3=b.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,children:i,placeholder:o="",...u}=e,d=ro(Z4,r),{onValueNodeHasChildrenChange:c}=d,h=i!==void 0,p=it(t,d.onValueNodeChange);return Qt(()=>{c(h)},[c,h]),s.jsx(Ye.span,{...u,ref:p,style:{pointerEvents:"none"},children:x3(d.value)?s.jsx(s.Fragment,{children:o}):i})});e3.displayName=Z4;var Use="SelectIcon",t3=b.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...a}=e;return s.jsx(Ye.span,{"aria-hidden":!0,...a,ref:t,children:n||"▼"})});t3.displayName=Use;var Vse="SelectPortal",r3=e=>s.jsx(cd,{asChild:!0,...e});r3.displayName=Vse;var Wo="SelectContent",n3=b.forwardRef((e,t)=>{const r=ro(Wo,e.__scopeSelect),[n,a]=b.useState();if(Qt(()=>{a(new DocumentFragment)},[]),!r.open){const i=n;return i?Ju.createPortal(s.jsx(a3,{scope:e.__scopeSelect,children:s.jsx(ng.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(i3,{...e,ref:t})});n3.displayName=Wo;var Xn=10,[a3,no]=Xl(Wo),Hse="SelectContentImpl",Wse=zoe("SelectContent.RemoveScroll"),i3=b.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:u,sideOffset:d,align:c,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:v,sticky:x,hideWhenDetached:y,avoidCollisions:S,...j}=e,N=ro(Wo,r),[E,A]=b.useState(null),[C,O]=b.useState(null),T=it(t,X=>A(X)),[R,L]=b.useState(null),[q,F]=b.useState(null),B=ag(r),[V,G]=b.useState(!1),W=b.useRef(!1);b.useEffect(()=>{if(E)return u_(E)},[E]),Yj();const H=b.useCallback(X=>{const[Y,...ee]=B().map(K=>K.ref.current),[le]=ee.slice(-1),pe=document.activeElement;for(const K of X)if(K===pe||(K?.scrollIntoView({block:"nearest"}),K===Y&&C&&(C.scrollTop=0),K===le&&C&&(C.scrollTop=C.scrollHeight),K?.focus(),document.activeElement!==pe))return},[B,C]),U=b.useCallback(()=>H([R,E]),[H,R,E]);b.useEffect(()=>{V&&U()},[V,U]);const{onOpenChange:$,triggerPointerDownPosRef:Z}=N;b.useEffect(()=>{if(E){let X={x:0,y:0};const Y=le=>{X={x:Math.abs(Math.round(le.pageX)-(Z.current?.x??0)),y:Math.abs(Math.round(le.pageY)-(Z.current?.y??0))}},ee=le=>{X.x<=10&&X.y<=10?le.preventDefault():E.contains(le.target)||$(!1),document.removeEventListener("pointermove",Y),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",Y),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Y),document.removeEventListener("pointerup",ee,{capture:!0})}}},[E,$,Z]),b.useEffect(()=>{const X=()=>$(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[$]);const[k,I]=b3(X=>{const Y=B().filter(pe=>!pe.disabled),ee=Y.find(pe=>pe.ref.current===document.activeElement),le=w3(Y,X,ee);le&&setTimeout(()=>le.ref.current.focus())}),D=b.useCallback((X,Y,ee)=>{const le=!W.current&&!ee;(N.value!==void 0&&N.value===Y||le)&&(L(X),le&&(W.current=!0))},[N.value]),J=b.useCallback(()=>E?.focus(),[E]),ae=b.useCallback((X,Y,ee)=>{const le=!W.current&&!ee;(N.value!==void 0&&N.value===Y||le)&&F(X)},[N.value]),ie=n==="popper"?wS:o3,ne=ie===wS?{side:u,sideOffset:d,align:c,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:v,sticky:x,hideWhenDetached:y,avoidCollisions:S}:{};return s.jsx(a3,{scope:r,content:E,viewport:C,onViewportChange:O,itemRefCallback:D,selectedItem:R,onItemLeave:J,itemTextRefCallback:ae,focusSelectedItem:U,selectedItemText:q,position:n,isPositioned:V,searchRef:k,children:s.jsx(rg,{as:Wse,allowPinchZoom:!0,children:s.jsx(Xm,{asChild:!0,trapped:N.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:Je(a,X=>{N.trigger?.focus({preventScroll:!0}),X.preventDefault()}),children:s.jsx(sd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(ie,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:X=>X.preventDefault(),...j,...ne,onPlaced:()=>G(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Je(j.onKeyDown,X=>{const Y=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!Y&&X.key.length===1&&I(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let le=B().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(X.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const pe=X.target,K=le.indexOf(pe);le=le.slice(K+1)}setTimeout(()=>H(le)),X.preventDefault()}})})})})})})});i3.displayName=Hse;var Gse="SelectItemAlignedPosition",o3=b.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...a}=e,i=ro(Wo,r),o=no(Wo,r),[u,d]=b.useState(null),[c,h]=b.useState(null),p=it(t,T=>h(T)),m=ag(r),v=b.useRef(!1),x=b.useRef(!0),{viewport:y,selectedItem:S,selectedItemText:j,focusSelectedItem:N}=o,E=b.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&c&&y&&S&&j){const T=i.trigger.getBoundingClientRect(),R=c.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),q=j.getBoundingClientRect();if(i.dir!=="rtl"){const pe=q.left-R.left,K=L.left-pe,je=T.left-K,Ce=T.width+je,Le=Math.max(Ce,R.width),De=window.innerWidth-Xn,tt=K1(K,[Xn,Math.max(Xn,De-Le)]);u.style.minWidth=Ce+"px",u.style.left=tt+"px"}else{const pe=R.right-q.right,K=window.innerWidth-L.right-pe,je=window.innerWidth-T.right-K,Ce=T.width+je,Le=Math.max(Ce,R.width),De=window.innerWidth-Xn,tt=K1(K,[Xn,Math.max(Xn,De-Le)]);u.style.minWidth=Ce+"px",u.style.right=tt+"px"}const F=m(),B=window.innerHeight-Xn*2,V=y.scrollHeight,G=window.getComputedStyle(c),W=parseInt(G.borderTopWidth,10),H=parseInt(G.paddingTop,10),U=parseInt(G.borderBottomWidth,10),$=parseInt(G.paddingBottom,10),Z=W+H+V+$+U,k=Math.min(S.offsetHeight*5,Z),I=window.getComputedStyle(y),D=parseInt(I.paddingTop,10),J=parseInt(I.paddingBottom,10),ae=T.top+T.height/2-Xn,ie=B-ae,ne=S.offsetHeight/2,X=S.offsetTop+ne,Y=W+H+X,ee=Z-Y;if(Y<=ae){const pe=F.length>0&&S===F[F.length-1].ref.current;u.style.bottom="0px";const K=c.clientHeight-y.offsetTop-y.offsetHeight,je=Math.max(ie,ne+(pe?J:0)+K+U),Ce=Y+je;u.style.height=Ce+"px"}else{const pe=F.length>0&&S===F[0].ref.current;u.style.top="0px";const je=Math.max(ae,W+y.offsetTop+(pe?D:0)+ne)+ee;u.style.height=je+"px",y.scrollTop=Y-ae+y.offsetTop}u.style.margin=`${Xn}px 0`,u.style.minHeight=k+"px",u.style.maxHeight=B+"px",n?.(),requestAnimationFrame(()=>v.current=!0)}},[m,i.trigger,i.valueNode,u,c,y,S,j,i.dir,n]);Qt(()=>E(),[E]);const[A,C]=b.useState();Qt(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const O=b.useCallback(T=>{T&&x.current===!0&&(E(),N?.(),x.current=!1)},[E,N]);return s.jsx(Xse,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:O,children:s.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:s.jsx(Ye.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});o3.displayName=Gse;var Kse="SelectPopperPosition",wS=b.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:a=Xn,...i}=e,o=ig(r);return s.jsx(s_,{...o,...i,ref:t,align:n,collisionPadding:a,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)"}})});wS.displayName=Kse;var[Xse,d_]=Xl(Wo,{}),SS="SelectViewport",s3=b.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...a}=e,i=no(SS,r),o=d_(SS,r),u=it(t,i.onViewportChange),d=b.useRef(0);return s.jsxs(s.Fragment,{children:[s.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:n}),s.jsx(ng.Slot,{scope:r,children:s.jsx(Ye.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Je(a.onScroll,c=>{const h=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=o;if(m?.current&&p){const v=Math.abs(d.current-h.scrollTop);if(v>0){const x=window.innerHeight-Xn*2,y=parseFloat(p.style.minHeight),S=parseFloat(p.style.height),j=Math.max(y,S);if(j0?A:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});s3.displayName=SS;var l3="SelectGroup",[Yse,Jse]=Xl(l3),Qse=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=Kr();return s.jsx(Yse,{scope:r,id:a,children:s.jsx(Ye.div,{role:"group","aria-labelledby":a,...n,ref:t})})});Qse.displayName=l3;var c3="SelectLabel",Zse=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=Jse(c3,r);return s.jsx(Ye.div,{id:a.id,...n,ref:t})});Zse.displayName=c3;var am="SelectItem",[ele,u3]=Xl(am),d3=b.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:a=!1,textValue:i,...o}=e,u=ro(am,r),d=no(am,r),c=u.value===n,[h,p]=b.useState(i??""),[m,v]=b.useState(!1),x=it(t,N=>d.itemRefCallback?.(N,n,a)),y=Kr(),S=b.useRef("touch"),j=()=>{a||(u.onValueChange(n),u.onOpenChange(!1))};if(n==="")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 s.jsx(ele,{scope:r,value:n,disabled:a,textId:y,isSelected:c,onItemTextChange:b.useCallback(N=>{p(E=>E||(N?.textContent??"").trim())},[]),children:s.jsx(ng.ItemSlot,{scope:r,value:n,disabled:a,textValue:h,children:s.jsx(Ye.div,{role:"option","aria-labelledby":y,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:x,onFocus:Je(o.onFocus,()=>v(!0)),onBlur:Je(o.onBlur,()=>v(!1)),onClick:Je(o.onClick,()=>{S.current!=="mouse"&&j()}),onPointerUp:Je(o.onPointerUp,()=>{S.current==="mouse"&&j()}),onPointerDown:Je(o.onPointerDown,N=>{S.current=N.pointerType}),onPointerMove:Je(o.onPointerMove,N=>{S.current=N.pointerType,a?d.onItemLeave?.():S.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Je(o.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Je(o.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||($se.includes(N.key)&&j(),N.key===" "&&N.preventDefault())})})})})});d3.displayName=am;var tu="SelectItemText",f3=b.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,...i}=e,o=ro(tu,r),u=no(tu,r),d=u3(tu,r),c=qse(tu,r),[h,p]=b.useState(null),m=it(t,j=>p(j),d.onItemTextChange,j=>u.itemTextRefCallback?.(j,d.value,d.disabled)),v=h?.textContent,x=b.useMemo(()=>s.jsx("option",{value:d.value,disabled:d.disabled,children:v},d.value),[d.disabled,d.value,v]),{onNativeOptionAdd:y,onNativeOptionRemove:S}=c;return Qt(()=>(y(x),()=>S(x)),[y,S,x]),s.jsxs(s.Fragment,{children:[s.jsx(Ye.span,{id:d.textId,...i,ref:m}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ju.createPortal(i.children,o.valueNode):null]})});f3.displayName=tu;var h3="SelectItemIndicator",p3=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return u3(h3,r).isSelected?s.jsx(Ye.span,{"aria-hidden":!0,...n,ref:t}):null});p3.displayName=h3;var jS="SelectScrollUpButton",m3=b.forwardRef((e,t)=>{const r=no(jS,e.__scopeSelect),n=d_(jS,e.__scopeSelect),[a,i]=b.useState(!1),o=it(t,n.onScrollButtonChange);return Qt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=d.scrollTop>0;i(c)};const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),a?s.jsx(v3,{...e,ref:o,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});m3.displayName=jS;var _S="SelectScrollDownButton",g3=b.forwardRef((e,t)=>{const r=no(_S,e.__scopeSelect),n=d_(_S,e.__scopeSelect),[a,i]=b.useState(!1),o=it(t,n.onScrollButtonChange);return Qt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),a?s.jsx(v3,{...e,ref:o,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});g3.displayName=_S;var v3=b.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...a}=e,i=no("SelectScrollButton",r),o=b.useRef(null),u=ag(r),d=b.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return b.useEffect(()=>()=>d(),[d]),Qt(()=>{u().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),s.jsx(Ye.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Je(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:Je(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:Je(a.onPointerLeave,()=>{d()})})}),tle="SelectSeparator",rle=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return s.jsx(Ye.div,{"aria-hidden":!0,...n,ref:t})});rle.displayName=tle;var NS="SelectArrow",nle=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=ig(r),i=ro(NS,r),o=no(NS,r);return i.open&&o.position==="popper"?s.jsx(l_,{...a,...n,ref:t}):null});nle.displayName=NS;var ale="SelectBubbleInput",y3=b.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const a=b.useRef(null),i=it(n,a),o=c_(t);return b.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("change",{bubbles:!0});h.call(u,t),u.dispatchEvent(p)}},[o,t]),s.jsx(Ye.select,{...r,style:{...F4,...r.style},ref:i,defaultValue:t})});y3.displayName=ale;function x3(e){return e===""||e===void 0}function b3(e){const t=kr(e),r=b.useRef(""),n=b.useRef(0),a=b.useCallback(o=>{const u=r.current+o;t(u),(function d(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),i=b.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,a,i]}function w3(e,t,r){const a=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=ile(e,Math.max(i,0));a.length===1&&(o=o.filter(c=>c!==r));const d=o.find(c=>c.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==r?d:void 0}function ile(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var ole=Y4,sle=Q4,lle=e3,cle=t3,ule=r3,dle=n3,fle=s3,hle=d3,ple=f3,mle=p3,gle=m3,vle=g3;function We({...e}){return s.jsx(ole,{"data-slot":"select",...e})}function Ge({...e}){return s.jsx(lle,{"data-slot":"select-value",...e})}function Ke({className:e,size:t="default",children:r,...n}){return s.jsxs(sle,{"data-slot":"select-trigger","data-size":t,className:Ae("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-input-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[r,s.jsx(cle,{asChild:!0,children:s.jsx(el,{className:"size-4 opacity-50"})})]})}function Xe({className:e,children:t,position:r="popper",...n}){return s.jsx(ule,{children:s.jsxs(dle,{"data-slot":"select-content",className:Ae("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="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:r,...n,children:[s.jsx(yle,{}),s.jsx(fle,{className:Ae("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),s.jsx(xle,{})]})})}function _e({className:e,children:t,...r}){return s.jsxs(hle,{"data-slot":"select-item",className:Ae("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[s.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:s.jsx(mle,{children:s.jsx(iM,{className:"size-4"})})}),s.jsx(ple,{children:t})]})}function yle({className:e,...t}){return s.jsx(gle,{"data-slot":"select-scroll-up-button",className:Ae("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(pz,{className:"size-4"})})}function xle({className:e,...t}){return s.jsx(vle,{"data-slot":"select-scroll-down-button",className:Ae("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(el,{className:"size-4"})})}function ble(e){const t=wle(e),r=b.forwardRef((n,a)=>{const{children:i,...o}=n,u=b.Children.toArray(i),d=u.find(jle);if(d){const c=d.props.children,h=u.map(p=>p===d?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:p);return s.jsx(t,{...o,ref:a,children:b.isValidElement(c)?b.cloneElement(c,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function wle(e){const t=b.forwardRef((r,n)=>{const{children:a,...i}=r;if(b.isValidElement(a)){const o=Nle(a),u=_le(i,a.props);return a.type!==b.Fragment&&(u.ref=n?Mn(n,o):o),b.cloneElement(a,u)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Sle=Symbol("radix.slottable");function jle(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Sle}function _le(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function Nle(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var og="Dialog",[S3]=li(og),[Cle,sa]=S3(og),j3=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,u=b.useRef(null),d=b.useRef(null),[c,h]=Vo({prop:n,defaultProp:a??!1,onChange:i,caller:og});return s.jsx(Cle,{scope:t,triggerRef:u,contentRef:d,contentId:Kr(),titleId:Kr(),descriptionId:Kr(),open:c,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(p=>!p),[h]),modal:o,children:r})};j3.displayName=og;var _3="DialogTrigger",Ele=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=sa(_3,r),i=it(t,a.triggerRef);return s.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":p_(a.open),...n,ref:i,onClick:Je(e.onClick,a.onOpenToggle)})});Ele.displayName=_3;var f_="DialogPortal",[Ole,N3]=S3(f_,{forceMount:void 0}),C3=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,i=sa(f_,t);return s.jsx(Ole,{scope:t,forceMount:r,children:b.Children.map(n,o=>s.jsx(mn,{present:r||i.open,children:s.jsx(cd,{asChild:!0,container:a,children:o})}))})};C3.displayName=f_;var im="DialogOverlay",E3=b.forwardRef((e,t)=>{const r=N3(im,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=sa(im,e.__scopeDialog);return i.modal?s.jsx(mn,{present:n||i.open,children:s.jsx(Ale,{...a,ref:t})}):null});E3.displayName=im;var Ple=ble("DialogOverlay.RemoveScroll"),Ale=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=sa(im,r);return s.jsx(rg,{as:Ple,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(Ye.div,{"data-state":p_(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Go="DialogContent",O3=b.forwardRef((e,t)=>{const r=N3(Go,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=sa(Go,e.__scopeDialog);return s.jsx(mn,{present:n||i.open,children:i.modal?s.jsx(Tle,{...a,ref:t}):s.jsx(kle,{...a,ref:t})})});O3.displayName=Go;var Tle=b.forwardRef((e,t)=>{const r=sa(Go,e.__scopeDialog),n=b.useRef(null),a=it(t,r.contentRef,n);return b.useEffect(()=>{const i=n.current;if(i)return u_(i)},[]),s.jsx(P3,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Je(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Je(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,u=o.button===0&&o.ctrlKey===!0;(o.button===2||u)&&i.preventDefault()}),onFocusOutside:Je(e.onFocusOutside,i=>i.preventDefault())})}),kle=b.forwardRef((e,t)=>{const r=sa(Go,e.__scopeDialog),n=b.useRef(!1),a=b.useRef(!1);return s.jsx(P3,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;r.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),P3=b.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,u=sa(Go,r),d=b.useRef(null),c=it(t,d);return Yj(),s.jsxs(s.Fragment,{children:[s.jsx(Xm,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(sd,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":p_(u.open),...o,ref:c,onDismiss:()=>u.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(Rle,{titleId:u.titleId}),s.jsx(Mle,{contentRef:d,descriptionId:u.descriptionId})]})]})}),h_="DialogTitle",A3=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=sa(h_,r);return s.jsx(Ye.h2,{id:a.titleId,...n,ref:t})});A3.displayName=h_;var T3="DialogDescription",k3=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=sa(T3,r);return s.jsx(Ye.p,{id:a.descriptionId,...n,ref:t})});k3.displayName=T3;var R3="DialogClose",I3=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=sa(R3,r);return s.jsx(Ye.button,{type:"button",...n,ref:t,onClick:Je(e.onClick,()=>a.onOpenChange(!1))})});I3.displayName=R3;function p_(e){return e?"open":"closed"}var M3="DialogTitleWarning",[qhe,D3]=yq(M3,{contentName:Go,titleName:h_,docsSlug:"dialog"}),Rle=({titleId:e})=>{const t=D3(M3),r=`\`${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 b.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Ile="DialogDescriptionWarning",Mle=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${D3(Ile).contentName}}.`;return b.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},L3=j3,$3=C3,B3=E3,F3=O3,Dle=A3,Lle=k3,$le=I3;function vt({...e}){return s.jsx(L3,{"data-slot":"dialog",...e})}function Ble({...e}){return s.jsx($3,{"data-slot":"dialog-portal",...e})}const z3=b.forwardRef(({className:e,...t},r)=>s.jsx(B3,{ref:r,"data-slot":"dialog-overlay",className:Ae("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t}));z3.displayName="DialogOverlay";const mt=b.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(Ble,{"data-slot":"dialog-portal",children:[s.jsx(z3,{}),s.jsxs(F3,{ref:n,"data-slot":"dialog-content",className:Ae("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,s.jsxs($le,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[s.jsx(ko,{}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));mt.displayName="DialogContent";function yt({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-header",className:Ae("flex flex-col gap-2 text-center sm:text-left",e),...t})}function wt({className:e,...t}){return s.jsx("div",{"data-slot":"dialog-footer",className:Ae("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function xt({className:e,...t}){return s.jsx(Dle,{"data-slot":"dialog-title",className:Ae("text-lg leading-none font-semibold",e),...t})}function Pt({className:e,...t}){return s.jsx(Lle,{"data-slot":"dialog-description",className:Ae("text-muted-foreground text-sm",e),...t})}var Fle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],zle=Fle.reduce((e,t)=>{const r=US(`Primitive.${t}`),n=b.forwardRef((a,i)=>{const{asChild:o,...u}=a,d=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(d,{...u,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),qle="Label",q3=b.forwardRef((e,t)=>s.jsx(zle.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));q3.displayName=qle;var Ule=q3;function ue({className:e,...t}){return s.jsx(Ule,{"data-slot":"label",className:Ae("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var sg="Switch",[Vle]=li(sg),[Hle,Wle]=Vle(sg),U3=b.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:i,required:o,disabled:u,value:d="on",onCheckedChange:c,form:h,...p}=e,[m,v]=b.useState(null),x=it(t,E=>v(E)),y=b.useRef(!1),S=m?h||!!m.closest("form"):!0,[j,N]=Vo({prop:a,defaultProp:i??!1,onChange:c,caller:sg});return s.jsxs(Hle,{scope:r,checked:j,disabled:u,children:[s.jsx(Ye.button,{type:"button",role:"switch","aria-checked":j,"aria-required":o,"data-state":G3(j),"data-disabled":u?"":void 0,disabled:u,value:d,...p,ref:x,onClick:Je(e.onClick,E=>{N(A=>!A),S&&(y.current=E.isPropagationStopped(),y.current||E.stopPropagation())})}),S&&s.jsx(W3,{control:m,bubbles:!y.current,name:n,value:d,checked:j,required:o,disabled:u,form:h,style:{transform:"translateX(-100%)"}})]})});U3.displayName=sg;var V3="SwitchThumb",H3=b.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,a=Wle(V3,r);return s.jsx(Ye.span,{"data-state":G3(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});H3.displayName=V3;var Gle="SwitchBubbleInput",W3=b.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...a},i)=>{const o=b.useRef(null),u=it(o,i),d=c_(r),c=n_(t);return b.useEffect(()=>{const h=o.current;if(!h)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==r&&v){const x=new Event("click",{bubbles:n});v.call(h,r),h.dispatchEvent(x)}},[d,r,n]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:u,style:{...a.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});W3.displayName=Gle;function G3(e){return e?"checked":"unchecked"}var Kle=U3,Xle=H3;function Gt({className:e,...t}){return s.jsx(Kle,{"data-slot":"switch",className:Ae("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(Xle,{"data-slot":"switch-thumb",className:Ae("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Yle(e){const t=Jle(e),r=b.forwardRef((n,a)=>{const{children:i,...o}=n,u=b.Children.toArray(i),d=u.find(Zle);if(d){const c=d.props.children,h=u.map(p=>p===d?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:p);return s.jsx(t,{...o,ref:a,children:b.isValidElement(c)?b.cloneElement(c,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function Jle(e){const t=b.forwardRef((r,n)=>{const{children:a,...i}=r;if(b.isValidElement(a)){const o=tce(a),u=ece(i,a.props);return a.type!==b.Fragment&&(u.ref=n?Mn(n,o):o),b.cloneElement(a,u)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Qle=Symbol("radix.slottable");function Zle(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Qle}function ece(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function tce(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var lg="Popover",[K3]=li(lg,[Kl]),ud=Kl(),[rce,ao]=K3(lg),X3=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,u=ud(t),d=b.useRef(null),[c,h]=b.useState(!1),[p,m]=Vo({prop:n,defaultProp:a??!1,onChange:i,caller:lg});return s.jsx(o_,{...u,children:s.jsx(rce,{scope:t,contentId:Kr(),triggerRef:d,open:p,onOpenChange:m,onOpenToggle:b.useCallback(()=>m(v=>!v),[m]),hasCustomAnchor:c,onCustomAnchorAdd:b.useCallback(()=>h(!0),[]),onCustomAnchorRemove:b.useCallback(()=>h(!1),[]),modal:o,children:r})})};X3.displayName=lg;var Y3="PopoverAnchor",nce=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=ao(Y3,r),i=ud(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:u}=a;return b.useEffect(()=>(o(),()=>u()),[o,u]),s.jsx(eg,{...i,...n,ref:t})});nce.displayName=Y3;var J3="PopoverTrigger",Q3=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=ao(J3,r),i=ud(r),o=it(t,a.triggerRef),u=s.jsx(Ye.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":n5(a.open),...n,ref:o,onClick:Je(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:s.jsx(eg,{asChild:!0,...i,children:u})});Q3.displayName=J3;var m_="PopoverPortal",[ace,ice]=K3(m_,{forceMount:void 0}),Z3=e=>{const{__scopePopover:t,forceMount:r,children:n,container:a}=e,i=ao(m_,t);return s.jsx(ace,{scope:t,forceMount:r,children:s.jsx(mn,{present:r||i.open,children:s.jsx(cd,{asChild:!0,container:a,children:n})})})};Z3.displayName=m_;var Tl="PopoverContent",e5=b.forwardRef((e,t)=>{const r=ice(Tl,e.__scopePopover),{forceMount:n=r.forceMount,...a}=e,i=ao(Tl,e.__scopePopover);return s.jsx(mn,{present:n||i.open,children:i.modal?s.jsx(sce,{...a,ref:t}):s.jsx(lce,{...a,ref:t})})});e5.displayName=Tl;var oce=Yle("PopoverContent.RemoveScroll"),sce=b.forwardRef((e,t)=>{const r=ao(Tl,e.__scopePopover),n=b.useRef(null),a=it(t,n),i=b.useRef(!1);return b.useEffect(()=>{const o=n.current;if(o)return u_(o)},[]),s.jsx(rg,{as:oce,allowPinchZoom:!0,children:s.jsx(t5,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Je(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Je(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,c=u.button===2||d;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Je(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),lce=b.forwardRef((e,t)=>{const r=ao(Tl,e.__scopePopover),n=b.useRef(!1),a=b.useRef(!1);return s.jsx(t5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;r.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),t5=b.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:h,...p}=e,m=ao(Tl,r),v=ud(r);return Yj(),s.jsx(Xm,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(sd,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:s.jsx(s_,{"data-state":n5(m.open),role:"dialog",id:m.contentId,...v,...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)"}})})})}),r5="PopoverClose",cce=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=ao(r5,r);return s.jsx(Ye.button,{type:"button",...n,ref:t,onClick:Je(e.onClick,()=>a.onOpenChange(!1))})});cce.displayName=r5;var uce="PopoverArrow",dce=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=ud(r);return s.jsx(l_,{...a,...n,ref:t})});dce.displayName=uce;function n5(e){return e?"open":"closed"}var fce=X3,hce=Q3,pce=Z3,mce=e5;function Ta({...e}){return s.jsx(fce,{"data-slot":"popover",...e})}function ka({...e}){return s.jsx(hce,{"data-slot":"popover-trigger",...e})}function Ra({className:e,align:t="center",sideOffset:r=4,...n}){return s.jsx(pce,{children:s.jsx(mce,{"data-slot":"popover-content",align:t,sideOffset:r,className:Ae("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}var cg="Checkbox",[gce]=li(cg),[vce,g_]=gce(cg);function yce(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:a,disabled:i,form:o,name:u,onCheckedChange:d,required:c,value:h="on",internal_do_not_use_render:p}=e,[m,v]=Vo({prop:r,defaultProp:a??!1,onChange:d,caller:cg}),[x,y]=b.useState(null),[S,j]=b.useState(null),N=b.useRef(!1),E=x?!!o||!!x.closest("form"):!0,A={checked:m,disabled:i,setChecked:v,control:x,setControl:y,name:u,form:o,value:h,hasConsumerStoppedPropagationRef:N,required:c,defaultChecked:Ui(a)?!1:a,isFormControl:E,bubbleInput:S,setBubbleInput:j};return s.jsx(vce,{scope:t,...A,children:xce(p)?p(A):n})}var a5="CheckboxTrigger",i5=b.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},a)=>{const{control:i,value:o,disabled:u,checked:d,required:c,setControl:h,setChecked:p,hasConsumerStoppedPropagationRef:m,isFormControl:v,bubbleInput:x}=g_(a5,e),y=it(a,h),S=b.useRef(d);return b.useEffect(()=>{const j=i?.form;if(j){const N=()=>p(S.current);return j.addEventListener("reset",N),()=>j.removeEventListener("reset",N)}},[i,p]),s.jsx(Ye.button,{type:"button",role:"checkbox","aria-checked":Ui(d)?"mixed":d,"aria-required":c,"data-state":d5(d),"data-disabled":u?"":void 0,disabled:u,value:o,...n,ref:y,onKeyDown:Je(t,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Je(r,j=>{p(N=>Ui(N)?!0:!N),x&&v&&(m.current=j.isPropagationStopped(),m.current||j.stopPropagation())})})});i5.displayName=a5;var o5=b.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:a,defaultChecked:i,required:o,disabled:u,value:d,onCheckedChange:c,form:h,...p}=e;return s.jsx(yce,{__scopeCheckbox:r,checked:a,defaultChecked:i,disabled:u,required:o,onCheckedChange:c,name:n,form:h,value:d,internal_do_not_use_render:({isFormControl:m})=>s.jsxs(s.Fragment,{children:[s.jsx(i5,{...p,ref:t,__scopeCheckbox:r}),m&&s.jsx(u5,{__scopeCheckbox:r})]})})});o5.displayName=cg;var s5="CheckboxIndicator",l5=b.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...a}=e,i=g_(s5,r);return s.jsx(mn,{present:n||Ui(i.checked)||i.checked===!0,children:s.jsx(Ye.span,{"data-state":d5(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});l5.displayName=s5;var c5="CheckboxBubbleInput",u5=b.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:u,disabled:d,name:c,value:h,form:p,bubbleInput:m,setBubbleInput:v}=g_(c5,e),x=it(r,v),y=c_(i),S=n_(n);b.useEffect(()=>{const N=m;if(!N)return;const E=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(E,"checked").set,O=!a.current;if(y!==i&&C){const T=new Event("click",{bubbles:O});N.indeterminate=Ui(i),C.call(N,Ui(i)?!1:i),N.dispatchEvent(T)}},[m,y,i,a]);const j=b.useRef(Ui(i)?!1:i);return s.jsx(Ye.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??j.current,required:u,disabled:d,name:c,value:h,form:p,...t,tabIndex:-1,ref:x,style:{...t.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});u5.displayName=c5;function xce(e){return typeof e=="function"}function Ui(e){return e==="indeterminate"}function d5(e){return Ui(e)?"indeterminate":e?"checked":"unchecked"}function kl({className:e,...t}){return s.jsx(o5,{"data-slot":"checkbox",className:Ae("peer border bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(l5,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:s.jsx(iM,{className:"size-3.5"})})})}var qR=1,bce=.9,wce=.8,Sce=.17,R1=.1,I1=.999,jce=.9999,_ce=.99,Nce=/[\\\/_+.#"@\[\(\{&]/,Cce=/[\\\/_+.#"@\[\(\{&]/g,Ece=/[\s-]/,f5=/[\s-]/g;function CS(e,t,r,n,a,i,o){if(i===t.length)return a===e.length?qR:_ce;var u=`${a},${i}`;if(o[u]!==void 0)return o[u];for(var d=n.charAt(i),c=r.indexOf(d,a),h=0,p,m,v,x;c>=0;)p=CS(e,t,r,n,c+1,i+1,o),p>h&&(c===a?p*=qR:Nce.test(e.charAt(c-1))?(p*=wce,v=e.slice(a,c-1).match(Cce),v&&a>0&&(p*=Math.pow(I1,v.length))):Ece.test(e.charAt(c-1))?(p*=bce,x=e.slice(a,c-1).match(f5),x&&a>0&&(p*=Math.pow(I1,x.length))):(p*=Sce,a>0&&(p*=Math.pow(I1,c-a))),e.charAt(c)!==t.charAt(i)&&(p*=jce)),(pp&&(p=m*R1)),p>h&&(h=p),c=r.indexOf(d,c+1);return o[u]=h,h}function UR(e){return e.toLowerCase().replace(f5," ")}function Oce(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,CS(e,t,UR(e),UR(t),0,0,{})}var Hc='[cmdk-group=""]',M1='[cmdk-group-items=""]',Pce='[cmdk-group-heading=""]',h5='[cmdk-item=""]',VR=`${h5}:not([aria-disabled="true"])`,ES="cmdk-item-select",Fs="data-value",Ace=(e,t,r)=>Oce(e,t,r),p5=b.createContext(void 0),dd=()=>b.useContext(p5),m5=b.createContext(void 0),v_=()=>b.useContext(m5),g5=b.createContext(void 0),v5=b.forwardRef((e,t)=>{let r=zs(()=>{var D,J;return{search:"",value:(J=(D=e.value)!=null?D:e.defaultValue)!=null?J:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=zs(()=>new Set),a=zs(()=>new Map),i=zs(()=>new Map),o=zs(()=>new Set),u=y5(e),{label:d,children:c,value:h,onValueChange:p,filter:m,shouldFilter:v,loop:x,disablePointerSelection:y=!1,vimBindings:S=!0,...j}=e,N=Kr(),E=Kr(),A=Kr(),C=b.useRef(null),O=zce();Ko(()=>{if(h!==void 0){let D=h.trim();r.current.value=D,T.emit()}},[h]),Ko(()=>{O(6,V)},[]);let T=b.useMemo(()=>({subscribe:D=>(o.current.add(D),()=>o.current.delete(D)),snapshot:()=>r.current,setState:(D,J,ae)=>{var ie,ne,X,Y;if(!Object.is(r.current[D],J)){if(r.current[D]=J,D==="search")B(),q(),O(1,F);else if(D==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ee=document.getElementById(A);ee?ee.focus():(ie=document.getElementById(N))==null||ie.focus()}if(O(7,()=>{var ee;r.current.selectedItemId=(ee=G())==null?void 0:ee.id,T.emit()}),ae||O(5,V),((ne=u.current)==null?void 0:ne.value)!==void 0){let ee=J??"";(Y=(X=u.current).onValueChange)==null||Y.call(X,ee);return}}T.emit()}},emit:()=>{o.current.forEach(D=>D())}}),[]),R=b.useMemo(()=>({value:(D,J,ae)=>{var ie;J!==((ie=i.current.get(D))==null?void 0:ie.value)&&(i.current.set(D,{value:J,keywords:ae}),r.current.filtered.items.set(D,L(J,ae)),O(2,()=>{q(),T.emit()}))},item:(D,J)=>(n.current.add(D),J&&(a.current.has(J)?a.current.get(J).add(D):a.current.set(J,new Set([D]))),O(3,()=>{B(),q(),r.current.value||F(),T.emit()}),()=>{i.current.delete(D),n.current.delete(D),r.current.filtered.items.delete(D);let ae=G();O(4,()=>{B(),ae?.getAttribute("id")===D&&F(),T.emit()})}),group:D=>(a.current.has(D)||a.current.set(D,new Set),()=>{i.current.delete(D),a.current.delete(D)}),filter:()=>u.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:N,inputId:A,labelId:E,listInnerRef:C}),[]);function L(D,J){var ae,ie;let ne=(ie=(ae=u.current)==null?void 0:ae.filter)!=null?ie:Ace;return D?ne(D,r.current.search,J):0}function q(){if(!r.current.search||u.current.shouldFilter===!1)return;let D=r.current.filtered.items,J=[];r.current.filtered.groups.forEach(ie=>{let ne=a.current.get(ie),X=0;ne.forEach(Y=>{let ee=D.get(Y);X=Math.max(ee,X)}),J.push([ie,X])});let ae=C.current;W().sort((ie,ne)=>{var X,Y;let ee=ie.getAttribute("id"),le=ne.getAttribute("id");return((X=D.get(le))!=null?X:0)-((Y=D.get(ee))!=null?Y:0)}).forEach(ie=>{let ne=ie.closest(M1);ne?ne.appendChild(ie.parentElement===ne?ie:ie.closest(`${M1} > *`)):ae.appendChild(ie.parentElement===ae?ie:ie.closest(`${M1} > *`))}),J.sort((ie,ne)=>ne[1]-ie[1]).forEach(ie=>{var ne;let X=(ne=C.current)==null?void 0:ne.querySelector(`${Hc}[${Fs}="${encodeURIComponent(ie[0])}"]`);X?.parentElement.appendChild(X)})}function F(){let D=W().find(ae=>ae.getAttribute("aria-disabled")!=="true"),J=D?.getAttribute(Fs);T.setState("value",J||void 0)}function B(){var D,J,ae,ie;if(!r.current.search||u.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let ne=0;for(let X of n.current){let Y=(J=(D=i.current.get(X))==null?void 0:D.value)!=null?J:"",ee=(ie=(ae=i.current.get(X))==null?void 0:ae.keywords)!=null?ie:[],le=L(Y,ee);r.current.filtered.items.set(X,le),le>0&&ne++}for(let[X,Y]of a.current)for(let ee of Y)if(r.current.filtered.items.get(ee)>0){r.current.filtered.groups.add(X);break}r.current.filtered.count=ne}function V(){var D,J,ae;let ie=G();ie&&(((D=ie.parentElement)==null?void 0:D.firstChild)===ie&&((ae=(J=ie.closest(Hc))==null?void 0:J.querySelector(Pce))==null||ae.scrollIntoView({block:"nearest"})),ie.scrollIntoView({block:"nearest"}))}function G(){var D;return(D=C.current)==null?void 0:D.querySelector(`${h5}[aria-selected="true"]`)}function W(){var D;return Array.from(((D=C.current)==null?void 0:D.querySelectorAll(VR))||[])}function H(D){let J=W()[D];J&&T.setState("value",J.getAttribute(Fs))}function U(D){var J;let ae=G(),ie=W(),ne=ie.findIndex(Y=>Y===ae),X=ie[ne+D];(J=u.current)!=null&&J.loop&&(X=ne+D<0?ie[ie.length-1]:ne+D===ie.length?ie[0]:ie[ne+D]),X&&T.setState("value",X.getAttribute(Fs))}function $(D){let J=G(),ae=J?.closest(Hc),ie;for(;ae&&!ie;)ae=D>0?Bce(ae,Hc):Fce(ae,Hc),ie=ae?.querySelector(VR);ie?T.setState("value",ie.getAttribute(Fs)):U(D)}let Z=()=>H(W().length-1),k=D=>{D.preventDefault(),D.metaKey?Z():D.altKey?$(1):U(1)},I=D=>{D.preventDefault(),D.metaKey?H(0):D.altKey?$(-1):U(-1)};return b.createElement(Ye.div,{ref:t,tabIndex:-1,...j,"cmdk-root":"",onKeyDown:D=>{var J;(J=j.onKeyDown)==null||J.call(j,D);let ae=D.nativeEvent.isComposing||D.keyCode===229;if(!(D.defaultPrevented||ae))switch(D.key){case"n":case"j":{S&&D.ctrlKey&&k(D);break}case"ArrowDown":{k(D);break}case"p":case"k":{S&&D.ctrlKey&&I(D);break}case"ArrowUp":{I(D);break}case"Home":{D.preventDefault(),H(0);break}case"End":{D.preventDefault(),Z();break}case"Enter":{D.preventDefault();let ie=G();if(ie){let ne=new Event(ES);ie.dispatchEvent(ne)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:Uce},d),ug(e,D=>b.createElement(m5.Provider,{value:T},b.createElement(p5.Provider,{value:R},D))))}),Tce=b.forwardRef((e,t)=>{var r,n;let a=Kr(),i=b.useRef(null),o=b.useContext(g5),u=dd(),d=y5(e),c=(n=(r=d.current)==null?void 0:r.forceMount)!=null?n:o?.forceMount;Ko(()=>{if(!c)return u.item(a,o?.id)},[c]);let h=x5(a,i,[e.value,e.children,i],e.keywords),p=v_(),m=Wi(O=>O.value&&O.value===h.current),v=Wi(O=>c||u.filter()===!1?!0:O.search?O.filtered.items.get(a)>0:!0);b.useEffect(()=>{let O=i.current;if(!(!O||e.disabled))return O.addEventListener(ES,x),()=>O.removeEventListener(ES,x)},[v,e.onSelect,e.disabled]);function x(){var O,T;y(),(T=(O=d.current).onSelect)==null||T.call(O,h.current)}function y(){p.setState("value",h.current,!0)}if(!v)return null;let{disabled:S,value:j,onSelect:N,forceMount:E,keywords:A,...C}=e;return b.createElement(Ye.div,{ref:Mn(i,t),...C,id:a,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!m,"data-disabled":!!S,"data-selected":!!m,onPointerMove:S||u.getDisablePointerSelection()?void 0:y,onClick:S?void 0:x},e.children)}),kce=b.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...i}=e,o=Kr(),u=b.useRef(null),d=b.useRef(null),c=Kr(),h=dd(),p=Wi(v=>a||h.filter()===!1?!0:v.search?v.filtered.groups.has(o):!0);Ko(()=>h.group(o),[]),x5(o,u,[e.value,e.heading,d]);let m=b.useMemo(()=>({id:o,forceMount:a}),[a]);return b.createElement(Ye.div,{ref:Mn(u,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},r&&b.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),ug(e,v=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},b.createElement(g5.Provider,{value:m},v))))}),Rce=b.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=b.useRef(null),i=Wi(o=>!o.search);return!r&&!i?null:b.createElement(Ye.div,{ref:Mn(a,t),...n,"cmdk-separator":"",role:"separator"})}),Ice=b.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=e.value!=null,i=v_(),o=Wi(c=>c.search),u=Wi(c=>c.selectedItemId),d=dd();return b.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),b.createElement(Ye.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:a?e.value:o,onChange:c=>{a||i.setState("search",c.target.value),r?.(c.target.value)}})}),Mce=b.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,i=b.useRef(null),o=b.useRef(null),u=Wi(c=>c.selectedItemId),d=dd();return b.useEffect(()=>{if(o.current&&i.current){let c=o.current,h=i.current,p,m=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=c.offsetHeight;h.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return m.observe(c),()=>{cancelAnimationFrame(p),m.unobserve(c)}}},[]),b.createElement(Ye.div,{ref:Mn(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":n,id:d.listId},ug(e,c=>b.createElement("div",{ref:Mn(o,d.listInnerRef),"cmdk-list-sizer":""},c)))}),Dce=b.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:i,container:o,...u}=e;return b.createElement(L3,{open:r,onOpenChange:n},b.createElement($3,{container:o},b.createElement(B3,{"cmdk-overlay":"",className:a}),b.createElement(F3,{"aria-label":e.label,"cmdk-dialog":"",className:i},b.createElement(v5,{ref:t,...u}))))}),Lce=b.forwardRef((e,t)=>Wi(r=>r.filtered.count===0)?b.createElement(Ye.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),$ce=b.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...i}=e;return b.createElement(Ye.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},ug(e,o=>b.createElement("div",{"aria-hidden":!0},o)))}),Yl=Object.assign(v5,{List:Mce,Item:Tce,Input:Ice,Group:kce,Separator:Rce,Dialog:Dce,Empty:Lce,Loading:$ce});function Bce(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Fce(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function y5(e){let t=b.useRef(e);return Ko(()=>{t.current=e}),t}var Ko=typeof window>"u"?b.useEffect:b.useLayoutEffect;function zs(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function Wi(e){let t=v_(),r=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,r,r)}function x5(e,t,r,n=[]){let a=b.useRef(),i=dd();return Ko(()=>{var o;let u=(()=>{var c;for(let h of r){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(c=h.current.textContent)==null?void 0:c.trim():a.current}})(),d=n.map(c=>c.trim());i.value(e,u,d),(o=t.current)==null||o.setAttribute(Fs,u),a.current=u}),a}var zce=()=>{let[e,t]=b.useState(),r=zs(()=>new Map);return Ko(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,a)=>{r.current.set(n,a),t({})}};function qce(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ug({asChild:e,children:t},r){return e&&b.isValidElement(t)?b.cloneElement(qce(t),{ref:t.ref},r(t.props.children)):r(t)}var Uce={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function b5({className:e,...t}){return s.jsx(Yl,{"data-slot":"command",className:Ae("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function w5({className:e,...t}){return s.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[s.jsx(cm,{className:"size-4 shrink-0 opacity-50"}),s.jsx(Yl.Input,{"data-slot":"command-input",className:Ae("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function S5({className:e,...t}){return s.jsx(Yl.List,{"data-slot":"command-list",className:Ae("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function j5({...e}){return s.jsx(Yl.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function OS({className:e,...t}){return s.jsx(Yl.Group,{"data-slot":"command-group",className:Ae("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function PS({className:e,...t}){return s.jsx(Yl.Item,{"data-slot":"command-item",className:Ae("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function xa({value:e,onValueChange:t,options:r,placeholder:n="Select…",searchPlaceholder:a="Search…",emptyText:i="No matching results.",disabled:o,className:u}){const[d,c]=b.useState(!1),h=e?r.find(m=>m.value===e):void 0,p=e?h?.label??e:null;return s.jsxs(Ta,{open:d,onOpenChange:c,children:[s.jsx(ka,{asChild:!0,children:s.jsxs(fe,{type:"button",variant:"outline",role:"combobox","aria-expanded":d,disabled:o,className:Ae("w-full justify-between h-10 px-3 font-normal border border-gray-300 bg-white",u),children:[s.jsx("span",{className:Ae("truncate text-left text-sm",!p&&"text-gray-500"),children:p??n}),s.jsx(sM,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsxs(Ra,{className:"p-0 w-[var(--radix-popover-trigger-width)] max-w-[min(100vw-2rem,400px)]",align:"start",children:[s.jsxs(b5,{children:[s.jsx(w5,{placeholder:a}),s.jsxs(S5,{children:[s.jsx(j5,{children:i}),s.jsx(OS,{children:r.map(m=>s.jsx(PS,{value:`${m.label} ${m.value}`,onSelect:()=>{t(m.value),c(!1)},className:Ae("cursor-pointer rounded-md px-2 py-2 transition-colors","hover:bg-gray-100 hover:text-gray-900","data-[selected=true]:bg-gray-100",e===m.value&&"bg-blue-50 text-gray-900 font-medium data-[selected=true]:bg-blue-100"),children:s.jsx("span",{className:"truncate",children:m.label})},m.value))})]})]}),e?s.jsx("div",{className:"border-t border-gray-100 px-2 py-1.5",children:s.jsx("button",{type:"button",className:"text-xs text-gray-500 hover:text-gray-900 underline-offset-2 hover:underline",onClick:()=>{t(""),c(!1)},children:"Clear selection"})}):null]})]})}function Gi({className:e,...t}){return s.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:Ae("mx-auto flex w-full justify-center",e),...t})}function Ki({className:e,...t}){return s.jsx("ul",{"data-slot":"pagination-content",className:Ae("flex flex-row items-center gap-1",e),...t})}function Mt({...e}){return s.jsx("li",{"data-slot":"pagination-item",...e})}function Ca({className:e,isActive:t,size:r="icon",...n}){return s.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:Ae(UM({variant:t?"outline":"ghost",size:r}),e),...n})}function Xi({className:e,...t}){return s.jsxs(Ca,{"aria-label":"Go to previous page",size:"default",className:Ae("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[s.jsx(oM,{}),s.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function Yi({className:e,...t}){return s.jsxs(Ca,{"aria-label":"Go to next page",size:"default",className:Ae("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[s.jsx("span",{className:"hidden sm:block",children:"Next"}),s.jsx(tl,{})]})}class Vce extends Error{status;payload;constructor(t,r,n){super(t),this.name="ApiError",this.status=r,this.payload=n}}function Hce(e,t){if(!e)return t;const r=e.endsWith("/")?e.slice(0,-1):e,n=t.startsWith("/")?t:`/${t}`;return`${r}${n}`}function Wce(e){const t=new URLSearchParams;for(const[n,a]of Object.entries(e))if(!(a==null||a==="")){if(typeof a=="boolean"){t.set(n,a?"true":"false");continue}t.set(n,String(a))}const r=t.toString();return r?`?${r}`:""}function Gce(e){const r=e?.error?.message?.trim();return r||null}function HR(e){if(Array.isArray(e))return{items:e,totalCount:e.length};if(!e||typeof e!="object")return e;const t=e,r="TotalCount"in t||"Items"in t,n="totalCount"in t||"items"in t;if(r&&!n)return{...t,totalCount:t.TotalCount,items:t.Items};if(!("items"in t)&&Array.isArray(t.data)&&typeof t.totalCount=="number")return{...t,items:t.data};if(!("items"in t)&&Array.isArray(t.Data)&&typeof t.TotalCount=="number")return{...t,totalCount:t.TotalCount,items:t.Data};if(Array.isArray(t.items)&&typeof t.totalCount!="number"){const a=t.TotalCount;return{...t,totalCount:typeof a=="number"?a:t.items.length}}return e}function gn(e={}){const t=e.baseUrl??"http://flus-test.3ffoodsafety.com"??"http://localhost:19001",r=e.getToken;async function n(a){const i=a.prefix??"/api/app",o=Hce(t,`${i}${a.path}${Wce(a.query??{})}`),u={"Content-Type":"application/json"},d=r?.();d&&(u.Authorization=`Bearer ${d}`);const c=await fetch(o,{method:a.method,headers:u,body:a.body===void 0?void 0:JSON.stringify(a.body),signal:a.signal}),m=(c.headers.get("content-type")??"").includes("application/json")?await c.json().catch(()=>null):await c.text().catch(()=>"");if(!c.ok){const x=Gce(m)??(typeof m=="string"&&m.trim()?m:"Request failed.");throw new Vce(x,c.status,m)}return m&&typeof m=="object"&&"data"in m?HR(m.data??null):HR(m)}return{requestJson:n}}const fd=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),hd="/label";async function Kce(e,t){return fd.requestJson({path:hd,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,LocationId:e.locationId,ProductId:e.productId,LabelCategoryId:e.labelCategoryId,LabelTypeId:e.labelTypeId,TemplateCode:e.templateCode,State:e.state},signal:t})}async function Xce(e,t){return fd.requestJson({path:`${hd}/${encodeURIComponent(e)}`,method:"GET",signal:t})}async function Yce(e){return fd.requestJson({path:hd,method:"POST",body:{labelCode:e.labelCode,labelName:e.labelName,templateCode:e.templateCode,locationId:e.locationId,labelCategoryId:e.labelCategoryId,labelTypeId:e.labelTypeId,productIds:e.productIds,labelInfoJson:e.labelInfoJson,state:e.state??!0}})}async function Jce(e,t){return fd.requestJson({path:`${hd}/${encodeURIComponent(e)}`,method:"PUT",body:{labelName:t.labelName,templateCode:t.templateCode,locationId:t.locationId,labelCategoryId:t.labelCategoryId,labelTypeId:t.labelTypeId,productIds:t.productIds,labelInfoJson:t.labelInfoJson,state:t.state??!0}})}async function Qce(e){await fd.requestJson({path:`${hd}/${encodeURIComponent(e)}`,method:"DELETE"})}const dg=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}});async function Jl(e,t){return dg.requestJson({path:"/location",method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,Partner:e.partner,GroupName:e.groupName,State:e.state},signal:t})}async function Zce(e){return dg.requestJson({path:"/location",method:"POST",body:{partner:e.partner,groupName:e.groupName,locationCode:e.locationCode,locationName:e.locationName,street:e.street,city:e.city,stateCode:e.stateCode,country:e.country,zipCode:e.zipCode,phone:e.phone,email:e.email,latitude:e.latitude,longitude:e.longitude,state:e.state??!0}})}async function eue(e,t){return dg.requestJson({path:`/location/${encodeURIComponent(e)}`,method:"PUT",body:{partner:t.partner,groupName:t.groupName,locationCode:t.locationCode,locationName:t.locationName,street:t.street,city:t.city,stateCode:t.stateCode,country:t.country,zipCode:t.zipCode,phone:t.phone,email:t.email,latitude:t.latitude,longitude:t.longitude,state:t.state??!0}})}async function tue(e){await dg.requestJson({path:`/location/${encodeURIComponent(e)}`,method:"DELETE"})}const fg=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),hg="/label-category";async function y_(e,t){return fg.requestJson({path:hg,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,State:e.state},signal:t})}async function rue(e){return fg.requestJson({path:hg,method:"POST",body:{categoryCode:e.categoryCode,categoryName:e.categoryName,categoryPhotoUrl:e.categoryPhotoUrl,state:e.state??!0,orderNum:e.orderNum}})}async function nue(e,t){return fg.requestJson({path:`${hg}/${encodeURIComponent(e)}`,method:"PUT",body:{categoryCode:t.categoryCode,categoryName:t.categoryName,categoryPhotoUrl:t.categoryPhotoUrl,state:t.state??!0,orderNum:t.orderNum}})}async function aue(e){await fg.requestJson({path:`${hg}/${encodeURIComponent(e)}`,method:"DELETE"})}const pg=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),mg="/label-type";async function _5(e,t){return pg.requestJson({path:mg,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,State:e.state},signal:t})}async function iue(e){return pg.requestJson({path:mg,method:"POST",body:{typeCode:e.typeCode,typeName:e.typeName,state:e.state??!0,orderNum:e.orderNum}})}async function oue(e,t){return pg.requestJson({path:`${mg}/${encodeURIComponent(e)}`,method:"PUT",body:{typeCode:t.typeCode,typeName:t.typeName,state:t.state??!0,orderNum:t.orderNum}})}async function sue(e){await pg.requestJson({path:`${mg}/${encodeURIComponent(e)}`,method:"DELETE"})}const pd=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),md="/label-template";function lue(e){const t=e;if(!t||typeof t!="object")return"";const r=t.id??t.templateCode??t.TemplateCode;return typeof r=="string"?r.trim():String(r??"").trim()}function gg(e){const t=e,n=((Array.isArray(t.appliedLocationIds)?t.appliedLocationIds:null)??(Array.isArray(t.AppliedLocationIds)?t.AppliedLocationIds:null)??[]).map(v=>String(v)),a=lue(e),i=t.templateName??t.TemplateName,o=t.templateCode??t.TemplateCode,u=t.locationText??t.LocationText,d=t.sizeText??t.SizeText,c=t.contentsCount??t.ContentsCount,h=typeof c=="number"?c:void 0,p=t.lastEdited??t.LastEdited,m=(typeof t.name=="string"&&t.name.trim()?t.name:null)??(typeof i=="string"&&String(i).trim()?String(i):null);return{...t,id:a,name:m??t.name,templateName:(typeof i=="string"?i:null)??t.templateName,templateCode:(typeof o=="string"?o:null)??t.templateCode,locationText:(typeof u=="string"?u:null)??t.locationText,sizeText:(typeof d=="string"?d:null)??t.sizeText,contentsCount:h??t.contentsCount,lastEdited:(typeof p=="string"?p:null)??t.lastEdited,appliedLocationIds:n,elements:Array.isArray(t.elements)?t.elements:[]}}async function N5(e,t){const r=await pd.requestJson({path:md,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,LocationId:e.locationId,LabelType:e.labelType,State:e.state},signal:t}),n=(r.items??[]).map(a=>gg(a));return{...r,items:n}}async function cue(e,t){const r=await pd.requestJson({path:`${md}/${encodeURIComponent(e)}`,method:"GET",signal:t});return gg(r)}async function uue(e){const t=await pd.requestJson({path:md,method:"POST",body:{id:e.id,name:e.name,labelType:e.labelType,unit:e.unit,width:e.width,height:e.height,appliedLocation:e.appliedLocation,showRuler:e.showRuler??!0,showGrid:e.showGrid??!0,state:e.state??!0,elements:e.elements,appliedLocationIds:e.appliedLocationIds??[]}});return gg(t)}async function due(e,t){const r=await pd.requestJson({path:`${md}/${encodeURIComponent(e)}`,method:"PUT",body:{id:t.id,name:t.name,labelType:t.labelType,unit:t.unit,width:t.width,height:t.height,appliedLocation:t.appliedLocation,showRuler:t.showRuler??!0,showGrid:t.showGrid??!0,state:t.state??!0,elements:t.elements,appliedLocationIds:t.appliedLocationIds??[]}});return gg(r)}async function fue(e){await pd.requestJson({path:`${md}/${encodeURIComponent(e)}`,method:"DELETE"})}const gd=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),vd="/product";function vg(e){const t=e,r=String(t?.id??t?.Id??"").trim();return{...t,id:r,productCode:t?.productCode??t?.ProductCode,productName:t?.productName??t?.ProductName,categoryName:t?.categoryName??t?.CategoryName,productImageUrl:t?.productImageUrl??t?.ProductImageUrl,state:typeof t?.state=="boolean"?t.state:typeof t?.State=="boolean"?t.State:null}}async function AS(e,t){const r=await gd.requestJson({path:vd,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,State:e.state},signal:t});return{...r,items:(r.items??[]).map(n=>vg(n))}}async function hue(e,t){const r=await gd.requestJson({path:`${vd}/${encodeURIComponent(e)}`,method:"GET",signal:t});return vg(r)}async function pue(e){const t=await gd.requestJson({path:vd,method:"POST",body:{productCode:e.productCode,productName:e.productName,categoryName:e.categoryName??null,productImageUrl:e.productImageUrl??null,state:e.state??!0}});return vg(t)}async function mue(e,t){const r=await gd.requestJson({path:`${vd}/${encodeURIComponent(e)}`,method:"PUT",body:{productCode:t.productCode,productName:t.productName,categoryName:t.categoryName??null,productImageUrl:t.productImageUrl??null,state:t.state??!0}});return vg(r)}async function gue(e){await gd.requestJson({path:`${vd}/${encodeURIComponent(e)}`,method:"DELETE"})}function ra(e){const t=(e??"").trim();return t||"None"}function vue(e){return(e.labelCode??e.id??"").trim()||"None"}function yue(e){const t=(e.productName??"").trim();if(t)return t;const r=e.productIds?.length??0;return r>0?`${r} product(s)`:"None"}function xue(e){const t=(e.lastEdited??"").trim();if(t)return t;const r=e.creationTime;if(r)try{return new Date(r).toLocaleString()}catch{return String(r)}return"None"}function WR(e){const t=e.productIds;return{labelName:e.labelName??"",templateCode:e.templateCode??"",locationId:e.locationId??"",labelCategoryId:e.labelCategoryId??"",labelTypeId:e.labelTypeId??"",productIds:Array.isArray(t)?[...t]:[],labelInfoJson:e.labelInfoJson??null,state:e.state??!0}}function Ku(e){return(e.templateCode??e.id??"").trim()}function C5(e){const t=(e.templateName??e.name??"").trim()||"None",r=Ku(e)||"None";return`${t} (${r})`}function E5(e){const[t,r]=b.useState(!1),[n,a]=b.useState([]),[i,o]=b.useState([]),[u,d]=b.useState([]),[c,h]=b.useState([]),[p,m]=b.useState([]);b.useEffect(()=>{if(!e)return;let x=!1;return(async()=>{r(!0);try{const[y,S,j,N,E]=await Promise.all([N5({skipCount:0,maxResultCount:500}),Jl({skipCount:0,maxResultCount:500}),y_({skipCount:0,maxResultCount:500}),_5({skipCount:0,maxResultCount:500}),AS({skipCount:0,maxResultCount:500})]);if(x)return;a(y.items??[]),o(S.items??[]),d(j.items??[]),h(N.items??[]),m(E.items??[])}catch(y){x||(ge.error("Failed to load options",{description:y?.message?String(y.message):"Check network or sign-in."}),a([]),o([]),d([]),h([]),m([]))}finally{x||r(!1)}})(),()=>{x=!0}},[e]);const v=b.useMemo(()=>p.map(x=>{const y=(x.productName??x.productCode??"").trim()||x.id;return{id:x.id,name:y}}),[p]);return{loading:t,templates:n,locations:i,categories:u,types:c,productOptions:v}}function O5({value:e,onChange:t,disabled:r,productOptions:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>{if(e.length===0)return"Select products (multi-select)";const c=e.map(p=>n.find(m=>m.id===p)?.name??p).slice(0,2),h=e.length>2?`, ${e.length} total`:"";return`${c.join(", ")}${h}`},[e,n]),u=b.useCallback((c,h)=>{const p=new Set(e);h?p.add(c):p.delete(c),t(Array.from(p))},[e,t]),d=b.useMemo(()=>e.filter(c=>!n.some(h=>h.id===c)),[e,n]);return s.jsxs(Ta,{open:a,onOpenChange:i,children:[s.jsx(ka,{asChild:!0,children:s.jsxs(fe,{type:"button",variant:"outline",role:"combobox",disabled:r,className:"w-full justify-between h-10 px-3 font-normal border border-gray-300 bg-white",children:[s.jsx("span",{className:"truncate text-left text-sm",children:o}),s.jsx(sM,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Ra,{className:"w-[var(--radix-popover-trigger-width)] max-w-[min(100vw-2rem,400px)] p-0",align:"start",children:s.jsxs(b5,{children:[s.jsx(w5,{placeholder:"Search products…"}),s.jsxs(S5,{children:[s.jsx(j5,{children:"No matching products."}),s.jsxs(OS,{children:[n.map(c=>s.jsxs(PS,{value:`${c.name} ${c.id}`,onSelect:()=>{u(c.id,!e.includes(c.id))},className:"cursor-pointer",children:[s.jsx(kl,{className:"pointer-events-none",checked:e.includes(c.id)}),s.jsxs("span",{className:"flex-1 min-w-0",children:[s.jsx("span",{className:"font-medium",children:c.name}),s.jsx("span",{className:"block text-xs text-gray-400 truncate",children:c.id})]})]},c.id)),d.length>0?s.jsx(OS,{heading:"Linked (not in current list, can deselect)",children:d.map(c=>s.jsxs(PS,{value:c,onSelect:()=>{u(c,!e.includes(c))},className:"cursor-pointer",children:[s.jsx(kl,{className:"pointer-events-none",checked:e.includes(c)}),s.jsx("span",{className:"text-xs font-mono truncate",children:c})]},c))}):null]})]})]})})]})}function bue(){const[e,t]=b.useState(!1),[r,n]=b.useState(!1),[a,i]=b.useState(!1),[o,u]=b.useState(null),[d,c]=b.useState(null),[h,p]=b.useState([]),[m,v]=b.useState(!1),[x,y]=b.useState(0),[S,j]=b.useState(0),[N,E]=b.useState(null),[A,C]=b.useState(""),[O,T]=b.useState("all"),[R,L]=b.useState("all"),[q,F]=b.useState("all"),[B,V]=b.useState("all"),[G,W]=b.useState("all"),[H,U]=b.useState(1),[$,Z]=b.useState(10),k=b.useRef(null),I=b.useRef(null),[D,J]=b.useState("");b.useEffect(()=>(I.current&&window.clearTimeout(I.current),I.current=window.setTimeout(()=>J(A.trim()),300),()=>{I.current&&window.clearTimeout(I.current)}),[A]);const ae=Math.max(1,Math.ceil(x/$));b.useEffect(()=>{U(1)},[D,O,R,q,B,G,$]),b.useEffect(()=>((async()=>{k.current?.abort();const ee=new AbortController;k.current=ee,v(!0);try{const le=(H-1)*$,pe=await Kce({skipCount:le,maxResultCount:$,keyword:D||void 0,locationId:O!=="all"?O:void 0,labelCategoryId:R!=="all"?R:void 0,labelTypeId:q!=="all"?q:void 0,templateCode:B!=="all"?B:void 0,state:G==="all"?void 0:G==="true"},ee.signal);p(pe.items??[]),y(pe.totalCount??0)}catch(le){if(le?.name==="AbortError")return;ge.error("Failed to load labels.",{description:le?.message?String(le.message):"Please try again."}),p([]),y(0)}finally{v(!1)}})(),()=>k.current?.abort()),[D,O,R,q,B,G,H,$,S]);const ie=()=>j(Y=>Y+1),ne=Y=>{E(null),u(Y),n(!0)},X=Y=>{E(null),c(Y),i(!0)};return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{className:"pb-4",children:s.jsx("div",{className:"flex flex-col gap-4",children:s.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[s.jsx(me,{placeholder:"Search",value:A,onChange:Y=>C(Y.target.value),style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),s.jsxs(We,{value:O,onValueChange:T,children:[s.jsx(Ke,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Location"})}),s.jsx(Xe,{children:s.jsx(_e,{value:"all",children:"All Locations"})})]}),s.jsxs(We,{value:R,onValueChange:L,children:[s.jsx(Ke,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Category"})}),s.jsx(Xe,{children:s.jsx(_e,{value:"all",children:"All Categories"})})]}),s.jsxs(We,{value:q,onValueChange:F,children:[s.jsx(Ke,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Type"})}),s.jsx(Xe,{children:s.jsx(_e,{value:"all",children:"All Types"})})]}),s.jsxs(We,{value:G,onValueChange:W,children:[s.jsx(Ke,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"State"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"all",children:"All States"}),s.jsx(_e,{value:"true",children:"Active"}),s.jsx(_e,{value:"false",children:"Inactive"})]})]}),s.jsx("div",{className:"flex-1"}),s.jsxs(fe,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0",onClick:()=>t(!0),children:["New Label ",s.jsx(In,{className:"ml-1 h-4 w-4"})]})]})})}),s.jsx("div",{className:"flex-1 overflow-auto pt-6",children:s.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-50 hover:bg-gray-50",children:[s.jsx(ye,{className:"font-bold text-gray-900 w-[120px]",children:"Label Code"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[140px]",children:"Label Name"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[120px]",children:"Location"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[140px]",children:"Category"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[140px]",children:"Type"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[120px]",children:"Template"}),s.jsx(ye,{className:"font-bold text-gray-900",children:"Products"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[100px]",children:"State"}),s.jsx(ye,{className:"font-bold text-gray-900",children:"Last Edited"}),s.jsx(ye,{className:"font-bold text-gray-900 text-center w-[100px]",children:"Actions"})]})}),s.jsx($r,{children:m?s.jsx(Fe,{children:s.jsx(de,{colSpan:10,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):h.length===0?s.jsx(Fe,{children:s.jsx(de,{colSpan:10,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):h.map(Y=>s.jsxs(Fe,{className:"hover:bg-gray-50",children:[s.jsx(de,{className:"font-medium whitespace-nowrap",children:vue(Y)}),s.jsx(de,{className:"whitespace-nowrap",children:ra(Y.labelName)}),s.jsx(de,{className:"text-gray-600 whitespace-nowrap",children:ra(Y.locationName??Y.locationId)}),s.jsx(de,{className:"text-gray-600 whitespace-nowrap",children:ra(Y.labelCategoryName??Y.labelCategoryId)}),s.jsx(de,{className:"text-gray-600 whitespace-nowrap",children:ra(Y.labelTypeName??Y.labelTypeId)}),s.jsx(de,{className:"text-gray-600 whitespace-nowrap",children:ra(Y.templateName??Y.templateCode)}),s.jsx(de,{className:"text-gray-600 whitespace-nowrap",children:yue(Y)}),s.jsx(de,{children:s.jsx(Or,{className:Y.state===!0?"bg-green-600":"bg-gray-400",children:Y.state===!0?"Active":"Inactive"})}),s.jsx(de,{className:"text-gray-500 tabular-nums font-numeric whitespace-nowrap",children:xue(Y)}),s.jsx(de,{className:"text-center",children:s.jsxs(Ta,{open:N===Y.id,onOpenChange:ee=>E(ee?Y.id:null),children:[s.jsx(ka,{asChild:!0,children:s.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:s.jsx(Ji,{className:"h-4 w-4 text-gray-500"})})}),s.jsxs(Ra,{align:"end",className:"w-40 p-1",children:[s.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>ne(Y),children:[s.jsx(kn,{className:"w-4 h-4"}),"Edit"]}),s.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>X(Y),children:"Delete"})]})]})})]},Y.id))})]})})}),s.jsx("div",{className:"pt-4",children:s.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[s.jsxs("div",{children:["Showing ",x===0?0:(H-1)*$+1,"-",Math.min(H*$,x)," of ",x]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(We,{value:String($),onValueChange:Y=>Z(Number(Y)),children:[s.jsx(Ke,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:s.jsx(Ge,{})}),s.jsx(Xe,{children:[10,20,50].map(Y=>s.jsxs(_e,{value:String(Y),children:[Y," / page"]},Y))})]}),s.jsx(Gi,{className:"mx-0 w-auto justify-end",children:s.jsxs(Ki,{children:[s.jsx(Mt,{children:s.jsx(Xi,{href:"#",size:"default",onClick:Y=>{Y.preventDefault(),U(ee=>Math.max(1,ee-1))},"aria-disabled":H<=1,className:H<=1?"pointer-events-none opacity-50":""})}),s.jsx(Mt,{children:s.jsxs(Ca,{href:"#",isActive:!0,size:"default",onClick:Y=>Y.preventDefault(),children:["Page ",H," / ",ae]})}),s.jsx(Mt,{children:s.jsx(Yi,{href:"#",size:"default",onClick:Y=>{Y.preventDefault(),U(ee=>Math.min(ae,ee+1))},"aria-disabled":H>=ae,className:H>=ae?"pointer-events-none opacity-50":""})})]})})]})]})}),s.jsx(wue,{open:e,onOpenChange:t,onCreated:()=>{U(1),ie()}}),s.jsx(Sue,{open:r,label:o,onOpenChange:Y=>{n(Y),Y||u(null)},onUpdated:ie}),s.jsx(jue,{open:a,label:d,onOpenChange:Y=>{i(Y),Y||c(null)},onDeleted:ie})]})}function wue({open:e,onOpenChange:t,onCreated:r}){const{loading:n,templates:a,locations:i,categories:o,types:u,productOptions:d}=E5(e),[c,h]=b.useState(!1),[p,m]=b.useState({labelCode:"",labelName:"",templateCode:"",locationId:"",labelCategoryId:"",labelTypeId:"",productIds:[],labelInfoJson:null,state:!0}),v=()=>{m({labelCode:"",labelName:"",templateCode:"",locationId:"",labelCategoryId:"",labelTypeId:"",productIds:[],labelInfoJson:null,state:!0})};b.useEffect(()=>{e||v()},[e]);const x=async()=>{if(!p.labelCode.trim()||!p.labelName.trim()||!p.templateCode.trim()||!p.locationId.trim()||!p.labelCategoryId.trim()||!p.labelTypeId.trim()){ge.error("Validation failed",{description:"Fill all required fields and select template, location, category, and type."});return}if(p.productIds.length===0){ge.error("Validation failed",{description:"Select at least one product."});return}h(!0);try{await Yce(p),ge.success("Label created.",{description:"The label has been created successfully."}),t(!1),r()}catch(E){ge.error("Failed to create label.",{description:E?.message?String(E.message):"Please try again."})}finally{h(!1)}},y=b.useMemo(()=>a.filter(E=>Ku(E)).map(E=>({value:Ku(E),label:C5(E)})),[a]),S=b.useMemo(()=>i.map(E=>({value:E.id,label:ra(E.locationName??E.locationCode??E.id)})),[i]),j=b.useMemo(()=>o.map(E=>({value:E.id,label:ra(E.categoryName??E.categoryCode??E.id)})),[o]),N=b.useMemo(()=>u.map(E=>({value:E.id,label:ra(E.typeName??E.typeCode??E.id)})),[u]);return s.jsx(vt,{open:e,onOpenChange:t,children:s.jsxs(mt,{className:"sm:max-w-[600px]",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Add New Label"}),s.jsx(Pt,{children:"Enter the details for the new label."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Label Code *"}),s.jsx(me,{className:"h-10",placeholder:"e.g. LBL_TEST_001",value:p.labelCode,onChange:E=>m(A=>({...A,labelCode:E.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Label Name *"}),s.jsx(me,{className:"h-10",placeholder:"e.g. Breakfast label",value:p.labelName,onChange:E=>m(A=>({...A,labelName:E.target.value}))})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Label Template *"}),s.jsx(xa,{value:p.templateCode,onValueChange:E=>m(A=>({...A,templateCode:E})),options:y,placeholder:"Select template",searchPlaceholder:"Search template…",emptyText:"No templates found.",disabled:n})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Location *"}),s.jsx(xa,{value:p.locationId,onValueChange:E=>m(A=>({...A,locationId:E})),options:S,placeholder:"Select location",searchPlaceholder:"Search location…",emptyText:"No locations found.",disabled:n})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Label Category *"}),s.jsx(xa,{value:p.labelCategoryId,onValueChange:E=>m(A=>({...A,labelCategoryId:E})),options:j,placeholder:"Select category",searchPlaceholder:"Search category…",emptyText:"No categories found.",disabled:n})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Label Type *"}),s.jsx(xa,{value:p.labelTypeId,onValueChange:E=>m(A=>({...A,labelTypeId:E})),options:N,placeholder:"Select type",searchPlaceholder:"Search type…",emptyText:"No types found.",disabled:n})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Product * (multi-select)"}),s.jsx(O5,{value:p.productIds,onChange:E=>m(A=>({...A,productIds:E})),disabled:n,productOptions:d})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),s.jsx(Gt,{checked:p.state,onCheckedChange:E=>m(A=>({...A,state:E}))})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(fe,{disabled:c||n,onClick:x,children:c?"Creating…":"Create"})]})]})})}function Sue({open:e,label:t,onOpenChange:r,onUpdated:n}){const{loading:a,templates:i,locations:o,categories:u,types:d,productOptions:c}=E5(e),[h,p]=b.useState(!1),[m,v]=b.useState(!1),[x,y]=b.useState({labelName:"",templateCode:"",locationId:"",labelCategoryId:"",labelTypeId:"",productIds:[],labelInfoJson:null,state:!0});b.useEffect(()=>{if(!e||!t?.id)return;const C=t.id;y(WR(t));const O=new AbortController;let T=!1;return v(!0),(async()=>{try{const R=await Xce(C,O.signal);if(T)return;y(WR(R))}catch(R){if(T||R?.name==="AbortError")return;ge.error("Failed to load label details.",{description:R?.message?String(R.message):"Form shows list data only; check network."})}finally{T||v(!1)}})(),()=>{T=!0,O.abort()}},[e,t]);const S=async()=>{if(t?.id){if(!x.labelName.trim()||!x.templateCode.trim()||!x.locationId.trim()||!x.labelCategoryId.trim()||!x.labelTypeId.trim()){ge.error("Validation failed",{description:"Fill all required fields and select template, location, category, and type."});return}if(x.productIds.length===0){ge.error("Validation failed",{description:"Select at least one product."});return}p(!0);try{await Jce(t.id,x),ge.success("Label updated.",{description:"The label has been updated successfully."}),r(!1),n()}catch(C){ge.error("Failed to update label.",{description:C?.message?String(C.message):"Please try again."})}finally{p(!1)}}},j=b.useMemo(()=>{const C=i.filter(T=>Ku(T)).map(T=>({value:Ku(T),label:C5(T)})),O=x.templateCode;return O&&!C.some(T=>T.value===O)?[{value:O,label:`${O} (current)`},...C]:C},[i,x.templateCode]),N=b.useMemo(()=>{const C=o.map(T=>({value:T.id,label:ra(T.locationName??T.locationCode??T.id)})),O=x.locationId;return O&&!C.some(T=>T.value===O)?[{value:O,label:`${O} (current)`},...C]:C},[o,x.locationId]),E=b.useMemo(()=>{const C=u.map(T=>({value:T.id,label:ra(T.categoryName??T.categoryCode??T.id)})),O=x.labelCategoryId;return O&&!C.some(T=>T.value===O)?[{value:O,label:`${O} (current)`},...C]:C},[u,x.labelCategoryId]),A=b.useMemo(()=>{const C=d.map(T=>({value:T.id,label:ra(T.typeName??T.typeCode??T.id)})),O=x.labelTypeId;return O&&!C.some(T=>T.value===O)?[{value:O,label:`${O} (current)`},...C]:C},[d,x.labelTypeId]);return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-[600px]",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Edit Label"}),s.jsx(Pt,{children:m?"Loading label details…":"Update the label details."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Label Name *"}),s.jsx(me,{className:"h-10",placeholder:"e.g. Breakfast label",value:x.labelName,onChange:C=>y(O=>({...O,labelName:C.target.value})),disabled:m})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Label Template *"}),s.jsx(xa,{value:x.templateCode,onValueChange:C=>y(O=>({...O,templateCode:C})),options:j,placeholder:"Select template",searchPlaceholder:"Search template…",emptyText:"No templates found.",disabled:a||m})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Location *"}),s.jsx(xa,{value:x.locationId,onValueChange:C=>y(O=>({...O,locationId:C})),options:N,placeholder:"Select location",searchPlaceholder:"Search location…",emptyText:"No locations found.",disabled:a||m})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Label Category *"}),s.jsx(xa,{value:x.labelCategoryId,onValueChange:C=>y(O=>({...O,labelCategoryId:C})),options:E,placeholder:"Select category",searchPlaceholder:"Search category…",emptyText:"No categories found.",disabled:a||m})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Label Type *"}),s.jsx(xa,{value:x.labelTypeId,onValueChange:C=>y(O=>({...O,labelTypeId:C})),options:A,placeholder:"Select type",searchPlaceholder:"Search type…",emptyText:"No types found.",disabled:a||m})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Product * (multi-select)"}),s.jsx(O5,{value:x.productIds,onChange:C=>y(O=>({...O,productIds:C})),disabled:a||m,productOptions:c})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),s.jsx(Gt,{checked:x.state,onCheckedChange:C=>y(O=>({...O,state:C})),disabled:m})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{disabled:h||a||m,onClick:S,children:h?"Updating…":"Update"})]})]})})}function jue({open:e,label:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>(t?.labelName??"").trim()||t?.labelCode||t?.id||"this label",[t]),u=async()=>{if(t?.id){i(!0);try{await Qce(t.id),ge.success("Label deleted.",{description:"The label has been removed successfully."}),r(!1),n()}catch(d){ge.error("Failed to delete label.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-none",style:{width:"30%"},children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Delete Label"}),s.jsx(Pt,{children:"This action cannot be undone."})]}),s.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",s.jsx("span",{className:"font-medium",children:o}),"?"]}),s.jsxs(wt,{className:"flex-row flex-wrap justify-end",children:[s.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function D1(e){const t=(e??"").trim();return t||"None"}function _ue(){const[e,t]=b.useState(!1),[r,n]=b.useState(!1),[a,i]=b.useState(!1),[o,u]=b.useState(null),[d,c]=b.useState(null),[h,p]=b.useState([]),[m,v]=b.useState(!1),[x,y]=b.useState(0),[S,j]=b.useState(0),[N,E]=b.useState(null),[A,C]=b.useState(""),[O,T]=b.useState("all"),[R,L]=b.useState(1),[q,F]=b.useState(10),B=b.useRef(null),V=b.useRef(null),[G,W]=b.useState("");b.useEffect(()=>(V.current&&window.clearTimeout(V.current),V.current=window.setTimeout(()=>W(A.trim()),300),()=>{V.current&&window.clearTimeout(V.current)}),[A]);const H=Math.max(1,Math.ceil(x/q));b.useEffect(()=>{L(1)},[G,O,q]),b.useEffect(()=>((async()=>{B.current?.abort();const I=new AbortController;B.current=I,v(!0);try{const D=(R-1)*q,J=await y_({skipCount:D,maxResultCount:q,keyword:G||void 0,state:O==="all"?void 0:O==="true"},I.signal);p(J.items??[]),y(J.totalCount??0)}catch(D){if(D?.name==="AbortError")return;ge.error("Failed to load label categories.",{description:D?.message?String(D.message):"Please try again."}),p([]),y(0)}finally{v(!1)}})(),()=>B.current?.abort()),[G,O,R,q,S]);const U=()=>j(k=>k+1),$=k=>{E(null),u(k),n(!0)},Z=k=>{E(null),c(k),i(!0)};return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{className:"pb-4",children:s.jsx("div",{className:"flex flex-col gap-4",children:s.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[s.jsx(me,{placeholder:"Search",value:A,onChange:k=>C(k.target.value),style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),s.jsxs(We,{value:O,onValueChange:T,children:[s.jsx(Ke,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"State"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"all",children:"All States"}),s.jsx(_e,{value:"true",children:"Active"}),s.jsx(_e,{value:"false",children:"Inactive"})]})]}),s.jsx("div",{className:"flex-1"}),s.jsxs(fe,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0",onClick:()=>t(!0),children:["New Label Category ",s.jsx(In,{className:"ml-1 h-4 w-4"})]})]})})}),s.jsx("div",{className:"flex-1 overflow-auto pt-6",children:s.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-50 hover:bg-gray-50",children:[s.jsx(ye,{className:"font-bold text-gray-900 w-[250px]",children:"Label Category"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[200px]",children:"Category Code"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[200px]",children:"Category Photo"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[100px]",children:"State"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[100px]",children:"Order"}),s.jsx(ye,{className:"font-bold text-gray-900",children:"Last Edited"}),s.jsx(ye,{className:"font-bold text-gray-900 text-center w-[100px]",children:"Actions"})]})}),s.jsx($r,{children:m?s.jsx(Fe,{children:s.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):h.length===0?s.jsx(Fe,{children:s.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):h.map(k=>s.jsxs(Fe,{className:"hover:bg-gray-50",children:[s.jsx(de,{className:"font-medium",children:D1(k.categoryName)}),s.jsx(de,{className:"text-gray-600",children:D1(k.categoryCode)}),s.jsx(de,{className:"text-gray-500",children:D1(k.categoryPhotoUrl)}),s.jsx(de,{children:s.jsx(Or,{className:k.state?"bg-green-600":"bg-gray-400",children:k.state?"Active":"Inactive"})}),s.jsx(de,{className:"font-numeric",children:k.orderNum??"None"}),s.jsx(de,{className:"text-gray-500 tabular-nums font-numeric",children:k.creationTime?new Date(k.creationTime).toLocaleString():"None"}),s.jsx(de,{className:"text-center",children:s.jsxs(Ta,{open:N===k.id,onOpenChange:I=>E(I?k.id:null),children:[s.jsx(ka,{asChild:!0,children:s.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:s.jsx(Ji,{className:"h-4 w-4 text-gray-500"})})}),s.jsxs(Ra,{align:"end",className:"w-40 p-1",children:[s.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>$(k),children:[s.jsx(kn,{className:"w-4 h-4"}),"Edit"]}),s.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>Z(k),children:"Delete"})]})]})})]},k.id))})]})})}),s.jsx("div",{className:"pt-4",children:s.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[s.jsxs("div",{children:["Showing ",x===0?0:(R-1)*q+1,"-",Math.min(R*q,x)," of ",x]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(We,{value:String(q),onValueChange:k=>F(Number(k)),children:[s.jsx(Ke,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:s.jsx(Ge,{})}),s.jsx(Xe,{children:[10,20,50].map(k=>s.jsxs(_e,{value:String(k),children:[k," / page"]},k))})]}),s.jsx(Gi,{className:"mx-0 w-auto justify-end",children:s.jsxs(Ki,{children:[s.jsx(Mt,{children:s.jsx(Xi,{href:"#",size:"default",onClick:k=>{k.preventDefault(),L(I=>Math.max(1,I-1))},"aria-disabled":R<=1,className:R<=1?"pointer-events-none opacity-50":""})}),s.jsx(Mt,{children:s.jsxs(Ca,{href:"#",isActive:!0,size:"default",onClick:k=>k.preventDefault(),children:["Page ",R," / ",H]})}),s.jsx(Mt,{children:s.jsx(Yi,{href:"#",size:"default",onClick:k=>{k.preventDefault(),L(I=>Math.min(H,I+1))},"aria-disabled":R>=H,className:R>=H?"pointer-events-none opacity-50":""})})]})})]})]})}),s.jsx(Nue,{open:e,onOpenChange:t,onCreated:()=>{L(1),U()}}),s.jsx(Cue,{open:r,category:o,onOpenChange:k=>{n(k),k||u(null)},onUpdated:U}),s.jsx(Eue,{open:a,category:d,onOpenChange:k=>{i(k),k||c(null)},onDeleted:U})]})}function Nue({open:e,onOpenChange:t,onCreated:r}){const[n,a]=b.useState(!1),[i,o]=b.useState({categoryCode:"",categoryName:"",categoryPhotoUrl:null,state:!0,orderNum:null}),u=()=>{o({categoryCode:"",categoryName:"",categoryPhotoUrl:null,state:!0,orderNum:null})};b.useEffect(()=>{e||u()},[e]);const d=async()=>{if(!i.categoryCode.trim()||!i.categoryName.trim()){ge.error("Validation failed",{description:"Category Code and Category Name are required."});return}if(i.orderNum===null||i.orderNum===void 0||!Number.isFinite(i.orderNum)){ge.error("Validation failed",{description:"Order is required."});return}a(!0);try{await rue(i),ge.success("Label category created.",{description:"The label category has been created successfully."}),t(!1),r()}catch(c){ge.error("Failed to create label category.",{description:c?.message?String(c.message):"Please try again."})}finally{a(!1)}};return s.jsx(vt,{open:e,onOpenChange:t,children:s.jsxs(mt,{className:"sm:max-w-[600px]",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Add New Label Category"}),s.jsx(Pt,{children:"Enter the details for the new label category."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Category Code *"}),s.jsx(me,{placeholder:"e.g. CAT_PREP",value:i.categoryCode,onChange:c=>o(h=>({...h,categoryCode:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Category Name *"}),s.jsx(me,{placeholder:"e.g. Prep",value:i.categoryName,onChange:c=>o(h=>({...h,categoryName:c.target.value}))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Category Photo URL"}),s.jsx(me,{placeholder:"https://cdn.example.com/cat-prep.png",value:i.categoryPhotoUrl??"",onChange:c=>o(h=>({...h,categoryPhotoUrl:c.target.value||null}))})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Order *"}),s.jsx(me,{type:"number",placeholder:"e.g. 1",value:i.orderNum??"",onChange:c=>o(h=>({...h,orderNum:c.target.value?Number(c.target.value):null}))})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),s.jsx(Gt,{checked:i.state,onCheckedChange:c=>o(h=>({...h,state:c}))})]})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(fe,{disabled:n,onClick:d,children:n?"Creating...":"Create"})]})]})})}function Cue({open:e,category:t,onOpenChange:r,onUpdated:n}){const[a,i]=b.useState(!1),[o,u]=b.useState(!1),[d,c]=b.useState({categoryCode:"",categoryName:"",categoryPhotoUrl:null,state:!0,orderNum:null});b.useEffect(()=>{e&&t&&c({categoryCode:t.categoryCode??"",categoryName:t.categoryName??"",categoryPhotoUrl:t.categoryPhotoUrl??null,state:t.state??!0,orderNum:t.orderNum??null})},[e,t]);const h=async()=>{if(t?.id){if(!d.categoryCode.trim()||!d.categoryName.trim()){ge.error("Validation failed",{description:"Category Code and Category Name are required."});return}if(d.orderNum===null||d.orderNum===void 0||!Number.isFinite(d.orderNum)){ge.error("Validation failed",{description:"Order is required."});return}i(!0);try{await nue(t.id,d),ge.success("Label category updated.",{description:"The label category has been updated successfully."}),r(!1),n()}catch(p){ge.error("Failed to update label category.",{description:p?.message?String(p.message):"Please try again."})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-[600px]",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Edit Label Category"}),s.jsx(Pt,{children:"Update the label category details."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Category Code *"}),s.jsx(me,{placeholder:"e.g. CAT_PREP",value:d.categoryCode,onChange:p=>c(m=>({...m,categoryCode:p.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Category Name *"}),s.jsx(me,{placeholder:"e.g. Prep",value:d.categoryName,onChange:p=>c(m=>({...m,categoryName:p.target.value}))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Category Photo URL"}),s.jsx(me,{placeholder:"https://cdn.example.com/cat-prep.png",value:d.categoryPhotoUrl??"",onChange:p=>c(m=>({...m,categoryPhotoUrl:p.target.value||null}))})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Order *"}),s.jsx(me,{type:"number",placeholder:"e.g. 1",value:d.orderNum??"",onChange:p=>c(m=>({...m,orderNum:p.target.value?Number(p.target.value):null}))})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),s.jsx(Gt,{checked:d.state,onCheckedChange:p=>c(m=>({...m,state:p}))})]})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{disabled:a,onClick:h,children:a?"Updating...":"Update"})]})]})})}function Eue({open:e,category:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>(t?.categoryName??"").trim()||t?.categoryCode||"this category",[t]),u=async()=>{if(t?.id){i(!0);try{await aue(t.id),ge.success("Label category deleted.",{description:"The label category has been removed successfully."}),r(!1),n()}catch(d){ge.error("Failed to delete label category.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-none",style:{width:"30%"},children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Delete Label Category"}),s.jsx(Pt,{children:"This action cannot be undone."})]}),s.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",s.jsx("span",{className:"font-medium",children:o}),"?"]}),s.jsxs(wt,{className:"flex-row flex-wrap justify-end",children:[s.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function GR(e){const t=(e??"").trim();return t||"None"}function Oue(){const[e,t]=b.useState(!1),[r,n]=b.useState(!1),[a,i]=b.useState(!1),[o,u]=b.useState(null),[d,c]=b.useState(null),[h,p]=b.useState([]),[m,v]=b.useState(!1),[x,y]=b.useState(0),[S,j]=b.useState(0),[N,E]=b.useState(null),[A,C]=b.useState(""),[O,T]=b.useState("all"),[R,L]=b.useState(1),[q,F]=b.useState(10),B=b.useRef(null),V=b.useRef(null),[G,W]=b.useState("");b.useEffect(()=>(V.current&&window.clearTimeout(V.current),V.current=window.setTimeout(()=>W(A.trim()),300),()=>{V.current&&window.clearTimeout(V.current)}),[A]);const H=Math.max(1,Math.ceil(x/q));b.useEffect(()=>{L(1)},[G,O,q]),b.useEffect(()=>((async()=>{B.current?.abort();const I=new AbortController;B.current=I,v(!0);try{const D=(R-1)*q,J=await _5({skipCount:D,maxResultCount:q,keyword:G||void 0,state:O==="all"?void 0:O==="true"},I.signal);p(J.items??[]),y(J.totalCount??0)}catch(D){if(D?.name==="AbortError")return;ge.error("Failed to load label types.",{description:D?.message?String(D.message):"Please try again."}),p([]),y(0)}finally{v(!1)}})(),()=>B.current?.abort()),[G,O,R,q,S]);const U=()=>j(k=>k+1),$=k=>{E(null),u(k),n(!0)},Z=k=>{E(null),c(k),i(!0)};return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{className:"pb-4",children:s.jsx("div",{className:"flex flex-col gap-4",children:s.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[s.jsx(me,{placeholder:"Search",value:A,onChange:k=>C(k.target.value),style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),s.jsxs(We,{value:O,onValueChange:T,children:[s.jsx(Ke,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"State"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"all",children:"All States"}),s.jsx(_e,{value:"true",children:"Active"}),s.jsx(_e,{value:"false",children:"Inactive"})]})]}),s.jsx("div",{className:"flex-1"}),s.jsxs(fe,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0",onClick:()=>t(!0),children:["New Label Type ",s.jsx(In,{className:"ml-1 h-4 w-4"})]})]})})}),s.jsx("div",{className:"flex-1 overflow-auto pt-6",children:s.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-50 hover:bg-gray-50",children:[s.jsx(ye,{className:"font-bold text-gray-900 w-[250px]",children:"Label Types"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[200px]",children:"Type Code"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[100px]",children:"State"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[100px]",children:"Order"}),s.jsx(ye,{className:"font-bold text-gray-900",children:"Last Edited"}),s.jsx(ye,{className:"font-bold text-gray-900 text-center w-[100px]",children:"Actions"})]})}),s.jsx($r,{children:m?s.jsx(Fe,{children:s.jsx(de,{colSpan:6,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):h.length===0?s.jsx(Fe,{children:s.jsx(de,{colSpan:6,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):h.map(k=>s.jsxs(Fe,{className:"hover:bg-gray-50",children:[s.jsx(de,{className:"font-medium",children:GR(k.typeName)}),s.jsx(de,{className:"text-gray-600",children:GR(k.typeCode)}),s.jsx(de,{children:s.jsx(Or,{className:k.state?"bg-green-600":"bg-gray-400",children:k.state?"Active":"Inactive"})}),s.jsx(de,{className:"font-numeric",children:k.orderNum??"None"}),s.jsx(de,{className:"text-gray-500 tabular-nums font-numeric",children:k.creationTime?new Date(k.creationTime).toLocaleString():"None"}),s.jsx(de,{className:"text-center",children:s.jsxs(Ta,{open:N===k.id,onOpenChange:I=>E(I?k.id:null),children:[s.jsx(ka,{asChild:!0,children:s.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:s.jsx(Ji,{className:"h-4 w-4 text-gray-500"})})}),s.jsxs(Ra,{align:"end",className:"w-40 p-1",children:[s.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>$(k),children:[s.jsx(kn,{className:"w-4 h-4"}),"Edit"]}),s.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>Z(k),children:"Delete"})]})]})})]},k.id))})]})})}),s.jsx("div",{className:"pt-4",children:s.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[s.jsxs("div",{children:["Showing ",x===0?0:(R-1)*q+1,"-",Math.min(R*q,x)," of ",x]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(We,{value:String(q),onValueChange:k=>F(Number(k)),children:[s.jsx(Ke,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:s.jsx(Ge,{})}),s.jsx(Xe,{children:[10,20,50].map(k=>s.jsxs(_e,{value:String(k),children:[k," / page"]},k))})]}),s.jsx(Gi,{className:"mx-0 w-auto justify-end",children:s.jsxs(Ki,{children:[s.jsx(Mt,{children:s.jsx(Xi,{href:"#",size:"default",onClick:k=>{k.preventDefault(),L(I=>Math.max(1,I-1))},"aria-disabled":R<=1,className:R<=1?"pointer-events-none opacity-50":""})}),s.jsx(Mt,{children:s.jsxs(Ca,{href:"#",isActive:!0,size:"default",onClick:k=>k.preventDefault(),children:["Page ",R," / ",H]})}),s.jsx(Mt,{children:s.jsx(Yi,{href:"#",size:"default",onClick:k=>{k.preventDefault(),L(I=>Math.min(H,I+1))},"aria-disabled":R>=H,className:R>=H?"pointer-events-none opacity-50":""})})]})})]})]})}),s.jsx(Pue,{open:e,onOpenChange:t,onCreated:()=>{L(1),U()}}),s.jsx(Aue,{open:r,type:o,onOpenChange:k=>{n(k),k||u(null)},onUpdated:U}),s.jsx(Tue,{open:a,type:d,onOpenChange:k=>{i(k),k||c(null)},onDeleted:U})]})}function Pue({open:e,onOpenChange:t,onCreated:r}){const[n,a]=b.useState(!1),[i,o]=b.useState({typeCode:"",typeName:"",state:!0,orderNum:null}),u=()=>{o({typeCode:"",typeName:"",state:!0,orderNum:null})};b.useEffect(()=>{e||u()},[e]);const d=async()=>{if(!i.typeCode.trim()||!i.typeName.trim()){ge.error("Validation failed",{description:"Type Code and Type Name are required."});return}if(i.orderNum===null||i.orderNum===void 0||!Number.isFinite(i.orderNum)){ge.error("Validation failed",{description:"Order is required."});return}a(!0);try{await iue(i),ge.success("Label type created.",{description:"The label type has been created successfully."}),t(!1),r()}catch(c){ge.error("Failed to create label type.",{description:c?.message?String(c.message):"Please try again."})}finally{a(!1)}};return s.jsx(vt,{open:e,onOpenChange:t,children:s.jsxs(mt,{className:"sm:max-w-[600px]",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Add New Label Type"}),s.jsx(Pt,{children:"Enter the details for the new label type."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Type Code *"}),s.jsx(me,{placeholder:"e.g. TYPE_DEFROST",value:i.typeCode,onChange:c=>o(h=>({...h,typeCode:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Type Name *"}),s.jsx(me,{placeholder:"e.g. Defrost",value:i.typeName,onChange:c=>o(h=>({...h,typeName:c.target.value}))})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Order *"}),s.jsx(me,{type:"number",placeholder:"e.g. 1",value:i.orderNum??"",onChange:c=>o(h=>({...h,orderNum:c.target.value?Number(c.target.value):null}))})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),s.jsx(Gt,{checked:i.state,onCheckedChange:c=>o(h=>({...h,state:c}))})]})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(fe,{disabled:n,onClick:d,children:n?"Creating...":"Create"})]})]})})}function Aue({open:e,type:t,onOpenChange:r,onUpdated:n}){const[a,i]=b.useState(!1),[o,u]=b.useState({typeCode:"",typeName:"",state:!0,orderNum:null});b.useEffect(()=>{e&&t&&u({typeCode:t.typeCode??"",typeName:t.typeName??"",state:t.state??!0,orderNum:t.orderNum??null})},[e,t]);const d=async()=>{if(t?.id){if(!o.typeCode.trim()||!o.typeName.trim()){ge.error("Validation failed",{description:"Type Code and Type Name are required."});return}if(o.orderNum===null||o.orderNum===void 0||!Number.isFinite(o.orderNum)){ge.error("Validation failed",{description:"Order is required."});return}i(!0);try{await oue(t.id,o),ge.success("Label type updated.",{description:"The label type has been updated successfully."}),r(!1),n()}catch(c){ge.error("Failed to update label type.",{description:c?.message?String(c.message):"Please try again."})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-[600px]",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Edit Label Type"}),s.jsx(Pt,{children:"Update the label type details."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Type Code *"}),s.jsx(me,{placeholder:"e.g. TYPE_DEFROST",value:o.typeCode,onChange:c=>u(h=>({...h,typeCode:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Type Name *"}),s.jsx(me,{placeholder:"e.g. Defrost",value:o.typeName,onChange:c=>u(h=>({...h,typeName:c.target.value}))})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Order *"}),s.jsx(me,{type:"number",placeholder:"e.g. 1",value:o.orderNum??"",onChange:c=>u(h=>({...h,orderNum:c.target.value?Number(c.target.value):null}))})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),s.jsx(Gt,{checked:o.state,onCheckedChange:c=>u(h=>({...h,state:c}))})]})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{disabled:a,onClick:d,children:a?"Updating...":"Update"})]})]})})}function Tue({open:e,type:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>(t?.typeName??"").trim()||t?.typeCode||"this type",[t]),u=async()=>{if(t?.id){i(!0);try{await sue(t.id),ge.success("Label type deleted.",{description:"The label type has been removed successfully."}),r(!1),n()}catch(d){ge.error("Failed to delete label type.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-none",style:{width:"30%"},children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Delete Label Type"}),s.jsx(Pt,{children:"This action cannot be undone."})]}),s.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",s.jsx("span",{className:"font-medium",children:o}),"?"]}),s.jsxs(wt,{className:"flex-row flex-wrap justify-end",children:[s.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function kue(){return`template-${Date.now()}`}function Rue(){return`el-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Iue(e){return{id:e??kue(),name:"未命名模板",labelType:"PRICE",unit:"cm",width:6,height:4,appliedLocation:"ALL",appliedLocationIds:[],showRuler:!0,showGrid:!0,elements:[]}}const L1=[{name:'2"×1"',width:2,height:1,unit:"inch"},{name:'2"×2"',width:2,height:2,unit:"inch"},{name:'3"×1"',width:3,height:1,unit:"inch"},{name:'3"×2"',width:3,height:2,unit:"inch"},{name:'4"×2"',width:4,height:2,unit:"inch"},{name:'4"×6"',width:4,height:6,unit:"inch"},{name:"6cm×4cm",width:6,height:4,unit:"cm"},{name:"10cm×6cm",width:10,height:6,unit:"cm"},{name:"A4",width:21,height:29.7,unit:"cm"},{name:"A5",width:14.8,height:21,unit:"cm"}];function KR(e,t=20,r=20){const n=Rue(),i={TEXT_STATIC:{width:120,height:24,config:{text:"文本",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left"}},TEXT_PRODUCT:{width:120,height:24,config:{text:"商品名",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left"}},TEXT_PRICE:{width:80,height:24,config:{text:"0.00",prefix:"¥",decimal:2,fontFamily:"Arial",fontSize:14,fontWeight:"bold",textAlign:"right"}},BARCODE:{width:160,height:48,config:{barcodeType:"CODE128",data:"123456789",showText:!0,orientation:"horizontal"}},QRCODE:{width:80,height:80,config:{data:"https://example.com",errorLevel:"M"}},IMAGE:{width:60,height:60,config:{src:"",scaleMode:"contain"}},DATE:{width:120,height:24,config:{format:"YYYY-MM-DD",offsetDays:0}},TIME:{width:100,height:24,config:{format:"HH:mm",offsetDays:0}},DURATION:{width:120,height:24,config:{format:"YYYY-MM-DD",offsetDays:3}},WEIGHT:{width:80,height:24,config:{unit:"g",value:500}},WEIGHT_PRICE:{width:100,height:24,config:{unitPrice:10,weight:.5,currency:"¥"}},BLANK:{width:40,height:24,config:{}},NUTRITION:{width:200,height:120,config:{calories:120,fat:"5g",protein:"3g",carbs:"10g",layout:"standard"}}}[e];return{id:n,type:e,x:t,y:r,width:i.width,height:i.height,rotation:"horizontal",border:"none",config:{...i.config}}}function P5(e){const t=String(e.appliedLocation??"").trim().toUpperCase();return t==="ALL"?"ALL":t==="SPECIFIED"||(e.appliedLocationIds?.length??0)>0?"SPECIFIED":"ALL"}function Mue(e){switch(e){case"TEXT_PRODUCT":return"PRODUCT";case"TEXT_PRICE":return"PRICE";default:return"FIXED"}}const Due=[{title:"模版信息",items:[{label:"Text",type:"TEXT_STATIC"},{label:"QR Code",type:"QRCODE"},{label:"Barcode",type:"BARCODE"},{label:"Blank Space",type:"BLANK"},{label:"Price",type:"TEXT_PRICE"},{label:"Image",type:"IMAGE"},{label:"Logo",type:"IMAGE"}]},{title:"标签信息",items:[{label:"Label Name",type:"TEXT_PRODUCT"},{label:"Text",type:"TEXT_STATIC"},{label:"QR Code",type:"QRCODE"},{label:"Barcode",type:"BARCODE"},{label:"Nutrition Facts",type:"NUTRITION"},{label:"Price",type:"TEXT_PRICE"},{label:"Duration Date",type:"DATE"},{label:"Duration Time",type:"TIME"},{label:"Duration",type:"DURATION"},{label:"Image",type:"IMAGE"},{label:"Label Type",type:"TEXT_STATIC"},{label:"How-to",type:"TEXT_STATIC"},{label:"Expiration Alert",type:"TEXT_STATIC"}]},{title:"自动生成",items:[{label:"Company",type:"TEXT_STATIC"},{label:"Employee",type:"TEXT_STATIC"},{label:"Current Date",type:"DATE"},{label:"Current Time",type:"TIME"},{label:"Label ID",type:"TEXT_STATIC"}]},{title:"打印时输入",subtitle:"点击添加到画布",items:[{label:"Text",type:"TEXT_STATIC",config:{inputType:"text"}},{label:"Weight",type:"WEIGHT"},{label:"Number",type:"TEXT_STATIC",config:{inputType:"number",text:"0"}},{label:"Date & Time",type:"DATE",config:{inputType:"datetime"}},{label:"Multiple Options",type:"TEXT_STATIC",config:{inputType:"options",multipleOptionId:"",selectedOptionValues:[],text:"文本",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left",prefix:"¥"}}]}];function Lue({onAddElement:e}){return s.jsxs("div",{className:"w-44 shrink-0 border-r border-gray-200 bg-white flex flex-col h-full",children:[s.jsx("div",{className:"px-2 py-2 border-b border-gray-200 font-semibold text-gray-800 text-sm",children:"Elements"}),s.jsx(al,{className:"flex-1",children:s.jsx("div",{className:"p-1.5 space-y-3",children:Due.map(t=>s.jsxs("div",{children:[s.jsx("div",{className:"px-2 py-1 text-xs font-medium text-gray-500 uppercase tracking-wide",children:t.title}),t.subtitle&&s.jsx("div",{className:"px-2 py-0.5 text-[10px] text-gray-400",children:t.subtitle}),s.jsx("div",{className:"grid grid-cols-2 gap-1 mt-0.5",children:t.items.map((r,n)=>s.jsx("button",{type:"button",onClick:()=>e(r.type,r.config),className:"text-left px-2 py-1 text-xs rounded hover:bg-gray-100 border border-transparent hover:border-gray-200 truncate",children:r.label},`${t.title}-${r.label}-${n}`))})]},t.title))})})]})}var nh={},Wc={},ah={},XR;function vn(){if(XR)return ah;XR=1,Object.defineProperty(ah,"__esModule",{value:!0});function e(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var t=function r(n,a){e(this,r),this.data=n,this.text=a.text||n,this.options=a};return ah.default=t,ah}var YR;function $ue(){if(YR)return Wc;YR=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.CODE39=void 0;var e=(function(){function y(S,j){for(var N=0;N=200){S=m.shift()-105;var j=n.SWAP[S];j!==void 0?y=h.next(m,v+1,j):((x===n.SET_A||x===n.SET_B)&&S===n.SHIFT&&(m[0]=x===n.SET_A?m[0]>95?m[0]-96:m[0]:m[0]<32?m[0]+96:m[0]),y=h.next(m,v+1,x))}else S=h.correctIndex(m,x),y=h.next(m,v+1,x);var N=h.getBar(S),E=S*v;return{result:N+y.result,checksum:E+y.checksum}}}]),h})(r.default);return oh.default=d,oh}var sh={},ZR;function Bue(){if(ZR)return sh;ZR=1,Object.defineProperty(sh,"__esModule",{value:!0});var e=yd(),t=function(u){return u.match(new RegExp("^"+e.A_CHARS+"*"))[0].length},r=function(u){return u.match(new RegExp("^"+e.B_CHARS+"*"))[0].length},n=function(u){return u.match(new RegExp("^"+e.C_CHARS+"*"))[0]};function a(o,u){var d=u?e.A_CHARS:e.B_CHARS,c=o.match(new RegExp("^("+d+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(c)return c[1]+"Ì"+i(o.substring(c[1].length));var h=o.match(new RegExp("^"+d+"+"))[0];return h.length===o.length?o:h+String.fromCharCode(u?205:206)+a(o.substring(h.length),!u)}function i(o){var u=n(o),d=u.length;if(d===o.length)return o;o=o.substring(d);var c=t(o)>=r(o);return u+String.fromCharCode(c?206:205)+a(o,c)}return sh.default=function(o){var u=void 0,d=n(o).length;if(d>=2)u=e.C_START_CHAR+i(o);else{var c=t(o)>r(o);u=(c?e.A_START_CHAR:e.B_START_CHAR)+a(o,c)}return u.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(h,p){return"Ë"+p})},sh}var eI;function Fue(){if(eI)return ih;eI=1,Object.defineProperty(ih,"__esModule",{value:!0});var e=yg(),t=a(e),r=Bue(),n=a(r);function a(c){return c&&c.__esModule?c:{default:c}}function i(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}function o(c,h){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:c}function u(c,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);c.prototype=Object.create(h&&h.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(c,h):c.__proto__=h)}var d=(function(c){u(h,c);function h(p,m){if(i(this,h),/^[\x00-\x7F\xC8-\xD3]+$/.test(p))var v=o(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,(0,n.default)(p),m));else var v=o(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,p,m));return o(v)}return h})(t.default);return ih.default=d,ih}var lh={},tI;function zue(){if(tI)return lh;tI=1,Object.defineProperty(lh,"__esModule",{value:!0});var e=(function(){function c(h,p){for(var m=0;mx.width*10?x.width*10:x.fontSize,y.guardHeight=x.height+y.fontSize/2+x.textMargin,y}return e(m,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(x,y){return this.text.substr(x,y)}},{key:"leftEncode",value:function(x,y){return(0,n.default)(x,y)}},{key:"rightText",value:function(x,y){return this.text.substr(x,y)}},{key:"rightEncode",value:function(x,y){return(0,n.default)(x,y)}},{key:"encodeGuarded",value:function(){var x={fontSize:this.fontSize},y={height:this.guardHeight};return[{data:t.SIDE_BIN,options:y},{data:this.leftEncode(),text:this.leftText(),options:x},{data:t.MIDDLE_BIN,options:y},{data:this.rightEncode(),text:this.rightText(),options:x},{data:t.SIDE_BIN,options:y}]}},{key:"encodeFlat",value:function(){var x=[t.SIDE_BIN,this.leftEncode(),t.MIDDLE_BIN,this.rightEncode(),t.SIDE_BIN];return{data:x.join(""),text:this.text}}}]),m})(i.default);return fh.default=h,fh}var lI;function Hue(){if(lI)return dh;lI=1,Object.defineProperty(dh,"__esModule",{value:!0});var e=(function(){function p(m,v){for(var x=0;xx.width*10?y.fontSize=x.width*10:y.fontSize=x.fontSize,y.guardHeight=x.height+y.fontSize/2+x.textMargin,y}return e(m,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==h(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var x="";return x+="101",x+=(0,r.default)(this.data.substr(0,6),"LLLLLL"),x+="01010",x+=(0,r.default)(this.data.substr(6,6),"RRRRRR"),x+="101",{data:x,text:this.text}}},{key:"guardedEncoding",value:function(){var x=[];return this.displayValue&&x.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),x.push({data:"101"+(0,r.default)(this.data[0],"L"),options:{height:this.guardHeight}}),x.push({data:(0,r.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),x.push({data:"01010",options:{height:this.guardHeight}}),x.push({data:(0,r.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),x.push({data:(0,r.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&x.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),x}}]),m})(a.default);function h(p){var m=0,v;for(v=1;v<11;v+=2)m+=parseInt(p[v]);for(v=0;v<11;v+=2)m+=parseInt(p[v])*3;return(10-m%10)%10}return Gc.default=c,Gc}var vh={},hI;function Xue(){if(hI)return vh;hI=1,Object.defineProperty(vh,"__esModule",{value:!0});var e=(function(){function x(y,S){for(var j=0;jj.width*10?N.fontSize=j.width*10:N.fontSize=j.fontSize,N.guardHeight=j.height+N.fontSize/2+j.textMargin,N}return e(y,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var j="";return j+="101",j+=this.encodeMiddleDigits(),j+="010101",{data:j,text:this.text}}},{key:"guardedEncoding",value:function(){var j=[];return this.displayValue&&j.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),j.push({data:"101",options:{height:this.guardHeight}}),j.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),j.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&j.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),j}},{key:"encodeMiddleDigits",value:function(){var j=this.upcA[0],N=this.upcA[this.upcA.length-1],E=p[parseInt(N)][parseInt(j)];return(0,r.default)(this.middleDigits,E)}}]),y})(a.default);function v(x,y){for(var S=parseInt(x[x.length-1]),j=h[S],N="",E=0,A=0;A=3&&this.number<=131070}}]),c})(r.default);return Xc.pharmacode=u,Xc}var Yc={},EI;function ode(){if(EI)return Yc;EI=1,Object.defineProperty(Yc,"__esModule",{value:!0}),Yc.codabar=void 0;var e=(function(){function d(c,h){for(var p=0;p":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"":["(%)","T"]}),Ls}var PI;function R5(){if(PI)return Nh;PI=1,Object.defineProperty(Nh,"__esModule",{value:!0});var e=(function(){function c(h,p){for(var m=0;m0?h.fontSize+h.textMargin:0)+h.marginTop+h.marginBottom}function a(c,h,p){if(p.displayValue&&hh&&(h=c[p].height);return h}function d(c,h,p){var m;if(p)m=p;else if(typeof document<"u")m=document.createElement("canvas").getContext("2d");else return 0;m.font=h.fontOptions+" "+h.fontSize+"px "+h.font;var v=m.measureText(c);if(!v)return 0;var x=v.width;return x}return rn.getMaximumHeightOfEncodings=u,rn.getEncodingHeight=n,rn.getBarcodePadding=a,rn.calculateEncodingAttributes=i,rn.getTotalWidthOfEncodings=o,rn}var zI;function mde(){if(zI)return Mh;zI=1,Object.defineProperty(Mh,"__esModule",{value:!0});var e=(function(){function u(d,c){for(var h=0;h0?(v=0,p.textAlign="left"):c.textAlign=="right"?(v=h.width-1,p.textAlign="right"):(v=h.width/2,p.textAlign="center"),p.fillText(h.text,v,x)}}},{key:"moveCanvasDrawing",value:function(c){var h=this.canvas.getContext("2d");h.translate(c.width,0)}},{key:"restoreCanvas",value:function(){var c=this.canvas.getContext("2d");c.restore()}}]),u})();return Mh.default=o,Mh}var Dh={},qI;function gde(){if(qI)return Dh;qI=1,Object.defineProperty(Dh,"__esModule",{value:!0});var e=(function(){function d(c,h){for(var p=0;p0&&(this.drawRect(S-p.width*y,x,p.width*y,p.height,h),y=0);y>0&&this.drawRect(S-p.width*(y-1),x,p.width*y,p.height,h)}},{key:"drawSVGText",value:function(h,p,m){var v=this.document.createElementNS(o,"text");if(p.displayValue){var x,y;v.setAttribute("font-family",p.font),v.setAttribute("font-size",p.fontSize),p.fontOptions.includes("bold")&&v.setAttribute("font-weight","bold"),p.fontOptions.includes("italic")&&v.setAttribute("font-style","italic"),p.textPosition=="top"?y=p.fontSize-p.textMargin:y=p.height+p.textMargin+p.fontSize,p.textAlign=="left"||m.barcodePadding>0?(x=0,v.setAttribute("text-anchor","start")):p.textAlign=="right"?(x=m.width-1,v.setAttribute("text-anchor","end")):(x=m.width/2,v.setAttribute("text-anchor","middle")),v.setAttribute("x",x),v.setAttribute("y",y),v.appendChild(this.document.createTextNode(m.text)),h.appendChild(v)}}},{key:"setSvgAttributes",value:function(h,p){var m=this.svg;m.setAttribute("width",h+"px"),m.setAttribute("height",p+"px"),m.setAttribute("x","0px"),m.setAttribute("y","0px"),m.setAttribute("viewBox","0 0 "+h+" "+p),m.setAttribute("xmlns",o),m.setAttribute("version","1.1")}},{key:"createGroup",value:function(h,p,m){var v=this.document.createElementNS(o,"g");return v.setAttribute("transform","translate("+h+", "+p+")"),m.appendChild(v),v}},{key:"setGroupOptions",value:function(h,p){h.setAttribute("fill",p.lineColor)}},{key:"drawRect",value:function(h,p,m,v,x){var y=this.document.createElementNS(o,"rect");return y.setAttribute("x",h),y.setAttribute("y",p),y.setAttribute("width",m),y.setAttribute("height",v),x.appendChild(y),y}}]),d})();return Dh.default=u,Dh}var Lh={},UI;function vde(){if(UI)return Lh;UI=1,Object.defineProperty(Lh,"__esModule",{value:!0});var e=(function(){function n(a,i){for(var o=0;o"u"?"undefined":e(h))==="object"&&!h.nodeName)return{element:h,renderer:a.default.ObjectRenderer};throw new i.InvalidElementException}}function d(h){var p=document.querySelectorAll(h);if(p.length!==0){for(var m=[],v=0;v"u")throw Error("No element to render on was provided.");return V._renderProperties=(0,c.default)(q),V._encodings=[],V._options=S.default,V._errorHandler=new v.default(V),typeof F<"u"&&(B=B||{},B.format||(B.format=T()),V.options(B)[B.format](F,B).render()),V};E.getModule=function(L){return t.default[L]};for(var A in t.default)t.default.hasOwnProperty(A)&&C(t.default,A);function C(L,q){N.prototype[q]=N.prototype[q.toUpperCase()]=N.prototype[q.toLowerCase()]=function(F,B){var V=this;return V._errorHandler.wrapBarcodeCall(function(){B.text=typeof B.text>"u"?void 0:""+B.text;var G=(0,n.default)(V._options,B);G=(0,p.default)(G);var W=L[q],H=O(F,W,G);return V._encodings.push(H),V})}}function O(L,q,F){L=""+L;var B=new q(L,F);if(!B.valid())throw new x.InvalidInputException(B.constructor.name,L);var V=B.encode();V=(0,i.default)(V);for(var G=0;Gt in e?_de(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,TS=(e,t)=>{for(var r in t||(t={}))$5.call(t,r)&&XI(e,r,t[r]);if(om)for(var r of om(t))B5.call(t,r)&&XI(e,r,t[r]);return e},kS=(e,t)=>{var r={};for(var n in e)$5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&om)for(var n of om(e))t.indexOf(n)<0&&B5.call(e,n)&&(r[n]=e[n]);return r};/** + * @license QR Code generator library (TypeScript) + * Copyright (c) Project Nayuki. + * SPDX-License-Identifier: MIT + */var Xo;(e=>{const t=class at{constructor(d,c,h,p){if(this.version=d,this.errorCorrectionLevel=c,this.modules=[],this.isFunction=[],dat.MAX_VERSION)throw new RangeError("Version value out of range");if(p<-1||p>7)throw new RangeError("Mask value out of range");this.size=d*4+17;let m=[];for(let x=0;x7)throw new RangeError("Invalid value");let x,y;for(x=h;;x++){const E=at.getNumDataCodewords(x,c)*8,A=o.getTotalBits(d,x);if(A<=E){y=A;break}if(x>=p)throw new RangeError("Data too long")}for(const E of[at.Ecc.MEDIUM,at.Ecc.QUARTILE,at.Ecc.HIGH])v&&y<=at.getNumDataCodewords(x,E)*8&&(c=E);let S=[];for(const E of d){r(E.mode.modeBits,4,S),r(E.numChars,E.mode.numCharCountBits(x),S);for(const A of E.getData())S.push(A)}a(S.length==y);const j=at.getNumDataCodewords(x,c)*8;a(S.length<=j),r(0,Math.min(4,j-S.length),S),r(0,(8-S.length%8)%8,S),a(S.length%8==0);for(let E=236;S.lengthN[A>>>3]|=E<<7-(A&7)),new at(x,c,N,m)}getModule(d,c){return 0<=d&&d>>9)*1335;const p=(c<<10|h)^21522;a(p>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(p,m));this.setFunctionModule(8,7,n(p,6)),this.setFunctionModule(8,8,n(p,7)),this.setFunctionModule(7,8,n(p,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(p,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(p,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(p,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let d=this.version;for(let h=0;h<12;h++)d=d<<1^(d>>>11)*7973;const c=this.version<<12|d;a(c>>>18==0);for(let h=0;h<18;h++){const p=n(c,h),m=this.size-11+h%3,v=Math.floor(h/3);this.setFunctionModule(m,v,p),this.setFunctionModule(v,m,p)}}drawFinderPattern(d,c){for(let h=-4;h<=4;h++)for(let p=-4;p<=4;p++){const m=Math.max(Math.abs(p),Math.abs(h)),v=d+p,x=c+h;0<=v&&v{(E!=y-m||C>=x)&&N.push(A[E])});return a(N.length==v),N}drawCodewords(d){if(d.length!=Math.floor(at.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let h=this.size-1;h>=1;h-=2){h==6&&(h=5);for(let p=0;p>>3],7-(c&7)),c++)}}a(c==d.length*8)}applyMask(d){if(d<0||d>7)throw new RangeError("Mask value out of range");for(let c=0;c5&&d++):(this.finderPenaltyAddHistory(x,y),v||(d+=this.finderPenaltyCountPatterns(y)*at.PENALTY_N3),v=this.modules[m][S],x=1);d+=this.finderPenaltyTerminateAndCount(v,x,y)*at.PENALTY_N3}for(let m=0;m5&&d++):(this.finderPenaltyAddHistory(x,y),v||(d+=this.finderPenaltyCountPatterns(y)*at.PENALTY_N3),v=this.modules[S][m],x=1);d+=this.finderPenaltyTerminateAndCount(v,x,y)*at.PENALTY_N3}for(let m=0;mv+(x?1:0),c);const h=this.size*this.size,p=Math.ceil(Math.abs(c*20-h*10)/h)-1;return a(0<=p&&p<=9),d+=p*at.PENALTY_N4,a(0<=d&&d<=2568888),d}getAlignmentPatternPositions(){if(this.version==1)return[];{const d=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(d*2-2))*2;let h=[6];for(let p=this.size-7;h.lengthat.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*d+128)*d+64;if(d>=2){const h=Math.floor(d/7)+2;c-=(25*h-10)*h-55,d>=7&&(c-=36)}return a(208<=c&&c<=29648),c}static getNumDataCodewords(d,c){return Math.floor(at.getNumRawDataModules(d)/8)-at.ECC_CODEWORDS_PER_BLOCK[c.ordinal][d]*at.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][d]}static reedSolomonComputeDivisor(d){if(d<1||d>255)throw new RangeError("Degree out of range");let c=[];for(let p=0;p0);for(const p of d){const m=p^h.shift();h.push(0),c.forEach((v,x)=>h[x]^=at.reedSolomonMultiply(v,m))}return h}static reedSolomonMultiply(d,c){if(d>>>8||c>>>8)throw new RangeError("Byte out of range");let h=0;for(let p=7;p>=0;p--)h=h<<1^(h>>>7)*285,h^=(c>>>p&1)*d;return a(h>>>8==0),h}finderPenaltyCountPatterns(d){const c=d[1];a(c<=this.size*3);const h=c>0&&d[2]==c&&d[3]==c*3&&d[4]==c&&d[5]==c;return(h&&d[0]>=c*4&&d[6]>=c?1:0)+(h&&d[6]>=c*4&&d[0]>=c?1:0)}finderPenaltyTerminateAndCount(d,c,h){return d&&(this.finderPenaltyAddHistory(c,h),c=0),c+=this.size,this.finderPenaltyAddHistory(c,h),this.finderPenaltyCountPatterns(h)}finderPenaltyAddHistory(d,c){c[0]==0&&(d+=this.size),c.pop(),c.unshift(d)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function r(u,d,c){if(d<0||d>31||u>>>d)throw new RangeError("Value out of range");for(let h=d-1;h>=0;h--)c.push(u>>>h&1)}function n(u,d){return(u>>>d&1)!=0}function a(u){if(!u)throw new Error("Assertion error")}const i=class zt{constructor(d,c,h){if(this.mode=d,this.numChars=c,this.bitData=h,c<0)throw new RangeError("Invalid argument");this.bitData=h.slice()}static makeBytes(d){let c=[];for(const h of d)r(h,8,c);return new zt(zt.Mode.BYTE,d.length,c)}static makeNumeric(d){if(!zt.isNumeric(d))throw new RangeError("String contains non-numeric characters");let c=[];for(let h=0;h=1<{(t=>{const r=class{constructor(a,i){this.ordinal=a,this.formatBits=i}};r.LOW=new r(0,1),r.MEDIUM=new r(1,0),r.QUARTILE=new r(2,3),r.HIGH=new r(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Xo||(Xo={}));(e=>{(t=>{const r=class{constructor(a,i){this.modeBits=a,this.numBitsCharCount=i}numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}};r.NUMERIC=new r(1,[10,12,14]),r.ALPHANUMERIC=new r(2,[9,11,13]),r.BYTE=new r(4,[8,16,16]),r.KANJI=new r(8,[8,10,12]),r.ECI=new r(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Xo||(Xo={}));var Gs=Xo;/** + * @license qrcode.react + * Copyright (c) Paul O'Shannessy + * SPDX-License-Identifier: ISC + */var Nde={L:Gs.QrCode.Ecc.LOW,M:Gs.QrCode.Ecc.MEDIUM,Q:Gs.QrCode.Ecc.QUARTILE,H:Gs.QrCode.Ecc.HIGH},F5=128,z5="L",q5="#FFFFFF",U5="#000000",V5=!1,H5=1,Cde=4,Ede=0,Ode=.1;function W5(e,t=0){const r=[];return e.forEach(function(n,a){let i=null;n.forEach(function(o,u){if(!o&&i!==null){r.push(`M${i+t} ${a+t}h${u-i}v1H${i+t}z`),i=null;return}if(u===n.length-1){if(!o)return;i===null?r.push(`M${u+t},${a+t} h1v1H${u+t}z`):r.push(`M${i+t},${a+t} h${u+1-i}v1H${i+t}z`);return}o&&i===null&&(i=u)})}),r.join("")}function G5(e,t){return e.slice().map((r,n)=>n=t.y+t.h?r:r.map((a,i)=>i=t.x+t.w?a:!1))}function Pde(e,t,r,n){if(n==null)return null;const a=e.length+r*2,i=Math.floor(t*Ode),o=a/t,u=(n.width||i)*o,d=(n.height||i)*o,c=n.x==null?e.length/2-u/2:n.x*o,h=n.y==null?e.length/2-d/2:n.y*o,p=n.opacity==null?1:n.opacity;let m=null;if(n.excavate){let x=Math.floor(c),y=Math.floor(h),S=Math.ceil(u+c-x),j=Math.ceil(d+h-y);m={x,y,w:S,h:j}}const v=n.crossOrigin;return{x:c,y:h,h:d,w:u,excavation:m,opacity:p,crossOrigin:v}}function Ade(e,t){return t!=null?Math.max(Math.floor(t),0):e?Cde:Ede}function K5({value:e,level:t,minVersion:r,includeMargin:n,marginSize:a,imageSettings:i,size:o,boostLevel:u}){let d=z.useMemo(()=>{const x=(Array.isArray(e)?e:[e]).reduce((y,S)=>(y.push(...Gs.QrSegment.makeSegments(S)),y),[]);return Gs.QrCode.encodeSegments(x,Nde[t],r,void 0,void 0,u)},[e,t,r,u]);const{cells:c,margin:h,numCells:p,calculatedImageSettings:m}=z.useMemo(()=>{let v=d.getModules();const x=Ade(n,a),y=v.length+x*2,S=Pde(v,o,x,i);return{cells:v,margin:x,numCells:y,calculatedImageSettings:S}},[d,o,i,n,a]);return{qrcode:d,margin:h,cells:c,numCells:p,calculatedImageSettings:m}}var Tde=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),kde=z.forwardRef(function(t,r){const n=t,{value:a,size:i=F5,level:o=z5,bgColor:u=q5,fgColor:d=U5,includeMargin:c=V5,minVersion:h=H5,boostLevel:p,marginSize:m,imageSettings:v}=n,y=kS(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:S}=y,j=kS(y,["style"]),N=v?.src,E=z.useRef(null),A=z.useRef(null),C=z.useCallback(G=>{E.current=G,typeof r=="function"?r(G):r&&(r.current=G)},[r]),[O,T]=z.useState(!1),{margin:R,cells:L,numCells:q,calculatedImageSettings:F}=K5({value:a,level:o,minVersion:h,boostLevel:p,includeMargin:c,marginSize:m,imageSettings:v,size:i});z.useEffect(()=>{if(E.current!=null){const G=E.current,W=G.getContext("2d");if(!W)return;let H=L;const U=A.current,$=F!=null&&U!==null&&U.complete&&U.naturalHeight!==0&&U.naturalWidth!==0;$&&F.excavation!=null&&(H=G5(L,F.excavation));const Z=window.devicePixelRatio||1;G.height=G.width=i*Z;const k=i/q*Z;W.scale(k,k),W.fillStyle=u,W.fillRect(0,0,q,q),W.fillStyle=d,Tde?W.fill(new Path2D(W5(H,R))):L.forEach(function(I,D){I.forEach(function(J,ae){J&&W.fillRect(ae+R,D+R,1,1)})}),F&&(W.globalAlpha=F.opacity),$&&W.drawImage(U,F.x+R,F.y+R,F.w,F.h)}}),z.useEffect(()=>{T(!1)},[N]);const B=TS({height:i,width:i},S);let V=null;return N!=null&&(V=z.createElement("img",{src:N,key:N,style:{display:"none"},onLoad:()=>{T(!0)},ref:A,crossOrigin:F?.crossOrigin})),z.createElement(z.Fragment,null,z.createElement("canvas",TS({style:B,height:i,width:i,ref:C,role:"img"},j)),V)});kde.displayName="QRCodeCanvas";var X5=z.forwardRef(function(t,r){const n=t,{value:a,size:i=F5,level:o=z5,bgColor:u=q5,fgColor:d=U5,includeMargin:c=V5,minVersion:h=H5,boostLevel:p,title:m,marginSize:v,imageSettings:x}=n,y=kS(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:S,cells:j,numCells:N,calculatedImageSettings:E}=K5({value:a,level:o,minVersion:h,boostLevel:p,includeMargin:c,marginSize:v,imageSettings:x,size:i});let A=j,C=null;x!=null&&E!=null&&(E.excavation!=null&&(A=G5(j,E.excavation)),C=z.createElement("image",{href:x.src,height:E.h,width:E.w,x:E.x+S,y:E.y+S,preserveAspectRatio:"none",opacity:E.opacity,crossOrigin:E.crossOrigin}));const O=W5(A,S);return z.createElement("svg",TS({height:i,width:i,viewBox:`0 0 ${N} ${N}`,ref:r,role:"img"},y),!!m&&z.createElement("title",null,m),z.createElement("path",{fill:u,d:`M0,0 h${N}v${N}H0z`,shapeRendering:"crispEdges"}),z.createElement("path",{fill:d,d:O,shapeRendering:"crispEdges"}),C)});X5.displayName="QRCodeSVG";function Rde({data:e,width:t,height:r,showText:n,orientation:a="horizontal"}){const i=b.useRef(null),o=a==="vertical",u=Math.max(20,(o?t:r)-(n?14:4));b.useEffect(()=>{if(i.current&&e)try{jde(i.current,e,{format:"CODE128",width:1,height:u,displayValue:n!==!1,margin:2,fontOptions:"",fontSize:10})}catch{}},[e,u,n]);const d=s.jsx("svg",{ref:i,className:"w-full h-full min-h-0",style:{maxHeight:o?t:r}});return o?s.jsx("div",{className:"w-full h-full flex items-center justify-center",children:s.jsx("div",{style:{transform:"rotate(-90deg)",transformOrigin:"center center",width:r,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:d})}):d}const cu=8;function Bs(e){return Math.round(e/cu)*cu}function sm(e,t){return t==="cm"?e*37.8:e*96}function YI(e,t){return t==="cm"?e/37.8:e/96}function Y5({el:e}){const t=e.config,r=e.type,n={fontSize:t?.fontSize??14,fontFamily:t?.fontFamily??"Arial",fontWeight:t?.fontWeight??"normal",textAlign:t?.textAlign??"left",color:t?.color??"#000"},a=t?.inputType;if(r==="TEXT_STATIC"){const i=t?.text??"文本";if(a==="number")return s.jsx("input",{type:"number",readOnly:!0,value:t?.text??"0",className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none",style:{...n,textAlign:"right"}});if(a==="options"){const o=Array.isArray(t?.selectedOptionValues)?t.selectedOptionValues:[],u=o.length>0?o.join(", "):i||"请选择...";return s.jsxs("div",{className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 flex items-center pointer-events-none text-gray-500",style:n,children:[s.jsx("span",{className:"truncate flex-1",title:u,children:u}),s.jsx("span",{className:"ml-auto text-gray-400 shrink-0",children:"▼"})]})}return a==="text"?s.jsx("input",{type:"text",readOnly:!0,value:i,className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none",style:n}):s.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-pre-wrap break-all leading-tight",style:n,children:i})}if(r==="TEXT_PRODUCT"){const i=t?.text??"商品名";return s.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-pre-wrap break-all leading-tight",style:n,children:i})}if(r==="TEXT_PRICE"){const i=t?.prefix??"¥",o=t?.text??"0.00";return s.jsxs("div",{className:"w-full h-full px-1 overflow-hidden flex items-center",style:{...n,justifyContent:n.textAlign==="center"?"center":n.textAlign==="right"?"flex-end":"flex-start"},children:[s.jsx("span",{children:i}),s.jsx("span",{children:o})]})}if(r==="BARCODE"){const i=t?.data??"123456789",o=t?.showText!==!1,u=t?.orientation==="vertical"?"vertical":"horizontal";return s.jsx("div",{className:"flex flex-col items-center justify-center w-full h-full overflow-hidden p-0.5",children:s.jsx("div",{className:"flex-1 w-full min-h-0 flex items-center justify-center",children:s.jsx(Rde,{data:i,width:e.width,height:e.height,showText:o,orientation:u})})})}if(r==="QRCODE"){const i=t?.data??"https://example.com",o=Math.min(e.width,e.height)-4;return s.jsx("div",{className:"w-full h-full flex items-center justify-center p-0.5",children:s.jsx(X5,{value:i,size:Math.max(20,o),level:"M",includeMargin:!1})})}if(r==="IMAGE"){const i=t?.src;return i?s.jsx("img",{src:i,alt:"",className:"w-full h-full object-contain"}):s.jsx("div",{className:"w-full h-full flex flex-col items-center justify-center bg-gray-100 text-gray-500 text-[10px] border border-dashed border-gray-300",children:s.jsx("span",{className:"font-medium",children:"Logo"})})}if(r==="DATE"){const o=(t?.format??"YYYY-MM-DD").replace("YYYY","2025").replace("MM","02").replace("DD","01");return t?.inputType==="datetime"||t?.inputType==="date"?s.jsx("input",{type:"date",readOnly:!0,value:"2025-02-01",className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none text-[10px]",style:n}):s.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:o})}if(r==="TIME"){const o=(t?.format??"HH:mm").replace("HH","12").replace("mm","30");return s.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:o})}if(r==="DURATION")return s.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:"保质期 2025-02-04"});if(r==="WEIGHT"){const i=t?.value??500,o=t?.unit??"g";return s.jsxs("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:[i,o]})}if(r==="WEIGHT_PRICE"){const i=t?.unitPrice??10,o=t?.weight??.5,u=t?.currency??"¥";return s.jsxs("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:[u,(i*o).toFixed(2)]})}if(r==="NUTRITION"){const i=t?.calories??120;return s.jsxs("div",{className:"text-[8px] p-0.5 w-full h-full overflow-hidden flex flex-col",children:[s.jsx("div",{className:"font-semibold border-b border-black",children:"Nutrition Facts"}),s.jsxs("div",{children:["Calories ",i]})]})}return r==="BLANK"?s.jsx("div",{className:"w-full h-full border border-dashed border-gray-200"}):s.jsx("div",{className:"text-gray-500 text-[10px] px-1 truncate w-full flex items-center justify-center",children:e.type.replace(/_/g," ")})}function Ide({template:e,selectedId:t,onSelect:r,onUpdateElement:n,onDeleteElement:a,onTemplateChange:i,scale:o=1,onZoomIn:u,onZoomOut:d,onPreview:c}){const h=b.useRef(null),p=b.useRef(null),m=b.useRef(null),v=b.useRef(null),x=b.useRef(null),y=b.useRef(null),S=b.useRef(null),[j,N]=z.useState(!1),[E,A]=z.useState(!1),C=b.useRef(null),[O,T]=z.useState({x:0,y:0}),R=b.useRef(null),L=sm(e.width,e.unit),q=sm(e.height,e.unit),F=e.showGrid!==!1,B=b.useCallback((k,I)=>{if(j||k.button===1)return;k.stopPropagation(),r(I),p.current?.focus();const D=e.elements.find(ae=>ae.id===I);if(!D)return;const J=document.getElementById(`element-${I}`);J&&(J.classList.add("z-50","opacity-90","shadow-xl","ring-2","ring-blue-400","ring-offset-2"),J.style.cursor="grabbing"),m.current={id:I,startX:k.clientX,startY:k.clientY,elX:D.x,elY:D.y},y.current={id:I,x:D.x,y:D.y},k.currentTarget.setPointerCapture?.(k.pointerId)},[e.elements,r,j]),V=b.useCallback(k=>{S.current!==null&&cancelAnimationFrame(S.current),S.current=requestAnimationFrame(()=>{k(),S.current=null})},[]),G=b.useCallback(k=>{if(E&&R.current){const I=k.clientX-R.current.startX,D=k.clientY-R.current.startY;T({x:R.current.x+I,y:R.current.y+D});return}if(E&&C.current&&h.current){const I=k.clientX-C.current.x,D=k.clientY-C.current.y;h.current.scrollLeft=C.current.scrollLeft-I,h.current.scrollTop=C.current.scrollTop-D;return}if(m.current){const{id:I,startX:D,startY:J,elX:ae,elY:ie}=m.current,ne=k.clientX,X=k.clientY;V(()=>{const Y=(ne-D)/o,ee=(X-J)/o,le=Math.max(0,ae+Y),pe=Math.max(0,ie+ee),K=Bs(le),je=Bs(pe),Ce=document.getElementById(`element-${I}`);Ce&&(Ce.style.left=`${K}px`,Ce.style.top=`${je}px`),y.current={id:I,x:K,y:je}})}if(v.current){const{id:I,corner:D,startX:J,startY:ae,w:ie,h:ne,elX:X,elY:Y}=v.current,ee=k.clientX,le=k.clientY;V(()=>{const pe=(ee-J)/o,K=(le-ae)/o;let je=ie,Ce=ne,Le=X,De=Y;D.includes("e")&&(je=Math.max(20,ie+pe)),D.includes("w")&&(je=Math.max(20,ie-pe),Le=X+pe),D.includes("s")&&(Ce=Math.max(12,ne+K)),D.includes("n")&&(Ce=Math.max(12,ne-K),De=Y+K);const tt=Bs(je),_t=Bs(Ce),ft=Bs(Le),Zt=Bs(De),At=document.getElementById(`element-${I}`);At&&(At.style.width=`${tt}px`,At.style.height=`${_t}px`,At.style.left=`${ft}px`,At.style.top=`${Zt}px`),y.current={id:I,width:tt,height:_t,x:ft,y:Zt}})}if(x.current&&i){const{edge:I,startX:D,startY:J,startW:ae,startH:ie}=x.current,ne=k.clientX,X=k.clientY;V(()=>{const Y=(ne-D)/o,ee=(X-J)/o,le=YI(Y,e.unit),pe=YI(ee,e.unit);if(I==="bottom"){const K=Math.max(1,ie+pe);i({height:K})}else{const K=Math.max(1,ae+le);i({width:K})}})}},[E,i,o,e.unit,V]),W=b.useCallback(()=>{E&&(A(!1),C.current=null,R.current=null),S.current!==null&&(cancelAnimationFrame(S.current),S.current=null);const k=m.current?.id||v.current?.id;if(k){const I=document.getElementById(`element-${k}`);I&&(I.classList.remove("z-50","opacity-90","shadow-xl","ring-2","ring-blue-400","ring-offset-2"),I.style.cursor="")}if(y.current){const{id:I,...D}=y.current;n(I,D),y.current=null}m.current=null,v.current=null,x.current=null},[n]);b.useEffect(()=>{const k=D=>{D.code==="Space"&&!D.repeat&&N(!0)},I=D=>{D.code==="Space"&&(N(!1),A(!1),C.current=null,R.current=null)};return window.addEventListener("keydown",k),window.addEventListener("keyup",I),()=>{window.removeEventListener("keydown",k),window.removeEventListener("keyup",I)}},[]),b.useEffect(()=>{const k=h.current;if(!k)return;const I=()=>{k.scrollLeft=Math.max(0,(k.scrollWidth-k.clientWidth)/2),k.scrollTop=Math.max(0,(k.scrollHeight-k.clientHeight)/2)},D=requestAnimationFrame(I),J=setTimeout(I,100);return()=>{cancelAnimationFrame(D),clearTimeout(J)}},[o,L,q]);const H=b.useCallback(k=>{if(!t)return;if(k.key==="Delete"||k.key==="Backspace"){k.preventDefault();const ie=e.elements.findIndex(ne=>ne.id===t);if(ie>=0){const ne=e.elements.filter(X=>X.id!==t);a(t),r(ne[ie]?.id??ne[ie-1]?.id??null)}return}const I=e.elements.find(ie=>ie.id===t);if(!I)return;const D=k.shiftKey?1:cu;let J=0,ae=0;switch(k.key){case"ArrowLeft":J=-D;break;case"ArrowRight":J=D;break;case"ArrowUp":ae=-D;break;case"ArrowDown":ae=-D;break;default:return}k.key==="ArrowDown"&&(ae=D),k.preventDefault(),n(I.id,{x:Math.max(0,I.x+J),y:Math.max(0,I.y+ae)})},[t,e.elements,n,a,r]),U=k=>{(j||k.button===1)&&(k.preventDefault(),A(!0),C.current={x:k.clientX,y:k.clientY,scrollLeft:h.current?.scrollLeft||0,scrollTop:h.current?.scrollTop||0},k.currentTarget.setPointerCapture(k.pointerId))},$=k=>{if(E&&C.current&&h.current){const I=k.clientX-C.current.x,D=k.clientY-C.current.y;h.current.scrollLeft=C.current.scrollLeft-I,h.current.scrollTop=C.current.scrollTop-D}},Z=k=>{E&&(A(!1),C.current=null)};return s.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-gray-100",children:[s.jsxs("div",{className:"shrink-0 px-4 py-2 border-b border-gray-200 bg-white flex items-center justify-between gap-2 flex-wrap z-10",children:[s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Label Preview"}),s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c&&s.jsx("button",{type:"button",onClick:c,className:"h-8 px-3 rounded border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 text-xs font-medium shadow-sm transition-all active:scale-95",children:"预览"}),i&&s.jsxs(s.Fragment,{children:[s.jsxs(We,{value:(()=>{const k=L1.findIndex(I=>I.width===e.width&&I.height===e.height&&I.unit===e.unit);return k>=0?String(k):"custom"})(),onValueChange:k=>{if(k==="custom")return;const I=L1[Number(k)];I&&i({width:I.width,height:I.height,unit:I.unit})},children:[s.jsx(Ke,{className:"h-8 w-[130px] text-xs",children:s.jsx(Ge,{placeholder:"画布大小"})}),s.jsxs(Xe,{children:[L1.map((k,I)=>s.jsx(_e,{value:String(I),className:"text-xs",children:k.name},I)),s.jsx(_e,{value:"custom",className:"text-xs text-gray-500",children:"自定义"})]})]}),s.jsx("button",{type:"button",onClick:()=>i({showGrid:!F}),className:Ae("h-8 px-3 rounded border text-xs font-medium shadow-sm transition-colors",F?"border-gray-300 bg-white text-gray-700 hover:bg-gray-50":"border-gray-300 bg-gray-100 text-gray-500"),children:F?"隐藏网格":"显示网格"})]}),s.jsxs("div",{className:"flex items-center gap-1 bg-white rounded border border-gray-300 p-0.5 shadow-sm h-8",children:[s.jsx("button",{type:"button",onClick:d,disabled:!d,className:"h-6 w-6 rounded hover:bg-gray-100 text-gray-600 disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center text-sm font-medium active:scale-90 transition-transform",title:"缩小",children:"−"}),s.jsxs("span",{className:"min-w-[3rem] text-center text-xs text-gray-600 font-medium",children:[Math.round(o*100),"%"]}),s.jsx("button",{type:"button",onClick:u,disabled:!u,className:"h-6 w-6 rounded hover:bg-gray-100 text-gray-600 disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center text-sm font-medium active:scale-90 transition-transform",title:"放大",children:"+"})]})]})]}),s.jsx("div",{ref:h,className:Ae("flex-1 overflow-auto bg-gray-100 relative",j?"cursor-grab active:cursor-grabbing":""),onPointerDown:U,onPointerMove:$,onPointerUp:Z,onPointerLeave:Z,children:s.jsx("div",{style:{minWidth:"100%",minHeight:"100%",width:"fit-content",height:"fit-content",display:"flex",padding:50,boxSizing:"border-box",transform:`translate(${O.x}px, ${O.y}px)`},children:s.jsxs("div",{ref:p,tabIndex:0,className:Ae("relative bg-white shadow-lg border border-dashed border-gray-300 origin-top-left outline-none m-auto",E?"cursor-grabbing":"cursor-grab"),style:{width:L,height:q,transform:`scale(${o})`,backgroundImage:F?`linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px), + linear-gradient(to bottom, rgba(0,0,0,0.06) 1px, transparent 1px)`:void 0,backgroundSize:F?`${cu}px ${cu}px`:void 0,pointerEvents:j?"none":"auto"},onClick:k=>{const I=k.target,D=I.closest('[id^="element-"]'),J=I.closest('[title*="拖拽拉高"]')||I.closest('[title*="拖拽拉宽"]');!D&&!J&&r(null)},onPointerDown:k=>{const I=k.target,D=I.closest('[id^="element-"]'),J=I.closest('[title*="拖拽拉高"]')||I.closest('[title*="拖拽拉宽"]');p.current?.contains(I)&&!D&&!J&&!m.current&&!v.current&&(j||k.button===1)&&(k.preventDefault(),k.stopPropagation(),A(!0),R.current={x:O.x,y:O.y,startX:k.clientX,startY:k.clientY},C.current={x:k.clientX,y:k.clientY,scrollLeft:h.current?.scrollLeft??0,scrollTop:h.current?.scrollTop??0},k.currentTarget.setPointerCapture?.(k.pointerId))},onPointerMove:G,onPointerUp:W,onKeyDown:H,children:[e.showRuler&&s.jsxs("div",{className:"absolute top-0 left-0 right-0 h-5 border-b border-gray-300 bg-gray-50 text-[10px] text-gray-500 flex items-center px-1 pointer-events-none select-none",children:[e.unit," ",e.width," × ",e.height]}),i&&s.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-3 cursor-ns-resize flex items-center justify-center bg-gray-200/80 hover:bg-blue-400/30 border-t border-gray-300 text-[10px] text-gray-500 transition-colors",title:"拖拽拉高纸张",onPointerDown:k=>{k.stopPropagation(),x.current={edge:"bottom",startX:k.clientX,startY:k.clientY,startW:e.width,startH:e.height},k.target.setPointerCapture?.(k.pointerId)},children:"⋮"}),i&&s.jsx("div",{className:"absolute top-0 right-0 bottom-0 w-3 cursor-ew-resize flex items-center justify-center bg-gray-200/80 hover:bg-blue-400/30 border-l border-gray-300 text-[10px] text-gray-500 transition-colors",title:"拖拽拉宽纸张",onPointerDown:k=>{k.stopPropagation(),x.current={edge:"right",startX:k.clientX,startY:k.clientY,startW:e.width,startH:e.height},k.target.setPointerCapture?.(k.pointerId)},children:"⋮"}),e.elements.map(k=>s.jsxs("div",{id:`element-${k.id}`,className:Ae("absolute box-border cursor-move overflow-hidden transition-shadow",k.border==="line"&&"border border-gray-400",k.border==="dotted"&&"border border-dotted border-gray-400",t===k.id&&"ring-2 ring-blue-500 ring-offset-1 z-10"),style:{left:k.x,top:k.y,width:k.width,height:k.height},onClick:I=>{I.stopPropagation(),r(k.id)},onPointerDown:I=>B(I,k.id),children:[s.jsx(Y5,{el:k}),t===k.id&&s.jsxs(s.Fragment,{children:[["nw","ne","sw","se"].map(I=>s.jsx("div",{className:"absolute w-4 h-4 bg-white border-2 border-blue-500 rounded-full z-20 shadow-md hover:scale-110 transition-transform",style:{cursor:"nwse-resize",top:I.startsWith("n")?-6:void 0,bottom:I.startsWith("s")?-6:void 0,left:I.endsWith("w")?-6:void 0,right:I.endsWith("e")?-6:void 0},onPointerDown:D=>{D.stopPropagation();const J=e.elements.find(ae=>ae.id===k.id);v.current={id:k.id,corner:I,startX:D.clientX,startY:D.clientY,w:J.width,h:J.height,elX:J.x,elY:J.y},D.currentTarget.setPointerCapture?.(D.pointerId)}},I)),["n","s","w","e"].map(I=>s.jsx("div",{className:"absolute bg-blue-500/50 border border-white/50 rounded-sm z-10 shadow-sm hover:bg-blue-600",style:{cursor:I==="n"||I==="s"?"ns-resize":"ew-resize",width:I==="n"||I==="s"?"20px":"6px",height:I==="n"||I==="s"?"6px":"20px",top:I==="n"?-3:I==="s"?void 0:"50%",bottom:I==="s"?-3:void 0,left:I==="w"?-3:I==="e"?void 0:"50%",right:I==="e"?-3:void 0,transform:I==="n"||I==="s"?"translateX(-50%)":"translateY(-50%)"},onPointerDown:D=>{D.stopPropagation();const J=e.elements.find(ie=>ie.id===k.id),ae=document.getElementById(`element-${k.id}`);ae&&ae.classList.add("z-50","opacity-90"),v.current={id:k.id,corner:I,startX:D.clientX,startY:D.clientY,w:J.width,h:J.height,elX:J.x,elY:J.y},D.currentTarget.setPointerCapture?.(D.pointerId)}},I))]})]},k.id))]})})})]})}function Mde({template:e,maxWidth:t=480}){const r=sm(e.width,e.unit),n=sm(e.height,e.unit),a=t?Math.min(t/r,t/n,2):1,i=r*a,o=n*a;return s.jsx("div",{className:"flex items-center justify-center p-4 bg-gray-100 rounded",children:s.jsx("div",{style:{width:i,height:o},className:"relative bg-white shadow-lg overflow-hidden",children:s.jsx("div",{className:"origin-top-left",style:{position:"absolute",left:0,top:0,width:r,height:n,transform:`scale(${a})`,transformOrigin:"0 0"},children:e.elements.map(u=>s.jsx("div",{className:"absolute box-border overflow-hidden pointer-events-none flex items-center justify-center text-xs",style:{left:u.x,top:u.y,width:u.width,height:u.height,border:u.border==="line"?"1px solid #999":u.border==="dotted"?"1px dotted #999":void 0},children:s.jsx(Y5,{el:u})},u.id))})})})}const wg=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),Sg="/label-multiple-option";function Dde(e){if(e==null)return[];if(Array.isArray(e))return e.map(t=>String(t));if(typeof e=="string"){const t=e.trim();if(!t)return[];try{const r=JSON.parse(t);return Array.isArray(r)?r.map(n=>String(n)):[]}catch{return[]}}return[]}function x_(e){return{...e,optionValuesJson:Dde(e.optionValuesJson)}}function Lde(e){return{totalCount:e.totalCount??0,items:(e.items??[]).map(x_)}}function J5(e){return JSON.stringify(e)}async function Q5(e,t){const r=await wg.requestJson({path:Sg,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,State:e.state},signal:t});return Lde(r)}async function $de(e){const t=await wg.requestJson({path:Sg,method:"POST",body:{optionCode:e.optionCode,optionName:e.optionName,optionValuesJson:J5(e.optionValuesJson),state:e.state??!0,orderNum:e.orderNum}});return x_(t)}async function Bde(e,t){const r=await wg.requestJson({path:`${Sg}/${encodeURIComponent(e)}`,method:"PUT",body:{optionCode:t.optionCode,optionName:t.optionName,optionValuesJson:J5(t.optionValuesJson),state:t.state??!0,orderNum:t.orderNum}});return x_(r)}async function Fde(e){await wg.requestJson({path:`${Sg}/${encodeURIComponent(e)}`,method:"DELETE"})}function zde({template:e,selectedElement:t,onTemplateChange:r,onElementChange:n,onDeleteElement:a,locations:i=[],readOnlyTemplateCode:o=!1}){return t?s.jsxs("div",{className:"w-72 shrink-0 border-l border-gray-200 bg-white flex flex-col h-full",children:[s.jsx("div",{className:"px-3 py-2 border-b border-gray-200 font-semibold text-gray-800",children:"Properties (Element)"}),s.jsx(al,{className:"flex-1",children:s.jsxs("div",{className:"p-3 space-y-3",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"X"}),s.jsx(me,{type:"number",value:t.x,onChange:u=>n(t.id,{x:Number(u.target.value)||0}),className:"h-8 text-sm"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Y"}),s.jsx(me,{type:"number",value:t.y,onChange:u=>n(t.id,{y:Number(u.target.value)||0}),className:"h-8 text-sm"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Width"}),s.jsx(me,{type:"number",value:t.width,onChange:u=>n(t.id,{width:Math.max(1,Number(u.target.value)||0)}),className:"h-8 text-sm"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Height"}),s.jsx(me,{type:"number",value:t.height,onChange:u=>n(t.id,{height:Math.max(1,Number(u.target.value)||0)}),className:"h-8 text-sm"})]})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Rotation"}),s.jsxs(We,{value:t.rotation,onValueChange:u=>n(t.id,{rotation:u}),children:[s.jsx(Ke,{className:"h-8 text-sm",children:s.jsx(Ge,{})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"horizontal",children:"horizontal"}),s.jsx(_e,{value:"vertical",children:"vertical"})]})]})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Border"}),s.jsxs(We,{value:t.border,onValueChange:u=>n(t.id,{border:u}),children:[s.jsx(Ke,{className:"h-8 text-sm",children:s.jsx(Ge,{})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"none",children:"none"}),s.jsx(_e,{value:"line",children:"line"}),s.jsx(_e,{value:"dotted",children:"dotted"})]})]})]}),s.jsx(Ude,{element:t,onChange:u=>n(t.id,{config:{...t.config,...u}})}),a&&s.jsx("div",{className:"pt-4 border-t border-gray-100",children:s.jsx(fe,{variant:"destructive",className:"w-full",onClick:()=>a(t.id),children:"Delete Element"})})]})})]}):s.jsxs("div",{className:"w-72 shrink-0 border-l border-gray-200 bg-white flex flex-col h-full",children:[s.jsx("div",{className:"px-3 py-2 border-b border-gray-200 font-semibold text-gray-800",children:"Properties (Template)"}),s.jsx(al,{className:"flex-1",children:s.jsxs("div",{className:"p-3 space-y-3",children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Template Code"}),s.jsx(me,{value:e.id,disabled:o,onChange:u=>r({id:u.target.value.trim()}),className:"h-8 text-sm mt-1",placeholder:"e.g. TPL_TEST_001"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Template Name"}),s.jsx(me,{value:e.name,onChange:u=>r({name:u.target.value}),className:"h-8 text-sm mt-1"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Label Type"}),s.jsxs(We,{value:e.labelType,onValueChange:u=>r({labelType:u}),children:[s.jsx(Ke,{className:"h-8 text-sm mt-1",children:s.jsx(Ge,{})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"PRICE",children:"PRICE"}),s.jsx(_e,{value:"NUTRITION",children:"NUTRITION"}),s.jsx(_e,{value:"SHIPPING",children:"SHIPPING"})]})]})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Applied Location"}),s.jsxs(We,{value:e.appliedLocation,onValueChange:u=>{r(u==="ALL"?{appliedLocation:u,appliedLocationIds:[]}:{appliedLocation:u})},children:[s.jsx(Ke,{className:"h-8 text-sm mt-1",children:s.jsx(Ge,{})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"ALL",children:"All locations"}),s.jsx(_e,{value:"SPECIFIED",children:"Specified locations"})]})]})]}),e.appliedLocation==="SPECIFIED"&&s.jsxs("div",{className:"rounded-md border border-gray-200 p-2 max-h-40 overflow-y-auto space-y-2",children:[s.jsx(ue,{className:"text-xs text-gray-600",children:"Select locations"}),i.length===0?s.jsx("p",{className:"text-xs text-gray-500",children:"No locations loaded."}):i.map(u=>{const d=(e.appliedLocationIds??[]).includes(u.id);return s.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[s.jsx(kl,{checked:d,onCheckedChange:c=>{const h=c===!0,p=new Set(e.appliedLocationIds??[]);h?p.add(u.id):p.delete(u.id),r({appliedLocationIds:Array.from(p)})}}),s.jsx("span",{className:"truncate",children:(u.locationName??u.locationCode??u.id).trim()||u.id})]},u.id)})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Width"}),s.jsx(me,{type:"number",value:e.width,onChange:u=>r({width:Math.max(.1,Number(u.target.value)||0)}),className:"h-8 text-sm"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Height"}),s.jsx(me,{type:"number",value:e.height,onChange:u=>r({height:Math.max(.1,Number(u.target.value)||0)}),className:"h-8 text-sm"})]})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Unit"}),s.jsxs(We,{value:e.unit,onValueChange:u=>r({unit:u}),children:[s.jsx(Ke,{className:"h-8 text-sm mt-1",children:s.jsx(Ge,{})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"cm",children:"cm"}),s.jsx(_e,{value:"inch",children:"inch"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Gt,{checked:e.showRuler,onCheckedChange:u=>r({showRuler:u})}),s.jsx(ue,{className:"text-xs",children:"Show Ruler"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Gt,{checked:e.showGrid??!0,onCheckedChange:u=>r({showGrid:u})}),s.jsx(ue,{className:"text-xs",children:"Show Grid"})]})]})})]})}const B1="__none__";function qde({cfg:e,onPatch:t}){const[r,n]=b.useState([]),[a,i]=b.useState(!1);b.useEffect(()=>{let p=!1;return i(!0),Q5({skipCount:0,maxResultCount:500}).then(m=>{p||n(m.items??[])}).catch(()=>{p||n([])}).finally(()=>{p||i(!1)}),()=>{p=!0}},[]);const o=(e.multipleOptionId??"").trim(),u=Array.isArray(e.selectedOptionValues)?e.selectedOptionValues:[],d=r.find(p=>p.id===o),c=d?.optionValuesJson??[],h=o||B1;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Option dictionary"}),s.jsxs(We,{value:h,onValueChange:p=>{if(p===B1){t({multipleOptionId:"",selectedOptionValues:[]});return}const m=r.find(y=>y.id===p),v=new Set(m?.optionValuesJson??[]),x=u.filter(y=>v.has(y));t({multipleOptionId:p,selectedOptionValues:x})},disabled:a,children:[s.jsx(Ke,{className:"h-8 text-sm mt-1",children:s.jsx(Ge,{placeholder:a?"Loading…":"Select from Multiple Options"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:B1,children:"— None —"}),r.map(p=>s.jsx(_e,{value:p.id,children:p.optionName??p.optionCode??p.id},p.id))]})]}),s.jsx("p",{className:"text-[10px] text-gray-400 mt-1",children:"Data comes from the Multiple Options tab (label-multiple-option list)."})]}),d&&c.length>0?s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Values (multi-select)"}),s.jsx("div",{className:"mt-1 max-h-44 overflow-y-auto border border-gray-200 rounded-md p-2 space-y-2 bg-gray-50/50",children:c.map(p=>s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(kl,{className:"shrink-0",checked:u.includes(p),onCheckedChange:m=>{const v=new Set(u);m?v.add(p):v.delete(p),t({selectedOptionValues:Array.from(v)})}}),s.jsx("span",{className:"text-xs truncate",title:p,children:p})]},p))})]}):o?s.jsx("p",{className:"text-[10px] text-amber-600",children:"No values in this dictionary or still loading."}):null]})}function F1({cfg:e,update:t,textAlignDefault:r}){return s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Text"}),s.jsx(me,{value:e.text??"0.00",onChange:n=>t("text",n.target.value),className:"h-8 text-sm mt-1"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Prefix"}),s.jsx(me,{value:e.prefix??"¥",onChange:n=>t("prefix",n.target.value),className:"h-8 text-sm mt-1"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Font Size"}),s.jsx(me,{type:"number",value:e.fontSize??14,onChange:n=>t("fontSize",Number(n.target.value)||14),className:"h-8 text-sm mt-1"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Text Align"}),s.jsxs(We,{value:e.textAlign??r,onValueChange:n=>t("textAlign",n),children:[s.jsx(Ke,{className:"h-8 text-sm mt-1",children:s.jsx(Ge,{})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"left",children:"Left"}),s.jsx(_e,{value:"center",children:"Center"}),s.jsx(_e,{value:"right",children:"Right"})]})]})]})]})}function Ude({element:e,onChange:t}){const r=e.config,n=(a,i)=>t({[a]:i});switch(e.type){case"TEXT_STATIC":return r.inputType==="options"?s.jsxs(s.Fragment,{children:[s.jsx(qde,{cfg:r,onPatch:t}),s.jsx(F1,{cfg:r,update:n,textAlignDefault:"left"})]}):s.jsx(F1,{cfg:r,update:n,textAlignDefault:"right"});case"TEXT_PRODUCT":case"TEXT_PRICE":return s.jsx(F1,{cfg:r,update:n,textAlignDefault:"right"});case"BARCODE":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Data"}),s.jsx(me,{value:r.data??"123456789",onChange:a=>n("data",a.target.value),className:"h-8 text-sm mt-1"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"方向"}),s.jsxs(We,{value:r.orientation??"horizontal",onValueChange:a=>n("orientation",a),children:[s.jsx(Ke,{className:"h-8 text-sm mt-1",children:s.jsx(Ge,{})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"horizontal",children:"水平"}),s.jsx(_e,{value:"vertical",children:"竖排"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Gt,{checked:r.showText!==!1,onCheckedChange:a=>n("showText",a)}),s.jsx(ue,{className:"text-xs",children:"Show Text"})]})]});case"QRCODE":return s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Data (URL)"}),s.jsx(me,{value:r.data??"https://example.com",onChange:a=>n("data",a.target.value),className:"h-8 text-sm mt-1"})]});case"IMAGE":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Image URL"}),s.jsx(me,{value:r.src??"",onChange:a=>n("src",a.target.value),className:"h-8 text-sm mt-1",placeholder:"输入图片URL或路径"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Scale Mode"}),s.jsxs(We,{value:r.scaleMode??"contain",onValueChange:a=>n("scaleMode",a),children:[s.jsx(Ke,{className:"h-8 text-sm mt-1",children:s.jsx(Ge,{})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"contain",children:"Contain"}),s.jsx(_e,{value:"cover",children:"Cover"}),s.jsx(_e,{value:"fill",children:"Fill"})]})]})]})]});case"DATE":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Format"}),s.jsx(me,{value:r.format??"YYYY-MM-DD",onChange:a=>n("format",a.target.value),className:"h-8 text-sm mt-1",placeholder:"YYYY-MM-DD"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Offset Days"}),s.jsx(me,{type:"number",value:r.offsetDays??0,onChange:a=>n("offsetDays",Number(a.target.value)||0),className:"h-8 text-sm mt-1"})]})]});case"TIME":return s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Format"}),s.jsx(me,{value:r.format??"HH:mm",onChange:a=>n("format",a.target.value),className:"h-8 text-sm mt-1",placeholder:"HH:mm"})]});case"DURATION":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Format"}),s.jsx(me,{value:r.format??"YYYY-MM-DD",onChange:a=>n("format",a.target.value),className:"h-8 text-sm mt-1",placeholder:"YYYY-MM-DD"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Offset Days"}),s.jsx(me,{type:"number",value:r.offsetDays??3,onChange:a=>n("offsetDays",Number(a.target.value)||3),className:"h-8 text-sm mt-1"})]})]});case"WEIGHT":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Value"}),s.jsx(me,{type:"number",value:r.value??500,onChange:a=>n("value",Number(a.target.value)||0),className:"h-8 text-sm mt-1"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Unit"}),s.jsxs(We,{value:r.unit??"g",onValueChange:a=>n("unit",a),children:[s.jsx(Ke,{className:"h-8 text-sm mt-1",children:s.jsx(Ge,{})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"g",children:"g"}),s.jsx(_e,{value:"kg",children:"kg"}),s.jsx(_e,{value:"oz",children:"oz"}),s.jsx(_e,{value:"lb",children:"lb"})]})]})]})]});case"WEIGHT_PRICE":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Unit Price"}),s.jsx(me,{type:"number",value:r.unitPrice??10,onChange:a=>n("unitPrice",Number(a.target.value)||0),className:"h-8 text-sm mt-1"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Weight"}),s.jsx(me,{type:"number",step:"0.1",value:r.weight??.5,onChange:a=>n("weight",Number(a.target.value)||0),className:"h-8 text-sm mt-1"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Currency"}),s.jsx(me,{value:r.currency??"¥",onChange:a=>n("currency",a.target.value),className:"h-8 text-sm mt-1"})]})]});case"NUTRITION":return s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Calories"}),s.jsx(me,{type:"number",value:r.calories??120,onChange:a=>n("calories",Number(a.target.value)||0),className:"h-8 text-sm mt-1"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Fat"}),s.jsx(me,{value:r.fat??"5g",onChange:a=>n("fat",a.target.value),className:"h-8 text-sm mt-1"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Protein"}),s.jsx(me,{value:r.protein??"3g",onChange:a=>n("protein",a.target.value),className:"h-8 text-sm mt-1"})]}),s.jsxs("div",{children:[s.jsx(ue,{className:"text-xs",children:"Carbs"}),s.jsx(me,{value:r.carbs??"10g",onChange:a=>n("carbs",a.target.value),className:"h-8 text-sm mt-1"})]})]});case"BLANK":return s.jsx("div",{className:"text-xs text-gray-500",children:"Blank spacer; no configuration needed."});default:return s.jsxs("div",{className:"text-xs text-gray-500",children:["Config for ",e.type," (edit in code if needed)"]})}}const Vde=.5,Hde=2,JI=.25,Wde=1;function Gde({templateId:e,initialTemplate:t,onClose:r,onSaved:n}){const[a,i]=b.useState(()=>t?{...t}:Iue(e??void 0)),[o,u]=b.useState(null),[d,c]=b.useState(Wde),[h,p]=b.useState(!1),[m,v]=b.useState([]);b.useEffect(()=>{let C=!1;return(async()=>{try{const O=await Jl({skipCount:0,maxResultCount:500});C||v(O.items??[])}catch{C||v([])}})(),()=>{C=!0}},[]);const x=a.elements.find(C=>C.id===o)??null,y=b.useCallback((C,O)=>{const T=(U,$)=>$==="cm"?U*37.8:U*96,R=T(a.width,a.unit),L=T(a.height,a.unit),q=KR(C,0,0),F=8,B=U=>Math.round(U/F)*F;let V=(R-q.width)/2,G=(L-q.height)/2;const W=(U,$,Z,k)=>a.elements.some(I=>{const D=I.x+I.width,J=I.y+I.height,ae=U+Z,ie=$+k;return!(U>=D||ae<=I.x||$>=J||ie<=I.y)});if(W(V,G,q.width,q.height)){const U=F*2;let $=!1;for(let Z=G;Z=0&&!$;Z-=U)for(let k=V;k>=0&&!$;k-=U)if(!W(k,Z,q.width,q.height)){V=k,G=Z,$=!0;break}}}const H=KR(C,Math.max(0,B(V)),Math.max(0,B(G)));O&&Object.keys(O).length>0&&(H.config={...H.config,...O}),i(U=>({...U,elements:[...U.elements,H]})),u(H.id)},[a.width,a.height,a.unit,a.elements]),S=b.useCallback((C,O)=>{i(T=>({...T,elements:T.elements.map(R=>R.id===C?{...R,...O}:R)}))},[]),j=b.useCallback(C=>{i(O=>({...O,elements:O.elements.filter(T=>T.id!==C)})),u(null)},[]),N=b.useCallback(C=>{i(O=>({...O,...C}))},[]),E=b.useCallback(async()=>{try{const C=(a.id??"").trim();if(!C){ge.error("Template code is required.",{description:"Please enter a template code (e.g. TPL_TEST_001)."});return}if(a.appliedLocation==="SPECIFIED"&&!(a.appliedLocationIds?.length??0)){ge.error("Locations required.",{description:"When using specified locations, select at least one location."});return}const O={id:C,name:a.name,labelType:a.labelType,unit:a.unit,width:a.width,height:a.height,appliedLocation:a.appliedLocation,showRuler:a.showRuler,showGrid:a.showGrid??!0,state:!0,elements:a.elements.map((T,R)=>({id:T.id,type:T.type,x:T.x,y:T.y,width:T.width,height:T.height,rotation:T.rotation,border:T.border,zIndex:T.zIndex??R+1,orderNum:T.orderNum??R+1,valueSourceType:T.valueSourceType??Mue(T.type),isRequiredInput:T.isRequiredInput??!1,config:T.config})),appliedLocationIds:a.appliedLocation==="ALL"?[]:a.appliedLocationIds??[]};e?(await due(C,O),ge.success("Template updated.",{description:"The template has been updated successfully."})):(await uue(O),ge.success("Template created.",{description:"The template has been created successfully."})),n(),r()}catch(C){ge.error("Failed to save template.",{description:C?.message?String(C.message):"Please try again."})}},[a,e,n,r]),A=b.useCallback(()=>{const C=new Blob([JSON.stringify(a,null,2)],{type:"application/json"}),O=URL.createObjectURL(C),T=document.createElement("a");T.href=O,T.download=`label-template-${a.id}.json`,T.click(),URL.revokeObjectURL(O)},[a]);return s.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200 bg-white shrink-0",children:[s.jsxs(fe,{variant:"outline",size:"sm",onClick:r,children:[s.jsx(tz,{className:"w-4 h-4 mr-1"}),"Back"]}),s.jsx("span",{className:"text-sm font-medium text-gray-700 truncate flex-1",children:a.name}),s.jsxs(fe,{size:"sm",onClick:A,variant:"outline",children:[s.jsx(LS,{className:"w-4 h-4 mr-1"}),"Export JSON"]}),s.jsxs(fe,{size:"sm",className:"bg-blue-600 hover:bg-blue-700 text-white",onClick:E,children:[s.jsx(Gz,{className:"w-4 h-4 mr-1"}),"Save"]})]}),s.jsxs("div",{className:"flex flex-1 min-h-0",children:[s.jsx(Lue,{onAddElement:y}),s.jsx(Ide,{template:a,selectedId:o,onSelect:u,onUpdateElement:S,onDeleteElement:j,onTemplateChange:N,scale:d,onZoomIn:()=>c(C=>Math.min(Hde,C+JI)),onZoomOut:()=>c(C=>Math.max(Vde,C-JI)),onPreview:()=>p(!0)}),s.jsx(vt,{open:h,onOpenChange:p,children:s.jsxs(mt,{className:"max-w-[90vw] max-h-[90vh] overflow-auto",children:[s.jsx(yt,{children:s.jsx(xt,{children:"标签预览"})}),s.jsx(Mde,{template:a,maxWidth:500})]})}),s.jsx(zde,{template:a,selectedElement:x,onTemplateChange:N,onElementChange:S,onDeleteElement:j,locations:m,readOnlyTemplateCode:!!e})]})]})}function z1(e){const t=(e??"").trim();return t||"None"}function Kde(e,t){if(P5(e)==="ALL")return"All";const n=e.appliedLocationIds??[];if(n.length===0)return"Specified (0)";const a=n.map(i=>t.find(o=>o.id===i)?.locationName?.trim()||i);return a.length<=2?a.join(", "):`${a.slice(0,2).join(", ")} +${a.length-2}`}function Xde(e){const t=(e.templateName??e.name??"").trim();return t||"None"}function Yde(e){const t=(e.templateCode??e.id??"").trim();return t||"None"}function Jde(e,t){const r=(e.locationText??"").trim();return r||Kde(e,t)}function Qde(e){return typeof e.contentsCount=="number"?e.contentsCount:e.elements?.length??0}function Zde(e){const t=(e.sizeText??"").trim();if(t)return t;const r=e.width,n=e.height,a=e.unit;return r!=null&&n!=null&&a?`${r}×${n} ${a}`:"None"}function efe(){const[e,t]=b.useState([]),[r,n]=b.useState("list"),[a,i]=b.useState(null),[o,u]=b.useState(null),[d,c]=b.useState(!1),[h,p]=b.useState(0),[m,v]=b.useState(0),[x,y]=b.useState(null),[S,j]=b.useState(!1),[N,E]=b.useState(null),[A,C]=b.useState(""),[O,T]=b.useState("all"),[R,L]=b.useState("all"),[q,F]=b.useState("all"),[B,V]=b.useState(1),[G,W]=b.useState(10),[H,U]=b.useState([]),$=b.useRef(null),Z=b.useRef(null),[k,I]=b.useState("");b.useEffect(()=>(Z.current&&window.clearTimeout(Z.current),Z.current=window.setTimeout(()=>I(A.trim()),300),()=>{Z.current&&window.clearTimeout(Z.current)}),[A]);const D=Math.max(1,Math.ceil(h/G));b.useEffect(()=>{let Y=!1;return(async()=>{try{const ee=await Jl({skipCount:0,maxResultCount:500});Y||U(ee.items??[])}catch{Y||U([])}})(),()=>{Y=!0}},[]),b.useEffect(()=>{V(1)},[k,O,R,q,G]),b.useEffect(()=>r!=="list"?void 0:((async()=>{$.current?.abort();const ee=new AbortController;$.current=ee,c(!0);try{const le=(B-1)*G,pe=await N5({skipCount:le,maxResultCount:G,keyword:k||void 0,locationId:O!=="all"?O:void 0,labelType:R!=="all"?R:void 0,state:q==="all"?void 0:q==="true"},ee.signal);t(pe.items??[]),p(pe.totalCount??0)}catch(le){if(le?.name==="AbortError")return;ge.error("Failed to load label templates.",{description:le?.message?String(le.message):"Please try again."}),t([]),p(0)}finally{c(!1)}})(),()=>$.current?.abort()),[k,O,R,q,B,G,m,r]);const J=()=>v(Y=>Y+1),ae=()=>{i(null),u(null),n("editor")},ie=async Y=>{i(Y),c(!0);try{const ee=await cue(Y),le={id:ee.id,name:(ee.name??ee.templateName??"").trim()||"未命名模板",labelType:ee.labelType??"PRICE",unit:ee.unit??"cm",width:ee.width??6,height:ee.height??4,appliedLocation:P5(ee),appliedLocationIds:[...ee.appliedLocationIds??[]],showRuler:ee.showRuler??!0,showGrid:ee.showGrid??!0,elements:ee.elements??[]};u(le),n("editor")}catch(ee){ge.error("Failed to load template.",{description:ee?.message?String(ee.message):"Please try again."})}finally{c(!1)}},ne=()=>{n("list"),i(null),u(null)},X=Y=>{y(null),E(Y),j(!0)};return r==="editor"?s.jsx("div",{className:"h-[calc(100vh-8rem)] min-h-[500px] flex flex-col",children:s.jsx(Gde,{templateId:a,initialTemplate:o,onClose:ne,onSaved:J})}):s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{className:"pb-4",children:s.jsx("div",{className:"flex flex-col gap-4",children:s.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[s.jsx(me,{placeholder:"Search",value:A,onChange:Y=>C(Y.target.value),style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),s.jsxs(We,{value:O,onValueChange:T,children:[s.jsx(Ke,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Location"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"all",children:"All Locations"}),H.map(Y=>s.jsx(_e,{value:Y.id,children:z1(Y.locationName??Y.locationCode??Y.id)},Y.id))]})]}),s.jsxs(We,{value:R,onValueChange:L,children:[s.jsx(Ke,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Label Type"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"all",children:"All Types"}),s.jsx(_e,{value:"PRICE",children:"PRICE"}),s.jsx(_e,{value:"NUTRITION",children:"NUTRITION"}),s.jsx(_e,{value:"SHIPPING",children:"SHIPPING"})]})]}),s.jsxs(We,{value:q,onValueChange:F,children:[s.jsx(Ke,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"State"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"all",children:"All States"}),s.jsx(_e,{value:"true",children:"Active"}),s.jsx(_e,{value:"false",children:"Inactive"})]})]}),s.jsx("div",{className:"flex-1"}),s.jsxs(fe,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0",onClick:ae,children:["New Label Template ",s.jsx(In,{className:"ml-1 w-4 h-4"})]})]})})}),s.jsx("div",{className:"flex-1 overflow-auto pt-6",children:s.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-50 hover:bg-gray-50",children:[s.jsx(ye,{className:"font-bold text-gray-900 w-[180px]",children:"Label Template"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[120px]",children:"Template Code"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[120px]",children:"Location"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[100px]",children:"Label Type"}),s.jsx(ye,{className:"font-bold text-gray-900",children:"Contents"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[150px]",children:"Size"}),s.jsx(ye,{className:"font-bold text-gray-900 text-center w-[100px]",children:"Actions"})]})}),s.jsx($r,{children:d?s.jsx(Fe,{children:s.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):e.length===0?s.jsx(Fe,{children:s.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:'No templates yet. Click "New Label Template" to create one.'})}):e.map(Y=>s.jsxs(Fe,{className:"hover:bg-gray-50",children:[s.jsx(de,{className:"font-medium whitespace-nowrap overflow-hidden text-ellipsis max-w-[180px]",children:Xde(Y)}),s.jsx(de,{className:"text-gray-600 whitespace-nowrap overflow-hidden text-ellipsis max-w-[140px]",children:Yde(Y)}),s.jsx(de,{className:"whitespace-nowrap overflow-hidden text-ellipsis max-w-[140px]",children:z1(Jde(Y,H))}),s.jsx(de,{className:"whitespace-nowrap",children:z1(Y.labelType)}),s.jsxs(de,{className:"text-sm text-gray-600 whitespace-nowrap",children:[Qde(Y)," element(s)"]}),s.jsx(de,{className:"whitespace-nowrap overflow-hidden text-ellipsis max-w-[160px]",children:Zde(Y)}),s.jsx(de,{className:"text-center",children:s.jsxs(Ta,{open:x===Y.id,onOpenChange:ee=>y(ee?Y.id:null),children:[s.jsx(ka,{asChild:!0,children:s.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:s.jsx(Ji,{className:"h-4 w-4 text-gray-500"})})}),s.jsxs(Ra,{align:"end",className:"w-40 p-1",children:[s.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>ie(Y.id),children:[s.jsx(Bh,{className:"w-4 h-4"}),"Edit"]}),s.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>X(Y),children:"Delete"})]})]})})]},Y.id))})]})})}),s.jsx("div",{className:"pt-4",children:s.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[s.jsxs("div",{children:["Showing ",h===0?0:(B-1)*G+1,"-",Math.min(B*G,h)," of ",h]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(We,{value:String(G),onValueChange:Y=>W(Number(Y)),children:[s.jsx(Ke,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:s.jsx(Ge,{})}),s.jsx(Xe,{children:[10,20,50].map(Y=>s.jsxs(_e,{value:String(Y),children:[Y," / page"]},Y))})]}),s.jsx(Gi,{className:"mx-0 w-auto justify-end",children:s.jsxs(Ki,{children:[s.jsx(Mt,{children:s.jsx(Xi,{href:"#",size:"default",onClick:Y=>{Y.preventDefault(),V(ee=>Math.max(1,ee-1))},"aria-disabled":B<=1,className:B<=1?"pointer-events-none opacity-50":""})}),s.jsx(Mt,{children:s.jsxs(Ca,{href:"#",isActive:!0,size:"default",onClick:Y=>Y.preventDefault(),children:["Page ",B," / ",D]})}),s.jsx(Mt,{children:s.jsx(Yi,{href:"#",size:"default",onClick:Y=>{Y.preventDefault(),V(ee=>Math.min(D,ee+1))},"aria-disabled":B>=D,className:B>=D?"pointer-events-none opacity-50":""})})]})})]})]})}),s.jsx(tfe,{open:S,template:N,onOpenChange:Y=>{j(Y),Y||E(null)},onDeleted:J})]})}function tfe({open:e,template:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>(t?.templateName??t?.name??"").trim()||(t?.templateCode??t?.id??"").trim()||"this template",[t]),u=async()=>{if(t?.id){i(!0);try{await fue(t.id),ge.success("Label template deleted.",{description:"The label template has been removed successfully."}),r(!1),n()}catch(d){ge.error("Failed to delete label template.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-none",style:{width:"30%"},children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Delete Label Template"}),s.jsx(Pt,{children:"This action cannot be undone."})]}),s.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",s.jsx("span",{className:"font-medium",children:o}),"?"]}),s.jsxs(wt,{className:"flex-row flex-wrap justify-end",children:[s.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function QI(e){const t=(e??"").trim();return t||"None"}function rfe(){const[e,t]=b.useState(!1),[r,n]=b.useState(!1),[a,i]=b.useState(!1),[o,u]=b.useState(null),[d,c]=b.useState(null),[h,p]=b.useState([]),[m,v]=b.useState(!1),[x,y]=b.useState(0),[S,j]=b.useState(0),[N,E]=b.useState(null),[A,C]=b.useState(""),[O,T]=b.useState("all"),[R,L]=b.useState(1),[q,F]=b.useState(10),B=b.useRef(null),V=b.useRef(null),[G,W]=b.useState("");b.useEffect(()=>(V.current&&window.clearTimeout(V.current),V.current=window.setTimeout(()=>W(A.trim()),300),()=>{V.current&&window.clearTimeout(V.current)}),[A]);const H=Math.max(1,Math.ceil(x/q));b.useEffect(()=>{L(1)},[G,O,q]),b.useEffect(()=>((async()=>{B.current?.abort();const I=new AbortController;B.current=I,v(!0);try{const D=(R-1)*q,J=await Q5({skipCount:D,maxResultCount:q,keyword:G||void 0,state:O==="all"?void 0:O==="true"},I.signal);p(J.items??[]),y(J.totalCount??0)}catch(D){if(D?.name==="AbortError")return;ge.error("Failed to load multiple options.",{description:D?.message?String(D.message):"Please try again."}),p([]),y(0)}finally{v(!1)}})(),()=>B.current?.abort()),[G,O,R,q,S]);const U=()=>j(k=>k+1),$=k=>{E(null),u(k),n(!0)},Z=k=>{E(null),c(k),i(!0)};return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{className:"pb-4",children:s.jsx("div",{className:"flex flex-col gap-4",children:s.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[s.jsx(me,{placeholder:"Search",value:A,onChange:k=>C(k.target.value),style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),s.jsxs(We,{value:O,onValueChange:T,children:[s.jsx(Ke,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"State"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"all",children:"All States"}),s.jsx(_e,{value:"true",children:"Active"}),s.jsx(_e,{value:"false",children:"Inactive"})]})]}),s.jsx("div",{className:"flex-1"}),s.jsxs(fe,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0",onClick:()=>t(!0),children:["New Multiple Options ",s.jsx(In,{className:"ml-1 h-4 w-4"})]})]})})}),s.jsx("div",{className:"flex-1 overflow-auto pt-6",children:s.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-50 hover:bg-gray-50",children:[s.jsx(ye,{className:"font-bold text-gray-900 w-[200px]",children:"Multiple Option Name"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[200px]",children:"Option Code"}),s.jsx(ye,{className:"font-bold text-gray-900",children:"Contents"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[100px]",children:"State"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[100px]",children:"Order"}),s.jsx(ye,{className:"font-bold text-gray-900 w-[180px]",children:"Last Edited"}),s.jsx(ye,{className:"font-bold text-gray-900 text-center w-[100px]",children:"Actions"})]})}),s.jsx($r,{children:m?s.jsx(Fe,{children:s.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):h.length===0?s.jsx(Fe,{children:s.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):h.map(k=>s.jsxs(Fe,{className:"hover:bg-gray-50",children:[s.jsx(de,{className:"font-medium",children:QI(k.optionName)}),s.jsx(de,{className:"text-gray-600",children:QI(k.optionCode)}),s.jsx(de,{className:"text-gray-600",children:k.optionValuesJson&&k.optionValuesJson.length>0?k.optionValuesJson.join("; "):"None"}),s.jsx(de,{children:s.jsx(Or,{className:k.state?"bg-green-600":"bg-gray-400",children:k.state?"Active":"Inactive"})}),s.jsx(de,{className:"font-numeric",children:k.orderNum??"None"}),s.jsx(de,{className:"text-gray-500 tabular-nums font-numeric",children:k.creationTime?new Date(k.creationTime).toLocaleString():"None"}),s.jsx(de,{className:"text-center",children:s.jsxs(Ta,{open:N===k.id,onOpenChange:I=>E(I?k.id:null),children:[s.jsx(ka,{asChild:!0,children:s.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:s.jsx(Ji,{className:"h-4 w-4 text-gray-500"})})}),s.jsxs(Ra,{align:"end",className:"w-40 p-1",children:[s.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>$(k),children:[s.jsx(kn,{className:"w-4 h-4"}),"Edit"]}),s.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>Z(k),children:"Delete"})]})]})})]},k.id))})]})})}),s.jsx("div",{className:"pt-4",children:s.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[s.jsxs("div",{children:["Showing ",x===0?0:(R-1)*q+1,"-",Math.min(R*q,x)," of ",x]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(We,{value:String(q),onValueChange:k=>F(Number(k)),children:[s.jsx(Ke,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:s.jsx(Ge,{})}),s.jsx(Xe,{children:[10,20,50].map(k=>s.jsxs(_e,{value:String(k),children:[k," / page"]},k))})]}),s.jsx(Gi,{className:"mx-0 w-auto justify-end",children:s.jsxs(Ki,{children:[s.jsx(Mt,{children:s.jsx(Xi,{href:"#",size:"default",onClick:k=>{k.preventDefault(),L(I=>Math.max(1,I-1))},"aria-disabled":R<=1,className:R<=1?"pointer-events-none opacity-50":""})}),s.jsx(Mt,{children:s.jsxs(Ca,{href:"#",isActive:!0,size:"default",onClick:k=>k.preventDefault(),children:["Page ",R," / ",H]})}),s.jsx(Mt,{children:s.jsx(Yi,{href:"#",size:"default",onClick:k=>{k.preventDefault(),L(I=>Math.min(H,I+1))},"aria-disabled":R>=H,className:R>=H?"pointer-events-none opacity-50":""})})]})})]})]})}),s.jsx(nfe,{open:e,onOpenChange:t,onCreated:()=>{L(1),U()}}),s.jsx(afe,{open:r,option:o,onOpenChange:k=>{n(k),k||u(null)},onUpdated:U}),s.jsx(ife,{open:a,option:d,onOpenChange:k=>{i(k),k||c(null)},onDeleted:U})]})}function nfe({open:e,onOpenChange:t,onCreated:r}){const[n,a]=b.useState(!1),[i,o]=b.useState({optionCode:"",optionName:"",optionValuesJson:[],state:!0,orderNum:null}),[u,d]=b.useState(""),c=()=>{o({optionCode:"",optionName:"",optionValuesJson:[],state:!0,orderNum:null}),d("")};b.useEffect(()=>{e||c()},[e]);const h=()=>{const v=u.trim();if(v){if(i.optionValuesJson.includes(v)){ge.error("Duplicate value",{description:"This value already exists."});return}o(x=>({...x,optionValuesJson:[...x.optionValuesJson,v]})),d("")}},p=v=>{o(x=>({...x,optionValuesJson:x.optionValuesJson.filter((y,S)=>S!==v)}))},m=async()=>{if(!i.optionCode.trim()||!i.optionName.trim()){ge.error("Validation failed",{description:"Option Code and Option Name are required."});return}if(i.optionValuesJson.length===0){ge.error("Validation failed",{description:"At least one option value is required."});return}if(i.orderNum===null||i.orderNum===void 0||!Number.isFinite(i.orderNum)){ge.error("Validation failed",{description:"Order is required."});return}a(!0);try{await $de(i),ge.success("Multiple option created.",{description:"The multiple option has been created successfully."}),t(!1),r()}catch(v){ge.error("Failed to create multiple option.",{description:v?.message?String(v.message):"Please try again."})}finally{a(!1)}};return s.jsx(vt,{open:e,onOpenChange:t,children:s.jsxs(mt,{className:"sm:max-w-[600px]",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Add New Multiple Option"}),s.jsx(Pt,{children:"Enter the details for the new multiple option."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Option Code *"}),s.jsx(me,{placeholder:"e.g. OPT_ALLERGENS",value:i.optionCode,onChange:v=>o(x=>({...x,optionCode:v.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Option Name *"}),s.jsx(me,{placeholder:"e.g. Allergens",value:i.optionName,onChange:v=>o(x=>({...x,optionName:v.target.value}))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Option Values *"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(me,{placeholder:"Enter a value and press Add",value:u,onChange:v=>d(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),h())}}),s.jsx(fe,{type:"button",onClick:h,variant:"outline",children:"Add"})]}),i.optionValuesJson.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:i.optionValuesJson.map((v,x)=>s.jsxs(Or,{variant:"secondary",className:"flex items-center gap-1",children:[v,s.jsx("button",{type:"button",onClick:()=>p(x),className:"ml-1 hover:text-red-600",children:s.jsx(ko,{className:"h-3 w-3"})})]},x))})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Order *"}),s.jsx(me,{type:"number",placeholder:"e.g. 1",value:i.orderNum??"",onChange:v=>o(x=>({...x,orderNum:v.target.value?Number(v.target.value):null}))})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),s.jsx(Gt,{checked:i.state,onCheckedChange:v=>o(x=>({...x,state:v}))})]})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(fe,{disabled:n,onClick:m,children:n?"Creating...":"Create"})]})]})})}function afe({open:e,option:t,onOpenChange:r,onUpdated:n}){const[a,i]=b.useState(!1),[o,u]=b.useState({optionCode:"",optionName:"",optionValuesJson:[],state:!0,orderNum:null}),[d,c]=b.useState("");b.useEffect(()=>{e&&t&&(u({optionCode:t.optionCode??"",optionName:t.optionName??"",optionValuesJson:t.optionValuesJson??[],state:t.state??!0,orderNum:t.orderNum??null}),c(""))},[e,t]);const h=()=>{const v=d.trim();if(v){if(o.optionValuesJson.includes(v)){ge.error("Duplicate value",{description:"This value already exists."});return}u(x=>({...x,optionValuesJson:[...x.optionValuesJson,v]})),c("")}},p=v=>{u(x=>({...x,optionValuesJson:x.optionValuesJson.filter((y,S)=>S!==v)}))},m=async()=>{if(t?.id){if(!o.optionCode.trim()||!o.optionName.trim()){ge.error("Validation failed",{description:"Option Code and Option Name are required."});return}if(o.optionValuesJson.length===0){ge.error("Validation failed",{description:"At least one option value is required."});return}if(o.orderNum===null||o.orderNum===void 0||!Number.isFinite(o.orderNum)){ge.error("Validation failed",{description:"Order is required."});return}i(!0);try{await Bde(t.id,o),ge.success("Multiple option updated.",{description:"The multiple option has been updated successfully."}),r(!1),n()}catch(v){ge.error("Failed to update multiple option.",{description:v?.message?String(v.message):"Please try again."})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-[600px]",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Edit Multiple Option"}),s.jsx(Pt,{children:"Update the multiple option details."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Option Code *"}),s.jsx(me,{placeholder:"e.g. OPT_ALLERGENS",value:o.optionCode,onChange:v=>u(x=>({...x,optionCode:v.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Option Name *"}),s.jsx(me,{placeholder:"e.g. Allergens",value:o.optionName,onChange:v=>u(x=>({...x,optionName:v.target.value}))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Option Values *"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(me,{placeholder:"Enter a value and press Add",value:d,onChange:v=>c(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),h())}}),s.jsx(fe,{type:"button",onClick:h,variant:"outline",children:"Add"})]}),o.optionValuesJson.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:o.optionValuesJson.map((v,x)=>s.jsxs(Or,{variant:"secondary",className:"flex items-center gap-1",children:[v,s.jsx("button",{type:"button",onClick:()=>p(x),className:"ml-1 hover:text-red-600",children:s.jsx(ko,{className:"h-3 w-3"})})]},x))})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Order *"}),s.jsx(me,{type:"number",placeholder:"e.g. 1",value:o.orderNum??"",onChange:v=>u(x=>({...x,orderNum:v.target.value?Number(v.target.value):null}))})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),s.jsx(Gt,{checked:o.state,onCheckedChange:v=>u(x=>({...x,state:v}))})]})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{disabled:a,onClick:m,children:a?"Updating...":"Update"})]})]})})}function ife({open:e,option:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>(t?.optionName??"").trim()||t?.optionCode||"this option",[t]),u=async()=>{if(t?.id){i(!0);try{await Fde(t.id),ge.success("Multiple option deleted.",{description:"The multiple option has been removed successfully."}),r(!1),n()}catch(d){ge.error("Failed to delete multiple option.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-none",style:{width:"30%"},children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Delete Multiple Option"}),s.jsx(Pt,{children:"This action cannot be undone."})]}),s.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",s.jsx("span",{className:"font-medium",children:o}),"?"]}),s.jsxs(wt,{className:"flex-row flex-wrap justify-end",children:[s.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function ofe({currentView:e="Labels",onViewChange:t}){const r=["Labels","Label Categories","Label Types","Label Templates","Multiple Options"],n=a=>{t&&t(a)};return s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"w-full border-b border-gray-200",children:s.jsx("div",{className:"flex overflow-x-auto bg-white",children:r.map(a=>s.jsx("div",{onClick:()=>n(a),style:e===a?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px ${e===a?"text-blue-600":"border-b-2 border-b-transparent text-gray-600 hover:text-gray-800"}`,children:a},a))})}),s.jsxs("div",{className:"min-h-[400px]",children:[e==="Labels"&&s.jsx(bue,{}),e==="Label Categories"&&s.jsx(_ue,{}),e==="Label Types"&&s.jsx(Oue,{}),e==="Label Templates"&&s.jsx(efe,{}),e==="Multiple Options"&&s.jsx(rfe,{}),!["Labels","Label Categories","Label Types","Label Templates","Multiple Options"].includes(e)&&s.jsxs("div",{className:"flex items-center justify-center h-64 text-gray-400",children:[e," content coming soon..."]})]})]})}function sfe(){const[e,t]=b.useState([{id:"1",name:"Pop",isOpen:!0,subcategories:[{id:"1-1",name:"2024",isOpen:!0,files:[{id:"f1",name:"uuuuu",date:"10/23/24, 12:21 AM",type:"image"},{id:"f2",name:"664EF167-DFCE-49C1-A417-DC09FEDF78D7.jpg",date:"11/24/25, 8:40 PM",type:"image"}]}]},{id:"2",name:"Training",isOpen:!0,subcategories:[{id:"2-1",name:"BOH",isOpen:!1,files:[]},{id:"2-2",name:"FOH",isOpen:!0,files:[]}]},{id:"3",name:"ww",isOpen:!1,subcategories:[]}]),r=a=>{t(i=>i.map(o=>o.id===a?{...o,isOpen:!o.isOpen}:o))},n=(a,i)=>{t(o=>o.map(u=>u.id!==a?u:{...u,subcategories:u.subcategories.map(d=>d.id===i?{...d,isOpen:!d.isOpen}:d)}))};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(me,{className:"bg-white border border-black rounded-md h-10 w-[150px]"}),s.jsx("span",{className:"text-sm text-black whitespace-nowrap",children:"Search"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(We,{defaultValue:"all",children:[s.jsx(Ke,{className:"bg-white border border-black rounded-md h-10 w-[100px]",children:s.jsx(Ge,{placeholder:"Location"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"all",children:"all"}),s.jsx(_e,{value:"loc-a",children:"Location A"})]})]}),s.jsx("span",{className:"text-sm text-black whitespace-nowrap",children:"Location"})]})]}),s.jsxs("div",{className:"bg-gray-100 p-2 flex justify-between items-center border-b border-gray-200",children:[s.jsx("h1",{className:"text-xl font-medium text-gray-700",children:"Information"}),s.jsxs("div",{className:"flex items-center gap-4 text-gray-600",children:[s.jsx("div",{className:"flex items-center gap-1 bg-gray-700 text-white text-[10px] px-1 py-0.5 rounded-sm font-bold",children:"NEW"}),s.jsx(e6,{className:"h-5 w-5"}),s.jsx("span",{className:"font-medium",children:"55789"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("button",{className:"w-full bg-[#2c7bb6] hover:bg-[#256b9e] text-white py-2 px-4 flex items-center gap-2 text-sm font-medium rounded-sm",children:[s.jsx(In,{className:"h-4 w-4"}),"New Category",s.jsx(Vh,{className:"h-4 w-4 opacity-70"})]}),s.jsx("div",{className:"space-y-4",children:e.map(a=>s.jsxs("div",{className:"border border-gray-300 rounded-sm overflow-hidden",children:[s.jsxs("div",{className:"bg-gradient-to-b from-gray-50 to-gray-100 border-b border-gray-200 p-2 flex items-center justify-between",children:[s.jsxs("button",{onClick:()=>r(a.id),className:"flex items-center gap-2 text-gray-700 font-medium text-sm flex-1 text-left",children:[a.isOpen?s.jsx(el,{className:"h-4 w-4 text-[#2c7bb6]"}):s.jsx(tl,{className:"h-4 w-4 text-[#2c7bb6]"}),a.name]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:s.jsx(Bh,{className:"h-4 w-4"})}),s.jsx("button",{className:"text-red-400 hover:text-red-600",children:s.jsx(ko,{className:"h-4 w-4"})})]})]}),a.isOpen&&s.jsxs("div",{className:"p-2 space-y-3 bg-white",children:[s.jsxs("button",{className:"w-full bg-[#2c7bb6] hover:bg-[#256b9e] text-white py-2 px-4 flex items-center gap-2 text-sm font-medium rounded-sm",children:[s.jsx(In,{className:"h-4 w-4"}),"New Subcategory",s.jsx(Vh,{className:"h-4 w-4 opacity-70"})]}),s.jsxs("div",{className:"space-y-3",children:[a.subcategories.map(i=>s.jsxs("div",{className:"border border-gray-200 rounded-sm",children:[s.jsxs("div",{className:"bg-white border-b border-gray-200 p-2 flex items-center justify-between",children:[s.jsxs("button",{onClick:()=>n(a.id,i.id),className:"flex items-center gap-2 text-gray-700 font-medium text-sm flex-1 text-left",children:[i.isOpen?s.jsx(el,{className:"h-4 w-4 text-[#2c7bb6]"}):s.jsx(tl,{className:"h-4 w-4 text-[#2c7bb6]"}),i.name]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:s.jsx(Bh,{className:"h-4 w-4"})}),s.jsx("button",{className:"text-red-400 hover:text-red-600",children:s.jsx(ko,{className:"h-4 w-4"})})]})]}),i.isOpen&&s.jsxs("div",{className:"p-3 bg-gray-50/50",children:[s.jsx("div",{className:"mb-2 text-xs font-bold text-gray-500 uppercase tracking-wide",children:"Files"}),s.jsxs("div",{className:"flex flex-wrap gap-2 mb-3 justify-end",children:[s.jsx(fe,{size:"sm",className:"h-8 bg-[#4CAF50] hover:bg-[#43a047] text-white text-xs border-none rounded-sm",children:"Upload Your Own File(s)"}),s.jsx(fe,{size:"sm",className:"h-8 bg-[#4CAF50] hover:bg-[#43a047] text-white text-xs border-none rounded-sm",children:"Create A Custom File"}),s.jsx(fe,{size:"sm",className:"h-8 bg-[#2c7bb6] hover:bg-[#256b9e] text-white text-xs border-none rounded-sm",children:"Edit File Permissions"}),s.jsxs(fe,{size:"sm",className:"h-8 bg-[#2c7bb6] hover:bg-[#256b9e] text-white text-xs border-none rounded-sm gap-1",children:["Sort (A-Z) ",s.jsx(nz,{className:"h-3 w-3"})]})]}),s.jsx("div",{className:"space-y-1",children:i.files.length>0?i.files.map(o=>s.jsxs("div",{className:"flex items-center bg-gray-200/50 p-2 border border-gray-200 rounded-sm text-sm hover:bg-gray-200 transition-colors",children:[s.jsx("div",{className:"flex-shrink-0 mr-3",children:o.type==="image"?s.jsx(Oz,{className:"h-5 w-5 text-[#2c7bb6]"}):s.jsx(rl,{className:"h-5 w-5 text-[#2c7bb6]"})}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("div",{className:"font-medium text-gray-700 truncate",children:o.name})}),s.jsx("div",{className:"text-xs text-gray-500 mr-4 whitespace-nowrap",children:o.date}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{className:"p-1 text-gray-400 hover:text-gray-600 bg-white border border-gray-300 rounded-sm",children:s.jsx(rl,{className:"h-3 w-3"})}),s.jsx("button",{className:"p-1 text-gray-400 hover:text-gray-600 bg-white border border-gray-300 rounded-sm",children:s.jsx(Bh,{className:"h-3 w-3"})}),s.jsx("button",{className:"p-1 text-red-400 hover:text-red-600 bg-white border border-gray-300 rounded-sm",children:s.jsx(ko,{className:"h-3 w-3"})})]})]},o.id)):s.jsx("div",{className:"p-4 border-2 border-dashed border-gray-300 rounded-sm text-center text-gray-400 text-sm",children:"No files in this subcategory"})})]})]},i.id)),a.subcategories.length===0&&s.jsx("div",{className:"p-2 text-sm text-gray-400 italic",children:"No subcategories"})]})]})]},a.id))})]})]})}const lfe=[{id:1,title:"Coffee - 2 hrs",subtitle:"1 min - Completes at 12:05 PM",totalTime:7200,remainingTime:0,status:"expired",icon:bz},{id:2,title:"Clean Tablet",subtitle:"1 hrs - Completes at 12:37 PM",totalTime:3600,remainingTime:237,status:"running",icon:n6},{id:3,title:"Replace Sanitizer Towels",subtitle:"1 hrs - Completes at 12:37 PM",totalTime:3600,remainingTime:238,status:"running",icon:du},{id:4,title:"Take Out Trash",subtitle:"1 hrs - Completes at 01:03 PM",totalTime:3600,remainingTime:58,status:"running",icon:du},{id:5,title:"Change Utensils",subtitle:"1 hrs - Completes at 01:03 PM",totalTime:3600,remainingTime:58,status:"running",icon:v6},{id:6,title:"Sanitize Surfaces",subtitle:"1 hrs - Completes at 02:00 PM",totalTime:3600,remainingTime:2157,status:"running",icon:gy},{id:7,title:"Check Temperatures",subtitle:"1 hrs - Completes at 02:00 PM",totalTime:3600,remainingTime:2158,status:"running",icon:gy},{id:8,title:"Ranch 4 hrs",subtitle:"4 hrs - Completes at 04:04 PM",totalTime:14400,remainingTime:2158,status:"running",icon:gy}];function cfe({timer:e}){const t=(e.totalTime-e.remainingTime)/e.totalTime*100,r=e.remainingTime===0,n=a=>{if(a<=0)return"0s";const i=Math.floor(a/60),o=a%60;return`${i.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`};return s.jsxs("div",{className:"bg-gray-200 rounded-xl p-4 flex flex-col items-center relative shadow-sm h-[280px]",children:[s.jsxs("div",{className:"text-center mb-2",children:[s.jsx("h3",{className:"text-lg font-medium text-gray-800 leading-tight",children:e.title}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.subtitle})]}),s.jsxs("div",{className:"relative w-32 h-32 my-auto flex items-center justify-center",children:[s.jsxs("svg",{className:"w-full h-full transform -rotate-90",children:[s.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:"white",strokeWidth:"12",fill:"transparent"}),s.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:r?"#ef4444":"#3b82f6",strokeWidth:"12",fill:"transparent",strokeDasharray:351.86,strokeDashoffset:r?0:351.86*(t/100),className:"transition-all duration-1000 ease-linear"})]}),s.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[s.jsx("span",{className:Ae("text-3xl font-bold",r?"text-red-500":"text-gray-800"),children:r?"0s":n(e.remainingTime)}),s.jsx("span",{className:Ae("text-[10px] font-medium uppercase mt-1",r?"text-red-400":"text-gray-400"),children:"Remaining"})]})]}),s.jsxs("div",{className:"w-full flex justify-between items-end mt-2",children:[s.jsx(zz,{className:"w-5 h-5 text-blue-700 fill-current"}),s.jsx("div",{className:"flex flex-col items-center",children:s.jsx("div",{className:"w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center text-gray-400 mb-1",children:s.jsx(e.icon,{className:"w-5 h-5"})})}),s.jsx("div",{className:"flex flex-col items-end",children:s.jsx("span",{className:"text-xs text-blue-600 font-bold mb-2 cursor-pointer",children:"EDIT"})})]}),s.jsx("button",{className:"absolute bottom-12 right-4 bg-blue-600 rounded-full p-1 text-white hover:bg-blue-700 shadow-md",children:s.jsx(ko,{className:"w-4 h-4"})})]})}function ufe(){const[e,t]=b.useState(!0);return s.jsxs("div",{className:"h-full flex flex-col bg-gray-50 relative",children:[s.jsxs("div",{className:"bg-white border-b border-gray-200 px-4 py-3 flex items-center justify-between shadow-sm z-10",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("button",{className:"flex items-center text-blue-500 text-lg font-medium",children:[s.jsx(oM,{className:"w-6 h-6"}),"Back"]}),s.jsx(Lz,{className:"w-6 h-6 text-gray-500"})]}),s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"bg-blue-600 p-1.5 rounded-md",children:s.jsx(o6,{className:"w-5 h-5 text-white"})}),s.jsx("h1",{className:"text-xl font-bold text-blue-900",children:"Timers"})]}),s.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 font-medium",children:[s.jsx("span",{children:"86016"}),s.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"})]})]}),s.jsxs("div",{className:"flex items-center gap-4 text-blue-500 font-medium",children:[s.jsx(p6,{className:"w-6 h-6 text-gray-400"}),s.jsxs("button",{className:"flex items-center gap-1",children:[s.jsx(In,{className:"w-5 h-5"}),"Add Timer"]})]})]}),s.jsxs("div",{className:"bg-gray-700 text-white px-6 py-2 flex items-center justify-between",children:[s.jsx("div",{className:"flex-1"})," ",s.jsx("div",{className:"font-medium",children:"Today, December 15"}),s.jsxs("div",{className:"flex-1 flex justify-end items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Cz,{className:"w-5 h-5 text-gray-300"}),s.jsx(kz,{className:"w-5 h-5 text-gray-500"})]}),s.jsx(J8,{className:"w-5 h-5 text-blue-400"})]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:lfe.map(r=>s.jsx(cfe,{timer:r},r.id))})}),e&&s.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-[1px]",children:s.jsx("div",{className:"bg-black text-white rounded-xl shadow-2xl w-[600px] max-w-full overflow-hidden border border-gray-800",children:s.jsxs("div",{className:"p-8 text-center space-y-6",children:[s.jsx("h2",{className:"text-3xl font-medium text-blue-500",children:"Coffee - 2 hrs"}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsx("p",{className:"text-2xl font-light",children:"Timer expired at 12:05 PM"}),s.jsx("p",{className:"text-2xl font-light",children:"Please discard the coffee"})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx("span",{className:"bg-gray-200 text-black text-[10px] px-1 rounded-sm opacity-50",children:"TACT_Img_Timer-Notification@2x"})}),s.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-8",children:[s.jsx(fe,{onClick:()=>t(!1),className:"bg-blue-700 hover:bg-blue-600 text-white h-14 text-xl font-medium rounded-lg",children:"Mute"}),s.jsx(fe,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-500 text-white h-14 text-xl font-medium rounded-lg",children:"Restart"}),s.jsx(fe,{onClick:()=>t(!1),className:"bg-blue-800 hover:bg-blue-700 text-white h-14 text-xl font-medium rounded-lg",children:"Acknowledge"})]})]})})})]})}const jg=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),_g="/product-location";function dfe(e){const t=e;return{id:t?.id??t?.Id,locationId:t?.locationId??t?.LocationId,productId:t?.productId??t?.ProductId}}async function ffe(e,t){const r=await jg.requestJson({path:_g,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,LocationId:e.locationId,ProductId:e.productId},signal:t});return{...r,items:(r.items??[]).map(n=>dfe(n))}}async function Z5(e,t){const r=await jg.requestJson({path:`${_g}/${encodeURIComponent(e)}`,method:"GET",signal:t});return Array.isArray(r?.productIds)?r.productIds.map(String):Array.isArray(r?.items)?(r.items??[]).map(n=>n?.productId).filter(n=>typeof n=="string"&&n.length>0):[]}async function eB(e){return jg.requestJson({path:_g,method:"POST",body:{locationId:e.locationId,productIds:e.productIds}})}async function hfe(e,t){return jg.requestJson({path:`${_g}/${encodeURIComponent(e)}`,method:"PUT",body:{productIds:t.productIds}})}function ea(e){const t=(e??"").trim();return t||"—"}async function pfe(e){const t=new Map;try{const r=await ffe({skipCount:0,maxResultCount:2e3},e);for(const n of r.items??[]){const a=(n.productId??"").trim(),i=(n.locationId??"").trim();if(!a||!i)continue;t.has(a)||t.set(a,[]);const o=t.get(a);o.includes(i)||o.push(i)}}catch{}return t}async function mfe(e,t,r){const n=[...new Set(r.filter(Boolean))];for(const a of n){if(a===t)continue;const i=await Z5(a);i.includes(e)&&await hfe(a,{productIds:i.filter(o=>o!==e)})}t.trim()&&await eB({locationId:t,productIds:[e]})}function gfe(){const[e,t]=b.useState("products"),[r,n]=b.useState([]),[a,i]=b.useState(0),[o,u]=b.useState(!1),[d,c]=b.useState(new Map),[h,p]=b.useState([]),[m,v]=b.useState([]),[x,y]=b.useState(""),[S,j]=b.useState(""),N=b.useRef(null),[E,A]=b.useState("all"),[C,O]=b.useState("all"),[T,R]=b.useState("all"),[L,q]=b.useState(1),[F,B]=b.useState(10),[V,G]=b.useState(0),W=b.useRef(null),[H,U]=b.useState(!1),[$,Z]=b.useState(!1),[k,I]=b.useState(null),[D,J]=b.useState(null),[ae,ie]=b.useState(null);b.useEffect(()=>(N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>j(x.trim()),300),()=>{N.current&&window.clearTimeout(N.current)}),[x]),b.useEffect(()=>{let K=!1;return(async()=>{try{const[je,Ce]=await Promise.all([Jl({skipCount:0,maxResultCount:500}),y_({skipCount:0,maxResultCount:500})]);if(K)return;p(je.items??[]),v(Ce.items??[])}catch{K||(p([]),v([]))}})(),()=>{K=!0}},[]),b.useEffect(()=>{q(1)},[S,E,C,T,F]);const ne=E!=="all"||C!=="all";b.useEffect(()=>e!=="products"?void 0:((async()=>{W.current?.abort();const je=new AbortController;W.current=je,u(!0);try{const Ce=await pfe(je.signal);if(je.signal.aborted)return;if(c(Ce),ne){const Le=await AS({skipCount:0,maxResultCount:500,keyword:S||void 0,state:T==="all"?void 0:T==="true"},je.signal);if(je.signal.aborted)return;let De=Le.items??[];if(E!=="all"){const ft=new Set(await Z5(E));De=De.filter(Zt=>ft.has(Zt.id))}C!=="all"&&(De=De.filter(ft=>(ft.categoryName??"").trim()===C));const tt=De.length;i(tt);const _t=(L-1)*F;n(De.slice(_t,_t+F))}else{const Le=(L-1)*F,De=await AS({skipCount:Le,maxResultCount:F,keyword:S||void 0,state:T==="all"?void 0:T==="true"},je.signal);if(je.signal.aborted)return;n(De.items??[]),i(De.totalCount??0)}}catch(Ce){if(Ce?.name==="AbortError")return;ge.error("Failed to load products",{description:Ce?.message?String(Ce.message):"Please try again."}),n([]),i(0)}finally{je.signal.aborted||u(!1)}})(),()=>W.current?.abort()),[e,S,E,C,T,L,F,V,ne]);const X=()=>G(K=>K+1),Y=b.useMemo(()=>h.map(K=>({value:K.id,label:ea(K.locationName??K.locationCode??K.id)})),[h]),ee=b.useMemo(()=>m.map(K=>({value:(K.categoryName??K.categoryCode??K.id??"").trim(),label:ea(K.categoryName??K.categoryCode??K.id)})).filter(K=>K.value),[m]),le=Math.max(1,Math.ceil(a/F)),pe=b.useCallback(K=>{const je=h.find(Ce=>Ce.id===K);return ea(je?.locationName??je?.locationCode??K)},[h]);return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsxs("div",{className:"pb-4",children:[s.jsxs("div",{className:"flex flex-nowrap items-center gap-3 flex-wrap",children:[s.jsxs("div",{className:"flex items-center w-40 shrink-0 rounded-md border border-gray-300 bg-white overflow-hidden",style:{height:40},children:[s.jsx(cm,{className:"h-4 w-4 text-gray-400 shrink-0 ml-2.5 pointer-events-none"}),s.jsx(me,{placeholder:"Search...",value:x,onChange:K=>y(K.target.value),className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full placeholder:text-gray-500"})]}),s.jsxs(We,{value:"all",disabled:!0,children:[s.jsx(Ke,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0 opacity-70",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Partner"})}),s.jsx(Xe,{children:s.jsx(_e,{value:"all",children:"All partners"})})]}),s.jsxs(We,{value:"all",disabled:!0,children:[s.jsx(Ke,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0 opacity-70",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Group"})}),s.jsx(Xe,{children:s.jsx(_e,{value:"all",children:"All groups"})})]}),s.jsxs(We,{value:E,onValueChange:A,children:[s.jsx(Ke,{className:"w-[160px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Location"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"all",children:"All Locations"}),h.map(K=>s.jsx(_e,{value:K.id,children:ea(K.locationName??K.locationCode??K.id)},K.id))]})]}),s.jsxs(We,{value:C,onValueChange:O,children:[s.jsx(Ke,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Category"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"all",children:"All Categories"}),ee.map(K=>s.jsx(_e,{value:K.value,children:K.label},K.value))]})]}),s.jsxs(We,{value:T,onValueChange:R,children:[s.jsx(Ke,{className:"w-[120px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"State"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"all",children:"All states"}),s.jsx(_e,{value:"true",children:"Active"}),s.jsx(_e,{value:"false",children:"Inactive"})]})]}),s.jsx("div",{className:"flex-1 min-w-2"}),s.jsxs(fe,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",disabled:!0,children:[s.jsx(f6,{className:"w-4 h-4"})," Bulk Import"]}),s.jsxs(fe,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",disabled:!0,children:[s.jsx(LS,{className:"w-4 h-4"})," Bulk Export"]}),s.jsxs(fe,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",disabled:!0,children:[s.jsx(kn,{className:"w-4 h-4"})," Bulk Edit"]}),e==="products"?s.jsxs(fe,{className:"h-10 rounded-md bg-blue-600 text-white hover:bg-blue-700 font-medium gap-1 shrink-0",onClick:()=>{I(null),U(!0)},children:["New Product ",s.jsx(In,{className:"w-4 h-4"})]}):s.jsxs(fe,{className:"h-10 rounded-md bg-blue-600 text-white hover:bg-blue-700 font-medium gap-1 shrink-0",onClick:()=>Z(!0),children:["New Category ",s.jsx(In,{className:"w-4 h-4"})]})]}),s.jsx("div",{className:"w-full border-b border-gray-200 mt-4",children:s.jsxs("div",{className:"flex overflow-x-auto w-fit",children:[s.jsx("button",{type:"button",onClick:()=>t("products"),style:e==="products"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2 ${e==="products"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"}`,children:"Products"}),s.jsx("button",{type:"button",onClick:()=>t("categories"),style:e==="categories"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2 ${e==="categories"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"}`,children:"Categories"})]})})]}),s.jsx("div",{className:"flex-1 overflow-auto pt-6",children:e==="products"?s.jsxs("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:[s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-100 hover:bg-gray-100",children:[s.jsx(ye,{className:"text-gray-900 font-bold border-r whitespace-nowrap",children:"Location"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r whitespace-nowrap",children:"Product Category"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r whitespace-nowrap",children:"Product"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r whitespace-nowrap",children:"Product ID"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r whitespace-nowrap",children:"Product Code"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r whitespace-nowrap",children:"Status"}),s.jsx(ye,{className:"text-gray-900 font-bold text-center whitespace-nowrap",children:"Actions"})]})}),s.jsx($r,{children:o?s.jsx(Fe,{children:s.jsx(de,{colSpan:7,className:"text-center text-gray-500 py-10",children:"Loading..."})}):r.length===0?s.jsx(Fe,{children:s.jsx(de,{colSpan:7,className:"text-center text-gray-500 py-10",children:"No products found."})}):r.map(K=>{const je=d.get(K.id)??[],Ce=je.length===0?"—":je.map(De=>pe(De)).join(", "),Le=K.state!==!1;return s.jsxs(Fe,{children:[s.jsx(de,{className:"border-r text-sm max-w-[200px] truncate",title:Ce,children:Ce}),s.jsx(de,{className:"border-r text-gray-900 font-medium whitespace-nowrap",children:ea(K.categoryName)}),s.jsx(de,{className:"border-r text-gray-900 font-medium",children:s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[K.productImageUrl?s.jsx("img",{src:K.productImageUrl,alt:"",className:"w-8 h-8 rounded object-cover border border-gray-200 shrink-0"}):s.jsx(uu,{className:"w-4 h-4 text-gray-400 shrink-0"}),s.jsx("span",{className:"truncate",children:ea(K.productName)})]})}),s.jsx(de,{className:"border-r font-mono text-sm text-gray-600 whitespace-nowrap",children:K.id}),s.jsx(de,{className:"border-r font-mono text-sm text-gray-600 whitespace-nowrap",children:ea(K.productCode)}),s.jsx(de,{className:"border-r whitespace-nowrap",children:s.jsx(Or,{variant:Le?"default":"secondary",className:Le?"bg-green-600":"bg-gray-400",children:Le?"active":"inactive"})}),s.jsx(de,{className:"text-center whitespace-nowrap",children:s.jsxs(Ta,{open:ae===K.id,onOpenChange:De=>ie(De?K.id:null),children:[s.jsx(ka,{asChild:!0,children:s.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(Ji,{className:"h-4 w-4"})})}),s.jsxs(Ra,{align:"end",className:"w-36 p-1",children:[s.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal",onClick:async()=>{ie(null);try{const De=await hue(K.id);I(De),U(!0)}catch(De){ge.error("Failed to load product",{description:De?.message?String(De.message):""})}},children:[s.jsx(kn,{className:"w-4 h-4 mr-2"}),"Edit"]}),s.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>{ie(null),J(K)},children:"Delete"})]})]})})]},K.id)})})]}),s.jsxs("div",{className:"flex items-center justify-between px-3 py-2 text-sm text-gray-600 border-t border-gray-100",children:[s.jsxs("span",{children:["Showing ",a===0?0:(L-1)*F+1,"-",Math.min(L*F,a)," of ",a]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(We,{value:String(F),onValueChange:K=>B(Number(K)),children:[s.jsx(Ke,{className:"w-[100px] h-9",children:s.jsx(Ge,{})}),s.jsx(Xe,{children:[10,20,50].map(K=>s.jsxs(_e,{value:String(K),children:[K," / page"]},K))})]}),s.jsx(fe,{type:"button",variant:"outline",size:"sm",disabled:L<=1,onClick:()=>q(K=>Math.max(1,K-1)),children:"Prev"}),s.jsxs("span",{className:"text-xs tabular-nums",children:["Page ",L," / ",le]}),s.jsx(fe,{type:"button",variant:"outline",size:"sm",disabled:L>=le,onClick:()=>q(K=>Math.min(le,K+1)),children:"Next"})]})]})]}):s.jsx(vfe,{categories:m})}),s.jsx(yfe,{open:H,onOpenChange:K=>{U(K),K||I(null)},editing:k,locationOptions:Y,categoryOptions:ee,locationMap:d,onSaved:()=>{X(),U(!1),I(null)}}),s.jsx(xfe,{open:!!D,product:D,onOpenChange:K=>{K||J(null)},onDeleted:X}),s.jsx(bfe,{open:$,onOpenChange:Z})]})}function vfe({categories:e}){return s.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-100 hover:bg-gray-100",children:[s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Category Name"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Code"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Status"})]})}),s.jsx($r,{children:e.length===0?s.jsx(Fe,{children:s.jsx(de,{colSpan:3,className:"text-center text-gray-500 py-8",children:"No categories loaded. Use Labeling → Label Categories to manage."})}):e.map(t=>s.jsxs(Fe,{children:[s.jsx(de,{className:"border-r font-medium",children:ea(t.categoryName)}),s.jsx(de,{className:"border-r text-gray-600",children:ea(t.categoryCode)}),s.jsx(de,{className:"border-r",children:s.jsx(Or,{variant:t.state!==!1?"default":"secondary",children:t.state!==!1?"active":"inactive"})})]},t.id))})]})})}function yfe({open:e,onOpenChange:t,editing:r,locationOptions:n,categoryOptions:a,locationMap:i,onSaved:o}){const[u,d]=b.useState(!1),[c,h]=b.useState(""),[p,m]=b.useState(""),[v,x]=b.useState(""),[y,S]=b.useState(""),[j,N]=b.useState(!0),[E,A]=b.useState("");b.useEffect(()=>{if(e)if(r){h(r.productCode??""),m(r.productName??""),x((r.categoryName??"").trim()),S(r.productImageUrl??""),N(r.state!==!1);const O=i.get(r.id)??[];A(O[0]??"")}else h(""),m(""),x(""),S(""),N(!0),A("")},[e,r,i]);const C=async()=>{if(!c.trim()||!p.trim()){ge.error("Validation",{description:"Product code and name are required."});return}if(!E.trim()){ge.error("Validation",{description:"Select a store to bind this product."});return}const O={productCode:c.trim(),productName:p.trim(),categoryName:v.trim()||null,productImageUrl:y.trim()||null,state:j};d(!0);try{if(r){await mue(r.id,O);const T=i.get(r.id)??[];await mfe(r.id,E.trim(),T)}else{const T=await pue(O);await eB({locationId:E.trim(),productIds:[T.id]})}ge.success(r?"Product updated.":"Product created."),o()}catch(T){ge.error(r?"Update failed":"Create failed",{description:T?.message?String(T.message):""})}finally{d(!1)}};return s.jsx(vt,{open:e,onOpenChange:t,children:s.jsxs(mt,{className:"w-[min(50%,calc(100vw-2rem))] max-w-none sm:max-w-none max-h-[90vh] overflow-y-auto",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:r?"Edit Product":"Add New Product"}),s.jsx(Pt,{children:r?"Update product and store binding.":"Create a product and bind it to a store."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Product code *"}),s.jsx(me,{className:"h-10",value:c,onChange:O=>h(O.target.value),placeholder:"e.g. PRD_TEST_001"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Product name *"}),s.jsx(me,{className:"h-10",value:p,onChange:O=>m(O.target.value),placeholder:"e.g. Chicken"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Category name"}),s.jsx(xa,{value:v,onValueChange:x,options:a,placeholder:"Select category (optional)",searchPlaceholder:"Search category…",emptyText:"No categories."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Image URL"}),s.jsx(me,{className:"h-10",value:y,onChange:O=>S(O.target.value),placeholder:"https://..."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Bind to store *"}),s.jsx(xa,{value:E,onValueChange:A,options:n,placeholder:"Select location",searchPlaceholder:"Search location…",emptyText:"No locations."})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 h-10 bg-white",children:[s.jsx("span",{className:"text-sm font-medium",children:"Enabled"}),s.jsx(Gt,{checked:j,onCheckedChange:N})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(fe,{type:"button",disabled:u,onClick:C,className:"bg-blue-600 hover:bg-blue-700 text-white",children:u?"Saving…":r?"Save":"Create"})]})]})})}function xfe({open:e,product:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=async()=>{if(t?.id){i(!0);try{await gue(t.id),ge.success("Product deleted."),r(!1),n()}catch(u){ge.error("Delete failed",{description:u?.message?String(u.message):""})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Delete product"}),s.jsx(Pt,{children:"This cannot be undone."})]}),s.jsxs("p",{className:"text-sm text-gray-700 py-2",children:["Delete ",s.jsx("span",{className:"font-medium",children:ea(t?.productName)})," (",ea(t?.productCode),")?"]}),s.jsxs(wt,{children:[s.jsx(fe,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{type:"button",variant:"destructive",disabled:a,onClick:o,children:a?"Deleting…":"Delete"})]})]})})}function bfe({open:e,onOpenChange:t}){return s.jsx(vt,{open:e,onOpenChange:t,children:s.jsxs(mt,{className:"sm:max-w-md",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Categories"}),s.jsxs(Pt,{children:["Manage categories under ",s.jsx("span",{className:"font-medium",children:"Labeling → Label Categories"})," (label module API)."]})]}),s.jsx(wt,{children:s.jsx(fe,{type:"button",onClick:()=>t(!1),children:"OK"})})]})})}const Sd=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),jd="/rbac-menu";function Xu(e){if(!e||typeof e!="object")return{id:""};const t=e;return{id:String(t.id??t.Id??""),orderNum:t.orderNum??t.OrderNum,state:t.state??t.State,menuName:t.menuName??t.MenuName,routerName:t.routerName??t.RouterName,menuType:t.menuType??t.MenuType,permissionCode:t.permissionCode??t.PermissionCode,parentId:t.parentId??t.ParentId,menuIcon:t.menuIcon??t.MenuIcon,routeUrl:t.routeUrl??t.RouteUrl,link:t.link??t.Link,isCache:t.isCache??t.IsCache,isShow:t.isShow??t.IsShow,remark:t.remark??t.Remark,component:t.component??t.Component,menuSource:t.menuSource??t.MenuSource,query:t.query??t.Query,concurrencyStamp:t.concurrencyStamp??t.ConcurrencyStamp}}function wfe(e){if(Array.isArray(e))return{items:e.map(Xu),totalCount:e.length};const t=e,r=t.items??t.Items??[],n=typeof t.totalCount=="number"?t.totalCount:typeof t.TotalCount=="number"?t.TotalCount:r.length;return{items:r.map(Xu),totalCount:n}}async function tB(e,t){const r=await Sd.requestJson({path:jd,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword},signal:t});return wfe(r)}function RS(e){const t=Xu(e),r=e,n=r?.children??r?.Children,a=Array.isArray(n)?n.map(RS):void 0;return{...t,children:a}}function Sfe(e){if(Array.isArray(e))return e.map(RS);if(!e||typeof e!="object")return[];const t=e,r=t.items??t.Items??t.data??t.Data;return Array.isArray(r)?r.map(RS):[]}async function jfe(e){const t=await Sd.requestJson({path:`${jd}/tree`,method:"GET",signal:e});return Sfe(t)}async function _fe(e){const t=new Map;let r=1;const n=500;for(;;){const i=(await tB({skipCount:r,maxResultCount:n},e)).items??[];for(const o of i)o.menuType!==0||!o.id||t.has(o.id)||t.set(o.id,o);if(i.length100))break}return Array.from(t.values()).sort((a,i)=>(a.orderNum??0)-(i.orderNum??0))}async function Nfe(e){const t=await Sd.requestJson({path:jd,method:"POST",body:e});return Xu(t)}async function Cfe(e,t){const r=await Sd.requestJson({path:`${jd}/${encodeURIComponent(e)}`,method:"PUT",body:t});return Xu(r)}async function Efe(e){e.length&&await Sd.requestJson({path:jd,method:"DELETE",body:e})}async function Ofe(e){await Efe([e])}const rB=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),nB="/rbac-role-menu";async function Pfe(e){await rB.requestJson({path:`${nB}/set`,method:"POST",body:e})}async function Afe(e){await rB.requestJson({path:nB,method:"DELETE",body:e})}const Tfe=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),kfe="/role";async function aB(e,t){return Tfe.requestJson({path:kfe,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,RoleName:e.roleName,RoleCode:e.roleCode,State:e.state},signal:t})}const Ng=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),Cg="/rbac-role";async function Rfe(e){return Ng.requestJson({path:Cg,method:"POST",body:e})}async function Ife(e,t){return Ng.requestJson({path:`${Cg}/${encodeURIComponent(e)}`,method:"PUT",body:t})}function Mfe(e){if(!e||typeof e!="object")return[];const t=e,r=Array.isArray(t.menuIds)?t.menuIds:Array.isArray(t.MenuIds)?t.MenuIds:void 0;if(r)return r.map(String);const n=t.data??t.Data;if(n&&typeof n=="object"){const i=n,o=Array.isArray(i.menuIds)?i.menuIds:Array.isArray(i.MenuIds)?i.MenuIds:void 0;if(o)return o.map(String)}const a=Array.isArray(t.roleMenus)?t.roleMenus:Array.isArray(t.RoleMenus)?t.RoleMenus:void 0;if(Array.isArray(a)){const i=[];for(const o of a){if(!o||typeof o!="object")continue;const u=o,d=u.menuId??u.MenuId??u.id??u.Id;d&&i.push(String(d))}return i}return[]}async function Dfe(e){e.length&&await Ng.requestJson({path:Cg,method:"DELETE",body:e})}async function Lfe(e){await Dfe([e])}async function $fe(e,t){const r=await Ng.requestJson({path:`${Cg}/${encodeURIComponent(e)}`,method:"GET",signal:t});return Mfe(r)}const _d=gn({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),Nd="/team-member";function Bfe(e){if(!Array.isArray(e))return[];const t=[];for(const r of e)if(r!=null){if(typeof r=="string"||typeof r=="number"){t.push(String(r));continue}if(typeof r=="object"){const n=r,a=n.id??n.Id??n.locationId??n.LocationId??n.location_id??n.locationID;a!=null&&t.push(String(a))}}return t}function Ffe(e){if(!Array.isArray(e))return[];const t=[];for(const r of e)if(r!=null){if(typeof r=="string"||typeof r=="number"){t.push(String(r));continue}if(typeof r=="object"){const n=r,a=n.locationCode??n.LocationCode??n.code??n.Code??n.location_code??n.locationCodeId,i=n.locationName??n.LocationName??n.name??n.Name??n.location_name,o=n.id??n.Id??n.locationId??n.LocationId,u=a==null?"":String(a).trim(),d=i==null?"":String(i).trim(),c=o==null?"":String(o).trim();u&&d?t.push(`${u} - ${d}`):d?t.push(d):u?t.push(u):c&&t.push(c)}}return t}function Eg(e){if(!e||typeof e!="object")return{id:""};const t=e,r=String(t.id??t.Id??t.userId??t.UserId??t.user_id??t.UserID??t.memberId??t.MemberId??""),n=t.fullName??t.FullName??t.name??t.Name,a=t.userName??t.UserName??t.username??t.UserName,i=t.email??t.Email,o=t.phone??t.Phone;let u=t.roleId??t.RoleId,d=t.roleName??t.RoleName??t.roleName??t.Role;const c=t.role??t.Role;if((!u||!d)&&c&&typeof c=="object"){const S=c;u=S.id??S.Id??S.roleId??S.RoleId??u,d=S.roleName??S.RoleName??S.name??S.Name??S.role??S.Role??d}const h=t.state??t.State,p=typeof h=="boolean"?h:h==="true"?!0:h==="false"?!1:void 0,m=t.locationIds??t.LocationIds??t.assignedLocationIds??t.AssignedLocationIds??t.location_id_list??t.LocationIdList;let v=Bfe(m);const x=t.locations??t.Locations??t.assignedLocations??t.AssignedLocations??t.locationNames??t.LocationNames;let y=Ffe(x);if(v.length===0&&Array.isArray(x)){const S=[];for(const j of x){if(typeof j!="object"||!j)continue;const N=j,E=N.id??N.Id??N.locationId??N.LocationId;E!=null&&S.push(String(E))}S.length&&(v=S)}return{id:r,fullName:n,userName:a,email:i,phone:o,roleId:u,roleName:d,locationIds:v,locations:y,state:p??(t.status?String(t.status).toLowerCase()==="active":void 0)}}async function zfe(e,t){const r=await _d.requestJson({path:Nd,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Keyword:e.keyword},signal:t}),n=r.items??[];return{totalCount:r.totalCount??0,items:n.map(Eg)}}async function qfe(e,t){const r=await _d.requestJson({path:`${Nd}/${encodeURIComponent(e)}`,method:"GET",signal:t});return Eg(r)}function iB(e){if(e==null||e==="")return null;const t=String(e).trim();return t?Number(t.replace(/\D/g,""))||0:null}function Ufe(e){const t=e.phone!=null&&e.phone!==""?iB(String(e.phone)):null;return{fullName:e.fullName,userName:e.userName,password:e.password,email:e.email??null,phone:t,roleId:e.roleId,locationIds:e.locationIds,locations:e.locationIds,state:e.state}}function Vfe(e){const t=e.phone!=null&&e.phone!==""?iB(String(e.phone)):null,r={fullName:e.fullName,userName:e.userName,email:e.email??null,phone:t,roleId:e.roleId,locationIds:e.locationIds,locations:e.locationIds,state:e.state};return e.password&&(r.password=e.password),r}async function Hfe(e){const t=await _d.requestJson({path:Nd,method:"POST",body:Ufe(e)});return Eg(t)}async function Wfe(e,t){const r=await _d.requestJson({path:`${Nd}/${encodeURIComponent(e)}`,method:"PUT",body:Vfe(t)});return Eg(r)}async function Gfe(e){await _d.requestJson({path:`${Nd}/${encodeURIComponent(e)}`,method:"DELETE"})}const oB=[{id:"p1",name:"Global Foods Inc.",status:"active",contact:"admin@globalfoods.com",phone:"+1 (555) 100-2000"},{id:"p2",name:"Local Eateries Co.",status:"active",contact:"support@localeateries.com",phone:"+1 (555) 200-3000"}],Kfe=[{id:"g1",name:"West Coast Region",partner:"Global Foods Inc.",status:"active"},{id:"g2",name:"East Coast Region",partner:"Global Foods Inc.",status:"inactive"}];function Xfe(){const[e,t]=b.useState("Roles"),[r,n]=b.useState([]),[a,i]=b.useState(0),[o,u]=b.useState(!1),[d,c]=b.useState(0),[h,p]=b.useState(1),[m,v]=b.useState(10),x=Math.max(1,Math.ceil(a/m)),y=b.useRef(null),[S,j]=b.useState(""),N=b.useRef(null),[E,A]=b.useState(""),[C,O]=b.useState(oB),[T,R]=b.useState(Kfe),[L,q]=b.useState([]),[F,B]=b.useState(!1),[V,G]=b.useState(0),[W,H]=b.useState(0),[U,$]=b.useState(1),[Z,k]=b.useState(10),I=Math.max(1,Math.ceil(V/Z)),D=b.useRef(null),[J,ae]=b.useState(""),ie=b.useRef(null),[ne,X]=b.useState(""),[Y,ee]=b.useState(null),[le,pe]=b.useState(!1),[K,je]=b.useState(null),[Ce,Le]=b.useState(!1),[De,tt]=b.useState(null),[_t,ft]=b.useState(!1),[Zt,At]=b.useState(null),[St,br]=b.useState(!1),[Ia,la]=b.useState(null),[Ma,hi]=b.useState(!1),[Da,La]=b.useState(!1),[Br,yn]=b.useState(!1),ca=()=>{alert(`Exporting ${e} list to PDF...`)};b.useEffect(()=>(N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>A(S.trim()),300),()=>{N.current&&window.clearTimeout(N.current)}),[S]),b.useEffect(()=>(ie.current&&window.clearTimeout(ie.current),ie.current=window.setTimeout(()=>X(J.trim()),300),()=>{ie.current&&window.clearTimeout(ie.current)}),[J]),b.useEffect(()=>{p(1)},[E,m]),b.useEffect(()=>{$(1)},[ne,Z]),b.useEffect(()=>e!=="Roles"?void 0:((async()=>{y.current?.abort();const ut=new AbortController;y.current=ut,u(!0);try{const Ut=await aB({skipCount:Math.max(1,h),maxResultCount:m,roleName:E||void 0},ut.signal);n(Ut.items??[]),i(Ut.totalCount??0)}catch(Ut){if(Ut?.name==="AbortError")return;ge.error("Failed to load roles.",{description:Ut?.message?String(Ut.message):"Please try again."}),n([]),i(0)}finally{u(!1)}})(),()=>y.current?.abort()),[e,E,h,m,d]),b.useEffect(()=>e!=="Team Member"?void 0:((async()=>{D.current?.abort();const ut=new AbortController;D.current=ut,B(!0);try{const Ut=await zfe({skipCount:Math.max(1,U),maxResultCount:Z,keyword:ne||void 0},ut.signal);q(Ut.items??[]),G(Ut.totalCount??0)}catch(Ut){if(Ut?.name==="AbortError")return;ge.error("Failed to load team members.",{description:Ut?.message?String(Ut.message):"Please try again."}),q([]),G(0)}finally{B(!1)}})(),()=>D.current?.abort()),[e,ne,U,Z,W]);const rs=()=>{switch(e){case"Roles":tt(null),Le(!0);break;case"Partner":hi(!0);break;case"Group":La(!0);break;case"Team Member":ee(null),yn(!0);break}},ns=()=>{const be=e==="Team Member";return s.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[s.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[s.jsx(me,{placeholder:"Search",value:e==="Roles"?S:e==="Team Member"?J:"",onChange:ut=>{e==="Roles"&&j(ut.target.value),e==="Team Member"&&ae(ut.target.value)},style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),s.jsx("div",{className:"flex-1"}),be&&s.jsxs(s.Fragment,{children:[s.jsx(fe,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Import"}),s.jsx(fe,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Edit"})]}),s.jsx(fe,{variant:"outline",onClick:ca,className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Export (PDF)"}),s.jsx(fe,{className:"h-10 bg-blue-600 hover:bg-blue-700 text-white rounded-md px-6 font-medium shrink-0",onClick:rs,children:"New+"})]}),s.jsx("div",{className:"w-full border-b border-gray-200",children:s.jsx("div",{className:"flex overflow-x-auto w-fit",children:["Roles","Partner","Group","Team Member"].map(ut=>s.jsx("button",{onClick:()=>t(ut),style:e===ut?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Ae("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e===ut?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:ut},ut))})})]})},as=()=>{switch(e){case"Roles":return s.jsxs("div",{className:"flex flex-col",children:[s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-100",children:[s.jsx(ye,{className:"font-bold text-black border-r",children:"Role Name"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Role Code"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Status"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Order"}),s.jsx(ye,{className:"font-bold text-black text-center",children:"Actions"})]})}),s.jsx($r,{children:r.length===0?s.jsx(Fe,{children:s.jsx(de,{colSpan:5,className:"text-center text-sm text-gray-500 py-10",children:o?"Loading...":"No data"})}):r.map(be=>s.jsxs(Fe,{children:[s.jsx(de,{className:"font-medium border-r",children:be.roleName??"N/A"}),s.jsx(de,{className:"border-r text-gray-600",children:be.roleCode??"N/A"}),s.jsx(de,{className:"border-r",children:s.jsx(Or,{className:be.state?"bg-green-600":"bg-gray-400",children:be.state?"Active":"Inactive"})}),s.jsx(de,{className:"border-r text-gray-600",children:be.orderNum??"N/A"}),s.jsxs(de,{className:"text-center",children:[s.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{At(be),ft(!0)},title:"Menu Permissions",children:s.jsx(Jz,{className:"w-4 h-4 text-blue-600"})}),s.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{tt(be),Le(!0)},children:s.jsx(kn,{className:"w-4 h-4 text-gray-500"})}),s.jsx(fe,{variant:"ghost",size:"sm",onClick:async()=>{la(be),br(!0)},title:"Delete role",children:s.jsx(du,{className:"w-4 h-4 text-red-600"})})]})]},be.id))})]}),s.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 bg-white flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",a===0?0:(h-1)*m+1,"-",Math.min(h*m,a)," of ",a]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(We,{value:String(m),onValueChange:be=>v(Number(be)),children:[s.jsx(Ke,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:s.jsx(Ge,{})}),s.jsx(Xe,{children:[10,20,50].map(be=>s.jsxs(_e,{value:String(be),children:[be," / page"]},be))})]}),s.jsx(Gi,{className:"mx-0 w-auto justify-end",children:s.jsxs(Ki,{children:[s.jsx(Mt,{children:s.jsx(Xi,{href:"#",size:"default",onClick:be=>{be.preventDefault(),p(ut=>Math.max(1,ut-1))},"aria-disabled":h<=1,className:h<=1?"pointer-events-none opacity-50":""})}),s.jsx(Mt,{children:s.jsxs(Ca,{href:"#",isActive:!0,size:"default",onClick:be=>be.preventDefault(),children:["Page ",h," / ",x]})}),s.jsx(Mt,{children:s.jsx(Yi,{href:"#",size:"default",onClick:be=>{be.preventDefault(),p(ut=>Math.min(x,ut+1))},"aria-disabled":h>=x,className:h>=x?"pointer-events-none opacity-50":""})})]})})]})]})]});case"Partner":return s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-100",children:[s.jsx(ye,{className:"font-bold text-black border-r",children:"Partner Name"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Contact"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Phone"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Status"}),s.jsx(ye,{className:"font-bold text-black text-center",children:"Actions"})]})}),s.jsx($r,{children:C.map(be=>s.jsxs(Fe,{children:[s.jsx(de,{className:"font-medium border-r",children:be.name}),s.jsx(de,{className:"border-r",children:be.contact}),s.jsx(de,{className:"border-r text-gray-600",children:be.phone}),s.jsx(de,{className:"border-r",children:s.jsx(Or,{className:be.status==="active"?"bg-green-600":"bg-gray-400",children:be.status})}),s.jsx(de,{className:"text-center",children:s.jsx(fe,{variant:"ghost",size:"sm",children:s.jsx(kn,{className:"w-4 h-4 text-gray-500"})})})]},be.id))})]});case"Group":return s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-100",children:[s.jsx(ye,{className:"font-bold text-black border-r",children:"Group Name"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Parent Partner"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Status"}),s.jsx(ye,{className:"font-bold text-black text-center",children:"Actions"})]})}),s.jsx($r,{children:T.map(be=>s.jsxs(Fe,{children:[s.jsx(de,{className:"font-medium border-r",children:be.name}),s.jsx(de,{className:"border-r",children:be.partner}),s.jsx(de,{className:"border-r",children:s.jsx(Or,{className:be.status==="active"?"bg-green-600":"bg-gray-400",children:be.status})}),s.jsx(de,{className:"text-center",children:s.jsx(fe,{variant:"ghost",size:"sm",children:s.jsx(kn,{className:"w-4 h-4 text-gray-500"})})})]},be.id))})]});case"Team Member":return s.jsxs(s.Fragment,{children:[s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-100",children:[s.jsx(ye,{className:"font-bold text-black border-r",children:"Name"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Email"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Phone"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Role"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Assigned Locations"}),s.jsx(ye,{className:"font-bold text-black border-r",children:"Status"}),s.jsx(ye,{className:"font-bold text-black text-center",children:"Actions"})]})}),s.jsx($r,{children:F?s.jsx(Fe,{children:s.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):L.length===0?s.jsx(Fe,{children:s.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):L.map(be=>s.jsxs(Fe,{children:[s.jsx(de,{className:"font-medium border-r",children:be.fullName??be.userName??"N/A"}),s.jsx(de,{className:"border-r text-gray-600",children:be.email??"N/A"}),s.jsx(de,{className:"border-r text-gray-600",children:be.phone??"N/A"}),s.jsx(de,{className:"border-r",children:s.jsx(Or,{variant:"outline",className:"font-normal",children:be.roleName??be.roleId??"N/A"})}),s.jsx(de,{className:"border-r",children:s.jsxs("div",{className:"flex flex-col gap-1",children:[(be.locations?.length?be.locations:be.locationIds??[]).map(ut=>s.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-600",children:[s.jsx(Il,{className:"w-3 h-3"})," ",ut]},ut)),!be.locations?.length&&!(be.locationIds?.length??0)&&s.jsx("div",{className:"text-xs text-gray-500",children:"None"})]})}),s.jsx(de,{className:"border-r",children:s.jsx(Or,{className:be.state?"bg-green-600":"bg-gray-400",children:be.state?"Active":"Inactive"})}),s.jsx(de,{className:"text-center",children:s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{ee(be),yn(!0)},title:"Edit",children:s.jsx(kn,{className:"w-4 h-4 text-gray-500"})}),s.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{je(be),pe(!0)},title:"Delete",children:s.jsx(du,{className:"w-4 h-4 text-red-600"})})]})})]},be.id))})]}),s.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 bg-white flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",V===0?0:(U-1)*Z+1,"-",Math.min(U*Z,V)," of ",V]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(We,{value:String(Z),onValueChange:be=>k(Number(be)),children:[s.jsx(Ke,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:s.jsx(Ge,{})}),s.jsx(Xe,{children:[10,20,50].map(be=>s.jsxs(_e,{value:String(be),children:[be," / page"]},be))})]}),s.jsx(Gi,{className:"mx-0 w-auto justify-end",children:s.jsxs(Ki,{children:[s.jsx(Mt,{children:s.jsx(Xi,{href:"#",size:"default",onClick:be=>{be.preventDefault(),$(ut=>Math.max(1,ut-1))},"aria-disabled":U<=1,className:U<=1?"pointer-events-none opacity-50":""})}),s.jsx(Mt,{children:s.jsxs(Ca,{href:"#",isActive:!0,size:"default",onClick:be=>be.preventDefault(),children:["Page ",U," / ",I]})}),s.jsx(Mt,{children:s.jsx(Yi,{href:"#",size:"default",onClick:be=>{be.preventDefault(),$(ut=>Math.min(I,ut+1))},"aria-disabled":U>=I,className:U>=I?"pointer-events-none opacity-50":""})})]})})]})]})]})}};return s.jsxs("div",{className:"h-full flex flex-col",children:[ns(),s.jsx("div",{className:"flex-1 overflow-auto pt-6",children:s.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md",children:as()})}),s.jsx(Yfe,{open:Ce,role:De,onOpenChange:be=>{Le(be),be||tt(null)},onSaved:()=>{p(1),c(be=>be+1)}}),s.jsx(Jfe,{open:_t,role:Zt,onOpenChange:be=>{ft(be),be||At(null)}}),s.jsx(Qfe,{open:St,role:Ia,onOpenChange:be=>{br(be),be||la(null)},onDeleted:()=>c(be=>be+1)}),s.jsx(Zfe,{open:Ma,onOpenChange:hi}),s.jsx(ehe,{open:Da,onOpenChange:La}),s.jsx(the,{open:Br,member:Y,onOpenChange:be=>{yn(be),be||ee(null)},onSaved:()=>{$(1),H(be=>be+1)}}),s.jsx(rhe,{open:le,member:K,onOpenChange:be=>{pe(be),be||je(null)},onDeleted:()=>{H(be=>be+1)}})]})}function Yfe({open:e,role:t,onOpenChange:r,onSaved:n}){const a=!!t?.id,[i,o]=b.useState(!1),[u,d]=b.useState(""),[c,h]=b.useState(""),[p,m]=b.useState(""),[v,x]=b.useState(""),[y,S]=b.useState(!0);b.useEffect(()=>{e&&(o(!1),d(t?.roleName??""),h(t?.roleCode??""),m(t?.remark??""),x(t?.orderNum===null||t?.orderNum===void 0?"":String(t.orderNum)),S(t?.state??!0))},[e,t]);const j=b.useMemo(()=>!!(u.trim()&&c.trim()&&v.trim()),[u,c,v]),N=A=>{const C=A.trim();if(!C)return null;const O=Number.parseInt(C,10);return Number.isFinite(O)?O:null},E=async()=>{if(console.log("submit",t),!j){ge.error("Please fill in required fields.",{description:"Role Name, Role Code, and Order are required."});return}o(!0);try{const A={roleName:u.trim(),roleCode:c.trim(),remark:p.trim()?p.trim():null,state:!!y,orderNum:N(v)};a&&t?.id?(await Ife(t.id,A),ge.success("Role updated.",{description:"Role fields have been saved successfully."})):(await Rfe(A),ge.success("Role created.",{description:"A new role has been created successfully."})),r(!1),n()}catch(A){ge.error(a?"Failed to update role.":"Failed to create role.",{description:A?.message?String(A.message):"Please try again."})}finally{o(!1)}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-[600px]",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:a?"Edit Role":"Create Role"}),s.jsx(Pt,{children:a?"Update role fields and save changes.":"Fill out the form to create a new role."})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Role Name *"}),s.jsx(me,{value:u,onChange:A=>d(A.target.value),placeholder:"e.g. Inventory Specialist"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Role Code *"}),s.jsx(me,{value:c,onChange:A=>h(A.target.value),placeholder:"e.g. inventory_specialist"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Remark"}),s.jsx(me,{value:p,onChange:A=>m(A.target.value),placeholder:"Optional"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Order *"}),s.jsx(me,{value:v,onChange:A=>x(A.target.value),placeholder:"e.g. 10"})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),s.jsx(Gt,{checked:y,onCheckedChange:S})]})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{disabled:i,onClick:E,className:"bg-blue-600 text-white hover:bg-blue-700",children:i?"Saving...":"Save"})]})]})})}function Jfe({open:e,role:t,onOpenChange:r}){const n=t?.id??"",a=t?.roleName??"",[i,o]=b.useState(!1),[u,d]=b.useState([]),[c,h]=b.useState(new Set),[p,m]=b.useState(new Set),[v,x]=b.useState(!1),y=b.useRef(null),[S,j]=b.useState(""),N=b.useRef(null),[E,A]=b.useState("");b.useEffect(()=>(N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>A(S.trim()),300),()=>{N.current&&window.clearTimeout(N.current)}),[S]),b.useEffect(()=>e?(o(!1),m(new Set),h(new Set),(async()=>{y.current?.abort();const H=new AbortController;y.current=H,x(!0);try{const U=await jfe(H.signal);if(d(U??[]),n){const $=await $fe(n,H.signal);m(new Set($))}}catch(U){if(U?.name==="AbortError")return;ge.error("Failed to load menus.",{description:U?.message?String(U.message):"Please try again."}),d([]),m(new Set)}finally{x(!1)}})(),()=>y.current?.abort()):void 0,[e,n]);const C=b.useMemo(()=>{const W=H=>H.reduce((U,$)=>U+1+($.children?W($.children):0),0);return W(u)},[u]),O=b.useMemo(()=>{const W=E.trim().toLowerCase();if(!W)return u;const H=$=>{const Z=($.menuName??"").toLowerCase(),k=($.routeUrl??"").toLowerCase();return Z.includes(W)||k.includes(W)},U=$=>{const Z=[];for(const k of $){const I=k.children?U(k.children):[];(H(k)||I.length)&&Z.push({...k,children:I.length?I:void 0})}return Z};return U(u)},[u,E]);b.useEffect(()=>{if(!E.trim())return;const H=new Set,U=$=>{for(const Z of $)Z.children?.length&&H.add(Z.id),Z.children?.length&&U(Z.children)};U(O),h(H)},[E,O]);const T=W=>{const H=[],U=$=>{$.id&&H.push($.id),$.children?.length&&$.children.forEach(U)};return U(W),H},R=W=>{const H=T(W);if(!H.length)return{checked:!1,indeterminate:!1};let U=0;for(const $ of H)p.has($)&&(U+=1);return U===0?{checked:!1,indeterminate:!1}:U===H.length?{checked:!0,indeterminate:!1}:{checked:!1,indeterminate:!0}},L=(W,H)=>{m(U=>{const $=new Set(U),Z=T(W);return H?Z.forEach(k=>$.add(k)):Z.forEach(k=>$.delete(k)),$})},q=W=>{h(H=>{const U=new Set(H);return U.has(W)?U.delete(W):U.add(W),U})},F=W=>{const H=E.trim(),U=W??"";if(!H)return U||"N/A";const $=U.toLowerCase().indexOf(H.toLowerCase());if($<0)return U||"N/A";const Z=U.slice(0,$),k=U.slice($,$+H.length),I=U.slice($+H.length);return s.jsxs("span",{children:[Z,s.jsx("span",{className:"bg-yellow-200 rounded px-0.5",children:k}),I]})},B=({node:W,depth:H})=>{const U=!!W.children?.length,$=c.has(W.id),{checked:Z,indeterminate:k}=R(W);return s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 py-1",style:{paddingLeft:H*16},children:[s.jsx("button",{type:"button",className:Ae("h-6 w-6 flex items-center justify-center rounded hover:bg-gray-100",!U&&"opacity-0 pointer-events-none"),onClick:()=>U&&q(W.id),"aria-label":U?$?"Collapse":"Expand":"No children",children:U?$?s.jsx(el,{className:"h-4 w-4"}):s.jsx(tl,{className:"h-4 w-4"}):null}),s.jsx(kl,{id:`perm-menu-${W.id}`,checked:k?"indeterminate":Z,onCheckedChange:I=>L(W,!!I)}),s.jsx("label",{htmlFor:`perm-menu-${W.id}`,className:"text-sm leading-none cursor-pointer select-none",children:F(W.menuName??W.routeUrl??W.id)})]}),U&&$&&s.jsx("div",{children:W.children.map(I=>s.jsx(B,{node:I,depth:H+1},I.id))})]})},V=async()=>{if(console.log("submit",t),!!n){o(!0);try{await Pfe({roleId:n,menuIds:Array.from(p)}),ge.success("Role menu permissions saved.",{description:"Menu permissions have been updated successfully."}),r(!1)}catch(W){ge.error("Failed to save menu permissions.",{description:W?.message?String(W.message):"Please try again."})}finally{o(!1)}}},G=async()=>{if(!(!n||p.size===0)){o(!0);try{await Afe({roleId:n,menuIds:Array.from(p)}),m(new Set),ge.success("Role menu permissions cleared.",{description:"Selected permissions have been removed."})}catch(W){ge.error("Failed to delete menu permissions.",{description:W?.message?String(W.message):"Please try again."})}finally{o(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-none",style:{width:"50%"},children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Menu Permissions"}),s.jsx(Pt,{children:a?`Set menu permissions for role: ${a}`:"Set menu permissions for this role."})]}),s.jsx("div",{className:"space-y-4 py-4",children:s.jsxs("div",{className:"rounded border border-gray-200 bg-white",children:[s.jsx("div",{className:"px-3 py-2 text-xs text-gray-500 border-b border-gray-200",children:s.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[s.jsx("div",{children:v?"Loading menus...":`Total ${C} menus`}),s.jsx(me,{value:S,onChange:W=>j(W.target.value),placeholder:"Search menus",className:"h-8 w-44 bg-white"})]})}),s.jsx(al,{className:"h-72",children:s.jsxs("div",{className:"p-3 space-y-2",children:[O.map(W=>s.jsx(B,{node:W,depth:0},W.id)),!v&&O.length===0&&s.jsx("div",{className:"text-sm text-gray-500 py-6 text-center",children:"No menus."})]})})]})}),s.jsxs(wt,{className:"flex flex-row justify-end gap-2",children:[s.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{variant:"destructive",disabled:i||p.size===0||!n,onClick:G,children:"Delete Selected"}),s.jsx(fe,{disabled:i||!n,onClick:V,className:"bg-blue-600 text-white hover:bg-blue-700",children:i?"Saving...":"Save"})]})]})})}function Qfe({open:e,role:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>(t?.roleName??"").trim()||t?.roleCode||t?.id||"this role",[t]),u=async()=>{if(console.log("submit",t),!!t?.id){i(!0);try{await Lfe(t.id),ge.success("Role deleted.",{description:"The role has been removed successfully."}),r(!1),n()}catch(d){ge.error("Failed to delete role.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-none",style:{width:"30%"},children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Delete Role"}),s.jsx(Pt,{children:"This action cannot be undone."})]}),s.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",s.jsx("span",{className:"font-medium",children:o}),"?"]}),s.jsxs(wt,{className:"flex-row flex-wrap justify-end",children:[s.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function Zfe({open:e,onOpenChange:t}){return s.jsx(vt,{open:e,onOpenChange:t,children:s.jsxs(mt,{children:[s.jsx(yt,{children:s.jsx(xt,{children:"Create New Partner"})}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Partner Name"}),s.jsx(me,{placeholder:"Company Name"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Contact Email"}),s.jsx(me,{placeholder:"admin@partner.com"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Phone Number"}),s.jsx(me,{type:"tel",placeholder:"+1 (555) 000-0000"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Gt,{id:"partner-status",defaultChecked:!0}),s.jsx(ue,{htmlFor:"partner-status",children:"Active"})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(fe,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Partner"})]})]})})}function ehe({open:e,onOpenChange:t}){return s.jsx(vt,{open:e,onOpenChange:t,children:s.jsxs(mt,{children:[s.jsx(yt,{children:s.jsx(xt,{children:"Create New Group"})}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Group Name"}),s.jsx(me,{placeholder:"e.g. West Coast Region"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Assign to Partner"}),s.jsxs(We,{children:[s.jsx(Ke,{children:s.jsx(Ge,{placeholder:"Select Partner"})}),s.jsx(Xe,{children:oB.map(r=>s.jsx(_e,{value:r.id,children:r.name},r.id))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Gt,{id:"group-status",defaultChecked:!0}),s.jsx(ue,{htmlFor:"group-status",children:"Active"})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(fe,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Group"})]})]})})}function the({open:e,member:t,onOpenChange:r,onSaved:n}){const a=!!t?.id,[i,o]=b.useState(!1),[u,d]=b.useState(""),[c,h]=b.useState(""),[p,m]=b.useState(""),[v,x]=b.useState(""),[y,S]=b.useState(""),[j,N]=b.useState(""),[E,A]=b.useState(!0),[C,O]=b.useState(new Set),[T,R]=b.useState([]),[L,q]=b.useState(!1),[F,B]=b.useState([]),[V,G]=b.useState(!1),[W,H]=b.useState(""),U=b.useRef(null),$=()=>{d(""),h(""),m(""),x(""),S(""),N(""),A(!0),O(new Set)},Z=async ne=>{const X=[];let Y=1;const ee=100;for(;;){const pe=await aB({skipCount:Y,maxResultCount:ee},ne);if(X.push(...pe.items??[]),!pe.items||pe.items.length200))break}const le=new Map;for(const pe of X)pe.id&&!le.has(pe.id)&&le.set(pe.id,pe);return Array.from(le.values())},k=async ne=>{const X=[];let Y=1;const ee=200;for(;;){const pe=await Jl({skipCount:Y,maxResultCount:ee},ne);if(X.push(...pe.items??[]),!pe.items||pe.items.length200))break}const le=new Map;for(const pe of X)pe.id&&!le.has(pe.id)&&le.set(pe.id,pe);return Array.from(le.values())};b.useEffect(()=>{if(!e)return;U.current?.abort();const ne=new AbortController;return U.current=ne,o(!1),$(),q(!0),G(!0),(async()=>{try{const[Y,ee]=await Promise.all([Z(ne.signal),k(ne.signal)]);if(R(Y),B(ee),t?.id){const le=await qfe(t.id,ne.signal);d(le.fullName??""),h(le.userName??""),x(le.email??""),S(le.phone!=null?String(le.phone):"");let pe=(le.roleId??"").toString().trim();if(!pe&&le.roleName){const je=String(le.roleName).trim().toLowerCase(),Ce=Y.find(Le=>{const De=String(Le.roleName??"").trim().toLowerCase(),tt=String(Le.roleCode??"").trim().toLowerCase(),_t=String(Le.id??"").trim().toLowerCase();return De===je||tt===je||_t===je});Ce?.id&&(pe=Ce.id)}N(pe),A(!!le.state);const K=le.locationIds&&le.locationIds.length?le.locationIds:[];if(K.length)O(new Set(K));else if(le.locations?.length){const je=new Set(le.locations),Ce=new Set;for(const Le of ee){const De=`${(Le.locationCode??"").trim()} - ${(Le.locationName??"").trim()}`.trim(),tt=(Le.locationName??"").trim(),_t=(Le.locationCode??"").trim();(je.has(De)||je.has(tt)||je.has(_t))&&Ce.add(Le.id)}O(Ce)}}}catch(Y){Y?.name!=="AbortError"&&ge.error("Failed to load user form.",{description:Y?.message?String(Y.message):"Please try again."})}finally{q(!1),G(!1)}})(),()=>ne.abort()},[e,t?.id]);const I=b.useMemo(()=>!(!u.trim()||!c.trim()||!v.trim()||!String(y??"").trim()||!j.trim()||C.size===0||!a&&!p.trim()),[u,c,v,y,j,C,a,p]),D=(ne,X)=>{O(Y=>{const ee=new Set(Y);return X?ee.add(ne):ee.delete(ne),ee})},J=async ne=>{if(ne?.preventDefault(),ne?.stopPropagation(),console.log("[MemberDialog] submit called",{isEdit:a,memberId:t?.id,canSubmit:I,roleId:j,fullName:u,userName:c,selectedLocationIds:C.size}),!I){const X=[];u.trim()||X.push("Full Name"),c.trim()||X.push("User Name"),v.trim()||X.push("Email"),String(y??"").trim()||X.push("Phone"),j.trim()||X.push("Role"),C.size===0&&X.push("Locations"),!a&&!p.trim()&&X.push("Password"),ge.error("Missing required fields.",{description:`Please fill: ${X.join(", ")}.`});return}if(!a&&!t?.id){o(!0);try{const X=Array.from(C);console.log("[MemberDialog] Creating user",{fullName:u,userName:c,roleId:j,locationIds:X}),await Hfe({fullName:u.trim(),userName:c.trim(),password:p.trim(),email:v.trim(),phone:String(y).trim(),roleId:j.trim(),locationIds:X,state:E}),ge.success("User created.",{description:"A new user has been created successfully."}),r(!1),n()}catch(X){console.error("[MemberDialog] Create error",X),ge.error("Failed to create user.",{description:X?.message?String(X.message):"Please try again."})}finally{o(!1)}}else if(a&&t?.id){o(!0);try{const X=Array.from(C);console.log("[MemberDialog] Updating user",{id:t.id,fullName:u,userName:c,roleId:j,locationIds:X}),await Wfe(t.id,{fullName:u.trim(),userName:c.trim(),password:p.trim()?p.trim():null,email:v.trim(),phone:String(y).trim(),roleId:j.trim(),locationIds:X,state:E}),ge.success("User updated.",{description:"Changes have been saved successfully."}),r(!1),n()}catch(X){console.error("[MemberDialog] Update error",X),ge.error("Failed to update user.",{description:X?.message?String(X.message):"Please try again."})}finally{o(!1)}}else console.error("[MemberDialog] Invalid state",{isEdit:a,memberId:t?.id}),ge.error("Invalid form state.",{description:"Please refresh and try again."})},ae=ne=>{const X=(ne.locationCode??"").trim(),Y=(ne.locationName??"").trim();return X&&Y?`${X} - ${Y}`:Y||X||ne.id},ie=b.useMemo(()=>{const ne=W.trim().toLowerCase();return ne?F.filter(X=>ae(X).toLowerCase().includes(ne)):F},[F,W]);return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-none",style:{width:"50%"},children:[s.jsxs(yt,{children:[s.jsx(xt,{children:a?"Edit User":"New User"}),s.jsx(Pt,{children:"Role is single-select; Locations is multi-select."})]}),s.jsxs("div",{className:"space-y-4 py-4 max-h-[70vh] overflow-y-auto pr-1",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Full Name *"}),s.jsx(me,{value:u,onChange:ne=>d(ne.target.value),placeholder:"John Doe"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"User Name *"}),s.jsx(me,{value:c,onChange:ne=>h(ne.target.value),placeholder:"username"})]})]}),!a&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Password *"}),s.jsx(me,{type:"password",value:p,onChange:ne=>m(ne.target.value),placeholder:"Enter password",autoComplete:"new-password",className:"w-full"})]}),a&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Password (Optional)"}),s.jsx(me,{type:"password",value:p,onChange:ne=>m(ne.target.value),placeholder:"Enter new password (optional)",autoComplete:"new-password",className:"w-full"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Email *"}),s.jsx(me,{value:v,onChange:ne=>x(ne.target.value),placeholder:"john@example.com"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Phone *"}),s.jsx(me,{value:y,onChange:ne=>S(ne.target.value),placeholder:"+1 (555) 000-0000"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Role *"}),s.jsxs(We,{value:j||"",onValueChange:ne=>{const X=ne&&ne.trim()?ne.trim():"";console.log("[MemberDialog] Role changed",{old:j,new:X,v:ne}),N(X)},disabled:L,children:[s.jsx(Ke,{className:"h-10 rounded-md border border-gray-200 bg-white",children:s.jsx(Ge,{placeholder:L?"Loading roles...":"Select role"})}),s.jsx(Xe,{children:T.map(ne=>s.jsx(_e,{value:ne.id,children:ne.roleName??ne.roleCode??ne.id},ne.id))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Locations *"}),s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx(me,{value:W,onChange:ne=>H(ne.target.value),placeholder:"Search locations",className:"h-9"}),s.jsxs("div",{className:"text-xs text-gray-500 shrink-0",children:[C.size," selected"]})]}),s.jsx(al,{className:"h-[180px] w-full border rounded-md p-2",children:s.jsx("div",{className:"space-y-2",children:V?s.jsx("div",{className:"text-sm text-gray-500 py-2",children:"Loading..."}):ie.map(ne=>s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(kl,{id:`loc-${ne.id}`,checked:C.has(ne.id),onCheckedChange:X=>D(ne.id,!!X)}),s.jsx("label",{htmlFor:`loc-${ne.id}`,className:"text-sm cursor-pointer w-full hover:bg-gray-50 p-1 rounded",children:ae(ne)})]},ne.id))})}),s.jsx("p",{className:"text-xs text-gray-500",children:"* Users must be assigned to at least one location."})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(Gt,{id:"member-status",checked:E,onCheckedChange:A}),s.jsx(ue,{htmlFor:"member-status",children:E?"Active":"Inactive"})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{disabled:i||!I,onClick:ne=>{ne.preventDefault(),ne.stopPropagation(),J(ne)},className:"bg-blue-600 text-white hover:bg-blue-700",children:i?"Saving...":a?"Save":"Create"})]})]})})}function rhe({open:e,member:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>{const d=(t?.fullName??"").trim(),c=(t?.userName??"").trim();return d||c||"this user"},[t?.fullName,t?.userName]),u=async()=>{if(console.log("submit",t),!!t?.id){i(!0);try{await Gfe(t.id),ge.success("User deleted.",{description:"The user has been removed successfully."}),r(!1),n()}catch(d){ge.error("Failed to delete user.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-none",style:{width:"30%"},children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Delete User"}),s.jsx(Pt,{children:"This action cannot be undone."})]}),s.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",s.jsx("span",{className:"font-medium",children:o}),"?"]}),s.jsxs(wt,{className:"flex-row flex-wrap justify-end",children:[s.jsx(fe,{variant:"outline",className:"min-w-24",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{variant:"destructive",className:"min-w-24",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}const nhe=[{id:"1-251201",productName:"Whole Milk",category:"Dairy",template:'2"x2" Basic',printedAt:"2024-03-20 09:30 AM",printedBy:"Alice Johnson",location:"Downtown Store (101)",expiryDate:"2024-03-27",status:"Valid"},{id:"2-251201",productName:"Ground Beef",category:"Meat",template:'2"x2" Basic',printedAt:"2024-03-20 10:15 AM",printedBy:"Bob Smith",location:"Uptown Store (102)",expiryDate:"2024-03-23",status:"Valid"},{id:"3-251201",productName:"Croissant",category:"Bakery",template:'2"x2" Basic',printedAt:"2024-03-19 14:00 PM",printedBy:"Charlie Brown",location:"Downtown Store (101)",expiryDate:"2024-03-20",status:"Expired"},{id:"4-251201",productName:"Caesar Salad",category:"Deli",template:`2"x6" G'n'G !!!`,printedAt:"2024-03-18 11:45 AM",printedBy:"Alice Johnson",location:"Downtown Store (101)",expiryDate:"2024-03-21",status:"Expiring Soon"},{id:"5-251201",productName:"Orange Juice",category:"Beverage",template:'2"x2" Basic',printedAt:"2024-03-18 08:20 AM",printedBy:"Bob Smith",location:"Airport Kiosk (201)",expiryDate:"2024-03-25",status:"Valid"}],ahe=[{name:"Dairy",count:450},{name:"Meat",count:320},{name:"Bakery",count:280},{name:"Deli",count:190},{name:"Produce",count:150},{name:"Beverage",count:120}],ihe=[{date:"Mon",count:120},{date:"Tue",count:132},{date:"Wed",count:101},{date:"Thu",count:134},{date:"Fri",count:190},{date:"Sat",count:230},{date:"Sun",count:210}];function ohe(){const[e,t]=b.useState("print-log"),r=n=>{ge.success(`Reprinting label ${n}`,{description:"Watermark 'RePrint' applied."})};return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsxs("div",{className:"pb-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsxs(We,{defaultValue:"partner-a",children:[s.jsx(Ke,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Partner"})}),s.jsx(Xe,{children:s.jsx(_e,{value:"partner-a",children:"Partner A"})})]}),s.jsxs(We,{defaultValue:"group-b",children:[s.jsx(Ke,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Group"})}),s.jsx(Xe,{children:s.jsx(_e,{value:"group-b",children:"Group B"})})]}),s.jsxs(We,{defaultValue:"loc-12345",children:[s.jsx(Ke,{className:"w-[160px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Location"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"loc-12345",children:"Downtown Store"}),s.jsx(_e,{value:"all",children:"All Locations"})]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Period Search:"}),s.jsxs("div",{className:"flex items-center bg-white border border-gray-300 rounded-md h-10 px-2",style:{minHeight:40},children:[s.jsx(oz,{className:"w-4 h-4 text-gray-500 mr-2 shrink-0"}),s.jsx("input",{type:"date",className:"text-sm outline-none w-32 bg-transparent"}),s.jsx("span",{className:"mx-2 text-gray-400",children:"-"}),s.jsx("input",{type:"date",className:"text-sm outline-none w-32 bg-transparent"})]})]}),s.jsxs("div",{className:"flex items-center w-64 rounded-md border border-gray-300 bg-white overflow-hidden shrink-0",style:{height:40},children:[s.jsx(cm,{className:"h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none"}),s.jsx(me,{placeholder:"Search Product or Category...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full placeholder:text-gray-500"})]}),s.jsx("div",{className:"flex-1 min-w-2"}),s.jsxs(fe,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[s.jsx(LS,{className:"w-4 h-4"})," Export Report"]})]}),s.jsx("div",{className:"w-full border-b border-gray-200 mt-4",children:s.jsxs("div",{className:"flex overflow-x-auto w-fit",children:[s.jsx("button",{onClick:()=>t("print-log"),style:e==="print-log"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Ae("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e==="print-log"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:"Print Log"}),s.jsx("button",{onClick:()=>t("label-report"),style:e==="label-report"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Ae("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e==="label-report"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:"Label Report"})]})})]}),s.jsxs("div",{className:"flex-1 overflow-auto pt-6",children:[e==="print-log"&&s.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-100 hover:bg-gray-100",children:[s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Label ID"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Product Name"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Category"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Template"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Printed At"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Printed By"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Location"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Expiry Date"}),s.jsx(ye,{className:"text-gray-900 font-bold text-center",children:"Action"})]})}),s.jsx($r,{children:nhe.map(n=>s.jsxs(Fe,{children:[s.jsx(de,{className:"border-r font-numeric text-gray-600",children:n.id}),s.jsx(de,{className:"border-r font-medium",children:n.productName}),s.jsx(de,{className:"border-r",children:s.jsx(Or,{variant:"secondary",className:"bg-blue-50 text-blue-700 hover:bg-blue-50 border-blue-200",children:n.category})}),s.jsx(de,{className:"border-r text-gray-600 text-sm",children:(()=>{const a=n.template.endsWith(" !!!"),i=a?n.template.slice(0,-4):n.template,o=i.lastIndexOf(" "),u=i.slice(0,o+1),d=i.slice(o+1);return s.jsxs(s.Fragment,{children:[u,s.jsx("span",{className:"font-bold text-gray-900",children:d}),a&&s.jsx("span",{className:"text-red-600",children:" !!!"})]})})()}),s.jsx(de,{className:"border-r text-gray-600 text-sm font-numeric",children:n.printedAt}),s.jsx(de,{className:"border-r text-gray-600 text-sm",children:n.printedBy}),s.jsx(de,{className:"border-r text-gray-600 text-sm font-numeric",children:n.location}),s.jsx(de,{className:"border-r",children:s.jsx("span",{className:Ae("text-sm font-medium font-numeric",n.status==="Expired"?"text-red-600":n.status==="Expiring Soon"?"text-orange-500":"text-green-600"),children:n.expiryDate})}),s.jsx(de,{className:"text-center",children:s.jsxs(fe,{size:"sm",variant:"outline",className:"h-8 gap-1 hover:bg-gray-100 border-gray-300",onClick:()=>r(n.id),children:[s.jsx(dM,{className:"w-3 h-3"})," Reprint"]})})]},n.id))})]})}),e==="label-report"&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[s.jsxs(sn,{children:[s.jsxs(Yn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(Jn,{className:"text-sm font-medium",children:"Total Labels Printed"}),s.jsx(rl,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(An,{children:[s.jsx("div",{className:"text-2xl font-bold",children:"2,543"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"+20.1% from last month"})]})]}),s.jsxs(sn,{children:[s.jsxs(Yn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(Jn,{className:"text-sm font-medium",children:"Most Printed Category"}),s.jsx(lz,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(An,{children:[s.jsx("div",{className:"text-2xl font-bold",children:"Dairy"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"450 labels generated"})]})]}),s.jsxs(sn,{children:[s.jsxs(Yn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(Jn,{className:"text-sm font-medium",children:"Top Product"}),s.jsx(aM,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(An,{children:[s.jsx("div",{className:"text-2xl font-bold",children:"Whole Milk"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"182 labels generated"})]})]}),s.jsxs(sn,{children:[s.jsxs(Yn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(Jn,{className:"text-sm font-medium",children:"Avg. Daily Prints"}),s.jsx(Hz,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(An,{children:[s.jsx("div",{className:"text-2xl font-bold",children:"85"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"+12% from last week"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs(sn,{className:"col-span-1",children:[s.jsxs(Yn,{children:[s.jsx(Jn,{children:"Labels by Category"}),s.jsx(Jh,{children:"Distribution of printed labels across product categories."})]}),s.jsx(An,{className:"h-[300px]",children:s.jsx(cp,{width:"100%",height:"100%",children:s.jsxs(Wae,{data:ahe,children:[s.jsx(Xp,{strokeDasharray:"3 3",vertical:!1}),s.jsx(zo,{dataKey:"name",fontSize:12,tickLine:!1,axisLine:!1}),s.jsx(qo,{fontSize:12,tickLine:!1,axisLine:!1,tickFormatter:n=>`${n}`}),s.jsx(ln,{}),s.jsx(ts,{dataKey:"count",fill:"#facc15",radius:[4,4,0,0]})]})})})]}),s.jsxs(sn,{className:"col-span-1",children:[s.jsxs(Yn,{children:[s.jsx(Jn,{children:"Print Volume Trends"}),s.jsx(Jh,{children:"Daily label printing volume for the last 7 days."})]}),s.jsx(An,{className:"h-[300px]",children:s.jsx(cp,{width:"100%",height:"100%",children:s.jsxs(m4,{data:ihe,children:[s.jsx(Xp,{strokeDasharray:"3 3",vertical:!1}),s.jsx(zo,{dataKey:"date",fontSize:12,tickLine:!1,axisLine:!1}),s.jsx(qo,{fontSize:12,tickLine:!1,axisLine:!1}),s.jsx(ln,{}),s.jsx(Hl,{type:"monotone",dataKey:"count",stroke:"#dc2626",strokeWidth:2,dot:{r:4},activeDot:{r:6}})]})})})]})]}),s.jsxs(sn,{children:[s.jsx(Yn,{children:s.jsx(Jn,{children:"Most Used Products"})}),s.jsx(An,{children:s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{children:[s.jsx(ye,{children:"Product Name"}),s.jsx(ye,{children:"Category"}),s.jsx(ye,{className:"text-right",children:"Total Printed"}),s.jsx(ye,{className:"text-right",children:"Usage %"})]})}),s.jsxs($r,{children:[s.jsxs(Fe,{children:[s.jsx(de,{className:"font-medium",children:"Whole Milk"}),s.jsx(de,{children:"Dairy"}),s.jsx(de,{className:"text-right",children:"182"}),s.jsx(de,{className:"text-right",children:"7.2%"})]}),s.jsxs(Fe,{children:[s.jsx(de,{className:"font-medium",children:"Ground Beef 80/20"}),s.jsx(de,{children:"Meat"}),s.jsx(de,{className:"text-right",children:"145"}),s.jsx(de,{className:"text-right",children:"5.7%"})]}),s.jsxs(Fe,{children:[s.jsx(de,{className:"font-medium",children:"Chicken Breast"}),s.jsx(de,{children:"Meat"}),s.jsx(de,{className:"text-right",children:"132"}),s.jsx(de,{className:"text-right",children:"5.2%"})]}),s.jsxs(Fe,{children:[s.jsx(de,{className:"font-medium",children:"Sliced Ham"}),s.jsx(de,{children:"Deli"}),s.jsx(de,{className:"text-right",children:"98"}),s.jsx(de,{className:"text-right",children:"3.8%"})]})]})]})})]})]})]})]})}var she=Symbol("radix.slottable");function lhe(e){const t=({children:r})=>s.jsx(s.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=she,t}var[Og]=li("Tooltip",[Kl]),Pg=Kl(),sB="TooltipProvider",che=700,IS="tooltip.open",[uhe,b_]=Og(sB),lB=e=>{const{__scopeTooltip:t,delayDuration:r=che,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:i}=e,o=b.useRef(!0),u=b.useRef(!1),d=b.useRef(0);return b.useEffect(()=>{const c=d.current;return()=>window.clearTimeout(c)},[]),s.jsx(uhe,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:b.useCallback(()=>{window.clearTimeout(d.current),o.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:b.useCallback(c=>{u.current=c},[]),disableHoverableContent:a,children:i})};lB.displayName=sB;var Yu="Tooltip",[dhe,Cd]=Og(Yu),cB=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:u}=e,d=b_(Yu,e.__scopeTooltip),c=Pg(t),[h,p]=b.useState(null),m=Kr(),v=b.useRef(0),x=o??d.disableHoverableContent,y=u??d.delayDuration,S=b.useRef(!1),[j,N]=Vo({prop:n,defaultProp:a??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(IS))):d.onClose(),i?.(T)},caller:Yu}),E=b.useMemo(()=>j?S.current?"delayed-open":"instant-open":"closed",[j]),A=b.useCallback(()=>{window.clearTimeout(v.current),v.current=0,S.current=!1,N(!0)},[N]),C=b.useCallback(()=>{window.clearTimeout(v.current),v.current=0,N(!1)},[N]),O=b.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{S.current=!0,N(!0),v.current=0},y)},[y,N]);return b.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),s.jsx(o_,{...c,children:s.jsx(dhe,{scope:t,contentId:m,open:j,stateAttribute:E,trigger:h,onTriggerChange:p,onTriggerEnter:b.useCallback(()=>{d.isOpenDelayedRef.current?O():A()},[d.isOpenDelayedRef,O,A]),onTriggerLeave:b.useCallback(()=>{x?C():(window.clearTimeout(v.current),v.current=0)},[C,x]),onOpen:A,onClose:C,disableHoverableContent:x,children:r})})};cB.displayName=Yu;var MS="TooltipTrigger",uB=b.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=Cd(MS,r),i=b_(MS,r),o=Pg(r),u=b.useRef(null),d=it(t,u,a.onTriggerChange),c=b.useRef(!1),h=b.useRef(!1),p=b.useCallback(()=>c.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),s.jsx(eg,{asChild:!0,...o,children:s.jsx(Ye.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:d,onPointerMove:Je(e.onPointerMove,m=>{m.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Je(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Je(e.onPointerDown,()=>{a.open&&a.onClose(),c.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Je(e.onFocus,()=>{c.current||a.onOpen()}),onBlur:Je(e.onBlur,a.onClose),onClick:Je(e.onClick,a.onClose)})})});uB.displayName=MS;var w_="TooltipPortal",[fhe,hhe]=Og(w_,{forceMount:void 0}),dB=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,i=Cd(w_,t);return s.jsx(fhe,{scope:t,forceMount:r,children:s.jsx(mn,{present:r||i.open,children:s.jsx(cd,{asChild:!0,container:a,children:n})})})};dB.displayName=w_;var Rl="TooltipContent",fB=b.forwardRef((e,t)=>{const r=hhe(Rl,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...i}=e,o=Cd(Rl,e.__scopeTooltip);return s.jsx(mn,{present:n||o.open,children:o.disableHoverableContent?s.jsx(hB,{side:a,...i,ref:t}):s.jsx(phe,{side:a,...i,ref:t})})}),phe=b.forwardRef((e,t)=>{const r=Cd(Rl,e.__scopeTooltip),n=b_(Rl,e.__scopeTooltip),a=b.useRef(null),i=it(t,a),[o,u]=b.useState(null),{trigger:d,onClose:c}=r,h=a.current,{onPointerInTransitChange:p}=n,m=b.useCallback(()=>{u(null),p(!1)},[p]),v=b.useCallback((x,y)=>{const S=x.currentTarget,j={x:x.clientX,y:x.clientY},N=yhe(j,S.getBoundingClientRect()),E=xhe(j,N),A=bhe(y.getBoundingClientRect()),C=She([...E,...A]);u(C),p(!0)},[p]);return b.useEffect(()=>()=>m(),[m]),b.useEffect(()=>{if(d&&h){const x=S=>v(S,h),y=S=>v(S,d);return d.addEventListener("pointerleave",x),h.addEventListener("pointerleave",y),()=>{d.removeEventListener("pointerleave",x),h.removeEventListener("pointerleave",y)}}},[d,h,v,m]),b.useEffect(()=>{if(o){const x=y=>{const S=y.target,j={x:y.clientX,y:y.clientY},N=d?.contains(S)||h?.contains(S),E=!whe(j,o);N?m():E&&(m(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[d,h,o,c,m]),s.jsx(hB,{...e,ref:i})}),[mhe,ghe]=Og(Yu,{isInside:!1}),vhe=lhe("TooltipContent"),hB=b.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...u}=e,d=Cd(Rl,r),c=Pg(r),{onClose:h}=d;return b.useEffect(()=>(document.addEventListener(IS,h),()=>document.removeEventListener(IS,h)),[h]),b.useEffect(()=>{if(d.trigger){const p=m=>{m.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),s.jsx(sd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:s.jsxs(s_,{"data-state":d.stateAttribute,...c,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(vhe,{children:n}),s.jsx(mhe,{scope:r,isInside:!0,children:s.jsx(Joe,{id:d.contentId,role:"tooltip",children:a||n})})]})})});fB.displayName=Rl;var pB="TooltipArrow",mB=b.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=Pg(r);return ghe(pB,r).isInside?null:s.jsx(l_,{...a,...n,ref:t})});mB.displayName=pB;function yhe(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function xhe(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function bhe(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function whe(e,t){const{x:r,y:n}=e;let a=!1;for(let i=0,o=t.length-1;in!=m>n&&r<(p-c)*(n-h)/(m-h)+c&&(a=!a)}return a}function She(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),jhe(t)}function jhe(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))r.pop();else break}r.push(a)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var _he=lB,Nhe=cB,Che=uB,Ehe=dB,Ohe=fB,Phe=mB;function Ahe({delayDuration:e=0,...t}){return s.jsx(_he,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function q1({...e}){return s.jsx(Ahe,{children:s.jsx(Nhe,{"data-slot":"tooltip",...e})})}function U1({...e}){return s.jsx(Che,{"data-slot":"tooltip-trigger",...e})}function V1({className:e,sideOffset:t=0,children:r,...n}){return s.jsx(Ehe,{children:s.jsxs(Ohe,{"data-slot":"tooltip-content",sideOffset:t,className:Ae("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[r,s.jsx(Phe,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Kn(e){const t=(e??"").trim();return t||"N/A"}function The(e,t){return e==null||t===null||t===void 0||!Number.isFinite(e)||!Number.isFinite(t)?"N/A":`${e}, ${t}`}function gB(e){const t=[];e.locationCode.trim()||t.push("Location ID"),e.locationName.trim()||t.push("Location Name"),(e.street??"").trim()||t.push("Street"),(e.city??"").trim()||t.push("City"),(e.stateCode??"").trim()||t.push("State"),(e.country??"").trim()||t.push("Country"),(e.zipCode??"").trim()||t.push("Zip Code"),(e.phone??"").trim()||t.push("Phone Number"),(e.email??"").trim()||t.push("Email");const r=e.latitude,n=e.longitude;return(r==null||!Number.isFinite(r))&&t.push("Latitude"),(n==null||!Number.isFinite(n))&&t.push("Longitude"),t}function khe(){const[e,t]=b.useState(!1),[r,n]=b.useState(!1),[a,i]=b.useState(!1),[o,u]=b.useState(null),[d,c]=b.useState(null),[h,p]=b.useState([]),[m,v]=b.useState(!1),[x,y]=b.useState(0),[S,j]=b.useState(0),[N,E]=b.useState(null),[A,C]=b.useState(""),[O,T]=b.useState("all"),[R,L]=b.useState("all"),[q,F]=b.useState("all"),[B,V]=b.useState(1),[G,W]=b.useState(10),H=b.useRef(null),U=b.useRef(null),[$,Z]=b.useState("");b.useEffect(()=>(U.current&&window.clearTimeout(U.current),U.current=window.setTimeout(()=>Z(A.trim()),300),()=>{U.current&&window.clearTimeout(U.current)}),[A]);const k=b.useMemo(()=>{const X=new Set;for(const Y of h){const ee=(Y.partner??"").trim();ee&&X.add(ee)}return["all",...Array.from(X).sort((Y,ee)=>Y.localeCompare(ee))]},[h]),I=b.useMemo(()=>{const X=new Set;for(const Y of h){const ee=(Y.groupName??"").trim();ee&&X.add(ee)}return["all",...Array.from(X).sort((Y,ee)=>Y.localeCompare(ee))]},[h]),D=b.useMemo(()=>{const X=new Set;for(const Y of h){const ee=(Y.locationCode??"").trim();ee&&X.add(ee)}return["all",...Array.from(X).sort((Y,ee)=>Y.localeCompare(ee))]},[h]),J=Math.max(1,Math.ceil(x/G));b.useEffect(()=>{V(1)},[$,O,R,q,G]),b.useEffect(()=>((async()=>{H.current?.abort();const Y=new AbortController;H.current=Y,v(!0);try{const ee=Math.max(1,B),pe=await Jl({skipCount:ee,maxResultCount:G,keyword:(q!=="all"?q:$)||void 0,partner:O!=="all"?O:void 0,groupName:R!=="all"?R:void 0},Y.signal);p(pe.items??[]),y(pe.totalCount??0)}catch(ee){if(ee?.name==="AbortError")return;ge.error("Failed to load locations.",{description:ee?.message?String(ee.message):"Please try again."}),p([]),y(0)}finally{v(!1)}})(),()=>H.current?.abort()),[$,O,R,q,B,G,S]);const ae=()=>j(X=>X+1),ie=X=>{E(null),u(X),n(!0)},ne=X=>{E(null),c(X),i(!0)};return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{className:"pb-4",children:s.jsx("div",{className:"flex flex-col gap-4",children:s.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[s.jsx(me,{placeholder:"Search",value:A,onChange:X=>C(X.target.value),style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),s.jsxs(We,{value:O,onValueChange:T,children:[s.jsx(Ke,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Partner"})}),s.jsx(Xe,{children:k.map(X=>s.jsx(_e,{value:X,children:X==="all"?"Partner (All)":X},X))})]}),s.jsxs(We,{value:R,onValueChange:L,children:[s.jsx(Ke,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Group"})}),s.jsx(Xe,{children:I.map(X=>s.jsx(_e,{value:X,children:X==="all"?"Group (All)":X},X))})]}),s.jsxs(We,{value:q,onValueChange:F,children:[s.jsx(Ke,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:s.jsx(Ge,{placeholder:"Location"})}),s.jsx(Xe,{children:D.map(X=>s.jsx(_e,{value:X,children:X==="all"?"All Locations":X},X))})]}),s.jsx("div",{className:"flex-1"}),s.jsxs(q1,{children:[s.jsx(U1,{asChild:!0,children:s.jsx("span",{children:s.jsx(fe,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Import"})})}),s.jsx(V1,{children:"Not supported yet"})]}),s.jsxs(q1,{children:[s.jsx(U1,{asChild:!0,children:s.jsx("span",{children:s.jsx(fe,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Export"})})}),s.jsx(V1,{children:"Not supported yet"})]}),s.jsxs(q1,{children:[s.jsx(U1,{asChild:!0,children:s.jsx("span",{children:s.jsx(fe,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Edit"})})}),s.jsx(V1,{children:"Not supported yet"})]}),s.jsx(fe,{className:"h-10 bg-blue-600 hover:bg-blue-700 text-white rounded-md px-6 font-medium shrink-0",onClick:()=>t(!0),children:"New"})]})})}),s.jsx("div",{className:"flex-1 overflow-auto pt-6",children:s.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:s.jsxs(Dr,{children:[s.jsx(Lr,{children:s.jsxs(Fe,{className:"bg-gray-100 hover:bg-gray-100",children:[s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Partner"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Group"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Location ID"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Location Name"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Street"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"City"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"State"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Country"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Zip Code"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Phone"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Email"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"GPS"}),s.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Active"}),s.jsx(ye,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),s.jsx($r,{children:m?s.jsx(Fe,{children:s.jsx(de,{colSpan:14,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):h.length===0?s.jsx(Fe,{children:s.jsx(de,{colSpan:14,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):h.map(X=>s.jsxs(Fe,{children:[s.jsx(de,{className:"border-r text-gray-600 max-w-[140px] truncate",children:Kn(X.partner)}),s.jsx(de,{className:"border-r text-gray-600 max-w-[140px] truncate",children:Kn(X.groupName)}),s.jsx(de,{className:"border-r font-numeric text-gray-600",children:Kn(X.locationCode??X.id)}),s.jsx(de,{className:"border-r font-medium text-black",children:Kn(X.locationName)}),s.jsx(de,{className:"border-r text-gray-600 max-w-[140px] truncate",children:Kn(X.street)}),s.jsx(de,{className:"border-r text-gray-600",children:Kn(X.city)}),s.jsx(de,{className:"border-r text-gray-600",children:Kn(X.stateCode)}),s.jsx(de,{className:"border-r text-gray-600",children:Kn(X.country)}),s.jsx(de,{className:"border-r text-gray-600 font-numeric",children:Kn(X.zipCode)}),s.jsx(de,{className:"border-r text-gray-600 whitespace-nowrap",children:Kn(X.phone)}),s.jsx(de,{className:"border-r text-gray-600 text-sm max-w-[180px] truncate",children:Kn(X.email)}),s.jsx(de,{className:"border-r text-gray-500 font-numeric text-xs",children:The(X.latitude,X.longitude)}),s.jsx(de,{className:"border-r",children:s.jsx(Or,{className:X.state?"bg-green-600":"bg-gray-400",children:X.state?"Yes":"No"})}),s.jsx(de,{className:"text-center",children:s.jsxs(Ta,{open:N===X.id,onOpenChange:Y=>E(Y?X.id:null),children:[s.jsx(ka,{asChild:!0,children:s.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:s.jsx(Ji,{className:"h-4 w-4 text-gray-500"})})}),s.jsxs(Ra,{align:"end",className:"w-40 p-1",children:[s.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>ie(X),children:[s.jsx(kn,{className:"w-4 h-4"}),"Edit"]}),s.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>ne(X),children:"Delete"})]})]})})]},X.id))})]})})}),s.jsx("div",{className:"pt-4",children:s.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[s.jsxs("div",{children:["Showing ",x===0?0:(B-1)*G+1,"-",Math.min(B*G,x)," of ",x]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(We,{value:String(G),onValueChange:X=>W(Number(X)),children:[s.jsx(Ke,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:s.jsx(Ge,{})}),s.jsx(Xe,{children:[10,20,50].map(X=>s.jsxs(_e,{value:String(X),children:[X," / page"]},X))})]}),s.jsx(Gi,{className:"mx-0 w-auto justify-end",children:s.jsxs(Ki,{children:[s.jsx(Mt,{children:s.jsx(Xi,{href:"#",size:"default",onClick:X=>{X.preventDefault(),V(Y=>Math.max(1,Y-1))},"aria-disabled":B<=1,className:B<=1?"pointer-events-none opacity-50":""})}),s.jsx(Mt,{children:s.jsxs(Ca,{href:"#",isActive:!0,size:"default",onClick:X=>X.preventDefault(),children:["Page ",B," / ",J]})}),s.jsx(Mt,{children:s.jsx(Yi,{href:"#",size:"default",onClick:X=>{X.preventDefault(),V(Y=>Math.min(J,Y+1))},"aria-disabled":B>=J,className:B>=J?"pointer-events-none opacity-50":""})})]})})]})]})}),s.jsx(Rhe,{open:e,onOpenChange:t,onCreated:()=>{V(1),ae()}}),s.jsx(Mhe,{open:r,location:o,onOpenChange:X=>{n(X),X||u(null)},onUpdated:()=>{ae()}}),s.jsx(Dhe,{open:a,location:d,onOpenChange:X=>{i(X),X||c(null)},onDeleted:()=>{ae()}})]})}function Rhe({open:e,onOpenChange:t,onCreated:r}){const[n,a]=b.useState(!1),[i,o]=b.useState({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0}),u=()=>{o({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0})};b.useEffect(()=>{e||(u(),a(!1))},[e]);const d=async()=>{const c=gB(i);if(c.length){ge.error("Please fill in required fields.",{description:`Missing: ${c.join(", ")}.`});return}a(!0);try{await Zce({...i,locationCode:i.locationCode.trim(),locationName:i.locationName.trim(),partner:i.partner?.trim()?i.partner.trim():null,groupName:i.groupName?.trim()?i.groupName.trim():null,street:(i.street??"").trim(),city:(i.city??"").trim(),stateCode:(i.stateCode??"").trim(),country:(i.country??"").trim(),zipCode:(i.zipCode??"").trim(),phone:(i.phone??"").trim(),email:(i.email??"").trim(),latitude:i.latitude,longitude:i.longitude}),ge.success("Location created.",{description:"The location has been added successfully."}),t(!1),r()}catch(h){ge.error("Failed to create location.",{description:h?.message?String(h.message):"Please try again."})}finally{a(!1)}};return s.jsx(vt,{open:e,onOpenChange:t,children:s.jsxs(mt,{className:"sm:max-w-[600px]",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Add New Location"}),s.jsx(Pt,{children:"Enter the details for the new store location."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Partner"}),s.jsx(me,{placeholder:"e.g. Global Foods Inc.",value:i.partner??"",onChange:c=>o(h=>({...h,partner:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Group"}),s.jsx(me,{placeholder:"e.g. East Coast Region",value:i.groupName??"",onChange:c=>o(h=>({...h,groupName:c.target.value}))})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"space-y-2 col-span-1",children:[s.jsx(ue,{children:"Location ID *"}),s.jsx(me,{placeholder:"e.g. 12345",value:i.locationCode,onChange:c=>o(h=>({...h,locationCode:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2 col-span-2",children:[s.jsx(ue,{children:"Location Name *"}),s.jsx(me,{placeholder:"e.g. Downtown Store",value:i.locationName,onChange:c=>o(h=>({...h,locationName:c.target.value}))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Street *"}),s.jsx(me,{placeholder:"e.g. 123 Main St",value:i.street??"",onChange:c=>o(h=>({...h,street:c.target.value}))})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"City *"}),s.jsx(me,{placeholder:"e.g. New York",value:i.city??"",onChange:c=>o(h=>({...h,city:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"State *"}),s.jsx(me,{placeholder:"e.g. NY",value:i.stateCode??"",onChange:c=>o(h=>({...h,stateCode:c.target.value}))})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Country *"}),s.jsx(me,{placeholder:"e.g. USA",value:i.country??"",onChange:c=>o(h=>({...h,country:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Zip Code *"}),s.jsx(me,{placeholder:"e.g. 10001",value:i.zipCode??"",onChange:c=>o(h=>({...h,zipCode:c.target.value}))})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Phone Number *"}),s.jsx(me,{placeholder:"+1 (555) 000-0000",value:i.phone??"",onChange:c=>o(h=>({...h,phone:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Email *"}),s.jsx(me,{placeholder:"store@example.com",value:i.email??"",onChange:c=>o(h=>({...h,email:c.target.value}))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(ue,{className:"flex items-center gap-2",children:[s.jsx(Il,{className:"w-4 h-4"})," GPS Coordinates *"]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(me,{placeholder:"Latitude (e.g. 40.7128)",value:i.latitude===null||i.latitude===void 0?"":String(i.latitude),onChange:c=>{const h=c.target.value.trim();o(p=>({...p,latitude:h?Number(h):null}))}}),s.jsx(me,{placeholder:"Longitude (e.g. -74.0060)",value:i.longitude===null||i.longitude===void 0?"":String(i.longitude),onChange:c=>{const h=c.target.value.trim();o(p=>({...p,longitude:h?Number(h):null}))}})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(Gt,{id:"loc-status",checked:!!i.state,onCheckedChange:c=>o(h=>({...h,state:c}))}),s.jsx(ue,{htmlFor:"loc-status",children:"Active Location"})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(fe,{disabled:n,onClick:d,className:"bg-blue-600 text-white hover:bg-blue-700",children:n?"Creating...":"Create Location"})]})]})})}function Ihe(e){return{partner:e.partner??"",groupName:e.groupName??"",locationCode:e.locationCode??"",locationName:e.locationName??"",street:e.street??"",city:e.city??"",stateCode:e.stateCode??"",country:e.country??"",zipCode:e.zipCode??"",phone:e.phone??"",email:e.email??"",latitude:e.latitude??null,longitude:e.longitude??null,state:!!e.state}}function Mhe({open:e,location:t,onOpenChange:r,onUpdated:n}){const[a,i]=b.useState(!1),[o,u]=b.useState({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0});b.useEffect(()=>{e&&t&&(u(Ihe(t)),i(!1)),e||i(!1)},[e,t]);const d=async()=>{if(!t?.id)return;const c=gB(o);if(c.length){ge.error("Please fill in required fields.",{description:`Missing: ${c.join(", ")}.`});return}i(!0);try{await eue(t.id,{...o,locationCode:o.locationCode.trim(),locationName:o.locationName.trim(),partner:o.partner?.trim()?o.partner.trim():null,groupName:o.groupName?.trim()?o.groupName.trim():null,street:(o.street??"").trim(),city:(o.city??"").trim(),stateCode:(o.stateCode??"").trim(),country:(o.country??"").trim(),zipCode:(o.zipCode??"").trim(),phone:(o.phone??"").trim(),email:(o.email??"").trim(),latitude:o.latitude,longitude:o.longitude}),ge.success("Location updated.",{description:"The changes have been saved successfully."}),r(!1),n()}catch(h){ge.error("Failed to update location.",{description:h?.message?String(h.message):"Please try again."})}finally{i(!1)}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-[600px]",children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Edit Location"}),s.jsx(Pt,{children:"Update the details for this store location."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Partner"}),s.jsx(me,{placeholder:"e.g. Global Foods Inc.",value:o.partner??"",onChange:c=>u(h=>({...h,partner:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Group"}),s.jsx(me,{placeholder:"e.g. East Coast Region",value:o.groupName??"",onChange:c=>u(h=>({...h,groupName:c.target.value}))})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"space-y-2 col-span-1",children:[s.jsx(ue,{children:"Location ID *"}),s.jsx(me,{placeholder:"e.g. 12345",value:o.locationCode,onChange:c=>u(h=>({...h,locationCode:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2 col-span-2",children:[s.jsx(ue,{children:"Location Name *"}),s.jsx(me,{placeholder:"e.g. Downtown Store",value:o.locationName,onChange:c=>u(h=>({...h,locationName:c.target.value}))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Street *"}),s.jsx(me,{placeholder:"e.g. 123 Main St",value:o.street??"",onChange:c=>u(h=>({...h,street:c.target.value}))})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"City *"}),s.jsx(me,{placeholder:"e.g. New York",value:o.city??"",onChange:c=>u(h=>({...h,city:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"State *"}),s.jsx(me,{placeholder:"e.g. NY",value:o.stateCode??"",onChange:c=>u(h=>({...h,stateCode:c.target.value}))})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Country *"}),s.jsx(me,{placeholder:"e.g. USA",value:o.country??"",onChange:c=>u(h=>({...h,country:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Zip Code *"}),s.jsx(me,{placeholder:"e.g. 10001",value:o.zipCode??"",onChange:c=>u(h=>({...h,zipCode:c.target.value}))})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Phone Number *"}),s.jsx(me,{placeholder:"+1 (555) 000-0000",value:o.phone??"",onChange:c=>u(h=>({...h,phone:c.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Email *"}),s.jsx(me,{placeholder:"store@example.com",value:o.email??"",onChange:c=>u(h=>({...h,email:c.target.value}))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(ue,{className:"flex items-center gap-2",children:[s.jsx(Il,{className:"w-4 h-4"})," GPS Coordinates *"]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(me,{placeholder:"Latitude (e.g. 40.7128)",value:o.latitude===null||o.latitude===void 0?"":String(o.latitude),onChange:c=>{const h=c.target.value.trim();u(p=>({...p,latitude:h?Number(h):null}))}}),s.jsx(me,{placeholder:"Longitude (e.g. -74.0060)",value:o.longitude===null||o.longitude===void 0?"":String(o.longitude),onChange:c=>{const h=c.target.value.trim();u(p=>({...p,longitude:h?Number(h):null}))}})]})]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(Gt,{id:"loc-status-edit",checked:!!o.state,onCheckedChange:c=>u(h=>({...h,state:c}))}),s.jsx(ue,{htmlFor:"loc-status-edit",children:"Active Location"})]})]}),s.jsxs(wt,{children:[s.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{disabled:a,onClick:d,className:"bg-blue-600 text-white hover:bg-blue-700",children:a?"Saving...":"Save Changes"})]})]})})}function Dhe({open:e,location:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>{const d=(t?.locationCode??"").trim(),c=(t?.locationName??"").trim();return d&&c?`${d} - ${c}`:d||c||"this location"},[t?.locationCode,t?.locationName]),u=async()=>{if(t?.id){i(!0);try{await tue(t.id),ge.success("Location deleted.",{description:"The location has been removed successfully."}),r(!1),n()}catch(d){ge.error("Failed to delete location.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-none",style:{width:"30%"},children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Delete Location"}),s.jsx(Pt,{children:"This action cannot be undone."})]}),s.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",s.jsx("span",{className:"font-medium",children:o}),"?"]}),s.jsxs(wt,{className:"flex-row flex-wrap justify-end",children:[s.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function Lhe({className:e,...t}){return s.jsx("textarea",{"data-slot":"textarea",className:Ae("resize-none border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-input-background px-3 py-2 text-base transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const ZI={Settings:Hh,LayoutDashboard:uM,Tag:Wh,MapPin:Il,Users:$S,Package:uu,FileText:rl,HelpCircle:Vh,Layers:cM,Type:fM,FileBox:lM};function H1(e){const t=(e??"").trim();return t||"N/A"}function $he(e){const t=e.trim();if(!t)return null;const r=Number.parseInt(t,10);return Number.isFinite(r)?r:null}function Bhe(){const[e,t]=b.useState([]),[r,n]=b.useState(!1),[a,i]=b.useState(0),[o,u]=b.useState(null),[d,c]=b.useState(""),h=b.useRef(null),[p,m]=b.useState(""),[v,x]=b.useState(!1),[y,S]=b.useState(!1),[j,N]=b.useState(!1),[E,A]=b.useState(null),[C,O]=b.useState(null),T=b.useRef(null);b.useEffect(()=>(h.current&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>m(d.trim()),300),()=>{h.current&&window.clearTimeout(h.current)}),[d]),b.useEffect(()=>((async()=>{T.current?.abort();const B=new AbortController;T.current=B,n(!0);try{const V=await tB({skipCount:1,maxResultCount:5e3,keyword:p||void 0},B.signal);t(V.items??[])}catch(V){if(V?.name==="AbortError")return;ge.error("Failed to load system menus.",{description:V?.message?String(V.message):"Please try again."}),t([])}finally{n(!1)}})(),()=>T.current?.abort()),[p,a]);const R=()=>i(F=>F+1),L=F=>{u(null),A(F),S(!0)},q=F=>{u(null),O(F),N(!0)};return s.jsxs("div",{className:"h-full flex flex-col",children:[s.jsx("div",{className:"pb-4",children:s.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[s.jsx(me,{placeholder:"Search",value:d,onChange:F=>c(F.target.value),style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),s.jsx("div",{className:"flex-1"}),s.jsxs(fe,{className:"bg-blue-600 text-white hover:bg-blue-700",onClick:()=>x(!0),children:[s.jsx(In,{className:"w-4 h-4 mr-2"}),"New Menu"]})]})}),s.jsx("div",{className:"flex-1 flex flex-col min-h-0 bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden",children:s.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:s.jsxs(Dr,{children:[s.jsx(Lr,{className:"bg-gray-50 sticky top-0 z-10",children:s.jsxs(Fe,{className:"hover:bg-gray-50",children:[s.jsx(ye,{className:"font-semibold text-gray-900",children:"Menu Name"}),s.jsx(ye,{className:"font-semibold text-gray-900",children:"Route URL"}),s.jsx(ye,{className:"font-semibold text-gray-900",children:"Router Name"}),s.jsx(ye,{className:"font-semibold text-gray-900",children:"Type"}),s.jsx(ye,{className:"font-semibold text-gray-900",children:"Order"}),s.jsx(ye,{className:"font-semibold text-gray-900",children:"Visible"}),s.jsx(ye,{className:"font-semibold text-gray-900",children:"Enabled"}),s.jsx(ye,{className:"font-semibold text-gray-900 w-16 text-right",children:"Actions"})]})}),s.jsx($r,{children:e.length===0?s.jsx(Fe,{children:s.jsx(de,{colSpan:8,className:"text-center py-10 text-gray-500",children:r?"Loading...":"No data"})}):e.map(F=>s.jsxs(Fe,{className:"hover:bg-gray-50",children:[s.jsx(de,{className:"font-medium text-gray-900",children:H1(F.menuName)}),s.jsx(de,{className:"text-gray-700",children:H1(F.routeUrl)}),s.jsx(de,{className:"text-gray-700",children:H1(F.routerName)}),s.jsx(de,{className:"text-gray-700",children:F.menuType??"N/A"}),s.jsx(de,{className:"text-gray-700",children:F.orderNum??"N/A"}),s.jsx(de,{className:"text-gray-700",children:F.isShow?"Yes":"No"}),s.jsx(de,{className:"text-gray-700",children:F.state?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsxs(Ta,{open:o===F.id,onOpenChange:B=>u(B?F.id:null),children:[s.jsx(ka,{asChild:!0,children:s.jsx(fe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:s.jsx(Ji,{className:"h-4 w-4"})})}),s.jsx(Ra,{className:"w-44 p-2",align:"end",children:s.jsxs("div",{className:"flex flex-col",children:[s.jsxs(fe,{variant:"ghost",className:"justify-start",onClick:()=>L(F),children:[s.jsx(kn,{className:"w-4 h-4 mr-2"}),"Edit"]}),s.jsxs(fe,{variant:"ghost",className:"justify-start text-red-600 hover:text-red-700",onClick:()=>q(F),children:[s.jsx(du,{className:"w-4 h-4 mr-2"}),"Delete"]})]})})]})})]},F.id))})]})})}),s.jsx(eM,{mode:"create",open:v,menu:null,onOpenChange:x,onSaved:R}),s.jsx(eM,{mode:"edit",open:y,menu:E,onOpenChange:S,onSaved:R}),s.jsx(Fhe,{open:j,menu:C,onOpenChange:N,onDeleted:R})]})}function eM({mode:e,open:t,menu:r,onOpenChange:n,onSaved:a}){const i=e==="edit",[o,u]=b.useState(!1),[d,c]=b.useState(""),[h,p]=b.useState(""),[m,v]=b.useState(""),[x,y]=b.useState("menu"),[S,j]=b.useState(""),[N,E]=b.useState(""),[A,C]=b.useState([]),[O,T]=b.useState(!1),[R,L]=b.useState(""),[q,F]=b.useState(""),[B,V]=b.useState(""),[G,W]=b.useState(""),[H,U]=b.useState(""),[$,Z]=b.useState(""),[k,I]=b.useState(!1),[D,J]=b.useState(!0),[ae,ie]=b.useState(!0);b.useEffect(()=>{if(!t)return;u(!1),c(r?.menuName??""),p(r?.routerName??""),v(r?.routeUrl??""),y(r?.menuType===0?"directory":"menu"),j(r?.permissionCode??"");const K=String(r?.parentId??"").trim();E(!K||K==="00000000-0000-0000-0000-000000000000"?"":K),L(r?.menuIcon??""),F(r?.orderNum===null||r?.orderNum===void 0?"":String(r.orderNum)),V(r?.link??""),W(r?.component??""),U(r?.query??""),Z(r?.remark??""),I(!!r?.isCache),J(r?.isShow??!0),ie(r?.state??!0)},[t,r]);const ne="__parent_root__";b.useEffect(()=>{if(!t)return;let K=!1;return T(!0),_fe().then(je=>{K||C(je)}).catch(()=>{K||C([])}).finally(()=>{K||T(!1)}),()=>{K=!0}},[t]);const X=K=>!K.trim()||K==="00000000-0000-0000-0000-000000000000",Y=b.useMemo(()=>{const K=A.filter(Ce=>Ce.id&&Ce.id!==r?.id),je=(N||"").trim();return je&&!X(je)&&!K.some(Ce=>Ce.id===je)?[...K,{id:je,menuName:`(Current parent) ${je}`}]:K},[A,N,r?.id]),ee=X(N)?ne:N,le=b.useMemo(()=>!!(d.trim()&&m.trim()&&q.trim()),[d,m,q]),pe=async()=>{if(!le){ge.error("Please fill in required fields.",{description:"Menu Name, Route URL, and Order are required."});return}u(!0);try{const K={menuName:d.trim(),routerName:h.trim()?h.trim():null,routeUrl:m.trim(),menuType:x==="directory"?0:1,permissionCode:S.trim()?S.trim():null,parentId:X(N)?null:N.trim(),menuIcon:R||null,orderNum:$he(q),link:B.trim()?B.trim():null,component:G.trim()?G.trim():null,query:H.trim()?H.trim():null,remark:$.trim()?$.trim():null,isCache:k,isShow:D,state:ae};if(i){if(!r?.id)throw new Error("Missing id.");await Cfe(r.id,K),ge.success("Menu updated.",{description:"Changes have been saved successfully."})}else await Nfe(K),ge.success("Menu created.",{description:"A new menu has been created successfully."});n(!1),a()}catch(K){ge.error(i?"Failed to update menu.":"Failed to create menu.",{description:K?.message?String(K.message):"Please try again."})}finally{u(!1)}};return s.jsx(vt,{open:t,onOpenChange:n,children:s.jsxs(mt,{className:"sm:max-w-none",style:{width:"70%"},children:[s.jsxs(yt,{children:[s.jsx(xt,{children:i?"Edit System Menu":"New System Menu"}),s.jsx(Pt,{children:i?"Update system menu fields and save changes.":"Fill out the form to create a new system menu."})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-6 py-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Menu Name *"}),s.jsx(me,{value:d,onChange:K=>c(K.target.value),placeholder:"e.g. Location Manager"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Route URL *"}),s.jsx(me,{value:m,onChange:K=>v(K.target.value),placeholder:"e.g. /location"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Router Name"}),s.jsx(me,{value:h,onChange:K=>p(K.target.value),placeholder:"e.g. location"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Menu Type"}),s.jsxs(We,{value:x,onValueChange:K=>y(K),children:[s.jsx(Ke,{className:"h-10 rounded-md border border-gray-200 bg-white",children:s.jsx(Ge,{})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"directory",children:"Directory"}),s.jsx(_e,{value:"menu",children:"Menu"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Permission Code"}),s.jsx(me,{value:S,onChange:K=>j(K.target.value),placeholder:"e.g. sys:menu"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Parent"}),s.jsxs(We,{value:ee,disabled:O,onValueChange:K=>E(K===ne?"":K),children:[s.jsx(Ke,{className:"h-10 rounded-md border border-gray-200 bg-white",children:s.jsx(Ge,{placeholder:O?"Loading…":"Select parent directory"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:ne,children:"Root (no parent)"}),Y.map(K=>s.jsx(_e,{value:K.id,children:K.menuName?.trim()||K.id},K.id))]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Menu Icon"}),s.jsxs(We,{value:R||"none",onValueChange:K=>L(K==="none"?"":K),children:[s.jsx(Ke,{className:"h-10 rounded-md border border-gray-200 bg-white",children:s.jsx(Ge,{placeholder:"Select an icon"})}),s.jsxs(Xe,{children:[s.jsx(_e,{value:"none",children:"None"}),Object.keys(ZI).map(K=>{const je=ZI[K];return s.jsx(_e,{value:K,children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(je,{className:"h-4 w-4"}),K]})},K)})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Order *"}),s.jsx(me,{value:q,onChange:K=>F(K.target.value),placeholder:"e.g. 10"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Link"}),s.jsx(me,{value:B,onChange:K=>V(K.target.value),placeholder:"Optional"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Component"}),s.jsx(me,{value:G,onChange:K=>W(K.target.value),placeholder:"Optional"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Query"}),s.jsx(me,{value:H,onChange:K=>U(K.target.value),placeholder:"Optional"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(ue,{children:"Remark"}),s.jsx(Lhe,{value:$,onChange:K=>Z(K.target.value),placeholder:"Optional"})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Cache"}),s.jsx(Gt,{checked:k,onCheckedChange:I})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Visible"}),s.jsx(Gt,{checked:D,onCheckedChange:J})]}),s.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[s.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),s.jsx(Gt,{checked:ae,onCheckedChange:ie})]})]}),s.jsxs(wt,{className:"flex-row flex-wrap justify-end",children:[s.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),s.jsx(fe,{className:"min-w-24 bg-blue-600 text-white hover:bg-blue-700",disabled:o,onClick:pe,children:o?"Saving...":i?"Save Changes":"Create"})]})]})})}function Fhe({open:e,menu:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>{const d=(t?.menuName??"").trim(),c=(t?.routeUrl??"").trim();return d&&c?`${d} (${c})`:d||c||"this menu"},[t?.menuName,t?.routeUrl]),u=async()=>{if(t?.id){i(!0);try{await Ofe(t.id),ge.success("Menu deleted.",{description:"The menu has been removed successfully."}),r(!1),n()}catch(d){ge.error("Failed to delete menu.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return s.jsx(vt,{open:e,onOpenChange:r,children:s.jsxs(mt,{className:"sm:max-w-none",style:{width:"30%"},children:[s.jsxs(yt,{children:[s.jsx(xt,{children:"Delete System Menu"}),s.jsx(Pt,{children:"This action cannot be undone."})]}),s.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",s.jsx("span",{className:"font-medium",children:o}),"?"]}),s.jsxs(wt,{className:"flex-row flex-wrap justify-end",children:[s.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),s.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function zhe(){const[e,t]=b.useState("Dashboard"),r=()=>{switch(e){case"Dashboard":return s.jsx(Yae,{});case"Training":return s.jsx(sfe,{});case"Alerts":return s.jsx(ufe,{});case"Menu Management":return s.jsx(gfe,{});case"System Menu":return s.jsx(Bhe,{});case"Account Management":return s.jsx(Xfe,{});case"Reports":return s.jsx(ohe,{});case"Location Manager":return s.jsx(khe,{});case"Labels":case"Label Categories":case"Label Types":case"Label Templates":case"Multiple Options":return s.jsx(ofe,{currentView:e,onViewChange:t});default:return s.jsx(Jae,{title:e})}};return s.jsxs(s.Fragment,{children:[s.jsx(cU,{currentView:e,setCurrentView:t,children:r()}),s.jsx(H8,{position:"top-center",richColors:!0,closeButton:!0,expand:!1})]})}y8.createRoot(document.getElementById("root")).render(s.jsx(zhe,{})); diff --git a/美国版/Food Labeling Management Platform/build/assets/index-DKXCW1Pt.css b/美国版/Food Labeling Management Platform/build/assets/index-Dc47WtG1.css index 97e5745..3b83967 100644 --- a/美国版/Food Labeling Management Platform/build/assets/index-DKXCW1Pt.css +++ b/美国版/Food Labeling Management Platform/build/assets/index-Dc47WtG1.css @@ -1 +1 @@ -/*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0;--tw-rotate-x: rotateX(0);--tw-rotate-y: rotateY(0);--tw-rotate-z: rotateZ(0);--tw-skew-x: skewX(0);--tw-skew-y: skewY(0);--tw-space-y-reverse: 0;--tw-space-x-reverse: 0;--tw-border-style: solid;--tw-gradient-position: initial;--tw-gradient-from: #0000;--tw-gradient-via: #0000;--tw-gradient-to: #0000;--tw-gradient-stops: initial;--tw-gradient-via-stops: initial;--tw-gradient-from-position: 0%;--tw-gradient-via-position: 50%;--tw-gradient-to-position: 100%;--tw-leading: initial;--tw-font-weight: initial;--tw-tracking: initial;--tw-ordinal: initial;--tw-slashed-zero: initial;--tw-numeric-figure: initial;--tw-numeric-spacing: initial;--tw-numeric-fraction: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-outline-style: solid;--tw-backdrop-blur: initial;--tw-backdrop-brightness: initial;--tw-backdrop-contrast: initial;--tw-backdrop-grayscale: initial;--tw-backdrop-hue-rotate: initial;--tw-backdrop-invert: initial;--tw-backdrop-opacity: initial;--tw-backdrop-saturate: initial;--tw-backdrop-sepia: initial;--tw-duration: initial;--tw-ease: initial;--tw-scale-x: 1;--tw-scale-y: 1;--tw-scale-z: 1}}}@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-100: oklch(.936 .032 17.717);--color-red-300: oklch(.808 .114 19.571);--color-red-400: oklch(.704 .191 22.216);--color-red-500: oklch(.637 .237 25.331);--color-red-600: oklch(.577 .245 27.325);--color-red-700: oklch(.505 .213 27.518);--color-red-900: oklch(.396 .141 25.723);--color-orange-50: oklch(.98 .016 73.684);--color-orange-200: oklch(.901 .076 70.697);--color-orange-500: oklch(.705 .213 47.604);--color-orange-700: oklch(.553 .195 38.402);--color-yellow-400: oklch(.852 .199 91.936);--color-yellow-500: oklch(.795 .184 86.047);--color-green-100: oklch(.962 .044 156.743);--color-green-500: oklch(.723 .219 149.579);--color-green-600: oklch(.627 .194 149.214);--color-green-700: oklch(.527 .154 150.069);--color-emerald-50: oklch(.979 .021 166.113);--color-emerald-600: oklch(.596 .145 163.225);--color-blue-50: oklch(.97 .014 254.604);--color-blue-100: oklch(.932 .032 255.585);--color-blue-200: oklch(.882 .059 254.128);--color-blue-300: oklch(.809 .105 251.813);--color-blue-400: oklch(.707 .165 254.624);--color-blue-500: oklch(.623 .214 259.815);--color-blue-600: oklch(.546 .245 262.881);--color-blue-700: oklch(.488 .243 264.376);--color-blue-800: oklch(.424 .199 265.638);--color-blue-900: oklch(.379 .146 265.522);--color-indigo-50: oklch(.962 .018 272.314);--color-indigo-600: oklch(.511 .262 276.966);--color-gray-50: oklch(.985 .002 247.839);--color-gray-100: oklch(.967 .003 264.542);--color-gray-200: oklch(.928 .006 264.531);--color-gray-300: oklch(.872 .01 258.338);--color-gray-400: oklch(.707 .022 261.325);--color-gray-500: oklch(.551 .027 264.364);--color-gray-600: oklch(.446 .03 256.802);--color-gray-700: oklch(.373 .034 259.733);--color-gray-800: oklch(.278 .033 256.848);--color-gray-900: oklch(.21 .034 264.665);--color-black: #000;--color-white: #fff;--spacing: .25rem;--container-xs: 20rem;--container-md: 28rem;--container-lg: 32rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-base: 1rem;--text-base--line-height: 1.5 ;--text-lg: 1.125rem;--text-lg--line-height: calc(1.75 / 1.125);--text-xl: 1.25rem;--text-xl--line-height: calc(1.75 / 1.25);--text-2xl: 1.5rem;--text-2xl--line-height: calc(2 / 1.5);--text-3xl: 1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-light: 300;--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--tracking-wide: .025em;--tracking-wider: .05em;--leading-tight: 1.25;--leading-relaxed: 1.625;--radius-xs: .125rem;--animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration: .15s;--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);--default-font-family: var(--font-sans);--default-font-feature-settings: var(--font-sans--font-feature-settings);--default-font-variation-settings: var(--font-sans--font-variation-settings);--default-mono-font-family: var(--font-mono);--default-mono-font-feature-settings: var(--font-mono--font-feature-settings);--default-mono-font-variation-settings: var(--font-mono--font-variation-settings)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;--lightningcss-light: initial;--lightningcss-dark: ;color-scheme:light;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;--lightningcss-light: initial;--lightningcss-dark: ;color-scheme:light;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1;color:currentColor}@supports (color: color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentColor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}body{background-color:var(--background);color:var(--foreground)}*{border-color:var(--border);outline-color:var(--ring)}@supports (color: color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring) 50%,transparent)}}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h1{font-size:var(--text-2xl);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h2{font-size:var(--text-xl);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h3{font-size:var(--text-lg);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h4,:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) label,:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) button{font-size:var(--text-base);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) input{font-size:var(--text-base);font-weight:var(--font-weight-normal);line-height:1.5}}@layer utilities{.\@container\/card-header{container:card-header / inline-size}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-2\.5{top:calc(var(--spacing) * 2.5)}.top-4{top:calc(var(--spacing) * 4)}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-12{bottom:calc(var(--spacing) * 12)}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.col-span-1{grid-column:span 1 / span 1}.col-span-2{grid-column:span 2 / span 2}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2 / span 2}.row-start-1{grid-row-start:1}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.my-1{margin-block:calc(var(--spacing) * 1)}.my-auto{margin-block:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mr-4{margin-right:calc(var(--spacing) * 4)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.aspect-square{aspect-ratio:1}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-full{width:100%;height:100%}.h-1{height:calc(var(--spacing) * 1)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-32{height:calc(var(--spacing) * 32)}.h-64{height:calc(var(--spacing) * 64)}.h-\[1\.15rem\]{height:1.15rem}.h-\[120px\]{height:120px}.h-\[200px\]{height:200px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-\[90vh\]{max-height:90vh}.min-h-\[400px\]{min-height:400px}.w-1{width:calc(var(--spacing) * 1)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-32{width:calc(var(--spacing) * 32)}.w-64{width:calc(var(--spacing) * 64)}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[150px\]{width:150px}.w-\[160px\]{width:160px}.w-\[180px\]{width:180px}.w-\[200px\]{width:200px}.w-\[250px\]{width:250px}.w-\[600px\]{width:600px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.translate-x-\[-50\%\]{--tw-translate-x: -50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y: -50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-rotate-90{rotate:-90deg}.transform{transform:var(--tw-rotate-x) var(--tw-rotate-y) var(--tw-rotate-z) var(--tw-skew-x) var(--tw-skew-y)}.animate-pulse{animation:var(--animate-pulse)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.scroll-my-1{scroll-margin-block:calc(var(--spacing) * 1)}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 0) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 0) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.-space-x-\[1px\]>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(-1px * var(--tw-space-x-reverse));margin-inline-end:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[4px\]{border-radius:4px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-0{border-right-style:var(--tw-border-style);border-right-width:0}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style: dashed;border-style:dashed}.border-none{--tw-border-style: none;border-style:none}.border-black{border-color:var(--color-black)}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-400{border-color:var(--color-blue-400)}.border-blue-800{border-color:var(--color-blue-800)}.border-blue-800\/50{border-color:color-mix(in srgb,oklch(.424 .199 265.638) 50%,transparent)}@supports (color: color-mix(in lab,red,red)){.border-blue-800\/50{border-color:color-mix(in oklab,var(--color-blue-800) 50%,transparent)}}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-gray-400{border-color:var(--color-gray-400)}.border-gray-800{border-color:var(--color-gray-800)}.border-input{border-color:var(--input)}.border-orange-200{border-color:var(--color-orange-200)}.border-red-600{border-color:var(--color-red-600)}.border-transparent{border-color:#0000}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-\[\#1e3a8a\]{background-color:#1e3a8a}.bg-\[\#2c7bb6\]{background-color:#2c7bb6}.bg-\[\#4CAF50\]{background-color:#4caf50}.bg-background{background-color:var(--background)}.bg-black{background-color:var(--color-black)}.bg-black\/40{background-color:#0006}@supports (color: color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color: color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-700{background-color:var(--color-blue-700)}.bg-blue-800{background-color:var(--color-blue-800)}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-current{background-color:currentColor}.bg-destructive{background-color:var(--destructive)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\/50{background-color:color-mix(in srgb,oklch(.985 .002 247.839) 50%,transparent)}@supports (color: color-mix(in lab,red,red)){.bg-gray-50\/50{background-color:color-mix(in oklab,var(--color-gray-50) 50%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-200\/50{background-color:color-mix(in srgb,oklch(.928 .006 264.531) 50%,transparent)}@supports (color: color-mix(in lab,red,red)){.bg-gray-200\/50{background-color:color-mix(in oklab,var(--color-gray-200) 50%,transparent)}}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-green-600{background-color:var(--color-green-600)}.bg-indigo-50{background-color:var(--color-indigo-50)}.bg-input-background{background-color:var(--input-background)}.bg-muted,.bg-muted\/50{background-color:var(--muted)}@supports (color: color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.bg-orange-50{background-color:var(--color-orange-50)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-400{background-color:var(--color-yellow-400)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-gradient-to-b{--tw-gradient-position: to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-gray-50{--tw-gradient-from: var(--color-gray-50);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-gray-100{--tw-gradient-to: var(--color-gray-100);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-\[3px\]{padding:3px}.p-px{padding:1px}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-0{padding-bottom:calc(var(--spacing) * 0)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading, var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading, var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading, var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading, var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading, var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.leading-none{--tw-leading: 1;line-height:1}.leading-relaxed{--tw-leading: var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading: var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight: var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-light{--tw-font-weight: var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight: var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight: var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking: var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking: var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-nowrap{white-space:nowrap}.text-\[\#2c7bb6\]{color:#2c7bb6}.text-black{color:var(--color-black)}.text-blue-100{color:var(--color-blue-100)}.text-blue-200{color:var(--color-blue-200)}.text-blue-300{color:var(--color-blue-300)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-blue-900{color:var(--color-blue-900)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-emerald-600{color:var(--color-emerald-600)}.text-foreground{color:var(--foreground)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-indigo-600{color:var(--color-indigo-600)}.text-muted-foreground{color:var(--muted-foreground)}.text-orange-500{color:var(--color-orange-500)}.text-orange-700{color:var(--color-orange-700)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-2xl{--tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, #00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, #0000001a), 0 4px 6px -4px var(--tw-shadow-color, #0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, #0000001a), 0 2px 4px -2px var(--tw-shadow-color, #0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, #0000001a), 0 8px 10px -6px var(--tw-shadow-color, #0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, #0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-blue-900\/20{--tw-shadow-color: color-mix(in srgb, oklch(.379 .146 265.522) 20%, transparent)}@supports (color: color-mix(in lab,red,red)){.shadow-blue-900\/20{--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-blue-900) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-offset-background{--tw-ring-offset-color: var(--background)}.outline-hidden{--tw-outline-style: none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-blur-\[1px\]{--tw-backdrop-blur: blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-none{transition-property:none}.duration-200{--tw-duration: .2s;transition-duration:.2s}.duration-1000{--tw-duration: 1s;transition-duration:1s}.ease-linear{--tw-ease: linear;transition-timing-function:linear}.outline-none{--tw-outline-style: none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.selection\:bg-primary ::selection,.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection,.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}.last\:pb-0:last-child{padding-bottom:calc(var(--spacing) * 0)}@media(hover:hover){.hover\:scale-110:hover{--tw-scale-x: 110%;--tw-scale-y: 110%;--tw-scale-z: 110%;scale:var(--tw-scale-x) var(--tw-scale-y)}}@media(hover:hover){.hover\:bg-\[\#43a047\]:hover{background-color:#43a047}}@media(hover:hover){.hover\:bg-\[\#256b9e\]:hover{background-color:#256b9e}}@media(hover:hover){.hover\:bg-accent:hover{background-color:var(--accent)}}@media(hover:hover){.hover\:bg-blue-50:hover{background-color:var(--color-blue-50)}}@media(hover:hover){.hover\:bg-blue-100:hover{background-color:var(--color-blue-100)}}@media(hover:hover){.hover\:bg-blue-500:hover{background-color:var(--color-blue-500)}}@media(hover:hover){.hover\:bg-blue-600:hover{background-color:var(--color-blue-600)}}@media(hover:hover){.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}}@media(hover:hover){.hover\:bg-blue-800:hover{background-color:var(--color-blue-800)}}@media(hover:hover){.hover\:bg-blue-800\/30:hover{background-color:color-mix(in srgb,oklch(.424 .199 265.638) 30%,transparent)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-blue-800\/30:hover{background-color:color-mix(in oklab,var(--color-blue-800) 30%,transparent)}}}@media(hover:hover){.hover\:bg-blue-800\/50:hover{background-color:color-mix(in srgb,oklch(.424 .199 265.638) 50%,transparent)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-blue-800\/50:hover{background-color:color-mix(in oklab,var(--color-blue-800) 50%,transparent)}}}@media(hover:hover){.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}}@media(hover:hover){.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}}@media(hover:hover){.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}}@media(hover:hover){.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}}@media(hover:hover){.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}}@media(hover:hover){.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}}@media(hover:hover){.hover\:bg-red-900\/20:hover{background-color:color-mix(in srgb,oklch(.396 .141 25.723) 20%,transparent)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-red-900\/20:hover{background-color:color-mix(in oklab,var(--color-red-900) 20%,transparent)}}}@media(hover:hover){.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}}@media(hover:hover){.hover\:bg-yellow-500:hover{background-color:var(--color-yellow-500)}}@media(hover:hover){.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}@media(hover:hover){.hover\:text-gray-600:hover{color:var(--color-gray-600)}}@media(hover:hover){.hover\:text-gray-700:hover{color:var(--color-gray-700)}}@media(hover:hover){.hover\:text-red-600:hover{color:var(--color-red-600)}}@media(hover:hover){.hover\:text-white:hover{color:var(--color-white)}}@media(hover:hover){.hover\:underline:hover{text-decoration-line:underline}}@media(hover:hover){.hover\:opacity-100:hover{opacity:1}}@media(hover:hover){.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, #0000001a), 0 2px 4px -2px var(--tw-shadow-color, #0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:bg-white:focus{background-color:var(--color-white)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color: var(--color-blue-500)}.focus\:ring-ring:focus{--tw-ring-color: var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px;--tw-ring-offset-shadow: var(--tw-ring-inset, ) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style: none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color: var(--ring)}@supports (color: color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: calc(2 * var(--spacing) * -1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: calc(2 * var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: calc(2 * var(--spacing) * -1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: calc(2 * var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\[state\=active\]\:bg-card[data-state=active]{background-color:var(--card)}.data-\[state\=checked\]\:translate-x-\[calc\(100\%-2px\)\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-duration, .15s) var(--tw-ease, ease)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-duration, .15s) var(--tw-ease, ease)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-switch-background[data-state=unchecked]{background-color:var(--switch-background)}@media(width>=40rem){.sm\:ml-0{margin-left:calc(var(--spacing) * 0)}}@media(width>=40rem){.sm\:w-auto{width:auto}}@media(width>=40rem){.sm\:max-w-\[500px\]{max-width:500px}}@media(width>=40rem){.sm\:max-w-\[600px\]{max-width:600px}}@media(width>=40rem){.sm\:max-w-lg{max-width:var(--container-lg)}}@media(width>=40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(width>=40rem){.sm\:flex-row{flex-direction:row}}@media(width>=40rem){.sm\:items-center{align-items:center}}@media(width>=40rem){.sm\:justify-end{justify-content:flex-end}}@media(width>=40rem){.sm\:text-left{text-align:left}}@media(width>=48rem){.md\:block{display:block}}@media(width>=48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(width>=48rem){.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(width>=48rem){.md\:flex-row{flex-direction:row}}@media(width>=48rem){.md\:text-base{font-size:var(--text-base);line-height:var(--tw-leading, var(--text-base--line-height))}}@media(width>=48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}}@media(width>=64rem){.lg\:col-span-2{grid-column:span 2 / span 2}}@media(width>=64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(width>=64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(width>=64rem){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(width>=80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive) 60%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}@media(hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color: color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}}@media(hover:hover){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:data-\[state\=checked\]\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\:data-\[state\=checked\]\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\:data-\[state\=unchecked\]\:bg-card-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--card-foreground)}.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--input) 80%,transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing) * 0)}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}.\[\&\:last-child\]\:pb-6:last-child{padding-bottom:calc(var(--spacing) * 6)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}}@media(hover:hover){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}}@media(hover:hover){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color: color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}}@media(hover:hover){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color: color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab,var(--secondary) 90%,transparent)}}}@media(hover:hover){a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}}:root{--font-size: 16px;--background: #fff;--foreground: oklch(.145 0 0);--card: #fff;--card-foreground: oklch(.145 0 0);--popover: oklch(1 0 0);--popover-foreground: oklch(.145 0 0);--primary: #030213;--primary-foreground: oklch(1 0 0);--secondary: oklch(.95 .0058 264.53);--secondary-foreground: #030213;--muted: #ececf0;--muted-foreground: #717182;--accent: #e9ebef;--accent-foreground: #030213;--destructive: #d4183d;--destructive-foreground: #fff;--border: #0000001a;--input: transparent;--input-background: #f3f3f5;--switch-background: #cbced4;--font-weight-medium: 500;--font-weight-normal: 400;--ring: oklch(.708 0 0);--chart-1: oklch(.646 .222 41.116);--chart-2: oklch(.6 .118 184.704);--chart-3: oklch(.398 .07 227.392);--chart-4: oklch(.828 .189 84.429);--chart-5: oklch(.769 .188 70.08);--radius: .625rem;--sidebar: oklch(.985 0 0);--sidebar-foreground: oklch(.145 0 0);--sidebar-primary: #030213;--sidebar-primary-foreground: oklch(.985 0 0);--sidebar-accent: oklch(.97 0 0);--sidebar-accent-foreground: oklch(.205 0 0);--sidebar-border: oklch(.922 0 0);--sidebar-ring: oklch(.708 0 0)}.dark{--background: oklch(.145 0 0);--foreground: oklch(.985 0 0);--card: oklch(.145 0 0);--card-foreground: oklch(.985 0 0);--popover: oklch(.145 0 0);--popover-foreground: oklch(.985 0 0);--primary: oklch(.985 0 0);--primary-foreground: oklch(.205 0 0);--secondary: oklch(.269 0 0);--secondary-foreground: oklch(.985 0 0);--muted: oklch(.269 0 0);--muted-foreground: oklch(.708 0 0);--accent: oklch(.269 0 0);--accent-foreground: oklch(.985 0 0);--destructive: oklch(.396 .141 25.723);--destructive-foreground: oklch(.637 .237 25.331);--border: oklch(.269 0 0);--input: oklch(.269 0 0);--ring: oklch(.439 0 0);--font-weight-medium: 500;--font-weight-normal: 400;--chart-1: oklch(.488 .243 264.376);--chart-2: oklch(.696 .17 162.48);--chart-3: oklch(.769 .188 70.08);--chart-4: oklch(.627 .265 303.9);--chart-5: oklch(.645 .246 16.439);--sidebar: oklch(.205 0 0);--sidebar-foreground: oklch(.985 0 0);--sidebar-primary: oklch(.488 .243 264.376);--sidebar-primary-foreground: oklch(.985 0 0);--sidebar-accent: oklch(.269 0 0);--sidebar-accent-foreground: oklch(.985 0 0);--sidebar-border: oklch(.269 0 0);--sidebar-ring: oklch(.439 0 0)}html{font-size:var(--font-size)}@property --tw-translate-x{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-y{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-z{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-rotate-x{syntax: "*"; inherits: false; initial-value: rotateX(0);}@property --tw-rotate-y{syntax: "*"; inherits: false; initial-value: rotateY(0);}@property --tw-rotate-z{syntax: "*"; inherits: false; initial-value: rotateZ(0);}@property --tw-skew-x{syntax: "*"; inherits: false; initial-value: skewX(0);}@property --tw-skew-y{syntax: "*"; inherits: false; initial-value: skewY(0);}@property --tw-space-y-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-space-x-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-gradient-position{syntax: "*"; inherits: false}@property --tw-gradient-from{syntax: ""; inherits: false; initial-value: #0000;}@property --tw-gradient-via{syntax: ""; inherits: false; initial-value: #0000;}@property --tw-gradient-to{syntax: ""; inherits: false; initial-value: #0000;}@property --tw-gradient-stops{syntax: "*"; inherits: false}@property --tw-gradient-via-stops{syntax: "*"; inherits: false}@property --tw-gradient-from-position{syntax: ""; inherits: false; initial-value: 0%;}@property --tw-gradient-via-position{syntax: ""; inherits: false; initial-value: 50%;}@property --tw-gradient-to-position{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-leading{syntax: "*"; inherits: false}@property --tw-font-weight{syntax: "*"; inherits: false}@property --tw-tracking{syntax: "*"; inherits: false}@property --tw-ordinal{syntax: "*"; inherits: false}@property --tw-slashed-zero{syntax: "*"; inherits: false}@property --tw-numeric-figure{syntax: "*"; inherits: false}@property --tw-numeric-spacing{syntax: "*"; inherits: false}@property --tw-numeric-fraction{syntax: "*"; inherits: false}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false}@property --tw-shadow-alpha{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false}@property --tw-inset-shadow-alpha{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false}@property --tw-ring-offset-width{syntax: ""; inherits: false; initial-value: 0;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-outline-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-backdrop-blur{syntax: "*"; inherits: false}@property --tw-backdrop-brightness{syntax: "*"; inherits: false}@property --tw-backdrop-contrast{syntax: "*"; inherits: false}@property --tw-backdrop-grayscale{syntax: "*"; inherits: false}@property --tw-backdrop-hue-rotate{syntax: "*"; inherits: false}@property --tw-backdrop-invert{syntax: "*"; inherits: false}@property --tw-backdrop-opacity{syntax: "*"; inherits: false}@property --tw-backdrop-saturate{syntax: "*"; inherits: false}@property --tw-backdrop-sepia{syntax: "*"; inherits: false}@property --tw-duration{syntax: "*"; inherits: false}@property --tw-ease{syntax: "*"; inherits: false}@property --tw-scale-x{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-scale-y{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-scale-z{syntax: "*"; inherits: false; initial-value: 1;}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}@font-face{font-family:FreightSans Bold;src:url(/assets/FreightSans%20Bold-CftzBXfG.ttf) format("truetype");font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0000-002F,U+003A-10FFFF}:root{--font-sans: "FreightSans Bold", ui-sans-serif, system-ui, sans-serif;--font-numeric: ui-sans-serif, system-ui, sans-serif}body{font-family:var(--font-sans)}.font-numeric{font-family:var(--font-numeric)!important} +/*! tailwindcss v4.1.3 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens: none)) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color: rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0;--tw-rotate-x: rotateX(0);--tw-rotate-y: rotateY(0);--tw-rotate-z: rotateZ(0);--tw-skew-x: skewX(0);--tw-skew-y: skewY(0);--tw-space-y-reverse: 0;--tw-space-x-reverse: 0;--tw-border-style: solid;--tw-gradient-position: initial;--tw-gradient-from: #0000;--tw-gradient-via: #0000;--tw-gradient-to: #0000;--tw-gradient-stops: initial;--tw-gradient-via-stops: initial;--tw-gradient-from-position: 0%;--tw-gradient-via-position: 50%;--tw-gradient-to-position: 100%;--tw-leading: initial;--tw-font-weight: initial;--tw-tracking: initial;--tw-ordinal: initial;--tw-slashed-zero: initial;--tw-numeric-figure: initial;--tw-numeric-spacing: initial;--tw-numeric-fraction: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-outline-style: solid;--tw-backdrop-blur: initial;--tw-backdrop-brightness: initial;--tw-backdrop-contrast: initial;--tw-backdrop-grayscale: initial;--tw-backdrop-hue-rotate: initial;--tw-backdrop-invert: initial;--tw-backdrop-opacity: initial;--tw-backdrop-saturate: initial;--tw-backdrop-sepia: initial;--tw-duration: initial;--tw-ease: initial;--tw-scale-x: 1;--tw-scale-y: 1;--tw-scale-z: 1}}}@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-100: oklch(.936 .032 17.717);--color-red-300: oklch(.808 .114 19.571);--color-red-400: oklch(.704 .191 22.216);--color-red-500: oklch(.637 .237 25.331);--color-red-600: oklch(.577 .245 27.325);--color-red-700: oklch(.505 .213 27.518);--color-red-900: oklch(.396 .141 25.723);--color-orange-50: oklch(.98 .016 73.684);--color-orange-200: oklch(.901 .076 70.697);--color-orange-500: oklch(.705 .213 47.604);--color-orange-700: oklch(.553 .195 38.402);--color-yellow-400: oklch(.852 .199 91.936);--color-yellow-500: oklch(.795 .184 86.047);--color-green-100: oklch(.962 .044 156.743);--color-green-500: oklch(.723 .219 149.579);--color-green-600: oklch(.627 .194 149.214);--color-green-700: oklch(.527 .154 150.069);--color-emerald-50: oklch(.979 .021 166.113);--color-emerald-600: oklch(.596 .145 163.225);--color-blue-50: oklch(.97 .014 254.604);--color-blue-100: oklch(.932 .032 255.585);--color-blue-200: oklch(.882 .059 254.128);--color-blue-300: oklch(.809 .105 251.813);--color-blue-400: oklch(.707 .165 254.624);--color-blue-500: oklch(.623 .214 259.815);--color-blue-600: oklch(.546 .245 262.881);--color-blue-700: oklch(.488 .243 264.376);--color-blue-800: oklch(.424 .199 265.638);--color-blue-900: oklch(.379 .146 265.522);--color-indigo-50: oklch(.962 .018 272.314);--color-indigo-600: oklch(.511 .262 276.966);--color-gray-50: oklch(.985 .002 247.839);--color-gray-100: oklch(.967 .003 264.542);--color-gray-200: oklch(.928 .006 264.531);--color-gray-300: oklch(.872 .01 258.338);--color-gray-400: oklch(.707 .022 261.325);--color-gray-500: oklch(.551 .027 264.364);--color-gray-600: oklch(.446 .03 256.802);--color-gray-700: oklch(.373 .034 259.733);--color-gray-800: oklch(.278 .033 256.848);--color-gray-900: oklch(.21 .034 264.665);--color-black: #000;--color-white: #fff;--spacing: .25rem;--container-xs: 20rem;--container-md: 28rem;--container-lg: 32rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-base: 1rem;--text-base--line-height: 1.5 ;--text-lg: 1.125rem;--text-lg--line-height: calc(1.75 / 1.125);--text-xl: 1.25rem;--text-xl--line-height: calc(1.75 / 1.25);--text-2xl: 1.5rem;--text-2xl--line-height: calc(2 / 1.5);--text-3xl: 1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-light: 300;--font-weight-normal: 400;--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--tracking-wide: .025em;--tracking-wider: .05em;--leading-tight: 1.25;--leading-relaxed: 1.625;--radius-xs: .125rem;--animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration: .15s;--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);--default-font-family: var(--font-sans);--default-font-feature-settings: var(--font-sans--font-feature-settings);--default-font-variation-settings: var(--font-sans--font-variation-settings);--default-mono-font-family: var(--font-mono);--default-mono-font-feature-settings: var(--font-mono--font-feature-settings);--default-mono-font-variation-settings: var(--font-mono--font-variation-settings)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;--lightningcss-light: initial;--lightningcss-dark: ;color-scheme:light;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;--lightningcss-light: initial;--lightningcss-dark: ;color-scheme:light;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1;color:currentColor}@supports (color: color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentColor 50%,transparent)}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}body{background-color:var(--background);color:var(--foreground)}*{border-color:var(--border);outline-color:var(--ring)}@supports (color: color-mix(in lab,red,red)){*{outline-color:color-mix(in oklab,var(--ring) 50%,transparent)}}body{background-color:var(--background);color:var(--foreground);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h1{font-size:var(--text-2xl);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h2{font-size:var(--text-xl);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h3{font-size:var(--text-lg);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) h4,:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) label,:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) button{font-size:var(--text-base);font-weight:var(--font-weight-medium);line-height:1.5}:where(:not(:has([class*=" text-"]),:not(:has([class^=text-])))) input{font-size:var(--text-base);font-weight:var(--font-weight-normal);line-height:1.5}}@layer utilities{.\@container\/card-header{container:card-header / inline-size}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-2\.5{top:calc(var(--spacing) * 2.5)}.top-4{top:calc(var(--spacing) * 4)}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.right-2{right:calc(var(--spacing) * 2)}.right-4{right:calc(var(--spacing) * 4)}.bottom-12{bottom:calc(var(--spacing) * 12)}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-\[50\%\]{left:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.col-span-1{grid-column:span 1 / span 1}.col-span-2{grid-column:span 2 / span 2}.col-start-2{grid-column-start:2}.row-span-2{grid-row:span 2 / span 2}.row-start-1{grid-row-start:1}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.my-1{margin-block:calc(var(--spacing) * 1)}.my-auto{margin-block:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mr-4{margin-right:calc(var(--spacing) * 4)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-row{display:table-row}.aspect-square{aspect-ratio:1}.size-3\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-9{width:calc(var(--spacing) * 9);height:calc(var(--spacing) * 9)}.size-10{width:calc(var(--spacing) * 10);height:calc(var(--spacing) * 10)}.size-full{width:100%;height:100%}.h-1{height:calc(var(--spacing) * 1)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-32{height:calc(var(--spacing) * 32)}.h-64{height:calc(var(--spacing) * 64)}.h-\[1\.15rem\]{height:1.15rem}.h-\[120px\]{height:120px}.h-\[200px\]{height:200px}.h-\[280px\]{height:280px}.h-\[300px\]{height:300px}.h-\[calc\(100\%-1px\)\]{height:calc(100% - 1px)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-\(--radix-select-content-available-height\){max-height:var(--radix-select-content-available-height)}.max-h-\[90vh\]{max-height:90vh}.min-h-\[400px\]{min-height:400px}.w-1{width:calc(var(--spacing) * 1)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-32{width:calc(var(--spacing) * 32)}.w-64{width:calc(var(--spacing) * 64)}.w-\[100px\]{width:100px}.w-\[120px\]{width:120px}.w-\[140px\]{width:140px}.w-\[150px\]{width:150px}.w-\[160px\]{width:160px}.w-\[180px\]{width:180px}.w-\[200px\]{width:200px}.w-\[250px\]{width:250px}.w-\[600px\]{width:600px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\[200px\]{max-width:200px}.max-w-\[calc\(100\%-2rem\)\]{max-width:calc(100% - 2rem)}.max-w-full{max-width:100%}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.origin-\(--radix-select-content-transform-origin\){transform-origin:var(--radix-select-content-transform-origin)}.translate-x-\[-50\%\]{--tw-translate-x: -50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-y-\[-50\%\]{--tw-translate-y: -50%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-rotate-90{rotate:-90deg}.transform{transform:var(--tw-rotate-x) var(--tw-rotate-y) var(--tw-rotate-z) var(--tw-skew-x) var(--tw-skew-y)}.animate-pulse{animation:var(--animate-pulse)}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.scroll-my-1{scroll-margin-block:calc(var(--spacing) * 1)}.auto-rows-min{grid-auto-rows:min-content}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-rows-\[auto_auto\]{grid-template-rows:auto auto}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 0) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 0) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.-space-x-\[1px\]>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(-1px * var(--tw-space-x-reverse));margin-inline-end:calc(-1px * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse: 0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}.self-start{align-self:flex-start}.justify-self-end{justify-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\[4px\]{border-radius:4px}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-xs{border-radius:var(--radius-xs)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-r-0{border-right-style:var(--tw-border-style);border-right-width:0}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style: dashed;border-style:dashed}.border-none{--tw-border-style: none;border-style:none}.border-black{border-color:var(--color-black)}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-400{border-color:var(--color-blue-400)}.border-blue-800{border-color:var(--color-blue-800)}.border-blue-800\/50{border-color:color-mix(in srgb,oklch(.424 .199 265.638) 50%,transparent)}@supports (color: color-mix(in lab,red,red)){.border-blue-800\/50{border-color:color-mix(in oklab,var(--color-blue-800) 50%,transparent)}}.border-gray-100{border-color:var(--color-gray-100)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.border-gray-400{border-color:var(--color-gray-400)}.border-gray-800{border-color:var(--color-gray-800)}.border-input{border-color:var(--input)}.border-orange-200{border-color:var(--color-orange-200)}.border-red-600{border-color:var(--color-red-600)}.border-transparent{border-color:#0000}.border-t-transparent{border-top-color:#0000}.border-l-transparent{border-left-color:#0000}.bg-\[\#1e3a8a\]{background-color:#1e3a8a}.bg-\[\#2c7bb6\]{background-color:#2c7bb6}.bg-\[\#4CAF50\]{background-color:#4caf50}.bg-background{background-color:var(--background)}.bg-black{background-color:var(--color-black)}.bg-black\/40{background-color:#0006}@supports (color: color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color: color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-blue-700{background-color:var(--color-blue-700)}.bg-blue-800{background-color:var(--color-blue-800)}.bg-border{background-color:var(--border)}.bg-card{background-color:var(--card)}.bg-current{background-color:currentColor}.bg-destructive{background-color:var(--destructive)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-50\/50{background-color:color-mix(in srgb,oklch(.985 .002 247.839) 50%,transparent)}@supports (color: color-mix(in lab,red,red)){.bg-gray-50\/50{background-color:color-mix(in oklab,var(--color-gray-50) 50%,transparent)}}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-200\/50{background-color:color-mix(in srgb,oklch(.928 .006 264.531) 50%,transparent)}@supports (color: color-mix(in lab,red,red)){.bg-gray-200\/50{background-color:color-mix(in oklab,var(--color-gray-200) 50%,transparent)}}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-700{background-color:var(--color-gray-700)}.bg-gray-900{background-color:var(--color-gray-900)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-500{background-color:var(--color-green-500)}.bg-green-600{background-color:var(--color-green-600)}.bg-indigo-50{background-color:var(--color-indigo-50)}.bg-input-background{background-color:var(--input-background)}.bg-muted,.bg-muted\/50{background-color:var(--muted)}@supports (color: color-mix(in lab,red,red)){.bg-muted\/50{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}.bg-orange-50{background-color:var(--color-orange-50)}.bg-popover{background-color:var(--popover)}.bg-primary{background-color:var(--primary)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-500{background-color:var(--color-red-500)}.bg-secondary{background-color:var(--secondary)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-yellow-400{background-color:var(--color-yellow-400)}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-gradient-to-b{--tw-gradient-position: to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-gray-50{--tw-gradient-from: var(--color-gray-50);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-gray-100{--tw-gradient-to: var(--color-gray-100);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-\[3px\]{padding:3px}.p-px{padding:1px}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pb-0{padding-bottom:calc(var(--spacing) * 0)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading, var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading, var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading, var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading, var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading, var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.text-\[10px\]{font-size:10px}.leading-none{--tw-leading: 1;line-height:1}.leading-relaxed{--tw-leading: var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading: var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight: var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-light{--tw-font-weight: var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight: var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight: var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking: var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking: var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-nowrap{white-space:nowrap}.text-\[\#2c7bb6\]{color:#2c7bb6}.text-black{color:var(--color-black)}.text-blue-100{color:var(--color-blue-100)}.text-blue-200{color:var(--color-blue-200)}.text-blue-300{color:var(--color-blue-300)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-blue-900{color:var(--color-blue-900)}.text-card-foreground{color:var(--card-foreground)}.text-current{color:currentColor}.text-emerald-600{color:var(--color-emerald-600)}.text-foreground{color:var(--foreground)}.text-gray-300{color:var(--color-gray-300)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-800{color:var(--color-gray-800)}.text-gray-900{color:var(--color-gray-900)}.text-green-500{color:var(--color-green-500)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-indigo-600{color:var(--color-indigo-600)}.text-muted-foreground{color:var(--muted-foreground)}.text-orange-500{color:var(--color-orange-500)}.text-orange-700{color:var(--color-orange-700)}.text-popover-foreground{color:var(--popover-foreground)}.text-primary{color:var(--primary)}.text-primary-foreground{color:var(--primary-foreground)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-secondary-foreground{color:var(--secondary-foreground)}.text-white{color:var(--color-white)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.underline-offset-4{text-underline-offset:4px}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.shadow-2xl{--tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, #00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, #0000001a), 0 4px 6px -4px var(--tw-shadow-color, #0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, #0000001a), 0 2px 4px -2px var(--tw-shadow-color, #0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, #0000001a), 0 1px 2px -1px var(--tw-shadow-color, #0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, #0000001a), 0 8px 10px -6px var(--tw-shadow-color, #0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xs{--tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, #0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-0{--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-blue-900\/20{--tw-shadow-color: color-mix(in srgb, oklch(.379 .146 265.522) 20%, transparent)}@supports (color: color-mix(in lab,red,red)){.shadow-blue-900\/20{--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-blue-900) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-offset-background{--tw-ring-offset-color: var(--background)}.outline-hidden{--tw-outline-style: none;outline-style:none}@media(forced-colors:active){.outline-hidden{outline-offset:2px;outline:2px solid #0000}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.backdrop-blur-\[1px\]{--tw-backdrop-blur: blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, );backdrop-filter:var(--tw-backdrop-blur, ) var(--tw-backdrop-brightness, ) var(--tw-backdrop-contrast, ) var(--tw-backdrop-grayscale, ) var(--tw-backdrop-hue-rotate, ) var(--tw-backdrop-invert, ) var(--tw-backdrop-opacity, ) var(--tw-backdrop-saturate, ) var(--tw-backdrop-sepia, )}.transition-\[color\,box-shadow\]{transition-property:color,box-shadow;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-none{transition-property:none}.duration-200{--tw-duration: .2s;transition-duration:.2s}.duration-1000{--tw-duration: 1s;transition-duration:1s}.ease-linear{--tw-ease: linear;transition-timing-function:linear}.outline-none{--tw-outline-style: none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}.group-data-\[disabled\=true\]\:pointer-events-none:is(:where(.group)[data-disabled=true] *){pointer-events:none}.group-data-\[disabled\=true\]\:opacity-50:is(:where(.group)[data-disabled=true] *){opacity:.5}.peer-disabled\:cursor-not-allowed:is(:where(.peer):disabled~*){cursor:not-allowed}.peer-disabled\:opacity-50:is(:where(.peer):disabled~*){opacity:.5}.peer-disabled\:opacity-70:is(:where(.peer):disabled~*){opacity:.7}.selection\:bg-primary ::selection,.selection\:bg-primary::selection{background-color:var(--primary)}.selection\:text-primary-foreground ::selection,.selection\:text-primary-foreground::selection{color:var(--primary-foreground)}.file\:inline-flex::file-selector-button{display:inline-flex}.file\:h-7::file-selector-button{height:calc(var(--spacing) * 7)}.file\:border-0::file-selector-button{border-style:var(--tw-border-style);border-width:0}.file\:bg-transparent::file-selector-button{background-color:#0000}.file\:text-sm::file-selector-button{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.file\:font-medium::file-selector-button{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.file\:text-foreground::file-selector-button{color:var(--foreground)}.placeholder\:text-muted-foreground::placeholder{color:var(--muted-foreground)}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}.last\:pb-0:last-child{padding-bottom:calc(var(--spacing) * 0)}@media(hover:hover){.hover\:scale-110:hover{--tw-scale-x: 110%;--tw-scale-y: 110%;--tw-scale-z: 110%;scale:var(--tw-scale-x) var(--tw-scale-y)}}@media(hover:hover){.hover\:bg-\[\#43a047\]:hover{background-color:#43a047}}@media(hover:hover){.hover\:bg-\[\#256b9e\]:hover{background-color:#256b9e}}@media(hover:hover){.hover\:bg-accent:hover{background-color:var(--accent)}}@media(hover:hover){.hover\:bg-blue-50:hover{background-color:var(--color-blue-50)}}@media(hover:hover){.hover\:bg-blue-100:hover{background-color:var(--color-blue-100)}}@media(hover:hover){.hover\:bg-blue-500:hover{background-color:var(--color-blue-500)}}@media(hover:hover){.hover\:bg-blue-600:hover{background-color:var(--color-blue-600)}}@media(hover:hover){.hover\:bg-blue-700:hover{background-color:var(--color-blue-700)}}@media(hover:hover){.hover\:bg-blue-800:hover{background-color:var(--color-blue-800)}}@media(hover:hover){.hover\:bg-blue-800\/30:hover{background-color:color-mix(in srgb,oklch(.424 .199 265.638) 30%,transparent)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-blue-800\/30:hover{background-color:color-mix(in oklab,var(--color-blue-800) 30%,transparent)}}}@media(hover:hover){.hover\:bg-blue-800\/50:hover{background-color:color-mix(in srgb,oklch(.424 .199 265.638) 50%,transparent)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-blue-800\/50:hover{background-color:color-mix(in oklab,var(--color-blue-800) 50%,transparent)}}}@media(hover:hover){.hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}}@media(hover:hover){.hover\:bg-gray-50:hover{background-color:var(--color-gray-50)}}@media(hover:hover){.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}}@media(hover:hover){.hover\:bg-gray-200:hover{background-color:var(--color-gray-200)}}@media(hover:hover){.hover\:bg-muted\/50:hover{background-color:var(--muted)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-muted\/50:hover{background-color:color-mix(in oklab,var(--muted) 50%,transparent)}}}@media(hover:hover){.hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}}@media(hover:hover){.hover\:bg-red-900\/20:hover{background-color:color-mix(in srgb,oklch(.396 .141 25.723) 20%,transparent)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-red-900\/20:hover{background-color:color-mix(in oklab,var(--color-red-900) 20%,transparent)}}}@media(hover:hover){.hover\:bg-secondary\/80:hover{background-color:var(--secondary)}@supports (color: color-mix(in lab,red,red)){.hover\:bg-secondary\/80:hover{background-color:color-mix(in oklab,var(--secondary) 80%,transparent)}}}@media(hover:hover){.hover\:bg-yellow-500:hover{background-color:var(--color-yellow-500)}}@media(hover:hover){.hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}@media(hover:hover){.hover\:text-gray-600:hover{color:var(--color-gray-600)}}@media(hover:hover){.hover\:text-gray-700:hover{color:var(--color-gray-700)}}@media(hover:hover){.hover\:text-red-600:hover{color:var(--color-red-600)}}@media(hover:hover){.hover\:text-white:hover{color:var(--color-white)}}@media(hover:hover){.hover\:underline:hover{text-decoration-line:underline}}@media(hover:hover){.hover\:opacity-100:hover{opacity:1}}@media(hover:hover){.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, #0000001a), 0 2px 4px -2px var(--tw-shadow-color, #0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:bg-accent:focus{background-color:var(--accent)}.focus\:bg-white:focus{background-color:var(--color-white)}.focus\:text-accent-foreground:focus{color:var(--accent-foreground)}.focus\:ring-2:focus{--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-blue-500:focus{--tw-ring-color: var(--color-blue-500)}.focus\:ring-ring:focus{--tw-ring-color: var(--ring)}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px;--tw-ring-offset-shadow: var(--tw-ring-inset, ) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.focus\:outline-hidden:focus{--tw-outline-style: none;outline-style:none}@media(forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus-visible\:border-ring:focus-visible{border-color:var(--ring)}.focus-visible\:ring-0:focus-visible{--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-\[3px\]:focus-visible{--tw-ring-shadow: var(--tw-ring-inset, ) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.focus-visible\:ring-destructive\/20:focus-visible{--tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent)}}.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color: var(--ring)}@supports (color: color-mix(in lab,red,red)){.focus-visible\:ring-ring\/50:focus-visible{--tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent)}}.focus-visible\:outline-1:focus-visible{outline-style:var(--tw-outline-style);outline-width:1px}.focus-visible\:outline-ring:focus-visible{outline-color:var(--ring)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.has-data-\[slot\=card-action\]\:grid-cols-\[1fr_auto\]:has([data-slot=card-action]){grid-template-columns:1fr auto}.has-\[\>svg\]\:px-2\.5:has(>svg){padding-inline:calc(var(--spacing) * 2.5)}.has-\[\>svg\]\:px-3:has(>svg){padding-inline:calc(var(--spacing) * 3)}.has-\[\>svg\]\:px-4:has(>svg){padding-inline:calc(var(--spacing) * 4)}.aria-invalid\:border-destructive[aria-invalid=true]{border-color:var(--destructive)}.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.aria-invalid\:ring-destructive\/20[aria-invalid=true]{--tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent)}}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[placeholder\]\:text-muted-foreground[data-placeholder]{color:var(--muted-foreground)}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: calc(2 * var(--spacing) * -1)}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: calc(2 * var(--spacing))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: calc(2 * var(--spacing) * -1)}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: calc(2 * var(--spacing))}.data-\[size\=default\]\:h-9[data-size=default]{height:calc(var(--spacing) * 9)}.data-\[size\=sm\]\:h-8[data-size=sm]{height:calc(var(--spacing) * 8)}:is(.\*\:data-\[slot\=select-value\]\:line-clamp-1>*)[data-slot=select-value]{-webkit-line-clamp:1;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}:is(.\*\:data-\[slot\=select-value\]\:flex>*)[data-slot=select-value]{display:flex}:is(.\*\:data-\[slot\=select-value\]\:items-center>*)[data-slot=select-value]{align-items:center}:is(.\*\:data-\[slot\=select-value\]\:gap-2>*)[data-slot=select-value]{gap:calc(var(--spacing) * 2)}.data-\[state\=active\]\:bg-card[data-state=active]{background-color:var(--card)}.data-\[state\=checked\]\:translate-x-\[calc\(100\%-2px\)\][data-state=checked]{--tw-translate-x: calc(100% - 2px) ;translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=checked\]\:border-primary[data-state=checked]{border-color:var(--primary)}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:var(--primary)}.data-\[state\=checked\]\:text-primary-foreground[data-state=checked]{color:var(--primary-foreground)}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation:exit var(--tw-duration, .15s) var(--tw-ease, ease)}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:animate-in[data-state=open]{animation:enter var(--tw-duration, .15s) var(--tw-ease, ease)}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:var(--accent)}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:var(--muted-foreground)}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:var(--muted)}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked]{--tw-translate-x: calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.data-\[state\=unchecked\]\:bg-switch-background[data-state=unchecked]{background-color:var(--switch-background)}@media(width>=40rem){.sm\:ml-0{margin-left:calc(var(--spacing) * 0)}}@media(width>=40rem){.sm\:w-auto{width:auto}}@media(width>=40rem){.sm\:max-w-\[500px\]{max-width:500px}}@media(width>=40rem){.sm\:max-w-\[600px\]{max-width:600px}}@media(width>=40rem){.sm\:max-w-lg{max-width:var(--container-lg)}}@media(width>=40rem){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(width>=40rem){.sm\:flex-row{flex-direction:row}}@media(width>=40rem){.sm\:items-center{align-items:center}}@media(width>=40rem){.sm\:justify-end{justify-content:flex-end}}@media(width>=40rem){.sm\:text-left{text-align:left}}@media(width>=48rem){.md\:block{display:block}}@media(width>=48rem){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(width>=48rem){.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(width>=48rem){.md\:flex-row{flex-direction:row}}@media(width>=48rem){.md\:text-base{font-size:var(--text-base);line-height:var(--tw-leading, var(--text-base--line-height))}}@media(width>=48rem){.md\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}}@media(width>=64rem){.lg\:col-span-2{grid-column:span 2 / span 2}}@media(width>=64rem){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(width>=64rem){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(width>=64rem){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(width>=80rem){.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}.dark\:border-input:is(.dark *){border-color:var(--input)}.dark\:bg-destructive\/60:is(.dark *){background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:bg-destructive\/60:is(.dark *){background-color:color-mix(in oklab,var(--destructive) 60%,transparent)}}.dark\:bg-input\/30:is(.dark *){background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:bg-input\/30:is(.dark *){background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:text-muted-foreground:is(.dark *){color:var(--muted-foreground)}@media(hover:hover){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:var(--accent)}@supports (color: color-mix(in lab,red,red)){.dark\:hover\:bg-accent\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--accent) 50%,transparent)}}}@media(hover:hover){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:hover\:bg-input\/50:is(.dark *):hover{background-color:color-mix(in oklab,var(--input) 50%,transparent)}}}.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:focus-visible\:ring-destructive\/40:is(.dark *):focus-visible{--tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color: var(--destructive)}@supports (color: color-mix(in lab,red,red)){.dark\:aria-invalid\:ring-destructive\/40:is(.dark *)[aria-invalid=true]{--tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent)}}.dark\:data-\[state\=active\]\:border-input:is(.dark *)[data-state=active]{border-color:var(--input)}.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:data-\[state\=active\]\:bg-input\/30:is(.dark *)[data-state=active]{background-color:color-mix(in oklab,var(--input) 30%,transparent)}}.dark\:data-\[state\=active\]\:text-foreground:is(.dark *)[data-state=active]{color:var(--foreground)}.dark\:data-\[state\=checked\]\:bg-primary:is(.dark *)[data-state=checked]{background-color:var(--primary)}.dark\:data-\[state\=checked\]\:bg-primary-foreground:is(.dark *)[data-state=checked]{background-color:var(--primary-foreground)}.dark\:data-\[state\=unchecked\]\:bg-card-foreground:is(.dark *)[data-state=unchecked]{background-color:var(--card-foreground)}.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:var(--input)}@supports (color: color-mix(in lab,red,red)){.dark\:data-\[state\=unchecked\]\:bg-input\/80:is(.dark *)[data-state=unchecked]{background-color:color-mix(in oklab,var(--input) 80%,transparent)}}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_svg\:not\(\[class\*\=\'size-\'\]\)\]\:size-4 svg:not([class*=size-]){width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.\[\&_svg\:not\(\[class\*\=\'text-\'\]\)\]\:text-muted-foreground svg:not([class*=text-]){color:var(--muted-foreground)}.\[\&_tr\]\:border-b tr{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-style:var(--tw-border-style);border-width:0}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:calc(var(--spacing) * 0)}.\[\.border-b\]\:pb-6.border-b{padding-bottom:calc(var(--spacing) * 6)}.\[\.border-t\]\:pt-6.border-t{padding-top:calc(var(--spacing) * 6)}:is(.\*\:\[span\]\:last\:flex>*):is(span):last-child{display:flex}:is(.\*\:\[span\]\:last\:items-center>*):is(span):last-child{align-items:center}:is(.\*\:\[span\]\:last\:gap-2>*):is(span):last-child{gap:calc(var(--spacing) * 2)}.\[\&\:last-child\]\:pb-6:last-child{padding-bottom:calc(var(--spacing) * 6)}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;translate:var(--tw-translate-x) var(--tw-translate-y)}.\[\&\>svg\]\:pointer-events-none>svg{pointer-events:none}.\[\&\>svg\]\:size-3>svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\[\&\>tr\]\:last\:border-b-0>tr:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media(hover:hover){a.\[a\&\]\:hover\:bg-accent:hover{background-color:var(--accent)}}@media(hover:hover){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:var(--destructive)}@supports (color: color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-destructive\/90:hover{background-color:color-mix(in oklab,var(--destructive) 90%,transparent)}}}@media(hover:hover){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:var(--primary)}@supports (color: color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,var(--primary) 90%,transparent)}}}@media(hover:hover){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:var(--secondary)}@supports (color: color-mix(in lab,red,red)){a.\[a\&\]\:hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab,var(--secondary) 90%,transparent)}}}@media(hover:hover){a.\[a\&\]\:hover\:text-accent-foreground:hover{color:var(--accent-foreground)}}}:root{--font-size: 16px;--background: #fff;--foreground: oklch(.145 0 0);--card: #fff;--card-foreground: oklch(.145 0 0);--popover: oklch(1 0 0);--popover-foreground: oklch(.145 0 0);--primary: #030213;--primary-foreground: oklch(1 0 0);--secondary: oklch(.95 .0058 264.53);--secondary-foreground: #030213;--muted: #ececf0;--muted-foreground: #717182;--accent: #e9ebef;--accent-foreground: #030213;--destructive: #d4183d;--destructive-foreground: #fff;--border: #0000001a;--input: transparent;--input-background: #f3f3f5;--switch-background: #cbced4;--font-weight-medium: 500;--font-weight-normal: 400;--ring: oklch(.708 0 0);--chart-1: oklch(.646 .222 41.116);--chart-2: oklch(.6 .118 184.704);--chart-3: oklch(.398 .07 227.392);--chart-4: oklch(.828 .189 84.429);--chart-5: oklch(.769 .188 70.08);--radius: .625rem;--sidebar: oklch(.985 0 0);--sidebar-foreground: oklch(.145 0 0);--sidebar-primary: #030213;--sidebar-primary-foreground: oklch(.985 0 0);--sidebar-accent: oklch(.97 0 0);--sidebar-accent-foreground: oklch(.205 0 0);--sidebar-border: oklch(.922 0 0);--sidebar-ring: oklch(.708 0 0)}.dark{--background: oklch(.145 0 0);--foreground: oklch(.985 0 0);--card: oklch(.145 0 0);--card-foreground: oklch(.985 0 0);--popover: oklch(.145 0 0);--popover-foreground: oklch(.985 0 0);--primary: oklch(.985 0 0);--primary-foreground: oklch(.205 0 0);--secondary: oklch(.269 0 0);--secondary-foreground: oklch(.985 0 0);--muted: oklch(.269 0 0);--muted-foreground: oklch(.708 0 0);--accent: oklch(.269 0 0);--accent-foreground: oklch(.985 0 0);--destructive: oklch(.396 .141 25.723);--destructive-foreground: oklch(.637 .237 25.331);--border: oklch(.269 0 0);--input: oklch(.269 0 0);--ring: oklch(.439 0 0);--font-weight-medium: 500;--font-weight-normal: 400;--chart-1: oklch(.488 .243 264.376);--chart-2: oklch(.696 .17 162.48);--chart-3: oklch(.769 .188 70.08);--chart-4: oklch(.627 .265 303.9);--chart-5: oklch(.645 .246 16.439);--sidebar: oklch(.205 0 0);--sidebar-foreground: oklch(.985 0 0);--sidebar-primary: oklch(.488 .243 264.376);--sidebar-primary-foreground: oklch(.985 0 0);--sidebar-accent: oklch(.269 0 0);--sidebar-accent-foreground: oklch(.985 0 0);--sidebar-border: oklch(.269 0 0);--sidebar-ring: oklch(.439 0 0)}html{font-size:var(--font-size)}@property --tw-translate-x{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-y{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-z{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-rotate-x{syntax: "*"; inherits: false; initial-value: rotateX(0);}@property --tw-rotate-y{syntax: "*"; inherits: false; initial-value: rotateY(0);}@property --tw-rotate-z{syntax: "*"; inherits: false; initial-value: rotateZ(0);}@property --tw-skew-x{syntax: "*"; inherits: false; initial-value: skewX(0);}@property --tw-skew-y{syntax: "*"; inherits: false; initial-value: skewY(0);}@property --tw-space-y-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-space-x-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-gradient-position{syntax: "*"; inherits: false}@property --tw-gradient-from{syntax: ""; inherits: false; initial-value: #0000;}@property --tw-gradient-via{syntax: ""; inherits: false; initial-value: #0000;}@property --tw-gradient-to{syntax: ""; inherits: false; initial-value: #0000;}@property --tw-gradient-stops{syntax: "*"; inherits: false}@property --tw-gradient-via-stops{syntax: "*"; inherits: false}@property --tw-gradient-from-position{syntax: ""; inherits: false; initial-value: 0%;}@property --tw-gradient-via-position{syntax: ""; inherits: false; initial-value: 50%;}@property --tw-gradient-to-position{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-leading{syntax: "*"; inherits: false}@property --tw-font-weight{syntax: "*"; inherits: false}@property --tw-tracking{syntax: "*"; inherits: false}@property --tw-ordinal{syntax: "*"; inherits: false}@property --tw-slashed-zero{syntax: "*"; inherits: false}@property --tw-numeric-figure{syntax: "*"; inherits: false}@property --tw-numeric-spacing{syntax: "*"; inherits: false}@property --tw-numeric-fraction{syntax: "*"; inherits: false}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false}@property --tw-shadow-alpha{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false}@property --tw-inset-shadow-alpha{syntax: ""; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false}@property --tw-ring-offset-width{syntax: ""; inherits: false; initial-value: 0;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-outline-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-backdrop-blur{syntax: "*"; inherits: false}@property --tw-backdrop-brightness{syntax: "*"; inherits: false}@property --tw-backdrop-contrast{syntax: "*"; inherits: false}@property --tw-backdrop-grayscale{syntax: "*"; inherits: false}@property --tw-backdrop-hue-rotate{syntax: "*"; inherits: false}@property --tw-backdrop-invert{syntax: "*"; inherits: false}@property --tw-backdrop-opacity{syntax: "*"; inherits: false}@property --tw-backdrop-saturate{syntax: "*"; inherits: false}@property --tw-backdrop-sepia{syntax: "*"; inherits: false}@property --tw-duration{syntax: "*"; inherits: false}@property --tw-ease{syntax: "*"; inherits: false}@property --tw-scale-x{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-scale-y{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-scale-z{syntax: "*"; inherits: false; initial-value: 1;}@keyframes pulse{50%{opacity:.5}}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}[data-sonner-toaster]{z-index:10000!important}@font-face{font-family:FreightSans Bold;src:url(/assets/FreightSans%20Bold-CftzBXfG.ttf) format("truetype");font-weight:700;font-style:normal;font-display:swap;unicode-range:U+0000-002F,U+003A-10FFFF}:root{--font-sans: "FreightSans Bold", ui-sans-serif, system-ui, sans-serif;--font-numeric: ui-sans-serif, system-ui, sans-serif}body{font-family:var(--font-sans)}.font-numeric{font-family:var(--font-numeric)!important} diff --git a/美国版/Food Labeling Management Platform/build/assets/index-hS5-bp4f.js b/美国版/Food Labeling Management Platform/build/assets/index-hS5-bp4f.js deleted file mode 100644 index 8296a2f..0000000 --- a/美国版/Food Labeling Management Platform/build/assets/index-hS5-bp4f.js +++ /dev/null @@ -1,453 +0,0 @@ -function tz(e,t){for(var r=0;rn[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var xf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ry={exports:{}},pc={},ny={exports:{}},tt={};/** - * @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 KC;function rz(){if(KC)return tt;KC=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(I){return I===null||typeof I!="object"?null:(I=p&&I[p]||I["@@iterator"],typeof I=="function"?I:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,y={};function S(I,D,Z){this.props=I,this.context=D,this.refs=y,this.updater=Z||v}S.prototype.isReactComponent={},S.prototype.setState=function(I,D){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,D,"setState")},S.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function _(){}_.prototype=S.prototype;function N(I,D,Z){this.props=I,this.context=D,this.refs=y,this.updater=Z||v}var O=N.prototype=new _;O.constructor=N,x(O,S.prototype),O.isPureReactComponent=!0;var A=Array.isArray,C=Object.prototype.hasOwnProperty,E={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function R(I,D,Z){var ie,oe={},ne=null,K=null;if(D!=null)for(ie in D.ref!==void 0&&(K=D.ref),D.key!==void 0&&(ne=""+D.key),D)C.call(D,ie)&&!T.hasOwnProperty(ie)&&(oe[ie]=D[ie]);var J=arguments.length-2;if(J===1)oe.children=Z;else if(1>>1,D=$[I];if(0>>1;Ia(oe,k))nea(K,oe)?($[I]=K,$[ne]=k,I=ne):($[I]=oe,$[ie]=k,I=ie);else if(nea(K,k))$[I]=K,$[ne]=k,I=ne;else break e}}return Q}function a($,Q){var k=$.sortIndex-Q.sortIndex;return k!==0?k:$.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var d=[],c=[],h=1,p=null,m=3,v=!1,x=!1,y=!1,S=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O($){for(var Q=r(c);Q!==null;){if(Q.callback===null)n(c);else if(Q.startTime<=$)n(c),Q.sortIndex=Q.expirationTime,t(d,Q);else break;Q=r(c)}}function A($){if(y=!1,O($),!x)if(r(d)!==null)x=!0,G(C);else{var Q=r(c);Q!==null&&U(A,Q.startTime-$)}}function C($,Q){x=!1,y&&(y=!1,_(R),R=-1),v=!0;var k=m;try{for(O(Q),p=r(d);p!==null&&(!(p.expirationTime>Q)||$&&!F());){var I=p.callback;if(typeof I=="function"){p.callback=null,m=p.priorityLevel;var D=I(p.expirationTime<=Q);Q=e.unstable_now(),typeof D=="function"?p.callback=D:p===r(d)&&n(d),O(Q)}else n(d);p=r(d)}if(p!==null)var Z=!0;else{var ie=r(c);ie!==null&&U(A,ie.startTime-Q),Z=!1}return Z}finally{p=null,m=k,v=!1}}var E=!1,T=null,R=-1,L=5,z=-1;function F(){return!(e.unstable_now()-z$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<$?Math.floor(1e3/$):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(d)},e.unstable_next=function($){switch(m){case 1:case 2:case 3:var Q=3;break;default:Q=m}var k=m;m=Q;try{return $()}finally{m=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function($,Q){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var k=m;m=$;try{return Q()}finally{m=k}},e.unstable_scheduleCallback=function($,Q,k){var I=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0I?($.sortIndex=k,t(c,$),r(d)===null&&$===r(c)&&(y?(_(R),R=-1):y=!0,U(A,k-I))):($.sortIndex=D,t(d,$),x||v||(x=!0,G(C))),$},e.unstable_shouldYield=F,e.unstable_wrapCallback=function($){var Q=m;return function(){var k=m;m=Q;try{return $.apply(this,arguments)}finally{m=k}}}})(oy)),oy}var ZC;function oz(){return ZC||(ZC=1,iy.exports=iz()),iy.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 eO;function sz(){if(eO)return Mr;eO=1;var e=Gp(),t=oz();function r(s){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+s,g=1;g"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,c=/^[: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]*$/,h={},p={};function m(s){return d.call(p,s)?!0:d.call(h,s)?!1:c.test(s)?p[s]=!0:(h[s]=!0,!1)}function v(s,f,g,w){if(g!==null&&g.type===0)return!1;switch(typeof f){case"function":case"symbol":return!0;case"boolean":return w?!1:g!==null?!g.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function x(s,f,g,w){if(f===null||typeof f>"u"||v(s,f,g,w))return!0;if(w)return!1;if(g!==null)switch(g.type){case 3:return!f;case 4:return f===!1;case 5:return isNaN(f);case 6:return isNaN(f)||1>f}return!1}function y(s,f,g,w,j,P,M){this.acceptsBooleans=f===2||f===3||f===4,this.attributeName=w,this.attributeNamespace=j,this.mustUseProperty=g,this.propertyName=s,this.type=f,this.sanitizeURL=P,this.removeEmptyString=M}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){S[s]=new y(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var f=s[0];S[f]=new y(f,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){S[s]=new y(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){S[s]=new y(s,2,!1,s,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(s){S[s]=new y(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){S[s]=new y(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){S[s]=new y(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){S[s]=new y(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){S[s]=new y(s,5,!1,s.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function N(s){return s[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(s){var f=s.replace(_,N);S[f]=new y(f,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var f=s.replace(_,N);S[f]=new y(f,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var f=s.replace(_,N);S[f]=new y(f,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){S[s]=new y(s,1,!1,s.toLowerCase(),null,!1,!1)}),S.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){S[s]=new y(s,1,!1,s.toLowerCase(),null,!0,!0)});function O(s,f,g,w){var j=S.hasOwnProperty(f)?S[f]:null;(j!==null?j.type!==0:w||!(2Y||j[M]!==P[Y]){var te=` -`+j[M].replace(" at new "," at ");return s.displayName&&te.includes("")&&(te=te.replace("",s.displayName)),te}while(1<=M&&0<=Y);break}}}finally{Z=!1,Error.prepareStackTrace=g}return(s=s?s.displayName||s.name:"")?D(s):""}function oe(s){switch(s.tag){case 5:return D(s.type);case 16:return D("Lazy");case 13:return D("Suspense");case 19:return D("SuspenseList");case 0:case 2:case 15:return s=ie(s.type,!1),s;case 11:return s=ie(s.type.render,!1),s;case 1:return s=ie(s.type,!0),s;default:return""}}function ne(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case T:return"Fragment";case E:return"Portal";case L:return"Profiler";case R:return"StrictMode";case q:return"Suspense";case H:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case F:return(s.displayName||"Context")+".Consumer";case z:return(s._context.displayName||"Context")+".Provider";case B:var f=s.render;return s=s.displayName,s||(s=f.displayName||f.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case V:return f=s.displayName||null,f!==null?f:ne(s.type)||"Memo";case G:f=s._payload,s=s._init;try{return ne(s(f))}catch{}}return null}function K(s){var f=s.type;switch(s.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=f.render,s=s.displayName||s.name||"",f.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ne(f);case 8:return f===R?"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 f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function J(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function ee(s){var f=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function ce(s){var f=ee(s)?"checked":"value",g=Object.getOwnPropertyDescriptor(s.constructor.prototype,f),w=""+s[f];if(!s.hasOwnProperty(f)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var j=g.get,P=g.set;return Object.defineProperty(s,f,{configurable:!0,get:function(){return j.call(this)},set:function(M){w=""+M,P.call(this,M)}}),Object.defineProperty(s,f,{enumerable:g.enumerable}),{getValue:function(){return w},setValue:function(M){w=""+M},stopTracking:function(){s._valueTracker=null,delete s[f]}}}}function pe(s){s._valueTracker||(s._valueTracker=ce(s))}function W(s){if(!s)return!1;var f=s._valueTracker;if(!f)return!0;var g=f.getValue(),w="";return s&&(w=ee(s)?s.checked?"true":"false":s.value),s=w,s!==g?(f.setValue(s),!0):!1}function _e(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Ce(s,f){var g=f.checked;return k({},f,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:g??s._wrapperState.initialChecked})}function qe(s,f){var g=f.defaultValue==null?"":f.defaultValue,w=f.checked!=null?f.checked:f.defaultChecked;g=J(f.value!=null?f.value:g),s._wrapperState={initialChecked:w,initialValue:g,controlled:f.type==="checkbox"||f.type==="radio"?f.checked!=null:f.value!=null}}function De(s,f){f=f.checked,f!=null&&O(s,"checked",f,!1)}function nt(s,f){De(s,f);var g=J(f.value),w=f.type;if(g!=null)w==="number"?(g===0&&s.value===""||s.value!=g)&&(s.value=""+g):s.value!==""+g&&(s.value=""+g);else if(w==="submit"||w==="reset"){s.removeAttribute("value");return}f.hasOwnProperty("value")?Ut(s,f.type,g):f.hasOwnProperty("defaultValue")&&Ut(s,f.type,J(f.defaultValue)),f.checked==null&&f.defaultChecked!=null&&(s.defaultChecked=!!f.defaultChecked)}function kt(s,f,g){if(f.hasOwnProperty("value")||f.hasOwnProperty("defaultValue")){var w=f.type;if(!(w!=="submit"&&w!=="reset"||f.value!==void 0&&f.value!==null))return;f=""+s._wrapperState.initialValue,g||f===s.value||(s.value=f),s.defaultValue=f}g=s.name,g!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,g!==""&&(s.name=g)}function Ut(s,f,g){(f!=="number"||_e(s.ownerDocument)!==s)&&(g==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+g&&(s.defaultValue=""+g))}var lr=Array.isArray;function Rt(s,f,g,w){if(s=s.options,f){f={};for(var j=0;j"+f.valueOf().toString()+"",f=Do.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;f.firstChild;)s.appendChild(f.firstChild)}});function Li(s,f){if(f){var g=s.firstChild;if(g&&g===s.lastChild&&g.nodeType===3){g.nodeValue=f;return}}s.textContent=f}var xa={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},mg=["Webkit","ms","Moz","O"];Object.keys(xa).forEach(function(s){mg.forEach(function(f){f=f+s.charAt(0).toUpperCase()+s.substring(1),xa[f]=xa[s]})});function cd(s,f,g){return f==null||typeof f=="boolean"||f===""?"":g||typeof f!="number"||f===0||xa.hasOwnProperty(s)&&xa[s]?(""+f).trim():f+"px"}function ud(s,f){s=s.style;for(var g in f)if(f.hasOwnProperty(g)){var w=g.indexOf("--")===0,j=cd(g,f[g],w);g==="float"&&(g="cssFloat"),w?s.setProperty(g,j):s[g]=j}}var gg=k({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 we(s,f){if(f){if(gg[s]&&(f.children!=null||f.dangerouslySetInnerHTML!=null))throw Error(r(137,s));if(f.dangerouslySetInnerHTML!=null){if(f.children!=null)throw Error(r(60));if(typeof f.dangerouslySetInnerHTML!="object"||!("__html"in f.dangerouslySetInnerHTML))throw Error(r(61))}if(f.style!=null&&typeof f.style!="object")throw Error(r(62))}}function ht(s,f){if(s.indexOf("-")===-1)return typeof f.is=="string";switch(s){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 cr=null;function vg(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var yg=null,Lo=null,$o=null;function d_(s){if(s=Zl(s)){if(typeof yg!="function")throw Error(r(280));var f=s.stateNode;f&&(f=Rd(f),yg(s.stateNode,s.type,f))}}function f_(s){Lo?$o?$o.push(s):$o=[s]:Lo=s}function h_(){if(Lo){var s=Lo,f=$o;if($o=Lo=null,d_(s),f)for(s=0;s>>=0,s===0?32:31-(vB(s)/yB|0)|0}var md=64,gd=4194304;function Ml(s){switch(s&-s){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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function vd(s,f){var g=s.pendingLanes;if(g===0)return 0;var w=0,j=s.suspendedLanes,P=s.pingedLanes,M=g&268435455;if(M!==0){var Y=M&~j;Y!==0?w=Ml(Y):(P&=M,P!==0&&(w=Ml(P)))}else M=g&~j,M!==0?w=Ml(M):P!==0&&(w=Ml(P));if(w===0)return 0;if(f!==0&&f!==w&&(f&j)===0&&(j=w&-w,P=f&-f,j>=P||j===16&&(P&4194240)!==0))return f;if((w&4)!==0&&(w|=g&16),f=s.entangledLanes,f!==0)for(s=s.entanglements,f&=w;0g;g++)f.push(s);return f}function Dl(s,f,g){s.pendingLanes|=f,f!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,f=31-Cn(f),s[f]=g}function SB(s,f){var g=s.pendingLanes&~f;s.pendingLanes=f,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=f,s.mutableReadLanes&=f,s.entangledLanes&=f,f=s.entanglements;var w=s.eventTimes;for(s=s.expirationTimes;0=Vl),z_=" ",q_=!1;function U_(s,f){switch(s){case"keyup":return YB.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function V_(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var zo=!1;function QB(s,f){switch(s){case"compositionend":return V_(f);case"keypress":return f.which!==32?null:(q_=!0,z_);case"textInput":return s=f.data,s===z_&&q_?null:s;default:return null}}function ZB(s,f){if(zo)return s==="compositionend"||!Dg&&U_(s,f)?(s=M_(),Sd=Ag=Za=null,zo=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1=f)return{node:g,offset:f-s};s=w}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=J_(g)}}function Z_(s,f){return s&&f?s===f?!0:s&&s.nodeType===3?!1:f&&f.nodeType===3?Z_(s,f.parentNode):"contains"in s?s.contains(f):s.compareDocumentPosition?!!(s.compareDocumentPosition(f)&16):!1:!1}function eN(){for(var s=window,f=_e();f instanceof s.HTMLIFrameElement;){try{var g=typeof f.contentWindow.location.href=="string"}catch{g=!1}if(g)s=f.contentWindow;else break;f=_e(s.document)}return f}function Bg(s){var f=s&&s.nodeName&&s.nodeName.toLowerCase();return f&&(f==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||f==="textarea"||s.contentEditable==="true")}function lF(s){var f=eN(),g=s.focusedElem,w=s.selectionRange;if(f!==g&&g&&g.ownerDocument&&Z_(g.ownerDocument.documentElement,g)){if(w!==null&&Bg(g)){if(f=w.start,s=w.end,s===void 0&&(s=f),"selectionStart"in g)g.selectionStart=f,g.selectionEnd=Math.min(s,g.value.length);else if(s=(f=g.ownerDocument||document)&&f.defaultView||window,s.getSelection){s=s.getSelection();var j=g.textContent.length,P=Math.min(w.start,j);w=w.end===void 0?P:Math.min(w.end,j),!s.extend&&P>w&&(j=w,w=P,P=j),j=Q_(g,P);var M=Q_(g,w);j&&M&&(s.rangeCount!==1||s.anchorNode!==j.node||s.anchorOffset!==j.offset||s.focusNode!==M.node||s.focusOffset!==M.offset)&&(f=f.createRange(),f.setStart(j.node,j.offset),s.removeAllRanges(),P>w?(s.addRange(f),s.extend(M.node,M.offset)):(f.setEnd(M.node,M.offset),s.addRange(f)))}}for(f=[],s=g;s=s.parentNode;)s.nodeType===1&&f.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g=document.documentMode,qo=null,Fg=null,Kl=null,zg=!1;function tN(s,f,g){var w=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;zg||qo==null||qo!==_e(w)||(w=qo,"selectionStart"in w&&Bg(w)?w={start:w.selectionStart,end:w.selectionEnd}:(w=(w.ownerDocument&&w.ownerDocument.defaultView||window).getSelection(),w={anchorNode:w.anchorNode,anchorOffset:w.anchorOffset,focusNode:w.focusNode,focusOffset:w.focusOffset}),Kl&&Gl(Kl,w)||(Kl=w,w=Ad(Fg,"onSelect"),0Go||(s.current=Zg[Go],Zg[Go]=null,Go--)}function wt(s,f){Go++,Zg[Go]=s.current,s.current=f}var ni={},hr=ri(ni),Ar=ri(!1),Fi=ni;function Ko(s,f){var g=s.type.contextTypes;if(!g)return ni;var w=s.stateNode;if(w&&w.__reactInternalMemoizedUnmaskedChildContext===f)return w.__reactInternalMemoizedMaskedChildContext;var j={},P;for(P in g)j[P]=f[P];return w&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=f,s.__reactInternalMemoizedMaskedChildContext=j),j}function Tr(s){return s=s.childContextTypes,s!=null}function Id(){Ot(Ar),Ot(hr)}function gN(s,f,g){if(hr.current!==ni)throw Error(r(168));wt(hr,f),wt(Ar,g)}function vN(s,f,g){var w=s.stateNode;if(f=f.childContextTypes,typeof w.getChildContext!="function")return g;w=w.getChildContext();for(var j in w)if(!(j in f))throw Error(r(108,K(s)||"Unknown",j));return k({},g,w)}function Md(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||ni,Fi=hr.current,wt(hr,s),wt(Ar,Ar.current),!0}function yN(s,f,g){var w=s.stateNode;if(!w)throw Error(r(169));g?(s=vN(s,f,Fi),w.__reactInternalMemoizedMergedChildContext=s,Ot(Ar),Ot(hr),wt(hr,s)):Ot(Ar),wt(Ar,g)}var wa=null,Dd=!1,ev=!1;function xN(s){wa===null?wa=[s]:wa.push(s)}function bF(s){Dd=!0,xN(s)}function ai(){if(!ev&&wa!==null){ev=!0;var s=0,f=pt;try{var g=wa;for(pt=1;s>=M,j-=M,Sa=1<<32-Cn(f)+j|g<Ve?(ar=$e,$e=null):ar=$e.sibling;var ot=ge(ae,$e,se[Ve],Se);if(ot===null){$e===null&&($e=ar);break}s&&$e&&ot.alternate===null&&f(ae,$e),re=P(ot,re,Ve),Le===null?Me=ot:Le.sibling=ot,Le=ot,$e=ar}if(Ve===se.length)return g(ae,$e),Pt&&qi(ae,Ve),Me;if($e===null){for(;VeVe?(ar=$e,$e=null):ar=$e.sibling;var hi=ge(ae,$e,ot.value,Se);if(hi===null){$e===null&&($e=ar);break}s&&$e&&hi.alternate===null&&f(ae,$e),re=P(hi,re,Ve),Le===null?Me=hi:Le.sibling=hi,Le=hi,$e=ar}if(ot.done)return g(ae,$e),Pt&&qi(ae,Ve),Me;if($e===null){for(;!ot.done;Ve++,ot=se.next())ot=be(ae,ot.value,Se),ot!==null&&(re=P(ot,re,Ve),Le===null?Me=ot:Le.sibling=ot,Le=ot);return Pt&&qi(ae,Ve),Me}for($e=w(ae,$e);!ot.done;Ve++,ot=se.next())ot=Oe($e,ae,Ve,ot.value,Se),ot!==null&&(s&&ot.alternate!==null&&$e.delete(ot.key===null?Ve:ot.key),re=P(ot,re,Ve),Le===null?Me=ot:Le.sibling=ot,Le=ot);return s&&$e.forEach(function(ez){return f(ae,ez)}),Pt&&qi(ae,Ve),Me}function zt(ae,re,se,Se){if(typeof se=="object"&&se!==null&&se.type===T&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case C:e:{for(var Me=se.key,Le=re;Le!==null;){if(Le.key===Me){if(Me=se.type,Me===T){if(Le.tag===7){g(ae,Le.sibling),re=j(Le,se.props.children),re.return=ae,ae=re;break e}}else if(Le.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===G&&NN(Me)===Le.type){g(ae,Le.sibling),re=j(Le,se.props),re.ref=ec(ae,Le,se),re.return=ae,ae=re;break e}g(ae,Le);break}else f(ae,Le);Le=Le.sibling}se.type===T?(re=Yi(se.props.children,ae.mode,Se,se.key),re.return=ae,ae=re):(Se=df(se.type,se.key,se.props,null,ae.mode,Se),Se.ref=ec(ae,re,se),Se.return=ae,ae=Se)}return M(ae);case E:e:{for(Le=se.key;re!==null;){if(re.key===Le)if(re.tag===4&&re.stateNode.containerInfo===se.containerInfo&&re.stateNode.implementation===se.implementation){g(ae,re.sibling),re=j(re,se.children||[]),re.return=ae,ae=re;break e}else{g(ae,re);break}else f(ae,re);re=re.sibling}re=Jv(se,ae.mode,Se),re.return=ae,ae=re}return M(ae);case G:return Le=se._init,zt(ae,re,Le(se._payload),Se)}if(lr(se))return Te(ae,re,se,Se);if(Q(se))return Ie(ae,re,se,Se);Fd(ae,se)}return typeof se=="string"&&se!==""||typeof se=="number"?(se=""+se,re!==null&&re.tag===6?(g(ae,re.sibling),re=j(re,se),re.return=ae,ae=re):(g(ae,re),re=Yv(se,ae.mode,Se),re.return=ae,ae=re),M(ae)):g(ae,re)}return zt}var Qo=CN(!0),ON=CN(!1),zd=ri(null),qd=null,Zo=null,ov=null;function sv(){ov=Zo=qd=null}function lv(s){var f=zd.current;Ot(zd),s._currentValue=f}function cv(s,f,g){for(;s!==null;){var w=s.alternate;if((s.childLanes&f)!==f?(s.childLanes|=f,w!==null&&(w.childLanes|=f)):w!==null&&(w.childLanes&f)!==f&&(w.childLanes|=f),s===g)break;s=s.return}}function es(s,f){qd=s,ov=Zo=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&f)!==0&&(kr=!0),s.firstContext=null)}function cn(s){var f=s._currentValue;if(ov!==s)if(s={context:s,memoizedValue:f,next:null},Zo===null){if(qd===null)throw Error(r(308));Zo=s,qd.dependencies={lanes:0,firstContext:s}}else Zo=Zo.next=s;return f}var Ui=null;function uv(s){Ui===null?Ui=[s]:Ui.push(s)}function EN(s,f,g,w){var j=f.interleaved;return j===null?(g.next=g,uv(f)):(g.next=j.next,j.next=g),f.interleaved=g,_a(s,w)}function _a(s,f){s.lanes|=f;var g=s.alternate;for(g!==null&&(g.lanes|=f),g=s,s=s.return;s!==null;)s.childLanes|=f,g=s.alternate,g!==null&&(g.childLanes|=f),g=s,s=s.return;return g.tag===3?g.stateNode:null}var ii=!1;function dv(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function PN(s,f){s=s.updateQueue,f.updateQueue===s&&(f.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function Na(s,f){return{eventTime:s,lane:f,tag:0,payload:null,callback:null,next:null}}function oi(s,f,g){var w=s.updateQueue;if(w===null)return null;if(w=w.shared,(it&2)!==0){var j=w.pending;return j===null?f.next=f:(f.next=j.next,j.next=f),w.pending=f,_a(s,g)}return j=w.interleaved,j===null?(f.next=f,uv(w)):(f.next=j.next,j.next=f),w.interleaved=f,_a(s,g)}function Ud(s,f,g){if(f=f.updateQueue,f!==null&&(f=f.shared,(g&4194240)!==0)){var w=f.lanes;w&=s.pendingLanes,g|=w,f.lanes=g,Ng(s,g)}}function AN(s,f){var g=s.updateQueue,w=s.alternate;if(w!==null&&(w=w.updateQueue,g===w)){var j=null,P=null;if(g=g.firstBaseUpdate,g!==null){do{var M={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};P===null?j=P=M:P=P.next=M,g=g.next}while(g!==null);P===null?j=P=f:P=P.next=f}else j=P=f;g={baseState:w.baseState,firstBaseUpdate:j,lastBaseUpdate:P,shared:w.shared,effects:w.effects},s.updateQueue=g;return}s=g.lastBaseUpdate,s===null?g.firstBaseUpdate=f:s.next=f,g.lastBaseUpdate=f}function Vd(s,f,g,w){var j=s.updateQueue;ii=!1;var P=j.firstBaseUpdate,M=j.lastBaseUpdate,Y=j.shared.pending;if(Y!==null){j.shared.pending=null;var te=Y,le=te.next;te.next=null,M===null?P=le:M.next=le,M=te;var ye=s.alternate;ye!==null&&(ye=ye.updateQueue,Y=ye.lastBaseUpdate,Y!==M&&(Y===null?ye.firstBaseUpdate=le:Y.next=le,ye.lastBaseUpdate=te))}if(P!==null){var be=j.baseState;M=0,ye=le=te=null,Y=P;do{var ge=Y.lane,Oe=Y.eventTime;if((w&ge)===ge){ye!==null&&(ye=ye.next={eventTime:Oe,lane:0,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null});e:{var Te=s,Ie=Y;switch(ge=f,Oe=g,Ie.tag){case 1:if(Te=Ie.payload,typeof Te=="function"){be=Te.call(Oe,be,ge);break e}be=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Ie.payload,ge=typeof Te=="function"?Te.call(Oe,be,ge):Te,ge==null)break e;be=k({},be,ge);break e;case 2:ii=!0}}Y.callback!==null&&Y.lane!==0&&(s.flags|=64,ge=j.effects,ge===null?j.effects=[Y]:ge.push(Y))}else Oe={eventTime:Oe,lane:ge,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},ye===null?(le=ye=Oe,te=be):ye=ye.next=Oe,M|=ge;if(Y=Y.next,Y===null){if(Y=j.shared.pending,Y===null)break;ge=Y,Y=ge.next,ge.next=null,j.lastBaseUpdate=ge,j.shared.pending=null}}while(!0);if(ye===null&&(te=be),j.baseState=te,j.firstBaseUpdate=le,j.lastBaseUpdate=ye,f=j.shared.interleaved,f!==null){j=f;do M|=j.lane,j=j.next;while(j!==f)}else P===null&&(j.shared.lanes=0);Wi|=M,s.lanes=M,s.memoizedState=be}}function TN(s,f,g){if(s=f.effects,f.effects=null,s!==null)for(f=0;fg?g:4,s(!0);var w=gv.transition;gv.transition={};try{s(!1),f()}finally{pt=g,gv.transition=w}}function YN(){return un().memoizedState}function _F(s,f,g){var w=ui(s);if(g={lane:w,action:g,hasEagerState:!1,eagerState:null,next:null},JN(s))QN(f,g);else if(g=EN(s,f,g,w),g!==null){var j=wr();kn(g,s,w,j),ZN(g,f,w)}}function NF(s,f,g){var w=ui(s),j={lane:w,action:g,hasEagerState:!1,eagerState:null,next:null};if(JN(s))QN(f,j);else{var P=s.alternate;if(s.lanes===0&&(P===null||P.lanes===0)&&(P=f.lastRenderedReducer,P!==null))try{var M=f.lastRenderedState,Y=P(M,g);if(j.hasEagerState=!0,j.eagerState=Y,On(Y,M)){var te=f.interleaved;te===null?(j.next=j,uv(f)):(j.next=te.next,te.next=j),f.interleaved=j;return}}catch{}finally{}g=EN(s,f,j,w),g!==null&&(j=wr(),kn(g,s,w,j),ZN(g,f,w))}}function JN(s){var f=s.alternate;return s===Mt||f!==null&&f===Mt}function QN(s,f){ac=Gd=!0;var g=s.pending;g===null?f.next=f:(f.next=g.next,g.next=f),s.pending=f}function ZN(s,f,g){if((g&4194240)!==0){var w=f.lanes;w&=s.pendingLanes,g|=w,f.lanes=g,Ng(s,g)}}var Yd={readContext:cn,useCallback:pr,useContext:pr,useEffect:pr,useImperativeHandle:pr,useInsertionEffect:pr,useLayoutEffect:pr,useMemo:pr,useReducer:pr,useRef:pr,useState:pr,useDebugValue:pr,useDeferredValue:pr,useTransition:pr,useMutableSource:pr,useSyncExternalStore:pr,useId:pr,unstable_isNewReconciler:!1},CF={readContext:cn,useCallback:function(s,f){return Qn().memoizedState=[s,f===void 0?null:f],s},useContext:cn,useEffect:qN,useImperativeHandle:function(s,f,g){return g=g!=null?g.concat([s]):null,Kd(4194308,4,HN.bind(null,f,s),g)},useLayoutEffect:function(s,f){return Kd(4194308,4,s,f)},useInsertionEffect:function(s,f){return Kd(4,2,s,f)},useMemo:function(s,f){var g=Qn();return f=f===void 0?null:f,s=s(),g.memoizedState=[s,f],s},useReducer:function(s,f,g){var w=Qn();return f=g!==void 0?g(f):f,w.memoizedState=w.baseState=f,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:f},w.queue=s,s=s.dispatch=_F.bind(null,Mt,s),[w.memoizedState,s]},useRef:function(s){var f=Qn();return s={current:s},f.memoizedState=s},useState:FN,useDebugValue:jv,useDeferredValue:function(s){return Qn().memoizedState=s},useTransition:function(){var s=FN(!1),f=s[0];return s=jF.bind(null,s[1]),Qn().memoizedState=s,[f,s]},useMutableSource:function(){},useSyncExternalStore:function(s,f,g){var w=Mt,j=Qn();if(Pt){if(g===void 0)throw Error(r(407));g=g()}else{if(g=f(),nr===null)throw Error(r(349));(Hi&30)!==0||MN(w,f,g)}j.memoizedState=g;var P={value:g,getSnapshot:f};return j.queue=P,qN(LN.bind(null,w,P,s),[s]),w.flags|=2048,sc(9,DN.bind(null,w,P,g,f),void 0,null),g},useId:function(){var s=Qn(),f=nr.identifierPrefix;if(Pt){var g=ja,w=Sa;g=(w&~(1<<32-Cn(w)-1)).toString(32)+g,f=":"+f+"R"+g,g=ic++,0<\/script>",s=s.removeChild(s.firstChild)):typeof w.is=="string"?s=M.createElement(g,{is:w.is}):(s=M.createElement(g),g==="select"&&(M=s,w.multiple?M.multiple=!0:w.size&&(M.size=w.size))):s=M.createElementNS(s,g),s[Yn]=f,s[Ql]=w,xC(s,f,!1,!1),f.stateNode=s;e:{switch(M=ht(g,w),g){case"dialog":Ct("cancel",s),Ct("close",s),j=w;break;case"iframe":case"object":case"embed":Ct("load",s),j=w;break;case"video":case"audio":for(j=0;jis&&(f.flags|=128,w=!0,lc(P,!1),f.lanes=4194304)}else{if(!w)if(s=Hd(M),s!==null){if(f.flags|=128,w=!0,g=s.updateQueue,g!==null&&(f.updateQueue=g,f.flags|=4),lc(P,!0),P.tail===null&&P.tailMode==="hidden"&&!M.alternate&&!Pt)return mr(f),null}else 2*Ft()-P.renderingStartTime>is&&g!==1073741824&&(f.flags|=128,w=!0,lc(P,!1),f.lanes=4194304);P.isBackwards?(M.sibling=f.child,f.child=M):(g=P.last,g!==null?g.sibling=M:f.child=M,P.last=M)}return P.tail!==null?(f=P.tail,P.rendering=f,P.tail=f.sibling,P.renderingStartTime=Ft(),f.sibling=null,g=It.current,wt(It,w?g&1|2:g&1),f):(mr(f),null);case 22:case 23:return Gv(),w=f.memoizedState!==null,s!==null&&s.memoizedState!==null!==w&&(f.flags|=8192),w&&(f.mode&1)!==0?(Ur&1073741824)!==0&&(mr(f),f.subtreeFlags&6&&(f.flags|=8192)):mr(f),null;case 24:return null;case 25:return null}throw Error(r(156,f.tag))}function IF(s,f){switch(rv(f),f.tag){case 1:return Tr(f.type)&&Id(),s=f.flags,s&65536?(f.flags=s&-65537|128,f):null;case 3:return ts(),Ot(Ar),Ot(hr),mv(),s=f.flags,(s&65536)!==0&&(s&128)===0?(f.flags=s&-65537|128,f):null;case 5:return hv(f),null;case 13:if(Ot(It),s=f.memoizedState,s!==null&&s.dehydrated!==null){if(f.alternate===null)throw Error(r(340));Jo()}return s=f.flags,s&65536?(f.flags=s&-65537|128,f):null;case 19:return Ot(It),null;case 4:return ts(),null;case 10:return lv(f.type._context),null;case 22:case 23:return Gv(),null;case 24:return null;default:return null}}var ef=!1,gr=!1,MF=typeof WeakSet=="function"?WeakSet:Set,Ee=null;function ns(s,f){var g=s.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(w){Dt(s,f,w)}else g.current=null}function Mv(s,f,g){try{g()}catch(w){Dt(s,f,w)}}var SC=!1;function DF(s,f){if(Gg=bd,s=eN(),Bg(s)){if("selectionStart"in s)var g={start:s.selectionStart,end:s.selectionEnd};else e:{g=(g=s.ownerDocument)&&g.defaultView||window;var w=g.getSelection&&g.getSelection();if(w&&w.rangeCount!==0){g=w.anchorNode;var j=w.anchorOffset,P=w.focusNode;w=w.focusOffset;try{g.nodeType,P.nodeType}catch{g=null;break e}var M=0,Y=-1,te=-1,le=0,ye=0,be=s,ge=null;t:for(;;){for(var Oe;be!==g||j!==0&&be.nodeType!==3||(Y=M+j),be!==P||w!==0&&be.nodeType!==3||(te=M+w),be.nodeType===3&&(M+=be.nodeValue.length),(Oe=be.firstChild)!==null;)ge=be,be=Oe;for(;;){if(be===s)break t;if(ge===g&&++le===j&&(Y=M),ge===P&&++ye===w&&(te=M),(Oe=be.nextSibling)!==null)break;be=ge,ge=be.parentNode}be=Oe}g=Y===-1||te===-1?null:{start:Y,end:te}}else g=null}g=g||{start:0,end:0}}else g=null;for(Kg={focusedElem:s,selectionRange:g},bd=!1,Ee=f;Ee!==null;)if(f=Ee,s=f.child,(f.subtreeFlags&1028)!==0&&s!==null)s.return=f,Ee=s;else for(;Ee!==null;){f=Ee;try{var Te=f.alternate;if((f.flags&1024)!==0)switch(f.tag){case 0:case 11:case 15:break;case 1:if(Te!==null){var Ie=Te.memoizedProps,zt=Te.memoizedState,ae=f.stateNode,re=ae.getSnapshotBeforeUpdate(f.elementType===f.type?Ie:Pn(f.type,Ie),zt);ae.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var se=f.stateNode.containerInfo;se.nodeType===1?se.textContent="":se.nodeType===9&&se.documentElement&&se.removeChild(se.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Se){Dt(f,f.return,Se)}if(s=f.sibling,s!==null){s.return=f.return,Ee=s;break}Ee=f.return}return Te=SC,SC=!1,Te}function cc(s,f,g){var w=f.updateQueue;if(w=w!==null?w.lastEffect:null,w!==null){var j=w=w.next;do{if((j.tag&s)===s){var P=j.destroy;j.destroy=void 0,P!==void 0&&Mv(f,g,P)}j=j.next}while(j!==w)}}function tf(s,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&s)===s){var w=g.create;g.destroy=w()}g=g.next}while(g!==f)}}function Dv(s){var f=s.ref;if(f!==null){var g=s.stateNode;switch(s.tag){case 5:s=g;break;default:s=g}typeof f=="function"?f(s):f.current=s}}function jC(s){var f=s.alternate;f!==null&&(s.alternate=null,jC(f)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(f=s.stateNode,f!==null&&(delete f[Yn],delete f[Ql],delete f[Qg],delete f[yF],delete f[xF])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function _C(s){return s.tag===5||s.tag===3||s.tag===4}function NC(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||_C(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Lv(s,f,g){var w=s.tag;if(w===5||w===6)s=s.stateNode,f?g.nodeType===8?g.parentNode.insertBefore(s,f):g.insertBefore(s,f):(g.nodeType===8?(f=g.parentNode,f.insertBefore(s,g)):(f=g,f.appendChild(s)),g=g._reactRootContainer,g!=null||f.onclick!==null||(f.onclick=kd));else if(w!==4&&(s=s.child,s!==null))for(Lv(s,f,g),s=s.sibling;s!==null;)Lv(s,f,g),s=s.sibling}function $v(s,f,g){var w=s.tag;if(w===5||w===6)s=s.stateNode,f?g.insertBefore(s,f):g.appendChild(s);else if(w!==4&&(s=s.child,s!==null))for($v(s,f,g),s=s.sibling;s!==null;)$v(s,f,g),s=s.sibling}var ur=null,An=!1;function si(s,f,g){for(g=g.child;g!==null;)CC(s,f,g),g=g.sibling}function CC(s,f,g){if(Xn&&typeof Xn.onCommitFiberUnmount=="function")try{Xn.onCommitFiberUnmount(pd,g)}catch{}switch(g.tag){case 5:gr||ns(g,f);case 6:var w=ur,j=An;ur=null,si(s,f,g),ur=w,An=j,ur!==null&&(An?(s=ur,g=g.stateNode,s.nodeType===8?s.parentNode.removeChild(g):s.removeChild(g)):ur.removeChild(g.stateNode));break;case 18:ur!==null&&(An?(s=ur,g=g.stateNode,s.nodeType===8?Jg(s.parentNode,g):s.nodeType===1&&Jg(s,g),zl(s)):Jg(ur,g.stateNode));break;case 4:w=ur,j=An,ur=g.stateNode.containerInfo,An=!0,si(s,f,g),ur=w,An=j;break;case 0:case 11:case 14:case 15:if(!gr&&(w=g.updateQueue,w!==null&&(w=w.lastEffect,w!==null))){j=w=w.next;do{var P=j,M=P.destroy;P=P.tag,M!==void 0&&((P&2)!==0||(P&4)!==0)&&Mv(g,f,M),j=j.next}while(j!==w)}si(s,f,g);break;case 1:if(!gr&&(ns(g,f),w=g.stateNode,typeof w.componentWillUnmount=="function"))try{w.props=g.memoizedProps,w.state=g.memoizedState,w.componentWillUnmount()}catch(Y){Dt(g,f,Y)}si(s,f,g);break;case 21:si(s,f,g);break;case 22:g.mode&1?(gr=(w=gr)||g.memoizedState!==null,si(s,f,g),gr=w):si(s,f,g);break;default:si(s,f,g)}}function OC(s){var f=s.updateQueue;if(f!==null){s.updateQueue=null;var g=s.stateNode;g===null&&(g=s.stateNode=new MF),f.forEach(function(w){var j=HF.bind(null,s,w);g.has(w)||(g.add(w),w.then(j,j))})}}function Tn(s,f){var g=f.deletions;if(g!==null)for(var w=0;wj&&(j=M),w&=~P}if(w=j,w=Ft()-w,w=(120>w?120:480>w?480:1080>w?1080:1920>w?1920:3e3>w?3e3:4320>w?4320:1960*$F(w/1960))-w,10s?16:s,ci===null)var w=!1;else{if(s=ci,ci=null,sf=0,(it&6)!==0)throw Error(r(331));var j=it;for(it|=4,Ee=s.current;Ee!==null;){var P=Ee,M=P.child;if((Ee.flags&16)!==0){var Y=P.deletions;if(Y!==null){for(var te=0;teFt()-zv?Ki(s,0):Fv|=g),Ir(s,f)}function FC(s,f){f===0&&((s.mode&1)===0?f=1:(f=gd,gd<<=1,(gd&130023424)===0&&(gd=4194304)));var g=wr();s=_a(s,f),s!==null&&(Dl(s,f,g),Ir(s,g))}function VF(s){var f=s.memoizedState,g=0;f!==null&&(g=f.retryLane),FC(s,g)}function HF(s,f){var g=0;switch(s.tag){case 13:var w=s.stateNode,j=s.memoizedState;j!==null&&(g=j.retryLane);break;case 19:w=s.stateNode;break;default:throw Error(r(314))}w!==null&&w.delete(f),FC(s,g)}var zC;zC=function(s,f,g){if(s!==null)if(s.memoizedProps!==f.pendingProps||Ar.current)kr=!0;else{if((s.lanes&g)===0&&(f.flags&128)===0)return kr=!1,kF(s,f,g);kr=(s.flags&131072)!==0}else kr=!1,Pt&&(f.flags&1048576)!==0&&bN(f,$d,f.index);switch(f.lanes=0,f.tag){case 2:var w=f.type;Zd(s,f),s=f.pendingProps;var j=Ko(f,hr.current);es(f,g),j=yv(null,f,w,s,j,g);var P=xv();return f.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,Tr(w)?(P=!0,Md(f)):P=!1,f.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,dv(f),j.updater=Jd,f.stateNode=j,j._reactInternals=f,Nv(f,w,s,g),f=Pv(null,f,w,!0,P,g)):(f.tag=0,Pt&&P&&tv(f),br(null,f,j,g),f=f.child),f;case 16:w=f.elementType;e:{switch(Zd(s,f),s=f.pendingProps,j=w._init,w=j(w._payload),f.type=w,j=f.tag=GF(w),s=Pn(w,s),j){case 0:f=Ev(null,f,w,s,g);break e;case 1:f=hC(null,f,w,s,g);break e;case 11:f=lC(null,f,w,s,g);break e;case 14:f=cC(null,f,w,Pn(w.type,s),g);break e}throw Error(r(306,w,""))}return f;case 0:return w=f.type,j=f.pendingProps,j=f.elementType===w?j:Pn(w,j),Ev(s,f,w,j,g);case 1:return w=f.type,j=f.pendingProps,j=f.elementType===w?j:Pn(w,j),hC(s,f,w,j,g);case 3:e:{if(pC(f),s===null)throw Error(r(387));w=f.pendingProps,P=f.memoizedState,j=P.element,PN(s,f),Vd(f,w,null,g);var M=f.memoizedState;if(w=M.element,P.isDehydrated)if(P={element:w,isDehydrated:!1,cache:M.cache,pendingSuspenseBoundaries:M.pendingSuspenseBoundaries,transitions:M.transitions},f.updateQueue.baseState=P,f.memoizedState=P,f.flags&256){j=rs(Error(r(423)),f),f=mC(s,f,w,g,j);break e}else if(w!==j){j=rs(Error(r(424)),f),f=mC(s,f,w,g,j);break e}else for(qr=ti(f.stateNode.containerInfo.firstChild),zr=f,Pt=!0,En=null,g=ON(f,null,w,g),f.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(Jo(),w===j){f=Ca(s,f,g);break e}br(s,f,w,g)}f=f.child}return f;case 5:return kN(f),s===null&&av(f),w=f.type,j=f.pendingProps,P=s!==null?s.memoizedProps:null,M=j.children,Xg(w,j)?M=null:P!==null&&Xg(w,P)&&(f.flags|=32),fC(s,f),br(s,f,M,g),f.child;case 6:return s===null&&av(f),null;case 13:return gC(s,f,g);case 4:return fv(f,f.stateNode.containerInfo),w=f.pendingProps,s===null?f.child=Qo(f,null,w,g):br(s,f,w,g),f.child;case 11:return w=f.type,j=f.pendingProps,j=f.elementType===w?j:Pn(w,j),lC(s,f,w,j,g);case 7:return br(s,f,f.pendingProps,g),f.child;case 8:return br(s,f,f.pendingProps.children,g),f.child;case 12:return br(s,f,f.pendingProps.children,g),f.child;case 10:e:{if(w=f.type._context,j=f.pendingProps,P=f.memoizedProps,M=j.value,wt(zd,w._currentValue),w._currentValue=M,P!==null)if(On(P.value,M)){if(P.children===j.children&&!Ar.current){f=Ca(s,f,g);break e}}else for(P=f.child,P!==null&&(P.return=f);P!==null;){var Y=P.dependencies;if(Y!==null){M=P.child;for(var te=Y.firstContext;te!==null;){if(te.context===w){if(P.tag===1){te=Na(-1,g&-g),te.tag=2;var le=P.updateQueue;if(le!==null){le=le.shared;var ye=le.pending;ye===null?te.next=te:(te.next=ye.next,ye.next=te),le.pending=te}}P.lanes|=g,te=P.alternate,te!==null&&(te.lanes|=g),cv(P.return,g,f),Y.lanes|=g;break}te=te.next}}else if(P.tag===10)M=P.type===f.type?null:P.child;else if(P.tag===18){if(M=P.return,M===null)throw Error(r(341));M.lanes|=g,Y=M.alternate,Y!==null&&(Y.lanes|=g),cv(M,g,f),M=P.sibling}else M=P.child;if(M!==null)M.return=P;else for(M=P;M!==null;){if(M===f){M=null;break}if(P=M.sibling,P!==null){P.return=M.return,M=P;break}M=M.return}P=M}br(s,f,j.children,g),f=f.child}return f;case 9:return j=f.type,w=f.pendingProps.children,es(f,g),j=cn(j),w=w(j),f.flags|=1,br(s,f,w,g),f.child;case 14:return w=f.type,j=Pn(w,f.pendingProps),j=Pn(w.type,j),cC(s,f,w,j,g);case 15:return uC(s,f,f.type,f.pendingProps,g);case 17:return w=f.type,j=f.pendingProps,j=f.elementType===w?j:Pn(w,j),Zd(s,f),f.tag=1,Tr(w)?(s=!0,Md(f)):s=!1,es(f,g),tC(f,w,j),Nv(f,w,j,g),Pv(null,f,w,!0,s,g);case 19:return yC(s,f,g);case 22:return dC(s,f,g)}throw Error(r(156,f.tag))};function qC(s,f){return w_(s,f)}function WF(s,f,g,w){this.tag=s,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=w,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(s,f,g,w){return new WF(s,f,g,w)}function Xv(s){return s=s.prototype,!(!s||!s.isReactComponent)}function GF(s){if(typeof s=="function")return Xv(s)?1:0;if(s!=null){if(s=s.$$typeof,s===B)return 11;if(s===V)return 14}return 2}function fi(s,f){var g=s.alternate;return g===null?(g=fn(s.tag,f,s.key,s.mode),g.elementType=s.elementType,g.type=s.type,g.stateNode=s.stateNode,g.alternate=s,s.alternate=g):(g.pendingProps=f,g.type=s.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=s.flags&14680064,g.childLanes=s.childLanes,g.lanes=s.lanes,g.child=s.child,g.memoizedProps=s.memoizedProps,g.memoizedState=s.memoizedState,g.updateQueue=s.updateQueue,f=s.dependencies,g.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},g.sibling=s.sibling,g.index=s.index,g.ref=s.ref,g}function df(s,f,g,w,j,P){var M=2;if(w=s,typeof s=="function")Xv(s)&&(M=1);else if(typeof s=="string")M=5;else e:switch(s){case T:return Yi(g.children,j,P,f);case R:M=8,j|=8;break;case L:return s=fn(12,g,f,j|2),s.elementType=L,s.lanes=P,s;case q:return s=fn(13,g,f,j),s.elementType=q,s.lanes=P,s;case H:return s=fn(19,g,f,j),s.elementType=H,s.lanes=P,s;case U:return ff(g,j,P,f);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case z:M=10;break e;case F:M=9;break e;case B:M=11;break e;case V:M=14;break e;case G:M=16,w=null;break e}throw Error(r(130,s==null?s:typeof s,""))}return f=fn(M,g,f,j),f.elementType=s,f.type=w,f.lanes=P,f}function Yi(s,f,g,w){return s=fn(7,s,w,f),s.lanes=g,s}function ff(s,f,g,w){return s=fn(22,s,w,f),s.elementType=U,s.lanes=g,s.stateNode={isHidden:!1},s}function Yv(s,f,g){return s=fn(6,s,null,f),s.lanes=g,s}function Jv(s,f,g){return f=fn(4,s.children!==null?s.children:[],s.key,f),f.lanes=g,f.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},f}function KF(s,f,g,w,j){this.tag=f,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_g(0),this.expirationTimes=_g(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_g(0),this.identifierPrefix=w,this.onRecoverableError=j,this.mutableSourceEagerHydrationData=null}function Qv(s,f,g,w,j,P,M,Y,te){return s=new KF(s,f,g,Y,te),f===1?(f=1,P===!0&&(f|=8)):f=0,P=fn(3,null,null,f),s.current=P,P.stateNode=s,P.memoizedState={element:w,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},dv(P),s}function XF(s,f,g){var w=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ay.exports=sz(),ay.exports}var rO;function lz(){if(rO)return bf;rO=1;var e=KI();return bf.createRoot=e.createRoot,bf.hydrateRoot=e.hydrateRoot,bf}var cz=lz(),b=Gp();const X=ct(b),NS=tz({__proto__:null,default:X},[b]);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),dz=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),nO=e=>{const t=dz(e);return t.charAt(0).toUpperCase()+t.slice(1)},XI=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var fz={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.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hz=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...u},d)=>b.createElement("svg",{ref:d,...fz,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:XI("lucide",a),...u},[...o.map(([c,h])=>b.createElement(c,h)),...Array.isArray(i)?i:[i]]));/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ze=(e,t)=>{const r=b.forwardRef(({className:n,...a},i)=>b.createElement(hz,{ref:i,iconNode:t,className:XI(`lucide-${uz(nO(e))}`,`lucide-${e}`,n),...a}));return r.displayName=nO(e),r};/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pz=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]],mz=ze("arrow-down-a-z",pz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gz=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],vz=ze("arrow-down-right",gz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yz=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],xz=ze("arrow-left",yz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bz=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],wz=ze("arrow-up-down",bz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Sz=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],YI=ze("arrow-up-right",Sz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const jz=[["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"}]],_z=ze("calendar",jz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Nz=[["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"}]],Cz=ze("chart-column",Nz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Oz=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],JI=ze("check",Oz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ez=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Is=ze("chevron-down",Ez);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Pz=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],QI=ze("chevron-left",Pz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Az=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ms=ze("chevron-right",Az);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Tz=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],kz=ze("chevron-up",Tz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Rz=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],ZI=ze("chevrons-up-down",Rz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Iz=[["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"}]],Ph=ze("circle-help",Iz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Mz=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],Dz=ze("circle-user",Mz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Lz=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],$z=ze("coffee",Lz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Bz=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],CS=ze("download",Bz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Fz=[["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"}]],Ei=ze("ellipsis",Fz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zz=[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]],eM=ze("file-box",zz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const qz=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ds=ze("file-text",qz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Uz=[["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"}]],Vz=ze("grid-3x3",Uz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Hz=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Wz=ze("image",Hz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Gz=[["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"}]],tM=ze("layers",Gz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Kz=[["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"}]],rM=ze("layout-dashboard",Kz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Xz=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],Yz=ze("list",Xz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Jz=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],Qz=ze("log-out",Jz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Zz=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],hl=ze("map-pin",Zz);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e8=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],t8=ze("menu",e8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const r8=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Vc=ze("package",r8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const n8=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],_h=ze("pencil",n8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a8=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],i8=ze("pin",a8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const o8=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],wn=ze("plus",o8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const s8=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],nM=ze("printer",s8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const l8=[["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"}]],c8=ze("refresh-cw",l8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const u8=[["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"}]],d8=ze("save",u8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const f8=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Kp=ze("search",f8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const h8=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ah=ze("settings",h8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const p8=[["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"}]],m8=ze("shield",p8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const g8=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],xn=ze("square-pen",g8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const v8=[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]],y8=ze("store",v8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const x8=[["path",{d:"m18 2 4 4",key:"22kx64"}],["path",{d:"m17 7 3-3",key:"1w1zoj"}],["path",{d:"M19 9 8.7 19.3c-1 1-2.5 1-3.4 0l-.6-.6c-1-1-1-2.5 0-3.4L15 5",key:"1exhtz"}],["path",{d:"m9 11 4 4",key:"rovt3i"}],["path",{d:"m5 19-3 3",key:"59f2uf"}],["path",{d:"m14 4 6 6",key:"yqp9t2"}]],sy=ze("syringe",x8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const b8=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]],w8=ze("tablet",b8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const S8=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Th=ze("tag",S8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const j8=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],_8=ze("timer",j8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const N8=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Hc=ze("trash-2",N8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const C8=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],O8=ze("trending-up",C8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const E8=[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],aM=ze("type",E8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const P8=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],A8=ze("upload",P8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const T8=[["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"}]],k8=ze("user",T8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const R8=[["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"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],OS=ze("users",R8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const I8=[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]],M8=ze("utensils",I8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const D8=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],uo=ze("x",D8);function iM(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const r=new Array(e.length+t.length);for(let n=0;n({classGroupId:e,validator:t}),oM=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),kh="-",aO=[],B8="arbitrary..",F8=e=>{const t=q8(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return z8(o);const u=o.split(kh),d=u[0]===""&&u.length>1?1:0;return sM(u,d,t)},getConflictingClassGroupIds:(o,u)=>{if(u){const d=n[o],c=r[o];return d?c?L8(c,d):d:c||aO}return r[o]||aO}}},sM=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const a=e[t],i=r.nextPart.get(a);if(i){const c=sM(e,t+1,i);if(c)return c}const o=r.validators;if(o===null)return;const u=t===0?e.join(kh):e.slice(t).join(kh),d=o.length;for(let c=0;ce.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?B8+n:void 0})(),q8=e=>{const{theme:t,classGroups:r}=e;return U8(r,t)},U8=(e,t)=>{const r=oM();for(const n in e){const a=e[n];ES(a,r,n,t)}return r},ES=(e,t,r,n)=>{const a=e.length;for(let i=0;i{if(typeof e=="string"){H8(e,t,r);return}if(typeof e=="function"){W8(e,t,r,n);return}G8(e,t,r,n)},H8=(e,t,r)=>{const n=e===""?t:lM(t,e);n.classGroupId=r},W8=(e,t,r,n)=>{if(K8(e)){ES(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push($8(r,e))},G8=(e,t,r,n)=>{const a=Object.entries(e),i=a.length;for(let o=0;o{let r=e;const n=t.split(kh),a=n.length;for(let i=0;i"isThemeGetter"in e&&e.isThemeGetter===!0,X8=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const a=(i,o)=>{r[i]=o,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(i){let o=r[i];if(o!==void 0)return o;if((o=n[i])!==void 0)return a(i,o),o},set(i,o){i in r?r[i]=o:a(i,o)}}},M1="!",iO=":",Y8=[],oO=(e,t,r,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),J8=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const i=[];let o=0,u=0,d=0,c;const h=a.length;for(let y=0;yd?c-d:void 0;return oO(i,v,m,x)};if(t){const a=t+iO,i=n;n=o=>o.startsWith(a)?i(o.slice(a.length)):oO(Y8,!1,o,void 0,!0)}if(r){const a=n;n=i=>r({className:i,parseClassName:a})}return n},Q8=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let a=[];for(let i=0;i0&&(a.sort(),n.push(...a),a=[]),n.push(o)):a.push(o)}return a.length>0&&(a.sort(),n.push(...a)),n}},Z8=e=>({cache:X8(e.cacheSize),parseClassName:J8(e),sortModifiers:Q8(e),...F8(e)}),e6=/\s+/,t6=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=t,o=[],u=e.trim().split(e6);let d="";for(let c=u.length-1;c>=0;c-=1){const h=u[c],{isExternal:p,modifiers:m,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:y}=r(h);if(p){d=h+(d.length>0?" "+d:d);continue}let S=!!y,_=n(S?x.substring(0,y):x);if(!_){if(!S){d=h+(d.length>0?" "+d:d);continue}if(_=n(x),!_){d=h+(d.length>0?" "+d:d);continue}S=!1}const N=m.length===0?"":m.length===1?m[0]:i(m).join(":"),O=v?N+M1:N,A=O+_;if(o.indexOf(A)>-1)continue;o.push(A);const C=a(_,S);for(let E=0;E0?" "+d:d)}return d},r6=(...e)=>{let t=0,r,n,a="";for(;t{if(typeof e=="string")return e;let t,r="";for(let n=0;n{let r,n,a,i;const o=d=>{const c=t.reduce((h,p)=>p(h),e());return r=Z8(c),n=r.cache.get,a=r.cache.set,i=u,u(d)},u=d=>{const c=n(d);if(c)return c;const h=t6(d,r);return a(d,h),h};return i=o,(...d)=>i(r6(...d))},a6=[],Yt=e=>{const t=r=>r[e]||a6;return t.isThemeGetter=!0,t},uM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,dM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,i6=/^\d+\/\d+$/,o6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,s6=/\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$/,l6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,c6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,u6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ss=e=>i6.test(e),et=e=>!!e&&!Number.isNaN(Number(e)),pi=e=>!!e&&Number.isInteger(Number(e)),ly=e=>e.endsWith("%")&&et(e.slice(0,-1)),Ea=e=>o6.test(e),d6=()=>!0,f6=e=>s6.test(e)&&!l6.test(e),fM=()=>!1,h6=e=>c6.test(e),p6=e=>u6.test(e),m6=e=>!ke(e)&&!Re(e),g6=e=>pl(e,mM,fM),ke=e=>uM.test(e),Ji=e=>pl(e,gM,f6),cy=e=>pl(e,w6,et),sO=e=>pl(e,hM,fM),v6=e=>pl(e,pM,p6),wf=e=>pl(e,vM,h6),Re=e=>dM.test(e),mc=e=>ml(e,gM),y6=e=>ml(e,S6),lO=e=>ml(e,hM),x6=e=>ml(e,mM),b6=e=>ml(e,pM),Sf=e=>ml(e,vM,!0),pl=(e,t,r)=>{const n=uM.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},ml=(e,t,r=!1)=>{const n=dM.exec(e);return n?n[1]?t(n[1]):r:!1},hM=e=>e==="position"||e==="percentage",pM=e=>e==="image"||e==="url",mM=e=>e==="length"||e==="size"||e==="bg-size",gM=e=>e==="length",w6=e=>e==="number",S6=e=>e==="family-name",vM=e=>e==="shadow",j6=()=>{const e=Yt("color"),t=Yt("font"),r=Yt("text"),n=Yt("font-weight"),a=Yt("tracking"),i=Yt("leading"),o=Yt("breakpoint"),u=Yt("container"),d=Yt("spacing"),c=Yt("radius"),h=Yt("shadow"),p=Yt("inset-shadow"),m=Yt("text-shadow"),v=Yt("drop-shadow"),x=Yt("blur"),y=Yt("perspective"),S=Yt("aspect"),_=Yt("ease"),N=Yt("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],C=()=>[...A(),Re,ke],E=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],R=()=>[Re,ke,d],L=()=>[ss,"full","auto",...R()],z=()=>[pi,"none","subgrid",Re,ke],F=()=>["auto",{span:["full",pi,Re,ke]},pi,Re,ke],B=()=>[pi,"auto",Re,ke],q=()=>["auto","min","max","fr",Re,ke],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...R()],U=()=>[ss,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],$=()=>[e,Re,ke],Q=()=>[...A(),lO,sO,{position:[Re,ke]}],k=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",x6,g6,{size:[Re,ke]}],D=()=>[ly,mc,Ji],Z=()=>["","none","full",c,Re,ke],ie=()=>["",et,mc,Ji],oe=()=>["solid","dashed","dotted","double"],ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>[et,ly,lO,sO],J=()=>["","none",x,Re,ke],ee=()=>["none",et,Re,ke],ce=()=>["none",et,Re,ke],pe=()=>[et,Re,ke],W=()=>[ss,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ea],breakpoint:[Ea],color:[d6],container:[Ea],"drop-shadow":[Ea],ease:["in","out","in-out"],font:[m6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ea],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ea],shadow:[Ea],spacing:["px",et],text:[Ea],"text-shadow":[Ea],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",ss,ke,Re,S]}],container:["container"],columns:[{columns:[et,ke,Re,u]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"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:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[pi,"auto",Re,ke]}],basis:[{basis:[ss,"full","auto",u,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[et,ss,"auto","initial","none",ke]}],grow:[{grow:["",et,Re,ke]}],shrink:[{shrink:["",et,Re,ke]}],order:[{order:[pi,"first","last","none",Re,ke]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[u,"screen",...U()]}],"min-w":[{"min-w":[u,"screen","none",...U()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[o]},...U()]}],h:[{h:["screen","lh",...U()]}],"min-h":[{"min-h":["screen","lh","none",...U()]}],"max-h":[{"max-h":["screen","lh",...U()]}],"font-size":[{text:["base",r,mc,Ji]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Re,cy]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ly,ke]}],"font-family":[{font:[y6,ke,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:[a,Re,ke]}],"line-clamp":[{"line-clamp":[et,"none",Re,cy]}],leading:[{leading:[i,...R()]}],"list-image":[{"list-image":["none",Re,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Re,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[et,"from-font","auto",Re,Ji]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[et,"auto",Re,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Re,ke]}],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",Re,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Q()}],"bg-repeat":[{bg:k()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},pi,Re,ke],radial:["",Re,ke],conic:[pi,Re,ke]},b6,v6]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:D()}],"gradient-via-pos":[{via:D()}],"gradient-to-pos":[{to:D()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...oe(),"hidden","none"]}],"divide-style":[{divide:[...oe(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[et,Re,ke]}],"outline-w":[{outline:["",et,mc,Ji]}],"outline-color":[{outline:$()}],shadow:[{shadow:["","none",h,Sf,wf]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",p,Sf,wf]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[et,Ji]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":$()}],"text-shadow":[{"text-shadow":["none",m,Sf,wf]}],"text-shadow-color":[{"text-shadow":$()}],opacity:[{opacity:[et,Re,ke]}],"mix-blend":[{"mix-blend":[...ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ne()}],"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":[et]}],"mask-image-linear-from-pos":[{"mask-linear-from":K()}],"mask-image-linear-to-pos":[{"mask-linear-to":K()}],"mask-image-linear-from-color":[{"mask-linear-from":$()}],"mask-image-linear-to-color":[{"mask-linear-to":$()}],"mask-image-t-from-pos":[{"mask-t-from":K()}],"mask-image-t-to-pos":[{"mask-t-to":K()}],"mask-image-t-from-color":[{"mask-t-from":$()}],"mask-image-t-to-color":[{"mask-t-to":$()}],"mask-image-r-from-pos":[{"mask-r-from":K()}],"mask-image-r-to-pos":[{"mask-r-to":K()}],"mask-image-r-from-color":[{"mask-r-from":$()}],"mask-image-r-to-color":[{"mask-r-to":$()}],"mask-image-b-from-pos":[{"mask-b-from":K()}],"mask-image-b-to-pos":[{"mask-b-to":K()}],"mask-image-b-from-color":[{"mask-b-from":$()}],"mask-image-b-to-color":[{"mask-b-to":$()}],"mask-image-l-from-pos":[{"mask-l-from":K()}],"mask-image-l-to-pos":[{"mask-l-to":K()}],"mask-image-l-from-color":[{"mask-l-from":$()}],"mask-image-l-to-color":[{"mask-l-to":$()}],"mask-image-x-from-pos":[{"mask-x-from":K()}],"mask-image-x-to-pos":[{"mask-x-to":K()}],"mask-image-x-from-color":[{"mask-x-from":$()}],"mask-image-x-to-color":[{"mask-x-to":$()}],"mask-image-y-from-pos":[{"mask-y-from":K()}],"mask-image-y-to-pos":[{"mask-y-to":K()}],"mask-image-y-from-color":[{"mask-y-from":$()}],"mask-image-y-to-color":[{"mask-y-to":$()}],"mask-image-radial":[{"mask-radial":[Re,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":K()}],"mask-image-radial-to-pos":[{"mask-radial-to":K()}],"mask-image-radial-from-color":[{"mask-radial-from":$()}],"mask-image-radial-to-color":[{"mask-radial-to":$()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[et]}],"mask-image-conic-from-pos":[{"mask-conic-from":K()}],"mask-image-conic-to-pos":[{"mask-conic-to":K()}],"mask-image-conic-from-color":[{"mask-conic-from":$()}],"mask-image-conic-to-color":[{"mask-conic-to":$()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Q()}],"mask-repeat":[{mask:k()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Re,ke]}],filter:[{filter:["","none",Re,ke]}],blur:[{blur:J()}],brightness:[{brightness:[et,Re,ke]}],contrast:[{contrast:[et,Re,ke]}],"drop-shadow":[{"drop-shadow":["","none",v,Sf,wf]}],"drop-shadow-color":[{"drop-shadow":$()}],grayscale:[{grayscale:["",et,Re,ke]}],"hue-rotate":[{"hue-rotate":[et,Re,ke]}],invert:[{invert:["",et,Re,ke]}],saturate:[{saturate:[et,Re,ke]}],sepia:[{sepia:["",et,Re,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Re,ke]}],"backdrop-blur":[{"backdrop-blur":J()}],"backdrop-brightness":[{"backdrop-brightness":[et,Re,ke]}],"backdrop-contrast":[{"backdrop-contrast":[et,Re,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",et,Re,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[et,Re,ke]}],"backdrop-invert":[{"backdrop-invert":["",et,Re,ke]}],"backdrop-opacity":[{"backdrop-opacity":[et,Re,ke]}],"backdrop-saturate":[{"backdrop-saturate":[et,Re,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",et,Re,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Re,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[et,"initial",Re,ke]}],ease:[{ease:["linear","initial",_,Re,ke]}],delay:[{delay:[et,Re,ke]}],animate:[{animate:["none",N,Re,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Re,ke]}],"perspective-origin":[{"perspective-origin":C()}],rotate:[{rotate:ee()}],"rotate-x":[{"rotate-x":ee()}],"rotate-y":[{"rotate-y":ee()}],"rotate-z":[{"rotate-z":ee()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":["scale-3d"],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[Re,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:C()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:W()}],"translate-x":[{"translate-x":W()}],"translate-y":[{"translate-y":W()}],"translate-z":[{"translate-z":W()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"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",Re,ke]}],"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":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",Re,ke]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[et,mc,Ji,cy]}],stroke:[{stroke:["none",...$()]}],"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"]}},_6=n6(j6);function Ae(...e){return _6(Ze(e))}var ku=KI();const N6=ct(ku);function cO(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Sn(...e){return t=>{let r=!1;const n=e.map(a=>{const i=cO(a,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a{const{children:i,...o}=n,u=b.Children.toArray(i),d=u.find(P6);if(d){const c=d.props.children,h=u.map(p=>p===d?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:p);return l.jsx(t,{...o,ref:a,children:b.isValidElement(c)?b.cloneElement(c,void 0,h):null})}return l.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function O6(e){const t=b.forwardRef((r,n)=>{const{children:a,...i}=r;if(b.isValidElement(a)){const o=T6(a),u=A6(i,a.props);return a.type!==b.Fragment&&(u.ref=n?Sn(n,o):o),b.cloneElement(a,u)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var E6=Symbol("radix.slottable");function P6(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===E6}function A6(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function T6(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var k6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],We=k6.reduce((e,t)=>{const r=C6(`Primitive.${t}`),n=b.forwardRef((a,i)=>{const{asChild:o,...u}=a,d=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(d,{...u,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function R6(e,t){e&&ku.flushSync(()=>e.dispatchEvent(t))}var Gt=globalThis?.document?b.useLayoutEffect:()=>{};function I6(e,t){return b.useReducer((r,n)=>t[r][n]??r,e)}var nn=e=>{const{present:t,children:r}=e,n=M6(t),a=typeof r=="function"?r({present:n.isPresent}):b.Children.only(r),i=at(n.ref,D6(a));return typeof r=="function"||n.isPresent?b.cloneElement(a,{ref:i}):null};nn.displayName="Presence";function M6(e){const[t,r]=b.useState(),n=b.useRef(null),a=b.useRef(e),i=b.useRef("none"),o=e?"mounted":"unmounted",[u,d]=I6(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const c=jf(n.current);i.current=u==="mounted"?c:"none"},[u]),Gt(()=>{const c=n.current,h=a.current;if(h!==e){const m=i.current,v=jf(c);e?d("MOUNT"):v==="none"||c?.display==="none"?d("UNMOUNT"):d(h&&m!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Gt(()=>{if(t){let c;const h=t.ownerDocument.defaultView??window,p=v=>{const y=jf(n.current).includes(CSS.escape(v.animationName));if(v.target===t&&y&&(d("ANIMATION_END"),!a.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",c=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},m=v=>{v.target===t&&(i.current=jf(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(c),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:b.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function jf(e){return e?.animationName||"none"}function D6(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function L6(e,t){const r=b.createContext(t),n=i=>{const{children:o,...u}=i,d=b.useMemo(()=>u,Object.values(u));return l.jsx(r.Provider,{value:d,children:o})};n.displayName=e+"Provider";function a(i){const o=b.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,a]}function Ua(e,t=[]){let r=[];function n(i,o){const u=b.createContext(o),d=r.length;r=[...r,o];const c=p=>{const{scope:m,children:v,...x}=p,y=m?.[e]?.[d]||u,S=b.useMemo(()=>x,Object.values(x));return l.jsx(y.Provider,{value:S,children:v})};c.displayName=i+"Provider";function h(p,m){const v=m?.[e]?.[d]||u,x=b.useContext(v);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[c,h]}const a=()=>{const i=r.map(o=>b.createContext(o));return function(u){const d=u?.[e]||i;return b.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[n,$6(a,...t)]}function $6(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((u,{useScope:d,scopeName:c})=>{const p=d(i)[`__scope${c}`];return{...u,...p}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function jr(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...r)=>t.current?.(...r),[])}var B6=b.createContext(void 0);function yM(e){const t=b.useContext(B6);return e||t||"ltr"}function D1(e,[t,r]){return Math.min(r,Math.max(t,e))}function Ge(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),r===!1||!a.defaultPrevented)return t?.(a)}}function F6(e,t){return b.useReducer((r,n)=>t[r][n]??r,e)}var PS="ScrollArea",[xM]=Ua(PS),[z6,_n]=xM(PS),bM=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:a,scrollHideDelay:i=600,...o}=e,[u,d]=b.useState(null),[c,h]=b.useState(null),[p,m]=b.useState(null),[v,x]=b.useState(null),[y,S]=b.useState(null),[_,N]=b.useState(0),[O,A]=b.useState(0),[C,E]=b.useState(!1),[T,R]=b.useState(!1),L=at(t,F=>d(F)),z=yM(a);return l.jsx(z6,{scope:r,type:n,dir:z,scrollHideDelay:i,scrollArea:u,viewport:c,onViewportChange:h,content:p,onContentChange:m,scrollbarX:v,onScrollbarXChange:x,scrollbarXEnabled:C,onScrollbarXEnabledChange:E,scrollbarY:y,onScrollbarYChange:S,scrollbarYEnabled:T,onScrollbarYEnabledChange:R,onCornerWidthChange:N,onCornerHeightChange:A,children:l.jsx(We.div,{dir:z,...o,ref:L,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":O+"px",...e.style}})})});bM.displayName=PS;var wM="ScrollAreaViewport",SM=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:a,...i}=e,o=_n(wM,r),u=b.useRef(null),d=at(t,u,o.onViewportChange);return l.jsxs(l.Fragment,{children:[l.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),l.jsx(We.div,{"data-radix-scroll-area-viewport":"",...i,ref:d,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:l.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});SM.displayName=wM;var da="ScrollAreaScrollbar",jM=b.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=_n(da,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,u=e.orientation==="horizontal";return b.useEffect(()=>(u?i(!0):o(!0),()=>{u?i(!1):o(!1)}),[u,i,o]),a.type==="hover"?l.jsx(q6,{...n,ref:t,forceMount:r}):a.type==="scroll"?l.jsx(U6,{...n,ref:t,forceMount:r}):a.type==="auto"?l.jsx(_M,{...n,ref:t,forceMount:r}):a.type==="always"?l.jsx(AS,{...n,ref:t}):null});jM.displayName=da;var q6=b.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=_n(da,e.__scopeScrollArea),[i,o]=b.useState(!1);return b.useEffect(()=>{const u=a.scrollArea;let d=0;if(u){const c=()=>{window.clearTimeout(d),o(!0)},h=()=>{d=window.setTimeout(()=>o(!1),a.scrollHideDelay)};return u.addEventListener("pointerenter",c),u.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",c),u.removeEventListener("pointerleave",h)}}},[a.scrollArea,a.scrollHideDelay]),l.jsx(nn,{present:r||i,children:l.jsx(_M,{"data-state":i?"visible":"hidden",...n,ref:t})})}),U6=b.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=_n(da,e.__scopeScrollArea),i=e.orientation==="horizontal",o=Yp(()=>d("SCROLL_END"),100),[u,d]=F6("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(u==="idle"){const c=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(c)}},[u,a.scrollHideDelay,d]),b.useEffect(()=>{const c=a.viewport,h=i?"scrollLeft":"scrollTop";if(c){let p=c[h];const m=()=>{const v=c[h];p!==v&&(d("SCROLL"),o()),p=v};return c.addEventListener("scroll",m),()=>c.removeEventListener("scroll",m)}},[a.viewport,i,d,o]),l.jsx(nn,{present:r||u!=="hidden",children:l.jsx(AS,{"data-state":u==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:Ge(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Ge(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),_M=b.forwardRef((e,t)=>{const r=_n(da,e.__scopeScrollArea),{forceMount:n,...a}=e,[i,o]=b.useState(!1),u=e.orientation==="horizontal",d=Yp(()=>{if(r.viewport){const c=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,a=_n(da,e.__scopeScrollArea),i=b.useRef(null),o=b.useRef(0),[u,d]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=PM(u.viewport,u.content),h={...n,sizes:u,onSizesChange:d,hasThumb:c>0&&c<1,onThumbChange:m=>i.current=m,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:m=>o.current=m};function p(m,v){return X6(m,o.current,u,v)}return r==="horizontal"?l.jsx(V6,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const m=a.viewport.scrollLeft,v=uO(m,u,a.dir);i.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollLeft=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollLeft=p(m,a.dir))}}):r==="vertical"?l.jsx(H6,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const m=a.viewport.scrollTop,v=uO(m,u);i.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{a.viewport&&(a.viewport.scrollTop=m)},onDragScroll:m=>{a.viewport&&(a.viewport.scrollTop=p(m))}}):null}),V6=b.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...a}=e,i=_n(da,e.__scopeScrollArea),[o,u]=b.useState(),d=b.useRef(null),c=at(t,d,i.onScrollbarXChange);return b.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),l.jsx(CM,{"data-orientation":"horizontal",...a,ref:c,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Xp(r)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(i.viewport){const m=i.viewport.scrollLeft+h.deltaX;e.onWheelScroll(m),TM(m,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Ih(o.paddingLeft),paddingEnd:Ih(o.paddingRight)}})}})}),H6=b.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...a}=e,i=_n(da,e.__scopeScrollArea),[o,u]=b.useState(),d=b.useRef(null),c=at(t,d,i.onScrollbarYChange);return b.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),l.jsx(CM,{"data-orientation":"vertical",...a,ref:c,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Xp(r)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(i.viewport){const m=i.viewport.scrollTop+h.deltaY;e.onWheelScroll(m),TM(m,p)&&h.preventDefault()}},onResize:()=>{d.current&&i.viewport&&o&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Ih(o.paddingTop),paddingEnd:Ih(o.paddingBottom)}})}})}),[W6,NM]=xM(da),CM=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:c,onWheelScroll:h,onResize:p,...m}=e,v=_n(da,r),[x,y]=b.useState(null),S=at(t,L=>y(L)),_=b.useRef(null),N=b.useRef(""),O=v.viewport,A=n.content-n.viewport,C=jr(h),E=jr(d),T=Yp(p,10);function R(L){if(_.current){const z=L.clientX-_.current.left,F=L.clientY-_.current.top;c({x:z,y:F})}}return b.useEffect(()=>{const L=z=>{const F=z.target;x?.contains(F)&&C(z,A)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[O,x,A,C]),b.useEffect(E,[n,E]),Ls(x,T),Ls(v.content,T),l.jsx(W6,{scope:r,scrollbar:x,hasThumb:a,onThumbChange:jr(i),onThumbPointerUp:jr(o),onThumbPositionChange:E,onThumbPointerDown:jr(u),children:l.jsx(We.div,{...m,ref:S,style:{position:"absolute",...m.style},onPointerDown:Ge(e.onPointerDown,L=>{L.button===0&&(L.target.setPointerCapture(L.pointerId),_.current=x.getBoundingClientRect(),N.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),R(L))}),onPointerMove:Ge(e.onPointerMove,R),onPointerUp:Ge(e.onPointerUp,L=>{const z=L.target;z.hasPointerCapture(L.pointerId)&&z.releasePointerCapture(L.pointerId),document.body.style.webkitUserSelect=N.current,v.viewport&&(v.viewport.style.scrollBehavior=""),_.current=null})})})}),Rh="ScrollAreaThumb",OM=b.forwardRef((e,t)=>{const{forceMount:r,...n}=e,a=NM(Rh,e.__scopeScrollArea);return l.jsx(nn,{present:r||a.hasThumb,children:l.jsx(G6,{ref:t,...n})})}),G6=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...a}=e,i=_n(Rh,r),o=NM(Rh,r),{onThumbPositionChange:u}=o,d=at(t,p=>o.onThumbChange(p)),c=b.useRef(void 0),h=Yp(()=>{c.current&&(c.current(),c.current=void 0)},100);return b.useEffect(()=>{const p=i.viewport;if(p){const m=()=>{if(h(),!c.current){const v=Y6(p,u);c.current=v,u()}};return u(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[i.viewport,h,u]),l.jsx(We.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Ge(e.onPointerDownCapture,p=>{const v=p.target.getBoundingClientRect(),x=p.clientX-v.left,y=p.clientY-v.top;o.onThumbPointerDown({x,y})}),onPointerUp:Ge(e.onPointerUp,o.onThumbPointerUp)})});OM.displayName=Rh;var TS="ScrollAreaCorner",EM=b.forwardRef((e,t)=>{const r=_n(TS,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?l.jsx(K6,{...e,ref:t}):null});EM.displayName=TS;var K6=b.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,a=_n(TS,r),[i,o]=b.useState(0),[u,d]=b.useState(0),c=!!(i&&u);return Ls(a.scrollbarX,()=>{const h=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(h),d(h)}),Ls(a.scrollbarY,()=>{const h=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(h),o(h)}),c?l.jsx(We.div,{...n,ref:t,style:{width:i,height:u,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Ih(e){return e?parseInt(e,10):0}function PM(e,t){const r=e/t;return isNaN(r)?0:r}function Xp(e){const t=PM(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function X6(e,t,r,n="ltr"){const a=Xp(r),i=a/2,o=t||i,u=a-o,d=r.scrollbar.paddingStart+o,c=r.scrollbar.size-r.scrollbar.paddingEnd-u,h=r.content-r.viewport,p=n==="ltr"?[0,h]:[h*-1,0];return AM([d,c],p)(e)}function uO(e,t,r="ltr"){const n=Xp(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,u=i-n,d=r==="ltr"?[0,o]:[o*-1,0],c=D1(e,d);return AM([0,o],[0,u])(c)}function AM(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function TM(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function a(){const i={left:e.scrollLeft,top:e.scrollTop},o=r.left!==i.left,u=r.top!==i.top;(o||u)&&t(),r=i,n=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(n)};function Yp(e,t){const r=jr(e),n=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(n.current),[]),b.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Ls(e,t){const r=jr(t);Gt(()=>{let n=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return a.observe(e),()=>{window.cancelAnimationFrame(n),a.unobserve(e)}}},[e,r])}var J6=bM,Q6=SM,Z6=EM;function $s({className:e,children:t,...r}){return l.jsxs(J6,{"data-slot":"scroll-area",className:Ae("relative",e),...r,children:[l.jsx(Q6,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),l.jsx(eq,{}),l.jsx(Z6,{})]})}function eq({className:e,orientation:t="vertical",...r}){return l.jsx(jM,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Ae("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:l.jsx(OM,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const tq="/assets/773f0c39e1986271e9144596caac519f934a6ae6-Cou8J2R8.png";function rq({currentView:e,setCurrentView:t}){const[r,n]=b.useState(!0),a=[{name:"Dashboard",icon:rM,type:"item"},{type:"header",name:"MODULES"},{name:"Labeling",icon:Th,type:"sub",isOpen:r,toggle:()=>n(!r),children:[{name:"Labels",icon:Th},{name:"Label Categories",icon:tM},{name:"Label Types",icon:aM},{name:"Label Templates",icon:eM},{name:"Multiple Options",icon:Ah}]},{type:"header",name:"MANAGEMENT"},{name:"Location Manager",icon:hl,type:"item"},{type:"header",name:"SYSTEM MANAGEMENT"},{name:"Account Management",icon:OS,type:"item"},{name:"Menu Management",icon:Vc,type:"item"},{name:"System Menu",icon:Ah,type:"item"},{name:"Reports",icon:Ds,type:"item"},{name:"Support",icon:Ph,type:"item"},{name:"Log Out",icon:Qz,type:"item"}];return l.jsxs("div",{className:"w-64 bg-[#1e3a8a] text-white flex flex-col h-screen border-r border-blue-800 shadow-xl z-20 shrink-0",children:[l.jsx("div",{className:"flex items-center justify-center border-b border-blue-800/50 bg-white px-4 shrink-0",style:{height:90},children:l.jsx("img",{src:tq,alt:"MedVantage",className:"h-16 w-auto object-contain"})}),l.jsx($s,{className:"flex-1 py-4",children:l.jsx("div",{className:"px-3 space-y-1",children:a.map((i,o)=>i.type==="header"?l.jsx("div",{className:"px-4 py-2 mt-4 text-xs font-semibold text-blue-300 uppercase tracking-wider",children:i.name},o):i.type==="sub"?l.jsxs("div",{className:"space-y-1",children:[l.jsxs("button",{onClick:i.toggle,className:Ae("w-full flex items-center justify-between px-4 py-2.5 text-sm font-medium rounded-lg transition-colors","hover:bg-blue-800/50 text-blue-100"),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(i.icon,{className:"w-4 h-4"}),i.name]}),i.isOpen?l.jsx(Is,{className:"w-4 h-4"}):l.jsx(Ms,{className:"w-4 h-4"})]}),i.isOpen&&l.jsx("div",{className:"pl-4 space-y-1",children:i.children?.map((u,d)=>l.jsxs("button",{onClick:()=>t(u.name),className:Ae("w-full flex items-center gap-3 px-4 py-2 text-sm font-medium rounded-lg transition-colors border-l-2",e===u.name?"bg-blue-800 border-blue-400 text-white":"border-transparent hover:bg-blue-800/30 text-blue-200 hover:text-white"),children:[l.jsx("div",{className:"w-1 h-1 rounded-full bg-current"}),u.name]},d))})]},o):l.jsxs("button",{onClick:()=>t(i.name),className:Ae("w-full flex items-center gap-3 px-4 py-2.5 text-sm font-medium rounded-lg transition-colors",e===i.name?"bg-blue-700 text-white shadow-md shadow-blue-900/20":i.name==="Log Out"?"text-red-300 hover:bg-red-900/20 hover:text-red-200":"text-blue-100 hover:bg-blue-800 hover:text-white"),children:[l.jsx(i.icon,{className:"w-4 h-4"}),i.name]},o))})})]})}function me({className:e,type:t,...r}){return l.jsx("input",{type:t,"data-slot":"input",className:Ae("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var nq=Symbol.for("react.lazy"),Mh=NS[" use ".trim().toString()];function aq(e){return typeof e=="object"&&e!==null&&"then"in e}function kM(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===nq&&"_payload"in e&&aq(e._payload)}function kS(e){const t=iq(e),r=b.forwardRef((n,a)=>{let{children:i,...o}=n;kM(i)&&typeof Mh=="function"&&(i=Mh(i._payload));const u=b.Children.toArray(i),d=u.find(sq);if(d){const c=d.props.children,h=u.map(p=>p===d?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:p);return l.jsx(t,{...o,ref:a,children:b.isValidElement(c)?b.cloneElement(c,void 0,h):null})}return l.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}var RM=kS("Slot");function iq(e){const t=b.forwardRef((r,n)=>{let{children:a,...i}=r;if(kM(a)&&typeof Mh=="function"&&(a=Mh(a._payload)),b.isValidElement(a)){const o=cq(a),u=lq(i,a.props);return a.type!==b.Fragment&&(u.ref=n?Sn(n,o):o),b.cloneElement(a,u)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oq=Symbol("radix.slottable");function sq(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oq}function lq(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function cq(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const dO=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,fO=Ze,IM=(e,t)=>r=>{var n;if(t?.variants==null)return fO(e,r?.class,r?.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(c=>{const h=r?.[c],p=i?.[c];if(h===null)return null;const m=dO(h)||dO(p);return a[c][m]}),u=r&&Object.entries(r).reduce((c,h)=>{let[p,m]=h;return m===void 0||(c[p]=m),c},{}),d=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,h)=>{let{class:p,className:m,...v}=h;return Object.entries(v).every(x=>{let[y,S]=x;return Array.isArray(S)?S.includes({...i,...u}[y]):{...i,...u}[y]===S})?[...c,p,m]:c},[]);return fO(e,o,d,r?.class,r?.className)},MM=IM("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),fe=b.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},i)=>{const o=n?RM:"button";return l.jsx(o,{ref:i,"data-slot":"button",className:Ae(MM({variant:t,size:r,className:e})),...a})});fe.displayName="Button";function uq(e,t=[]){let r=[];function n(i,o){const u=b.createContext(o);u.displayName=i+"Context";const d=r.length;r=[...r,o];const c=p=>{const{scope:m,children:v,...x}=p,y=m?.[e]?.[d]||u,S=b.useMemo(()=>x,Object.values(x));return l.jsx(y.Provider,{value:S,children:v})};c.displayName=i+"Provider";function h(p,m){const v=m?.[e]?.[d]||u,x=b.useContext(v);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[c,h]}const a=()=>{const i=r.map(o=>b.createContext(o));return function(u){const d=u?.[e]||i;return b.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[n,dq(a,...t)]}function dq(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((u,{useScope:d,scopeName:c})=>{const p=d(i)[`__scope${c}`];return{...u,...p}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var fq=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],RS=fq.reduce((e,t)=>{const r=kS(`Primitive.${t}`),n=b.forwardRef((a,i)=>{const{asChild:o,...u}=a,d=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(d,{...u,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),uy={exports:{}},dy={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var hO;function hq(){if(hO)return dy;hO=1;var e=Gp();function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,a=e.useEffect,i=e.useLayoutEffect,o=e.useDebugValue;function u(p,m){var v=m(),x=n({inst:{value:v,getSnapshot:m}}),y=x[0].inst,S=x[1];return i(function(){y.value=v,y.getSnapshot=m,d(y)&&S({inst:y})},[p,v,m]),a(function(){return d(y)&&S({inst:y}),p(function(){d(y)&&S({inst:y})})},[p]),o(v),v}function d(p){var m=p.getSnapshot;p=p.value;try{var v=m();return!r(p,v)}catch{return!0}}function c(p,m){return m()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:u;return dy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,dy}var pO;function pq(){return pO||(pO=1,uy.exports=hq()),uy.exports}var mq=pq();function gq(){return mq.useSyncExternalStore(vq,()=>!0,()=>!1)}function vq(){return()=>{}}var IS="Avatar",[yq]=uq(IS),[xq,DM]=yq(IS),LM=b.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[a,i]=b.useState("idle");return l.jsx(xq,{scope:r,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:l.jsx(RS.span,{...n,ref:t})})});LM.displayName=IS;var $M="AvatarImage",BM=b.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:a=()=>{},...i}=e,o=DM($M,r),u=bq(n,i),d=jr(c=>{a(c),o.onImageLoadingStatusChange(c)});return Gt(()=>{u!=="idle"&&d(u)},[u,d]),u==="loaded"?l.jsx(RS.img,{...i,ref:t,src:n}):null});BM.displayName=$M;var FM="AvatarFallback",zM=b.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...a}=e,i=DM(FM,r),[o,u]=b.useState(n===void 0);return b.useEffect(()=>{if(n!==void 0){const d=window.setTimeout(()=>u(!0),n);return()=>window.clearTimeout(d)}},[n]),o&&i.imageLoadingStatus!=="loaded"?l.jsx(RS.span,{...a,ref:t}):null});zM.displayName=FM;function mO(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function bq(e,{referrerPolicy:t,crossOrigin:r}){const n=gq(),a=b.useRef(null),i=n?(a.current||(a.current=new window.Image),a.current):null,[o,u]=b.useState(()=>mO(i,e));return Gt(()=>{u(mO(i,e))},[i,e]),Gt(()=>{const d=p=>()=>{u(p)};if(!i)return;const c=d("loaded"),h=d("error");return i.addEventListener("load",c),i.addEventListener("error",h),t&&(i.referrerPolicy=t),typeof r=="string"&&(i.crossOrigin=r),()=>{i.removeEventListener("load",c),i.removeEventListener("error",h)}},[i,r,t]),o}var wq=LM,Sq=BM,jq=zM;function _q({className:e,...t}){return l.jsx(wq,{"data-slot":"avatar",className:Ae("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function Nq({className:e,...t}){return l.jsx(Sq,{"data-slot":"avatar-image",className:Ae("aspect-square size-full",e),...t})}function Cq({className:e,...t}){return l.jsx(jq,{"data-slot":"avatar-fallback",className:Ae("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function Oq({title:e}){const t=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});return l.jsxs("header",{className:"bg-white border-b border-gray-200 px-8 flex items-center justify-between shadow-sm sticky top-0 z-10 shrink-0",style:{height:90},children:[l.jsxs("div",{children:[l.jsxs("h1",{className:"text-2xl font-bold",style:{color:"rgb(43, 50, 143)"},children:[e," Overview"]}),l.jsxs("p",{className:"text-sm text-gray-500 mt-1 flex items-center gap-2",children:[t," | Last updated: Just now"]})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("div",{className:"flex items-center w-64 h-9 rounded-md border border-gray-200 bg-gray-50 focus-within:bg-white focus-within:ring-2 focus-within:ring-ring/50 focus-within:border-ring transition-colors overflow-hidden",children:[l.jsx(Kp,{className:"h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none"}),l.jsx(me,{type:"search",placeholder:"Search...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full"})]}),l.jsx(fe,{variant:"ghost",size:"icon",className:"text-gray-500 hover:text-gray-700",children:l.jsx(Ah,{className:"w-5 h-5"})}),l.jsx("div",{className:"h-8 w-px bg-gray-200 mx-2"}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"text-right hidden md:block",children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Admin User"}),l.jsx("div",{className:"text-xs text-gray-500",children:"Administrator"})]}),l.jsxs(_q,{className:"h-10 w-10 border border-gray-200",children:[l.jsx(Nq,{src:"https://github.com/shadcn.png"}),l.jsx(Cq,{children:"AD"})]})]})]})]})}function Eq({children:e,currentView:t,setCurrentView:r}){return l.jsxs("div",{className:"flex h-screen bg-gray-50 overflow-hidden font-sans",children:[l.jsx(rq,{currentView:t,setCurrentView:r}),l.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[l.jsx(Oq,{title:t}),l.jsx("div",{className:"px-8 mt-8 shrink-0",children:l.jsxs("nav",{className:"flex items-center gap-2 text-sm font-normal","aria-label":"Breadcrumb",children:[l.jsx("button",{type:"button",onClick:()=>r("Dashboard"),className:"text-gray-500 hover:text-gray-700 transition-colors",children:"Home"}),l.jsx(Ms,{className:"w-4 h-4 text-gray-500 shrink-0"}),l.jsx("span",{style:{color:"rgb(43, 50, 143)"},children:t})]})}),l.jsx("main",{className:"flex-1 overflow-y-auto p-8",children:l.jsx("div",{className:"w-full h-full",children:e})})]})]})}function Xr({className:e,...t}){return l.jsx("div",{"data-slot":"card",className:Ae("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border",e),...t})}function Ln({className:e,...t}){return l.jsx("div",{"data-slot":"card-header",className:Ae("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function $n({className:e,...t}){return l.jsx("h4",{"data-slot":"card-title",className:Ae("leading-none",e),...t})}function Dh({className:e,...t}){return l.jsx("p",{"data-slot":"card-description",className:Ae("text-muted-foreground",e),...t})}function vn({className:e,...t}){return l.jsx("div",{"data-slot":"card-content",className:Ae("px-6 [&:last-child]:pb-6",e),...t})}const Pq=IM("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function xr({className:e,variant:t,asChild:r=!1,...n}){const a=r?RM:"span";return l.jsx(a,{"data-slot":"badge",className:Ae(Pq({variant:t}),e),...n})}var fy,gO;function $r(){if(gO)return fy;gO=1;var e=Array.isArray;return fy=e,fy}var hy,vO;function qM(){if(vO)return hy;vO=1;var e=typeof xf=="object"&&xf&&xf.Object===Object&&xf;return hy=e,hy}var py,yO;function fa(){if(yO)return py;yO=1;var e=qM(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return py=r,py}var my,xO;function Ru(){if(xO)return my;xO=1;var e=fa(),t=e.Symbol;return my=t,my}var gy,bO;function Aq(){if(bO)return gy;bO=1;var e=Ru(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,a=e?e.toStringTag:void 0;function i(o){var u=r.call(o,a),d=o[a];try{o[a]=void 0;var c=!0}catch{}var h=n.call(o);return c&&(u?o[a]=d:delete o[a]),h}return gy=i,gy}var vy,wO;function Tq(){if(wO)return vy;wO=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return vy=r,vy}var yy,SO;function Va(){if(SO)return yy;SO=1;var e=Ru(),t=Aq(),r=Tq(),n="[object Null]",a="[object Undefined]",i=e?e.toStringTag:void 0;function o(u){return u==null?u===void 0?a:n:i&&i in Object(u)?t(u):r(u)}return yy=o,yy}var xy,jO;function Ha(){if(jO)return xy;jO=1;function e(t){return t!=null&&typeof t=="object"}return xy=e,xy}var by,_O;function gl(){if(_O)return by;_O=1;var e=Va(),t=Ha(),r="[object Symbol]";function n(a){return typeof a=="symbol"||t(a)&&e(a)==r}return by=n,by}var wy,NO;function MS(){if(NO)return wy;NO=1;var e=$r(),t=gl(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(e(i))return!1;var u=typeof i;return u=="number"||u=="symbol"||u=="boolean"||i==null||t(i)?!0:n.test(i)||!r.test(i)||o!=null&&i in Object(o)}return wy=a,wy}var Sy,CO;function Pi(){if(CO)return Sy;CO=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Sy=e,Sy}var jy,OO;function DS(){if(OO)return jy;OO=1;var e=Va(),t=Pi(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(u){if(!t(u))return!1;var d=e(u);return d==n||d==a||d==r||d==i}return jy=o,jy}var _y,EO;function kq(){if(EO)return _y;EO=1;var e=fa(),t=e["__core-js_shared__"];return _y=t,_y}var Ny,PO;function Rq(){if(PO)return Ny;PO=1;var e=kq(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Ny=r,Ny}var Cy,AO;function UM(){if(AO)return Cy;AO=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Cy=r,Cy}var Oy,TO;function Iq(){if(TO)return Oy;TO=1;var e=DS(),t=Rq(),r=Pi(),n=UM(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,u=Object.prototype,d=o.toString,c=u.hasOwnProperty,h=RegExp("^"+d.call(c).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(m){if(!r(m)||t(m))return!1;var v=e(m)?h:i;return v.test(n(m))}return Oy=p,Oy}var Ey,kO;function Mq(){if(kO)return Ey;kO=1;function e(t,r){return t?.[r]}return Ey=e,Ey}var Py,RO;function Po(){if(RO)return Py;RO=1;var e=Iq(),t=Mq();function r(n,a){var i=t(n,a);return e(i)?i:void 0}return Py=r,Py}var Ay,IO;function Jp(){if(IO)return Ay;IO=1;var e=Po(),t=e(Object,"create");return Ay=t,Ay}var Ty,MO;function Dq(){if(MO)return Ty;MO=1;var e=Jp();function t(){this.__data__=e?e(null):{},this.size=0}return Ty=t,Ty}var ky,DO;function Lq(){if(DO)return ky;DO=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return ky=e,ky}var Ry,LO;function $q(){if(LO)return Ry;LO=1;var e=Jp(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var o=this.__data__;if(e){var u=o[i];return u===t?void 0:u}return n.call(o,i)?o[i]:void 0}return Ry=a,Ry}var Iy,$O;function Bq(){if($O)return Iy;$O=1;var e=Jp(),t=Object.prototype,r=t.hasOwnProperty;function n(a){var i=this.__data__;return e?i[a]!==void 0:r.call(i,a)}return Iy=n,Iy}var My,BO;function Fq(){if(BO)return My;BO=1;var e=Jp(),t="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=e&&a===void 0?t:a,this}return My=r,My}var Dy,FO;function zq(){if(FO)return Dy;FO=1;var e=Dq(),t=Lq(),r=$q(),n=Bq(),a=Fq();function i(o){var u=-1,d=o==null?0:o.length;for(this.clear();++u-1}return qy=t,qy}var Uy,GO;function Wq(){if(GO)return Uy;GO=1;var e=Qp();function t(r,n){var a=this.__data__,i=e(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return Uy=t,Uy}var Vy,KO;function Zp(){if(KO)return Vy;KO=1;var e=qq(),t=Uq(),r=Vq(),n=Hq(),a=Wq();function i(o){var u=-1,d=o==null?0:o.length;for(this.clear();++u0?1:-1},oo=function(t){return po(t)&&t.indexOf("%")===t.length-1},je=function(t){return mU(t)&&!Iu(t)},gU=function(t){return Qe(t)},er=function(t){return je(t)||po(t)},vU=0,yl=function(t){var r=++vU;return"".concat(t||"").concat(r)},Nr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!je(t)&&!po(t))return n;var i;if(oo(t)){var o=t.indexOf("%");i=r*parseFloat(t.slice(0,o))/100}else i=+t;return Iu(i)&&(i=n),a&&i>r&&(i=r),i},vi=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},yU=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function NU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function $1(e){"@babel/helpers - typeof";return $1=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},$1(e)}var SE={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Ma=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},jE=null,g0=null,US=function e(t){if(t===jE&&Array.isArray(g0))return g0;var r=[];return b.Children.forEach(t,function(n){Qe(n)||(dU.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),g0=r,jE=t,r};function tn(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return Ma(a)}):n=[Ma(t)],US(e).forEach(function(a){var i=en(a,"type.displayName")||en(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function Kr(e,t){var r=tn(e,t);return r&&r[0]}var _E=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!je(n)||n<=0||!je(a)||a<=0)},CU=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],OU=function(t){return t&&t.type&&po(t.type)&&CU.indexOf(t.type)>=0},EU=function(t){return t&&$1(t)==="object"&&"clipDot"in t},PU=function(t,r,n,a){var i,o=(i=m0?.[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!He(t)&&(a&&o.includes(r)||wU.includes(r))||n&&qS.includes(r)},Fe=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(b.isValidElement(t)&&(a=t.props),!vl(a))return null;var i={};return Object.keys(a).forEach(function(o){var u;PU((u=a)===null||u===void 0?void 0:u[o],o,r,n)&&(i[o]=a[o])}),i},B1=function e(t,r){if(t===r)return!0;var n=b.Children.count(t);if(n!==b.Children.count(r))return!1;if(n===0)return!0;if(n===1)return NE(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function IU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function z1(e){var t=e.children,r=e.width,n=e.height,a=e.viewBox,i=e.className,o=e.style,u=e.title,d=e.desc,c=RU(e,kU),h=a||{width:r,height:n,x:0,y:0},p=Ze("recharts-surface",i);return X.createElement("svg",F1({},Fe(c,!0,"svg"),{className:p,width:r,height:n,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),X.createElement("title",null,u),X.createElement("desc",null,d),t)}var MU=["children","className"];function q1(){return q1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var st=X.forwardRef(function(e,t){var r=e.children,n=e.className,a=DU(e,MU),i=Ze("recharts-layer",n);return X.createElement("g",q1({className:i},Fe(a,!0),{ref:t}),r)}),Vn=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;ii?0:i+r),n=n>i?i:n,n<0&&(n+=i),i=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(i);++a=i?r:e(r,n,a)}return y0=t,y0}var x0,PE;function XM(){if(PE)return x0;PE=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,i="\\ufe0e\\ufe0f",o="\\u200d",u=RegExp("["+o+e+a+i+"]");function d(c){return u.test(c)}return x0=d,x0}var b0,AE;function FU(){if(AE)return b0;AE=1;function e(t){return t.split("")}return b0=e,b0}var w0,TE;function zU(){if(TE)return w0;TE=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,i="\\ufe0e\\ufe0f",o="["+e+"]",u="["+a+"]",d="\\ud83c[\\udffb-\\udfff]",c="(?:"+u+"|"+d+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",x=c+"?",y="["+i+"]?",S="(?:"+v+"(?:"+[h,p,m].join("|")+")"+y+x+")*",_=y+x+S,N="(?:"+[h+u+"?",u,p,m,o].join("|")+")",O=RegExp(d+"(?="+d+")|"+N+_,"g");function A(C){return C.match(O)||[]}return w0=A,w0}var S0,kE;function qU(){if(kE)return S0;kE=1;var e=FU(),t=XM(),r=zU();function n(a){return t(a)?r(a):e(a)}return S0=n,S0}var j0,RE;function UU(){if(RE)return j0;RE=1;var e=BU(),t=XM(),r=qU(),n=HM();function a(i){return function(o){o=n(o);var u=t(o)?r(o):void 0,d=u?u[0]:o.charAt(0),c=u?e(u,1).join(""):o.slice(1);return d[i]()+c}}return j0=a,j0}var _0,IE;function VU(){if(IE)return _0;IE=1;var e=UU(),t=e("toUpperCase");return _0=t,_0}var HU=VU();const rm=ct(HU);function jt(e){return function(){return e}}const YM=Math.cos,Bh=Math.sin,Gn=Math.sqrt,Fh=Math.PI,nm=2*Fh,U1=Math.PI,V1=2*U1,no=1e-6,WU=V1-no;function JM(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return JM;const r=10**t;return function(n){this._+=n[0];for(let a=1,i=n.length;ano)if(!(Math.abs(p*d-c*h)>no)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let v=n-o,x=a-u,y=d*d+c*c,S=v*v+x*x,_=Math.sqrt(y),N=Math.sqrt(m),O=i*Math.tan((U1-Math.acos((y+m-S)/(2*_*N)))/2),A=O/N,C=O/_;Math.abs(A-1)>no&&this._append`L${t+A*h},${r+A*p}`,this._append`A${i},${i},0,0,${+(p*v>h*x)},${this._x1=t+C*d},${this._y1=r+C*c}`}}arc(t,r,n,a,i,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(a),d=n*Math.sin(a),c=t+u,h=r+d,p=1^o,m=o?a-i:i-a;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>no||Math.abs(this._y1-h)>no)&&this._append`L${c},${h}`,n&&(m<0&&(m=m%V1+V1),m>WU?this._append`A${n},${n},0,1,${p},${t-u},${r-d}A${n},${n},0,1,${p},${this._x1=c},${this._y1=h}`:m>no&&this._append`A${n},${n},0,${+(m>=U1)},${p},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function VS(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new KU(t)}function HS(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function QM(e){this._context=e}QM.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 am(e){return new QM(e)}function ZM(e){return e[0]}function eD(e){return e[1]}function tD(e,t){var r=jt(!0),n=null,a=am,i=null,o=VS(u);e=typeof e=="function"?e:e===void 0?ZM:jt(e),t=typeof t=="function"?t:t===void 0?eD:jt(t);function u(d){var c,h=(d=HS(d)).length,p,m=!1,v;for(n==null&&(i=a(v=o())),c=0;c<=h;++c)!(c=v;--x)u.point(O[x],A[x]);u.lineEnd(),u.areaEnd()}_&&(O[m]=+e(S,m,p),A[m]=+t(S,m,p),u.point(n?+n(S,m,p):O[m],r?+r(S,m,p):A[m]))}if(N)return u=null,N+""||null}function h(){return tD().defined(a).curve(o).context(i)}return c.x=function(p){return arguments.length?(e=typeof p=="function"?p:jt(+p),n=null,c):e},c.x0=function(p){return arguments.length?(e=typeof p=="function"?p:jt(+p),c):e},c.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:jt(+p),c):n},c.y=function(p){return arguments.length?(t=typeof p=="function"?p:jt(+p),r=null,c):t},c.y0=function(p){return arguments.length?(t=typeof p=="function"?p:jt(+p),c):t},c.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:jt(+p),c):r},c.lineX0=c.lineY0=function(){return h().x(e).y(t)},c.lineY1=function(){return h().x(e).y(r)},c.lineX1=function(){return h().x(n).y(t)},c.defined=function(p){return arguments.length?(a=typeof p=="function"?p:jt(!!p),c):a},c.curve=function(p){return arguments.length?(o=p,i!=null&&(u=o(i)),c):o},c.context=function(p){return arguments.length?(p==null?i=u=null:u=o(i=p),c):i},c}class rD{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function XU(e){return new rD(e,!0)}function YU(e){return new rD(e,!1)}const WS={draw(e,t){const r=Gn(t/Fh);e.moveTo(r,0),e.arc(0,0,r,0,nm)}},JU={draw(e,t){const r=Gn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},nD=Gn(1/3),QU=nD*2,ZU={draw(e,t){const r=Gn(t/QU),n=r*nD;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},e9={draw(e,t){const r=Gn(t),n=-r/2;e.rect(n,n,r,r)}},t9=.8908130915292852,aD=Bh(Fh/10)/Bh(7*Fh/10),r9=Bh(nm/10)*aD,n9=-YM(nm/10)*aD,a9={draw(e,t){const r=Gn(t*t9),n=r9*r,a=n9*r;e.moveTo(0,-r),e.lineTo(n,a);for(let i=1;i<5;++i){const o=nm*i/5,u=YM(o),d=Bh(o);e.lineTo(d*r,-u*r),e.lineTo(u*n-d*a,d*n+u*a)}e.closePath()}},N0=Gn(3),i9={draw(e,t){const r=-Gn(t/(N0*3));e.moveTo(0,r*2),e.lineTo(-N0*r,-r),e.lineTo(N0*r,-r),e.closePath()}},hn=-.5,pn=Gn(3)/2,H1=1/Gn(12),o9=(H1/2+1)*3,s9={draw(e,t){const r=Gn(t/o9),n=r/2,a=r*H1,i=n,o=r*H1+r,u=-i,d=o;e.moveTo(n,a),e.lineTo(i,o),e.lineTo(u,d),e.lineTo(hn*n-pn*a,pn*n+hn*a),e.lineTo(hn*i-pn*o,pn*i+hn*o),e.lineTo(hn*u-pn*d,pn*u+hn*d),e.lineTo(hn*n+pn*a,hn*a-pn*n),e.lineTo(hn*i+pn*o,hn*o-pn*i),e.lineTo(hn*u+pn*d,hn*d-pn*u),e.closePath()}};function l9(e,t){let r=null,n=VS(a);e=typeof e=="function"?e:jt(e||WS),t=typeof t=="function"?t:jt(t===void 0?64:+t);function a(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:jt(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:jt(+i),a):t},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function zh(){}function qh(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function iD(e){this._context=e}iD.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 c9(e){return new iD(e)}function oD(e){this._context=e}oD.prototype={areaStart:zh,areaEnd:zh,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 u9(e){return new oD(e)}function sD(e){this._context=e}sD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);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 d9(e){return new sD(e)}function lD(e){this._context=e}lD.prototype={areaStart:zh,areaEnd:zh,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 f9(e){return new lD(e)}function ME(e){return e<0?-1:1}function DE(e,t,r){var n=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(n||a<0&&-0),o=(r-e._y1)/(a||n<0&&-0),u=(i*a+o*n)/(n+a);return(ME(i)+ME(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(u))||0}function LE(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function C0(e,t,r){var n=e._x0,a=e._y0,i=e._x1,o=e._y1,u=(i-n)/3;e._context.bezierCurveTo(n+u,a+u*t,i-u,o-u*r,i,o)}function Uh(e){this._context=e}Uh.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:C0(this,this._t0,LE(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,C0(this,LE(this,r=DE(this,e,t)),r);break;default:C0(this,this._t0,r=DE(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function cD(e){this._context=new uD(e)}(cD.prototype=Object.create(Uh.prototype)).point=function(e,t){Uh.prototype.point.call(this,t,e)};function uD(e){this._context=e}uD.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,a,i){this._context.bezierCurveTo(t,e,n,r,i,a)}};function h9(e){return new Uh(e)}function p9(e){return new cD(e)}function dD(e){this._context=e}dD.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=$E(e),a=$E(t),i=0,o=1;o=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[r-1]=(e[r]+a[r-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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function g9(e){return new im(e,.5)}function v9(e){return new im(e,0)}function y9(e){return new im(e,1)}function Bs(e,t){if((o=e.length)>1)for(var r=1,n,a,i=e[t[0]],o,u=i.length;r=0;)r[t]=t;return r}function x9(e,t){return e[t]}function b9(e){const t=[];return t.key=e,t}function w9(){var e=jt([]),t=W1,r=Bs,n=x9;function a(i){var o=Array.from(e.apply(this,arguments),b9),u,d=o.length,c=-1,h;for(const p of i)for(u=0,++c;u0){for(var r,n,a=0,i=e[0].length,o;a0){for(var r=0,n=e[t[0]],a,i=n.length;r0)||!((i=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,i,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function A9(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var fD={symbolCircle:WS,symbolCross:JU,symbolDiamond:ZU,symbolSquare:e9,symbolStar:a9,symbolTriangle:i9,symbolWye:s9},T9=Math.PI/180,k9=function(t){var r="symbol".concat(rm(t));return fD[r]||WS},R9=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*T9;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},I9=function(t,r){fD["symbol".concat(rm(t))]=r},GS=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,i=a===void 0?64:a,o=t.sizeType,u=o===void 0?"area":o,d=P9(t,N9),c=FE(FE({},d),{},{type:n,size:i,sizeType:u}),h=function(){var S=k9(n),_=l9().type(S).size(R9(i,u,n));return _()},p=c.className,m=c.cx,v=c.cy,x=Fe(c,!0);return m===+m&&v===+v&&i===+i?X.createElement("path",G1({},x,{className:Ze("recharts-symbols",p),transform:"translate(".concat(m,", ").concat(v,")"),d:h()})):null};GS.registerSymbol=I9;function Fs(e){"@babel/helpers - typeof";return Fs=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},Fs(e)}function K1(){return K1=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var N=v.inactive?c:v.color;return X.createElement("li",K1({className:S,style:p,key:"legend-item-".concat(x)},mo(n.props,v,x)),X.createElement(z1,{width:o,height:o,viewBox:h,style:m},n.renderIcon(v)),X.createElement("span",{className:"recharts-legend-item-text",style:{color:N}},y?y(_,v,x):_))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,o=n.align;if(!a||!a.length)return null;var u={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return X.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(b.PureComponent);Gc(KS,"displayName","Legend");Gc(KS,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var O0,qE;function V9(){if(qE)return O0;qE=1;var e=Zp();function t(){this.__data__=new e,this.size=0}return O0=t,O0}var E0,UE;function H9(){if(UE)return E0;UE=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return E0=e,E0}var P0,VE;function W9(){if(VE)return P0;VE=1;function e(t){return this.__data__.get(t)}return P0=e,P0}var A0,HE;function G9(){if(HE)return A0;HE=1;function e(t){return this.__data__.has(t)}return A0=e,A0}var T0,WE;function K9(){if(WE)return T0;WE=1;var e=Zp(),t=$S(),r=BS(),n=200;function a(i,o){var u=this.__data__;if(u instanceof e){var d=u.__data__;if(!t||d.lengthv))return!1;var y=p.get(o),S=p.get(u);if(y&&S)return y==u&&S==o;var _=-1,N=!0,O=d&a?new e:void 0;for(p.set(o,u),p.set(u,o);++_-1&&n%1==0&&n-1&&r%1==0&&r<=e}return Z0=t,Z0}var ex,gP;function s7(){if(gP)return ex;gP=1;var e=Va(),t=QS(),r=Ha(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",u="[object Error]",d="[object Function]",c="[object Map]",h="[object Number]",p="[object Object]",m="[object RegExp]",v="[object Set]",x="[object String]",y="[object WeakMap]",S="[object ArrayBuffer]",_="[object DataView]",N="[object Float32Array]",O="[object Float64Array]",A="[object Int8Array]",C="[object Int16Array]",E="[object Int32Array]",T="[object Uint8Array]",R="[object Uint8ClampedArray]",L="[object Uint16Array]",z="[object Uint32Array]",F={};F[N]=F[O]=F[A]=F[C]=F[E]=F[T]=F[R]=F[L]=F[z]=!0,F[n]=F[a]=F[S]=F[i]=F[_]=F[o]=F[u]=F[d]=F[c]=F[h]=F[p]=F[m]=F[v]=F[x]=F[y]=!1;function B(q){return r(q)&&t(q.length)&&!!F[e(q)]}return ex=B,ex}var tx,vP;function SD(){if(vP)return tx;vP=1;function e(t){return function(r){return t(r)}}return tx=e,tx}var Rc={exports:{}};Rc.exports;var yP;function l7(){return yP||(yP=1,(function(e,t){var r=qM(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&r.process,u=(function(){try{var d=a&&a.require&&a.require("util").types;return d||o&&o.binding&&o.binding("util")}catch{}})();e.exports=u})(Rc,Rc.exports)),Rc.exports}var rx,xP;function jD(){if(xP)return rx;xP=1;var e=s7(),t=SD(),r=l7(),n=r&&r.isTypedArray,a=n?t(n):e;return rx=a,rx}var nx,bP;function c7(){if(bP)return nx;bP=1;var e=a7(),t=YS(),r=$r(),n=wD(),a=JS(),i=jD(),o=Object.prototype,u=o.hasOwnProperty;function d(c,h){var p=r(c),m=!p&&t(c),v=!p&&!m&&n(c),x=!p&&!m&&!v&&i(c),y=p||m||v||x,S=y?e(c.length,String):[],_=S.length;for(var N in c)(h||u.call(c,N))&&!(y&&(N=="length"||v&&(N=="offset"||N=="parent")||x&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||a(N,_)))&&S.push(N);return S}return nx=d,nx}var ax,wP;function u7(){if(wP)return ax;wP=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return ax=t,ax}var ix,SP;function _D(){if(SP)return ix;SP=1;function e(t,r){return function(n){return t(r(n))}}return ix=e,ix}var ox,jP;function d7(){if(jP)return ox;jP=1;var e=_D(),t=e(Object.keys,Object);return ox=t,ox}var sx,_P;function f7(){if(_P)return sx;_P=1;var e=u7(),t=d7(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!e(i))return t(i);var o=[];for(var u in Object(i))n.call(i,u)&&u!="constructor"&&o.push(u);return o}return sx=a,sx}var lx,NP;function Mu(){if(NP)return lx;NP=1;var e=DS(),t=QS();function r(n){return n!=null&&t(n.length)&&!e(n)}return lx=r,lx}var cx,CP;function om(){if(CP)return cx;CP=1;var e=c7(),t=f7(),r=Mu();function n(a){return r(a)?e(a):t(a)}return cx=n,cx}var ux,OP;function h7(){if(OP)return ux;OP=1;var e=e7(),t=n7(),r=om();function n(a){return e(a,r,t)}return ux=n,ux}var dx,EP;function p7(){if(EP)return dx;EP=1;var e=h7(),t=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,o,u,d,c,h){var p=u&t,m=e(i),v=m.length,x=e(o),y=x.length;if(v!=y&&!p)return!1;for(var S=v;S--;){var _=m[S];if(!(p?_ in o:n.call(o,_)))return!1}var N=h.get(i),O=h.get(o);if(N&&O)return N==o&&O==i;var A=!0;h.set(i,o),h.set(o,i);for(var C=p;++S-1}return Lx=t,Lx}var $x,tA;function I7(){if(tA)return $x;tA=1;function e(t,r,n){for(var a=-1,i=t==null?0:t.length;++a=o){var _=c?null:a(d);if(_)return i(_);x=!1,m=n,S=new e}else S=c?[]:y;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function X7(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Y7(e){return e.value}function J7(e,t){if(X.isValidElement(e))return X.cloneElement(e,t);if(typeof e=="function")return X.createElement(e,t);t.ref;var r=K7(t,F7);return X.createElement(KS,r)}var cA=1,Ps=(function(e){function t(){var r;z7(this,t);for(var n=arguments.length,a=new Array(n),i=0;icA||Math.abs(a.height-this.lastBoundingBox.height)>cA)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Pa({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,o=a.align,u=a.verticalAlign,d=a.margin,c=a.chartWidth,h=a.chartHeight,p,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var v=this.getBBoxSnapshot();p={left:((c||0)-v.width)/2}}else p=o==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var x=this.getBBoxSnapshot();m={top:((h||0)-x.height)/2}}else m=u==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return Pa(Pa({},p),m)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,o=a.width,u=a.height,d=a.wrapperStyle,c=a.payloadUniqBy,h=a.payload,p=Pa(Pa({position:"absolute",width:o||"auto",height:u||"auto"},this.getDefaultPosition(d)),d);return X.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(v){n.wrapperNode=v}},J7(i,Pa(Pa({},this.props),{},{payload:PD(h,c,Y7)})))}}],[{key:"getWithHeight",value:function(n,a){var i=Pa(Pa({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&je(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||a}:null}}])})(b.PureComponent);sm(Ps,"displayName","Legend");sm(Ps,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Ux,uA;function Q7(){if(uA)return Ux;uA=1;var e=Ru(),t=YS(),r=$r(),n=e?e.isConcatSpreadable:void 0;function a(i){return r(i)||t(i)||!!(n&&i&&i[n])}return Ux=a,Ux}var Vx,dA;function kD(){if(dA)return Vx;dA=1;var e=bD(),t=Q7();function r(n,a,i,o,u){var d=-1,c=n.length;for(i||(i=t),u||(u=[]);++d0&&i(h)?a>1?r(h,a-1,i,o,u):e(u,h):o||(u[u.length]=h)}return u}return Vx=r,Vx}var Hx,fA;function Z7(){if(fA)return Hx;fA=1;function e(t){return function(r,n,a){for(var i=-1,o=Object(r),u=a(r),d=u.length;d--;){var c=u[t?d:++i];if(n(o[c],c,o)===!1)break}return r}}return Hx=e,Hx}var Wx,hA;function eV(){if(hA)return Wx;hA=1;var e=Z7(),t=e();return Wx=t,Wx}var Gx,pA;function RD(){if(pA)return Gx;pA=1;var e=eV(),t=om();function r(n,a){return n&&e(n,a,t)}return Gx=r,Gx}var Kx,mA;function tV(){if(mA)return Kx;mA=1;var e=Mu();function t(r,n){return function(a,i){if(a==null)return a;if(!e(a))return r(a,i);for(var o=a.length,u=n?o:-1,d=Object(a);(n?u--:++un||u&&d&&h&&!c&&!p||i&&d&&h||!a&&h||!o)return 1;if(!i&&!u&&!p&&r=c)return h;var p=a[i];return h*(p=="desc"?-1:1)}}return r.index-n.index}return Zx=t,Zx}var eb,wA;function iV(){if(wA)return eb;wA=1;var e=FS(),t=zS(),r=ha(),n=ID(),a=rV(),i=SD(),o=aV(),u=xl(),d=$r();function c(h,p,m){p.length?p=e(p,function(y){return d(y)?function(S){return t(S,y.length===1?y[0]:y)}:y}):p=[u];var v=-1;p=e(p,i(r));var x=n(h,function(y,S,_){var N=e(p,function(O){return O(y)});return{criteria:N,index:++v,value:y}});return a(x,function(y,S){return o(y,S,m)})}return eb=c,eb}var tb,SA;function oV(){if(SA)return tb;SA=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return tb=e,tb}var rb,jA;function sV(){if(jA)return rb;jA=1;var e=oV(),t=Math.max;function r(n,a,i){return a=t(a===void 0?n.length-1:a,0),function(){for(var o=arguments,u=-1,d=t(o.length-a,0),c=Array(d);++u0){if(++i>=e)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return ob=n,ob}var sb,EA;function dV(){if(EA)return sb;EA=1;var e=cV(),t=uV(),r=t(e);return sb=r,sb}var lb,PA;function fV(){if(PA)return lb;PA=1;var e=xl(),t=sV(),r=dV();function n(a,i){return r(t(a,i,e),a+"")}return lb=n,lb}var cb,AA;function lm(){if(AA)return cb;AA=1;var e=LS(),t=Mu(),r=JS(),n=Pi();function a(i,o,u){if(!n(u))return!1;var d=typeof o;return(d=="number"?t(u)&&r(o,u.length):d=="string"&&o in u)?e(u[o],i):!1}return cb=a,cb}var ub,TA;function hV(){if(TA)return ub;TA=1;var e=kD(),t=iV(),r=fV(),n=lm(),a=r(function(i,o){if(i==null)return[];var u=o.length;return u>1&&n(i,o[0],o[1])?o=[]:u>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),t(i,e(o,1),[])});return ub=a,ub}var pV=hV();const tj=ct(pV);function Kc(e){"@babel/helpers - typeof";return Kc=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},Kc(e)}function J1(){return J1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(gc,"-left"),je(r)&&t&&je(t.x)&&r=t.y),"".concat(gc,"-top"),je(n)&&t&&je(t.y)&&ny?Math.max(h,d[n]):Math.max(p,d[n])}function PV(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function AV(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,u=e.useTranslate3d,d=e.viewBox,c,h,p;return o.height>0&&o.width>0&&r?(h=IA({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:d,viewBoxDimension:d.width}),p=IA({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:d,viewBoxDimension:d.height}),c=PV({translateX:h,translateY:p,useTranslate3d:u})):c=OV,{cssProperties:c,cssClasses:EV({translateX:h,translateY:p,coordinate:r})}}function qs(e){"@babel/helpers - typeof";return qs=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},qs(e)}function MA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function DA(e){for(var t=1;tLA||Math.abs(n.height-this.state.lastBoundingBox.height)>LA)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,u=a.animationDuration,d=a.animationEasing,c=a.children,h=a.coordinate,p=a.hasPayload,m=a.isAnimationActive,v=a.offset,x=a.position,y=a.reverseDirection,S=a.useTranslate3d,_=a.viewBox,N=a.wrapperStyle,O=AV({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:v,position:x,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:S,viewBox:_}),A=O.cssClasses,C=O.cssProperties,E=DA(DA({transition:m&&i?"transform ".concat(u,"ms ").concat(d):void 0},C),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&p?"visible":"hidden",position:"absolute",top:0,left:0},N);return X.createElement("div",{tabIndex:-1,className:A,style:E,ref:function(R){n.wrapperNode=R}},c)}}])})(b.PureComponent),FV=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ao={isSsr:FV()};function Us(e){"@babel/helpers - typeof";return Us=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},Us(e)}function $A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function BA(e){for(var t=1;t0;return X.createElement(BV,{allowEscapeViewBox:o,animationDuration:u,animationEasing:d,isAnimationActive:m,active:i,coordinate:h,hasPayload:E,offset:v,position:S,reverseDirection:_,useTranslate3d:N,viewBox:O,wrapperStyle:A},YV(c,BA(BA({},this.props),{},{payload:C})))}}])})(b.PureComponent);rj(Yr,"displayName","Tooltip");rj(Yr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ao.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var fb,FA;function JV(){if(FA)return fb;FA=1;var e=fa(),t=function(){return e.Date.now()};return fb=t,fb}var hb,zA;function QV(){if(zA)return hb;zA=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return hb=t,hb}var pb,qA;function ZV(){if(qA)return pb;qA=1;var e=QV(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return pb=r,pb}var mb,UA;function FD(){if(UA)return mb;UA=1;var e=ZV(),t=Pi(),r=gl(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,u=parseInt;function d(c){if(typeof c=="number")return c;if(r(c))return n;if(t(c)){var h=typeof c.valueOf=="function"?c.valueOf():c;c=t(h)?h+"":h}if(typeof c!="string")return c===0?c:+c;c=e(c);var p=i.test(c);return p||o.test(c)?u(c.slice(2),p?2:8):a.test(c)?n:+c}return mb=d,mb}var gb,VA;function eH(){if(VA)return gb;VA=1;var e=Pi(),t=JV(),r=FD(),n="Expected a function",a=Math.max,i=Math.min;function o(u,d,c){var h,p,m,v,x,y,S=0,_=!1,N=!1,O=!0;if(typeof u!="function")throw new TypeError(n);d=r(d)||0,e(c)&&(_=!!c.leading,N="maxWait"in c,m=N?a(r(c.maxWait)||0,d):m,O="trailing"in c?!!c.trailing:O);function A(q){var H=h,V=p;return h=p=void 0,S=q,v=u.apply(V,H),v}function C(q){return S=q,x=setTimeout(R,d),_?A(q):v}function E(q){var H=q-y,V=q-S,G=d-H;return N?i(G,m-V):G}function T(q){var H=q-y,V=q-S;return y===void 0||H>=d||H<0||N&&V>=m}function R(){var q=t();if(T(q))return L(q);x=setTimeout(R,E(q))}function L(q){return x=void 0,O&&h?A(q):(h=p=void 0,v)}function z(){x!==void 0&&clearTimeout(x),S=0,h=y=p=x=void 0}function F(){return x===void 0?v:L(t())}function B(){var q=t(),H=T(q);if(h=arguments,p=this,y=q,H){if(x===void 0)return C(y);if(N)return clearTimeout(x),x=setTimeout(R,d),A(y)}return x===void 0&&(x=setTimeout(R,d)),v}return B.cancel=z,B.flush=F,B}return gb=o,gb}var vb,HA;function tH(){if(HA)return vb;HA=1;var e=eH(),t=Pi(),r="Expected a function";function n(a,i,o){var u=!0,d=!0;if(typeof a!="function")throw new TypeError(r);return t(o)&&(u="leading"in o?!!o.leading:u,d="trailing"in o?!!o.trailing:d),e(a,i,{leading:u,maxWait:i,trailing:d})}return vb=n,vb}var rH=tH();const zD=ct(rH);function Yc(e){"@babel/helpers - typeof";return Yc=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},Yc(e)}function WA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Cf(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(q=zD(q,y,{trailing:!0,leading:!1}));var H=new ResizeObserver(q),V=C.current.getBoundingClientRect(),G=V.width,U=V.height;return F(G,U),H.observe(C.current),function(){H.disconnect()}},[F,y]);var B=b.useMemo(function(){var q=L.containerWidth,H=L.containerHeight;if(q<0||H<0)return null;Vn(oo(o)||oo(d),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,o,d),Vn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var V=oo(o)?q:o,G=oo(d)?H:d;r&&r>0&&(V?G=V/r:G&&(V=G*r),m&&G>m&&(G=m)),Vn(V>0||G>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.`,V,G,o,d,h,p,r);var U=!Array.isArray(v)&&Ma(v.type).endsWith("Chart");return X.Children.map(v,function($){return X.isValidElement($)?b.cloneElement($,Cf({width:V,height:G},U?{style:Cf({height:"100%",width:"100%",maxHeight:G,maxWidth:V},$.props.style)}:{})):$})},[r,v,d,m,p,h,L,o]);return X.createElement("div",{id:S?"".concat(S):void 0,className:Ze("recharts-responsive-container",_),style:Cf(Cf({},A),{},{width:o,height:d,minWidth:h,minHeight:p,maxHeight:m}),ref:C},B)}),cm=function(t){return null};cm.displayName="Cell";function Jc(e){"@babel/helpers - typeof";return Jc=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},Jc(e)}function KA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function tw(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ao.isSsr)return{width:0,height:0};var n=gH(r),a=JSON.stringify({text:t,copyStyle:n});if(ls.widthCache[a])return ls.widthCache[a];try{var i=document.getElementById(XA);i||(i=document.createElement("span"),i.setAttribute("id",XA),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=tw(tw({},mH),n);Object.assign(i.style,o),i.textContent="".concat(t);var u=i.getBoundingClientRect(),d={width:u.width,height:u.height};return ls.widthCache[a]=d,++ls.cacheCount>pH&&(ls.cacheCount=0,ls.widthCache={}),d}catch{return{width:0,height:0}}},vH=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Qc(e){"@babel/helpers - typeof";return Qc=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},Qc(e)}function Xh(e,t){return wH(e)||bH(e,t)||xH(e,t)||yH()}function yH(){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 xH(e,t){if(e){if(typeof e=="string")return YA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return YA(e,t)}}function YA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function MH(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function r2(e,t){return BH(e)||$H(e,t)||LH(e,t)||DH()}function DH(){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 LH(e,t){if(e){if(typeof e=="string")return n2(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n2(e,t)}}function n2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return V.reduce(function(G,U){var $=U.word,Q=U.width,k=G[G.length-1];if(k&&(a==null||i||k.width+Q+nU.width?G:U})};if(!h)return v;for(var y="…",S=function(V){var G=p.slice(0,V),U=HD({breakAll:c,style:d,children:G+y}).wordsWithComputedWidth,$=m(U),Q=$.length>o||x($).width>Number(a);return[Q,$]},_=0,N=p.length-1,O=0,A;_<=N&&O<=p.length-1;){var C=Math.floor((_+N)/2),E=C-1,T=S(E),R=r2(T,2),L=R[0],z=R[1],F=S(C),B=r2(F,1),q=B[0];if(!L&&!q&&(_=C+1),L&&q&&(N=C-1),!L&&q){A=z;break}O++}return A||v},a2=function(t){var r=Qe(t)?[]:t.toString().split(VD);return[{words:r}]},zH=function(t){var r=t.width,n=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,u=t.maxLines;if((r||n)&&!Ao.isSsr){var d,c,h=HD({breakAll:o,children:a,style:i});if(h){var p=h.wordsWithComputedWidth,m=h.spaceWidth;d=p,c=m}else return a2(a);return FH({breakAll:o,children:a,maxLines:u,style:i},d,c,r,n)}return a2(a)},i2="#808080",go=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.lineHeight,u=o===void 0?"1em":o,d=t.capHeight,c=d===void 0?"0.71em":d,h=t.scaleToFit,p=h===void 0?!1:h,m=t.textAnchor,v=m===void 0?"start":m,x=t.verticalAnchor,y=x===void 0?"end":x,S=t.fill,_=S===void 0?i2:S,N=t2(t,RH),O=b.useMemo(function(){return zH({breakAll:N.breakAll,children:N.children,maxLines:N.maxLines,scaleToFit:p,style:N.style,width:N.width})},[N.breakAll,N.children,N.maxLines,p,N.style,N.width]),A=N.dx,C=N.dy,E=N.angle,T=N.className,R=N.breakAll,L=t2(N,IH);if(!er(n)||!er(i))return null;var z=n+(je(A)?A:0),F=i+(je(C)?C:0),B;switch(y){case"start":B=yb("calc(".concat(c,")"));break;case"middle":B=yb("calc(".concat((O.length-1)/2," * -").concat(u," + (").concat(c," / 2))"));break;default:B=yb("calc(".concat(O.length-1," * -").concat(u,")"));break}var q=[];if(p){var H=O[0].width,V=N.width;q.push("scale(".concat((je(V)?V/H:1)/H,")"))}return E&&q.push("rotate(".concat(E,", ").concat(z,", ").concat(F,")")),q.length&&(L.transform=q.join(" ")),X.createElement("text",rw({},Fe(L,!0),{x:z,y:F,className:Ze("recharts-text",T),textAnchor:v,fill:_.includes("url")?i2:_}),O.map(function(G,U){var $=G.words.join(R?"":" ");return X.createElement("tspan",{x:z,dy:U===0?B:u,key:"".concat($,"-").concat(U)},$)}))};function xi(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function qH(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function nj(e){let t,r,n;e.length!==2?(t=xi,r=(u,d)=>xi(e(u),d),n=(u,d)=>e(u)-d):(t=e===xi||e===qH?e:UH,r=e,n=e);function a(u,d,c=0,h=u.length){if(c>>1;r(u[p],d)<0?c=p+1:h=p}while(c>>1;r(u[p],d)<=0?c=p+1:h=p}while(cc&&n(u[p-1],d)>-n(u[p],d)?p-1:p}return{left:a,center:o,right:i}}function UH(){return 0}function WD(e){return e===null?NaN:+e}function*VH(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const HH=nj(xi),Du=HH.right;nj(WD).center;class o2 extends Map{constructor(t,r=KH){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(s2(this,t))}has(t){return super.has(s2(this,t))}set(t,r){return super.set(WH(this,t),r)}delete(t){return super.delete(GH(this,t))}}function s2({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function WH({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function GH({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function KH(e){return e!==null&&typeof e=="object"?e.valueOf():e}function XH(e=xi){if(e===xi)return GD;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function GD(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const YH=Math.sqrt(50),JH=Math.sqrt(10),QH=Math.sqrt(2);function Yh(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=YH?10:i>=JH?5:i>=QH?2:1;let u,d,c;return a<0?(c=Math.pow(10,-a)/o,u=Math.round(e*c),d=Math.round(t*c),u/ct&&--d,c=-c):(c=Math.pow(10,a)*o,u=Math.round(e/c),d=Math.round(t/c),u*ct&&--d),d0))return[];if(e===t)return[e];const n=t=a))return[];const u=i-a+1,d=new Array(u);if(n)if(o<0)for(let c=0;c=n)&&(r=n);return r}function c2(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function KD(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?GD:XH(a);n>r;){if(n-r>600){const d=n-r+1,c=t-r+1,h=Math.log(d),p=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*p*(d-p)/d)*(c-d/2<0?-1:1),v=Math.max(r,Math.floor(t-c*p/d+m)),x=Math.min(n,Math.floor(t+(d-c)*p/d+m));KD(e,t,v,x,a)}const i=e[t];let o=r,u=n;for(vc(e,r,t),a(e[n],i)>0&&vc(e,r,n);o0;)--u}a(e[r],i)===0?vc(e,r,u):(++u,vc(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function vc(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function ZH(e,t,r){if(e=Float64Array.from(VH(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return c2(e);if(t>=1)return l2(e);var n,a=(n-1)*t,i=Math.floor(a),o=l2(KD(e,i).subarray(0,i+1)),u=c2(e.subarray(i+1));return o+(u-o)*(a-i)}}function eW(e,t,r=WD){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,i=Math.floor(a),o=+r(e[i],i,e),u=+r(e[i+1],i+1,e);return o+(u-o)*(a-i)}}function tW(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(a);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Ef(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Ef(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=nW.exec(e))?new Dr(t[1],t[2],t[3],1):(t=aW.exec(e))?new Dr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=iW.exec(e))?Ef(t[1],t[2],t[3],t[4]):(t=oW.exec(e))?Ef(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=sW.exec(e))?g2(t[1],t[2]/100,t[3]/100,1):(t=lW.exec(e))?g2(t[1],t[2]/100,t[3]/100,t[4]):u2.hasOwnProperty(e)?h2(u2[e]):e==="transparent"?new Dr(NaN,NaN,NaN,0):null}function h2(e){return new Dr(e>>16&255,e>>8&255,e&255,1)}function Ef(e,t,r,n){return n<=0&&(e=t=r=NaN),new Dr(e,t,r,n)}function dW(e){return e instanceof Lu||(e=ru(e)),e?(e=e.rgb(),new Dr(e.r,e.g,e.b,e.opacity)):new Dr}function sw(e,t,r,n){return arguments.length===1?dW(e):new Dr(e,t,r,n??1)}function Dr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}ij(Dr,sw,YD(Lu,{brighter(e){return e=e==null?Jh:Math.pow(Jh,e),new Dr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?eu:Math.pow(eu,e),new Dr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Dr(fo(this.r),fo(this.g),fo(this.b),Qh(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:p2,formatHex:p2,formatHex8:fW,formatRgb:m2,toString:m2}));function p2(){return`#${so(this.r)}${so(this.g)}${so(this.b)}`}function fW(){return`#${so(this.r)}${so(this.g)}${so(this.b)}${so((isNaN(this.opacity)?1:this.opacity)*255)}`}function m2(){const e=Qh(this.opacity);return`${e===1?"rgb(":"rgba("}${fo(this.r)}, ${fo(this.g)}, ${fo(this.b)}${e===1?")":`, ${e})`}`}function Qh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function fo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function so(e){return e=fo(e),(e<16?"0":"")+e.toString(16)}function g2(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new qn(e,t,r,n)}function JD(e){if(e instanceof qn)return new qn(e.h,e.s,e.l,e.opacity);if(e instanceof Lu||(e=ru(e)),!e)return new qn;if(e instanceof qn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),i=Math.max(t,r,n),o=NaN,u=i-a,d=(i+a)/2;return u?(t===i?o=(r-n)/u+(r0&&d<1?0:o,new qn(o,u,d,e.opacity)}function hW(e,t,r,n){return arguments.length===1?JD(e):new qn(e,t,r,n??1)}function qn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}ij(qn,hW,YD(Lu,{brighter(e){return e=e==null?Jh:Math.pow(Jh,e),new qn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?eu:Math.pow(eu,e),new qn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new Dr(xb(e>=240?e-240:e+120,a,n),xb(e,a,n),xb(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new qn(v2(this.h),Pf(this.s),Pf(this.l),Qh(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=Qh(this.opacity);return`${e===1?"hsl(":"hsla("}${v2(this.h)}, ${Pf(this.s)*100}%, ${Pf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function v2(e){return e=(e||0)%360,e<0?e+360:e}function Pf(e){return Math.max(0,Math.min(1,e||0))}function xb(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const oj=e=>()=>e;function pW(e,t){return function(r){return e+r*t}}function mW(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function gW(e){return(e=+e)==1?QD:function(t,r){return r-t?mW(t,r,e):oj(isNaN(t)?r:t)}}function QD(e,t){var r=t-e;return r?pW(e,r):oj(isNaN(e)?t:e)}const y2=(function e(t){var r=gW(t);function n(a,i){var o=r((a=sw(a)).r,(i=sw(i)).r),u=r(a.g,i.g),d=r(a.b,i.b),c=QD(a.opacity,i.opacity);return function(h){return a.r=o(h),a.g=u(h),a.b=d(h),a.opacity=c(h),a+""}}return n.gamma=e,n})(1);function vW(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(i){for(a=0;ar&&(i=t.slice(r,i),u[o]?u[o]+=i:u[++o]=i),(n=n[0])===(a=a[0])?u[o]?u[o]+=a:u[++o]=a:(u[++o]=null,d.push({i:o,x:Zh(n,a)})),r=bb.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function EW(e,t,r){var n=e[0],a=e[1],i=t[0],o=t[1];return a2?PW:EW,d=c=null,p}function p(m){return m==null||isNaN(m=+m)?i:(d||(d=u(e.map(n),t,r)))(n(o(m)))}return p.invert=function(m){return o(a((c||(c=u(t,e.map(n),Zh)))(m)))},p.domain=function(m){return arguments.length?(e=Array.from(m,ep),h()):e.slice()},p.range=function(m){return arguments.length?(t=Array.from(m),h()):t.slice()},p.rangeRound=function(m){return t=Array.from(m),r=sj,h()},p.clamp=function(m){return arguments.length?(o=m?!0:Cr,h()):o!==Cr},p.interpolate=function(m){return arguments.length?(r=m,h()):r},p.unknown=function(m){return arguments.length?(i=m,p):i},function(m,v){return n=m,a=v,h()}}function lj(){return um()(Cr,Cr)}function AW(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function tp(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Vs(e){return e=tp(Math.abs(e)),e?e[1]:NaN}function TW(e,t){return function(r,n){for(var a=r.length,i=[],o=0,u=e[0],d=0;a>0&&u>0&&(d+u+1>n&&(u=Math.max(1,n-d)),i.push(r.substring(a-=u,a+u)),!((d+=u+1)>n));)u=e[o=(o+1)%e.length];return i.reverse().join(t)}}function kW(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var RW=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function nu(e){if(!(t=RW.exec(e)))throw new Error("invalid format: "+e);var t;return new cj({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]})}nu.prototype=cj.prototype;function cj(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+""}cj.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 IW(e){e:for(var t=e.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var rp;function MW(e,t){var r=tp(e,t);if(!r)return rp=void 0,e.toPrecision(t);var n=r[0],a=r[1],i=a-(rp=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+tp(e,Math.max(0,t+i-1))[0]}function b2(e,t){var r=tp(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const w2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:AW,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)=>b2(e*100,t),r:b2,s:MW,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function S2(e){return e}var j2=Array.prototype.map,_2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function DW(e){var t=e.grouping===void 0||e.thousands===void 0?S2:TW(j2.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?S2:kW(j2.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function c(p,m){p=nu(p);var v=p.fill,x=p.align,y=p.sign,S=p.symbol,_=p.zero,N=p.width,O=p.comma,A=p.precision,C=p.trim,E=p.type;E==="n"?(O=!0,E="g"):w2[E]||(A===void 0&&(A=12),C=!0,E="g"),(_||v==="0"&&x==="=")&&(_=!0,v="0",x="=");var T=(m&&m.prefix!==void 0?m.prefix:"")+(S==="$"?r:S==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():""),R=(S==="$"?n:/[%p]/.test(E)?o:"")+(m&&m.suffix!==void 0?m.suffix:""),L=w2[E],z=/[defgprs%]/.test(E);A=A===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function F(B){var q=T,H=R,V,G,U;if(E==="c")H=L(B)+H,B="";else{B=+B;var $=B<0||1/B<0;if(B=isNaN(B)?d:L(Math.abs(B),A),C&&(B=IW(B)),$&&+B==0&&y!=="+"&&($=!1),q=($?y==="("?y:u:y==="-"||y==="("?"":y)+q,H=(E==="s"&&!isNaN(B)&&rp!==void 0?_2[8+rp/3]:"")+H+($&&y==="("?")":""),z){for(V=-1,G=B.length;++VU||U>57){H=(U===46?a+B.slice(V+1):B.slice(V))+H,B=B.slice(0,V);break}}}O&&!_&&(B=t(B,1/0));var Q=q.length+B.length+H.length,k=Q>1)+q+B+H+k.slice(Q);break;default:B=k+q+B+H;break}return i(B)}return F.toString=function(){return p+""},F}function h(p,m){var v=Math.max(-8,Math.min(8,Math.floor(Vs(m)/3)))*3,x=Math.pow(10,-v),y=c((p=nu(p),p.type="f",p),{suffix:_2[8+v/3]});return function(S){return y(x*S)}}return{format:c,formatPrefix:h}}var Af,uj,ZD;LW({thousands:",",grouping:[3],currency:["$",""]});function LW(e){return Af=DW(e),uj=Af.format,ZD=Af.formatPrefix,Af}function $W(e){return Math.max(0,-Vs(Math.abs(e)))}function BW(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Vs(t)/3)))*3-Vs(Math.abs(e)))}function FW(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Vs(t)-Vs(e))+1}function eL(e,t,r,n){var a=iw(e,t,r),i;switch(n=nu(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=BW(a,o))&&(n.precision=i),ZD(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=FW(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=$W(a))&&(n.precision=i-(n.type==="%")*2);break}}return uj(n)}function Ai(e){var t=e.domain;return e.ticks=function(r){var n=t();return nw(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return eL(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,i=n.length-1,o=n[a],u=n[i],d,c,h=10;for(u0;){if(c=aw(o,u,r),c===d)return n[a]=o,n[i]=u,t(n);if(c>0)o=Math.floor(o/c)*c,u=Math.ceil(u/c)*c;else if(c<0)o=Math.ceil(o*c)/c,u=Math.floor(u*c)/c;else break;d=c}return e},e}function np(){var e=lj();return e.copy=function(){return $u(e,np())},Nn.apply(e,arguments),Ai(e)}function tL(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,ep),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return tL(e).unknown(t)},e=arguments.length?Array.from(e,ep):[0,1],Ai(r)}function rL(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],i=e[n],o;return iMath.pow(e,t)}function HW(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 O2(e){return(t,r)=>-e(-t,r)}function dj(e){const t=e(N2,C2),r=t.domain;let n=10,a,i;function o(){return a=HW(n),i=VW(n),r()[0]<0?(a=O2(a),i=O2(i),e(zW,qW)):e(N2,C2),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const d=r();let c=d[0],h=d[d.length-1];const p=h0){for(;m<=v;++m)for(x=1;xh)break;_.push(y)}}else for(;m<=v;++m)for(x=n-1;x>=1;--x)if(y=m>0?x/i(-m):x*i(m),!(yh)break;_.push(y)}_.length*2{if(u==null&&(u=10),d==null&&(d=n===10?"s":","),typeof d!="function"&&(!(n%1)&&(d=nu(d)).precision==null&&(d.trim=!0),d=uj(d)),u===1/0)return d;const c=Math.max(1,n*u/t.ticks().length);return h=>{let p=h/i(Math.round(a(h)));return p*nr(rL(r(),{floor:u=>i(Math.floor(a(u))),ceil:u=>i(Math.ceil(a(u)))})),t}function nL(){const e=dj(um()).domain([1,10]);return e.copy=()=>$u(e,nL()).base(e.base()),Nn.apply(e,arguments),e}function E2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function P2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function fj(e){var t=1,r=e(E2(t),P2(t));return r.constant=function(n){return arguments.length?e(E2(t=+n),P2(t)):t},Ai(r)}function aL(){var e=fj(um());return e.copy=function(){return $u(e,aL()).constant(e.constant())},Nn.apply(e,arguments)}function A2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function WW(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function GW(e){return e<0?-e*e:e*e}function hj(e){var t=e(Cr,Cr),r=1;function n(){return r===1?e(Cr,Cr):r===.5?e(WW,GW):e(A2(r),A2(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Ai(t)}function pj(){var e=hj(um());return e.copy=function(){return $u(e,pj()).exponent(e.exponent())},Nn.apply(e,arguments),e}function KW(){return pj.apply(null,arguments).exponent(.5)}function T2(e){return Math.sign(e)*e*e}function XW(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function iL(){var e=lj(),t=[0,1],r=!1,n;function a(i){var o=XW(e(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return e.invert(T2(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,ep)).map(T2)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return iL(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Nn.apply(a,arguments),Ai(a)}function oL(){var e=[],t=[],r=[],n;function a(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[c-1],n[c]]},o.unknown=function(d){return arguments.length&&(i=d),o},o.thresholds=function(){return n.slice()},o.copy=function(){return sL().domain([e,t]).range(a).unknown(i)},Nn.apply(Ai(o),arguments)}function lL(){var e=[.5],t=[0,1],r,n=1;function a(i){return i!=null&&i<=i?t[Du(e,i,0,n)]:r}return a.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return lL().domain(e).range(t).unknown(r)},Nn.apply(a,arguments)}const wb=new Date,Sb=new Date;function tr(e,t,r,n){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),u=a.ceil(i);return i-o(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,u)=>{const d=[];if(i=a.ceil(i),u=u==null?1:Math.floor(u),!(i0))return d;let c;do d.push(c=new Date(+i)),t(i,u),e(i);while(ctr(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!i(o););else for(;--u>=0;)for(;t(o,1),!i(o););}),r&&(a.count=(i,o)=>(wb.setTime(+i),Sb.setTime(+o),e(wb),e(Sb),Math.floor(r(wb,Sb))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const ap=tr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ap.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?tr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):ap);ap.range;const ka=1e3,bn=ka*60,Ra=bn*60,$a=Ra*24,mj=$a*7,k2=$a*30,jb=$a*365,lo=tr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ka)},(e,t)=>(t-e)/ka,e=>e.getUTCSeconds());lo.range;const gj=tr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ka)},(e,t)=>{e.setTime(+e+t*bn)},(e,t)=>(t-e)/bn,e=>e.getMinutes());gj.range;const vj=tr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*bn)},(e,t)=>(t-e)/bn,e=>e.getUTCMinutes());vj.range;const yj=tr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ka-e.getMinutes()*bn)},(e,t)=>{e.setTime(+e+t*Ra)},(e,t)=>(t-e)/Ra,e=>e.getHours());yj.range;const xj=tr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Ra)},(e,t)=>(t-e)/Ra,e=>e.getUTCHours());xj.range;const Bu=tr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*bn)/$a,e=>e.getDate()-1);Bu.range;const dm=tr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$a,e=>e.getUTCDate()-1);dm.range;const cL=tr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/$a,e=>Math.floor(e/$a));cL.range;function To(e){return tr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*bn)/mj)}const fm=To(0),ip=To(1),YW=To(2),JW=To(3),Hs=To(4),QW=To(5),ZW=To(6);fm.range;ip.range;YW.range;JW.range;Hs.range;QW.range;ZW.range;function ko(e){return tr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/mj)}const hm=ko(0),op=ko(1),eG=ko(2),tG=ko(3),Ws=ko(4),rG=ko(5),nG=ko(6);hm.range;op.range;eG.range;tG.range;Ws.range;rG.range;nG.range;const bj=tr(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());bj.range;const wj=tr(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());wj.range;const Ba=tr(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());Ba.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:tr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Ba.range;const Fa=tr(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());Fa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:tr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Fa.range;function uL(e,t,r,n,a,i){const o=[[lo,1,ka],[lo,5,5*ka],[lo,15,15*ka],[lo,30,30*ka],[i,1,bn],[i,5,5*bn],[i,15,15*bn],[i,30,30*bn],[a,1,Ra],[a,3,3*Ra],[a,6,6*Ra],[a,12,12*Ra],[n,1,$a],[n,2,2*$a],[r,1,mj],[t,1,k2],[t,3,3*k2],[e,1,jb]];function u(c,h,p){const m=hS).right(o,m);if(v===o.length)return e.every(iw(c/jb,h/jb,p));if(v===0)return ap.every(Math.max(iw(c,h,p),1));const[x,y]=o[m/o[v-1][2]53)return null;"w"in W||(W.w=1),"Z"in W?(Ce=Nb(yc(W.y,0,1)),qe=Ce.getUTCDay(),Ce=qe>4||qe===0?op.ceil(Ce):op(Ce),Ce=dm.offset(Ce,(W.V-1)*7),W.y=Ce.getUTCFullYear(),W.m=Ce.getUTCMonth(),W.d=Ce.getUTCDate()+(W.w+6)%7):(Ce=_b(yc(W.y,0,1)),qe=Ce.getDay(),Ce=qe>4||qe===0?ip.ceil(Ce):ip(Ce),Ce=Bu.offset(Ce,(W.V-1)*7),W.y=Ce.getFullYear(),W.m=Ce.getMonth(),W.d=Ce.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),qe="Z"in W?Nb(yc(W.y,0,1)).getUTCDay():_b(yc(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(qe+5)%7:W.w+W.U*7-(qe+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,Nb(W)):_b(W)}}function R(ee,ce,pe,W){for(var _e=0,Ce=ce.length,qe=pe.length,De,nt;_e=qe)return-1;if(De=ce.charCodeAt(_e++),De===37){if(De=ce.charAt(_e++),nt=C[De in R2?ce.charAt(_e++):De],!nt||(W=nt(ee,pe,W))<0)return-1}else if(De!=pe.charCodeAt(W++))return-1}return W}function L(ee,ce,pe){var W=c.exec(ce.slice(pe));return W?(ee.p=h.get(W[0].toLowerCase()),pe+W[0].length):-1}function z(ee,ce,pe){var W=v.exec(ce.slice(pe));return W?(ee.w=x.get(W[0].toLowerCase()),pe+W[0].length):-1}function F(ee,ce,pe){var W=p.exec(ce.slice(pe));return W?(ee.w=m.get(W[0].toLowerCase()),pe+W[0].length):-1}function B(ee,ce,pe){var W=_.exec(ce.slice(pe));return W?(ee.m=N.get(W[0].toLowerCase()),pe+W[0].length):-1}function q(ee,ce,pe){var W=y.exec(ce.slice(pe));return W?(ee.m=S.get(W[0].toLowerCase()),pe+W[0].length):-1}function H(ee,ce,pe){return R(ee,t,ce,pe)}function V(ee,ce,pe){return R(ee,r,ce,pe)}function G(ee,ce,pe){return R(ee,n,ce,pe)}function U(ee){return o[ee.getDay()]}function $(ee){return i[ee.getDay()]}function Q(ee){return d[ee.getMonth()]}function k(ee){return u[ee.getMonth()]}function I(ee){return a[+(ee.getHours()>=12)]}function D(ee){return 1+~~(ee.getMonth()/3)}function Z(ee){return o[ee.getUTCDay()]}function ie(ee){return i[ee.getUTCDay()]}function oe(ee){return d[ee.getUTCMonth()]}function ne(ee){return u[ee.getUTCMonth()]}function K(ee){return a[+(ee.getUTCHours()>=12)]}function J(ee){return 1+~~(ee.getUTCMonth()/3)}return{format:function(ee){var ce=E(ee+="",O);return ce.toString=function(){return ee},ce},parse:function(ee){var ce=T(ee+="",!1);return ce.toString=function(){return ee},ce},utcFormat:function(ee){var ce=E(ee+="",A);return ce.toString=function(){return ee},ce},utcParse:function(ee){var ce=T(ee+="",!0);return ce.toString=function(){return ee},ce}}}var R2={"-":"",_:" ",0:"0"},sr=/^\s*\d+/,cG=/^%/,uG=/[\\^$*+?|[\]().{}]/g;function lt(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",i=a.length;return n+(i[t.toLowerCase(),r]))}function fG(e,t,r){var n=sr.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function hG(e,t,r){var n=sr.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function pG(e,t,r){var n=sr.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function mG(e,t,r){var n=sr.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function gG(e,t,r){var n=sr.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function I2(e,t,r){var n=sr.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function M2(e,t,r){var n=sr.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function vG(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function yG(e,t,r){var n=sr.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function xG(e,t,r){var n=sr.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function D2(e,t,r){var n=sr.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function bG(e,t,r){var n=sr.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function L2(e,t,r){var n=sr.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function wG(e,t,r){var n=sr.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function SG(e,t,r){var n=sr.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function jG(e,t,r){var n=sr.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function _G(e,t,r){var n=sr.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function NG(e,t,r){var n=cG.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function CG(e,t,r){var n=sr.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function OG(e,t,r){var n=sr.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function $2(e,t){return lt(e.getDate(),t,2)}function EG(e,t){return lt(e.getHours(),t,2)}function PG(e,t){return lt(e.getHours()%12||12,t,2)}function AG(e,t){return lt(1+Bu.count(Ba(e),e),t,3)}function dL(e,t){return lt(e.getMilliseconds(),t,3)}function TG(e,t){return dL(e,t)+"000"}function kG(e,t){return lt(e.getMonth()+1,t,2)}function RG(e,t){return lt(e.getMinutes(),t,2)}function IG(e,t){return lt(e.getSeconds(),t,2)}function MG(e){var t=e.getDay();return t===0?7:t}function DG(e,t){return lt(fm.count(Ba(e)-1,e),t,2)}function fL(e){var t=e.getDay();return t>=4||t===0?Hs(e):Hs.ceil(e)}function LG(e,t){return e=fL(e),lt(Hs.count(Ba(e),e)+(Ba(e).getDay()===4),t,2)}function $G(e){return e.getDay()}function BG(e,t){return lt(ip.count(Ba(e)-1,e),t,2)}function FG(e,t){return lt(e.getFullYear()%100,t,2)}function zG(e,t){return e=fL(e),lt(e.getFullYear()%100,t,2)}function qG(e,t){return lt(e.getFullYear()%1e4,t,4)}function UG(e,t){var r=e.getDay();return e=r>=4||r===0?Hs(e):Hs.ceil(e),lt(e.getFullYear()%1e4,t,4)}function VG(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+lt(t/60|0,"0",2)+lt(t%60,"0",2)}function B2(e,t){return lt(e.getUTCDate(),t,2)}function HG(e,t){return lt(e.getUTCHours(),t,2)}function WG(e,t){return lt(e.getUTCHours()%12||12,t,2)}function GG(e,t){return lt(1+dm.count(Fa(e),e),t,3)}function hL(e,t){return lt(e.getUTCMilliseconds(),t,3)}function KG(e,t){return hL(e,t)+"000"}function XG(e,t){return lt(e.getUTCMonth()+1,t,2)}function YG(e,t){return lt(e.getUTCMinutes(),t,2)}function JG(e,t){return lt(e.getUTCSeconds(),t,2)}function QG(e){var t=e.getUTCDay();return t===0?7:t}function ZG(e,t){return lt(hm.count(Fa(e)-1,e),t,2)}function pL(e){var t=e.getUTCDay();return t>=4||t===0?Ws(e):Ws.ceil(e)}function eK(e,t){return e=pL(e),lt(Ws.count(Fa(e),e)+(Fa(e).getUTCDay()===4),t,2)}function tK(e){return e.getUTCDay()}function rK(e,t){return lt(op.count(Fa(e)-1,e),t,2)}function nK(e,t){return lt(e.getUTCFullYear()%100,t,2)}function aK(e,t){return e=pL(e),lt(e.getUTCFullYear()%100,t,2)}function iK(e,t){return lt(e.getUTCFullYear()%1e4,t,4)}function oK(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Ws(e):Ws.ceil(e),lt(e.getUTCFullYear()%1e4,t,4)}function sK(){return"+0000"}function F2(){return"%"}function z2(e){return+e}function q2(e){return Math.floor(+e/1e3)}var cs,mL,gL;lK({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 lK(e){return cs=lG(e),mL=cs.format,cs.parse,gL=cs.utcFormat,cs.utcParse,cs}function cK(e){return new Date(e)}function uK(e){return e instanceof Date?+e:+new Date(+e)}function Sj(e,t,r,n,a,i,o,u,d,c){var h=lj(),p=h.invert,m=h.domain,v=c(".%L"),x=c(":%S"),y=c("%I:%M"),S=c("%I %p"),_=c("%a %d"),N=c("%b %d"),O=c("%B"),A=c("%Y");function C(E){return(d(E)t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>ZH(e,i/n))},r.copy=function(){return bL(t).domain(e)},Wa.apply(r,arguments)}function mm(){var e=0,t=.5,r=1,n=1,a,i,o,u,d,c=Cr,h,p=!1,m;function v(y){return isNaN(y=+y)?m:(y=.5+((y=+h(y))-i)*(n*yr}return Ob=e,Ob}var Eb,W2;function mK(){if(W2)return Eb;W2=1;var e=gm(),t=_L(),r=xl();function n(a){return a&&a.length?e(a,r,t):void 0}return Eb=n,Eb}var gK=mK();const vm=ct(gK);var Pb,G2;function NL(){if(G2)return Pb;G2=1;function e(t,r){return te.e^i.s<0?1:-1;for(n=i.d.length,a=e.d.length,t=0,r=ne.d[t]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};Pe.decimalPlaces=Pe.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Et;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Pe.dividedBy=Pe.div=function(e){return Da(this,new this.constructor(e))};Pe.dividedToIntegerBy=Pe.idiv=function(e){var t=this,r=t.constructor;return bt(Da(t,new r(e),0,1),r.precision)};Pe.equals=Pe.eq=function(e){return!this.cmp(e)};Pe.exponent=function(){return Wt(this)};Pe.greaterThan=Pe.gt=function(e){return this.cmp(e)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(e){return this.cmp(e)>=0};Pe.isInteger=Pe.isint=function(){return this.e>this.d.length-2};Pe.isNegative=Pe.isneg=function(){return this.s<0};Pe.isPositive=Pe.ispos=function(){return this.s>0};Pe.isZero=function(){return this.s===0};Pe.lessThan=Pe.lt=function(e){return this.cmp(e)<0};Pe.lessThanOrEqualTo=Pe.lte=function(e){return this.cmp(e)<1};Pe.logarithm=Pe.log=function(e){var t,r=this,n=r.constructor,a=n.precision,i=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Zr))throw Error(jn+"NaN");if(r.s<1)throw Error(jn+(r.s?"NaN":"-Infinity"));return r.eq(Zr)?new n(0):(Tt=!1,t=Da(au(r,i),au(e,i),i),Tt=!0,bt(t,a))};Pe.minus=Pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?PL(t,e):OL(t,(e.s=-e.s,e))};Pe.modulo=Pe.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(jn+"NaN");return r.s?(Tt=!1,t=Da(r,e,0,1).times(e),Tt=!0,r.minus(t)):bt(new n(r),a)};Pe.naturalExponential=Pe.exp=function(){return EL(this)};Pe.naturalLogarithm=Pe.ln=function(){return au(this)};Pe.negated=Pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Pe.plus=Pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?OL(t,e):PL(t,(e.s=-e.s,e))};Pe.precision=Pe.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(ho+e);if(t=Wt(a)+1,n=a.d.length-1,r=n*Et+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Pe.squareRoot=Pe.sqrt=function(){var e,t,r,n,a,i,o,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(jn+"NaN")}for(e=Wt(u),Tt=!1,a=Math.sqrt(+u),a==0||a==1/0?(t=ta(u.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Sl((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new d(t)):n=new d(a.toString()),r=d.precision,a=o=r+3;;)if(i=n,n=i.plus(Da(u,i,o+2)).times(.5),ta(i.d).slice(0,o)===(t=ta(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(bt(i,r+1,0),i.times(i).eq(u)){n=i;break}}else if(t!="9999")break;o+=4}return Tt=!0,bt(n,r)};Pe.times=Pe.mul=function(e){var t,r,n,a,i,o,u,d,c,h=this,p=h.constructor,m=h.d,v=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,r=h.e+e.e,d=m.length,c=v.length,d=0;){for(t=0,a=d+n;a>n;)u=i[a]+v[n]*m[a-n-1]+t,i[a--]=u%ir|0,t=u/ir|0;i[a]=(i[a]+t)%ir|0}for(;!i[--o];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,Tt?bt(e,p.precision):e};Pe.toDecimalPlaces=Pe.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(sa(e,0,wl),t===void 0?t=n.rounding:sa(t,0,8),bt(r,e+Wt(r)+1,t))};Pe.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=vo(n,!0):(sa(e,0,wl),t===void 0?t=a.rounding:sa(t,0,8),n=bt(new a(n),e+1,t),r=vo(n,!0,e+1)),r};Pe.toFixed=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?vo(a):(sa(e,0,wl),t===void 0?t=i.rounding:sa(t,0,8),n=bt(new i(a),e+Wt(a)+1,t),r=vo(n.abs(),!1,e+Wt(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};Pe.toInteger=Pe.toint=function(){var e=this,t=e.constructor;return bt(new t(e),Wt(e)+1,t.rounding)};Pe.toNumber=function(){return+this};Pe.toPower=Pe.pow=function(e){var t,r,n,a,i,o,u=this,d=u.constructor,c=12,h=+(e=new d(e));if(!e.s)return new d(Zr);if(u=new d(u),!u.s){if(e.s<1)throw Error(jn+"Infinity");return u}if(u.eq(Zr))return u;if(n=d.precision,e.eq(Zr))return bt(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,i=u.s,o){if((r=h<0?-h:h)<=CL){for(a=new d(Zr),t=Math.ceil(n/Et+4),Tt=!1;r%2&&(a=a.times(u),Z2(a.d,t)),r=Sl(r/2),r!==0;)u=u.times(u),Z2(u.d,t);return Tt=!0,e.s<0?new d(Zr).div(a):bt(a,n)}}else if(i<0)throw Error(jn+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,Tt=!1,a=e.times(au(u,n+c)),Tt=!0,a=EL(a),a.s=i,a};Pe.toPrecision=function(e,t){var r,n,a=this,i=a.constructor;return e===void 0?(r=Wt(a),n=vo(a,r<=i.toExpNeg||r>=i.toExpPos)):(sa(e,1,wl),t===void 0?t=i.rounding:sa(t,0,8),a=bt(new i(a),e,t),r=Wt(a),n=vo(a,e<=r||r<=i.toExpNeg,e)),n};Pe.toSignificantDigits=Pe.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(sa(e,1,wl),t===void 0?t=n.rounding:sa(t,0,8)),bt(new n(r),e,t)};Pe.toString=Pe.valueOf=Pe.val=Pe.toJSON=Pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Wt(e),r=e.constructor;return vo(e,t<=r.toExpNeg||t>=r.toExpPos)};function OL(e,t){var r,n,a,i,o,u,d,c,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),Tt?bt(t,p):t;if(d=e.d,c=t.d,o=e.e,a=t.e,d=d.slice(),i=o-a,i){for(i<0?(n=d,i=-i,u=c.length):(n=c,a=o,u=d.length),o=Math.ceil(p/Et),u=o>u?o+1:u+1,i>u&&(i=u,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(u=d.length,i=c.length,u-i<0&&(i=u,n=c,c=d,d=n),r=0;i;)r=(d[--i]=d[i]+c[i]+r)/ir|0,d[i]%=ir;for(r&&(d.unshift(r),++a),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=a,Tt?bt(t,p):t}function sa(e,t,r){if(e!==~~e||er)throw Error(ho+e)}function ta(e){var t,r,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;to?1:-1;else for(u=d=0;ua[u]?1:-1;break}return d}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]1;)n.shift()}return function(n,a,i,o){var u,d,c,h,p,m,v,x,y,S,_,N,O,A,C,E,T,R,L=n.constructor,z=n.s==a.s?1:-1,F=n.d,B=a.d;if(!n.s)return new L(n);if(!a.s)throw Error(jn+"Division by zero");for(d=n.e-a.e,T=B.length,C=F.length,v=new L(z),x=v.d=[],c=0;B[c]==(F[c]||0);)++c;if(B[c]>(F[c]||0)&&--d,i==null?N=i=L.precision:o?N=i+(Wt(n)-Wt(a))+1:N=i,N<0)return new L(0);if(N=N/Et+2|0,c=0,T==1)for(h=0,B=B[0],N++;(c1&&(B=e(B,h),F=e(F,h),T=B.length,C=F.length),A=T,y=F.slice(0,T),S=y.length;S=ir/2&&++E;do h=0,u=t(B,y,T,S),u<0?(_=y[0],T!=S&&(_=_*ir+(y[1]||0)),h=_/E|0,h>1?(h>=ir&&(h=ir-1),p=e(B,h),m=p.length,S=y.length,u=t(p,y,m,S),u==1&&(h--,r(p,T16)throw Error(Nj+Wt(e));if(!e.s)return new h(Zr);for(Tt=!1,u=p,o=new h(.03125);e.abs().gte(.1);)e=e.times(o),c+=5;for(n=Math.log(ao(2,c))/Math.LN10*2+5|0,u+=n,r=a=i=new h(Zr),h.precision=u;;){if(a=bt(a.times(e),u),r=r.times(++d),o=i.plus(Da(a,r,u)),ta(o.d).slice(0,u)===ta(i.d).slice(0,u)){for(;c--;)i=bt(i.times(i),u);return h.precision=p,t==null?(Tt=!0,bt(i,p)):i}i=o}}function Wt(e){for(var t=e.e*Et,r=e.d[0];r>=10;r/=10)t++;return t}function Ib(e,t,r){if(t>e.LN10.sd())throw Tt=!0,r&&(e.precision=r),Error(jn+"LN10 precision limit exceeded");return bt(new e(e.LN10),t)}function gi(e){for(var t="";e--;)t+="0";return t}function au(e,t){var r,n,a,i,o,u,d,c,h,p=1,m=10,v=e,x=v.d,y=v.constructor,S=y.precision;if(v.s<1)throw Error(jn+(v.s?"NaN":"-Infinity"));if(v.eq(Zr))return new y(0);if(t==null?(Tt=!1,c=S):c=t,v.eq(10))return t==null&&(Tt=!0),Ib(y,c);if(c+=m,y.precision=c,r=ta(x),n=r.charAt(0),i=Wt(v),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=ta(v.d),n=r.charAt(0),p++;i=Wt(v),n>1?(v=new y("0."+r),i++):v=new y(n+"."+r.slice(1))}else return d=Ib(y,c+2,S).times(i+""),v=au(new y(n+"."+r.slice(1)),c-m).plus(d),y.precision=S,t==null?(Tt=!0,bt(v,S)):v;for(u=o=v=Da(v.minus(Zr),v.plus(Zr),c),h=bt(v.times(v),c),a=3;;){if(o=bt(o.times(h),c),d=u.plus(Da(o,new y(a),c)),ta(d.d).slice(0,c)===ta(u.d).slice(0,c))return u=u.times(2),i!==0&&(u=u.plus(Ib(y,c+2,S).times(i+""))),u=Da(u,new y(p),c),y.precision=S,t==null?(Tt=!0,bt(u,S)):u;u=d,a+=2}}function Q2(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Sl(r/Et),e.d=[],n=(r+1)%Et,r<0&&(n+=Et),nsp||e.e<-sp))throw Error(Nj+r)}else e.s=0,e.e=0,e.d=[0];return e}function bt(e,t,r){var n,a,i,o,u,d,c,h,p=e.d;for(o=1,i=p[0];i>=10;i/=10)o++;if(n=t-o,n<0)n+=Et,a=t,c=p[h=0];else{if(h=Math.ceil((n+1)/Et),i=p.length,h>=i)return e;for(c=i=p[h],o=1;i>=10;i/=10)o++;n%=Et,a=n-Et+o}if(r!==void 0&&(i=ao(10,o-a-1),u=c/i%10|0,d=t<0||p[h+1]!==void 0||c%i,d=r<4?(u||d)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||d||r==6&&(n>0?a>0?c/ao(10,o-a):0:p[h-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return d?(i=Wt(e),p.length=1,t=t-i-1,p[0]=ao(10,(Et-t%Et)%Et),e.e=Sl(-t/Et)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(n==0?(p.length=h,i=1,h--):(p.length=h+1,i=ao(10,Et-n),p[h]=a>0?(c/ao(10,o-a)%ao(10,a)|0)*i:0),d)for(;;)if(h==0){(p[0]+=i)==ir&&(p[0]=1,++e.e);break}else{if(p[h]+=i,p[h]!=ir)break;p[h--]=0,i=1}for(n=p.length;p[--n]===0;)p.pop();if(Tt&&(e.e>sp||e.e<-sp))throw Error(Nj+Wt(e));return e}function PL(e,t){var r,n,a,i,o,u,d,c,h,p,m=e.constructor,v=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Tt?bt(t,v):t;if(d=e.d,p=t.d,n=t.e,c=e.e,d=d.slice(),o=c-n,o){for(h=o<0,h?(r=d,o=-o,u=p.length):(r=p,n=c,u=d.length),a=Math.max(Math.ceil(v/Et),u)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=d.length,u=p.length,h=a0;--a)d[u++]=0;for(a=p.length;a>o;){if(d[--a]0?i=i.charAt(0)+"."+i.slice(1)+gi(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+gi(-a-1)+i,r&&(n=r-o)>0&&(i+=gi(n))):a>=o?(i+=gi(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+gi(n))):((n=a+1)0&&(a+1===o&&(i+="."),i+=gi(n))),e.s<0?"-"+i:i}function Z2(e,t){if(e.length>t)return e.length=t,!0}function AL(e){var t,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(ho+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return Q2(o,i.toString())}else if(typeof i!="string")throw Error(ho+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,CK.test(i))Q2(o,i);else throw Error(ho+i)}if(a.prototype=Pe,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=AL,a.config=a.set=OK,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(ho+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(ho+r+": "+n);return this}var Cj=AL(NK);Zr=new Cj(1);const yt=Cj;function EK(e){return kK(e)||TK(e)||AK(e)||PK()}function PK(){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 AK(e,t){if(e){if(typeof e=="string")return uw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uw(e,t)}}function TK(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function kK(e){if(Array.isArray(e))return uw(e)}function uw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,a):e(t-o,eT(function(){for(var u=arguments.length,d=new Array(u),c=0;ce.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),u;!(n=(u=o.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(d){a=!0,i=d}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return r}}function GK(e){if(Array.isArray(e))return e}function ML(e){var t=iu(e,2),r=t[0],n=t[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function DL(e,t,r){if(e.lte(0))return new yt(0);var n=bm.getDigitCount(e.toNumber()),a=new yt(10).pow(n),i=e.div(a),o=n!==1?.05:.1,u=new yt(Math.ceil(i.div(o).toNumber())).add(r).mul(o),d=u.mul(a);return t?d:new yt(Math.ceil(d))}function KK(e,t,r){var n=1,a=new yt(e);if(!a.isint()&&r){var i=Math.abs(e);i<1?(n=new yt(10).pow(bm.getDigitCount(e)-1),a=new yt(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new yt(Math.floor(e)))}else e===0?a=new yt(Math.floor((t-1)/2)):r||(a=new yt(Math.floor(e)));var o=Math.floor((t-1)/2),u=DK(MK(function(d){return a.add(new yt(d-o).mul(n)).toNumber()}),dw);return u(0,t)}function LL(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new yt(0),tickMin:new yt(0),tickMax:new yt(0)};var i=DL(new yt(t).sub(e).div(r-1),n,a),o;e<=0&&t>=0?o=new yt(0):(o=new yt(e).add(t).div(2),o=o.sub(new yt(o).mod(i)));var u=Math.ceil(o.sub(e).div(i).toNumber()),d=Math.ceil(new yt(t).sub(o).div(i).toNumber()),c=u+d+1;return c>r?LL(e,t,r,n,a+1):(c0?d+(r-c):d,u=t>0?u:u+(r-c)),{step:i,tickMin:o.sub(new yt(u).mul(i)),tickMax:o.add(new yt(d).mul(i))})}function XK(e){var t=iu(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),u=ML([r,n]),d=iu(u,2),c=d[0],h=d[1];if(c===-1/0||h===1/0){var p=h===1/0?[c].concat(hw(dw(0,a-1).map(function(){return 1/0}))):[].concat(hw(dw(0,a-1).map(function(){return-1/0})),[h]);return r>n?fw(p):p}if(c===h)return KK(c,a,i);var m=LL(c,h,o,i),v=m.step,x=m.tickMin,y=m.tickMax,S=bm.rangeStep(x,y.add(new yt(.1).mul(v)),v);return r>n?fw(S):S}function YK(e,t){var r=iu(e,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=ML([n,a]),u=iu(o,2),d=u[0],c=u[1];if(d===-1/0||c===1/0)return[n,a];if(d===c)return[d];var h=Math.max(t,2),p=DL(new yt(c).sub(d).div(h-1),i,0),m=[].concat(hw(bm.rangeStep(new yt(d),new yt(c).sub(new yt(.99).mul(p)),p)),[c]);return n>a?fw(m):m}var JK=RL(XK),QK=RL(YK),ZK="Invariant failed";function yo(e,t){throw new Error(ZK)}var eX=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Gs(e){"@babel/helpers - typeof";return Gs=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},Gs(e)}function lp(){return lp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function lX(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function cX(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,u=(r=n?.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var d=i.range,c=0;c0?a[c-1].coordinate:a[u-1].coordinate,p=a[c].coordinate,m=c>=u-1?a[0].coordinate:a[c+1].coordinate,v=void 0;if(_r(p-h)!==_r(m-p)){var x=[];if(_r(m-p)===_r(d[1]-d[0])){v=m;var y=p+d[1]-d[0];x[0]=Math.min(y,(y+h)/2),x[1]=Math.max(y,(y+h)/2)}else{v=h;var S=m+d[1]-d[0];x[0]=Math.min(p,(S+p)/2),x[1]=Math.max(p,(S+p)/2)}var _=[Math.min(p,(v+p)/2),Math.max(p,(v+p)/2)];if(t>_[0]&&t<=_[1]||t>=x[0]&&t<=x[1]){o=a[c].index;break}}else{var N=Math.min(h,m),O=Math.max(h,m);if(t>(N+p)/2&&t<=(O+p)/2){o=a[c].index;break}}}else for(var A=0;A0&&A(n[A].coordinate+n[A-1].coordinate)/2&&t<=(n[A].coordinate+n[A+1].coordinate)/2||A===u-1&&t>(n[A].coordinate+n[A-1].coordinate)/2){o=n[A].index;break}return o},Oj=function(t){var r,n=t,a=n.type.displayName,i=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Bt(Bt({},t.type.defaultProps),t.props):t.props,o=i.stroke,u=i.fill,d;switch(a){case"Line":d=o;break;case"Area":case"Radar":d=o&&o!=="none"?o:u;break;default:d=u;break}return d},CX=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},u=Object.keys(i),d=0,c=u.length;d=0});if(_&&_.length){var N=_[0].type.defaultProps,O=N!==void 0?Bt(Bt({},N),_[0].props):_[0].props,A=O.barSize,C=O[S];o[C]||(o[C]=[]);var E=Qe(A)?r:A;o[C].push({item:_[0],stackList:_.slice(1),barSize:Qe(E)?void 0:Nr(E,n,0)})}}return o},OX=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,u=t.maxBarSize,d=o.length;if(d<1)return null;var c=Nr(r,a,0,!0),h,p=[];if(o[0].barSize===+o[0].barSize){var m=!1,v=a/d,x=o.reduce(function(A,C){return A+C.barSize||0},0);x+=(d-1)*c,x>=a&&(x-=(d-1)*c,c=0),x>=a&&v>0&&(m=!0,v*=.9,x=d*v);var y=(a-x)/2>>0,S={offset:y-c,size:0};h=o.reduce(function(A,C){var E={item:C.item,position:{offset:S.offset+S.size+c,size:m?v:C.barSize}},T=[].concat(nT(A),[E]);return S=T[T.length-1].position,C.stackList&&C.stackList.length&&C.stackList.forEach(function(R){T.push({item:R,position:S})}),T},p)}else{var _=Nr(n,a,0,!0);a-2*_-(d-1)*c<=0&&(c=0);var N=(a-2*_-(d-1)*c)/d;N>1&&(N>>=0);var O=u===+u?Math.min(N,u):N;h=o.reduce(function(A,C,E){var T=[].concat(nT(A),[{item:C.item,position:{offset:_+(N+c)*E+(N-O)/2,size:O}}]);return C.stackList&&C.stackList.length&&C.stackList.forEach(function(R){T.push({item:R,position:T[T.length-1].position})}),T},p)}return h},EX=function(t,r,n,a){var i=n.children,o=n.width,u=n.margin,d=o-(u.left||0)-(u.right||0),c=zL({children:i,legendWidth:d});if(c){var h=a||{},p=h.width,m=h.height,v=c.align,x=c.verticalAlign,y=c.layout;if((y==="vertical"||y==="horizontal"&&x==="middle")&&v!=="center"&&je(t[v]))return Bt(Bt({},t),{},Ts({},v,t[v]+(p||0)));if((y==="horizontal"||y==="vertical"&&v==="center")&&x!=="middle"&&je(t[x]))return Bt(Bt({},t),{},Ts({},x,t[x]+(m||0)))}return t},PX=function(t,r,n){return Qe(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},qL=function(t,r,n,a,i){var o=r.props.children,u=tn(o,zu).filter(function(c){return PX(a,i,c.props.direction)});if(u&&u.length){var d=u.map(function(c){return c.props.dataKey});return t.reduce(function(c,h){var p=Zt(h,n);if(Qe(p))return c;var m=Array.isArray(p)?[ym(p),vm(p)]:[p,p],v=d.reduce(function(x,y){var S=Zt(h,y,0),_=m[0]-Math.abs(Array.isArray(S)?S[0]:S),N=m[1]+Math.abs(Array.isArray(S)?S[1]:S);return[Math.min(_,x[0]),Math.max(N,x[1])]},[1/0,-1/0]);return[Math.min(v[0],c[0]),Math.max(v[1],c[1])]},[1/0,-1/0])}return null},AX=function(t,r,n,a,i){var o=r.map(function(u){return qL(t,u,n,i,a)}).filter(function(u){return!Qe(u)});return o&&o.length?o.reduce(function(u,d){return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]):null},UL=function(t,r,n,a,i){var o=r.map(function(d){var c=d.props.dataKey;return n==="number"&&c&&qL(t,d,c,a)||$c(t,c,n,i)});if(n==="number")return o.reduce(function(d,c){return[Math.min(d[0],c[0]),Math.max(d[1],c[1])]},[1/0,-1/0]);var u={};return o.reduce(function(d,c){for(var h=0,p=c.length;h=2?_r(u[0]-u[1])*2*c:c,r&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var m=i?i.indexOf(p):p;return{coordinate:a(m)+c,value:p,offset:c}});return h.filter(function(p){return!Iu(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,m){return{coordinate:a(p)+c,value:p,index:m,offset:c}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(p){return{coordinate:a(p)+c,value:p,offset:c}}):a.domain().map(function(p,m){return{coordinate:a(p)+c,value:i?i[p]:p,index:m,offset:c}})},Mb=new WeakMap,Tf=function(t,r){if(typeof r!="function")return t;Mb.has(t)||Mb.set(t,new WeakMap);var n=Mb.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},WL=function(t,r,n){var a=t.scale,i=t.type,o=t.layout,u=t.axisType;if(a==="auto")return o==="radial"&&u==="radiusAxis"?{scale:Zc(),realScaleType:"band"}:o==="radial"&&u==="angleAxis"?{scale:np(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Lc(),realScaleType:"point"}:i==="category"?{scale:Zc(),realScaleType:"band"}:{scale:np(),realScaleType:"linear"};if(po(a)){var d="scale".concat(rm(a));return{scale:(U2[d]||Lc)(),realScaleType:U2[d]?d:"point"}}return He(a)?{scale:a}:{scale:Lc(),realScaleType:"point"}},iT=1e-4,GL=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),i=Math.min(a[0],a[1])-iT,o=Math.max(a[0],a[1])+iT,u=t(r[0]),d=t(r[n-1]);(uo||do)&&t.domain([r[0],r[n-1]])}},TX=function(t,r){if(!t)return null;for(var n=0,a=t.length;na)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]=0?(t[u][n][0]=i,t[u][n][1]=i+d,i=t[u][n][1]):(t[u][n][0]=o,t[u][n][1]=o+d,o=t[u][n][1])}},IX=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n=0?(t[o][n][0]=i,t[o][n][1]=i+u,i=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},MX={sign:RX,expand:S9,none:Bs,silhouette:j9,wiggle:_9,positive:IX},DX=function(t,r,n){var a=r.map(function(u){return u.props.dataKey}),i=MX[n],o=w9().keys(a).value(function(u,d){return+Zt(u,d,0)}).order(W1).offset(i);return o(t)},LX=function(t,r,n,a,i,o){if(!t)return null;var u=o?r.reverse():r,d={},c=u.reduce(function(p,m){var v,x=(v=m.type)!==null&&v!==void 0&&v.defaultProps?Bt(Bt({},m.type.defaultProps),m.props):m.props,y=x.stackId,S=x.hide;if(S)return p;var _=x[n],N=p[_]||{hasStack:!1,stackGroups:{}};if(er(y)){var O=N.stackGroups[y]||{numericAxisId:n,cateAxisId:a,items:[]};O.items.push(m),N.hasStack=!0,N.stackGroups[y]=O}else N.stackGroups[yl("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[m]};return Bt(Bt({},p),{},Ts({},_,N))},d),h={};return Object.keys(c).reduce(function(p,m){var v=c[m];if(v.hasStack){var x={};v.stackGroups=Object.keys(v.stackGroups).reduce(function(y,S){var _=v.stackGroups[S];return Bt(Bt({},y),{},Ts({},S,{numericAxisId:n,cateAxisId:a,items:_.items,stackedData:DX(t,_.items,i)}))},x)}return Bt(Bt({},p),{},Ts({},m,v))},h)},KL=function(t,r){var n=r.realScaleType,a=r.type,i=r.tickCount,o=r.originalDomain,u=r.allowDecimals,d=n||r.scale;if(d!=="auto"&&d!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var c=t.domain();if(!c.length)return null;var h=JK(c,i,u);return t.domain([ym(h),vm(h)]),{niceTicks:h}}if(i&&a==="number"){var p=t.domain(),m=QK(p,i,u);return{niceTicks:m}}return null};function oT(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Qe(a[t.dataKey])){var u=Lh(r,"value",a[t.dataKey]);if(u)return u.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var d=Zt(a,Qe(o)?t.dataKey:o);return Qe(d)?null:t.scale(d)}var sT=function(t){var r=t.axis,n=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+a:null;var d=Zt(o,r.dataKey,r.domain[u]);return Qe(d)?null:r.scale(d)-i/2+a},$X=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},BX=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Bt(Bt({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(er(i)){var o=r[i];if(o){var u=o.items.indexOf(t);return u>=0?o.stackedData[u]:null}}return null},FX=function(t){return t.reduce(function(r,n){return[ym(n.concat([r[0]]).filter(je)),vm(n.concat([r[1]]).filter(je))]},[1/0,-1/0])},XL=function(t,r,n){return Object.keys(t).reduce(function(a,i){var o=t[i],u=o.stackedData,d=u.reduce(function(c,h){var p=FX(h.slice(r,n+1));return[Math.min(c[0],p[0]),Math.max(c[1],p[1])]},[1/0,-1/0]);return[Math.min(d[0],a[0]),Math.max(d[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},lT=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,cT=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,vw=function(t,r,n){if(He(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(je(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(lT.test(t[0])){var i=+lT.exec(t[0])[1];a[0]=r[0]-i}else He(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(je(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(cT.test(t[1])){var o=+cT.exec(t[1])[1];a[1]=r[1]+o}else He(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},up=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var i=tj(r,function(p){return p.coordinate}),o=1/0,u=1,d=i.length;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},XX=function(t,r,n,a,i){var o=t.width,u=t.height,d=t.startAngle,c=t.endAngle,h=Nr(t.cx,o,o/2),p=Nr(t.cy,u,u/2),m=QL(o,u,n),v=Nr(t.innerRadius,m,0),x=Nr(t.outerRadius,m,m*.8),y=Object.keys(r);return y.reduce(function(S,_){var N=r[_],O=N.domain,A=N.reversed,C;if(Qe(N.range))a==="angleAxis"?C=[d,c]:a==="radiusAxis"&&(C=[v,x]),A&&(C=[C[1],C[0]]);else{C=N.range;var E=C,T=UX(E,2);d=T[0],c=T[1]}var R=WL(N,i),L=R.realScaleType,z=R.scale;z.domain(O).range(C),GL(z);var F=KL(z,Ta(Ta({},N),{},{realScaleType:L})),B=Ta(Ta(Ta({},N),F),{},{range:C,radius:x,realScaleType:L,scale:z,cx:h,cy:p,innerRadius:v,outerRadius:x,startAngle:d,endAngle:c});return Ta(Ta({},S),{},JL({},_,B))},{})},YX=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-o,2))},JX=function(t,r){var n=t.x,a=t.y,i=r.cx,o=r.cy,u=YX({x:n,y:a},{x:i,y:o});if(u<=0)return{radius:u};var d=(n-i)/u,c=Math.acos(d);return a>o&&(c=2*Math.PI-c),{radius:u,angle:KX(c),angleInRadian:c}},QX=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return{startAngle:r-o*360,endAngle:n-o*360}},ZX=function(t,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),o=Math.floor(a/360),u=Math.min(i,o);return t+u*360},hT=function(t,r){var n=t.x,a=t.y,i=JX({x:n,y:a},r),o=i.radius,u=i.angle,d=r.innerRadius,c=r.outerRadius;if(oc)return!1;if(o===0)return!0;var h=QX(r),p=h.startAngle,m=h.endAngle,v=u,x;if(p<=m){for(;v>m;)v-=360;for(;v=p&&v<=m}else{for(;v>p;)v-=360;for(;v=m&&v<=p}return x?Ta(Ta({},r),{},{radius:o,angle:ZX(v,r)}):null},ZL=function(t){return!b.isValidElement(t)&&!He(t)&&typeof t!="boolean"?t.className:""};function cu(e){"@babel/helpers - typeof";return cu=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},cu(e)}var eY=["offset"];function tY(e){return iY(e)||aY(e)||nY(e)||rY()}function rY(){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 nY(e,t){if(e){if(typeof e=="string")return yw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yw(e,t)}}function aY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iY(e){if(Array.isArray(e))return yw(e)}function yw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Qt(e){for(var t=1;t=0?1:-1,O,A;a==="insideStart"?(O=v+N*o,A=y):a==="insideEnd"?(O=x-N*o,A=!y):a==="end"&&(O=x+N*o,A=y),A=_<=0?A:!A;var C=_t(c,h,S,O),E=_t(c,h,S,O+(A?1:-1)*359),T="M".concat(C.x,",").concat(C.y,` - A`).concat(S,",").concat(S,",0,1,").concat(A?0:1,`, - `).concat(E.x,",").concat(E.y),R=Qe(t.id)?yl("recharts-radial-line-"):t.id;return X.createElement("text",uu({},n,{dominantBaseline:"central",className:Ze("recharts-radial-bar-label",u)}),X.createElement("defs",null,X.createElement("path",{id:R,d:T})),X.createElement("textPath",{xlinkHref:"#".concat(R)},r))},pY=function(t){var r=t.viewBox,n=t.offset,a=t.position,i=r,o=i.cx,u=i.cy,d=i.innerRadius,c=i.outerRadius,h=i.startAngle,p=i.endAngle,m=(h+p)/2;if(a==="outside"){var v=_t(o,u,c+n,m),x=v.x,y=v.y;return{x,y,textAnchor:x>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:u,textAnchor:"middle",verticalAnchor:"end"};var S=(d+c)/2,_=_t(o,u,S,m),N=_.x,O=_.y;return{x:N,y:O,textAnchor:"middle",verticalAnchor:"middle"}},mY=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,i=t.position,o=r,u=o.x,d=o.y,c=o.width,h=o.height,p=h>=0?1:-1,m=p*a,v=p>0?"end":"start",x=p>0?"start":"end",y=c>=0?1:-1,S=y*a,_=y>0?"end":"start",N=y>0?"start":"end";if(i==="top"){var O={x:u+c/2,y:d-p*a,textAnchor:"middle",verticalAnchor:v};return Qt(Qt({},O),n?{height:Math.max(d-n.y,0),width:c}:{})}if(i==="bottom"){var A={x:u+c/2,y:d+h+m,textAnchor:"middle",verticalAnchor:x};return Qt(Qt({},A),n?{height:Math.max(n.y+n.height-(d+h),0),width:c}:{})}if(i==="left"){var C={x:u-S,y:d+h/2,textAnchor:_,verticalAnchor:"middle"};return Qt(Qt({},C),n?{width:Math.max(C.x-n.x,0),height:h}:{})}if(i==="right"){var E={x:u+c+S,y:d+h/2,textAnchor:N,verticalAnchor:"middle"};return Qt(Qt({},E),n?{width:Math.max(n.x+n.width-E.x,0),height:h}:{})}var T=n?{width:c,height:h}:{};return i==="insideLeft"?Qt({x:u+S,y:d+h/2,textAnchor:N,verticalAnchor:"middle"},T):i==="insideRight"?Qt({x:u+c-S,y:d+h/2,textAnchor:_,verticalAnchor:"middle"},T):i==="insideTop"?Qt({x:u+c/2,y:d+m,textAnchor:"middle",verticalAnchor:x},T):i==="insideBottom"?Qt({x:u+c/2,y:d+h-m,textAnchor:"middle",verticalAnchor:v},T):i==="insideTopLeft"?Qt({x:u+S,y:d+m,textAnchor:N,verticalAnchor:x},T):i==="insideTopRight"?Qt({x:u+c-S,y:d+m,textAnchor:_,verticalAnchor:x},T):i==="insideBottomLeft"?Qt({x:u+S,y:d+h-m,textAnchor:N,verticalAnchor:v},T):i==="insideBottomRight"?Qt({x:u+c-S,y:d+h-m,textAnchor:_,verticalAnchor:v},T):vl(i)&&(je(i.x)||oo(i.x))&&(je(i.y)||oo(i.y))?Qt({x:u+Nr(i.x,c),y:d+Nr(i.y,h),textAnchor:"end",verticalAnchor:"end"},T):Qt({x:u+c/2,y:d+h/2,textAnchor:"middle",verticalAnchor:"middle"},T)},gY=function(t){return"cx"in t&&je(t.cx)};function or(e){var t=e.offset,r=t===void 0?5:t,n=oY(e,eY),a=Qt({offset:r},n),i=a.viewBox,o=a.position,u=a.value,d=a.children,c=a.content,h=a.className,p=h===void 0?"":h,m=a.textBreakAll;if(!i||Qe(u)&&Qe(d)&&!b.isValidElement(c)&&!He(c))return null;if(b.isValidElement(c))return b.cloneElement(c,a);var v;if(He(c)){if(v=b.createElement(c,a),b.isValidElement(v))return v}else v=dY(a);var x=gY(i),y=Fe(a,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return hY(a,v,y);var S=x?pY(a):mY(a);return X.createElement(go,uu({className:Ze("recharts-label",p)},y,S,{breakAll:m}),v)}or.displayName="Label";var e$=function(t){var r=t.cx,n=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,u=t.r,d=t.radius,c=t.innerRadius,h=t.outerRadius,p=t.x,m=t.y,v=t.top,x=t.left,y=t.width,S=t.height,_=t.clockWise,N=t.labelViewBox;if(N)return N;if(je(y)&&je(S)){if(je(p)&&je(m))return{x:p,y:m,width:y,height:S};if(je(v)&&je(x))return{x:v,y:x,width:y,height:S}}return je(p)&&je(m)?{x:p,y:m,width:0,height:0}:je(r)&&je(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:o||a||0,innerRadius:c||0,outerRadius:h||d||u||0,clockWise:_}:t.viewBox?t.viewBox:{}},vY=function(t,r){return t?t===!0?X.createElement(or,{key:"label-implicit",viewBox:r}):er(t)?X.createElement(or,{key:"label-implicit",viewBox:r,value:t}):b.isValidElement(t)?t.type===or?b.cloneElement(t,{key:"label-implicit",viewBox:r}):X.createElement(or,{key:"label-implicit",content:t,viewBox:r}):He(t)?X.createElement(or,{key:"label-implicit",content:t,viewBox:r}):vl(t)?X.createElement(or,uu({viewBox:r},t,{key:"label-implicit"})):null:null},yY=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var a=t.children,i=e$(t),o=tn(a,or).map(function(d,c){return b.cloneElement(d,{viewBox:r||i,key:"label-".concat(c)})});if(!n)return o;var u=vY(t.label,r||i);return[u].concat(tY(o))};or.parseViewBox=e$;or.renderCallByParent=yY;var Db,mT;function xY(){if(mT)return Db;mT=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Db=e,Db}var bY=xY();const wY=ct(bY);function du(e){"@babel/helpers - typeof";return du=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},du(e)}var SY=["valueAccessor"],jY=["data","dataKey","clockWise","id","textBreakAll"];function _Y(e){return EY(e)||OY(e)||CY(e)||NY()}function NY(){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 CY(e,t){if(e){if(typeof e=="string")return xw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return xw(e,t)}}function OY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function EY(e){if(Array.isArray(e))return xw(e)}function xw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var RY=function(t){return Array.isArray(t.value)?wY(t.value):t.value};function La(e){var t=e.valueAccessor,r=t===void 0?RY:t,n=yT(e,SY),a=n.data,i=n.dataKey,o=n.clockWise,u=n.id,d=n.textBreakAll,c=yT(n,jY);return!a||!a.length?null:X.createElement(st,{className:"recharts-label-list"},a.map(function(h,p){var m=Qe(i)?r(h,p):Zt(h&&h.payload,i),v=Qe(u)?{}:{id:"".concat(u,"-").concat(p)};return X.createElement(or,fp({},Fe(h,!0),c,v,{parentViewBox:h.parentViewBox,value:m,textBreakAll:d,viewBox:or.parseViewBox(Qe(o)?h:vT(vT({},h),{},{clockWise:o})),key:"label-".concat(p),index:p}))}))}La.displayName="LabelList";function IY(e,t){return e?e===!0?X.createElement(La,{key:"labelList-implicit",data:t}):X.isValidElement(e)||He(e)?X.createElement(La,{key:"labelList-implicit",data:t,content:e}):vl(e)?X.createElement(La,fp({data:t},e,{key:"labelList-implicit"})):null:null}function MY(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,a=tn(n,La).map(function(o,u){return b.cloneElement(o,{data:t,key:"labelList-".concat(u)})});if(!r)return a;var i=IY(e.label,t);return[i].concat(_Y(a))}La.renderCallByParent=MY;function fu(e){"@babel/helpers - typeof";return fu=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},fu(e)}function bw(){return bw=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>c),`, - `).concat(p.x,",").concat(p.y,` - `);if(a>0){var v=_t(r,n,a,o),x=_t(r,n,a,c);m+="L ".concat(x.x,",").concat(x.y,` - A `).concat(a,",").concat(a,`,0, - `).concat(+(Math.abs(d)>180),",").concat(+(o<=c),`, - `).concat(v.x,",").concat(v.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},FY=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,u=t.forceCornerRadius,d=t.cornerIsExternal,c=t.startAngle,h=t.endAngle,p=_r(h-c),m=kf({cx:r,cy:n,radius:i,angle:c,sign:p,cornerRadius:o,cornerIsExternal:d}),v=m.circleTangency,x=m.lineTangency,y=m.theta,S=kf({cx:r,cy:n,radius:i,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:d}),_=S.circleTangency,N=S.lineTangency,O=S.theta,A=d?Math.abs(c-h):Math.abs(c-h)-y-O;if(A<0)return u?"M ".concat(x.x,",").concat(x.y,` - a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 - a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):t$({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:c,endAngle:h});var C="M ".concat(x.x,",").concat(x.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(v.x,",").concat(v.y,` - A`).concat(i,",").concat(i,",0,").concat(+(A>180),",").concat(+(p<0),",").concat(_.x,",").concat(_.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(N.x,",").concat(N.y,` - `);if(a>0){var E=kf({cx:r,cy:n,radius:a,angle:c,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),T=E.circleTangency,R=E.lineTangency,L=E.theta,z=kf({cx:r,cy:n,radius:a,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:d}),F=z.circleTangency,B=z.lineTangency,q=z.theta,H=d?Math.abs(c-h):Math.abs(c-h)-L-q;if(H<0&&o===0)return"".concat(C,"L").concat(r,",").concat(n,"Z");C+="L".concat(B.x,",").concat(B.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(F.x,",").concat(F.y,` - A`).concat(a,",").concat(a,",0,").concat(+(H>180),",").concat(+(p>0),",").concat(T.x,",").concat(T.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(p<0),",").concat(R.x,",").concat(R.y,"Z")}else C+="L".concat(r,",").concat(n,"Z");return C},zY={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},r$=function(t){var r=bT(bT({},zY),t),n=r.cx,a=r.cy,i=r.innerRadius,o=r.outerRadius,u=r.cornerRadius,d=r.forceCornerRadius,c=r.cornerIsExternal,h=r.startAngle,p=r.endAngle,m=r.className;if(o0&&Math.abs(h-p)<360?S=FY({cx:n,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(y,x/2),forceCornerRadius:d,cornerIsExternal:c,startAngle:h,endAngle:p}):S=t$({cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:p}),X.createElement("path",bw({},Fe(r,!0),{className:v,d:S,role:"img"}))};function hu(e){"@babel/helpers - typeof";return hu=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},hu(e)}function ww(){return ww=Object.assign?Object.assign.bind():function(e){for(var t=1;tZY.call(e,t));function Ro(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const rJ="__v",nJ="__o",aJ="_owner",{getOwnPropertyDescriptor:ET,keys:PT}=Object;function iJ(e,t){return e.byteLength===t.byteLength&&pp(new Uint8Array(e),new Uint8Array(t))}function oJ(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function sJ(e,t){return e.byteLength===t.byteLength&&pp(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function lJ(e,t){return Ro(e.getTime(),t.getTime())}function cJ(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function uJ(e,t){return e===t}function AT(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.entries();let o,u,d=0;for(;(o=i.next())&&!o.done;){const c=t.entries();let h=!1,p=0;for(;(u=c.next())&&!u.done;){if(a[p]){p++;continue}const m=o.value,v=u.value;if(r.equals(m[0],v[0],d,p,e,t,r)&&r.equals(m[1],v[1],m[0],v[0],e,t,r)){h=a[p]=!0;break}p++}if(!h)return!1;d++}return!0}const dJ=Ro;function fJ(e,t,r){const n=PT(e);let a=n.length;if(PT(t).length!==a)return!1;for(;a-- >0;)if(!n$(e,t,r,n[a]))return!1;return!0}function jc(e,t,r){const n=OT(e);let a=n.length;if(OT(t).length!==a)return!1;let i,o,u;for(;a-- >0;)if(i=n[a],!n$(e,t,r,i)||(o=ET(e,i),u=ET(t,i),(o||u)&&(!o||!u||o.configurable!==u.configurable||o.enumerable!==u.enumerable||o.writable!==u.writable)))return!1;return!0}function hJ(e,t){return Ro(e.valueOf(),t.valueOf())}function pJ(e,t){return e.source===t.source&&e.flags===t.flags}function TT(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),i=e.values();let o,u;for(;(o=i.next())&&!o.done;){const d=t.values();let c=!1,h=0;for(;(u=d.next())&&!u.done;){if(!a[h]&&r.equals(o.value,u.value,o.value,u.value,e,t,r)){c=a[h]=!0;break}h++}if(!c)return!1}return!0}function pp(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function mJ(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function n$(e,t,r,n){return(n===aJ||n===nJ||n===rJ)&&(e.$$typeof||t.$$typeof)?!0:tJ(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const gJ="[object ArrayBuffer]",vJ="[object Arguments]",yJ="[object Boolean]",xJ="[object DataView]",bJ="[object Date]",wJ="[object Error]",SJ="[object Map]",jJ="[object Number]",_J="[object Object]",NJ="[object RegExp]",CJ="[object Set]",OJ="[object String]",EJ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},PJ="[object URL]",AJ=Object.prototype.toString;function TJ({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:u,areObjectsEqual:d,arePrimitiveWrappersEqual:c,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:m,areUrlsEqual:v,unknownTagComparators:x}){return function(S,_,N){if(S===_)return!0;if(S==null||_==null)return!1;const O=typeof S;if(O!==typeof _)return!1;if(O!=="object")return O==="number"?u(S,_,N):O==="function"?i(S,_,N):!1;const A=S.constructor;if(A!==_.constructor)return!1;if(A===Object)return d(S,_,N);if(Array.isArray(S))return t(S,_,N);if(A===Date)return n(S,_,N);if(A===RegExp)return h(S,_,N);if(A===Map)return o(S,_,N);if(A===Set)return p(S,_,N);const C=AJ.call(S);if(C===bJ)return n(S,_,N);if(C===NJ)return h(S,_,N);if(C===SJ)return o(S,_,N);if(C===CJ)return p(S,_,N);if(C===_J)return typeof S.then!="function"&&typeof _.then!="function"&&d(S,_,N);if(C===PJ)return v(S,_,N);if(C===wJ)return a(S,_,N);if(C===vJ)return d(S,_,N);if(EJ[C])return m(S,_,N);if(C===gJ)return e(S,_,N);if(C===xJ)return r(S,_,N);if(C===yJ||C===jJ||C===OJ)return c(S,_,N);if(x){let E=x[C];if(!E){const T=eJ(S);T&&(E=x[T])}if(E)return E(S,_,N)}return!1}}function kJ({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:iJ,areArraysEqual:r?jc:oJ,areDataViewsEqual:sJ,areDatesEqual:lJ,areErrorsEqual:cJ,areFunctionsEqual:uJ,areMapsEqual:r?Fb(AT,jc):AT,areNumbersEqual:dJ,areObjectsEqual:r?jc:fJ,arePrimitiveWrappersEqual:hJ,areRegExpsEqual:pJ,areSetsEqual:r?Fb(TT,jc):TT,areTypedArraysEqual:r?Fb(pp,jc):pp,areUrlsEqual:mJ,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=If(n.areArraysEqual),i=If(n.areMapsEqual),o=If(n.areObjectsEqual),u=If(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:u})}return n}function RJ(e){return function(t,r,n,a,i,o,u){return e(t,r,u)}}function IJ({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(u,d){const{cache:c=e?new WeakMap:void 0,meta:h}=r();return t(u,d,{cache:c,equals:n,meta:h,strict:a})};if(e)return function(u,d){return t(u,d,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const i={cache:void 0,equals:n,meta:void 0,strict:a};return function(u,d){return t(u,d,i)}}const MJ=ki();ki({strict:!0});ki({circular:!0});ki({circular:!0,strict:!0});ki({createInternalComparator:()=>Ro});ki({strict:!0,createInternalComparator:()=>Ro});ki({circular:!0,createInternalComparator:()=>Ro});ki({circular:!0,createInternalComparator:()=>Ro,strict:!0});function ki(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,i=kJ(e),o=TJ(i),u=r?r(o):RJ(o);return IJ({circular:t,comparator:o,createState:n,equals:u,strict:a})}function DJ(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function kT(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>t?(e(i),r=-1):DJ(a)};requestAnimationFrame(n)}function Sw(e){"@babel/helpers - typeof";return Sw=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},Sw(e)}function LJ(e){return zJ(e)||FJ(e)||BJ(e)||$J()}function $J(){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 BJ(e,t){if(e){if(typeof e=="string")return RT(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return RT(e,t)}}function RT(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:_<0?0:_},y=function(_){for(var N=_>1?1:_,O=N,A=0;A<8;++A){var C=p(O)-N,E=v(O);if(Math.abs(C-N)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,i=a===void 0?8:a,o=t.dt,u=o===void 0?17:o,d=function(h,p,m){var v=-(h-p)*n,x=m*i,y=m+(v-x)*u/1e3,S=m*u/1e3+h;return Math.abs(S-p)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yQ(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i=0)&&(r[a]=e[a]);return r}function zb(e){return SQ(e)||wQ(e)||bQ(e)||xQ()}function xQ(){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 bQ(e,t){if(e){if(typeof e=="string")return Ow(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ow(e,t)}}function wQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function SQ(e){if(Array.isArray(e))return Ow(e)}function Ow(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vp(e){return vp=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vp(e)}var la=(function(e){OQ(r,e);var t=EQ(r);function r(n,a){var i;jQ(this,r),i=t.call(this,n,a);var o=i.props,u=o.isActive,d=o.attributeName,c=o.from,h=o.to,p=o.steps,m=o.children,v=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Aw(i)),i.changeStyle=i.changeStyle.bind(Aw(i)),!u||v<=0)return i.state={style:{}},typeof m=="function"&&(i.state={style:h}),Pw(i);if(p&&p.length)i.state={style:p[0].style};else if(c){if(typeof m=="function")return i.state={style:c},Pw(i);i.state={style:d?Ic({},d,c):c}}else i.state={style:{}};return i}return NQ(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,u=i.canBegin,d=i.attributeName,c=i.shouldReAnimate,h=i.to,p=i.from,m=this.state.style;if(u){if(!o){var v={style:d?Ic({},d,h):h};this.state&&m&&(d&&m[d]!==h||!d&&m!==h)&&this.setState(v);return}if(!(MJ(a.to,h)&&a.canBegin&&a.isActive)){var x=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=x||c?p:a.to;if(this.state&&m){var S={style:d?Ic({},d,y):y};(d&&m[d]!==y||!d&&m!==y)&&this.setState(S)}this.runAnimation(Rn(Rn({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,u=a.to,d=a.duration,c=a.easing,h=a.begin,p=a.onAnimationEnd,m=a.onAnimationStart,v=mQ(o,u,aQ(c),d,this.changeStyle),x=function(){i.stopJSAnimation=v()};this.manager.start([m,h,x,d,p])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,u=a.begin,d=a.onAnimationStart,c=o[0],h=c.style,p=c.duration,m=p===void 0?0:p,v=function(y,S,_){if(_===0)return y;var N=S.duration,O=S.easing,A=O===void 0?"ease":O,C=S.style,E=S.properties,T=S.onAnimationEnd,R=_>0?o[_-1]:S,L=E||Object.keys(C);if(typeof A=="function"||A==="spring")return[].concat(zb(y),[i.runJSAnimation.bind(i,{from:R.style,to:C,duration:N,easing:A}),N]);var z=DT(L,N,A),F=Rn(Rn(Rn({},R.style),C),{},{transition:z});return[].concat(zb(y),[F,N,T]).filter(WJ)};return this.manager.start([d].concat(zb(o.reduce(v,[h,Math.max(m,u)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=qJ());var i=a.begin,o=a.duration,u=a.attributeName,d=a.to,c=a.easing,h=a.onAnimationStart,p=a.onAnimationEnd,m=a.steps,v=a.children,x=this.manager;if(this.unSubscribe=x.subscribe(this.handleStyleChange),typeof c=="function"||typeof v=="function"||c==="spring"){this.runJSAnimation(a);return}if(m.length>1){this.runStepAnimation(a);return}var y=u?Ic({},u,d):d,S=DT(Object.keys(y),o,c);x.start([h,i,Rn(Rn({},y),{},{transition:S}),o,p])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var u=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=vQ(a,gQ),c=b.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!u||c===0||o<=0)return i;var p=function(v){var x=v.props,y=x.style,S=y===void 0?{}:y,_=x.className,N=b.cloneElement(v,Rn(Rn({},d),{},{style:Rn(Rn({},S),h),className:_}));return N};return c===1?p(b.Children.only(i)):X.createElement("div",null,b.Children.map(i,function(m){return p(m)}))}}]),r})(b.PureComponent);la.displayName="Animate";la.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};la.propTypes={from:dt.oneOfType([dt.object,dt.string]),to:dt.oneOfType([dt.object,dt.string]),attributeName:dt.string,duration:dt.number,begin:dt.number,easing:dt.oneOfType([dt.string,dt.func]),steps:dt.arrayOf(dt.shape({duration:dt.number.isRequired,style:dt.object.isRequired,easing:dt.oneOfType([dt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),dt.func]),properties:dt.arrayOf("string"),onAnimationEnd:dt.func})),children:dt.oneOfType([dt.node,dt.func]),isActive:dt.bool,canBegin:dt.bool,onAnimationEnd:dt.func,shouldReAnimate:dt.bool,onAnimationStart:dt.func,onAnimationReStart:dt.func};function gu(e){"@babel/helpers - typeof";return gu=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},gu(e)}function yp(){return yp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,d=n>=0?1:-1,c=a>=0&&n>=0||a<0&&n<0?1:0,h;if(o>0&&i instanceof Array){for(var p=[0,0,0,0],m=0,v=4;mo?o:i[m];h="M".concat(t,",").concat(r+u*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(c,",").concat(t+d*p[0],",").concat(r)),h+="L ".concat(t+n-d*p[1],",").concat(r),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(c,`, - `).concat(t+n,",").concat(r+u*p[1])),h+="L ".concat(t+n,",").concat(r+a-u*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(c,`, - `).concat(t+n-d*p[2],",").concat(r+a)),h+="L ".concat(t+d*p[3],",").concat(r+a),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(c,`, - `).concat(t,",").concat(r+a-u*p[3])),h+="Z"}else if(o>0&&i===+i&&i>0){var x=Math.min(o,i);h="M ".concat(t,",").concat(r+u*x,` - A `).concat(x,",").concat(x,",0,0,").concat(c,",").concat(t+d*x,",").concat(r,` - L `).concat(t+n-d*x,",").concat(r,` - A `).concat(x,",").concat(x,",0,0,").concat(c,",").concat(t+n,",").concat(r+u*x,` - L `).concat(t+n,",").concat(r+a-u*x,` - A `).concat(x,",").concat(x,",0,0,").concat(c,",").concat(t+n-d*x,",").concat(r+a,` - L `).concat(t+d*x,",").concat(r+a,` - A `).concat(x,",").concat(x,",0,0,").concat(c,",").concat(t,",").concat(r+a-u*x," Z")}else h="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return h},$Q=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,i=r.x,o=r.y,u=r.width,d=r.height;if(Math.abs(u)>0&&Math.abs(d)>0){var c=Math.min(i,i+u),h=Math.max(i,i+u),p=Math.min(o,o+d),m=Math.max(o,o+d);return n>=c&&n<=h&&a>=p&&a<=m}return!1},BQ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Ej=function(t){var r=VT(VT({},BQ),t),n=b.useRef(),a=b.useState(-1),i=AQ(a,2),o=i[0],u=i[1];b.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var A=n.current.getTotalLength();A&&u(A)}catch{}},[]);var d=r.x,c=r.y,h=r.width,p=r.height,m=r.radius,v=r.className,x=r.animationEasing,y=r.animationDuration,S=r.animationBegin,_=r.isAnimationActive,N=r.isUpdateAnimationActive;if(d!==+d||c!==+c||h!==+h||p!==+p||h===0||p===0)return null;var O=Ze("recharts-rectangle",v);return N?X.createElement(la,{canBegin:o>0,from:{width:h,height:p,x:d,y:c},to:{width:h,height:p,x:d,y:c},duration:y,animationEasing:x,isActive:N},function(A){var C=A.width,E=A.height,T=A.x,R=A.y;return X.createElement(la,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:S,duration:y,isActive:_,easing:x},X.createElement("path",yp({},Fe(r,!0),{className:O,d:HT(T,R,C,E,m),ref:n})))}):X.createElement("path",yp({},Fe(r,!0),{className:O,d:HT(d,c,h,p,m)}))},FQ=["points","className","baseLinePoints","connectNulls"];function js(){return js=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function WT(e){return WQ(e)||HQ(e)||VQ(e)||UQ()}function UQ(){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 VQ(e,t){if(e){if(typeof e=="string")return Tw(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tw(e,t)}}function HQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function WQ(e){if(Array.isArray(e))return Tw(e)}function Tw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){GT(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),GT(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Fc=function(t,r){var n=GQ(t);r&&(n=[n.reduce(function(i,o){return[].concat(WT(i),WT(o))},[])]);var a=n.map(function(i){return i.reduce(function(o,u,d){return"".concat(o).concat(d===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return n.length===1?"".concat(a,"Z"):a},KQ=function(t,r,n){var a=Fc(t,n);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(Fc(r.reverse(),n).slice(1))},XQ=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,o=zQ(t,FQ);if(!r||!r.length)return null;var u=Ze("recharts-polygon",n);if(a&&a.length){var d=o.stroke&&o.stroke!=="none",c=KQ(r,a,i);return X.createElement("g",{className:u},X.createElement("path",js({},Fe(o,!0),{fill:c.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:c})),d?X.createElement("path",js({},Fe(o,!0),{fill:"none",d:Fc(r,i)})):null,d?X.createElement("path",js({},Fe(o,!0),{fill:"none",d:Fc(a,i)})):null)}var h=Fc(r,i);return X.createElement("path",js({},Fe(o,!0),{fill:h.slice(-1)==="Z"?o.fill:"none",className:u,d:h}))};function kw(){return kw=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var nZ=function(t,r,n,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(r,"h").concat(n)},aZ=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.top,u=o===void 0?0:o,d=t.left,c=d===void 0?0:d,h=t.width,p=h===void 0?0:h,m=t.height,v=m===void 0?0:m,x=t.className,y=tZ(t,YQ),S=JQ({x:n,y:i,top:u,left:c,width:p,height:v},y);return!je(n)||!je(i)||!je(p)||!je(v)||!je(u)||!je(c)?null:X.createElement("path",Rw({},Fe(S,!0),{className:Ze("recharts-cross",x),d:nZ(n,i,p,v,u,c)}))},qb,XT;function iZ(){if(XT)return qb;XT=1;var e=gm(),t=_L(),r=ha();function n(a,i){return a&&a.length?e(a,r(i,2),t):void 0}return qb=n,qb}var oZ=iZ();const sZ=ct(oZ);var Ub,YT;function lZ(){if(YT)return Ub;YT=1;var e=gm(),t=ha(),r=NL();function n(a,i){return a&&a.length?e(a,t(i,2),r):void 0}return Ub=n,Ub}var cZ=lZ();const uZ=ct(cZ);var dZ=["cx","cy","angle","ticks","axisLine"],fZ=["ticks","tick","angle","tickFormatter","stroke"];function Xs(e){"@babel/helpers - typeof";return Xs=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},Xs(e)}function zc(){return zc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZT(e,t){for(var r=0;rrk?o=a==="outer"?"start":"end":i<-rk?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.cx,i=n.cy,o=n.radius,u=n.axisLine,d=n.axisLineType,c=eo(eo({},Fe(this.props,!1)),{},{fill:"none"},Fe(u,!1));if(d==="circle")return X.createElement(wm,io({className:"recharts-polar-angle-axis-line"},c,{cx:a,cy:i,r:o}));var h=this.props.ticks,p=h.map(function(m){return _t(a,i,o,m.coordinate)});return X.createElement(XQ,io({className:"recharts-polar-angle-axis-line"},c,{points:p}))}},{key:"renderTicks",value:function(){var n=this,a=this.props,i=a.ticks,o=a.tick,u=a.tickLine,d=a.tickFormatter,c=a.stroke,h=Fe(this.props,!1),p=Fe(o,!1),m=eo(eo({},h),{},{fill:"none"},Fe(u,!1)),v=i.map(function(x,y){var S=n.getTickLineCoord(x),_=n.getTickTextAnchor(x),N=eo(eo(eo({textAnchor:_},h),{},{stroke:"none",fill:c},p),{},{index:y,payload:x,x:S.x2,y:S.y2});return X.createElement(st,io({className:Ze("recharts-polar-angle-axis-tick",ZL(o)),key:"tick-".concat(x.coordinate)},mo(n.props,x,y)),u&&X.createElement("line",io({className:"recharts-polar-angle-axis-tick-line"},m,S)),o&&t.renderTickItem(o,N,d?d(x.value,y):x.value))});return X.createElement(st,{className:"recharts-polar-angle-axis-ticks"},v)}},{key:"render",value:function(){var n=this.props,a=n.ticks,i=n.radius,o=n.axisLine;return i<=0||!a||!a.length?null:X.createElement(st,{className:Ze("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,a,i){var o;return X.isValidElement(n)?o=X.cloneElement(n,a):He(n)?o=n(a):o=X.createElement(go,io({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])})(b.PureComponent);_m(Nm,"displayName","PolarAngleAxis");_m(Nm,"axisType","angleAxis");_m(Nm,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Vb,nk;function PZ(){if(nk)return Vb;nk=1;var e=_D(),t=e(Object.getPrototypeOf,Object);return Vb=t,Vb}var Hb,ak;function AZ(){if(ak)return Hb;ak=1;var e=Va(),t=PZ(),r=Ha(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,u=i.hasOwnProperty,d=o.call(Object);function c(h){if(!r(h)||e(h)!=n)return!1;var p=t(h);if(p===null)return!0;var m=u.call(p,"constructor")&&p.constructor;return typeof m=="function"&&m instanceof m&&o.call(m)==d}return Hb=c,Hb}var TZ=AZ();const kZ=ct(TZ);var Wb,ik;function RZ(){if(ik)return Wb;ik=1;var e=Va(),t=Ha(),r="[object Boolean]";function n(a){return a===!0||a===!1||t(a)&&e(a)==r}return Wb=n,Wb}var IZ=RZ();const MZ=ct(IZ);function yu(e){"@babel/helpers - typeof";return yu=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},yu(e)}function wp(){return wp=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:m,x:d,y:c},to:{upperWidth:h,lowerWidth:p,height:m,x:d,y:c},duration:y,animationEasing:x,isActive:_},function(O){var A=O.upperWidth,C=O.lowerWidth,E=O.height,T=O.x,R=O.y;return X.createElement(la,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:S,duration:y,easing:x},X.createElement("path",wp({},Fe(r,!0),{className:N,d:ck(T,R,A,C,E),ref:n})))}):X.createElement("g",null,X.createElement("path",wp({},Fe(r,!0),{className:N,d:ck(d,c,h,p,m)})))},WZ=["option","shapeType","propTransformer","activeClassName","isActive"];function xu(e){"@babel/helpers - typeof";return xu=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},xu(e)}function GZ(e,t){if(e==null)return{};var r=KZ(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Sp(e){for(var t=1;t0?en(O,"paddingAngle",0):0;if(C){var T=Jr(C.endAngle-C.startAngle,O.endAngle-O.startAngle),R=St(St({},O),{},{startAngle:N+E,endAngle:N+T(y)+E});S.push(R),N=R.endAngle}else{var L=O.endAngle,z=O.startAngle,F=Jr(0,L-z),B=F(y),q=St(St({},O),{},{startAngle:N+E,endAngle:N+B+E});S.push(q),N=q.endAngle}}),X.createElement(st,null,n.renderSectorsStatically(S))})}},{key:"attachKeyboardHandlers",value:function(n){var a=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var u=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[u].focus(),a.setState({sectorToFocus:u});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,a=n.sectors,i=n.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!Fu(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,a=this.props,i=a.hide,o=a.sectors,u=a.className,d=a.label,c=a.cx,h=a.cy,p=a.innerRadius,m=a.outerRadius,v=a.isAnimationActive,x=this.state.isAnimationFinished;if(i||!o||!o.length||!je(c)||!je(h)||!je(p)||!je(m))return null;var y=Ze("recharts-pie",u);return X.createElement(st,{tabIndex:this.props.rootTabIndex,className:y,ref:function(_){n.pieRef=_}},this.renderSectors(),d&&this.renderLabels(o),or.renderCallByParent(this.props,null,!1),(!v||x)&&La.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return a.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:n.sectors!==a.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,a){return n>a?"start":n=360?N:N-1)*d,A=S-N*v-O,C=a.reduce(function(R,L){var z=Zt(L,_,0);return R+(je(z)?z:0)},0),E;if(C>0){var T;E=a.map(function(R,L){var z=Zt(R,_,0),F=Zt(R,h,L),B=(je(z)?z:0)/C,q;L?q=T.endAngle+_r(y)*d*(z!==0?1:0):q=o;var H=q+_r(y)*((z!==0?v:0)+B*A),V=(q+H)/2,G=(x.innerRadius+x.outerRadius)/2,U=[{name:F,value:z,payload:R,dataKey:_,type:m}],$=_t(x.cx,x.cy,G,V);return T=St(St(St({percent:B,cornerRadius:i,name:F,tooltipPayload:U,midAngle:V,middleRadius:G,tooltipPosition:$},R),x),{},{value:Zt(R,_),startAngle:q,endAngle:H,payload:R,paddingAngle:_r(y)*d}),T})}return St(St({},x),{},{sectors:E,data:a})});var Gb,pk;function mee(){if(pk)return Gb;pk=1;var e=Math.ceil,t=Math.max;function r(n,a,i,o){for(var u=-1,d=t(e((a-n)/(i||1)),0),c=Array(d);d--;)c[o?d:++u]=n,n+=i;return c}return Gb=r,Gb}var Kb,mk;function v$(){if(mk)return Kb;mk=1;var e=FD(),t=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var i=a<0?-1:1;return i*r}return a===a?a:0}return Kb=n,Kb}var Xb,gk;function gee(){if(gk)return Xb;gk=1;var e=mee(),t=lm(),r=v$();function n(a){return function(i,o,u){return u&&typeof u!="number"&&t(i,o,u)&&(o=u=void 0),i=r(i),o===void 0?(o=i,i=0):o=r(o),u=u===void 0?i0&&n.handleDrag(a.changedTouches[0])}),Gr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,o=a.onDragEnd,u=a.startIndex;o?.({endIndex:i,startIndex:u})}),n.detachDragEndListener()}),Gr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Gr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Gr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Gr(n,"handleSlideDragStart",function(a){var i=Sk(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Eee(t,e),_ee(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,o=this.state.scaleValues,u=this.props,d=u.gap,c=u.data,h=c.length-1,p=Math.min(a,i),m=Math.max(a,i),v=t.getIndexInRange(o,p),x=t.getIndexInRange(o,m);return{startIndex:v-v%d,endIndex:x===h?h:x-x%d}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,o=a.tickFormatter,u=a.dataKey,d=Zt(i[n],u,n);return He(o)?o(d,n):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,o=a.startX,u=a.endX,d=this.props,c=d.x,h=d.width,p=d.travellerWidth,m=d.startIndex,v=d.endIndex,x=d.onChange,y=n.pageX-i;y>0?y=Math.min(y,c+h-p-u,c+h-p-o):y<0&&(y=Math.max(y,c-o,c-u));var S=this.getIndex({startX:o+y,endX:u+y});(S.startIndex!==m||S.endIndex!==v)&&x&&x(S),this.setState({startX:o+y,endX:u+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=Sk(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,u=a.endX,d=a.startX,c=this.state[o],h=this.props,p=h.x,m=h.width,v=h.travellerWidth,x=h.onChange,y=h.gap,S=h.data,_={startX:this.state.startX,endX:this.state.endX},N=n.pageX-i;N>0?N=Math.min(N,p+m-v-c):N<0&&(N=Math.max(N,p-c)),_[o]=c+N;var O=this.getIndex(_),A=O.startIndex,C=O.endIndex,E=function(){var R=S.length-1;return o==="startX"&&(u>d?A%y===0:C%y===0)||ud?C%y===0:A%y===0)||u>d&&C===R};this.setState(Gr(Gr({},o,c+N),"brushMoveStartX",n.pageX),function(){x&&E()&&x(O)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,o=this.state,u=o.scaleValues,d=o.startX,c=o.endX,h=this.state[a],p=u.indexOf(h);if(p!==-1){var m=p+n;if(!(m===-1||m>=u.length)){var v=u[m];a==="startX"&&v>=c||a==="endX"&&v<=d||this.setState(Gr({},a,v),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,u=n.height,d=n.fill,c=n.stroke;return X.createElement("rect",{stroke:c,fill:d,x:a,y:i,width:o,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,u=n.height,d=n.data,c=n.children,h=n.padding,p=b.Children.only(c);return p?X.cloneElement(p,{x:a,y:i,width:o,height:u,margin:h,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,o,u=this,d=this.props,c=d.y,h=d.travellerWidth,p=d.height,m=d.traveller,v=d.ariaLabel,x=d.data,y=d.startIndex,S=d.endIndex,_=Math.max(n,this.props.x),N=Jb(Jb({},Fe(this.props,!1)),{},{x:_,y:c,width:h,height:p}),O=v||"Min value: ".concat((i=x[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=x[S])===null||o===void 0?void 0:o.name);return X.createElement(st,{tabIndex:0,role:"slider","aria-label":O,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(C){["ArrowLeft","ArrowRight"].includes(C.key)&&(C.preventDefault(),C.stopPropagation(),u.handleTravellerMoveKeyboard(C.key==="ArrowRight"?1:-1,a))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,N))}},{key:"renderSlide",value:function(n,a){var i=this.props,o=i.y,u=i.height,d=i.stroke,c=i.travellerWidth,h=Math.min(n,a)+c,p=Math.max(Math.abs(a-n)-c,0);return X.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:h,y:o,width:p,height:u})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,o=n.y,u=n.height,d=n.travellerWidth,c=n.stroke,h=this.state,p=h.startX,m=h.endX,v=5,x={pointerEvents:"none",fill:c};return X.createElement(st,{className:"recharts-brush-texts"},X.createElement(go,Np({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,m)-v,y:o+u/2},x),this.getTextOfTick(a)),X.createElement(go,Np({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,m)+d+v,y:o+u/2},x),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,o=n.children,u=n.x,d=n.y,c=n.width,h=n.height,p=n.alwaysShowText,m=this.state,v=m.startX,x=m.endX,y=m.isTextActive,S=m.isSlideMoving,_=m.isTravellerMoving,N=m.isTravellerFocused;if(!a||!a.length||!je(u)||!je(d)||!je(c)||!je(h)||c<=0||h<=0)return null;var O=Ze("recharts-brush",i),A=X.Children.count(o)===1,C=See("userSelect","none");return X.createElement(st,{className:O,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:C},this.renderBackground(),A&&this.renderPanorama(),this.renderSlide(v,x),this.renderTravellerLayer(v,"startX"),this.renderTravellerLayer(x,"endX"),(y||S||_||N||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,o=n.width,u=n.height,d=n.stroke,c=Math.floor(i+u/2)-1;return X.createElement(X.Fragment,null,X.createElement("rect",{x:a,y:i,width:o,height:u,fill:d,stroke:"none"}),X.createElement("line",{x1:a+1,y1:c,x2:a+o-1,y2:c,fill:"none",stroke:"#fff"}),X.createElement("line",{x1:a+1,y1:c+2,x2:a+o-1,y2:c+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return X.isValidElement(n)?i=X.cloneElement(n,a):He(n)?i=n(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,o=n.width,u=n.x,d=n.travellerWidth,c=n.updateId,h=n.startIndex,p=n.endIndex;if(i!==a.prevData||c!==a.prevUpdateId)return Jb({prevData:i,prevTravellerWidth:d,prevUpdateId:c,prevX:u,prevWidth:o},i&&i.length?Aee({data:i,width:o,x:u,travellerWidth:d,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||u!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([u,u+o-d]);var m=a.scale.domain().map(function(v){return a.scale(v)});return{prevData:i,prevTravellerWidth:d,prevUpdateId:c,prevX:u,prevWidth:o,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,o=0,u=i-1;u-o>1;){var d=Math.floor((o+u)/2);n[d]>a?u=d:o=d}return a>=n[u]?u:o}}])})(b.PureComponent);Gr(Zs,"displayName","Brush");Gr(Zs,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Qb,jk;function Tee(){if(jk)return Qb;jk=1;var e=ej();function t(r,n){var a;return e(r,function(i,o,u){return a=n(i,o,u),!a}),!!a}return Qb=t,Qb}var Zb,_k;function kee(){if(_k)return Zb;_k=1;var e=vD(),t=ha(),r=Tee(),n=$r(),a=lm();function i(o,u,d){var c=n(o)?e:r;return d&&a(o,u,d)&&(u=void 0),c(o,t(u,3))}return Zb=i,Zb}var Ree=kee();const Iee=ct(Ree);var ia=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},e1,Nk;function Mee(){if(Nk)return e1;Nk=1;var e=MD();function t(r,n,a){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return e1=t,e1}var t1,Ck;function Dee(){if(Ck)return t1;Ck=1;var e=Mee(),t=RD(),r=ha();function n(a,i){var o={};return i=r(i,3),t(a,function(u,d,c){e(o,d,i(u,d,c))}),o}return t1=n,t1}var Lee=Dee();const $ee=ct(Lee);var r1,Ok;function Bee(){if(Ok)return r1;Ok=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Kee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Xee(e,t){var r=e.x,n=e.y,a=Gee(e,Uee),i="".concat(r),o=parseInt(i,10),u="".concat(n),d=parseInt(u,10),c="".concat(t.height||a.height),h=parseInt(c,10),p="".concat(t.width||a.width),m=parseInt(p,10);return _c(_c(_c(_c(_c({},t),a),o?{x:o}:{}),d?{y:d}:{}),{},{height:h,width:m,name:t.name,radius:t.radius})}function Tk(e){return X.createElement(p$,$w({shapeType:"rectangle",propTransformer:Xee,activeClassName:"recharts-active-bar"},e))}var Yee=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var i=je(n)||gU(n);return i?t(n,a):(i||yo(),r)}},Jee=["value","background"],S$;function el(e){"@babel/helpers - typeof";return el=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},el(e)}function Qee(e,t){if(e==null)return{};var r=Zee(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Zee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Op(){return Op=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(V)0&&Math.abs(H)0&&(q=Math.min((ie||0)-(H[oe-1]||0),q))}),Number.isFinite(q)){var V=q/B,G=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(T=V*G/2),y.padding==="no-gap"){var U=Nr(t.barCategoryGap,V*G),$=V*G/2;T=$-U-($-U)/G*U}}}a==="xAxis"?R=[n.left+(O.left||0)+(T||0),n.left+n.width-(O.right||0)-(T||0)]:a==="yAxis"?R=d==="horizontal"?[n.top+n.height-(O.bottom||0),n.top+(O.top||0)]:[n.top+(O.top||0)+(T||0),n.top+n.height-(O.bottom||0)-(T||0)]:R=y.range,C&&(R=[R[1],R[0]]);var Q=WL(y,i,m),k=Q.scale,I=Q.realScaleType;k.domain(_).range(R),GL(k);var D=KL(k,Bn(Bn({},y),{},{realScaleType:I}));a==="xAxis"?(F=S==="top"&&!A||S==="bottom"&&A,L=n.left,z=p[E]-F*y.height):a==="yAxis"&&(F=S==="left"&&!A||S==="right"&&A,L=p[E]-F*y.width,z=n.top);var Z=Bn(Bn(Bn({},y),D),{},{realScaleType:I,x:L,y:z,scale:k,width:a==="xAxis"?n.width:y.width,height:a==="yAxis"?n.height:y.height});return Z.bandSize=up(Z,D),!y.hide&&a==="xAxis"?p[E]+=(F?-1:1)*Z.height:y.hide||(p[E]+=(F?-1:1)*Z.width),Bn(Bn({},v),{},Em({},x,Z))},{})},O$=function(t,r){var n=t.x,a=t.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(a,o),width:Math.abs(i-n),height:Math.abs(o-a)}},ute=function(t){var r=t.x1,n=t.y1,a=t.x2,i=t.y2;return O$({x:r,y:n},{x:a,y:i})},E$=(function(){function e(t){ste(this,e),this.scale=t}return lte(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(a){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+d}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])})();Em(E$,"EPS",1e-4);var Pj=function(t){var r=Object.keys(t).reduce(function(n,a){return Bn(Bn({},n),{},Em({},a,E$.create(t[a])))},{});return Bn(Bn({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,u=i.position;return $ee(a,function(d,c){return r[c].apply(d,{bandAware:o,position:u})})},isInRange:function(a){return w$(a,function(i,o){return r[o].isInRange(i)})}})};function dte(e){return(e%180+180)%180}var fte=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=dte(a),o=i*Math.PI/180,u=Math.atan(n/r),d=o>u&&o-1?d[c?i[h]:h]:void 0}}return i1=n,i1}var o1,Lk;function pte(){if(Lk)return o1;Lk=1;var e=v$();function t(r){var n=e(r),a=n%1;return n===n?a?n-a:n:0}return o1=t,o1}var s1,$k;function mte(){if($k)return s1;$k=1;var e=ED(),t=ha(),r=pte(),n=Math.max;function a(i,o,u){var d=i==null?0:i.length;if(!d)return-1;var c=u==null?0:r(u);return c<0&&(c=n(d+c,0)),e(i,t(o,3),c)}return s1=a,s1}var l1,Bk;function gte(){if(Bk)return l1;Bk=1;var e=hte(),t=mte(),r=e(t);return l1=r,l1}var vte=gte();const yte=ct(vte);var xte=VM();const bte=ct(xte);var wte=bte(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Aj=b.createContext(void 0),Tj=b.createContext(void 0),P$=b.createContext(void 0),A$=b.createContext({}),T$=b.createContext(void 0),k$=b.createContext(0),R$=b.createContext(0),Fk=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,o=t.clipPathId,u=t.children,d=t.width,c=t.height,h=wte(i);return X.createElement(Aj.Provider,{value:n},X.createElement(Tj.Provider,{value:a},X.createElement(A$.Provider,{value:i},X.createElement(P$.Provider,{value:h},X.createElement(T$.Provider,{value:o},X.createElement(k$.Provider,{value:c},X.createElement(R$.Provider,{value:d},u)))))))},Ste=function(){return b.useContext(T$)},I$=function(t){var r=b.useContext(Aj);r==null&&yo();var n=r[t];return n==null&&yo(),n},jte=function(){var t=b.useContext(Aj);return vi(t)},_te=function(){var t=b.useContext(Tj),r=yte(t,function(n){return w$(n.domain,Number.isFinite)});return r||vi(t)},M$=function(t){var r=b.useContext(Tj);r==null&&yo();var n=r[t];return n==null&&yo(),n},Nte=function(){var t=b.useContext(P$);return t},Cte=function(){return b.useContext(A$)},kj=function(){return b.useContext(R$)},Rj=function(){return b.useContext(k$)};function tl(e){"@babel/helpers - typeof";return tl=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},tl(e)}function Ote(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ete(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*a)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-a)<=0}function cre(e,t){return q$(e,t+1)}function ure(e,t,r,n,a){for(var i=(n||[]).slice(),o=t.start,u=t.end,d=0,c=1,h=o,p=function(){var x=n?.[d];if(x===void 0)return{v:q$(n,c)};var y=d,S,_=function(){return S===void 0&&(S=r(x,y)),S},N=x.coordinate,O=d===0||kp(e,N,_,h,u);O||(d=0,h=o,c+=1),O&&(h=N+e*(_()/2+a),d+=c)},m;c<=i.length;)if(m=p(),m)return m.v;return[]}function _u(e){"@babel/helpers - typeof";return _u=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},_u(e)}function Kk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function vr(e){for(var t=1;t0?v.coordinate-S*e:v.coordinate})}else i[m]=v=vr(vr({},v),{},{tickCoord:v.coordinate});var _=kp(e,v.tickCoord,y,u,d);_&&(d=v.tickCoord-e*(y()/2+a),i[m]=vr(vr({},v),{},{isShow:!0}))},h=o-1;h>=0;h--)c(h);return i}function mre(e,t,r,n,a,i){var o=(n||[]).slice(),u=o.length,d=t.start,c=t.end;if(i){var h=n[u-1],p=r(h,u-1),m=e*(h.coordinate+e*p/2-c);o[u-1]=h=vr(vr({},h),{},{tickCoord:m>0?h.coordinate-m*e:h.coordinate});var v=kp(e,h.tickCoord,function(){return p},d,c);v&&(c=h.tickCoord-e*(p/2+a),o[u-1]=vr(vr({},h),{},{isShow:!0}))}for(var x=i?u-1:u,y=function(N){var O=o[N],A,C=function(){return A===void 0&&(A=r(O,N)),A};if(N===0){var E=e*(O.coordinate-e*C()/2-d);o[N]=O=vr(vr({},O),{},{tickCoord:E<0?O.coordinate-E*e:O.coordinate})}else o[N]=O=vr(vr({},O),{},{tickCoord:O.coordinate});var T=kp(e,O.tickCoord,C,d,c);T&&(d=O.tickCoord+e*(C()/2+a),o[N]=vr(vr({},O),{},{isShow:!0}))},S=0;S=2?_r(a[1].coordinate-a[0].coordinate):1,_=lre(i,S,v);return d==="equidistantPreserveStart"?ure(S,_,y,a,o):(d==="preserveStart"||d==="preserveStartEnd"?m=mre(S,_,y,a,o,d==="preserveStartEnd"):m=pre(S,_,y,a,o),m.filter(function(N){return N.isShow}))}var gre=["viewBox"],vre=["viewBox"],yre=["ticks"];function al(e){"@babel/helpers - typeof";return al=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},al(e)}function Ns(){return Ns=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yk(e,t){for(var r=0;r0?d(this.props):d(v)),o<=0||u<=0||!x||!x.length?null:X.createElement(st,{className:Ze("recharts-cartesian-axis",c),ref:function(S){n.layerReference=S}},i&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),or.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var o,u=Ze(a.className,"recharts-cartesian-axis-tick-value");return X.isValidElement(n)?o=X.cloneElement(n,Jt(Jt({},a),{},{className:u})):He(n)?o=n(Jt(Jt({},a),{},{className:u})):o=X.createElement(go,Ns({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(b.Component);Lj(jl,"displayName","CartesianAxis");Lj(jl,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Ore=["x1","y1","x2","y2","key"],Ere=["offset"];function xo(e){"@babel/helpers - typeof";return xo=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},xo(e)}function Jk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function yr(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Rre=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,i=t.y,o=t.width,u=t.height,d=t.ry;return X.createElement("rect",{x:a,y:i,ry:d,width:o,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function H$(e,t){var r;if(X.isValidElement(e))r=X.cloneElement(e,t);else if(He(e))r=e(t);else{var n=t.x1,a=t.y1,i=t.x2,o=t.y2,u=t.key,d=Qk(t,Ore),c=Fe(d,!1);c.offset;var h=Qk(c,Ere);r=X.createElement("line",co({},h,{x1:n,y1:a,x2:i,y2:o,fill:"none",key:u}))}return r}function Ire(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(u,d){var c=yr(yr({},e),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(d),index:d});return H$(a,c)});return X.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function Mre(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,i=e.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(u,d){var c=yr(yr({},e),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(d),index:d});return H$(a,c)});return X.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function Dre(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,i=e.width,o=e.height,u=e.horizontalPoints,d=e.horizontal,c=d===void 0?!0:d;if(!c||!t||!t.length)return null;var h=u.map(function(m){return Math.round(m+a-a)}).sort(function(m,v){return m-v});a!==h[0]&&h.unshift(0);var p=h.map(function(m,v){var x=!h[v+1],y=x?a+o-m:h[v+1]-m;if(y<=0)return null;var S=v%t.length;return X.createElement("rect",{key:"react-".concat(v),y:m,x:n,height:y,width:i,stroke:"none",fill:t[S],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return X.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function Lre(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,i=e.x,o=e.y,u=e.width,d=e.height,c=e.verticalPoints;if(!r||!n||!n.length)return null;var h=c.map(function(m){return Math.round(m+i-i)}).sort(function(m,v){return m-v});i!==h[0]&&h.unshift(0);var p=h.map(function(m,v){var x=!h[v+1],y=x?i+u-m:h[v+1]-m;if(y<=0)return null;var S=v%n.length;return X.createElement("rect",{key:"react-".concat(v),x:m,y:o,width:y,height:d,stroke:"none",fill:n[S],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return X.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var $re=function(t,r){var n=t.xAxis,a=t.width,i=t.height,o=t.offset;return HL(Dj(yr(yr(yr({},jl.defaultProps),n),{},{ticks:Ia(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,r)},Bre=function(t,r){var n=t.yAxis,a=t.width,i=t.height,o=t.offset;return HL(Dj(yr(yr(yr({},jl.defaultProps),n),{},{ticks:Ia(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,r)},us={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Ip(e){var t,r,n,a,i,o,u=kj(),d=Rj(),c=Cte(),h=yr(yr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:us.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:us.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:us.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:us.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:us.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:us.verticalFill,x:je(e.x)?e.x:c.left,y:je(e.y)?e.y:c.top,width:je(e.width)?e.width:c.width,height:je(e.height)?e.height:c.height}),p=h.x,m=h.y,v=h.width,x=h.height,y=h.syncWithTicks,S=h.horizontalValues,_=h.verticalValues,N=jte(),O=_te();if(!je(v)||v<=0||!je(x)||x<=0||!je(p)||p!==+p||!je(m)||m!==+m)return null;var A=h.verticalCoordinatesGenerator||$re,C=h.horizontalCoordinatesGenerator||Bre,E=h.horizontalPoints,T=h.verticalPoints;if((!E||!E.length)&&He(C)){var R=S&&S.length,L=C({yAxis:O?yr(yr({},O),{},{ticks:R?S:O.ticks}):void 0,width:u,height:d,offset:c},R?!0:y);Vn(Array.isArray(L),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(xo(L),"]")),Array.isArray(L)&&(E=L)}if((!T||!T.length)&&He(A)){var z=_&&_.length,F=A({xAxis:N?yr(yr({},N),{},{ticks:z?_:N.ticks}):void 0,width:u,height:d,offset:c},z?!0:y);Vn(Array.isArray(F),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(xo(F),"]")),Array.isArray(F)&&(T=F)}return X.createElement("g",{className:"recharts-cartesian-grid"},X.createElement(Rre,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),X.createElement(Ire,co({},h,{offset:c,horizontalPoints:E,xAxis:N,yAxis:O})),X.createElement(Mre,co({},h,{offset:c,verticalPoints:T,xAxis:N,yAxis:O})),X.createElement(Dre,co({},h,{horizontalPoints:E})),X.createElement(Lre,co({},h,{verticalPoints:T})))}Ip.displayName="CartesianGrid";var Fre=["type","layout","connectNulls","ref"],zre=["key"];function il(e){"@babel/helpers - typeof";return il=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},il(e)}function Zk(e,t){if(e==null)return{};var r=qre(e,t),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function qc(){return qc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rp){v=[].concat(ds(d.slice(0,x)),[p-y]);break}var S=v.length%2===0?[0,m]:[m];return[].concat(ds(t.repeat(d,h)),ds(v),S).map(function(_){return"".concat(_,"px")}).join(", ")}),Fn(r,"id",yl("recharts-line-")),Fn(r,"pathRef",function(o){r.mainCurve=o}),Fn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Fn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Qre(t,e),Kre(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,u=i.xAxis,d=i.yAxis,c=i.layout,h=i.children,p=tn(h,zu);if(!p)return null;var m=function(y,S){return{x:y.x,y:y.y,value:y.value,errorVal:Zt(y.payload,S)}},v={clipPath:n?"url(#clipPath-".concat(a,")"):null};return X.createElement(st,v,p.map(function(x){return X.cloneElement(x,{key:"bar-".concat(x.props.dataKey),data:o,xAxis:u,yAxis:d,layout:c,dataPointFormatter:m})}))}},{key:"renderDots",value:function(n,a,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var u=this.props,d=u.dot,c=u.points,h=u.dataKey,p=Fe(this.props,!1),m=Fe(d,!0),v=c.map(function(y,S){var _=Wr(Wr(Wr({key:"dot-".concat(S),r:3},p),m),{},{index:S,cx:y.x,cy:y.y,value:y.value,dataKey:h,payload:y.payload,points:c});return t.renderDotItem(d,_)}),x={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return X.createElement(st,qc({className:"recharts-line-dots",key:"dots"},x),v)}},{key:"renderCurveStatically",value:function(n,a,i,o){var u=this.props,d=u.type,c=u.layout,h=u.connectNulls;u.ref;var p=Zk(u,Fre),m=Wr(Wr(Wr({},Fe(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:n},o),{},{type:d,layout:c,connectNulls:h});return X.createElement(hp,qc({},m,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,a){var i=this,o=this.props,u=o.points,d=o.strokeDasharray,c=o.isAnimationActive,h=o.animationBegin,p=o.animationDuration,m=o.animationEasing,v=o.animationId,x=o.animateNewValues,y=o.width,S=o.height,_=this.state,N=_.prevPoints,O=_.totalLength;return X.createElement(la,{begin:h,duration:p,isActive:c,easing:m,from:{t:0},to:{t:1},key:"line-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(A){var C=A.t;if(N){var E=N.length/u.length,T=u.map(function(B,q){var H=Math.floor(q*E);if(N[H]){var V=N[H],G=Jr(V.x,B.x),U=Jr(V.y,B.y);return Wr(Wr({},B),{},{x:G(C),y:U(C)})}if(x){var $=Jr(y*2,B.x),Q=Jr(S/2,B.y);return Wr(Wr({},B),{},{x:$(C),y:Q(C)})}return Wr(Wr({},B),{},{x:B.x,y:B.y})});return i.renderCurveStatically(T,n,a)}var R=Jr(0,O),L=R(C),z;if(d){var F="".concat(d).split(/[,\s]+/gim).map(function(B){return parseFloat(B)});z=i.getStrokeDasharray(L,O,F)}else z=i.generateSimpleStrokeDasharray(O,L);return i.renderCurveStatically(u,n,a,{strokeDasharray:z})})}},{key:"renderCurve",value:function(n,a){var i=this.props,o=i.points,u=i.isAnimationActive,d=this.state,c=d.prevPoints,h=d.totalLength;return u&&o&&o.length&&(!c&&h>0||!Fu(c,o))?this.renderCurveWithAnimation(n,a):this.renderCurveStatically(o,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,u=a.points,d=a.className,c=a.xAxis,h=a.yAxis,p=a.top,m=a.left,v=a.width,x=a.height,y=a.isAnimationActive,S=a.id;if(i||!u||!u.length)return null;var _=this.state.isAnimationFinished,N=u.length===1,O=Ze("recharts-line",d),A=c&&c.allowDataOverflow,C=h&&h.allowDataOverflow,E=A||C,T=Qe(S)?this.id:S,R=(n=Fe(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},L=R.r,z=L===void 0?3:L,F=R.strokeWidth,B=F===void 0?2:F,q=EU(o)?o:{},H=q.clipDot,V=H===void 0?!0:H,G=z*2+B;return X.createElement(st,{className:O},A||C?X.createElement("defs",null,X.createElement("clipPath",{id:"clipPath-".concat(T)},X.createElement("rect",{x:A?m:m-v/2,y:C?p:p-x/2,width:A?v:v*2,height:C?x:x*2})),!V&&X.createElement("clipPath",{id:"clipPath-dots-".concat(T)},X.createElement("rect",{x:m-G/2,y:p-G/2,width:v+G,height:x+G}))):null,!N&&this.renderCurve(E,T),this.renderErrorBar(E,T),(N||o)&&this.renderDots(E,V,T),(!y||_)&&La.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:a.curPoints}:n.points!==a.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,a){for(var i=n.length%2!==0?[].concat(ds(n),[0]):n,o=[],u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Une(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vne(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&je(a)&&je(i)?t.slice(a,i+1):[]};function o4(e){return e==="number"?[0,"auto"]:void 0}var nS=function(t,r,n,a){var i=t.graphicalItems,o=t.tooltipAxis,u=Rm(r,t);return n<0||!i||!i.length||n>=u.length?null:i.reduce(function(d,c){var h,p=(h=c.props.data)!==null&&h!==void 0?h:r;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(o.dataKey&&!o.allowDuplicatedCategory){var v=p===void 0?u:p;m=Lh(v,o.dataKey,a)}else m=p&&p[n]||u[n];return m?[].concat(cl(d),[YL(c,m)]):d},[])},lR=function(t,r,n,a){var i=a||{x:t.chartX,y:t.chartY},o=rae(i,n),u=t.orderedTooltipTicks,d=t.tooltipAxis,c=t.tooltipTicks,h=NX(o,u,c,d);if(h>=0&&c){var p=c[h]&&c[h].value,m=nS(t,r,h,p),v=nae(n,u,h,i);return{activeTooltipIndex:h,activeLabel:p,activePayload:m,activeCoordinate:v}}return null},aae=function(t,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,o=r.axisIdKey,u=r.stackGroups,d=r.dataStartIndex,c=r.dataEndIndex,h=t.layout,p=t.children,m=t.stackOffset,v=VL(h,i);return n.reduce(function(x,y){var S,_=y.type.defaultProps!==void 0?he(he({},y.type.defaultProps),y.props):y.props,N=_.type,O=_.dataKey,A=_.allowDataOverflow,C=_.allowDuplicatedCategory,E=_.scale,T=_.ticks,R=_.includeHidden,L=_[o];if(x[L])return x;var z=Rm(t.data,{graphicalItems:a.filter(function(D){var Z,ie=o in D.props?D.props[o]:(Z=D.type.defaultProps)===null||Z===void 0?void 0:Z[o];return ie===L}),dataStartIndex:d,dataEndIndex:c}),F=z.length,B,q,H;Ane(_.domain,A,N)&&(B=vw(_.domain,null,A),v&&(N==="number"||E!=="auto")&&(H=$c(z,O,"category")));var V=o4(N);if(!B||B.length===0){var G,U=(G=_.domain)!==null&&G!==void 0?G:V;if(O){if(B=$c(z,O,N),N==="category"&&v){var $=yU(B);C&&$?(q=B,B=_p(0,F)):C||(B=uT(U,B,y).reduce(function(D,Z){return D.indexOf(Z)>=0?D:[].concat(cl(D),[Z])},[]))}else if(N==="category")C?B=B.filter(function(D){return D!==""&&!Qe(D)}):B=uT(U,B,y).reduce(function(D,Z){return D.indexOf(Z)>=0||Z===""||Qe(Z)?D:[].concat(cl(D),[Z])},[]);else if(N==="number"){var Q=AX(z,a.filter(function(D){var Z,ie,oe=o in D.props?D.props[o]:(Z=D.type.defaultProps)===null||Z===void 0?void 0:Z[o],ne="hide"in D.props?D.props.hide:(ie=D.type.defaultProps)===null||ie===void 0?void 0:ie.hide;return oe===L&&(R||!ne)}),O,i,h);Q&&(B=Q)}v&&(N==="number"||E!=="auto")&&(H=$c(z,O,"category"))}else v?B=_p(0,F):u&&u[L]&&u[L].hasStack&&N==="number"?B=m==="expand"?[0,1]:XL(u[L].stackGroups,d,c):B=UL(z,a.filter(function(D){var Z=o in D.props?D.props[o]:D.type.defaultProps[o],ie="hide"in D.props?D.props.hide:D.type.defaultProps.hide;return Z===L&&(R||!ie)}),N,h,!0);if(N==="number")B=eS(p,B,L,i,T),U&&(B=vw(U,B,A));else if(N==="category"&&U){var k=U,I=B.every(function(D){return k.indexOf(D)>=0});I&&(B=k)}}return he(he({},x),{},Ue({},L,he(he({},_),{},{axisType:i,domain:B,categoricalDomain:H,duplicateDomain:q,originalDomain:(S=_.domain)!==null&&S!==void 0?S:V,isCategorical:v,layout:h})))},{})},iae=function(t,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,o=r.axisIdKey,u=r.stackGroups,d=r.dataStartIndex,c=r.dataEndIndex,h=t.layout,p=t.children,m=Rm(t.data,{graphicalItems:n,dataStartIndex:d,dataEndIndex:c}),v=m.length,x=VL(h,i),y=-1;return n.reduce(function(S,_){var N=_.type.defaultProps!==void 0?he(he({},_.type.defaultProps),_.props):_.props,O=N[o],A=o4("number");if(!S[O]){y++;var C;return x?C=_p(0,v):u&&u[O]&&u[O].hasStack?(C=XL(u[O].stackGroups,d,c),C=eS(p,C,O,i)):(C=vw(A,UL(m,n.filter(function(E){var T,R,L=o in E.props?E.props[o]:(T=E.type.defaultProps)===null||T===void 0?void 0:T[o],z="hide"in E.props?E.props.hide:(R=E.type.defaultProps)===null||R===void 0?void 0:R.hide;return L===O&&!z}),"number",h),a.defaultProps.allowDataOverflow),C=eS(p,C,O,i)),he(he({},S),{},Ue({},O,he(he({axisType:i},a.defaultProps),{},{hide:!0,orientation:en(eae,"".concat(i,".").concat(y%2),null),domain:C,originalDomain:A,isCategorical:x,layout:h})))}return S},{})},oae=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,u=r.stackGroups,d=r.dataStartIndex,c=r.dataEndIndex,h=t.children,p="".concat(a,"Id"),m=tn(h,i),v={};return m&&m.length?v=aae(t,{axes:m,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:c}):o&&o.length&&(v=iae(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:p,stackGroups:u,dataStartIndex:d,dataEndIndex:c})),v},sae=function(t){var r=vi(t),n=Ia(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:tj(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:up(r,n)}},cR=function(t){var r=t.children,n=t.defaultShowTooltip,a=Kr(r,Zs),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},lae=function(t){return!t||!t.length?!1:t.some(function(r){var n=Ma(r&&r.type);return n&&n.indexOf("Bar")>=0})},uR=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},cae=function(t,r){var n=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,u=t.yAxisMap,d=u===void 0?{}:u,c=n.width,h=n.height,p=n.children,m=n.margin||{},v=Kr(p,Zs),x=Kr(p,Ps),y=Object.keys(d).reduce(function(C,E){var T=d[E],R=T.orientation;return!T.mirror&&!T.hide?he(he({},C),{},Ue({},R,C[R]+T.width)):C},{left:m.left||0,right:m.right||0}),S=Object.keys(o).reduce(function(C,E){var T=o[E],R=T.orientation;return!T.mirror&&!T.hide?he(he({},C),{},Ue({},R,en(C,"".concat(R))+T.height)):C},{top:m.top||0,bottom:m.bottom||0}),_=he(he({},S),y),N=_.bottom;v&&(_.bottom+=v.props.height||Zs.defaultProps.height),x&&r&&(_=EX(_,a,n,r));var O=c-_.left-_.right,A=h-_.top-_.bottom;return he(he({brushBottom:N},_),{},{width:Math.max(O,0),height:Math.max(A,0)})},uae=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},$j=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,u=o===void 0?["axis"]:o,d=t.axisComponents,c=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,m=function(_,N){var O=N.graphicalItems,A=N.stackGroups,C=N.offset,E=N.updateId,T=N.dataStartIndex,R=N.dataEndIndex,L=_.barSize,z=_.layout,F=_.barGap,B=_.barCategoryGap,q=_.maxBarSize,H=uR(z),V=H.numericAxisName,G=H.cateAxisName,U=lae(O),$=[];return O.forEach(function(Q,k){var I=Rm(_.data,{graphicalItems:[Q],dataStartIndex:T,dataEndIndex:R}),D=Q.type.defaultProps!==void 0?he(he({},Q.type.defaultProps),Q.props):Q.props,Z=D.dataKey,ie=D.maxBarSize,oe=D["".concat(V,"Id")],ne=D["".concat(G,"Id")],K={},J=d.reduce(function(Rt,Br){var ya=N["".concat(Br.axisType,"Map")],Di=D["".concat(Br.axisType,"Id")];ya&&ya[Di]||Br.axisType==="zAxis"||yo();var Ka=ya[Di];return he(he({},Rt),{},Ue(Ue({},Br.axisType,Ka),"".concat(Br.axisType,"Ticks"),Ia(Ka)))},K),ee=J[G],ce=J["".concat(G,"Ticks")],pe=A&&A[oe]&&A[oe].hasStack&&BX(Q,A[oe].stackGroups),W=Ma(Q.type).indexOf("Bar")>=0,_e=up(ee,ce),Ce=[],qe=U&&CX({barSize:L,stackGroups:A,totalSize:uae(J,G)});if(W){var De,nt,kt=Qe(ie)?q:ie,Ut=(De=(nt=up(ee,ce,!0))!==null&&nt!==void 0?nt:kt)!==null&&De!==void 0?De:0;Ce=OX({barGap:F,barCategoryGap:B,bandSize:Ut!==_e?Ut:_e,sizeList:qe[ne],maxBarSize:kt}),Ut!==_e&&(Ce=Ce.map(function(Rt){return he(he({},Rt),{},{position:he(he({},Rt.position),{},{offset:Rt.position.offset-Ut/2})})}))}var lr=Q&&Q.type&&Q.type.getComposedData;lr&&$.push({props:he(he({},lr(he(he({},J),{},{displayedData:I,props:_,dataKey:Z,item:Q,bandSize:_e,barPosition:Ce,offset:C,stackedData:pe,layout:z,dataStartIndex:T,dataEndIndex:R}))),{},Ue(Ue(Ue({key:Q.key||"item-".concat(k)},V,J[V]),G,J[G]),"animationId",E)),childIndex:TU(Q,_.children),item:Q})}),$},v=function(_,N){var O=_.props,A=_.dataStartIndex,C=_.dataEndIndex,E=_.updateId;if(!_E({props:O}))return null;var T=O.children,R=O.layout,L=O.stackOffset,z=O.data,F=O.reverseStackOrder,B=uR(R),q=B.numericAxisName,H=B.cateAxisName,V=tn(T,n),G=LX(z,V,"".concat(q,"Id"),"".concat(H,"Id"),L,F),U=d.reduce(function(D,Z){var ie="".concat(Z.axisType,"Map");return he(he({},D),{},Ue({},ie,oae(O,he(he({},Z),{},{graphicalItems:V,stackGroups:Z.axisType===q&&G,dataStartIndex:A,dataEndIndex:C}))))},{}),$=cae(he(he({},U),{},{props:O,graphicalItems:V}),N?.legendBBox);Object.keys(U).forEach(function(D){U[D]=h(O,U[D],$,D.replace("Map",""),r)});var Q=U["".concat(H,"Map")],k=sae(Q),I=m(O,he(he({},U),{},{dataStartIndex:A,dataEndIndex:C,updateId:E,graphicalItems:V,stackGroups:G,offset:$}));return he(he({formattedGraphicalItems:I,graphicalItems:V,offset:$,stackGroups:G},k),U)},x=(function(S){function _(N){var O,A,C;return Une(this,_),C=Wne(this,_,[N]),Ue(C,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ue(C,"accessibilityManager",new Pne),Ue(C,"handleLegendBBoxUpdate",function(E){if(E){var T=C.state,R=T.dataStartIndex,L=T.dataEndIndex,z=T.updateId;C.setState(he({legendBBox:E},v({props:C.props,dataStartIndex:R,dataEndIndex:L,updateId:z},he(he({},C.state),{},{legendBBox:E}))))}}),Ue(C,"handleReceiveSyncEvent",function(E,T,R){if(C.props.syncId===E){if(R===C.eventEmitterSymbol&&typeof C.props.syncMethod!="function")return;C.applySyncEvent(T)}}),Ue(C,"handleBrushChange",function(E){var T=E.startIndex,R=E.endIndex;if(T!==C.state.dataStartIndex||R!==C.state.dataEndIndex){var L=C.state.updateId;C.setState(function(){return he({dataStartIndex:T,dataEndIndex:R},v({props:C.props,dataStartIndex:T,dataEndIndex:R,updateId:L},C.state))}),C.triggerSyncEvent({dataStartIndex:T,dataEndIndex:R})}}),Ue(C,"handleMouseEnter",function(E){var T=C.getMouseInfo(E);if(T){var R=he(he({},T),{},{isTooltipActive:!0});C.setState(R),C.triggerSyncEvent(R);var L=C.props.onMouseEnter;He(L)&&L(R,E)}}),Ue(C,"triggeredAfterMouseMove",function(E){var T=C.getMouseInfo(E),R=T?he(he({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};C.setState(R),C.triggerSyncEvent(R);var L=C.props.onMouseMove;He(L)&&L(R,E)}),Ue(C,"handleItemMouseEnter",function(E){C.setState(function(){return{isTooltipActive:!0,activeItem:E,activePayload:E.tooltipPayload,activeCoordinate:E.tooltipPosition||{x:E.cx,y:E.cy}}})}),Ue(C,"handleItemMouseLeave",function(){C.setState(function(){return{isTooltipActive:!1}})}),Ue(C,"handleMouseMove",function(E){E.persist(),C.throttleTriggeredAfterMouseMove(E)}),Ue(C,"handleMouseLeave",function(E){C.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};C.setState(T),C.triggerSyncEvent(T);var R=C.props.onMouseLeave;He(R)&&R(T,E)}),Ue(C,"handleOuterEvent",function(E){var T=AU(E),R=en(C.props,"".concat(T));if(T&&He(R)){var L,z;/.*touch.*/i.test(T)?z=C.getMouseInfo(E.changedTouches[0]):z=C.getMouseInfo(E),R((L=z)!==null&&L!==void 0?L:{},E)}}),Ue(C,"handleClick",function(E){var T=C.getMouseInfo(E);if(T){var R=he(he({},T),{},{isTooltipActive:!0});C.setState(R),C.triggerSyncEvent(R);var L=C.props.onClick;He(L)&&L(R,E)}}),Ue(C,"handleMouseDown",function(E){var T=C.props.onMouseDown;if(He(T)){var R=C.getMouseInfo(E);T(R,E)}}),Ue(C,"handleMouseUp",function(E){var T=C.props.onMouseUp;if(He(T)){var R=C.getMouseInfo(E);T(R,E)}}),Ue(C,"handleTouchMove",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&C.throttleTriggeredAfterMouseMove(E.changedTouches[0])}),Ue(C,"handleTouchStart",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&C.handleMouseDown(E.changedTouches[0])}),Ue(C,"handleTouchEnd",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&C.handleMouseUp(E.changedTouches[0])}),Ue(C,"handleDoubleClick",function(E){var T=C.props.onDoubleClick;if(He(T)){var R=C.getMouseInfo(E);T(R,E)}}),Ue(C,"handleContextMenu",function(E){var T=C.props.onContextMenu;if(He(T)){var R=C.getMouseInfo(E);T(R,E)}}),Ue(C,"triggerSyncEvent",function(E){C.props.syncId!==void 0&&d1.emit(f1,C.props.syncId,E,C.eventEmitterSymbol)}),Ue(C,"applySyncEvent",function(E){var T=C.props,R=T.layout,L=T.syncMethod,z=C.state.updateId,F=E.dataStartIndex,B=E.dataEndIndex;if(E.dataStartIndex!==void 0||E.dataEndIndex!==void 0)C.setState(he({dataStartIndex:F,dataEndIndex:B},v({props:C.props,dataStartIndex:F,dataEndIndex:B,updateId:z},C.state)));else if(E.activeTooltipIndex!==void 0){var q=E.chartX,H=E.chartY,V=E.activeTooltipIndex,G=C.state,U=G.offset,$=G.tooltipTicks;if(!U)return;if(typeof L=="function")V=L($,E);else if(L==="value"){V=-1;for(var Q=0;Q<$.length;Q++)if($[Q].value===E.activeLabel){V=Q;break}}var k=he(he({},U),{},{x:U.left,y:U.top}),I=Math.min(q,k.x+k.width),D=Math.min(H,k.y+k.height),Z=$[V]&&$[V].value,ie=nS(C.state,C.props.data,V),oe=$[V]?{x:R==="horizontal"?$[V].coordinate:I,y:R==="horizontal"?D:$[V].coordinate}:i4;C.setState(he(he({},E),{},{activeLabel:Z,activeCoordinate:oe,activePayload:ie,activeTooltipIndex:V}))}else C.setState(E)}),Ue(C,"renderCursor",function(E){var T,R=C.state,L=R.isTooltipActive,z=R.activeCoordinate,F=R.activePayload,B=R.offset,q=R.activeTooltipIndex,H=R.tooltipAxisBandSize,V=C.getTooltipEventType(),G=(T=E.props.active)!==null&&T!==void 0?T:L,U=C.props.layout,$=E.key||"_recharts-cursor";return X.createElement(Dne,{key:$,activeCoordinate:z,activePayload:F,activeTooltipIndex:q,chartName:r,element:E,isActive:G,layout:U,offset:B,tooltipAxisBandSize:H,tooltipEventType:V})}),Ue(C,"renderPolarAxis",function(E,T,R){var L=en(E,"type.axisType"),z=en(C.state,"".concat(L,"Map")),F=E.type.defaultProps,B=F!==void 0?he(he({},F),E.props):E.props,q=z&&z[B["".concat(L,"Id")]];return b.cloneElement(E,he(he({},q),{},{className:Ze(L,q.className),key:E.key||"".concat(T,"-").concat(R),ticks:Ia(q,!0)}))}),Ue(C,"renderPolarGrid",function(E){var T=E.props,R=T.radialLines,L=T.polarAngles,z=T.polarRadius,F=C.state,B=F.radiusAxisMap,q=F.angleAxisMap,H=vi(B),V=vi(q),G=V.cx,U=V.cy,$=V.innerRadius,Q=V.outerRadius;return b.cloneElement(E,{polarAngles:Array.isArray(L)?L:Ia(V,!0).map(function(k){return k.coordinate}),polarRadius:Array.isArray(z)?z:Ia(H,!0).map(function(k){return k.coordinate}),cx:G,cy:U,innerRadius:$,outerRadius:Q,key:E.key||"polar-grid",radialLines:R})}),Ue(C,"renderLegend",function(){var E=C.state.formattedGraphicalItems,T=C.props,R=T.children,L=T.width,z=T.height,F=C.props.margin||{},B=L-(F.left||0)-(F.right||0),q=zL({children:R,formattedGraphicalItems:E,legendWidth:B,legendContent:c});if(!q)return null;var H=q.item,V=oR(q,Lne);return b.cloneElement(H,he(he({},V),{},{chartWidth:L,chartHeight:z,margin:F,onBBoxUpdate:C.handleLegendBBoxUpdate}))}),Ue(C,"renderTooltip",function(){var E,T=C.props,R=T.children,L=T.accessibilityLayer,z=Kr(R,Yr);if(!z)return null;var F=C.state,B=F.isTooltipActive,q=F.activeCoordinate,H=F.activePayload,V=F.activeLabel,G=F.offset,U=(E=z.props.active)!==null&&E!==void 0?E:B;return b.cloneElement(z,{viewBox:he(he({},G),{},{x:G.left,y:G.top}),active:U,label:V,payload:U?H:[],coordinate:q,accessibilityLayer:L})}),Ue(C,"renderBrush",function(E){var T=C.props,R=T.margin,L=T.data,z=C.state,F=z.offset,B=z.dataStartIndex,q=z.dataEndIndex,H=z.updateId;return b.cloneElement(E,{key:E.key||"_recharts-brush",onChange:Tf(C.handleBrushChange,E.props.onChange),data:L,x:je(E.props.x)?E.props.x:F.left,y:je(E.props.y)?E.props.y:F.top+F.height+F.brushBottom-(R.bottom||0),width:je(E.props.width)?E.props.width:F.width,startIndex:B,endIndex:q,updateId:"brush-".concat(H)})}),Ue(C,"renderReferenceElement",function(E,T,R){if(!E)return null;var L=C,z=L.clipPathId,F=C.state,B=F.xAxisMap,q=F.yAxisMap,H=F.offset,V=E.type.defaultProps||{},G=E.props,U=G.xAxisId,$=U===void 0?V.xAxisId:U,Q=G.yAxisId,k=Q===void 0?V.yAxisId:Q;return b.cloneElement(E,{key:E.key||"".concat(T,"-").concat(R),xAxis:B[$],yAxis:q[k],viewBox:{x:H.left,y:H.top,width:H.width,height:H.height},clipPathId:z})}),Ue(C,"renderActivePoints",function(E){var T=E.item,R=E.activePoint,L=E.basePoint,z=E.childIndex,F=E.isRange,B=[],q=T.props.key,H=T.item.type.defaultProps!==void 0?he(he({},T.item.type.defaultProps),T.item.props):T.item.props,V=H.activeDot,G=H.dataKey,U=he(he({index:z,dataKey:G,cx:R.x,cy:R.y,r:4,fill:Oj(T.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},Fe(V,!1)),$h(V));return B.push(_.renderActiveDot(V,U,"".concat(q,"-activePoint-").concat(z))),L?B.push(_.renderActiveDot(V,he(he({},U),{},{cx:L.x,cy:L.y}),"".concat(q,"-basePoint-").concat(z))):F&&B.push(null),B}),Ue(C,"renderGraphicChild",function(E,T,R){var L=C.filterFormatItem(E,T,R);if(!L)return null;var z=C.getTooltipEventType(),F=C.state,B=F.isTooltipActive,q=F.tooltipAxis,H=F.activeTooltipIndex,V=F.activeLabel,G=C.props.children,U=Kr(G,Yr),$=L.props,Q=$.points,k=$.isRange,I=$.baseLine,D=L.item.type.defaultProps!==void 0?he(he({},L.item.type.defaultProps),L.item.props):L.item.props,Z=D.activeDot,ie=D.hide,oe=D.activeBar,ne=D.activeShape,K=!!(!ie&&B&&U&&(Z||oe||ne)),J={};z!=="axis"&&U&&U.props.trigger==="click"?J={onClick:Tf(C.handleItemMouseEnter,E.props.onClick)}:z!=="axis"&&(J={onMouseLeave:Tf(C.handleItemMouseLeave,E.props.onMouseLeave),onMouseEnter:Tf(C.handleItemMouseEnter,E.props.onMouseEnter)});var ee=b.cloneElement(E,he(he({},L.props),J));function ce(Br){return typeof q.dataKey=="function"?q.dataKey(Br.payload):null}if(K)if(H>=0){var pe,W;if(q.dataKey&&!q.allowDuplicatedCategory){var _e=typeof q.dataKey=="function"?ce:"payload.".concat(q.dataKey.toString());pe=Lh(Q,_e,V),W=k&&I&&Lh(I,_e,V)}else pe=Q?.[H],W=k&&I&&I[H];if(ne||oe){var Ce=E.props.activeIndex!==void 0?E.props.activeIndex:H;return[b.cloneElement(E,he(he(he({},L.props),J),{},{activeIndex:Ce})),null,null]}if(!Qe(pe))return[ee].concat(cl(C.renderActivePoints({item:L,activePoint:pe,basePoint:W,childIndex:H,isRange:k})))}else{var qe,De=(qe=C.getItemByXY(C.state.activeCoordinate))!==null&&qe!==void 0?qe:{graphicalItem:ee},nt=De.graphicalItem,kt=nt.item,Ut=kt===void 0?E:kt,lr=nt.childIndex,Rt=he(he(he({},L.props),J),{},{activeIndex:lr});return[b.cloneElement(Ut,Rt),null,null]}return k?[ee,null,null]:[ee,null]}),Ue(C,"renderCustomized",function(E,T,R){return b.cloneElement(E,he(he({key:"recharts-customized-".concat(R)},C.props),C.state))}),Ue(C,"renderMap",{CartesianGrid:{handler:Df,once:!0},ReferenceArea:{handler:C.renderReferenceElement},ReferenceLine:{handler:Df},ReferenceDot:{handler:C.renderReferenceElement},XAxis:{handler:Df},YAxis:{handler:Df},Brush:{handler:C.renderBrush,once:!0},Bar:{handler:C.renderGraphicChild},Line:{handler:C.renderGraphicChild},Area:{handler:C.renderGraphicChild},Radar:{handler:C.renderGraphicChild},RadialBar:{handler:C.renderGraphicChild},Scatter:{handler:C.renderGraphicChild},Pie:{handler:C.renderGraphicChild},Funnel:{handler:C.renderGraphicChild},Tooltip:{handler:C.renderCursor,once:!0},PolarGrid:{handler:C.renderPolarGrid,once:!0},PolarAngleAxis:{handler:C.renderPolarAxis},PolarRadiusAxis:{handler:C.renderPolarAxis},Customized:{handler:C.renderCustomized}}),C.clipPathId="".concat((O=N.id)!==null&&O!==void 0?O:yl("recharts"),"-clip"),C.throttleTriggeredAfterMouseMove=zD(C.triggeredAfterMouseMove,(A=N.throttleDelay)!==null&&A!==void 0?A:1e3/60),C.state={},C}return Xne(_,S),Hne(_,[{key:"componentDidMount",value:function(){var O,A;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(O=this.props.margin.left)!==null&&O!==void 0?O:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var O=this.props,A=O.children,C=O.data,E=O.height,T=O.layout,R=Kr(A,Yr);if(R){var L=R.props.defaultIndex;if(!(typeof L!="number"||L<0||L>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[L]&&this.state.tooltipTicks[L].value,F=nS(this.state,C,L,z),B=this.state.tooltipTicks[L].coordinate,q=(this.state.offset.top+E)/2,H=T==="horizontal",V=H?{x:B,y:q}:{y:B,x:q},G=this.state.formattedGraphicalItems.find(function($){var Q=$.item;return Q.type.name==="Scatter"});G&&(V=he(he({},V),G.props.points[L].tooltipPosition),F=G.props.points[L].tooltipPayload);var U={activeTooltipIndex:L,isTooltipActive:!0,activeLabel:z,activePayload:F,activeCoordinate:V};this.setState(U),this.renderCursor(R),this.accessibilityManager.setIndex(L)}}}},{key:"getSnapshotBeforeUpdate",value:function(O,A){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==A.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==O.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==O.margin){var C,E;this.accessibilityManager.setDetails({offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0}})}return null}},{key:"componentDidUpdate",value:function(O){B1([Kr(O.children,Yr)],[Kr(this.props.children,Yr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var O=Kr(this.props.children,Yr);if(O&&typeof O.props.shared=="boolean"){var A=O.props.shared?"axis":"item";return u.indexOf(A)>=0?A:i}return i}},{key:"getMouseInfo",value:function(O){if(!this.container)return null;var A=this.container,C=A.getBoundingClientRect(),E=vH(C),T={chartX:Math.round(O.pageX-E.left),chartY:Math.round(O.pageY-E.top)},R=C.width/A.offsetWidth||1,L=this.inRange(T.chartX,T.chartY,R);if(!L)return null;var z=this.state,F=z.xAxisMap,B=z.yAxisMap,q=this.getTooltipEventType(),H=lR(this.state,this.props.data,this.props.layout,L);if(q!=="axis"&&F&&B){var V=vi(F).scale,G=vi(B).scale,U=V&&V.invert?V.invert(T.chartX):null,$=G&&G.invert?G.invert(T.chartY):null;return he(he({},T),{},{xValue:U,yValue:$},H)}return H?he(he({},T),H):null}},{key:"inRange",value:function(O,A){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,E=this.props.layout,T=O/C,R=A/C;if(E==="horizontal"||E==="vertical"){var L=this.state.offset,z=T>=L.left&&T<=L.left+L.width&&R>=L.top&&R<=L.top+L.height;return z?{x:T,y:R}:null}var F=this.state,B=F.angleAxisMap,q=F.radiusAxisMap;if(B&&q){var H=vi(B);return hT({x:T,y:R},H)}return null}},{key:"parseEventsOfWrapper",value:function(){var O=this.props.children,A=this.getTooltipEventType(),C=Kr(O,Yr),E={};C&&A==="axis"&&(C.props.trigger==="click"?E={onClick:this.handleClick}:E={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=$h(this.props,this.handleOuterEvent);return he(he({},T),E)}},{key:"addListener",value:function(){d1.on(f1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){d1.removeListener(f1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(O,A,C){for(var E=this.state.formattedGraphicalItems,T=0,R=E.length;Tl.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg border border-gray-100 hover:bg-gray-100 transition-colors",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 font-bold text-xs",children:e.template.substring(0,2)}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-semibold text-gray-900",children:e.product}),l.jsxs("p",{className:"text-xs text-gray-500",children:[e.id," • ",e.user]})]})]}),l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("span",{className:"text-xs text-gray-500 font-medium",children:e.time}),l.jsx(xr,{variant:"secondary",className:e.status==="expired"?"bg-red-100 text-red-700":"bg-green-100 text-green-700",children:e.status})]})]},e.id))})})]})]}),l.jsx("div",{className:"space-y-6",children:l.jsxs(Xr,{className:"shadow-sm border-gray-200",children:[l.jsx(Ln,{children:l.jsxs($n,{className:"text-base font-bold text-gray-800 flex items-center gap-2",children:[l.jsx(Vc,{className:"w-5 h-5 text-gray-500"}),"By Category"]})}),l.jsxs(vn,{children:[l.jsxs("div",{className:"h-[200px] relative",children:[l.jsx(Kh,{width:"100%",height:"100%",children:l.jsxs(fae,{children:[l.jsx(Ga,{data:p1,cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"value",children:p1.map((e,t)=>l.jsx(cm,{fill:e.color},`cell-${t}`))}),l.jsx(Yr,{})]})}),l.jsxs("div",{className:"absolute inset-0 flex items-center justify-center flex-col pointer-events-none",children:[l.jsx("span",{className:"text-2xl font-bold text-gray-900",children:"1000"}),l.jsx("span",{className:"text-xs text-gray-500",children:"Total"})]})]}),l.jsx("div",{className:"mt-4 space-y-2",children:p1.map(e=>l.jsxs("div",{className:"flex items-center justify-between text-sm",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),l.jsx("span",{className:"text-gray-600",children:e.name})]}),l.jsx("span",{className:"font-medium text-gray-900",children:e.value})]},e.name))})]})]})})]})]})}function fs({title:e,value:t,trend:r,trendUp:n,icon:a,color:i,bgColor:o}){return l.jsx(Xr,{className:"border-gray-200 shadow-sm hover:shadow-md transition-shadow",children:l.jsxs(vn,{className:"p-6",children:[l.jsxs("div",{className:"flex justify-between items-start",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-medium text-gray-500 mb-1",children:e}),l.jsx("h3",{className:"text-2xl font-bold text-gray-900",children:t})]}),l.jsx("div",{className:`p-2 rounded-lg ${o}`,children:l.jsx(a,{className:`w-5 h-5 ${i}`})})]}),l.jsxs("div",{className:"mt-4 flex items-center text-sm",children:[n?l.jsx(YI,{className:"w-4 h-4 text-green-500 mr-1"}):l.jsx(vz,{className:"w-4 h-4 text-red-500 mr-1"}),l.jsx("span",{className:n?"text-green-600 font-medium":"text-red-600 font-medium",children:r}),l.jsx("span",{className:"text-gray-400 ml-1",children:"Vs. last period"})]})]})})}function gae({title:e}){return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[1,2,3,4].map(t=>l.jsxs(Xr,{children:[l.jsx(Ln,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:l.jsxs($n,{className:"text-sm font-medium",children:["Metric ",t]})}),l.jsxs(vn,{children:[l.jsx("div",{className:"text-2xl font-bold",children:"000"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"+0.0% from last month"})]})]},t))}),l.jsx(Xr,{className:"min-h-[400px] flex items-center justify-center border-dashed",children:l.jsxs("div",{className:"text-center text-muted-foreground",children:[l.jsxs("h3",{className:"text-lg font-medium",children:[e," Module"]}),l.jsx("p",{children:"This module is currently under development."})]})})]})}function Or({className:e,...t}){return l.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:l.jsx("table",{"data-slot":"table",className:Ae("w-full caption-bottom text-sm",e),...t})})}function Er({className:e,...t}){return l.jsx("thead",{"data-slot":"table-header",className:Ae("[&_tr]:border-b",e),...t})}function Pr({className:e,...t}){return l.jsx("tbody",{"data-slot":"table-body",className:Ae("[&_tr:last-child]:border-0",e),...t})}function Be({className:e,...t}){return l.jsx("tr",{"data-slot":"table-row",className:Ae("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function ve({className:e,...t}){return l.jsx("th",{"data-slot":"table-head",className:Ae("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function de({className:e,...t}){return l.jsx("td",{"data-slot":"table-cell",className:Ae("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function dR(e){const t=vae(e),r=b.forwardRef((n,a)=>{const{children:i,...o}=n,u=b.Children.toArray(i),d=u.find(xae);if(d){const c=d.props.children,h=u.map(p=>p===d?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:p);return l.jsx(t,{...o,ref:a,children:b.isValidElement(c)?b.cloneElement(c,void 0,h):null})}return l.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function vae(e){const t=b.forwardRef((r,n)=>{const{children:a,...i}=r;if(b.isValidElement(a)){const o=wae(a),u=bae(i,a.props);return a.type!==b.Fragment&&(u.ref=n?Sn(n,o):o),b.cloneElement(a,u)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yae=Symbol("radix.slottable");function xae(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===yae}function bae(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function wae(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Sae(e){const t=e+"CollectionProvider",[r,n]=Ua(t),[a,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=y=>{const{scope:S,children:_}=y,N=X.useRef(null),O=X.useRef(new Map).current;return l.jsx(a,{scope:S,itemMap:O,collectionRef:N,children:_})};o.displayName=t;const u=e+"CollectionSlot",d=dR(u),c=X.forwardRef((y,S)=>{const{scope:_,children:N}=y,O=i(u,_),A=at(S,O.collectionRef);return l.jsx(d,{ref:A,children:N})});c.displayName=u;const h=e+"CollectionItemSlot",p="data-radix-collection-item",m=dR(h),v=X.forwardRef((y,S)=>{const{scope:_,children:N,...O}=y,A=X.useRef(null),C=at(S,A),E=i(h,_);return X.useEffect(()=>(E.itemMap.set(A,{ref:A,...O}),()=>void E.itemMap.delete(A))),l.jsx(m,{[p]:"",ref:C,children:N})});v.displayName=h;function x(y){const S=i(e+"CollectionConsumer",y);return X.useCallback(()=>{const N=S.collectionRef.current;if(!N)return[];const O=Array.from(N.querySelectorAll(`[${p}]`));return Array.from(S.itemMap.values()).sort((E,T)=>O.indexOf(E.ref.current)-O.indexOf(T.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:o,Slot:c,ItemSlot:v},x,n]}function jae(e,t=globalThis?.document){const r=jr(e);b.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var _ae="DismissableLayer",aS="dismissableLayer.update",Nae="dismissableLayer.pointerDownOutside",Cae="dismissableLayer.focusOutside",fR,l4=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),qu=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:u,...d}=e,c=b.useContext(l4),[h,p]=b.useState(null),m=h?.ownerDocument??globalThis?.document,[,v]=b.useState({}),x=at(t,T=>p(T)),y=Array.from(c.layers),[S]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),_=y.indexOf(S),N=h?y.indexOf(h):-1,O=c.layersWithOutsidePointerEventsDisabled.size>0,A=N>=_,C=Pae(T=>{const R=T.target,L=[...c.branches].some(z=>z.contains(R));!A||L||(a?.(T),o?.(T),T.defaultPrevented||u?.())},m),E=Aae(T=>{const R=T.target;[...c.branches].some(z=>z.contains(R))||(i?.(T),o?.(T),T.defaultPrevented||u?.())},m);return jae(T=>{N===c.layers.size-1&&(n?.(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},m),b.useEffect(()=>{if(h)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(fR=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),hR(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=fR)}},[h,m,r,c]),b.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),hR())},[h,c]),b.useEffect(()=>{const T=()=>v({});return document.addEventListener(aS,T),()=>document.removeEventListener(aS,T)},[]),l.jsx(We.div,{...d,ref:x,style:{pointerEvents:O?A?"auto":"none":void 0,...e.style},onFocusCapture:Ge(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Ge(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ge(e.onPointerDownCapture,C.onPointerDownCapture)})});qu.displayName=_ae;var Oae="DismissableLayerBranch",Eae=b.forwardRef((e,t)=>{const r=b.useContext(l4),n=b.useRef(null),a=at(t,n);return b.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),l.jsx(We.div,{...e,ref:a})});Eae.displayName=Oae;function Pae(e,t=globalThis?.document){const r=jr(e),n=b.useRef(!1),a=b.useRef(()=>{});return b.useEffect(()=>{const i=u=>{if(u.target&&!n.current){let d=function(){c4(Nae,r,c,{discrete:!0})};const c={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Aae(e,t=globalThis?.document){const r=jr(e),n=b.useRef(!1);return b.useEffect(()=>{const a=i=>{i.target&&!n.current&&c4(Cae,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function hR(){const e=new CustomEvent(aS);document.dispatchEvent(e)}function c4(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?R6(a,i):a.dispatchEvent(i)}var m1=0;function Bj(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pR()),document.body.insertAdjacentElement("beforeend",e[1]??pR()),m1++,()=>{m1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),m1--}},[])}function pR(){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}var g1="focusScope.autoFocusOnMount",v1="focusScope.autoFocusOnUnmount",mR={bubbles:!1,cancelable:!0},Tae="FocusScope",Im=b.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[u,d]=b.useState(null),c=jr(a),h=jr(i),p=b.useRef(null),m=at(t,y=>d(y)),v=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(n){let y=function(O){if(v.paused||!u)return;const A=O.target;u.contains(A)?p.current=A:mi(p.current,{select:!0})},S=function(O){if(v.paused||!u)return;const A=O.relatedTarget;A!==null&&(u.contains(A)||mi(p.current,{select:!0}))},_=function(O){if(document.activeElement===document.body)for(const C of O)C.removedNodes.length>0&&mi(u)};document.addEventListener("focusin",y),document.addEventListener("focusout",S);const N=new MutationObserver(_);return u&&N.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",S),N.disconnect()}}},[n,u,v.paused]),b.useEffect(()=>{if(u){vR.add(v);const y=document.activeElement;if(!u.contains(y)){const _=new CustomEvent(g1,mR);u.addEventListener(g1,c),u.dispatchEvent(_),_.defaultPrevented||(kae(Lae(u4(u)),{select:!0}),document.activeElement===y&&mi(u))}return()=>{u.removeEventListener(g1,c),setTimeout(()=>{const _=new CustomEvent(v1,mR);u.addEventListener(v1,h),u.dispatchEvent(_),_.defaultPrevented||mi(y??document.body,{select:!0}),u.removeEventListener(v1,h),vR.remove(v)},0)}}},[u,c,h,v]);const x=b.useCallback(y=>{if(!r&&!n||v.paused)return;const S=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,_=document.activeElement;if(S&&_){const N=y.currentTarget,[O,A]=Rae(N);O&&A?!y.shiftKey&&_===A?(y.preventDefault(),r&&mi(O,{select:!0})):y.shiftKey&&_===O&&(y.preventDefault(),r&&mi(A,{select:!0})):_===N&&y.preventDefault()}},[r,n,v.paused]);return l.jsx(We.div,{tabIndex:-1,...o,ref:m,onKeyDown:x})});Im.displayName=Tae;function kae(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(mi(n,{select:t}),document.activeElement!==r)return}function Rae(e){const t=u4(e),r=gR(t,e),n=gR(t.reverse(),e);return[r,n]}function u4(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function gR(e,t){for(const r of e)if(!Iae(r,{upTo:t}))return r}function Iae(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 Mae(e){return e instanceof HTMLInputElement&&"select"in e}function mi(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Mae(e)&&t&&e.select()}}var vR=Dae();function Dae(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=yR(e,t),e.unshift(t)},remove(t){e=yR(e,t),e[0]?.resume()}}}function yR(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Lae(e){return e.filter(t=>t.tagName!=="A")}var $ae=NS[" useId ".trim().toString()]||(()=>{}),Bae=0;function Lr(e){const[t,r]=b.useState($ae());return Gt(()=>{r(n=>n??String(Bae++))},[e]),e||(t?`radix-${t}`:"")}const Fae=["top","right","bottom","left"],wi=Math.min,Qr=Math.max,Bp=Math.round,Lf=Math.floor,oa=e=>({x:e,y:e}),zae={left:"right",right:"left",bottom:"top",top:"bottom"},qae={start:"end",end:"start"};function iS(e,t,r){return Qr(e,wi(t,r))}function za(e,t){return typeof e=="function"?e(t):e}function qa(e){return e.split("-")[0]}function Nl(e){return e.split("-")[1]}function Fj(e){return e==="x"?"y":"x"}function zj(e){return e==="y"?"height":"width"}const Uae=new Set(["top","bottom"]);function ra(e){return Uae.has(qa(e))?"y":"x"}function qj(e){return Fj(ra(e))}function Vae(e,t,r){r===void 0&&(r=!1);const n=Nl(e),a=qj(e),i=zj(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Fp(o)),[o,Fp(o)]}function Hae(e){const t=Fp(e);return[oS(e),t,oS(t)]}function oS(e){return e.replace(/start|end/g,t=>qae[t])}const xR=["left","right"],bR=["right","left"],Wae=["top","bottom"],Gae=["bottom","top"];function Kae(e,t,r){switch(e){case"top":case"bottom":return r?t?bR:xR:t?xR:bR;case"left":case"right":return t?Wae:Gae;default:return[]}}function Xae(e,t,r,n){const a=Nl(e);let i=Kae(qa(e),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(oS)))),i}function Fp(e){return e.replace(/left|right|bottom|top/g,t=>zae[t])}function Yae(e){return{top:0,right:0,bottom:0,left:0,...e}}function d4(e){return typeof e!="number"?Yae(e):{top:e,right:e,bottom:e,left:e}}function zp(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function wR(e,t,r){let{reference:n,floating:a}=e;const i=ra(t),o=qj(t),u=zj(o),d=qa(t),c=i==="y",h=n.x+n.width/2-a.width/2,p=n.y+n.height/2-a.height/2,m=n[u]/2-a[u]/2;let v;switch(d){case"top":v={x:h,y:n.y-a.height};break;case"bottom":v={x:h,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:p};break;case"left":v={x:n.x-a.width,y:p};break;default:v={x:n.x,y:n.y}}switch(Nl(t)){case"start":v[o]-=m*(r&&c?-1:1);break;case"end":v[o]+=m*(r&&c?-1:1);break}return v}async function Jae(e,t){var r;t===void 0&&(t={});const{x:n,y:a,platform:i,rects:o,elements:u,strategy:d}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:v=0}=za(t,e),x=d4(v),S=u[m?p==="floating"?"reference":"floating":p],_=zp(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(S)))==null||r?S:S.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:c,rootBoundary:h,strategy:d})),N=p==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,O=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),A=await(i.isElement==null?void 0:i.isElement(O))?await(i.getScale==null?void 0:i.getScale(O))||{x:1,y:1}:{x:1,y:1},C=zp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:N,offsetParent:O,strategy:d}):N);return{top:(_.top-C.top+x.top)/A.y,bottom:(C.bottom-_.bottom+x.bottom)/A.y,left:(_.left-C.left+x.left)/A.x,right:(C.right-_.right+x.right)/A.x}}const Qae=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,u=i.filter(Boolean),d=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=wR(c,n,d),m=n,v={},x=0;for(let S=0;S({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:i,platform:o,elements:u,middlewareData:d}=t,{element:c,padding:h=0}=za(e,t)||{};if(c==null)return{};const p=d4(h),m={x:r,y:n},v=qj(a),x=zj(v),y=await o.getDimensions(c),S=v==="y",_=S?"top":"left",N=S?"bottom":"right",O=S?"clientHeight":"clientWidth",A=i.reference[x]+i.reference[v]-m[v]-i.floating[x],C=m[v]-i.reference[v],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let T=E?E[O]:0;(!T||!await(o.isElement==null?void 0:o.isElement(E)))&&(T=u.floating[O]||i.floating[x]);const R=A/2-C/2,L=T/2-y[x]/2-1,z=wi(p[_],L),F=wi(p[N],L),B=z,q=T-y[x]-F,H=T/2-y[x]/2+R,V=iS(B,H,q),G=!d.arrow&&Nl(a)!=null&&H!==V&&i.reference[x]/2-(HH<=0)){var F,B;const H=(((F=i.flip)==null?void 0:F.index)||0)+1,V=T[H];if(V&&(!(p==="alignment"?N!==ra(V):!1)||z.every($=>ra($.placement)===N?$.overflows[0]>0:!0)))return{data:{index:H,overflows:z},reset:{placement:V}};let G=(B=z.filter(U=>U.overflows[0]<=0).sort((U,$)=>U.overflows[1]-$.overflows[1])[0])==null?void 0:B.placement;if(!G)switch(v){case"bestFit":{var q;const U=(q=z.filter($=>{if(E){const Q=ra($.placement);return Q===N||Q==="y"}return!0}).map($=>[$.placement,$.overflows.filter(Q=>Q>0).reduce((Q,k)=>Q+k,0)]).sort(($,Q)=>$[1]-Q[1])[0])==null?void 0:q[0];U&&(G=U);break}case"initialPlacement":G=u;break}if(a!==G)return{reset:{placement:G}}}return{}}}};function SR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jR(e){return Fae.some(t=>e[t]>=0)}const tie=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...i}=za(e,t);switch(a){case"referenceHidden":{const o=await n.detectOverflow(t,{...i,elementContext:"reference"}),u=SR(o,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:jR(u)}}}case"escaped":{const o=await n.detectOverflow(t,{...i,altBoundary:!0}),u=SR(o,r.floating);return{data:{escapedOffsets:u,escaped:jR(u)}}}default:return{}}}}},f4=new Set(["left","top"]);async function rie(e,t){const{placement:r,platform:n,elements:a}=e,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=qa(r),u=Nl(r),d=ra(r)==="y",c=f4.has(o)?-1:1,h=i&&d?-1:1,p=za(t,e);let{mainAxis:m,crossAxis:v,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof x=="number"&&(v=u==="end"?x*-1:x),d?{x:v*h,y:m*c}:{x:m*c,y:v*h}}const nie=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:i,placement:o,middlewareData:u}=t,d=await rie(t,e);return o===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:a+d.x,y:i+d.y,data:{...d,placement:o}}}}},aie=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a,platform:i}=t,{mainAxis:o=!0,crossAxis:u=!1,limiter:d={fn:_=>{let{x:N,y:O}=_;return{x:N,y:O}}},...c}=za(e,t),h={x:r,y:n},p=await i.detectOverflow(t,c),m=ra(qa(a)),v=Fj(m);let x=h[v],y=h[m];if(o){const _=v==="y"?"top":"left",N=v==="y"?"bottom":"right",O=x+p[_],A=x-p[N];x=iS(O,x,A)}if(u){const _=m==="y"?"top":"left",N=m==="y"?"bottom":"right",O=y+p[_],A=y-p[N];y=iS(O,y,A)}const S=d.fn({...t,[v]:x,[m]:y});return{...S,data:{x:S.x-r,y:S.y-n,enabled:{[v]:o,[m]:u}}}}}},iie=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=t,{offset:u=0,mainAxis:d=!0,crossAxis:c=!0}=za(e,t),h={x:r,y:n},p=ra(a),m=Fj(p);let v=h[m],x=h[p];const y=za(u,t),S=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(d){const O=m==="y"?"height":"width",A=i.reference[m]-i.floating[O]+S.mainAxis,C=i.reference[m]+i.reference[O]-S.mainAxis;vC&&(v=C)}if(c){var _,N;const O=m==="y"?"width":"height",A=f4.has(qa(a)),C=i.reference[p]-i.floating[O]+(A&&((_=o.offset)==null?void 0:_[p])||0)+(A?0:S.crossAxis),E=i.reference[p]+i.reference[O]+(A?0:((N=o.offset)==null?void 0:N[p])||0)-(A?S.crossAxis:0);xE&&(x=E)}return{[m]:v,[p]:x}}}},oie=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:i,platform:o,elements:u}=t,{apply:d=()=>{},...c}=za(e,t),h=await o.detectOverflow(t,c),p=qa(a),m=Nl(a),v=ra(a)==="y",{width:x,height:y}=i.floating;let S,_;p==="top"||p==="bottom"?(S=p,_=m===(await(o.isRTL==null?void 0:o.isRTL(u.floating))?"start":"end")?"left":"right"):(_=p,S=m==="end"?"top":"bottom");const N=y-h.top-h.bottom,O=x-h.left-h.right,A=wi(y-h[S],N),C=wi(x-h[_],O),E=!t.middlewareData.shift;let T=A,R=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(R=O),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=N),E&&!m){const z=Qr(h.left,0),F=Qr(h.right,0),B=Qr(h.top,0),q=Qr(h.bottom,0);v?R=x-2*(z!==0||F!==0?z+F:Qr(h.left,h.right)):T=y-2*(B!==0||q!==0?B+q:Qr(h.top,h.bottom))}await d({...t,availableWidth:R,availableHeight:T});const L=await o.getDimensions(u.floating);return x!==L.width||y!==L.height?{reset:{rects:!0}}:{}}}};function Mm(){return typeof window<"u"}function Cl(e){return h4(e)?(e.nodeName||"").toLowerCase():"#document"}function rn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function pa(e){var t;return(t=(h4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function h4(e){return Mm()?e instanceof Node||e instanceof rn(e).Node:!1}function Hn(e){return Mm()?e instanceof Element||e instanceof rn(e).Element:!1}function ca(e){return Mm()?e instanceof HTMLElement||e instanceof rn(e).HTMLElement:!1}function _R(e){return!Mm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof rn(e).ShadowRoot}const sie=new Set(["inline","contents"]);function Uu(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Wn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!sie.has(a)}const lie=new Set(["table","td","th"]);function cie(e){return lie.has(Cl(e))}const uie=[":popover-open",":modal"];function Dm(e){return uie.some(t=>{try{return e.matches(t)}catch{return!1}})}const die=["transform","translate","scale","rotate","perspective"],fie=["transform","translate","scale","rotate","perspective","filter"],hie=["paint","layout","strict","content"];function Uj(e){const t=Vj(),r=Hn(e)?Wn(e):e;return die.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||fie.some(n=>(r.willChange||"").includes(n))||hie.some(n=>(r.contain||"").includes(n))}function pie(e){let t=Si(e);for(;ca(t)&&!ul(t);){if(Uj(t))return t;if(Dm(t))return null;t=Si(t)}return null}function Vj(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const mie=new Set(["html","body","#document"]);function ul(e){return mie.has(Cl(e))}function Wn(e){return rn(e).getComputedStyle(e)}function Lm(e){return Hn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Si(e){if(Cl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_R(e)&&e.host||pa(e);return _R(t)?t.host:t}function p4(e){const t=Si(e);return ul(t)?e.ownerDocument?e.ownerDocument.body:e.body:ca(t)&&Uu(t)?t:p4(t)}function Ou(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=p4(e),i=a===((n=e.ownerDocument)==null?void 0:n.body),o=rn(a);if(i){const u=sS(o);return t.concat(o,o.visualViewport||[],Uu(a)?a:[],u&&r?Ou(u):[])}return t.concat(a,Ou(a,[],r))}function sS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function m4(e){const t=Wn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=ca(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,u=Bp(r)!==i||Bp(n)!==o;return u&&(r=i,n=o),{width:r,height:n,$:u}}function Hj(e){return Hn(e)?e:e.contextElement}function ks(e){const t=Hj(e);if(!ca(t))return oa(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:i}=m4(t);let o=(i?Bp(r.width):r.width)/n,u=(i?Bp(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!u||!Number.isFinite(u))&&(u=1),{x:o,y:u}}const gie=oa(0);function g4(e){const t=rn(e);return!Vj()||!t.visualViewport?gie:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vie(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==rn(e)?!1:t}function So(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),i=Hj(e);let o=oa(1);t&&(n?Hn(n)&&(o=ks(n)):o=ks(e));const u=vie(i,r,n)?g4(i):oa(0);let d=(a.left+u.x)/o.x,c=(a.top+u.y)/o.y,h=a.width/o.x,p=a.height/o.y;if(i){const m=rn(i),v=n&&Hn(n)?rn(n):n;let x=m,y=sS(x);for(;y&&n&&v!==x;){const S=ks(y),_=y.getBoundingClientRect(),N=Wn(y),O=_.left+(y.clientLeft+parseFloat(N.paddingLeft))*S.x,A=_.top+(y.clientTop+parseFloat(N.paddingTop))*S.y;d*=S.x,c*=S.y,h*=S.x,p*=S.y,d+=O,c+=A,x=rn(y),y=sS(x)}}return zp({width:h,height:p,x:d,y:c})}function $m(e,t){const r=Lm(e).scrollLeft;return t?t.left+r:So(pa(e)).left+r}function v4(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-$m(e,r),a=r.top+t.scrollTop;return{x:n,y:a}}function yie(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const i=a==="fixed",o=pa(n),u=t?Dm(t.floating):!1;if(n===o||u&&i)return r;let d={scrollLeft:0,scrollTop:0},c=oa(1);const h=oa(0),p=ca(n);if((p||!p&&!i)&&((Cl(n)!=="body"||Uu(o))&&(d=Lm(n)),ca(n))){const v=So(n);c=ks(n),h.x=v.x+n.clientLeft,h.y=v.y+n.clientTop}const m=o&&!p&&!i?v4(o,d):oa(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-d.scrollLeft*c.x+h.x+m.x,y:r.y*c.y-d.scrollTop*c.y+h.y+m.y}}function xie(e){return Array.from(e.getClientRects())}function bie(e){const t=pa(e),r=Lm(e),n=e.ownerDocument.body,a=Qr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Qr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+$m(e);const u=-r.scrollTop;return Wn(n).direction==="rtl"&&(o+=Qr(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:u}}const NR=25;function wie(e,t){const r=rn(e),n=pa(e),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,u=0,d=0;if(a){i=a.width,o=a.height;const h=Vj();(!h||h&&t==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}const c=$m(n);if(c<=0){const h=n.ownerDocument,p=h.body,m=getComputedStyle(p),v=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(n.clientWidth-p.clientWidth-v);x<=NR&&(i-=x)}else c<=NR&&(i+=c);return{width:i,height:o,x:u,y:d}}const Sie=new Set(["absolute","fixed"]);function jie(e,t){const r=So(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=ca(e)?ks(e):oa(1),o=e.clientWidth*i.x,u=e.clientHeight*i.y,d=a*i.x,c=n*i.y;return{width:o,height:u,x:d,y:c}}function CR(e,t,r){let n;if(t==="viewport")n=wie(e,r);else if(t==="document")n=bie(pa(e));else if(Hn(t))n=jie(t,r);else{const a=g4(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return zp(n)}function y4(e,t){const r=Si(e);return r===t||!Hn(r)||ul(r)?!1:Wn(r).position==="fixed"||y4(r,t)}function _ie(e,t){const r=t.get(e);if(r)return r;let n=Ou(e,[],!1).filter(u=>Hn(u)&&Cl(u)!=="body"),a=null;const i=Wn(e).position==="fixed";let o=i?Si(e):e;for(;Hn(o)&&!ul(o);){const u=Wn(o),d=Uj(o);!d&&u.position==="fixed"&&(a=null),(i?!d&&!a:!d&&u.position==="static"&&!!a&&Sie.has(a.position)||Uu(o)&&!d&&y4(e,o))?n=n.filter(h=>h!==o):a=u,o=Si(o)}return t.set(e,n),n}function Nie(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[...r==="clippingAncestors"?Dm(t)?[]:_ie(t,this._c):[].concat(r),n],u=o[0],d=o.reduce((c,h)=>{const p=CR(t,h,a);return c.top=Qr(p.top,c.top),c.right=wi(p.right,c.right),c.bottom=wi(p.bottom,c.bottom),c.left=Qr(p.left,c.left),c},CR(t,u,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Cie(e){const{width:t,height:r}=m4(e);return{width:t,height:r}}function Oie(e,t,r){const n=ca(t),a=pa(t),i=r==="fixed",o=So(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const d=oa(0);function c(){d.x=$m(a)}if(n||!n&&!i)if((Cl(t)!=="body"||Uu(a))&&(u=Lm(t)),n){const v=So(t,!0,i,t);d.x=v.x+t.clientLeft,d.y=v.y+t.clientTop}else a&&c();i&&!n&&a&&c();const h=a&&!n&&!i?v4(a,u):oa(0),p=o.left+u.scrollLeft-d.x-h.x,m=o.top+u.scrollTop-d.y-h.y;return{x:p,y:m,width:o.width,height:o.height}}function y1(e){return Wn(e).position==="static"}function OR(e,t){if(!ca(e)||Wn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return pa(e)===r&&(r=r.ownerDocument.body),r}function x4(e,t){const r=rn(e);if(Dm(e))return r;if(!ca(e)){let a=Si(e);for(;a&&!ul(a);){if(Hn(a)&&!y1(a))return a;a=Si(a)}return r}let n=OR(e,t);for(;n&&cie(n)&&y1(n);)n=OR(n,t);return n&&ul(n)&&y1(n)&&!Uj(n)?r:n||pie(e)||r}const Eie=async function(e){const t=this.getOffsetParent||x4,r=this.getDimensions,n=await r(e.floating);return{reference:Oie(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Pie(e){return Wn(e).direction==="rtl"}const Aie={convertOffsetParentRelativeRectToViewportRelativeRect:yie,getDocumentElement:pa,getClippingRect:Nie,getOffsetParent:x4,getElementRects:Eie,getClientRects:xie,getDimensions:Cie,getScale:ks,isElement:Hn,isRTL:Pie};function b4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tie(e,t){let r=null,n;const a=pa(e);function i(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function o(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const c=e.getBoundingClientRect(),{left:h,top:p,width:m,height:v}=c;if(u||t(),!m||!v)return;const x=Lf(p),y=Lf(a.clientWidth-(h+m)),S=Lf(a.clientHeight-(p+v)),_=Lf(h),O={rootMargin:-x+"px "+-y+"px "+-S+"px "+-_+"px",threshold:Qr(0,wi(1,d))||1};let A=!0;function C(E){const T=E[0].intersectionRatio;if(T!==d){if(!A)return o();T?o(!1,T):n=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!b4(c,e.getBoundingClientRect())&&o(),A=!1}try{r=new IntersectionObserver(C,{...O,root:a.ownerDocument})}catch{r=new IntersectionObserver(C,O)}r.observe(e)}return o(!0),i}function kie(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=n,c=Hj(e),h=a||i?[...c?Ou(c):[],...Ou(t)]:[];h.forEach(_=>{a&&_.addEventListener("scroll",r,{passive:!0}),i&&_.addEventListener("resize",r)});const p=c&&u?Tie(c,r):null;let m=-1,v=null;o&&(v=new ResizeObserver(_=>{let[N]=_;N&&N.target===c&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var O;(O=v)==null||O.observe(t)})),r()}),c&&!d&&v.observe(c),v.observe(t));let x,y=d?So(e):null;d&&S();function S(){const _=So(e);y&&!b4(y,_)&&r(),y=_,x=requestAnimationFrame(S)}return r(),()=>{var _;h.forEach(N=>{a&&N.removeEventListener("scroll",r),i&&N.removeEventListener("resize",r)}),p?.(),(_=v)==null||_.disconnect(),v=null,d&&cancelAnimationFrame(x)}}const Rie=nie,Iie=aie,Mie=eie,Die=oie,Lie=tie,ER=Zae,$ie=iie,Bie=(e,t,r)=>{const n=new Map,a={platform:Aie,...r},i={...a.platform,_c:n};return Qae(e,t,{...a,platform:i})};var Fie=typeof document<"u",zie=function(){},Ch=Fie?b.useLayoutEffect:zie;function qp(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 r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!qp(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&e.$$typeof)&&!qp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function w4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function PR(e,t){const r=w4(e);return Math.round(t*r)/r}function x1(e){const t=b.useRef(e);return Ch(()=>{t.current=e}),t}function qie(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:u=!0,whileElementsMounted:d,open:c}=e,[h,p]=b.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=b.useState(n);qp(m,n)||v(n);const[x,y]=b.useState(null),[S,_]=b.useState(null),N=b.useCallback($=>{$!==E.current&&(E.current=$,y($))},[]),O=b.useCallback($=>{$!==T.current&&(T.current=$,_($))},[]),A=i||x,C=o||S,E=b.useRef(null),T=b.useRef(null),R=b.useRef(h),L=d!=null,z=x1(d),F=x1(a),B=x1(c),q=b.useCallback(()=>{if(!E.current||!T.current)return;const $={placement:t,strategy:r,middleware:m};F.current&&($.platform=F.current),Bie(E.current,T.current,$).then(Q=>{const k={...Q,isPositioned:B.current!==!1};H.current&&!qp(R.current,k)&&(R.current=k,ku.flushSync(()=>{p(k)}))})},[m,t,r,F,B]);Ch(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p($=>({...$,isPositioned:!1})))},[c]);const H=b.useRef(!1);Ch(()=>(H.current=!0,()=>{H.current=!1}),[]),Ch(()=>{if(A&&(E.current=A),C&&(T.current=C),A&&C){if(z.current)return z.current(A,C,q);q()}},[A,C,q,z,L]);const V=b.useMemo(()=>({reference:E,floating:T,setReference:N,setFloating:O}),[N,O]),G=b.useMemo(()=>({reference:A,floating:C}),[A,C]),U=b.useMemo(()=>{const $={position:r,left:0,top:0};if(!G.floating)return $;const Q=PR(G.floating,h.x),k=PR(G.floating,h.y);return u?{...$,transform:"translate("+Q+"px, "+k+"px)",...w4(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Q,top:k}},[r,u,G.floating,h.x,h.y]);return b.useMemo(()=>({...h,update:q,refs:V,elements:G,floatingStyles:U}),[h,q,V,G,U])}const Uie=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?ER({element:n.current,padding:a}).fn(r):{}:n?ER({element:n,padding:a}).fn(r):{}}}},Vie=(e,t)=>({...Rie(e),options:[e,t]}),Hie=(e,t)=>({...Iie(e),options:[e,t]}),Wie=(e,t)=>({...$ie(e),options:[e,t]}),Gie=(e,t)=>({...Mie(e),options:[e,t]}),Kie=(e,t)=>({...Die(e),options:[e,t]}),Xie=(e,t)=>({...Lie(e),options:[e,t]}),Yie=(e,t)=>({...Uie(e),options:[e,t]});var Jie="Arrow",S4=b.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...i}=e;return l.jsx(We.svg,{...i,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:l.jsx("polygon",{points:"0,0 30,0 15,10"})})});S4.displayName=Jie;var Qie=S4;function Wj(e){const[t,r]=b.useState(void 0);return Gt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,u;if("borderBoxSize"in i){const d=i.borderBoxSize,c=Array.isArray(d)?d[0]:d;o=c.inlineSize,u=c.blockSize}else o=e.offsetWidth,u=e.offsetHeight;r({width:o,height:u})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var Gj="Popper",[j4,Ol]=Ua(Gj),[Zie,_4]=j4(Gj),N4=e=>{const{__scopePopper:t,children:r}=e,[n,a]=b.useState(null);return l.jsx(Zie,{scope:t,anchor:n,onAnchorChange:a,children:r})};N4.displayName=Gj;var C4="PopperAnchor",O4=b.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,i=_4(C4,r),o=b.useRef(null),u=at(t,o),d=b.useRef(null);return b.useEffect(()=>{const c=d.current;d.current=n?.current||o.current,c!==d.current&&i.onAnchorChange(d.current)}),n?null:l.jsx(We.div,{...a,ref:u})});O4.displayName=C4;var Kj="PopperContent",[eoe,toe]=j4(Kj),E4=b.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:c=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:x,...y}=e,S=_4(Kj,r),[_,N]=b.useState(null),O=at(t,K=>N(K)),[A,C]=b.useState(null),E=Wj(A),T=E?.width??0,R=E?.height??0,L=n+(i!=="center"?"-"+i:""),z=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},F=Array.isArray(c)?c:[c],B=F.length>0,q={padding:z,boundary:F.filter(noe),altBoundary:B},{refs:H,floatingStyles:V,placement:G,isPositioned:U,middlewareData:$}=qie({strategy:"fixed",placement:L,whileElementsMounted:(...K)=>kie(...K,{animationFrame:v==="always"}),elements:{reference:S.anchor},middleware:[Vie({mainAxis:a+R,alignmentAxis:o}),d&&Hie({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Wie():void 0,...q}),d&&Gie({...q}),Kie({...q,apply:({elements:K,rects:J,availableWidth:ee,availableHeight:ce})=>{const{width:pe,height:W}=J.reference,_e=K.floating.style;_e.setProperty("--radix-popper-available-width",`${ee}px`),_e.setProperty("--radix-popper-available-height",`${ce}px`),_e.setProperty("--radix-popper-anchor-width",`${pe}px`),_e.setProperty("--radix-popper-anchor-height",`${W}px`)}}),A&&Yie({element:A,padding:u}),aoe({arrowWidth:T,arrowHeight:R}),m&&Xie({strategy:"referenceHidden",...q})]}),[Q,k]=T4(G),I=jr(x);Gt(()=>{U&&I?.()},[U,I]);const D=$.arrow?.x,Z=$.arrow?.y,ie=$.arrow?.centerOffset!==0,[oe,ne]=b.useState();return Gt(()=>{_&&ne(window.getComputedStyle(_).zIndex)},[_]),l.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:U?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[$.transformOrigin?.x,$.transformOrigin?.y].join(" "),...$.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:l.jsx(eoe,{scope:r,placedSide:Q,onArrowChange:C,arrowX:D,arrowY:Z,shouldHideArrow:ie,children:l.jsx(We.div,{"data-side":Q,"data-align":k,...y,ref:O,style:{...y.style,animation:U?void 0:"none"}})})})});E4.displayName=Kj;var P4="PopperArrow",roe={top:"bottom",right:"left",bottom:"top",left:"right"},A4=b.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,i=toe(P4,n),o=roe[i.placedSide];return l.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]: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:l.jsx(Qie,{...a,ref:r,style:{...a.style,display:"block"}})})});A4.displayName=P4;function noe(e){return e!==null}var aoe=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,o=a.arrow?.centerOffset!==0,u=o?0:e.arrowWidth,d=o?0:e.arrowHeight,[c,h]=T4(r),p={start:"0%",center:"50%",end:"100%"}[h],m=(a.arrow?.x??0)+u/2,v=(a.arrow?.y??0)+d/2;let x="",y="";return c==="bottom"?(x=o?p:`${m}px`,y=`${-d}px`):c==="top"?(x=o?p:`${m}px`,y=`${n.floating.height+d}px`):c==="right"?(x=`${-d}px`,y=o?p:`${v}px`):c==="left"&&(x=`${n.floating.width+d}px`,y=o?p:`${v}px`),{data:{x,y}}}});function T4(e){const[t,r="center"]=e.split("-");return[t,r]}var Xj=N4,Bm=O4,Yj=E4,Jj=A4,ioe="Portal",Vu=b.forwardRef((e,t)=>{const{container:r,...n}=e,[a,i]=b.useState(!1);Gt(()=>i(!0),[]);const o=r||a&&globalThis?.document?.body;return o?N6.createPortal(l.jsx(We.div,{...n,ref:t}),o):null});Vu.displayName=ioe;function ooe(e){const t=soe(e),r=b.forwardRef((n,a)=>{const{children:i,...o}=n,u=b.Children.toArray(i),d=u.find(coe);if(d){const c=d.props.children,h=u.map(p=>p===d?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:p);return l.jsx(t,{...o,ref:a,children:b.isValidElement(c)?b.cloneElement(c,void 0,h):null})}return l.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function soe(e){const t=b.forwardRef((r,n)=>{const{children:a,...i}=r;if(b.isValidElement(a)){const o=doe(a),u=uoe(i,a.props);return a.type!==b.Fragment&&(u.ref=n?Sn(n,o):o),b.cloneElement(a,u)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var loe=Symbol("radix.slottable");function coe(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===loe}function uoe(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function doe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var foe=NS[" useInsertionEffect ".trim().toString()]||Gt;function jo({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,i,o]=hoe({defaultProp:t,onChange:r}),u=e!==void 0,d=u?e:a;{const h=b.useRef(e!==void 0);b.useEffect(()=>{const p=h.current;p!==u&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${u?"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.`),h.current=u},[u,n])}const c=b.useCallback(h=>{if(u){const p=poe(h)?h(e):h;p!==e&&o.current?.(p)}else i(h)},[u,e,i,o]);return[d,c]}function hoe({defaultProp:e,onChange:t}){const[r,n]=b.useState(e),a=b.useRef(r),i=b.useRef(t);return foe(()=>{i.current=t},[t]),b.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,n,i]}function poe(e){return typeof e=="function"}function Qj(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var k4=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"}),moe="VisuallyHidden",R4=b.forwardRef((e,t)=>l.jsx(We.span,{...e,ref:t,style:{...k4,...e.style}}));R4.displayName=moe;var goe=R4,voe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},hs=new WeakMap,$f=new WeakMap,Bf={},b1=0,I4=function(e){return e&&(e.host||I4(e.parentNode))},yoe=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=I4(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},xoe=function(e,t,r,n){var a=yoe(t,Array.isArray(e)?e:[e]);Bf[r]||(Bf[r]=new WeakMap);var i=Bf[r],o=[],u=new Set,d=new Set(a),c=function(p){!p||u.has(p)||(u.add(p),c(p.parentNode))};a.forEach(c);var h=function(p){!p||d.has(p)||Array.prototype.forEach.call(p.children,function(m){if(u.has(m))h(m);else try{var v=m.getAttribute(n),x=v!==null&&v!=="false",y=(hs.get(m)||0)+1,S=(i.get(m)||0)+1;hs.set(m,y),i.set(m,S),o.push(m),y===1&&x&&$f.set(m,!0),S===1&&m.setAttribute(r,"true"),x||m.setAttribute(n,"true")}catch(_){console.error("aria-hidden: cannot operate on ",m,_)}})};return h(t),u.clear(),b1++,function(){o.forEach(function(p){var m=hs.get(p)-1,v=i.get(p)-1;hs.set(p,m),i.set(p,v),m||($f.has(p)||p.removeAttribute(n),$f.delete(p)),v||p.removeAttribute(r)}),b1--,b1||(hs=new WeakMap,hs=new WeakMap,$f=new WeakMap,Bf={})}},Zj=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=voe(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),xoe(n,a,r,"aria-hidden")):function(){return null}},ea=function(){return ea=Object.assign||function(t){for(var r,n=1,a=arguments.length;n"u")return Doe;var t=Loe(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Boe=$4(),Rs="data-scroll-locked",Foe=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,u=e.gap;return r===void 0&&(r="margin"),` - .`.concat(woe,` { - overflow: hidden `).concat(n,`; - padding-right: `).concat(u,"px ").concat(n,`; - } - body[`).concat(Rs,`] { - overflow: hidden `).concat(n,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` - padding-left: `.concat(a,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(o,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(u,"px ").concat(n,`; - `),r==="padding"&&"padding-right: ".concat(u,"px ").concat(n,";")].filter(Boolean).join(""),` - } - - .`).concat(Oh,` { - right: `).concat(u,"px ").concat(n,`; - } - - .`).concat(Eh,` { - margin-right: `).concat(u,"px ").concat(n,`; - } - - .`).concat(Oh," .").concat(Oh,` { - right: 0 `).concat(n,`; - } - - .`).concat(Eh," .").concat(Eh,` { - margin-right: 0 `).concat(n,`; - } - - body[`).concat(Rs,`] { - `).concat(Soe,": ").concat(u,`px; - } -`)},TR=function(){var e=parseInt(document.body.getAttribute(Rs)||"0",10);return isFinite(e)?e:0},zoe=function(){b.useEffect(function(){return document.body.setAttribute(Rs,(TR()+1).toString()),function(){var e=TR()-1;e<=0?document.body.removeAttribute(Rs):document.body.setAttribute(Rs,e.toString())}},[])},qoe=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;zoe();var i=b.useMemo(function(){return $oe(a)},[a]);return b.createElement(Boe,{styles:Foe(i,!t,a,r?"":"!important")})},lS=!1;if(typeof window<"u")try{var Ff=Object.defineProperty({},"passive",{get:function(){return lS=!0,!0}});window.addEventListener("test",Ff,Ff),window.removeEventListener("test",Ff,Ff)}catch{lS=!1}var ps=lS?{passive:!1}:!1,Uoe=function(e){return e.tagName==="TEXTAREA"},B4=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Uoe(e)&&r[t]==="visible")},Voe=function(e){return B4(e,"overflowY")},Hoe=function(e){return B4(e,"overflowX")},kR=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=F4(e,n);if(a){var i=z4(e,n),o=i[1],u=i[2];if(o>u)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Woe=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Goe=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},F4=function(e,t){return e==="v"?Voe(t):Hoe(t)},z4=function(e,t){return e==="v"?Woe(t):Goe(t)},Koe=function(e,t){return e==="h"&&t==="rtl"?-1:1},Xoe=function(e,t,r,n,a){var i=Koe(e,window.getComputedStyle(t).direction),o=i*n,u=r.target,d=t.contains(u),c=!1,h=o>0,p=0,m=0;do{if(!u)break;var v=z4(e,u),x=v[0],y=v[1],S=v[2],_=y-S-i*x;(x||_)&&F4(e,u)&&(p+=_,m+=x);var N=u.parentNode;u=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(h&&Math.abs(p)<1||!h&&Math.abs(m)<1)&&(c=!0),c},zf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},RR=function(e){return[e.deltaX,e.deltaY]},IR=function(e){return e&&"current"in e?e.current:e},Yoe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Joe=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Qoe=0,ms=[];function Zoe(e){var t=b.useRef([]),r=b.useRef([0,0]),n=b.useRef(),a=b.useState(Qoe++)[0],i=b.useState($4)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var y=boe([e.lockRef.current],(e.shards||[]).map(IR),!0).filter(Boolean);return y.forEach(function(S){return S.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),y.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=b.useCallback(function(y,S){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var _=zf(y),N=r.current,O="deltaX"in y?y.deltaX:N[0]-_[0],A="deltaY"in y?y.deltaY:N[1]-_[1],C,E=y.target,T=Math.abs(O)>Math.abs(A)?"h":"v";if("touches"in y&&T==="h"&&E.type==="range")return!1;var R=window.getSelection(),L=R&&R.anchorNode,z=L?L===E||L.contains(E):!1;if(z)return!1;var F=kR(T,E);if(!F)return!0;if(F?C=T:(C=T==="v"?"h":"v",F=kR(T,E)),!F)return!1;if(!n.current&&"changedTouches"in y&&(O||A)&&(n.current=C),!C)return!0;var B=n.current||C;return Xoe(B,S,y,B==="h"?O:A)},[]),d=b.useCallback(function(y){var S=y;if(!(!ms.length||ms[ms.length-1]!==i)){var _="deltaY"in S?RR(S):zf(S),N=t.current.filter(function(C){return C.name===S.type&&(C.target===S.target||S.target===C.shadowParent)&&Yoe(C.delta,_)})[0];if(N&&N.should){S.cancelable&&S.preventDefault();return}if(!N){var O=(o.current.shards||[]).map(IR).filter(Boolean).filter(function(C){return C.contains(S.target)}),A=O.length>0?u(S,O[0]):!o.current.noIsolation;A&&S.cancelable&&S.preventDefault()}}},[]),c=b.useCallback(function(y,S,_,N){var O={name:y,delta:S,target:_,should:N,shadowParent:ese(_)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(A){return A!==O})},1)},[]),h=b.useCallback(function(y){r.current=zf(y),n.current=void 0},[]),p=b.useCallback(function(y){c(y.type,RR(y),y.target,u(y,e.lockRef.current))},[]),m=b.useCallback(function(y){c(y.type,zf(y),y.target,u(y,e.lockRef.current))},[]);b.useEffect(function(){return ms.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",d,ps),document.addEventListener("touchmove",d,ps),document.addEventListener("touchstart",h,ps),function(){ms=ms.filter(function(y){return y!==i}),document.removeEventListener("wheel",d,ps),document.removeEventListener("touchmove",d,ps),document.removeEventListener("touchstart",h,ps)}},[]);var v=e.removeScrollBar,x=e.inert;return b.createElement(b.Fragment,null,x?b.createElement(i,{styles:Joe(a)}):null,v?b.createElement(qoe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ese(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const tse=Poe(L4,Zoe);var zm=b.forwardRef(function(e,t){return b.createElement(Fm,ea({},e,{ref:t,sideCar:tse}))});zm.classNames=Fm.classNames;var rse=[" ","Enter","ArrowUp","ArrowDown"],nse=[" ","Enter"],_o="Select",[qm,Um,ase]=Sae(_o),[El]=Ua(_o,[ase,Ol]),Vm=Ol(),[ise,Ri]=El(_o),[ose,sse]=El(_o),q4=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:a,onOpenChange:i,value:o,defaultValue:u,onValueChange:d,dir:c,name:h,autoComplete:p,disabled:m,required:v,form:x}=e,y=Vm(t),[S,_]=b.useState(null),[N,O]=b.useState(null),[A,C]=b.useState(!1),E=yM(c),[T,R]=jo({prop:n,defaultProp:a??!1,onChange:i,caller:_o}),[L,z]=jo({prop:o,defaultProp:u,onChange:d,caller:_o}),F=b.useRef(null),B=S?x||!!S.closest("form"):!0,[q,H]=b.useState(new Set),V=Array.from(q).map(G=>G.props.value).join(";");return l.jsx(Xj,{...y,children:l.jsxs(ise,{required:v,scope:t,trigger:S,onTriggerChange:_,valueNode:N,onValueNodeChange:O,valueNodeHasChildren:A,onValueNodeHasChildrenChange:C,contentId:Lr(),value:L,onValueChange:z,open:T,onOpenChange:R,dir:E,triggerPointerDownPosRef:F,disabled:m,children:[l.jsx(qm.Provider,{scope:t,children:l.jsx(ose,{scope:e.__scopeSelect,onNativeOptionAdd:b.useCallback(G=>{H(U=>new Set(U).add(G))},[]),onNativeOptionRemove:b.useCallback(G=>{H(U=>{const $=new Set(U);return $.delete(G),$})},[]),children:r})}),B?l.jsxs(u3,{"aria-hidden":!0,required:v,tabIndex:-1,name:h,autoComplete:p,value:L,onChange:G=>z(G.target.value),disabled:m,form:x,children:[L===void 0?l.jsx("option",{value:""}):null,Array.from(q)]},V):null]})})};q4.displayName=_o;var U4="SelectTrigger",V4=b.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...a}=e,i=Vm(r),o=Ri(U4,r),u=o.disabled||n,d=at(t,o.onTriggerChange),c=Um(r),h=b.useRef("touch"),[p,m,v]=f3(y=>{const S=c().filter(O=>!O.disabled),_=S.find(O=>O.value===o.value),N=h3(S,y,_);N!==void 0&&o.onValueChange(N.value)}),x=y=>{u||(o.onOpenChange(!0),v()),y&&(o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return l.jsx(Bm,{asChild:!0,...i,children:l.jsx(We.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":d3(o.value)?"":void 0,...a,ref:d,onClick:Ge(a.onClick,y=>{y.currentTarget.focus(),h.current!=="mouse"&&x(y)}),onPointerDown:Ge(a.onPointerDown,y=>{h.current=y.pointerType;const S=y.target;S.hasPointerCapture(y.pointerId)&&S.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(x(y),y.preventDefault())}),onKeyDown:Ge(a.onKeyDown,y=>{const S=p.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&m(y.key),!(S&&y.key===" ")&&rse.includes(y.key)&&(x(),y.preventDefault())})})})});V4.displayName=U4;var H4="SelectValue",W4=b.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,children:i,placeholder:o="",...u}=e,d=Ri(H4,r),{onValueNodeHasChildrenChange:c}=d,h=i!==void 0,p=at(t,d.onValueNodeChange);return Gt(()=>{c(h)},[c,h]),l.jsx(We.span,{...u,ref:p,style:{pointerEvents:"none"},children:d3(d.value)?l.jsx(l.Fragment,{children:o}):i})});W4.displayName=H4;var lse="SelectIcon",G4=b.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...a}=e;return l.jsx(We.span,{"aria-hidden":!0,...a,ref:t,children:n||"▼"})});G4.displayName=lse;var cse="SelectPortal",K4=e=>l.jsx(Vu,{asChild:!0,...e});K4.displayName=cse;var No="SelectContent",X4=b.forwardRef((e,t)=>{const r=Ri(No,e.__scopeSelect),[n,a]=b.useState();if(Gt(()=>{a(new DocumentFragment)},[]),!r.open){const i=n;return i?ku.createPortal(l.jsx(Y4,{scope:e.__scopeSelect,children:l.jsx(qm.Slot,{scope:e.__scopeSelect,children:l.jsx("div",{children:e.children})})}),i):null}return l.jsx(J4,{...e,ref:t})});X4.displayName=No;var Dn=10,[Y4,Ii]=El(No),use="SelectContentImpl",dse=ooe("SelectContent.RemoveScroll"),J4=b.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:u,sideOffset:d,align:c,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:v,sticky:x,hideWhenDetached:y,avoidCollisions:S,..._}=e,N=Ri(No,r),[O,A]=b.useState(null),[C,E]=b.useState(null),T=at(t,K=>A(K)),[R,L]=b.useState(null),[z,F]=b.useState(null),B=Um(r),[q,H]=b.useState(!1),V=b.useRef(!1);b.useEffect(()=>{if(O)return Zj(O)},[O]),Bj();const G=b.useCallback(K=>{const[J,...ee]=B().map(W=>W.ref.current),[ce]=ee.slice(-1),pe=document.activeElement;for(const W of K)if(W===pe||(W?.scrollIntoView({block:"nearest"}),W===J&&C&&(C.scrollTop=0),W===ce&&C&&(C.scrollTop=C.scrollHeight),W?.focus(),document.activeElement!==pe))return},[B,C]),U=b.useCallback(()=>G([R,O]),[G,R,O]);b.useEffect(()=>{q&&U()},[q,U]);const{onOpenChange:$,triggerPointerDownPosRef:Q}=N;b.useEffect(()=>{if(O){let K={x:0,y:0};const J=ce=>{K={x:Math.abs(Math.round(ce.pageX)-(Q.current?.x??0)),y:Math.abs(Math.round(ce.pageY)-(Q.current?.y??0))}},ee=ce=>{K.x<=10&&K.y<=10?ce.preventDefault():O.contains(ce.target)||$(!1),document.removeEventListener("pointermove",J),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",ee,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",ee,{capture:!0})}}},[O,$,Q]),b.useEffect(()=>{const K=()=>$(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[$]);const[k,I]=f3(K=>{const J=B().filter(pe=>!pe.disabled),ee=J.find(pe=>pe.ref.current===document.activeElement),ce=h3(J,K,ee);ce&&setTimeout(()=>ce.ref.current.focus())}),D=b.useCallback((K,J,ee)=>{const ce=!V.current&&!ee;(N.value!==void 0&&N.value===J||ce)&&(L(K),ce&&(V.current=!0))},[N.value]),Z=b.useCallback(()=>O?.focus(),[O]),ie=b.useCallback((K,J,ee)=>{const ce=!V.current&&!ee;(N.value!==void 0&&N.value===J||ce)&&F(K)},[N.value]),oe=n==="popper"?cS:Q4,ne=oe===cS?{side:u,sideOffset:d,align:c,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:v,sticky:x,hideWhenDetached:y,avoidCollisions:S}:{};return l.jsx(Y4,{scope:r,content:O,viewport:C,onViewportChange:E,itemRefCallback:D,selectedItem:R,onItemLeave:Z,itemTextRefCallback:ie,focusSelectedItem:U,selectedItemText:z,position:n,isPositioned:q,searchRef:k,children:l.jsx(zm,{as:dse,allowPinchZoom:!0,children:l.jsx(Im,{asChild:!0,trapped:N.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:Ge(a,K=>{N.trigger?.focus({preventScroll:!0}),K.preventDefault()}),children:l.jsx(qu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:l.jsx(oe,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:K=>K.preventDefault(),..._,...ne,onPlaced:()=>H(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:Ge(_.onKeyDown,K=>{const J=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!J&&K.key.length===1&&I(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let ce=B().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(K.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const pe=K.target,W=ce.indexOf(pe);ce=ce.slice(W+1)}setTimeout(()=>G(ce)),K.preventDefault()}})})})})})})});J4.displayName=use;var fse="SelectItemAlignedPosition",Q4=b.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...a}=e,i=Ri(No,r),o=Ii(No,r),[u,d]=b.useState(null),[c,h]=b.useState(null),p=at(t,T=>h(T)),m=Um(r),v=b.useRef(!1),x=b.useRef(!0),{viewport:y,selectedItem:S,selectedItemText:_,focusSelectedItem:N}=o,O=b.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&c&&y&&S&&_){const T=i.trigger.getBoundingClientRect(),R=c.getBoundingClientRect(),L=i.valueNode.getBoundingClientRect(),z=_.getBoundingClientRect();if(i.dir!=="rtl"){const pe=z.left-R.left,W=L.left-pe,_e=T.left-W,Ce=T.width+_e,qe=Math.max(Ce,R.width),De=window.innerWidth-Dn,nt=D1(W,[Dn,Math.max(Dn,De-qe)]);u.style.minWidth=Ce+"px",u.style.left=nt+"px"}else{const pe=R.right-z.right,W=window.innerWidth-L.right-pe,_e=window.innerWidth-T.right-W,Ce=T.width+_e,qe=Math.max(Ce,R.width),De=window.innerWidth-Dn,nt=D1(W,[Dn,Math.max(Dn,De-qe)]);u.style.minWidth=Ce+"px",u.style.right=nt+"px"}const F=m(),B=window.innerHeight-Dn*2,q=y.scrollHeight,H=window.getComputedStyle(c),V=parseInt(H.borderTopWidth,10),G=parseInt(H.paddingTop,10),U=parseInt(H.borderBottomWidth,10),$=parseInt(H.paddingBottom,10),Q=V+G+q+$+U,k=Math.min(S.offsetHeight*5,Q),I=window.getComputedStyle(y),D=parseInt(I.paddingTop,10),Z=parseInt(I.paddingBottom,10),ie=T.top+T.height/2-Dn,oe=B-ie,ne=S.offsetHeight/2,K=S.offsetTop+ne,J=V+G+K,ee=Q-J;if(J<=ie){const pe=F.length>0&&S===F[F.length-1].ref.current;u.style.bottom="0px";const W=c.clientHeight-y.offsetTop-y.offsetHeight,_e=Math.max(oe,ne+(pe?Z:0)+W+U),Ce=J+_e;u.style.height=Ce+"px"}else{const pe=F.length>0&&S===F[0].ref.current;u.style.top="0px";const _e=Math.max(ie,V+y.offsetTop+(pe?D:0)+ne)+ee;u.style.height=_e+"px",y.scrollTop=J-ie+y.offsetTop}u.style.margin=`${Dn}px 0`,u.style.minHeight=k+"px",u.style.maxHeight=B+"px",n?.(),requestAnimationFrame(()=>v.current=!0)}},[m,i.trigger,i.valueNode,u,c,y,S,_,i.dir,n]);Gt(()=>O(),[O]);const[A,C]=b.useState();Gt(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const E=b.useCallback(T=>{T&&x.current===!0&&(O(),N?.(),x.current=!1)},[O,N]);return l.jsx(pse,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:v,onScrollButtonChange:E,children:l.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:l.jsx(We.div,{...a,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});Q4.displayName=fse;var hse="SelectPopperPosition",cS=b.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:a=Dn,...i}=e,o=Vm(r);return l.jsx(Yj,{...o,...i,ref:t,align:n,collisionPadding:a,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)"}})});cS.displayName=hse;var[pse,e_]=El(No,{}),uS="SelectViewport",Z4=b.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...a}=e,i=Ii(uS,r),o=e_(uS,r),u=at(t,i.onViewportChange),d=b.useRef(0);return l.jsxs(l.Fragment,{children:[l.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:n}),l.jsx(qm.Slot,{scope:r,children:l.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Ge(a.onScroll,c=>{const h=c.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=o;if(m?.current&&p){const v=Math.abs(d.current-h.scrollTop);if(v>0){const x=window.innerHeight-Dn*2,y=parseFloat(p.style.minHeight),S=parseFloat(p.style.height),_=Math.max(y,S);if(_0?A:0,p.style.justifyContent="flex-end")}}}d.current=h.scrollTop})})})]})});Z4.displayName=uS;var e3="SelectGroup",[mse,gse]=El(e3),vse=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=Lr();return l.jsx(mse,{scope:r,id:a,children:l.jsx(We.div,{role:"group","aria-labelledby":a,...n,ref:t})})});vse.displayName=e3;var t3="SelectLabel",yse=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=gse(t3,r);return l.jsx(We.div,{id:a.id,...n,ref:t})});yse.displayName=t3;var Up="SelectItem",[xse,r3]=El(Up),n3=b.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:a=!1,textValue:i,...o}=e,u=Ri(Up,r),d=Ii(Up,r),c=u.value===n,[h,p]=b.useState(i??""),[m,v]=b.useState(!1),x=at(t,N=>d.itemRefCallback?.(N,n,a)),y=Lr(),S=b.useRef("touch"),_=()=>{a||(u.onValueChange(n),u.onOpenChange(!1))};if(n==="")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 l.jsx(xse,{scope:r,value:n,disabled:a,textId:y,isSelected:c,onItemTextChange:b.useCallback(N=>{p(O=>O||(N?.textContent??"").trim())},[]),children:l.jsx(qm.ItemSlot,{scope:r,value:n,disabled:a,textValue:h,children:l.jsx(We.div,{role:"option","aria-labelledby":y,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:x,onFocus:Ge(o.onFocus,()=>v(!0)),onBlur:Ge(o.onBlur,()=>v(!1)),onClick:Ge(o.onClick,()=>{S.current!=="mouse"&&_()}),onPointerUp:Ge(o.onPointerUp,()=>{S.current==="mouse"&&_()}),onPointerDown:Ge(o.onPointerDown,N=>{S.current=N.pointerType}),onPointerMove:Ge(o.onPointerMove,N=>{S.current=N.pointerType,a?d.onItemLeave?.():S.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ge(o.onPointerLeave,N=>{N.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Ge(o.onKeyDown,N=>{d.searchRef?.current!==""&&N.key===" "||(nse.includes(N.key)&&_(),N.key===" "&&N.preventDefault())})})})})});n3.displayName=Up;var Mc="SelectItemText",a3=b.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,...i}=e,o=Ri(Mc,r),u=Ii(Mc,r),d=r3(Mc,r),c=sse(Mc,r),[h,p]=b.useState(null),m=at(t,_=>p(_),d.onItemTextChange,_=>u.itemTextRefCallback?.(_,d.value,d.disabled)),v=h?.textContent,x=b.useMemo(()=>l.jsx("option",{value:d.value,disabled:d.disabled,children:v},d.value),[d.disabled,d.value,v]),{onNativeOptionAdd:y,onNativeOptionRemove:S}=c;return Gt(()=>(y(x),()=>S(x)),[y,S,x]),l.jsxs(l.Fragment,{children:[l.jsx(We.span,{id:d.textId,...i,ref:m}),d.isSelected&&o.valueNode&&!o.valueNodeHasChildren?ku.createPortal(i.children,o.valueNode):null]})});a3.displayName=Mc;var i3="SelectItemIndicator",o3=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return r3(i3,r).isSelected?l.jsx(We.span,{"aria-hidden":!0,...n,ref:t}):null});o3.displayName=i3;var dS="SelectScrollUpButton",s3=b.forwardRef((e,t)=>{const r=Ii(dS,e.__scopeSelect),n=e_(dS,e.__scopeSelect),[a,i]=b.useState(!1),o=at(t,n.onScrollButtonChange);return Gt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=d.scrollTop>0;i(c)};const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),a?l.jsx(c3,{...e,ref:o,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});s3.displayName=dS;var fS="SelectScrollDownButton",l3=b.forwardRef((e,t)=>{const r=Ii(fS,e.__scopeSelect),n=e_(fS,e.__scopeSelect),[a,i]=b.useState(!1),o=at(t,n.onScrollButtonChange);return Gt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const c=d.scrollHeight-d.clientHeight,h=Math.ceil(d.scrollTop)d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),a?l.jsx(c3,{...e,ref:o,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});l3.displayName=fS;var c3=b.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...a}=e,i=Ii("SelectScrollButton",r),o=b.useRef(null),u=Um(r),d=b.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return b.useEffect(()=>()=>d(),[d]),Gt(()=>{u().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),l.jsx(We.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Ge(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:Ge(a.onPointerMove,()=>{i.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:Ge(a.onPointerLeave,()=>{d()})})}),bse="SelectSeparator",wse=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return l.jsx(We.div,{"aria-hidden":!0,...n,ref:t})});wse.displayName=bse;var hS="SelectArrow",Sse=b.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=Vm(r),i=Ri(hS,r),o=Ii(hS,r);return i.open&&o.position==="popper"?l.jsx(Jj,{...a,...n,ref:t}):null});Sse.displayName=hS;var jse="SelectBubbleInput",u3=b.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const a=b.useRef(null),i=at(n,a),o=Qj(t);return b.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(d,"value").set;if(o!==t&&h){const p=new Event("change",{bubbles:!0});h.call(u,t),u.dispatchEvent(p)}},[o,t]),l.jsx(We.select,{...r,style:{...k4,...r.style},ref:i,defaultValue:t})});u3.displayName=jse;function d3(e){return e===""||e===void 0}function f3(e){const t=jr(e),r=b.useRef(""),n=b.useRef(0),a=b.useCallback(o=>{const u=r.current+o;t(u),(function d(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),i=b.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,a,i]}function h3(e,t,r){const a=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=_se(e,Math.max(i,0));a.length===1&&(o=o.filter(c=>c!==r));const d=o.find(c=>c.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==r?d:void 0}function _se(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Nse=q4,Cse=V4,Ose=W4,Ese=G4,Pse=K4,Ase=X4,Tse=Z4,kse=n3,Rse=a3,Ise=o3,Mse=s3,Dse=l3;function Ke({...e}){return l.jsx(Nse,{"data-slot":"select",...e})}function Xe({...e}){return l.jsx(Ose,{"data-slot":"select-value",...e})}function Ye({className:e,size:t="default",children:r,...n}){return l.jsxs(Cse,{"data-slot":"select-trigger","data-size":t,className:Ae("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-input-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[r,l.jsx(Ese,{asChild:!0,children:l.jsx(Is,{className:"size-4 opacity-50"})})]})}function Je({className:e,children:t,position:r="popper",...n}){return l.jsx(Pse,{children:l.jsxs(Ase,{"data-slot":"select-content",className:Ae("bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="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:r,...n,children:[l.jsx(Lse,{}),l.jsx(Tse,{className:Ae("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),l.jsx($se,{})]})})}function Ne({className:e,children:t,...r}){return l.jsxs(kse,{"data-slot":"select-item",className:Ae("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[l.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:l.jsx(Ise,{children:l.jsx(JI,{className:"size-4"})})}),l.jsx(Rse,{children:t})]})}function Lse({className:e,...t}){return l.jsx(Mse,{"data-slot":"select-scroll-up-button",className:Ae("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(kz,{className:"size-4"})})}function $se({className:e,...t}){return l.jsx(Dse,{"data-slot":"select-scroll-down-button",className:Ae("flex cursor-default items-center justify-center py-1",e),...t,children:l.jsx(Is,{className:"size-4"})})}function Bse(e){const t=Fse(e),r=b.forwardRef((n,a)=>{const{children:i,...o}=n,u=b.Children.toArray(i),d=u.find(qse);if(d){const c=d.props.children,h=u.map(p=>p===d?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:p);return l.jsx(t,{...o,ref:a,children:b.isValidElement(c)?b.cloneElement(c,void 0,h):null})}return l.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function Fse(e){const t=b.forwardRef((r,n)=>{const{children:a,...i}=r;if(b.isValidElement(a)){const o=Vse(a),u=Use(i,a.props);return a.type!==b.Fragment&&(u.ref=n?Sn(n,o):o),b.cloneElement(a,u)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zse=Symbol("radix.slottable");function qse(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zse}function Use(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function Vse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Hm="Dialog",[p3]=Ua(Hm),[Hse,Kn]=p3(Hm),m3=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,u=b.useRef(null),d=b.useRef(null),[c,h]=jo({prop:n,defaultProp:a??!1,onChange:i,caller:Hm});return l.jsx(Hse,{scope:t,triggerRef:u,contentRef:d,contentId:Lr(),titleId:Lr(),descriptionId:Lr(),open:c,onOpenChange:h,onOpenToggle:b.useCallback(()=>h(p=>!p),[h]),modal:o,children:r})};m3.displayName=Hm;var g3="DialogTrigger",Wse=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kn(g3,r),i=at(t,a.triggerRef);return l.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":n_(a.open),...n,ref:i,onClick:Ge(e.onClick,a.onOpenToggle)})});Wse.displayName=g3;var t_="DialogPortal",[Gse,v3]=p3(t_,{forceMount:void 0}),y3=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,i=Kn(t_,t);return l.jsx(Gse,{scope:t,forceMount:r,children:b.Children.map(n,o=>l.jsx(nn,{present:r||i.open,children:l.jsx(Vu,{asChild:!0,container:a,children:o})}))})};y3.displayName=t_;var Vp="DialogOverlay",x3=b.forwardRef((e,t)=>{const r=v3(Vp,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=Kn(Vp,e.__scopeDialog);return i.modal?l.jsx(nn,{present:n||i.open,children:l.jsx(Xse,{...a,ref:t})}):null});x3.displayName=Vp;var Kse=Bse("DialogOverlay.RemoveScroll"),Xse=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kn(Vp,r);return l.jsx(zm,{as:Kse,allowPinchZoom:!0,shards:[a.contentRef],children:l.jsx(We.div,{"data-state":n_(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Co="DialogContent",b3=b.forwardRef((e,t)=>{const r=v3(Co,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=Kn(Co,e.__scopeDialog);return l.jsx(nn,{present:n||i.open,children:i.modal?l.jsx(Yse,{...a,ref:t}):l.jsx(Jse,{...a,ref:t})})});b3.displayName=Co;var Yse=b.forwardRef((e,t)=>{const r=Kn(Co,e.__scopeDialog),n=b.useRef(null),a=at(t,r.contentRef,n);return b.useEffect(()=>{const i=n.current;if(i)return Zj(i)},[]),l.jsx(w3,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ge(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Ge(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,u=o.button===0&&o.ctrlKey===!0;(o.button===2||u)&&i.preventDefault()}),onFocusOutside:Ge(e.onFocusOutside,i=>i.preventDefault())})}),Jse=b.forwardRef((e,t)=>{const r=Kn(Co,e.__scopeDialog),n=b.useRef(!1),a=b.useRef(!1);return l.jsx(w3,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;r.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),w3=b.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,u=Kn(Co,r),d=b.useRef(null),c=at(t,d);return Bj(),l.jsxs(l.Fragment,{children:[l.jsx(Im,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:l.jsx(qu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":n_(u.open),...o,ref:c,onDismiss:()=>u.onOpenChange(!1)})}),l.jsxs(l.Fragment,{children:[l.jsx(Qse,{titleId:u.titleId}),l.jsx(ele,{contentRef:d,descriptionId:u.descriptionId})]})]})}),r_="DialogTitle",S3=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kn(r_,r);return l.jsx(We.h2,{id:a.titleId,...n,ref:t})});S3.displayName=r_;var j3="DialogDescription",_3=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kn(j3,r);return l.jsx(We.p,{id:a.descriptionId,...n,ref:t})});_3.displayName=j3;var N3="DialogClose",C3=b.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Kn(N3,r);return l.jsx(We.button,{type:"button",...n,ref:t,onClick:Ge(e.onClick,()=>a.onOpenChange(!1))})});C3.displayName=N3;function n_(e){return e?"open":"closed"}var O3="DialogTitleWarning",[phe,E3]=L6(O3,{contentName:Co,titleName:r_,docsSlug:"dialog"}),Qse=({titleId:e})=>{const t=E3(O3),r=`\`${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 b.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Zse="DialogDescriptionWarning",ele=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${E3(Zse).contentName}}.`;return b.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},P3=m3,A3=y3,T3=x3,k3=b3,tle=S3,rle=_3,nle=C3;function mt({...e}){return l.jsx(P3,{"data-slot":"dialog",...e})}function ale({...e}){return l.jsx(A3,{"data-slot":"dialog-portal",...e})}const R3=b.forwardRef(({className:e,...t},r)=>l.jsx(T3,{ref:r,"data-slot":"dialog-overlay",className:Ae("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t}));R3.displayName="DialogOverlay";const ft=b.forwardRef(({className:e,children:t,...r},n)=>l.jsxs(ale,{"data-slot":"dialog-portal",children:[l.jsx(R3,{}),l.jsxs(k3,{ref:n,"data-slot":"dialog-content",className:Ae("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,l.jsxs(nle,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[l.jsx(uo,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ft.displayName="DialogContent";function gt({className:e,...t}){return l.jsx("div",{"data-slot":"dialog-header",className:Ae("flex flex-col gap-2 text-center sm:text-left",e),...t})}function xt({className:e,...t}){return l.jsx("div",{"data-slot":"dialog-footer",className:Ae("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function vt({className:e,...t}){return l.jsx(tle,{"data-slot":"dialog-title",className:Ae("text-lg leading-none font-semibold",e),...t})}function Nt({className:e,...t}){return l.jsx(rle,{"data-slot":"dialog-description",className:Ae("text-muted-foreground text-sm",e),...t})}var ile=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ole=ile.reduce((e,t)=>{const r=kS(`Primitive.${t}`),n=b.forwardRef((a,i)=>{const{asChild:o,...u}=a,d=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(d,{...u,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),sle="Label",I3=b.forwardRef((e,t)=>l.jsx(ole.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));I3.displayName=sle;var lle=I3;function ue({className:e,...t}){return l.jsx(lle,{"data-slot":"label",className:Ae("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var Wm="Switch",[cle]=Ua(Wm),[ule,dle]=cle(Wm),M3=b.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:i,required:o,disabled:u,value:d="on",onCheckedChange:c,form:h,...p}=e,[m,v]=b.useState(null),x=at(t,O=>v(O)),y=b.useRef(!1),S=m?h||!!m.closest("form"):!0,[_,N]=jo({prop:a,defaultProp:i??!1,onChange:c,caller:Wm});return l.jsxs(ule,{scope:r,checked:_,disabled:u,children:[l.jsx(We.button,{type:"button",role:"switch","aria-checked":_,"aria-required":o,"data-state":B3(_),"data-disabled":u?"":void 0,disabled:u,value:d,...p,ref:x,onClick:Ge(e.onClick,O=>{N(A=>!A),S&&(y.current=O.isPropagationStopped(),y.current||O.stopPropagation())})}),S&&l.jsx($3,{control:m,bubbles:!y.current,name:n,value:d,checked:_,required:o,disabled:u,form:h,style:{transform:"translateX(-100%)"}})]})});M3.displayName=Wm;var D3="SwitchThumb",L3=b.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,a=dle(D3,r);return l.jsx(We.span,{"data-state":B3(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});L3.displayName=D3;var fle="SwitchBubbleInput",$3=b.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...a},i)=>{const o=b.useRef(null),u=at(o,i),d=Qj(r),c=Wj(t);return b.useEffect(()=>{const h=o.current;if(!h)return;const p=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(p,"checked").set;if(d!==r&&v){const x=new Event("click",{bubbles:n});v.call(h,r),h.dispatchEvent(x)}},[d,r,n]),l.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:u,style:{...a.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});$3.displayName=fle;function B3(e){return e?"checked":"unchecked"}var hle=M3,ple=L3;function qt({className:e,...t}){return l.jsx(hle,{"data-slot":"switch",className:Ae("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx(ple,{"data-slot":"switch-thumb",className:Ae("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function mle(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Array(12).fill(0);let pS=1;class gle{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...a}=t,i=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:pS++,o=this.toasts.find(d=>d.id===i),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(d=>d.id===i?(this.publish({...d,...t,id:i,title:n}),{...d,...t,id:i,dismissible:u,title:n}):d):this.addToast({title:n,...a,dismissible:u,id:i}),i},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let i=n!==void 0,o;const u=a.then(async c=>{if(o=["resolve",c],X.isValidElement(c))i=!1,this.create({id:n,type:"default",message:c});else if(yle(c)&&!c.ok){i=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${c.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${c.status}`):r.description,x=typeof p=="object"&&!X.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:m,...x})}else if(c instanceof Error){i=!1;const p=typeof r.error=="function"?await r.error(c):r.error,m=typeof r.description=="function"?await r.description(c):r.description,x=typeof p=="object"&&!X.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:m,...x})}else if(r.success!==void 0){i=!1;const p=typeof r.success=="function"?await r.success(c):r.success,m=typeof r.description=="function"?await r.description(c):r.description,x=typeof p=="object"&&!X.isValidElement(p)?p:{message:p};this.create({id:n,type:"success",description:m,...x})}}).catch(async c=>{if(o=["reject",c],r.error!==void 0){i=!1;const h=typeof r.error=="function"?await r.error(c):r.error,p=typeof r.description=="function"?await r.description(c):r.description,v=typeof h=="object"&&!X.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:p,...v})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),d=()=>new Promise((c,h)=>u.then(()=>o[0]==="reject"?h(o[1]):c(o[1])).catch(h));return typeof n!="string"&&typeof n!="number"?{unwrap:d}:Object.assign(n,{unwrap:d})},this.custom=(t,r)=>{const n=r?.id||pS++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const gn=new gle,vle=(e,t)=>{const r=t?.id||pS++;return gn.addToast({title:e,...t,id:r}),r},yle=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",xle=vle,ble=()=>gn.toasts,wle=()=>gn.getActiveToasts(),xe=Object.assign(xle,{success:gn.success,info:gn.info,warning:gn.warning,error:gn.error,custom:gn.custom,message:gn.message,promise:gn.promise,dismiss:gn.dismiss,loading:gn.loading},{getHistory:ble,getToasts:wle});mle("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-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;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Sle(e){const t=jle(e),r=b.forwardRef((n,a)=>{const{children:i,...o}=n,u=b.Children.toArray(i),d=u.find(Nle);if(d){const c=d.props.children,h=u.map(p=>p===d?b.Children.count(c)>1?b.Children.only(null):b.isValidElement(c)?c.props.children:null:p);return l.jsx(t,{...o,ref:a,children:b.isValidElement(c)?b.cloneElement(c,void 0,h):null})}return l.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function jle(e){const t=b.forwardRef((r,n)=>{const{children:a,...i}=r;if(b.isValidElement(a)){const o=Ole(a),u=Cle(i,a.props);return a.type!==b.Fragment&&(u.ref=n?Sn(n,o):o),b.cloneElement(a,u)}return b.Children.count(a)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var _le=Symbol("radix.slottable");function Nle(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===_le}function Cle(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function Ole(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Gm="Popover",[F3]=Ua(Gm,[Ol]),Hu=Ol(),[Ele,Mi]=F3(Gm),z3=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,u=Hu(t),d=b.useRef(null),[c,h]=b.useState(!1),[p,m]=jo({prop:n,defaultProp:a??!1,onChange:i,caller:Gm});return l.jsx(Xj,{...u,children:l.jsx(Ele,{scope:t,contentId:Lr(),triggerRef:d,open:p,onOpenChange:m,onOpenToggle:b.useCallback(()=>m(v=>!v),[m]),hasCustomAnchor:c,onCustomAnchorAdd:b.useCallback(()=>h(!0),[]),onCustomAnchorRemove:b.useCallback(()=>h(!1),[]),modal:o,children:r})})};z3.displayName=Gm;var q3="PopoverAnchor",Ple=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=Mi(q3,r),i=Hu(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:u}=a;return b.useEffect(()=>(o(),()=>u()),[o,u]),l.jsx(Bm,{...i,...n,ref:t})});Ple.displayName=q3;var U3="PopoverTrigger",V3=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=Mi(U3,r),i=Hu(r),o=at(t,a.triggerRef),u=l.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":X3(a.open),...n,ref:o,onClick:Ge(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:l.jsx(Bm,{asChild:!0,...i,children:u})});V3.displayName=U3;var a_="PopoverPortal",[Ale,Tle]=F3(a_,{forceMount:void 0}),H3=e=>{const{__scopePopover:t,forceMount:r,children:n,container:a}=e,i=Mi(a_,t);return l.jsx(Ale,{scope:t,forceMount:r,children:l.jsx(nn,{present:r||i.open,children:l.jsx(Vu,{asChild:!0,container:a,children:n})})})};H3.displayName=a_;var dl="PopoverContent",W3=b.forwardRef((e,t)=>{const r=Tle(dl,e.__scopePopover),{forceMount:n=r.forceMount,...a}=e,i=Mi(dl,e.__scopePopover);return l.jsx(nn,{present:n||i.open,children:i.modal?l.jsx(Rle,{...a,ref:t}):l.jsx(Ile,{...a,ref:t})})});W3.displayName=dl;var kle=Sle("PopoverContent.RemoveScroll"),Rle=b.forwardRef((e,t)=>{const r=Mi(dl,e.__scopePopover),n=b.useRef(null),a=at(t,n),i=b.useRef(!1);return b.useEffect(()=>{const o=n.current;if(o)return Zj(o)},[]),l.jsx(zm,{as:kle,allowPinchZoom:!0,children:l.jsx(G3,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ge(e.onCloseAutoFocus,o=>{o.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Ge(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,c=u.button===2||d;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ge(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),Ile=b.forwardRef((e,t)=>{const r=Mi(dl,e.__scopePopover),n=b.useRef(!1),a=b.useRef(!1);return l.jsx(G3,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(n.current||r.triggerRef.current?.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;r.triggerRef.current?.contains(o)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),G3=b.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:h,...p}=e,m=Mi(dl,r),v=Hu(r);return Bj(),l.jsx(Im,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:l.jsx(qu,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:c,onDismiss:()=>m.onOpenChange(!1),children:l.jsx(Yj,{"data-state":X3(m.open),role:"dialog",id:m.contentId,...v,...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)"}})})})}),K3="PopoverClose",Mle=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=Mi(K3,r);return l.jsx(We.button,{type:"button",...n,ref:t,onClick:Ge(e.onClick,()=>a.onOpenChange(!1))})});Mle.displayName=K3;var Dle="PopoverArrow",Lle=b.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,a=Hu(r);return l.jsx(Jj,{...a,...n,ref:t})});Lle.displayName=Dle;function X3(e){return e?"open":"closed"}var $le=z3,Ble=V3,Fle=H3,zle=W3;function ma({...e}){return l.jsx($le,{"data-slot":"popover",...e})}function ga({...e}){return l.jsx(Ble,{"data-slot":"popover-trigger",...e})}function va({className:e,align:t="center",sideOffset:r=4,...n}){return l.jsx(Fle,{children:l.jsx(zle,{"data-slot":"popover-content",align:t,sideOffset:r,className:Ae("bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}var Km="Checkbox",[qle]=Ua(Km),[Ule,i_]=qle(Km);function Vle(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:a,disabled:i,form:o,name:u,onCheckedChange:d,required:c,value:h="on",internal_do_not_use_render:p}=e,[m,v]=jo({prop:r,defaultProp:a??!1,onChange:d,caller:Km}),[x,y]=b.useState(null),[S,_]=b.useState(null),N=b.useRef(!1),O=x?!!o||!!x.closest("form"):!0,A={checked:m,disabled:i,setChecked:v,control:x,setControl:y,name:u,form:o,value:h,hasConsumerStoppedPropagationRef:N,required:c,defaultChecked:bi(a)?!1:a,isFormControl:O,bubbleInput:S,setBubbleInput:_};return l.jsx(Ule,{scope:t,...A,children:Hle(p)?p(A):n})}var Y3="CheckboxTrigger",J3=b.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},a)=>{const{control:i,value:o,disabled:u,checked:d,required:c,setControl:h,setChecked:p,hasConsumerStoppedPropagationRef:m,isFormControl:v,bubbleInput:x}=i_(Y3,e),y=at(a,h),S=b.useRef(d);return b.useEffect(()=>{const _=i?.form;if(_){const N=()=>p(S.current);return _.addEventListener("reset",N),()=>_.removeEventListener("reset",N)}},[i,p]),l.jsx(We.button,{type:"button",role:"checkbox","aria-checked":bi(d)?"mixed":d,"aria-required":c,"data-state":n5(d),"data-disabled":u?"":void 0,disabled:u,value:o,...n,ref:y,onKeyDown:Ge(t,_=>{_.key==="Enter"&&_.preventDefault()}),onClick:Ge(r,_=>{p(N=>bi(N)?!0:!N),x&&v&&(m.current=_.isPropagationStopped(),m.current||_.stopPropagation())})})});J3.displayName=Y3;var Q3=b.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:a,defaultChecked:i,required:o,disabled:u,value:d,onCheckedChange:c,form:h,...p}=e;return l.jsx(Vle,{__scopeCheckbox:r,checked:a,defaultChecked:i,disabled:u,required:o,onCheckedChange:c,name:n,form:h,value:d,internal_do_not_use_render:({isFormControl:m})=>l.jsxs(l.Fragment,{children:[l.jsx(J3,{...p,ref:t,__scopeCheckbox:r}),m&&l.jsx(r5,{__scopeCheckbox:r})]})})});Q3.displayName=Km;var Z3="CheckboxIndicator",e5=b.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...a}=e,i=i_(Z3,r);return l.jsx(nn,{present:n||bi(i.checked)||i.checked===!0,children:l.jsx(We.span,{"data-state":n5(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});e5.displayName=Z3;var t5="CheckboxBubbleInput",r5=b.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:u,disabled:d,name:c,value:h,form:p,bubbleInput:m,setBubbleInput:v}=i_(t5,e),x=at(r,v),y=Qj(i),S=Wj(n);b.useEffect(()=>{const N=m;if(!N)return;const O=window.HTMLInputElement.prototype,C=Object.getOwnPropertyDescriptor(O,"checked").set,E=!a.current;if(y!==i&&C){const T=new Event("click",{bubbles:E});N.indeterminate=bi(i),C.call(N,bi(i)?!1:i),N.dispatchEvent(T)}},[m,y,i,a]);const _=b.useRef(bi(i)?!1:i);return l.jsx(We.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??_.current,required:u,disabled:d,name:c,value:h,form:p,...t,tabIndex:-1,ref:x,style:{...t.style,...S,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});r5.displayName=t5;function Hle(e){return typeof e=="function"}function bi(e){return e==="indeterminate"}function n5(e){return bi(e)?"indeterminate":e?"checked":"unchecked"}function Eu({className:e,...t}){return l.jsx(Q3,{"data-slot":"checkbox",className:Ae("peer border bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:l.jsx(e5,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:l.jsx(JI,{className:"size-3.5"})})})}var MR=1,Wle=.9,Gle=.8,Kle=.17,_1=.1,N1=.999,Xle=.9999,Yle=.99,Jle=/[\\\/_+.#"@\[\(\{&]/,Qle=/[\\\/_+.#"@\[\(\{&]/g,Zle=/[\s-]/,a5=/[\s-]/g;function mS(e,t,r,n,a,i,o){if(i===t.length)return a===e.length?MR:Yle;var u=`${a},${i}`;if(o[u]!==void 0)return o[u];for(var d=n.charAt(i),c=r.indexOf(d,a),h=0,p,m,v,x;c>=0;)p=mS(e,t,r,n,c+1,i+1,o),p>h&&(c===a?p*=MR:Jle.test(e.charAt(c-1))?(p*=Gle,v=e.slice(a,c-1).match(Qle),v&&a>0&&(p*=Math.pow(N1,v.length))):Zle.test(e.charAt(c-1))?(p*=Wle,x=e.slice(a,c-1).match(a5),x&&a>0&&(p*=Math.pow(N1,x.length))):(p*=Kle,a>0&&(p*=Math.pow(N1,c-a))),e.charAt(c)!==t.charAt(i)&&(p*=Xle)),(p<_1&&r.charAt(c-1)===n.charAt(i+1)||n.charAt(i+1)===n.charAt(i)&&r.charAt(c-1)!==n.charAt(i))&&(m=mS(e,t,r,n,c+1,i+2,o),m*_1>p&&(p=m*_1)),p>h&&(h=p),c=r.indexOf(d,c+1);return o[u]=h,h}function DR(e){return e.toLowerCase().replace(a5," ")}function ece(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,mS(e,t,DR(e),DR(t),0,0,{})}var Nc='[cmdk-group=""]',C1='[cmdk-group-items=""]',tce='[cmdk-group-heading=""]',i5='[cmdk-item=""]',LR=`${i5}:not([aria-disabled="true"])`,gS="cmdk-item-select",bs="data-value",rce=(e,t,r)=>ece(e,t,r),o5=b.createContext(void 0),Wu=()=>b.useContext(o5),s5=b.createContext(void 0),o_=()=>b.useContext(s5),l5=b.createContext(void 0),c5=b.forwardRef((e,t)=>{let r=ws(()=>{var D,Z;return{search:"",value:(Z=(D=e.value)!=null?D:e.defaultValue)!=null?Z:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=ws(()=>new Set),a=ws(()=>new Map),i=ws(()=>new Map),o=ws(()=>new Set),u=u5(e),{label:d,children:c,value:h,onValueChange:p,filter:m,shouldFilter:v,loop:x,disablePointerSelection:y=!1,vimBindings:S=!0,..._}=e,N=Lr(),O=Lr(),A=Lr(),C=b.useRef(null),E=hce();Oo(()=>{if(h!==void 0){let D=h.trim();r.current.value=D,T.emit()}},[h]),Oo(()=>{E(6,q)},[]);let T=b.useMemo(()=>({subscribe:D=>(o.current.add(D),()=>o.current.delete(D)),snapshot:()=>r.current,setState:(D,Z,ie)=>{var oe,ne,K,J;if(!Object.is(r.current[D],Z)){if(r.current[D]=Z,D==="search")B(),z(),E(1,F);else if(D==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ee=document.getElementById(A);ee?ee.focus():(oe=document.getElementById(N))==null||oe.focus()}if(E(7,()=>{var ee;r.current.selectedItemId=(ee=H())==null?void 0:ee.id,T.emit()}),ie||E(5,q),((ne=u.current)==null?void 0:ne.value)!==void 0){let ee=Z??"";(J=(K=u.current).onValueChange)==null||J.call(K,ee);return}}T.emit()}},emit:()=>{o.current.forEach(D=>D())}}),[]),R=b.useMemo(()=>({value:(D,Z,ie)=>{var oe;Z!==((oe=i.current.get(D))==null?void 0:oe.value)&&(i.current.set(D,{value:Z,keywords:ie}),r.current.filtered.items.set(D,L(Z,ie)),E(2,()=>{z(),T.emit()}))},item:(D,Z)=>(n.current.add(D),Z&&(a.current.has(Z)?a.current.get(Z).add(D):a.current.set(Z,new Set([D]))),E(3,()=>{B(),z(),r.current.value||F(),T.emit()}),()=>{i.current.delete(D),n.current.delete(D),r.current.filtered.items.delete(D);let ie=H();E(4,()=>{B(),ie?.getAttribute("id")===D&&F(),T.emit()})}),group:D=>(a.current.has(D)||a.current.set(D,new Set),()=>{i.current.delete(D),a.current.delete(D)}),filter:()=>u.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:N,inputId:A,labelId:O,listInnerRef:C}),[]);function L(D,Z){var ie,oe;let ne=(oe=(ie=u.current)==null?void 0:ie.filter)!=null?oe:rce;return D?ne(D,r.current.search,Z):0}function z(){if(!r.current.search||u.current.shouldFilter===!1)return;let D=r.current.filtered.items,Z=[];r.current.filtered.groups.forEach(oe=>{let ne=a.current.get(oe),K=0;ne.forEach(J=>{let ee=D.get(J);K=Math.max(ee,K)}),Z.push([oe,K])});let ie=C.current;V().sort((oe,ne)=>{var K,J;let ee=oe.getAttribute("id"),ce=ne.getAttribute("id");return((K=D.get(ce))!=null?K:0)-((J=D.get(ee))!=null?J:0)}).forEach(oe=>{let ne=oe.closest(C1);ne?ne.appendChild(oe.parentElement===ne?oe:oe.closest(`${C1} > *`)):ie.appendChild(oe.parentElement===ie?oe:oe.closest(`${C1} > *`))}),Z.sort((oe,ne)=>ne[1]-oe[1]).forEach(oe=>{var ne;let K=(ne=C.current)==null?void 0:ne.querySelector(`${Nc}[${bs}="${encodeURIComponent(oe[0])}"]`);K?.parentElement.appendChild(K)})}function F(){let D=V().find(ie=>ie.getAttribute("aria-disabled")!=="true"),Z=D?.getAttribute(bs);T.setState("value",Z||void 0)}function B(){var D,Z,ie,oe;if(!r.current.search||u.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let ne=0;for(let K of n.current){let J=(Z=(D=i.current.get(K))==null?void 0:D.value)!=null?Z:"",ee=(oe=(ie=i.current.get(K))==null?void 0:ie.keywords)!=null?oe:[],ce=L(J,ee);r.current.filtered.items.set(K,ce),ce>0&&ne++}for(let[K,J]of a.current)for(let ee of J)if(r.current.filtered.items.get(ee)>0){r.current.filtered.groups.add(K);break}r.current.filtered.count=ne}function q(){var D,Z,ie;let oe=H();oe&&(((D=oe.parentElement)==null?void 0:D.firstChild)===oe&&((ie=(Z=oe.closest(Nc))==null?void 0:Z.querySelector(tce))==null||ie.scrollIntoView({block:"nearest"})),oe.scrollIntoView({block:"nearest"}))}function H(){var D;return(D=C.current)==null?void 0:D.querySelector(`${i5}[aria-selected="true"]`)}function V(){var D;return Array.from(((D=C.current)==null?void 0:D.querySelectorAll(LR))||[])}function G(D){let Z=V()[D];Z&&T.setState("value",Z.getAttribute(bs))}function U(D){var Z;let ie=H(),oe=V(),ne=oe.findIndex(J=>J===ie),K=oe[ne+D];(Z=u.current)!=null&&Z.loop&&(K=ne+D<0?oe[oe.length-1]:ne+D===oe.length?oe[0]:oe[ne+D]),K&&T.setState("value",K.getAttribute(bs))}function $(D){let Z=H(),ie=Z?.closest(Nc),oe;for(;ie&&!oe;)ie=D>0?dce(ie,Nc):fce(ie,Nc),oe=ie?.querySelector(LR);oe?T.setState("value",oe.getAttribute(bs)):U(D)}let Q=()=>G(V().length-1),k=D=>{D.preventDefault(),D.metaKey?Q():D.altKey?$(1):U(1)},I=D=>{D.preventDefault(),D.metaKey?G(0):D.altKey?$(-1):U(-1)};return b.createElement(We.div,{ref:t,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:D=>{var Z;(Z=_.onKeyDown)==null||Z.call(_,D);let ie=D.nativeEvent.isComposing||D.keyCode===229;if(!(D.defaultPrevented||ie))switch(D.key){case"n":case"j":{S&&D.ctrlKey&&k(D);break}case"ArrowDown":{k(D);break}case"p":case"k":{S&&D.ctrlKey&&I(D);break}case"ArrowUp":{I(D);break}case"Home":{D.preventDefault(),G(0);break}case"End":{D.preventDefault(),Q();break}case"Enter":{D.preventDefault();let oe=H();if(oe){let ne=new Event(gS);oe.dispatchEvent(ne)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:R.inputId,id:R.labelId,style:mce},d),Xm(e,D=>b.createElement(s5.Provider,{value:T},b.createElement(o5.Provider,{value:R},D))))}),nce=b.forwardRef((e,t)=>{var r,n;let a=Lr(),i=b.useRef(null),o=b.useContext(l5),u=Wu(),d=u5(e),c=(n=(r=d.current)==null?void 0:r.forceMount)!=null?n:o?.forceMount;Oo(()=>{if(!c)return u.item(a,o?.id)},[c]);let h=d5(a,i,[e.value,e.children,i],e.keywords),p=o_(),m=ji(E=>E.value&&E.value===h.current),v=ji(E=>c||u.filter()===!1?!0:E.search?E.filtered.items.get(a)>0:!0);b.useEffect(()=>{let E=i.current;if(!(!E||e.disabled))return E.addEventListener(gS,x),()=>E.removeEventListener(gS,x)},[v,e.onSelect,e.disabled]);function x(){var E,T;y(),(T=(E=d.current).onSelect)==null||T.call(E,h.current)}function y(){p.setState("value",h.current,!0)}if(!v)return null;let{disabled:S,value:_,onSelect:N,forceMount:O,keywords:A,...C}=e;return b.createElement(We.div,{ref:Sn(i,t),...C,id:a,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!m,"data-disabled":!!S,"data-selected":!!m,onPointerMove:S||u.getDisablePointerSelection()?void 0:y,onClick:S?void 0:x},e.children)}),ace=b.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...i}=e,o=Lr(),u=b.useRef(null),d=b.useRef(null),c=Lr(),h=Wu(),p=ji(v=>a||h.filter()===!1?!0:v.search?v.filtered.groups.has(o):!0);Oo(()=>h.group(o),[]),d5(o,u,[e.value,e.heading,d]);let m=b.useMemo(()=>({id:o,forceMount:a}),[a]);return b.createElement(We.div,{ref:Sn(u,t),...i,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},r&&b.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:c},r),Xm(e,v=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?c:void 0},b.createElement(l5.Provider,{value:m},v))))}),ice=b.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=b.useRef(null),i=ji(o=>!o.search);return!r&&!i?null:b.createElement(We.div,{ref:Sn(a,t),...n,"cmdk-separator":"",role:"separator"})}),oce=b.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=e.value!=null,i=o_(),o=ji(c=>c.search),u=ji(c=>c.selectedItemId),d=Wu();return b.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),b.createElement(We.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:a?e.value:o,onChange:c=>{a||i.setState("search",c.target.value),r?.(c.target.value)}})}),sce=b.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,i=b.useRef(null),o=b.useRef(null),u=ji(c=>c.selectedItemId),d=Wu();return b.useEffect(()=>{if(o.current&&i.current){let c=o.current,h=i.current,p,m=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let v=c.offsetHeight;h.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return m.observe(c),()=>{cancelAnimationFrame(p),m.unobserve(c)}}},[]),b.createElement(We.div,{ref:Sn(i,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":n,id:d.listId},Xm(e,c=>b.createElement("div",{ref:Sn(o,d.listInnerRef),"cmdk-list-sizer":""},c)))}),lce=b.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:i,container:o,...u}=e;return b.createElement(P3,{open:r,onOpenChange:n},b.createElement(A3,{container:o},b.createElement(T3,{"cmdk-overlay":"",className:a}),b.createElement(k3,{"aria-label":e.label,"cmdk-dialog":"",className:i},b.createElement(c5,{ref:t,...u}))))}),cce=b.forwardRef((e,t)=>ji(r=>r.filtered.count===0)?b.createElement(We.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),uce=b.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...i}=e;return b.createElement(We.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Xm(e,o=>b.createElement("div",{"aria-hidden":!0},o)))}),Pl=Object.assign(c5,{List:sce,Item:nce,Input:oce,Group:ace,Separator:ice,Dialog:lce,Empty:cce,Loading:uce});function dce(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function fce(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function u5(e){let t=b.useRef(e);return Oo(()=>{t.current=e}),t}var Oo=typeof window>"u"?b.useEffect:b.useLayoutEffect;function ws(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function ji(e){let t=o_(),r=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,r,r)}function d5(e,t,r,n=[]){let a=b.useRef(),i=Wu();return Oo(()=>{var o;let u=(()=>{var c;for(let h of r){if(typeof h=="string")return h.trim();if(typeof h=="object"&&"current"in h)return h.current?(c=h.current.textContent)==null?void 0:c.trim():a.current}})(),d=n.map(c=>c.trim());i.value(e,u,d),(o=t.current)==null||o.setAttribute(bs,u),a.current=u}),a}var hce=()=>{let[e,t]=b.useState(),r=ws(()=>new Map);return Oo(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,a)=>{r.current.set(n,a),t({})}};function pce(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Xm({asChild:e,children:t},r){return e&&b.isValidElement(t)?b.cloneElement(pce(t),{ref:t.ref},r(t.props.children)):r(t)}var mce={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function f5({className:e,...t}){return l.jsx(Pl,{"data-slot":"command",className:Ae("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function h5({className:e,...t}){return l.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[l.jsx(Kp,{className:"size-4 shrink-0 opacity-50"}),l.jsx(Pl.Input,{"data-slot":"command-input",className:Ae("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function p5({className:e,...t}){return l.jsx(Pl.List,{"data-slot":"command-list",className:Ae("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function m5({...e}){return l.jsx(Pl.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function vS({className:e,...t}){return l.jsx(Pl.Group,{"data-slot":"command-group",className:Ae("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function yS({className:e,...t}){return l.jsx(Pl.Item,{"data-slot":"command-item",className:Ae("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function na({value:e,onValueChange:t,options:r,placeholder:n="Select…",searchPlaceholder:a="Search…",emptyText:i="No matching results.",disabled:o,className:u}){const[d,c]=b.useState(!1),h=e?r.find(m=>m.value===e):void 0,p=e?h?.label??e:null;return l.jsxs(ma,{open:d,onOpenChange:c,children:[l.jsx(ga,{asChild:!0,children:l.jsxs(fe,{type:"button",variant:"outline",role:"combobox","aria-expanded":d,disabled:o,className:Ae("w-full justify-between h-10 px-3 font-normal border border-gray-300 bg-white",u),children:[l.jsx("span",{className:Ae("truncate text-left text-sm",!p&&"text-gray-500"),children:p??n}),l.jsx(ZI,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),l.jsxs(va,{className:"p-0 w-[var(--radix-popover-trigger-width)] max-w-[min(100vw-2rem,400px)]",align:"start",children:[l.jsxs(f5,{children:[l.jsx(h5,{placeholder:a}),l.jsxs(p5,{children:[l.jsx(m5,{children:i}),l.jsx(vS,{children:r.map(m=>l.jsx(yS,{value:`${m.label} ${m.value}`,onSelect:()=>{t(m.value),c(!1)},className:Ae("cursor-pointer rounded-md px-2 py-2 transition-colors","hover:bg-gray-100 hover:text-gray-900","data-[selected=true]:bg-gray-100",e===m.value&&"bg-blue-50 text-gray-900 font-medium data-[selected=true]:bg-blue-100"),children:l.jsx("span",{className:"truncate",children:m.label})},m.value))})]})]}),e?l.jsx("div",{className:"border-t border-gray-100 px-2 py-1.5",children:l.jsx("button",{type:"button",className:"text-xs text-gray-500 hover:text-gray-900 underline-offset-2 hover:underline",onClick:()=>{t(""),c(!1)},children:"Clear selection"})}):null]})]})}function _i({className:e,...t}){return l.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:Ae("mx-auto flex w-full justify-center",e),...t})}function Ni({className:e,...t}){return l.jsx("ul",{"data-slot":"pagination-content",className:Ae("flex flex-row items-center gap-1",e),...t})}function At({...e}){return l.jsx("li",{"data-slot":"pagination-item",...e})}function ua({className:e,isActive:t,size:r="icon",...n}){return l.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:Ae(MM({variant:t?"outline":"ghost",size:r}),e),...n})}function Ci({className:e,...t}){return l.jsxs(ua,{"aria-label":"Go to previous page",size:"default",className:Ae("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[l.jsx(QI,{}),l.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function Oi({className:e,...t}){return l.jsxs(ua,{"aria-label":"Go to next page",size:"default",className:Ae("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[l.jsx("span",{className:"hidden sm:block",children:"Next"}),l.jsx(Ms,{})]})}class gce extends Error{status;payload;constructor(t,r,n){super(t),this.name="ApiError",this.status=r,this.payload=n}}function vce(e,t){if(!e)return t;const r=e.endsWith("/")?e.slice(0,-1):e,n=t.startsWith("/")?t:`/${t}`;return`${r}${n}`}function yce(e){const t=new URLSearchParams;for(const[n,a]of Object.entries(e))if(!(a==null||a==="")){if(typeof a=="boolean"){t.set(n,a?"true":"false");continue}t.set(n,String(a))}const r=t.toString();return r?`?${r}`:""}function xce(e){const r=e?.error?.message?.trim();return r||null}function $R(e){if(Array.isArray(e))return{items:e,totalCount:e.length};if(!e||typeof e!="object")return e;const t=e,r="TotalCount"in t||"Items"in t,n="totalCount"in t||"items"in t;if(r&&!n)return{...t,totalCount:t.TotalCount,items:t.Items};if(!("items"in t)&&Array.isArray(t.data)&&typeof t.totalCount=="number")return{...t,items:t.data};if(!("items"in t)&&Array.isArray(t.Data)&&typeof t.TotalCount=="number")return{...t,totalCount:t.TotalCount,items:t.Data};if(Array.isArray(t.items)&&typeof t.totalCount!="number"){const a=t.TotalCount;return{...t,totalCount:typeof a=="number"?a:t.items.length}}return e}function an(e={}){const t=e.baseUrl??"http://flus-test.3ffoodsafety.com"??"http://localhost:19001",r=e.getToken;async function n(a){const i=a.prefix??"/api/app",o=vce(t,`${i}${a.path}${yce(a.query??{})}`),u={"Content-Type":"application/json"},d=r?.();d&&(u.Authorization=`Bearer ${d}`);const c=await fetch(o,{method:a.method,headers:u,body:a.body===void 0?void 0:JSON.stringify(a.body),signal:a.signal}),m=(c.headers.get("content-type")??"").includes("application/json")?await c.json().catch(()=>null):await c.text().catch(()=>"");if(!c.ok){const x=xce(m)??(typeof m=="string"&&m.trim()?m:"Request failed.");throw new gce(x,c.status,m)}return m&&typeof m=="object"&&"data"in m?$R(m.data??null):$R(m)}return{requestJson:n}}const Gu=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),Ku="/label";async function bce(e,t){return Gu.requestJson({path:Ku,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,LocationId:e.locationId,ProductId:e.productId,LabelCategoryId:e.labelCategoryId,LabelTypeId:e.labelTypeId,TemplateCode:e.templateCode,State:e.state},signal:t})}async function wce(e,t){return Gu.requestJson({path:`${Ku}/${encodeURIComponent(e)}`,method:"GET",signal:t})}async function Sce(e){return Gu.requestJson({path:Ku,method:"POST",body:{labelCode:e.labelCode,labelName:e.labelName,templateCode:e.templateCode,locationId:e.locationId,labelCategoryId:e.labelCategoryId,labelTypeId:e.labelTypeId,productIds:e.productIds,labelInfoJson:e.labelInfoJson,state:e.state??!0}})}async function jce(e,t){return Gu.requestJson({path:`${Ku}/${encodeURIComponent(e)}`,method:"PUT",body:{labelName:t.labelName,templateCode:t.templateCode,locationId:t.locationId,labelCategoryId:t.labelCategoryId,labelTypeId:t.labelTypeId,productIds:t.productIds,labelInfoJson:t.labelInfoJson,state:t.state??!0}})}async function _ce(e){await Gu.requestJson({path:`${Ku}/${encodeURIComponent(e)}`,method:"DELETE"})}const Ym=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}});async function Al(e,t){return Ym.requestJson({path:"/location",method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,Partner:e.partner,GroupName:e.groupName,State:e.state},signal:t})}async function Nce(e){return Ym.requestJson({path:"/location",method:"POST",body:{partner:e.partner,groupName:e.groupName,locationCode:e.locationCode,locationName:e.locationName,street:e.street,city:e.city,stateCode:e.stateCode,country:e.country,zipCode:e.zipCode,phone:e.phone,email:e.email,latitude:e.latitude,longitude:e.longitude,state:e.state??!0}})}async function Cce(e,t){return Ym.requestJson({path:`/location/${encodeURIComponent(e)}`,method:"PUT",body:{partner:t.partner,groupName:t.groupName,locationCode:t.locationCode,locationName:t.locationName,street:t.street,city:t.city,stateCode:t.stateCode,country:t.country,zipCode:t.zipCode,phone:t.phone,email:t.email,latitude:t.latitude,longitude:t.longitude,state:t.state??!0}})}async function Oce(e){await Ym.requestJson({path:`/location/${encodeURIComponent(e)}`,method:"DELETE"})}const Jm=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),Qm="/label-category";async function s_(e,t){return Jm.requestJson({path:Qm,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,State:e.state},signal:t})}async function Ece(e){return Jm.requestJson({path:Qm,method:"POST",body:{categoryCode:e.categoryCode,categoryName:e.categoryName,categoryPhotoUrl:e.categoryPhotoUrl,state:e.state??!0,orderNum:e.orderNum}})}async function Pce(e,t){return Jm.requestJson({path:`${Qm}/${encodeURIComponent(e)}`,method:"PUT",body:{categoryCode:t.categoryCode,categoryName:t.categoryName,categoryPhotoUrl:t.categoryPhotoUrl,state:t.state??!0,orderNum:t.orderNum}})}async function Ace(e){await Jm.requestJson({path:`${Qm}/${encodeURIComponent(e)}`,method:"DELETE"})}const Zm=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),eg="/label-type";async function g5(e,t){return Zm.requestJson({path:eg,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,State:e.state},signal:t})}async function Tce(e){return Zm.requestJson({path:eg,method:"POST",body:{typeCode:e.typeCode,typeName:e.typeName,state:e.state??!0,orderNum:e.orderNum}})}async function kce(e,t){return Zm.requestJson({path:`${eg}/${encodeURIComponent(e)}`,method:"PUT",body:{typeCode:t.typeCode,typeName:t.typeName,state:t.state??!0,orderNum:t.orderNum}})}async function Rce(e){await Zm.requestJson({path:`${eg}/${encodeURIComponent(e)}`,method:"DELETE"})}const Xu=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),Yu="/label-template";function Ice(e){const t=e;if(!t||typeof t!="object")return"";const r=t.id??t.templateCode??t.TemplateCode;return typeof r=="string"?r.trim():String(r??"").trim()}function tg(e){const t=e,n=((Array.isArray(t.appliedLocationIds)?t.appliedLocationIds:null)??(Array.isArray(t.AppliedLocationIds)?t.AppliedLocationIds:null)??[]).map(v=>String(v)),a=Ice(e),i=t.templateName??t.TemplateName,o=t.templateCode??t.TemplateCode,u=t.locationText??t.LocationText,d=t.sizeText??t.SizeText,c=t.contentsCount??t.ContentsCount,h=typeof c=="number"?c:void 0,p=t.lastEdited??t.LastEdited,m=(typeof t.name=="string"&&t.name.trim()?t.name:null)??(typeof i=="string"&&String(i).trim()?String(i):null);return{...t,id:a,name:m??t.name,templateName:(typeof i=="string"?i:null)??t.templateName,templateCode:(typeof o=="string"?o:null)??t.templateCode,locationText:(typeof u=="string"?u:null)??t.locationText,sizeText:(typeof d=="string"?d:null)??t.sizeText,contentsCount:h??t.contentsCount,lastEdited:(typeof p=="string"?p:null)??t.lastEdited,appliedLocationIds:n,elements:Array.isArray(t.elements)?t.elements:[]}}async function v5(e,t){const r=await Xu.requestJson({path:Yu,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,LocationId:e.locationId,LabelType:e.labelType,State:e.state},signal:t}),n=(r.items??[]).map(a=>tg(a));return{...r,items:n}}async function Mce(e,t){const r=await Xu.requestJson({path:`${Yu}/${encodeURIComponent(e)}`,method:"GET",signal:t});return tg(r)}async function Dce(e){const t=await Xu.requestJson({path:Yu,method:"POST",body:{id:e.id,name:e.name,labelType:e.labelType,unit:e.unit,width:e.width,height:e.height,appliedLocation:e.appliedLocation,showRuler:e.showRuler??!0,showGrid:e.showGrid??!0,state:e.state??!0,elements:e.elements,appliedLocationIds:e.appliedLocationIds??[]}});return tg(t)}async function Lce(e,t){const r=await Xu.requestJson({path:`${Yu}/${encodeURIComponent(e)}`,method:"PUT",body:{id:t.id,name:t.name,labelType:t.labelType,unit:t.unit,width:t.width,height:t.height,appliedLocation:t.appliedLocation,showRuler:t.showRuler??!0,showGrid:t.showGrid??!0,state:t.state??!0,elements:t.elements,appliedLocationIds:t.appliedLocationIds??[]}});return tg(r)}async function $ce(e){await Xu.requestJson({path:`${Yu}/${encodeURIComponent(e)}`,method:"DELETE"})}const Ju=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),Qu="/product";function rg(e){const t=e,r=String(t?.id??t?.Id??"").trim();return{...t,id:r,productCode:t?.productCode??t?.ProductCode,productName:t?.productName??t?.ProductName,categoryName:t?.categoryName??t?.CategoryName,productImageUrl:t?.productImageUrl??t?.ProductImageUrl,state:typeof t?.state=="boolean"?t.state:typeof t?.State=="boolean"?t.State:null}}async function xS(e,t){const r=await Ju.requestJson({path:Qu,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,State:e.state},signal:t});return{...r,items:(r.items??[]).map(n=>rg(n))}}async function Bce(e,t){const r=await Ju.requestJson({path:`${Qu}/${encodeURIComponent(e)}`,method:"GET",signal:t});return rg(r)}async function Fce(e){const t=await Ju.requestJson({path:Qu,method:"POST",body:{productCode:e.productCode,productName:e.productName,categoryName:e.categoryName??null,productImageUrl:e.productImageUrl??null,state:e.state??!0}});return rg(t)}async function zce(e,t){const r=await Ju.requestJson({path:`${Qu}/${encodeURIComponent(e)}`,method:"PUT",body:{productCode:t.productCode,productName:t.productName,categoryName:t.categoryName??null,productImageUrl:t.productImageUrl??null,state:t.state??!0}});return rg(r)}async function qce(e){await Ju.requestJson({path:`${Qu}/${encodeURIComponent(e)}`,method:"DELETE"})}function Un(e){const t=(e??"").trim();return t||"None"}function Uce(e){return(e.labelCode??e.id??"").trim()||"None"}function Vce(e){const t=(e.productName??"").trim();if(t)return t;const r=e.productIds?.length??0;return r>0?`${r} product(s)`:"None"}function Hce(e){const t=(e.lastEdited??"").trim();if(t)return t;const r=e.creationTime;if(r)try{return new Date(r).toLocaleString()}catch{return String(r)}return"None"}function BR(e){const t=e.productIds;return{labelName:e.labelName??"",templateCode:e.templateCode??"",locationId:e.locationId??"",labelCategoryId:e.labelCategoryId??"",labelTypeId:e.labelTypeId??"",productIds:Array.isArray(t)?[...t]:[],labelInfoJson:e.labelInfoJson??null,state:e.state??!0}}function Pu(e){return(e.templateCode??e.id??"").trim()}function y5(e){const t=(e.templateName??e.name??"").trim()||"None",r=Pu(e)||"None";return`${t} (${r})`}function x5(e){const[t,r]=b.useState(!1),[n,a]=b.useState([]),[i,o]=b.useState([]),[u,d]=b.useState([]),[c,h]=b.useState([]),[p,m]=b.useState([]);b.useEffect(()=>{if(!e)return;let x=!1;return(async()=>{r(!0);try{const[y,S,_,N,O]=await Promise.all([v5({skipCount:0,maxResultCount:500}),Al({skipCount:0,maxResultCount:500}),s_({skipCount:0,maxResultCount:500}),g5({skipCount:0,maxResultCount:500}),xS({skipCount:0,maxResultCount:500})]);if(x)return;a(y.items??[]),o(S.items??[]),d(_.items??[]),h(N.items??[]),m(O.items??[])}catch(y){x||(xe.error("Failed to load options",{description:y?.message?String(y.message):"Check network or sign-in."}),a([]),o([]),d([]),h([]),m([]))}finally{x||r(!1)}})(),()=>{x=!0}},[e]);const v=b.useMemo(()=>p.map(x=>{const y=(x.productName??x.productCode??"").trim()||x.id;return{id:x.id,name:y}}),[p]);return{loading:t,templates:n,locations:i,categories:u,types:c,productOptions:v}}function b5({value:e,onChange:t,disabled:r,productOptions:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>{if(e.length===0)return"Select products (multi-select)";const c=e.map(p=>n.find(m=>m.id===p)?.name??p).slice(0,2),h=e.length>2?`, ${e.length} total`:"";return`${c.join(", ")}${h}`},[e,n]),u=b.useCallback((c,h)=>{const p=new Set(e);h?p.add(c):p.delete(c),t(Array.from(p))},[e,t]),d=b.useMemo(()=>e.filter(c=>!n.some(h=>h.id===c)),[e,n]);return l.jsxs(ma,{open:a,onOpenChange:i,children:[l.jsx(ga,{asChild:!0,children:l.jsxs(fe,{type:"button",variant:"outline",role:"combobox",disabled:r,className:"w-full justify-between h-10 px-3 font-normal border border-gray-300 bg-white",children:[l.jsx("span",{className:"truncate text-left text-sm",children:o}),l.jsx(ZI,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),l.jsx(va,{className:"w-[var(--radix-popover-trigger-width)] max-w-[min(100vw-2rem,400px)] p-0",align:"start",children:l.jsxs(f5,{children:[l.jsx(h5,{placeholder:"Search products…"}),l.jsxs(p5,{children:[l.jsx(m5,{children:"No matching products."}),l.jsxs(vS,{children:[n.map(c=>l.jsxs(yS,{value:`${c.name} ${c.id}`,onSelect:()=>{u(c.id,!e.includes(c.id))},className:"cursor-pointer",children:[l.jsx(Eu,{className:"pointer-events-none",checked:e.includes(c.id)}),l.jsxs("span",{className:"flex-1 min-w-0",children:[l.jsx("span",{className:"font-medium",children:c.name}),l.jsx("span",{className:"block text-xs text-gray-400 truncate",children:c.id})]})]},c.id)),d.length>0?l.jsx(vS,{heading:"Linked (not in current list, can deselect)",children:d.map(c=>l.jsxs(yS,{value:c,onSelect:()=>{u(c,!e.includes(c))},className:"cursor-pointer",children:[l.jsx(Eu,{className:"pointer-events-none",checked:e.includes(c)}),l.jsx("span",{className:"text-xs font-mono truncate",children:c})]},c))}):null]})]})]})})]})}function Wce(){const[e,t]=b.useState(!1),[r,n]=b.useState(!1),[a,i]=b.useState(!1),[o,u]=b.useState(null),[d,c]=b.useState(null),[h,p]=b.useState([]),[m,v]=b.useState(!1),[x,y]=b.useState(0),[S,_]=b.useState(0),[N,O]=b.useState(null),[A,C]=b.useState(""),[E,T]=b.useState("all"),[R,L]=b.useState("all"),[z,F]=b.useState("all"),[B,q]=b.useState("all"),[H,V]=b.useState("all"),[G,U]=b.useState(1),[$,Q]=b.useState(10),k=b.useRef(null),I=b.useRef(null),[D,Z]=b.useState("");b.useEffect(()=>(I.current&&window.clearTimeout(I.current),I.current=window.setTimeout(()=>Z(A.trim()),300),()=>{I.current&&window.clearTimeout(I.current)}),[A]);const ie=Math.max(1,Math.ceil(x/$));b.useEffect(()=>{U(1)},[D,E,R,z,B,H,$]),b.useEffect(()=>((async()=>{k.current?.abort();const ee=new AbortController;k.current=ee,v(!0);try{const ce=(G-1)*$,pe=await bce({skipCount:ce,maxResultCount:$,keyword:D||void 0,locationId:E!=="all"?E:void 0,labelCategoryId:R!=="all"?R:void 0,labelTypeId:z!=="all"?z:void 0,templateCode:B!=="all"?B:void 0,state:H==="all"?void 0:H==="true"},ee.signal);p(pe.items??[]),y(pe.totalCount??0)}catch(ce){if(ce?.name==="AbortError")return;xe.error("Failed to load labels.",{description:ce?.message?String(ce.message):"Please try again."}),p([]),y(0)}finally{v(!1)}})(),()=>k.current?.abort()),[D,E,R,z,B,H,G,$,S]);const oe=()=>_(J=>J+1),ne=J=>{O(null),u(J),n(!0)},K=J=>{O(null),c(J),i(!0)};return l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsx("div",{className:"pb-4",children:l.jsx("div",{className:"flex flex-col gap-4",children:l.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[l.jsx(me,{placeholder:"Search",value:A,onChange:J=>C(J.target.value),style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),l.jsxs(Ke,{value:E,onValueChange:T,children:[l.jsx(Ye,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Location"})}),l.jsx(Je,{children:l.jsx(Ne,{value:"all",children:"All Locations"})})]}),l.jsxs(Ke,{value:R,onValueChange:L,children:[l.jsx(Ye,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Category"})}),l.jsx(Je,{children:l.jsx(Ne,{value:"all",children:"All Categories"})})]}),l.jsxs(Ke,{value:z,onValueChange:F,children:[l.jsx(Ye,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Type"})}),l.jsx(Je,{children:l.jsx(Ne,{value:"all",children:"All Types"})})]}),l.jsxs(Ke,{value:H,onValueChange:V,children:[l.jsx(Ye,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"State"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"all",children:"All States"}),l.jsx(Ne,{value:"true",children:"Active"}),l.jsx(Ne,{value:"false",children:"Inactive"})]})]}),l.jsx("div",{className:"flex-1"}),l.jsxs(fe,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0",onClick:()=>t(!0),children:["New Label ",l.jsx(wn,{className:"ml-1 h-4 w-4"})]})]})})}),l.jsx("div",{className:"flex-1 overflow-auto pt-6",children:l.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-50 hover:bg-gray-50",children:[l.jsx(ve,{className:"font-bold text-gray-900 w-[120px]",children:"Label Code"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[140px]",children:"Label Name"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[120px]",children:"Location"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[140px]",children:"Category"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[140px]",children:"Type"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[120px]",children:"Template"}),l.jsx(ve,{className:"font-bold text-gray-900",children:"Products"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[100px]",children:"State"}),l.jsx(ve,{className:"font-bold text-gray-900",children:"Last Edited"}),l.jsx(ve,{className:"font-bold text-gray-900 text-center w-[100px]",children:"Actions"})]})}),l.jsx(Pr,{children:m?l.jsx(Be,{children:l.jsx(de,{colSpan:10,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):h.length===0?l.jsx(Be,{children:l.jsx(de,{colSpan:10,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):h.map(J=>l.jsxs(Be,{className:"hover:bg-gray-50",children:[l.jsx(de,{className:"font-medium whitespace-nowrap",children:Uce(J)}),l.jsx(de,{className:"whitespace-nowrap",children:Un(J.labelName)}),l.jsx(de,{className:"text-gray-600 whitespace-nowrap",children:Un(J.locationName??J.locationId)}),l.jsx(de,{className:"text-gray-600 whitespace-nowrap",children:Un(J.labelCategoryName??J.labelCategoryId)}),l.jsx(de,{className:"text-gray-600 whitespace-nowrap",children:Un(J.labelTypeName??J.labelTypeId)}),l.jsx(de,{className:"text-gray-600 whitespace-nowrap",children:Un(J.templateName??J.templateCode)}),l.jsx(de,{className:"text-gray-600 whitespace-nowrap",children:Vce(J)}),l.jsx(de,{children:l.jsx(xr,{className:J.state===!0?"bg-green-600":"bg-gray-400",children:J.state===!0?"Active":"Inactive"})}),l.jsx(de,{className:"text-gray-500 tabular-nums font-numeric whitespace-nowrap",children:Hce(J)}),l.jsx(de,{className:"text-center",children:l.jsxs(ma,{open:N===J.id,onOpenChange:ee=>O(ee?J.id:null),children:[l.jsx(ga,{asChild:!0,children:l.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:l.jsx(Ei,{className:"h-4 w-4 text-gray-500"})})}),l.jsxs(va,{align:"end",className:"w-40 p-1",children:[l.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>ne(J),children:[l.jsx(xn,{className:"w-4 h-4"}),"Edit"]}),l.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>K(J),children:"Delete"})]})]})})]},J.id))})]})})}),l.jsx("div",{className:"pt-4",children:l.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[l.jsxs("div",{children:["Showing ",x===0?0:(G-1)*$+1,"-",Math.min(G*$,x)," of ",x]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Ke,{value:String($),onValueChange:J=>Q(Number(J)),children:[l.jsx(Ye,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:l.jsx(Xe,{})}),l.jsx(Je,{children:[10,20,50].map(J=>l.jsxs(Ne,{value:String(J),children:[J," / page"]},J))})]}),l.jsx(_i,{className:"mx-0 w-auto justify-end",children:l.jsxs(Ni,{children:[l.jsx(At,{children:l.jsx(Ci,{href:"#",size:"default",onClick:J=>{J.preventDefault(),U(ee=>Math.max(1,ee-1))},"aria-disabled":G<=1,className:G<=1?"pointer-events-none opacity-50":""})}),l.jsx(At,{children:l.jsxs(ua,{href:"#",isActive:!0,size:"default",onClick:J=>J.preventDefault(),children:["Page ",G," / ",ie]})}),l.jsx(At,{children:l.jsx(Oi,{href:"#",size:"default",onClick:J=>{J.preventDefault(),U(ee=>Math.min(ie,ee+1))},"aria-disabled":G>=ie,className:G>=ie?"pointer-events-none opacity-50":""})})]})})]})]})}),l.jsx(Gce,{open:e,onOpenChange:t,onCreated:()=>{U(1),oe()}}),l.jsx(Kce,{open:r,label:o,onOpenChange:J=>{n(J),J||u(null)},onUpdated:oe}),l.jsx(Xce,{open:a,label:d,onOpenChange:J=>{i(J),J||c(null)},onDeleted:oe})]})}function Gce({open:e,onOpenChange:t,onCreated:r}){const{loading:n,templates:a,locations:i,categories:o,types:u,productOptions:d}=x5(e),[c,h]=b.useState(!1),[p,m]=b.useState({labelCode:"",labelName:"",templateCode:"",locationId:"",labelCategoryId:"",labelTypeId:"",productIds:[],labelInfoJson:null,state:!0}),v=()=>{m({labelCode:"",labelName:"",templateCode:"",locationId:"",labelCategoryId:"",labelTypeId:"",productIds:[],labelInfoJson:null,state:!0})};b.useEffect(()=>{e||v()},[e]);const x=async()=>{if(!p.labelCode.trim()||!p.labelName.trim()||!p.templateCode.trim()||!p.locationId.trim()||!p.labelCategoryId.trim()||!p.labelTypeId.trim()){xe.error("Validation failed",{description:"Fill all required fields and select template, location, category, and type."});return}if(p.productIds.length===0){xe.error("Validation failed",{description:"Select at least one product."});return}h(!0);try{await Sce(p),xe.success("Label created.",{description:"The label has been created successfully."}),t(!1),r()}catch(O){xe.error("Failed to create label.",{description:O?.message?String(O.message):"Please try again."})}finally{h(!1)}},y=b.useMemo(()=>a.filter(O=>Pu(O)).map(O=>({value:Pu(O),label:y5(O)})),[a]),S=b.useMemo(()=>i.map(O=>({value:O.id,label:Un(O.locationName??O.locationCode??O.id)})),[i]),_=b.useMemo(()=>o.map(O=>({value:O.id,label:Un(O.categoryName??O.categoryCode??O.id)})),[o]),N=b.useMemo(()=>u.map(O=>({value:O.id,label:Un(O.typeName??O.typeCode??O.id)})),[u]);return l.jsx(mt,{open:e,onOpenChange:t,children:l.jsxs(ft,{className:"sm:max-w-[600px]",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Add New Label"}),l.jsx(Nt,{children:"Enter the details for the new label."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Label Code *"}),l.jsx(me,{className:"h-10",placeholder:"e.g. LBL_TEST_001",value:p.labelCode,onChange:O=>m(A=>({...A,labelCode:O.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Label Name *"}),l.jsx(me,{className:"h-10",placeholder:"e.g. Breakfast label",value:p.labelName,onChange:O=>m(A=>({...A,labelName:O.target.value}))})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Label Template *"}),l.jsx(na,{value:p.templateCode,onValueChange:O=>m(A=>({...A,templateCode:O})),options:y,placeholder:"Select template",searchPlaceholder:"Search template…",emptyText:"No templates found.",disabled:n})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Location *"}),l.jsx(na,{value:p.locationId,onValueChange:O=>m(A=>({...A,locationId:O})),options:S,placeholder:"Select location",searchPlaceholder:"Search location…",emptyText:"No locations found.",disabled:n})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Label Category *"}),l.jsx(na,{value:p.labelCategoryId,onValueChange:O=>m(A=>({...A,labelCategoryId:O})),options:_,placeholder:"Select category",searchPlaceholder:"Search category…",emptyText:"No categories found.",disabled:n})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Label Type *"}),l.jsx(na,{value:p.labelTypeId,onValueChange:O=>m(A=>({...A,labelTypeId:O})),options:N,placeholder:"Select type",searchPlaceholder:"Search type…",emptyText:"No types found.",disabled:n})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Product * (multi-select)"}),l.jsx(b5,{value:p.productIds,onChange:O=>m(A=>({...A,productIds:O})),disabled:n,productOptions:d})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),l.jsx(qt,{checked:p.state,onCheckedChange:O=>m(A=>({...A,state:O}))})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsx(fe,{disabled:c||n,onClick:x,children:c?"Creating…":"Create"})]})]})})}function Kce({open:e,label:t,onOpenChange:r,onUpdated:n}){const{loading:a,templates:i,locations:o,categories:u,types:d,productOptions:c}=x5(e),[h,p]=b.useState(!1),[m,v]=b.useState(!1),[x,y]=b.useState({labelName:"",templateCode:"",locationId:"",labelCategoryId:"",labelTypeId:"",productIds:[],labelInfoJson:null,state:!0});b.useEffect(()=>{if(!e||!t?.id)return;const C=t.id;y(BR(t));const E=new AbortController;let T=!1;return v(!0),(async()=>{try{const R=await wce(C,E.signal);if(T)return;y(BR(R))}catch(R){if(T||R?.name==="AbortError")return;xe.error("Failed to load label details.",{description:R?.message?String(R.message):"Form shows list data only; check network."})}finally{T||v(!1)}})(),()=>{T=!0,E.abort()}},[e,t]);const S=async()=>{if(t?.id){if(!x.labelName.trim()||!x.templateCode.trim()||!x.locationId.trim()||!x.labelCategoryId.trim()||!x.labelTypeId.trim()){xe.error("Validation failed",{description:"Fill all required fields and select template, location, category, and type."});return}if(x.productIds.length===0){xe.error("Validation failed",{description:"Select at least one product."});return}p(!0);try{await jce(t.id,x),xe.success("Label updated.",{description:"The label has been updated successfully."}),r(!1),n()}catch(C){xe.error("Failed to update label.",{description:C?.message?String(C.message):"Please try again."})}finally{p(!1)}}},_=b.useMemo(()=>{const C=i.filter(T=>Pu(T)).map(T=>({value:Pu(T),label:y5(T)})),E=x.templateCode;return E&&!C.some(T=>T.value===E)?[{value:E,label:`${E} (current)`},...C]:C},[i,x.templateCode]),N=b.useMemo(()=>{const C=o.map(T=>({value:T.id,label:Un(T.locationName??T.locationCode??T.id)})),E=x.locationId;return E&&!C.some(T=>T.value===E)?[{value:E,label:`${E} (current)`},...C]:C},[o,x.locationId]),O=b.useMemo(()=>{const C=u.map(T=>({value:T.id,label:Un(T.categoryName??T.categoryCode??T.id)})),E=x.labelCategoryId;return E&&!C.some(T=>T.value===E)?[{value:E,label:`${E} (current)`},...C]:C},[u,x.labelCategoryId]),A=b.useMemo(()=>{const C=d.map(T=>({value:T.id,label:Un(T.typeName??T.typeCode??T.id)})),E=x.labelTypeId;return E&&!C.some(T=>T.value===E)?[{value:E,label:`${E} (current)`},...C]:C},[d,x.labelTypeId]);return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-[600px]",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Edit Label"}),l.jsx(Nt,{children:m?"Loading label details…":"Update the label details."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Label Name *"}),l.jsx(me,{className:"h-10",placeholder:"e.g. Breakfast label",value:x.labelName,onChange:C=>y(E=>({...E,labelName:C.target.value})),disabled:m})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Label Template *"}),l.jsx(na,{value:x.templateCode,onValueChange:C=>y(E=>({...E,templateCode:C})),options:_,placeholder:"Select template",searchPlaceholder:"Search template…",emptyText:"No templates found.",disabled:a||m})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Location *"}),l.jsx(na,{value:x.locationId,onValueChange:C=>y(E=>({...E,locationId:C})),options:N,placeholder:"Select location",searchPlaceholder:"Search location…",emptyText:"No locations found.",disabled:a||m})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Label Category *"}),l.jsx(na,{value:x.labelCategoryId,onValueChange:C=>y(E=>({...E,labelCategoryId:C})),options:O,placeholder:"Select category",searchPlaceholder:"Search category…",emptyText:"No categories found.",disabled:a||m})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Label Type *"}),l.jsx(na,{value:x.labelTypeId,onValueChange:C=>y(E=>({...E,labelTypeId:C})),options:A,placeholder:"Select type",searchPlaceholder:"Search type…",emptyText:"No types found.",disabled:a||m})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Product * (multi-select)"}),l.jsx(b5,{value:x.productIds,onChange:C=>y(E=>({...E,productIds:C})),disabled:a||m,productOptions:c})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),l.jsx(qt,{checked:x.state,onCheckedChange:C=>y(E=>({...E,state:C})),disabled:m})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{disabled:h||a||m,onClick:S,children:h?"Updating…":"Update"})]})]})})}function Xce({open:e,label:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>(t?.labelName??"").trim()||t?.labelCode||t?.id||"this label",[t]),u=async()=>{if(t?.id){i(!0);try{await _ce(t.id),xe.success("Label deleted.",{description:"The label has been removed successfully."}),r(!1),n()}catch(d){xe.error("Failed to delete label.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-none",style:{width:"30%"},children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Delete Label"}),l.jsx(Nt,{children:"This action cannot be undone."})]}),l.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",l.jsx("span",{className:"font-medium",children:o}),"?"]}),l.jsxs(xt,{className:"flex-row flex-wrap justify-end",children:[l.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function O1(e){const t=(e??"").trim();return t||"None"}function Yce(){const[e,t]=b.useState(!1),[r,n]=b.useState(!1),[a,i]=b.useState(!1),[o,u]=b.useState(null),[d,c]=b.useState(null),[h,p]=b.useState([]),[m,v]=b.useState(!1),[x,y]=b.useState(0),[S,_]=b.useState(0),[N,O]=b.useState(null),[A,C]=b.useState(""),[E,T]=b.useState("all"),[R,L]=b.useState(1),[z,F]=b.useState(10),B=b.useRef(null),q=b.useRef(null),[H,V]=b.useState("");b.useEffect(()=>(q.current&&window.clearTimeout(q.current),q.current=window.setTimeout(()=>V(A.trim()),300),()=>{q.current&&window.clearTimeout(q.current)}),[A]);const G=Math.max(1,Math.ceil(x/z));b.useEffect(()=>{L(1)},[H,E,z]),b.useEffect(()=>((async()=>{B.current?.abort();const I=new AbortController;B.current=I,v(!0);try{const D=(R-1)*z,Z=await s_({skipCount:D,maxResultCount:z,keyword:H||void 0,state:E==="all"?void 0:E==="true"},I.signal);p(Z.items??[]),y(Z.totalCount??0)}catch(D){if(D?.name==="AbortError")return;xe.error("Failed to load label categories.",{description:D?.message?String(D.message):"Please try again."}),p([]),y(0)}finally{v(!1)}})(),()=>B.current?.abort()),[H,E,R,z,S]);const U=()=>_(k=>k+1),$=k=>{O(null),u(k),n(!0)},Q=k=>{O(null),c(k),i(!0)};return l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsx("div",{className:"pb-4",children:l.jsx("div",{className:"flex flex-col gap-4",children:l.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[l.jsx(me,{placeholder:"Search",value:A,onChange:k=>C(k.target.value),style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),l.jsxs(Ke,{value:E,onValueChange:T,children:[l.jsx(Ye,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"State"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"all",children:"All States"}),l.jsx(Ne,{value:"true",children:"Active"}),l.jsx(Ne,{value:"false",children:"Inactive"})]})]}),l.jsx("div",{className:"flex-1"}),l.jsxs(fe,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0",onClick:()=>t(!0),children:["New Label Category ",l.jsx(wn,{className:"ml-1 h-4 w-4"})]})]})})}),l.jsx("div",{className:"flex-1 overflow-auto pt-6",children:l.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-50 hover:bg-gray-50",children:[l.jsx(ve,{className:"font-bold text-gray-900 w-[250px]",children:"Label Category"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[200px]",children:"Category Code"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[200px]",children:"Category Photo"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[100px]",children:"State"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[100px]",children:"Order"}),l.jsx(ve,{className:"font-bold text-gray-900",children:"Last Edited"}),l.jsx(ve,{className:"font-bold text-gray-900 text-center w-[100px]",children:"Actions"})]})}),l.jsx(Pr,{children:m?l.jsx(Be,{children:l.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):h.length===0?l.jsx(Be,{children:l.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):h.map(k=>l.jsxs(Be,{className:"hover:bg-gray-50",children:[l.jsx(de,{className:"font-medium",children:O1(k.categoryName)}),l.jsx(de,{className:"text-gray-600",children:O1(k.categoryCode)}),l.jsx(de,{className:"text-gray-500",children:O1(k.categoryPhotoUrl)}),l.jsx(de,{children:l.jsx(xr,{className:k.state?"bg-green-600":"bg-gray-400",children:k.state?"Active":"Inactive"})}),l.jsx(de,{className:"font-numeric",children:k.orderNum??"None"}),l.jsx(de,{className:"text-gray-500 tabular-nums font-numeric",children:k.creationTime?new Date(k.creationTime).toLocaleString():"None"}),l.jsx(de,{className:"text-center",children:l.jsxs(ma,{open:N===k.id,onOpenChange:I=>O(I?k.id:null),children:[l.jsx(ga,{asChild:!0,children:l.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:l.jsx(Ei,{className:"h-4 w-4 text-gray-500"})})}),l.jsxs(va,{align:"end",className:"w-40 p-1",children:[l.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>$(k),children:[l.jsx(xn,{className:"w-4 h-4"}),"Edit"]}),l.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>Q(k),children:"Delete"})]})]})})]},k.id))})]})})}),l.jsx("div",{className:"pt-4",children:l.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[l.jsxs("div",{children:["Showing ",x===0?0:(R-1)*z+1,"-",Math.min(R*z,x)," of ",x]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Ke,{value:String(z),onValueChange:k=>F(Number(k)),children:[l.jsx(Ye,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:l.jsx(Xe,{})}),l.jsx(Je,{children:[10,20,50].map(k=>l.jsxs(Ne,{value:String(k),children:[k," / page"]},k))})]}),l.jsx(_i,{className:"mx-0 w-auto justify-end",children:l.jsxs(Ni,{children:[l.jsx(At,{children:l.jsx(Ci,{href:"#",size:"default",onClick:k=>{k.preventDefault(),L(I=>Math.max(1,I-1))},"aria-disabled":R<=1,className:R<=1?"pointer-events-none opacity-50":""})}),l.jsx(At,{children:l.jsxs(ua,{href:"#",isActive:!0,size:"default",onClick:k=>k.preventDefault(),children:["Page ",R," / ",G]})}),l.jsx(At,{children:l.jsx(Oi,{href:"#",size:"default",onClick:k=>{k.preventDefault(),L(I=>Math.min(G,I+1))},"aria-disabled":R>=G,className:R>=G?"pointer-events-none opacity-50":""})})]})})]})]})}),l.jsx(Jce,{open:e,onOpenChange:t,onCreated:()=>{L(1),U()}}),l.jsx(Qce,{open:r,category:o,onOpenChange:k=>{n(k),k||u(null)},onUpdated:U}),l.jsx(Zce,{open:a,category:d,onOpenChange:k=>{i(k),k||c(null)},onDeleted:U})]})}function Jce({open:e,onOpenChange:t,onCreated:r}){const[n,a]=b.useState(!1),[i,o]=b.useState({categoryCode:"",categoryName:"",categoryPhotoUrl:null,state:!0,orderNum:null}),u=()=>{o({categoryCode:"",categoryName:"",categoryPhotoUrl:null,state:!0,orderNum:null})};b.useEffect(()=>{e||u()},[e]);const d=async()=>{if(!i.categoryCode.trim()||!i.categoryName.trim()){xe.error("Validation failed",{description:"Category Code and Category Name are required."});return}a(!0);try{await Ece(i),xe.success("Label category created.",{description:"The label category has been created successfully."}),t(!1),r()}catch(c){xe.error("Failed to create label category.",{description:c?.message?String(c.message):"Please try again."})}finally{a(!1)}};return l.jsx(mt,{open:e,onOpenChange:t,children:l.jsxs(ft,{className:"sm:max-w-[600px]",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Add New Label Category"}),l.jsx(Nt,{children:"Enter the details for the new label category."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Category Code *"}),l.jsx(me,{placeholder:"e.g. CAT_PREP",value:i.categoryCode,onChange:c=>o(h=>({...h,categoryCode:c.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Category Name *"}),l.jsx(me,{placeholder:"e.g. Prep",value:i.categoryName,onChange:c=>o(h=>({...h,categoryName:c.target.value}))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Category Photo URL"}),l.jsx(me,{placeholder:"https://cdn.example.com/cat-prep.png",value:i.categoryPhotoUrl??"",onChange:c=>o(h=>({...h,categoryPhotoUrl:c.target.value||null}))})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Order"}),l.jsx(me,{type:"number",placeholder:"e.g. 1",value:i.orderNum??"",onChange:c=>o(h=>({...h,orderNum:c.target.value?Number(c.target.value):null}))})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),l.jsx(qt,{checked:i.state,onCheckedChange:c=>o(h=>({...h,state:c}))})]})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsx(fe,{disabled:n,onClick:d,children:n?"Creating...":"Create"})]})]})})}function Qce({open:e,category:t,onOpenChange:r,onUpdated:n}){const[a,i]=b.useState(!1),[o,u]=b.useState(!1),[d,c]=b.useState({categoryCode:"",categoryName:"",categoryPhotoUrl:null,state:!0,orderNum:null});b.useEffect(()=>{e&&t&&c({categoryCode:t.categoryCode??"",categoryName:t.categoryName??"",categoryPhotoUrl:t.categoryPhotoUrl??null,state:t.state??!0,orderNum:t.orderNum??null})},[e,t]);const h=async()=>{if(t?.id){if(!d.categoryCode.trim()||!d.categoryName.trim()){xe.error("Validation failed",{description:"Category Code and Category Name are required."});return}i(!0);try{await Pce(t.id,d),xe.success("Label category updated.",{description:"The label category has been updated successfully."}),r(!1),n()}catch(p){xe.error("Failed to update label category.",{description:p?.message?String(p.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-[600px]",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Edit Label Category"}),l.jsx(Nt,{children:"Update the label category details."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Category Code *"}),l.jsx(me,{placeholder:"e.g. CAT_PREP",value:d.categoryCode,onChange:p=>c(m=>({...m,categoryCode:p.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Category Name *"}),l.jsx(me,{placeholder:"e.g. Prep",value:d.categoryName,onChange:p=>c(m=>({...m,categoryName:p.target.value}))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Category Photo URL"}),l.jsx(me,{placeholder:"https://cdn.example.com/cat-prep.png",value:d.categoryPhotoUrl??"",onChange:p=>c(m=>({...m,categoryPhotoUrl:p.target.value||null}))})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Order"}),l.jsx(me,{type:"number",placeholder:"e.g. 1",value:d.orderNum??"",onChange:p=>c(m=>({...m,orderNum:p.target.value?Number(p.target.value):null}))})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),l.jsx(qt,{checked:d.state,onCheckedChange:p=>c(m=>({...m,state:p}))})]})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{disabled:a,onClick:h,children:a?"Updating...":"Update"})]})]})})}function Zce({open:e,category:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>(t?.categoryName??"").trim()||t?.categoryCode||"this category",[t]),u=async()=>{if(t?.id){i(!0);try{await Ace(t.id),xe.success("Label category deleted.",{description:"The label category has been removed successfully."}),r(!1),n()}catch(d){xe.error("Failed to delete label category.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-none",style:{width:"30%"},children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Delete Label Category"}),l.jsx(Nt,{children:"This action cannot be undone."})]}),l.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",l.jsx("span",{className:"font-medium",children:o}),"?"]}),l.jsxs(xt,{className:"flex-row flex-wrap justify-end",children:[l.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function FR(e){const t=(e??"").trim();return t||"None"}function eue(){const[e,t]=b.useState(!1),[r,n]=b.useState(!1),[a,i]=b.useState(!1),[o,u]=b.useState(null),[d,c]=b.useState(null),[h,p]=b.useState([]),[m,v]=b.useState(!1),[x,y]=b.useState(0),[S,_]=b.useState(0),[N,O]=b.useState(null),[A,C]=b.useState(""),[E,T]=b.useState("all"),[R,L]=b.useState(1),[z,F]=b.useState(10),B=b.useRef(null),q=b.useRef(null),[H,V]=b.useState("");b.useEffect(()=>(q.current&&window.clearTimeout(q.current),q.current=window.setTimeout(()=>V(A.trim()),300),()=>{q.current&&window.clearTimeout(q.current)}),[A]);const G=Math.max(1,Math.ceil(x/z));b.useEffect(()=>{L(1)},[H,E,z]),b.useEffect(()=>((async()=>{B.current?.abort();const I=new AbortController;B.current=I,v(!0);try{const D=(R-1)*z,Z=await g5({skipCount:D,maxResultCount:z,keyword:H||void 0,state:E==="all"?void 0:E==="true"},I.signal);p(Z.items??[]),y(Z.totalCount??0)}catch(D){if(D?.name==="AbortError")return;xe.error("Failed to load label types.",{description:D?.message?String(D.message):"Please try again."}),p([]),y(0)}finally{v(!1)}})(),()=>B.current?.abort()),[H,E,R,z,S]);const U=()=>_(k=>k+1),$=k=>{O(null),u(k),n(!0)},Q=k=>{O(null),c(k),i(!0)};return l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsx("div",{className:"pb-4",children:l.jsx("div",{className:"flex flex-col gap-4",children:l.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[l.jsx(me,{placeholder:"Search",value:A,onChange:k=>C(k.target.value),style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),l.jsxs(Ke,{value:E,onValueChange:T,children:[l.jsx(Ye,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"State"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"all",children:"All States"}),l.jsx(Ne,{value:"true",children:"Active"}),l.jsx(Ne,{value:"false",children:"Inactive"})]})]}),l.jsx("div",{className:"flex-1"}),l.jsxs(fe,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0",onClick:()=>t(!0),children:["New Label Type ",l.jsx(wn,{className:"ml-1 h-4 w-4"})]})]})})}),l.jsx("div",{className:"flex-1 overflow-auto pt-6",children:l.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-50 hover:bg-gray-50",children:[l.jsx(ve,{className:"font-bold text-gray-900 w-[250px]",children:"Label Types"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[200px]",children:"Type Code"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[100px]",children:"State"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[100px]",children:"Order"}),l.jsx(ve,{className:"font-bold text-gray-900",children:"Last Edited"}),l.jsx(ve,{className:"font-bold text-gray-900 text-center w-[100px]",children:"Actions"})]})}),l.jsx(Pr,{children:m?l.jsx(Be,{children:l.jsx(de,{colSpan:6,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):h.length===0?l.jsx(Be,{children:l.jsx(de,{colSpan:6,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):h.map(k=>l.jsxs(Be,{className:"hover:bg-gray-50",children:[l.jsx(de,{className:"font-medium",children:FR(k.typeName)}),l.jsx(de,{className:"text-gray-600",children:FR(k.typeCode)}),l.jsx(de,{children:l.jsx(xr,{className:k.state?"bg-green-600":"bg-gray-400",children:k.state?"Active":"Inactive"})}),l.jsx(de,{className:"font-numeric",children:k.orderNum??"None"}),l.jsx(de,{className:"text-gray-500 tabular-nums font-numeric",children:k.creationTime?new Date(k.creationTime).toLocaleString():"None"}),l.jsx(de,{className:"text-center",children:l.jsxs(ma,{open:N===k.id,onOpenChange:I=>O(I?k.id:null),children:[l.jsx(ga,{asChild:!0,children:l.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:l.jsx(Ei,{className:"h-4 w-4 text-gray-500"})})}),l.jsxs(va,{align:"end",className:"w-40 p-1",children:[l.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>$(k),children:[l.jsx(xn,{className:"w-4 h-4"}),"Edit"]}),l.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>Q(k),children:"Delete"})]})]})})]},k.id))})]})})}),l.jsx("div",{className:"pt-4",children:l.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[l.jsxs("div",{children:["Showing ",x===0?0:(R-1)*z+1,"-",Math.min(R*z,x)," of ",x]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Ke,{value:String(z),onValueChange:k=>F(Number(k)),children:[l.jsx(Ye,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:l.jsx(Xe,{})}),l.jsx(Je,{children:[10,20,50].map(k=>l.jsxs(Ne,{value:String(k),children:[k," / page"]},k))})]}),l.jsx(_i,{className:"mx-0 w-auto justify-end",children:l.jsxs(Ni,{children:[l.jsx(At,{children:l.jsx(Ci,{href:"#",size:"default",onClick:k=>{k.preventDefault(),L(I=>Math.max(1,I-1))},"aria-disabled":R<=1,className:R<=1?"pointer-events-none opacity-50":""})}),l.jsx(At,{children:l.jsxs(ua,{href:"#",isActive:!0,size:"default",onClick:k=>k.preventDefault(),children:["Page ",R," / ",G]})}),l.jsx(At,{children:l.jsx(Oi,{href:"#",size:"default",onClick:k=>{k.preventDefault(),L(I=>Math.min(G,I+1))},"aria-disabled":R>=G,className:R>=G?"pointer-events-none opacity-50":""})})]})})]})]})}),l.jsx(tue,{open:e,onOpenChange:t,onCreated:()=>{L(1),U()}}),l.jsx(rue,{open:r,type:o,onOpenChange:k=>{n(k),k||u(null)},onUpdated:U}),l.jsx(nue,{open:a,type:d,onOpenChange:k=>{i(k),k||c(null)},onDeleted:U})]})}function tue({open:e,onOpenChange:t,onCreated:r}){const[n,a]=b.useState(!1),[i,o]=b.useState({typeCode:"",typeName:"",state:!0,orderNum:null}),u=()=>{o({typeCode:"",typeName:"",state:!0,orderNum:null})};b.useEffect(()=>{e||u()},[e]);const d=async()=>{if(!i.typeCode.trim()||!i.typeName.trim()){xe.error("Validation failed",{description:"Type Code and Type Name are required."});return}a(!0);try{await Tce(i),xe.success("Label type created.",{description:"The label type has been created successfully."}),t(!1),r()}catch(c){xe.error("Failed to create label type.",{description:c?.message?String(c.message):"Please try again."})}finally{a(!1)}};return l.jsx(mt,{open:e,onOpenChange:t,children:l.jsxs(ft,{className:"sm:max-w-[600px]",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Add New Label Type"}),l.jsx(Nt,{children:"Enter the details for the new label type."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Type Code *"}),l.jsx(me,{placeholder:"e.g. TYPE_DEFROST",value:i.typeCode,onChange:c=>o(h=>({...h,typeCode:c.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Type Name *"}),l.jsx(me,{placeholder:"e.g. Defrost",value:i.typeName,onChange:c=>o(h=>({...h,typeName:c.target.value}))})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Order"}),l.jsx(me,{type:"number",placeholder:"e.g. 1",value:i.orderNum??"",onChange:c=>o(h=>({...h,orderNum:c.target.value?Number(c.target.value):null}))})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),l.jsx(qt,{checked:i.state,onCheckedChange:c=>o(h=>({...h,state:c}))})]})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsx(fe,{disabled:n,onClick:d,children:n?"Creating...":"Create"})]})]})})}function rue({open:e,type:t,onOpenChange:r,onUpdated:n}){const[a,i]=b.useState(!1),[o,u]=b.useState({typeCode:"",typeName:"",state:!0,orderNum:null});b.useEffect(()=>{e&&t&&u({typeCode:t.typeCode??"",typeName:t.typeName??"",state:t.state??!0,orderNum:t.orderNum??null})},[e,t]);const d=async()=>{if(t?.id){if(!o.typeCode.trim()||!o.typeName.trim()){xe.error("Validation failed",{description:"Type Code and Type Name are required."});return}i(!0);try{await kce(t.id,o),xe.success("Label type updated.",{description:"The label type has been updated successfully."}),r(!1),n()}catch(c){xe.error("Failed to update label type.",{description:c?.message?String(c.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-[600px]",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Edit Label Type"}),l.jsx(Nt,{children:"Update the label type details."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Type Code *"}),l.jsx(me,{placeholder:"e.g. TYPE_DEFROST",value:o.typeCode,onChange:c=>u(h=>({...h,typeCode:c.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Type Name *"}),l.jsx(me,{placeholder:"e.g. Defrost",value:o.typeName,onChange:c=>u(h=>({...h,typeName:c.target.value}))})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Order"}),l.jsx(me,{type:"number",placeholder:"e.g. 1",value:o.orderNum??"",onChange:c=>u(h=>({...h,orderNum:c.target.value?Number(c.target.value):null}))})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),l.jsx(qt,{checked:o.state,onCheckedChange:c=>u(h=>({...h,state:c}))})]})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{disabled:a,onClick:d,children:a?"Updating...":"Update"})]})]})})}function nue({open:e,type:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>(t?.typeName??"").trim()||t?.typeCode||"this type",[t]),u=async()=>{if(t?.id){i(!0);try{await Rce(t.id),xe.success("Label type deleted.",{description:"The label type has been removed successfully."}),r(!1),n()}catch(d){xe.error("Failed to delete label type.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-none",style:{width:"30%"},children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Delete Label Type"}),l.jsx(Nt,{children:"This action cannot be undone."})]}),l.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",l.jsx("span",{className:"font-medium",children:o}),"?"]}),l.jsxs(xt,{className:"flex-row flex-wrap justify-end",children:[l.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function aue(){return`template-${Date.now()}`}function iue(){return`el-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function oue(e){return{id:e??aue(),name:"未命名模板",labelType:"PRICE",unit:"cm",width:6,height:4,appliedLocation:"ALL",appliedLocationIds:[],showRuler:!0,showGrid:!0,elements:[]}}const E1=[{name:'2"×1"',width:2,height:1,unit:"inch"},{name:'2"×2"',width:2,height:2,unit:"inch"},{name:'3"×1"',width:3,height:1,unit:"inch"},{name:'3"×2"',width:3,height:2,unit:"inch"},{name:'4"×2"',width:4,height:2,unit:"inch"},{name:'4"×6"',width:4,height:6,unit:"inch"},{name:"6cm×4cm",width:6,height:4,unit:"cm"},{name:"10cm×6cm",width:10,height:6,unit:"cm"},{name:"A4",width:21,height:29.7,unit:"cm"},{name:"A5",width:14.8,height:21,unit:"cm"}];function zR(e,t=20,r=20){const n=iue(),i={TEXT_STATIC:{width:120,height:24,config:{text:"文本",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left"}},TEXT_PRODUCT:{width:120,height:24,config:{text:"商品名",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left"}},TEXT_PRICE:{width:80,height:24,config:{text:"0.00",prefix:"¥",decimal:2,fontFamily:"Arial",fontSize:14,fontWeight:"bold",textAlign:"right"}},BARCODE:{width:160,height:48,config:{barcodeType:"CODE128",data:"123456789",showText:!0,orientation:"horizontal"}},QRCODE:{width:80,height:80,config:{data:"https://example.com",errorLevel:"M"}},IMAGE:{width:60,height:60,config:{src:"",scaleMode:"contain"}},DATE:{width:120,height:24,config:{format:"YYYY-MM-DD",offsetDays:0}},TIME:{width:100,height:24,config:{format:"HH:mm",offsetDays:0}},DURATION:{width:120,height:24,config:{format:"YYYY-MM-DD",offsetDays:3}},WEIGHT:{width:80,height:24,config:{unit:"g",value:500}},WEIGHT_PRICE:{width:100,height:24,config:{unitPrice:10,weight:.5,currency:"¥"}},BLANK:{width:40,height:24,config:{}},NUTRITION:{width:200,height:120,config:{calories:120,fat:"5g",protein:"3g",carbs:"10g",layout:"standard"}}}[e];return{id:n,type:e,x:t,y:r,width:i.width,height:i.height,rotation:"horizontal",border:"none",config:{...i.config}}}function w5(e){const t=String(e.appliedLocation??"").trim().toUpperCase();return t==="ALL"?"ALL":t==="SPECIFIED"||(e.appliedLocationIds?.length??0)>0?"SPECIFIED":"ALL"}function sue(e){switch(e){case"TEXT_PRODUCT":return"PRODUCT";case"TEXT_PRICE":return"PRICE";default:return"FIXED"}}const lue=[{title:"模版信息",items:[{label:"Text",type:"TEXT_STATIC"},{label:"QR Code",type:"QRCODE"},{label:"Barcode",type:"BARCODE"},{label:"Blank Space",type:"BLANK"},{label:"Price",type:"TEXT_PRICE"},{label:"Image",type:"IMAGE"},{label:"Logo",type:"IMAGE"}]},{title:"标签信息",items:[{label:"Label Name",type:"TEXT_PRODUCT"},{label:"Text",type:"TEXT_STATIC"},{label:"QR Code",type:"QRCODE"},{label:"Barcode",type:"BARCODE"},{label:"Nutrition Facts",type:"NUTRITION"},{label:"Price",type:"TEXT_PRICE"},{label:"Duration Date",type:"DATE"},{label:"Duration Time",type:"TIME"},{label:"Duration",type:"DURATION"},{label:"Image",type:"IMAGE"},{label:"Label Type",type:"TEXT_STATIC"},{label:"How-to",type:"TEXT_STATIC"},{label:"Expiration Alert",type:"TEXT_STATIC"}]},{title:"自动生成",items:[{label:"Company",type:"TEXT_STATIC"},{label:"Employee",type:"TEXT_STATIC"},{label:"Current Date",type:"DATE"},{label:"Current Time",type:"TIME"},{label:"Label ID",type:"TEXT_STATIC"}]},{title:"打印时输入",subtitle:"点击添加到画布",items:[{label:"Text",type:"TEXT_STATIC",config:{inputType:"text"}},{label:"Weight",type:"WEIGHT"},{label:"Number",type:"TEXT_STATIC",config:{inputType:"number",text:"0"}},{label:"Date & Time",type:"DATE",config:{inputType:"datetime"}},{label:"Multiple Options",type:"TEXT_STATIC",config:{inputType:"options"}}]}];function cue({onAddElement:e}){return l.jsxs("div",{className:"w-44 shrink-0 border-r border-gray-200 bg-white flex flex-col h-full",children:[l.jsx("div",{className:"px-2 py-2 border-b border-gray-200 font-semibold text-gray-800 text-sm",children:"Elements"}),l.jsx($s,{className:"flex-1",children:l.jsx("div",{className:"p-1.5 space-y-3",children:lue.map(t=>l.jsxs("div",{children:[l.jsx("div",{className:"px-2 py-1 text-xs font-medium text-gray-500 uppercase tracking-wide",children:t.title}),t.subtitle&&l.jsx("div",{className:"px-2 py-0.5 text-[10px] text-gray-400",children:t.subtitle}),l.jsx("div",{className:"grid grid-cols-2 gap-1 mt-0.5",children:t.items.map((r,n)=>l.jsx("button",{type:"button",onClick:()=>e(r.type,r.config),className:"text-left px-2 py-1 text-xs rounded hover:bg-gray-100 border border-transparent hover:border-gray-200 truncate",children:r.label},`${t.title}-${r.label}-${n}`))})]},t.title))})})]})}var qf={},Cc={},Uf={},qR;function on(){if(qR)return Uf;qR=1,Object.defineProperty(Uf,"__esModule",{value:!0});function e(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var t=function r(n,a){e(this,r),this.data=n,this.text=a.text||n,this.options=a};return Uf.default=t,Uf}var UR;function uue(){if(UR)return Cc;UR=1,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.CODE39=void 0;var e=(function(){function y(S,_){for(var N=0;N<_.length;N++){var O=_[N];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(S,O.key,O)}}return function(S,_,N){return _&&y(S.prototype,_),N&&y(S,N),S}})(),t=on(),r=n(t);function n(y){return y&&y.__esModule?y:{default:y}}function a(y,S){if(!(y instanceof S))throw new TypeError("Cannot call a class as a function")}function i(y,S){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S&&(typeof S=="object"||typeof S=="function")?S:y}function o(y,S){if(typeof S!="function"&&S!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof S);y.prototype=Object.create(S&&S.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),S&&(Object.setPrototypeOf?Object.setPrototypeOf(y,S):y.__proto__=S)}var u=(function(y){o(S,y);function S(_,N){return a(this,S),_=_.toUpperCase(),N.mod43&&(_+=m(x(_))),i(this,(S.__proto__||Object.getPrototypeOf(S)).call(this,_,N))}return e(S,[{key:"encode",value:function(){for(var N=h("*"),O=0;O=200){S=m.shift()-105;var _=n.SWAP[S];_!==void 0?y=h.next(m,v+1,_):((x===n.SET_A||x===n.SET_B)&&S===n.SHIFT&&(m[0]=x===n.SET_A?m[0]>95?m[0]-96:m[0]:m[0]<32?m[0]+96:m[0]),y=h.next(m,v+1,x))}else S=h.correctIndex(m,x),y=h.next(m,v+1,x);var N=h.getBar(S),O=S*v;return{result:N+y.result,checksum:O+y.checksum}}}]),h})(r.default);return Hf.default=d,Hf}var Wf={},WR;function due(){if(WR)return Wf;WR=1,Object.defineProperty(Wf,"__esModule",{value:!0});var e=Zu(),t=function(u){return u.match(new RegExp("^"+e.A_CHARS+"*"))[0].length},r=function(u){return u.match(new RegExp("^"+e.B_CHARS+"*"))[0].length},n=function(u){return u.match(new RegExp("^"+e.C_CHARS+"*"))[0]};function a(o,u){var d=u?e.A_CHARS:e.B_CHARS,c=o.match(new RegExp("^("+d+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(c)return c[1]+"Ì"+i(o.substring(c[1].length));var h=o.match(new RegExp("^"+d+"+"))[0];return h.length===o.length?o:h+String.fromCharCode(u?205:206)+a(o.substring(h.length),!u)}function i(o){var u=n(o),d=u.length;if(d===o.length)return o;o=o.substring(d);var c=t(o)>=r(o);return u+String.fromCharCode(c?206:205)+a(o,c)}return Wf.default=function(o){var u=void 0,d=n(o).length;if(d>=2)u=e.C_START_CHAR+i(o);else{var c=t(o)>r(o);u=(c?e.A_START_CHAR:e.B_START_CHAR)+a(o,c)}return u.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(h,p){return"Ë"+p})},Wf}var GR;function fue(){if(GR)return Vf;GR=1,Object.defineProperty(Vf,"__esModule",{value:!0});var e=ng(),t=a(e),r=due(),n=a(r);function a(c){return c&&c.__esModule?c:{default:c}}function i(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}function o(c,h){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:c}function u(c,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);c.prototype=Object.create(h&&h.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(c,h):c.__proto__=h)}var d=(function(c){u(h,c);function h(p,m){if(i(this,h),/^[\x00-\x7F\xC8-\xD3]+$/.test(p))var v=o(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,(0,n.default)(p),m));else var v=o(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,p,m));return o(v)}return h})(t.default);return Vf.default=d,Vf}var Gf={},KR;function hue(){if(KR)return Gf;KR=1,Object.defineProperty(Gf,"__esModule",{value:!0});var e=(function(){function c(h,p){for(var m=0;mx.width*10?x.width*10:x.fontSize,y.guardHeight=x.height+y.fontSize/2+x.textMargin,y}return e(m,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(x,y){return this.text.substr(x,y)}},{key:"leftEncode",value:function(x,y){return(0,n.default)(x,y)}},{key:"rightText",value:function(x,y){return this.text.substr(x,y)}},{key:"rightEncode",value:function(x,y){return(0,n.default)(x,y)}},{key:"encodeGuarded",value:function(){var x={fontSize:this.fontSize},y={height:this.guardHeight};return[{data:t.SIDE_BIN,options:y},{data:this.leftEncode(),text:this.leftText(),options:x},{data:t.MIDDLE_BIN,options:y},{data:this.rightEncode(),text:this.rightText(),options:x},{data:t.SIDE_BIN,options:y}]}},{key:"encodeFlat",value:function(){var x=[t.SIDE_BIN,this.leftEncode(),t.MIDDLE_BIN,this.rightEncode(),t.SIDE_BIN];return{data:x.join(""),text:this.text}}}]),m})(i.default);return Jf.default=h,Jf}var tI;function vue(){if(tI)return Yf;tI=1,Object.defineProperty(Yf,"__esModule",{value:!0});var e=(function(){function p(m,v){for(var x=0;xx.width*10?y.fontSize=x.width*10:y.fontSize=x.fontSize,y.guardHeight=x.height+y.fontSize/2+x.textMargin,y}return e(m,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==h(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var x="";return x+="101",x+=(0,r.default)(this.data.substr(0,6),"LLLLLL"),x+="01010",x+=(0,r.default)(this.data.substr(6,6),"RRRRRR"),x+="101",{data:x,text:this.text}}},{key:"guardedEncoding",value:function(){var x=[];return this.displayValue&&x.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),x.push({data:"101"+(0,r.default)(this.data[0],"L"),options:{height:this.guardHeight}}),x.push({data:(0,r.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),x.push({data:"01010",options:{height:this.guardHeight}}),x.push({data:(0,r.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),x.push({data:(0,r.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&x.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),x}}]),m})(a.default);function h(p){var m=0,v;for(v=1;v<11;v+=2)m+=parseInt(p[v]);for(v=0;v<11;v+=2)m+=parseInt(p[v])*3;return(10-m%10)%10}return Oc.default=c,Oc}var rh={},oI;function wue(){if(oI)return rh;oI=1,Object.defineProperty(rh,"__esModule",{value:!0});var e=(function(){function x(y,S){for(var _=0;__.width*10?N.fontSize=_.width*10:N.fontSize=_.fontSize,N.guardHeight=_.height+N.fontSize/2+_.textMargin,N}return e(y,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var _="";return _+="101",_+=this.encodeMiddleDigits(),_+="010101",{data:_,text:this.text}}},{key:"guardedEncoding",value:function(){var _=[];return this.displayValue&&_.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),_.push({data:"101",options:{height:this.guardHeight}}),_.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),_.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&_.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),_}},{key:"encodeMiddleDigits",value:function(){var _=this.upcA[0],N=this.upcA[this.upcA.length-1],O=p[parseInt(N)][parseInt(_)];return(0,r.default)(this.middleDigits,O)}}]),y})(a.default);function v(x,y){for(var S=parseInt(x[x.length-1]),_=h[S],N="",O=0,A=0;A<_.length;A++){var C=_[A];C==="X"?N+=x[O++]:N+=C}return N=""+y+N,""+N+(0,i.checksum)(N)}return rh.default=m,rh}var sI;function Sue(){if(sI)return Sr;sI=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.UPCE=Sr.UPC=Sr.EAN2=Sr.EAN5=Sr.EAN8=Sr.EAN13=void 0;var e=vue(),t=m(e),r=yue(),n=m(r),a=xue(),i=m(a),o=bue(),u=m(o),d=j5(),c=m(d),h=wue(),p=m(h);function m(v){return v&&v.__esModule?v:{default:v}}return Sr.EAN13=t.default,Sr.EAN8=n.default,Sr.EAN5=i.default,Sr.EAN2=u.default,Sr.UPC=c.default,Sr.UPCE=p.default,Sr}var to={},nh={},gs={},lI;function jue(){return lI||(lI=1,Object.defineProperty(gs,"__esModule",{value:!0}),gs.START_BIN="1010",gs.END_BIN="11101",gs.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]),gs}var cI;function _5(){if(cI)return nh;cI=1,Object.defineProperty(nh,"__esModule",{value:!0});var e=(function(){function c(h,p){for(var m=0;m=3&&this.number<=131070}}]),c})(r.default);return Pc.pharmacode=u,Pc}var Ac={},bI;function kue(){if(bI)return Ac;bI=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.codabar=void 0;var e=(function(){function d(c,h){for(var p=0;p":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"":["(%)","T"]}),vs}var SI;function N5(){if(SI)return uh;SI=1,Object.defineProperty(uh,"__esModule",{value:!0});var e=(function(){function c(h,p){for(var m=0;m0?h.fontSize+h.textMargin:0)+h.marginTop+h.marginBottom}function a(c,h,p){if(p.displayValue&&hh&&(h=c[p].height);return h}function d(c,h,p){var m;if(p)m=p;else if(typeof document<"u")m=document.createElement("canvas").getContext("2d");else return 0;m.font=h.fontOptions+" "+h.fontSize+"px "+h.font;var v=m.measureText(c);if(!v)return 0;var x=v.width;return x}return Hr.getMaximumHeightOfEncodings=u,Hr.getEncodingHeight=n,Hr.getBarcodePadding=a,Hr.calculateEncodingAttributes=i,Hr.getTotalWidthOfEncodings=o,Hr}var II;function zue(){if(II)return bh;II=1,Object.defineProperty(bh,"__esModule",{value:!0});var e=(function(){function u(d,c){for(var h=0;h0?(v=0,p.textAlign="left"):c.textAlign=="right"?(v=h.width-1,p.textAlign="right"):(v=h.width/2,p.textAlign="center"),p.fillText(h.text,v,x)}}},{key:"moveCanvasDrawing",value:function(c){var h=this.canvas.getContext("2d");h.translate(c.width,0)}},{key:"restoreCanvas",value:function(){var c=this.canvas.getContext("2d");c.restore()}}]),u})();return bh.default=o,bh}var wh={},MI;function que(){if(MI)return wh;MI=1,Object.defineProperty(wh,"__esModule",{value:!0});var e=(function(){function d(c,h){for(var p=0;p0&&(this.drawRect(S-p.width*y,x,p.width*y,p.height,h),y=0);y>0&&this.drawRect(S-p.width*(y-1),x,p.width*y,p.height,h)}},{key:"drawSVGText",value:function(h,p,m){var v=this.document.createElementNS(o,"text");if(p.displayValue){var x,y;v.setAttribute("font-family",p.font),v.setAttribute("font-size",p.fontSize),p.fontOptions.includes("bold")&&v.setAttribute("font-weight","bold"),p.fontOptions.includes("italic")&&v.setAttribute("font-style","italic"),p.textPosition=="top"?y=p.fontSize-p.textMargin:y=p.height+p.textMargin+p.fontSize,p.textAlign=="left"||m.barcodePadding>0?(x=0,v.setAttribute("text-anchor","start")):p.textAlign=="right"?(x=m.width-1,v.setAttribute("text-anchor","end")):(x=m.width/2,v.setAttribute("text-anchor","middle")),v.setAttribute("x",x),v.setAttribute("y",y),v.appendChild(this.document.createTextNode(m.text)),h.appendChild(v)}}},{key:"setSvgAttributes",value:function(h,p){var m=this.svg;m.setAttribute("width",h+"px"),m.setAttribute("height",p+"px"),m.setAttribute("x","0px"),m.setAttribute("y","0px"),m.setAttribute("viewBox","0 0 "+h+" "+p),m.setAttribute("xmlns",o),m.setAttribute("version","1.1")}},{key:"createGroup",value:function(h,p,m){var v=this.document.createElementNS(o,"g");return v.setAttribute("transform","translate("+h+", "+p+")"),m.appendChild(v),v}},{key:"setGroupOptions",value:function(h,p){h.setAttribute("fill",p.lineColor)}},{key:"drawRect",value:function(h,p,m,v,x){var y=this.document.createElementNS(o,"rect");return y.setAttribute("x",h),y.setAttribute("y",p),y.setAttribute("width",m),y.setAttribute("height",v),x.appendChild(y),y}}]),d})();return wh.default=u,wh}var Sh={},DI;function Uue(){if(DI)return Sh;DI=1,Object.defineProperty(Sh,"__esModule",{value:!0});var e=(function(){function n(a,i){for(var o=0;o"u"?"undefined":e(h))==="object"&&!h.nodeName)return{element:h,renderer:a.default.ObjectRenderer};throw new i.InvalidElementException}}function d(h){var p=document.querySelectorAll(h);if(p.length!==0){for(var m=[],v=0;v"u")throw Error("No element to render on was provided.");return q._renderProperties=(0,c.default)(z),q._encodings=[],q._options=S.default,q._errorHandler=new v.default(q),typeof F<"u"&&(B=B||{},B.format||(B.format=T()),q.options(B)[B.format](F,B).render()),q};O.getModule=function(L){return t.default[L]};for(var A in t.default)t.default.hasOwnProperty(A)&&C(t.default,A);function C(L,z){N.prototype[z]=N.prototype[z.toUpperCase()]=N.prototype[z.toLowerCase()]=function(F,B){var q=this;return q._errorHandler.wrapBarcodeCall(function(){B.text=typeof B.text>"u"?void 0:""+B.text;var H=(0,n.default)(q._options,B);H=(0,p.default)(H);var V=L[z],G=E(F,V,H);return q._encodings.push(G),q})}}function E(L,z,F){L=""+L;var B=new z(L,F);if(!B.valid())throw new x.InvalidInputException(B.constructor.name,L);var q=B.encode();q=(0,i.default)(q);for(var H=0;Ht in e?Yue(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bS=(e,t)=>{for(var r in t||(t={}))A5.call(t,r)&&qI(e,r,t[r]);if(Hp)for(var r of Hp(t))T5.call(t,r)&&qI(e,r,t[r]);return e},wS=(e,t)=>{var r={};for(var n in e)A5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Hp)for(var n of Hp(e))t.indexOf(n)<0&&T5.call(e,n)&&(r[n]=e[n]);return r};/** - * @license QR Code generator library (TypeScript) - * Copyright (c) Project Nayuki. - * SPDX-License-Identifier: MIT - */var Eo;(e=>{const t=class rt{constructor(d,c,h,p){if(this.version=d,this.errorCorrectionLevel=c,this.modules=[],this.isFunction=[],drt.MAX_VERSION)throw new RangeError("Version value out of range");if(p<-1||p>7)throw new RangeError("Mask value out of range");this.size=d*4+17;let m=[];for(let x=0;x7)throw new RangeError("Invalid value");let x,y;for(x=h;;x++){const O=rt.getNumDataCodewords(x,c)*8,A=o.getTotalBits(d,x);if(A<=O){y=A;break}if(x>=p)throw new RangeError("Data too long")}for(const O of[rt.Ecc.MEDIUM,rt.Ecc.QUARTILE,rt.Ecc.HIGH])v&&y<=rt.getNumDataCodewords(x,O)*8&&(c=O);let S=[];for(const O of d){r(O.mode.modeBits,4,S),r(O.numChars,O.mode.numCharCountBits(x),S);for(const A of O.getData())S.push(A)}a(S.length==y);const _=rt.getNumDataCodewords(x,c)*8;a(S.length<=_),r(0,Math.min(4,_-S.length),S),r(0,(8-S.length%8)%8,S),a(S.length%8==0);for(let O=236;S.length<_;O^=253)r(O,8,S);let N=[];for(;N.length*8N[A>>>3]|=O<<7-(A&7)),new rt(x,c,N,m)}getModule(d,c){return 0<=d&&d>>9)*1335;const p=(c<<10|h)^21522;a(p>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(p,m));this.setFunctionModule(8,7,n(p,6)),this.setFunctionModule(8,8,n(p,7)),this.setFunctionModule(7,8,n(p,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(p,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(p,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(p,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let d=this.version;for(let h=0;h<12;h++)d=d<<1^(d>>>11)*7973;const c=this.version<<12|d;a(c>>>18==0);for(let h=0;h<18;h++){const p=n(c,h),m=this.size-11+h%3,v=Math.floor(h/3);this.setFunctionModule(m,v,p),this.setFunctionModule(v,m,p)}}drawFinderPattern(d,c){for(let h=-4;h<=4;h++)for(let p=-4;p<=4;p++){const m=Math.max(Math.abs(p),Math.abs(h)),v=d+p,x=c+h;0<=v&&v{(O!=y-m||C>=x)&&N.push(A[O])});return a(N.length==v),N}drawCodewords(d){if(d.length!=Math.floor(rt.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let h=this.size-1;h>=1;h-=2){h==6&&(h=5);for(let p=0;p>>3],7-(c&7)),c++)}}a(c==d.length*8)}applyMask(d){if(d<0||d>7)throw new RangeError("Mask value out of range");for(let c=0;c5&&d++):(this.finderPenaltyAddHistory(x,y),v||(d+=this.finderPenaltyCountPatterns(y)*rt.PENALTY_N3),v=this.modules[m][S],x=1);d+=this.finderPenaltyTerminateAndCount(v,x,y)*rt.PENALTY_N3}for(let m=0;m5&&d++):(this.finderPenaltyAddHistory(x,y),v||(d+=this.finderPenaltyCountPatterns(y)*rt.PENALTY_N3),v=this.modules[S][m],x=1);d+=this.finderPenaltyTerminateAndCount(v,x,y)*rt.PENALTY_N3}for(let m=0;mv+(x?1:0),c);const h=this.size*this.size,p=Math.ceil(Math.abs(c*20-h*10)/h)-1;return a(0<=p&&p<=9),d+=p*rt.PENALTY_N4,a(0<=d&&d<=2568888),d}getAlignmentPatternPositions(){if(this.version==1)return[];{const d=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(d*2-2))*2;let h=[6];for(let p=this.size-7;h.lengthrt.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*d+128)*d+64;if(d>=2){const h=Math.floor(d/7)+2;c-=(25*h-10)*h-55,d>=7&&(c-=36)}return a(208<=c&&c<=29648),c}static getNumDataCodewords(d,c){return Math.floor(rt.getNumRawDataModules(d)/8)-rt.ECC_CODEWORDS_PER_BLOCK[c.ordinal][d]*rt.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][d]}static reedSolomonComputeDivisor(d){if(d<1||d>255)throw new RangeError("Degree out of range");let c=[];for(let p=0;p0);for(const p of d){const m=p^h.shift();h.push(0),c.forEach((v,x)=>h[x]^=rt.reedSolomonMultiply(v,m))}return h}static reedSolomonMultiply(d,c){if(d>>>8||c>>>8)throw new RangeError("Byte out of range");let h=0;for(let p=7;p>=0;p--)h=h<<1^(h>>>7)*285,h^=(c>>>p&1)*d;return a(h>>>8==0),h}finderPenaltyCountPatterns(d){const c=d[1];a(c<=this.size*3);const h=c>0&&d[2]==c&&d[3]==c*3&&d[4]==c&&d[5]==c;return(h&&d[0]>=c*4&&d[6]>=c?1:0)+(h&&d[6]>=c*4&&d[0]>=c?1:0)}finderPenaltyTerminateAndCount(d,c,h){return d&&(this.finderPenaltyAddHistory(c,h),c=0),c+=this.size,this.finderPenaltyAddHistory(c,h),this.finderPenaltyCountPatterns(h)}finderPenaltyAddHistory(d,c){c[0]==0&&(d+=this.size),c.pop(),c.unshift(d)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function r(u,d,c){if(d<0||d>31||u>>>d)throw new RangeError("Value out of range");for(let h=d-1;h>=0;h--)c.push(u>>>h&1)}function n(u,d){return(u>>>d&1)!=0}function a(u){if(!u)throw new Error("Assertion error")}const i=class $t{constructor(d,c,h){if(this.mode=d,this.numChars=c,this.bitData=h,c<0)throw new RangeError("Invalid argument");this.bitData=h.slice()}static makeBytes(d){let c=[];for(const h of d)r(h,8,c);return new $t($t.Mode.BYTE,d.length,c)}static makeNumeric(d){if(!$t.isNumeric(d))throw new RangeError("String contains non-numeric characters");let c=[];for(let h=0;h=1<{(t=>{const r=class{constructor(a,i){this.ordinal=a,this.formatBits=i}};r.LOW=new r(0,1),r.MEDIUM=new r(1,0),r.QUARTILE=new r(2,3),r.HIGH=new r(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(Eo||(Eo={}));(e=>{(t=>{const r=class{constructor(a,i){this.modeBits=a,this.numBitsCharCount=i}numCharCountBits(a){return this.numBitsCharCount[Math.floor((a+7)/17)]}};r.NUMERIC=new r(1,[10,12,14]),r.ALPHANUMERIC=new r(2,[9,11,13]),r.BYTE=new r(4,[8,16,16]),r.KANJI=new r(8,[8,10,12]),r.ECI=new r(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(Eo||(Eo={}));var Os=Eo;/** - * @license qrcode.react - * Copyright (c) Paul O'Shannessy - * SPDX-License-Identifier: ISC - */var Jue={L:Os.QrCode.Ecc.LOW,M:Os.QrCode.Ecc.MEDIUM,Q:Os.QrCode.Ecc.QUARTILE,H:Os.QrCode.Ecc.HIGH},k5=128,R5="L",I5="#FFFFFF",M5="#000000",D5=!1,L5=1,Que=4,Zue=0,ede=.1;function $5(e,t=0){const r=[];return e.forEach(function(n,a){let i=null;n.forEach(function(o,u){if(!o&&i!==null){r.push(`M${i+t} ${a+t}h${u-i}v1H${i+t}z`),i=null;return}if(u===n.length-1){if(!o)return;i===null?r.push(`M${u+t},${a+t} h1v1H${u+t}z`):r.push(`M${i+t},${a+t} h${u+1-i}v1H${i+t}z`);return}o&&i===null&&(i=u)})}),r.join("")}function B5(e,t){return e.slice().map((r,n)=>n=t.y+t.h?r:r.map((a,i)=>i=t.x+t.w?a:!1))}function tde(e,t,r,n){if(n==null)return null;const a=e.length+r*2,i=Math.floor(t*ede),o=a/t,u=(n.width||i)*o,d=(n.height||i)*o,c=n.x==null?e.length/2-u/2:n.x*o,h=n.y==null?e.length/2-d/2:n.y*o,p=n.opacity==null?1:n.opacity;let m=null;if(n.excavate){let x=Math.floor(c),y=Math.floor(h),S=Math.ceil(u+c-x),_=Math.ceil(d+h-y);m={x,y,w:S,h:_}}const v=n.crossOrigin;return{x:c,y:h,h:d,w:u,excavation:m,opacity:p,crossOrigin:v}}function rde(e,t){return t!=null?Math.max(Math.floor(t),0):e?Que:Zue}function F5({value:e,level:t,minVersion:r,includeMargin:n,marginSize:a,imageSettings:i,size:o,boostLevel:u}){let d=X.useMemo(()=>{const x=(Array.isArray(e)?e:[e]).reduce((y,S)=>(y.push(...Os.QrSegment.makeSegments(S)),y),[]);return Os.QrCode.encodeSegments(x,Jue[t],r,void 0,void 0,u)},[e,t,r,u]);const{cells:c,margin:h,numCells:p,calculatedImageSettings:m}=X.useMemo(()=>{let v=d.getModules();const x=rde(n,a),y=v.length+x*2,S=tde(v,o,x,i);return{cells:v,margin:x,numCells:y,calculatedImageSettings:S}},[d,o,i,n,a]);return{qrcode:d,margin:h,cells:c,numCells:p,calculatedImageSettings:m}}var nde=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),ade=X.forwardRef(function(t,r){const n=t,{value:a,size:i=k5,level:o=R5,bgColor:u=I5,fgColor:d=M5,includeMargin:c=D5,minVersion:h=L5,boostLevel:p,marginSize:m,imageSettings:v}=n,y=wS(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:S}=y,_=wS(y,["style"]),N=v?.src,O=X.useRef(null),A=X.useRef(null),C=X.useCallback(H=>{O.current=H,typeof r=="function"?r(H):r&&(r.current=H)},[r]),[E,T]=X.useState(!1),{margin:R,cells:L,numCells:z,calculatedImageSettings:F}=F5({value:a,level:o,minVersion:h,boostLevel:p,includeMargin:c,marginSize:m,imageSettings:v,size:i});X.useEffect(()=>{if(O.current!=null){const H=O.current,V=H.getContext("2d");if(!V)return;let G=L;const U=A.current,$=F!=null&&U!==null&&U.complete&&U.naturalHeight!==0&&U.naturalWidth!==0;$&&F.excavation!=null&&(G=B5(L,F.excavation));const Q=window.devicePixelRatio||1;H.height=H.width=i*Q;const k=i/z*Q;V.scale(k,k),V.fillStyle=u,V.fillRect(0,0,z,z),V.fillStyle=d,nde?V.fill(new Path2D($5(G,R))):L.forEach(function(I,D){I.forEach(function(Z,ie){Z&&V.fillRect(ie+R,D+R,1,1)})}),F&&(V.globalAlpha=F.opacity),$&&V.drawImage(U,F.x+R,F.y+R,F.w,F.h)}}),X.useEffect(()=>{T(!1)},[N]);const B=bS({height:i,width:i},S);let q=null;return N!=null&&(q=X.createElement("img",{src:N,key:N,style:{display:"none"},onLoad:()=>{T(!0)},ref:A,crossOrigin:F?.crossOrigin})),X.createElement(X.Fragment,null,X.createElement("canvas",bS({style:B,height:i,width:i,ref:C,role:"img"},_)),q)});ade.displayName="QRCodeCanvas";var z5=X.forwardRef(function(t,r){const n=t,{value:a,size:i=k5,level:o=R5,bgColor:u=I5,fgColor:d=M5,includeMargin:c=D5,minVersion:h=L5,boostLevel:p,title:m,marginSize:v,imageSettings:x}=n,y=wS(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:S,cells:_,numCells:N,calculatedImageSettings:O}=F5({value:a,level:o,minVersion:h,boostLevel:p,includeMargin:c,marginSize:v,imageSettings:x,size:i});let A=_,C=null;x!=null&&O!=null&&(O.excavation!=null&&(A=B5(_,O.excavation)),C=X.createElement("image",{href:x.src,height:O.h,width:O.w,x:O.x+S,y:O.y+S,preserveAspectRatio:"none",opacity:O.opacity,crossOrigin:O.crossOrigin}));const E=$5(A,S);return X.createElement("svg",bS({height:i,width:i,viewBox:`0 0 ${N} ${N}`,ref:r,role:"img"},y),!!m&&X.createElement("title",null,m),X.createElement("path",{fill:u,d:`M0,0 h${N}v${N}H0z`,shapeRendering:"crispEdges"}),X.createElement("path",{fill:d,d:E,shapeRendering:"crispEdges"}),C)});z5.displayName="QRCodeSVG";function ide({data:e,width:t,height:r,showText:n,orientation:a="horizontal"}){const i=b.useRef(null),o=a==="vertical",u=Math.max(20,(o?t:r)-(n?14:4));b.useEffect(()=>{if(i.current&&e)try{Xue(i.current,e,{format:"CODE128",width:1,height:u,displayValue:n!==!1,margin:2,fontOptions:"",fontSize:10})}catch{}},[e,u,n]);const d=l.jsx("svg",{ref:i,className:"w-full h-full min-h-0",style:{maxHeight:o?t:r}});return o?l.jsx("div",{className:"w-full h-full flex items-center justify-center",children:l.jsx("div",{style:{transform:"rotate(-90deg)",transformOrigin:"center center",width:r,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:d})}):d}const Uc=8;function xs(e){return Math.round(e/Uc)*Uc}function Wp(e,t){return t==="cm"?e*37.8:e*96}function UI(e,t){return t==="cm"?e/37.8:e/96}function q5({el:e}){const t=e.config,r=e.type,n={fontSize:t?.fontSize??14,fontFamily:t?.fontFamily??"Arial",fontWeight:t?.fontWeight??"normal",textAlign:t?.textAlign??"left",color:t?.color??"#000"},a=t?.inputType;if(r==="TEXT_STATIC"){const i=t?.text??"文本";return a==="number"?l.jsx("input",{type:"number",readOnly:!0,value:t?.text??"0",className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none",style:{...n,textAlign:"right"}}):a==="options"?l.jsxs("div",{className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 flex items-center pointer-events-none text-gray-500",style:n,children:[l.jsx("span",{className:"truncate flex-1",children:i||"请选择..."}),l.jsx("span",{className:"ml-auto text-gray-400",children:"▼"})]}):a==="text"?l.jsx("input",{type:"text",readOnly:!0,value:i,className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none",style:n}):l.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-pre-wrap break-all leading-tight",style:n,children:i})}if(r==="TEXT_PRODUCT"){const i=t?.text??"商品名";return l.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-pre-wrap break-all leading-tight",style:n,children:i})}if(r==="TEXT_PRICE"){const i=t?.prefix??"¥",o=t?.text??"0.00";return l.jsxs("div",{className:"w-full h-full px-1 overflow-hidden flex items-center",style:{...n,justifyContent:n.textAlign==="center"?"center":n.textAlign==="right"?"flex-end":"flex-start"},children:[l.jsx("span",{children:i}),l.jsx("span",{children:o})]})}if(r==="BARCODE"){const i=t?.data??"123456789",o=t?.showText!==!1,u=t?.orientation==="vertical"?"vertical":"horizontal";return l.jsx("div",{className:"flex flex-col items-center justify-center w-full h-full overflow-hidden p-0.5",children:l.jsx("div",{className:"flex-1 w-full min-h-0 flex items-center justify-center",children:l.jsx(ide,{data:i,width:e.width,height:e.height,showText:o,orientation:u})})})}if(r==="QRCODE"){const i=t?.data??"https://example.com",o=Math.min(e.width,e.height)-4;return l.jsx("div",{className:"w-full h-full flex items-center justify-center p-0.5",children:l.jsx(z5,{value:i,size:Math.max(20,o),level:"M",includeMargin:!1})})}if(r==="IMAGE"){const i=t?.src;return i?l.jsx("img",{src:i,alt:"",className:"w-full h-full object-contain"}):l.jsx("div",{className:"w-full h-full flex flex-col items-center justify-center bg-gray-100 text-gray-500 text-[10px] border border-dashed border-gray-300",children:l.jsx("span",{className:"font-medium",children:"Logo"})})}if(r==="DATE"){const o=(t?.format??"YYYY-MM-DD").replace("YYYY","2025").replace("MM","02").replace("DD","01");return t?.inputType==="datetime"||t?.inputType==="date"?l.jsx("input",{type:"date",readOnly:!0,value:"2025-02-01",className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none text-[10px]",style:n}):l.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:o})}if(r==="TIME"){const o=(t?.format??"HH:mm").replace("HH","12").replace("mm","30");return l.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:o})}if(r==="DURATION")return l.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:"保质期 2025-02-04"});if(r==="WEIGHT"){const i=t?.value??500,o=t?.unit??"g";return l.jsxs("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:[i,o]})}if(r==="WEIGHT_PRICE"){const i=t?.unitPrice??10,o=t?.weight??.5,u=t?.currency??"¥";return l.jsxs("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:[u,(i*o).toFixed(2)]})}if(r==="NUTRITION"){const i=t?.calories??120;return l.jsxs("div",{className:"text-[8px] p-0.5 w-full h-full overflow-hidden flex flex-col",children:[l.jsx("div",{className:"font-semibold border-b border-black",children:"Nutrition Facts"}),l.jsxs("div",{children:["Calories ",i]})]})}return r==="BLANK"?l.jsx("div",{className:"w-full h-full border border-dashed border-gray-200"}):l.jsx("div",{className:"text-gray-500 text-[10px] px-1 truncate w-full flex items-center justify-center",children:e.type.replace(/_/g," ")})}function ode({template:e,selectedId:t,onSelect:r,onUpdateElement:n,onDeleteElement:a,onTemplateChange:i,scale:o=1,onZoomIn:u,onZoomOut:d,onPreview:c}){const h=b.useRef(null),p=b.useRef(null),m=b.useRef(null),v=b.useRef(null),x=b.useRef(null),y=b.useRef(null),S=b.useRef(null),[_,N]=X.useState(!1),[O,A]=X.useState(!1),C=b.useRef(null),[E,T]=X.useState({x:0,y:0}),R=b.useRef(null),L=Wp(e.width,e.unit),z=Wp(e.height,e.unit),F=e.showGrid!==!1,B=b.useCallback((k,I)=>{if(_||k.button===1)return;k.stopPropagation(),r(I),p.current?.focus();const D=e.elements.find(ie=>ie.id===I);if(!D)return;const Z=document.getElementById(`element-${I}`);Z&&(Z.classList.add("z-50","opacity-90","shadow-xl","ring-2","ring-blue-400","ring-offset-2"),Z.style.cursor="grabbing"),m.current={id:I,startX:k.clientX,startY:k.clientY,elX:D.x,elY:D.y},y.current={id:I,x:D.x,y:D.y},k.currentTarget.setPointerCapture?.(k.pointerId)},[e.elements,r,_]),q=b.useCallback(k=>{S.current!==null&&cancelAnimationFrame(S.current),S.current=requestAnimationFrame(()=>{k(),S.current=null})},[]),H=b.useCallback(k=>{if(O&&R.current){const I=k.clientX-R.current.startX,D=k.clientY-R.current.startY;T({x:R.current.x+I,y:R.current.y+D});return}if(O&&C.current&&h.current){const I=k.clientX-C.current.x,D=k.clientY-C.current.y;h.current.scrollLeft=C.current.scrollLeft-I,h.current.scrollTop=C.current.scrollTop-D;return}if(m.current){const{id:I,startX:D,startY:Z,elX:ie,elY:oe}=m.current,ne=k.clientX,K=k.clientY;q(()=>{const J=(ne-D)/o,ee=(K-Z)/o,ce=Math.max(0,ie+J),pe=Math.max(0,oe+ee),W=xs(ce),_e=xs(pe),Ce=document.getElementById(`element-${I}`);Ce&&(Ce.style.left=`${W}px`,Ce.style.top=`${_e}px`),y.current={id:I,x:W,y:_e}})}if(v.current){const{id:I,corner:D,startX:Z,startY:ie,w:oe,h:ne,elX:K,elY:J}=v.current,ee=k.clientX,ce=k.clientY;q(()=>{const pe=(ee-Z)/o,W=(ce-ie)/o;let _e=oe,Ce=ne,qe=K,De=J;D.includes("e")&&(_e=Math.max(20,oe+pe)),D.includes("w")&&(_e=Math.max(20,oe-pe),qe=K+pe),D.includes("s")&&(Ce=Math.max(12,ne+W)),D.includes("n")&&(Ce=Math.max(12,ne-W),De=J+W);const nt=xs(_e),kt=xs(Ce),Ut=xs(qe),lr=xs(De),Rt=document.getElementById(`element-${I}`);Rt&&(Rt.style.width=`${nt}px`,Rt.style.height=`${kt}px`,Rt.style.left=`${Ut}px`,Rt.style.top=`${lr}px`),y.current={id:I,width:nt,height:kt,x:Ut,y:lr}})}if(x.current&&i){const{edge:I,startX:D,startY:Z,startW:ie,startH:oe}=x.current,ne=k.clientX,K=k.clientY;q(()=>{const J=(ne-D)/o,ee=(K-Z)/o,ce=UI(J,e.unit),pe=UI(ee,e.unit);if(I==="bottom"){const W=Math.max(1,oe+pe);i({height:W})}else{const W=Math.max(1,ie+ce);i({width:W})}})}},[O,i,o,e.unit,q]),V=b.useCallback(()=>{O&&(A(!1),C.current=null,R.current=null),S.current!==null&&(cancelAnimationFrame(S.current),S.current=null);const k=m.current?.id||v.current?.id;if(k){const I=document.getElementById(`element-${k}`);I&&(I.classList.remove("z-50","opacity-90","shadow-xl","ring-2","ring-blue-400","ring-offset-2"),I.style.cursor="")}if(y.current){const{id:I,...D}=y.current;n(I,D),y.current=null}m.current=null,v.current=null,x.current=null},[n]);b.useEffect(()=>{const k=D=>{D.code==="Space"&&!D.repeat&&N(!0)},I=D=>{D.code==="Space"&&(N(!1),A(!1),C.current=null,R.current=null)};return window.addEventListener("keydown",k),window.addEventListener("keyup",I),()=>{window.removeEventListener("keydown",k),window.removeEventListener("keyup",I)}},[]),b.useEffect(()=>{const k=h.current;if(!k)return;const I=()=>{k.scrollLeft=Math.max(0,(k.scrollWidth-k.clientWidth)/2),k.scrollTop=Math.max(0,(k.scrollHeight-k.clientHeight)/2)},D=requestAnimationFrame(I),Z=setTimeout(I,100);return()=>{cancelAnimationFrame(D),clearTimeout(Z)}},[o,L,z]);const G=b.useCallback(k=>{if(!t)return;if(k.key==="Delete"||k.key==="Backspace"){k.preventDefault();const oe=e.elements.findIndex(ne=>ne.id===t);if(oe>=0){const ne=e.elements.filter(K=>K.id!==t);a(t),r(ne[oe]?.id??ne[oe-1]?.id??null)}return}const I=e.elements.find(oe=>oe.id===t);if(!I)return;const D=k.shiftKey?1:Uc;let Z=0,ie=0;switch(k.key){case"ArrowLeft":Z=-D;break;case"ArrowRight":Z=D;break;case"ArrowUp":ie=-D;break;case"ArrowDown":ie=-D;break;default:return}k.key==="ArrowDown"&&(ie=D),k.preventDefault(),n(I.id,{x:Math.max(0,I.x+Z),y:Math.max(0,I.y+ie)})},[t,e.elements,n,a,r]),U=k=>{(_||k.button===1)&&(k.preventDefault(),A(!0),C.current={x:k.clientX,y:k.clientY,scrollLeft:h.current?.scrollLeft||0,scrollTop:h.current?.scrollTop||0},k.currentTarget.setPointerCapture(k.pointerId))},$=k=>{if(O&&C.current&&h.current){const I=k.clientX-C.current.x,D=k.clientY-C.current.y;h.current.scrollLeft=C.current.scrollLeft-I,h.current.scrollTop=C.current.scrollTop-D}},Q=k=>{O&&(A(!1),C.current=null)};return l.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-gray-100",children:[l.jsxs("div",{className:"shrink-0 px-4 py-2 border-b border-gray-200 bg-white flex items-center justify-between gap-2 flex-wrap z-10",children:[l.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Label Preview"}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c&&l.jsx("button",{type:"button",onClick:c,className:"h-8 px-3 rounded border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 text-xs font-medium shadow-sm transition-all active:scale-95",children:"预览"}),i&&l.jsxs(l.Fragment,{children:[l.jsxs(Ke,{value:(()=>{const k=E1.findIndex(I=>I.width===e.width&&I.height===e.height&&I.unit===e.unit);return k>=0?String(k):"custom"})(),onValueChange:k=>{if(k==="custom")return;const I=E1[Number(k)];I&&i({width:I.width,height:I.height,unit:I.unit})},children:[l.jsx(Ye,{className:"h-8 w-[130px] text-xs",children:l.jsx(Xe,{placeholder:"画布大小"})}),l.jsxs(Je,{children:[E1.map((k,I)=>l.jsx(Ne,{value:String(I),className:"text-xs",children:k.name},I)),l.jsx(Ne,{value:"custom",className:"text-xs text-gray-500",children:"自定义"})]})]}),l.jsx("button",{type:"button",onClick:()=>i({showGrid:!F}),className:Ae("h-8 px-3 rounded border text-xs font-medium shadow-sm transition-colors",F?"border-gray-300 bg-white text-gray-700 hover:bg-gray-50":"border-gray-300 bg-gray-100 text-gray-500"),children:F?"隐藏网格":"显示网格"})]}),l.jsxs("div",{className:"flex items-center gap-1 bg-white rounded border border-gray-300 p-0.5 shadow-sm h-8",children:[l.jsx("button",{type:"button",onClick:d,disabled:!d,className:"h-6 w-6 rounded hover:bg-gray-100 text-gray-600 disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center text-sm font-medium active:scale-90 transition-transform",title:"缩小",children:"−"}),l.jsxs("span",{className:"min-w-[3rem] text-center text-xs text-gray-600 font-medium",children:[Math.round(o*100),"%"]}),l.jsx("button",{type:"button",onClick:u,disabled:!u,className:"h-6 w-6 rounded hover:bg-gray-100 text-gray-600 disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center text-sm font-medium active:scale-90 transition-transform",title:"放大",children:"+"})]})]})]}),l.jsx("div",{ref:h,className:Ae("flex-1 overflow-auto bg-gray-100 relative",_?"cursor-grab active:cursor-grabbing":""),onPointerDown:U,onPointerMove:$,onPointerUp:Q,onPointerLeave:Q,children:l.jsx("div",{style:{minWidth:"100%",minHeight:"100%",width:"fit-content",height:"fit-content",display:"flex",padding:50,boxSizing:"border-box",transform:`translate(${E.x}px, ${E.y}px)`},children:l.jsxs("div",{ref:p,tabIndex:0,className:Ae("relative bg-white shadow-lg border border-dashed border-gray-300 origin-top-left outline-none m-auto",O?"cursor-grabbing":"cursor-grab"),style:{width:L,height:z,transform:`scale(${o})`,backgroundImage:F?`linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px), - linear-gradient(to bottom, rgba(0,0,0,0.06) 1px, transparent 1px)`:void 0,backgroundSize:F?`${Uc}px ${Uc}px`:void 0,pointerEvents:_?"none":"auto"},onClick:k=>{const I=k.target,D=I.closest('[id^="element-"]'),Z=I.closest('[title*="拖拽拉高"]')||I.closest('[title*="拖拽拉宽"]');!D&&!Z&&r(null)},onPointerDown:k=>{const I=k.target,D=I.closest('[id^="element-"]'),Z=I.closest('[title*="拖拽拉高"]')||I.closest('[title*="拖拽拉宽"]');p.current?.contains(I)&&!D&&!Z&&!m.current&&!v.current&&(_||k.button===1)&&(k.preventDefault(),k.stopPropagation(),A(!0),R.current={x:E.x,y:E.y,startX:k.clientX,startY:k.clientY},C.current={x:k.clientX,y:k.clientY,scrollLeft:h.current?.scrollLeft??0,scrollTop:h.current?.scrollTop??0},k.currentTarget.setPointerCapture?.(k.pointerId))},onPointerMove:H,onPointerUp:V,onKeyDown:G,children:[e.showRuler&&l.jsxs("div",{className:"absolute top-0 left-0 right-0 h-5 border-b border-gray-300 bg-gray-50 text-[10px] text-gray-500 flex items-center px-1 pointer-events-none select-none",children:[e.unit," ",e.width," × ",e.height]}),i&&l.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-3 cursor-ns-resize flex items-center justify-center bg-gray-200/80 hover:bg-blue-400/30 border-t border-gray-300 text-[10px] text-gray-500 transition-colors",title:"拖拽拉高纸张",onPointerDown:k=>{k.stopPropagation(),x.current={edge:"bottom",startX:k.clientX,startY:k.clientY,startW:e.width,startH:e.height},k.target.setPointerCapture?.(k.pointerId)},children:"⋮"}),i&&l.jsx("div",{className:"absolute top-0 right-0 bottom-0 w-3 cursor-ew-resize flex items-center justify-center bg-gray-200/80 hover:bg-blue-400/30 border-l border-gray-300 text-[10px] text-gray-500 transition-colors",title:"拖拽拉宽纸张",onPointerDown:k=>{k.stopPropagation(),x.current={edge:"right",startX:k.clientX,startY:k.clientY,startW:e.width,startH:e.height},k.target.setPointerCapture?.(k.pointerId)},children:"⋮"}),e.elements.map(k=>l.jsxs("div",{id:`element-${k.id}`,className:Ae("absolute box-border cursor-move overflow-hidden transition-shadow",k.border==="line"&&"border border-gray-400",k.border==="dotted"&&"border border-dotted border-gray-400",t===k.id&&"ring-2 ring-blue-500 ring-offset-1 z-10"),style:{left:k.x,top:k.y,width:k.width,height:k.height},onClick:I=>{I.stopPropagation(),r(k.id)},onPointerDown:I=>B(I,k.id),children:[l.jsx(q5,{el:k}),t===k.id&&l.jsxs(l.Fragment,{children:[["nw","ne","sw","se"].map(I=>l.jsx("div",{className:"absolute w-4 h-4 bg-white border-2 border-blue-500 rounded-full z-20 shadow-md hover:scale-110 transition-transform",style:{cursor:"nwse-resize",top:I.startsWith("n")?-6:void 0,bottom:I.startsWith("s")?-6:void 0,left:I.endsWith("w")?-6:void 0,right:I.endsWith("e")?-6:void 0},onPointerDown:D=>{D.stopPropagation();const Z=e.elements.find(ie=>ie.id===k.id);v.current={id:k.id,corner:I,startX:D.clientX,startY:D.clientY,w:Z.width,h:Z.height,elX:Z.x,elY:Z.y},D.currentTarget.setPointerCapture?.(D.pointerId)}},I)),["n","s","w","e"].map(I=>l.jsx("div",{className:"absolute bg-blue-500/50 border border-white/50 rounded-sm z-10 shadow-sm hover:bg-blue-600",style:{cursor:I==="n"||I==="s"?"ns-resize":"ew-resize",width:I==="n"||I==="s"?"20px":"6px",height:I==="n"||I==="s"?"6px":"20px",top:I==="n"?-3:I==="s"?void 0:"50%",bottom:I==="s"?-3:void 0,left:I==="w"?-3:I==="e"?void 0:"50%",right:I==="e"?-3:void 0,transform:I==="n"||I==="s"?"translateX(-50%)":"translateY(-50%)"},onPointerDown:D=>{D.stopPropagation();const Z=e.elements.find(oe=>oe.id===k.id),ie=document.getElementById(`element-${k.id}`);ie&&ie.classList.add("z-50","opacity-90"),v.current={id:k.id,corner:I,startX:D.clientX,startY:D.clientY,w:Z.width,h:Z.height,elX:Z.x,elY:Z.y},D.currentTarget.setPointerCapture?.(D.pointerId)}},I))]})]},k.id))]})})})]})}function sde({template:e,maxWidth:t=480}){const r=Wp(e.width,e.unit),n=Wp(e.height,e.unit),a=t?Math.min(t/r,t/n,2):1,i=r*a,o=n*a;return l.jsx("div",{className:"flex items-center justify-center p-4 bg-gray-100 rounded",children:l.jsx("div",{style:{width:i,height:o},className:"relative bg-white shadow-lg overflow-hidden",children:l.jsx("div",{className:"origin-top-left",style:{position:"absolute",left:0,top:0,width:r,height:n,transform:`scale(${a})`,transformOrigin:"0 0"},children:e.elements.map(u=>l.jsx("div",{className:"absolute box-border overflow-hidden pointer-events-none flex items-center justify-center text-xs",style:{left:u.x,top:u.y,width:u.width,height:u.height,border:u.border==="line"?"1px solid #999":u.border==="dotted"?"1px dotted #999":void 0},children:l.jsx(q5,{el:u})},u.id))})})})}function lde({template:e,selectedElement:t,onTemplateChange:r,onElementChange:n,onDeleteElement:a,locations:i=[],readOnlyTemplateCode:o=!1}){return t?l.jsxs("div",{className:"w-72 shrink-0 border-l border-gray-200 bg-white flex flex-col h-full",children:[l.jsx("div",{className:"px-3 py-2 border-b border-gray-200 font-semibold text-gray-800",children:"Properties (Element)"}),l.jsx($s,{className:"flex-1",children:l.jsxs("div",{className:"p-3 space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"X"}),l.jsx(me,{type:"number",value:t.x,onChange:u=>n(t.id,{x:Number(u.target.value)||0}),className:"h-8 text-sm"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Y"}),l.jsx(me,{type:"number",value:t.y,onChange:u=>n(t.id,{y:Number(u.target.value)||0}),className:"h-8 text-sm"})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Width"}),l.jsx(me,{type:"number",value:t.width,onChange:u=>n(t.id,{width:Math.max(1,Number(u.target.value)||0)}),className:"h-8 text-sm"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Height"}),l.jsx(me,{type:"number",value:t.height,onChange:u=>n(t.id,{height:Math.max(1,Number(u.target.value)||0)}),className:"h-8 text-sm"})]})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Rotation"}),l.jsxs(Ke,{value:t.rotation,onValueChange:u=>n(t.id,{rotation:u}),children:[l.jsx(Ye,{className:"h-8 text-sm",children:l.jsx(Xe,{})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"horizontal",children:"horizontal"}),l.jsx(Ne,{value:"vertical",children:"vertical"})]})]})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Border"}),l.jsxs(Ke,{value:t.border,onValueChange:u=>n(t.id,{border:u}),children:[l.jsx(Ye,{className:"h-8 text-sm",children:l.jsx(Xe,{})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"none",children:"none"}),l.jsx(Ne,{value:"line",children:"line"}),l.jsx(Ne,{value:"dotted",children:"dotted"})]})]})]}),l.jsx(cde,{element:t,onChange:u=>n(t.id,{config:{...t.config,...u}})}),a&&l.jsx("div",{className:"pt-4 border-t border-gray-100",children:l.jsx(fe,{variant:"destructive",className:"w-full",onClick:()=>a(t.id),children:"Delete Element"})})]})})]}):l.jsxs("div",{className:"w-72 shrink-0 border-l border-gray-200 bg-white flex flex-col h-full",children:[l.jsx("div",{className:"px-3 py-2 border-b border-gray-200 font-semibold text-gray-800",children:"Properties (Template)"}),l.jsx($s,{className:"flex-1",children:l.jsxs("div",{className:"p-3 space-y-3",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Template Code"}),l.jsx(me,{value:e.id,disabled:o,onChange:u=>r({id:u.target.value.trim()}),className:"h-8 text-sm mt-1",placeholder:"e.g. TPL_TEST_001"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Template Name"}),l.jsx(me,{value:e.name,onChange:u=>r({name:u.target.value}),className:"h-8 text-sm mt-1"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Label Type"}),l.jsxs(Ke,{value:e.labelType,onValueChange:u=>r({labelType:u}),children:[l.jsx(Ye,{className:"h-8 text-sm mt-1",children:l.jsx(Xe,{})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"PRICE",children:"PRICE"}),l.jsx(Ne,{value:"NUTRITION",children:"NUTRITION"}),l.jsx(Ne,{value:"SHIPPING",children:"SHIPPING"})]})]})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Applied Location"}),l.jsxs(Ke,{value:e.appliedLocation,onValueChange:u=>{r(u==="ALL"?{appliedLocation:u,appliedLocationIds:[]}:{appliedLocation:u})},children:[l.jsx(Ye,{className:"h-8 text-sm mt-1",children:l.jsx(Xe,{})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"ALL",children:"All locations"}),l.jsx(Ne,{value:"SPECIFIED",children:"Specified locations"})]})]})]}),e.appliedLocation==="SPECIFIED"&&l.jsxs("div",{className:"rounded-md border border-gray-200 p-2 max-h-40 overflow-y-auto space-y-2",children:[l.jsx(ue,{className:"text-xs text-gray-600",children:"Select locations"}),i.length===0?l.jsx("p",{className:"text-xs text-gray-500",children:"No locations loaded."}):i.map(u=>{const d=(e.appliedLocationIds??[]).includes(u.id);return l.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[l.jsx(Eu,{checked:d,onCheckedChange:c=>{const h=c===!0,p=new Set(e.appliedLocationIds??[]);h?p.add(u.id):p.delete(u.id),r({appliedLocationIds:Array.from(p)})}}),l.jsx("span",{className:"truncate",children:(u.locationName??u.locationCode??u.id).trim()||u.id})]},u.id)})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Width"}),l.jsx(me,{type:"number",value:e.width,onChange:u=>r({width:Math.max(.1,Number(u.target.value)||0)}),className:"h-8 text-sm"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Height"}),l.jsx(me,{type:"number",value:e.height,onChange:u=>r({height:Math.max(.1,Number(u.target.value)||0)}),className:"h-8 text-sm"})]})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Unit"}),l.jsxs(Ke,{value:e.unit,onValueChange:u=>r({unit:u}),children:[l.jsx(Ye,{className:"h-8 text-sm mt-1",children:l.jsx(Xe,{})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"cm",children:"cm"}),l.jsx(Ne,{value:"inch",children:"inch"})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qt,{checked:e.showRuler,onCheckedChange:u=>r({showRuler:u})}),l.jsx(ue,{className:"text-xs",children:"Show Ruler"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qt,{checked:e.showGrid??!0,onCheckedChange:u=>r({showGrid:u})}),l.jsx(ue,{className:"text-xs",children:"Show Grid"})]})]})})]})}function cde({element:e,onChange:t}){const r=e.config,n=(a,i)=>t({[a]:i});switch(e.type){case"TEXT_STATIC":case"TEXT_PRODUCT":case"TEXT_PRICE":return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Text"}),l.jsx(me,{value:r.text??"0.00",onChange:a=>n("text",a.target.value),className:"h-8 text-sm mt-1"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Prefix"}),l.jsx(me,{value:r.prefix??"¥",onChange:a=>n("prefix",a.target.value),className:"h-8 text-sm mt-1"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Font Size"}),l.jsx(me,{type:"number",value:r.fontSize??14,onChange:a=>n("fontSize",Number(a.target.value)||14),className:"h-8 text-sm mt-1"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Text Align"}),l.jsxs(Ke,{value:r.textAlign??"right",onValueChange:a=>n("textAlign",a),children:[l.jsx(Ye,{className:"h-8 text-sm mt-1",children:l.jsx(Xe,{})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"left",children:"Left"}),l.jsx(Ne,{value:"center",children:"Center"}),l.jsx(Ne,{value:"right",children:"Right"})]})]})]})]});case"BARCODE":return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Data"}),l.jsx(me,{value:r.data??"123456789",onChange:a=>n("data",a.target.value),className:"h-8 text-sm mt-1"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"方向"}),l.jsxs(Ke,{value:r.orientation??"horizontal",onValueChange:a=>n("orientation",a),children:[l.jsx(Ye,{className:"h-8 text-sm mt-1",children:l.jsx(Xe,{})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"horizontal",children:"水平"}),l.jsx(Ne,{value:"vertical",children:"竖排"})]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qt,{checked:r.showText!==!1,onCheckedChange:a=>n("showText",a)}),l.jsx(ue,{className:"text-xs",children:"Show Text"})]})]});case"QRCODE":return l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Data (URL)"}),l.jsx(me,{value:r.data??"https://example.com",onChange:a=>n("data",a.target.value),className:"h-8 text-sm mt-1"})]});case"IMAGE":return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Image URL"}),l.jsx(me,{value:r.src??"",onChange:a=>n("src",a.target.value),className:"h-8 text-sm mt-1",placeholder:"输入图片URL或路径"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Scale Mode"}),l.jsxs(Ke,{value:r.scaleMode??"contain",onValueChange:a=>n("scaleMode",a),children:[l.jsx(Ye,{className:"h-8 text-sm mt-1",children:l.jsx(Xe,{})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"contain",children:"Contain"}),l.jsx(Ne,{value:"cover",children:"Cover"}),l.jsx(Ne,{value:"fill",children:"Fill"})]})]})]})]});case"DATE":return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Format"}),l.jsx(me,{value:r.format??"YYYY-MM-DD",onChange:a=>n("format",a.target.value),className:"h-8 text-sm mt-1",placeholder:"YYYY-MM-DD"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Offset Days"}),l.jsx(me,{type:"number",value:r.offsetDays??0,onChange:a=>n("offsetDays",Number(a.target.value)||0),className:"h-8 text-sm mt-1"})]})]});case"TIME":return l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Format"}),l.jsx(me,{value:r.format??"HH:mm",onChange:a=>n("format",a.target.value),className:"h-8 text-sm mt-1",placeholder:"HH:mm"})]});case"DURATION":return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Format"}),l.jsx(me,{value:r.format??"YYYY-MM-DD",onChange:a=>n("format",a.target.value),className:"h-8 text-sm mt-1",placeholder:"YYYY-MM-DD"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Offset Days"}),l.jsx(me,{type:"number",value:r.offsetDays??3,onChange:a=>n("offsetDays",Number(a.target.value)||3),className:"h-8 text-sm mt-1"})]})]});case"WEIGHT":return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Value"}),l.jsx(me,{type:"number",value:r.value??500,onChange:a=>n("value",Number(a.target.value)||0),className:"h-8 text-sm mt-1"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Unit"}),l.jsxs(Ke,{value:r.unit??"g",onValueChange:a=>n("unit",a),children:[l.jsx(Ye,{className:"h-8 text-sm mt-1",children:l.jsx(Xe,{})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"g",children:"g"}),l.jsx(Ne,{value:"kg",children:"kg"}),l.jsx(Ne,{value:"oz",children:"oz"}),l.jsx(Ne,{value:"lb",children:"lb"})]})]})]})]});case"WEIGHT_PRICE":return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Unit Price"}),l.jsx(me,{type:"number",value:r.unitPrice??10,onChange:a=>n("unitPrice",Number(a.target.value)||0),className:"h-8 text-sm mt-1"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Weight"}),l.jsx(me,{type:"number",step:"0.1",value:r.weight??.5,onChange:a=>n("weight",Number(a.target.value)||0),className:"h-8 text-sm mt-1"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Currency"}),l.jsx(me,{value:r.currency??"¥",onChange:a=>n("currency",a.target.value),className:"h-8 text-sm mt-1"})]})]});case"NUTRITION":return l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Calories"}),l.jsx(me,{type:"number",value:r.calories??120,onChange:a=>n("calories",Number(a.target.value)||0),className:"h-8 text-sm mt-1"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Fat"}),l.jsx(me,{value:r.fat??"5g",onChange:a=>n("fat",a.target.value),className:"h-8 text-sm mt-1"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Protein"}),l.jsx(me,{value:r.protein??"3g",onChange:a=>n("protein",a.target.value),className:"h-8 text-sm mt-1"})]}),l.jsxs("div",{children:[l.jsx(ue,{className:"text-xs",children:"Carbs"}),l.jsx(me,{value:r.carbs??"10g",onChange:a=>n("carbs",a.target.value),className:"h-8 text-sm mt-1"})]})]});case"BLANK":return l.jsx("div",{className:"text-xs text-gray-500",children:"Blank spacer; no configuration needed."});default:return l.jsxs("div",{className:"text-xs text-gray-500",children:["Config for ",e.type," (edit in code if needed)"]})}}const ude=.5,dde=2,VI=.25,fde=1;function hde({templateId:e,initialTemplate:t,onClose:r,onSaved:n}){const[a,i]=b.useState(()=>t?{...t}:oue(e??void 0)),[o,u]=b.useState(null),[d,c]=b.useState(fde),[h,p]=b.useState(!1),[m,v]=b.useState([]);b.useEffect(()=>{let C=!1;return(async()=>{try{const E=await Al({skipCount:0,maxResultCount:500});C||v(E.items??[])}catch{C||v([])}})(),()=>{C=!0}},[]);const x=a.elements.find(C=>C.id===o)??null,y=b.useCallback((C,E)=>{const T=(U,$)=>$==="cm"?U*37.8:U*96,R=T(a.width,a.unit),L=T(a.height,a.unit),z=zR(C,0,0),F=8,B=U=>Math.round(U/F)*F;let q=(R-z.width)/2,H=(L-z.height)/2;const V=(U,$,Q,k)=>a.elements.some(I=>{const D=I.x+I.width,Z=I.y+I.height,ie=U+Q,oe=$+k;return!(U>=D||ie<=I.x||$>=Z||oe<=I.y)});if(V(q,H,z.width,z.height)){const U=F*2;let $=!1;for(let Q=H;Q=0&&!$;Q-=U)for(let k=q;k>=0&&!$;k-=U)if(!V(k,Q,z.width,z.height)){q=k,H=Q,$=!0;break}}}const G=zR(C,Math.max(0,B(q)),Math.max(0,B(H)));E&&Object.keys(E).length>0&&(G.config={...G.config,...E}),i(U=>({...U,elements:[...U.elements,G]})),u(G.id)},[a.width,a.height,a.unit,a.elements]),S=b.useCallback((C,E)=>{i(T=>({...T,elements:T.elements.map(R=>R.id===C?{...R,...E}:R)}))},[]),_=b.useCallback(C=>{i(E=>({...E,elements:E.elements.filter(T=>T.id!==C)})),u(null)},[]),N=b.useCallback(C=>{i(E=>({...E,...C}))},[]),O=b.useCallback(async()=>{try{const C=(a.id??"").trim();if(!C){xe.error("Template code is required.",{description:"Please enter a template code (e.g. TPL_TEST_001)."});return}if(a.appliedLocation==="SPECIFIED"&&!(a.appliedLocationIds?.length??0)){xe.error("Locations required.",{description:"When using specified locations, select at least one location."});return}const E={id:C,name:a.name,labelType:a.labelType,unit:a.unit,width:a.width,height:a.height,appliedLocation:a.appliedLocation,showRuler:a.showRuler,showGrid:a.showGrid??!0,state:!0,elements:a.elements.map((T,R)=>({id:T.id,type:T.type,x:T.x,y:T.y,width:T.width,height:T.height,rotation:T.rotation,border:T.border,zIndex:T.zIndex??R+1,orderNum:T.orderNum??R+1,valueSourceType:T.valueSourceType??sue(T.type),isRequiredInput:T.isRequiredInput??!1,config:T.config})),appliedLocationIds:a.appliedLocation==="ALL"?[]:a.appliedLocationIds??[]};e?(await Lce(C,E),xe.success("Template updated.",{description:"The template has been updated successfully."})):(await Dce(E),xe.success("Template created.",{description:"The template has been created successfully."})),n(),r()}catch(C){xe.error("Failed to save template.",{description:C?.message?String(C.message):"Please try again."})}},[a,e,n,r]),A=b.useCallback(()=>{const C=new Blob([JSON.stringify(a,null,2)],{type:"application/json"}),E=URL.createObjectURL(C),T=document.createElement("a");T.href=E,T.download=`label-template-${a.id}.json`,T.click(),URL.revokeObjectURL(E)},[a]);return l.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[l.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200 bg-white shrink-0",children:[l.jsxs(fe,{variant:"outline",size:"sm",onClick:r,children:[l.jsx(xz,{className:"w-4 h-4 mr-1"}),"Back"]}),l.jsx("span",{className:"text-sm font-medium text-gray-700 truncate flex-1",children:a.name}),l.jsxs(fe,{size:"sm",onClick:A,variant:"outline",children:[l.jsx(CS,{className:"w-4 h-4 mr-1"}),"Export JSON"]}),l.jsxs(fe,{size:"sm",className:"bg-blue-600 hover:bg-blue-700 text-white",onClick:O,children:[l.jsx(d8,{className:"w-4 h-4 mr-1"}),"Save"]})]}),l.jsxs("div",{className:"flex flex-1 min-h-0",children:[l.jsx(cue,{onAddElement:y}),l.jsx(ode,{template:a,selectedId:o,onSelect:u,onUpdateElement:S,onDeleteElement:_,onTemplateChange:N,scale:d,onZoomIn:()=>c(C=>Math.min(dde,C+VI)),onZoomOut:()=>c(C=>Math.max(ude,C-VI)),onPreview:()=>p(!0)}),l.jsx(mt,{open:h,onOpenChange:p,children:l.jsxs(ft,{className:"max-w-[90vw] max-h-[90vh] overflow-auto",children:[l.jsx(gt,{children:l.jsx(vt,{children:"标签预览"})}),l.jsx(sde,{template:a,maxWidth:500})]})}),l.jsx(lde,{template:a,selectedElement:x,onTemplateChange:N,onElementChange:S,onDeleteElement:_,locations:m,readOnlyTemplateCode:!!e})]})]})}function A1(e){const t=(e??"").trim();return t||"None"}function pde(e,t){if(w5(e)==="ALL")return"All";const n=e.appliedLocationIds??[];if(n.length===0)return"Specified (0)";const a=n.map(i=>t.find(o=>o.id===i)?.locationName?.trim()||i);return a.length<=2?a.join(", "):`${a.slice(0,2).join(", ")} +${a.length-2}`}function mde(e){const t=(e.templateName??e.name??"").trim();return t||"None"}function gde(e){const t=(e.templateCode??e.id??"").trim();return t||"None"}function vde(e,t){const r=(e.locationText??"").trim();return r||pde(e,t)}function yde(e){return typeof e.contentsCount=="number"?e.contentsCount:e.elements?.length??0}function xde(e){const t=(e.sizeText??"").trim();if(t)return t;const r=e.width,n=e.height,a=e.unit;return r!=null&&n!=null&&a?`${r}×${n} ${a}`:"None"}function bde(){const[e,t]=b.useState([]),[r,n]=b.useState("list"),[a,i]=b.useState(null),[o,u]=b.useState(null),[d,c]=b.useState(!1),[h,p]=b.useState(0),[m,v]=b.useState(0),[x,y]=b.useState(null),[S,_]=b.useState(!1),[N,O]=b.useState(null),[A,C]=b.useState(""),[E,T]=b.useState("all"),[R,L]=b.useState("all"),[z,F]=b.useState("all"),[B,q]=b.useState(1),[H,V]=b.useState(10),[G,U]=b.useState([]),$=b.useRef(null),Q=b.useRef(null),[k,I]=b.useState("");b.useEffect(()=>(Q.current&&window.clearTimeout(Q.current),Q.current=window.setTimeout(()=>I(A.trim()),300),()=>{Q.current&&window.clearTimeout(Q.current)}),[A]);const D=Math.max(1,Math.ceil(h/H));b.useEffect(()=>{let J=!1;return(async()=>{try{const ee=await Al({skipCount:0,maxResultCount:500});J||U(ee.items??[])}catch{J||U([])}})(),()=>{J=!0}},[]),b.useEffect(()=>{q(1)},[k,E,R,z,H]),b.useEffect(()=>r!=="list"?void 0:((async()=>{$.current?.abort();const ee=new AbortController;$.current=ee,c(!0);try{const ce=(B-1)*H,pe=await v5({skipCount:ce,maxResultCount:H,keyword:k||void 0,locationId:E!=="all"?E:void 0,labelType:R!=="all"?R:void 0,state:z==="all"?void 0:z==="true"},ee.signal);t(pe.items??[]),p(pe.totalCount??0)}catch(ce){if(ce?.name==="AbortError")return;xe.error("Failed to load label templates.",{description:ce?.message?String(ce.message):"Please try again."}),t([]),p(0)}finally{c(!1)}})(),()=>$.current?.abort()),[k,E,R,z,B,H,m,r]);const Z=()=>v(J=>J+1),ie=()=>{i(null),u(null),n("editor")},oe=async J=>{i(J),c(!0);try{const ee=await Mce(J),ce={id:ee.id,name:(ee.name??ee.templateName??"").trim()||"未命名模板",labelType:ee.labelType??"PRICE",unit:ee.unit??"cm",width:ee.width??6,height:ee.height??4,appliedLocation:w5(ee),appliedLocationIds:[...ee.appliedLocationIds??[]],showRuler:ee.showRuler??!0,showGrid:ee.showGrid??!0,elements:ee.elements??[]};u(ce),n("editor")}catch(ee){xe.error("Failed to load template.",{description:ee?.message?String(ee.message):"Please try again."})}finally{c(!1)}},ne=()=>{n("list"),i(null),u(null)},K=J=>{y(null),O(J),_(!0)};return r==="editor"?l.jsx("div",{className:"h-[calc(100vh-8rem)] min-h-[500px] flex flex-col",children:l.jsx(hde,{templateId:a,initialTemplate:o,onClose:ne,onSaved:Z})}):l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsx("div",{className:"pb-4",children:l.jsx("div",{className:"flex flex-col gap-4",children:l.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[l.jsx(me,{placeholder:"Search",value:A,onChange:J=>C(J.target.value),style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),l.jsxs(Ke,{value:E,onValueChange:T,children:[l.jsx(Ye,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Location"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"all",children:"All Locations"}),G.map(J=>l.jsx(Ne,{value:J.id,children:A1(J.locationName??J.locationCode??J.id)},J.id))]})]}),l.jsxs(Ke,{value:R,onValueChange:L,children:[l.jsx(Ye,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Label Type"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"all",children:"All Types"}),l.jsx(Ne,{value:"PRICE",children:"PRICE"}),l.jsx(Ne,{value:"NUTRITION",children:"NUTRITION"}),l.jsx(Ne,{value:"SHIPPING",children:"SHIPPING"})]})]}),l.jsxs(Ke,{value:z,onValueChange:F,children:[l.jsx(Ye,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"State"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"all",children:"All States"}),l.jsx(Ne,{value:"true",children:"Active"}),l.jsx(Ne,{value:"false",children:"Inactive"})]})]}),l.jsx("div",{className:"flex-1"}),l.jsxs(fe,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0",onClick:ie,children:["New Label Template ",l.jsx(wn,{className:"ml-1 w-4 h-4"})]})]})})}),l.jsx("div",{className:"flex-1 overflow-auto pt-6",children:l.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-50 hover:bg-gray-50",children:[l.jsx(ve,{className:"font-bold text-gray-900 w-[180px]",children:"Label Template"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[120px]",children:"Template Code"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[120px]",children:"Location"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[100px]",children:"Label Type"}),l.jsx(ve,{className:"font-bold text-gray-900",children:"Contents"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[150px]",children:"Size"}),l.jsx(ve,{className:"font-bold text-gray-900 text-center w-[100px]",children:"Actions"})]})}),l.jsx(Pr,{children:d?l.jsx(Be,{children:l.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):e.length===0?l.jsx(Be,{children:l.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:'No templates yet. Click "New Label Template" to create one.'})}):e.map(J=>l.jsxs(Be,{className:"hover:bg-gray-50",children:[l.jsx(de,{className:"font-medium whitespace-nowrap overflow-hidden text-ellipsis max-w-[180px]",children:mde(J)}),l.jsx(de,{className:"text-gray-600 whitespace-nowrap overflow-hidden text-ellipsis max-w-[140px]",children:gde(J)}),l.jsx(de,{className:"whitespace-nowrap overflow-hidden text-ellipsis max-w-[140px]",children:A1(vde(J,G))}),l.jsx(de,{className:"whitespace-nowrap",children:A1(J.labelType)}),l.jsxs(de,{className:"text-sm text-gray-600 whitespace-nowrap",children:[yde(J)," element(s)"]}),l.jsx(de,{className:"whitespace-nowrap overflow-hidden text-ellipsis max-w-[160px]",children:xde(J)}),l.jsx(de,{className:"text-center",children:l.jsxs(ma,{open:x===J.id,onOpenChange:ee=>y(ee?J.id:null),children:[l.jsx(ga,{asChild:!0,children:l.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:l.jsx(Ei,{className:"h-4 w-4 text-gray-500"})})}),l.jsxs(va,{align:"end",className:"w-40 p-1",children:[l.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>oe(J.id),children:[l.jsx(_h,{className:"w-4 h-4"}),"Edit"]}),l.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>K(J),children:"Delete"})]})]})})]},J.id))})]})})}),l.jsx("div",{className:"pt-4",children:l.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[l.jsxs("div",{children:["Showing ",h===0?0:(B-1)*H+1,"-",Math.min(B*H,h)," of ",h]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Ke,{value:String(H),onValueChange:J=>V(Number(J)),children:[l.jsx(Ye,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:l.jsx(Xe,{})}),l.jsx(Je,{children:[10,20,50].map(J=>l.jsxs(Ne,{value:String(J),children:[J," / page"]},J))})]}),l.jsx(_i,{className:"mx-0 w-auto justify-end",children:l.jsxs(Ni,{children:[l.jsx(At,{children:l.jsx(Ci,{href:"#",size:"default",onClick:J=>{J.preventDefault(),q(ee=>Math.max(1,ee-1))},"aria-disabled":B<=1,className:B<=1?"pointer-events-none opacity-50":""})}),l.jsx(At,{children:l.jsxs(ua,{href:"#",isActive:!0,size:"default",onClick:J=>J.preventDefault(),children:["Page ",B," / ",D]})}),l.jsx(At,{children:l.jsx(Oi,{href:"#",size:"default",onClick:J=>{J.preventDefault(),q(ee=>Math.min(D,ee+1))},"aria-disabled":B>=D,className:B>=D?"pointer-events-none opacity-50":""})})]})})]})]})}),l.jsx(wde,{open:S,template:N,onOpenChange:J=>{_(J),J||O(null)},onDeleted:Z})]})}function wde({open:e,template:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>(t?.templateName??t?.name??"").trim()||(t?.templateCode??t?.id??"").trim()||"this template",[t]),u=async()=>{if(t?.id){i(!0);try{await $ce(t.id),xe.success("Label template deleted.",{description:"The label template has been removed successfully."}),r(!1),n()}catch(d){xe.error("Failed to delete label template.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-none",style:{width:"30%"},children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Delete Label Template"}),l.jsx(Nt,{children:"This action cannot be undone."})]}),l.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",l.jsx("span",{className:"font-medium",children:o}),"?"]}),l.jsxs(xt,{className:"flex-row flex-wrap justify-end",children:[l.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}const og=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),sg="/label-multiple-option";function Sde(e){if(e==null)return[];if(Array.isArray(e))return e.map(t=>String(t));if(typeof e=="string"){const t=e.trim();if(!t)return[];try{const r=JSON.parse(t);return Array.isArray(r)?r.map(n=>String(n)):[]}catch{return[]}}return[]}function l_(e){return{...e,optionValuesJson:Sde(e.optionValuesJson)}}function jde(e){return{totalCount:e.totalCount??0,items:(e.items??[]).map(l_)}}function U5(e){return JSON.stringify(e)}async function _de(e,t){const r=await og.requestJson({path:sg,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,State:e.state},signal:t});return jde(r)}async function Nde(e){const t=await og.requestJson({path:sg,method:"POST",body:{optionCode:e.optionCode,optionName:e.optionName,optionValuesJson:U5(e.optionValuesJson),state:e.state??!0,orderNum:e.orderNum}});return l_(t)}async function Cde(e,t){const r=await og.requestJson({path:`${sg}/${encodeURIComponent(e)}`,method:"PUT",body:{optionCode:t.optionCode,optionName:t.optionName,optionValuesJson:U5(t.optionValuesJson),state:t.state??!0,orderNum:t.orderNum}});return l_(r)}async function Ode(e){await og.requestJson({path:`${sg}/${encodeURIComponent(e)}`,method:"DELETE"})}function HI(e){const t=(e??"").trim();return t||"None"}function Ede(){const[e,t]=b.useState(!1),[r,n]=b.useState(!1),[a,i]=b.useState(!1),[o,u]=b.useState(null),[d,c]=b.useState(null),[h,p]=b.useState([]),[m,v]=b.useState(!1),[x,y]=b.useState(0),[S,_]=b.useState(0),[N,O]=b.useState(null),[A,C]=b.useState(""),[E,T]=b.useState("all"),[R,L]=b.useState(1),[z,F]=b.useState(10),B=b.useRef(null),q=b.useRef(null),[H,V]=b.useState("");b.useEffect(()=>(q.current&&window.clearTimeout(q.current),q.current=window.setTimeout(()=>V(A.trim()),300),()=>{q.current&&window.clearTimeout(q.current)}),[A]);const G=Math.max(1,Math.ceil(x/z));b.useEffect(()=>{L(1)},[H,E,z]),b.useEffect(()=>((async()=>{B.current?.abort();const I=new AbortController;B.current=I,v(!0);try{const D=(R-1)*z,Z=await _de({skipCount:D,maxResultCount:z,keyword:H||void 0,state:E==="all"?void 0:E==="true"},I.signal);p(Z.items??[]),y(Z.totalCount??0)}catch(D){if(D?.name==="AbortError")return;xe.error("Failed to load multiple options.",{description:D?.message?String(D.message):"Please try again."}),p([]),y(0)}finally{v(!1)}})(),()=>B.current?.abort()),[H,E,R,z,S]);const U=()=>_(k=>k+1),$=k=>{O(null),u(k),n(!0)},Q=k=>{O(null),c(k),i(!0)};return l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsx("div",{className:"pb-4",children:l.jsx("div",{className:"flex flex-col gap-4",children:l.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[l.jsx(me,{placeholder:"Search",value:A,onChange:k=>C(k.target.value),style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),l.jsxs(Ke,{value:E,onValueChange:T,children:[l.jsx(Ye,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"State"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"all",children:"All States"}),l.jsx(Ne,{value:"true",children:"Active"}),l.jsx(Ne,{value:"false",children:"Inactive"})]})]}),l.jsx("div",{className:"flex-1"}),l.jsxs(fe,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0",onClick:()=>t(!0),children:["New Multiple Options ",l.jsx(wn,{className:"ml-1 h-4 w-4"})]})]})})}),l.jsx("div",{className:"flex-1 overflow-auto pt-6",children:l.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-50 hover:bg-gray-50",children:[l.jsx(ve,{className:"font-bold text-gray-900 w-[200px]",children:"Multiple Option Name"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[200px]",children:"Option Code"}),l.jsx(ve,{className:"font-bold text-gray-900",children:"Contents"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[100px]",children:"State"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[100px]",children:"Order"}),l.jsx(ve,{className:"font-bold text-gray-900 w-[180px]",children:"Last Edited"}),l.jsx(ve,{className:"font-bold text-gray-900 text-center w-[100px]",children:"Actions"})]})}),l.jsx(Pr,{children:m?l.jsx(Be,{children:l.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):h.length===0?l.jsx(Be,{children:l.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):h.map(k=>l.jsxs(Be,{className:"hover:bg-gray-50",children:[l.jsx(de,{className:"font-medium",children:HI(k.optionName)}),l.jsx(de,{className:"text-gray-600",children:HI(k.optionCode)}),l.jsx(de,{className:"text-gray-600",children:k.optionValuesJson&&k.optionValuesJson.length>0?k.optionValuesJson.join("; "):"None"}),l.jsx(de,{children:l.jsx(xr,{className:k.state?"bg-green-600":"bg-gray-400",children:k.state?"Active":"Inactive"})}),l.jsx(de,{className:"font-numeric",children:k.orderNum??"None"}),l.jsx(de,{className:"text-gray-500 tabular-nums font-numeric",children:k.creationTime?new Date(k.creationTime).toLocaleString():"None"}),l.jsx(de,{className:"text-center",children:l.jsxs(ma,{open:N===k.id,onOpenChange:I=>O(I?k.id:null),children:[l.jsx(ga,{asChild:!0,children:l.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:l.jsx(Ei,{className:"h-4 w-4 text-gray-500"})})}),l.jsxs(va,{align:"end",className:"w-40 p-1",children:[l.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>$(k),children:[l.jsx(xn,{className:"w-4 h-4"}),"Edit"]}),l.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>Q(k),children:"Delete"})]})]})})]},k.id))})]})})}),l.jsx("div",{className:"pt-4",children:l.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[l.jsxs("div",{children:["Showing ",x===0?0:(R-1)*z+1,"-",Math.min(R*z,x)," of ",x]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Ke,{value:String(z),onValueChange:k=>F(Number(k)),children:[l.jsx(Ye,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:l.jsx(Xe,{})}),l.jsx(Je,{children:[10,20,50].map(k=>l.jsxs(Ne,{value:String(k),children:[k," / page"]},k))})]}),l.jsx(_i,{className:"mx-0 w-auto justify-end",children:l.jsxs(Ni,{children:[l.jsx(At,{children:l.jsx(Ci,{href:"#",size:"default",onClick:k=>{k.preventDefault(),L(I=>Math.max(1,I-1))},"aria-disabled":R<=1,className:R<=1?"pointer-events-none opacity-50":""})}),l.jsx(At,{children:l.jsxs(ua,{href:"#",isActive:!0,size:"default",onClick:k=>k.preventDefault(),children:["Page ",R," / ",G]})}),l.jsx(At,{children:l.jsx(Oi,{href:"#",size:"default",onClick:k=>{k.preventDefault(),L(I=>Math.min(G,I+1))},"aria-disabled":R>=G,className:R>=G?"pointer-events-none opacity-50":""})})]})})]})]})}),l.jsx(Pde,{open:e,onOpenChange:t,onCreated:()=>{L(1),U()}}),l.jsx(Ade,{open:r,option:o,onOpenChange:k=>{n(k),k||u(null)},onUpdated:U}),l.jsx(Tde,{open:a,option:d,onOpenChange:k=>{i(k),k||c(null)},onDeleted:U})]})}function Pde({open:e,onOpenChange:t,onCreated:r}){const[n,a]=b.useState(!1),[i,o]=b.useState({optionCode:"",optionName:"",optionValuesJson:[],state:!0,orderNum:null}),[u,d]=b.useState(""),c=()=>{o({optionCode:"",optionName:"",optionValuesJson:[],state:!0,orderNum:null}),d("")};b.useEffect(()=>{e||c()},[e]);const h=()=>{const v=u.trim();if(v){if(i.optionValuesJson.includes(v)){xe.error("Duplicate value",{description:"This value already exists."});return}o(x=>({...x,optionValuesJson:[...x.optionValuesJson,v]})),d("")}},p=v=>{o(x=>({...x,optionValuesJson:x.optionValuesJson.filter((y,S)=>S!==v)}))},m=async()=>{if(!i.optionCode.trim()||!i.optionName.trim()){xe.error("Validation failed",{description:"Option Code and Option Name are required."});return}if(i.optionValuesJson.length===0){xe.error("Validation failed",{description:"At least one option value is required."});return}a(!0);try{await Nde(i),xe.success("Multiple option created.",{description:"The multiple option has been created successfully."}),t(!1),r()}catch(v){xe.error("Failed to create multiple option.",{description:v?.message?String(v.message):"Please try again."})}finally{a(!1)}};return l.jsx(mt,{open:e,onOpenChange:t,children:l.jsxs(ft,{className:"sm:max-w-[600px]",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Add New Multiple Option"}),l.jsx(Nt,{children:"Enter the details for the new multiple option."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Option Code *"}),l.jsx(me,{placeholder:"e.g. OPT_ALLERGENS",value:i.optionCode,onChange:v=>o(x=>({...x,optionCode:v.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Option Name *"}),l.jsx(me,{placeholder:"e.g. Allergens",value:i.optionName,onChange:v=>o(x=>({...x,optionName:v.target.value}))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Option Values *"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(me,{placeholder:"Enter a value and press Add",value:u,onChange:v=>d(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),h())}}),l.jsx(fe,{type:"button",onClick:h,variant:"outline",children:"Add"})]}),i.optionValuesJson.length>0&&l.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:i.optionValuesJson.map((v,x)=>l.jsxs(xr,{variant:"secondary",className:"flex items-center gap-1",children:[v,l.jsx("button",{type:"button",onClick:()=>p(x),className:"ml-1 hover:text-red-600",children:l.jsx(uo,{className:"h-3 w-3"})})]},x))})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Order"}),l.jsx(me,{type:"number",placeholder:"e.g. 1",value:i.orderNum??"",onChange:v=>o(x=>({...x,orderNum:v.target.value?Number(v.target.value):null}))})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),l.jsx(qt,{checked:i.state,onCheckedChange:v=>o(x=>({...x,state:v}))})]})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsx(fe,{disabled:n,onClick:m,children:n?"Creating...":"Create"})]})]})})}function Ade({open:e,option:t,onOpenChange:r,onUpdated:n}){const[a,i]=b.useState(!1),[o,u]=b.useState({optionCode:"",optionName:"",optionValuesJson:[],state:!0,orderNum:null}),[d,c]=b.useState("");b.useEffect(()=>{e&&t&&(u({optionCode:t.optionCode??"",optionName:t.optionName??"",optionValuesJson:t.optionValuesJson??[],state:t.state??!0,orderNum:t.orderNum??null}),c(""))},[e,t]);const h=()=>{const v=d.trim();if(v){if(o.optionValuesJson.includes(v)){xe.error("Duplicate value",{description:"This value already exists."});return}u(x=>({...x,optionValuesJson:[...x.optionValuesJson,v]})),c("")}},p=v=>{u(x=>({...x,optionValuesJson:x.optionValuesJson.filter((y,S)=>S!==v)}))},m=async()=>{if(t?.id){if(!o.optionCode.trim()||!o.optionName.trim()){xe.error("Validation failed",{description:"Option Code and Option Name are required."});return}if(o.optionValuesJson.length===0){xe.error("Validation failed",{description:"At least one option value is required."});return}i(!0);try{await Cde(t.id,o),xe.success("Multiple option updated.",{description:"The multiple option has been updated successfully."}),r(!1),n()}catch(v){xe.error("Failed to update multiple option.",{description:v?.message?String(v.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-[600px]",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Edit Multiple Option"}),l.jsx(Nt,{children:"Update the multiple option details."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Option Code *"}),l.jsx(me,{placeholder:"e.g. OPT_ALLERGENS",value:o.optionCode,onChange:v=>u(x=>({...x,optionCode:v.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Option Name *"}),l.jsx(me,{placeholder:"e.g. Allergens",value:o.optionName,onChange:v=>u(x=>({...x,optionName:v.target.value}))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Option Values *"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(me,{placeholder:"Enter a value and press Add",value:d,onChange:v=>c(v.target.value),onKeyDown:v=>{v.key==="Enter"&&(v.preventDefault(),h())}}),l.jsx(fe,{type:"button",onClick:h,variant:"outline",children:"Add"})]}),o.optionValuesJson.length>0&&l.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:o.optionValuesJson.map((v,x)=>l.jsxs(xr,{variant:"secondary",className:"flex items-center gap-1",children:[v,l.jsx("button",{type:"button",onClick:()=>p(x),className:"ml-1 hover:text-red-600",children:l.jsx(uo,{className:"h-3 w-3"})})]},x))})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Order"}),l.jsx(me,{type:"number",placeholder:"e.g. 1",value:o.orderNum??"",onChange:v=>u(x=>({...x,orderNum:v.target.value?Number(v.target.value):null}))})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),l.jsx(qt,{checked:o.state,onCheckedChange:v=>u(x=>({...x,state:v}))})]})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{disabled:a,onClick:m,children:a?"Updating...":"Update"})]})]})})}function Tde({open:e,option:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>(t?.optionName??"").trim()||t?.optionCode||"this option",[t]),u=async()=>{if(t?.id){i(!0);try{await Ode(t.id),xe.success("Multiple option deleted.",{description:"The multiple option has been removed successfully."}),r(!1),n()}catch(d){xe.error("Failed to delete multiple option.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-none",style:{width:"30%"},children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Delete Multiple Option"}),l.jsx(Nt,{children:"This action cannot be undone."})]}),l.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",l.jsx("span",{className:"font-medium",children:o}),"?"]}),l.jsxs(xt,{className:"flex-row flex-wrap justify-end",children:[l.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function kde({currentView:e="Labels",onViewChange:t}){const r=["Labels","Label Categories","Label Types","Label Templates","Multiple Options"],n=a=>{t&&t(a)};return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"w-full border-b border-gray-200",children:l.jsx("div",{className:"flex overflow-x-auto bg-white",children:r.map(a=>l.jsx("div",{onClick:()=>n(a),style:e===a?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px ${e===a?"text-blue-600":"border-b-2 border-b-transparent text-gray-600 hover:text-gray-800"}`,children:a},a))})}),l.jsxs("div",{className:"min-h-[400px]",children:[e==="Labels"&&l.jsx(Wce,{}),e==="Label Categories"&&l.jsx(Yce,{}),e==="Label Types"&&l.jsx(eue,{}),e==="Label Templates"&&l.jsx(bde,{}),e==="Multiple Options"&&l.jsx(Ede,{}),!["Labels","Label Categories","Label Types","Label Templates","Multiple Options"].includes(e)&&l.jsxs("div",{className:"flex items-center justify-center h-64 text-gray-400",children:[e," content coming soon..."]})]})]})}function Rde(){const[e,t]=b.useState([{id:"1",name:"Pop",isOpen:!0,subcategories:[{id:"1-1",name:"2024",isOpen:!0,files:[{id:"f1",name:"uuuuu",date:"10/23/24, 12:21 AM",type:"image"},{id:"f2",name:"664EF167-DFCE-49C1-A417-DC09FEDF78D7.jpg",date:"11/24/25, 8:40 PM",type:"image"}]}]},{id:"2",name:"Training",isOpen:!0,subcategories:[{id:"2-1",name:"BOH",isOpen:!1,files:[]},{id:"2-2",name:"FOH",isOpen:!0,files:[]}]},{id:"3",name:"ww",isOpen:!1,subcategories:[]}]),r=a=>{t(i=>i.map(o=>o.id===a?{...o,isOpen:!o.isOpen}:o))},n=(a,i)=>{t(o=>o.map(u=>u.id!==a?u:{...u,subcategories:u.subcategories.map(d=>d.id===i?{...d,isOpen:!d.isOpen}:d)}))};return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(me,{className:"bg-white border border-black rounded-md h-10 w-[150px]"}),l.jsx("span",{className:"text-sm text-black whitespace-nowrap",children:"Search"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(Ke,{defaultValue:"all",children:[l.jsx(Ye,{className:"bg-white border border-black rounded-md h-10 w-[100px]",children:l.jsx(Xe,{placeholder:"Location"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"all",children:"all"}),l.jsx(Ne,{value:"loc-a",children:"Location A"})]})]}),l.jsx("span",{className:"text-sm text-black whitespace-nowrap",children:"Location"})]})]}),l.jsxs("div",{className:"bg-gray-100 p-2 flex justify-between items-center border-b border-gray-200",children:[l.jsx("h1",{className:"text-xl font-medium text-gray-700",children:"Information"}),l.jsxs("div",{className:"flex items-center gap-4 text-gray-600",children:[l.jsx("div",{className:"flex items-center gap-1 bg-gray-700 text-white text-[10px] px-1 py-0.5 rounded-sm font-bold",children:"NEW"}),l.jsx(y8,{className:"h-5 w-5"}),l.jsx("span",{className:"font-medium",children:"55789"})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("button",{className:"w-full bg-[#2c7bb6] hover:bg-[#256b9e] text-white py-2 px-4 flex items-center gap-2 text-sm font-medium rounded-sm",children:[l.jsx(wn,{className:"h-4 w-4"}),"New Category",l.jsx(Ph,{className:"h-4 w-4 opacity-70"})]}),l.jsx("div",{className:"space-y-4",children:e.map(a=>l.jsxs("div",{className:"border border-gray-300 rounded-sm overflow-hidden",children:[l.jsxs("div",{className:"bg-gradient-to-b from-gray-50 to-gray-100 border-b border-gray-200 p-2 flex items-center justify-between",children:[l.jsxs("button",{onClick:()=>r(a.id),className:"flex items-center gap-2 text-gray-700 font-medium text-sm flex-1 text-left",children:[a.isOpen?l.jsx(Is,{className:"h-4 w-4 text-[#2c7bb6]"}):l.jsx(Ms,{className:"h-4 w-4 text-[#2c7bb6]"}),a.name]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:l.jsx(_h,{className:"h-4 w-4"})}),l.jsx("button",{className:"text-red-400 hover:text-red-600",children:l.jsx(uo,{className:"h-4 w-4"})})]})]}),a.isOpen&&l.jsxs("div",{className:"p-2 space-y-3 bg-white",children:[l.jsxs("button",{className:"w-full bg-[#2c7bb6] hover:bg-[#256b9e] text-white py-2 px-4 flex items-center gap-2 text-sm font-medium rounded-sm",children:[l.jsx(wn,{className:"h-4 w-4"}),"New Subcategory",l.jsx(Ph,{className:"h-4 w-4 opacity-70"})]}),l.jsxs("div",{className:"space-y-3",children:[a.subcategories.map(i=>l.jsxs("div",{className:"border border-gray-200 rounded-sm",children:[l.jsxs("div",{className:"bg-white border-b border-gray-200 p-2 flex items-center justify-between",children:[l.jsxs("button",{onClick:()=>n(a.id,i.id),className:"flex items-center gap-2 text-gray-700 font-medium text-sm flex-1 text-left",children:[i.isOpen?l.jsx(Is,{className:"h-4 w-4 text-[#2c7bb6]"}):l.jsx(Ms,{className:"h-4 w-4 text-[#2c7bb6]"}),i.name]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:l.jsx(_h,{className:"h-4 w-4"})}),l.jsx("button",{className:"text-red-400 hover:text-red-600",children:l.jsx(uo,{className:"h-4 w-4"})})]})]}),i.isOpen&&l.jsxs("div",{className:"p-3 bg-gray-50/50",children:[l.jsx("div",{className:"mb-2 text-xs font-bold text-gray-500 uppercase tracking-wide",children:"Files"}),l.jsxs("div",{className:"flex flex-wrap gap-2 mb-3 justify-end",children:[l.jsx(fe,{size:"sm",className:"h-8 bg-[#4CAF50] hover:bg-[#43a047] text-white text-xs border-none rounded-sm",children:"Upload Your Own File(s)"}),l.jsx(fe,{size:"sm",className:"h-8 bg-[#4CAF50] hover:bg-[#43a047] text-white text-xs border-none rounded-sm",children:"Create A Custom File"}),l.jsx(fe,{size:"sm",className:"h-8 bg-[#2c7bb6] hover:bg-[#256b9e] text-white text-xs border-none rounded-sm",children:"Edit File Permissions"}),l.jsxs(fe,{size:"sm",className:"h-8 bg-[#2c7bb6] hover:bg-[#256b9e] text-white text-xs border-none rounded-sm gap-1",children:["Sort (A-Z) ",l.jsx(wz,{className:"h-3 w-3"})]})]}),l.jsx("div",{className:"space-y-1",children:i.files.length>0?i.files.map(o=>l.jsxs("div",{className:"flex items-center bg-gray-200/50 p-2 border border-gray-200 rounded-sm text-sm hover:bg-gray-200 transition-colors",children:[l.jsx("div",{className:"flex-shrink-0 mr-3",children:o.type==="image"?l.jsx(Wz,{className:"h-5 w-5 text-[#2c7bb6]"}):l.jsx(Ds,{className:"h-5 w-5 text-[#2c7bb6]"})}),l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx("div",{className:"font-medium text-gray-700 truncate",children:o.name})}),l.jsx("div",{className:"text-xs text-gray-500 mr-4 whitespace-nowrap",children:o.date}),l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx("button",{className:"p-1 text-gray-400 hover:text-gray-600 bg-white border border-gray-300 rounded-sm",children:l.jsx(Ds,{className:"h-3 w-3"})}),l.jsx("button",{className:"p-1 text-gray-400 hover:text-gray-600 bg-white border border-gray-300 rounded-sm",children:l.jsx(_h,{className:"h-3 w-3"})}),l.jsx("button",{className:"p-1 text-red-400 hover:text-red-600 bg-white border border-gray-300 rounded-sm",children:l.jsx(uo,{className:"h-3 w-3"})})]})]},o.id)):l.jsx("div",{className:"p-4 border-2 border-dashed border-gray-300 rounded-sm text-center text-gray-400 text-sm",children:"No files in this subcategory"})})]})]},i.id)),a.subcategories.length===0&&l.jsx("div",{className:"p-2 text-sm text-gray-400 italic",children:"No subcategories"})]})]})]},a.id))})]})]})}const Ide=[{id:1,title:"Coffee - 2 hrs",subtitle:"1 min - Completes at 12:05 PM",totalTime:7200,remainingTime:0,status:"expired",icon:$z},{id:2,title:"Clean Tablet",subtitle:"1 hrs - Completes at 12:37 PM",totalTime:3600,remainingTime:237,status:"running",icon:w8},{id:3,title:"Replace Sanitizer Towels",subtitle:"1 hrs - Completes at 12:37 PM",totalTime:3600,remainingTime:238,status:"running",icon:Hc},{id:4,title:"Take Out Trash",subtitle:"1 hrs - Completes at 01:03 PM",totalTime:3600,remainingTime:58,status:"running",icon:Hc},{id:5,title:"Change Utensils",subtitle:"1 hrs - Completes at 01:03 PM",totalTime:3600,remainingTime:58,status:"running",icon:M8},{id:6,title:"Sanitize Surfaces",subtitle:"1 hrs - Completes at 02:00 PM",totalTime:3600,remainingTime:2157,status:"running",icon:sy},{id:7,title:"Check Temperatures",subtitle:"1 hrs - Completes at 02:00 PM",totalTime:3600,remainingTime:2158,status:"running",icon:sy},{id:8,title:"Ranch 4 hrs",subtitle:"4 hrs - Completes at 04:04 PM",totalTime:14400,remainingTime:2158,status:"running",icon:sy}];function Mde({timer:e}){const t=(e.totalTime-e.remainingTime)/e.totalTime*100,r=e.remainingTime===0,n=a=>{if(a<=0)return"0s";const i=Math.floor(a/60),o=a%60;return`${i.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`};return l.jsxs("div",{className:"bg-gray-200 rounded-xl p-4 flex flex-col items-center relative shadow-sm h-[280px]",children:[l.jsxs("div",{className:"text-center mb-2",children:[l.jsx("h3",{className:"text-lg font-medium text-gray-800 leading-tight",children:e.title}),l.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.subtitle})]}),l.jsxs("div",{className:"relative w-32 h-32 my-auto flex items-center justify-center",children:[l.jsxs("svg",{className:"w-full h-full transform -rotate-90",children:[l.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:"white",strokeWidth:"12",fill:"transparent"}),l.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:r?"#ef4444":"#3b82f6",strokeWidth:"12",fill:"transparent",strokeDasharray:351.86,strokeDashoffset:r?0:351.86*(t/100),className:"transition-all duration-1000 ease-linear"})]}),l.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[l.jsx("span",{className:Ae("text-3xl font-bold",r?"text-red-500":"text-gray-800"),children:r?"0s":n(e.remainingTime)}),l.jsx("span",{className:Ae("text-[10px] font-medium uppercase mt-1",r?"text-red-400":"text-gray-400"),children:"Remaining"})]})]}),l.jsxs("div",{className:"w-full flex justify-between items-end mt-2",children:[l.jsx(i8,{className:"w-5 h-5 text-blue-700 fill-current"}),l.jsx("div",{className:"flex flex-col items-center",children:l.jsx("div",{className:"w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center text-gray-400 mb-1",children:l.jsx(e.icon,{className:"w-5 h-5"})})}),l.jsx("div",{className:"flex flex-col items-end",children:l.jsx("span",{className:"text-xs text-blue-600 font-bold mb-2 cursor-pointer",children:"EDIT"})})]}),l.jsx("button",{className:"absolute bottom-12 right-4 bg-blue-600 rounded-full p-1 text-white hover:bg-blue-700 shadow-md",children:l.jsx(uo,{className:"w-4 h-4"})})]})}function Dde(){const[e,t]=b.useState(!0);return l.jsxs("div",{className:"h-full flex flex-col bg-gray-50 relative",children:[l.jsxs("div",{className:"bg-white border-b border-gray-200 px-4 py-3 flex items-center justify-between shadow-sm z-10",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsxs("button",{className:"flex items-center text-blue-500 text-lg font-medium",children:[l.jsx(QI,{className:"w-6 h-6"}),"Back"]}),l.jsx(t8,{className:"w-6 h-6 text-gray-500"})]}),l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"bg-blue-600 p-1.5 rounded-md",children:l.jsx(_8,{className:"w-5 h-5 text-white"})}),l.jsx("h1",{className:"text-xl font-bold text-blue-900",children:"Timers"})]}),l.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 font-medium",children:[l.jsx("span",{children:"86016"}),l.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"})]})]}),l.jsxs("div",{className:"flex items-center gap-4 text-blue-500 font-medium",children:[l.jsx(k8,{className:"w-6 h-6 text-gray-400"}),l.jsxs("button",{className:"flex items-center gap-1",children:[l.jsx(wn,{className:"w-5 h-5"}),"Add Timer"]})]})]}),l.jsxs("div",{className:"bg-gray-700 text-white px-6 py-2 flex items-center justify-between",children:[l.jsx("div",{className:"flex-1"})," ",l.jsx("div",{className:"font-medium",children:"Today, December 15"}),l.jsxs("div",{className:"flex-1 flex justify-end items-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-1",children:[l.jsx(Vz,{className:"w-5 h-5 text-gray-300"}),l.jsx(Yz,{className:"w-5 h-5 text-gray-500"})]}),l.jsx(mz,{className:"w-5 h-5 text-blue-400"})]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:l.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Ide.map(r=>l.jsx(Mde,{timer:r},r.id))})}),e&&l.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-[1px]",children:l.jsx("div",{className:"bg-black text-white rounded-xl shadow-2xl w-[600px] max-w-full overflow-hidden border border-gray-800",children:l.jsxs("div",{className:"p-8 text-center space-y-6",children:[l.jsx("h2",{className:"text-3xl font-medium text-blue-500",children:"Coffee - 2 hrs"}),l.jsxs("div",{className:"space-y-4 py-4",children:[l.jsx("p",{className:"text-2xl font-light",children:"Timer expired at 12:05 PM"}),l.jsx("p",{className:"text-2xl font-light",children:"Please discard the coffee"})]}),l.jsx("div",{className:"flex justify-end",children:l.jsx("span",{className:"bg-gray-200 text-black text-[10px] px-1 rounded-sm opacity-50",children:"TACT_Img_Timer-Notification@2x"})}),l.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-8",children:[l.jsx(fe,{onClick:()=>t(!1),className:"bg-blue-700 hover:bg-blue-600 text-white h-14 text-xl font-medium rounded-lg",children:"Mute"}),l.jsx(fe,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-500 text-white h-14 text-xl font-medium rounded-lg",children:"Restart"}),l.jsx(fe,{onClick:()=>t(!1),className:"bg-blue-800 hover:bg-blue-700 text-white h-14 text-xl font-medium rounded-lg",children:"Acknowledge"})]})]})})})]})}const lg=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),cg="/product-location";function Lde(e){const t=e;return{id:t?.id??t?.Id,locationId:t?.locationId??t?.LocationId,productId:t?.productId??t?.ProductId}}async function $de(e,t){const r=await lg.requestJson({path:cg,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,LocationId:e.locationId,ProductId:e.productId},signal:t});return{...r,items:(r.items??[]).map(n=>Lde(n))}}async function V5(e,t){const r=await lg.requestJson({path:`${cg}/${encodeURIComponent(e)}`,method:"GET",signal:t});return Array.isArray(r?.productIds)?r.productIds.map(String):Array.isArray(r?.items)?(r.items??[]).map(n=>n?.productId).filter(n=>typeof n=="string"&&n.length>0):[]}async function H5(e){return lg.requestJson({path:cg,method:"POST",body:{locationId:e.locationId,productIds:e.productIds}})}async function Bde(e,t){return lg.requestJson({path:`${cg}/${encodeURIComponent(e)}`,method:"PUT",body:{productIds:t.productIds}})}function zn(e){const t=(e??"").trim();return t||"—"}async function Fde(e){const t=new Map;try{const r=await $de({skipCount:0,maxResultCount:2e3},e);for(const n of r.items??[]){const a=(n.productId??"").trim(),i=(n.locationId??"").trim();if(!a||!i)continue;t.has(a)||t.set(a,[]);const o=t.get(a);o.includes(i)||o.push(i)}}catch{}return t}async function zde(e,t,r){const n=[...new Set(r.filter(Boolean))];for(const a of n){if(a===t)continue;const i=await V5(a);i.includes(e)&&await Bde(a,{productIds:i.filter(o=>o!==e)})}t.trim()&&await H5({locationId:t,productIds:[e]})}function qde(){const[e,t]=b.useState("products"),[r,n]=b.useState([]),[a,i]=b.useState(0),[o,u]=b.useState(!1),[d,c]=b.useState(new Map),[h,p]=b.useState([]),[m,v]=b.useState([]),[x,y]=b.useState(""),[S,_]=b.useState(""),N=b.useRef(null),[O,A]=b.useState("all"),[C,E]=b.useState("all"),[T,R]=b.useState("all"),[L,z]=b.useState(1),[F,B]=b.useState(10),[q,H]=b.useState(0),V=b.useRef(null),[G,U]=b.useState(!1),[$,Q]=b.useState(!1),[k,I]=b.useState(null),[D,Z]=b.useState(null),[ie,oe]=b.useState(null);b.useEffect(()=>(N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>_(x.trim()),300),()=>{N.current&&window.clearTimeout(N.current)}),[x]),b.useEffect(()=>{let W=!1;return(async()=>{try{const[_e,Ce]=await Promise.all([Al({skipCount:0,maxResultCount:500}),s_({skipCount:0,maxResultCount:500})]);if(W)return;p(_e.items??[]),v(Ce.items??[])}catch{W||(p([]),v([]))}})(),()=>{W=!0}},[]),b.useEffect(()=>{z(1)},[S,O,C,T,F]);const ne=O!=="all"||C!=="all";b.useEffect(()=>e!=="products"?void 0:((async()=>{V.current?.abort();const _e=new AbortController;V.current=_e,u(!0);try{const Ce=await Fde(_e.signal);if(_e.signal.aborted)return;if(c(Ce),ne){const qe=await xS({skipCount:0,maxResultCount:500,keyword:S||void 0,state:T==="all"?void 0:T==="true"},_e.signal);if(_e.signal.aborted)return;let De=qe.items??[];if(O!=="all"){const Ut=new Set(await V5(O));De=De.filter(lr=>Ut.has(lr.id))}C!=="all"&&(De=De.filter(Ut=>(Ut.categoryName??"").trim()===C));const nt=De.length;i(nt);const kt=(L-1)*F;n(De.slice(kt,kt+F))}else{const qe=(L-1)*F,De=await xS({skipCount:qe,maxResultCount:F,keyword:S||void 0,state:T==="all"?void 0:T==="true"},_e.signal);if(_e.signal.aborted)return;n(De.items??[]),i(De.totalCount??0)}}catch(Ce){if(Ce?.name==="AbortError")return;xe.error("Failed to load products",{description:Ce?.message?String(Ce.message):"Please try again."}),n([]),i(0)}finally{_e.signal.aborted||u(!1)}})(),()=>V.current?.abort()),[e,S,O,C,T,L,F,q,ne]);const K=()=>H(W=>W+1),J=b.useMemo(()=>h.map(W=>({value:W.id,label:zn(W.locationName??W.locationCode??W.id)})),[h]),ee=b.useMemo(()=>m.map(W=>({value:(W.categoryName??W.categoryCode??W.id??"").trim(),label:zn(W.categoryName??W.categoryCode??W.id)})).filter(W=>W.value),[m]),ce=Math.max(1,Math.ceil(a/F)),pe=b.useCallback(W=>{const _e=h.find(Ce=>Ce.id===W);return zn(_e?.locationName??_e?.locationCode??W)},[h]);return l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsxs("div",{className:"pb-4",children:[l.jsxs("div",{className:"flex flex-nowrap items-center gap-3 flex-wrap",children:[l.jsxs("div",{className:"flex items-center w-40 shrink-0 rounded-md border border-gray-300 bg-white overflow-hidden",style:{height:40},children:[l.jsx(Kp,{className:"h-4 w-4 text-gray-400 shrink-0 ml-2.5 pointer-events-none"}),l.jsx(me,{placeholder:"Search...",value:x,onChange:W=>y(W.target.value),className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full placeholder:text-gray-500"})]}),l.jsxs(Ke,{value:"all",disabled:!0,children:[l.jsx(Ye,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0 opacity-70",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Partner"})}),l.jsx(Je,{children:l.jsx(Ne,{value:"all",children:"All partners"})})]}),l.jsxs(Ke,{value:"all",disabled:!0,children:[l.jsx(Ye,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0 opacity-70",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Group"})}),l.jsx(Je,{children:l.jsx(Ne,{value:"all",children:"All groups"})})]}),l.jsxs(Ke,{value:O,onValueChange:A,children:[l.jsx(Ye,{className:"w-[160px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Location"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"all",children:"All Locations"}),h.map(W=>l.jsx(Ne,{value:W.id,children:zn(W.locationName??W.locationCode??W.id)},W.id))]})]}),l.jsxs(Ke,{value:C,onValueChange:E,children:[l.jsx(Ye,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Category"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"all",children:"All Categories"}),ee.map(W=>l.jsx(Ne,{value:W.value,children:W.label},W.value))]})]}),l.jsxs(Ke,{value:T,onValueChange:R,children:[l.jsx(Ye,{className:"w-[120px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"State"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"all",children:"All states"}),l.jsx(Ne,{value:"true",children:"Active"}),l.jsx(Ne,{value:"false",children:"Inactive"})]})]}),l.jsx("div",{className:"flex-1 min-w-2"}),l.jsxs(fe,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",disabled:!0,children:[l.jsx(A8,{className:"w-4 h-4"})," Bulk Import"]}),l.jsxs(fe,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",disabled:!0,children:[l.jsx(CS,{className:"w-4 h-4"})," Bulk Export"]}),l.jsxs(fe,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",disabled:!0,children:[l.jsx(xn,{className:"w-4 h-4"})," Bulk Edit"]}),e==="products"?l.jsxs(fe,{className:"h-10 rounded-md bg-blue-600 text-white hover:bg-blue-700 font-medium gap-1 shrink-0",onClick:()=>{I(null),U(!0)},children:["New Product ",l.jsx(wn,{className:"w-4 h-4"})]}):l.jsxs(fe,{className:"h-10 rounded-md bg-blue-600 text-white hover:bg-blue-700 font-medium gap-1 shrink-0",onClick:()=>Q(!0),children:["New Category ",l.jsx(wn,{className:"w-4 h-4"})]})]}),l.jsx("div",{className:"w-full border-b border-gray-200 mt-4",children:l.jsxs("div",{className:"flex overflow-x-auto w-fit",children:[l.jsx("button",{type:"button",onClick:()=>t("products"),style:e==="products"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2 ${e==="products"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"}`,children:"Products"}),l.jsx("button",{type:"button",onClick:()=>t("categories"),style:e==="categories"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2 ${e==="categories"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"}`,children:"Categories"})]})})]}),l.jsx("div",{className:"flex-1 overflow-auto pt-6",children:e==="products"?l.jsxs("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:[l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-100 hover:bg-gray-100",children:[l.jsx(ve,{className:"text-gray-900 font-bold border-r whitespace-nowrap",children:"Location"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r whitespace-nowrap",children:"Product Category"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r whitespace-nowrap",children:"Product"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r whitespace-nowrap",children:"Product ID"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r whitespace-nowrap",children:"Product Code"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r whitespace-nowrap",children:"Status"}),l.jsx(ve,{className:"text-gray-900 font-bold text-center whitespace-nowrap",children:"Actions"})]})}),l.jsx(Pr,{children:o?l.jsx(Be,{children:l.jsx(de,{colSpan:7,className:"text-center text-gray-500 py-10",children:"Loading..."})}):r.length===0?l.jsx(Be,{children:l.jsx(de,{colSpan:7,className:"text-center text-gray-500 py-10",children:"No products found."})}):r.map(W=>{const _e=d.get(W.id)??[],Ce=_e.length===0?"—":_e.map(De=>pe(De)).join(", "),qe=W.state!==!1;return l.jsxs(Be,{children:[l.jsx(de,{className:"border-r text-sm max-w-[200px] truncate",title:Ce,children:Ce}),l.jsx(de,{className:"border-r text-gray-900 font-medium whitespace-nowrap",children:zn(W.categoryName)}),l.jsx(de,{className:"border-r text-gray-900 font-medium",children:l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[W.productImageUrl?l.jsx("img",{src:W.productImageUrl,alt:"",className:"w-8 h-8 rounded object-cover border border-gray-200 shrink-0"}):l.jsx(Vc,{className:"w-4 h-4 text-gray-400 shrink-0"}),l.jsx("span",{className:"truncate",children:zn(W.productName)})]})}),l.jsx(de,{className:"border-r font-mono text-sm text-gray-600 whitespace-nowrap",children:W.id}),l.jsx(de,{className:"border-r font-mono text-sm text-gray-600 whitespace-nowrap",children:zn(W.productCode)}),l.jsx(de,{className:"border-r whitespace-nowrap",children:l.jsx(xr,{variant:qe?"default":"secondary",className:qe?"bg-green-600":"bg-gray-400",children:qe?"active":"inactive"})}),l.jsx(de,{className:"text-center whitespace-nowrap",children:l.jsxs(ma,{open:ie===W.id,onOpenChange:De=>oe(De?W.id:null),children:[l.jsx(ga,{asChild:!0,children:l.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8",children:l.jsx(Ei,{className:"h-4 w-4"})})}),l.jsxs(va,{align:"end",className:"w-36 p-1",children:[l.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal",onClick:async()=>{oe(null);try{const De=await Bce(W.id);I(De),U(!0)}catch(De){xe.error("Failed to load product",{description:De?.message?String(De.message):""})}},children:[l.jsx(xn,{className:"w-4 h-4 mr-2"}),"Edit"]}),l.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>{oe(null),Z(W)},children:"Delete"})]})]})})]},W.id)})})]}),l.jsxs("div",{className:"flex items-center justify-between px-3 py-2 text-sm text-gray-600 border-t border-gray-100",children:[l.jsxs("span",{children:["Showing ",a===0?0:(L-1)*F+1,"-",Math.min(L*F,a)," of ",a]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs(Ke,{value:String(F),onValueChange:W=>B(Number(W)),children:[l.jsx(Ye,{className:"w-[100px] h-9",children:l.jsx(Xe,{})}),l.jsx(Je,{children:[10,20,50].map(W=>l.jsxs(Ne,{value:String(W),children:[W," / page"]},W))})]}),l.jsx(fe,{type:"button",variant:"outline",size:"sm",disabled:L<=1,onClick:()=>z(W=>Math.max(1,W-1)),children:"Prev"}),l.jsxs("span",{className:"text-xs tabular-nums",children:["Page ",L," / ",ce]}),l.jsx(fe,{type:"button",variant:"outline",size:"sm",disabled:L>=ce,onClick:()=>z(W=>Math.min(ce,W+1)),children:"Next"})]})]})]}):l.jsx(Ude,{categories:m})}),l.jsx(Vde,{open:G,onOpenChange:W=>{U(W),W||I(null)},editing:k,locationOptions:J,categoryOptions:ee,locationMap:d,onSaved:()=>{K(),U(!1),I(null)}}),l.jsx(Hde,{open:!!D,product:D,onOpenChange:W=>{W||Z(null)},onDeleted:K}),l.jsx(Wde,{open:$,onOpenChange:Q})]})}function Ude({categories:e}){return l.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-100 hover:bg-gray-100",children:[l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Category Name"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Code"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Status"})]})}),l.jsx(Pr,{children:e.length===0?l.jsx(Be,{children:l.jsx(de,{colSpan:3,className:"text-center text-gray-500 py-8",children:"No categories loaded. Use Labeling → Label Categories to manage."})}):e.map(t=>l.jsxs(Be,{children:[l.jsx(de,{className:"border-r font-medium",children:zn(t.categoryName)}),l.jsx(de,{className:"border-r text-gray-600",children:zn(t.categoryCode)}),l.jsx(de,{className:"border-r",children:l.jsx(xr,{variant:t.state!==!1?"default":"secondary",children:t.state!==!1?"active":"inactive"})})]},t.id))})]})})}function Vde({open:e,onOpenChange:t,editing:r,locationOptions:n,categoryOptions:a,locationMap:i,onSaved:o}){const[u,d]=b.useState(!1),[c,h]=b.useState(""),[p,m]=b.useState(""),[v,x]=b.useState(""),[y,S]=b.useState(""),[_,N]=b.useState(!0),[O,A]=b.useState("");b.useEffect(()=>{if(e)if(r){h(r.productCode??""),m(r.productName??""),x((r.categoryName??"").trim()),S(r.productImageUrl??""),N(r.state!==!1);const E=i.get(r.id)??[];A(E[0]??"")}else h(""),m(""),x(""),S(""),N(!0),A("")},[e,r,i]);const C=async()=>{if(!c.trim()||!p.trim()){xe.error("Validation",{description:"Product code and name are required."});return}if(!O.trim()){xe.error("Validation",{description:"Select a store to bind this product."});return}const E={productCode:c.trim(),productName:p.trim(),categoryName:v.trim()||null,productImageUrl:y.trim()||null,state:_};d(!0);try{if(r){await zce(r.id,E);const T=i.get(r.id)??[];await zde(r.id,O.trim(),T)}else{const T=await Fce(E);await H5({locationId:O.trim(),productIds:[T.id]})}xe.success(r?"Product updated.":"Product created."),o()}catch(T){xe.error(r?"Update failed":"Create failed",{description:T?.message?String(T.message):""})}finally{d(!1)}};return l.jsx(mt,{open:e,onOpenChange:t,children:l.jsxs(ft,{className:"w-[min(50%,calc(100vw-2rem))] max-w-none sm:max-w-none max-h-[90vh] overflow-y-auto",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:r?"Edit Product":"Add New Product"}),l.jsx(Nt,{children:r?"Update product and store binding.":"Create a product and bind it to a store."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Product code *"}),l.jsx(me,{className:"h-10",value:c,onChange:E=>h(E.target.value),placeholder:"e.g. PRD_TEST_001"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Product name *"}),l.jsx(me,{className:"h-10",value:p,onChange:E=>m(E.target.value),placeholder:"e.g. Chicken"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Category name"}),l.jsx(na,{value:v,onValueChange:x,options:a,placeholder:"Select category (optional)",searchPlaceholder:"Search category…",emptyText:"No categories."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Image URL"}),l.jsx(me,{className:"h-10",value:y,onChange:E=>S(E.target.value),placeholder:"https://..."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Bind to store *"}),l.jsx(na,{value:O,onValueChange:A,options:n,placeholder:"Select location",searchPlaceholder:"Search location…",emptyText:"No locations."})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 h-10 bg-white",children:[l.jsx("span",{className:"text-sm font-medium",children:"Enabled"}),l.jsx(qt,{checked:_,onCheckedChange:N})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsx(fe,{type:"button",disabled:u,onClick:C,className:"bg-blue-600 hover:bg-blue-700 text-white",children:u?"Saving…":r?"Save":"Create"})]})]})})}function Hde({open:e,product:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=async()=>{if(t?.id){i(!0);try{await qce(t.id),xe.success("Product deleted."),r(!1),n()}catch(u){xe.error("Delete failed",{description:u?.message?String(u.message):""})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-md",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Delete product"}),l.jsx(Nt,{children:"This cannot be undone."})]}),l.jsxs("p",{className:"text-sm text-gray-700 py-2",children:["Delete ",l.jsx("span",{className:"font-medium",children:zn(t?.productName)})," (",zn(t?.productCode),")?"]}),l.jsxs(xt,{children:[l.jsx(fe,{type:"button",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{type:"button",variant:"destructive",disabled:a,onClick:o,children:a?"Deleting…":"Delete"})]})]})})}function Wde({open:e,onOpenChange:t}){return l.jsx(mt,{open:e,onOpenChange:t,children:l.jsxs(ft,{className:"sm:max-w-md",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Categories"}),l.jsxs(Nt,{children:["Manage categories under ",l.jsx("span",{className:"font-medium",children:"Labeling → Label Categories"})," (label module API)."]})]}),l.jsx(xt,{children:l.jsx(fe,{type:"button",onClick:()=>t(!1),children:"OK"})})]})})}const nd=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),ad="/rbac-menu";function Au(e){if(!e||typeof e!="object")return{id:""};const t=e;return{id:String(t.id??t.Id??""),orderNum:t.orderNum??t.OrderNum,state:t.state??t.State,menuName:t.menuName??t.MenuName,routerName:t.routerName??t.RouterName,menuType:t.menuType??t.MenuType,permissionCode:t.permissionCode??t.PermissionCode,parentId:t.parentId??t.ParentId,menuIcon:t.menuIcon??t.MenuIcon,routeUrl:t.routeUrl??t.RouteUrl,link:t.link??t.Link,isCache:t.isCache??t.IsCache,isShow:t.isShow??t.IsShow,remark:t.remark??t.Remark,component:t.component??t.Component,menuSource:t.menuSource??t.MenuSource,query:t.query??t.Query,concurrencyStamp:t.concurrencyStamp??t.ConcurrencyStamp}}function Gde(e){if(Array.isArray(e))return{items:e.map(Au),totalCount:e.length};const t=e,r=t.items??t.Items??[],n=typeof t.totalCount=="number"?t.totalCount:typeof t.TotalCount=="number"?t.TotalCount:r.length;return{items:r.map(Au),totalCount:n}}async function W5(e,t){const r=await nd.requestJson({path:ad,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword},signal:t});return Gde(r)}function SS(e){const t=Au(e),r=e,n=r?.children??r?.Children,a=Array.isArray(n)?n.map(SS):void 0;return{...t,children:a}}function Kde(e){if(Array.isArray(e))return e.map(SS);if(!e||typeof e!="object")return[];const t=e,r=t.items??t.Items??t.data??t.Data;return Array.isArray(r)?r.map(SS):[]}async function Xde(e){const t=await nd.requestJson({path:`${ad}/tree`,method:"GET",signal:e});return Kde(t)}async function Yde(e){const t=new Map;let r=1;const n=500;for(;;){const i=(await W5({skipCount:r,maxResultCount:n},e)).items??[];for(const o of i)o.menuType!==0||!o.id||t.has(o.id)||t.set(o.id,o);if(i.length100))break}return Array.from(t.values()).sort((a,i)=>(a.orderNum??0)-(i.orderNum??0))}async function Jde(e){const t=await nd.requestJson({path:ad,method:"POST",body:e});return Au(t)}async function Qde(e,t){const r=await nd.requestJson({path:`${ad}/${encodeURIComponent(e)}`,method:"PUT",body:t});return Au(r)}async function Zde(e){e.length&&await nd.requestJson({path:ad,method:"DELETE",body:e})}async function efe(e){await Zde([e])}const G5=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),K5="/rbac-role-menu";async function tfe(e){await G5.requestJson({path:`${K5}/set`,method:"POST",body:e})}async function rfe(e){await G5.requestJson({path:K5,method:"DELETE",body:e})}const nfe=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),afe="/role";async function X5(e,t){return nfe.requestJson({path:afe,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,RoleName:e.roleName,RoleCode:e.roleCode,State:e.state},signal:t})}const ug=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),dg="/rbac-role";async function ife(e){return ug.requestJson({path:dg,method:"POST",body:e})}async function ofe(e,t){return ug.requestJson({path:`${dg}/${encodeURIComponent(e)}`,method:"PUT",body:t})}function sfe(e){if(!e||typeof e!="object")return[];const t=e,r=Array.isArray(t.menuIds)?t.menuIds:Array.isArray(t.MenuIds)?t.MenuIds:void 0;if(r)return r.map(String);const n=t.data??t.Data;if(n&&typeof n=="object"){const i=n,o=Array.isArray(i.menuIds)?i.menuIds:Array.isArray(i.MenuIds)?i.MenuIds:void 0;if(o)return o.map(String)}const a=Array.isArray(t.roleMenus)?t.roleMenus:Array.isArray(t.RoleMenus)?t.RoleMenus:void 0;if(Array.isArray(a)){const i=[];for(const o of a){if(!o||typeof o!="object")continue;const u=o,d=u.menuId??u.MenuId??u.id??u.Id;d&&i.push(String(d))}return i}return[]}async function lfe(e){e.length&&await ug.requestJson({path:dg,method:"DELETE",body:e})}async function cfe(e){await lfe([e])}async function ufe(e,t){const r=await ug.requestJson({path:`${dg}/${encodeURIComponent(e)}`,method:"GET",signal:t});return sfe(r)}const id=an({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),od="/team-member";function dfe(e){if(!Array.isArray(e))return[];const t=[];for(const r of e)if(r!=null){if(typeof r=="string"||typeof r=="number"){t.push(String(r));continue}if(typeof r=="object"){const n=r,a=n.id??n.Id??n.locationId??n.LocationId??n.location_id??n.locationID;a!=null&&t.push(String(a))}}return t}function ffe(e){if(!Array.isArray(e))return[];const t=[];for(const r of e)if(r!=null){if(typeof r=="string"||typeof r=="number"){t.push(String(r));continue}if(typeof r=="object"){const n=r,a=n.locationCode??n.LocationCode??n.code??n.Code??n.location_code??n.locationCodeId,i=n.locationName??n.LocationName??n.name??n.Name??n.location_name,o=n.id??n.Id??n.locationId??n.LocationId,u=a==null?"":String(a).trim(),d=i==null?"":String(i).trim(),c=o==null?"":String(o).trim();u&&d?t.push(`${u} - ${d}`):d?t.push(d):u?t.push(u):c&&t.push(c)}}return t}function fg(e){if(!e||typeof e!="object")return{id:""};const t=e,r=String(t.id??t.Id??t.userId??t.UserId??t.user_id??t.UserID??t.memberId??t.MemberId??""),n=t.fullName??t.FullName??t.name??t.Name,a=t.userName??t.UserName??t.username??t.UserName,i=t.email??t.Email,o=t.phone??t.Phone;let u=t.roleId??t.RoleId,d=t.roleName??t.RoleName??t.roleName??t.Role;const c=t.role??t.Role;if((!u||!d)&&c&&typeof c=="object"){const S=c;u=S.id??S.Id??S.roleId??S.RoleId??u,d=S.roleName??S.RoleName??S.name??S.Name??S.role??S.Role??d}const h=t.state??t.State,p=typeof h=="boolean"?h:h==="true"?!0:h==="false"?!1:void 0,m=t.locationIds??t.LocationIds??t.assignedLocationIds??t.AssignedLocationIds??t.location_id_list??t.LocationIdList;let v=dfe(m);const x=t.locations??t.Locations??t.assignedLocations??t.AssignedLocations??t.locationNames??t.LocationNames;let y=ffe(x);if(v.length===0&&Array.isArray(x)){const S=[];for(const _ of x){if(typeof _!="object"||!_)continue;const N=_,O=N.id??N.Id??N.locationId??N.LocationId;O!=null&&S.push(String(O))}S.length&&(v=S)}return{id:r,fullName:n,userName:a,email:i,phone:o,roleId:u,roleName:d,locationIds:v,locations:y,state:p??(t.status?String(t.status).toLowerCase()==="active":void 0)}}async function hfe(e,t){const r=await id.requestJson({path:od,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Keyword:e.keyword},signal:t}),n=r.items??[];return{totalCount:r.totalCount??0,items:n.map(fg)}}async function pfe(e,t){const r=await id.requestJson({path:`${od}/${encodeURIComponent(e)}`,method:"GET",signal:t});return fg(r)}function Y5(e){if(e==null||e==="")return null;const t=String(e).trim();return t?Number(t.replace(/\D/g,""))||0:null}function mfe(e){const t=e.phone!=null&&e.phone!==""?Y5(String(e.phone)):null;return{fullName:e.fullName,userName:e.userName,password:e.password,email:e.email??null,phone:t,roleId:e.roleId,locationIds:e.locationIds,locations:e.locationIds,state:e.state}}function gfe(e){const t=e.phone!=null&&e.phone!==""?Y5(String(e.phone)):null,r={fullName:e.fullName,userName:e.userName,email:e.email??null,phone:t,roleId:e.roleId,locationIds:e.locationIds,locations:e.locationIds,state:e.state};return e.password&&(r.password=e.password),r}async function vfe(e){const t=await id.requestJson({path:od,method:"POST",body:mfe(e)});return fg(t)}async function yfe(e,t){const r=await id.requestJson({path:`${od}/${encodeURIComponent(e)}`,method:"PUT",body:gfe(t)});return fg(r)}async function xfe(e){await id.requestJson({path:`${od}/${encodeURIComponent(e)}`,method:"DELETE"})}const J5=[{id:"p1",name:"Global Foods Inc.",status:"active",contact:"admin@globalfoods.com",phone:"+1 (555) 100-2000"},{id:"p2",name:"Local Eateries Co.",status:"active",contact:"support@localeateries.com",phone:"+1 (555) 200-3000"}],bfe=[{id:"g1",name:"West Coast Region",partner:"Global Foods Inc.",status:"active"},{id:"g2",name:"East Coast Region",partner:"Global Foods Inc.",status:"inactive"}];function wfe(){const[e,t]=b.useState("Roles"),[r,n]=b.useState([]),[a,i]=b.useState(0),[o,u]=b.useState(!1),[d,c]=b.useState(0),[h,p]=b.useState(1),[m,v]=b.useState(10),x=Math.max(1,Math.ceil(a/m)),y=b.useRef(null),[S,_]=b.useState(""),N=b.useRef(null),[O,A]=b.useState(""),[C,E]=b.useState(J5),[T,R]=b.useState(bfe),[L,z]=b.useState([]),[F,B]=b.useState(!1),[q,H]=b.useState(0),[V,G]=b.useState(0),[U,$]=b.useState(1),[Q,k]=b.useState(10),I=Math.max(1,Math.ceil(q/Q)),D=b.useRef(null),[Z,ie]=b.useState(""),oe=b.useRef(null),[ne,K]=b.useState(""),[J,ee]=b.useState(null),[ce,pe]=b.useState(!1),[W,_e]=b.useState(null),[Ce,qe]=b.useState(!1),[De,nt]=b.useState(null),[kt,Ut]=b.useState(!1),[lr,Rt]=b.useState(null),[Br,ya]=b.useState(!1),[Di,Ka]=b.useState(null),[ld,Mo]=b.useState(!1),[Do,Tl]=b.useState(!1),[Li,xa]=b.useState(!1),mg=()=>{alert(`Exporting ${e} list to PDF...`)};b.useEffect(()=>(N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>A(S.trim()),300),()=>{N.current&&window.clearTimeout(N.current)}),[S]),b.useEffect(()=>(oe.current&&window.clearTimeout(oe.current),oe.current=window.setTimeout(()=>K(Z.trim()),300),()=>{oe.current&&window.clearTimeout(oe.current)}),[Z]),b.useEffect(()=>{p(1)},[O,m]),b.useEffect(()=>{$(1)},[ne,Q]),b.useEffect(()=>e!=="Roles"?void 0:((async()=>{y.current?.abort();const ht=new AbortController;y.current=ht,u(!0);try{const cr=await X5({skipCount:Math.max(1,h),maxResultCount:m,roleName:O||void 0},ht.signal);n(cr.items??[]),i(cr.totalCount??0)}catch(cr){if(cr?.name==="AbortError")return;xe.error("Failed to load roles.",{description:cr?.message?String(cr.message):"Please try again."}),n([]),i(0)}finally{u(!1)}})(),()=>y.current?.abort()),[e,O,h,m,d]),b.useEffect(()=>e!=="Team Member"?void 0:((async()=>{D.current?.abort();const ht=new AbortController;D.current=ht,B(!0);try{const cr=await hfe({skipCount:Math.max(1,U),maxResultCount:Q,keyword:ne||void 0},ht.signal);z(cr.items??[]),H(cr.totalCount??0)}catch(cr){if(cr?.name==="AbortError")return;xe.error("Failed to load team members.",{description:cr?.message?String(cr.message):"Please try again."}),z([]),H(0)}finally{B(!1)}})(),()=>D.current?.abort()),[e,ne,U,Q,V]);const cd=()=>{switch(e){case"Roles":nt(null),qe(!0);break;case"Partner":Mo(!0);break;case"Group":Tl(!0);break;case"Team Member":ee(null),xa(!0);break}},ud=()=>{const we=e==="Team Member";return l.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[l.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[l.jsx(me,{placeholder:"Search",value:e==="Roles"?S:e==="Team Member"?Z:"",onChange:ht=>{e==="Roles"&&_(ht.target.value),e==="Team Member"&&ie(ht.target.value)},style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),l.jsx("div",{className:"flex-1"}),we&&l.jsxs(l.Fragment,{children:[l.jsx(fe,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Import"}),l.jsx(fe,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Edit"})]}),l.jsx(fe,{variant:"outline",onClick:mg,className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Export (PDF)"}),l.jsx(fe,{className:"h-10 bg-blue-600 hover:bg-blue-700 text-white rounded-md px-6 font-medium shrink-0",onClick:cd,children:"New+"})]}),l.jsx("div",{className:"w-full border-b border-gray-200",children:l.jsx("div",{className:"flex overflow-x-auto w-fit",children:["Roles","Partner","Group","Team Member"].map(ht=>l.jsx("button",{onClick:()=>t(ht),style:e===ht?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Ae("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e===ht?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:ht},ht))})})]})},gg=()=>{switch(e){case"Roles":return l.jsxs("div",{className:"flex flex-col",children:[l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-100",children:[l.jsx(ve,{className:"font-bold text-black border-r",children:"Role Name"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Role Code"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Status"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Order"}),l.jsx(ve,{className:"font-bold text-black text-center",children:"Actions"})]})}),l.jsx(Pr,{children:r.length===0?l.jsx(Be,{children:l.jsx(de,{colSpan:5,className:"text-center text-sm text-gray-500 py-10",children:o?"Loading...":"No data"})}):r.map(we=>l.jsxs(Be,{children:[l.jsx(de,{className:"font-medium border-r",children:we.roleName??"N/A"}),l.jsx(de,{className:"border-r text-gray-600",children:we.roleCode??"N/A"}),l.jsx(de,{className:"border-r",children:l.jsx(xr,{className:we.state?"bg-green-600":"bg-gray-400",children:we.state?"Active":"Inactive"})}),l.jsx(de,{className:"border-r text-gray-600",children:we.orderNum??"N/A"}),l.jsxs(de,{className:"text-center",children:[l.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{Rt(we),Ut(!0)},title:"Menu Permissions",children:l.jsx(m8,{className:"w-4 h-4 text-blue-600"})}),l.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{nt(we),qe(!0)},children:l.jsx(xn,{className:"w-4 h-4 text-gray-500"})}),l.jsx(fe,{variant:"ghost",size:"sm",onClick:async()=>{Ka(we),ya(!0)},title:"Delete role",children:l.jsx(Hc,{className:"w-4 h-4 text-red-600"})})]})]},we.id))})]}),l.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 bg-white flex flex-wrap items-center justify-between gap-3",children:[l.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",a===0?0:(h-1)*m+1,"-",Math.min(h*m,a)," of ",a]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Ke,{value:String(m),onValueChange:we=>v(Number(we)),children:[l.jsx(Ye,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:l.jsx(Xe,{})}),l.jsx(Je,{children:[10,20,50].map(we=>l.jsxs(Ne,{value:String(we),children:[we," / page"]},we))})]}),l.jsx(_i,{className:"mx-0 w-auto justify-end",children:l.jsxs(Ni,{children:[l.jsx(At,{children:l.jsx(Ci,{href:"#",size:"default",onClick:we=>{we.preventDefault(),p(ht=>Math.max(1,ht-1))},"aria-disabled":h<=1,className:h<=1?"pointer-events-none opacity-50":""})}),l.jsx(At,{children:l.jsxs(ua,{href:"#",isActive:!0,size:"default",onClick:we=>we.preventDefault(),children:["Page ",h," / ",x]})}),l.jsx(At,{children:l.jsx(Oi,{href:"#",size:"default",onClick:we=>{we.preventDefault(),p(ht=>Math.min(x,ht+1))},"aria-disabled":h>=x,className:h>=x?"pointer-events-none opacity-50":""})})]})})]})]})]});case"Partner":return l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-100",children:[l.jsx(ve,{className:"font-bold text-black border-r",children:"Partner Name"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Contact"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Phone"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Status"}),l.jsx(ve,{className:"font-bold text-black text-center",children:"Actions"})]})}),l.jsx(Pr,{children:C.map(we=>l.jsxs(Be,{children:[l.jsx(de,{className:"font-medium border-r",children:we.name}),l.jsx(de,{className:"border-r",children:we.contact}),l.jsx(de,{className:"border-r text-gray-600",children:we.phone}),l.jsx(de,{className:"border-r",children:l.jsx(xr,{className:we.status==="active"?"bg-green-600":"bg-gray-400",children:we.status})}),l.jsx(de,{className:"text-center",children:l.jsx(fe,{variant:"ghost",size:"sm",children:l.jsx(xn,{className:"w-4 h-4 text-gray-500"})})})]},we.id))})]});case"Group":return l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-100",children:[l.jsx(ve,{className:"font-bold text-black border-r",children:"Group Name"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Parent Partner"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Status"}),l.jsx(ve,{className:"font-bold text-black text-center",children:"Actions"})]})}),l.jsx(Pr,{children:T.map(we=>l.jsxs(Be,{children:[l.jsx(de,{className:"font-medium border-r",children:we.name}),l.jsx(de,{className:"border-r",children:we.partner}),l.jsx(de,{className:"border-r",children:l.jsx(xr,{className:we.status==="active"?"bg-green-600":"bg-gray-400",children:we.status})}),l.jsx(de,{className:"text-center",children:l.jsx(fe,{variant:"ghost",size:"sm",children:l.jsx(xn,{className:"w-4 h-4 text-gray-500"})})})]},we.id))})]});case"Team Member":return l.jsxs(l.Fragment,{children:[l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-100",children:[l.jsx(ve,{className:"font-bold text-black border-r",children:"Name"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Email"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Phone"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Role"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Assigned Locations"}),l.jsx(ve,{className:"font-bold text-black border-r",children:"Status"}),l.jsx(ve,{className:"font-bold text-black text-center",children:"Actions"})]})}),l.jsx(Pr,{children:F?l.jsx(Be,{children:l.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):L.length===0?l.jsx(Be,{children:l.jsx(de,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):L.map(we=>l.jsxs(Be,{children:[l.jsx(de,{className:"font-medium border-r",children:we.fullName??we.userName??"N/A"}),l.jsx(de,{className:"border-r text-gray-600",children:we.email??"N/A"}),l.jsx(de,{className:"border-r text-gray-600",children:we.phone??"N/A"}),l.jsx(de,{className:"border-r",children:l.jsx(xr,{variant:"outline",className:"font-normal",children:we.roleName??we.roleId??"N/A"})}),l.jsx(de,{className:"border-r",children:l.jsxs("div",{className:"flex flex-col gap-1",children:[(we.locations?.length?we.locations:we.locationIds??[]).map(ht=>l.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-600",children:[l.jsx(hl,{className:"w-3 h-3"})," ",ht]},ht)),!we.locations?.length&&!(we.locationIds?.length??0)&&l.jsx("div",{className:"text-xs text-gray-500",children:"None"})]})}),l.jsx(de,{className:"border-r",children:l.jsx(xr,{className:we.state?"bg-green-600":"bg-gray-400",children:we.state?"Active":"Inactive"})}),l.jsx(de,{className:"text-center",children:l.jsxs("div",{className:"flex items-center justify-center gap-2",children:[l.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{ee(we),xa(!0)},title:"Edit",children:l.jsx(xn,{className:"w-4 h-4 text-gray-500"})}),l.jsx(fe,{variant:"ghost",size:"sm",onClick:()=>{_e(we),pe(!0)},title:"Delete",children:l.jsx(Hc,{className:"w-4 h-4 text-red-600"})})]})})]},we.id))})]}),l.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 bg-white flex flex-wrap items-center justify-between gap-3",children:[l.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",q===0?0:(U-1)*Q+1,"-",Math.min(U*Q,q)," of ",q]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Ke,{value:String(Q),onValueChange:we=>k(Number(we)),children:[l.jsx(Ye,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:l.jsx(Xe,{})}),l.jsx(Je,{children:[10,20,50].map(we=>l.jsxs(Ne,{value:String(we),children:[we," / page"]},we))})]}),l.jsx(_i,{className:"mx-0 w-auto justify-end",children:l.jsxs(Ni,{children:[l.jsx(At,{children:l.jsx(Ci,{href:"#",size:"default",onClick:we=>{we.preventDefault(),$(ht=>Math.max(1,ht-1))},"aria-disabled":U<=1,className:U<=1?"pointer-events-none opacity-50":""})}),l.jsx(At,{children:l.jsxs(ua,{href:"#",isActive:!0,size:"default",onClick:we=>we.preventDefault(),children:["Page ",U," / ",I]})}),l.jsx(At,{children:l.jsx(Oi,{href:"#",size:"default",onClick:we=>{we.preventDefault(),$(ht=>Math.min(I,ht+1))},"aria-disabled":U>=I,className:U>=I?"pointer-events-none opacity-50":""})})]})})]})]})]})}};return l.jsxs("div",{className:"h-full flex flex-col",children:[ud(),l.jsx("div",{className:"flex-1 overflow-auto pt-6",children:l.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md",children:gg()})}),l.jsx(Sfe,{open:Ce,role:De,onOpenChange:we=>{qe(we),we||nt(null)},onSaved:()=>{p(1),c(we=>we+1)}}),l.jsx(jfe,{open:kt,role:lr,onOpenChange:we=>{Ut(we),we||Rt(null)}}),l.jsx(_fe,{open:Br,role:Di,onOpenChange:we=>{ya(we),we||Ka(null)},onDeleted:()=>c(we=>we+1)}),l.jsx(Nfe,{open:ld,onOpenChange:Mo}),l.jsx(Cfe,{open:Do,onOpenChange:Tl}),l.jsx(Ofe,{open:Li,member:J,onOpenChange:we=>{xa(we),we||ee(null)},onSaved:()=>{$(1),G(we=>we+1)}}),l.jsx(Efe,{open:ce,member:W,onOpenChange:we=>{pe(we),we||_e(null)},onDeleted:()=>{G(we=>we+1)}})]})}function Sfe({open:e,role:t,onOpenChange:r,onSaved:n}){const a=!!t?.id,[i,o]=b.useState(!1),[u,d]=b.useState(""),[c,h]=b.useState(""),[p,m]=b.useState(""),[v,x]=b.useState(""),[y,S]=b.useState(!0);b.useEffect(()=>{e&&(o(!1),d(t?.roleName??""),h(t?.roleCode??""),m(t?.remark??""),x(t?.orderNum===null||t?.orderNum===void 0?"":String(t.orderNum)),S(t?.state??!0))},[e,t]);const _=b.useMemo(()=>!!(u.trim()&&c.trim()),[u,c]),N=A=>{const C=A.trim();if(!C)return null;const E=Number.parseInt(C,10);return Number.isFinite(E)?E:null},O=async()=>{if(console.log("submit",t),!_){xe.error("Please fill in required fields.",{description:"Role Name and Role Code are required."});return}o(!0);try{const A={roleName:u.trim(),roleCode:c.trim(),remark:p.trim()?p.trim():null,state:!!y,orderNum:N(v)};a&&t?.id?(await ofe(t.id,A),xe.success("Role updated.",{description:"Role fields have been saved successfully."})):(await ife(A),xe.success("Role created.",{description:"A new role has been created successfully."})),r(!1),n()}catch(A){xe.error(a?"Failed to update role.":"Failed to create role.",{description:A?.message?String(A.message):"Please try again."})}finally{o(!1)}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-[600px]",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:a?"Edit Role":"Create Role"}),l.jsx(Nt,{children:a?"Update role fields and save changes.":"Fill out the form to create a new role."})]}),l.jsxs("div",{className:"space-y-4 py-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Role Name *"}),l.jsx(me,{value:u,onChange:A=>d(A.target.value),placeholder:"e.g. Inventory Specialist"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Role Code *"}),l.jsx(me,{value:c,onChange:A=>h(A.target.value),placeholder:"e.g. inventory_specialist"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Remark"}),l.jsx(me,{value:p,onChange:A=>m(A.target.value),placeholder:"Optional"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Order"}),l.jsx(me,{value:v,onChange:A=>x(A.target.value),placeholder:"e.g. 10"})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),l.jsx(qt,{checked:y,onCheckedChange:S})]})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{disabled:i,onClick:O,className:"bg-blue-600 text-white hover:bg-blue-700",children:i?"Saving...":"Save"})]})]})})}function jfe({open:e,role:t,onOpenChange:r}){const n=t?.id??"",a=t?.roleName??"",[i,o]=b.useState(!1),[u,d]=b.useState([]),[c,h]=b.useState(new Set),[p,m]=b.useState(new Set),[v,x]=b.useState(!1),y=b.useRef(null),[S,_]=b.useState(""),N=b.useRef(null),[O,A]=b.useState("");b.useEffect(()=>(N.current&&window.clearTimeout(N.current),N.current=window.setTimeout(()=>A(S.trim()),300),()=>{N.current&&window.clearTimeout(N.current)}),[S]),b.useEffect(()=>e?(o(!1),m(new Set),h(new Set),(async()=>{y.current?.abort();const G=new AbortController;y.current=G,x(!0);try{const U=await Xde(G.signal);if(d(U??[]),n){const $=await ufe(n,G.signal);m(new Set($))}}catch(U){if(U?.name==="AbortError")return;xe.error("Failed to load menus.",{description:U?.message?String(U.message):"Please try again."}),d([]),m(new Set)}finally{x(!1)}})(),()=>y.current?.abort()):void 0,[e,n]);const C=b.useMemo(()=>{const V=G=>G.reduce((U,$)=>U+1+($.children?V($.children):0),0);return V(u)},[u]),E=b.useMemo(()=>{const V=O.trim().toLowerCase();if(!V)return u;const G=$=>{const Q=($.menuName??"").toLowerCase(),k=($.routeUrl??"").toLowerCase();return Q.includes(V)||k.includes(V)},U=$=>{const Q=[];for(const k of $){const I=k.children?U(k.children):[];(G(k)||I.length)&&Q.push({...k,children:I.length?I:void 0})}return Q};return U(u)},[u,O]);b.useEffect(()=>{if(!O.trim())return;const G=new Set,U=$=>{for(const Q of $)Q.children?.length&&G.add(Q.id),Q.children?.length&&U(Q.children)};U(E),h(G)},[O,E]);const T=V=>{const G=[],U=$=>{$.id&&G.push($.id),$.children?.length&&$.children.forEach(U)};return U(V),G},R=V=>{const G=T(V);if(!G.length)return{checked:!1,indeterminate:!1};let U=0;for(const $ of G)p.has($)&&(U+=1);return U===0?{checked:!1,indeterminate:!1}:U===G.length?{checked:!0,indeterminate:!1}:{checked:!1,indeterminate:!0}},L=(V,G)=>{m(U=>{const $=new Set(U),Q=T(V);return G?Q.forEach(k=>$.add(k)):Q.forEach(k=>$.delete(k)),$})},z=V=>{h(G=>{const U=new Set(G);return U.has(V)?U.delete(V):U.add(V),U})},F=V=>{const G=O.trim(),U=V??"";if(!G)return U||"N/A";const $=U.toLowerCase().indexOf(G.toLowerCase());if($<0)return U||"N/A";const Q=U.slice(0,$),k=U.slice($,$+G.length),I=U.slice($+G.length);return l.jsxs("span",{children:[Q,l.jsx("span",{className:"bg-yellow-200 rounded px-0.5",children:k}),I]})},B=({node:V,depth:G})=>{const U=!!V.children?.length,$=c.has(V.id),{checked:Q,indeterminate:k}=R(V);return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 py-1",style:{paddingLeft:G*16},children:[l.jsx("button",{type:"button",className:Ae("h-6 w-6 flex items-center justify-center rounded hover:bg-gray-100",!U&&"opacity-0 pointer-events-none"),onClick:()=>U&&z(V.id),"aria-label":U?$?"Collapse":"Expand":"No children",children:U?$?l.jsx(Is,{className:"h-4 w-4"}):l.jsx(Ms,{className:"h-4 w-4"}):null}),l.jsx(Eu,{id:`perm-menu-${V.id}`,checked:k?"indeterminate":Q,onCheckedChange:I=>L(V,!!I)}),l.jsx("label",{htmlFor:`perm-menu-${V.id}`,className:"text-sm leading-none cursor-pointer select-none",children:F(V.menuName??V.routeUrl??V.id)})]}),U&&$&&l.jsx("div",{children:V.children.map(I=>l.jsx(B,{node:I,depth:G+1},I.id))})]})},q=async()=>{if(console.log("submit",t),!!n){o(!0);try{await tfe({roleId:n,menuIds:Array.from(p)}),xe.success("Role menu permissions saved.",{description:"Menu permissions have been updated successfully."}),r(!1)}catch(V){xe.error("Failed to save menu permissions.",{description:V?.message?String(V.message):"Please try again."})}finally{o(!1)}}},H=async()=>{if(!(!n||p.size===0)){o(!0);try{await rfe({roleId:n,menuIds:Array.from(p)}),m(new Set),xe.success("Role menu permissions cleared.",{description:"Selected permissions have been removed."})}catch(V){xe.error("Failed to delete menu permissions.",{description:V?.message?String(V.message):"Please try again."})}finally{o(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-none",style:{width:"50%"},children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Menu Permissions"}),l.jsx(Nt,{children:a?`Set menu permissions for role: ${a}`:"Set menu permissions for this role."})]}),l.jsx("div",{className:"space-y-4 py-4",children:l.jsxs("div",{className:"rounded border border-gray-200 bg-white",children:[l.jsx("div",{className:"px-3 py-2 text-xs text-gray-500 border-b border-gray-200",children:l.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[l.jsx("div",{children:v?"Loading menus...":`Total ${C} menus`}),l.jsx(me,{value:S,onChange:V=>_(V.target.value),placeholder:"Search menus",className:"h-8 w-44 bg-white"})]})}),l.jsx($s,{className:"h-72",children:l.jsxs("div",{className:"p-3 space-y-2",children:[E.map(V=>l.jsx(B,{node:V,depth:0},V.id)),!v&&E.length===0&&l.jsx("div",{className:"text-sm text-gray-500 py-6 text-center",children:"No menus."})]})})]})}),l.jsxs(xt,{className:"flex flex-row justify-end gap-2",children:[l.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{variant:"destructive",disabled:i||p.size===0||!n,onClick:H,children:"Delete Selected"}),l.jsx(fe,{disabled:i||!n,onClick:q,className:"bg-blue-600 text-white hover:bg-blue-700",children:i?"Saving...":"Save"})]})]})})}function _fe({open:e,role:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>(t?.roleName??"").trim()||t?.roleCode||t?.id||"this role",[t]),u=async()=>{if(console.log("submit",t),!!t?.id){i(!0);try{await cfe(t.id),xe.success("Role deleted.",{description:"The role has been removed successfully."}),r(!1),n()}catch(d){xe.error("Failed to delete role.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-none",style:{width:"30%"},children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Delete Role"}),l.jsx(Nt,{children:"This action cannot be undone."})]}),l.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",l.jsx("span",{className:"font-medium",children:o}),"?"]}),l.jsxs(xt,{className:"flex-row flex-wrap justify-end",children:[l.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function Nfe({open:e,onOpenChange:t}){return l.jsx(mt,{open:e,onOpenChange:t,children:l.jsxs(ft,{children:[l.jsx(gt,{children:l.jsx(vt,{children:"Create New Partner"})}),l.jsxs("div",{className:"space-y-4 py-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Partner Name"}),l.jsx(me,{placeholder:"Company Name"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Contact Email"}),l.jsx(me,{placeholder:"admin@partner.com"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Phone Number"}),l.jsx(me,{type:"tel",placeholder:"+1 (555) 000-0000"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qt,{id:"partner-status",defaultChecked:!0}),l.jsx(ue,{htmlFor:"partner-status",children:"Active"})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsx(fe,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Partner"})]})]})})}function Cfe({open:e,onOpenChange:t}){return l.jsx(mt,{open:e,onOpenChange:t,children:l.jsxs(ft,{children:[l.jsx(gt,{children:l.jsx(vt,{children:"Create New Group"})}),l.jsxs("div",{className:"space-y-4 py-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Group Name"}),l.jsx(me,{placeholder:"e.g. West Coast Region"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Assign to Partner"}),l.jsxs(Ke,{children:[l.jsx(Ye,{children:l.jsx(Xe,{placeholder:"Select Partner"})}),l.jsx(Je,{children:J5.map(r=>l.jsx(Ne,{value:r.id,children:r.name},r.id))})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qt,{id:"group-status",defaultChecked:!0}),l.jsx(ue,{htmlFor:"group-status",children:"Active"})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsx(fe,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Group"})]})]})})}function Ofe({open:e,member:t,onOpenChange:r,onSaved:n}){const a=!!t?.id,[i,o]=b.useState(!1),[u,d]=b.useState(""),[c,h]=b.useState(""),[p,m]=b.useState(""),[v,x]=b.useState(""),[y,S]=b.useState(""),[_,N]=b.useState(""),[O,A]=b.useState(!0),[C,E]=b.useState(new Set),[T,R]=b.useState([]),[L,z]=b.useState(!1),[F,B]=b.useState([]),[q,H]=b.useState(!1),[V,G]=b.useState(""),U=b.useRef(null),$=()=>{d(""),h(""),m(""),x(""),S(""),N(""),A(!0),E(new Set)},Q=async ne=>{const K=[];let J=1;const ee=100;for(;;){const pe=await X5({skipCount:J,maxResultCount:ee},ne);if(K.push(...pe.items??[]),!pe.items||pe.items.length200))break}const ce=new Map;for(const pe of K)pe.id&&!ce.has(pe.id)&&ce.set(pe.id,pe);return Array.from(ce.values())},k=async ne=>{const K=[];let J=1;const ee=200;for(;;){const pe=await Al({skipCount:J,maxResultCount:ee},ne);if(K.push(...pe.items??[]),!pe.items||pe.items.length200))break}const ce=new Map;for(const pe of K)pe.id&&!ce.has(pe.id)&&ce.set(pe.id,pe);return Array.from(ce.values())};b.useEffect(()=>{if(!e)return;U.current?.abort();const ne=new AbortController;return U.current=ne,o(!1),$(),z(!0),H(!0),(async()=>{try{const[J,ee]=await Promise.all([Q(ne.signal),k(ne.signal)]);if(R(J),B(ee),t?.id){const ce=await pfe(t.id,ne.signal);d(ce.fullName??""),h(ce.userName??""),x(ce.email??""),S(ce.phone!=null?String(ce.phone):"");let pe=(ce.roleId??"").toString().trim();if(!pe&&ce.roleName){const _e=String(ce.roleName).trim().toLowerCase(),Ce=J.find(qe=>{const De=String(qe.roleName??"").trim().toLowerCase(),nt=String(qe.roleCode??"").trim().toLowerCase(),kt=String(qe.id??"").trim().toLowerCase();return De===_e||nt===_e||kt===_e});Ce?.id&&(pe=Ce.id)}N(pe),A(!!ce.state);const W=ce.locationIds&&ce.locationIds.length?ce.locationIds:[];if(W.length)E(new Set(W));else if(ce.locations?.length){const _e=new Set(ce.locations),Ce=new Set;for(const qe of ee){const De=`${(qe.locationCode??"").trim()} - ${(qe.locationName??"").trim()}`.trim(),nt=(qe.locationName??"").trim(),kt=(qe.locationCode??"").trim();(_e.has(De)||_e.has(nt)||_e.has(kt))&&Ce.add(qe.id)}E(Ce)}}}catch(J){J?.name!=="AbortError"&&xe.error("Failed to load user form.",{description:J?.message?String(J.message):"Please try again."})}finally{z(!1),H(!1)}})(),()=>ne.abort()},[e,t?.id]);const I=b.useMemo(()=>!(!u.trim()||!c.trim()||!_.trim()||C.size===0||!a&&!p.trim()),[u,c,_,C,a,p]),D=(ne,K)=>{E(J=>{const ee=new Set(J);return K?ee.add(ne):ee.delete(ne),ee})},Z=async ne=>{if(ne?.preventDefault(),ne?.stopPropagation(),console.log("[MemberDialog] submit called",{isEdit:a,memberId:t?.id,canSubmit:I,roleId:_,fullName:u,userName:c,selectedLocationIds:C.size}),!I){const K=[];u.trim()||K.push("Full Name"),c.trim()||K.push("User Name"),_.trim()||K.push("Role"),C.size===0&&K.push("Locations"),!a&&!p.trim()&&K.push("Password"),xe.error("Missing required fields.",{description:`Please fill: ${K.join("、")}.`});return}if(!a&&!t?.id){o(!0);try{const K=Array.from(C);console.log("[MemberDialog] Creating user",{fullName:u,userName:c,roleId:_,locationIds:K}),await vfe({fullName:u.trim(),userName:c.trim(),password:p.trim(),email:v.trim()?v.trim():null,phone:y!=null&&String(y).trim()?String(y).trim():null,roleId:_.trim(),locationIds:K,state:O}),xe.success("User created.",{description:"A new user has been created successfully."}),r(!1),n()}catch(K){console.error("[MemberDialog] Create error",K),xe.error("Failed to create user.",{description:K?.message?String(K.message):"Please try again."})}finally{o(!1)}}else if(a&&t?.id){o(!0);try{const K=Array.from(C);console.log("[MemberDialog] Updating user",{id:t.id,fullName:u,userName:c,roleId:_,locationIds:K}),await yfe(t.id,{fullName:u.trim(),userName:c.trim(),password:p.trim()?p.trim():null,email:v.trim()?v.trim():null,phone:y!=null&&String(y).trim()?String(y).trim():null,roleId:_.trim(),locationIds:K,state:O}),xe.success("User updated.",{description:"Changes have been saved successfully."}),r(!1),n()}catch(K){console.error("[MemberDialog] Update error",K),xe.error("Failed to update user.",{description:K?.message?String(K.message):"Please try again."})}finally{o(!1)}}else console.error("[MemberDialog] Invalid state",{isEdit:a,memberId:t?.id}),xe.error("Invalid form state.",{description:"Please refresh and try again."})},ie=ne=>{const K=(ne.locationCode??"").trim(),J=(ne.locationName??"").trim();return K&&J?`${K} - ${J}`:J||K||ne.id},oe=b.useMemo(()=>{const ne=V.trim().toLowerCase();return ne?F.filter(K=>ie(K).toLowerCase().includes(ne)):F},[F,V]);return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-none",style:{width:"50%"},children:[l.jsxs(gt,{children:[l.jsx(vt,{children:a?"Edit User":"New User"}),l.jsx(Nt,{children:"Role is single-select; Locations is multi-select."})]}),l.jsxs("div",{className:"space-y-4 py-4 max-h-[70vh] overflow-y-auto pr-1",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Full Name *"}),l.jsx(me,{value:u,onChange:ne=>d(ne.target.value),placeholder:"John Doe"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"User Name *"}),l.jsx(me,{value:c,onChange:ne=>h(ne.target.value),placeholder:"username"})]})]}),!a&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Password *"}),l.jsx(me,{type:"password",value:p,onChange:ne=>m(ne.target.value),placeholder:"Enter password",autoComplete:"new-password",className:"w-full"})]}),a&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Password (Optional)"}),l.jsx(me,{type:"password",value:p,onChange:ne=>m(ne.target.value),placeholder:"Enter new password (optional)",autoComplete:"new-password",className:"w-full"})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Email"}),l.jsx(me,{type:"email",value:v,onChange:ne=>x(ne.target.value),placeholder:"john@example.com"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Phone"}),l.jsx(me,{type:"tel",value:y,onChange:ne=>S(ne.target.value),placeholder:"+1 (555) 000-0000"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Role *"}),l.jsxs(Ke,{value:_||"",onValueChange:ne=>{const K=ne&&ne.trim()?ne.trim():"";console.log("[MemberDialog] Role changed",{old:_,new:K,v:ne}),N(K)},disabled:L,children:[l.jsx(Ye,{className:"h-10 rounded-md border border-gray-200 bg-white",children:l.jsx(Xe,{placeholder:L?"Loading roles...":"Select role"})}),l.jsx(Je,{children:T.map(ne=>l.jsx(Ne,{value:ne.id,children:ne.roleName??ne.roleCode??ne.id},ne.id))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Locations *"}),l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx(me,{value:V,onChange:ne=>G(ne.target.value),placeholder:"Search locations",className:"h-9"}),l.jsxs("div",{className:"text-xs text-gray-500 shrink-0",children:[C.size," selected"]})]}),l.jsx($s,{className:"h-[180px] w-full border rounded-md p-2",children:l.jsx("div",{className:"space-y-2",children:q?l.jsx("div",{className:"text-sm text-gray-500 py-2",children:"Loading..."}):oe.map(ne=>l.jsxs("div",{className:"flex items-center space-x-2",children:[l.jsx(Eu,{id:`loc-${ne.id}`,checked:C.has(ne.id),onCheckedChange:K=>D(ne.id,!!K)}),l.jsx("label",{htmlFor:`loc-${ne.id}`,className:"text-sm cursor-pointer w-full hover:bg-gray-50 p-1 rounded",children:ie(ne)})]},ne.id))})}),l.jsx("p",{className:"text-xs text-gray-500",children:"* Users must be assigned to at least one location."})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[l.jsx(qt,{id:"member-status",checked:O,onCheckedChange:A}),l.jsx(ue,{htmlFor:"member-status",children:O?"Active":"Inactive"})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{disabled:i||!I,onClick:ne=>{ne.preventDefault(),ne.stopPropagation(),Z(ne)},className:"bg-blue-600 text-white hover:bg-blue-700",children:i?"Saving...":a?"Save":"Create"})]})]})})}function Efe({open:e,member:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>{const d=(t?.fullName??"").trim(),c=(t?.userName??"").trim();return d||c||"this user"},[t?.fullName,t?.userName]),u=async()=>{if(console.log("submit",t),!!t?.id){i(!0);try{await xfe(t.id),xe.success("User deleted.",{description:"The user has been removed successfully."}),r(!1),n()}catch(d){xe.error("Failed to delete user.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-none",style:{width:"30%"},children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Delete User"}),l.jsx(Nt,{children:"This action cannot be undone."})]}),l.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",l.jsx("span",{className:"font-medium",children:o}),"?"]}),l.jsxs(xt,{className:"flex-row flex-wrap justify-end",children:[l.jsx(fe,{variant:"outline",className:"min-w-24",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{variant:"destructive",className:"min-w-24",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}const Pfe=[{id:"1-251201",productName:"Whole Milk",category:"Dairy",template:'2"x2" Basic',printedAt:"2024-03-20 09:30 AM",printedBy:"Alice Johnson",location:"Downtown Store (101)",expiryDate:"2024-03-27",status:"Valid"},{id:"2-251201",productName:"Ground Beef",category:"Meat",template:'2"x2" Basic',printedAt:"2024-03-20 10:15 AM",printedBy:"Bob Smith",location:"Uptown Store (102)",expiryDate:"2024-03-23",status:"Valid"},{id:"3-251201",productName:"Croissant",category:"Bakery",template:'2"x2" Basic',printedAt:"2024-03-19 14:00 PM",printedBy:"Charlie Brown",location:"Downtown Store (101)",expiryDate:"2024-03-20",status:"Expired"},{id:"4-251201",productName:"Caesar Salad",category:"Deli",template:`2"x6" G'n'G !!!`,printedAt:"2024-03-18 11:45 AM",printedBy:"Alice Johnson",location:"Downtown Store (101)",expiryDate:"2024-03-21",status:"Expiring Soon"},{id:"5-251201",productName:"Orange Juice",category:"Beverage",template:'2"x2" Basic',printedAt:"2024-03-18 08:20 AM",printedBy:"Bob Smith",location:"Airport Kiosk (201)",expiryDate:"2024-03-25",status:"Valid"}],Afe=[{name:"Dairy",count:450},{name:"Meat",count:320},{name:"Bakery",count:280},{name:"Deli",count:190},{name:"Produce",count:150},{name:"Beverage",count:120}],Tfe=[{date:"Mon",count:120},{date:"Tue",count:132},{date:"Wed",count:101},{date:"Thu",count:134},{date:"Fri",count:190},{date:"Sat",count:230},{date:"Sun",count:210}];function kfe(){const[e,t]=b.useState("print-log"),r=n=>{xe.success(`Reprinting label ${n}`,{description:"Watermark 'RePrint' applied."})};return l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsxs("div",{className:"pb-4",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsxs(Ke,{defaultValue:"partner-a",children:[l.jsx(Ye,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Partner"})}),l.jsx(Je,{children:l.jsx(Ne,{value:"partner-a",children:"Partner A"})})]}),l.jsxs(Ke,{defaultValue:"group-b",children:[l.jsx(Ye,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Group"})}),l.jsx(Je,{children:l.jsx(Ne,{value:"group-b",children:"Group B"})})]}),l.jsxs(Ke,{defaultValue:"loc-12345",children:[l.jsx(Ye,{className:"w-[160px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Location"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"loc-12345",children:"Downtown Store"}),l.jsx(Ne,{value:"all",children:"All Locations"})]})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[l.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Period Search:"}),l.jsxs("div",{className:"flex items-center bg-white border border-gray-300 rounded-md h-10 px-2",style:{minHeight:40},children:[l.jsx(_z,{className:"w-4 h-4 text-gray-500 mr-2 shrink-0"}),l.jsx("input",{type:"date",className:"text-sm outline-none w-32 bg-transparent"}),l.jsx("span",{className:"mx-2 text-gray-400",children:"-"}),l.jsx("input",{type:"date",className:"text-sm outline-none w-32 bg-transparent"})]})]}),l.jsxs("div",{className:"flex items-center w-64 rounded-md border border-gray-300 bg-white overflow-hidden shrink-0",style:{height:40},children:[l.jsx(Kp,{className:"h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none"}),l.jsx(me,{placeholder:"Search Product or Category...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full placeholder:text-gray-500"})]}),l.jsx("div",{className:"flex-1 min-w-2"}),l.jsxs(fe,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[l.jsx(CS,{className:"w-4 h-4"})," Export Report"]})]}),l.jsx("div",{className:"w-full border-b border-gray-200 mt-4",children:l.jsxs("div",{className:"flex overflow-x-auto w-fit",children:[l.jsx("button",{onClick:()=>t("print-log"),style:e==="print-log"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Ae("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e==="print-log"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:"Print Log"}),l.jsx("button",{onClick:()=>t("label-report"),style:e==="label-report"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Ae("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e==="label-report"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:"Label Report"})]})})]}),l.jsxs("div",{className:"flex-1 overflow-auto pt-6",children:[e==="print-log"&&l.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-100 hover:bg-gray-100",children:[l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Label ID"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Product Name"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Category"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Template"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Printed At"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Printed By"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Location"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Expiry Date"}),l.jsx(ve,{className:"text-gray-900 font-bold text-center",children:"Action"})]})}),l.jsx(Pr,{children:Pfe.map(n=>l.jsxs(Be,{children:[l.jsx(de,{className:"border-r font-numeric text-gray-600",children:n.id}),l.jsx(de,{className:"border-r font-medium",children:n.productName}),l.jsx(de,{className:"border-r",children:l.jsx(xr,{variant:"secondary",className:"bg-blue-50 text-blue-700 hover:bg-blue-50 border-blue-200",children:n.category})}),l.jsx(de,{className:"border-r text-gray-600 text-sm",children:(()=>{const a=n.template.endsWith(" !!!"),i=a?n.template.slice(0,-4):n.template,o=i.lastIndexOf(" "),u=i.slice(0,o+1),d=i.slice(o+1);return l.jsxs(l.Fragment,{children:[u,l.jsx("span",{className:"font-bold text-gray-900",children:d}),a&&l.jsx("span",{className:"text-red-600",children:" !!!"})]})})()}),l.jsx(de,{className:"border-r text-gray-600 text-sm font-numeric",children:n.printedAt}),l.jsx(de,{className:"border-r text-gray-600 text-sm",children:n.printedBy}),l.jsx(de,{className:"border-r text-gray-600 text-sm font-numeric",children:n.location}),l.jsx(de,{className:"border-r",children:l.jsx("span",{className:Ae("text-sm font-medium font-numeric",n.status==="Expired"?"text-red-600":n.status==="Expiring Soon"?"text-orange-500":"text-green-600"),children:n.expiryDate})}),l.jsx(de,{className:"text-center",children:l.jsxs(fe,{size:"sm",variant:"outline",className:"h-8 gap-1 hover:bg-gray-100 border-gray-300",onClick:()=>r(n.id),children:[l.jsx(nM,{className:"w-3 h-3"})," Reprint"]})})]},n.id))})]})}),e==="label-report"&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[l.jsxs(Xr,{children:[l.jsxs(Ln,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx($n,{className:"text-sm font-medium",children:"Total Labels Printed"}),l.jsx(Ds,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(vn,{children:[l.jsx("div",{className:"text-2xl font-bold",children:"2,543"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"+20.1% from last month"})]})]}),l.jsxs(Xr,{children:[l.jsxs(Ln,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx($n,{className:"text-sm font-medium",children:"Most Printed Category"}),l.jsx(Cz,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(vn,{children:[l.jsx("div",{className:"text-2xl font-bold",children:"Dairy"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"450 labels generated"})]})]}),l.jsxs(Xr,{children:[l.jsxs(Ln,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx($n,{className:"text-sm font-medium",children:"Top Product"}),l.jsx(YI,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(vn,{children:[l.jsx("div",{className:"text-2xl font-bold",children:"Whole Milk"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"182 labels generated"})]})]}),l.jsxs(Xr,{children:[l.jsxs(Ln,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[l.jsx($n,{className:"text-sm font-medium",children:"Avg. Daily Prints"}),l.jsx(c8,{className:"h-4 w-4 text-muted-foreground"})]}),l.jsxs(vn,{children:[l.jsx("div",{className:"text-2xl font-bold",children:"85"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"+12% from last week"})]})]})]}),l.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l.jsxs(Xr,{className:"col-span-1",children:[l.jsxs(Ln,{children:[l.jsx($n,{children:"Labels by Category"}),l.jsx(Dh,{children:"Distribution of printed labels across product categories."})]}),l.jsx(vn,{className:"h-[300px]",children:l.jsx(Kh,{width:"100%",height:"100%",children:l.jsxs(dae,{data:Afe,children:[l.jsx(Ip,{strokeDasharray:"3 3",vertical:!1}),l.jsx(bo,{dataKey:"name",fontSize:12,tickLine:!1,axisLine:!1}),l.jsx(wo,{fontSize:12,tickLine:!1,axisLine:!1,tickFormatter:n=>`${n}`}),l.jsx(Yr,{}),l.jsx(Io,{dataKey:"count",fill:"#facc15",radius:[4,4,0,0]})]})})})]}),l.jsxs(Xr,{className:"col-span-1",children:[l.jsxs(Ln,{children:[l.jsx($n,{children:"Print Volume Trends"}),l.jsx(Dh,{children:"Daily label printing volume for the last 7 days."})]}),l.jsx(vn,{className:"h-[300px]",children:l.jsx(Kh,{width:"100%",height:"100%",children:l.jsxs(s4,{data:Tfe,children:[l.jsx(Ip,{strokeDasharray:"3 3",vertical:!1}),l.jsx(bo,{dataKey:"date",fontSize:12,tickLine:!1,axisLine:!1}),l.jsx(wo,{fontSize:12,tickLine:!1,axisLine:!1}),l.jsx(Yr,{}),l.jsx(_l,{type:"monotone",dataKey:"count",stroke:"#dc2626",strokeWidth:2,dot:{r:4},activeDot:{r:6}})]})})})]})]}),l.jsxs(Xr,{children:[l.jsx(Ln,{children:l.jsx($n,{children:"Most Used Products"})}),l.jsx(vn,{children:l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{children:[l.jsx(ve,{children:"Product Name"}),l.jsx(ve,{children:"Category"}),l.jsx(ve,{className:"text-right",children:"Total Printed"}),l.jsx(ve,{className:"text-right",children:"Usage %"})]})}),l.jsxs(Pr,{children:[l.jsxs(Be,{children:[l.jsx(de,{className:"font-medium",children:"Whole Milk"}),l.jsx(de,{children:"Dairy"}),l.jsx(de,{className:"text-right",children:"182"}),l.jsx(de,{className:"text-right",children:"7.2%"})]}),l.jsxs(Be,{children:[l.jsx(de,{className:"font-medium",children:"Ground Beef 80/20"}),l.jsx(de,{children:"Meat"}),l.jsx(de,{className:"text-right",children:"145"}),l.jsx(de,{className:"text-right",children:"5.7%"})]}),l.jsxs(Be,{children:[l.jsx(de,{className:"font-medium",children:"Chicken Breast"}),l.jsx(de,{children:"Meat"}),l.jsx(de,{className:"text-right",children:"132"}),l.jsx(de,{className:"text-right",children:"5.2%"})]}),l.jsxs(Be,{children:[l.jsx(de,{className:"font-medium",children:"Sliced Ham"}),l.jsx(de,{children:"Deli"}),l.jsx(de,{className:"text-right",children:"98"}),l.jsx(de,{className:"text-right",children:"3.8%"})]})]})]})})]})]})]})]})}var Rfe=Symbol("radix.slottable");function Ife(e){const t=({children:r})=>l.jsx(l.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Rfe,t}var[hg]=Ua("Tooltip",[Ol]),pg=Ol(),Q5="TooltipProvider",Mfe=700,jS="tooltip.open",[Dfe,c_]=hg(Q5),Z5=e=>{const{__scopeTooltip:t,delayDuration:r=Mfe,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:i}=e,o=b.useRef(!0),u=b.useRef(!1),d=b.useRef(0);return b.useEffect(()=>{const c=d.current;return()=>window.clearTimeout(c)},[]),l.jsx(Dfe,{scope:t,isOpenDelayedRef:o,delayDuration:r,onOpen:b.useCallback(()=>{window.clearTimeout(d.current),o.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:b.useCallback(c=>{u.current=c},[]),disableHoverableContent:a,children:i})};Z5.displayName=Q5;var Tu="Tooltip",[Lfe,sd]=hg(Tu),eB=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:u}=e,d=c_(Tu,e.__scopeTooltip),c=pg(t),[h,p]=b.useState(null),m=Lr(),v=b.useRef(0),x=o??d.disableHoverableContent,y=u??d.delayDuration,S=b.useRef(!1),[_,N]=jo({prop:n,defaultProp:a??!1,onChange:T=>{T?(d.onOpen(),document.dispatchEvent(new CustomEvent(jS))):d.onClose(),i?.(T)},caller:Tu}),O=b.useMemo(()=>_?S.current?"delayed-open":"instant-open":"closed",[_]),A=b.useCallback(()=>{window.clearTimeout(v.current),v.current=0,S.current=!1,N(!0)},[N]),C=b.useCallback(()=>{window.clearTimeout(v.current),v.current=0,N(!1)},[N]),E=b.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{S.current=!0,N(!0),v.current=0},y)},[y,N]);return b.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),l.jsx(Xj,{...c,children:l.jsx(Lfe,{scope:t,contentId:m,open:_,stateAttribute:O,trigger:h,onTriggerChange:p,onTriggerEnter:b.useCallback(()=>{d.isOpenDelayedRef.current?E():A()},[d.isOpenDelayedRef,E,A]),onTriggerLeave:b.useCallback(()=>{x?C():(window.clearTimeout(v.current),v.current=0)},[C,x]),onOpen:A,onClose:C,disableHoverableContent:x,children:r})})};eB.displayName=Tu;var _S="TooltipTrigger",tB=b.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=sd(_S,r),i=c_(_S,r),o=pg(r),u=b.useRef(null),d=at(t,u,a.onTriggerChange),c=b.useRef(!1),h=b.useRef(!1),p=b.useCallback(()=>c.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),l.jsx(Bm,{asChild:!0,...o,children:l.jsx(We.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:d,onPointerMove:Ge(e.onPointerMove,m=>{m.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ge(e.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:Ge(e.onPointerDown,()=>{a.open&&a.onClose(),c.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ge(e.onFocus,()=>{c.current||a.onOpen()}),onBlur:Ge(e.onBlur,a.onClose),onClick:Ge(e.onClick,a.onClose)})})});tB.displayName=_S;var u_="TooltipPortal",[$fe,Bfe]=hg(u_,{forceMount:void 0}),rB=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:a}=e,i=sd(u_,t);return l.jsx($fe,{scope:t,forceMount:r,children:l.jsx(nn,{present:r||i.open,children:l.jsx(Vu,{asChild:!0,container:a,children:n})})})};rB.displayName=u_;var fl="TooltipContent",nB=b.forwardRef((e,t)=>{const r=Bfe(fl,e.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...i}=e,o=sd(fl,e.__scopeTooltip);return l.jsx(nn,{present:n||o.open,children:o.disableHoverableContent?l.jsx(aB,{side:a,...i,ref:t}):l.jsx(Ffe,{side:a,...i,ref:t})})}),Ffe=b.forwardRef((e,t)=>{const r=sd(fl,e.__scopeTooltip),n=c_(fl,e.__scopeTooltip),a=b.useRef(null),i=at(t,a),[o,u]=b.useState(null),{trigger:d,onClose:c}=r,h=a.current,{onPointerInTransitChange:p}=n,m=b.useCallback(()=>{u(null),p(!1)},[p]),v=b.useCallback((x,y)=>{const S=x.currentTarget,_={x:x.clientX,y:x.clientY},N=Vfe(_,S.getBoundingClientRect()),O=Hfe(_,N),A=Wfe(y.getBoundingClientRect()),C=Kfe([...O,...A]);u(C),p(!0)},[p]);return b.useEffect(()=>()=>m(),[m]),b.useEffect(()=>{if(d&&h){const x=S=>v(S,h),y=S=>v(S,d);return d.addEventListener("pointerleave",x),h.addEventListener("pointerleave",y),()=>{d.removeEventListener("pointerleave",x),h.removeEventListener("pointerleave",y)}}},[d,h,v,m]),b.useEffect(()=>{if(o){const x=y=>{const S=y.target,_={x:y.clientX,y:y.clientY},N=d?.contains(S)||h?.contains(S),O=!Gfe(_,o);N?m():O&&(m(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[d,h,o,c,m]),l.jsx(aB,{...e,ref:i})}),[zfe,qfe]=hg(Tu,{isInside:!1}),Ufe=Ife("TooltipContent"),aB=b.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...u}=e,d=sd(fl,r),c=pg(r),{onClose:h}=d;return b.useEffect(()=>(document.addEventListener(jS,h),()=>document.removeEventListener(jS,h)),[h]),b.useEffect(()=>{if(d.trigger){const p=m=>{m.target?.contains(d.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[d.trigger,h]),l.jsx(qu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:l.jsxs(Yj,{"data-state":d.stateAttribute,...c,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[l.jsx(Ufe,{children:n}),l.jsx(zfe,{scope:r,isInside:!0,children:l.jsx(goe,{id:d.contentId,role:"tooltip",children:a||n})})]})})});nB.displayName=fl;var iB="TooltipArrow",oB=b.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,a=pg(r);return qfe(iB,r).isInside?null:l.jsx(Jj,{...a,...n,ref:t})});oB.displayName=iB;function Vfe(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Hfe(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Wfe(e){const{top:t,right:r,bottom:n,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:n},{x:a,y:n}]}function Gfe(e,t){const{x:r,y:n}=e;let a=!1;for(let i=0,o=t.length-1;in!=m>n&&r<(p-c)*(n-h)/(m-h)+c&&(a=!a)}return a}function Kfe(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),Xfe(t)}function Xfe(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const a=e[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))r.pop();else break}r.push(a)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Yfe=Z5,Jfe=eB,Qfe=tB,Zfe=rB,ehe=nB,the=oB;function rhe({delayDuration:e=0,...t}){return l.jsx(Yfe,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function T1({...e}){return l.jsx(rhe,{children:l.jsx(Jfe,{"data-slot":"tooltip",...e})})}function k1({...e}){return l.jsx(Qfe,{"data-slot":"tooltip-trigger",...e})}function R1({className:e,sideOffset:t=0,children:r,...n}){return l.jsx(Zfe,{children:l.jsxs(ehe,{"data-slot":"tooltip-content",sideOffset:t,className:Ae("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[r,l.jsx(the,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Mn(e){const t=(e??"").trim();return t||"N/A"}function nhe(e,t){return e==null||t===null||t===void 0||!Number.isFinite(e)||!Number.isFinite(t)?"N/A":`${e}, ${t}`}function ahe(){const[e,t]=b.useState(!1),[r,n]=b.useState(!1),[a,i]=b.useState(!1),[o,u]=b.useState(null),[d,c]=b.useState(null),[h,p]=b.useState([]),[m,v]=b.useState(!1),[x,y]=b.useState(0),[S,_]=b.useState(0),[N,O]=b.useState(null),[A,C]=b.useState(""),[E,T]=b.useState("all"),[R,L]=b.useState("all"),[z,F]=b.useState("all"),[B,q]=b.useState(1),[H,V]=b.useState(10),G=b.useRef(null),U=b.useRef(null),[$,Q]=b.useState("");b.useEffect(()=>(U.current&&window.clearTimeout(U.current),U.current=window.setTimeout(()=>Q(A.trim()),300),()=>{U.current&&window.clearTimeout(U.current)}),[A]);const k=b.useMemo(()=>{const K=new Set;for(const J of h){const ee=(J.partner??"").trim();ee&&K.add(ee)}return["all",...Array.from(K).sort((J,ee)=>J.localeCompare(ee))]},[h]),I=b.useMemo(()=>{const K=new Set;for(const J of h){const ee=(J.groupName??"").trim();ee&&K.add(ee)}return["all",...Array.from(K).sort((J,ee)=>J.localeCompare(ee))]},[h]),D=b.useMemo(()=>{const K=new Set;for(const J of h){const ee=(J.locationCode??"").trim();ee&&K.add(ee)}return["all",...Array.from(K).sort((J,ee)=>J.localeCompare(ee))]},[h]),Z=Math.max(1,Math.ceil(x/H));b.useEffect(()=>{q(1)},[$,E,R,z,H]),b.useEffect(()=>((async()=>{G.current?.abort();const J=new AbortController;G.current=J,v(!0);try{const ee=Math.max(1,B),pe=await Al({skipCount:ee,maxResultCount:H,keyword:(z!=="all"?z:$)||void 0,partner:E!=="all"?E:void 0,groupName:R!=="all"?R:void 0},J.signal);p(pe.items??[]),y(pe.totalCount??0)}catch(ee){if(ee?.name==="AbortError")return;xe.error("Failed to load locations.",{description:ee?.message?String(ee.message):"Please try again."}),p([]),y(0)}finally{v(!1)}})(),()=>G.current?.abort()),[$,E,R,z,B,H,S]);const ie=()=>_(K=>K+1),oe=K=>{O(null),u(K),n(!0)},ne=K=>{O(null),c(K),i(!0)};return l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsx("div",{className:"pb-4",children:l.jsx("div",{className:"flex flex-col gap-4",children:l.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[l.jsx(me,{placeholder:"Search",value:A,onChange:K=>C(K.target.value),style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),l.jsxs(Ke,{value:E,onValueChange:T,children:[l.jsx(Ye,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Partner"})}),l.jsx(Je,{children:k.map(K=>l.jsx(Ne,{value:K,children:K==="all"?"Partner (All)":K},K))})]}),l.jsxs(Ke,{value:R,onValueChange:L,children:[l.jsx(Ye,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Group"})}),l.jsx(Je,{children:I.map(K=>l.jsx(Ne,{value:K,children:K==="all"?"Group (All)":K},K))})]}),l.jsxs(Ke,{value:z,onValueChange:F,children:[l.jsx(Ye,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:l.jsx(Xe,{placeholder:"Location"})}),l.jsx(Je,{children:D.map(K=>l.jsx(Ne,{value:K,children:K==="all"?"All Locations":K},K))})]}),l.jsx("div",{className:"flex-1"}),l.jsxs(T1,{children:[l.jsx(k1,{asChild:!0,children:l.jsx("span",{children:l.jsx(fe,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Import"})})}),l.jsx(R1,{children:"Not supported yet"})]}),l.jsxs(T1,{children:[l.jsx(k1,{asChild:!0,children:l.jsx("span",{children:l.jsx(fe,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Export"})})}),l.jsx(R1,{children:"Not supported yet"})]}),l.jsxs(T1,{children:[l.jsx(k1,{asChild:!0,children:l.jsx("span",{children:l.jsx(fe,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Edit"})})}),l.jsx(R1,{children:"Not supported yet"})]}),l.jsx(fe,{className:"h-10 bg-blue-600 hover:bg-blue-700 text-white rounded-md px-6 font-medium shrink-0",onClick:()=>t(!0),children:"New"})]})})}),l.jsx("div",{className:"flex-1 overflow-auto pt-6",children:l.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:l.jsxs(Or,{children:[l.jsx(Er,{children:l.jsxs(Be,{className:"bg-gray-100 hover:bg-gray-100",children:[l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Partner"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Group"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Location ID"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Location Name"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Street"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"City"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"State"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Country"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Zip Code"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Phone"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Email"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"GPS"}),l.jsx(ve,{className:"text-gray-900 font-bold border-r",children:"Active"}),l.jsx(ve,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),l.jsx(Pr,{children:m?l.jsx(Be,{children:l.jsx(de,{colSpan:14,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):h.length===0?l.jsx(Be,{children:l.jsx(de,{colSpan:14,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):h.map(K=>l.jsxs(Be,{children:[l.jsx(de,{className:"border-r text-gray-600 max-w-[140px] truncate",children:Mn(K.partner)}),l.jsx(de,{className:"border-r text-gray-600 max-w-[140px] truncate",children:Mn(K.groupName)}),l.jsx(de,{className:"border-r font-numeric text-gray-600",children:Mn(K.locationCode??K.id)}),l.jsx(de,{className:"border-r font-medium text-black",children:Mn(K.locationName)}),l.jsx(de,{className:"border-r text-gray-600 max-w-[140px] truncate",children:Mn(K.street)}),l.jsx(de,{className:"border-r text-gray-600",children:Mn(K.city)}),l.jsx(de,{className:"border-r text-gray-600",children:Mn(K.stateCode)}),l.jsx(de,{className:"border-r text-gray-600",children:Mn(K.country)}),l.jsx(de,{className:"border-r text-gray-600 font-numeric",children:Mn(K.zipCode)}),l.jsx(de,{className:"border-r text-gray-600 whitespace-nowrap",children:Mn(K.phone)}),l.jsx(de,{className:"border-r text-gray-600 text-sm max-w-[180px] truncate",children:Mn(K.email)}),l.jsx(de,{className:"border-r text-gray-500 font-numeric text-xs",children:nhe(K.latitude,K.longitude)}),l.jsx(de,{className:"border-r",children:l.jsx(xr,{className:K.state?"bg-green-600":"bg-gray-400",children:K.state?"Yes":"No"})}),l.jsx(de,{className:"text-center",children:l.jsxs(ma,{open:N===K.id,onOpenChange:J=>O(J?K.id:null),children:[l.jsx(ga,{asChild:!0,children:l.jsx(fe,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:l.jsx(Ei,{className:"h-4 w-4 text-gray-500"})})}),l.jsxs(va,{align:"end",className:"w-40 p-1",children:[l.jsxs(fe,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>oe(K),children:[l.jsx(xn,{className:"w-4 h-4"}),"Edit"]}),l.jsx(fe,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>ne(K),children:"Delete"})]})]})})]},K.id))})]})})}),l.jsx("div",{className:"pt-4",children:l.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[l.jsxs("div",{children:["Showing ",x===0?0:(B-1)*H+1,"-",Math.min(B*H,x)," of ",x]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs(Ke,{value:String(H),onValueChange:K=>V(Number(K)),children:[l.jsx(Ye,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:l.jsx(Xe,{})}),l.jsx(Je,{children:[10,20,50].map(K=>l.jsxs(Ne,{value:String(K),children:[K," / page"]},K))})]}),l.jsx(_i,{className:"mx-0 w-auto justify-end",children:l.jsxs(Ni,{children:[l.jsx(At,{children:l.jsx(Ci,{href:"#",size:"default",onClick:K=>{K.preventDefault(),q(J=>Math.max(1,J-1))},"aria-disabled":B<=1,className:B<=1?"pointer-events-none opacity-50":""})}),l.jsx(At,{children:l.jsxs(ua,{href:"#",isActive:!0,size:"default",onClick:K=>K.preventDefault(),children:["Page ",B," / ",Z]})}),l.jsx(At,{children:l.jsx(Oi,{href:"#",size:"default",onClick:K=>{K.preventDefault(),q(J=>Math.min(Z,J+1))},"aria-disabled":B>=Z,className:B>=Z?"pointer-events-none opacity-50":""})})]})})]})]})}),l.jsx(ihe,{open:e,onOpenChange:t,onCreated:()=>{q(1),ie()}}),l.jsx(she,{open:r,location:o,onOpenChange:K=>{n(K),K||u(null)},onUpdated:()=>{ie()}}),l.jsx(lhe,{open:a,location:d,onOpenChange:K=>{i(K),K||c(null)},onDeleted:()=>{ie()}})]})}function ihe({open:e,onOpenChange:t,onCreated:r}){const[n,a]=b.useState(!1),[i,o]=b.useState({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0}),u=()=>{o({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0})};b.useEffect(()=>{e||(u(),a(!1))},[e]);const d=b.useMemo(()=>i.locationCode.trim().length>0&&i.locationName.trim().length>0,[i.locationCode,i.locationName]),c=async()=>{if(!d){xe.error("Please fill in required fields.",{description:"Location ID and Location Name are required."});return}a(!0);try{await Nce({...i,locationCode:i.locationCode.trim(),locationName:i.locationName.trim(),partner:i.partner?.trim()?i.partner.trim():null,groupName:i.groupName?.trim()?i.groupName.trim():null,street:i.street?.trim()?i.street.trim():null,city:i.city?.trim()?i.city.trim():null,stateCode:i.stateCode?.trim()?i.stateCode.trim():null,country:i.country?.trim()?i.country.trim():null,zipCode:i.zipCode?.trim()?i.zipCode.trim():null,phone:i.phone?.trim()?i.phone.trim():null,email:i.email?.trim()?i.email.trim():null}),xe.success("Location created.",{description:"The location has been added successfully."}),t(!1),r()}catch(h){xe.error("Failed to create location.",{description:h?.message?String(h.message):"Please try again."})}finally{a(!1)}};return l.jsx(mt,{open:e,onOpenChange:t,children:l.jsxs(ft,{className:"sm:max-w-[600px]",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Add New Location"}),l.jsx(Nt,{children:"Enter the details for the new store location."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Partner"}),l.jsx(me,{placeholder:"e.g. Global Foods Inc.",value:i.partner??"",onChange:h=>o(p=>({...p,partner:h.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Group"}),l.jsx(me,{placeholder:"e.g. East Coast Region",value:i.groupName??"",onChange:h=>o(p=>({...p,groupName:h.target.value}))})]})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsxs("div",{className:"space-y-2 col-span-1",children:[l.jsx(ue,{children:"Location ID"}),l.jsx(me,{placeholder:"e.g. 12345",value:i.locationCode,onChange:h=>o(p=>({...p,locationCode:h.target.value}))})]}),l.jsxs("div",{className:"space-y-2 col-span-2",children:[l.jsx(ue,{children:"Location Name"}),l.jsx(me,{placeholder:"e.g. Downtown Store",value:i.locationName,onChange:h=>o(p=>({...p,locationName:h.target.value}))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Street"}),l.jsx(me,{placeholder:"e.g. 123 Main St",value:i.street??"",onChange:h=>o(p=>({...p,street:h.target.value}))})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"City"}),l.jsx(me,{placeholder:"e.g. New York",value:i.city??"",onChange:h=>o(p=>({...p,city:h.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"State"}),l.jsx(me,{placeholder:"e.g. NY",value:i.stateCode??"",onChange:h=>o(p=>({...p,stateCode:h.target.value}))})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Country"}),l.jsx(me,{placeholder:"e.g. USA",value:i.country??"",onChange:h=>o(p=>({...p,country:h.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Zip Code"}),l.jsx(me,{placeholder:"e.g. 10001",value:i.zipCode??"",onChange:h=>o(p=>({...p,zipCode:h.target.value}))})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Phone Number"}),l.jsx(me,{placeholder:"+1 (555) 000-0000",value:i.phone??"",onChange:h=>o(p=>({...p,phone:h.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Email"}),l.jsx(me,{placeholder:"store@example.com",value:i.email??"",onChange:h=>o(p=>({...p,email:h.target.value}))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs(ue,{className:"flex items-center gap-2",children:[l.jsx(hl,{className:"w-4 h-4"})," GPS Coordinates"]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(me,{placeholder:"Latitude (e.g. 40.7128)",value:i.latitude===null||i.latitude===void 0?"":String(i.latitude),onChange:h=>{const p=h.target.value.trim();o(m=>({...m,latitude:p?Number(p):null}))}}),l.jsx(me,{placeholder:"Longitude (e.g. -74.0060)",value:i.longitude===null||i.longitude===void 0?"":String(i.longitude),onChange:h=>{const p=h.target.value.trim();o(m=>({...m,longitude:p?Number(p):null}))}})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[l.jsx(qt,{id:"loc-status",checked:!!i.state,onCheckedChange:h=>o(p=>({...p,state:h}))}),l.jsx(ue,{htmlFor:"loc-status",children:"Active Location"})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),l.jsx(fe,{disabled:n,onClick:c,className:"bg-blue-600 text-white hover:bg-blue-700",children:n?"Creating...":"Create Location"})]})]})})}function ohe(e){return{partner:e.partner??"",groupName:e.groupName??"",locationCode:e.locationCode??"",locationName:e.locationName??"",street:e.street??"",city:e.city??"",stateCode:e.stateCode??"",country:e.country??"",zipCode:e.zipCode??"",phone:e.phone??"",email:e.email??"",latitude:e.latitude??null,longitude:e.longitude??null,state:!!e.state}}function she({open:e,location:t,onOpenChange:r,onUpdated:n}){const[a,i]=b.useState(!1),[o,u]=b.useState({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0});b.useEffect(()=>{e&&t&&(u(ohe(t)),i(!1)),e||i(!1)},[e,t]);const d=b.useMemo(()=>o.locationCode.trim().length>0&&o.locationName.trim().length>0,[o.locationCode,o.locationName]),c=async()=>{if(t?.id){if(!d){xe.error("Please fill in required fields.",{description:"Location ID and Location Name are required."});return}i(!0);try{await Cce(t.id,{...o,locationCode:o.locationCode.trim(),locationName:o.locationName.trim(),partner:o.partner?.trim()?o.partner.trim():null,groupName:o.groupName?.trim()?o.groupName.trim():null,street:o.street?.trim()?o.street.trim():null,city:o.city?.trim()?o.city.trim():null,stateCode:o.stateCode?.trim()?o.stateCode.trim():null,country:o.country?.trim()?o.country.trim():null,zipCode:o.zipCode?.trim()?o.zipCode.trim():null,phone:o.phone?.trim()?o.phone.trim():null,email:o.email?.trim()?o.email.trim():null}),xe.success("Location updated.",{description:"The changes have been saved successfully."}),r(!1),n()}catch(h){xe.error("Failed to update location.",{description:h?.message?String(h.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-[600px]",children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Edit Location"}),l.jsx(Nt,{children:"Update the details for this store location."})]}),l.jsxs("div",{className:"grid gap-4 py-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Partner"}),l.jsx(me,{placeholder:"e.g. Global Foods Inc.",value:o.partner??"",onChange:h=>u(p=>({...p,partner:h.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Group"}),l.jsx(me,{placeholder:"e.g. East Coast Region",value:o.groupName??"",onChange:h=>u(p=>({...p,groupName:h.target.value}))})]})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[l.jsxs("div",{className:"space-y-2 col-span-1",children:[l.jsx(ue,{children:"Location ID"}),l.jsx(me,{placeholder:"e.g. 12345",value:o.locationCode,onChange:h=>u(p=>({...p,locationCode:h.target.value}))})]}),l.jsxs("div",{className:"space-y-2 col-span-2",children:[l.jsx(ue,{children:"Location Name"}),l.jsx(me,{placeholder:"e.g. Downtown Store",value:o.locationName,onChange:h=>u(p=>({...p,locationName:h.target.value}))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Street"}),l.jsx(me,{placeholder:"e.g. 123 Main St",value:o.street??"",onChange:h=>u(p=>({...p,street:h.target.value}))})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"City"}),l.jsx(me,{placeholder:"e.g. New York",value:o.city??"",onChange:h=>u(p=>({...p,city:h.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"State"}),l.jsx(me,{placeholder:"e.g. NY",value:o.stateCode??"",onChange:h=>u(p=>({...p,stateCode:h.target.value}))})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Country"}),l.jsx(me,{placeholder:"e.g. USA",value:o.country??"",onChange:h=>u(p=>({...p,country:h.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Zip Code"}),l.jsx(me,{placeholder:"e.g. 10001",value:o.zipCode??"",onChange:h=>u(p=>({...p,zipCode:h.target.value}))})]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Phone Number"}),l.jsx(me,{placeholder:"+1 (555) 000-0000",value:o.phone??"",onChange:h=>u(p=>({...p,phone:h.target.value}))})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Email"}),l.jsx(me,{placeholder:"store@example.com",value:o.email??"",onChange:h=>u(p=>({...p,email:h.target.value}))})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs(ue,{className:"flex items-center gap-2",children:[l.jsx(hl,{className:"w-4 h-4"})," GPS Coordinates"]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(me,{placeholder:"Latitude (e.g. 40.7128)",value:o.latitude===null||o.latitude===void 0?"":String(o.latitude),onChange:h=>{const p=h.target.value.trim();u(m=>({...m,latitude:p?Number(p):null}))}}),l.jsx(me,{placeholder:"Longitude (e.g. -74.0060)",value:o.longitude===null||o.longitude===void 0?"":String(o.longitude),onChange:h=>{const p=h.target.value.trim();u(m=>({...m,longitude:p?Number(p):null}))}})]})]}),l.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[l.jsx(qt,{id:"loc-status-edit",checked:!!o.state,onCheckedChange:h=>u(p=>({...p,state:h}))}),l.jsx(ue,{htmlFor:"loc-status-edit",children:"Active Location"})]})]}),l.jsxs(xt,{children:[l.jsx(fe,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{disabled:a,onClick:c,className:"bg-blue-600 text-white hover:bg-blue-700",children:a?"Saving...":"Save Changes"})]})]})})}function lhe({open:e,location:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>{const d=(t?.locationCode??"").trim(),c=(t?.locationName??"").trim();return d&&c?`${d} - ${c}`:d||c||"this location"},[t?.locationCode,t?.locationName]),u=async()=>{if(t?.id){i(!0);try{await Oce(t.id),xe.success("Location deleted.",{description:"The location has been removed successfully."}),r(!1),n()}catch(d){xe.error("Failed to delete location.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-none",style:{width:"30%"},children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Delete Location"}),l.jsx(Nt,{children:"This action cannot be undone."})]}),l.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",l.jsx("span",{className:"font-medium",children:o}),"?"]}),l.jsxs(xt,{className:"flex-row flex-wrap justify-end",children:[l.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function che({className:e,...t}){return l.jsx("textarea",{"data-slot":"textarea",className:Ae("resize-none border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-input-background px-3 py-2 text-base transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const WI={Settings:Ah,LayoutDashboard:rM,Tag:Th,MapPin:hl,Users:OS,Package:Vc,FileText:Ds,HelpCircle:Ph,Layers:tM,Type:aM,FileBox:eM};function I1(e){const t=(e??"").trim();return t||"N/A"}function uhe(e){const t=e.trim();if(!t)return null;const r=Number.parseInt(t,10);return Number.isFinite(r)?r:null}function dhe(){const[e,t]=b.useState([]),[r,n]=b.useState(!1),[a,i]=b.useState(0),[o,u]=b.useState(null),[d,c]=b.useState(""),h=b.useRef(null),[p,m]=b.useState(""),[v,x]=b.useState(!1),[y,S]=b.useState(!1),[_,N]=b.useState(!1),[O,A]=b.useState(null),[C,E]=b.useState(null),T=b.useRef(null);b.useEffect(()=>(h.current&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>m(d.trim()),300),()=>{h.current&&window.clearTimeout(h.current)}),[d]),b.useEffect(()=>((async()=>{T.current?.abort();const B=new AbortController;T.current=B,n(!0);try{const q=await W5({skipCount:1,maxResultCount:5e3,keyword:p||void 0},B.signal);t(q.items??[])}catch(q){if(q?.name==="AbortError")return;xe.error("Failed to load system menus.",{description:q?.message?String(q.message):"Please try again."}),t([])}finally{n(!1)}})(),()=>T.current?.abort()),[p,a]);const R=()=>i(F=>F+1),L=F=>{u(null),A(F),S(!0)},z=F=>{u(null),E(F),N(!0)};return l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsx("div",{className:"pb-4",children:l.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[l.jsx(me,{placeholder:"Search",value:d,onChange:F=>c(F.target.value),style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),l.jsx("div",{className:"flex-1"}),l.jsxs(fe,{className:"bg-blue-600 text-white hover:bg-blue-700",onClick:()=>x(!0),children:[l.jsx(wn,{className:"w-4 h-4 mr-2"}),"New Menu"]})]})}),l.jsx("div",{className:"flex-1 flex flex-col min-h-0 bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden",children:l.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:l.jsxs(Or,{children:[l.jsx(Er,{className:"bg-gray-50 sticky top-0 z-10",children:l.jsxs(Be,{className:"hover:bg-gray-50",children:[l.jsx(ve,{className:"font-semibold text-gray-900",children:"Menu Name"}),l.jsx(ve,{className:"font-semibold text-gray-900",children:"Route URL"}),l.jsx(ve,{className:"font-semibold text-gray-900",children:"Router Name"}),l.jsx(ve,{className:"font-semibold text-gray-900",children:"Type"}),l.jsx(ve,{className:"font-semibold text-gray-900",children:"Order"}),l.jsx(ve,{className:"font-semibold text-gray-900",children:"Visible"}),l.jsx(ve,{className:"font-semibold text-gray-900",children:"Enabled"}),l.jsx(ve,{className:"font-semibold text-gray-900 w-16 text-right",children:"Actions"})]})}),l.jsx(Pr,{children:e.length===0?l.jsx(Be,{children:l.jsx(de,{colSpan:8,className:"text-center py-10 text-gray-500",children:r?"Loading...":"No data"})}):e.map(F=>l.jsxs(Be,{className:"hover:bg-gray-50",children:[l.jsx(de,{className:"font-medium text-gray-900",children:I1(F.menuName)}),l.jsx(de,{className:"text-gray-700",children:I1(F.routeUrl)}),l.jsx(de,{className:"text-gray-700",children:I1(F.routerName)}),l.jsx(de,{className:"text-gray-700",children:F.menuType??"N/A"}),l.jsx(de,{className:"text-gray-700",children:F.orderNum??"N/A"}),l.jsx(de,{className:"text-gray-700",children:F.isShow?"Yes":"No"}),l.jsx(de,{className:"text-gray-700",children:F.state?"Yes":"No"}),l.jsx(de,{className:"text-right",children:l.jsxs(ma,{open:o===F.id,onOpenChange:B=>u(B?F.id:null),children:[l.jsx(ga,{asChild:!0,children:l.jsx(fe,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:l.jsx(Ei,{className:"h-4 w-4"})})}),l.jsx(va,{className:"w-44 p-2",align:"end",children:l.jsxs("div",{className:"flex flex-col",children:[l.jsxs(fe,{variant:"ghost",className:"justify-start",onClick:()=>L(F),children:[l.jsx(xn,{className:"w-4 h-4 mr-2"}),"Edit"]}),l.jsxs(fe,{variant:"ghost",className:"justify-start text-red-600 hover:text-red-700",onClick:()=>z(F),children:[l.jsx(Hc,{className:"w-4 h-4 mr-2"}),"Delete"]})]})})]})})]},F.id))})]})})}),l.jsx(GI,{mode:"create",open:v,menu:null,onOpenChange:x,onSaved:R}),l.jsx(GI,{mode:"edit",open:y,menu:O,onOpenChange:S,onSaved:R}),l.jsx(fhe,{open:_,menu:C,onOpenChange:N,onDeleted:R})]})}function GI({mode:e,open:t,menu:r,onOpenChange:n,onSaved:a}){const i=e==="edit",[o,u]=b.useState(!1),[d,c]=b.useState(""),[h,p]=b.useState(""),[m,v]=b.useState(""),[x,y]=b.useState("menu"),[S,_]=b.useState(""),[N,O]=b.useState(""),[A,C]=b.useState([]),[E,T]=b.useState(!1),[R,L]=b.useState(""),[z,F]=b.useState(""),[B,q]=b.useState(""),[H,V]=b.useState(""),[G,U]=b.useState(""),[$,Q]=b.useState(""),[k,I]=b.useState(!1),[D,Z]=b.useState(!0),[ie,oe]=b.useState(!0);b.useEffect(()=>{if(!t)return;u(!1),c(r?.menuName??""),p(r?.routerName??""),v(r?.routeUrl??""),y(r?.menuType===0?"directory":"menu"),_(r?.permissionCode??"");const W=String(r?.parentId??"").trim();O(!W||W==="00000000-0000-0000-0000-000000000000"?"":W),L(r?.menuIcon??""),F(r?.orderNum===null||r?.orderNum===void 0?"":String(r.orderNum)),q(r?.link??""),V(r?.component??""),U(r?.query??""),Q(r?.remark??""),I(!!r?.isCache),Z(r?.isShow??!0),oe(r?.state??!0)},[t,r]);const ne="__parent_root__";b.useEffect(()=>{if(!t)return;let W=!1;return T(!0),Yde().then(_e=>{W||C(_e)}).catch(()=>{W||C([])}).finally(()=>{W||T(!1)}),()=>{W=!0}},[t]);const K=W=>!W.trim()||W==="00000000-0000-0000-0000-000000000000",J=b.useMemo(()=>{const W=A.filter(Ce=>Ce.id&&Ce.id!==r?.id),_e=(N||"").trim();return _e&&!K(_e)&&!W.some(Ce=>Ce.id===_e)?[...W,{id:_e,menuName:`(Current parent) ${_e}`}]:W},[A,N,r?.id]),ee=K(N)?ne:N,ce=b.useMemo(()=>!!(d.trim()&&m.trim()),[d,m]),pe=async()=>{if(!ce){xe.error("Please fill in required fields.",{description:"Menu Name and Route URL are required."});return}u(!0);try{const W={menuName:d.trim(),routerName:h.trim()?h.trim():null,routeUrl:m.trim(),menuType:x==="directory"?0:1,permissionCode:S.trim()?S.trim():null,parentId:K(N)?null:N.trim(),menuIcon:R||null,orderNum:uhe(z),link:B.trim()?B.trim():null,component:H.trim()?H.trim():null,query:G.trim()?G.trim():null,remark:$.trim()?$.trim():null,isCache:k,isShow:D,state:ie};if(i){if(!r?.id)throw new Error("Missing id.");await Qde(r.id,W),xe.success("Menu updated.",{description:"Changes have been saved successfully."})}else await Jde(W),xe.success("Menu created.",{description:"A new menu has been created successfully."});n(!1),a()}catch(W){xe.error(i?"Failed to update menu.":"Failed to create menu.",{description:W?.message?String(W.message):"Please try again."})}finally{u(!1)}};return l.jsx(mt,{open:t,onOpenChange:n,children:l.jsxs(ft,{className:"sm:max-w-none",style:{width:"70%"},children:[l.jsxs(gt,{children:[l.jsx(vt,{children:i?"Edit System Menu":"New System Menu"}),l.jsx(Nt,{children:i?"Update system menu fields and save changes.":"Fill out the form to create a new system menu."})]}),l.jsxs("div",{className:"grid grid-cols-3 gap-6 py-2",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Menu Name *"}),l.jsx(me,{value:d,onChange:W=>c(W.target.value),placeholder:"e.g. Location Manager"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Route URL *"}),l.jsx(me,{value:m,onChange:W=>v(W.target.value),placeholder:"e.g. /location"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Router Name"}),l.jsx(me,{value:h,onChange:W=>p(W.target.value),placeholder:"e.g. location"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Menu Type"}),l.jsxs(Ke,{value:x,onValueChange:W=>y(W),children:[l.jsx(Ye,{className:"h-10 rounded-md border border-gray-200 bg-white",children:l.jsx(Xe,{})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"directory",children:"Directory"}),l.jsx(Ne,{value:"menu",children:"Menu"})]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Permission Code"}),l.jsx(me,{value:S,onChange:W=>_(W.target.value),placeholder:"e.g. sys:menu"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Parent"}),l.jsxs(Ke,{value:ee,disabled:E,onValueChange:W=>O(W===ne?"":W),children:[l.jsx(Ye,{className:"h-10 rounded-md border border-gray-200 bg-white",children:l.jsx(Xe,{placeholder:E?"Loading…":"Select parent directory"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:ne,children:"Root (no parent)"}),J.map(W=>l.jsx(Ne,{value:W.id,children:W.menuName?.trim()||W.id},W.id))]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Menu Icon"}),l.jsxs(Ke,{value:R||"none",onValueChange:W=>L(W==="none"?"":W),children:[l.jsx(Ye,{className:"h-10 rounded-md border border-gray-200 bg-white",children:l.jsx(Xe,{placeholder:"Select an icon"})}),l.jsxs(Je,{children:[l.jsx(Ne,{value:"none",children:"None"}),Object.keys(WI).map(W=>{const _e=WI[W];return l.jsx(Ne,{value:W,children:l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx(_e,{className:"h-4 w-4"}),W]})},W)})]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Order"}),l.jsx(me,{value:z,onChange:W=>F(W.target.value),placeholder:"e.g. 10"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Link"}),l.jsx(me,{value:B,onChange:W=>q(W.target.value),placeholder:"Optional"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Component"}),l.jsx(me,{value:H,onChange:W=>V(W.target.value),placeholder:"Optional"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Query"}),l.jsx(me,{value:G,onChange:W=>U(W.target.value),placeholder:"Optional"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(ue,{children:"Remark"}),l.jsx(che,{value:$,onChange:W=>Q(W.target.value),placeholder:"Optional"})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Cache"}),l.jsx(qt,{checked:k,onCheckedChange:I})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Visible"}),l.jsx(qt,{checked:D,onCheckedChange:Z})]}),l.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[l.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),l.jsx(qt,{checked:ie,onCheckedChange:oe})]})]}),l.jsxs(xt,{className:"flex-row flex-wrap justify-end",children:[l.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),l.jsx(fe,{className:"min-w-24 bg-blue-600 text-white hover:bg-blue-700",disabled:o,onClick:pe,children:o?"Saving...":i?"Save Changes":"Create"})]})]})})}function fhe({open:e,menu:t,onOpenChange:r,onDeleted:n}){const[a,i]=b.useState(!1),o=b.useMemo(()=>{const d=(t?.menuName??"").trim(),c=(t?.routeUrl??"").trim();return d&&c?`${d} (${c})`:d||c||"this menu"},[t?.menuName,t?.routeUrl]),u=async()=>{if(t?.id){i(!0);try{await efe(t.id),xe.success("Menu deleted.",{description:"The menu has been removed successfully."}),r(!1),n()}catch(d){xe.error("Failed to delete menu.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}}};return l.jsx(mt,{open:e,onOpenChange:r,children:l.jsxs(ft,{className:"sm:max-w-none",style:{width:"30%"},children:[l.jsxs(gt,{children:[l.jsx(vt,{children:"Delete System Menu"}),l.jsx(Nt,{children:"This action cannot be undone."})]}),l.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",l.jsx("span",{className:"font-medium",children:o}),"?"]}),l.jsxs(xt,{className:"flex-row flex-wrap justify-end",children:[l.jsx(fe,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),l.jsx(fe,{className:"min-w-24",variant:"destructive",disabled:a,onClick:u,children:a?"Deleting...":"Delete"})]})]})})}function hhe(){const[e,t]=b.useState("Dashboard"),r=()=>{switch(e){case"Dashboard":return l.jsx(mae,{});case"Training":return l.jsx(Rde,{});case"Alerts":return l.jsx(Dde,{});case"Menu Management":return l.jsx(qde,{});case"System Menu":return l.jsx(dhe,{});case"Account Management":return l.jsx(wfe,{});case"Reports":return l.jsx(kfe,{});case"Location Manager":return l.jsx(ahe,{});case"Labels":case"Label Categories":case"Label Types":case"Label Templates":case"Multiple Options":return l.jsx(kde,{currentView:e,onViewChange:t});default:return l.jsx(gae,{title:e})}};return l.jsx(Eq,{currentView:e,setCurrentView:t,children:r()})}cz.createRoot(document.getElementById("root")).render(l.jsx(hhe,{})); diff --git a/美国版/Food Labeling Management Platform/build/index.html b/美国版/Food Labeling Management Platform/build/index.html index 1a006c1..8104607 100644 --- a/美国版/Food Labeling Management Platform/build/index.html +++ b/美国版/Food Labeling Management Platform/build/index.html @@ -5,8 +5,8 @@ Food Labeling Management Platform - - + + diff --git a/美国版/Food Labeling Management Platform/src/App.tsx b/美国版/Food Labeling Management Platform/src/App.tsx index b02f655..66caaf9 100755 --- a/美国版/Food Labeling Management Platform/src/App.tsx +++ b/美国版/Food Labeling Management Platform/src/App.tsx @@ -1,4 +1,5 @@ import { useState } from 'react'; +import { Toaster } from 'sonner'; import { Layout } from './components/layout/Layout'; import { Dashboard } from './components/dashboard/Dashboard'; import { PlaceholderView } from './components/PlaceholderView'; @@ -46,8 +47,11 @@ export default function App() { }; return ( - - {renderView()} - + <> + + {renderView()} + + + ); } diff --git a/美国版/Food Labeling Management Platform/src/components/labels/LabelCategoriesView.tsx b/美国版/Food Labeling Management Platform/src/components/labels/LabelCategoriesView.tsx index d1a0faf..b4ccda1 100755 --- a/美国版/Food Labeling Management Platform/src/components/labels/LabelCategoriesView.tsx +++ b/美国版/Food Labeling Management Platform/src/components/labels/LabelCategoriesView.tsx @@ -398,6 +398,10 @@ function CreateLabelCategoryDialog({ }); return; } + if (form.orderNum === null || form.orderNum === undefined || !Number.isFinite(form.orderNum)) { + toast.error("Validation failed", { description: "Order is required." }); + return; + } setSubmitting(true); try { @@ -457,7 +461,7 @@ function CreateLabelCategoryDialog({
- +
- + 0) { + const answers = selected.join(', '); + const line = prefix ? `${prefix}${answers}` : answers; + return ( +
+ {line} +
+ ); + } + const placeholder = text || '…'; return ( -
- {text || '请选择...'} - +
+ {placeholder}
); } diff --git a/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/PropertiesPanel.tsx b/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/PropertiesPanel.tsx index 05f660c..860651e 100644 --- a/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/PropertiesPanel.tsx +++ b/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/PropertiesPanel.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { ScrollArea } from '../../ui/scroll-area'; import { Input } from '../../ui/input'; import { Button } from '../../ui/button'; @@ -21,6 +21,8 @@ import type { AppliedLocation, } from '../../../types/labelTemplate'; import type { LocationDto } from '../../../types/location'; +import type { LabelMultipleOptionDto } from '../../../types/labelMultipleOption'; +import { getLabelMultipleOptions } from '../../../services/labelMultipleOptionService'; import { Checkbox } from '../../ui/checkbox'; interface PropertiesPanelProps { @@ -319,6 +321,166 @@ export function PropertiesPanel({ ); } +const MULTIPLE_OPTION_NONE = '__none__'; + +/** 绑定「Multiple Options」页维护的字典:先选字典,再在该字典的值列表中多选 */ +function MultipleOptionsDictionaryFields({ + cfg, + onPatch, +}: { + cfg: Record; + onPatch: (patch: Record) => void; +}) { + const [rows, setRows] = useState([]); + const [loading, setLoading] = useState(false); + + useEffect(() => { + let cancelled = false; + setLoading(true); + getLabelMultipleOptions({ skipCount: 0, maxResultCount: 500 }) + .then((res) => { + if (!cancelled) setRows(res.items ?? []); + }) + .catch(() => { + if (!cancelled) setRows([]); + }) + .finally(() => { + if (!cancelled) setLoading(false); + }); + return () => { + cancelled = true; + }; + }, []); + + const selectedId = ((cfg.multipleOptionId as string) ?? '').trim(); + const selectedVals = Array.isArray(cfg.selectedOptionValues) + ? (cfg.selectedOptionValues as string[]) + : []; + const active = rows.find((r) => r.id === selectedId); + const valueList = active?.optionValuesJson ?? []; + + const selectValue = selectedId ? selectedId : MULTIPLE_OPTION_NONE; + + return ( + <> +
+ + +

+ Data comes from the Multiple Options tab (label-multiple-option list). +

+
+ {active && valueList.length > 0 ? ( +
+ +
+ {valueList.map((val) => ( +
+ { + const set = new Set(selectedVals); + if (checked) set.add(val); + else set.delete(val); + onPatch({ selectedOptionValues: Array.from(set) }); + }} + /> + + {val} + +
+ ))} +
+
+ ) : selectedId ? ( +

No values in this dictionary or still loading.

+ ) : null} + + ); +} + +function TextStaticStyleFields({ + cfg, + update, + textAlignDefault, +}: { + cfg: Record; + update: (key: string, value: unknown) => void; + textAlignDefault: string; +}) { + return ( + <> +
+ + update('text', e.target.value)} + className="h-8 text-sm mt-1" + /> +
+
+ + update('prefix', e.target.value)} + className="h-8 text-sm mt-1" + /> +
+
+ + update('fontSize', Number(e.target.value) || 14)} + className="h-8 text-sm mt-1" + /> +
+
+ + +
+ + ); +} + function ElementConfigFields({ element, onChange, @@ -332,53 +494,18 @@ function ElementConfigFields({ switch (element.type) { case 'TEXT_STATIC': + if (cfg.inputType === 'options') { + return ( + <> + + + + ); + } + return ; case 'TEXT_PRODUCT': case 'TEXT_PRICE': - return ( - <> -
- - update('text', e.target.value)} - className="h-8 text-sm mt-1" - /> -
-
- - update('prefix', e.target.value)} - className="h-8 text-sm mt-1" - /> -
-
- - update('fontSize', Number(e.target.value) || 14)} - className="h-8 text-sm mt-1" - /> -
-
- - -
- - ); + return ; case 'BARCODE': return ( <> diff --git a/美国版/Food Labeling Management Platform/src/components/labels/LabelTypesView.tsx b/美国版/Food Labeling Management Platform/src/components/labels/LabelTypesView.tsx index 4150fb8..10b0028 100755 --- a/美国版/Food Labeling Management Platform/src/components/labels/LabelTypesView.tsx +++ b/美国版/Food Labeling Management Platform/src/components/labels/LabelTypesView.tsx @@ -393,6 +393,10 @@ function CreateLabelTypeDialog({ }); return; } + if (form.orderNum === null || form.orderNum === undefined || !Number.isFinite(form.orderNum)) { + toast.error("Validation failed", { description: "Order is required." }); + return; + } setSubmitting(true); try { @@ -443,7 +447,7 @@ function CreateLabelTypeDialog({
- +
- +
- +
- + { - return form.locationCode.trim().length > 0 && form.locationName.trim().length > 0; - }, [form.locationCode, form.locationName]); - const submit = async () => { - if (!canSubmit) { + const errs = getLocationRedBoxValidationErrors(form); + if (errs.length) { toast.error("Please fill in required fields.", { - description: "Location ID and Location Name are required.", + description: `Missing: ${errs.join(", ")}.`, }); return; } @@ -539,13 +559,15 @@ function CreateLocationDialog({ locationName: form.locationName.trim(), partner: form.partner?.trim() ? form.partner.trim() : null, groupName: form.groupName?.trim() ? form.groupName.trim() : null, - street: form.street?.trim() ? form.street.trim() : null, - city: form.city?.trim() ? form.city.trim() : null, - stateCode: form.stateCode?.trim() ? form.stateCode.trim() : null, - country: form.country?.trim() ? form.country.trim() : null, - zipCode: form.zipCode?.trim() ? form.zipCode.trim() : null, - phone: form.phone?.trim() ? form.phone.trim() : null, - email: form.email?.trim() ? form.email.trim() : null, + street: (form.street ?? "").trim(), + city: (form.city ?? "").trim(), + stateCode: (form.stateCode ?? "").trim(), + country: (form.country ?? "").trim(), + zipCode: (form.zipCode ?? "").trim(), + phone: (form.phone ?? "").trim(), + email: (form.email ?? "").trim(), + latitude: form.latitude!, + longitude: form.longitude!, }); toast.success("Location created.", { description: "The location has been added successfully.", @@ -593,7 +615,7 @@ function CreateLocationDialog({
- +
- +
- +
- +
- +
- +
- +
- +
- +
{ - return form.locationCode.trim().length > 0 && form.locationName.trim().length > 0; - }, [form.locationCode, form.locationName]); - const submit = async () => { if (!location?.id) return; - if (!canSubmit) { + const errs = getLocationRedBoxValidationErrors(form); + if (errs.length) { toast.error("Please fill in required fields.", { - description: "Location ID and Location Name are required.", + description: `Missing: ${errs.join(", ")}.`, }); return; } @@ -803,13 +822,15 @@ function EditLocationDialog({ locationName: form.locationName.trim(), partner: form.partner?.trim() ? form.partner.trim() : null, groupName: form.groupName?.trim() ? form.groupName.trim() : null, - street: form.street?.trim() ? form.street.trim() : null, - city: form.city?.trim() ? form.city.trim() : null, - stateCode: form.stateCode?.trim() ? form.stateCode.trim() : null, - country: form.country?.trim() ? form.country.trim() : null, - zipCode: form.zipCode?.trim() ? form.zipCode.trim() : null, - phone: form.phone?.trim() ? form.phone.trim() : null, - email: form.email?.trim() ? form.email.trim() : null, + street: (form.street ?? "").trim(), + city: (form.city ?? "").trim(), + stateCode: (form.stateCode ?? "").trim(), + country: (form.country ?? "").trim(), + zipCode: (form.zipCode ?? "").trim(), + phone: (form.phone ?? "").trim(), + email: (form.email ?? "").trim(), + latitude: form.latitude!, + longitude: form.longitude!, }); toast.success("Location updated.", { @@ -858,7 +879,7 @@ function EditLocationDialog({
- +
- +
- +
- +
- +
- +
- +
- +
- +
{ - return Boolean(name.trim() && path.trim()); - }, [name, path]); + return Boolean(name.trim() && path.trim() && order.trim()); + }, [name, path, order]); const submit = async () => { if (!canSubmit) { toast.error("Please fill in required fields.", { - description: "Name and Path are required.", + description: "Name, Path, and Order are required.", }); return; } @@ -412,7 +412,7 @@ function CreateOrEditMenuDialog({
- + setOrder(e.target.value)} placeholder="e.g. 10" />
diff --git a/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx b/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx index c2ee1eb..c92dcca 100755 --- a/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx +++ b/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx @@ -816,8 +816,8 @@ function RoleDialog({ }, [open, role]); const canSubmit = useMemo(() => { - return Boolean(roleName.trim() && roleCode.trim()); - }, [roleName, roleCode]); + return Boolean(roleName.trim() && roleCode.trim() && orderNum.trim()); + }, [roleName, roleCode, orderNum]); const toIntOrNullLocal = (v: string): number | null => { const s = v.trim(); @@ -830,7 +830,7 @@ function RoleDialog({ console.log("submit", role); if (!canSubmit) { toast.error("Please fill in required fields.", { - description: "Role Name and Role Code are required.", + description: "Role Name, Role Code, and Order are required.", }); return; } @@ -888,7 +888,7 @@ function RoleDialog({
- + setOrderNum(e.target.value)} placeholder="e.g. 10" />
@@ -1493,11 +1493,13 @@ function MemberDialog({ const canSubmit = useMemo(() => { if (!fullName.trim()) return false; if (!userName.trim()) return false; + if (!email.trim()) return false; + if (!String(phone ?? "").trim()) return false; if (!roleId.trim()) return false; if (selectedLocationIds.size === 0) return false; if (!isEdit && !password.trim()) return false; return true; - }, [fullName, userName, roleId, selectedLocationIds, isEdit, password]); + }, [fullName, userName, email, phone, roleId, selectedLocationIds, isEdit, password]); const toggleLocation = (id: string, checked: boolean) => { setSelectedLocationIds((prev) => { @@ -1519,11 +1521,13 @@ function MemberDialog({ const missing: string[] = []; if (!fullName.trim()) missing.push("Full Name"); if (!userName.trim()) missing.push("User Name"); + if (!email.trim()) missing.push("Email"); + if (!String(phone ?? "").trim()) missing.push("Phone"); if (!roleId.trim()) missing.push("Role"); if (selectedLocationIds.size === 0) missing.push("Locations"); if (!isEdit && !password.trim()) missing.push("Password"); toast.error("Missing required fields.", { - description: `Please fill: ${missing.join("、")}.`, + description: `Please fill: ${missing.join(", ")}.`, }); return; } @@ -1538,8 +1542,8 @@ function MemberDialog({ fullName: fullName.trim(), userName: userName.trim(), password: password.trim(), - email: email.trim() ? email.trim() : null, - phone: phone != null && String(phone).trim() ? String(phone).trim() : null, + email: email.trim(), + phone: String(phone).trim(), roleId: roleId.trim(), locationIds, state, @@ -1565,8 +1569,8 @@ function MemberDialog({ fullName: fullName.trim(), userName: userName.trim(), password: password.trim() ? password.trim() : null, - email: email.trim() ? email.trim() : null, - phone: phone != null && String(phone).trim() ? String(phone).trim() : null, + email: email.trim(), + phone: String(phone).trim(), roleId: roleId.trim(), locationIds, state, @@ -1652,12 +1656,12 @@ function MemberDialog({
- - setEmail(e.target.value)} placeholder="john@example.com" /> + + setEmail(e.target.value)} placeholder="john@example.com" />
- - setPhone(e.target.value)} placeholder="+1 (555) 000-0000" /> + + setPhone(e.target.value)} placeholder="+1 (555) 000-0000" />
diff --git a/美国版/Food Labeling Management Platform/src/components/system-menu/SystemMenuView.tsx b/美国版/Food Labeling Management Platform/src/components/system-menu/SystemMenuView.tsx index 6a6389f..ff20b51 100644 --- a/美国版/Food Labeling Management Platform/src/components/system-menu/SystemMenuView.tsx +++ b/美国版/Food Labeling Management Platform/src/components/system-menu/SystemMenuView.tsx @@ -379,13 +379,13 @@ function SystemMenuDialog({ const parentSelectValue = isRootParentId(parentId) ? PARENT_ROOT : parentId; const canSubmit = useMemo(() => { - return Boolean(menuName.trim() && routeUrl.trim()); - }, [menuName, routeUrl]); + return Boolean(menuName.trim() && routeUrl.trim() && orderNum.trim()); + }, [menuName, routeUrl, orderNum]); const submit = async () => { if (!canSubmit) { toast.error("Please fill in required fields.", { - description: "Menu Name and Route URL are required.", + description: "Menu Name, Route URL, and Order are required.", }); return; } @@ -515,7 +515,7 @@ function SystemMenuDialog({
- + setOrderNum(e.target.value)} placeholder="e.g. 10" />
diff --git a/美国版/Food Labeling Management Platform/src/index.css b/美国版/Food Labeling Management Platform/src/index.css index d2aef22..91e2b21 100755 --- a/美国版/Food Labeling Management Platform/src/index.css +++ b/美国版/Food Labeling Management Platform/src/index.css @@ -3491,3 +3491,8 @@ html { transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0)); } } + +/* Sonner: above Radix Dialog (z-50) so validation toasts are visible */ +[data-sonner-toaster] { + z-index: 10000 !important; +}