randmarcomps 1.319.0 → 1.320.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/randmarcomps.d.ts +1 -1
- package/dist/randmarcomps.js +15 -10
- package/dist/randmarcomps.umd.cjs +3 -3
- package/package.json +1 -1
package/dist/randmarcomps.d.ts
CHANGED
|
@@ -748,7 +748,7 @@ declare interface SeriesConfig {
|
|
|
748
748
|
/** The Y-axis this series should be plotted against. Defaults to 'left'. */
|
|
749
749
|
yAxisId?: "left" | "right";
|
|
750
750
|
/** The format to display for this series' values. */
|
|
751
|
-
format?: "money" | null;
|
|
751
|
+
format?: "money" | "integer" | null;
|
|
752
752
|
}
|
|
753
753
|
|
|
754
754
|
export declare const Sheet: React_2.FC<DialogPrimitive.DialogProps>;
|
package/dist/randmarcomps.js
CHANGED
|
@@ -3959,12 +3959,17 @@ const fromTheme = (t) => {
|
|
|
3959
3959
|
function cn(...t) {
|
|
3960
3960
|
return twMerge(clsx(t));
|
|
3961
3961
|
}
|
|
3962
|
-
const formatNumber = (t) => new Intl.NumberFormat("en-CA").format(t), formatMoney = (t, e
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3962
|
+
const formatNumber = (t, e) => new Intl.NumberFormat("en-CA", e).format(t), formatMoney = (t, e) => {
|
|
3963
|
+
const n = {
|
|
3964
|
+
style: "currency",
|
|
3965
|
+
currency: "CAD",
|
|
3966
|
+
minimumFractionDigits: 2,
|
|
3967
|
+
maximumFractionDigits: 2,
|
|
3968
|
+
...e
|
|
3969
|
+
// User-provided options will override the defaults
|
|
3970
|
+
};
|
|
3971
|
+
return new Intl.NumberFormat("en-CA", n).format(t);
|
|
3972
|
+
}, formatYYYYMMDDIntToDateString = (t) => {
|
|
3968
3973
|
if (t === null || typeof t > "u")
|
|
3969
3974
|
return "—";
|
|
3970
3975
|
const e = t.toString();
|
|
@@ -35572,7 +35577,7 @@ function ChartTooltipContent({ active: t, payload: e, label: n, series: o }) {
|
|
|
35572
35577
|
return null;
|
|
35573
35578
|
const f = l.get(d.dataKey);
|
|
35574
35579
|
if (!f) return null;
|
|
35575
|
-
const g = f.format === "money" ? formatMoney(d.value) : f.unitsPosition === "left" ? `${f.units || ""}${d.value}` : `${d.value}${f.units ? ` ${f.units}` : ""}`;
|
|
35580
|
+
const g = f.format === "money" && typeof d.value == "number" ? formatMoney(d.value) : f.format === "integer" && typeof d.value == "number" ? formatNumber(d.value, { maximumFractionDigits: 2 }) : f.unitsPosition === "left" ? `${f.units || ""}${d.value}` : `${d.value}${f.units ? ` ${f.units}` : ""}`;
|
|
35576
35581
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
35577
35582
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
35578
35583
|
/* @__PURE__ */ jsx("span", { className: "mr-2 h-2.5 w-2.5 rounded-full", style: { backgroundColor: f.color ?? "#000" } }),
|
|
@@ -35596,10 +35601,10 @@ function AreaChart({
|
|
|
35596
35601
|
return /* @__PURE__ */ jsx("div", { className: cn("flex items-center justify-center text-muted-foreground", o), style: l === "default" ? { height: n } : {}, children: "No data available" });
|
|
35597
35602
|
const d = Object.keys(t[0])[0], f = l === "mini", g = e.filter((C) => C.yAxisId === "left" || !C.yAxisId), b = e.filter((C) => C.yAxisId === "right"), S = (C) => {
|
|
35598
35603
|
const E = g[0];
|
|
35599
|
-
return (E == null ? void 0 : E.format) === "money" ? formatMoney(C, 0) : E != null && E.units ? E.unitsPosition === "left" ? `${E.units}${C}` : `${C}${E.units}` : String(C);
|
|
35604
|
+
return (E == null ? void 0 : E.format) === "money" ? formatMoney(C, { minimumFractionDigits: 0, maximumFractionDigits: 0 }) : E != null && E.units ? E.unitsPosition === "left" ? `${E.units}${C}` : `${C}${E.units}` : String(C);
|
|
35600
35605
|
}, _ = (C) => {
|
|
35601
35606
|
const E = b[0];
|
|
35602
|
-
return E != null && E.units ? E.unitsPosition === "left" ? `${E.units}${C}` : `${C}${E.units}` : String(C);
|
|
35607
|
+
return (E == null ? void 0 : E.format) === "money" ? formatMoney(C, { minimumFractionDigits: 0, maximumFractionDigits: 0 }) : E != null && E.units ? E.unitsPosition === "left" ? `${E.units}${C}` : `${C}${E.units}` : String(C);
|
|
35603
35608
|
};
|
|
35604
35609
|
return /* @__PURE__ */ jsx(
|
|
35605
35610
|
"div",
|
|
@@ -64775,7 +64780,7 @@ function SalesChart({
|
|
|
64775
64780
|
}) {
|
|
64776
64781
|
const [d, f] = useState([]), [g, b] = useState(!1), S = [
|
|
64777
64782
|
{ name: "dollarVolume", label: "Dollar Volume", color: "var(--primary)", yAxisId: "left", format: "money" },
|
|
64778
|
-
{ name: "unitsSold", label: "Units Sold", color: "#888", units: " units", yAxisId: "right" }
|
|
64783
|
+
{ name: "unitsSold", label: "Units Sold", color: "#888", units: " units", yAxisId: "right", format: "integer" }
|
|
64779
64784
|
];
|
|
64780
64785
|
return useEffect(() => {
|
|
64781
64786
|
if (o || !t) {
|
|
@@ -422,7 +422,7 @@
|
|
|
422
422
|
*
|
|
423
423
|
* This source code is licensed under the ISC license.
|
|
424
424
|
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
-
*/const __iconNode=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],X$1=createLucideIcon("X",__iconNode);function r(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var l=t.length;for(e=0;e<l;e++)t[e]&&(n=r(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function clsx(){for(var t,e,n=0,o="",l=arguments.length;n<l;n++)(t=arguments[n])&&(e=r(t))&&(o&&(o+=" "),o+=e);return o}const CLASS_PART_SEPARATOR="-",createClassGroupUtils=t=>{const e=createClassMap(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=t;return{getClassGroupId:f=>{const g=f.split(CLASS_PART_SEPARATOR);return g[0]===""&&g.length!==1&&g.shift(),getGroupRecursive(g,e)||getGroupIdForArbitraryProperty(f)},getConflictingClassGroupIds:(f,g)=>{const b=n[f]||[];return g&&o[f]?[...b,...o[f]]:b}}},getGroupRecursive=(t,e)=>{var f;if(t.length===0)return e.classGroupId;const n=t[0],o=e.nextPart.get(n),l=o?getGroupRecursive(t.slice(1),o):void 0;if(l)return l;if(e.validators.length===0)return;const d=t.join(CLASS_PART_SEPARATOR);return(f=e.validators.find(({validator:g})=>g(d)))==null?void 0:f.classGroupId},arbitraryPropertyRegex=/^\[(.+)\]$/,getGroupIdForArbitraryProperty=t=>{if(arbitraryPropertyRegex.test(t)){const e=arbitraryPropertyRegex.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},createClassMap=t=>{const{theme:e,classGroups:n}=t,o={nextPart:new Map,validators:[]};for(const l in n)processClassesRecursively(n[l],o,l,e);return o},processClassesRecursively=(t,e,n,o)=>{t.forEach(l=>{if(typeof l=="string"){const d=l===""?e:getPart(e,l);d.classGroupId=n;return}if(typeof l=="function"){if(isThemeGetter(l)){processClassesRecursively(l(o),e,n,o);return}e.validators.push({validator:l,classGroupId:n});return}Object.entries(l).forEach(([d,f])=>{processClassesRecursively(f,getPart(e,d),n,o)})})},getPart=(t,e)=>{let n=t;return e.split(CLASS_PART_SEPARATOR).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},isThemeGetter=t=>t.isThemeGetter,createLruCache=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,o=new Map;const l=(d,f)=>{n.set(d,f),e++,e>t&&(e=0,o=n,n=new Map)};return{get(d){let f=n.get(d);if(f!==void 0)return f;if((f=o.get(d))!==void 0)return l(d,f),f},set(d,f){n.has(d)?n.set(d,f):l(d,f)}}},IMPORTANT_MODIFIER="!",MODIFIER_SEPARATOR=":",MODIFIER_SEPARATOR_LENGTH=MODIFIER_SEPARATOR.length,createParseClassName=t=>{const{prefix:e,experimentalParseClassName:n}=t;let o=l=>{const d=[];let f=0,g=0,b=0,_;for(let A=0;A<l.length;A++){let M=l[A];if(f===0&&g===0){if(M===MODIFIER_SEPARATOR){d.push(l.slice(b,A)),b=A+MODIFIER_SEPARATOR_LENGTH;continue}if(M==="/"){_=A;continue}}M==="["?f++:M==="]"?f--:M==="("?g++:M===")"&&g--}const S=d.length===0?l:l.substring(b),R=stripImportantModifier(S),C=R!==S,E=_&&_>b?_-b:void 0;return{modifiers:d,hasImportantModifier:C,baseClassName:R,maybePostfixModifierPosition:E}};if(e){const l=e+MODIFIER_SEPARATOR,d=o;o=f=>f.startsWith(l)?d(f.substring(l.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:f,maybePostfixModifierPosition:void 0}}if(n){const l=o;o=d=>n({className:d,parseClassName:l})}return o},stripImportantModifier=t=>t.endsWith(IMPORTANT_MODIFIER)?t.substring(0,t.length-1):t.startsWith(IMPORTANT_MODIFIER)?t.substring(1):t,createSortModifiers=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const l=[];let d=[];return o.forEach(f=>{f[0]==="["||e[f]?(l.push(...d.sort(),f),d=[]):d.push(f)}),l.push(...d.sort()),l}},createConfigUtils=t=>({cache:createLruCache(t.cacheSize),parseClassName:createParseClassName(t),sortModifiers:createSortModifiers(t),...createClassGroupUtils(t)}),SPLIT_CLASSES_REGEX=/\s+/,mergeClassList=(t,e)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:l,sortModifiers:d}=e,f=[],g=t.trim().split(SPLIT_CLASSES_REGEX);let b="";for(let _=g.length-1;_>=0;_-=1){const S=g[_],{isExternal:R,modifiers:C,hasImportantModifier:E,baseClassName:A,maybePostfixModifierPosition:M}=n(S);if(R){b=S+(b.length>0?" "+b:b);continue}let I=!!M,j=o(I?A.substring(0,M):A);if(!j){if(!I){b=S+(b.length>0?" "+b:b);continue}if(j=o(A),!j){b=S+(b.length>0?" "+b:b);continue}I=!1}const q=d(C).join(":"),z=E?q+IMPORTANT_MODIFIER:q,Q=z+j;if(f.includes(Q))continue;f.push(Q);const F=l(j,I);for(let V=0;V<F.length;++V){const te=F[V];f.push(z+te)}b=S+(b.length>0?" "+b:b)}return b};function twJoin(){let t=0,e,n,o="";for(;t<arguments.length;)(e=arguments[t++])&&(n=toValue(e))&&(o&&(o+=" "),o+=n);return o}const toValue=t=>{if(typeof t=="string")return t;let e,n="";for(let o=0;o<t.length;o++)t[o]&&(e=toValue(t[o]))&&(n&&(n+=" "),n+=e);return n};function createTailwindMerge(t,...e){let n,o,l,d=f;function f(b){const _=e.reduce((S,R)=>R(S),t());return n=createConfigUtils(_),o=n.cache.get,l=n.cache.set,d=g,g(b)}function g(b){const _=o(b);if(_)return _;const S=mergeClassList(b,n);return l(b,S),S}return function(){return d(twJoin.apply(null,arguments))}}const fromTheme=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},arbitraryValueRegex=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,arbitraryVariableRegex=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fractionRegex=/^\d+\/\d+$/,tshirtUnitRegex=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lengthUnitRegex=/\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$/,colorFunctionRegex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,shadowRegex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,imageRegex=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,isFraction=t=>fractionRegex.test(t),isNumber$4=t=>!!t&&!Number.isNaN(Number(t)),isInteger=t=>!!t&&Number.isInteger(Number(t)),isPercent$1=t=>t.endsWith("%")&&isNumber$4(t.slice(0,-1)),isTshirtSize=t=>tshirtUnitRegex.test(t),isAny=()=>!0,isLengthOnly=t=>lengthUnitRegex.test(t)&&!colorFunctionRegex.test(t),isNever=()=>!1,isShadow=t=>shadowRegex.test(t),isImage=t=>imageRegex.test(t),isAnyNonArbitrary=t=>!isArbitraryValue(t)&&!isArbitraryVariable(t),isArbitrarySize=t=>getIsArbitraryValue(t,isLabelSize,isNever),isArbitraryValue=t=>arbitraryValueRegex.test(t),isArbitraryLength=t=>getIsArbitraryValue(t,isLabelLength,isLengthOnly),isArbitraryNumber=t=>getIsArbitraryValue(t,isLabelNumber,isNumber$4),isArbitraryPosition=t=>getIsArbitraryValue(t,isLabelPosition,isNever),isArbitraryImage=t=>getIsArbitraryValue(t,isLabelImage,isImage),isArbitraryShadow=t=>getIsArbitraryValue(t,isLabelShadow,isShadow),isArbitraryVariable=t=>arbitraryVariableRegex.test(t),isArbitraryVariableLength=t=>getIsArbitraryVariable(t,isLabelLength),isArbitraryVariableFamilyName=t=>getIsArbitraryVariable(t,isLabelFamilyName),isArbitraryVariablePosition=t=>getIsArbitraryVariable(t,isLabelPosition),isArbitraryVariableSize=t=>getIsArbitraryVariable(t,isLabelSize),isArbitraryVariableImage=t=>getIsArbitraryVariable(t,isLabelImage),isArbitraryVariableShadow=t=>getIsArbitraryVariable(t,isLabelShadow,!0),getIsArbitraryValue=(t,e,n)=>{const o=arbitraryValueRegex.exec(t);return o?o[1]?e(o[1]):n(o[2]):!1},getIsArbitraryVariable=(t,e,n=!1)=>{const o=arbitraryVariableRegex.exec(t);return o?o[1]?e(o[1]):n:!1},isLabelPosition=t=>t==="position"||t==="percentage",isLabelImage=t=>t==="image"||t==="url",isLabelSize=t=>t==="length"||t==="size"||t==="bg-size",isLabelLength=t=>t==="length",isLabelNumber=t=>t==="number",isLabelFamilyName=t=>t==="family-name",isLabelShadow=t=>t==="shadow",getDefaultConfig=()=>{const t=fromTheme("color"),e=fromTheme("font"),n=fromTheme("text"),o=fromTheme("font-weight"),l=fromTheme("tracking"),d=fromTheme("leading"),f=fromTheme("breakpoint"),g=fromTheme("container"),b=fromTheme("spacing"),_=fromTheme("radius"),S=fromTheme("shadow"),R=fromTheme("inset-shadow"),C=fromTheme("text-shadow"),E=fromTheme("drop-shadow"),A=fromTheme("blur"),M=fromTheme("perspective"),I=fromTheme("aspect"),j=fromTheme("ease"),q=fromTheme("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...Q(),isArbitraryVariable,isArbitraryValue],V=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto","contain","none"],ne=()=>[isArbitraryVariable,isArbitraryValue,b],se=()=>[isFraction,"full","auto",...ne()],ge=()=>[isInteger,"none","subgrid",isArbitraryVariable,isArbitraryValue],oe=()=>["auto",{span:["full",isInteger,isArbitraryVariable,isArbitraryValue]},isInteger,isArbitraryVariable,isArbitraryValue],Ae=()=>[isInteger,"auto",isArbitraryVariable,isArbitraryValue],je=()=>["auto","min","max","fr",isArbitraryVariable,isArbitraryValue],Ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Oe=()=>["start","end","center","stretch","center-safe","end-safe"],Fe=()=>["auto",...ne()],ze=()=>[isFraction,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...ne()],$e=()=>[t,isArbitraryVariable,isArbitraryValue],Be=()=>[...Q(),isArbitraryVariablePosition,isArbitraryPosition,{position:[isArbitraryVariable,isArbitraryValue]}],qe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Ge=()=>["auto","cover","contain",isArbitraryVariableSize,isArbitrarySize,{size:[isArbitraryVariable,isArbitraryValue]}],He=()=>[isPercent$1,isArbitraryVariableLength,isArbitraryLength],Ze=()=>["","none","full",_,isArbitraryVariable,isArbitraryValue],tt=()=>["",isNumber$4,isArbitraryVariableLength,isArbitraryLength],Ye=()=>["solid","dashed","dotted","double"],Qe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Xe=()=>[isNumber$4,isPercent$1,isArbitraryVariablePosition,isArbitraryPosition],st=()=>["","none",A,isArbitraryVariable,isArbitraryValue],rt=()=>["none",isNumber$4,isArbitraryVariable,isArbitraryValue],at=()=>["none",isNumber$4,isArbitraryVariable,isArbitraryValue],ot=()=>[isNumber$4,isArbitraryVariable,isArbitraryValue],Ue=()=>[isFraction,"full",...ne()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[isTshirtSize],breakpoint:[isTshirtSize],color:[isAny],container:[isTshirtSize],"drop-shadow":[isTshirtSize],ease:["in","out","in-out"],font:[isAnyNonArbitrary],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[isTshirtSize],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[isTshirtSize],shadow:[isTshirtSize],spacing:["px",isNumber$4],text:[isTshirtSize],"text-shadow":[isTshirtSize],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",isFraction,isArbitraryValue,isArbitraryVariable,I]}],container:["container"],columns:[{columns:[isNumber$4,isArbitraryValue,isArbitraryVariable,g]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:F()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:se()}],"inset-x":[{"inset-x":se()}],"inset-y":[{"inset-y":se()}],start:[{start:se()}],end:[{end:se()}],top:[{top:se()}],right:[{right:se()}],bottom:[{bottom:se()}],left:[{left:se()}],visibility:["visible","invisible","collapse"],z:[{z:[isInteger,"auto",isArbitraryVariable,isArbitraryValue]}],basis:[{basis:[isFraction,"full","auto",g,...ne()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[isNumber$4,isFraction,"auto","initial","none",isArbitraryValue]}],grow:[{grow:["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],shrink:[{shrink:["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],order:[{order:[isInteger,"first","last","none",isArbitraryVariable,isArbitraryValue]}],"grid-cols":[{"grid-cols":ge()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":Ae()}],"col-end":[{"col-end":Ae()}],"grid-rows":[{"grid-rows":ge()}],"row-start-end":[{row:oe()}],"row-start":[{"row-start":Ae()}],"row-end":[{"row-end":Ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":je()}],"auto-rows":[{"auto-rows":je()}],gap:[{gap:ne()}],"gap-x":[{"gap-x":ne()}],"gap-y":[{"gap-y":ne()}],"justify-content":[{justify:[...Ne(),"normal"]}],"justify-items":[{"justify-items":[...Oe(),"normal"]}],"justify-self":[{"justify-self":["auto",...Oe()]}],"align-content":[{content:["normal",...Ne()]}],"align-items":[{items:[...Oe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Oe(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ne()}],"place-items":[{"place-items":[...Oe(),"baseline"]}],"place-self":[{"place-self":["auto",...Oe()]}],p:[{p:ne()}],px:[{px:ne()}],py:[{py:ne()}],ps:[{ps:ne()}],pe:[{pe:ne()}],pt:[{pt:ne()}],pr:[{pr:ne()}],pb:[{pb:ne()}],pl:[{pl:ne()}],m:[{m:Fe()}],mx:[{mx:Fe()}],my:[{my:Fe()}],ms:[{ms:Fe()}],me:[{me:Fe()}],mt:[{mt:Fe()}],mr:[{mr:Fe()}],mb:[{mb:Fe()}],ml:[{ml:Fe()}],"space-x":[{"space-x":ne()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":ne()}],"space-y-reverse":["space-y-reverse"],size:[{size:ze()}],w:[{w:[g,"screen",...ze()]}],"min-w":[{"min-w":[g,"screen","none",...ze()]}],"max-w":[{"max-w":[g,"screen","none","prose",{screen:[f]},...ze()]}],h:[{h:["screen","lh",...ze()]}],"min-h":[{"min-h":["screen","lh","none",...ze()]}],"max-h":[{"max-h":["screen","lh",...ze()]}],"font-size":[{text:["base",n,isArbitraryVariableLength,isArbitraryLength]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,isArbitraryVariable,isArbitraryNumber]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",isPercent$1,isArbitraryValue]}],"font-family":[{font:[isArbitraryVariableFamilyName,isArbitraryValue,e]}],"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:[l,isArbitraryVariable,isArbitraryValue]}],"line-clamp":[{"line-clamp":[isNumber$4,"none",isArbitraryVariable,isArbitraryNumber]}],leading:[{leading:[d,...ne()]}],"list-image":[{"list-image":["none",isArbitraryVariable,isArbitraryValue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",isArbitraryVariable,isArbitraryValue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$e()}],"text-color":[{text:$e()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[isNumber$4,"from-font","auto",isArbitraryVariable,isArbitraryLength]}],"text-decoration-color":[{decoration:$e()}],"underline-offset":[{"underline-offset":[isNumber$4,"auto",isArbitraryVariable,isArbitraryValue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ne()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",isArbitraryVariable,isArbitraryValue]}],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",isArbitraryVariable,isArbitraryValue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Be()}],"bg-repeat":[{bg:qe()}],"bg-size":[{bg:Ge()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},isInteger,isArbitraryVariable,isArbitraryValue],radial:["",isArbitraryVariable,isArbitraryValue],conic:[isInteger,isArbitraryVariable,isArbitraryValue]},isArbitraryVariableImage,isArbitraryImage]}],"bg-color":[{bg:$e()}],"gradient-from-pos":[{from:He()}],"gradient-via-pos":[{via:He()}],"gradient-to-pos":[{to:He()}],"gradient-from":[{from:$e()}],"gradient-via":[{via:$e()}],"gradient-to":[{to:$e()}],rounded:[{rounded:Ze()}],"rounded-s":[{"rounded-s":Ze()}],"rounded-e":[{"rounded-e":Ze()}],"rounded-t":[{"rounded-t":Ze()}],"rounded-r":[{"rounded-r":Ze()}],"rounded-b":[{"rounded-b":Ze()}],"rounded-l":[{"rounded-l":Ze()}],"rounded-ss":[{"rounded-ss":Ze()}],"rounded-se":[{"rounded-se":Ze()}],"rounded-ee":[{"rounded-ee":Ze()}],"rounded-es":[{"rounded-es":Ze()}],"rounded-tl":[{"rounded-tl":Ze()}],"rounded-tr":[{"rounded-tr":Ze()}],"rounded-br":[{"rounded-br":Ze()}],"rounded-bl":[{"rounded-bl":Ze()}],"border-w":[{border:tt()}],"border-w-x":[{"border-x":tt()}],"border-w-y":[{"border-y":tt()}],"border-w-s":[{"border-s":tt()}],"border-w-e":[{"border-e":tt()}],"border-w-t":[{"border-t":tt()}],"border-w-r":[{"border-r":tt()}],"border-w-b":[{"border-b":tt()}],"border-w-l":[{"border-l":tt()}],"divide-x":[{"divide-x":tt()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":tt()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ye(),"hidden","none"]}],"divide-style":[{divide:[...Ye(),"hidden","none"]}],"border-color":[{border:$e()}],"border-color-x":[{"border-x":$e()}],"border-color-y":[{"border-y":$e()}],"border-color-s":[{"border-s":$e()}],"border-color-e":[{"border-e":$e()}],"border-color-t":[{"border-t":$e()}],"border-color-r":[{"border-r":$e()}],"border-color-b":[{"border-b":$e()}],"border-color-l":[{"border-l":$e()}],"divide-color":[{divide:$e()}],"outline-style":[{outline:[...Ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"outline-w":[{outline:["",isNumber$4,isArbitraryVariableLength,isArbitraryLength]}],"outline-color":[{outline:$e()}],shadow:[{shadow:["","none",S,isArbitraryVariableShadow,isArbitraryShadow]}],"shadow-color":[{shadow:$e()}],"inset-shadow":[{"inset-shadow":["none",R,isArbitraryVariableShadow,isArbitraryShadow]}],"inset-shadow-color":[{"inset-shadow":$e()}],"ring-w":[{ring:tt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$e()}],"ring-offset-w":[{"ring-offset":[isNumber$4,isArbitraryLength]}],"ring-offset-color":[{"ring-offset":$e()}],"inset-ring-w":[{"inset-ring":tt()}],"inset-ring-color":[{"inset-ring":$e()}],"text-shadow":[{"text-shadow":["none",C,isArbitraryVariableShadow,isArbitraryShadow]}],"text-shadow-color":[{"text-shadow":$e()}],opacity:[{opacity:[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"mix-blend":[{"mix-blend":[...Qe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Qe()}],"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":[isNumber$4]}],"mask-image-linear-from-pos":[{"mask-linear-from":Xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":Xe()}],"mask-image-linear-from-color":[{"mask-linear-from":$e()}],"mask-image-linear-to-color":[{"mask-linear-to":$e()}],"mask-image-t-from-pos":[{"mask-t-from":Xe()}],"mask-image-t-to-pos":[{"mask-t-to":Xe()}],"mask-image-t-from-color":[{"mask-t-from":$e()}],"mask-image-t-to-color":[{"mask-t-to":$e()}],"mask-image-r-from-pos":[{"mask-r-from":Xe()}],"mask-image-r-to-pos":[{"mask-r-to":Xe()}],"mask-image-r-from-color":[{"mask-r-from":$e()}],"mask-image-r-to-color":[{"mask-r-to":$e()}],"mask-image-b-from-pos":[{"mask-b-from":Xe()}],"mask-image-b-to-pos":[{"mask-b-to":Xe()}],"mask-image-b-from-color":[{"mask-b-from":$e()}],"mask-image-b-to-color":[{"mask-b-to":$e()}],"mask-image-l-from-pos":[{"mask-l-from":Xe()}],"mask-image-l-to-pos":[{"mask-l-to":Xe()}],"mask-image-l-from-color":[{"mask-l-from":$e()}],"mask-image-l-to-color":[{"mask-l-to":$e()}],"mask-image-x-from-pos":[{"mask-x-from":Xe()}],"mask-image-x-to-pos":[{"mask-x-to":Xe()}],"mask-image-x-from-color":[{"mask-x-from":$e()}],"mask-image-x-to-color":[{"mask-x-to":$e()}],"mask-image-y-from-pos":[{"mask-y-from":Xe()}],"mask-image-y-to-pos":[{"mask-y-to":Xe()}],"mask-image-y-from-color":[{"mask-y-from":$e()}],"mask-image-y-to-color":[{"mask-y-to":$e()}],"mask-image-radial":[{"mask-radial":[isArbitraryVariable,isArbitraryValue]}],"mask-image-radial-from-pos":[{"mask-radial-from":Xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":Xe()}],"mask-image-radial-from-color":[{"mask-radial-from":$e()}],"mask-image-radial-to-color":[{"mask-radial-to":$e()}],"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":Q()}],"mask-image-conic-pos":[{"mask-conic":[isNumber$4]}],"mask-image-conic-from-pos":[{"mask-conic-from":Xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":Xe()}],"mask-image-conic-from-color":[{"mask-conic-from":$e()}],"mask-image-conic-to-color":[{"mask-conic-to":$e()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Be()}],"mask-repeat":[{mask:qe()}],"mask-size":[{mask:Ge()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",isArbitraryVariable,isArbitraryValue]}],filter:[{filter:["","none",isArbitraryVariable,isArbitraryValue]}],blur:[{blur:st()}],brightness:[{brightness:[isNumber$4,isArbitraryVariable,isArbitraryValue]}],contrast:[{contrast:[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"drop-shadow":[{"drop-shadow":["","none",E,isArbitraryVariableShadow,isArbitraryShadow]}],"drop-shadow-color":[{"drop-shadow":$e()}],grayscale:[{grayscale:["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],"hue-rotate":[{"hue-rotate":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],invert:[{invert:["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],saturate:[{saturate:[isNumber$4,isArbitraryVariable,isArbitraryValue]}],sepia:[{sepia:["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-filter":[{"backdrop-filter":["","none",isArbitraryVariable,isArbitraryValue]}],"backdrop-blur":[{"backdrop-blur":st()}],"backdrop-brightness":[{"backdrop-brightness":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-contrast":[{"backdrop-contrast":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-invert":[{"backdrop-invert":["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-opacity":[{"backdrop-opacity":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-saturate":[{"backdrop-saturate":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-sepia":[{"backdrop-sepia":["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":ne()}],"border-spacing-x":[{"border-spacing-x":ne()}],"border-spacing-y":[{"border-spacing-y":ne()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",isArbitraryVariable,isArbitraryValue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[isNumber$4,"initial",isArbitraryVariable,isArbitraryValue]}],ease:[{ease:["linear","initial",j,isArbitraryVariable,isArbitraryValue]}],delay:[{delay:[isNumber$4,isArbitraryVariable,isArbitraryValue]}],animate:[{animate:["none",q,isArbitraryVariable,isArbitraryValue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[M,isArbitraryVariable,isArbitraryValue]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:rt()}],"rotate-x":[{"rotate-x":rt()}],"rotate-y":[{"rotate-y":rt()}],"rotate-z":[{"rotate-z":rt()}],scale:[{scale:at()}],"scale-x":[{"scale-x":at()}],"scale-y":[{"scale-y":at()}],"scale-z":[{"scale-z":at()}],"scale-3d":["scale-3d"],skew:[{skew:ot()}],"skew-x":[{"skew-x":ot()}],"skew-y":[{"skew-y":ot()}],transform:[{transform:[isArbitraryVariable,isArbitraryValue,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ue()}],"translate-x":[{"translate-x":Ue()}],"translate-y":[{"translate-y":Ue()}],"translate-z":[{"translate-z":Ue()}],"translate-none":["translate-none"],accent:[{accent:$e()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$e()}],"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",isArbitraryVariable,isArbitraryValue]}],"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":ne()}],"scroll-mx":[{"scroll-mx":ne()}],"scroll-my":[{"scroll-my":ne()}],"scroll-ms":[{"scroll-ms":ne()}],"scroll-me":[{"scroll-me":ne()}],"scroll-mt":[{"scroll-mt":ne()}],"scroll-mr":[{"scroll-mr":ne()}],"scroll-mb":[{"scroll-mb":ne()}],"scroll-ml":[{"scroll-ml":ne()}],"scroll-p":[{"scroll-p":ne()}],"scroll-px":[{"scroll-px":ne()}],"scroll-py":[{"scroll-py":ne()}],"scroll-ps":[{"scroll-ps":ne()}],"scroll-pe":[{"scroll-pe":ne()}],"scroll-pt":[{"scroll-pt":ne()}],"scroll-pr":[{"scroll-pr":ne()}],"scroll-pb":[{"scroll-pb":ne()}],"scroll-pl":[{"scroll-pl":ne()}],"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",isArbitraryVariable,isArbitraryValue]}],fill:[{fill:["none",...$e()]}],"stroke-w":[{stroke:[isNumber$4,isArbitraryVariableLength,isArbitraryLength,isArbitraryNumber]}],stroke:[{stroke:["none",...$e()]}],"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"]}},twMerge=createTailwindMerge(getDefaultConfig);function cn(...t){return twMerge(clsx(t))}const formatNumber=t=>new Intl.NumberFormat("en-CA").format(t),formatMoney=(t,e=2)=>new Intl.NumberFormat("en-CA",{style:"currency",currency:"CAD",minimumFractionDigits:e,maximumFractionDigits:e}).format(t),formatYYYYMMDDIntToDateString=t=>{if(t===null||typeof t>"u")return"—";const e=t.toString();if(e.length===8){const n=e.substring(0,4),o=e.substring(4,6),l=e.substring(6,8);return`${n}-${o}-${l}`}return e};function InputOTP({className:t,containerClassName:e,...n}){return jsxRuntime.jsx(Lt,{"data-slot":"input-otp",containerClassName:cn("flex items-center gap-2 has-disabled:opacity-50",e),className:cn("disabled:cursor-not-allowed",t),...n})}function InputOTPGroup({className:t,...e}){return jsxRuntime.jsx("div",{"data-slot":"input-otp-group",className:cn("flex items-center",t),...e})}function InputOTPSlot({index:t,className:e,...n}){const o=React__namespace.useContext(jt),{char:l,hasFakeCaret:d,isActive:f}=(o==null?void 0:o.slots[t])??{};return jsxRuntime.jsxs("div",{"data-slot":"input-otp-slot","data-active":f,className:cn("border-input data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",e),...n,children:[l,d&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function InputOTPSeparator({...t}){return jsxRuntime.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:jsxRuntime.jsx(Minus,{})})}function composeEventHandlers(t,e,{checkForDefaultPrevented:n=!0}={}){return function(l){if(t==null||t(l),n===!1||!l.defaultPrevented)return e==null?void 0:e(l)}}function setRef(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function composeRefs(...t){return e=>{let n=!1;const o=t.map(l=>{const d=setRef(l,e);return!n&&typeof d=="function"&&(n=!0),d});if(n)return()=>{for(let l=0;l<o.length;l++){const d=o[l];typeof d=="function"?d():setRef(t[l],null)}}}}function useComposedRefs(...t){return React__namespace.useCallback(composeRefs(...t),t)}function createContext2(t,e){const n=React__namespace.createContext(e),o=d=>{const{children:f,...g}=d,b=React__namespace.useMemo(()=>g,Object.values(g));return jsxRuntime.jsx(n.Provider,{value:b,children:f})};o.displayName=t+"Provider";function l(d){const f=React__namespace.useContext(n);if(f)return f;if(e!==void 0)return e;throw new Error(`\`${d}\` must be used within \`${t}\``)}return[o,l]}function createContextScope(t,e=[]){let n=[];function o(d,f){const g=React__namespace.createContext(f),b=n.length;n=[...n,f];const _=R=>{var j;const{scope:C,children:E,...A}=R,M=((j=C==null?void 0:C[t])==null?void 0:j[b])||g,I=React__namespace.useMemo(()=>A,Object.values(A));return jsxRuntime.jsx(M.Provider,{value:I,children:E})};_.displayName=d+"Provider";function S(R,C){var M;const E=((M=C==null?void 0:C[t])==null?void 0:M[b])||g,A=React__namespace.useContext(E);if(A)return A;if(f!==void 0)return f;throw new Error(`\`${R}\` must be used within \`${d}\``)}return[_,S]}const l=()=>{const d=n.map(f=>React__namespace.createContext(f));return function(g){const b=(g==null?void 0:g[t])||d;return React__namespace.useMemo(()=>({[`__scope${t}`]:{...g,[t]:b}}),[g,b])}};return l.scopeName=t,[o,composeContextScopes(l,...e)]}function composeContextScopes(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const o=t.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(d){const f=o.reduce((g,{useScope:b,scopeName:_})=>{const R=b(d)[`__scope${_}`];return{...g,...R}},{});return React__namespace.useMemo(()=>({[`__scope${e.scopeName}`]:f}),[f])}};return n.scopeName=e.scopeName,n}function createSlot(t){const e=createSlotClone(t),n=React__namespace.forwardRef((o,l)=>{const{children:d,...f}=o,g=React__namespace.Children.toArray(d),b=g.find(isSlottable);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(e,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(e,{...f,ref:l,children:d})});return n.displayName=`${t}.Slot`,n}var Slot$4=createSlot("Slot");function createSlotClone(t){const e=React__namespace.forwardRef((n,o)=>{const{children:l,...d}=n;if(React__namespace.isValidElement(l)){const f=getElementRef$1(l),g=mergeProps(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var SLOTTABLE_IDENTIFIER=Symbol("radix.slottable");function createSlottable(t){const e=({children:n})=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=SLOTTABLE_IDENTIFIER,e}function isSlottable(t){return React__namespace.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===SLOTTABLE_IDENTIFIER}function mergeProps(t,e){const n={...e};for(const o in e){const l=t[o],d=e[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...t,...n}}function getElementRef$1(t){var o,l;let e=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(l=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:l.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive=NODES.reduce((t,e)=>{const n=createSlot(`Primitive.${e}`),o=React__namespace.forwardRef((l,d)=>{const{asChild:f,...g}=l,b=f?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntime.jsx(b,{...g,ref:d})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{});function dispatchDiscreteCustomEvent(t,e){t&&ReactDOM__namespace.flushSync(()=>t.dispatchEvent(e))}function createCollection(t){const e=t+"CollectionProvider",[n,o]=createContextScope(e),[l,d]=n(e,{collectionRef:{current:null},itemMap:new Map}),f=M=>{const{scope:I,children:j}=M,q=React.useRef(null),z=React.useRef(new Map).current;return jsxRuntime.jsx(l,{scope:I,itemMap:z,collectionRef:q,children:j})};f.displayName=e;const g=t+"CollectionSlot",b=createSlot(g),_=React.forwardRef((M,I)=>{const{scope:j,children:q}=M,z=d(g,j),Q=useComposedRefs(I,z.collectionRef);return jsxRuntime.jsx(b,{ref:Q,children:q})});_.displayName=g;const S=t+"CollectionItemSlot",R="data-radix-collection-item",C=createSlot(S),E=React.forwardRef((M,I)=>{const{scope:j,children:q,...z}=M,Q=React.useRef(null),F=useComposedRefs(I,Q),V=d(S,j);return React.useEffect(()=>(V.itemMap.set(Q,{ref:Q,...z}),()=>void V.itemMap.delete(Q))),jsxRuntime.jsx(C,{[R]:"",ref:F,children:q})});E.displayName=S;function A(M){const I=d(t+"CollectionConsumer",M);return React.useCallback(()=>{const q=I.collectionRef.current;if(!q)return[];const z=Array.from(q.querySelectorAll(`[${R}]`));return Array.from(I.itemMap.values()).sort((V,te)=>z.indexOf(V.ref.current)-z.indexOf(te.ref.current))},[I.collectionRef,I.itemMap])}return[{Provider:f,Slot:_,ItemSlot:E},A,o]}var useLayoutEffect2=globalThis!=null&&globalThis.document?React__namespace.useLayoutEffect:()=>{},useReactId=React__namespace[" useId ".trim().toString()]||(()=>{}),count$3=0;function useId(t){const[e,n]=React__namespace.useState(useReactId());return useLayoutEffect2(()=>{n(o=>o??String(count$3++))},[t]),e?`radix-${e}`:""}function useCallbackRef$1(t){const e=React__namespace.useRef(t);return React__namespace.useEffect(()=>{e.current=t}),React__namespace.useMemo(()=>(...n)=>{var o;return(o=e.current)==null?void 0:o.call(e,...n)},[])}var useInsertionEffect=React__namespace[" useInsertionEffect ".trim().toString()]||useLayoutEffect2;function useControllableState({prop:t,defaultProp:e,onChange:n=()=>{},caller:o}){const[l,d,f]=useUncontrolledState({defaultProp:e,onChange:n}),g=t!==void 0,b=g?t:l;{const S=React__namespace.useRef(t!==void 0);React__namespace.useEffect(()=>{const R=S.current;R!==g&&console.warn(`${o} is changing from ${R?"controlled":"uncontrolled"} to ${g?"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.`),S.current=g},[g,o])}const _=React__namespace.useCallback(S=>{var R;if(g){const C=isFunction$6(S)?S(t):S;C!==t&&((R=f.current)==null||R.call(f,C))}else d(S)},[g,t,d,f]);return[b,_]}function useUncontrolledState({defaultProp:t,onChange:e}){const[n,o]=React__namespace.useState(t),l=React__namespace.useRef(n),d=React__namespace.useRef(e);return useInsertionEffect(()=>{d.current=e},[e]),React__namespace.useEffect(()=>{var f;l.current!==n&&((f=d.current)==null||f.call(d,n),l.current=n)},[n,l]),[n,o,d]}function isFunction$6(t){return typeof t=="function"}var DirectionContext=React__namespace.createContext(void 0);function useDirection(t){const e=React__namespace.useContext(DirectionContext);return t||e||"ltr"}var ENTRY_FOCUS="rovingFocusGroup.onEntryFocus",EVENT_OPTIONS$1={bubbles:!1,cancelable:!0},GROUP_NAME$3="RovingFocusGroup",[Collection$3,useCollection$3,createCollectionScope$3]=createCollection(GROUP_NAME$3),[createRovingFocusGroupContext,createRovingFocusGroupScope]=createContextScope(GROUP_NAME$3,[createCollectionScope$3]),[RovingFocusProvider,useRovingFocusContext]=createRovingFocusGroupContext(GROUP_NAME$3),RovingFocusGroup=React__namespace.forwardRef((t,e)=>jsxRuntime.jsx(Collection$3.Provider,{scope:t.__scopeRovingFocusGroup,children:jsxRuntime.jsx(Collection$3.Slot,{scope:t.__scopeRovingFocusGroup,children:jsxRuntime.jsx(RovingFocusGroupImpl,{...t,ref:e})})}));RovingFocusGroup.displayName=GROUP_NAME$3;var RovingFocusGroupImpl=React__namespace.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:l=!1,dir:d,currentTabStopId:f,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:b,onEntryFocus:_,preventScrollOnEntryFocus:S=!1,...R}=t,C=React__namespace.useRef(null),E=useComposedRefs(e,C),A=useDirection(d),[M,I]=useControllableState({prop:f,defaultProp:g??null,onChange:b,caller:GROUP_NAME$3}),[j,q]=React__namespace.useState(!1),z=useCallbackRef$1(_),Q=useCollection$3(n),F=React__namespace.useRef(!1),[V,te]=React__namespace.useState(0);return React__namespace.useEffect(()=>{const ne=C.current;if(ne)return ne.addEventListener(ENTRY_FOCUS,z),()=>ne.removeEventListener(ENTRY_FOCUS,z)},[z]),jsxRuntime.jsx(RovingFocusProvider,{scope:n,orientation:o,dir:A,loop:l,currentTabStopId:M,onItemFocus:React__namespace.useCallback(ne=>I(ne),[I]),onItemShiftTab:React__namespace.useCallback(()=>q(!0),[]),onFocusableItemAdd:React__namespace.useCallback(()=>te(ne=>ne+1),[]),onFocusableItemRemove:React__namespace.useCallback(()=>te(ne=>ne-1),[]),children:jsxRuntime.jsx(Primitive.div,{tabIndex:j||V===0?-1:0,"data-orientation":o,...R,ref:E,style:{outline:"none",...t.style},onMouseDown:composeEventHandlers(t.onMouseDown,()=>{F.current=!0}),onFocus:composeEventHandlers(t.onFocus,ne=>{const se=!F.current;if(ne.target===ne.currentTarget&&se&&!j){const ge=new CustomEvent(ENTRY_FOCUS,EVENT_OPTIONS$1);if(ne.currentTarget.dispatchEvent(ge),!ge.defaultPrevented){const oe=Q().filter(Fe=>Fe.focusable),Ae=oe.find(Fe=>Fe.active),je=oe.find(Fe=>Fe.id===M),Oe=[Ae,je,...oe].filter(Boolean).map(Fe=>Fe.ref.current);focusFirst$3(Oe,S)}}F.current=!1}),onBlur:composeEventHandlers(t.onBlur,()=>q(!1))})})}),ITEM_NAME$4="RovingFocusGroupItem",RovingFocusGroupItem=React__namespace.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:d,children:f,...g}=t,b=useId(),_=d||b,S=useRovingFocusContext(ITEM_NAME$4,n),R=S.currentTabStopId===_,C=useCollection$3(n),{onFocusableItemAdd:E,onFocusableItemRemove:A,currentTabStopId:M}=S;return React__namespace.useEffect(()=>{if(o)return E(),()=>A()},[o,E,A]),jsxRuntime.jsx(Collection$3.ItemSlot,{scope:n,id:_,focusable:o,active:l,children:jsxRuntime.jsx(Primitive.span,{tabIndex:R?0:-1,"data-orientation":S.orientation,...g,ref:e,onMouseDown:composeEventHandlers(t.onMouseDown,I=>{o?S.onItemFocus(_):I.preventDefault()}),onFocus:composeEventHandlers(t.onFocus,()=>S.onItemFocus(_)),onKeyDown:composeEventHandlers(t.onKeyDown,I=>{if(I.key==="Tab"&&I.shiftKey){S.onItemShiftTab();return}if(I.target!==I.currentTarget)return;const j=getFocusIntent(I,S.orientation,S.dir);if(j!==void 0){if(I.metaKey||I.ctrlKey||I.altKey||I.shiftKey)return;I.preventDefault();let z=C().filter(Q=>Q.focusable).map(Q=>Q.ref.current);if(j==="last")z.reverse();else if(j==="prev"||j==="next"){j==="prev"&&z.reverse();const Q=z.indexOf(I.currentTarget);z=S.loop?wrapArray$2(z,Q+1):z.slice(Q+1)}setTimeout(()=>focusFirst$3(z))}}),children:typeof f=="function"?f({isCurrentTabStop:R,hasTabStop:M!=null}):f})})});RovingFocusGroupItem.displayName=ITEM_NAME$4;var MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function getDirectionAwareKey(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function getFocusIntent(t,e,n){const o=getDirectionAwareKey(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return MAP_KEY_TO_FOCUS_INTENT[o]}function focusFirst$3(t,e=!1){const n=document.activeElement;for(const o of t)if(o===n||(o.focus({preventScroll:e}),document.activeElement!==n))return}function wrapArray$2(t,e){return t.map((n,o)=>t[(e+o)%t.length])}var Root$a=RovingFocusGroup,Item$2=RovingFocusGroupItem;function useSize(t){const[e,n]=React__namespace.useState(void 0);return useLayoutEffect2(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const o=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const d=l[0];let f,g;if("borderBoxSize"in d){const b=d.borderBoxSize,_=Array.isArray(b)?b[0]:b;f=_.inlineSize,g=_.blockSize}else f=t.offsetWidth,g=t.offsetHeight;n({width:f,height:g})});return o.observe(t,{box:"border-box"}),()=>o.unobserve(t)}else n(void 0)},[t]),e}function usePrevious(t){const e=React__namespace.useRef({value:t,previous:t});return React__namespace.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function useStateMachine$1(t,e){return React__namespace.useReducer((n,o)=>e[n][o]??n,t)}var Presence=t=>{const{present:e,children:n}=t,o=usePresence(e),l=typeof n=="function"?n({present:o.isPresent}):React__namespace.Children.only(n),d=useComposedRefs(o.ref,getElementRef(l));return typeof n=="function"||o.isPresent?React__namespace.cloneElement(l,{ref:d}):null};Presence.displayName="Presence";function usePresence(t){const[e,n]=React__namespace.useState(),o=React__namespace.useRef(null),l=React__namespace.useRef(t),d=React__namespace.useRef("none"),f=t?"mounted":"unmounted",[g,b]=useStateMachine$1(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return React__namespace.useEffect(()=>{const _=getAnimationName(o.current);d.current=g==="mounted"?_:"none"},[g]),useLayoutEffect2(()=>{const _=o.current,S=l.current;if(S!==t){const C=d.current,E=getAnimationName(_);t?b("MOUNT"):E==="none"||(_==null?void 0:_.display)==="none"?b("UNMOUNT"):b(S&&C!==E?"ANIMATION_OUT":"UNMOUNT"),l.current=t}},[t,b]),useLayoutEffect2(()=>{if(e){let _;const S=e.ownerDocument.defaultView??window,R=E=>{const M=getAnimationName(o.current).includes(E.animationName);if(E.target===e&&M&&(b("ANIMATION_END"),!l.current)){const I=e.style.animationFillMode;e.style.animationFillMode="forwards",_=S.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=I)})}},C=E=>{E.target===e&&(d.current=getAnimationName(o.current))};return e.addEventListener("animationstart",C),e.addEventListener("animationcancel",R),e.addEventListener("animationend",R),()=>{S.clearTimeout(_),e.removeEventListener("animationstart",C),e.removeEventListener("animationcancel",R),e.removeEventListener("animationend",R)}}else b("ANIMATION_END")},[e,b]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:React__namespace.useCallback(_=>{o.current=_?getComputedStyle(_):null,n(_)},[])}}function getAnimationName(t){return(t==null?void 0:t.animationName)||"none"}function getElementRef(t){var o,l;let e=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(l=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:l.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var RADIO_NAME="Radio",[createRadioContext,createRadioScope]=createContextScope(RADIO_NAME),[RadioProvider,useRadioContext]=createRadioContext(RADIO_NAME),Radio=React__namespace.forwardRef((t,e)=>{const{__scopeRadio:n,name:o,checked:l=!1,required:d,disabled:f,value:g="on",onCheck:b,form:_,...S}=t,[R,C]=React__namespace.useState(null),E=useComposedRefs(e,I=>C(I)),A=React__namespace.useRef(!1),M=R?_||!!R.closest("form"):!0;return jsxRuntime.jsxs(RadioProvider,{scope:n,checked:l,disabled:f,children:[jsxRuntime.jsx(Primitive.button,{type:"button",role:"radio","aria-checked":l,"data-state":getState$4(l),"data-disabled":f?"":void 0,disabled:f,value:g,...S,ref:E,onClick:composeEventHandlers(t.onClick,I=>{l||b==null||b(),M&&(A.current=I.isPropagationStopped(),A.current||I.stopPropagation())})}),M&&jsxRuntime.jsx(RadioBubbleInput,{control:R,bubbles:!A.current,name:o,value:g,checked:l,required:d,disabled:f,form:_,style:{transform:"translateX(-100%)"}})]})});Radio.displayName=RADIO_NAME;var INDICATOR_NAME$3="RadioIndicator",RadioIndicator=React__namespace.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:o,...l}=t,d=useRadioContext(INDICATOR_NAME$3,n);return jsxRuntime.jsx(Presence,{present:o||d.checked,children:jsxRuntime.jsx(Primitive.span,{"data-state":getState$4(d.checked),"data-disabled":d.disabled?"":void 0,...l,ref:e})})});RadioIndicator.displayName=INDICATOR_NAME$3;var BUBBLE_INPUT_NAME$3="RadioBubbleInput",RadioBubbleInput=React__namespace.forwardRef(({__scopeRadio:t,control:e,checked:n,bubbles:o=!0,...l},d)=>{const f=React__namespace.useRef(null),g=useComposedRefs(f,d),b=usePrevious(n),_=useSize(e);return React__namespace.useEffect(()=>{const S=f.current;if(!S)return;const R=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(R,"checked").set;if(b!==n&&E){const A=new Event("click",{bubbles:o});E.call(S,n),S.dispatchEvent(A)}},[b,n,o]),jsxRuntime.jsx(Primitive.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...l,tabIndex:-1,ref:g,style:{...l.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});RadioBubbleInput.displayName=BUBBLE_INPUT_NAME$3;function getState$4(t){return t?"checked":"unchecked"}var ARROW_KEYS=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],RADIO_GROUP_NAME$2="RadioGroup",[createRadioGroupContext,createRadioGroupScope]=createContextScope(RADIO_GROUP_NAME$2,[createRovingFocusGroupScope,createRadioScope]),useRovingFocusGroupScope$2=createRovingFocusGroupScope(),useRadioScope=createRadioScope(),[RadioGroupProvider$1,useRadioGroupContext$1]=createRadioGroupContext(RADIO_GROUP_NAME$2),RadioGroup$2=React__namespace.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:o,defaultValue:l,value:d,required:f=!1,disabled:g=!1,orientation:b,dir:_,loop:S=!0,onValueChange:R,...C}=t,E=useRovingFocusGroupScope$2(n),A=useDirection(_),[M,I]=useControllableState({prop:d,defaultProp:l??null,onChange:R,caller:RADIO_GROUP_NAME$2});return jsxRuntime.jsx(RadioGroupProvider$1,{scope:n,name:o,required:f,disabled:g,value:M,onValueChange:I,children:jsxRuntime.jsx(Root$a,{asChild:!0,...E,orientation:b,dir:A,loop:S,children:jsxRuntime.jsx(Primitive.div,{role:"radiogroup","aria-required":f,"aria-orientation":b,"data-disabled":g?"":void 0,dir:A,...C,ref:e})})})});RadioGroup$2.displayName=RADIO_GROUP_NAME$2;var ITEM_NAME$3="RadioGroupItem",RadioGroupItem$1=React__namespace.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:o,...l}=t,d=useRadioGroupContext$1(ITEM_NAME$3,n),f=d.disabled||o,g=useRovingFocusGroupScope$2(n),b=useRadioScope(n),_=React__namespace.useRef(null),S=useComposedRefs(e,_),R=d.value===l.value,C=React__namespace.useRef(!1);return React__namespace.useEffect(()=>{const E=M=>{ARROW_KEYS.includes(M.key)&&(C.current=!0)},A=()=>C.current=!1;return document.addEventListener("keydown",E),document.addEventListener("keyup",A),()=>{document.removeEventListener("keydown",E),document.removeEventListener("keyup",A)}},[]),jsxRuntime.jsx(Item$2,{asChild:!0,...g,focusable:!f,active:R,children:jsxRuntime.jsx(Radio,{disabled:f,required:d.required,checked:R,...b,...l,name:d.name,ref:S,onCheck:()=>d.onValueChange(l.value),onKeyDown:composeEventHandlers(E=>{E.key==="Enter"&&E.preventDefault()}),onFocus:composeEventHandlers(l.onFocus,()=>{var E;C.current&&((E=_.current)==null||E.click())})})})});RadioGroupItem$1.displayName=ITEM_NAME$3;var INDICATOR_NAME2="RadioGroupIndicator",RadioGroupIndicator=React__namespace.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...o}=t,l=useRadioScope(n);return jsxRuntime.jsx(RadioIndicator,{...l,...o,ref:e})});RadioGroupIndicator.displayName=INDICATOR_NAME2;var Root2$7=RadioGroup$2,Item2$2=RadioGroupItem$1,Indicator$1=RadioGroupIndicator;const RadioGroup$1=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx(Root2$7,{className:cn("grid gap-2",t),...e,ref:n}));RadioGroup$1.displayName=Root2$7.displayName;const RadioGroupItem=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx(Item2$2,{ref:n,className:cn("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow-sm focus:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:jsxRuntime.jsx(Indicator$1,{className:"flex items-center justify-center",children:jsxRuntime.jsx(Circle,{className:"h-3.5 w-3.5 fill-primary"})})}));RadioGroupItem.displayName=Item2$2.displayName;function useEscapeKeydown(t,e=globalThis==null?void 0:globalThis.document){const n=useCallbackRef$1(t);React__namespace.useEffect(()=>{const o=l=>{l.key==="Escape"&&n(l)};return e.addEventListener("keydown",o,{capture:!0}),()=>e.removeEventListener("keydown",o,{capture:!0})},[n,e])}var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=React__namespace.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=React__namespace.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:f,onDismiss:g,...b}=t,_=React__namespace.useContext(DismissableLayerContext),[S,R]=React__namespace.useState(null),C=(S==null?void 0:S.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=React__namespace.useState({}),A=useComposedRefs(e,te=>R(te)),M=Array.from(_.layers),[I]=[..._.layersWithOutsidePointerEventsDisabled].slice(-1),j=M.indexOf(I),q=S?M.indexOf(S):-1,z=_.layersWithOutsidePointerEventsDisabled.size>0,Q=q>=j,F=usePointerDownOutside(te=>{const ne=te.target,se=[..._.branches].some(ge=>ge.contains(ne));!Q||se||(l==null||l(te),f==null||f(te),te.defaultPrevented||g==null||g())},C),V=useFocusOutside(te=>{const ne=te.target;[..._.branches].some(ge=>ge.contains(ne))||(d==null||d(te),f==null||f(te),te.defaultPrevented||g==null||g())},C);return useEscapeKeydown(te=>{q===_.layers.size-1&&(o==null||o(te),!te.defaultPrevented&&g&&(te.preventDefault(),g()))},C),React__namespace.useEffect(()=>{if(S)return n&&(_.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),_.layersWithOutsidePointerEventsDisabled.add(S)),_.layers.add(S),dispatchUpdate(),()=>{n&&_.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=originalBodyPointerEvents)}},[S,C,n,_]),React__namespace.useEffect(()=>()=>{S&&(_.layers.delete(S),_.layersWithOutsidePointerEventsDisabled.delete(S),dispatchUpdate())},[S,_]),React__namespace.useEffect(()=>{const te=()=>E({});return document.addEventListener(CONTEXT_UPDATE,te),()=>document.removeEventListener(CONTEXT_UPDATE,te)},[]),jsxRuntime.jsx(Primitive.div,{...b,ref:A,style:{pointerEvents:z?Q?"auto":"none":void 0,...t.style},onFocusCapture:composeEventHandlers(t.onFocusCapture,V.onFocusCapture),onBlurCapture:composeEventHandlers(t.onBlurCapture,V.onBlurCapture),onPointerDownCapture:composeEventHandlers(t.onPointerDownCapture,F.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=React__namespace.forwardRef((t,e)=>{const n=React__namespace.useContext(DismissableLayerContext),o=React__namespace.useRef(null),l=useComposedRefs(e,o);return React__namespace.useEffect(()=>{const d=o.current;if(d)return n.branches.add(d),()=>{n.branches.delete(d)}},[n.branches]),jsxRuntime.jsx(Primitive.div,{...t,ref:l})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(t,e=globalThis==null?void 0:globalThis.document){const n=useCallbackRef$1(t),o=React__namespace.useRef(!1),l=React__namespace.useRef(()=>{});return React__namespace.useEffect(()=>{const d=g=>{if(g.target&&!o.current){let b=function(){handleAndDispatchCustomEvent$1(POINTER_DOWN_OUTSIDE,n,_,{discrete:!0})};const _={originalEvent:g};g.pointerType==="touch"?(e.removeEventListener("click",l.current),l.current=b,e.addEventListener("click",l.current,{once:!0})):b()}else e.removeEventListener("click",l.current);o.current=!1},f=window.setTimeout(()=>{e.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(f),e.removeEventListener("pointerdown",d),e.removeEventListener("click",l.current)}},[e,n]),{onPointerDownCapture:()=>o.current=!0}}function useFocusOutside(t,e=globalThis==null?void 0:globalThis.document){const n=useCallbackRef$1(t),o=React__namespace.useRef(!1);return React__namespace.useEffect(()=>{const l=d=>{d.target&&!o.current&&handleAndDispatchCustomEvent$1(FOCUS_OUTSIDE,n,{originalEvent:d},{discrete:!1})};return e.addEventListener("focusin",l),()=>e.removeEventListener("focusin",l)},[e,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function dispatchUpdate(){const t=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(t)}function handleAndDispatchCustomEvent$1(t,e,n,{discrete:o}){const l=n.originalEvent.target,d=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&l.addEventListener(t,e,{once:!0}),o?dispatchDiscreteCustomEvent(l,d):l.dispatchEvent(d)}var Root$9=DismissableLayer,Branch$1=DismissableLayerBranch,AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",EVENT_OPTIONS={bubbles:!1,cancelable:!0},FOCUS_SCOPE_NAME="FocusScope",FocusScope=React__namespace.forwardRef((t,e)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:l,onUnmountAutoFocus:d,...f}=t,[g,b]=React__namespace.useState(null),_=useCallbackRef$1(l),S=useCallbackRef$1(d),R=React__namespace.useRef(null),C=useComposedRefs(e,M=>b(M)),E=React__namespace.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;React__namespace.useEffect(()=>{if(o){let M=function(z){if(E.paused||!g)return;const Q=z.target;g.contains(Q)?R.current=Q:focus$1(R.current,{select:!0})},I=function(z){if(E.paused||!g)return;const Q=z.relatedTarget;Q!==null&&(g.contains(Q)||focus$1(R.current,{select:!0}))},j=function(z){if(document.activeElement===document.body)for(const F of z)F.removedNodes.length>0&&focus$1(g)};document.addEventListener("focusin",M),document.addEventListener("focusout",I);const q=new MutationObserver(j);return g&&q.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",M),document.removeEventListener("focusout",I),q.disconnect()}}},[o,g,E.paused]),React__namespace.useEffect(()=>{if(g){focusScopesStack.add(E);const M=document.activeElement;if(!g.contains(M)){const j=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS);g.addEventListener(AUTOFOCUS_ON_MOUNT,_),g.dispatchEvent(j),j.defaultPrevented||(focusFirst$2(removeLinks(getTabbableCandidates$1(g)),{select:!0}),document.activeElement===M&&focus$1(g))}return()=>{g.removeEventListener(AUTOFOCUS_ON_MOUNT,_),setTimeout(()=>{const j=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS);g.addEventListener(AUTOFOCUS_ON_UNMOUNT,S),g.dispatchEvent(j),j.defaultPrevented||focus$1(M??document.body,{select:!0}),g.removeEventListener(AUTOFOCUS_ON_UNMOUNT,S),focusScopesStack.remove(E)},0)}}},[g,_,S,E]);const A=React__namespace.useCallback(M=>{if(!n&&!o||E.paused)return;const I=M.key==="Tab"&&!M.altKey&&!M.ctrlKey&&!M.metaKey,j=document.activeElement;if(I&&j){const q=M.currentTarget,[z,Q]=getTabbableEdges(q);z&&Q?!M.shiftKey&&j===Q?(M.preventDefault(),n&&focus$1(z,{select:!0})):M.shiftKey&&j===z&&(M.preventDefault(),n&&focus$1(Q,{select:!0})):j===q&&M.preventDefault()}},[n,o,E.paused]);return jsxRuntime.jsx(Primitive.div,{tabIndex:-1,...f,ref:C,onKeyDown:A})});FocusScope.displayName=FOCUS_SCOPE_NAME;function focusFirst$2(t,{select:e=!1}={}){const n=document.activeElement;for(const o of t)if(focus$1(o,{select:e}),document.activeElement!==n)return}function getTabbableEdges(t){const e=getTabbableCandidates$1(t),n=findVisible(e,t),o=findVisible(e.reverse(),t);return[n,o]}function getTabbableCandidates$1(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const l=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||l?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function findVisible(t,e){for(const n of t)if(!isHidden(n,{upTo:e}))return n}function isHidden(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function isSelectableInput(t){return t instanceof HTMLInputElement&&"select"in t}function focus$1(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&isSelectableInput(t)&&e&&t.select()}}var focusScopesStack=createFocusScopesStack();function createFocusScopesStack(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=arrayRemove(t,e),t.unshift(e)},remove(e){var n;t=arrayRemove(t,e),(n=t[0])==null||n.resume()}}}function arrayRemove(t,e){const n=[...t],o=n.indexOf(e);return o!==-1&&n.splice(o,1),n}function removeLinks(t){return t.filter(e=>e.tagName!=="A")}var PORTAL_NAME$7="Portal",Portal$5=React__namespace.forwardRef((t,e)=>{var g;const{container:n,...o}=t,[l,d]=React__namespace.useState(!1);useLayoutEffect2(()=>d(!0),[]);const f=n||l&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return f?ReactDOM.createPortal(jsxRuntime.jsx(Primitive.div,{...o,ref:e}),f):null});Portal$5.displayName=PORTAL_NAME$7;var count$2=0;function useFocusGuards(){React__namespace.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",t[1]??createFocusGuard()),count$2++,()=>{count$2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),count$2--}},[])}function createFocusGuard(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var __assign$1=function(){return __assign$1=Object.assign||function(e){for(var n,o=1,l=arguments.length;o<l;o++){n=arguments[o];for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&(e[d]=n[d])}return e},__assign$1.apply(this,arguments)};function __rest(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(t);l<o.length;l++)e.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(t,o[l])&&(n[o[l]]=t[o[l]]);return n}function __spreadArray(t,e,n){if(n||arguments.length===2)for(var o=0,l=e.length,d;o<l;o++)(d||!(o in e))&&(d||(d=Array.prototype.slice.call(e,0,o)),d[o]=e[o]);return t.concat(d||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";function assignRef(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function useCallbackRef(t,e){var n=React.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(o){var l=n.value;l!==o&&(n.value=o,n.callback(o,l))}}}})[0];return n.callback=e,n.facade}var useIsomorphicLayoutEffect$3=typeof window<"u"?React__namespace.useLayoutEffect:React__namespace.useEffect,currentValues=new WeakMap;function useMergeRefs(t,e){var n=useCallbackRef(null,function(o){return t.forEach(function(l){return assignRef(l,o)})});return useIsomorphicLayoutEffect$3(function(){var o=currentValues.get(n);if(o){var l=new Set(o),d=new Set(t),f=n.current;l.forEach(function(g){d.has(g)||assignRef(g,null)}),d.forEach(function(g){l.has(g)||assignRef(g,f)})}currentValues.set(n,t)},[t]),n}function ItoI(t){return t}function innerCreateMedium(t,e){e===void 0&&(e=ItoI);var n=[],o=!1,l={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(d){var f=e(d,o);return n.push(f),function(){n=n.filter(function(g){return g!==f})}},assignSyncMedium:function(d){for(o=!0;n.length;){var f=n;n=[],f.forEach(d)}n={push:function(g){return d(g)},filter:function(){return n}}},assignMedium:function(d){o=!0;var f=[];if(n.length){var g=n;n=[],g.forEach(d),f=n}var b=function(){var S=f;f=[],S.forEach(d)},_=function(){return Promise.resolve().then(b)};_(),n={push:function(S){f.push(S),_()},filter:function(S){return f=f.filter(S),n}}}};return l}function createSidecarMedium(t){t===void 0&&(t={});var e=innerCreateMedium(null);return e.options=__assign$1({async:!0,ssr:!1},t),e}var SideCar$1=function(t){var e=t.sideCar,n=__rest(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=e.read();if(!o)throw new Error("Sidecar medium not found");return React__namespace.createElement(o,__assign$1({},n))};SideCar$1.isSideCarExport=!0;function exportSidecar(t,e){return t.useMedium(e),SideCar$1}var effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=React__namespace.forwardRef(function(t,e){var n=React__namespace.useRef(null),o=React__namespace.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),l=o[0],d=o[1],f=t.forwardProps,g=t.children,b=t.className,_=t.removeScrollBar,S=t.enabled,R=t.shards,C=t.sideCar,E=t.noRelative,A=t.noIsolation,M=t.inert,I=t.allowPinchZoom,j=t.as,q=j===void 0?"div":j,z=t.gapMode,Q=__rest(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),F=C,V=useMergeRefs([n,e]),te=__assign$1(__assign$1({},Q),l);return React__namespace.createElement(React__namespace.Fragment,null,S&&React__namespace.createElement(F,{sideCar:effectCar,removeScrollBar:_,shards:R,noRelative:E,noIsolation:A,inert:M,setCallbacks:d,allowPinchZoom:!!I,lockRef:n,gapMode:z}),f?React__namespace.cloneElement(React__namespace.Children.only(g),__assign$1(__assign$1({},te),{ref:V})):React__namespace.createElement(q,__assign$1({},te,{className:b,ref:V}),g))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=getNonce();return e&&t.setAttribute("nonce",e),t}function injectStyles(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function insertStyleTag(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var stylesheetSingleton=function(){var t=0,e=null;return{add:function(n){t==0&&(e=makeStyleTag())&&(injectStyles(e,n),insertStyleTag(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},styleHookSingleton=function(){var t=stylesheetSingleton();return function(e,n){React__namespace.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},styleSingleton=function(){var t=styleHookSingleton(),e=function(n){var o=n.styles,l=n.dynamic;return t(o,l),null};return e},zeroGap={left:0,top:0,right:0,gap:0},parse=function(t){return parseInt(t||"",10)||0},getOffset$1=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],o=e[t==="padding"?"paddingTop":"marginTop"],l=e[t==="padding"?"paddingRight":"marginRight"];return[parse(n),parse(o),parse(l)]},getGapWidth=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return zeroGap;var e=getOffset$1(t),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,o-n+e[2]-e[0])}},Style=styleSingleton(),lockAttribute="data-scroll-locked",getStyles=function(t,e,n,o){var l=t.left,d=t.top,f=t.right,g=t.gap;return n===void 0&&(n="margin"),`
|
|
425
|
+
*/const __iconNode=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],X$1=createLucideIcon("X",__iconNode);function r(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var l=t.length;for(e=0;e<l;e++)t[e]&&(n=r(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function clsx(){for(var t,e,n=0,o="",l=arguments.length;n<l;n++)(t=arguments[n])&&(e=r(t))&&(o&&(o+=" "),o+=e);return o}const CLASS_PART_SEPARATOR="-",createClassGroupUtils=t=>{const e=createClassMap(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=t;return{getClassGroupId:f=>{const g=f.split(CLASS_PART_SEPARATOR);return g[0]===""&&g.length!==1&&g.shift(),getGroupRecursive(g,e)||getGroupIdForArbitraryProperty(f)},getConflictingClassGroupIds:(f,g)=>{const b=n[f]||[];return g&&o[f]?[...b,...o[f]]:b}}},getGroupRecursive=(t,e)=>{var f;if(t.length===0)return e.classGroupId;const n=t[0],o=e.nextPart.get(n),l=o?getGroupRecursive(t.slice(1),o):void 0;if(l)return l;if(e.validators.length===0)return;const d=t.join(CLASS_PART_SEPARATOR);return(f=e.validators.find(({validator:g})=>g(d)))==null?void 0:f.classGroupId},arbitraryPropertyRegex=/^\[(.+)\]$/,getGroupIdForArbitraryProperty=t=>{if(arbitraryPropertyRegex.test(t)){const e=arbitraryPropertyRegex.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},createClassMap=t=>{const{theme:e,classGroups:n}=t,o={nextPart:new Map,validators:[]};for(const l in n)processClassesRecursively(n[l],o,l,e);return o},processClassesRecursively=(t,e,n,o)=>{t.forEach(l=>{if(typeof l=="string"){const d=l===""?e:getPart(e,l);d.classGroupId=n;return}if(typeof l=="function"){if(isThemeGetter(l)){processClassesRecursively(l(o),e,n,o);return}e.validators.push({validator:l,classGroupId:n});return}Object.entries(l).forEach(([d,f])=>{processClassesRecursively(f,getPart(e,d),n,o)})})},getPart=(t,e)=>{let n=t;return e.split(CLASS_PART_SEPARATOR).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},isThemeGetter=t=>t.isThemeGetter,createLruCache=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,o=new Map;const l=(d,f)=>{n.set(d,f),e++,e>t&&(e=0,o=n,n=new Map)};return{get(d){let f=n.get(d);if(f!==void 0)return f;if((f=o.get(d))!==void 0)return l(d,f),f},set(d,f){n.has(d)?n.set(d,f):l(d,f)}}},IMPORTANT_MODIFIER="!",MODIFIER_SEPARATOR=":",MODIFIER_SEPARATOR_LENGTH=MODIFIER_SEPARATOR.length,createParseClassName=t=>{const{prefix:e,experimentalParseClassName:n}=t;let o=l=>{const d=[];let f=0,g=0,b=0,_;for(let A=0;A<l.length;A++){let M=l[A];if(f===0&&g===0){if(M===MODIFIER_SEPARATOR){d.push(l.slice(b,A)),b=A+MODIFIER_SEPARATOR_LENGTH;continue}if(M==="/"){_=A;continue}}M==="["?f++:M==="]"?f--:M==="("?g++:M===")"&&g--}const S=d.length===0?l:l.substring(b),R=stripImportantModifier(S),C=R!==S,E=_&&_>b?_-b:void 0;return{modifiers:d,hasImportantModifier:C,baseClassName:R,maybePostfixModifierPosition:E}};if(e){const l=e+MODIFIER_SEPARATOR,d=o;o=f=>f.startsWith(l)?d(f.substring(l.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:f,maybePostfixModifierPosition:void 0}}if(n){const l=o;o=d=>n({className:d,parseClassName:l})}return o},stripImportantModifier=t=>t.endsWith(IMPORTANT_MODIFIER)?t.substring(0,t.length-1):t.startsWith(IMPORTANT_MODIFIER)?t.substring(1):t,createSortModifiers=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const l=[];let d=[];return o.forEach(f=>{f[0]==="["||e[f]?(l.push(...d.sort(),f),d=[]):d.push(f)}),l.push(...d.sort()),l}},createConfigUtils=t=>({cache:createLruCache(t.cacheSize),parseClassName:createParseClassName(t),sortModifiers:createSortModifiers(t),...createClassGroupUtils(t)}),SPLIT_CLASSES_REGEX=/\s+/,mergeClassList=(t,e)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:l,sortModifiers:d}=e,f=[],g=t.trim().split(SPLIT_CLASSES_REGEX);let b="";for(let _=g.length-1;_>=0;_-=1){const S=g[_],{isExternal:R,modifiers:C,hasImportantModifier:E,baseClassName:A,maybePostfixModifierPosition:M}=n(S);if(R){b=S+(b.length>0?" "+b:b);continue}let I=!!M,j=o(I?A.substring(0,M):A);if(!j){if(!I){b=S+(b.length>0?" "+b:b);continue}if(j=o(A),!j){b=S+(b.length>0?" "+b:b);continue}I=!1}const q=d(C).join(":"),z=E?q+IMPORTANT_MODIFIER:q,Q=z+j;if(f.includes(Q))continue;f.push(Q);const F=l(j,I);for(let V=0;V<F.length;++V){const te=F[V];f.push(z+te)}b=S+(b.length>0?" "+b:b)}return b};function twJoin(){let t=0,e,n,o="";for(;t<arguments.length;)(e=arguments[t++])&&(n=toValue(e))&&(o&&(o+=" "),o+=n);return o}const toValue=t=>{if(typeof t=="string")return t;let e,n="";for(let o=0;o<t.length;o++)t[o]&&(e=toValue(t[o]))&&(n&&(n+=" "),n+=e);return n};function createTailwindMerge(t,...e){let n,o,l,d=f;function f(b){const _=e.reduce((S,R)=>R(S),t());return n=createConfigUtils(_),o=n.cache.get,l=n.cache.set,d=g,g(b)}function g(b){const _=o(b);if(_)return _;const S=mergeClassList(b,n);return l(b,S),S}return function(){return d(twJoin.apply(null,arguments))}}const fromTheme=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},arbitraryValueRegex=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,arbitraryVariableRegex=/^\((?:(\w[\w-]*):)?(.+)\)$/i,fractionRegex=/^\d+\/\d+$/,tshirtUnitRegex=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lengthUnitRegex=/\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$/,colorFunctionRegex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,shadowRegex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,imageRegex=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,isFraction=t=>fractionRegex.test(t),isNumber$4=t=>!!t&&!Number.isNaN(Number(t)),isInteger=t=>!!t&&Number.isInteger(Number(t)),isPercent$1=t=>t.endsWith("%")&&isNumber$4(t.slice(0,-1)),isTshirtSize=t=>tshirtUnitRegex.test(t),isAny=()=>!0,isLengthOnly=t=>lengthUnitRegex.test(t)&&!colorFunctionRegex.test(t),isNever=()=>!1,isShadow=t=>shadowRegex.test(t),isImage=t=>imageRegex.test(t),isAnyNonArbitrary=t=>!isArbitraryValue(t)&&!isArbitraryVariable(t),isArbitrarySize=t=>getIsArbitraryValue(t,isLabelSize,isNever),isArbitraryValue=t=>arbitraryValueRegex.test(t),isArbitraryLength=t=>getIsArbitraryValue(t,isLabelLength,isLengthOnly),isArbitraryNumber=t=>getIsArbitraryValue(t,isLabelNumber,isNumber$4),isArbitraryPosition=t=>getIsArbitraryValue(t,isLabelPosition,isNever),isArbitraryImage=t=>getIsArbitraryValue(t,isLabelImage,isImage),isArbitraryShadow=t=>getIsArbitraryValue(t,isLabelShadow,isShadow),isArbitraryVariable=t=>arbitraryVariableRegex.test(t),isArbitraryVariableLength=t=>getIsArbitraryVariable(t,isLabelLength),isArbitraryVariableFamilyName=t=>getIsArbitraryVariable(t,isLabelFamilyName),isArbitraryVariablePosition=t=>getIsArbitraryVariable(t,isLabelPosition),isArbitraryVariableSize=t=>getIsArbitraryVariable(t,isLabelSize),isArbitraryVariableImage=t=>getIsArbitraryVariable(t,isLabelImage),isArbitraryVariableShadow=t=>getIsArbitraryVariable(t,isLabelShadow,!0),getIsArbitraryValue=(t,e,n)=>{const o=arbitraryValueRegex.exec(t);return o?o[1]?e(o[1]):n(o[2]):!1},getIsArbitraryVariable=(t,e,n=!1)=>{const o=arbitraryVariableRegex.exec(t);return o?o[1]?e(o[1]):n:!1},isLabelPosition=t=>t==="position"||t==="percentage",isLabelImage=t=>t==="image"||t==="url",isLabelSize=t=>t==="length"||t==="size"||t==="bg-size",isLabelLength=t=>t==="length",isLabelNumber=t=>t==="number",isLabelFamilyName=t=>t==="family-name",isLabelShadow=t=>t==="shadow",getDefaultConfig=()=>{const t=fromTheme("color"),e=fromTheme("font"),n=fromTheme("text"),o=fromTheme("font-weight"),l=fromTheme("tracking"),d=fromTheme("leading"),f=fromTheme("breakpoint"),g=fromTheme("container"),b=fromTheme("spacing"),_=fromTheme("radius"),S=fromTheme("shadow"),R=fromTheme("inset-shadow"),C=fromTheme("text-shadow"),E=fromTheme("drop-shadow"),A=fromTheme("blur"),M=fromTheme("perspective"),I=fromTheme("aspect"),j=fromTheme("ease"),q=fromTheme("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],F=()=>[...Q(),isArbitraryVariable,isArbitraryValue],V=()=>["auto","hidden","clip","visible","scroll"],te=()=>["auto","contain","none"],ne=()=>[isArbitraryVariable,isArbitraryValue,b],se=()=>[isFraction,"full","auto",...ne()],ge=()=>[isInteger,"none","subgrid",isArbitraryVariable,isArbitraryValue],oe=()=>["auto",{span:["full",isInteger,isArbitraryVariable,isArbitraryValue]},isInteger,isArbitraryVariable,isArbitraryValue],Ae=()=>[isInteger,"auto",isArbitraryVariable,isArbitraryValue],je=()=>["auto","min","max","fr",isArbitraryVariable,isArbitraryValue],Ne=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Oe=()=>["start","end","center","stretch","center-safe","end-safe"],Fe=()=>["auto",...ne()],ze=()=>[isFraction,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...ne()],$e=()=>[t,isArbitraryVariable,isArbitraryValue],Be=()=>[...Q(),isArbitraryVariablePosition,isArbitraryPosition,{position:[isArbitraryVariable,isArbitraryValue]}],qe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Ge=()=>["auto","cover","contain",isArbitraryVariableSize,isArbitrarySize,{size:[isArbitraryVariable,isArbitraryValue]}],He=()=>[isPercent$1,isArbitraryVariableLength,isArbitraryLength],Ze=()=>["","none","full",_,isArbitraryVariable,isArbitraryValue],tt=()=>["",isNumber$4,isArbitraryVariableLength,isArbitraryLength],Ye=()=>["solid","dashed","dotted","double"],Qe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Xe=()=>[isNumber$4,isPercent$1,isArbitraryVariablePosition,isArbitraryPosition],st=()=>["","none",A,isArbitraryVariable,isArbitraryValue],rt=()=>["none",isNumber$4,isArbitraryVariable,isArbitraryValue],at=()=>["none",isNumber$4,isArbitraryVariable,isArbitraryValue],ot=()=>[isNumber$4,isArbitraryVariable,isArbitraryValue],Ue=()=>[isFraction,"full",...ne()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[isTshirtSize],breakpoint:[isTshirtSize],color:[isAny],container:[isTshirtSize],"drop-shadow":[isTshirtSize],ease:["in","out","in-out"],font:[isAnyNonArbitrary],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[isTshirtSize],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[isTshirtSize],shadow:[isTshirtSize],spacing:["px",isNumber$4],text:[isTshirtSize],"text-shadow":[isTshirtSize],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",isFraction,isArbitraryValue,isArbitraryVariable,I]}],container:["container"],columns:[{columns:[isNumber$4,isArbitraryValue,isArbitraryVariable,g]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:F()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:te()}],"overscroll-x":[{"overscroll-x":te()}],"overscroll-y":[{"overscroll-y":te()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:se()}],"inset-x":[{"inset-x":se()}],"inset-y":[{"inset-y":se()}],start:[{start:se()}],end:[{end:se()}],top:[{top:se()}],right:[{right:se()}],bottom:[{bottom:se()}],left:[{left:se()}],visibility:["visible","invisible","collapse"],z:[{z:[isInteger,"auto",isArbitraryVariable,isArbitraryValue]}],basis:[{basis:[isFraction,"full","auto",g,...ne()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[isNumber$4,isFraction,"auto","initial","none",isArbitraryValue]}],grow:[{grow:["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],shrink:[{shrink:["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],order:[{order:[isInteger,"first","last","none",isArbitraryVariable,isArbitraryValue]}],"grid-cols":[{"grid-cols":ge()}],"col-start-end":[{col:oe()}],"col-start":[{"col-start":Ae()}],"col-end":[{"col-end":Ae()}],"grid-rows":[{"grid-rows":ge()}],"row-start-end":[{row:oe()}],"row-start":[{"row-start":Ae()}],"row-end":[{"row-end":Ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":je()}],"auto-rows":[{"auto-rows":je()}],gap:[{gap:ne()}],"gap-x":[{"gap-x":ne()}],"gap-y":[{"gap-y":ne()}],"justify-content":[{justify:[...Ne(),"normal"]}],"justify-items":[{"justify-items":[...Oe(),"normal"]}],"justify-self":[{"justify-self":["auto",...Oe()]}],"align-content":[{content:["normal",...Ne()]}],"align-items":[{items:[...Oe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Oe(),{baseline:["","last"]}]}],"place-content":[{"place-content":Ne()}],"place-items":[{"place-items":[...Oe(),"baseline"]}],"place-self":[{"place-self":["auto",...Oe()]}],p:[{p:ne()}],px:[{px:ne()}],py:[{py:ne()}],ps:[{ps:ne()}],pe:[{pe:ne()}],pt:[{pt:ne()}],pr:[{pr:ne()}],pb:[{pb:ne()}],pl:[{pl:ne()}],m:[{m:Fe()}],mx:[{mx:Fe()}],my:[{my:Fe()}],ms:[{ms:Fe()}],me:[{me:Fe()}],mt:[{mt:Fe()}],mr:[{mr:Fe()}],mb:[{mb:Fe()}],ml:[{ml:Fe()}],"space-x":[{"space-x":ne()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":ne()}],"space-y-reverse":["space-y-reverse"],size:[{size:ze()}],w:[{w:[g,"screen",...ze()]}],"min-w":[{"min-w":[g,"screen","none",...ze()]}],"max-w":[{"max-w":[g,"screen","none","prose",{screen:[f]},...ze()]}],h:[{h:["screen","lh",...ze()]}],"min-h":[{"min-h":["screen","lh","none",...ze()]}],"max-h":[{"max-h":["screen","lh",...ze()]}],"font-size":[{text:["base",n,isArbitraryVariableLength,isArbitraryLength]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,isArbitraryVariable,isArbitraryNumber]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",isPercent$1,isArbitraryValue]}],"font-family":[{font:[isArbitraryVariableFamilyName,isArbitraryValue,e]}],"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:[l,isArbitraryVariable,isArbitraryValue]}],"line-clamp":[{"line-clamp":[isNumber$4,"none",isArbitraryVariable,isArbitraryNumber]}],leading:[{leading:[d,...ne()]}],"list-image":[{"list-image":["none",isArbitraryVariable,isArbitraryValue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",isArbitraryVariable,isArbitraryValue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$e()}],"text-color":[{text:$e()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ye(),"wavy"]}],"text-decoration-thickness":[{decoration:[isNumber$4,"from-font","auto",isArbitraryVariable,isArbitraryLength]}],"text-decoration-color":[{decoration:$e()}],"underline-offset":[{"underline-offset":[isNumber$4,"auto",isArbitraryVariable,isArbitraryValue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ne()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",isArbitraryVariable,isArbitraryValue]}],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",isArbitraryVariable,isArbitraryValue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Be()}],"bg-repeat":[{bg:qe()}],"bg-size":[{bg:Ge()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},isInteger,isArbitraryVariable,isArbitraryValue],radial:["",isArbitraryVariable,isArbitraryValue],conic:[isInteger,isArbitraryVariable,isArbitraryValue]},isArbitraryVariableImage,isArbitraryImage]}],"bg-color":[{bg:$e()}],"gradient-from-pos":[{from:He()}],"gradient-via-pos":[{via:He()}],"gradient-to-pos":[{to:He()}],"gradient-from":[{from:$e()}],"gradient-via":[{via:$e()}],"gradient-to":[{to:$e()}],rounded:[{rounded:Ze()}],"rounded-s":[{"rounded-s":Ze()}],"rounded-e":[{"rounded-e":Ze()}],"rounded-t":[{"rounded-t":Ze()}],"rounded-r":[{"rounded-r":Ze()}],"rounded-b":[{"rounded-b":Ze()}],"rounded-l":[{"rounded-l":Ze()}],"rounded-ss":[{"rounded-ss":Ze()}],"rounded-se":[{"rounded-se":Ze()}],"rounded-ee":[{"rounded-ee":Ze()}],"rounded-es":[{"rounded-es":Ze()}],"rounded-tl":[{"rounded-tl":Ze()}],"rounded-tr":[{"rounded-tr":Ze()}],"rounded-br":[{"rounded-br":Ze()}],"rounded-bl":[{"rounded-bl":Ze()}],"border-w":[{border:tt()}],"border-w-x":[{"border-x":tt()}],"border-w-y":[{"border-y":tt()}],"border-w-s":[{"border-s":tt()}],"border-w-e":[{"border-e":tt()}],"border-w-t":[{"border-t":tt()}],"border-w-r":[{"border-r":tt()}],"border-w-b":[{"border-b":tt()}],"border-w-l":[{"border-l":tt()}],"divide-x":[{"divide-x":tt()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":tt()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ye(),"hidden","none"]}],"divide-style":[{divide:[...Ye(),"hidden","none"]}],"border-color":[{border:$e()}],"border-color-x":[{"border-x":$e()}],"border-color-y":[{"border-y":$e()}],"border-color-s":[{"border-s":$e()}],"border-color-e":[{"border-e":$e()}],"border-color-t":[{"border-t":$e()}],"border-color-r":[{"border-r":$e()}],"border-color-b":[{"border-b":$e()}],"border-color-l":[{"border-l":$e()}],"divide-color":[{divide:$e()}],"outline-style":[{outline:[...Ye(),"none","hidden"]}],"outline-offset":[{"outline-offset":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"outline-w":[{outline:["",isNumber$4,isArbitraryVariableLength,isArbitraryLength]}],"outline-color":[{outline:$e()}],shadow:[{shadow:["","none",S,isArbitraryVariableShadow,isArbitraryShadow]}],"shadow-color":[{shadow:$e()}],"inset-shadow":[{"inset-shadow":["none",R,isArbitraryVariableShadow,isArbitraryShadow]}],"inset-shadow-color":[{"inset-shadow":$e()}],"ring-w":[{ring:tt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$e()}],"ring-offset-w":[{"ring-offset":[isNumber$4,isArbitraryLength]}],"ring-offset-color":[{"ring-offset":$e()}],"inset-ring-w":[{"inset-ring":tt()}],"inset-ring-color":[{"inset-ring":$e()}],"text-shadow":[{"text-shadow":["none",C,isArbitraryVariableShadow,isArbitraryShadow]}],"text-shadow-color":[{"text-shadow":$e()}],opacity:[{opacity:[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"mix-blend":[{"mix-blend":[...Qe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Qe()}],"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":[isNumber$4]}],"mask-image-linear-from-pos":[{"mask-linear-from":Xe()}],"mask-image-linear-to-pos":[{"mask-linear-to":Xe()}],"mask-image-linear-from-color":[{"mask-linear-from":$e()}],"mask-image-linear-to-color":[{"mask-linear-to":$e()}],"mask-image-t-from-pos":[{"mask-t-from":Xe()}],"mask-image-t-to-pos":[{"mask-t-to":Xe()}],"mask-image-t-from-color":[{"mask-t-from":$e()}],"mask-image-t-to-color":[{"mask-t-to":$e()}],"mask-image-r-from-pos":[{"mask-r-from":Xe()}],"mask-image-r-to-pos":[{"mask-r-to":Xe()}],"mask-image-r-from-color":[{"mask-r-from":$e()}],"mask-image-r-to-color":[{"mask-r-to":$e()}],"mask-image-b-from-pos":[{"mask-b-from":Xe()}],"mask-image-b-to-pos":[{"mask-b-to":Xe()}],"mask-image-b-from-color":[{"mask-b-from":$e()}],"mask-image-b-to-color":[{"mask-b-to":$e()}],"mask-image-l-from-pos":[{"mask-l-from":Xe()}],"mask-image-l-to-pos":[{"mask-l-to":Xe()}],"mask-image-l-from-color":[{"mask-l-from":$e()}],"mask-image-l-to-color":[{"mask-l-to":$e()}],"mask-image-x-from-pos":[{"mask-x-from":Xe()}],"mask-image-x-to-pos":[{"mask-x-to":Xe()}],"mask-image-x-from-color":[{"mask-x-from":$e()}],"mask-image-x-to-color":[{"mask-x-to":$e()}],"mask-image-y-from-pos":[{"mask-y-from":Xe()}],"mask-image-y-to-pos":[{"mask-y-to":Xe()}],"mask-image-y-from-color":[{"mask-y-from":$e()}],"mask-image-y-to-color":[{"mask-y-to":$e()}],"mask-image-radial":[{"mask-radial":[isArbitraryVariable,isArbitraryValue]}],"mask-image-radial-from-pos":[{"mask-radial-from":Xe()}],"mask-image-radial-to-pos":[{"mask-radial-to":Xe()}],"mask-image-radial-from-color":[{"mask-radial-from":$e()}],"mask-image-radial-to-color":[{"mask-radial-to":$e()}],"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":Q()}],"mask-image-conic-pos":[{"mask-conic":[isNumber$4]}],"mask-image-conic-from-pos":[{"mask-conic-from":Xe()}],"mask-image-conic-to-pos":[{"mask-conic-to":Xe()}],"mask-image-conic-from-color":[{"mask-conic-from":$e()}],"mask-image-conic-to-color":[{"mask-conic-to":$e()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Be()}],"mask-repeat":[{mask:qe()}],"mask-size":[{mask:Ge()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",isArbitraryVariable,isArbitraryValue]}],filter:[{filter:["","none",isArbitraryVariable,isArbitraryValue]}],blur:[{blur:st()}],brightness:[{brightness:[isNumber$4,isArbitraryVariable,isArbitraryValue]}],contrast:[{contrast:[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"drop-shadow":[{"drop-shadow":["","none",E,isArbitraryVariableShadow,isArbitraryShadow]}],"drop-shadow-color":[{"drop-shadow":$e()}],grayscale:[{grayscale:["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],"hue-rotate":[{"hue-rotate":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],invert:[{invert:["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],saturate:[{saturate:[isNumber$4,isArbitraryVariable,isArbitraryValue]}],sepia:[{sepia:["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-filter":[{"backdrop-filter":["","none",isArbitraryVariable,isArbitraryValue]}],"backdrop-blur":[{"backdrop-blur":st()}],"backdrop-brightness":[{"backdrop-brightness":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-contrast":[{"backdrop-contrast":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-invert":[{"backdrop-invert":["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-opacity":[{"backdrop-opacity":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-saturate":[{"backdrop-saturate":[isNumber$4,isArbitraryVariable,isArbitraryValue]}],"backdrop-sepia":[{"backdrop-sepia":["",isNumber$4,isArbitraryVariable,isArbitraryValue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":ne()}],"border-spacing-x":[{"border-spacing-x":ne()}],"border-spacing-y":[{"border-spacing-y":ne()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",isArbitraryVariable,isArbitraryValue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[isNumber$4,"initial",isArbitraryVariable,isArbitraryValue]}],ease:[{ease:["linear","initial",j,isArbitraryVariable,isArbitraryValue]}],delay:[{delay:[isNumber$4,isArbitraryVariable,isArbitraryValue]}],animate:[{animate:["none",q,isArbitraryVariable,isArbitraryValue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[M,isArbitraryVariable,isArbitraryValue]}],"perspective-origin":[{"perspective-origin":F()}],rotate:[{rotate:rt()}],"rotate-x":[{"rotate-x":rt()}],"rotate-y":[{"rotate-y":rt()}],"rotate-z":[{"rotate-z":rt()}],scale:[{scale:at()}],"scale-x":[{"scale-x":at()}],"scale-y":[{"scale-y":at()}],"scale-z":[{"scale-z":at()}],"scale-3d":["scale-3d"],skew:[{skew:ot()}],"skew-x":[{"skew-x":ot()}],"skew-y":[{"skew-y":ot()}],transform:[{transform:[isArbitraryVariable,isArbitraryValue,"","none","gpu","cpu"]}],"transform-origin":[{origin:F()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ue()}],"translate-x":[{"translate-x":Ue()}],"translate-y":[{"translate-y":Ue()}],"translate-z":[{"translate-z":Ue()}],"translate-none":["translate-none"],accent:[{accent:$e()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$e()}],"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",isArbitraryVariable,isArbitraryValue]}],"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":ne()}],"scroll-mx":[{"scroll-mx":ne()}],"scroll-my":[{"scroll-my":ne()}],"scroll-ms":[{"scroll-ms":ne()}],"scroll-me":[{"scroll-me":ne()}],"scroll-mt":[{"scroll-mt":ne()}],"scroll-mr":[{"scroll-mr":ne()}],"scroll-mb":[{"scroll-mb":ne()}],"scroll-ml":[{"scroll-ml":ne()}],"scroll-p":[{"scroll-p":ne()}],"scroll-px":[{"scroll-px":ne()}],"scroll-py":[{"scroll-py":ne()}],"scroll-ps":[{"scroll-ps":ne()}],"scroll-pe":[{"scroll-pe":ne()}],"scroll-pt":[{"scroll-pt":ne()}],"scroll-pr":[{"scroll-pr":ne()}],"scroll-pb":[{"scroll-pb":ne()}],"scroll-pl":[{"scroll-pl":ne()}],"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",isArbitraryVariable,isArbitraryValue]}],fill:[{fill:["none",...$e()]}],"stroke-w":[{stroke:[isNumber$4,isArbitraryVariableLength,isArbitraryLength,isArbitraryNumber]}],stroke:[{stroke:["none",...$e()]}],"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"]}},twMerge=createTailwindMerge(getDefaultConfig);function cn(...t){return twMerge(clsx(t))}const formatNumber=(t,e)=>new Intl.NumberFormat("en-CA",e).format(t),formatMoney=(t,e)=>{const n={style:"currency",currency:"CAD",minimumFractionDigits:2,maximumFractionDigits:2,...e};return new Intl.NumberFormat("en-CA",n).format(t)},formatYYYYMMDDIntToDateString=t=>{if(t===null||typeof t>"u")return"—";const e=t.toString();if(e.length===8){const n=e.substring(0,4),o=e.substring(4,6),l=e.substring(6,8);return`${n}-${o}-${l}`}return e};function InputOTP({className:t,containerClassName:e,...n}){return jsxRuntime.jsx(Lt,{"data-slot":"input-otp",containerClassName:cn("flex items-center gap-2 has-disabled:opacity-50",e),className:cn("disabled:cursor-not-allowed",t),...n})}function InputOTPGroup({className:t,...e}){return jsxRuntime.jsx("div",{"data-slot":"input-otp-group",className:cn("flex items-center",t),...e})}function InputOTPSlot({index:t,className:e,...n}){const o=React__namespace.useContext(jt),{char:l,hasFakeCaret:d,isActive:f}=(o==null?void 0:o.slots[t])??{};return jsxRuntime.jsxs("div",{"data-slot":"input-otp-slot","data-active":f,className:cn("border-input data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",e),...n,children:[l,d&&jsxRuntime.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function InputOTPSeparator({...t}){return jsxRuntime.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:jsxRuntime.jsx(Minus,{})})}function composeEventHandlers(t,e,{checkForDefaultPrevented:n=!0}={}){return function(l){if(t==null||t(l),n===!1||!l.defaultPrevented)return e==null?void 0:e(l)}}function setRef(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function composeRefs(...t){return e=>{let n=!1;const o=t.map(l=>{const d=setRef(l,e);return!n&&typeof d=="function"&&(n=!0),d});if(n)return()=>{for(let l=0;l<o.length;l++){const d=o[l];typeof d=="function"?d():setRef(t[l],null)}}}}function useComposedRefs(...t){return React__namespace.useCallback(composeRefs(...t),t)}function createContext2(t,e){const n=React__namespace.createContext(e),o=d=>{const{children:f,...g}=d,b=React__namespace.useMemo(()=>g,Object.values(g));return jsxRuntime.jsx(n.Provider,{value:b,children:f})};o.displayName=t+"Provider";function l(d){const f=React__namespace.useContext(n);if(f)return f;if(e!==void 0)return e;throw new Error(`\`${d}\` must be used within \`${t}\``)}return[o,l]}function createContextScope(t,e=[]){let n=[];function o(d,f){const g=React__namespace.createContext(f),b=n.length;n=[...n,f];const _=R=>{var j;const{scope:C,children:E,...A}=R,M=((j=C==null?void 0:C[t])==null?void 0:j[b])||g,I=React__namespace.useMemo(()=>A,Object.values(A));return jsxRuntime.jsx(M.Provider,{value:I,children:E})};_.displayName=d+"Provider";function S(R,C){var M;const E=((M=C==null?void 0:C[t])==null?void 0:M[b])||g,A=React__namespace.useContext(E);if(A)return A;if(f!==void 0)return f;throw new Error(`\`${R}\` must be used within \`${d}\``)}return[_,S]}const l=()=>{const d=n.map(f=>React__namespace.createContext(f));return function(g){const b=(g==null?void 0:g[t])||d;return React__namespace.useMemo(()=>({[`__scope${t}`]:{...g,[t]:b}}),[g,b])}};return l.scopeName=t,[o,composeContextScopes(l,...e)]}function composeContextScopes(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const o=t.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(d){const f=o.reduce((g,{useScope:b,scopeName:_})=>{const R=b(d)[`__scope${_}`];return{...g,...R}},{});return React__namespace.useMemo(()=>({[`__scope${e.scopeName}`]:f}),[f])}};return n.scopeName=e.scopeName,n}function createSlot(t){const e=createSlotClone(t),n=React__namespace.forwardRef((o,l)=>{const{children:d,...f}=o,g=React__namespace.Children.toArray(d),b=g.find(isSlottable);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(e,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(e,{...f,ref:l,children:d})});return n.displayName=`${t}.Slot`,n}var Slot$4=createSlot("Slot");function createSlotClone(t){const e=React__namespace.forwardRef((n,o)=>{const{children:l,...d}=n;if(React__namespace.isValidElement(l)){const f=getElementRef$1(l),g=mergeProps(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var SLOTTABLE_IDENTIFIER=Symbol("radix.slottable");function createSlottable(t){const e=({children:n})=>jsxRuntime.jsx(jsxRuntime.Fragment,{children:n});return e.displayName=`${t}.Slottable`,e.__radixId=SLOTTABLE_IDENTIFIER,e}function isSlottable(t){return React__namespace.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===SLOTTABLE_IDENTIFIER}function mergeProps(t,e){const n={...e};for(const o in e){const l=t[o],d=e[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...t,...n}}function getElementRef$1(t){var o,l;let e=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(l=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:l.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Primitive=NODES.reduce((t,e)=>{const n=createSlot(`Primitive.${e}`),o=React__namespace.forwardRef((l,d)=>{const{asChild:f,...g}=l,b=f?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntime.jsx(b,{...g,ref:d})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{});function dispatchDiscreteCustomEvent(t,e){t&&ReactDOM__namespace.flushSync(()=>t.dispatchEvent(e))}function createCollection(t){const e=t+"CollectionProvider",[n,o]=createContextScope(e),[l,d]=n(e,{collectionRef:{current:null},itemMap:new Map}),f=M=>{const{scope:I,children:j}=M,q=React.useRef(null),z=React.useRef(new Map).current;return jsxRuntime.jsx(l,{scope:I,itemMap:z,collectionRef:q,children:j})};f.displayName=e;const g=t+"CollectionSlot",b=createSlot(g),_=React.forwardRef((M,I)=>{const{scope:j,children:q}=M,z=d(g,j),Q=useComposedRefs(I,z.collectionRef);return jsxRuntime.jsx(b,{ref:Q,children:q})});_.displayName=g;const S=t+"CollectionItemSlot",R="data-radix-collection-item",C=createSlot(S),E=React.forwardRef((M,I)=>{const{scope:j,children:q,...z}=M,Q=React.useRef(null),F=useComposedRefs(I,Q),V=d(S,j);return React.useEffect(()=>(V.itemMap.set(Q,{ref:Q,...z}),()=>void V.itemMap.delete(Q))),jsxRuntime.jsx(C,{[R]:"",ref:F,children:q})});E.displayName=S;function A(M){const I=d(t+"CollectionConsumer",M);return React.useCallback(()=>{const q=I.collectionRef.current;if(!q)return[];const z=Array.from(q.querySelectorAll(`[${R}]`));return Array.from(I.itemMap.values()).sort((V,te)=>z.indexOf(V.ref.current)-z.indexOf(te.ref.current))},[I.collectionRef,I.itemMap])}return[{Provider:f,Slot:_,ItemSlot:E},A,o]}var useLayoutEffect2=globalThis!=null&&globalThis.document?React__namespace.useLayoutEffect:()=>{},useReactId=React__namespace[" useId ".trim().toString()]||(()=>{}),count$3=0;function useId(t){const[e,n]=React__namespace.useState(useReactId());return useLayoutEffect2(()=>{n(o=>o??String(count$3++))},[t]),e?`radix-${e}`:""}function useCallbackRef$1(t){const e=React__namespace.useRef(t);return React__namespace.useEffect(()=>{e.current=t}),React__namespace.useMemo(()=>(...n)=>{var o;return(o=e.current)==null?void 0:o.call(e,...n)},[])}var useInsertionEffect=React__namespace[" useInsertionEffect ".trim().toString()]||useLayoutEffect2;function useControllableState({prop:t,defaultProp:e,onChange:n=()=>{},caller:o}){const[l,d,f]=useUncontrolledState({defaultProp:e,onChange:n}),g=t!==void 0,b=g?t:l;{const S=React__namespace.useRef(t!==void 0);React__namespace.useEffect(()=>{const R=S.current;R!==g&&console.warn(`${o} is changing from ${R?"controlled":"uncontrolled"} to ${g?"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.`),S.current=g},[g,o])}const _=React__namespace.useCallback(S=>{var R;if(g){const C=isFunction$6(S)?S(t):S;C!==t&&((R=f.current)==null||R.call(f,C))}else d(S)},[g,t,d,f]);return[b,_]}function useUncontrolledState({defaultProp:t,onChange:e}){const[n,o]=React__namespace.useState(t),l=React__namespace.useRef(n),d=React__namespace.useRef(e);return useInsertionEffect(()=>{d.current=e},[e]),React__namespace.useEffect(()=>{var f;l.current!==n&&((f=d.current)==null||f.call(d,n),l.current=n)},[n,l]),[n,o,d]}function isFunction$6(t){return typeof t=="function"}var DirectionContext=React__namespace.createContext(void 0);function useDirection(t){const e=React__namespace.useContext(DirectionContext);return t||e||"ltr"}var ENTRY_FOCUS="rovingFocusGroup.onEntryFocus",EVENT_OPTIONS$1={bubbles:!1,cancelable:!0},GROUP_NAME$3="RovingFocusGroup",[Collection$3,useCollection$3,createCollectionScope$3]=createCollection(GROUP_NAME$3),[createRovingFocusGroupContext,createRovingFocusGroupScope]=createContextScope(GROUP_NAME$3,[createCollectionScope$3]),[RovingFocusProvider,useRovingFocusContext]=createRovingFocusGroupContext(GROUP_NAME$3),RovingFocusGroup=React__namespace.forwardRef((t,e)=>jsxRuntime.jsx(Collection$3.Provider,{scope:t.__scopeRovingFocusGroup,children:jsxRuntime.jsx(Collection$3.Slot,{scope:t.__scopeRovingFocusGroup,children:jsxRuntime.jsx(RovingFocusGroupImpl,{...t,ref:e})})}));RovingFocusGroup.displayName=GROUP_NAME$3;var RovingFocusGroupImpl=React__namespace.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:l=!1,dir:d,currentTabStopId:f,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:b,onEntryFocus:_,preventScrollOnEntryFocus:S=!1,...R}=t,C=React__namespace.useRef(null),E=useComposedRefs(e,C),A=useDirection(d),[M,I]=useControllableState({prop:f,defaultProp:g??null,onChange:b,caller:GROUP_NAME$3}),[j,q]=React__namespace.useState(!1),z=useCallbackRef$1(_),Q=useCollection$3(n),F=React__namespace.useRef(!1),[V,te]=React__namespace.useState(0);return React__namespace.useEffect(()=>{const ne=C.current;if(ne)return ne.addEventListener(ENTRY_FOCUS,z),()=>ne.removeEventListener(ENTRY_FOCUS,z)},[z]),jsxRuntime.jsx(RovingFocusProvider,{scope:n,orientation:o,dir:A,loop:l,currentTabStopId:M,onItemFocus:React__namespace.useCallback(ne=>I(ne),[I]),onItemShiftTab:React__namespace.useCallback(()=>q(!0),[]),onFocusableItemAdd:React__namespace.useCallback(()=>te(ne=>ne+1),[]),onFocusableItemRemove:React__namespace.useCallback(()=>te(ne=>ne-1),[]),children:jsxRuntime.jsx(Primitive.div,{tabIndex:j||V===0?-1:0,"data-orientation":o,...R,ref:E,style:{outline:"none",...t.style},onMouseDown:composeEventHandlers(t.onMouseDown,()=>{F.current=!0}),onFocus:composeEventHandlers(t.onFocus,ne=>{const se=!F.current;if(ne.target===ne.currentTarget&&se&&!j){const ge=new CustomEvent(ENTRY_FOCUS,EVENT_OPTIONS$1);if(ne.currentTarget.dispatchEvent(ge),!ge.defaultPrevented){const oe=Q().filter(Fe=>Fe.focusable),Ae=oe.find(Fe=>Fe.active),je=oe.find(Fe=>Fe.id===M),Oe=[Ae,je,...oe].filter(Boolean).map(Fe=>Fe.ref.current);focusFirst$3(Oe,S)}}F.current=!1}),onBlur:composeEventHandlers(t.onBlur,()=>q(!1))})})}),ITEM_NAME$4="RovingFocusGroupItem",RovingFocusGroupItem=React__namespace.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:l=!1,tabStopId:d,children:f,...g}=t,b=useId(),_=d||b,S=useRovingFocusContext(ITEM_NAME$4,n),R=S.currentTabStopId===_,C=useCollection$3(n),{onFocusableItemAdd:E,onFocusableItemRemove:A,currentTabStopId:M}=S;return React__namespace.useEffect(()=>{if(o)return E(),()=>A()},[o,E,A]),jsxRuntime.jsx(Collection$3.ItemSlot,{scope:n,id:_,focusable:o,active:l,children:jsxRuntime.jsx(Primitive.span,{tabIndex:R?0:-1,"data-orientation":S.orientation,...g,ref:e,onMouseDown:composeEventHandlers(t.onMouseDown,I=>{o?S.onItemFocus(_):I.preventDefault()}),onFocus:composeEventHandlers(t.onFocus,()=>S.onItemFocus(_)),onKeyDown:composeEventHandlers(t.onKeyDown,I=>{if(I.key==="Tab"&&I.shiftKey){S.onItemShiftTab();return}if(I.target!==I.currentTarget)return;const j=getFocusIntent(I,S.orientation,S.dir);if(j!==void 0){if(I.metaKey||I.ctrlKey||I.altKey||I.shiftKey)return;I.preventDefault();let z=C().filter(Q=>Q.focusable).map(Q=>Q.ref.current);if(j==="last")z.reverse();else if(j==="prev"||j==="next"){j==="prev"&&z.reverse();const Q=z.indexOf(I.currentTarget);z=S.loop?wrapArray$2(z,Q+1):z.slice(Q+1)}setTimeout(()=>focusFirst$3(z))}}),children:typeof f=="function"?f({isCurrentTabStop:R,hasTabStop:M!=null}):f})})});RovingFocusGroupItem.displayName=ITEM_NAME$4;var MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function getDirectionAwareKey(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function getFocusIntent(t,e,n){const o=getDirectionAwareKey(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return MAP_KEY_TO_FOCUS_INTENT[o]}function focusFirst$3(t,e=!1){const n=document.activeElement;for(const o of t)if(o===n||(o.focus({preventScroll:e}),document.activeElement!==n))return}function wrapArray$2(t,e){return t.map((n,o)=>t[(e+o)%t.length])}var Root$a=RovingFocusGroup,Item$2=RovingFocusGroupItem;function useSize(t){const[e,n]=React__namespace.useState(void 0);return useLayoutEffect2(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const o=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const d=l[0];let f,g;if("borderBoxSize"in d){const b=d.borderBoxSize,_=Array.isArray(b)?b[0]:b;f=_.inlineSize,g=_.blockSize}else f=t.offsetWidth,g=t.offsetHeight;n({width:f,height:g})});return o.observe(t,{box:"border-box"}),()=>o.unobserve(t)}else n(void 0)},[t]),e}function usePrevious(t){const e=React__namespace.useRef({value:t,previous:t});return React__namespace.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}function useStateMachine$1(t,e){return React__namespace.useReducer((n,o)=>e[n][o]??n,t)}var Presence=t=>{const{present:e,children:n}=t,o=usePresence(e),l=typeof n=="function"?n({present:o.isPresent}):React__namespace.Children.only(n),d=useComposedRefs(o.ref,getElementRef(l));return typeof n=="function"||o.isPresent?React__namespace.cloneElement(l,{ref:d}):null};Presence.displayName="Presence";function usePresence(t){const[e,n]=React__namespace.useState(),o=React__namespace.useRef(null),l=React__namespace.useRef(t),d=React__namespace.useRef("none"),f=t?"mounted":"unmounted",[g,b]=useStateMachine$1(f,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return React__namespace.useEffect(()=>{const _=getAnimationName(o.current);d.current=g==="mounted"?_:"none"},[g]),useLayoutEffect2(()=>{const _=o.current,S=l.current;if(S!==t){const C=d.current,E=getAnimationName(_);t?b("MOUNT"):E==="none"||(_==null?void 0:_.display)==="none"?b("UNMOUNT"):b(S&&C!==E?"ANIMATION_OUT":"UNMOUNT"),l.current=t}},[t,b]),useLayoutEffect2(()=>{if(e){let _;const S=e.ownerDocument.defaultView??window,R=E=>{const M=getAnimationName(o.current).includes(E.animationName);if(E.target===e&&M&&(b("ANIMATION_END"),!l.current)){const I=e.style.animationFillMode;e.style.animationFillMode="forwards",_=S.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=I)})}},C=E=>{E.target===e&&(d.current=getAnimationName(o.current))};return e.addEventListener("animationstart",C),e.addEventListener("animationcancel",R),e.addEventListener("animationend",R),()=>{S.clearTimeout(_),e.removeEventListener("animationstart",C),e.removeEventListener("animationcancel",R),e.removeEventListener("animationend",R)}}else b("ANIMATION_END")},[e,b]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:React__namespace.useCallback(_=>{o.current=_?getComputedStyle(_):null,n(_)},[])}}function getAnimationName(t){return(t==null?void 0:t.animationName)||"none"}function getElementRef(t){var o,l;let e=(o=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:o.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(l=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:l.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var RADIO_NAME="Radio",[createRadioContext,createRadioScope]=createContextScope(RADIO_NAME),[RadioProvider,useRadioContext]=createRadioContext(RADIO_NAME),Radio=React__namespace.forwardRef((t,e)=>{const{__scopeRadio:n,name:o,checked:l=!1,required:d,disabled:f,value:g="on",onCheck:b,form:_,...S}=t,[R,C]=React__namespace.useState(null),E=useComposedRefs(e,I=>C(I)),A=React__namespace.useRef(!1),M=R?_||!!R.closest("form"):!0;return jsxRuntime.jsxs(RadioProvider,{scope:n,checked:l,disabled:f,children:[jsxRuntime.jsx(Primitive.button,{type:"button",role:"radio","aria-checked":l,"data-state":getState$4(l),"data-disabled":f?"":void 0,disabled:f,value:g,...S,ref:E,onClick:composeEventHandlers(t.onClick,I=>{l||b==null||b(),M&&(A.current=I.isPropagationStopped(),A.current||I.stopPropagation())})}),M&&jsxRuntime.jsx(RadioBubbleInput,{control:R,bubbles:!A.current,name:o,value:g,checked:l,required:d,disabled:f,form:_,style:{transform:"translateX(-100%)"}})]})});Radio.displayName=RADIO_NAME;var INDICATOR_NAME$3="RadioIndicator",RadioIndicator=React__namespace.forwardRef((t,e)=>{const{__scopeRadio:n,forceMount:o,...l}=t,d=useRadioContext(INDICATOR_NAME$3,n);return jsxRuntime.jsx(Presence,{present:o||d.checked,children:jsxRuntime.jsx(Primitive.span,{"data-state":getState$4(d.checked),"data-disabled":d.disabled?"":void 0,...l,ref:e})})});RadioIndicator.displayName=INDICATOR_NAME$3;var BUBBLE_INPUT_NAME$3="RadioBubbleInput",RadioBubbleInput=React__namespace.forwardRef(({__scopeRadio:t,control:e,checked:n,bubbles:o=!0,...l},d)=>{const f=React__namespace.useRef(null),g=useComposedRefs(f,d),b=usePrevious(n),_=useSize(e);return React__namespace.useEffect(()=>{const S=f.current;if(!S)return;const R=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(R,"checked").set;if(b!==n&&E){const A=new Event("click",{bubbles:o});E.call(S,n),S.dispatchEvent(A)}},[b,n,o]),jsxRuntime.jsx(Primitive.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...l,tabIndex:-1,ref:g,style:{...l.style,..._,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});RadioBubbleInput.displayName=BUBBLE_INPUT_NAME$3;function getState$4(t){return t?"checked":"unchecked"}var ARROW_KEYS=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],RADIO_GROUP_NAME$2="RadioGroup",[createRadioGroupContext,createRadioGroupScope]=createContextScope(RADIO_GROUP_NAME$2,[createRovingFocusGroupScope,createRadioScope]),useRovingFocusGroupScope$2=createRovingFocusGroupScope(),useRadioScope=createRadioScope(),[RadioGroupProvider$1,useRadioGroupContext$1]=createRadioGroupContext(RADIO_GROUP_NAME$2),RadioGroup$2=React__namespace.forwardRef((t,e)=>{const{__scopeRadioGroup:n,name:o,defaultValue:l,value:d,required:f=!1,disabled:g=!1,orientation:b,dir:_,loop:S=!0,onValueChange:R,...C}=t,E=useRovingFocusGroupScope$2(n),A=useDirection(_),[M,I]=useControllableState({prop:d,defaultProp:l??null,onChange:R,caller:RADIO_GROUP_NAME$2});return jsxRuntime.jsx(RadioGroupProvider$1,{scope:n,name:o,required:f,disabled:g,value:M,onValueChange:I,children:jsxRuntime.jsx(Root$a,{asChild:!0,...E,orientation:b,dir:A,loop:S,children:jsxRuntime.jsx(Primitive.div,{role:"radiogroup","aria-required":f,"aria-orientation":b,"data-disabled":g?"":void 0,dir:A,...C,ref:e})})})});RadioGroup$2.displayName=RADIO_GROUP_NAME$2;var ITEM_NAME$3="RadioGroupItem",RadioGroupItem$1=React__namespace.forwardRef((t,e)=>{const{__scopeRadioGroup:n,disabled:o,...l}=t,d=useRadioGroupContext$1(ITEM_NAME$3,n),f=d.disabled||o,g=useRovingFocusGroupScope$2(n),b=useRadioScope(n),_=React__namespace.useRef(null),S=useComposedRefs(e,_),R=d.value===l.value,C=React__namespace.useRef(!1);return React__namespace.useEffect(()=>{const E=M=>{ARROW_KEYS.includes(M.key)&&(C.current=!0)},A=()=>C.current=!1;return document.addEventListener("keydown",E),document.addEventListener("keyup",A),()=>{document.removeEventListener("keydown",E),document.removeEventListener("keyup",A)}},[]),jsxRuntime.jsx(Item$2,{asChild:!0,...g,focusable:!f,active:R,children:jsxRuntime.jsx(Radio,{disabled:f,required:d.required,checked:R,...b,...l,name:d.name,ref:S,onCheck:()=>d.onValueChange(l.value),onKeyDown:composeEventHandlers(E=>{E.key==="Enter"&&E.preventDefault()}),onFocus:composeEventHandlers(l.onFocus,()=>{var E;C.current&&((E=_.current)==null||E.click())})})})});RadioGroupItem$1.displayName=ITEM_NAME$3;var INDICATOR_NAME2="RadioGroupIndicator",RadioGroupIndicator=React__namespace.forwardRef((t,e)=>{const{__scopeRadioGroup:n,...o}=t,l=useRadioScope(n);return jsxRuntime.jsx(RadioIndicator,{...l,...o,ref:e})});RadioGroupIndicator.displayName=INDICATOR_NAME2;var Root2$7=RadioGroup$2,Item2$2=RadioGroupItem$1,Indicator$1=RadioGroupIndicator;const RadioGroup$1=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx(Root2$7,{className:cn("grid gap-2",t),...e,ref:n}));RadioGroup$1.displayName=Root2$7.displayName;const RadioGroupItem=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx(Item2$2,{ref:n,className:cn("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow-sm focus:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:jsxRuntime.jsx(Indicator$1,{className:"flex items-center justify-center",children:jsxRuntime.jsx(Circle,{className:"h-3.5 w-3.5 fill-primary"})})}));RadioGroupItem.displayName=Item2$2.displayName;function useEscapeKeydown(t,e=globalThis==null?void 0:globalThis.document){const n=useCallbackRef$1(t);React__namespace.useEffect(()=>{const o=l=>{l.key==="Escape"&&n(l)};return e.addEventListener("keydown",o,{capture:!0}),()=>e.removeEventListener("keydown",o,{capture:!0})},[n,e])}var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=React__namespace.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=React__namespace.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:f,onDismiss:g,...b}=t,_=React__namespace.useContext(DismissableLayerContext),[S,R]=React__namespace.useState(null),C=(S==null?void 0:S.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=React__namespace.useState({}),A=useComposedRefs(e,te=>R(te)),M=Array.from(_.layers),[I]=[..._.layersWithOutsidePointerEventsDisabled].slice(-1),j=M.indexOf(I),q=S?M.indexOf(S):-1,z=_.layersWithOutsidePointerEventsDisabled.size>0,Q=q>=j,F=usePointerDownOutside(te=>{const ne=te.target,se=[..._.branches].some(ge=>ge.contains(ne));!Q||se||(l==null||l(te),f==null||f(te),te.defaultPrevented||g==null||g())},C),V=useFocusOutside(te=>{const ne=te.target;[..._.branches].some(ge=>ge.contains(ne))||(d==null||d(te),f==null||f(te),te.defaultPrevented||g==null||g())},C);return useEscapeKeydown(te=>{q===_.layers.size-1&&(o==null||o(te),!te.defaultPrevented&&g&&(te.preventDefault(),g()))},C),React__namespace.useEffect(()=>{if(S)return n&&(_.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),_.layersWithOutsidePointerEventsDisabled.add(S)),_.layers.add(S),dispatchUpdate(),()=>{n&&_.layersWithOutsidePointerEventsDisabled.size===1&&(C.body.style.pointerEvents=originalBodyPointerEvents)}},[S,C,n,_]),React__namespace.useEffect(()=>()=>{S&&(_.layers.delete(S),_.layersWithOutsidePointerEventsDisabled.delete(S),dispatchUpdate())},[S,_]),React__namespace.useEffect(()=>{const te=()=>E({});return document.addEventListener(CONTEXT_UPDATE,te),()=>document.removeEventListener(CONTEXT_UPDATE,te)},[]),jsxRuntime.jsx(Primitive.div,{...b,ref:A,style:{pointerEvents:z?Q?"auto":"none":void 0,...t.style},onFocusCapture:composeEventHandlers(t.onFocusCapture,V.onFocusCapture),onBlurCapture:composeEventHandlers(t.onBlurCapture,V.onBlurCapture),onPointerDownCapture:composeEventHandlers(t.onPointerDownCapture,F.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=React__namespace.forwardRef((t,e)=>{const n=React__namespace.useContext(DismissableLayerContext),o=React__namespace.useRef(null),l=useComposedRefs(e,o);return React__namespace.useEffect(()=>{const d=o.current;if(d)return n.branches.add(d),()=>{n.branches.delete(d)}},[n.branches]),jsxRuntime.jsx(Primitive.div,{...t,ref:l})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(t,e=globalThis==null?void 0:globalThis.document){const n=useCallbackRef$1(t),o=React__namespace.useRef(!1),l=React__namespace.useRef(()=>{});return React__namespace.useEffect(()=>{const d=g=>{if(g.target&&!o.current){let b=function(){handleAndDispatchCustomEvent$1(POINTER_DOWN_OUTSIDE,n,_,{discrete:!0})};const _={originalEvent:g};g.pointerType==="touch"?(e.removeEventListener("click",l.current),l.current=b,e.addEventListener("click",l.current,{once:!0})):b()}else e.removeEventListener("click",l.current);o.current=!1},f=window.setTimeout(()=>{e.addEventListener("pointerdown",d)},0);return()=>{window.clearTimeout(f),e.removeEventListener("pointerdown",d),e.removeEventListener("click",l.current)}},[e,n]),{onPointerDownCapture:()=>o.current=!0}}function useFocusOutside(t,e=globalThis==null?void 0:globalThis.document){const n=useCallbackRef$1(t),o=React__namespace.useRef(!1);return React__namespace.useEffect(()=>{const l=d=>{d.target&&!o.current&&handleAndDispatchCustomEvent$1(FOCUS_OUTSIDE,n,{originalEvent:d},{discrete:!1})};return e.addEventListener("focusin",l),()=>e.removeEventListener("focusin",l)},[e,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function dispatchUpdate(){const t=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(t)}function handleAndDispatchCustomEvent$1(t,e,n,{discrete:o}){const l=n.originalEvent.target,d=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&l.addEventListener(t,e,{once:!0}),o?dispatchDiscreteCustomEvent(l,d):l.dispatchEvent(d)}var Root$9=DismissableLayer,Branch$1=DismissableLayerBranch,AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",EVENT_OPTIONS={bubbles:!1,cancelable:!0},FOCUS_SCOPE_NAME="FocusScope",FocusScope=React__namespace.forwardRef((t,e)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:l,onUnmountAutoFocus:d,...f}=t,[g,b]=React__namespace.useState(null),_=useCallbackRef$1(l),S=useCallbackRef$1(d),R=React__namespace.useRef(null),C=useComposedRefs(e,M=>b(M)),E=React__namespace.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;React__namespace.useEffect(()=>{if(o){let M=function(z){if(E.paused||!g)return;const Q=z.target;g.contains(Q)?R.current=Q:focus$1(R.current,{select:!0})},I=function(z){if(E.paused||!g)return;const Q=z.relatedTarget;Q!==null&&(g.contains(Q)||focus$1(R.current,{select:!0}))},j=function(z){if(document.activeElement===document.body)for(const F of z)F.removedNodes.length>0&&focus$1(g)};document.addEventListener("focusin",M),document.addEventListener("focusout",I);const q=new MutationObserver(j);return g&&q.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",M),document.removeEventListener("focusout",I),q.disconnect()}}},[o,g,E.paused]),React__namespace.useEffect(()=>{if(g){focusScopesStack.add(E);const M=document.activeElement;if(!g.contains(M)){const j=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS);g.addEventListener(AUTOFOCUS_ON_MOUNT,_),g.dispatchEvent(j),j.defaultPrevented||(focusFirst$2(removeLinks(getTabbableCandidates$1(g)),{select:!0}),document.activeElement===M&&focus$1(g))}return()=>{g.removeEventListener(AUTOFOCUS_ON_MOUNT,_),setTimeout(()=>{const j=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS);g.addEventListener(AUTOFOCUS_ON_UNMOUNT,S),g.dispatchEvent(j),j.defaultPrevented||focus$1(M??document.body,{select:!0}),g.removeEventListener(AUTOFOCUS_ON_UNMOUNT,S),focusScopesStack.remove(E)},0)}}},[g,_,S,E]);const A=React__namespace.useCallback(M=>{if(!n&&!o||E.paused)return;const I=M.key==="Tab"&&!M.altKey&&!M.ctrlKey&&!M.metaKey,j=document.activeElement;if(I&&j){const q=M.currentTarget,[z,Q]=getTabbableEdges(q);z&&Q?!M.shiftKey&&j===Q?(M.preventDefault(),n&&focus$1(z,{select:!0})):M.shiftKey&&j===z&&(M.preventDefault(),n&&focus$1(Q,{select:!0})):j===q&&M.preventDefault()}},[n,o,E.paused]);return jsxRuntime.jsx(Primitive.div,{tabIndex:-1,...f,ref:C,onKeyDown:A})});FocusScope.displayName=FOCUS_SCOPE_NAME;function focusFirst$2(t,{select:e=!1}={}){const n=document.activeElement;for(const o of t)if(focus$1(o,{select:e}),document.activeElement!==n)return}function getTabbableEdges(t){const e=getTabbableCandidates$1(t),n=findVisible(e,t),o=findVisible(e.reverse(),t);return[n,o]}function getTabbableCandidates$1(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const l=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||l?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function findVisible(t,e){for(const n of t)if(!isHidden(n,{upTo:e}))return n}function isHidden(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function isSelectableInput(t){return t instanceof HTMLInputElement&&"select"in t}function focus$1(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&isSelectableInput(t)&&e&&t.select()}}var focusScopesStack=createFocusScopesStack();function createFocusScopesStack(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=arrayRemove(t,e),t.unshift(e)},remove(e){var n;t=arrayRemove(t,e),(n=t[0])==null||n.resume()}}}function arrayRemove(t,e){const n=[...t],o=n.indexOf(e);return o!==-1&&n.splice(o,1),n}function removeLinks(t){return t.filter(e=>e.tagName!=="A")}var PORTAL_NAME$7="Portal",Portal$5=React__namespace.forwardRef((t,e)=>{var g;const{container:n,...o}=t,[l,d]=React__namespace.useState(!1);useLayoutEffect2(()=>d(!0),[]);const f=n||l&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return f?ReactDOM.createPortal(jsxRuntime.jsx(Primitive.div,{...o,ref:e}),f):null});Portal$5.displayName=PORTAL_NAME$7;var count$2=0;function useFocusGuards(){React__namespace.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",t[1]??createFocusGuard()),count$2++,()=>{count$2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),count$2--}},[])}function createFocusGuard(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var __assign$1=function(){return __assign$1=Object.assign||function(e){for(var n,o=1,l=arguments.length;o<l;o++){n=arguments[o];for(var d in n)Object.prototype.hasOwnProperty.call(n,d)&&(e[d]=n[d])}return e},__assign$1.apply(this,arguments)};function __rest(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(t);l<o.length;l++)e.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(t,o[l])&&(n[o[l]]=t[o[l]]);return n}function __spreadArray(t,e,n){if(n||arguments.length===2)for(var o=0,l=e.length,d;o<l;o++)(d||!(o in e))&&(d||(d=Array.prototype.slice.call(e,0,o)),d[o]=e[o]);return t.concat(d||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";function assignRef(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function useCallbackRef(t,e){var n=React.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(o){var l=n.value;l!==o&&(n.value=o,n.callback(o,l))}}}})[0];return n.callback=e,n.facade}var useIsomorphicLayoutEffect$3=typeof window<"u"?React__namespace.useLayoutEffect:React__namespace.useEffect,currentValues=new WeakMap;function useMergeRefs(t,e){var n=useCallbackRef(null,function(o){return t.forEach(function(l){return assignRef(l,o)})});return useIsomorphicLayoutEffect$3(function(){var o=currentValues.get(n);if(o){var l=new Set(o),d=new Set(t),f=n.current;l.forEach(function(g){d.has(g)||assignRef(g,null)}),d.forEach(function(g){l.has(g)||assignRef(g,f)})}currentValues.set(n,t)},[t]),n}function ItoI(t){return t}function innerCreateMedium(t,e){e===void 0&&(e=ItoI);var n=[],o=!1,l={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(d){var f=e(d,o);return n.push(f),function(){n=n.filter(function(g){return g!==f})}},assignSyncMedium:function(d){for(o=!0;n.length;){var f=n;n=[],f.forEach(d)}n={push:function(g){return d(g)},filter:function(){return n}}},assignMedium:function(d){o=!0;var f=[];if(n.length){var g=n;n=[],g.forEach(d),f=n}var b=function(){var S=f;f=[],S.forEach(d)},_=function(){return Promise.resolve().then(b)};_(),n={push:function(S){f.push(S),_()},filter:function(S){return f=f.filter(S),n}}}};return l}function createSidecarMedium(t){t===void 0&&(t={});var e=innerCreateMedium(null);return e.options=__assign$1({async:!0,ssr:!1},t),e}var SideCar$1=function(t){var e=t.sideCar,n=__rest(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=e.read();if(!o)throw new Error("Sidecar medium not found");return React__namespace.createElement(o,__assign$1({},n))};SideCar$1.isSideCarExport=!0;function exportSidecar(t,e){return t.useMedium(e),SideCar$1}var effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=React__namespace.forwardRef(function(t,e){var n=React__namespace.useRef(null),o=React__namespace.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),l=o[0],d=o[1],f=t.forwardProps,g=t.children,b=t.className,_=t.removeScrollBar,S=t.enabled,R=t.shards,C=t.sideCar,E=t.noRelative,A=t.noIsolation,M=t.inert,I=t.allowPinchZoom,j=t.as,q=j===void 0?"div":j,z=t.gapMode,Q=__rest(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),F=C,V=useMergeRefs([n,e]),te=__assign$1(__assign$1({},Q),l);return React__namespace.createElement(React__namespace.Fragment,null,S&&React__namespace.createElement(F,{sideCar:effectCar,removeScrollBar:_,shards:R,noRelative:E,noIsolation:A,inert:M,setCallbacks:d,allowPinchZoom:!!I,lockRef:n,gapMode:z}),f?React__namespace.cloneElement(React__namespace.Children.only(g),__assign$1(__assign$1({},te),{ref:V})):React__namespace.createElement(q,__assign$1({},te,{className:b,ref:V}),g))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=getNonce();return e&&t.setAttribute("nonce",e),t}function injectStyles(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function insertStyleTag(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var stylesheetSingleton=function(){var t=0,e=null;return{add:function(n){t==0&&(e=makeStyleTag())&&(injectStyles(e,n),insertStyleTag(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},styleHookSingleton=function(){var t=stylesheetSingleton();return function(e,n){React__namespace.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},styleSingleton=function(){var t=styleHookSingleton(),e=function(n){var o=n.styles,l=n.dynamic;return t(o,l),null};return e},zeroGap={left:0,top:0,right:0,gap:0},parse=function(t){return parseInt(t||"",10)||0},getOffset$1=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],o=e[t==="padding"?"paddingTop":"marginTop"],l=e[t==="padding"?"paddingRight":"marginRight"];return[parse(n),parse(o),parse(l)]},getGapWidth=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return zeroGap;var e=getOffset$1(t),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,o-n+e[2]-e[0])}},Style=styleSingleton(),lockAttribute="data-scroll-locked",getStyles=function(t,e,n,o){var l=t.left,d=t.top,f=t.right,g=t.gap;return n===void 0&&(n="margin"),`
|
|
426
426
|
.`.concat(noScrollbarsClassName,` {
|
|
427
427
|
overflow: hidden `).concat(o,`;
|
|
428
428
|
padding-right: `).concat(g,"px ").concat(o,`;
|
|
@@ -593,7 +593,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
593
593
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$2(t,e){if(t){if(typeof t=="string")return _arrayLikeToArray$2(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray$2(t,e)}}function _arrayLikeToArray$2(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function _iterableToArrayLimit$1(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o,l,d,f,g=[],b=!0,_=!1;try{if(d=(n=n.call(t)).next,e!==0)for(;!(b=(o=d.call(n)).done)&&(g.push(o.value),g.length!==e);b=!0);}catch(S){_=!0,l=S}finally{try{if(!b&&n.return!=null&&(f=n.return(),Object(f)!==f))return}finally{if(_)throw l}}return g}}function _arrayWithHoles$1(t){if(Array.isArray(t))return t}function _extends$8(){return _extends$8=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_extends$8.apply(this,arguments)}var renderLine=function(e,n){var o;return React.isValidElement(e)?o=React.cloneElement(e,n):isFunction$4(e)?o=e(n):o=React.createElement("line",_extends$8({},n,{className:"recharts-reference-line-line"})),o},getEndPoints=function(e,n,o,l,d,f,g,b,_){var S=d.x,R=d.y,C=d.width,E=d.height;if(o){var A=_.y,M=e.y.apply(A,{position:f});if(ifOverflowMatches(_,"discard")&&!e.y.isInRange(M))return null;var I=[{x:S+C,y:M},{x:S,y:M}];return b==="left"?I.reverse():I}if(n){var j=_.x,q=e.x.apply(j,{position:f});if(ifOverflowMatches(_,"discard")&&!e.x.isInRange(q))return null;var z=[{x:q,y:R+E},{x:q,y:R}];return g==="top"?z.reverse():z}if(l){var Q=_.segment,F=Q.map(function(V){return e.apply(V,{position:f})});return ifOverflowMatches(_,"discard")&&some(F,function(V){return!e.isInRange(V)})?null:F}return null};function ReferenceLineImpl(t){var e=t.x,n=t.y,o=t.segment,l=t.xAxisId,d=t.yAxisId,f=t.shape,g=t.className,b=t.alwaysShow,_=useClipPathId(),S=useXAxisOrThrow(l),R=useYAxisOrThrow(d),C=useViewBox();if(!_||!C)return null;warn$1(b===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var E=createLabeledScales({x:S.scale,y:R.scale}),A=isNumOrStr(e),M=isNumOrStr(n),I=o&&o.length===2,j=getEndPoints(E,A,M,I,C,t.position,S.orientation,R.orientation,t);if(!j)return null;var q=_slicedToArray$1(j,2),z=q[0],Q=z.x,F=z.y,V=q[1],te=V.x,ne=V.y,se=ifOverflowMatches(t,"hidden")?"url(#".concat(_,")"):void 0,ge=_objectSpread$8(_objectSpread$8({clipPath:se},filterProps(t,!0)),{},{x1:Q,y1:F,x2:te,y2:ne});return React.createElement(Layer,{className:clsx("recharts-reference-line",g)},renderLine(f,ge),Label$1.renderCallByParent(t,rectWithCoords({x1:Q,y1:F,x2:te,y2:ne})))}var ReferenceLine=function(t){function e(){return _classCallCheck$8(this,e),_callSuper$7(this,e,arguments)}return _inherits$7(e,t),_createClass$8(e,[{key:"render",value:function(){return React.createElement(ReferenceLineImpl,this.props)}}])}(React.Component);_defineProperty$b(ReferenceLine,"displayName","ReferenceLine"),_defineProperty$b(ReferenceLine,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function _extends$7(){return _extends$7=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_extends$7.apply(this,arguments)}function _typeof$a(t){"@babel/helpers - typeof";return _typeof$a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$a(t)}function ownKeys$7(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$7(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys$7(Object(n),!0).forEach(function(o){_defineProperty$a(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys$7(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function _classCallCheck$7(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties$7(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,_toPropertyKey$a(o.key),o)}}function _createClass$7(t,e,n){return e&&_defineProperties$7(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function _callSuper$6(t,e,n){return e=_getPrototypeOf$6(e),_possibleConstructorReturn$6(t,_isNativeReflectConstruct$6()?Reflect.construct(e,n||[],_getPrototypeOf$6(t).constructor):e.apply(t,n))}function _possibleConstructorReturn$6(t,e){if(e&&(_typeof$a(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$6(t)}function _assertThisInitialized$6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct$6(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$6=function(){return!!t})()}function _getPrototypeOf$6(t){return _getPrototypeOf$6=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf$6(t)}function _inherits$6(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf$6(t,e)}function _setPrototypeOf$6(t,e){return _setPrototypeOf$6=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf$6(t,e)}function _defineProperty$a(t,e,n){return e=_toPropertyKey$a(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey$a(t){var e=_toPrimitive$a(t,"string");return _typeof$a(e)=="symbol"?e:e+""}function _toPrimitive$a(t,e){if(_typeof$a(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(_typeof$a(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var getCoordinate=function(e){var n=e.x,o=e.y,l=e.xAxis,d=e.yAxis,f=createLabeledScales({x:l.scale,y:d.scale}),g=f.apply({x:n,y:o},{bandAware:!0});return ifOverflowMatches(e,"discard")&&!f.isInRange(g)?null:g},ReferenceDot=function(t){function e(){return _classCallCheck$7(this,e),_callSuper$6(this,e,arguments)}return _inherits$6(e,t),_createClass$7(e,[{key:"render",value:function(){var o=this.props,l=o.x,d=o.y,f=o.r,g=o.alwaysShow,b=o.clipPathId,_=isNumOrStr(l),S=isNumOrStr(d);if(warn$1(g===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!_||!S)return null;var R=getCoordinate(this.props);if(!R)return null;var C=R.x,E=R.y,A=this.props,M=A.shape,I=A.className,j=ifOverflowMatches(this.props,"hidden")?"url(#".concat(b,")"):void 0,q=_objectSpread$7(_objectSpread$7({clipPath:j},filterProps(this.props,!0)),{},{cx:C,cy:E});return React.createElement(Layer,{className:clsx("recharts-reference-dot",I)},e.renderDot(M,q),Label$1.renderCallByParent(this.props,{x:C-f,y:E-f,width:2*f,height:2*f}))}}])}(React.Component);_defineProperty$a(ReferenceDot,"displayName","ReferenceDot"),_defineProperty$a(ReferenceDot,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1}),_defineProperty$a(ReferenceDot,"renderDot",function(t,e){var n;return React.isValidElement(t)?n=React.cloneElement(t,e):isFunction$4(t)?n=t(e):n=React.createElement(Dot,_extends$7({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),n});function _extends$6(){return _extends$6=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_extends$6.apply(this,arguments)}function _typeof$9(t){"@babel/helpers - typeof";return _typeof$9=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$9(t)}function ownKeys$6(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$6(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys$6(Object(n),!0).forEach(function(o){_defineProperty$9(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys$6(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function _classCallCheck$6(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties$6(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,_toPropertyKey$9(o.key),o)}}function _createClass$6(t,e,n){return e&&_defineProperties$6(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function _callSuper$5(t,e,n){return e=_getPrototypeOf$5(e),_possibleConstructorReturn$5(t,_isNativeReflectConstruct$5()?Reflect.construct(e,n||[],_getPrototypeOf$5(t).constructor):e.apply(t,n))}function _possibleConstructorReturn$5(t,e){if(e&&(_typeof$9(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$5(t)}function _assertThisInitialized$5(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct$5(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$5=function(){return!!t})()}function _getPrototypeOf$5(t){return _getPrototypeOf$5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf$5(t)}function _inherits$5(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf$5(t,e)}function _setPrototypeOf$5(t,e){return _setPrototypeOf$5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf$5(t,e)}function _defineProperty$9(t,e,n){return e=_toPropertyKey$9(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey$9(t){var e=_toPrimitive$9(t,"string");return _typeof$9(e)=="symbol"?e:e+""}function _toPrimitive$9(t,e){if(_typeof$9(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(_typeof$9(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var getRect=function(e,n,o,l,d){var f=d.x1,g=d.x2,b=d.y1,_=d.y2,S=d.xAxis,R=d.yAxis;if(!S||!R)return null;var C=createLabeledScales({x:S.scale,y:R.scale}),E={x:e?C.x.apply(f,{position:"start"}):C.x.rangeMin,y:o?C.y.apply(b,{position:"start"}):C.y.rangeMin},A={x:n?C.x.apply(g,{position:"end"}):C.x.rangeMax,y:l?C.y.apply(_,{position:"end"}):C.y.rangeMax};return ifOverflowMatches(d,"discard")&&(!C.isInRange(E)||!C.isInRange(A))?null:rectWithPoints(E,A)},ReferenceArea=function(t){function e(){return _classCallCheck$6(this,e),_callSuper$5(this,e,arguments)}return _inherits$5(e,t),_createClass$6(e,[{key:"render",value:function(){var o=this.props,l=o.x1,d=o.x2,f=o.y1,g=o.y2,b=o.className,_=o.alwaysShow,S=o.clipPathId;warn$1(_===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var R=isNumOrStr(l),C=isNumOrStr(d),E=isNumOrStr(f),A=isNumOrStr(g),M=this.props.shape;if(!R&&!C&&!E&&!A&&!M)return null;var I=getRect(R,C,E,A,this.props);if(!I&&!M)return null;var j=ifOverflowMatches(this.props,"hidden")?"url(#".concat(S,")"):void 0;return React.createElement(Layer,{className:clsx("recharts-reference-area",b)},e.renderRect(M,_objectSpread$6(_objectSpread$6({clipPath:j},filterProps(this.props,!0)),I)),Label$1.renderCallByParent(this.props,I))}}])}(React.Component);_defineProperty$9(ReferenceArea,"displayName","ReferenceArea"),_defineProperty$9(ReferenceArea,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1}),_defineProperty$9(ReferenceArea,"renderRect",function(t,e){var n;return React.isValidElement(t)?n=React.cloneElement(t,e):isFunction$4(t)?n=t(e):n=React.createElement(Rectangle,_extends$6({},e,{className:"recharts-reference-area-rect"})),n});function getEveryNthWithCondition(t,e,n){if(e<1)return[];if(e===1&&n===void 0)return t;for(var o=[],l=0;l<t.length;l+=e)o.push(t[l]);return o}function getAngledTickWidth(t,e,n){var o={width:t.width+e.width,height:t.height+e.height};return getAngledRectangleWidth(o,n)}function getTickBoundaries(t,e,n){var o=n==="width",l=t.x,d=t.y,f=t.width,g=t.height;return e===1?{start:o?l:d,end:o?l+f:d+g}:{start:o?l+f:d+g,end:o?l:d}}function isVisible(t,e,n,o,l){if(t*e<t*o||t*e>t*l)return!1;var d=n();return t*(e-t*d/2-o)>=0&&t*(e+t*d/2-l)<=0}function getNumberIntervalTicks(t,e){return getEveryNthWithCondition(t,e+1)}function getEquidistantTicks(t,e,n,o,l){for(var d=(o||[]).slice(),f=e.start,g=e.end,b=0,_=1,S=f,R=function(){var A=o==null?void 0:o[b];if(A===void 0)return{v:getEveryNthWithCondition(o,_)};var M=b,I,j=function(){return I===void 0&&(I=n(A,M)),I},q=A.coordinate,z=b===0||isVisible(t,q,j,S,g);z||(b=0,S=f,_+=1),z&&(S=q+t*(j()/2+l),b+=_)},C;_<=d.length;)if(C=R(),C)return C.v;return[]}function _typeof$8(t){"@babel/helpers - typeof";return _typeof$8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$8(t)}function ownKeys$5(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$5(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys$5(Object(n),!0).forEach(function(o){_defineProperty$8(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys$5(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function _defineProperty$8(t,e,n){return e=_toPropertyKey$8(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey$8(t){var e=_toPrimitive$8(t,"string");return _typeof$8(e)=="symbol"?e:e+""}function _toPrimitive$8(t,e){if(_typeof$8(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(_typeof$8(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function getTicksEnd(t,e,n,o,l){for(var d=(o||[]).slice(),f=d.length,g=e.start,b=e.end,_=function(C){var E=d[C],A,M=function(){return A===void 0&&(A=n(E,C)),A};if(C===f-1){var I=t*(E.coordinate+t*M()/2-b);d[C]=E=_objectSpread$5(_objectSpread$5({},E),{},{tickCoord:I>0?E.coordinate-I*t:E.coordinate})}else d[C]=E=_objectSpread$5(_objectSpread$5({},E),{},{tickCoord:E.coordinate});var j=isVisible(t,E.tickCoord,M,g,b);j&&(b=E.tickCoord-t*(M()/2+l),d[C]=_objectSpread$5(_objectSpread$5({},E),{},{isShow:!0}))},S=f-1;S>=0;S--)_(S);return d}function getTicksStart(t,e,n,o,l,d){var f=(o||[]).slice(),g=f.length,b=e.start,_=e.end;if(d){var S=o[g-1],R=n(S,g-1),C=t*(S.coordinate+t*R/2-_);f[g-1]=S=_objectSpread$5(_objectSpread$5({},S),{},{tickCoord:C>0?S.coordinate-C*t:S.coordinate});var E=isVisible(t,S.tickCoord,function(){return R},b,_);E&&(_=S.tickCoord-t*(R/2+l),f[g-1]=_objectSpread$5(_objectSpread$5({},S),{},{isShow:!0}))}for(var A=d?g-1:g,M=function(q){var z=f[q],Q,F=function(){return Q===void 0&&(Q=n(z,q)),Q};if(q===0){var V=t*(z.coordinate-t*F()/2-b);f[q]=z=_objectSpread$5(_objectSpread$5({},z),{},{tickCoord:V<0?z.coordinate-V*t:z.coordinate})}else f[q]=z=_objectSpread$5(_objectSpread$5({},z),{},{tickCoord:z.coordinate});var te=isVisible(t,z.tickCoord,F,b,_);te&&(b=z.tickCoord+t*(F()/2+l),f[q]=_objectSpread$5(_objectSpread$5({},z),{},{isShow:!0}))},I=0;I<A;I++)M(I);return f}function getTicks(t,e,n){var o=t.tick,l=t.ticks,d=t.viewBox,f=t.minTickGap,g=t.orientation,b=t.interval,_=t.tickFormatter,S=t.unit,R=t.angle;if(!l||!l.length||!o)return[];if(isNumber$2(b)||Global.isSsr)return getNumberIntervalTicks(l,typeof b=="number"&&isNumber$2(b)?b:0);var C=[],E=g==="top"||g==="bottom"?"width":"height",A=S&&E==="width"?getStringSize(S,{fontSize:e,letterSpacing:n}):{width:0,height:0},M=function(z,Q){var F=isFunction$4(_)?_(z.value,Q):z.value;return E==="width"?getAngledTickWidth(getStringSize(F,{fontSize:e,letterSpacing:n}),A,R):getStringSize(F,{fontSize:e,letterSpacing:n})[E]},I=l.length>=2?mathSign(l[1].coordinate-l[0].coordinate):1,j=getTickBoundaries(d,I,E);return b==="equidistantPreserveStart"?getEquidistantTicks(I,j,M,l,f):(b==="preserveStart"||b==="preserveStartEnd"?C=getTicksStart(I,j,M,l,f,b==="preserveStartEnd"):C=getTicksEnd(I,j,M,l,f),C.filter(function(q){return q.isShow}))}var _excluded$3=["viewBox"],_excluded2$3=["viewBox"],_excluded3=["ticks"];function _typeof$7(t){"@babel/helpers - typeof";return _typeof$7=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$7(t)}function _extends$5(){return _extends$5=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_extends$5.apply(this,arguments)}function ownKeys$4(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$4(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys$4(Object(n),!0).forEach(function(o){_defineProperty$7(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys$4(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function _objectWithoutProperties$3(t,e){if(t==null)return{};var n=_objectWithoutPropertiesLoose$3(t,e),o,l;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(t);for(l=0;l<d.length;l++)o=d[l],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function _objectWithoutPropertiesLoose$3(t,e){if(t==null)return{};var n={};for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(e.indexOf(o)>=0)continue;n[o]=t[o]}return n}function _classCallCheck$5(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties$5(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,_toPropertyKey$7(o.key),o)}}function _createClass$5(t,e,n){return e&&_defineProperties$5(t.prototype,e),n&&_defineProperties$5(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _callSuper$4(t,e,n){return e=_getPrototypeOf$4(e),_possibleConstructorReturn$4(t,_isNativeReflectConstruct$4()?Reflect.construct(e,n||[],_getPrototypeOf$4(t).constructor):e.apply(t,n))}function _possibleConstructorReturn$4(t,e){if(e&&(_typeof$7(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$4(t)}function _assertThisInitialized$4(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct$4(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$4=function(){return!!t})()}function _getPrototypeOf$4(t){return _getPrototypeOf$4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf$4(t)}function _inherits$4(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf$4(t,e)}function _setPrototypeOf$4(t,e){return _setPrototypeOf$4=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf$4(t,e)}function _defineProperty$7(t,e,n){return e=_toPropertyKey$7(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey$7(t){var e=_toPrimitive$7(t,"string");return _typeof$7(e)=="symbol"?e:e+""}function _toPrimitive$7(t,e){if(_typeof$7(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(_typeof$7(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var CartesianAxis=function(t){function e(n){var o;return _classCallCheck$5(this,e),o=_callSuper$4(this,e,[n]),o.state={fontSize:"",letterSpacing:""},o}return _inherits$4(e,t),_createClass$5(e,[{key:"shouldComponentUpdate",value:function(o,l){var d=o.viewBox,f=_objectWithoutProperties$3(o,_excluded$3),g=this.props,b=g.viewBox,_=_objectWithoutProperties$3(g,_excluded2$3);return!shallowEqual(d,b)||!shallowEqual(f,_)||!shallowEqual(l,this.state)}},{key:"componentDidMount",value:function(){var o=this.layerReference;if(o){var l=o.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];l&&this.setState({fontSize:window.getComputedStyle(l).fontSize,letterSpacing:window.getComputedStyle(l).letterSpacing})}}},{key:"getTickLineCoord",value:function(o){var l=this.props,d=l.x,f=l.y,g=l.width,b=l.height,_=l.orientation,S=l.tickSize,R=l.mirror,C=l.tickMargin,E,A,M,I,j,q,z=R?-1:1,Q=o.tickSize||S,F=isNumber$2(o.tickCoord)?o.tickCoord:o.coordinate;switch(_){case"top":E=A=o.coordinate,I=f+ +!R*b,M=I-z*Q,q=M-z*C,j=F;break;case"left":M=I=o.coordinate,A=d+ +!R*g,E=A-z*Q,j=E-z*C,q=F;break;case"right":M=I=o.coordinate,A=d+ +R*g,E=A+z*Q,j=E+z*C,q=F;break;default:E=A=o.coordinate,I=f+ +R*b,M=I+z*Q,q=M+z*C,j=F;break}return{line:{x1:E,y1:M,x2:A,y2:I},tick:{x:j,y:q}}}},{key:"getTickTextAnchor",value:function(){var o=this.props,l=o.orientation,d=o.mirror,f;switch(l){case"left":f=d?"start":"end";break;case"right":f=d?"end":"start";break;default:f="middle";break}return f}},{key:"getTickVerticalAnchor",value:function(){var o=this.props,l=o.orientation,d=o.mirror,f="end";switch(l){case"left":case"right":f="middle";break;case"top":f=d?"start":"end";break;default:f=d?"end":"start";break}return f}},{key:"renderAxisLine",value:function(){var o=this.props,l=o.x,d=o.y,f=o.width,g=o.height,b=o.orientation,_=o.mirror,S=o.axisLine,R=_objectSpread$4(_objectSpread$4(_objectSpread$4({},filterProps(this.props,!1)),filterProps(S,!1)),{},{fill:"none"});if(b==="top"||b==="bottom"){var C=+(b==="top"&&!_||b==="bottom"&&_);R=_objectSpread$4(_objectSpread$4({},R),{},{x1:l,y1:d+C*g,x2:l+f,y2:d+C*g})}else{var E=+(b==="left"&&!_||b==="right"&&_);R=_objectSpread$4(_objectSpread$4({},R),{},{x1:l+E*f,y1:d,x2:l+E*f,y2:d+g})}return React.createElement("line",_extends$5({},R,{className:clsx("recharts-cartesian-axis-line",get$1(S,"className"))}))}},{key:"renderTicks",value:function(o,l,d){var f=this,g=this.props,b=g.tickLine,_=g.stroke,S=g.tick,R=g.tickFormatter,C=g.unit,E=getTicks(_objectSpread$4(_objectSpread$4({},this.props),{},{ticks:o}),l,d),A=this.getTickTextAnchor(),M=this.getTickVerticalAnchor(),I=filterProps(this.props,!1),j=filterProps(S,!1),q=_objectSpread$4(_objectSpread$4({},I),{},{fill:"none"},filterProps(b,!1)),z=E.map(function(Q,F){var V=f.getTickLineCoord(Q),te=V.line,ne=V.tick,se=_objectSpread$4(_objectSpread$4(_objectSpread$4(_objectSpread$4({textAnchor:A,verticalAnchor:M},I),{},{stroke:"none",fill:_},j),ne),{},{index:F,payload:Q,visibleTicksCount:E.length,tickFormatter:R});return React.createElement(Layer,_extends$5({className:"recharts-cartesian-axis-tick",key:"tick-".concat(Q.value,"-").concat(Q.coordinate,"-").concat(Q.tickCoord)},adaptEventsOfChild(f.props,Q,F)),b&&React.createElement("line",_extends$5({},q,te,{className:clsx("recharts-cartesian-axis-tick-line",get$1(b,"className"))})),S&&e.renderTickItem(S,se,"".concat(isFunction$4(R)?R(Q.value,F):Q.value).concat(C||"")))});return React.createElement("g",{className:"recharts-cartesian-axis-ticks"},z)}},{key:"render",value:function(){var o=this,l=this.props,d=l.axisLine,f=l.width,g=l.height,b=l.ticksGenerator,_=l.className,S=l.hide;if(S)return null;var R=this.props,C=R.ticks,E=_objectWithoutProperties$3(R,_excluded3),A=C;return isFunction$4(b)&&(A=C&&C.length>0?b(this.props):b(E)),f<=0||g<=0||!A||!A.length?null:React.createElement(Layer,{className:clsx("recharts-cartesian-axis",_),ref:function(I){o.layerReference=I}},d&&this.renderAxisLine(),this.renderTicks(A,this.state.fontSize,this.state.letterSpacing),Label$1.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(o,l,d){var f;return React.isValidElement(o)?f=React.cloneElement(o,l):isFunction$4(o)?f=o(l):f=React.createElement(Text$1,_extends$5({},l,{className:"recharts-cartesian-axis-tick-value"}),d),f}}])}(React.Component);_defineProperty$7(CartesianAxis,"displayName","CartesianAxis"),_defineProperty$7(CartesianAxis,"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 _excluded$2=["x1","y1","x2","y2","key"],_excluded2$2=["offset"];function _typeof$6(t){"@babel/helpers - typeof";return _typeof$6=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(t)}function ownKeys$3(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$3(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys$3(Object(n),!0).forEach(function(o){_defineProperty$6(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys$3(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function _defineProperty$6(t,e,n){return e=_toPropertyKey$6(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey$6(t){var e=_toPrimitive$6(t,"string");return _typeof$6(e)=="symbol"?e:e+""}function _toPrimitive$6(t,e){if(_typeof$6(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(_typeof$6(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _extends$4(){return _extends$4=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_extends$4.apply(this,arguments)}function _objectWithoutProperties$2(t,e){if(t==null)return{};var n=_objectWithoutPropertiesLoose$2(t,e),o,l;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(t);for(l=0;l<d.length;l++)o=d[l],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function _objectWithoutPropertiesLoose$2(t,e){if(t==null)return{};var n={};for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(e.indexOf(o)>=0)continue;n[o]=t[o]}return n}var Background=function(e){var n=e.fill;if(!n||n==="none")return null;var o=e.fillOpacity,l=e.x,d=e.y,f=e.width,g=e.height,b=e.ry;return React.createElement("rect",{x:l,y:d,ry:b,width:f,height:g,stroke:"none",fill:n,fillOpacity:o,className:"recharts-cartesian-grid-bg"})};function renderLineItem(t,e){var n;if(React.isValidElement(t))n=React.cloneElement(t,e);else if(isFunction$4(t))n=t(e);else{var o=e.x1,l=e.y1,d=e.x2,f=e.y2,g=e.key,b=_objectWithoutProperties$2(e,_excluded$2),_=filterProps(b,!1);_.offset;var S=_objectWithoutProperties$2(_,_excluded2$2);n=React.createElement("line",_extends$4({},S,{x1:o,y1:l,x2:d,y2:f,fill:"none",key:g}))}return n}function HorizontalGridLines(t){var e=t.x,n=t.width,o=t.horizontal,l=o===void 0?!0:o,d=t.horizontalPoints;if(!l||!d||!d.length)return null;var f=d.map(function(g,b){var _=_objectSpread$3(_objectSpread$3({},t),{},{x1:e,y1:g,x2:e+n,y2:g,key:"line-".concat(b),index:b});return renderLineItem(l,_)});return React.createElement("g",{className:"recharts-cartesian-grid-horizontal"},f)}function VerticalGridLines(t){var e=t.y,n=t.height,o=t.vertical,l=o===void 0?!0:o,d=t.verticalPoints;if(!l||!d||!d.length)return null;var f=d.map(function(g,b){var _=_objectSpread$3(_objectSpread$3({},t),{},{x1:g,y1:e,x2:g,y2:e+n,key:"line-".concat(b),index:b});return renderLineItem(l,_)});return React.createElement("g",{className:"recharts-cartesian-grid-vertical"},f)}function HorizontalStripes(t){var e=t.horizontalFill,n=t.fillOpacity,o=t.x,l=t.y,d=t.width,f=t.height,g=t.horizontalPoints,b=t.horizontal,_=b===void 0?!0:b;if(!_||!e||!e.length)return null;var S=g.map(function(C){return Math.round(C+l-l)}).sort(function(C,E){return C-E});l!==S[0]&&S.unshift(0);var R=S.map(function(C,E){var A=!S[E+1],M=A?l+f-C:S[E+1]-C;if(M<=0)return null;var I=E%e.length;return React.createElement("rect",{key:"react-".concat(E),y:C,x:o,height:M,width:d,stroke:"none",fill:e[I],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return React.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},R)}function VerticalStripes(t){var e=t.vertical,n=e===void 0?!0:e,o=t.verticalFill,l=t.fillOpacity,d=t.x,f=t.y,g=t.width,b=t.height,_=t.verticalPoints;if(!n||!o||!o.length)return null;var S=_.map(function(C){return Math.round(C+d-d)}).sort(function(C,E){return C-E});d!==S[0]&&S.unshift(0);var R=S.map(function(C,E){var A=!S[E+1],M=A?d+g-C:S[E+1]-C;if(M<=0)return null;var I=E%o.length;return React.createElement("rect",{key:"react-".concat(E),x:C,y:f,width:M,height:b,stroke:"none",fill:o[I],fillOpacity:l,className:"recharts-cartesian-grid-bg"})});return React.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},R)}var defaultVerticalCoordinatesGenerator=function(e,n){var o=e.xAxis,l=e.width,d=e.height,f=e.offset;return getCoordinatesOfGrid(getTicks(_objectSpread$3(_objectSpread$3(_objectSpread$3({},CartesianAxis.defaultProps),o),{},{ticks:getTicksOfAxis(o,!0),viewBox:{x:0,y:0,width:l,height:d}})),f.left,f.left+f.width,n)},defaultHorizontalCoordinatesGenerator=function(e,n){var o=e.yAxis,l=e.width,d=e.height,f=e.offset;return getCoordinatesOfGrid(getTicks(_objectSpread$3(_objectSpread$3(_objectSpread$3({},CartesianAxis.defaultProps),o),{},{ticks:getTicksOfAxis(o,!0),viewBox:{x:0,y:0,width:l,height:d}})),f.top,f.top+f.height,n)},defaultProps={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function CartesianGrid(t){var e,n,o,l,d,f,g=useChartWidth(),b=useChartHeight(),_=useOffset(),S=_objectSpread$3(_objectSpread$3({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:defaultProps.stroke,fill:(n=t.fill)!==null&&n!==void 0?n:defaultProps.fill,horizontal:(o=t.horizontal)!==null&&o!==void 0?o:defaultProps.horizontal,horizontalFill:(l=t.horizontalFill)!==null&&l!==void 0?l:defaultProps.horizontalFill,vertical:(d=t.vertical)!==null&&d!==void 0?d:defaultProps.vertical,verticalFill:(f=t.verticalFill)!==null&&f!==void 0?f:defaultProps.verticalFill,x:isNumber$2(t.x)?t.x:_.left,y:isNumber$2(t.y)?t.y:_.top,width:isNumber$2(t.width)?t.width:_.width,height:isNumber$2(t.height)?t.height:_.height}),R=S.x,C=S.y,E=S.width,A=S.height,M=S.syncWithTicks,I=S.horizontalValues,j=S.verticalValues,q=useArbitraryXAxis(),z=useYAxisWithFiniteDomainOrRandom();if(!isNumber$2(E)||E<=0||!isNumber$2(A)||A<=0||!isNumber$2(R)||R!==+R||!isNumber$2(C)||C!==+C)return null;var Q=S.verticalCoordinatesGenerator||defaultVerticalCoordinatesGenerator,F=S.horizontalCoordinatesGenerator||defaultHorizontalCoordinatesGenerator,V=S.horizontalPoints,te=S.verticalPoints;if((!V||!V.length)&&isFunction$4(F)){var ne=I&&I.length,se=F({yAxis:z?_objectSpread$3(_objectSpread$3({},z),{},{ticks:ne?I:z.ticks}):void 0,width:g,height:b,offset:_},ne?!0:M);warn$1(Array.isArray(se),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(_typeof$6(se),"]")),Array.isArray(se)&&(V=se)}if((!te||!te.length)&&isFunction$4(Q)){var ge=j&&j.length,oe=Q({xAxis:q?_objectSpread$3(_objectSpread$3({},q),{},{ticks:ge?j:q.ticks}):void 0,width:g,height:b,offset:_},ge?!0:M);warn$1(Array.isArray(oe),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(_typeof$6(oe),"]")),Array.isArray(oe)&&(te=oe)}return React.createElement("g",{className:"recharts-cartesian-grid"},React.createElement(Background,{fill:S.fill,fillOpacity:S.fillOpacity,x:S.x,y:S.y,width:S.width,height:S.height,ry:S.ry}),React.createElement(HorizontalGridLines,_extends$4({},S,{offset:_,horizontalPoints:V,xAxis:q,yAxis:z})),React.createElement(VerticalGridLines,_extends$4({},S,{offset:_,verticalPoints:te,xAxis:q,yAxis:z})),React.createElement(HorizontalStripes,_extends$4({},S,{horizontalPoints:V})),React.createElement(VerticalStripes,_extends$4({},S,{verticalPoints:te})))}CartesianGrid.displayName="CartesianGrid";var _excluded$1=["layout","type","stroke","connectNulls","isRange","ref"],_excluded2$1=["key"],_Area;function _typeof$5(t){"@babel/helpers - typeof";return _typeof$5=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(t)}function _objectWithoutProperties$1(t,e){if(t==null)return{};var n=_objectWithoutPropertiesLoose$1(t,e),o,l;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(t);for(l=0;l<d.length;l++)o=d[l],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function _objectWithoutPropertiesLoose$1(t,e){if(t==null)return{};var n={};for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(e.indexOf(o)>=0)continue;n[o]=t[o]}return n}function _extends$3(){return _extends$3=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_extends$3.apply(this,arguments)}function ownKeys$2(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$2(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys$2(Object(n),!0).forEach(function(o){_defineProperty$5(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys$2(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function _classCallCheck$4(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties$4(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,_toPropertyKey$5(o.key),o)}}function _createClass$4(t,e,n){return e&&_defineProperties$4(t.prototype,e),n&&_defineProperties$4(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function _callSuper$3(t,e,n){return e=_getPrototypeOf$3(e),_possibleConstructorReturn$3(t,_isNativeReflectConstruct$3()?Reflect.construct(e,n||[],_getPrototypeOf$3(t).constructor):e.apply(t,n))}function _possibleConstructorReturn$3(t,e){if(e&&(_typeof$5(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$3(t)}function _assertThisInitialized$3(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct$3(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$3=function(){return!!t})()}function _getPrototypeOf$3(t){return _getPrototypeOf$3=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf$3(t)}function _inherits$3(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf$3(t,e)}function _setPrototypeOf$3(t,e){return _setPrototypeOf$3=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf$3(t,e)}function _defineProperty$5(t,e,n){return e=_toPropertyKey$5(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey$5(t){var e=_toPrimitive$5(t,"string");return _typeof$5(e)=="symbol"?e:e+""}function _toPrimitive$5(t,e){if(_typeof$5(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(_typeof$5(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Area=function(t){function e(){var n;_classCallCheck$4(this,e);for(var o=arguments.length,l=new Array(o),d=0;d<o;d++)l[d]=arguments[d];return n=_callSuper$3(this,e,[].concat(l)),_defineProperty$5(n,"state",{isAnimationFinished:!0}),_defineProperty$5(n,"id",uniqueId("recharts-area-")),_defineProperty$5(n,"handleAnimationEnd",function(){var f=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),isFunction$4(f)&&f()}),_defineProperty$5(n,"handleAnimationStart",function(){var f=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),isFunction$4(f)&&f()}),n}return _inherits$3(e,t),_createClass$4(e,[{key:"renderDots",value:function(o,l,d){var f=this.props.isAnimationActive,g=this.state.isAnimationFinished;if(f&&!g)return null;var b=this.props,_=b.dot,S=b.points,R=b.dataKey,C=filterProps(this.props,!1),E=filterProps(_,!0),A=S.map(function(I,j){var q=_objectSpread$2(_objectSpread$2(_objectSpread$2({key:"dot-".concat(j),r:3},C),E),{},{index:j,cx:I.x,cy:I.y,dataKey:R,value:I.value,payload:I.payload,points:S});return e.renderDotItem(_,q)}),M={clipPath:o?"url(#clipPath-".concat(l?"":"dots-").concat(d,")"):null};return React.createElement(Layer,_extends$3({className:"recharts-area-dots"},M),A)}},{key:"renderHorizontalRect",value:function(o){var l=this.props,d=l.baseLine,f=l.points,g=l.strokeWidth,b=f[0].x,_=f[f.length-1].x,S=o*Math.abs(b-_),R=max$1(f.map(function(C){return C.y||0}));return isNumber$2(d)&&typeof d=="number"?R=Math.max(d,R):d&&Array.isArray(d)&&d.length&&(R=Math.max(max$1(d.map(function(C){return C.y||0})),R)),isNumber$2(R)?React.createElement("rect",{x:b<_?b:b-S,y:0,width:S,height:Math.floor(R+(g?parseInt("".concat(g),10):1))}):null}},{key:"renderVerticalRect",value:function(o){var l=this.props,d=l.baseLine,f=l.points,g=l.strokeWidth,b=f[0].y,_=f[f.length-1].y,S=o*Math.abs(b-_),R=max$1(f.map(function(C){return C.x||0}));return isNumber$2(d)&&typeof d=="number"?R=Math.max(d,R):d&&Array.isArray(d)&&d.length&&(R=Math.max(max$1(d.map(function(C){return C.x||0})),R)),isNumber$2(R)?React.createElement("rect",{x:0,y:b<_?b:b-S,width:R+(g?parseInt("".concat(g),10):1),height:Math.floor(S)}):null}},{key:"renderClipRect",value:function(o){var l=this.props.layout;return l==="vertical"?this.renderVerticalRect(o):this.renderHorizontalRect(o)}},{key:"renderAreaStatically",value:function(o,l,d,f){var g=this.props,b=g.layout,_=g.type,S=g.stroke,R=g.connectNulls,C=g.isRange;g.ref;var E=_objectWithoutProperties$1(g,_excluded$1);return React.createElement(Layer,{clipPath:d?"url(#clipPath-".concat(f,")"):null},React.createElement(Curve,_extends$3({},filterProps(E,!0),{points:o,connectNulls:R,type:_,baseLine:l,layout:b,stroke:"none",className:"recharts-area-area"})),S!=="none"&&React.createElement(Curve,_extends$3({},filterProps(this.props,!1),{className:"recharts-area-curve",layout:b,type:_,connectNulls:R,fill:"none",points:o})),S!=="none"&&C&&React.createElement(Curve,_extends$3({},filterProps(this.props,!1),{className:"recharts-area-curve",layout:b,type:_,connectNulls:R,fill:"none",points:l})))}},{key:"renderAreaWithAnimation",value:function(o,l){var d=this,f=this.props,g=f.points,b=f.baseLine,_=f.isAnimationActive,S=f.animationBegin,R=f.animationDuration,C=f.animationEasing,E=f.animationId,A=this.state,M=A.prevPoints,I=A.prevBaseLine;return React.createElement(Animate,{begin:S,duration:R,isActive:_,easing:C,from:{t:0},to:{t:1},key:"area-".concat(E),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(j){var q=j.t;if(M){var z=M.length/g.length,Q=g.map(function(ne,se){var ge=Math.floor(se*z);if(M[ge]){var oe=M[ge],Ae=interpolateNumber$2(oe.x,ne.x),je=interpolateNumber$2(oe.y,ne.y);return _objectSpread$2(_objectSpread$2({},ne),{},{x:Ae(q),y:je(q)})}return ne}),F;if(isNumber$2(b)&&typeof b=="number"){var V=interpolateNumber$2(I,b);F=V(q)}else if(isNil(b)||isNan(b)){var te=interpolateNumber$2(I,0);F=te(q)}else F=b.map(function(ne,se){var ge=Math.floor(se*z);if(I[ge]){var oe=I[ge],Ae=interpolateNumber$2(oe.x,ne.x),je=interpolateNumber$2(oe.y,ne.y);return _objectSpread$2(_objectSpread$2({},ne),{},{x:Ae(q),y:je(q)})}return ne});return d.renderAreaStatically(Q,F,o,l)}return React.createElement(Layer,null,React.createElement("defs",null,React.createElement("clipPath",{id:"animationClipPath-".concat(l)},d.renderClipRect(q))),React.createElement(Layer,{clipPath:"url(#animationClipPath-".concat(l,")")},d.renderAreaStatically(g,b,o,l)))})}},{key:"renderArea",value:function(o,l){var d=this.props,f=d.points,g=d.baseLine,b=d.isAnimationActive,_=this.state,S=_.prevPoints,R=_.prevBaseLine,C=_.totalLength;return b&&f&&f.length&&(!S&&C>0||!isEqual(S,f)||!isEqual(R,g))?this.renderAreaWithAnimation(o,l):this.renderAreaStatically(f,g,o,l)}},{key:"render",value:function(){var o,l=this.props,d=l.hide,f=l.dot,g=l.points,b=l.className,_=l.top,S=l.left,R=l.xAxis,C=l.yAxis,E=l.width,A=l.height,M=l.isAnimationActive,I=l.id;if(d||!g||!g.length)return null;var j=this.state.isAnimationFinished,q=g.length===1,z=clsx("recharts-area",b),Q=R&&R.allowDataOverflow,F=C&&C.allowDataOverflow,V=Q||F,te=isNil(I)?this.id:I,ne=(o=filterProps(f,!1))!==null&&o!==void 0?o:{r:3,strokeWidth:2},se=ne.r,ge=se===void 0?3:se,oe=ne.strokeWidth,Ae=oe===void 0?2:oe,je=hasClipDot(f)?f:{},Ne=je.clipDot,Oe=Ne===void 0?!0:Ne,Fe=ge*2+Ae;return React.createElement(Layer,{className:z},Q||F?React.createElement("defs",null,React.createElement("clipPath",{id:"clipPath-".concat(te)},React.createElement("rect",{x:Q?S:S-E/2,y:F?_:_-A/2,width:Q?E:E*2,height:F?A:A*2})),!Oe&&React.createElement("clipPath",{id:"clipPath-dots-".concat(te)},React.createElement("rect",{x:S-Fe/2,y:_-Fe/2,width:E+Fe,height:A+Fe}))):null,q?null:this.renderArea(V,te),(f||q)&&this.renderDots(V,Oe,te),(!M||j)&&LabelList.renderCallByParent(this.props,g))}}],[{key:"getDerivedStateFromProps",value:function(o,l){return o.animationId!==l.prevAnimationId?{prevAnimationId:o.animationId,curPoints:o.points,curBaseLine:o.baseLine,prevPoints:l.curPoints,prevBaseLine:l.curBaseLine}:o.points!==l.curPoints||o.baseLine!==l.curBaseLine?{curPoints:o.points,curBaseLine:o.baseLine}:null}}])}(React.PureComponent);_Area=Area,_defineProperty$5(Area,"displayName","Area"),_defineProperty$5(Area,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Global.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"}),_defineProperty$5(Area,"getBaseValue",function(t,e,n,o){var l=t.layout,d=t.baseValue,f=e.props.baseValue,g=f??d;if(isNumber$2(g)&&typeof g=="number")return g;var b=l==="horizontal"?o:n,_=b.scale.domain();if(b.type==="number"){var S=Math.max(_[0],_[1]),R=Math.min(_[0],_[1]);return g==="dataMin"?R:g==="dataMax"||S<0?S:Math.max(Math.min(_[0],_[1]),0)}return g==="dataMin"?_[0]:g==="dataMax"?_[1]:_[0]}),_defineProperty$5(Area,"getComposedData",function(t){var e=t.props,n=t.item,o=t.xAxis,l=t.yAxis,d=t.xAxisTicks,f=t.yAxisTicks,g=t.bandSize,b=t.dataKey,_=t.stackedData,S=t.dataStartIndex,R=t.displayedData,C=t.offset,E=e.layout,A=_&&_.length,M=_Area.getBaseValue(e,n,o,l),I=E==="horizontal",j=!1,q=R.map(function(Q,F){var V;A?V=_[S+F]:(V=getValueByDataKey(Q,b),Array.isArray(V)?j=!0:V=[M,V]);var te=V[1]==null||A&&getValueByDataKey(Q,b)==null;return I?{x:getCateCoordinateOfLine({axis:o,ticks:d,bandSize:g,entry:Q,index:F}),y:te?null:l.scale(V[1]),value:V,payload:Q}:{x:te?null:o.scale(V[1]),y:getCateCoordinateOfLine({axis:l,ticks:f,bandSize:g,entry:Q,index:F}),value:V,payload:Q}}),z;return A||j?z=q.map(function(Q){var F=Array.isArray(Q.value)?Q.value[0]:null;return I?{x:Q.x,y:F!=null&&Q.y!=null?l.scale(F):null}:{x:F!=null?o.scale(F):null,y:Q.y}}):z=I?l.scale(M):o.scale(M),_objectSpread$2({points:q,baseLine:z,layout:E,isRange:j},C)}),_defineProperty$5(Area,"renderDotItem",function(t,e){var n;if(React.isValidElement(t))n=React.cloneElement(t,e);else if(isFunction$4(t))n=t(e);else{var o=clsx("recharts-area-dot",typeof t!="boolean"?t.className:""),l=e.key,d=_objectWithoutProperties$1(e,_excluded2$1);n=React.createElement(Dot,_extends$3({},d,{key:l,className:o}))}return n});function _typeof$4(t){"@babel/helpers - typeof";return _typeof$4=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$4(t)}function _classCallCheck$3(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties$3(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,_toPropertyKey$4(o.key),o)}}function _createClass$3(t,e,n){return e&&_defineProperties$3(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function _callSuper$2(t,e,n){return e=_getPrototypeOf$2(e),_possibleConstructorReturn$2(t,_isNativeReflectConstruct$2()?Reflect.construct(e,n||[],_getPrototypeOf$2(t).constructor):e.apply(t,n))}function _possibleConstructorReturn$2(t,e){if(e&&(_typeof$4(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$2(t)}function _assertThisInitialized$2(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct$2(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$2=function(){return!!t})()}function _getPrototypeOf$2(t){return _getPrototypeOf$2=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf$2(t)}function _inherits$2(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf$2(t,e)}function _setPrototypeOf$2(t,e){return _setPrototypeOf$2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf$2(t,e)}function _defineProperty$4(t,e,n){return e=_toPropertyKey$4(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey$4(t){var e=_toPrimitive$4(t,"string");return _typeof$4(e)=="symbol"?e:e+""}function _toPrimitive$4(t,e){if(_typeof$4(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(_typeof$4(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_extends$2.apply(this,arguments)}function XAxisImpl(t){var e=t.xAxisId,n=useChartWidth(),o=useChartHeight(),l=useXAxisOrThrow(e);return l==null?null:React.createElement(CartesianAxis,_extends$2({},l,{className:clsx("recharts-".concat(l.axisType," ").concat(l.axisType),l.className),viewBox:{x:0,y:0,width:n,height:o},ticksGenerator:function(f){return getTicksOfAxis(f,!0)}}))}var XAxis=function(t){function e(){return _classCallCheck$3(this,e),_callSuper$2(this,e,arguments)}return _inherits$2(e,t),_createClass$3(e,[{key:"render",value:function(){return React.createElement(XAxisImpl,this.props)}}])}(React.Component);_defineProperty$4(XAxis,"displayName","XAxis"),_defineProperty$4(XAxis,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function _typeof$3(t){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(t)}function _classCallCheck$2(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties$2(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,_toPropertyKey$3(o.key),o)}}function _createClass$2(t,e,n){return e&&_defineProperties$2(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function _callSuper$1(t,e,n){return e=_getPrototypeOf$1(e),_possibleConstructorReturn$1(t,_isNativeReflectConstruct$1()?Reflect.construct(e,n||[],_getPrototypeOf$1(t).constructor):e.apply(t,n))}function _possibleConstructorReturn$1(t,e){if(e&&(_typeof$3(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized$1(t)}function _assertThisInitialized$1(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct$1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct$1=function(){return!!t})()}function _getPrototypeOf$1(t){return _getPrototypeOf$1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf$1(t)}function _inherits$1(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf$1(t,e)}function _setPrototypeOf$1(t,e){return _setPrototypeOf$1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf$1(t,e)}function _defineProperty$3(t,e,n){return e=_toPropertyKey$3(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey$3(t){var e=_toPrimitive$3(t,"string");return _typeof$3(e)=="symbol"?e:e+""}function _toPrimitive$3(t,e){if(_typeof$3(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(_typeof$3(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_extends$1.apply(this,arguments)}var YAxisImpl=function(e){var n=e.yAxisId,o=useChartWidth(),l=useChartHeight(),d=useYAxisOrThrow(n);return d==null?null:React.createElement(CartesianAxis,_extends$1({},d,{className:clsx("recharts-".concat(d.axisType," ").concat(d.axisType),d.className),viewBox:{x:0,y:0,width:o,height:l},ticksGenerator:function(g){return getTicksOfAxis(g,!0)}}))},YAxis=function(t){function e(){return _classCallCheck$2(this,e),_callSuper$1(this,e,arguments)}return _inherits$1(e,t),_createClass$2(e,[{key:"render",value:function(){return React.createElement(YAxisImpl,this.props)}}])}(React.Component);_defineProperty$3(YAxis,"displayName","YAxis"),_defineProperty$3(YAxis,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function _toConsumableArray$1(t){return _arrayWithoutHoles$1(t)||_iterableToArray$1(t)||_unsupportedIterableToArray$1(t)||_nonIterableSpread$1()}function _nonIterableSpread$1(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
594
594
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray$1(t,e){if(t){if(typeof t=="string")return _arrayLikeToArray$1(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray$1(t,e)}}function _iterableToArray$1(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function _arrayWithoutHoles$1(t){if(Array.isArray(t))return _arrayLikeToArray$1(t)}function _arrayLikeToArray$1(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}var detectReferenceElementsDomain=function(e,n,o,l,d){var f=findAllByType(e,ReferenceLine),g=findAllByType(e,ReferenceDot),b=[].concat(_toConsumableArray$1(f),_toConsumableArray$1(g)),_=findAllByType(e,ReferenceArea),S="".concat(l,"Id"),R=l[0],C=n;if(b.length&&(C=b.reduce(function(M,I){if(I.props[S]===o&&ifOverflowMatches(I.props,"extendDomain")&&isNumber$2(I.props[R])){var j=I.props[R];return[Math.min(M[0],j),Math.max(M[1],j)]}return M},C)),_.length){var E="".concat(R,"1"),A="".concat(R,"2");C=_.reduce(function(M,I){if(I.props[S]===o&&ifOverflowMatches(I.props,"extendDomain")&&isNumber$2(I.props[E])&&isNumber$2(I.props[A])){var j=I.props[E],q=I.props[A];return[Math.min(M[0],j,q),Math.max(M[1],j,q)]}return M},C)}return d&&d.length&&(C=d.reduce(function(M,I){return isNumber$2(I)?[Math.min(M[0],I),Math.max(M[1],I)]:M},C)),C},eventemitter3={exports:{}},hasRequiredEventemitter3;function requireEventemitter3(){return hasRequiredEventemitter3||(hasRequiredEventemitter3=1,function(t){var e=Object.prototype.hasOwnProperty,n="~";function o(){}Object.create&&(o.prototype=Object.create(null),new o().__proto__||(n=!1));function l(b,_,S){this.fn=b,this.context=_,this.once=S||!1}function d(b,_,S,R,C){if(typeof S!="function")throw new TypeError("The listener must be a function");var E=new l(S,R||b,C),A=n?n+_:_;return b._events[A]?b._events[A].fn?b._events[A]=[b._events[A],E]:b._events[A].push(E):(b._events[A]=E,b._eventsCount++),b}function f(b,_){--b._eventsCount===0?b._events=new o:delete b._events[_]}function g(){this._events=new o,this._eventsCount=0}g.prototype.eventNames=function(){var _=[],S,R;if(this._eventsCount===0)return _;for(R in S=this._events)e.call(S,R)&&_.push(n?R.slice(1):R);return Object.getOwnPropertySymbols?_.concat(Object.getOwnPropertySymbols(S)):_},g.prototype.listeners=function(_){var S=n?n+_:_,R=this._events[S];if(!R)return[];if(R.fn)return[R.fn];for(var C=0,E=R.length,A=new Array(E);C<E;C++)A[C]=R[C].fn;return A},g.prototype.listenerCount=function(_){var S=n?n+_:_,R=this._events[S];return R?R.fn?1:R.length:0},g.prototype.emit=function(_,S,R,C,E,A){var M=n?n+_:_;if(!this._events[M])return!1;var I=this._events[M],j=arguments.length,q,z;if(I.fn){switch(I.once&&this.removeListener(_,I.fn,void 0,!0),j){case 1:return I.fn.call(I.context),!0;case 2:return I.fn.call(I.context,S),!0;case 3:return I.fn.call(I.context,S,R),!0;case 4:return I.fn.call(I.context,S,R,C),!0;case 5:return I.fn.call(I.context,S,R,C,E),!0;case 6:return I.fn.call(I.context,S,R,C,E,A),!0}for(z=1,q=new Array(j-1);z<j;z++)q[z-1]=arguments[z];I.fn.apply(I.context,q)}else{var Q=I.length,F;for(z=0;z<Q;z++)switch(I[z].once&&this.removeListener(_,I[z].fn,void 0,!0),j){case 1:I[z].fn.call(I[z].context);break;case 2:I[z].fn.call(I[z].context,S);break;case 3:I[z].fn.call(I[z].context,S,R);break;case 4:I[z].fn.call(I[z].context,S,R,C);break;default:if(!q)for(F=1,q=new Array(j-1);F<j;F++)q[F-1]=arguments[F];I[z].fn.apply(I[z].context,q)}}return!0},g.prototype.on=function(_,S,R){return d(this,_,S,R,!1)},g.prototype.once=function(_,S,R){return d(this,_,S,R,!0)},g.prototype.removeListener=function(_,S,R,C){var E=n?n+_:_;if(!this._events[E])return this;if(!S)return f(this,E),this;var A=this._events[E];if(A.fn)A.fn===S&&(!C||A.once)&&(!R||A.context===R)&&f(this,E);else{for(var M=0,I=[],j=A.length;M<j;M++)(A[M].fn!==S||C&&!A[M].once||R&&A[M].context!==R)&&I.push(A[M]);I.length?this._events[E]=I.length===1?I[0]:I:f(this,E)}return this},g.prototype.removeAllListeners=function(_){var S;return _?(S=n?n+_:_,this._events[S]&&f(this,S)):(this._events=new o,this._eventsCount=0),this},g.prototype.off=g.prototype.removeListener,g.prototype.addListener=g.prototype.on,g.prefixed=n,g.EventEmitter=g,t.exports=g}(eventemitter3)),eventemitter3.exports}var eventemitter3Exports=requireEventemitter3();const EventEmitter$1=getDefaultExportFromCjs$1(eventemitter3Exports);var eventCenter=new EventEmitter$1,SYNC_EVENT="recharts.syncMouseEvents";function _typeof$2(t){"@babel/helpers - typeof";return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$2(t)}function _classCallCheck$1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties$1(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,_toPropertyKey$2(o.key),o)}}function _createClass$1(t,e,n){return e&&_defineProperties$1(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function _defineProperty$2(t,e,n){return e=_toPropertyKey$2(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey$2(t){var e=_toPrimitive$2(t,"string");return _typeof$2(e)=="symbol"?e:e+""}function _toPrimitive$2(t,e){if(_typeof$2(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(_typeof$2(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var AccessibilityManager=function(){function t(){_classCallCheck$1(this,t),_defineProperty$2(this,"activeIndex",0),_defineProperty$2(this,"coordinateList",[]),_defineProperty$2(this,"layout","horizontal")}return _createClass$1(t,[{key:"setDetails",value:function(n){var o,l=n.coordinateList,d=l===void 0?null:l,f=n.container,g=f===void 0?null:f,b=n.layout,_=b===void 0?null:b,S=n.offset,R=S===void 0?null:S,C=n.mouseHandlerCallback,E=C===void 0?null:C;this.coordinateList=(o=d??this.coordinateList)!==null&&o!==void 0?o:[],this.container=g??this.container,this.layout=_??this.layout,this.offset=R??this.offset,this.mouseHandlerCallback=E??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,o;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var l=this.container.getBoundingClientRect(),d=l.x,f=l.y,g=l.height,b=this.coordinateList[this.activeIndex].coordinate,_=((n=window)===null||n===void 0?void 0:n.scrollX)||0,S=((o=window)===null||o===void 0?void 0:o.scrollY)||0,R=d+b+_,C=f+this.offset.top+g/2+S;this.mouseHandlerCallback({pageX:R,pageY:C})}}}])}();function isDomainSpecifiedByUser(t,e,n){if(n==="number"&&e===!0&&Array.isArray(t)){var o=t==null?void 0:t[0],l=t==null?void 0:t[1];if(o&&l&&isNumber$2(o)&&isNumber$2(l))return!0}return!1}function getCursorRectangle(t,e,n,o){var l=o/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-l:n.left+.5,y:t==="horizontal"?n.top+.5:e.y-l,width:t==="horizontal"?o:n.width-1,height:t==="horizontal"?n.height-1:o}}function getRadialCursorPoints(t){var e=t.cx,n=t.cy,o=t.radius,l=t.startAngle,d=t.endAngle,f=polarToCartesian(e,n,o,l),g=polarToCartesian(e,n,o,d);return{points:[f,g],cx:e,cy:n,radius:o,startAngle:l,endAngle:d}}function getCursorPoints(t,e,n){var o,l,d,f;if(t==="horizontal")o=e.x,d=o,l=n.top,f=n.top+n.height;else if(t==="vertical")l=e.y,f=l,o=n.left,d=n.left+n.width;else if(e.cx!=null&&e.cy!=null)if(t==="centric"){var g=e.cx,b=e.cy,_=e.innerRadius,S=e.outerRadius,R=e.angle,C=polarToCartesian(g,b,_,R),E=polarToCartesian(g,b,S,R);o=C.x,l=C.y,d=E.x,f=E.y}else return getRadialCursorPoints(e);return[{x:o,y:l},{x:d,y:f}]}function _typeof$1(t){"@babel/helpers - typeof";return _typeof$1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$1(t)}function ownKeys$1(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread$1(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys$1(Object(n),!0).forEach(function(o){_defineProperty$1(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys$1(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function _defineProperty$1(t,e,n){return e=_toPropertyKey$1(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey$1(t){var e=_toPrimitive$1(t,"string");return _typeof$1(e)=="symbol"?e:e+""}function _toPrimitive$1(t,e){if(_typeof$1(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(_typeof$1(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Cursor(t){var e,n,o=t.element,l=t.tooltipEventType,d=t.isActive,f=t.activeCoordinate,g=t.activePayload,b=t.offset,_=t.activeTooltipIndex,S=t.tooltipAxisBandSize,R=t.layout,C=t.chartName,E=(e=o.props.cursor)!==null&&e!==void 0?e:(n=o.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!o||!E||!d||!f||C!=="ScatterChart"&&l!=="axis")return null;var A,M=Curve;if(C==="ScatterChart")A=f,M=Cross;else if(C==="BarChart")A=getCursorRectangle(R,f,b,S),M=Rectangle;else if(R==="radial"){var I=getRadialCursorPoints(f),j=I.cx,q=I.cy,z=I.radius,Q=I.startAngle,F=I.endAngle;A={cx:j,cy:q,startAngle:Q,endAngle:F,innerRadius:z,outerRadius:z},M=Sector}else A={points:getCursorPoints(R,f,b)},M=Curve;var V=_objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({stroke:"#ccc",pointerEvents:"none"},b),A),filterProps(E,!1)),{},{payload:g,payloadIndex:_,className:clsx("recharts-tooltip-cursor",E.className)});return React.isValidElement(E)?React.cloneElement(E,V):React.createElement(M,V)}var _excluded=["item"],_excluded2=["children","className","width","height","style","compact","title","desc"];function _typeof(t){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(t)}function _extends(){return _extends=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_extends.apply(this,arguments)}function _slicedToArray(t,e){return _arrayWithHoles(t)||_iterableToArrayLimit(t,e)||_unsupportedIterableToArray(t,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
595
595
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _iterableToArrayLimit(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var o,l,d,f,g=[],b=!0,_=!1;try{if(d=(n=n.call(t)).next,e!==0)for(;!(b=(o=d.call(n)).done)&&(g.push(o.value),g.length!==e);b=!0);}catch(S){_=!0,l=S}finally{try{if(!b&&n.return!=null&&(f=n.return(),Object(f)!==f))return}finally{if(_)throw l}}return g}}function _arrayWithHoles(t){if(Array.isArray(t))return t}function _objectWithoutProperties(t,e){if(t==null)return{};var n=_objectWithoutPropertiesLoose(t,e),o,l;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(t);for(l=0;l<d.length;l++)o=d[l],!(e.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function _objectWithoutPropertiesLoose(t,e){if(t==null)return{};var n={};for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(e.indexOf(o)>=0)continue;n[o]=t[o]}return n}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,_toPropertyKey(o.key),o)}}function _createClass(t,e,n){return e&&_defineProperties(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function _callSuper(t,e,n){return e=_getPrototypeOf(e),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(e,n||[],_getPrototypeOf(t).constructor):e.apply(t,n))}function _possibleConstructorReturn(t,e){if(e&&(_typeof(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _assertThisInitialized(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct=function(){return!!t})()}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_getPrototypeOf(t)}function _inherits(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,l){return o.__proto__=l,o},_setPrototypeOf(t,e)}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
596
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray(t,e){if(t){if(typeof t=="string")return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(t,e)}}function _iterableToArray(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(o){_defineProperty(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function _defineProperty(t,e,n){return e=_toPropertyKey(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return _typeof(e)=="symbol"?e:e+""}function _toPrimitive(t,e){if(_typeof(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(_typeof(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ORIENT_MAP={xAxis:["bottom","top"],yAxis:["left","right"]},FULL_WIDTH_AND_HEIGHT={width:"100%",height:"100%"},originCoordinate={x:0,y:0};function renderAsIs(t){return t}var calculateTooltipPos=function(e,n){return n==="horizontal"?e.x:n==="vertical"?e.y:n==="centric"?e.angle:e.radius},getActiveCoordinate=function(e,n,o,l){var d=n.find(function(S){return S&&S.index===o});if(d){if(e==="horizontal")return{x:d.coordinate,y:l.y};if(e==="vertical")return{x:l.x,y:d.coordinate};if(e==="centric"){var f=d.coordinate,g=l.radius;return _objectSpread(_objectSpread(_objectSpread({},l),polarToCartesian(l.cx,l.cy,g,f)),{},{angle:f,radius:g})}var b=d.coordinate,_=l.angle;return _objectSpread(_objectSpread(_objectSpread({},l),polarToCartesian(l.cx,l.cy,b,_)),{},{angle:_,radius:b})}return originCoordinate},getDisplayedData=function(e,n){var o=n.graphicalItems,l=n.dataStartIndex,d=n.dataEndIndex,f=(o??[]).reduce(function(g,b){var _=b.props.data;return _&&_.length?[].concat(_toConsumableArray(g),_toConsumableArray(_)):g},[]);return f.length>0?f:e&&e.length&&isNumber$2(l)&&isNumber$2(d)?e.slice(l,d+1):[]};function getDefaultDomainByAxisType(t){return t==="number"?[0,"auto"]:void 0}var getTooltipContent=function(e,n,o,l){var d=e.graphicalItems,f=e.tooltipAxis,g=getDisplayedData(n,e);return o<0||!d||!d.length||o>=g.length?null:d.reduce(function(b,_){var S,R=(S=_.props.data)!==null&&S!==void 0?S:n;R&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=o&&(R=R.slice(e.dataStartIndex,e.dataEndIndex+1));var C;if(f.dataKey&&!f.allowDuplicatedCategory){var E=R===void 0?g:R;C=findEntryInArray(E,f.dataKey,l)}else C=R&&R[o]||g[o];return C?[].concat(_toConsumableArray(b),[getTooltipItem(_,C)]):b},[])},getTooltipData=function(e,n,o,l){var d=l||{x:e.chartX,y:e.chartY},f=calculateTooltipPos(d,o),g=e.orderedTooltipTicks,b=e.tooltipAxis,_=e.tooltipTicks,S=calculateActiveTickIndex(f,g,_,b);if(S>=0&&_){var R=_[S]&&_[S].value,C=getTooltipContent(e,n,S,R),E=getActiveCoordinate(o,g,S,d);return{activeTooltipIndex:S,activeLabel:R,activePayload:C,activeCoordinate:E}}return null},getAxisMapByAxes=function(e,n){var o=n.axes,l=n.graphicalItems,d=n.axisType,f=n.axisIdKey,g=n.stackGroups,b=n.dataStartIndex,_=n.dataEndIndex,S=e.layout,R=e.children,C=e.stackOffset,E=isCategoricalAxis(S,d);return o.reduce(function(A,M){var I,j=M.type.defaultProps!==void 0?_objectSpread(_objectSpread({},M.type.defaultProps),M.props):M.props,q=j.type,z=j.dataKey,Q=j.allowDataOverflow,F=j.allowDuplicatedCategory,V=j.scale,te=j.ticks,ne=j.includeHidden,se=j[f];if(A[se])return A;var ge=getDisplayedData(e.data,{graphicalItems:l.filter(function(He){var Ze,tt=f in He.props?He.props[f]:(Ze=He.type.defaultProps)===null||Ze===void 0?void 0:Ze[f];return tt===se}),dataStartIndex:b,dataEndIndex:_}),oe=ge.length,Ae,je,Ne;isDomainSpecifiedByUser(j.domain,Q,q)&&(Ae=parseSpecifiedDomain(j.domain,null,Q),E&&(q==="number"||V!=="auto")&&(Ne=getDomainOfDataByKey(ge,z,"category")));var Oe=getDefaultDomainByAxisType(q);if(!Ae||Ae.length===0){var Fe,ze=(Fe=j.domain)!==null&&Fe!==void 0?Fe:Oe;if(z){if(Ae=getDomainOfDataByKey(ge,z,q),q==="category"&&E){var $e=hasDuplicate(Ae);F&&$e?(je=Ae,Ae=range(0,oe)):F||(Ae=parseDomainOfCategoryAxis(ze,Ae,M).reduce(function(He,Ze){return He.indexOf(Ze)>=0?He:[].concat(_toConsumableArray(He),[Ze])},[]))}else if(q==="category")F?Ae=Ae.filter(function(He){return He!==""&&!isNil(He)}):Ae=parseDomainOfCategoryAxis(ze,Ae,M).reduce(function(He,Ze){return He.indexOf(Ze)>=0||Ze===""||isNil(Ze)?He:[].concat(_toConsumableArray(He),[Ze])},[]);else if(q==="number"){var Be=parseErrorBarsOfAxis(ge,l.filter(function(He){var Ze,tt,Ye=f in He.props?He.props[f]:(Ze=He.type.defaultProps)===null||Ze===void 0?void 0:Ze[f],Qe="hide"in He.props?He.props.hide:(tt=He.type.defaultProps)===null||tt===void 0?void 0:tt.hide;return Ye===se&&(ne||!Qe)}),z,d,S);Be&&(Ae=Be)}E&&(q==="number"||V!=="auto")&&(Ne=getDomainOfDataByKey(ge,z,"category"))}else E?Ae=range(0,oe):g&&g[se]&&g[se].hasStack&&q==="number"?Ae=C==="expand"?[0,1]:getDomainOfStackGroups(g[se].stackGroups,b,_):Ae=getDomainOfItemsWithSameAxis(ge,l.filter(function(He){var Ze=f in He.props?He.props[f]:He.type.defaultProps[f],tt="hide"in He.props?He.props.hide:He.type.defaultProps.hide;return Ze===se&&(ne||!tt)}),q,S,!0);if(q==="number")Ae=detectReferenceElementsDomain(R,Ae,se,d,te),ze&&(Ae=parseSpecifiedDomain(ze,Ae,Q));else if(q==="category"&&ze){var qe=ze,Ge=Ae.every(function(He){return qe.indexOf(He)>=0});Ge&&(Ae=qe)}}return _objectSpread(_objectSpread({},A),{},_defineProperty({},se,_objectSpread(_objectSpread({},j),{},{axisType:d,domain:Ae,categoricalDomain:Ne,duplicateDomain:je,originalDomain:(I=j.domain)!==null&&I!==void 0?I:Oe,isCategorical:E,layout:S})))},{})},getAxisMapByItems=function(e,n){var o=n.graphicalItems,l=n.Axis,d=n.axisType,f=n.axisIdKey,g=n.stackGroups,b=n.dataStartIndex,_=n.dataEndIndex,S=e.layout,R=e.children,C=getDisplayedData(e.data,{graphicalItems:o,dataStartIndex:b,dataEndIndex:_}),E=C.length,A=isCategoricalAxis(S,d),M=-1;return o.reduce(function(I,j){var q=j.type.defaultProps!==void 0?_objectSpread(_objectSpread({},j.type.defaultProps),j.props):j.props,z=q[f],Q=getDefaultDomainByAxisType("number");if(!I[z]){M++;var F;return A?F=range(0,E):g&&g[z]&&g[z].hasStack?(F=getDomainOfStackGroups(g[z].stackGroups,b,_),F=detectReferenceElementsDomain(R,F,z,d)):(F=parseSpecifiedDomain(Q,getDomainOfItemsWithSameAxis(C,o.filter(function(V){var te,ne,se=f in V.props?V.props[f]:(te=V.type.defaultProps)===null||te===void 0?void 0:te[f],ge="hide"in V.props?V.props.hide:(ne=V.type.defaultProps)===null||ne===void 0?void 0:ne.hide;return se===z&&!ge}),"number",S),l.defaultProps.allowDataOverflow),F=detectReferenceElementsDomain(R,F,z,d)),_objectSpread(_objectSpread({},I),{},_defineProperty({},z,_objectSpread(_objectSpread({axisType:d},l.defaultProps),{},{hide:!0,orientation:get$1(ORIENT_MAP,"".concat(d,".").concat(M%2),null),domain:F,originalDomain:Q,isCategorical:A,layout:S})))}return I},{})},getAxisMap=function(e,n){var o=n.axisType,l=o===void 0?"xAxis":o,d=n.AxisComp,f=n.graphicalItems,g=n.stackGroups,b=n.dataStartIndex,_=n.dataEndIndex,S=e.children,R="".concat(l,"Id"),C=findAllByType(S,d),E={};return C&&C.length?E=getAxisMapByAxes(e,{axes:C,graphicalItems:f,axisType:l,axisIdKey:R,stackGroups:g,dataStartIndex:b,dataEndIndex:_}):f&&f.length&&(E=getAxisMapByItems(e,{Axis:d,graphicalItems:f,axisType:l,axisIdKey:R,stackGroups:g,dataStartIndex:b,dataEndIndex:_})),E},tooltipTicksGenerator=function(e){var n=getAnyElementOfObject(e),o=getTicksOfAxis(n,!1,!0);return{tooltipTicks:o,orderedTooltipTicks:sortBy(o,function(l){return l.coordinate}),tooltipAxis:n,tooltipAxisBandSize:getBandSizeOfAxis(n,o)}},createDefaultState=function(e){var n=e.children,o=e.defaultShowTooltip,l=findChildByType(n,Brush),d=0,f=0;return e.data&&e.data.length!==0&&(f=e.data.length-1),l&&l.props&&(l.props.startIndex>=0&&(d=l.props.startIndex),l.props.endIndex>=0&&(f=l.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:d,dataEndIndex:f,activeTooltipIndex:-1,isTooltipActive:!!o}},hasGraphicalBarItem=function(e){return!e||!e.length?!1:e.some(function(n){var o=getDisplayName(n&&n.type);return o&&o.indexOf("Bar")>=0})},getAxisNameByLayout=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},calculateOffset=function(e,n){var o=e.props,l=e.graphicalItems,d=e.xAxisMap,f=d===void 0?{}:d,g=e.yAxisMap,b=g===void 0?{}:g,_=o.width,S=o.height,R=o.children,C=o.margin||{},E=findChildByType(R,Brush),A=findChildByType(R,Legend),M=Object.keys(b).reduce(function(F,V){var te=b[V],ne=te.orientation;return!te.mirror&&!te.hide?_objectSpread(_objectSpread({},F),{},_defineProperty({},ne,F[ne]+te.width)):F},{left:C.left||0,right:C.right||0}),I=Object.keys(f).reduce(function(F,V){var te=f[V],ne=te.orientation;return!te.mirror&&!te.hide?_objectSpread(_objectSpread({},F),{},_defineProperty({},ne,get$1(F,"".concat(ne))+te.height)):F},{top:C.top||0,bottom:C.bottom||0}),j=_objectSpread(_objectSpread({},I),M),q=j.bottom;E&&(j.bottom+=E.props.height||Brush.defaultProps.height),A&&n&&(j=appendOffsetOfLegend(j,l,o,n));var z=_-j.left-j.right,Q=S-j.top-j.bottom;return _objectSpread(_objectSpread({brushBottom:q},j),{},{width:Math.max(z,0),height:Math.max(Q,0)})},getCartesianAxisSize=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},generateCategoricalChart=function(e){var n=e.chartName,o=e.GraphicalChild,l=e.defaultTooltipEventType,d=l===void 0?"axis":l,f=e.validateTooltipEventTypes,g=f===void 0?["axis"]:f,b=e.axisComponents,_=e.legendContent,S=e.formatAxisMap,R=e.defaultProps,C=function(j,q){var z=q.graphicalItems,Q=q.stackGroups,F=q.offset,V=q.updateId,te=q.dataStartIndex,ne=q.dataEndIndex,se=j.barSize,ge=j.layout,oe=j.barGap,Ae=j.barCategoryGap,je=j.maxBarSize,Ne=getAxisNameByLayout(ge),Oe=Ne.numericAxisName,Fe=Ne.cateAxisName,ze=hasGraphicalBarItem(z),$e=[];return z.forEach(function(Be,qe){var Ge=getDisplayedData(j.data,{graphicalItems:[Be],dataStartIndex:te,dataEndIndex:ne}),He=Be.type.defaultProps!==void 0?_objectSpread(_objectSpread({},Be.type.defaultProps),Be.props):Be.props,Ze=He.dataKey,tt=He.maxBarSize,Ye=He["".concat(Oe,"Id")],Qe=He["".concat(Fe,"Id")],Xe={},st=b.reduce(function(it,et){var ct,ft,dt=q["".concat(et.axisType,"Map")],Rt=He["".concat(et.axisType,"Id")];dt&&dt[Rt]||et.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?invariant$1(!1,"Specifying a(n) ".concat(et.axisType,"Id requires a corresponding ").concat(et.axisType,"Id on the targeted graphical component ").concat((ct=Be==null||(ft=Be.type)===null||ft===void 0?void 0:ft.displayName)!==null&&ct!==void 0?ct:"")):invariant$1());var zt=dt[Rt];return _objectSpread(_objectSpread({},it),{},_defineProperty(_defineProperty({},et.axisType,zt),"".concat(et.axisType,"Ticks"),getTicksOfAxis(zt)))},Xe),rt=st[Fe],at=st["".concat(Fe,"Ticks")],ot=Q&&Q[Ye]&&Q[Ye].hasStack&&getStackedDataOfItem(Be,Q[Ye].stackGroups),Ue=getDisplayName(Be.type).indexOf("Bar")>=0,Ct=getBandSizeOfAxis(rt,at),Je=[],yt=ze&&getBarSizeList({barSize:se,stackGroups:Q,totalSize:getCartesianAxisSize(st,Fe)});if(Ue){var Mt,qt,Ht=isNil(tt)?je:tt,Ft=(Mt=(qt=getBandSizeOfAxis(rt,at,!0))!==null&&qt!==void 0?qt:Ht)!==null&&Mt!==void 0?Mt:0;Je=getBarPosition({barGap:oe,barCategoryGap:Ae,bandSize:Ft!==Ct?Ft:Ct,sizeList:yt[Qe],maxBarSize:Ht}),Ft!==Ct&&(Je=Je.map(function(it){return _objectSpread(_objectSpread({},it),{},{position:_objectSpread(_objectSpread({},it.position),{},{offset:it.position.offset-Ft/2})})}))}var Ke=Be&&Be.type&&Be.type.getComposedData;Ke&&$e.push({props:_objectSpread(_objectSpread({},Ke(_objectSpread(_objectSpread({},st),{},{displayedData:Ge,props:j,dataKey:Ze,item:Be,bandSize:Ct,barPosition:Je,offset:F,stackedData:ot,layout:ge,dataStartIndex:te,dataEndIndex:ne}))),{},_defineProperty(_defineProperty(_defineProperty({key:Be.key||"item-".concat(qe)},Oe,st[Oe]),Fe,st[Fe]),"animationId",V)),childIndex:parseChildIndex(Be,j.children),item:Be})}),$e},E=function(j,q){var z=j.props,Q=j.dataStartIndex,F=j.dataEndIndex,V=j.updateId;if(!validateWidthHeight({props:z}))return null;var te=z.children,ne=z.layout,se=z.stackOffset,ge=z.data,oe=z.reverseStackOrder,Ae=getAxisNameByLayout(ne),je=Ae.numericAxisName,Ne=Ae.cateAxisName,Oe=findAllByType(te,o),Fe=getStackGroupsByAxisId(ge,Oe,"".concat(je,"Id"),"".concat(Ne,"Id"),se,oe),ze=b.reduce(function(He,Ze){var tt="".concat(Ze.axisType,"Map");return _objectSpread(_objectSpread({},He),{},_defineProperty({},tt,getAxisMap(z,_objectSpread(_objectSpread({},Ze),{},{graphicalItems:Oe,stackGroups:Ze.axisType===je&&Fe,dataStartIndex:Q,dataEndIndex:F}))))},{}),$e=calculateOffset(_objectSpread(_objectSpread({},ze),{},{props:z,graphicalItems:Oe}),q==null?void 0:q.legendBBox);Object.keys(ze).forEach(function(He){ze[He]=S(z,ze[He],$e,He.replace("Map",""),n)});var Be=ze["".concat(Ne,"Map")],qe=tooltipTicksGenerator(Be),Ge=C(z,_objectSpread(_objectSpread({},ze),{},{dataStartIndex:Q,dataEndIndex:F,updateId:V,graphicalItems:Oe,stackGroups:Fe,offset:$e}));return _objectSpread(_objectSpread({formattedGraphicalItems:Ge,graphicalItems:Oe,offset:$e,stackGroups:Fe},qe),ze)},A=function(I){function j(q){var z,Q,F;return _classCallCheck(this,j),F=_callSuper(this,j,[q]),_defineProperty(F,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),_defineProperty(F,"accessibilityManager",new AccessibilityManager),_defineProperty(F,"handleLegendBBoxUpdate",function(V){if(V){var te=F.state,ne=te.dataStartIndex,se=te.dataEndIndex,ge=te.updateId;F.setState(_objectSpread({legendBBox:V},E({props:F.props,dataStartIndex:ne,dataEndIndex:se,updateId:ge},_objectSpread(_objectSpread({},F.state),{},{legendBBox:V}))))}}),_defineProperty(F,"handleReceiveSyncEvent",function(V,te,ne){if(F.props.syncId===V){if(ne===F.eventEmitterSymbol&&typeof F.props.syncMethod!="function")return;F.applySyncEvent(te)}}),_defineProperty(F,"handleBrushChange",function(V){var te=V.startIndex,ne=V.endIndex;if(te!==F.state.dataStartIndex||ne!==F.state.dataEndIndex){var se=F.state.updateId;F.setState(function(){return _objectSpread({dataStartIndex:te,dataEndIndex:ne},E({props:F.props,dataStartIndex:te,dataEndIndex:ne,updateId:se},F.state))}),F.triggerSyncEvent({dataStartIndex:te,dataEndIndex:ne})}}),_defineProperty(F,"handleMouseEnter",function(V){var te=F.getMouseInfo(V);if(te){var ne=_objectSpread(_objectSpread({},te),{},{isTooltipActive:!0});F.setState(ne),F.triggerSyncEvent(ne);var se=F.props.onMouseEnter;isFunction$4(se)&&se(ne,V)}}),_defineProperty(F,"triggeredAfterMouseMove",function(V){var te=F.getMouseInfo(V),ne=te?_objectSpread(_objectSpread({},te),{},{isTooltipActive:!0}):{isTooltipActive:!1};F.setState(ne),F.triggerSyncEvent(ne);var se=F.props.onMouseMove;isFunction$4(se)&&se(ne,V)}),_defineProperty(F,"handleItemMouseEnter",function(V){F.setState(function(){return{isTooltipActive:!0,activeItem:V,activePayload:V.tooltipPayload,activeCoordinate:V.tooltipPosition||{x:V.cx,y:V.cy}}})}),_defineProperty(F,"handleItemMouseLeave",function(){F.setState(function(){return{isTooltipActive:!1}})}),_defineProperty(F,"handleMouseMove",function(V){V.persist(),F.throttleTriggeredAfterMouseMove(V)}),_defineProperty(F,"handleMouseLeave",function(V){F.throttleTriggeredAfterMouseMove.cancel();var te={isTooltipActive:!1};F.setState(te),F.triggerSyncEvent(te);var ne=F.props.onMouseLeave;isFunction$4(ne)&&ne(te,V)}),_defineProperty(F,"handleOuterEvent",function(V){var te=getReactEventByType(V),ne=get$1(F.props,"".concat(te));if(te&&isFunction$4(ne)){var se,ge;/.*touch.*/i.test(te)?ge=F.getMouseInfo(V.changedTouches[0]):ge=F.getMouseInfo(V),ne((se=ge)!==null&&se!==void 0?se:{},V)}}),_defineProperty(F,"handleClick",function(V){var te=F.getMouseInfo(V);if(te){var ne=_objectSpread(_objectSpread({},te),{},{isTooltipActive:!0});F.setState(ne),F.triggerSyncEvent(ne);var se=F.props.onClick;isFunction$4(se)&&se(ne,V)}}),_defineProperty(F,"handleMouseDown",function(V){var te=F.props.onMouseDown;if(isFunction$4(te)){var ne=F.getMouseInfo(V);te(ne,V)}}),_defineProperty(F,"handleMouseUp",function(V){var te=F.props.onMouseUp;if(isFunction$4(te)){var ne=F.getMouseInfo(V);te(ne,V)}}),_defineProperty(F,"handleTouchMove",function(V){V.changedTouches!=null&&V.changedTouches.length>0&&F.throttleTriggeredAfterMouseMove(V.changedTouches[0])}),_defineProperty(F,"handleTouchStart",function(V){V.changedTouches!=null&&V.changedTouches.length>0&&F.handleMouseDown(V.changedTouches[0])}),_defineProperty(F,"handleTouchEnd",function(V){V.changedTouches!=null&&V.changedTouches.length>0&&F.handleMouseUp(V.changedTouches[0])}),_defineProperty(F,"handleDoubleClick",function(V){var te=F.props.onDoubleClick;if(isFunction$4(te)){var ne=F.getMouseInfo(V);te(ne,V)}}),_defineProperty(F,"handleContextMenu",function(V){var te=F.props.onContextMenu;if(isFunction$4(te)){var ne=F.getMouseInfo(V);te(ne,V)}}),_defineProperty(F,"triggerSyncEvent",function(V){F.props.syncId!==void 0&&eventCenter.emit(SYNC_EVENT,F.props.syncId,V,F.eventEmitterSymbol)}),_defineProperty(F,"applySyncEvent",function(V){var te=F.props,ne=te.layout,se=te.syncMethod,ge=F.state.updateId,oe=V.dataStartIndex,Ae=V.dataEndIndex;if(V.dataStartIndex!==void 0||V.dataEndIndex!==void 0)F.setState(_objectSpread({dataStartIndex:oe,dataEndIndex:Ae},E({props:F.props,dataStartIndex:oe,dataEndIndex:Ae,updateId:ge},F.state)));else if(V.activeTooltipIndex!==void 0){var je=V.chartX,Ne=V.chartY,Oe=V.activeTooltipIndex,Fe=F.state,ze=Fe.offset,$e=Fe.tooltipTicks;if(!ze)return;if(typeof se=="function")Oe=se($e,V);else if(se==="value"){Oe=-1;for(var Be=0;Be<$e.length;Be++)if($e[Be].value===V.activeLabel){Oe=Be;break}}var qe=_objectSpread(_objectSpread({},ze),{},{x:ze.left,y:ze.top}),Ge=Math.min(je,qe.x+qe.width),He=Math.min(Ne,qe.y+qe.height),Ze=$e[Oe]&&$e[Oe].value,tt=getTooltipContent(F.state,F.props.data,Oe),Ye=$e[Oe]?{x:ne==="horizontal"?$e[Oe].coordinate:Ge,y:ne==="horizontal"?He:$e[Oe].coordinate}:originCoordinate;F.setState(_objectSpread(_objectSpread({},V),{},{activeLabel:Ze,activeCoordinate:Ye,activePayload:tt,activeTooltipIndex:Oe}))}else F.setState(V)}),_defineProperty(F,"renderCursor",function(V){var te,ne=F.state,se=ne.isTooltipActive,ge=ne.activeCoordinate,oe=ne.activePayload,Ae=ne.offset,je=ne.activeTooltipIndex,Ne=ne.tooltipAxisBandSize,Oe=F.getTooltipEventType(),Fe=(te=V.props.active)!==null&&te!==void 0?te:se,ze=F.props.layout,$e=V.key||"_recharts-cursor";return React.createElement(Cursor,{key:$e,activeCoordinate:ge,activePayload:oe,activeTooltipIndex:je,chartName:n,element:V,isActive:Fe,layout:ze,offset:Ae,tooltipAxisBandSize:Ne,tooltipEventType:Oe})}),_defineProperty(F,"renderPolarAxis",function(V,te,ne){var se=get$1(V,"type.axisType"),ge=get$1(F.state,"".concat(se,"Map")),oe=V.type.defaultProps,Ae=oe!==void 0?_objectSpread(_objectSpread({},oe),V.props):V.props,je=ge&&ge[Ae["".concat(se,"Id")]];return React.cloneElement(V,_objectSpread(_objectSpread({},je),{},{className:clsx(se,je.className),key:V.key||"".concat(te,"-").concat(ne),ticks:getTicksOfAxis(je,!0)}))}),_defineProperty(F,"renderPolarGrid",function(V){var te=V.props,ne=te.radialLines,se=te.polarAngles,ge=te.polarRadius,oe=F.state,Ae=oe.radiusAxisMap,je=oe.angleAxisMap,Ne=getAnyElementOfObject(Ae),Oe=getAnyElementOfObject(je),Fe=Oe.cx,ze=Oe.cy,$e=Oe.innerRadius,Be=Oe.outerRadius;return React.cloneElement(V,{polarAngles:Array.isArray(se)?se:getTicksOfAxis(Oe,!0).map(function(qe){return qe.coordinate}),polarRadius:Array.isArray(ge)?ge:getTicksOfAxis(Ne,!0).map(function(qe){return qe.coordinate}),cx:Fe,cy:ze,innerRadius:$e,outerRadius:Be,key:V.key||"polar-grid",radialLines:ne})}),_defineProperty(F,"renderLegend",function(){var V=F.state.formattedGraphicalItems,te=F.props,ne=te.children,se=te.width,ge=te.height,oe=F.props.margin||{},Ae=se-(oe.left||0)-(oe.right||0),je=getLegendProps({children:ne,formattedGraphicalItems:V,legendWidth:Ae,legendContent:_});if(!je)return null;var Ne=je.item,Oe=_objectWithoutProperties(je,_excluded);return React.cloneElement(Ne,_objectSpread(_objectSpread({},Oe),{},{chartWidth:se,chartHeight:ge,margin:oe,onBBoxUpdate:F.handleLegendBBoxUpdate}))}),_defineProperty(F,"renderTooltip",function(){var V,te=F.props,ne=te.children,se=te.accessibilityLayer,ge=findChildByType(ne,Tooltip);if(!ge)return null;var oe=F.state,Ae=oe.isTooltipActive,je=oe.activeCoordinate,Ne=oe.activePayload,Oe=oe.activeLabel,Fe=oe.offset,ze=(V=ge.props.active)!==null&&V!==void 0?V:Ae;return React.cloneElement(ge,{viewBox:_objectSpread(_objectSpread({},Fe),{},{x:Fe.left,y:Fe.top}),active:ze,label:Oe,payload:ze?Ne:[],coordinate:je,accessibilityLayer:se})}),_defineProperty(F,"renderBrush",function(V){var te=F.props,ne=te.margin,se=te.data,ge=F.state,oe=ge.offset,Ae=ge.dataStartIndex,je=ge.dataEndIndex,Ne=ge.updateId;return React.cloneElement(V,{key:V.key||"_recharts-brush",onChange:combineEventHandlers(F.handleBrushChange,V.props.onChange),data:se,x:isNumber$2(V.props.x)?V.props.x:oe.left,y:isNumber$2(V.props.y)?V.props.y:oe.top+oe.height+oe.brushBottom-(ne.bottom||0),width:isNumber$2(V.props.width)?V.props.width:oe.width,startIndex:Ae,endIndex:je,updateId:"brush-".concat(Ne)})}),_defineProperty(F,"renderReferenceElement",function(V,te,ne){if(!V)return null;var se=F,ge=se.clipPathId,oe=F.state,Ae=oe.xAxisMap,je=oe.yAxisMap,Ne=oe.offset,Oe=V.type.defaultProps||{},Fe=V.props,ze=Fe.xAxisId,$e=ze===void 0?Oe.xAxisId:ze,Be=Fe.yAxisId,qe=Be===void 0?Oe.yAxisId:Be;return React.cloneElement(V,{key:V.key||"".concat(te,"-").concat(ne),xAxis:Ae[$e],yAxis:je[qe],viewBox:{x:Ne.left,y:Ne.top,width:Ne.width,height:Ne.height},clipPathId:ge})}),_defineProperty(F,"renderActivePoints",function(V){var te=V.item,ne=V.activePoint,se=V.basePoint,ge=V.childIndex,oe=V.isRange,Ae=[],je=te.props.key,Ne=te.item.type.defaultProps!==void 0?_objectSpread(_objectSpread({},te.item.type.defaultProps),te.item.props):te.item.props,Oe=Ne.activeDot,Fe=Ne.dataKey,ze=_objectSpread(_objectSpread({index:ge,dataKey:Fe,cx:ne.x,cy:ne.y,r:4,fill:getMainColorOfGraphicItem(te.item),strokeWidth:2,stroke:"#fff",payload:ne.payload,value:ne.value},filterProps(Oe,!1)),adaptEventHandlers(Oe));return Ae.push(j.renderActiveDot(Oe,ze,"".concat(je,"-activePoint-").concat(ge))),se?Ae.push(j.renderActiveDot(Oe,_objectSpread(_objectSpread({},ze),{},{cx:se.x,cy:se.y}),"".concat(je,"-basePoint-").concat(ge))):oe&&Ae.push(null),Ae}),_defineProperty(F,"renderGraphicChild",function(V,te,ne){var se=F.filterFormatItem(V,te,ne);if(!se)return null;var ge=F.getTooltipEventType(),oe=F.state,Ae=oe.isTooltipActive,je=oe.tooltipAxis,Ne=oe.activeTooltipIndex,Oe=oe.activeLabel,Fe=F.props.children,ze=findChildByType(Fe,Tooltip),$e=se.props,Be=$e.points,qe=$e.isRange,Ge=$e.baseLine,He=se.item.type.defaultProps!==void 0?_objectSpread(_objectSpread({},se.item.type.defaultProps),se.item.props):se.item.props,Ze=He.activeDot,tt=He.hide,Ye=He.activeBar,Qe=He.activeShape,Xe=!!(!tt&&Ae&&ze&&(Ze||Ye||Qe)),st={};ge!=="axis"&&ze&&ze.props.trigger==="click"?st={onClick:combineEventHandlers(F.handleItemMouseEnter,V.props.onClick)}:ge!=="axis"&&(st={onMouseLeave:combineEventHandlers(F.handleItemMouseLeave,V.props.onMouseLeave),onMouseEnter:combineEventHandlers(F.handleItemMouseEnter,V.props.onMouseEnter)});var rt=React.cloneElement(V,_objectSpread(_objectSpread({},se.props),st));function at(et){return typeof je.dataKey=="function"?je.dataKey(et.payload):null}if(Xe)if(Ne>=0){var ot,Ue;if(je.dataKey&&!je.allowDuplicatedCategory){var Ct=typeof je.dataKey=="function"?at:"payload.".concat(je.dataKey.toString());ot=findEntryInArray(Be,Ct,Oe),Ue=qe&&Ge&&findEntryInArray(Ge,Ct,Oe)}else ot=Be==null?void 0:Be[Ne],Ue=qe&&Ge&&Ge[Ne];if(Qe||Ye){var Je=V.props.activeIndex!==void 0?V.props.activeIndex:Ne;return[React.cloneElement(V,_objectSpread(_objectSpread(_objectSpread({},se.props),st),{},{activeIndex:Je})),null,null]}if(!isNil(ot))return[rt].concat(_toConsumableArray(F.renderActivePoints({item:se,activePoint:ot,basePoint:Ue,childIndex:Ne,isRange:qe})))}else{var yt,Mt=(yt=F.getItemByXY(F.state.activeCoordinate))!==null&&yt!==void 0?yt:{graphicalItem:rt},qt=Mt.graphicalItem,Ht=qt.item,Ft=Ht===void 0?V:Ht,Ke=qt.childIndex,it=_objectSpread(_objectSpread(_objectSpread({},se.props),st),{},{activeIndex:Ke});return[React.cloneElement(Ft,it),null,null]}return qe?[rt,null,null]:[rt,null]}),_defineProperty(F,"renderCustomized",function(V,te,ne){return React.cloneElement(V,_objectSpread(_objectSpread({key:"recharts-customized-".concat(ne)},F.props),F.state))}),_defineProperty(F,"renderMap",{CartesianGrid:{handler:renderAsIs,once:!0},ReferenceArea:{handler:F.renderReferenceElement},ReferenceLine:{handler:renderAsIs},ReferenceDot:{handler:F.renderReferenceElement},XAxis:{handler:renderAsIs},YAxis:{handler:renderAsIs},Brush:{handler:F.renderBrush,once:!0},Bar:{handler:F.renderGraphicChild},Line:{handler:F.renderGraphicChild},Area:{handler:F.renderGraphicChild},Radar:{handler:F.renderGraphicChild},RadialBar:{handler:F.renderGraphicChild},Scatter:{handler:F.renderGraphicChild},Pie:{handler:F.renderGraphicChild},Funnel:{handler:F.renderGraphicChild},Tooltip:{handler:F.renderCursor,once:!0},PolarGrid:{handler:F.renderPolarGrid,once:!0},PolarAngleAxis:{handler:F.renderPolarAxis},PolarRadiusAxis:{handler:F.renderPolarAxis},Customized:{handler:F.renderCustomized}}),F.clipPathId="".concat((z=q.id)!==null&&z!==void 0?z:uniqueId("recharts"),"-clip"),F.throttleTriggeredAfterMouseMove=throttle(F.triggeredAfterMouseMove,(Q=q.throttleDelay)!==null&&Q!==void 0?Q:1e3/60),F.state={},F}return _inherits(j,I),_createClass(j,[{key:"componentDidMount",value:function(){var z,Q;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(z=this.props.margin.left)!==null&&z!==void 0?z:0,top:(Q=this.props.margin.top)!==null&&Q!==void 0?Q:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var z=this.props,Q=z.children,F=z.data,V=z.height,te=z.layout,ne=findChildByType(Q,Tooltip);if(ne){var se=ne.props.defaultIndex;if(!(typeof se!="number"||se<0||se>this.state.tooltipTicks.length-1)){var ge=this.state.tooltipTicks[se]&&this.state.tooltipTicks[se].value,oe=getTooltipContent(this.state,F,se,ge),Ae=this.state.tooltipTicks[se].coordinate,je=(this.state.offset.top+V)/2,Ne=te==="horizontal",Oe=Ne?{x:Ae,y:je}:{y:Ae,x:je},Fe=this.state.formattedGraphicalItems.find(function($e){var Be=$e.item;return Be.type.name==="Scatter"});Fe&&(Oe=_objectSpread(_objectSpread({},Oe),Fe.props.points[se].tooltipPosition),oe=Fe.props.points[se].tooltipPayload);var ze={activeTooltipIndex:se,isTooltipActive:!0,activeLabel:ge,activePayload:oe,activeCoordinate:Oe};this.setState(ze),this.renderCursor(ne),this.accessibilityManager.setIndex(se)}}}},{key:"getSnapshotBeforeUpdate",value:function(z,Q){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==Q.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==z.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==z.margin){var F,V;this.accessibilityManager.setDetails({offset:{left:(F=this.props.margin.left)!==null&&F!==void 0?F:0,top:(V=this.props.margin.top)!==null&&V!==void 0?V:0}})}return null}},{key:"componentDidUpdate",value:function(z){isChildrenEqual([findChildByType(z.children,Tooltip)],[findChildByType(this.props.children,Tooltip)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var z=findChildByType(this.props.children,Tooltip);if(z&&typeof z.props.shared=="boolean"){var Q=z.props.shared?"axis":"item";return g.indexOf(Q)>=0?Q:d}return d}},{key:"getMouseInfo",value:function(z){if(!this.container)return null;var Q=this.container,F=Q.getBoundingClientRect(),V=getOffset(F),te={chartX:Math.round(z.pageX-V.left),chartY:Math.round(z.pageY-V.top)},ne=F.width/Q.offsetWidth||1,se=this.inRange(te.chartX,te.chartY,ne);if(!se)return null;var ge=this.state,oe=ge.xAxisMap,Ae=ge.yAxisMap,je=this.getTooltipEventType(),Ne=getTooltipData(this.state,this.props.data,this.props.layout,se);if(je!=="axis"&&oe&&Ae){var Oe=getAnyElementOfObject(oe).scale,Fe=getAnyElementOfObject(Ae).scale,ze=Oe&&Oe.invert?Oe.invert(te.chartX):null,$e=Fe&&Fe.invert?Fe.invert(te.chartY):null;return _objectSpread(_objectSpread({},te),{},{xValue:ze,yValue:$e},Ne)}return Ne?_objectSpread(_objectSpread({},te),Ne):null}},{key:"inRange",value:function(z,Q){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,V=this.props.layout,te=z/F,ne=Q/F;if(V==="horizontal"||V==="vertical"){var se=this.state.offset,ge=te>=se.left&&te<=se.left+se.width&&ne>=se.top&&ne<=se.top+se.height;return ge?{x:te,y:ne}:null}var oe=this.state,Ae=oe.angleAxisMap,je=oe.radiusAxisMap;if(Ae&&je){var Ne=getAnyElementOfObject(Ae);return inRangeOfSector({x:te,y:ne},Ne)}return null}},{key:"parseEventsOfWrapper",value:function(){var z=this.props.children,Q=this.getTooltipEventType(),F=findChildByType(z,Tooltip),V={};F&&Q==="axis"&&(F.props.trigger==="click"?V={onClick:this.handleClick}:V={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 te=adaptEventHandlers(this.props,this.handleOuterEvent);return _objectSpread(_objectSpread({},te),V)}},{key:"addListener",value:function(){eventCenter.on(SYNC_EVENT,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){eventCenter.removeListener(SYNC_EVENT,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(z,Q,F){for(var V=this.state.formattedGraphicalItems,te=0,ne=V.length;te<ne;te++){var se=V[te];if(se.item===z||se.props.key===z.key||Q===getDisplayName(se.item.type)&&F===se.childIndex)return se}return null}},{key:"renderClipPath",value:function(){var z=this.clipPathId,Q=this.state.offset,F=Q.left,V=Q.top,te=Q.height,ne=Q.width;return React.createElement("defs",null,React.createElement("clipPath",{id:z},React.createElement("rect",{x:F,y:V,height:te,width:ne})))}},{key:"getXScales",value:function(){var z=this.state.xAxisMap;return z?Object.entries(z).reduce(function(Q,F){var V=_slicedToArray(F,2),te=V[0],ne=V[1];return _objectSpread(_objectSpread({},Q),{},_defineProperty({},te,ne.scale))},{}):null}},{key:"getYScales",value:function(){var z=this.state.yAxisMap;return z?Object.entries(z).reduce(function(Q,F){var V=_slicedToArray(F,2),te=V[0],ne=V[1];return _objectSpread(_objectSpread({},Q),{},_defineProperty({},te,ne.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(z){var Q;return(Q=this.state.xAxisMap)===null||Q===void 0||(Q=Q[z])===null||Q===void 0?void 0:Q.scale}},{key:"getYScaleByAxisId",value:function(z){var Q;return(Q=this.state.yAxisMap)===null||Q===void 0||(Q=Q[z])===null||Q===void 0?void 0:Q.scale}},{key:"getItemByXY",value:function(z){var Q=this.state,F=Q.formattedGraphicalItems,V=Q.activeItem;if(F&&F.length)for(var te=0,ne=F.length;te<ne;te++){var se=F[te],ge=se.props,oe=se.item,Ae=oe.type.defaultProps!==void 0?_objectSpread(_objectSpread({},oe.type.defaultProps),oe.props):oe.props,je=getDisplayName(oe.type);if(je==="Bar"){var Ne=(ge.data||[]).find(function($e){return isInRectangle(z,$e)});if(Ne)return{graphicalItem:se,payload:Ne}}else if(je==="RadialBar"){var Oe=(ge.data||[]).find(function($e){return inRangeOfSector(z,$e)});if(Oe)return{graphicalItem:se,payload:Oe}}else if(isFunnel(se,V)||isPie(se,V)||isScatter(se,V)){var Fe=getActiveShapeIndexForTooltip({graphicalItem:se,activeTooltipItem:V,itemData:Ae.data}),ze=Ae.activeIndex===void 0?Fe:Ae.activeIndex;return{graphicalItem:_objectSpread(_objectSpread({},se),{},{childIndex:ze}),payload:isScatter(se,V)?Ae.data[Fe]:se.props.data[Fe]}}}return null}},{key:"render",value:function(){var z=this;if(!validateWidthHeight(this))return null;var Q=this.props,F=Q.children,V=Q.className,te=Q.width,ne=Q.height,se=Q.style,ge=Q.compact,oe=Q.title,Ae=Q.desc,je=_objectWithoutProperties(Q,_excluded2),Ne=filterProps(je,!1);if(ge)return React.createElement(ChartLayoutContextProvider,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},React.createElement(Surface,_extends({},Ne,{width:te,height:ne,title:oe,desc:Ae}),this.renderClipPath(),renderByOrder(F,this.renderMap)));if(this.props.accessibilityLayer){var Oe,Fe;Ne.tabIndex=(Oe=this.props.tabIndex)!==null&&Oe!==void 0?Oe:0,Ne.role=(Fe=this.props.role)!==null&&Fe!==void 0?Fe:"application",Ne.onKeyDown=function($e){z.accessibilityManager.keyboardEvent($e)},Ne.onFocus=function(){z.accessibilityManager.focus()}}var ze=this.parseEventsOfWrapper();return React.createElement(ChartLayoutContextProvider,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},React.createElement("div",_extends({className:clsx("recharts-wrapper",V),style:_objectSpread({position:"relative",cursor:"default",width:te,height:ne},se)},ze,{ref:function(Be){z.container=Be}}),React.createElement(Surface,_extends({},Ne,{width:te,height:ne,title:oe,desc:Ae,style:FULL_WIDTH_AND_HEIGHT}),this.renderClipPath(),renderByOrder(F,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(React.Component);_defineProperty(A,"displayName",n),_defineProperty(A,"defaultProps",_objectSpread({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},R)),_defineProperty(A,"getDerivedStateFromProps",function(I,j){var q=I.dataKey,z=I.data,Q=I.children,F=I.width,V=I.height,te=I.layout,ne=I.stackOffset,se=I.margin,ge=j.dataStartIndex,oe=j.dataEndIndex;if(j.updateId===void 0){var Ae=createDefaultState(I);return _objectSpread(_objectSpread(_objectSpread({},Ae),{},{updateId:0},E(_objectSpread(_objectSpread({props:I},Ae),{},{updateId:0}),j)),{},{prevDataKey:q,prevData:z,prevWidth:F,prevHeight:V,prevLayout:te,prevStackOffset:ne,prevMargin:se,prevChildren:Q})}if(q!==j.prevDataKey||z!==j.prevData||F!==j.prevWidth||V!==j.prevHeight||te!==j.prevLayout||ne!==j.prevStackOffset||!shallowEqual(se,j.prevMargin)){var je=createDefaultState(I),Ne={chartX:j.chartX,chartY:j.chartY,isTooltipActive:j.isTooltipActive},Oe=_objectSpread(_objectSpread({},getTooltipData(j,z,te)),{},{updateId:j.updateId+1}),Fe=_objectSpread(_objectSpread(_objectSpread({},je),Ne),Oe);return _objectSpread(_objectSpread(_objectSpread({},Fe),E(_objectSpread({props:I},Fe),j)),{},{prevDataKey:q,prevData:z,prevWidth:F,prevHeight:V,prevLayout:te,prevStackOffset:ne,prevMargin:se,prevChildren:Q})}if(!isChildrenEqual(Q,j.prevChildren)){var ze,$e,Be,qe,Ge=findChildByType(Q,Brush),He=Ge&&(ze=($e=Ge.props)===null||$e===void 0?void 0:$e.startIndex)!==null&&ze!==void 0?ze:ge,Ze=Ge&&(Be=(qe=Ge.props)===null||qe===void 0?void 0:qe.endIndex)!==null&&Be!==void 0?Be:oe,tt=He!==ge||Ze!==oe,Ye=!isNil(z),Qe=Ye&&!tt?j.updateId:j.updateId+1;return _objectSpread(_objectSpread({updateId:Qe},E(_objectSpread(_objectSpread({props:I},j),{},{updateId:Qe,dataStartIndex:He,dataEndIndex:Ze}),j)),{},{prevChildren:Q,dataStartIndex:He,dataEndIndex:Ze})}return null}),_defineProperty(A,"renderActiveDot",function(I,j,q){var z;return React.isValidElement(I)?z=React.cloneElement(I,j):isFunction$4(I)?z=I(j):z=React.createElement(Dot,j),React.createElement(Layer,{className:"recharts-active-dot",key:q},z)});var M=React.forwardRef(function(j,q){return React.createElement(A,_extends({},j,{ref:q}))});return M.displayName=A.displayName,M},AreaChart$1=generateCategoricalChart({chartName:"AreaChart",GraphicalChild:Area,axisComponents:[{axisType:"xAxis",AxisComp:XAxis},{axisType:"yAxis",AxisComp:YAxis}],formatAxisMap});function ChartTooltipContent({active:t,payload:e,label:n,series:o}){if(t&&(e!=null&&e.length)){const l=new Map(o.map(d=>[d.name,d]));return jsxRuntime.jsxs("div",{className:"rounded-lg border bg-background p-2 text-sm shadow-sm",children:[jsxRuntime.jsx("div",{className:"mb-1 font-medium",children:n}),jsxRuntime.jsx("div",{className:"space-y-1",children:e.map(d=>{if(d.value===null||d.value===void 0)return null;const f=l.get(d.dataKey);if(!f)return null;const g=f.format==="money"?formatMoney(d.value):f.unitsPosition==="left"?`${f.units||""}${d.value}`:`${d.value}${f.units?` ${f.units}`:""}`;return jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("span",{className:"mr-2 h-2.5 w-2.5 rounded-full",style:{backgroundColor:f.color??"#000"}}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:f.label||d.name})]}),jsxRuntime.jsx("span",{className:"font-medium",children:g})]},d.dataKey)})})]})}return null}function AreaChart({data:t,series:e,height:n,className:o,size:l="default"}){if(!(t!=null&&t.length)||!(e!=null&&e.length))return jsxRuntime.jsx("div",{className:cn("flex items-center justify-center text-muted-foreground",o),style:l==="default"?{height:n}:{},children:"No data available"});const d=Object.keys(t[0])[0],f=l==="mini",g=e.filter(R=>R.yAxisId==="left"||!R.yAxisId),b=e.filter(R=>R.yAxisId==="right"),_=R=>{const C=g[0];return(C==null?void 0:C.format)==="money"?formatMoney(R,0):C!=null&&C.units?C.unitsPosition==="left"?`${C.units}${R}`:`${R}${C.units}`:String(R)},S=R=>{const C=b[0];return C!=null&&C.units?C.unitsPosition==="left"?`${C.units}${R}`:`${R}${C.units}`:String(R)};return jsxRuntime.jsx("div",{className:cn("w-full",o),style:{height:n?`${n}px`:"100%"},children:jsxRuntime.jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxRuntime.jsxs(AreaChart$1,{data:t,margin:f?{top:0,right:0,left:0,bottom:0}:{top:10,right:30,left:0,bottom:0},children:[jsxRuntime.jsx("defs",{children:e.map(R=>jsxRuntime.jsxs("linearGradient",{id:`gradient-${R.name}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{offset:"5%",stopColor:R.color,stopOpacity:.8}),jsxRuntime.jsx("stop",{offset:"95%",stopColor:R.color,stopOpacity:.1})]},R.name))}),!f&&jsxRuntime.jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-border/50"}),!f&&jsxRuntime.jsx(XAxis,{dataKey:d,className:"text-xs text-muted-foreground",tickLine:!1,axisLine:!1}),!f&&g.length>0&&jsxRuntime.jsx(YAxis,{yAxisId:"left",className:"text-xs text-muted-foreground",tickLine:!1,axisLine:!1,tickFormatter:_}),!f&&b.length>0&&jsxRuntime.jsx(YAxis,{yAxisId:"right",orientation:"right",className:"text-xs text-muted-foreground",tickLine:!1,axisLine:!1,tickFormatter:S}),!f&&jsxRuntime.jsx(Tooltip,{content:jsxRuntime.jsx(ChartTooltipContent,{series:e}),cursor:{stroke:"var(--muted)",strokeWidth:1}}),e.map(R=>jsxRuntime.jsx(Area,{yAxisId:R.yAxisId||"left",type:"monotone",dataKey:R.name,stroke:R.color,fillOpacity:.6,fill:`url(#gradient-${R.name})`,strokeWidth:f?1:2},R.name))]})})})}/*! *****************************************************************************
|
|
596
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _unsupportedIterableToArray(t,e){if(t){if(typeof t=="string")return _arrayLikeToArray(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(t,e)}}function _iterableToArray(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function ownKeys(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(t,l).enumerable})),n.push.apply(n,o)}return n}function _objectSpread(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ownKeys(Object(n),!0).forEach(function(o){_defineProperty(t,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(n,o))})}return t}function _defineProperty(t,e,n){return e=_toPropertyKey(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return _typeof(e)=="symbol"?e:e+""}function _toPrimitive(t,e){if(_typeof(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var o=n.call(t,e);if(_typeof(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ORIENT_MAP={xAxis:["bottom","top"],yAxis:["left","right"]},FULL_WIDTH_AND_HEIGHT={width:"100%",height:"100%"},originCoordinate={x:0,y:0};function renderAsIs(t){return t}var calculateTooltipPos=function(e,n){return n==="horizontal"?e.x:n==="vertical"?e.y:n==="centric"?e.angle:e.radius},getActiveCoordinate=function(e,n,o,l){var d=n.find(function(S){return S&&S.index===o});if(d){if(e==="horizontal")return{x:d.coordinate,y:l.y};if(e==="vertical")return{x:l.x,y:d.coordinate};if(e==="centric"){var f=d.coordinate,g=l.radius;return _objectSpread(_objectSpread(_objectSpread({},l),polarToCartesian(l.cx,l.cy,g,f)),{},{angle:f,radius:g})}var b=d.coordinate,_=l.angle;return _objectSpread(_objectSpread(_objectSpread({},l),polarToCartesian(l.cx,l.cy,b,_)),{},{angle:_,radius:b})}return originCoordinate},getDisplayedData=function(e,n){var o=n.graphicalItems,l=n.dataStartIndex,d=n.dataEndIndex,f=(o??[]).reduce(function(g,b){var _=b.props.data;return _&&_.length?[].concat(_toConsumableArray(g),_toConsumableArray(_)):g},[]);return f.length>0?f:e&&e.length&&isNumber$2(l)&&isNumber$2(d)?e.slice(l,d+1):[]};function getDefaultDomainByAxisType(t){return t==="number"?[0,"auto"]:void 0}var getTooltipContent=function(e,n,o,l){var d=e.graphicalItems,f=e.tooltipAxis,g=getDisplayedData(n,e);return o<0||!d||!d.length||o>=g.length?null:d.reduce(function(b,_){var S,R=(S=_.props.data)!==null&&S!==void 0?S:n;R&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=o&&(R=R.slice(e.dataStartIndex,e.dataEndIndex+1));var C;if(f.dataKey&&!f.allowDuplicatedCategory){var E=R===void 0?g:R;C=findEntryInArray(E,f.dataKey,l)}else C=R&&R[o]||g[o];return C?[].concat(_toConsumableArray(b),[getTooltipItem(_,C)]):b},[])},getTooltipData=function(e,n,o,l){var d=l||{x:e.chartX,y:e.chartY},f=calculateTooltipPos(d,o),g=e.orderedTooltipTicks,b=e.tooltipAxis,_=e.tooltipTicks,S=calculateActiveTickIndex(f,g,_,b);if(S>=0&&_){var R=_[S]&&_[S].value,C=getTooltipContent(e,n,S,R),E=getActiveCoordinate(o,g,S,d);return{activeTooltipIndex:S,activeLabel:R,activePayload:C,activeCoordinate:E}}return null},getAxisMapByAxes=function(e,n){var o=n.axes,l=n.graphicalItems,d=n.axisType,f=n.axisIdKey,g=n.stackGroups,b=n.dataStartIndex,_=n.dataEndIndex,S=e.layout,R=e.children,C=e.stackOffset,E=isCategoricalAxis(S,d);return o.reduce(function(A,M){var I,j=M.type.defaultProps!==void 0?_objectSpread(_objectSpread({},M.type.defaultProps),M.props):M.props,q=j.type,z=j.dataKey,Q=j.allowDataOverflow,F=j.allowDuplicatedCategory,V=j.scale,te=j.ticks,ne=j.includeHidden,se=j[f];if(A[se])return A;var ge=getDisplayedData(e.data,{graphicalItems:l.filter(function(He){var Ze,tt=f in He.props?He.props[f]:(Ze=He.type.defaultProps)===null||Ze===void 0?void 0:Ze[f];return tt===se}),dataStartIndex:b,dataEndIndex:_}),oe=ge.length,Ae,je,Ne;isDomainSpecifiedByUser(j.domain,Q,q)&&(Ae=parseSpecifiedDomain(j.domain,null,Q),E&&(q==="number"||V!=="auto")&&(Ne=getDomainOfDataByKey(ge,z,"category")));var Oe=getDefaultDomainByAxisType(q);if(!Ae||Ae.length===0){var Fe,ze=(Fe=j.domain)!==null&&Fe!==void 0?Fe:Oe;if(z){if(Ae=getDomainOfDataByKey(ge,z,q),q==="category"&&E){var $e=hasDuplicate(Ae);F&&$e?(je=Ae,Ae=range(0,oe)):F||(Ae=parseDomainOfCategoryAxis(ze,Ae,M).reduce(function(He,Ze){return He.indexOf(Ze)>=0?He:[].concat(_toConsumableArray(He),[Ze])},[]))}else if(q==="category")F?Ae=Ae.filter(function(He){return He!==""&&!isNil(He)}):Ae=parseDomainOfCategoryAxis(ze,Ae,M).reduce(function(He,Ze){return He.indexOf(Ze)>=0||Ze===""||isNil(Ze)?He:[].concat(_toConsumableArray(He),[Ze])},[]);else if(q==="number"){var Be=parseErrorBarsOfAxis(ge,l.filter(function(He){var Ze,tt,Ye=f in He.props?He.props[f]:(Ze=He.type.defaultProps)===null||Ze===void 0?void 0:Ze[f],Qe="hide"in He.props?He.props.hide:(tt=He.type.defaultProps)===null||tt===void 0?void 0:tt.hide;return Ye===se&&(ne||!Qe)}),z,d,S);Be&&(Ae=Be)}E&&(q==="number"||V!=="auto")&&(Ne=getDomainOfDataByKey(ge,z,"category"))}else E?Ae=range(0,oe):g&&g[se]&&g[se].hasStack&&q==="number"?Ae=C==="expand"?[0,1]:getDomainOfStackGroups(g[se].stackGroups,b,_):Ae=getDomainOfItemsWithSameAxis(ge,l.filter(function(He){var Ze=f in He.props?He.props[f]:He.type.defaultProps[f],tt="hide"in He.props?He.props.hide:He.type.defaultProps.hide;return Ze===se&&(ne||!tt)}),q,S,!0);if(q==="number")Ae=detectReferenceElementsDomain(R,Ae,se,d,te),ze&&(Ae=parseSpecifiedDomain(ze,Ae,Q));else if(q==="category"&&ze){var qe=ze,Ge=Ae.every(function(He){return qe.indexOf(He)>=0});Ge&&(Ae=qe)}}return _objectSpread(_objectSpread({},A),{},_defineProperty({},se,_objectSpread(_objectSpread({},j),{},{axisType:d,domain:Ae,categoricalDomain:Ne,duplicateDomain:je,originalDomain:(I=j.domain)!==null&&I!==void 0?I:Oe,isCategorical:E,layout:S})))},{})},getAxisMapByItems=function(e,n){var o=n.graphicalItems,l=n.Axis,d=n.axisType,f=n.axisIdKey,g=n.stackGroups,b=n.dataStartIndex,_=n.dataEndIndex,S=e.layout,R=e.children,C=getDisplayedData(e.data,{graphicalItems:o,dataStartIndex:b,dataEndIndex:_}),E=C.length,A=isCategoricalAxis(S,d),M=-1;return o.reduce(function(I,j){var q=j.type.defaultProps!==void 0?_objectSpread(_objectSpread({},j.type.defaultProps),j.props):j.props,z=q[f],Q=getDefaultDomainByAxisType("number");if(!I[z]){M++;var F;return A?F=range(0,E):g&&g[z]&&g[z].hasStack?(F=getDomainOfStackGroups(g[z].stackGroups,b,_),F=detectReferenceElementsDomain(R,F,z,d)):(F=parseSpecifiedDomain(Q,getDomainOfItemsWithSameAxis(C,o.filter(function(V){var te,ne,se=f in V.props?V.props[f]:(te=V.type.defaultProps)===null||te===void 0?void 0:te[f],ge="hide"in V.props?V.props.hide:(ne=V.type.defaultProps)===null||ne===void 0?void 0:ne.hide;return se===z&&!ge}),"number",S),l.defaultProps.allowDataOverflow),F=detectReferenceElementsDomain(R,F,z,d)),_objectSpread(_objectSpread({},I),{},_defineProperty({},z,_objectSpread(_objectSpread({axisType:d},l.defaultProps),{},{hide:!0,orientation:get$1(ORIENT_MAP,"".concat(d,".").concat(M%2),null),domain:F,originalDomain:Q,isCategorical:A,layout:S})))}return I},{})},getAxisMap=function(e,n){var o=n.axisType,l=o===void 0?"xAxis":o,d=n.AxisComp,f=n.graphicalItems,g=n.stackGroups,b=n.dataStartIndex,_=n.dataEndIndex,S=e.children,R="".concat(l,"Id"),C=findAllByType(S,d),E={};return C&&C.length?E=getAxisMapByAxes(e,{axes:C,graphicalItems:f,axisType:l,axisIdKey:R,stackGroups:g,dataStartIndex:b,dataEndIndex:_}):f&&f.length&&(E=getAxisMapByItems(e,{Axis:d,graphicalItems:f,axisType:l,axisIdKey:R,stackGroups:g,dataStartIndex:b,dataEndIndex:_})),E},tooltipTicksGenerator=function(e){var n=getAnyElementOfObject(e),o=getTicksOfAxis(n,!1,!0);return{tooltipTicks:o,orderedTooltipTicks:sortBy(o,function(l){return l.coordinate}),tooltipAxis:n,tooltipAxisBandSize:getBandSizeOfAxis(n,o)}},createDefaultState=function(e){var n=e.children,o=e.defaultShowTooltip,l=findChildByType(n,Brush),d=0,f=0;return e.data&&e.data.length!==0&&(f=e.data.length-1),l&&l.props&&(l.props.startIndex>=0&&(d=l.props.startIndex),l.props.endIndex>=0&&(f=l.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:d,dataEndIndex:f,activeTooltipIndex:-1,isTooltipActive:!!o}},hasGraphicalBarItem=function(e){return!e||!e.length?!1:e.some(function(n){var o=getDisplayName(n&&n.type);return o&&o.indexOf("Bar")>=0})},getAxisNameByLayout=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},calculateOffset=function(e,n){var o=e.props,l=e.graphicalItems,d=e.xAxisMap,f=d===void 0?{}:d,g=e.yAxisMap,b=g===void 0?{}:g,_=o.width,S=o.height,R=o.children,C=o.margin||{},E=findChildByType(R,Brush),A=findChildByType(R,Legend),M=Object.keys(b).reduce(function(F,V){var te=b[V],ne=te.orientation;return!te.mirror&&!te.hide?_objectSpread(_objectSpread({},F),{},_defineProperty({},ne,F[ne]+te.width)):F},{left:C.left||0,right:C.right||0}),I=Object.keys(f).reduce(function(F,V){var te=f[V],ne=te.orientation;return!te.mirror&&!te.hide?_objectSpread(_objectSpread({},F),{},_defineProperty({},ne,get$1(F,"".concat(ne))+te.height)):F},{top:C.top||0,bottom:C.bottom||0}),j=_objectSpread(_objectSpread({},I),M),q=j.bottom;E&&(j.bottom+=E.props.height||Brush.defaultProps.height),A&&n&&(j=appendOffsetOfLegend(j,l,o,n));var z=_-j.left-j.right,Q=S-j.top-j.bottom;return _objectSpread(_objectSpread({brushBottom:q},j),{},{width:Math.max(z,0),height:Math.max(Q,0)})},getCartesianAxisSize=function(e,n){if(n==="xAxis")return e[n].width;if(n==="yAxis")return e[n].height},generateCategoricalChart=function(e){var n=e.chartName,o=e.GraphicalChild,l=e.defaultTooltipEventType,d=l===void 0?"axis":l,f=e.validateTooltipEventTypes,g=f===void 0?["axis"]:f,b=e.axisComponents,_=e.legendContent,S=e.formatAxisMap,R=e.defaultProps,C=function(j,q){var z=q.graphicalItems,Q=q.stackGroups,F=q.offset,V=q.updateId,te=q.dataStartIndex,ne=q.dataEndIndex,se=j.barSize,ge=j.layout,oe=j.barGap,Ae=j.barCategoryGap,je=j.maxBarSize,Ne=getAxisNameByLayout(ge),Oe=Ne.numericAxisName,Fe=Ne.cateAxisName,ze=hasGraphicalBarItem(z),$e=[];return z.forEach(function(Be,qe){var Ge=getDisplayedData(j.data,{graphicalItems:[Be],dataStartIndex:te,dataEndIndex:ne}),He=Be.type.defaultProps!==void 0?_objectSpread(_objectSpread({},Be.type.defaultProps),Be.props):Be.props,Ze=He.dataKey,tt=He.maxBarSize,Ye=He["".concat(Oe,"Id")],Qe=He["".concat(Fe,"Id")],Xe={},st=b.reduce(function(it,et){var ct,ft,dt=q["".concat(et.axisType,"Map")],Rt=He["".concat(et.axisType,"Id")];dt&&dt[Rt]||et.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?invariant$1(!1,"Specifying a(n) ".concat(et.axisType,"Id requires a corresponding ").concat(et.axisType,"Id on the targeted graphical component ").concat((ct=Be==null||(ft=Be.type)===null||ft===void 0?void 0:ft.displayName)!==null&&ct!==void 0?ct:"")):invariant$1());var zt=dt[Rt];return _objectSpread(_objectSpread({},it),{},_defineProperty(_defineProperty({},et.axisType,zt),"".concat(et.axisType,"Ticks"),getTicksOfAxis(zt)))},Xe),rt=st[Fe],at=st["".concat(Fe,"Ticks")],ot=Q&&Q[Ye]&&Q[Ye].hasStack&&getStackedDataOfItem(Be,Q[Ye].stackGroups),Ue=getDisplayName(Be.type).indexOf("Bar")>=0,Ct=getBandSizeOfAxis(rt,at),Je=[],yt=ze&&getBarSizeList({barSize:se,stackGroups:Q,totalSize:getCartesianAxisSize(st,Fe)});if(Ue){var Mt,qt,Ht=isNil(tt)?je:tt,Ft=(Mt=(qt=getBandSizeOfAxis(rt,at,!0))!==null&&qt!==void 0?qt:Ht)!==null&&Mt!==void 0?Mt:0;Je=getBarPosition({barGap:oe,barCategoryGap:Ae,bandSize:Ft!==Ct?Ft:Ct,sizeList:yt[Qe],maxBarSize:Ht}),Ft!==Ct&&(Je=Je.map(function(it){return _objectSpread(_objectSpread({},it),{},{position:_objectSpread(_objectSpread({},it.position),{},{offset:it.position.offset-Ft/2})})}))}var Ke=Be&&Be.type&&Be.type.getComposedData;Ke&&$e.push({props:_objectSpread(_objectSpread({},Ke(_objectSpread(_objectSpread({},st),{},{displayedData:Ge,props:j,dataKey:Ze,item:Be,bandSize:Ct,barPosition:Je,offset:F,stackedData:ot,layout:ge,dataStartIndex:te,dataEndIndex:ne}))),{},_defineProperty(_defineProperty(_defineProperty({key:Be.key||"item-".concat(qe)},Oe,st[Oe]),Fe,st[Fe]),"animationId",V)),childIndex:parseChildIndex(Be,j.children),item:Be})}),$e},E=function(j,q){var z=j.props,Q=j.dataStartIndex,F=j.dataEndIndex,V=j.updateId;if(!validateWidthHeight({props:z}))return null;var te=z.children,ne=z.layout,se=z.stackOffset,ge=z.data,oe=z.reverseStackOrder,Ae=getAxisNameByLayout(ne),je=Ae.numericAxisName,Ne=Ae.cateAxisName,Oe=findAllByType(te,o),Fe=getStackGroupsByAxisId(ge,Oe,"".concat(je,"Id"),"".concat(Ne,"Id"),se,oe),ze=b.reduce(function(He,Ze){var tt="".concat(Ze.axisType,"Map");return _objectSpread(_objectSpread({},He),{},_defineProperty({},tt,getAxisMap(z,_objectSpread(_objectSpread({},Ze),{},{graphicalItems:Oe,stackGroups:Ze.axisType===je&&Fe,dataStartIndex:Q,dataEndIndex:F}))))},{}),$e=calculateOffset(_objectSpread(_objectSpread({},ze),{},{props:z,graphicalItems:Oe}),q==null?void 0:q.legendBBox);Object.keys(ze).forEach(function(He){ze[He]=S(z,ze[He],$e,He.replace("Map",""),n)});var Be=ze["".concat(Ne,"Map")],qe=tooltipTicksGenerator(Be),Ge=C(z,_objectSpread(_objectSpread({},ze),{},{dataStartIndex:Q,dataEndIndex:F,updateId:V,graphicalItems:Oe,stackGroups:Fe,offset:$e}));return _objectSpread(_objectSpread({formattedGraphicalItems:Ge,graphicalItems:Oe,offset:$e,stackGroups:Fe},qe),ze)},A=function(I){function j(q){var z,Q,F;return _classCallCheck(this,j),F=_callSuper(this,j,[q]),_defineProperty(F,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),_defineProperty(F,"accessibilityManager",new AccessibilityManager),_defineProperty(F,"handleLegendBBoxUpdate",function(V){if(V){var te=F.state,ne=te.dataStartIndex,se=te.dataEndIndex,ge=te.updateId;F.setState(_objectSpread({legendBBox:V},E({props:F.props,dataStartIndex:ne,dataEndIndex:se,updateId:ge},_objectSpread(_objectSpread({},F.state),{},{legendBBox:V}))))}}),_defineProperty(F,"handleReceiveSyncEvent",function(V,te,ne){if(F.props.syncId===V){if(ne===F.eventEmitterSymbol&&typeof F.props.syncMethod!="function")return;F.applySyncEvent(te)}}),_defineProperty(F,"handleBrushChange",function(V){var te=V.startIndex,ne=V.endIndex;if(te!==F.state.dataStartIndex||ne!==F.state.dataEndIndex){var se=F.state.updateId;F.setState(function(){return _objectSpread({dataStartIndex:te,dataEndIndex:ne},E({props:F.props,dataStartIndex:te,dataEndIndex:ne,updateId:se},F.state))}),F.triggerSyncEvent({dataStartIndex:te,dataEndIndex:ne})}}),_defineProperty(F,"handleMouseEnter",function(V){var te=F.getMouseInfo(V);if(te){var ne=_objectSpread(_objectSpread({},te),{},{isTooltipActive:!0});F.setState(ne),F.triggerSyncEvent(ne);var se=F.props.onMouseEnter;isFunction$4(se)&&se(ne,V)}}),_defineProperty(F,"triggeredAfterMouseMove",function(V){var te=F.getMouseInfo(V),ne=te?_objectSpread(_objectSpread({},te),{},{isTooltipActive:!0}):{isTooltipActive:!1};F.setState(ne),F.triggerSyncEvent(ne);var se=F.props.onMouseMove;isFunction$4(se)&&se(ne,V)}),_defineProperty(F,"handleItemMouseEnter",function(V){F.setState(function(){return{isTooltipActive:!0,activeItem:V,activePayload:V.tooltipPayload,activeCoordinate:V.tooltipPosition||{x:V.cx,y:V.cy}}})}),_defineProperty(F,"handleItemMouseLeave",function(){F.setState(function(){return{isTooltipActive:!1}})}),_defineProperty(F,"handleMouseMove",function(V){V.persist(),F.throttleTriggeredAfterMouseMove(V)}),_defineProperty(F,"handleMouseLeave",function(V){F.throttleTriggeredAfterMouseMove.cancel();var te={isTooltipActive:!1};F.setState(te),F.triggerSyncEvent(te);var ne=F.props.onMouseLeave;isFunction$4(ne)&&ne(te,V)}),_defineProperty(F,"handleOuterEvent",function(V){var te=getReactEventByType(V),ne=get$1(F.props,"".concat(te));if(te&&isFunction$4(ne)){var se,ge;/.*touch.*/i.test(te)?ge=F.getMouseInfo(V.changedTouches[0]):ge=F.getMouseInfo(V),ne((se=ge)!==null&&se!==void 0?se:{},V)}}),_defineProperty(F,"handleClick",function(V){var te=F.getMouseInfo(V);if(te){var ne=_objectSpread(_objectSpread({},te),{},{isTooltipActive:!0});F.setState(ne),F.triggerSyncEvent(ne);var se=F.props.onClick;isFunction$4(se)&&se(ne,V)}}),_defineProperty(F,"handleMouseDown",function(V){var te=F.props.onMouseDown;if(isFunction$4(te)){var ne=F.getMouseInfo(V);te(ne,V)}}),_defineProperty(F,"handleMouseUp",function(V){var te=F.props.onMouseUp;if(isFunction$4(te)){var ne=F.getMouseInfo(V);te(ne,V)}}),_defineProperty(F,"handleTouchMove",function(V){V.changedTouches!=null&&V.changedTouches.length>0&&F.throttleTriggeredAfterMouseMove(V.changedTouches[0])}),_defineProperty(F,"handleTouchStart",function(V){V.changedTouches!=null&&V.changedTouches.length>0&&F.handleMouseDown(V.changedTouches[0])}),_defineProperty(F,"handleTouchEnd",function(V){V.changedTouches!=null&&V.changedTouches.length>0&&F.handleMouseUp(V.changedTouches[0])}),_defineProperty(F,"handleDoubleClick",function(V){var te=F.props.onDoubleClick;if(isFunction$4(te)){var ne=F.getMouseInfo(V);te(ne,V)}}),_defineProperty(F,"handleContextMenu",function(V){var te=F.props.onContextMenu;if(isFunction$4(te)){var ne=F.getMouseInfo(V);te(ne,V)}}),_defineProperty(F,"triggerSyncEvent",function(V){F.props.syncId!==void 0&&eventCenter.emit(SYNC_EVENT,F.props.syncId,V,F.eventEmitterSymbol)}),_defineProperty(F,"applySyncEvent",function(V){var te=F.props,ne=te.layout,se=te.syncMethod,ge=F.state.updateId,oe=V.dataStartIndex,Ae=V.dataEndIndex;if(V.dataStartIndex!==void 0||V.dataEndIndex!==void 0)F.setState(_objectSpread({dataStartIndex:oe,dataEndIndex:Ae},E({props:F.props,dataStartIndex:oe,dataEndIndex:Ae,updateId:ge},F.state)));else if(V.activeTooltipIndex!==void 0){var je=V.chartX,Ne=V.chartY,Oe=V.activeTooltipIndex,Fe=F.state,ze=Fe.offset,$e=Fe.tooltipTicks;if(!ze)return;if(typeof se=="function")Oe=se($e,V);else if(se==="value"){Oe=-1;for(var Be=0;Be<$e.length;Be++)if($e[Be].value===V.activeLabel){Oe=Be;break}}var qe=_objectSpread(_objectSpread({},ze),{},{x:ze.left,y:ze.top}),Ge=Math.min(je,qe.x+qe.width),He=Math.min(Ne,qe.y+qe.height),Ze=$e[Oe]&&$e[Oe].value,tt=getTooltipContent(F.state,F.props.data,Oe),Ye=$e[Oe]?{x:ne==="horizontal"?$e[Oe].coordinate:Ge,y:ne==="horizontal"?He:$e[Oe].coordinate}:originCoordinate;F.setState(_objectSpread(_objectSpread({},V),{},{activeLabel:Ze,activeCoordinate:Ye,activePayload:tt,activeTooltipIndex:Oe}))}else F.setState(V)}),_defineProperty(F,"renderCursor",function(V){var te,ne=F.state,se=ne.isTooltipActive,ge=ne.activeCoordinate,oe=ne.activePayload,Ae=ne.offset,je=ne.activeTooltipIndex,Ne=ne.tooltipAxisBandSize,Oe=F.getTooltipEventType(),Fe=(te=V.props.active)!==null&&te!==void 0?te:se,ze=F.props.layout,$e=V.key||"_recharts-cursor";return React.createElement(Cursor,{key:$e,activeCoordinate:ge,activePayload:oe,activeTooltipIndex:je,chartName:n,element:V,isActive:Fe,layout:ze,offset:Ae,tooltipAxisBandSize:Ne,tooltipEventType:Oe})}),_defineProperty(F,"renderPolarAxis",function(V,te,ne){var se=get$1(V,"type.axisType"),ge=get$1(F.state,"".concat(se,"Map")),oe=V.type.defaultProps,Ae=oe!==void 0?_objectSpread(_objectSpread({},oe),V.props):V.props,je=ge&&ge[Ae["".concat(se,"Id")]];return React.cloneElement(V,_objectSpread(_objectSpread({},je),{},{className:clsx(se,je.className),key:V.key||"".concat(te,"-").concat(ne),ticks:getTicksOfAxis(je,!0)}))}),_defineProperty(F,"renderPolarGrid",function(V){var te=V.props,ne=te.radialLines,se=te.polarAngles,ge=te.polarRadius,oe=F.state,Ae=oe.radiusAxisMap,je=oe.angleAxisMap,Ne=getAnyElementOfObject(Ae),Oe=getAnyElementOfObject(je),Fe=Oe.cx,ze=Oe.cy,$e=Oe.innerRadius,Be=Oe.outerRadius;return React.cloneElement(V,{polarAngles:Array.isArray(se)?se:getTicksOfAxis(Oe,!0).map(function(qe){return qe.coordinate}),polarRadius:Array.isArray(ge)?ge:getTicksOfAxis(Ne,!0).map(function(qe){return qe.coordinate}),cx:Fe,cy:ze,innerRadius:$e,outerRadius:Be,key:V.key||"polar-grid",radialLines:ne})}),_defineProperty(F,"renderLegend",function(){var V=F.state.formattedGraphicalItems,te=F.props,ne=te.children,se=te.width,ge=te.height,oe=F.props.margin||{},Ae=se-(oe.left||0)-(oe.right||0),je=getLegendProps({children:ne,formattedGraphicalItems:V,legendWidth:Ae,legendContent:_});if(!je)return null;var Ne=je.item,Oe=_objectWithoutProperties(je,_excluded);return React.cloneElement(Ne,_objectSpread(_objectSpread({},Oe),{},{chartWidth:se,chartHeight:ge,margin:oe,onBBoxUpdate:F.handleLegendBBoxUpdate}))}),_defineProperty(F,"renderTooltip",function(){var V,te=F.props,ne=te.children,se=te.accessibilityLayer,ge=findChildByType(ne,Tooltip);if(!ge)return null;var oe=F.state,Ae=oe.isTooltipActive,je=oe.activeCoordinate,Ne=oe.activePayload,Oe=oe.activeLabel,Fe=oe.offset,ze=(V=ge.props.active)!==null&&V!==void 0?V:Ae;return React.cloneElement(ge,{viewBox:_objectSpread(_objectSpread({},Fe),{},{x:Fe.left,y:Fe.top}),active:ze,label:Oe,payload:ze?Ne:[],coordinate:je,accessibilityLayer:se})}),_defineProperty(F,"renderBrush",function(V){var te=F.props,ne=te.margin,se=te.data,ge=F.state,oe=ge.offset,Ae=ge.dataStartIndex,je=ge.dataEndIndex,Ne=ge.updateId;return React.cloneElement(V,{key:V.key||"_recharts-brush",onChange:combineEventHandlers(F.handleBrushChange,V.props.onChange),data:se,x:isNumber$2(V.props.x)?V.props.x:oe.left,y:isNumber$2(V.props.y)?V.props.y:oe.top+oe.height+oe.brushBottom-(ne.bottom||0),width:isNumber$2(V.props.width)?V.props.width:oe.width,startIndex:Ae,endIndex:je,updateId:"brush-".concat(Ne)})}),_defineProperty(F,"renderReferenceElement",function(V,te,ne){if(!V)return null;var se=F,ge=se.clipPathId,oe=F.state,Ae=oe.xAxisMap,je=oe.yAxisMap,Ne=oe.offset,Oe=V.type.defaultProps||{},Fe=V.props,ze=Fe.xAxisId,$e=ze===void 0?Oe.xAxisId:ze,Be=Fe.yAxisId,qe=Be===void 0?Oe.yAxisId:Be;return React.cloneElement(V,{key:V.key||"".concat(te,"-").concat(ne),xAxis:Ae[$e],yAxis:je[qe],viewBox:{x:Ne.left,y:Ne.top,width:Ne.width,height:Ne.height},clipPathId:ge})}),_defineProperty(F,"renderActivePoints",function(V){var te=V.item,ne=V.activePoint,se=V.basePoint,ge=V.childIndex,oe=V.isRange,Ae=[],je=te.props.key,Ne=te.item.type.defaultProps!==void 0?_objectSpread(_objectSpread({},te.item.type.defaultProps),te.item.props):te.item.props,Oe=Ne.activeDot,Fe=Ne.dataKey,ze=_objectSpread(_objectSpread({index:ge,dataKey:Fe,cx:ne.x,cy:ne.y,r:4,fill:getMainColorOfGraphicItem(te.item),strokeWidth:2,stroke:"#fff",payload:ne.payload,value:ne.value},filterProps(Oe,!1)),adaptEventHandlers(Oe));return Ae.push(j.renderActiveDot(Oe,ze,"".concat(je,"-activePoint-").concat(ge))),se?Ae.push(j.renderActiveDot(Oe,_objectSpread(_objectSpread({},ze),{},{cx:se.x,cy:se.y}),"".concat(je,"-basePoint-").concat(ge))):oe&&Ae.push(null),Ae}),_defineProperty(F,"renderGraphicChild",function(V,te,ne){var se=F.filterFormatItem(V,te,ne);if(!se)return null;var ge=F.getTooltipEventType(),oe=F.state,Ae=oe.isTooltipActive,je=oe.tooltipAxis,Ne=oe.activeTooltipIndex,Oe=oe.activeLabel,Fe=F.props.children,ze=findChildByType(Fe,Tooltip),$e=se.props,Be=$e.points,qe=$e.isRange,Ge=$e.baseLine,He=se.item.type.defaultProps!==void 0?_objectSpread(_objectSpread({},se.item.type.defaultProps),se.item.props):se.item.props,Ze=He.activeDot,tt=He.hide,Ye=He.activeBar,Qe=He.activeShape,Xe=!!(!tt&&Ae&&ze&&(Ze||Ye||Qe)),st={};ge!=="axis"&&ze&&ze.props.trigger==="click"?st={onClick:combineEventHandlers(F.handleItemMouseEnter,V.props.onClick)}:ge!=="axis"&&(st={onMouseLeave:combineEventHandlers(F.handleItemMouseLeave,V.props.onMouseLeave),onMouseEnter:combineEventHandlers(F.handleItemMouseEnter,V.props.onMouseEnter)});var rt=React.cloneElement(V,_objectSpread(_objectSpread({},se.props),st));function at(et){return typeof je.dataKey=="function"?je.dataKey(et.payload):null}if(Xe)if(Ne>=0){var ot,Ue;if(je.dataKey&&!je.allowDuplicatedCategory){var Ct=typeof je.dataKey=="function"?at:"payload.".concat(je.dataKey.toString());ot=findEntryInArray(Be,Ct,Oe),Ue=qe&&Ge&&findEntryInArray(Ge,Ct,Oe)}else ot=Be==null?void 0:Be[Ne],Ue=qe&&Ge&&Ge[Ne];if(Qe||Ye){var Je=V.props.activeIndex!==void 0?V.props.activeIndex:Ne;return[React.cloneElement(V,_objectSpread(_objectSpread(_objectSpread({},se.props),st),{},{activeIndex:Je})),null,null]}if(!isNil(ot))return[rt].concat(_toConsumableArray(F.renderActivePoints({item:se,activePoint:ot,basePoint:Ue,childIndex:Ne,isRange:qe})))}else{var yt,Mt=(yt=F.getItemByXY(F.state.activeCoordinate))!==null&&yt!==void 0?yt:{graphicalItem:rt},qt=Mt.graphicalItem,Ht=qt.item,Ft=Ht===void 0?V:Ht,Ke=qt.childIndex,it=_objectSpread(_objectSpread(_objectSpread({},se.props),st),{},{activeIndex:Ke});return[React.cloneElement(Ft,it),null,null]}return qe?[rt,null,null]:[rt,null]}),_defineProperty(F,"renderCustomized",function(V,te,ne){return React.cloneElement(V,_objectSpread(_objectSpread({key:"recharts-customized-".concat(ne)},F.props),F.state))}),_defineProperty(F,"renderMap",{CartesianGrid:{handler:renderAsIs,once:!0},ReferenceArea:{handler:F.renderReferenceElement},ReferenceLine:{handler:renderAsIs},ReferenceDot:{handler:F.renderReferenceElement},XAxis:{handler:renderAsIs},YAxis:{handler:renderAsIs},Brush:{handler:F.renderBrush,once:!0},Bar:{handler:F.renderGraphicChild},Line:{handler:F.renderGraphicChild},Area:{handler:F.renderGraphicChild},Radar:{handler:F.renderGraphicChild},RadialBar:{handler:F.renderGraphicChild},Scatter:{handler:F.renderGraphicChild},Pie:{handler:F.renderGraphicChild},Funnel:{handler:F.renderGraphicChild},Tooltip:{handler:F.renderCursor,once:!0},PolarGrid:{handler:F.renderPolarGrid,once:!0},PolarAngleAxis:{handler:F.renderPolarAxis},PolarRadiusAxis:{handler:F.renderPolarAxis},Customized:{handler:F.renderCustomized}}),F.clipPathId="".concat((z=q.id)!==null&&z!==void 0?z:uniqueId("recharts"),"-clip"),F.throttleTriggeredAfterMouseMove=throttle(F.triggeredAfterMouseMove,(Q=q.throttleDelay)!==null&&Q!==void 0?Q:1e3/60),F.state={},F}return _inherits(j,I),_createClass(j,[{key:"componentDidMount",value:function(){var z,Q;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(z=this.props.margin.left)!==null&&z!==void 0?z:0,top:(Q=this.props.margin.top)!==null&&Q!==void 0?Q:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var z=this.props,Q=z.children,F=z.data,V=z.height,te=z.layout,ne=findChildByType(Q,Tooltip);if(ne){var se=ne.props.defaultIndex;if(!(typeof se!="number"||se<0||se>this.state.tooltipTicks.length-1)){var ge=this.state.tooltipTicks[se]&&this.state.tooltipTicks[se].value,oe=getTooltipContent(this.state,F,se,ge),Ae=this.state.tooltipTicks[se].coordinate,je=(this.state.offset.top+V)/2,Ne=te==="horizontal",Oe=Ne?{x:Ae,y:je}:{y:Ae,x:je},Fe=this.state.formattedGraphicalItems.find(function($e){var Be=$e.item;return Be.type.name==="Scatter"});Fe&&(Oe=_objectSpread(_objectSpread({},Oe),Fe.props.points[se].tooltipPosition),oe=Fe.props.points[se].tooltipPayload);var ze={activeTooltipIndex:se,isTooltipActive:!0,activeLabel:ge,activePayload:oe,activeCoordinate:Oe};this.setState(ze),this.renderCursor(ne),this.accessibilityManager.setIndex(se)}}}},{key:"getSnapshotBeforeUpdate",value:function(z,Q){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==Q.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==z.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==z.margin){var F,V;this.accessibilityManager.setDetails({offset:{left:(F=this.props.margin.left)!==null&&F!==void 0?F:0,top:(V=this.props.margin.top)!==null&&V!==void 0?V:0}})}return null}},{key:"componentDidUpdate",value:function(z){isChildrenEqual([findChildByType(z.children,Tooltip)],[findChildByType(this.props.children,Tooltip)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var z=findChildByType(this.props.children,Tooltip);if(z&&typeof z.props.shared=="boolean"){var Q=z.props.shared?"axis":"item";return g.indexOf(Q)>=0?Q:d}return d}},{key:"getMouseInfo",value:function(z){if(!this.container)return null;var Q=this.container,F=Q.getBoundingClientRect(),V=getOffset(F),te={chartX:Math.round(z.pageX-V.left),chartY:Math.round(z.pageY-V.top)},ne=F.width/Q.offsetWidth||1,se=this.inRange(te.chartX,te.chartY,ne);if(!se)return null;var ge=this.state,oe=ge.xAxisMap,Ae=ge.yAxisMap,je=this.getTooltipEventType(),Ne=getTooltipData(this.state,this.props.data,this.props.layout,se);if(je!=="axis"&&oe&&Ae){var Oe=getAnyElementOfObject(oe).scale,Fe=getAnyElementOfObject(Ae).scale,ze=Oe&&Oe.invert?Oe.invert(te.chartX):null,$e=Fe&&Fe.invert?Fe.invert(te.chartY):null;return _objectSpread(_objectSpread({},te),{},{xValue:ze,yValue:$e},Ne)}return Ne?_objectSpread(_objectSpread({},te),Ne):null}},{key:"inRange",value:function(z,Q){var F=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,V=this.props.layout,te=z/F,ne=Q/F;if(V==="horizontal"||V==="vertical"){var se=this.state.offset,ge=te>=se.left&&te<=se.left+se.width&&ne>=se.top&&ne<=se.top+se.height;return ge?{x:te,y:ne}:null}var oe=this.state,Ae=oe.angleAxisMap,je=oe.radiusAxisMap;if(Ae&&je){var Ne=getAnyElementOfObject(Ae);return inRangeOfSector({x:te,y:ne},Ne)}return null}},{key:"parseEventsOfWrapper",value:function(){var z=this.props.children,Q=this.getTooltipEventType(),F=findChildByType(z,Tooltip),V={};F&&Q==="axis"&&(F.props.trigger==="click"?V={onClick:this.handleClick}:V={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 te=adaptEventHandlers(this.props,this.handleOuterEvent);return _objectSpread(_objectSpread({},te),V)}},{key:"addListener",value:function(){eventCenter.on(SYNC_EVENT,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){eventCenter.removeListener(SYNC_EVENT,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(z,Q,F){for(var V=this.state.formattedGraphicalItems,te=0,ne=V.length;te<ne;te++){var se=V[te];if(se.item===z||se.props.key===z.key||Q===getDisplayName(se.item.type)&&F===se.childIndex)return se}return null}},{key:"renderClipPath",value:function(){var z=this.clipPathId,Q=this.state.offset,F=Q.left,V=Q.top,te=Q.height,ne=Q.width;return React.createElement("defs",null,React.createElement("clipPath",{id:z},React.createElement("rect",{x:F,y:V,height:te,width:ne})))}},{key:"getXScales",value:function(){var z=this.state.xAxisMap;return z?Object.entries(z).reduce(function(Q,F){var V=_slicedToArray(F,2),te=V[0],ne=V[1];return _objectSpread(_objectSpread({},Q),{},_defineProperty({},te,ne.scale))},{}):null}},{key:"getYScales",value:function(){var z=this.state.yAxisMap;return z?Object.entries(z).reduce(function(Q,F){var V=_slicedToArray(F,2),te=V[0],ne=V[1];return _objectSpread(_objectSpread({},Q),{},_defineProperty({},te,ne.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(z){var Q;return(Q=this.state.xAxisMap)===null||Q===void 0||(Q=Q[z])===null||Q===void 0?void 0:Q.scale}},{key:"getYScaleByAxisId",value:function(z){var Q;return(Q=this.state.yAxisMap)===null||Q===void 0||(Q=Q[z])===null||Q===void 0?void 0:Q.scale}},{key:"getItemByXY",value:function(z){var Q=this.state,F=Q.formattedGraphicalItems,V=Q.activeItem;if(F&&F.length)for(var te=0,ne=F.length;te<ne;te++){var se=F[te],ge=se.props,oe=se.item,Ae=oe.type.defaultProps!==void 0?_objectSpread(_objectSpread({},oe.type.defaultProps),oe.props):oe.props,je=getDisplayName(oe.type);if(je==="Bar"){var Ne=(ge.data||[]).find(function($e){return isInRectangle(z,$e)});if(Ne)return{graphicalItem:se,payload:Ne}}else if(je==="RadialBar"){var Oe=(ge.data||[]).find(function($e){return inRangeOfSector(z,$e)});if(Oe)return{graphicalItem:se,payload:Oe}}else if(isFunnel(se,V)||isPie(se,V)||isScatter(se,V)){var Fe=getActiveShapeIndexForTooltip({graphicalItem:se,activeTooltipItem:V,itemData:Ae.data}),ze=Ae.activeIndex===void 0?Fe:Ae.activeIndex;return{graphicalItem:_objectSpread(_objectSpread({},se),{},{childIndex:ze}),payload:isScatter(se,V)?Ae.data[Fe]:se.props.data[Fe]}}}return null}},{key:"render",value:function(){var z=this;if(!validateWidthHeight(this))return null;var Q=this.props,F=Q.children,V=Q.className,te=Q.width,ne=Q.height,se=Q.style,ge=Q.compact,oe=Q.title,Ae=Q.desc,je=_objectWithoutProperties(Q,_excluded2),Ne=filterProps(je,!1);if(ge)return React.createElement(ChartLayoutContextProvider,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},React.createElement(Surface,_extends({},Ne,{width:te,height:ne,title:oe,desc:Ae}),this.renderClipPath(),renderByOrder(F,this.renderMap)));if(this.props.accessibilityLayer){var Oe,Fe;Ne.tabIndex=(Oe=this.props.tabIndex)!==null&&Oe!==void 0?Oe:0,Ne.role=(Fe=this.props.role)!==null&&Fe!==void 0?Fe:"application",Ne.onKeyDown=function($e){z.accessibilityManager.keyboardEvent($e)},Ne.onFocus=function(){z.accessibilityManager.focus()}}var ze=this.parseEventsOfWrapper();return React.createElement(ChartLayoutContextProvider,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},React.createElement("div",_extends({className:clsx("recharts-wrapper",V),style:_objectSpread({position:"relative",cursor:"default",width:te,height:ne},se)},ze,{ref:function(Be){z.container=Be}}),React.createElement(Surface,_extends({},Ne,{width:te,height:ne,title:oe,desc:Ae,style:FULL_WIDTH_AND_HEIGHT}),this.renderClipPath(),renderByOrder(F,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(React.Component);_defineProperty(A,"displayName",n),_defineProperty(A,"defaultProps",_objectSpread({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},R)),_defineProperty(A,"getDerivedStateFromProps",function(I,j){var q=I.dataKey,z=I.data,Q=I.children,F=I.width,V=I.height,te=I.layout,ne=I.stackOffset,se=I.margin,ge=j.dataStartIndex,oe=j.dataEndIndex;if(j.updateId===void 0){var Ae=createDefaultState(I);return _objectSpread(_objectSpread(_objectSpread({},Ae),{},{updateId:0},E(_objectSpread(_objectSpread({props:I},Ae),{},{updateId:0}),j)),{},{prevDataKey:q,prevData:z,prevWidth:F,prevHeight:V,prevLayout:te,prevStackOffset:ne,prevMargin:se,prevChildren:Q})}if(q!==j.prevDataKey||z!==j.prevData||F!==j.prevWidth||V!==j.prevHeight||te!==j.prevLayout||ne!==j.prevStackOffset||!shallowEqual(se,j.prevMargin)){var je=createDefaultState(I),Ne={chartX:j.chartX,chartY:j.chartY,isTooltipActive:j.isTooltipActive},Oe=_objectSpread(_objectSpread({},getTooltipData(j,z,te)),{},{updateId:j.updateId+1}),Fe=_objectSpread(_objectSpread(_objectSpread({},je),Ne),Oe);return _objectSpread(_objectSpread(_objectSpread({},Fe),E(_objectSpread({props:I},Fe),j)),{},{prevDataKey:q,prevData:z,prevWidth:F,prevHeight:V,prevLayout:te,prevStackOffset:ne,prevMargin:se,prevChildren:Q})}if(!isChildrenEqual(Q,j.prevChildren)){var ze,$e,Be,qe,Ge=findChildByType(Q,Brush),He=Ge&&(ze=($e=Ge.props)===null||$e===void 0?void 0:$e.startIndex)!==null&&ze!==void 0?ze:ge,Ze=Ge&&(Be=(qe=Ge.props)===null||qe===void 0?void 0:qe.endIndex)!==null&&Be!==void 0?Be:oe,tt=He!==ge||Ze!==oe,Ye=!isNil(z),Qe=Ye&&!tt?j.updateId:j.updateId+1;return _objectSpread(_objectSpread({updateId:Qe},E(_objectSpread(_objectSpread({props:I},j),{},{updateId:Qe,dataStartIndex:He,dataEndIndex:Ze}),j)),{},{prevChildren:Q,dataStartIndex:He,dataEndIndex:Ze})}return null}),_defineProperty(A,"renderActiveDot",function(I,j,q){var z;return React.isValidElement(I)?z=React.cloneElement(I,j):isFunction$4(I)?z=I(j):z=React.createElement(Dot,j),React.createElement(Layer,{className:"recharts-active-dot",key:q},z)});var M=React.forwardRef(function(j,q){return React.createElement(A,_extends({},j,{ref:q}))});return M.displayName=A.displayName,M},AreaChart$1=generateCategoricalChart({chartName:"AreaChart",GraphicalChild:Area,axisComponents:[{axisType:"xAxis",AxisComp:XAxis},{axisType:"yAxis",AxisComp:YAxis}],formatAxisMap});function ChartTooltipContent({active:t,payload:e,label:n,series:o}){if(t&&(e!=null&&e.length)){const l=new Map(o.map(d=>[d.name,d]));return jsxRuntime.jsxs("div",{className:"rounded-lg border bg-background p-2 text-sm shadow-sm",children:[jsxRuntime.jsx("div",{className:"mb-1 font-medium",children:n}),jsxRuntime.jsx("div",{className:"space-y-1",children:e.map(d=>{if(d.value===null||d.value===void 0)return null;const f=l.get(d.dataKey);if(!f)return null;const g=f.format==="money"&&typeof d.value=="number"?formatMoney(d.value):f.format==="integer"&&typeof d.value=="number"?formatNumber(d.value,{maximumFractionDigits:2}):f.unitsPosition==="left"?`${f.units||""}${d.value}`:`${d.value}${f.units?` ${f.units}`:""}`;return jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx("span",{className:"mr-2 h-2.5 w-2.5 rounded-full",style:{backgroundColor:f.color??"#000"}}),jsxRuntime.jsx("span",{className:"text-muted-foreground",children:f.label||d.name})]}),jsxRuntime.jsx("span",{className:"font-medium",children:g})]},d.dataKey)})})]})}return null}function AreaChart({data:t,series:e,height:n,className:o,size:l="default"}){if(!(t!=null&&t.length)||!(e!=null&&e.length))return jsxRuntime.jsx("div",{className:cn("flex items-center justify-center text-muted-foreground",o),style:l==="default"?{height:n}:{},children:"No data available"});const d=Object.keys(t[0])[0],f=l==="mini",g=e.filter(R=>R.yAxisId==="left"||!R.yAxisId),b=e.filter(R=>R.yAxisId==="right"),_=R=>{const C=g[0];return(C==null?void 0:C.format)==="money"?formatMoney(R,{minimumFractionDigits:0,maximumFractionDigits:0}):C!=null&&C.units?C.unitsPosition==="left"?`${C.units}${R}`:`${R}${C.units}`:String(R)},S=R=>{const C=b[0];return(C==null?void 0:C.format)==="money"?formatMoney(R,{minimumFractionDigits:0,maximumFractionDigits:0}):C!=null&&C.units?C.unitsPosition==="left"?`${C.units}${R}`:`${R}${C.units}`:String(R)};return jsxRuntime.jsx("div",{className:cn("w-full",o),style:{height:n?`${n}px`:"100%"},children:jsxRuntime.jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxRuntime.jsxs(AreaChart$1,{data:t,margin:f?{top:0,right:0,left:0,bottom:0}:{top:10,right:30,left:0,bottom:0},children:[jsxRuntime.jsx("defs",{children:e.map(R=>jsxRuntime.jsxs("linearGradient",{id:`gradient-${R.name}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[jsxRuntime.jsx("stop",{offset:"5%",stopColor:R.color,stopOpacity:.8}),jsxRuntime.jsx("stop",{offset:"95%",stopColor:R.color,stopOpacity:.1})]},R.name))}),!f&&jsxRuntime.jsx(CartesianGrid,{strokeDasharray:"3 3",className:"stroke-border/50"}),!f&&jsxRuntime.jsx(XAxis,{dataKey:d,className:"text-xs text-muted-foreground",tickLine:!1,axisLine:!1}),!f&&g.length>0&&jsxRuntime.jsx(YAxis,{yAxisId:"left",className:"text-xs text-muted-foreground",tickLine:!1,axisLine:!1,tickFormatter:_}),!f&&b.length>0&&jsxRuntime.jsx(YAxis,{yAxisId:"right",orientation:"right",className:"text-xs text-muted-foreground",tickLine:!1,axisLine:!1,tickFormatter:S}),!f&&jsxRuntime.jsx(Tooltip,{content:jsxRuntime.jsx(ChartTooltipContent,{series:e}),cursor:{stroke:"var(--muted)",strokeWidth:1}}),e.map(R=>jsxRuntime.jsx(Area,{yAxisId:R.yAxisId||"left",type:"monotone",dataKey:R.name,stroke:R.color,fillOpacity:.6,fill:`url(#gradient-${R.name})`,strokeWidth:f?1:2},R.name))]})})})}/*! *****************************************************************************
|
|
597
597
|
Copyright (c) Microsoft Corporation.
|
|
598
598
|
|
|
599
599
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -1076,7 +1076,7 @@ Please report this to https://github.com/markedjs/marked.`,t){const o="<p>An err
|
|
|
1076
1076
|
|
|
1077
1077
|
Defaulting to \`null\`.`}var Root=Progress$1,Indicator=ProgressIndicator;const Progress=React__namespace.forwardRef(({className:t,value:e,...n},o)=>jsxRuntime.jsx(Root,{ref:o,className:cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",t),...n,children:jsxRuntime.jsx(Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));Progress.displayName=Root.displayName;function ManufacturerInventoryFinanceCard({manufacturer:t,isLoading:e}){const{data:n,isLoading:o,isFetching:l}=useGetV4ManufacturerByRouteManufacturerIdInventoryValueQuery({routeManufacturerId:(t==null?void 0:t.ManufacturerId)??""},{skip:!(t!=null&&t.ManufacturerId)}),d=(t==null?void 0:t.DefaultMaxInventoryValue)??0,f=(n||[]).reduce((_,S)=>_+(S.InventoryValue||0),0),g=d-f,b=Math.round(f/d*100);return e||o||l?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsx(Skeleton,{className:"h-7 w-3/4"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/2 mt-2"})]}),jsxRuntime.jsxs(CardContent,{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/4"})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/4"})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/4"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16"})]}),jsxRuntime.jsx(Skeleton,{className:"h-2 w-full"})]})]})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsxs(CardTitle,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(DollarSign,{className:"h-5 w-5 text-muted-foreground"}),"Inventory Finance"]}),jsxRuntime.jsx(CardDescription,{children:"Current inventory financial status"})]}),jsxRuntime.jsxs(CardContent,{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Max Allowance"}),jsxRuntime.jsx("span",{className:"font-bold",children:formatMoney(d)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Current Funds"}),jsxRuntime.jsx("span",{className:"font-bold",children:formatMoney(f)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Available Funds"}),jsxRuntime.jsx("span",{className:`font-bold ${g>=0?"text-emerald-600 dark:text-emerald-500":"text-red-600 dark:text-red-500"}`,children:formatMoney(g)})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Budget Usage"}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:[b,"%"]}),b>80&&jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4 text-amber-500"})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:b>80?"High usage alert":"Budget usage"})})]})})]}),jsxRuntime.jsx(Progress,{value:b,className:"h-2"})]})]})]})}function ManufacturerCreditFinanceCard({manufacturer:t,isLoading:e}){const n=(t==null?void 0:t.CreditLimit)??0,o=(t==null?void 0:t.OutstandingBalance)??0,l=n-o,d=Math.round(o/n*100);return e?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsx(Skeleton,{className:"h-7 w-3/4"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/2 mt-2"})]}),jsxRuntime.jsxs(CardContent,{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/4"})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/4"})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/4"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16"})]}),jsxRuntime.jsx(Skeleton,{className:"h-2 w-full"})]})]})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsxs(CardTitle,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(CreditCard,{className:"h-5 w-5 text-muted-foreground"}),"Credit Finance"]}),jsxRuntime.jsx(CardDescription,{children:"Current credit financial status"})]}),jsxRuntime.jsxs(CardContent,{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Credit Limit"}),jsxRuntime.jsx("span",{className:"font-bold",children:formatMoney(n)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Outstanding Balance"}),jsxRuntime.jsx("span",{className:"font-bold",children:formatMoney(o)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Available Credit"}),jsxRuntime.jsx("span",{className:`font-bold ${l>=0?"text-emerald-600 dark:text-emerald-500":"text-red-600 dark:text-red-500"}`,children:formatMoney(l)})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Credit Usage"}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:[d,"%"]}),d>80&&jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4 text-amber-500"})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:d>80?"High credit usage alert":"Credit usage"})})]})})]}),jsxRuntime.jsx(Progress,{value:d,className:"h-2"})]})]})]})}function SalesChartCard({statistics:t,loading:e=!1,mode:n="month",chartHeight:o=300,className:l,size:d="default"}){return e?jsxRuntime.jsxs(Card,{className:cn("w-full",l),children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-48 rounded-md"})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{style:{height:o},children:jsxRuntime.jsx(Skeleton,{className:"h-full w-full rounded-md"})}),d==="default"&&n==="month"&&jsxRuntime.jsxs("div",{className:"mt-4 flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-10 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40 rounded-md"})]})]})]}):jsxRuntime.jsxs(Card,{className:cn("w-full",l),children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:n==="week"?"Weekly Sales Performance":"Monthly Sales Performance"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(SalesChart,{statistics:t,mode:n,chartHeight:o,size:d})})]})}function ManufacturerOverviewPage({applicationId:t,readonly:e,withReports:n,manufacturer:o,userEmail:l}){const{data:d,isLoading:f,isError:g}=useGetV4PartnerByApplicationIdAccountManufacturerQuery({applicationId:t,withSpecification:!0},{skip:!!o}),[b,_]=React.useState({publicInfo:{hasUnsavedChanges:!1},qualifications:{hasUnsavedChanges:!1},billingInfo:{hasUnsavedChanges:!1}}),S=React.useCallback(()=>e?!1:b.publicInfo.hasUnsavedChanges||b.qualifications.hasUnsavedChanges||b.billingInfo.hasUnsavedChanges,[e,b]),R=React.useCallback((A,M)=>{_(I=>{var j;return((j=I[A])==null?void 0:j.hasUnsavedChanges)!==M.hasUnsavedChanges?(console.log(`Updating form state for ${A}:`,M.hasUnsavedChanges),{...I,[A]:M}):I})},[]),{NavigationGuardDialog:C}=useRouterNavigationGuard(S),E=o??d;return jsxRuntime.jsxs("div",{className:"@container",children:[g?jsxRuntime.jsx(Card,{className:"p-6",children:jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Error"}),jsxRuntime.jsx(AlertDescription,{children:"There was an error loading your manufacturer information. Please try again later."})]})}):jsxRuntime.jsxs("div",{className:"space-y-6 mb-6",children:[jsxRuntime.jsx(SalesSummary,{fiscalYearMonthStart:E==null?void 0:E.FiscalYearMonthStart,salesData:E==null?void 0:E.SalesData,isLoading:f}),jsxRuntime.jsxs("div",{className:"grid @2xl:grid-cols-2 gap-6",children:[jsxRuntime.jsx(SalesChartCard,{statistics:(E==null?void 0:E.SalesStatistics)??[],loading:f}),jsxRuntime.jsx(ManufacturerResellerOrdersSection,{manufacturerId:(E==null?void 0:E.ManufacturerId)??"",activeOrders:(E==null?void 0:E.ActiveOrderDetails)??void 0,isLoading:f}),n&&jsxRuntime.jsx(ManufacturerInventoryFinanceCard,{manufacturer:E,isLoading:f}),n&&jsxRuntime.jsx(ManufacturerCreditFinanceCard,{manufacturer:E,isLoading:f}),n&&jsxRuntime.jsx(ManufacturerReorderingCard,{manufacturer:E??{},onSave:()=>{},loading:f,readonly:e}),n&&jsxRuntime.jsx(ManufacturerPublicInfoSection,{manufacturer:E,readonly:e,isLoading:f,onUnsavedChanges:A=>R("publicInfo",{hasUnsavedChanges:A})}),n&&jsxRuntime.jsx(OpenToWorkSection,{manufacturer:E,readonly:e,isLoading:f}),n&&jsxRuntime.jsx(ManufacturerBillingInfoSection,{manufacturer:E,readonly:e,isLoading:f,onUnsavedChanges:A=>R("billingInfo",{hasUnsavedChanges:A})}),n&&jsxRuntime.jsx(ManufacturerQualificationsSection,{manufacturer:E,readonly:e,isLoading:f,onUnsavedChanges:A=>R("qualifications",{hasUnsavedChanges:A})})]}),n&&jsxRuntime.jsx(ManufacturerReportsSection,{manufacturerId:(E==null?void 0:E.ManufacturerId)??"",userEmail:l,isLoading:f})]}),jsxRuntime.jsx(C,{})]})}function ManufacturerCategories({categories:t,activeCategory:e,onSelectCategory:n}){return jsxRuntime.jsx("div",{className:"grid",children:jsxRuntime.jsx("div",{className:"flex overflow-x-auto small-scrollbar pb-4",children:jsxRuntime.jsx("div",{className:"flex gap-2",children:t.map(o=>jsxRuntime.jsxs(Button,{onClick:()=>n(o.CategoryCode??""),variant:e===o.CategoryCode?"default":"outline",size:"sm",className:"px-3 py-1.5 text-xs whitespace-nowrap rounded-full",children:[o.CategoryName??"Undefined",o.QualificationRequired&&jsxRuntime.jsx(ShieldCheck,{className:`ml-1 w-5 h-5 ${e!==o.CategoryCode?"text-red-500":""}`})]},o.CategoryCode))})})})}function ManufacturerProducts({applicationId:t,manufacturer:e,shopifyHostName:n}){var I,j,q,z;const[o]=usePostV4ResellerByRouteResellerIdManufacturerAndManufacturerIdCategoryCodeShopifyMutation(),[l,d]=React.useState(((j=(I=e.Categories)==null?void 0:I[0])==null?void 0:j.CategoryCode)||""),[f,g]=React.useState(!1),[b,_]=React.useState(!1),{toast:S}=useToast(),{data:R,isLoading:C,isFetching:E}=useGetV4ResellerByRouteResellerIdManufacturerAndManufacturerIdCategoryCodeQuery({routeResellerId:t,manufacturerId:e.ManufacturerId,categoryCode:l??""},{skip:!e.ManufacturerId||!l}),A=async()=>{try{g(!0),_(!1),await o({routeResellerId:t,manufacturerId:e.ManufacturerId??"",categoryCode:l,shopifyHostName:n}).unwrap()&&S({title:"Success",description:"Category synced to Shopify successfully",variant:"success"})}catch(Q){console.error("Error syncing to Shopify:",Q),S({title:"Error",description:"Error syncing category to Shopify.",variant:"destructive"})}finally{g(!1)}},M=()=>{var Q,F;return((F=(Q=e.Categories)==null?void 0:Q.find(V=>V.CategoryCode===l))==null?void 0:F.CategoryName)||l};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(ManufacturerCategories,{categories:e.Categories||[],activeCategory:l,onSelectCategory:d}),n&&((q=e.Categories)==null?void 0:q.findIndex(Q=>Q.AvailableToBuy))!==-1&&jsxRuntime.jsxs(Dialog,{open:b,onOpenChange:_,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsx(Button,{className:"bg-green-600 hover:bg-green-700 mb-4",disabled:f,children:f?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Syncing..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2 h-4 w-4"}),"Sync Category to Shopify"]})})}),jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Confirm Sync to Shopify"}),jsxRuntime.jsxs(DialogDescription,{children:['Are you sure you want to sync the category "',M(),'" to Shopify? This will add all products in this category to your Shopify store.']})]}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>_(!1),children:"Cancel"}),jsxRuntime.jsx(Button,{className:"bg-green-600 hover:bg-green-700",onClick:A,disabled:f,children:f?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Syncing..."]}):"Confirm Sync"})]})]})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4 mb-4",children:C||E?Array.from({length:4}).map((Q,F)=>jsxRuntime.jsx(ProductCard,{},F)):R!=null&&R.Products&&(R==null?void 0:R.Products.length)>0?(z=[...R.Products].sort((Q,F)=>{const V=Q.OverallPercentileRank??0;return(F.OverallPercentileRank??0)-V}))==null?void 0:z.map(Q=>jsxRuntime.jsx(ProductCard,{applicationId:t,product:Q,viewProductLink:`/${t}/Product/${Q.RandmarSKU}`,shopifyHostname:n},Q.RandmarSKU)):jsxRuntime.jsxs(Alert,{variant:"warning",className:"col-span-1 @md:col-span-2",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Warning"}),jsxRuntime.jsx(AlertDescription,{children:"No products found for this manufacturer category."})]})})]})}function PartnerRelationshipPage({applicationId:t,partnerId:e,userEmail:n,shopifyHostName:o,isSuperAdmin:l}){var j,q,z;const{data:d,isLoading:f,isFetching:g}=useGetV4PartnerByRouteApplicationIdPartnerAndPartnerIdQuery({routeApplicationId:t,partnerId:e,withSpecification:!0}),b=f||g,{toast:_}=useToast(),[S]=usePostV4ResellerByRouteResellerIdManufacturerAndManufacturerIdShopifyMutation(),[R,C]=React.useState(!1),[E,A]=React.useState(!1),M=async()=>{try{C(!0),A(!1),await S({routeResellerId:t??"",manufacturerId:e??"",shopifyHostName:o}).unwrap()&&_({title:"Success",description:"Manufacturer synced to Shopify successfully",variant:"success"})}catch(Q){console.error("Error syncing to Shopify:",Q),_({title:"Error",description:"Error syncing manufacturer to Shopify.",variant:"destructive"})}finally{C(!1)}},I=()=>d!=null&&d.Reseller?"reseller-overview":d!=null&&d.Manufacturer?"manufacturer-overview":"";return jsxRuntime.jsxs("div",{className:"@container",children:[jsxRuntime.jsxs("div",{className:"grid gap-4 @2xl:grid-cols-2",children:[jsxRuntime.jsx(PartnerCard,{account:d,loading:b,withAbout:!0,withVoice:!1,action:" "}),jsxRuntime.jsxs("div",{className:"grid gap-4",children:[((d==null?void 0:d.Manufacturer)||b)&&jsxRuntime.jsx(ManufacturerCard,{manufacturer:d==null?void 0:d.Manufacturer,loading:b,mainAction:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[(d==null?void 0:d.Manufacturer)&&jsxRuntime.jsx(ManufacturerGetStartedButton,{applicationId:t,manufacturer:d==null?void 0:d.Manufacturer}),o&&((q=(j=d==null?void 0:d.Manufacturer)==null?void 0:j.Categories)==null?void 0:q.findIndex(Q=>Q.AvailableToBuy))!==-1&&jsxRuntime.jsxs(Dialog,{open:E,onOpenChange:A,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsx(Button,{className:"bg-green-600 hover:bg-green-700 ml-2",disabled:R,children:R?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Syncing..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2 h-4 w-4"}),"Sync Manufacturer to Shopify"]})})}),jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Confirm Sync to Shopify"}),jsxRuntime.jsxs(DialogDescription,{children:['Are you sure you want to sync the manufacturer "',(z=d==null?void 0:d.Manufacturer)==null?void 0:z.PublicName,'" to Shopify? This will add all products from this manufacturer to your Shopify store.']})]}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>A(!1),children:"Cancel"}),jsxRuntime.jsx(Button,{className:"bg-green-600 hover:bg-green-700",onClick:M,disabled:R,children:R?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Syncing..."]}):"Confirm Sync"})]})]})]})]})}),(d==null?void 0:d.Reseller)&&jsxRuntime.jsx(ResellerCard,{reseller:d==null?void 0:d.Reseller,loading:b})]})]}),((d==null?void 0:d.Reseller)||(d==null?void 0:d.Manufacturer))&&!b&&jsxRuntime.jsx("div",{className:"max-w-6xl mx-auto p-4",children:jsxRuntime.jsxs(Tabs,{defaultValue:I(),className:"w-full",children:[jsxRuntime.jsxs(TabsList,{className:"inline-flex h-auto items-center justify-center rounded-none border-b bg-transparent p-0",children:[(d==null?void 0:d.Reseller)&&jsxRuntime.jsx(TabsTrigger,{value:"reseller-overview",className:"reseller-theme relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",children:"Reseller Overview"}),(d==null?void 0:d.Manufacturer)&&jsxRuntime.jsx(TabsTrigger,{value:"manufacturer-overview",className:"manufacturer-theme relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",children:"Manufacturer Overview"}),(d==null?void 0:d.Manufacturer)&&jsxRuntime.jsx(TabsTrigger,{value:"products",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",children:"Products"})]}),(d==null?void 0:d.Reseller)&&jsxRuntime.jsx(TabsContent,{value:"reseller-overview",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(ResellerOverview,{readonly:!0,appID:d.ApplicationId||"",reseller:d==null?void 0:d.Reseller,userEmail:n,isSuperAdmin:l,withoutReports:!0})})}),(d==null?void 0:d.Manufacturer)&&jsxRuntime.jsx(TabsContent,{value:"manufacturer-overview",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(ManufacturerOverviewPage,{readonly:!0,manufacturer:d==null?void 0:d.Manufacturer,applicationId:t,userEmail:n})})}),(d==null?void 0:d.Manufacturer)&&jsxRuntime.jsx(TabsContent,{value:"products",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(ManufacturerProducts,{applicationId:t,manufacturer:d.Manufacturer,shopifyHostName:o})})})]})}),b&&jsxRuntime.jsx("div",{className:"max-w-6xl mx-auto p-4 mt-4 flex justify-center items-center h-32",children:jsxRuntime.jsx(LoaderCircle,{className:"h-8 w-8 animate-spin text-primary"})})]})}const PublicInfo=({reseller:t,appID:e,isLoading:n,readonly:o,onUnsavedChanges:l})=>{const{toast:d}=useToast(),[f]=usePostV4PartnerByApplicationIdAccountResellerAndFieldNameMutation(),[g,b]=React.useState({}),_=React.useMemo(()=>({publicEmail:t.PublicEmail??"",contactName:t.ContactName??"",phone:t.Phone??"",website:t.Website??""}),[t]),{register:S,handleSubmit:R,reset:C,watch:E,formState:{errors:A,isSubmitting:M}}=useForm({defaultValues:_}),I=E(),j=React.useCallback(()=>g?JSON.stringify(I)!==JSON.stringify(g):!1,[I,g]);React.useEffect(()=>{l&&l(j())},[j,l]),React.useEffect(()=>{t&&Object.keys(t).length>0&&(C(_),b(_))},[t,C,_]);const q=async Q=>{let F=!0,V=!1;const te=Object.keys(Q).map(ne=>({key:ne,keyApi:ne.charAt(0).toUpperCase()+ne.slice(1)}));for(const ne of te){const se=Q[ne.key],ge=t[ne.keyApi];if(se!==ge&&se!==void 0){V=!0;try{await f({applicationId:e,fieldName:ne.keyApi,newValue:String(se)}).unwrap()||(F=!1)}catch(oe){console.error(`Error updating ${ne.keyApi}:`,oe),F=!1}}}F&&V?(d({title:"Public info",description:"Information updated successfully",variant:"success"}),b({...Q}),l&&l(!1)):F||d({title:"Updation error",description:"Failed to update",variant:"destructive"})},z=Q=>!Q||Q.trim()==="";return n?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Public Information"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-20"})})]})})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsxs(CardTitle,{className:"text-1xl font-bold",children:["Public Information ",o?"(read only)":""]})}),jsxRuntime.jsxs(CardContent,{children:[(z(E("contactName"))||z(E("publicEmail"))||z(E("website"))||z(E("phone")))&&jsxRuntime.jsxs(Alert,{variant:"destructive",className:"mb-6",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Missing information"}),jsxRuntime.jsx(AlertDescription,{children:"All fields are required to get started at working with Manufacturers."})]}),jsxRuntime.jsxs("form",{onSubmit:R(q),className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-sm font-medium leading-none",htmlFor:"contactName",children:"Main Representative *"}),jsxRuntime.jsx(Input,{id:"contactName",placeholder:"John Doe",readOnly:o,...S("contactName",{}),className:A.contactName||z(E("contactName"))?"input-error-indicator":""}),A.contactName&&jsxRuntime.jsx("p",{className:"text-red-500 text-sm",children:A.contactName.message})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-sm font-medium leading-none",htmlFor:"publicEmail",children:"Public Email *"}),jsxRuntime.jsx(Input,{id:"publicEmail",placeholder:"contact@company.com",readOnly:o,...S("publicEmail",{pattern:{value:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:"Invalid email address"}}),className:A.publicEmail||z(E("publicEmail"))?"input-error-indicator":""}),A.publicEmail&&jsxRuntime.jsx("p",{className:"text-red-500 text-sm",children:A.publicEmail.message})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-sm font-medium leading-none",htmlFor:"website",children:"Website *"}),jsxRuntime.jsx(Input,{id:"website",placeholder:"https://company.com",readOnly:o,...S("website",{pattern:{value:/^.{7,}$/,message:"Must be at least 7 characters"}}),className:A.website||z(E("website"))?"input-error-indicator":""}),A.website&&jsxRuntime.jsx("p",{className:"text-red-500 text-sm",children:A.website.message})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-sm font-medium leading-none",htmlFor:"phone",children:"Phone Number *"}),jsxRuntime.jsx(Input,{id:"phone",placeholder:"+1 (555) 123-4567",readOnly:o,...S("phone",{pattern:{value:/^.{7,}$/,message:"Must be at least 7 characters"}}),className:A.phone||z(E("phone"))?"input-error-indicator":""}),A.phone&&jsxRuntime.jsx("p",{className:"text-red-500 text-sm",children:A.phone.message})]}),jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsx(Button,{type:"submit",disabled:M||o,className:o?"hidden":"",children:M?"Saving...":"Save"})})]})]})]})};function BillingCard({appID:t,reseller:e,isLoading:n,withoutReports:o,userEmail:l}){const{toast:d}=useToast(),{Statement:f,CreditLimit:g}=e,[b,_]=React.useState(!1),[S,R]=React.useState(!1),[C,E]=React.useState(!1),[A,M]=React.useState(!1),[I,j]=React.useState(!1),[q,z]=React.useState(l||""),Q=[{label:"0 - 30 Days",value:jsxRuntime.jsx(FormattedNumber,{value:(f==null?void 0:f.Over0)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:Calendar},{label:"31 - 45 Days",value:jsxRuntime.jsx(FormattedNumber,{value:(f==null?void 0:f.Over30)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:CalendarDays},{label:"45+ Days",value:jsxRuntime.jsx(FormattedNumber,{value:(f==null?void 0:f.Over45)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:CalendarRange},{label:"Total",value:jsxRuntime.jsx(FormattedNumber,{value:(f==null?void 0:f.Total)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:DollarSign},{label:"Credit Limit",value:jsxRuntime.jsx(FormattedNumber,{value:g||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:CreditCard}],[F]=useLazyGetV4ResellerByRouteResellerIdDocumentAndDocumentNumberPdfQuery(),V=async ge=>{_(!1),ge?R(!0):E(!0);let oe="";try{const je=(await F({routeResellerId:t,documentNumber:`ST${t}`})).data;if(!je.url||!je.filename)throw new Error("No data received for download.");if(oe=je.url,ge)window.open(oe);else{const Ne=document.createElement("a");Ne.href=oe,Ne.download=je.filename,document.body.appendChild(Ne),Ne.click(),Ne.remove()}d({title:"Success",description:"Statement downloaded successfully.",variant:"success"})}catch(Ae){console.error("Download Error:",Ae),d({title:"Error",description:"An error occurred while downloading the statement. Please try again.",variant:"destructive"})}finally{ge?R(!1):E(!1),oe&&setTimeout(()=>{window.URL.revokeObjectURL(oe)},1e3)}},[te]=usePostV4ResellerByRouteResellerIdDocumentStatementEmailMutation(),ne=async()=>{if(!q||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(q)){d({title:"Invalid Email",description:"Please enter a valid email address.",variant:"destructive"});return}M(!0);try{await te({routeResellerId:t,emailAddress:q}).unwrap(),d({title:"Success",description:`Statement sent to ${q} successfully.`,variant:"success"}),j(!1)}catch(oe){console.error("Send Email Error:",oe),d({title:"Error",description:"An error occurred while sending the statement. Please try again.",variant:"destructive"})}finally{M(!1)}};if(n)return jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{className:"border-b p-6 md:p-5",children:jsxRuntime.jsx(Skeleton,{className:"h-6 w-36"})}),jsxRuntime.jsxs(CardContent,{className:"p-6 md:p-5",children:[jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 sm:divide-x divide-border",children:[jsxRuntime.jsx("div",{className:"space-y-6 sm:pe-4",children:[1,2,3].map(ge=>jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 ms-auto"})]},ge))}),jsxRuntime.jsx("div",{className:"space-y-6 sm:ps-4 pt-6 sm:pt-0 mt-6 sm:mt-0 border-t sm:border-t-0 border-border",children:[1,2].map(ge=>jsxRuntime.jsx("div",{className:ge===2?"pt-6 mt-6 border-t border-border":"",children:jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 ms-auto"})]})},ge))})]}),jsxRuntime.jsxs("div",{className:"flex justify-end mt-6 gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-28"})]})]})]});const se=!o;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{className:"border-b p-6 md:p-5",children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Billing Overview"})}),jsxRuntime.jsxs(CardContent,{className:"p-6 md:p-5",children:[jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 sm:divide-x divide-border",children:[jsxRuntime.jsx("div",{className:"space-y-6 sm:pe-4",children:Q.slice(0,3).map((ge,oe)=>jsxRuntime.jsx(BillingItem,{icon:ge.icon,label:ge.label,value:ge.value},oe))}),jsxRuntime.jsx("div",{className:"space-y-6 sm:ps-4 pt-6 sm:pt-0 mt-6 sm:mt-0 border-t sm:border-t-0 border-border",children:Q.slice(3).map((ge,oe)=>jsxRuntime.jsx("div",{className:oe===1?"pt-6 mt-6 border-t border-border":"",children:jsxRuntime.jsx(BillingItem,{icon:ge.icon,label:ge.label,value:ge.value})},oe))})]}),se&&jsxRuntime.jsxs("div",{className:"flex justify-end mt-6 gap-2",children:[jsxRuntime.jsxs(DropdownMenu,{open:b,onOpenChange:_,children:[jsxRuntime.jsx(DropdownMenuTrigger,{asChild:!0,children:jsxRuntime.jsx(Button,{variant:"outline",disabled:S||C,children:S?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Printing..."]}):C?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Downloading..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(FileText,{className:"mr-2 h-4 w-4"}),"Statement",jsxRuntime.jsx(ChevronDown,{className:"ml-2 h-4 w-4"})]})})}),jsxRuntime.jsxs(DropdownMenuContent,{align:"end",children:[jsxRuntime.jsxs(DropdownMenuItem,{onClick:()=>V(!0),disabled:S,children:[jsxRuntime.jsx(Printer,{className:"mr-2 h-4 w-4"}),jsxRuntime.jsx("span",{children:"Print"})]}),jsxRuntime.jsx(DropdownMenuSeparator,{}),jsxRuntime.jsxs(DropdownMenuItem,{onClick:()=>V(!1),disabled:C,children:[jsxRuntime.jsx(Download,{className:"mr-2 h-4 w-4"}),jsxRuntime.jsx("span",{children:"Download"})]}),jsxRuntime.jsx(DropdownMenuSeparator,{}),jsxRuntime.jsxs(DropdownMenuItem,{onSelect:()=>j(!0),children:[jsxRuntime.jsx(Mail,{className:"mr-2 h-4 w-4"}),jsxRuntime.jsx("span",{children:"Send by Email"})]})]})]}),jsxRuntime.jsx(reactRouterDom.Link,{to:`https://dashboard.randmar.io/${t}/PayInvoice`,target:"_blank",children:jsxRuntime.jsxs(Button,{children:[jsxRuntime.jsx(CreditCard,{className:"mr-2 h-4 w-4"}),"Pay Invoices"]})})]})]})]}),jsxRuntime.jsx(Dialog,{open:I,children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Send Statement by Email"}),jsxRuntime.jsx(DialogDescription,{children:"Enter the recipient's email address below. The statement will be sent as a PDF attachment."})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",className:"text-right",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",type:"email",value:q,onChange:ge=>z(ge.target.value),className:"col-span-3",placeholder:"recipient@example.com"})]})}),jsxRuntime.jsx(DialogFooter,{children:jsxRuntime.jsx(Button,{type:"submit",onClick:ne,disabled:A||!q,children:A?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Send,{className:"mr-2 h-4 w-4"}),"Send"]})})})]})})]})}function BillingItem({icon:t,label:e,value:n}){return jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(t,{className:"size-4 text-muted-foreground"}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:e})]}),jsxRuntime.jsx("span",{className:"text-base font-semibold ms-auto",children:n})]})}function ChangePricingTierModal({open:t,setOpen:e,tier:n,onTierChange:o,isLoading:l}){const d=()=>{e(!1)};return jsxRuntime.jsx(Dialog,{open:t,onOpenChange:e,children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsx(DialogTitle,{children:"Change Pricing Tier"})}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 py-2",children:[jsxRuntime.jsxs("p",{className:"text-lg text-muted-foreground",children:["Requested Pricing Tier: ",jsxRuntime.jsx("span",{className:"font-bold",children:n})]}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"If your account qualifies, your pricing will update immediately."}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"If not, we'll review your request and notify you of the decision."})]}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:d,disabled:l,children:"Cancel"}),jsxRuntime.jsx(Button,{onClick:o,disabled:l,children:l?"Loading...":`Apply for ${n}`})]})]})})}const getPricingText=t=>t===1?"The Best":t===2?"Fixed 12.5% GP on all items":t===3?"Advantageous":t===4?"Buying Group":t===5?"Cost":t,getShippingText=t=>t==="A"?"Free or Custom":t==="B"?"Fixed $10 anywhere":t==="C"?`Free shipping on $150+ orders to your location,
|
|
1078
1078
|
$15 for drop shipped orders under $1,500,
|
|
1079
|
-
$10 with opportunities under $1,000`:t==="D"?"$15 under $1,500":t==="E"?"Full shipping charges":t,getTermsText=t=>t==="STRIPE"?"Credit card payment":t==="NET30"?"Net 30 days":t,AccountTier=({isSuperAdmin:t,readonly:e,reseller:n,appID:o,isLoading:l})=>{const{toast:d}=useToast(),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,{isLoading:R}]=usePostV4PartnerByApplicationIdAccountResellerAndFieldNameMutation(),C=Oe=>Oe&&{Starter:"starter","E-Commerce":"ecommerce",Commercial:"commercial",Basics:"cws",Novexco:"novexco","Jean Coutu":"jeancoutu",Exclusive:"exclusive"}[Oe]||"",E=Oe=>Oe&&{A:"free",B:"fixed",C:"dropshipped",D:"under1500",E:"fullcharges"}[Oe]||"",A=Oe=>Oe&&{1:"exclusive",2:"ecommerce",3:"commercial",4:"buyinggroup",5:"cost"}[Oe]||"",[M,I]=React.useState(C((n==null?void 0:n.Priority)??"")),[j,q]=React.useState(E((n==null?void 0:n.ShippingProfile)??"")),[z,Q]=React.useState(A(n==null?void 0:n.PriceProfile)),F=Oe=>({starter:"Starter",ecommerce:"E-Commerce",commercial:"Commercial",cws:"Basics",novexco:"Novexco",jeancoutu:"Jean Coutu",exclusive:"Exclusive"})[Oe]||Oe,V=Oe=>({free:"A",fixed:"B",dropshipped:"C",under1500:"D",fullcharges:"E"})[Oe]||Oe,te=Oe=>({exclusive:"1",ecommerce:"2",commercial:"3",buyinggroup:"4",cost:"5"})[Oe]||Oe;React.useEffect(()=>{I(C((n==null?void 0:n.Priority)??"")),q(E((n==null?void 0:n.ShippingProfile)??"")),Q(A(n==null?void 0:n.PriceProfile))},[n]);const ne=async(Oe,Fe,ze,$e)=>{try{(await S({applicationId:o,fieldName:Oe,newValue:Fe})).error?d({title:"Error",description:$e,variant:"destructive"}):d({title:"Success",description:ze,variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}},se=async Oe=>{I(Oe);const Fe=F(Oe);ne("Priority",Fe,`Priority updated to ${Fe}`,"Failed to update priority")},ge=async Oe=>{q(Oe);const Fe=V(Oe);ne("ShippingProfile",Fe,`Shipping profile updated to ${Fe}`,"Failed to update shipping profile")},oe=async Oe=>{Q(Oe);const Fe=te(Oe);ne("PriceProfile",Fe,`Pricing profile updated to ${Fe}`,"Failed to update pricing profile")},Ae=async()=>{try{const Oe=await S({applicationId:o,fieldName:"Tier",newValue:b});Oe.error?d({title:"Error",description:"Failed to update reseller",variant:"destructive"}):Oe.data?d({title:"Success",description:`Pricing Tier changed to ${b}`,variant:"success"}):d({title:"Considered",description:"Request being considered",variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}finally{g(!1),_("")}},je=[{name:"Terms",enabled:n.Priority==="Starter"},{name:"E-Commerce",enabled:n.Priority==="Commercial"},{name:"Commercial",enabled:n.Priority==="E-Commerce"},{name:"Exclusive",enabled:t}],Ne=Oe=>{_(Oe),g(!0)};return l?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-16 rounded-full"})]})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-56"})]}),jsxRuntime.jsx("div",{className:"grid gap-3",children:[1,2,3].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]})]},Oe))}),jsxRuntime.jsxs("div",{className:"flex gap-2 mt-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{className:"pb-2 pt-4 px-4 flex flex-row items-center justify-between",children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Account Tier"}),jsxRuntime.jsx(Badge,{variant:"secondary",className:"bg-green-100 text-green-700 hover:bg-green-200 text-xs",children:"Active"})]}),jsxRuntime.jsxs(CardContent,{className:"pt-2 px-4 pb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 bg-primary/5 p-4 rounded-lg",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-bold text-primary",children:[(n==null?void 0:n.Priority)||""," Tier"]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Optimized for online retail"})]}),jsxRuntime.jsx(CircleCheck,{className:"h-6 w-6 text-green-600"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-2 mb-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Package2,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Pricing"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground truncate",children:getPricingText(n.PriceProfile||0)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Truck,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Shipping"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getShippingText(n.ShippingProfile||"").split(".")[0]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Calendar,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Payment terms"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getTermsText((n==null?void 0:n.Terms)||"")})]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[!e&&jsxRuntime.jsx(Button,{variant:"outline",className:"flex-1",asChild:!0,children:jsxRuntime.jsxs("a",{href:"https://www.randmar.io/docs/overview/pricingTiers",target:"_blank",rel:"noreferrer",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4 mr-1"}),"Pricing Tiers"]})}),jsxRuntime.jsxs(Popover,{children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{disabled:e,className:e?"hidden":"flex-1",children:["Upgrade Tier ",jsxRuntime.jsx(ChevronRight,{className:"h-3 w-3 ml-1"})]})}),jsxRuntime.jsx(PopoverContent,{className:"w-56 p-2",children:jsxRuntime.jsxs("div",{className:"grid gap-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-xs mb-1",children:"Select a tier"}),je.map(Oe=>jsxRuntime.jsx(Button,{variant:"ghost",size:"sm",className:"w-full justify-start h-8",disabled:!Oe.enabled,onClick:()=>Ne(Oe.name),children:Oe.name},Oe.name))]})})]})]})]})]}),jsxRuntime.jsx(ChangePricingTierModal,{isLoading:R,open:f,setOpen:g,tier:b,onTierChange:Ae}),t&&!e&&jsxRuntime.jsxs(Card,{className:"mt-4",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2 pt-3 px-4",children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Admin Configuration"})}),jsxRuntime.jsx(CardContent,{className:"pt-2 px-4 pb-4",children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Priority"}),jsxRuntime.jsx(RadioGroup$1,{value:M,onValueChange:se,className:"grid grid-cols-2 @sm:grid-cols-3 @md:grid-cols-4 gap-1",children:[{value:"starter",label:"Starter"},{value:"ecommerce",label:"E-Commerce"},{value:"commercial",label:"Commercial"},{value:"cws",label:"CWS (Basics)"},{value:"novexco",label:"Novexco"},{value:"jeancoutu",label:"Jean Coutu"},{value:"exclusive",label:"Exclusive"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`priority-${Oe.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`priority-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Shipping Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:j,onValueChange:ge,className:"grid grid-cols-1 @md:grid-cols-2 gap-1",children:[{value:"free",label:"Free (A)"},{value:"fixed",label:"Fixed $10 Shipping (B)"},{value:"dropshipped",label:"$15 for drop shipped (C)"},{value:"under1500",label:"15$ under 1,500 (D)"},{value:"fullcharges",label:"Full shipping charges (E)"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`shipping-${Oe.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`shipping-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Pricing Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:z,onValueChange:oe,className:"grid grid-cols-2 @sm:grid-cols-3 gap-1",children:[{value:"exclusive",label:"Exclusive (1)"},{value:"ecommerce",label:"E-Commerce (2)"},{value:"commercial",label:"Commercial (3)"},{value:"buyinggroup",label:"Buying Group (4)"},{value:"cost",label:"Cost (5)"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`pricing-${Oe.value}`,className:"h-6 w-6 scale-50 antialiased"}),jsxRuntime.jsx(Label$2,{htmlFor:`pricing-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]})]})})]})]})};function OrderCategories({openOrders:t=[],isLoading:e=!1}){const n=(t==null?void 0:t.filter(M=>M.DocumentType==="Order"))||[],o=(t==null?void 0:t.filter(M=>M.DocumentType==="Shipment"))||[],l=n.filter(M=>M.WarehouseCode!=="3PLE"),d=l.reduce((M,I)=>M+(I.Quantity??0),0),f=l.reduce((M,I)=>M+(I.ExtendedPrice??0),0),g=n.filter(M=>M.WarehouseCode==="3PLE"),b=g.reduce((M,I)=>M+(I.Quantity??0),0),_=g.reduce((M,I)=>M+(I.ExtendedPrice??0),0),S=o.reduce((M,I)=>M+(I.Quantity??0),0),R=o.reduce((M,I)=>M+(I.ExtendedPrice??0),0),C=d+b+S,E=f+_+R,A=[{name:"All",icon:Package,color:"bg-blue-500",orders:C,amount:E},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",orders:d,amount:f},{name:"Shipped",icon:Truck,color:"bg-green-500",orders:S,amount:R},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",orders:b,amount:_}];return e?jsxRuntime.jsxs(Card,{className:"w-full @md:col-span-2 @xl:col-span-1",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-40"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-3.5",children:[1,2,3,4].map(M=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:"bg-gray-200 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]})},M))})})]}):jsxRuntime.jsxs(Card,{className:"w-full @md:col-span-2 @xl:col-span-1",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Order Categories"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-3.5",children:A.map(M=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:`${M.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:M.name}),jsxRuntime.jsx("div",{className:`${M.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(M.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:M.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:jsxRuntime.jsx(FormattedNumber,{value:M.amount,style:"currency",currency:"CAD",currencyDisplay:"symbol"})})]})]})]})]})},M.name))})})]})}function ReportsSection({isLoading:t,userEmail:e,appID:n}){const{toast:o}=useToast(),[l,{isLoading:d}]=usePostV4ResellerByRouteResellerIdReportWalmartTrackingFileEmailMutation(),[f,{isLoading:g}]=usePostV4ResellerByRouteResellerIdReportAmazonTrackingFileEmailMutation(),[b,{isLoading:_}]=usePostV4ResellerByRouteResellerIdReportOpenOrdersEmailMutation(),[S,{isLoading:R}]=usePostV4ResellerByRouteResellerIdReportProductsEmailMutation(),[C,{isLoading:E}]=usePostV4ResellerByRouteResellerIdReportInvoicesEmailMutation(),[A,{isLoading:M}]=usePostV4ResellerByRouteResellerIdDocumentStatementEmailMutation(),[I,j]=React.useState(null),[q,z]=React.useState(e),[Q,F]=React.useState(!1),V=[{name:"Products",reports:[{id:"Products",title:"Universal Product List",description:"A comprehensive overview of your product list with detailed specifications and pricing information.",icon:Package}]},{name:"Operation Details",reports:[{id:"OpenOrders",title:"Order Details",description:"A detailed report of all your orders and shipments, including status, tracking information, and delivery estimates.",icon:ShoppingCart},{id:"Invoices",title:"Invoices and Credits Report",description:"Detailed overview of your invoices and credits within a specific date range. It also contains reports about additional charges, serial numbers, and other relevant information.",icon:ScrollText},{id:"Statement",title:"Statement and RMAs Report",description:"A detailed report of all unpaid invoices and active RMAs.",icon:Banknote}]},{name:"Tracking Files",reports:[{id:"AmazonTrackingFile",title:"Amazon Tracking File",description:"Track products sold on Amazon marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing},{id:"WalmartTrackingFile",title:"Walmart Tracking File",description:"Track products sold on Walmart marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing}]}],te=async ge=>{j(ge),F(!0)},ne=async()=>{if(!(!I||!n))try{switch(I.id){case"Products":await S({routeResellerId:n,emailAddress:q}).unwrap();break;case"AmazonTrackingFile":await f({routeResellerId:n,emailAddress:q}).unwrap();break;case"WalmartTrackingFile":await l({routeResellerId:n,emailAddress:q}).unwrap();break;case"OpenOrders":await b({routeResellerId:n,emailAddress:q}).unwrap();break;case"Invoices":await C({routeResellerId:n,emailAddress:q}).unwrap();break;case"Statement":await A({routeResellerId:n,emailAddress:q}).unwrap();break;default:throw new Error("invalid report id")}o({title:"Report requested",description:`The ${I.title} will be sent to ${q} shortly.`,variant:"success"}),F(!1)}catch(ge){console.error("Error requesting report:",ge),o({title:"Error",description:"Failed to request report. Please try again.",variant:"destructive"})}},se=_||R||g||d||M||E;return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Reports"}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Download essential business reports, from your Product List to your Order Details."})]}),jsxRuntime.jsx(CardContent,{className:"space-y-6",children:t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:[1,2,3].map(ge=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-48"}),[1,2].map(oe=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})]},oe))]},ge))}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:V.map(ge=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold",children:ge.name}),ge.reports.map(oe=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg hover:bg-gray-100 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:jsxRuntime.jsx(oe.icon,{className:"h-5 w-5 text-primary"})}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h4",{className:"font-semibold text-sm",children:oe.title}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:oe.description})]}),jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",className:"flex items-center gap-1",onClick:()=>te(oe),children:[jsxRuntime.jsx(Download,{className:"h-4 w-4"}),"Request"]})]},oe.id))]},ge.name))})}),jsxRuntime.jsx(Dialog,{open:Q,onOpenChange:F,children:jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsxs(DialogTitle,{children:["Request ",I==null?void 0:I.title]}),jsxRuntime.jsx(DialogDescription,{children:"Enter the email address where you would like to receive the report."})]}),jsxRuntime.jsxs("div",{className:"py-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",value:q,onChange:ge=>z(ge.target.value),placeholder:"your@email.com",className:"mt-2"})]}),jsxRuntime.jsx(DialogDescription,{children:"The report will take around 5 minutes to generate."}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>F(!1),children:"Cancel"}),jsxRuntime.jsx(Button,{onClick:ne,disabled:!q||se,children:se?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Report"})]})]})})]})}const badgeVariants=cva("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input hover:bg-accent hover:text-accent-foreground",success:"bg-green-600 text-white hover:bg-green-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",ghost:"bg-background hover:bg-accent hover:text-accent-foreground",randmarRed:"bg-randmar-red text-white hover:bg-randmar-red/80",randmarBlue:"bg-randmar-blue text-white hover:bg-randmar-blue/80",randmarPurple:"bg-randmar-purple text-white hover:bg-randmar-purple/80",randmarGreen:"bg-randmar-green text-black hover:bg-randmar-green/80",randmarBlack:"bg-randmar-black text-white hover:bg-randmar-black/80",randmarYellow:"bg-randmar-yellow text-black hover:bg-randmar-yellow/80"},size:{default:"h-6",sm:"h-5 text-[10px]",lg:"h-7 px-3"}},defaultVariants:{variant:"default",size:"default"}}),Badge=React__namespace.forwardRef(({className:t,variant:e,size:n,icon:o,children:l,...d},f)=>jsxRuntime.jsxs("div",{ref:f,className:cn(badgeVariants({variant:e,size:n}),t),...d,children:[o&&jsxRuntime.jsx("span",{className:"mr-1",children:o}),l]}));Badge.displayName="Badge";function QualificationBadge({qualification:t}){return!t.QualificationId||t.QualificationId==="Suspended"?null:t.QualificationId==="Do Not Sell"?jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"destructive",children:[jsxRuntime.jsx(X$1,{className:"h-3 w-3 mr-1"}),"Do Not Sell"]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})}):jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"info",className:t.DefaultOpportunityNumber?"pr-1":"",children:[jsxRuntime.jsx(BadgeCheck,{className:"h-3 w-3 mr-1"}),t.QualificationId,t.DefaultOpportunityNumber&&jsxRuntime.jsx(Badge,{variant:"secondary",size:"sm",className:"ml-1",children:t.DefaultOpportunityNumber})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})})}function SalesChart({statistics:t,mode:e="month",chartHeight:n,loading:o=!1,size:l="default"}){const[d,f]=React.useState([]),[g,b]=React.useState(!1),_=[{name:"dollarVolume",label:"Dollar Volume",color:"var(--primary)",yAxisId:"left",format:"money"},{name:"unitsSold",label:"Units Sold",color:"#888",units:" units",yAxisId:"right"}];return React.useEffect(()=>{if(o||!t){f([]);return}let S=[];if(e==="week"){const R=new Map;t.forEach(C=>{var A;const E=((A=C.Day)==null?void 0:A.toString())||"";if(E.length===8){const M=parseInt(E.substring(0,4),10),I=parseInt(E.substring(4,6),10)-1,j=parseInt(E.substring(6,8),10),q=new Date(M,I,j),z=new Date(q);z.setDate(q.getDate()-q.getDay());const Q=`${z.getFullYear()}-${String(z.getMonth()+1).padStart(2,"0")}-${String(z.getDate()).padStart(2,"0")}`,F=R.get(Q)||{price:0,quantity:0};F.price+=C.ExtendedPrice||0,F.quantity+=C.Quantity||0,R.set(Q,F)}}),S=Array.from(R).sort(([C],[E])=>C.localeCompare(E)).map(([C,E])=>({date:`${C.substring(5,7)}/${C.substring(8,10)}`,dollarVolume:E.price,unitsSold:E.quantity}))}else{const R=new Date,C=R.getFullYear(),E=R.getMonth(),A=R.getDate(),M=`${C}-${(E+1).toString().padStart(2,"0")}`,I=Array.from({length:12},(q,z)=>{const Q=new Date(C,E-(11-z),1);return`${Q.getFullYear()}-${(Q.getMonth()+1).toString().padStart(2,"0")}`}),j=Object.fromEntries(I.map(q=>[q,{price:0,quantity:0}]));if(t.forEach(q=>{const z=String(q.Day??0);if(z.length!==8)return;const Q=`${z.substring(0,4)}-${z.substring(4,6)}`;j.hasOwnProperty(Q)&&(j[Q].price+=q.ExtendedPrice??0,j[Q].quantity+=q.Quantity??0)}),S=I.map(q=>{const z=j[q],[Q,F]=q.split("-").map(Number);return{date:new Date(Q,F-1).toLocaleString("default",{month:"short",year:"numeric"}),dollarVolume:z.price,unitsSold:z.quantity}}),g){const q=j[M];if(q&&q.price>0&&A>0){const z=new Date(C,E+1,0).getDate();if(A<z){const Q=q.price/A,F=q.quantity/A,V=Q*z,te=F*z,ne=S[S.length-1];ne&&(ne.dollarVolume=V,ne.unitsSold=te)}}}}f(S)},[t,e,g,o]),o?jsxRuntime.jsx("div",{style:{height:n},children:jsxRuntime.jsx(Skeleton,{className:"h-full w-full rounded-md"})}):d.length===0?jsxRuntime.jsx("div",{style:{height:n},className:"flex items-center justify-center text-muted-foreground",children:"No sales data available."}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(AreaChart,{data:d,series:_,height:n,size:l}),l==="default"&&e==="month"&&jsxRuntime.jsxs("div",{className:"mt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Switch,{checked:g,onCheckedChange:b,id:"extrapolate-switch"}),jsxRuntime.jsx(Label$2,{htmlFor:"extrapolate-switch",children:"Extrapolate Current Month"})]}),g&&jsxRuntime.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["* Values for ",new Date().toLocaleString("default",{month:"long"})," are projected estimates."]})]})]})}function ManufacturerCard({manufacturer:t,link:e,linkNewTab:n=!0,actions:o,mainAction:l,loading:d=!1}){var S,R,C;if(d||!t)return jsxRuntime.jsxs(Card,{className:"flex flex-col h-full",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-24"})]}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex flex-col space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2 mt-auto",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const f=t.ManufacturerId||"N/A",g=[t.City,t.Province,t.Country].filter(Boolean),b=g.length>0?g.join(", "):"",_=((S=t.Tags)==null?void 0:S.split(",").map(E=>E.trim()).filter(Boolean))||[];return jsxRuntime.jsxs(Card,{className:"manufacturer-theme flex flex-col h-full",children:[jsxRuntime.jsx(reactRouterDom.Link,{to:e??"#",target:e&&n?"_blank":"_self",children:jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"h-12 w-12 overflow-hidden rounded-md",children:jsxRuntime.jsx(PartnerLogo,{id:t.ManufacturerId,width:48,height:48})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-primary",children:"Manufacturer"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"|"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:f})]}),jsxRuntime.jsx("h3",{className:"font-semibold",children:t.PublicName||"N/A"}),t.Name&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:t.Name}),b&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:b})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col items-end gap-2",children:t.SalesStatistics&&t.SalesStatistics.length>0&&jsxRuntime.jsx("div",{className:"h-16 w-24",children:jsxRuntime.jsx(SalesChart,{statistics:t.SalesStatistics,size:"mini"})})})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[(!!((R=t.Qualification)!=null&&R.QualificationId)&&((C=t.Qualification)==null?void 0:C.QualificationId)!=="Suspended"||!!t.OpenToWork||!!t.OnHold&&t.OnHold!==0||_.length>0)&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(QualificationBadge,{qualification:t.Qualification??{}}),!!t.OpenToWork&&jsxRuntime.jsxs(Badge,{variant:"success",children:[jsxRuntime.jsx(HardHat,{className:"h-3 w-3 mr-1"}),"Open To Work"]}),!!t.OnHold&&t.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"}),_.map((E,A)=>jsxRuntime.jsx(Badge,{variant:"outline",children:E},A))]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[t.Phone&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`tel:${t.Phone}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.Phone})]}),t.PublicEmail&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`mailto:${t.PublicEmail}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.PublicEmail})]}),t.Website&&jsxRuntime.jsxs(reactRouterDom.Link,{to:t.Website,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.Website})]}),t.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.CurrencyCode})]})]})]}),t.SalesData&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:t.SalesData.SalesYearToDay?formatMoney(t.SalesData.SalesYearToDay):"—"}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:t.SalesData.SalesLast3Months?formatMoney(t.SalesData.SalesLast3Months):"—"}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:t.SalesData.SalesLast30Days?formatMoney(t.SalesData.SalesLast30Days):"—"})]})]})}),(o||l||t.PublicResourcesLink)&&jsxRuntime.jsxs(CardFooter,{className:"flex pt-2 gap-2 justify-between mt-auto",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[o&&o,t.PublicResourcesLink&&jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:t.PublicResourcesLink,target:"_blank",children:jsxRuntime.jsx(Button,{size:"icon",children:jsxRuntime.jsx(HardDriveDownload,{className:"h-4 w-4"})})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Public Resources Link"})})]})})]}),l&&jsxRuntime.jsx("div",{children:l})]})]})}function OrdersCard({applicationId:t,orders:e=null,loading:n=!1,title:o="Order Details"}){const l=React.useMemo(()=>[{accessorKey:"DocumentNumber",header:"Document Number",cell:({row:g})=>g.original.DocumentNumber?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${t}/Document/${g.original.DocumentNumber}`,className:"font-medium text-primary hover:underline",children:g.original.DocumentNumber})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for order ",g.original.DocumentNumber]})})]})}):"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"DocumentDate",header:"Document Date",cell:({row:g})=>formatYYYYMMDDIntToDateString(g.original.DocumentDate),enableSorting:!0,enableFiltering:!1},{accessorKey:"OrderNumber",header:"Order Number",cell:({row:g})=>g.original.OrderNumber??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"PONumber",header:"PO Number",cell:({row:g})=>g.original.PONumber??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"WarehouseCode",header:"Warehouse",cell:({row:g})=>g.original.WarehouseCode??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"Quantity",header:"Quantity",cell:({row:g})=>g.original.Quantity??"N/A",enableSorting:!0,enableFiltering:!1},{accessorKey:"ShipToName",header:"Name",cell:({row:g})=>jsxRuntime.jsx("div",{className:"min-w-[150px]",children:g.original.ShipToName??"N/A"}),enableSorting:!0,enableFiltering:!0},{accessorKey:"UnitPrice",header:"Unit Price",cell:({row:g})=>g.original.UnitPrice?formatMoney(g.original.UnitPrice):"N/A",enableSorting:!0,enableFiltering:!1}],[]),d=React.useMemo(()=>{const g={};if(e){const b=Array.from(new Set(e.map(E=>E.WarehouseCode).filter(E=>E!=null)));g.WarehouseCode=b;const _=Array.from(new Set(e.map(E=>E.ShipToName).filter(E=>E!=null)));g.ShipToName=_;const S=Array.from(new Set(e.map(E=>E.DocumentNumber).filter(E=>E!=null)));g.DocumentNumber=S;const R=Array.from(new Set(e.map(E=>E.OrderNumber).filter(E=>E!=null)));g.OrderNumber=R;const C=Array.from(new Set(e.map(E=>E.PONumber).filter(E=>E!=null)));g.PONumber=C}return g},[e]),f=e||[];return n?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(Skeleton,{className:"h-7 w-48"})," "]}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md border"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-[130px]"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-20"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})]})]})]})]}):jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:o})," "]}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(DataTable,{columns:l,data:f,uniqueValues:d})})]})}function ResellerOverview({appID:t,reseller:e,readonly:n,userEmail:o,isSuperAdmin:l,withoutReports:d=!1}){const{data:f,isLoading:g,isError:b}=useGetV4PartnerByApplicationIdAccountResellerQuery({applicationId:t??"",withSpecification:!0},{skip:!!e}),[_,S]=React.useState({publicInfo:{hasUnsavedChanges:!1}}),R=React.useCallback(()=>n?!1:_.publicInfo.hasUnsavedChanges,[n,_]),C=React.useCallback((q,z)=>{S(Q=>{var F;return((F=Q[q])==null?void 0:F.hasUnsavedChanges)!==z.hasUnsavedChanges?{...Q,[q]:z}:Q})},[]),{NavigationGuardDialog:E}=useRouterNavigationGuard(R),A=e??f,M=!n||!!(A!=null&&A.Statement)&&(A.Statement.Total??0)>0,I=(A==null?void 0:A.QualifiedManufacturers)??[],j=(A==null?void 0:A.Qualifications)??[];return jsxRuntime.jsxs("div",{className:"@container",children:[b?jsxRuntime.jsx(Card,{className:"p-6",children:jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Error"}),jsxRuntime.jsx(AlertDescription,{children:"There was an error loading your reseller information. Please try again later."})]})}):jsxRuntime.jsxs("div",{className:"space-y-6 mb-6",children:[jsxRuntime.jsx(SalesSummary,{fiscalYearMonthStart:(A==null?void 0:A.FiscalYearMonthStart)||1,salesData:A==null?void 0:A.SalesData,isLoading:g}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @2xl:grid-cols-2 gap-6",children:[jsxRuntime.jsx(SalesChartCard,{statistics:(A==null?void 0:A.SalesStatistics)??[],loading:g}),jsxRuntime.jsx(OrderCategories,{openOrders:(A==null?void 0:A.ActiveOrderDetails)??[],isLoading:g}),M&&jsxRuntime.jsx(BillingCard,{appID:t,reseller:A||{},withoutReports:d,isLoading:g,userEmail:o}),jsxRuntime.jsx(PublicInfo,{reseller:A||{},appID:t??"",isLoading:g,readonly:n,onUnsavedChanges:q=>C("publicInfo",{hasUnsavedChanges:q})}),jsxRuntime.jsx(AccountTier,{isSuperAdmin:l,readonly:n,reseller:A||{},appID:t??"",isLoading:g})]}),g||I.length>0?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Manufacturers you are qualified for"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid @2xl:grid-cols-2 gap-4",children:g?Array.from({length:2}).map((q,z)=>jsxRuntime.jsx(ManufacturerCard,{loading:!0},z)):I.map(q=>jsxRuntime.jsx(ManufacturerCard,{manufacturer:q,link:`https://dashboard.randmar.io/${t}/Partner/${q.ManufacturerId}`},q.ManufacturerId))})})]}):jsxRuntime.jsx(ResellerQualificationsCard,{qualifications:j}),jsxRuntime.jsx(OpportunitiesTable,{applicationId:t,opportunities:A==null?void 0:A.Opportunities,loading:g}),jsxRuntime.jsx(OrdersCard,{applicationId:t,title:"Active Orders",orders:A==null?void 0:A.ActiveOrderDetails,loading:g}),jsxRuntime.jsx(OrdersCard,{applicationId:t,title:"Completed Orders",orders:A==null?void 0:A.CompletedOrderDetails,loading:g}),jsxRuntime.jsx(ReturnsTable,{applicationId:t,returns:A==null?void 0:A.Returns,loading:g}),!d&&jsxRuntime.jsx(ReportsSection,{appID:t,userEmail:o,isLoading:g})]}),jsxRuntime.jsx(E,{})]})}const alertVariants=cva("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-500/50 bg-green-50 text-green-700 dark:border-green-500 dark:bg-green-950 dark:text-green-400 [&>svg]:text-green-500",warning:"border-yellow-500/50 bg-yellow-50 text-yellow-700 dark:border-yellow-500 dark:bg-yellow-950 dark:text-yellow-400 [&>svg]:text-yellow-500",info:"border-blue-500/50 bg-blue-50 text-blue-700 dark:border-blue-500 dark:bg-blue-950 dark:text-blue-400 [&>svg]:text-blue-500"}},defaultVariants:{variant:"default"}}),Alert=React__namespace.forwardRef(({className:t,variant:e,...n},o)=>jsxRuntime.jsx("div",{ref:o,role:"alert",className:cn(alertVariants({variant:e}),t),...n}));Alert.displayName="Alert";const AlertTitle=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("h5",{ref:n,className:cn("mb-1 font-medium leading-none tracking-tight",t),...e}));AlertTitle.displayName="AlertTitle";const AlertDescription=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("div",{ref:n,className:cn("text-sm [&_p]:leading-relaxed",t),...e}));AlertDescription.displayName="AlertDescription";/**
|
|
1079
|
+
$10 with opportunities under $1,000`:t==="D"?"$15 under $1,500":t==="E"?"Full shipping charges":t,getTermsText=t=>t==="STRIPE"?"Credit card payment":t==="NET30"?"Net 30 days":t,AccountTier=({isSuperAdmin:t,readonly:e,reseller:n,appID:o,isLoading:l})=>{const{toast:d}=useToast(),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,{isLoading:R}]=usePostV4PartnerByApplicationIdAccountResellerAndFieldNameMutation(),C=Oe=>Oe&&{Starter:"starter","E-Commerce":"ecommerce",Commercial:"commercial",Basics:"cws",Novexco:"novexco","Jean Coutu":"jeancoutu",Exclusive:"exclusive"}[Oe]||"",E=Oe=>Oe&&{A:"free",B:"fixed",C:"dropshipped",D:"under1500",E:"fullcharges"}[Oe]||"",A=Oe=>Oe&&{1:"exclusive",2:"ecommerce",3:"commercial",4:"buyinggroup",5:"cost"}[Oe]||"",[M,I]=React.useState(C((n==null?void 0:n.Priority)??"")),[j,q]=React.useState(E((n==null?void 0:n.ShippingProfile)??"")),[z,Q]=React.useState(A(n==null?void 0:n.PriceProfile)),F=Oe=>({starter:"Starter",ecommerce:"E-Commerce",commercial:"Commercial",cws:"Basics",novexco:"Novexco",jeancoutu:"Jean Coutu",exclusive:"Exclusive"})[Oe]||Oe,V=Oe=>({free:"A",fixed:"B",dropshipped:"C",under1500:"D",fullcharges:"E"})[Oe]||Oe,te=Oe=>({exclusive:"1",ecommerce:"2",commercial:"3",buyinggroup:"4",cost:"5"})[Oe]||Oe;React.useEffect(()=>{I(C((n==null?void 0:n.Priority)??"")),q(E((n==null?void 0:n.ShippingProfile)??"")),Q(A(n==null?void 0:n.PriceProfile))},[n]);const ne=async(Oe,Fe,ze,$e)=>{try{(await S({applicationId:o,fieldName:Oe,newValue:Fe})).error?d({title:"Error",description:$e,variant:"destructive"}):d({title:"Success",description:ze,variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}},se=async Oe=>{I(Oe);const Fe=F(Oe);ne("Priority",Fe,`Priority updated to ${Fe}`,"Failed to update priority")},ge=async Oe=>{q(Oe);const Fe=V(Oe);ne("ShippingProfile",Fe,`Shipping profile updated to ${Fe}`,"Failed to update shipping profile")},oe=async Oe=>{Q(Oe);const Fe=te(Oe);ne("PriceProfile",Fe,`Pricing profile updated to ${Fe}`,"Failed to update pricing profile")},Ae=async()=>{try{const Oe=await S({applicationId:o,fieldName:"Tier",newValue:b});Oe.error?d({title:"Error",description:"Failed to update reseller",variant:"destructive"}):Oe.data?d({title:"Success",description:`Pricing Tier changed to ${b}`,variant:"success"}):d({title:"Considered",description:"Request being considered",variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}finally{g(!1),_("")}},je=[{name:"Terms",enabled:n.Priority==="Starter"},{name:"E-Commerce",enabled:n.Priority==="Commercial"},{name:"Commercial",enabled:n.Priority==="E-Commerce"},{name:"Exclusive",enabled:t}],Ne=Oe=>{_(Oe),g(!0)};return l?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-16 rounded-full"})]})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-56"})]}),jsxRuntime.jsx("div",{className:"grid gap-3",children:[1,2,3].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]})]},Oe))}),jsxRuntime.jsxs("div",{className:"flex gap-2 mt-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{className:"pb-2 pt-4 px-4 flex flex-row items-center justify-between",children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Account Tier"}),jsxRuntime.jsx(Badge,{variant:"secondary",className:"bg-green-100 text-green-700 hover:bg-green-200 text-xs",children:"Active"})]}),jsxRuntime.jsxs(CardContent,{className:"pt-2 px-4 pb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 bg-primary/5 p-4 rounded-lg",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-bold text-primary",children:[(n==null?void 0:n.Priority)||""," Tier"]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Optimized for online retail"})]}),jsxRuntime.jsx(CircleCheck,{className:"h-6 w-6 text-green-600"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-2 mb-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Package2,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Pricing"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground truncate",children:getPricingText(n.PriceProfile||0)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Truck,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Shipping"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getShippingText(n.ShippingProfile||"").split(".")[0]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Calendar,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Payment terms"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getTermsText((n==null?void 0:n.Terms)||"")})]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[!e&&jsxRuntime.jsx(Button,{variant:"outline",className:"flex-1",asChild:!0,children:jsxRuntime.jsxs("a",{href:"https://www.randmar.io/docs/overview/pricingTiers",target:"_blank",rel:"noreferrer",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4 mr-1"}),"Pricing Tiers"]})}),jsxRuntime.jsxs(Popover,{children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button,{disabled:e,className:e?"hidden":"flex-1",children:["Upgrade Tier ",jsxRuntime.jsx(ChevronRight,{className:"h-3 w-3 ml-1"})]})}),jsxRuntime.jsx(PopoverContent,{className:"w-56 p-2",children:jsxRuntime.jsxs("div",{className:"grid gap-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-xs mb-1",children:"Select a tier"}),je.map(Oe=>jsxRuntime.jsx(Button,{variant:"ghost",size:"sm",className:"w-full justify-start h-8",disabled:!Oe.enabled,onClick:()=>Ne(Oe.name),children:Oe.name},Oe.name))]})})]})]})]})]}),jsxRuntime.jsx(ChangePricingTierModal,{isLoading:R,open:f,setOpen:g,tier:b,onTierChange:Ae}),t&&!e&&jsxRuntime.jsxs(Card,{className:"mt-4",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2 pt-3 px-4",children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Admin Configuration"})}),jsxRuntime.jsx(CardContent,{className:"pt-2 px-4 pb-4",children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Priority"}),jsxRuntime.jsx(RadioGroup$1,{value:M,onValueChange:se,className:"grid grid-cols-2 @sm:grid-cols-3 @md:grid-cols-4 gap-1",children:[{value:"starter",label:"Starter"},{value:"ecommerce",label:"E-Commerce"},{value:"commercial",label:"Commercial"},{value:"cws",label:"CWS (Basics)"},{value:"novexco",label:"Novexco"},{value:"jeancoutu",label:"Jean Coutu"},{value:"exclusive",label:"Exclusive"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`priority-${Oe.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`priority-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Shipping Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:j,onValueChange:ge,className:"grid grid-cols-1 @md:grid-cols-2 gap-1",children:[{value:"free",label:"Free (A)"},{value:"fixed",label:"Fixed $10 Shipping (B)"},{value:"dropshipped",label:"$15 for drop shipped (C)"},{value:"under1500",label:"15$ under 1,500 (D)"},{value:"fullcharges",label:"Full shipping charges (E)"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`shipping-${Oe.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`shipping-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Pricing Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:z,onValueChange:oe,className:"grid grid-cols-2 @sm:grid-cols-3 gap-1",children:[{value:"exclusive",label:"Exclusive (1)"},{value:"ecommerce",label:"E-Commerce (2)"},{value:"commercial",label:"Commercial (3)"},{value:"buyinggroup",label:"Buying Group (4)"},{value:"cost",label:"Cost (5)"}].map(Oe=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:Oe.value,id:`pricing-${Oe.value}`,className:"h-6 w-6 scale-50 antialiased"}),jsxRuntime.jsx(Label$2,{htmlFor:`pricing-${Oe.value}`,className:"cursor-pointer text-xs",children:Oe.label})]},Oe.value))})]})]})})]})]})};function OrderCategories({openOrders:t=[],isLoading:e=!1}){const n=(t==null?void 0:t.filter(M=>M.DocumentType==="Order"))||[],o=(t==null?void 0:t.filter(M=>M.DocumentType==="Shipment"))||[],l=n.filter(M=>M.WarehouseCode!=="3PLE"),d=l.reduce((M,I)=>M+(I.Quantity??0),0),f=l.reduce((M,I)=>M+(I.ExtendedPrice??0),0),g=n.filter(M=>M.WarehouseCode==="3PLE"),b=g.reduce((M,I)=>M+(I.Quantity??0),0),_=g.reduce((M,I)=>M+(I.ExtendedPrice??0),0),S=o.reduce((M,I)=>M+(I.Quantity??0),0),R=o.reduce((M,I)=>M+(I.ExtendedPrice??0),0),C=d+b+S,E=f+_+R,A=[{name:"All",icon:Package,color:"bg-blue-500",orders:C,amount:E},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",orders:d,amount:f},{name:"Shipped",icon:Truck,color:"bg-green-500",orders:S,amount:R},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",orders:b,amount:_}];return e?jsxRuntime.jsxs(Card,{className:"w-full @md:col-span-2 @xl:col-span-1",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-40"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-3.5",children:[1,2,3,4].map(M=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:"bg-gray-200 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]})},M))})})]}):jsxRuntime.jsxs(Card,{className:"w-full @md:col-span-2 @xl:col-span-1",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Order Categories"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-3.5",children:A.map(M=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:`${M.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:M.name}),jsxRuntime.jsx("div",{className:`${M.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(M.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:M.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:jsxRuntime.jsx(FormattedNumber,{value:M.amount,style:"currency",currency:"CAD",currencyDisplay:"symbol"})})]})]})]})]})},M.name))})})]})}function ReportsSection({isLoading:t,userEmail:e,appID:n}){const{toast:o}=useToast(),[l,{isLoading:d}]=usePostV4ResellerByRouteResellerIdReportWalmartTrackingFileEmailMutation(),[f,{isLoading:g}]=usePostV4ResellerByRouteResellerIdReportAmazonTrackingFileEmailMutation(),[b,{isLoading:_}]=usePostV4ResellerByRouteResellerIdReportOpenOrdersEmailMutation(),[S,{isLoading:R}]=usePostV4ResellerByRouteResellerIdReportProductsEmailMutation(),[C,{isLoading:E}]=usePostV4ResellerByRouteResellerIdReportInvoicesEmailMutation(),[A,{isLoading:M}]=usePostV4ResellerByRouteResellerIdDocumentStatementEmailMutation(),[I,j]=React.useState(null),[q,z]=React.useState(e),[Q,F]=React.useState(!1),V=[{name:"Products",reports:[{id:"Products",title:"Universal Product List",description:"A comprehensive overview of your product list with detailed specifications and pricing information.",icon:Package}]},{name:"Operation Details",reports:[{id:"OpenOrders",title:"Order Details",description:"A detailed report of all your orders and shipments, including status, tracking information, and delivery estimates.",icon:ShoppingCart},{id:"Invoices",title:"Invoices and Credits Report",description:"Detailed overview of your invoices and credits within a specific date range. It also contains reports about additional charges, serial numbers, and other relevant information.",icon:ScrollText},{id:"Statement",title:"Statement and RMAs Report",description:"A detailed report of all unpaid invoices and active RMAs.",icon:Banknote}]},{name:"Tracking Files",reports:[{id:"AmazonTrackingFile",title:"Amazon Tracking File",description:"Track products sold on Amazon marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing},{id:"WalmartTrackingFile",title:"Walmart Tracking File",description:"Track products sold on Walmart marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing}]}],te=async ge=>{j(ge),F(!0)},ne=async()=>{if(!(!I||!n))try{switch(I.id){case"Products":await S({routeResellerId:n,emailAddress:q}).unwrap();break;case"AmazonTrackingFile":await f({routeResellerId:n,emailAddress:q}).unwrap();break;case"WalmartTrackingFile":await l({routeResellerId:n,emailAddress:q}).unwrap();break;case"OpenOrders":await b({routeResellerId:n,emailAddress:q}).unwrap();break;case"Invoices":await C({routeResellerId:n,emailAddress:q}).unwrap();break;case"Statement":await A({routeResellerId:n,emailAddress:q}).unwrap();break;default:throw new Error("invalid report id")}o({title:"Report requested",description:`The ${I.title} will be sent to ${q} shortly.`,variant:"success"}),F(!1)}catch(ge){console.error("Error requesting report:",ge),o({title:"Error",description:"Failed to request report. Please try again.",variant:"destructive"})}},se=_||R||g||d||M||E;return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Reports"}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Download essential business reports, from your Product List to your Order Details."})]}),jsxRuntime.jsx(CardContent,{className:"space-y-6",children:t?jsxRuntime.jsx(jsxRuntime.Fragment,{children:[1,2,3].map(ge=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-48"}),[1,2].map(oe=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})]},oe))]},ge))}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:V.map(ge=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold",children:ge.name}),ge.reports.map(oe=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg hover:bg-gray-100 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:jsxRuntime.jsx(oe.icon,{className:"h-5 w-5 text-primary"})}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h4",{className:"font-semibold text-sm",children:oe.title}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:oe.description})]}),jsxRuntime.jsxs(Button,{variant:"outline",size:"sm",className:"flex items-center gap-1",onClick:()=>te(oe),children:[jsxRuntime.jsx(Download,{className:"h-4 w-4"}),"Request"]})]},oe.id))]},ge.name))})}),jsxRuntime.jsx(Dialog,{open:Q,onOpenChange:F,children:jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsxs(DialogTitle,{children:["Request ",I==null?void 0:I.title]}),jsxRuntime.jsx(DialogDescription,{children:"Enter the email address where you would like to receive the report."})]}),jsxRuntime.jsxs("div",{className:"py-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",value:q,onChange:ge=>z(ge.target.value),placeholder:"your@email.com",className:"mt-2"})]}),jsxRuntime.jsx(DialogDescription,{children:"The report will take around 5 minutes to generate."}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button,{variant:"outline",onClick:()=>F(!1),children:"Cancel"}),jsxRuntime.jsx(Button,{onClick:ne,disabled:!q||se,children:se?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Report"})]})]})})]})}const badgeVariants=cva("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input hover:bg-accent hover:text-accent-foreground",success:"bg-green-600 text-white hover:bg-green-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",ghost:"bg-background hover:bg-accent hover:text-accent-foreground",randmarRed:"bg-randmar-red text-white hover:bg-randmar-red/80",randmarBlue:"bg-randmar-blue text-white hover:bg-randmar-blue/80",randmarPurple:"bg-randmar-purple text-white hover:bg-randmar-purple/80",randmarGreen:"bg-randmar-green text-black hover:bg-randmar-green/80",randmarBlack:"bg-randmar-black text-white hover:bg-randmar-black/80",randmarYellow:"bg-randmar-yellow text-black hover:bg-randmar-yellow/80"},size:{default:"h-6",sm:"h-5 text-[10px]",lg:"h-7 px-3"}},defaultVariants:{variant:"default",size:"default"}}),Badge=React__namespace.forwardRef(({className:t,variant:e,size:n,icon:o,children:l,...d},f)=>jsxRuntime.jsxs("div",{ref:f,className:cn(badgeVariants({variant:e,size:n}),t),...d,children:[o&&jsxRuntime.jsx("span",{className:"mr-1",children:o}),l]}));Badge.displayName="Badge";function QualificationBadge({qualification:t}){return!t.QualificationId||t.QualificationId==="Suspended"?null:t.QualificationId==="Do Not Sell"?jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"destructive",children:[jsxRuntime.jsx(X$1,{className:"h-3 w-3 mr-1"}),"Do Not Sell"]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})}):jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"info",className:t.DefaultOpportunityNumber?"pr-1":"",children:[jsxRuntime.jsx(BadgeCheck,{className:"h-3 w-3 mr-1"}),t.QualificationId,t.DefaultOpportunityNumber&&jsxRuntime.jsx(Badge,{variant:"secondary",size:"sm",className:"ml-1",children:t.DefaultOpportunityNumber})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})})}function SalesChart({statistics:t,mode:e="month",chartHeight:n,loading:o=!1,size:l="default"}){const[d,f]=React.useState([]),[g,b]=React.useState(!1),_=[{name:"dollarVolume",label:"Dollar Volume",color:"var(--primary)",yAxisId:"left",format:"money"},{name:"unitsSold",label:"Units Sold",color:"#888",units:" units",yAxisId:"right",format:"integer"}];return React.useEffect(()=>{if(o||!t){f([]);return}let S=[];if(e==="week"){const R=new Map;t.forEach(C=>{var A;const E=((A=C.Day)==null?void 0:A.toString())||"";if(E.length===8){const M=parseInt(E.substring(0,4),10),I=parseInt(E.substring(4,6),10)-1,j=parseInt(E.substring(6,8),10),q=new Date(M,I,j),z=new Date(q);z.setDate(q.getDate()-q.getDay());const Q=`${z.getFullYear()}-${String(z.getMonth()+1).padStart(2,"0")}-${String(z.getDate()).padStart(2,"0")}`,F=R.get(Q)||{price:0,quantity:0};F.price+=C.ExtendedPrice||0,F.quantity+=C.Quantity||0,R.set(Q,F)}}),S=Array.from(R).sort(([C],[E])=>C.localeCompare(E)).map(([C,E])=>({date:`${C.substring(5,7)}/${C.substring(8,10)}`,dollarVolume:E.price,unitsSold:E.quantity}))}else{const R=new Date,C=R.getFullYear(),E=R.getMonth(),A=R.getDate(),M=`${C}-${(E+1).toString().padStart(2,"0")}`,I=Array.from({length:12},(q,z)=>{const Q=new Date(C,E-(11-z),1);return`${Q.getFullYear()}-${(Q.getMonth()+1).toString().padStart(2,"0")}`}),j=Object.fromEntries(I.map(q=>[q,{price:0,quantity:0}]));if(t.forEach(q=>{const z=String(q.Day??0);if(z.length!==8)return;const Q=`${z.substring(0,4)}-${z.substring(4,6)}`;j.hasOwnProperty(Q)&&(j[Q].price+=q.ExtendedPrice??0,j[Q].quantity+=q.Quantity??0)}),S=I.map(q=>{const z=j[q],[Q,F]=q.split("-").map(Number);return{date:new Date(Q,F-1).toLocaleString("default",{month:"short",year:"numeric"}),dollarVolume:z.price,unitsSold:z.quantity}}),g){const q=j[M];if(q&&q.price>0&&A>0){const z=new Date(C,E+1,0).getDate();if(A<z){const Q=q.price/A,F=q.quantity/A,V=Q*z,te=F*z,ne=S[S.length-1];ne&&(ne.dollarVolume=V,ne.unitsSold=te)}}}}f(S)},[t,e,g,o]),o?jsxRuntime.jsx("div",{style:{height:n},children:jsxRuntime.jsx(Skeleton,{className:"h-full w-full rounded-md"})}):d.length===0?jsxRuntime.jsx("div",{style:{height:n},className:"flex items-center justify-center text-muted-foreground",children:"No sales data available."}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(AreaChart,{data:d,series:_,height:n,size:l}),l==="default"&&e==="month"&&jsxRuntime.jsxs("div",{className:"mt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Switch,{checked:g,onCheckedChange:b,id:"extrapolate-switch"}),jsxRuntime.jsx(Label$2,{htmlFor:"extrapolate-switch",children:"Extrapolate Current Month"})]}),g&&jsxRuntime.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["* Values for ",new Date().toLocaleString("default",{month:"long"})," are projected estimates."]})]})]})}function ManufacturerCard({manufacturer:t,link:e,linkNewTab:n=!0,actions:o,mainAction:l,loading:d=!1}){var S,R,C;if(d||!t)return jsxRuntime.jsxs(Card,{className:"flex flex-col h-full",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-24"})]}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex flex-col space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2 mt-auto",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const f=t.ManufacturerId||"N/A",g=[t.City,t.Province,t.Country].filter(Boolean),b=g.length>0?g.join(", "):"",_=((S=t.Tags)==null?void 0:S.split(",").map(E=>E.trim()).filter(Boolean))||[];return jsxRuntime.jsxs(Card,{className:"manufacturer-theme flex flex-col h-full",children:[jsxRuntime.jsx(reactRouterDom.Link,{to:e??"#",target:e&&n?"_blank":"_self",children:jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"h-12 w-12 overflow-hidden rounded-md",children:jsxRuntime.jsx(PartnerLogo,{id:t.ManufacturerId,width:48,height:48})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-primary",children:"Manufacturer"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"|"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:f})]}),jsxRuntime.jsx("h3",{className:"font-semibold",children:t.PublicName||"N/A"}),t.Name&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:t.Name}),b&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:b})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col items-end gap-2",children:t.SalesStatistics&&t.SalesStatistics.length>0&&jsxRuntime.jsx("div",{className:"h-16 w-24",children:jsxRuntime.jsx(SalesChart,{statistics:t.SalesStatistics,size:"mini"})})})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[(!!((R=t.Qualification)!=null&&R.QualificationId)&&((C=t.Qualification)==null?void 0:C.QualificationId)!=="Suspended"||!!t.OpenToWork||!!t.OnHold&&t.OnHold!==0||_.length>0)&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(QualificationBadge,{qualification:t.Qualification??{}}),!!t.OpenToWork&&jsxRuntime.jsxs(Badge,{variant:"success",children:[jsxRuntime.jsx(HardHat,{className:"h-3 w-3 mr-1"}),"Open To Work"]}),!!t.OnHold&&t.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"}),_.map((E,A)=>jsxRuntime.jsx(Badge,{variant:"outline",children:E},A))]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[t.Phone&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`tel:${t.Phone}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.Phone})]}),t.PublicEmail&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`mailto:${t.PublicEmail}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.PublicEmail})]}),t.Website&&jsxRuntime.jsxs(reactRouterDom.Link,{to:t.Website,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.Website})]}),t.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:t.CurrencyCode})]})]})]}),t.SalesData&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:t.SalesData.SalesYearToDay?formatMoney(t.SalesData.SalesYearToDay):"—"}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:t.SalesData.SalesLast3Months?formatMoney(t.SalesData.SalesLast3Months):"—"}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:t.SalesData.SalesLast30Days?formatMoney(t.SalesData.SalesLast30Days):"—"})]})]})}),(o||l||t.PublicResourcesLink)&&jsxRuntime.jsxs(CardFooter,{className:"flex pt-2 gap-2 justify-between mt-auto",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[o&&o,t.PublicResourcesLink&&jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:t.PublicResourcesLink,target:"_blank",children:jsxRuntime.jsx(Button,{size:"icon",children:jsxRuntime.jsx(HardDriveDownload,{className:"h-4 w-4"})})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Public Resources Link"})})]})})]}),l&&jsxRuntime.jsx("div",{children:l})]})]})}function OrdersCard({applicationId:t,orders:e=null,loading:n=!1,title:o="Order Details"}){const l=React.useMemo(()=>[{accessorKey:"DocumentNumber",header:"Document Number",cell:({row:g})=>g.original.DocumentNumber?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${t}/Document/${g.original.DocumentNumber}`,className:"font-medium text-primary hover:underline",children:g.original.DocumentNumber})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for order ",g.original.DocumentNumber]})})]})}):"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"DocumentDate",header:"Document Date",cell:({row:g})=>formatYYYYMMDDIntToDateString(g.original.DocumentDate),enableSorting:!0,enableFiltering:!1},{accessorKey:"OrderNumber",header:"Order Number",cell:({row:g})=>g.original.OrderNumber??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"PONumber",header:"PO Number",cell:({row:g})=>g.original.PONumber??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"WarehouseCode",header:"Warehouse",cell:({row:g})=>g.original.WarehouseCode??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"Quantity",header:"Quantity",cell:({row:g})=>g.original.Quantity??"N/A",enableSorting:!0,enableFiltering:!1},{accessorKey:"ShipToName",header:"Name",cell:({row:g})=>jsxRuntime.jsx("div",{className:"min-w-[150px]",children:g.original.ShipToName??"N/A"}),enableSorting:!0,enableFiltering:!0},{accessorKey:"UnitPrice",header:"Unit Price",cell:({row:g})=>g.original.UnitPrice?formatMoney(g.original.UnitPrice):"N/A",enableSorting:!0,enableFiltering:!1}],[]),d=React.useMemo(()=>{const g={};if(e){const b=Array.from(new Set(e.map(E=>E.WarehouseCode).filter(E=>E!=null)));g.WarehouseCode=b;const _=Array.from(new Set(e.map(E=>E.ShipToName).filter(E=>E!=null)));g.ShipToName=_;const S=Array.from(new Set(e.map(E=>E.DocumentNumber).filter(E=>E!=null)));g.DocumentNumber=S;const R=Array.from(new Set(e.map(E=>E.OrderNumber).filter(E=>E!=null)));g.OrderNumber=R;const C=Array.from(new Set(e.map(E=>E.PONumber).filter(E=>E!=null)));g.PONumber=C}return g},[e]),f=e||[];return n?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(Skeleton,{className:"h-7 w-48"})," "]}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md border"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-[130px]"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-20"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})]})]})]})]}):jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:o})," "]}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(DataTable,{columns:l,data:f,uniqueValues:d})})]})}function ResellerOverview({appID:t,reseller:e,readonly:n,userEmail:o,isSuperAdmin:l,withoutReports:d=!1}){const{data:f,isLoading:g,isError:b}=useGetV4PartnerByApplicationIdAccountResellerQuery({applicationId:t??"",withSpecification:!0},{skip:!!e}),[_,S]=React.useState({publicInfo:{hasUnsavedChanges:!1}}),R=React.useCallback(()=>n?!1:_.publicInfo.hasUnsavedChanges,[n,_]),C=React.useCallback((q,z)=>{S(Q=>{var F;return((F=Q[q])==null?void 0:F.hasUnsavedChanges)!==z.hasUnsavedChanges?{...Q,[q]:z}:Q})},[]),{NavigationGuardDialog:E}=useRouterNavigationGuard(R),A=e??f,M=!n||!!(A!=null&&A.Statement)&&(A.Statement.Total??0)>0,I=(A==null?void 0:A.QualifiedManufacturers)??[],j=(A==null?void 0:A.Qualifications)??[];return jsxRuntime.jsxs("div",{className:"@container",children:[b?jsxRuntime.jsx(Card,{className:"p-6",children:jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Error"}),jsxRuntime.jsx(AlertDescription,{children:"There was an error loading your reseller information. Please try again later."})]})}):jsxRuntime.jsxs("div",{className:"space-y-6 mb-6",children:[jsxRuntime.jsx(SalesSummary,{fiscalYearMonthStart:(A==null?void 0:A.FiscalYearMonthStart)||1,salesData:A==null?void 0:A.SalesData,isLoading:g}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @2xl:grid-cols-2 gap-6",children:[jsxRuntime.jsx(SalesChartCard,{statistics:(A==null?void 0:A.SalesStatistics)??[],loading:g}),jsxRuntime.jsx(OrderCategories,{openOrders:(A==null?void 0:A.ActiveOrderDetails)??[],isLoading:g}),M&&jsxRuntime.jsx(BillingCard,{appID:t,reseller:A||{},withoutReports:d,isLoading:g,userEmail:o}),jsxRuntime.jsx(PublicInfo,{reseller:A||{},appID:t??"",isLoading:g,readonly:n,onUnsavedChanges:q=>C("publicInfo",{hasUnsavedChanges:q})}),jsxRuntime.jsx(AccountTier,{isSuperAdmin:l,readonly:n,reseller:A||{},appID:t??"",isLoading:g})]}),g||I.length>0?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Manufacturers you are qualified for"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid @2xl:grid-cols-2 gap-4",children:g?Array.from({length:2}).map((q,z)=>jsxRuntime.jsx(ManufacturerCard,{loading:!0},z)):I.map(q=>jsxRuntime.jsx(ManufacturerCard,{manufacturer:q,link:`https://dashboard.randmar.io/${t}/Partner/${q.ManufacturerId}`},q.ManufacturerId))})})]}):jsxRuntime.jsx(ResellerQualificationsCard,{qualifications:j}),jsxRuntime.jsx(OpportunitiesTable,{applicationId:t,opportunities:A==null?void 0:A.Opportunities,loading:g}),jsxRuntime.jsx(OrdersCard,{applicationId:t,title:"Active Orders",orders:A==null?void 0:A.ActiveOrderDetails,loading:g}),jsxRuntime.jsx(OrdersCard,{applicationId:t,title:"Completed Orders",orders:A==null?void 0:A.CompletedOrderDetails,loading:g}),jsxRuntime.jsx(ReturnsTable,{applicationId:t,returns:A==null?void 0:A.Returns,loading:g}),!d&&jsxRuntime.jsx(ReportsSection,{appID:t,userEmail:o,isLoading:g})]}),jsxRuntime.jsx(E,{})]})}const alertVariants=cva("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-500/50 bg-green-50 text-green-700 dark:border-green-500 dark:bg-green-950 dark:text-green-400 [&>svg]:text-green-500",warning:"border-yellow-500/50 bg-yellow-50 text-yellow-700 dark:border-yellow-500 dark:bg-yellow-950 dark:text-yellow-400 [&>svg]:text-yellow-500",info:"border-blue-500/50 bg-blue-50 text-blue-700 dark:border-blue-500 dark:bg-blue-950 dark:text-blue-400 [&>svg]:text-blue-500"}},defaultVariants:{variant:"default"}}),Alert=React__namespace.forwardRef(({className:t,variant:e,...n},o)=>jsxRuntime.jsx("div",{ref:o,role:"alert",className:cn(alertVariants({variant:e}),t),...n}));Alert.displayName="Alert";const AlertTitle=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("h5",{ref:n,className:cn("mb-1 font-medium leading-none tracking-tight",t),...e}));AlertTitle.displayName="AlertTitle";const AlertDescription=React__namespace.forwardRef(({className:t,...e},n)=>jsxRuntime.jsx("div",{ref:n,className:cn("text-sm [&_p]:leading-relaxed",t),...e}));AlertDescription.displayName="AlertDescription";/**
|
|
1080
1080
|
* table-core
|
|
1081
1081
|
*
|
|
1082
1082
|
* Copyright (c) TanStack
|