@ukpc-lib/react 0.11.7 → 0.11.8-sandbox.saas-7771

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),T=require("react"),m=require("../index.esm2017-3734a51e.cjs"),X=require("moment"),N=require("@mui/material");require("axios");require("@r2wc/react-to-web-component");const gr=require("react-router-dom");require("react-query");require("react-dom");function bo(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 W=bo(T),vo=e=>{var r,o;const{tabs:t}=e,n=s=>{e.setCurrentTab(s.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),T=require("react"),m=require("../index.esm2017-47cea4e3.cjs"),X=require("moment"),N=require("@mui/material");require("axios");require("@r2wc/react-to-web-component");const gr=require("react-router-dom");require("react-query");require("react-dom");function bo(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 W=bo(T),vo=e=>{var r,o;const{tabs:t}=e,n=s=>{e.setCurrentTab(s.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
2
2
  .tab-title {
3
3
  min-width: 90px;
4
4
  padding: 5px 16px;
@@ -29,7 +29,7 @@
29
29
  .tab-content {
30
30
  padding: 16px 0;
31
31
  }
32
- `}),c.jsxs("div",{className:"tab-container",children:[c.jsx("div",{style:{display:"flex",width:"100%",height:"50px",borderBottom:`1px solid ${m.color.grey200}`},className:"tab-container__title",children:t.map((s,i)=>c.jsx("button",{id:s.id,disabled:e.currentTab===`${s.id}`,onClick:n,className:`tab-title ${e.currentTab===`${s.id}`?"is-active":""}`,children:s.tabTitle},i))}),c.jsx("div",{className:"tab-content",children:t.map((s,i)=>c.jsx("div",{children:e.currentTab===`${s.id}`&&c.jsx("div",{children:s.children})},i))})]})]})},cn=({baseUrl:e,notiPath:t,setNotiData:n})=>async()=>{var d;const s=e+(t||"/notification-management/api/v1/notifications"),l=(d=(await m.axiosInstance.get(s,{params:{filter:{notificationFilterType:"all"}}})).data)==null?void 0:d.rows,u=l==null?void 0:l.filter(f=>f.isRead===!1);n({all:{rows:l??[],total:(l==null?void 0:l.length)??0},unread:{rows:u??[],total:(u==null?void 0:u.length)??0}})},So=({notification:e,baseUrl:t,notiPath:n,markAllAsReadState:r,brandColors:o})=>{var C,v;const[s,i]=T.useState(!1),[l,u]=T.useState({id:e.id,isRead:e.isRead}),d=l.isRead===!1?"unread":"read",f={borderColor:l.isRead?"#c5c5c5":(o==null?void 0:o.primary500)||m.color.primary500,backgroundColor:l.isRead?"#c5c5c5":(o==null?void 0:o.primary500)||m.color.primary500},{setNotiData:h}=T.useContext(m.CustomOpenList),p=cn({baseUrl:t,notiPath:n,setNotiData:h}),b=async(y,w)=>{try{const k=n||`/notification-management/api/v1/notifications/${y}`,A=t+k;await m.axiosInstance.put(A,{isRead:w})}catch(k){console.log(k),u({id:e.id,isRead:e.isRead})}await p()},g=(y,w)=>{console.log("specificNotificationID",y);const k=!w;u(A=>({...A,isRead:k})),console.log("newIsReadState",k),b(y,k)};T.useEffect(()=>{u(r?y=>({...y,isRead:!0}):{id:e.id,isRead:e.isRead})},[r,e.id,e.isRead]);const a=()=>{i(!s)},x=y=>{const w=X(),k=X(y),A=w.diff(k,"days"),j=w.diff(k,"minutes"),I=w.diff(k,"months"),O=w.diff(k,"years");if(console.log("diffInMonths",I),j<1)return"Just now";if(A===0){if(j<=60)return`${j} minute${j>1?"s":""} ago`;const $=Math.floor(j/60);return console.log("diffIhours",$),`${$} hour${$>1?"s":""} ago`}if(A===1)return"Yesterday";if(A>=2&&A<7)return`${A} days ago`;if(A<30){const $=Math.floor(A/7);return`${$} week${$>1?"s":""} ago`}return I===0||I===1?"1 month ago":I<12?`${I} months ago`:O===0||O===1?"1 year ago":"Over 1 year ago"},S=e!=null&&e.data?(C=e==null?void 0:e.data)==null?void 0:C.length:0,E=(y,w)=>{var k,A;if((y==null?void 0:y.actionKey)!=null){if((k=y==null?void 0:y.data)!=null&&k.brandName)return m.translate(`notificationAdmin.notify.actionKey.${y==null?void 0:y.actionKey}`,{defaultValue:`${y==null?void 0:y.message}`,brandName:y.data.brandName});switch(y==null?void 0:y.notificationType){case"deleteMultiple":return y!=null&&y.data&&((A=y==null?void 0:y.data)==null?void 0:A.length)>1?m.translate(`notificationAdmin.notify.actionKey.${y==null?void 0:y.actionKey}_multiple`,{defaultValue:`${y==null?void 0:y.actionKey}`,count:w}):m.translate(`notificationAdmin.notify.actionKey.${y==null?void 0:y.actionKey}_single`,{defaultValue:`${y==null?void 0:y.actionKey}`});default:return m.translate(`notificationAdmin.notify.actionKey.${y==null?void 0:y.actionKey}`,{defaultValue:`${y==null?void 0:y.message}`})}}return y.message},_=e!=null&&e.contextUrl?"a":"p";return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"notitification-item__container",children:[c.jsx("div",{className:"notification-item__image-container",children:c.jsx("img",{src:!e.actorAvatarUrl||e.actorName==="System"?"https://ukpcsaprod.blob.core.windows.net/account/logo.png":e.actorAvatarUrl,onError:({currentTarget:y})=>{console.log("img on error",y),y.onerror=null,y.src="https://ukpcsaprod.blob.core.windows.net/account/logo.png"},alt:e.actorName})}),c.jsxs("div",{style:{width:"100%"},children:[c.jsxs("div",{className:"notification-item__content-wrapper",children:[c.jsxs("div",{className:"notification-item__content",children:[c.jsx("p",{className:"notification-item__user-name",children:e.actorName}),c.jsxs(_,{href:e.contextUrl,style:{cursor:e!=null&&e.contextUrl?"pointer":"unset"},children:[E(e,S),c.jsx("span",{className:"notification-item__context-link",children:` ${e!=null&&e.context?e.context:""}`})]}),(e==null?void 0:e.notificationType)==="deleteMultiple"&&c.jsxs("button",{style:{color:m.color.primary400,textDecoration:"underline"},onClick:a,children:[s?"Hide":"Show "," details"]})]}),c.jsx("div",{className:"notification-item__time",children:c.jsx("p",{children:x(e.createdAt)})}),c.jsx("button",{className:`${d} notification-item__read-at`,"aria-label":"Mark as read",style:f,onClick:()=>g(e.id,e.isRead)})]}),s&&c.jsx("div",{style:{background:"#fff",width:"100%",padding:"8px",fontSize:"12px",marginTop:"8px"},children:c.jsx("ul",{children:(v=e==null?void 0:e.data)==null?void 0:v.map((y,w)=>c.jsxs("li",{style:{display:"flex",alignItems:"center",marginBottom:"4px"},children:[c.jsx("span",{style:{backgroundColor:m.color.primary400},className:"list-dot"}),c.jsx("span",{style:{width:"calc(100% - 12px)"},children:y.name})]},w))})})]})]})})},Tn=({notidata:e,baseUrl:t,notiPath:n,brandColors:r,notiUnreadNumber:o})=>{const[s,i]=T.useState(!1);console.log(s);const{setNotiData:l}=T.useContext(m.CustomOpenList),u=cn({baseUrl:t,notiPath:n,setNotiData:l}),d=async()=>{try{const p=t+(n||"/notification-management/api/v1/notifications");await m.axiosInstance.put(p)}catch(h){console.log(h)}await u(),i(!1)},f=()=>{i(!0),d()};return console.log("notiUnreadNumber",o),c.jsxs("div",{children:[c.jsx("div",{className:"mark-all-read",children:c.jsx("button",{onClick:f,style:{visibility:o===0?"hidden":"visible"},children:"Mark all as read"})}),c.jsx("div",{className:"notification-items__wrapper",children:c.jsx("div",{className:"notification-items__content",children:Object.values(e).map((h,p)=>c.jsx(So,{notification:h,baseUrl:t,notiPath:n,markAllAsReadState:s,brandColors:r},p))})})]})},wo=({baseUrl:e,notiPath:t,brandColors:n})=>{var d,f,h,p;const r=T.useRef(null),{setShowModalFalse:o}=T.useContext(m.CustomOpenList),{notidata:s}=T.useContext(m.CustomOpenList);console.log(s),T.useEffect(()=>{const b=a=>{!(!!a.composedPath?a.composedPath():[a.target]).some(_=>{var C;return _===r.current||((C=_==null?void 0:_.classList)==null?void 0:C.contains("noti-container"))})&&o()},g=setTimeout(()=>{document.addEventListener("mousedown",b)},100);return()=>{clearTimeout(g),document.removeEventListener("mousedown",b)}},[o]);const[i,l]=T.useState("all"),u=[{id:"all",tabTitle:`All (${((d=s==null?void 0:s.all)==null?void 0:d.total)||0})`,children:c.jsx(Tn,{notidata:((f=s==null?void 0:s.all)==null?void 0:f.rows)||[],baseUrl:e,notiPath:t,brandColors:n,notiUnreadNumber:s.unread.total})},{id:"unread",tabTitle:`Unread (${((h=s==null?void 0:s.unread)==null?void 0:h.total)||0})`,children:c.jsx(Tn,{notidata:((p=s==null?void 0:s.unread)==null?void 0:p.rows)||[],baseUrl:e,notiPath:t,brandColors:n,notiUnreadNumber:s.unread.total})}];return c.jsx(c.Fragment,{children:c.jsx("div",{ref:r,style:{position:"absolute",backgroundColor:"#fff",width:"550px",height:"90vh",right:"100px",top:"100%",padding:"32px",boxShadow:"10px 0px 20px #999",borderRadius:"0 0 8px 8px",overflow:"hidden",zIndex:"100"},children:c.jsxs("div",{className:"list-content",children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[c.jsx("h3",{style:{fontSize:"24px",fontWeight:"500",color:m.color.textPrimary},className:"list-title",children:"Notifications"}),c.jsx("button",{onClick:o,children:c.jsx("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M7.05086 6.13616C6.66033 5.74563 6.02717 5.74563 5.63664 6.13616C5.24612 6.52668 5.24612 7.15984 5.63664 7.55037L10.5864 12.5001L5.63664 17.4499C5.24612 17.8404 5.24612 18.4736 5.63664 18.8641C6.02717 19.2546 6.66033 19.2546 7.05086 18.8641L12.0006 13.9143L16.9504 18.8641C17.3409 19.2546 17.974 19.2546 18.3646 18.8641C18.7551 18.4736 18.7551 17.8404 18.3646 17.4499L13.4148 12.5001L18.3646 7.55037C18.7551 7.15984 18.7551 6.52668 18.3646 6.13616C17.974 5.74563 17.3409 5.74563 16.9504 6.13616L12.0006 11.0859L7.05086 6.13616Z",fill:"#85858A"})})})]}),c.jsx(vo,{tabs:u,setCurrentTab:l,currentTab:i,brandColors:n})]})})})};function _o({iconColor:e="#fff",baseUrl:t,notiPath:n,brandColors:r}){var h,p;const{isOpen:o,toggleOpen:s,setShowModalFalse:i}=T.useContext(m.CustomOpenList),{notidata:l,setNotiData:u}=T.useContext(m.CustomOpenList),d=cn({baseUrl:t,notiPath:n,setNotiData:u}),f=async()=>{var b,g;try{await d()}catch(a){m.pushError(((g=(b=a.response)==null?void 0:b.data)==null?void 0:g.errorMessage)||"Have error when get notification list")}};return T.useEffect(()=>{f()},[o]),c.jsxs("div",{children:[c.jsxs("div",{className:"noti-container",style:{position:"relative"},children:[c.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:b=>{b.stopPropagation(),s()},style:{cursor:"pointer",color:e},children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7968 17.4705C16.5901 17.4705 18.8076 16.8556 19.0218 14.3874C19.0218 11.921 17.4757 12.0796 17.4757 9.05334C17.4757 6.68952 15.2352 4 11.7968 4C8.35833 4 6.1178 6.68952 6.1178 9.05334C6.1178 12.0796 4.57178 11.921 4.57178 14.3874C4.78679 16.8649 7.00428 17.4705 11.7968 17.4705Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M13.8274 20.0286C12.6679 21.3161 10.8591 21.3313 9.68848 20.0286",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(l==null?void 0:l.unread)&&(l==null?void 0:l.unread.total)!=0&&c.jsx("span",{style:{position:"absolute",top:"-9px",right:"-6px",width:"20px",height:"20px",border:"1px solid #fff",borderRadius:"50%",color:"#fff",fontSize:"12px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:m.color.danger},className:"notification-badge",children:((h=l==null?void 0:l.unread)==null?void 0:h.total)>9?"9+":`${(p=l==null?void 0:l.unread)==null?void 0:p.total}`})]}),c.jsx("div",{className:"noti-list-container",children:o&&c.jsx(wo,{baseUrl:t,notiPath:n,brandColors:r})})]})}const Eo=`.avatar-dropdown-item{padding:.5rem;font-size:.875rem;line-height:1.25rem;cursor:pointer;border-radius:.25rem}.avartarDropdownMenu{background-color:#fff;padding:.5rem;width:13rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);position:absolute;left:-10rem;top:3.2rem}.avartarDropdownMenu ul{list-style:none;padding-inline-start:0;margin-block-end:0}.navbar-wrapper{position:fixed;top:0;left:0;width:100%;height:64px;display:flex;z-index:1000;background:#292929;padding-left:2.5rem}.navbar-container{display:flex;flex-direction:row;align-items:center;width:100%;justify-content:space-between;position:relative}.logo-container{height:100%;display:flex;align-items:center}.right-side-container{display:flex;flex-direction:row;align-items:center;text-align:center;margin-right:2.5rem;gap:1rem}.userContainer{display:flex;align-items:center;gap:.5rem}.userFullName{color:#fff;font-weight:400;font-size:.875rem;line-height:1.25rem;transition:width .3s}.userAvatar{width:2.5rem;height:2.5rem;-o-object-fit:cover;object-fit:cover;border-radius:9999px;border:2px solid #FFFFFF}#userAvatarNull{width:2.5rem;height:2.5rem;background:#DDDDDD;border-radius:100%;color:#fff;font-size:20px;font-weight:400;display:flex;align-items:center;justify-content:center}.relative{position:relative}.cursor-pointer{cursor:pointer}.topbar-search-label{display:flex;position:relative}.topbar-search-input{color:#292929;border-radius:3px;height:40px;outline:none;font-size:14px;text-overflow:ellipsis;max-width:166px}#icon{position:absolute;left:9px;top:8px;width:16px;height:24px}
32
+ `}),c.jsxs("div",{className:"tab-container",children:[c.jsx("div",{style:{display:"flex",width:"100%",height:"50px",borderBottom:`1px solid ${m.color.grey200}`},className:"tab-container__title",children:t.map((s,i)=>c.jsx("button",{id:s.id,disabled:e.currentTab===`${s.id}`,onClick:n,className:`tab-title ${e.currentTab===`${s.id}`?"is-active":""}`,children:s.tabTitle},i))}),c.jsx("div",{className:"tab-content",children:t.map((s,i)=>c.jsx("div",{children:e.currentTab===`${s.id}`&&c.jsx("div",{children:s.children})},i))})]})]})},cn=({baseUrl:e,notiPath:t,setNotiData:n})=>async()=>{var d;const s=e+(t||"/notification-management/api/v1/notifications"),l=(d=(await m.axiosInstance.get(s,{params:{filter:{notificationFilterType:"all"}}})).data)==null?void 0:d.rows,u=l==null?void 0:l.filter(f=>f.isRead===!1);n({all:{rows:l??[],total:(l==null?void 0:l.length)??0},unread:{rows:u??[],total:(u==null?void 0:u.length)??0}})},So=({notification:e,baseUrl:t,notiPath:n,markAllAsReadState:r,brandColors:o})=>{var C,v;const[s,i]=T.useState(!1),[l,u]=T.useState({id:e.id,isRead:e.isRead}),d=l.isRead===!1?"unread":"read",f={borderColor:l.isRead?"#c5c5c5":(o==null?void 0:o.primary500)||m.color.primary500,backgroundColor:l.isRead?"#c5c5c5":(o==null?void 0:o.primary500)||m.color.primary500},{setNotiData:h}=T.useContext(m.CustomOpenList),p=cn({baseUrl:t,notiPath:n,setNotiData:h}),b=async(y,w)=>{try{const k=n||`/notification-management/api/v1/notifications/${y}`,A=t+k;await m.axiosInstance.put(A,{isRead:w})}catch(k){console.log(k),u({id:e.id,isRead:e.isRead})}await p()},g=(y,w)=>{console.log("specificNotificationID",y);const k=!w;u(A=>({...A,isRead:k})),console.log("newIsReadState",k),b(y,k)};T.useEffect(()=>{u(r?y=>({...y,isRead:!0}):{id:e.id,isRead:e.isRead})},[r,e.id,e.isRead]);const a=()=>{i(!s)},x=y=>{const w=X(),k=X(y),A=w.diff(k,"days"),j=w.diff(k,"minutes"),I=w.diff(k,"months"),O=w.diff(k,"years");if(console.log("diffInMonths",I),j<1)return"Just now";if(A===0){if(j<=60)return`${j} minute${j>1?"s":""} ago`;const $=Math.floor(j/60);return console.log("diffIhours",$),`${$} hour${$>1?"s":""} ago`}if(A===1)return"Yesterday";if(A>=2&&A<7)return`${A} days ago`;if(A<30){const $=Math.floor(A/7);return`${$} week${$>1?"s":""} ago`}return I===0||I===1?"1 month ago":I<12?`${I} months ago`:O===0||O===1?"1 year ago":"Over 1 year ago"},S=e!=null&&e.data?(C=e==null?void 0:e.data)==null?void 0:C.length:0,E=(y,w)=>{var k,A;if((y==null?void 0:y.actionKey)!=null){if((k=y==null?void 0:y.data)!=null&&k.brandName)return m.translate(`notificationAdmin.notify.actionKey.${y==null?void 0:y.actionKey}`,{defaultValue:`${y==null?void 0:y.message}`,brandName:y.data.brandName});switch(y==null?void 0:y.notificationType){case"deleteMultiple":return y!=null&&y.data&&((A=y==null?void 0:y.data)==null?void 0:A.length)>1?m.translate(`notificationAdmin.notify.actionKey.${y==null?void 0:y.actionKey}_multiple`,{defaultValue:`${y==null?void 0:y.actionKey}`,count:w}):m.translate(`notificationAdmin.notify.actionKey.${y==null?void 0:y.actionKey}_single`,{defaultValue:`${y==null?void 0:y.actionKey}`});default:return m.translate(`notificationAdmin.notify.actionKey.${y==null?void 0:y.actionKey}`,{defaultValue:`${y==null?void 0:y.message}`})}}return y.message},_=e!=null&&e.contextUrl?"a":"p";return c.jsx(c.Fragment,{children:c.jsxs("div",{className:"notitification-item__container",children:[c.jsx("div",{className:"notification-item__image-container",children:c.jsx("img",{src:!e.actorAvatarUrl||e.actorName==="System"?"https://ukpcsaprod.blob.core.windows.net/account/logo.png":e.actorAvatarUrl,onError:({currentTarget:y})=>{console.log("img on error",y),y.onerror=null,y.src="https://ukpcsaprod.blob.core.windows.net/account/logo.png"},alt:e.actorName})}),c.jsxs("div",{style:{width:"100%"},children:[c.jsxs("div",{className:"notification-item__content-wrapper",children:[c.jsxs("div",{className:"notification-item__content",children:[c.jsx("p",{className:"notification-item__user-name",children:e.actorName}),c.jsxs(_,{href:e.contextUrl,style:{cursor:e!=null&&e.contextUrl?"pointer":"unset"},children:[E(e,S),c.jsx("span",{className:"notification-item__context-link",children:` ${e!=null&&e.context?e.context:""}`})]}),(e==null?void 0:e.notificationType)==="deleteMultiple"&&c.jsxs("button",{style:{color:m.color.primary400,textDecoration:"underline"},onClick:a,children:[s?"Hide":"Show "," details"]})]}),c.jsx("div",{className:"notification-item__time",children:c.jsx("p",{children:x(e.createdAt)})}),c.jsx("button",{className:`${d} notification-item__read-at`,"aria-label":"Mark as read",style:f,onClick:()=>g(e.id,e.isRead)})]}),s&&c.jsx("div",{style:{background:"#fff",width:"100%",padding:"8px",fontSize:"12px",marginTop:"8px"},children:c.jsx("ul",{children:(v=e==null?void 0:e.data)==null?void 0:v.map((y,w)=>c.jsxs("li",{style:{display:"flex",alignItems:"center",marginBottom:"4px"},children:[c.jsx("span",{style:{backgroundColor:m.color.primary400},className:"list-dot"}),c.jsx("span",{style:{width:"calc(100% - 12px)"},children:y.name})]},w))})})]})]})})},Tn=({notidata:e,baseUrl:t,notiPath:n,brandColors:r,notiUnreadNumber:o})=>{const[s,i]=T.useState(!1);console.log(s);const{setNotiData:l}=T.useContext(m.CustomOpenList),u=cn({baseUrl:t,notiPath:n,setNotiData:l}),d=async()=>{try{const p=t+(n||"/notification-management/api/v1/notifications");await m.axiosInstance.put(p)}catch(h){console.log(h)}await u(),i(!1)},f=()=>{i(!0),d()};return console.log("notiUnreadNumber",o),c.jsxs("div",{children:[c.jsx("div",{className:"mark-all-read",children:c.jsx("button",{onClick:f,style:{visibility:o===0?"hidden":"visible"},children:"Mark all as read"})}),c.jsx("div",{className:"notification-items__wrapper",children:c.jsx("div",{className:"notification-items__content",children:Object.values(e).map((h,p)=>c.jsx(So,{notification:h,baseUrl:t,notiPath:n,markAllAsReadState:s,brandColors:r},p))})})]})},wo=({baseUrl:e,notiPath:t,brandColors:n})=>{var d,f,h,p;const r=T.useRef(null),{setShowModalFalse:o}=T.useContext(m.CustomOpenList),{notidata:s}=T.useContext(m.CustomOpenList);console.log(s),T.useEffect(()=>{const b=a=>{!(!!a.composedPath?a.composedPath():[a.target]).some(_=>{var C;return _===r.current||((C=_==null?void 0:_.classList)==null?void 0:C.contains("noti-container"))})&&o()},g=setTimeout(()=>{document.addEventListener("mousedown",b)},100);return()=>{clearTimeout(g),document.removeEventListener("mousedown",b)}},[o]);const[i,l]=T.useState("all"),u=[{id:"all",tabTitle:`All (${((d=s==null?void 0:s.all)==null?void 0:d.total)||0})`,children:c.jsx(Tn,{notidata:((f=s==null?void 0:s.all)==null?void 0:f.rows)||[],baseUrl:e,notiPath:t,brandColors:n,notiUnreadNumber:s.unread.total})},{id:"unread",tabTitle:`Unread (${((h=s==null?void 0:s.unread)==null?void 0:h.total)||0})`,children:c.jsx(Tn,{notidata:((p=s==null?void 0:s.unread)==null?void 0:p.rows)||[],baseUrl:e,notiPath:t,brandColors:n,notiUnreadNumber:s.unread.total})}];return c.jsx(c.Fragment,{children:c.jsx("div",{ref:r,style:{position:"absolute",backgroundColor:"#fff",width:"550px",height:"90vh",right:"100px",top:"100%",padding:"32px",boxShadow:"10px 0px 20px #999",borderRadius:"0 0 8px 8px",overflow:"hidden",zIndex:"100"},children:c.jsxs("div",{className:"list-content",children:[c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[c.jsx("h3",{style:{fontSize:"24px",fontWeight:"500",color:m.color.textPrimary},className:"list-title",children:"Notifications"}),c.jsx("button",{onClick:o,children:c.jsx("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M7.05086 6.13616C6.66033 5.74563 6.02717 5.74563 5.63664 6.13616C5.24612 6.52668 5.24612 7.15984 5.63664 7.55037L10.5864 12.5001L5.63664 17.4499C5.24612 17.8404 5.24612 18.4736 5.63664 18.8641C6.02717 19.2546 6.66033 19.2546 7.05086 18.8641L12.0006 13.9143L16.9504 18.8641C17.3409 19.2546 17.974 19.2546 18.3646 18.8641C18.7551 18.4736 18.7551 17.8404 18.3646 17.4499L13.4148 12.5001L18.3646 7.55037C18.7551 7.15984 18.7551 6.52668 18.3646 6.13616C17.974 5.74563 17.3409 5.74563 16.9504 6.13616L12.0006 11.0859L7.05086 6.13616Z",fill:"#85858A"})})})]}),c.jsx(vo,{tabs:u,setCurrentTab:l,currentTab:i,brandColors:n})]})})})};function _o({iconColor:e="#fff",baseUrl:t,notiPath:n,brandColors:r}){var h,p;const{isOpen:o,toggleOpen:s,setShowModalFalse:i}=T.useContext(m.CustomOpenList),{notidata:l,setNotiData:u}=T.useContext(m.CustomOpenList),d=cn({baseUrl:t,notiPath:n,setNotiData:u}),f=async()=>{var b,g;try{await d()}catch(a){m.pushError(((g=(b=a.response)==null?void 0:b.data)==null?void 0:g.errorMessage)||"Have error when get notification list")}};return T.useEffect(()=>{f()},[o]),c.jsxs("div",{children:[c.jsxs("div",{className:"noti-container",style:{position:"relative"},children:[c.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",onClick:b=>{b.stopPropagation(),s()},style:{cursor:"pointer",color:e},children:[c.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.7968 17.4705C16.5901 17.4705 18.8076 16.8556 19.0218 14.3874C19.0218 11.921 17.4757 12.0796 17.4757 9.05334C17.4757 6.68952 15.2352 4 11.7968 4C8.35833 4 6.1178 6.68952 6.1178 9.05334C6.1178 12.0796 4.57178 11.921 4.57178 14.3874C4.78679 16.8649 7.00428 17.4705 11.7968 17.4705Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),c.jsx("path",{d:"M13.8274 20.0286C12.6679 21.3161 10.8591 21.3313 9.68848 20.0286",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(l==null?void 0:l.unread)&&(l==null?void 0:l.unread.total)!=0&&c.jsx("span",{style:{position:"absolute",top:"-9px",right:"-6px",width:"20px",height:"20px",border:"1px solid #fff",borderRadius:"50%",color:"#fff",fontSize:"12px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:m.color.danger},className:"notification-badge",children:((h=l==null?void 0:l.unread)==null?void 0:h.total)>9?"9+":`${(p=l==null?void 0:l.unread)==null?void 0:p.total}`})]}),c.jsx("div",{className:"noti-list-container",children:o&&c.jsx(wo,{baseUrl:t,notiPath:n,brandColors:r})})]})}const Eo=`.avatar-dropdown-item{padding:.5rem;font-size:.875rem;line-height:1.25rem;cursor:pointer;border-radius:.25rem}.avartarDropdownMenu{background-color:#fff;padding:.5rem;width:13rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);position:absolute;left:-10rem;top:3.2rem}.avartarDropdownMenu ul{list-style:none;padding-inline-start:0;margin-block-end:0}.navbar-wrapper{top:0;left:0;width:100%;height:64px;display:flex;z-index:1000;background:#292929;padding-left:2.5rem}.navbar-container{display:flex;flex-direction:row;align-items:center;width:100%;justify-content:space-between;position:relative}.logo-container{height:100%;display:flex;align-items:center}.right-side-container{display:flex;flex-direction:row;align-items:center;text-align:center;margin-right:2.5rem;gap:1rem}.userContainer{display:flex;align-items:center;gap:.5rem}.userFullName{color:#fff;font-weight:400;font-size:.875rem;line-height:1.25rem;transition:width .3s}.userAvatar{width:2.5rem;height:2.5rem;-o-object-fit:cover;object-fit:cover;border-radius:9999px;border:2px solid #FFFFFF}#userAvatarNull{width:2.5rem;height:2.5rem;background:#DDDDDD;border-radius:100%;color:#fff;font-size:20px;font-weight:400;display:flex;align-items:center;justify-content:center}.relative{position:relative}.cursor-pointer{cursor:pointer}.topbar-search-label{display:flex;position:relative}.topbar-search-input{color:#292929;border-radius:3px;height:40px;outline:none;font-size:14px;text-overflow:ellipsis;max-width:166px}#icon{position:absolute;left:9px;top:8px;width:16px;height:24px}
33
33
  `,Co=`.StyledReactSearchAutocomplete ::-webkit-scrollbar-track{background:#f1f1f1;border-radius:5px}.StyledReactSearchAutocomplete ::-webkit-scrollbar-thumb{background:rgb(194,194,194);border-radius:5px}.StyledReactSearchAutocomplete ::-webkit-scrollbar-thumb:hover{background:rgb(117,117,117)}.StyledReactSearchAutocomplete .container{display:flex;width:100%;height:100vh;justify-content:center;align-items:center}.StyledReactSearchAutocomplete .container>div{width:300px;height:40px}.StyledReactSearchAutocomplete .container>div input{width:100%;height:40px;border:1px solid #ccc;border-radius:5px;font-size:14px;color:#000}.StyledReactSearchAutocomplete .container>div input:focus{outline:1px solid rgb(83,172,255)}.StyledReactSearchAutocomplete .list{display:flex;flex-direction:column;max-height:220px;width:inherit;overflow:auto;overflow-x:hidden;box-shadow:#0000001f 0 1px 3px,#0000003d 0 1px 2px;color:#000}.StyledReactSearchAutocomplete .list button{background:none;border:none;width:100%;height:100%;max-height:3em;padding:10px;text-align:left;cursor:pointer;border-bottom:1px solid #ccc}.StyledReactSearchAutocomplete .list button:hover{background:#f8f8f8}.StyledReactSearchAutocomplete .list button:last-child{border-bottom:none}.StyledReactSearchAutocomplete{position:relative;height:46px}.StyledReactSearchAutocomplete .wrapper{position:absolute;display:flex;flex-direction:column;width:100%;border:1px solid #dfe1e5;background-color:#fff;color:#212121;font-size:14px;font-family:inherit;z-index:0;margin-top:2px;border-radius:3px}.StyledReactSearchAutocomplete .wrapper:hover,.StyledReactSearchAutocomplete .wrapper:active,.StyledReactSearchAutocomplete .wrapper:focus-within{box-shadow:#20212447 0 1px 6px}.StyledResults{position:absolute;display:flex;flex-direction:column;border:1px solid #dfe1e5;background-color:#fff;color:#212121;font-size:14px;font-family:inherit;z-index:0;min-width:250px;max-width:400px;top:calc(100% - 2px);left:0}.StyledResults>div.line{border-top-color:#e8eaed;border-top-style:solid;border-top-width:1px;margin:0 20px 0 14px;padding-bottom:4px}.StyledResults>ul{list-style-type:none;margin:0;padding:0 0 16px;max-height:300px;max-width:450px}#autocomplete-results strong,#autocomplete-results li strong,#autocomplete-results li div strong{font-weight:700!important}.StyledResults>ul>li{display:flex;align-items:center;padding:4px 10px 4px 0;font-size:14px;width:100%}.StyledResults>ul>li>div{margin-left:13px;font-size:14px}.StyledResults .ellipsis{text-align:left;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.StyledResults .selectedSearch{color:#fff;text-decoration:none;background-color:#0d6efd}.StyledSearchInput{min-height:40px;width:100%;display:flex;align-items:center}.StyledSearchInput input{width:100%}.StyledSearchInput>input::-moz-placeholder{color:gray;opacity:1}.StyledSearchInput>input::placeholder{color:gray;opacity:1}.StyledSearchInput>input:-ms-input-placeholder{color:gray}.StyledSearchInput>input::-ms-input-placeholder{color:gray}.StyledClearIcon{margin:0 0 0 5px}.StyledClearIcon:hover{cursor:pointer}.StyledClearIcon>svg{fill:gray}.StyledSearchIcon{flex-shrink:0;margin:0 0 0 10px;fill:gray}.search-icon{position:unset!important;float:left;margin-right:5px;margin-left:5px}
34
34
  `,To=`:root{--textPrimary: #292929;--textWhite: #fff;--primary500: #2E7D32;--grey100: #FAFAFA;--gray200: #EEEEEE;--gray600: #85858A;--link: #007BFF }.list-content{overflow-y:auto;overflow-x:hidden}.mark-all-read{text-align:right;color:#007bff;margin-bottom:12px;font-size:12px}.notification-items__wrapper{overflow:hidden}.notification-items__content{height:calc(100vh - 275px);overflow-x:hidden;overflow-y:auto;color:#292929}.notitification-item__container{display:flex;justify-content:space-between;padding:16px;border-bottom:#FAFAFA 1px solid;text-align:left;font-size:12px;position:relative;z-index:10;border-radius:4px;margin-bottom:8px}.notitification-item__container:hover{background-color:#fafafa}.notification-item__image-container{width:46px;height:40px;display:flex;justify-content:center;align-items:center;border-radius:50%;overflow:hidden;margin-right:16px}.notification-item__image-container img{width:100%;height:100%;text-align:center;-o-object-fit:cover;object-fit:cover;color:transparent;text-indent:10000px}.notification-item__content-wrapper{width:100%;display:flex;align-items:center;justify-content:space-between}.notification-item__context-link{color:#007bff}.notification-item__context-text{color:#292929}.notification-item__content{width:68%;padding-right:16px}.notification-item__user-name{margin-bottom:2px;font-size:14px}.notification-item__time{margin-right:15px;text-align:right}.notification-item__read-at{border-width:2px;border-style:solid;border-radius:50%;width:10px;height:10px;display:block;position:relative}.notification-item__read-at:before{position:absolute;top:-30px;right:0;width:91px;background-color:#85858a;color:#fff;border-radius:4px;font-size:10px;text-align:center;padding:4px;opacity:0;visibility:hidden;transition:all .3s cubic-bezier(.39,.575,.565,1)}.notification-item__read-at:hover:before{opacity:1;visibility:visible}.notification-item__read-at.read:before{content:"Mark as unread"}.notification-item__read-at.unread:before{content:"Mark as read"}.notification-item__read-at.read{border-color:#eee}.notification-item__read-at.unread{border-color:#2e7d32;background-color:#2e7d32}.list-dot{border-radius:50%;width:8px;height:8px;margin-right:4px;display:block}
35
35
  `,Io=`._subscription-diaglog_1bysb_2{position:fixed;width:100vw;height:100vh;top:0;left:0;background-color:#0006;z-index:10000;display:flex;align-items:center;justify-content:center}._subscription-container_1bysb_15{width:610px;height:222px;border-radius:8px;padding:32px 24px 40px;background:#fff;color:#292929}._subscription-title_1bysb_25{font-size:20px;font-weight:500;text-align:center;color:#292929}._subscription-title_1bysb_25,._subscription-text_1bysb_34{margin-bottom:24px}._subscription-btn__container_1bysb_38{display:flex;justify-content:space-between;align-items:center}._btn-success_1bysb_44,._btn-cancel_1bysb_45{width:150px;height:40px;display:flex;align-items:center;justify-content:center;padding:8px;color:#292929;border-radius:1px;transition:background-color .25s cubic-bezier(.4,0,.2,1) 0ms,box-shadow .25s cubic-bezier(.4,0,.2,1) 0ms,border-color .25s cubic-bezier(.4,0,.2,1) 0ms,color .25s cubic-bezier(.4,0,.2,1) 0ms}._btn-cancel_1bysb_45{background-color:#ddd}._btn-cancel_1bysb_45:hover{background-color:#c5c5c5}._btn-success_1bysb_44{background-color:#93d500}._btn-success_1bysb_44:hover{background-color:#2e7d32}
@@ -1,8 +1,8 @@
1
1
  import { jsxs as k, Fragment as ce, jsx as u } from "react/jsx-runtime";
2
2
  import * as W from "react";
3
3
  import pe, { useState as B, useContext as ke, useEffect as q, useRef as ve, useCallback as kt, forwardRef as Wo, createElement as or, PureComponent as Uo } from "react";
4
- import { c as De, a as gt, C as Le, t as ct, p as Yo, L as Wr, u as Ko, b as Go, S as Hn, d as qo, e as Zo, Q as jn, f as Et, g as Bn, h as Xo, s as Ct, _ as V, P as N, i as we, j as Jo, o as Qo, k as Ae, l as ei, m as ti, n as Ur, q as At, r as Yr, I as ri, v as ni, w as Kr, D as oi, x as Vn, y as Wn, z as ii, A as ai, B as si } from "../index.esm2017-9e03f5b5.js";
5
- import { H as B1, G as V1, K as W1, E as U1, F as Y1, J as K1 } from "../index.esm2017-9e03f5b5.js";
4
+ import { c as De, a as gt, C as Le, t as ct, p as Yo, L as Wr, u as Ko, b as Go, S as Hn, d as qo, e as Zo, Q as jn, f as Et, g as Bn, h as Xo, s as Ct, _ as V, P as N, i as we, j as Jo, o as Qo, k as Ae, l as ei, m as ti, n as Ur, q as At, r as Yr, I as ri, v as ni, w as Kr, D as oi, x as Vn, y as Wn, z as ii, A as ai, B as si } from "../index.esm2017-7c760d4b.js";
5
+ import { H as B1, G as V1, K as W1, E as U1, F as Y1, J as K1 } from "../index.esm2017-7c760d4b.js";
6
6
  import Q from "moment";
7
7
  import { Stack as he, Dialog as li, DialogTitle as ci, Typography as Pe, DialogContent as ui, DialogActions as di, Button as ur, Box as fi, ClickAwayListener as hi, TextField as Un, IconButton as mi, CircularProgress as pi, Fade as gi, Paper as yi, Checkbox as bi } from "@mui/material";
8
8
  import "axios";
@@ -526,7 +526,7 @@ function Ei({
526
526
  ) })
527
527
  ] });
528
528
  }
529
- const Ci = `.avatar-dropdown-item{padding:.5rem;font-size:.875rem;line-height:1.25rem;cursor:pointer;border-radius:.25rem}.avartarDropdownMenu{background-color:#fff;padding:.5rem;width:13rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);position:absolute;left:-10rem;top:3.2rem}.avartarDropdownMenu ul{list-style:none;padding-inline-start:0;margin-block-end:0}.navbar-wrapper{position:fixed;top:0;left:0;width:100%;height:64px;display:flex;z-index:1000;background:#292929;padding-left:2.5rem}.navbar-container{display:flex;flex-direction:row;align-items:center;width:100%;justify-content:space-between;position:relative}.logo-container{height:100%;display:flex;align-items:center}.right-side-container{display:flex;flex-direction:row;align-items:center;text-align:center;margin-right:2.5rem;gap:1rem}.userContainer{display:flex;align-items:center;gap:.5rem}.userFullName{color:#fff;font-weight:400;font-size:.875rem;line-height:1.25rem;transition:width .3s}.userAvatar{width:2.5rem;height:2.5rem;-o-object-fit:cover;object-fit:cover;border-radius:9999px;border:2px solid #FFFFFF}#userAvatarNull{width:2.5rem;height:2.5rem;background:#DDDDDD;border-radius:100%;color:#fff;font-size:20px;font-weight:400;display:flex;align-items:center;justify-content:center}.relative{position:relative}.cursor-pointer{cursor:pointer}.topbar-search-label{display:flex;position:relative}.topbar-search-input{color:#292929;border-radius:3px;height:40px;outline:none;font-size:14px;text-overflow:ellipsis;max-width:166px}#icon{position:absolute;left:9px;top:8px;width:16px;height:24px}
529
+ const Ci = `.avatar-dropdown-item{padding:.5rem;font-size:.875rem;line-height:1.25rem;cursor:pointer;border-radius:.25rem}.avartarDropdownMenu{background-color:#fff;padding:.5rem;width:13rem;--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);position:absolute;left:-10rem;top:3.2rem}.avartarDropdownMenu ul{list-style:none;padding-inline-start:0;margin-block-end:0}.navbar-wrapper{top:0;left:0;width:100%;height:64px;display:flex;z-index:1000;background:#292929;padding-left:2.5rem}.navbar-container{display:flex;flex-direction:row;align-items:center;width:100%;justify-content:space-between;position:relative}.logo-container{height:100%;display:flex;align-items:center}.right-side-container{display:flex;flex-direction:row;align-items:center;text-align:center;margin-right:2.5rem;gap:1rem}.userContainer{display:flex;align-items:center;gap:.5rem}.userFullName{color:#fff;font-weight:400;font-size:.875rem;line-height:1.25rem;transition:width .3s}.userAvatar{width:2.5rem;height:2.5rem;-o-object-fit:cover;object-fit:cover;border-radius:9999px;border:2px solid #FFFFFF}#userAvatarNull{width:2.5rem;height:2.5rem;background:#DDDDDD;border-radius:100%;color:#fff;font-size:20px;font-weight:400;display:flex;align-items:center;justify-content:center}.relative{position:relative}.cursor-pointer{cursor:pointer}.topbar-search-label{display:flex;position:relative}.topbar-search-input{color:#292929;border-radius:3px;height:40px;outline:none;font-size:14px;text-overflow:ellipsis;max-width:166px}#icon{position:absolute;left:9px;top:8px;width:16px;height:24px}
530
530
  `, Ii = `.StyledReactSearchAutocomplete ::-webkit-scrollbar-track{background:#f1f1f1;border-radius:5px}.StyledReactSearchAutocomplete ::-webkit-scrollbar-thumb{background:rgb(194,194,194);border-radius:5px}.StyledReactSearchAutocomplete ::-webkit-scrollbar-thumb:hover{background:rgb(117,117,117)}.StyledReactSearchAutocomplete .container{display:flex;width:100%;height:100vh;justify-content:center;align-items:center}.StyledReactSearchAutocomplete .container>div{width:300px;height:40px}.StyledReactSearchAutocomplete .container>div input{width:100%;height:40px;border:1px solid #ccc;border-radius:5px;font-size:14px;color:#000}.StyledReactSearchAutocomplete .container>div input:focus{outline:1px solid rgb(83,172,255)}.StyledReactSearchAutocomplete .list{display:flex;flex-direction:column;max-height:220px;width:inherit;overflow:auto;overflow-x:hidden;box-shadow:#0000001f 0 1px 3px,#0000003d 0 1px 2px;color:#000}.StyledReactSearchAutocomplete .list button{background:none;border:none;width:100%;height:100%;max-height:3em;padding:10px;text-align:left;cursor:pointer;border-bottom:1px solid #ccc}.StyledReactSearchAutocomplete .list button:hover{background:#f8f8f8}.StyledReactSearchAutocomplete .list button:last-child{border-bottom:none}.StyledReactSearchAutocomplete{position:relative;height:46px}.StyledReactSearchAutocomplete .wrapper{position:absolute;display:flex;flex-direction:column;width:100%;border:1px solid #dfe1e5;background-color:#fff;color:#212121;font-size:14px;font-family:inherit;z-index:0;margin-top:2px;border-radius:3px}.StyledReactSearchAutocomplete .wrapper:hover,.StyledReactSearchAutocomplete .wrapper:active,.StyledReactSearchAutocomplete .wrapper:focus-within{box-shadow:#20212447 0 1px 6px}.StyledResults{position:absolute;display:flex;flex-direction:column;border:1px solid #dfe1e5;background-color:#fff;color:#212121;font-size:14px;font-family:inherit;z-index:0;min-width:250px;max-width:400px;top:calc(100% - 2px);left:0}.StyledResults>div.line{border-top-color:#e8eaed;border-top-style:solid;border-top-width:1px;margin:0 20px 0 14px;padding-bottom:4px}.StyledResults>ul{list-style-type:none;margin:0;padding:0 0 16px;max-height:300px;max-width:450px}#autocomplete-results strong,#autocomplete-results li strong,#autocomplete-results li div strong{font-weight:700!important}.StyledResults>ul>li{display:flex;align-items:center;padding:4px 10px 4px 0;font-size:14px;width:100%}.StyledResults>ul>li>div{margin-left:13px;font-size:14px}.StyledResults .ellipsis{text-align:left;width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.StyledResults .selectedSearch{color:#fff;text-decoration:none;background-color:#0d6efd}.StyledSearchInput{min-height:40px;width:100%;display:flex;align-items:center}.StyledSearchInput input{width:100%}.StyledSearchInput>input::-moz-placeholder{color:gray;opacity:1}.StyledSearchInput>input::placeholder{color:gray;opacity:1}.StyledSearchInput>input:-ms-input-placeholder{color:gray}.StyledSearchInput>input::-ms-input-placeholder{color:gray}.StyledClearIcon{margin:0 0 0 5px}.StyledClearIcon:hover{cursor:pointer}.StyledClearIcon>svg{fill:gray}.StyledSearchIcon{flex-shrink:0;margin:0 0 0 10px;fill:gray}.search-icon{position:unset!important;float:left;margin-right:5px;margin-left:5px}
531
531
  `, Ti = `:root{--textPrimary: #292929;--textWhite: #fff;--primary500: #2E7D32;--grey100: #FAFAFA;--gray200: #EEEEEE;--gray600: #85858A;--link: #007BFF }.list-content{overflow-y:auto;overflow-x:hidden}.mark-all-read{text-align:right;color:#007bff;margin-bottom:12px;font-size:12px}.notification-items__wrapper{overflow:hidden}.notification-items__content{height:calc(100vh - 275px);overflow-x:hidden;overflow-y:auto;color:#292929}.notitification-item__container{display:flex;justify-content:space-between;padding:16px;border-bottom:#FAFAFA 1px solid;text-align:left;font-size:12px;position:relative;z-index:10;border-radius:4px;margin-bottom:8px}.notitification-item__container:hover{background-color:#fafafa}.notification-item__image-container{width:46px;height:40px;display:flex;justify-content:center;align-items:center;border-radius:50%;overflow:hidden;margin-right:16px}.notification-item__image-container img{width:100%;height:100%;text-align:center;-o-object-fit:cover;object-fit:cover;color:transparent;text-indent:10000px}.notification-item__content-wrapper{width:100%;display:flex;align-items:center;justify-content:space-between}.notification-item__context-link{color:#007bff}.notification-item__context-text{color:#292929}.notification-item__content{width:68%;padding-right:16px}.notification-item__user-name{margin-bottom:2px;font-size:14px}.notification-item__time{margin-right:15px;text-align:right}.notification-item__read-at{border-width:2px;border-style:solid;border-radius:50%;width:10px;height:10px;display:block;position:relative}.notification-item__read-at:before{position:absolute;top:-30px;right:0;width:91px;background-color:#85858a;color:#fff;border-radius:4px;font-size:10px;text-align:center;padding:4px;opacity:0;visibility:hidden;transition:all .3s cubic-bezier(.39,.575,.565,1)}.notification-item__read-at:hover:before{opacity:1;visibility:visible}.notification-item__read-at.read:before{content:"Mark as unread"}.notification-item__read-at.unread:before{content:"Mark as read"}.notification-item__read-at.read{border-color:#eee}.notification-item__read-at.unread{border-color:#2e7d32;background-color:#2e7d32}.list-dot{border-radius:50%;width:8px;height:8px;margin-right:4px;display:block}
532
532
  `, Mi = `._subscription-diaglog_1bysb_2{position:fixed;width:100vw;height:100vh;top:0;left:0;background-color:#0006;z-index:10000;display:flex;align-items:center;justify-content:center}._subscription-container_1bysb_15{width:610px;height:222px;border-radius:8px;padding:32px 24px 40px;background:#fff;color:#292929}._subscription-title_1bysb_25{font-size:20px;font-weight:500;text-align:center;color:#292929}._subscription-title_1bysb_25,._subscription-text_1bysb_34{margin-bottom:24px}._subscription-btn__container_1bysb_38{display:flex;justify-content:space-between;align-items:center}._btn-success_1bysb_44,._btn-cancel_1bysb_45{width:150px;height:40px;display:flex;align-items:center;justify-content:center;padding:8px;color:#292929;border-radius:1px;transition:background-color .25s cubic-bezier(.4,0,.2,1) 0ms,box-shadow .25s cubic-bezier(.4,0,.2,1) 0ms,border-color .25s cubic-bezier(.4,0,.2,1) 0ms,color .25s cubic-bezier(.4,0,.2,1) 0ms}._btn-cancel_1bysb_45{background-color:#ddd}._btn-cancel_1bysb_45:hover{background-color:#c5c5c5}._btn-success_1bysb_44{background-color:#93d500}._btn-success_1bysb_44:hover{background-color:#2e7d32}
@@ -138,7 +138,7 @@ Incoming: %s`,Ri,"["+g.join(", ")+"]","["+w.join(", ")+"]");for(var A=0;A<w.leng
138
138
  Error generating stack: `+$.message+`
139
139
  `+$.stack}}var ll=n.ReactCurrentDispatcher,Es=n.ReactDebugCurrentFrame,tc=0,Ii=1,ul=2,tu=3,Ga=4,ks=0,nc=1,qa=2,rc=12800;function ic(g){return console.error(g),null}function To(){}function Gf(g,w,A,$,K,se,ye,Ae,h){var b=[],D=new Set,M={destination:null,responseState:w,progressiveChunkSize:$===void 0?rc:$,status:ks,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:D,pingedTasks:b,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:K===void 0?ic:K,onAllReady:se===void 0?To:se,onShellReady:ye===void 0?To:ye,onShellError:Ae===void 0?To:Ae,onFatalError:h===void 0?To:h},Y=nu(M,0,null,A,!1,!1);Y.parentFlushed=!0;var ie=cl(M,g,null,Y,D,jn,Hc,Uf);return b.push(ie),M}function qf(g,w){var A=g.pingedTasks;A.push(w),A.length===1&&s(function(){return vl(g)})}function Os(g,w){return{id:zi,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:w,errorDigest:null}}function cl(g,w,A,$,K,se,ye,Ae){g.allPendingTasks++,A===null?g.pendingRootTasks++:A.pendingTasks++;var h={node:w,ping:function(){return qf(g,h)},blockedBoundary:A,blockedSegment:$,abortSet:K,legacyContext:se,context:ye,treeContext:Ae};return h.componentStack=null,K.add(h),h}function nu(g,w,A,$,K,se){return{status:tc,id:-1,index:w,parentFlushed:!1,chunks:[],children:[],formatContext:$,boundary:A,lastPushedText:K,textEmbedded:se}}var to=null;function _s(){return to===null||to.componentStack===null?"":Zc(to.componentStack)}function Wo(g,w){g.componentStack={tag:0,parent:g.componentStack,type:w}}function no(g,w){g.componentStack={tag:1,parent:g.componentStack,type:w}}function Ds(g,w){g.componentStack={tag:2,parent:g.componentStack,type:w}}function Ai(g){g.componentStack===null?i("Unexpectedly popped too many stack frames. This is a bug in React."):g.componentStack=g.componentStack.parent}var Xa=null;function ru(g,w){{var A;typeof w=="string"?A=w:w&&typeof w.message=="string"?A=w.message:A=String(w);var $=Xa||_s();Xa=null,g.errorMessage=A,g.errorComponentStack=$}}function Mi(g,w){var A=g.onError(w);if(A!=null&&typeof A!="string")throw new Error('onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "'+typeof A+'" instead');return A}function zo(g,w){var A=g.onShellError;A(w);var $=g.onFatalError;$(w),g.destination!==null?(g.status=qa,U(g.destination,w)):(g.status=nc,g.fatalError=w)}function oc(g,w,A){Wo(w,"Suspense");var $=w.blockedBoundary,K=w.blockedSegment,se=A.fallback,ye=A.children,Ae=new Set,h=Os(g,Ae),b=K.chunks.length,D=nu(g,b,h,K.formatContext,!1,!1);K.children.push(D),K.lastPushedText=!1;var M=nu(g,0,null,K.formatContext,!1,!1);M.parentFlushed=!0,w.blockedBoundary=h,w.blockedSegment=M;try{if(Co(g,w,ye),Lr(M.chunks,g.responseState,M.lastPushedText,M.textEmbedded),M.status=Ii,gl(h,M),h.pendingTasks===0){Ai(w);return}}catch(ie){M.status=Ga,h.forceClientRender=!0,h.errorDigest=Mi(g,ie),ru(h,ie)}finally{w.blockedBoundary=$,w.blockedSegment=K}var Y=cl(g,se,$,D,Ae,w.legacyContext,w.context,w.treeContext);Y.componentStack=w.componentStack,g.pingedTasks.push(Y),Ai(w)}function Ka(g,w,A,$){Wo(w,A);var K=w.blockedSegment,se=ia(K.chunks,A,$,g.responseState,K.formatContext);K.lastPushedText=!1;var ye=K.formatContext;K.formatContext=ri(ye,A,$),Co(g,w,se),K.formatContext=ye,Fo(K.chunks,A),K.lastPushedText=!1,Ai(w)}function fl(g){return g.prototype&&g.prototype.isReactComponent}function iu(g,w,A,$,K){var se={};qu(w,se);var ye=A($,K);return va(A,$,ye,K)}function Jc(g,w,A,$,K){var se=A.render();A.props!==K&&(Ps||i("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",En($)||"a component"),Ps=!0);{var ye=$.childContextTypes;if(ye!=null){var Ae=w.legacyContext,h=zu(A,$,Ae,ye);w.legacyContext=h,zr(g,w,se),w.legacyContext=Ae;return}}zr(g,w,se)}function ac(g,w,A,$){Ds(w,A);var K=Wu(A,w.legacyContext),se=xo(A,$,K);Gc(se,A,$,K),Jc(g,w,se,A,$),Ai(w)}var Gt={},dl={},Qc={},Za={},Ps=!1,sc={},lc=!1,ai=!1,uc=!1;function hl(g,w,A,$){var K;if(K=Wu(A,w.legacyContext),no(w,A),A.prototype&&typeof A.prototype.render=="function"){var se=En(A)||"Unknown";Gt[se]||(i("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",se,se),Gt[se]=!0)}var ye=iu(g,w,A,$,K),Ae=Wr();if(typeof ye=="object"&&ye!==null&&typeof ye.render=="function"&&ye.$$typeof===void 0){var h=En(A)||"Unknown";dl[h]||(i("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",h,h,h),dl[h]=!0)}if(typeof ye=="object"&&ye!==null&&typeof ye.render=="function"&&ye.$$typeof===void 0){{var b=En(A)||"Unknown";dl[b]||(i("The <%s /> component appears to be a function component that returns a class instance. Change %s to a class that extends React.Component instead. If you can't use a class try assigning the prototype on the function as a workaround. `%s.prototype = React.Component.prototype`. Don't use an arrow function since it cannot be called with `new` by React.",b,b,b),dl[b]=!0)}Gc(ye,A,$,K),Jc(g,w,ye,A,$)}else if(ou(A),Ae){var D=w.treeContext,M=1,Y=0;w.treeContext=ql(D,M,Y);try{zr(g,w,ye)}finally{w.treeContext=D}}else zr(g,w,ye);Ai(w)}function ou(g){{if(g&&g.childContextTypes&&i("%s(...): childContextTypes cannot be defined on a function component.",g.displayName||g.name||"Component"),g.defaultProps!==void 0){var w=En(g)||"Unknown";sc[w]||(i("%s: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.",w),sc[w]=!0)}if(typeof g.getDerivedStateFromProps=="function"){var A=En(g)||"Unknown";Za[A]||(i("%s: Function components do not support getDerivedStateFromProps.",A),Za[A]=!0)}if(typeof g.contextType=="object"&&g.contextType!==null){var $=En(g)||"Unknown";Qc[$]||(i("%s: Function components do not support contextType.",$),Qc[$]=!0)}}}function au(g,w){if(g&&g.defaultProps){var A=ee({},w),$=g.defaultProps;for(var K in $)A[K]===void 0&&(A[K]=$[K]);return A}return w}function ef(g,w,A,$,K){no(w,A.render);var se=iu(g,w,A.render,$,K),ye=Wr();if(ye){var Ae=w.treeContext,h=1,b=0;w.treeContext=ql(Ae,h,b);try{zr(g,w,se)}finally{w.treeContext=Ae}}else zr(g,w,se);Ai(w)}function xi(g,w,A,$,K){var se=A.type,ye=au(se,$);Rs(g,w,se,ye,K)}function Yo(g,w,A,$){A._context===void 0?A!==A.Consumer&&(uc||(uc=!0,i("Rendering <Context> directly is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?"))):A=A._context;var K=$.children;typeof K!="function"&&i("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it.");var se=nl(A),ye=K(se);zr(g,w,ye)}function cc(g,w,A,$){var K=A._context,se=$.value,ye=$.children,Ae;Ae=w.context,w.context=Uc(K,se),zr(g,w,ye),w.context=Wc(K),Ae!==w.context&&i("Popping the context provider did not return back to the original snapshot. This is a bug in React.")}function tf(g,w,A,$,K){Wo(w,"Lazy");var se=A._payload,ye=A._init,Ae=ye(se),h=au(Ae,$);Rs(g,w,Ae,h,K),Ai(w)}function Rs(g,w,A,$,K){if(typeof A=="function")if(fl(A)){ac(g,w,A,$);return}else{hl(g,w,A,$);return}if(typeof A=="string"){Ka(g,w,A,$);return}switch(A){case Fn:case Yt:case Q:case he:case Oe:{zr(g,w,$.children);return}case pt:{Wo(w,"SuspenseList"),zr(g,w,$.children),Ai(w);return}case kt:throw new Error("ReactDOMServer does not yet support scope components.");case ht:{oc(g,w,$);return}}if(typeof A=="object"&&A!==null)switch(A.$$typeof){case ze:{ef(g,w,A,$,K);return}case ut:{xi(g,w,A,$,K);return}case fe:{cc(g,w,A,$);return}case $e:{Yo(g,w,A,$);return}case It:{tf(g,w,A,$);return}}var se="";throw(A===void 0||typeof A=="object"&&A!==null&&Object.keys(A).length===0)&&(se+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),new Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) "+("but got: "+(A==null?A:typeof A)+"."+se))}function nf(g,w){typeof Symbol=="function"&&g[Symbol.toStringTag]==="Generator"&&(lc||i("Using Generators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. Keep in mind you might need to polyfill these features for older browsers."),lc=!0),g.entries===w&&(ai||i("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ai=!0)}function zr(g,w,A){try{return su(g,w,A)}catch($){throw typeof $=="object"&&$!==null&&typeof $.then=="function"||(Xa=Xa!==null?Xa:_s()),$}}function su(g,w,A){if(w.node=A,typeof A=="object"&&A!==null){switch(A.$$typeof){case ve:{var $=A,K=$.type,se=$.props,ye=$.ref;Rs(g,w,K,se,ye);return}case Pe:throw new Error("Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.");case It:{var Ae=A,h=Ae._payload,b=Ae._init,D;try{D=b(h)}catch(St){throw typeof St=="object"&&St!==null&&typeof St.then=="function"&&Wo(w,"Lazy"),St}zr(g,w,D);return}}if(ki(A)){lu(g,w,A);return}var M=Ki(A);if(M){nf(A,M);var Y=M.call(A);if(Y){var ie=Y.next();if(!ie.done){var de=[];do de.push(ie.value),ie=Y.next();while(!ie.done);lu(g,w,de);return}return}}var Ie=Object.prototype.toString.call(A);throw new Error("Objects are not valid as a React child (found: "+(Ie==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":Ie)+"). If you meant to render a collection of children, use an array instead.")}if(typeof A=="string"){var Ze=w.blockedSegment;Ze.lastPushedText=Yi(w.blockedSegment.chunks,A,g.responseState,Ze.lastPushedText);return}if(typeof A=="number"){var vt=w.blockedSegment;vt.lastPushedText=Yi(w.blockedSegment.chunks,""+A,g.responseState,vt.lastPushedText);return}typeof A=="function"&&i("Functions are not valid as a React child. This may happen if you return a Component instead of <Component /> from render. Or maybe you meant to call this function rather than return it.")}function lu(g,w,A){for(var $=A.length,K=0;K<$;K++){var se=w.treeContext;w.treeContext=ql(se,$,K);try{Co(g,w,A[K])}finally{w.treeContext=se}}}function Yr(g,w,A){var $=w.blockedSegment,K=$.chunks.length,se=nu(g,K,null,$.formatContext,$.lastPushedText,!0);$.children.push(se),$.lastPushedText=!1;var ye=cl(g,w.node,w.blockedBoundary,se,w.abortSet,w.legacyContext,w.context,w.treeContext);w.componentStack!==null&&(ye.componentStack=w.componentStack.parent);var Ae=ye.ping;A.then(Ae,Ae)}function Co(g,w,A){var $=w.blockedSegment.formatContext,K=w.legacyContext,se=w.context,ye=null;ye=w.componentStack;try{return zr(g,w,A)}catch(Ae){if(Xu(),typeof Ae=="object"&&Ae!==null&&typeof Ae.then=="function"){Yr(g,w,Ae),w.blockedSegment.formatContext=$,w.legacyContext=K,w.context=se,tl(se),w.componentStack=ye;return}else throw w.blockedSegment.formatContext=$,w.legacyContext=K,w.context=se,tl(se),w.componentStack=ye,Ae}}function rf(g,w,A,$){var K=Mi(g,$);if(w===null?zo(g,$):(w.pendingTasks--,w.forceClientRender||(w.forceClientRender=!0,w.errorDigest=K,ru(w,$),w.parentFlushed&&g.clientRenderedBoundaries.push(w))),g.allPendingTasks--,g.allPendingTasks===0){var se=g.onAllReady;se()}}function ya(g){var w=this,A=g.blockedBoundary,$=g.blockedSegment;$.status=tu,uu(w,A,$)}function pl(g,w,A){var $=g.blockedBoundary,K=g.blockedSegment;if(K.status=tu,$===null)w.allPendingTasks--,w.status!==qa&&(w.status=qa,w.destination!==null&&_(w.destination));else{if($.pendingTasks--,!$.forceClientRender){$.forceClientRender=!0;var se=A===void 0?new Error("The render was aborted by the server without a reason."):A;$.errorDigest=w.onError(se);{var ye="The server did not finish this Suspense boundary: ";se&&typeof se.message=="string"?se=ye+se.message:se=ye+String(se);var Ae=to;to=g;try{ru($,se)}finally{to=Ae}}$.parentFlushed&&w.clientRenderedBoundaries.push($)}if($.fallbackAbortableTasks.forEach(function(b){return pl(b,w,A)}),$.fallbackAbortableTasks.clear(),w.allPendingTasks--,w.allPendingTasks===0){var h=w.onAllReady;h()}}}function gl(g,w){if(w.chunks.length===0&&w.children.length===1&&w.children[0].boundary===null){var A=w.children[0];A.id=w.id,A.parentFlushed=!0,A.status===Ii&&gl(g,A)}else{var $=g.completedSegments;$.push(w)}}function uu(g,w,A){if(w===null){if(A.parentFlushed){if(g.completedRootSegment!==null)throw new Error("There can only be one root segment. This is a bug in React.");g.completedRootSegment=A}if(g.pendingRootTasks--,g.pendingRootTasks===0){g.onShellError=To;var $=g.onShellReady;$()}}else if(w.pendingTasks--,!w.forceClientRender){if(w.pendingTasks===0)A.parentFlushed&&A.status===Ii&&gl(w,A),w.parentFlushed&&g.completedBoundaries.push(w),w.fallbackAbortableTasks.forEach(ya,g),w.fallbackAbortableTasks.clear();else if(A.parentFlushed&&A.status===Ii){gl(w,A);var K=w.completedSegments;K.length===1&&w.parentFlushed&&g.partialBoundaries.push(w)}}if(g.allPendingTasks--,g.allPendingTasks===0){var se=g.onAllReady;se()}}function of(g,w){var A=w.blockedSegment;if(A.status===tc){tl(w.context);var $=null;$=to,to=w;try{zr(g,w,w.node),Lr(A.chunks,g.responseState,A.lastPushedText,A.textEmbedded),w.abortSet.delete(w),A.status=Ii,uu(g,w.blockedBoundary,A)}catch(se){if(Xu(),typeof se=="object"&&se!==null&&typeof se.then=="function"){var K=w.ping;se.then(K,K)}else w.abortSet.delete(w),A.status=Ga,rf(g,w.blockedBoundary,A,se)}finally{to=$}}}function vl(g){if(g.status!==qa){var w=Ul(),A=ll.current;ll.current=Cr;var $;$=Es.getCurrentStack,Es.getCurrentStack=_s;var K=al;sl(g.responseState);try{var se=g.pingedTasks,ye;for(ye=0;ye<se.length;ye++){var Ae=se[ye];of(g,Ae)}se.splice(0,ye),g.destination!==null&&Si(g,g.destination)}catch(h){Mi(g,h),zo(g,h)}finally{sl(K),ll.current=A,Es.getCurrentStack=$,A===Cr&&tl(w)}}}function ml(g,w,A){switch(A.parentFlushed=!0,A.status){case tc:{var $=A.id=g.nextSegmentId++;return A.lastPushedText=!1,A.textEmbedded=!1,er(w,g.responseState,$)}case Ii:{A.status=ul;for(var K=!0,se=A.chunks,ye=0,Ae=A.children,h=0;h<Ae.length;h++){for(var b=Ae[h];ye<b.index;ye++)p(w,se[ye]);K=yl(g,w,b)}for(;ye<se.length-1;ye++)p(w,se[ye]);return ye<se.length&&(K=x(w,se[ye])),K}default:throw new Error("Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.")}}function yl(g,w,A){var $=A.boundary;if($===null)return ml(g,w,A);if($.parentFlushed=!0,$.forceClientRender)return Xe(w,g.responseState,$.errorDigest,$.errorMessage,$.errorComponentStack),ml(g,w,A),Rt(w,g.responseState);if($.pendingTasks>0){$.rootSegmentID=g.nextSegmentId++,$.completedSegments.length>0&&g.partialBoundaries.push($);var K=$.id=Rn(g.responseState);return ke(w,g.responseState,K),ml(g,w,A),Dt(w,g.responseState)}else{if($.byteSize>g.progressiveChunkSize)return $.rootSegmentID=g.nextSegmentId++,g.completedBoundaries.push($),ke(w,g.responseState,$.id),ml(g,w,A),Dt(w,g.responseState);je(w,g.responseState);var se=$.completedSegments;if(se.length!==1)throw new Error("A previously unvisited boundary must have exactly one root segment. This is a bug in React.");var ye=se[0];return yl(g,w,ye),ft(w,g.responseState)}}function fc(g,w,A){return Xs(w,g.responseState,A.id,A.errorDigest,A.errorMessage,A.errorComponentStack)}function bl(g,w,A){return _t(w,g.responseState,A.formatContext,A.id),yl(g,w,A),Et(w,A.formatContext)}function Is(g,w,A){for(var $=A.completedSegments,K=0;K<$.length;K++){var se=$[K];Er(g,w,A,se)}return $.length=0,Xi(w,g.responseState,A.id,A.rootSegmentID)}function af(g,w,A){for(var $=A.completedSegments,K=0;K<$.length;K++){var se=$[K];if(!Er(g,w,A,se))return K++,$.splice(0,K),!1}return $.splice(0,K),!0}function Er(g,w,A,$){if($.status===ul)return!0;var K=$.id;if(K===-1){var se=$.id=A.rootSegmentID;if(se===-1)throw new Error("A root segment ID must have been assigned by now. This is a bug in React.");return bl(g,w,$)}else return bl(g,w,$),Gs(w,g.responseState,K)}function Si(g,w){v();try{var A=g.completedRootSegment;A!==null&&g.pendingRootTasks===0&&(yl(g,w,A),g.completedRootSegment=null,bi(w,g.responseState));var $=g.clientRenderedBoundaries,K;for(K=0;K<$.length;K++){var se=$[K];fc(g,w,se)}$.splice(0,K);var ye=g.completedBoundaries;for(K=0;K<ye.length;K++){var Ae=ye[K];Is(g,w,Ae)}ye.splice(0,K),T(w),v(w);var h=g.partialBoundaries;for(K=0;K<h.length;K++){var b=h[K];if(!af(g,w,b)){g.destination=null,K++,h.splice(0,K);return}}h.splice(0,K);var D=g.completedBoundaries;for(K=0;K<D.length;K++){var M=D[K];Is(g,w,M)}D.splice(0,K)}finally{T(w),g.allPendingTasks===0&&g.pingedTasks.length===0&&g.clientRenderedBoundaries.length===0&&g.completedBoundaries.length===0&&(g.abortableTasks.size!==0&&i("There was still abortable task at the root when we closed. This is a bug in React."),_(w))}}function Xf(g){s(function(){return vl(g)})}function sf(g,w){if(g.status===nc){g.status=qa,U(w,g.fatalError);return}if(g.status!==qa&&g.destination===null){g.destination=w;try{Si(g,w)}catch(A){Mi(g,A),zo(g,A)}}}function Ja(g,w){try{var A=g.abortableTasks;A.forEach(function($){return pl($,g,w)}),A.clear(),g.destination!==null&&Si(g,g.destination)}catch($){Mi(g,$),zo(g,$)}}function As(g,w){return new Promise(function(A,$){var K,se,ye=new Promise(function(Y,ie){se=Y,K=ie});function Ae(){var Y=new ReadableStream({type:"bytes",pull:function(ie){sf(b,ie)},cancel:function(ie){Ja(b)}},{highWaterMark:0});Y.allReady=ye,A(Y)}function h(Y){ye.catch(function(){}),$(Y)}var b=Gf(g,Ir(w?w.identifierPrefix:void 0,w?w.nonce:void 0,w?w.bootstrapScriptContent:void 0,w?w.bootstrapScripts:void 0,w?w.bootstrapModules:void 0),ni(w?w.namespaceURI:void 0),w?w.progressiveChunkSize:void 0,w?w.onError:void 0,se,Ae,h,K);if(w&&w.signal){var D=w.signal,M=function(){Ja(b,D.reason),D.removeEventListener("abort",M)};D.addEventListener("abort",M)}Xf(b)})}Hh.renderToReadableStream=As,Hh.version=t}()),Hh}var Mc,Lm;process.env.NODE_ENV==="production"?(Mc=S4(),Lm=T4()):(Mc=C4(),Lm=E4());Mc.version;var k4=Mc.renderToString;Mc.renderToStaticMarkup;Mc.renderToNodeStream;Mc.renderToStaticNodeStream;Lm.renderToReadableStream;var O4=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yO(e,t){return e(t={exports:{}},t.exports),t.exports}var _4=yO(function(e){(function(t){var n=function(L,R,U){if(!c(R)||v(R)||p(R)||x(R)||l(R))return R;var W,te=0,J=0;if(d(R))for(W=[],J=R.length;te<J;te++)W.push(n(L,R[te],U));else for(var pe in W={},R)Object.prototype.hasOwnProperty.call(R,pe)&&(W[L(pe,U)]=n(L,R[pe],U));return W},r=function(L){return T(L)?L:(L=L.replace(/[\-_\s]+(.)?/g,function(R,U){return U?U.toUpperCase():""})).substr(0,1).toLowerCase()+L.substr(1)},i=function(L){var R=r(L);return R.substr(0,1).toUpperCase()+R.substr(1)},o=function(L,R){return function(U,W){var te=(W=W||{}).separator||"_",J=W.split||/(?=[A-Z])/;return U.split(J).join(te)}(L,R).toLowerCase()},s=Object.prototype.toString,l=function(L){return typeof L=="function"},c=function(L){return L===Object(L)},d=function(L){return s.call(L)=="[object Array]"},v=function(L){return s.call(L)=="[object Date]"},p=function(L){return s.call(L)=="[object RegExp]"},x=function(L){return s.call(L)=="[object Boolean]"},T=function(L){return(L-=0)==L},_=function(L,R){var U=R&&"process"in R?R.process:R;return typeof U!="function"?L:function(W,te){return U(W,L,te)}},I={camelize:r,decamelize:o,pascalize:i,depascalize:o,camelizeKeys:function(L,R){return n(_(r,R),L)},decamelizeKeys:function(L,R){return n(_(o,R),L,R)},pascalizeKeys:function(L,R){return n(_(i,R),L)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=I:t.humps=I})(O4)}).decamelize,D4=function(e){if(Array.isArray(e))return e},P4=function(e,t){if(typeof Symbol<"u"&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var s,l=e[Symbol.iterator]();!(r=(s=l.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(c){i=!0,o=c}finally{try{r||l.return==null||l.return()}finally{if(i)throw o}}return n}},u1=function(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},R4=function(e,t){if(e){if(typeof e=="string")return u1(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u1(e,t):void 0}},I4=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
140
140
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},A4=function(e,t){return D4(e)||P4(e,t)||R4(e,t)||I4()},bO=yO(function(e){function t(){return e.exports=t=Object.assign||function(n){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},t.apply(this,arguments)}e.exports=t}),M4=function(e,t){if(e==null)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i},wO=function(e,t){if(e==null)return{};var n,r,i=M4(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i},L4=X.createContext(null);function xO(e){var t=e.children,n=t===void 0?"":t,r=wO(e,["children"]);return typeof n!="string"&&(n=k4(n)),X.createElement("template",bO({},r,{dangerouslySetInnerHTML:{__html:n}}))}function SO(e){var t=e.root,n=e.children;return Wm.createPortal(n===void 0?null:n,t)}function F4(e){var t=X.forwardRef(function(n,r){var i,o,s=n.mode,l=s===void 0?"open":s,c=n.delegatesFocus,d=c!==void 0&&c,v=n.styleSheets,p=v===void 0?[]:v,x=n.ssr,T=x!==void 0&&x,_=n.children,I=wO(n,["mode","delegatesFocus","styleSheets","ssr","children"]),L=(o=X.useRef((i=r)&&i.current),X.useEffect(function(){i&&(i.current=o.current)},[i]),o),R=X.useState(null),U=A4(R,2),W=U[0],te=U[1],J="node_".concat(l).concat(d);return X.useLayoutEffect(function(){if(L.current)try{if(typeof r=="function"&&r(L.current),T){var pe=L.current.shadowRoot;return void te(pe)}var S=L.current.attachShadow({mode:l,delegatesFocus:d});p.length>0&&(S.adoptedStyleSheets=p),te(S)}catch(ce){(function(ae){var Ne=ae.error,Ge=ae.styleSheets,qe=ae.root;switch(Ne.name){case"NotSupportedError":Ge.length>0&&(qe.adoptedStyleSheets=Ge);break;default:throw Ne}})({error:ce,styleSheets:p,root:W})}},[r,L,p]),X.createElement(X.Fragment,null,X.createElement(e.tag,bO({key:J,ref:L},I),(W||T)&&X.createElement(L4.Provider,{value:W},T?X.createElement(xO,{shadowroot:l,shadowrootmode:l},e.render({root:W,ssr:T,children:_})):X.createElement(SO,{root:W},e.render({root:W,ssr:T,children:_})))))});return t.propTypes={mode:Oa.oneOf(["open","closed"]),delegatesFocus:Oa.bool,styleSheets:Oa.arrayOf(Oa.instanceOf(globalThis.CSSStyleSheet)),ssr:Oa.bool,children:Oa.node},t}xO.propTypes={children:Oa.oneOfType([Oa.string,Oa.node])},SO.propTypes={root:Oa.object.isRequired,children:Oa.node};var _v=new Map;function N4(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"core",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(r){return r.children};return new Proxy(e,{get:function(r,i){var o=_4(i,{separator:"-"}),s="".concat(t,"-").concat(o);return _v.has(s)||_v.set(s,F4({tag:o,render:n})),_v.get(s)}})}var TO=N4();const j4=`.app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}
141
- `,B4=`.favorite-bar{position:sticky;top:64px;z-index:900;transition:transform .3s ease,opacity .3s ease;border-bottom:1px solid #ddd}.favorite-bar--hidden{transform:translateY(-100%);opacity:0}.favorite-bar--visible{transform:translateY(0);opacity:1}
141
+ `,B4=`.favorite-bar{z-index:900;transition:transform .3s ease,opacity .3s ease;border-bottom:1px solid #ddd}.favorite-bar--hidden{transform:translateY(-100%);opacity:0}.favorite-bar--visible{transform:translateY(0);opacity:1}
142
142
  `;function $4(e){const t=new CustomEvent("updateFavoriteMenu",{detail:{menuItem:e}});window.dispatchEvent(t)}function V4(e){const t=_p.useLocation(),[n,r]=X.useState([]),[i,o]=X.useState(window.location.href);X.useEffect(()=>{o(window.location.href)},[t]);const s=x=>`${x}`;function l(x,T){for(const _ of x){if(_.id===T)return _;if(_.children){const I=l(_.children,T);if(I)return I}}return null}function c(x,T){const _=l(n,x);_?(_.isFavorite=T,$4(_),Qy(x,T)):console.error(`Item with id ${x} not found`)}const d=x=>{console.log("Favorite menus changed",x),r(x.detail.favoriteMenus||[])};X.useEffect(()=>(window.addEventListener("favoriteMenusChange",d),()=>{window.removeEventListener("favoriteMenusChange",d)}),[]),console.log("favoriteItems",n);function v(x,T){return!T||n.indexOf(T)===-1?1:v(T,n.find(I=>I.id===T.parentKey))+1}const p=(x,T,_)=>{const I=L=>_.some(R=>R.id===L);return Ue.jsx(mO,{isActive:I,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,item:x,level:T,onSetFavoriteSuccess:c})};return Ue.jsx(Ue.Fragment,{children:n.length?Ue.jsx("div",{className:s("favorite-menu"),children:Ue.jsx("div",{className:s("wrap-section favorite-menu__menu"),style:{flex:1,overflow:"auto",width:"100%",overflowY:"hidden",display:"flex",alignItems:"center",scrollbarWidth:"thin"},children:n.map(x=>Ue.jsx("div",{children:p(x,v(),[])},x.id))})}):""})}function H4(e=32){const[t,n]=X.useState(!0),[r,i]=X.useState(0),o=()=>{const s=window.scrollY;s>r&&s>e?n(!1):s<r&&n(!0),i(s)};return X.useEffect(()=>(window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)),[r]),{isFavoriteBarVisible:t}}function U4(e){const{isFavoriteBarVisible:t}=H4();return Ue.jsxs(Ue.Fragment,{children:[Ue.jsx("style",{children:B4}),Ue.jsx("div",{className:`favorite-bar ${t?"favorite-bar--visible":"favorite-bar--hidden"}`,children:Ue.jsx(TO.div,{children:Ue.jsx(Xm,{styles:[ST,x4,j4],children:Ue.jsx(V4,{...e})})})})]})}function Qy(e,t){const n=JSON.parse(localStorage.getItem("favoriteItems")||"[]");if(t)n.includes(e)||n.push(e);else{const r=n.indexOf(e);r>-1&&n.splice(r,1)}localStorage.setItem("favoriteItems",JSON.stringify(n))}function CO({...e}){var _e,Ye,We,Re,Fe;const t=e.item,n=e.level||0,r=!!((_e=e.item.children)!=null&&_e.length),{isActive:i,isCollapsed:o}=e,s=`level-${n}`,l=o?"collapsed":"expanded",c=i(t.id)?"active":"",d=r?"parent":"child",v=e.params.isOpen?"isOpen":"isClose",p=e.isInternalApp?"isInternalApp":"",x=(He,lt=s)=>`${He} ${lt} ${l} ${c} ${d} ${v} ${p}`,[T,_]=X.useState(!1),[I,L]=X.useState(t.isFavorite||!1);X.useEffect(()=>{L(!!e.item.isFavorite)},[e.item.isFavorite]);const R=X.useRef(),U=X.useRef();U!=null&&U.current&&((Ye=U==null?void 0:U.current)==null?void 0:Ye.scrollWidth)>((We=U==null?void 0:U.current)==null?void 0:We.clientWidth);const W=window.location.origin,te=t.path&&t.path.includes("http")?new URL(t.path):{origin:"",pathname:""},J=window.location.pathname.split("/")[1],pe=te.pathname.split("/")[1],S=e.item.redirectUrl||e.ssr||!W.includes("local")&&W!==te.origin||pe!==J,ce=r?"div":!e.isInternalApp&&S?"a":_p.Link,ae=t.redirectUrl||t.path||"#",Ne=n+1,Ge=r&&o&&T,qe=o||n===0?void 0:`${n+.25}rem`,it=()=>{_(!0)},nt=()=>{_(!1)},me="/global-menu-config/api/v1/menu-items/user/set-favorite",Se=t.serviceKey==="mn_poms";e.params.depth*20,e.params.depth,yH(t.id,e.params.isOpen,e.params.onToggle);const Ve=He=>{He.stopPropagation(),e.params.onToggle()},at=Se||o&&n===0?t.name==="POMs"?"Parking Operations Management":t.description||t.name:null;Object.entries(e.brandColors||{}).reduce((He,[lt,ct])=>(ct&&(He[`--${lt}`]=ct),He),{});const Ee=W!==te.origin||e.item.redirectUrl?"_blank":"_self";return Ue.jsxs("div",{ref:R,className:x("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s"},onMouseOver:it,onMouseOut:nt,onDragStart:He=>{o&&n>1&&He.preventDefault()},children:[Ue.jsx(ss.Tooltip,{placement:"top",title:at,disableInteractive:!0,children:Ue.jsxs(ce,{target:Ee,to:ae,href:ae,draggable:"true",className:x("menu-item__link"),style:{paddingLeft:qe,transition:"all 0.3s",color:i(t.id)?((Re=e.brandColors)==null?void 0:Re.primary400)||Gr.primary400:void 0,backgroundColor:i(t.id)&&n===0?(Fe=e.brandColors)==null?void 0:Fe.primary200:void 0},onClick:He=>{o||Ve(He)},children:[Ue.jsx(W4,{cls:x,item:t}),Ue.jsx("span",{className:x("menu-item__label"),ref:U,children:t.name}),Ue.jsx(z4,{tooltipPosition:at?"right":"top",menuLevel:n,hasChildren:r,isHovered:T,isFavorite:I,onClick:He=>{const lt={menuConfigId:t.id,isFavorite:He},ct=e.baseUrl+me;as.post(ct,lt).then(yt=>{var dt;L(He),Qm("Set favorite menu item successfully"),(dt=e.onSetFavoriteSuccess)==null||dt.call(e,e.item.id,He),Qy(e.item.id,He)}).catch(yt=>{var dt,Tt;Wd(((Tt=(dt=yt.response)==null?void 0:dt.data)==null?void 0:Tt.errorMessage)||"Have error when set favorite menu item")})}}),r&&Ue.jsx("div",{className:x("menu-item__icon-arrow__wrapper"),children:Ue.jsx(V5,{className:x(`menu-item__icon-arrow__icon ${e.params.isOpen?"open":"close"}`)})})]})}),Ge&&Ue.jsx(H5,{parentRef:R,onlyChild:!o,renderChildren:({maxHeight:He})=>{var lt;return Ue.jsx(lO.div,{className:x(`menu-item__dropdown ${e.params.isOpen?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${Ne}`),style:Zy({maxHeight:He,overflowY:"auto",paddingRight:3},He!=="auto"&&!!Ne),children:(lt=t.children)==null?void 0:lt.map(ct=>X.createElement(CO,{...e,key:ct.id,item:ct,level:Ne}))})}})]})}function W4({item:e,cls:t}){return Ue.jsx("div",{className:t("menu-item__icon"),children:Ue.jsx(vO,{item:e})})}function z4(e){const t={marginRight:e.hasChildren?10:0,fontSize:18,fill:Gr.warning};return Ue.jsxs(Ue.Fragment,{children:[e.isHovered&&!e.isFavorite&&Ue.jsx(ss.Tooltip,{placement:e.tooltipPosition||"top",title:"Add to favorites",disableInteractive:!0,children:Ue.jsx("div",{children:Ue.jsx(uO,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!0)}})})}),e.isFavorite&&Ue.jsx(ss.Tooltip,{placement:e.tooltipPosition||"top",title:"Remove from favorites",disableInteractive:!0,children:Ue.jsx("div",{children:Ue.jsx(cO,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!1)}})})})]})}function Y4(){return Ue.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",children:Ue.jsx("path",{d:"M21 18v2H3v-2h18zM6.596 3.903L8.01 5.318 4.828 8.5 8.01 11.68l-1.414 1.415L2 8.5l4.596-4.597zM21 11v2h-9v-2h9zm0-7v2h-9V4h9z"})})}function G4(){return Ue.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",fill:"currentColor",stroke:"currentColor",strokeWidth:"0",viewBox:"0 0 24 24",children:Ue.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function q4(e){return Ue.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...e,children:Ue.jsx("path",{fill:"#E01B00",fillRule:"evenodd",d:"M.179 2.875A2.375 2.375 0 012.554.5h3.393a1.018 1.018 0 010 2.036H2.554a.34.34 0 00-.34.339v14.25c0 .187.152.34.34.34h3.393a1.018 1.018 0 110 2.035H2.554a2.375 2.375 0 01-2.375-2.375V2.875zm14.167 6.107h-7.72a1.018 1.018 0 000 2.036h7.72l-2.673 2.673a1.018 1.018 0 101.44 1.44l4.41-4.411a1.018 1.018 0 000-1.44l-4.41-4.41a1.018 1.018 0 10-1.44 1.439l2.673 2.673z",clipRule:"evenodd"})})}const X4=`.flex-col-center{display:flex;flex-direction:column;justify-content:center}.wrap-section{padding:0 8px;transition:all .3s}.wrap-section.collapsed{padding:0 4px}.side-bar{position:fixed;top:64px;left:0;height:calc(100vh - 64px);max-width:18rem;display:flex;flex-direction:column;border-right:1px solid #ddd;background-color:#fafafa;transition:all .3s}.side-bar.expanded{width:17rem}.side-bar.collapsed{width:64px}.side-bar__wrap-btn-logout,.side-bar__btn-logout{margin:40px 0}.side-bar__logout-btn__text{margin-left:12px;font-size:.875rem;opacity:1}.side-bar__logout-btn__text.collapsed{opacity:0;transition:ease-in-out .2s;transition-delay:.15s}.side-bar__wrapper-toggle-btn{display:flex;flex-direction:row;justify-content:flex-end;transition:all .3s;margin-right:-8px;margin-top:40px}.side-bar__wrapper-toggle-btn.collapsed{justify-content:center;width:100%}.side-bar__toggle-btn{margin-top:-6px;color:#85858a}.side-bar__logout-btn{width:100%;text-align:left;display:flex;flex-direction:row;align-items:center;padding:8px 16px 8px 18.6665px;min-height:48px;border-radius:.375rem;overflow:hidden;transition:all .3s ease-in-out;background-color:initial}.side-bar__logout-btn:hover{background-color:#919eab14}.side-bar__icon-logout{flex-shrink:0}.menu-item__wrapper{display:flex;flex-direction:column;position:relative;width:100%}.menu-item__link{display:flex;flex-direction:row;border-radius:.375rem;align-items:center;padding:.5rem;position:relative;height:48px;cursor:pointer;color:#85858a}.menu-item__link.expanded.level-0{padding:.5rem 10px}.menu-item__link:hover{background-color:#919eab14}.menu-item__link.collapsed.level-0{padding-left:calc(.5rem + 7.665px)!important}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.menu-item__link.active.level-0,.menu-item__link.active.level-1,.menu-item__link.active.level-2,.menu-item__link.active.level-3,.menu-item__link.active.level-4,.menu-item__link.active.level-5,.menu-item__link.active.level-6,.menu-item__link.active.level-7,.menu-item__link.active.level-8,.menu-item__link.active.level-9{background-color:inherit;color:inherit}.menu-item__link.active.level-1:hover,.menu-item__link.active.level-2:hover,.menu-item__link.active.level-3:hover,.menu-item__link.active.level-4:hover,.menu-item__link.active.level-5:hover,.menu-item__link.active.level-6:hover,.menu-item__link.active.level-7:hover,.menu-item__link.active.level-8:hover,.menu-item__link.active.level-9:hover,.menu-item__link.active.level-0:hover{background-color:#919eab14}.menu-item__link.menu-item__link.collapsed.level-0{padding:0;transition:all .15s}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center}.menu-item__icon.collapsed.level-0>*{margin:0 auto}.menu-item__label{font-size:.875rem;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;width:100%;flex-shrink:1;margin-left:12px;padding-right:12px;color:#292929;opacity:1}.menu-item__label.level-0.collapsed{text-overflow:unset}.menu-item__label.active{color:inherit}.menu-item__label.collapsed{margin-left:8px;font-size:.75rem;line-height:1rem}.menu-item__label.collapsed.level-0{font-size:.875rem;opacity:0;transition-delay:.15s}.menu-item__label.level-0{margin-left:8px}.menu-item__label.level-0.isInternalApp{font-weight:unset!important}.menu-item__icon-arrow__wrapper{display:grid;place-items:center;position:absolute;top:50%;transform:translateY(-50%);right:0}.menu-item__icon-arrow__wrapper.expanded{right:4px}.menu-item__icon-arrow__icon{transition:all .3s!important;transform:rotate(-90deg)!important}.menu-item__icon-arrow__icon.active{color:inherit}.menu-item__icon-arrow__icon.expanded.open{transform:rotate(0)!important}.menu-item__dropdown.collapsed{background-color:#fafafa;border:1px solid #ddd;box-shadow:#0000001a 0 10px 15px -3px,#0000000d 0 4px 6px -2px;border-radius:4px;width:210px;max-width:210px;padding:4px;z-index:1200}.menu-item__dropdown::-webkit-scrollbar{width:4px}.menu-item__dropdown::-webkit-scrollbar-thumb{background-color:#9b9b9b99;border-radius:2px}.menu-item__dropdown,.menu-item__dropdown>*{margin-top:4px}.menu-item__dropdown.expanded.menu-item__dropdown--close{margin-top:0;transition:margin-top .3s}.menu-item__dropdown:first-of-type{margin-top:0}.menu-item__dropdown>*:first-child{margin-top:0}.menu-item__dropdown.collapsed .menu-item__link{height:40px}.menu-item__dropdown.collapsed .menu-item__link.level-0{height:48px}.menu-item__dropdown.collapsed.level-0{width:auto;max-width:unset;box-shadow:none;border:none;padding:0;background-color:unset}.menu-item__dropdown.expanded{overflow:hidden}.icon-btn{display:inline-flex;align-items:center;justify-content:center;padding:8px;border-radius:50%;background-color:transparent;transition:background-color .3s ease;border:none}.icon-btn:hover{background-color:var(--btn-bg-hover)}.simplebar-scrollbar:before{background-color:#0000002d}.side-bar__menu.collapsed .simplebar-track.simplebar-vertical{display:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}
143
143
  `,K4=e=>{const t=e.isCollapsed?0:e.depth*16;return Ue.jsx("div",{style:{backgroundColor:e.color||"#93D500",height:"2px",position:"absolute",right:"0",top:"0",left:t}})},Z4=`.app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}
144
144
  `,J4=e=>{const[t,n]=X.useState(()=>{const r=localStorage.getItem("openingMenuIds");return r&&r!=="[]"?JSON.parse(r):(e==null?void 0:e.initOpenIds)||[]});return X.useEffect(()=>{localStorage.setItem("openingMenuIds",JSON.stringify(t))},[t]),[t,n]};function EO(e){document.documentElement.style.setProperty("--global-menu-width",!e||e==="true"?"64px":"17rem")}const Jh=localStorage.getItem("isCollapsed");EO(Jh);function Q4(e){const t=new CustomEvent("favoriteMenusChange",{detail:{favoriteMenus:e}});window.dispatchEvent(t)}function e6(e){const t=_p.useLocation(),[n,r]=X.useState([]),i=n.map(ce=>ce.data),[o,s]=X.useState(!1),[l,c]=X.useState(Jh===null?!0:Jh==="true"),[d,v]=X.useState(window.location.href),p=X.useRef(null);X.useEffect(()=>{var ce;(ce=e.handleCallback)==null||ce.call(e,i)},[i,e.handleCallback]),X.useEffect(()=>{v(window.location.href)},[t]);const x=n6(i,d),[T,_]=J4({initOpenIds:e.initOpenIds}),I=()=>{var ce,ae;if(c(!l),localStorage.setItem("isCollapsed",JSON.stringify(!l)),EO(l),l)T&&((ce=p.current)==null||ce.open(T));else{const Ne=n.filter(Ge=>Ge.parent===0).map(Ge=>Ge.id);console.log("closeIds:",Ne),(ae=p.current)==null||ae.close(Ne)}},[L,R]=X.useState(!1),U=l?"collapsed":"expanded",W=ce=>`${ce} ${U}`,te=X.useRef(null);X.useLayoutEffect(()=>{(async()=>{var ae,Ne;try{const Ge=e.menuPath||"/global-menu-config/api/v1/menu-items/user",qe=e.baseUrl+Ge,{data:it}=await as.get(qe);let nt=it.map(Se=>({...Se,parentKey:Se.parentKey||0}));nt=OO(nt),e.replacePath&&(nt=kO(nt,e.replacePath));const me=nt.map(Se=>({id:Se.id,parent:Se.parentKey,text:Se.name,data:Se}));r(me)}catch(Ge){console.error("Global menu",Ge),Wd(((Ne=(ae=Ge.response)==null?void 0:ae.data)==null?void 0:Ne.errorMessage)||"Have error when get menu items")}})()},[e.baseUrl,e.menuPath,e.replacePath]),X.useEffect(()=>{const ce=i.filter(Ge=>Ge.isFavorite);function ae(Ge){return i.every(qe=>qe.parentKey!==Ge.id)?Ge:{...Ge,children:i.filter(qe=>qe.parentKey===Ge.id).map(qe=>ae(qe))}}const Ne=ce.map(Ge=>ae(Ge));Q4(Ne)},[i]);function J(ce){const ae=ce.detail.menuItem;r(Ne=>Ne.map(Ge=>Ge.id!==ae.id?Ge:{...Ge,data:ae}))}X.useEffect(()=>(window.addEventListener("updateFavoriteMenu",J),()=>{window.removeEventListener("updateFavoriteMenu",J)}),[]),X.useLayoutEffect(()=>{var Ge;const ce=localStorage.getItem("scrollPos");ce&&te.current&&setTimeout(()=>{const qe=te.current.getScrollElement();qe.scrollTop=parseInt(ce)},0);const ae=()=>{if(te.current){const qe=te.current.getScrollElement();localStorage.setItem("scrollPos",qe.scrollTop.toString())}},Ne=(Ge=te.current)==null?void 0:Ge.getScrollElement();return Ne==null||Ne.addEventListener("scroll",ae),()=>{Ne==null||Ne.removeEventListener("scroll",ae)}},[i]);function pe(ce){s(!0);const ae=[...n];r(ce);const Ne=ce.map((Ge,qe)=>({menuItemId:Ge.id,order:qe}));as.post("/global-menu-config/api/v1/menu-items/user",Ne,{baseURL:e.baseUrl}).then(()=>{}).catch(Ge=>{console.error(Ge),r(ae)}).finally(()=>{s(!1)})}const S=X.useMemo(()=>Jh==="false"?T:[],[]);return Ue.jsxs("div",{className:W("side-bar"),children:[Ue.jsx("div",{className:W("wrap-section side-bar__wrapper-toggle-btn"),children:Ue.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:I,children:l?Ue.jsx(G4,{}):Ue.jsx(Y4,{})})}),Ue.jsx(xT,{ref:te,className:W("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:Ue.jsx(t3,{backend:H3,options:cH(),children:Ue.jsx(PH,{ref:p,classes:{root:"treeRoot",draggingSource:"draggingSource",placeholder:"placeholderContainer"},tree:n,rootId:0,sort:!1,insertDroppableFirst:!1,enableAnimateExpand:!0,dropTargetOffset:10,onDrop:pe,render:(ce,ae)=>{function Ne(nt){return n.every(me=>me.parent!==nt.id)?nt:{...nt,children:n.filter(me=>me.parent===nt.id).map(me=>Ne(me.data))}}const Ge=Ne(ce.data),qe=nt=>x.some(me=>me.id===nt);function it(nt,me){r(Se=>Se.map(Ve=>Ve.id===nt?{...Ve,data:{...Ve.data,isFavorite:me}}:Ve))}return Ue.jsx(CO,{isInternalApp:e.isInternalApp,isActive:qe,isCollapsed:l,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,node:ce,params:ae,nodes:n,item:Ge,expanded:()=>!1,toggleExpand:()=>{},level:ae.depth,onSetFavoriteSuccess:it})},placeholderRender:(ce,{depth:ae})=>{var Ne;return Ue.jsx(K4,{node:ce,depth:ae,color:(Ne=e.brandColors)==null?void 0:Ne.primary300,isCollapsed:l})},canDrag:()=>!o,canDrop:(ce,{dragSource:ae,dropTargetId:Ne})=>(ae==null?void 0:ae.parent)===Ne,onDragStart:ce=>{console.log("onDragStart",ce)},onChangeOpen:ce=>{localStorage.getItem("isCollapsed")==="false"&&(console.log("onChangeOpen:",ce),_(ce))},initialOpen:S})})}),Ue.jsxs("div",{className:W("wrap-section side-bar__wrap-btn-logout"),children:[Ue.jsxs("button",{className:W("side-bar__logout-btn"),onClick:()=>R(!0),children:[Ue.jsx(q4,{className:W("side-bar__icon-logout")}),Ue.jsx("span",{className:W("side-bar__logout-btn__text"),children:"Logout"})]}),Ue.jsx(D1,{isOpen:L,onClose:()=>R(!1),onConfirm:()=>e.logout?e.logout():B1(e.baseUrl)})]})]})}function t6(e,t){const n=new URL(e,window.location.origin),r=new URL(t,window.location.origin);return n.pathname===r.pathname&&n.search===r.search?3:n.pathname===r.pathname?2:r.pathname.startsWith(n.pathname)?1:0}function n6(e,t){const n=e.map(s=>({item:s,priority:s.path?t6(s.path,t):0})).filter(s=>s.priority>0),r=n.length>0?n.reduce((s,l)=>l.priority>s.priority?l:s).item:null,i=[];let o=r;for(;o;)i.unshift(o),o=e.find(s=>s.id===(o==null?void 0:o.parentKey))||null;return i}function kO(e,t){return e.map(n=>{var r;return(r=n.children)!=null&&r.length?(n.path="",n.children=kO(n.children,t)):n.path=t(n.path),n})}function OO(e){return e.map(n=>n.path&&!n.path.includes("http")&&n.path.includes("/")?{...n,path:window.location.origin+n.path}:(n.children&&(n.children=OO(n.children)),n))}function r6(e){return Ue.jsx(TO.div,{children:Ue.jsx(Xm,{styles:[ST,X4,Z4],style:{position:"sticky",zIndex:1300},children:Ue.jsx(e6,{...e})})})}const i6={"page-container":"_page-container_1pwo1_1","page-main-content":"_page-main-content_1pwo1_8","page-title":"_page-title_1pwo1_19","text-base":"_text-base_1pwo1_26","mt-4":"_mt-4_1pwo1_33"};var Ep={exports:{}};/**
@@ -28931,7 +28931,7 @@ function W4() {
28931
28931
  }
28932
28932
  var OO = W4();
28933
28933
  const z4 = `.app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}
28934
- `, Y4 = `.favorite-bar{position:sticky;top:64px;z-index:900;transition:transform .3s ease,opacity .3s ease;border-bottom:1px solid #ddd}.favorite-bar--hidden{transform:translateY(-100%);opacity:0}.favorite-bar--visible{transform:translateY(0);opacity:1}
28934
+ `, Y4 = `.favorite-bar{z-index:900;transition:transform .3s ease,opacity .3s ease;border-bottom:1px solid #ddd}.favorite-bar--hidden{transform:translateY(-100%);opacity:0}.favorite-bar--visible{transform:translateY(0);opacity:1}
28935
28935
  `;
28936
28936
  function G4(e) {
28937
28937
  const t = new CustomEvent("updateFavoriteMenu", {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.esm2017-3734a51e.cjs"),m=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");const l=require("react-router-dom");require("@mui/material");const c=r=>{const[t,n]=u.useState([]);return u.useEffect(()=>{m.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(s=>n(s.data)).catch(s=>{console.error("Getting user permission error:",s)})},[r]),t},a=r=>(t,n)=>{const s=c(r);return n?t.every(o=>s==null?void 0:s.includes(o)):t.some(o=>s==null?void 0:s.includes(o))},h=({baseUrl:r,accessWith:t,requireAll:n,children:s})=>a(r)(t,n)?i.jsx(i.Fragment,{children:s}):null,P=({accessWith:r,requireAll:t,baseUrl:n,unAuthorizedPath:s,children:o})=>a(n)(r,t)?i.jsx(i.Fragment,{children:o}):i.jsx(l.Navigate,{to:s,replace:!0});exports.AuthContext=e.AuthContext;exports.AuthProvider=e.AuthProvider;exports.ERROR_MESSAGE=e.ERROR_MESSAGE;exports.SaasThemeProvider=e.SaasThemeProvider;exports.TranslationProvider=e.TranslationProvider;exports.axiosInstance=e.axiosInstance;exports.color=e.color;exports.createCustomTheme=e.createCustomTheme;exports.handleErrorAxios=e.handleErrorAxios;exports.login=e.login;exports.logout=e.logout;exports.responseInterceptor=e.responseInterceptor;exports.search=e.search;exports.setFavicon=e.setFavicon;exports.translate=e.translate;exports.translationConfig=e.translationConfig;exports.useAuth=e.useAuth;exports.useCustomTranslation=e.useCustomTranslation;exports.useTheme=e.useTheme;exports.useTranslation=e.useTranslation$1;exports.HasPermission=h;exports.PermissionRoute=P;exports.getUseHasPermission=a;exports.useGetPermission=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.esm2017-47cea4e3.cjs"),m=require("axios"),u=require("react"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");const l=require("react-router-dom");require("@mui/material");const c=r=>{const[t,n]=u.useState([]);return u.useEffect(()=>{m.get(`${r}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(s=>n(s.data)).catch(s=>{console.error("Getting user permission error:",s)})},[r]),t},a=r=>(t,n)=>{const s=c(r);return n?t.every(o=>s==null?void 0:s.includes(o)):t.some(o=>s==null?void 0:s.includes(o))},h=({baseUrl:r,accessWith:t,requireAll:n,children:s})=>a(r)(t,n)?i.jsx(i.Fragment,{children:s}):null,P=({accessWith:r,requireAll:t,baseUrl:n,unAuthorizedPath:s,children:o})=>a(n)(r,t)?i.jsx(i.Fragment,{children:o}):i.jsx(l.Navigate,{to:s,replace:!0});exports.AuthContext=e.AuthContext;exports.AuthProvider=e.AuthProvider;exports.ERROR_MESSAGE=e.ERROR_MESSAGE;exports.SaasThemeProvider=e.SaasThemeProvider;exports.TranslationProvider=e.TranslationProvider;exports.axiosInstance=e.axiosInstance;exports.color=e.color;exports.createCustomTheme=e.createCustomTheme;exports.handleErrorAxios=e.handleErrorAxios;exports.login=e.login;exports.logout=e.logout;exports.responseInterceptor=e.responseInterceptor;exports.search=e.search;exports.setFavicon=e.setFavicon;exports.translate=e.translate;exports.translationConfig=e.translationConfig;exports.useAuth=e.useAuth;exports.useCustomTranslation=e.useCustomTranslation;exports.useTheme=e.useTheme;exports.useTranslation=e.useTranslation$1;exports.HasPermission=h;exports.PermissionRoute=P;exports.getUseHasPermission=a;exports.useGetPermission=c;
@@ -1,4 +1,4 @@
1
- import { M as R, N as S, O as G, a0 as y, Y as F, a as H, c as I, Z as M, U as N, R as O, T as $, V as j, v as w, $ as U, t as V, W as X, b as Y, u as Z, g as _, X as b } from "../index.esm2017-9e03f5b5.js";
1
+ import { M as R, N as S, O as G, a0 as y, Y as F, a as H, c as I, Z as M, U as N, R as O, T as $, V as j, v as w, $ as U, t as V, W as X, b as Y, u as Z, g as _, X as b } from "../index.esm2017-7c760d4b.js";
2
2
  import u from "axios";
3
3
  import { useState as m, useEffect as c } from "react";
4
4
  import { jsx as a, Fragment as n } from "react/jsx-runtime";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.11.7",
4
+ "version": "0.11.8-sandbox.saas-7771",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-d5889290.js";
2
- import { F as s, u } from "../index-f530ed06.js";
2
+ import { F as s, u } from "../index-65c948b6.js";
3
3
  import "../index-51ba1ee1.js";
4
4
  import "../index-c91ec106.js";
5
5
  import "../react-toastify.esm-d8df41b8.js";
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-d5889290.js";
2
- import { G as l } from "../index-f530ed06.js";
2
+ import { G as l } from "../index-65c948b6.js";
3
3
  import "../index-51ba1ee1.js";
4
4
  import "../index-c91ec106.js";
5
5
  import "../react-toastify.esm-d8df41b8.js";
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-d5889290.js";
2
- import { L as g, T as n } from "../index-f530ed06.js";
2
+ import { L as g, T as n } from "../index-65c948b6.js";
3
3
  import "../index-51ba1ee1.js";
4
4
  import "../index-c91ec106.js";
5
5
  import "../react-toastify.esm-d8df41b8.js";
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-d5889290.js";
2
- import { H as a, g as H } from "../index-f530ed06.js";
2
+ import { H as a, g as H } from "../index-65c948b6.js";
3
3
  import "../index-c91ec106.js";
4
4
  import "../react-toastify.esm-d8df41b8.js";
5
5
  import "../index-51ba1ee1.js";