@ukpc-lib/react 0.16.3-dev.0 → 0.16.3-dev.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,6 +7,7 @@ export type OwnMenuItemProps = {
7
7
  replacePath?(path: string): string;
8
8
  ssr?: boolean;
9
9
  brandColors?: ColorsType;
10
+ onClickItem?(path: string): void;
10
11
  };
11
12
  type MenuItemProps = {
12
13
  baseUrl: string;
@@ -18,8 +19,9 @@ type MenuItemProps = {
18
19
  params?: RenderParams;
19
20
  nodes?: NodeModel<MenuItemDto>[];
20
21
  isDrop?: boolean;
22
+ onClick?: (item: MenuItemDto) => void;
21
23
  } & OwnMenuItemProps;
22
- export default function MenuItem({ ...props }: MenuItemProps): import("react/jsx-runtime").JSX.Element;
24
+ export default function FavMenuItem({ ...props }: MenuItemProps): import("react/jsx-runtime").JSX.Element;
23
25
  export type FavoriteIconProps = {
24
26
  onClick?(_isFavorite: boolean): void;
25
27
  menuLevel?: number;
@@ -8,6 +8,7 @@ export type OwnMenuItemProps = {
8
8
  ssr?: boolean;
9
9
  brandColors?: ColorsType;
10
10
  isInternalApp?: boolean;
11
+ onClickItem?(path: string): void;
11
12
  };
12
13
  type MenuItemProps = {
13
14
  baseUrl: string;
@@ -1 +1,3 @@
1
- declare const checkResponseStatus: (status: number) => boolean;
1
+ import { MenuItemDto } from '../models';
2
+
3
+ export declare function getPath(item: MenuItemDto): string;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),C=require("react"),m=require("../index.esm2017-BOJSSD0C.cjs"),N=require("@mui/material");require("axios");const gn=require("react-router-dom");require("@r2wc/react-to-web-component");require("react-query");require("react-dom");const se=require("moment");function No(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const j=No(C),Ro=e=>{var r,o;const{tabs:t}=e,n=i=>{e.setCurrentTab(i.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),C=require("react"),m=require("../index.esm2017-xVJCd_op.cjs"),N=require("@mui/material");require("axios");const gn=require("react-router-dom");require("@r2wc/react-to-web-component");require("react-query");require("react-dom");const se=require("moment");function No(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const j=No(C),Ro=e=>{var r,o;const{tabs:t}=e,n=i=>{e.setCurrentTab(i.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
2
2
  .tab-title {
3
3
  min-width: 90px;
4
4
  padding: 5px 16px;
@@ -91,4 +91,4 @@ const theme2 = createTheme({ palette: {
91
91
  } });`:Qe(12,g?` (${g})`:"",JSON.stringify(a.main)));return vr(a,"light",w,r),vr(a,"dark",S,r),a.contrastText||(a.contrastText=h(a.main)),a},b={dark:qt,light:br};return process.env.NODE_ENV!=="production"&&(b[t]||console.error(`MUI: The palette mode \`${t}\` is not supported.`)),Se(m._extends({common:m._extends({},rt),mode:t,primary:p({color:i,name:"primary"}),secondary:p({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:c,name:"error"}),warning:p({color:d,name:"warning"}),info:p({color:u,name:"info"}),success:p({color:f,name:"success"}),grey:Ll,contrastThreshold:n,getContrastText:h,augmentColor:p,tonalOffset:r},b[t]),o)}const Gl=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];function Kl(e){return Math.round(e*1e5)/1e5}const Sr={textTransform:"uppercase"},wr='"Roboto", "Helvetica", "Arial", sans-serif';function Yl(e,t){const n=typeof t=="function"?t(e):t,{fontFamily:r=wr,fontSize:o=14,fontWeightLight:i=300,fontWeightRegular:s=400,fontWeightMedium:c=500,fontWeightBold:u=700,htmlFontSize:f=16,allVariants:d,pxToRem:h}=n,p=m._objectWithoutPropertiesLoose(n,Gl);process.env.NODE_ENV!=="production"&&(typeof o!="number"&&console.error("MUI: `fontSize` is required to be a number."),typeof f!="number"&&console.error("MUI: `htmlFontSize` is required to be a number."));const b=o/14,y=h||(v=>`${v/f*b}rem`),a=(v,w,S,T,x)=>m._extends({fontFamily:r,fontWeight:v,fontSize:y(w),lineHeight:S},r===wr?{letterSpacing:`${Kl(T/w)}em`}:{},x,d),g={h1:a(i,96,1.167,-1.5),h2:a(i,60,1.2,-.5),h3:a(s,48,1.167,0),h4:a(s,34,1.235,.25),h5:a(s,24,1.334,0),h6:a(c,20,1.6,.15),subtitle1:a(s,16,1.75,.15),subtitle2:a(c,14,1.57,.1),body1:a(s,16,1.5,.15),body2:a(s,14,1.43,.15),button:a(c,14,1.75,.4,Sr),caption:a(s,12,1.66,.4),overline:a(s,12,2.66,1,Sr),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Se(m._extends({htmlFontSize:f,pxToRem:y,fontFamily:r,fontSize:o,fontWeightLight:i,fontWeightRegular:s,fontWeightMedium:c,fontWeightBold:u},g),p,{clone:!1})}const ql=.2,Zl=.14,Xl=.12;function Y(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${ql})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Zl})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Xl})`].join(",")}const Jl=["none",Y(0,2,1,-1,0,1,1,0,0,1,3,0),Y(0,3,1,-2,0,2,2,0,0,1,5,0),Y(0,3,3,-2,0,3,4,0,0,1,8,0),Y(0,2,4,-1,0,4,5,0,0,1,10,0),Y(0,3,5,-1,0,5,8,0,0,1,14,0),Y(0,3,5,-1,0,6,10,0,0,1,18,0),Y(0,4,5,-2,0,7,10,1,0,2,16,1),Y(0,5,5,-3,0,8,10,1,0,3,14,2),Y(0,5,6,-3,0,9,12,1,0,3,16,2),Y(0,6,6,-3,0,10,14,1,0,4,18,3),Y(0,6,7,-4,0,11,15,1,0,4,20,3),Y(0,7,8,-4,0,12,17,2,0,5,22,4),Y(0,7,8,-4,0,13,19,2,0,5,24,4),Y(0,7,9,-4,0,14,21,2,0,5,26,4),Y(0,8,9,-5,0,15,22,2,0,6,28,5),Y(0,8,10,-5,0,16,24,2,0,6,30,5),Y(0,8,11,-5,0,17,26,2,0,6,32,5),Y(0,9,11,-5,0,18,28,2,0,7,34,6),Y(0,9,12,-6,0,19,29,2,0,7,36,6),Y(0,10,13,-6,0,20,31,3,0,8,38,7),Y(0,10,13,-6,0,21,33,3,0,8,40,7),Y(0,10,14,-6,0,22,35,3,0,8,42,7),Y(0,11,14,-7,0,23,36,3,0,9,44,8),Y(0,11,15,-7,0,24,38,3,0,9,46,8)],Ql=["duration","easing","delay"],e0={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},t0={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function _r(e){return`${Math.round(e)}ms`}function n0(e){if(!e)return 0;const t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function r0(e){const t=m._extends({},e0,e.easing),n=m._extends({},t0,e.duration),r=(o=["all"],i={})=>{const{duration:s=n.standard,easing:c=t.easeInOut,delay:u=0}=i,f=m._objectWithoutPropertiesLoose(i,Ql);if(process.env.NODE_ENV!=="production"){const d=p=>typeof p=="string",h=p=>!isNaN(parseFloat(p));!d(o)&&!Array.isArray(o)&&console.error('MUI: Argument "props" must be a string or Array.'),!h(s)&&!d(s)&&console.error(`MUI: Argument "duration" must be a number or a string but found ${s}.`),d(c)||console.error('MUI: Argument "easing" must be a string.'),!h(u)&&!d(u)&&console.error('MUI: Argument "delay" must be a number or a string.'),typeof i!="object"&&console.error(["MUI: Secong argument of transition.create must be an object.","Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`"].join(`
92
92
  `)),Object.keys(f).length!==0&&console.error(`MUI: Unrecognized argument(s) [${Object.keys(f).join(",")}].`)}return(Array.isArray(o)?o:[o]).map(d=>`${d} ${typeof s=="string"?s:_r(s)} ${c} ${typeof u=="string"?u:_r(u)}`).join(",")};return m._extends({getAutoHeightDuration:n0,create:r},e,{easing:t,duration:n})}const o0={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},i0=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function s0(e={},...t){const{mixins:n={},palette:r={},transitions:o={},typography:i={}}=e,s=m._objectWithoutPropertiesLoose(e,i0);if(e.vars)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name.":Qe(18));const c=Ul(r),u=wo(e);let f=Se(u,{mixins:wl(u.breakpoints,n),palette:c,shadows:Jl.slice(),typography:Yl(c,i),transitions:r0(o),zIndex:m._extends({},o0)});if(f=Se(f,s),f=t.reduce((d,h)=>Se(d,h),f),process.env.NODE_ENV!=="production"){const d=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],h=(p,b)=>{let y;for(y in p){const a=p[y];if(d.indexOf(y)!==-1&&Object.keys(a).length>0){if(process.env.NODE_ENV!=="production"){const g=bn("",y);console.error([`MUI: The \`${b}\` component increases the CSS specificity of the \`${y}\` internal state.`,"You can not override it like this: ",JSON.stringify(p,null,2),"",`Instead, you need to use the '&.${g}' syntax:`,JSON.stringify({root:{[`&.${g}`]:a}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
93
93
  `))}p[y]={}}}};Object.keys(f.components).forEach(p=>{const b=f.components[p].styleOverrides;b&&p.indexOf("Mui")===0&&h(b,p)})}return f.unstable_sxConfig=m._extends({},ct,s==null?void 0:s.unstable_sxConfig),f.unstable_sx=function(h){return Ht({sx:h,theme:this})},f}const a0=s0(),c0="$$material";function l0(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const u0=e=>l0(e)&&e!=="classes",d0=al({themeId:c0,defaultTheme:a0,rootShouldForwardProp:u0});function f0(e){return bn("MuiSvgIcon",e)}Us("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const h0=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],p0=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${ke(t)}`,`fontSize${ke(n)}`]};return Bs(o,f0,r)},m0=d0("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${ke(n.color)}`],t[`fontSize${ke(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,o,i,s,c,u,f,d,h,p,b,y;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=e.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((i=e.typography)==null||(s=i.pxToRem)==null?void 0:s.call(i,20))||"1.25rem",medium:((c=e.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,24))||"1.5rem",large:((f=e.typography)==null||(d=f.pxToRem)==null?void 0:d.call(f,35))||"2.1875rem"}[t.fontSize],color:(h=(p=(e.vars||e).palette)==null||(p=p[t.color])==null?void 0:p.main)!=null?h:{action:(b=(e.vars||e).palette)==null||(b=b.action)==null?void 0:b.active,disabled:(y=(e.vars||e).palette)==null||(y=y.action)==null?void 0:y.disabled,inherit:void 0}[t.color]}}),Ct=j.forwardRef(function(t,n){const r=Xs({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:s="inherit",component:c="svg",fontSize:u="medium",htmlColor:f,inheritViewBox:d=!1,titleAccess:h,viewBox:p="0 0 24 24"}=r,b=m._objectWithoutPropertiesLoose(r,h0),y=j.isValidElement(o)&&o.type==="svg",a=m._extends({},r,{color:s,component:c,fontSize:u,instanceFontSize:t.fontSize,inheritViewBox:d,viewBox:p,hasSvgAsChild:y}),g={};d||(g.viewBox=p);const v=p0(a);return l.jsxs(m0,m._extends({as:c,className:m.clsx(v.root,i),focusable:"false",color:f,"aria-hidden":h?void 0:!0,role:h?"img":void 0,ref:n},g,b,y&&o.props,{ownerState:a,children:[y?o.props.children:o,h?l.jsx("title",{children:h}):null]}))});process.env.NODE_ENV!=="production"&&(Ct.propTypes={children:m.PropTypes.node,classes:m.PropTypes.object,className:m.PropTypes.string,color:m.PropTypes.oneOfType([m.PropTypes.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),m.PropTypes.string]),component:m.PropTypes.elementType,fontSize:m.PropTypes.oneOfType([m.PropTypes.oneOf(["inherit","large","medium","small"]),m.PropTypes.string]),htmlColor:m.PropTypes.string,inheritViewBox:m.PropTypes.bool,shapeRendering:m.PropTypes.string,sx:m.PropTypes.oneOfType([m.PropTypes.arrayOf(m.PropTypes.oneOfType([m.PropTypes.func,m.PropTypes.object,m.PropTypes.bool])),m.PropTypes.func,m.PropTypes.object]),titleAccess:m.PropTypes.string,viewBox:m.PropTypes.string});Ct.muiName="SvgIcon";function Po(e,t){function n(r,o){return l.jsx(Ct,m._extends({"data-testid":`${t}Icon`,ref:o},r,{children:e}))}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=Ct.muiName,j.memo(j.forwardRef(n))}const g0={configure:e=>{process.env.NODE_ENV!=="production"&&console.warn(["MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.","","You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead","","The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401","","The updated documentation: https://mui.com/guides/classname-generator/"].join(`
94
- `)),qr.configure(e)}},y0=Object.freeze(Object.defineProperty({__proto__:null,capitalize:ke,createChainedFunction:ws,createSvgIcon:Po,debounce:_s,deprecatedPropType:Es,isMuiElement:Cs,ownerDocument:Gr,ownerWindow:Ts,requirePropFactory:Is,setRef:Kr,unstable_ClassNameGenerator:g0,unstable_useEnhancedEffect:Yr,unstable_useId:Ms,unsupportedProp:Ps,useControlled:Os,useEventCallback:As,useForkRef:js,useIsFocusVisible:Hs},Symbol.toStringTag,{value:"Module"})),x0=Po(l.jsx("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");function mn(e){const{colors:t}=m.useTheme();return l.jsx(N.Stack,{sx:{cursor:"pointer"},onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,e.option)},...e.stackProps,children:l.jsx(N.Stack,{sx:{p:1,transition:"0.2s",borderRadius:"5px",cursor:"pointer",...m.activeStyles({backgroundColor:t.primary200},e.select),":hover":{backgroundColor:"#eeeeee80",borderColor:"transparent"}},children:e.renderOption(e.option)})})}const Tt=37,b0=(e,t)=>{const s=document.createElement("p");s.innerText=t,s.style.width=`${e-16-16-4}px`,document.body.appendChild(s);const c=s.offsetHeight;return document.body.removeChild(s),c>21?Tt+21:Tt};function v0(e){const[t,n]=C.useState(!1),[r,o]=C.useState(""),[i,s]=C.useState(""),[c,u]=C.useState(!1),{isRequired:f=!1}=e,d=C.useCallback(m._.debounce(_=>{var E;(E=e.handleChangeSearch)==null||E.call(e,_)},300),[e.handleChangeSearch]),h=()=>{n(!t)},p=()=>{n(!1),s(""),d("")};C.useEffect(()=>{o(e.value?e.getOptionLabel(e.value):"")},[e.value]),C.useEffect(()=>{t||o(e.value?e.getOptionLabel(e.value):"")},[t]),C.useEffect(()=>{u(e.searchLoading)},[e.paging.rows,e.searchLoading]);const b=e.paging.rows,{hasNextPage:y}=e,a=y?b.length+1:b.length,g=()=>e.isNextPageLoading?void 0:e.loadNextPage(i),v=_=>!y||_<b.length,w=_=>{o(_.target.value),t&&(s(_.target.value),d(_.target.value),u(!0))},S=C.useRef(null),T=C.useRef(null),x=C.useRef(null);return C.useEffect(()=>{var _,E,M,P;t?((_=T.current)==null||_.classList.add("Mui-focused"),(E=x.current)==null||E.classList.add("Mui-focused")):((M=T.current)==null||M.classList.remove("Mui-focused"),(P=x.current)==null||P.classList.remove("Mui-focused"))},[t]),l.jsx(N.ClickAwayListener,{onClickAway:p,mouseEvent:"onMouseDown",touchEvent:"onTouchEnd",children:l.jsx("div",{ref:S,style:{width:e.wrapperWidth??"auto"},children:l.jsxs(N.Stack,{sx:{position:"relative"},children:[l.jsx(N.TextField,{required:f,label:e.label,value:r,disabled:e.loading||e.disabled||e.readOnly,fullWidth:!0,error:e.error,helperText:e.helperText,onFocus:_=>{e.loading||e.disabled||e.readOnly||(_.preventDefault(),_.stopPropagation(),n(!0))},autoComplete:"off",onChange:w,placeholder:e.placeholder||"All options",sx:{"& input:not(:focus)":{"&::placeholder":{color:e.placeHolderColor||"#C5C5C5",opacity:1}}},InputLabelProps:{ref:T,shrink:!0},InputProps:{readOnly:e.readOnly,ref:x,endAdornment:l.jsx(N.IconButton,{size:"small",sx:{padding:"1px"},onClick:_=>{var E;_.preventDefault(),_.stopPropagation(),h(),(E=S.current)==null||E.focus()},disabled:e.loading||e.disabled||e.readOnly,children:e.loading?l.jsx(N.CircularProgress,{size:"16px"}):l.jsx(x0,{fontSize:"small",style:{transition:"0.3s"},className:t?"rotate":""})})}}),l.jsx(N.Fade,{in:t,timeout:0,unmountOnExit:!1,children:l.jsxs(N.Paper,{sx:{position:"absolute",top:"calc(100% + 2px)",zIndex:2,left:0,right:0,p:1},children:[!e.disabledAllOption&&l.jsx(N.Stack,{sx:{...m.activeStyles({display:"none"},!!c)},children:l.jsx(N.Stack,{children:l.jsx(mn,{option:void 0,select:!e.value,renderOption:()=>l.jsx(N.Typography,{children:e.placeholder||"All options"}),onClick:()=>{var _,E;p(),(_=e.onChange)==null||_.call(e,void 0),(E=e.handleChangeSearch)==null||E.call(e,"")}})})}),!c&&l.jsx(m.InfiniteLoader,{isItemLoaded:v,itemCount:a,loadMoreItems:g,threshold:5,children:({onItemsRendered:_,ref:E})=>l.jsx(kr,{ref:E,onItemsRendered:_,height:Tt*Math.min(e.itemsNumber||6,a),itemCount:a,itemSize:M=>{var P;return b0((P=S.current)==null?void 0:P.offsetWidth,b[M]?e.getOptionLabel(b[M]):"")},width:"100%",className:"styled-scroll",children:({index:M,style:P})=>{var I;const z=b[M];return v(M)?l.jsx(mn,{stackProps:{style:P},option:z,renderOption:O=>{var R;return l.jsxs(N.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[l.jsx(N.Typography,{children:e.getOptionLabel(O)}),(R=e.renderOptionTooltip)==null?void 0:R.call(e,O)]})},onClick:O=>{var R;p(),(R=e.onChange)==null||R.call(e,O)},select:((I=e.isEqual)==null?void 0:I.call(e,z,e.value))??m._.isEqual(z,e.value)}):l.jsx(N.Stack,{style:P,sx:{height:Tt,pl:1},justifyContent:"center",children:l.jsx(N.Typography,{children:"Loading..."})})}})}),l.jsx(N.Stack,{sx:{height:30,display:"flex",justifyContent:"center",paddingLeft:"5px",...m.activeStyles({display:"none"},!c)},children:l.jsx(N.Typography,{color:"grayText",children:"Searching..."})}),l.jsx(N.Stack,{sx:{height:30,display:"flex",justifyContent:"center",paddingLeft:"5px",...m.activeStyles({display:"none"},!!(b.length||e.loading||c))},children:l.jsx(N.Typography,{color:"grayText",children:"No options"})})]})})]})})})}function S0(e){var d;const{listProps:t}=e,[n,r]=C.useState({initLoading:!e.disabled,searchLoading:!1,hasNextPage:!1,isNextPageLoading:!1,paging:{page:1,pageSize:((d=e.listProps)==null?void 0:d.pageSize)||20,rows:[],total:0,totalPages:1}}),o=async(h,p)=>{var b,y;if(e.list)r(()=>{var v;const a=((v=h==null?void 0:h.search)==null?void 0:v.content)||"";return{hasNextPage:!1,isNextPageLoading:!1,paging:{page:1,pageSize:1e5,rows:e.list.options.filter(w=>e.list.searchOption?e.list.searchOption(w,a):m.search(w,a,e.list.searchFields)),total:e.list.options.length,totalPages:1},searchLoading:!1,initLoading:!1}});else{r(a=>({...a,isNextPageLoading:!0}));try{const a={page:1,pageSize:20,filter:{...t==null?void 0:t.filter,...h==null?void 0:h.filter},...m.lodashExports.omit(t,"filter"),...m.lodashExports.omit(h,"filter"),search:{fields:((b=t==null?void 0:t.search)==null?void 0:b.fields)??[],content:((y=h==null?void 0:h.search)==null?void 0:y.content)??""}};p&&(a.filter={},a.search&&(a.search.content=""),a.page=1);const g=await e.getList(a);r(v=>({initLoading:!1,searchLoading:!1,isNextPageLoading:!1,paging:{...g,rows:(h==null?void 0:h.page)===1?g.rows:v.paging.rows.concat(g.rows)},hasNextPage:g.page<g.totalPages}))}catch{}}},i=()=>(r(h=>({...h,initLoading:!0})),o(void 0,!0)),s=h=>(r(p=>({...p,initLoading:!0})),o(h)),c=h=>{o({page:n.paging.page+1,search:{content:h}})},u=h=>{r(p=>({...p,searchLoading:!0})),o({page:1,search:{content:h}})};C.useEffect(()=>{e.disabled||(r(h=>({...h,initLoading:!0})),o({page:1}))},[...e.dependencyList||[]]);const f=()=>{r(h=>({...h,initLoading:!h.initLoading}))};return{...e,loadNextPage:c,handleChangeSearch:u,paging:n.paging,hasNextPage:n.hasNextPage,isNextPageLoading:n.isNextPageLoading,searchLoading:n.searchLoading,loading:e.loading||n.initLoading,getList:s,reset:i,toggleLoading:f}}function w0(e){return l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M12 3.16663H3.99998C2.80336 3.16663 1.83331 4.13668 1.83331 5.33329V12C1.83331 13.1966 2.80336 14.1666 3.99998 14.1666H12C13.1966 14.1666 14.1666 13.1966 14.1666 12V5.33329C14.1666 4.13668 13.1966 3.16663 12 3.16663Z",stroke:"#85858A"}),l.jsx("path",{d:"M4.5 1.83337V4.16671",stroke:"#85858A",strokeLinecap:"round"}),l.jsx("path",{d:"M2.5 6.16663H13.5",stroke:"#85858A",strokeLinecap:"round"}),l.jsx("path",{d:"M11.8333 1.83337V4.16671",stroke:"#85858A",strokeLinecap:"round"}),l.jsx("path",{d:"M5.5 9.33337C5.77614 9.33337 6 9.10952 6 8.83337C6 8.55723 5.77614 8.33337 5.5 8.33337C5.22386 8.33337 5 8.55723 5 8.83337C5 9.10952 5.22386 9.33337 5.5 9.33337Z",fill:"#85858A"}),l.jsx("path",{d:"M8.16669 9.33337C8.44283 9.33337 8.66669 9.10952 8.66669 8.83337C8.66669 8.55723 8.44283 8.33337 8.16669 8.33337C7.89054 8.33337 7.66669 8.55723 7.66669 8.83337C7.66669 9.10952 7.89054 9.33337 8.16669 9.33337Z",fill:"#85858A"}),l.jsx("path",{d:"M10.8333 9.33337C11.1095 9.33337 11.3333 9.10952 11.3333 8.83337C11.3333 8.55723 11.1095 8.33337 10.8333 8.33337C10.5572 8.33337 10.3333 8.55723 10.3333 8.83337C10.3333 9.10952 10.5572 9.33337 10.8333 9.33337Z",fill:"#85858A"}),l.jsx("path",{d:"M5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12Z",fill:"#85858A"}),l.jsx("path",{d:"M8.16669 12C8.44283 12 8.66669 11.7761 8.66669 11.5C8.66669 11.2239 8.44283 11 8.16669 11C7.89054 11 7.66669 11.2239 7.66669 11.5C7.66669 11.7761 7.89054 12 8.16669 12Z",fill:"#85858A"}),l.jsx("path",{d:"M10.8333 12C11.1095 12 11.3333 11.7761 11.3333 11.5C11.3333 11.2239 11.1095 11 10.8333 11C10.5572 11 10.3333 11.2239 10.3333 11.5C10.3333 11.7761 10.5572 12 10.8333 12Z",fill:"#85858A"})]})}const _0="Reset date";function E0(e){var c,u;const[t,n]=C.useState(e.value),r=!(t!=null&&t.startDate)||!(t!=null&&t.endDate)?"":se(t==null?void 0:t.startDate).format("DD/MM/YYYY")+" ~ "+se(t==null?void 0:t.endDate).format("DD/MM/YYYY");C.useEffect(()=>{n(e.value)},[e.value]);const o=C.useRef(null),i=C.useRef(null),s=C.useRef(null);return console.log("inputRef",o),console.log("labelRef",i),l.jsx(m.DateRangePicker,{initialSettings:{autoApply:!0,ranges:{Today:[se(),se()],Yesterday:[se().subtract(1,"days"),se().subtract(1,"days")],"Last 7 days":[se().subtract(6,"days"),se()],"Last 30 days":[se().subtract(29,"days"),se()],"This month":[se().startOf("month"),se().endOf("month")],"Last month":[se().subtract(1,"month").startOf("month"),se().subtract(1,"month").endOf("month")],"Reset date":[((c=e.dateReset)==null?void 0:c.startDate)??void 0,((u=e.dateReset)==null?void 0:u.endDate)??void 0]},alwaysShowCalendars:!0,startDate:(t==null?void 0:t.startDate)??void 0,endDate:(t==null?void 0:t.endDate)??void 0,opens:"left",maxDate:se(),...e.initialSettings},onApply:(f,d)=>{var g,v,w;const h=d.chosenLabel===_0,{startDate:p,endDate:b}=d,y=h?((g=e.dateReset)==null?void 0:g.startDate)??void 0:p.toDate(),a=h?((v=e.dateReset)==null?void 0:v.endDate)??void 0:b.toDate();n({startDate:y,endDate:a}),(w=e.onChange)==null||w.call(e,{startDate:y,endDate:a})},children:l.jsx(N.TextField,{inputRef:o,label:e.label??"Permit date",placeholder:"Select date range",value:r,InputLabelProps:{ref:i,shrink:!0},InputProps:{readOnly:!0,ref:s,endAdornment:l.jsx(w0,{onClick:()=>{var f;return(f=o.current)==null?void 0:f.focus()},width:24,height:24,color:"gray"})},fullWidth:!0,sx:{"& *":{cursor:"pointer"},display:"flex",justifyContent:"center",minWidth:"250px"}})})}function Oo(e){return l.jsx("svg",{...e,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M16 2.75H8C5.10051 2.75 2.75 5.10051 2.75 8V16C2.75 18.8995 5.10051 21.25 8 21.25H16C18.8995 21.25 21.25 18.8995 21.25 16V8C21.25 5.10051 18.8995 2.75 16 2.75Z",stroke:"#85858A",strokeWidth:"1.5"})})}function Ao(e){return l.jsxs("svg",{...e,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M16 2.75H8C5.10051 2.75 2.75 5.10051 2.75 8V16C2.75 18.8995 5.10051 21.25 8 21.25H16C18.8995 21.25 21.25 18.8995 21.25 16V8C21.25 5.10051 18.8995 2.75 16 2.75Z",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M9 12L11 14L15 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function C0(e){return l.jsx(N.Checkbox,{sx:{"& input:disabled ~ svg":{fill:"#ddd"}},color:"primary",icon:l.jsx(Oo,{fontSize:"small"}),checkedIcon:l.jsx(Ao,{fontSize:"small"}),style:{padding:0},...e})}const Er=e=>{"serviceWorker"in navigator&&navigator.serviceWorker.register(e.path).then(function(t){console.log("Registration successful, scope is:",t.scope),console.log("initialize service worker props ",e);const n=m.getMessagingInWindow(m.initializeApp({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));m.getToken(n,{serviceWorkerRegistration:t,vapidKey:e.vapidKey}).then(async r=>{if(r){console.log("current token for client: ",r);try{const i=e.baseUrl+"/notification-management/api/v1/notifications/registrations";await m.axiosInstance.post(i,{deviceToken:r})}catch(o){console.log(o)}}else console.log("No registration token available. Request permission to generate one.")}).catch(r=>{console.log("An error occurred while retrieving token. ",r)})}).catch(function(t){console.log("Service worker registration failed, error:",t)})},T0=e=>{const t=new BroadcastChannel("my-channel");t.onmessage=n=>{console.log("Broadcast chanel message",n),n&&e(r=>({...r,unread:{...r.unread,total:r.unread.total+1}}))}},I0=e=>new Promise(t=>{const n=m.getMessagingInWindow(m.initializeApp({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));m.onMessage(n,r=>{console.log("payload",r),t(r)})}),jo=e=>{const[t,n]=C.useState({actorName:"",message:"",context:"",contextUrl:""});console.log(t);const{setNotiData:r}=C.useContext(m.CustomOpenList);function o(){const s=l.jsxs("div",{className:"notification-massage_content",children:[l.jsx("h6",{className:"notification-name",children:t==null?void 0:t.actorName}),l.jsxs("div",{className:"notification-message_service",children:[l.jsxs("span",{children:[`${t==null?void 0:t.message} `," "]}),l.jsx("span",{children:t==null?void 0:t.context})]})]});return l.jsxs(l.Fragment,{children:[l.jsx("style",{children:Mr}),t!=null&&t.contextUrl?l.jsx("a",{className:"notification-massage_container",href:t.contextUrl,style:{display:"block"},children:s}):l.jsx("div",{className:"notification-massage_container",style:{width:"100%",display:"block"},children:s})]})}C.useEffect(()=>{t&&Notification.permission==="granted"&&(t.actorName||t.message||t.context||t.contextUrl)&&m.notify(l.jsx(o,{}))},[t]),C.useEffect(()=>{"Notification"in window&&(console.log("notification permission",Notification.permission),Notification.permission==="default"?Notification.requestPermission(function(s){s==="granted"&&Er(e)}):Notification.permission==="granted"&&Er(e))},[Notification.permission]),C.useEffect(()=>{T0(r)},[]);const i=(s,c)=>{var u;if((s==null?void 0:s.actionKey)!=null){if((u=s==null?void 0:s.data)!=null&&u.brandName)return m.translate(`notificationAdmin.notify.actionKey.${s==null?void 0:s.actionKey}`,{defaultValue:`${s==null?void 0:s.message}`,brandName:s.data.brandName});switch(s==null?void 0:s.notificationType){case"deleteMultiple":return s!=null&&s.data&&c>1?m.translate(`notificationAdmin.notify.actionKey.${s==null?void 0:s.actionKey}_multiple`,{defaultValue:`${s==null?void 0:s.actionKey}`,count:c}):m.translate(`notificationAdmin.notify.actionKey.${s==null?void 0:s.actionKey}_single`,{defaultValue:`${s==null?void 0:s.actionKey}`});default:return m.translate(`notificationAdmin.notify.actionKey.${s==null?void 0:s.actionKey}`,{defaultValue:`${s==null?void 0:s.message}`})}}return s.message};return I0(e).then(s=>{console.log("aaa",s);const c=s==null?void 0:s.data;let u=[];try{u=JSON.parse(c.data)}catch(d){console.error("Parse msg.data failed:",d),u=[]}const f=Array.isArray(u)?u.length:0;n({actorName:c==null?void 0:c.actorName,message:i(c,f||0),context:c==null?void 0:c.context,contextUrl:c==null?void 0:c.contextUrl}),r(d=>{var h;return{...d,unread:{...d.unread,total:((h=d.unread)==null?void 0:h.total)+1}}})}).catch(s=>console.log("failed: ",s)),l.jsx(l.Fragment,{})},k0=(e,t)=>C.cloneElement(t,{},e),M0=({children:e,providers:t})=>l.jsx(l.Fragment,{children:t.reduceRight(k0,e)}),P0=".pnf-button-primary{font-size:14px;background-color:var(--primary300);color:var(--buttonText);padding:8px 24px;border-radius:4px;border:none;cursor:pointer;transition:background-color .25s cubic-bezier(.4,0,.2,1),box-shadow .25s cubic-bezier(.4,0,.2,1),border-color .25s cubic-bezier(.4,0,.2,1),color .25s cubic-bezier(.4,0,.2,1)}.pnf-button-primary:hover{background-color:var(--buttonHover)}.pnf-container{padding-top:16px;padding-bottom:16px;gap:16px;display:flex;flex-direction:column;align-items:center;font-family:inherit}.pnf-content-wrapper{display:flex;flex-direction:column;gap:8px;align-items:center}.pnf-title{text-align:center;font-size:1.25rem;font-weight:500;margin:0}.pnf-description{text-align:center;color:#85858a;font-size:.875rem;font-weight:400;margin:0}",O0=()=>{const e=()=>{window.top&&(window.top.location.href="/app/home")};return console.log("window.location.origin",window.location.origin),l.jsx(m.StyleWrapper,{styles:[P0],children:l.jsxs("div",{className:"pnf-container",children:[l.jsx("img",{width:120,height:120,src:"https://ukpcsaprod.blob.core.windows.net/lib/images/page-not-found.png",alt:"Page not found"}),l.jsxs("div",{className:"pnf-content-wrapper",children:[l.jsx("h4",{className:"pnf-title",children:"Page Not Found"}),l.jsxs("p",{className:"pnf-description",children:["We’re sorry. The page you requested could not be found. ",l.jsx("br",{}),"Please go back to the home page"]}),l.jsx("button",{className:"pnf-button-primary",onClick:e,children:"Go to homepage"})]})]})})};var jn={},Zt={};const A0=m.getAugmentedNamespace(y0);var Cr;function j0(){return Cr||(Cr=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=A0}(Zt)),Zt}var $0=vn;Object.defineProperty(jn,"__esModule",{value:!0});var $o=jn.default=void 0,N0=$0(j0()),R0=l;$o=jn.default=(0,N0.default)((0,R0.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext");function L0({index:e,href:t,title:n,ssr:r}){return r?l.jsx("a",{style:{color:m.color.linkPrimary,textDecoration:"none",fontSize:"inherit"},href:t,children:n},e):l.jsx(gn.Link,{style:{color:m.color.linkPrimary,textDecoration:"none",fontSize:"inherit"},to:t,children:n},e)}function z0(e){return console.log("BaseBreadcrumbs",e),e.isLoading?l.jsx(Or,{width:300}):l.jsx(l.Fragment,{children:l.jsx(N.Breadcrumbs,{sx:{fontSize:"12px",fontFamily:"inherit"},separator:l.jsx($o,{sx:{color:m.color.linkPrimary,fontSize:"inherit"}}),"aria-label":"breadcrumb",color:m.color.linkPrimary,children:e.data.map((t,n)=>t.onClick?l.jsx(N.Typography,{style:{color:m.color.linkPrimary,textDecoration:"none",cursor:"pointer",fontSize:"inherit",fontFamily:"inherit"},onClick:t.onClick,children:t.title||""},n):t.href?l.jsx(L0,{index:n,href:t.href,title:t.title,ssr:e.ssr}):l.jsx(N.Typography,{style:{color:t.highlight?m.color.linkPrimary:m.color.textPrimary,textDecoration:"none",fontSize:"inherit",fontFamily:"inherit"},children:t.title},n))})})}function F0({children:e,accessKeys:t,requireAll:n}){const{permissions:r}=m.useAuth();return n?t.every(o=>r==null?void 0:r.includes(o))?e:null:t.some(o=>r==null?void 0:r.includes(o))?e:null}exports.FavoriteMenu=m.FavoriteMenu;exports.GlobalMenu=m.GlobalMenu;exports.IconComponent=m.IconComponent;exports.UnauthorizedPage=m.UnauthorizedPage;exports.notify=m.notify;exports.pushError=m.pushError;exports.pushSuccess=m.pushSuccess;exports.pushWarning=m.pushWarning;exports.updateFavoriteItems=m.updateFavoriteItems;exports.AutocompleteOption=mn;exports.BaseBreadcrumbs=z0;exports.BaseCheckbox=C0;exports.CheckedIcon=Ao;exports.HomePage=hs;exports.LanguageDropdown=Br;exports.MultiProvider=M0;exports.NoData=is;exports.NotFoundPage=fs;exports.NotificationBase=jo;exports.PageNotFound=O0;exports.PopUpBase=us;exports.StyledAutocomplete=v0;exports.StyledDateRangePicker=E0;exports.ToastConfig=rs;exports.ToastConfigNotification=os;exports.TopBar=ns;exports.UncheckedIcon=Oo;exports.WrapPermission=F0;exports.usePopUp=ds;exports.useStyledAutocomplete=S0;
94
+ `)),qr.configure(e)}},y0=Object.freeze(Object.defineProperty({__proto__:null,capitalize:ke,createChainedFunction:ws,createSvgIcon:Po,debounce:_s,deprecatedPropType:Es,isMuiElement:Cs,ownerDocument:Gr,ownerWindow:Ts,requirePropFactory:Is,setRef:Kr,unstable_ClassNameGenerator:g0,unstable_useEnhancedEffect:Yr,unstable_useId:Ms,unsupportedProp:Ps,useControlled:Os,useEventCallback:As,useForkRef:js,useIsFocusVisible:Hs},Symbol.toStringTag,{value:"Module"})),x0=Po(l.jsx("path",{d:"m7 10 5 5 5-5z"}),"ArrowDropDown");function mn(e){const{colors:t}=m.useTheme();return l.jsx(N.Stack,{sx:{cursor:"pointer"},onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,e.option)},...e.stackProps,children:l.jsx(N.Stack,{sx:{p:1,transition:"0.2s",borderRadius:"5px",cursor:"pointer",...m.activeStyles({backgroundColor:t.primary200},e.select),":hover":{backgroundColor:"#eeeeee80",borderColor:"transparent"}},children:e.renderOption(e.option)})})}const Tt=37,b0=(e,t)=>{const s=document.createElement("p");s.innerText=t,s.style.width=`${e-16-16-4}px`,document.body.appendChild(s);const c=s.offsetHeight;return document.body.removeChild(s),c>21?Tt+21:Tt};function v0(e){const[t,n]=C.useState(!1),[r,o]=C.useState(""),[i,s]=C.useState(""),[c,u]=C.useState(!1),{isRequired:f=!1}=e,d=C.useCallback(m._.debounce(_=>{var E;(E=e.handleChangeSearch)==null||E.call(e,_)},300),[e.handleChangeSearch]),h=()=>{n(!t)},p=()=>{n(!1),s(""),d("")};C.useEffect(()=>{o(e.value?e.getOptionLabel(e.value):"")},[e.value]),C.useEffect(()=>{t||o(e.value?e.getOptionLabel(e.value):"")},[t]),C.useEffect(()=>{u(e.searchLoading)},[e.paging.rows,e.searchLoading]);const b=e.paging.rows,{hasNextPage:y}=e,a=y?b.length+1:b.length,g=()=>e.isNextPageLoading?void 0:e.loadNextPage(i),v=_=>!y||_<b.length,w=_=>{o(_.target.value),t&&(s(_.target.value),d(_.target.value),u(!0))},S=C.useRef(null),T=C.useRef(null),x=C.useRef(null);return C.useEffect(()=>{var _,E,M,P;t?((_=T.current)==null||_.classList.add("Mui-focused"),(E=x.current)==null||E.classList.add("Mui-focused")):((M=T.current)==null||M.classList.remove("Mui-focused"),(P=x.current)==null||P.classList.remove("Mui-focused"))},[t]),l.jsx(N.ClickAwayListener,{onClickAway:p,mouseEvent:"onMouseDown",touchEvent:"onTouchEnd",children:l.jsx("div",{ref:S,style:{width:e.wrapperWidth??"auto"},children:l.jsxs(N.Stack,{sx:{position:"relative"},children:[l.jsx(N.TextField,{required:f,label:e.label,value:r,disabled:e.loading||e.disabled||e.readOnly,fullWidth:!0,error:e.error,helperText:e.helperText,onFocus:_=>{e.loading||e.disabled||e.readOnly||(_.preventDefault(),_.stopPropagation(),n(!0))},autoComplete:"off",onChange:w,placeholder:e.placeholder||"All options",sx:{"& input:not(:focus)":{"&::placeholder":{color:e.placeHolderColor||"#C5C5C5",opacity:1}}},InputLabelProps:{ref:T,shrink:!0},InputProps:{readOnly:e.readOnly,ref:x,endAdornment:l.jsx(N.IconButton,{size:"small",sx:{padding:"1px"},onClick:_=>{var E;_.preventDefault(),_.stopPropagation(),h(),(E=S.current)==null||E.focus()},disabled:e.loading||e.disabled||e.readOnly,children:e.loading?l.jsx(N.CircularProgress,{size:"16px"}):l.jsx(x0,{fontSize:"small",style:{transition:"0.3s"},className:t?"rotate":""})})}}),l.jsx(N.Fade,{in:t,timeout:0,unmountOnExit:!1,children:l.jsxs(N.Paper,{sx:{position:"absolute",top:"calc(100% + 2px)",zIndex:2,left:0,right:0,p:1},children:[!e.disabledAllOption&&l.jsx(N.Stack,{sx:{...m.activeStyles({display:"none"},!!c)},children:l.jsx(N.Stack,{children:l.jsx(mn,{option:void 0,select:!e.value,renderOption:()=>l.jsx(N.Typography,{children:e.placeholder||"All options"}),onClick:()=>{var _,E;p(),(_=e.onChange)==null||_.call(e,void 0),(E=e.handleChangeSearch)==null||E.call(e,"")}})})}),!c&&l.jsx(m.InfiniteLoader,{isItemLoaded:v,itemCount:a,loadMoreItems:g,threshold:5,children:({onItemsRendered:_,ref:E})=>l.jsx(kr,{ref:E,onItemsRendered:_,height:Tt*Math.min(e.itemsNumber||6,a),itemCount:a,itemSize:M=>{var P;return b0((P=S.current)==null?void 0:P.offsetWidth,b[M]?e.getOptionLabel(b[M]):"")},width:"100%",className:"styled-scroll",children:({index:M,style:P})=>{var I;const z=b[M];return v(M)?l.jsx(mn,{stackProps:{style:P},option:z,renderOption:O=>{var R;return l.jsxs(N.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[l.jsx(N.Typography,{children:e.getOptionLabel(O)}),(R=e.renderOptionTooltip)==null?void 0:R.call(e,O)]})},onClick:O=>{var R;p(),(R=e.onChange)==null||R.call(e,O)},select:((I=e.isEqual)==null?void 0:I.call(e,z,e.value))??m._.isEqual(z,e.value)}):l.jsx(N.Stack,{style:P,sx:{height:Tt,pl:1},justifyContent:"center",children:l.jsx(N.Typography,{children:"Loading..."})})}})}),l.jsx(N.Stack,{sx:{height:30,display:"flex",justifyContent:"center",paddingLeft:"5px",...m.activeStyles({display:"none"},!c)},children:l.jsx(N.Typography,{color:"grayText",children:"Searching..."})}),l.jsx(N.Stack,{sx:{height:30,display:"flex",justifyContent:"center",paddingLeft:"5px",...m.activeStyles({display:"none"},!!(b.length||e.loading||c))},children:l.jsx(N.Typography,{color:"grayText",children:"No options"})})]})})]})})})}function S0(e){var d;const{listProps:t}=e,[n,r]=C.useState({initLoading:!e.disabled,searchLoading:!1,hasNextPage:!1,isNextPageLoading:!1,paging:{page:1,pageSize:((d=e.listProps)==null?void 0:d.pageSize)||20,rows:[],total:0,totalPages:1}}),o=async(h,p)=>{var b,y;if(e.list)r(()=>{var v;const a=((v=h==null?void 0:h.search)==null?void 0:v.content)||"";return{hasNextPage:!1,isNextPageLoading:!1,paging:{page:1,pageSize:1e5,rows:e.list.options.filter(w=>e.list.searchOption?e.list.searchOption(w,a):m.search(w,a,e.list.searchFields)),total:e.list.options.length,totalPages:1},searchLoading:!1,initLoading:!1}});else{r(a=>({...a,isNextPageLoading:!0}));try{const a={page:1,pageSize:20,filter:{...t==null?void 0:t.filter,...h==null?void 0:h.filter},...m.lodashExports.omit(t,"filter"),...m.lodashExports.omit(h,"filter"),search:{fields:((b=t==null?void 0:t.search)==null?void 0:b.fields)??[],content:((y=h==null?void 0:h.search)==null?void 0:y.content)??""}};p&&(a.filter={},a.search&&(a.search.content=""),a.page=1);const g=await e.getList(a);r(v=>({initLoading:!1,searchLoading:!1,isNextPageLoading:!1,paging:{...g,rows:(h==null?void 0:h.page)===1?g.rows:v.paging.rows.concat(g.rows)},hasNextPage:g.page<g.totalPages}))}catch{}}},i=()=>(r(h=>({...h,initLoading:!0})),o(void 0,!0)),s=h=>(r(p=>({...p,initLoading:!0})),o(h)),c=h=>{o({page:n.paging.page+1,search:{content:h}})},u=h=>{r(p=>({...p,searchLoading:!0})),o({page:1,search:{content:h}})};C.useEffect(()=>{e.disabled||(r(h=>({...h,initLoading:!0})),o({page:1}))},[...e.dependencyList||[]]);const f=()=>{r(h=>({...h,initLoading:!h.initLoading}))};return{...e,loadNextPage:c,handleChangeSearch:u,paging:n.paging,hasNextPage:n.hasNextPage,isNextPageLoading:n.isNextPageLoading,searchLoading:n.searchLoading,loading:e.loading||n.initLoading,getList:s,reset:i,toggleLoading:f}}function w0(e){return l.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[l.jsx("path",{d:"M12 3.16663H3.99998C2.80336 3.16663 1.83331 4.13668 1.83331 5.33329V12C1.83331 13.1966 2.80336 14.1666 3.99998 14.1666H12C13.1966 14.1666 14.1666 13.1966 14.1666 12V5.33329C14.1666 4.13668 13.1966 3.16663 12 3.16663Z",stroke:"#85858A"}),l.jsx("path",{d:"M4.5 1.83337V4.16671",stroke:"#85858A",strokeLinecap:"round"}),l.jsx("path",{d:"M2.5 6.16663H13.5",stroke:"#85858A",strokeLinecap:"round"}),l.jsx("path",{d:"M11.8333 1.83337V4.16671",stroke:"#85858A",strokeLinecap:"round"}),l.jsx("path",{d:"M5.5 9.33337C5.77614 9.33337 6 9.10952 6 8.83337C6 8.55723 5.77614 8.33337 5.5 8.33337C5.22386 8.33337 5 8.55723 5 8.83337C5 9.10952 5.22386 9.33337 5.5 9.33337Z",fill:"#85858A"}),l.jsx("path",{d:"M8.16669 9.33337C8.44283 9.33337 8.66669 9.10952 8.66669 8.83337C8.66669 8.55723 8.44283 8.33337 8.16669 8.33337C7.89054 8.33337 7.66669 8.55723 7.66669 8.83337C7.66669 9.10952 7.89054 9.33337 8.16669 9.33337Z",fill:"#85858A"}),l.jsx("path",{d:"M10.8333 9.33337C11.1095 9.33337 11.3333 9.10952 11.3333 8.83337C11.3333 8.55723 11.1095 8.33337 10.8333 8.33337C10.5572 8.33337 10.3333 8.55723 10.3333 8.83337C10.3333 9.10952 10.5572 9.33337 10.8333 9.33337Z",fill:"#85858A"}),l.jsx("path",{d:"M5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12Z",fill:"#85858A"}),l.jsx("path",{d:"M8.16669 12C8.44283 12 8.66669 11.7761 8.66669 11.5C8.66669 11.2239 8.44283 11 8.16669 11C7.89054 11 7.66669 11.2239 7.66669 11.5C7.66669 11.7761 7.89054 12 8.16669 12Z",fill:"#85858A"}),l.jsx("path",{d:"M10.8333 12C11.1095 12 11.3333 11.7761 11.3333 11.5C11.3333 11.2239 11.1095 11 10.8333 11C10.5572 11 10.3333 11.2239 10.3333 11.5C10.3333 11.7761 10.5572 12 10.8333 12Z",fill:"#85858A"})]})}const _0="Reset date";function E0(e){var c,u;const[t,n]=C.useState(e.value),r=!(t!=null&&t.startDate)||!(t!=null&&t.endDate)?"":se(t==null?void 0:t.startDate).format("DD/MM/YYYY")+" ~ "+se(t==null?void 0:t.endDate).format("DD/MM/YYYY");C.useEffect(()=>{n(e.value)},[e.value]);const o=C.useRef(null),i=C.useRef(null),s=C.useRef(null);return console.log("inputRef",o),console.log("labelRef",i),l.jsx(m.DateRangePicker,{initialSettings:{autoApply:!0,ranges:{Today:[se(),se()],Yesterday:[se().subtract(1,"days"),se().subtract(1,"days")],"Last 7 days":[se().subtract(6,"days"),se()],"Last 30 days":[se().subtract(29,"days"),se()],"This month":[se().startOf("month"),se().endOf("month")],"Last month":[se().subtract(1,"month").startOf("month"),se().subtract(1,"month").endOf("month")],"Reset date":[((c=e.dateReset)==null?void 0:c.startDate)??void 0,((u=e.dateReset)==null?void 0:u.endDate)??void 0]},alwaysShowCalendars:!0,startDate:(t==null?void 0:t.startDate)??void 0,endDate:(t==null?void 0:t.endDate)??void 0,opens:"left",maxDate:se(),...e.initialSettings},onApply:(f,d)=>{var g,v,w;const h=d.chosenLabel===_0,{startDate:p,endDate:b}=d,y=h?((g=e.dateReset)==null?void 0:g.startDate)??void 0:p.toDate(),a=h?((v=e.dateReset)==null?void 0:v.endDate)??void 0:b.toDate();n({startDate:y,endDate:a}),(w=e.onChange)==null||w.call(e,{startDate:y,endDate:a})},children:l.jsx(N.TextField,{inputRef:o,label:e.label??"Permit date",placeholder:"Select date range",value:r,InputLabelProps:{ref:i,shrink:!0},InputProps:{readOnly:!0,ref:s,endAdornment:l.jsx(w0,{onClick:()=>{var f;return(f=o.current)==null?void 0:f.focus()},width:24,height:24,color:"gray"})},fullWidth:!0,sx:{"& *":{cursor:"pointer"},display:"flex",justifyContent:"center",minWidth:"250px"}})})}function Oo(e){return l.jsx("svg",{...e,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:l.jsx("path",{d:"M16 2.75H8C5.10051 2.75 2.75 5.10051 2.75 8V16C2.75 18.8995 5.10051 21.25 8 21.25H16C18.8995 21.25 21.25 18.8995 21.25 16V8C21.25 5.10051 18.8995 2.75 16 2.75Z",stroke:"#85858A",strokeWidth:"1.5"})})}function Ao(e){return l.jsxs("svg",{...e,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("path",{d:"M16 2.75H8C5.10051 2.75 2.75 5.10051 2.75 8V16C2.75 18.8995 5.10051 21.25 8 21.25H16C18.8995 21.25 21.25 18.8995 21.25 16V8C21.25 5.10051 18.8995 2.75 16 2.75Z",stroke:"currentColor",strokeWidth:"1.5"}),l.jsx("path",{d:"M9 12L11 14L15 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}function C0(e){return l.jsx(N.Checkbox,{sx:{"& input:disabled ~ svg":{fill:"#ddd"}},color:"primary",icon:l.jsx(Oo,{fontSize:"small"}),checkedIcon:l.jsx(Ao,{fontSize:"small"}),style:{padding:0},...e})}const Er=e=>{"serviceWorker"in navigator&&navigator.serviceWorker.register(e.path).then(function(t){console.log("Registration successful, scope is:",t.scope),console.log("initialize service worker props ",e);const n=m.getMessagingInWindow(m.initializeApp({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));m.getToken(n,{serviceWorkerRegistration:t,vapidKey:e.vapidKey}).then(async r=>{if(r){console.log("current token for client: ",r);try{const i=e.baseUrl+"/notification-management/api/v1/notifications/registrations";await m.axiosInstance.post(i,{deviceToken:r})}catch(o){console.log(o)}}else console.log("No registration token available. Request permission to generate one.")}).catch(r=>{console.log("An error occurred while retrieving token. ",r)})}).catch(function(t){console.log("Service worker registration failed, error:",t)})},T0=e=>{const t=new BroadcastChannel("my-channel");t.onmessage=n=>{console.log("Broadcast chanel message",n),n&&e(r=>({...r,unread:{...r.unread,total:r.unread.total+1}}))}},I0=e=>new Promise(t=>{const n=m.getMessagingInWindow(m.initializeApp({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,storageBucket:e.storageBucket,messagingSenderId:e.messagingSenderId,appId:e.appId,measurementId:e.measurementId}));m.onMessage(n,r=>{console.log("payload",r),t(r)})}),jo=e=>{const[t,n]=C.useState({actorName:"",message:"",context:"",contextUrl:""});console.log(t);const{setNotiData:r}=C.useContext(m.CustomOpenList);function o(){const s=l.jsxs("div",{className:"notification-massage_content",children:[l.jsx("h6",{className:"notification-name",children:t==null?void 0:t.actorName}),l.jsxs("div",{className:"notification-message_service",children:[l.jsxs("span",{children:[`${t==null?void 0:t.message} `," "]}),l.jsx("span",{children:t==null?void 0:t.context})]})]});return l.jsxs(l.Fragment,{children:[l.jsx("style",{children:Mr}),t!=null&&t.contextUrl?l.jsx("a",{className:"notification-massage_container",href:t.contextUrl,style:{display:"block"},children:s}):l.jsx("div",{className:"notification-massage_container",style:{width:"100%",display:"block"},children:s})]})}C.useEffect(()=>{t&&Notification.permission==="granted"&&(t.actorName||t.message||t.context||t.contextUrl)&&m.notify(l.jsx(o,{}))},[t]),C.useEffect(()=>{"Notification"in window&&(console.log("notification permission",Notification.permission),Notification.permission==="default"?Notification.requestPermission(function(s){s==="granted"&&Er(e)}):Notification.permission==="granted"&&Er(e))},[Notification.permission]),C.useEffect(()=>{T0(r)},[]);const i=(s,c)=>{var u;if((s==null?void 0:s.actionKey)!=null){if((u=s==null?void 0:s.data)!=null&&u.brandName)return m.translate(`notificationAdmin.notify.actionKey.${s==null?void 0:s.actionKey}`,{defaultValue:`${s==null?void 0:s.message}`,brandName:s.data.brandName});switch(s==null?void 0:s.notificationType){case"deleteMultiple":return s!=null&&s.data&&c>1?m.translate(`notificationAdmin.notify.actionKey.${s==null?void 0:s.actionKey}_multiple`,{defaultValue:`${s==null?void 0:s.actionKey}`,count:c}):m.translate(`notificationAdmin.notify.actionKey.${s==null?void 0:s.actionKey}_single`,{defaultValue:`${s==null?void 0:s.actionKey}`});default:return m.translate(`notificationAdmin.notify.actionKey.${s==null?void 0:s.actionKey}`,{defaultValue:`${s==null?void 0:s.message}`})}}return s.message};return I0(e).then(s=>{console.log("aaa",s);const c=s==null?void 0:s.data;let u=[];try{u=JSON.parse(c.data)}catch(d){console.error("Parse msg.data failed:",d),u=[]}const f=Array.isArray(u)?u.length:0;n({actorName:c==null?void 0:c.actorName,message:i(c,f||0),context:c==null?void 0:c.context,contextUrl:c==null?void 0:c.contextUrl}),r(d=>{var h;return{...d,unread:{...d.unread,total:((h=d.unread)==null?void 0:h.total)+1}}})}).catch(s=>console.log("failed: ",s)),l.jsx(l.Fragment,{})},k0=(e,t)=>C.cloneElement(t,{},e),M0=({children:e,providers:t})=>l.jsx(l.Fragment,{children:t.reduceRight(k0,e)}),P0=".pnf-button-primary{font-size:14px;background-color:var(--primary300);color:var(--buttonText);padding:8px 24px;border-radius:4px;border:none;cursor:pointer;transition:background-color .25s cubic-bezier(.4,0,.2,1),box-shadow .25s cubic-bezier(.4,0,.2,1),border-color .25s cubic-bezier(.4,0,.2,1),color .25s cubic-bezier(.4,0,.2,1)}.pnf-button-primary:hover{background-color:var(--buttonHover)}.pnf-container{padding-top:16px;padding-bottom:16px;gap:16px;display:flex;flex-direction:column;align-items:center;font-family:inherit}.pnf-content-wrapper{display:flex;flex-direction:column;gap:8px;align-items:center}.pnf-title{text-align:center;font-size:1.25rem;font-weight:500;margin:0}.pnf-description{text-align:center;color:#85858a;font-size:.875rem;font-weight:400;margin:0}",O0=()=>{const e=()=>{window.top&&(window.top.location.href="/app/home")},{colors:t}=m.useTheme();return l.jsx(m.StyleWrapper,{styles:[P0],children:l.jsxs("div",{className:"pnf-container",children:[l.jsx("img",{width:120,height:120,src:"https://ukpcsaprod.blob.core.windows.net/lib/images/page-not-found.png",alt:"Page not found"}),l.jsxs("div",{className:"pnf-content-wrapper",children:[l.jsx("h4",{className:"pnf-title",children:"Page Not Found"}),l.jsxs("p",{className:"pnf-description",children:["We’re sorry. The page you requested could not be found. ",l.jsx("br",{}),"Please go back to the home page"]}),l.jsx("button",{className:"pnf-button-primary",style:{backgroundColor:`${t.primary300}`},onClick:e,children:"Go to homepage"})]})]})})};var jn={},Zt={};const A0=m.getAugmentedNamespace(y0);var Cr;function j0(){return Cr||(Cr=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=A0}(Zt)),Zt}var $0=vn;Object.defineProperty(jn,"__esModule",{value:!0});var $o=jn.default=void 0,N0=$0(j0()),R0=l;$o=jn.default=(0,N0.default)((0,R0.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext");function L0({index:e,href:t,title:n,ssr:r}){return r?l.jsx("a",{style:{color:m.color.linkPrimary,textDecoration:"none",fontSize:"inherit"},href:t,children:n},e):l.jsx(gn.Link,{style:{color:m.color.linkPrimary,textDecoration:"none",fontSize:"inherit"},to:t,children:n},e)}function z0(e){return console.log("BaseBreadcrumbs",e),e.isLoading?l.jsx(Or,{width:300}):l.jsx(l.Fragment,{children:l.jsx(N.Breadcrumbs,{sx:{fontSize:"12px",fontFamily:"inherit"},separator:l.jsx($o,{sx:{color:m.color.linkPrimary,fontSize:"inherit"}}),"aria-label":"breadcrumb",color:m.color.linkPrimary,children:e.data.map((t,n)=>t.onClick?l.jsx(N.Typography,{style:{color:m.color.linkPrimary,textDecoration:"none",cursor:"pointer",fontSize:"inherit",fontFamily:"inherit"},onClick:t.onClick,children:t.title||""},n):t.href?l.jsx(L0,{index:n,href:t.href,title:t.title,ssr:e.ssr}):l.jsx(N.Typography,{style:{color:t.highlight?m.color.linkPrimary:m.color.textPrimary,textDecoration:"none",fontSize:"inherit",fontFamily:"inherit"},children:t.title},n))})})}function F0({children:e,accessKeys:t,requireAll:n}){const{permissions:r}=m.useAuth();return n?t.every(o=>r==null?void 0:r.includes(o))?e:null:t.some(o=>r==null?void 0:r.includes(o))?e:null}exports.FavoriteMenu=m.FavoriteMenu;exports.GlobalMenu=m.GlobalMenu;exports.IconComponent=m.IconComponent;exports.UnauthorizedPage=m.UnauthorizedPage;exports.notify=m.notify;exports.pushError=m.pushError;exports.pushSuccess=m.pushSuccess;exports.pushWarning=m.pushWarning;exports.updateFavoriteItems=m.updateFavoriteItems;exports.AutocompleteOption=mn;exports.BaseBreadcrumbs=z0;exports.BaseCheckbox=C0;exports.CheckedIcon=Ao;exports.HomePage=hs;exports.LanguageDropdown=Br;exports.MultiProvider=M0;exports.NoData=is;exports.NotFoundPage=fs;exports.NotificationBase=jo;exports.PageNotFound=O0;exports.PopUpBase=us;exports.StyledAutocomplete=v0;exports.StyledDateRangePicker=E0;exports.ToastConfig=rs;exports.ToastConfigNotification=os;exports.TopBar=ns;exports.UncheckedIcon=Oo;exports.WrapPermission=F0;exports.usePopUp=ds;exports.useStyledAutocomplete=S0;