@ukpc-lib/react 0.10.29-dev.0 → 0.10.29-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.cjs +19 -19
- package/dist/components/index.js +111 -94
- package/dist/{index.esm2017-f3d75692.cjs → index.esm2017-7b80133e.cjs} +1 -1
- package/dist/{index.esm2017-3eee8145.js → index.esm2017-fb7717a2.js} +1 -1
- package/dist/share/index.cjs +1 -1
- package/dist/share/index.js +1 -1
- package/package.json +1 -1
- package/web-components-bundle/favorite-menu/index.js +1 -1
- package/web-components-bundle/global-menu/index.js +1 -1
- package/web-components-bundle/global-topbar/index.js +1 -1
- package/web-components-bundle/has-permission/index.js +1 -1
- package/web-components-bundle/{index-5ff41ddb.js → index-ec9d43e3.js} +9636 -9622
|
@@ -139,7 +139,7 @@ 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=ni(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,oi=!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 dt:{Wo(w,"SuspenseList"),zr(g,w,$.children),Ai(w);return}case kt:throw new Error("ReactDOMServer does not yet support scope components.");case ft:{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 Ve:{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&&(oi||i("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),oi=!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 me:{var $=A,K=$.type,se=$.props,ye=$.ref;Rs(g,w,K,se,ye);return}case De: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 pt=w.blockedSegment;pt.lastPushedText=Yi(w.blockedSegment.chunks,""+A,g.responseState,pt.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),ct(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),Ct(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),ti(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 vO(e,t){return e(t={exports:{}},t.exports),t.exports}var _4=vO(function(e){(function(t){var n=function(L,I,U){if(!c(I)||v(I)||p(I)||x(I)||l(I))return I;var W,te=0,J=0;if(d(I))for(W=[],J=I.length;te<J;te++)W.push(n(L,I[te],U));else for(var ge in W={},I)Object.prototype.hasOwnProperty.call(I,ge)&&(W[L(ge,U)]=n(L,I[ge],U));return W},r=function(L){return T(L)?L:(L=L.replace(/[\-_\s]+(.)?/g,function(I,U){return U?U.toUpperCase():""})).substr(0,1).toLowerCase()+L.substr(1)},i=function(L){var I=r(L);return I.substr(0,1).toUpperCase()+I.substr(1)},o=function(L,I){return function(U,W){var te=(W=W||{}).separator||"_",J=W.split||/(?=[A-Z])/;return U.split(J).join(te)}(L,I).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,I){var U=I&&"process"in I?I.process:I;return typeof U!="function"?L:function(W,te){return U(W,L,te)}},R={camelize:r,decamelize:o,pascalize:i,depascalize:o,camelizeKeys:function(L,I){return n(_(r,I),L)},decamelizeKeys:function(L,I){return n(_(o,I),L,I)},pascalizeKeys:function(L,I){return n(_(i,I),L)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};e.exports?e.exports=R:t.humps=R})(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}},l1=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 l1(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)?l1(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()},mO=vO(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},yO=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 bO(e){var t=e.children,n=t===void 0?"":t,r=yO(e,["children"]);return typeof n!="string"&&(n=k4(n)),X.createElement("template",mO({},r,{dangerouslySetInnerHTML:{__html:n}}))}function wO(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,R=yO(n,["mode","delegatesFocus","styleSheets","ssr","children"]),L=(o=X.useRef((i=r)&&i.current),X.useEffect(function(){i&&(i.current=o.current)},[i]),o),I=X.useState(null),U=A4(I,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 ge=L.current.shadowRoot;return void te(ge)}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,Ye=ae.styleSheets,Ge=ae.root;switch(Ne.name){case"NotSupportedError":Ye.length>0&&(Ge.adoptedStyleSheets=Ye);break;default:throw Ne}})({error:ce,styleSheets:p,root:W})}},[r,L,p]),X.createElement(X.Fragment,null,X.createElement(e.tag,mO({key:J,ref:L},R),(W||T)&&X.createElement(L4.Provider,{value:W},T?X.createElement(bO,{shadowroot:l,shadowrootmode:l},e.render({root:W,ssr:T,children:_})):X.createElement(wO,{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}bO.propTypes={children:Oa.oneOfType([Oa.string,Oa.node])},wO.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 xO=N4();const j4=`.app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}
|
|
141
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}
|
|
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 R=l(_.children,T);if(R)return R}}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(R=>R.id===T.parentKey))+1}const p=(x,T,_)=>{const R=L=>_.some(I=>I.id===L);return We.jsx(gO,{isActive:R,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,item:x,level:T,onSetFavoriteSuccess:c})};return We.jsx(We.Fragment,{children:n.length?We.jsx("div",{className:s("favorite-menu"),children:We.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=>We.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 We.jsxs(We.Fragment,{children:[We.jsx("style",{children:B4}),We.jsx("div",{className:`favorite-bar ${t?"favorite-bar--visible":"favorite-bar--hidden"}`,children:We.jsx(xO.div,{children:We.jsx(Xm,{styles:[wT,x4,j4],children:We.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 SO({...e}){var He,Qe,at,Ee,Pe;const t=e.item,n=e.level||0,r=!!((He=e.item.children)!=null&&He.length),{isActive:i,isCollapsed:o}=e,s=`level-${n}`,l=o?"collapsed":"expanded",c=i(t.id)?"active":"",d=(Be,Ue=s)=>`${Be} ${Ue} ${l} ${c}`,[v,p]=X.useState(!1),[x,T]=X.useState(t.isFavorite||!1);X.useEffect(()=>{T(!!e.item.isFavorite)},[e.item.isFavorite]);const _=X.useRef(),R=X.useRef();R!=null&&R.current&&((Qe=R==null?void 0:R.current)==null?void 0:Qe.scrollWidth)>((at=R==null?void 0:R.current)==null?void 0:at.clientWidth);const L=window.location.origin,I=t.path&&t.path.includes("http")?new URL(t.path):{origin:"",pathname:""},U=window.location.pathname.split("/")[1],W=I.pathname.split("/")[1],te=e.ssr||!L.includes("local")&&L!==I.origin||W!==U,J=r||n===0?"div":te?"a":_p.Link,ge=t.path||"#",S=n+1,ce=r&&o&&v,ae=o||n===0?void 0:`${n+.25}rem`,Ne=()=>{p(!0)},Ye=()=>{p(!1)},Ge="/global-menu-config/api/v1/menu-items/user/set-favorite",it=t.serviceKey==="mn_poms";e.params.depth*20,e.params.depth,yH(t.id,e.params.isOpen,e.params.onToggle);const nt=Be=>{Be.stopPropagation(),e.params.onToggle()},Ce=it||o&&n===0?t.name==="POMs"?"Parking Operations Management":t.description||t.name:null;return We.jsxs("div",{ref:_,className:d("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s"},onMouseOver:Ne,onMouseOut:Ye,onDragStart:Be=>{o&&n>1&&Be.preventDefault()},children:[We.jsx(ss.Tooltip,{placement:"top",title:Ce,disableInteractive:!0,children:We.jsxs(J,{to:ge,href:ge,draggable:"true",className:d("menu-item__link"),style:{paddingLeft:ae,transition:"all 0.3s",color:i(t.id)?((Ee=e.brandColors)==null?void 0:Ee.primary400)||si.primary400:void 0,backgroundColor:i(t.id)&&n===0?(Pe=e.brandColors)==null?void 0:Pe.primary200:void 0},onClick:Be=>{o||nt(Be)},children:[We.jsx(W4,{cls:d,item:t}),We.jsx("span",{className:d("menu-item__label"),ref:R,children:t.name}),We.jsx(z4,{tooltipPosition:Ce?"right":"top",menuLevel:n,hasChildren:r,isHovered:v,isFavorite:x,onClick:Be=>{const Ue={menuConfigId:t.id,isFavorite:Be},Re=e.baseUrl+Ge;as.post(Re,Ue).then(Fe=>{var qe;T(Be),Qm("Set favorite menu item successfully"),(qe=e.onSetFavoriteSuccess)==null||qe.call(e,e.item.id,Be),Qy(e.item.id,Be)}).catch(Fe=>{var qe,lt;Wd(((lt=(qe=Fe.response)==null?void 0:qe.data)==null?void 0:lt.errorMessage)||"Have error when set favorite menu item")})}}),r&&We.jsx("div",{className:d("menu-item__icon-arrow__wrapper"),children:We.jsx(V5,{className:d(`menu-item__icon-arrow__icon ${e.params.isOpen?"open":"close"}`)})})]})}),ce&&We.jsx(H5,{parentRef:_,onlyChild:!o,renderChildren:({maxHeight:Be})=>{var Ue;return We.jsx(aO.div,{className:d(`menu-item__dropdown ${e.params.isOpen?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${S}`),style:Zy({maxHeight:Be,overflowY:"auto",paddingRight:3},Be!=="auto"&&!!S),children:(Ue=t.children)==null?void 0:Ue.map(Re=>X.createElement(SO,{...e,key:Re.id,item:Re,level:S}))})}})]})}function W4({item:e,cls:t}){return We.jsx("div",{className:t("menu-item__icon"),children:We.jsx(pO,{item:e})})}function z4(e){const t={marginRight:e.hasChildren?10:0,fontSize:18,fill:si.warning};return We.jsxs(We.Fragment,{children:[e.isHovered&&!e.isFavorite&&We.jsx(ss.Tooltip,{placement:e.tooltipPosition||"top",title:"Add to favorites",disableInteractive:!0,children:We.jsx("div",{children:We.jsx(sO,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!0)}})})}),e.isFavorite&&We.jsx(ss.Tooltip,{placement:e.tooltipPosition||"top",title:"Remove from favorites",disableInteractive:!0,children:We.jsx("div",{children:We.jsx(lO,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!1)}})})})]})}function Y4(){return We.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:We.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 We.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:We.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function q4(e){return We.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...e,children:We.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__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}}
|
|
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 R=l(_.children,T);if(R)return R}}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(R=>R.id===T.parentKey))+1}const p=(x,T,_)=>{const R=L=>_.some(I=>I.id===L);return We.jsx(gO,{isActive:R,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,item:x,level:T,onSetFavoriteSuccess:c})};return We.jsx(We.Fragment,{children:n.length?We.jsx("div",{className:s("favorite-menu"),children:We.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=>We.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 We.jsxs(We.Fragment,{children:[We.jsx("style",{children:B4}),We.jsx("div",{className:`favorite-bar ${t?"favorite-bar--visible":"favorite-bar--hidden"}`,children:We.jsx(xO.div,{children:We.jsx(Xm,{styles:[wT,x4,j4],children:We.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 SO({...e}){var He,Qe,at,Ee,Pe;const t=e.item,n=e.level||0,r=!!((He=e.item.children)!=null&&He.length),{isActive:i,isCollapsed:o}=e,s=`level-${n}`,l=o?"collapsed":"expanded",c=i(t.id)?"active":"",d=(Be,Ue=s)=>`${Be} ${Ue} ${l} ${c}`,[v,p]=X.useState(!1),[x,T]=X.useState(t.isFavorite||!1);X.useEffect(()=>{T(!!e.item.isFavorite)},[e.item.isFavorite]);const _=X.useRef(),R=X.useRef();R!=null&&R.current&&((Qe=R==null?void 0:R.current)==null?void 0:Qe.scrollWidth)>((at=R==null?void 0:R.current)==null?void 0:at.clientWidth);const L=window.location.origin,I=t.path&&t.path.includes("http")?new URL(t.path):{origin:"",pathname:""},U=window.location.pathname.split("/")[1],W=I.pathname.split("/")[1],te=e.ssr||!L.includes("local")&&L!==I.origin||W!==U,J=r||n===0?"div":te?"a":_p.Link,ge=t.path||"#",S=n+1,ce=r&&o&&v,ae=o||n===0?void 0:`${n+.25}rem`,Ne=()=>{p(!0)},Ye=()=>{p(!1)},Ge="/global-menu-config/api/v1/menu-items/user/set-favorite",it=t.serviceKey==="mn_poms";e.params.depth*20,e.params.depth,yH(t.id,e.params.isOpen,e.params.onToggle);const nt=Be=>{Be.stopPropagation(),e.params.onToggle()},Ce=it||o&&n===0?t.name==="POMs"?"Parking Operations Management":t.description||t.name:null;return We.jsxs("div",{ref:_,className:d("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s"},onMouseOver:Ne,onMouseOut:Ye,onDragStart:Be=>{o&&n>1&&Be.preventDefault()},children:[We.jsx(ss.Tooltip,{placement:"top",title:Ce,disableInteractive:!0,children:We.jsxs(J,{to:ge,href:ge,draggable:"true",className:d("menu-item__link"),style:{paddingLeft:ae,transition:"all 0.3s",color:i(t.id)?((Ee=e.brandColors)==null?void 0:Ee.primary400)||si.primary400:void 0,backgroundColor:i(t.id)&&n===0?(Pe=e.brandColors)==null?void 0:Pe.primary200:void 0},onClick:Be=>{o||nt(Be)},children:[We.jsx(W4,{cls:d,item:t}),We.jsx("span",{className:d("menu-item__label"),ref:R,children:t.name}),We.jsx(z4,{tooltipPosition:Ce?"right":"top",menuLevel:n,hasChildren:r,isHovered:v,isFavorite:x,onClick:Be=>{const Ue={menuConfigId:t.id,isFavorite:Be},Re=e.baseUrl+Ge;as.post(Re,Ue).then(Fe=>{var qe;T(Be),Qm("Set favorite menu item successfully"),(qe=e.onSetFavoriteSuccess)==null||qe.call(e,e.item.id,Be),Qy(e.item.id,Be)}).catch(Fe=>{var qe,lt;Wd(((lt=(qe=Fe.response)==null?void 0:qe.data)==null?void 0:lt.errorMessage)||"Have error when set favorite menu item")})}}),r&&We.jsx("div",{className:d("menu-item__icon-arrow__wrapper"),children:We.jsx(V5,{className:d(`menu-item__icon-arrow__icon ${e.params.isOpen?"open":"close"}`)})})]})}),ce&&We.jsx(H5,{parentRef:_,onlyChild:!o,renderChildren:({maxHeight:Be})=>{var Ue;return We.jsx(aO.div,{className:d(`menu-item__dropdown ${e.params.isOpen?"menu-item__dropdown--open":"menu-item__dropdown--close"}`,`level-${S}`),style:Zy({maxHeight:Be,overflowY:"auto",paddingRight:3},Be!=="auto"&&!!S),children:(Ue=t.children)==null?void 0:Ue.map(Re=>X.createElement(SO,{...e,key:Re.id,item:Re,level:S}))})}})]})}function W4({item:e,cls:t}){return We.jsx("div",{className:t("menu-item__icon"),children:We.jsx(pO,{item:e})})}function z4(e){const t={marginRight:e.hasChildren?10:0,fontSize:18,fill:si.warning};return We.jsxs(We.Fragment,{children:[e.isHovered&&!e.isFavorite&&We.jsx(ss.Tooltip,{placement:e.tooltipPosition||"top",title:"Add to favorites",disableInteractive:!0,children:We.jsx("div",{children:We.jsx(sO,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!0)}})})}),e.isFavorite&&We.jsx(ss.Tooltip,{placement:e.tooltipPosition||"top",title:"Remove from favorites",disableInteractive:!0,children:We.jsx("div",{children:We.jsx(lO,{style:t,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=e.onClick)==null||r.call(e,!1)}})})})]})}function Y4(){return We.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:We.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 We.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:We.jsx("path",{d:"M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z"})})}function q4(e){return We.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"20",fill:"none",viewBox:"0 0 18 20",...e,children:We.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:5px 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;font-weight:500;font-size:.951rem}.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 We.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 TO(e){document.documentElement.style.setProperty("--global-menu-width",!e||e==="true"?"64px":"17rem")}const Jh=localStorage.getItem("isCollapsed");TO(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}),R=()=>{var ce,ae;if(c(!l),localStorage.setItem("isCollapsed",JSON.stringify(!l)),TO(l),l)T&&((ce=p.current)==null||ce.open(T));else{const Ne=n.filter(Ye=>Ye.parent===0).map(Ye=>Ye.id);console.log("closeIds:",Ne),(ae=p.current)==null||ae.close(Ne)}},[L,I]=X.useState(!1),U=l?"collapsed":"expanded",W=ce=>`${ce} ${U}`,te=X.useRef(null);X.useLayoutEffect(()=>{(async()=>{var ae,Ne;try{const Ye=e.menuPath||"/global-menu-config/api/v1/menu-items/user",Ge=e.baseUrl+Ye,{data:it}=await as.get(Ge);let nt=it.map(Ce=>({...Ce,parentKey:Ce.parentKey||0}));nt=EO(nt),e.replacePath&&(nt=CO(nt,e.replacePath));const pe=nt.map(Ce=>({id:Ce.id,parent:Ce.parentKey,text:Ce.name,data:Ce}));r(pe)}catch(Ye){console.error("Global menu",Ye),Wd(((Ne=(ae=Ye.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(Ye=>Ye.isFavorite);function ae(Ye){return i.every(Ge=>Ge.parentKey!==Ye.id)?Ye:{...Ye,children:i.filter(Ge=>Ge.parentKey===Ye.id).map(Ge=>ae(Ge))}}const Ne=ce.map(Ye=>ae(Ye));Q4(Ne)},[i]);function J(ce){const ae=ce.detail.menuItem;r(Ne=>Ne.map(Ye=>Ye.id!==ae.id?Ye:{...Ye,data:ae}))}X.useEffect(()=>(window.addEventListener("updateFavoriteMenu",J),()=>{window.removeEventListener("updateFavoriteMenu",J)}),[]),X.useLayoutEffect(()=>{var Ye;const ce=localStorage.getItem("scrollPos");ce&&te.current&&setTimeout(()=>{const Ge=te.current.getScrollElement();Ge.scrollTop=parseInt(ce)},0);const ae=()=>{if(te.current){const Ge=te.current.getScrollElement();localStorage.setItem("scrollPos",Ge.scrollTop.toString())}},Ne=(Ye=te.current)==null?void 0:Ye.getScrollElement();return Ne==null||Ne.addEventListener("scroll",ae),()=>{Ne==null||Ne.removeEventListener("scroll",ae)}},[i]);function ge(ce){s(!0);const ae=[...n];r(ce);const Ne=ce.map((Ye,Ge)=>({menuItemId:Ye.id,order:Ge}));as.post("/global-menu-config/api/v1/menu-items/user",Ne,{baseURL:e.baseUrl}).then(()=>{}).catch(Ye=>{console.error(Ye),r(ae)}).finally(()=>{s(!1)})}const S=X.useMemo(()=>Jh==="false"?T:[],[]);return We.jsxs("div",{className:W("side-bar"),children:[We.jsx("div",{className:W("wrap-section side-bar__wrapper-toggle-btn"),children:We.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:R,children:l?We.jsx(G4,{}):We.jsx(Y4,{})})}),We.jsx(bT,{ref:te,className:W("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:We.jsx(t3,{backend:H3,options:cH(),children:We.jsx(PH,{ref:p,classes:{root:"treeRoot",draggingSource:"draggingSource",placeholder:"placeholderContainer"},tree:n,rootId:0,sort:!1,insertDroppableFirst:!1,enableAnimateExpand:!0,dropTargetOffset:10,onDrop:ge,render:(ce,ae)=>{function Ne(nt){return n.every(pe=>pe.parent!==nt.id)?nt:{...nt,children:n.filter(pe=>pe.parent===nt.id).map(pe=>Ne(pe.data))}}const Ye=Ne(ce.data),Ge=nt=>x.some(pe=>pe.id===nt);function it(nt,pe){r(Ce=>Ce.map(He=>He.id===nt?{...He,data:{...He.data,isFavorite:pe}}:He))}return We.jsx(SO,{isActive:Ge,isCollapsed:l,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,node:ce,params:ae,nodes:n,item:Ye,expanded:()=>!1,toggleExpand:()=>{},level:ae.depth,onSetFavoriteSuccess:it})},placeholderRender:(ce,{depth:ae})=>{var Ne;return We.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})})}),We.jsxs("div",{className:W("wrap-section side-bar__wrap-btn-logout"),children:[We.jsxs("button",{className:W("side-bar__logout-btn"),onClick:()=>I(!0),children:[We.jsx(q4,{className:W("side-bar__icon-logout")}),We.jsx("span",{className:W("side-bar__logout-btn__text"),children:"Logout"})]}),We.jsx(_1,{isOpen:L,onClose:()=>I(!1),onConfirm:()=>e.logout?e.logout():j1(e.baseUrl)})]})]})}function t6(e,t){const n=new URL(e).searchParams,r=new URL(t).searchParams;return Array.from(r).filter(([i,o])=>o===n.get(i)).length}function n6(e,t){var c;console.log("menuItems:",e);const n=new URL(t);let r=e.filter(d=>d.path&&d.path.includes("http")).map(d=>({item:d,itemUrl:new URL(d.path),matchingParamsCount:t6(t,d.path)})).sort((d,v)=>{const p=new URL(d.itemUrl).searchParams,x=new URL(v.itemUrl).searchParams;return Array.from(p).length-Array.from(x).length}).filter(({itemUrl:d})=>n.origin===d.origin);const i=r.filter(({itemUrl:d})=>n.pathname===d.pathname),o=r.filter(({itemUrl:d})=>n.pathname.includes(d.pathname));r=i.length>0?i:o,r=r.sort((d,v)=>v.matchingParamsCount-d.matchingParamsCount);let s=r.length>0?(c=r.find(d=>d.item.parentKey))==null?void 0:c.item:null;console.log("matchingItems:",r);let l=[];for(;s;)l=[s,...l],s=e.find(d=>d.id===(s==null?void 0:s.parentKey))||null;return console.log("parents:",l),l}function CO(e,t){return e.map(n=>{var r;return(r=n.children)!=null&&r.length?(n.path="",n.children=CO(n.children,t)):n.path=t(n.path),n})}function EO(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=EO(n.children)),n))}function r6(e){return We.jsx(xO.div,{children:We.jsx(Xm,{styles:[wT,X4,Z4],style:{position:"sticky",zIndex:1300},children:We.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:{}};/**
|
|
145
145
|
* @license
|
|
@@ -29259,7 +29259,7 @@ function e6(e) {
|
|
|
29259
29259
|
}
|
|
29260
29260
|
);
|
|
29261
29261
|
}
|
|
29262
|
-
const t6 = `.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:
|
|
29262
|
+
const t6 = `.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:5px 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;font-weight:500;font-size:.951rem}.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}}
|
|
29263
29263
|
`, n6 = (e) => {
|
|
29264
29264
|
const t = e.isCollapsed ? 0 : e.depth * 16;
|
|
29265
29265
|
return /* @__PURE__ */ Qe(
|
package/dist/share/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.esm2017-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.esm2017-7b80133e.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;
|
package/dist/share/index.js
CHANGED
|
@@ -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-
|
|
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-fb7717a2.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,5 +1,5 @@
|
|
|
1
1
|
import "../react-to-web-component-d5889290.js";
|
|
2
|
-
import { F as a, u as s } from "../index-
|
|
2
|
+
import { F as a, u as s } from "../index-ec9d43e3.js";
|
|
3
3
|
import "../index-c91ec106.js";
|
|
4
4
|
import "../react-toastify.esm-d8df41b8.js";
|
|
5
5
|
import "../toast-config/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../react-to-web-component-d5889290.js";
|
|
2
|
-
import { L as e, T as g } from "../index-
|
|
2
|
+
import { L as e, T as g } from "../index-ec9d43e3.js";
|
|
3
3
|
import "../index-c91ec106.js";
|
|
4
4
|
import "../react-toastify.esm-d8df41b8.js";
|
|
5
5
|
import "../toast-config/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../react-to-web-component-d5889290.js";
|
|
2
|
-
import { H as e, g as a } from "../index-
|
|
2
|
+
import { H as e, g as a } from "../index-ec9d43e3.js";
|
|
3
3
|
import "../index-c91ec106.js";
|
|
4
4
|
import "../react-toastify.esm-d8df41b8.js";
|
|
5
5
|
import "../toast-config/index.js";
|