diff --git a/dist/assets/Button-COL1_fTB.js b/dist/assets/Button-BkRsd5c4.js similarity index 98% rename from dist/assets/Button-COL1_fTB.js rename to dist/assets/Button-BkRsd5c4.js index d67b06e..0aa97b5 100644 --- a/dist/assets/Button-COL1_fTB.js +++ b/dist/assets/Button-BkRsd5c4.js @@ -1 +1 @@ -import{l as V,m as _,a as d,aK as j,n as O,o as F,_ as r,j as b,p as R,q as n,v as U,w as z,X as G,a4 as A,A as u}from"./index-Dg-wT72v.js";function D(o){return V("MuiButton",o)}const v=_("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),H=d.createContext({}),q=d.createContext(void 0),K=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],X=o=>{const{color:a,disableElevation:i,fullWidth:s,size:t,variant:l,classes:c}=o,x={root:["root",l,`${l}${n(a)}`,`size${n(t)}`,`${l}Size${n(t)}`,`color${n(a)}`,i&&"disableElevation",s&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${n(t)}`],endIcon:["icon","endIcon",`iconSize${n(t)}`]},g=U(x,D,c);return r({},c,g)},k=o=>r({},o.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},o.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},o.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),J=z(G,{shouldForwardProp:o=>A(o)||o==="classes",name:"MuiButton",slot:"Root",overridesResolver:(o,a)=>{const{ownerState:i}=o;return[a.root,a[i.variant],a[`${i.variant}${n(i.color)}`],a[`size${n(i.size)}`],a[`${i.variant}Size${n(i.size)}`],i.color==="inherit"&&a.colorInherit,i.disableElevation&&a.disableElevation,i.fullWidth&&a.fullWidth]}})(({theme:o,ownerState:a})=>{var i,s;const t=o.palette.mode==="light"?o.palette.grey[300]:o.palette.grey[800],l=o.palette.mode==="light"?o.palette.grey.A100:o.palette.grey[700];return r({},o.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(o.vars||o).shape.borderRadius,transition:o.transitions.create(["background-color","box-shadow","border-color","color"],{duration:o.transitions.duration.short}),"&:hover":r({textDecoration:"none",backgroundColor:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})`:u(o.palette.text.primary,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},a.variant==="text"&&a.color!=="inherit"&&{backgroundColor:o.vars?`rgba(${o.vars.palette[a.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:u(o.palette[a.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},a.variant==="outlined"&&a.color!=="inherit"&&{border:`1px solid ${(o.vars||o).palette[a.color].main}`,backgroundColor:o.vars?`rgba(${o.vars.palette[a.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:u(o.palette[a.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},a.variant==="contained"&&{backgroundColor:o.vars?o.vars.palette.Button.inheritContainedHoverBg:l,boxShadow:(o.vars||o).shadows[4],"@media (hover: none)":{boxShadow:(o.vars||o).shadows[2],backgroundColor:(o.vars||o).palette.grey[300]}},a.variant==="contained"&&a.color!=="inherit"&&{backgroundColor:(o.vars||o).palette[a.color].dark,"@media (hover: none)":{backgroundColor:(o.vars||o).palette[a.color].main}}),"&:active":r({},a.variant==="contained"&&{boxShadow:(o.vars||o).shadows[8]}),[`&.${v.focusVisible}`]:r({},a.variant==="contained"&&{boxShadow:(o.vars||o).shadows[6]}),[`&.${v.disabled}`]:r({color:(o.vars||o).palette.action.disabled},a.variant==="outlined"&&{border:`1px solid ${(o.vars||o).palette.action.disabledBackground}`},a.variant==="contained"&&{color:(o.vars||o).palette.action.disabled,boxShadow:(o.vars||o).shadows[0],backgroundColor:(o.vars||o).palette.action.disabledBackground})},a.variant==="text"&&{padding:"6px 8px"},a.variant==="text"&&a.color!=="inherit"&&{color:(o.vars||o).palette[a.color].main},a.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},a.variant==="outlined"&&a.color!=="inherit"&&{color:(o.vars||o).palette[a.color].main,border:o.vars?`1px solid rgba(${o.vars.palette[a.color].mainChannel} / 0.5)`:`1px solid ${u(o.palette[a.color].main,.5)}`},a.variant==="contained"&&{color:o.vars?o.vars.palette.text.primary:(i=(s=o.palette).getContrastText)==null?void 0:i.call(s,o.palette.grey[300]),backgroundColor:o.vars?o.vars.palette.Button.inheritContainedBg:t,boxShadow:(o.vars||o).shadows[2]},a.variant==="contained"&&a.color!=="inherit"&&{color:(o.vars||o).palette[a.color].contrastText,backgroundColor:(o.vars||o).palette[a.color].main},a.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},a.size==="small"&&a.variant==="text"&&{padding:"4px 5px",fontSize:o.typography.pxToRem(13)},a.size==="large"&&a.variant==="text"&&{padding:"8px 11px",fontSize:o.typography.pxToRem(15)},a.size==="small"&&a.variant==="outlined"&&{padding:"3px 9px",fontSize:o.typography.pxToRem(13)},a.size==="large"&&a.variant==="outlined"&&{padding:"7px 21px",fontSize:o.typography.pxToRem(15)},a.size==="small"&&a.variant==="contained"&&{padding:"4px 10px",fontSize:o.typography.pxToRem(13)},a.size==="large"&&a.variant==="contained"&&{padding:"8px 22px",fontSize:o.typography.pxToRem(15)},a.fullWidth&&{width:"100%"})},({ownerState:o})=>o.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${v.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${v.disabled}`]:{boxShadow:"none"}}),Q=z("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(o,a)=>{const{ownerState:i}=o;return[a.startIcon,a[`iconSize${n(i.size)}`]]}})(({ownerState:o})=>r({display:"inherit",marginRight:8,marginLeft:-4},o.size==="small"&&{marginLeft:-2},k(o))),Y=z("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(o,a)=>{const{ownerState:i}=o;return[a.endIcon,a[`iconSize${n(i.size)}`]]}})(({ownerState:o})=>r({display:"inherit",marginRight:-4,marginLeft:8},o.size==="small"&&{marginRight:-2},k(o))),w=d.forwardRef(function(a,i){const s=d.useContext(H),t=d.useContext(q),l=j(s,a),c=O({props:l,name:"MuiButton"}),{children:x,color:g="primary",component:C="button",className:h,disabled:f=!1,disableElevation:E=!1,disableFocusRipple:y=!1,endIcon:I,focusVisibleClassName:P,fullWidth:W=!1,size:M="medium",startIcon:$,type:B,variant:N="text"}=c,L=F(c,K),p=r({},c,{color:g,component:C,disabled:f,disableElevation:E,disableFocusRipple:y,fullWidth:W,size:M,type:B,variant:N}),e=X(p),S=$&&b.jsx(Q,{className:e.startIcon,ownerState:p,children:$}),m=I&&b.jsx(Y,{className:e.endIcon,ownerState:p,children:I}),T=t||"";return b.jsxs(J,r({ownerState:p,className:R(s.className,e.root,h,T),component:C,disabled:f,focusRipple:!y,focusVisibleClassName:R(e.focusVisible,P),ref:i,type:B},L,{classes:e,children:[S,x,m]}))});export{w as B}; +import{l as V,m as _,a as d,aK as j,n as O,o as F,_ as r,j as b,p as R,q as n,v as U,w as z,X as G,a4 as A,A as u}from"./index-J0uxx8As.js";function D(o){return V("MuiButton",o)}const v=_("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),H=d.createContext({}),q=d.createContext(void 0),K=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],X=o=>{const{color:a,disableElevation:i,fullWidth:s,size:t,variant:l,classes:c}=o,x={root:["root",l,`${l}${n(a)}`,`size${n(t)}`,`${l}Size${n(t)}`,`color${n(a)}`,i&&"disableElevation",s&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${n(t)}`],endIcon:["icon","endIcon",`iconSize${n(t)}`]},g=U(x,D,c);return r({},c,g)},k=o=>r({},o.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},o.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},o.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),J=z(G,{shouldForwardProp:o=>A(o)||o==="classes",name:"MuiButton",slot:"Root",overridesResolver:(o,a)=>{const{ownerState:i}=o;return[a.root,a[i.variant],a[`${i.variant}${n(i.color)}`],a[`size${n(i.size)}`],a[`${i.variant}Size${n(i.size)}`],i.color==="inherit"&&a.colorInherit,i.disableElevation&&a.disableElevation,i.fullWidth&&a.fullWidth]}})(({theme:o,ownerState:a})=>{var i,s;const t=o.palette.mode==="light"?o.palette.grey[300]:o.palette.grey[800],l=o.palette.mode==="light"?o.palette.grey.A100:o.palette.grey[700];return r({},o.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(o.vars||o).shape.borderRadius,transition:o.transitions.create(["background-color","box-shadow","border-color","color"],{duration:o.transitions.duration.short}),"&:hover":r({textDecoration:"none",backgroundColor:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})`:u(o.palette.text.primary,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},a.variant==="text"&&a.color!=="inherit"&&{backgroundColor:o.vars?`rgba(${o.vars.palette[a.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:u(o.palette[a.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},a.variant==="outlined"&&a.color!=="inherit"&&{border:`1px solid ${(o.vars||o).palette[a.color].main}`,backgroundColor:o.vars?`rgba(${o.vars.palette[a.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:u(o.palette[a.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},a.variant==="contained"&&{backgroundColor:o.vars?o.vars.palette.Button.inheritContainedHoverBg:l,boxShadow:(o.vars||o).shadows[4],"@media (hover: none)":{boxShadow:(o.vars||o).shadows[2],backgroundColor:(o.vars||o).palette.grey[300]}},a.variant==="contained"&&a.color!=="inherit"&&{backgroundColor:(o.vars||o).palette[a.color].dark,"@media (hover: none)":{backgroundColor:(o.vars||o).palette[a.color].main}}),"&:active":r({},a.variant==="contained"&&{boxShadow:(o.vars||o).shadows[8]}),[`&.${v.focusVisible}`]:r({},a.variant==="contained"&&{boxShadow:(o.vars||o).shadows[6]}),[`&.${v.disabled}`]:r({color:(o.vars||o).palette.action.disabled},a.variant==="outlined"&&{border:`1px solid ${(o.vars||o).palette.action.disabledBackground}`},a.variant==="contained"&&{color:(o.vars||o).palette.action.disabled,boxShadow:(o.vars||o).shadows[0],backgroundColor:(o.vars||o).palette.action.disabledBackground})},a.variant==="text"&&{padding:"6px 8px"},a.variant==="text"&&a.color!=="inherit"&&{color:(o.vars||o).palette[a.color].main},a.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},a.variant==="outlined"&&a.color!=="inherit"&&{color:(o.vars||o).palette[a.color].main,border:o.vars?`1px solid rgba(${o.vars.palette[a.color].mainChannel} / 0.5)`:`1px solid ${u(o.palette[a.color].main,.5)}`},a.variant==="contained"&&{color:o.vars?o.vars.palette.text.primary:(i=(s=o.palette).getContrastText)==null?void 0:i.call(s,o.palette.grey[300]),backgroundColor:o.vars?o.vars.palette.Button.inheritContainedBg:t,boxShadow:(o.vars||o).shadows[2]},a.variant==="contained"&&a.color!=="inherit"&&{color:(o.vars||o).palette[a.color].contrastText,backgroundColor:(o.vars||o).palette[a.color].main},a.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},a.size==="small"&&a.variant==="text"&&{padding:"4px 5px",fontSize:o.typography.pxToRem(13)},a.size==="large"&&a.variant==="text"&&{padding:"8px 11px",fontSize:o.typography.pxToRem(15)},a.size==="small"&&a.variant==="outlined"&&{padding:"3px 9px",fontSize:o.typography.pxToRem(13)},a.size==="large"&&a.variant==="outlined"&&{padding:"7px 21px",fontSize:o.typography.pxToRem(15)},a.size==="small"&&a.variant==="contained"&&{padding:"4px 10px",fontSize:o.typography.pxToRem(13)},a.size==="large"&&a.variant==="contained"&&{padding:"8px 22px",fontSize:o.typography.pxToRem(15)},a.fullWidth&&{width:"100%"})},({ownerState:o})=>o.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${v.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${v.disabled}`]:{boxShadow:"none"}}),Q=z("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(o,a)=>{const{ownerState:i}=o;return[a.startIcon,a[`iconSize${n(i.size)}`]]}})(({ownerState:o})=>r({display:"inherit",marginRight:8,marginLeft:-4},o.size==="small"&&{marginLeft:-2},k(o))),Y=z("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(o,a)=>{const{ownerState:i}=o;return[a.endIcon,a[`iconSize${n(i.size)}`]]}})(({ownerState:o})=>r({display:"inherit",marginRight:-4,marginLeft:8},o.size==="small"&&{marginRight:-2},k(o))),w=d.forwardRef(function(a,i){const s=d.useContext(H),t=d.useContext(q),l=j(s,a),c=O({props:l,name:"MuiButton"}),{children:x,color:g="primary",component:C="button",className:h,disabled:f=!1,disableElevation:E=!1,disableFocusRipple:y=!1,endIcon:I,focusVisibleClassName:P,fullWidth:W=!1,size:M="medium",startIcon:$,type:B,variant:N="text"}=c,L=F(c,K),p=r({},c,{color:g,component:C,disabled:f,disableElevation:E,disableFocusRipple:y,fullWidth:W,size:M,type:B,variant:N}),e=X(p),S=$&&b.jsx(Q,{className:e.startIcon,ownerState:p,children:$}),m=I&&b.jsx(Y,{className:e.endIcon,ownerState:p,children:I}),T=t||"";return b.jsxs(J,r({ownerState:p,className:R(s.className,e.root,h,T),component:C,disabled:f,focusRipple:!y,focusVisibleClassName:R(e.focusVisible,P),ref:i,type:B},L,{classes:e,children:[S,x,m]}))});export{w as B}; diff --git a/dist/assets/Close-DKUHif5O.js b/dist/assets/Close-DtPVHjo-.js similarity index 80% rename from dist/assets/Close-DKUHif5O.js rename to dist/assets/Close-DtPVHjo-.js index e92c6be..cd03b85 100644 --- a/dist/assets/Close-DKUHif5O.js +++ b/dist/assets/Close-DtPVHjo-.js @@ -1 +1 @@ -import{r,j as t,i as a}from"./index-Dg-wT72v.js";var e={},o=a;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,s=o(r()),i=t;u=e.default=(0,s.default)((0,i.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");export{u as d}; +import{r,j as t,i as a}from"./index-J0uxx8As.js";var e={},o=a;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,s=o(r()),i=t;u=e.default=(0,s.default)((0,i.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");export{u as d}; diff --git a/dist/assets/ComingSoon-DMAOAczX.js b/dist/assets/ComingSoon-hlrj6HJr.js similarity index 89% rename from dist/assets/ComingSoon-DMAOAczX.js rename to dist/assets/ComingSoon-hlrj6HJr.js index 1f39719..f628baf 100644 --- a/dist/assets/ComingSoon-DMAOAczX.js +++ b/dist/assets/ComingSoon-hlrj6HJr.js @@ -1 +1 @@ -import{a as c,j as e,B as a,S as i,at as x,T as t}from"./index-Dg-wT72v.js";import{T as d}from"./TextField-COVOKpzm.js";import{B as h}from"./Button-COL1_fTB.js";const n=[{label:"Days",value:12},{label:"Hours",value:8},{label:"Minutes",value:45},{label:"Seconds",value:30}];function u(){const[s,o]=c.useState("");return e.jsx(a,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:e.jsxs(i,{spacing:3,alignItems:"center",sx:{maxWidth:620,width:"100%"},children:[e.jsx(x,{}),e.jsx(t,{variant:"h2",sx:{fontWeight:800,color:"grey.800"},children:"Coming Soon"}),e.jsx(t,{variant:"body1",color:"text.secondary",children:"Something new is on its way"}),e.jsx(i,{direction:"row",spacing:{xs:1,sm:2},alignItems:"center",justifyContent:"center",children:n.map((r,l)=>e.jsxs(i,{direction:"row",spacing:{xs:1,sm:2},alignItems:"center",children:[e.jsxs(a,{sx:{width:{xs:64,sm:84},py:2,borderRadius:2,bgcolor:"primary.lighter",border:1,borderColor:"primary.light"},children:[e.jsx(t,{variant:"h2",sx:{fontWeight:800,color:"primary.main",lineHeight:1},children:String(r.value).padStart(2,"0")}),e.jsx(t,{variant:"caption",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:1},children:r.label})]}),lo(r.target.value)}),e.jsx(h,{variant:"contained",sx:{whiteSpace:"nowrap",px:3},children:"Notify Me"})]})]})]})})}export{u as default}; +import{a as c,j as e,B as a,S as i,at as x,T as t}from"./index-J0uxx8As.js";import{T as d}from"./TextField-BARvBB_z.js";import{B as h}from"./Button-BkRsd5c4.js";const n=[{label:"Days",value:12},{label:"Hours",value:8},{label:"Minutes",value:45},{label:"Seconds",value:30}];function u(){const[s,o]=c.useState("");return e.jsx(a,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:e.jsxs(i,{spacing:3,alignItems:"center",sx:{maxWidth:620,width:"100%"},children:[e.jsx(x,{}),e.jsx(t,{variant:"h2",sx:{fontWeight:800,color:"grey.800"},children:"Coming Soon"}),e.jsx(t,{variant:"body1",color:"text.secondary",children:"Something new is on its way"}),e.jsx(i,{direction:"row",spacing:{xs:1,sm:2},alignItems:"center",justifyContent:"center",children:n.map((r,l)=>e.jsxs(i,{direction:"row",spacing:{xs:1,sm:2},alignItems:"center",children:[e.jsxs(a,{sx:{width:{xs:64,sm:84},py:2,borderRadius:2,bgcolor:"primary.lighter",border:1,borderColor:"primary.light"},children:[e.jsx(t,{variant:"h2",sx:{fontWeight:800,color:"primary.main",lineHeight:1},children:String(r.value).padStart(2,"0")}),e.jsx(t,{variant:"caption",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:1},children:r.label})]}),lo(r.target.value)}),e.jsx(h,{variant:"contained",sx:{whiteSpace:"nowrap",px:3},children:"Notify Me"})]})]})]})})}export{u as default}; diff --git a/dist/assets/Dashboard-C9wQ4JPv.js b/dist/assets/Dashboard-DNc332tE.js similarity index 94% rename from dist/assets/Dashboard-C9wQ4JPv.js rename to dist/assets/Dashboard-DNc332tE.js index d9365ae..4feef07 100644 --- a/dist/assets/Dashboard-C9wQ4JPv.js +++ b/dist/assets/Dashboard-DNc332tE.js @@ -1 +1 @@ -import{r as D,j as e,i as R,S as c,B as d,T as i,a as u,t as T,C as U,d as V,U as W,b as q,D as G,f as z,c as J,e as K,g as Q}from"./index-Dg-wT72v.js";import{d as X,E as C}from"./EmptyState-Do4nLXP0.js";import{S,d as Y,a as Z,b as ee,c as P}from"./StatusChip-ioS4PHcC.js";import{P as k,A as te,G as h}from"./PageHeader-DgkErsA7.js";import{B as E}from"./Button-COL1_fTB.js";import{T as re,a as se,b as ae,c as F,d as ne}from"./TableRow-Du7Jvlvh.js";import{T as o}from"./TableCell-ClQIqE-T.js";import{L as ie}from"./LinearProgress-BvM3Q63G.js";import{C as le}from"./Link-CndAQvyC.js";var I={},oe=R;Object.defineProperty(I,"__esModule",{value:!0});var B=I.default=void 0,ce=oe(D()),de=e;B=I.default=(0,ce.default)((0,de.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.25 2.52.77-1.28-3.52-2.09V8z"}),"HistoryOutlined");var L={},xe=R;Object.defineProperty(L,"__esModule",{value:!0});var N=L.default=void 0,ue=xe(D()),he=e;N=L.default=(0,ue.default)((0,he.jsx)("path",{d:"M13 5.08c3.06.44 5.48 2.86 5.92 5.92h3.03c-.47-4.72-4.23-8.48-8.95-8.95zM18.92 13c-.44 3.06-2.86 5.48-5.92 5.92v3.03c4.72-.47 8.48-4.23 8.95-8.95zM11 18.92c-3.39-.49-6-3.4-6-6.92s2.61-6.43 6-6.92V2.05c-5.05.5-9 4.76-9 9.95 0 5.19 3.95 9.45 9 9.95z"}),"DonutLargeOutlined");var A={},me=R;Object.defineProperty(A,"__esModule",{value:!0});var H=A.default=void 0,ge=me(D()),je=e;H=A.default=(0,ge.default)((0,je.jsx)("path",{d:"m12 2-5.5 9h11zm0 3.84L13.93 9h-3.87zM17.5 13c-2.49 0-4.5 2.01-4.5 4.5s2.01 4.5 4.5 4.5 4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5m0 7c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5M3 21.5h8v-8H3zm2-6h4v4H5z"}),"CategoryOutlined");function pe({data:s=[],size:n=180,thickness:x=26,centerLabel:g,centerValue:y}){const j=s.reduce((a,b)=>a+b.value,0)||1,m=(n-x)/2,v=2*Math.PI*m;let f=0;return e.jsxs(c,{direction:{xs:"column",sm:"row"},spacing:3,alignItems:"center",justifyContent:"center",sx:{flexWrap:"wrap"},children:[e.jsxs(d,{sx:{position:"relative",width:n,maxWidth:"100%",aspectRatio:"1 / 1"},children:[e.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${n} ${n}`,children:e.jsxs("g",{transform:`rotate(-90 ${n/2} ${n/2})`,children:[e.jsx("circle",{cx:n/2,cy:n/2,r:m,fill:"none",stroke:"#F0F0F0",strokeWidth:x}),s.map((a,b)=>{const p=a.value/j*v,$=e.jsx("circle",{cx:n/2,cy:n/2,r:m,fill:"none",stroke:a.color,strokeWidth:x,strokeDasharray:`${p} ${v-p}`,strokeDashoffset:-f,strokeLinecap:"butt"},b);return f+=p,$})]})}),e.jsxs(d,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[e.jsx(i,{variant:"h3",sx:{fontWeight:700},children:y??j}),e.jsx(i,{variant:"caption",color:"text.secondary",children:g??"Total"})]})]}),e.jsx(c,{spacing:1.25,children:s.map(a=>e.jsxs(c,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(d,{sx:{width:10,height:10,borderRadius:"3px",bgcolor:a.color}}),e.jsx(i,{variant:"body2",color:"text.secondary",sx:{minWidth:80},children:a.label}),e.jsx(i,{variant:"subtitle2",children:a.value.toLocaleString("en-IN")})]},a.label))})]})}const fe={newclient:"#00A2AE",contacted:"#FFBF00",onboarded:"#00A854",lost:"#F04134"},be=s=>fe[String(s||"").toLowerCase()]||"#8C8C8C",w=["#C01227","#00A2AE","#00A854","#FFBF00","#9E0E20","#8C8C8C","#D6515C"];function _({icon:s,title:n,action:x,color:g="primary",noPadding:y=!1,children:j}){return e.jsxs(le,{sx:{height:"100%",display:"flex",flexDirection:"column",borderRadius:4,boxShadow:"0 10px 30px rgba(0,0,0,0.03)",border:"1px solid rgba(0,0,0,0.04)"},children:[e.jsxs(c,{direction:"row",spacing:1.5,alignItems:"center",sx:{px:3,py:2,borderBottom:1,borderColor:"divider",background:m=>`linear-gradient(90deg, ${m.palette[g].lighter}66 0%, transparent 100%)`},children:[e.jsx(d,{sx:{width:40,height:40,borderRadius:2,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${g}.lighter`,color:`${g}.main`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.05)"},children:e.jsx(s,{fontSize:"small"})}),e.jsx(i,{variant:"h6",sx:{fontWeight:700,color:"grey.800",flexGrow:1,letterSpacing:"-0.3px"},children:n}),x]}),e.jsx(d,{sx:{p:y?0:3,flexGrow:1},children:j})]})}function Re(){var O;const[s,n]=u.useState([]),[x,g]=u.useState([]),[y,j]=u.useState(!0),[m,v]=u.useState(null),f=()=>{j(!0),v(null),Promise.all([z(),J()]).then(([t,r])=>{n((t||[]).map(K)),g((r||[]).map(Q))}).catch(t=>v(t.message||"Failed to load dashboard data")).finally(()=>j(!1))};u.useEffect(()=>{f()},[]);const a=u.useMemo(()=>({total:s.length,newCount:s.filter(t=>t.status==="newClient").length,parcels:s.reduce((t,r)=>t+r.parcelVolume,0),contracts:s.reduce((t,r)=>t+r.activeContracts,0)}),[s]),b=u.useMemo(()=>{const t={};return s.forEach(r=>{t[r.status]=(t[r.status]||0)+1}),Object.entries(t).sort((r,l)=>l[1]-r[1]).map(([r,l])=>({label:T(r),value:l,color:be(r)}))},[s]),p=u.useMemo(()=>{const t={};return s.forEach(r=>{const l=r.businessType||"other";t[l]=(t[l]||0)+1}),Object.entries(t).sort((r,l)=>l[1]-r[1])},[s]),$=((O=p[0])==null?void 0:O[1])||1,M=u.useMemo(()=>[...s].sort((t,r)=>String(r.lastUpdated).localeCompare(String(t.lastUpdated))).slice(0,6),[s]);return new Date().toLocaleDateString("en-IN",{weekday:"long",day:"numeric",month:"long",year:"numeric"}),y?e.jsxs(e.Fragment,{children:[e.jsx(k,{title:"Dashboard",breadcrumbs:[{label:"Dashboard"}]}),e.jsx(d,{sx:{display:"flex",justifyContent:"center",py:12},children:e.jsx(U,{})})]}):e.jsxs(e.Fragment,{children:[e.jsx(k,{title:"Dashboard",breadcrumbs:[{label:"Dashboard"}],action:e.jsx(E,{variant:"outlined",startIcon:e.jsx(X,{}),onClick:f,children:"Refresh"})}),m&&e.jsx(te,{severity:"error",sx:{mb:2.5},action:e.jsx(E,{color:"inherit",size:"small",onClick:f,children:"Retry"}),children:m}),e.jsxs(h,{container:!0,spacing:3,children:[e.jsx(h,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(S,{accent:!0,title:"Total Clients",value:a.total,icon:V,color:"primary",caption:"All registered"})}),e.jsx(h,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(S,{accent:!0,title:"New Clients",value:a.newCount,icon:Y,color:"primary",caption:"Awaiting onboarding"})}),e.jsx(h,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(S,{accent:!0,title:"Total Parcel Volume",value:a.parcels.toLocaleString("en-IN"),icon:Z,color:"primary",caption:"Across all clients"})}),e.jsx(h,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(S,{accent:!0,title:"Active Contracts",value:a.contracts,icon:ee,color:"primary",caption:"Currently running"})}),e.jsx(h,{item:!0,xs:12,lg:8,children:e.jsx(_,{icon:B,title:"Recent Clients",color:"primary",noPadding:!0,children:M.length===0?e.jsx(C,{title:"No clients yet",caption:"Add a client to see it here."}):e.jsx(re,{children:e.jsxs(se,{sx:{minWidth:600},children:[e.jsx(ae,{children:e.jsxs(F,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(o,{children:"Client"}),e.jsx(o,{children:"Type"}),e.jsx(o,{children:"Location"}),e.jsx(o,{align:"right",children:"Parcels"}),e.jsx(o,{children:"Status"})]})}),e.jsx(ne,{children:M.map(t=>e.jsxs(F,{hover:!0,children:[e.jsx(o,{children:e.jsxs(c,{direction:"row",spacing:1.25,alignItems:"center",children:[e.jsx(W,{name:t.name,size:32}),e.jsx(i,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:t.name})]})}),e.jsx(o,{children:e.jsx(i,{variant:"body2",children:T(t.businessType)||"—"})}),e.jsx(o,{children:e.jsxs(i,{variant:"body2",children:[t.city||"—",t.businessState?`, ${t.businessState}`:""]})}),e.jsx(o,{align:"right",sx:{fontWeight:600},children:t.parcelVolume.toLocaleString("en-IN")}),e.jsx(o,{children:e.jsx(P,{status:t.status})})]},t.id))})]})})})}),e.jsx(h,{item:!0,xs:12,lg:4,children:e.jsx(_,{icon:N,title:"Clients by Status",color:"primary",children:e.jsx(d,{sx:{py:1.5},children:b.length===0?e.jsx(C,{title:"No data"}):e.jsx(pe,{data:b,centerValue:a.total,centerLabel:"Clients"})})})}),e.jsx(h,{item:!0,xs:12,lg:8,children:e.jsx(_,{icon:H,title:"Clients by Business Type",color:"primary",children:p.length===0?e.jsx(C,{title:"No data"}):e.jsx(c,{spacing:2.25,children:p.map(([t,r],l)=>e.jsxs(d,{children:[e.jsxs(c,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:.75},children:[e.jsxs(c,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(d,{sx:{width:10,height:10,borderRadius:"3px",bgcolor:w[l%w.length]}}),e.jsx(i,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:T(t)})]}),e.jsxs(i,{variant:"body2",color:"text.secondary",children:[r," · ",Math.round(r/s.length*100),"%"]})]}),e.jsx(ie,{variant:"determinate",value:r/$*100,sx:{height:8,borderRadius:4,bgcolor:"grey.100","& .MuiLinearProgress-bar":{borderRadius:4,backgroundColor:w[l%w.length]}}})]},t))})})}),e.jsx(h,{item:!0,xs:12,lg:4,children:e.jsx(_,{icon:q,title:`App Users · ${x.length}`,color:"primary",children:x.length===0?e.jsx(C,{title:"No team users"}):e.jsx(c,{divider:e.jsx(G,{}),spacing:0,children:x.slice(0,6).map(t=>e.jsxs(c,{direction:"row",spacing:1.5,alignItems:"center",sx:{py:1.25},children:[e.jsx(W,{name:t.name,size:36}),e.jsxs(d,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(i,{variant:"subtitle2",sx:{fontWeight:600},children:t.name}),e.jsx(i,{variant:"caption",color:"text.secondary",noWrap:!0,sx:{display:"block"},children:t.email})]}),e.jsx(P,{status:t.role})]},t.id))})})})]})]})}export{Re as default}; +import{r as D,j as e,i as R,S as c,B as d,T as i,a as u,t as T,C as U,d as V,U as W,b as q,D as G,f as z,c as J,e as K,g as Q}from"./index-J0uxx8As.js";import{d as X,E as C}from"./EmptyState-B2FWZCr6.js";import{S,d as Y,a as Z,b as ee,c as P}from"./StatusChip-DTSEpe4F.js";import{P as k,A as te,G as h}from"./PageHeader-TW1dMGrU.js";import{B as E}from"./Button-BkRsd5c4.js";import{T as re,a as se,b as ae,c as F,d as ne}from"./TableRow-DryS4Frn.js";import{T as o}from"./TableCell-dI-OU86K.js";import{L as ie}from"./LinearProgress-DAlys0Qw.js";import{C as le}from"./Link-DdF3Xu1F.js";var I={},oe=R;Object.defineProperty(I,"__esModule",{value:!0});var B=I.default=void 0,ce=oe(D()),de=e;B=I.default=(0,ce.default)((0,de.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.25 2.52.77-1.28-3.52-2.09V8z"}),"HistoryOutlined");var L={},xe=R;Object.defineProperty(L,"__esModule",{value:!0});var N=L.default=void 0,ue=xe(D()),he=e;N=L.default=(0,ue.default)((0,he.jsx)("path",{d:"M13 5.08c3.06.44 5.48 2.86 5.92 5.92h3.03c-.47-4.72-4.23-8.48-8.95-8.95zM18.92 13c-.44 3.06-2.86 5.48-5.92 5.92v3.03c4.72-.47 8.48-4.23 8.95-8.95zM11 18.92c-3.39-.49-6-3.4-6-6.92s2.61-6.43 6-6.92V2.05c-5.05.5-9 4.76-9 9.95 0 5.19 3.95 9.45 9 9.95z"}),"DonutLargeOutlined");var A={},me=R;Object.defineProperty(A,"__esModule",{value:!0});var H=A.default=void 0,ge=me(D()),je=e;H=A.default=(0,ge.default)((0,je.jsx)("path",{d:"m12 2-5.5 9h11zm0 3.84L13.93 9h-3.87zM17.5 13c-2.49 0-4.5 2.01-4.5 4.5s2.01 4.5 4.5 4.5 4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5m0 7c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5M3 21.5h8v-8H3zm2-6h4v4H5z"}),"CategoryOutlined");function pe({data:s=[],size:n=180,thickness:x=26,centerLabel:g,centerValue:y}){const j=s.reduce((a,b)=>a+b.value,0)||1,m=(n-x)/2,v=2*Math.PI*m;let f=0;return e.jsxs(c,{direction:{xs:"column",sm:"row"},spacing:3,alignItems:"center",justifyContent:"center",sx:{flexWrap:"wrap"},children:[e.jsxs(d,{sx:{position:"relative",width:n,maxWidth:"100%",aspectRatio:"1 / 1"},children:[e.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${n} ${n}`,children:e.jsxs("g",{transform:`rotate(-90 ${n/2} ${n/2})`,children:[e.jsx("circle",{cx:n/2,cy:n/2,r:m,fill:"none",stroke:"#F0F0F0",strokeWidth:x}),s.map((a,b)=>{const p=a.value/j*v,$=e.jsx("circle",{cx:n/2,cy:n/2,r:m,fill:"none",stroke:a.color,strokeWidth:x,strokeDasharray:`${p} ${v-p}`,strokeDashoffset:-f,strokeLinecap:"butt"},b);return f+=p,$})]})}),e.jsxs(d,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[e.jsx(i,{variant:"h3",sx:{fontWeight:700},children:y??j}),e.jsx(i,{variant:"caption",color:"text.secondary",children:g??"Total"})]})]}),e.jsx(c,{spacing:1.25,children:s.map(a=>e.jsxs(c,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(d,{sx:{width:10,height:10,borderRadius:"3px",bgcolor:a.color}}),e.jsx(i,{variant:"body2",color:"text.secondary",sx:{minWidth:80},children:a.label}),e.jsx(i,{variant:"subtitle2",children:a.value.toLocaleString("en-IN")})]},a.label))})]})}const fe={newclient:"#00A2AE",contacted:"#FFBF00",onboarded:"#00A854",lost:"#F04134"},be=s=>fe[String(s||"").toLowerCase()]||"#8C8C8C",w=["#C01227","#00A2AE","#00A854","#FFBF00","#9E0E20","#8C8C8C","#D6515C"];function _({icon:s,title:n,action:x,color:g="primary",noPadding:y=!1,children:j}){return e.jsxs(le,{sx:{height:"100%",display:"flex",flexDirection:"column",borderRadius:4,boxShadow:"0 10px 30px rgba(0,0,0,0.03)",border:"1px solid rgba(0,0,0,0.04)"},children:[e.jsxs(c,{direction:"row",spacing:1.5,alignItems:"center",sx:{px:3,py:2,borderBottom:1,borderColor:"divider",background:m=>`linear-gradient(90deg, ${m.palette[g].lighter}66 0%, transparent 100%)`},children:[e.jsx(d,{sx:{width:40,height:40,borderRadius:2,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${g}.lighter`,color:`${g}.main`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.05)"},children:e.jsx(s,{fontSize:"small"})}),e.jsx(i,{variant:"h6",sx:{fontWeight:700,color:"grey.800",flexGrow:1,letterSpacing:"-0.3px"},children:n}),x]}),e.jsx(d,{sx:{p:y?0:3,flexGrow:1},children:j})]})}function Re(){var O;const[s,n]=u.useState([]),[x,g]=u.useState([]),[y,j]=u.useState(!0),[m,v]=u.useState(null),f=()=>{j(!0),v(null),Promise.all([z(),J()]).then(([t,r])=>{n((t||[]).map(K)),g((r||[]).map(Q))}).catch(t=>v(t.message||"Failed to load dashboard data")).finally(()=>j(!1))};u.useEffect(()=>{f()},[]);const a=u.useMemo(()=>({total:s.length,newCount:s.filter(t=>t.status==="newClient").length,parcels:s.reduce((t,r)=>t+r.parcelVolume,0),contracts:s.reduce((t,r)=>t+r.activeContracts,0)}),[s]),b=u.useMemo(()=>{const t={};return s.forEach(r=>{t[r.status]=(t[r.status]||0)+1}),Object.entries(t).sort((r,l)=>l[1]-r[1]).map(([r,l])=>({label:T(r),value:l,color:be(r)}))},[s]),p=u.useMemo(()=>{const t={};return s.forEach(r=>{const l=r.businessType||"other";t[l]=(t[l]||0)+1}),Object.entries(t).sort((r,l)=>l[1]-r[1])},[s]),$=((O=p[0])==null?void 0:O[1])||1,M=u.useMemo(()=>[...s].sort((t,r)=>String(r.lastUpdated).localeCompare(String(t.lastUpdated))).slice(0,6),[s]);return new Date().toLocaleDateString("en-IN",{weekday:"long",day:"numeric",month:"long",year:"numeric"}),y?e.jsxs(e.Fragment,{children:[e.jsx(k,{title:"Dashboard",breadcrumbs:[{label:"Dashboard"}]}),e.jsx(d,{sx:{display:"flex",justifyContent:"center",py:12},children:e.jsx(U,{})})]}):e.jsxs(e.Fragment,{children:[e.jsx(k,{title:"Dashboard",breadcrumbs:[{label:"Dashboard"}],action:e.jsx(E,{variant:"outlined",startIcon:e.jsx(X,{}),onClick:f,children:"Refresh"})}),m&&e.jsx(te,{severity:"error",sx:{mb:2.5},action:e.jsx(E,{color:"inherit",size:"small",onClick:f,children:"Retry"}),children:m}),e.jsxs(h,{container:!0,spacing:3,children:[e.jsx(h,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(S,{accent:!0,title:"Total Clients",value:a.total,icon:V,color:"primary",caption:"All registered"})}),e.jsx(h,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(S,{accent:!0,title:"New Clients",value:a.newCount,icon:Y,color:"primary",caption:"Awaiting onboarding"})}),e.jsx(h,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(S,{accent:!0,title:"Total Parcel Volume",value:a.parcels.toLocaleString("en-IN"),icon:Z,color:"primary",caption:"Across all clients"})}),e.jsx(h,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(S,{accent:!0,title:"Active Contracts",value:a.contracts,icon:ee,color:"primary",caption:"Currently running"})}),e.jsx(h,{item:!0,xs:12,lg:8,children:e.jsx(_,{icon:B,title:"Recent Clients",color:"primary",noPadding:!0,children:M.length===0?e.jsx(C,{title:"No clients yet",caption:"Add a client to see it here."}):e.jsx(re,{children:e.jsxs(se,{sx:{minWidth:600},children:[e.jsx(ae,{children:e.jsxs(F,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(o,{children:"Client"}),e.jsx(o,{children:"Type"}),e.jsx(o,{children:"Location"}),e.jsx(o,{align:"right",children:"Parcels"}),e.jsx(o,{children:"Status"})]})}),e.jsx(ne,{children:M.map(t=>e.jsxs(F,{hover:!0,children:[e.jsx(o,{children:e.jsxs(c,{direction:"row",spacing:1.25,alignItems:"center",children:[e.jsx(W,{name:t.name,size:32}),e.jsx(i,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:t.name})]})}),e.jsx(o,{children:e.jsx(i,{variant:"body2",children:T(t.businessType)||"—"})}),e.jsx(o,{children:e.jsxs(i,{variant:"body2",children:[t.city||"—",t.businessState?`, ${t.businessState}`:""]})}),e.jsx(o,{align:"right",sx:{fontWeight:600},children:t.parcelVolume.toLocaleString("en-IN")}),e.jsx(o,{children:e.jsx(P,{status:t.status})})]},t.id))})]})})})}),e.jsx(h,{item:!0,xs:12,lg:4,children:e.jsx(_,{icon:N,title:"Clients by Status",color:"primary",children:e.jsx(d,{sx:{py:1.5},children:b.length===0?e.jsx(C,{title:"No data"}):e.jsx(pe,{data:b,centerValue:a.total,centerLabel:"Clients"})})})}),e.jsx(h,{item:!0,xs:12,lg:8,children:e.jsx(_,{icon:H,title:"Clients by Business Type",color:"primary",children:p.length===0?e.jsx(C,{title:"No data"}):e.jsx(c,{spacing:2.25,children:p.map(([t,r],l)=>e.jsxs(d,{children:[e.jsxs(c,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:.75},children:[e.jsxs(c,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(d,{sx:{width:10,height:10,borderRadius:"3px",bgcolor:w[l%w.length]}}),e.jsx(i,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:T(t)})]}),e.jsxs(i,{variant:"body2",color:"text.secondary",children:[r," · ",Math.round(r/s.length*100),"%"]})]}),e.jsx(ie,{variant:"determinate",value:r/$*100,sx:{height:8,borderRadius:4,bgcolor:"grey.100","& .MuiLinearProgress-bar":{borderRadius:4,backgroundColor:w[l%w.length]}}})]},t))})})}),e.jsx(h,{item:!0,xs:12,lg:4,children:e.jsx(_,{icon:q,title:`App Users · ${x.length}`,color:"primary",children:x.length===0?e.jsx(C,{title:"No team users"}):e.jsx(c,{divider:e.jsx(G,{}),spacing:0,children:x.slice(0,6).map(t=>e.jsxs(c,{direction:"row",spacing:1.5,alignItems:"center",sx:{py:1.25},children:[e.jsx(W,{name:t.name,size:36}),e.jsxs(d,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(i,{variant:"subtitle2",sx:{fontWeight:600},children:t.name}),e.jsx(i,{variant:"caption",color:"text.secondary",noWrap:!0,sx:{display:"block"},children:t.email})]}),e.jsx(P,{status:t.role})]},t.id))})})})]})]})}export{Re as default}; diff --git a/dist/assets/EditOutlined-COfONJBH.js b/dist/assets/EditOutlined-CLycK5tS.js similarity index 99% rename from dist/assets/EditOutlined-COfONJBH.js rename to dist/assets/EditOutlined-CLycK5tS.js index 0f8f8e0..d4cb0f7 100644 --- a/dist/assets/EditOutlined-COfONJBH.js +++ b/dist/assets/EditOutlined-CLycK5tS.js @@ -1 +1 @@ -import{l as v,m as h,a as d,n as b,a2 as Z,P as N,a9 as oo,o as D,_ as i,u as eo,j as n,p as x,q as m,v as C,w as u,aa as ao,ab as to,T as io,r as U,i as I}from"./index-Dg-wT72v.js";function so(o){return v("MuiDialog",o)}const R=h("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),F=d.createContext({}),ro=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],lo=u(to,{name:"MuiDialog",slot:"Backdrop",overrides:(o,e)=>e.backdrop})({zIndex:-1}),no=o=>{const{classes:e,scroll:a,maxWidth:t,fullWidth:r,fullScreen:s}=o,c={root:["root"],container:["container",`scroll${m(a)}`],paper:["paper",`paperScroll${m(a)}`,`paperWidth${m(String(t))}`,r&&"paperFullWidth",s&&"paperFullScreen"]};return C(c,so,e)},co=u(ao,{name:"MuiDialog",slot:"Root",overridesResolver:(o,e)=>e.root})({"@media print":{position:"absolute !important"}}),po=u("div",{name:"MuiDialog",slot:"Container",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.container,e[`scroll${m(a.scroll)}`]]}})(({ownerState:o})=>i({height:"100%","@media print":{height:"auto"},outline:0},o.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},o.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),uo=u(N,{name:"MuiDialog",slot:"Paper",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.paper,e[`scrollPaper${m(a.scroll)}`],e[`paperWidth${m(String(a.maxWidth))}`],a.fullWidth&&e.paperFullWidth,a.fullScreen&&e.paperFullScreen]}})(({theme:o,ownerState:e})=>i({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:o.breakpoints.unit==="px"?Math.max(o.breakpoints.values.xs,444):`max(${o.breakpoints.values.xs}${o.breakpoints.unit}, 444px)`,[`&.${R.paperScrollBody}`]:{[o.breakpoints.down(Math.max(o.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${o.breakpoints.values[e.maxWidth]}${o.breakpoints.unit}`,[`&.${R.paperScrollBody}`]:{[o.breakpoints.down(o.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${R.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),Ao=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialog"}),r=Z(),s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":c,"aria-labelledby":l,BackdropComponent:p,BackdropProps:k,children:L,className:E,disableEscapeKeyDown:T=!1,fullScreen:q=!1,fullWidth:z=!1,maxWidth:O="sm",onBackdropClick:j,onClick:w,onClose:y,open:_,PaperComponent:H=N,PaperProps:B={},scroll:Y="paper",TransitionComponent:V=oo,transitionDuration:A=s,TransitionProps:X}=t,K=D(t,ro),f=i({},t,{disableEscapeKeyDown:T,fullScreen:q,fullWidth:z,maxWidth:O,scroll:Y}),W=no(f),M=d.useRef(),G=g=>{M.current=g.target===g.currentTarget},J=g=>{w&&w(g),M.current&&(M.current=null,j&&j(g),y&&y(g,"backdropClick"))},S=eo(l),Q=d.useMemo(()=>({titleId:S}),[S]);return n.jsx(co,i({className:x(W.root,E),closeAfterTransition:!0,components:{Backdrop:lo},componentsProps:{backdrop:i({transitionDuration:A,as:p},k)},disableEscapeKeyDown:T,onClose:y,open:_,ref:a,onClick:J,ownerState:f},K,{children:n.jsx(V,i({appear:!0,in:_,timeout:A,role:"presentation"},X,{children:n.jsx(po,{className:x(W.container),onMouseDown:G,ownerState:f,children:n.jsx(uo,i({as:H,elevation:24,role:"dialog","aria-describedby":c,"aria-labelledby":S},B,{className:x(W.paper,B.className),ownerState:f,children:n.jsx(F.Provider,{value:Q,children:L})}))})}))}))});function go(o){return v("MuiDialogActions",o)}h("MuiDialogActions",["root","spacing"]);const xo=["className","disableSpacing"],mo=o=>{const{classes:e,disableSpacing:a}=o;return C({root:["root",!a&&"spacing"]},go,e)},fo=u("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.root,!a.disableSpacing&&e.spacing]}})(({ownerState:o})=>i({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!o.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),No=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialogActions"}),{className:r,disableSpacing:s=!1}=t,c=D(t,xo),l=i({},t,{disableSpacing:s}),p=mo(l);return n.jsx(fo,i({className:x(p.root,r),ownerState:l,ref:a},c))});function vo(o){return v("MuiDialogContent",o)}h("MuiDialogContent",["root","dividers"]);function ho(o){return v("MuiDialogTitle",o)}const bo=h("MuiDialogTitle",["root"]),Do=["className","dividers"],Co=o=>{const{classes:e,dividers:a}=o;return C({root:["root",a&&"dividers"]},vo,e)},ko=u("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.root,a.dividers&&e.dividers]}})(({theme:o,ownerState:e})=>i({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(o.vars||o).palette.divider}`,borderBottom:`1px solid ${(o.vars||o).palette.divider}`}:{[`.${bo.root} + &`]:{paddingTop:0}})),Uo=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialogContent"}),{className:r,dividers:s=!1}=t,c=D(t,Do),l=i({},t,{dividers:s}),p=Co(l);return n.jsx(ko,i({className:x(p.root,r),ownerState:l,ref:a},c))}),yo=["className","id"],Wo=o=>{const{classes:e}=o;return C({root:["root"]},ho,e)},Mo=u(io,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(o,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),Io=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialogTitle"}),{className:r,id:s}=t,c=D(t,yo),l=t,p=Wo(l),{titleId:k=s}=d.useContext(F);return n.jsx(Mo,i({component:"h2",className:x(p.root,r),ownerState:l,ref:a,variant:"h6",id:s??k},c))});var $={},So=I;Object.defineProperty($,"__esModule",{value:!0});var Ro=$.default=void 0,$o=So(U()),Po=n;Ro=$.default=(0,$o.default)((0,Po.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var P={},To=I;Object.defineProperty(P,"__esModule",{value:!0});var jo=P.default=void 0,wo=To(U()),_o=n;jo=P.default=(0,wo.default)((0,_o.jsx)("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"}),"EditOutlined");export{Ao as D,Io as a,Uo as b,No as c,Ro as d,jo as e}; +import{l as v,m as h,a as d,n as b,a2 as Z,P as N,a9 as oo,o as D,_ as i,u as eo,j as n,p as x,q as m,v as C,w as u,aa as ao,ab as to,T as io,r as U,i as I}from"./index-J0uxx8As.js";function so(o){return v("MuiDialog",o)}const R=h("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),F=d.createContext({}),ro=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],lo=u(to,{name:"MuiDialog",slot:"Backdrop",overrides:(o,e)=>e.backdrop})({zIndex:-1}),no=o=>{const{classes:e,scroll:a,maxWidth:t,fullWidth:r,fullScreen:s}=o,c={root:["root"],container:["container",`scroll${m(a)}`],paper:["paper",`paperScroll${m(a)}`,`paperWidth${m(String(t))}`,r&&"paperFullWidth",s&&"paperFullScreen"]};return C(c,so,e)},co=u(ao,{name:"MuiDialog",slot:"Root",overridesResolver:(o,e)=>e.root})({"@media print":{position:"absolute !important"}}),po=u("div",{name:"MuiDialog",slot:"Container",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.container,e[`scroll${m(a.scroll)}`]]}})(({ownerState:o})=>i({height:"100%","@media print":{height:"auto"},outline:0},o.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},o.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),uo=u(N,{name:"MuiDialog",slot:"Paper",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.paper,e[`scrollPaper${m(a.scroll)}`],e[`paperWidth${m(String(a.maxWidth))}`],a.fullWidth&&e.paperFullWidth,a.fullScreen&&e.paperFullScreen]}})(({theme:o,ownerState:e})=>i({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:o.breakpoints.unit==="px"?Math.max(o.breakpoints.values.xs,444):`max(${o.breakpoints.values.xs}${o.breakpoints.unit}, 444px)`,[`&.${R.paperScrollBody}`]:{[o.breakpoints.down(Math.max(o.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${o.breakpoints.values[e.maxWidth]}${o.breakpoints.unit}`,[`&.${R.paperScrollBody}`]:{[o.breakpoints.down(o.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${R.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),Ao=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialog"}),r=Z(),s={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":c,"aria-labelledby":l,BackdropComponent:p,BackdropProps:k,children:L,className:E,disableEscapeKeyDown:T=!1,fullScreen:q=!1,fullWidth:z=!1,maxWidth:O="sm",onBackdropClick:j,onClick:w,onClose:y,open:_,PaperComponent:H=N,PaperProps:B={},scroll:Y="paper",TransitionComponent:V=oo,transitionDuration:A=s,TransitionProps:X}=t,K=D(t,ro),f=i({},t,{disableEscapeKeyDown:T,fullScreen:q,fullWidth:z,maxWidth:O,scroll:Y}),W=no(f),M=d.useRef(),G=g=>{M.current=g.target===g.currentTarget},J=g=>{w&&w(g),M.current&&(M.current=null,j&&j(g),y&&y(g,"backdropClick"))},S=eo(l),Q=d.useMemo(()=>({titleId:S}),[S]);return n.jsx(co,i({className:x(W.root,E),closeAfterTransition:!0,components:{Backdrop:lo},componentsProps:{backdrop:i({transitionDuration:A,as:p},k)},disableEscapeKeyDown:T,onClose:y,open:_,ref:a,onClick:J,ownerState:f},K,{children:n.jsx(V,i({appear:!0,in:_,timeout:A,role:"presentation"},X,{children:n.jsx(po,{className:x(W.container),onMouseDown:G,ownerState:f,children:n.jsx(uo,i({as:H,elevation:24,role:"dialog","aria-describedby":c,"aria-labelledby":S},B,{className:x(W.paper,B.className),ownerState:f,children:n.jsx(F.Provider,{value:Q,children:L})}))})}))}))});function go(o){return v("MuiDialogActions",o)}h("MuiDialogActions",["root","spacing"]);const xo=["className","disableSpacing"],mo=o=>{const{classes:e,disableSpacing:a}=o;return C({root:["root",!a&&"spacing"]},go,e)},fo=u("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.root,!a.disableSpacing&&e.spacing]}})(({ownerState:o})=>i({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!o.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),No=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialogActions"}),{className:r,disableSpacing:s=!1}=t,c=D(t,xo),l=i({},t,{disableSpacing:s}),p=mo(l);return n.jsx(fo,i({className:x(p.root,r),ownerState:l,ref:a},c))});function vo(o){return v("MuiDialogContent",o)}h("MuiDialogContent",["root","dividers"]);function ho(o){return v("MuiDialogTitle",o)}const bo=h("MuiDialogTitle",["root"]),Do=["className","dividers"],Co=o=>{const{classes:e,dividers:a}=o;return C({root:["root",a&&"dividers"]},vo,e)},ko=u("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.root,a.dividers&&e.dividers]}})(({theme:o,ownerState:e})=>i({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(o.vars||o).palette.divider}`,borderBottom:`1px solid ${(o.vars||o).palette.divider}`}:{[`.${bo.root} + &`]:{paddingTop:0}})),Uo=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialogContent"}),{className:r,dividers:s=!1}=t,c=D(t,Do),l=i({},t,{dividers:s}),p=Co(l);return n.jsx(ko,i({className:x(p.root,r),ownerState:l,ref:a},c))}),yo=["className","id"],Wo=o=>{const{classes:e}=o;return C({root:["root"]},ho,e)},Mo=u(io,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(o,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),Io=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialogTitle"}),{className:r,id:s}=t,c=D(t,yo),l=t,p=Wo(l),{titleId:k=s}=d.useContext(F);return n.jsx(Mo,i({component:"h2",className:x(p.root,r),ownerState:l,ref:a,variant:"h6",id:s??k},c))});var $={},So=I;Object.defineProperty($,"__esModule",{value:!0});var Ro=$.default=void 0,$o=So(U()),Po=n;Ro=$.default=(0,$o.default)((0,Po.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var P={},To=I;Object.defineProperty(P,"__esModule",{value:!0});var jo=P.default=void 0,wo=To(U()),_o=n;jo=P.default=(0,wo.default)((0,_o.jsx)("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"}),"EditOutlined");export{Ao as D,Io as a,Uo as b,No as c,Ro as d,jo as e}; diff --git a/dist/assets/EmptyState-Do4nLXP0.js b/dist/assets/EmptyState-B2FWZCr6.js similarity index 94% rename from dist/assets/EmptyState-Do4nLXP0.js rename to dist/assets/EmptyState-B2FWZCr6.js index 1bcf1a1..82fa1a8 100644 --- a/dist/assets/EmptyState-Do4nLXP0.js +++ b/dist/assets/EmptyState-B2FWZCr6.js @@ -1 +1 @@ -import{r as n,j as e,i,B as o,T as s}from"./index-Dg-wT72v.js";var r={},x=i;Object.defineProperty(r,"__esModule",{value:!0});var f=r.default=void 0,v=x(n()),h=e;f=r.default=(0,v.default)((0,h.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");var t={},p=i;Object.defineProperty(t,"__esModule",{value:!0});var c=t.default=void 0,j=p(n()),y=e;c=t.default=(0,j.default)((0,y.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5v-3h3.56c.69 1.19 1.97 2 3.45 2s2.75-.81 3.45-2H19zm0-5h-4.99c0 1.1-.9 2-2 2s-2-.9-2-2H5V5h14z"}),"InboxOutlined");function m({icon:d=c,title:u="No records found",caption:a,sx:l}){return e.jsxs(o,{sx:{textAlign:"center",py:6,px:2,...l},children:[e.jsx(o,{sx:{width:72,height:72,borderRadius:"50%",bgcolor:"grey.100",display:"inline-flex",alignItems:"center",justifyContent:"center",mb:2},children:e.jsx(d,{sx:{fontSize:34,color:"grey.400"}})}),e.jsx(s,{variant:"h5",color:"text.secondary",children:u}),a&&e.jsx(s,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:a})]})}export{m as E,f as d}; +import{r as n,j as e,i,B as o,T as s}from"./index-J0uxx8As.js";var r={},x=i;Object.defineProperty(r,"__esModule",{value:!0});var f=r.default=void 0,v=x(n()),h=e;f=r.default=(0,v.default)((0,h.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");var t={},p=i;Object.defineProperty(t,"__esModule",{value:!0});var c=t.default=void 0,j=p(n()),y=e;c=t.default=(0,j.default)((0,y.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5v-3h3.56c.69 1.19 1.97 2 3.45 2s2.75-.81 3.45-2H19zm0-5h-4.99c0 1.1-.9 2-2 2s-2-.9-2-2H5V5h14z"}),"InboxOutlined");function m({icon:d=c,title:u="No records found",caption:a,sx:l}){return e.jsxs(o,{sx:{textAlign:"center",py:6,px:2,...l},children:[e.jsx(o,{sx:{width:72,height:72,borderRadius:"50%",bgcolor:"grey.100",display:"inline-flex",alignItems:"center",justifyContent:"center",mb:2},children:e.jsx(d,{sx:{fontSize:34,color:"grey.400"}})}),e.jsx(s,{variant:"h5",color:"text.secondary",children:u}),a&&e.jsx(s,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:a})]})}export{m as E,f as d}; diff --git a/dist/assets/Error404-Bm5B4e4s.js b/dist/assets/Error404-BKSqGNFt.js similarity index 79% rename from dist/assets/Error404-Bm5B4e4s.js rename to dist/assets/Error404-BKSqGNFt.js index 161e57b..083a414 100644 --- a/dist/assets/Error404-Bm5B4e4s.js +++ b/dist/assets/Error404-BKSqGNFt.js @@ -1 +1 @@ -import{as as o,j as e,B as t,S as i,T as r}from"./index-Dg-wT72v.js";import{d as n}from"./HomeOutlined-CTxH7VVL.js";import{B as s}from"./Button-COL1_fTB.js";function c(){const a=o();return e.jsx(t,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:e.jsxs(i,{spacing:2,alignItems:"center",children:[e.jsx(r,{sx:{fontWeight:900,fontSize:{xs:"6rem",md:"9rem"},lineHeight:1,color:"primary.main"},children:"404"}),e.jsx(t,{sx:{width:64,height:4,borderRadius:2,bgcolor:"primary.main"}}),e.jsx(r,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:"Page Not Found"}),e.jsx(r,{variant:"body1",color:"text.secondary",sx:{maxWidth:460},children:"The page you are looking for was moved, removed, renamed, or might never exist!"}),e.jsx(s,{variant:"contained",size:"large",startIcon:e.jsx(n,{}),onClick:()=>a("/dashboard"),sx:{mt:1},children:"Back To Home"})]})})}export{c as default}; +import{as as o,j as e,B as t,S as i,T as r}from"./index-J0uxx8As.js";import{d as n}from"./HomeOutlined-B9pi5FD_.js";import{B as s}from"./Button-BkRsd5c4.js";function c(){const a=o();return e.jsx(t,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:e.jsxs(i,{spacing:2,alignItems:"center",children:[e.jsx(r,{sx:{fontWeight:900,fontSize:{xs:"6rem",md:"9rem"},lineHeight:1,color:"primary.main"},children:"404"}),e.jsx(t,{sx:{width:64,height:4,borderRadius:2,bgcolor:"primary.main"}}),e.jsx(r,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:"Page Not Found"}),e.jsx(r,{variant:"body1",color:"text.secondary",sx:{maxWidth:460},children:"The page you are looking for was moved, removed, renamed, or might never exist!"}),e.jsx(s,{variant:"contained",size:"large",startIcon:e.jsx(n,{}),onClick:()=>a("/dashboard"),sx:{mt:1},children:"Back To Home"})]})})}export{c as default}; diff --git a/dist/assets/Error500-Cot1QOxV.js b/dist/assets/Error500-CiU1ecHp.js similarity index 79% rename from dist/assets/Error500-Cot1QOxV.js rename to dist/assets/Error500-CiU1ecHp.js index cec015b..ebd865b 100644 --- a/dist/assets/Error500-Cot1QOxV.js +++ b/dist/assets/Error500-CiU1ecHp.js @@ -1 +1 @@ -import{as as i,j as r,B as t,S as n,T as e}from"./index-Dg-wT72v.js";import{d as s}from"./HomeOutlined-CTxH7VVL.js";import{B as o}from"./Button-COL1_fTB.js";function m(){const a=i();return r.jsx(t,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:r.jsxs(n,{spacing:2,alignItems:"center",children:[r.jsx(e,{sx:{fontWeight:900,fontSize:{xs:"6rem",md:"9rem"},lineHeight:1,color:"primary.main"},children:"500"}),r.jsx(t,{sx:{width:64,height:4,borderRadius:2,bgcolor:"primary.main"}}),r.jsx(e,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:"Internal Server Error"}),r.jsx(e,{variant:"body1",color:"text.secondary",sx:{maxWidth:460},children:"Server error 500. We are fixing the problem. Please try again at a later stage."}),r.jsx(o,{variant:"contained",size:"large",startIcon:r.jsx(s,{}),onClick:()=>a("/dashboard"),sx:{mt:1},children:"Back To Home"})]})})}export{m as default}; +import{as as i,j as r,B as t,S as n,T as e}from"./index-J0uxx8As.js";import{d as s}from"./HomeOutlined-B9pi5FD_.js";import{B as o}from"./Button-BkRsd5c4.js";function m(){const a=i();return r.jsx(t,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:r.jsxs(n,{spacing:2,alignItems:"center",children:[r.jsx(e,{sx:{fontWeight:900,fontSize:{xs:"6rem",md:"9rem"},lineHeight:1,color:"primary.main"},children:"500"}),r.jsx(t,{sx:{width:64,height:4,borderRadius:2,bgcolor:"primary.main"}}),r.jsx(e,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:"Internal Server Error"}),r.jsx(e,{variant:"body1",color:"text.secondary",sx:{maxWidth:460},children:"Server error 500. We are fixing the problem. Please try again at a later stage."}),r.jsx(o,{variant:"contained",size:"large",startIcon:r.jsx(s,{}),onClick:()=>a("/dashboard"),sx:{mt:1},children:"Back To Home"})]})})}export{m as default}; diff --git a/dist/assets/HomeOutlined-CTxH7VVL.js b/dist/assets/HomeOutlined-B9pi5FD_.js similarity index 78% rename from dist/assets/HomeOutlined-CTxH7VVL.js rename to dist/assets/HomeOutlined-B9pi5FD_.js index 03119ec..44f2213 100644 --- a/dist/assets/HomeOutlined-CTxH7VVL.js +++ b/dist/assets/HomeOutlined-B9pi5FD_.js @@ -1 +1 @@ -import{r,j as t,i as a}from"./index-Dg-wT72v.js";var e={},u=a;Object.defineProperty(e,"__esModule",{value:!0});var v=e.default=void 0,o=u(r()),i=t;v=e.default=(0,o.default)((0,i.jsx)("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"}),"HomeOutlined");export{v as d}; +import{r,j as t,i as a}from"./index-J0uxx8As.js";var e={},u=a;Object.defineProperty(e,"__esModule",{value:!0});var v=e.default=void 0,o=u(r()),i=t;v=e.default=(0,o.default)((0,i.jsx)("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"}),"HomeOutlined");export{v as d}; diff --git a/dist/assets/InputAdornment-HqPFSHfS.js b/dist/assets/InputAdornment-Cbcw8oJa.js similarity index 96% rename from dist/assets/InputAdornment-HqPFSHfS.js rename to dist/assets/InputAdornment-Cbcw8oJa.js index 965e860..b320371 100644 --- a/dist/assets/InputAdornment-HqPFSHfS.js +++ b/dist/assets/InputAdornment-Cbcw8oJa.js @@ -1 +1 @@ -import{l as y,m as C,a as b,n as I,o as A,aq as j,_ as c,j as a,av as L,p as z,T as R,q as m,v as T,w as _}from"./index-Dg-wT72v.js";function $(n){return y("MuiInputAdornment",n)}const x=C("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var f;const F=["children","className","component","disablePointerEvents","disableTypography","position","variant"],M=(n,t)=>{const{ownerState:e}=n;return[t.root,t[`position${m(e.position)}`],e.disablePointerEvents===!0&&t.disablePointerEvents,t[e.variant]]},N=n=>{const{classes:t,disablePointerEvents:e,hiddenLabel:o,position:s,size:r,variant:l}=n,d={root:["root",e&&"disablePointerEvents",s&&`position${m(s)}`,l,o&&"hiddenLabel",r&&`size${m(r)}`]};return T(d,$,t)},U=_("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:M})(({theme:n,ownerState:t})=>c({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(n.vars||n).palette.action.active},t.variant==="filled"&&{[`&.${x.positionStart}&:not(.${x.hiddenLabel})`]:{marginTop:16}},t.position==="start"&&{marginRight:8},t.position==="end"&&{marginLeft:8},t.disablePointerEvents===!0&&{pointerEvents:"none"})),S=b.forwardRef(function(t,e){const o=I({props:t,name:"MuiInputAdornment"}),{children:s,className:r,component:l="div",disablePointerEvents:d=!1,disableTypography:g=!1,position:u,variant:v}=o,E=A(o,F),i=j()||{};let p=v;v&&i.variant,i&&!p&&(p=i.variant);const h=c({},o,{hiddenLabel:i.hiddenLabel,size:i.size,disablePointerEvents:d,position:u,variant:p}),P=N(h);return a.jsx(L.Provider,{value:null,children:a.jsx(U,c({as:l,ownerState:h,className:z(P.root,r),ref:e},E,{children:typeof s=="string"&&!g?a.jsx(R,{color:"text.secondary",children:s}):a.jsxs(b.Fragment,{children:[u==="start"?f||(f=a.jsx("span",{className:"notranslate",children:"​"})):null,s]})}))})});export{S as I}; +import{l as y,m as C,a as b,n as I,o as A,aq as j,_ as c,j as a,av as L,p as z,T as R,q as m,v as T,w as _}from"./index-J0uxx8As.js";function $(n){return y("MuiInputAdornment",n)}const x=C("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var f;const F=["children","className","component","disablePointerEvents","disableTypography","position","variant"],M=(n,t)=>{const{ownerState:e}=n;return[t.root,t[`position${m(e.position)}`],e.disablePointerEvents===!0&&t.disablePointerEvents,t[e.variant]]},N=n=>{const{classes:t,disablePointerEvents:e,hiddenLabel:o,position:s,size:r,variant:l}=n,d={root:["root",e&&"disablePointerEvents",s&&`position${m(s)}`,l,o&&"hiddenLabel",r&&`size${m(r)}`]};return T(d,$,t)},U=_("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:M})(({theme:n,ownerState:t})=>c({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(n.vars||n).palette.action.active},t.variant==="filled"&&{[`&.${x.positionStart}&:not(.${x.hiddenLabel})`]:{marginTop:16}},t.position==="start"&&{marginRight:8},t.position==="end"&&{marginLeft:8},t.disablePointerEvents===!0&&{pointerEvents:"none"})),S=b.forwardRef(function(t,e){const o=I({props:t,name:"MuiInputAdornment"}),{children:s,className:r,component:l="div",disablePointerEvents:d=!1,disableTypography:g=!1,position:u,variant:v}=o,E=A(o,F),i=j()||{};let p=v;v&&i.variant,i&&!p&&(p=i.variant);const h=c({},o,{hiddenLabel:i.hiddenLabel,size:i.size,disablePointerEvents:d,position:u,variant:p}),P=N(h);return a.jsx(L.Provider,{value:null,children:a.jsx(U,c({as:l,ownerState:h,className:z(P.root,r),ref:e},E,{children:typeof s=="string"&&!g?a.jsx(R,{color:"text.secondary",children:s}):a.jsxs(b.Fragment,{children:[u==="start"?f||(f=a.jsx("span",{className:"notranslate",children:"​"})):null,s]})}))})});export{S as I}; diff --git a/dist/assets/LinearProgress-BvM3Q63G.js b/dist/assets/LinearProgress-DAlys0Qw.js similarity index 98% rename from dist/assets/LinearProgress-BvM3Q63G.js rename to dist/assets/LinearProgress-DAlys0Qw.js index be5e594..fd57177 100644 --- a/dist/assets/LinearProgress-BvM3Q63G.js +++ b/dist/assets/LinearProgress-DAlys0Qw.js @@ -1,4 +1,4 @@ -import{l as q,m as N,a as M,n as D,o as z,_ as s,a0 as U,j as b,p as O,q as t,v as T,w as m,aj as h,ac as A,ad as K,ak as C}from"./index-Dg-wT72v.js";function E(r){return q("MuiLinearProgress",r)}N("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const X=["className","color","value","valueBuffer","variant"];let l=r=>r,$,k,L,_,B,I;const v=4,W=C($||($=l` +import{l as q,m as N,a as M,n as D,o as z,_ as s,a0 as U,j as b,p as O,q as t,v as T,w as m,aj as h,ac as A,ad as K,ak as C}from"./index-J0uxx8As.js";function E(r){return q("MuiLinearProgress",r)}N("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const X=["className","color","value","valueBuffer","variant"];let l=r=>r,$,k,L,_,B,I;const v=4,W=C($||($=l` 0% { left: -35%; right: 100%; diff --git a/dist/assets/Link-CndAQvyC.js b/dist/assets/Link-DdF3Xu1F.js similarity index 97% rename from dist/assets/Link-CndAQvyC.js rename to dist/assets/Link-DdF3Xu1F.js index 3c83bb8..a154eed 100644 --- a/dist/assets/Link-CndAQvyC.js +++ b/dist/assets/Link-DdF3Xu1F.js @@ -1 +1 @@ -import{l as x,m as h,a as p,n as g,o as v,_ as a,j as k,p as R,v as V,w as F,P as z,aw as b,A as W,ax as E,y as H,q as L,T as q}from"./index-Dg-wT72v.js";function I(e){return x("MuiCard",e)}h("MuiCard",["root"]);const O=["className","raised"],S=e=>{const{classes:o}=e;return V({root:["root"]},I,o)},G=F(z,{name:"MuiCard",slot:"Root",overridesResolver:(e,o)=>o.root})(()=>({overflow:"hidden"})),so=p.forwardRef(function(o,s){const n=g({props:o,name:"MuiCard"}),{className:t,raised:r=!1}=n,c=v(n,O),i=a({},n,{raised:r}),u=S(i);return k.jsx(G,a({className:R(u.root,t),elevation:r?8:void 0,ref:s,ownerState:i},c))});function J(e){return x("MuiLink",e)}const K=h("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),D={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Q=e=>D[e]||e,X=({theme:e,ownerState:o})=>{const s=Q(o.color),n=b(e,`palette.${s}`,!1)||o.color,t=b(e,`palette.${s}Channel`);return"vars"in e&&t?`rgba(${t} / 0.4)`:W(n,.4)},Y=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],Z=e=>{const{classes:o,component:s,focusVisible:n,underline:t}=e,r={root:["root",`underline${L(t)}`,s==="button"&&"button",n&&"focusVisible"]};return V(r,J,o)},oo=F(q,{name:"MuiLink",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,o[`underline${L(s.underline)}`],s.component==="button"&&o.button]}})(({theme:e,ownerState:o})=>a({},o.underline==="none"&&{textDecoration:"none"},o.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},o.underline==="always"&&a({textDecoration:"underline"},o.color!=="inherit"&&{textDecorationColor:X({theme:e,ownerState:o})},{"&:hover":{textDecorationColor:"inherit"}}),o.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${K.focusVisible}`]:{outline:"auto"}})),no=p.forwardRef(function(o,s){const n=g({props:o,name:"MuiLink"}),{className:t,color:r="primary",component:c="a",onBlur:i,onFocus:u,TypographyClasses:M,underline:$="always",variant:f="inherit",sx:d}=n,A=v(n,Y),{isFocusVisibleRef:m,onBlur:N,onFocus:T,ref:j}=E(),[B,y]=p.useState(!1),P=H(s,j),U=l=>{N(l),m.current===!1&&y(!1),i&&i(l)},_=l=>{T(l),m.current===!0&&y(!0),u&&u(l)},C=a({},n,{color:r,component:c,focusVisible:B,underline:$,variant:f}),w=Z(C);return k.jsx(oo,a({color:r,className:R(w.root,t),classes:M,component:c,onBlur:U,onFocus:_,ref:P,ownerState:C,variant:f,sx:[...Object.keys(D).includes(r)?[]:[{color:r}],...Array.isArray(d)?d:[d]]},A))});export{so as C,no as L}; +import{l as x,m as h,a as p,n as g,o as v,_ as a,j as k,p as R,v as V,w as F,P as z,aw as b,A as W,ax as E,y as H,q as L,T as q}from"./index-J0uxx8As.js";function I(e){return x("MuiCard",e)}h("MuiCard",["root"]);const O=["className","raised"],S=e=>{const{classes:o}=e;return V({root:["root"]},I,o)},G=F(z,{name:"MuiCard",slot:"Root",overridesResolver:(e,o)=>o.root})(()=>({overflow:"hidden"})),so=p.forwardRef(function(o,s){const n=g({props:o,name:"MuiCard"}),{className:t,raised:r=!1}=n,c=v(n,O),i=a({},n,{raised:r}),u=S(i);return k.jsx(G,a({className:R(u.root,t),elevation:r?8:void 0,ref:s,ownerState:i},c))});function J(e){return x("MuiLink",e)}const K=h("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),D={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Q=e=>D[e]||e,X=({theme:e,ownerState:o})=>{const s=Q(o.color),n=b(e,`palette.${s}`,!1)||o.color,t=b(e,`palette.${s}Channel`);return"vars"in e&&t?`rgba(${t} / 0.4)`:W(n,.4)},Y=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],Z=e=>{const{classes:o,component:s,focusVisible:n,underline:t}=e,r={root:["root",`underline${L(t)}`,s==="button"&&"button",n&&"focusVisible"]};return V(r,J,o)},oo=F(q,{name:"MuiLink",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,o[`underline${L(s.underline)}`],s.component==="button"&&o.button]}})(({theme:e,ownerState:o})=>a({},o.underline==="none"&&{textDecoration:"none"},o.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},o.underline==="always"&&a({textDecoration:"underline"},o.color!=="inherit"&&{textDecorationColor:X({theme:e,ownerState:o})},{"&:hover":{textDecorationColor:"inherit"}}),o.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${K.focusVisible}`]:{outline:"auto"}})),no=p.forwardRef(function(o,s){const n=g({props:o,name:"MuiLink"}),{className:t,color:r="primary",component:c="a",onBlur:i,onFocus:u,TypographyClasses:M,underline:$="always",variant:f="inherit",sx:d}=n,A=v(n,Y),{isFocusVisibleRef:m,onBlur:N,onFocus:T,ref:j}=E(),[B,y]=p.useState(!1),P=H(s,j),U=l=>{N(l),m.current===!1&&y(!1),i&&i(l)},_=l=>{T(l),m.current===!0&&y(!0),u&&u(l)},C=a({},n,{color:r,component:c,focusVisible:B,underline:$,variant:f}),w=Z(C);return k.jsx(oo,a({color:r,className:R(w.root,t),classes:M,component:c,onBlur:U,onFocus:_,ref:P,ownerState:C,variant:f,sx:[...Object.keys(D).includes(r)?[]:[{color:r}],...Array.isArray(d)?d:[d]]},A))});export{so as C,no as L}; diff --git a/dist/assets/Login-lPugph-B.js b/dist/assets/Login-SNBlIs0y.js similarity index 96% rename from dist/assets/Login-lPugph-B.js rename to dist/assets/Login-SNBlIs0y.js index 7c51685..7bebe1d 100644 --- a/dist/assets/Login-lPugph-B.js +++ b/dist/assets/Login-SNBlIs0y.js @@ -1 +1 @@ -import{a5 as B,j as o,l as D,m as E,a as u,n as N,o as q,_ as m,p as F,q as v,v as T,w as W,a4 as O,A as U,aq as V,ar as K,T as p,S as M,as as J,B as y,at as Y,I as G,au as Q}from"./index-Dg-wT72v.js";import{S as X,d as Z,a as ee}from"./VisibilityOff-D6_289tJ.js";import{C as oe,L as re}from"./Link-CndAQvyC.js";import{T as A}from"./TextField-COVOKpzm.js";import{I as te}from"./InputAdornment-HqPFSHfS.js";import{B as ae}from"./Button-COL1_fTB.js";const se=B(o.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),ne=B(o.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),le=B(o.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function ie(e){return D("MuiCheckbox",e)}const R=E("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),ce=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],de=e=>{const{classes:r,indeterminate:t,color:n,size:l}=e,a={root:["root",t&&"indeterminate",`color${v(n)}`,`size${v(l)}`]},c=T(a,ie,r);return m({},r,c)},pe=W(X,{shouldForwardProp:e=>O(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.indeterminate&&r.indeterminate,r[`size${v(t.size)}`],t.color!=="default"&&r[`color${v(t.color)}`]]}})(({theme:e,ownerState:r})=>m({color:(e.vars||e).palette.text.secondary},!r.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${r.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[r.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:U(r.color==="default"?e.palette.action.active:e.palette[r.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},r.color!=="default"&&{[`&.${R.checked}, &.${R.indeterminate}`]:{color:(e.vars||e).palette[r.color].main},[`&.${R.disabled}`]:{color:(e.vars||e).palette.action.disabled}})),ue=o.jsx(ne,{}),me=o.jsx(se,{}),be=o.jsx(le,{}),xe=u.forwardRef(function(r,t){var n,l;const a=N({props:r,name:"MuiCheckbox"}),{checkedIcon:c=ue,color:x="primary",icon:d=me,indeterminate:i=!1,indeterminateIcon:b=be,inputProps:s,size:C="medium",className:I}=a,z=q(a,ce),P=i?b:d,h=i?b:c,k=m({},a,{color:x,indeterminate:i,size:C}),g=de(k);return o.jsx(pe,m({type:"checkbox",inputProps:m({"data-indeterminate":i},s),icon:u.cloneElement(P,{fontSize:(n=P.props.fontSize)!=null?n:C}),checkedIcon:u.cloneElement(h,{fontSize:(l=h.props.fontSize)!=null?l:C}),ownerState:k,ref:t,className:F(g.root,I)},z,{classes:g}))});function he(e){return D("MuiFormControlLabel",e)}const j=E("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),ge=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],fe=e=>{const{classes:r,disabled:t,labelPlacement:n,error:l,required:a}=e,c={root:["root",t&&"disabled",`labelPlacement${v(n)}`,l&&"error",a&&"required"],label:["label",t&&"disabled"],asterisk:["asterisk",l&&"error"]};return T(c,he,r)},ve=W("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[{[`& .${j.label}`]:r.label},r.root,r[`labelPlacement${v(t.labelPlacement)}`]]}})(({theme:e,ownerState:r})=>m({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${j.disabled}`]:{cursor:"default"}},r.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},r.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},r.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${j.label}`]:{[`&.${j.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),Ce=W("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,r)=>r.asterisk})(({theme:e})=>({[`&.${j.error}`]:{color:(e.vars||e).palette.error.main}})),ke=u.forwardRef(function(r,t){var n,l;const a=N({props:r,name:"MuiFormControlLabel"}),{className:c,componentsProps:x={},control:d,disabled:i,disableTypography:b,label:s,labelPlacement:C="end",required:I,slotProps:z={}}=a,P=q(a,ge),h=V(),k=(n=i??d.props.disabled)!=null?n:h==null?void 0:h.disabled,g=I??d.props.required,_={disabled:k,required:g};["checked","name","onChange","value","inputRef"].forEach(S=>{typeof d.props[S]>"u"&&typeof a[S]<"u"&&(_[S]=a[S])});const H=K({props:a,muiFormControl:h,states:["error"]}),w=m({},a,{disabled:k,labelPlacement:C,required:g,error:H.error}),$=fe(w),L=(l=z.typography)!=null?l:x.typography;let f=s;return f!=null&&f.type!==p&&!b&&(f=o.jsx(p,m({component:"span"},L,{className:F($.label,L==null?void 0:L.className),children:f}))),o.jsxs(ve,m({className:F($.root,c),ownerState:w,ref:t},P,{children:[u.cloneElement(d,_),g?o.jsxs(M,{display:"block",children:[f,o.jsxs(Ce,{ownerState:w,"aria-hidden":!0,className:$.asterisk,children:[" ","*"]})]}):f]}))}),ye="/assets/mid-mile-approach-Drwn-ig9.jpg";function $e(){const e=J(),[r,t]=u.useState(!1),[n,l]=u.useState(""),[a,c]=u.useState(""),[x,d]=u.useState(""),i=async()=>{try{d("");const s=await Q(n,a);localStorage.setItem("logged_in","true"),localStorage.setItem("auth_token",s.token),localStorage.setItem("user",JSON.stringify(s.user)),e("/dashboard")}catch(s){d(s.message||"Invalid email or password")}},b=s=>{s.key==="Enter"&&i()};return o.jsxs(y,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundImage:`url(${ye})`,backgroundSize:"cover",backgroundPosition:"center",position:"relative","&::before":{content:'""',position:"absolute",inset:0,background:"linear-gradient(180deg, rgba(15,23,42,0.6) 0%, rgba(192, 18, 39, 0.8) 100%)",zIndex:1}},children:[o.jsxs(oe,{sx:{position:"relative",zIndex:2,width:"100%",maxWidth:440,p:{xs:4,sm:5},m:2,background:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",border:"1px solid rgba(255, 255, 255, 0.5)",boxShadow:"0 24px 48px rgba(0,0,0,0.2)",borderRadius:4},children:[o.jsx(y,{sx:{mb:4,display:"flex",justifyContent:"center"},children:o.jsx(Y,{})}),o.jsx(p,{variant:"h3",sx:{fontWeight:800,textAlign:"center",letterSpacing:"-0.5px",color:"#1e293b"},children:"Welcome back"}),o.jsx(p,{variant:"body1",sx:{mt:1,mb:4,textAlign:"center",color:"#475569"},children:"Sign in to your Doormile operations account."}),o.jsxs(M,{spacing:2.5,children:[o.jsxs(y,{children:[o.jsx(p,{variant:"subtitle2",sx:{mb:.75,color:"#334155",fontWeight:600},children:"Email"}),o.jsx(A,{fullWidth:!0,placeholder:"Enter your email address",value:n,onChange:s=>l(s.target.value),onKeyDown:b,sx:{"& .MuiOutlinedInput-root":{bgcolor:"rgba(255,255,255,0.6)",borderRadius:2,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(255,255,255,0.9)"},"&.Mui-focused":{bgcolor:"#fff",boxShadow:"0 4px 12px rgba(0,0,0,0.05)"}}}})]}),o.jsxs(y,{children:[o.jsx(p,{variant:"subtitle2",sx:{mb:.75,color:"#334155",fontWeight:600},children:"Password"}),o.jsx(A,{fullWidth:!0,type:r?"text":"password",placeholder:"Enter your password",value:a,onChange:s=>c(s.target.value),onKeyDown:b,sx:{"& .MuiOutlinedInput-root":{bgcolor:"rgba(255,255,255,0.6)",borderRadius:2,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(255,255,255,0.9)"},"&.Mui-focused":{bgcolor:"#fff",boxShadow:"0 4px 12px rgba(0,0,0,0.05)"}}},InputProps:{endAdornment:o.jsx(te,{position:"end",children:o.jsx(G,{onClick:()=>t(s=>!s),edge:"end",size:"small",children:r?o.jsx(Z,{fontSize:"small",sx:{color:"#94a3b8"}}):o.jsx(ee,{fontSize:"small",sx:{color:"#94a3b8"}})})})}})]}),o.jsxs(M,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[o.jsx(ke,{control:o.jsx(xe,{defaultChecked:!0,size:"small",sx:{color:"#cbd5e1","&.Mui-checked":{color:"primary.main"}}}),label:o.jsx(p,{variant:"body2",sx:{color:"#475569",fontWeight:500},children:"Remember me"})}),o.jsx(re,{href:"#",underline:"hover",variant:"body2",color:"primary",sx:{fontWeight:600},children:"Forgot password?"})]}),x&&o.jsx(p,{variant:"body2",color:"error",textAlign:"center",sx:{fontWeight:600},children:x}),o.jsx(ae,{fullWidth:!0,size:"large",variant:"contained",onClick:i,sx:{mt:2,py:1.5,borderRadius:2,fontSize:"1.05rem",fontWeight:700,textTransform:"none",boxShadow:"0 8px 16px rgba(192, 18, 39, 0.25)","&:hover":{boxShadow:"0 12px 20px rgba(192, 18, 39, 0.35)"},transition:"box-shadow 0.2s ease"},children:"Sign In"})]})]}),o.jsx(y,{sx:{position:"absolute",bottom:20,zIndex:2},children:o.jsxs(p,{variant:"caption",sx:{color:"rgba(255,255,255,0.8)",fontSize:"0.8rem"},children:["© ",new Date().getFullYear()," Doormile Technologies. All rights reserved."]})})]})}export{$e as default}; +import{a5 as B,j as o,l as D,m as E,a as u,n as N,o as q,_ as m,p as F,q as v,v as T,w as W,a4 as O,A as U,aq as V,ar as K,T as p,S as M,as as J,B as y,at as Y,I as G,au as Q}from"./index-J0uxx8As.js";import{S as X,d as Z,a as ee}from"./VisibilityOff-DVBJPx6F.js";import{C as oe,L as re}from"./Link-DdF3Xu1F.js";import{T as A}from"./TextField-BARvBB_z.js";import{I as te}from"./InputAdornment-Cbcw8oJa.js";import{B as ae}from"./Button-BkRsd5c4.js";const se=B(o.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),ne=B(o.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),le=B(o.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function ie(e){return D("MuiCheckbox",e)}const R=E("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),ce=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],de=e=>{const{classes:r,indeterminate:t,color:n,size:l}=e,a={root:["root",t&&"indeterminate",`color${v(n)}`,`size${v(l)}`]},c=T(a,ie,r);return m({},r,c)},pe=W(X,{shouldForwardProp:e=>O(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[r.root,t.indeterminate&&r.indeterminate,r[`size${v(t.size)}`],t.color!=="default"&&r[`color${v(t.color)}`]]}})(({theme:e,ownerState:r})=>m({color:(e.vars||e).palette.text.secondary},!r.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${r.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[r.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:U(r.color==="default"?e.palette.action.active:e.palette[r.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},r.color!=="default"&&{[`&.${R.checked}, &.${R.indeterminate}`]:{color:(e.vars||e).palette[r.color].main},[`&.${R.disabled}`]:{color:(e.vars||e).palette.action.disabled}})),ue=o.jsx(ne,{}),me=o.jsx(se,{}),be=o.jsx(le,{}),xe=u.forwardRef(function(r,t){var n,l;const a=N({props:r,name:"MuiCheckbox"}),{checkedIcon:c=ue,color:x="primary",icon:d=me,indeterminate:i=!1,indeterminateIcon:b=be,inputProps:s,size:C="medium",className:I}=a,z=q(a,ce),P=i?b:d,h=i?b:c,k=m({},a,{color:x,indeterminate:i,size:C}),g=de(k);return o.jsx(pe,m({type:"checkbox",inputProps:m({"data-indeterminate":i},s),icon:u.cloneElement(P,{fontSize:(n=P.props.fontSize)!=null?n:C}),checkedIcon:u.cloneElement(h,{fontSize:(l=h.props.fontSize)!=null?l:C}),ownerState:k,ref:t,className:F(g.root,I)},z,{classes:g}))});function he(e){return D("MuiFormControlLabel",e)}const j=E("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),ge=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],fe=e=>{const{classes:r,disabled:t,labelPlacement:n,error:l,required:a}=e,c={root:["root",t&&"disabled",`labelPlacement${v(n)}`,l&&"error",a&&"required"],label:["label",t&&"disabled"],asterisk:["asterisk",l&&"error"]};return T(c,he,r)},ve=W("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:t}=e;return[{[`& .${j.label}`]:r.label},r.root,r[`labelPlacement${v(t.labelPlacement)}`]]}})(({theme:e,ownerState:r})=>m({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${j.disabled}`]:{cursor:"default"}},r.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},r.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},r.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${j.label}`]:{[`&.${j.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),Ce=W("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,r)=>r.asterisk})(({theme:e})=>({[`&.${j.error}`]:{color:(e.vars||e).palette.error.main}})),ke=u.forwardRef(function(r,t){var n,l;const a=N({props:r,name:"MuiFormControlLabel"}),{className:c,componentsProps:x={},control:d,disabled:i,disableTypography:b,label:s,labelPlacement:C="end",required:I,slotProps:z={}}=a,P=q(a,ge),h=V(),k=(n=i??d.props.disabled)!=null?n:h==null?void 0:h.disabled,g=I??d.props.required,_={disabled:k,required:g};["checked","name","onChange","value","inputRef"].forEach(S=>{typeof d.props[S]>"u"&&typeof a[S]<"u"&&(_[S]=a[S])});const H=K({props:a,muiFormControl:h,states:["error"]}),w=m({},a,{disabled:k,labelPlacement:C,required:g,error:H.error}),$=fe(w),L=(l=z.typography)!=null?l:x.typography;let f=s;return f!=null&&f.type!==p&&!b&&(f=o.jsx(p,m({component:"span"},L,{className:F($.label,L==null?void 0:L.className),children:f}))),o.jsxs(ve,m({className:F($.root,c),ownerState:w,ref:t},P,{children:[u.cloneElement(d,_),g?o.jsxs(M,{display:"block",children:[f,o.jsxs(Ce,{ownerState:w,"aria-hidden":!0,className:$.asterisk,children:[" ","*"]})]}):f]}))}),ye="/assets/mid-mile-approach-Drwn-ig9.jpg";function $e(){const e=J(),[r,t]=u.useState(!1),[n,l]=u.useState(""),[a,c]=u.useState(""),[x,d]=u.useState(""),i=async()=>{try{d("");const s=await Q(n,a);localStorage.setItem("logged_in","true"),localStorage.setItem("auth_token",s.token),localStorage.setItem("user",JSON.stringify(s.user)),e("/dashboard")}catch(s){d(s.message||"Invalid email or password")}},b=s=>{s.key==="Enter"&&i()};return o.jsxs(y,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundImage:`url(${ye})`,backgroundSize:"cover",backgroundPosition:"center",position:"relative","&::before":{content:'""',position:"absolute",inset:0,background:"linear-gradient(180deg, rgba(15,23,42,0.6) 0%, rgba(192, 18, 39, 0.8) 100%)",zIndex:1}},children:[o.jsxs(oe,{sx:{position:"relative",zIndex:2,width:"100%",maxWidth:440,p:{xs:4,sm:5},m:2,background:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",border:"1px solid rgba(255, 255, 255, 0.5)",boxShadow:"0 24px 48px rgba(0,0,0,0.2)",borderRadius:4},children:[o.jsx(y,{sx:{mb:4,display:"flex",justifyContent:"center"},children:o.jsx(Y,{})}),o.jsx(p,{variant:"h3",sx:{fontWeight:800,textAlign:"center",letterSpacing:"-0.5px",color:"#1e293b"},children:"Welcome back"}),o.jsx(p,{variant:"body1",sx:{mt:1,mb:4,textAlign:"center",color:"#475569"},children:"Sign in to your Doormile operations account."}),o.jsxs(M,{spacing:2.5,children:[o.jsxs(y,{children:[o.jsx(p,{variant:"subtitle2",sx:{mb:.75,color:"#334155",fontWeight:600},children:"Email"}),o.jsx(A,{fullWidth:!0,placeholder:"Enter your email address",value:n,onChange:s=>l(s.target.value),onKeyDown:b,sx:{"& .MuiOutlinedInput-root":{bgcolor:"rgba(255,255,255,0.6)",borderRadius:2,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(255,255,255,0.9)"},"&.Mui-focused":{bgcolor:"#fff",boxShadow:"0 4px 12px rgba(0,0,0,0.05)"}}}})]}),o.jsxs(y,{children:[o.jsx(p,{variant:"subtitle2",sx:{mb:.75,color:"#334155",fontWeight:600},children:"Password"}),o.jsx(A,{fullWidth:!0,type:r?"text":"password",placeholder:"Enter your password",value:a,onChange:s=>c(s.target.value),onKeyDown:b,sx:{"& .MuiOutlinedInput-root":{bgcolor:"rgba(255,255,255,0.6)",borderRadius:2,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(255,255,255,0.9)"},"&.Mui-focused":{bgcolor:"#fff",boxShadow:"0 4px 12px rgba(0,0,0,0.05)"}}},InputProps:{endAdornment:o.jsx(te,{position:"end",children:o.jsx(G,{onClick:()=>t(s=>!s),edge:"end",size:"small",children:r?o.jsx(Z,{fontSize:"small",sx:{color:"#94a3b8"}}):o.jsx(ee,{fontSize:"small",sx:{color:"#94a3b8"}})})})}})]}),o.jsxs(M,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[o.jsx(ke,{control:o.jsx(xe,{defaultChecked:!0,size:"small",sx:{color:"#cbd5e1","&.Mui-checked":{color:"primary.main"}}}),label:o.jsx(p,{variant:"body2",sx:{color:"#475569",fontWeight:500},children:"Remember me"})}),o.jsx(re,{href:"#",underline:"hover",variant:"body2",color:"primary",sx:{fontWeight:600},children:"Forgot password?"})]}),x&&o.jsx(p,{variant:"body2",color:"error",textAlign:"center",sx:{fontWeight:600},children:x}),o.jsx(ae,{fullWidth:!0,size:"large",variant:"contained",onClick:i,sx:{mt:2,py:1.5,borderRadius:2,fontSize:"1.05rem",fontWeight:700,textTransform:"none",boxShadow:"0 8px 16px rgba(192, 18, 39, 0.25)","&:hover":{boxShadow:"0 12px 20px rgba(192, 18, 39, 0.35)"},transition:"box-shadow 0.2s ease"},children:"Sign In"})]})]}),o.jsx(y,{sx:{position:"absolute",bottom:20,zIndex:2},children:o.jsxs(p,{variant:"caption",sx:{color:"rgba(255,255,255,0.8)",fontSize:"0.8rem"},children:["© ",new Date().getFullYear()," Doormile Technologies. All rights reserved."]})})]})}export{$e as default}; diff --git a/dist/assets/MapOutlined-C-CxlyED.js b/dist/assets/MapOutlined-DE0O8xFw.js similarity index 86% rename from dist/assets/MapOutlined-C-CxlyED.js rename to dist/assets/MapOutlined-DE0O8xFw.js index 047118e..ce15ed0 100644 --- a/dist/assets/MapOutlined-C-CxlyED.js +++ b/dist/assets/MapOutlined-DE0O8xFw.js @@ -1 +1 @@ -import{r,j as t,i as a}from"./index-Dg-wT72v.js";var e={},l=a;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=l(r()),o=t;u=e.default=(0,i.default)((0,o.jsx)("path",{d:"m20.5 3-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5M10 5.47l4 1.4v11.66l-4-1.4zm-5 .99 3-1.01v11.7l-3 1.16zm14 11.08-3 1.01V6.86l3-1.16z"}),"MapOutlined");export{u as d}; +import{r,j as t,i as a}from"./index-J0uxx8As.js";var e={},l=a;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=l(r()),o=t;u=e.default=(0,i.default)((0,o.jsx)("path",{d:"m20.5 3-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5M10 5.47l4 1.4v11.66l-4-1.4zm-5 .99 3-1.01v11.7l-3 1.16zm14 11.08-3 1.01V6.86l3-1.16z"}),"MapOutlined");export{u as d}; diff --git a/dist/assets/PageHeader-DgkErsA7.js b/dist/assets/PageHeader-TW1dMGrU.js similarity index 99% rename from dist/assets/PageHeader-DgkErsA7.js rename to dist/assets/PageHeader-TW1dMGrU.js index ff8ffea..b4a6d81 100644 --- a/dist/assets/PageHeader-DgkErsA7.js +++ b/dist/assets/PageHeader-TW1dMGrU.js @@ -1 +1 @@ -import{l as _,m as G,a5 as w,j as n,a as x,n as K,o as D,_ as g,al as ro,I as mo,p as B,q as p,v as U,w as M,P as $o,ad as to,ac as lo,y as yo,X,A as P,ag as no,a1 as ko,T as J,a2 as Io,am as ho,an as F,ao as Q,r as So,i as zo,S as Mo,B as so,ap as io}from"./index-Dg-wT72v.js";import{L as co}from"./Link-CndAQvyC.js";function Ro(o){return _("MuiAlert",o)}const po=G("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),jo=w(n.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Po=w(n.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Bo=w(n.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),Ao=w(n.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),No=w(n.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Oo=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],Lo=o=>{const{variant:e,color:t,severity:a,classes:r}=o,l={root:["root",`color${p(t||a)}`,`${e}${p(t||a)}`,`${e}`],icon:["icon"],message:["message"],action:["action"]};return U(l,Ro,r)},Wo=M($o,{name:"MuiAlert",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,e[t.variant],e[`${t.variant}${p(t.color||t.severity)}`]]}})(({theme:o})=>{const e=o.palette.mode==="light"?to:lo,t=o.palette.mode==="light"?lo:to;return g({},o.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(o.palette).filter(([,a])=>a.main&&a.light).map(([a])=>({props:{colorSeverity:a,variant:"standard"},style:{color:o.vars?o.vars.palette.Alert[`${a}Color`]:e(o.palette[a].light,.6),backgroundColor:o.vars?o.vars.palette.Alert[`${a}StandardBg`]:t(o.palette[a].light,.9),[`& .${po.icon}`]:o.vars?{color:o.vars.palette.Alert[`${a}IconColor`]}:{color:o.palette[a].main}}})),...Object.entries(o.palette).filter(([,a])=>a.main&&a.light).map(([a])=>({props:{colorSeverity:a,variant:"outlined"},style:{color:o.vars?o.vars.palette.Alert[`${a}Color`]:e(o.palette[a].light,.6),border:`1px solid ${(o.vars||o).palette[a].light}`,[`& .${po.icon}`]:o.vars?{color:o.vars.palette.Alert[`${a}IconColor`]}:{color:o.palette[a].main}}})),...Object.entries(o.palette).filter(([,a])=>a.main&&a.dark).map(([a])=>({props:{colorSeverity:a,variant:"filled"},style:g({fontWeight:o.typography.fontWeightMedium},o.vars?{color:o.vars.palette.Alert[`${a}FilledColor`],backgroundColor:o.vars.palette.Alert[`${a}FilledBg`]}:{backgroundColor:o.palette.mode==="dark"?o.palette[a].dark:o.palette[a].main,color:o.palette.getContrastText(o.palette[a].main)})}))]})}),wo=M("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(o,e)=>e.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Eo=M("div",{name:"MuiAlert",slot:"Message",overridesResolver:(o,e)=>e.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),uo=M("div",{name:"MuiAlert",slot:"Action",overridesResolver:(o,e)=>e.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),go={success:n.jsx(jo,{fontSize:"inherit"}),warning:n.jsx(Po,{fontSize:"inherit"}),error:n.jsx(Bo,{fontSize:"inherit"}),info:n.jsx(Ao,{fontSize:"inherit"})},Ie=x.forwardRef(function(e,t){const a=K({props:e,name:"MuiAlert"}),{action:r,children:l,className:s,closeText:i="Close",color:d,components:f={},componentsProps:u={},icon:v,iconMapping:$=go,onClose:b,role:m="alert",severity:S="success",slotProps:A={},slots:I={},variant:j="standard"}=a,L=D(a,Oo),y=g({},a,{color:d,severity:S,variant:j,colorSeverity:d||S}),z=Lo(y),h={slots:g({closeButton:f.CloseButton,closeIcon:f.CloseIcon},I),slotProps:g({},u,A)},[C,R]=ro("closeButton",{elementType:mo,externalForwardedProps:h,ownerState:y}),[N,O]=ro("closeIcon",{elementType:No,externalForwardedProps:h,ownerState:y});return n.jsxs(Wo,g({role:m,elevation:0,ownerState:y,className:B(z.root,s),ref:t},L,{children:[v!==!1?n.jsx(wo,{ownerState:y,className:z.icon,children:v||$[S]||go[S]}):null,n.jsx(Eo,{ownerState:y,className:z.message,children:l}),r!=null?n.jsx(uo,{ownerState:y,className:z.action,children:r}):null,r==null&&b?n.jsx(uo,{ownerState:y,className:z.action,children:n.jsx(C,g({size:"small","aria-label":i,title:i,color:"inherit",onClick:b},R,{children:n.jsx(N,g({fontSize:"small"},O))}))}):null]}))}),To=w(n.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function Vo(o){return _("MuiChip",o)}const c=G("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Do=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],_o=o=>{const{classes:e,disabled:t,size:a,color:r,iconColor:l,onDelete:s,clickable:i,variant:d}=o,f={root:["root",d,t&&"disabled",`size${p(a)}`,`color${p(r)}`,i&&"clickable",i&&`clickableColor${p(r)}`,s&&"deletable",s&&`deletableColor${p(r)}`,`${d}${p(r)}`],label:["label",`label${p(a)}`],avatar:["avatar",`avatar${p(a)}`,`avatarColor${p(r)}`],icon:["icon",`icon${p(a)}`,`iconColor${p(l)}`],deleteIcon:["deleteIcon",`deleteIcon${p(a)}`,`deleteIconColor${p(r)}`,`deleteIcon${p(d)}Color${p(r)}`]};return U(f,Vo,e)},Go=M("div",{name:"MuiChip",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o,{color:a,iconColor:r,clickable:l,onDelete:s,size:i,variant:d}=t;return[{[`& .${c.avatar}`]:e.avatar},{[`& .${c.avatar}`]:e[`avatar${p(i)}`]},{[`& .${c.avatar}`]:e[`avatarColor${p(a)}`]},{[`& .${c.icon}`]:e.icon},{[`& .${c.icon}`]:e[`icon${p(i)}`]},{[`& .${c.icon}`]:e[`iconColor${p(r)}`]},{[`& .${c.deleteIcon}`]:e.deleteIcon},{[`& .${c.deleteIcon}`]:e[`deleteIcon${p(i)}`]},{[`& .${c.deleteIcon}`]:e[`deleteIconColor${p(a)}`]},{[`& .${c.deleteIcon}`]:e[`deleteIcon${p(d)}Color${p(a)}`]},e.root,e[`size${p(i)}`],e[`color${p(a)}`],l&&e.clickable,l&&a!=="default"&&e[`clickableColor${p(a)})`],s&&e.deletable,s&&a!=="default"&&e[`deletableColor${p(a)}`],e[d],e[`${d}${p(a)}`]]}})(({theme:o,ownerState:e})=>{const t=o.palette.mode==="light"?o.palette.grey[700]:o.palette.grey[300];return g({maxWidth:"100%",fontFamily:o.typography.fontFamily,fontSize:o.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(o.vars||o).palette.text.primary,backgroundColor:(o.vars||o).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:o.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${c.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${c.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:o.vars?o.vars.palette.Chip.defaultAvatarColor:t,fontSize:o.typography.pxToRem(12)},[`& .${c.avatarColorPrimary}`]:{color:(o.vars||o).palette.primary.contrastText,backgroundColor:(o.vars||o).palette.primary.dark},[`& .${c.avatarColorSecondary}`]:{color:(o.vars||o).palette.secondary.contrastText,backgroundColor:(o.vars||o).palette.secondary.dark},[`& .${c.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:o.typography.pxToRem(10)},[`& .${c.icon}`]:g({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&g({color:o.vars?o.vars.palette.Chip.defaultIconColor:t},e.color!=="default"&&{color:"inherit"})),[`& .${c.deleteIcon}`]:g({WebkitTapHighlightColor:"transparent",color:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / 0.26)`:P(o.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / 0.4)`:P(o.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:o.vars?`rgba(${o.vars.palette[e.color].contrastTextChannel} / 0.7)`:P(o.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(o.vars||o).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(o.vars||o).palette[e.color].main,color:(o.vars||o).palette[e.color].contrastText},e.onDelete&&{[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:P(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette[e.color].dark}})},({theme:o,ownerState:e})=>g({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:P(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)},[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:P(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)},"&:active":{boxShadow:(o.vars||o).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette[e.color].dark}}),({theme:o,ownerState:e})=>g({},e.variant==="outlined"&&{backgroundColor:"transparent",border:o.vars?`1px solid ${o.vars.palette.Chip.defaultBorder}`:`1px solid ${o.palette.mode==="light"?o.palette.grey[400]:o.palette.grey[700]}`,[`&.${c.clickable}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},[`& .${c.avatar}`]:{marginLeft:4},[`& .${c.avatarSmall}`]:{marginLeft:2},[`& .${c.icon}`]:{marginLeft:4},[`& .${c.iconSmall}`]:{marginLeft:2},[`& .${c.deleteIcon}`]:{marginRight:5},[`& .${c.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(o.vars||o).palette[e.color].main,border:`1px solid ${o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / 0.7)`:P(o.palette[e.color].main,.7)}`,[`&.${c.clickable}:hover`]:{backgroundColor:o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:P(o.palette[e.color].main,o.palette.action.hoverOpacity)},[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / ${o.vars.palette.action.focusOpacity})`:P(o.palette[e.color].main,o.palette.action.focusOpacity)},[`& .${c.deleteIcon}`]:{color:o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / 0.7)`:P(o.palette[e.color].main,.7),"&:hover, &:active":{color:(o.vars||o).palette[e.color].main}}})),Ko=M("span",{name:"MuiChip",slot:"Label",overridesResolver:(o,e)=>{const{ownerState:t}=o,{size:a}=t;return[e.label,e[`label${p(a)}`]]}})(({ownerState:o})=>g({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},o.variant==="outlined"&&{paddingLeft:11,paddingRight:11},o.size==="small"&&{paddingLeft:8,paddingRight:8},o.size==="small"&&o.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function fo(o){return o.key==="Backspace"||o.key==="Delete"}const he=x.forwardRef(function(e,t){const a=K({props:e,name:"MuiChip"}),{avatar:r,className:l,clickable:s,color:i="default",component:d,deleteIcon:f,disabled:u=!1,icon:v,label:$,onClick:b,onDelete:m,onKeyDown:S,onKeyUp:A,size:I="medium",variant:j="filled",tabIndex:L,skipFocusWhenDisabled:y=!1}=a,z=D(a,Do),h=x.useRef(null),C=yo(h,t),R=k=>{k.stopPropagation(),m&&m(k)},N=k=>{k.currentTarget===k.target&&fo(k)&&k.preventDefault(),S&&S(k)},O=k=>{k.currentTarget===k.target&&(m&&fo(k)?m(k):k.key==="Escape"&&h.current&&h.current.blur()),A&&A(k)},H=s!==!1&&b?!0:s,q=H||m?X:d||"div",Z=g({},a,{component:q,disabled:u,size:I,color:i,iconColor:x.isValidElement(v)&&v.props.color||i,onDelete:!!m,clickable:H,variant:j}),W=_o(Z),bo=q===X?g({component:d||"div",focusVisibleClassName:W.focusVisible},m&&{disableRipple:!0}):{};let oo=null;m&&(oo=f&&x.isValidElement(f)?x.cloneElement(f,{className:B(f.props.className,W.deleteIcon),onClick:R}):n.jsx(To,{className:B(W.deleteIcon),onClick:R}));let eo=null;r&&x.isValidElement(r)&&(eo=x.cloneElement(r,{className:B(W.avatar,r.props.className)}));let ao=null;return v&&x.isValidElement(v)&&(ao=x.cloneElement(v,{className:B(W.icon,v.props.className)})),n.jsxs(Go,g({as:q,className:B(W.root,l),disabled:H&&u?!0:void 0,onClick:b,onKeyDown:N,onKeyUp:O,ref:C,tabIndex:y&&u?-1:L,ownerState:Z},bo,z,{children:[eo||ao,n.jsx(Ko,{className:B(W.label),ownerState:Z,children:$}),oo]}))}),Uo=w(n.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),Fo=["slots","slotProps"],Ho=M(X,{name:"MuiBreadcrumbCollapsed"})(({theme:o})=>g({display:"flex",marginLeft:`calc(${o.spacing(1)} * 0.5)`,marginRight:`calc(${o.spacing(1)} * 0.5)`},o.palette.mode==="light"?{backgroundColor:o.palette.grey[100],color:o.palette.grey[700]}:{backgroundColor:o.palette.grey[700],color:o.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":g({},o.palette.mode==="light"?{backgroundColor:o.palette.grey[200]}:{backgroundColor:o.palette.grey[600]}),"&:active":g({boxShadow:o.shadows[0]},o.palette.mode==="light"?{backgroundColor:no(o.palette.grey[200],.12)}:{backgroundColor:no(o.palette.grey[600],.12)})})),qo=M(Uo)({width:24,height:16});function Zo(o){const{slots:e={},slotProps:t={}}=o,a=D(o,Fo),r=o;return n.jsx("li",{children:n.jsx(Ho,g({focusRipple:!0},a,{ownerState:r,children:n.jsx(qo,g({as:e.CollapsedIcon,ownerState:r},t.collapsedIcon))}))})}function Xo(o){return _("MuiBreadcrumbs",o)}const Jo=G("MuiBreadcrumbs",["root","ol","li","separator"]),Qo=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],Yo=o=>{const{classes:e}=o;return U({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},Xo,e)},oe=M(J,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(o,e)=>[{[`& .${Jo.li}`]:e.li},e.root]})({}),ee=M("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(o,e)=>e.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ae=M("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(o,e)=>e.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function re(o,e,t,a){return o.reduce((r,l,s)=>(s{const R=()=>{A(!0);const N=y.current.querySelector("a[href],button,[tabindex]");N&&N.focus()};return v+u>=C.length?C:[...C.slice(0,v),n.jsx(Zo,{"aria-label":f,slots:{CollapsedIcon:i.CollapsedIcon},slotProps:{collapsedIcon:L},onClick:R},"ellipsis"),...C.slice(C.length-u,C.length)]},h=x.Children.toArray(r).filter(C=>x.isValidElement(C)).map((C,R)=>n.jsx("li",{className:j.li,children:C},`child-${R}`));return n.jsx(oe,g({ref:t,component:s,color:"text.secondary",className:B(j.root,l),ownerState:I},m,{children:n.jsx(ee,{className:j.ol,ref:y,ownerState:I,children:re(S||$&&h.length<=$?h:z(h),j.separator,b,I)})}))}),vo=x.createContext();function le(o){return _("MuiGrid",o)}const ne=[0,1,2,3,4,5,6,7,8,9,10],se=["column-reverse","column","row-reverse","row"],ie=["nowrap","wrap-reverse","wrap"],T=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],V=G("MuiGrid",["root","container","item","zeroMinWidth",...ne.map(o=>`spacing-xs-${o}`),...se.map(o=>`direction-xs-${o}`),...ie.map(o=>`wrap-xs-${o}`),...T.map(o=>`grid-xs-${o}`),...T.map(o=>`grid-sm-${o}`),...T.map(o=>`grid-md-${o}`),...T.map(o=>`grid-lg-${o}`),...T.map(o=>`grid-xl-${o}`)]),ce=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function E(o){const e=parseFloat(o);return`${e}${String(o).replace(String(e),"")||"px"}`}function pe({theme:o,ownerState:e}){let t;return o.breakpoints.keys.reduce((a,r)=>{let l={};if(e[r]&&(t=e[r]),!t)return a;if(t===!0)l={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(t==="auto")l={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=F({values:e.columns,breakpoints:o.breakpoints.values}),i=typeof s=="object"?s[r]:s;if(i==null)return a;const d=`${Math.round(t/i*1e8)/1e6}%`;let f={};if(e.container&&e.item&&e.columnSpacing!==0){const u=o.spacing(e.columnSpacing);if(u!=="0px"){const v=`calc(${d} + ${E(u)})`;f={flexBasis:v,maxWidth:v}}}l=g({flexBasis:d,flexGrow:0,maxWidth:d},f)}return o.breakpoints.values[r]===0?Object.assign(a,l):a[o.breakpoints.up(r)]=l,a},{})}function de({theme:o,ownerState:e}){const t=F({values:e.direction,breakpoints:o.breakpoints.values});return Q({theme:o},t,a=>{const r={flexDirection:a};return a.indexOf("column")===0&&(r[`& > .${V.item}`]={maxWidth:"none"}),r})}function xo({breakpoints:o,values:e}){let t="";Object.keys(e).forEach(r=>{t===""&&e[r]!==0&&(t=r)});const a=Object.keys(o).sort((r,l)=>o[r]-o[l]);return a.slice(0,a.indexOf(t))}function ue({theme:o,ownerState:e}){const{container:t,rowSpacing:a}=e;let r={};if(t&&a!==0){const l=F({values:a,breakpoints:o.breakpoints.values});let s;typeof l=="object"&&(s=xo({breakpoints:o.breakpoints.values,values:l})),r=Q({theme:o},l,(i,d)=>{var f;const u=o.spacing(i);return u!=="0px"?{marginTop:`-${E(u)}`,[`& > .${V.item}`]:{paddingTop:E(u)}}:(f=s)!=null&&f.includes(d)?{}:{marginTop:0,[`& > .${V.item}`]:{paddingTop:0}}})}return r}function ge({theme:o,ownerState:e}){const{container:t,columnSpacing:a}=e;let r={};if(t&&a!==0){const l=F({values:a,breakpoints:o.breakpoints.values});let s;typeof l=="object"&&(s=xo({breakpoints:o.breakpoints.values,values:l})),r=Q({theme:o},l,(i,d)=>{var f;const u=o.spacing(i);return u!=="0px"?{width:`calc(100% + ${E(u)})`,marginLeft:`-${E(u)}`,[`& > .${V.item}`]:{paddingLeft:E(u)}}:(f=s)!=null&&f.includes(d)?{}:{width:"100%",marginLeft:0,[`& > .${V.item}`]:{paddingLeft:0}}})}return r}function fe(o,e,t={}){if(!o||o<=0)return[];if(typeof o=="string"&&!Number.isNaN(Number(o))||typeof o=="number")return[t[`spacing-xs-${String(o)}`]];const a=[];return e.forEach(r=>{const l=o[r];Number(l)>0&&a.push(t[`spacing-${r}-${String(l)}`])}),a}const ve=M("div",{name:"MuiGrid",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o,{container:a,direction:r,item:l,spacing:s,wrap:i,zeroMinWidth:d,breakpoints:f}=t;let u=[];a&&(u=fe(s,f,e));const v=[];return f.forEach($=>{const b=t[$];b&&v.push(e[`grid-${$}-${String(b)}`])}),[e.root,a&&e.container,l&&e.item,d&&e.zeroMinWidth,...u,r!=="row"&&e[`direction-xs-${String(r)}`],i!=="wrap"&&e[`wrap-xs-${String(i)}`],...v]}})(({ownerState:o})=>g({boxSizing:"border-box"},o.container&&{display:"flex",flexWrap:"wrap",width:"100%"},o.item&&{margin:0},o.zeroMinWidth&&{minWidth:0},o.wrap!=="wrap"&&{flexWrap:o.wrap}),de,ue,ge,pe);function xe(o,e){if(!o||o<=0)return[];if(typeof o=="string"&&!Number.isNaN(Number(o))||typeof o=="number")return[`spacing-xs-${String(o)}`];const t=[];return e.forEach(a=>{const r=o[a];if(Number(r)>0){const l=`spacing-${a}-${String(r)}`;t.push(l)}}),t}const Ce=o=>{const{classes:e,container:t,direction:a,item:r,spacing:l,wrap:s,zeroMinWidth:i,breakpoints:d}=o;let f=[];t&&(f=xe(l,d));const u=[];d.forEach($=>{const b=o[$];b&&u.push(`grid-${$}-${String(b)}`)});const v={root:["root",t&&"container",r&&"item",i&&"zeroMinWidth",...f,a!=="row"&&`direction-xs-${String(a)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return U(v,le,e)},Se=x.forwardRef(function(e,t){const a=K({props:e,name:"MuiGrid"}),{breakpoints:r}=Io(),l=ho(a),{className:s,columns:i,columnSpacing:d,component:f="div",container:u=!1,direction:v="row",item:$=!1,rowSpacing:b,spacing:m=0,wrap:S="wrap",zeroMinWidth:A=!1}=l,I=D(l,ce),j=b||m,L=d||m,y=x.useContext(vo),z=u?i||12:y,h={},C=g({},I);r.keys.forEach(O=>{I[O]!=null&&(h[O]=I[O],delete C[O])});const R=g({},l,{columns:z,container:u,direction:v,item:$,rowSpacing:j,columnSpacing:L,wrap:S,zeroMinWidth:A,spacing:m},h,{breakpoints:r.keys}),N=Ce(R);return n.jsx(vo.Provider,{value:z,children:n.jsx(ve,g({ownerState:R,className:B(N.root,s),as:f,ref:t},C))})});var Y={},be=zo;Object.defineProperty(Y,"__esModule",{value:!0});var Co=Y.default=void 0,me=be(So()),$e=n;Co=Y.default=(0,me.default)((0,$e.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext");function ze({title:o,breadcrumbs:e=[],action:t}){return n.jsxs(Mo,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,sx:{mb:3},children:[n.jsxs(so,{children:[n.jsx(J,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:o}),e.length>0&&n.jsxs(te,{separator:n.jsx(Co,{fontSize:"small"}),sx:{mt:.5},children:[n.jsx(co,{component:io,to:"/dashboard",underline:"hover",color:"text.secondary",variant:"caption",children:"Home"}),e.map((a,r)=>a.to&&r{const{variant:e,color:t,severity:a,classes:r}=o,l={root:["root",`color${p(t||a)}`,`${e}${p(t||a)}`,`${e}`],icon:["icon"],message:["message"],action:["action"]};return U(l,Ro,r)},Wo=M($o,{name:"MuiAlert",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,e[t.variant],e[`${t.variant}${p(t.color||t.severity)}`]]}})(({theme:o})=>{const e=o.palette.mode==="light"?to:lo,t=o.palette.mode==="light"?lo:to;return g({},o.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(o.palette).filter(([,a])=>a.main&&a.light).map(([a])=>({props:{colorSeverity:a,variant:"standard"},style:{color:o.vars?o.vars.palette.Alert[`${a}Color`]:e(o.palette[a].light,.6),backgroundColor:o.vars?o.vars.palette.Alert[`${a}StandardBg`]:t(o.palette[a].light,.9),[`& .${po.icon}`]:o.vars?{color:o.vars.palette.Alert[`${a}IconColor`]}:{color:o.palette[a].main}}})),...Object.entries(o.palette).filter(([,a])=>a.main&&a.light).map(([a])=>({props:{colorSeverity:a,variant:"outlined"},style:{color:o.vars?o.vars.palette.Alert[`${a}Color`]:e(o.palette[a].light,.6),border:`1px solid ${(o.vars||o).palette[a].light}`,[`& .${po.icon}`]:o.vars?{color:o.vars.palette.Alert[`${a}IconColor`]}:{color:o.palette[a].main}}})),...Object.entries(o.palette).filter(([,a])=>a.main&&a.dark).map(([a])=>({props:{colorSeverity:a,variant:"filled"},style:g({fontWeight:o.typography.fontWeightMedium},o.vars?{color:o.vars.palette.Alert[`${a}FilledColor`],backgroundColor:o.vars.palette.Alert[`${a}FilledBg`]}:{backgroundColor:o.palette.mode==="dark"?o.palette[a].dark:o.palette[a].main,color:o.palette.getContrastText(o.palette[a].main)})}))]})}),wo=M("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(o,e)=>e.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Eo=M("div",{name:"MuiAlert",slot:"Message",overridesResolver:(o,e)=>e.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),uo=M("div",{name:"MuiAlert",slot:"Action",overridesResolver:(o,e)=>e.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),go={success:n.jsx(jo,{fontSize:"inherit"}),warning:n.jsx(Po,{fontSize:"inherit"}),error:n.jsx(Bo,{fontSize:"inherit"}),info:n.jsx(Ao,{fontSize:"inherit"})},Ie=x.forwardRef(function(e,t){const a=K({props:e,name:"MuiAlert"}),{action:r,children:l,className:s,closeText:i="Close",color:d,components:f={},componentsProps:u={},icon:v,iconMapping:$=go,onClose:b,role:m="alert",severity:S="success",slotProps:A={},slots:I={},variant:j="standard"}=a,L=D(a,Oo),y=g({},a,{color:d,severity:S,variant:j,colorSeverity:d||S}),z=Lo(y),h={slots:g({closeButton:f.CloseButton,closeIcon:f.CloseIcon},I),slotProps:g({},u,A)},[C,R]=ro("closeButton",{elementType:mo,externalForwardedProps:h,ownerState:y}),[N,O]=ro("closeIcon",{elementType:No,externalForwardedProps:h,ownerState:y});return n.jsxs(Wo,g({role:m,elevation:0,ownerState:y,className:B(z.root,s),ref:t},L,{children:[v!==!1?n.jsx(wo,{ownerState:y,className:z.icon,children:v||$[S]||go[S]}):null,n.jsx(Eo,{ownerState:y,className:z.message,children:l}),r!=null?n.jsx(uo,{ownerState:y,className:z.action,children:r}):null,r==null&&b?n.jsx(uo,{ownerState:y,className:z.action,children:n.jsx(C,g({size:"small","aria-label":i,title:i,color:"inherit",onClick:b},R,{children:n.jsx(N,g({fontSize:"small"},O))}))}):null]}))}),To=w(n.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function Vo(o){return _("MuiChip",o)}const c=G("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Do=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],_o=o=>{const{classes:e,disabled:t,size:a,color:r,iconColor:l,onDelete:s,clickable:i,variant:d}=o,f={root:["root",d,t&&"disabled",`size${p(a)}`,`color${p(r)}`,i&&"clickable",i&&`clickableColor${p(r)}`,s&&"deletable",s&&`deletableColor${p(r)}`,`${d}${p(r)}`],label:["label",`label${p(a)}`],avatar:["avatar",`avatar${p(a)}`,`avatarColor${p(r)}`],icon:["icon",`icon${p(a)}`,`iconColor${p(l)}`],deleteIcon:["deleteIcon",`deleteIcon${p(a)}`,`deleteIconColor${p(r)}`,`deleteIcon${p(d)}Color${p(r)}`]};return U(f,Vo,e)},Go=M("div",{name:"MuiChip",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o,{color:a,iconColor:r,clickable:l,onDelete:s,size:i,variant:d}=t;return[{[`& .${c.avatar}`]:e.avatar},{[`& .${c.avatar}`]:e[`avatar${p(i)}`]},{[`& .${c.avatar}`]:e[`avatarColor${p(a)}`]},{[`& .${c.icon}`]:e.icon},{[`& .${c.icon}`]:e[`icon${p(i)}`]},{[`& .${c.icon}`]:e[`iconColor${p(r)}`]},{[`& .${c.deleteIcon}`]:e.deleteIcon},{[`& .${c.deleteIcon}`]:e[`deleteIcon${p(i)}`]},{[`& .${c.deleteIcon}`]:e[`deleteIconColor${p(a)}`]},{[`& .${c.deleteIcon}`]:e[`deleteIcon${p(d)}Color${p(a)}`]},e.root,e[`size${p(i)}`],e[`color${p(a)}`],l&&e.clickable,l&&a!=="default"&&e[`clickableColor${p(a)})`],s&&e.deletable,s&&a!=="default"&&e[`deletableColor${p(a)}`],e[d],e[`${d}${p(a)}`]]}})(({theme:o,ownerState:e})=>{const t=o.palette.mode==="light"?o.palette.grey[700]:o.palette.grey[300];return g({maxWidth:"100%",fontFamily:o.typography.fontFamily,fontSize:o.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(o.vars||o).palette.text.primary,backgroundColor:(o.vars||o).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:o.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${c.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${c.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:o.vars?o.vars.palette.Chip.defaultAvatarColor:t,fontSize:o.typography.pxToRem(12)},[`& .${c.avatarColorPrimary}`]:{color:(o.vars||o).palette.primary.contrastText,backgroundColor:(o.vars||o).palette.primary.dark},[`& .${c.avatarColorSecondary}`]:{color:(o.vars||o).palette.secondary.contrastText,backgroundColor:(o.vars||o).palette.secondary.dark},[`& .${c.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:o.typography.pxToRem(10)},[`& .${c.icon}`]:g({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&g({color:o.vars?o.vars.palette.Chip.defaultIconColor:t},e.color!=="default"&&{color:"inherit"})),[`& .${c.deleteIcon}`]:g({WebkitTapHighlightColor:"transparent",color:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / 0.26)`:P(o.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / 0.4)`:P(o.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:o.vars?`rgba(${o.vars.palette[e.color].contrastTextChannel} / 0.7)`:P(o.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(o.vars||o).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(o.vars||o).palette[e.color].main,color:(o.vars||o).palette[e.color].contrastText},e.onDelete&&{[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:P(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette[e.color].dark}})},({theme:o,ownerState:e})=>g({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:P(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)},[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:P(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)},"&:active":{boxShadow:(o.vars||o).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette[e.color].dark}}),({theme:o,ownerState:e})=>g({},e.variant==="outlined"&&{backgroundColor:"transparent",border:o.vars?`1px solid ${o.vars.palette.Chip.defaultBorder}`:`1px solid ${o.palette.mode==="light"?o.palette.grey[400]:o.palette.grey[700]}`,[`&.${c.clickable}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},[`& .${c.avatar}`]:{marginLeft:4},[`& .${c.avatarSmall}`]:{marginLeft:2},[`& .${c.icon}`]:{marginLeft:4},[`& .${c.iconSmall}`]:{marginLeft:2},[`& .${c.deleteIcon}`]:{marginRight:5},[`& .${c.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(o.vars||o).palette[e.color].main,border:`1px solid ${o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / 0.7)`:P(o.palette[e.color].main,.7)}`,[`&.${c.clickable}:hover`]:{backgroundColor:o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:P(o.palette[e.color].main,o.palette.action.hoverOpacity)},[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / ${o.vars.palette.action.focusOpacity})`:P(o.palette[e.color].main,o.palette.action.focusOpacity)},[`& .${c.deleteIcon}`]:{color:o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / 0.7)`:P(o.palette[e.color].main,.7),"&:hover, &:active":{color:(o.vars||o).palette[e.color].main}}})),Ko=M("span",{name:"MuiChip",slot:"Label",overridesResolver:(o,e)=>{const{ownerState:t}=o,{size:a}=t;return[e.label,e[`label${p(a)}`]]}})(({ownerState:o})=>g({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},o.variant==="outlined"&&{paddingLeft:11,paddingRight:11},o.size==="small"&&{paddingLeft:8,paddingRight:8},o.size==="small"&&o.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function fo(o){return o.key==="Backspace"||o.key==="Delete"}const he=x.forwardRef(function(e,t){const a=K({props:e,name:"MuiChip"}),{avatar:r,className:l,clickable:s,color:i="default",component:d,deleteIcon:f,disabled:u=!1,icon:v,label:$,onClick:b,onDelete:m,onKeyDown:S,onKeyUp:A,size:I="medium",variant:j="filled",tabIndex:L,skipFocusWhenDisabled:y=!1}=a,z=D(a,Do),h=x.useRef(null),C=yo(h,t),R=k=>{k.stopPropagation(),m&&m(k)},N=k=>{k.currentTarget===k.target&&fo(k)&&k.preventDefault(),S&&S(k)},O=k=>{k.currentTarget===k.target&&(m&&fo(k)?m(k):k.key==="Escape"&&h.current&&h.current.blur()),A&&A(k)},H=s!==!1&&b?!0:s,q=H||m?X:d||"div",Z=g({},a,{component:q,disabled:u,size:I,color:i,iconColor:x.isValidElement(v)&&v.props.color||i,onDelete:!!m,clickable:H,variant:j}),W=_o(Z),bo=q===X?g({component:d||"div",focusVisibleClassName:W.focusVisible},m&&{disableRipple:!0}):{};let oo=null;m&&(oo=f&&x.isValidElement(f)?x.cloneElement(f,{className:B(f.props.className,W.deleteIcon),onClick:R}):n.jsx(To,{className:B(W.deleteIcon),onClick:R}));let eo=null;r&&x.isValidElement(r)&&(eo=x.cloneElement(r,{className:B(W.avatar,r.props.className)}));let ao=null;return v&&x.isValidElement(v)&&(ao=x.cloneElement(v,{className:B(W.icon,v.props.className)})),n.jsxs(Go,g({as:q,className:B(W.root,l),disabled:H&&u?!0:void 0,onClick:b,onKeyDown:N,onKeyUp:O,ref:C,tabIndex:y&&u?-1:L,ownerState:Z},bo,z,{children:[eo||ao,n.jsx(Ko,{className:B(W.label),ownerState:Z,children:$}),oo]}))}),Uo=w(n.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),Fo=["slots","slotProps"],Ho=M(X,{name:"MuiBreadcrumbCollapsed"})(({theme:o})=>g({display:"flex",marginLeft:`calc(${o.spacing(1)} * 0.5)`,marginRight:`calc(${o.spacing(1)} * 0.5)`},o.palette.mode==="light"?{backgroundColor:o.palette.grey[100],color:o.palette.grey[700]}:{backgroundColor:o.palette.grey[700],color:o.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":g({},o.palette.mode==="light"?{backgroundColor:o.palette.grey[200]}:{backgroundColor:o.palette.grey[600]}),"&:active":g({boxShadow:o.shadows[0]},o.palette.mode==="light"?{backgroundColor:no(o.palette.grey[200],.12)}:{backgroundColor:no(o.palette.grey[600],.12)})})),qo=M(Uo)({width:24,height:16});function Zo(o){const{slots:e={},slotProps:t={}}=o,a=D(o,Fo),r=o;return n.jsx("li",{children:n.jsx(Ho,g({focusRipple:!0},a,{ownerState:r,children:n.jsx(qo,g({as:e.CollapsedIcon,ownerState:r},t.collapsedIcon))}))})}function Xo(o){return _("MuiBreadcrumbs",o)}const Jo=G("MuiBreadcrumbs",["root","ol","li","separator"]),Qo=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],Yo=o=>{const{classes:e}=o;return U({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},Xo,e)},oe=M(J,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(o,e)=>[{[`& .${Jo.li}`]:e.li},e.root]})({}),ee=M("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(o,e)=>e.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ae=M("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(o,e)=>e.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function re(o,e,t,a){return o.reduce((r,l,s)=>(s{const R=()=>{A(!0);const N=y.current.querySelector("a[href],button,[tabindex]");N&&N.focus()};return v+u>=C.length?C:[...C.slice(0,v),n.jsx(Zo,{"aria-label":f,slots:{CollapsedIcon:i.CollapsedIcon},slotProps:{collapsedIcon:L},onClick:R},"ellipsis"),...C.slice(C.length-u,C.length)]},h=x.Children.toArray(r).filter(C=>x.isValidElement(C)).map((C,R)=>n.jsx("li",{className:j.li,children:C},`child-${R}`));return n.jsx(oe,g({ref:t,component:s,color:"text.secondary",className:B(j.root,l),ownerState:I},m,{children:n.jsx(ee,{className:j.ol,ref:y,ownerState:I,children:re(S||$&&h.length<=$?h:z(h),j.separator,b,I)})}))}),vo=x.createContext();function le(o){return _("MuiGrid",o)}const ne=[0,1,2,3,4,5,6,7,8,9,10],se=["column-reverse","column","row-reverse","row"],ie=["nowrap","wrap-reverse","wrap"],T=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],V=G("MuiGrid",["root","container","item","zeroMinWidth",...ne.map(o=>`spacing-xs-${o}`),...se.map(o=>`direction-xs-${o}`),...ie.map(o=>`wrap-xs-${o}`),...T.map(o=>`grid-xs-${o}`),...T.map(o=>`grid-sm-${o}`),...T.map(o=>`grid-md-${o}`),...T.map(o=>`grid-lg-${o}`),...T.map(o=>`grid-xl-${o}`)]),ce=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function E(o){const e=parseFloat(o);return`${e}${String(o).replace(String(e),"")||"px"}`}function pe({theme:o,ownerState:e}){let t;return o.breakpoints.keys.reduce((a,r)=>{let l={};if(e[r]&&(t=e[r]),!t)return a;if(t===!0)l={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(t==="auto")l={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=F({values:e.columns,breakpoints:o.breakpoints.values}),i=typeof s=="object"?s[r]:s;if(i==null)return a;const d=`${Math.round(t/i*1e8)/1e6}%`;let f={};if(e.container&&e.item&&e.columnSpacing!==0){const u=o.spacing(e.columnSpacing);if(u!=="0px"){const v=`calc(${d} + ${E(u)})`;f={flexBasis:v,maxWidth:v}}}l=g({flexBasis:d,flexGrow:0,maxWidth:d},f)}return o.breakpoints.values[r]===0?Object.assign(a,l):a[o.breakpoints.up(r)]=l,a},{})}function de({theme:o,ownerState:e}){const t=F({values:e.direction,breakpoints:o.breakpoints.values});return Q({theme:o},t,a=>{const r={flexDirection:a};return a.indexOf("column")===0&&(r[`& > .${V.item}`]={maxWidth:"none"}),r})}function xo({breakpoints:o,values:e}){let t="";Object.keys(e).forEach(r=>{t===""&&e[r]!==0&&(t=r)});const a=Object.keys(o).sort((r,l)=>o[r]-o[l]);return a.slice(0,a.indexOf(t))}function ue({theme:o,ownerState:e}){const{container:t,rowSpacing:a}=e;let r={};if(t&&a!==0){const l=F({values:a,breakpoints:o.breakpoints.values});let s;typeof l=="object"&&(s=xo({breakpoints:o.breakpoints.values,values:l})),r=Q({theme:o},l,(i,d)=>{var f;const u=o.spacing(i);return u!=="0px"?{marginTop:`-${E(u)}`,[`& > .${V.item}`]:{paddingTop:E(u)}}:(f=s)!=null&&f.includes(d)?{}:{marginTop:0,[`& > .${V.item}`]:{paddingTop:0}}})}return r}function ge({theme:o,ownerState:e}){const{container:t,columnSpacing:a}=e;let r={};if(t&&a!==0){const l=F({values:a,breakpoints:o.breakpoints.values});let s;typeof l=="object"&&(s=xo({breakpoints:o.breakpoints.values,values:l})),r=Q({theme:o},l,(i,d)=>{var f;const u=o.spacing(i);return u!=="0px"?{width:`calc(100% + ${E(u)})`,marginLeft:`-${E(u)}`,[`& > .${V.item}`]:{paddingLeft:E(u)}}:(f=s)!=null&&f.includes(d)?{}:{width:"100%",marginLeft:0,[`& > .${V.item}`]:{paddingLeft:0}}})}return r}function fe(o,e,t={}){if(!o||o<=0)return[];if(typeof o=="string"&&!Number.isNaN(Number(o))||typeof o=="number")return[t[`spacing-xs-${String(o)}`]];const a=[];return e.forEach(r=>{const l=o[r];Number(l)>0&&a.push(t[`spacing-${r}-${String(l)}`])}),a}const ve=M("div",{name:"MuiGrid",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o,{container:a,direction:r,item:l,spacing:s,wrap:i,zeroMinWidth:d,breakpoints:f}=t;let u=[];a&&(u=fe(s,f,e));const v=[];return f.forEach($=>{const b=t[$];b&&v.push(e[`grid-${$}-${String(b)}`])}),[e.root,a&&e.container,l&&e.item,d&&e.zeroMinWidth,...u,r!=="row"&&e[`direction-xs-${String(r)}`],i!=="wrap"&&e[`wrap-xs-${String(i)}`],...v]}})(({ownerState:o})=>g({boxSizing:"border-box"},o.container&&{display:"flex",flexWrap:"wrap",width:"100%"},o.item&&{margin:0},o.zeroMinWidth&&{minWidth:0},o.wrap!=="wrap"&&{flexWrap:o.wrap}),de,ue,ge,pe);function xe(o,e){if(!o||o<=0)return[];if(typeof o=="string"&&!Number.isNaN(Number(o))||typeof o=="number")return[`spacing-xs-${String(o)}`];const t=[];return e.forEach(a=>{const r=o[a];if(Number(r)>0){const l=`spacing-${a}-${String(r)}`;t.push(l)}}),t}const Ce=o=>{const{classes:e,container:t,direction:a,item:r,spacing:l,wrap:s,zeroMinWidth:i,breakpoints:d}=o;let f=[];t&&(f=xe(l,d));const u=[];d.forEach($=>{const b=o[$];b&&u.push(`grid-${$}-${String(b)}`)});const v={root:["root",t&&"container",r&&"item",i&&"zeroMinWidth",...f,a!=="row"&&`direction-xs-${String(a)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return U(v,le,e)},Se=x.forwardRef(function(e,t){const a=K({props:e,name:"MuiGrid"}),{breakpoints:r}=Io(),l=ho(a),{className:s,columns:i,columnSpacing:d,component:f="div",container:u=!1,direction:v="row",item:$=!1,rowSpacing:b,spacing:m=0,wrap:S="wrap",zeroMinWidth:A=!1}=l,I=D(l,ce),j=b||m,L=d||m,y=x.useContext(vo),z=u?i||12:y,h={},C=g({},I);r.keys.forEach(O=>{I[O]!=null&&(h[O]=I[O],delete C[O])});const R=g({},l,{columns:z,container:u,direction:v,item:$,rowSpacing:j,columnSpacing:L,wrap:S,zeroMinWidth:A,spacing:m},h,{breakpoints:r.keys}),N=Ce(R);return n.jsx(vo.Provider,{value:z,children:n.jsx(ve,g({ownerState:R,className:B(N.root,s),as:f,ref:t},C))})});var Y={},be=zo;Object.defineProperty(Y,"__esModule",{value:!0});var Co=Y.default=void 0,me=be(So()),$e=n;Co=Y.default=(0,me.default)((0,$e.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext");function ze({title:o,breadcrumbs:e=[],action:t}){return n.jsxs(Mo,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,sx:{mb:3},children:[n.jsxs(so,{children:[n.jsx(J,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:o}),e.length>0&&n.jsxs(te,{separator:n.jsx(Co,{fontSize:"small"}),sx:{mt:.5},children:[n.jsx(co,{component:io,to:"/dashboard",underline:"hover",color:"text.secondary",variant:"caption",children:"Home"}),e.map((a,r)=>a.to&&r{const{classes:o}=t,u=st({root:["root"]},Pt,o);return s({},o,u)},Rt=B(dt,{shouldForwardProp:t=>gt(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,o)=>o.root})({}),Zt=F.forwardRef(function(o,p){const u=et({props:o,name:"MuiDialogContentText"}),{className:x}=u,v=V(u,ft),P=It(v);return e.jsx(Rt,s({component:"p",variant:"body1",color:"text.secondary",ref:p,ownerState:v,className:y(P.root,x)},u,{classes:P}))}),Tt=H(e.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),Ct=H(e.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),Lt=H(e.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),Mt=H(e.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),jt=["backIconButtonProps","count","disabled","getItemAriaLabel","nextIconButtonProps","onPageChange","page","rowsPerPage","showFirstButton","showLastButton","slots","slotProps"],wt=F.forwardRef(function(o,p){var u,x,v,P,$,D,I,d;const{backIconButtonProps:k,count:R,disabled:T=!1,getItemAriaLabel:g,nextIconButtonProps:U,onPageChange:C,page:a,rowsPerPage:h,showFirstButton:m,showLastButton:L,slots:b={},slotProps:n={}}=o,K=V(o,jt),l=bt(),q=f=>{C(f,0)},E=f=>{C(f,a-1)},M=f=>{C(f,a+1)},i=f=>{C(f,Math.max(0,Math.ceil(R/h)-1))},r=(u=b.firstButton)!=null?u:z,j=(x=b.lastButton)!=null?x:z,w=(v=b.nextButton)!=null?v:z,N=(P=b.previousButton)!=null?P:z,S=($=b.firstButtonIcon)!=null?$:Tt,A=(D=b.lastButtonIcon)!=null?D:Ct,c=(I=b.nextButtonIcon)!=null?I:Mt,O=(d=b.previousButtonIcon)!=null?d:Lt,lt=l?j:r,it=l?w:N,rt=l?N:w,ct=l?r:j,ut=l?n.lastButton:n.firstButton,Q=l?n.nextButton:n.previousButton,X=l?n.previousButton:n.nextButton,pt=l?n.firstButton:n.lastButton;return e.jsxs("div",s({ref:p},K,{children:[m&&e.jsx(lt,s({onClick:q,disabled:T||a===0,"aria-label":g("first",a),title:g("first",a)},ut,{children:l?e.jsx(A,s({},n.lastButtonIcon)):e.jsx(S,s({},n.firstButtonIcon))})),e.jsx(it,s({onClick:E,disabled:T||a===0,color:"inherit","aria-label":g("previous",a),title:g("previous",a)},Q??k,{children:l?e.jsx(c,s({},n.nextButtonIcon)):e.jsx(O,s({},n.previousButtonIcon))})),e.jsx(rt,s({onClick:M,disabled:T||(R!==-1?a>=Math.ceil(R/h)-1:!1),color:"inherit","aria-label":g("next",a),title:g("next",a)},X??U,{children:l?e.jsx(O,s({},n.previousButtonIcon)):e.jsx(c,s({},n.nextButtonIcon))})),L&&e.jsx(ct,s({onClick:i,disabled:T||a>=Math.ceil(R/h)-1,"aria-label":g("last",a),title:g("last",a)},pt,{children:l?e.jsx(S,s({},n.firstButtonIcon)):e.jsx(A,s({},n.lastButtonIcon))}))]}))});function St(t){return tt("MuiTablePagination",t)}const _=ot("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var Z;const yt=["ActionsComponent","backIconButtonProps","className","colSpan","component","count","disabled","getItemAriaLabel","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onPageChange","onRowsPerPageChange","page","rowsPerPage","rowsPerPageOptions","SelectProps","showFirstButton","showLastButton","slotProps","slots"],_t=B(G,{name:"MuiTablePagination",slot:"Root",overridesResolver:(t,o)=>o.root})(({theme:t})=>({overflow:"auto",color:(t.vars||t).palette.text.primary,fontSize:t.typography.pxToRem(14),"&:last-child":{padding:0}})),$t=B(Bt,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(t,o)=>s({[`& .${_.actions}`]:o.actions},o.toolbar)})(({theme:t})=>({minHeight:52,paddingRight:2,[`${t.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[t.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${_.actions}`]:{flexShrink:0,marginLeft:20}})),Dt=B("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(t,o)=>o.spacer})({flex:"1 1 100%"}),kt=B("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(t,o)=>o.selectLabel})(({theme:t})=>s({},t.typography.body2,{flexShrink:0})),Nt=B(vt,{name:"MuiTablePagination",slot:"Select",overridesResolver:(t,o)=>s({[`& .${_.selectIcon}`]:o.selectIcon,[`& .${_.select}`]:o.select},o.input,o.selectRoot)})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${_.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),At=B(mt,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(t,o)=>o.menuItem})({}),zt=B("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(t,o)=>o.displayedRows})(({theme:t})=>s({},t.typography.body2,{flexShrink:0}));function Ft({from:t,to:o,count:p}){return`${t}–${o} of ${p!==-1?p:`more than ${o}`}`}function Ht(t){return`Go to ${t} page`}const Ut=t=>{const{classes:o}=t;return st({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},St,o)},to=F.forwardRef(function(o,p){var u;const x=et({props:o,name:"MuiTablePagination"}),{ActionsComponent:v=wt,backIconButtonProps:P,className:$,colSpan:D,component:I=G,count:d,disabled:k=!1,getItemAriaLabel:R=Ht,labelDisplayedRows:T=Ft,labelRowsPerPage:g="Rows per page:",nextIconButtonProps:U,onPageChange:C,onRowsPerPageChange:a,page:h,rowsPerPage:m,rowsPerPageOptions:L=[10,25,50,100],SelectProps:b={},showFirstButton:n=!1,showLastButton:K=!1,slotProps:l={},slots:q={}}=x,E=V(x,yt),M=x,i=Ut(M),r=(u=l==null?void 0:l.select)!=null?u:b,j=r.native?"option":At;let w;(I===G||I==="td")&&(w=D||1e3);const N=Y(r.id),S=Y(r.labelId),A=()=>d===-1?(h+1)*m:m===-1?d:Math.min(d,(h+1)*m);return e.jsx(_t,s({colSpan:w,ref:p,as:I,ownerState:M,className:y(i.root,$)},E,{children:e.jsxs($t,{className:i.toolbar,children:[e.jsx(Dt,{className:i.spacer}),L.length>1&&e.jsx(kt,{className:i.selectLabel,id:S,children:g}),L.length>1&&e.jsx(Nt,s({variant:"standard"},!r.variant&&{input:Z||(Z=e.jsx(ht,{}))},{value:m,onChange:a,id:N,labelId:S},r,{classes:s({},r.classes,{root:y(i.input,i.selectRoot,(r.classes||{}).root),select:y(i.select,(r.classes||{}).select),icon:y(i.selectIcon,(r.classes||{}).icon)}),disabled:k,children:L.map(c=>F.createElement(j,s({},!xt(j)&&{ownerState:M},{className:i.menuItem,key:c.label?c.label:c,value:c.value?c.value:c}),c.label?c.label:c))})),e.jsx(zt,{className:i.displayedRows,children:T({from:d===0?0:h*m+1,to:A(),count:d===-1?-1:d,page:h})}),e.jsx(v,{className:i.actions,backIconButtonProps:P,count:d,nextIconButtonProps:U,onPageChange:C,page:h,rowsPerPage:m,showFirstButton:n,showLastButton:K,slotProps:l.actions,slots:q.actions,getItemAriaLabel:R,disabled:k})]})}))});var W={},Kt=at;Object.defineProperty(W,"__esModule",{value:!0});var qt=W.default=void 0,Et=Kt(nt()),Gt=e;qt=W.default=(0,Et.default)((0,Gt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline");var J={},Vt=at;Object.defineProperty(J,"__esModule",{value:!0});var Wt=J.default=void 0,Jt=Vt(nt()),Ot=e;Wt=J.default=(0,Jt.default)((0,Ot.jsx)("path",{d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79zm9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75zM7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1"}),"PhoneOutlined");export{Zt as D,Lt as K,to as T,qt as a,Mt as b,Wt as d}; +import{l as tt,m as ot,a as F,n as et,o as V,j as e,_ as s,p as y,v as st,w as B,T as dt,a4 as gt,a5 as H,a0 as bt,I as z,u as Y,a6 as ht,a7 as xt,M as mt,a8 as Bt,r as nt,i as at}from"./index-J0uxx8As.js";import{T as G}from"./TableCell-dI-OU86K.js";import{S as vt}from"./TextField-BARvBB_z.js";function Pt(t){return tt("MuiDialogContentText",t)}ot("MuiDialogContentText",["root"]);const ft=["children","className"],It=t=>{const{classes:o}=t,u=st({root:["root"]},Pt,o);return s({},o,u)},Rt=B(dt,{shouldForwardProp:t=>gt(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,o)=>o.root})({}),Zt=F.forwardRef(function(o,p){const u=et({props:o,name:"MuiDialogContentText"}),{className:x}=u,v=V(u,ft),P=It(v);return e.jsx(Rt,s({component:"p",variant:"body1",color:"text.secondary",ref:p,ownerState:v,className:y(P.root,x)},u,{classes:P}))}),Tt=H(e.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),Ct=H(e.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),Lt=H(e.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),Mt=H(e.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),jt=["backIconButtonProps","count","disabled","getItemAriaLabel","nextIconButtonProps","onPageChange","page","rowsPerPage","showFirstButton","showLastButton","slots","slotProps"],wt=F.forwardRef(function(o,p){var u,x,v,P,$,D,I,d;const{backIconButtonProps:k,count:R,disabled:T=!1,getItemAriaLabel:g,nextIconButtonProps:U,onPageChange:C,page:a,rowsPerPage:h,showFirstButton:m,showLastButton:L,slots:b={},slotProps:n={}}=o,K=V(o,jt),l=bt(),q=f=>{C(f,0)},E=f=>{C(f,a-1)},M=f=>{C(f,a+1)},i=f=>{C(f,Math.max(0,Math.ceil(R/h)-1))},r=(u=b.firstButton)!=null?u:z,j=(x=b.lastButton)!=null?x:z,w=(v=b.nextButton)!=null?v:z,N=(P=b.previousButton)!=null?P:z,S=($=b.firstButtonIcon)!=null?$:Tt,A=(D=b.lastButtonIcon)!=null?D:Ct,c=(I=b.nextButtonIcon)!=null?I:Mt,O=(d=b.previousButtonIcon)!=null?d:Lt,lt=l?j:r,it=l?w:N,rt=l?N:w,ct=l?r:j,ut=l?n.lastButton:n.firstButton,Q=l?n.nextButton:n.previousButton,X=l?n.previousButton:n.nextButton,pt=l?n.firstButton:n.lastButton;return e.jsxs("div",s({ref:p},K,{children:[m&&e.jsx(lt,s({onClick:q,disabled:T||a===0,"aria-label":g("first",a),title:g("first",a)},ut,{children:l?e.jsx(A,s({},n.lastButtonIcon)):e.jsx(S,s({},n.firstButtonIcon))})),e.jsx(it,s({onClick:E,disabled:T||a===0,color:"inherit","aria-label":g("previous",a),title:g("previous",a)},Q??k,{children:l?e.jsx(c,s({},n.nextButtonIcon)):e.jsx(O,s({},n.previousButtonIcon))})),e.jsx(rt,s({onClick:M,disabled:T||(R!==-1?a>=Math.ceil(R/h)-1:!1),color:"inherit","aria-label":g("next",a),title:g("next",a)},X??U,{children:l?e.jsx(O,s({},n.previousButtonIcon)):e.jsx(c,s({},n.nextButtonIcon))})),L&&e.jsx(ct,s({onClick:i,disabled:T||a>=Math.ceil(R/h)-1,"aria-label":g("last",a),title:g("last",a)},pt,{children:l?e.jsx(S,s({},n.firstButtonIcon)):e.jsx(A,s({},n.lastButtonIcon))}))]}))});function St(t){return tt("MuiTablePagination",t)}const _=ot("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var Z;const yt=["ActionsComponent","backIconButtonProps","className","colSpan","component","count","disabled","getItemAriaLabel","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onPageChange","onRowsPerPageChange","page","rowsPerPage","rowsPerPageOptions","SelectProps","showFirstButton","showLastButton","slotProps","slots"],_t=B(G,{name:"MuiTablePagination",slot:"Root",overridesResolver:(t,o)=>o.root})(({theme:t})=>({overflow:"auto",color:(t.vars||t).palette.text.primary,fontSize:t.typography.pxToRem(14),"&:last-child":{padding:0}})),$t=B(Bt,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(t,o)=>s({[`& .${_.actions}`]:o.actions},o.toolbar)})(({theme:t})=>({minHeight:52,paddingRight:2,[`${t.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[t.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${_.actions}`]:{flexShrink:0,marginLeft:20}})),Dt=B("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(t,o)=>o.spacer})({flex:"1 1 100%"}),kt=B("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(t,o)=>o.selectLabel})(({theme:t})=>s({},t.typography.body2,{flexShrink:0})),Nt=B(vt,{name:"MuiTablePagination",slot:"Select",overridesResolver:(t,o)=>s({[`& .${_.selectIcon}`]:o.selectIcon,[`& .${_.select}`]:o.select},o.input,o.selectRoot)})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${_.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),At=B(mt,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(t,o)=>o.menuItem})({}),zt=B("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(t,o)=>o.displayedRows})(({theme:t})=>s({},t.typography.body2,{flexShrink:0}));function Ft({from:t,to:o,count:p}){return`${t}–${o} of ${p!==-1?p:`more than ${o}`}`}function Ht(t){return`Go to ${t} page`}const Ut=t=>{const{classes:o}=t;return st({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},St,o)},to=F.forwardRef(function(o,p){var u;const x=et({props:o,name:"MuiTablePagination"}),{ActionsComponent:v=wt,backIconButtonProps:P,className:$,colSpan:D,component:I=G,count:d,disabled:k=!1,getItemAriaLabel:R=Ht,labelDisplayedRows:T=Ft,labelRowsPerPage:g="Rows per page:",nextIconButtonProps:U,onPageChange:C,onRowsPerPageChange:a,page:h,rowsPerPage:m,rowsPerPageOptions:L=[10,25,50,100],SelectProps:b={},showFirstButton:n=!1,showLastButton:K=!1,slotProps:l={},slots:q={}}=x,E=V(x,yt),M=x,i=Ut(M),r=(u=l==null?void 0:l.select)!=null?u:b,j=r.native?"option":At;let w;(I===G||I==="td")&&(w=D||1e3);const N=Y(r.id),S=Y(r.labelId),A=()=>d===-1?(h+1)*m:m===-1?d:Math.min(d,(h+1)*m);return e.jsx(_t,s({colSpan:w,ref:p,as:I,ownerState:M,className:y(i.root,$)},E,{children:e.jsxs($t,{className:i.toolbar,children:[e.jsx(Dt,{className:i.spacer}),L.length>1&&e.jsx(kt,{className:i.selectLabel,id:S,children:g}),L.length>1&&e.jsx(Nt,s({variant:"standard"},!r.variant&&{input:Z||(Z=e.jsx(ht,{}))},{value:m,onChange:a,id:N,labelId:S},r,{classes:s({},r.classes,{root:y(i.input,i.selectRoot,(r.classes||{}).root),select:y(i.select,(r.classes||{}).select),icon:y(i.selectIcon,(r.classes||{}).icon)}),disabled:k,children:L.map(c=>F.createElement(j,s({},!xt(j)&&{ownerState:M},{className:i.menuItem,key:c.label?c.label:c,value:c.value?c.value:c}),c.label?c.label:c))})),e.jsx(zt,{className:i.displayedRows,children:T({from:d===0?0:h*m+1,to:A(),count:d===-1?-1:d,page:h})}),e.jsx(v,{className:i.actions,backIconButtonProps:P,count:d,nextIconButtonProps:U,onPageChange:C,page:h,rowsPerPage:m,showFirstButton:n,showLastButton:K,slotProps:l.actions,slots:q.actions,getItemAriaLabel:R,disabled:k})]})}))});var W={},Kt=at;Object.defineProperty(W,"__esModule",{value:!0});var qt=W.default=void 0,Et=Kt(nt()),Gt=e;qt=W.default=(0,Et.default)((0,Gt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline");var J={},Vt=at;Object.defineProperty(J,"__esModule",{value:!0});var Wt=J.default=void 0,Jt=Vt(nt()),Ot=e;Wt=J.default=(0,Jt.default)((0,Ot.jsx)("path",{d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79zm9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75zM7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1"}),"PhoneOutlined");export{Zt as D,Lt as K,to as T,qt as a,Mt as b,Wt as d}; diff --git a/dist/assets/Pricing-BbUkW6tl.js b/dist/assets/Pricing-BbUkW6tl.js deleted file mode 100644 index 5afc837..0000000 --- a/dist/assets/Pricing-BbUkW6tl.js +++ /dev/null @@ -1 +0,0 @@ -import{r as ae,j as e,i as ne,a as d,B as h,T as f,M,N as a,H as le,S as F,Q as ce,L as de,C as xe,K as he,c as ge,I as pe}from"./index-Dg-wT72v.js";import{d as ue,e as X,D as fe,a as me,b as be,c as ye}from"./EditOutlined-COfONJBH.js";import{d as je}from"./Close-DKUHif5O.js";import{e as ve,c as Se,b as Y,d as we,a as Ce}from"./StorefrontOutlined-BR_dFc0C.js";import{P as We,a as $,A as Re,G as W}from"./PageHeader-DgkErsA7.js";import{C as U}from"./Link-CndAQvyC.js";import{F as Ie,S as _e,O as ke,T as E}from"./TextField-COVOKpzm.js";import{I as Ae}from"./InputAdornment-HqPFSHfS.js";import{B as P}from"./Button-COL1_fTB.js";import{T as ze,a as Ee,b as Pe,c as O,d as Te}from"./TableRow-Du7Jvlvh.js";import{T as R}from"./TableCell-ClQIqE-T.js";var G={},Le=ne;Object.defineProperty(G,"__esModule",{value:!0});var ee=G.default=void 0,Be=Le(ae()),Fe=e;ee=G.default=(0,Be.default)((0,Fe.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline");const H="https://api.doormile.com/api/v1",Z=()=>{const t=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{}}};async function $e(){const t=await fetch(`${H}/admin/carrier-pricing?limit=1000`,{headers:Z()});if(!t.ok)throw new Error("Failed to fetch pricing");const l=await t.json();return Array.isArray(l)?{data:l}:l}async function Oe(t){const l=!!t.id,v=l?`${H}/admin/carrier-pricing/${t.id}`:`${H}/admin/carrier-pricing`,m=await fetch(v,{method:l?"PUT":"POST",headers:Z(),body:JSON.stringify({company:t.company,weight_slab:t.weight_slab,zone:t.zone,rate:String(t.rate)})});if(!m.ok){const w=await m.json().catch(()=>({}));throw new Error(w.error||w.message||"Failed to save pricing")}return m.status===204?{}:m.json().catch(()=>({}))}const Me=["Local / Same","Within Tamilnadu","Interstate India"],He=["< 500g","500g - 1kg","1kg - 2kg","2kg - 5kg","> 5kg"];function Ne({open:t,onClose:l,onSave:v,initialData:p,isCell:m=!1,pricingList:w=[]}){const[o,I]=d.useState({}),[y,T]=d.useState(!1),[u,b]=d.useState(null);d.useEffect(()=>{t&&(I(p||{company:"",weight_slab:"",zone:"",rate:""}),b(null))},[t,p]);const C=n=>i=>I(S=>({...S,[n]:i.target.value})),_=n=>{const i=(n.company||"").trim(),S=(n.weight_slab||"").trim(),g=(n.zone||"").trim();return w.find(j=>(j.company||"").trim()===i&&(j.weight_slab||"").trim()===S&&(j.zone||"").trim()===g)||null},N=async()=>{var n,i,S;if(!m){if(!((n=o.company)!=null&&n.trim())){b("Company is required.");return}if(!((i=o.weight_slab)!=null&&i.trim())){b("Weight slab is required.");return}if(!((S=o.zone)!=null&&S.trim())){b("Zone is required.");return}}if(!String(o.rate??"").trim()){b("Rate is required.");return}T(!0),b(null);try{let g={...o};if(!g.id){const j=_(g);j&&(g={...g,id:j.id})}await Oe(g),v(),l()}catch(g){console.error(g),b(g.message||"Failed to save. Please try again.")}finally{T(!1)}};return e.jsxs(fe,{open:t,onClose:y?void 0:l,maxWidth:"xs",fullWidth:!0,children:[e.jsxs(me,{sx:{fontWeight:800,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[m?p!=null&&p.id?"Edit Rate":"Add Rate":p!=null&&p.id?"Edit Rate":"Add New Rate",e.jsx(pe,{size:"small",onClick:l,disabled:y,children:e.jsx(je,{fontSize:"small"})})]}),e.jsxs(be,{dividers:!0,children:[u&&e.jsx(Re,{severity:"error",sx:{mb:2},children:u}),e.jsxs(W,{container:!0,spacing:2,children:[m?e.jsx(W,{item:!0,xs:12,children:e.jsxs(h,{sx:{p:1.5,borderRadius:2,bgcolor:a("#c01227",.04),border:"1px solid",borderColor:a("#c01227",.15),mb:.5},children:[e.jsx(f,{variant:"caption",sx:{fontWeight:700,color:"grey.500",letterSpacing:.5,display:"block",mb:.5},children:"UPDATING RATE FOR"}),e.jsx(f,{variant:"subtitle2",sx:{fontWeight:700,color:"grey.900"},children:o.company}),e.jsxs(f,{variant:"body2",sx:{color:"grey.600",mt:.25},children:[o.weight_slab," · ",o.zone]})]})}):e.jsxs(e.Fragment,{children:[e.jsx(W,{item:!0,xs:12,children:e.jsx(E,{fullWidth:!0,label:"Company *",value:o.company||"",onChange:C("company"),size:"small"})}),e.jsx(W,{item:!0,xs:12,children:e.jsx(E,{select:!0,fullWidth:!0,label:"Weight Slab *",value:o.weight_slab||"",onChange:C("weight_slab"),size:"small",children:He.map(n=>e.jsx(M,{value:n,children:n},n))})}),e.jsx(W,{item:!0,xs:12,children:e.jsx(E,{select:!0,fullWidth:!0,label:"Zone *",value:o.zone||"",onChange:C("zone"),size:"small",children:Me.map(n=>e.jsx(M,{value:n,children:n},n))})})]}),e.jsx(W,{item:!0,xs:12,children:e.jsx(E,{fullWidth:!0,label:"Rate (₹) *",value:o.rate||"",onChange:C("rate"),size:"small",placeholder:"e.g. 25 or 25-35",autoFocus:!0})})]})]}),e.jsxs(ye,{sx:{p:2,bgcolor:"grey.50"},children:[e.jsx(P,{onClick:l,disabled:y,color:"inherit",children:"Cancel"}),e.jsx(P,{onClick:N,disabled:y,variant:"contained",sx:{bgcolor:"#c01227","&:hover":{bgcolor:"#a00f20"},borderRadius:2},children:y?"Saving...":"Save Rate"})]})]})}async function qe(){const t=await fetch(`${H}/admin/competitor-branches?limit=1000`,{headers:Z()});if(!t.ok)throw new Error("Failed to fetch surveys");const l=await t.json(),v=Array.isArray(l)?l:l.data||[];return{data:v,total:v.length}}function rr(){const[t,l]=d.useState([]),[v,p]=d.useState([]),[m,w]=d.useState(!0),[o,I]=d.useState(""),[y,T]=d.useState(""),[u,b]=d.useState(!1),[C,_]=d.useState(!1),[N,n]=d.useState(null),[i,S]=d.useState(!1),[g,j]=d.useState(!1),[re,te]=d.useState([]),Q=()=>{let r=!1;return w(!0),Promise.all([$e().catch(()=>({data:[]})),qe().catch(()=>({data:[]})),ge().catch(()=>[])]).then(([s,c,x])=>{r||(l(Array.isArray(s)?s:s.data||[]),p(c.data||c||[]),te(Array.isArray(x)?x:x.data||[]))}).catch(s=>console.error("Failed to fetch data",s)).finally(()=>{r||w(!1)}),()=>{r=!0}};d.useEffect(()=>Q(),[]);const k=[...new Set(t.map(r=>r.company).filter(Boolean))];d.useEffect(()=>{!o&&k.length>0&&I(k[0])},[k,o]);const oe=t.filter(r=>r.company===o),L=v.filter(r=>(r.company||"").toLowerCase()===(o||"").toLowerCase()),q=[...oe].sort((r,s)=>(s.id||0)-(r.id||0)),V=r=>{const s=(r||"").toLowerCase().replace(/\s+/g,""),c=s.match(/[\d.]+/g);if(!c)return 9999;const x=parseFloat(c[0]),A=s.includes("kg")?x*1e3:x;return s.startsWith("<")||s.startsWith("upto")?A-.5:s.startsWith(">")||s.includes("above")||s.endsWith("+")?A+.5:A},B=[...new Set(q.map(r=>(r.zone||"").trim()).filter(Boolean))].sort(),J=[...new Set(q.map(r=>(r.weight_slab||"").trim()).filter(Boolean))].sort((r,s)=>V(r)-V(s)),K=y?J.filter(r=>r.toLowerCase().includes(y.toLowerCase())):J;return e.jsxs(h,{sx:{pb:6,minHeight:"80vh",bgcolor:"#f8fafc",px:{xs:2,md:4},pt:3},children:[e.jsx(We,{title:"Logistics Pricing Board",breadcrumbs:[{label:"Pricing Overview"}]}),e.jsxs(h,{sx:{display:"flex",flexDirection:"column",gap:4,mt:3,maxWidth:1200,mx:"auto"},children:[e.jsxs(U,{sx:{p:3,borderRadius:4,bgcolor:"#ffffff",boxShadow:"0 20px 40px -10px rgba(0,0,0,0.03)",border:"1px solid",borderColor:"grey.100",display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",justifyContent:"space-between",gap:3},children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",gap:2,width:{xs:"100%",md:"auto"}},children:[e.jsx(h,{sx:{width:48,height:48,borderRadius:3,bgcolor:"primary.lighter",color:"primary.main",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(ve,{})}),e.jsxs(h,{children:[e.jsx(f,{variant:"caption",sx:{fontWeight:700,color:"text.secondary",letterSpacing:.8,textTransform:"uppercase"},children:"Active Logistics Provider"}),e.jsx(Ie,{sx:{mt:.5,minWidth:260,display:"block"},children:e.jsx(_e,{value:o||"",onChange:r=>I(r.target.value),displayEmpty:!0,IconComponent:Se,input:e.jsx(ke,{sx:{borderRadius:3,fontWeight:700,fontSize:"1.1rem",bgcolor:a("#e2e8f0",.4),"& fieldset":{border:"none"},"&:hover":{bgcolor:a("#e2e8f0",.6)},"&.Mui-focused":{bgcolor:"#fff","& fieldset":{border:"2px solid",borderColor:"primary.main"}}}}),MenuProps:{PaperProps:{sx:{borderRadius:3,mt:1,boxShadow:"0 12px 24px rgba(0,0,0,0.1)"}}},children:k.length===0?e.jsx(M,{value:"",disabled:!0,children:"Loading Providers..."}):k.map(r=>e.jsx(M,{value:r,sx:{fontWeight:600,py:1.5,borderRadius:1,mx:1},children:r},r))})})]})]}),e.jsxs(h,{sx:{display:"flex",gap:2,alignItems:"center"},children:[e.jsx(E,{placeholder:"Search weight slabs...",value:y,onChange:r=>T(r.target.value),InputProps:{startAdornment:e.jsx(Ae,{position:"start",children:e.jsx(le,{color:"primary"})}),sx:{borderRadius:50,bgcolor:a("#e2e8f0",.3),"& fieldset":{border:"none"},"&:hover":{bgcolor:a("#e2e8f0",.5)},"&.Mui-focused":{bgcolor:"#fff","& fieldset":{border:"2px solid",borderColor:"primary.main"}}}}}),e.jsx(P,{variant:"contained",startIcon:e.jsx(ue,{}),onClick:()=>{n({company:o,weight_slab:"",zone:"",rate:""}),j(!1),_(!0)},sx:{bgcolor:"#c01227","&:hover":{bgcolor:"#a00f20"},borderRadius:2,py:1.2,fontWeight:700,whiteSpace:"nowrap"},children:"Add Rate"}),e.jsx(P,{variant:i?"contained":"outlined",startIcon:e.jsx(X,{}),onClick:()=>S(!i),sx:{borderRadius:2,py:1.2,fontWeight:700,whiteSpace:"nowrap",color:i?"white":"grey.700",borderColor:i?"transparent":"grey.300",bgcolor:i?"grey.800":"transparent","&:hover":{bgcolor:i?"grey.900":a("#000",.05),borderColor:i?"transparent":"grey.400"}},children:i?"Done":"Edit"})]})]}),o&&L.length>0&&e.jsxs(U,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:u?"#c01227":"grey.200",bgcolor:"white",transition:"border-color 0.3s ease, box-shadow 0.3s ease","&:hover":{borderColor:"#c01227",boxShadow:"0 8px 30px rgba(192, 18, 39, 0.08)"}},children:[e.jsxs(F,{direction:{xs:"column",md:"row"},spacing:4,sx:{p:{xs:3,md:3.5},cursor:"pointer",userSelect:"none"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",onClick:()=>b(!u),children:[e.jsxs(F,{direction:"row",spacing:3,alignItems:"center",sx:{minWidth:260},children:[e.jsx(ce,{sx:{width:68,height:68,bgcolor:a("#c01227",.08),color:"#c01227",fontWeight:800,fontSize:"1.8rem",borderRadius:3},children:(o||"A")[0].toUpperCase()}),e.jsxs(h,{children:[e.jsx(f,{variant:"overline",sx:{color:"grey.500",fontWeight:700,letterSpacing:1.2},children:"LOGISTICS PARTNER"}),e.jsx(f,{variant:"h5",sx:{fontWeight:800,color:"grey.900",lineHeight:1.1,mt:.25},children:o}),e.jsxs(f,{variant:"body2",sx:{color:"grey.600",mt:1,fontWeight:500,display:"flex",alignItems:"center"},children:[e.jsx(Y,{sx:{fontSize:16,mr:.5,color:"#c01227"}}),L.length," Registered Location",L.length!==1&&"s"]})]})]}),e.jsxs(F,{direction:"row",spacing:3,alignItems:"center",children:[e.jsxs(F,{direction:"row",spacing:1,sx:{display:{xs:"none",md:"flex"}},children:[e.jsx($,{size:"small",label:"First Mile",sx:{bgcolor:a("#c01227",.08),color:"#c01227",fontWeight:700,borderRadius:1.5}}),e.jsx($,{size:"small",label:"Mid Mile",sx:{bgcolor:a("#c01227",.08),color:"#c01227",fontWeight:700,borderRadius:1.5}}),e.jsx($,{size:"small",label:"Last Mile",sx:{bgcolor:a("#c01227",.08),color:"#c01227",fontWeight:700,borderRadius:1.5}})]}),e.jsx(P,{onClick:r=>{r.stopPropagation(),b(!u)},sx:{borderRadius:2,py:1,px:3,fontWeight:700,color:u?"#c01227":"grey.700",bgcolor:u?a("#c01227",.1):"grey.100","&:hover":{bgcolor:a("#c01227",.15),color:"#c01227"}},endIcon:u?e.jsx(we,{}):e.jsx(Ce,{}),children:u?"Hide Coverage":"View Coverage Map"})]})]}),e.jsx(de,{in:u,timeout:"auto",unmountOnExit:!0,children:e.jsxs(h,{sx:{p:3,pt:0,borderTop:"1px dashed",borderColor:"grey.200",bgcolor:"grey.50",borderBottomLeftRadius:16,borderBottomRightRadius:16},children:[e.jsxs(h,{sx:{display:"flex",alignItems:"center",mb:2,mt:3},children:[e.jsx(Y,{sx:{color:"#c01227",fontSize:20,mr:1}}),e.jsx(f,{variant:"caption",sx:{color:"grey.600",fontWeight:700,letterSpacing:1},children:"ALL SERVICED AREAS:"})]}),e.jsx(h,{sx:{display:"flex",gap:1.5,flexWrap:"wrap"},children:L.map((r,s)=>e.jsx($,{label:r.area||r.address,sx:{borderRadius:2,fontWeight:600,px:1,py:2.5,bgcolor:"white",color:"grey.800",border:"1px solid",borderColor:"grey.300",boxShadow:"0 2px 8px rgba(0,0,0,0.02)","&:hover":{borderColor:"#c01227",color:"#c01227",bgcolor:a("#c01227",.05),boxShadow:"0 4px 12px rgba(192,18,39,0.08)"},transition:"border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease"}},r.id??s))})]})})]}),e.jsx(U,{sx:{borderRadius:4,boxShadow:"0 24px 48px -12px rgba(0,0,0,0.05)",border:"1px solid",borderColor:"grey.200",overflow:"hidden",bgcolor:"#fff"},children:m?e.jsx(h,{sx:{display:"flex",justifyContent:"center",alignItems:"center",py:10},children:e.jsx(xe,{size:48,thickness:4,sx:{color:"primary.light"}})}):e.jsx(ze,{children:e.jsxs(Ee,{sx:{minWidth:700},children:[e.jsx(Pe,{children:e.jsxs(O,{sx:{bgcolor:a("#f8fafc",.8)},children:[e.jsx(R,{sx:{py:2,px:4,fontWeight:700,color:"grey.500",fontSize:"0.75rem",letterSpacing:1.2,textTransform:"uppercase",borderBottom:"2px solid",borderColor:"grey.100"},children:"Weight Slab"}),B.map(r=>e.jsx(R,{align:"center",sx:{py:2,fontWeight:700,color:"grey.500",fontSize:"0.75rem",letterSpacing:1.2,textTransform:"uppercase",borderBottom:"2px solid",borderColor:"grey.100"},children:r},r))]})}),e.jsx(Te,{children:B.length===0?e.jsx(O,{children:e.jsx(R,{colSpan:2,align:"center",sx:{py:8},children:e.jsx(f,{variant:"body1",color:"text.secondary",sx:{fontWeight:500},children:"No pricing data for this provider yet."})})}):K.length===0?e.jsx(O,{children:e.jsx(R,{colSpan:B.length+1,align:"center",sx:{py:8},children:e.jsx(f,{variant:"body1",color:"text.secondary",sx:{fontWeight:500},children:"No weight slabs match your search."})})}):K.map(r=>e.jsxs(O,{sx:{transition:"background-color 0.15s","&:hover":{bgcolor:a("#f1f5f9",.5)},"&:last-child td":{borderBottom:0}},children:[e.jsx(R,{sx:{px:4,py:2,fontWeight:600,color:"grey.800",fontSize:"0.9rem",borderBottom:"1px solid",borderColor:"grey.100"},children:r}),B.map(s=>{const c=q.find(z=>(z.weight_slab||"").trim()===r&&(z.zone||"").trim()===s),x=!!c,A=c?`₹${c.rate}`:"—";let D="";if(c&&c.updated_by){const z=re.find(ie=>ie.id===c.updated_by);D=`Last updated by: ${z?z.first_name:"ID "+c.updated_by}`}const se=()=>{n({id:c?c.id:void 0,company:o,weight_slab:r,zone:s,rate:c?String(c.rate):""}),j(!0),_(!0)};return e.jsx(R,{align:"center",sx:{py:1.5,borderBottom:"1px solid",borderColor:"grey.100",cursor:i?"pointer":"default",transition:"background 0.15s","&:hover":i?{bgcolor:a("#c01227",.04)}:{}},onClick:i?se:void 0,children:e.jsx(he,{title:i?x?"Click to edit rate":"Click to add rate":D,placement:"top",arrow:!0,disableHoverListener:!i&&!D,children:e.jsxs(h,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[e.jsx(f,{sx:{display:"inline-block",fontWeight:x?700:400,color:x?"success.dark":i?a("#c01227",.4):"grey.300",fontSize:x?"0.95rem":"0.85rem",bgcolor:x?a("#10b981",.08):"transparent",px:x?1.5:0,py:x?.5:0,borderRadius:2},children:A}),i&&(x?e.jsx(X,{sx:{fontSize:13,color:"grey.400"}}):e.jsx(ee,{sx:{fontSize:13,color:a("#c01227",.4)}}))]})})},s)})]},r))})]})})})]}),e.jsx(Ne,{open:C,onClose:()=>_(!1),onSave:()=>Q(),initialData:N,isCell:g,pricingList:t})]})}export{rr as default}; diff --git a/dist/assets/Pricing-DRDC22ok.js b/dist/assets/Pricing-DRDC22ok.js new file mode 100644 index 0000000..cba759f --- /dev/null +++ b/dist/assets/Pricing-DRDC22ok.js @@ -0,0 +1 @@ +import{r as le,j as e,i as ce,a as d,B as u,T as j,M as D,N as a,H as de,S as H,Q as xe,L as ge,C as he,K as pe,c as ue,I as fe}from"./index-J0uxx8As.js";import{d as me,e as te,D as be,a as ye,b as je,c as ve}from"./EditOutlined-CLycK5tS.js";import{d as Se}from"./Close-DtPVHjo-.js";import{e as we,c as Ce,b as oe,d as _e,a as We}from"./StorefrontOutlined-C6lTcD4z.js";import{P as Re,a as N,A as Ie,G as W}from"./PageHeader-TW1dMGrU.js";import{C as U}from"./Link-DdF3Xu1F.js";import{F as ke,S as Ae,O as ze,T as B}from"./TextField-BARvBB_z.js";import{I as Ee}from"./InputAdornment-Cbcw8oJa.js";import{B as F}from"./Button-BkRsd5c4.js";import{T as Pe,a as Te,b as Le,c as q,d as Be}from"./TableRow-DryS4Frn.js";import{T as R}from"./TableCell-dI-OU86K.js";var V={},Fe=ce;Object.defineProperty(V,"__esModule",{value:!0});var se=V.default=void 0,$e=Fe(le()),Oe=e;se=V.default=(0,$e.default)((0,Oe.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline");const G="https://api.doormile.com/api/v1",J=()=>{const o=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...o?{Authorization:`Bearer ${o}`}:{}}};async function Me(){const o=await fetch(`${G}/admin/carrier-pricing?limit=1000`,{headers:J()});if(!o.ok)throw new Error("Failed to fetch pricing");const l=await o.json();return Array.isArray(l)?{data:l}:l}async function He(o){const l=!!o.id,S=l?`${G}/admin/carrier-pricing/${o.id}`:`${G}/admin/carrier-pricing`,m=await fetch(S,{method:l?"PUT":"POST",headers:J(),body:JSON.stringify({company:o.company,weight_slab:o.weight_slab,zone:o.zone||"",service_type:o.service_type||"",rate:String(o.rate)})});if(!m.ok){const _=await m.json().catch(()=>({}));throw new Error(_.error||_.message||"Failed to save pricing")}return m.status===204?{}:m.json().catch(()=>({}))}const Ne=["Local / Same","Within Tamilnadu","Interstate India"],qe=["< 500g","500g - 1kg","1kg - 2kg","2kg - 5kg","> 5kg"];function De({open:o,onClose:l,onSave:S,initialData:f,isCell:m=!1,pricingList:_=[],providerColumns:p=[],providerUsesServiceType:w=!1}){const[n,I]=d.useState({}),[h,k]=d.useState(!1),[$,b]=d.useState(null);d.useEffect(()=>{o&&(I(f||{company:"",weight_slab:"",zone:"",rate:""}),b(null))},[o,f]);const A=t=>y=>I(C=>({...C,[t]:y.target.value})),O=t=>(t.zone||"").trim()||(t.service_type||"").trim(),c=t=>{const y=(t.company||"").trim(),C=(t.weight_slab||"").trim(),x=(t.zone||t.service_type||"").trim();return _.find(v=>(v.company||"").trim()===y&&(v.weight_slab||"").trim()===C&&O(v)===x)||null},Z=async()=>{var y,C;const t=(n.zone||n.service_type||"").trim();if(!m){if(!((y=n.company)!=null&&y.trim())){b("Company is required.");return}if(!((C=n.weight_slab)!=null&&C.trim())){b("Weight slab is required.");return}if(!t){b("Zone / Service Type is required.");return}}if(!String(n.rate??"").trim()){b("Rate is required.");return}k(!0),b(null);try{let x={...n};if(m||(x={...x,zone:w?"":t,service_type:w?t:x.service_type||""}),!x.id){const v=c(x);v&&(x={...x,id:v.id})}await He(x),S(),l()}catch(x){console.error(x),b(x.message||"Failed to save. Please try again.")}finally{k(!1)}};return e.jsxs(be,{open:o,onClose:h?void 0:l,maxWidth:"xs",fullWidth:!0,children:[e.jsxs(ye,{sx:{fontWeight:800,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[m?f!=null&&f.id?"Edit Rate":"Add Rate":f!=null&&f.id?"Edit Rate":"Add New Rate",e.jsx(fe,{size:"small",onClick:l,disabled:h,children:e.jsx(Se,{fontSize:"small"})})]}),e.jsxs(je,{dividers:!0,children:[$&&e.jsx(Ie,{severity:"error",sx:{mb:2},children:$}),e.jsxs(W,{container:!0,spacing:2,children:[m?e.jsx(W,{item:!0,xs:12,children:e.jsxs(u,{sx:{p:1.5,borderRadius:2,bgcolor:a("#c01227",.04),border:"1px solid",borderColor:a("#c01227",.15),mb:.5},children:[e.jsx(j,{variant:"caption",sx:{fontWeight:700,color:"grey.500",letterSpacing:.5,display:"block",mb:.5},children:"UPDATING RATE FOR"}),e.jsx(j,{variant:"subtitle2",sx:{fontWeight:700,color:"grey.900"},children:n.company}),e.jsxs(j,{variant:"body2",sx:{color:"grey.600",mt:.25},children:[n.weight_slab," · ",n.zone||n.service_type]})]})}):e.jsxs(e.Fragment,{children:[e.jsx(W,{item:!0,xs:12,children:e.jsx(B,{fullWidth:!0,label:"Company *",value:n.company||"",onChange:A("company"),size:"small"})}),e.jsx(W,{item:!0,xs:12,children:e.jsx(B,{select:!0,fullWidth:!0,label:"Weight Slab *",value:n.weight_slab||"",onChange:A("weight_slab"),size:"small",children:qe.map(t=>e.jsx(D,{value:t,children:t},t))})}),e.jsx(W,{item:!0,xs:12,children:e.jsx(B,{select:!0,fullWidth:!0,label:w?"Service Type *":"Zone / Service Type *",value:n.zone||n.service_type||"",onChange:t=>I(y=>({...y,zone:w?"":t.target.value,service_type:w?t.target.value:""})),size:"small",children:(p.length>0?p:Ne).map(t=>e.jsx(D,{value:t,children:t},t))})})]}),e.jsx(W,{item:!0,xs:12,children:e.jsx(B,{fullWidth:!0,label:"Rate (₹) *",value:n.rate||"",onChange:A("rate"),size:"small",placeholder:"e.g. 25 or 25-35",autoFocus:!0})})]})]}),e.jsxs(ve,{sx:{p:2,bgcolor:"grey.50"},children:[e.jsx(F,{onClick:l,disabled:h,color:"inherit",children:"Cancel"}),e.jsx(F,{onClick:Z,disabled:h,variant:"contained",sx:{bgcolor:"#c01227","&:hover":{bgcolor:"#a00f20"},borderRadius:2},children:h?"Saving...":"Save Rate"})]})]})}async function Ge(){const o=await fetch(`${G}/admin/competitor-branches?limit=1000`,{headers:J()});if(!o.ok)throw new Error("Failed to fetch surveys");const l=await o.json(),S=Array.isArray(l)?l:l.data||[];return{data:S,total:S.length}}function or(){const[o,l]=d.useState([]),[S,f]=d.useState([]),[m,_]=d.useState(!0),[p,w]=d.useState(""),[n,I]=d.useState(""),[h,k]=d.useState(!1),[$,b]=d.useState(!1),[A,O]=d.useState(null),[c,Z]=d.useState(!1),[t,y]=d.useState(!1),[C,x]=d.useState([]),v=()=>{let r=!1;return _(!0),Promise.all([Me().catch(()=>({data:[]})),Ge().catch(()=>({data:[]})),ue().catch(()=>[])]).then(([s,i,g])=>{r||(l(Array.isArray(s)?s:s.data||[]),f(i.data||i||[]),x(Array.isArray(g)?g:g.data||[]))}).catch(s=>console.error("Failed to fetch data",s)).finally(()=>{r||_(!1)}),()=>{r=!0}};d.useEffect(()=>v(),[]);const z=[...new Set(o.map(r=>r.company).filter(Boolean))];d.useEffect(()=>{!p&&z.length>0&&w(z[0])},[z,p]);const ie=o.filter(r=>r.company===p),M=S.filter(r=>(r.company||"").toLowerCase()===(p||"").toLowerCase()),E=[...ie].sort((r,s)=>(s.id||0)-(r.id||0)),X=r=>{const s=(r||"").toLowerCase().replace(/\s+/g,""),i=s.match(/[\d.]+/g);if(!i)return 9999;const g=parseFloat(i[0]),T=s.includes("kg")?g*1e3:g;return s.startsWith("<")||s.startsWith("upto")?T-.5:s.startsWith(">")||s.includes("above")||s.endsWith("+")?T+.5:T},Y=r=>(r.zone||"").trim()||(r.service_type||"").trim(),K=E.length>0&&E.every(r=>!(r.zone||"").trim()),P=[...new Set(E.map(Y).filter(Boolean))].sort(),ee=[...new Set(E.map(r=>(r.weight_slab||"").trim()).filter(Boolean))].sort((r,s)=>X(r)-X(s)),re=n?ee.filter(r=>r.toLowerCase().includes(n.toLowerCase())):ee;return e.jsxs(u,{sx:{pb:6,minHeight:"80vh",bgcolor:"#f8fafc",px:{xs:2,md:4},pt:3},children:[e.jsx(Re,{title:"Logistics Pricing Board",breadcrumbs:[{label:"Pricing Overview"}]}),e.jsxs(u,{sx:{display:"flex",flexDirection:"column",gap:4,mt:3,maxWidth:1200,mx:"auto"},children:[e.jsxs(U,{sx:{p:3,borderRadius:4,bgcolor:"#ffffff",boxShadow:"0 20px 40px -10px rgba(0,0,0,0.03)",border:"1px solid",borderColor:"grey.100",display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",justifyContent:"space-between",gap:3},children:[e.jsxs(u,{sx:{display:"flex",alignItems:"center",gap:2,width:{xs:"100%",md:"auto"}},children:[e.jsx(u,{sx:{width:48,height:48,borderRadius:3,bgcolor:"primary.lighter",color:"primary.main",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(we,{})}),e.jsxs(u,{children:[e.jsx(j,{variant:"caption",sx:{fontWeight:700,color:"text.secondary",letterSpacing:.8,textTransform:"uppercase"},children:"Active Logistics Provider"}),e.jsx(ke,{sx:{mt:.5,minWidth:260,display:"block"},children:e.jsx(Ae,{value:p||"",onChange:r=>w(r.target.value),displayEmpty:!0,IconComponent:Ce,input:e.jsx(ze,{sx:{borderRadius:3,fontWeight:700,fontSize:"1.1rem",bgcolor:a("#e2e8f0",.4),"& fieldset":{border:"none"},"&:hover":{bgcolor:a("#e2e8f0",.6)},"&.Mui-focused":{bgcolor:"#fff","& fieldset":{border:"2px solid",borderColor:"primary.main"}}}}),MenuProps:{PaperProps:{sx:{borderRadius:3,mt:1,boxShadow:"0 12px 24px rgba(0,0,0,0.1)"}}},children:z.length===0?e.jsx(D,{value:"",disabled:!0,children:"Loading Providers..."}):z.map(r=>e.jsx(D,{value:r,sx:{fontWeight:600,py:1.5,borderRadius:1,mx:1},children:r},r))})})]})]}),e.jsxs(u,{sx:{display:"flex",gap:2,alignItems:"center"},children:[e.jsx(B,{placeholder:"Search weight slabs...",value:n,onChange:r=>I(r.target.value),InputProps:{startAdornment:e.jsx(Ee,{position:"start",children:e.jsx(de,{color:"primary"})}),sx:{borderRadius:50,bgcolor:a("#e2e8f0",.3),"& fieldset":{border:"none"},"&:hover":{bgcolor:a("#e2e8f0",.5)},"&.Mui-focused":{bgcolor:"#fff","& fieldset":{border:"2px solid",borderColor:"primary.main"}}}}}),e.jsx(F,{variant:"contained",startIcon:e.jsx(me,{}),onClick:()=>{O({company:p,weight_slab:"",zone:"",rate:""}),y(!1),b(!0)},sx:{bgcolor:"#c01227","&:hover":{bgcolor:"#a00f20"},borderRadius:2,py:1.2,fontWeight:700,whiteSpace:"nowrap"},children:"Add Rate"}),e.jsx(F,{variant:c?"contained":"outlined",startIcon:e.jsx(te,{}),onClick:()=>Z(!c),sx:{borderRadius:2,py:1.2,fontWeight:700,whiteSpace:"nowrap",color:c?"white":"grey.700",borderColor:c?"transparent":"grey.300",bgcolor:c?"grey.800":"transparent","&:hover":{bgcolor:c?"grey.900":a("#000",.05),borderColor:c?"transparent":"grey.400"}},children:c?"Done":"Edit"})]})]}),p&&M.length>0&&e.jsxs(U,{elevation:0,sx:{borderRadius:4,border:"1px solid",borderColor:h?"#c01227":"grey.200",bgcolor:"white",transition:"border-color 0.3s ease, box-shadow 0.3s ease","&:hover":{borderColor:"#c01227",boxShadow:"0 8px 30px rgba(192, 18, 39, 0.08)"}},children:[e.jsxs(H,{direction:{xs:"column",md:"row"},spacing:4,sx:{p:{xs:3,md:3.5},cursor:"pointer",userSelect:"none"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",onClick:()=>k(!h),children:[e.jsxs(H,{direction:"row",spacing:3,alignItems:"center",sx:{minWidth:260},children:[e.jsx(xe,{sx:{width:68,height:68,bgcolor:a("#c01227",.08),color:"#c01227",fontWeight:800,fontSize:"1.8rem",borderRadius:3},children:(p||"A")[0].toUpperCase()}),e.jsxs(u,{children:[e.jsx(j,{variant:"overline",sx:{color:"grey.500",fontWeight:700,letterSpacing:1.2},children:"LOGISTICS PARTNER"}),e.jsx(j,{variant:"h5",sx:{fontWeight:800,color:"grey.900",lineHeight:1.1,mt:.25},children:p}),e.jsxs(j,{variant:"body2",sx:{color:"grey.600",mt:1,fontWeight:500,display:"flex",alignItems:"center"},children:[e.jsx(oe,{sx:{fontSize:16,mr:.5,color:"#c01227"}}),M.length," Registered Location",M.length!==1&&"s"]})]})]}),e.jsxs(H,{direction:"row",spacing:3,alignItems:"center",children:[e.jsxs(H,{direction:"row",spacing:1,sx:{display:{xs:"none",md:"flex"}},children:[e.jsx(N,{size:"small",label:"First Mile",sx:{bgcolor:a("#c01227",.08),color:"#c01227",fontWeight:700,borderRadius:1.5}}),e.jsx(N,{size:"small",label:"Mid Mile",sx:{bgcolor:a("#c01227",.08),color:"#c01227",fontWeight:700,borderRadius:1.5}}),e.jsx(N,{size:"small",label:"Last Mile",sx:{bgcolor:a("#c01227",.08),color:"#c01227",fontWeight:700,borderRadius:1.5}})]}),e.jsx(F,{onClick:r=>{r.stopPropagation(),k(!h)},sx:{borderRadius:2,py:1,px:3,fontWeight:700,color:h?"#c01227":"grey.700",bgcolor:h?a("#c01227",.1):"grey.100","&:hover":{bgcolor:a("#c01227",.15),color:"#c01227"}},endIcon:h?e.jsx(_e,{}):e.jsx(We,{}),children:h?"Hide Coverage":"View Coverage Map"})]})]}),e.jsx(ge,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsxs(u,{sx:{p:3,pt:0,borderTop:"1px dashed",borderColor:"grey.200",bgcolor:"grey.50",borderBottomLeftRadius:16,borderBottomRightRadius:16},children:[e.jsxs(u,{sx:{display:"flex",alignItems:"center",mb:2,mt:3},children:[e.jsx(oe,{sx:{color:"#c01227",fontSize:20,mr:1}}),e.jsx(j,{variant:"caption",sx:{color:"grey.600",fontWeight:700,letterSpacing:1},children:"ALL SERVICED AREAS:"})]}),e.jsx(u,{sx:{display:"flex",gap:1.5,flexWrap:"wrap"},children:M.map((r,s)=>e.jsx(N,{label:r.area||r.address,sx:{borderRadius:2,fontWeight:600,px:1,py:2.5,bgcolor:"white",color:"grey.800",border:"1px solid",borderColor:"grey.300",boxShadow:"0 2px 8px rgba(0,0,0,0.02)","&:hover":{borderColor:"#c01227",color:"#c01227",bgcolor:a("#c01227",.05),boxShadow:"0 4px 12px rgba(192,18,39,0.08)"},transition:"border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease"}},r.id??s))})]})})]}),e.jsx(U,{sx:{borderRadius:4,boxShadow:"0 24px 48px -12px rgba(0,0,0,0.05)",border:"1px solid",borderColor:"grey.200",overflow:"hidden",bgcolor:"#fff"},children:m?e.jsx(u,{sx:{display:"flex",justifyContent:"center",alignItems:"center",py:10},children:e.jsx(he,{size:48,thickness:4,sx:{color:"primary.light"}})}):e.jsx(Pe,{children:e.jsxs(Te,{sx:{minWidth:700},children:[e.jsx(Le,{children:e.jsxs(q,{sx:{bgcolor:a("#f8fafc",.8)},children:[e.jsx(R,{sx:{py:2,px:4,fontWeight:700,color:"grey.500",fontSize:"0.75rem",letterSpacing:1.2,textTransform:"uppercase",borderBottom:"2px solid",borderColor:"grey.100"},children:"Weight Slab"}),P.map(r=>e.jsx(R,{align:"center",sx:{py:2,fontWeight:700,color:"grey.500",fontSize:"0.75rem",letterSpacing:1.2,textTransform:"uppercase",borderBottom:"2px solid",borderColor:"grey.100"},children:r},r))]})}),e.jsx(Be,{children:P.length===0?e.jsx(q,{children:e.jsx(R,{colSpan:2,align:"center",sx:{py:8},children:e.jsx(j,{variant:"body1",color:"text.secondary",sx:{fontWeight:500},children:"No pricing data for this provider yet."})})}):re.length===0?e.jsx(q,{children:e.jsx(R,{colSpan:P.length+1,align:"center",sx:{py:8},children:e.jsx(j,{variant:"body1",color:"text.secondary",sx:{fontWeight:500},children:"No weight slabs match your search."})})}):re.map(r=>e.jsxs(q,{sx:{transition:"background-color 0.15s","&:hover":{bgcolor:a("#f1f5f9",.5)},"&:last-child td":{borderBottom:0}},children:[e.jsx(R,{sx:{px:4,py:2,fontWeight:600,color:"grey.800",fontSize:"0.9rem",borderBottom:"1px solid",borderColor:"grey.100"},children:r}),P.map(s=>{const i=E.find(L=>(L.weight_slab||"").trim()===r&&Y(L)===s),g=!!i,T=i?`₹${i.rate}`:"—";let Q="";if(i&&i.updated_by){const L=C.find(ne=>ne.id===i.updated_by);Q=`Last updated by: ${L?L.first_name:"ID "+i.updated_by}`}const ae=()=>{O({id:i?i.id:void 0,company:p,weight_slab:r,zone:K?"":s,service_type:K?s:(i==null?void 0:i.service_type)||"",rate:i?String(i.rate):""}),y(!0),b(!0)};return e.jsx(R,{align:"center",sx:{py:1.5,borderBottom:"1px solid",borderColor:"grey.100",cursor:c?"pointer":"default",transition:"background 0.15s","&:hover":c?{bgcolor:a("#c01227",.04)}:{}},onClick:c?ae:void 0,children:e.jsx(pe,{title:c?g?"Click to edit rate":"Click to add rate":Q,placement:"top",arrow:!0,disableHoverListener:!c&&!Q,children:e.jsxs(u,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[e.jsx(j,{sx:{display:"inline-block",fontWeight:g?700:400,color:g?"success.dark":c?a("#c01227",.4):"grey.300",fontSize:g?"0.95rem":"0.85rem",bgcolor:g?a("#10b981",.08):"transparent",px:g?1.5:0,py:g?.5:0,borderRadius:2},children:T}),c&&(g?e.jsx(te,{sx:{fontSize:13,color:"grey.400"}}):e.jsx(se,{sx:{fontSize:13,color:a("#c01227",.4)}}))]})})},s)})]},r))})]})})})]}),e.jsx(De,{open:$,onClose:()=>b(!1),onSave:()=>v(),initialData:A,isCell:t,pricingList:o,providerColumns:P,providerUsesServiceType:K})]})}export{or as default}; diff --git a/dist/assets/Settings-DhO0lsb-.js b/dist/assets/Settings-DCzsntaD.js similarity index 98% rename from dist/assets/Settings-DhO0lsb-.js rename to dist/assets/Settings-DCzsntaD.js index c236464..ef49cda 100644 --- a/dist/assets/Settings-DhO0lsb-.js +++ b/dist/assets/Settings-DCzsntaD.js @@ -1 +1 @@ -import{ae as Ve,a as b,k as ge,_ as x,af as xe,l as Z,m as K,n as X,o as F,j as e,p as Ce,v as Q,w as M,P as Fe,ag as qe,a2 as Ge,ah as Ue,a1 as Ye,ai as Ze,q as R,ac as Ke,ad as Xe,A as fe,r as $,i as _,S as p,T as C,B as j,Q as Qe,M as me,D,I as Je}from"./index-Dg-wT72v.js";import{S as et,d as tt,a as rt}from"./VisibilityOff-D6_289tJ.js";import{P as at,a as G,G as T,A as nt}from"./PageHeader-DgkErsA7.js";import{B as N}from"./Button-COL1_fTB.js";import{C as V}from"./Link-CndAQvyC.js";import{T as A}from"./TextField-COVOKpzm.js";import{L as ot}from"./LinearProgress-BvM3Q63G.js";import{I as st}from"./InputAdornment-HqPFSHfS.js";function it(t={}){const{autoHideDuration:r=null,disableWindowBlurListener:a=!1,onClose:n,open:d,resumeHideDuration:u}=t,l=Ve();b.useEffect(()=>{if(!d)return;function c(i){i.defaultPrevented||(i.key==="Escape"||i.key==="Esc")&&(n==null||n(i,"escapeKeyDown"))}return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[d,n]);const w=ge((c,i)=>{n==null||n(c,i)}),v=ge(c=>{!n||c==null||l.start(c,()=>{w(null,"timeout")})});b.useEffect(()=>(d&&v(r),l.clear),[d,r,v,l]);const y=c=>{n==null||n(c,"clickaway")},s=l.clear,h=b.useCallback(()=>{r!=null&&v(u??r*.5)},[r,u,v]),k=c=>i=>{const g=c.onBlur;g==null||g(i),h()},O=c=>i=>{const g=c.onFocus;g==null||g(i),s()},P=c=>i=>{const g=c.onMouseEnter;g==null||g(i),s()},E=c=>i=>{const g=c.onMouseLeave;g==null||g(i),h()};return b.useEffect(()=>{if(!a&&d)return window.addEventListener("focus",h),window.addEventListener("blur",s),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",s)}},[a,d,h,s]),{getRootProps:(c={})=>{const i=x({},xe(t),xe(c));return x({role:"presentation"},c,i,{onBlur:k(i),onFocus:O(i),onMouseEnter:P(i),onMouseLeave:E(i)})},onClickAway:y}}function lt(t){return Z("MuiSnackbarContent",t)}K("MuiSnackbarContent",["root","message","action"]);const ct=["action","className","message","role"],dt=t=>{const{classes:r}=t;return Q({root:["root"],action:["action"],message:["message"]},lt,r)},ut=M(Fe,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,r)=>r.root})(({theme:t})=>{const r=t.palette.mode==="light"?.8:.98,a=qe(t.palette.background.default,r);return x({},t.typography.body2,{color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(a),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:a,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})}),ht=M("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,r)=>r.message})({padding:"8px 0"}),pt=M("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,r)=>r.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),vt=b.forwardRef(function(r,a){const n=X({props:r,name:"MuiSnackbarContent"}),{action:d,className:u,message:l,role:w="alert"}=n,v=F(n,ct),y=n,s=dt(y);return e.jsxs(ut,x({role:w,square:!0,elevation:6,className:Ce(s.root,u),ownerState:y,ref:a},v,{children:[e.jsx(ht,{className:s.message,ownerState:y,children:l}),d?e.jsx(pt,{className:s.action,ownerState:y,children:d}):null]}))});function gt(t){return Z("MuiSnackbar",t)}K("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const xt=["onEnter","onExited"],ft=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],mt=t=>{const{classes:r,anchorOrigin:a}=t,n={root:["root",`anchorOrigin${R(a.vertical)}${R(a.horizontal)}`]};return Q(n,gt,r)},be=M("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,r)=>{const{ownerState:a}=t;return[r.root,r[`anchorOrigin${R(a.anchorOrigin.vertical)}${R(a.anchorOrigin.horizontal)}`]]}})(({theme:t,ownerState:r})=>{const a={left:"50%",right:"auto",transform:"translateX(-50%)"};return x({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},r.anchorOrigin.vertical==="top"?{top:8}:{bottom:8},r.anchorOrigin.horizontal==="left"&&{justifyContent:"flex-start"},r.anchorOrigin.horizontal==="right"&&{justifyContent:"flex-end"},{[t.breakpoints.up("sm")]:x({},r.anchorOrigin.vertical==="top"?{top:24}:{bottom:24},r.anchorOrigin.horizontal==="center"&&a,r.anchorOrigin.horizontal==="left"&&{left:24,right:"auto"},r.anchorOrigin.horizontal==="right"&&{right:24,left:"auto"})})}),bt=b.forwardRef(function(r,a){const n=X({props:r,name:"MuiSnackbar"}),d=Ge(),u={enter:d.transitions.duration.enteringScreen,exit:d.transitions.duration.leavingScreen},{action:l,anchorOrigin:{vertical:w,horizontal:v}={vertical:"bottom",horizontal:"left"},autoHideDuration:y=null,children:s,className:h,ClickAwayListenerProps:k,ContentProps:O,disableWindowBlurListener:P=!1,message:E,open:L,TransitionComponent:c=Ue,transitionDuration:i=u,TransitionProps:{onEnter:g,onExited:o}={}}=n,z=F(n.TransitionProps,xt),f=F(n,ft),H=x({},n,{anchorOrigin:{vertical:w,horizontal:v},autoHideDuration:y,disableWindowBlurListener:P,TransitionComponent:c,transitionDuration:i}),Te=mt(H),{getRootProps:Ee,onClickAway:Le}=it(x({},H)),[He,ve]=b.useState(!0),Ne=Ye({elementType:be,getSlotProps:Ee,externalForwardedProps:f,ownerState:H,additionalProps:{ref:a},className:[Te.root,h]}),De=q=>{ve(!0),o&&o(q)},We=(q,Be)=>{ve(!1),g&&g(q,Be)};return!L&&He?null:e.jsx(Ze,x({onClickAway:Le},k,{children:e.jsx(be,x({},Ne,{children:e.jsx(c,x({appear:!0,in:L,timeout:i,direction:w==="top"?"down":"up",onEnter:We,onExited:De},z,{children:s||e.jsx(vt,x({message:E,action:l},O))}))}))}))});function jt(t){return Z("MuiSwitch",t)}const m=K("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),wt=["className","color","edge","size","sx"],yt=t=>{const{classes:r,edge:a,size:n,color:d,checked:u,disabled:l}=t,w={root:["root",a&&`edge${R(a)}`,`size${R(n)}`],switchBase:["switchBase",`color${R(d)}`,u&&"checked",l&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},v=Q(w,jt,r);return x({},r,v)},St=M("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,r)=>{const{ownerState:a}=t;return[r.root,a.edge&&r[`edge${R(a.edge)}`],r[`size${R(a.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${m.thumb}`]:{width:16,height:16},[`& .${m.switchBase}`]:{padding:4,[`&.${m.checked}`]:{transform:"translateX(16px)"}}}}]}),Ct=M(et,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,r)=>{const{ownerState:a}=t;return[r.switchBase,{[`& .${m.input}`]:r.input},a.color!=="default"&&r[`color${R(a.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${m.checked}`]:{transform:"translateX(20px)"},[`&.${m.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${m.checked} + .${m.track}`]:{opacity:.5},[`&.${m.disabled} + .${m.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${m.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:fe(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,r])=>r.main&&r.light).map(([r])=>({props:{color:r},style:{[`&.${m.checked}`]:{color:(t.vars||t).palette[r].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fe(t.palette[r].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${m.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${r}DisabledColor`]:`${t.palette.mode==="light"?Ke(t.palette[r].main,.62):Xe(t.palette[r].main,.55)}`}},[`&.${m.checked} + .${m.track}`]:{backgroundColor:(t.vars||t).palette[r].main}}}))]})),kt=M("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,r)=>r.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),zt=M("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,r)=>r.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),W=b.forwardRef(function(r,a){const n=X({props:r,name:"MuiSwitch"}),{className:d,color:u="primary",edge:l=!1,size:w="medium",sx:v}=n,y=F(n,wt),s=x({},n,{color:u,edge:l,size:w}),h=yt(s),k=e.jsx(zt,{className:h.thumb,ownerState:s});return e.jsxs(St,{className:Ce(h.root,d),sx:v,ownerState:s,children:[e.jsx(Ct,x({type:"checkbox",icon:k,checkedIcon:k,ref:a,ownerState:s},y,{classes:x({},h,{root:h.switchBase})})),e.jsx(kt,{className:h.track,ownerState:s})]})});var J={},$t=_;Object.defineProperty(J,"__esModule",{value:!0});var ke=J.default=void 0,_t=$t($()),Rt=e;ke=J.default=(0,_t.default)((0,Rt.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm2 16H5V5h11.17L19 7.83zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3M6 6h9v4H6z"}),"SaveOutlined");var ee={},Mt=_;Object.defineProperty(ee,"__esModule",{value:!0});var te=ee.default=void 0,Ot=Mt($()),Pt=e;te=ee.default=(0,Ot.default)((0,Pt.jsx)("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"TuneOutlined");var re={},It=_;Object.defineProperty(re,"__esModule",{value:!0});var ae=re.default=void 0,At=It($()),Tt=e;ae=re.default=(0,At.default)((0,Tt.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone");var ne={},Et=_;Object.defineProperty(ne,"__esModule",{value:!0});var oe=ne.default=void 0,Lt=Et($()),Ht=e;oe=ne.default=(0,Lt.default)((0,Ht.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2M9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9zm9 14H6V10h12zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2"}),"LockOutlined");var se={},Nt=_;Object.defineProperty(se,"__esModule",{value:!0});var Y=se.default=void 0,Dt=Nt($()),Wt=e;Y=se.default=(0,Dt.default)((0,Wt.jsx)("path",{d:"M12 2 4 5v6.09c0 5.05 3.41 9.76 8 10.91 4.59-1.15 8-5.86 8-10.91V5zm6 9.09c0 4-2.55 7.7-6 8.83-3.45-1.13-6-4.82-6-8.83v-4.7l6-2.25 6 2.25z"}),"ShieldOutlined");var ie={},Bt=_;Object.defineProperty(ie,"__esModule",{value:!0});var ze=ie.default=void 0,Vt=Bt($()),Ft=e;ze=ie.default=(0,Vt.default)((0,Ft.jsx)("path",{d:"M18 11v2h4v-2zm-2 6.61c.96.71 2.21 1.65 3.2 2.39.4-.53.8-1.07 1.2-1.6-.99-.74-2.24-1.68-3.2-2.4-.4.54-.8 1.08-1.2 1.61M20.4 5.6c-.4-.53-.8-1.07-1.2-1.6-.99.74-2.24 1.68-3.2 2.4.4.53.8 1.07 1.2 1.6.96-.72 2.21-1.65 3.2-2.4M4 9c-1.1 0-2 .9-2 2v2c0 1.1.9 2 2 2h1v4h2v-4h1l5 3V6L8 9zm5.03 1.71L11 9.53v4.94l-1.97-1.18-.48-.29H4v-2h4.55zM15.5 12c0-1.33-.58-2.53-1.5-3.35v6.69c.92-.81 1.5-2.01 1.5-3.34"}),"CampaignOutlined");var le={},qt=_;Object.defineProperty(le,"__esModule",{value:!0});var $e=le.default=void 0,Gt=qt($()),Ut=e;$e=le.default=(0,Gt.default)((0,Ut.jsx)("path",{d:"M12 7V3H2v18h20V7zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8zm-2-8h-2v2h2zm0 4h-2v2h2z"}),"BusinessOutlined");var ce={},Yt=_;Object.defineProperty(ce,"__esModule",{value:!0});var _e=ce.default=void 0,Zt=Yt($()),je=e;_e=ce.default=(0,Zt.default)([(0,je.jsx)("path",{d:"M23 11.99 20.56 9.2l.34-3.69-3.61-.82L15.4 1.5 12 2.96 8.6 1.5 6.71 4.69 3.1 5.5l.34 3.7L1 11.99l2.44 2.79-.34 3.7 3.61.82 1.89 3.2 3.4-1.47 3.4 1.46 1.89-3.19 3.61-.82-.34-3.69zm-3.95 1.48-.56.65.08.85.18 1.95-1.9.43-.84.19-.44.74-.99 1.68-1.78-.77-.8-.34-.79.34-1.78.77-.99-1.67-.44-.74-.84-.19-1.9-.43.18-1.96.08-.85-.56-.65L3.67 12l1.29-1.48.56-.65-.09-.86-.18-1.94 1.9-.43.84-.19.44-.74.99-1.68 1.78.77.8.34.79-.34 1.78-.77.99 1.68.44.74.84.19 1.9.43-.18 1.95-.08.85.56.65 1.29 1.47z"},"0"),(0,je.jsx)("path",{d:"m10.09 13.75-2.32-2.33-1.48 1.49 3.8 3.81 7.34-7.36-1.48-1.49z"},"1")],"VerifiedOutlined");var de={},Kt=_;Object.defineProperty(de,"__esModule",{value:!0});var Re=de.default=void 0,Xt=Kt($()),Qt=e;Re=de.default=(0,Xt.default)((0,Qt.jsx)("path",{d:"M12 5.99 19.53 19H4.47zM2.74 18c-.77 1.33.19 3 1.73 3h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0zM11 11v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1m0 5h2v2h-2z"}),"WarningAmberRounded");var ue={},Jt=_;Object.defineProperty(ue,"__esModule",{value:!0});var Me=ue.default=void 0,er=Jt($()),tr=e;Me=ue.default=(0,er.default)((0,tr.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-1-4h2v2h-2zm1.61-9.96c-2.06-.3-3.88.97-4.43 2.79-.18.58.26 1.17.87 1.17h.2c.41 0 .74-.29.88-.67.32-.89 1.27-1.5 2.3-1.28.95.2 1.65 1.13 1.57 2.1-.1 1.34-1.62 1.63-2.45 2.88 0 .01-.01.01-.01.02-.01.02-.02.03-.03.05-.09.15-.18.32-.25.5-.01.03-.03.05-.04.08-.01.02-.01.04-.02.07-.12.34-.2.75-.2 1.25h2c0-.42.11-.77.28-1.07.02-.03.03-.06.05-.09.08-.14.18-.27.28-.39.01-.01.02-.03.03-.04.1-.12.21-.23.33-.34.96-.91 2.26-1.65 1.99-3.56-.24-1.74-1.61-3.21-3.35-3.47"}),"HelpOutlineRounded");var he={},rr=_;Object.defineProperty(he,"__esModule",{value:!0});var Oe=he.default=void 0,ar=rr($()),nr=e;Oe=he.default=(0,ar.default)((0,nr.jsx)("path",{d:"m17 8-1.41 1.41L17.17 11H9v2h8.17l-1.58 1.58L17 16l4-4zM5 5h7V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h7v-2H5z"}),"LogoutOutlined");var pe={},or=_;Object.defineProperty(pe,"__esModule",{value:!0});var Pe=pe.default=void 0,sr=or($()),ir=e;Pe=pe.default=(0,sr.default)((0,ir.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");const Ie=["Asia/Kolkata (IST)","Asia/Dubai (GST)","UTC","America/New_York (EST)"],Ae=["English","हिन्दी (Hindi)","العربية (Arabic)"],we={orgName:"Doormile Technologies",supportEmail:"support@doormile.in",contact:"+91 63749 46729",timezone:Ie[0],language:Ae[0]},ye={newClient:!0,contractStatus:!0,teamAccess:!1,databaseSync:!0,emailAlerts:!0,smsAlerts:!1},Se={currentPassword:"",newPassword:"",confirmPassword:"",twoFactor:!1},lr=[{icon:te,label:"General",desc:"Organisation profile"},{icon:ae,label:"Notifications",desc:"Alerts & channels"},{icon:oe,label:"Security",desc:"Password & 2FA"}],cr=[{k:"newClient",t:"New client onboarded",d:"Notify when a new client is added to the system"},{k:"contractStatus",t:"Contract status",d:"When a client contract becomes active or expires"},{k:"teamAccess",t:"Team access",d:"When a new team member is granted or revoked access"},{k:"databaseSync",t:"Database sync",d:"Alerts for vector database synchronization events"}],dr=[{label:"Too weak",color:"error"},{label:"Weak",color:"error"},{label:"Fair",color:"warning"},{label:"Good",color:"info"},{label:"Strong",color:"success"}],ur=t=>{let r=0;return t.length>=8&&r++,/[a-z]/.test(t)&&/[A-Z]/.test(t)&&r++,/\d/.test(t)&&r++,/[^A-Za-z0-9]/.test(t)&&r++,r};function I({icon:t,title:r,subtitle:a,color:n="primary",danger:d=!1,children:u}){return e.jsxs(V,{sx:d?{borderColor:"error.light"}:void 0,children:[e.jsxs(p,{direction:"row",spacing:1.75,alignItems:"center",sx:{px:3,py:2.25,borderBottom:1,borderColor:"divider",background:l=>`linear-gradient(90deg, ${l.palette[n].lighter}66 0%, ${l.palette.background.paper} 72%)`},children:[e.jsx(j,{sx:{width:40,height:40,borderRadius:2,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${n}.lighter`,color:`${n}.main`},children:e.jsx(t,{fontSize:"small"})}),e.jsxs(j,{sx:{minWidth:0},children:[e.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.3},children:r}),a&&e.jsx(C,{variant:"caption",color:"text.secondary",children:a})]})]}),e.jsx(j,{sx:{px:3},children:u})]})}function S({label:t,description:r,children:a,align:n="center"}){return e.jsxs(T,{container:!0,spacing:2,alignItems:n,sx:{py:2.5,borderRadius:2,transition:"background-color .15s","&:hover":{bgcolor:"grey.50"}},children:[e.jsxs(T,{item:!0,xs:12,sm:5,children:[e.jsx(C,{variant:"subtitle2",sx:{fontWeight:600,color:"grey.800"},children:t}),r&&e.jsx(C,{variant:"caption",color:"text.secondary",children:r})]}),e.jsx(T,{item:!0,xs:12,sm:7,children:a})]})}const B={display:"flex",justifyContent:{sm:"flex-end"}};function U({label:t,value:r,onChange:a,autoComplete:n}){const[d,u]=b.useState(!1);return e.jsx(A,{fullWidth:!0,size:"small",type:d?"text":"password",label:t,value:r,onChange:a,autoComplete:n,InputProps:{endAdornment:e.jsx(st,{position:"end",children:e.jsx(Je,{onClick:()=>u(l=>!l),edge:"end",size:"small",children:d?e.jsx(tt,{fontSize:"small"}):e.jsx(rt,{fontSize:"small"})})})}})}function jr(){const[t,r]=b.useState(0),[a,n]=b.useState(!1),[d,u]=b.useState(!1),[l,w]=b.useState(we),[v,y]=b.useState(ye),[s,h]=b.useState(Se),k=o=>z=>{w(f=>({...f,[o]:z.target.value})),u(!0)},O=o=>z=>{y(f=>({...f,[o]:z.target.checked})),u(!0)},P=o=>z=>{h(f=>({...f,[o]:z.target.value})),u(!0)},E=()=>{n(!0),u(!1)},L=()=>{w(we),y(ye),h(Se),u(!1)},c=ur(s.newPassword),i=dr[c],g=s.confirmPassword&&s.newPassword!==s.confirmPassword;return e.jsxs(e.Fragment,{children:[e.jsx(at,{title:"Settings",breadcrumbs:[{label:"Settings"}],action:e.jsxs(p,{direction:"row",spacing:1.5,alignItems:"center",children:[d&&e.jsx(G,{size:"small",label:"Unsaved changes",sx:{bgcolor:"warning.lighter",color:"warning.dark",fontWeight:600}}),e.jsx(N,{variant:"outlined",onClick:L,children:"Discard"}),e.jsx(N,{variant:"contained",startIcon:e.jsx(ke,{}),onClick:E,children:"Save Changes"})]})}),e.jsxs(T,{container:!0,spacing:2.5,children:[e.jsx(T,{item:!0,xs:12,md:3,children:e.jsxs(p,{spacing:2.5,sx:{position:{md:"sticky"},top:{md:88}},children:[e.jsxs(V,{sx:{p:1.5},children:[e.jsx(C,{variant:"overline",sx:{px:1,color:"text.secondary",fontWeight:700,letterSpacing:.6},children:"Preferences"}),e.jsx(p,{spacing:.25,sx:{mt:.5},children:lr.map((o,z)=>{const f=t===z,H=o.icon;return e.jsxs(p,{direction:"row",spacing:1.5,alignItems:"center",onClick:()=>r(z),sx:{px:1.5,py:1.25,borderRadius:2,cursor:"pointer",position:"relative",bgcolor:f?"primary.lighter":"transparent",transition:"background-color .15s","&:hover":{bgcolor:f?"primary.lighter":"grey.50"},"&::before":f?{content:'""',position:"absolute",left:0,top:9,bottom:9,width:3,borderRadius:3,bgcolor:"primary.main"}:{}},children:[e.jsx(j,{sx:{width:34,height:34,borderRadius:1.5,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:f?"primary.main":"grey.100",color:f?"#fff":"grey.600"},children:e.jsx(H,{fontSize:"small"})}),e.jsxs(j,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(C,{variant:"subtitle2",sx:{fontWeight:600,color:f?"primary.main":"grey.800"},children:o.label}),e.jsx(C,{variant:"caption",color:"text.secondary",children:o.desc})]}),e.jsx(Pe,{sx:{fontSize:18,color:f?"primary.main":"grey.300"}})]},o.label)})})]}),e.jsx(V,{sx:{p:2.5,bgcolor:"primary.lighter",borderColor:"primary.100"},children:e.jsxs(p,{spacing:1.25,children:[e.jsx(j,{sx:{width:38,height:38,borderRadius:2,bgcolor:"primary.main",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Me,{fontSize:"small"})}),e.jsxs(j,{children:[e.jsx(C,{variant:"subtitle2",sx:{fontWeight:700,color:"primary.dark"},children:"Need a hand?"}),e.jsx(C,{variant:"caption",sx:{color:"primary.dark",opacity:.85},children:"Our team is available 24/7 for operational support."})]}),e.jsx(N,{size:"small",variant:"contained",sx:{alignSelf:"flex-start"},children:"Contact support"})]})})]})}),e.jsxs(T,{item:!0,xs:12,md:9,children:[t===0&&e.jsxs(p,{spacing:2.5,children:[e.jsx(V,{sx:{overflow:"hidden"},children:e.jsxs(p,{direction:{xs:"column",sm:"row"},spacing:2.5,alignItems:{sm:"center"},sx:{p:3,background:o=>`linear-gradient(90deg, ${o.palette.primary.lighter}88 0%, ${o.palette.background.paper} 75%)`},children:[e.jsx(Qe,{variant:"rounded",sx:{width:64,height:64,bgcolor:"primary.main",color:"#fff"},children:e.jsx($e,{})}),e.jsxs(j,{sx:{flexGrow:1,minWidth:0},children:[e.jsxs(p,{direction:"row",spacing:1,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[e.jsx(C,{variant:"h5",sx:{fontWeight:700,color:"grey.800"},children:l.orgName}),e.jsx(G,{size:"small",icon:e.jsx(_e,{sx:{fontSize:15,ml:.5}}),label:"Verified",sx:{fontWeight:700,bgcolor:"success.lighter",color:"success.dark","& .MuiChip-icon":{color:"inherit"}}})]}),e.jsxs(C,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:[l.supportEmail," · ",l.contact]})]}),e.jsx(N,{variant:"outlined",size:"small",children:"Change logo"})]})}),e.jsx(I,{icon:te,title:"Organisation",subtitle:"Profile and regional preferences",color:"primary",children:e.jsxs(p,{divider:e.jsx(D,{}),children:[e.jsx(S,{label:"Organisation name",description:"Shown on invoices and exports",children:e.jsx(A,{fullWidth:!0,size:"small",value:l.orgName,onChange:k("orgName")})}),e.jsx(S,{label:"Support email",description:"Where customer replies are routed",children:e.jsx(A,{fullWidth:!0,size:"small",value:l.supportEmail,onChange:k("supportEmail")})}),e.jsx(S,{label:"Contact number",description:"Primary operations line",children:e.jsx(A,{fullWidth:!0,size:"small",value:l.contact,onChange:k("contact")})}),e.jsx(S,{label:"Timezone",description:"Used for schedules and reports",children:e.jsx(A,{select:!0,fullWidth:!0,size:"small",value:l.timezone,onChange:k("timezone"),children:Ie.map(o=>e.jsx(me,{value:o,children:o},o))})}),e.jsx(S,{label:"Language",description:"Console display language",children:e.jsx(A,{select:!0,fullWidth:!0,size:"small",value:l.language,onChange:k("language"),children:Ae.map(o=>e.jsx(me,{value:o,children:o},o))})})]})})]}),t===1&&e.jsxs(p,{spacing:2.5,children:[e.jsx(I,{icon:ae,title:"Notification Preferences",subtitle:"Choose what you get alerted about",color:"primary",children:e.jsx(p,{divider:e.jsx(D,{}),children:cr.map(o=>e.jsx(S,{label:o.t,description:o.d,children:e.jsx(j,{sx:B,children:e.jsx(W,{checked:v[o.k],onChange:O(o.k)})})},o.k))})}),e.jsx(I,{icon:ze,title:"Delivery Channels",subtitle:"How alerts reach your team",color:"primary",children:e.jsxs(p,{divider:e.jsx(D,{}),children:[e.jsx(S,{label:"Email alerts",description:"Send notifications to the support inbox",children:e.jsx(j,{sx:B,children:e.jsx(W,{checked:v.emailAlerts,onChange:O("emailAlerts")})})}),e.jsx(S,{label:"SMS alerts",description:"Send notifications to the registered mobile",children:e.jsx(j,{sx:B,children:e.jsx(W,{checked:v.smsAlerts,onChange:O("smsAlerts")})})})]})})]}),t===2&&e.jsxs(p,{spacing:2.5,children:[e.jsx(I,{icon:oe,title:"Change Password",subtitle:"Use 8+ characters with a mix of letters, numbers & symbols",color:"primary",children:e.jsxs(p,{divider:e.jsx(D,{}),children:[e.jsx(S,{label:"Current password",description:"Enter your existing password",align:"flex-start",children:e.jsx(U,{label:"Current password",value:s.currentPassword,onChange:P("currentPassword"),autoComplete:"current-password"})}),e.jsx(S,{label:"New password",description:"Choose a strong, unique password",align:"flex-start",children:e.jsxs(j,{children:[e.jsx(U,{label:"New password",value:s.newPassword,onChange:P("newPassword"),autoComplete:"new-password"}),s.newPassword&&e.jsxs(p,{direction:"row",spacing:1.5,alignItems:"center",sx:{mt:1},children:[e.jsx(ot,{variant:"determinate",value:c/4*100,color:i.color,sx:{flexGrow:1,height:6,borderRadius:3}}),e.jsx(C,{variant:"caption",sx:{fontWeight:700,color:`${i.color}.main`,minWidth:56},children:i.label})]})]})}),e.jsx(S,{label:"Confirm new password",description:"Re-enter the new password",align:"flex-start",children:e.jsxs(j,{children:[e.jsx(U,{label:"Confirm new password",value:s.confirmPassword,onChange:P("confirmPassword"),autoComplete:"new-password"}),g&&e.jsx(C,{variant:"caption",color:"error.main",sx:{mt:.75,display:"block"},children:"Passwords do not match"})]})})]})}),e.jsx(I,{icon:Y,title:"Two-Factor Authentication",subtitle:"Add an extra layer of security to your account",color:"primary",children:e.jsx(S,{label:"Authenticator app",description:"Require a one-time code at sign-in for extra security",children:e.jsxs(p,{direction:"row",spacing:1.5,alignItems:"center",sx:{justifyContent:{sm:"flex-end"}},children:[e.jsx(G,{size:"small",icon:e.jsx(Y,{sx:{fontSize:15,ml:.5}}),label:s.twoFactor?"Enabled":"Disabled",sx:{fontWeight:700,bgcolor:s.twoFactor?"success.lighter":"grey.100",color:s.twoFactor?"success.dark":"grey.600","& .MuiChip-icon":{color:"inherit"}}}),e.jsx(W,{checked:s.twoFactor,onChange:o=>{h(z=>({...z,twoFactor:o.target.checked})),u(!0)}})]})})}),e.jsx(I,{icon:Re,title:"Danger Zone",subtitle:"Irreversible and high-impact actions",color:"error",danger:!0,children:e.jsx(S,{label:"Sign out of all sessions",description:"End every active session on all devices",children:e.jsx(j,{sx:B,children:e.jsx(N,{variant:"outlined",color:"error",startIcon:e.jsx(Oe,{}),onClick:()=>{localStorage.removeItem("auth_token"),window.location.href="/login"},children:"Sign out everywhere"})})})})]})]})]}),e.jsx(bt,{open:a,autoHideDuration:2500,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:e.jsx(nt,{severity:"success",variant:"filled",onClose:()=>n(!1),sx:{width:"100%"},children:"Settings saved successfully."})})]})}export{jr as default}; +import{ae as Ve,a as b,k as ge,_ as x,af as xe,l as Z,m as K,n as X,o as F,j as e,p as Ce,v as Q,w as M,P as Fe,ag as qe,a2 as Ge,ah as Ue,a1 as Ye,ai as Ze,q as R,ac as Ke,ad as Xe,A as fe,r as $,i as _,S as p,T as C,B as j,Q as Qe,M as me,D,I as Je}from"./index-J0uxx8As.js";import{S as et,d as tt,a as rt}from"./VisibilityOff-DVBJPx6F.js";import{P as at,a as G,G as T,A as nt}from"./PageHeader-TW1dMGrU.js";import{B as N}from"./Button-BkRsd5c4.js";import{C as V}from"./Link-DdF3Xu1F.js";import{T as A}from"./TextField-BARvBB_z.js";import{L as ot}from"./LinearProgress-DAlys0Qw.js";import{I as st}from"./InputAdornment-Cbcw8oJa.js";function it(t={}){const{autoHideDuration:r=null,disableWindowBlurListener:a=!1,onClose:n,open:d,resumeHideDuration:u}=t,l=Ve();b.useEffect(()=>{if(!d)return;function c(i){i.defaultPrevented||(i.key==="Escape"||i.key==="Esc")&&(n==null||n(i,"escapeKeyDown"))}return document.addEventListener("keydown",c),()=>{document.removeEventListener("keydown",c)}},[d,n]);const w=ge((c,i)=>{n==null||n(c,i)}),v=ge(c=>{!n||c==null||l.start(c,()=>{w(null,"timeout")})});b.useEffect(()=>(d&&v(r),l.clear),[d,r,v,l]);const y=c=>{n==null||n(c,"clickaway")},s=l.clear,h=b.useCallback(()=>{r!=null&&v(u??r*.5)},[r,u,v]),k=c=>i=>{const g=c.onBlur;g==null||g(i),h()},O=c=>i=>{const g=c.onFocus;g==null||g(i),s()},P=c=>i=>{const g=c.onMouseEnter;g==null||g(i),s()},E=c=>i=>{const g=c.onMouseLeave;g==null||g(i),h()};return b.useEffect(()=>{if(!a&&d)return window.addEventListener("focus",h),window.addEventListener("blur",s),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",s)}},[a,d,h,s]),{getRootProps:(c={})=>{const i=x({},xe(t),xe(c));return x({role:"presentation"},c,i,{onBlur:k(i),onFocus:O(i),onMouseEnter:P(i),onMouseLeave:E(i)})},onClickAway:y}}function lt(t){return Z("MuiSnackbarContent",t)}K("MuiSnackbarContent",["root","message","action"]);const ct=["action","className","message","role"],dt=t=>{const{classes:r}=t;return Q({root:["root"],action:["action"],message:["message"]},lt,r)},ut=M(Fe,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(t,r)=>r.root})(({theme:t})=>{const r=t.palette.mode==="light"?.8:.98,a=qe(t.palette.background.default,r);return x({},t.typography.body2,{color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(a),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:a,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})}),ht=M("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(t,r)=>r.message})({padding:"8px 0"}),pt=M("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(t,r)=>r.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),vt=b.forwardRef(function(r,a){const n=X({props:r,name:"MuiSnackbarContent"}),{action:d,className:u,message:l,role:w="alert"}=n,v=F(n,ct),y=n,s=dt(y);return e.jsxs(ut,x({role:w,square:!0,elevation:6,className:Ce(s.root,u),ownerState:y,ref:a},v,{children:[e.jsx(ht,{className:s.message,ownerState:y,children:l}),d?e.jsx(pt,{className:s.action,ownerState:y,children:d}):null]}))});function gt(t){return Z("MuiSnackbar",t)}K("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const xt=["onEnter","onExited"],ft=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],mt=t=>{const{classes:r,anchorOrigin:a}=t,n={root:["root",`anchorOrigin${R(a.vertical)}${R(a.horizontal)}`]};return Q(n,gt,r)},be=M("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(t,r)=>{const{ownerState:a}=t;return[r.root,r[`anchorOrigin${R(a.anchorOrigin.vertical)}${R(a.anchorOrigin.horizontal)}`]]}})(({theme:t,ownerState:r})=>{const a={left:"50%",right:"auto",transform:"translateX(-50%)"};return x({zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},r.anchorOrigin.vertical==="top"?{top:8}:{bottom:8},r.anchorOrigin.horizontal==="left"&&{justifyContent:"flex-start"},r.anchorOrigin.horizontal==="right"&&{justifyContent:"flex-end"},{[t.breakpoints.up("sm")]:x({},r.anchorOrigin.vertical==="top"?{top:24}:{bottom:24},r.anchorOrigin.horizontal==="center"&&a,r.anchorOrigin.horizontal==="left"&&{left:24,right:"auto"},r.anchorOrigin.horizontal==="right"&&{right:24,left:"auto"})})}),bt=b.forwardRef(function(r,a){const n=X({props:r,name:"MuiSnackbar"}),d=Ge(),u={enter:d.transitions.duration.enteringScreen,exit:d.transitions.duration.leavingScreen},{action:l,anchorOrigin:{vertical:w,horizontal:v}={vertical:"bottom",horizontal:"left"},autoHideDuration:y=null,children:s,className:h,ClickAwayListenerProps:k,ContentProps:O,disableWindowBlurListener:P=!1,message:E,open:L,TransitionComponent:c=Ue,transitionDuration:i=u,TransitionProps:{onEnter:g,onExited:o}={}}=n,z=F(n.TransitionProps,xt),f=F(n,ft),H=x({},n,{anchorOrigin:{vertical:w,horizontal:v},autoHideDuration:y,disableWindowBlurListener:P,TransitionComponent:c,transitionDuration:i}),Te=mt(H),{getRootProps:Ee,onClickAway:Le}=it(x({},H)),[He,ve]=b.useState(!0),Ne=Ye({elementType:be,getSlotProps:Ee,externalForwardedProps:f,ownerState:H,additionalProps:{ref:a},className:[Te.root,h]}),De=q=>{ve(!0),o&&o(q)},We=(q,Be)=>{ve(!1),g&&g(q,Be)};return!L&&He?null:e.jsx(Ze,x({onClickAway:Le},k,{children:e.jsx(be,x({},Ne,{children:e.jsx(c,x({appear:!0,in:L,timeout:i,direction:w==="top"?"down":"up",onEnter:We,onExited:De},z,{children:s||e.jsx(vt,x({message:E,action:l},O))}))}))}))});function jt(t){return Z("MuiSwitch",t)}const m=K("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),wt=["className","color","edge","size","sx"],yt=t=>{const{classes:r,edge:a,size:n,color:d,checked:u,disabled:l}=t,w={root:["root",a&&`edge${R(a)}`,`size${R(n)}`],switchBase:["switchBase",`color${R(d)}`,u&&"checked",l&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},v=Q(w,jt,r);return x({},r,v)},St=M("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,r)=>{const{ownerState:a}=t;return[r.root,a.edge&&r[`edge${R(a.edge)}`],r[`size${R(a.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${m.thumb}`]:{width:16,height:16},[`& .${m.switchBase}`]:{padding:4,[`&.${m.checked}`]:{transform:"translateX(16px)"}}}}]}),Ct=M(et,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,r)=>{const{ownerState:a}=t;return[r.switchBase,{[`& .${m.input}`]:r.input},a.color!=="default"&&r[`color${R(a.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${m.checked}`]:{transform:"translateX(20px)"},[`&.${m.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${m.checked} + .${m.track}`]:{opacity:.5},[`&.${m.disabled} + .${m.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${m.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:fe(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,r])=>r.main&&r.light).map(([r])=>({props:{color:r},style:{[`&.${m.checked}`]:{color:(t.vars||t).palette[r].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:fe(t.palette[r].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${m.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${r}DisabledColor`]:`${t.palette.mode==="light"?Ke(t.palette[r].main,.62):Xe(t.palette[r].main,.55)}`}},[`&.${m.checked} + .${m.track}`]:{backgroundColor:(t.vars||t).palette[r].main}}}))]})),kt=M("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,r)=>r.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),zt=M("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,r)=>r.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),W=b.forwardRef(function(r,a){const n=X({props:r,name:"MuiSwitch"}),{className:d,color:u="primary",edge:l=!1,size:w="medium",sx:v}=n,y=F(n,wt),s=x({},n,{color:u,edge:l,size:w}),h=yt(s),k=e.jsx(zt,{className:h.thumb,ownerState:s});return e.jsxs(St,{className:Ce(h.root,d),sx:v,ownerState:s,children:[e.jsx(Ct,x({type:"checkbox",icon:k,checkedIcon:k,ref:a,ownerState:s},y,{classes:x({},h,{root:h.switchBase})})),e.jsx(kt,{className:h.track,ownerState:s})]})});var J={},$t=_;Object.defineProperty(J,"__esModule",{value:!0});var ke=J.default=void 0,_t=$t($()),Rt=e;ke=J.default=(0,_t.default)((0,Rt.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm2 16H5V5h11.17L19 7.83zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3M6 6h9v4H6z"}),"SaveOutlined");var ee={},Mt=_;Object.defineProperty(ee,"__esModule",{value:!0});var te=ee.default=void 0,Ot=Mt($()),Pt=e;te=ee.default=(0,Ot.default)((0,Pt.jsx)("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"TuneOutlined");var re={},It=_;Object.defineProperty(re,"__esModule",{value:!0});var ae=re.default=void 0,At=It($()),Tt=e;ae=re.default=(0,At.default)((0,Tt.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone");var ne={},Et=_;Object.defineProperty(ne,"__esModule",{value:!0});var oe=ne.default=void 0,Lt=Et($()),Ht=e;oe=ne.default=(0,Lt.default)((0,Ht.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2M9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9zm9 14H6V10h12zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2"}),"LockOutlined");var se={},Nt=_;Object.defineProperty(se,"__esModule",{value:!0});var Y=se.default=void 0,Dt=Nt($()),Wt=e;Y=se.default=(0,Dt.default)((0,Wt.jsx)("path",{d:"M12 2 4 5v6.09c0 5.05 3.41 9.76 8 10.91 4.59-1.15 8-5.86 8-10.91V5zm6 9.09c0 4-2.55 7.7-6 8.83-3.45-1.13-6-4.82-6-8.83v-4.7l6-2.25 6 2.25z"}),"ShieldOutlined");var ie={},Bt=_;Object.defineProperty(ie,"__esModule",{value:!0});var ze=ie.default=void 0,Vt=Bt($()),Ft=e;ze=ie.default=(0,Vt.default)((0,Ft.jsx)("path",{d:"M18 11v2h4v-2zm-2 6.61c.96.71 2.21 1.65 3.2 2.39.4-.53.8-1.07 1.2-1.6-.99-.74-2.24-1.68-3.2-2.4-.4.54-.8 1.08-1.2 1.61M20.4 5.6c-.4-.53-.8-1.07-1.2-1.6-.99.74-2.24 1.68-3.2 2.4.4.53.8 1.07 1.2 1.6.96-.72 2.21-1.65 3.2-2.4M4 9c-1.1 0-2 .9-2 2v2c0 1.1.9 2 2 2h1v4h2v-4h1l5 3V6L8 9zm5.03 1.71L11 9.53v4.94l-1.97-1.18-.48-.29H4v-2h4.55zM15.5 12c0-1.33-.58-2.53-1.5-3.35v6.69c.92-.81 1.5-2.01 1.5-3.34"}),"CampaignOutlined");var le={},qt=_;Object.defineProperty(le,"__esModule",{value:!0});var $e=le.default=void 0,Gt=qt($()),Ut=e;$e=le.default=(0,Gt.default)((0,Ut.jsx)("path",{d:"M12 7V3H2v18h20V7zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8zm-2-8h-2v2h2zm0 4h-2v2h2z"}),"BusinessOutlined");var ce={},Yt=_;Object.defineProperty(ce,"__esModule",{value:!0});var _e=ce.default=void 0,Zt=Yt($()),je=e;_e=ce.default=(0,Zt.default)([(0,je.jsx)("path",{d:"M23 11.99 20.56 9.2l.34-3.69-3.61-.82L15.4 1.5 12 2.96 8.6 1.5 6.71 4.69 3.1 5.5l.34 3.7L1 11.99l2.44 2.79-.34 3.7 3.61.82 1.89 3.2 3.4-1.47 3.4 1.46 1.89-3.19 3.61-.82-.34-3.69zm-3.95 1.48-.56.65.08.85.18 1.95-1.9.43-.84.19-.44.74-.99 1.68-1.78-.77-.8-.34-.79.34-1.78.77-.99-1.67-.44-.74-.84-.19-1.9-.43.18-1.96.08-.85-.56-.65L3.67 12l1.29-1.48.56-.65-.09-.86-.18-1.94 1.9-.43.84-.19.44-.74.99-1.68 1.78.77.8.34.79-.34 1.78-.77.99 1.68.44.74.84.19 1.9.43-.18 1.95-.08.85.56.65 1.29 1.47z"},"0"),(0,je.jsx)("path",{d:"m10.09 13.75-2.32-2.33-1.48 1.49 3.8 3.81 7.34-7.36-1.48-1.49z"},"1")],"VerifiedOutlined");var de={},Kt=_;Object.defineProperty(de,"__esModule",{value:!0});var Re=de.default=void 0,Xt=Kt($()),Qt=e;Re=de.default=(0,Xt.default)((0,Qt.jsx)("path",{d:"M12 5.99 19.53 19H4.47zM2.74 18c-.77 1.33.19 3 1.73 3h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0zM11 11v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1m0 5h2v2h-2z"}),"WarningAmberRounded");var ue={},Jt=_;Object.defineProperty(ue,"__esModule",{value:!0});var Me=ue.default=void 0,er=Jt($()),tr=e;Me=ue.default=(0,er.default)((0,tr.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-1-4h2v2h-2zm1.61-9.96c-2.06-.3-3.88.97-4.43 2.79-.18.58.26 1.17.87 1.17h.2c.41 0 .74-.29.88-.67.32-.89 1.27-1.5 2.3-1.28.95.2 1.65 1.13 1.57 2.1-.1 1.34-1.62 1.63-2.45 2.88 0 .01-.01.01-.01.02-.01.02-.02.03-.03.05-.09.15-.18.32-.25.5-.01.03-.03.05-.04.08-.01.02-.01.04-.02.07-.12.34-.2.75-.2 1.25h2c0-.42.11-.77.28-1.07.02-.03.03-.06.05-.09.08-.14.18-.27.28-.39.01-.01.02-.03.03-.04.1-.12.21-.23.33-.34.96-.91 2.26-1.65 1.99-3.56-.24-1.74-1.61-3.21-3.35-3.47"}),"HelpOutlineRounded");var he={},rr=_;Object.defineProperty(he,"__esModule",{value:!0});var Oe=he.default=void 0,ar=rr($()),nr=e;Oe=he.default=(0,ar.default)((0,nr.jsx)("path",{d:"m17 8-1.41 1.41L17.17 11H9v2h8.17l-1.58 1.58L17 16l4-4zM5 5h7V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h7v-2H5z"}),"LogoutOutlined");var pe={},or=_;Object.defineProperty(pe,"__esModule",{value:!0});var Pe=pe.default=void 0,sr=or($()),ir=e;Pe=pe.default=(0,sr.default)((0,ir.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");const Ie=["Asia/Kolkata (IST)","Asia/Dubai (GST)","UTC","America/New_York (EST)"],Ae=["English","हिन्दी (Hindi)","العربية (Arabic)"],we={orgName:"Doormile Technologies",supportEmail:"support@doormile.in",contact:"+91 63749 46729",timezone:Ie[0],language:Ae[0]},ye={newClient:!0,contractStatus:!0,teamAccess:!1,databaseSync:!0,emailAlerts:!0,smsAlerts:!1},Se={currentPassword:"",newPassword:"",confirmPassword:"",twoFactor:!1},lr=[{icon:te,label:"General",desc:"Organisation profile"},{icon:ae,label:"Notifications",desc:"Alerts & channels"},{icon:oe,label:"Security",desc:"Password & 2FA"}],cr=[{k:"newClient",t:"New client onboarded",d:"Notify when a new client is added to the system"},{k:"contractStatus",t:"Contract status",d:"When a client contract becomes active or expires"},{k:"teamAccess",t:"Team access",d:"When a new team member is granted or revoked access"},{k:"databaseSync",t:"Database sync",d:"Alerts for vector database synchronization events"}],dr=[{label:"Too weak",color:"error"},{label:"Weak",color:"error"},{label:"Fair",color:"warning"},{label:"Good",color:"info"},{label:"Strong",color:"success"}],ur=t=>{let r=0;return t.length>=8&&r++,/[a-z]/.test(t)&&/[A-Z]/.test(t)&&r++,/\d/.test(t)&&r++,/[^A-Za-z0-9]/.test(t)&&r++,r};function I({icon:t,title:r,subtitle:a,color:n="primary",danger:d=!1,children:u}){return e.jsxs(V,{sx:d?{borderColor:"error.light"}:void 0,children:[e.jsxs(p,{direction:"row",spacing:1.75,alignItems:"center",sx:{px:3,py:2.25,borderBottom:1,borderColor:"divider",background:l=>`linear-gradient(90deg, ${l.palette[n].lighter}66 0%, ${l.palette.background.paper} 72%)`},children:[e.jsx(j,{sx:{width:40,height:40,borderRadius:2,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${n}.lighter`,color:`${n}.main`},children:e.jsx(t,{fontSize:"small"})}),e.jsxs(j,{sx:{minWidth:0},children:[e.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.3},children:r}),a&&e.jsx(C,{variant:"caption",color:"text.secondary",children:a})]})]}),e.jsx(j,{sx:{px:3},children:u})]})}function S({label:t,description:r,children:a,align:n="center"}){return e.jsxs(T,{container:!0,spacing:2,alignItems:n,sx:{py:2.5,borderRadius:2,transition:"background-color .15s","&:hover":{bgcolor:"grey.50"}},children:[e.jsxs(T,{item:!0,xs:12,sm:5,children:[e.jsx(C,{variant:"subtitle2",sx:{fontWeight:600,color:"grey.800"},children:t}),r&&e.jsx(C,{variant:"caption",color:"text.secondary",children:r})]}),e.jsx(T,{item:!0,xs:12,sm:7,children:a})]})}const B={display:"flex",justifyContent:{sm:"flex-end"}};function U({label:t,value:r,onChange:a,autoComplete:n}){const[d,u]=b.useState(!1);return e.jsx(A,{fullWidth:!0,size:"small",type:d?"text":"password",label:t,value:r,onChange:a,autoComplete:n,InputProps:{endAdornment:e.jsx(st,{position:"end",children:e.jsx(Je,{onClick:()=>u(l=>!l),edge:"end",size:"small",children:d?e.jsx(tt,{fontSize:"small"}):e.jsx(rt,{fontSize:"small"})})})}})}function jr(){const[t,r]=b.useState(0),[a,n]=b.useState(!1),[d,u]=b.useState(!1),[l,w]=b.useState(we),[v,y]=b.useState(ye),[s,h]=b.useState(Se),k=o=>z=>{w(f=>({...f,[o]:z.target.value})),u(!0)},O=o=>z=>{y(f=>({...f,[o]:z.target.checked})),u(!0)},P=o=>z=>{h(f=>({...f,[o]:z.target.value})),u(!0)},E=()=>{n(!0),u(!1)},L=()=>{w(we),y(ye),h(Se),u(!1)},c=ur(s.newPassword),i=dr[c],g=s.confirmPassword&&s.newPassword!==s.confirmPassword;return e.jsxs(e.Fragment,{children:[e.jsx(at,{title:"Settings",breadcrumbs:[{label:"Settings"}],action:e.jsxs(p,{direction:"row",spacing:1.5,alignItems:"center",children:[d&&e.jsx(G,{size:"small",label:"Unsaved changes",sx:{bgcolor:"warning.lighter",color:"warning.dark",fontWeight:600}}),e.jsx(N,{variant:"outlined",onClick:L,children:"Discard"}),e.jsx(N,{variant:"contained",startIcon:e.jsx(ke,{}),onClick:E,children:"Save Changes"})]})}),e.jsxs(T,{container:!0,spacing:2.5,children:[e.jsx(T,{item:!0,xs:12,md:3,children:e.jsxs(p,{spacing:2.5,sx:{position:{md:"sticky"},top:{md:88}},children:[e.jsxs(V,{sx:{p:1.5},children:[e.jsx(C,{variant:"overline",sx:{px:1,color:"text.secondary",fontWeight:700,letterSpacing:.6},children:"Preferences"}),e.jsx(p,{spacing:.25,sx:{mt:.5},children:lr.map((o,z)=>{const f=t===z,H=o.icon;return e.jsxs(p,{direction:"row",spacing:1.5,alignItems:"center",onClick:()=>r(z),sx:{px:1.5,py:1.25,borderRadius:2,cursor:"pointer",position:"relative",bgcolor:f?"primary.lighter":"transparent",transition:"background-color .15s","&:hover":{bgcolor:f?"primary.lighter":"grey.50"},"&::before":f?{content:'""',position:"absolute",left:0,top:9,bottom:9,width:3,borderRadius:3,bgcolor:"primary.main"}:{}},children:[e.jsx(j,{sx:{width:34,height:34,borderRadius:1.5,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:f?"primary.main":"grey.100",color:f?"#fff":"grey.600"},children:e.jsx(H,{fontSize:"small"})}),e.jsxs(j,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(C,{variant:"subtitle2",sx:{fontWeight:600,color:f?"primary.main":"grey.800"},children:o.label}),e.jsx(C,{variant:"caption",color:"text.secondary",children:o.desc})]}),e.jsx(Pe,{sx:{fontSize:18,color:f?"primary.main":"grey.300"}})]},o.label)})})]}),e.jsx(V,{sx:{p:2.5,bgcolor:"primary.lighter",borderColor:"primary.100"},children:e.jsxs(p,{spacing:1.25,children:[e.jsx(j,{sx:{width:38,height:38,borderRadius:2,bgcolor:"primary.main",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Me,{fontSize:"small"})}),e.jsxs(j,{children:[e.jsx(C,{variant:"subtitle2",sx:{fontWeight:700,color:"primary.dark"},children:"Need a hand?"}),e.jsx(C,{variant:"caption",sx:{color:"primary.dark",opacity:.85},children:"Our team is available 24/7 for operational support."})]}),e.jsx(N,{size:"small",variant:"contained",sx:{alignSelf:"flex-start"},children:"Contact support"})]})})]})}),e.jsxs(T,{item:!0,xs:12,md:9,children:[t===0&&e.jsxs(p,{spacing:2.5,children:[e.jsx(V,{sx:{overflow:"hidden"},children:e.jsxs(p,{direction:{xs:"column",sm:"row"},spacing:2.5,alignItems:{sm:"center"},sx:{p:3,background:o=>`linear-gradient(90deg, ${o.palette.primary.lighter}88 0%, ${o.palette.background.paper} 75%)`},children:[e.jsx(Qe,{variant:"rounded",sx:{width:64,height:64,bgcolor:"primary.main",color:"#fff"},children:e.jsx($e,{})}),e.jsxs(j,{sx:{flexGrow:1,minWidth:0},children:[e.jsxs(p,{direction:"row",spacing:1,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[e.jsx(C,{variant:"h5",sx:{fontWeight:700,color:"grey.800"},children:l.orgName}),e.jsx(G,{size:"small",icon:e.jsx(_e,{sx:{fontSize:15,ml:.5}}),label:"Verified",sx:{fontWeight:700,bgcolor:"success.lighter",color:"success.dark","& .MuiChip-icon":{color:"inherit"}}})]}),e.jsxs(C,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:[l.supportEmail," · ",l.contact]})]}),e.jsx(N,{variant:"outlined",size:"small",children:"Change logo"})]})}),e.jsx(I,{icon:te,title:"Organisation",subtitle:"Profile and regional preferences",color:"primary",children:e.jsxs(p,{divider:e.jsx(D,{}),children:[e.jsx(S,{label:"Organisation name",description:"Shown on invoices and exports",children:e.jsx(A,{fullWidth:!0,size:"small",value:l.orgName,onChange:k("orgName")})}),e.jsx(S,{label:"Support email",description:"Where customer replies are routed",children:e.jsx(A,{fullWidth:!0,size:"small",value:l.supportEmail,onChange:k("supportEmail")})}),e.jsx(S,{label:"Contact number",description:"Primary operations line",children:e.jsx(A,{fullWidth:!0,size:"small",value:l.contact,onChange:k("contact")})}),e.jsx(S,{label:"Timezone",description:"Used for schedules and reports",children:e.jsx(A,{select:!0,fullWidth:!0,size:"small",value:l.timezone,onChange:k("timezone"),children:Ie.map(o=>e.jsx(me,{value:o,children:o},o))})}),e.jsx(S,{label:"Language",description:"Console display language",children:e.jsx(A,{select:!0,fullWidth:!0,size:"small",value:l.language,onChange:k("language"),children:Ae.map(o=>e.jsx(me,{value:o,children:o},o))})})]})})]}),t===1&&e.jsxs(p,{spacing:2.5,children:[e.jsx(I,{icon:ae,title:"Notification Preferences",subtitle:"Choose what you get alerted about",color:"primary",children:e.jsx(p,{divider:e.jsx(D,{}),children:cr.map(o=>e.jsx(S,{label:o.t,description:o.d,children:e.jsx(j,{sx:B,children:e.jsx(W,{checked:v[o.k],onChange:O(o.k)})})},o.k))})}),e.jsx(I,{icon:ze,title:"Delivery Channels",subtitle:"How alerts reach your team",color:"primary",children:e.jsxs(p,{divider:e.jsx(D,{}),children:[e.jsx(S,{label:"Email alerts",description:"Send notifications to the support inbox",children:e.jsx(j,{sx:B,children:e.jsx(W,{checked:v.emailAlerts,onChange:O("emailAlerts")})})}),e.jsx(S,{label:"SMS alerts",description:"Send notifications to the registered mobile",children:e.jsx(j,{sx:B,children:e.jsx(W,{checked:v.smsAlerts,onChange:O("smsAlerts")})})})]})})]}),t===2&&e.jsxs(p,{spacing:2.5,children:[e.jsx(I,{icon:oe,title:"Change Password",subtitle:"Use 8+ characters with a mix of letters, numbers & symbols",color:"primary",children:e.jsxs(p,{divider:e.jsx(D,{}),children:[e.jsx(S,{label:"Current password",description:"Enter your existing password",align:"flex-start",children:e.jsx(U,{label:"Current password",value:s.currentPassword,onChange:P("currentPassword"),autoComplete:"current-password"})}),e.jsx(S,{label:"New password",description:"Choose a strong, unique password",align:"flex-start",children:e.jsxs(j,{children:[e.jsx(U,{label:"New password",value:s.newPassword,onChange:P("newPassword"),autoComplete:"new-password"}),s.newPassword&&e.jsxs(p,{direction:"row",spacing:1.5,alignItems:"center",sx:{mt:1},children:[e.jsx(ot,{variant:"determinate",value:c/4*100,color:i.color,sx:{flexGrow:1,height:6,borderRadius:3}}),e.jsx(C,{variant:"caption",sx:{fontWeight:700,color:`${i.color}.main`,minWidth:56},children:i.label})]})]})}),e.jsx(S,{label:"Confirm new password",description:"Re-enter the new password",align:"flex-start",children:e.jsxs(j,{children:[e.jsx(U,{label:"Confirm new password",value:s.confirmPassword,onChange:P("confirmPassword"),autoComplete:"new-password"}),g&&e.jsx(C,{variant:"caption",color:"error.main",sx:{mt:.75,display:"block"},children:"Passwords do not match"})]})})]})}),e.jsx(I,{icon:Y,title:"Two-Factor Authentication",subtitle:"Add an extra layer of security to your account",color:"primary",children:e.jsx(S,{label:"Authenticator app",description:"Require a one-time code at sign-in for extra security",children:e.jsxs(p,{direction:"row",spacing:1.5,alignItems:"center",sx:{justifyContent:{sm:"flex-end"}},children:[e.jsx(G,{size:"small",icon:e.jsx(Y,{sx:{fontSize:15,ml:.5}}),label:s.twoFactor?"Enabled":"Disabled",sx:{fontWeight:700,bgcolor:s.twoFactor?"success.lighter":"grey.100",color:s.twoFactor?"success.dark":"grey.600","& .MuiChip-icon":{color:"inherit"}}}),e.jsx(W,{checked:s.twoFactor,onChange:o=>{h(z=>({...z,twoFactor:o.target.checked})),u(!0)}})]})})}),e.jsx(I,{icon:Re,title:"Danger Zone",subtitle:"Irreversible and high-impact actions",color:"error",danger:!0,children:e.jsx(S,{label:"Sign out of all sessions",description:"End every active session on all devices",children:e.jsx(j,{sx:B,children:e.jsx(N,{variant:"outlined",color:"error",startIcon:e.jsx(Oe,{}),onClick:()=>{localStorage.removeItem("auth_token"),window.location.href="/login"},children:"Sign out everywhere"})})})})]})]})]}),e.jsx(bt,{open:a,autoHideDuration:2500,onClose:()=>n(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:e.jsx(nt,{severity:"success",variant:"filled",onClose:()=>n(!1),sx:{width:"100%"},children:"Settings saved successfully."})})]})}export{jr as default}; diff --git a/dist/assets/StatusChip-ioS4PHcC.js b/dist/assets/StatusChip-DTSEpe4F.js similarity index 97% rename from dist/assets/StatusChip-ioS4PHcC.js rename to dist/assets/StatusChip-DTSEpe4F.js index 0b2e5d2..2eb6418 100644 --- a/dist/assets/StatusChip-ioS4PHcC.js +++ b/dist/assets/StatusChip-DTSEpe4F.js @@ -1 +1 @@ -import{l as R,m as S,a as $,n as M,o as O,_ as j,j as e,p as z,v as E,w as k,r as d,i as u,B as f,S as v,T as p}from"./index-Dg-wT72v.js";import{C as F}from"./Link-CndAQvyC.js";import{a as I}from"./PageHeader-DgkErsA7.js";function A(r){return R("MuiCardContent",r)}S("MuiCardContent",["root"]);const D=["className","component"],V=r=>{const{classes:a}=r;return E({root:["root"]},A,a)},H=k("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(r,a)=>a.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),P=$.forwardRef(function(a,t){const l=M({props:a,name:"MuiCardContent"}),{className:s,component:n="div"}=l,c=O(l,D),o=j({},l,{component:n}),i=V(o);return e.jsx(H,j({as:n,className:z(i.root,s),ownerState:o,ref:t},c))});var b={},L=u;Object.defineProperty(b,"__esModule",{value:!0});var U=b.default=void 0,q=L(d()),N=e;U=b.default=(0,q.default)((0,N.jsx)("path",{d:"M7.25 12.5 4.75 9H3.5v6h1.25v-3.5L7.3 15h1.2V9H7.25zM9.5 15h4v-1.25H11v-1.11h2.5v-1.26H11v-1.12h2.5V9h-4zm9.75-6v4.5h-1.12V9.99h-1.25v3.52h-1.13V9H14.5v5c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V9z"}),"FiberNewOutlined");var g={},B=u;Object.defineProperty(g,"__esModule",{value:!0});var T=g.default=void 0,W=B(d()),C=e;T=g.default=(0,W.default)([(0,C.jsx)("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-1 18H5V9h14zm1-13H4V4h16z"},"0"),(0,C.jsx)("path",{d:"M9 12h6v2H9z"},"1")],"Inventory2Outlined");var x={},G=u;Object.defineProperty(x,"__esModule",{value:!0});var Y=x.default=void 0,J=G(d()),K=e;Y=x.default=(0,J.default)((0,K.jsx)("path",{d:"M12.22 19.85c-.18.18-.5.21-.71 0-.18-.18-.21-.5 0-.71l3.39-3.39-1.41-1.41-3.39 3.39c-.19.2-.51.19-.71 0-.21-.21-.18-.53 0-.71l3.39-3.39-1.41-1.41-3.39 3.39c-.18.18-.5.21-.71 0-.19-.19-.19-.51 0-.71l3.39-3.39-1.42-1.41-3.39 3.39c-.18.18-.5.21-.71 0-.19-.2-.19-.51 0-.71L9.52 8.4l1.87 1.86c.95.95 2.59.94 3.54 0 .98-.98.98-2.56 0-3.54l-1.86-1.86.28-.28c.78-.78 2.05-.78 2.83 0l4.24 4.24c.78.78.78 2.05 0 2.83zm9.61-6.78c1.56-1.56 1.56-4.09 0-5.66l-4.24-4.24c-1.56-1.56-4.09-1.56-5.66 0l-.28.28-.28-.28c-1.56-1.56-4.09-1.56-5.66 0L2.17 6.71C.75 8.13.62 10.34 1.77 11.9l1.45-1.45c-.39-.75-.26-1.7.37-2.33l3.54-3.54c.78-.78 2.05-.78 2.83 0l3.56 3.56c.18.18.21.5 0 .71-.21.21-.53.18-.71 0L9.52 5.57l-5.8 5.79c-.98.97-.98 2.56 0 3.54.39.39.89.63 1.42.7.07.52.3 1.02.7 1.42.4.4.9.63 1.42.7.07.52.3 1.02.7 1.42.4.4.9.63 1.42.7.07.54.31 1.03.7 1.42.47.47 1.1.73 1.77.73.67 0 1.3-.26 1.77-.73z"}),"HandshakeOutlined");var h={},Q=u;Object.defineProperty(h,"__esModule",{value:!0});var _=h.default=void 0,X=Q(d()),Z=e;_=h.default=(0,X.default)((0,Z.jsx)("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0 .39-.39.39-1.02 0-1.41l-6.59-6.59a.9959.9959 0 0 0-1.41 0l-6.6 6.58c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1"}),"ArrowUpwardRounded");var m={},ee=u;Object.defineProperty(m,"__esModule",{value:!0});var y=m.default=void 0,re=ee(d()),oe=e;y=m.default=(0,re.default)((0,oe.jsx)("path",{d:"M11 5v11.17l-4.88-4.88c-.39-.39-1.03-.39-1.42 0-.39.39-.39 1.02 0 1.41l6.59 6.59c.39.39 1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L13 16.17V5c0-.55-.45-1-1-1s-1 .45-1 1"}),"ArrowDownwardRounded");function se({title:r,value:a,icon:t,color:l="primary",trend:s,caption:n,accent:c=!1}){const o=typeof s=="number"?s>=0:null;return e.jsxs(F,{sx:{height:"100%",position:"relative",overflow:"hidden",borderRadius:3,boxShadow:"0 8px 24px rgba(0,0,0,0.03)",border:"1px solid rgba(0,0,0,0.04)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{transform:"translateY(-4px)",boxShadow:"0 16px 32px rgba(0,0,0,0.06)"},background:i=>`linear-gradient(145deg, ${i.palette.background.paper} 0%, ${i.palette[l].lighter}15 100%)`},children:[t&&e.jsx(f,{sx:{position:"absolute",right:-15,bottom:-15,opacity:.04,transform:"rotate(-15deg)",pointerEvents:"none"},children:e.jsx(t,{sx:{fontSize:110}})}),e.jsxs(P,{sx:{p:2.5,"&:last-child":{pb:2.5},height:"100%",display:"flex",flexDirection:"column"},children:[e.jsxs(v,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:1.5,position:"relative",zIndex:2},children:[e.jsx(p,{variant:"body2",sx:{fontWeight:600,color:"text.secondary"},children:r}),t&&e.jsx(f,{sx:{width:38,height:38,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${l}.lighter`,color:`${l}.main`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.05)"},children:e.jsx(t,{fontSize:"small"})})]}),e.jsx(f,{sx:{flexGrow:1,position:"relative",zIndex:2},children:e.jsx(p,{variant:"h4",sx:{fontWeight:800,color:"grey.900",letterSpacing:"-0.5px",lineHeight:1},children:a})}),(o!==null||n)&&e.jsxs(v,{direction:"row",spacing:1,alignItems:"center",sx:{mt:2,pt:1.5,borderTop:"1px dashed rgba(0,0,0,0.06)",position:"relative",zIndex:2},children:[o!==null&&e.jsxs(v,{direction:"row",spacing:.25,alignItems:"center",sx:{bgcolor:o?"success.lighter":"error.lighter",px:.75,py:.25,borderRadius:1},children:[o?e.jsx(_,{sx:{fontSize:14,color:"success.dark"}}):e.jsx(y,{sx:{fontSize:14,color:"error.dark"}}),e.jsxs(p,{variant:"caption",sx:{fontWeight:700,color:o?"success.dark":"error.dark"},children:[Math.abs(s),"%"]})]}),n&&e.jsx(p,{variant:"caption",sx:{color:"text.secondary",fontWeight:600},children:n})]})]})]})}const ae={pending:{color:"warning",label:"Pending"},created:{color:"info",label:"Created"},assigned:{color:"info",label:"Assigned"},accepted:{color:"info",label:"Accepted"},arrived:{color:"info",label:"Arrived"},picked:{color:"primary",label:"Picked"},"in-transit":{color:"info",label:"In Transit"},active:{color:"primary",label:"Active"},delivered:{color:"success",label:"Delivered"},completed:{color:"success",label:"Completed"},skipped:{color:"warning",label:"Skipped"},failed:{color:"error",label:"Failed"},cancelled:{color:"error",label:"Cancelled"},newclient:{color:"info",label:"New Client"},contacted:{color:"warning",label:"Contacted"},onboarded:{color:"success",label:"Onboarded"},lost:{color:"error",label:"Lost"},admin:{color:"primary",label:"Admin"},rep:{color:"info",label:"Rep"},manager:{color:"success",label:"Manager"},support:{color:"warning",label:"Support"},online:{color:"success",label:"Online"},offline:{color:"default",label:"Offline"},"on-delivery":{color:"info",label:"On Delivery"},inactive:{color:"default",label:"Inactive"},paid:{color:"success",label:"Paid"},open:{color:"info",label:"Open"},overdue:{color:"error",label:"Overdue"},prepaid:{color:"success",label:"Prepaid"},cod:{color:"warning",label:"COD"}},w={success:{bg:"#E3F6EC",fg:"#00773B"},warning:{bg:"#FFF7E0",fg:"#8A6500"},info:{bg:"#E0F7F8",fg:"#00727B"},error:{bg:"#FEEAE9",fg:"#A82216"},primary:{bg:"#F8E0E3",fg:"#9E0E20"},default:{bg:"#F0F0F0",fg:"#595959"}};function ie({status:r,size:a="small",label:t,sx:l}){const s=String(r||"").toLowerCase().replace(/\s+/g,"-"),n=String(r||"").replace(/[_-]+/g," ").replace(/\b\w/g,i=>i.toUpperCase()),c=ae[s]||{color:"default",label:n||r},o=w[c.color]||w.default;return e.jsx(I,{size:a,label:t||c.label,sx:{bgcolor:o.bg,color:o.fg,border:"none",...l}})}export{se as S,T as a,Y as b,ie as c,U as d}; +import{l as R,m as S,a as $,n as M,o as O,_ as j,j as e,p as z,v as E,w as k,r as d,i as u,B as f,S as v,T as p}from"./index-J0uxx8As.js";import{C as F}from"./Link-DdF3Xu1F.js";import{a as I}from"./PageHeader-TW1dMGrU.js";function A(r){return R("MuiCardContent",r)}S("MuiCardContent",["root"]);const D=["className","component"],V=r=>{const{classes:a}=r;return E({root:["root"]},A,a)},H=k("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(r,a)=>a.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),P=$.forwardRef(function(a,t){const l=M({props:a,name:"MuiCardContent"}),{className:s,component:n="div"}=l,c=O(l,D),o=j({},l,{component:n}),i=V(o);return e.jsx(H,j({as:n,className:z(i.root,s),ownerState:o,ref:t},c))});var b={},L=u;Object.defineProperty(b,"__esModule",{value:!0});var U=b.default=void 0,q=L(d()),N=e;U=b.default=(0,q.default)((0,N.jsx)("path",{d:"M7.25 12.5 4.75 9H3.5v6h1.25v-3.5L7.3 15h1.2V9H7.25zM9.5 15h4v-1.25H11v-1.11h2.5v-1.26H11v-1.12h2.5V9h-4zm9.75-6v4.5h-1.12V9.99h-1.25v3.52h-1.13V9H14.5v5c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V9z"}),"FiberNewOutlined");var g={},B=u;Object.defineProperty(g,"__esModule",{value:!0});var T=g.default=void 0,W=B(d()),C=e;T=g.default=(0,W.default)([(0,C.jsx)("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-1 18H5V9h14zm1-13H4V4h16z"},"0"),(0,C.jsx)("path",{d:"M9 12h6v2H9z"},"1")],"Inventory2Outlined");var x={},G=u;Object.defineProperty(x,"__esModule",{value:!0});var Y=x.default=void 0,J=G(d()),K=e;Y=x.default=(0,J.default)((0,K.jsx)("path",{d:"M12.22 19.85c-.18.18-.5.21-.71 0-.18-.18-.21-.5 0-.71l3.39-3.39-1.41-1.41-3.39 3.39c-.19.2-.51.19-.71 0-.21-.21-.18-.53 0-.71l3.39-3.39-1.41-1.41-3.39 3.39c-.18.18-.5.21-.71 0-.19-.19-.19-.51 0-.71l3.39-3.39-1.42-1.41-3.39 3.39c-.18.18-.5.21-.71 0-.19-.2-.19-.51 0-.71L9.52 8.4l1.87 1.86c.95.95 2.59.94 3.54 0 .98-.98.98-2.56 0-3.54l-1.86-1.86.28-.28c.78-.78 2.05-.78 2.83 0l4.24 4.24c.78.78.78 2.05 0 2.83zm9.61-6.78c1.56-1.56 1.56-4.09 0-5.66l-4.24-4.24c-1.56-1.56-4.09-1.56-5.66 0l-.28.28-.28-.28c-1.56-1.56-4.09-1.56-5.66 0L2.17 6.71C.75 8.13.62 10.34 1.77 11.9l1.45-1.45c-.39-.75-.26-1.7.37-2.33l3.54-3.54c.78-.78 2.05-.78 2.83 0l3.56 3.56c.18.18.21.5 0 .71-.21.21-.53.18-.71 0L9.52 5.57l-5.8 5.79c-.98.97-.98 2.56 0 3.54.39.39.89.63 1.42.7.07.52.3 1.02.7 1.42.4.4.9.63 1.42.7.07.52.3 1.02.7 1.42.4.4.9.63 1.42.7.07.54.31 1.03.7 1.42.47.47 1.1.73 1.77.73.67 0 1.3-.26 1.77-.73z"}),"HandshakeOutlined");var h={},Q=u;Object.defineProperty(h,"__esModule",{value:!0});var _=h.default=void 0,X=Q(d()),Z=e;_=h.default=(0,X.default)((0,Z.jsx)("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0 .39-.39.39-1.02 0-1.41l-6.59-6.59a.9959.9959 0 0 0-1.41 0l-6.6 6.58c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1"}),"ArrowUpwardRounded");var m={},ee=u;Object.defineProperty(m,"__esModule",{value:!0});var y=m.default=void 0,re=ee(d()),oe=e;y=m.default=(0,re.default)((0,oe.jsx)("path",{d:"M11 5v11.17l-4.88-4.88c-.39-.39-1.03-.39-1.42 0-.39.39-.39 1.02 0 1.41l6.59 6.59c.39.39 1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L13 16.17V5c0-.55-.45-1-1-1s-1 .45-1 1"}),"ArrowDownwardRounded");function se({title:r,value:a,icon:t,color:l="primary",trend:s,caption:n,accent:c=!1}){const o=typeof s=="number"?s>=0:null;return e.jsxs(F,{sx:{height:"100%",position:"relative",overflow:"hidden",borderRadius:3,boxShadow:"0 8px 24px rgba(0,0,0,0.03)",border:"1px solid rgba(0,0,0,0.04)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{transform:"translateY(-4px)",boxShadow:"0 16px 32px rgba(0,0,0,0.06)"},background:i=>`linear-gradient(145deg, ${i.palette.background.paper} 0%, ${i.palette[l].lighter}15 100%)`},children:[t&&e.jsx(f,{sx:{position:"absolute",right:-15,bottom:-15,opacity:.04,transform:"rotate(-15deg)",pointerEvents:"none"},children:e.jsx(t,{sx:{fontSize:110}})}),e.jsxs(P,{sx:{p:2.5,"&:last-child":{pb:2.5},height:"100%",display:"flex",flexDirection:"column"},children:[e.jsxs(v,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:1.5,position:"relative",zIndex:2},children:[e.jsx(p,{variant:"body2",sx:{fontWeight:600,color:"text.secondary"},children:r}),t&&e.jsx(f,{sx:{width:38,height:38,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${l}.lighter`,color:`${l}.main`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.05)"},children:e.jsx(t,{fontSize:"small"})})]}),e.jsx(f,{sx:{flexGrow:1,position:"relative",zIndex:2},children:e.jsx(p,{variant:"h4",sx:{fontWeight:800,color:"grey.900",letterSpacing:"-0.5px",lineHeight:1},children:a})}),(o!==null||n)&&e.jsxs(v,{direction:"row",spacing:1,alignItems:"center",sx:{mt:2,pt:1.5,borderTop:"1px dashed rgba(0,0,0,0.06)",position:"relative",zIndex:2},children:[o!==null&&e.jsxs(v,{direction:"row",spacing:.25,alignItems:"center",sx:{bgcolor:o?"success.lighter":"error.lighter",px:.75,py:.25,borderRadius:1},children:[o?e.jsx(_,{sx:{fontSize:14,color:"success.dark"}}):e.jsx(y,{sx:{fontSize:14,color:"error.dark"}}),e.jsxs(p,{variant:"caption",sx:{fontWeight:700,color:o?"success.dark":"error.dark"},children:[Math.abs(s),"%"]})]}),n&&e.jsx(p,{variant:"caption",sx:{color:"text.secondary",fontWeight:600},children:n})]})]})]})}const ae={pending:{color:"warning",label:"Pending"},created:{color:"info",label:"Created"},assigned:{color:"info",label:"Assigned"},accepted:{color:"info",label:"Accepted"},arrived:{color:"info",label:"Arrived"},picked:{color:"primary",label:"Picked"},"in-transit":{color:"info",label:"In Transit"},active:{color:"primary",label:"Active"},delivered:{color:"success",label:"Delivered"},completed:{color:"success",label:"Completed"},skipped:{color:"warning",label:"Skipped"},failed:{color:"error",label:"Failed"},cancelled:{color:"error",label:"Cancelled"},newclient:{color:"info",label:"New Client"},contacted:{color:"warning",label:"Contacted"},onboarded:{color:"success",label:"Onboarded"},lost:{color:"error",label:"Lost"},admin:{color:"primary",label:"Admin"},rep:{color:"info",label:"Rep"},manager:{color:"success",label:"Manager"},support:{color:"warning",label:"Support"},online:{color:"success",label:"Online"},offline:{color:"default",label:"Offline"},"on-delivery":{color:"info",label:"On Delivery"},inactive:{color:"default",label:"Inactive"},paid:{color:"success",label:"Paid"},open:{color:"info",label:"Open"},overdue:{color:"error",label:"Overdue"},prepaid:{color:"success",label:"Prepaid"},cod:{color:"warning",label:"COD"}},w={success:{bg:"#E3F6EC",fg:"#00773B"},warning:{bg:"#FFF7E0",fg:"#8A6500"},info:{bg:"#E0F7F8",fg:"#00727B"},error:{bg:"#FEEAE9",fg:"#A82216"},primary:{bg:"#F8E0E3",fg:"#9E0E20"},default:{bg:"#F0F0F0",fg:"#595959"}};function ie({status:r,size:a="small",label:t,sx:l}){const s=String(r||"").toLowerCase().replace(/\s+/g,"-"),n=String(r||"").replace(/[_-]+/g," ").replace(/\b\w/g,i=>i.toUpperCase()),c=ae[s]||{color:"default",label:n||r},o=w[c.color]||w.default;return e.jsx(I,{size:a,label:t||c.label,sx:{bgcolor:o.bg,color:o.fg,border:"none",...l}})}export{se as S,T as a,Y as b,ie as c,U as d}; diff --git a/dist/assets/StorefrontOutlined-BR_dFc0C.js b/dist/assets/StorefrontOutlined-C6lTcD4z.js similarity index 97% rename from dist/assets/StorefrontOutlined-BR_dFc0C.js rename to dist/assets/StorefrontOutlined-C6lTcD4z.js index c1f2595..219932c 100644 --- a/dist/assets/StorefrontOutlined-BR_dFc0C.js +++ b/dist/assets/StorefrontOutlined-C6lTcD4z.js @@ -1 +1 @@ -import{r as e,j as a,i as r}from"./index-Dg-wT72v.js";var t={},v=r;Object.defineProperty(t,"__esModule",{value:!0});var c=t.default=void 0,i=v(e()),n=a;c=t.default=(0,i.default)((0,n.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var u={},f=r;Object.defineProperty(u,"__esModule",{value:!0});var s=u.default=void 0,_=f(e()),p=a;s=u.default=(0,_.default)((0,p.jsx)("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");var l={},j=r;Object.defineProperty(l,"__esModule",{value:!0});var $=l.default=void 0,h=j(e()),M=a;$=l.default=(0,h.default)((0,M.jsx)("path",{d:"M12 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m6-1.8C18 6.57 15.35 4 12 4s-6 2.57-6 6.2c0 2.34 1.95 5.44 6 9.14 4.05-3.7 6-6.8 6-9.14M12 2c4.2 0 8 3.22 8 8.2 0 3.32-2.67 7.25-8 11.8-5.33-4.55-8-8.48-8-11.8C4 5.22 7.8 2 12 2"}),"PlaceOutlined");var d={},m=r;Object.defineProperty(d,"__esModule",{value:!0});var x=d.default=void 0,R=m(e()),O=a;x=d.default=(0,R.default)((0,O.jsx)("path",{d:"M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5zm-.5 1.5 1.96 2.5H17V9.5zM6 18c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m2.22-3c-.55-.61-1.33-1-2.22-1s-1.67.39-2.22 1H3V6h12v9zM18 18c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"LocalShippingOutlined");var o={},b=r;Object.defineProperty(o,"__esModule",{value:!0});var S=o.default=void 0,y=b(e()),g=a;S=o.default=(0,y.default)((0,g.jsx)("path",{d:"m21.9 8.89-1.05-4.37c-.22-.9-1-1.52-1.91-1.52H5.05c-.9 0-1.69.63-1.9 1.52L2.1 8.89c-.24 1.02-.02 2.06.62 2.88.08.11.19.19.28.29V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6.94c.09-.09.2-.18.28-.28.64-.82.87-1.87.62-2.89m-2.99-3.9 1.05 4.37c.1.42.01.84-.25 1.17-.14.18-.44.47-.94.47-.61 0-1.14-.49-1.21-1.14L16.98 5zM13 5h1.96l.54 4.52c.05.39-.07.78-.33 1.07-.22.26-.54.41-.95.41-.67 0-1.22-.59-1.22-1.31zM8.49 9.52 9.04 5H11v4.69c0 .72-.55 1.31-1.29 1.31-.34 0-.65-.15-.89-.41-.25-.29-.37-.68-.33-1.07m-4.45-.16L5.05 5h1.97l-.58 4.86c-.08.65-.6 1.14-1.21 1.14-.49 0-.8-.29-.93-.47-.27-.32-.36-.75-.26-1.17M5 19v-6.03c.08.01.15.03.23.03.87 0 1.66-.36 2.24-.95.6.6 1.4.95 2.31.95.87 0 1.65-.36 2.23-.93.59.57 1.39.93 2.29.93.84 0 1.64-.35 2.24-.95.58.59 1.37.95 2.24.95.08 0 .15-.02.23-.03V19z"}),"StorefrontOutlined");export{c as a,$ as b,S as c,s as d,x as e}; +import{r as e,j as a,i as r}from"./index-J0uxx8As.js";var t={},v=r;Object.defineProperty(t,"__esModule",{value:!0});var c=t.default=void 0,i=v(e()),n=a;c=t.default=(0,i.default)((0,n.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var u={},f=r;Object.defineProperty(u,"__esModule",{value:!0});var s=u.default=void 0,_=f(e()),p=a;s=u.default=(0,_.default)((0,p.jsx)("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");var l={},j=r;Object.defineProperty(l,"__esModule",{value:!0});var $=l.default=void 0,h=j(e()),M=a;$=l.default=(0,h.default)((0,M.jsx)("path",{d:"M12 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m6-1.8C18 6.57 15.35 4 12 4s-6 2.57-6 6.2c0 2.34 1.95 5.44 6 9.14 4.05-3.7 6-6.8 6-9.14M12 2c4.2 0 8 3.22 8 8.2 0 3.32-2.67 7.25-8 11.8-5.33-4.55-8-8.48-8-11.8C4 5.22 7.8 2 12 2"}),"PlaceOutlined");var d={},m=r;Object.defineProperty(d,"__esModule",{value:!0});var x=d.default=void 0,R=m(e()),O=a;x=d.default=(0,R.default)((0,O.jsx)("path",{d:"M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5zm-.5 1.5 1.96 2.5H17V9.5zM6 18c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m2.22-3c-.55-.61-1.33-1-2.22-1s-1.67.39-2.22 1H3V6h12v9zM18 18c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"LocalShippingOutlined");var o={},b=r;Object.defineProperty(o,"__esModule",{value:!0});var S=o.default=void 0,y=b(e()),g=a;S=o.default=(0,y.default)((0,g.jsx)("path",{d:"m21.9 8.89-1.05-4.37c-.22-.9-1-1.52-1.91-1.52H5.05c-.9 0-1.69.63-1.9 1.52L2.1 8.89c-.24 1.02-.02 2.06.62 2.88.08.11.19.19.28.29V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6.94c.09-.09.2-.18.28-.28.64-.82.87-1.87.62-2.89m-2.99-3.9 1.05 4.37c.1.42.01.84-.25 1.17-.14.18-.44.47-.94.47-.61 0-1.14-.49-1.21-1.14L16.98 5zM13 5h1.96l.54 4.52c.05.39-.07.78-.33 1.07-.22.26-.54.41-.95.41-.67 0-1.22-.59-1.22-1.31zM8.49 9.52 9.04 5H11v4.69c0 .72-.55 1.31-1.29 1.31-.34 0-.65-.15-.89-.41-.25-.29-.37-.68-.33-1.07m-4.45-.16L5.05 5h1.97l-.58 4.86c-.08.65-.6 1.14-1.21 1.14-.49 0-.8-.29-.93-.47-.27-.32-.36-.75-.26-1.17M5 19v-6.03c.08.01.15.03.23.03.87 0 1.66-.36 2.24-.95.6.6 1.4.95 2.31.95.87 0 1.65-.36 2.23-.93.59.57 1.39.93 2.29.93.84 0 1.64-.35 2.24-.95.58.59 1.37.95 2.24.95.08 0 .15-.02.23-.03V19z"}),"StorefrontOutlined");export{c as a,$ as b,S as c,s as d,x as e}; diff --git a/dist/assets/Survey-Coph8xEf.js b/dist/assets/Survey-B7FNo3gA.js similarity index 96% rename from dist/assets/Survey-Coph8xEf.js rename to dist/assets/Survey-B7FNo3gA.js index f5b76bb..96e0e76 100644 --- a/dist/assets/Survey-Coph8xEf.js +++ b/dist/assets/Survey-B7FNo3gA.js @@ -1 +1 @@ -import{r as ce,j as e,i as de,a as c,B as i,N as g,T as n,H as xe,S as h,C as Y,c as he,O as ge,Q as ue,L as Z,M as T,I as Q}from"./index-Dg-wT72v.js";import{d as pe,D as J,a as X,b as ee,c as re,e as fe}from"./EditOutlined-COfONJBH.js";import{d as se,T as me,D as je,a as be}from"./PhoneOutlined-BqFvwse4.js";import{c as U,d as ye,a as ve,b as L,e as _e}from"./StorefrontOutlined-BR_dFc0C.js";import{d as Ce}from"./MapOutlined-C-CxlyED.js";import{P as Se,G as a,A as te,a as z}from"./PageHeader-DgkErsA7.js";import{C as oe}from"./Link-CndAQvyC.js";import{T as y}from"./TextField-COVOKpzm.js";import{I as Ie}from"./InputAdornment-HqPFSHfS.js";import{B as S}from"./Button-COL1_fTB.js";import"./TableCell-ClQIqE-T.js";var F={},ke=de;Object.defineProperty(F,"__esModule",{value:!0});var W=F.default=void 0,Re=ke(ce()),ze=e;W=F.default=(0,Re.default)((0,ze.jsx)("path",{d:"M7 15h7v2H7zm0-4h10v2H7zm0-4h10v2H7zm12-4h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-.14 0-.27.01-.4.04-.39.08-.74.28-1.01.55-.18.18-.33.4-.43.64-.1.23-.16.49-.16.77v14c0 .27.06.54.16.78s.25.45.43.64c.27.27.62.47 1.01.55.13.02.26.03.4.03h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7-.25c.41 0 .75.34.75.75s-.34.75-.75.75-.75-.34-.75-.75.34-.75.75-.75M19 19H5V5h14z"}),"AssignmentOutlined");const M="https://api.doormile.com/api/v1",ne=()=>{const r=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...r?{Authorization:`Bearer ${r}`}:{}}},We={textTransform:"uppercase",letterSpacing:.4,fontSize:"0.68rem",fontWeight:700,color:"grey.700"};function V({label:r,color:o="default"}){return r?e.jsx(z,{size:"small",label:r,sx:{fontWeight:600,...o==="default"?{bgcolor:"grey.100",color:"grey.700"}:{bgcolor:`${o}.lighter`,color:`${o}.dark`}}}):e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:"grey.500"},children:"—"})}function b({label:r,children:o}){return e.jsxs(i,{children:[e.jsx(n,{variant:"caption",color:"text.secondary",sx:We,children:r}),e.jsx(i,{sx:{mt:.5},children:o})]})}function $({title:r,value:o,icon:l,gradient:u,percentage:s}){return e.jsxs(i,{sx:{position:"relative",overflow:"hidden",borderRadius:3.5,p:3,color:"white",background:u,boxShadow:"0 10px 30px rgba(0,0,0,0.08)",transition:"box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{boxShadow:"0 20px 40px rgba(0,0,0,0.12)"}},children:[e.jsxs(i,{sx:{position:"relative",zIndex:2},children:[e.jsxs(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(n,{variant:"overline",sx:{fontWeight:700,letterSpacing:1.2,opacity:.9},children:r}),e.jsx(i,{sx:{width:36,height:36,borderRadius:"50%",bgcolor:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:e.jsx(l,{sx:{fontSize:20}})})]}),e.jsxs(h,{direction:"row",alignItems:"baseline",spacing:1.5,sx:{mt:2},children:[e.jsx(n,{variant:"h3",sx:{fontWeight:800,lineHeight:1},children:o}),s&&e.jsx(z,{size:"small",label:s,sx:{height:22,bgcolor:"rgba(255,255,255,0.25)",color:"white",fontWeight:700,borderRadius:1.5,backdropFilter:"blur(4px)"}})]})]}),e.jsx(l,{sx:{position:"absolute",right:-24,bottom:-24,fontSize:160,opacity:.1,zIndex:1,transform:"rotate(-15deg)"}})]})}function D({icon:r,title:o,children:l}){return e.jsxs(i,{sx:{height:"100%",borderRadius:2,border:1,borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"},children:[e.jsxs(h,{direction:"row",spacing:1,alignItems:"center",sx:{px:2,py:1.25,borderBottom:1,borderColor:"divider",bgcolor:g("#c01227",.08)},children:[e.jsx(r,{sx:{fontSize:18,color:"#c01227"}}),e.jsx(n,{variant:"overline",sx:{fontWeight:700,color:"grey.800",letterSpacing:.6,lineHeight:1},children:o})]}),e.jsx(h,{spacing:2,sx:{p:2},children:l})]})}async function Pe(){const r=await fetch(`${M}/admin/competitor-branches?limit=1000`,{headers:ne()});if(!r.ok)throw new Error("Failed to fetch surveys");const o=await r.json(),l=Array.isArray(o)?o:o.data||[];return{data:l,total:l.length}}async function Ee(r){const o=!!r.id,l=o?`${M}/admin/competitor-branches/${r.id}`:`${M}/admin/competitor-branches`,s=await fetch(l,{method:o?"PUT":"POST",headers:ne(),body:JSON.stringify(r)});if(!s.ok){const d=await s.json().catch(()=>({}));throw new Error(d.error||d.message||"Failed to save survey")}return s.status===204?{}:s.json().catch(()=>({}))}function we({open:r,onClose:o,onSave:l,initialData:u}){const[s,d]=c.useState({}),[p,m]=c.useState(!1),[x,I]=c.useState(null);c.useEffect(()=>{r&&(d(u||{company:"",area:"",phone:"",rate_per_kg:"",offers_pickup:"no",offers_drop:"no",packing_charge:"",time_in_days:"",plus_code:"",address:""}),I(null))},[r,u]);const j=C=>P=>{d(v=>({...v,[C]:P.target.value}))},k=async()=>{m(!0),I(null);try{const C={...s.id?{id:s.id}:{},company:s.company||"",area:s.area||"",phone:s.phone||"",rate_per_kg:s.rate_per_kg||"",offers_pickup:s.offers_pickup||"no",offers_drop:s.offers_drop||"no",packing_charge:s.packing_charge||"",time_in_days:s.time_in_days||"",plus_code:s.plus_code||"",address:s.address||""};await Ee(C),l(),o()}catch(C){console.error(C),I(C.message||"Failed to save. Please try again.")}finally{m(!1)}};return e.jsxs(J,{open:r,onClose:p?void 0:o,maxWidth:"sm",fullWidth:!0,children:[e.jsx(X,{sx:{fontWeight:800},children:u?"Edit Survey Record":"Add New Survey"}),e.jsxs(ee,{dividers:!0,children:[x&&e.jsx(te,{severity:"error",sx:{mb:2},children:x}),e.jsxs(a,{container:!0,spacing:2,children:[e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,label:"Company",value:s.company||"",onChange:j("company"),size:"small"})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,label:"Area / Zone",value:s.area||"",onChange:j("area"),size:"small"})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,label:"Phone",value:s.phone||"",onChange:j("phone"),size:"small"})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,label:"Rate Per KG",value:s.rate_per_kg||"",onChange:j("rate_per_kg"),size:"small"})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsxs(y,{select:!0,fullWidth:!0,label:"Offers Pickup",value:s.offers_pickup||"no",onChange:j("offers_pickup"),size:"small",children:[e.jsx(T,{value:"yes",children:"Yes"}),e.jsx(T,{value:"no",children:"No"})]})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsxs(y,{select:!0,fullWidth:!0,label:"Offers Drop",value:s.offers_drop||"no",onChange:j("offers_drop"),size:"small",children:[e.jsx(T,{value:"yes",children:"Yes"}),e.jsx(T,{value:"no",children:"No"})]})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,label:"Time in Days",value:s.time_in_days||"",onChange:j("time_in_days"),size:"small"})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,label:"Packing Charge",value:s.packing_charge||"",onChange:j("packing_charge"),size:"small"})}),e.jsx(a,{item:!0,xs:12,children:e.jsx(y,{fullWidth:!0,label:"Plus Code",value:s.plus_code||"",onChange:j("plus_code"),size:"small"})}),e.jsx(a,{item:!0,xs:12,children:e.jsx(y,{fullWidth:!0,multiline:!0,rows:2,label:"Address",value:s.address||"",onChange:j("address"),size:"small"})})]})]}),e.jsxs(re,{sx:{p:2,bgcolor:"grey.50"},children:[e.jsx(S,{onClick:o,disabled:p,color:"inherit",children:"Cancel"}),e.jsx(S,{onClick:k,disabled:p,variant:"contained",sx:{bgcolor:"#c01227","&:hover":{bgcolor:"#a00f20"},borderRadius:2},children:p?"Saving...":"Save Record"})]})]})}function Ae({row:r,onEdit:o,onDelete:l,users:u}){const[s,d]=c.useState(!1),p=u.find(x=>x.id===r.created_by),m=u.find(x=>x.id===r.updated_by);return e.jsxs(i,{sx:{p:2,borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",transition:"border-color 0.2s ease, box-shadow 0.2s ease","&:hover":{borderColor:"#c01227",boxShadow:"0 4px 12px rgba(192, 18, 39, 0.05)"}},children:[e.jsxs(h,{direction:{xs:"column",md:"row"},spacing:3,alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",onClick:()=>d(!s),sx:{cursor:"pointer",userSelect:"none"},children:[e.jsxs(h,{direction:"row",spacing:2,alignItems:"center",sx:{minWidth:240},children:[e.jsx(i,{sx:{p:1.5,borderRadius:2,bgcolor:g("#c01227",.05)},children:e.jsx(L,{sx:{color:"#c01227"}})}),e.jsxs(i,{children:[e.jsx(n,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.900",lineHeight:1.2},children:r.area||"Unknown Area"}),e.jsxs(n,{variant:"body2",sx:{color:"grey.600",display:"flex",alignItems:"center",gap:.5,mt:.5},children:[e.jsx(se,{sx:{fontSize:14}})," ",r.phone||"—"]})]})]}),e.jsxs(h,{direction:"row",spacing:4,sx:{flex:1},justifyContent:{xs:"flex-start",md:"center"},children:[e.jsxs(i,{children:[e.jsx(n,{variant:"caption",sx:{color:"grey.500",fontWeight:700,letterSpacing:.5,display:"block",mb:.5},children:"RATE PER KG"}),e.jsx(V,{label:r.rate_per_kg,color:"success"})]}),e.jsxs(i,{children:[e.jsx(n,{variant:"caption",sx:{color:"grey.500",fontWeight:700,letterSpacing:.5,display:"block",mb:.5},children:"LOGISTICS"}),e.jsx(n,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:r.offers_pickup==="yes"||r.offers_drop==="yes"?`${r.offers_pickup==="yes"?"Pickup":""} ${r.offers_drop==="yes"?"Drop":""}`:"—"})]})]}),e.jsxs(h,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(S,{size:"small",sx:{borderRadius:1.5,color:s?"#c01227":"grey.700",bgcolor:s?g("#c01227",.05):"transparent","&:hover":{bgcolor:g("#c01227",.1),color:"#c01227"}},children:s?"Hide Info":"More Info"}),e.jsx(Q,{size:"small",onClick:x=>{x.stopPropagation(),o(r)},sx:{color:"grey.400","&:hover":{color:"#c01227",bgcolor:g("#c01227",.1)}},children:e.jsx(fe,{fontSize:"small"})}),e.jsx(Q,{size:"small",onClick:x=>{x.stopPropagation(),l(r)},sx:{color:"grey.400","&:hover":{color:"#ef4444",bgcolor:g("#ef4444",.1)}},children:e.jsx(be,{fontSize:"small"})})]})]}),e.jsx(Z,{in:s,timeout:"auto",unmountOnExit:!0,children:e.jsx(i,{sx:{mt:2.5,pt:2.5,borderTop:"1px dashed",borderColor:"divider"},children:e.jsxs(a,{container:!0,spacing:2,alignItems:"stretch",children:[e.jsx(a,{item:!0,xs:12,md:4,children:e.jsxs(D,{icon:U,title:"ENQUIRY DETAILS",children:[e.jsx(b,{label:"RATE PER KG",children:e.jsx(V,{label:r.rate_per_kg,color:"success"})}),e.jsx(b,{label:"PICKUP",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:r.offers_pickup?"grey.800":"grey.500"},children:r.offers_pickup||"—"})}),e.jsx(b,{label:"DROP",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:r.offers_drop?"grey.800":"grey.500"},children:r.offers_drop||"—"})}),e.jsx(b,{label:"PACKING",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:r.packing_charge?"grey.800":"grey.500"},children:r.packing_charge||"—"})})]})}),e.jsx(a,{item:!0,xs:12,md:4,children:e.jsxs(D,{icon:_e,title:"LOGISTICS & OPS",children:[e.jsx(b,{label:"TIME IN DAYS",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:r.time_in_days?"grey.800":"grey.500"},children:r.time_in_days||"—"})}),e.jsx(b,{label:"COMPANY",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.company||"—"})}),e.jsx(b,{label:"CONTACT NUMBER",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.phone||"—"})})]})}),e.jsx(a,{item:!0,xs:12,md:4,children:e.jsxs(D,{icon:L,title:"LOCATION & PINCODE",children:[e.jsx(b,{label:"AREA / ZONE",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.area||"—"})}),e.jsx(b,{label:"PLUS CODE",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:r.plus_code?"grey.800":"grey.500"},children:r.plus_code||"—"})}),e.jsx(b,{label:"FULL ADDRESS",children:e.jsxs(h,{spacing:1.5,children:[e.jsxs(h,{direction:"row",spacing:1,sx:{p:1.5,borderRadius:1.5,bgcolor:"grey.50",border:1,borderColor:"divider"},children:[e.jsx(L,{sx:{fontSize:16,color:"grey.400",mt:"2px"}}),e.jsx(n,{variant:"body2",sx:{color:"grey.800",lineHeight:1.5},children:r.address||"—"})]}),(r.address||r.plus_code)&&e.jsx(S,{component:"a",href:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(r.plus_code?r.plus_code+" "+(r.address||""):r.address)}`,target:"_blank",rel:"noopener",size:"small",variant:"outlined",startIcon:e.jsx(Ce,{sx:{fontSize:16}}),sx:{alignSelf:"flex-start",py:.5,px:1.5,fontSize:"0.75rem",fontWeight:600,borderRadius:2,color:"#c01227",borderColor:g("#c01227",.5),bgcolor:g("#c01227",.05),"&:hover":{borderColor:"#c01227",bgcolor:g("#c01227",.1)}},children:"View on map"})]})})]})}),e.jsx(a,{item:!0,xs:12,children:e.jsx(D,{icon:W,title:"RECORD METADATA",children:e.jsxs(a,{container:!0,spacing:2,children:[e.jsx(a,{item:!0,xs:6,children:e.jsx(b,{label:"CREATED BY",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:p?p.first_name:r.created_by?`User ID: ${r.created_by}`:"System"})})}),e.jsx(a,{item:!0,xs:6,children:e.jsx(b,{label:"LAST EDITED BY",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:m?m.first_name:r.updated_by?`User ID: ${r.updated_by}`:"—"})})})]})})})]})})})]})}function Te({companyName:r,branches:o,onEdit:l,onDelete:u,users:s}){const[d,p]=c.useState(!1);return e.jsxs(oe,{elevation:0,sx:{borderRadius:3,border:"1px solid",borderColor:d?"#c01227":"grey.200",p:{xs:2.5,md:3},mb:2.5,transition:"border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{borderColor:"#c01227",boxShadow:"0 8px 30px rgba(192, 18, 39, 0.08)"}},children:[e.jsxs(h,{direction:{xs:"column",md:"row"},spacing:3,alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",onClick:()=>p(!d),sx:{cursor:"pointer",userSelect:"none"},children:[e.jsxs(h,{direction:"row",spacing:2.5,alignItems:"center",children:[e.jsx(ue,{sx:{width:64,height:64,bgcolor:g("#c01227",.1),color:"#c01227",fontWeight:800,fontSize:"1.5rem",borderRadius:2.5},children:(r||"A")[0].toUpperCase()}),e.jsxs(i,{children:[e.jsx(n,{variant:"h5",sx:{fontWeight:800,lineHeight:1.2,color:"grey.900"},children:r||"Unknown Company"}),e.jsxs(n,{variant:"body2",sx:{color:"grey.600",mt:.5,display:"flex",alignItems:"center",gap:.5},children:[e.jsx(U,{sx:{fontSize:16}})," ",o.length," Location",o.length!==1&&"s"," Surveyed"]})]})]}),e.jsxs(h,{direction:"row",spacing:3,alignItems:"center",children:[e.jsxs(h,{direction:"row",spacing:1,sx:{display:{xs:"none",md:"flex"}},children:[e.jsx(z,{size:"small",label:"First Mile",sx:{bgcolor:g("#c01227",.08),color:"#c01227",fontWeight:700,borderRadius:1.5}}),e.jsx(z,{size:"small",label:"Mid Mile",sx:{bgcolor:g("#c01227",.08),color:"#c01227",fontWeight:700,borderRadius:1.5}}),e.jsx(z,{size:"small",label:"Last Mile",sx:{bgcolor:g("#c01227",.08),color:"#c01227",fontWeight:700,borderRadius:1.5}})]}),e.jsx(h,{direction:"row",spacing:1.5,alignItems:"center",children:e.jsx(S,{sx:{borderRadius:2,py:1,px:3,fontWeight:700,color:d?"#c01227":"grey.700",bgcolor:d?g("#c01227",.1):"grey.100","&:hover":{bgcolor:g("#c01227",.15),color:"#c01227"}},endIcon:d?e.jsx(ye,{}):e.jsx(ve,{}),children:d?"Hide Locations":"View Locations"})})]})]}),e.jsx(Z,{in:d,timeout:"auto",unmountOnExit:!0,children:e.jsx(i,{sx:{mt:3,pt:3,borderTop:"2px dashed",borderColor:"grey.200"},children:e.jsx(h,{spacing:2,children:o.map((m,x)=>e.jsx(Ae,{row:m,onEdit:l,onDelete:u,users:s},m.id??x))})})})]})}function qe(){const[r,o]=c.useState([]),[l,u]=c.useState(!0),[s,d]=c.useState(""),[p,m]=c.useState(0),[x,I]=c.useState(5),[j,k]=c.useState(!1),[C,P]=c.useState(null),[v,E]=c.useState(null),[w,B]=c.useState(!1),[H,A]=c.useState(null),[ie,ae]=c.useState([]),O=()=>{let t=!1;return u(!0),Promise.all([Pe(),he().catch(()=>[])]).then(([f,R])=>{t||(o(f.data||f||[]),ae(R||[]))}).catch(f=>console.error("Error fetching data:",f)).finally(()=>{t||u(!1)}),()=>{t=!0}};c.useEffect(()=>O(),[]);const le=async()=>{B(!0),A(null);try{await ge(v.id),E(null),O()}catch(t){A(t.message||"Failed to delete. Please try again.")}finally{B(!1)}},N=r.filter(t=>(t.company||"").toLowerCase().includes(s.toLowerCase())||(t.area||"").toLowerCase().includes(s.toLowerCase())||(t.phone||"").toLowerCase().includes(s.toLowerCase())),G=N.reduce((t,f)=>{const R=f.company||"Unknown Company";return t[R]||(t[R]=[]),t[R].push(f),t},{}),q=Object.keys(G).sort(),K=q.slice(p*x,p*x+x),_={total:r.length,quoted:r.filter(t=>t.rate_per_kg&&!String(t.rate_per_kg).toLowerCase().includes("not answered")).length,missing:r.filter(t=>!t.rate_per_kg||String(t.rate_per_kg).toLowerCase().includes("not answered")).length};return e.jsxs(i,{sx:{pb:6,bgcolor:"#f8fafc",px:{xs:2,md:4},pt:3,minHeight:"100vh"},children:[e.jsx(Se,{title:"Field Surveys",breadcrumbs:[{label:"Survey Management"}]}),e.jsxs(a,{container:!0,spacing:3,sx:{mb:5,mt:1},children:[e.jsx(a,{item:!0,xs:12,md:4,children:e.jsx($,{title:"TOTAL ENQUIRIES",value:l?"...":_.total,icon:W,gradient:"linear-gradient(135deg, #e11d48 0%, #c01227 100%)"})}),e.jsx(a,{item:!0,xs:12,md:4,children:e.jsx($,{title:"RATES QUOTED",value:l?"...":_.quoted,icon:U,gradient:"linear-gradient(135deg, #10b981 0%, #047857 100%)",percentage:_.total?`${Math.round(_.quoted/_.total*100)}%`:"0%"})}),e.jsx(a,{item:!0,xs:12,md:4,children:e.jsx($,{title:"MISSING INFO",value:l?"...":_.missing,icon:se,gradient:"linear-gradient(135deg, #334155 0%, #0f172a 100%)",percentage:_.total?`${Math.round(_.missing/_.total*100)}%`:"0%"})})]}),e.jsxs(oe,{sx:{borderRadius:2,boxShadow:"0 4px 20px rgba(0,0,0,0.05)",overflow:"hidden"},children:[e.jsxs(i,{sx:{p:3,display:"flex",alignItems:"center",gap:2,borderBottom:"1px solid",borderColor:"grey.100"},children:[e.jsx(i,{sx:{width:48,height:48,borderRadius:2.5,bgcolor:g("#c01227",.1),color:"#c01227",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(W,{})}),e.jsxs(i,{children:[e.jsx(n,{variant:"h6",sx:{fontWeight:700,color:"grey.900"},children:"Survey Records"}),e.jsx(n,{variant:"body2",sx:{color:"grey.600",mt:.5},children:"Manage business enquiry and survey data from the field"})]})]}),e.jsxs(i,{sx:{p:2,borderBottom:"1px solid",borderColor:"grey.100",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(y,{size:"small",placeholder:"Search by company, area or phone...",value:s,onChange:t=>{d(t.target.value),m(0)},sx:{width:{xs:"100%",md:400}},InputProps:{startAdornment:e.jsx(Ie,{position:"start",children:e.jsx(xe,{fontSize:"small"})})}}),e.jsxs(h,{direction:"row",spacing:2,alignItems:"center",children:[!l&&e.jsxs(n,{variant:"body2",sx:{color:"grey.500",fontWeight:600},children:[N.length," records"]}),e.jsx(S,{variant:"contained",startIcon:e.jsx(pe,{}),onClick:()=>{P(null),k(!0)},sx:{bgcolor:"#c01227","&:hover":{bgcolor:"#a00f20"},borderRadius:2,px:2,fontWeight:700,whiteSpace:"nowrap"},children:"Add New Survey"})]})]}),e.jsx(i,{sx:{p:3,bgcolor:"grey.50"},children:l?e.jsx(i,{sx:{display:"flex",justifyContent:"center",py:8},children:e.jsx(Y,{})}):K.length>0?e.jsx(i,{children:K.map(t=>e.jsx(Te,{companyName:t,branches:G[t],onEdit:f=>{P(f),k(!0)},onDelete:f=>E(f),users:ie},t))}):e.jsxs(i,{sx:{py:10,textAlign:"center"},children:[e.jsx(W,{sx:{fontSize:48,color:"grey.300",mb:2}}),e.jsx(n,{variant:"h6",color:"text.secondary",children:"No survey records found."}),e.jsx(n,{variant:"body2",color:"text.disabled",sx:{mt:1},children:"Try adjusting your search filters."})]})}),e.jsx(i,{sx:{borderTop:"1px solid",borderColor:"grey.200",bgcolor:"white"},children:e.jsx(me,{component:"div",count:q.length,page:p,onPageChange:(t,f)=>m(f),rowsPerPage:x,onRowsPerPageChange:t=>{I(parseInt(t.target.value,10)),m(0)},rowsPerPageOptions:[5,10,25],labelRowsPerPage:"Companies per page:"})})]}),e.jsx(we,{open:j,onClose:()=>k(!1),onSave:()=>O(),initialData:C}),e.jsxs(J,{open:!!v,onClose:w?void 0:()=>{E(null),A(null)},children:[e.jsx(X,{children:"Delete survey record?"}),e.jsxs(ee,{children:[e.jsxs(je,{children:["This will permanently remove the record for ",e.jsx("strong",{children:(v==null?void 0:v.area)||(v==null?void 0:v.company)}),". This cannot be undone."]}),H&&e.jsx(te,{severity:"error",sx:{mt:2},children:H})]}),e.jsxs(re,{sx:{px:3,py:2},children:[e.jsx(S,{onClick:()=>{E(null),A(null)},disabled:w,color:"inherit",children:"Cancel"}),e.jsx(S,{color:"error",variant:"contained",onClick:le,disabled:w,startIcon:w?e.jsx(Y,{size:16,color:"inherit"}):null,children:"Delete"})]})]})]})}export{qe as default}; +import{r as ce,j as e,i as de,a as c,B as i,N as g,T as n,H as xe,S as h,C as Y,c as he,O as ge,Q as ue,L as Z,M as T,I as Q}from"./index-J0uxx8As.js";import{d as pe,D as J,a as X,b as ee,c as re,e as fe}from"./EditOutlined-CLycK5tS.js";import{d as se,T as me,D as je,a as be}from"./PhoneOutlined-C_1wJaio.js";import{c as U,d as ye,a as ve,b as L,e as _e}from"./StorefrontOutlined-C6lTcD4z.js";import{d as Ce}from"./MapOutlined-DE0O8xFw.js";import{P as Se,G as a,A as te,a as z}from"./PageHeader-TW1dMGrU.js";import{C as oe}from"./Link-DdF3Xu1F.js";import{T as y}from"./TextField-BARvBB_z.js";import{I as Ie}from"./InputAdornment-Cbcw8oJa.js";import{B as S}from"./Button-BkRsd5c4.js";import"./TableCell-dI-OU86K.js";var F={},ke=de;Object.defineProperty(F,"__esModule",{value:!0});var W=F.default=void 0,Re=ke(ce()),ze=e;W=F.default=(0,Re.default)((0,ze.jsx)("path",{d:"M7 15h7v2H7zm0-4h10v2H7zm0-4h10v2H7zm12-4h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-.14 0-.27.01-.4.04-.39.08-.74.28-1.01.55-.18.18-.33.4-.43.64-.1.23-.16.49-.16.77v14c0 .27.06.54.16.78s.25.45.43.64c.27.27.62.47 1.01.55.13.02.26.03.4.03h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7-.25c.41 0 .75.34.75.75s-.34.75-.75.75-.75-.34-.75-.75.34-.75.75-.75M19 19H5V5h14z"}),"AssignmentOutlined");const M="https://api.doormile.com/api/v1",ne=()=>{const r=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...r?{Authorization:`Bearer ${r}`}:{}}},We={textTransform:"uppercase",letterSpacing:.4,fontSize:"0.68rem",fontWeight:700,color:"grey.700"};function V({label:r,color:o="default"}){return r?e.jsx(z,{size:"small",label:r,sx:{fontWeight:600,...o==="default"?{bgcolor:"grey.100",color:"grey.700"}:{bgcolor:`${o}.lighter`,color:`${o}.dark`}}}):e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:"grey.500"},children:"—"})}function b({label:r,children:o}){return e.jsxs(i,{children:[e.jsx(n,{variant:"caption",color:"text.secondary",sx:We,children:r}),e.jsx(i,{sx:{mt:.5},children:o})]})}function $({title:r,value:o,icon:l,gradient:u,percentage:s}){return e.jsxs(i,{sx:{position:"relative",overflow:"hidden",borderRadius:3.5,p:3,color:"white",background:u,boxShadow:"0 10px 30px rgba(0,0,0,0.08)",transition:"box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{boxShadow:"0 20px 40px rgba(0,0,0,0.12)"}},children:[e.jsxs(i,{sx:{position:"relative",zIndex:2},children:[e.jsxs(h,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(n,{variant:"overline",sx:{fontWeight:700,letterSpacing:1.2,opacity:.9},children:r}),e.jsx(i,{sx:{width:36,height:36,borderRadius:"50%",bgcolor:"rgba(255,255,255,0.2)",display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:"blur(4px)"},children:e.jsx(l,{sx:{fontSize:20}})})]}),e.jsxs(h,{direction:"row",alignItems:"baseline",spacing:1.5,sx:{mt:2},children:[e.jsx(n,{variant:"h3",sx:{fontWeight:800,lineHeight:1},children:o}),s&&e.jsx(z,{size:"small",label:s,sx:{height:22,bgcolor:"rgba(255,255,255,0.25)",color:"white",fontWeight:700,borderRadius:1.5,backdropFilter:"blur(4px)"}})]})]}),e.jsx(l,{sx:{position:"absolute",right:-24,bottom:-24,fontSize:160,opacity:.1,zIndex:1,transform:"rotate(-15deg)"}})]})}function D({icon:r,title:o,children:l}){return e.jsxs(i,{sx:{height:"100%",borderRadius:2,border:1,borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"},children:[e.jsxs(h,{direction:"row",spacing:1,alignItems:"center",sx:{px:2,py:1.25,borderBottom:1,borderColor:"divider",bgcolor:g("#c01227",.08)},children:[e.jsx(r,{sx:{fontSize:18,color:"#c01227"}}),e.jsx(n,{variant:"overline",sx:{fontWeight:700,color:"grey.800",letterSpacing:.6,lineHeight:1},children:o})]}),e.jsx(h,{spacing:2,sx:{p:2},children:l})]})}async function Pe(){const r=await fetch(`${M}/admin/competitor-branches?limit=1000`,{headers:ne()});if(!r.ok)throw new Error("Failed to fetch surveys");const o=await r.json(),l=Array.isArray(o)?o:o.data||[];return{data:l,total:l.length}}async function Ee(r){const o=!!r.id,l=o?`${M}/admin/competitor-branches/${r.id}`:`${M}/admin/competitor-branches`,s=await fetch(l,{method:o?"PUT":"POST",headers:ne(),body:JSON.stringify(r)});if(!s.ok){const d=await s.json().catch(()=>({}));throw new Error(d.error||d.message||"Failed to save survey")}return s.status===204?{}:s.json().catch(()=>({}))}function we({open:r,onClose:o,onSave:l,initialData:u}){const[s,d]=c.useState({}),[p,m]=c.useState(!1),[x,I]=c.useState(null);c.useEffect(()=>{r&&(d(u||{company:"",area:"",phone:"",rate_per_kg:"",offers_pickup:"no",offers_drop:"no",packing_charge:"",time_in_days:"",plus_code:"",address:""}),I(null))},[r,u]);const j=C=>P=>{d(v=>({...v,[C]:P.target.value}))},k=async()=>{m(!0),I(null);try{const C={...s.id?{id:s.id}:{},company:s.company||"",area:s.area||"",phone:s.phone||"",rate_per_kg:s.rate_per_kg||"",offers_pickup:s.offers_pickup||"no",offers_drop:s.offers_drop||"no",packing_charge:s.packing_charge||"",time_in_days:s.time_in_days||"",plus_code:s.plus_code||"",address:s.address||""};await Ee(C),l(),o()}catch(C){console.error(C),I(C.message||"Failed to save. Please try again.")}finally{m(!1)}};return e.jsxs(J,{open:r,onClose:p?void 0:o,maxWidth:"sm",fullWidth:!0,children:[e.jsx(X,{sx:{fontWeight:800},children:u?"Edit Survey Record":"Add New Survey"}),e.jsxs(ee,{dividers:!0,children:[x&&e.jsx(te,{severity:"error",sx:{mb:2},children:x}),e.jsxs(a,{container:!0,spacing:2,children:[e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,label:"Company",value:s.company||"",onChange:j("company"),size:"small"})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,label:"Area / Zone",value:s.area||"",onChange:j("area"),size:"small"})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,label:"Phone",value:s.phone||"",onChange:j("phone"),size:"small"})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,label:"Rate Per KG",value:s.rate_per_kg||"",onChange:j("rate_per_kg"),size:"small"})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsxs(y,{select:!0,fullWidth:!0,label:"Offers Pickup",value:s.offers_pickup||"no",onChange:j("offers_pickup"),size:"small",children:[e.jsx(T,{value:"yes",children:"Yes"}),e.jsx(T,{value:"no",children:"No"})]})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsxs(y,{select:!0,fullWidth:!0,label:"Offers Drop",value:s.offers_drop||"no",onChange:j("offers_drop"),size:"small",children:[e.jsx(T,{value:"yes",children:"Yes"}),e.jsx(T,{value:"no",children:"No"})]})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,label:"Time in Days",value:s.time_in_days||"",onChange:j("time_in_days"),size:"small"})}),e.jsx(a,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,label:"Packing Charge",value:s.packing_charge||"",onChange:j("packing_charge"),size:"small"})}),e.jsx(a,{item:!0,xs:12,children:e.jsx(y,{fullWidth:!0,label:"Plus Code",value:s.plus_code||"",onChange:j("plus_code"),size:"small"})}),e.jsx(a,{item:!0,xs:12,children:e.jsx(y,{fullWidth:!0,multiline:!0,rows:2,label:"Address",value:s.address||"",onChange:j("address"),size:"small"})})]})]}),e.jsxs(re,{sx:{p:2,bgcolor:"grey.50"},children:[e.jsx(S,{onClick:o,disabled:p,color:"inherit",children:"Cancel"}),e.jsx(S,{onClick:k,disabled:p,variant:"contained",sx:{bgcolor:"#c01227","&:hover":{bgcolor:"#a00f20"},borderRadius:2},children:p?"Saving...":"Save Record"})]})]})}function Ae({row:r,onEdit:o,onDelete:l,users:u}){const[s,d]=c.useState(!1),p=u.find(x=>x.id===r.created_by),m=u.find(x=>x.id===r.updated_by);return e.jsxs(i,{sx:{p:2,borderRadius:2.5,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",transition:"border-color 0.2s ease, box-shadow 0.2s ease","&:hover":{borderColor:"#c01227",boxShadow:"0 4px 12px rgba(192, 18, 39, 0.05)"}},children:[e.jsxs(h,{direction:{xs:"column",md:"row"},spacing:3,alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",onClick:()=>d(!s),sx:{cursor:"pointer",userSelect:"none"},children:[e.jsxs(h,{direction:"row",spacing:2,alignItems:"center",sx:{minWidth:240},children:[e.jsx(i,{sx:{p:1.5,borderRadius:2,bgcolor:g("#c01227",.05)},children:e.jsx(L,{sx:{color:"#c01227"}})}),e.jsxs(i,{children:[e.jsx(n,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.900",lineHeight:1.2},children:r.area||"Unknown Area"}),e.jsxs(n,{variant:"body2",sx:{color:"grey.600",display:"flex",alignItems:"center",gap:.5,mt:.5},children:[e.jsx(se,{sx:{fontSize:14}})," ",r.phone||"—"]})]})]}),e.jsxs(h,{direction:"row",spacing:4,sx:{flex:1},justifyContent:{xs:"flex-start",md:"center"},children:[e.jsxs(i,{children:[e.jsx(n,{variant:"caption",sx:{color:"grey.500",fontWeight:700,letterSpacing:.5,display:"block",mb:.5},children:"RATE PER KG"}),e.jsx(V,{label:r.rate_per_kg,color:"success"})]}),e.jsxs(i,{children:[e.jsx(n,{variant:"caption",sx:{color:"grey.500",fontWeight:700,letterSpacing:.5,display:"block",mb:.5},children:"LOGISTICS"}),e.jsx(n,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:r.offers_pickup==="yes"||r.offers_drop==="yes"?`${r.offers_pickup==="yes"?"Pickup":""} ${r.offers_drop==="yes"?"Drop":""}`:"—"})]})]}),e.jsxs(h,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(S,{size:"small",sx:{borderRadius:1.5,color:s?"#c01227":"grey.700",bgcolor:s?g("#c01227",.05):"transparent","&:hover":{bgcolor:g("#c01227",.1),color:"#c01227"}},children:s?"Hide Info":"More Info"}),e.jsx(Q,{size:"small",onClick:x=>{x.stopPropagation(),o(r)},sx:{color:"grey.400","&:hover":{color:"#c01227",bgcolor:g("#c01227",.1)}},children:e.jsx(fe,{fontSize:"small"})}),e.jsx(Q,{size:"small",onClick:x=>{x.stopPropagation(),l(r)},sx:{color:"grey.400","&:hover":{color:"#ef4444",bgcolor:g("#ef4444",.1)}},children:e.jsx(be,{fontSize:"small"})})]})]}),e.jsx(Z,{in:s,timeout:"auto",unmountOnExit:!0,children:e.jsx(i,{sx:{mt:2.5,pt:2.5,borderTop:"1px dashed",borderColor:"divider"},children:e.jsxs(a,{container:!0,spacing:2,alignItems:"stretch",children:[e.jsx(a,{item:!0,xs:12,md:4,children:e.jsxs(D,{icon:U,title:"ENQUIRY DETAILS",children:[e.jsx(b,{label:"RATE PER KG",children:e.jsx(V,{label:r.rate_per_kg,color:"success"})}),e.jsx(b,{label:"PICKUP",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:r.offers_pickup?"grey.800":"grey.500"},children:r.offers_pickup||"—"})}),e.jsx(b,{label:"DROP",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:r.offers_drop?"grey.800":"grey.500"},children:r.offers_drop||"—"})}),e.jsx(b,{label:"PACKING",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:r.packing_charge?"grey.800":"grey.500"},children:r.packing_charge||"—"})})]})}),e.jsx(a,{item:!0,xs:12,md:4,children:e.jsxs(D,{icon:_e,title:"LOGISTICS & OPS",children:[e.jsx(b,{label:"TIME IN DAYS",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:r.time_in_days?"grey.800":"grey.500"},children:r.time_in_days||"—"})}),e.jsx(b,{label:"COMPANY",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.company||"—"})}),e.jsx(b,{label:"CONTACT NUMBER",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.phone||"—"})})]})}),e.jsx(a,{item:!0,xs:12,md:4,children:e.jsxs(D,{icon:L,title:"LOCATION & PINCODE",children:[e.jsx(b,{label:"AREA / ZONE",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.area||"—"})}),e.jsx(b,{label:"PLUS CODE",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:r.plus_code?"grey.800":"grey.500"},children:r.plus_code||"—"})}),e.jsx(b,{label:"FULL ADDRESS",children:e.jsxs(h,{spacing:1.5,children:[e.jsxs(h,{direction:"row",spacing:1,sx:{p:1.5,borderRadius:1.5,bgcolor:"grey.50",border:1,borderColor:"divider"},children:[e.jsx(L,{sx:{fontSize:16,color:"grey.400",mt:"2px"}}),e.jsx(n,{variant:"body2",sx:{color:"grey.800",lineHeight:1.5},children:r.address||"—"})]}),(r.address||r.plus_code)&&e.jsx(S,{component:"a",href:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(r.plus_code?r.plus_code+" "+(r.address||""):r.address)}`,target:"_blank",rel:"noopener",size:"small",variant:"outlined",startIcon:e.jsx(Ce,{sx:{fontSize:16}}),sx:{alignSelf:"flex-start",py:.5,px:1.5,fontSize:"0.75rem",fontWeight:600,borderRadius:2,color:"#c01227",borderColor:g("#c01227",.5),bgcolor:g("#c01227",.05),"&:hover":{borderColor:"#c01227",bgcolor:g("#c01227",.1)}},children:"View on map"})]})})]})}),e.jsx(a,{item:!0,xs:12,children:e.jsx(D,{icon:W,title:"RECORD METADATA",children:e.jsxs(a,{container:!0,spacing:2,children:[e.jsx(a,{item:!0,xs:6,children:e.jsx(b,{label:"CREATED BY",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:p?p.first_name:r.created_by?`User ID: ${r.created_by}`:"System"})})}),e.jsx(a,{item:!0,xs:6,children:e.jsx(b,{label:"LAST EDITED BY",children:e.jsx(n,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:m?m.first_name:r.updated_by?`User ID: ${r.updated_by}`:"—"})})})]})})})]})})})]})}function Te({companyName:r,branches:o,onEdit:l,onDelete:u,users:s}){const[d,p]=c.useState(!1);return e.jsxs(oe,{elevation:0,sx:{borderRadius:3,border:"1px solid",borderColor:d?"#c01227":"grey.200",p:{xs:2.5,md:3},mb:2.5,transition:"border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{borderColor:"#c01227",boxShadow:"0 8px 30px rgba(192, 18, 39, 0.08)"}},children:[e.jsxs(h,{direction:{xs:"column",md:"row"},spacing:3,alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",onClick:()=>p(!d),sx:{cursor:"pointer",userSelect:"none"},children:[e.jsxs(h,{direction:"row",spacing:2.5,alignItems:"center",children:[e.jsx(ue,{sx:{width:64,height:64,bgcolor:g("#c01227",.1),color:"#c01227",fontWeight:800,fontSize:"1.5rem",borderRadius:2.5},children:(r||"A")[0].toUpperCase()}),e.jsxs(i,{children:[e.jsx(n,{variant:"h5",sx:{fontWeight:800,lineHeight:1.2,color:"grey.900"},children:r||"Unknown Company"}),e.jsxs(n,{variant:"body2",sx:{color:"grey.600",mt:.5,display:"flex",alignItems:"center",gap:.5},children:[e.jsx(U,{sx:{fontSize:16}})," ",o.length," Location",o.length!==1&&"s"," Surveyed"]})]})]}),e.jsxs(h,{direction:"row",spacing:3,alignItems:"center",children:[e.jsxs(h,{direction:"row",spacing:1,sx:{display:{xs:"none",md:"flex"}},children:[e.jsx(z,{size:"small",label:"First Mile",sx:{bgcolor:g("#c01227",.08),color:"#c01227",fontWeight:700,borderRadius:1.5}}),e.jsx(z,{size:"small",label:"Mid Mile",sx:{bgcolor:g("#c01227",.08),color:"#c01227",fontWeight:700,borderRadius:1.5}}),e.jsx(z,{size:"small",label:"Last Mile",sx:{bgcolor:g("#c01227",.08),color:"#c01227",fontWeight:700,borderRadius:1.5}})]}),e.jsx(h,{direction:"row",spacing:1.5,alignItems:"center",children:e.jsx(S,{sx:{borderRadius:2,py:1,px:3,fontWeight:700,color:d?"#c01227":"grey.700",bgcolor:d?g("#c01227",.1):"grey.100","&:hover":{bgcolor:g("#c01227",.15),color:"#c01227"}},endIcon:d?e.jsx(ye,{}):e.jsx(ve,{}),children:d?"Hide Locations":"View Locations"})})]})]}),e.jsx(Z,{in:d,timeout:"auto",unmountOnExit:!0,children:e.jsx(i,{sx:{mt:3,pt:3,borderTop:"2px dashed",borderColor:"grey.200"},children:e.jsx(h,{spacing:2,children:o.map((m,x)=>e.jsx(Ae,{row:m,onEdit:l,onDelete:u,users:s},m.id??x))})})})]})}function qe(){const[r,o]=c.useState([]),[l,u]=c.useState(!0),[s,d]=c.useState(""),[p,m]=c.useState(0),[x,I]=c.useState(5),[j,k]=c.useState(!1),[C,P]=c.useState(null),[v,E]=c.useState(null),[w,B]=c.useState(!1),[H,A]=c.useState(null),[ie,ae]=c.useState([]),O=()=>{let t=!1;return u(!0),Promise.all([Pe(),he().catch(()=>[])]).then(([f,R])=>{t||(o(f.data||f||[]),ae(R||[]))}).catch(f=>console.error("Error fetching data:",f)).finally(()=>{t||u(!1)}),()=>{t=!0}};c.useEffect(()=>O(),[]);const le=async()=>{B(!0),A(null);try{await ge(v.id),E(null),O()}catch(t){A(t.message||"Failed to delete. Please try again.")}finally{B(!1)}},N=r.filter(t=>(t.company||"").toLowerCase().includes(s.toLowerCase())||(t.area||"").toLowerCase().includes(s.toLowerCase())||(t.phone||"").toLowerCase().includes(s.toLowerCase())),G=N.reduce((t,f)=>{const R=f.company||"Unknown Company";return t[R]||(t[R]=[]),t[R].push(f),t},{}),q=Object.keys(G).sort(),K=q.slice(p*x,p*x+x),_={total:r.length,quoted:r.filter(t=>t.rate_per_kg&&!String(t.rate_per_kg).toLowerCase().includes("not answered")).length,missing:r.filter(t=>!t.rate_per_kg||String(t.rate_per_kg).toLowerCase().includes("not answered")).length};return e.jsxs(i,{sx:{pb:6,bgcolor:"#f8fafc",px:{xs:2,md:4},pt:3,minHeight:"100vh"},children:[e.jsx(Se,{title:"Field Surveys",breadcrumbs:[{label:"Survey Management"}]}),e.jsxs(a,{container:!0,spacing:3,sx:{mb:5,mt:1},children:[e.jsx(a,{item:!0,xs:12,md:4,children:e.jsx($,{title:"TOTAL ENQUIRIES",value:l?"...":_.total,icon:W,gradient:"linear-gradient(135deg, #e11d48 0%, #c01227 100%)"})}),e.jsx(a,{item:!0,xs:12,md:4,children:e.jsx($,{title:"RATES QUOTED",value:l?"...":_.quoted,icon:U,gradient:"linear-gradient(135deg, #10b981 0%, #047857 100%)",percentage:_.total?`${Math.round(_.quoted/_.total*100)}%`:"0%"})}),e.jsx(a,{item:!0,xs:12,md:4,children:e.jsx($,{title:"MISSING INFO",value:l?"...":_.missing,icon:se,gradient:"linear-gradient(135deg, #334155 0%, #0f172a 100%)",percentage:_.total?`${Math.round(_.missing/_.total*100)}%`:"0%"})})]}),e.jsxs(oe,{sx:{borderRadius:2,boxShadow:"0 4px 20px rgba(0,0,0,0.05)",overflow:"hidden"},children:[e.jsxs(i,{sx:{p:3,display:"flex",alignItems:"center",gap:2,borderBottom:"1px solid",borderColor:"grey.100"},children:[e.jsx(i,{sx:{width:48,height:48,borderRadius:2.5,bgcolor:g("#c01227",.1),color:"#c01227",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(W,{})}),e.jsxs(i,{children:[e.jsx(n,{variant:"h6",sx:{fontWeight:700,color:"grey.900"},children:"Survey Records"}),e.jsx(n,{variant:"body2",sx:{color:"grey.600",mt:.5},children:"Manage business enquiry and survey data from the field"})]})]}),e.jsxs(i,{sx:{p:2,borderBottom:"1px solid",borderColor:"grey.100",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[e.jsx(y,{size:"small",placeholder:"Search by company, area or phone...",value:s,onChange:t=>{d(t.target.value),m(0)},sx:{width:{xs:"100%",md:400}},InputProps:{startAdornment:e.jsx(Ie,{position:"start",children:e.jsx(xe,{fontSize:"small"})})}}),e.jsxs(h,{direction:"row",spacing:2,alignItems:"center",children:[!l&&e.jsxs(n,{variant:"body2",sx:{color:"grey.500",fontWeight:600},children:[N.length," records"]}),e.jsx(S,{variant:"contained",startIcon:e.jsx(pe,{}),onClick:()=>{P(null),k(!0)},sx:{bgcolor:"#c01227","&:hover":{bgcolor:"#a00f20"},borderRadius:2,px:2,fontWeight:700,whiteSpace:"nowrap"},children:"Add New Survey"})]})]}),e.jsx(i,{sx:{p:3,bgcolor:"grey.50"},children:l?e.jsx(i,{sx:{display:"flex",justifyContent:"center",py:8},children:e.jsx(Y,{})}):K.length>0?e.jsx(i,{children:K.map(t=>e.jsx(Te,{companyName:t,branches:G[t],onEdit:f=>{P(f),k(!0)},onDelete:f=>E(f),users:ie},t))}):e.jsxs(i,{sx:{py:10,textAlign:"center"},children:[e.jsx(W,{sx:{fontSize:48,color:"grey.300",mb:2}}),e.jsx(n,{variant:"h6",color:"text.secondary",children:"No survey records found."}),e.jsx(n,{variant:"body2",color:"text.disabled",sx:{mt:1},children:"Try adjusting your search filters."})]})}),e.jsx(i,{sx:{borderTop:"1px solid",borderColor:"grey.200",bgcolor:"white"},children:e.jsx(me,{component:"div",count:q.length,page:p,onPageChange:(t,f)=>m(f),rowsPerPage:x,onRowsPerPageChange:t=>{I(parseInt(t.target.value,10)),m(0)},rowsPerPageOptions:[5,10,25],labelRowsPerPage:"Companies per page:"})})]}),e.jsx(we,{open:j,onClose:()=>k(!1),onSave:()=>O(),initialData:C}),e.jsxs(J,{open:!!v,onClose:w?void 0:()=>{E(null),A(null)},children:[e.jsx(X,{children:"Delete survey record?"}),e.jsxs(ee,{children:[e.jsxs(je,{children:["This will permanently remove the record for ",e.jsx("strong",{children:(v==null?void 0:v.area)||(v==null?void 0:v.company)}),". This cannot be undone."]}),H&&e.jsx(te,{severity:"error",sx:{mt:2},children:H})]}),e.jsxs(re,{sx:{px:3,py:2},children:[e.jsx(S,{onClick:()=>{E(null),A(null)},disabled:w,color:"inherit",children:"Cancel"}),e.jsx(S,{color:"error",variant:"contained",onClick:le,disabled:w,startIcon:w?e.jsx(Y,{size:16,color:"inherit"}):null,children:"Delete"})]})]})]})}export{qe as default}; diff --git a/dist/assets/TabLabelCount-BKNSTwCP.js b/dist/assets/TabLabelCount-C4m0Yyzh.js similarity index 99% rename from dist/assets/TabLabelCount-BKNSTwCP.js rename to dist/assets/TabLabelCount-C4m0Yyzh.js index 9bda906..fa744e1 100644 --- a/dist/assets/TabLabelCount-BKNSTwCP.js +++ b/dist/assets/TabLabelCount-C4m0Yyzh.js @@ -1 +1 @@ -import{l as pt,m as ht,a as d,n as vt,o as nt,_ as f,p as N,j as p,q as Nt,v as St,w as A,X as kt,Y as te,Z as jt,$ as Ot,a0 as Ft,a1 as rt,a2 as ee,k as ft,a3 as oe,r as le,i as re,S as ne,B as se}from"./index-Dg-wT72v.js";import{K as ae,b as ie}from"./PhoneOutlined-BqFvwse4.js";let V;function $t(){if(V)return V;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),V="reverse",t.scrollLeft>0?V="default":(t.scrollLeft=1,t.scrollLeft===0&&(V="negative")),document.body.removeChild(t),V}function ce(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch($t()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}function de(t){return pt("MuiTab",t)}const L=ht("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),ue=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],fe=t=>{const{classes:e,textColor:r,fullWidth:a,wrapped:s,icon:c,label:v,selected:h,disabled:u}=t,x={root:["root",c&&v&&"labelIcon",`textColor${Nt(r)}`,a&&"fullWidth",s&&"wrapped",h&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return St(x,de,e)},be=A(kt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Nt(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped,{[`& .${L.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>f({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${L.iconWrapper}`]:f({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${L.selected}`]:{opacity:1},[`&.${L.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${L.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${L.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${L.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${L.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),Fe=d.forwardRef(function(e,r){const a=vt({props:e,name:"MuiTab"}),{className:s,disabled:c=!1,disableFocusRipple:v=!1,fullWidth:h,icon:u,iconPosition:x="top",indicator:C,label:y,onChange:S,onClick:w,onFocus:k,selected:I,selectionFollowsFocus:g,textColor:H="inherit",value:M,wrapped:st=!1}=a,_=nt(a,ue),Y=f({},a,{disabled:c,disableFocusRipple:v,selected:I,icon:!!u,iconPosition:x,label:!!y,fullWidth:h,textColor:H,wrapped:st}),D=fe(Y),j=u&&y&&d.isValidElement(u)?d.cloneElement(u,{className:N(D.iconWrapper,u.props.className)}):u,Z=R=>{!I&&S&&S(R,M),w&&w(R)},X=R=>{g&&!I&&S&&S(R,M),k&&k(R)};return p.jsxs(be,f({focusRipple:!v,className:N(D.root,s),ref:r,role:"tab","aria-selected":I,disabled:c,onClick:Z,onFocus:X,ownerState:Y,tabIndex:I?0:-1},_,{children:[x==="top"||x==="start"?p.jsxs(d.Fragment,{children:[j,y]}):p.jsxs(d.Fragment,{children:[y,j]}),C]}))});function pe(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function he(t,e,r,a={},s=()=>{}){const{ease:c=pe,duration:v=300}=a;let h=null;const u=e[t];let x=!1;const C=()=>{x=!0},y=S=>{if(x){s(new Error("Animation cancelled"));return}h===null&&(h=S);const w=Math.min(1,(S-h)/v);if(e[t]=c(w)*(r-u)+u,w>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(y)};return u===r?(s(new Error("Element already at target position")),C):(requestAnimationFrame(y),C)}const ve=["onChange"],Se={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function me(t){const{onChange:e}=t,r=nt(t,ve),a=d.useRef(),s=d.useRef(null),c=()=>{a.current=s.current.offsetHeight-s.current.clientHeight};return te(()=>{const v=jt(()=>{const u=a.current;c(),u!==a.current&&e(a.current)}),h=Ot(s.current);return h.addEventListener("resize",v),()=>{v.clear(),h.removeEventListener("resize",v)}},[e]),d.useEffect(()=>{c(),e(a.current)},[e]),p.jsx("div",f({style:Se},r,{ref:s}))}function xe(t){return pt("MuiTabScrollButton",t)}const ge=ht("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),ye=["className","slots","slotProps","direction","orientation","disabled"],Be=t=>{const{classes:e,orientation:r,disabled:a}=t;return St({root:["root",r,a&&"disabled"]},xe,e)},Ce=A(kt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>f({width:40,flexShrink:0,opacity:.8,[`&.${ge.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),we=d.forwardRef(function(e,r){var a,s;const c=vt({props:e,name:"MuiTabScrollButton"}),{className:v,slots:h={},slotProps:u={},direction:x}=c,C=nt(c,ye),y=Ft(),S=f({isRtl:y},c),w=Be(S),k=(a=h.StartScrollButtonIcon)!=null?a:ae,I=(s=h.EndScrollButtonIcon)!=null?s:ie,g=rt({elementType:k,externalSlotProps:u.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S}),H=rt({elementType:I,externalSlotProps:u.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S});return p.jsx(Ce,f({component:"div",className:N(w.root,v),ref:r,role:null,ownerState:S,tabIndex:null},C,{children:x==="left"?p.jsx(k,f({},g)):p.jsx(I,f({},H))}))});function Ie(t){return pt("MuiTabs",t)}const bt=ht("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Te=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Wt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,Pt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,ot=(t,e,r)=>{let a=!1,s=r(t,e);for(;s;){if(s===t.firstChild){if(a)return;a=!0}const c=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||c)s=r(t,s);else{s.focus();return}}},Ee=t=>{const{vertical:e,fixed:r,hideScrollbar:a,scrollableX:s,scrollableY:c,centered:v,scrollButtonsHideMobile:h,classes:u}=t;return St({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",a&&"hideScrollbar",s&&"scrollableX",c&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",v&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",h&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},Ie,u)},Me=A("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${bt.scrollButtons}`]:e.scrollButtons},{[`& .${bt.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>f({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${bt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Re=A("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>f({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),ze=A("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>f({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),We=A("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>f({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),Pe=A(me)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Lt={},$e=d.forwardRef(function(e,r){const a=vt({props:e,name:"MuiTabs"}),s=ee(),c=Ft(),{"aria-label":v,"aria-labelledby":h,action:u,centered:x=!1,children:C,className:y,component:S="div",allowScrollButtonsMobile:w=!1,indicatorColor:k="primary",onChange:I,orientation:g="horizontal",ScrollButtonComponent:H=we,scrollButtons:M="auto",selectionFollowsFocus:st,slots:_={},slotProps:Y={},TabIndicatorProps:D={},TabScrollButtonProps:j={},textColor:Z="primary",value:X,variant:R="standard",visibleScrollbar:at=!1}=a,At=nt(a,Te),T=R==="scrollable",B=g==="vertical",U=B?"scrollTop":"scrollLeft",J=B?"top":"left",Q=B?"bottom":"right",it=B?"clientHeight":"clientWidth",q=B?"height":"width",O=f({},a,{component:S,allowScrollButtonsMobile:w,indicatorColor:k,orientation:g,vertical:B,scrollButtons:M,textColor:Z,variant:R,visibleScrollbar:at,fixed:!T,hideScrollbar:T&&!at,scrollableX:T&&!B,scrollableY:T&&B,centered:x&&!T,scrollButtonsHideMobile:!w}),W=Ee(O),Ht=rt({elementType:_.StartScrollButtonIcon,externalSlotProps:Y.startScrollButtonIcon,ownerState:O}),_t=rt({elementType:_.EndScrollButtonIcon,externalSlotProps:Y.endScrollButtonIcon,ownerState:O}),[xt,Dt]=d.useState(!1),[F,gt]=d.useState(Lt),[yt,Xt]=d.useState(!1),[Bt,Vt]=d.useState(!1),[Ct,Yt]=d.useState(!1),[wt,Ut]=d.useState({overflow:"hidden",scrollbarWidth:0}),It=new Map,z=d.useRef(null),$=d.useRef(null),Tt=()=>{const o=z.current;let l;if(o){const n=o.getBoundingClientRect();l={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ce(o,c?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let i;if(o&&X!==!1){const n=$.current.children;if(n.length>0){const b=n[It.get(X)];i=b?b.getBoundingClientRect():null}}return{tabsMeta:l,tabMeta:i}},K=ft(()=>{const{tabsMeta:o,tabMeta:l}=Tt();let i=0,n;if(B)n="top",l&&o&&(i=l.top-o.top+o.scrollTop);else if(n=c?"right":"left",l&&o){const m=c?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;i=(c?-1:1)*(l[n]-o[n]+m)}const b={[n]:i,[q]:l?l[q]:0};if(isNaN(F[n])||isNaN(F[q]))gt(b);else{const m=Math.abs(F[n]-b[n]),E=Math.abs(F[q]-b[q]);(m>=1||E>=1)&>(b)}}),ct=(o,{animation:l=!0}={})=>{l?he(U,z.current,o,{duration:s.transitions.duration.standard}):z.current[U]=o},Et=o=>{let l=z.current[U];B?l+=o:(l+=o*(c?-1:1),l*=c&&$t()==="reverse"?-1:1),ct(l)},Mt=()=>{const o=z.current[it];let l=0;const i=Array.from($.current.children);for(let n=0;no){n===0&&(l=o);break}l+=b[it]}return l},qt=()=>{Et(-1*Mt())},Kt=()=>{Et(Mt())},Gt=d.useCallback(o=>{Ut({overflow:null,scrollbarWidth:o})},[]),Zt=()=>{const o={};o.scrollbarSizeListener=T?p.jsx(Pe,{onChange:Gt,className:N(W.scrollableX,W.hideScrollbar)}):null;const i=T&&(M==="auto"&&(yt||Bt)||M===!0);return o.scrollButtonStart=i?p.jsx(H,f({slots:{StartScrollButtonIcon:_.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Ht},orientation:g,direction:c?"right":"left",onClick:qt,disabled:!yt},j,{className:N(W.scrollButtons,j.className)})):null,o.scrollButtonEnd=i?p.jsx(H,f({slots:{EndScrollButtonIcon:_.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:_t},orientation:g,direction:c?"left":"right",onClick:Kt,disabled:!Bt},j,{className:N(W.scrollButtons,j.className)})):null,o},Rt=ft(o=>{const{tabsMeta:l,tabMeta:i}=Tt();if(!(!i||!l)){if(i[J]l[Q]){const n=l[U]+(i[Q]-l[Q]);ct(n,{animation:o})}}}),tt=ft(()=>{T&&M!==!1&&Yt(!Ct)});d.useEffect(()=>{const o=jt(()=>{z.current&&K()});let l;const i=m=>{m.forEach(E=>{E.removedNodes.forEach(G=>{var P;(P=l)==null||P.unobserve(G)}),E.addedNodes.forEach(G=>{var P;(P=l)==null||P.observe(G)})}),o(),tt()},n=Ot(z.current);n.addEventListener("resize",o);let b;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(o),Array.from($.current.children).forEach(m=>{l.observe(m)})),typeof MutationObserver<"u"&&(b=new MutationObserver(i),b.observe($.current,{childList:!0})),()=>{var m,E;o.clear(),n.removeEventListener("resize",o),(m=b)==null||m.disconnect(),(E=l)==null||E.disconnect()}},[K,tt]),d.useEffect(()=>{const o=Array.from($.current.children),l=o.length;if(typeof IntersectionObserver<"u"&&l>0&&T&&M!==!1){const i=o[0],n=o[l-1],b={root:z.current,threshold:.99},m=ut=>{Xt(!ut[0].isIntersecting)},E=new IntersectionObserver(m,b);E.observe(i);const G=ut=>{Vt(!ut[0].isIntersecting)},P=new IntersectionObserver(G,b);return P.observe(n),()=>{E.disconnect(),P.disconnect()}}},[T,M,Ct,C==null?void 0:C.length]),d.useEffect(()=>{Dt(!0)},[]),d.useEffect(()=>{K()}),d.useEffect(()=>{Rt(Lt!==F)},[Rt,F]),d.useImperativeHandle(u,()=>({updateIndicator:K,updateScrollButtons:tt}),[K,tt]);const zt=p.jsx(We,f({},D,{className:N(W.indicator,D.className),ownerState:O,style:f({},F,D.style)}));let et=0;const Jt=d.Children.map(C,o=>{if(!d.isValidElement(o))return null;const l=o.props.value===void 0?et:o.props.value;It.set(l,et);const i=l===X;return et+=1,d.cloneElement(o,f({fullWidth:R==="fullWidth",indicator:i&&!xt&&zt,selected:i,selectionFollowsFocus:st,onChange:I,textColor:Z,value:l},et===1&&X===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Qt=o=>{const l=$.current,i=oe(l).activeElement;if(i.getAttribute("role")!=="tab")return;let b=g==="horizontal"?"ArrowLeft":"ArrowUp",m=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&c&&(b="ArrowRight",m="ArrowLeft"),o.key){case b:o.preventDefault(),ot(l,i,Pt);break;case m:o.preventDefault(),ot(l,i,Wt);break;case"Home":o.preventDefault(),ot(l,null,Wt);break;case"End":o.preventDefault(),ot(l,null,Pt);break}},dt=Zt();return p.jsxs(Me,f({className:N(W.root,y),ownerState:O,ref:r,as:S},At,{children:[dt.scrollButtonStart,dt.scrollbarSizeListener,p.jsxs(Re,{className:W.scroller,ownerState:O,style:{overflow:wt.overflow,[B?`margin${c?"Left":"Right"}`:"marginBottom"]:at?void 0:-wt.scrollbarWidth},ref:z,children:[p.jsx(ze,{"aria-label":v,"aria-labelledby":h,"aria-orientation":g==="vertical"?"vertical":null,className:W.flexContainer,ownerState:O,onKeyDown:Qt,ref:$,role:"tablist",children:Jt}),xt&&zt]}),dt.scrollButtonEnd]}))});var mt={},Le=re;Object.defineProperty(mt,"__esModule",{value:!0});var Ne=mt.default=void 0,ke=Le(le()),lt=p;Ne=mt.default=(0,ke.default)([(0,lt.jsx)("path",{d:"M14 12h4v1.5h-4zm0 3h4v1.5h-4z"},"0"),(0,lt.jsx)("path",{d:"M20 7h-5V4c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m-9 0V4h2v5h-2zm9 13H4V9h5c0 1.1.9 2 2 2h2c1.1 0 2-.9 2-2h5z"},"1"),(0,lt.jsx)("circle",{cx:"9",cy:"13.5",r:"1.5"},"2"),(0,lt.jsx)("path",{d:"M11.08 16.18c-.64-.28-1.34-.43-2.08-.43s-1.44.15-2.08.43c-.56.24-.92.78-.92 1.39V18h6v-.43c0-.61-.36-1.15-.92-1.39"},"3")],"BadgeOutlined");function Ae({label:t,count:e,active:r=!1}){return p.jsxs(ne,{direction:"row",alignItems:"center",spacing:1,children:[p.jsx("span",{children:t}),p.jsx(se,{component:"span",sx:{minWidth:20,height:20,px:.75,borderRadius:10,fontSize:"0.72rem",fontWeight:700,lineHeight:"20px",textAlign:"center",bgcolor:r?"primary.main":"grey.200",color:r?"#fff":"text.secondary"},children:e})]})}export{$e as T,Fe as a,Ae as b,Ne as d}; +import{l as pt,m as ht,a as d,n as vt,o as nt,_ as f,p as N,j as p,q as Nt,v as St,w as A,X as kt,Y as te,Z as jt,$ as Ot,a0 as Ft,a1 as rt,a2 as ee,k as ft,a3 as oe,r as le,i as re,S as ne,B as se}from"./index-J0uxx8As.js";import{K as ae,b as ie}from"./PhoneOutlined-C_1wJaio.js";let V;function $t(){if(V)return V;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),V="reverse",t.scrollLeft>0?V="default":(t.scrollLeft=1,t.scrollLeft===0&&(V="negative")),document.body.removeChild(t),V}function ce(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch($t()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}function de(t){return pt("MuiTab",t)}const L=ht("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),ue=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],fe=t=>{const{classes:e,textColor:r,fullWidth:a,wrapped:s,icon:c,label:v,selected:h,disabled:u}=t,x={root:["root",c&&v&&"labelIcon",`textColor${Nt(r)}`,a&&"fullWidth",s&&"wrapped",h&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return St(x,de,e)},be=A(kt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Nt(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped,{[`& .${L.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>f({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${L.iconWrapper}`]:f({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${L.selected}`]:{opacity:1},[`&.${L.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${L.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${L.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${L.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${L.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),Fe=d.forwardRef(function(e,r){const a=vt({props:e,name:"MuiTab"}),{className:s,disabled:c=!1,disableFocusRipple:v=!1,fullWidth:h,icon:u,iconPosition:x="top",indicator:C,label:y,onChange:S,onClick:w,onFocus:k,selected:I,selectionFollowsFocus:g,textColor:H="inherit",value:M,wrapped:st=!1}=a,_=nt(a,ue),Y=f({},a,{disabled:c,disableFocusRipple:v,selected:I,icon:!!u,iconPosition:x,label:!!y,fullWidth:h,textColor:H,wrapped:st}),D=fe(Y),j=u&&y&&d.isValidElement(u)?d.cloneElement(u,{className:N(D.iconWrapper,u.props.className)}):u,Z=R=>{!I&&S&&S(R,M),w&&w(R)},X=R=>{g&&!I&&S&&S(R,M),k&&k(R)};return p.jsxs(be,f({focusRipple:!v,className:N(D.root,s),ref:r,role:"tab","aria-selected":I,disabled:c,onClick:Z,onFocus:X,ownerState:Y,tabIndex:I?0:-1},_,{children:[x==="top"||x==="start"?p.jsxs(d.Fragment,{children:[j,y]}):p.jsxs(d.Fragment,{children:[y,j]}),C]}))});function pe(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function he(t,e,r,a={},s=()=>{}){const{ease:c=pe,duration:v=300}=a;let h=null;const u=e[t];let x=!1;const C=()=>{x=!0},y=S=>{if(x){s(new Error("Animation cancelled"));return}h===null&&(h=S);const w=Math.min(1,(S-h)/v);if(e[t]=c(w)*(r-u)+u,w>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(y)};return u===r?(s(new Error("Element already at target position")),C):(requestAnimationFrame(y),C)}const ve=["onChange"],Se={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function me(t){const{onChange:e}=t,r=nt(t,ve),a=d.useRef(),s=d.useRef(null),c=()=>{a.current=s.current.offsetHeight-s.current.clientHeight};return te(()=>{const v=jt(()=>{const u=a.current;c(),u!==a.current&&e(a.current)}),h=Ot(s.current);return h.addEventListener("resize",v),()=>{v.clear(),h.removeEventListener("resize",v)}},[e]),d.useEffect(()=>{c(),e(a.current)},[e]),p.jsx("div",f({style:Se},r,{ref:s}))}function xe(t){return pt("MuiTabScrollButton",t)}const ge=ht("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),ye=["className","slots","slotProps","direction","orientation","disabled"],Be=t=>{const{classes:e,orientation:r,disabled:a}=t;return St({root:["root",r,a&&"disabled"]},xe,e)},Ce=A(kt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>f({width:40,flexShrink:0,opacity:.8,[`&.${ge.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),we=d.forwardRef(function(e,r){var a,s;const c=vt({props:e,name:"MuiTabScrollButton"}),{className:v,slots:h={},slotProps:u={},direction:x}=c,C=nt(c,ye),y=Ft(),S=f({isRtl:y},c),w=Be(S),k=(a=h.StartScrollButtonIcon)!=null?a:ae,I=(s=h.EndScrollButtonIcon)!=null?s:ie,g=rt({elementType:k,externalSlotProps:u.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S}),H=rt({elementType:I,externalSlotProps:u.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:S});return p.jsx(Ce,f({component:"div",className:N(w.root,v),ref:r,role:null,ownerState:S,tabIndex:null},C,{children:x==="left"?p.jsx(k,f({},g)):p.jsx(I,f({},H))}))});function Ie(t){return pt("MuiTabs",t)}const bt=ht("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Te=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Wt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,Pt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,ot=(t,e,r)=>{let a=!1,s=r(t,e);for(;s;){if(s===t.firstChild){if(a)return;a=!0}const c=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||c)s=r(t,s);else{s.focus();return}}},Ee=t=>{const{vertical:e,fixed:r,hideScrollbar:a,scrollableX:s,scrollableY:c,centered:v,scrollButtonsHideMobile:h,classes:u}=t;return St({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",a&&"hideScrollbar",s&&"scrollableX",c&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",v&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",h&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},Ie,u)},Me=A("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${bt.scrollButtons}`]:e.scrollButtons},{[`& .${bt.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>f({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${bt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Re=A("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>f({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),ze=A("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>f({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),We=A("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>f({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),Pe=A(me)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Lt={},$e=d.forwardRef(function(e,r){const a=vt({props:e,name:"MuiTabs"}),s=ee(),c=Ft(),{"aria-label":v,"aria-labelledby":h,action:u,centered:x=!1,children:C,className:y,component:S="div",allowScrollButtonsMobile:w=!1,indicatorColor:k="primary",onChange:I,orientation:g="horizontal",ScrollButtonComponent:H=we,scrollButtons:M="auto",selectionFollowsFocus:st,slots:_={},slotProps:Y={},TabIndicatorProps:D={},TabScrollButtonProps:j={},textColor:Z="primary",value:X,variant:R="standard",visibleScrollbar:at=!1}=a,At=nt(a,Te),T=R==="scrollable",B=g==="vertical",U=B?"scrollTop":"scrollLeft",J=B?"top":"left",Q=B?"bottom":"right",it=B?"clientHeight":"clientWidth",q=B?"height":"width",O=f({},a,{component:S,allowScrollButtonsMobile:w,indicatorColor:k,orientation:g,vertical:B,scrollButtons:M,textColor:Z,variant:R,visibleScrollbar:at,fixed:!T,hideScrollbar:T&&!at,scrollableX:T&&!B,scrollableY:T&&B,centered:x&&!T,scrollButtonsHideMobile:!w}),W=Ee(O),Ht=rt({elementType:_.StartScrollButtonIcon,externalSlotProps:Y.startScrollButtonIcon,ownerState:O}),_t=rt({elementType:_.EndScrollButtonIcon,externalSlotProps:Y.endScrollButtonIcon,ownerState:O}),[xt,Dt]=d.useState(!1),[F,gt]=d.useState(Lt),[yt,Xt]=d.useState(!1),[Bt,Vt]=d.useState(!1),[Ct,Yt]=d.useState(!1),[wt,Ut]=d.useState({overflow:"hidden",scrollbarWidth:0}),It=new Map,z=d.useRef(null),$=d.useRef(null),Tt=()=>{const o=z.current;let l;if(o){const n=o.getBoundingClientRect();l={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ce(o,c?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let i;if(o&&X!==!1){const n=$.current.children;if(n.length>0){const b=n[It.get(X)];i=b?b.getBoundingClientRect():null}}return{tabsMeta:l,tabMeta:i}},K=ft(()=>{const{tabsMeta:o,tabMeta:l}=Tt();let i=0,n;if(B)n="top",l&&o&&(i=l.top-o.top+o.scrollTop);else if(n=c?"right":"left",l&&o){const m=c?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;i=(c?-1:1)*(l[n]-o[n]+m)}const b={[n]:i,[q]:l?l[q]:0};if(isNaN(F[n])||isNaN(F[q]))gt(b);else{const m=Math.abs(F[n]-b[n]),E=Math.abs(F[q]-b[q]);(m>=1||E>=1)&>(b)}}),ct=(o,{animation:l=!0}={})=>{l?he(U,z.current,o,{duration:s.transitions.duration.standard}):z.current[U]=o},Et=o=>{let l=z.current[U];B?l+=o:(l+=o*(c?-1:1),l*=c&&$t()==="reverse"?-1:1),ct(l)},Mt=()=>{const o=z.current[it];let l=0;const i=Array.from($.current.children);for(let n=0;no){n===0&&(l=o);break}l+=b[it]}return l},qt=()=>{Et(-1*Mt())},Kt=()=>{Et(Mt())},Gt=d.useCallback(o=>{Ut({overflow:null,scrollbarWidth:o})},[]),Zt=()=>{const o={};o.scrollbarSizeListener=T?p.jsx(Pe,{onChange:Gt,className:N(W.scrollableX,W.hideScrollbar)}):null;const i=T&&(M==="auto"&&(yt||Bt)||M===!0);return o.scrollButtonStart=i?p.jsx(H,f({slots:{StartScrollButtonIcon:_.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:Ht},orientation:g,direction:c?"right":"left",onClick:qt,disabled:!yt},j,{className:N(W.scrollButtons,j.className)})):null,o.scrollButtonEnd=i?p.jsx(H,f({slots:{EndScrollButtonIcon:_.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:_t},orientation:g,direction:c?"left":"right",onClick:Kt,disabled:!Bt},j,{className:N(W.scrollButtons,j.className)})):null,o},Rt=ft(o=>{const{tabsMeta:l,tabMeta:i}=Tt();if(!(!i||!l)){if(i[J]l[Q]){const n=l[U]+(i[Q]-l[Q]);ct(n,{animation:o})}}}),tt=ft(()=>{T&&M!==!1&&Yt(!Ct)});d.useEffect(()=>{const o=jt(()=>{z.current&&K()});let l;const i=m=>{m.forEach(E=>{E.removedNodes.forEach(G=>{var P;(P=l)==null||P.unobserve(G)}),E.addedNodes.forEach(G=>{var P;(P=l)==null||P.observe(G)})}),o(),tt()},n=Ot(z.current);n.addEventListener("resize",o);let b;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(o),Array.from($.current.children).forEach(m=>{l.observe(m)})),typeof MutationObserver<"u"&&(b=new MutationObserver(i),b.observe($.current,{childList:!0})),()=>{var m,E;o.clear(),n.removeEventListener("resize",o),(m=b)==null||m.disconnect(),(E=l)==null||E.disconnect()}},[K,tt]),d.useEffect(()=>{const o=Array.from($.current.children),l=o.length;if(typeof IntersectionObserver<"u"&&l>0&&T&&M!==!1){const i=o[0],n=o[l-1],b={root:z.current,threshold:.99},m=ut=>{Xt(!ut[0].isIntersecting)},E=new IntersectionObserver(m,b);E.observe(i);const G=ut=>{Vt(!ut[0].isIntersecting)},P=new IntersectionObserver(G,b);return P.observe(n),()=>{E.disconnect(),P.disconnect()}}},[T,M,Ct,C==null?void 0:C.length]),d.useEffect(()=>{Dt(!0)},[]),d.useEffect(()=>{K()}),d.useEffect(()=>{Rt(Lt!==F)},[Rt,F]),d.useImperativeHandle(u,()=>({updateIndicator:K,updateScrollButtons:tt}),[K,tt]);const zt=p.jsx(We,f({},D,{className:N(W.indicator,D.className),ownerState:O,style:f({},F,D.style)}));let et=0;const Jt=d.Children.map(C,o=>{if(!d.isValidElement(o))return null;const l=o.props.value===void 0?et:o.props.value;It.set(l,et);const i=l===X;return et+=1,d.cloneElement(o,f({fullWidth:R==="fullWidth",indicator:i&&!xt&&zt,selected:i,selectionFollowsFocus:st,onChange:I,textColor:Z,value:l},et===1&&X===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Qt=o=>{const l=$.current,i=oe(l).activeElement;if(i.getAttribute("role")!=="tab")return;let b=g==="horizontal"?"ArrowLeft":"ArrowUp",m=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&c&&(b="ArrowRight",m="ArrowLeft"),o.key){case b:o.preventDefault(),ot(l,i,Pt);break;case m:o.preventDefault(),ot(l,i,Wt);break;case"Home":o.preventDefault(),ot(l,null,Wt);break;case"End":o.preventDefault(),ot(l,null,Pt);break}},dt=Zt();return p.jsxs(Me,f({className:N(W.root,y),ownerState:O,ref:r,as:S},At,{children:[dt.scrollButtonStart,dt.scrollbarSizeListener,p.jsxs(Re,{className:W.scroller,ownerState:O,style:{overflow:wt.overflow,[B?`margin${c?"Left":"Right"}`:"marginBottom"]:at?void 0:-wt.scrollbarWidth},ref:z,children:[p.jsx(ze,{"aria-label":v,"aria-labelledby":h,"aria-orientation":g==="vertical"?"vertical":null,className:W.flexContainer,ownerState:O,onKeyDown:Qt,ref:$,role:"tablist",children:Jt}),xt&&zt]}),dt.scrollButtonEnd]}))});var mt={},Le=re;Object.defineProperty(mt,"__esModule",{value:!0});var Ne=mt.default=void 0,ke=Le(le()),lt=p;Ne=mt.default=(0,ke.default)([(0,lt.jsx)("path",{d:"M14 12h4v1.5h-4zm0 3h4v1.5h-4z"},"0"),(0,lt.jsx)("path",{d:"M20 7h-5V4c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m-9 0V4h2v5h-2zm9 13H4V9h5c0 1.1.9 2 2 2h2c1.1 0 2-.9 2-2h5z"},"1"),(0,lt.jsx)("circle",{cx:"9",cy:"13.5",r:"1.5"},"2"),(0,lt.jsx)("path",{d:"M11.08 16.18c-.64-.28-1.34-.43-2.08-.43s-1.44.15-2.08.43c-.56.24-.92.78-.92 1.39V18h6v-.43c0-.61-.36-1.15-.92-1.39"},"3")],"BadgeOutlined");function Ae({label:t,count:e,active:r=!1}){return p.jsxs(ne,{direction:"row",alignItems:"center",spacing:1,children:[p.jsx("span",{children:t}),p.jsx(se,{component:"span",sx:{minWidth:20,height:20,px:.75,borderRadius:10,fontSize:"0.72rem",fontWeight:700,lineHeight:"20px",textAlign:"center",bgcolor:r?"primary.main":"grey.200",color:r?"#fff":"text.secondary"},children:e})]})}export{$e as T,Fe as a,Ae as b,Ne as d}; diff --git a/dist/assets/TableCell-ClQIqE-T.js b/dist/assets/TableCell-dI-OU86K.js similarity index 97% rename from dist/assets/TableCell-ClQIqE-T.js rename to dist/assets/TableCell-dI-OU86K.js index 01a447b..fb06bcd 100644 --- a/dist/assets/TableCell-ClQIqE-T.js +++ b/dist/assets/TableCell-dI-OU86K.js @@ -1,2 +1,2 @@ -import{a as l,l as R,m as $,n as A,o as P,_ as u,j as _,p as j,q as s,v as M,w as D,ac as N,A as z,ad as U}from"./index-Dg-wT72v.js";const W=l.createContext(),E=l.createContext();function L(a){return R("MuiTableCell",a)}const q=$("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),B=["align","className","component","padding","scope","size","sortDirection","variant"],I=a=>{const{classes:e,variant:i,align:o,padding:r,size:g,stickyHeader:d}=a,x={root:["root",i,d&&"stickyHeader",o!=="inherit"&&`align${s(o)}`,r!=="normal"&&`padding${s(r)}`,`size${s(g)}`]};return M(x,L,e)},J=D("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(a,e)=>{const{ownerState:i}=a;return[e.root,e[i.variant],e[`size${s(i.size)}`],i.padding!=="normal"&&e[`padding${s(i.padding)}`],i.align!=="inherit"&&e[`align${s(i.align)}`],i.stickyHeader&&e.stickyHeader]}})(({theme:a,ownerState:e})=>u({},a.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:a.vars?`1px solid ${a.vars.palette.TableCell.border}`:`1px solid +import{a as l,l as R,m as $,n as A,o as P,_ as u,j as _,p as j,q as s,v as M,w as D,ac as N,A as z,ad as U}from"./index-J0uxx8As.js";const W=l.createContext(),E=l.createContext();function L(a){return R("MuiTableCell",a)}const q=$("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),B=["align","className","component","padding","scope","size","sortDirection","variant"],I=a=>{const{classes:e,variant:i,align:o,padding:r,size:g,stickyHeader:d}=a,x={root:["root",i,d&&"stickyHeader",o!=="inherit"&&`align${s(o)}`,r!=="normal"&&`padding${s(r)}`,`size${s(g)}`]};return M(x,L,e)},J=D("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(a,e)=>{const{ownerState:i}=a;return[e.root,e[i.variant],e[`size${s(i.size)}`],i.padding!=="normal"&&e[`padding${s(i.padding)}`],i.align!=="inherit"&&e[`align${s(i.align)}`],i.stickyHeader&&e.stickyHeader]}})(({theme:a,ownerState:e})=>u({},a.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:a.vars?`1px solid ${a.vars.palette.TableCell.border}`:`1px solid ${a.palette.mode==="light"?N(z(a.palette.divider,1),.88):U(z(a.palette.divider,1),.68)}`,textAlign:"left",padding:16},e.variant==="head"&&{color:(a.vars||a).palette.text.primary,lineHeight:a.typography.pxToRem(24),fontWeight:a.typography.fontWeightMedium},e.variant==="body"&&{color:(a.vars||a).palette.text.primary},e.variant==="footer"&&{color:(a.vars||a).palette.text.secondary,lineHeight:a.typography.pxToRem(21),fontSize:a.typography.pxToRem(12)},e.size==="small"&&{padding:"6px 16px",[`&.${q.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},e.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},e.padding==="none"&&{padding:0},e.align==="left"&&{textAlign:"left"},e.align==="center"&&{textAlign:"center"},e.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},e.align==="justify"&&{textAlign:"justify"},e.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(a.vars||a).palette.background.default})),G=l.forwardRef(function(e,i){const o=A({props:e,name:"MuiTableCell"}),{align:r="inherit",className:g,component:d,padding:x,scope:k,size:T,sortDirection:y,variant:h}=o,m=P(o,B),t=l.useContext(W),p=l.useContext(E),b=p&&p.variant==="head";let n;d?n=d:n=b?"th":"td";let c=k;n==="td"?c=void 0:!c&&b&&(c="col");const v=h||p&&p.variant,C=u({},o,{align:r,component:n,padding:x||(t&&t.padding?t.padding:"normal"),size:T||(t&&t.size?t.size:"medium"),sortDirection:y,stickyHeader:v==="head"&&t&&t.stickyHeader,variant:v}),H=I(C);let f=null;return y&&(f=y==="asc"?"ascending":"descending"),_.jsx(J,u({as:n,ref:i,className:j(H.root,g),"aria-sort":f,scope:c,ownerState:C},m))});export{G as T,W as a,E as b}; diff --git a/dist/assets/TableRow-Du7Jvlvh.js b/dist/assets/TableRow-DryS4Frn.js similarity index 97% rename from dist/assets/TableRow-Du7Jvlvh.js rename to dist/assets/TableRow-DryS4Frn.js index 39bb8d3..db873ef 100644 --- a/dist/assets/TableRow-Du7Jvlvh.js +++ b/dist/assets/TableRow-DryS4Frn.js @@ -1 +1 @@ -import{l as v,m as y,a as p,n as m,o as T,_ as n,j as d,p as f,v as C,w,A as x}from"./index-Dg-wT72v.js";import{a as j,b as g}from"./TableCell-ClQIqE-T.js";function k(o){return v("MuiTable",o)}y("MuiTable",["root","stickyHeader"]);const S=["className","component","padding","size","stickyHeader"],_=o=>{const{classes:e,stickyHeader:s}=o;return C({root:["root",s&&"stickyHeader"]},k,e)},B=w("table",{name:"MuiTable",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:s}=o;return[e.root,s.stickyHeader&&e.stickyHeader]}})(({theme:o,ownerState:e})=>n({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":n({},o.typography.body2,{padding:o.spacing(2),color:(o.vars||o).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},e.stickyHeader&&{borderCollapse:"separate"})),h="table",eo=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTable"}),{className:c,component:a=h,padding:l="normal",size:r="medium",stickyHeader:i=!1}=t,u=T(t,S),b=n({},t,{component:a,padding:l,size:r,stickyHeader:i}),R=_(b),U=p.useMemo(()=>({padding:l,size:r,stickyHeader:i}),[l,r,i]);return d.jsx(j.Provider,{value:U,children:d.jsx(B,n({as:a,role:a===h?null:"table",ref:s,className:f(R.root,c),ownerState:b},u))})});function O(o){return v("MuiTableBody",o)}y("MuiTableBody",["root"]);const P=["className","component"],A=o=>{const{classes:e}=o;return C({root:["root"]},O,e)},z=w("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(o,e)=>e.root})({display:"table-row-group"}),E={variant:"body"},M="tbody",to=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableBody"}),{className:c,component:a=M}=t,l=T(t,P),r=n({},t,{component:a}),i=A(r);return d.jsx(g.Provider,{value:E,children:d.jsx(z,n({className:f(i.root,c),as:a,ref:s,role:a===M?null:"rowgroup",ownerState:r},l))})});function D(o){return v("MuiTableContainer",o)}y("MuiTableContainer",["root"]);const L=["className","component"],W=o=>{const{classes:e}=o;return C({root:["root"]},D,e)},X=w("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(o,e)=>e.root})({width:"100%",overflowX:"auto"}),so=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableContainer"}),{className:c,component:a="div"}=t,l=T(t,L),r=n({},t,{component:a}),i=W(r);return d.jsx(X,n({ref:s,as:a,className:f(i.root,c),ownerState:r},l))});function q(o){return v("MuiTableHead",o)}y("MuiTableHead",["root"]);const F=["className","component"],G=o=>{const{classes:e}=o;return C({root:["root"]},q,e)},I=w("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(o,e)=>e.root})({display:"table-header-group"}),J={variant:"head"},$="thead",ao=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableHead"}),{className:c,component:a=$}=t,l=T(t,F),r=n({},t,{component:a}),i=G(r);return d.jsx(g.Provider,{value:J,children:d.jsx(I,n({as:a,className:f(i.root,c),ref:s,role:a===$?null:"rowgroup",ownerState:r},l))})});function K(o){return v("MuiTableRow",o)}const H=y("MuiTableRow",["root","selected","hover","head","footer"]),Q=["className","component","hover","selected"],V=o=>{const{classes:e,selected:s,hover:t,head:c,footer:a}=o;return C({root:["root",s&&"selected",t&&"hover",c&&"head",a&&"footer"]},K,e)},Y=w("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:s}=o;return[e.root,s.head&&e.head,s.footer&&e.footer]}})(({theme:o})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${H.hover}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${H.selected}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.selectedOpacity})`:x(o.palette.primary.main,o.palette.action.selectedOpacity),"&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:x(o.palette.primary.main,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)}}})),N="tr",ro=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableRow"}),{className:c,component:a=N,hover:l=!1,selected:r=!1}=t,i=T(t,Q),u=p.useContext(g),b=n({},t,{component:a,hover:l,selected:r,head:u&&u.variant==="head",footer:u&&u.variant==="footer"}),R=V(b);return d.jsx(Y,n({as:a,ref:s,className:f(R.root,c),role:a===N?null:"row",ownerState:b},i))});export{so as T,eo as a,ao as b,ro as c,to as d}; +import{l as v,m as y,a as p,n as m,o as T,_ as n,j as d,p as f,v as C,w,A as x}from"./index-J0uxx8As.js";import{a as j,b as g}from"./TableCell-dI-OU86K.js";function k(o){return v("MuiTable",o)}y("MuiTable",["root","stickyHeader"]);const S=["className","component","padding","size","stickyHeader"],_=o=>{const{classes:e,stickyHeader:s}=o;return C({root:["root",s&&"stickyHeader"]},k,e)},B=w("table",{name:"MuiTable",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:s}=o;return[e.root,s.stickyHeader&&e.stickyHeader]}})(({theme:o,ownerState:e})=>n({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":n({},o.typography.body2,{padding:o.spacing(2),color:(o.vars||o).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},e.stickyHeader&&{borderCollapse:"separate"})),h="table",eo=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTable"}),{className:c,component:a=h,padding:l="normal",size:r="medium",stickyHeader:i=!1}=t,u=T(t,S),b=n({},t,{component:a,padding:l,size:r,stickyHeader:i}),R=_(b),U=p.useMemo(()=>({padding:l,size:r,stickyHeader:i}),[l,r,i]);return d.jsx(j.Provider,{value:U,children:d.jsx(B,n({as:a,role:a===h?null:"table",ref:s,className:f(R.root,c),ownerState:b},u))})});function O(o){return v("MuiTableBody",o)}y("MuiTableBody",["root"]);const P=["className","component"],A=o=>{const{classes:e}=o;return C({root:["root"]},O,e)},z=w("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(o,e)=>e.root})({display:"table-row-group"}),E={variant:"body"},M="tbody",to=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableBody"}),{className:c,component:a=M}=t,l=T(t,P),r=n({},t,{component:a}),i=A(r);return d.jsx(g.Provider,{value:E,children:d.jsx(z,n({className:f(i.root,c),as:a,ref:s,role:a===M?null:"rowgroup",ownerState:r},l))})});function D(o){return v("MuiTableContainer",o)}y("MuiTableContainer",["root"]);const L=["className","component"],W=o=>{const{classes:e}=o;return C({root:["root"]},D,e)},X=w("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(o,e)=>e.root})({width:"100%",overflowX:"auto"}),so=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableContainer"}),{className:c,component:a="div"}=t,l=T(t,L),r=n({},t,{component:a}),i=W(r);return d.jsx(X,n({ref:s,as:a,className:f(i.root,c),ownerState:r},l))});function q(o){return v("MuiTableHead",o)}y("MuiTableHead",["root"]);const F=["className","component"],G=o=>{const{classes:e}=o;return C({root:["root"]},q,e)},I=w("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(o,e)=>e.root})({display:"table-header-group"}),J={variant:"head"},$="thead",ao=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableHead"}),{className:c,component:a=$}=t,l=T(t,F),r=n({},t,{component:a}),i=G(r);return d.jsx(g.Provider,{value:J,children:d.jsx(I,n({as:a,className:f(i.root,c),ref:s,role:a===$?null:"rowgroup",ownerState:r},l))})});function K(o){return v("MuiTableRow",o)}const H=y("MuiTableRow",["root","selected","hover","head","footer"]),Q=["className","component","hover","selected"],V=o=>{const{classes:e,selected:s,hover:t,head:c,footer:a}=o;return C({root:["root",s&&"selected",t&&"hover",c&&"head",a&&"footer"]},K,e)},Y=w("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:s}=o;return[e.root,s.head&&e.head,s.footer&&e.footer]}})(({theme:o})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${H.hover}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${H.selected}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.selectedOpacity})`:x(o.palette.primary.main,o.palette.action.selectedOpacity),"&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:x(o.palette.primary.main,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)}}})),N="tr",ro=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableRow"}),{className:c,component:a=N,hover:l=!1,selected:r=!1}=t,i=T(t,Q),u=p.useContext(g),b=n({},t,{component:a,hover:l,selected:r,head:u&&u.variant==="head",footer:u&&u.variant==="footer"}),R=V(b);return d.jsx(Y,n({as:a,ref:s,className:f(R.root,c),role:a===N?null:"row",ownerState:b},i))});export{so as T,eo as a,ao as b,ro as c,to as d}; diff --git a/dist/assets/TeamUsers-Csrvkh6_.js b/dist/assets/TeamUsers-Dv5yeZfk.js similarity index 94% rename from dist/assets/TeamUsers-Csrvkh6_.js rename to dist/assets/TeamUsers-Dv5yeZfk.js index 15a0e5f..7291f96 100644 --- a/dist/assets/TeamUsers-Csrvkh6_.js +++ b/dist/assets/TeamUsers-Dv5yeZfk.js @@ -1 +1 @@ -import{r as $,j as e,i as T,a,I as W,M as pe,C as L,R as fe,V as je,t as X,S as A,B as p,b as ge,T as j,H as ve,K as Q,c as be,g as ye,W as Se,U as Ce}from"./index-Dg-wT72v.js";import{D as Z,a as ee,b as se,c as re,d as _e,e as $e}from"./EditOutlined-COfONJBH.js";import{d as Te,E as ze}from"./EmptyState-Do4nLXP0.js";import{d as Me,a as Pe,T as Ie,D as Re}from"./PhoneOutlined-BqFvwse4.js";import{T as we,a as ke,b as De,d as Ee}from"./TabLabelCount-BKNSTwCP.js";import{A as te,G as b,P as Ae,a as le}from"./PageHeader-DgkErsA7.js";import{d as Oe}from"./Close-DKUHif5O.js";import{T as y}from"./TextField-COVOKpzm.js";import{B as S}from"./Button-COL1_fTB.js";import{C as Ue,L as Y}from"./Link-CndAQvyC.js";import{I as We}from"./InputAdornment-HqPFSHfS.js";import{T as Le,a as qe,b as Be,c as k,d as He}from"./TableRow-Du7Jvlvh.js";import{T as i}from"./TableCell-ClQIqE-T.js";var q={},Ve=T;Object.defineProperty(q,"__esModule",{value:!0});var ae=q.default=void 0,Fe=Ve($()),Ne=e;ae=q.default=(0,Fe.default)((0,Ne.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 14H4V8l8 5 8-5zm-8-7L4 6h16z"}),"MailOutline");var B={},Ge=T;Object.defineProperty(B,"__esModule",{value:!0});var ne=B.default=void 0,Ke=Ge($()),D=e;ne=B.default=(0,Ke.default)((0,D.jsxs)("g",{fillRule:"evenodd",children:[(0,D.jsx)("circle",{cx:"17",cy:"15.5",r:"1.12"}),(0,D.jsx)("path",{d:"M17 17.5c-.73 0-2.19.36-2.24 1.08.5.71 1.32 1.17 2.24 1.17s1.74-.46 2.24-1.17c-.05-.72-1.51-1.08-2.24-1.08"}),(0,D.jsx)("path",{d:"M18 11.09V6.27L10.5 3 3 6.27v4.91c0 4.54 3.2 8.79 7.5 9.82.55-.13 1.08-.32 1.6-.55C13.18 21.99 14.97 23 17 23c3.31 0 6-2.69 6-6 0-2.97-2.16-5.43-5-5.91M11 17c0 .56.08 1.11.23 1.62-.24.11-.48.22-.73.3-3.17-1-5.5-4.24-5.5-7.74v-3.6l5.5-2.4 5.5 2.4v3.51c-2.84.48-5 2.94-5 5.91m6 4c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4"})]}),"AdminPanelSettingsOutlined");var H={},Qe=T;Object.defineProperty(H,"__esModule",{value:!0});var ie=H.default=void 0,Ye=Qe($()),E=e;ie=H.default=(0,Ye.default)([(0,E.jsx)("path",{d:"M21 12.22C21 6.73 16.74 3 12 3c-4.69 0-9 3.65-9 9.28-.6.34-1 .98-1 1.72v2c0 1.1.9 2 2 2h1v-6.1c0-3.87 3.13-7 7-7s7 3.13 7 7V19h-8v2h8c1.1 0 2-.9 2-2v-1.22c.59-.31 1-.92 1-1.64v-2.3c0-.7-.41-1.31-1-1.62"},"0"),(0,E.jsx)("circle",{cx:"9",cy:"13",r:"1"},"1"),(0,E.jsx)("circle",{cx:"15",cy:"13",r:"1"},"2"),(0,E.jsx)("path",{d:"M18 11.03C17.52 8.18 15.04 6 12.05 6c-3.03 0-6.29 2.51-6.03 6.45 2.47-1.01 4.33-3.21 4.86-5.89 1.31 2.63 4 4.44 7.12 4.47"},"3")],"SupportAgentOutlined");var V={},Je=T;Object.defineProperty(V,"__esModule",{value:!0});var oe=V.default=void 0,Xe=Je($()),Ze=e;oe=V.default=(0,Xe.default)((0,Ze.jsx)("path",{d:"M4 18v-.65c0-.34.16-.66.41-.81C6.1 15.53 8.03 15 10 15c.03 0 .05 0 .08.01.1-.7.3-1.37.59-1.98-.22-.02-.44-.03-.67-.03-2.42 0-4.68.67-6.61 1.82-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.42-.6-.75-1.28-.97-2zm6-6c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m10.75 10c0-.22-.03-.42-.06-.63l1.14-1.01-1-1.73-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49-1 1.73 1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01 1 1.73 1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49 1-1.73-1.14-1.01c.03-.21.06-.41.06-.63M17 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"ManageAccountsOutlined");var F={},es=T;Object.defineProperty(F,"__esModule",{value:!0});var ce=F.default=void 0,ss=es($()),rs=e;ce=F.default=(0,ss.default)((0,rs.jsx)("path",{d:"M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4"}),"PersonOutlineOutlined");const ts=["admin","rep","manager"],J={name:"",email:"",phone:"",role:"rep",pin:"",password:""},ls=(r,n)=>n&&!r.includes(n)?[n,...r]:r;function as({open:r,mode:n,initial:u,onClose:m,onSaved:C}){const o=n==="edit",[t,z]=a.useState(J),[h,M]=a.useState(!1),[g,x]=a.useState(null);a.useEffect(()=>{r&&(z({...J,...u||{}}),x(null))},[r,u]);const c=d=>f=>z(v=>({...v,[d]:f.target.value})),O=async()=>{if(!t.name.trim()){x("Name is required.");return}if(!t.email.trim()){x("Email is required.");return}if(!o&&!t.password.trim()){x("Password is required.");return}M(!0),x(null);const d={first_name:t.name.trim(),email:t.email.trim(),phone:t.phone,role:t.role,...t.password?{password:t.password}:{},...t.pin?{pin:String(t.pin)}:{}};try{o?await fe(u.id,d):await je(d),C()}catch(f){x(f.message||"Failed to save user")}finally{M(!1)}};return e.jsxs(Z,{open:r,onClose:h?void 0:m,maxWidth:"sm",fullWidth:!0,children:[e.jsxs(ee,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o?"Edit Team User":"Add Team User",e.jsx(W,{onClick:m,size:"small",disabled:h,children:e.jsx(Oe,{})})]}),e.jsxs(se,{dividers:!0,children:[g&&e.jsx(te,{severity:"error",sx:{mb:2},children:g}),e.jsxs(b,{container:!0,spacing:2,sx:{mt:0},children:[e.jsx(b,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,size:"small",label:"Name *",value:t.name,onChange:c("name")})}),e.jsx(b,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,size:"small",label:"Email *",value:t.email,onChange:c("email")})}),e.jsx(b,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,size:"small",label:"Phone",value:t.phone,onChange:c("phone")})}),e.jsx(b,{item:!0,xs:12,sm:6,children:e.jsx(y,{select:!0,fullWidth:!0,size:"small",label:"Role",value:t.role,onChange:c("role"),children:ls(ts,t.role).map(d=>e.jsx(pe,{value:d,children:d},d))})}),e.jsx(b,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,size:"small",label:"PIN",value:t.pin,onChange:c("pin")})}),e.jsx(b,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,size:"small",type:"password",label:o?"New Password (optional)":"Password *",value:t.password,onChange:c("password")})})]})]}),e.jsxs(re,{sx:{px:3,py:2},children:[e.jsx(S,{onClick:m,disabled:h,children:"Cancel"}),e.jsx(S,{variant:"contained",onClick:O,disabled:h,startIcon:h?e.jsx(L,{size:16,color:"inherit"}):null,children:o?"Save Changes":"Create User"})]})]})}const ns={admin:{color:"primary",icon:ne},manager:{color:"success",icon:oe},rep:{color:"info",icon:Ee},support:{color:"warning",icon:ie}},de=r=>ns[String(r||"").toLowerCase()]||{color:"secondary",icon:ce};function is({name:r,email:n,role:u}){const{color:m,icon:C}=de(u),o=n?n.split("@")[0]:"";return e.jsxs(A,{direction:"row",spacing:1.5,alignItems:"center",children:[e.jsxs(p,{sx:{position:"relative",display:"inline-flex"},children:[e.jsx(Ce,{name:r,size:40,sx:{border:"2px solid",borderColor:`${m}.lighter`}}),e.jsx(p,{sx:{position:"absolute",right:-3,bottom:-3,width:18,height:18,borderRadius:"50%",bgcolor:`${m}.main`,color:"#fff",display:"inline-flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff"},children:e.jsx(C,{sx:{fontSize:11}})})]}),e.jsxs(p,{sx:{minWidth:0},children:[e.jsx(j,{variant:"body2",sx:{fontWeight:600,color:"grey.800",lineHeight:1.25},children:r}),o&&e.jsxs(j,{variant:"caption",color:"text.secondary",children:["@",o]})]})]})}function os({role:r}){const{color:n,icon:u}=de(r);return e.jsx(le,{size:"small",icon:e.jsx(u,{sx:{fontSize:15,ml:.5}}),label:X(r),sx:{fontWeight:600,bgcolor:`${n==="secondary"?"grey.100":`${n}.lighter`}`,color:`${n==="secondary"?"grey.700":`${n}.dark`}`,"& .MuiChip-icon":{color:"inherit"}}})}function Ss(){var K;const[r,n]=a.useState([]),[u,m]=a.useState(!0),[C,o]=a.useState(null),[t,z]=a.useState(0),[h,M]=a.useState(""),[g,x]=a.useState(0),[c,O]=a.useState(10),[d,f]=a.useState({open:!1,mode:"add",initial:null}),[v,P]=a.useState(null),[I,N]=a.useState(!1),_=()=>{m(!0),o(null),be().then(s=>n(s.map(ye))).catch(s=>o(s.message||"Failed to load team users")).finally(()=>m(!1))};a.useEffect(()=>{_()},[]);const R=a.useMemo(()=>{const s=[];return r.forEach(l=>{s.includes(l.role)||s.push(l.role)}),[{key:"all",label:"All"},...s.map(l=>({key:l,label:X(l)}))]},[r]),U=((K=R[Math.min(t,R.length-1)])==null?void 0:K.key)||"all",ue=a.useMemo(()=>{const s={all:r.length};return r.forEach(l=>{s[l.role]=(s[l.role]||0)+1}),s},[r]),w=a.useMemo(()=>r.filter(s=>{const l=U==="all"||s.role===U,me=!h||[s.name,s.email,s.phone,s.role].join(" ").toLowerCase().includes(h.toLowerCase());return l&&me}),[r,U,h]),G=w.slice(g*c,g*c+c),xe=()=>{f({open:!1,mode:"add",initial:null}),_()},he=async()=>{N(!0);try{await Se(v.id),P(null),_()}catch(s){o(s.message||"Failed to delete user")}finally{N(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{title:"App Users",breadcrumbs:[{label:"App Users"}],action:e.jsxs(A,{direction:"row",spacing:1.5,children:[e.jsx(S,{variant:"outlined",startIcon:e.jsx(Te,{}),onClick:_,disabled:u,children:"Refresh"}),e.jsx(S,{variant:"contained",startIcon:e.jsx(_e,{}),onClick:()=>f({open:!0,mode:"add",initial:null}),children:"Add User"})]})}),e.jsxs(Ue,{sx:{overflow:"hidden"},children:[e.jsxs(p,{sx:{px:2.5,py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:s=>`linear-gradient(90deg, ${s.palette.primary.lighter}66 0%, ${s.palette.background.paper} 70%)`},children:[e.jsx(p,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(ge,{fontSize:"small"})}),e.jsxs(p,{children:[e.jsx(j,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"App Users Directory"}),e.jsx(j,{variant:"caption",color:"text.secondary",children:"Manage console members, roles and access"})]})]}),e.jsxs(A,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:2},alignItems:{md:"center"},children:[e.jsx(y,{size:"small",placeholder:"Search by name, email, phone…",value:h,onChange:s=>{M(s.target.value),x(0)},sx:{minWidth:300},InputProps:{startAdornment:e.jsx(We,{position:"start",children:e.jsx(ve,{fontSize:"small"})})}}),e.jsx(p,{sx:{flexGrow:1}}),!u&&e.jsxs(A,{direction:"row",spacing:1,alignItems:"center",children:[e.jsxs(j,{variant:"body2",color:"text.secondary",children:[w.length," ",w.length===1?"user":"users"]}),e.jsx(le,{size:"small",label:"live · PostgreSQL",sx:{height:22,fontSize:"0.7rem",bgcolor:"success.lighter",color:"success.dark",fontWeight:600}})]})]}),e.jsx(p,{sx:{px:2,borderBottom:1,borderColor:"divider"},children:e.jsx(we,{value:Math.min(t,R.length-1),onChange:(s,l)=>{z(l),x(0)},variant:"scrollable",scrollButtons:"auto",children:R.map((s,l)=>e.jsx(ke,{label:e.jsx(De,{label:s.label,count:ue[s.key]||0,active:t===l})},s.key))})}),C&&e.jsx(te,{severity:"error",sx:{m:2},action:e.jsx(S,{color:"inherit",size:"small",onClick:_,children:"Retry"}),children:C}),e.jsx(Le,{children:e.jsxs(qe,{sx:{minWidth:800},children:[e.jsx(Be,{children:e.jsxs(k,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(i,{sx:{width:64},children:"S.No"}),e.jsx(i,{children:"User"}),e.jsx(i,{children:"Email"}),e.jsx(i,{children:"Phone"}),e.jsx(i,{children:"Role"}),e.jsx(i,{align:"right",children:"Actions"})]})}),e.jsx(He,{children:u?e.jsx(k,{children:e.jsx(i,{colSpan:6,sx:{border:"none"},children:e.jsx(p,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(L,{})})})}):G.length===0?e.jsx(k,{children:e.jsx(i,{colSpan:6,sx:{border:"none"},children:e.jsx(ze,{title:"No team users found",caption:"Try a different role or search term, or add a user."})})}):G.map((s,l)=>e.jsxs(k,{hover:!0,children:[e.jsx(i,{children:e.jsx(j,{variant:"body2",color:"text.secondary",children:g*c+l+1})}),e.jsx(i,{children:e.jsx(is,{name:s.name,email:s.email,role:s.role})}),e.jsx(i,{children:s.email?e.jsxs(Y,{href:`mailto:${s.email}`,underline:"hover",color:"text.primary",sx:{display:"inline-flex",alignItems:"center",gap:.75,fontSize:"0.8125rem"},children:[e.jsx(ae,{sx:{fontSize:15,color:"grey.400"}}),s.email]}):e.jsx(j,{variant:"body2",color:"text.disabled",children:"—"})}),e.jsx(i,{children:s.phone?e.jsxs(Y,{href:`tel:${s.phone}`,underline:"hover",color:"text.primary",sx:{display:"inline-flex",alignItems:"center",gap:.75,fontSize:"0.8125rem"},children:[e.jsx(Me,{sx:{fontSize:15,color:"grey.400"}}),s.phone]}):e.jsx(j,{variant:"body2",color:"text.disabled",children:"—"})}),e.jsx(i,{children:e.jsx(os,{role:s.role})}),e.jsxs(i,{align:"right",children:[e.jsx(Q,{title:"Edit",children:e.jsx(W,{size:"small",onClick:()=>f({open:!0,mode:"edit",initial:s}),children:e.jsx($e,{fontSize:"small"})})}),e.jsx(Q,{title:"Delete",children:e.jsx(W,{size:"small",color:"error",onClick:()=>P(s),children:e.jsx(Pe,{fontSize:"small"})})})]})]},s.id))})]})}),e.jsx(Ie,{component:"div",count:w.length,page:g,onPageChange:(s,l)=>x(l),rowsPerPage:c,onRowsPerPageChange:s=>{O(+s.target.value),x(0)},rowsPerPageOptions:[5,10,25]})]}),e.jsx(as,{open:d.open,mode:d.mode,initial:d.initial,onClose:()=>f({open:!1,mode:"add",initial:null}),onSaved:xe}),e.jsxs(Z,{open:!!v,onClose:I?void 0:()=>P(null),children:[e.jsx(ee,{children:"Delete user?"}),e.jsx(se,{children:e.jsxs(Re,{children:["This will permanently remove ",e.jsx("strong",{children:v==null?void 0:v.name})," from the PostgreSQL database. This cannot be undone."]})}),e.jsxs(re,{sx:{px:3,py:2},children:[e.jsx(S,{onClick:()=>P(null),disabled:I,children:"Cancel"}),e.jsx(S,{color:"error",variant:"contained",onClick:he,disabled:I,startIcon:I?e.jsx(L,{size:16,color:"inherit"}):null,children:"Delete"})]})]})]})}export{Ss as default}; +import{r as $,j as e,i as T,a,I as W,M as pe,C as L,R as fe,V as je,t as X,S as A,B as p,b as ge,T as j,H as ve,K as Q,c as be,g as ye,W as Se,U as Ce}from"./index-J0uxx8As.js";import{D as Z,a as ee,b as se,c as re,d as _e,e as $e}from"./EditOutlined-CLycK5tS.js";import{d as Te,E as ze}from"./EmptyState-B2FWZCr6.js";import{d as Me,a as Pe,T as Ie,D as Re}from"./PhoneOutlined-C_1wJaio.js";import{T as we,a as ke,b as De,d as Ee}from"./TabLabelCount-C4m0Yyzh.js";import{A as te,G as b,P as Ae,a as le}from"./PageHeader-TW1dMGrU.js";import{d as Oe}from"./Close-DtPVHjo-.js";import{T as y}from"./TextField-BARvBB_z.js";import{B as S}from"./Button-BkRsd5c4.js";import{C as Ue,L as Y}from"./Link-DdF3Xu1F.js";import{I as We}from"./InputAdornment-Cbcw8oJa.js";import{T as Le,a as qe,b as Be,c as k,d as He}from"./TableRow-DryS4Frn.js";import{T as i}from"./TableCell-dI-OU86K.js";var q={},Ve=T;Object.defineProperty(q,"__esModule",{value:!0});var ae=q.default=void 0,Fe=Ve($()),Ne=e;ae=q.default=(0,Fe.default)((0,Ne.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 14H4V8l8 5 8-5zm-8-7L4 6h16z"}),"MailOutline");var B={},Ge=T;Object.defineProperty(B,"__esModule",{value:!0});var ne=B.default=void 0,Ke=Ge($()),D=e;ne=B.default=(0,Ke.default)((0,D.jsxs)("g",{fillRule:"evenodd",children:[(0,D.jsx)("circle",{cx:"17",cy:"15.5",r:"1.12"}),(0,D.jsx)("path",{d:"M17 17.5c-.73 0-2.19.36-2.24 1.08.5.71 1.32 1.17 2.24 1.17s1.74-.46 2.24-1.17c-.05-.72-1.51-1.08-2.24-1.08"}),(0,D.jsx)("path",{d:"M18 11.09V6.27L10.5 3 3 6.27v4.91c0 4.54 3.2 8.79 7.5 9.82.55-.13 1.08-.32 1.6-.55C13.18 21.99 14.97 23 17 23c3.31 0 6-2.69 6-6 0-2.97-2.16-5.43-5-5.91M11 17c0 .56.08 1.11.23 1.62-.24.11-.48.22-.73.3-3.17-1-5.5-4.24-5.5-7.74v-3.6l5.5-2.4 5.5 2.4v3.51c-2.84.48-5 2.94-5 5.91m6 4c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4"})]}),"AdminPanelSettingsOutlined");var H={},Qe=T;Object.defineProperty(H,"__esModule",{value:!0});var ie=H.default=void 0,Ye=Qe($()),E=e;ie=H.default=(0,Ye.default)([(0,E.jsx)("path",{d:"M21 12.22C21 6.73 16.74 3 12 3c-4.69 0-9 3.65-9 9.28-.6.34-1 .98-1 1.72v2c0 1.1.9 2 2 2h1v-6.1c0-3.87 3.13-7 7-7s7 3.13 7 7V19h-8v2h8c1.1 0 2-.9 2-2v-1.22c.59-.31 1-.92 1-1.64v-2.3c0-.7-.41-1.31-1-1.62"},"0"),(0,E.jsx)("circle",{cx:"9",cy:"13",r:"1"},"1"),(0,E.jsx)("circle",{cx:"15",cy:"13",r:"1"},"2"),(0,E.jsx)("path",{d:"M18 11.03C17.52 8.18 15.04 6 12.05 6c-3.03 0-6.29 2.51-6.03 6.45 2.47-1.01 4.33-3.21 4.86-5.89 1.31 2.63 4 4.44 7.12 4.47"},"3")],"SupportAgentOutlined");var V={},Je=T;Object.defineProperty(V,"__esModule",{value:!0});var oe=V.default=void 0,Xe=Je($()),Ze=e;oe=V.default=(0,Xe.default)((0,Ze.jsx)("path",{d:"M4 18v-.65c0-.34.16-.66.41-.81C6.1 15.53 8.03 15 10 15c.03 0 .05 0 .08.01.1-.7.3-1.37.59-1.98-.22-.02-.44-.03-.67-.03-2.42 0-4.68.67-6.61 1.82-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.42-.6-.75-1.28-.97-2zm6-6c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m10.75 10c0-.22-.03-.42-.06-.63l1.14-1.01-1-1.73-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49-1 1.73 1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01 1 1.73 1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49 1-1.73-1.14-1.01c.03-.21.06-.41.06-.63M17 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"ManageAccountsOutlined");var F={},es=T;Object.defineProperty(F,"__esModule",{value:!0});var ce=F.default=void 0,ss=es($()),rs=e;ce=F.default=(0,ss.default)((0,rs.jsx)("path",{d:"M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4"}),"PersonOutlineOutlined");const ts=["admin","rep","manager"],J={name:"",email:"",phone:"",role:"rep",pin:"",password:""},ls=(r,n)=>n&&!r.includes(n)?[n,...r]:r;function as({open:r,mode:n,initial:u,onClose:m,onSaved:C}){const o=n==="edit",[t,z]=a.useState(J),[h,M]=a.useState(!1),[g,x]=a.useState(null);a.useEffect(()=>{r&&(z({...J,...u||{}}),x(null))},[r,u]);const c=d=>f=>z(v=>({...v,[d]:f.target.value})),O=async()=>{if(!t.name.trim()){x("Name is required.");return}if(!t.email.trim()){x("Email is required.");return}if(!o&&!t.password.trim()){x("Password is required.");return}M(!0),x(null);const d={first_name:t.name.trim(),email:t.email.trim(),phone:t.phone,role:t.role,...t.password?{password:t.password}:{},...t.pin?{pin:String(t.pin)}:{}};try{o?await fe(u.id,d):await je(d),C()}catch(f){x(f.message||"Failed to save user")}finally{M(!1)}};return e.jsxs(Z,{open:r,onClose:h?void 0:m,maxWidth:"sm",fullWidth:!0,children:[e.jsxs(ee,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[o?"Edit Team User":"Add Team User",e.jsx(W,{onClick:m,size:"small",disabled:h,children:e.jsx(Oe,{})})]}),e.jsxs(se,{dividers:!0,children:[g&&e.jsx(te,{severity:"error",sx:{mb:2},children:g}),e.jsxs(b,{container:!0,spacing:2,sx:{mt:0},children:[e.jsx(b,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,size:"small",label:"Name *",value:t.name,onChange:c("name")})}),e.jsx(b,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,size:"small",label:"Email *",value:t.email,onChange:c("email")})}),e.jsx(b,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,size:"small",label:"Phone",value:t.phone,onChange:c("phone")})}),e.jsx(b,{item:!0,xs:12,sm:6,children:e.jsx(y,{select:!0,fullWidth:!0,size:"small",label:"Role",value:t.role,onChange:c("role"),children:ls(ts,t.role).map(d=>e.jsx(pe,{value:d,children:d},d))})}),e.jsx(b,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,size:"small",label:"PIN",value:t.pin,onChange:c("pin")})}),e.jsx(b,{item:!0,xs:12,sm:6,children:e.jsx(y,{fullWidth:!0,size:"small",type:"password",label:o?"New Password (optional)":"Password *",value:t.password,onChange:c("password")})})]})]}),e.jsxs(re,{sx:{px:3,py:2},children:[e.jsx(S,{onClick:m,disabled:h,children:"Cancel"}),e.jsx(S,{variant:"contained",onClick:O,disabled:h,startIcon:h?e.jsx(L,{size:16,color:"inherit"}):null,children:o?"Save Changes":"Create User"})]})]})}const ns={admin:{color:"primary",icon:ne},manager:{color:"success",icon:oe},rep:{color:"info",icon:Ee},support:{color:"warning",icon:ie}},de=r=>ns[String(r||"").toLowerCase()]||{color:"secondary",icon:ce};function is({name:r,email:n,role:u}){const{color:m,icon:C}=de(u),o=n?n.split("@")[0]:"";return e.jsxs(A,{direction:"row",spacing:1.5,alignItems:"center",children:[e.jsxs(p,{sx:{position:"relative",display:"inline-flex"},children:[e.jsx(Ce,{name:r,size:40,sx:{border:"2px solid",borderColor:`${m}.lighter`}}),e.jsx(p,{sx:{position:"absolute",right:-3,bottom:-3,width:18,height:18,borderRadius:"50%",bgcolor:`${m}.main`,color:"#fff",display:"inline-flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff"},children:e.jsx(C,{sx:{fontSize:11}})})]}),e.jsxs(p,{sx:{minWidth:0},children:[e.jsx(j,{variant:"body2",sx:{fontWeight:600,color:"grey.800",lineHeight:1.25},children:r}),o&&e.jsxs(j,{variant:"caption",color:"text.secondary",children:["@",o]})]})]})}function os({role:r}){const{color:n,icon:u}=de(r);return e.jsx(le,{size:"small",icon:e.jsx(u,{sx:{fontSize:15,ml:.5}}),label:X(r),sx:{fontWeight:600,bgcolor:`${n==="secondary"?"grey.100":`${n}.lighter`}`,color:`${n==="secondary"?"grey.700":`${n}.dark`}`,"& .MuiChip-icon":{color:"inherit"}}})}function Ss(){var K;const[r,n]=a.useState([]),[u,m]=a.useState(!0),[C,o]=a.useState(null),[t,z]=a.useState(0),[h,M]=a.useState(""),[g,x]=a.useState(0),[c,O]=a.useState(10),[d,f]=a.useState({open:!1,mode:"add",initial:null}),[v,P]=a.useState(null),[I,N]=a.useState(!1),_=()=>{m(!0),o(null),be().then(s=>n(s.map(ye))).catch(s=>o(s.message||"Failed to load team users")).finally(()=>m(!1))};a.useEffect(()=>{_()},[]);const R=a.useMemo(()=>{const s=[];return r.forEach(l=>{s.includes(l.role)||s.push(l.role)}),[{key:"all",label:"All"},...s.map(l=>({key:l,label:X(l)}))]},[r]),U=((K=R[Math.min(t,R.length-1)])==null?void 0:K.key)||"all",ue=a.useMemo(()=>{const s={all:r.length};return r.forEach(l=>{s[l.role]=(s[l.role]||0)+1}),s},[r]),w=a.useMemo(()=>r.filter(s=>{const l=U==="all"||s.role===U,me=!h||[s.name,s.email,s.phone,s.role].join(" ").toLowerCase().includes(h.toLowerCase());return l&&me}),[r,U,h]),G=w.slice(g*c,g*c+c),xe=()=>{f({open:!1,mode:"add",initial:null}),_()},he=async()=>{N(!0);try{await Se(v.id),P(null),_()}catch(s){o(s.message||"Failed to delete user")}finally{N(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Ae,{title:"App Users",breadcrumbs:[{label:"App Users"}],action:e.jsxs(A,{direction:"row",spacing:1.5,children:[e.jsx(S,{variant:"outlined",startIcon:e.jsx(Te,{}),onClick:_,disabled:u,children:"Refresh"}),e.jsx(S,{variant:"contained",startIcon:e.jsx(_e,{}),onClick:()=>f({open:!0,mode:"add",initial:null}),children:"Add User"})]})}),e.jsxs(Ue,{sx:{overflow:"hidden"},children:[e.jsxs(p,{sx:{px:2.5,py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:s=>`linear-gradient(90deg, ${s.palette.primary.lighter}66 0%, ${s.palette.background.paper} 70%)`},children:[e.jsx(p,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(ge,{fontSize:"small"})}),e.jsxs(p,{children:[e.jsx(j,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"App Users Directory"}),e.jsx(j,{variant:"caption",color:"text.secondary",children:"Manage console members, roles and access"})]})]}),e.jsxs(A,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:2},alignItems:{md:"center"},children:[e.jsx(y,{size:"small",placeholder:"Search by name, email, phone…",value:h,onChange:s=>{M(s.target.value),x(0)},sx:{minWidth:300},InputProps:{startAdornment:e.jsx(We,{position:"start",children:e.jsx(ve,{fontSize:"small"})})}}),e.jsx(p,{sx:{flexGrow:1}}),!u&&e.jsxs(A,{direction:"row",spacing:1,alignItems:"center",children:[e.jsxs(j,{variant:"body2",color:"text.secondary",children:[w.length," ",w.length===1?"user":"users"]}),e.jsx(le,{size:"small",label:"live · PostgreSQL",sx:{height:22,fontSize:"0.7rem",bgcolor:"success.lighter",color:"success.dark",fontWeight:600}})]})]}),e.jsx(p,{sx:{px:2,borderBottom:1,borderColor:"divider"},children:e.jsx(we,{value:Math.min(t,R.length-1),onChange:(s,l)=>{z(l),x(0)},variant:"scrollable",scrollButtons:"auto",children:R.map((s,l)=>e.jsx(ke,{label:e.jsx(De,{label:s.label,count:ue[s.key]||0,active:t===l})},s.key))})}),C&&e.jsx(te,{severity:"error",sx:{m:2},action:e.jsx(S,{color:"inherit",size:"small",onClick:_,children:"Retry"}),children:C}),e.jsx(Le,{children:e.jsxs(qe,{sx:{minWidth:800},children:[e.jsx(Be,{children:e.jsxs(k,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(i,{sx:{width:64},children:"S.No"}),e.jsx(i,{children:"User"}),e.jsx(i,{children:"Email"}),e.jsx(i,{children:"Phone"}),e.jsx(i,{children:"Role"}),e.jsx(i,{align:"right",children:"Actions"})]})}),e.jsx(He,{children:u?e.jsx(k,{children:e.jsx(i,{colSpan:6,sx:{border:"none"},children:e.jsx(p,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(L,{})})})}):G.length===0?e.jsx(k,{children:e.jsx(i,{colSpan:6,sx:{border:"none"},children:e.jsx(ze,{title:"No team users found",caption:"Try a different role or search term, or add a user."})})}):G.map((s,l)=>e.jsxs(k,{hover:!0,children:[e.jsx(i,{children:e.jsx(j,{variant:"body2",color:"text.secondary",children:g*c+l+1})}),e.jsx(i,{children:e.jsx(is,{name:s.name,email:s.email,role:s.role})}),e.jsx(i,{children:s.email?e.jsxs(Y,{href:`mailto:${s.email}`,underline:"hover",color:"text.primary",sx:{display:"inline-flex",alignItems:"center",gap:.75,fontSize:"0.8125rem"},children:[e.jsx(ae,{sx:{fontSize:15,color:"grey.400"}}),s.email]}):e.jsx(j,{variant:"body2",color:"text.disabled",children:"—"})}),e.jsx(i,{children:s.phone?e.jsxs(Y,{href:`tel:${s.phone}`,underline:"hover",color:"text.primary",sx:{display:"inline-flex",alignItems:"center",gap:.75,fontSize:"0.8125rem"},children:[e.jsx(Me,{sx:{fontSize:15,color:"grey.400"}}),s.phone]}):e.jsx(j,{variant:"body2",color:"text.disabled",children:"—"})}),e.jsx(i,{children:e.jsx(os,{role:s.role})}),e.jsxs(i,{align:"right",children:[e.jsx(Q,{title:"Edit",children:e.jsx(W,{size:"small",onClick:()=>f({open:!0,mode:"edit",initial:s}),children:e.jsx($e,{fontSize:"small"})})}),e.jsx(Q,{title:"Delete",children:e.jsx(W,{size:"small",color:"error",onClick:()=>P(s),children:e.jsx(Pe,{fontSize:"small"})})})]})]},s.id))})]})}),e.jsx(Ie,{component:"div",count:w.length,page:g,onPageChange:(s,l)=>x(l),rowsPerPage:c,onRowsPerPageChange:s=>{O(+s.target.value),x(0)},rowsPerPageOptions:[5,10,25]})]}),e.jsx(as,{open:d.open,mode:d.mode,initial:d.initial,onClose:()=>f({open:!1,mode:"add",initial:null}),onSaved:xe}),e.jsxs(Z,{open:!!v,onClose:I?void 0:()=>P(null),children:[e.jsx(ee,{children:"Delete user?"}),e.jsx(se,{children:e.jsxs(Re,{children:["This will permanently remove ",e.jsx("strong",{children:v==null?void 0:v.name})," from the PostgreSQL database. This cannot be undone."]})}),e.jsxs(re,{sx:{px:3,py:2},children:[e.jsx(S,{onClick:()=>P(null),disabled:I,children:"Cancel"}),e.jsx(S,{color:"error",variant:"contained",onClick:he,disabled:I,startIcon:I?e.jsx(L,{size:16,color:"inherit"}):null,children:"Delete"})]})]})]})}export{Ss as default}; diff --git a/dist/assets/Tenants-BNEm3NVI.js b/dist/assets/Tenants-CtuW6TmF.js similarity index 98% rename from dist/assets/Tenants-BNEm3NVI.js rename to dist/assets/Tenants-CtuW6TmF.js index fb711bb..5d2efd1 100644 --- a/dist/assets/Tenants-BNEm3NVI.js +++ b/dist/assets/Tenants-CtuW6TmF.js @@ -1 +1 @@ -import{a as p,u as vr,h as Lt,k as at,s as jr,_ as w,l as rr,m as nr,n as sr,o as Ke,j as e,p as Me,q as mt,v as or,w as re,P as ar,x as ir,y as Cr,z as Le,I as Ne,A as Ot,r as bt,i as yt,T as C,M as it,D as zt,C as xt,E as Sr,F as Ir,G as Tr,t as ye,S as z,d as Vt,B as W,H as Pr,f as $r,e as Lr,J as Or,U as Gt,K as At,L as Ar}from"./index-Dg-wT72v.js";import{D as lr,a as cr,b as ur,c as dr,d as kr,e as qt}from"./EditOutlined-COfONJBH.js";import{d as Rr,E as zr}from"./EmptyState-Do4nLXP0.js";import{T as wr,D as Dr,d as _r,a as Wr}from"./PhoneOutlined-BqFvwse4.js";import{d as Mr,a as Nr,b as lt,c as Er,e as Fr}from"./StorefrontOutlined-BR_dFc0C.js";import{S as ct,d as Br,a as pr,b as gr,c as Kt}from"./StatusChip-ioS4PHcC.js";import{d as Hr}from"./MapOutlined-C-CxlyED.js";import{T as Vr,a as Gr,b as qr,d as Kr}from"./TabLabelCount-BKNSTwCP.js";import{C as Ur,a as vt,A as hr,G as g,P as Jr}from"./PageHeader-DgkErsA7.js";import{d as Zr}from"./Close-DKUHif5O.js";import{A as Xr,f as We,o as Ut,i as kt,T as L}from"./TextField-COVOKpzm.js";import{B as pe}from"./Button-COL1_fTB.js";import{C as Yr}from"./Link-CndAQvyC.js";import{I as Qr}from"./InputAdornment-HqPFSHfS.js";import{T as en,a as tn,b as rn,c as Ue,d as nn}from"./TableRow-Du7Jvlvh.js";import{T as N}from"./TableCell-ClQIqE-T.js";const sn=t=>{const o=p.useRef({});return p.useEffect(()=>{o.current=t}),o.current};function Jt(t){return typeof t.normalize<"u"?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t}function on(t={}){const{ignoreAccents:o=!0,ignoreCase:c=!0,limit:b,matchFrom:$="any",stringify:I,trim:s=!1}=t;return(h,{inputValue:k,getOptionLabel:E})=>{let D=s?k.trim():k;c&&(D=D.toLowerCase()),o&&(D=Jt(D));const _=D?h.filter(H=>{let O=(I||E)(H);return c&&(O=O.toLowerCase()),o&&(O=Jt(O)),$==="start"?O.indexOf(D)===0:O.indexOf(D)>-1}):h;return typeof b=="number"?_.slice(0,b):_}}function ut(t,o){for(let c=0;c{var o;return t.current!==null&&((o=t.current.parentElement)==null?void 0:o.contains(document.activeElement))},cn=[];function un(t){const{unstable_isActiveElementInListbox:o=ln,unstable_classNamePrefix:c="Mui",autoComplete:b=!1,autoHighlight:$=!1,autoSelect:I=!1,blurOnSelect:s=!1,clearOnBlur:h=!t.freeSolo,clearOnEscape:k=!1,componentName:E="useAutocomplete",defaultValue:D=t.multiple?cn:null,disableClearable:_=!1,disableCloseOnSelect:H=!1,disabled:O,disabledItemsFocusable:ve=!1,disableListWrap:T=!1,filterOptions:ge=an,filterSelectedOptions:u=!1,freeSolo:v=!1,getOptionDisabled:y,getOptionKey:Y,getOptionLabel:V=n=>{var r;return(r=n.label)!=null?r:n},groupBy:B,handleHomeEndKeys:K=!t.freeSolo,id:xe,includeInputInList:je=!1,inputValue:ne,isOptionEqualToValue:U=(n,r)=>n===r,multiple:S=!1,onChange:Ce,onClose:Se,onHighlightChange:l,onInputChange:m,onOpen:le,open:Mt,openOnFocus:Nt=!1,options:Ee,readOnly:Ie=!1,selectOnFocus:Fe=!t.freeSolo,value:Je}=t,Q=vr(xe);let J=V;J=n=>{const r=V(n);return typeof r!="string"?String(r):r};const Be=p.useRef(!1),Ze=p.useRef(!0),M=p.useRef(null),ee=p.useRef(null),[Oe,jt]=p.useState(null),[Z,He]=p.useState(-1),Xe=$?0:-1,G=p.useRef(Xe),[d,Et]=Lt({controlled:Je,default:D,name:E}),[j,he]=Lt({controlled:ne,default:"",name:E,state:"inputValue"}),[Ae,Ye]=p.useState(!1),Te=p.useCallback((n,r)=>{if(!(S?d.length!(u&&(S?d:[d]).some(r=>r!==null&&U(n,r)))),{inputValue:tt&&Ct?"":j,getOptionLabel:J}):[],se=sn({filteredOptions:P,value:d,inputValue:j});p.useEffect(()=>{const n=d!==se.value;Ae&&!n||v&&!n||Te(null,d)},[d,Te,Ae,se.value,v]);const Ve=me&&P.length>0&&!Ie,ke=at(n=>{n===-1?M.current.focus():Oe.querySelector(`[data-tag-index="${n}"]`).focus()});p.useEffect(()=>{S&&Z>d.length-1&&(He(-1),ke(-1))},[d,S,Z,ke]);function Re(n,r){if(!ee.current||n<0||n>=P.length)return-1;let a=n;for(;;){const i=ee.current.querySelector(`[data-option-index="${a}"]`),x=ve?!1:!i||i.disabled||i.getAttribute("aria-disabled")==="true";if(i&&i.hasAttribute("tabindex")&&!x)return a;if(r==="next"?a=(a+1)%P.length:a=(a-1+P.length)%P.length,a===n)return-1}}const ce=at(({event:n,index:r,reason:a="auto"})=>{if(G.current=r,r===-1?M.current.removeAttribute("aria-activedescendant"):M.current.setAttribute("aria-activedescendant",`${Q}-option-${r}`),l&&l(n,r===-1?null:P[r],a),!ee.current)return;const i=ee.current.querySelector(`[role="option"].${c}-focused`);i&&(i.classList.remove(`${c}-focused`),i.classList.remove(`${c}-focusVisible`));let x=ee.current;if(ee.current.getAttribute("role")!=="listbox"&&(x=ee.current.parentElement.querySelector('[role="listbox"]')),!x)return;if(r===-1){x.scrollTop=0;return}const A=ee.current.querySelector(`[data-option-index="${r}"]`);if(A&&(A.classList.add(`${c}-focused`),a==="keyboard"&&A.classList.add(`${c}-focusVisible`),x.scrollHeight>x.clientHeight&&a!=="mouse"&&a!=="touch")){const R=A,de=x.clientHeight+x.scrollTop,Ht=R.offsetTop+R.offsetHeight;Ht>de?x.scrollTop=Ht-x.clientHeight:R.offsetTop-R.offsetHeight*(B?1.3:0){if(!X)return;const A=Re((()=>{const R=P.length-1;if(r==="reset")return Xe;if(r==="start")return 0;if(r==="end")return R;const de=G.current+r;return de<0?de===-1&&je?-1:T&&G.current!==-1||Math.abs(r)>1?0:R:de>R?de===R+1&&je?-1:T||Math.abs(r)>1?R:0:de})(),a);if(ce({index:A,reason:i,event:n}),b&&r!=="reset")if(A===-1)M.current.value=j;else{const R=J(P[A]);M.current.value=R,R.toLowerCase().indexOf(j.toLowerCase())===0&&j.length>0&&M.current.setSelectionRange(j.length,R.length)}}),ze=()=>{const n=(r,a)=>{const i=r?J(r):"",x=a?J(a):"";return i===x};if(G.current!==-1&&se.filteredOptions&&se.filteredOptions.length!==P.length&&se.inputValue===j&&(S?d.length===se.value.length&&se.value.every((r,a)=>J(d[a])===J(r)):n(se.value,d))){const r=se.filteredOptions[G.current];if(r)return ut(P,a=>J(a)===J(r))}return-1},Ge=p.useCallback(()=>{if(!X)return;const n=ze();if(n!==-1){G.current=n;return}const r=S?d[0]:d;if(P.length===0||r==null){oe({diff:"reset"});return}if(ee.current){if(r!=null){const a=P[G.current];if(S&&a&&ut(d,x=>U(a,x))!==-1)return;const i=ut(P,x=>U(x,r));i===-1?oe({diff:"reset"}):ce({index:i});return}if(G.current>=P.length-1){ce({index:P.length-1});return}ce({index:G.current})}},[P.length,S?!1:d,u,oe,ce,X,j,S]),St=at(n=>{jr(ee,n),n&&Ge()});p.useEffect(()=>{Ge()},[Ge]);const te=n=>{me||(Qe(!0),et(!0),le&&le(n))},fe=(n,r)=>{me&&(Qe(!1),Se&&Se(n,r))},ue=(n,r,a,i)=>{if(S){if(d.length===r.length&&d.every((x,A)=>x===r[A]))return}else if(d===r)return;Ce&&Ce(n,r,a,i),Et(r)},we=p.useRef(!1),Pe=(n,r,a="selectOption",i="options")=>{let x=a,A=r;if(S){A=Array.isArray(d)?d.slice():[];const R=ut(A,de=>U(r,de));R===-1?A.push(r):i!=="freeSolo"&&(A.splice(R,1),x="removeOption")}Te(n,A),ue(n,A,x,{option:r}),!H&&(!n||!n.ctrlKey&&!n.metaKey)&&fe(n,x),(s===!0||s==="touch"&&we.current||s==="mouse"&&!we.current)&&M.current.blur()};function rt(n,r){if(n===-1)return-1;let a=n;for(;;){if(r==="next"&&a===d.length||r==="previous"&&a===-1)return-1;const i=Oe.querySelector(`[data-tag-index="${a}"]`);if(!i||!i.hasAttribute("tabindex")||i.disabled||i.getAttribute("aria-disabled")==="true")a+=r==="next"?1:-1;else return a}}const nt=(n,r)=>{if(!S)return;j===""&&fe(n,"toggleInput");let a=Z;Z===-1?j===""&&r==="previous"&&(a=d.length-1):(a+=r==="next"?1:-1,a<0&&(a=0),a===d.length&&(a=-1)),a=rt(a,r),He(a),ke(a)},st=n=>{Be.current=!0,he(""),m&&m(n,"","clear"),ue(n,S?[]:null,"clear")},It=n=>r=>{if(n.onKeyDown&&n.onKeyDown(r),!r.defaultMuiPrevented&&(Z!==-1&&["ArrowLeft","ArrowRight"].indexOf(r.key)===-1&&(He(-1),ke(-1)),r.which!==229))switch(r.key){case"Home":X&&K&&(r.preventDefault(),oe({diff:"start",direction:"next",reason:"keyboard",event:r}));break;case"End":X&&K&&(r.preventDefault(),oe({diff:"end",direction:"previous",reason:"keyboard",event:r}));break;case"PageUp":r.preventDefault(),oe({diff:-Zt,direction:"previous",reason:"keyboard",event:r}),te(r);break;case"PageDown":r.preventDefault(),oe({diff:Zt,direction:"next",reason:"keyboard",event:r}),te(r);break;case"ArrowDown":r.preventDefault(),oe({diff:1,direction:"next",reason:"keyboard",event:r}),te(r);break;case"ArrowUp":r.preventDefault(),oe({diff:-1,direction:"previous",reason:"keyboard",event:r}),te(r);break;case"ArrowLeft":nt(r,"previous");break;case"ArrowRight":nt(r,"next");break;case"Enter":if(G.current!==-1&&X){const a=P[G.current],i=y?y(a):!1;if(r.preventDefault(),i)return;Pe(r,a,"selectOption"),b&&M.current.setSelectionRange(M.current.value.length,M.current.value.length)}else v&&j!==""&&tt===!1&&(S&&r.preventDefault(),Pe(r,j,"createOption","freeSolo"));break;case"Escape":X?(r.preventDefault(),r.stopPropagation(),fe(r,"escape")):k&&(j!==""||S&&d.length>0)&&(r.preventDefault(),r.stopPropagation(),st(r));break;case"Backspace":if(S&&!Ie&&j===""&&d.length>0){const a=Z===-1?d.length-1:Z,i=d.slice();i.splice(a,1),ue(r,i,"removeOption",{option:d[a]})}break;case"Delete":if(S&&!Ie&&j===""&&d.length>0&&Z!==-1){const a=Z,i=d.slice();i.splice(a,1),ue(r,i,"removeOption",{option:d[a]})}break}},Ft=n=>{Ye(!0),Nt&&!Be.current&&te(n)},De=n=>{if(o(ee)){M.current.focus();return}Ye(!1),Ze.current=!0,Be.current=!1,I&&G.current!==-1&&X?Pe(n,P[G.current],"blur"):I&&v&&j!==""?Pe(n,j,"blur","freeSolo"):h&&Te(n,d),fe(n,"blur")},q=n=>{const r=n.target.value;j!==r&&(he(r),et(!1),m&&m(n,r,"input")),r===""?!_&&!S&&ue(n,null,"clear"):te(n)},F=n=>{const r=Number(n.currentTarget.getAttribute("data-option-index"));G.current!==r&&ce({event:n,index:r,reason:"mouse"})},ae=n=>{ce({event:n,index:Number(n.currentTarget.getAttribute("data-option-index")),reason:"touch"}),we.current=!0},Bt=n=>{const r=Number(n.currentTarget.getAttribute("data-option-index"));Pe(n,P[r],"selectOption"),we.current=!1},Tt=n=>r=>{const a=d.slice();a.splice(n,1),ue(r,a,"removeOption",{option:d[n]})},Pt=n=>{me?fe(n,"toggleInput"):te(n)},$t=n=>{n.currentTarget.contains(n.target)&&n.target.getAttribute("id")!==Q&&n.preventDefault()},ot=n=>{n.currentTarget.contains(n.target)&&(M.current.focus(),Fe&&Ze.current&&M.current.selectionEnd-M.current.selectionStart===0&&M.current.select(),Ze.current=!1)},qe=n=>{!O&&(j===""||!me)&&Pt(n)};let $e=v&&j.length>0;$e=$e||(S?d.length>0:d!==null);let _e=P;return B&&(_e=P.reduce((n,r,a)=>{const i=B(r);return n.length>0&&n[n.length-1].group===i?n[n.length-1].options.push(r):n.push({key:a,index:a,group:i,options:[r]}),n},[])),O&&Ae&&De(),{getRootProps:(n={})=>w({"aria-owns":Ve?`${Q}-listbox`:null},n,{onKeyDown:It(n),onMouseDown:$t,onClick:ot}),getInputLabelProps:()=>({id:`${Q}-label`,htmlFor:Q}),getInputProps:()=>({id:Q,value:j,onBlur:De,onFocus:Ft,onChange:q,onMouseDown:qe,"aria-activedescendant":X?"":null,"aria-autocomplete":b?"both":"list","aria-controls":Ve?`${Q}-listbox`:void 0,"aria-expanded":Ve,autoComplete:"off",ref:M,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:O}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:st}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Pt}),getTagProps:({index:n})=>w({key:n,"data-tag-index":n,tabIndex:-1},!Ie&&{onDelete:Tt(n)}),getListboxProps:()=>({role:"listbox",id:`${Q}-listbox`,"aria-labelledby":`${Q}-label`,ref:St,onMouseDown:n=>{n.preventDefault()}}),getOptionProps:({index:n,option:r})=>{var a;const i=(S?d:[d]).some(A=>A!=null&&U(r,A)),x=y?y(r):!1;return{key:(a=Y==null?void 0:Y(r))!=null?a:J(r),tabIndex:-1,role:"option",id:`${Q}-option-${n}`,onMouseMove:F,onClick:Bt,onTouchStart:ae,"data-option-index":n,"aria-disabled":x,"aria-selected":i}},id:Q,inputValue:j,value:d,dirty:$e,expanded:X&&Oe,popupOpen:X,focused:Ae||Z!==-1,anchorEl:Oe,setAnchorEl:jt,focusedTag:Z,groupedOptions:_e}}function dn(t){return rr("MuiListSubheader",t)}nr("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const pn=["className","color","component","disableGutters","disableSticky","inset"],gn=t=>{const{classes:o,color:c,disableGutters:b,inset:$,disableSticky:I}=t,s={root:["root",c!=="default"&&`color${mt(c)}`,!b&&"gutters",$&&"inset",!I&&"sticky"]};return or(s,dn,o)},hn=re("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:c}=t;return[o.root,c.color!=="default"&&o[`color${mt(c.color)}`],!c.disableGutters&&o.gutters,c.inset&&o.inset,!c.disableSticky&&o.sticky]}})(({theme:t,ownerState:o})=>w({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14)},o.color==="primary"&&{color:(t.vars||t).palette.primary.main},o.color==="inherit"&&{color:"inherit"},!o.disableGutters&&{paddingLeft:16,paddingRight:16},o.inset&&{paddingLeft:72},!o.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper})),fr=p.forwardRef(function(o,c){const b=sr({props:o,name:"MuiListSubheader"}),{className:$,color:I="default",component:s="li",disableGutters:h=!1,disableSticky:k=!1,inset:E=!1}=b,D=Ke(b,pn),_=w({},b,{color:I,component:s,disableGutters:h,disableSticky:k,inset:E}),H=gn(_);return e.jsx(hn,w({as:s,className:Me(H.root,$),ref:c,ownerState:_},D))});fr.muiSkipListHighlight=!0;function fn(t){return rr("MuiAutocomplete",t)}const f=nr("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var Xt,Yt;const xn=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],mn=["ref"],bn=["key"],yn=["key"],vn=t=>{const{classes:o,disablePortal:c,expanded:b,focused:$,fullWidth:I,hasClearIcon:s,hasPopupIcon:h,inputFocused:k,popupOpen:E,size:D}=t,_={root:["root",b&&"expanded",$&&"focused",I&&"fullWidth",s&&"hasClearIcon",h&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",k&&"inputFocused"],tag:["tag",`tagSize${mt(D)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",E&&"popupIndicatorOpen"],popper:["popper",c&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return or(_,fn,o)},jn=re("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:c}=t,{fullWidth:b,hasClearIcon:$,hasPopupIcon:I,inputFocused:s,size:h}=c;return[{[`& .${f.tag}`]:o.tag},{[`& .${f.tag}`]:o[`tagSize${mt(h)}`]},{[`& .${f.inputRoot}`]:o.inputRoot},{[`& .${f.input}`]:o.input},{[`& .${f.input}`]:s&&o.inputFocused},o.root,b&&o.fullWidth,I&&o.hasPopupIcon,$&&o.hasClearIcon]}})({[`&.${f.focused} .${f.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${f.clearIndicator}`]:{visibility:"visible"}},[`& .${f.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${f.inputRoot}`]:{[`.${f.hasPopupIcon}&, .${f.hasClearIcon}&`]:{paddingRight:30},[`.${f.hasPopupIcon}.${f.hasClearIcon}&`]:{paddingRight:56},[`& .${f.input}`]:{width:0,minWidth:30}},[`& .${kt.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${kt.root}.${Le.sizeSmall}`]:{[`& .${kt.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Ut.root}`]:{padding:9,[`.${f.hasPopupIcon}&, .${f.hasClearIcon}&`]:{paddingRight:39},[`.${f.hasPopupIcon}.${f.hasClearIcon}&`]:{paddingRight:65},[`& .${f.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${f.endAdornment}`]:{right:9}},[`& .${Ut.root}.${Le.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${f.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${We.root}`]:{paddingTop:19,paddingLeft:8,[`.${f.hasPopupIcon}&, .${f.hasClearIcon}&`]:{paddingRight:39},[`.${f.hasPopupIcon}.${f.hasClearIcon}&`]:{paddingRight:65},[`& .${We.input}`]:{padding:"7px 4px"},[`& .${f.endAdornment}`]:{right:9}},[`& .${We.root}.${Le.sizeSmall}`]:{paddingBottom:1,[`& .${We.input}`]:{padding:"2.5px 4px"}},[`& .${Le.hiddenLabel}`]:{paddingTop:8},[`& .${We.root}.${Le.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${f.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${We.root}.${Le.hiddenLabel}.${Le.sizeSmall}`]:{[`& .${f.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${f.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${f.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${f.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${f.inputRoot}`]:{flexWrap:"wrap"}}}]}),Cn=re("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(t,o)=>o.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),Sn=re(Ne,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(t,o)=>o.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),In=re(Ne,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:t},o)=>w({},o.popupIndicator,t.popupOpen&&o.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),Tn=re(ir,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(t,o)=>{const{ownerState:c}=t;return[{[`& .${f.option}`]:o.option},o.popper,c.disablePortal&&o.popperDisablePortal]}})(({theme:t})=>({zIndex:(t.vars||t).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),Pn=re(ar,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(t,o)=>o.paper})(({theme:t})=>w({},t.typography.body1,{overflow:"auto"})),$n=re("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(t,o)=>o.loading})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),Ln=re("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(t,o)=>o.noOptions})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),On=re("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(t,o)=>o.listbox})(({theme:t})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${f.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[t.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${f.focused}`]:{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${f.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Ot(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${f.focused}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Ot(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},[`&.${f.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Ot(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}}})),An=re(fr,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(t,o)=>o.groupLabel})(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,top:-8})),kn=re("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(t,o)=>o.groupUl})({padding:0,[`& .${f.option}`]:{paddingLeft:24}}),dt=p.forwardRef(function(o,c){var b,$,I,s;const h=sr({props:o,name:"MuiAutocomplete"}),{autoComplete:k=!1,autoHighlight:E=!1,autoSelect:D=!1,blurOnSelect:_=!1,ChipProps:H,className:O,clearIcon:ve=Xt||(Xt=e.jsx(Ur,{fontSize:"small"})),clearOnBlur:T=!h.freeSolo,clearOnEscape:ge=!1,clearText:u="Clear",closeText:v="Close",componentsProps:y={},defaultValue:Y=h.multiple?[]:null,disableClearable:V=!1,disableCloseOnSelect:B=!1,disabled:K=!1,disabledItemsFocusable:xe=!1,disableListWrap:je=!1,disablePortal:ne=!1,filterSelectedOptions:U=!1,forcePopupIcon:S="auto",freeSolo:Ce=!1,fullWidth:Se=!1,getLimitTagsText:l=r=>`+${r}`,getOptionLabel:m,groupBy:le,handleHomeEndKeys:Mt=!h.freeSolo,includeInputInList:Nt=!1,limitTags:Ee=-1,ListboxComponent:Ie="ul",ListboxProps:Fe,loading:Je=!1,loadingText:Q="Loading…",multiple:J=!1,noOptionsText:Be="No options",openOnFocus:Ze=!1,openText:M="Open",PaperComponent:ee=ar,PopperComponent:Oe=ir,popupIcon:jt=Yt||(Yt=e.jsx(Xr,{})),readOnly:Z=!1,renderGroup:He,renderInput:Xe,renderOption:G,renderTags:d,selectOnFocus:Et=!h.freeSolo,size:j="medium",slotProps:he={}}=h,Ae=Ke(h,xn),{getRootProps:Ye,getInputProps:Te,getInputLabelProps:me,getPopupIndicatorProps:Qe,getClearProps:Ct,getTagProps:et,getListboxProps:tt,getOptionProps:X,value:P,dirty:se,expanded:Ve,id:ke,popupOpen:Re,focused:ce,focusedTag:oe,anchorEl:ze,setAnchorEl:Ge,inputValue:St,groupedOptions:te}=un(w({},h,{componentName:"Autocomplete"})),fe=!V&&!K&&se&&!Z,ue=(!Ce||S===!0)&&S!==!1,{onMouseDown:we}=Te(),{ref:Pe}=Fe??{},rt=tt(),{ref:nt}=rt,st=Ke(rt,mn),It=Cr(nt,Pe),De=m||(r=>{var a;return(a=r.label)!=null?a:r}),q=w({},h,{disablePortal:ne,expanded:Ve,focused:ce,fullWidth:Se,getOptionLabel:De,hasClearIcon:fe,hasPopupIcon:ue,inputFocused:oe===-1,popupOpen:Re,size:j}),F=vn(q);let ae;if(J&&P.length>0){const r=a=>w({className:F.tag,disabled:K},et(a));d?ae=d(P,r,q):ae=P.map((a,i)=>{const x=r({index:i}),{key:A}=x,R=Ke(x,bn);return e.jsx(vt,w({label:De(a),size:j},R,H),A)})}if(Ee>-1&&Array.isArray(ae)){const r=ae.length-Ee;!ce&&r>0&&(ae=ae.splice(0,Ee),ae.push(e.jsx("span",{className:F.tag,children:l(r)},ae.length)))}const Tt=He||(r=>e.jsxs("li",{children:[e.jsx(An,{className:F.groupLabel,ownerState:q,component:"div",children:r.group}),e.jsx(kn,{className:F.groupUl,ownerState:q,children:r.children})]},r.key)),$t=G||((r,a)=>{const{key:i}=r,x=Ke(r,yn);return e.jsx("li",w({},x,{children:De(a)}),i)}),ot=(r,a)=>{const i=X({option:r,index:a});return $t(w({},i,{className:F.option}),r,{selected:i["aria-selected"],index:a,inputValue:St},q)},qe=(b=he.clearIndicator)!=null?b:y.clearIndicator,$e=($=he.paper)!=null?$:y.paper,_e=(I=he.popper)!=null?I:y.popper,n=(s=he.popupIndicator)!=null?s:y.popupIndicator;return e.jsxs(p.Fragment,{children:[e.jsx(jn,w({ref:c,className:Me(F.root,O),ownerState:q},Ye(Ae),{children:Xe({id:ke,disabled:K,fullWidth:!0,size:j==="small"?"small":void 0,InputLabelProps:me(),InputProps:w({ref:Ge,className:F.inputRoot,startAdornment:ae,onClick:r=>{r.target===r.currentTarget&&we(r)}},(fe||ue)&&{endAdornment:e.jsxs(Cn,{className:F.endAdornment,ownerState:q,children:[fe?e.jsx(Sn,w({},Ct(),{"aria-label":u,title:u,ownerState:q},qe,{className:Me(F.clearIndicator,qe==null?void 0:qe.className),children:ve})):null,ue?e.jsx(In,w({},Qe(),{disabled:K,"aria-label":Re?v:M,title:Re?v:M,ownerState:q},n,{className:Me(F.popupIndicator,n==null?void 0:n.className),children:jt})):null]})}),inputProps:w({className:F.input,disabled:K,readOnly:Z},Te())})})),ze?e.jsx(Tn,w({as:Oe,disablePortal:ne,style:{width:ze?ze.clientWidth:null},ownerState:q,role:"presentation",anchorEl:ze,open:Re},_e,{className:Me(F.popper,_e==null?void 0:_e.className),children:e.jsxs(Pn,w({ownerState:q,as:ee},$e,{className:Me(F.paper,$e==null?void 0:$e.className),children:[Je&&te.length===0?e.jsx($n,{className:F.loading,ownerState:q,children:Q}):null,te.length===0&&!Ce&&!Je?e.jsx(Ln,{className:F.noOptions,ownerState:q,role:"presentation",onMouseDown:r=>{r.preventDefault()},children:Be}):null,te.length>0?e.jsx(On,w({as:Ie,className:F.listbox,ownerState:q},st,Fe,{ref:It,children:te.map((r,a)=>le?Tt({key:r.key,group:r.group,children:r.options.map((i,x)=>ot(i,r.index+x))}):ot(r,a))})):null]}))})):null]})});var wt={},Rn=yt;Object.defineProperty(wt,"__esModule",{value:!0});var xr=wt.default=void 0,zn=Rn(bt()),wn=e;xr=wt.default=(0,zn.default)((0,wn.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined");var Dt={},Dn=yt;Object.defineProperty(Dt,"__esModule",{value:!0});var mr=Dt.default=void 0,_n=Dn(bt()),Wn=e;mr=Dt.default=(0,_n.default)((0,Wn.jsx)("path",{d:"M21 11.01 3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"}),"NotesOutlined");var _t={},Mn=yt;Object.defineProperty(_t,"__esModule",{value:!0});var br=_t.default=void 0,Nn=Mn(bt()),En=e;br=_t.default=(0,Nn.default)((0,En.jsx)("path",{d:"M16.01 11H4v2h12.01v3L20 12l-3.99-4z"}),"ArrowRightAlt");var Wt={},Fn=yt;Object.defineProperty(Wt,"__esModule",{value:!0});var yr=Wt.default=void 0,Bn=Fn(bt()),Hn=e;yr=Wt.default=(0,Bn.default)((0,Hn.jsx)("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"}),"MyLocation");const Vn=["retail","wholesale","manufacturer","distributor","services","ecommerce","other"],Gn=["newClient","contacted","onboarded","lost"],qn=["Daily","Weekly","Fortnightly","Monthly","Occasional"],Kn=["basicOnly","full","none"],Un=["Blue Dart","Delhivery","DTDC","India Post / Speed Post","The Professional Couriers","XpressBees","Ecom Express","Shadowfax","Safexpress","VRL Logistics","TCI (Transport Corporation of India)","Om Logistics","Best Roadways","MSS (Mettur Super Services)","ABT Travels & Logistics","Navata Road Transport","KRS (Kerala Roadways)","Parveen Travels / Parveen Express","SRM Transports","KPN Travels & KPN Speed Parcel","SRS Travels","Hindusthan Travels","City Travels","Essaar Travels","No. 1 Air Travels","A1 Travels","Krish Travels","Hebron Transports","Horma Travels","Vivegam Travels","PSS Transport","SRT (Renugambal Travels)","Thamarai Bus Transports","Rathimeena Travels","Ganesh Travels","John Kennedy Bus Service","Arun Travel","Saaji Meera Roadways","ARC Parcel Service","Chakra Travels & Parcel Service","MVA Parcel And Bus Service","Shrinath Travels & Cargo","Hans Travels","Zingbus","Kalpana Travels / City Land Travels","Trackon Couriers","North India Transways","RSRTC Cargo","UPSRTC Cargo"],Rt=["Chennai","Coimbatore","Madurai","Tiruchirappalli","Salem","Tuticorin","Tirupur","Erode","Vellore","Tirunelveli","Thanjavur","Dindigul","Hosur","Nagercoil","Karur","Namakkal","Kanchipuram","Cuddalore","Thoothukudi","Bengaluru","Mysuru","Mangaluru","Hubli","Belagavi","Kalaburagi","Davangere","Ballari","Kochi","Thiruvananthapuram","Kozhikode","Kannur","Thrissur","Kollam","Hyderabad","Warangal","Visakhapatnam","Vijayawada","Tirupati","Guntur","Rajahmundry","Nellore","Mumbai","Pune","Nagpur","Nashik","Aurangabad","Kolhapur","Solapur","New Delhi","Gurugram","Noida","Faridabad","Chandigarh","Amritsar","Ludhiana","Jalandhar","Ahmedabad","Surat","Vadodara","Rajkot","Bhavnagar","Jamnagar","Jaipur","Jodhpur","Udaipur","Kota","Bikaner","Lucknow","Kanpur","Varanasi","Agra","Prayagraj","Gorakhpur","Bhopal","Indore","Gwalior","Jabalpur","Raipur","Kolkata","Siliguri","Durgapur","Patna","Gaya","Ranchi","Jamshedpur","Bhubaneswar","Cuttack","Guwahati","Dibrugarh","Agartala","Imphal","Shillong","Aizawl","Dimapur","Dehradun","Haridwar","Shimla","Srinagar","Jammu","Leh","Panaji","Puducherry","Port Blair"],Qt={name:"",email:"",password:"",phone:"",city:"",businessState:"",businessType:"retail",status:"newClient",frequency:"Daily",parcelVolume:0,activeContracts:0,provider:"",efficiency:"",logisticsSegment:"",transitFrom:"",transitTo:"",neighbourhood:"",surveyAddress:"",surveyLat:"",surveyLng:"",dataConsent:"full",notes:"",pincode:""},pt=t=>typeof t=="string"?t.charAt(0).toUpperCase()+t.slice(1).replace(/([A-Z])/g," $1").trim():t,gt=(t,o)=>o&&!t.includes(o)?[o,...t]:t;function Jn({open:t,mode:o,initial:c,onClose:b,onSaved:$}){const I=o==="edit",[s,h]=p.useState(Qt),[k,E]=p.useState(!1),[D,_]=p.useState(null),[H,O]=p.useState(!1),ve=()=>{if(!navigator.geolocation){alert("Geolocation is not supported by your browser");return}O(!0),navigator.geolocation.getCurrentPosition(async u=>{const v=u.coords.latitude,y=u.coords.longitude;h(Y=>({...Y,surveyLat:v,surveyLng:y}));try{const V=await(await fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${v}&lon=${y}`)).json();if(V&&V.address){const B=V.address,K=B.city||B.town||B.village||B.county||"",xe=B.state||"",je=B.postcode||"",ne=V.display_name||"";h(U=>({...U,city:K||U.city,businessState:xe||U.businessState,pincode:je||U.pincode,surveyAddress:ne||U.surveyAddress}))}}catch(Y){console.error("Reverse geocoding failed",Y)}finally{O(!1)}},u=>{alert("Unable to retrieve your location"),O(!1)})};p.useEffect(()=>{t&&(h({...Qt,...c||{}}),_(null))},[t,c]);const T=u=>v=>h(y=>({...y,[u]:v.target.value})),ge=async()=>{if(!s.name.trim()){_("Client name is required.");return}E(!0),_(null);const u=s.surveyLat===""?void 0:Number(s.surveyLat),v=s.surveyLng===""?void 0:Number(s.surveyLng),y={first_name:s.name.trim(),phone:s.phone,city:s.city,businessState:s.businessState,businessType:s.businessType,status:s.status,frequency:s.frequency,parcelVolume:Number(s.parcelVolume)||0,activeContracts:Number(s.activeContracts)||0,provider:s.provider,efficiency:s.efficiency,logisticsSegment:s.logisticsSegment,transitFrom:s.transitFrom,transitTo:s.transitTo,neighbourhood:s.neighbourhood,pincode:s.pincode,surveyAddress:s.surveyAddress,dataConsent:s.dataConsent,notes:s.notes,lastUpdated:new Date().toISOString().slice(0,10),registration_source:"web",...s.email.trim()?{email:s.email.trim()}:{},...u!=null?{survey_lat:u}:{},...v!=null?{survey_long:v}:{}};try{I?await Sr(c.id,y):await Ir({...y,...s.password?{password:s.password}:{}}),$()}catch(Y){_(Y.message||"Failed to save client")}finally{E(!1)}};return e.jsxs(lr,{open:t,onClose:k?void 0:b,maxWidth:"md",fullWidth:!0,children:[e.jsxs(cr,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[I?"Edit Client":"Add Client",e.jsx(Ne,{onClick:b,size:"small",disabled:k,children:e.jsx(Zr,{})})]}),e.jsxs(ur,{dividers:!0,children:[D&&e.jsx(hr,{severity:"error",sx:{mb:2},children:D}),e.jsx(C,{variant:"overline",color:"text.secondary",children:"Business"}),e.jsxs(g,{container:!0,spacing:2,sx:{mt:0,mb:1},children:[e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Client Name *",value:s.name,onChange:T("name")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Phone",value:s.phone,onChange:T("phone")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Email",value:s.email,onChange:T("email")})}),!I&&e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Password",type:"password",value:s.password,onChange:T("password")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{select:!0,fullWidth:!0,size:"small",label:"Business Type",value:s.businessType,onChange:T("businessType"),children:gt(Vn,s.businessType).map(u=>e.jsx(it,{value:u,children:pt(u)},u))})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{select:!0,fullWidth:!0,size:"small",label:"Status",value:s.status,onChange:T("status"),children:gt(Gn,s.status).map(u=>e.jsx(it,{value:u,children:pt(u)},u))})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{select:!0,fullWidth:!0,size:"small",label:"Order Frequency",value:s.frequency,onChange:T("frequency"),children:gt(qn,s.frequency).map(u=>e.jsx(it,{value:u,children:pt(u)},u))})}),e.jsx(g,{item:!0,xs:12,sm:3,children:e.jsx(L,{fullWidth:!0,size:"small",type:"number",label:"Parcel Volume",value:s.parcelVolume,onChange:T("parcelVolume")})}),e.jsx(g,{item:!0,xs:12,sm:3,children:e.jsx(L,{fullWidth:!0,size:"small",type:"number",label:"Active Contracts",value:s.activeContracts,onChange:T("activeContracts")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(dt,{autoHighlight:!0,options:Un,value:s.provider||null,onChange:(u,v)=>h(y=>({...y,provider:v||""})),renderInput:u=>e.jsx(L,{...u,fullWidth:!0,size:"small",label:"Current Provider"})})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Efficiency",value:s.efficiency,onChange:T("efficiency")})}),e.jsx(g,{item:!0,xs:12,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Logistics Segment",value:s.logisticsSegment,onChange:T("logisticsSegment"),placeholder:"First Mile, Last Mile"})})]}),e.jsx(zt,{sx:{my:1.5}}),e.jsx(C,{variant:"overline",color:"text.secondary",children:"Location & Transit"}),e.jsxs(g,{container:!0,spacing:2,sx:{mt:0,mb:1},children:[e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(dt,{autoHighlight:!0,options:Rt,value:s.city||null,onChange:(u,v)=>h(y=>({...y,city:v||""})),renderInput:u=>e.jsx(L,{...u,fullWidth:!0,size:"small",label:"City"})})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"State",value:s.businessState,onChange:T("businessState")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Pincode",value:s.pincode,onChange:T("pincode")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Neighbourhood / Zone",value:s.neighbourhood,onChange:T("neighbourhood")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(dt,{autoHighlight:!0,options:Rt,value:s.transitFrom||null,onChange:(u,v)=>h(y=>({...y,transitFrom:v||""})),renderInput:u=>e.jsx(L,{...u,fullWidth:!0,size:"small",label:"Transit From"})})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(dt,{autoHighlight:!0,options:Rt,value:s.transitTo||null,onChange:(u,v)=>h(y=>({...y,transitTo:v||""})),renderInput:u=>e.jsx(L,{...u,fullWidth:!0,size:"small",label:"Transit To"})})}),e.jsx(g,{item:!0,xs:12,sm:3,children:e.jsx(L,{fullWidth:!0,size:"small",type:"number",label:"Latitude",value:s.surveyLat,onChange:T("surveyLat")})}),e.jsx(g,{item:!0,xs:12,sm:3,children:e.jsx(L,{fullWidth:!0,size:"small",type:"number",label:"Longitude",value:s.surveyLng,onChange:T("surveyLng")})}),e.jsx(g,{item:!0,xs:12,sm:6,display:"flex",alignItems:"center",children:e.jsx(pe,{variant:"outlined",size:"small",onClick:ve,disabled:H,startIcon:H?e.jsx(xt,{size:16}):e.jsx(yr,{}),fullWidth:!0,children:"Get GPS Location"})}),e.jsx(g,{item:!0,xs:12,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Survey Address",value:s.surveyAddress,onChange:T("surveyAddress"),multiline:!0,minRows:2})})]}),e.jsx(zt,{sx:{my:1.5}}),e.jsx(C,{variant:"overline",color:"text.secondary",children:"Other"}),e.jsxs(g,{container:!0,spacing:2,sx:{mt:0},children:[e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{select:!0,fullWidth:!0,size:"small",label:"Data Consent",value:s.dataConsent,onChange:T("dataConsent"),children:gt(Kn,s.dataConsent).map(u=>e.jsx(it,{value:u,children:pt(u)},u))})}),e.jsx(g,{item:!0,xs:12,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Notes",value:s.notes,onChange:T("notes"),multiline:!0,minRows:2})})]})]}),e.jsxs(dr,{sx:{px:3,py:2},children:[e.jsx(pe,{onClick:b,disabled:k,children:"Cancel"}),e.jsx(pe,{variant:"contained",onClick:ge,disabled:k,startIcon:k?e.jsx(xt,{size:16,color:"inherit"}):null,children:I?"Save Changes":"Create Client"})]})]})}const Zn=t=>({full:"success",basiconly:"info",none:"default"})[String(t||"").toLowerCase()]||"default",Xn=t=>{const o=String(t||"").toLowerCase();return/high|good|excellent/.test(o)?"success":/med|average|moderate/.test(o)?"warning":/low|poor|bad/.test(o)?"error":"info"},Yn={textTransform:"uppercase",letterSpacing:.4,fontSize:"0.68rem",fontWeight:700,color:"grey.700"};function be({label:t,color:o="default"}){return t==null||t===""?e.jsx(C,{variant:"body2",sx:{fontWeight:500,color:"grey.500"},children:"—"}):e.jsx(vt,{size:"small",label:t,sx:{fontWeight:600,...o==="default"?{bgcolor:"grey.100",color:"grey.700"}:{bgcolor:`${o}.lighter`,color:`${o}.dark`}}})}function ie({label:t,children:o}){return e.jsxs(W,{children:[e.jsx(C,{variant:"caption",color:"text.secondary",sx:Yn,children:t}),e.jsx(W,{sx:{mt:.5},children:o})]})}function ht({label:t,value:o}){return e.jsx(ie,{label:t,children:e.jsx(C,{variant:"body2",sx:{fontWeight:500,color:o?"grey.800":"grey.500",wordBreak:"break-word"},children:o||"—"})})}function ft({icon:t,title:o,accent:c="primary",children:b}){return e.jsxs(W,{sx:{height:"100%",borderRadius:2,border:1,borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"},children:[e.jsxs(z,{direction:"row",spacing:1,alignItems:"center",sx:{px:2,py:1.25,borderBottom:1,borderColor:"divider",bgcolor:`${c}.lighter`,opacity:.999},children:[e.jsx(t,{sx:{fontSize:18,color:`${c}.main`}}),e.jsx(C,{variant:"overline",sx:{fontWeight:700,color:"grey.800",letterSpacing:.6,lineHeight:1},children:o})]}),e.jsx(z,{spacing:1.75,sx:{p:2},children:b})]})}function er({label:t,value:o,icon:c,color:b="primary"}){return e.jsx(W,{sx:{flex:1,p:1.5,borderRadius:1.5,border:1,borderColor:"divider",bgcolor:"grey.50"},children:e.jsxs(z,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(W,{sx:{width:32,height:32,borderRadius:1,bgcolor:`${b}.lighter`,color:`${b}.main`,display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(c,{sx:{fontSize:18}})}),e.jsxs(W,{children:[e.jsx(C,{variant:"h5",sx:{fontWeight:700,color:"grey.800",lineHeight:1.1},children:o}),e.jsx(C,{variant:"caption",color:"text.secondary",children:t})]})]})})}function tr({label:t,value:o,color:c="grey.800"}){return e.jsxs(W,{sx:{textAlign:"center",minWidth:56},children:[e.jsx(C,{variant:"body2",sx:{fontWeight:700,color:c,lineHeight:1.2},children:o}),e.jsx(C,{variant:"caption",color:"text.secondary",sx:{fontSize:"0.65rem"},children:t})]})}function Qn({row:t,index:o,onEdit:c,onDelete:b}){const[$,I]=p.useState(!1);return e.jsxs(p.Fragment,{children:[e.jsxs(Ue,{hover:!0,sx:{cursor:"pointer","& > *":{borderBottom:$?"unset":void 0},...$&&{bgcolor:"primary.lighter","&:hover":{bgcolor:"primary.lighter"}}},onClick:()=>I(s=>!s),children:[e.jsx(N,{padding:"checkbox",children:e.jsx(Ne,{size:"small",onClick:s=>{s.stopPropagation(),I(h=>!h)},children:$?e.jsx(Mr,{}):e.jsx(Nr,{})})}),e.jsx(N,{sx:{whiteSpace:"nowrap"},children:e.jsx(C,{variant:"caption",sx:{fontFamily:"monospace",fontWeight:700,color:"primary.main",bgcolor:"primary.lighter",px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:"primary.light",whiteSpace:"nowrap"},children:t.logicalId})}),e.jsx(N,{children:e.jsxs(z,{direction:"row",spacing:1.25,alignItems:"center",children:[e.jsx(Gt,{name:t.name,size:38}),e.jsxs(W,{sx:{minWidth:0},children:[e.jsx(C,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:t.name}),e.jsx(z,{direction:"row",spacing:.75,alignItems:"center",sx:{mt:.4},children:t.businessType&&e.jsx(vt,{size:"small",label:ye(t.businessType),sx:{height:20,fontSize:"0.68rem",fontWeight:600,bgcolor:"grey.100",color:"grey.700"}})})]})]})}),e.jsx(N,{children:e.jsxs(z,{direction:"row",spacing:.75,alignItems:"center",children:[e.jsx(_r,{sx:{fontSize:15,color:"grey.400"}}),e.jsxs(W,{children:[e.jsx(C,{variant:"body2",children:t.phone||"—"}),t.frequency&&e.jsx(C,{variant:"caption",color:"text.secondary",children:t.frequency})]})]})}),e.jsx(N,{children:e.jsxs(z,{direction:"row",spacing:.75,alignItems:"center",children:[e.jsx(lt,{sx:{fontSize:15,color:"grey.400"}}),e.jsxs(W,{children:[e.jsxs(C,{variant:"body2",children:[t.city||"—",t.businessState?`, ${t.businessState}`:""]}),t.neighbourhood&&e.jsx(C,{variant:"caption",color:"text.secondary",children:t.neighbourhood})]})]})}),e.jsx(N,{children:e.jsxs(z,{direction:"row",spacing:1.5,alignItems:"center",justifyContent:"center",divider:e.jsx(zt,{orientation:"vertical",flexItem:!0}),children:[e.jsx(tr,{label:"Parcels",value:Number(t.parcelVolume).toLocaleString()}),e.jsx(tr,{label:"Contracts",value:t.activeContracts,color:"primary.main"})]})}),e.jsx(N,{children:e.jsx(Kt,{status:t.status})}),e.jsxs(N,{align:"right",children:[e.jsx(At,{title:"Edit",children:e.jsx(Ne,{size:"small",onClick:s=>{s.stopPropagation(),c(t)},children:e.jsx(qt,{fontSize:"small"})})}),e.jsx(At,{title:"Delete",children:e.jsx(Ne,{size:"small",onClick:s=>{s.stopPropagation(),b(t)},children:e.jsx(Wr,{fontSize:"small"})})})]})]}),e.jsx(Ue,{children:e.jsx(N,{colSpan:8,sx:{py:0,borderBottom:$?void 0:"none"},children:e.jsx(Ar,{in:$,timeout:"auto",unmountOnExit:!0,children:e.jsxs(W,{sx:{m:2,borderRadius:2.5,border:1,borderColor:"divider",overflow:"hidden",boxShadow:"0 4px 16px rgba(0,0,0,0.06)"},children:[e.jsxs(z,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,sx:{px:2.5,py:1.75,borderBottom:1,borderColor:"divider",background:s=>`linear-gradient(90deg, ${s.palette.primary.lighter}88 0%, ${s.palette.background.paper} 75%)`},children:[e.jsxs(z,{direction:"row",spacing:1.5,alignItems:"center",children:[e.jsx(Gt,{name:t.name,size:40}),e.jsxs(W,{children:[e.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,lineHeight:1.2},children:t.name}),e.jsxs(z,{direction:"row",spacing:.75,alignItems:"center",sx:{mt:.25},children:[e.jsx(Kr,{sx:{fontSize:14,color:"grey.400"}}),e.jsx(C,{variant:"caption",color:"text.secondary",children:t.clientId})]})]}),e.jsx(Kt,{status:t.status,sx:{ml:.5}})]}),e.jsx(pe,{size:"small",variant:"contained",startIcon:e.jsx(qt,{}),onClick:()=>c(t),children:"Edit Client"})]}),e.jsx(W,{sx:{p:2.5,bgcolor:"grey.50"},children:e.jsxs(g,{container:!0,spacing:2.5,alignItems:"stretch",children:[e.jsx(g,{item:!0,xs:12,md:4,children:e.jsxs(ft,{icon:Er,title:"Business",accent:"primary",children:[e.jsxs(z,{direction:"row",spacing:1.5,children:[e.jsx(er,{label:"Parcel Volume",value:Number(t.parcelVolume).toLocaleString(),icon:pr,color:"primary"}),e.jsx(er,{label:"Active Contracts",value:t.activeContracts,icon:gr,color:"primary"})]}),e.jsx(ie,{label:"Client ID",children:e.jsx(C,{variant:"body2",sx:{fontFamily:"monospace",fontWeight:600,color:"grey.800"},children:t.clientId})}),e.jsx(ie,{label:"Business Type",children:e.jsx(be,{label:t.businessType&&ye(t.businessType),color:"primary"})}),e.jsx(ie,{label:"Order Frequency",children:e.jsx(be,{label:t.frequency&&ye(t.frequency),color:"info"})})]})}),e.jsx(g,{item:!0,xs:12,md:4,children:e.jsxs(ft,{icon:Fr,title:"Logistics",accent:"primary",children:[e.jsx(ie,{label:"Logistics Segment",children:t.logisticsSegment?e.jsx(z,{direction:"row",spacing:.75,flexWrap:"wrap",useFlexGap:!0,children:String(t.logisticsSegment).split(/[,/]/).map(s=>s.trim()).filter(Boolean).map(s=>e.jsx(be,{label:ye(s),color:"primary"},s))}):e.jsx(be,{label:null})}),e.jsx(ht,{label:"Current Provider",value:t.provider}),e.jsx(ie,{label:"Efficiency",children:e.jsx(be,{label:t.efficiency&&ye(t.efficiency),color:Xn(t.efficiency)})}),e.jsx(ie,{label:"Transit Route",children:(()=>{const s=[t.transitFrom,...String(t.transitTo||"").split(",")].map(h=>h.trim()).filter(Boolean);return s.length?e.jsx(z,{direction:"row",spacing:.75,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:s.map((h,k)=>e.jsxs(p.Fragment,{children:[k>0&&e.jsx(br,{sx:{fontSize:20,color:"primary.main"}}),e.jsx(be,{label:ye(h),color:k===0?"default":"info"})]},`${h}-${k}`))}):e.jsx(be,{label:null})})()})]})}),e.jsx(g,{item:!0,xs:12,md:4,children:e.jsxs(ft,{icon:lt,title:"Location & Survey",accent:"primary",children:[e.jsx(ie,{label:"City / State",children:e.jsx(C,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:[t.city,t.businessState].filter(Boolean).join(", ")||"—"})}),e.jsx(ht,{label:"Neighbourhood",value:t.neighbourhood}),e.jsx(ie,{label:"Survey Address",children:e.jsxs(z,{direction:"row",spacing:1,sx:{p:1.25,borderRadius:1.5,bgcolor:"grey.50",border:1,borderColor:"divider"},children:[e.jsx(lt,{sx:{fontSize:16,color:"grey.400",mt:"2px"}}),e.jsx(C,{variant:"body2",sx:{color:"grey.800",lineHeight:1.5},children:t.surveyAddress||"—"})]})}),e.jsx(ie,{label:"Coordinates",children:t.surveyLat&&t.surveyLng?e.jsxs(z,{direction:"row",spacing:1.25,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[e.jsx(At,{title:`${t.surveyLat}, ${t.surveyLng}`,arrow:!0,placement:"top",children:e.jsxs(z,{direction:"row",spacing:.5,alignItems:"center",sx:{cursor:"default"},children:[e.jsx(lt,{sx:{fontSize:16,color:"grey.400"}}),e.jsx(C,{variant:"body2",sx:{fontWeight:500,color:"grey.800",borderBottom:"1px dotted",borderColor:"grey.300"},children:[t.neighbourhood,t.city].filter(Boolean).join(", ")||"Pinned location"})]})}),e.jsx(pe,{component:"a",href:`https://www.google.com/maps?q=${t.surveyLat},${t.surveyLng}`,target:"_blank",rel:"noopener",size:"small",variant:"outlined",startIcon:e.jsx(Hr,{sx:{fontSize:16}}),sx:{py:.25,px:1.25,minWidth:0,fontSize:"0.75rem",fontWeight:600,borderRadius:5,color:"primary.main",borderColor:"primary.100",bgcolor:"primary.lighter","&:hover":{borderColor:"primary.main",bgcolor:"primary.lighter"}},children:"View on map"})]}):e.jsx(C,{variant:"body2",sx:{color:"grey.500"},children:"—"})})]})}),e.jsx(g,{item:!0,xs:12,children:e.jsx(ft,{icon:xr,title:"Contact & Compliance",accent:"primary",children:e.jsxs(g,{container:!0,spacing:2.5,children:[e.jsx(g,{item:!0,xs:12,sm:6,md:4,children:e.jsx(ht,{label:"Phone",value:t.phone})}),e.jsx(g,{item:!0,xs:12,sm:6,md:4,children:e.jsx(ie,{label:"Data Consent",children:e.jsx(be,{label:t.dataConsent&&ye(t.dataConsent),color:Zn(t.dataConsent)})})}),e.jsx(g,{item:!0,xs:12,sm:6,md:4,children:e.jsx(ht,{label:"Last Updated",value:t.lastUpdated})}),t.notes&&e.jsx(g,{item:!0,xs:12,children:e.jsxs(W,{sx:{p:2,borderRadius:1.5,bgcolor:"warning.lighter",border:1,borderColor:"warning.light"},children:[e.jsxs(z,{direction:"row",spacing:1,alignItems:"center",sx:{mb:.5},children:[e.jsx(mr,{sx:{fontSize:16,color:"warning.dark"}}),e.jsx(C,{variant:"caption",sx:{color:"warning.dark",textTransform:"uppercase",letterSpacing:.4,fontSize:"0.68rem",fontWeight:700},children:"Notes"})]}),e.jsx(C,{variant:"body2",sx:{color:"grey.800"},children:t.notes})]})})]})})})]})})]})})})})]})}function xs(){var Se;const[t,o]=p.useState([]),[c,b]=p.useState(!0),[$,I]=p.useState(null),[s]=Tr(),[h,k]=p.useState(0),[E,D]=p.useState(s.get("q")||""),[_,H]=p.useState(0),[O,ve]=p.useState(10);p.useEffect(()=>{const l=s.get("q");l!=null&&(D(l),H(0))},[s]);const[T,ge]=p.useState({open:!1,mode:"add",initial:null}),[u,v]=p.useState(null),[y,Y]=p.useState(!1),V=(l=!1)=>{l||(b(!0),I(null)),$r().then(m=>o(m.map(Lr))).catch(m=>{l||I(m.message||"Failed to load clients")}).finally(()=>{l||b(!1)})};p.useEffect(()=>{V();const l=setInterval(()=>{V(!0)},1e4);return()=>clearInterval(l)},[]);const B=p.useMemo(()=>({total:t.length,newCount:t.filter(l=>l.status==="newClient").length,parcels:t.reduce((l,m)=>l+(Number(m.parcelVolume)||0),0),contracts:t.reduce((l,m)=>l+(Number(m.activeContracts)||0),0)}),[t]),K=p.useMemo(()=>{const l=[];return t.forEach(m=>{l.includes(m.status)||l.push(m.status)}),[{key:"all",label:"All"},...l.map(m=>({key:m,label:ye(m)}))]},[t]),xe=((Se=K[Math.min(h,K.length-1)])==null?void 0:Se.key)||"all",je=p.useMemo(()=>{const l={all:t.length};return t.forEach(m=>{l[m.status]=(l[m.status]||0)+1}),l},[t]),ne=p.useMemo(()=>t.filter(l=>{const m=xe==="all"||l.status===xe,le=!E||[l.name,l.phone,l.city,l.businessType,l.clientId,l.neighbourhood].join(" ").toLowerCase().includes(E.toLowerCase());return m&&le}),[t,xe,E]),U=ne.slice(_*O,_*O+O),S=()=>{ge({open:!1,mode:"add",initial:null}),V()},Ce=async()=>{Y(!0);try{await Or(u.id),v(null),V()}catch(l){I(l.message||"Failed to delete client")}finally{Y(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Jr,{title:"Clients",breadcrumbs:[{label:"Clients"}],action:e.jsxs(z,{direction:"row",spacing:1.5,children:[e.jsx(pe,{variant:"outlined",startIcon:e.jsx(Rr,{}),onClick:V,disabled:c,children:"Refresh"}),e.jsx(pe,{variant:"contained",startIcon:e.jsx(kr,{}),onClick:()=>ge({open:!0,mode:"add",initial:null}),children:"Add Client"})]})}),e.jsxs(g,{container:!0,spacing:2.5,sx:{mb:3},children:[e.jsx(g,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(ct,{accent:!0,title:"Total Clients",value:B.total,icon:Vt,caption:"All registered"})}),e.jsx(g,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(ct,{accent:!0,title:"New Clients",value:B.newCount,icon:Br,color:"primary",caption:"Awaiting onboarding"})}),e.jsx(g,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(ct,{accent:!0,title:"Total Parcel Volume",value:B.parcels.toLocaleString(),icon:pr,color:"primary",caption:"Across all clients"})}),e.jsx(g,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(ct,{accent:!0,title:"Active Contracts",value:B.contracts,icon:gr,color:"primary",caption:"Currently running"})})]}),e.jsxs(Yr,{sx:{overflow:"hidden"},children:[e.jsxs(W,{sx:{px:2.5,py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:l=>`linear-gradient(90deg, ${l.palette.primary.lighter}66 0%, ${l.palette.background.paper} 70%)`},children:[e.jsx(W,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Vt,{fontSize:"small"})}),e.jsxs(W,{children:[e.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"Client Directory"}),e.jsx(C,{variant:"caption",color:"text.secondary",children:"Browse, search and manage every client account"})]})]}),e.jsxs(z,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:2},alignItems:{md:"center"},children:[e.jsx(L,{size:"small",placeholder:"Search by name, phone, city, ID…",value:E,onChange:l=>{D(l.target.value),H(0)},sx:{minWidth:300},InputProps:{startAdornment:e.jsx(Qr,{position:"start",children:e.jsx(Pr,{fontSize:"small"})})}}),e.jsx(W,{sx:{flexGrow:1}}),!c&&e.jsxs(z,{direction:"row",spacing:1,alignItems:"center",children:[e.jsxs(C,{variant:"body2",color:"text.secondary",children:[ne.length," ",ne.length===1?"client":"clients"]}),e.jsx(vt,{size:"small",label:"live · doormile_clients",sx:{height:22,fontSize:"0.7rem",bgcolor:"success.lighter",color:"success.dark",fontWeight:600}})]})]}),e.jsx(W,{sx:{px:2,borderBottom:1,borderColor:"divider"},children:e.jsx(Vr,{value:Math.min(h,K.length-1),onChange:(l,m)=>{k(m),H(0)},variant:"scrollable",scrollButtons:"auto",children:K.map((l,m)=>e.jsx(Gr,{label:e.jsx(qr,{label:l.label,count:je[l.key]||0,active:h===m})},l.key))})}),$&&e.jsx(hr,{severity:"error",sx:{m:2},action:e.jsx(pe,{color:"inherit",size:"small",onClick:V,children:"Retry"}),children:$}),e.jsx(en,{children:e.jsxs(tn,{sx:{minWidth:900},children:[e.jsx(rn,{children:e.jsxs(Ue,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(N,{padding:"checkbox"}),e.jsx(N,{children:"ID"}),e.jsx(N,{children:"Client"}),e.jsx(N,{children:"Contact"}),e.jsx(N,{children:"Location"}),e.jsx(N,{align:"center",children:"Volume"}),e.jsx(N,{children:"Status"}),e.jsx(N,{align:"right",children:"Actions"})]})}),e.jsx(nn,{children:c?e.jsx(Ue,{children:e.jsx(N,{colSpan:8,sx:{border:"none"},children:e.jsx(W,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(xt,{})})})}):U.length===0?e.jsx(Ue,{children:e.jsx(N,{colSpan:8,sx:{border:"none"},children:e.jsx(zr,{title:"No clients found",caption:"Try a different tab or search term, or add a client."})})}):U.map((l,m)=>e.jsx(Qn,{row:l,index:_*O+m,onEdit:le=>ge({open:!0,mode:"edit",initial:le}),onDelete:le=>v(le)},l.id))})]})}),e.jsx(wr,{component:"div",count:ne.length,page:_,onPageChange:(l,m)=>H(m),rowsPerPage:O,onRowsPerPageChange:l=>{ve(+l.target.value),H(0)},rowsPerPageOptions:[5,10,25]})]}),e.jsx(Jn,{open:T.open,mode:T.mode,initial:T.initial,onClose:()=>ge({open:!1,mode:"add",initial:null}),onSaved:S}),e.jsxs(lr,{open:!!u,onClose:y?void 0:()=>v(null),children:[e.jsx(cr,{children:"Delete client?"}),e.jsx(ur,{children:e.jsxs(Dr,{children:["This will permanently remove ",e.jsx("strong",{children:u==null?void 0:u.name})," from the doormile_clients collection. This cannot be undone."]})}),e.jsxs(dr,{sx:{px:3,py:2},children:[e.jsx(pe,{onClick:()=>v(null),disabled:y,children:"Cancel"}),e.jsx(pe,{color:"error",variant:"contained",onClick:Ce,disabled:y,startIcon:y?e.jsx(xt,{size:16,color:"inherit"}):null,children:"Delete"})]})]})]})}export{xs as default}; +import{a as p,u as vr,h as Lt,k as at,s as jr,_ as w,l as rr,m as nr,n as sr,o as Ke,j as e,p as Me,q as mt,v as or,w as re,P as ar,x as ir,y as Cr,z as Le,I as Ne,A as Ot,r as bt,i as yt,T as C,M as it,D as zt,C as xt,E as Sr,F as Ir,G as Tr,t as ye,S as z,d as Vt,B as W,H as Pr,f as $r,e as Lr,J as Or,U as Gt,K as At,L as Ar}from"./index-J0uxx8As.js";import{D as lr,a as cr,b as ur,c as dr,d as kr,e as qt}from"./EditOutlined-CLycK5tS.js";import{d as Rr,E as zr}from"./EmptyState-B2FWZCr6.js";import{T as wr,D as Dr,d as _r,a as Wr}from"./PhoneOutlined-C_1wJaio.js";import{d as Mr,a as Nr,b as lt,c as Er,e as Fr}from"./StorefrontOutlined-C6lTcD4z.js";import{S as ct,d as Br,a as pr,b as gr,c as Kt}from"./StatusChip-DTSEpe4F.js";import{d as Hr}from"./MapOutlined-DE0O8xFw.js";import{T as Vr,a as Gr,b as qr,d as Kr}from"./TabLabelCount-C4m0Yyzh.js";import{C as Ur,a as vt,A as hr,G as g,P as Jr}from"./PageHeader-TW1dMGrU.js";import{d as Zr}from"./Close-DtPVHjo-.js";import{A as Xr,f as We,o as Ut,i as kt,T as L}from"./TextField-BARvBB_z.js";import{B as pe}from"./Button-BkRsd5c4.js";import{C as Yr}from"./Link-DdF3Xu1F.js";import{I as Qr}from"./InputAdornment-Cbcw8oJa.js";import{T as en,a as tn,b as rn,c as Ue,d as nn}from"./TableRow-DryS4Frn.js";import{T as N}from"./TableCell-dI-OU86K.js";const sn=t=>{const o=p.useRef({});return p.useEffect(()=>{o.current=t}),o.current};function Jt(t){return typeof t.normalize<"u"?t.normalize("NFD").replace(/[\u0300-\u036f]/g,""):t}function on(t={}){const{ignoreAccents:o=!0,ignoreCase:c=!0,limit:b,matchFrom:$="any",stringify:I,trim:s=!1}=t;return(h,{inputValue:k,getOptionLabel:E})=>{let D=s?k.trim():k;c&&(D=D.toLowerCase()),o&&(D=Jt(D));const _=D?h.filter(H=>{let O=(I||E)(H);return c&&(O=O.toLowerCase()),o&&(O=Jt(O)),$==="start"?O.indexOf(D)===0:O.indexOf(D)>-1}):h;return typeof b=="number"?_.slice(0,b):_}}function ut(t,o){for(let c=0;c{var o;return t.current!==null&&((o=t.current.parentElement)==null?void 0:o.contains(document.activeElement))},cn=[];function un(t){const{unstable_isActiveElementInListbox:o=ln,unstable_classNamePrefix:c="Mui",autoComplete:b=!1,autoHighlight:$=!1,autoSelect:I=!1,blurOnSelect:s=!1,clearOnBlur:h=!t.freeSolo,clearOnEscape:k=!1,componentName:E="useAutocomplete",defaultValue:D=t.multiple?cn:null,disableClearable:_=!1,disableCloseOnSelect:H=!1,disabled:O,disabledItemsFocusable:ve=!1,disableListWrap:T=!1,filterOptions:ge=an,filterSelectedOptions:u=!1,freeSolo:v=!1,getOptionDisabled:y,getOptionKey:Y,getOptionLabel:V=n=>{var r;return(r=n.label)!=null?r:n},groupBy:B,handleHomeEndKeys:K=!t.freeSolo,id:xe,includeInputInList:je=!1,inputValue:ne,isOptionEqualToValue:U=(n,r)=>n===r,multiple:S=!1,onChange:Ce,onClose:Se,onHighlightChange:l,onInputChange:m,onOpen:le,open:Mt,openOnFocus:Nt=!1,options:Ee,readOnly:Ie=!1,selectOnFocus:Fe=!t.freeSolo,value:Je}=t,Q=vr(xe);let J=V;J=n=>{const r=V(n);return typeof r!="string"?String(r):r};const Be=p.useRef(!1),Ze=p.useRef(!0),M=p.useRef(null),ee=p.useRef(null),[Oe,jt]=p.useState(null),[Z,He]=p.useState(-1),Xe=$?0:-1,G=p.useRef(Xe),[d,Et]=Lt({controlled:Je,default:D,name:E}),[j,he]=Lt({controlled:ne,default:"",name:E,state:"inputValue"}),[Ae,Ye]=p.useState(!1),Te=p.useCallback((n,r)=>{if(!(S?d.length!(u&&(S?d:[d]).some(r=>r!==null&&U(n,r)))),{inputValue:tt&&Ct?"":j,getOptionLabel:J}):[],se=sn({filteredOptions:P,value:d,inputValue:j});p.useEffect(()=>{const n=d!==se.value;Ae&&!n||v&&!n||Te(null,d)},[d,Te,Ae,se.value,v]);const Ve=me&&P.length>0&&!Ie,ke=at(n=>{n===-1?M.current.focus():Oe.querySelector(`[data-tag-index="${n}"]`).focus()});p.useEffect(()=>{S&&Z>d.length-1&&(He(-1),ke(-1))},[d,S,Z,ke]);function Re(n,r){if(!ee.current||n<0||n>=P.length)return-1;let a=n;for(;;){const i=ee.current.querySelector(`[data-option-index="${a}"]`),x=ve?!1:!i||i.disabled||i.getAttribute("aria-disabled")==="true";if(i&&i.hasAttribute("tabindex")&&!x)return a;if(r==="next"?a=(a+1)%P.length:a=(a-1+P.length)%P.length,a===n)return-1}}const ce=at(({event:n,index:r,reason:a="auto"})=>{if(G.current=r,r===-1?M.current.removeAttribute("aria-activedescendant"):M.current.setAttribute("aria-activedescendant",`${Q}-option-${r}`),l&&l(n,r===-1?null:P[r],a),!ee.current)return;const i=ee.current.querySelector(`[role="option"].${c}-focused`);i&&(i.classList.remove(`${c}-focused`),i.classList.remove(`${c}-focusVisible`));let x=ee.current;if(ee.current.getAttribute("role")!=="listbox"&&(x=ee.current.parentElement.querySelector('[role="listbox"]')),!x)return;if(r===-1){x.scrollTop=0;return}const A=ee.current.querySelector(`[data-option-index="${r}"]`);if(A&&(A.classList.add(`${c}-focused`),a==="keyboard"&&A.classList.add(`${c}-focusVisible`),x.scrollHeight>x.clientHeight&&a!=="mouse"&&a!=="touch")){const R=A,de=x.clientHeight+x.scrollTop,Ht=R.offsetTop+R.offsetHeight;Ht>de?x.scrollTop=Ht-x.clientHeight:R.offsetTop-R.offsetHeight*(B?1.3:0){if(!X)return;const A=Re((()=>{const R=P.length-1;if(r==="reset")return Xe;if(r==="start")return 0;if(r==="end")return R;const de=G.current+r;return de<0?de===-1&&je?-1:T&&G.current!==-1||Math.abs(r)>1?0:R:de>R?de===R+1&&je?-1:T||Math.abs(r)>1?R:0:de})(),a);if(ce({index:A,reason:i,event:n}),b&&r!=="reset")if(A===-1)M.current.value=j;else{const R=J(P[A]);M.current.value=R,R.toLowerCase().indexOf(j.toLowerCase())===0&&j.length>0&&M.current.setSelectionRange(j.length,R.length)}}),ze=()=>{const n=(r,a)=>{const i=r?J(r):"",x=a?J(a):"";return i===x};if(G.current!==-1&&se.filteredOptions&&se.filteredOptions.length!==P.length&&se.inputValue===j&&(S?d.length===se.value.length&&se.value.every((r,a)=>J(d[a])===J(r)):n(se.value,d))){const r=se.filteredOptions[G.current];if(r)return ut(P,a=>J(a)===J(r))}return-1},Ge=p.useCallback(()=>{if(!X)return;const n=ze();if(n!==-1){G.current=n;return}const r=S?d[0]:d;if(P.length===0||r==null){oe({diff:"reset"});return}if(ee.current){if(r!=null){const a=P[G.current];if(S&&a&&ut(d,x=>U(a,x))!==-1)return;const i=ut(P,x=>U(x,r));i===-1?oe({diff:"reset"}):ce({index:i});return}if(G.current>=P.length-1){ce({index:P.length-1});return}ce({index:G.current})}},[P.length,S?!1:d,u,oe,ce,X,j,S]),St=at(n=>{jr(ee,n),n&&Ge()});p.useEffect(()=>{Ge()},[Ge]);const te=n=>{me||(Qe(!0),et(!0),le&&le(n))},fe=(n,r)=>{me&&(Qe(!1),Se&&Se(n,r))},ue=(n,r,a,i)=>{if(S){if(d.length===r.length&&d.every((x,A)=>x===r[A]))return}else if(d===r)return;Ce&&Ce(n,r,a,i),Et(r)},we=p.useRef(!1),Pe=(n,r,a="selectOption",i="options")=>{let x=a,A=r;if(S){A=Array.isArray(d)?d.slice():[];const R=ut(A,de=>U(r,de));R===-1?A.push(r):i!=="freeSolo"&&(A.splice(R,1),x="removeOption")}Te(n,A),ue(n,A,x,{option:r}),!H&&(!n||!n.ctrlKey&&!n.metaKey)&&fe(n,x),(s===!0||s==="touch"&&we.current||s==="mouse"&&!we.current)&&M.current.blur()};function rt(n,r){if(n===-1)return-1;let a=n;for(;;){if(r==="next"&&a===d.length||r==="previous"&&a===-1)return-1;const i=Oe.querySelector(`[data-tag-index="${a}"]`);if(!i||!i.hasAttribute("tabindex")||i.disabled||i.getAttribute("aria-disabled")==="true")a+=r==="next"?1:-1;else return a}}const nt=(n,r)=>{if(!S)return;j===""&&fe(n,"toggleInput");let a=Z;Z===-1?j===""&&r==="previous"&&(a=d.length-1):(a+=r==="next"?1:-1,a<0&&(a=0),a===d.length&&(a=-1)),a=rt(a,r),He(a),ke(a)},st=n=>{Be.current=!0,he(""),m&&m(n,"","clear"),ue(n,S?[]:null,"clear")},It=n=>r=>{if(n.onKeyDown&&n.onKeyDown(r),!r.defaultMuiPrevented&&(Z!==-1&&["ArrowLeft","ArrowRight"].indexOf(r.key)===-1&&(He(-1),ke(-1)),r.which!==229))switch(r.key){case"Home":X&&K&&(r.preventDefault(),oe({diff:"start",direction:"next",reason:"keyboard",event:r}));break;case"End":X&&K&&(r.preventDefault(),oe({diff:"end",direction:"previous",reason:"keyboard",event:r}));break;case"PageUp":r.preventDefault(),oe({diff:-Zt,direction:"previous",reason:"keyboard",event:r}),te(r);break;case"PageDown":r.preventDefault(),oe({diff:Zt,direction:"next",reason:"keyboard",event:r}),te(r);break;case"ArrowDown":r.preventDefault(),oe({diff:1,direction:"next",reason:"keyboard",event:r}),te(r);break;case"ArrowUp":r.preventDefault(),oe({diff:-1,direction:"previous",reason:"keyboard",event:r}),te(r);break;case"ArrowLeft":nt(r,"previous");break;case"ArrowRight":nt(r,"next");break;case"Enter":if(G.current!==-1&&X){const a=P[G.current],i=y?y(a):!1;if(r.preventDefault(),i)return;Pe(r,a,"selectOption"),b&&M.current.setSelectionRange(M.current.value.length,M.current.value.length)}else v&&j!==""&&tt===!1&&(S&&r.preventDefault(),Pe(r,j,"createOption","freeSolo"));break;case"Escape":X?(r.preventDefault(),r.stopPropagation(),fe(r,"escape")):k&&(j!==""||S&&d.length>0)&&(r.preventDefault(),r.stopPropagation(),st(r));break;case"Backspace":if(S&&!Ie&&j===""&&d.length>0){const a=Z===-1?d.length-1:Z,i=d.slice();i.splice(a,1),ue(r,i,"removeOption",{option:d[a]})}break;case"Delete":if(S&&!Ie&&j===""&&d.length>0&&Z!==-1){const a=Z,i=d.slice();i.splice(a,1),ue(r,i,"removeOption",{option:d[a]})}break}},Ft=n=>{Ye(!0),Nt&&!Be.current&&te(n)},De=n=>{if(o(ee)){M.current.focus();return}Ye(!1),Ze.current=!0,Be.current=!1,I&&G.current!==-1&&X?Pe(n,P[G.current],"blur"):I&&v&&j!==""?Pe(n,j,"blur","freeSolo"):h&&Te(n,d),fe(n,"blur")},q=n=>{const r=n.target.value;j!==r&&(he(r),et(!1),m&&m(n,r,"input")),r===""?!_&&!S&&ue(n,null,"clear"):te(n)},F=n=>{const r=Number(n.currentTarget.getAttribute("data-option-index"));G.current!==r&&ce({event:n,index:r,reason:"mouse"})},ae=n=>{ce({event:n,index:Number(n.currentTarget.getAttribute("data-option-index")),reason:"touch"}),we.current=!0},Bt=n=>{const r=Number(n.currentTarget.getAttribute("data-option-index"));Pe(n,P[r],"selectOption"),we.current=!1},Tt=n=>r=>{const a=d.slice();a.splice(n,1),ue(r,a,"removeOption",{option:d[n]})},Pt=n=>{me?fe(n,"toggleInput"):te(n)},$t=n=>{n.currentTarget.contains(n.target)&&n.target.getAttribute("id")!==Q&&n.preventDefault()},ot=n=>{n.currentTarget.contains(n.target)&&(M.current.focus(),Fe&&Ze.current&&M.current.selectionEnd-M.current.selectionStart===0&&M.current.select(),Ze.current=!1)},qe=n=>{!O&&(j===""||!me)&&Pt(n)};let $e=v&&j.length>0;$e=$e||(S?d.length>0:d!==null);let _e=P;return B&&(_e=P.reduce((n,r,a)=>{const i=B(r);return n.length>0&&n[n.length-1].group===i?n[n.length-1].options.push(r):n.push({key:a,index:a,group:i,options:[r]}),n},[])),O&&Ae&&De(),{getRootProps:(n={})=>w({"aria-owns":Ve?`${Q}-listbox`:null},n,{onKeyDown:It(n),onMouseDown:$t,onClick:ot}),getInputLabelProps:()=>({id:`${Q}-label`,htmlFor:Q}),getInputProps:()=>({id:Q,value:j,onBlur:De,onFocus:Ft,onChange:q,onMouseDown:qe,"aria-activedescendant":X?"":null,"aria-autocomplete":b?"both":"list","aria-controls":Ve?`${Q}-listbox`:void 0,"aria-expanded":Ve,autoComplete:"off",ref:M,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:O}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:st}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Pt}),getTagProps:({index:n})=>w({key:n,"data-tag-index":n,tabIndex:-1},!Ie&&{onDelete:Tt(n)}),getListboxProps:()=>({role:"listbox",id:`${Q}-listbox`,"aria-labelledby":`${Q}-label`,ref:St,onMouseDown:n=>{n.preventDefault()}}),getOptionProps:({index:n,option:r})=>{var a;const i=(S?d:[d]).some(A=>A!=null&&U(r,A)),x=y?y(r):!1;return{key:(a=Y==null?void 0:Y(r))!=null?a:J(r),tabIndex:-1,role:"option",id:`${Q}-option-${n}`,onMouseMove:F,onClick:Bt,onTouchStart:ae,"data-option-index":n,"aria-disabled":x,"aria-selected":i}},id:Q,inputValue:j,value:d,dirty:$e,expanded:X&&Oe,popupOpen:X,focused:Ae||Z!==-1,anchorEl:Oe,setAnchorEl:jt,focusedTag:Z,groupedOptions:_e}}function dn(t){return rr("MuiListSubheader",t)}nr("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const pn=["className","color","component","disableGutters","disableSticky","inset"],gn=t=>{const{classes:o,color:c,disableGutters:b,inset:$,disableSticky:I}=t,s={root:["root",c!=="default"&&`color${mt(c)}`,!b&&"gutters",$&&"inset",!I&&"sticky"]};return or(s,dn,o)},hn=re("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:c}=t;return[o.root,c.color!=="default"&&o[`color${mt(c.color)}`],!c.disableGutters&&o.gutters,c.inset&&o.inset,!c.disableSticky&&o.sticky]}})(({theme:t,ownerState:o})=>w({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(t.vars||t).palette.text.secondary,fontFamily:t.typography.fontFamily,fontWeight:t.typography.fontWeightMedium,fontSize:t.typography.pxToRem(14)},o.color==="primary"&&{color:(t.vars||t).palette.primary.main},o.color==="inherit"&&{color:"inherit"},!o.disableGutters&&{paddingLeft:16,paddingRight:16},o.inset&&{paddingLeft:72},!o.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(t.vars||t).palette.background.paper})),fr=p.forwardRef(function(o,c){const b=sr({props:o,name:"MuiListSubheader"}),{className:$,color:I="default",component:s="li",disableGutters:h=!1,disableSticky:k=!1,inset:E=!1}=b,D=Ke(b,pn),_=w({},b,{color:I,component:s,disableGutters:h,disableSticky:k,inset:E}),H=gn(_);return e.jsx(hn,w({as:s,className:Me(H.root,$),ref:c,ownerState:_},D))});fr.muiSkipListHighlight=!0;function fn(t){return rr("MuiAutocomplete",t)}const f=nr("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var Xt,Yt;const xn=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],mn=["ref"],bn=["key"],yn=["key"],vn=t=>{const{classes:o,disablePortal:c,expanded:b,focused:$,fullWidth:I,hasClearIcon:s,hasPopupIcon:h,inputFocused:k,popupOpen:E,size:D}=t,_={root:["root",b&&"expanded",$&&"focused",I&&"fullWidth",s&&"hasClearIcon",h&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",k&&"inputFocused"],tag:["tag",`tagSize${mt(D)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",E&&"popupIndicatorOpen"],popper:["popper",c&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return or(_,fn,o)},jn=re("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:c}=t,{fullWidth:b,hasClearIcon:$,hasPopupIcon:I,inputFocused:s,size:h}=c;return[{[`& .${f.tag}`]:o.tag},{[`& .${f.tag}`]:o[`tagSize${mt(h)}`]},{[`& .${f.inputRoot}`]:o.inputRoot},{[`& .${f.input}`]:o.input},{[`& .${f.input}`]:s&&o.inputFocused},o.root,b&&o.fullWidth,I&&o.hasPopupIcon,$&&o.hasClearIcon]}})({[`&.${f.focused} .${f.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${f.clearIndicator}`]:{visibility:"visible"}},[`& .${f.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${f.inputRoot}`]:{[`.${f.hasPopupIcon}&, .${f.hasClearIcon}&`]:{paddingRight:30},[`.${f.hasPopupIcon}.${f.hasClearIcon}&`]:{paddingRight:56},[`& .${f.input}`]:{width:0,minWidth:30}},[`& .${kt.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${kt.root}.${Le.sizeSmall}`]:{[`& .${kt.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Ut.root}`]:{padding:9,[`.${f.hasPopupIcon}&, .${f.hasClearIcon}&`]:{paddingRight:39},[`.${f.hasPopupIcon}.${f.hasClearIcon}&`]:{paddingRight:65},[`& .${f.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${f.endAdornment}`]:{right:9}},[`& .${Ut.root}.${Le.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${f.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${We.root}`]:{paddingTop:19,paddingLeft:8,[`.${f.hasPopupIcon}&, .${f.hasClearIcon}&`]:{paddingRight:39},[`.${f.hasPopupIcon}.${f.hasClearIcon}&`]:{paddingRight:65},[`& .${We.input}`]:{padding:"7px 4px"},[`& .${f.endAdornment}`]:{right:9}},[`& .${We.root}.${Le.sizeSmall}`]:{paddingBottom:1,[`& .${We.input}`]:{padding:"2.5px 4px"}},[`& .${Le.hiddenLabel}`]:{paddingTop:8},[`& .${We.root}.${Le.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${f.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${We.root}.${Le.hiddenLabel}.${Le.sizeSmall}`]:{[`& .${f.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${f.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${f.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${f.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${f.inputRoot}`]:{flexWrap:"wrap"}}}]}),Cn=re("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(t,o)=>o.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),Sn=re(Ne,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(t,o)=>o.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),In=re(Ne,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:t},o)=>w({},o.popupIndicator,t.popupOpen&&o.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),Tn=re(ir,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(t,o)=>{const{ownerState:c}=t;return[{[`& .${f.option}`]:o.option},o.popper,c.disablePortal&&o.popperDisablePortal]}})(({theme:t})=>({zIndex:(t.vars||t).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),Pn=re(ar,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(t,o)=>o.paper})(({theme:t})=>w({},t.typography.body1,{overflow:"auto"})),$n=re("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(t,o)=>o.loading})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),Ln=re("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(t,o)=>o.noOptions})(({theme:t})=>({color:(t.vars||t).palette.text.secondary,padding:"14px 16px"})),On=re("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(t,o)=>o.listbox})(({theme:t})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${f.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[t.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${f.focused}`]:{backgroundColor:(t.vars||t).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(t.vars||t).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${f.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Ot(t.palette.primary.main,t.palette.action.selectedOpacity),[`&.${f.focused}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Ot(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(t.vars||t).palette.action.selected}},[`&.${f.focusVisible}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.focusOpacity}))`:Ot(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.focusOpacity)}}}})),An=re(fr,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(t,o)=>o.groupLabel})(({theme:t})=>({backgroundColor:(t.vars||t).palette.background.paper,top:-8})),kn=re("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(t,o)=>o.groupUl})({padding:0,[`& .${f.option}`]:{paddingLeft:24}}),dt=p.forwardRef(function(o,c){var b,$,I,s;const h=sr({props:o,name:"MuiAutocomplete"}),{autoComplete:k=!1,autoHighlight:E=!1,autoSelect:D=!1,blurOnSelect:_=!1,ChipProps:H,className:O,clearIcon:ve=Xt||(Xt=e.jsx(Ur,{fontSize:"small"})),clearOnBlur:T=!h.freeSolo,clearOnEscape:ge=!1,clearText:u="Clear",closeText:v="Close",componentsProps:y={},defaultValue:Y=h.multiple?[]:null,disableClearable:V=!1,disableCloseOnSelect:B=!1,disabled:K=!1,disabledItemsFocusable:xe=!1,disableListWrap:je=!1,disablePortal:ne=!1,filterSelectedOptions:U=!1,forcePopupIcon:S="auto",freeSolo:Ce=!1,fullWidth:Se=!1,getLimitTagsText:l=r=>`+${r}`,getOptionLabel:m,groupBy:le,handleHomeEndKeys:Mt=!h.freeSolo,includeInputInList:Nt=!1,limitTags:Ee=-1,ListboxComponent:Ie="ul",ListboxProps:Fe,loading:Je=!1,loadingText:Q="Loading…",multiple:J=!1,noOptionsText:Be="No options",openOnFocus:Ze=!1,openText:M="Open",PaperComponent:ee=ar,PopperComponent:Oe=ir,popupIcon:jt=Yt||(Yt=e.jsx(Xr,{})),readOnly:Z=!1,renderGroup:He,renderInput:Xe,renderOption:G,renderTags:d,selectOnFocus:Et=!h.freeSolo,size:j="medium",slotProps:he={}}=h,Ae=Ke(h,xn),{getRootProps:Ye,getInputProps:Te,getInputLabelProps:me,getPopupIndicatorProps:Qe,getClearProps:Ct,getTagProps:et,getListboxProps:tt,getOptionProps:X,value:P,dirty:se,expanded:Ve,id:ke,popupOpen:Re,focused:ce,focusedTag:oe,anchorEl:ze,setAnchorEl:Ge,inputValue:St,groupedOptions:te}=un(w({},h,{componentName:"Autocomplete"})),fe=!V&&!K&&se&&!Z,ue=(!Ce||S===!0)&&S!==!1,{onMouseDown:we}=Te(),{ref:Pe}=Fe??{},rt=tt(),{ref:nt}=rt,st=Ke(rt,mn),It=Cr(nt,Pe),De=m||(r=>{var a;return(a=r.label)!=null?a:r}),q=w({},h,{disablePortal:ne,expanded:Ve,focused:ce,fullWidth:Se,getOptionLabel:De,hasClearIcon:fe,hasPopupIcon:ue,inputFocused:oe===-1,popupOpen:Re,size:j}),F=vn(q);let ae;if(J&&P.length>0){const r=a=>w({className:F.tag,disabled:K},et(a));d?ae=d(P,r,q):ae=P.map((a,i)=>{const x=r({index:i}),{key:A}=x,R=Ke(x,bn);return e.jsx(vt,w({label:De(a),size:j},R,H),A)})}if(Ee>-1&&Array.isArray(ae)){const r=ae.length-Ee;!ce&&r>0&&(ae=ae.splice(0,Ee),ae.push(e.jsx("span",{className:F.tag,children:l(r)},ae.length)))}const Tt=He||(r=>e.jsxs("li",{children:[e.jsx(An,{className:F.groupLabel,ownerState:q,component:"div",children:r.group}),e.jsx(kn,{className:F.groupUl,ownerState:q,children:r.children})]},r.key)),$t=G||((r,a)=>{const{key:i}=r,x=Ke(r,yn);return e.jsx("li",w({},x,{children:De(a)}),i)}),ot=(r,a)=>{const i=X({option:r,index:a});return $t(w({},i,{className:F.option}),r,{selected:i["aria-selected"],index:a,inputValue:St},q)},qe=(b=he.clearIndicator)!=null?b:y.clearIndicator,$e=($=he.paper)!=null?$:y.paper,_e=(I=he.popper)!=null?I:y.popper,n=(s=he.popupIndicator)!=null?s:y.popupIndicator;return e.jsxs(p.Fragment,{children:[e.jsx(jn,w({ref:c,className:Me(F.root,O),ownerState:q},Ye(Ae),{children:Xe({id:ke,disabled:K,fullWidth:!0,size:j==="small"?"small":void 0,InputLabelProps:me(),InputProps:w({ref:Ge,className:F.inputRoot,startAdornment:ae,onClick:r=>{r.target===r.currentTarget&&we(r)}},(fe||ue)&&{endAdornment:e.jsxs(Cn,{className:F.endAdornment,ownerState:q,children:[fe?e.jsx(Sn,w({},Ct(),{"aria-label":u,title:u,ownerState:q},qe,{className:Me(F.clearIndicator,qe==null?void 0:qe.className),children:ve})):null,ue?e.jsx(In,w({},Qe(),{disabled:K,"aria-label":Re?v:M,title:Re?v:M,ownerState:q},n,{className:Me(F.popupIndicator,n==null?void 0:n.className),children:jt})):null]})}),inputProps:w({className:F.input,disabled:K,readOnly:Z},Te())})})),ze?e.jsx(Tn,w({as:Oe,disablePortal:ne,style:{width:ze?ze.clientWidth:null},ownerState:q,role:"presentation",anchorEl:ze,open:Re},_e,{className:Me(F.popper,_e==null?void 0:_e.className),children:e.jsxs(Pn,w({ownerState:q,as:ee},$e,{className:Me(F.paper,$e==null?void 0:$e.className),children:[Je&&te.length===0?e.jsx($n,{className:F.loading,ownerState:q,children:Q}):null,te.length===0&&!Ce&&!Je?e.jsx(Ln,{className:F.noOptions,ownerState:q,role:"presentation",onMouseDown:r=>{r.preventDefault()},children:Be}):null,te.length>0?e.jsx(On,w({as:Ie,className:F.listbox,ownerState:q},st,Fe,{ref:It,children:te.map((r,a)=>le?Tt({key:r.key,group:r.group,children:r.options.map((i,x)=>ot(i,r.index+x))}):ot(r,a))})):null]}))})):null]})});var wt={},Rn=yt;Object.defineProperty(wt,"__esModule",{value:!0});var xr=wt.default=void 0,zn=Rn(bt()),wn=e;xr=wt.default=(0,zn.default)((0,wn.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined");var Dt={},Dn=yt;Object.defineProperty(Dt,"__esModule",{value:!0});var mr=Dt.default=void 0,_n=Dn(bt()),Wn=e;mr=Dt.default=(0,_n.default)((0,Wn.jsx)("path",{d:"M21 11.01 3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"}),"NotesOutlined");var _t={},Mn=yt;Object.defineProperty(_t,"__esModule",{value:!0});var br=_t.default=void 0,Nn=Mn(bt()),En=e;br=_t.default=(0,Nn.default)((0,En.jsx)("path",{d:"M16.01 11H4v2h12.01v3L20 12l-3.99-4z"}),"ArrowRightAlt");var Wt={},Fn=yt;Object.defineProperty(Wt,"__esModule",{value:!0});var yr=Wt.default=void 0,Bn=Fn(bt()),Hn=e;yr=Wt.default=(0,Bn.default)((0,Hn.jsx)("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"}),"MyLocation");const Vn=["retail","wholesale","manufacturer","distributor","services","ecommerce","other"],Gn=["newClient","contacted","onboarded","lost"],qn=["Daily","Weekly","Fortnightly","Monthly","Occasional"],Kn=["basicOnly","full","none"],Un=["Blue Dart","Delhivery","DTDC","India Post / Speed Post","The Professional Couriers","XpressBees","Ecom Express","Shadowfax","Safexpress","VRL Logistics","TCI (Transport Corporation of India)","Om Logistics","Best Roadways","MSS (Mettur Super Services)","ABT Travels & Logistics","Navata Road Transport","KRS (Kerala Roadways)","Parveen Travels / Parveen Express","SRM Transports","KPN Travels & KPN Speed Parcel","SRS Travels","Hindusthan Travels","City Travels","Essaar Travels","No. 1 Air Travels","A1 Travels","Krish Travels","Hebron Transports","Horma Travels","Vivegam Travels","PSS Transport","SRT (Renugambal Travels)","Thamarai Bus Transports","Rathimeena Travels","Ganesh Travels","John Kennedy Bus Service","Arun Travel","Saaji Meera Roadways","ARC Parcel Service","Chakra Travels & Parcel Service","MVA Parcel And Bus Service","Shrinath Travels & Cargo","Hans Travels","Zingbus","Kalpana Travels / City Land Travels","Trackon Couriers","North India Transways","RSRTC Cargo","UPSRTC Cargo"],Rt=["Chennai","Coimbatore","Madurai","Tiruchirappalli","Salem","Tuticorin","Tirupur","Erode","Vellore","Tirunelveli","Thanjavur","Dindigul","Hosur","Nagercoil","Karur","Namakkal","Kanchipuram","Cuddalore","Thoothukudi","Bengaluru","Mysuru","Mangaluru","Hubli","Belagavi","Kalaburagi","Davangere","Ballari","Kochi","Thiruvananthapuram","Kozhikode","Kannur","Thrissur","Kollam","Hyderabad","Warangal","Visakhapatnam","Vijayawada","Tirupati","Guntur","Rajahmundry","Nellore","Mumbai","Pune","Nagpur","Nashik","Aurangabad","Kolhapur","Solapur","New Delhi","Gurugram","Noida","Faridabad","Chandigarh","Amritsar","Ludhiana","Jalandhar","Ahmedabad","Surat","Vadodara","Rajkot","Bhavnagar","Jamnagar","Jaipur","Jodhpur","Udaipur","Kota","Bikaner","Lucknow","Kanpur","Varanasi","Agra","Prayagraj","Gorakhpur","Bhopal","Indore","Gwalior","Jabalpur","Raipur","Kolkata","Siliguri","Durgapur","Patna","Gaya","Ranchi","Jamshedpur","Bhubaneswar","Cuttack","Guwahati","Dibrugarh","Agartala","Imphal","Shillong","Aizawl","Dimapur","Dehradun","Haridwar","Shimla","Srinagar","Jammu","Leh","Panaji","Puducherry","Port Blair"],Qt={name:"",email:"",password:"",phone:"",city:"",businessState:"",businessType:"retail",status:"newClient",frequency:"Daily",parcelVolume:0,activeContracts:0,provider:"",efficiency:"",logisticsSegment:"",transitFrom:"",transitTo:"",neighbourhood:"",surveyAddress:"",surveyLat:"",surveyLng:"",dataConsent:"full",notes:"",pincode:""},pt=t=>typeof t=="string"?t.charAt(0).toUpperCase()+t.slice(1).replace(/([A-Z])/g," $1").trim():t,gt=(t,o)=>o&&!t.includes(o)?[o,...t]:t;function Jn({open:t,mode:o,initial:c,onClose:b,onSaved:$}){const I=o==="edit",[s,h]=p.useState(Qt),[k,E]=p.useState(!1),[D,_]=p.useState(null),[H,O]=p.useState(!1),ve=()=>{if(!navigator.geolocation){alert("Geolocation is not supported by your browser");return}O(!0),navigator.geolocation.getCurrentPosition(async u=>{const v=u.coords.latitude,y=u.coords.longitude;h(Y=>({...Y,surveyLat:v,surveyLng:y}));try{const V=await(await fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${v}&lon=${y}`)).json();if(V&&V.address){const B=V.address,K=B.city||B.town||B.village||B.county||"",xe=B.state||"",je=B.postcode||"",ne=V.display_name||"";h(U=>({...U,city:K||U.city,businessState:xe||U.businessState,pincode:je||U.pincode,surveyAddress:ne||U.surveyAddress}))}}catch(Y){console.error("Reverse geocoding failed",Y)}finally{O(!1)}},u=>{alert("Unable to retrieve your location"),O(!1)})};p.useEffect(()=>{t&&(h({...Qt,...c||{}}),_(null))},[t,c]);const T=u=>v=>h(y=>({...y,[u]:v.target.value})),ge=async()=>{if(!s.name.trim()){_("Client name is required.");return}E(!0),_(null);const u=s.surveyLat===""?void 0:Number(s.surveyLat),v=s.surveyLng===""?void 0:Number(s.surveyLng),y={first_name:s.name.trim(),phone:s.phone,city:s.city,businessState:s.businessState,businessType:s.businessType,status:s.status,frequency:s.frequency,parcelVolume:Number(s.parcelVolume)||0,activeContracts:Number(s.activeContracts)||0,provider:s.provider,efficiency:s.efficiency,logisticsSegment:s.logisticsSegment,transitFrom:s.transitFrom,transitTo:s.transitTo,neighbourhood:s.neighbourhood,pincode:s.pincode,surveyAddress:s.surveyAddress,dataConsent:s.dataConsent,notes:s.notes,lastUpdated:new Date().toISOString().slice(0,10),registration_source:"web",...s.email.trim()?{email:s.email.trim()}:{},...u!=null?{survey_lat:u}:{},...v!=null?{survey_long:v}:{}};try{I?await Sr(c.id,y):await Ir({...y,...s.password?{password:s.password}:{}}),$()}catch(Y){_(Y.message||"Failed to save client")}finally{E(!1)}};return e.jsxs(lr,{open:t,onClose:k?void 0:b,maxWidth:"md",fullWidth:!0,children:[e.jsxs(cr,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[I?"Edit Client":"Add Client",e.jsx(Ne,{onClick:b,size:"small",disabled:k,children:e.jsx(Zr,{})})]}),e.jsxs(ur,{dividers:!0,children:[D&&e.jsx(hr,{severity:"error",sx:{mb:2},children:D}),e.jsx(C,{variant:"overline",color:"text.secondary",children:"Business"}),e.jsxs(g,{container:!0,spacing:2,sx:{mt:0,mb:1},children:[e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Client Name *",value:s.name,onChange:T("name")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Phone",value:s.phone,onChange:T("phone")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Email",value:s.email,onChange:T("email")})}),!I&&e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Password",type:"password",value:s.password,onChange:T("password")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{select:!0,fullWidth:!0,size:"small",label:"Business Type",value:s.businessType,onChange:T("businessType"),children:gt(Vn,s.businessType).map(u=>e.jsx(it,{value:u,children:pt(u)},u))})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{select:!0,fullWidth:!0,size:"small",label:"Status",value:s.status,onChange:T("status"),children:gt(Gn,s.status).map(u=>e.jsx(it,{value:u,children:pt(u)},u))})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{select:!0,fullWidth:!0,size:"small",label:"Order Frequency",value:s.frequency,onChange:T("frequency"),children:gt(qn,s.frequency).map(u=>e.jsx(it,{value:u,children:pt(u)},u))})}),e.jsx(g,{item:!0,xs:12,sm:3,children:e.jsx(L,{fullWidth:!0,size:"small",type:"number",label:"Parcel Volume",value:s.parcelVolume,onChange:T("parcelVolume")})}),e.jsx(g,{item:!0,xs:12,sm:3,children:e.jsx(L,{fullWidth:!0,size:"small",type:"number",label:"Active Contracts",value:s.activeContracts,onChange:T("activeContracts")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(dt,{autoHighlight:!0,options:Un,value:s.provider||null,onChange:(u,v)=>h(y=>({...y,provider:v||""})),renderInput:u=>e.jsx(L,{...u,fullWidth:!0,size:"small",label:"Current Provider"})})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Efficiency",value:s.efficiency,onChange:T("efficiency")})}),e.jsx(g,{item:!0,xs:12,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Logistics Segment",value:s.logisticsSegment,onChange:T("logisticsSegment"),placeholder:"First Mile, Last Mile"})})]}),e.jsx(zt,{sx:{my:1.5}}),e.jsx(C,{variant:"overline",color:"text.secondary",children:"Location & Transit"}),e.jsxs(g,{container:!0,spacing:2,sx:{mt:0,mb:1},children:[e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(dt,{autoHighlight:!0,options:Rt,value:s.city||null,onChange:(u,v)=>h(y=>({...y,city:v||""})),renderInput:u=>e.jsx(L,{...u,fullWidth:!0,size:"small",label:"City"})})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"State",value:s.businessState,onChange:T("businessState")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Pincode",value:s.pincode,onChange:T("pincode")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Neighbourhood / Zone",value:s.neighbourhood,onChange:T("neighbourhood")})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(dt,{autoHighlight:!0,options:Rt,value:s.transitFrom||null,onChange:(u,v)=>h(y=>({...y,transitFrom:v||""})),renderInput:u=>e.jsx(L,{...u,fullWidth:!0,size:"small",label:"Transit From"})})}),e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(dt,{autoHighlight:!0,options:Rt,value:s.transitTo||null,onChange:(u,v)=>h(y=>({...y,transitTo:v||""})),renderInput:u=>e.jsx(L,{...u,fullWidth:!0,size:"small",label:"Transit To"})})}),e.jsx(g,{item:!0,xs:12,sm:3,children:e.jsx(L,{fullWidth:!0,size:"small",type:"number",label:"Latitude",value:s.surveyLat,onChange:T("surveyLat")})}),e.jsx(g,{item:!0,xs:12,sm:3,children:e.jsx(L,{fullWidth:!0,size:"small",type:"number",label:"Longitude",value:s.surveyLng,onChange:T("surveyLng")})}),e.jsx(g,{item:!0,xs:12,sm:6,display:"flex",alignItems:"center",children:e.jsx(pe,{variant:"outlined",size:"small",onClick:ve,disabled:H,startIcon:H?e.jsx(xt,{size:16}):e.jsx(yr,{}),fullWidth:!0,children:"Get GPS Location"})}),e.jsx(g,{item:!0,xs:12,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Survey Address",value:s.surveyAddress,onChange:T("surveyAddress"),multiline:!0,minRows:2})})]}),e.jsx(zt,{sx:{my:1.5}}),e.jsx(C,{variant:"overline",color:"text.secondary",children:"Other"}),e.jsxs(g,{container:!0,spacing:2,sx:{mt:0},children:[e.jsx(g,{item:!0,xs:12,sm:6,children:e.jsx(L,{select:!0,fullWidth:!0,size:"small",label:"Data Consent",value:s.dataConsent,onChange:T("dataConsent"),children:gt(Kn,s.dataConsent).map(u=>e.jsx(it,{value:u,children:pt(u)},u))})}),e.jsx(g,{item:!0,xs:12,children:e.jsx(L,{fullWidth:!0,size:"small",label:"Notes",value:s.notes,onChange:T("notes"),multiline:!0,minRows:2})})]})]}),e.jsxs(dr,{sx:{px:3,py:2},children:[e.jsx(pe,{onClick:b,disabled:k,children:"Cancel"}),e.jsx(pe,{variant:"contained",onClick:ge,disabled:k,startIcon:k?e.jsx(xt,{size:16,color:"inherit"}):null,children:I?"Save Changes":"Create Client"})]})]})}const Zn=t=>({full:"success",basiconly:"info",none:"default"})[String(t||"").toLowerCase()]||"default",Xn=t=>{const o=String(t||"").toLowerCase();return/high|good|excellent/.test(o)?"success":/med|average|moderate/.test(o)?"warning":/low|poor|bad/.test(o)?"error":"info"},Yn={textTransform:"uppercase",letterSpacing:.4,fontSize:"0.68rem",fontWeight:700,color:"grey.700"};function be({label:t,color:o="default"}){return t==null||t===""?e.jsx(C,{variant:"body2",sx:{fontWeight:500,color:"grey.500"},children:"—"}):e.jsx(vt,{size:"small",label:t,sx:{fontWeight:600,...o==="default"?{bgcolor:"grey.100",color:"grey.700"}:{bgcolor:`${o}.lighter`,color:`${o}.dark`}}})}function ie({label:t,children:o}){return e.jsxs(W,{children:[e.jsx(C,{variant:"caption",color:"text.secondary",sx:Yn,children:t}),e.jsx(W,{sx:{mt:.5},children:o})]})}function ht({label:t,value:o}){return e.jsx(ie,{label:t,children:e.jsx(C,{variant:"body2",sx:{fontWeight:500,color:o?"grey.800":"grey.500",wordBreak:"break-word"},children:o||"—"})})}function ft({icon:t,title:o,accent:c="primary",children:b}){return e.jsxs(W,{sx:{height:"100%",borderRadius:2,border:1,borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"},children:[e.jsxs(z,{direction:"row",spacing:1,alignItems:"center",sx:{px:2,py:1.25,borderBottom:1,borderColor:"divider",bgcolor:`${c}.lighter`,opacity:.999},children:[e.jsx(t,{sx:{fontSize:18,color:`${c}.main`}}),e.jsx(C,{variant:"overline",sx:{fontWeight:700,color:"grey.800",letterSpacing:.6,lineHeight:1},children:o})]}),e.jsx(z,{spacing:1.75,sx:{p:2},children:b})]})}function er({label:t,value:o,icon:c,color:b="primary"}){return e.jsx(W,{sx:{flex:1,p:1.5,borderRadius:1.5,border:1,borderColor:"divider",bgcolor:"grey.50"},children:e.jsxs(z,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(W,{sx:{width:32,height:32,borderRadius:1,bgcolor:`${b}.lighter`,color:`${b}.main`,display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(c,{sx:{fontSize:18}})}),e.jsxs(W,{children:[e.jsx(C,{variant:"h5",sx:{fontWeight:700,color:"grey.800",lineHeight:1.1},children:o}),e.jsx(C,{variant:"caption",color:"text.secondary",children:t})]})]})})}function tr({label:t,value:o,color:c="grey.800"}){return e.jsxs(W,{sx:{textAlign:"center",minWidth:56},children:[e.jsx(C,{variant:"body2",sx:{fontWeight:700,color:c,lineHeight:1.2},children:o}),e.jsx(C,{variant:"caption",color:"text.secondary",sx:{fontSize:"0.65rem"},children:t})]})}function Qn({row:t,index:o,onEdit:c,onDelete:b}){const[$,I]=p.useState(!1);return e.jsxs(p.Fragment,{children:[e.jsxs(Ue,{hover:!0,sx:{cursor:"pointer","& > *":{borderBottom:$?"unset":void 0},...$&&{bgcolor:"primary.lighter","&:hover":{bgcolor:"primary.lighter"}}},onClick:()=>I(s=>!s),children:[e.jsx(N,{padding:"checkbox",children:e.jsx(Ne,{size:"small",onClick:s=>{s.stopPropagation(),I(h=>!h)},children:$?e.jsx(Mr,{}):e.jsx(Nr,{})})}),e.jsx(N,{sx:{whiteSpace:"nowrap"},children:e.jsx(C,{variant:"caption",sx:{fontFamily:"monospace",fontWeight:700,color:"primary.main",bgcolor:"primary.lighter",px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:"primary.light",whiteSpace:"nowrap"},children:t.logicalId})}),e.jsx(N,{children:e.jsxs(z,{direction:"row",spacing:1.25,alignItems:"center",children:[e.jsx(Gt,{name:t.name,size:38}),e.jsxs(W,{sx:{minWidth:0},children:[e.jsx(C,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:t.name}),e.jsx(z,{direction:"row",spacing:.75,alignItems:"center",sx:{mt:.4},children:t.businessType&&e.jsx(vt,{size:"small",label:ye(t.businessType),sx:{height:20,fontSize:"0.68rem",fontWeight:600,bgcolor:"grey.100",color:"grey.700"}})})]})]})}),e.jsx(N,{children:e.jsxs(z,{direction:"row",spacing:.75,alignItems:"center",children:[e.jsx(_r,{sx:{fontSize:15,color:"grey.400"}}),e.jsxs(W,{children:[e.jsx(C,{variant:"body2",children:t.phone||"—"}),t.frequency&&e.jsx(C,{variant:"caption",color:"text.secondary",children:t.frequency})]})]})}),e.jsx(N,{children:e.jsxs(z,{direction:"row",spacing:.75,alignItems:"center",children:[e.jsx(lt,{sx:{fontSize:15,color:"grey.400"}}),e.jsxs(W,{children:[e.jsxs(C,{variant:"body2",children:[t.city||"—",t.businessState?`, ${t.businessState}`:""]}),t.neighbourhood&&e.jsx(C,{variant:"caption",color:"text.secondary",children:t.neighbourhood})]})]})}),e.jsx(N,{children:e.jsxs(z,{direction:"row",spacing:1.5,alignItems:"center",justifyContent:"center",divider:e.jsx(zt,{orientation:"vertical",flexItem:!0}),children:[e.jsx(tr,{label:"Parcels",value:Number(t.parcelVolume).toLocaleString()}),e.jsx(tr,{label:"Contracts",value:t.activeContracts,color:"primary.main"})]})}),e.jsx(N,{children:e.jsx(Kt,{status:t.status})}),e.jsxs(N,{align:"right",children:[e.jsx(At,{title:"Edit",children:e.jsx(Ne,{size:"small",onClick:s=>{s.stopPropagation(),c(t)},children:e.jsx(qt,{fontSize:"small"})})}),e.jsx(At,{title:"Delete",children:e.jsx(Ne,{size:"small",onClick:s=>{s.stopPropagation(),b(t)},children:e.jsx(Wr,{fontSize:"small"})})})]})]}),e.jsx(Ue,{children:e.jsx(N,{colSpan:8,sx:{py:0,borderBottom:$?void 0:"none"},children:e.jsx(Ar,{in:$,timeout:"auto",unmountOnExit:!0,children:e.jsxs(W,{sx:{m:2,borderRadius:2.5,border:1,borderColor:"divider",overflow:"hidden",boxShadow:"0 4px 16px rgba(0,0,0,0.06)"},children:[e.jsxs(z,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,sx:{px:2.5,py:1.75,borderBottom:1,borderColor:"divider",background:s=>`linear-gradient(90deg, ${s.palette.primary.lighter}88 0%, ${s.palette.background.paper} 75%)`},children:[e.jsxs(z,{direction:"row",spacing:1.5,alignItems:"center",children:[e.jsx(Gt,{name:t.name,size:40}),e.jsxs(W,{children:[e.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,lineHeight:1.2},children:t.name}),e.jsxs(z,{direction:"row",spacing:.75,alignItems:"center",sx:{mt:.25},children:[e.jsx(Kr,{sx:{fontSize:14,color:"grey.400"}}),e.jsx(C,{variant:"caption",color:"text.secondary",children:t.clientId})]})]}),e.jsx(Kt,{status:t.status,sx:{ml:.5}})]}),e.jsx(pe,{size:"small",variant:"contained",startIcon:e.jsx(qt,{}),onClick:()=>c(t),children:"Edit Client"})]}),e.jsx(W,{sx:{p:2.5,bgcolor:"grey.50"},children:e.jsxs(g,{container:!0,spacing:2.5,alignItems:"stretch",children:[e.jsx(g,{item:!0,xs:12,md:4,children:e.jsxs(ft,{icon:Er,title:"Business",accent:"primary",children:[e.jsxs(z,{direction:"row",spacing:1.5,children:[e.jsx(er,{label:"Parcel Volume",value:Number(t.parcelVolume).toLocaleString(),icon:pr,color:"primary"}),e.jsx(er,{label:"Active Contracts",value:t.activeContracts,icon:gr,color:"primary"})]}),e.jsx(ie,{label:"Client ID",children:e.jsx(C,{variant:"body2",sx:{fontFamily:"monospace",fontWeight:600,color:"grey.800"},children:t.clientId})}),e.jsx(ie,{label:"Business Type",children:e.jsx(be,{label:t.businessType&&ye(t.businessType),color:"primary"})}),e.jsx(ie,{label:"Order Frequency",children:e.jsx(be,{label:t.frequency&&ye(t.frequency),color:"info"})})]})}),e.jsx(g,{item:!0,xs:12,md:4,children:e.jsxs(ft,{icon:Fr,title:"Logistics",accent:"primary",children:[e.jsx(ie,{label:"Logistics Segment",children:t.logisticsSegment?e.jsx(z,{direction:"row",spacing:.75,flexWrap:"wrap",useFlexGap:!0,children:String(t.logisticsSegment).split(/[,/]/).map(s=>s.trim()).filter(Boolean).map(s=>e.jsx(be,{label:ye(s),color:"primary"},s))}):e.jsx(be,{label:null})}),e.jsx(ht,{label:"Current Provider",value:t.provider}),e.jsx(ie,{label:"Efficiency",children:e.jsx(be,{label:t.efficiency&&ye(t.efficiency),color:Xn(t.efficiency)})}),e.jsx(ie,{label:"Transit Route",children:(()=>{const s=[t.transitFrom,...String(t.transitTo||"").split(",")].map(h=>h.trim()).filter(Boolean);return s.length?e.jsx(z,{direction:"row",spacing:.75,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:s.map((h,k)=>e.jsxs(p.Fragment,{children:[k>0&&e.jsx(br,{sx:{fontSize:20,color:"primary.main"}}),e.jsx(be,{label:ye(h),color:k===0?"default":"info"})]},`${h}-${k}`))}):e.jsx(be,{label:null})})()})]})}),e.jsx(g,{item:!0,xs:12,md:4,children:e.jsxs(ft,{icon:lt,title:"Location & Survey",accent:"primary",children:[e.jsx(ie,{label:"City / State",children:e.jsx(C,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:[t.city,t.businessState].filter(Boolean).join(", ")||"—"})}),e.jsx(ht,{label:"Neighbourhood",value:t.neighbourhood}),e.jsx(ie,{label:"Survey Address",children:e.jsxs(z,{direction:"row",spacing:1,sx:{p:1.25,borderRadius:1.5,bgcolor:"grey.50",border:1,borderColor:"divider"},children:[e.jsx(lt,{sx:{fontSize:16,color:"grey.400",mt:"2px"}}),e.jsx(C,{variant:"body2",sx:{color:"grey.800",lineHeight:1.5},children:t.surveyAddress||"—"})]})}),e.jsx(ie,{label:"Coordinates",children:t.surveyLat&&t.surveyLng?e.jsxs(z,{direction:"row",spacing:1.25,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[e.jsx(At,{title:`${t.surveyLat}, ${t.surveyLng}`,arrow:!0,placement:"top",children:e.jsxs(z,{direction:"row",spacing:.5,alignItems:"center",sx:{cursor:"default"},children:[e.jsx(lt,{sx:{fontSize:16,color:"grey.400"}}),e.jsx(C,{variant:"body2",sx:{fontWeight:500,color:"grey.800",borderBottom:"1px dotted",borderColor:"grey.300"},children:[t.neighbourhood,t.city].filter(Boolean).join(", ")||"Pinned location"})]})}),e.jsx(pe,{component:"a",href:`https://www.google.com/maps?q=${t.surveyLat},${t.surveyLng}`,target:"_blank",rel:"noopener",size:"small",variant:"outlined",startIcon:e.jsx(Hr,{sx:{fontSize:16}}),sx:{py:.25,px:1.25,minWidth:0,fontSize:"0.75rem",fontWeight:600,borderRadius:5,color:"primary.main",borderColor:"primary.100",bgcolor:"primary.lighter","&:hover":{borderColor:"primary.main",bgcolor:"primary.lighter"}},children:"View on map"})]}):e.jsx(C,{variant:"body2",sx:{color:"grey.500"},children:"—"})})]})}),e.jsx(g,{item:!0,xs:12,children:e.jsx(ft,{icon:xr,title:"Contact & Compliance",accent:"primary",children:e.jsxs(g,{container:!0,spacing:2.5,children:[e.jsx(g,{item:!0,xs:12,sm:6,md:4,children:e.jsx(ht,{label:"Phone",value:t.phone})}),e.jsx(g,{item:!0,xs:12,sm:6,md:4,children:e.jsx(ie,{label:"Data Consent",children:e.jsx(be,{label:t.dataConsent&&ye(t.dataConsent),color:Zn(t.dataConsent)})})}),e.jsx(g,{item:!0,xs:12,sm:6,md:4,children:e.jsx(ht,{label:"Last Updated",value:t.lastUpdated})}),t.notes&&e.jsx(g,{item:!0,xs:12,children:e.jsxs(W,{sx:{p:2,borderRadius:1.5,bgcolor:"warning.lighter",border:1,borderColor:"warning.light"},children:[e.jsxs(z,{direction:"row",spacing:1,alignItems:"center",sx:{mb:.5},children:[e.jsx(mr,{sx:{fontSize:16,color:"warning.dark"}}),e.jsx(C,{variant:"caption",sx:{color:"warning.dark",textTransform:"uppercase",letterSpacing:.4,fontSize:"0.68rem",fontWeight:700},children:"Notes"})]}),e.jsx(C,{variant:"body2",sx:{color:"grey.800"},children:t.notes})]})})]})})})]})})]})})})})]})}function xs(){var Se;const[t,o]=p.useState([]),[c,b]=p.useState(!0),[$,I]=p.useState(null),[s]=Tr(),[h,k]=p.useState(0),[E,D]=p.useState(s.get("q")||""),[_,H]=p.useState(0),[O,ve]=p.useState(10);p.useEffect(()=>{const l=s.get("q");l!=null&&(D(l),H(0))},[s]);const[T,ge]=p.useState({open:!1,mode:"add",initial:null}),[u,v]=p.useState(null),[y,Y]=p.useState(!1),V=(l=!1)=>{l||(b(!0),I(null)),$r().then(m=>o(m.map(Lr))).catch(m=>{l||I(m.message||"Failed to load clients")}).finally(()=>{l||b(!1)})};p.useEffect(()=>{V();const l=setInterval(()=>{V(!0)},1e4);return()=>clearInterval(l)},[]);const B=p.useMemo(()=>({total:t.length,newCount:t.filter(l=>l.status==="newClient").length,parcels:t.reduce((l,m)=>l+(Number(m.parcelVolume)||0),0),contracts:t.reduce((l,m)=>l+(Number(m.activeContracts)||0),0)}),[t]),K=p.useMemo(()=>{const l=[];return t.forEach(m=>{l.includes(m.status)||l.push(m.status)}),[{key:"all",label:"All"},...l.map(m=>({key:m,label:ye(m)}))]},[t]),xe=((Se=K[Math.min(h,K.length-1)])==null?void 0:Se.key)||"all",je=p.useMemo(()=>{const l={all:t.length};return t.forEach(m=>{l[m.status]=(l[m.status]||0)+1}),l},[t]),ne=p.useMemo(()=>t.filter(l=>{const m=xe==="all"||l.status===xe,le=!E||[l.name,l.phone,l.city,l.businessType,l.clientId,l.neighbourhood].join(" ").toLowerCase().includes(E.toLowerCase());return m&&le}),[t,xe,E]),U=ne.slice(_*O,_*O+O),S=()=>{ge({open:!1,mode:"add",initial:null}),V()},Ce=async()=>{Y(!0);try{await Or(u.id),v(null),V()}catch(l){I(l.message||"Failed to delete client")}finally{Y(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Jr,{title:"Clients",breadcrumbs:[{label:"Clients"}],action:e.jsxs(z,{direction:"row",spacing:1.5,children:[e.jsx(pe,{variant:"outlined",startIcon:e.jsx(Rr,{}),onClick:V,disabled:c,children:"Refresh"}),e.jsx(pe,{variant:"contained",startIcon:e.jsx(kr,{}),onClick:()=>ge({open:!0,mode:"add",initial:null}),children:"Add Client"})]})}),e.jsxs(g,{container:!0,spacing:2.5,sx:{mb:3},children:[e.jsx(g,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(ct,{accent:!0,title:"Total Clients",value:B.total,icon:Vt,caption:"All registered"})}),e.jsx(g,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(ct,{accent:!0,title:"New Clients",value:B.newCount,icon:Br,color:"primary",caption:"Awaiting onboarding"})}),e.jsx(g,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(ct,{accent:!0,title:"Total Parcel Volume",value:B.parcels.toLocaleString(),icon:pr,color:"primary",caption:"Across all clients"})}),e.jsx(g,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(ct,{accent:!0,title:"Active Contracts",value:B.contracts,icon:gr,color:"primary",caption:"Currently running"})})]}),e.jsxs(Yr,{sx:{overflow:"hidden"},children:[e.jsxs(W,{sx:{px:2.5,py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:l=>`linear-gradient(90deg, ${l.palette.primary.lighter}66 0%, ${l.palette.background.paper} 70%)`},children:[e.jsx(W,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Vt,{fontSize:"small"})}),e.jsxs(W,{children:[e.jsx(C,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"Client Directory"}),e.jsx(C,{variant:"caption",color:"text.secondary",children:"Browse, search and manage every client account"})]})]}),e.jsxs(z,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:2},alignItems:{md:"center"},children:[e.jsx(L,{size:"small",placeholder:"Search by name, phone, city, ID…",value:E,onChange:l=>{D(l.target.value),H(0)},sx:{minWidth:300},InputProps:{startAdornment:e.jsx(Qr,{position:"start",children:e.jsx(Pr,{fontSize:"small"})})}}),e.jsx(W,{sx:{flexGrow:1}}),!c&&e.jsxs(z,{direction:"row",spacing:1,alignItems:"center",children:[e.jsxs(C,{variant:"body2",color:"text.secondary",children:[ne.length," ",ne.length===1?"client":"clients"]}),e.jsx(vt,{size:"small",label:"live · doormile_clients",sx:{height:22,fontSize:"0.7rem",bgcolor:"success.lighter",color:"success.dark",fontWeight:600}})]})]}),e.jsx(W,{sx:{px:2,borderBottom:1,borderColor:"divider"},children:e.jsx(Vr,{value:Math.min(h,K.length-1),onChange:(l,m)=>{k(m),H(0)},variant:"scrollable",scrollButtons:"auto",children:K.map((l,m)=>e.jsx(Gr,{label:e.jsx(qr,{label:l.label,count:je[l.key]||0,active:h===m})},l.key))})}),$&&e.jsx(hr,{severity:"error",sx:{m:2},action:e.jsx(pe,{color:"inherit",size:"small",onClick:V,children:"Retry"}),children:$}),e.jsx(en,{children:e.jsxs(tn,{sx:{minWidth:900},children:[e.jsx(rn,{children:e.jsxs(Ue,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(N,{padding:"checkbox"}),e.jsx(N,{children:"ID"}),e.jsx(N,{children:"Client"}),e.jsx(N,{children:"Contact"}),e.jsx(N,{children:"Location"}),e.jsx(N,{align:"center",children:"Volume"}),e.jsx(N,{children:"Status"}),e.jsx(N,{align:"right",children:"Actions"})]})}),e.jsx(nn,{children:c?e.jsx(Ue,{children:e.jsx(N,{colSpan:8,sx:{border:"none"},children:e.jsx(W,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(xt,{})})})}):U.length===0?e.jsx(Ue,{children:e.jsx(N,{colSpan:8,sx:{border:"none"},children:e.jsx(zr,{title:"No clients found",caption:"Try a different tab or search term, or add a client."})})}):U.map((l,m)=>e.jsx(Qn,{row:l,index:_*O+m,onEdit:le=>ge({open:!0,mode:"edit",initial:le}),onDelete:le=>v(le)},l.id))})]})}),e.jsx(wr,{component:"div",count:ne.length,page:_,onPageChange:(l,m)=>H(m),rowsPerPage:O,onRowsPerPageChange:l=>{ve(+l.target.value),H(0)},rowsPerPageOptions:[5,10,25]})]}),e.jsx(Jn,{open:T.open,mode:T.mode,initial:T.initial,onClose:()=>ge({open:!1,mode:"add",initial:null}),onSaved:S}),e.jsxs(lr,{open:!!u,onClose:y?void 0:()=>v(null),children:[e.jsx(cr,{children:"Delete client?"}),e.jsx(ur,{children:e.jsxs(Dr,{children:["This will permanently remove ",e.jsx("strong",{children:u==null?void 0:u.name})," from the doormile_clients collection. This cannot be undone."]})}),e.jsxs(dr,{sx:{px:3,py:2},children:[e.jsx(pe,{onClick:()=>v(null),disabled:y,children:"Cancel"}),e.jsx(pe,{color:"error",variant:"contained",onClick:Ce,disabled:y,startIcon:y?e.jsx(xt,{size:16,color:"inherit"}):null,children:"Delete"})]})]})]})}export{xs as default}; diff --git a/dist/assets/TextField-COVOKpzm.js b/dist/assets/TextField-BARvBB_z.js similarity index 99% rename from dist/assets/TextField-COVOKpzm.js rename to dist/assets/TextField-BARvBB_z.js index 8e98a90..5beff08 100644 --- a/dist/assets/TextField-COVOKpzm.js +++ b/dist/assets/TextField-BARvBB_z.js @@ -1 +1 @@ -import{_ as r,z as Se,m as A,l as U,a5 as co,j as m,a as f,n as K,o as T,ay as ke,a6 as Pe,v as _,w as C,az as Me,aA as Oe,a4 as Q,aB as Ne,aC as we,aD as Fe,aE as po,aF as $e,av as fo,p as Y,q,aq as de,ar as ue,h as De,y as Je,a3 as mo,aG as bo,u as Qe,aH as vo,aI as go,aJ as ho}from"./index-Dg-wT72v.js";function xo(e){return U("MuiInput",e)}const le=r({},Se,A("MuiInput",["root","underline","input"]));function Co(e){return U("MuiOutlinedInput",e)}const J=r({},Se,A("MuiOutlinedInput",["root","notchedOutline","input"]));function Io(e){return U("MuiFilledInput",e)}const ee=r({},Se,A("MuiFilledInput",["root","underline","input"])),Ro=co(m.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),yo=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],Fo=e=>{const{classes:o,disableUnderline:t}=e,s=_({root:["root",!t&&"underline"],input:["input"]},Io,o);return r({},o,s)},$o=C(Me,{shouldForwardProp:e=>Q(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Oe(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{var t;const n=e.palette.mode==="light",s=n?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",d=n?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=n?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",u=n?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return r({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:d,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:d}},[`&.${ee.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:d},[`&.${ee.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:u}},!o.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t=(e.vars||e).palette[o.color||"primary"])==null?void 0:t.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ee.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ee.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:s}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ee.disabled}, .${ee.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${ee.disabled}:before`]:{borderBottomStyle:"dotted"}},o.startAdornment&&{paddingLeft:12},o.endAdornment&&{paddingRight:12},o.multiline&&r({padding:"25px 12px 8px"},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9}))}),So=C(Ne,{name:"MuiFilledInput",slot:"Input",overridesResolver:we})(({theme:e,ownerState:o})=>r({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9},o.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),Le=f.forwardRef(function(o,t){var n,s,d,a;const u=K({props:o,name:"MuiFilledInput"}),{components:c={},componentsProps:l,fullWidth:p=!1,inputComponent:v="input",multiline:g=!1,slotProps:I,slots:x={},type:S="text"}=u,F=T(u,yo),$=r({},u,{fullWidth:p,inputComponent:v,multiline:g,type:S}),R=Fo(u),k={root:{ownerState:$},input:{ownerState:$}},b=I??l?ke(k,I??l):k,w=(n=(s=x.root)!=null?s:c.Root)!=null?n:$o,O=(d=(a=x.input)!=null?a:c.Input)!=null?d:So;return m.jsx(Pe,r({slots:{root:w,input:O},componentsProps:b,fullWidth:p,inputComponent:v,multiline:g,ref:t,type:S},F,{classes:R}))});Le.muiName="Input";function ko(e){return U("MuiFormControl",e)}A("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Po=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Mo=e=>{const{classes:o,margin:t,fullWidth:n}=e,s={root:["root",t!=="none"&&`margin${q(t)}`,n&&"fullWidth"]};return _(s,ko,o)},Oo=C("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},o)=>r({},o.root,o[`margin${q(e.margin)}`],e.fullWidth&&o.fullWidth)})(({ownerState:e})=>r({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},e.margin==="normal"&&{marginTop:16,marginBottom:8},e.margin==="dense"&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),No=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiFormControl"}),{children:s,className:d,color:a="primary",component:u="div",disabled:c=!1,error:l=!1,focused:p,fullWidth:v=!1,hiddenLabel:g=!1,margin:I="none",required:x=!1,size:S="medium",variant:F="outlined"}=n,$=T(n,Po),R=r({},n,{color:a,component:u,disabled:c,error:l,fullWidth:v,hiddenLabel:g,margin:I,required:x,size:S,variant:F}),k=Mo(R),[b,w]=f.useState(()=>{let P=!1;return s&&f.Children.forEach(s,M=>{if(!Fe(M,["Input","Select"]))return;const E=Fe(M,["Select"])?M.props.input:M;E&&po(E.props)&&(P=!0)}),P}),[O,L]=f.useState(()=>{let P=!1;return s&&f.Children.forEach(s,M=>{Fe(M,["Input","Select"])&&($e(M.props,!0)||$e(M.props.inputProps,!0))&&(P=!0)}),P}),[z,j]=f.useState(!1);c&&z&&j(!1);const D=p!==void 0&&!c?p:z;let H;const V=f.useMemo(()=>({adornedStart:b,setAdornedStart:w,color:a,disabled:c,error:l,filled:O,focused:D,fullWidth:v,hiddenLabel:g,size:S,onBlur:()=>{j(!1)},onEmpty:()=>{L(!1)},onFilled:()=>{L(!0)},onFocus:()=>{j(!0)},registerEffect:H,required:x,variant:F}),[b,a,c,l,O,D,v,g,H,x,S,F]);return m.jsx(fo.Provider,{value:V,children:m.jsx(Oo,r({as:u,ownerState:R,className:Y(k.root,d),ref:t},$,{children:s}))})});function wo(e){return U("MuiFormHelperText",e)}const He=A("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Ve;const Lo=["children","className","component","disabled","error","filled","focused","margin","required","variant"],Wo=e=>{const{classes:o,contained:t,size:n,disabled:s,error:d,filled:a,focused:u,required:c}=e,l={root:["root",s&&"disabled",d&&"error",n&&`size${q(n)}`,t&&"contained",u&&"focused",a&&"filled",c&&"required"]};return _(l,wo,o)},Bo=C("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.size&&o[`size${q(t.size)}`],t.contained&&o.contained,t.filled&&o.filled]}})(({theme:e,ownerState:o})=>r({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${He.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${He.error}`]:{color:(e.vars||e).palette.error.main}},o.size==="small"&&{marginTop:4},o.contained&&{marginLeft:14,marginRight:14})),To=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiFormHelperText"}),{children:s,className:d,component:a="p"}=n,u=T(n,Lo),c=de(),l=ue({props:n,muiFormControl:c,states:["variant","size","disabled","error","filled","focused","required"]}),p=r({},n,{component:a,contained:l.variant==="filled"||l.variant==="outlined",variant:l.variant,size:l.size,disabled:l.disabled,error:l.error,filled:l.filled,focused:l.focused,required:l.required}),v=Wo(p);return m.jsx(Bo,r({as:a,ownerState:p,className:Y(v.root,d),ref:t},u,{children:s===" "?Ve||(Ve=m.jsx("span",{className:"notranslate",children:"​"})):s}))});function zo(e){return U("MuiFormLabel",e)}const ae=A("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Eo=["children","className","color","component","disabled","error","filled","focused","required"],jo=e=>{const{classes:o,color:t,focused:n,disabled:s,error:d,filled:a,required:u}=e,c={root:["root",`color${q(t)}`,s&&"disabled",d&&"error",a&&"filled",n&&"focused",u&&"required"],asterisk:["asterisk",d&&"error"]};return _(c,zo,o)},Ao=C("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},o)=>r({},o.root,e.color==="secondary"&&o.colorSecondary,e.filled&&o.filled)})(({theme:e,ownerState:o})=>r({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${ae.focused}`]:{color:(e.vars||e).palette[o.color].main},[`&.${ae.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ae.error}`]:{color:(e.vars||e).palette.error.main}})),Uo=C("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(({theme:e})=>({[`&.${ae.error}`]:{color:(e.vars||e).palette.error.main}})),_o=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiFormLabel"}),{children:s,className:d,component:a="label"}=n,u=T(n,Eo),c=de(),l=ue({props:n,muiFormControl:c,states:["color","required","focused","disabled","error","filled"]}),p=r({},n,{color:l.color||"primary",component:a,disabled:l.disabled,error:l.error,filled:l.filled,focused:l.focused,required:l.required}),v=jo(p);return m.jsxs(Ao,r({as:a,ownerState:p,className:Y(v.root,d),ref:t},u,{children:[s,l.required&&m.jsxs(Uo,{ownerState:p,"aria-hidden":!0,className:v.asterisk,children:[" ","*"]})]}))}),qo=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],Do=e=>{const{classes:o,disableUnderline:t}=e,s=_({root:["root",!t&&"underline"],input:["input"]},xo,o);return r({},o,s)},Ho=C(Me,{shouldForwardProp:e=>Q(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Oe(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),r({position:"relative"},o.formControl&&{"label + &":{marginTop:16}},!o.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[o.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${le.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${le.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${le.disabled}, .${le.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${le.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Vo=C(Ne,{name:"MuiInput",slot:"Input",overridesResolver:we})({}),We=f.forwardRef(function(o,t){var n,s,d,a;const u=K({props:o,name:"MuiInput"}),{disableUnderline:c,components:l={},componentsProps:p,fullWidth:v=!1,inputComponent:g="input",multiline:I=!1,slotProps:x,slots:S={},type:F="text"}=u,$=T(u,qo),R=Do(u),b={root:{ownerState:{disableUnderline:c}}},w=x??p?ke(x??p,b):b,O=(n=(s=S.root)!=null?s:l.Root)!=null?n:Ho,L=(d=(a=S.input)!=null?a:l.Input)!=null?d:Vo;return m.jsx(Pe,r({slots:{root:O,input:L},slotProps:w,fullWidth:v,inputComponent:g,multiline:I,ref:t,type:F},$,{classes:R}))});We.muiName="Input";function Ko(e){return U("MuiInputLabel",e)}A("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Xo=["disableAnimation","margin","shrink","variant","className"],Go=e=>{const{classes:o,formControl:t,size:n,shrink:s,disableAnimation:d,variant:a,required:u}=e,c={root:["root",t&&"formControl",!d&&"animated",s&&"shrink",n&&n!=="normal"&&`size${q(n)}`,a],asterisk:[u&&"asterisk"]},l=_(c,Ko,o);return r({},o,l)},Jo=C(_o,{shouldForwardProp:e=>Q(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`& .${ae.asterisk}`]:o.asterisk},o.root,t.formControl&&o.formControl,t.size==="small"&&o.sizeSmall,t.shrink&&o.shrink,!t.disableAnimation&&o.animated,t.focused&&o.focused,o[t.variant]]}})(({theme:e,ownerState:o})=>r({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},o.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},o.size==="small"&&{transform:"translate(0, 17px) scale(1)"},o.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!o.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},o.variant==="filled"&&r({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},o.shrink&&r({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},o.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),o.variant==="outlined"&&r({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},o.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),Qo=f.forwardRef(function(o,t){const n=K({name:"MuiInputLabel",props:o}),{disableAnimation:s=!1,shrink:d,className:a}=n,u=T(n,Xo),c=de();let l=d;typeof l>"u"&&c&&(l=c.filled||c.focused||c.adornedStart);const p=ue({props:n,muiFormControl:c,states:["size","variant","required","focused"]}),v=r({},n,{disableAnimation:s,formControl:c,shrink:l,size:p.size,variant:p.variant,required:p.required,focused:p.focused}),g=Go(v);return m.jsx(Jo,r({"data-shrink":l,ownerState:v,ref:t,className:Y(g.root,a)},u,{classes:g}))});function Yo(e){return U("MuiNativeSelect",e)}const Be=A("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Zo=["className","disabled","error","IconComponent","inputRef","variant"],et=e=>{const{classes:o,variant:t,disabled:n,multiple:s,open:d,error:a}=e,u={select:["select",t,n&&"disabled",s&&"multiple",a&&"error"],icon:["icon",`icon${q(t)}`,d&&"iconOpen",n&&"disabled"]};return _(u,Yo,o)},Ye=({ownerState:e,theme:o})=>r({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":r({},o.vars?{backgroundColor:`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:o.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${Be.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}}),ot=C("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Q,overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.select,o[t.variant],t.error&&o.error,{[`&.${Be.multiple}`]:o.multiple}]}})(Ye),Ze=({ownerState:e,theme:o})=>r({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${Be.disabled}`]:{color:(o.vars||o).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),tt=C("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${q(t.variant)}`],t.open&&o.iconOpen]}})(Ze),nt=f.forwardRef(function(o,t){const{className:n,disabled:s,error:d,IconComponent:a,inputRef:u,variant:c="standard"}=o,l=T(o,Zo),p=r({},o,{disabled:s,variant:c,error:d}),v=et(p);return m.jsxs(f.Fragment,{children:[m.jsx(ot,r({ownerState:p,className:Y(v.select,n),disabled:s,ref:u||t},l)),o.multiple?null:m.jsx(tt,{as:a,ownerState:p,className:v.icon})]})});var Ke;const rt=["children","classes","className","label","notched"],st=C("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:Q})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),lt=C("legend",{name:"MuiNotchedOutlined",shouldForwardProp:Q})(({ownerState:e,theme:o})=>r({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})},e.withLabel&&r({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})})));function it(e){const{className:o,label:t,notched:n}=e,s=T(e,rt),d=t!=null&&t!=="",a=r({},e,{notched:n,withLabel:d});return m.jsx(st,r({"aria-hidden":!0,className:o,ownerState:a},s,{children:m.jsx(lt,{ownerState:a,children:d?m.jsx("span",{children:t}):Ke||(Ke=m.jsx("span",{className:"notranslate",children:"​"}))})}))}const at=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],dt=e=>{const{classes:o}=e,n=_({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Co,o);return r({},o,n)},ut=C(Me,{shouldForwardProp:e=>Q(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Oe})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return r({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${J.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${J.focused} .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette[o.color].main,borderWidth:2},[`&.${J.error} .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${J.disabled} .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},o.startAdornment&&{paddingLeft:14},o.endAdornment&&{paddingRight:14},o.multiline&&r({padding:"16.5px 14px"},o.size==="small"&&{padding:"8.5px 14px"}))}),ct=C(it,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,o)=>o.notchedOutline})(({theme:e})=>{const o=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:o}}),pt=C(Ne,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:we})(({theme:e,ownerState:o})=>r({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{padding:"8.5px 14px"},o.multiline&&{padding:0},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0})),Te=f.forwardRef(function(o,t){var n,s,d,a,u;const c=K({props:o,name:"MuiOutlinedInput"}),{components:l={},fullWidth:p=!1,inputComponent:v="input",label:g,multiline:I=!1,notched:x,slots:S={},type:F="text"}=c,$=T(c,at),R=dt(c),k=de(),b=ue({props:c,muiFormControl:k,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),w=r({},c,{color:b.color||"primary",disabled:b.disabled,error:b.error,focused:b.focused,formControl:k,fullWidth:p,hiddenLabel:b.hiddenLabel,multiline:I,size:b.size,type:F}),O=(n=(s=S.root)!=null?s:l.Root)!=null?n:ut,L=(d=(a=S.input)!=null?a:l.Input)!=null?d:pt;return m.jsx(Pe,r({slots:{root:O,input:L},renderSuffix:z=>m.jsx(ct,{ownerState:w,className:R.notchedOutline,label:g!=null&&g!==""&&b.required?u||(u=m.jsxs(f.Fragment,{children:[g," ","*"]})):g,notched:typeof x<"u"?x:!!(z.startAdornment||z.filled||z.focused)}),fullWidth:p,inputComponent:v,multiline:I,ref:t,type:F},$,{classes:r({},R,{notchedOutline:null})}))});Te.muiName="Input";function ft(e){return U("MuiSelect",e)}const ie=A("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Xe;const mt=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],bt=C("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`&.${ie.select}`]:o.select},{[`&.${ie.select}`]:o[t.variant]},{[`&.${ie.error}`]:o.error},{[`&.${ie.multiple}`]:o.multiple}]}})(Ye,{[`&.${ie.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),vt=C("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${q(t.variant)}`],t.open&&o.iconOpen]}})(Ze),gt=C("input",{shouldForwardProp:e=>go(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,o)=>o.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Ge(e,o){return typeof o=="object"&&o!==null?e===o:String(e)===String(o)}function ht(e){return e==null||typeof e=="string"&&!e.trim()}const xt=e=>{const{classes:o,variant:t,disabled:n,multiple:s,open:d,error:a}=e,u={select:["select",t,n&&"disabled",s&&"multiple",a&&"error"],icon:["icon",`icon${q(t)}`,d&&"iconOpen",n&&"disabled"],nativeInput:["nativeInput"]};return _(u,ft,o)},Ct=f.forwardRef(function(o,t){var n;const{"aria-describedby":s,"aria-label":d,autoFocus:a,autoWidth:u,children:c,className:l,defaultOpen:p,defaultValue:v,disabled:g,displayEmpty:I,error:x=!1,IconComponent:S,inputRef:F,labelId:$,MenuProps:R={},multiple:k,name:b,onBlur:w,onChange:O,onClose:L,onFocus:z,onOpen:j,open:D,readOnly:H,renderValue:V,SelectDisplayProps:P={},tabIndex:M,value:E,variant:X="standard"}=o,G=T(o,mt),[y,Z]=De({controlled:E,default:v,name:"Select"}),[ce,pe]=De({controlled:D,default:p,name:"Select"}),fe=f.useRef(null),B=f.useRef(null),[W,re]=f.useState(null),{current:oe}=f.useRef(D!=null),[Ce,se]=f.useState(),oo=Je(t,F),to=f.useCallback(i=>{B.current=i,i&&re(i)},[]),me=W==null?void 0:W.parentNode;f.useImperativeHandle(oo,()=>({focus:()=>{B.current.focus()},node:fe.current,value:y}),[y]),f.useEffect(()=>{p&&ce&&W&&!oe&&(se(u?null:me.clientWidth),B.current.focus())},[W,u]),f.useEffect(()=>{a&&B.current.focus()},[a]),f.useEffect(()=>{if(!$)return;const i=mo(B.current).getElementById($);if(i){const h=()=>{getSelection().isCollapsed&&B.current.focus()};return i.addEventListener("click",h),()=>{i.removeEventListener("click",h)}}},[$]);const be=(i,h)=>{i?j&&j(h):L&&L(h),oe||(se(u?null:me.clientWidth),pe(i))},no=i=>{i.button===0&&(i.preventDefault(),B.current.focus(),be(!0,i))},ro=i=>{be(!1,i)},Ee=f.Children.toArray(c),so=i=>{const h=Ee.find(N=>N.props.value===i.target.value);h!==void 0&&(Z(h.props.value),O&&O(i,h))},lo=i=>h=>{let N;if(h.currentTarget.hasAttribute("tabindex")){if(k){N=Array.isArray(y)?y.slice():[];const ne=y.indexOf(i.props.value);ne===-1?N.push(i.props.value):N.splice(ne,1)}else N=i.props.value;if(i.props.onClick&&i.props.onClick(h),y!==N&&(Z(N),O)){const ne=h.nativeEvent||h,qe=new ne.constructor(ne.type,ne);Object.defineProperty(qe,"target",{writable:!0,value:{value:N,name:b}}),O(qe,i)}k||be(!1,h)}},io=i=>{H||[" ","ArrowUp","ArrowDown","Enter"].indexOf(i.key)!==-1&&(i.preventDefault(),be(!0,i))},ve=W!==null&&ce,ao=i=>{!ve&&w&&(Object.defineProperty(i,"target",{writable:!0,value:{value:y,name:b}}),w(i))};delete G["aria-invalid"];let te,je;const ge=[];let he=!1;($e({value:y})||I)&&(V?te=V(y):he=!0);const uo=Ee.map(i=>{if(!f.isValidElement(i))return null;let h;if(k){if(!Array.isArray(y))throw new Error(bo(2));h=y.some(N=>Ge(N,i.props.value)),h&&he&&ge.push(i.props.children)}else h=Ge(y,i.props.value),h&&he&&(je=i.props.children);return f.cloneElement(i,{"aria-selected":h?"true":"false",onClick:lo(i),onKeyUp:N=>{N.key===" "&&N.preventDefault(),i.props.onKeyUp&&i.props.onKeyUp(N)},role:"option",selected:h,value:void 0,"data-value":i.props.value})});he&&(k?ge.length===0?te=null:te=ge.reduce((i,h,N)=>(i.push(h),N{const{classes:o}=e;return o},ze={name:"MuiSelect",overridesResolver:(e,o)=>o.root,shouldForwardProp:e=>Q(e)&&e!=="variant",slot:"Root"},Ft=C(We,ze)(""),$t=C(Te,ze)(""),St=C(Le,ze)(""),eo=f.forwardRef(function(o,t){const n=K({name:"MuiSelect",props:o}),{autoWidth:s=!1,children:d,classes:a={},className:u,defaultOpen:c=!1,displayEmpty:l=!1,IconComponent:p=Ro,id:v,input:g,inputProps:I,label:x,labelId:S,MenuProps:F,multiple:$=!1,native:R=!1,onClose:k,onOpen:b,open:w,renderValue:O,SelectDisplayProps:L,variant:z="outlined"}=n,j=T(n,It),D=R?nt:Ct,H=de(),V=ue({props:n,muiFormControl:H,states:["variant","error"]}),P=V.variant||z,M=r({},n,{variant:P,classes:a}),E=yt(M),X=T(E,Rt),G=g||{standard:m.jsx(Ft,{ownerState:M}),outlined:m.jsx($t,{label:x,ownerState:M}),filled:m.jsx(St,{ownerState:M})}[P],y=Je(t,ho(G));return m.jsx(f.Fragment,{children:f.cloneElement(G,r({inputComponent:D,inputProps:r({children:d,error:V.error,IconComponent:p,variant:P,type:void 0,multiple:$},R?{id:v}:{autoWidth:s,defaultOpen:c,displayEmpty:l,labelId:S,MenuProps:F,onClose:k,onOpen:b,open:w,renderValue:O,SelectDisplayProps:r({id:v},L)},I,{classes:I?ke(X,I.classes):X},g?g.props.inputProps:{})},($&&R||l)&&P==="outlined"?{notched:!0}:{},{ref:y,className:Y(G.props.className,u,E.root)},!g&&{variant:P},j))})});eo.muiName="Select";function kt(e){return U("MuiTextField",e)}A("MuiTextField",["root"]);const Pt=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],Mt={standard:We,filled:Le,outlined:Te},Ot=e=>{const{classes:o}=e;return _({root:["root"]},kt,o)},Nt=C(No,{name:"MuiTextField",slot:"Root",overridesResolver:(e,o)=>o.root})({}),Lt=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiTextField"}),{autoComplete:s,autoFocus:d=!1,children:a,className:u,color:c="primary",defaultValue:l,disabled:p=!1,error:v=!1,FormHelperTextProps:g,fullWidth:I=!1,helperText:x,id:S,InputLabelProps:F,inputProps:$,InputProps:R,inputRef:k,label:b,maxRows:w,minRows:O,multiline:L=!1,name:z,onBlur:j,onChange:D,onFocus:H,placeholder:V,required:P=!1,rows:M,select:E=!1,SelectProps:X,type:G,value:y,variant:Z="outlined"}=n,ce=T(n,Pt),pe=r({},n,{autoFocus:d,color:c,disabled:p,error:v,fullWidth:I,multiline:L,required:P,select:E,variant:Z}),fe=Ot(pe),B={};Z==="outlined"&&(F&&typeof F.shrink<"u"&&(B.notched=F.shrink),B.label=b),E&&((!X||!X.native)&&(B.id=void 0),B["aria-describedby"]=void 0);const W=Qe(S),re=x&&W?`${W}-helper-text`:void 0,oe=b&&W?`${W}-label`:void 0,Ce=Mt[Z],se=m.jsx(Ce,r({"aria-describedby":re,autoComplete:s,autoFocus:d,defaultValue:l,fullWidth:I,multiline:L,name:z,rows:M,maxRows:w,minRows:O,type:G,value:y,id:W,inputRef:k,onBlur:j,onChange:D,onFocus:H,placeholder:V,inputProps:$},B,R));return m.jsxs(Nt,r({className:Y(fe.root,u),disabled:p,error:v,fullWidth:I,ref:t,required:P,color:c,variant:Z,ownerState:pe},ce,{children:[b!=null&&b!==""&&m.jsx(Qo,r({htmlFor:W,id:oe},F,{children:b})),E?m.jsx(eo,r({"aria-describedby":re,id:W,labelId:oe,value:y,input:se},X,{children:a})):se,x&&m.jsx(To,r({id:re},g,{children:x}))]}))});export{Ro as A,No as F,Te as O,eo as S,Lt as T,ee as f,le as i,J as o}; +import{_ as r,z as Se,m as A,l as U,a5 as co,j as m,a as f,n as K,o as T,ay as ke,a6 as Pe,v as _,w as C,az as Me,aA as Oe,a4 as Q,aB as Ne,aC as we,aD as Fe,aE as po,aF as $e,av as fo,p as Y,q,aq as de,ar as ue,h as De,y as Je,a3 as mo,aG as bo,u as Qe,aH as vo,aI as go,aJ as ho}from"./index-J0uxx8As.js";function xo(e){return U("MuiInput",e)}const le=r({},Se,A("MuiInput",["root","underline","input"]));function Co(e){return U("MuiOutlinedInput",e)}const J=r({},Se,A("MuiOutlinedInput",["root","notchedOutline","input"]));function Io(e){return U("MuiFilledInput",e)}const ee=r({},Se,A("MuiFilledInput",["root","underline","input"])),Ro=co(m.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),yo=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],Fo=e=>{const{classes:o,disableUnderline:t}=e,s=_({root:["root",!t&&"underline"],input:["input"]},Io,o);return r({},o,s)},$o=C(Me,{shouldForwardProp:e=>Q(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Oe(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{var t;const n=e.palette.mode==="light",s=n?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",d=n?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=n?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",u=n?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return r({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:d,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:d}},[`&.${ee.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:d},[`&.${ee.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:u}},!o.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t=(e.vars||e).palette[o.color||"primary"])==null?void 0:t.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ee.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ee.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:s}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ee.disabled}, .${ee.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${ee.disabled}:before`]:{borderBottomStyle:"dotted"}},o.startAdornment&&{paddingLeft:12},o.endAdornment&&{paddingRight:12},o.multiline&&r({padding:"25px 12px 8px"},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9}))}),So=C(Ne,{name:"MuiFilledInput",slot:"Input",overridesResolver:we})(({theme:e,ownerState:o})=>r({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9},o.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),Le=f.forwardRef(function(o,t){var n,s,d,a;const u=K({props:o,name:"MuiFilledInput"}),{components:c={},componentsProps:l,fullWidth:p=!1,inputComponent:v="input",multiline:g=!1,slotProps:I,slots:x={},type:S="text"}=u,F=T(u,yo),$=r({},u,{fullWidth:p,inputComponent:v,multiline:g,type:S}),R=Fo(u),k={root:{ownerState:$},input:{ownerState:$}},b=I??l?ke(k,I??l):k,w=(n=(s=x.root)!=null?s:c.Root)!=null?n:$o,O=(d=(a=x.input)!=null?a:c.Input)!=null?d:So;return m.jsx(Pe,r({slots:{root:w,input:O},componentsProps:b,fullWidth:p,inputComponent:v,multiline:g,ref:t,type:S},F,{classes:R}))});Le.muiName="Input";function ko(e){return U("MuiFormControl",e)}A("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Po=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Mo=e=>{const{classes:o,margin:t,fullWidth:n}=e,s={root:["root",t!=="none"&&`margin${q(t)}`,n&&"fullWidth"]};return _(s,ko,o)},Oo=C("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},o)=>r({},o.root,o[`margin${q(e.margin)}`],e.fullWidth&&o.fullWidth)})(({ownerState:e})=>r({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},e.margin==="normal"&&{marginTop:16,marginBottom:8},e.margin==="dense"&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),No=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiFormControl"}),{children:s,className:d,color:a="primary",component:u="div",disabled:c=!1,error:l=!1,focused:p,fullWidth:v=!1,hiddenLabel:g=!1,margin:I="none",required:x=!1,size:S="medium",variant:F="outlined"}=n,$=T(n,Po),R=r({},n,{color:a,component:u,disabled:c,error:l,fullWidth:v,hiddenLabel:g,margin:I,required:x,size:S,variant:F}),k=Mo(R),[b,w]=f.useState(()=>{let P=!1;return s&&f.Children.forEach(s,M=>{if(!Fe(M,["Input","Select"]))return;const E=Fe(M,["Select"])?M.props.input:M;E&&po(E.props)&&(P=!0)}),P}),[O,L]=f.useState(()=>{let P=!1;return s&&f.Children.forEach(s,M=>{Fe(M,["Input","Select"])&&($e(M.props,!0)||$e(M.props.inputProps,!0))&&(P=!0)}),P}),[z,j]=f.useState(!1);c&&z&&j(!1);const D=p!==void 0&&!c?p:z;let H;const V=f.useMemo(()=>({adornedStart:b,setAdornedStart:w,color:a,disabled:c,error:l,filled:O,focused:D,fullWidth:v,hiddenLabel:g,size:S,onBlur:()=>{j(!1)},onEmpty:()=>{L(!1)},onFilled:()=>{L(!0)},onFocus:()=>{j(!0)},registerEffect:H,required:x,variant:F}),[b,a,c,l,O,D,v,g,H,x,S,F]);return m.jsx(fo.Provider,{value:V,children:m.jsx(Oo,r({as:u,ownerState:R,className:Y(k.root,d),ref:t},$,{children:s}))})});function wo(e){return U("MuiFormHelperText",e)}const He=A("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Ve;const Lo=["children","className","component","disabled","error","filled","focused","margin","required","variant"],Wo=e=>{const{classes:o,contained:t,size:n,disabled:s,error:d,filled:a,focused:u,required:c}=e,l={root:["root",s&&"disabled",d&&"error",n&&`size${q(n)}`,t&&"contained",u&&"focused",a&&"filled",c&&"required"]};return _(l,wo,o)},Bo=C("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.size&&o[`size${q(t.size)}`],t.contained&&o.contained,t.filled&&o.filled]}})(({theme:e,ownerState:o})=>r({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${He.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${He.error}`]:{color:(e.vars||e).palette.error.main}},o.size==="small"&&{marginTop:4},o.contained&&{marginLeft:14,marginRight:14})),To=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiFormHelperText"}),{children:s,className:d,component:a="p"}=n,u=T(n,Lo),c=de(),l=ue({props:n,muiFormControl:c,states:["variant","size","disabled","error","filled","focused","required"]}),p=r({},n,{component:a,contained:l.variant==="filled"||l.variant==="outlined",variant:l.variant,size:l.size,disabled:l.disabled,error:l.error,filled:l.filled,focused:l.focused,required:l.required}),v=Wo(p);return m.jsx(Bo,r({as:a,ownerState:p,className:Y(v.root,d),ref:t},u,{children:s===" "?Ve||(Ve=m.jsx("span",{className:"notranslate",children:"​"})):s}))});function zo(e){return U("MuiFormLabel",e)}const ae=A("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Eo=["children","className","color","component","disabled","error","filled","focused","required"],jo=e=>{const{classes:o,color:t,focused:n,disabled:s,error:d,filled:a,required:u}=e,c={root:["root",`color${q(t)}`,s&&"disabled",d&&"error",a&&"filled",n&&"focused",u&&"required"],asterisk:["asterisk",d&&"error"]};return _(c,zo,o)},Ao=C("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},o)=>r({},o.root,e.color==="secondary"&&o.colorSecondary,e.filled&&o.filled)})(({theme:e,ownerState:o})=>r({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${ae.focused}`]:{color:(e.vars||e).palette[o.color].main},[`&.${ae.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ae.error}`]:{color:(e.vars||e).palette.error.main}})),Uo=C("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(({theme:e})=>({[`&.${ae.error}`]:{color:(e.vars||e).palette.error.main}})),_o=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiFormLabel"}),{children:s,className:d,component:a="label"}=n,u=T(n,Eo),c=de(),l=ue({props:n,muiFormControl:c,states:["color","required","focused","disabled","error","filled"]}),p=r({},n,{color:l.color||"primary",component:a,disabled:l.disabled,error:l.error,filled:l.filled,focused:l.focused,required:l.required}),v=jo(p);return m.jsxs(Ao,r({as:a,ownerState:p,className:Y(v.root,d),ref:t},u,{children:[s,l.required&&m.jsxs(Uo,{ownerState:p,"aria-hidden":!0,className:v.asterisk,children:[" ","*"]})]}))}),qo=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],Do=e=>{const{classes:o,disableUnderline:t}=e,s=_({root:["root",!t&&"underline"],input:["input"]},xo,o);return r({},o,s)},Ho=C(Me,{shouldForwardProp:e=>Q(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Oe(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),r({position:"relative"},o.formControl&&{"label + &":{marginTop:16}},!o.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[o.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${le.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${le.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${le.disabled}, .${le.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${le.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Vo=C(Ne,{name:"MuiInput",slot:"Input",overridesResolver:we})({}),We=f.forwardRef(function(o,t){var n,s,d,a;const u=K({props:o,name:"MuiInput"}),{disableUnderline:c,components:l={},componentsProps:p,fullWidth:v=!1,inputComponent:g="input",multiline:I=!1,slotProps:x,slots:S={},type:F="text"}=u,$=T(u,qo),R=Do(u),b={root:{ownerState:{disableUnderline:c}}},w=x??p?ke(x??p,b):b,O=(n=(s=S.root)!=null?s:l.Root)!=null?n:Ho,L=(d=(a=S.input)!=null?a:l.Input)!=null?d:Vo;return m.jsx(Pe,r({slots:{root:O,input:L},slotProps:w,fullWidth:v,inputComponent:g,multiline:I,ref:t,type:F},$,{classes:R}))});We.muiName="Input";function Ko(e){return U("MuiInputLabel",e)}A("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Xo=["disableAnimation","margin","shrink","variant","className"],Go=e=>{const{classes:o,formControl:t,size:n,shrink:s,disableAnimation:d,variant:a,required:u}=e,c={root:["root",t&&"formControl",!d&&"animated",s&&"shrink",n&&n!=="normal"&&`size${q(n)}`,a],asterisk:[u&&"asterisk"]},l=_(c,Ko,o);return r({},o,l)},Jo=C(_o,{shouldForwardProp:e=>Q(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`& .${ae.asterisk}`]:o.asterisk},o.root,t.formControl&&o.formControl,t.size==="small"&&o.sizeSmall,t.shrink&&o.shrink,!t.disableAnimation&&o.animated,t.focused&&o.focused,o[t.variant]]}})(({theme:e,ownerState:o})=>r({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},o.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},o.size==="small"&&{transform:"translate(0, 17px) scale(1)"},o.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!o.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},o.variant==="filled"&&r({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},o.shrink&&r({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},o.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),o.variant==="outlined"&&r({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},o.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),Qo=f.forwardRef(function(o,t){const n=K({name:"MuiInputLabel",props:o}),{disableAnimation:s=!1,shrink:d,className:a}=n,u=T(n,Xo),c=de();let l=d;typeof l>"u"&&c&&(l=c.filled||c.focused||c.adornedStart);const p=ue({props:n,muiFormControl:c,states:["size","variant","required","focused"]}),v=r({},n,{disableAnimation:s,formControl:c,shrink:l,size:p.size,variant:p.variant,required:p.required,focused:p.focused}),g=Go(v);return m.jsx(Jo,r({"data-shrink":l,ownerState:v,ref:t,className:Y(g.root,a)},u,{classes:g}))});function Yo(e){return U("MuiNativeSelect",e)}const Be=A("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Zo=["className","disabled","error","IconComponent","inputRef","variant"],et=e=>{const{classes:o,variant:t,disabled:n,multiple:s,open:d,error:a}=e,u={select:["select",t,n&&"disabled",s&&"multiple",a&&"error"],icon:["icon",`icon${q(t)}`,d&&"iconOpen",n&&"disabled"]};return _(u,Yo,o)},Ye=({ownerState:e,theme:o})=>r({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":r({},o.vars?{backgroundColor:`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:o.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${Be.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}}),ot=C("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Q,overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.select,o[t.variant],t.error&&o.error,{[`&.${Be.multiple}`]:o.multiple}]}})(Ye),Ze=({ownerState:e,theme:o})=>r({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${Be.disabled}`]:{color:(o.vars||o).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),tt=C("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${q(t.variant)}`],t.open&&o.iconOpen]}})(Ze),nt=f.forwardRef(function(o,t){const{className:n,disabled:s,error:d,IconComponent:a,inputRef:u,variant:c="standard"}=o,l=T(o,Zo),p=r({},o,{disabled:s,variant:c,error:d}),v=et(p);return m.jsxs(f.Fragment,{children:[m.jsx(ot,r({ownerState:p,className:Y(v.select,n),disabled:s,ref:u||t},l)),o.multiple?null:m.jsx(tt,{as:a,ownerState:p,className:v.icon})]})});var Ke;const rt=["children","classes","className","label","notched"],st=C("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:Q})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),lt=C("legend",{name:"MuiNotchedOutlined",shouldForwardProp:Q})(({ownerState:e,theme:o})=>r({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})},e.withLabel&&r({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})})));function it(e){const{className:o,label:t,notched:n}=e,s=T(e,rt),d=t!=null&&t!=="",a=r({},e,{notched:n,withLabel:d});return m.jsx(st,r({"aria-hidden":!0,className:o,ownerState:a},s,{children:m.jsx(lt,{ownerState:a,children:d?m.jsx("span",{children:t}):Ke||(Ke=m.jsx("span",{className:"notranslate",children:"​"}))})}))}const at=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],dt=e=>{const{classes:o}=e,n=_({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Co,o);return r({},o,n)},ut=C(Me,{shouldForwardProp:e=>Q(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Oe})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return r({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${J.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${J.focused} .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette[o.color].main,borderWidth:2},[`&.${J.error} .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${J.disabled} .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},o.startAdornment&&{paddingLeft:14},o.endAdornment&&{paddingRight:14},o.multiline&&r({padding:"16.5px 14px"},o.size==="small"&&{padding:"8.5px 14px"}))}),ct=C(it,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,o)=>o.notchedOutline})(({theme:e})=>{const o=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:o}}),pt=C(Ne,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:we})(({theme:e,ownerState:o})=>r({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{padding:"8.5px 14px"},o.multiline&&{padding:0},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0})),Te=f.forwardRef(function(o,t){var n,s,d,a,u;const c=K({props:o,name:"MuiOutlinedInput"}),{components:l={},fullWidth:p=!1,inputComponent:v="input",label:g,multiline:I=!1,notched:x,slots:S={},type:F="text"}=c,$=T(c,at),R=dt(c),k=de(),b=ue({props:c,muiFormControl:k,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),w=r({},c,{color:b.color||"primary",disabled:b.disabled,error:b.error,focused:b.focused,formControl:k,fullWidth:p,hiddenLabel:b.hiddenLabel,multiline:I,size:b.size,type:F}),O=(n=(s=S.root)!=null?s:l.Root)!=null?n:ut,L=(d=(a=S.input)!=null?a:l.Input)!=null?d:pt;return m.jsx(Pe,r({slots:{root:O,input:L},renderSuffix:z=>m.jsx(ct,{ownerState:w,className:R.notchedOutline,label:g!=null&&g!==""&&b.required?u||(u=m.jsxs(f.Fragment,{children:[g," ","*"]})):g,notched:typeof x<"u"?x:!!(z.startAdornment||z.filled||z.focused)}),fullWidth:p,inputComponent:v,multiline:I,ref:t,type:F},$,{classes:r({},R,{notchedOutline:null})}))});Te.muiName="Input";function ft(e){return U("MuiSelect",e)}const ie=A("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Xe;const mt=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],bt=C("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`&.${ie.select}`]:o.select},{[`&.${ie.select}`]:o[t.variant]},{[`&.${ie.error}`]:o.error},{[`&.${ie.multiple}`]:o.multiple}]}})(Ye,{[`&.${ie.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),vt=C("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${q(t.variant)}`],t.open&&o.iconOpen]}})(Ze),gt=C("input",{shouldForwardProp:e=>go(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,o)=>o.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Ge(e,o){return typeof o=="object"&&o!==null?e===o:String(e)===String(o)}function ht(e){return e==null||typeof e=="string"&&!e.trim()}const xt=e=>{const{classes:o,variant:t,disabled:n,multiple:s,open:d,error:a}=e,u={select:["select",t,n&&"disabled",s&&"multiple",a&&"error"],icon:["icon",`icon${q(t)}`,d&&"iconOpen",n&&"disabled"],nativeInput:["nativeInput"]};return _(u,ft,o)},Ct=f.forwardRef(function(o,t){var n;const{"aria-describedby":s,"aria-label":d,autoFocus:a,autoWidth:u,children:c,className:l,defaultOpen:p,defaultValue:v,disabled:g,displayEmpty:I,error:x=!1,IconComponent:S,inputRef:F,labelId:$,MenuProps:R={},multiple:k,name:b,onBlur:w,onChange:O,onClose:L,onFocus:z,onOpen:j,open:D,readOnly:H,renderValue:V,SelectDisplayProps:P={},tabIndex:M,value:E,variant:X="standard"}=o,G=T(o,mt),[y,Z]=De({controlled:E,default:v,name:"Select"}),[ce,pe]=De({controlled:D,default:p,name:"Select"}),fe=f.useRef(null),B=f.useRef(null),[W,re]=f.useState(null),{current:oe}=f.useRef(D!=null),[Ce,se]=f.useState(),oo=Je(t,F),to=f.useCallback(i=>{B.current=i,i&&re(i)},[]),me=W==null?void 0:W.parentNode;f.useImperativeHandle(oo,()=>({focus:()=>{B.current.focus()},node:fe.current,value:y}),[y]),f.useEffect(()=>{p&&ce&&W&&!oe&&(se(u?null:me.clientWidth),B.current.focus())},[W,u]),f.useEffect(()=>{a&&B.current.focus()},[a]),f.useEffect(()=>{if(!$)return;const i=mo(B.current).getElementById($);if(i){const h=()=>{getSelection().isCollapsed&&B.current.focus()};return i.addEventListener("click",h),()=>{i.removeEventListener("click",h)}}},[$]);const be=(i,h)=>{i?j&&j(h):L&&L(h),oe||(se(u?null:me.clientWidth),pe(i))},no=i=>{i.button===0&&(i.preventDefault(),B.current.focus(),be(!0,i))},ro=i=>{be(!1,i)},Ee=f.Children.toArray(c),so=i=>{const h=Ee.find(N=>N.props.value===i.target.value);h!==void 0&&(Z(h.props.value),O&&O(i,h))},lo=i=>h=>{let N;if(h.currentTarget.hasAttribute("tabindex")){if(k){N=Array.isArray(y)?y.slice():[];const ne=y.indexOf(i.props.value);ne===-1?N.push(i.props.value):N.splice(ne,1)}else N=i.props.value;if(i.props.onClick&&i.props.onClick(h),y!==N&&(Z(N),O)){const ne=h.nativeEvent||h,qe=new ne.constructor(ne.type,ne);Object.defineProperty(qe,"target",{writable:!0,value:{value:N,name:b}}),O(qe,i)}k||be(!1,h)}},io=i=>{H||[" ","ArrowUp","ArrowDown","Enter"].indexOf(i.key)!==-1&&(i.preventDefault(),be(!0,i))},ve=W!==null&&ce,ao=i=>{!ve&&w&&(Object.defineProperty(i,"target",{writable:!0,value:{value:y,name:b}}),w(i))};delete G["aria-invalid"];let te,je;const ge=[];let he=!1;($e({value:y})||I)&&(V?te=V(y):he=!0);const uo=Ee.map(i=>{if(!f.isValidElement(i))return null;let h;if(k){if(!Array.isArray(y))throw new Error(bo(2));h=y.some(N=>Ge(N,i.props.value)),h&&he&&ge.push(i.props.children)}else h=Ge(y,i.props.value),h&&he&&(je=i.props.children);return f.cloneElement(i,{"aria-selected":h?"true":"false",onClick:lo(i),onKeyUp:N=>{N.key===" "&&N.preventDefault(),i.props.onKeyUp&&i.props.onKeyUp(N)},role:"option",selected:h,value:void 0,"data-value":i.props.value})});he&&(k?ge.length===0?te=null:te=ge.reduce((i,h,N)=>(i.push(h),N{const{classes:o}=e;return o},ze={name:"MuiSelect",overridesResolver:(e,o)=>o.root,shouldForwardProp:e=>Q(e)&&e!=="variant",slot:"Root"},Ft=C(We,ze)(""),$t=C(Te,ze)(""),St=C(Le,ze)(""),eo=f.forwardRef(function(o,t){const n=K({name:"MuiSelect",props:o}),{autoWidth:s=!1,children:d,classes:a={},className:u,defaultOpen:c=!1,displayEmpty:l=!1,IconComponent:p=Ro,id:v,input:g,inputProps:I,label:x,labelId:S,MenuProps:F,multiple:$=!1,native:R=!1,onClose:k,onOpen:b,open:w,renderValue:O,SelectDisplayProps:L,variant:z="outlined"}=n,j=T(n,It),D=R?nt:Ct,H=de(),V=ue({props:n,muiFormControl:H,states:["variant","error"]}),P=V.variant||z,M=r({},n,{variant:P,classes:a}),E=yt(M),X=T(E,Rt),G=g||{standard:m.jsx(Ft,{ownerState:M}),outlined:m.jsx($t,{label:x,ownerState:M}),filled:m.jsx(St,{ownerState:M})}[P],y=Je(t,ho(G));return m.jsx(f.Fragment,{children:f.cloneElement(G,r({inputComponent:D,inputProps:r({children:d,error:V.error,IconComponent:p,variant:P,type:void 0,multiple:$},R?{id:v}:{autoWidth:s,defaultOpen:c,displayEmpty:l,labelId:S,MenuProps:F,onClose:k,onOpen:b,open:w,renderValue:O,SelectDisplayProps:r({id:v},L)},I,{classes:I?ke(X,I.classes):X},g?g.props.inputProps:{})},($&&R||l)&&P==="outlined"?{notched:!0}:{},{ref:y,className:Y(G.props.className,u,E.root)},!g&&{variant:P},j))})});eo.muiName="Select";function kt(e){return U("MuiTextField",e)}A("MuiTextField",["root"]);const Pt=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],Mt={standard:We,filled:Le,outlined:Te},Ot=e=>{const{classes:o}=e;return _({root:["root"]},kt,o)},Nt=C(No,{name:"MuiTextField",slot:"Root",overridesResolver:(e,o)=>o.root})({}),Lt=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiTextField"}),{autoComplete:s,autoFocus:d=!1,children:a,className:u,color:c="primary",defaultValue:l,disabled:p=!1,error:v=!1,FormHelperTextProps:g,fullWidth:I=!1,helperText:x,id:S,InputLabelProps:F,inputProps:$,InputProps:R,inputRef:k,label:b,maxRows:w,minRows:O,multiline:L=!1,name:z,onBlur:j,onChange:D,onFocus:H,placeholder:V,required:P=!1,rows:M,select:E=!1,SelectProps:X,type:G,value:y,variant:Z="outlined"}=n,ce=T(n,Pt),pe=r({},n,{autoFocus:d,color:c,disabled:p,error:v,fullWidth:I,multiline:L,required:P,select:E,variant:Z}),fe=Ot(pe),B={};Z==="outlined"&&(F&&typeof F.shrink<"u"&&(B.notched=F.shrink),B.label=b),E&&((!X||!X.native)&&(B.id=void 0),B["aria-describedby"]=void 0);const W=Qe(S),re=x&&W?`${W}-helper-text`:void 0,oe=b&&W?`${W}-label`:void 0,Ce=Mt[Z],se=m.jsx(Ce,r({"aria-describedby":re,autoComplete:s,autoFocus:d,defaultValue:l,fullWidth:I,multiline:L,name:z,rows:M,maxRows:w,minRows:O,type:G,value:y,id:W,inputRef:k,onBlur:j,onChange:D,onFocus:H,placeholder:V,inputProps:$},B,R));return m.jsxs(Nt,r({className:Y(fe.root,u),disabled:p,error:v,fullWidth:I,ref:t,required:P,color:c,variant:Z,ownerState:pe},ce,{children:[b!=null&&b!==""&&m.jsx(Qo,r({htmlFor:W,id:oe},F,{children:b})),E?m.jsx(eo,r({"aria-describedby":re,id:W,labelId:oe,value:y,input:se},X,{children:a})):se,x&&m.jsx(To,r({id:re},g,{children:x}))]}))});export{Ro as A,No as F,Te as O,eo as S,Lt as T,ee as f,le as i,J as o}; diff --git a/dist/assets/UnderConstruction-DsmkPjmj.js b/dist/assets/UnderConstruction-8igSl5Z8.js similarity index 91% rename from dist/assets/UnderConstruction-DsmkPjmj.js rename to dist/assets/UnderConstruction-8igSl5Z8.js index c20243e..a2d695f 100644 --- a/dist/assets/UnderConstruction-DsmkPjmj.js +++ b/dist/assets/UnderConstruction-8igSl5Z8.js @@ -1 +1 @@ -import{r as o,j as e,i as s,as as c,B as r,S as l,T as n}from"./index-Dg-wT72v.js";import{d}from"./HomeOutlined-CTxH7VVL.js";import{B as u}from"./Button-COL1_fTB.js";var t={},x=s;Object.defineProperty(t,"__esModule",{value:!0});var a=t.default=void 0,h=x(o()),m=e;a=t.default=(0,h.default)((0,m.jsx)("path",{d:"m13.7826 15.1719 2.1213-2.1213 5.9963 5.9962-2.1213 2.1213zM17.5 10c1.93 0 3.5-1.57 3.5-3.5 0-.58-.16-1.12-.41-1.6l-2.7 2.7-1.49-1.49 2.7-2.7c-.48-.25-1.02-.41-1.6-.41C15.57 3 14 4.57 14 6.5c0 .41.08.8.21 1.16l-1.85 1.85-1.78-1.78.71-.71-1.41-1.41L12 3.49c-1.17-1.17-3.07-1.17-4.24 0L4.22 7.03l1.41 1.41H2.81l-.71.71 3.54 3.54.71-.71V9.15l1.41 1.41.71-.71 1.78 1.78-7.41 7.41 2.12 2.12L16.34 9.79c.36.13.75.21 1.16.21"}),"ConstructionOutlined");function j(){const i=c();return e.jsx(r,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:e.jsxs(l,{spacing:2.5,alignItems:"center",children:[e.jsx(r,{sx:{width:110,height:110,borderRadius:"50%",bgcolor:"primary.lighter",color:"primary.main",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(a,{sx:{fontSize:56}})}),e.jsx(n,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:"Under Construction"}),e.jsx(n,{variant:"body1",color:"text.secondary",sx:{maxWidth:460},children:"Hey! Please check out this site later. We are doing some maintenance on it right now."}),e.jsx(u,{variant:"contained",size:"large",startIcon:e.jsx(d,{}),onClick:()=>i("/dashboard"),sx:{mt:1},children:"Back To Home"})]})})}export{j as default}; +import{r as o,j as e,i as s,as as c,B as r,S as l,T as n}from"./index-J0uxx8As.js";import{d}from"./HomeOutlined-B9pi5FD_.js";import{B as u}from"./Button-BkRsd5c4.js";var t={},x=s;Object.defineProperty(t,"__esModule",{value:!0});var a=t.default=void 0,h=x(o()),m=e;a=t.default=(0,h.default)((0,m.jsx)("path",{d:"m13.7826 15.1719 2.1213-2.1213 5.9963 5.9962-2.1213 2.1213zM17.5 10c1.93 0 3.5-1.57 3.5-3.5 0-.58-.16-1.12-.41-1.6l-2.7 2.7-1.49-1.49 2.7-2.7c-.48-.25-1.02-.41-1.6-.41C15.57 3 14 4.57 14 6.5c0 .41.08.8.21 1.16l-1.85 1.85-1.78-1.78.71-.71-1.41-1.41L12 3.49c-1.17-1.17-3.07-1.17-4.24 0L4.22 7.03l1.41 1.41H2.81l-.71.71 3.54 3.54.71-.71V9.15l1.41 1.41.71-.71 1.78 1.78-7.41 7.41 2.12 2.12L16.34 9.79c.36.13.75.21 1.16.21"}),"ConstructionOutlined");function j(){const i=c();return e.jsx(r,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:e.jsxs(l,{spacing:2.5,alignItems:"center",children:[e.jsx(r,{sx:{width:110,height:110,borderRadius:"50%",bgcolor:"primary.lighter",color:"primary.main",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(a,{sx:{fontSize:56}})}),e.jsx(n,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:"Under Construction"}),e.jsx(n,{variant:"body1",color:"text.secondary",sx:{maxWidth:460},children:"Hey! Please check out this site later. We are doing some maintenance on it right now."}),e.jsx(u,{variant:"contained",size:"large",startIcon:e.jsx(d,{}),onClick:()=>i("/dashboard"),sx:{mt:1},children:"Back To Home"})]})})}export{j as default}; diff --git a/dist/assets/VisibilityOff-D6_289tJ.js b/dist/assets/VisibilityOff-DVBJPx6F.js similarity index 97% rename from dist/assets/VisibilityOff-D6_289tJ.js rename to dist/assets/VisibilityOff-DVBJPx6F.js index 2fda919..8e255d4 100644 --- a/dist/assets/VisibilityOff-D6_289tJ.js +++ b/dist/assets/VisibilityOff-DVBJPx6F.js @@ -1 +1 @@ -import{l as X,m as A,a as G,o as H,h as J,aq as K,_ as n,j as d,p as Q,q as T,v as Y,w as R,X as Z,a4 as ee,r as _,i as F}from"./index-Dg-wT72v.js";function te(e){return X("PrivateSwitchBase",e)}A("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const ae=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],se=e=>{const{classes:s,checked:l,disabled:r,edge:o}=e,u={root:["root",l&&"checked",r&&"disabled",o&&`edge${T(o)}`],input:["input"]};return Y(u,te,s)},oe=R(Z,{name:"MuiSwitchBase"})(({ownerState:e})=>n({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),ie=R("input",{name:"MuiSwitchBase",shouldForwardProp:ee})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),me=G.forwardRef(function(s,l){const{autoFocus:r,checked:o,checkedIcon:u,className:S,defaultChecked:m,disabled:w,disableFocusRipple:g=!1,edge:P=!1,icon:j,id:I,inputProps:M,inputRef:q,name:z,onBlur:b,onChange:v,onFocus:x,readOnly:O,required:E=!1,tabIndex:$,type:c,value:C}=s,L=H(s,ae),[B,N]=J({controlled:o,default:!!m,name:"SwitchBase",state:"checked"}),a=K(),U=t=>{x&&x(t),a&&a.onFocus&&a.onFocus(t)},V=t=>{b&&b(t),a&&a.onBlur&&a.onBlur(t)},D=t=>{if(t.nativeEvent.defaultPrevented)return;const y=t.target.checked;N(y),v&&v(t,y)};let i=w;a&&typeof i>"u"&&(i=a.disabled);const W=c==="checkbox"||c==="radio",h=n({},s,{checked:B,disabled:i,disableFocusRipple:g,edge:P}),k=se(h);return d.jsxs(oe,n({component:"span",className:Q(k.root,S),centerRipple:!0,focusRipple:!g,disabled:i,tabIndex:null,role:void 0,onFocus:U,onBlur:V,ownerState:h,ref:l},L,{children:[d.jsx(ie,n({autoFocus:r,checked:o,defaultChecked:m,className:k.input,disabled:i,id:W?I:void 0,name:z,onChange:D,readOnly:O,ref:q,required:E,ownerState:h,tabIndex:$,type:c},c==="checkbox"&&C===void 0?{}:{value:C},M)),B?u:j]}))});var p={},ce=F;Object.defineProperty(p,"__esModule",{value:!0});var ne=p.default=void 0,de=ce(_()),le=d;ne=p.default=(0,de.default)((0,le.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility");var f={},re=F;Object.defineProperty(f,"__esModule",{value:!0});var ue=f.default=void 0,he=re(_()),pe=d;ue=f.default=(0,he.default)((0,pe.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");export{me as S,ne as a,ue as d}; +import{l as X,m as A,a as G,o as H,h as J,aq as K,_ as n,j as d,p as Q,q as T,v as Y,w as R,X as Z,a4 as ee,r as _,i as F}from"./index-J0uxx8As.js";function te(e){return X("PrivateSwitchBase",e)}A("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const ae=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],se=e=>{const{classes:s,checked:l,disabled:r,edge:o}=e,u={root:["root",l&&"checked",r&&"disabled",o&&`edge${T(o)}`],input:["input"]};return Y(u,te,s)},oe=R(Z,{name:"MuiSwitchBase"})(({ownerState:e})=>n({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),ie=R("input",{name:"MuiSwitchBase",shouldForwardProp:ee})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),me=G.forwardRef(function(s,l){const{autoFocus:r,checked:o,checkedIcon:u,className:S,defaultChecked:m,disabled:w,disableFocusRipple:g=!1,edge:P=!1,icon:j,id:I,inputProps:M,inputRef:q,name:z,onBlur:b,onChange:v,onFocus:x,readOnly:O,required:E=!1,tabIndex:$,type:c,value:C}=s,L=H(s,ae),[B,N]=J({controlled:o,default:!!m,name:"SwitchBase",state:"checked"}),a=K(),U=t=>{x&&x(t),a&&a.onFocus&&a.onFocus(t)},V=t=>{b&&b(t),a&&a.onBlur&&a.onBlur(t)},D=t=>{if(t.nativeEvent.defaultPrevented)return;const y=t.target.checked;N(y),v&&v(t,y)};let i=w;a&&typeof i>"u"&&(i=a.disabled);const W=c==="checkbox"||c==="radio",h=n({},s,{checked:B,disabled:i,disableFocusRipple:g,edge:P}),k=se(h);return d.jsxs(oe,n({component:"span",className:Q(k.root,S),centerRipple:!0,focusRipple:!g,disabled:i,tabIndex:null,role:void 0,onFocus:U,onBlur:V,ownerState:h,ref:l},L,{children:[d.jsx(ie,n({autoFocus:r,checked:o,defaultChecked:m,className:k.input,disabled:i,id:W?I:void 0,name:z,onChange:D,readOnly:O,ref:q,required:E,ownerState:h,tabIndex:$,type:c},c==="checkbox"&&C===void 0?{}:{value:C},M)),B?u:j]}))});var p={},ce=F;Object.defineProperty(p,"__esModule",{value:!0});var ne=p.default=void 0,de=ce(_()),le=d;ne=p.default=(0,de.default)((0,le.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility");var f={},re=F;Object.defineProperty(f,"__esModule",{value:!0});var ue=f.default=void 0,he=re(_()),pe=d;ue=f.default=(0,he.default)((0,pe.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");export{me as S,ne as a,ue as d}; diff --git a/dist/assets/index-Dg-wT72v.js b/dist/assets/index-J0uxx8As.js similarity index 99% rename from dist/assets/index-Dg-wT72v.js rename to dist/assets/index-J0uxx8As.js index 991e185..8d6e140 100644 --- a/dist/assets/index-Dg-wT72v.js +++ b/dist/assets/index-J0uxx8As.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-C9wQ4JPv.js","assets/EmptyState-Do4nLXP0.js","assets/StatusChip-ioS4PHcC.js","assets/Link-CndAQvyC.js","assets/PageHeader-DgkErsA7.js","assets/Button-COL1_fTB.js","assets/TableRow-Du7Jvlvh.js","assets/TableCell-ClQIqE-T.js","assets/LinearProgress-BvM3Q63G.js","assets/Tenants-BNEm3NVI.js","assets/EditOutlined-COfONJBH.js","assets/PhoneOutlined-BqFvwse4.js","assets/TextField-COVOKpzm.js","assets/StorefrontOutlined-BR_dFc0C.js","assets/MapOutlined-C-CxlyED.js","assets/TabLabelCount-BKNSTwCP.js","assets/Close-DKUHif5O.js","assets/InputAdornment-HqPFSHfS.js","assets/Survey-Coph8xEf.js","assets/Pricing-BbUkW6tl.js","assets/TeamUsers-Csrvkh6_.js","assets/Settings-DhO0lsb-.js","assets/VisibilityOff-D6_289tJ.js","assets/Login-lPugph-B.js","assets/UnderConstruction-DsmkPjmj.js","assets/HomeOutlined-CTxH7VVL.js","assets/ComingSoon-DMAOAczX.js","assets/Error500-Cot1QOxV.js","assets/Error404-Bm5B4e4s.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-DNc332tE.js","assets/EmptyState-B2FWZCr6.js","assets/StatusChip-DTSEpe4F.js","assets/Link-DdF3Xu1F.js","assets/PageHeader-TW1dMGrU.js","assets/Button-BkRsd5c4.js","assets/TableRow-DryS4Frn.js","assets/TableCell-dI-OU86K.js","assets/LinearProgress-DAlys0Qw.js","assets/Tenants-CtuW6TmF.js","assets/EditOutlined-CLycK5tS.js","assets/PhoneOutlined-C_1wJaio.js","assets/TextField-BARvBB_z.js","assets/StorefrontOutlined-C6lTcD4z.js","assets/MapOutlined-DE0O8xFw.js","assets/TabLabelCount-C4m0Yyzh.js","assets/Close-DtPVHjo-.js","assets/InputAdornment-Cbcw8oJa.js","assets/Survey-B7FNo3gA.js","assets/Pricing-DRDC22ok.js","assets/TeamUsers-Dv5yeZfk.js","assets/Settings-DCzsntaD.js","assets/VisibilityOff-DVBJPx6F.js","assets/Login-SNBlIs0y.js","assets/UnderConstruction-8igSl5Z8.js","assets/HomeOutlined-B9pi5FD_.js","assets/ComingSoon-hlrj6HJr.js","assets/Error500-CiU1ecHp.js","assets/Error404-BKSqGNFt.js"])))=>i.map(i=>d[i]); function B1(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var cs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Yn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var gg={exports:{}},ul={},vg={exports:{}},ie={};/** * @license React * react.production.min.js @@ -185,4 +185,4 @@ Error generating stack: `+i.message+` `));return m},[u,h,c,d,i]),S=v.useMemo(()=>g?{minDate:g.date("1900-01-01T00:00:00.000"),maxDate:g.date("2099-12-31T00:00:00.000")}:null,[g]),p=v.useMemo(()=>({utils:g,defaultDates:S,localeText:y}),[S,g,y]);return b.jsx(ug.Provider,{value:p,children:l})},KM=(e,t="warning")=>{let n=!1;const r=Array.isArray(e)?e.join(` `):e;return()=>{n||(n=!0,t==="error"?console.error(r):console.warn(r))}};var h1={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(cs,function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",a="minute",l="hour",u="day",c="week",d="month",h="quarter",x="year",y="date",g="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(j){var O=["th","st","nd","rd"],$=j%100;return"["+j+(O[($-20)%10]||O[$]||O[0])+"]"}},f=function(j,O,$){var I=String(j);return!I||I.length>=O?j:""+Array(O+1-I.length).join($)+j},w={s:f,z:function(j){var O=-j.utcOffset(),$=Math.abs(O),I=Math.floor($/60),T=$%60;return(O<=0?"+":"-")+f(I,2,"0")+":"+f(T,2,"0")},m:function j(O,$){if(O.date()<$.date())return-j($,O);var I=12*($.year()-O.year())+($.month()-O.month()),T=O.clone().add(I,d),L=$-T<0,N=O.clone().add(I+(L?-1:1),d);return+(-(I+($-T)/(L?T-N:N-T))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:d,y:x,w:c,d:u,D:y,h:l,m:a,s,ms:i,Q:h}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},P="en",E={};E[P]=m;var k="$isDayjsObject",M=function(j){return j instanceof A||!(!j||!j[k])},D=function j(O,$,I){var T;if(!O)return P;if(typeof O=="string"){var L=O.toLowerCase();E[L]&&(T=L),$&&(E[L]=$,T=L);var N=O.split("-");if(!T&&N.length>1)return j(N[0])}else{var B=O.name;E[B]=O,T=B}return!I&&T&&(P=T),T||!I&&P},R=function(j,O){if(M(j))return j.clone();var $=typeof O=="object"?O:{};return $.date=j,$.args=arguments,new A($)},_=w;_.l=D,_.i=M,_.w=function(j,O){return R(j,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var A=function(){function j($){this.$L=D($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[k]=!0}var O=j.prototype;return O.parse=function($){this.$d=function(I){var T=I.date,L=I.utc;if(T===null)return new Date(NaN);if(_.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var N=T.match(S);if(N){var B=N[2]-1||0,U=(N[7]||"0").substring(0,3);return L?new Date(Date.UTC(N[1],B,N[3]||1,N[4]||0,N[5]||0,N[6]||0,U)):new Date(N[1],B,N[3]||1,N[4]||0,N[5]||0,N[6]||0,U)}}return new Date(T)}($),this.init()},O.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},O.$utils=function(){return _},O.isValid=function(){return this.$d.toString()!==g},O.isSame=function($,I){var T=R($);return this.startOf(I)<=T&&T<=this.endOf(I)},O.isAfter=function($,I){return R($)25){var c=s(this).startOf(r).add(1,r).date(u),d=s(this).endOf(n);if(c.isBefore(d))return 1}var h=s(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),x=this.diff(h,n,!0);return x<0?s(this).startOf("week").week():Math.ceil(x)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})})(m1);var QM=m1.exports;const XM=Kr(QM);var g1={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(cs,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,i=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},u=function(S){return(S=+S)+(S>68?1900:2e3)},c=function(S){return function(p){this[S]=+p}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(S){(this.zone||(this.zone={})).offset=function(p){if(!p||p==="Z")return 0;var m=p.match(/([+-]|\d\d)/g),f=60*m[1]+(+m[2]||0);return f===0?0:m[0]==="+"?-f:f}(S)}],h=function(S){var p=l[S];return p&&(p.indexOf?p:p.s.concat(p.f))},x=function(S,p){var m,f=l.meridiem;if(f){for(var w=1;w<=24;w+=1)if(S.indexOf(f(w,0,p))>-1){m=w>12;break}}else m=S===(p?"pm":"PM");return m},y={A:[a,function(S){this.afternoon=x(S,!1)}],a:[a,function(S){this.afternoon=x(S,!0)}],Q:[o,function(S){this.month=3*(S-1)+1}],S:[o,function(S){this.milliseconds=100*+S}],SS:[i,function(S){this.milliseconds=10*+S}],SSS:[/\d{3}/,function(S){this.milliseconds=+S}],s:[s,c("seconds")],ss:[s,c("seconds")],m:[s,c("minutes")],mm:[s,c("minutes")],H:[s,c("hours")],h:[s,c("hours")],HH:[s,c("hours")],hh:[s,c("hours")],D:[s,c("day")],DD:[i,c("day")],Do:[a,function(S){var p=l.ordinal,m=S.match(/\d+/);if(this.day=m[0],p)for(var f=1;f<=31;f+=1)p(f).replace(/\[|\]/g,"")===S&&(this.day=f)}],w:[s,c("week")],ww:[i,c("week")],M:[s,c("month")],MM:[i,c("month")],MMM:[a,function(S){var p=h("months"),m=(h("monthsShort")||p.map(function(f){return f.slice(0,3)})).indexOf(S)+1;if(m<1)throw new Error;this.month=m%12||m}],MMMM:[a,function(S){var p=h("months").indexOf(S)+1;if(p<1)throw new Error;this.month=p%12||p}],Y:[/[+-]?\d+/,c("year")],YY:[i,function(S){this.year=u(S)}],YYYY:[/\d{4}/,c("year")],Z:d,ZZ:d};function g(S){var p,m;p=S,m=l&&l.formats;for(var f=(S=p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,_,A){var z=A&&A.toUpperCase();return _||m[A]||n[A]||m[z].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(j,O,$){return O||$.slice(1)})})).match(r),w=f.length,P=0;P-1)return new Date((T==="X"?1e3:1)*I);var B=g(T)(I),U=B.year,q=B.month,V=B.day,G=B.hours,W=B.minutes,Z=B.seconds,te=B.milliseconds,Q=B.zone,re=B.week,K=new Date,ce=V||(U||q?1:K.getDate()),X=U||K.getFullYear(),se=0;U&&!q||(se=q>0?q-1:K.getMonth());var oe,nt=G||0,Ve=W||0,Le=Z||0,ft=te||0;return Q?new Date(Date.UTC(X,se,ce,nt,Ve,Le,ft+60*Q.offset*1e3)):L?new Date(Date.UTC(X,se,ce,nt,Ve,Le,ft)):(oe=new Date(X,se,ce,nt,Ve,Le,ft),re&&(oe=N(oe).week(re).toDate()),oe)}catch{return new Date("")}}(E,D,k,m),this.init(),z&&z!==!0&&(this.$L=this.locale(z).$L),A&&E!=this.format(D)&&(this.$d=new Date("")),l={}}else if(D instanceof Array)for(var j=D.length,O=1;O<=j;O+=1){M[1]=D[O-1];var $=m.apply(this,M);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}O===j&&(this.$d=new Date(""))}else w.call(this,P)}}})})(g1);var qM=g1.exports;const ZM=Kr(qM);var v1={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(cs,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,i){var s=o.prototype,a=s.format;i.en.formats=n,s.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,c=function(d,h){return d.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(x,y,g){var S=g&&g.toUpperCase();return y||h[g]||n[g]||h[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(p,m,f){return m||f.slice(1)})})}(l,u===void 0?{}:u);return a.call(this,c)}}})})(v1);var JM=v1.exports;const e_=Kr(JM);var y1={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(cs,function(){return function(n,r,o){r.prototype.isBetween=function(i,s,a,l){var u=o(i),c=o(s),d=(l=l||"()")[0]==="(",h=l[1]===")";return(d?this.isAfter(u,a):!this.isBefore(u,a))&&(h?this.isBefore(c,a):!this.isAfter(c,a))||(d?this.isBefore(u,a):!this.isAfter(u,a))&&(h?this.isAfter(c,a):!this.isBefore(c,a))}}})})(y1);var t_=y1.exports;const n_=Kr(t_);lt.extend(ZM);lt.extend(e_);lt.extend(n_);const r_=KM(["Your locale has not been found.","Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale","Or you forget to import the locale from 'dayjs/locale/{localeUsed}'","fallback on English locale"]),o_={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},i_={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",fullDateWithWeekday:"dddd, LL",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",monthAndYear:"MMMM YYYY",monthAndDate:"MMMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",fullDateTime:"lll",fullDateTime12h:"ll hh:mm A",fullDateTime24h:"ll HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},nc=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(` `),cg=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(` -`),s_=(e,t)=>t?(...n)=>e(...n).locale(t):e;class a_{constructor({locale:t,formats:n,instance:r}={}){var o;this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.rawDayJsInstance=void 0,this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=o_,this.setLocaleToValue=i=>{const s=this.getCurrentLocaleCode();return s===i.locale()?i:i.locale(s)},this.hasUTCPlugin=()=>typeof lt.utc<"u",this.hasTimezonePlugin=()=>typeof lt.tz<"u",this.isSame=(i,s,a)=>{const l=this.setTimezone(s,this.getTimezone(i));return i.format(a)===l.format(a)},this.cleanTimezone=i=>{switch(i){case"default":return;case"system":return lt.tz.guess();default:return i}},this.createSystemDate=i=>{if(this.rawDayJsInstance)return this.rawDayJsInstance(i);if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const s=lt.tz.guess();return s!=="UTC"?lt.tz(i,s):lt(i)}return lt(i)},this.createUTCDate=i=>{if(!this.hasUTCPlugin())throw new Error(nc);return lt.utc(i)},this.createTZDate=(i,s)=>{if(!this.hasUTCPlugin())throw new Error(nc);if(!this.hasTimezonePlugin())throw new Error(cg);const a=i!==void 0&&!i.endsWith("Z");return lt(i).tz(this.cleanTimezone(s),a)},this.getLocaleFormats=()=>{const i=lt.Ls,s=this.locale||"en";let a=i[s];return a===void 0&&(r_(),a=i.en),a.formats},this.adjustOffset=i=>{if(!this.hasTimezonePlugin())return i;const s=this.getTimezone(i);if(s!=="UTC"){var a,l;const u=i.tz(this.cleanTimezone(s),!0);if(((a=u.$offset)!=null?a:0)===((l=i.$offset)!=null?l:0))return i;i.$offset=u.$offset}return i},this.date=i=>i===null?null:this.dayjs(i),this.dateWithTimezone=(i,s)=>{if(i===null)return null;let a;return s==="UTC"?a=this.createUTCDate(i):s==="system"||s==="default"&&!this.hasTimezonePlugin()?a=this.createSystemDate(i):a=this.createTZDate(i,s),this.locale===void 0?a:a.locale(this.locale)},this.getTimezone=i=>{if(this.hasTimezonePlugin()){var s;const a=(s=i.$x)==null?void 0:s.$timezone;if(a)return a}return this.hasUTCPlugin()&&i.isUTC()?"UTC":"system"},this.setTimezone=(i,s)=>{if(this.getTimezone(i)===s)return i;if(s==="UTC"){if(!this.hasUTCPlugin())throw new Error(nc);return i.utc()}if(s==="system")return i.local();if(!this.hasTimezonePlugin()){if(s==="default")return i;throw new Error(cg)}return lt.tz(i,this.cleanTimezone(s))},this.toJsDate=i=>i.toDate(),this.parseISO=i=>this.dayjs(i),this.toISO=i=>i.toISOString(),this.parse=(i,s)=>i===""?null:this.dayjs(i,s,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=i=>{const s=this.getLocaleFormats(),a=l=>l.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(u,c,d)=>c||d.slice(1));return i.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(l,u,c)=>{const d=c&&c.toUpperCase();return u||s[c]||a(s[d])})},this.getFormatHelperText=i=>this.expandFormat(i).replace(/a/gi,"(a|p)m").toLocaleLowerCase(),this.isNull=i=>i===null,this.isValid=i=>this.dayjs(i).isValid(),this.format=(i,s)=>this.formatByString(i,this.formats[s]),this.formatByString=(i,s)=>this.dayjs(i).format(s),this.formatNumber=i=>i,this.getDiff=(i,s,a)=>i.diff(s,a),this.isEqual=(i,s)=>i===null&&s===null?!0:this.dayjs(i).toDate().getTime()===this.dayjs(s).toDate().getTime(),this.isSameYear=(i,s)=>this.isSame(i,s,"YYYY"),this.isSameMonth=(i,s)=>this.isSame(i,s,"YYYY-MM"),this.isSameDay=(i,s)=>this.isSame(i,s,"YYYY-MM-DD"),this.isSameHour=(i,s)=>i.isSame(s,"hour"),this.isAfter=(i,s)=>i>s,this.isAfterYear=(i,s)=>this.hasUTCPlugin()?!this.isSameYear(i,s)&&i.utc()>s.utc():i.isAfter(s,"year"),this.isAfterDay=(i,s)=>this.hasUTCPlugin()?!this.isSameDay(i,s)&&i.utc()>s.utc():i.isAfter(s,"day"),this.isBefore=(i,s)=>ithis.hasUTCPlugin()?!this.isSameYear(i,s)&&i.utc()this.hasUTCPlugin()?!this.isSameDay(i,s)&&i.utc()i>=s&&i<=a,this.startOfYear=i=>this.adjustOffset(i.startOf("year")),this.startOfMonth=i=>this.adjustOffset(i.startOf("month")),this.startOfWeek=i=>this.adjustOffset(i.startOf("week")),this.startOfDay=i=>this.adjustOffset(i.startOf("day")),this.endOfYear=i=>this.adjustOffset(i.endOf("year")),this.endOfMonth=i=>this.adjustOffset(i.endOf("month")),this.endOfWeek=i=>this.adjustOffset(i.endOf("week")),this.endOfDay=i=>this.adjustOffset(i.endOf("day")),this.addYears=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"year"):i.add(s,"year")),this.addMonths=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"month"):i.add(s,"month")),this.addWeeks=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"week"):i.add(s,"week")),this.addDays=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"day"):i.add(s,"day")),this.addHours=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"hour"):i.add(s,"hour")),this.addMinutes=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"minute"):i.add(s,"minute")),this.addSeconds=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"second"):i.add(s,"second")),this.getYear=i=>i.year(),this.getMonth=i=>i.month(),this.getDate=i=>i.date(),this.getHours=i=>i.hour(),this.getMinutes=i=>i.minute(),this.getSeconds=i=>i.second(),this.getMilliseconds=i=>i.millisecond(),this.setYear=(i,s)=>this.adjustOffset(i.set("year",s)),this.setMonth=(i,s)=>this.adjustOffset(i.set("month",s)),this.setDate=(i,s)=>this.adjustOffset(i.set("date",s)),this.setHours=(i,s)=>this.adjustOffset(i.set("hour",s)),this.setMinutes=(i,s)=>this.adjustOffset(i.set("minute",s)),this.setSeconds=(i,s)=>this.adjustOffset(i.set("second",s)),this.setMilliseconds=(i,s)=>this.adjustOffset(i.set("millisecond",s)),this.getDaysInMonth=i=>i.daysInMonth(),this.getNextMonth=i=>this.addMonths(i,1),this.getPreviousMonth=i=>this.addMonths(i,-1),this.getMonthArray=i=>{const a=[i.startOf("year")];for(;a.length<12;){const l=a[a.length-1];a.push(this.addMonths(l,1))}return a},this.mergeDateAndTime=(i,s)=>i.hour(s.hour()).minute(s.minute()).second(s.second()),this.getWeekdays=()=>{const i=this.dayjs().startOf("week");return[0,1,2,3,4,5,6].map(s=>this.formatByString(this.addDays(i,s),"dd"))},this.getWeekArray=i=>{const s=this.setLocaleToValue(i),a=s.startOf("month").startOf("week"),l=s.endOf("month").endOf("week");let u=0,c=a;const d=[];for(;ci.week(),this.getYearRange=(i,s)=>{const a=i.startOf("year"),l=s.endOf("year"),u=[];let c=a;for(;ci==="am"?"AM":"PM",this.rawDayJsInstance=r,this.dayjs=s_((o=this.rawDayJsInstance)!=null?o:lt,t),this.locale=t,this.formats=C({},i_,n),lt.extend(XM)}}const Ne={0:"#FFFFFF",50:"#FAFAFA",100:"#F5F5F5",200:"#F0F0F0",300:"#D9D9D9",400:"#BFBFBF",500:"#8C8C8C",600:"#595959",700:"#434343",800:"#262626",900:"#141414",A50:"#FAFAFB",A100:"#E6EBF1"},l_={mode:"light",common:{black:"#000000",white:"#FFFFFF"},primary:{lighter:"#F8E0E3",100:"#EFBBC1",200:"#E08A92",light:"#D6515C",400:"#CC2E3C",main:"#C01227",dark:"#9E0E20",700:"#870C1B",darker:"#7E0B17",900:"#520710",contrastText:"#FFFFFF"},secondary:{lighter:Ne[100],100:Ne[100],200:Ne[200],light:Ne[300],400:Ne[400],main:Ne[500],600:Ne[600],dark:Ne[700],800:Ne[800],darker:Ne[900],A100:Ne[0],A200:Ne[400],A300:Ne[700],contrastText:Ne[0]},error:{lighter:"#FEEAE9",light:"#F88078",main:"#F04134",dark:"#A82216",darker:"#7A150C",contrastText:"#FFFFFF"},warning:{lighter:"#FFF7E0",light:"#FFD666",main:"#FFBF00",dark:"#B38600",darker:"#805F00",contrastText:"#262626"},info:{lighter:"#E0F7F8",light:"#66CBD2",main:"#00A2AE",dark:"#00727B",darker:"#005159",contrastText:"#FFFFFF"},success:{lighter:"#E3F6EC",light:"#5CC98C",main:"#00A854",dark:"#00773B",darker:"#00552A",contrastText:"#FFFFFF"},grey:Ne,text:{primary:Ne[800],secondary:Ne[600],disabled:Ne[400]},action:{disabled:Ne[300],hover:"rgba(192, 18, 39, 0.04)",selected:"rgba(192, 18, 39, 0.08)"},divider:Ne[200],background:{paper:"#FFFFFF",default:Ne.A50}},u_={fontFamily:'"Public Sans", "Inter", "Helvetica", "Arial", sans-serif',htmlFontSize:16,fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:600,h1:{fontWeight:700,fontSize:"2.375rem",lineHeight:1.21},h2:{fontWeight:700,fontSize:"1.875rem",lineHeight:1.27},h3:{fontWeight:600,fontSize:"1.5rem",lineHeight:1.33},h4:{fontWeight:600,fontSize:"1.25rem",lineHeight:1.4},h5:{fontWeight:600,fontSize:"1rem",lineHeight:1.5},h6:{fontWeight:500,fontSize:"0.875rem",lineHeight:1.57},caption:{fontWeight:400,fontSize:"0.75rem",lineHeight:1.66},body1:{fontSize:"0.875rem",lineHeight:1.57},body2:{fontSize:"0.75rem",lineHeight:1.66},subtitle1:{fontSize:"0.875rem",fontWeight:600,lineHeight:1.57},subtitle2:{fontSize:"0.75rem",fontWeight:500,lineHeight:1.66},overline:{fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.08em",textTransform:"uppercase"},button:{textTransform:"capitalize",fontWeight:600}},ki={card:"0px 1px 4px rgba(0, 0, 0, 0.08)",cardHover:"0px 4px 16px rgba(0, 0, 0, 0.10)",widget:"0px 2px 14px rgba(38, 38, 38, 0.06)",dropdown:"0px 8px 24px rgba(38, 38, 38, 0.12)",primaryGlow:"0px 6px 16px rgba(192, 18, 39, 0.28)",primaryGlowHover:"0px 8px 20px rgba(192, 18, 39, 0.36)",header:"0px 1px 0px rgba(0, 0, 0, 0.06)"};function c_(e){const{palette:t}=e;return{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:t.background.default},"*::-webkit-scrollbar":{width:8,height:8},"*::-webkit-scrollbar-thumb":{background:t.grey[300],borderRadius:8},"*::-webkit-scrollbar-thumb:hover":{background:t.grey[400]}}},MuiButton:{defaultProps:{disableElevation:!0},styleOverrides:{root:{borderRadius:6,fontWeight:600,padding:"7px 18px"},containedPrimary:{boxShadow:ki.primaryGlow,"&:hover":{boxShadow:ki.primaryGlowHover,backgroundColor:t.primary.dark}},outlined:{borderColor:t.grey[300]},sizeLarge:{padding:"10px 22px",fontSize:"0.9375rem"}}},MuiIconButton:{styleOverrides:{root:{borderRadius:8}}},MuiCard:{styleOverrides:{root:{borderRadius:10,border:`1px solid ${t.grey[200]}`,boxShadow:ki.card,backgroundImage:"none"}}},MuiCardHeader:{defaultProps:{titleTypographyProps:{variant:"h5"},subheaderTypographyProps:{variant:"caption"}},styleOverrides:{root:{padding:20}}},MuiCardContent:{styleOverrides:{root:{padding:20,"&:last-child":{paddingBottom:20}}}},MuiPaper:{defaultProps:{elevation:0},styleOverrides:{rounded:{borderRadius:10}}},MuiChip:{styleOverrides:{root:{borderRadius:6,fontWeight:600,fontSize:"0.75rem"},sizeSmall:{height:22},label:{paddingLeft:8,paddingRight:8}}},MuiTableCell:{styleOverrides:{root:{borderColor:t.grey[200],padding:"12px 16px",fontSize:"0.8125rem"},head:{fontWeight:600,color:t.grey[600],backgroundColor:t.grey[50],textTransform:"none",whiteSpace:"nowrap"}}},MuiTableRow:{styleOverrides:{root:{"&:hover":{backgroundColor:t.primary.lighter+"66"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:8,backgroundColor:t.background.paper,"& .MuiOutlinedInput-notchedOutline":{borderColor:t.grey[300]},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:t.grey[400]}},input:{padding:"11px 14px"}}},MuiInputLabel:{styleOverrides:{root:{color:t.grey[600],fontSize:"0.875rem"}}},MuiTab:{styleOverrides:{root:{textTransform:"none",fontWeight:600,minHeight:46,fontSize:"0.875rem"}}},MuiTabs:{styleOverrides:{indicator:{height:3,borderRadius:3}}},MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:t.grey[800],borderRadius:6,fontSize:"0.75rem",padding:"6px 10px"}}},MuiDialog:{styleOverrides:{paper:{borderRadius:12}}},MuiAvatar:{styleOverrides:{root:{fontWeight:600,fontSize:"0.875rem"}}},MuiListItemButton:{styleOverrides:{root:{borderRadius:8}}},MuiLinearProgress:{styleOverrides:{root:{borderRadius:8,height:6,backgroundColor:t.grey[200]}}},MuiMenu:{styleOverrides:{paper:{borderRadius:10,boxShadow:ki.dropdown,marginTop:4}}}}}let xd=Xf({palette:l_,typography:u_,shape:{borderRadius:6},customShadows:ki,mixins:{toolbar:{minHeight:64}}});xd.components=c_(xd);const d_="modulepreload",f_=function(e){return"/"+e},dg={},Ht=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=f_(l),l in dg)return;dg[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":d_,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((h,x)=>{d.addEventListener("load",h),d.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};var dp={},rc={};const p_=Yn(Hb);var fg;function En(){return fg||(fg=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=p_}(rc)),rc}var h_=Ut;Object.defineProperty(dp,"__esModule",{value:!0});var x1=dp.default=void 0,m_=h_(En()),g_=b;x1=dp.default=(0,m_.default)((0,g_.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu");var fp={},v_=Ut;Object.defineProperty(fp,"__esModule",{value:!0});var wd=fp.default=void 0,y_=v_(En()),x_=b;wd=fp.default=(0,y_.default)((0,x_.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search");var pp={},w_=Ut;Object.defineProperty(pp,"__esModule",{value:!0});var hp=pp.default=void 0,S_=w_(En()),E_=b;hp=pp.default=(0,S_.default)((0,E_.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined");var mp={},C_=Ut;Object.defineProperty(mp,"__esModule",{value:!0});var w1=mp.default=void 0,k_=C_(En()),b_=b;w1=mp.default=(0,k_.default)((0,b_.jsx)("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z"}),"Logout");const P_="/Doormile-logo.png";function S1({onDark:e=!1,compact:t=!1,height:n=26,sx:r}){if(t){const o=e?"#FFFFFF":"#C01227",i=e?"#C01227":"#FFFFFF";return b.jsx(xe,{sx:{display:"flex",alignItems:"center",...r},children:b.jsx(xe,{sx:{width:34,height:34,borderRadius:2,bgcolor:o,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:e?"none":"0 4px 10px rgba(192, 18, 39,0.30)"},children:b.jsx(St,{sx:{color:i,fontWeight:800,fontSize:"1.25rem",lineHeight:1},children:"D"})})})}return b.jsx(xe,{sx:{display:"flex",alignItems:"center",...r},children:b.jsx(xe,{component:"img",src:P_,alt:"Doormile",sx:{height:n,width:"auto",display:"block",filter:e?"none":"brightness(0) saturate(100%) invert(15%) sepia(93%) saturate(5437%) hue-rotate(346deg) brightness(81%) contrast(92%)"}})})}const dO=e=>String(e||"").replace(/[_-]+/g," ").replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/\s+/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim(),T_=(e="")=>{let t=0;for(let r=0;re.split(" ").filter(Boolean).slice(0,2).map(t=>t[0]).join("").toUpperCase();function $_({name:e="",size:t=32,sx:n}){return b.jsx(vd,{sx:{width:t,height:t,bgcolor:T_(e),fontSize:t*.42,...n},children:R_(e)})}const In="https://api.doormile.com/api/v1",Qn=()=>{const e=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...e?{Authorization:`Bearer ${e}`}:{}}},Jr=e=>e.status===204?{}:e.json().catch(()=>({})),E1=e=>Array.isArray(e)?e:Array.isArray(e==null?void 0:e.data)?e.data:[];async function M_(){const e=await fetch(`${In}/crm/clients?limit=1000`,{headers:Qn()});if(!e.ok)throw new Error("Failed to fetch clients");const t=await e.json();return E1(t)}async function fO(e,t){const n=await fetch(`${In}/admin/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||"Failed to login")}return n.json()}async function pO(e){const t=await fetch(`${In}/crm/clients`,{method:"POST",headers:Qn(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(n.error||n.message||"Failed to create client")}return Jr(t)}async function hO(e,t){const n=await fetch(`${In}/crm/clients/${e}`,{method:"PUT",headers:Qn(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||r.message||"Failed to update client")}return Jr(n)}async function mO(e){const t=await fetch(`${In}/crm/clients/${e}`,{method:"DELETE",headers:Qn()});if(!t.ok)throw new Error("Failed to delete client");return Jr(t)}async function __(){const e=await fetch(`${In}/admin/users?limit=1000`,{headers:Qn()});if(!e.ok)throw new Error("Failed to fetch users");const t=await e.json();return E1(t)}async function gO(e){const t=await fetch(`${In}/admin/users`,{method:"POST",headers:Qn(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(n.error||n.message||"Failed to create user")}return Jr(t)}async function vO(e,t){const n=await fetch(`${In}/admin/users/${e}`,{method:"PUT",headers:Qn(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||r.message||"Failed to update user")}return Jr(n)}async function yO(e){const t=await fetch(`${In}/admin/users/${e}`,{method:"DELETE",headers:Qn()});if(!t.ok)throw new Error("Failed to delete user");return Jr(t)}async function xO(e){const t=await fetch(`${In}/admin/competitor-branches/${e}`,{method:"DELETE",headers:Qn()});if(!t.ok)throw new Error("Failed to delete survey record");return Jr(t)}const O_=e=>"CLI-"+String(e).replace(/[^a-zA-Z0-9]/g,"").toUpperCase().substring(0,6).padStart(6,"0");function L_(e){const t=e.payload??e,n=t.id??e.id,r=O_(n);return{id:n,logicalId:r,clientId:r,name:t.first_name?`${t.first_name} ${t.last_name||""}`.trim():t.name||"—",email:t.email||"",phone:t.phone||"",city:t.city||"",businessState:t.businessState||"",businessType:t.businessType||"",status:t.status||"unknown",parcelVolume:Number(t.parcelVolume)||0,activeContracts:Number(t.activeContracts)||0,frequency:t.frequency||"",provider:t.provider||"",efficiency:t.efficiency||"",logisticsSegment:t.logisticsSegment||"",transitFrom:t.transitFrom||"",transitTo:t.transitTo||"",neighbourhood:t.neighbourhood||t.surveyZone||"",surveyAddress:t.surveyAddress||t.address||"",surveyLat:t.survey_lat??t.surveyLat??"",surveyLng:t.survey_long??t.surveyLng??"",dataConsent:t.dataConsent||"",lastUpdated:t.lastUpdated||"",pincode:t.pincode||t.postal_code||"",notes:t.notes||""}}function wO(e){const t=e.payload??e;return{id:t.id??e.id,name:t.first_name?`${t.first_name} ${t.last_name||""}`.trim():t.name||"—",email:t.email||"",phone:t.phone||"",role:t.role||"unknown",pin:t.pin||""}}const pg="#C01227";function I_({onToggle:e}){var R;const t=gs(),[n,r]=v.useState(null),[o,i]=v.useState("");let s={name:"Admin",role:"Operations Admin",id:0};try{const _=localStorage.getItem("user");_&&(s=JSON.parse(_))}catch{}const[a,l]=v.useState(s.name||"Admin"),u=s.role==="admin"?"Administrator":s.role==="manager"?"Manager":s.role==="executive"?"Executive":"Operations Admin",c=a.charAt(0).toUpperCase(),d=v.useRef(null),[h,x]=v.useState([]),[y,g]=v.useState(!1),[S,p]=v.useState(!1),[m,f]=v.useState(!1);v.useEffect(()=>{__().then(_=>{if(s.email){const A=_.find(z=>z.email===s.email);if(A&&A.first_name){l(A.first_name);const z={...s,name:A.first_name};localStorage.setItem("user",JSON.stringify(z))}}}).catch(console.error)},[]);const w=()=>{y||S||(p(!0),M_().then(_=>x(_.map(L_))).catch(()=>{}).finally(()=>{g(!0),p(!1)}))},P=o.trim().toLowerCase(),E=P?h.filter(_=>[_.name,_.city,_.businessType,_.phone].join(" ").toLowerCase().includes(P)).slice(0,6):[],k=_=>{i(_.target.value),w(),f(!0)},M=_=>{t(`/tenants?q=${encodeURIComponent(_)}`),i(""),f(!1)},D=_=>{_.preventDefault();const A=o.trim();A&&M(A)};return b.jsx(WP,{position:"fixed",elevation:0,sx:{bgcolor:"#fff",color:"grey.800",zIndex:_=>_.zIndex.drawer+1,borderBottom:1,borderColor:"divider"},children:b.jsxs(cp,{sx:{minHeight:64,px:{xs:1.5,sm:2.5},gap:1},children:[b.jsx(_P,{color:"inherit",edge:"start",onClick:e,sx:{mr:.5},children:b.jsx(x1,{})}),b.jsx(xe,{onClick:()=>t("/dashboard"),sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:b.jsx(S1,{height:22})}),b.jsx(xe,{sx:{flexGrow:1}}),b.jsx(t$,{onClickAway:()=>f(!1),children:b.jsxs(xe,{sx:{display:{xs:"none",sm:"block"},position:"relative"},children:[b.jsxs(xe,{ref:d,component:"form",onSubmit:D,sx:{display:"flex",alignItems:"center",bgcolor:"grey.100",borderRadius:2,px:1.5,py:.5,width:{sm:240,md:320},"&:hover":{bgcolor:"grey.200"},"&:focus-within":{bgcolor:"grey.200"}},children:[b.jsx(wd,{sx:{fontSize:20,mr:1,color:"grey.500"}}),b.jsx(TR,{value:o,onChange:k,onFocus:()=>{w(),o.trim()&&f(!0)},placeholder:"Search clients…",sx:{color:"grey.800",fontSize:"0.875rem",flex:1,"&::placeholder":{color:"grey.500"}},inputProps:{"aria-label":"search"}})]}),b.jsx(up,{open:m&&!!P,anchorEl:d.current,placement:"bottom-start",style:{zIndex:1400,width:(R=d.current)==null?void 0:R.offsetWidth},children:b.jsx(lu,{sx:{mt:1,borderRadius:2,overflow:"hidden",boxShadow:"0 8px 24px rgba(0,0,0,0.18)"},children:S&&E.length===0?b.jsx(xe,{sx:{display:"flex",justifyContent:"center",py:2.5},children:b.jsx(o1,{size:20})}):E.length===0?b.jsx(xe,{sx:{px:2,py:2},children:b.jsxs(St,{variant:"body2",color:"text.secondary",children:["No clients match “",o.trim(),"”."]})}):b.jsxs(b.Fragment,{children:[E.map(_=>b.jsxs(ea,{onClick:()=>M(_.name),sx:{py:1,gap:1.25},children:[b.jsx($_,{name:_.name,size:30}),b.jsxs(xe,{sx:{minWidth:0},children:[b.jsx(St,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},noWrap:!0,children:_.name}),b.jsx(St,{variant:"caption",color:"text.secondary",noWrap:!0,children:[_.businessType,_.city].filter(Boolean).join(" · ")||_.phone})]})]},_.id)),b.jsx(Ea,{}),b.jsxs(ea,{onClick:()=>M(o.trim()),sx:{py:1.25,color:"primary.main",fontWeight:600},children:[b.jsx(wd,{fontSize:"small",sx:{mr:1}}),"See all results for “",o.trim(),"”"]})]})})})]})}),b.jsxs(xe,{onClick:_=>r(_.currentTarget),sx:{display:"flex",alignItems:"center",gap:1,ml:.5,cursor:"pointer",py:.5,px:.5,borderRadius:2,"&:hover":{bgcolor:"grey.100"}},children:[b.jsx(vd,{sx:{width:34,height:34,bgcolor:pg,color:"#fff",fontWeight:700},children:c}),b.jsxs(xe,{sx:{display:{xs:"none",md:"block"},lineHeight:1.1},children:[b.jsx(St,{variant:"subtitle2",sx:{color:"grey.800",fontWeight:600},children:a}),b.jsx(St,{variant:"caption",sx:{color:"text.secondary",textTransform:"capitalize"},children:u})]})]}),b.jsxs(RM,{anchorEl:n,open:!!n,onClose:()=>r(null),transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},PaperProps:{sx:{mt:1,minWidth:220}},children:[b.jsx(xe,{sx:{px:2,py:1.5},children:b.jsxs(H$,{direction:"row",spacing:1.5,alignItems:"center",children:[b.jsx(vd,{sx:{width:38,height:38,bgcolor:pg,color:"#fff",fontWeight:700},children:c}),b.jsxs(xe,{sx:{lineHeight:1.2},children:[b.jsx(St,{variant:"subtitle2",sx:{fontWeight:700},children:a}),b.jsx(St,{variant:"caption",color:"text.secondary",sx:{textTransform:"capitalize"},children:u})]})]})}),b.jsx(Ea,{}),b.jsxs(ea,{onClick:()=>{r(null),t("/settings")},children:[b.jsx(al,{children:b.jsx(hp,{fontSize:"small"})}),"Settings"]}),b.jsx(Ea,{}),b.jsxs(ea,{onClick:()=>{r(null),localStorage.removeItem("auth_token"),t("/login")},sx:{color:"error.main"},children:[b.jsx(al,{children:b.jsx(w1,{fontSize:"small",color:"error"})}),"Logout"]})]})]})})}var gp={},j_=Ut;Object.defineProperty(gp,"__esModule",{value:!0});var C1=gp.default=void 0,D_=j_(En()),A_=b;C1=gp.default=(0,D_.default)((0,A_.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");var vp={},N_=Ut;Object.defineProperty(vp,"__esModule",{value:!0});var k1=vp.default=void 0,z_=N_(En()),F_=b;k1=vp.default=(0,z_.default)((0,F_.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var yp={},B_=Ut;Object.defineProperty(yp,"__esModule",{value:!0});var b1=yp.default=void 0,W_=B_(En()),U_=b;b1=yp.default=(0,W_.default)((0,U_.jsx)("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");var xp={},H_=Ut;Object.defineProperty(xp,"__esModule",{value:!0});var Sd=xp.default=void 0,V_=H_(En()),Y_=b;Sd=xp.default=(0,V_.default)((0,Y_.jsx)("path",{d:"M19 5v2h-4V5zM9 5v6H5V5zm10 8v6h-4v-6zM9 17v2H5v-2zM21 3h-8v6h8zM11 3H3v10h8zm10 8h-8v10h8zm-10 4H3v6h8z"}),"DashboardOutlined");var wp={},K_=Ut;Object.defineProperty(wp,"__esModule",{value:!0});var P1=wp.default=void 0,G_=K_(En()),Q_=b;P1=wp.default=(0,G_.default)((0,Q_.jsx)("path",{d:"M17 11V3H7v4H3v14h8v-4h2v4h8V11zM7 19H5v-2h2zm0-4H5v-2h2zm0-4H5V9h2zm4 4H9v-2h2zm0-4H9V9h2zm0-4H9V5h2zm4 8h-2v-2h2zm0-4h-2V9h2zm0-4h-2V5h2zm4 12h-2v-2h2zm0-4h-2v-2h2z"}),"ApartmentOutlined");var Sp={},X_=Ut;Object.defineProperty(Sp,"__esModule",{value:!0});var T1=Sp.default=void 0,q_=X_(En()),Z_=b;T1=Sp.default=(0,q_.default)((0,Z_.jsx)("path",{d:"M4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58C.48 14.9 0 15.62 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29M20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m4 3.43c0-.81-.48-1.53-1.22-1.85-.85-.37-1.79-.58-2.78-.58-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24zm-7.76-2.78c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9C6.68 14.13 6 15.21 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74M8.07 16c.09-.23.13-.39.91-.69.97-.38 1.99-.56 3.02-.56s2.05.18 3.02.56c.77.3.81.46.91.69zM12 8c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m0-2c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"GroupsOutlined");var Ep={},J_=Ut;Object.defineProperty(Ep,"__esModule",{value:!0});var R1=Ep.default=void 0,eO=J_(En()),tO=b;R1=Ep.default=(0,eO.default)((0,tO.jsx)("path",{d:"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4"}),"AttachMoneyOutlined");const hg=[{group:"CRM",items:[{id:"dashboard",title:"Dashboard",url:"/dashboard",icon:Sd},{id:"tenants",title:"Clients",url:"/tenants",icon:P1},{id:"survey",title:"Survey",url:"/survey",icon:Sd},{id:"pricing",title:"Pricing Matrix",url:"/pricing",icon:R1},{id:"team-users",title:"App Users",url:"/team-users",icon:T1}]},{group:"System",items:[{id:"settings",title:"Settings",url:"/settings",icon:hp}]}],Ca=264,Ed=78,ut="#C01227";function mg({item:e,open:t,active:n,depth:r=0,onClick:o}){const i=e.icon,s=b.jsxs(u1,{selected:n,onClick:o,sx:{minHeight:44,my:.25,mx:t?1:.75,px:t?1.5:0,justifyContent:t?"flex-start":"center",borderRadius:2,color:n?ut:"grey.700","& .MuiListItemIcon-root":{color:n?ut:"grey.500"},"&:hover":{bgcolor:ji(ut,.04),color:ut,"& .MuiListItemIcon-root":{color:ut}},"&.Mui-selected":{bgcolor:ji(ut,.08),color:ut,"& .MuiListItemIcon-root":{color:ut},borderLeft:t?`4px solid ${ut}`:"none","&:hover":{bgcolor:ji(ut,.12)}}},children:[b.jsx(al,{sx:{minWidth:t?34:"auto",justifyContent:"center"},children:r>0&&!i?b.jsx(b1,{sx:{fontSize:8}}):i?b.jsx(i,{fontSize:"small"}):null}),t&&b.jsx(c1,{primary:e.title,primaryTypographyProps:{fontSize:"0.875rem",fontWeight:n?700:500}})]});return t?s:b.jsx(p1,{title:e.title,placement:"right",children:s})}function nO({open:e,mobileOpen:t,onMobileClose:n,isMobile:r}){const o=Xr(),i=gs(),s=x=>x&&o.pathname.startsWith(x),a=e||r,l=hg.flatMap(x=>x.items).filter(x=>x.children&&x.children.some(y=>s(y.url))).map(x=>x.id),[u,c]=v.useState(l),d=x=>{i(x),r&&n()},h=b.jsxs(xe,{sx:{bgcolor:"#fff",height:"100%",color:"grey.800",display:"flex",flexDirection:"column",borderRight:1,borderColor:"divider"},children:[b.jsx(cp,{sx:{px:a?2.5:0,justifyContent:a?"flex-start":"center",minHeight:64},children:b.jsx(S1,{compact:!a})}),b.jsx(xe,{sx:{overflowY:"auto",overflowX:"hidden",flexGrow:1,pb:2},children:hg.map(x=>b.jsxs(xe,{sx:{mt:1},children:[a&&b.jsx(St,{variant:"overline",sx:{px:2.5,color:"#A06060",fontSize:"0.6875rem",letterSpacing:"0.08em",fontWeight:700},children:x.group}),b.jsx(l1,{disablePadding:!0,sx:{mt:.5},children:x.items.map(y=>{if(y.children){const g=u.includes(y.id),S=y.children.some(f=>s(f.url)),p=y.icon,m=b.jsxs(u1,{onClick:()=>a?c(f=>f.includes(y.id)?f.filter(w=>w!==y.id):[...f,y.id]):d(y.children[0].url),sx:{minHeight:44,my:.25,mx:a?1:.75,px:a?1.5:0,justifyContent:a?"flex-start":"center",borderRadius:2,color:S?ut:"grey.700",bgcolor:S&&!g?ji(ut,.08):"transparent","& .MuiListItemIcon-root":{color:S?ut:"grey.500"},"&:hover":{bgcolor:ji(ut,.04),color:ut,"& .MuiListItemIcon-root":{color:ut}}},children:[b.jsx(al,{sx:{minWidth:a?34:"auto",justifyContent:"center"},children:b.jsx(p,{fontSize:"small"})}),a&&b.jsxs(b.Fragment,{children:[b.jsx(c1,{primary:y.title,primaryTypographyProps:{fontSize:"0.875rem",fontWeight:500}}),g?b.jsx(C1,{fontSize:"small"}):b.jsx(k1,{fontSize:"small"})]})]});return b.jsxs(xe,{children:[a?m:b.jsx(p1,{title:y.title,placement:"right",children:m}),a&&b.jsx(U0,{in:g,timeout:"auto",unmountOnExit:!0,children:b.jsx(xe,{sx:{pl:1.5},children:y.children.map(f=>b.jsx(mg,{item:f,open:!0,depth:1,active:s(f.url),onClick:()=>d(f.url)},f.id))})})]},y.id)}return b.jsx(mg,{item:y,open:a,active:s(y.url),onClick:()=>d(y.url)},y.id)})})]},x.group))}),a&&b.jsx(xe,{sx:{p:2,borderTop:"1px solid",borderColor:"divider"},children:b.jsx(St,{variant:"caption",sx:{color:"text.secondary"},children:"Doormile CRM v1.0"})})]});return r?b.jsx(ng,{variant:"temporary",open:t,onClose:n,ModalProps:{keepMounted:!0},sx:{"& .MuiDrawer-paper":{width:Ca,border:"none"}},children:h}):b.jsx(ng,{variant:"permanent",sx:{width:e?Ca:Ed,flexShrink:0,whiteSpace:"nowrap","& .MuiDrawer-paper":{width:e?Ca:Ed,border:"none",overflowX:"hidden",transition:x=>x.transitions.create("width",{duration:x.transitions.duration.standard})}},open:e,children:h})}function rO(){const e=Zr(),t=YC(e.breakpoints.down("lg")),[n,r]=v.useState(!0),[o,i]=v.useState(!1),s=()=>{t?i(a=>!a):r(a=>!a)};return b.jsxs(xe,{sx:{display:"flex",bgcolor:"background.default",minHeight:"100vh"},children:[b.jsx(I_,{onToggle:s}),b.jsx(nO,{open:n,isMobile:t,mobileOpen:o,onMobileClose:()=>i(!1)}),b.jsxs(xe,{component:"main",sx:{flexGrow:1,width:{lg:`calc(100% - ${n?Ca:Ed}px)`},minHeight:"100vh",transition:e.transitions.create("width",{duration:e.transitions.duration.standard})},children:[b.jsx(cp,{sx:{minHeight:64}}),b.jsx(xe,{sx:{p:{xs:2,sm:3}},children:b.jsx(kf,{})})]})]})}function oO(){return b.jsx(xe,{sx:{minHeight:"100vh",bgcolor:"background.default"},children:b.jsx(kf,{})})}function iO({children:e}){return localStorage.getItem("logged_in")?e||b.jsx(kf,{}):b.jsx(Ny,{to:"/login",replace:!0})}const Vt=e=>{const t=v.lazy(e);return b.jsx(v.Suspense,{fallback:b.jsx(xe,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"60vh"},children:b.jsx(o1,{color:"primary"})}),children:b.jsx(t,{})})};function sO(){return b.jsxs(s2,{children:[b.jsxs(st,{element:b.jsx(iO,{children:b.jsx(rO,{})}),children:[b.jsx(st,{path:"/dashboard",element:Vt(()=>Ht(()=>import("./Dashboard-C9wQ4JPv.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))}),b.jsx(st,{path:"/tenants",element:Vt(()=>Ht(()=>import("./Tenants-BNEm3NVI.js"),__vite__mapDeps([9,10,1,11,7,12,13,2,3,4,14,15,16,5,17,6])))}),b.jsx(st,{path:"/survey",element:Vt(()=>Ht(()=>import("./Survey-Coph8xEf.js"),__vite__mapDeps([18,10,11,7,12,13,14,4,3,17,5])))}),b.jsx(st,{path:"/pricing",element:Vt(()=>Ht(()=>import("./Pricing-BbUkW6tl.js"),__vite__mapDeps([19,10,16,13,4,3,12,17,5,6,7])))}),b.jsx(st,{path:"/team-users",element:Vt(()=>Ht(()=>import("./TeamUsers-Csrvkh6_.js"),__vite__mapDeps([20,10,1,11,7,12,15,4,3,16,5,17,6])))}),b.jsx(st,{path:"/settings",element:Vt(()=>Ht(()=>import("./Settings-DhO0lsb-.js"),__vite__mapDeps([21,22,4,3,5,12,8,17])))})]}),b.jsxs(st,{element:b.jsx(oO,{}),children:[b.jsx(st,{path:"/login",element:Vt(()=>Ht(()=>import("./Login-lPugph-B.js"),__vite__mapDeps([23,22,3,12,17,5])))}),b.jsx(st,{path:"/under-construction",element:Vt(()=>Ht(()=>import("./UnderConstruction-DsmkPjmj.js"),__vite__mapDeps([24,25,5])))}),b.jsx(st,{path:"/coming-soon",element:Vt(()=>Ht(()=>import("./ComingSoon-DMAOAczX.js"),__vite__mapDeps([26,12,5])))}),b.jsx(st,{path:"/500",element:Vt(()=>Ht(()=>import("./Error500-Cot1QOxV.js"),__vite__mapDeps([27,25,5])))}),b.jsx(st,{path:"/404",element:Vt(()=>Ht(()=>import("./Error404-Bm5B4e4s.js"),__vite__mapDeps([28,25,5])))})]}),b.jsx(st,{path:"/",element:b.jsx(Ny,{to:"/dashboard",replace:!0})}),b.jsx(st,{path:"*",element:Vt(()=>Ht(()=>import("./Error404-Bm5B4e4s.js"),__vite__mapDeps([28,25,5])))})]})}oc.createRoot(document.getElementById("root")).render(b.jsx(gn.StrictMode,{children:b.jsxs(Nb,{theme:xd,children:[b.jsx(i$,{}),b.jsx(YM,{dateAdapter:a_,children:b.jsx(h2,{children:b.jsx(sO,{})})})]})}));export{On as $,gt as A,xe as B,o1 as C,Ea as D,hO as E,pO as F,lO as G,wd as H,_P as I,mO as J,p1 as K,U0 as L,ea as M,ji as N,xO as O,lu as P,vd as Q,vO as R,H$ as S,St as T,$_ as U,gO as V,yO as W,ep as X,Mt as Y,iu as Z,C as _,v as a,Yf as a0,Hr as a1,Zr as a2,Xe as a3,ks as a4,B0 as a5,TR as a6,tl as a7,cp as a8,NR as a9,SR as aA,bR as aB,ER as aC,ZC as aD,cO as aE,yR as aF,yr as aG,RM as aH,Db as aI,qr as aJ,Ja as aK,i1 as aa,UR as ab,Ak as ac,jk as ad,Or as ae,k0 as af,uO as ag,sl as ah,t$ as ai,zl as aj,Qo as ak,dP as al,Gl as am,Yu as an,Sn as ao,aO as ap,vR as aq,gR as ar,gs as as,S1 as at,fO as au,n1 as av,Fl as aw,Vf as ax,Jt as ay,kR as az,T1 as b,__ as c,P1 as d,L_ as e,M_ as f,wO as g,E0 as h,Ut as i,b as j,vn as k,Se as l,Ee as m,ve as n,Y as o,J as p,ue as q,En as r,el as s,dO as t,Hf as u,be as v,ne as w,up as x,Ae as y,gd as z}; +`),s_=(e,t)=>t?(...n)=>e(...n).locale(t):e;class a_{constructor({locale:t,formats:n,instance:r}={}){var o;this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.rawDayJsInstance=void 0,this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=o_,this.setLocaleToValue=i=>{const s=this.getCurrentLocaleCode();return s===i.locale()?i:i.locale(s)},this.hasUTCPlugin=()=>typeof lt.utc<"u",this.hasTimezonePlugin=()=>typeof lt.tz<"u",this.isSame=(i,s,a)=>{const l=this.setTimezone(s,this.getTimezone(i));return i.format(a)===l.format(a)},this.cleanTimezone=i=>{switch(i){case"default":return;case"system":return lt.tz.guess();default:return i}},this.createSystemDate=i=>{if(this.rawDayJsInstance)return this.rawDayJsInstance(i);if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const s=lt.tz.guess();return s!=="UTC"?lt.tz(i,s):lt(i)}return lt(i)},this.createUTCDate=i=>{if(!this.hasUTCPlugin())throw new Error(nc);return lt.utc(i)},this.createTZDate=(i,s)=>{if(!this.hasUTCPlugin())throw new Error(nc);if(!this.hasTimezonePlugin())throw new Error(cg);const a=i!==void 0&&!i.endsWith("Z");return lt(i).tz(this.cleanTimezone(s),a)},this.getLocaleFormats=()=>{const i=lt.Ls,s=this.locale||"en";let a=i[s];return a===void 0&&(r_(),a=i.en),a.formats},this.adjustOffset=i=>{if(!this.hasTimezonePlugin())return i;const s=this.getTimezone(i);if(s!=="UTC"){var a,l;const u=i.tz(this.cleanTimezone(s),!0);if(((a=u.$offset)!=null?a:0)===((l=i.$offset)!=null?l:0))return i;i.$offset=u.$offset}return i},this.date=i=>i===null?null:this.dayjs(i),this.dateWithTimezone=(i,s)=>{if(i===null)return null;let a;return s==="UTC"?a=this.createUTCDate(i):s==="system"||s==="default"&&!this.hasTimezonePlugin()?a=this.createSystemDate(i):a=this.createTZDate(i,s),this.locale===void 0?a:a.locale(this.locale)},this.getTimezone=i=>{if(this.hasTimezonePlugin()){var s;const a=(s=i.$x)==null?void 0:s.$timezone;if(a)return a}return this.hasUTCPlugin()&&i.isUTC()?"UTC":"system"},this.setTimezone=(i,s)=>{if(this.getTimezone(i)===s)return i;if(s==="UTC"){if(!this.hasUTCPlugin())throw new Error(nc);return i.utc()}if(s==="system")return i.local();if(!this.hasTimezonePlugin()){if(s==="default")return i;throw new Error(cg)}return lt.tz(i,this.cleanTimezone(s))},this.toJsDate=i=>i.toDate(),this.parseISO=i=>this.dayjs(i),this.toISO=i=>i.toISOString(),this.parse=(i,s)=>i===""?null:this.dayjs(i,s,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=i=>{const s=this.getLocaleFormats(),a=l=>l.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(u,c,d)=>c||d.slice(1));return i.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(l,u,c)=>{const d=c&&c.toUpperCase();return u||s[c]||a(s[d])})},this.getFormatHelperText=i=>this.expandFormat(i).replace(/a/gi,"(a|p)m").toLocaleLowerCase(),this.isNull=i=>i===null,this.isValid=i=>this.dayjs(i).isValid(),this.format=(i,s)=>this.formatByString(i,this.formats[s]),this.formatByString=(i,s)=>this.dayjs(i).format(s),this.formatNumber=i=>i,this.getDiff=(i,s,a)=>i.diff(s,a),this.isEqual=(i,s)=>i===null&&s===null?!0:this.dayjs(i).toDate().getTime()===this.dayjs(s).toDate().getTime(),this.isSameYear=(i,s)=>this.isSame(i,s,"YYYY"),this.isSameMonth=(i,s)=>this.isSame(i,s,"YYYY-MM"),this.isSameDay=(i,s)=>this.isSame(i,s,"YYYY-MM-DD"),this.isSameHour=(i,s)=>i.isSame(s,"hour"),this.isAfter=(i,s)=>i>s,this.isAfterYear=(i,s)=>this.hasUTCPlugin()?!this.isSameYear(i,s)&&i.utc()>s.utc():i.isAfter(s,"year"),this.isAfterDay=(i,s)=>this.hasUTCPlugin()?!this.isSameDay(i,s)&&i.utc()>s.utc():i.isAfter(s,"day"),this.isBefore=(i,s)=>ithis.hasUTCPlugin()?!this.isSameYear(i,s)&&i.utc()this.hasUTCPlugin()?!this.isSameDay(i,s)&&i.utc()i>=s&&i<=a,this.startOfYear=i=>this.adjustOffset(i.startOf("year")),this.startOfMonth=i=>this.adjustOffset(i.startOf("month")),this.startOfWeek=i=>this.adjustOffset(i.startOf("week")),this.startOfDay=i=>this.adjustOffset(i.startOf("day")),this.endOfYear=i=>this.adjustOffset(i.endOf("year")),this.endOfMonth=i=>this.adjustOffset(i.endOf("month")),this.endOfWeek=i=>this.adjustOffset(i.endOf("week")),this.endOfDay=i=>this.adjustOffset(i.endOf("day")),this.addYears=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"year"):i.add(s,"year")),this.addMonths=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"month"):i.add(s,"month")),this.addWeeks=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"week"):i.add(s,"week")),this.addDays=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"day"):i.add(s,"day")),this.addHours=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"hour"):i.add(s,"hour")),this.addMinutes=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"minute"):i.add(s,"minute")),this.addSeconds=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"second"):i.add(s,"second")),this.getYear=i=>i.year(),this.getMonth=i=>i.month(),this.getDate=i=>i.date(),this.getHours=i=>i.hour(),this.getMinutes=i=>i.minute(),this.getSeconds=i=>i.second(),this.getMilliseconds=i=>i.millisecond(),this.setYear=(i,s)=>this.adjustOffset(i.set("year",s)),this.setMonth=(i,s)=>this.adjustOffset(i.set("month",s)),this.setDate=(i,s)=>this.adjustOffset(i.set("date",s)),this.setHours=(i,s)=>this.adjustOffset(i.set("hour",s)),this.setMinutes=(i,s)=>this.adjustOffset(i.set("minute",s)),this.setSeconds=(i,s)=>this.adjustOffset(i.set("second",s)),this.setMilliseconds=(i,s)=>this.adjustOffset(i.set("millisecond",s)),this.getDaysInMonth=i=>i.daysInMonth(),this.getNextMonth=i=>this.addMonths(i,1),this.getPreviousMonth=i=>this.addMonths(i,-1),this.getMonthArray=i=>{const a=[i.startOf("year")];for(;a.length<12;){const l=a[a.length-1];a.push(this.addMonths(l,1))}return a},this.mergeDateAndTime=(i,s)=>i.hour(s.hour()).minute(s.minute()).second(s.second()),this.getWeekdays=()=>{const i=this.dayjs().startOf("week");return[0,1,2,3,4,5,6].map(s=>this.formatByString(this.addDays(i,s),"dd"))},this.getWeekArray=i=>{const s=this.setLocaleToValue(i),a=s.startOf("month").startOf("week"),l=s.endOf("month").endOf("week");let u=0,c=a;const d=[];for(;ci.week(),this.getYearRange=(i,s)=>{const a=i.startOf("year"),l=s.endOf("year"),u=[];let c=a;for(;ci==="am"?"AM":"PM",this.rawDayJsInstance=r,this.dayjs=s_((o=this.rawDayJsInstance)!=null?o:lt,t),this.locale=t,this.formats=C({},i_,n),lt.extend(XM)}}const Ne={0:"#FFFFFF",50:"#FAFAFA",100:"#F5F5F5",200:"#F0F0F0",300:"#D9D9D9",400:"#BFBFBF",500:"#8C8C8C",600:"#595959",700:"#434343",800:"#262626",900:"#141414",A50:"#FAFAFB",A100:"#E6EBF1"},l_={mode:"light",common:{black:"#000000",white:"#FFFFFF"},primary:{lighter:"#F8E0E3",100:"#EFBBC1",200:"#E08A92",light:"#D6515C",400:"#CC2E3C",main:"#C01227",dark:"#9E0E20",700:"#870C1B",darker:"#7E0B17",900:"#520710",contrastText:"#FFFFFF"},secondary:{lighter:Ne[100],100:Ne[100],200:Ne[200],light:Ne[300],400:Ne[400],main:Ne[500],600:Ne[600],dark:Ne[700],800:Ne[800],darker:Ne[900],A100:Ne[0],A200:Ne[400],A300:Ne[700],contrastText:Ne[0]},error:{lighter:"#FEEAE9",light:"#F88078",main:"#F04134",dark:"#A82216",darker:"#7A150C",contrastText:"#FFFFFF"},warning:{lighter:"#FFF7E0",light:"#FFD666",main:"#FFBF00",dark:"#B38600",darker:"#805F00",contrastText:"#262626"},info:{lighter:"#E0F7F8",light:"#66CBD2",main:"#00A2AE",dark:"#00727B",darker:"#005159",contrastText:"#FFFFFF"},success:{lighter:"#E3F6EC",light:"#5CC98C",main:"#00A854",dark:"#00773B",darker:"#00552A",contrastText:"#FFFFFF"},grey:Ne,text:{primary:Ne[800],secondary:Ne[600],disabled:Ne[400]},action:{disabled:Ne[300],hover:"rgba(192, 18, 39, 0.04)",selected:"rgba(192, 18, 39, 0.08)"},divider:Ne[200],background:{paper:"#FFFFFF",default:Ne.A50}},u_={fontFamily:'"Public Sans", "Inter", "Helvetica", "Arial", sans-serif',htmlFontSize:16,fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:600,h1:{fontWeight:700,fontSize:"2.375rem",lineHeight:1.21},h2:{fontWeight:700,fontSize:"1.875rem",lineHeight:1.27},h3:{fontWeight:600,fontSize:"1.5rem",lineHeight:1.33},h4:{fontWeight:600,fontSize:"1.25rem",lineHeight:1.4},h5:{fontWeight:600,fontSize:"1rem",lineHeight:1.5},h6:{fontWeight:500,fontSize:"0.875rem",lineHeight:1.57},caption:{fontWeight:400,fontSize:"0.75rem",lineHeight:1.66},body1:{fontSize:"0.875rem",lineHeight:1.57},body2:{fontSize:"0.75rem",lineHeight:1.66},subtitle1:{fontSize:"0.875rem",fontWeight:600,lineHeight:1.57},subtitle2:{fontSize:"0.75rem",fontWeight:500,lineHeight:1.66},overline:{fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.08em",textTransform:"uppercase"},button:{textTransform:"capitalize",fontWeight:600}},ki={card:"0px 1px 4px rgba(0, 0, 0, 0.08)",cardHover:"0px 4px 16px rgba(0, 0, 0, 0.10)",widget:"0px 2px 14px rgba(38, 38, 38, 0.06)",dropdown:"0px 8px 24px rgba(38, 38, 38, 0.12)",primaryGlow:"0px 6px 16px rgba(192, 18, 39, 0.28)",primaryGlowHover:"0px 8px 20px rgba(192, 18, 39, 0.36)",header:"0px 1px 0px rgba(0, 0, 0, 0.06)"};function c_(e){const{palette:t}=e;return{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:t.background.default},"*::-webkit-scrollbar":{width:8,height:8},"*::-webkit-scrollbar-thumb":{background:t.grey[300],borderRadius:8},"*::-webkit-scrollbar-thumb:hover":{background:t.grey[400]}}},MuiButton:{defaultProps:{disableElevation:!0},styleOverrides:{root:{borderRadius:6,fontWeight:600,padding:"7px 18px"},containedPrimary:{boxShadow:ki.primaryGlow,"&:hover":{boxShadow:ki.primaryGlowHover,backgroundColor:t.primary.dark}},outlined:{borderColor:t.grey[300]},sizeLarge:{padding:"10px 22px",fontSize:"0.9375rem"}}},MuiIconButton:{styleOverrides:{root:{borderRadius:8}}},MuiCard:{styleOverrides:{root:{borderRadius:10,border:`1px solid ${t.grey[200]}`,boxShadow:ki.card,backgroundImage:"none"}}},MuiCardHeader:{defaultProps:{titleTypographyProps:{variant:"h5"},subheaderTypographyProps:{variant:"caption"}},styleOverrides:{root:{padding:20}}},MuiCardContent:{styleOverrides:{root:{padding:20,"&:last-child":{paddingBottom:20}}}},MuiPaper:{defaultProps:{elevation:0},styleOverrides:{rounded:{borderRadius:10}}},MuiChip:{styleOverrides:{root:{borderRadius:6,fontWeight:600,fontSize:"0.75rem"},sizeSmall:{height:22},label:{paddingLeft:8,paddingRight:8}}},MuiTableCell:{styleOverrides:{root:{borderColor:t.grey[200],padding:"12px 16px",fontSize:"0.8125rem"},head:{fontWeight:600,color:t.grey[600],backgroundColor:t.grey[50],textTransform:"none",whiteSpace:"nowrap"}}},MuiTableRow:{styleOverrides:{root:{"&:hover":{backgroundColor:t.primary.lighter+"66"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:8,backgroundColor:t.background.paper,"& .MuiOutlinedInput-notchedOutline":{borderColor:t.grey[300]},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:t.grey[400]}},input:{padding:"11px 14px"}}},MuiInputLabel:{styleOverrides:{root:{color:t.grey[600],fontSize:"0.875rem"}}},MuiTab:{styleOverrides:{root:{textTransform:"none",fontWeight:600,minHeight:46,fontSize:"0.875rem"}}},MuiTabs:{styleOverrides:{indicator:{height:3,borderRadius:3}}},MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:t.grey[800],borderRadius:6,fontSize:"0.75rem",padding:"6px 10px"}}},MuiDialog:{styleOverrides:{paper:{borderRadius:12}}},MuiAvatar:{styleOverrides:{root:{fontWeight:600,fontSize:"0.875rem"}}},MuiListItemButton:{styleOverrides:{root:{borderRadius:8}}},MuiLinearProgress:{styleOverrides:{root:{borderRadius:8,height:6,backgroundColor:t.grey[200]}}},MuiMenu:{styleOverrides:{paper:{borderRadius:10,boxShadow:ki.dropdown,marginTop:4}}}}}let xd=Xf({palette:l_,typography:u_,shape:{borderRadius:6},customShadows:ki,mixins:{toolbar:{minHeight:64}}});xd.components=c_(xd);const d_="modulepreload",f_=function(e){return"/"+e},dg={},Ht=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=f_(l),l in dg)return;dg[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":d_,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((h,x)=>{d.addEventListener("load",h),d.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};var dp={},rc={};const p_=Yn(Hb);var fg;function En(){return fg||(fg=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=p_}(rc)),rc}var h_=Ut;Object.defineProperty(dp,"__esModule",{value:!0});var x1=dp.default=void 0,m_=h_(En()),g_=b;x1=dp.default=(0,m_.default)((0,g_.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu");var fp={},v_=Ut;Object.defineProperty(fp,"__esModule",{value:!0});var wd=fp.default=void 0,y_=v_(En()),x_=b;wd=fp.default=(0,y_.default)((0,x_.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search");var pp={},w_=Ut;Object.defineProperty(pp,"__esModule",{value:!0});var hp=pp.default=void 0,S_=w_(En()),E_=b;hp=pp.default=(0,S_.default)((0,E_.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined");var mp={},C_=Ut;Object.defineProperty(mp,"__esModule",{value:!0});var w1=mp.default=void 0,k_=C_(En()),b_=b;w1=mp.default=(0,k_.default)((0,b_.jsx)("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z"}),"Logout");const P_="/Doormile-logo.png";function S1({onDark:e=!1,compact:t=!1,height:n=26,sx:r}){if(t){const o=e?"#FFFFFF":"#C01227",i=e?"#C01227":"#FFFFFF";return b.jsx(xe,{sx:{display:"flex",alignItems:"center",...r},children:b.jsx(xe,{sx:{width:34,height:34,borderRadius:2,bgcolor:o,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:e?"none":"0 4px 10px rgba(192, 18, 39,0.30)"},children:b.jsx(St,{sx:{color:i,fontWeight:800,fontSize:"1.25rem",lineHeight:1},children:"D"})})})}return b.jsx(xe,{sx:{display:"flex",alignItems:"center",...r},children:b.jsx(xe,{component:"img",src:P_,alt:"Doormile",sx:{height:n,width:"auto",display:"block",filter:e?"none":"brightness(0) saturate(100%) invert(15%) sepia(93%) saturate(5437%) hue-rotate(346deg) brightness(81%) contrast(92%)"}})})}const dO=e=>String(e||"").replace(/[_-]+/g," ").replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/\s+/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim(),T_=(e="")=>{let t=0;for(let r=0;re.split(" ").filter(Boolean).slice(0,2).map(t=>t[0]).join("").toUpperCase();function $_({name:e="",size:t=32,sx:n}){return b.jsx(vd,{sx:{width:t,height:t,bgcolor:T_(e),fontSize:t*.42,...n},children:R_(e)})}const In="https://api.doormile.com/api/v1",Qn=()=>{const e=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...e?{Authorization:`Bearer ${e}`}:{}}},Jr=e=>e.status===204?{}:e.json().catch(()=>({})),E1=e=>Array.isArray(e)?e:Array.isArray(e==null?void 0:e.data)?e.data:[];async function M_(){const e=await fetch(`${In}/crm/clients?limit=1000`,{headers:Qn()});if(!e.ok)throw new Error("Failed to fetch clients");const t=await e.json();return E1(t)}async function fO(e,t){const n=await fetch(`${In}/admin/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||"Failed to login")}return n.json()}async function pO(e){const t=await fetch(`${In}/crm/clients`,{method:"POST",headers:Qn(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(n.error||n.message||"Failed to create client")}return Jr(t)}async function hO(e,t){const n=await fetch(`${In}/crm/clients/${e}`,{method:"PUT",headers:Qn(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||r.message||"Failed to update client")}return Jr(n)}async function mO(e){const t=await fetch(`${In}/crm/clients/${e}`,{method:"DELETE",headers:Qn()});if(!t.ok)throw new Error("Failed to delete client");return Jr(t)}async function __(){const e=await fetch(`${In}/admin/users?limit=1000`,{headers:Qn()});if(!e.ok)throw new Error("Failed to fetch users");const t=await e.json();return E1(t)}async function gO(e){const t=await fetch(`${In}/admin/users`,{method:"POST",headers:Qn(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(n.error||n.message||"Failed to create user")}return Jr(t)}async function vO(e,t){const n=await fetch(`${In}/admin/users/${e}`,{method:"PUT",headers:Qn(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||r.message||"Failed to update user")}return Jr(n)}async function yO(e){const t=await fetch(`${In}/admin/users/${e}`,{method:"DELETE",headers:Qn()});if(!t.ok)throw new Error("Failed to delete user");return Jr(t)}async function xO(e){const t=await fetch(`${In}/admin/competitor-branches/${e}`,{method:"DELETE",headers:Qn()});if(!t.ok)throw new Error("Failed to delete survey record");return Jr(t)}const O_=e=>"CLI-"+String(e).replace(/[^a-zA-Z0-9]/g,"").toUpperCase().substring(0,6).padStart(6,"0");function L_(e){const t=e.payload??e,n=t.id??e.id,r=O_(n);return{id:n,logicalId:r,clientId:r,name:t.first_name?`${t.first_name} ${t.last_name||""}`.trim():t.name||"—",email:t.email||"",phone:t.phone||"",city:t.city||"",businessState:t.businessState||"",businessType:t.businessType||"",status:t.status||"unknown",parcelVolume:Number(t.parcelVolume)||0,activeContracts:Number(t.activeContracts)||0,frequency:t.frequency||"",provider:t.provider||"",efficiency:t.efficiency||"",logisticsSegment:t.logisticsSegment||"",transitFrom:t.transitFrom||"",transitTo:t.transitTo||"",neighbourhood:t.neighbourhood||t.surveyZone||"",surveyAddress:t.surveyAddress||t.address||"",surveyLat:t.survey_lat??t.surveyLat??"",surveyLng:t.survey_long??t.surveyLng??"",dataConsent:t.dataConsent||"",lastUpdated:t.lastUpdated||"",pincode:t.pincode||t.postal_code||"",notes:t.notes||""}}function wO(e){const t=e.payload??e;return{id:t.id??e.id,name:t.first_name?`${t.first_name} ${t.last_name||""}`.trim():t.name||"—",email:t.email||"",phone:t.phone||"",role:t.role||"unknown",pin:t.pin||""}}const pg="#C01227";function I_({onToggle:e}){var R;const t=gs(),[n,r]=v.useState(null),[o,i]=v.useState("");let s={name:"Admin",role:"Operations Admin",id:0};try{const _=localStorage.getItem("user");_&&(s=JSON.parse(_))}catch{}const[a,l]=v.useState(s.name||"Admin"),u=s.role==="admin"?"Administrator":s.role==="manager"?"Manager":s.role==="executive"?"Executive":"Operations Admin",c=a.charAt(0).toUpperCase(),d=v.useRef(null),[h,x]=v.useState([]),[y,g]=v.useState(!1),[S,p]=v.useState(!1),[m,f]=v.useState(!1);v.useEffect(()=>{__().then(_=>{if(s.email){const A=_.find(z=>z.email===s.email);if(A&&A.first_name){l(A.first_name);const z={...s,name:A.first_name};localStorage.setItem("user",JSON.stringify(z))}}}).catch(console.error)},[]);const w=()=>{y||S||(p(!0),M_().then(_=>x(_.map(L_))).catch(()=>{}).finally(()=>{g(!0),p(!1)}))},P=o.trim().toLowerCase(),E=P?h.filter(_=>[_.name,_.city,_.businessType,_.phone].join(" ").toLowerCase().includes(P)).slice(0,6):[],k=_=>{i(_.target.value),w(),f(!0)},M=_=>{t(`/tenants?q=${encodeURIComponent(_)}`),i(""),f(!1)},D=_=>{_.preventDefault();const A=o.trim();A&&M(A)};return b.jsx(WP,{position:"fixed",elevation:0,sx:{bgcolor:"#fff",color:"grey.800",zIndex:_=>_.zIndex.drawer+1,borderBottom:1,borderColor:"divider"},children:b.jsxs(cp,{sx:{minHeight:64,px:{xs:1.5,sm:2.5},gap:1},children:[b.jsx(_P,{color:"inherit",edge:"start",onClick:e,sx:{mr:.5},children:b.jsx(x1,{})}),b.jsx(xe,{onClick:()=>t("/dashboard"),sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:b.jsx(S1,{height:22})}),b.jsx(xe,{sx:{flexGrow:1}}),b.jsx(t$,{onClickAway:()=>f(!1),children:b.jsxs(xe,{sx:{display:{xs:"none",sm:"block"},position:"relative"},children:[b.jsxs(xe,{ref:d,component:"form",onSubmit:D,sx:{display:"flex",alignItems:"center",bgcolor:"grey.100",borderRadius:2,px:1.5,py:.5,width:{sm:240,md:320},"&:hover":{bgcolor:"grey.200"},"&:focus-within":{bgcolor:"grey.200"}},children:[b.jsx(wd,{sx:{fontSize:20,mr:1,color:"grey.500"}}),b.jsx(TR,{value:o,onChange:k,onFocus:()=>{w(),o.trim()&&f(!0)},placeholder:"Search clients…",sx:{color:"grey.800",fontSize:"0.875rem",flex:1,"&::placeholder":{color:"grey.500"}},inputProps:{"aria-label":"search"}})]}),b.jsx(up,{open:m&&!!P,anchorEl:d.current,placement:"bottom-start",style:{zIndex:1400,width:(R=d.current)==null?void 0:R.offsetWidth},children:b.jsx(lu,{sx:{mt:1,borderRadius:2,overflow:"hidden",boxShadow:"0 8px 24px rgba(0,0,0,0.18)"},children:S&&E.length===0?b.jsx(xe,{sx:{display:"flex",justifyContent:"center",py:2.5},children:b.jsx(o1,{size:20})}):E.length===0?b.jsx(xe,{sx:{px:2,py:2},children:b.jsxs(St,{variant:"body2",color:"text.secondary",children:["No clients match “",o.trim(),"”."]})}):b.jsxs(b.Fragment,{children:[E.map(_=>b.jsxs(ea,{onClick:()=>M(_.name),sx:{py:1,gap:1.25},children:[b.jsx($_,{name:_.name,size:30}),b.jsxs(xe,{sx:{minWidth:0},children:[b.jsx(St,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},noWrap:!0,children:_.name}),b.jsx(St,{variant:"caption",color:"text.secondary",noWrap:!0,children:[_.businessType,_.city].filter(Boolean).join(" · ")||_.phone})]})]},_.id)),b.jsx(Ea,{}),b.jsxs(ea,{onClick:()=>M(o.trim()),sx:{py:1.25,color:"primary.main",fontWeight:600},children:[b.jsx(wd,{fontSize:"small",sx:{mr:1}}),"See all results for “",o.trim(),"”"]})]})})})]})}),b.jsxs(xe,{onClick:_=>r(_.currentTarget),sx:{display:"flex",alignItems:"center",gap:1,ml:.5,cursor:"pointer",py:.5,px:.5,borderRadius:2,"&:hover":{bgcolor:"grey.100"}},children:[b.jsx(vd,{sx:{width:34,height:34,bgcolor:pg,color:"#fff",fontWeight:700},children:c}),b.jsxs(xe,{sx:{display:{xs:"none",md:"block"},lineHeight:1.1},children:[b.jsx(St,{variant:"subtitle2",sx:{color:"grey.800",fontWeight:600},children:a}),b.jsx(St,{variant:"caption",sx:{color:"text.secondary",textTransform:"capitalize"},children:u})]})]}),b.jsxs(RM,{anchorEl:n,open:!!n,onClose:()=>r(null),transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},PaperProps:{sx:{mt:1,minWidth:220}},children:[b.jsx(xe,{sx:{px:2,py:1.5},children:b.jsxs(H$,{direction:"row",spacing:1.5,alignItems:"center",children:[b.jsx(vd,{sx:{width:38,height:38,bgcolor:pg,color:"#fff",fontWeight:700},children:c}),b.jsxs(xe,{sx:{lineHeight:1.2},children:[b.jsx(St,{variant:"subtitle2",sx:{fontWeight:700},children:a}),b.jsx(St,{variant:"caption",color:"text.secondary",sx:{textTransform:"capitalize"},children:u})]})]})}),b.jsx(Ea,{}),b.jsxs(ea,{onClick:()=>{r(null),t("/settings")},children:[b.jsx(al,{children:b.jsx(hp,{fontSize:"small"})}),"Settings"]}),b.jsx(Ea,{}),b.jsxs(ea,{onClick:()=>{r(null),localStorage.removeItem("auth_token"),t("/login")},sx:{color:"error.main"},children:[b.jsx(al,{children:b.jsx(w1,{fontSize:"small",color:"error"})}),"Logout"]})]})]})})}var gp={},j_=Ut;Object.defineProperty(gp,"__esModule",{value:!0});var C1=gp.default=void 0,D_=j_(En()),A_=b;C1=gp.default=(0,D_.default)((0,A_.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");var vp={},N_=Ut;Object.defineProperty(vp,"__esModule",{value:!0});var k1=vp.default=void 0,z_=N_(En()),F_=b;k1=vp.default=(0,z_.default)((0,F_.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var yp={},B_=Ut;Object.defineProperty(yp,"__esModule",{value:!0});var b1=yp.default=void 0,W_=B_(En()),U_=b;b1=yp.default=(0,W_.default)((0,U_.jsx)("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");var xp={},H_=Ut;Object.defineProperty(xp,"__esModule",{value:!0});var Sd=xp.default=void 0,V_=H_(En()),Y_=b;Sd=xp.default=(0,V_.default)((0,Y_.jsx)("path",{d:"M19 5v2h-4V5zM9 5v6H5V5zm10 8v6h-4v-6zM9 17v2H5v-2zM21 3h-8v6h8zM11 3H3v10h8zm10 8h-8v10h8zm-10 4H3v6h8z"}),"DashboardOutlined");var wp={},K_=Ut;Object.defineProperty(wp,"__esModule",{value:!0});var P1=wp.default=void 0,G_=K_(En()),Q_=b;P1=wp.default=(0,G_.default)((0,Q_.jsx)("path",{d:"M17 11V3H7v4H3v14h8v-4h2v4h8V11zM7 19H5v-2h2zm0-4H5v-2h2zm0-4H5V9h2zm4 4H9v-2h2zm0-4H9V9h2zm0-4H9V5h2zm4 8h-2v-2h2zm0-4h-2V9h2zm0-4h-2V5h2zm4 12h-2v-2h2zm0-4h-2v-2h2z"}),"ApartmentOutlined");var Sp={},X_=Ut;Object.defineProperty(Sp,"__esModule",{value:!0});var T1=Sp.default=void 0,q_=X_(En()),Z_=b;T1=Sp.default=(0,q_.default)((0,Z_.jsx)("path",{d:"M4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58C.48 14.9 0 15.62 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29M20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m4 3.43c0-.81-.48-1.53-1.22-1.85-.85-.37-1.79-.58-2.78-.58-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24zm-7.76-2.78c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9C6.68 14.13 6 15.21 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74M8.07 16c.09-.23.13-.39.91-.69.97-.38 1.99-.56 3.02-.56s2.05.18 3.02.56c.77.3.81.46.91.69zM12 8c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m0-2c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"GroupsOutlined");var Ep={},J_=Ut;Object.defineProperty(Ep,"__esModule",{value:!0});var R1=Ep.default=void 0,eO=J_(En()),tO=b;R1=Ep.default=(0,eO.default)((0,tO.jsx)("path",{d:"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4"}),"AttachMoneyOutlined");const hg=[{group:"CRM",items:[{id:"dashboard",title:"Dashboard",url:"/dashboard",icon:Sd},{id:"tenants",title:"Clients",url:"/tenants",icon:P1},{id:"survey",title:"Survey",url:"/survey",icon:Sd},{id:"pricing",title:"Pricing Matrix",url:"/pricing",icon:R1},{id:"team-users",title:"App Users",url:"/team-users",icon:T1}]},{group:"System",items:[{id:"settings",title:"Settings",url:"/settings",icon:hp}]}],Ca=264,Ed=78,ut="#C01227";function mg({item:e,open:t,active:n,depth:r=0,onClick:o}){const i=e.icon,s=b.jsxs(u1,{selected:n,onClick:o,sx:{minHeight:44,my:.25,mx:t?1:.75,px:t?1.5:0,justifyContent:t?"flex-start":"center",borderRadius:2,color:n?ut:"grey.700","& .MuiListItemIcon-root":{color:n?ut:"grey.500"},"&:hover":{bgcolor:ji(ut,.04),color:ut,"& .MuiListItemIcon-root":{color:ut}},"&.Mui-selected":{bgcolor:ji(ut,.08),color:ut,"& .MuiListItemIcon-root":{color:ut},borderLeft:t?`4px solid ${ut}`:"none","&:hover":{bgcolor:ji(ut,.12)}}},children:[b.jsx(al,{sx:{minWidth:t?34:"auto",justifyContent:"center"},children:r>0&&!i?b.jsx(b1,{sx:{fontSize:8}}):i?b.jsx(i,{fontSize:"small"}):null}),t&&b.jsx(c1,{primary:e.title,primaryTypographyProps:{fontSize:"0.875rem",fontWeight:n?700:500}})]});return t?s:b.jsx(p1,{title:e.title,placement:"right",children:s})}function nO({open:e,mobileOpen:t,onMobileClose:n,isMobile:r}){const o=Xr(),i=gs(),s=x=>x&&o.pathname.startsWith(x),a=e||r,l=hg.flatMap(x=>x.items).filter(x=>x.children&&x.children.some(y=>s(y.url))).map(x=>x.id),[u,c]=v.useState(l),d=x=>{i(x),r&&n()},h=b.jsxs(xe,{sx:{bgcolor:"#fff",height:"100%",color:"grey.800",display:"flex",flexDirection:"column",borderRight:1,borderColor:"divider"},children:[b.jsx(cp,{sx:{px:a?2.5:0,justifyContent:a?"flex-start":"center",minHeight:64},children:b.jsx(S1,{compact:!a})}),b.jsx(xe,{sx:{overflowY:"auto",overflowX:"hidden",flexGrow:1,pb:2},children:hg.map(x=>b.jsxs(xe,{sx:{mt:1},children:[a&&b.jsx(St,{variant:"overline",sx:{px:2.5,color:"#A06060",fontSize:"0.6875rem",letterSpacing:"0.08em",fontWeight:700},children:x.group}),b.jsx(l1,{disablePadding:!0,sx:{mt:.5},children:x.items.map(y=>{if(y.children){const g=u.includes(y.id),S=y.children.some(f=>s(f.url)),p=y.icon,m=b.jsxs(u1,{onClick:()=>a?c(f=>f.includes(y.id)?f.filter(w=>w!==y.id):[...f,y.id]):d(y.children[0].url),sx:{minHeight:44,my:.25,mx:a?1:.75,px:a?1.5:0,justifyContent:a?"flex-start":"center",borderRadius:2,color:S?ut:"grey.700",bgcolor:S&&!g?ji(ut,.08):"transparent","& .MuiListItemIcon-root":{color:S?ut:"grey.500"},"&:hover":{bgcolor:ji(ut,.04),color:ut,"& .MuiListItemIcon-root":{color:ut}}},children:[b.jsx(al,{sx:{minWidth:a?34:"auto",justifyContent:"center"},children:b.jsx(p,{fontSize:"small"})}),a&&b.jsxs(b.Fragment,{children:[b.jsx(c1,{primary:y.title,primaryTypographyProps:{fontSize:"0.875rem",fontWeight:500}}),g?b.jsx(C1,{fontSize:"small"}):b.jsx(k1,{fontSize:"small"})]})]});return b.jsxs(xe,{children:[a?m:b.jsx(p1,{title:y.title,placement:"right",children:m}),a&&b.jsx(U0,{in:g,timeout:"auto",unmountOnExit:!0,children:b.jsx(xe,{sx:{pl:1.5},children:y.children.map(f=>b.jsx(mg,{item:f,open:!0,depth:1,active:s(f.url),onClick:()=>d(f.url)},f.id))})})]},y.id)}return b.jsx(mg,{item:y,open:a,active:s(y.url),onClick:()=>d(y.url)},y.id)})})]},x.group))}),a&&b.jsx(xe,{sx:{p:2,borderTop:"1px solid",borderColor:"divider"},children:b.jsx(St,{variant:"caption",sx:{color:"text.secondary"},children:"Doormile CRM v1.0"})})]});return r?b.jsx(ng,{variant:"temporary",open:t,onClose:n,ModalProps:{keepMounted:!0},sx:{"& .MuiDrawer-paper":{width:Ca,border:"none"}},children:h}):b.jsx(ng,{variant:"permanent",sx:{width:e?Ca:Ed,flexShrink:0,whiteSpace:"nowrap","& .MuiDrawer-paper":{width:e?Ca:Ed,border:"none",overflowX:"hidden",transition:x=>x.transitions.create("width",{duration:x.transitions.duration.standard})}},open:e,children:h})}function rO(){const e=Zr(),t=YC(e.breakpoints.down("lg")),[n,r]=v.useState(!0),[o,i]=v.useState(!1),s=()=>{t?i(a=>!a):r(a=>!a)};return b.jsxs(xe,{sx:{display:"flex",bgcolor:"background.default",minHeight:"100vh"},children:[b.jsx(I_,{onToggle:s}),b.jsx(nO,{open:n,isMobile:t,mobileOpen:o,onMobileClose:()=>i(!1)}),b.jsxs(xe,{component:"main",sx:{flexGrow:1,width:{lg:`calc(100% - ${n?Ca:Ed}px)`},minHeight:"100vh",transition:e.transitions.create("width",{duration:e.transitions.duration.standard})},children:[b.jsx(cp,{sx:{minHeight:64}}),b.jsx(xe,{sx:{p:{xs:2,sm:3}},children:b.jsx(kf,{})})]})]})}function oO(){return b.jsx(xe,{sx:{minHeight:"100vh",bgcolor:"background.default"},children:b.jsx(kf,{})})}function iO({children:e}){return localStorage.getItem("logged_in")?e||b.jsx(kf,{}):b.jsx(Ny,{to:"/login",replace:!0})}const Vt=e=>{const t=v.lazy(e);return b.jsx(v.Suspense,{fallback:b.jsx(xe,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"60vh"},children:b.jsx(o1,{color:"primary"})}),children:b.jsx(t,{})})};function sO(){return b.jsxs(s2,{children:[b.jsxs(st,{element:b.jsx(iO,{children:b.jsx(rO,{})}),children:[b.jsx(st,{path:"/dashboard",element:Vt(()=>Ht(()=>import("./Dashboard-DNc332tE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))}),b.jsx(st,{path:"/tenants",element:Vt(()=>Ht(()=>import("./Tenants-CtuW6TmF.js"),__vite__mapDeps([9,10,1,11,7,12,13,2,3,4,14,15,16,5,17,6])))}),b.jsx(st,{path:"/survey",element:Vt(()=>Ht(()=>import("./Survey-B7FNo3gA.js"),__vite__mapDeps([18,10,11,7,12,13,14,4,3,17,5])))}),b.jsx(st,{path:"/pricing",element:Vt(()=>Ht(()=>import("./Pricing-DRDC22ok.js"),__vite__mapDeps([19,10,16,13,4,3,12,17,5,6,7])))}),b.jsx(st,{path:"/team-users",element:Vt(()=>Ht(()=>import("./TeamUsers-Dv5yeZfk.js"),__vite__mapDeps([20,10,1,11,7,12,15,4,3,16,5,17,6])))}),b.jsx(st,{path:"/settings",element:Vt(()=>Ht(()=>import("./Settings-DCzsntaD.js"),__vite__mapDeps([21,22,4,3,5,12,8,17])))})]}),b.jsxs(st,{element:b.jsx(oO,{}),children:[b.jsx(st,{path:"/login",element:Vt(()=>Ht(()=>import("./Login-SNBlIs0y.js"),__vite__mapDeps([23,22,3,12,17,5])))}),b.jsx(st,{path:"/under-construction",element:Vt(()=>Ht(()=>import("./UnderConstruction-8igSl5Z8.js"),__vite__mapDeps([24,25,5])))}),b.jsx(st,{path:"/coming-soon",element:Vt(()=>Ht(()=>import("./ComingSoon-hlrj6HJr.js"),__vite__mapDeps([26,12,5])))}),b.jsx(st,{path:"/500",element:Vt(()=>Ht(()=>import("./Error500-CiU1ecHp.js"),__vite__mapDeps([27,25,5])))}),b.jsx(st,{path:"/404",element:Vt(()=>Ht(()=>import("./Error404-BKSqGNFt.js"),__vite__mapDeps([28,25,5])))})]}),b.jsx(st,{path:"/",element:b.jsx(Ny,{to:"/dashboard",replace:!0})}),b.jsx(st,{path:"*",element:Vt(()=>Ht(()=>import("./Error404-BKSqGNFt.js"),__vite__mapDeps([28,25,5])))})]})}oc.createRoot(document.getElementById("root")).render(b.jsx(gn.StrictMode,{children:b.jsxs(Nb,{theme:xd,children:[b.jsx(i$,{}),b.jsx(YM,{dateAdapter:a_,children:b.jsx(h2,{children:b.jsx(sO,{})})})]})}));export{On as $,gt as A,xe as B,o1 as C,Ea as D,hO as E,pO as F,lO as G,wd as H,_P as I,mO as J,p1 as K,U0 as L,ea as M,ji as N,xO as O,lu as P,vd as Q,vO as R,H$ as S,St as T,$_ as U,gO as V,yO as W,ep as X,Mt as Y,iu as Z,C as _,v as a,Yf as a0,Hr as a1,Zr as a2,Xe as a3,ks as a4,B0 as a5,TR as a6,tl as a7,cp as a8,NR as a9,SR as aA,bR as aB,ER as aC,ZC as aD,cO as aE,yR as aF,yr as aG,RM as aH,Db as aI,qr as aJ,Ja as aK,i1 as aa,UR as ab,Ak as ac,jk as ad,Or as ae,k0 as af,uO as ag,sl as ah,t$ as ai,zl as aj,Qo as ak,dP as al,Gl as am,Yu as an,Sn as ao,aO as ap,vR as aq,gR as ar,gs as as,S1 as at,fO as au,n1 as av,Fl as aw,Vf as ax,Jt as ay,kR as az,T1 as b,__ as c,P1 as d,L_ as e,M_ as f,wO as g,E0 as h,Ut as i,b as j,vn as k,Se as l,Ee as m,ve as n,Y as o,J as p,ue as q,En as r,el as s,dO as t,Hf as u,be as v,ne as w,up as x,Ae as y,gd as z}; diff --git a/dist/index.html b/dist/index.html index a9e2b72..35569fe 100644 --- a/dist/index.html +++ b/dist/index.html @@ -13,7 +13,7 @@ rel="stylesheet" /> Doormile CRM - +