@ukpc-lib/react 0.13.1-dev.0 → 0.13.1-dev.1

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,7 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
- import { Identity, MenuItemDto } from '../models';
3
2
  import { ColorsType } from '../../../theme/Colors';
4
3
  import { NodeModel, RenderParams } from '@minoru/react-dnd-treeview';
4
+ import { Identity, MenuItemDto } from '../models';
5
5
 
6
6
  export type OwnMenuItemProps = {
7
7
  replacePath?(path: string): string;
@@ -9,5 +9,6 @@ export interface MenuItemDto {
9
9
  serviceKey: string;
10
10
  isFavorite?: boolean;
11
11
  children?: MenuItemDto[];
12
+ redirectUrl?: string;
12
13
  }
13
14
  export declare function buildMenuTree(menuItems: MenuItemDto[]): MenuItemDto[];
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),T=require("react"),m=require("../index.esm2017-DtX2uFv9.cjs"),X=require("moment"),N=require("@mui/material");require("axios");const pr=require("react-router-dom");require("@r2wc/react-to-web-component");require("react-query");require("react-dom");function $o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const A=$o(T),Ao=e=>{var n,o;const{tabs:t}=e,r=s=>{e.setCurrentTab(s.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),T=require("react"),m=require("../index.esm2017-CzVNnCiI.cjs"),X=require("moment"),N=require("@mui/material");require("axios");const pr=require("react-router-dom");require("@r2wc/react-to-web-component");require("react-query");require("react-dom");function $o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const A=$o(T),Ao=e=>{var n,o;const{tabs:t}=e,r=s=>{e.setCurrentTab(s.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),l.jsxs(l.Fragment,{children:[l.jsx("style",{children:`
2
2
  .tab-title {
3
3
  min-width: 90px;
4
4
  padding: 5px 16px;
@@ -1,8 +1,8 @@
1
1
  import ii, { jsxs as M, Fragment as le, jsx as u } from "react/jsx-runtime";
2
2
  import * as N from "react";
3
3
  import ye, { useState as W, useContext as $e, useEffect as q, useRef as Se, useCallback as Mt, forwardRef as ai, createElement as sr, PureComponent as si } from "react";
4
- import { c as ne, a as gt, C as Le, t as ct, p as li, L as Xr, u as ci, b as ui, S as qn, d as di, e as fi, Q as Zn, f as Et, g as Xn, h as hi, s as Ct, _ as B, P as R, i as pe, j as mi, o as pi, k as Ne, l as gi, m as yi, n as Jr, q as Ot, r as Qr, I as vi, v as bi, w as en, D as xi, x as Jn, y as Qn, z as Si, A as wi, B as _i } from "../index.esm2017-D3VDEGOb.js";
5
- import { H as au, G as su, K as lu, E as cu, F as uu, J as du } from "../index.esm2017-D3VDEGOb.js";
4
+ import { c as ne, a as gt, C as Le, t as ct, p as li, L as Xr, u as ci, b as ui, S as qn, d as di, e as fi, Q as Zn, f as Et, g as Xn, h as hi, s as Ct, _ as B, P as R, i as pe, j as mi, o as pi, k as Ne, l as gi, m as yi, n as Jr, q as Ot, r as Qr, I as vi, v as bi, w as en, D as xi, x as Jn, y as Qn, z as Si, A as wi, B as _i } from "../index.esm2017-I88kEk_g.js";
5
+ import { H as au, G as su, K as lu, E as cu, F as uu, J as du } from "../index.esm2017-I88kEk_g.js";
6
6
  import Q from "moment";
7
7
  import { Stack as me, Dialog as Ei, DialogTitle as Ci, Typography as Ce, DialogContent as Ti, DialogActions as Ii, Button as pr, Box as ki, ClickAwayListener as Mi, TextField as eo, IconButton as Oi, CircularProgress as $i, Fade as Ai, Paper as Ni, Checkbox as Ri, Breadcrumbs as Pi } from "@mui/material";
8
8
  import "axios";
@@ -28,7 +28,7 @@ object-assign
28
28
  (c) Sindre Sorhus
29
29
  @license MIT
30
30
  */var um,u1;function p4(){if(u1)return um;u1=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var a={},c=0;c<10;c++)a["_"+String.fromCharCode(c)]=c;var d=Object.getOwnPropertyNames(a).map(function(w){return a[w]});if(d.join("")!=="0123456789")return!1;var p={};return"abcdefghijklmnopqrst".split("").forEach(function(w){p[w]=w}),Object.keys(Object.assign({},p)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return um=i()?Object.assign:function(o,a){for(var c,d=r(o),p,w=1;w<arguments.length;w++){c=Object(arguments[w]);for(var m in c)e.call(c,m)&&(d[m]=c[m]);if(t){p=t(c);for(var T=0;T<p.length;T++)n.call(c,p[T])&&(d[p[T]]=c[p[T]])}}return d},um}var cm,c1;function Qy(){if(c1)return cm;c1=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cm=t,cm}var fm,f1;function MD(){return f1||(f1=1,fm=Function.call.bind(Object.prototype.hasOwnProperty)),fm}var dm,d1;function g4(){if(d1)return dm;d1=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=Qy(),n={},r=MD();t=function(o){var a="Warning: "+o;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function i(o,a,c,d,p){if(process.env.NODE_ENV!=="production"){for(var w in o)if(r(o,w)){var m;try{if(typeof o[w]!="function"){var T=Error((d||"React class")+": "+c+" type `"+w+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[w]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}m=o[w](a,w,d,c,null,e)}catch(I){m=I}if(m&&!(m instanceof Error)&&t((d||"React class")+": type specification of "+c+" `"+w+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof m+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),m instanceof Error&&!(m.message in n)){n[m.message]=!0;var E=p?p():"";t("Failed "+c+" type: "+m.message+(E??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},dm=i,dm}var hm,h1;function m4(){if(h1)return hm;h1=1;var t=ID(),e=p4(),n=Qy(),r=MD(),i=g4(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(c){var d="Warning: "+c;typeof console<"u"&&console.error(d);try{throw new Error(d)}catch{}});function a(){return null}return hm=function(c,d){var p=typeof Symbol=="function"&&Symbol.iterator,w="@@iterator";function m(me){var ke=me&&(p&&me[p]||me[w]);if(typeof ke=="function")return ke}var T="<<anonymous>>",E={array:_("array"),bigint:_("bigint"),bool:_("boolean"),func:_("function"),number:_("number"),object:_("object"),string:_("string"),symbol:_("symbol"),any:U(),arrayOf:G,element:re(),elementType:Z(),instanceOf:ue,node:Ue(),objectOf:ae,oneOf:S,oneOfType:ce,shape:Fe,exact:Ve};function I(me,ke){return me===ke?me!==0||1/me===1/ke:me!==me&&ke!==ke}function A(me,ke){this.message=me,this.data=ke&&typeof ke=="object"?ke:{},this.stack=""}A.prototype=Error.prototype;function L(me){if(process.env.NODE_ENV!=="production")var ke={},ze=0;function et(Je,Ke,ot,ct,pt,ft,yt){if(ct=ct||T,ft=ft||ot,yt!==n){if(d){var Qe=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw Qe.name="Invariant Violation",Qe}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var At=ct+":"+ot;!ke[At]&&ze<3&&(o("You are manually calling a React.PropTypes validation function for the `"+ft+"` prop on `"+ct+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),ke[At]=!0,ze++)}}return Ke[ot]==null?Je?Ke[ot]===null?new A("The "+pt+" `"+ft+"` is marked as required "+("in `"+ct+"`, but its value is `null`.")):new A("The "+pt+" `"+ft+"` is marked as required in "+("`"+ct+"`, but its value is `undefined`.")):null:me(Ke,ot,ct,pt,ft)}var qe=et.bind(null,!1);return qe.isRequired=et.bind(null,!0),qe}function _(me){function ke(ze,et,qe,Je,Ke,ot){var ct=ze[et],pt=Ee(ct);if(pt!==me){var ft=Oe(ct);return new A("Invalid "+Je+" `"+Ke+"` of type "+("`"+ft+"` supplied to `"+qe+"`, expected ")+("`"+me+"`."),{expectedType:me})}return null}return L(ke)}function U(){return L(a)}function G(me){function ke(ze,et,qe,Je,Ke){if(typeof me!="function")return new A("Property `"+Ke+"` of component `"+qe+"` has invalid PropType notation inside arrayOf.");var ot=ze[et];if(!Array.isArray(ot)){var ct=Ee(ot);return new A("Invalid "+Je+" `"+Ke+"` of type "+("`"+ct+"` supplied to `"+qe+"`, expected an array."))}for(var pt=0;pt<ot.length;pt++){var ft=me(ot,pt,qe,Je,Ke+"["+pt+"]",n);if(ft instanceof Error)return ft}return null}return L(ke)}function re(){function me(ke,ze,et,qe,Je){var Ke=ke[ze];if(!c(Ke)){var ot=Ee(Ke);return new A("Invalid "+qe+" `"+Je+"` of type "+("`"+ot+"` supplied to `"+et+"`, expected a single ReactElement."))}return null}return L(me)}function Z(){function me(ke,ze,et,qe,Je){var Ke=ke[ze];if(!t.isValidElementType(Ke)){var ot=Ee(Ke);return new A("Invalid "+qe+" `"+Je+"` of type "+("`"+ot+"` supplied to `"+et+"`, expected a single ReactElement type."))}return null}return L(me)}function ue(me){function ke(ze,et,qe,Je,Ke){if(!(ze[et]instanceof me)){var ot=me.name||T,ct=tt(ze[et]);return new A("Invalid "+Je+" `"+Ke+"` of type "+("`"+ct+"` supplied to `"+qe+"`, expected ")+("instance of `"+ot+"`."))}return null}return L(ke)}function S(me){if(!Array.isArray(me))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),a;function ke(ze,et,qe,Je,Ke){for(var ot=ze[et],ct=0;ct<me.length;ct++)if(I(ot,me[ct]))return null;var pt=JSON.stringify(me,function(yt,Qe){var At=Oe(Qe);return At==="symbol"?String(Qe):Qe});return new A("Invalid "+Je+" `"+Ke+"` of value `"+String(ot)+"` "+("supplied to `"+qe+"`, expected one of "+pt+"."))}return L(ke)}function ae(me){function ke(ze,et,qe,Je,Ke){if(typeof me!="function")return new A("Property `"+Ke+"` of component `"+qe+"` has invalid PropType notation inside objectOf.");var ot=ze[et],ct=Ee(ot);if(ct!=="object")return new A("Invalid "+Je+" `"+Ke+"` of type "+("`"+ct+"` supplied to `"+qe+"`, expected an object."));for(var pt in ot)if(r(ot,pt)){var ft=me(ot,pt,qe,Je,Ke+"."+pt,n);if(ft instanceof Error)return ft}return null}return L(ke)}function ce(me){if(!Array.isArray(me))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var ke=0;ke<me.length;ke++){var ze=me[ke];if(typeof ze!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Ne(ze)+" at index "+ke+"."),a}function et(qe,Je,Ke,ot,ct){for(var pt=[],ft=0;ft<me.length;ft++){var yt=me[ft],Qe=yt(qe,Je,Ke,ot,ct,n);if(Qe==null)return null;Qe.data&&r(Qe.data,"expectedType")&&pt.push(Qe.data.expectedType)}var At=pt.length>0?", expected one of type ["+pt.join(", ")+"]":"";return new A("Invalid "+ot+" `"+ct+"` supplied to "+("`"+Ke+"`"+At+"."))}return L(et)}function Ue(){function me(ke,ze,et,qe,Je){return We(ke[ze])?null:new A("Invalid "+qe+" `"+Je+"` supplied to "+("`"+et+"`, expected a ReactNode."))}return L(me)}function Me(me,ke,ze,et,qe){return new A((me||"React class")+": "+ke+" type `"+ze+"."+et+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+qe+"`.")}function Fe(me){function ke(ze,et,qe,Je,Ke){var ot=ze[et],ct=Ee(ot);if(ct!=="object")return new A("Invalid "+Je+" `"+Ke+"` of type `"+ct+"` "+("supplied to `"+qe+"`, expected `object`."));for(var pt in me){var ft=me[pt];if(typeof ft!="function")return Me(qe,Je,Ke,pt,Oe(ft));var yt=ft(ot,pt,qe,Je,Ke+"."+pt,n);if(yt)return yt}return null}return L(ke)}function Ve(me){function ke(ze,et,qe,Je,Ke){var ot=ze[et],ct=Ee(ot);if(ct!=="object")return new A("Invalid "+Je+" `"+Ke+"` of type `"+ct+"` "+("supplied to `"+qe+"`, expected `object`."));var pt=e({},ze[et],me);for(var ft in pt){var yt=me[ft];if(r(me,ft)&&typeof yt!="function")return Me(qe,Je,Ke,ft,Oe(yt));if(!yt)return new A("Invalid "+Je+" `"+Ke+"` key `"+ft+"` supplied to `"+qe+"`.\nBad object: "+JSON.stringify(ze[et],null," ")+`
31
- Valid keys: `+JSON.stringify(Object.keys(me),null," "));var Qe=yt(ot,ft,qe,Je,Ke+"."+ft,n);if(Qe)return Qe}return null}return L(ke)}function We(me){switch(typeof me){case"number":case"string":case"undefined":return!0;case"boolean":return!me;case"object":if(Array.isArray(me))return me.every(We);if(me===null||c(me))return!0;var ke=m(me);if(ke){var ze=ke.call(me),et;if(ke!==me.entries){for(;!(et=ze.next()).done;)if(!We(et.value))return!1}else for(;!(et=ze.next()).done;){var qe=et.value;if(qe&&!We(qe[1]))return!1}}else return!1;return!0;default:return!1}}function he(me,ke){return me==="symbol"?!0:ke?ke["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&ke instanceof Symbol:!1}function Ee(me){var ke=typeof me;return Array.isArray(me)?"array":me instanceof RegExp?"object":he(ke,me)?"symbol":ke}function Oe(me){if(typeof me>"u"||me===null)return""+me;var ke=Ee(me);if(ke==="object"){if(me instanceof Date)return"date";if(me instanceof RegExp)return"regexp"}return ke}function Ne(me){var ke=Oe(me);switch(ke){case"array":case"object":return"an "+ke;case"boolean":case"date":case"regexp":return"a "+ke;default:return ke}}function tt(me){return!me.constructor||!me.constructor.name?T:me.constructor.name}return E.checkPropTypes=i,E.resetWarningCache=i.resetWarningCache,E.PropTypes=E,E},hm}var pm,p1;function v4(){if(p1)return pm;p1=1;var t=Qy();function e(){}function n(){}return n.resetWarningCache=e,pm=function(){function r(a,c,d,p,w,m){if(m!==t){var T=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw T.name="Invariant Violation",T}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},pm}if(process.env.NODE_ENV!=="production"){var y4=ID(),b4=!0;xv.exports=m4()(y4.isElement,b4)}else xv.exports=v4()();var Cr=xv.exports;const _s=Oc(Cr);var w4=function(e){var n=(e==null?void 0:e.ownerDocument)||document;return n.defaultView||window},x4=function(e,n){for(var r in e)if(!(r in n))return!0;for(var i in n)if(e[i]!==n[i])return!0;return!1},S4=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Ah="http://www.w3.org/2000/svg",g1="http://www.w3.org/1999/xlink",Yp=function(t){function e(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o))||this,r.initialState={hasError:!1,isLoading:!0},r.state=r.initialState,r._isMounted=!1,r.reactWrapper=void 0,r.nonReactWrapper=void 0,r.refCallback=function(c){r.reactWrapper=c},r}_D(e,t);var n=e.prototype;return n.renderSVG=function(){var i=this;if(this.reactWrapper instanceof w4(this.reactWrapper).Node){var o=this.props,a=o.desc,c=o.evalScripts,d=o.httpRequestWithCredentials,p=o.renumerateIRIElements,w=o.src,m=o.title,T=o.useRequestCache,E=this.props.onError,I=this.props.beforeInjection,A=this.props.afterInjection,L=this.props.wrapper,_,U;L==="svg"?(_=document.createElementNS(Ah,L),_.setAttribute("xmlns",Ah),_.setAttribute("xmlns:xlink",g1),U=document.createElementNS(Ah,L)):(_=document.createElement(L),U=document.createElement(L)),_.appendChild(U),U.dataset.src=w,this.nonReactWrapper=this.reactWrapper.appendChild(_);var G=function(S){if(i.removeSVG(),!i._isMounted){E(S);return}i.setState(function(){return{hasError:!0,isLoading:!1}},function(){E(S)})},re=function(S,ae){if(S){G(S);return}i._isMounted&&i.setState(function(){return{isLoading:!1}},function(){try{A(ae)}catch(ce){G(ce)}})},Z=function(S){if(S.setAttribute("role","img"),a){var ae=S.querySelector(":scope > desc");ae&&S.removeChild(ae);var ce=document.createElement("desc");ce.innerHTML=a,S.prepend(ce)}if(m){var Ue=S.querySelector(":scope > title");Ue&&S.removeChild(Ue);var Me=document.createElement("title");Me.innerHTML=m,S.prepend(Me)}try{I(S)}catch(Fe){G(Fe)}};f4(U,{afterEach:re,beforeEach:Z,cacheRequests:T,evalScripts:c,httpRequestWithCredentials:d,renumerateIRIElements:p})}},n.removeSVG=function(){var i;(i=this.nonReactWrapper)!=null&&i.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(i){var o=this;x4(Rf({},i),this.props)&&this.setState(function(){return o.initialState},function(){o.removeSVG(),o.renderSVG()})},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var i=this.props;i.afterInjection,i.beforeInjection,i.desc,i.evalScripts;var o=i.fallback;i.httpRequestWithCredentials;var a=i.loading;i.renumerateIRIElements,i.src,i.title,i.useRequestCache;var c=i.wrapper,d=Fv(i,S4),p=c;return kn.createElement(p,Rf({},d,{ref:this.refCallback},c==="svg"?{xmlns:Ah,xmlnsXlink:g1}:{}),this.state.isLoading&&a&&kn.createElement(a,null),this.state.hasError&&o&&kn.createElement(o,null))},e}(kn.Component);Yp.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Yp.propTypes={afterInjection:Cr.func,beforeInjection:Cr.func,desc:Cr.string,evalScripts:Cr.oneOf(["always","once","never"]),fallback:Cr.oneOfType([Cr.func,Cr.object,Cr.string]),httpRequestWithCredentials:Cr.bool,loading:Cr.oneOfType([Cr.func,Cr.object,Cr.string]),onError:Cr.func,renumerateIRIElements:Cr.bool,src:Cr.string.isRequired,title:Cr.string,useRequestCache:Cr.bool,wrapper:Cr.oneOf(["div","span","svg"])};const Af=new Map;Af.set("text",t=>{var e,n;return Ie.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center",lineHeight:"24px"},children:(n=(e=t==null?void 0:t.name)==null?void 0:e.trim().at(0))==null?void 0:n.toUpperCase()})});Af.set("svgHtml",t=>{function e(n){function r(o){const c=new DOMParser().parseFromString(o,"image/svg+xml").querySelector("svg");return c?(c.querySelectorAll("path").forEach(p=>{p.hasAttribute("fill")&&p.setAttribute("fill","currentColor"),p.hasAttribute("stroke")&&p.setAttribute("stroke","currentColor")}),c.outerHTML):""}const i=r(n.svgString);return Ie.jsx("div",{dangerouslySetInnerHTML:{__html:i},style:{width:24,height:24,margin:"0 auto"}})}return Ie.jsx(e,{svgString:t.icon})});Af.set("svgHttp",t=>Ie.jsx(Yp,{src:t.icon,beforeInjection:e=>{e.setAttribute("style","margin: 0 auto;"),e.querySelectorAll("path").forEach(r=>{r.hasAttribute("fill")&&r.setAttribute("fill","currentColor"),r.hasAttribute("stroke")&&r.setAttribute("stroke","currentColor")})}}));Af.set("img",t=>Ie.jsx("img",{src:t.icon||"/",alt:t.name,style:{height:24,maxHeight:24,maxWidth:24}}));function T4(t){return t.icon=(t.icon||"").trim(),t.icon?t.icon.startsWith("<svg")?"svgHtml":t.icon.endsWith(".svg")?"svgHttp":"img":"text"}function LD({item:t}){return(Af.get(T4(t))||Af.get("text"))(t)}function C4(t){return Ie.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...t,children:Ie.jsx("path",{fill:"currenColor",d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})})}function E4(t){const{renderChildren:e,parentRef:n,onlyChild:r,dropdownLevel:i}=t,[o,a]=q.useState({top:0,left:0}),c=q.useRef(null),[d,p]=q.useState("auto");return q.useLayoutEffect(()=>{if(n.current&&c.current){const w=n.current.getBoundingClientRect(),m=c.current.getBoundingClientRect();let T,E;if(i===1)T=w.bottom,E=w.left,m.height+T>window.innerHeight?(p(window.innerHeight-T-50),T=w.bottom-m.height):T=w.bottom;else if(i>1){T=w.top,E=w.left+w.width;const I=m.height+(window.innerHeight-w.top)>window.innerHeight;I&&(console.log("DropDown-fav overtop"),p(window.innerHeight-w.top-50)),w.top+m.height>window.innerHeight&&!I&&(T=w.top-m.height+w.height)}a({top:T-64,left:E})}},[n,c,i]),r?e({maxHeight:d}):Iv.createPortal(Ie.jsx("div",{ref:c,style:{position:"fixed",top:o.top,left:`calc(${o.left}px - var(--global-menu-width))`,zIndex:1200},children:e({maxHeight:d})}),n.current)}const If=new Map;If.set("text",t=>{var e,n;return Ie.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center",lineHeight:"24px"},children:(n=(e=t==null?void 0:t.name)==null?void 0:e.trim().at(0))==null?void 0:n.toUpperCase()})});If.set("svgHtml",t=>{function e(n){function r(o){const c=new DOMParser().parseFromString(o,"image/svg+xml").querySelector("svg");return c?(c.querySelectorAll("path").forEach(p=>{p.hasAttribute("fill")&&p.setAttribute("fill","currentColor"),p.hasAttribute("stroke")&&p.setAttribute("stroke","currentColor")}),c.outerHTML):""}const i=r(n.svgString);return Ie.jsx("div",{dangerouslySetInnerHTML:{__html:i},style:{width:24,height:24,margin:"0 auto"}})}return Ie.jsx(e,{svgString:t.icon})});If.set("svgHttp",t=>Ie.jsx(Yp,{src:t.icon,beforeInjection:e=>{e.setAttribute("style","margin: 0 auto;"),e.querySelectorAll("path").forEach(r=>{r.hasAttribute("fill")&&r.setAttribute("fill","currentColor"),r.hasAttribute("stroke")&&r.setAttribute("stroke","currentColor")})}}));If.set("img",t=>Ie.jsx("img",{src:t.icon||"/",alt:t.name,style:{height:24,maxHeight:24,maxWidth:24}}));function k4(t){return t.icon=(t.icon||"").trim(),t.icon?t.icon.startsWith("<svg")?"svgHtml":t.icon.endsWith(".svg")?"svgHttp":"img":"text"}function D4({item:t}){return(If.get(k4(t))||If.get("text"))(t)}function FD({...t}){var ae,ce,Ue;const e=t.item,n=t.level||0,r=!!((ae=t.item.children)!=null&&ae.length),i=`level-${n}`,o=(Me,Fe=i)=>`${Me} ${Fe} `,[a,c]=q.useState(!1),[d,p]=q.useState(e.isFavorite||!1),w=q.useRef(),m=q.useRef();m!=null&&m.current&&((ce=m==null?void 0:m.current)==null?void 0:ce.scrollWidth)>((Ue=m==null?void 0:m.current)==null?void 0:Ue.clientWidth);const T=window.location.origin,E=e.path&&e.path.includes("http")?new URL(e.path):{origin:"",pathname:""},I=window.location.pathname.split("/")[1],A=E.pathname.split("/")[1],L=t.ssr||!T.includes("local")&&T!==E.origin||A!==I,_=r||n===0?"div":L?"a":xp.Link,U=e.path||"#",G=n+1,re=r&&a&&n>0,Z=()=>{c(!0)},ue=()=>{c(!1)},S="/global-menu-config/api/v1/menu-items/user/set-favorite";return Ie.jsxs("div",{ref:w,className:o("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s"},onMouseOver:Z,onMouseOut:ue,onDragStart:Me=>{n>1&&Me.preventDefault()},children:[Ie.jsxs(_,{to:U,href:U,draggable:"true",className:o("menu-item__link"),style:{width:"100%",transition:"all 0.3s"},onDragStart:Me=>{console.log("onDragStart component",Me.target)},children:[Ie.jsx(P4,{cls:o,item:e}),Ie.jsx("span",{className:o("menu-item__label"),ref:m,children:e.name}),Ie.jsx(O4,{menuLevel:n,hasChildren:r,isHovered:a,isFavorite:d,onClick:Me=>{const Fe={menuConfigId:e.id,isFavorite:Me},Ve=t.baseUrl+S;As.post(Ve,Fe).then(We=>{var he;p(Me),Uv("Set favorite menu item successfully"),(he=t.onSetFavoriteSuccess)==null||he.call(t,t.item.id,Me)}).catch(We=>{var he,Ee;Wd(((Ee=(he=We.response)==null?void 0:he.data)==null?void 0:Ee.errorMessage)||"Have error when set favorite menu item")})}}),r&&Ie.jsx("div",{className:o("menu-item__icon-arrow__wrapper"),children:Ie.jsx(C4,{className:o("menu-item__icon-arrow__icon")})})]}),re&&Ie.jsx(E4,{parentRef:w,onlyChild:G<2,dropdownLevel:n,renderChildren:({maxHeight:Me})=>{var Fe;return Ie.jsx(DD.div,{className:o("menu-item__dropdown dropdown-favorite ? 'menu-item__dropdown--open' : 'menu-item__dropdown--close'}",`level-${G}`),style:Jy({maxHeight:Me,overflowY:"auto",paddingRight:3},Me!=="auto"&&!!G),children:(Fe=e.children)==null?void 0:Fe.map(Ve=>q.createElement(FD,{...t,key:Ve.id,item:Ve,level:G}))})}})]})}function P4({item:t,cls:e}){return Ie.jsx("div",{className:e("menu-item__icon"),children:Ie.jsx(D4,{item:t})})}function O4(t){const e={marginRight:t.hasChildren?10:0,fontSize:22,fill:ki.warning,minWidth:16};if(t.menuLevel!==0)return Ie.jsxs(Ie.Fragment,{children:[t.isHovered&&!t.isFavorite&&Ie.jsx(sa.Tooltip,{title:"Add to favorites",children:Ie.jsx(PD,{style:e,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.onClick)==null||r.call(t,!0)}})}),t.isFavorite&&Ie.jsx(sa.Tooltip,{title:"Remove from favorites",children:Ie.jsx(OD,{style:e,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.onClick)==null||r.call(t,!1)}})})]})}const _4='.flex-col-center{display:flex;flex-direction:column;justify-content:center}.wrap-section{transition:all .3s;padding:0 4px}.favorite-menu{display:flex;height:56px;border-right:1px solid #ddd;background-color:#fafafa;transition:all .3s;width:100%}.scrollbar-hidden::-webkit-scrollbar{width:2px;background:transparent}.favorite-menu__wrap-btn-logout,.favorite-menu__btn-logout{margin:40px 0}.favorite-menu__logout-btn__text{margin-left:12px;font-size:.875rem;opacity:0;transition:ease-in-out .2s;transition-delay:.15s}.favorite-menu__wrapper-toggle-btn{display:flex;flex-direction:row;justify-content:flex-end;transition:all .3s;margin-right:-8px;margin-top:40px;justify-content:center;width:100%}.favorite-menu__toggle-btn{margin-top:-6px;color:#85858a}.favorite-menu__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}.favorite-menu__logout-btn:hover{background-color:#919eab14}.favorite-menu__icon-logout{flex-shrink:0}.menu-item__wrapper{display:flex;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:hover{background-color:#919eab14}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.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,.menu-item__link.active.level-10{background-color:inherit;color:inherit}.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-10:hover{background-color:#919eab14}.menu-item__link.menu-item__link.level-0{padding:0;background-color:#919eab14;transition:all .15s}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center}.menu-item__icon.level-1>*{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-1{text-overflow:unset}.menu-item__label.active{color:inherit}.menu-item__label{margin-left:8px;font-size:.75rem;line-height:1rem}.menu-item__label.level-0,.menu-item__label.level-1{font-size:.875rem;transition-delay:.15s}.menu-item__label.level-0{color:#85858a;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.level-0{display:none}.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.open{transform:rotate(0)!important}.menu-item__dropdown{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.dropdown-favorite{width:auto;min-width:180px;max-width:350px}.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:first-of-type{margin-top:0}.menu-item__dropdown>*:first-child{margin-top:0}.menu-item__dropdown .menu-item__link{height:40px}.menu-item__dropdown .menu-item__link.level-1{height:48px}.menu-item__dropdown.level-1{width:auto;max-width:unset;box-shadow:none;border:none;padding:0;background-color:unset}.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}.favorite-menu__menu .simplebar-track.simplebar-vertical{display:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.treeFavorited{display:flex;align-items:center;margin:0 -5px}.treeFavorited li{margin:0 5px}.item.hover-on:before{content:"";position:absolute;top:0;left:0;height:100%;width:2px;background-color:var(--primary300)}';var ac={};/**
31
+ Valid keys: `+JSON.stringify(Object.keys(me),null," "));var Qe=yt(ot,ft,qe,Je,Ke+"."+ft,n);if(Qe)return Qe}return null}return L(ke)}function We(me){switch(typeof me){case"number":case"string":case"undefined":return!0;case"boolean":return!me;case"object":if(Array.isArray(me))return me.every(We);if(me===null||c(me))return!0;var ke=m(me);if(ke){var ze=ke.call(me),et;if(ke!==me.entries){for(;!(et=ze.next()).done;)if(!We(et.value))return!1}else for(;!(et=ze.next()).done;){var qe=et.value;if(qe&&!We(qe[1]))return!1}}else return!1;return!0;default:return!1}}function he(me,ke){return me==="symbol"?!0:ke?ke["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&ke instanceof Symbol:!1}function Ee(me){var ke=typeof me;return Array.isArray(me)?"array":me instanceof RegExp?"object":he(ke,me)?"symbol":ke}function Oe(me){if(typeof me>"u"||me===null)return""+me;var ke=Ee(me);if(ke==="object"){if(me instanceof Date)return"date";if(me instanceof RegExp)return"regexp"}return ke}function Ne(me){var ke=Oe(me);switch(ke){case"array":case"object":return"an "+ke;case"boolean":case"date":case"regexp":return"a "+ke;default:return ke}}function tt(me){return!me.constructor||!me.constructor.name?T:me.constructor.name}return E.checkPropTypes=i,E.resetWarningCache=i.resetWarningCache,E.PropTypes=E,E},hm}var pm,p1;function v4(){if(p1)return pm;p1=1;var t=Qy();function e(){}function n(){}return n.resetWarningCache=e,pm=function(){function r(a,c,d,p,w,m){if(m!==t){var T=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw T.name="Invariant Violation",T}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},pm}if(process.env.NODE_ENV!=="production"){var y4=ID(),b4=!0;xv.exports=m4()(y4.isElement,b4)}else xv.exports=v4()();var Cr=xv.exports;const _s=Oc(Cr);var w4=function(e){var n=(e==null?void 0:e.ownerDocument)||document;return n.defaultView||window},x4=function(e,n){for(var r in e)if(!(r in n))return!0;for(var i in n)if(e[i]!==n[i])return!0;return!1},S4=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Ah="http://www.w3.org/2000/svg",g1="http://www.w3.org/1999/xlink",Yp=function(t){function e(){for(var r,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=t.call.apply(t,[this].concat(o))||this,r.initialState={hasError:!1,isLoading:!0},r.state=r.initialState,r._isMounted=!1,r.reactWrapper=void 0,r.nonReactWrapper=void 0,r.refCallback=function(c){r.reactWrapper=c},r}_D(e,t);var n=e.prototype;return n.renderSVG=function(){var i=this;if(this.reactWrapper instanceof w4(this.reactWrapper).Node){var o=this.props,a=o.desc,c=o.evalScripts,d=o.httpRequestWithCredentials,p=o.renumerateIRIElements,w=o.src,m=o.title,T=o.useRequestCache,E=this.props.onError,I=this.props.beforeInjection,A=this.props.afterInjection,L=this.props.wrapper,_,U;L==="svg"?(_=document.createElementNS(Ah,L),_.setAttribute("xmlns",Ah),_.setAttribute("xmlns:xlink",g1),U=document.createElementNS(Ah,L)):(_=document.createElement(L),U=document.createElement(L)),_.appendChild(U),U.dataset.src=w,this.nonReactWrapper=this.reactWrapper.appendChild(_);var G=function(S){if(i.removeSVG(),!i._isMounted){E(S);return}i.setState(function(){return{hasError:!0,isLoading:!1}},function(){E(S)})},re=function(S,ae){if(S){G(S);return}i._isMounted&&i.setState(function(){return{isLoading:!1}},function(){try{A(ae)}catch(ce){G(ce)}})},Z=function(S){if(S.setAttribute("role","img"),a){var ae=S.querySelector(":scope > desc");ae&&S.removeChild(ae);var ce=document.createElement("desc");ce.innerHTML=a,S.prepend(ce)}if(m){var Ue=S.querySelector(":scope > title");Ue&&S.removeChild(Ue);var Me=document.createElement("title");Me.innerHTML=m,S.prepend(Me)}try{I(S)}catch(Fe){G(Fe)}};f4(U,{afterEach:re,beforeEach:Z,cacheRequests:T,evalScripts:c,httpRequestWithCredentials:d,renumerateIRIElements:p})}},n.removeSVG=function(){var i;(i=this.nonReactWrapper)!=null&&i.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},n.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},n.componentDidUpdate=function(i){var o=this;x4(Rf({},i),this.props)&&this.setState(function(){return o.initialState},function(){o.removeSVG(),o.renderSVG()})},n.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},n.render=function(){var i=this.props;i.afterInjection,i.beforeInjection,i.desc,i.evalScripts;var o=i.fallback;i.httpRequestWithCredentials;var a=i.loading;i.renumerateIRIElements,i.src,i.title,i.useRequestCache;var c=i.wrapper,d=Fv(i,S4),p=c;return kn.createElement(p,Rf({},d,{ref:this.refCallback},c==="svg"?{xmlns:Ah,xmlnsXlink:g1}:{}),this.state.isLoading&&a&&kn.createElement(a,null),this.state.hasError&&o&&kn.createElement(o,null))},e}(kn.Component);Yp.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Yp.propTypes={afterInjection:Cr.func,beforeInjection:Cr.func,desc:Cr.string,evalScripts:Cr.oneOf(["always","once","never"]),fallback:Cr.oneOfType([Cr.func,Cr.object,Cr.string]),httpRequestWithCredentials:Cr.bool,loading:Cr.oneOfType([Cr.func,Cr.object,Cr.string]),onError:Cr.func,renumerateIRIElements:Cr.bool,src:Cr.string.isRequired,title:Cr.string,useRequestCache:Cr.bool,wrapper:Cr.oneOf(["div","span","svg"])};const Af=new Map;Af.set("text",t=>{var e,n;return Ie.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center",lineHeight:"24px"},children:(n=(e=t==null?void 0:t.name)==null?void 0:e.trim().at(0))==null?void 0:n.toUpperCase()})});Af.set("svgHtml",t=>{function e(n){function r(o){const c=new DOMParser().parseFromString(o,"image/svg+xml").querySelector("svg");return c?(c.querySelectorAll("path").forEach(p=>{p.hasAttribute("fill")&&p.setAttribute("fill","currentColor"),p.hasAttribute("stroke")&&p.setAttribute("stroke","currentColor")}),c.outerHTML):""}const i=r(n.svgString);return Ie.jsx("div",{dangerouslySetInnerHTML:{__html:i},style:{width:24,height:24,margin:"0 auto"}})}return Ie.jsx(e,{svgString:t.icon})});Af.set("svgHttp",t=>Ie.jsx(Yp,{src:t.icon,beforeInjection:e=>{e.setAttribute("style","margin: 0 auto;"),e.querySelectorAll("path").forEach(r=>{r.hasAttribute("fill")&&r.setAttribute("fill","currentColor"),r.hasAttribute("stroke")&&r.setAttribute("stroke","currentColor")})}}));Af.set("img",t=>Ie.jsx("img",{src:t.icon||"/",alt:t.name,style:{height:24,maxHeight:24,maxWidth:24}}));function T4(t){return t.icon=(t.icon||"").trim(),t.icon?t.icon.startsWith("<svg")?"svgHtml":t.icon.endsWith(".svg")?"svgHttp":"img":"text"}function LD({item:t}){return(Af.get(T4(t))||Af.get("text"))(t)}function C4(t){return Ie.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...t,children:Ie.jsx("path",{fill:"currenColor",d:"M4.427 7.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 7H4.604a.25.25 0 00-.177.427z"})})}function E4(t){const{renderChildren:e,parentRef:n,onlyChild:r,dropdownLevel:i}=t,[o,a]=q.useState({top:0,left:0}),c=q.useRef(null),[d,p]=q.useState("auto");return q.useLayoutEffect(()=>{if(n.current&&c.current){const w=n.current.getBoundingClientRect(),m=c.current.getBoundingClientRect();let T,E;if(i===1)T=w.bottom,E=w.left,m.height+T>window.innerHeight?(p(window.innerHeight-T-50),T=w.bottom-m.height):T=w.bottom;else if(i>1){T=w.top,E=w.left+w.width;const I=m.height+(window.innerHeight-w.top)>window.innerHeight;I&&(console.log("DropDown-fav overtop"),p(window.innerHeight-w.top-50)),w.top+m.height>window.innerHeight&&!I&&(T=w.top-m.height+w.height)}a({top:T-64,left:E})}},[n,c,i]),r?e({maxHeight:d}):Iv.createPortal(Ie.jsx("div",{ref:c,style:{position:"fixed",top:o.top,left:`calc(${o.left}px - var(--global-menu-width))`,zIndex:1200},children:e({maxHeight:d})}),n.current)}const If=new Map;If.set("text",t=>{var e,n;return Ie.jsx("div",{style:{width:24,height:24,backgroundColor:"#dadada",borderRadius:"5px",display:"flex",justifyContent:"center",alignItems:"center",lineHeight:"24px"},children:(n=(e=t==null?void 0:t.name)==null?void 0:e.trim().at(0))==null?void 0:n.toUpperCase()})});If.set("svgHtml",t=>{function e(n){function r(o){const c=new DOMParser().parseFromString(o,"image/svg+xml").querySelector("svg");return c?(c.querySelectorAll("path").forEach(p=>{p.hasAttribute("fill")&&p.setAttribute("fill","currentColor"),p.hasAttribute("stroke")&&p.setAttribute("stroke","currentColor")}),c.outerHTML):""}const i=r(n.svgString);return Ie.jsx("div",{dangerouslySetInnerHTML:{__html:i},style:{width:24,height:24,margin:"0 auto"}})}return Ie.jsx(e,{svgString:t.icon})});If.set("svgHttp",t=>Ie.jsx(Yp,{src:t.icon,beforeInjection:e=>{e.setAttribute("style","margin: 0 auto;"),e.querySelectorAll("path").forEach(r=>{r.hasAttribute("fill")&&r.setAttribute("fill","currentColor"),r.hasAttribute("stroke")&&r.setAttribute("stroke","currentColor")})}}));If.set("img",t=>Ie.jsx("img",{src:t.icon||"/",alt:t.name,style:{height:24,maxHeight:24,maxWidth:24}}));function k4(t){return t.icon=(t.icon||"").trim(),t.icon?t.icon.startsWith("<svg")?"svgHtml":t.icon.endsWith(".svg")?"svgHttp":"img":"text"}function D4({item:t}){return(If.get(k4(t))||If.get("text"))(t)}function FD({...t}){var ae,ce,Ue;const e=t.item,n=t.level||0,r=!!((ae=t.item.children)!=null&&ae.length),i=`level-${n}`,o=(Me,Fe=i)=>`${Me} ${Fe} `,[a,c]=q.useState(!1),[d,p]=q.useState(e.isFavorite||!1),w=q.useRef(),m=q.useRef();m!=null&&m.current&&((ce=m==null?void 0:m.current)==null?void 0:ce.scrollWidth)>((Ue=m==null?void 0:m.current)==null?void 0:Ue.clientWidth);const T=window.location.origin,E=e.path&&e.path.includes("http")?new URL(e.path):{origin:"",pathname:""},I=window.location.pathname.split("/")[1],A=E.pathname.split("/")[1],L=t.ssr||!T.includes("local")&&T!==E.origin||A!==I,_=r||n===0?"div":L?"a":xp.Link,U=e.redirectUrl||e.path||"#",G=n+1,re=r&&a&&n>0,Z=()=>{c(!0)},ue=()=>{c(!1)},S="/global-menu-config/api/v1/menu-items/user/set-favorite";return Ie.jsxs("div",{ref:w,className:o("menu-item__wrapper tree-node"),style:{borderRadius:"8px",transition:"all 0.3s"},onMouseOver:Z,onMouseOut:ue,onDragStart:Me=>{n>1&&Me.preventDefault()},children:[Ie.jsxs(_,{to:U,href:U,draggable:"true",className:o("menu-item__link"),style:{width:"100%",transition:"all 0.3s"},onDragStart:Me=>{console.log("onDragStart component",Me.target)},children:[Ie.jsx(P4,{cls:o,item:e}),Ie.jsx("span",{className:o("menu-item__label"),ref:m,children:e.name}),Ie.jsx(O4,{menuLevel:n,hasChildren:r,isHovered:a,isFavorite:d,onClick:Me=>{const Fe={menuConfigId:e.id,isFavorite:Me},Ve=t.baseUrl+S;As.post(Ve,Fe).then(We=>{var he;p(Me),Uv("Set favorite menu item successfully"),(he=t.onSetFavoriteSuccess)==null||he.call(t,t.item.id,Me)}).catch(We=>{var he,Ee;Wd(((Ee=(he=We.response)==null?void 0:he.data)==null?void 0:Ee.errorMessage)||"Have error when set favorite menu item")})}}),r&&Ie.jsx("div",{className:o("menu-item__icon-arrow__wrapper"),children:Ie.jsx(C4,{className:o("menu-item__icon-arrow__icon")})})]}),re&&Ie.jsx(E4,{parentRef:w,onlyChild:G<2,dropdownLevel:n,renderChildren:({maxHeight:Me})=>{var Fe;return Ie.jsx(DD.div,{className:o("menu-item__dropdown dropdown-favorite ? 'menu-item__dropdown--open' : 'menu-item__dropdown--close'}",`level-${G}`),style:Jy({maxHeight:Me,overflowY:"auto",paddingRight:3},Me!=="auto"&&!!G),children:(Fe=e.children)==null?void 0:Fe.map(Ve=>q.createElement(FD,{...t,key:Ve.id,item:Ve,level:G}))})}})]})}function P4({item:t,cls:e}){return Ie.jsx("div",{className:e("menu-item__icon"),children:Ie.jsx(D4,{item:t})})}function O4(t){const e={marginRight:t.hasChildren?10:0,fontSize:22,fill:ki.warning,minWidth:16};if(t.menuLevel!==0)return Ie.jsxs(Ie.Fragment,{children:[t.isHovered&&!t.isFavorite&&Ie.jsx(sa.Tooltip,{title:"Add to favorites",children:Ie.jsx(PD,{style:e,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.onClick)==null||r.call(t,!0)}})}),t.isFavorite&&Ie.jsx(sa.Tooltip,{title:"Remove from favorites",children:Ie.jsx(OD,{style:e,onClick:n=>{var r;n.preventDefault(),n.stopPropagation(),(r=t.onClick)==null||r.call(t,!1)}})})]})}const _4='.flex-col-center{display:flex;flex-direction:column;justify-content:center}.wrap-section{transition:all .3s;padding:0 4px}.favorite-menu{display:flex;height:56px;border-right:1px solid #ddd;background-color:#fafafa;transition:all .3s;width:100%}.scrollbar-hidden::-webkit-scrollbar{width:2px;background:transparent}.favorite-menu__wrap-btn-logout,.favorite-menu__btn-logout{margin:40px 0}.favorite-menu__logout-btn__text{margin-left:12px;font-size:.875rem;opacity:0;transition:ease-in-out .2s;transition-delay:.15s}.favorite-menu__wrapper-toggle-btn{display:flex;flex-direction:row;justify-content:flex-end;transition:all .3s;margin-right:-8px;margin-top:40px;justify-content:center;width:100%}.favorite-menu__toggle-btn{margin-top:-6px;color:#85858a}.favorite-menu__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}.favorite-menu__logout-btn:hover{background-color:#919eab14}.favorite-menu__icon-logout{flex-shrink:0}.menu-item__wrapper{display:flex;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:hover{background-color:#919eab14}.menu-item__link.active{background-color:#009d4f1a;color:inherit}.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,.menu-item__link.active.level-10{background-color:inherit;color:inherit}.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-10:hover{background-color:#919eab14}.menu-item__link.menu-item__link.level-0{padding:0;background-color:#919eab14;transition:all .15s}.menu-item__icon{width:1.5rem;height:1.5rem;flex-shrink:0;display:grid;place-items:center}.menu-item__icon.level-1>*{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-1{text-overflow:unset}.menu-item__label.active{color:inherit}.menu-item__label{margin-left:8px;font-size:.75rem;line-height:1rem}.menu-item__label.level-0,.menu-item__label.level-1{font-size:.875rem;transition-delay:.15s}.menu-item__label.level-0{color:#85858a;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.level-0{display:none}.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.open{transform:rotate(0)!important}.menu-item__dropdown{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.dropdown-favorite{width:auto;min-width:180px;max-width:350px}.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:first-of-type{margin-top:0}.menu-item__dropdown>*:first-child{margin-top:0}.menu-item__dropdown .menu-item__link{height:40px}.menu-item__dropdown .menu-item__link.level-1{height:48px}.menu-item__dropdown.level-1{width:auto;max-width:unset;box-shadow:none;border:none;padding:0;background-color:unset}.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}.favorite-menu__menu .simplebar-track.simplebar-vertical{display:none}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.treeFavorited{display:flex;align-items:center;margin:0 -5px}.treeFavorited li{margin:0 5px}.item.hover-on:before{content:"";position:absolute;top:0;left:0;height:100%;width:2px;background-color:var(--primary300)}';var ac={};/**
32
32
  * @license React
33
33
  * react-dom-server-legacy.browser.production.min.js
34
34
  *
@@ -19311,7 +19311,7 @@ function UD({ ...t }) {
19311
19311
  var se, ue, He;
19312
19312
  const e = t.item, n = t.level || 0, r = !!((se = t.item.children) != null && se.length), i = `level-${n}`, o = (Ae, Me = i) => `${Ae} ${Me} `, [a, c] = tn(!1), [d, p] = tn(e.isFavorite || !1), w = un(), m = un();
19313
19313
  m != null && m.current && ((ue = m == null ? void 0 : m.current) == null ? void 0 : ue.scrollWidth) > ((He = m == null ? void 0 : m.current) == null ? void 0 : He.clientWidth);
19314
- const T = window.location.origin, E = e.path && e.path.includes("http") ? new URL(e.path) : { origin: "", pathname: "" }, I = window.location.pathname.split("/")[1], A = E.pathname.split("/")[1], L = t.ssr || !T.includes("local") && T !== E.origin || A !== I, _ = r || n === 0 ? "div" : L ? "a" : rT, U = e.path || "#", G = n + 1, ne = r && a && n > 0, K = () => {
19314
+ const T = window.location.origin, E = e.path && e.path.includes("http") ? new URL(e.path) : { origin: "", pathname: "" }, I = window.location.pathname.split("/")[1], A = E.pathname.split("/")[1], L = t.ssr || !T.includes("local") && T !== E.origin || A !== I, _ = r || n === 0 ? "div" : L ? "a" : rT, U = e.redirectUrl || e.path || "#", G = n + 1, ne = r && a && n > 0, K = () => {
19315
19315
  c(!0);
19316
19316
  }, le = () => {
19317
19317
  c(!1);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../index.esm2017-DtX2uFv9.cjs"),h=require("axios"),a=require("react"),u=require("react-router-dom"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("@mui/material");const l=o=>{const[s,t]=a.useState([]);return a.useEffect(()=>{h.get(`${o}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(e=>t(e.data)).catch(e=>{console.error("Getting user permission error:",e)})},[o]),s},m=()=>{const o=u.useNavigate(),s=u.useLocation();if(a.useEffect(()=>{const t={changeRoute:e=>{typeof e=="string"&&s.pathname+s.search+s.hash!==e&&o(e)}};window.MicrofeBridge=t},[o,s]),a.useEffect(()=>{var e,n;const t=s.pathname+s.search+s.hash;(n=(e=window.parent)==null?void 0:e.HostBridge)==null||n.childRouteChange(t)},[s]),window.self===window.top){console.log("useSyncRouter: Navigate to /app path"),window.location.href=window.location.href.replace(window.origin,`${window.origin}/app`);return}},c=o=>(s,t)=>{const e=l(o);return t?s.every(n=>e==null?void 0:e.includes(n)):s.some(n=>e==null?void 0:e.includes(n))},g=({baseUrl:o,accessWith:s,requireAll:t,children:e})=>c(o)(s,t)?i.jsx(i.Fragment,{children:e}):null,d=({accessWith:o,requireAll:s,baseUrl:t,unAuthorizedPath:e,children:n})=>c(t)(o,s)?i.jsx(i.Fragment,{children:n}):i.jsx(u.Navigate,{to:e,replace:!0});exports.AuthContext=r.AuthContext;exports.AuthProvider=r.AuthProvider;exports.ERROR_MESSAGE=r.ERROR_MESSAGE;exports.SaasThemeProvider=r.SaasThemeProvider;exports.TranslationProvider=r.TranslationProvider;exports.axiosInstance=r.axiosInstance;exports.color=r.color;exports.createCustomTheme=r.createCustomTheme;exports.handleErrorAxios=r.handleErrorAxios;exports.login=r.login;exports.logout=r.logout;exports.responseInterceptor=r.responseInterceptor;exports.search=r.search;exports.setFavicon=r.setFavicon;exports.translate=r.translate;exports.translationConfig=r.translationConfig;exports.useAuth=r.useAuth;exports.useCustomTranslation=r.useCustomTranslation;exports.useTheme=r.useTheme;exports.useTranslation=r.useTranslation$1;exports.HasPermission=g;exports.PermissionRoute=d;exports.getUseHasPermission=c;exports.useGetPermission=l;exports.useSyncRouter=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../index.esm2017-CzVNnCiI.cjs"),h=require("axios"),a=require("react"),u=require("react-router-dom"),i=require("react/jsx-runtime");require("@r2wc/react-to-web-component");require("@mui/material");const l=o=>{const[s,t]=a.useState([]);return a.useEffect(()=>{h.get(`${o}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(e=>t(e.data)).catch(e=>{console.error("Getting user permission error:",e)})},[o]),s},m=()=>{const o=u.useNavigate(),s=u.useLocation();if(a.useEffect(()=>{const t={changeRoute:e=>{typeof e=="string"&&s.pathname+s.search+s.hash!==e&&o(e)}};window.MicrofeBridge=t},[o,s]),a.useEffect(()=>{var e,n;const t=s.pathname+s.search+s.hash;(n=(e=window.parent)==null?void 0:e.HostBridge)==null||n.childRouteChange(t)},[s]),window.self===window.top){console.log("useSyncRouter: Navigate to /app path"),window.location.href=window.location.href.replace(window.origin,`${window.origin}/app`);return}},c=o=>(s,t)=>{const e=l(o);return t?s.every(n=>e==null?void 0:e.includes(n)):s.some(n=>e==null?void 0:e.includes(n))},g=({baseUrl:o,accessWith:s,requireAll:t,children:e})=>c(o)(s,t)?i.jsx(i.Fragment,{children:e}):null,d=({accessWith:o,requireAll:s,baseUrl:t,unAuthorizedPath:e,children:n})=>c(t)(o,s)?i.jsx(i.Fragment,{children:n}):i.jsx(u.Navigate,{to:e,replace:!0});exports.AuthContext=r.AuthContext;exports.AuthProvider=r.AuthProvider;exports.ERROR_MESSAGE=r.ERROR_MESSAGE;exports.SaasThemeProvider=r.SaasThemeProvider;exports.TranslationProvider=r.TranslationProvider;exports.axiosInstance=r.axiosInstance;exports.color=r.color;exports.createCustomTheme=r.createCustomTheme;exports.handleErrorAxios=r.handleErrorAxios;exports.login=r.login;exports.logout=r.logout;exports.responseInterceptor=r.responseInterceptor;exports.search=r.search;exports.setFavicon=r.setFavicon;exports.translate=r.translate;exports.translationConfig=r.translationConfig;exports.useAuth=r.useAuth;exports.useCustomTranslation=r.useCustomTranslation;exports.useTheme=r.useTheme;exports.useTranslation=r.useTranslation$1;exports.HasPermission=g;exports.PermissionRoute=d;exports.getUseHasPermission=c;exports.useGetPermission=l;exports.useSyncRouter=m;
@@ -1,4 +1,4 @@
1
- import { M as E, N as M, O as N, a0 as B, Y as G, a as H, c as $, Z as F, U as I, R as O, T as j, V as L, v as U, $ as V, t as X, W as Y, b as Z, u as _, g as b, X as k } from "../index.esm2017-D3VDEGOb.js";
1
+ import { M as E, N as M, O as N, a0 as B, Y as G, a as H, c as $, Z as F, U as I, R as O, T as j, V as L, v as U, $ as V, t as X, W as Y, b as Z, u as _, g as b, X as k } from "../index.esm2017-I88kEk_g.js";
2
2
  import c from "axios";
3
3
  import { useState as m, useEffect as n } from "react";
4
4
  import { useNavigate as h, useLocation as l, Navigate as g } from "react-router-dom";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.13.1-dev.0",
4
+ "version": "0.13.1-dev.1",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-D7SoYMky.js";
2
- import { F as i, u as m } from "../index-DkWIzRN3.js";
2
+ import { F as i, u as m } from "../index-CXQLVfRc.js";
3
3
  import "../index-Cx0zTfOC.js";
4
4
  import "../index-B8-7QZsi.js";
5
5
  export {
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-D7SoYMky.js";
2
- import { G as i } from "../index-DkWIzRN3.js";
2
+ import { G as i } from "../index-CXQLVfRc.js";
3
3
  import "../index-Cx0zTfOC.js";
4
4
  import "../index-B8-7QZsi.js";
5
5
  export {
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-D7SoYMky.js";
2
- import { L as n, T as s } from "../index-DkWIzRN3.js";
2
+ import { L as n, T as s } from "../index-CXQLVfRc.js";
3
3
  import "../index-Cx0zTfOC.js";
4
4
  import "../index-B2-j-GrO.js";
5
5
  import "../index-B8-7QZsi.js";
@@ -1,5 +1,5 @@
1
1
  import "../react-to-web-component-D7SoYMky.js";
2
- import { H as e, g as m } from "../index-DkWIzRN3.js";
2
+ import { H as e, g as m } from "../index-CXQLVfRc.js";
3
3
  import "../index-B8-7QZsi.js";
4
4
  export {
5
5
  e as HasPermission,
@@ -16494,7 +16494,7 @@ function IA({ ...e }) {
16494
16494
  var z, K, re;
16495
16495
  const t = e.item, n = e.level || 0, r = !!((z = e.item.children) != null && z.length), i = `level-${n}`, s = (J, ae = i) => `${J} ${ae} `, [o, l] = A.useState(!1), [c, d] = A.useState(t.isFavorite || !1), h = A.useRef(), p = A.useRef();
16496
16496
  p != null && p.current && ((K = p == null ? void 0 : p.current) == null ? void 0 : K.scrollWidth) > ((re = p == null ? void 0 : p.current) == null ? void 0 : re.clientWidth);
16497
- const y = window.location.origin, x = t.path && t.path.includes("http") ? new URL(t.path) : { origin: "", pathname: "" }, T = window.location.pathname.split("/")[1], C = x.pathname.split("/")[1], O = e.ssr || !y.includes("local") && y !== x.origin || C !== T, _ = r || n === 0 ? "div" : O ? "a" : zD, N = t.path || "#", R = n + 1, V = r && o && n > 0, H = () => {
16497
+ const y = window.location.origin, x = t.path && t.path.includes("http") ? new URL(t.path) : { origin: "", pathname: "" }, T = window.location.pathname.split("/")[1], C = x.pathname.split("/")[1], O = e.ssr || !y.includes("local") && y !== x.origin || C !== T, _ = r || n === 0 ? "div" : O ? "a" : zD, N = t.redirectUrl || t.path || "#", R = n + 1, V = r && o && n > 0, H = () => {
16498
16498
  l(!0);
16499
16499
  }, F = () => {
16500
16500
  l(!1);