adminizer 4.3.0-build.75 → 4.3.0-build.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/add-CCznNk7p.js +1 -0
- package/assets/add-form-Cujvebyq.js +1 -0
- package/assets/add-group-KxM-aCt4.js +1 -0
- package/assets/add-group-form-BrDR-i0l.js +1 -0
- package/assets/add-user-form-CrfboTix.js +1 -0
- package/assets/add-user-uiWxY8Il.js +1 -0
- package/assets/app-layout-DlouPwk2.js +1 -0
- package/assets/{app-shell-CByYJPLe.js → app-shell-B969C0PB.js} +1 -1
- package/assets/app-sidebar-DBaEEAgj.js +1 -0
- package/assets/app-sidebar-header-DAKTYE0g.js +1 -0
- package/assets/app.js +5817 -1629
- package/assets/breadcrumbs-DHQ3AkEO.js +1 -0
- package/assets/{catalog-BEnuFPi6.js → catalog-Dt5pVGyH.js} +3 -3
- package/assets/{dashboard-Cb4RAfgr.js → dashboard-SxHpjYT5.js} +2 -2
- package/assets/date-picker--zSt9NKp.js +1 -0
- package/assets/del-modal-B73-X7Bm.js +1 -0
- package/assets/{field-renderer-CrsFaZNM.js → field-renderer-BP9UmRzN.js} +3 -3
- package/assets/form-NLJGRnF1.js +1 -0
- package/assets/form-lSJpGHTy.js +1 -0
- package/assets/{geo-json-Dswzlx0K.js → geo-json-Dq8ViYH4.js} +1 -1
- package/assets/home-C5a2kMDP.js +2 -0
- package/assets/icon-BbhNOU2o.js +1 -0
- package/assets/init-user--zYviDj5.js +1 -0
- package/assets/{input-error-BBzQCTcg.js → input-error-1aQ9bwyz.js} +1 -1
- package/assets/list-D-3gH3Qy.js +1 -0
- package/assets/{list-table-DMJKIWta.js → list-table-D6PqwSh1.js} +1 -1
- package/assets/login-BQhUl8bB.js +1 -0
- package/assets/manifest.json +97 -204
- package/assets/{material-icon-BE8cT_z7.js → material-icon-8nTeT-mJ.js} +1 -1
- package/assets/{media-manager-DWLUhFyJ.js → media-manager-D1nqMyHv.js} +3 -3
- package/assets/module-DvUc6HiL.js +1 -0
- package/assets/nav-footer-xpg-_O5z.js +1 -0
- package/assets/nav-main-FLS_mh3K.js +1 -0
- package/assets/nav-user-CfXR0Kcu.js +1 -0
- package/assets/notification-DsrY4egH.js +1 -0
- package/assets/{pagination-render-PLbPRWg5.js → pagination-render-rZ5_6g0n.js} +1 -1
- package/assets/register-DQ_hsYCS.js +1 -0
- package/assets/{tabs-D5eQoog9.js → tabs-DD2mZktY.js} +1 -1
- package/assets/theme-switcher-BKpJx2Op.js +1 -0
- package/assets/{toast-editor-C0550yms.js → toast-editor-CexR_aza.js} +4 -4
- package/assets/{user-info-CJp_GYZl.js → user-info-obJxhBMF.js} +1 -1
- package/assets/user-menu-content-Bs0bmqDB.js +1 -0
- package/assets/welcome-DOcJbFZS.js +1 -0
- package/package.json +1 -1
- package/assets/VanillaJSONEditor-x8tDbio1.js +0 -3833
- package/assets/add-B-wtzl14.js +0 -1
- package/assets/add-form-BlPl0S7W.js +0 -1
- package/assets/add-group-CGiSK3je.js +0 -1
- package/assets/add-group-form-Chb9XkVr.js +0 -1
- package/assets/add-user-CI91aShE.js +0 -1
- package/assets/add-user-form-CpszaZtW.js +0 -1
- package/assets/app-layout-CDjEwM9a.js +0 -1
- package/assets/app-sidebar-CLPoDV2f.js +0 -1
- package/assets/app-sidebar-header-B1mI-oGm.js +0 -1
- package/assets/breadcrumbs-0GLBx1iv.js +0 -1
- package/assets/date-picker-Gy19IF7Q.js +0 -1
- package/assets/debounce-D6eaSoDg.js +0 -1
- package/assets/del-modal-COG1XcES.js +0 -1
- package/assets/form-BwafUUB7.js +0 -1
- package/assets/form-X67d3x3D.js +0 -1
- package/assets/form-state-702tb_BV.js +0 -1
- package/assets/handsontable-DQYtlTE2.js +0 -347
- package/assets/home-DlxjWnrt.js +0 -2
- package/assets/icon-BWrEqTE-.js +0 -1
- package/assets/index-C148XJoK.js +0 -1
- package/assets/index-Vcq4gwWv.js +0 -1
- package/assets/init-user-DKSIGCcH.js +0 -1
- package/assets/list-CjOxUyML.js +0 -1
- package/assets/login-5G-1gzoH.js +0 -1
- package/assets/module-9RNagTns.js +0 -1
- package/assets/monaco-editor-XX8Hz76f.js +0 -11
- package/assets/multi-select-BnR59_kI.js +0 -1
- package/assets/nav-footer-Dq1Z6Fmw.js +0 -1
- package/assets/nav-main-DQNNAKwu.js +0 -1
- package/assets/nav-user-q7QW6ZiI.js +0 -1
- package/assets/notification-CIUVTHsw.js +0 -1
- package/assets/register-48nlLgHz.js +0 -1
- package/assets/theme-switcher-BZ6eg-WU.js +0 -1
- package/assets/use-appearance-CXP5cHaQ.js +0 -1
- package/assets/use-window-size-DLSEoR6e.js +0 -1
- package/assets/user-menu-content-ljwR9luU.js +0 -1
- package/assets/welcome-CBKz_MRJ.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as p,q as i,j as m}from"./app.js";import{A as s}from"./app-layout-DlouPwk2.js";import e from"./add-form-Cujvebyq.js";import"./app-shell-B969C0PB.js";import"./app-sidebar-DBaEEAgj.js";import"./nav-main-FLS_mh3K.js";import"./material-icon-8nTeT-mJ.js";import"./app-sidebar-header-DAKTYE0g.js";import"./breadcrumbs-DHQ3AkEO.js";import"./nav-user-CfXR0Kcu.js";import"./user-info-obJxhBMF.js";import"./user-menu-content-Bs0bmqDB.js";import"./theme-switcher-BKpJx2Op.js";import"./icon-BbhNOU2o.js";import"./field-renderer-BP9UmRzN.js";import"./dynamic-controls-CSVVCONh.js";import"./input-error-1aQ9bwyz.js";const a=[];function L(){const t=p.c(2),r=i();let o;return t[0]!==r?(o=m.jsx(s,{breadcrumbs:a,children:m.jsx(e,{page:r,catalog:!1})}),t[0]=r,t[1]=o):o=t[1],o}export{L as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as f,c as L,j as t,b as O,V as z,W as A,X as M,aQ as D,Y as J,a3 as U,bI as S,B as E,a1 as K,aP as Q,bJ as R,L as $,bK as k,f as X,i as Y,s as q}from"./app.js";import{Icon as P}from"./icon-BbhNOU2o.js";import{F as V}from"./field-renderer-BP9UmRzN.js";import I from"./input-error-1aQ9bwyz.js";import"./dynamic-controls-CSVVCONh.js";var F=new Map,C=new WeakMap,T=0,G=void 0;function H(s){return s?(C.has(s)||(T+=1,C.set(s,T.toString())),C.get(s)):"0"}function W(s){return Object.keys(s).sort().filter(e=>s[e]!==void 0).map(e=>`${e}_${e==="root"?H(s.root):s[e]}`).toString()}function Z(s){const e=W(s);let n=F.get(e);if(!n){const c=new Map;let l;const i=new IntersectionObserver(o=>{o.forEach(a=>{var d;const m=a.isIntersecting&&l.some(u=>a.intersectionRatio>=u);s.trackVisibility&&typeof a.isVisible>"u"&&(a.isVisible=m),(d=c.get(a.target))==null||d.forEach(u=>{u(m,a)})})},s);l=i.thresholds||(Array.isArray(s.threshold)?s.threshold:[s.threshold||0]),n={id:e,observer:i,elements:c},F.set(e,n)}return n}function _(s,e,n={},c=G){if(typeof window.IntersectionObserver>"u"&&c!==void 0){const d=s.getBoundingClientRect();return e(c,{isIntersecting:c,target:s,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:d,intersectionRect:d,rootBounds:d}),()=>{}}const{id:l,observer:i,elements:o}=Z(n),a=o.get(s)||[];return o.has(s)||o.set(s,a),a.push(e),i.observe(s),function(){a.splice(a.indexOf(e),1),a.length===0&&(o.delete(s),i.unobserve(s)),o.size===0&&(i.disconnect(),F.delete(l))}}function ee({threshold:s,delay:e,trackVisibility:n,rootMargin:c,root:l,triggerOnce:i,skip:o,initialInView:a,fallbackInView:d,onChange:m}={}){var u;const[p,j]=f.useState(null),h=f.useRef(m),[x,N]=f.useState({inView:!!a,entry:void 0});h.current=m,f.useEffect(()=>{if(o||!p)return;let b;return b=_(p,(r,g)=>{N({inView:r,entry:g}),h.current&&h.current(r,g),g.isIntersecting&&i&&b&&(b(),b=void 0)},{root:l,rootMargin:c,threshold:s,trackVisibility:n,delay:e},d),()=>{b&&b()}},[Array.isArray(s)?s.toString():s,p,l,c,i,o,n,d,e]);const w=(u=x.entry)==null?void 0:u.target,y=f.useRef(void 0);!p&&w&&!i&&!o&&y.current!==w&&(y.current=w,N({inView:!!a,entry:void 0}));const v=[j,x.inView,x.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}const B=f.memo(s=>{const e=L.c(8),{field:n}=s,c=`${n.type}-${n.name}`;let l;e[0]!==n.label||e[1]!==c?(l=t.jsx(O,{htmlFor:c,children:n.label}),e[0]=n.label,e[1]=c,e[2]=l):l=e[2];let i;e[3]!==n.tooltip?(i=n.tooltip&&t.jsx(z,{children:t.jsxs(A,{children:[t.jsx(M,{onClick:te,children:t.jsx(P,{iconNode:D,className:"text-primary w-5 h-5 cursor-pointer"})}),t.jsx(J,{align:"center",side:"top",className:"z-[1002]",children:t.jsx("p",{children:n.tooltip})})]})}),e[3]=n.tooltip,e[4]=i):i=e[4];let o;return e[5]!==l||e[6]!==i?(o=t.jsxs("div",{className:"flex gap-3",children:[l,i]}),e[5]=l,e[6]=i,e[7]=o):o=e[7],o}),se=f.memo(s=>{const e=L.c(12),{field:n,value:c,onChange:l,processing:i,notFound:o,search:a}=s;let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={triggerOnce:!0,rootMargin:"100px 0px"},e[0]=d):d=e[0];const[m,u]=ee(d);let p;e[1]!==n||e[2]!==u||e[3]!==o||e[4]!==l||e[5]!==i||e[6]!==a||e[7]!==c?(p=u?t.jsx(V,{field:n,value:c,onChange:l,notFound:o,search:a,processing:i}):t.jsx(q,{className:"w-full h-[250px] rounded-sm"}),e[1]=n,e[2]=u,e[3]=o,e[4]=l,e[5]=i,e[6]=a,e[7]=c,e[8]=p):p=e[8];let j;return e[9]!==m||e[10]!==p?(j=t.jsx("div",{ref:m,className:"grid gap-4 w-full",children:p}),e[9]=m,e[10]=p,e[11]=j):j=e[11],j}),ce=({page:s,catalog:e,callback:n,openNewWindow:c,openNewWindowLabel:l,isNavigation:i})=>{const{fields:o,btnBack:a,view:d,notFound:m}=s.props,{data:u,setData:p,post:j,processing:h}=U({...Object.fromEntries(o.map(r=>[r.name,r.value??void 0])),jsonPopupCatalog:e}),[x,N]=f.useState(!1),[w,y]=f.useState(c??!1);f.useEffect(()=>(y(c??!1),S(),p({...Object.fromEntries(o.map(r=>[r.name,r.value??void 0])),jsonPopupCatalog:e}),()=>S()),[o,e,c]);const v=f.useCallback((r,g)=>{p(r,g)},[]),b=async r=>{if(r.preventDefault(),e){N(!0);const g=await Y.post(s.props.postLink,u);g.status===200&&n&&(i?n(g.data.record,w):n(g.data.record))}else j(s.props.postLink)};return t.jsxs("div",{className:"p-4 w-full",children:[!e&&t.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[t.jsx(E,{className:"w-fit",asChild:!0,children:t.jsxs(K,{href:a.link,preserveScroll:!0,children:[t.jsx(P,{iconNode:Q}),a.title]})}),t.jsxs(E,{variant:"green",type:"submit",className:"w-fit lg:hidden",form:"addUserForm",disabled:x||h||s.props.view||R(),children:[x||h&&t.jsx($,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]})]}),t.jsx("form",{id:"addUserForm",onSubmit:b,className:d?"cursor-not-allowed":"",children:t.jsxs("div",{className:`grid lg:grid-cols-[1fr_150px] gap-4 max-w-[1144px] pb-8 ${e?"lg:grid-cols-[1fr_200px]":"lg:grid-cols-[1fr_150px]"}`,children:[t.jsx("div",{className:"flex flex-col gap-10",children:o.map(r=>t.jsx("div",{className:`grid gap-4 w-full ${d?"pointer-events-none":""}`,children:r.type==="markdown"||r.type==="table"||r.type==="jsonEditor"||r.type==="codeEditor"||r.type==="geoJson"?t.jsxs(t.Fragment,{children:[t.jsx(B,{field:r}),t.jsx(I,{message:k(`${r.type}-${r.name}`)}),t.jsx(se,{field:r,value:u[r.name],onChange:v,processing:x||h||d,notFound:m,search:s.props.search})]}):t.jsxs(t.Fragment,{children:[t.jsx(B,{field:r}),t.jsx(I,{message:k(`${r.type}-${r.name}`)}),t.jsx(V,{field:r,value:u[r.name],onChange:v,processing:x||h||d,notFound:m,search:s.props.search})]})},r.name))}),t.jsxs("div",{className:`p-4 rounded-md h-fit sticky shadow ${e?"top-0 grid gap-4":"top-[84px] hidden lg:block"}`,children:[i&&t.jsxs("div",{className:"flex gap-4 items-center",children:[t.jsx(X,{id:"targetBlank",checked:w,onCheckedChange:r=>y(!!r),className:"cursor-pointer size-5"}),t.jsx(O,{htmlFor:"targetBlank",children:l})]}),t.jsxs(E,{variant:"green",type:"submit",className:"w-fit",disabled:x||h||s.props.view||R(),children:[(x||h)&&t.jsx($,{className:"h-4 w-4 animate-spin"}),s.props.btnSave.title]})]})]})})]})};function te(s){return s.preventDefault()}export{B as LabelRenderer,se as LazyField,ce as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as m,j as t}from"./app.js";import{A as p}from"./app-layout-DlouPwk2.js";import i from"./add-group-form-BrDR-i0l.js";import"./app-shell-B969C0PB.js";import"./app-sidebar-DBaEEAgj.js";import"./nav-main-FLS_mh3K.js";import"./material-icon-8nTeT-mJ.js";import"./app-sidebar-header-DAKTYE0g.js";import"./breadcrumbs-DHQ3AkEO.js";import"./nav-user-CfXR0Kcu.js";import"./user-info-obJxhBMF.js";import"./user-menu-content-Bs0bmqDB.js";import"./theme-switcher-BKpJx2Op.js";import"./icon-BbhNOU2o.js";const e=[];function E(){const r=m.c(1);let o;return r[0]===Symbol.for("react.memo_cache_sentinel")?(o=t.jsx(p,{breadcrumbs:e,children:t.jsx(i,{})}),r[0]=o):o=r[0],o}export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as D,a3 as q,r as L,j as s,B as y,a1 as O,aP as S,L as z,b as j,I as E,c as M,f as P,V as R,W as U,X as $,aQ as A,Y as G}from"./app.js";import{Icon as B}from"./icon-BbhNOU2o.js";const I=L.memo(t=>{const e=M.c(20),{field:l,disabled:h,value:c,onCheckedChange:u,tooltip:f}=t;let x;e[0]!==l.name||e[1]!==u?(x=g=>{u(l.name,g)},e[0]=l.name,e[1]=u,e[2]=x):x=e[2];const o=x;let n;e[3]!==h||e[4]!==l.name||e[5]!==o||e[6]!==c?(n=s.jsx(P,{id:l.name,className:"cursor-pointer size-5",disabled:h,checked:c,onCheckedChange:o}),e[3]=h,e[4]=l.name,e[5]=o,e[6]=c,e[7]=n):n=e[7];let r;e[8]!==l.label||e[9]!==l.name?(r=s.jsx(j,{className:"cursor-pointer",htmlFor:l.name,children:l.label}),e[8]=l.label,e[9]=l.name,e[10]=r):r=e[10];let p;e[11]!==l.tooltip||e[12]!==f?(p=f&&s.jsx(R,{children:s.jsxs(U,{children:[s.jsx($,{onClick:H,children:s.jsx(B,{iconNode:A,className:"text-primary w-5 h-5 cursor-pointer"})}),s.jsx(G,{align:"center",side:"top",children:s.jsx("p",{children:l.tooltip})})]})}),e[11]=l.tooltip,e[12]=f,e[13]=p):p=e[13];let d;e[14]!==r||e[15]!==p?(d=s.jsxs("div",{className:"flex gap-3",children:[r,p]}),e[14]=r,e[15]=p,e[16]=d):d=e[16];let m;return e[17]!==n||e[18]!==d?(m=s.jsxs("div",{className:"flex gap-3 items-center",children:[n,d]}),e[17]=n,e[18]=d,e[19]=m):m=e[19],m});function V(){var d,m,g,b,v,C,N,k,w,F,T;const t=D(),{fields:e,groupedTokens:l,users:h}=t.props,{data:c,setData:u,clearErrors:f,post:x,processing:o}=q({...Object.fromEntries(e.map(a=>[a.name,a.value])),...Object.fromEntries(h.map(a=>[a.name,a.value])),...Object.fromEntries(l.flatMap(a=>a.fields.map(i=>[i.name,i.value])))}),n=a=>t.props.fields.find(i=>i.name===a),r=L.useCallback((a,i)=>{f(),u(a,i)},[]),p=a=>{a.preventDefault(),x(t.props.postLink)};return s.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[s.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[s.jsx(y,{className:"mb-3 w-fit",asChild:!0,children:s.jsxs(O,{href:t.props.btnBack.link,children:[s.jsx(B,{iconNode:S}),t.props.btnBack.title]})}),s.jsxs(y,{variant:"green",type:"submit",className:"w-fit",form:"addUserForm",disabled:o||t.props.view,children:[o&&s.jsx(z,{className:"h-4 w-4 animate-spin"}),t.props.btnSave.title]})]}),s.jsx("form",{id:"addUserForm",onSubmit:p,className:`${t.props.view?"cursor-not-allowed":""}`,children:s.jsxs("div",{className:"flex flex-col gap-6 max-w-[1144px]",children:[s.jsx("h2",{className:"font-bold text-xl",children:t.props.head}),s.jsxs("div",{className:"grid gap-4",children:[s.jsx(j,{htmlFor:(d=n("name"))==null?void 0:d.name,children:(m=n("name"))==null?void 0:m.label}),s.jsx(E,{id:(g=n("name"))==null?void 0:g.name,type:"text",required:!0,tabIndex:1,autoComplete:(b=n("name"))==null?void 0:b.name,value:c.name,onChange:a=>r("name",a.target.value),disabled:o||t.props.view,placeholder:(v=n("name"))==null?void 0:v.label})]}),s.jsxs("div",{className:"grid gap-4",children:[s.jsx(j,{htmlFor:(C=n("description"))==null?void 0:C.name,children:(N=n("description"))==null?void 0:N.label}),s.jsx(E,{id:(k=n("description"))==null?void 0:k.name,type:"text",required:!0,tabIndex:1,autoComplete:(w=n("description"))==null?void 0:w.name,value:c.description,onChange:a=>r("description",a.target.value),disabled:o||t.props.view,placeholder:(F=n("description"))==null?void 0:F.label})]}),t.props.users.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"font-bold text-xl",children:t.props.userHead}),t.props.users.map(a=>s.jsx(I,{field:a,disabled:o||t.props.view,value:c[a.name],onCheckedChange:r},a.name))]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 xl:grid-cols-4 gap-4",children:((T=t.props.groupedTokens)==null?void 0:T.length)>0&&t.props.groupedTokens.map(a=>s.jsxs("div",{className:"grid gap-4 content-start justify-between",children:[s.jsx("h2",{className:"font-bold text-xl mt-3",children:a.header}),a.fields.map(i=>s.jsx(I,{field:i,disabled:o||t.props.view,value:c[i.name],onCheckedChange:r,tooltip:!0},i.name))]},a.header))})]})})]})}function H(t){return t.preventDefault()}export{V as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as pl,q as cl,r as sl,a3 as ml,j as l,B as hs,a1 as ll,b as n,I as Te,f as gs,l as tl,S as al,d as rl,k as il,aP as fl,L as xl,X as ul,aQ as hl,V as gl,W as jl,Y as vl,h as nl,i as wl}from"./app.js";import{Icon as ol}from"./icon-BbhNOU2o.js";import bl from"./input-error-1aQ9bwyz.js";import Nl from"./material-icon-8nTeT-mJ.js";function Al(){var js,vs,ws,bs,Ns,Cs,Ps,ks,ys,Fs,Us,zs,Ss,Is,As,Es,Ts,Bs,Ls,qs,Vs,_s,Ds,Hs,Ms,Os,Rs,$s,Js,Qs,Ws,Xs,Ys,Gs,Ks,Zs,el;const e=pl.c(260),t=cl(),[Re,dl]=sl.useState(),{fields:$e,groups:Je,auth:Qe}=t.props;let p;e[0]!==$e?(p=Object.fromEntries($e.map(Fl)),e[0]=$e,e[1]=p):p=e[1];let c;e[2]!==Je?(c=Object.fromEntries(Je.map(yl)),e[2]=Je,e[3]=c):c=e[3];let Be;e[4]!==p||e[5]!==c?(Be={...p,...c},e[4]=p,e[5]=c,e[6]=Be):Be=e[6];const{data:i,setData:We,errors:Xe,setError:Ye,clearErrors:Ge,post:Ke,processing:o}=ml(Be);let Le,qe;e[7]===Symbol.for("react.memo_cache_sentinel")?(Le=()=>{(async()=>{const d=await wl.get(`${window.routePrefix}/get-timezones`);dl(d.data.timezones)})()},qe=[],e[7]=Le,e[8]=qe):(Le=e[7],qe=e[8]),sl.useEffect(Le,qe);let Ve;e[9]!==t.props.fields?(Ve=r=>t.props.fields.find(d=>d.name===r),e[9]=t.props.fields,e[10]=Ve):Ve=e[10];const s=Ve;let _e;e[11]!==i.repeatUserPassword||e[12]!==i.userPassword||e[13]!==t.props.passwordError||e[14]!==t.props.postLink||e[15]!==Ke||e[16]!==Ye?(_e=r=>{if(r.preventDefault(),i.userPassword!==i.repeatUserPassword){Ye("repeatUserPassword",t.props.passwordError);return}Ke(t.props.postLink)},e[11]=i.repeatUserPassword,e[12]=i.userPassword,e[13]=t.props.passwordError,e[14]=t.props.postLink,e[15]=Ke,e[16]=Ye,e[17]=_e):_e=e[17];const Ze=_e;let De;e[18]!==Ge||e[19]!==We?(De=(r,d)=>{Ge(),We(r,d)},e[18]=Ge,e[19]=We,e[20]=De):De=e[20];const a=De;let He;e[21]===Symbol.for("react.memo_cache_sentinel")?(He=l.jsx(ol,{iconNode:fl}),e[21]=He):He=e[21];let m;e[22]!==t.props.btnBack.link||e[23]!==t.props.btnBack.title?(m=l.jsx(hs,{className:"mb-3 w-fit",asChild:!0,children:l.jsxs(ll,{href:t.props.btnBack.link,children:[He,t.props.btnBack.title]})}),e[22]=t.props.btnBack.link,e[23]=t.props.btnBack.title,e[24]=m):m=e[24];const es=o||t.props.view;let f;e[25]!==o?(f=o&&l.jsx(xl,{className:"h-4 w-4 animate-spin"}),e[25]=o,e[26]=f):f=e[26];let x;e[27]!==t.props.btnSave.title||e[28]!==es||e[29]!==f?(x=l.jsxs(hs,{variant:"green",type:"submit",className:"w-fit",form:"addUserForm",disabled:es,children:[f,t.props.btnSave.title]}),e[27]=t.props.btnSave.title,e[28]=es,e[29]=f,e[30]=x):x=e[30];let u;e[31]!==x||e[32]!==m?(u=l.jsxs("div",{className:"w-full sticky z-[1001] py-4 pb-8 top-0 h-fit bg-background flex gap-4",children:[m,x]}),e[31]=x,e[32]=m,e[33]=u):u=e[33];const ss=t.props.view?"cursor-not-allowed":"";let h;e[34]!==t.props.head?(h=l.jsx("h2",{className:"font-bold text-xl",children:t.props.head}),e[34]=t.props.head,e[35]=h):h=e[35];let g;e[36]!==s?(g=(js=s("login"))==null?void 0:js.name,e[36]=s,e[37]=g):g=e[37];let j;e[38]!==s?(j=(vs=s("login"))==null?void 0:vs.label,e[38]=s,e[39]=j):j=e[39];let v;e[40]!==g||e[41]!==j?(v=l.jsx(n,{htmlFor:g,children:j}),e[40]=g,e[41]=j,e[42]=v):v=e[42];let w;e[43]!==s?(w=(ws=s("login"))==null?void 0:ws.name,e[43]=s,e[44]=w):w=e[44];const ls=i.login;let b;e[45]!==a?(b=r=>a("login",r.target.value),e[45]=a,e[46]=b):b=e[46];const ts=o||t.props.view;let N;e[47]!==s?(N=(bs=s("login"))==null?void 0:bs.label,e[47]=s,e[48]=N):N=e[48];let C;e[49]!==w||e[50]!==ls||e[51]!==b||e[52]!==ts||e[53]!==N?(C=l.jsx(Te,{id:w,type:"text",required:!0,tabIndex:1,autoComplete:"username",value:ls,onChange:b,disabled:ts,placeholder:N}),e[49]=w,e[50]=ls,e[51]=b,e[52]=ts,e[53]=N,e[54]=C):C=e[54];let P;e[55]!==v||e[56]!==C?(P=l.jsxs("div",{className:"grid gap-4",children:[v,C]}),e[55]=v,e[56]=C,e[57]=P):P=e[57];let k;e[58]!==s?(k=(Ns=s("fullName"))==null?void 0:Ns.name,e[58]=s,e[59]=k):k=e[59];let y;e[60]!==s?(y=(Cs=s("fullName"))==null?void 0:Cs.label,e[60]=s,e[61]=y):y=e[61];let F;e[62]!==k||e[63]!==y?(F=l.jsx(n,{htmlFor:k,children:y}),e[62]=k,e[63]=y,e[64]=F):F=e[64];let U;e[65]!==s?(U=(Ps=s("fullName"))==null?void 0:Ps.name,e[65]=s,e[66]=U):U=e[66];const as=i.fullName;let z;e[67]!==a?(z=r=>a("fullName",r.target.value),e[67]=a,e[68]=z):z=e[68];const rs=o||t.props.view;let S;e[69]!==s?(S=(ks=s("fullName"))==null?void 0:ks.label,e[69]=s,e[70]=S):S=e[70];let I;e[71]!==U||e[72]!==as||e[73]!==z||e[74]!==rs||e[75]!==S?(I=l.jsx(Te,{id:U,type:"text",required:!0,tabIndex:1,autoComplete:"additional-name",value:as,onChange:z,disabled:rs,placeholder:S}),e[71]=U,e[72]=as,e[73]=z,e[74]=rs,e[75]=S,e[76]=I):I=e[76];let A;e[77]!==F||e[78]!==I?(A=l.jsxs("div",{className:"grid gap-4",children:[F,I]}),e[77]=F,e[78]=I,e[79]=A):A=e[79];let E;e[80]!==s?(E=(ys=s("email"))==null?void 0:ys.name,e[80]=s,e[81]=E):E=e[81];let T;e[82]!==s?(T=(Fs=s("email"))==null?void 0:Fs.label,e[82]=s,e[83]=T):T=e[83];let B;e[84]!==E||e[85]!==T?(B=l.jsx(n,{htmlFor:E,children:T}),e[84]=E,e[85]=T,e[86]=B):B=e[86];let L;e[87]!==s?(L=(Us=s("email"))==null?void 0:Us.name,e[87]=s,e[88]=L):L=e[88];const is=i.email;let q;e[89]!==a?(q=r=>a("email",r.target.value),e[89]=a,e[90]=q):q=e[90];const os=o||t.props.view;let V;e[91]!==s?(V=(zs=s("email"))==null?void 0:zs.label,e[91]=s,e[92]=V):V=e[92];let _;e[93]!==L||e[94]!==is||e[95]!==q||e[96]!==os||e[97]!==V?(_=l.jsx(Te,{id:L,type:"email",required:!0,tabIndex:1,autoComplete:"email",value:is,onChange:q,disabled:os,placeholder:V}),e[93]=L,e[94]=is,e[95]=q,e[96]=os,e[97]=V,e[98]=_):_=e[98];let D;e[99]!==B||e[100]!==_?(D=l.jsxs("div",{className:"grid gap-4",children:[B,_]}),e[99]=B,e[100]=_,e[101]=D):D=e[101];let H;e[102]!==P||e[103]!==A||e[104]!==D?(H=l.jsxs("div",{className:"basis-1/2 flex flex-col gap-6",children:[P,A,D]}),e[102]=P,e[103]=A,e[104]=D,e[105]=H):H=e[105];let M;e[106]!==s?(M=(Ss=s("timezone"))==null?void 0:Ss.name,e[106]=s,e[107]=M):M=e[107];let O;e[108]!==s?(O=(Is=s("timezone"))==null?void 0:Is.label,e[108]=s,e[109]=O):O=e[109];let R;e[110]!==M||e[111]!==O?(R=l.jsx(n,{htmlFor:M,children:O}),e[110]=M,e[111]=O,e[112]=R):R=e[112];let $;e[113]!==a?($=r=>a("timezone",r),e[113]=a,e[114]=$):$=e[114];const ns=i.timezone,ds=o||t.props.view;let J;e[115]!==s?(J=(As=s("timezone"))==null?void 0:As.name,e[115]=s,e[116]=J):J=e[116];let Q;e[117]!==J?(Q=l.jsx(al,{className:"w-full cursor-pointer",children:l.jsx(rl,{placeholder:J})}),e[117]=J,e[118]=Q):Q=e[118];let W;e[119]!==Re?(W=Re??[],e[119]=Re,e[120]=W):W=e[120];let X;e[121]!==W?(X=W.map(kl),e[121]=W,e[122]=X):X=e[122];let Y;e[123]!==X?(Y=l.jsx(il,{children:X}),e[123]=X,e[124]=Y):Y=e[124];let G;e[125]!==$||e[126]!==ns||e[127]!==ds||e[128]!==Q||e[129]!==Y?(G=l.jsxs(tl,{onValueChange:$,defaultValue:ns,disabled:ds,children:[Q,Y]}),e[125]=$,e[126]=ns,e[127]=ds,e[128]=Q,e[129]=Y,e[130]=G):G=e[130];let K;e[131]!==R||e[132]!==G?(K=l.jsxs("div",{className:"grid gap-4",children:[R,G]}),e[131]=R,e[132]=G,e[133]=K):K=e[133];let Z;e[134]!==i.date||e[135]!==s||e[136]!==a||e[137]!==o?(Z=s("date")&&l.jsxs("div",{className:"grid gap-4",children:[l.jsx(n,{htmlFor:(Es=s("date"))==null?void 0:Es.name,children:(Ts=s("date"))==null?void 0:Ts.label}),l.jsx(Te,{id:(Bs=s("date"))==null?void 0:Bs.name,type:"date",className:"max-w-fit",tabIndex:1,value:i.date,onChange:r=>a("date",r.target.value),disabled:o})]}),e[134]=i.date,e[135]=s,e[136]=a,e[137]=o,e[138]=Z):Z=e[138];let ee;e[139]!==i.isAdmin||e[140]!==s||e[141]!==a||e[142]!==t.props.view||e[143]!==o?(ee=s("isAdmin")&&l.jsxs("div",{className:"grid gap-4",children:[l.jsx(n,{className:"cursor-pointer",htmlFor:(Ls=s("isAdmin"))==null?void 0:Ls.name,children:(qs=s("isAdmin"))==null?void 0:qs.label}),l.jsx(gs,{id:(Vs=s("isAdmin"))==null?void 0:Vs.name,className:"cursor-pointer size-5",disabled:o||t.props.view,checked:i.isAdmin,onCheckedChange:r=>a("isAdmin",r)})]}),e[139]=i.isAdmin,e[140]=s,e[141]=a,e[142]=t.props.view,e[143]=o,e[144]=ee):ee=e[144];let se;e[145]!==i.isConfirmed||e[146]!==s||e[147]!==a||e[148]!==t.props.view||e[149]!==o?(se=s("isConfirmed")&&l.jsxs("div",{className:"grid gap-4",children:[l.jsx(n,{className:"cursor-pointer",htmlFor:(_s=s("isConfirmed"))==null?void 0:_s.name,children:(Ds=s("isConfirmed"))==null?void 0:Ds.label}),l.jsx(gs,{id:(Hs=s("isConfirmed"))==null?void 0:Hs.name,className:"cursor-pointer size-5",disabled:o||t.props.view,checked:i.isConfirmed,onCheckedChange:r=>a("isConfirmed",r)})]}),e[145]=i.isConfirmed,e[146]=s,e[147]=a,e[148]=t.props.view,e[149]=o,e[150]=se):se=e[150];let le;e[151]!==ee||e[152]!==se?(le=l.jsxs("div",{className:"flex gap-6",children:[ee,se]}),e[151]=ee,e[152]=se,e[153]=le):le=e[153];let te;e[154]!==Z||e[155]!==le?(te=l.jsxs("div",{className:"flex flex-col md:flex-row justify-start gap-4 xl:justify-between items-start md:items-center",children:[Z,le]}),e[154]=Z,e[155]=le,e[156]=te):te=e[156];let ae;e[157]!==i.locale||e[158]!==s||e[159]!==a||e[160]!==t.props.locales||e[161]!==t.props.view||e[162]!==o?(ae=s("locale")&&l.jsxs("div",{className:"grid gap-4",children:[l.jsx(n,{htmlFor:(Ms=s("locale"))==null?void 0:Ms.name,children:(Os=s("locale"))==null?void 0:Os.label}),l.jsxs(tl,{onValueChange:r=>a("locale",r),defaultValue:i.locale,disabled:o||t.props.view,children:[l.jsx(al,{className:"w-full cursor-pointer",children:l.jsx(rl,{placeholder:(Rs=s("locale"))==null?void 0:Rs.name})}),l.jsx(il,{children:(t.props.locales??[]).map(Pl)})]})]}),e[157]=i.locale,e[158]=s,e[159]=a,e[160]=t.props.locales,e[161]=t.props.view,e[162]=o,e[163]=ae):ae=e[163];let re;e[164]!==K||e[165]!==te||e[166]!==ae?(re=l.jsxs("div",{className:"basis-1/2 flex flex-col gap-6",children:[K,te,ae]}),e[164]=K,e[165]=te,e[166]=ae,e[167]=re):re=e[167];let ie;e[168]!==H||e[169]!==re?(ie=l.jsxs("div",{className:"flex-col xl:flex-row flex gap-16",children:[H,re]}),e[168]=H,e[169]=re,e[170]=ie):ie=e[170];let oe;e[171]!==Qe.user.isAdministrator||e[172]!==i.login||e[173]!==t.props.userPretend?(oe=Qe.user.isAdministrator&&l.jsx(hs,{className:"w-fit",asChild:!0,variant:"outline",children:l.jsxs(ll,{href:t.props.userPretend.postLink,method:"post",data:{login:i.login,pretend:!0},children:[l.jsx(Nl,{name:"masks",className:"!text-[18px]"}),t.props.userPretend.label]})}),e[171]=Qe.user.isAdministrator,e[172]=i.login,e[173]=t.props.userPretend,e[174]=oe):oe=e[174];let ne;e[175]!==s?(ne=($s=s("userPassword"))==null?void 0:$s.label,e[175]=s,e[176]=ne):ne=e[176];let de;e[177]!==ne?(de=l.jsx("label",{className:"font-bold text-xl",children:ne}),e[177]=ne,e[178]=de):de=e[178];let Me;e[179]===Symbol.for("react.memo_cache_sentinel")?(Me=l.jsx(ul,{onClick:Cl,children:l.jsx(ol,{iconNode:hl,className:"text-primary w-5 h-5 cursor-pointer"})}),e[179]=Me):Me=e[179];let pe;e[180]!==s?(pe=(Js=s("userPassword"))==null?void 0:Js.tooltip,e[180]=s,e[181]=pe):pe=e[181];let ce;e[182]!==pe?(ce=l.jsx(gl,{children:l.jsxs(jl,{children:[Me,l.jsx(vl,{align:"center",side:"top",children:l.jsx("p",{children:pe})})]})}),e[182]=pe,e[183]=ce):ce=e[183];let me;e[184]!==de||e[185]!==ce?(me=l.jsxs("div",{className:"flex gap-3",children:[de,ce]}),e[184]=de,e[185]=ce,e[186]=me):me=e[186];let fe;e[187]!==s?(fe=(Qs=s("userPassword"))==null?void 0:Qs.name,e[187]=s,e[188]=fe):fe=e[188];let xe;e[189]!==s?(xe=(Ws=s("userPassword"))==null?void 0:Ws.label,e[189]=s,e[190]=xe):xe=e[190];let ue;e[191]!==fe||e[192]!==xe?(ue=l.jsx(n,{htmlFor:fe,children:xe}),e[191]=fe,e[192]=xe,e[193]=ue):ue=e[193];let he;e[194]!==s?(he=(Xs=s("userPassword"))==null?void 0:Xs.name,e[194]=s,e[195]=he):he=e[195];const ps=!t.props.edit,cs=i.password;let ge;e[196]!==a?(ge=r=>a("userPassword",r.target.value),e[196]=a,e[197]=ge):ge=e[197];const ms=o||t.props.view;let je;e[198]!==s?(je=(Ys=s("userPassword"))==null?void 0:Ys.label,e[198]=s,e[199]=je):je=e[199];let ve;e[200]!==he||e[201]!==ps||e[202]!==cs||e[203]!==ge||e[204]!==ms||e[205]!==je?(ve=l.jsx(Te,{id:he,type:"password",required:ps,tabIndex:1,autoComplete:"new-password",value:cs,onChange:ge,disabled:ms,placeholder:je}),e[200]=he,e[201]=ps,e[202]=cs,e[203]=ge,e[204]=ms,e[205]=je,e[206]=ve):ve=e[206];let we;e[207]!==ue||e[208]!==ve?(we=l.jsxs("div",{className:"grid gap-4 col-span-1",children:[ue,ve]}),e[207]=ue,e[208]=ve,e[209]=we):we=e[209];let be;e[210]!==s?(be=(Gs=s("repeatUserPassword"))==null?void 0:Gs.name,e[210]=s,e[211]=be):be=e[211];let Ne;e[212]!==s?(Ne=(Ks=s("repeatUserPassword"))==null?void 0:Ks.label,e[212]=s,e[213]=Ne):Ne=e[213];let Ce;e[214]!==be||e[215]!==Ne?(Ce=l.jsx(n,{htmlFor:be,children:Ne}),e[214]=be,e[215]=Ne,e[216]=Ce):Ce=e[216];let Pe;e[217]!==s?(Pe=(Zs=s("repeatUserPassword"))==null?void 0:Zs.name,e[217]=s,e[218]=Pe):Pe=e[218];const fs=!t.props.edit,xs=i.repeatUserPassword;let ke;e[219]!==a?(ke=r=>a("repeatUserPassword",r.target.value),e[219]=a,e[220]=ke):ke=e[220];const us=o||t.props.view;let ye;e[221]!==s?(ye=(el=s("repeatUserPassword"))==null?void 0:el.label,e[221]=s,e[222]=ye):ye=e[222];let Fe;e[223]!==Pe||e[224]!==fs||e[225]!==xs||e[226]!==ke||e[227]!==us||e[228]!==ye?(Fe=l.jsx(Te,{id:Pe,type:"password",required:fs,tabIndex:1,autoComplete:"new-password",value:xs,onChange:ke,disabled:us,placeholder:ye}),e[223]=Pe,e[224]=fs,e[225]=xs,e[226]=ke,e[227]=us,e[228]=ye,e[229]=Fe):Fe=e[229];let Ue;e[230]!==Xe.repeatUserPassword?(Ue=l.jsx(bl,{message:Xe.repeatUserPassword}),e[230]=Xe.repeatUserPassword,e[231]=Ue):Ue=e[231];let ze;e[232]!==Ce||e[233]!==Fe||e[234]!==Ue?(ze=l.jsxs("div",{className:"grid gap-4 col-span-1 col-start-1",children:[Ce,Fe,Ue]}),e[232]=Ce,e[233]=Fe,e[234]=Ue,e[235]=ze):ze=e[235];let Se;e[236]!==we||e[237]!==ze?(Se=l.jsxs("div",{className:"grid grid-col-1 lg:grid-cols-2 grid-rows-2 gap-x-16 gap-y-6",children:[we,ze]}),e[236]=we,e[237]=ze,e[238]=Se):Se=e[238];let Ie;e[239]!==i||e[240]!==a||e[241]!==t.props.groupHead||e[242]!==t.props.groups||e[243]!==t.props.view||e[244]!==o?(Ie=t.props.groups.length>0&&l.jsxs(l.Fragment,{children:[l.jsx("h2",{className:"font-bold text-xl",children:t.props.groupHead}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-5 xl:grid-cols-6 gap-4",children:t.props.groups.map(r=>l.jsxs("div",{className:"grid gap-4",children:[l.jsx(n,{className:"cursor-pointer",htmlFor:r.name,children:r.label}),l.jsx(gs,{id:r.name,disabled:o||t.props.view,className:"cursor-pointer size-5",checked:i[r.name],onCheckedChange:d=>a(r.name,d)})]},r.name))})]}),e[239]=i,e[240]=a,e[241]=t.props.groupHead,e[242]=t.props.groups,e[243]=t.props.view,e[244]=o,e[245]=Ie):Ie=e[245];let Ae;e[246]!==h||e[247]!==ie||e[248]!==oe||e[249]!==me||e[250]!==Se||e[251]!==Ie?(Ae=l.jsxs("div",{className:"flex flex-col gap-10 max-w-[1144px]",children:[h,ie,oe,me,Se,Ie]}),e[246]=h,e[247]=ie,e[248]=oe,e[249]=me,e[250]=Se,e[251]=Ie,e[252]=Ae):Ae=e[252];let Ee;e[253]!==Ze||e[254]!==Ae||e[255]!==ss?(Ee=l.jsx("form",{id:"addUserForm",onSubmit:Ze,className:ss,children:Ae}),e[253]=Ze,e[254]=Ae,e[255]=ss,e[256]=Ee):Ee=e[256];let Oe;return e[257]!==Ee||e[258]!==u?(Oe=l.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[u,Ee]}),e[257]=Ee,e[258]=u,e[259]=Oe):Oe=e[259],Oe}function Cl(e){return e.preventDefault()}function Pl(e){return l.jsx(nl,{value:e.value,children:e.label},e.value)}function kl(e){return l.jsx(nl,{value:e.value,children:e.label},e.value)}function yl(e){return[e.name,e.value]}function Fl(e){return[e.name,e.value]}export{Al as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as m,j as t}from"./app.js";import{A as i}from"./app-layout-DlouPwk2.js";import p from"./add-user-form-CrfboTix.js";import"./app-shell-B969C0PB.js";import"./app-sidebar-DBaEEAgj.js";import"./nav-main-FLS_mh3K.js";import"./material-icon-8nTeT-mJ.js";import"./app-sidebar-header-DAKTYE0g.js";import"./breadcrumbs-DHQ3AkEO.js";import"./nav-user-CfXR0Kcu.js";import"./user-info-obJxhBMF.js";import"./user-menu-content-Bs0bmqDB.js";import"./theme-switcher-BKpJx2Op.js";import"./icon-BbhNOU2o.js";import"./input-error-1aQ9bwyz.js";const e=[];function R(){const o=m.c(1);let r;return o[0]===Symbol.for("react.memo_cache_sentinel")?(r=t.jsx(i,{breadcrumbs:e,children:t.jsx(p,{})}),o[0]=r):r=o[0],r}export{R as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as b,c as x,q as j,j as a,a0 as u,am as h}from"./app.js";import A from"./app-shell-B969C0PB.js";import{AppSidebar as S}from"./app-sidebar-DBaEEAgj.js";import{A as N,N as v}from"./app-sidebar-header-DAKTYE0g.js";const y=b.memo(m=>{const e=x.c(14),{children:r,breadcrumbs:t,className:i}=m;let s;e[0]!==t?(s=t===void 0?[]:t,e[0]=t,e[1]=s):s=e[1];const o=s,f=j().props.title;let l;e[2]!==f?(l=a.jsx(u,{title:f}),e[2]=f,e[3]=l):l=e[3];let n;e[4]===Symbol.for("react.memo_cache_sentinel")?(n=a.jsx(S,{}),e[4]=n):n=e[4];let c;e[5]!==o?(c=a.jsx(N,{breadcrumbs:o}),e[5]=o,e[6]=c):c=e[6];let p;e[7]!==r||e[8]!==i||e[9]!==c?(p=a.jsxs(h,{className:i,children:[c,r]}),e[7]=r,e[8]=i,e[9]=c,e[10]=p):p=e[10];let d;return e[11]!==l||e[12]!==p?(d=a.jsxs(A,{variant:"sidebar",children:[l,n,p]}),e[11]=l,e[12]=p,e[13]=d):d=e[13],d}),$=b.memo(m=>{const e=x.c(10);let r,t,i,s;e[0]!==m?({children:t,className:i,breadcrumbs:r,...s}=m,e[0]=m,e[1]=r,e[2]=t,e[3]=i,e[4]=s):(r=e[1],t=e[2],i=e[3],s=e[4]);let o;return e[5]!==r||e[6]!==t||e[7]!==i||e[8]!==s?(o=a.jsx(v,{children:a.jsx(y,{breadcrumbs:r,className:i,...s,children:t})}),e[5]=r,e[6]=t,e[7]=i,e[8]=s,e[9]=o):o=e[9],o});export{$ as A};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as p,j as l,
|
|
1
|
+
import{r as i,c as p,j as l,aR as u}from"./app.js";const S=i.memo(c=>{const e=p.c(6),{children:n,variant:o}=c,d=o===void 0?"header":o,[r,f]=i.useState(h);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=t=>{f(t),typeof window<"u"&&localStorage.setItem("sidebar",String(t))},e[0]=a):a=e[0];const m=a;if(d==="header"){let t;return e[1]!==n?(t=l.jsx("div",{className:"flex min-h-screen w-full flex-col",children:n}),e[1]=n,e[2]=t):t=e[2],t}let s;return e[3]!==n||e[4]!==r?(s=l.jsx(u,{defaultOpen:r,open:r,onOpenChange:m,children:n}),e[3]=n,e[4]=r,e[5]=s):s=e[5],s});function h(){return typeof window<"u"?localStorage.getItem("sidebar")!=="false":!0}export{S as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as D,q as F,j as s,aX as G,aY as H,C as B,aZ as $,a_ as R,a$ as J,b0 as M,b1 as w,b2 as U,b3 as V,b4 as X,b5 as Y,b6 as T,a1 as v,b7 as E,b8 as q,b9 as y,ba as z,bb as A,bc as Z,B as _,bd as K,be as L,bf as O,bg as P,bh as Q}from"./app.js";import{NavMain as W}from"./nav-main-FLS_mh3K.js";import r from"./material-icon-8nTeT-mJ.js";function ne(){const e=D.c(41),a=F(),k=`w-full ${a.props.section?"":"pointer-events-none"}`;let f;e[0]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(r,{name:"rocket_launch",className:"!text-[18px]"}),e[0]=f):f=e[0];let l;e[1]!==a.props.brand?(l=s.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:a.props.brand}),e[1]=a.props.brand,e[2]=l):l=e[2];let n;e[3]!==a.props.section?(n=a.props.section&&s.jsx(G,{className:"ml-auto group-data-[state=collapsed]:hidden"}),e[3]=a.props.section,e[4]=n):n=e[4];let i;e[5]!==l||e[6]!==n?(i=s.jsxs("div",{children:[f,l,n]}),e[5]=l,e[6]=n,e[7]=i):i=e[7];let t;e[8]!==k||e[9]!==i?(t=s.jsx(Z,{asChild:!0,className:"text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground rounded-md",children:s.jsx(y,{asChild:!0,children:s.jsx(_,{variant:"ghost",asChild:!0,className:k,children:i})})}),e[8]=k,e[9]=i,e[10]=t):t=e[10];let c;e[11]!==a.props.section?(c=a.props.section&&s.jsx(H,{side:"right",className:"z-[1003]",children:a.props.section.map(ee)}),e[11]=a.props.section,e[12]=c):c=e[12];let p;e[13]!==t||e[14]!==c?(p=s.jsx(K,{className:"p-0 shadow-none border-none bg-transparent hidden md:block",children:s.jsxs(L,{children:[t,c]})}),e[13]=t,e[14]=c,e[15]=p):p=e[15];let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N=s.jsx(r,{name:"rocket_launch",className:"!text-[18px]"}),e[16]=N):N=e[16];let d;e[17]!==a.props.brand?(d=s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:a.props.brand}),e[17]=a.props.brand,e[18]=d):d=e[18];let o;e[19]!==a.props.section?(o=a.props.section&&s.jsx(B,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"}),e[19]=a.props.section,e[20]=o):o=e[20];let x;e[21]!==o||e[22]!==d?(x=s.jsx(q,{asChild:!0,children:s.jsxs(y,{children:[N,d,o]})}),e[21]=o,e[22]=d,e[23]=x):x=e[23];let h;e[24]!==a.props.section?(h=a.props.section&&s.jsx($,{children:s.jsx(R,{children:a.props.section&&a.props.section.map(S)})}),e[24]=a.props.section,e[25]=h):h=e[25];let j;e[26]!==x||e[27]!==h?(j=s.jsx(O,{className:"px-2 py-0 block md:hidden",children:s.jsx(M,{children:s.jsx(E,{asChild:!0,className:"group/collapsible",children:s.jsxs(w,{children:[x,h]})})})}),e[26]=x,e[27]=h,e[28]=j):j=e[28];let m;e[29]!==a.props.brand||e[30]!==j||e[31]!==p?(m=s.jsx(J,{children:s.jsx(M,{children:s.jsxs(w,{children:[p,j]},a.props.brand)})}),e[29]=a.props.brand,e[30]=j,e[31]=p,e[32]=m):m=e[32];let b;e[33]!==a.props.menu?(b=s.jsx(U,{children:s.jsx(W,{items:a.props.menu})}),e[33]=a.props.menu,e[34]=b):b=e[34];const C=a.props.showVersion&&"v.4.3.0";let u;e[35]!==C?(u=s.jsx(P,{children:s.jsx("div",{className:"text-center opacity-70",children:C})}),e[35]=C,e[36]=u):u=e[36];let g;return e[37]!==m||e[38]!==b||e[39]!==u?(g=s.jsxs(Q,{collapsible:"icon",variant:"inset",children:[m,b,u]}),e[37]=m,e[38]=b,e[39]=u,e[40]=g):g=e[40],g}function S(e){return e.subItems?s.jsx(M,{children:s.jsx(E,{asChild:!0,className:"group/collapsible-sub",children:s.jsxs(w,{children:[s.jsx(q,{asChild:!0,children:s.jsxs(y,{children:[s.jsx(r,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:e.title}),s.jsx(B,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible-sub:rotate-90"})]})}),s.jsx($,{children:s.jsx(R,{children:e.subItems.map(I)})})]})})},e.id):s.jsx(z,{children:s.jsx(A,{asChild:!0,children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(r,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]}):s.jsxs(v,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(r,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]})})},e.id)}function I(e){return s.jsx(z,{children:s.jsx(A,{asChild:!0,children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(r,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]}):s.jsxs(v,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(r,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]})})},e.id)}function ee(e){return s.jsx("div",{children:e.subItems?s.jsxs(V,{children:[s.jsxs(X,{className:"flex gap-2 items-center cursor-pointer",children:[s.jsx(r,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]}),s.jsx(Y,{children:e.subItems.map(se)})]}):s.jsx(T,{children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(r,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]}):s.jsxs(v,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(r,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]})})},e.id)}function se(e){return s.jsx(T,{children:e.type==="blank"?s.jsxs("a",{href:e.link,target:"_blank",className:"flex gap-2 items-center",children:[e.icon&&s.jsx(r,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]},e.id):s.jsxs(v,{href:e.link,className:"flex gap-2 items-center",children:[e.icon&&s.jsx(r,{name:e.icon,className:"!text-[18px]"}),s.jsx("span",{className:"hover:underline",children:e.title})]},e.id)},e.id)}export{ne as AppSidebar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as h,j as e,i as N,aS as S,y as C,B as v,aT as M,A as E,E as _,aU as $,W as T,X as A,aa as P,Y as D,u as I,aV as R,a1 as k,L as B,c as z,aW as L}from"./app.js";import{Breadcrumbs as O}from"./breadcrumbs-DHQ3AkEO.js";import{NavUser as H}from"./nav-user-CfXR0Kcu.js";import{ThemeSwitcher as J}from"./theme-switcher-BKpJx2Op.js";import F from"./material-icon-8nTeT-mJ.js";const b=h.createContext(void 0),Q=({children:d})=>{const[s,f]=h.useState([]),[x,i]=h.useState([]),[u,n]=h.useState(!1),l=async()=>{try{const r=await N.get(`${window.routePrefix}/api/notifications`,{params:{unreadOnly:!0,limit:4}});f(r.data)}catch(r){console.error("Error fetching bell notifications:",r)}},t=async()=>{await l()},m=async r=>{n(!0);try{const o=r?`${window.routePrefix}/api/notifications/${r}`:`${window.routePrefix}/api/notifications`,a=await N.get(o);return i(a.data),a.data}catch(o){return console.error("Error fetching all notifications:",o),[]}finally{n(!1)}};h.useEffect(()=>{l();const r=new EventSource(`${window.routePrefix}/api/notifications/stream`);return r.addEventListener("connected",o=>{const a=JSON.parse(o.data);console.log("Connected event:",a)}),r.addEventListener("notification",o=>{const a=JSON.parse(o.data);f(c=>[a,...c.filter(p=>p.id!==a.id)].slice(0,4)),i(c=>[a,...c.filter(p=>p.id!==a.id)])}),r.onerror=()=>{console.error("SSE connection error")},()=>r.close()},[]);const j=async(r,o)=>{try{await N.put(`${window.routePrefix}/api/notifications/${r}/${o}/read`,{}),i(a=>a.map(c=>c.id===o?{...c,read:!0}:c)),await l()}catch(a){throw console.error("Error marking as read:",a),a}},w=s.filter(r=>!r.read).length;return e.jsx(b.Provider,{value:{bellNotifications:s,allNotifications:x,unreadCount:w,markAsRead:j,fetchAllNotifications:m,loading:u,refreshBellNotifications:t},children:d})},U=()=>{const d=h.useContext(b);if(d===void 0)throw new Error("useNotifications must be used within a NotificationProvider");return d};function V(){const{bellNotifications:d,markAsRead:s,unreadCount:f,refreshBellNotifications:x}=U(),[i,u]=h.useState(!1),n=async(t,m)=>{u(!0);try{await s(t,m),await x()}catch(j){console.error("Error marking as read:",j)}finally{u(!1)}},l=t=>{const m=new Date,j=new Date(t),w=m.getTime()-j.getTime(),r=Math.floor(w/1e3),o=new Intl.RelativeTimeFormat("en",{numeric:"auto"});if(r<60)return o.format(-r,"second");const a=Math.floor(r/60);if(a<60)return o.format(-a,"minute");const c=Math.floor(a/60);if(c<24)return o.format(-c,"hour");const p=Math.floor(c/24);if(p<30)return o.format(-p,"day");const g=Math.floor(p/30);if(g<12)return o.format(-g,"month");const y=Math.floor(g/12);return o.format(-y,"year")};return e.jsxs(S,{children:[e.jsx(C,{asChild:!0,className:"cursor-pointer data-[state=open]:bg-sidebar-accent",children:e.jsxs(v,{variant:"ghost",className:"relative",children:[e.jsx(M,{}),f>0&&e.jsx("div",{className:"absolute top-1.5 right-1.5 size-1.5 rounded-full bg-destructive"})]})}),e.jsxs(E,{className:"z-[1002] p-2",align:"end",onCloseAutoFocus:t=>t.preventDefault(),children:[e.jsx(_,{className:`${i?"opacity-50 pointer-events-none":""}`,children:d.length===0?e.jsx("div",{className:"p-4 text-center text-muted-foreground",children:"No notifications"}):d.map(t=>e.jsxs("div",{children:[e.jsx($,{asChild:!0,className:"cursor-pointer",onSelect:m=>{m.preventDefault(),I.visit(`${window.routePrefix}/notifications?type=${t.notificationClass}`)},children:e.jsxs("div",{className:"grid grid-cols-[32px_250px] grid-rows-[auto_1fr] items-start gap-x-4 gap-y-2",children:[t.icon?e.jsx(F,{name:t.icon.icon,style:{color:t.icon.iconColor},className:"!text-[32px]"}):e.jsx("div",{}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium",children:t.title}),e.jsx("span",{className:"truncate",children:t.message})]}),e.jsxs("div",{className:"col-start-2 flex justify-between flex-nowrap items-center",children:[e.jsxs("div",{className:"flex flex-nowrap gap-2 items-center",children:[t.notificationClass==="general"?e.jsx("div",{className:"font-medium",children:"Info"}):e.jsx("div",{className:"font-medium",children:"Activity"}),e.jsx("span",{children:"●"}),e.jsx("div",{children:l(t.createdAt)})]}),e.jsxs(T,{children:[e.jsx(A,{asChild:!0,children:e.jsx(v,{variant:"ghost",size:"icon",className:"size-4",onClick:m=>{m.stopPropagation(),n(t.notificationClass,t.id)},children:e.jsx(P,{className:"text-primary"})})}),e.jsx(D,{side:"left",className:"z-[1003]",children:e.jsx("p",{children:"Make read"})})]})]})]})}),e.jsx(R,{})]},t.id))}),e.jsx(v,{variant:"secondary",asChild:!0,children:e.jsxs(k,{href:`${window.routePrefix}/notifications?type=general`,className:`w-full ${i?"opacity-50 pointer-events-none":""}`,children:["View All",i&&e.jsx(B,{className:"h-4 w-4 animate-spin"})]})})]})]})}function W(d){const s=z.c(8),{breadcrumbs:f}=d;let x;s[0]!==f?(x=f===void 0?[]:f,s[0]=f,s[1]=x):x=s[1];const i=x;let u;s[2]===Symbol.for("react.memo_cache_sentinel")?(u=e.jsx(L,{className:"-ml-1"}),s[2]=u):u=s[2];let n;s[3]!==i?(n=e.jsxs("div",{className:"flex items-center gap-2",children:[u,e.jsx(O,{breadcrumbs:i})]}),s[3]=i,s[4]=n):n=s[4];let l;s[5]===Symbol.for("react.memo_cache_sentinel")?(l=e.jsxs("div",{className:"flex gap-4 items-center",children:[e.jsx(J,{}),e.jsx(V,{}),e.jsx(H,{})]}),s[5]=l):l=s[5];let t;return s[6]!==n?(t=e.jsx("header",{className:"border-sidebar-border/50 flex h-16 shrink-0 items-center gap-2 border-b px-6 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 md:px-4",children:e.jsxs("div",{className:"flex justify-between w-full",children:[n,l]})}),s[6]=n,s[7]=t):t=s[7],t}const Z=Object.freeze(Object.defineProperty({__proto__:null,AppSidebarHeader:W},Symbol.toStringTag,{value:"Module"}));export{W as A,Q as N,Z as a,U as u};
|