@ukpc-lib/react 0.5.2 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),j=require("react"),m=require("../index.module-623b0381.cjs"),K=require("moment"),O=require("@mui/material");require("@r2wc/react-to-web-component");require("axios");const on=require("react-router-dom");require("react-query");function Jn(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 L=Jn(j),Qn=e=>{var n,o;const{tabs:t}=e,r=i=>{e.setCurrentTab(i.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),s.jsxs(s.Fragment,{children:[s.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),j=require("react"),m=require("../index.module-8e124b28.cjs"),K=require("moment"),O=require("@mui/material");require("@r2wc/react-to-web-component");require("axios");const on=require("react-router-dom");require("react-query");function Jn(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 L=Jn(j),Qn=e=>{var n,o;const{tabs:t}=e,r=i=>{e.setCurrentTab(i.target.id)};return console.log("🚀 ~ brandColors:",e.currentTab),s.jsxs(s.Fragment,{children:[s.jsx("style",{children:`
2
2
  .tab-title {
3
3
  min-width: 90px;
4
4
  padding: 5px 16px;
@@ -1,8 +1,8 @@
1
1
  import { jsxs as O, Fragment as $e, jsx as c } from "react/jsx-runtime";
2
2
  import * as j from "react";
3
3
  import ge, { useState as G, useContext as _e, useEffect as Q, useRef as xe, useCallback as xt, forwardRef as No, createElement as rr, PureComponent as Oo } from "react";
4
- import { c as Te, a as Rt, C as ke, p as To, u as ko, S as Io, b as $o, L as Mo, d as Rr, e as Ao, Q as $n, f as pt, g as mr, h as Po, s as gt, _ as z, i as we, P as k, j as he, k as Ro, o as Do, l as zo, m as Fo, n as Dr, q as _t, r as zr, I as jo, t as Lo, v as Fr, D as Vo, w as Mn, x as An, y as Ho, z as Bo, A as Oe, B as Wo, E as yt } from "../index.module-011cabd9.js";
5
- import { G as zc, F as Fc, H as jc } from "../index.module-011cabd9.js";
4
+ import { c as Te, a as Rt, C as ke, p as To, u as ko, S as Io, b as $o, L as Mo, d as Rr, e as Ao, Q as $n, f as pt, g as mr, h as Po, s as gt, _ as z, i as we, P as k, j as he, k as Ro, o as Do, l as zo, m as Fo, n as Dr, q as _t, r as zr, I as jo, t as Lo, v as Fr, D as Vo, w as Mn, x as An, y as Ho, z as Bo, A as Oe, B as Wo, E as yt } from "../index.module-6d5f3127.js";
5
+ import { G as zc, F as Fc, H as jc } from "../index.module-6d5f3127.js";
6
6
  import Z from "moment";
7
7
  import { Stack as te, Dialog as Uo, DialogTitle as Yo, Typography as ye, DialogContent as qo, DialogActions as Go, Button as kt, Box as Ko, ClickAwayListener as Zo, TextField as Pn, IconButton as Xo, CircularProgress as Jo, Fade as Qo, Paper as ei, Checkbox as ti } from "@mui/material";
8
8
  import "@r2wc/react-to-web-component";
@@ -28843,7 +28843,7 @@ function l4(e) {
28843
28843
  }
28844
28844
  function u4(e) {
28845
28845
  const t = NI(), [n, r] = An([]), i = n.map((ue) => ue.data), [o, s] = An(!1);
28846
- Gn(() => {
28846
+ console.log("isSubmitting:", o), Gn(() => {
28847
28847
  const ue = /* @__PURE__ */ new Map();
28848
28848
  return n.forEach((oe) => {
28849
28849
  ue.set(oe.id, oe);
@@ -28858,6 +28858,9 @@ function u4(e) {
28858
28858
  const ue = i.filter((oe) => oe.isFavorite);
28859
28859
  l4(ue);
28860
28860
  }, [i]), zt(() => {
28861
+ var ue;
28862
+ (ue = e.handleCallback) == null || ue.call(e, i);
28863
+ }, [i, e.handleCallback]), zt(() => {
28861
28864
  _(window.location.href);
28862
28865
  }, [t]);
28863
28866
  const L = f4(i, T).filter(
@@ -28931,7 +28934,9 @@ function u4(e) {
28931
28934
  baseURL: e.baseUrl
28932
28935
  }).then(() => {
28933
28936
  }).catch((Qe) => {
28934
- console.error(Qe), r(oe), s(!1);
28937
+ console.error(Qe), r(oe);
28938
+ }).finally(() => {
28939
+ s(!1);
28935
28940
  });
28936
28941
  }
28937
28942
  return /* @__PURE__ */ ra("div", { className: Z("side-bar"), children: [
@@ -138,7 +138,7 @@ Incoming: %s`,Di,"["+g.join(", ")+"]","["+w.join(", ")+"]");for(var A=0;A<w.leng
138
138
  Error generating stack: `+$.message+`
139
139
  `+$.stack}}var ru=n.ReactCurrentDispatcher,xs=n.ReactDebugCurrentFrame,Jl=0,Pi=1,iu=2,Ju=3,Ga=4,Ss=0,Ql=1,qa=2,ec=12800;function tc(g){return console.error(g),null}function So(){}function Wf(g,w,A,$,K,se,ge,Ae,h){var b=[],D=new Set,M={destination:null,responseState:w,progressiveChunkSize:$===void 0?ec:$,status:Ss,fatalError:null,nextSegmentId:0,allPendingTasks:0,pendingRootTasks:0,completedRootSegment:null,abortableTasks:D,pingedTasks:b,clientRenderedBoundaries:[],completedBoundaries:[],partialBoundaries:[],onError:K===void 0?tc:K,onAllReady:se===void 0?So:se,onShellReady:ge===void 0?So:ge,onShellError:Ae===void 0?So:Ae,onFatalError:h===void 0?So:h},Y=Qu(M,0,null,A,!1,!1);Y.parentFlushed=!0;var ie=ou(M,g,null,Y,D,Fn,Wc,$f);return b.push(ie),M}function zf(g,w){var A=g.pingedTasks;A.push(w),A.length===1&&s(function(){return hu(g)})}function Ts(g,w){return{id:Hi,rootSegmentID:-1,parentFlushed:!1,pendingTasks:0,forceClientRender:!1,completedSegments:[],byteSize:0,fallbackAbortableTasks:w,errorDigest:null}}function ou(g,w,A,$,K,se,ge,Ae){g.allPendingTasks++,A===null?g.pendingRootTasks++:A.pendingTasks++;var h={node:w,ping:function(){return zf(g,h)},blockedBoundary:A,blockedSegment:$,abortSet:K,legacyContext:se,context:ge,treeContext:Ae};return h.componentStack=null,K.add(h),h}function Qu(g,w,A,$,K,se){return{status:Jl,id:-1,index:w,parentFlushed:!1,chunks:[],children:[],formatContext:$,boundary:A,lastPushedText:K,textEmbedded:se}}var Ji=null;function Cs(){return Ji===null||Ji.componentStack===null?"":Qc(Ji.componentStack)}function Uo(g,w){g.componentStack={tag:0,parent:g.componentStack,type:w}}function Qi(g,w){g.componentStack={tag:1,parent:g.componentStack,type:w}}function Es(g,w){g.componentStack={tag:2,parent:g.componentStack,type:w}}function _i(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 el(g,w){{var A;typeof w=="string"?A=w:w&&typeof w.message=="string"?A=w.message:A=String(w);var $=Xa||Cs();Xa=null,g.errorMessage=A,g.errorComponentStack=$}}function Ri(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 Wo(g,w){var A=g.onShellError;A(w);var $=g.onFatalError;$(w),g.destination!==null?(g.status=qa,U(g.destination,w)):(g.status=Ql,g.fatalError=w)}function nc(g,w,A){Uo(w,"Suspense");var $=w.blockedBoundary,K=w.blockedSegment,se=A.fallback,ge=A.children,Ae=new Set,h=Ts(g,Ae),b=K.chunks.length,D=Qu(g,b,h,K.formatContext,!1,!1);K.children.push(D),K.lastPushedText=!1;var M=Qu(g,0,null,K.formatContext,!1,!1);M.parentFlushed=!0,w.blockedBoundary=h,w.blockedSegment=M;try{if(fu(g,w,ge),Nr(M.chunks,g.responseState,M.lastPushedText,M.textEmbedded),M.status=Pi,du(h,M),h.pendingTasks===0){_i(w);return}}catch(ie){M.status=Ga,h.forceClientRender=!0,h.errorDigest=Ri(g,ie),el(h,ie)}finally{w.blockedBoundary=$,w.blockedSegment=K}var Y=ou(g,se,$,D,Ae,w.legacyContext,w.context,w.treeContext);Y.componentStack=w.componentStack,g.pingedTasks.push(Y),_i(w)}function Ka(g,w,A,$){Uo(w,A);var K=w.blockedSegment,se=ia(K.chunks,A,$,g.responseState,K.formatContext);K.lastPushedText=!1;var ge=K.formatContext;K.formatContext=ni(ge,A,$),fu(g,w,se),K.formatContext=ge,Lo(K.chunks,A),K.lastPushedText=!1,_i(w)}function au(g){return g.prototype&&g.prototype.isReactComponent}function tl(g,w,A,$,K){var se={};zl(w,se);var ge=A($,K);return va(A,$,ge,K)}function ef(g,w,A,$,K){var se=A.render();A.props!==K&&(ks||i("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",Dn($)||"a component"),ks=!0);{var ge=$.childContextTypes;if(ge!=null){var Ae=w.legacyContext,h=Hl(A,$,Ae,ge);w.legacyContext=h,si(g,w,se),w.legacyContext=Ae;return}}si(g,w,se)}function rc(g,w,A,$){Es(w,A);var K=Vl(A,w.legacyContext),se=wo(A,$,K);Xc(se,A,$,K),ef(g,w,se,A,$),_i(w)}var Gt={},su={},tf={},Za={},ks=!1,ic=!1,oc=!1,oi=!1;function nf(g,w,A,$){var K;if(K=Vl(A,w.legacyContext),Qi(w,A),A.prototype&&typeof A.prototype.render=="function"){var se=Dn(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 ge=tl(g,w,A,$,K),Ae=zr();if(typeof ge=="object"&&ge!==null&&typeof ge.render=="function"&&ge.$$typeof===void 0){var h=Dn(A)||"Unknown";su[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),su[h]=!0)}if(typeof ge=="object"&&ge!==null&&typeof ge.render=="function"&&ge.$$typeof===void 0){{var b=Dn(A)||"Unknown";su[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),su[b]=!0)}Xc(ge,A,$,K),ef(g,w,ge,A,$)}else if(uu(A),Ae){var D=w.treeContext,M=1,Y=0;w.treeContext=zu(D,M,Y);try{si(g,w,ge)}finally{w.treeContext=D}}else si(g,w,ge);_i(w)}function uu(g){{if(g&&g.childContextTypes&&i("%s(...): childContextTypes cannot be defined on a function component.",g.displayName||g.name||"Component"),typeof g.getDerivedStateFromProps=="function"){var w=Dn(g)||"Unknown";Za[w]||(i("%s: Function components do not support getDerivedStateFromProps.",w),Za[w]=!0)}if(typeof g.contextType=="object"&&g.contextType!==null){var A=Dn(g)||"Unknown";tf[A]||(i("%s: Function components do not support contextType.",A),tf[A]=!0)}}}function lu(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 rf(g,w,A,$,K){Qi(w,A.render);var se=tl(g,w,A.render,$,K),ge=zr();if(ge){var Ae=w.treeContext,h=1,b=0;w.treeContext=zu(Ae,h,b);try{si(g,w,se)}finally{w.treeContext=Ae}}else si(g,w,se);_i(w)}function of(g,w,A,$,K){var se=A.type,ge=lu(se,$);nl(g,w,se,ge,K)}function ai(g,w,A,$){A._context===void 0?A!==A.Consumer&&(oi||(oi=!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=Zs(A),ge=K(se);si(g,w,ge)}function ya(g,w,A,$){var K=A._context,se=$.value,ge=$.children,Ae;Ae=w.context,w.context=zc(K,se),si(g,w,ge),w.context=Yc(K),Ae!==w.context&&i("Popping the context provider did not return back to the original snapshot. This is a bug in React.")}function ac(g,w,A,$,K){Uo(w,"Lazy");var se=A._payload,ge=A._init,Ae=ge(se),h=lu(Ae,$);nl(g,w,Ae,h,K),_i(w)}function nl(g,w,A,$,K){if(typeof A=="function")if(au(A)){rc(g,w,A,$);return}else{nf(g,w,A,$);return}if(typeof A=="string"){Ka(g,w,A,$);return}switch(A){case Ln:case Yt:case J:case pe:case ke:{si(g,w,$.children);return}case dt:{Uo(w,"SuspenseList"),si(g,w,$.children),_i(w);return}case kt:throw new Error("ReactDOMServer does not yet support scope components.");case ft:{nc(g,w,$);return}}if(typeof A=="object"&&A!==null)switch(A.$$typeof){case We:{rf(g,w,A,$,K);return}case ut:{of(g,w,A,$,K);return}case de:{ya(g,w,A,$);return}case Be:{ai(g,w,A,$);return}case At:{ac(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 rl(g,w){typeof Symbol=="function"&&g[Symbol.toStringTag]==="Generator"&&(ic||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."),ic=!0),g.entries===w&&(oc||i("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),oc=!0)}function si(g,w,A){try{return cu(g,w,A)}catch($){throw typeof $=="object"&&$!==null&&typeof $.then=="function"||(Xa=Xa!==null?Xa:Cs()),$}}function cu(g,w,A){if(w.node=A,typeof A=="object"&&A!==null){switch(A.$$typeof){case me:{var $=A,K=$.type,se=$.props,ge=$.ref;nl(g,w,K,se,ge);return}case _e: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 At:{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"&&Uo(w,"Lazy"),St}si(g,w,D);return}}if(Ti(A)){sc(g,w,A);return}var M=Gi(A);if(M){rl(A,M);var Y=M.call(A);if(Y){var ie=Y.next();if(!ie.done){var fe=[];do fe.push(ie.value),ie=Y.next();while(!ie.done);sc(g,w,fe);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 Ke=w.blockedSegment;Ke.lastPushedText=Ui(w.blockedSegment.chunks,A,g.responseState,Ke.lastPushedText);return}if(typeof A=="number"){var ht=w.blockedSegment;ht.lastPushedText=Ui(w.blockedSegment.chunks,""+A,g.responseState,ht.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 sc(g,w,A){for(var $=A.length,K=0;K<$;K++){var se=w.treeContext;w.treeContext=zu(se,$,K);try{fu(g,w,A[K])}finally{w.treeContext=se}}}function Yr(g,w,A){var $=w.blockedSegment,K=$.chunks.length,se=Qu(g,K,null,$.formatContext,$.lastPushedText,!0);$.children.push(se),$.lastPushedText=!1;var ge=ou(g,w.node,w.blockedBoundary,se,w.abortSet,w.legacyContext,w.context,w.treeContext);w.componentStack!==null&&(ge.componentStack=w.componentStack.parent);var Ae=ge.ping;A.then(Ae,Ae)}function fu(g,w,A){var $=w.blockedSegment.formatContext,K=w.legacyContext,se=w.context,ge=null;ge=w.componentStack;try{return si(g,w,A)}catch(Ae){if(Yl(),typeof Ae=="object"&&Ae!==null&&typeof Ae.then=="function"){Yr(g,w,Ae),w.blockedSegment.formatContext=$,w.legacyContext=K,w.context=se,Ks(se),w.componentStack=ge;return}else throw w.blockedSegment.formatContext=$,w.legacyContext=K,w.context=se,Ks(se),w.componentStack=ge,Ae}}function zo(g,w,A,$){var K=Ri(g,$);if(w===null?Wo(g,$):(w.pendingTasks--,w.forceClientRender||(w.forceClientRender=!0,w.errorDigest=K,el(w,$),w.parentFlushed&&g.clientRenderedBoundaries.push(w))),g.allPendingTasks--,g.allPendingTasks===0){var se=g.onAllReady;se()}}function Yf(g){var w=this,A=g.blockedBoundary,$=g.blockedSegment;$.status=Ju,uc(w,A,$)}function eo(g,w,A){var $=g.blockedBoundary,K=g.blockedSegment;if(K.status=Ju,$===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 ge="The server did not finish this Suspense boundary: ";se&&typeof se.message=="string"?se=ge+se.message:se=ge+String(se);var Ae=Ji;Ji=g;try{el($,se)}finally{Ji=Ae}}$.parentFlushed&&w.clientRenderedBoundaries.push($)}if($.fallbackAbortableTasks.forEach(function(b){return eo(b,w,A)}),$.fallbackAbortableTasks.clear(),w.allPendingTasks--,w.allPendingTasks===0){var h=w.onAllReady;h()}}}function du(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===Pi&&du(g,A)}else{var $=g.completedSegments;$.push(w)}}function uc(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=So;var $=g.onShellReady;$()}}else if(w.pendingTasks--,!w.forceClientRender){if(w.pendingTasks===0)A.parentFlushed&&A.status===Pi&&du(w,A),w.parentFlushed&&g.completedBoundaries.push(w),w.fallbackAbortableTasks.forEach(Yf,g),w.fallbackAbortableTasks.clear();else if(A.parentFlushed&&A.status===Pi){du(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 il(g,w){var A=w.blockedSegment;if(A.status===Jl){Ks(w.context);var $=null;$=Ji,Ji=w;try{si(g,w,w.node),Nr(A.chunks,g.responseState,A.lastPushedText,A.textEmbedded),w.abortSet.delete(w),A.status=Pi,uc(g,w.blockedBoundary,A)}catch(se){if(Yl(),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,zo(g,w.blockedBoundary,A,se)}finally{Ji=$}}}function hu(g){if(g.status!==qa){var w=$u(),A=ru.current;ru.current=kr;var $;$=xs.getCurrentStack,xs.getCurrentStack=Cs;var K=tu;nu(g.responseState);try{var se=g.pingedTasks,ge;for(ge=0;ge<se.length;ge++){var Ae=se[ge];il(g,Ae)}se.splice(0,ge),g.destination!==null&&vr(g,g.destination)}catch(h){Ri(g,h),Wo(g,h)}finally{nu(K),ru.current=A,xs.getCurrentStack=$,A===kr&&Ks(w)}}}function pu(g,w,A){switch(A.parentFlushed=!0,A.status){case Jl:{var $=A.id=g.nextSegmentId++;return A.lastPushedText=!1,A.textEmbedded=!1,er(w,g.responseState,$)}case Pi:{A.status=iu;for(var K=!0,se=A.chunks,ge=0,Ae=A.children,h=0;h<Ae.length;h++){for(var b=Ae[h];ge<b.index;ge++)p(w,se[ge]);K=ol(g,w,b)}for(;ge<se.length-1;ge++)p(w,se[ge]);return ge<se.length&&(K=S(w,se[ge])),K}default:throw new Error("Aborted, errored or already flushed boundaries should not be flushed again. This is a bug in React.")}}function ol(g,w,A){var $=A.boundary;if($===null)return pu(g,w,A);if($.parentFlushed=!0,$.forceClientRender)return Ye(w,g.responseState,$.errorDigest,$.errorMessage,$.errorComponentStack),pu(g,w,A),It(w,g.responseState);if($.pendingTasks>0){$.rootSegmentID=g.nextSegmentId++,$.completedSegments.length>0&&g.partialBoundaries.push($);var K=$.id=_n(g.responseState);return Ee(w,g.responseState,K),pu(g,w,A),Pt(w,g.responseState)}else{if($.byteSize>g.progressiveChunkSize)return $.rootSegmentID=g.nextSegmentId++,g.completedBoundaries.push($),Ee(w,g.responseState,$.id),pu(g,w,A),Pt(w,g.responseState);Fe(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 ge=se[0];return ol(g,w,ge),ct(w,g.responseState)}}function lc(g,w,A){return Ws(w,g.responseState,A.id,A.errorDigest,A.errorMessage,A.errorComponentStack)}function Os(g,w,A){return Dt(w,g.responseState,A.formatContext,A.id),ol(g,w,A),Ct(w,A.formatContext)}function gu(g,w,A){for(var $=A.completedSegments,K=0;K<$.length;K++){var se=$[K];al(g,w,A,se)}return $.length=0,Yi(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(!al(g,w,A,se))return K++,$.splice(0,K),!1}return $.splice(0,K),!0}function al(g,w,A,$){if($.status===iu)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 Os(g,w,$)}else return Os(g,w,$),Hs(w,g.responseState,K)}function vr(g,w){v();try{var A=g.completedRootSegment;A!==null&&g.pendingRootTasks===0&&(ol(g,w,A),g.completedRootSegment=null,wi(w,g.responseState));var $=g.clientRenderedBoundaries,K;for(K=0;K<$.length;K++){var se=$[K];lc(g,w,se)}$.splice(0,K);var ge=g.completedBoundaries;for(K=0;K<ge.length;K++){var Ae=ge[K];gu(g,w,Ae)}ge.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];gu(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 To(g){s(function(){return hu(g)})}function sf(g,w){if(g.status===Ql){g.status=qa,U(w,g.fatalError);return}if(g.status!==qa&&g.destination===null){g.destination=w;try{vr(g,w)}catch(A){Ri(g,A),Wo(g,A)}}}function sl(g,w){try{var A=g.abortableTasks;A.forEach(function($){return eo($,g,w)}),A.clear(),g.destination!==null&&vr(g,g.destination)}catch($){Ri(g,$),Wo(g,$)}}function ul(g,w){return new Promise(function(A,$){var K,se,ge=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){sl(b)}},{highWaterMark:0});Y.allReady=ge,A(Y)}function h(Y){ge.catch(function(){}),$(Y)}var b=Wf(g,Ar(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(){sl(b,D.reason),D.removeEventListener("abort",M)};D.addEventListener("abort",M)}To(b)})}jh.renderToReadableStream=ul,jh.version=t}()),jh}var Ac,Rm;process.env.NODE_ENV==="production"?(Ac=F5(),Rm=j5()):(Ac=B5(),Rm=$5());Ac.version;var V5=Ac.renderToString;Ac.renderToStaticMarkup;Ac.renderToNodeStream;Ac.renderToStaticNodeStream;Rm.renderToReadableStream;var H5=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oO(e,t){return e(t={exports:{}},t.exports),t.exports}var U5=oO(function(e){(function(t){var n=function(L,I,U){if(!c(I)||v(I)||p(I)||S(I)||l(I))return I;var z,re=0,Z=0;if(d(I))for(z=[],Z=I.length;re<Z;re++)z.push(n(L,I[re],U));else for(var he in z={},I)Object.prototype.hasOwnProperty.call(I,he)&&(z[L(he,U)]=n(L,I[he],U));return z},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,z){var re=(z=z||{}).separator||"_",Z=z.split||/(?=[A-Z])/;return U.split(Z).join(re)}(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]"},S=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(z,re){return U(z,L,re)}},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})(H5)}).decamelize,W5=function(e){if(Array.isArray(e))return e},z5=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}},e1=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},Y5=function(e,t){if(e){if(typeof e=="string")return e1(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)?e1(e,t):void 0}},G5=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.`)},q5=function(e,t){return W5(e)||z5(e,t)||Y5(e,t)||G5()},aO=oO(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}),X5=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},sO=function(e,t){if(e==null)return{};var n,r,i=X5(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},K5=Q.createContext(null);function Im(e){var t=e.children,n=sO(e,["children"]);return typeof t!="string"&&(t=V5(t)),Q.createElement("template",aO({},n,{dangerouslySetInnerHTML:{__html:t}}))}function Am(e){var t=e.root,n=e.children;return S1.createPortal(n,t)}function Z5(e){var t=Q.forwardRef(function(n,r){var i,o,s=n.mode,l=n.delegatesFocus,c=n.styleSheets,d=n.ssr,v=n.children,p=sO(n,["mode","delegatesFocus","styleSheets","ssr","children"]),S=(o=Q.useRef((i=r)&&i.current),Q.useEffect(function(){i&&(i.current=o.current)},[i]),o),T=Q.useState(null),_=q5(T,2),R=_[0],L=_[1],I="node_".concat(s).concat(l);return Q.useLayoutEffect(function(){if(S.current)try{if(typeof r=="function"&&r(S.current),d){var U=S.current.shadowRoot;return void L(U)}var z=S.current.attachShadow({mode:s,delegatesFocus:l});c.length>0&&(z.adoptedStyleSheets=c),L(z)}catch(re){(function(Z){var he=Z.error,x=Z.styleSheets,ce=Z.root;switch(he.name){case"NotSupportedError":x.length>0&&(ce.adoptedStyleSheets=x);break;default:throw he}})({error:re,styleSheets:c,root:R})}},[r,S,c]),Q.createElement(Q.Fragment,null,Q.createElement(e.tag,aO({key:I,ref:S},p),(R||d)&&Q.createElement(K5.Provider,{value:R},d?Q.createElement(Im,{shadowroot:s,shadowrootmode:s},e.render({root:R,ssr:d,children:v})):Q.createElement(Am,{root:R},e.render({root:R,ssr:d,children:v})))))});return t.propTypes={mode:ka.oneOf(["open","closed"]),delegatesFocus:ka.bool,styleSheets:ka.arrayOf(ka.instanceOf(globalThis.CSSStyleSheet)),ssr:ka.bool,children:ka.node},t.defaultProps={mode:"open",delegatesFocus:!1,styleSheets:[],ssr:!1,children:null},t}Im.propTypes={children:ka.oneOfType([ka.string,ka.node])},Im.defaultProps={children:""},Am.propTypes={root:ka.object.isRequired,children:ka.node},Am.defaultProps={children:null};var Cv=new Map;function J5(){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=U5(i,{separator:"-"}),s="".concat(t,"-").concat(o);return Cv.has(s)||Cv.set(s,Z5({tag:o,render:n})),Cv.get(s)}})}var Q5=J5();const e4=e=>{const t=e.isCollapsed?0:e.depth*16;return st.jsx("div",{style:{backgroundColor:e.color||"#93D500",height:"2px",position:"absolute",right:"0",top:"0",left:t}})};function t4(){const e=JSON.parse(localStorage.getItem("menuOpenIds")||"[]");function t(i){localStorage.setItem("menuOpenIds",JSON.stringify(i))}const n=JSON.parse(localStorage.getItem("prevMenuOpenIds")||"[]");function r(){localStorage.setItem("prevMenuOpenIds",localStorage.getItem("menuOpenIds"))}return{menuOpenIds:e,setMenuOpenIds:t,prevMenuOpenIds:n,setPrevMenuOpenIds:r}}const n4=`.app,.treeRoot{height:100%}.draggingSource{opacity:.3}.placeholderContainer{position:relative}.dropTarget{background-color:#8d878711}
141
- `,t1=localStorage.getItem("isCollapsed");function r4(e){window.favoriteMenus=e;const t=new CustomEvent("favoriteMenusChange",{detail:{favoriteMenus:e}});window.dispatchEvent(t)}function i4(e){const t=x1.useLocation(),[n,r]=Q.useState([]),i=n.map(ce=>ce.data),[o,s]=Q.useState(!1);Q.useMemo(()=>{const ce=new Map;return n.forEach(ae=>{ce.set(ae.id,ae)}),ce},[n]);const{menuOpenIds:l,prevMenuOpenIds:c,setMenuOpenIds:d,setPrevMenuOpenIds:v}=t4();console.log("🚀 ~ GlobalMenuContent ~ menuItems:",i);const[p,S]=Q.useState(t1===null?!0:t1==="true"),[T,_]=Q.useState(window.location.href),R=Q.useRef(null);Q.useEffect(()=>{const ce=i.filter(ae=>ae.isFavorite);r4(ce)},[i]),Q.useEffect(()=>{_(window.location.href)},[t]);const L=a4(i,T).filter(ce=>ce.parentKey!==0);console.log("matchPaths:",T,t,L);const I=()=>{var ce,ae;if(p)c&&((ae=R.current)==null||ae.open(c));else{const $e=n.filter(ze=>ze.parent!==0).map(ze=>ze.id);console.log("closeIds:",$e);const et=n.filter(ze=>ze.parent===0).map(ze=>ze.id);v(),(ce=R.current)==null||ce.close($e),setTimeout(()=>{var ze;console.log("openIds:",et),(ze=R.current)==null||ze.open(et)},1)}S(!p),localStorage.setItem("isCollapsed",JSON.stringify(!p))},[U,z]=Q.useState(!1),re=p?"collapsed":"expanded",Z=ce=>`${ce} ${re}`,he=Q.useRef(null);Q.useLayoutEffect(()=>{(async()=>{var ae,$e;try{const et=e.menuPath||"/global-menu-config/api/v1/menu-items/user",ze=e.baseUrl+et,{data:rt}=await Ls.get(ze);let nt=rt.map(De=>({...De,parentKey:De.parentKey||0}));nt=lO(nt),e.replacePath&&(nt=uO(nt,e.replacePath));const ye=nt.map(De=>({id:De.id,parent:De.parentKey,text:De.name,data:De}));r(ye)}catch(et){console.error(et),Rp((($e=(ae=et.response)==null?void 0:ae.data)==null?void 0:$e.errorMessage)||"Have error when get menu items")}})()},[e.baseUrl,e.menuPath,e.replacePath]),Q.useLayoutEffect(()=>{var et;const ce=localStorage.getItem("scrollPos");ce&&he.current&&setTimeout(()=>{const ze=he.current.getScrollElement();ze.scrollTop=parseInt(ce)},0);const ae=()=>{if(he.current){const ze=he.current.getScrollElement();localStorage.setItem("scrollPos",ze.scrollTop.toString())}},$e=(et=he.current)==null?void 0:et.getScrollElement();return $e==null||$e.addEventListener("scroll",ae),()=>{$e==null||$e.removeEventListener("scroll",ae)}},[i]);function x(ce){s(!0);const ae=[...n];r(ce);const $e=ce.map((et,ze)=>({menuItemId:et.id,order:ze}));Ls.post("/global-menu-config/api/v1/menu-items/user",$e,{baseURL:e.baseUrl}).then(()=>{}).catch(et=>{console.error(et),r(ae),s(!1)})}return st.jsxs("div",{className:Z("side-bar"),children:[st.jsx("div",{className:Z("wrap-section side-bar__wrapper-toggle-btn"),children:st.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:I,children:p?st.jsx(M5,{}):st.jsx(A5,{})})}),st.jsx(fT,{ref:he,className:Z("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:st.jsx(tz,{backend:Hz,options:c5(),children:st.jsx(_5,{ref:R,classes:{root:"treeRoot",draggingSource:"draggingSource",placeholder:"placeholderContainer"},tree:n,rootId:0,sort:!1,insertDroppableFirst:!1,enableAnimateExpand:!0,dropTargetOffset:10,onDrop:x,render:(ce,ae)=>{function $e(nt){return n.every(ye=>ye.parent!==nt.id)?nt:{...nt,children:n.filter(ye=>ye.parent===nt.id).map(ye=>$e(ye.data))}}const et=$e(ce.data),ze=nt=>L.some(ye=>ye.id===nt);function rt(nt,ye){r(De=>De.map(He=>He.id===nt?{...He,data:{...He.data,isFavorite:ye}}:He))}return st.jsx(iO,{isActive:ze,isCollapsed:p,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,node:ce,params:ae,nodes:n,item:et,expanded:()=>!1,toggleExpand:()=>{},level:ae.depth,onSetFavoriteSuccess:rt})},placeholderRender:(ce,{depth:ae})=>{var $e;return st.jsx(e4,{node:ce,depth:ae,color:($e=e.brandColors)==null?void 0:$e.primary300,isCollapsed:p})},canDrag:ce=>!o&&!!(ce!=null&&ce.parent),canDrop:(ce,{dragSource:ae,dropTargetId:$e,dropTarget:et})=>(console.log("dragSource",ae,et),!((ae==null?void 0:ae.parent)!==0&&$e===0||(ae==null?void 0:ae.parent)===0&&$e!==0||(et==null?void 0:et.id)!==(ae==null?void 0:ae.parent)||s4(ce,ae==null?void 0:ae.id,$e))),onDragStart:ce=>{console.log("onDragStart",ce)},onChangeOpen:ce=>{console.log("onChangeOpen:",ce),d(ce)},initialOpen:l.length?l:[1]})})}),st.jsxs("div",{className:Z("wrap-section side-bar__wrap-btn-logout"),children:[st.jsxs("button",{className:Z("side-bar__logout-btn"),onClick:()=>z(!0),children:[st.jsx(L5,{className:Z("side-bar__icon-logout")}),st.jsx("span",{className:Z("side-bar__logout-btn__text"),children:"Logout"})]}),st.jsx(T1,{isOpen:U,onClose:()=>z(!1),onConfirm:()=>e.logout?e.logout():A1(e.baseUrl)})]})]})}function o4(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 a4(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:o4(t,d.path)})).sort((d,v)=>{const p=new URL(d.itemUrl).searchParams,S=new URL(v.itemUrl).searchParams;return Array.from(p).length-Array.from(S).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 uO(e,t){return e.map(n=>{var r;return(r=n.children)!=null&&r.length?(n.path="",n.children=uO(n.children,t)):n.path=t(n.path),n})}function lO(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=lO(n.children)),n))}function n1(e,t){return e.find(n=>n.id===t)}function s4(e,t,n){let r=n1(e,n);for(;r;){if(r.id===t)return!0;r=n1(e,r.parent)}return!1}function u4(e){return st.jsx(Q5.div,{children:st.jsx($1,{styles:[hL,N5,n4],style:{position:"sticky",zIndex:20},children:st.jsx(i4,{...e})})})}const l4={"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 Tp={exports:{}};/**
141
+ `,t1=localStorage.getItem("isCollapsed");function r4(e){window.favoriteMenus=e;const t=new CustomEvent("favoriteMenusChange",{detail:{favoriteMenus:e}});window.dispatchEvent(t)}function i4(e){const t=x1.useLocation(),[n,r]=Q.useState([]),i=n.map(ce=>ce.data),[o,s]=Q.useState(!1);console.log("isSubmitting:",o),Q.useMemo(()=>{const ce=new Map;return n.forEach(ae=>{ce.set(ae.id,ae)}),ce},[n]);const{menuOpenIds:l,prevMenuOpenIds:c,setMenuOpenIds:d,setPrevMenuOpenIds:v}=t4();console.log("🚀 ~ GlobalMenuContent ~ menuItems:",i);const[p,S]=Q.useState(t1===null?!0:t1==="true"),[T,_]=Q.useState(window.location.href),R=Q.useRef(null);Q.useEffect(()=>{const ce=i.filter(ae=>ae.isFavorite);r4(ce)},[i]),Q.useEffect(()=>{var ce;(ce=e.handleCallback)==null||ce.call(e,i)},[i,e.handleCallback]),Q.useEffect(()=>{_(window.location.href)},[t]);const L=a4(i,T).filter(ce=>ce.parentKey!==0);console.log("matchPaths:",T,t,L);const I=()=>{var ce,ae;if(p)c&&((ae=R.current)==null||ae.open(c));else{const $e=n.filter(ze=>ze.parent!==0).map(ze=>ze.id);console.log("closeIds:",$e);const et=n.filter(ze=>ze.parent===0).map(ze=>ze.id);v(),(ce=R.current)==null||ce.close($e),setTimeout(()=>{var ze;console.log("openIds:",et),(ze=R.current)==null||ze.open(et)},1)}S(!p),localStorage.setItem("isCollapsed",JSON.stringify(!p))},[U,z]=Q.useState(!1),re=p?"collapsed":"expanded",Z=ce=>`${ce} ${re}`,he=Q.useRef(null);Q.useLayoutEffect(()=>{(async()=>{var ae,$e;try{const et=e.menuPath||"/global-menu-config/api/v1/menu-items/user",ze=e.baseUrl+et,{data:rt}=await Ls.get(ze);let nt=rt.map(De=>({...De,parentKey:De.parentKey||0}));nt=lO(nt),e.replacePath&&(nt=uO(nt,e.replacePath));const ye=nt.map(De=>({id:De.id,parent:De.parentKey,text:De.name,data:De}));r(ye)}catch(et){console.error(et),Rp((($e=(ae=et.response)==null?void 0:ae.data)==null?void 0:$e.errorMessage)||"Have error when get menu items")}})()},[e.baseUrl,e.menuPath,e.replacePath]),Q.useLayoutEffect(()=>{var et;const ce=localStorage.getItem("scrollPos");ce&&he.current&&setTimeout(()=>{const ze=he.current.getScrollElement();ze.scrollTop=parseInt(ce)},0);const ae=()=>{if(he.current){const ze=he.current.getScrollElement();localStorage.setItem("scrollPos",ze.scrollTop.toString())}},$e=(et=he.current)==null?void 0:et.getScrollElement();return $e==null||$e.addEventListener("scroll",ae),()=>{$e==null||$e.removeEventListener("scroll",ae)}},[i]);function x(ce){s(!0);const ae=[...n];r(ce);const $e=ce.map((et,ze)=>({menuItemId:et.id,order:ze}));Ls.post("/global-menu-config/api/v1/menu-items/user",$e,{baseURL:e.baseUrl}).then(()=>{}).catch(et=>{console.error(et),r(ae)}).finally(()=>{s(!1)})}return st.jsxs("div",{className:Z("side-bar"),children:[st.jsx("div",{className:Z("wrap-section side-bar__wrapper-toggle-btn"),children:st.jsx("button",{className:"icon-btn side-bar__toggle-btn",onClick:I,children:p?st.jsx(M5,{}):st.jsx(A5,{})})}),st.jsx(fT,{ref:he,className:Z("wrap-section side-bar__menu"),style:{marginTop:24,flex:1,overflow:"auto",height:"100%",overflowX:"hidden"},children:st.jsx(tz,{backend:Hz,options:c5(),children:st.jsx(_5,{ref:R,classes:{root:"treeRoot",draggingSource:"draggingSource",placeholder:"placeholderContainer"},tree:n,rootId:0,sort:!1,insertDroppableFirst:!1,enableAnimateExpand:!0,dropTargetOffset:10,onDrop:x,render:(ce,ae)=>{function $e(nt){return n.every(ye=>ye.parent!==nt.id)?nt:{...nt,children:n.filter(ye=>ye.parent===nt.id).map(ye=>$e(ye.data))}}const et=$e(ce.data),ze=nt=>L.some(ye=>ye.id===nt);function rt(nt,ye){r(De=>De.map(He=>He.id===nt?{...He,data:{...He.data,isFavorite:ye}}:He))}return st.jsx(iO,{isActive:ze,isCollapsed:p,replacePath:e.replacePath,ssr:e.ssr,brandColors:e.brandColors,baseUrl:e.baseUrl,node:ce,params:ae,nodes:n,item:et,expanded:()=>!1,toggleExpand:()=>{},level:ae.depth,onSetFavoriteSuccess:rt})},placeholderRender:(ce,{depth:ae})=>{var $e;return st.jsx(e4,{node:ce,depth:ae,color:($e=e.brandColors)==null?void 0:$e.primary300,isCollapsed:p})},canDrag:ce=>!o&&!!(ce!=null&&ce.parent),canDrop:(ce,{dragSource:ae,dropTargetId:$e,dropTarget:et})=>(console.log("dragSource",ae,et),!((ae==null?void 0:ae.parent)!==0&&$e===0||(ae==null?void 0:ae.parent)===0&&$e!==0||(et==null?void 0:et.id)!==(ae==null?void 0:ae.parent)||s4(ce,ae==null?void 0:ae.id,$e))),onDragStart:ce=>{console.log("onDragStart",ce)},onChangeOpen:ce=>{console.log("onChangeOpen:",ce),d(ce)},initialOpen:l.length?l:[1]})})}),st.jsxs("div",{className:Z("wrap-section side-bar__wrap-btn-logout"),children:[st.jsxs("button",{className:Z("side-bar__logout-btn"),onClick:()=>z(!0),children:[st.jsx(L5,{className:Z("side-bar__icon-logout")}),st.jsx("span",{className:Z("side-bar__logout-btn__text"),children:"Logout"})]}),st.jsx(T1,{isOpen:U,onClose:()=>z(!1),onConfirm:()=>e.logout?e.logout():A1(e.baseUrl)})]})]})}function o4(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 a4(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:o4(t,d.path)})).sort((d,v)=>{const p=new URL(d.itemUrl).searchParams,S=new URL(v.itemUrl).searchParams;return Array.from(p).length-Array.from(S).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 uO(e,t){return e.map(n=>{var r;return(r=n.children)!=null&&r.length?(n.path="",n.children=uO(n.children,t)):n.path=t(n.path),n})}function lO(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=lO(n.children)),n))}function n1(e,t){return e.find(n=>n.id===t)}function s4(e,t,n){let r=n1(e,n);for(;r;){if(r.id===t)return!0;r=n1(e,r.parent)}return!1}function u4(e){return st.jsx(Q5.div,{children:st.jsx($1,{styles:[hL,N5,n4],style:{position:"sticky",zIndex:20},children:st.jsx(i4,{...e})})})}const l4={"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 Tp={exports:{}};/**
142
142
  * @license
143
143
  * Lodash <https://lodash.com/>
144
144
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-623b0381.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=s=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${s}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(r=>o(r.data)).catch(r=>{console.error("Getting user permission error:",r)})},[s]),t},a=s=>(t,o)=>{const r=c(s);return o?t.every(n=>r==null?void 0:r.includes(n)):t.some(n=>r==null?void 0:r.includes(n))},h=({baseUrl:s,accessWith:t,requireAll:o,children:r})=>a(s)(t,o)?i.jsx(i.Fragment,{children:r}):null,P=({accessWith:s,requireAll:t,baseUrl:o,unAuthorizedPath:r,children:n})=>a(o)(s,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:r,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.translate=e.translate;exports.translationConfig=e.translationConfig;exports.useAuth=e.useAuth;exports.useCustomTranslation=e.useCustomTranslation;exports.useTheme=e.useTheme;exports.useTranslation=e.useTranslation$1;exports.HasPermission=h;exports.PermissionRoute=P;exports.getUseHasPermission=a;exports.useGetPermission=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index.module-8e124b28.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=s=>{const[t,o]=u.useState([]);return u.useEffect(()=>{m.get(`${s}/user-management/api/v1/users/my-account/permissions`,{withCredentials:!0}).then(r=>o(r.data)).catch(r=>{console.error("Getting user permission error:",r)})},[s]),t},a=s=>(t,o)=>{const r=c(s);return o?t.every(n=>r==null?void 0:r.includes(n)):t.some(n=>r==null?void 0:r.includes(n))},h=({baseUrl:s,accessWith:t,requireAll:o,children:r})=>a(s)(t,o)?i.jsx(i.Fragment,{children:r}):null,P=({accessWith:s,requireAll:t,baseUrl:o,unAuthorizedPath:r,children:n})=>a(o)(s,t)?i.jsx(i.Fragment,{children:n}):i.jsx(l.Navigate,{to:r,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.translate=e.translate;exports.translationConfig=e.translationConfig;exports.useAuth=e.useAuth;exports.useCustomTranslation=e.useCustomTranslation;exports.useTheme=e.useTheme;exports.useTranslation=e.useTranslation$1;exports.HasPermission=h;exports.PermissionRoute=P;exports.getUseHasPermission=a;exports.useGetPermission=c;
@@ -1,4 +1,4 @@
1
- import { J as R, K as S, M as G, Z as y, X as H, a as I, c as M, Y as N, R as O, N as j, O as w, T as F, t as J, V as K, U, u as V, e as X, g as Y, W as Z } from "../index.module-011cabd9.js";
1
+ import { J as R, K as S, M as G, Z as y, X as H, a as I, c as M, Y as N, R as O, N as j, O as w, T as F, t as J, V as K, U, u as V, e as X, g as Y, W as Z } from "../index.module-6d5f3127.js";
2
2
  import u from "axios";
3
3
  import { useState as m, useEffect as c } from "react";
4
4
  import { jsx as a, Fragment as n } from "react/jsx-runtime";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ukpc-lib/react",
3
3
  "private": false,
4
- "version": "0.5.2",
4
+ "version": "0.5.4",
5
5
  "type": "module",
6
6
  "main": "./dist/",
7
7
  "module": "./dist/",
@@ -1,5 +1,5 @@
1
1
  import "../index-d9f68aa9.js";
2
- import { G as e } from "../index-85ced7a8.js";
2
+ import { G as e } from "../index-c32061d1.js";
3
3
  export {
4
4
  e as GlobalMenu
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import "../index-d9f68aa9.js";
2
- import { T as a } from "../index-85ced7a8.js";
2
+ import { T as a } from "../index-c32061d1.js";
3
3
  export {
4
4
  a as TopBar
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import "../index-d9f68aa9.js";
2
- import { H as o, g as r } from "../index-85ced7a8.js";
2
+ import { H as o, g as r } from "../index-c32061d1.js";
3
3
  export {
4
4
  o as HasPermission,
5
5
  r as getUseHasPermission
@@ -40953,7 +40953,7 @@ function Pge(e) {
40953
40953
  }
40954
40954
  function kge(e) {
40955
40955
  const t = iv(), [n, r] = k.useState([]), i = n.map((q) => q.data), [o, s] = k.useState(!1);
40956
- k.useMemo(() => {
40956
+ console.log("isSubmitting:", o), k.useMemo(() => {
40957
40957
  const q = /* @__PURE__ */ new Map();
40958
40958
  return n.forEach((H) => {
40959
40959
  q.set(H.id, H);
@@ -40968,6 +40968,9 @@ function kge(e) {
40968
40968
  const q = i.filter((H) => H.isFavorite);
40969
40969
  Pge(q);
40970
40970
  }, [i]), k.useEffect(() => {
40971
+ var q;
40972
+ (q = e.handleCallback) == null || q.call(e, i);
40973
+ }, [i, e.handleCallback]), k.useEffect(() => {
40971
40974
  x(window.location.href);
40972
40975
  }, [t]);
40973
40976
  const _ = Age(i, b).filter(
@@ -41041,7 +41044,9 @@ function kge(e) {
41041
41044
  baseURL: e.baseUrl
41042
41045
  }).then(() => {
41043
41046
  }).catch((se) => {
41044
- console.error(se), r(H), s(!1);
41047
+ console.error(se), r(H);
41048
+ }).finally(() => {
41049
+ s(!1);
41045
41050
  });
41046
41051
  }
41047
41052
  return /* @__PURE__ */ W.jsxs("div", { className: F("side-bar"), children: [