|
|
|
@@ -1,41 +1,19 @@
|
|
|
|
|
var SirsoftAdminBasic=(function(Q,c,b,ar){"use strict";function eg(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const P=eg(b),tg=()=>window.G7Core,re=b.forwardRef(({children:e,variant:t="primary",size:n="md",className:a="",...r},o)=>{const s="inline-flex items-center justify-center",i=tg()?.style?.mergeClasses?.(s,a)??`${s} ${a}`;return c.jsx("button",{ref:o,className:i,...r,children:e})});re.displayName="Button";const Hi=b.forwardRef(({accept:e,maxSize:t,onChange:n,onError:a,buttonText:r="Browse",placeholder:o="No file selected",className:s="",disabled:i,...l},g)=>{const d=b.useRef(null),u=g||d,[f,h]=b.useState(""),v=b.useCallback(()=>{!i&&u.current&&u.current.click()},[i,u]),p=b.useCallback(m=>{const T=m.target.files?.[0]||null;if(!T){h(""),n?.({target:{value:null,name:""}});return}if(t&&T.size>t*1024*1024){const C=`File size exceeds ${t}MB limit`;a?.(C),u.current&&(u.current.value=""),h("");return}h(T.name),n?.({target:{value:T,name:T.name}})},[t,n,a,u]),x=b.useCallback(m=>{m.stopPropagation(),u.current&&(u.current.value=""),h(""),n?.({target:{value:null,name:""}})},[n,u]);return c.jsxs("div",{className:`flex items-center gap-2 ${s}`,children:[c.jsx("input",{ref:u,type:"file",accept:e,onChange:p,disabled:i,className:"hidden",...l}),c.jsx("button",{type:"button",onClick:v,disabled:i,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:r}),c.jsx("span",{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:f||o}),f&&!i&&c.jsx("button",{type:"button",onClick:x,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:c.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});Hi.displayName="FileInput";const ft=b.forwardRef(({label:e,error:t,className:n="",onChange:a,onKeyPress:r,value:o,defaultValue:s,type:i="text",checked:l,defaultChecked:g,...d},u)=>{const f=i==="radio"||i==="checkbox",h=b.useRef(!1),v=b.useRef(null);b.useImperativeHandle(u,()=>v.current);const[p,x]=b.useState(o??s??"");b.useEffect(()=>{if(!f&&!h.current&&o!==void 0){if(v.current&&document.activeElement===v.current)return;x(o)}},[o,f]);const m=b.useCallback(()=>{h.current=!0},[]),T=b.useCallback(w=>{if(h.current=!1,a){const A=w.target.value;x(A);const D=new Event("change",{bubbles:!0});Object.defineProperty(D,"target",{writable:!1,value:{value:A}}),Object.defineProperty(D,"currentTarget",{writable:!1,value:{value:A}}),a(D)}},[a]),C=b.useCallback(w=>{const A=w.target.value;x(A),!h.current&&a&&a(w)},[a]),S=b.useCallback(w=>{h.current||r&&r(w)},[r]),{loadingactions:N,formdata:E,...k}=d;if(f)return c.jsx("input",{ref:v,type:i,className:n,onChange:a,checked:l,defaultChecked:g,value:o,...k});const y=o!==void 0?{value:p}:{defaultValue:s};return c.jsx("input",{ref:v,type:i,className:n,onChange:C,onKeyPress:S,onCompositionStart:m,onCompositionEnd:T,...y,...k})});ft.displayName="Input";const vr=({label:e,error:t,className:n="",onChange:a,value:r,defaultValue:o,...s})=>{const i=b.useRef(!1),l=b.useRef(null),[g,d]=b.useState(r??o??"");b.useEffect(()=>{!i.current&&r!==void 0&&d(r)},[r]);const u=b.useCallback(()=>{i.current=!0},[]),f=b.useCallback(T=>{if(i.current=!1,a){const C=T.target.value;d(C);const S=new Event("change",{bubbles:!0});Object.defineProperty(S,"target",{writable:!1,value:{value:C}}),Object.defineProperty(S,"currentTarget",{writable:!1,value:{value:C}}),a(S)}},[a]),h=b.useCallback(T=>{const C=T.target.value;d(C),!i.current&&a&&a(T)},[a]),{loadingactions:v,formdata:p,...x}=s,m=r!==void 0?{value:g}:{defaultValue:o};return c.jsx("textarea",{ref:l,className:n,onChange:h,onCompositionStart:u,onCompositionEnd:f,...m,...x})},Ft=({children:e,className:t="",...n})=>c.jsx("label",{className:t,...n,children:e}),_=b.forwardRef(({children:e,className:t="",...n},a)=>c.jsx("div",{ref:a,className:t,...n,children:e})),Z=({children:e,className:t="",...n})=>c.jsx("span",{className:t,...n,children:e}),ut=({children:e,className:t="",...n})=>c.jsx("p",{className:t,...n,children:e}),or=({className:e="",alt:t="",...n})=>c.jsx("img",{className:e,alt:t,...n}),Ao=({children:e,className:t="",...n})=>c.jsx("h1",{className:t,...n,children:e}),Er=({children:e,className:t="",...n})=>c.jsx("h2",{className:t,...n,children:e}),Hr=({children:e,className:t="",...n})=>c.jsx("h3",{className:t,...n,children:e}),ji=({children:e,className:t="",...n})=>c.jsx("h4",{className:t,...Line truncated
|
|
|
|
|
var SirsoftAdminBasic=(function(R,h,v,Nn){"use strict";var _T=Object.defineProperty;var ET=(R,h,v)=>h in R?_T(R,h,{enumerable:!0,configurable:!0,writable:!0,value:v}):R[h]=v;var $e=(R,h,v)=>ET(R,typeof h!="symbol"?h+"":h,v);var Na,cr;function Xm(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const P=Xm(v),Km=()=>window.G7Core,oe=v.forwardRef(({children:t,variant:e="primary",size:n="md",className:r="",...s},o)=>{const i="button",a=Km()?.style?.mergeClasses?.(i,r)??`${i} ${r}`;return h.jsx("button",{ref:o,className:a,...s,children:t})});oe.displayName="Button";const Sd=v.forwardRef(({accept:t,maxSize:e,onChange:n,onError:r,buttonText:s="Browse",placeholder:o="No file selected",className:i="",disabled:a,...l},c)=>{const d=v.useRef(null),u=c||d,[f,g]=v.useState(""),m={},p={};Object.entries(l).forEach(([x,E])=>{x.startsWith("data-editor-")||x==="id"||x==="onMouseMove"||x==="onMouseLeave"?m[x]=E:p[x]=E});const y=v.useCallback(()=>{!a&&u.current&&u.current.click()},[a,u]),b=v.useCallback(x=>{const E=x.target.files?.[0]||null;if(!E){g(""),n?.({target:{value:null,name:""}});return}if(e&&E.size>e*1024*1024){const k=`File size exceeds ${e}MB limit`;r?.(k),u.current&&(u.current.value=""),g("");return}g(E.name),n?.({target:{value:E,name:E.name}})},[e,n,r,u]),S=v.useCallback(x=>{x.stopPropagation(),u.current&&(u.current.value=""),g(""),n?.({target:{value:null,name:""}})},[n,u]);return h.jsxs("div",{className:`flex items-center gap-2 ${i}`,...m,children:[h.jsx("input",{ref:u,type:"file",accept:t,onChange:b,disabled:a,className:"hidden",...p}),h.jsx("button",{type:"button",onClick:y,disabled:a,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:s}),h.jsx("span",{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:f||o}),f&&!a&&h.jsx("button",{type:"button",onClick:S,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:h.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});Sd.displayName="FileInput";const qm=t=>t==="checkbox"?"checkbox":t==="radio"?"radio":"input",Zm=(t,e)=>{const n=qm(t);return e?e.split(/\s+/).filter(Boolean).includes(n)?e:`${n} ${e}`:n},wt=v.forwardRef(({label:t,error:e,className:n="",onChange:r,onKeyPress:s,value:o,defaultValue:i,type:a="text",checked:l,defaultChecked:c,...d},u)=>{const f=a==="radio"||a==="checkbox",g=Zm(a,n),m=v.useRef(!1),p=v.useRef(null);v.useImperativeHandle(u,()=>p.current);const[y,b]=v.useState(o??i??"");v.useEffect(()=>{if(!f&&!m.current&&o!==void 0){if(p.current&&document.activeElement===p.current)return;b(o)}},[o,f]);const S=v.useCallback(()=>{m.current=!0},[]),x=v.useCallback(M=>{if(m.current=!1,r){const O=M.target.value;b(O);const L=new Event("change",{bubbles:!0});Object.defineProperty(L,"target",{writable:!1,value:{value:O}}),Object.defineProperty(L,"currentTarget",{writable:!1,value:{value:O}}),r(L)}},[r]),E=v.useCallback(M=>{const O=M.target.value;b(O),!m.current&&r&&r(M)},[r]),k=v.useCallback(M=>{m.current||s&&s(M)},[s]),{loadingactions:C,formdata:N,..._}=d;if(f)return h.jsx("input",{ref:p,type:a,className:g,onChange:r,checked:l,defaultChecked:c,value:o,..._});const w=o!==void 0?{value:y}:{defaultValue:i};return h.jsx("input",{ref:p,type:a,className:g,onChange:E,onKeyPress:k,onCompositionStart:S,onCompositionEnd:x,...w,..._})});wt.displayName="Input";const qn=({label:t,error:e,className:n="",onChange:r,value:s,defaultValue:o,...i})=>{const a=v.useRef(!1),l=v.useRef(null),[c,d]=v.useState(s??o??"");v.useEffect(()=>{!a.current&&s!==void 0&&d(s)},[s]);const u=v.useCallback(()=>{a.current=!0},[]),f=v.useCallback(E=>{if(a.current=!1,r){const k=E.target.value;d(k);const C=new Event("change",{bubbles:!0});Object.defineProperty(C,"target",{writable:!1,value:{value:k}}),Object.defineProperty(C,"currentTarget",{writable:!1,value:{value:k}}),r(C)}},[r]),g=v.useCallback(E=>{const k=E.target.value;d(k),!a.current&&r&&r(E)},[r]),{loadingactions:m,formdata:p,...y}=i,b=s!==void 0?{value:c}:{defaultValue:o},x=(n??"").split(/\s+/).filter(Boolean).includes("textarea")?n??"":["textarea",n].filter(Boolean).join(" ");return h.jsx("textarea",{ref:l,className:x,onChange:g,onCompositionStart:u,onCompositionEnd:f,...b,...y})},en=({children:t,className:e="",...n})=>h.jsx("label",{className:e,...n,children:t}),I=v.forwardRef(({children:t,className:e="",...n},r)=>h.jsx("div",{ref:r,classNameLine truncated
|
|
|
|
|
inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium
|
|
|
|
|
${ee?"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300"}
|
|
|
|
|
`,children:[c.jsx(ne,{name:"globe",className:"w-3 h-3"}),I(V),ee&&c.jsx(Z,{className:"text-red-500 dark:text-red-400",children:"*"}),!ee&&c.jsx(re,{type:"button",className:"ml-0.5 p-0.5 rounded-full hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",onClick:()=>O(V),disabled:l,children:c.jsx(ne,{name:"xmark",className:"w-3 h-3"})})]}),ee&&Y&&$()]}),n==="textarea"?c.jsx(vr,{name:`${f}[${V}]`,value:C[V]||"",onChange:oe=>L(V,oe.target.value),placeholder:X,required:i&&ee,disabled:l,maxLength:g,rows:d,className:`${ae} resize-vertical`}):c.jsx(ft,{type:"text",name:`${f}[${V}]`,value:C[V]||"",onChange:oe=>L(V,oe.target.value),placeholder:X,required:i&&ee,disabled:l,maxLength:g,className:ae})]},V)},[f,C,L,s,i,l,g,d,n,I,m,O,$,p]),G=b.useCallback(V=>{const R=`w-full px-3 py-2 border ${p?"border-red-500 dark:border-red-500 focus:ring-red-500 focus:border-red-500":"border-gray-200 dark:border-gray-600 focus:ring-blue-500 focus:border-blue-500"} rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2`,ae=`${s}${s?" (":""}${I(V)}${s?")":""}`;return c.jsx(_,{children:n==="textarea"?c.jsx(vr,{name:`${f}[${V}]`,value:C[V]||"",onChange:ee=>L(V,ee.target.value),placeholder:ae,required:i&&V===m,disabled:l,maxLength:g,rows:d,className:`${R} resize-vertical`}):c.jsx(ft,{type:"text",name:`${f}[${V}]`,value:C[V]||"",onChange:ee=>L(V,ee.target.value),placeholder:ae,required:i&&V===m,disabled:l,maxLength:g,className:R})},V)},[f,C,L,s,i,l,g,d,n,m,I]),j=()=>c.jsx(_,{className:u,children:c.jsx(_,{className:"space-y-4",children:k.map((V,Y)=>z(V,Y===0))})}),W=()=>c.jsxs(_,{className:u,children:[c.jsxs(_,{className:"flex items-center gap-2 mb-3",children:[k.map(V=>c.jsxs(re,{type:"button",className:`
|
|
|
|
|
${he?"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300"}
|
|
|
|
|
`,children:[h.jsx(re,{name:"globe",className:"w-3 h-3"}),H(X),he&&h.jsx(Q,{className:"text-red-500 dark:text-red-400",children:"*"}),!he&&h.jsx(oe,{type:"button",className:"ml-0.5 p-0.5 rounded-full hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",onClick:()=>V(X),disabled:l,children:h.jsx(re,{name:"xmark",className:"w-3 h-3"})})]}),he&&Z&&j()]}),n==="textarea"?h.jsx(qn,{name:`${f}[${X}]`,value:k[X]||"",onChange:ce=>A(X,ce.target.value),placeholder:J,required:a&&he,disabled:l,maxLength:c,rows:d,className:`${ne} resize-vertical`}):h.jsx(wt,{type:"text",name:`${f}[${X}]`,value:k[X]||"",onChange:ce=>A(X,ce.target.value),placeholder:J,required:a&&he,disabled:l,maxLength:c,className:ee})]},X)},[f,k,A,i,a,l,c,d,n,H,x,V,j,b]),B=v.useCallback(X=>{const Z=b?"input input-error":"input",ee=b?"textarea input-error":"textarea",ne=`${i}${i?" (":""}${H(X)}${i?")":""}`;return h.jsx(I,{children:n==="textarea"?h.jsx(qn,{name:`${f}[${X}]`,value:k[X]||"",onChange:he=>A(X,he.target.value),placeholder:ne,required:a&&X===x,disabled:l,maxLength:c,rows:d,className:`${ee} resize-vertical`}):h.jsx(wt,{type:"text",name:`${f}[${X}]`,value:k[X]||"",onChange:he=>A(X,he.target.value),placeholder:ne,required:a&&X===x,disabled:l,maxLength:c,className:Z})},X)},[f,k,A,i,a,l,c,d,n,x,H,b]),G=()=>h.jsx(I,{className:u,children:h.jsx(I,{className:"space-y-4",children:w.map((X,Z)=>U(X,Z===0))})}),z=()=>h.jsxs(I,{className:u,children:[h.jsxs(I,{className:"flex items-center gap-2 mb-3",children:[w.map(X=>h.jsxs(oe,{type:"button",className:`
|
|
|
|
|
inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold transition-all
|
|
|
|
|
${w===V?V===m?"bg-blue-500 text-white dark:bg-blue-600 dark:text-white shadow-md scale-105":"bg-gray-500 text-white dark:bg-gray-600 dark:text-white shadow-md scale-105":V===m?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/50":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
|
|
|
|
`,onClick:()=>A(V),children:[c.jsx(ne,{name:"globe",className:"w-3 h-3"}),h?c.jsxs(c.Fragment,{children:[c.jsx(Z,{className:"hidden md:inline",children:I(V)}),c.jsx(Z,{className:"inline md:hidden",children:V.toUpperCase()})]}):I(V),V===m&&c.jsx(Z,{className:"text-red-500 dark:text-red-400",children:"*"}),H(V)&&w!==V&&c.jsx(ne,{name:"check",className:"w-3 h-3 text-green-500 dark:text-green-400"}),V!==m&&c.jsx(re,{type:"button",className:"ml-0.5 p-0.5 rounded-full hover:bg-gray-300 dark:hover:bg-gray-500 transition-colors",onClick:Y=>{Y.stopPropagation(),O(V)},disabled:l,children:c.jsx(ne,{name:"xmark",className:"w-3 h-3"})})]},V)),$()]}),k.map(V=>c.jsx(_,{className:w===V?"block":"hidden",children:G(V)},V))]}),B=()=>{const V=p?"border-red-500 dark:border-red-500 focus:ring-red-500 focus:border-red-500":"border-gray-200 dark:border-gray-600 focus:ring-blue-500 focus:border-blue-500";return c.jsx(_,{className:u,children:c.jsxs(_,{className:"flex items-center gap-1",children:[c.jsx(_,{className:"flex items-center shrink-0",children:k.map(Y=>c.jsxs(re,{type:"button",className:`
|
|
|
|
|
${O===X?X===x?"bg-blue-500 text-white dark:bg-blue-600 dark:text-white shadow-md scale-105":"bg-gray-500 text-white dark:bg-gray-600 dark:text-white shadow-md scale-105":X===x?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/50":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
|
|
|
|
`,onClick:()=>L(X),children:[h.jsx(re,{name:"globe",className:"w-3 h-3"}),g?h.jsxs(h.Fragment,{children:[h.jsx(Q,{className:"hidden md:inline",children:H(X)}),h.jsx(Q,{className:"inline md:hidden",children:X.toUpperCase()})]}):H(X),X===x&&h.jsx(Q,{className:"text-red-500 dark:text-red-400",children:"*"}),W(X)&&O!==X&&h.jsx(re,{name:"check",className:"w-3 h-3 text-green-500 dark:text-green-400"}),X!==x&&h.jsx(oe,{type:"button",className:"ml-0.5 p-0.5 rounded-full hover:bg-gray-300 dark:hover:bg-gray-500 transition-colors",onClick:Z=>{Z.stopPropagation(),V(X)},disabled:l,children:h.jsx(re,{name:"xmark",className:"w-3 h-3"})})]},X)),j()]}),w.map(X=>h.jsx(I,{className:O===X?"block":"hidden",children:B(X)},X))]}),K=()=>{const X=b?"input input-error":"input",Z=b?"textarea input-error":"textarea";return h.jsx(I,{className:u,children:h.jsxs(I,{className:"flex items-center gap-1",children:[h.jsx(I,{className:"flex items-center shrink-0",children:w.map(ee=>h.jsxs(oe,{type:"button",className:`
|
|
|
|
|
px-2 py-1.5 text-xs font-medium border-y border-l first:rounded-l last:rounded-r last:border-r transition-colors
|
|
|
|
|
${w===Y?"bg-blue-500 text-white border-blue-500 dark:bg-blue-600 dark:border-blue-600":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700"}
|
|
|
|
|
`,onClick:()=>A(Y),title:I(Y),children:[Y.toUpperCase(),Y===m&&c.jsx(Z,{className:"text-red-400 ml-0.5",children:"*"})]},Y))}),c.jsx(_,{className:"flex-1 min-w-0",children:n==="textarea"?c.jsx(vr,{name:`${f}[${w}]`,value:C[w]||"",onChange:Y=>L(w,Y.target.value),placeholder:s,required:i&&w===m,disabled:l,maxLength:g,rows:d,className:`w-full px-2 py-1.5 border ${V} rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-white text-sm`}):c.jsx(ft,{type:"text",name:`${f}[${w}]`,value:C[w]||"",onChange:Y=>L(w,Y.target.value),placeholder:s,required:i&&w===m,disabled:l,maxLength:g,className:`w-full px-2 py-1.5 border ${V} rounded bg-white dark:bg-gray-800 text-gray-900 dark:text-white text-sm`})})]})})};return c.jsxs(_,{className:l?"opacity-50 cursor-not-allowed":void 0,children:[a==="compact"?B():a==="tabs"?W():j(),p&&v&&c.jsx(Z,{className:"text-xs text-red-500 dark:text-red-400 mt-1 block",children:v})]})};Vo.displayName="MultilingualInput";const pg=()=>window.G7Core,Ho=({checked:e,value:t,onChange:n,disabled:a=!1,label:r,description:o,size:s="md",className:i="",name:l})=>{const[g,d]=b.useState(()=>e??t??!1);b.useEffect(()=>{d(e??t??!1)},[e,t]);const u=p=>{const x=p.target.checked;d(x),n&&!a&&n(p)},h={sm:{track:"w-9 h-5",thumb:"after:h-4 after:w-4"},md:{track:"w-11 h-6",thumb:"after:h-5 after:w-5"},lg:{track:"w-14 h-7",thumb:"after:h-6 after:w-6"}}[s],v=()=>{if(!a){const p=!g;if(d(p),n){const x=pg();x?.createChangeEvent&&n(x.createChangeEvent({checked:p,name:l}))}}};return c.jsxs("div",{className:`inline-flex flex-wrap items-start gap-x-2 w-auto ${i}`,children:[c.jsxs("div",{className:`relative inline-flex items-center flex-shrink-0 ${a?"cursor-not-allowed opacity-50":"cursor-pointer"}`,onClick:p=>{p.preventDefault(),p.stopPropagation(),v()},children:[c.jsx("input",{type:"checkbox",id:l,name:l,checked:g,onChange:u,disabled:a,className:"sr-only peer",tabIndex:-1}),c.jsx("div",{className:`
|
|
|
|
|
relative ${h.track}
|
|
|
|
|
bg-gray-200 dark:bg-gray-700
|
|
|
|
|
rounded-full
|
|
|
|
|
peer
|
|
|
|
|
peer-focus:outline-none
|
|
|
|
|
peer-focus:ring-4
|
|
|
|
|
peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800
|
|
|
|
|
peer-checked:bg-blue-600 dark:peer-checked:bg-blue-500
|
|
|
|
|
after:content-['']
|
|
|
|
|
after:absolute
|
|
|
|
|
after:top-0.5
|
|
|
|
|
after:left-0.5
|
|
|
|
|
after:bg-white
|
|
|
|
|
after:border-gray-300 dark:after:border-gray-600
|
|
|
|
|
after:border
|
|
|
|
|
after:rounded-full
|
|
|
|
|
${h.thumb}
|
|
|
|
|
after:transition-all
|
|
|
|
|
peer-checked:after:translate-x-full
|
|
|
|
|
peer-checked:after:border-white
|
|
|
|
|
transition-colors
|
|
|
|
|
`})]}),r&&c.jsx("span",{className:`text-sm font-medium text-gray-900 dark:text-white ${a?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:v,children:r}),o&&c.jsx("p",{className:"w-full mt-1 text-xs text-gray-500 dark:text-gray-400",children:o})]})},ga=({status:e,label:t,showIcon:n=!0,iconName:a,className:r="",style:o})=>{const s={success:"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400 border-green-200 dark:border-green-800",warning:"bg-yellow-50 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-400 border-yellow-200 dark:border-yellow-800",error:"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-400 border-red-200 dark:border-red-800",info:"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-400 border-blue-200 dark:border-blue-800",pending:"bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-300 border-gray-200 dark:border-gray-600",default:"bg-gray-50 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-gray-200 dark:border-gray-600"},i={success:de.CheckCircle,warning:de.ExclamationTriangle,error:de.XCircle,info:de.InfoCircle,pending:de.Clock,default:de.QuestionCircle},l={success:"성공",warning:"경고",error:"오류",info:"정보",pending:"대기 중",default:"기본"},g=a||i[e],d=t||l[e],u=s[e];return c.jsxs(Z,{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium border ${u} ${r}`,style:o,children:[n&&c.jsx(ne,{name:g,className:"w-4 h-4"}),c.jsx(Z,{children:d})]})},Wi={blue:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",green:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",red:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300",gray:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",yellow:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300",purple:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",orange:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300",teal:"bg-teal-100 text-teal-800 dark:bg-teal-900/30 dark:text-teal-300",cyan:"bg-cyan-100 text-cyan-800 dark:bg-cyan-900/30 dark:text-cyan-300"},Yi={sm:"px-1.5 py-0.5 text-[10px]",md:"px-2 py-0.5 text-xs",lg:"px-2.5 py-1 text-sm"},qi=({color:e="gray",text:t,size:n="md",className:a="",style:r,children:o})=>{const s=Wi[e]||Wi.gray,i=Yi[n]||Yi.md;return c.jsxs(Z,{className:`inline-flex items-center rounded-full font-medium ${i} ${s} ${a}`,style:r,children:[t,o]})};/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:Ki,setPrototypeOf:Xi,isFrozen:bg,getPrototypeOf:mg,getOwnPropertyDescriptor:vg}=Object;let{freeze:Tt,seal:zt,create:Zi}=Object,{apply:jo,construct:zo}=typeof Reflect<"u"&&Reflect;Tt||(Tt=function(t){return t}),zt||(zt=function(t){return t}),jo||(jo=function(t,n,a){return t.apply(n,a)}),zo||(zo=function(t,n){return new t(...n)});const ha=Ut(Array.prototype.forEach),Qi=Ut(Array.prototype.pop),vn=Ut(Array.prototype.push),pa=Ut(String.prototype.toLowerCase),Go=Ut(String.prototype.toString),Ji=Ut(String.prototype.match),yn=Ut(String.prototype.replace),yg=Ut(String.prototype.indexOf),xg=Ut(String.prototype.trim),Zt=Ut(Object.prototype.hasOwnProperty),Ot=Ut(RegExp.prototype.test),xn=wg(TypeError);function Ut(e){return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];return jo(e,t,a)}}function wg(e){return function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return zo(e,n)}}function je(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pa;Xi&&Xi(e,null);let a=t.length;for(;a--;){let r=t[a];if(typeof r=="string"){const o=n(r);o!==r&&(bg(t)||(t[a]=o),r=o)}e[r]=!0}return e}function kg(e){for(let t=0;t<e.length;t++)Zt(e,t)||(e[t]=null);return e}function Nr(e){const t=Zi(null);for(const[n,a]of Ki(e))Zt(e,n)&&(Array.isArray(a)?t[n]=kg(a):a&&typeof a=="object"&&a.constructor===Object?t[n]=Nr(a):t[n]=a);return t}function wn(e,t){for(;e!==null;){const a=vg(e,t);if(a){if(a.get)return Ut(a.get);if(typeof a.value=="function")return Ut(a.value)}e=mg(e)}function n(){return null}return n}const Ri=Tt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","stri
Line truncated
|
|
|
|
|
`+Ve),se&&ha([F,M,L],Ne=>{Ve=yn(Ve,Ne," ")}),S&&Be?S.createHTML(Ve):Ve},t.setConfig=function(){let ke=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};at(ke),ce=!0},t.clearConfig=function(){Le=null,ce=!1},t.isValidAttribute=function(ke,q,ie){Le||at({});const ye=fe(ke),K=fe(q);return ca(ye,K,ie)},t.addHook=function(ke,q){typeof q=="function"&&(D[ke]=D[ke]||[],vn(D[ke],q))},t.removeHook=function(ke){if(D[ke])return Qi(D[ke])},t.removeHooks=function(ke){D[ke]&&(D[ke]=[])},t.removeAllHooks=function(){D={}},t}var Pg=sl();const Ko=({content:e,text:t,isHtml:n=!0,className:a="",purifyConfig:r})=>{const o=t??e??"";if(!o||o.trim()==="")return null;if(!n){const g=`
|
|
|
|
|
${O===ee?"bg-blue-500 text-white border-blue-500 dark:bg-blue-600 dark:border-blue-600":"bg-white text-gray-600 border-gray-200 hover:bg-gray-50 dark:bg-gray-800 dark:text-gray-300 dark:border-gray-600 dark:hover:bg-gray-700"}
|
|
|
|
|
`,onClick:()=>L(ee),title:H(ee),children:[ee.toUpperCase(),ee===x&&h.jsx(Q,{className:"text-red-400 ml-0.5",children:"*"})]},ee))}),h.jsx(I,{className:"flex-1 min-w-0",children:n==="textarea"?h.jsx(qn,{name:`${f}[${O}]`,value:k[O]||"",onChange:ee=>A(O,ee.target.value),placeholder:i,required:a&&O===x,disabled:l,maxLength:c,rows:d,className:Z}):h.jsx(wt,{type:"text",name:`${f}[${O}]`,value:k[O]||"",onChange:ee=>A(O,ee.target.value),placeholder:i,required:a&&O===x,disabled:l,maxLength:c,className:X})})]})})};return h.jsxs(I,{className:l?"opacity-50 cursor-not-allowed":void 0,id:p,...y,children:[r==="compact"?K():r==="tabs"?z():G(),b&&m&&h.jsx(Q,{className:"text-xs text-red-500 dark:text-red-400 mt-1 block",children:m})]})};Va.displayName="MultilingualInput";const fb=()=>window.G7Core,za=({checked:t,value:e,onChange:n,disabled:r=!1,label:s,description:o,size:i="md",className:a="",name:l,id:c,editorAttrs:d})=>{const[u,f]=v.useState(()=>t??e??!1);v.useEffect(()=>{f(t??e??!1)},[t,e]);const g=b=>{const S=b.target.checked;f(S),n&&!r&&n(b)},p={sm:{track:"w-9 h-5",thumb:"after:h-4 after:w-4"},md:{track:"w-11 h-6",thumb:"after:h-5 after:w-5"},lg:{track:"w-14 h-7",thumb:"after:h-6 after:w-6"}}[i],y=()=>{if(!r){const b=!u;if(f(b),n){const S=fb();S?.createChangeEvent&&n(S.createChangeEvent({checked:b,name:l}))}}};return h.jsxs("div",{className:`toggle-container ${a}`,id:c,...d,children:[h.jsxs("div",{className:`toggle-switch-wrapper ${r?"cursor-not-allowed opacity-50":"cursor-pointer"}`,onClick:b=>{b.preventDefault(),b.stopPropagation(),y()},children:[h.jsx("input",{type:"checkbox",id:l,name:l,checked:u,onChange:g,disabled:r,className:"sr-only peer",tabIndex:-1}),h.jsx("div",{className:`toggle-switch-track ${p.track} ${p.thumb}`})]}),s&&h.jsx("span",{className:`toggle-label ${r?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onClick:y,children:s}),o&&h.jsx("p",{className:"toggle-description",children:o})]})},Po=({status:t,label:e,showIcon:n=!0,iconName:r,className:s="",style:o,id:i,editorAttrs:a})=>{const l={success:"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-400 border-green-200 dark:border-green-800",warning:"bg-yellow-50 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-400 border-yellow-200 dark:border-yellow-800",error:"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-400 border-red-200 dark:border-red-800",info:"bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-400 border-blue-200 dark:border-blue-800",pending:"bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-300 border-gray-200 dark:border-gray-600",default:"bg-gray-50 dark:bg-gray-700 text-gray-600 dark:text-gray-400 border-gray-200 dark:border-gray-600"},c={success:de.CheckCircle,warning:de.ExclamationTriangle,error:de.XCircle,info:de.InfoCircle,pending:de.Clock,default:de.QuestionCircle},d={success:"성공",warning:"경고",error:"오류",info:"정보",pending:"대기 중",default:"기본"},u=r||c[t],f=e||d[t],g=l[t];return h.jsxs(Q,{className:`inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium border ${g} ${s}`,style:o,id:i,...a,children:[n&&h.jsx(re,{name:u,className:"w-4 h-4"}),h.jsx(Q,{children:f})]})},Td={blue:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",green:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-300",red:"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300",gray:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300",yellow:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300",purple:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300",orange:"bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-300",teal:"bg-teal-100 text-teal-800 dark:bg-teal-900/30 dark:text-teal-300",cyan:"bg-cyan-100 text-cyan-800 dark:bg-cyan-900/30 dark:text-cyan-300"},hb={success:"green",warning:"yellow",danger:"red",error:"red",info:"blue",primary:"blue",secondary:"gray",text:"gray",default:"gray"},Ad={sm:"px-1.5 py-0.5 text-[10px]",md:"px-2 py-0.5 text-xs",lg:"px-2.5 py-1 text-sm"},Dd=({color:t,variant:e,text:n,size:r="md",className:s="",style:o,children:i,id:a,editorAttrs:l})=>{const c=t||(e?hb[e]:void 0)||"gray",d=Td[c]||Td.gray,u=Ad[r]||Ad.md;return h.jsxs(Q,{className:`inline-flex items-center rounded-full font-medium ${u} ${d} ${s}`,style:o,id:a,...l,children:[n,i]})};/*! @license DOMPurify 3.1.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.7/LICENSE */const{entries:Id,setPrototypeOf:Ld,isFrozen:gb,getPrototypeOf:pb,getOwnPropertyDescriptor:mb}=Object;let{freeze:Bt,seal:an,create:Pd}=Object,{apply:Ha,construct:Ua}=typeof Reflect<"u"&&Reflect;Bt||(Bt=function(e){return e}),an||(an=function(e){return e}),Ha||(Ha=function(e,n,r){return e.apply(n,r)}),Ua||(Ua=function(e,n){return new e(...n)});const $o=tn(Array.prototype.forEach),$d=tn(Array.prototype.pop),ys=t
Line truncated
|
|
|
|
|
`+ke),J&&$o([L,$,F],We=>{ke=vs(ke,We," ")}),E&&Se?E.createHTML(ke):ke},e.setConfig=function(){let Ce=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Re(Ce),ie=!0},e.clearConfig=function(){Ee=null,ie=!1},e.isValidAttribute=function(Ce,Y,ae){Ee||Re({});const xe=we(Ce),lt=we(Y);return Ao(xe,lt,ae)},e.addHook=function(Ce,Y){typeof Y=="function"&&(O[Ce]=O[Ce]||[],ys(O[Ce],Y))},e.removeHook=function(Ce){if(O[Ce])return $d(O[Ce])},e.removeHooks=function(Ce){O[Ce]&&(O[Ce]=[])},e.removeAllHooks=function(){O={}},e}var Ib=Gd();const Xa=({content:t,text:e,isHtml:n=!0,className:r="",purifyConfig:s,id:o,editorAttrs:i})=>{const a=e??t??"";if(!a||a.trim()==="")return null;if(!n){const u=`
|
|
|
|
|
whitespace-pre-wrap
|
|
|
|
|
text-gray-900 dark:text-gray-100
|
|
|
|
|
font-sans
|
|
|
|
|
${a}
|
|
|
|
|
`.trim().replace(/\s+/g," ");return c.jsx(_,{className:g,children:o})}const s={FORBID_TAGS:["script","noscript","iframe","frame","frameset","object","embed","applet","portal","form","input","textarea","select","button","style","link","meta","base","body","head","html","title","svg","math","audio","video","source","track","canvas","details","dialog","plaintext","xmp","listing","marquee","noframes","noembed","template","slot"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onfocus","onblur","ontoggle","oncanplay","onloadstart","formaction","xlink:href","action"],ALLOW_DATA_ATTR:!0,ADD_ATTR:["target"]},i=b.useMemo(()=>{const g=r?{...s,...r,FORBID_TAGS:[...s.FORBID_TAGS,...r.FORBID_TAGS||[]],FORBID_ATTR:[...s.FORBID_ATTR,...r.FORBID_ATTR||[]]}:s;return Pg.sanitize(o,g).replace(/<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi,(u,f,h,v)=>(h.startsWith("http://")||h.startsWith("https://"))&&!u.includes("rel=")?`<a ${f}href="${h}"${v} rel="noopener noreferrer">`:u)},[o,r]),l=`
|
|
|
|
|
${r}
|
|
|
|
|
`.trim().replace(/\s+/g," ");return h.jsx(I,{className:u,id:o,...i,children:a})}const l={FORBID_TAGS:["script","noscript","iframe","frame","frameset","object","embed","applet","portal","form","input","textarea","select","button","style","link","meta","base","body","head","html","title","svg","math","audio","video","source","track","canvas","details","dialog","plaintext","xmp","listing","marquee","noframes","noembed","template","slot"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onfocus","onblur","ontoggle","oncanplay","onloadstart","formaction","xlink:href","action"],ALLOW_DATA_ATTR:!0,ADD_ATTR:["target"]},c=v.useMemo(()=>{const u=s?{...l,...s,FORBID_TAGS:[...l.FORBID_TAGS,...s.FORBID_TAGS||[]],FORBID_ATTR:[...l.FORBID_ATTR,...s.FORBID_ATTR||[]]}:l;return Ib.sanitize(a,u).replace(/<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi,(g,m,p,y)=>(p.startsWith("http://")||p.startsWith("https://"))&&!g.includes("rel=")?`<a ${m}href="${p}"${y} rel="noopener noreferrer">`:g)},[a,s]),d=`
|
|
|
|
|
prose dark:prose-invert max-w-none
|
|
|
|
|
prose-p:my-2
|
|
|
|
|
prose-headings:font-bold prose-headings:mt-6 prose-headings:mb-4
|
|
|
|
@@ -56,87 +34,68 @@ var SirsoftAdminBasic=(function(Q,c,b,ar){"use strict";function eg(e){const t=Ob
|
|
|
|
|
dark:[&_td]:border-gray-600
|
|
|
|
|
[&_tr:hover]:bg-gray-50 dark:[&_tr:hover]:bg-gray-700/50
|
|
|
|
|
after:content-[''] after:block after:clear-both
|
|
|
|
|
${a}
|
|
|
|
|
`.trim().replace(/\s+/g," ");return c.jsx(_,{className:l,dangerouslySetInnerHTML:{__html:i}})},ma=window.G7Core?.createLogger?.("Comp:DataGrid")??{log:(...e)=>console.log("[Comp:DataGrid]",...e),warn:(...e)=>console.warn("[Comp:DataGrid]",...e),error:(...e)=>console.error("[Comp:DataGrid]",...e)},Cn=(e,t)=>window.G7Core?.t?.(e,t)??e,Xo={Div:_,Span:Z,Button:re,Icon:ne,Checkbox:Xt,P:ut,A:jr,Label:Ft,Input:ft,H1:Ao,H2:Er,H3:Hr,H4:ji,Img:or,Select:zr,Textarea:vr,Table:Po,Thead:$o,Tbody:Fo,Tfoot:Uo,Tr:yr,Th:Gr,Td:_t,MultilingualInput:Vo,Toggle:Ho,StatusBadge:ga,Badge:qi,HtmlContent:Ko,ActionMenu:mn},Zo=e=>{if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.map(t=>Zo(t)).join(", ");if(typeof e=="object"){if(b.isValidElement(e))return e;if(Object.keys(e).length===0)return"";try{return JSON.stringify(e)}catch{return ma.warn("객체를 문자열로 변환할 수 없습니다:",e),"[Object]"}}return String(e)},il=(e,t)=>{if(!e)return!0;const n=e.match(/^\{\{(.+)\}\}$/);if(!n)return!0;const a=n[1].trim();try{return!!new Function("row",`return ${a}`)(t)}catch(r){return ma.warn("subRow 조건 평가 실패:",e,r),!0}},Sn=(e,t,n,a="",r)=>{const o=window.G7Core;if(o?.renderItemChildren){const s={row:t,value:n,$value:n};return o.renderItemChildren(e,s,Xo,a,r?{componentContext:r}:void 0)}return ma.warn("G7Core.renderItemChildren을 사용할 수 없습니다."),null},Qo=(e,t,n="",a)=>{const r=window.G7Core;if(r?.renderItemChildren){const o={row:t,$value:t};return r.renderItemChildren(e,o,Xo,n,a?{componentContext:a}:void 0)}return ma.warn("G7Core.renderItemChildren을 사용할 수 없습니다."),null},$g=({id:e,columns:t,data:n,sortable:a=!0,pagination:r=!1,pageSize:o=10,onRowClick:s,className:i="",style:l,sortField:g,sortDirection:d,onSortChange:u,selectable:f=!1,selectedIds:h=[],onSelectionChange:v,idField:p="id",showColumnSelector:x=!1,visibleColumns:m,onColumnVisibilityChange:T,responsiveBreakpoint:C=768,cardRenderer:S,rowActions:N,onRowAction:E,alwaysShowPagination:k=!1,serverSidePagination:y=!1,serverCurrentPage:w,serverTotalPages:A,onPageChange:D,prevText:F,nextText:M,columnSelectorText:L,emptyMessage:U,actionsColumnHeader:O,requiredText:I,selectedCountText:H,showFirstLast:$=!0,expandable:z=!1,expandedRowIds:G,onExpandChange:j,expandChildren:W,expandedRowRender:B,expandColumnWidth:V="48px",expandIconExpanded:Y=de.ChevronDown,expandIconCollapsed:R=de.ChevronRight,expandConditionField:ae,dynamicColumns:ee,dynamicColumnsInsertAfter:X,expandContext:oe,__componentContext:se,subRowChildren:pe,subRowCondition:we,subRowClassName:ce="px-6 py-2 bg-gray-50 dark:bg-gray-750",subRowRender:me,footerCells:ge,footerClassName:_e="bg-gray-50 dark:bg-gray-800/50 font-medium",footerCardChildren:Be})=>{const Ye=F||void 0,te=M||void 0,Ie=L??Cn("common.column_selector"),De=U??Cn("common.no_data"),Ae=O??Cn("common.actions"),Fe=I??Cn("common.required"),Qe=H??Cn("common.selected_count"),rt=window.G7Core,$e=rt?.useControllableState,st=rt?.shallowArrayEqual,[J,be]=$e?$e(g,null,K=>{K!==null&&u?.(K,he)}):[g??null,()=>{}],[he,xe]=$e?$e(d,"asc",K=>{J!==null&&u?.(J,K)}):[d??"asc",()=>{}],[ue,Pe]=b.useState(1),[Ce,Ue]=$e?$e(G,[],j,{isEqual:st}):[G??[],()=>{}],[Oe,Je]=b.useState(!1),qe=b.useRef(null),dt=rt?.useResponsive,fe=dt?.(),Le=fe?fe.width<C:typeof window<"u"&&window.innerWidth<C,He=b.useMemo(()=>{if(!ee||!Array.isArray(ee)||ee.length===0)return t;if(X){const K=t.findIndex(le=>le.field===X);if(K!==-1)return[...t.slice(0,K+1),...ee,...t.slice(K+1)]}return[...t,...ee]},[t,ee,X]),[Re,at]=b.useState(()=>m&&m.length>0?m:t.filter(K=>!K.hidden).map(K=>K.field));b.useEffect(()=>{m&&m.length>0&&at(m)},[m]);const tt=b.useRef("");b.useEffect(()=>{const K=t.map(le=>le.field).join(",");tt.current&&K!==tt.current&&(!m||m.length===0)&&at(t.filter(le=>!le.hidden).map(le=>le.field)),tt.current=K},[t,m]);const ot=b.useRef([]),qt=b.useRef(null);b.useEffect(()=>{if(ee&&ee.length>0){const K=ee.map(Ve=>Ve.field);if(qt.current===null&&(qt.current=m!==void 0&&m.length>0,qt.current)){ot.current=K;return}const le=ot.current,ve=K.filter(Ve=>!le.includes(Ve));if(ve.length>0){const Ve=ve.filter(Ne=>!Re.includes(Ne));if(Ve.length>0){const Ne=[...Re,...Ve];at(Ne),T?.(Ne)}}ot.current=K}},[ee]),b.useEffect(()=>{y||Pe(1)},[n,y]),b.useEffect(()=>{const K=le=>{qe.current&&!qe.current.contains(le.target)&&Je(!1)};return Oe&&document.addEventListener("mousedown",K),()=>document.removeEventListener("mousedown",K)},[Oe]);const et=b.useMemo(()=>!x&&(!m||m.length===0)?He.filter(K=>!K.hidden):He.filter(K=>Re.includes(K.field)),[He,Re,x,m]),kt=b.useMemo(()=>!J||!a||!n?n||[]:[...n].sort((K,le)=>{const ve=K[J],Ve=le[J];if(ve===Ve)return 0;const Ne=ve>Ve?1:-1;return he==="asc"?Ne:-Ne}),[n,J,he,a]),We=b.useMemo(()=>{if(y||!r)return kt;const K=(ue-1)*o,le=K+o;return kt.slice(K,le)},[kt,ue,o,r,y]),it=y?w||1:ue,At=y?A||1:Math.ceil((kt?.length||0)/o),nr=b.useCallback(K=>{y&&D?D(K):Pe(K)},[y,D]),jt=K=>{if(!a||t.find(
Line truncated
|
|
|
|
|
px-4 py-2 rounded-md font-medium transition-colors
|
|
|
|
|
focus:outline-none focus:ring-2 focus:ring-offset-2
|
|
|
|
|
disabled:opacity-50 disabled:cursor-not-allowed
|
|
|
|
|
${u[f.variant||"primary"]}
|
|
|
|
|
`,children:[f.iconName&&c.jsx(ne,{name:f.iconName,className:"w-4 h-4 mr-2 inline-block"}),f.label]},h))})]})},rs=(e,t)=>window.G7Core?.t?.(e,t)??e,pl=({isOpen:e,onClose:t,title:n,message:a,confirmText:r,cancelText:o,onConfirm:s,onCancel:i,confirmButtonVariant:l="primary",cancelButtonVariant:g="secondary",width:d="500px",closeOnOverlay:u=!0,isLoading:f=!1,loadingText:h})=>{const v=r??rs("common.confirm"),p=o??rs("common.cancel"),x=h??rs("common.loading"),m=()=>{s()},T=()=>{f||(i?.(),t())},C=()=>{f||t()},S={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-600",danger:"bg-red-600 text-white hover:bg-red-700",ghost:"bg-transparent text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"};return c.jsxs(va,{isOpen:e,onClose:C,title:n,width:d,children:[c.jsx(_,{className:"py-2",children:typeof a=="string"?c.jsx(ut,{className:"text-gray-700 dark:text-gray-300",children:a}):a}),c.jsxs(_,{className:"flex justify-end gap-3 mt-6",children:[c.jsx(re,{onClick:T,disabled:f,className:"px-4 py-2 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:c.jsx(Z,{children:p})}),c.jsxs(re,{onClick:m,disabled:f,className:`flex items-center gap-2 px-4 py-2 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed ${S[l]}`,children:[f&&c.jsx(ne,{name:de.Spinner,className:"w-4 h-4 animate-spin"}),c.jsx(Z,{children:f?x:v})]})]})]})},n0=(e,t)=>window.G7Core?.t?.(e,t)??e,a0=({isOpen:e,onClose:t,title:n,message:a,confirmText:r,onConfirm:o,confirmButtonVariant:s="primary",width:i="500px",closeOnOverlay:l=!0})=>{const u=[{label:r??n0("common.confirm"),onClick:()=>{o?.(),t()},variant:s}],f=typeof a=="string"?c.jsx(ut,{className:"text-gray-700 dark:text-gray-300",children:a}):a;return c.jsx(hl,{isOpen:e,onClose:t,title:n,content:f,actions:u,width:i,closeOnOverlay:l})},o0=(e,t)=>window.G7Core?.t?.(e,t)??e,s0={success:de.CheckCircle,error:de.XCircle,warning:de.ExclamationTriangle,info:de.InfoCircle},bl={success:{bg:"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800",text:"text-green-800 dark:text-green-300"},error:{bg:"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800",text:"text-red-800 dark:text-red-300"},warning:{bg:"bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800",text:"text-yellow-800 dark:text-yellow-300"},info:{bg:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",text:"text-blue-800 dark:text-blue-300"}},i0={"top-left":"top-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-center":"bottom-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4"},l0=({toasts:e,position:t="bottom-center",duration:n=3e3,onRemove:a})=>{const[r,o]=b.useState(new Map),s=b.useCallback(i=>{o(l=>{const g=new Map(l);return g.set(i,!1),g}),setTimeout(()=>{if(a)a(i);else{const l=window.G7Core;l?.state?.update&&l.state.update(g=>({toasts:(Array.isArray(g.toasts)?g.toasts:[]).filter(u=>u.id!==i)}))}},300)},[a]);return b.useEffect(()=>{!e||e.length===0||e.forEach(i=>{if(r.has(i.id))return;o(g=>{const d=new Map(g);return d.set(i.id,!0),d});const l=i.duration||n;l>0&&setTimeout(()=>{s(i.id)},l)})},[e,n,s,r]),!e||e.length===0?null:c.jsx(_,{className:`fixed z-[9999] flex flex-col gap-2 ${i0[t]}`,"aria-live":"polite","aria-atomic":"true",children:e.map(i=>c.jsx(c0,{toast:i,position:t,isVisible:r.get(i.id)??!0,onClose:()=>s(i.id)},i.id))})},c0=({toast:e,position:t,isVisible:n,onClose:a})=>{const r=bl[e.type]||bl.info,o=e.icon?e.icon:s0[e.type],s=t.startsWith("bottom")?"translate-y-2":"-translate-y-2";return c.jsxs(_,{className:`
|
|
|
|
|
${r}
|
|
|
|
|
`.trim().replace(/\s+/g," ");return h.jsx(I,{className:d,dangerouslySetInnerHTML:{__html:c},id:o,...i})},zo=window.G7Core?.createLogger?.("Comp:DataGrid")??{log:(...t)=>console.log("[Comp:DataGrid]",...t),warn:(...t)=>console.warn("[Comp:DataGrid]",...t),error:(...t)=>console.error("[Comp:DataGrid]",...t)},Cs=(t,e)=>window.G7Core?.t?.(t,e)??t,Ka={Div:I,Span:Q,Button:oe,Icon:re,Checkbox:vn,P:bt,A:Lr,Label:en,Input:wt,H1:Ta,H2:Zn,H3:Ir,H4:_d,Img:yn,Select:Pr,Textarea:qn,Table:La,Thead:Pa,Tbody:$a,Tfoot:Fa,Tr:Qn,Th:$r,Td:Yt,MultilingualInput:Va,Toggle:za,StatusBadge:Po,Badge:Dd,HtmlContent:Xa,ActionMenu:bs},qa=t=>{if(t==null)return"";if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t))return t.map(e=>qa(e)).join(", ");if(typeof t=="object"){if(v.isValidElement(t))return t;if(Object.keys(t).length===0)return"";try{return JSON.stringify(t)}catch{return zo.warn("객체를 문자열로 변환할 수 없습니다:",t),"[Object]"}}return String(t)},Yd=(t,e)=>{if(!t)return!0;const n=t.match(/^\{\{(.+)\}\}$/);if(!n)return!0;const r=n[1].trim();try{return!!new Function("row",`return ${r}`)(e)}catch(s){return zo.warn("subRow 조건 평가 실패:",t,s),!0}},Ss=(t,e,n,r="",s)=>{const o=window.G7Core;if(o?.renderItemChildren){const i={row:e,value:n,$value:n};return o.renderItemChildren(t,i,Ka,r,s?{componentContext:s}:void 0)}return zo.warn("G7Core.renderItemChildren을 사용할 수 없습니다."),null},Za=(t,e,n="",r)=>{const s=window.G7Core;if(s?.renderItemChildren){const o={row:e,$value:e};return s.renderItemChildren(t,o,Ka,n,r?{componentContext:r}:void 0)}return zo.warn("G7Core.renderItemChildren을 사용할 수 없습니다."),null},Lb=({id:t,columns:e,data:n,sortable:r=!0,pagination:s=!1,pageSize:o=10,onRowClick:i,className:a="",style:l,sortField:c,sortDirection:d,onSortChange:u,selectable:f=!1,selectedIds:g=[],onSelectionChange:m,idField:p="id",showColumnSelector:y=!1,visibleColumns:b,onColumnVisibilityChange:S,responsiveBreakpoint:x=768,cardRenderer:E,rowActions:k,onRowAction:C,alwaysShowPagination:N=!1,serverSidePagination:_=!1,serverCurrentPage:w,serverTotalPages:M,onPageChange:O,prevText:L,nextText:$,columnSelectorText:F,emptyMessage:D,actionsColumnHeader:A,requiredText:T,selectedCountText:V,showFirstLast:H=!0,expandable:W=!1,expandedRowIds:j,onExpandChange:U,expandChildren:B,expandedRowRender:G,expandColumnWidth:z="48px",expandIconExpanded:K=de.ChevronDown,expandIconCollapsed:X=de.ChevronRight,expandConditionField:Z,dynamicColumns:ee,dynamicColumnsInsertAfter:ne,expandContext:he,__componentContext:J,subRowChildren:ce,subRowCondition:ue,subRowClassName:ie="px-6 py-2 bg-gray-50 dark:bg-gray-900",subRowRender:ve,footerCells:fe,footerClassName:ye="bg-gray-50 dark:bg-gray-800/50 font-medium",footerCardChildren:Se,editorAttrs:He})=>{const se=L||void 0,Ae=$||void 0,Le=F??Cs("common.column_selector"),Ie=D??Cs("common.no_data"),Be=A??Cs("common.actions"),st=T??Cs("common.required"),ft=V??Cs("common.selected_count"),je=window.G7Core,Je=je?.useControllableState,Xe=je?.shallowArrayEqual,[te,ge]=Je?Je(c,null,q=>{q!==null&&u?.(q,pe)}):[c??null,()=>{}],[pe,me]=Je?Je(d,"asc",q=>{te!==null&&u?.(te,q)}):[d??"asc",()=>{}],[be,Ue]=v.useState(1),[Me,Fe]=Je?Je(j,[],U,{isEqual:Xe}):[j??[],()=>{}],[_e,ot]=v.useState(!1),it=v.useRef(null),we=je?.useResponsive,Ee=we?.(),ze=Ee?Ee.width<x:typeof window<"u"&&window.innerWidth<x,qe=v.useMemo(()=>{if(!ee||!Array.isArray(ee)||ee.length===0)return e;if(ne){const q=e.findIndex(le=>le.field===ne);if(q!==-1)return[...e.slice(0,q+1),...ee,...e.slice(q+1)]}return[...e,...ee]},[e,ee,ne]),[Re,nt]=v.useState(()=>b&&b.length>0?b:e.filter(q=>!q.hidden).map(q=>q.field));v.useEffect(()=>{b&&b.length>0&&nt(b)},[b]);const gt=v.useRef("");v.useEffect(()=>{const q=e.map(le=>le.field).join(",");gt.current&&q!==gt.current&&(!b||b.length===0)&&nt(e.filter(le=>!le.hidden).map(le=>le.field)),gt.current=q},[e,b]);const mn=v.useRef([]),mt=v.useRef(null);v.useEffect(()=>{if(ee&&ee.length>0){const q=ee.map(We=>We.field);if(mt.current===null&&(mt.current=b!==void 0&&b.length>0,mt.current)){mn.current=q;return}const le=mn.current,ke=q.filter(We=>!le.includes(We));if(ke.length>0){const We=ke.filter(Pe=>!Re.includes(Pe));if(We.length>0){const Pe=[...Re,...We];nt(Pe),S?.(Pe)}}mn.current=q}},[ee]),v.useEffect(()=>{_||Ue(1)},[n,_]),v.useEffect(()=>{const q=le=>{it.current&&!it.current.contains(le.target)&&ot(!1)};return _e&&document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[_e]);const xt=v.useMemo(()=>!y&&(!b||b.length===0)?qe.filter(q=>!q.hidden):qe.filter(q=>Re.includes(q.field)),[qe,Re,y,b]),Dt=v.useMemo(()=>!te||!r||!n?n||[]:u?n:[...n].sort((q,le)=>{const ke=q[te],We=le[te];if(ke===We)return 0;const Pe=ke>We?1:-1;return pe==="asc"?Pe:-Pe}),[n,te,pe,r,u]),Ve=v.useMemo(()=>{if(_||!s)return Dt;const q=(be-1)*o,le=q+o;return Dt.slice(q,le)},[Dt,be,o,s,_]),sn=_?w||1:be,on=_?M||1:Math.ceil((Dt?.length||0)/o),Rt=v.useCallback(q=>{_&&O?
Line truncated
|
|
|
|
|
flex items-center gap-3 p-4 rounded-lg border shadow-lg
|
|
|
|
|
min-w-[300px] max-w-md
|
|
|
|
|
transition-all duration-300
|
|
|
|
|
${r.bg}
|
|
|
|
|
${n?"opacity-100 translate-y-0":`opacity-0 ${s}`}
|
|
|
|
|
`,role:"alert",children:[c.jsx(ne,{name:o,className:`w-5 h-5 flex-shrink-0 ${r.text}`}),c.jsx(Z,{className:`flex-1 text-sm font-medium ${r.text}`,children:e.message}),c.jsx(re,{onClick:a,className:`flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 ${r.text} focus:outline-none`,"aria-label":o0("common.close_notification"),children:c.jsx(ne,{name:de.Times,className:"w-4 h-4"})})]})},ml=({items:e,separator:t=c.jsx(ne,{name:de.ChevronRight,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),showHome:n=!1,homeHref:a="/",maxItems:r,className:o=""})=>{let i=n?[{label:"Home",href:a},...e]:e,l=i,g=!1;if(r&&i.length>r){g=!0;const d=i.slice(0,1),u=i.slice(-(r-2));l=[...d,...u]}return c.jsx(ua,{className:`flex items-center space-x-2 text-sm ${o}`,"aria-label":"Breadcrumb",children:c.jsx(_,{className:"flex items-center space-x-2",children:l.map((d,u)=>{const f=u===l.length-1,h=u===0;return c.jsxs(b.Fragment,{children:[g&&h&&c.jsxs(c.Fragment,{children:[c.jsx(vl,{item:d,isLast:!1}),c.jsx(Z,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:t}),c.jsx(Z,{className:"text-gray-500 dark:text-gray-400",children:"..."}),l.length>1&&c.jsx(Z,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:t})]}),(!g||!h)&&c.jsxs(c.Fragment,{children:[c.jsx(vl,{item:d,isLast:f}),!f&&c.jsx(Z,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:t})]})]},u)})})})},vl=({item:e,isLast:t})=>t||!e.href&&!e.onClick?c.jsx(Z,{className:"font-medium text-gray-900 dark:text-white","aria-current":t?"page":void 0,children:e.label}):e.onClick?c.jsx(jr,{href:"#",onClick:n=>{n.preventDefault(),e.onClick?.()},className:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 transition-colors",children:e.label}):c.jsx(jr,{href:e.href,className:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 transition-colors",children:e.label}),d0=({title:e,description:t,iconName:n,illustrationSrc:a,illustrationAlt:r="Empty state illustration",actions:o=[],className:s=""})=>{const i={primary:"bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",secondary:"bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-600 focus:ring-gray-500",danger:"bg-red-600 text-white hover:bg-red-700 focus:ring-red-500",ghost:"bg-transparent text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-gray-500"};return c.jsxs(_,{className:`flex flex-col items-center justify-center p-8 text-center ${s}`,role:"status","aria-live":"polite",children:[a?c.jsx(or,{src:a,alt:r,className:"w-48 h-48 mb-6 object-contain"}):n?c.jsx(_,{className:"mb-6 p-4 rounded-full bg-gray-100 dark:bg-gray-700",children:c.jsx(ne,{name:n,className:"w-12 h-12 text-gray-400 dark:text-gray-500"})}):null,c.jsx(Er,{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:e}),t&&c.jsx(ut,{className:"text-gray-600 dark:text-gray-400 mb-6 max-w-md",children:t}),o.length>0&&c.jsx(_,{className:"flex flex-wrap gap-3 justify-center",children:o.map((l,g)=>c.jsxs(re,{onClick:l.onClick,className:`
|
|
|
|
|
${s.bg}
|
|
|
|
|
${n?"opacity-100 translate-y-0":`opacity-0 ${i}`}
|
|
|
|
|
`,role:"alert",children:[h.jsx(re,{name:o,className:`w-5 h-5 flex-shrink-0 ${s.text}`}),h.jsx(Q,{className:`flex-1 text-sm font-medium ${s.text}`,children:t.message}),h.jsx(oe,{onClick:r,className:`flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 ${s.text} focus:outline-none`,"aria-label":ry("common.close_notification"),children:h.jsx(re,{name:de.Times,className:"w-4 h-4"})})]})},nu=({items:t,separator:e=h.jsx(re,{name:de.ChevronRight,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),showHome:n=!1,homeHref:r="/",maxItems:s,className:o="",id:i,editorAttrs:a})=>{let c=n?[{label:"Home",href:r},...t]:t,d=c,u=!1;if(s&&c.length>s){u=!0;const f=c.slice(0,1),g=c.slice(-(s-2));d=[...f,...g]}return h.jsx(Io,{className:`flex items-center space-x-2 text-sm ${o}`,"aria-label":"Breadcrumb",id:i,...a,children:h.jsx(I,{className:"flex items-center space-x-2",children:d.map((f,g)=>{const m=g===d.length-1,p=g===0;return h.jsxs(v.Fragment,{children:[u&&p&&h.jsxs(h.Fragment,{children:[h.jsx(ru,{item:f,isLast:!1}),h.jsx(Q,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:e}),h.jsx(Q,{className:"text-gray-500 dark:text-gray-400",children:"..."}),d.length>1&&h.jsx(Q,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:e})]}),(!u||!p)&&h.jsxs(h.Fragment,{children:[h.jsx(ru,{item:f,isLast:m}),!m&&h.jsx(Q,{className:"text-gray-400 dark:text-gray-500","aria-hidden":"true",children:e})]})]},g)})})})},ru=({item:t,isLast:e})=>e||!t.href&&!t.onClick?h.jsx(Q,{className:"font-medium text-gray-900 dark:text-white","aria-current":e?"page":void 0,children:t.label}):t.onClick?h.jsx(Lr,{href:"#",onClick:n=>{n.preventDefault(),t.onClick?.()},className:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 transition-colors",children:t.label}):h.jsx(Lr,{href:t.href,className:"text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 transition-colors",children:t.label}),ly=({title:t,description:e,iconName:n,illustrationSrc:r,illustrationAlt:s="Empty state illustration",actions:o=[],className:i="",id:a,editorAttrs:l})=>{const c={primary:"bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500",secondary:"bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-600 focus:ring-gray-500",danger:"bg-red-600 text-white hover:bg-red-700 focus:ring-red-500",ghost:"bg-transparent text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 focus:ring-gray-500"};return h.jsxs(I,{className:`flex flex-col items-center justify-center p-8 text-center ${i}`,role:"status","aria-live":"polite",id:a,...l,children:[r?h.jsx(yn,{src:r,alt:s,className:"w-48 h-48 mb-6 object-contain"}):n?h.jsx(I,{className:"mb-6 p-4 rounded-full bg-gray-100 dark:bg-gray-700",children:h.jsx(re,{name:n,className:"w-12 h-12 text-gray-400 dark:text-gray-500"})}):null,h.jsx(Zn,{className:"text-xl font-semibold text-gray-900 dark:text-white mb-2",children:t}),e&&h.jsx(bt,{className:"text-gray-600 dark:text-gray-400 mb-6 max-w-md",children:e}),o.length>0&&h.jsx(I,{className:"flex flex-wrap gap-3 justify-center",children:o.map((d,u)=>h.jsxs(oe,{onClick:d.onClick,className:`
|
|
|
|
|
px-4 py-2 rounded-md font-medium transition-colors
|
|
|
|
|
focus:outline-none focus:ring-2 focus:ring-offset-2
|
|
|
|
|
${i[l.variant||"primary"]}
|
|
|
|
|
`,children:[l.iconName&&c.jsx(ne,{name:l.iconName,className:"w-4 h-4 mr-2 inline-block"}),l.label]},g))})]})},u0=(e,t)=>window.G7Core?.t?.(e,t)??e,f0=({id:e,size:t="md",color:n="text-blue-600",fullscreen:a=!1,text:r,className:o=""})=>{const s={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-2",lg:"w-12 h-12 border-3",xl:"w-16 h-16 border-4"},i={sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"},l=c.jsxs(_,{className:`flex flex-col items-center justify-center gap-3 ${o}`,children:[c.jsx(_,{className:`
|
|
|
|
|
${s[t]}
|
|
|
|
|
${c[d.variant||"primary"]}
|
|
|
|
|
`,children:[d.iconName&&h.jsx(re,{name:d.iconName,className:"w-4 h-4 mr-2 inline-block"}),d.label]},u))})]})},cy=(t,e)=>window.G7Core?.t?.(t,e)??t,dy=({id:t,size:e="md",color:n="text-blue-600",fullscreen:r=!1,text:s,className:o="",editorAttrs:i})=>{const a={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-2",lg:"w-12 h-12 border-3",xl:"w-16 h-16 border-4"},l={sm:"text-xs",md:"text-sm",lg:"text-base",xl:"text-lg"},c=h.jsxs(I,{className:`flex flex-col items-center justify-center gap-3 ${o}`,children:[h.jsx(I,{className:`
|
|
|
|
|
${a[e]}
|
|
|
|
|
border-gray-200 dark:border-gray-700 border-t-current
|
|
|
|
|
rounded-full animate-spin
|
|
|
|
|
${n}
|
|
|
|
|
`,role:"status","aria-label":u0("common.loading")}),r&&c.jsx(Z,{className:`${i[t]} ${n} font-medium`,children:r})]});return a?c.jsx(_,{id:e,className:"fixed inset-0 z-50 flex items-center justify-center bg-white dark:bg-gray-900 bg-opacity-90 dark:bg-opacity-90","aria-live":"polite","aria-busy":"true",children:l}):c.jsx(_,{id:e,className:"flex items-center justify-center p-4","aria-live":"polite","aria-busy":"true",children:l})},lt=({className:e="",children:t,style:n,...a})=>c.jsx("i",{className:e,style:n,...a,children:t}),Wr=()=>window.G7Core,ns=(e,t)=>window.G7Core?.t?.(e,t)??e,g0=({logo:e,logoAlt:t="Logo",menu:n=[],collapsed:a=!1,onToggleCollapse:r,className:o="",currentLocale:s})=>{const[i,l]=b.useState(new Set),[g,d]=b.useState(s||Wr()?.locale?.current?.()||"ko"),[u,f]=b.useState(window.location.pathname),h=b.useMemo(()=>{const k=[],y=w=>{for(const A of w)A.url&&k.push(A.url),A.children&&y(A.children)};return y(n),k},[n]),v=b.useCallback(k=>{let y=null;for(const w of h)(k===w||k.startsWith(w+"/"))&&(!y||w.length>y.length)&&(y=w);return y},[h]);b.useEffect(()=>{const k=Wr();return k?.state?.subscribe?k.state.subscribe(w=>{const A=w?._global?.locale||k?.locale?.current?.()||"ko";d(A);const D=w?._global?.currentPath||window.location.pathname;f(D)}):void 0},[]),b.useEffect(()=>{const k=()=>{f(window.location.pathname)};return window.addEventListener("popstate",k),()=>window.removeEventListener("popstate",k)},[]),b.useEffect(()=>{s&&d(s)},[s]);const p=(k,y)=>!k||typeof y!="string"?!1:y===k?!0:y.startsWith(k+"/")?v(y)===k:!1,x=(k,y)=>{const w=new Set,A=D=>{for(const F of D)if(F.children&&F.children.length>0){if(A(F.children)||p(F.url,y))return w.add(F.id),!0}else if(p(F.url,y))return!0;return!1};return A(k),w};b.useEffect(()=>{if(n.length>0&&u){const k=x(n,u);k.size>0&&l(y=>new Set([...y,...k]))}},[u,n]);const m=k=>p(k,u),T=k=>k.children?k.children.some(y=>m(y.url)||T(y)):!1,C=k=>{l(y=>{const w=new Set(y);return w.has(k)?w.delete(k):w.add(k),w})},S=k=>typeof k=="string"?k:k[g]||k.en||Object.values(k)[0]||"",N=(k,y)=>{Wr()?.dispatch?(k.preventDefault(),Wr().navigation?.onComplete(()=>{Wr().dispatch({handler:"setState",params:{target:"global",sidebarOpen:!1}})}),Wr().dispatch({handler:"navigate",params:{path:y}})):window.location.href=y},E=(k,y=0)=>{const w=k.children&&k.children.length>0,A=i.has(k.id),D=y*16+16,F=S(k.name),M=m(k.url),L=T(k),U="w-full flex items-center justify-between px-4 py-3 transition-colors",O="bg-blue-50 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400 border-l-4 border-blue-500",I="text-blue-600 dark:text-blue-400",H="text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700";return c.jsxs(_,{children:[w&&k.url?c.jsxs(_,{className:`
|
|
|
|
|
${U}
|
|
|
|
|
${M?O:L?I:H}
|
|
|
|
|
${a?"justify-center":""}
|
|
|
|
|
`,style:{paddingLeft:a?void 0:`${D}px`},children:[c.jsxs(re,{onClick:z=>N(z,k.url),className:"flex items-center justify-start flex-1 min-w-0",children:[k.icon&&c.jsx(lt,{className:`${k.icon} ${a?"":"mr-3"} w-5 h-5 flex items-center justify-center`}),!a&&c.jsx(Z,{className:"truncate",children:F})]}),!a&&c.jsxs(_,{className:"flex items-center gap-1",children:[k.module_id&&c.jsx(lt,{className:"fas fa-cube w-3 h-3 mr-2 text-gray-400 dark:text-gray-500 opacity-60",title:"모듈 메뉴"}),c.jsx(re,{onClick:()=>C(k.id),className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600","aria-label":ns(A?"common.collapse":"common.expand"),children:c.jsx(lt,{className:`fas fa-chevron-down w-4 h-4 transition-transform ${A?"rotate-180":""}`})})]})]}):w?c.jsxs(re,{onClick:()=>C(k.id),className:`
|
|
|
|
|
${U}
|
|
|
|
|
${L?I:H}
|
|
|
|
|
${a?"justify-center":""}
|
|
|
|
|
`,style:{paddingLeft:a?void 0:`${D}px`},children:[c.jsxs(_,{className:"flex items-center",children:[k.icon&&c.jsx(lt,{className:`${k.icon} ${a?"":"mr-3"} w-5 h-5 flex items-center justify-center`}),!a&&c.jsx(Z,{children:F})]}),!a&&c.jsxs(_,{className:"flex items-center gap-1",children:[k.module_id&&c.jsx(lt,{className:"fas fa-cube w-3 h-3 mr-2 text-gray-400 dark:text-gray-500 opacity-60",title:"모듈 메뉴"}),c.jsx(lt,{className:`fas fa-chevron-down w-4 h-4 transition-transform ${A?"rotate-180":""}`})]})]}):k.url?c.jsxs(re,{onClick:z=>N(z,k.url),className:`
|
|
|
|
|
${U}
|
|
|
|
|
${M?O:H}
|
|
|
|
|
${a?"justify-center":""}
|
|
|
|
|
`,role:"status","aria-label":cy("common.loading")}),s&&h.jsx(Q,{className:`${l[e]} ${n} font-medium`,children:s})]});return r?h.jsx(I,{id:t,className:"fixed inset-0 z-50 flex items-center justify-center bg-white dark:bg-gray-900 bg-opacity-90 dark:bg-opacity-90","aria-live":"polite","aria-busy":"true",...i,children:c}):h.jsx(I,{id:t,className:"flex items-center justify-center p-4","aria-live":"polite","aria-busy":"true",...i,children:c})},Vr=()=>window.G7Core,nl=(t,e)=>window.G7Core?.t?.(t,e)??t,uy=({logo:t,logoAlt:e="Logo",menu:n=[],collapsed:r=!1,onToggleCollapse:s,className:o="",currentLocale:i,id:a,editorAttrs:l})=>{const[c,d]=v.useState(new Set),[u,f]=v.useState(i||Vr()?.locale?.current?.()||"ko"),[g,m]=v.useState(window.location.pathname),p=v.useMemo(()=>{const w=[],M=O=>{for(const L of O)L.url&&w.push(L.url),L.children&&M(L.children)};return M(n),w},[n]),y=v.useCallback(w=>{let M=null;for(const O of p)(w===O||w.startsWith(O+"/"))&&(!M||O.length>M.length)&&(M=O);return M},[p]);v.useEffect(()=>{const w=Vr();return w?.state?.subscribe?w.state.subscribe(O=>{const L=O?._global?.locale||w?.locale?.current?.()||"ko";f(L);const $=O?._global?.currentPath||window.location.pathname;m($)}):void 0},[]),v.useEffect(()=>{const w=()=>{m(window.location.pathname)};return window.addEventListener("popstate",w),()=>window.removeEventListener("popstate",w)},[]),v.useEffect(()=>{i&&f(i)},[i]);const b=(w,M)=>!w||typeof M!="string"?!1:M===w?!0:M.startsWith(w+"/")?y(M)===w:!1,S=(w,M)=>{const O=new Set,L=$=>{for(const F of $)if(F.children&&F.children.length>0){if(L(F.children)||b(F.url,M))return O.add(F.id),!0}else if(b(F.url,M))return!0;return!1};return L(w),O};v.useEffect(()=>{if(n.length>0&&g){const w=S(n,g);w.size>0&&d(M=>new Set([...M,...w]))}},[g,n]);const x=w=>b(w,g),E=w=>w.children?w.children.some(M=>x(M.url)||E(M)):!1,k=w=>{d(M=>{const O=new Set(M);return O.has(w)?O.delete(w):O.add(w),O})},C=w=>typeof w=="string"?w:w[u]||w.en||Object.values(w)[0]||"",N=(w,M)=>{Vr()?.dispatch?(w.preventDefault(),Vr().navigation?.onComplete(()=>{Vr().dispatch({handler:"setState",params:{target:"global",sidebarOpen:!1}})}),Vr().dispatch({handler:"navigate",params:{path:M}})):window.location.href=M},_=(w,M=0,O=!1)=>{const L=w.children&&w.children.length>0,$=c.has(w.id),F=C(w.name),D=M>0,A=x(w.url),T=E(w),V=D?"admin-sidebar-subitem":"admin-sidebar-item",H="admin-sidebar-item-active",W="admin-sidebar-item-active-parent",j="admin-sidebar-item-default";return h.jsxs(I,{className:D?"relative group":"",children:[D&&h.jsxs(h.Fragment,{children:[!O&&h.jsx(I,{className:"admin-sidebar-tree-line-vertical"}),h.jsx(I,{className:"admin-sidebar-tree-line-curve"})]}),L&&w.url?h.jsxs(I,{className:`
|
|
|
|
|
${V}
|
|
|
|
|
${A?H:T?W:j}
|
|
|
|
|
${r?"justify-center":""}
|
|
|
|
|
`,children:[h.jsxs(oe,{onClick:B=>N(B,w.url),className:"flex items-center justify-start flex-1 min-w-0",children:[w.icon&&h.jsx(pt,{className:`${w.icon} ${r?"":"mr-3"} w-5 h-5 flex items-center justify-center`}),!r&&h.jsx(Q,{className:"truncate",children:F})]}),!r&&h.jsxs(I,{className:"admin-sidebar-chevron-trail",children:[w.module_id&&h.jsx(pt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"}),h.jsx(oe,{onClick:()=>k(w.id),className:"p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-600","aria-label":nl($?"common.collapse":"common.expand"),children:h.jsx(pt,{className:`fas fa-chevron-down w-4 h-4 transition-transform ${$?"rotate-180":""}`})})]})]}):L?h.jsxs(oe,{onClick:()=>k(w.id),className:`
|
|
|
|
|
${V}
|
|
|
|
|
${T?W:j}
|
|
|
|
|
${r?"justify-center":""}
|
|
|
|
|
`,children:[h.jsxs(I,{className:"admin-sidebar-item-content",children:[w.icon&&h.jsx(I,{className:"admin-sidebar-icon-box",children:h.jsx(pt,{className:w.icon})}),!r&&h.jsx(Q,{children:F})]}),!r&&h.jsxs(I,{className:"admin-sidebar-chevron-trail",children:[w.module_id&&h.jsx(pt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"}),h.jsx(pt,{className:`fas fa-chevron-right w-4 h-4 text-slate-400 transition-transform duration-200 ${$?"rotate-90":""}`})]})]}):w.url?h.jsxs(oe,{onClick:B=>N(B,w.url),className:`
|
|
|
|
|
${V}
|
|
|
|
|
${A?H:j}
|
|
|
|
|
${r?"justify-center":""}
|
|
|
|
|
text-left
|
|
|
|
|
`,style:{paddingLeft:a?void 0:`${D}px`},children:[c.jsxs(_,{className:"flex items-center",children:[k.icon&&c.jsx(lt,{className:`${k.icon} ${a?"":"mr-3"} w-5 h-5 flex items-center justify-center`}),!a&&c.jsx(Z,{children:F})]}),!a&&k.module_id&&c.jsx(lt,{className:"fas fa-cube w-3 h-3 mr-2 text-gray-400 dark:text-gray-500 opacity-60",title:"모듈 메뉴"})]}):c.jsxs(re,{className:`
|
|
|
|
|
${U}
|
|
|
|
|
text-gray-400 dark:text-gray-500 cursor-default
|
|
|
|
|
${a?"justify-center":""}
|
|
|
|
|
`,children:[h.jsxs(I,{className:"admin-sidebar-item-content",children:[w.icon&&h.jsx(I,{className:"admin-sidebar-icon-box",children:h.jsx(pt,{className:w.icon})}),!r&&h.jsx(Q,{children:F})]}),!r&&w.module_id&&h.jsx(pt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"})]}):h.jsxs(oe,{className:`
|
|
|
|
|
${V}
|
|
|
|
|
admin-sidebar-item-disabled
|
|
|
|
|
${r?"justify-center":""}
|
|
|
|
|
text-left
|
|
|
|
|
`,style:{paddingLeft:a?void 0:`${D}px`},children:[c.jsxs(_,{className:"flex items-center",children:[k.icon&&c.jsx(lt,{className:`${k.icon} ${a?"":"mr-3"} w-5 h-5 flex items-center justify-center`}),!a&&c.jsx(Z,{children:F})]}),!a&&k.module_id&&c.jsx(lt,{className:"fas fa-cube w-3 h-3 mr-2 text-gray-400 dark:text-gray-500 opacity-60",title:"모듈 메뉴"})]}),w&&!a&&A&&c.jsx(_,{className:"bg-gray-50 dark:bg-gray-900",children:k.children.map(z=>E(z,y+1))})]},k.id)};return c.jsxs(_,{className:o,children:[(e||r)&&c.jsxs(_,{className:"flex items-center justify-between px-4 py-4 border-b border-gray-200 dark:border-gray-700",children:[e&&!a&&c.jsx(or,{src:e,alt:t,className:"h-8"}),r&&c.jsx(re,{onClick:r,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors","aria-label":ns(a?"common.expand_sidebar":"common.collapse_sidebar"),children:c.jsx(lt,{className:`${a?"fas fa-chevron-right":"fas fa-chevron-left"} w-5 h-5 text-gray-600 dark:text-gray-400`})})]}),c.jsx(_,{children:n.map(k=>E(k))})]})},En=(e,t)=>window.G7Core?.t?.(e,t)??e,h0=({user:e={name:"",email:""},notifications:t=[],onNotificationClick:n,onProfileClick:a,onLogoutClick:r,className:o=""})=>{const[s,i]=b.useState(!1),[l,g]=b.useState(!1),d=b.useRef(null),u=b.useRef(null),f=t.filter(h=>!h.read).length;return b.useEffect(()=>{const h=v=>{d.current&&!d.current.contains(v.target)&&i(!1),u.current&&!u.current.contains(v.target)&&g(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]),c.jsxs(_,{className:`
|
|
|
|
|
`,children:[h.jsxs(I,{className:"admin-sidebar-item-content",children:[w.icon&&h.jsx(I,{className:"admin-sidebar-icon-box",children:h.jsx(pt,{className:w.icon})}),!r&&h.jsx(Q,{children:F})]}),!r&&w.module_id&&h.jsx(pt,{className:"fas fa-cube admin-sidebar-module-icon",title:"모듈 메뉴"})]}),L&&!r&&$&&h.jsx(I,{className:"relative ml-2",children:w.children.map((B,G)=>_(B,M+1,G===w.children.length-1))})]},w.id)};return h.jsxs(I,{className:o,id:a,...l,children:[(t||s)&&h.jsxs(I,{className:"admin-sidebar-header",children:[t&&!r&&h.jsx(yn,{src:t,alt:e,className:"h-8"}),s&&h.jsx(oe,{onClick:s,className:"admin-sidebar-collapse-btn","aria-label":nl(r?"common.expand_sidebar":"common.collapse_sidebar"),children:h.jsx(pt,{className:`${r?"fas fa-chevron-right":"fas fa-chevron-left"} w-5 h-5 text-slate-600 dark:text-slate-400`})})]}),h.jsx(I,{className:"admin-sidebar-menu-list",children:n.map((w,M)=>_(w,0,M===n.length-1))})]})},_s=(t,e)=>window.G7Core?.t?.(t,e)??t,fy=({user:t={name:"",email:""},notifications:e=[],onNotificationClick:n,onProfileClick:r,onLogoutClick:s,className:o=""})=>{const[i,a]=v.useState(!1),[l,c]=v.useState(!1),d=v.useRef(null),u=v.useRef(null),f=e.filter(g=>!g.read).length;return v.useEffect(()=>{const g=m=>{d.current&&!d.current.contains(m.target)&&a(!1),u.current&&!u.current.contains(m.target)&&c(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]),h.jsxs(I,{className:`
|
|
|
|
|
bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 px-6 py-4 flex items-center justify-end gap-4
|
|
|
|
|
${o}
|
|
|
|
|
`,children:[c.jsxs(_,{ref:d,className:"relative",children:[c.jsxs(re,{onClick:()=>i(!s),className:"relative p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-full transition-colors","aria-label":En("common.notifications"),children:[c.jsx(ne,{name:de.Bell,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),f>0&&c.jsx(Z,{className:"absolute top-0 right-0 flex items-center justify-center w-5 h-5 text-xs font-bold text-white bg-red-500 rounded-full",children:f>9?"9+":f})]}),s&&c.jsxs(_,{className:"absolute right-0 mt-2 w-80 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[c.jsx(_,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:c.jsx(Z,{className:"font-semibold text-gray-900 dark:text-white",children:En("common.notifications")})}),c.jsx(_,{className:"max-h-96 overflow-y-auto",children:t.length===0?c.jsx(_,{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400",children:c.jsx(Z,{children:En("common.no_notifications")})}):t.map(h=>c.jsx(re,{onClick:()=>{h.onClick?.(),n?.(h.id),i(!1)},className:`
|
|
|
|
|
`,children:[h.jsxs(I,{ref:d,className:"relative",children:[h.jsxs(oe,{onClick:()=>a(!i),className:"relative p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-full transition-colors","aria-label":_s("common.notifications"),children:[h.jsx(re,{name:de.Bell,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),f>0&&h.jsx(Q,{className:"absolute top-0 right-0 flex items-center justify-center w-5 h-5 text-xs font-bold text-white bg-red-500 rounded-full",children:f>9?"9+":f})]}),i&&h.jsxs(I,{className:"absolute right-0 mt-2 w-80 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[h.jsx(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:h.jsx(Q,{className:"font-semibold text-gray-900 dark:text-white",children:_s("common.notifications")})}),h.jsx(I,{className:"max-h-96 overflow-y-auto",children:e.length===0?h.jsx(I,{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400",children:h.jsx(Q,{children:_s("common.no_notifications")})}):e.map(g=>h.jsx(oe,{onClick:()=>{g.onClick?.(),n?.(g.id),a(!1)},className:`
|
|
|
|
|
w-full px-4 py-3 text-left hover:bg-gray-50 dark:hover:bg-gray-700 border-b border-gray-100 dark:border-gray-700 transition-colors
|
|
|
|
|
${h.read?"":"bg-blue-50 dark:bg-blue-900/20"}
|
|
|
|
|
`,children:c.jsxs(_,{className:"flex items-start gap-3",children:[h.iconName&&c.jsx(ne,{name:h.iconName,className:"w-5 h-5 text-gray-600 dark:text-gray-400 mt-0.5"}),c.jsxs(_,{className:"flex-1",children:[c.jsx(_,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:h.title}),c.jsx(_,{className:"text-gray-600 dark:text-gray-400 text-sm mt-1",children:h.message}),c.jsx(_,{className:"text-gray-400 dark:text-gray-500 text-xs mt-1",children:h.time})]}),!h.read&&c.jsx(Z,{className:"w-2 h-2 bg-blue-500 rounded-full mt-1.5"})]})},h.id))})]})]}),c.jsxs(_,{ref:u,className:"relative",children:[c.jsxs(re,{onClick:()=>g(!l),className:"flex items-center gap-3 px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:[e.avatar?c.jsx(or,{src:e.avatar,alt:e.name,className:"w-8 h-8 rounded-full object-cover"}):c.jsx(_,{className:"w-8 h-8 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center",children:c.jsx(ne,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),c.jsxs(_,{className:"hidden md:block text-left",children:[c.jsx(_,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:e.name}),e.role&&c.jsx(_,{className:"text-gray-500 dark:text-gray-400 text-xs",children:e.role})]}),c.jsx(ne,{name:de.ChevronDown,className:"w-4 h-4 text-gray-600 dark:text-gray-400"})]}),l&&c.jsxs(_,{className:"absolute right-0 mt-2 w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[c.jsxs(_,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:[c.jsx(_,{className:"font-semibold text-gray-900 dark:text-white",children:e.name}),c.jsx(_,{className:"text-gray-500 dark:text-gray-400 text-sm",children:e.email})]}),c.jsxs(_,{className:"py-2",children:[c.jsxs(re,{onClick:()=>{a?.(),g(!1)},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors text-gray-900 dark:text-white",children:[c.jsx(ne,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),c.jsx(Z,{children:En("common.profile_settings")})]}),c.jsxs(re,{onClick:()=>{r?.(),g(!1)},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 text-red-600 dark:text-red-400 transition-colors",children:[c.jsx(ne,{name:de.ArrowRight,className:"w-5 h-5"}),c.jsx(Z,{children:En("common.logout")})]})]})]})]})]})},p0=({notifications:e=[],unreadCount:t=0,hasMore:n=!1,loading:a=!1,titleText:r="Notifications",emptyText:o="No notifications",markAllReadText:s="Mark all as read",deleteAllText:i="Delete all",unreadOnlyText:l="Unread only",unreadOnly:g=!1,onNotificationClick:d,onClose:u,onLoadMore:f,onMarkAllRead:h,onDeleteAll:v,onDelete:p,onUnreadOnlyToggle:x,dropdownAlign:m="right",className:T=""})=>{const[C,S]=b.useState(!1),N=b.useRef(null),E=b.useRef(null),k=b.useRef(null),y=b.useRef(null),w=b.useRef(new Set),A=b.useRef(f),D=b.useRef(n),F=b.useRef(a),M=b.useRef(e.length),L=b.useRef(-1);b.useEffect(()=>{A.current=f,D.current=n,F.current=a,M.current=e.length}),b.useEffect(()=>{if(!y.current||!k.current||!C)return;L.current=-1;const H=new IntersectionObserver(([$])=>{$.isIntersecting&&(F.current||!D.current||L.current!==M.current&&(L.current=M.current,A.current?.()))},{root:k.current,threshold:.1});return H.observe(y.current),()=>H.disconnect()},[C]),b.useEffect(()=>{if(!k.current||!C)return;const H=new IntersectionObserver(z=>{z.forEach(G=>{const j=G.target.getAttribute("data-notification-id"),W=G.target.getAttribute("data-unread")==="true";j&&W&&G.isIntersecting&&w.current.add(j)})},{root:k.current,threshold:.5});return k.current.querySelectorAll("[data-notification-id]").forEach(z=>H.observe(z)),()=>H.disconnect()},[C,e]);const U=t>0?t:e.filter(H=>!H.read).length,O=b.useCallback(()=>{if(C){if(U>0){const H=Array.from(w.current).filter($=>{const z=e.find(G=>String(G.id)===String($));return z&&!z.read});H.length>0&&u?.(H)}w.current.clear(),S(!1)}},[C,u,U,e]);b.useEffect(()=>{if(!C)return;const H=$=>{N.current&&!N.current.contains($.target)&&O()};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[C,O]);const I=b.useCallback(()=>{C?O():S(!0)},[C,O]);return b.useLayoutEffect(()=>{const H=E.current;if(!C||!H)return;H.style.transform="";const $=H.getBoundingClientRect(),z=typeof window<"u"?window.innerWidth:0;if($.width===0&&$.height===0)return;const G=8;let j=0;$.right>z-G?j=-($.right-(z-G)):$.left<G&&(j=G-$.left),j!==0&&(H.style.transform=`translateX(${j}px)`)},[C,m,e.length]),c.jsxs(_,{ref:N,className:`relative ${T}`,children:[c.jsxs(re,{onClick:I,className:"relative p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-full transition-colors cursor-pointer","aria-label":r,children:[c.jsx(ne,{name:de.Bell,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),U>0&&c.jsx(Z,{className:"absolute top-0 right-0 flex items-center justify-center w-5 h
Line truncated
|
|
|
|
|
${g.read?"":"bg-blue-50 dark:bg-blue-900/20"}
|
|
|
|
|
`,children:h.jsxs(I,{className:"flex items-start gap-3",children:[g.iconName&&h.jsx(re,{name:g.iconName,className:"w-5 h-5 text-gray-600 dark:text-gray-400 mt-0.5"}),h.jsxs(I,{className:"flex-1",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:g.title}),h.jsx(I,{className:"text-gray-600 dark:text-gray-400 text-sm mt-1",children:g.message}),h.jsx(I,{className:"text-gray-400 dark:text-gray-500 text-xs mt-1",children:g.time})]}),!g.read&&h.jsx(Q,{className:"w-2 h-2 bg-blue-500 rounded-full mt-1.5"})]})},g.id))})]})]}),h.jsxs(I,{ref:u,className:"relative",children:[h.jsxs(oe,{onClick:()=>c(!l),className:"flex items-center gap-3 px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors",children:[t.avatar?h.jsx(yn,{src:t.avatar,alt:t.name,className:"w-8 h-8 rounded-full object-cover"}):h.jsx(I,{className:"w-8 h-8 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center",children:h.jsx(re,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),h.jsxs(I,{className:"hidden md:block text-left",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:t.name}),t.role&&h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-xs",children:t.role})]}),h.jsx(re,{name:de.ChevronDown,className:"w-4 h-4 text-gray-600 dark:text-gray-400"})]}),l&&h.jsxs(I,{className:"absolute right-0 mt-2 w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[h.jsxs(I,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:[h.jsx(I,{className:"font-semibold text-gray-900 dark:text-white",children:t.name}),h.jsx(I,{className:"text-gray-500 dark:text-gray-400 text-sm",children:t.email})]}),h.jsxs(I,{className:"py-2",children:[h.jsxs(oe,{onClick:()=>{r?.(),c(!1)},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors text-gray-900 dark:text-white",children:[h.jsx(re,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{children:_s("common.profile_settings")})]}),h.jsxs(oe,{onClick:()=>{s?.(),c(!1)},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 text-red-600 dark:text-red-400 transition-colors",children:[h.jsx(re,{name:de.ArrowRight,className:"w-5 h-5"}),h.jsx(Q,{children:_s("common.logout")})]})]})]})]})]})},hy=({notifications:t=[],unreadCount:e=0,hasMore:n=!1,loading:r=!1,titleText:s="Notifications",emptyText:o="No notifications",markAllReadText:i="Mark all as read",deleteAllText:a="Delete all",unreadOnlyText:l="Unread only",unreadOnly:c=!1,onNotificationClick:d,onClose:u,onLoadMore:f,onMarkAllRead:g,onDeleteAll:m,onDelete:p,onUnreadOnlyToggle:y,dropdownAlign:b="right",className:S="",id:x,editorAttrs:E})=>{const[k,C]=v.useState(!1),N=v.useRef(null),_=v.useRef(null),w=v.useRef(null),M=v.useRef(null),O=v.useRef(new Set),L=v.useRef(f),$=v.useRef(n),F=v.useRef(r),D=v.useRef(t.length),A=v.useRef(-1);v.useEffect(()=>{L.current=f,$.current=n,F.current=r,D.current=t.length}),v.useEffect(()=>{if(!M.current||!w.current||!k)return;A.current=-1;const W=new IntersectionObserver(([j])=>{j.isIntersecting&&(F.current||!$.current||A.current!==D.current&&(A.current=D.current,L.current?.()))},{root:w.current,threshold:.1});return W.observe(M.current),()=>W.disconnect()},[k]),v.useEffect(()=>{if(!w.current||!k)return;const W=new IntersectionObserver(U=>{U.forEach(B=>{const G=B.target.getAttribute("data-notification-id"),z=B.target.getAttribute("data-unread")==="true";G&&z&&B.isIntersecting&&O.current.add(G)})},{root:w.current,threshold:.5});return w.current.querySelectorAll("[data-notification-id]").forEach(U=>W.observe(U)),()=>W.disconnect()},[k,t]);const T=e>0?e:t.filter(W=>!W.read).length,V=v.useCallback(()=>{if(k){if(T>0){const W=Array.from(O.current).filter(j=>{const U=t.find(B=>String(B.id)===String(j));return U&&!U.read});W.length>0&&u?.(W)}O.current.clear(),C(!1)}},[k,u,T,t]);v.useEffect(()=>{if(!k)return;const W=j=>{N.current&&!N.current.contains(j.target)&&V()};return document.addEventListener("mousedown",W),()=>document.removeEventListener("mousedown",W)},[k,V]);const H=v.useCallback(()=>{k?V():C(!0)},[k,V]);return v.useLayoutEffect(()=>{const W=_.current;if(!k||!W)return;W.style.transform="";const j=W.getBoundingClientRect(),U=typeof window<"u"?window.innerWidth:0;if(j.width===0&&j.height===0)return;const B=8;let G=0;j.right>U-B?G=-(j.right-(U-B)):j.left<B&&(G=B-j.left),G!==0&&(W.style.transform=`translateX(${G}px)`)},[k,b,t.length]),h.jsxs(I,{ref:N,className:`relative ${S}`,id:x,...E,children:[h.jsxs(oe,{onClick:H,className:"relative w-9 h-9 flex items-center justify-center hover:bg-gray-100 dark:hover:bg-gray-800 rounded-full transition-colors cursor-pointer","aria-label":s,children:[h.jsx(re,{name:de.Bell,className:"text-sm text-slate-500 dark:text-slate-400"}),T>0&&h.jsx(Q,{clas
Line truncated
|
|
|
|
|
px-3 py-1.5 text-sm font-medium rounded-md transition-colors
|
|
|
|
|
${d===x?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
|
|
|
|
${l?"opacity-50 cursor-not-allowed":""}
|
|
|
|
|
`,children:yl(x)},x))})]}):c.jsxs(_,{ref:f,className:`relative ${r}`,children:[c.jsx(re,{onClick:()=>i(!s),className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors","aria-label":t,children:c.jsx(ne,{name:de.Globe,className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),s&&c.jsx(_,{className:"absolute right-0 mt-2 w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:c.jsx(_,{className:"py-2",children:e.map(x=>c.jsxs(re,{onClick:()=>p(x),disabled:l,className:`
|
|
|
|
|
${g===x?"bg-blue-600 text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
|
|
|
|
${u?"opacity-50 cursor-not-allowed":""}
|
|
|
|
|
`,children:ou(x)},x))})]}):h.jsxs(I,{ref:p,className:`relative ${s}`,id:a,...l,children:[h.jsxs(oe,{onClick:()=>d(!c),className:i?"flex items-center gap-1.5 px-2.5 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors cursor-pointer":"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors","aria-haspopup":"listbox","aria-expanded":c,"aria-label":e,children:[h.jsx(re,{name:de.Globe,className:i?"w-4 h-4":"w-5 h-5 text-gray-600 dark:text-gray-400"}),i&&h.jsx(Q,{className:"font-medium uppercase",children:g}),i&&h.jsx(re,{name:de.ChevronDown,className:"w-3 h-3"})]}),c&&h.jsx(I,{className:"absolute right-0 mt-2 w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:h.jsx(I,{className:"py-2",children:t.map(x=>h.jsxs(oe,{onClick:()=>S(x),disabled:u,className:`
|
|
|
|
|
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
|
|
|
|
${d===x?"bg-gray-50 dark:bg-gray-700":""}
|
|
|
|
|
${l?"opacity-50 cursor-not-allowed":""}
|
|
|
|
|
`,children:[c.jsx(Z,{className:"text-gray-900 dark:text-white flex-1",children:yl(x)}),d===x&&c.jsx(ne,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400"})]},x))})})]})},wl=window.G7Core?.createLogger?.("Comp:UserProfile")??{log:(...e)=>console.log("[Comp:UserProfile]",...e),warn:(...e)=>console.warn("[Comp:UserProfile]",...e),error:(...e)=>console.error("[Comp:UserProfile]",...e)},b0=({user:e={name:"",email:""},profileText:t="Profile Settings",logoutText:n="Logout",languageText:a="Language",availableLocales:r=["ko","en"],onProfileClick:o,onLogoutClick:s,className:i="",logoutEndpoint:l="/api/admin/auth/logout",redirectPath:g="/admin/login"})=>{const[d,u]=b.useState(!1),[f,h]=b.useState(!1),v=b.useRef(null);b.useEffect(()=>{const T=C=>{v.current&&!v.current.contains(C.target)&&u(!1)};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[]);const p=()=>{const C=`; ${document.cookie}`.split("; XSRF-TOKEN=");return C.length===2?decodeURIComponent(C.pop()?.split(";").shift()||""):null},x=()=>localStorage.getItem("auth_token"),m=async()=>{if(!f)try{if(h(!0),u(!1),s){s();return}const T=p(),C=x(),S=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...T&&{"X-XSRF-TOKEN":T},...C&&{Authorization:`Bearer ${C}`}},credentials:"include"});S.ok?(localStorage.removeItem("auth_token"),window.location.href=g):(wl.error("로그아웃 실패:",S.statusText),localStorage.removeItem("auth_token"),window.location.href=g)}catch(T){wl.error("로그아웃 오류:",T),localStorage.removeItem("auth_token"),window.location.href=g}finally{h(!1)}};return c.jsxs(_,{ref:v,className:`relative ${i}`,children:[c.jsxs(re,{onClick:()=>u(!d),className:"flex items-center gap-2 px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors w-full",children:[e.avatar?c.jsx(or,{src:e.avatar,alt:e.name,className:"w-8 h-8 rounded-full object-cover"}):c.jsx(_,{className:"w-8 h-8 rounded-full bg-gray-300 dark:bg-gray-600 flex items-center justify-center",children:c.jsx(ne,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),c.jsxs(_,{className:"flex-1 text-left",children:[c.jsx(_,{className:"font-semibold text-gray-900 dark:text-white text-sm",children:e.name}),e.role&&c.jsx(_,{className:"text-gray-500 dark:text-gray-400 text-xs",children:e.role})]}),c.jsx(ne,{name:de.ChevronDown,className:"w-4 h-4 text-gray-600 dark:text-gray-400"})]}),d&&c.jsxs(_,{className:"absolute bottom-full left-0 mb-2 w-full bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:[c.jsxs(_,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",onClick:()=>{u(!1),window.G7Core?.dispatch({handler:"navigate",params:{path:`/admin/users/${e.uuid}`}})},children:[c.jsx(_,{className:"font-semibold text-gray-900 dark:text-white",children:e.name}),c.jsx(_,{className:"text-gray-500 dark:text-gray-400 text-sm",children:e.email})]}),r.length>1&&c.jsx(_,{className:"border-b border-gray-200 dark:border-gray-700",children:c.jsx(xl,{availableLocales:r,languageText:a,inline:!0,onLanguageChange:()=>u(!1)})}),c.jsxs(_,{className:"py-2",children:[c.jsxs(re,{onClick:()=>{u(!1),o?o():window.G7Core?.dispatch({handler:"navigate",params:{path:`/admin/users/${e.uuid}/edit`}})},className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center justify-start gap-3 transition-colors",children:[c.jsx(ne,{name:de.User,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),c.jsx(Z,{className:"text-gray-900 dark:text-white",children:t})]}),c.jsxs(re,{onClick:m,disabled:f,className:"w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center justify-start gap-3 text-red-600 dark:text-red-400 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[c.jsx(ne,{name:de.ArrowRight,className:"w-5 h-5"}),c.jsx(Z,{children:f?"Logging out...":n})]})]})]})]})},m0=({copyright:e="© 2026 G7",version:t,quickLinks:n=[],className:a="",changelogModalId:r,copyrightModalId:o})=>{const s=b.useCallback(()=>{r&&window.G7Core?.dispatch?.({handler:"sequence",actions:[{handler:"apiCall",auth_required:!0,target:"/api/admin/changelog",params:{method:"GET"},onSuccess:[{handler:"setState",params:{target:"global",coreChangelogContent:"{{response.data.content}}"}},{handler:"openModal",target:r}],onError:[{handler:"openModal",target:r}]}]})},[r]),i=b.useCallback(()=>{o&&window.G7Core?.dispatch?.({handler:"sequence",actions:[{handler:"apiCall",auth_required:!0,target:"/api/admin/license",params:{method:"GET"},onSuccess:[{handler:"setState",params:{target:"global",coreLicenseContent:"{{response.data.content}}"}},{handler:"openModal",target:o}],onError:[{handler:"openModal",target:o}]}]})},[o]);return c.jsx(_,{className:`
|
|
|
|
|
bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 px-6 py-4
|
|
|
|
|
${a}
|
|
|
|
|
`,children:c.jsxs(_,{className:"flex flex-col md:flex-row items-center justify-between gap-4",children:[c.jsxs(_,{className:"flex items-center gap-4 text-sm text-gray-600 dark:text-gray-400",children:[c.jsx(Z,{className:o?"cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors":"",onClick:o?i:void 0,children:e}),t&&c.jsxs(c.Fragment,{children:[c.jsx(Z,{className:"hidden md:inline",children:"•"}),c.jsxs(Z,{className:`flex items-center gap-2 ${r?"cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors":""}`,onClick:r?s:void 0,children:[c.jsx(ne,{name:de.Tag,className:"w-4 h-4"}),c.jsxs(Z,{children:["v",t]})]})]})]}),n.length>0&&c.jsx(_,{className:"flex items-center gap-4",children:n.map(l=>c.jsxs(jr,{href:l.url,className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400 hover:text-blue-600 dark:hover:text-blue-400 transition-colors",children:[l.iconName&&c.jsx(ne,{name:l.iconName,className:"w-4 h-4"}),c.jsx(Z,{children:l.label})]},l.id))})]})})},v0=({title:e,description:t,breadcrumbItems:n,tabs:a,onTabChange:r,actions:o,className:s="",children:i})=>{const l=(g="secondary")=>`px-4 py-2 rounded-lg font-medium transition-colors flex items-center gap-2 ${{primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-200 dark:bg-gray-700 text-gray-900 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-600",danger:"bg-red-600 text-white hover:bg-red-700",ghost:"p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800"}[g]}`;return c.jsxs(_,{className:s,children:[n&&n.length>0&&c.jsx(_,{className:"mb-4",children:c.jsx(ml,{items:n})}),c.jsxs(_,{className:"flex items-center justify-between mb-6",children:[c.jsxs(_,{children:[c.jsx(Ao,{className:"text-xl sm:text-2xl font-semibold text-gray-900 dark:text-white",children:e}),t&&c.jsx(ut,{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:t})]}),i?c.jsx(_,{className:"flex items-center gap-2",children:i}):o&&o.length>0?c.jsx(_,{className:"flex items-center gap-2",children:o.map(g=>c.jsxs(re,{onClick:g.onClick,disabled:g.disabled,className:l(g.variant),children:[g.iconName&&c.jsx(ne,{name:g.iconName,className:"w-5 h-5"}),g.variant!=="ghost"&&g.label&&c.jsx(_,{children:g.label})]},g.id))}):null]}),a&&a.length>0&&c.jsx(_,{className:"flex gap-6 border-b border-gray-200 dark:border-gray-700 mb-6",children:a.map(g=>c.jsxs(re,{onClick:()=>r?.(g.value),className:`
|
|
|
|
|
px-1 py-3 border-b-2 transition-colors font-medium flex items-center gap-2 -mb-px
|
|
|
|
|
${g.active?"border-blue-600 text-blue-600 dark:text-blue-400":"border-transparent text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200"}
|
|
|
|
|
`,children:[c.jsx(_,{children:g.label}),g.badge!==void 0&&c.jsx(_,{className:`
|
|
|
|
|
px-2 py-0.5 rounded-full text-xs font-semibold
|
|
|
|
|
${g.active?"bg-blue-100 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400":"bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400"}
|
|
|
|
|
`,children:g.badge})]},g.id))})]})},xr=(e,t)=>window.G7Core?.t?.(e,t)??e,y0=({image:e,imageAlt:t,vendor:n,name:a,version:r,status:o,updateAvailable:s=!1,latestVersion:i,dependencies:l=[],showLayoutEditButton:g=!1,actions:d=[],onLayoutEditClick:u,className:f=""})=>{const h=p=>({active:"success",inactive:"default",pending:"pending",error:"error"})[p],v=p=>({active:xr("common.status_active"),inactive:xr("common.status_inactive"),pending:xr("common.status_pending"),error:xr("common.status_error")})[p];return c.jsxs(_,{className:`
|
|
|
|
|
${g===x?"bg-gray-50 dark:bg-gray-700":""}
|
|
|
|
|
${u?"opacity-50 cursor-not-allowed":""}
|
|
|
|
|
`,children:[h.jsx(Q,{className:"text-gray-900 dark:text-white flex-1",children:ou(x)}),g===x&&h.jsx(re,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400"})]},x))})})]})},my=({copyright:t="© 2026 G7",version:e,quickLinks:n=[],className:r="",changelogModalId:s,copyrightModalId:o,id:i,editorAttrs:a})=>{const l=v.useCallback(()=>{s&&window.G7Core?.dispatch?.({handler:"sequence",actions:[{handler:"apiCall",auth_required:!0,target:"/api/admin/changelog",params:{method:"GET"},onSuccess:[{handler:"setState",params:{target:"global",coreChangelogContent:"{{response.data.content}}"}},{handler:"openModal",target:s}],onError:[{handler:"openModal",target:s}]}]})},[s]),c=v.useCallback(()=>{o&&window.G7Core?.dispatch?.({handler:"sequence",actions:[{handler:"apiCall",auth_required:!0,target:"/api/admin/license",params:{method:"GET"},onSuccess:[{handler:"setState",params:{target:"global",coreLicenseContent:"{{response.data.content}}"}},{handler:"openModal",target:o}],onError:[{handler:"openModal",target:o}]}]})},[o]);return h.jsx(I,{className:`admin-footer ${r}`,id:i,...a,children:h.jsxs(I,{className:"admin-footer-row",children:[h.jsxs(I,{className:"admin-footer-group",children:[h.jsx(Q,{className:o?"admin-footer-link-hover":"",onClick:o?c:void 0,children:t}),e&&h.jsxs(h.Fragment,{children:[h.jsx(Q,{className:"hidden md:inline",children:"•"}),h.jsxs(Q,{className:`flex-center gap-2 ${s?"admin-footer-link-hover":""}`,onClick:s?l:void 0,children:[h.jsx(re,{name:de.Tag,className:"w-4 h-4"}),h.jsxs(Q,{children:["v",e]})]})]})]}),n.length>0&&h.jsx(I,{className:"flex-center gap-4",children:n.map(d=>h.jsxs(Lr,{href:d.url,className:"admin-footer-link",children:[d.iconName&&h.jsx(re,{name:d.iconName,className:"w-4 h-4"}),h.jsx(Q,{children:d.label})]},d.id))})]})})},by=({title:t,description:e,breadcrumbItems:n,tabs:r,onTabChange:s,actions:o,className:i="",children:a,id:l,editorAttrs:c})=>{const d=(u="secondary")=>({primary:"page-action-primary",secondary:"page-action-secondary",danger:"page-action-danger",ghost:"page-action-ghost"})[u];return h.jsxs(I,{className:i,id:l,...c,children:[n&&n.length>0&&h.jsx(I,{className:"mb-md",children:h.jsx(nu,{items:n})}),h.jsxs(I,{className:"flex-between mb-lg",children:[h.jsxs(I,{children:[h.jsx(Ta,{className:"page-title",children:t}),e&&h.jsx(bt,{className:"page-description",children:e})]}),a?h.jsx(I,{className:"page-actions",children:a}):o&&o.length>0?h.jsx(I,{className:"page-actions",children:o.map(u=>h.jsxs(oe,{onClick:u.onClick,disabled:u.disabled,className:d(u.variant),children:[u.iconName&&h.jsx(re,{name:u.iconName,className:"icon-md"}),u.variant!=="ghost"&&u.label&&h.jsx(I,{children:u.label})]},u.id))}):null]}),r&&r.length>0&&h.jsx(I,{className:"tab-container",children:r.map(u=>h.jsxs(oe,{onClick:()=>s?.(u.value),className:u.active?"tab-btn-active":"tab-btn",children:[h.jsx(I,{children:u.label}),u.badge!==void 0&&h.jsx(I,{className:u.active?"tab-badge-active":"tab-badge",children:u.badge})]},u.id))})]})},yy=()=>window.G7Core,vy=({title:t,description:e,className:n="",style:r,children:s,id:o,editorAttrs:i})=>{const a="flex items-center justify-between",l=yy()?.style?.mergeClasses?.(a,n)??`${a} ${n}`;return h.jsxs(I,{className:l,style:r,id:o,...i,children:[h.jsxs(I,{children:[t&&h.jsx(Zn,{className:"text-base font-semibold text-gray-900 dark:text-white",children:t}),e&&h.jsx(bt,{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:e})]}),s&&h.jsx(I,{className:"flex items-center gap-2",children:s})]})},Jn=(t,e)=>window.G7Core?.t?.(t,e)??t,xy=({image:t,imageAlt:e,vendor:n,name:r,version:s,status:o,updateAvailable:i=!1,latestVersion:a,dependencies:l=[],showLayoutEditButton:c=!1,actions:d=[],onLayoutEditClick:u,className:f="",id:g,editorAttrs:m})=>{const p=b=>({active:"success",inactive:"default",pending:"pending",error:"error"})[b],y=b=>({active:Jn("common.status_active"),inactive:Jn("common.status_inactive"),pending:Jn("common.status_pending"),error:Jn("common.status_error")})[b];return h.jsxs(I,{className:`
|
|
|
|
|
bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden hover:shadow-lg transition-shadow
|
|
|
|
|
${f}
|
|
|
|
|
`,children:[e&&c.jsxs(_,{className:"relative",children:[c.jsx(or,{src:e,alt:t||xr("common.template_preview",{vendor:n,name:a}),className:"w-full h-48 object-cover"}),c.jsx(_,{className:"absolute top-3 right-3",children:c.jsx(ga,{status:h(o),label:v(o),showIcon:!0})}),s&&c.jsx(_,{className:"absolute top-3 left-3",children:c.jsxs(Z,{className:"flex items-center gap-1 px-2 py-1 bg-yellow-50 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-400 border border-yellow-200 dark:border-yellow-800 rounded-md text-xs font-semibold",children:[c.jsx(ne,{name:de.ExclamationTriangle,className:"w-3 h-3"}),c.jsx(Z,{children:xr("common.update_available")})]})})]}),c.jsxs(_,{className:"p-4",children:[c.jsxs(_,{className:"flex items-start justify-between mb-3",children:[c.jsxs(_,{className:"flex-1",children:[c.jsxs(Hr,{className:"text-lg font-bold text-gray-900 dark:text-white",children:[n,"/",a]}),c.jsxs(_,{className:"flex items-center gap-2 mt-1 text-sm text-gray-600 dark:text-gray-400",children:[c.jsxs(Z,{children:["v",r]}),s&&i&&c.jsxs(c.Fragment,{children:[c.jsx(Z,{children:"→"}),c.jsxs(Z,{className:"text-yellow-600 dark:text-yellow-400 font-semibold",children:["v",i]})]})]}),!e&&c.jsx(_,{className:"mt-2",children:c.jsx(ga,{status:h(o),label:v(o),showIcon:!0})})]}),d.length>0&&c.jsx(mn,{items:d,triggerIconName:de.EllipsisVertical,position:"left"})]}),l.length>0&&c.jsxs(_,{className:"mb-3",children:[c.jsxs(ut,{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:[xr("common.dependencies"),":"]}),c.jsx(_,{className:"flex flex-wrap gap-1",children:l.map((p,x)=>c.jsx(Z,{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 text-xs rounded",children:p},x))})]}),g&&u&&c.jsxs(re,{onClick:u,className:"w-full px-4 py-2 bg-blue-600 dark:bg-blue-500 text-white rounded-md hover:bg-blue-700 dark:hover:bg-blue-600 transition-colors flex items-center justify-center gap-2 font-medium",children:[c.jsx(ne,{name:de.Edit,className:"w-4 h-4"}),c.jsx(Z,{children:xr("common.edit_layout")})]})]})]})},kl=({type:e,message:t,dismissible:n=!1,onDismiss:a,className:r=""})=>{const s={info:{bgColor:"bg-blue-100 dark:bg-blue-900",borderColor:"border-blue-400 dark:border-blue-600",textColor:"text-blue-800 dark:text-blue-200",iconColor:"text-blue-600 dark:text-blue-400",icon:de.InfoCircle},success:{bgColor:"bg-green-100 dark:bg-green-900",borderColor:"border-green-400 dark:border-green-600",textColor:"text-green-800 dark:text-green-200",iconColor:"text-green-600 dark:text-green-400",icon:de.CheckCircle},warning:{bgColor:"bg-yellow-100 dark:bg-yellow-900",borderColor:"border-yellow-400 dark:border-yellow-600",textColor:"text-yellow-800 dark:text-yellow-200",iconColor:"text-yellow-600 dark:text-yellow-400",icon:de.ExclamationTriangle},error:{bgColor:"bg-red-100 dark:bg-red-900",borderColor:"border-red-400 dark:border-red-600",textColor:"text-red-800 dark:text-red-200",iconColor:"text-red-600 dark:text-red-400",icon:de.TimesCircle}}[e],i=`
|
|
|
|
|
flex items-start gap-3 p-4 rounded-lg border
|
|
|
|
|
${s.bgColor}
|
|
|
|
|
${s.borderColor}
|
|
|
|
|
${r}
|
|
|
|
|
`.trim().replace(/\s+/g," ");return c.jsxs(_,{className:i,role:"alert","aria-live":"polite",children:[c.jsx(ne,{name:s.icon,className:`${s.iconColor} flex-shrink-0 mt-0.5`,ariaLabel:`${e} icon`}),c.jsx(ut,{className:`flex-1 ${s.textColor} text-sm`,children:t}),n&&c.jsx(re,{onClick:a,className:`${s.textColor} hover:opacity-70 flex-shrink-0 bg-transparent border-0 p-0 cursor-pointer`,"aria-label":"Close alert",children:c.jsx(ne,{name:de.Times,className:s.iconColor,ariaLabel:"Close"})})]})},x0=({layoutName:e,onBack:t,onPreview:n,onSave:a,isSaving:r=!1,className:o=""})=>{const s=`
|
|
|
|
|
`,id:g,...m,children:[t&&h.jsxs(I,{className:"relative",children:[h.jsx(yn,{src:t,alt:e||Jn("common.template_preview",{vendor:n,name:r}),className:"w-full h-48 object-cover"}),h.jsx(I,{className:"absolute top-3 right-3",children:h.jsx(Po,{status:p(o),label:y(o),showIcon:!0})}),i&&h.jsx(I,{className:"absolute top-3 left-3",children:h.jsxs(Q,{className:"flex items-center gap-1 px-2 py-1 bg-yellow-50 dark:bg-yellow-900/20 text-yellow-700 dark:text-yellow-400 border border-yellow-200 dark:border-yellow-800 rounded-md text-xs font-semibold",children:[h.jsx(re,{name:de.ExclamationTriangle,className:"w-3 h-3"}),h.jsx(Q,{children:Jn("common.update_available")})]})})]}),h.jsxs(I,{className:"p-4",children:[h.jsxs(I,{className:"flex items-start justify-between mb-3",children:[h.jsxs(I,{className:"flex-1",children:[h.jsxs(Ir,{className:"text-lg font-bold text-gray-900 dark:text-white",children:[n,"/",r]}),h.jsxs(I,{className:"flex items-center gap-2 mt-1 text-sm text-gray-600 dark:text-gray-400",children:[h.jsxs(Q,{children:["v",s]}),i&&a&&h.jsxs(h.Fragment,{children:[h.jsx(Q,{children:"→"}),h.jsxs(Q,{className:"text-yellow-600 dark:text-yellow-400 font-semibold",children:["v",a]})]})]}),!t&&h.jsx(I,{className:"mt-2",children:h.jsx(Po,{status:p(o),label:y(o),showIcon:!0})})]}),d.length>0&&h.jsx(bs,{items:d,triggerIconName:de.EllipsisVertical,position:"left"})]}),l.length>0&&h.jsxs(I,{className:"mb-3",children:[h.jsxs(bt,{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:[Jn("common.dependencies"),":"]}),h.jsx(I,{className:"flex flex-wrap gap-1",children:l.map((b,S)=>h.jsx(Q,{className:"px-2 py-0.5 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 text-xs rounded",children:b},S))})]}),c&&u&&h.jsxs(oe,{onClick:u,className:"w-full px-4 py-2 bg-blue-600 dark:bg-blue-500 text-white rounded-md hover:bg-blue-700 dark:hover:bg-blue-600 transition-colors flex items-center justify-center gap-2 font-medium",children:[h.jsx(re,{name:de.Edit,className:"w-4 h-4"}),h.jsx(Q,{children:Jn("common.edit_layout")})]})]})]})},iu=({type:t,message:e,dismissible:n=!1,onDismiss:r,className:s="",id:o,editorAttrs:i})=>{const a={info:{containerClass:"alert-info",iconClass:"alert-icon-info",textClass:"alert-text-info",icon:de.InfoCircle},success:{containerClass:"alert-success",iconClass:"alert-icon-success",textClass:"alert-text-success",icon:de.CheckCircle},warning:{containerClass:"alert-warning",iconClass:"alert-icon-warning",textClass:"alert-text-warning",icon:de.ExclamationTriangle},error:{containerClass:"alert-error",iconClass:"alert-icon-error",textClass:"alert-text-error",icon:de.TimesCircle}},l=a[t]??a.info;return h.jsxs(I,{className:`${l.containerClass} ${s}`,role:"alert","aria-live":"polite",id:o,...i,children:[h.jsx(re,{name:l.icon,className:l.iconClass,ariaLabel:`${t} icon`}),h.jsx(bt,{className:l.textClass,children:e}),n&&h.jsx(oe,{onClick:r,className:`alert-dismiss ${l.textClass}`,"aria-label":"Close alert",children:h.jsx(re,{name:de.Times,className:l.iconClass,ariaLabel:"Close"})})]})},wy=({layoutName:t,onBack:e,onPreview:n,onSave:r,isSaving:s=!1,className:o=""})=>{const i=`
|
|
|
|
|
flex items-center justify-between gap-4 p-4 bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700
|
|
|
|
|
${o}
|
|
|
|
|
`.trim().replace(/\s+/g," ");return c.jsxs(_,{className:s,children:[c.jsxs(_,{className:"flex items-center gap-3",children:[c.jsx(re,{onClick:t,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors bg-transparent border-0 cursor-pointer","aria-label":"뒤로가기",children:c.jsx(ne,{name:de.ArrowLeft,className:"text-gray-700 dark:text-gray-300",ariaLabel:"뒤로가기"})}),c.jsx(Er,{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:e})]}),c.jsxs(_,{className:"flex items-center gap-2",children:[c.jsx(re,{onClick:n,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors border-0 cursor-pointer","aria-label":"미리보기",children:c.jsxs(_,{className:"flex items-center gap-2",children:[c.jsx(ne,{name:de.Eye,className:"text-gray-700 dark:text-gray-300",ariaLabel:"미리보기 아이콘"}),c.jsx("span",{children:"미리보기"})]})}),c.jsx(re,{onClick:a,disabled:r,className:`
|
|
|
|
|
`.trim().replace(/\s+/g," ");return h.jsxs(I,{className:i,children:[h.jsxs(I,{className:"flex items-center gap-3",children:[h.jsx(oe,{onClick:e,className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors bg-transparent border-0 cursor-pointer","aria-label":"뒤로가기",children:h.jsx(re,{name:de.ArrowLeft,className:"text-gray-700 dark:text-gray-300",ariaLabel:"뒤로가기"})}),h.jsx(Zn,{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:t})]}),h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(oe,{onClick:n,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-lg transition-colors border-0 cursor-pointer","aria-label":"미리보기",children:h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(re,{name:de.Eye,className:"text-gray-700 dark:text-gray-300",ariaLabel:"미리보기 아이콘"}),h.jsx("span",{children:"미리보기"})]})}),h.jsx(oe,{onClick:r,disabled:s,className:`
|
|
|
|
|
px-4 py-2 rounded-lg transition-colors border-0 cursor-pointer
|
|
|
|
|
${r?"bg-blue-400 dark:bg-blue-600 cursor-not-allowed":"bg-blue-600 dark:bg-blue-500 hover:bg-blue-700 dark:hover:bg-blue-600"}
|
|
|
|
|
${s?"bg-blue-400 dark:bg-blue-600 cursor-not-allowed":"bg-blue-600 dark:bg-blue-500 hover:bg-blue-700 dark:hover:bg-blue-600"}
|
|
|
|
|
text-white
|
|
|
|
|
`.trim().replace(/\s+/g," "),"aria-label":r?"저장 중...":"저장",children:c.jsxs(_,{className:"flex items-center gap-2",children:[c.jsx(ne,{name:r?de.Spinner:de.Save,className:`text-white ${r?"animate-spin":""}`,ariaLabel:r?"저장 중 아이콘":"저장 아이콘"}),c.jsx("span",{children:r?"저장 중...":"저장"})]})})]})]})},w0=({files:e,selectedId:t,onSelect:n,className:a=""})=>{const r=i=>{try{const l=new Date(i);if(isNaN(l.getTime()))return i;const g=l.getFullYear(),d=String(l.getMonth()+1).padStart(2,"0"),u=String(l.getDate()).padStart(2,"0"),f=String(l.getHours()).padStart(2,"0"),h=String(l.getMinutes()).padStart(2,"0");return`${g}-${d}-${u} ${f}:${h}`}catch{return i}},o=i=>{n(i)},s=`
|
|
|
|
|
`.trim().replace(/\s+/g," "),"aria-label":s?"저장 중...":"저장",children:h.jsxs(I,{className:"flex items-center gap-2",children:[h.jsx(re,{name:s?de.Spinner:de.Save,className:`text-white ${s?"animate-spin":""}`,ariaLabel:s?"저장 중 아이콘":"저장 아이콘"}),h.jsx("span",{children:s?"저장 중...":"저장"})]})})]})]})},ky=({files:t,selectedId:e,onSelect:n,className:r=""})=>{const s=a=>{try{const l=new Date(a);if(isNaN(l.getTime()))return a;const c=l.getFullYear(),d=String(l.getMonth()+1).padStart(2,"0"),u=String(l.getDate()).padStart(2,"0"),f=String(l.getHours()).padStart(2,"0"),g=String(l.getMinutes()).padStart(2,"0");return`${c}-${d}-${u} ${f}:${g}`}catch{return a}},o=a=>{n(a)},i=`
|
|
|
|
|
w-full
|
|
|
|
|
${a}
|
|
|
|
|
`.trim().replace(/\s+/g," ");return c.jsx(_,{className:s,children:e.length===0?c.jsx(_,{className:"p-4 text-center text-gray-500 dark:text-gray-400",children:"파일이 없습니다."}):c.jsx(Lo,{className:"divide-y divide-gray-200 dark:divide-gray-700",role:"listbox","aria-label":"레이아웃 파일 목록",children:e.map(i=>{const l=i.id===t,g=`
|
|
|
|
|
${r}
|
|
|
|
|
`.trim().replace(/\s+/g," ");return h.jsx(I,{className:i,children:t.length===0?h.jsx(I,{className:"p-4 text-center text-gray-500 dark:text-gray-400",children:"파일이 없습니다."}):h.jsx(Aa,{className:"divide-y divide-gray-200 dark:divide-gray-700",role:"listbox","aria-label":"레이아웃 파일 목록",children:t.map(a=>{const l=a.id===e,c=`
|
|
|
|
|
flex items-center justify-between p-4 cursor-pointer
|
|
|
|
|
transition-colors duration-150
|
|
|
|
|
${l?"bg-blue-100 dark:bg-blue-900 border-l-4 border-blue-500":"hover:bg-gray-100 dark:hover:bg-gray-800"}
|
|
|
|
@@ -146,8 +105,8 @@ var SirsoftAdminBasic=(function(Q,c,b,ar){"use strict";function eg(e){const t=Ob
|
|
|
|
|
`.trim().replace(/\s+/g," "),u=`
|
|
|
|
|
text-sm
|
|
|
|
|
${l?"text-blue-700 dark:text-blue-300":"text-gray-500 dark:text-gray-400"}
|
|
|
|
|
`.trim().replace(/\s+/g," ");return c.jsx(_o,{className:g,onClick:()=>o(i.id),role:"option","aria-selected":l,tabIndex:0,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),o(i.id))},children:c.jsxs(_,{className:"flex flex-col gap-1",children:[c.jsx(Z,{className:d,children:i.name}),c.jsx(Z,{className:u,children:r(i.updated_at)})]})},i.id)})})})};function Cl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function k0(e){if(Array.isArray(e))return e}function C0(e,t,n){return(t=I0(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S0(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,r,o,s,i=[],l=!0,g=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(a=o.call(n)).done)&&(i.push(a.value),i.length!==t);l=!0);}catch(d){g=!0,r=d}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(g)throw r}}return i}}function E0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Sl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function El(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Sl(Object(n),!0).forEach(function(a){C0(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sl(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function N0(e,t){if(e==null)return{};var n,a,r=T0(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function T0(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;n[a]=e[a]}return n}function O0(e,t){return k0(e)||S0(e,t)||A0(e,t)||E0()}function M0(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function I0(e){var t=M0(e,"string");return typeof t=="symbol"?t:t+""}function A0(e,t){if(e){if(typeof e=="string")return Cl(e,t);var n={}.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)?Cl(e,t):void 0}}function L0(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function Tl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nl(Object(n),!0).forEach(function(a){L0(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nl(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function _0(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(a){return t.reduceRight(function(r,o){return o(r)},a)}}function Nn(e){return function t(){for(var n=this,a=arguments.length,r=new Array(a),o=0;o<a;o++)r[o]=arguments[o];return r.length>=e.length?e.apply(this,r):function(){for(var s=arguments.length,i=new Array(s),l=0;l<s;l++)i[l]=arguments[l];return t.apply(n,[].concat(r,i))}}}function xa(e){return{}.toString.call(e).includes("Object")}function D0(e){return!Object.keys(e).length}function Tn(e){return typeof e=="function"}function P0(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $0(e,t){return xa(t)||wr("changeType"),Object.keys(t).some(function(n){return!P0(e,n)})&&wr("changeField"),t}function F0(e){Tn(e)||wr("selectorType")}function U0(e){Tn(e)||xa(e)||wr("handlerType"),xa(e)&&Object.values(e).some(function(t){return!Tn(t)})&&wr("handlersType")}function V0(e){e||wr("initialIsRequired"),xa(e)||wr("initialType"),D0(e)&&wr("initialContent")}function H0(e,t){throw new Error(e[t]||e.default)}var j0={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},wr=Nn(H0)(j0),wa={changes:$0,selector:F0,handler:U0,initial:V0};function z0(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};wa.initial(e),wa.handler(t);var n={current:e},a=Nn(W0)(n,t),r=Nn(B0)(n),o=Nn(wa.changes)(e),s=Nn(G0)(n);function i(){var g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return wa.selector(g),g(n.current)}function l(g){_0(a,r,o,s)(g)}return[i,l]}function G0(e,t){return Tn(t)?t(e.current):t}function B0(e,t){return e.current=Tl(Tl({},e.current),t),t}function W0(e,t,n){return Tn(t)?t(e.current):Object.keys(n).forEach(function(a){var r;return(r=t[a])===null||r===void 0?void 0:r.call(t,e.current[a])}),n}var Y0={create:z0},q0={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"}};function K0(e){return function t(){for(var n=this,a=arguments.length,r=new Array(a),o=0;o<a;o++)r[o]=arguments[o];return r.length>=e.length?e.apply(this,r):function(){for(var s=arguments.length,i=new Array(s),l=0;l<s;l++)i[l]=arguments[l];
Line truncated
|
|
|
|
|
`.trim().replace(/\s+/g," ");return h.jsx(Da,{className:c,onClick:()=>o(a.id),role:"option","aria-selected":l,tabIndex:0,onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),o(a.id))},children:h.jsxs(I,{className:"flex flex-col gap-1",children:[h.jsx(Q,{className:d,children:a.name}),h.jsx(Q,{className:u,children:s(a.updated_at)})]})},a.id)})})})};function au(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Cy(t){if(Array.isArray(t))return t}function Sy(t,e,n){return(e=Ay(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _y(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,o,i,a=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){c=!0,s=d}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw s}}return a}}function Ey(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function cu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?lu(Object(n),!0).forEach(function(r){Sy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):lu(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function My(t,e){if(t==null)return{};var n,r,s=Ny(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}function Ny(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function Oy(t,e){return Cy(t)||_y(t,e)||Dy(t,e)||Ey()}function Ty(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ay(t){var e=Ty(t,"string");return typeof e=="symbol"?e:e+""}function Dy(t,e){if(t){if(typeof t=="string")return au(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?au(t,e):void 0}}function Iy(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function du(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function uu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?du(Object(n),!0).forEach(function(r){Iy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):du(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Ly(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(r){return e.reduceRight(function(s,o){return o(s)},r)}}function Es(t){return function e(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=t.length?t.apply(this,s):function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];return e.apply(n,[].concat(s,a))}}}function Bo(t){return{}.toString.call(t).includes("Object")}function Py(t){return!Object.keys(t).length}function Ms(t){return typeof t=="function"}function $y(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Fy(t,e){return Bo(e)||Rn("changeType"),Object.keys(e).some(function(n){return!$y(t,n)})&&Rn("changeField"),e}function Vy(t){Ms(t)||Rn("selectorType")}function zy(t){Ms(t)||Bo(t)||Rn("handlerType"),Bo(t)&&Object.values(t).some(function(e){return!Ms(e)})&&Rn("handlersType")}function Hy(t){t||Rn("initialIsRequired"),Bo(t)||Rn("initialType"),Py(t)&&Rn("initialContent")}function Uy(t,e){throw new Error(t[e]||t.default)}var By={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Rn=Es(Uy)(By),jo={changes:Fy,selector:Vy,handler:zy,initial:Hy};function jy(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};jo.initial(t),jo.handler(e);var n={current:t},r=Es(Yy)(n,e),s=Es(Gy)(n),o=Es(jo.changes)(t),i=Es(Wy)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return jo.selector(c),c(n.current)}function l(c){Ly(r,s,o,i)(c)}return[a,l]}function Wy(t,e){return Ms(e)?e(t.current):e}function Gy(t,e){return t.current=uu(uu({},t.current),e),e}function Yy(t,e,n){return Ms(e)?e(t.current):Object.keys(n).forEach(function(r){var s;return(s=e[r])===null||s===void 0?void 0:s.call(e,t.current[r])}),n}var Xy={create:jy},Ky={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"}};function qy(t){return function e(){for(var n=this,r=arguments.length,s=new Array(r),o=0;o<r;o++)s[o]=arguments[o];return s.length>=t.length?t.apply(this,s):function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];
Line truncated
|
|
|
|
|
You are using deprecated way of configuration.
|
|
|
|
|
|
|
|
|
|
Instead of using
|
|
|
|
@@ -156,28 +115,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
|
|
monaco.config({ paths: { vs: '...' } })
|
|
|
|
|
|
|
|
|
|
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
|
|
|
`},Ml=K0(J0)(Ol),R0={config:Z0},eh=function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return function(r){return n.reduceRight(function(o,s){return s(o)},r)}};function Il(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],Il(e[n],t[n]))}),El(El({},e),t)}var th={type:"cancelation",msg:"operation is manually canceled"};function as(e){var t=!1,n=new Promise(function(a,r){e.then(function(o){return t?r(th):a(o)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var rh=["monaco"],nh=Y0.create({config:q0,isInitialized:!1,resolve:null,reject:null,monaco:null}),Al=O0(nh,2),On=Al[0],ka=Al[1];function ah(e){var t=R0.config(e),n=t.monaco,a=N0(t,rh);ka(function(r){return{config:Il(r.config,a),monaco:n}})}function oh(){var e=On(function(t){var n=t.monaco,a=t.isInitialized,r=t.resolve;return{monaco:n,isInitialized:a,resolve:r}});if(!e.isInitialized){if(ka({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),as(os);if(window.monaco&&window.monaco.editor)return Ll(window.monaco),e.resolve(window.monaco),as(os);eh(sh,lh)(ch)}return as(os)}function sh(e){return document.body.appendChild(e)}function ih(e){var t=document.createElement("script");return e&&(t.src=e),t}function lh(e){var t=On(function(a){var r=a.config,o=a.reject;return{config:r,reject:o}}),n=ih("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function ch(){var e=On(function(n){var a=n.config,r=n.resolve,o=n.reject;return{config:a,resolve:r,reject:o}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var a=n.m;Ll(a),e.resolve(a)},function(n){e.reject(n)})}function Ll(e){On().monaco||ka({monaco:e})}function dh(){return On(function(e){var t=e.monaco;return t})}var os=new Promise(function(e,t){return ka({resolve:e,reject:t})}),_l={config:ah,init:oh,__getMonacoInstance:dh},uh={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ss=uh,fh={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},gh=fh;function hh({children:e}){return b.createElement("div",{style:gh.container},e)}var ph=hh,bh=ph;function mh({width:e,height:t,isEditorReady:n,loading:a,_ref:r,className:o,wrapperProps:s}){return b.createElement("section",{style:{...ss.wrapper,width:e,height:t},...s},!n&&b.createElement(bh,null,a),b.createElement("div",{ref:r,style:{...ss.fullWidth,...!n&&ss.hide},className:o}))}var vh=mh,Dl=b.memo(vh);function yh(e){b.useEffect(e,[])}var Pl=yh;function xh(e,t,n=!0){let a=b.useRef(!0);b.useEffect(a.current||!n?()=>{a.current=!1}:e,t)}var Vt=xh;function Mn(){}function Yr(e,t,n,a){return wh(e,a)||kh(e,t,n,a)}function wh(e,t){return e.editor.getModel($l(e,t))}function kh(e,t,n,a){return e.editor.createModel(t,n,a?$l(e,a):void 0)}function $l(e,t){return e.Uri.parse(t)}function Ch({original:e,modified:t,language:n,originalLanguage:a,modifiedLanguage:r,originalModelPath:o,modifiedModelPath:s,keepCurrentOriginalModel:i=!1,keepCurrentModifiedModel:l=!1,theme:g="light",loading:d="Loading...",options:u={},height:f="100%",width:h="100%",className:v,wrapperProps:p={},beforeMount:x=Mn,onMount:m=Mn}){let[T,C]=b.useState(!1),[S,N]=b.useState(!0),E=b.useRef(null),k=b.useRef(null),y=b.useRef(null),w=b.useRef(m),A=b.useRef(x),D=b.useRef(!1);Pl(()=>{let U=_l.init();return U.then(O=>(k.current=O)&&N(!1)).catch(O=>O?.type!=="cancelation"&&console.error("Monaco initialization: error:",O)),()=>E.current?L():U.cancel()}),Vt(()=>{if(E.current&&k.current){let U=E.current.getOriginalEditor(),O=Yr(k.current,e||"",a||n||"text",o||"");O!==U.getModel()&&U.setModel(O)}},[o],T),Vt(()=>{if(E.current&&k.current){let U=E.current.getModifiedEditor(),O=Yr(k.current,t||"",r||n||"text",s||"");O!==U.getModel()&&U.setModel(O)}},[s],T),Vt(()=>{let U=E.current.getModifiedEditor();U.getOption(k.current.editor.EditorOption.readOnly)?U.setValue(t||""):t!==U.getValue()&&(U.executeEdits("",[{range:U.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),U.pushUndoStop())},[t],T),Vt(()=>{E.current?.getModel()?.original.setValue(e||"")},[e],T),Vt(()=>{let{original:U,modified:O}=E.current.getModel();k.current.editor.setModelLanguage(U,a||n||"text"),k.current.editor.setModelLanguage(O,r||n||"text")},[n,a,r],T),Vt(()=>{k.current?.editor.setTheme(g)},[g],T),Vt(()=>{E.current?.updateOptions(u)},[u],T);let F=b.useCallback(()=>{if(!k.current)return;A.current(k.current);let U=Yr(k.current,e||"",a||n||"text",o||""),O=Yr(k.current,t||"",r||n||"text",s||"");E.current?.setModel({original:U,modified:O})},[n,t,r,e,a,o,s]),M=b.useCallback(()=>{!D.current&&y.current&&(E.current=k.current.editor.createDiffEditor(y.current,{automaticLayout:!0,...u}),F(),k.current?.editor.setTheme(g),C(!0),D.current=!0)},[u,g,F]);b.useEffect(()=>{T&&w.current(E.current,k.current)},[T]),b.useEffect(()=>{!S&&!T&&M()},[S,T,M]);function L(){let U=E.current?.getModel();i||U?.original?.disp
Line truncated
|
|
|
|
|
`},hu=qy(Ry)(fu),ev={config:Qy},tv=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(o,i){return i(o)},s)}};function gu(t,e){return Object.keys(e).forEach(function(n){e[n]instanceof Object&&t[n]&&Object.assign(e[n],gu(t[n],e[n]))}),cu(cu({},t),e)}var nv={type:"cancelation",msg:"operation is manually canceled"};function rl(t){var e=!1,n=new Promise(function(r,s){t.then(function(o){return e?s(nv):r(o)}),t.catch(s)});return n.cancel=function(){return e=!0},n}var rv=["monaco"],sv=Xy.create({config:Ky,isInitialized:!1,resolve:null,reject:null,monaco:null}),pu=Oy(sv,2),Ns=pu[0],Wo=pu[1];function ov(t){var e=ev.config(t),n=e.monaco,r=My(e,rv);Wo(function(s){return{config:gu(s.config,r),monaco:n}})}function iv(){var t=Ns(function(e){var n=e.monaco,r=e.isInitialized,s=e.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!t.isInitialized){if(Wo({isInitialized:!0}),t.monaco)return t.resolve(t.monaco),rl(sl);if(window.monaco&&window.monaco.editor)return mu(window.monaco),t.resolve(window.monaco),rl(sl);tv(av,cv)(dv)}return rl(sl)}function av(t){return document.body.appendChild(t)}function lv(t){var e=document.createElement("script");return t&&(e.src=t),e}function cv(t){var e=Ns(function(r){var s=r.config,o=r.reject;return{config:s,reject:o}}),n=lv("".concat(e.config.paths.vs,"/loader.js"));return n.onload=function(){return t()},n.onerror=e.reject,n}function dv(){var t=Ns(function(n){var r=n.config,s=n.resolve,o=n.reject;return{config:r,resolve:s,reject:o}}),e=window.require;e.config(t.config),e(["vs/editor/editor.main"],function(n){var r=n.m;mu(r),t.resolve(r)},function(n){t.reject(n)})}function mu(t){Ns().monaco||Wo({monaco:t})}function uv(){return Ns(function(t){var e=t.monaco;return e})}var sl=new Promise(function(t,e){return Wo({resolve:t,reject:e})}),bu={config:ov,init:iv,__getMonacoInstance:uv},fv={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},ol=fv,hv={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},gv=hv;function pv({children:t}){return v.createElement("div",{style:gv.container},t)}var mv=pv,bv=mv;function yv({width:t,height:e,isEditorReady:n,loading:r,_ref:s,className:o,wrapperProps:i}){return v.createElement("section",{style:{...ol.wrapper,width:t,height:e},...i},!n&&v.createElement(bv,null,r),v.createElement("div",{ref:s,style:{...ol.fullWidth,...!n&&ol.hide},className:o}))}var vv=yv,yu=v.memo(vv);function xv(t){v.useEffect(t,[])}var vu=xv;function wv(t,e,n=!0){let r=v.useRef(!0);v.useEffect(r.current||!n?()=>{r.current=!1}:t,e)}var nn=wv;function Os(){}function zr(t,e,n,r){return kv(t,r)||Cv(t,e,n,r)}function kv(t,e){return t.editor.getModel(xu(t,e))}function Cv(t,e,n,r){return t.editor.createModel(e,n,r?xu(t,r):void 0)}function xu(t,e){return t.Uri.parse(e)}function Sv({original:t,modified:e,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:o,modifiedModelPath:i,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:d="Loading...",options:u={},height:f="100%",width:g="100%",className:m,wrapperProps:p={},beforeMount:y=Os,onMount:b=Os}){let[S,x]=v.useState(!1),[E,k]=v.useState(!0),C=v.useRef(null),N=v.useRef(null),_=v.useRef(null),w=v.useRef(b),M=v.useRef(y),O=v.useRef(!1);vu(()=>{let D=bu.init();return D.then(A=>(N.current=A)&&k(!1)).catch(A=>A?.type!=="cancelation"&&console.error("Monaco initialization: error:",A)),()=>C.current?F():D.cancel()}),nn(()=>{if(C.current&&N.current){let D=C.current.getOriginalEditor(),A=zr(N.current,t||"",r||n||"text",o||"");A!==D.getModel()&&D.setModel(A)}},[o],S),nn(()=>{if(C.current&&N.current){let D=C.current.getModifiedEditor(),A=zr(N.current,e||"",s||n||"text",i||"");A!==D.getModel()&&D.setModel(A)}},[i],S),nn(()=>{let D=C.current.getModifiedEditor();D.getOption(N.current.editor.EditorOption.readOnly)?D.setValue(e||""):e!==D.getValue()&&(D.executeEdits("",[{range:D.getModel().getFullModelRange(),text:e||"",forceMoveMarkers:!0}]),D.pushUndoStop())},[e],S),nn(()=>{C.current?.getModel()?.original.setValue(t||"")},[t],S),nn(()=>{let{original:D,modified:A}=C.current.getModel();N.current.editor.setModelLanguage(D,r||n||"text"),N.current.editor.setModelLanguage(A,s||n||"text")},[n,r,s],S),nn(()=>{N.current?.editor.setTheme(c)},[c],S),nn(()=>{C.current?.updateOptions(u)},[u],S);let L=v.useCallback(()=>{if(!N.current)return;M.current(N.current);let D=zr(N.current,t||"",r||n||"text",o||""),A=zr(N.current,e||"",s||n||"text",i||"");C.current?.setModel({original:D,modified:A})},[n,e,s,t,r,o,i]),$=v.useCallback(()=>{!O.current&&_.current&&(C.current=N.current.editor.createDiffEditor(_.current,{automaticLayout:!0,...u}),L(),N.current?.editor.setTheme(c),x(!0),O.current=!0)},[u,c,L]);v.useEffect(()=>{S&&w.current(C.current,N.current)},[S]),v.useEffect(()=>{!E&&!S&&$()},[E,S,$]);function F(){let D=C.current?.getModel();a||D?.original?.disp
Line truncated
|
|
|
|
|
p-3 rounded-lg border cursor-pointer transition-colors
|
|
|
|
|
${t?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 hover:border-gray-400 dark:border-gray-600 dark:hover:border-gray-500"}
|
|
|
|
|
`,onClick:a,children:c.jsxs(_,{className:"flex justify-between items-start",children:[c.jsxs(_,{className:"flex-1",children:[c.jsxs(Z,{className:"font-semibold text-gray-900 dark:text-gray-100",children:["버전 ",e.version]}),c.jsx(Z,{className:"ml-2 text-sm text-gray-500 dark:text-gray-400",children:Lh(e.created_at)})]}),c.jsxs(_,{className:"flex gap-3 text-sm",children:[c.jsxs(Z,{className:"text-green-600 dark:text-green-400",children:["+",e.changes_summary.added]}),c.jsxs(Z,{className:"text-red-600 dark:text-red-400",children:["-",e.changes_summary.removed]})]})]})})});Fl.displayName="VersionListItem";const Ul=({versions:e,selectedId:t,onSelect:n})=>e.length===0?c.jsx(_,{className:"p-4 text-center text-gray-500 dark:text-gray-400",children:"버전이 없습니다."}):c.jsx(Lo,{role:"list",className:"space-y-2",children:e.map(a=>c.jsx(Fl,{version:a,isSelected:t===a.id,onSelect:n},a.id))}),_h=({layoutId:e,versions:t,onRestore:n})=>{const[a,r]=b.useState(),o=l=>{r(l)},s=()=>{a!==void 0&&n(a)},i=a===void 0;return c.jsxs(_,{className:"space-y-4",role:"region","aria-label":"레이아웃 히스토리 패널",children:[c.jsx(_,{className:"border border-gray-300 dark:border-gray-600 rounded-lg p-4",children:c.jsx(Ul,{versions:t,selectedId:a,onSelect:o})}),c.jsx(_,{className:"flex justify-end",children:c.jsx(re,{variant:"primary",disabled:i,onClick:s,"aria-label":"선택한 버전으로 복원",children:"복원"})})]})},Dh=({emailLabel:e="Email",passwordLabel:t="Password",submitButtonText:n="Sign In",processingText:a="Processing...",emailPlaceholder:r="Email",passwordPlaceholder:o="Password",forgotPasswordText:s="Forgot your password?",forgotPasswordUrl:i="/admin/password/reset",emailRequiredError:l="Please enter your email.",emailInvalidError:g="Please enter a valid email address.",passwordRequiredError:d="Please enter your password.",onSubmit:u,loadingActions:f={},isLoading:h=!1,disabled:v=!1,apiError:p="",className:x="",style:m})=>{const[T,C]=b.useState(""),[S,N]=b.useState(""),[E,k]=b.useState({}),y=p,w=Object.values(f).some(L=>L===!0),A=h||w,D=v||A,F=()=>{const L={},U=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return!T||T.trim()===""?L.email=l:U.test(T)||(L.email=g),(!S||S.trim()==="")&&(L.password=d),k(L),Object.keys(L).length===0},M=async L=>{if(!F()){L.preventDefault();return}k({}),u?await u(L):L.preventDefault()};return c.jsx(_,{className:`w-full ${x}`,style:m,children:c.jsxs(Do,{onSubmit:M,className:"space-y-6",noValidate:!0,children:[y&&c.jsx(_,{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",children:c.jsx(ut,{className:"text-sm text-red-600 dark:text-red-400",children:y})}),c.jsxs(_,{children:[c.jsx(Ft,{htmlFor:"email",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:e}),c.jsx(ft,{id:"email",name:"email",type:"email",value:T,onChange:L=>C(L.target.value),placeholder:r,disabled:D,className:`
|
|
|
|
|
${e?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 hover:border-gray-400 dark:border-gray-600 dark:hover:border-gray-500"}
|
|
|
|
|
`,onClick:r,children:h.jsxs(I,{className:"flex justify-between items-start",children:[h.jsxs(I,{className:"flex-1",children:[h.jsxs(Q,{className:"font-semibold text-gray-900 dark:text-gray-100",children:["버전 ",t.version]}),h.jsx(Q,{className:"ml-2 text-sm text-gray-500 dark:text-gray-400",children:Iv(t.created_at)})]}),h.jsxs(I,{className:"flex gap-3 text-sm",children:[h.jsxs(Q,{className:"text-green-600 dark:text-green-400",children:["+",t.changes_summary.added]}),h.jsxs(Q,{className:"text-red-600 dark:text-red-400",children:["-",t.changes_summary.removed]})]})]})})});wu.displayName="VersionListItem";const ku=({versions:t,selectedId:e,onSelect:n})=>t.length===0?h.jsx(I,{className:"p-4 text-center text-gray-500 dark:text-gray-400",children:"버전이 없습니다."}):h.jsx(Aa,{role:"list",className:"space-y-2",children:t.map(r=>h.jsx(wu,{version:r,isSelected:e===r.id,onSelect:n},r.id))}),Lv=({layoutId:t,versions:e,onRestore:n})=>{const[r,s]=v.useState(),o=l=>{s(l)},i=()=>{r!==void 0&&n(r)},a=r===void 0;return h.jsxs(I,{className:"space-y-4",role:"region","aria-label":"레이아웃 히스토리 패널",children:[h.jsx(I,{className:"border border-gray-300 dark:border-gray-600 rounded-lg p-4",children:h.jsx(ku,{versions:e,selectedId:r,onSelect:o})}),h.jsx(I,{className:"flex justify-end",children:h.jsx(oe,{variant:"primary",disabled:a,onClick:i,"aria-label":"선택한 버전으로 복원",children:"복원"})})]})},Pv=({emailLabel:t="Email",passwordLabel:e="Password",submitButtonText:n="Sign In",processingText:r="Processing...",emailPlaceholder:s="Email",passwordPlaceholder:o="Password",forgotPasswordText:i="Forgot your password?",forgotPasswordUrl:a="/admin/password/reset",emailRequiredError:l="Please enter your email.",emailInvalidError:c="Please enter a valid email address.",passwordRequiredError:d="Please enter your password.",onSubmit:u,loadingActions:f={},isLoading:g=!1,disabled:m=!1,apiError:p="",className:y="",style:b})=>{const[S,x]=v.useState(""),[E,k]=v.useState(""),[C,N]=v.useState({}),_=p,w=Object.values(f).some(F=>F===!0),M=g||w,O=m||M,L=()=>{const F={},D=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return!S||S.trim()===""?F.email=l:D.test(S)||(F.email=c),(!E||E.trim()==="")&&(F.password=d),N(F),Object.keys(F).length===0},$=async F=>{if(!L()){F.preventDefault();return}N({}),u?await u(F):F.preventDefault()};return h.jsx(I,{className:`w-full ${y}`,style:b,children:h.jsxs(Ia,{onSubmit:$,className:"space-y-6",noValidate:!0,children:[_&&h.jsx(I,{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800",children:h.jsx(bt,{className:"text-sm text-red-600 dark:text-red-400",children:_})}),h.jsxs(I,{children:[h.jsx(en,{htmlFor:"email",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:t}),h.jsx(wt,{id:"email",name:"email",type:"email",value:S,onChange:F=>x(F.target.value),placeholder:s,disabled:O,className:`
|
|
|
|
|
w-full px-4 py-3 rounded-lg border
|
|
|
|
|
${E.email?"border-red-500 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500"}
|
|
|
|
|
${C.email?"border-red-500 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500"}
|
|
|
|
|
bg-white dark:bg-gray-800
|
|
|
|
|
text-gray-900 dark:text-white
|
|
|
|
|
placeholder-gray-400 dark:placeholder-gray-500
|
|
|
|
|
focus:outline-none focus:ring-2
|
|
|
|
|
disabled:opacity-50 disabled:cursor-not-allowed
|
|
|
|
|
transition-colors duration-200
|
|
|
|
|
`}),E.email&&c.jsx(ut,{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:E.email})]}),c.jsxs(_,{children:[c.jsx(Ft,{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:t}),c.jsx(ft,{id:"password",name:"password",type:"password",value:S,onChange:L=>N(L.target.value),placeholder:o,disabled:D,className:`
|
|
|
|
|
`}),C.email&&h.jsx(bt,{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:C.email})]}),h.jsxs(I,{children:[h.jsx(en,{htmlFor:"password",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",children:e}),h.jsx(wt,{id:"password",name:"password",type:"password",value:E,onChange:F=>k(F.target.value),placeholder:o,disabled:O,className:`
|
|
|
|
|
w-full px-4 py-3 rounded-lg border
|
|
|
|
|
${E.password?"border-red-500 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500"}
|
|
|
|
|
${C.password?"border-red-500 focus:border-red-500 focus:ring-red-500":"border-gray-300 dark:border-gray-600 focus:border-blue-500 focus:ring-blue-500"}
|
|
|
|
|
bg-white dark:bg-gray-800
|
|
|
|
|
text-gray-900 dark:text-white
|
|
|
|
|
placeholder-gray-400 dark:placeholder-gray-500
|
|
|
|
|
focus:outline-none focus:ring-2
|
|
|
|
|
disabled:opacity-50 disabled:cursor-not-allowed
|
|
|
|
|
transition-colors duration-200
|
|
|
|
|
`}),E.password&&c.jsx(ut,{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:E.password})]}),i&&c.jsx(_,{className:"flex items-center justify-end",children:c.jsx(jr,{href:i,className:"text-sm text-blue-600 hover:text-blue-500 dark:text-blue-400 dark:hover:text-blue-300 transition-colors duration-200",children:s})}),c.jsx(re,{type:"submit",disabled:D,className:`
|
|
|
|
|
`}),C.password&&h.jsx(bt,{className:"mt-2 text-sm text-red-600 dark:text-red-400",children:C.password})]}),a&&h.jsx(I,{className:"flex items-center justify-end",children:h.jsx(Lr,{href:a,className:"text-sm text-blue-600 hover:text-blue-500 dark:text-blue-400 dark:hover:text-blue-300 transition-colors duration-200",children:i})}),h.jsx(oe,{type:"submit",disabled:O,className:`
|
|
|
|
|
w-full px-4 py-3 rounded-lg font-medium
|
|
|
|
|
bg-blue-600 hover:bg-blue-700
|
|
|
|
|
dark:bg-blue-500 dark:hover:bg-blue-600
|
|
|
|
@@ -187,16 +146,16 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
|
|
disabled:opacity-50 disabled:cursor-not-allowed
|
|
|
|
|
transition-colors duration-200
|
|
|
|
|
flex items-center justify-center
|
|
|
|
|
`,children:A?c.jsxs(c.Fragment,{children:[c.jsxs(gr,{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[c.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),c.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),a]}):n})]})})},Vl=e=>e==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,is=e=>{const t=Vl(e);document.documentElement.setAttribute("data-theme",t),t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},Ph=()=>{const e=localStorage.getItem("g7_color_scheme");return e&&["auto","light","dark"].includes(e)?e:"auto"},$h=({onThemeChange:e,className:t="",autoText:n="System",lightText:a="Light",darkText:r="Dark"})=>{const o=Ph(),[s,i]=b.useState(o),[l,g]=b.useState(!1),d=b.useRef(null);b.useEffect(()=>{is(s)},[]),b.useEffect(()=>{if(s!=="auto")return;const h=window.matchMedia("(prefers-color-scheme: dark)"),v=()=>{is("auto")};return h.addEventListener("change",v),()=>h.removeEventListener("change",v)},[s]),b.useEffect(()=>{const h=v=>{d.current&&!d.current.contains(v.target)&&g(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[]);const u=h=>{i(h),localStorage.setItem("g7_color_scheme",h),is(h),g(!1),e?.(h)},f=()=>Vl(s)==="dark"?de.Moon:de.Sun;return c.jsxs(_,{ref:d,className:`relative ${t}`,children:[c.jsx(re,{onClick:()=>g(!l),className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors","aria-label":"Toggle theme",children:c.jsx(ne,{name:f(),className:"w-5 h-5 text-gray-600 dark:text-gray-400"})}),l&&c.jsx(_,{className:"absolute right-0 mt-2 w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:c.jsxs(_,{className:"py-2",children:[c.jsxs(re,{onClick:()=>u("auto"),className:`
|
|
|
|
|
`,children:M?h.jsxs(h.Fragment,{children:[h.jsxs(Hn,{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r]}):n})]})})},Cu=t=>t==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,il=t=>{const e=Cu(t);document.documentElement.setAttribute("data-theme",e),e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},$v=()=>{const t=localStorage.getItem("g7_color_scheme");return t&&["auto","light","dark"].includes(t)?t:"auto"},Fv=({onThemeChange:t,className:e="",autoText:n="System",lightText:r="Light",darkText:s="Dark",id:o,editorAttrs:i})=>{const a=$v(),[l,c]=v.useState(a),[d,u]=v.useState(!1),f=v.useRef(null);v.useEffect(()=>{il(l)},[]),v.useEffect(()=>{if(l!=="auto")return;const p=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>{il("auto")};return p.addEventListener("change",y),()=>p.removeEventListener("change",y)},[l]),v.useEffect(()=>{const p=y=>{f.current&&!f.current.contains(y.target)&&u(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const g=p=>{c(p),localStorage.setItem("g7_color_scheme",p),il(p),u(!1),t?.(p)},m=()=>Cu(l)==="dark"?de.Moon:de.Sun;return h.jsxs(I,{ref:f,className:`relative ${e}`,id:o,...i,children:[h.jsx(oe,{onClick:()=>u(!d),className:"w-9 h-9 flex items-center justify-center hover:bg-gray-100 dark:hover:bg-gray-800 rounded-full transition-colors","aria-label":"Toggle theme",children:h.jsx(re,{name:m(),className:"text-sm text-slate-500 dark:text-slate-400"})}),d&&h.jsx(I,{className:"absolute right-0 mt-2 w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:h.jsxs(I,{className:"py-2",children:[h.jsxs(oe,{onClick:()=>g("auto"),className:`
|
|
|
|
|
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
|
|
|
|
${s==="auto"?"bg-gray-50 dark:bg-gray-700":""}
|
|
|
|
|
`,children:[c.jsx(ne,{name:de.Settings,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),c.jsx(Z,{className:"flex-1 text-left text-gray-900 dark:text-white",children:n}),s==="auto"&&c.jsx(ne,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),c.jsxs(re,{onClick:()=>u("light"),className:`
|
|
|
|
|
${l==="auto"?"bg-gray-50 dark:bg-gray-700":""}
|
|
|
|
|
`,children:[h.jsx(re,{name:de.Settings,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"flex-1 text-left text-gray-900 dark:text-white",children:n}),l==="auto"&&h.jsx(re,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),h.jsxs(oe,{onClick:()=>g("light"),className:`
|
|
|
|
|
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
|
|
|
|
${s==="light"?"bg-gray-50 dark:bg-gray-700":""}
|
|
|
|
|
`,children:[c.jsx(ne,{name:de.Sun,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),c.jsx(Z,{className:"flex-1 text-left text-gray-900 dark:text-white",children:a}),s==="light"&&c.jsx(ne,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),c.jsxs(re,{onClick:()=>u("dark"),className:`
|
|
|
|
|
${l==="light"?"bg-gray-50 dark:bg-gray-700":""}
|
|
|
|
|
`,children:[h.jsx(re,{name:de.Sun,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"flex-1 text-left text-gray-900 dark:text-white",children:r}),l==="light"&&h.jsx(re,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),h.jsxs(oe,{onClick:()=>g("dark"),className:`
|
|
|
|
|
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
|
|
|
|
${s==="dark"?"bg-gray-50 dark:bg-gray-700":""}
|
|
|
|
|
`,children:[c.jsx(ne,{name:de.Moon,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),c.jsx(Z,{className:"flex-1 text-left text-gray-900 dark:text-white",children:r}),s==="dark"&&c.jsx(ne,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},Hl=window.G7Core?.createLogger?.("Comp:ColumnSelector")??{log:(...e)=>console.log("[Comp:ColumnSelector]",...e),warn:(...e)=>console.warn("[Comp:ColumnSelector]",...e),error:(...e)=>console.error("[Comp:ColumnSelector]",...e)},jl=(e,t)=>window.G7Core?.t?.(e,t)??e,Fh=()=>window.G7Core,Uh=({id:e,columns:t,visibleColumns:n,onColumnVisibilityChange:a,triggerLabel:r,triggerIconName:o=de.Sliders,position:s="right",className:i="",style:l,requiredText:g,menuTitle:d,menuDescription:u,defaultColumns:f,triggerClassName:h,labelClassName:v,dynamicColumns:p,dynamicColumnsInsertAfter:x})=>{const m=r??jl("common.column_selector"),T=g??jl("common.required"),C=b.useMemo(()=>{if(!p||!Array.isArray(p)||p.length===0)return t;if(x){const B=t.findIndex(V=>V.field===x);if(B!==-1)return[...t.slice(0,B+1),...p,...t.slice(B+1)]}return[...t,...p]},[t,p,x]),[S,N]=b.useState(!1),E=b.useRef(null),k=b.useRef(null),[y,w]=b.useState(!1),[A,D]=b.useState(s),F=b.useMemo(()=>{try{const B=window.G7Core?.AuthManager?.getInstance();return B?B.getUser()?.uuid:void 0}catch{return}},[]),M=e?`g7_columns_${e}${F!==void 0?`_${F}`:""}`:null,L=()=>{if(!M)return null;try{const B=localStorage.getItem(M);if(B){const V=JSON.parse(B);if(Array.isArray(V)&&V.length>0)return V}}catch(B){Hl.warn("Failed to load from localStorage:",B)}return null},U=B=>{if(M)try{localStorage.setItem(M,JSON.stringify(B))}catch(V){Hl.warn("Failed to save to localStorage:",V)}},O=()=>{const B=L();return B||(n&&n.length>0?n:f&&f.length>0?f:C.filter(V=>V.visible!==!1).map(V=>V.field))},[I,H]=b.useState(O);b.useEffect(()=>{y||(a&&I.length>0&&a(I),w(!0))},[y,a,I]),b.useEffect(()=>{y&&n&&n.length>0&&(L()||H(n))},[n,y]);const $=b.useRef([]),z=b.useRef(null);b.useEffect(()=>{if(y&&p&&p.length>0){const B=p.map(R=>R.field);if(z.current===null){const R=L();if(z.current=R!==null,R!==null){$.current=B;return}}const V=$.current,Y=B.filter(R=>!V.includes(R));if(Y.length>0){const R=n&&n.length>0?n:I,ae=Y.filter(ee=>!R.includes(ee));if(ae.length>0){const ee=[...R,...ae];H(ee),U(ee),a?.(ee)}}$.current=B}},[p,y]);const G=n&&n.length>0?n:I;b.useEffect(()=>{const B=V=>{E.current&&!E.current.contains(V.target)&&N(!1)};return S&&document.addEventListener("mousedown",B),()=>{document.removeEventListener("mousedown",B)}},[S]),b.useEffect(()=>{if(S&&k.current&&E.current){const B=k.current.getBoundingClientRect(),V=E.current.getBoundingClientRect(),Y=window.innerWidth,R=B.width||256;s==="right"?V.right-R<0?D("left"):D("right"):V.left+R>Y?D("right"):D("left")}},[S,s]);const j=B=>{if(C.find(R=>R.field===B)?.required)return;const Y=G.includes(B)?G.filter(R=>R!==B):[...G,B];H(Y),U(Y),a?.(Y)},W=A==="left"?"left-0":"right-0";return c.jsxs(_,{ref:E,className:`relative inline-block ${i}`,style:l,children:[c.jsxs(re,{onClick:()=>N(!S),className:Fh()?.style?.mergeClasses?.("flex items-center gap-2 px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",h)??`flex items-center gap-2 px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors ${h??""}`,children:[c.jsx(ne,{name:o,className:"w-5 h-5"}),m&&c.jsx(Z,{className:`${v||"hidden sm:inline"} text-sm`,children:m})]}),S&&c.jsxs(_,{ref:k,className:`absolute ${W} z-50 mt-2 w-64 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg`,children:[(d||u)&&c.jsxs(_,{className:"px-4 pt-3 pb-2 border-b border-gray-200 dark:border-gray-700",children:[d&&c.jsx(Z,{className:"block text-sm font-medium text-gray-900 dark:text-white",children:d}),u&&c.jsx(Z,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-1",children:u})]}),c.jsx(_,{className:"p-2 max-h-64 overflow-y-auto",children:C.map(B=>{const V=G.includes(B.field),Y=B.required===!0;return c.jsxs(_,{onClick:()=>!Y&&j(B.field),className:`flex items-center gap-2 px-3 py-2 rounded hover:bg-gray-50 dark:hover:bg-gray-700 ${Y?"cursor-default":"cursor-pointer"}`,children:[c.jsx(Xt,{checked:V,disabled:Y,readOnly:!0,className:"h-4 w-4 text-blue-600 rounded border-gray-300 dark:border-gray-600 pointer-events-none"}),c.jsx(Z,{className:"text-sm text-gray-700 dark:text-gray-300",children:B.header}),Y&&T&&c.jsx(Z,{className:"ml-auto text-xs text-gray-400 dark:text-gray-500",children:T})]},B.field)})})]})]})},Vh=window.G7Core?.createLogger?.("Comp:PageTransition")??{log:(...e)=>console.log("[Comp:PageTransition]",...e),warn:(...e)=>console.warn("[Comp:PageTransition]",...e),error:(...e)=>console.error("[Comp:PageTransition]",...e)},Hh=({className:e="",style:t})=>{const[n,a]=b.useState(!1);return b.useEffect(()=>{const r=window.G7Core?.Tr
Line truncated
|
|
|
|
|
${l==="dark"?"bg-gray-50 dark:bg-gray-700":""}
|
|
|
|
|
`,children:[h.jsx(re,{name:de.Moon,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"flex-1 text-left text-gray-900 dark:text-white",children:s}),l==="dark"&&h.jsx(re,{name:de.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},Su=window.G7Core?.createLogger?.("Comp:ColumnSelector")??{log:(...t)=>console.log("[Comp:ColumnSelector]",...t),warn:(...t)=>console.warn("[Comp:ColumnSelector]",...t),error:(...t)=>console.error("[Comp:ColumnSelector]",...t)},_u=(t,e)=>window.G7Core?.t?.(t,e)??t,Vv=()=>window.G7Core,zv=({id:t,columns:e,visibleColumns:n,onColumnVisibilityChange:r,triggerLabel:s,triggerIconName:o=de.Sliders,position:i="right",className:a="",style:l,requiredText:c,menuTitle:d,menuDescription:u,defaultColumns:f,triggerClassName:g,labelClassName:m,dynamicColumns:p,dynamicColumnsInsertAfter:y,editorAttrs:b})=>{const S=s??_u("common.column_selector"),x=c??_u("common.required"),E=v.useMemo(()=>{if(!p||!Array.isArray(p)||p.length===0)return e;if(y){const z=e.findIndex(K=>K.field===y);if(z!==-1)return[...e.slice(0,z+1),...p,...e.slice(z+1)]}return[...e,...p]},[e,p,y]),[k,C]=v.useState(!1),N=v.useRef(null),_=v.useRef(null),[w,M]=v.useState(!1),[O,L]=v.useState(i),$=v.useMemo(()=>{try{const z=window.G7Core?.AuthManager?.getInstance();return z?z.getUser()?.uuid:void 0}catch{return}},[]),F=t?`g7_columns_${t}${$!==void 0?`_${$}`:""}`:null,D=()=>{if(!F)return null;try{const z=localStorage.getItem(F);if(z){const K=JSON.parse(z);if(Array.isArray(K)&&K.length>0)return K}}catch(z){Su.warn("Failed to load from localStorage:",z)}return null},A=z=>{if(F)try{localStorage.setItem(F,JSON.stringify(z))}catch(K){Su.warn("Failed to save to localStorage:",K)}},T=()=>{const z=D();return z||(n&&n.length>0?n:f&&f.length>0?f:E.filter(K=>K.visible!==!1).map(K=>K.field))},[V,H]=v.useState(T);v.useEffect(()=>{w||(r&&V.length>0&&r(V),M(!0))},[w,r,V]),v.useEffect(()=>{w&&n&&n.length>0&&(D()||H(n))},[n,w]);const W=v.useRef([]),j=v.useRef(null);v.useEffect(()=>{if(w&&p&&p.length>0){const z=p.map(Z=>Z.field);if(j.current===null){const Z=D();if(j.current=Z!==null,Z!==null){W.current=z;return}}const K=W.current,X=z.filter(Z=>!K.includes(Z));if(X.length>0){const Z=n&&n.length>0?n:V,ee=X.filter(ne=>!Z.includes(ne));if(ee.length>0){const ne=[...Z,...ee];H(ne),A(ne),r?.(ne)}}W.current=z}},[p,w]);const U=n&&n.length>0?n:V;v.useEffect(()=>{const z=K=>{N.current&&!N.current.contains(K.target)&&C(!1)};return k&&document.addEventListener("mousedown",z),()=>{document.removeEventListener("mousedown",z)}},[k]),v.useEffect(()=>{if(k&&_.current&&N.current){const z=_.current.getBoundingClientRect(),K=N.current.getBoundingClientRect(),X=window.innerWidth,Z=z.width||256;i==="right"?K.right-Z<0?L("left"):L("right"):K.left+Z>X?L("right"):L("left")}},[k,i]);const B=z=>{if(E.find(Z=>Z.field===z)?.required)return;const X=U.includes(z)?U.filter(Z=>Z!==z):[...U,z];H(X),A(X),r?.(X)},G=O==="left"?"left-0":"right-0";return h.jsxs(I,{ref:N,className:`relative inline-block ${a}`,style:l,id:t,...b,children:[h.jsxs(oe,{onClick:()=>C(!k),className:Vv()?.style?.mergeClasses?.("flex items-center gap-2 px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors",g)??`flex items-center gap-2 px-3 py-2 bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-200 dark:hover:bg-gray-600 transition-colors ${g??""}`,children:[h.jsx(re,{name:o,className:"w-5 h-5"}),S&&h.jsx(Q,{className:`${m||"hidden sm:inline"} text-sm`,children:S})]}),k&&h.jsxs(I,{ref:_,className:`absolute ${G} z-50 mt-2 w-64 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg`,children:[(d||u)&&h.jsxs(I,{className:"px-4 pt-3 pb-2 border-b border-gray-200 dark:border-gray-700",children:[d&&h.jsx(Q,{className:"block text-sm font-medium text-gray-900 dark:text-white",children:d}),u&&h.jsx(Q,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-1",children:u})]}),h.jsx(I,{className:"p-2 max-h-64 overflow-y-auto",children:E.map(z=>{const K=U.includes(z.field),X=z.required===!0;return h.jsxs(I,{onClick:()=>!X&&B(z.field),className:`flex items-center gap-2 px-3 py-2 rounded hover:bg-gray-50 dark:hover:bg-gray-700 ${X?"cursor-default":"cursor-pointer"}`,children:[h.jsx(vn,{checked:K,disabled:X,readOnly:!0,className:"h-4 w-4 text-blue-600 rounded border-gray-300 dark:border-gray-600 pointer-events-none"}),h.jsx(Q,{className:"text-sm text-gray-700 dark:text-gray-300",children:z.header}),X&&x&&h.jsx(Q,{className:"ml-auto text-xs text-gray-400 dark:text-gray-500",children:x})]},z.field)})})]})]})},Hv=window.G7Core?.createLogger?.("Comp:PageTransition")??{log:(...t)=>console.log("[Comp:PageTransition]",...t),warn:(...t)=>console.warn("[Comp:PageTransition]",...t),error:(...t)=>console.error("[Comp:PageTransition]",...t)},Uv=({className:t="",style:e})=>{const[n,r]=v.useState(!1);return v.useEffect(()=>{c
Line truncated
|
|
|
|
|
@keyframes loading {
|
|
|
|
|
0% {
|
|
|
|
|
transform: translateX(-100%);
|
|
|
|
@@ -208,19 +167,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
|
|
transform: translateX(-100%);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`})]}):null},jh=(e,t)=>window.G7Core?.t?.(e,t)??e,zh=({options:e})=>{const t=document.documentElement.classList.contains("dark"),n=t?"rgb(17,24,39)":"rgb(249,250,251)",a=t?"#6b7280":"#9ca3af",r=t?"#9ca3af":"#6b7280";return c.jsxs("div",{style:{position:"absolute",inset:0,zIndex:2147483647,overflow:"hidden",background:n,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",paddingTop:"15%",gap:"12px"},children:[c.jsx("div",{style:{width:"32px",height:"32px",border:`3px solid ${a}`,borderTopColor:"transparent",borderRadius:"50%",animation:"g7-spin 0.8s linear infinite"}}),c.jsx("span",{style:{color:r,fontSize:"14px"},children:e?.text||jh("nav.loading")})]})};function Tr(e){"@babel/helpers - typeof";return Tr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tr(e)}function Gh(e,t){if(Tr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(Tr(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zl(e){var t=Gh(e,"string");return Tr(t)=="symbol"?t:t+""}function In(e,t,n){return(t=zl(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,a)}return n}function Ee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gl(Object(n),!0).forEach(function(a){In(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gl(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function Bh(e){if(Array.isArray(e))return e}function Wh(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,r,o,s,i=[],l=!0,g=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=o.call(n)).done)&&(i.push(a.value),i.length!==t);l=!0);}catch(d){g=!0,r=d}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(g)throw r}}return i}}function ls(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function Bl(e,t){if(e){if(typeof e=="string")return ls(e,t);var n={}.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)?ls(e,t):void 0}}function Yh(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hr(e,t){return Bh(e)||Wh(e,t)||Bl(e,t)||Yh()}function qh(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;n[a]=e[a]}return n}function sr(e,t){if(e==null)return{};var n,a,r=qh(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)n=o[a],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Kh=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Wl(e){var t=e.defaultInputValue,n=t===void 0?"":t,a=e.defaultMenuIsOpen,r=a===void 0?!1:a,o=e.defaultValue,s=o===void 0?null:o,i=e.inputValue,l=e.menuIsOpen,g=e.onChange,d=e.onInputChange,u=e.onMenuClose,f=e.onMenuOpen,h=e.value,v=sr(e,Kh),p=b.useState(i!==void 0?i:n),x=hr(p,2),m=x[0],T=x[1],C=b.useState(l!==void 0?l:r),S=hr(C,2),N=S[0],E=S[1],k=b.useState(h!==void 0?h:s),y=hr(k,2),w=y[0],A=y[1],D=b.useCallback(function(H,$){typeof g=="function"&&g(H,$),A(H)},[g]),F=b.useCallback(function(H,$){var z;typeof d=="function"&&(z=d(H,$)),T(z!==void 0?z:H)},[d]),M=b.useCallback(function(){typeof f=="function"&&f(),E(!0)},[f]),L=b.useCallback(function(){typeof u=="function"&&u(),E(!1)},[u]),U=i!==void 0?i:m,O=l!==void 0?l:N,I=h!==void 0?h:w;return Ee(Ee({},v),{},{inputValue:U,menuIsOpen:O,onChange:D,onInputChange:F,onMenuClose:L,onMenuOpen:M,value:I})}function Me(){return Me=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Me.apply(null,arguments)}function Xh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yl(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,zl(a.key),a)}}function Zh(e,t,n){return t&&Yl(e.prototype,t),n&&Yl(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function cs(e,t){return cs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},cs(e,t)}function Qh(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cs(e,t)}function Sa(e){return Sa=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sa(e)}function ql(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ql=function(){return!!e})()}function Jh(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Rh(e,t){if(t&&(Tr(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jh(e)}function ep(e){var t=ql();return function(){var n,a=Sa(e);if(t){var r=Sa(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return Rh(this,n)}}function tp(e){if(Array.isArray(e))return ls(e)}function rp(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function np(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qr(e){return tp(e)||rp(e)||Bl(e)||np()}function ap(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function op(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var sp=(function(){function e(n){var a=this;this._insertTag=function(r){var o;a.tags.length===0?a.insertionPoint?o=a.insertionPoint.nextSibling:a.prepend?o=a.container.firstChild:o=a.before:o=a.tags[a.tags.length-1].nextSibling,a.container.insertBefore(r,o),a.tags.push(r)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(a){a.forEach(this._insertTag)},t.insert=function(a){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(op(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=ap(r);try{o.insertRule(a,o.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(a));this.ctr++},t.flush=function(){this.tags.forEach(function(a){var r;return(r=a.parentNode)==null?void 0:r.removeChild(a)}),this.tags=[],this.ctr=0},e})(),Ct="-ms-",Ea="-moz-",Ke="-webkit-",Kl="comm",ds="rule",us="decl",ip="@import",Xl="@keyframes",lp="@layer",cp=Math.abs,Na=String.fromCharCode,dp=Object.assign;function up(e,t){return yt(e,0)^45?(((t<<2^yt(e,0))<<2^yt(e,1))<<2^yt(e,2))<<2^yt(e,3):0}function Zl(e){return e.trim()}function fp(e,t){return(e=t.exec(e))?e[0]:e}function Xe(e,t,n){return e.replace(t,n)}function fs(e,t){return e.indexOf(t)}function yt(e,t){return e.charCodeAt(t)|0}function An(e,t,n){return e.slice(t,n)}function ir(e){return e.length}function gs(e){return e.length}function Ta(e,t){return t.push(e),e}function gp(e,t){return e.map(t).join("")}var Oa=1,Kr=1,Ql=0,Dt=0,gt=0,Xr="";function Ma(e,t,n,a,r,o,s){return{value:e,root:t,parent:n,type:a,props:r,children:o,line:Oa,column:Kr,length:s,return:""}}function Ln(e,t){return dp(Ma("",null,null,"",null,null,0),e,{length:-e.length},t)}function hp(){return gt}function pp(){return gt=Dt>0?yt(Xr,--Dt):0,Kr--,gt===10&&(Kr=1,Oa--),gt}function Ht(){return gt=Dt<Ql?yt(Xr,Dt++):0,Kr++,gt===10&&(Kr=1,Oa++),gt}function lr(){return yt(Xr,Dt)}function Ia(){return Dt}function _n(e,t){return An(Xr,e,t)}function Dn(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Jl(e){return Oa=Kr=1,Ql=ir(Xr=e),Dt=0,[]}function Rl(e){return Xr="",e}function Aa(e){return Zl(_n(Dt-1,hs(e===91?e+2:e===40?e+1:e)))}function bp(e){for(;(gt=lr())&><33;)Ht();return Dn(e)>2||Dn(gt)>3?"":" "}function mp(e,t){for(;--t&&Ht()&&!(gt<48||gt>102||gt>57&><65||gt>70&><97););return _n(e,Ia()+(t<6&&lr()==32&&Ht()==32))}function hs(e){for(;Ht();)switch(gt){case e:return Dt;case 34:case 39:e!==34&&e!==39&&hs(gt);break;case 40:e===41&&hs(e);break;case 92:Ht();break}return Dt}function vp(e,t){for(;Ht()&&e+gt!==57;)if(e+gt===84&&lr()===47)break;return"/*"+_n(t,Dt-1)+"*"+Na(e===47?e:Ht())}function yp(e){for(;!Dn(lr());)Ht();return _n(e,Dt)}function xp(e){return Rl(La("",null,null,null,[""],e=Jl(e),0,[0],e))}function La(e,t,n,a,r,o,s,i,l){for(var g=0,d=0,u=s,f=0,h=0,v=0,p=1,x=1,m=1,T=0,C="",S=r,N=o,E=a,k=C;x;)switch(v=T,T=Ht()){case 40:if(v!=108&&yt(k,u-1)==58){fs(k+=Xe(Aa(T),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:k+=Aa(T);break;case 9:case 10:case 13:case 32:k+=bp(v);break;case 92:k+=mp(Ia()-1,7);continue;case 47:switch(lr()){case 42:case 47:Ta(wp(vp(Ht(),Ia()),t,n),l);break;default:k+="/"}break;case 123*p:i[g++]=ir(k)*m;case 125*p:case 59:case 0:switch(T){case 0:case 125:x=0;case 59+d:m==-1&&(k=Xe(k,/\f/g,"")),h>0&&ir(k)-u&&Ta(h>32?tc(k+";",a,n,u-1):tc(Xe(k," ","")+";",a,n,u-2),l);break;case 59:k+=";";default:if(Ta(E=ec(k,t,n,g,d,r,i,C,S=[],N=[],u),o),T===123)if(d===0)La(k,t,E,E,S,o,u,i,N);else switch(f===99&&yt(k,3)===110?100:f){case 100:case 108:case 109:case 115:La(e,E,E,a&&Ta(ec(e,E,E,0,0,r,i,C,r,S=[],u),N),r,N,u,i,a?S:N);break;default:La(k,E,E,E,[""],N,0,i,N)}}g=d=h=0,p=m=1,C=k="",u=s;break;case 58:u=1+ir(k),h=v;default:if(p<1){if(T==123)--p;else if(T==125&&p++==0&&pp()==125)continue}switch(k+=Na(T),T*p){case 38:m=d>0?1:(k+="\f",-1);break;case 44:i[g++]=(ir(k)-1)*m,m=1;break;case 64:lr()===45&&(k+=Aa(Ht())),f=lr(),d=u=ir(C=k+=yp(Ia())),T++;break;case 45:v===45&&ir(k)==2&&(p=0)}}return o}function ec(e,t,n,a,r,o,s,i,l,g,d){for(var u=r-1,f=r===0?o:[""],h=gs(f),v=0,p=0,x=0;v<a;++v)for(var m=0,T=An(e,u+1,u=cp(p=s[v])),C=e;m<h;++m)(C=Zl(p>0?f[m]+" "+T:Xe(T,/&\f/g,f[m])))&&(l[x++]=C);retu
Line truncated
|
|
|
|
|
`})]}):null},Bv=(t,e)=>window.G7Core?.t?.(t,e)??t,jv=({options:t})=>{const e=document.documentElement.classList.contains("dark"),n=e?"rgb(17,24,39)":"rgb(249,250,251)",r=e?"#6b7280":"#9ca3af",s=e?"#9ca3af":"#6b7280";return h.jsxs("div",{style:{position:"absolute",inset:0,zIndex:2147483647,overflow:"hidden",background:n,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",paddingTop:"15%",gap:"12px"},children:[h.jsx("div",{style:{width:"32px",height:"32px",border:`3px solid ${r}`,borderTopColor:"transparent",borderRadius:"50%",animation:"g7-spin 0.8s linear infinite"}}),h.jsx("span",{style:{color:s,fontSize:"14px"},children:t?.text||Bv("nav.loading")})]})};function fr(t){"@babel/helpers - typeof";return fr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fr(t)}function Wv(t,e){if(fr(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(fr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Eu(t){var e=Wv(t,"string");return fr(e)=="symbol"?e:e+""}function Ts(t,e,n){return(e=Eu(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Mu(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),n.push.apply(n,r)}return n}function Oe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Mu(Object(n),!0).forEach(function(r){Ts(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mu(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Gv(t){if(Array.isArray(t))return t}function Yv(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,o,i,a=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(d){c=!0,s=d}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw s}}return a}}function al(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Nu(t,e){if(t){if(typeof t=="string")return al(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?al(t,e):void 0}}function Xv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Un(t,e){return Gv(t)||Yv(t,e)||Nu(t,e)||Xv()}function Kv(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function On(t,e){if(t==null)return{};var n,r,s=Kv(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}var qv=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Ou(t){var e=t.defaultInputValue,n=e===void 0?"":e,r=t.defaultMenuIsOpen,s=r===void 0?!1:r,o=t.defaultValue,i=o===void 0?null:o,a=t.inputValue,l=t.menuIsOpen,c=t.onChange,d=t.onInputChange,u=t.onMenuClose,f=t.onMenuOpen,g=t.value,m=On(t,qv),p=v.useState(a!==void 0?a:n),y=Un(p,2),b=y[0],S=y[1],x=v.useState(l!==void 0?l:s),E=Un(x,2),k=E[0],C=E[1],N=v.useState(g!==void 0?g:i),_=Un(N,2),w=_[0],M=_[1],O=v.useCallback(function(V,H){typeof c=="function"&&c(V,H),M(V)},[c]),L=v.useCallback(function(V,H){var W;typeof d=="function"&&(W=d(V,H)),S(W!==void 0?W:V)},[d]),$=v.useCallback(function(){typeof f=="function"&&f(),C(!0)},[f]),F=v.useCallback(function(){typeof u=="function"&&u(),C(!1)},[u]),D=a!==void 0?a:b,A=l!==void 0?l:k,T=g!==void 0?g:w;return Oe(Oe({},m),{},{inputValue:D,menuIsOpen:A,onChange:O,onInputChange:L,onMenuClose:F,onMenuOpen:$,value:T})}function De(){return De=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},De.apply(null,arguments)}function Zv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tu(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,Eu(r.key),r)}}function Qv(t,e,n){return e&&Tu(t.prototype,e),n&&Tu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ll(t,e){return ll=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ll(t,e)}function Jv(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ll(t,e)}function Yo(t){return Yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yo(t)}function Au(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Au=function(){return!!t})()}function Rv(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ex(t,e){if(e&&(fr(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rv(t)}function tx(t){var e=Au();return function(){var n,r=Yo(t);if(e){var s=Yo(this).constructor;n=Reflect.construct(r,arguments,s)}else n=r.apply(this,arguments);return ex(this,n)}}function nx(t){if(Array.isArray(t))return al(t)}function rx(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function sx(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
|
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hr(t){return nx(t)||rx(t)||Nu(t)||sx()}function ox(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function ix(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var ax=(function(){function t(n){var r=this;this._insertTag=function(s){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(s,o),r.tags.push(s)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(ix(this));var s=this.tags[this.tags.length-1];if(this.isSpeedy){var o=ox(s);try{o.insertRule(r,o.cssRules.length)}catch{}}else s.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var s;return(s=r.parentNode)==null?void 0:s.removeChild(r)}),this.tags=[],this.ctr=0},t})(),$t="-ms-",Xo="-moz-",et="-webkit-",Du="comm",cl="rule",dl="decl",lx="@import",Iu="@keyframes",cx="@layer",dx=Math.abs,Ko=String.fromCharCode,ux=Object.assign;function fx(t,e){return It(t,0)^45?(((e<<2^It(t,0))<<2^It(t,1))<<2^It(t,2))<<2^It(t,3):0}function Lu(t){return t.trim()}function hx(t,e){return(t=e.exec(t))?t[0]:t}function tt(t,e,n){return t.replace(e,n)}function ul(t,e){return t.indexOf(e)}function It(t,e){return t.charCodeAt(e)|0}function As(t,e,n){return t.slice(e,n)}function Tn(t){return t.length}function fl(t){return t.length}function qo(t,e){return e.push(t),t}function gx(t,e){return t.map(e).join("")}var Zo=1,Ur=1,Pu=0,Xt=0,kt=0,Br="";function Qo(t,e,n,r,s,o,i){return{value:t,root:e,parent:n,type:r,props:s,children:o,line:Zo,column:Ur,length:i,return:""}}function Ds(t,e){return ux(Qo("",null,null,"",null,null,0),t,{length:-t.length},e)}function px(){return kt}function mx(){return kt=Xt>0?It(Br,--Xt):0,Ur--,kt===10&&(Ur=1,Zo--),kt}function rn(){return kt=Xt<Pu?It(Br,Xt++):0,Ur++,kt===10&&(Ur=1,Zo++),kt}function An(){return It(Br,Xt)}function Jo(){return Xt}function Is(t,e){return As(Br,t,e)}function Ls(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function $u(t){return Zo=Ur=1,Pu=Tn(Br=t),Xt=0,[]}function Fu(t){return Br="",t}function Ro(t){return Lu(Is(Xt-1,hl(t===91?t+2:t===40?t+1:t)))}function bx(t){for(;(kt=An())&&kt<33;)rn();return Ls(t)>2||Ls(kt)>3?"":" "}function yx(t,e){for(;--e&&rn()&&!(kt<48||kt>102||kt>57&&kt<65||kt>70&&kt<97););return Is(t,Jo()+(e<6&&An()==32&&rn()==32))}function hl(t){for(;rn();)switch(kt){case t:return Xt;case 34:case 39:t!==34&&t!==39&&hl(kt);break;case 40:t===41&&hl(t);break;case 92:rn();break}return Xt}function vx(t,e){for(;rn()&&t+kt!==57;)if(t+kt===84&&An()===47)break;return"/*"+Is(e,Xt-1)+"*"+Ko(t===47?t:rn())}function xx(t){for(;!Ls(An());)rn();return Is(t,Xt)}function wx(t){return Fu(ei("",null,null,null,[""],t=$u(t),0,[0],t))}function ei(t,e,n,r,s,o,i,a,l){for(var c=0,d=0,u=i,f=0,g=0,m=0,p=1,y=1,b=1,S=0,x="",E=s,k=o,C=r,N=x;y;)switch(m=S,S=rn()){case 40:if(m!=108&&It(N,u-1)==58){ul(N+=tt(Ro(S),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:N+=Ro(S);break;case 9:case 10:case 13:case 32:N+=bx(m);break;case 92:N+=yx(Jo()-1,7);continue;case 47:switch(An()){case 42:case 47:qo(kx(vx(rn(),Jo()),e,n),l);break;default:N+="/"}break;case 123*p:a[c++]=Tn(N)*b;case 125*p:case 59:case 0:switch(S){case 0:case 125:y=0;case 59+d:b==-1&&(N=tt(N,/\f/g,"")),g>0&&Tn(N)-u&&qo(g>32?zu(N+";",r,n,u-1):zu(tt(N," ","")+";",r,n,u-2),l);break;case 59:N+=";";default:if(qo(C=Vu(N,e,n,c,d,s,a,x,E=[],k=[],u),o),S===123)if(d===0)ei(N,e,C,C,E,o,u,a,k);else switch(f===99&&It(N,3)===110?100:f){case 100:case 108:case 109:case 115:ei(t,C,C,r&&qo(Vu(t,C,C,0,0,s,a,x,s,E=[],u),k),s,k,u,a,r?E:k);break;default:ei(N,C,C,C,[""],k,0,a,k)}}c=d=g=0,p=b=1,x=N="",u=i;break;case 58:u=1+Tn(N),g=m;default:if(p<1){if(S==123)--p;else if(S==125&&p++==0&&mx()==125)continue}switch(N+=Ko(S),S*p){case 38:b=d>0?1:(N+="\f",-1);break;case 44:a[c++]=(Tn(N)-1)*b,b=1;break;case 64:An()===45&&(N+=Ro(rn())),f=An(),d=u=Tn(x=N+=xx(Jo())),S++;break;case 45:m===45&&Tn(N)==2&&(p=0)}}return o}function Vu(t,e,n,r,s,o,i,a,l,c,d){for(var u=s-1,f=s===0?o:[""],g=fl(f),m=0,p=0,y=0;m<r;++m)for(var b=0,S=As(t,u+1,u=dx(p=i[m])),x=t;b<g;++b)(x=Lu(p>0?f[b]+" "+S:tt(S,/&\f/g,f[b])))&&(l[y++]=x);retu
Line truncated
|
|
|
|
|
* react-is.production.min.js
|
|
|
|
|
*
|
|
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
|
|
*
|
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
|
*/var ac;function Dp(){if(ac)return Ze;ac=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,a=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,i=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,g=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,u=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,m=e?Symbol.for("react.responder"):60118,T=e?Symbol.for("react.scope"):60119;function C(N){if(typeof N=="object"&&N!==null){var E=N.$$typeof;switch(E){case t:switch(N=N.type,N){case l:case g:case a:case o:case r:case u:return N;default:switch(N=N&&N.$$typeof,N){case i:case d:case v:case h:case s:return N;default:return E}}case n:return E}}}function S(N){return C(N)===g}return Ze.AsyncMode=l,Ze.ConcurrentMode=g,Ze.ContextConsumer=i,Ze.ContextProvider=s,Ze.Element=t,Ze.ForwardRef=d,Ze.Fragment=a,Ze.Lazy=v,Ze.Memo=h,Ze.Portal=n,Ze.Profiler=o,Ze.StrictMode=r,Ze.Suspense=u,Ze.isAsyncMode=function(N){return S(N)||C(N)===l},Ze.isConcurrentMode=S,Ze.isContextConsumer=function(N){return C(N)===i},Ze.isContextProvider=function(N){return C(N)===s},Ze.isElement=function(N){return typeof N=="object"&&N!==null&&N.$$typeof===t},Ze.isForwardRef=function(N){return C(N)===d},Ze.isFragment=function(N){return C(N)===a},Ze.isLazy=function(N){return C(N)===v},Ze.isMemo=function(N){return C(N)===h},Ze.isPortal=function(N){return C(N)===n},Ze.isProfiler=function(N){return C(N)===o},Ze.isStrictMode=function(N){return C(N)===r},Ze.isSuspense=function(N){return C(N)===u},Ze.isValidElementType=function(N){return typeof N=="string"||typeof N=="function"||N===a||N===g||N===o||N===r||N===u||N===f||typeof N=="object"&&N!==null&&(N.$$typeof===v||N.$$typeof===h||N.$$typeof===s||N.$$typeof===i||N.$$typeof===d||N.$$typeof===x||N.$$typeof===m||N.$$typeof===T||N.$$typeof===p)},Ze.typeOf=C,Ze}var oc;function Pp(){return oc||(oc=1,ps.exports=Dp()),ps.exports}var bs,sc;function $p(){if(sc)return bs;sc=1;var e=Pp(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},r={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[e.ForwardRef]=a,o[e.Memo]=r;function s(v){return e.isMemo(v)?r:o[v.$$typeof]||t}var i=Object.defineProperty,l=Object.getOwnPropertyNames,g=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,f=Object.prototype;function h(v,p,x){if(typeof p!="string"){if(f){var m=u(p);m&&m!==f&&h(v,m,x)}var T=l(p);g&&(T=T.concat(g(p)));for(var C=s(v),S=s(p),N=0;N<T.length;++N){var E=T[N];if(!n[E]&&!(x&&x[E])&&!(S&&S[E])&&!(C&&C[E])){var k=d(p,E);try{i(v,E,k)}catch{}}}}return v}return bs=h,bs}$p();var Fp=!0;function Up(e,t,n){var a="";return n.split(" ").forEach(function(r){e[r]!==void 0?t.push(e[r]+";"):r&&(a+=r+" ")}),a}var ic=function(t,n,a){var r=t.key+"-"+n.name;(a===!1||Fp===!1)&&t.registered[r]===void 0&&(t.registered[r]=n.styles)},Vp=function(t,n,a){ic(t,n,a);var r=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+r:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function Hp(e){for(var t=0,n,a=0,r=e.length;r>=4;++a,r-=4)n=e.charCodeAt(a)&255|(e.charCodeAt(++a)&255)<<8|(e.charCodeAt(++a)&255)<<16|(e.charCodeAt(++a)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(r){case 3:t^=(e.charCodeAt(a+2)&255)<<16;case 2:t^=(e.charCodeAt(a+1)&255)<<8;case 1:t^=e.charCodeAt(a)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var jp={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},zp=/[A-Z]|^ms/g,Gp=/_EMO_([^_]+?)_([^]*?)_EMO_/g,lc=function(t){return t.charCodeAt(1)===45},cc=functioLine truncated
|
|
|
|
|
*/var Bu;function Px(){if(Bu)return rt;Bu=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,s=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,i=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,u=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,g=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,p=t?Symbol.for("react.block"):60121,y=t?Symbol.for("react.fundamental"):60117,b=t?Symbol.for("react.responder"):60118,S=t?Symbol.for("react.scope"):60119;function x(k){if(typeof k=="object"&&k!==null){var C=k.$$typeof;switch(C){case e:switch(k=k.type,k){case l:case c:case r:case o:case s:case u:return k;default:switch(k=k&&k.$$typeof,k){case a:case d:case m:case g:case i:return k;default:return C}}case n:return C}}}function E(k){return x(k)===c}return rt.AsyncMode=l,rt.ConcurrentMode=c,rt.ContextConsumer=a,rt.ContextProvider=i,rt.Element=e,rt.ForwardRef=d,rt.Fragment=r,rt.Lazy=m,rt.Memo=g,rt.Portal=n,rt.Profiler=o,rt.StrictMode=s,rt.Suspense=u,rt.isAsyncMode=function(k){return E(k)||x(k)===l},rt.isConcurrentMode=E,rt.isContextConsumer=function(k){return x(k)===a},rt.isContextProvider=function(k){return x(k)===i},rt.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===e},rt.isForwardRef=function(k){return x(k)===d},rt.isFragment=function(k){return x(k)===r},rt.isLazy=function(k){return x(k)===m},rt.isMemo=function(k){return x(k)===g},rt.isPortal=function(k){return x(k)===n},rt.isProfiler=function(k){return x(k)===o},rt.isStrictMode=function(k){return x(k)===s},rt.isSuspense=function(k){return x(k)===u},rt.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===c||k===o||k===s||k===u||k===f||typeof k=="object"&&k!==null&&(k.$$typeof===m||k.$$typeof===g||k.$$typeof===i||k.$$typeof===a||k.$$typeof===d||k.$$typeof===y||k.$$typeof===b||k.$$typeof===S||k.$$typeof===p)},rt.typeOf=x,rt}var ju;function $x(){return ju||(ju=1,gl.exports=Px()),gl.exports}var pl,Wu;function Fx(){if(Wu)return pl;Wu=1;var t=$x(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[t.ForwardRef]=r,o[t.Memo]=s;function i(m){return t.isMemo(m)?s:o[m.$$typeof]||e}var a=Object.defineProperty,l=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,u=Object.getPrototypeOf,f=Object.prototype;function g(m,p,y){if(typeof p!="string"){if(f){var b=u(p);b&&b!==f&&g(m,b,y)}var S=l(p);c&&(S=S.concat(c(p)));for(var x=i(m),E=i(p),k=0;k<S.length;++k){var C=S[k];if(!n[C]&&!(y&&y[C])&&!(E&&E[C])&&!(x&&x[C])){var N=d(p,C);try{a(m,C,N)}catch{}}}}return m}return pl=g,pl}Fx();var Vx=!0;function zx(t,e,n){var r="";return n.split(" ").forEach(function(s){t[s]!==void 0?e.push(t[s]+";"):s&&(r+=s+" ")}),r}var Gu=function(e,n,r){var s=e.key+"-"+n.name;(r===!1||Vx===!1)&&e.registered[s]===void 0&&(e.registered[s]=n.styles)},Hx=function(e,n,r){Gu(e,n,r);var s=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var o=n;do e.insert(n===o?"."+s:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function Ux(t){for(var e=0,n,r=0,s=t.length;s>=4;++r,s-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(s){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var Bx={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},jx=/[A-Z]|^ms/g,Wx=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Yu=function(e){return e.charCodeAt(1)===45},Xu=functioLine truncated
|
|
|
|
|
0%, 80%, 100% { opacity: 0; }
|
|
|
|
|
40% { opacity: 1; }
|
|
|
|
|
`]))),lm=function(t,n){var a=t.isFocused,r=t.size,o=t.theme,s=o.colors,i=o.spacing.baseUnit;return Ee({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},n?{}:{color:a?s.neutral60:s.neutral20,padding:i*2})},Ts=function(t){var n=t.delay,a=t.offset;return Se("span",{css:xs({animation:"".concat(im," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:a?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},cm=function(t){var n=t.innerProps,a=t.isRtl,r=t.size,o=r===void 0?4:r,s=sr(t,Rb);return Se("div",Me({},ct(Ee(Ee({},s),{},{innerProps:n,isRtl:a,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Se(Ts,{delay:0,offset:a}),Se(Ts,{delay:160,offset:!0}),Se(Ts,{delay:320,offset:!a}))},dm=function(t,n){var a=t.isDisabled,r=t.isFocused,o=t.theme,s=o.colors,i=o.borderRadius,l=o.spacing;return Ee({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:a?s.neutral5:s.neutral0,borderColor:a?s.neutral10:r?s.primary:s.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:r?s.primary:s.neutral30}})},um=function(t){var n=t.children,a=t.isDisabled,r=t.isFocused,o=t.innerRef,s=t.innerProps,i=t.menuIsOpen;return Se("div",Me({ref:o},ct(t,"control",{control:!0,"control--is-disabled":a,"control--is-focused":r,"control--menu-is-open":i}),s,{"aria-disabled":a||void 0}),n)},fm=um,gm=["data"],hm=function(t,n){var a=t.theme.spacing;return n?{}:{paddingBottom:a.baseUnit*2,paddingTop:a.baseUnit*2}},pm=function(t){var n=t.children,a=t.cx,r=t.getStyles,o=t.getClassNames,s=t.Heading,i=t.headingProps,l=t.innerProps,g=t.label,d=t.theme,u=t.selectProps;return Se("div",Me({},ct(t,"group",{group:!0}),l),Se(s,Me({},i,{selectProps:u,theme:d,getStyles:r,getClassNames:o,cx:a}),g),Se("div",null,n))},bm=function(t,n){var a=t.theme,r=a.colors,o=a.spacing;return Ee({label:"group",cursor:"default",display:"block"},n?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},mm=function(t){var n=Cc(t);n.data;var a=sr(n,gm);return Se("div",Me({},ct(t,"groupHeading",{"group-heading":!0}),a))},vm=pm,ym=["innerRef","isDisabled","isHidden","inputClassName"],xm=function(t,n){var a=t.isDisabled,r=t.value,o=t.theme,s=o.spacing,i=o.colors;return Ee(Ee({visibility:a?"hidden":"visible",transform:r?"translateZ(0)":""},wm),n?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:i.neutral80})},Pc={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},wm={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Ee({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Pc)},km=function(t){return Ee({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Pc)},Cm=function(t){var n=t.cx,a=t.value,r=Cc(t),o=r.innerRef,s=r.isDisabled,i=r.isHidden,l=r.inputClassName,g=sr(r,ym);return Se("div",Me({},ct(t,"input",{"input-container":!0}),{"data-value":a||""}),Se("input",Me({className:n({input:!0},l),ref:o,style:km(i),disabled:s},g)))},Sm=Cm,Em=function(t,n){var a=t.theme,r=a.spacing,o=a.borderRadius,s=a.colors;return Ee({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:s.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},Nm=function(t,n){var a=t.theme,r=a.borderRadius,o=a.colors,s=t.cropWithEllipsis;return Ee({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Tm=function(t,n){var a=t.theme,r=a.spacing,o=a.borderRadius,s=a.colors,i=t.isFocused;return Ee({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:i?s.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},$c=function(t){var n=t.children,a=t.innerProps;return Se("div",a,n)},Om=$c,Mm=$c;function Im(e){var t=e.children,n=e.innerProps;return Se("div",Me({role:"button"},n),t||Se(Ns,{size:14}))}var Am=function(t){var n=t.children,a=t.components,r=t.data,o=t.innerProps,s=t.isDisabled,i=t.removeProps,l=t.selectProps,g=a.Container,d=a.Label,u=a.Remove;return Se(g,{data:r,innerProps:Ee(Ee({},ct(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),o),selectProps:l},Se(d,{data:r,innerProps:Ee({},ct(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Se(u,{data:r,innerProps:Ee(Ee({},ct(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},i),s
Line truncated
|
|
|
|
|
`]))),c1=function(e,n){var r=e.isFocused,s=e.size,o=e.theme,i=o.colors,a=o.spacing.baseUnit;return Oe({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:s,lineHeight:1,marginRight:s,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?i.neutral60:i.neutral20,padding:a*2})},El=function(e){var n=e.delay,r=e.offset;return Ne("span",{css:vl({animation:"".concat(l1," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},d1=function(e){var n=e.innerProps,r=e.isRtl,s=e.size,o=s===void 0?4:s,i=On(e,e1);return Ne("div",De({},yt(Oe(Oe({},i),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),Ne(El,{delay:0,offset:r}),Ne(El,{delay:160,offset:!0}),Ne(El,{delay:320,offset:!r}))},u1=function(e,n){var r=e.isDisabled,s=e.isFocused,o=e.theme,i=o.colors,a=o.borderRadius,l=o.spacing;return Oe({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?i.neutral5:i.neutral0,borderColor:r?i.neutral10:s?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:s?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:s?i.primary:i.neutral30}})},f1=function(e){var n=e.children,r=e.isDisabled,s=e.isFocused,o=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return Ne("div",De({ref:o},yt(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":s,"control--menu-is-open":a}),i,{"aria-disabled":r||void 0}),n)},h1=f1,g1=["data"],p1=function(e,n){var r=e.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},m1=function(e){var n=e.children,r=e.cx,s=e.getStyles,o=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,c=e.label,d=e.theme,u=e.selectProps;return Ne("div",De({},yt(e,"group",{group:!0}),l),Ne(i,De({},a,{selectProps:u,theme:d,getStyles:s,getClassNames:o,cx:r}),c),Ne("div",null,n))},b1=function(e,n){var r=e.theme,s=r.colors,o=r.spacing;return Oe({label:"group",cursor:"default",display:"block"},n?{}:{color:s.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},y1=function(e){var n=lf(e);n.data;var r=On(n,g1);return Ne("div",De({},yt(e,"groupHeading",{"group-heading":!0}),r))},v1=m1,x1=["innerRef","isDisabled","isHidden","inputClassName"],w1=function(e,n){var r=e.isDisabled,s=e.value,o=e.theme,i=o.spacing,a=o.colors;return Oe(Oe({visibility:r?"hidden":"visible",transform:s?"translateZ(0)":""},k1),n?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},xf={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},k1={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Oe({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},xf)},C1=function(e){return Oe({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},xf)},S1=function(e){var n=e.cx,r=e.value,s=lf(e),o=s.innerRef,i=s.isDisabled,a=s.isHidden,l=s.inputClassName,c=On(s,x1);return Ne("div",De({},yt(e,"input",{"input-container":!0}),{"data-value":r||""}),Ne("input",De({className:n({input:!0},l),ref:o,style:C1(a),disabled:i},c)))},_1=S1,E1=function(e,n){var r=e.theme,s=r.spacing,o=r.borderRadius,i=r.colors;return Oe({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:i.neutral10,borderRadius:o/2,margin:s.baseUnit/2})},M1=function(e,n){var r=e.theme,s=r.borderRadius,o=r.colors,i=e.cropWithEllipsis;return Oe({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:s/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},N1=function(e,n){var r=e.theme,s=r.spacing,o=r.borderRadius,i=r.colors,a=e.isFocused;return Oe({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:s.baseUnit,paddingRight:s.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},wf=function(e){var n=e.children,r=e.innerProps;return Ne("div",r,n)},O1=wf,T1=wf;function A1(t){var e=t.children,n=t.innerProps;return Ne("div",De({role:"button"},n),e||Ne(_l,{size:14}))}var D1=function(e){var n=e.children,r=e.components,s=e.data,o=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,c=r.Container,d=r.Label,u=r.Remove;return Ne(c,{data:s,innerProps:Oe(Oe({},yt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),o),selectProps:l},Ne(d,{data:s,innerProps:Oe({},yt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),Ne(u,{data:s,innerProps:Oe(Oe({},yt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},a),s
Line truncated
|
|
|
|
|
px-4 py-2.5 bg-gray-100 dark:bg-gray-700
|
|
|
|
|
border-0 rounded-xl
|
|
|
|
|
text-gray-700 dark:text-gray-200 font-medium
|
|
|
|
@@ -229,27 +188,27 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
|
|
text-left cursor-pointer
|
|
|
|
|
disabled:opacity-50 disabled:cursor-not-allowed
|
|
|
|
|
min-w-[200px]
|
|
|
|
|
`,"aria-haspopup":"listbox","aria-expanded":f,children:[c.jsxs(_,{className:"flex items-center gap-2",children:[g,c.jsx(Z,{className:"truncate",children:N})]}),c.jsx(gr,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${f?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),f&&c.jsxs(_,{className:"absolute z-50 w-full mt-2 bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden min-w-[280px]",role:"listbox",children:[c.jsx(_,{className:"p-3 border-b border-gray-200 dark:border-gray-700",children:c.jsx("input",{id:T,type:"text",value:v,onChange:k,placeholder:r,className:"w-full px-3 py-2 bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:ring-2 focus:ring-blue-500 focus:border-transparent focus:outline-none"})}),c.jsxs(_,{className:"max-h-80 overflow-auto",children:[A&&c.jsx(_,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:i}),D&&c.jsx(_,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:s}),F&&c.jsx(_,{className:"py-2",children:S.map(M=>{const L=w(M.value);return c.jsxs(re,{type:"button",onClick:()=>!M.disabled&&y(M.value),disabled:M.disabled,className:`
|
|
|
|
|
`,"aria-haspopup":"listbox","aria-expanded":m,children:[h.jsxs(I,{className:"flex items-center gap-2",children:[c,h.jsx(Q,{className:"truncate",children:N})]}),h.jsx(Hn,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${m?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),m&&h.jsxs(I,{className:"absolute z-50 w-full mt-2 bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden min-w-[280px]",role:"listbox",children:[h.jsx(I,{className:"p-3 border-b border-gray-200 dark:border-gray-700",children:h.jsx("input",{id:E,type:"text",value:y,onChange:w,placeholder:s,className:"w-full px-3 py-2 bg-gray-50 dark:bg-gray-700 border border-gray-200 dark:border-gray-600 rounded-lg text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-gray-500 focus:ring-2 focus:ring-blue-500 focus:border-transparent focus:outline-none"})}),h.jsxs(I,{className:"max-h-80 overflow-auto",children:[L&&h.jsx(I,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:a}),$&&h.jsx(I,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:i}),F&&h.jsx(I,{className:"py-2",children:C.map(D=>{const A=O(D.value);return h.jsxs(oe,{type:"button",onClick:()=>!D.disabled&&M(D.value),disabled:D.disabled,className:`
|
|
|
|
|
w-full px-4 py-3 text-left
|
|
|
|
|
flex items-start gap-3
|
|
|
|
|
hover:bg-gray-100 dark:hover:bg-gray-700
|
|
|
|
|
transition-colors
|
|
|
|
|
${M.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
|
|
|
`,role:"option","aria-selected":L,children:[c.jsx(_,{className:"w-5 h-5 flex-shrink-0 mt-0.5",children:L&&c.jsx(gr,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),c.jsxs(_,{className:"flex-1 min-w-0",children:[c.jsx(_,{className:`font-medium ${L?"text-blue-600 dark:text-blue-400":"text-gray-900 dark:text-white"}`,children:M.label}),M.description&&c.jsx(_,{className:"text-sm text-gray-500 dark:text-gray-400 mt-0.5",children:M.description})]})]},M.value)})})]})]})]})},Un={container:{base:"tag-select",disabled:"opacity-50 cursor-not-allowed"},tag:"tag",tagRemove:"tag-remove",placeholder:"tag-select-placeholder"},Vv=({options:e=[],value:t=[],onChange:n,placeholder:a="No items selected",disabled:r=!1,className:o=""})=>{const s=b.useCallback(d=>e.find(f=>String(f.value)===String(d))?.label||String(d),[e]),i=b.useCallback(d=>{if(r)return;const u=t.filter(f=>String(f)!==String(d));n?.(u)},[t,n,r]),l=b.useMemo(()=>t.map(d=>({value:d,label:s(d)})),[t,s]),g=`${Un.container.base} ${r?Un.container.disabled:""} ${o}`.trim();return c.jsx(_,{className:g,children:l.length===0?c.jsx(Z,{className:Un.placeholder,children:a}):l.map(d=>c.jsxs(Z,{className:Un.tag,children:[d.label,!r&&c.jsx(Z,{className:Un.tagRemove,onClick:()=>i(d.value),role:"button","aria-label":`Remove ${d.label}`,children:c.jsx(gr,{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},d.value))})};function Hv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.useMemo(()=>a=>{t.forEach(r=>r(a))},t)}const qa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Rr(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Us(e){return"nodeType"in e}function Mt(e){var t,n;return e?Rr(e)?e:Us(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Vs(e){const{Document:t}=Mt(e);return e instanceof t}function Vn(e){return Rr(e)?!1:e instanceof Mt(e).HTMLElement}function pd(e){return e instanceof Mt(e).SVGElement}function en(e){return e?Rr(e)?e.document:Us(e)?Vs(e)?e:Vn(e)||pd(e)?e.ownerDocument:document:document:document}const Qt=qa?b.useLayoutEffect:b.useEffect;function Ka(e){const t=b.useRef(e);return Qt(()=>{t.current=e}),b.useCallback(function(){for(var n=arguments.length,a=new Array(n),r=0;r<n;r++)a[r]=arguments[r];return t.current==null?void 0:t.current(...a)},[])}function jv(){const e=b.useRef(null),t=b.useCallback((a,r)=>{e.current=setInterval(a,r)},[]),n=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Hn(e,t){t===void 0&&(t=[e]);const n=b.useRef(e);return Qt(()=>{n.current!==e&&(n.current=e)},t),n}function jn(e,t){const n=b.useRef();return b.useMemo(()=>{const a=e(n.current);return n.current=a,a},[...t])}function Xa(e){const t=Ka(e),n=b.useRef(null),a=b.useCallback(r=>{r!==n.current&&t?.(r,n.current),n.current=r},[]);return[n,a]}function Za(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let Hs={};function zn(e,t){return b.useMemo(()=>{if(t)return t;const n=Hs[e]==null?0:Hs[e]+1;return Hs[e]=n,e+"-"+n},[e,t])}function bd(e){return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),r=1;r<n;r++)a[r-1]=arguments[r];return a.reduce((o,s)=>{const i=Object.entries(s);for(const[l,g]of i){const d=o[l];d!=null&&(o[l]=d+e*g)}return o},{...t})}}const tn=bd(1),Gn=bd(-1);function zv(e){return"clientX"in e&&"clientY"in e}function Qa(e){if(!e)return!1;const{KeyboardEvent:t}=Mt(e.target);return t&&e instanceof t}function Gv(e){if(!e)return!1;const{TouchEvent:t}=Mt(e.target);return t&&e instanceof t}function Ja(e){if(Gv(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return zv(e)?{x:e.clientX,y:e.clientY}:null}const dr=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[dr.Translate.toString(e),dr.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:a}=e;return t+" "+n+"ms "+a}}}),md="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Bv(e){return e.matches(md)?e:e.querySelector(md)}const Wv={display:"none"};function Yv(e){let{id:t,value:n}=e;return b.createElement("div",{id:t,style:Wv},n)}function qv(e){le
Line truncated
|
|
|
|
|
${D.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
|
|
|
`,role:"option","aria-selected":A,children:[h.jsx(I,{className:"w-5 h-5 flex-shrink-0 mt-0.5",children:A&&h.jsx(Hn,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),h.jsxs(I,{className:"flex-1 min-w-0",children:[h.jsx(I,{className:`font-medium ${A?"text-blue-600 dark:text-blue-400":"text-gray-900 dark:text-white"}`,children:D.label}),D.description&&h.jsx(I,{className:"text-sm text-gray-500 dark:text-gray-400 mt-0.5",children:D.description})]})]},D.value)})})]})]})]})},Vs={container:{base:"tag-select",disabled:"opacity-50 cursor-not-allowed"},tag:"tag",tagRemove:"tag-remove",placeholder:"tag-select-placeholder"},Hk=({options:t=[],value:e=[],onChange:n,placeholder:r="No items selected",disabled:s=!1,className:o="",id:i,editorAttrs:a})=>{const l=v.useCallback(f=>t.find(m=>String(m.value)===String(f))?.label||String(f),[t]),c=v.useCallback(f=>{if(s)return;const g=e.filter(m=>String(m)!==String(f));n?.(g)},[e,n,s]),d=v.useMemo(()=>e.map(f=>({value:f,label:l(f)})),[e,l]),u=`${Vs.container.base} ${s?Vs.container.disabled:""} ${o}`.trim();return h.jsx(I,{className:u,id:i,...a,children:d.length===0?h.jsx(Q,{className:Vs.placeholder,children:r}):d.map(f=>h.jsxs(Q,{className:Vs.tag,children:[f.label,!s&&h.jsx(Q,{className:Vs.tagRemove,onClick:()=>c(f.value),role:"button","aria-label":`Remove ${f.label}`,children:h.jsx(Hn,{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},f.value))})};function Uk(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>r=>{e.forEach(s=>s(r))},e)}const pi=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Yr(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function Fl(t){return"nodeType"in t}function Wt(t){var e,n;return t?Yr(t)?t:Fl(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}function Vl(t){const{Document:e}=Wt(t);return t instanceof e}function zs(t){return Yr(t)?!1:t instanceof Wt(t).HTMLElement}function eh(t){return t instanceof Wt(t).SVGElement}function Xr(t){return t?Yr(t)?t.document:Fl(t)?Vl(t)?t:zs(t)||eh(t)?t.ownerDocument:document:document:document}const wn=pi?v.useLayoutEffect:v.useEffect;function mi(t){const e=v.useRef(t);return wn(()=>{e.current=t}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.current==null?void 0:e.current(...r)},[])}function Bk(){const t=v.useRef(null),e=v.useCallback((r,s)=>{t.current=setInterval(r,s)},[]),n=v.useCallback(()=>{t.current!==null&&(clearInterval(t.current),t.current=null)},[]);return[e,n]}function Hs(t,e){e===void 0&&(e=[t]);const n=v.useRef(t);return wn(()=>{n.current!==t&&(n.current=t)},e),n}function Us(t,e){const n=v.useRef();return v.useMemo(()=>{const r=t(n.current);return n.current=r,r},[...e])}function bi(t){const e=mi(t),n=v.useRef(null),r=v.useCallback(s=>{s!==n.current&&e?.(s,n.current),n.current=s},[]);return[n,r]}function yi(t){const e=v.useRef();return v.useEffect(()=>{e.current=t},[t]),e.current}let zl={};function Bs(t,e){return v.useMemo(()=>{if(e)return e;const n=zl[t]==null?0:zl[t]+1;return zl[t]=n,t+"-"+n},[t,e])}function th(t){return function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((o,i)=>{const a=Object.entries(i);for(const[l,c]of a){const d=o[l];d!=null&&(o[l]=d+t*c)}return o},{...e})}}const Kr=th(1),js=th(-1);function jk(t){return"clientX"in t&&"clientY"in t}function vi(t){if(!t)return!1;const{KeyboardEvent:e}=Wt(t.target);return e&&t instanceof e}function Wk(t){if(!t)return!1;const{TouchEvent:e}=Wt(t.target);return e&&t instanceof e}function xi(t){if(Wk(t)){if(t.touches&&t.touches.length){const{clientX:e,clientY:n}=t.touches[0];return{x:e,y:n}}else if(t.changedTouches&&t.changedTouches.length){const{clientX:e,clientY:n}=t.changedTouches[0];return{x:e,y:n}}}return jk(t)?{x:t.clientX,y:t.clientY}:null}const In=Object.freeze({Translate:{toString(t){if(!t)return;const{x:e,y:n}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;const{scaleX:e,scaleY:n}=t;return"scaleX("+e+") scaleY("+n+")"}},Transform:{toString(t){if(t)return[In.Translate.toString(t),In.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:n,easing:r}=t;return e+" "+n+"ms "+r}}}),nh="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Gk(t){return t.matches(nh)?t:t.querySelector(nh)}const Yk={display:"none"};function Xk(t){let{id:e,value:n}=t;return v.createElement("div",{id:e,s
Line truncated
|
|
|
|
|
To pick up a draggable item, press the space bar.
|
|
|
|
|
While dragging, use the arrow keys to move the item.
|
|
|
|
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
|
|
|
`},Jv={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Rv(e){let{announcements:t=Jv,container:n,hiddenTextDescribedById:a,screenReaderInstructions:r=Qv}=e;const{announce:o,announcement:s}=Kv(),i=zn("DndLiveRegion"),[l,g]=b.useState(!1);if(b.useEffect(()=>{g(!0)},[]),Xv(b.useMemo(()=>({onDragStart(u){let{active:f}=u;o(t.onDragStart({active:f}))},onDragMove(u){let{active:f,over:h}=u;t.onDragMove&&o(t.onDragMove({active:f,over:h}))},onDragOver(u){let{active:f,over:h}=u;o(t.onDragOver({active:f,over:h}))},onDragEnd(u){let{active:f,over:h}=u;o(t.onDragEnd({active:f,over:h}))},onDragCancel(u){let{active:f,over:h}=u;o(t.onDragCancel({active:f,over:h}))}}),[o,t])),!l)return null;const d=b.createElement(b.Fragment,null,b.createElement(Yv,{id:a,value:r.draggable}),b.createElement(qv,{id:i,announcement:s}));return n?ar.createPortal(d,n):d}var ht;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(ht||(ht={}));function Ra(){}function rn(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function js(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.useMemo(()=>[...t].filter(a=>a!=null),[...t])}const Jt=Object.freeze({x:0,y:0});function yd(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ey(e,t){const n=Ja(e);if(!n)return"0 0";const a={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return a.x+"% "+a.y+"%"}function xd(e,t){let{data:{value:n}}=e,{data:{value:a}}=t;return n-a}function ty(e,t){let{data:{value:n}}=e,{data:{value:a}}=t;return a-n}function wd(e){let{left:t,top:n,height:a,width:r}=e;return[{x:t,y:n},{x:t+r,y:n},{x:t,y:n+a},{x:t+r,y:n+a}]}function kd(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Cd(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const zs=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:a}=e;const r=Cd(t,t.left,t.top),o=[];for(const s of a){const{id:i}=s,l=n.get(i);if(l){const g=yd(Cd(l),r);o.push({id:i,data:{droppableContainer:s,value:g}})}}return o.sort(xd)},ry=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:a}=e;const r=wd(t),o=[];for(const s of a){const{id:i}=s,l=n.get(i);if(l){const g=wd(l),d=r.reduce((f,h,v)=>f+yd(g[v],h),0),u=Number((d/4).toFixed(4));o.push({id:i,data:{droppableContainer:s,value:u}})}}return o.sort(xd)};function ny(e,t){const n=Math.max(t.top,e.top),a=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=r-a,i=o-n;if(a<r&&n<o){const l=t.width*t.height,g=e.width*e.height,d=s*i,u=d/(l+g-d);return Number(u.toFixed(4))}return 0}const ay=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:a}=e;const r=[];for(const o of a){const{id:s}=o,i=n.get(s);if(i){const l=ny(i,t);l>0&&r.push({id:s,data:{droppableContainer:o,value:l}})}}return r.sort(ty)};function oy(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Sd(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Jt}function sy(e){return function(n){for(var a=arguments.length,r=new Array(a>1?a-1:0),o=1;o<a;o++)r[o-1]=arguments[o];return r.reduce((s,i)=>({...s,top:s.top+e*i.y,bottom:s.bottom+e*i.y,left:s.left+e*i.x,right:s.right+e*i.x}),{...n})}}const iy=sy(1);function Ed(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function ly(e,t,n){const a=Ed(t);if(!a)return e;const{scaleX:r,scaleY:o,x:s,y:i}=a,l=e.left-s-(1-r)*parseFloat(n),g=e.top-i-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),d=r?e.width/r:e.width,u=o?e.height/o:e.height;return{width:d,height:u,top:g,right:l+d,bottom:g+u,left:l}}const cy={ignoreTransform:!1};function nn(e,t){t===void 0&&(t=cy);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:g,transformOrigin:d}=Mt(e).getComputedStyle(e);g&&(n=ly(n,g,d))}const{top:a,left:r,width:o,height:s,bottom:i,right:l}=n;return{top:a,left:r,width:o,height:s,bottom:i,right:l}}function Nd(e){return nn(e,{ignoreTransform:!0})}function dy(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function uy(e,t){return t===void 0&&(t=Mt(e).getComputedStyle(e)),t.posit
Line truncated
|
|
|
|
|
`},Rk={onDragStart(t){let{active:e}=t;return"Picked up draggable item "+e.id+"."},onDragOver(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was moved over droppable area "+n.id+".":"Draggable item "+e.id+" is no longer over a droppable area."},onDragEnd(t){let{active:e,over:n}=t;return n?"Draggable item "+e.id+" was dropped over droppable area "+n.id:"Draggable item "+e.id+" was dropped."},onDragCancel(t){let{active:e}=t;return"Dragging was cancelled. Draggable item "+e.id+" was dropped."}};function eC(t){let{announcements:e=Rk,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Jk}=t;const{announce:o,announcement:i}=qk(),a=Bs("DndLiveRegion"),[l,c]=v.useState(!1);if(v.useEffect(()=>{c(!0)},[]),Zk(v.useMemo(()=>({onDragStart(u){let{active:f}=u;o(e.onDragStart({active:f}))},onDragMove(u){let{active:f,over:g}=u;e.onDragMove&&o(e.onDragMove({active:f,over:g}))},onDragOver(u){let{active:f,over:g}=u;o(e.onDragOver({active:f,over:g}))},onDragEnd(u){let{active:f,over:g}=u;o(e.onDragEnd({active:f,over:g}))},onDragCancel(u){let{active:f,over:g}=u;o(e.onDragCancel({active:f,over:g}))}}),[o,e])),!l)return null;const d=v.createElement(v.Fragment,null,v.createElement(Xk,{id:r,value:s.draggable}),v.createElement(Kk,{id:a,announcement:i}));return n?Nn.createPortal(d,n):d}var St;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(St||(St={}));function wi(){}function qr(t,e){return v.useMemo(()=>({sensor:t,options:e??{}}),[t,e])}function Hl(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return v.useMemo(()=>[...e].filter(r=>r!=null),[...e])}const kn=Object.freeze({x:0,y:0});function sh(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function tC(t,e){const n=xi(t);if(!n)return"0 0";const r={x:(n.x-e.left)/e.width*100,y:(n.y-e.top)/e.height*100};return r.x+"% "+r.y+"%"}function oh(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return n-r}function nC(t,e){let{data:{value:n}}=t,{data:{value:r}}=e;return r-n}function ih(t){let{left:e,top:n,height:r,width:s}=t;return[{x:e,y:n},{x:e+s,y:n},{x:e,y:n+r},{x:e+s,y:n+r}]}function ah(t,e){if(!t||t.length===0)return null;const[n]=t;return n[e]}function lh(t,e,n){return e===void 0&&(e=t.left),n===void 0&&(n=t.top),{x:e+t.width*.5,y:n+t.height*.5}}const Ul=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=lh(e,e.left,e.top),o=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=sh(lh(l),s);o.push({id:a,data:{droppableContainer:i,value:c}})}}return o.sort(oh)},rC=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=ih(e),o=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const c=ih(l),d=s.reduce((f,g,m)=>f+sh(c[m],g),0),u=Number((d/4).toFixed(4));o.push({id:a,data:{droppableContainer:i,value:u}})}}return o.sort(oh)};function sC(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),s=Math.min(e.left+e.width,t.left+t.width),o=Math.min(e.top+e.height,t.top+t.height),i=s-r,a=o-n;if(r<s&&n<o){const l=e.width*e.height,c=t.width*t.height,d=i*a,u=d/(l+c-d);return Number(u.toFixed(4))}return 0}const oC=t=>{let{collisionRect:e,droppableRects:n,droppableContainers:r}=t;const s=[];for(const o of r){const{id:i}=o,a=n.get(i);if(a){const l=sC(a,e);l>0&&s.push({id:i,data:{droppableContainer:o,value:l}})}}return s.sort(nC)};function iC(t,e,n){return{...t,scaleX:e&&n?e.width/n.width:1,scaleY:e&&n?e.height/n.height:1}}function ch(t,e){return t&&e?{x:t.left-e.left,y:t.top-e.top}:kn}function aC(t){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];return s.reduce((i,a)=>({...i,top:i.top+t*a.y,bottom:i.bottom+t*a.y,left:i.left+t*a.x,right:i.right+t*a.x}),{...n})}}const lC=aC(1);function dh(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function cC(t,e,n){const r=dh(e);if(!r)return t;const{scaleX:s,scaleY:o,x:i,y:a}=r,l=t.left-i-(1-s)*parseFloat(n),c=t.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),d=s?t.width/s:t.width,u=o?t.height/o:t.height;return{width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}const dC={ignoreTransform:!1};function Zr(t,e){e===void 0&&(e=dC);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:c,transformOrigin:d}=Wt(t).getComputedStyle(t);c&&(n=cC(n,c,d))}const{top:r,left:s,width:o,height:i,bottom:a,right:l}=n;return{top:r,left:s,width:o,height:i,bottom:a,right:l}}function uh(t){return Zr(t,{ignoreTransform:!0})}function uC(t){const e=t.innerWidth,n=t.innerHeight;return{top:0,left:0,right:e,bottom:n,width:e,height:n}}function fC(t,e){return e===void 0&&(e=Wt(t).getComputedStyle(t)),e.posit
Line truncated
|
|
|
|
|
w-full flex items-center justify-between px-3 py-2
|
|
|
|
|
bg-white dark:bg-gray-800
|
|
|
|
|
border border-gray-300 dark:border-gray-600 rounded-lg
|
|
|
|
|
text-left text-sm
|
|
|
|
|
${i?"opacity-50 cursor-not-allowed":"hover:border-gray-400 dark:hover:border-gray-500"}
|
|
|
|
|
${a?"opacity-50 cursor-not-allowed":"hover:border-gray-400 dark:hover:border-gray-500"}
|
|
|
|
|
focus:outline-none focus:ring-2 focus:ring-blue-500
|
|
|
|
|
`,children:[c.jsx(_,{className:"flex items-center gap-2",children:v?c.jsxs(c.Fragment,{children:[c.jsx(ne,{name:v.faIcon,className:"w-4 h-4 text-gray-600 dark:text-gray-400"}),c.jsx(Z,{className:"text-gray-900 dark:text-white",children:v.label})]}):c.jsx(Z,{className:"text-gray-500 dark:text-gray-400",children:a})}),c.jsx(ne,{name:"chevron-down",className:`w-4 h-4 text-gray-400 dark:text-gray-500 transition-transform ${g?"rotate-180":""}`})]}),l&&c.jsx("input",{type:"hidden",name:l,value:e||""}),g&&c.jsxs(_,{className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg max-h-72 overflow-hidden",children:[c.jsx(_,{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:c.jsx(ft,{type:"text",value:u,onChange:m=>f(m.target.value),placeholder:r,className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-white",autoFocus:!0})}),c.jsx(_,{className:"max-h-56 overflow-y-auto",children:p.length>0?p.map(m=>c.jsxs(re,{type:"button",onClick:()=>x(m),className:`
|
|
|
|
|
`,children:[h.jsx(I,{className:"flex items-center gap-2",children:y?h.jsxs(h.Fragment,{children:[h.jsx(re,{name:y.faIcon,className:"w-4 h-4 text-gray-600 dark:text-gray-400"}),h.jsx(Q,{className:"text-gray-900 dark:text-white",children:y.label})]}):h.jsx(Q,{className:"text-gray-500 dark:text-gray-400",children:r})}),h.jsx(re,{name:"chevron-down",className:`w-4 h-4 text-gray-400 dark:text-gray-500 transition-transform ${u?"rotate-180":""}`})]}),l&&h.jsx("input",{type:"hidden",name:l,value:t||""}),u&&h.jsxs(I,{className:"absolute z-50 w-full mt-1 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg max-h-72 overflow-hidden",children:[h.jsx(I,{className:"p-2 border-b border-gray-200 dark:border-gray-700",children:h.jsx(wt,{type:"text",value:g,onChange:x=>m(x.target.value),placeholder:s,className:"w-full px-3 py-1.5 text-sm border border-gray-300 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-white",autoFocus:!0})}),h.jsx(I,{className:"max-h-56 overflow-y-auto",children:b.length>0?b.map(x=>h.jsxs(oe,{type:"button",onClick:()=>S(x),className:`
|
|
|
|
|
w-full flex items-center gap-3 px-3 py-2 text-left text-sm
|
|
|
|
|
${v?.faIcon===m.faIcon?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"}
|
|
|
|
|
`,children:[c.jsx(ne,{name:m.faIcon,className:"w-4 h-4"}),c.jsx(Z,{children:m.label}),v?.faIcon===m.faIcon&&c.jsx(ne,{name:"check",className:"w-4 h-4 ml-auto text-blue-600"})]},m.value)):c.jsx(_,{className:"px-3 py-4 text-sm text-gray-500 dark:text-gray-400 text-center",children:o})})]})]})},ti=({defaultOpen:e=!1,isOpen:t,onToggle:n,className:a="",style:r,children:o,disabled:s=!1})=>{const[i,l]=b.useState(e),g=t!==void 0,d=g?t:i,u=b.useRef(null),[f,h]=b.useState(e?void 0:0),v=()=>{if(s)return;const x=!d;g||l(x),n?.(x)};b.useEffect(()=>{if(u.current)if(d){h(u.current.scrollHeight);const x=setTimeout(()=>{h(void 0)},300);return()=>clearTimeout(x)}else h(u.current.scrollHeight),requestAnimationFrame(()=>{h(0)})},[d]);const p={};if(b.Children.forEach(o,x=>{if(b.isValidElement(x)){const m=x.props?.slot;m==="trigger"?p.trigger=x:m==="content"&&(p.content=x)}}),!p.trigger&&!p.content){const x=b.Children.toArray(o);x.length>=2?(p.trigger=x[0],p.content=x.slice(1)):x.length===1&&(p.content=x[0])}return c.jsxs(_,{className:`border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden ${a}`,style:r,children:[c.jsxs(re,{type:"button",onClick:v,disabled:s,className:`w-full flex items-center justify-between p-3 text-left bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${s?"opacity-50 cursor-not-allowed":""} ${d?"border-b border-gray-200 dark:border-gray-700":""}`,"aria-expanded":d,children:[c.jsx(_,{className:"flex-1",children:p.trigger}),!p.trigger&&c.jsx("svg",{className:`w-5 h-5 text-gray-500 dark:text-gray-400 transition-transform duration-200 ${d?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),c.jsx(_,{ref:u,className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:f!==void 0?`${f}px`:"auto"},children:c.jsx(_,{className:"bg-white dark:bg-gray-800",children:p.content})})]})},Jn=window.G7Core,du=Jn?.useControllableState,Ix=(e,t)=>window.G7Core?.t?.(e,t)??e,Ax={"":"common.scope_type_all_desc",self:"common.scope_type_self_desc",role:"common.scope_type_role_desc"},Lx=({options:e,value:t,onChange:n,disabled:a=!1})=>{const[r,o]=b.useState(!1),[s,i]=b.useState({}),l=b.useRef(null),g=e.find(u=>u.value===t)??e[0];b.useEffect(()=>{if(!r)return;const u=h=>{l.current&&!l.current.contains(h.target)&&o(!1)},f=()=>{if(!l.current)return;const h=l.current.getBoundingClientRect();i({position:"fixed",top:h.bottom+4,right:window.innerWidth-h.right,zIndex:9999})};return document.addEventListener("mousedown",u),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{document.removeEventListener("mousedown",u),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[r]);const d=b.useCallback(()=>{if(a||!l.current)return;const u=l.current.getBoundingClientRect();i({position:"fixed",top:u.bottom+4,right:window.innerWidth-u.right,zIndex:9999}),o(f=>!f)},[a]);return c.jsxs(_,{ref:l,className:"relative flex-shrink-0",children:[c.jsxs(_,{role:"button",tabIndex:0,onClick:u=>{u.stopPropagation(),u.preventDefault(),d()},onMouseDown:u=>u.stopPropagation(),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.stopPropagation(),u.preventDefault(),d()),u.key==="Escape"&&o(!1)},className:`flex items-center gap-1 text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 cursor-pointer select-none ${a?"opacity-50 cursor-not-allowed":"hover:border-blue-400 dark:hover:border-blue-500"}`,children:[c.jsx(Z,{children:g?.label??""}),c.jsx(ne,{name:de.ChevronDown,className:"w-3 h-3 text-gray-400 dark:text-gray-500"})]}),r&&c.jsx(_,{style:s,className:"w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1",children:e.map(u=>{const f=u.value??"",h=Ax[f],v=h?Ix(h):"",p=u.value===t;return c.jsxs(_,{role:"option","aria-selected":p,onClick:x=>{x.stopPropagation(),x.preventDefault(),n(u.value),o(!1)},onMouseDown:x=>x.stopPropagation(),className:`px-3 py-2 cursor-pointer transition-colors ${p?"bg-blue-50 dark:bg-blue-900/30":"hover:bg-gray-50 dark:hover:bg-gray-700/50"}`,children:[c.jsxs(_,{className:"flex items-center justify-between",children:[c.jsx(Z,{className:`text-xs font-medium ${p?"text-blue-700 dark:text-blue-300":"text-gray-900 dark:text-white"}`,children:u.label}),p&&c.jsx(ne,{name:de.Check,className:"w-3.5 h-3.5 text-blue-600 dark:text-blue-400"})]}),v&&c.jsx(Z,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:v})]},f||"__null__")})})]})},_x=(e,t)=>{if(e.length!==t.length)return!1;const n=[...e].sort((r,o)=>r.id-o.id),a=[...t].sort((r,o)=>r.id-o.id);return n.every((r,o)=>r.id===a[o].id&&r.scope_type===a[o].scope_type)},Dx=({data:e=[],value:t=[],onChange:n,scopeOptions:a=[],className:r="",disabled:o=!1,desktopColumns:s=2,installedModules:i=[],installedPl
Line truncated
|
|
|
|
|
${y?.faIcon===x.faIcon?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700"}
|
|
|
|
|
`,children:[h.jsx(re,{name:x.faIcon,className:"w-4 h-4"}),h.jsx(Q,{children:x.label}),y?.faIcon===x.faIcon&&h.jsx(re,{name:"check",className:"w-4 h-4 ml-auto text-blue-600"})]},x.value)):h.jsx(I,{className:"px-3 py-4 text-sm text-gray-500 dark:text-gray-400 text-center",children:o})})]})]})},ec=({defaultOpen:t=!1,isOpen:e,onToggle:n,className:r="",style:s,children:o,disabled:i=!1,id:a,editorAttrs:l})=>{const[c,d]=v.useState(t),u=e!==void 0,f=u?e:c,g=v.useRef(null),[m,p]=v.useState(t?void 0:0),y=()=>{if(i)return;const S=!f;u||d(S),n?.(S)};v.useEffect(()=>{if(g.current)if(f){p(g.current.scrollHeight);const S=setTimeout(()=>{p(void 0)},300);return()=>clearTimeout(S)}else p(g.current.scrollHeight),requestAnimationFrame(()=>{p(0)})},[f]);const b={};if(v.Children.forEach(o,S=>{if(v.isValidElement(S)){const x=S.props?.slot;x==="trigger"?b.trigger=S:x==="content"&&(b.content=S)}}),!b.trigger&&!b.content){const S=v.Children.toArray(o);S.length>=2?(b.trigger=S[0],b.content=S.slice(1)):S.length===1&&(b.content=S[0])}return h.jsxs(I,{className:`border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden ${r}`,style:s,id:a,...l,children:[h.jsxs(oe,{type:"button",onClick:y,disabled:i,className:`w-full flex items-center justify-between p-3 text-left bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${i?"opacity-50 cursor-not-allowed":""} ${f?"border-b border-gray-200 dark:border-gray-700":""}`,"aria-expanded":f,children:[h.jsx(I,{className:"flex-1",children:b.trigger}),!b.trigger&&h.jsx("svg",{className:`w-5 h-5 text-gray-500 dark:text-gray-400 transition-transform duration-200 ${f?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h.jsx(I,{ref:g,className:"overflow-hidden transition-all duration-300 ease-in-out",style:{height:m!==void 0?`${m}px`:"auto"},children:h.jsx(I,{className:"bg-white dark:bg-gray-800",children:b.content})})]})},Js=window.G7Core,qh=Js?.useControllableState,Zh=(t,e)=>window.G7Core?.t?.(t,e)??t,AS={"":"common.scope_type_all_desc",self:"common.scope_type_self_desc",role:"common.scope_type_role_desc"},DS=({options:t,value:e,onChange:n,disabled:r=!1})=>{const[s,o]=v.useState(!1),[i,a]=v.useState({}),l=v.useRef(null),c=t.find(u=>u.value===e)??t[0];v.useEffect(()=>{if(!s)return;const u=g=>{l.current&&!l.current.contains(g.target)&&o(!1)},f=()=>{if(!l.current)return;const g=l.current.getBoundingClientRect();a({position:"fixed",top:g.bottom+4,right:window.innerWidth-g.right,zIndex:9999})};return document.addEventListener("mousedown",u),window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{document.removeEventListener("mousedown",u),window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[s]);const d=v.useCallback(()=>{if(r||!l.current)return;const u=l.current.getBoundingClientRect();a({position:"fixed",top:u.bottom+4,right:window.innerWidth-u.right,zIndex:9999}),o(f=>!f)},[r]);return h.jsxs(I,{ref:l,className:"relative flex-shrink-0",children:[h.jsxs(I,{role:"button",tabIndex:0,onClick:u=>{u.stopPropagation(),u.preventDefault(),d()},onMouseDown:u=>u.stopPropagation(),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&(u.stopPropagation(),u.preventDefault(),d()),u.key==="Escape"&&o(!1)},className:`flex items-center gap-1 text-xs px-2 py-1 rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 cursor-pointer select-none ${r?"opacity-50 cursor-not-allowed":"hover:border-blue-400 dark:hover:border-blue-500"}`,children:[h.jsx(Q,{children:c?.label??""}),h.jsx(re,{name:de.ChevronDown,className:"w-3 h-3 text-gray-400 dark:text-gray-500"})]}),s&&h.jsx(I,{style:i,className:"w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg py-1",children:t.map(u=>{const f=u.value??"",g=AS[f],m=g?Zh(g):"",p=u.value===e;return h.jsxs(I,{role:"option","aria-selected":p,onClick:y=>{y.stopPropagation(),y.preventDefault(),n(u.value),o(!1)},onMouseDown:y=>y.stopPropagation(),className:`px-3 py-2 cursor-pointer transition-colors ${p?"bg-blue-50 dark:bg-blue-900/30":"hover:bg-gray-50 dark:hover:bg-gray-700/50"}`,children:[h.jsxs(I,{className:"flex items-center justify-between",children:[h.jsx(Q,{className:`text-xs font-medium ${p?"text-blue-700 dark:text-blue-300":"text-gray-900 dark:text-white"}`,children:u.label}),p&&h.jsx(re,{name:de.Check,className:"w-3.5 h-3.5 text-blue-600 dark:text-blue-400"})]}),m&&h.jsx(Q,{className:"block text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:m})]},f||"__null__")})})]})},IS=(t,e)=>{if(t.length!==e.length)return!1;const n=[...t].sort((s,o)=>s.id-o.id),r=[...e].sort((s,o)=>s.id-o.id);return n.every((s,o)=>s.id===r[o].id&&s.scope_type===r[o].scope_type)},LS=({data:t=[],value:e=[],onChange:n,scopeOptions:r=[],className:s="",disabled:o=!1,desktopColumns:i=2,inst
Line truncated
|
|
|
|
|
let scriptImported = false
|
|
|
|
|
self.addEventListener('message', async (e) => {
|
|
|
|
|
const { file, id, imageCompressionLibUrl, options } = e.data
|
|
|
|
@@ -268,40 +227,57 @@ self.addEventListener('message', async (e) => {
|
|
|
|
|
self.postMessage({ error: e.message + '\\n' + e.stack, id })
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
`;let Li;function Q1(e,t){return new Promise(((n,a)=>{Li||(Li=(function(s){const i=[];return i.push(s),URL.createObjectURL(new Blob(i))})(Z1));const r=new Worker(Li);r.addEventListener("message",(function(s){if(t.signal&&t.signal.aborted)r.terminate();else if(s.data.progress===void 0){if(s.data.error)return a(new Error(s.data.error)),void r.terminate();n(s.data.file),r.terminate()}else t.onProgress(s.data.progress)})),r.addEventListener("error",a),t.signal&&t.signal.addEventListener("abort",(()=>{a(t.signal.reason),r.terminate()})),r.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})}))}function Nt(e,t){return new Promise((function(n,a){let r,o,s,i,l,g;if(r={...t},s=0,{onProgress:i}=r,r.maxSizeMB=r.maxSizeMB||Number.POSITIVE_INFINITY,l=typeof r.useWebWorker!="boolean"||r.useWebWorker,delete r.useWebWorker,r.onProgress=h=>{s=h,typeof i=="function"&&i(s)},!(e instanceof Blob||e instanceof X1))return a(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return a(new Error("The file given is not an image"));if(g=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!l||typeof Worker!="function"||g)return Df(e,r).then(function(h){try{return o=h,f.call(this)}catch(v){return a(v)}}.bind(this),a);var d=function(){try{return f.call(this)}catch(h){return a(h)}}.bind(this),u=function(h){try{return Df(e,r).then((function(v){try{return o=v,d()}catch(p){return a(p)}}),a)}catch(v){return a(v)}};try{return r.libURL=r.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",Q1(e,r).then((function(h){try{return o=h,d()}catch{return u()}}),u)}catch{u()}function f(){try{o.name=e.name,o.lastModified=e.lastModified}catch{}try{r.preserveExif&&e.type==="image/jpeg"&&(!r.fileType||r.fileType&&r.fileType===e.type)&&(o=Cf(e,o))}catch{}return n(o)}}))}Nt.getDataUrlFromFile=Tf,Nt.getFilefromDataUrl=Ai,Nt.loadImage=Of,Nt.drawImageInCanvas=If,Nt.drawFileInCanvas=So,Nt.canvasToFile=Eo,Nt.getExifOrientation=Af,Nt.handleMaxWidthOrHeight=Lf,Nt.followExifOrientation=_f,Nt.cleanupCanvasMemory=ur,Nt.isAutoOrientationInBrowser=hn,Nt.approximateBelowMaximumCanvasSizeOfBrowser=Mf,Nt.copyExifWithoutOrientation=Cf,Nt.getBrowserName=$r,Nt.version="2.0.2";const J1=window.G7Core,_i=e=>{const t=["B","KB","MB","GB"];let n=0,a=e;for(;a>=1024&&n<t.length-1;)a/=1024,n++;return`${a.toFixed(2)} ${t[n]}`},R1=e=>{if(e&&typeof e=="object"){const t=e;if(t.response?.data?.message)return t.response.data.message;if(t.response?.data?.errors){const n=Object.values(t.response.data.errors)[0];if(Array.isArray(n)&&n[0])return n[0]}if(t.message)return t.message}return e instanceof Error?e.message:"업로드 실패"},ek=e=>e?e.startsWith("image/")?"fa-file-image":e.startsWith("video/")?"fa-file-video":e.startsWith("audio/")?"fa-file-audio":e==="application/pdf"?"fa-file-pdf":e.includes("word")||e.includes("document")?"fa-file-word":e.includes("excel")||e.includes("spreadsheet")?"fa-file-excel":e.includes("zip")||e.includes("compressed")?"fa-file-zipper":"fa-file":"fa-file",wt=(e,t)=>J1?.t?.(e,t)??e,Pf=window.G7Core?.createLogger?.("Comp:FileUploader")??{log:(...e)=>console.log("[Comp:FileUploader]",...e),warn:(...e)=>console.warn("[Comp:FileUploader]",...e),error:(...e)=>console.error("[Comp:FileUploader]",...e)},Fr=window.G7Core;function tk(e){const{attachmentableType:t,attachmentableId:n,collection:a,maxFiles:r,maxSize:o,maxConcurrentUploads:s,accept:i,imageCompression:l,roleIds:g,autoUpload:d,initialFiles:u,endpoints:f,onFilesChange:h,onUploadComplete:v,onUploadError:p,onRemove:x,onReorder:m,uploadTriggerEvent:T,confirmBeforeRemove:C,uploadParams:S}=e,[N,E]=b.useState(u),[k,y]=b.useState([]),[w,A]=b.useState(!1),D=b.useRef(null),F=b.useRef(0),M=b.useRef(new Set),L=b.useRef(new Map),[U,O]=b.useState(!1),[I,H]=b.useState(null),[$,z]=b.useState(!1),G=b.useRef(!1),[j,W]=b.useState([]),[B,V]=b.useState(!1),[Y,R]=b.useState(0),ae=b.useRef(0),[ee,X]=b.useState(new Map),oe=b.useRef(new Map),se=b.useRef(h);se.current=h,b.useEffect(()=>{se.current?.(k)},[k]),b.useEffect(()=>{if(G.current)return;const J=u.filter(xe=>!M.current.has(xe.id)&&(!xe.hash||!M.current.has(xe.hash))),be=new Set(J.map(xe=>xe.id)),he=Array.from(L.current.values()).filter(xe=>!be.has(xe.id)&&!M.current.has(xe.id));E([...J,...he])},[u]);const pe=b.useCallback(async J=>{const be={maxSizeMB:l?.maxSizeMB??1,maxWidthOrHeight:l?.maxWidthOrHeight??1920,useWebWorker:!0};return await Nt(J,be)},[l]),we=b.useCallback(async J=>{const be=N.length+k.length,he=r-be,xe=Array.from(J).slice(0,he);for(const ue of xe){if(ue.size>o*1024*1024){p?.(`[${ue.name}] 파일 크기(${_i(ue.size)})가 최대 허용 크기(${o}MB)를 초과합니다.`,ue);continue}if(i){const Ce="."+ue.name.split(".").pop()?.toLowerCase();if(!i.split(",").map(Oe=>Oe.trim().toLowerCase()).includes(Ce)){p?.(`[${ue.name}] 허용되지 않는 파일 형식입니다. (허용: ${i})`,ue);continue}}const Pe={id:`pendinLine truncated
|
|
|
|
|
`;let Tc;function Q2(t,e){return new Promise(((n,r)=>{Tc||(Tc=(function(i){const a=[];return a.push(i),URL.createObjectURL(new Blob(a))})(Z2));const s=new Worker(Tc);s.addEventListener("message",(function(i){if(e.signal&&e.signal.aborted)s.terminate();else if(i.data.progress===void 0){if(i.data.error)return r(new Error(i.data.error)),void s.terminate();n(i.data.file),s.terminate()}else e.onProgress(i.data.progress)})),s.addEventListener("error",r),e.signal&&e.signal.addEventListener("abort",(()=>{r(e.signal.reason),s.terminate()})),s.postMessage({file:t,imageCompressionLibUrl:e.libURL,options:{...e,onProgress:void 0,signal:void 0}})}))}function zt(t,e){return new Promise((function(n,r){let s,o,i,a,l,c;if(s={...e},i=0,{onProgress:a}=s,s.maxSizeMB=s.maxSizeMB||Number.POSITIVE_INFINITY,l=typeof s.useWebWorker!="boolean"||s.useWebWorker,delete s.useWebWorker,s.onProgress=g=>{i=g,typeof a=="function"&&a(i)},!(t instanceof Blob||t instanceof q2))return r(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(t.type))return r(new Error("The file given is not an image"));if(c=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!l||typeof Worker!="function"||c)return vp(t,s).then(function(g){try{return o=g,f.call(this)}catch(m){return r(m)}}.bind(this),r);var d=function(){try{return f.call(this)}catch(g){return r(g)}}.bind(this),u=function(g){try{return vp(t,s).then((function(m){try{return o=m,d()}catch(p){return r(p)}}),r)}catch(m){return r(m)}};try{return s.libURL=s.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",Q2(t,s).then((function(g){try{return o=g,d()}catch{return u()}}),u)}catch{u()}function f(){try{o.name=t.name,o.lastModified=t.lastModified}catch{}try{s.preserveExif&&t.type==="image/jpeg"&&(!s.fileType||s.fileType&&s.fileType===t.type)&&(o=lp(t,o))}catch{}return n(o)}}))}zt.getDataUrlFromFile=fp,zt.getFilefromDataUrl=Oc,zt.loadImage=hp,zt.drawImageInCanvas=pp,zt.drawFileInCanvas=Yi,zt.canvasToFile=Xi,zt.getExifOrientation=mp,zt.handleMaxWidthOrHeight=bp,zt.followExifOrientation=yp,zt.cleanupCanvasMemory=Ln,zt.isAutoOrientationInBrowser=is,zt.approximateBelowMaximumCanvasSizeOfBrowser=gp,zt.copyExifWithoutOrientation=lp,zt.getBrowserName=wr,zt.version="2.0.2";const J2=window.G7Core,Ac=t=>{const e=["B","KB","MB","GB"];let n=0,r=t;for(;r>=1024&&n<e.length-1;)r/=1024,n++;return`${r.toFixed(2)} ${e[n]}`},R2=t=>{if(t&&typeof t=="object"){const e=t;if(e.response?.data?.message)return e.response.data.message;if(e.response?.data?.errors){const n=Object.values(e.response.data.errors)[0];if(Array.isArray(n)&&n[0])return n[0]}if(e.message)return e.message}return t instanceof Error?t.message:"업로드 실패"},eE=t=>t?t.startsWith("image/")?"fa-file-image":t.startsWith("video/")?"fa-file-video":t.startsWith("audio/")?"fa-file-audio":t==="application/pdf"?"fa-file-pdf":t.includes("word")||t.includes("document")?"fa-file-word":t.includes("excel")||t.includes("spreadsheet")?"fa-file-excel":t.includes("zip")||t.includes("compressed")?"fa-file-zipper":"fa-file":"fa-file",At=(t,e)=>J2?.t?.(t,e)??t,xp=window.G7Core?.createLogger?.("Comp:FileUploader")??{log:(...t)=>console.log("[Comp:FileUploader]",...t),warn:(...t)=>console.warn("[Comp:FileUploader]",...t),error:(...t)=>console.error("[Comp:FileUploader]",...t)},kr=window.G7Core;function tE(t){const{attachmentableType:e,attachmentableId:n,collection:r,maxFiles:s,maxSize:o,maxConcurrentUploads:i,accept:a,imageCompression:l,roleIds:c,autoUpload:d,initialFiles:u,endpoints:f,onFilesChange:g,onUploadComplete:m,onUploadError:p,onRemove:y,onReorder:b,uploadTriggerEvent:S,confirmBeforeRemove:x,uploadParams:E}=t,[k,C]=v.useState(u),[N,_]=v.useState([]),[w,M]=v.useState(!1),O=v.useRef(null),L=v.useRef(0),$=v.useRef(new Set),F=v.useRef(new Map),D=v.useRef(null),[A,T]=v.useState(!1),[V,H]=v.useState(null),[W,j]=v.useState(!1),U=v.useRef(!1),[B,G]=v.useState([]),[z,K]=v.useState(!1),[X,Z]=v.useState(0),ee=v.useRef(0),[ne,he]=v.useState(new Map),J=v.useRef(new Map),ce=v.useRef(g);ce.current=g,v.useEffect(()=>{ce.current?.(N)},[N]),v.useEffect(()=>{if(U.current)return;const te=u.filter(me=>!$.current.has(me.id)&&(!me.hash||!$.current.has(me.hash))),ge=new Set(te.map(me=>me.id)),pe=Array.from(F.current.values()).filter(me=>!ge.has(me.id)&&!$.current.has(me.id));C([...te,...pe])},[u]);const ue=v.useCallback(async te=>{const ge={maxSizeMB:l?.maxSizeMB??1,maxWidthOrHeight:l?.maxWidthOrHeight??1920,useWebWorker:!0};return await zt(te,ge)},[l]),ie=v.useCallback(async te=>{const ge=k.length+N.length,pe=Math.max(0,s-ge),me=Array.from(te).slice(0,pe);if(te.length>pe){const be=Array.from(te).slice(pe),Ue=At("attachment.upload_limit_exceeded",{max:s});p?.(Ue,be[0]??te[0])}for(const be of me){if(be.size>o*1024*1024){p?.(`[${be.name}] 파일 크기(${Ac(be.size)})가 최대 허용 크기(${o}MB)를 초과합니다.`,be);continue}if(a){const Me="."+be.name.split(".").pop()?.toLowerCase();if(!a.split(",").m
Line truncated
|
|
|
|
|
relative border-2 border-dashed rounded-lg transition-colors
|
|
|
|
|
${l?"opacity-60 cursor-not-allowed":""}
|
|
|
|
|
${e&&!l?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600"}
|
|
|
|
|
`,onDragOver:u=>{u.preventDefault(),d&&a(!0)},onDragLeave:()=>a(!1),onDrop:u=>{u.preventDefault(),a(!1),d&&n(u.dataTransfer.files)},children:[c.jsx("input",{ref:r,type:"file",multiple:!0,accept:o,onChange:u=>u.target.files&&!l&&n(u.target.files),className:"hidden",disabled:l}),!g&&c.jsxs(_,{className:`p-8 text-center transition-colors ${l?"cursor-not-allowed":"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50"}`,onClick:()=>!l&&r.current?.click(),children:[c.jsx(lt,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),c.jsx(ut,{className:"text-sm text-gray-600 dark:text-gray-400",children:wt("attachment.drop_or_click")}),c.jsxs(ut,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[wt("attachment.upload_limit",{maxFiles:s,maxSize:i}),o&&` (${o})`]})]}),g]})},nk=window.G7Core,ak=window.G7Core?.createLogger?.("Comp:SortableThumbnail")??{log:(...e)=>console.log("[Comp:SortableThumbnail]",...e),warn:(...e)=>console.warn("[Comp:SortableThumbnail]",...e),error:(...e)=>console.error("[Comp:SortableThumbnail]",...e)},ok=({file:e,onRemove:t,onRetry:n,onImageClick:a,onDownload:r,isPrimary:o,onPrimaryClick:s,disabled:i})=>{const{attributes:l,listeners:g,setNodeRef:d,transform:u,transition:f,isDragging:h}=co({id:"hash"in e?e.hash:e.id}),v={transform:dr.Transform.toString(u),transition:f,opacity:h?.5:1},p="status"in e&&e.status!==void 0,x=p?e.status:"done",m=x==="uploading",T=x==="compressing",C=x==="error",S=p?e.progress:100,N=p?e.preview:void 0,E=p?e.mime_type?.startsWith("image/")??!1:e.is_image,[k,y]=b.useState(void 0),w=!p&&E?e.download_url:void 0;b.useEffect(()=>{if(!w){y(void 0);return}let D=!0,F;return(async()=>{try{const L=await nk.api.get(w,{responseType:"blob"});D&&L&&(F=URL.createObjectURL(L),y(F))}catch(L){ak.error("Failed to load authenticated image:",L)}})(),()=>{D=!1,F&&URL.revokeObjectURL(F)}},[w]);const A=k;return c.jsxs(_,{ref:d,style:v,className:"relative group bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[c.jsxs(_,{className:`aspect-square w-full flex items-center justify-center bg-gray-50 dark:bg-gray-900 relative ${E||!p?"cursor-pointer":""}`,onClick:()=>{m||T||(E&&a?a():!p&&r&&r())},children:[N||A?c.jsx(or,{src:N||A,alt:e.original_filename,className:"w-full h-full object-cover"}):c.jsx(lt,{className:`fa-solid ${ek(e.mime_type)} text-4xl text-gray-400 dark:text-gray-500`}),(m||T)&&c.jsxs(_,{className:"absolute inset-0 bg-black/50 flex flex-col items-center justify-center",children:[c.jsx(_,{className:"w-3/4 h-2 bg-gray-700 rounded-full overflow-hidden",children:c.jsx(_,{className:"h-full bg-blue-500 transition-all",style:{width:`${S}%`}})}),c.jsxs(Z,{className:"text-white text-xs mt-1",children:[S,"%"]})]}),C&&c.jsx(_,{className:"absolute inset-0 bg-red-500/50 flex items-center justify-center",children:c.jsx(lt,{className:"fa-solid fa-exclamation-triangle text-2xl text-white"})}),s&&c.jsx(re,{type:"button",onClick:D=>{D.stopPropagation(),s()},className:`absolute top-1.5 left-1.5 z-10 p-1 rounded-full transition-colors ${o?"bg-yellow-500 text-white":"bg-gray-800/50 text-gray-300 hover:bg-yellow-500 hover:text-white opacity-0 group-hover:opacity-100"}`,title:wt(o?"attachment.primary_image":"attachment.set_as_primary"),children:c.jsx(lt,{className:"fa-solid fa-star text-xs"})}),c.jsxs(_,{className:`absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-colors flex items-start justify-end p-1 gap-1 opacity-0 group-hover:opacity-100 ${i?"hidden":""}`,children:[c.jsx(re,{type:"button",...l,...g,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-gray-600 dark:text-gray-300 hover:bg-white cursor-grab active:cursor-grabbing",title:wt("attachment.drag_to_reorder"),onClick:D=>D.stopPropagation(),children:c.jsx(lt,{className:"fa-solid fa-grip-vertical text-sm"})}),!p&&r&&c.jsx(re,{type:"button",onClick:D=>{D.stopPropagation(),r()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-blue-500 hover:bg-white",title:wt("common.download"),children:c.jsx(lt,{className:"fa-solid fa-download text-sm"})}),C&&n&&c.jsx(re,{type:"button",onClick:D=>{D.stopPropagation(),n()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-orange-500 hover:bg-white",title:wt("common.retry"),children:c.jsx(lt,{className:"fa-solid fa-arrow-rotate-right text-sm"})}),c.jsx(re,{type:"button",onClick:D=>{D.stopPropagation(),t()},disabled:m||T,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-red-500 hover:bg-white disabled:opacity-50",title:wt("common.delete"),children:c.jsx(lt,{className:"fa-solid fa-times text-sm"})})]})]}),c.jsxs(_,{className:`p-2 ${!p&&r?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,onClick:()=>{!p&&r&&r()},children:[c.jsx(ut,{className:"text-xs font-medium text-gray-900 dark:text-white truncate",title:e.original_filename,children:e.original_filename}),c.jsx(ut,{className:"text-xs text-gray-500 dark:text-gray-400",children:e.siz
Line truncated
|
|
|
|
|
${v.radio}
|
|
|
|
|
${t&&!l?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600"}
|
|
|
|
|
`,onDragOver:u=>{u.preventDefault(),d&&r(!0)},onDragLeave:()=>r(!1),onDrop:u=>{u.preventDefault(),r(!1),d&&n(u.dataTransfer.files)},children:[h.jsx("input",{ref:s,type:"file",multiple:!0,accept:o,onChange:u=>u.target.files&&!l&&n(u.target.files),className:"hidden",disabled:l}),!c&&h.jsxs(I,{className:`p-8 text-center transition-colors ${l?"cursor-not-allowed":"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50"}`,onClick:()=>!l&&s.current?.click(),children:[h.jsx(pt,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),h.jsx(bt,{className:"text-sm text-gray-600 dark:text-gray-400",children:At("attachment.drop_or_click")}),h.jsxs(bt,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[At("attachment.upload_limit",{maxFiles:i,maxSize:a}),o&&` (${o})`]})]}),c]})},rE=window.G7Core,sE=window.G7Core?.createLogger?.("Comp:SortableThumbnail")??{log:(...t)=>console.log("[Comp:SortableThumbnail]",...t),warn:(...t)=>console.warn("[Comp:SortableThumbnail]",...t),error:(...t)=>console.error("[Comp:SortableThumbnail]",...t)},oE=({file:t,onRemove:e,onRetry:n,onImageClick:r,onDownload:s,isPrimary:o,onPrimaryClick:i,disabled:a})=>{const{attributes:l,listeners:c,setNodeRef:d,transform:u,transition:f,isDragging:g}=Ai({id:"hash"in t?t.hash:t.id}),m={transform:In.Transform.toString(u),transition:f,opacity:g?.5:1},p="status"in t&&t.status!==void 0,y=p?t.status:"done",b=y==="uploading",S=y==="compressing",x=y==="error",E=p?t.progress:100,k=p?t.preview:void 0,C=p?t.mime_type?.startsWith("image/")??!1:t.is_image,[N,_]=v.useState(void 0),w=!p&&C?t.download_url:void 0;v.useEffect(()=>{if(!w){_(void 0);return}let O=!0,L;return(async()=>{try{const F=await rE.api.get(w,{responseType:"blob"});O&&F&&(L=URL.createObjectURL(F),_(L))}catch(F){sE.error("Failed to load authenticated image:",F)}})(),()=>{O=!1,L&&URL.revokeObjectURL(L)}},[w]);const M=N;return h.jsxs(I,{ref:d,style:m,className:"relative group bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[h.jsxs(I,{className:`aspect-square w-full flex items-center justify-center bg-gray-50 dark:bg-gray-900 relative ${C||!p?"cursor-pointer":""}`,onClick:()=>{b||S||(C&&r?r():!p&&s&&s())},children:[k||M?h.jsx(yn,{src:k||M,alt:t.original_filename,className:"w-full h-full object-cover"}):h.jsx(pt,{className:`fa-solid ${eE(t.mime_type)} text-4xl text-gray-400 dark:text-gray-500`}),(b||S)&&h.jsxs(I,{className:"absolute inset-0 bg-black/50 flex flex-col items-center justify-center",children:[h.jsx(I,{className:"w-3/4 h-2 bg-gray-700 rounded-full overflow-hidden",children:h.jsx(I,{className:"h-full bg-blue-500 transition-all",style:{width:`${E}%`}})}),h.jsxs(Q,{className:"text-white text-xs mt-1",children:[E,"%"]})]}),x&&h.jsx(I,{className:"absolute inset-0 bg-red-500/50 flex items-center justify-center",children:h.jsx(pt,{className:"fa-solid fa-exclamation-triangle text-2xl text-white"})}),i&&h.jsx(oe,{type:"button",onClick:O=>{O.stopPropagation(),i()},className:`absolute top-1.5 left-1.5 z-10 p-1 rounded-full transition-colors ${o?"bg-yellow-500 text-white":"bg-gray-800/50 text-gray-300 hover:bg-yellow-500 hover:text-white opacity-0 group-hover:opacity-100"}`,title:At(o?"attachment.primary_image":"attachment.set_as_primary"),children:h.jsx(pt,{className:"fa-solid fa-star text-xs"})}),h.jsxs(I,{className:`absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-colors flex items-start justify-end p-1 gap-1 opacity-0 group-hover:opacity-100 ${a?"hidden":""}`,children:[h.jsx(oe,{type:"button",...l,...c,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-gray-600 dark:text-gray-300 hover:bg-white cursor-grab active:cursor-grabbing",title:At("attachment.drag_to_reorder"),onClick:O=>O.stopPropagation(),children:h.jsx(pt,{className:"fa-solid fa-grip-vertical text-sm"})}),!p&&s&&h.jsx(oe,{type:"button",onClick:O=>{O.stopPropagation(),s()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-blue-500 hover:bg-white",title:At("common.download"),children:h.jsx(pt,{className:"fa-solid fa-download text-sm"})}),x&&n&&h.jsx(oe,{type:"button",onClick:O=>{O.stopPropagation(),n()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-orange-500 hover:bg-white",title:At("common.retry"),children:h.jsx(pt,{className:"fa-solid fa-arrow-rotate-right text-sm"})}),h.jsx(oe,{type:"button",onClick:O=>{O.stopPropagation(),e()},disabled:b||S,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-red-500 hover:bg-white disabled:opacity-50",title:At("common.delete"),children:h.jsx(pt,{className:"fa-solid fa-times text-sm"})})]})]}),h.jsxs(I,{className:`p-2 ${!p&&s?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,onClick:()=>{!p&&s&&s()},children:[h.jsx(bt,{className:"text-xs font-medium text-gray-900 dark:text-white truncate",title:t.original_filename,children:t.original_filename}),h.jsx(bt,{className:"text-xs text-gray-500 dark:text-gray-400",children:t.siz
Line truncated
|
|
|
|
|
${y.radio}
|
|
|
|
|
text-blue-600
|
|
|
|
|
bg-gray-100 dark:bg-gray-700
|
|
|
|
|
border-gray-300 dark:border-gray-600
|
|
|
|
|
focus:ring-blue-500 dark:focus:ring-blue-600
|
|
|
|
|
focus:ring-2
|
|
|
|
|
dark:ring-offset-gray-800
|
|
|
|
|
${T?"cursor-not-allowed":"cursor-pointer"}
|
|
|
|
|
`}),c.jsx(Z,{className:`
|
|
|
|
|
${v.label}
|
|
|
|
|
${E?"cursor-not-allowed":"cursor-pointer"}
|
|
|
|
|
`}),h.jsx(Q,{className:`
|
|
|
|
|
${y.label}
|
|
|
|
|
font-medium
|
|
|
|
|
text-gray-900 dark:text-gray-300
|
|
|
|
|
`,children:x.label})]},x.value)})}),g&&c.jsx(Z,{className:"mt-1 text-xs text-red-600 dark:text-red-400",children:g})]})},pn=()=>window.G7Core,No=(e,t)=>pn()?.t?.(e,t)??e,lk=()=>pn()?.locale?.supported?.()??["ko","en"],ck=()=>pn()?.locale?.current?.()??"ko",Ff=e=>{const t=No(`common.language_${e}`);return t===`common.language_${e}`?{ko:"한국어",en:"English",ja:"日本語",zh:"中文"}[e]||e.toUpperCase():t},dk=({content:e="",value:t,onChange:n,multilingual:a=!1,isHtml:r=!1,onIsHtmlChange:o,rows:s=15,placeholder:i="",label:l,showHtmlModeToggle:g=!0,contentClassName:d="",purifyConfig:u,className:f="",name:h="content",htmlFieldName:v="content_mode",readOnly:p=!1})=>{const x=b.useMemo(()=>lk(),[]),m=b.useMemo(()=>ck(),[]),[T,C]=b.useState(m),[S,N]=b.useState(r),[E,k]=b.useState(e),[y,w]=b.useState(t??{}),[A,D]=b.useState(!1);b.useEffect(()=>{N(r)},[r]),b.useEffect(()=>{a||k(e)},[e,a]),b.useEffect(()=>{a&&t&&w(t)},[t,a]);const F=b.useCallback($=>{const z=$.target.value;if(k(z),n){const G=pn()?.createChangeEvent?.({value:z,name:h,type:"textarea"})??{target:{name:h,value:z}};n(G)}},[n,h]),M=b.useCallback(($,z)=>{const G={...y,[$]:z};if(w(G),n){const j=pn()?.createChangeEvent?.({value:G,name:h,type:"multilingual"})??{target:{name:h,value:G}};n(j)}},[n,h,y]),L=b.useCallback($=>{const z=$.target.checked;if(N(z),z||D(!1),o){const G=pn()?.createChangeEvent?.({checked:z,name:v,type:"checkbox"})??{target:{name:v,checked:z}};o(G)}},[o,v]),U=b.useCallback(()=>{D($=>!$)},[]),O=a?y[T]??"":E,I=b.useCallback($=>!!y[$]?.trim(),[y]),H=()=>c.jsx(_,{className:"flex items-center gap-2 mb-3",children:x.map($=>{const z=$===m,G=T===$;return c.jsxs(re,{type:"button",className:`
|
|
|
|
|
`,children:S.label})]},S.value)})}),c&&h.jsx(Q,{className:"mt-1 text-xs text-red-600 dark:text-red-400",children:c})]})},as=()=>window.G7Core,Ki=(t,e)=>as()?.t?.(t,e)??t,lE=()=>as()?.locale?.supported?.()??["ko","en"],cE=()=>as()?.locale?.current?.()??"ko",kp=t=>{const e=Ki(`common.language_${t}`);return e===`common.language_${t}`?{ko:"한국어",en:"English",ja:"日本語",zh:"中文"}[t]||t.toUpperCase():e},dE=({content:t="",value:e,onChange:n,multilingual:r=!1,isHtml:s=!1,onIsHtmlChange:o,rows:i=15,placeholder:a="",label:l,showHtmlModeToggle:c=!0,contentClassName:d="",purifyConfig:u,className:f="",name:g="content",htmlFieldName:m="content_mode",readOnly:p=!1,id:y,editorAttrs:b})=>{const S=v.useMemo(()=>lE(),[]),x=v.useMemo(()=>cE(),[]),[E,k]=v.useState(x),[C,N]=v.useState(s),[_,w]=v.useState(t),[M,O]=v.useState(e??{}),[L,$]=v.useState(!1);v.useEffect(()=>{N(s)},[s]),v.useEffect(()=>{r||w(t)},[t,r]),v.useEffect(()=>{r&&e&&O(e)},[e,r]);const F=v.useCallback(j=>{const U=j.target.value;if(w(U),n){const B=as()?.createChangeEvent?.({value:U,name:g,type:"textarea"})??{target:{name:g,value:U}};n(B)}},[n,g]),D=v.useCallback((j,U)=>{const B={...M,[j]:U};if(O(B),n){const G=as()?.createChangeEvent?.({value:B,name:g,type:"multilingual"})??{target:{name:g,value:B}};n(G)}},[n,g,M]),A=v.useCallback(j=>{const U=j.target.checked;if(N(U),U||$(!1),o){const B=as()?.createChangeEvent?.({checked:U,name:m,type:"checkbox"})??{target:{name:m,checked:U}};o(B)}},[o,m]),T=v.useCallback(()=>{$(j=>!j)},[]),V=r?M[E]??"":_,H=v.useCallback(j=>!!M[j]?.trim(),[M]),W=()=>h.jsx(I,{className:"flex items-center gap-2 mb-3",children:S.map(j=>{const U=j===x,B=E===j;return h.jsxs(oe,{type:"button",className:`
|
|
|
|
|
inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-semibold transition-all
|
|
|
|
|
${G?z?"bg-blue-500 text-white dark:bg-blue-600 dark:text-white shadow-md scale-105":"bg-gray-500 text-white dark:bg-gray-600 dark:text-white shadow-md scale-105":z?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/50":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
|
|
|
|
`,onClick:()=>C($),children:[c.jsx(ne,{name:"globe",className:"w-3 h-3"}),c.jsx(Z,{children:Ff($)}),z&&c.jsx(Z,{className:"text-red-500",children:"*"}),I($)&&!G&&c.jsx(ne,{name:"check",className:"w-3 h-3 text-green-500 dark:text-green-400"})]},$)})});return c.jsxs(_,{className:`space-y-2 ${f}`,children:[c.jsxs(_,{className:"flex items-center justify-between",children:[l&&c.jsx(Ft,{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:l}),c.jsxs(_,{className:"flex items-center gap-3",children:[S&&!p&&c.jsx(re,{type:"button",onClick:U,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${A?"text-gray-700 dark:text-gray-200 bg-gray-200 dark:bg-gray-600 border border-gray-300 dark:border-gray-500 hover:bg-gray-300 dark:hover:bg-gray-500 focus:ring-gray-400 dark:focus:ring-gray-500":"text-blue-600 dark:text-blue-400 bg-white dark:bg-gray-700 border border-blue-300 dark:border-blue-600 hover:bg-blue-50 dark:hover:bg-gray-600 focus:ring-blue-500 dark:focus:ring-blue-600"}`,children:No(A?"common.preview_off":"common.preview")}),g&&c.jsxs(Ft,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[c.jsx(ft,{type:"checkbox",name:v,checked:S,onChange:L,disabled:p,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),c.jsx(_,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:No("common.html_mode")})]})]})]}),a&&H(),!A&&(a?x.map($=>c.jsx(_,{className:T===$?"block":"hidden",children:c.jsx(vr,{name:`${h}[${$}]`,value:y[$]??"",onChange:z=>M($,z.target.value),placeholder:`${i} (${Ff($)})`,rows:s,readOnly:p,className:`block w-full rounded-lg border px-3 py-2 text-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 disabled:opacity-50 disabled:cursor-not-allowed ${S?"font-mono bg-white dark:bg-gray-800 border-blue-300 dark:border-blue-600 text-gray-800 dark:text-gray-200 focus:border-blue-500 focus:ring-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:border-blue-500 focus:ring-blue-500"}`})},$)):c.jsx(vr,{name:h,value:E,onChange:F,placeholder:i,rows:s,readOnly:p,className:`block w-full rounded-lg border px-3 py-2 text-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 disabled:opacity-50 disabled:cursor-not-allowed ${S?"font-mono bg-white dark:bg-gray-800 border-blue-300 dark:border-blue-600 text-gray-800 dark:text-gray-200 focus:border-blue-500 focus:ring-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:border-blue-500 focus:ring-blue-500"}`})),A&&c.jsx(_,{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 min-h-[400px]",children:c.jsx(Ko,{content:O,isHtml:!0,className:d||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:u})})]})},Uf="g7_dismissed_warnings";function Vf(){try{const e=sessionStorage.getItem(Uf);return e?JSON.parse(e):[]}catch{return[]}}function uk(e){try{const t=Vf();t.includes(e)||(t.push(e),sessionStorage.setItem(Uf,JSON.stringify(t)))}catch{}}function fk(e){switch(e){case"error":return"error";case"warning":return"warning";case"info":default:return"info"}}const gk=({warnings:e,className:t=""})=>{const[n,a]=b.useState([]);b.useEffect(()=>{a(Vf())},[]);const r=b.useCallback(s=>{uk(s),a(i=>[...i,s])},[]);if(!e||e.length===0)return null;const o=e.filter(s=>!n.includes(s.id));return o.length===0?null:c.jsx(_,{className:`space-y-2 ${t}`.trim(),children:o.map(s=>c.jsx(kl,{type:fk(s.level),message:s.message,dismissible:!0,onDismiss:()=>r(s.id)},s.id))})},Hf=window.G7Core?.createLogger?.("Comp:FilterVisibility")??{log:(...e)=>console.log("[Comp:FilterVisibility]",...e),warn:(...e)=>console.warn("[Comp:FilterVisibility]",...e),error:(...e)=>console.error("[Comp:FilterVisibility]",...e)},hk=({id:e,visibleFilters:t,defaultFilters:n=[],onFilterVisibilityChange:a})=>{const[r,o]=b.useState(!1),s=b.useRef(!0),i=b.useMemo(()=>{try{const f=window.G7Core?.AuthManager?.getInstance();return f?f.getUser()?.uuid:void 0}catch{return}},[]),l=b.useMemo(()=>`g7_filters_${e}${i!==void 0?`_${i}`:""}`,[e,i]),g=b.useCallback(()=>{try{const f=localStorage.getItem(l);if(f){const h=JSON.parse(f);if(Array.isArray(h))return h}}catch(f){Hf.warn("Failed to load from localStorage:",f)}return null},[l]),d=b.useCallback(f=>{try{localStorage.setItem(l,JSON.stringify(f))}catch(h){Hf.warn("Failed to save to localStorage:",h)}},[l]),u=b.useCallback(()=>{const f=g();return f||(t&&t.length>0?t:n)},[g,t,n]);return b.useEffect(()=>{if(!r){const f=u();a&&f.length>0&&a(f),o(!0)}},[r,a,u]),b.useEffect(()=>{if(r&&t&&t.length>0){if(s.current){s.current=!1;return}d(t)}},[r,t,d]),null},pk=window.G7Core?.createLogger?.("Comp:SlotContainer")??{log:(...e)=>console.log
Line truncated
|
|
|
|
|
${B?U?"bg-blue-500 text-white dark:bg-blue-600 dark:text-white shadow-md scale-105":"bg-gray-500 text-white dark:bg-gray-600 dark:text-white shadow-md scale-105":U?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400 hover:bg-blue-100 dark:hover:bg-blue-900/50":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"}
|
|
|
|
|
`,onClick:()=>k(j),children:[h.jsx(re,{name:"globe",className:"w-3 h-3"}),h.jsx(Q,{children:kp(j)}),U&&h.jsx(Q,{className:"text-red-500",children:"*"}),H(j)&&!B&&h.jsx(re,{name:"check",className:"w-3 h-3 text-green-500 dark:text-green-400"})]},j)})});return h.jsxs(I,{className:`space-y-2 ${f}`,id:y,...b,children:[h.jsxs(I,{className:"flex items-center justify-between",children:[l&&h.jsx(en,{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:l}),h.jsxs(I,{className:"flex items-center gap-3",children:[C&&!p&&h.jsx(oe,{type:"button",onClick:T,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${L?"text-gray-700 dark:text-gray-200 bg-gray-200 dark:bg-gray-600 border border-gray-300 dark:border-gray-500 hover:bg-gray-300 dark:hover:bg-gray-500 focus:ring-gray-400 dark:focus:ring-gray-500":"text-blue-600 dark:text-blue-400 bg-white dark:bg-gray-700 border border-blue-300 dark:border-blue-600 hover:bg-blue-50 dark:hover:bg-gray-600 focus:ring-blue-500 dark:focus:ring-blue-600"}`,children:Ki(L?"common.preview_off":"common.preview")}),c&&h.jsxs(en,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[h.jsx(wt,{type:"checkbox",name:m,checked:C,onChange:A,disabled:p,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),h.jsx(I,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:Ki("common.html_mode")})]})]})]}),r&&W(),!L&&(r?S.map(j=>h.jsx(I,{className:E===j?"block":"hidden",children:h.jsx(qn,{name:`${g}[${j}]`,value:M[j]??"",onChange:U=>D(j,U.target.value),placeholder:`${a} (${kp(j)})`,rows:i,readOnly:p,className:`block w-full rounded-lg border px-3 py-2 text-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 disabled:opacity-50 disabled:cursor-not-allowed ${C?"font-mono bg-white dark:bg-gray-800 border-blue-300 dark:border-blue-600 text-gray-800 dark:text-gray-200 focus:border-blue-500 focus:ring-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:border-blue-500 focus:ring-blue-500"}`})},j)):h.jsx(qn,{name:g,value:_,onChange:F,placeholder:a,rows:i,readOnly:p,className:`block w-full rounded-lg border px-3 py-2 text-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 disabled:opacity-50 disabled:cursor-not-allowed ${C?"font-mono bg-white dark:bg-gray-800 border-blue-300 dark:border-blue-600 text-gray-800 dark:text-gray-200 focus:border-blue-500 focus:ring-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:border-blue-500 focus:ring-blue-500"}`})),L&&h.jsx(I,{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 min-h-[400px]",children:h.jsx(Xa,{content:V,isHtml:!0,className:d||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:u})})]})},Cp="g7_dismissed_warnings";function Sp(){try{const t=sessionStorage.getItem(Cp);return t?JSON.parse(t):[]}catch{return[]}}function uE(t){try{const e=Sp();e.includes(t)||(e.push(t),sessionStorage.setItem(Cp,JSON.stringify(e)))}catch{}}function fE(t){switch(t){case"error":return"error";case"warning":return"warning";case"info":default:return"info"}}const hE=({warnings:t,className:e=""})=>{const[n,r]=v.useState([]);v.useEffect(()=>{r(Sp())},[]);const s=v.useCallback(i=>{uE(i),r(a=>[...a,i])},[]);if(!t||t.length===0)return null;const o=t.filter(i=>!n.includes(i.id));return o.length===0?null:h.jsx(I,{className:`space-y-2 ${e}`.trim(),children:o.map(i=>h.jsx(iu,{type:fE(i.level),message:i.message,dismissible:!0,onDismiss:()=>s(i.id)},i.id))})},_p=window.G7Core?.createLogger?.("Comp:FilterVisibility")??{log:(...t)=>console.log("[Comp:FilterVisibility]",...t),warn:(...t)=>console.warn("[Comp:FilterVisibility]",...t),error:(...t)=>console.error("[Comp:FilterVisibility]",...t)},gE=({id:t,visibleFilters:e,defaultFilters:n=[],onFilterVisibilityChange:r})=>{const[s,o]=v.useState(!1),i=v.useRef(!0),a=v.useMemo(()=>{try{const f=window.G7Core?.AuthManager?.getInstance();return f?f.getUser()?.uuid:void 0}catch{return}},[]),l=v.useMemo(()=>`g7_filters_${t}${a!==void 0?`_${a}`:""}`,[t,a]),c=v.useCallback(()=>{try{const f=localStorage.getItem(l);if(f){const g=JSON.parse(f);if(Array.isArray(g))return g}}catch(f){_p.warn("Failed to load from localStorage:",f)}return null},[l]),d=v.useCallback(f=>{try{localStorage.setItem(l,JSON.stringify(f))}catch(g){_p.warn("Failed to save to localStorage:",g)}},[l]),u=v.useCallback(()=>{const f=c();return f||(e&&e.length>0?e:n)},[c,e,n]);return v.useEffect(()=>{if(!s){const f=u();r&&f.length>0&&r(f),o(!0)}},[s,r,u]),v.useEffect(()=>{if(s&&e&&e.length>0){if(i.current){i.current=!1;return}d(e)}},[s,e,d]),null},pE=window.G7Core?.createLogger?.("Comp:SlotContainer")??{log:(...t)=>c
Line truncated
|
|
|
|
|
w-full px-4 py-2.5
|
|
|
|
|
bg-gray-100 dark:bg-gray-700
|
|
|
|
|
border-0 rounded-xl
|
|
|
|
|
text-gray-700 dark:text-gray-200 font-medium
|
|
|
|
|
text-sm text-gray-700 dark:text-gray-200 font-medium
|
|
|
|
|
focus:ring-2 focus:ring-blue-500 focus:outline-none
|
|
|
|
|
flex items-center justify-between gap-2
|
|
|
|
|
text-left cursor-pointer
|
|
|
|
|
disabled:opacity-50 disabled:cursor-not-allowed
|
|
|
|
|
`,"aria-haspopup":"listbox","aria-expanded":d,children:[c.jsx(_,{className:"flex-1 min-w-0",children:T()}),c.jsx(gr,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${d?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),d&&c.jsx(_,{className:"absolute z-50 w-full mt-2 bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden",role:"listbox",children:c.jsx(_,{className:"overflow-auto",style:{maxHeight:s},children:e.length===0?c.jsx(_,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:jf("common.no_options")}):e.map((S,N)=>{const E=String(S.value)===String(t);return c.jsx(re,{type:"button",onClick:()=>!S.disabled&&x(S.value),disabled:S.disabled,className:`
|
|
|
|
|
w-full px-4 py-3 text-left
|
|
|
|
|
`,"aria-haspopup":"listbox","aria-expanded":f,children:[h.jsx(I,{className:"flex-1 min-w-0",children:E()}),h.jsx(Hn,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${f?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:h.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),f&&h.jsx(I,{className:"absolute z-50 w-full mt-2 bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden",role:"listbox",children:h.jsx(I,{className:"overflow-auto",style:{maxHeight:i},children:t.length===0?h.jsx(I,{className:"px-4 py-6 text-center text-gray-500 dark:text-gray-400",children:Ep("common.no_options")}):t.map((C,N)=>{const _=String(C.value)===String(e);return h.jsx(oe,{type:"button",onClick:()=>!C.disabled&&S(C.value),disabled:C.disabled,className:`
|
|
|
|
|
w-full px-4 py-3 text-left text-sm
|
|
|
|
|
hover:bg-gray-100 dark:hover:bg-gray-700
|
|
|
|
|
transition-colors
|
|
|
|
|
${E?"bg-blue-50 dark:bg-blue-900/20":""}
|
|
|
|
|
${S.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
|
|
|
`,role:"option","aria-selected":E,"data-item-value":S.value,"data-item-index":N,"data-item-selected":E,children:g?.item?zf(g.item,{item:S,index:N,isSelected:E},`item-${N}`):i||C(S,E)},S.value)})})})]})};function vk(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}const yk=({value:e,checked:t=!1,icon:n,label:a,variant:r="blue",customColor:o,className:s="",style:i,onChange:l})=>{const[g,d]=b.useState(!1),u="inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium border cursor-pointer transition-all";if(o){const p=vk(o),x=document.documentElement.classList.contains("dark");let m;return t?m={backgroundColor:o,color:"#ffffff",borderColor:o,opacity:g?.85:1}:m=p?{backgroundColor:`rgba(${p.r}, ${p.g}, ${p.b}, ${g?x?.25:.12:x?.15:.06})`,color:o,borderColor:`rgba(${p.r}, ${p.g}, ${p.b}, ${x?.3:.2})`}:{},c.jsxs(Ft,{className:`${u} ${s}`,style:{...m,...i},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[c.jsx(ft,{type:"checkbox",value:e,checked:t,onChange:T=>{l?.(T)},className:"hidden"}),n&&c.jsx(ne,{name:n,className:"w-4 h-4"}),c.jsx(_,{children:a})]})}const v=t?{green:"bg-green-600 dark:bg-green-600 text-white dark:text-white border-green-700 dark:border-green-500 hover:bg-green-700 dark:hover:bg-green-500",orange:"bg-orange-600 dark:bg-orange-600 text-white dark:text-white border-orange-700 dark:border-orange-500 hover:bg-orange-700 dark:hover:bg-orange-500",yellow:"bg-yellow-600 dark:bg-yellow-600 text-white dark:text-white border-yellow-700 dark:border-yellow-500 hover:bg-yellow-700 dark:hover:bg-yellow-500",gray:"bg-gray-600 dark:bg-gray-500 text-white dark:text-white border-gray-700 dark:border-gray-400 hover:bg-gray-700 dark:hover:bg-gray-400",blue:"bg-blue-600 dark:bg-blue-600 text-white dark:text-white border-blue-700 dark:border-blue-500 hover:bg-blue-700 dark:hover:bg-blue-500"}[r]:{green:"bg-green-50 dark:bg-green-900/20 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 hover:bg-green-100 dark:hover:bg-green-900/30",orange:"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-800 hover:bg-orange-100 dark:hover:bg-orange-900/30",yellow:"bg-yellow-50 dark:bg-yellow-900/20 text-yellow-600 dark:text-yellow-400 border-yellow-200 dark:border-yellow-800 hover:bg-yellow-100 dark:hover:bg-yellow-900/30",gray:"bg-gray-50 dark:bg-gray-700 text-gray-600 dark:text-gray-300 border-gray-200 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-600",blue:"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 hover:bg-blue-100 dark:hover:bg-blue-900/30"}[r];return c.jsxs(Ft,{className:`${u} ${v} ${s}`,style:i,children:[c.jsx(ft,{type:"checkbox",value:e,checked:t,onChange:p=>{l?.(p)},className:"hidden"}),n&&c.jsx(ne,{name:n,className:"w-4 h-4"}),c.jsx(_,{children:a})]})},xk=({label:e,icon:t,iconPosition:n="left",position:a="right",className:r="",style:o,children:s})=>{const[i,l]=b.useState(!1),[g,d]=b.useState({top:0,left:0}),u=b.useRef(null),f=b.useRef(null),h=b.useCallback(()=>{if(!u.current)return;const p=u.current.getBoundingClientRect(),x=224;let m=a==="right"?p.right-x:p.left;const T=p.bottom+8;m<8&&(m=8),m+x>window.innerWidth-8&&(m=window.innerWidth-x-8),d({top:T,left:m})},[a]);b.useEffect(()=>{i&&h()},[i,h]),b.useEffect(()=>{if(!i)return;const p=()=>{l(!1)};return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[i]),b.useEffect(()=>{const p=x=>{const m=x.target,T=u.current?.contains(m),C=f.current?.contains(m);!T&&!C&&l(!1)};return i&&document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[i]);const v=i?ar.createPortal(c.jsx("div",{ref:f,className:"fixed z-[9999] w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden",style:{top:g.top,left:g.left},onClick:()=>l(!1),children:s}),document.body):null;return c.jsxs(_,{className:`relative inline-block ${r}`,style:o,children:[c.jsxs(re,{ref:u,onClick:()=>l(!i),className:"flex items-center gap-2",children:[n==="left"&&t&&c.jsx(ne,{name:t,className:"w-4 h-4"}),e&&c.jsx(Z,{className:"text-sm font-medium",children:e}),n==="right"&&t&&c.jsx(ne,{name:t,className:"w-4 h-4"})]}),v]})},wk=({label:e,icon:t,variant:n="default",disabled:a=!1,divider:r=!1,className:o="",style:s,onClick:i})=>{if(r)return c.jsx(_,{className:"h-px bg-gray-200 dark:bg-gray-700 my-1",style:s});const l=n==="danger"?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700",g=a?"opacity-50 cursor-not-allowed":"cursor-pointer",d=()=>{!a&&i&&i()};return c.jsxs(_,{onClick:d,className:`flex items-center gap-3 px-4 py-3 transition-colors ${l} ${g} ${o}`,styl
Line truncated
|
|
|
|
|
${_?"bg-blue-50 dark:bg-blue-900/20":""}
|
|
|
|
|
${C.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
|
|
|
`,role:"option","aria-selected":_,"data-item-value":C.value,"data-item-index":N,"data-item-selected":_,children:c?.item?Mp(c.item,{item:C,index:N,isSelected:_},`item-${N}`):a||k(C,_)},C.value)})})})]})};function vE(t){const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}const xE=({value:t,checked:e=!1,icon:n,label:r,variant:s="blue",customColor:o,className:i="",style:a,onChange:l,id:c,editorAttrs:d})=>{const[u,f]=v.useState(!1),g="inline-flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm font-medium border cursor-pointer transition-all";if(o){const b=vE(o),S=document.documentElement.classList.contains("dark");let x;return e?x={backgroundColor:o,color:"#ffffff",borderColor:o,opacity:u?.85:1}:x=b?{backgroundColor:`rgba(${b.r}, ${b.g}, ${b.b}, ${u?S?.25:.12:S?.15:.06})`,color:o,borderColor:`rgba(${b.r}, ${b.g}, ${b.b}, ${S?.3:.2})`}:{},h.jsxs(en,{className:`${g} ${i}`,style:{...x,...a},onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),id:c,...d,children:[h.jsx(wt,{type:"checkbox",value:t,checked:e,onChange:E=>{l?.(E)},className:"hidden"}),n&&h.jsx(re,{name:n,className:"w-4 h-4"}),h.jsx(I,{children:r})]})}const y=e?{green:"bg-green-600 dark:bg-green-600 text-white dark:text-white border-green-700 dark:border-green-500 hover:bg-green-700 dark:hover:bg-green-500",orange:"bg-orange-600 dark:bg-orange-600 text-white dark:text-white border-orange-700 dark:border-orange-500 hover:bg-orange-700 dark:hover:bg-orange-500",yellow:"bg-yellow-600 dark:bg-yellow-600 text-white dark:text-white border-yellow-700 dark:border-yellow-500 hover:bg-yellow-700 dark:hover:bg-yellow-500",gray:"bg-gray-600 dark:bg-gray-500 text-white dark:text-white border-gray-700 dark:border-gray-400 hover:bg-gray-700 dark:hover:bg-gray-400",blue:"bg-blue-600 dark:bg-blue-600 text-white dark:text-white border-blue-700 dark:border-blue-500 hover:bg-blue-700 dark:hover:bg-blue-500"}[s]:{green:"bg-green-50 dark:bg-green-900/20 text-green-600 dark:text-green-400 border-green-200 dark:border-green-800 hover:bg-green-100 dark:hover:bg-green-900/30",orange:"bg-orange-50 dark:bg-orange-900/20 text-orange-600 dark:text-orange-400 border-orange-200 dark:border-orange-800 hover:bg-orange-100 dark:hover:bg-orange-900/30",yellow:"bg-yellow-50 dark:bg-yellow-900/20 text-yellow-600 dark:text-yellow-400 border-yellow-200 dark:border-yellow-800 hover:bg-yellow-100 dark:hover:bg-yellow-900/30",gray:"bg-gray-50 dark:bg-gray-700 text-gray-600 dark:text-gray-300 border-gray-200 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-600",blue:"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400 border-blue-200 dark:border-blue-800 hover:bg-blue-100 dark:hover:bg-blue-900/30"}[s];return h.jsxs(en,{className:`${g} ${y} ${i}`,style:a,id:c,...d,children:[h.jsx(wt,{type:"checkbox",value:t,checked:e,onChange:b=>{l?.(b)},className:"hidden"}),n&&h.jsx(re,{name:n,className:"w-4 h-4"}),h.jsx(I,{children:r})]})},wE=({label:t,icon:e,iconPosition:n="left",position:r="right",className:s="",style:o,children:i})=>{const[a,l]=v.useState(!1),[c,d]=v.useState({top:0,left:0}),u=v.useRef(null),f=v.useRef(null),g=v.useCallback(()=>{if(!u.current)return;const p=u.current.getBoundingClientRect(),y=224;let b=r==="right"?p.right-y:p.left;const S=p.bottom+8;b<8&&(b=8),b+y>window.innerWidth-8&&(b=window.innerWidth-y-8),d({top:S,left:b})},[r]);v.useEffect(()=>{a&&g()},[a,g]),v.useEffect(()=>{if(!a)return;const p=()=>{l(!1)};return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[a]),v.useEffect(()=>{const p=y=>{const b=y.target,S=u.current?.contains(b),x=f.current?.contains(b);!S&&!x&&l(!1)};return a&&document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[a]);const m=a?Nn.createPortal(h.jsx("div",{ref:f,className:"fixed z-[9999] w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg overflow-hidden",style:{top:c.top,left:c.left},onClick:()=>l(!1),children:i}),document.body):null;return h.jsxs(I,{className:`relative inline-block ${s}`,style:o,children:[h.jsxs(oe,{ref:u,onClick:()=>l(!a),className:"flex items-center gap-2",children:[n==="left"&&e&&h.jsx(re,{name:e,className:"w-4 h-4"}),t&&h.jsx(Q,{className:"text-sm font-medium",children:t}),n==="right"&&e&&h.jsx(re,{name:e,className:"w-4 h-4"})]}),m]})},kE=({label:t,icon:e,variant:n="default",disabled:r=!1,divider:s=!1,className:o="",style:i,onClick:a})=>{if(s)return h.jsx(I,{className:"h-px bg-gray-200 dark:bg-gray-700 my-1",style:i});const l=n==="danger"?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20":"text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700",c=r?"opacity-50 cursor-not-allowed":"cursor-pointer",d=()=>{!r&&a&&a()};return h.jsxs(I,{onClick:d,className:`flex items-center gap-3 px-4 py-3Line truncated
|
|
|
|
|
* @kurkle/color v0.3.4
|
|
|
|
|
* https://github.com/kurkle/color#readme
|
|
|
|
|
* (c) 2024 Jukka Kurkela
|
|
|
|
|
* Released under the MIT License
|
|
|
|
|
*/function io(t){return t+.5|0}const rr=(t,e,n)=>Math.max(Math.min(t,n),e);function ao(t){return rr(io(t*2.55),0,255)}function sr(t){return rr(io(t*255),0,255)}function jn(t){return rr(io(t/2.55)/100,0,1)}function Ap(t){return rr(io(t*100),0,100)}const fn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Lc=[..."0123456789ABCDEF"],VE=t=>Lc[t&15],zE=t=>Lc[(t&240)>>4]+Lc[t&15],qi=t=>(t&240)>>4===(t&15),HE=t=>qi(t.r)&&qi(t.g)&&qi(t.b)&&qi(t.a);function UE(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&fn[t[1]]*17,g:255&fn[t[2]]*17,b:255&fn[t[3]]*17,a:e===5?fn[t[4]]*17:255}:(e===7||e===9)&&(n={r:fn[t[1]]<<4|fn[t[2]],g:fn[t[3]]<<4|fn[t[4]],b:fn[t[5]]<<4|fn[t[6]],a:e===9?fn[t[7]]<<4|fn[t[8]]:255})),n}const BE=(t,e)=>t<255?e(t):"";function jE(t){var e=HE(t)?VE:zE;return t?"#"+e(t.r)+e(t.g)+e(t.b)+BE(t.a,e):void 0}const WE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Dp(t,e,n){const r=e*Math.min(n,1-n),s=(o,i=(o+t/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[s(0),s(8),s(4)]}function GE(t,e,n){const r=(s,o=(s+t/60)%6)=>n-n*e*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function YE(t,e,n){const r=Dp(t,1,.5);let s;for(e+n>1&&(s=1/(e+n),e*=s,n*=s),s=0;s<3;s++)r[s]*=1-e-n,r[s]+=e;return r}function XE(t,e,n,r,s){return t===s?(e-n)/r+(e<n?6:0):e===s?(n-t)/r+2:(t-e)/r+4}function Pc(t){const n=t.r/255,r=t.g/255,s=t.b/255,o=Math.max(n,r,s),i=Math.min(n,r,s),a=(o+i)/2;let l,c,d;return o!==i&&(d=o-i,c=a>.5?d/(2-o-i):d/(o+i),l=XE(n,r,s,d,o),l=l*60+.5),[l|0,c||0,a]}function $c(t,e,n,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,r)).map(sr)}function Fc(t,e,n){return $c(Dp,t,e,n)}function KE(t,e,n){return $c(YE,t,e,n)}function qE(t,e,n){return $c(GE,t,e,n)}function Ip(t){return(t%360+360)%360}function ZE(t){const e=WE.exec(t);let n=255,r;if(!e)return;e[5]!==r&&(n=e[6]?ao(+e[5]):sr(+e[5]));const s=Ip(+e[2]),o=+e[3]/100,i=+e[4]/100;return e[1]==="hwb"?r=KE(s,o,i):e[1]==="hsv"?r=qE(s,o,i):r=Fc(s,o,i),{r:r[0],g:r[1],b:r[2],a:n}}function QE(t,e){var n=Pc(t);n[0]=Ip(n[0]+e),n=Fc(n),t.r=n[0],t.g=n[1],t.b=n[2]}function JE(t){if(!t)return;const e=Pc(t),n=e[0],r=Ap(e[1]),s=Ap(e[2]);return t.a<255?`hsla(${n}, ${r}%, ${s}%, ${jn(t.a)})`:`hsl(${n}, ${r}%, ${s}%)`}const Lp={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Pp={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function RE(){const t={},e=Object.keys(Pp),n=Object.keys(Lp);let r,s,o,i,a;for(r=0;r<e.length;r++){for(i=a=e[r],s=0;s<n.length;s++)o=n[s]Line truncated
|
|
|
|
|
* Chart.js v4.5.1
|
|
|
|
|
* https://www.chartjs.org
|
|
|
|
|
* (c) 2025 Chart.js Contributors
|
|
|
|
|
* Released under the MIT License
|
|
|
|
|
*/function Wn(){}const iM=(()=>{let t=0;return()=>t++})();function ct(t){return t==null}function _t(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Ze(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function hn(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Pn(t,e){return hn(t)?t:e}function Qe(t,e){return typeof t>"u"?e:t}const aM=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,Vp=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ht(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function at(t,e,n,r){let s,o,i;if(_t(t))for(o=t.length,s=0;s<o;s++)e.call(n,t[s],s);else if(Ze(t))for(i=Object.keys(t),o=i.length,s=0;s<o;s++)e.call(n,t[i[s]],i[s])}function Ji(t,e){let n,r,s,o;if(!t||!e||t.length!==e.length)return!1;for(n=0,r=t.length;n<r;++n)if(s=t[n],o=e[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Ri(t){if(_t(t))return t.map(Ri);if(Ze(t)){const e=Object.create(null),n=Object.keys(t),r=n.length;let s=0;for(;s<r;++s)e[n[s]]=Ri(t[n[s]]);return e}return t}function zp(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function lM(t,e,n,r){if(!zp(t))return;const s=e[t],o=n[t];Ze(s)&&Ze(o)?co(s,o,r):e[t]=Ri(o)}function co(t,e,n){const r=_t(e)?e:[e],s=r.length;if(!Ze(t))return t;n=n||{};const o=n.merger||lM;let i;for(let a=0;a<s;++a){if(i=r[a],!Ze(i))continue;const l=Object.keys(i);for(let c=0,d=l.length;c<d;++c)o(l[c],t,i,n)}return t}function uo(t,e){return co(t,e,{merger:cM})}function cM(t,e,n){if(!zp(t))return;const r=e[t],s=n[t];Ze(r)&&Ze(s)?uo(r,s):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ri(s))}const Hp={"":t=>t,x:t=>t.x,y:t=>t.y};function dM(t){const e=t.split("."),n=[];let r="";for(const s of e)r+=s,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function uM(t){const e=dM(t);return n=>{for(const r of e){if(r==="")break;n=n&&n[r]}return n}}function Cr(t,e){return(Hp[e]||(Hp[e]=uM(e)))(t)}function zc(t){return t.charAt(0).toUpperCase()+t.slice(1)}const fo=t=>typeof t<"u",or=t=>typeof t=="function",Up=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function fM(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const dt=Math.PI,Ct=2*dt,ea=Number.POSITIVE_INFINITY,hM=dt/180,Et=dt/2,Sr=dt/4,Bp=dt*2/3,jp=Math.log10,ir=Math.sign;function ta(t,e,n){return Math.abs(t-e)<n}function Wp(t){const e=Math.round(t);t=ta(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(jp(t))),r=t/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function gM(t){const e=[],n=Math.sqrt(t);let r;for(r=1;r<n;r++)t%r===0&&(e.push(r),e.push(t/r));return n===(n|0)&&e.push(n),e.sort((s,o)=>s-o).pop(),e}function pM(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function na(t){return!pM(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function mM(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function bM(t,e,n){let r,s,o;for(r=0,s=t.length;r<s;r++)o=t[r][n],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Gn(t){return t*(dt/180)}function yM(t){return t*(180/dt)}function Gp(t){if(!hn(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Yp(t,e){const n=e.x-t.x,r=e.y-t.y,s=Math.sqrt(n*n+r*r);let o=Math.atan2(r,n);return o<-.5*dt&&(o+=Ct),{angle:o,distance:s}}function vM(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function $n(t){return(t%Ct+Ct)%Ct}function ra(t,e,n,r){const s=$n(t),o=$n(e),i=$n(n),a=$n(o-s),l=$n(i-s),c=$n(s-o),d=$n(s-i);return s===o||s===i||r&&o===i||a>l&&c<d}function Zt(t,e,n){return Math.max(e,Math.min(n,t))}function xM(t){return Zt(t,-32768,32767)}function _r(t,e,n,r=1e-6){return t>=Math.min(e,n)-r&&t<=Math.max(e,n)+r}function Hc(t,e,n){n=n||(i=>t[i]<e);let r=t.length-1,s=0,o;for(;r-s>1;)o=s+r>>1,n(o)?s=o:r=o;return{lo:s,hi:r}}const Uc=(t,e,n,r)=>Hc(t,n,r?s=>{const o=t[s][e];return o<n||o===n&&t[s+1][e]===n}:s=>t[s][e]<n),wM=(t,e,n)=>Hc(t,n,r=>t[r][e]>=n);function kM(t,e,n){let r=0,s=t.length;for(;r<s&&t[r]<e;)r++;for(;s>r&&t[s-1]>n;)s--;return r>0||s<t.length?t.slice(r,s):t}const Xp=["push","pop","shift","splice","unshift"];function CM(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Xp.forEach(n=>{const r="_onData"+zc(n),s=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...o){const i=s.apply(this,o);return t._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),i}})})}function Kp(t,e){const n=t._chartjs;if(!n)return;const r=n.listeners,s=r.indexOf(e);s!==-1&&r.splice(s,1),!(r.length>0)&&(Xp.forEach(o=>{delete t[o]}),delete t._chartjs)}function qp(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Zp=(function(){return typeof window>"u"?functionLine truncated
|
|
|
|
|
* Chart.js v4.5.1
|
|
|
|
|
* https://www.chartjs.org
|
|
|
|
|
* (c) 2025 Chart.js Contributors
|
|
|
|
|
* Released under the MIT License
|
|
|
|
|
*/class dN{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,r,s){const o=n.listeners[s],i=n.duration;o.forEach(a=>a({chart:e,initial:n.initial,numSteps:i,currentStep:Math.min(r-n.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=Zp.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const o=r.items;let i=o.length-1,a=!1,l;for(;i>=0;--i)l=o[i],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(e),a=!0):(o[i]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,r,e,"progress")),o.length||(r.running=!1,this._notify(s,r,e,"complete"),r.initial=!1),n+=o.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let r=n.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,r)),r}listen(e,n,r){this._getAnims(e).listeners[n].push(r)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,s)=>Math.max(r,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const r=n.items;let s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Yn=new dN;const x0="transparent",uN={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const r=t0(t||x0),s=r.valid&&t0(e||x0);return s&&s.valid?s.mix(r,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class fN{constructor(e,n,r,s){const o=n[r];s=ia([e.to,s,o,e.from]);const i=ia([e.from,o,s]);this._active=!0,this._fn=e.fn||uN[e.type||typeof i],this._easing=ho[e.easing]||ho.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=r,this._from=i,this._to=s,this._promises=void 0}active(){return this._active}update(e,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],o=r-this._start,i=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(i,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=ia([e.to,n,s,e.from]),this._from=ia([e.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-this._start,r=this._duration,s=this._prop,o=this._from,i=this._loop,a=this._to;let l;if(this._active=o!==a&&(i||n<r),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/r%2,l=i&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((n,r)=>{e.push({res:n,rej:r})})}_notify(e){const n=e?"res":"rej",r=this._promises||[];for(let s=0;s<r.length;s++)r[s][n]()}}class w0{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!Ze(e))return;const n=Object.keys(vt.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(s=>{const o=e[s];if(!Ze(o))return;const i={};for(const a of n)i[a]=o[a];(_t(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!r.has(a))&&r.set(a,i)})})}_animateOptions(e,n){const r=n.options,s=gN(e,r);if(!s)return[];const o=this._createAnimations(s,r);return r.$shared&&hN(e.options.$animations,r).then(()=>{e.options=r},()=>{}),o}_createAnimations(e,n){const r=this._properties,s=[],o=e.$animations||(e.$animations={}),i=Object.keys(n),a=Date.now();let l;for(l=i.length-1;l>=0;--l){const c=i[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(e,n));continue}const d=n[c];let u=o[c];const f=r.get(c);if(u)if(f&&u.active()){u.update(f,d,a);continue}else u.cancel();if(!f||!f.duration){e[c]=d;continue}o[c]=u=new fN(f,e,c,d),s.push(u)}return s}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const r=this._createAnimations(e,n);if(r.length)return Yn.add(this._chart,r),!0}}function hN(t,e){const n=[],r=Object.keys(e);for(let s=0;s<r.length;s++){const o=t[r[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function gN(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function k0(t,e){const n=t&&t.options||{},r=n.reverse,s=n.min===void 0?e:0,o=n.max===void 0?e:0;return{start:r?o:s,end:r?s:o}}function pN(t,e,n){if(n===!1)return!1;const r=k0(t,n),s=k0(e,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function mN(t){let e,n,r,s;return Ze(t)?(e=t.top,n=t.right,r=t.bottom,s=t.left):e=n=r=s=t,{top:e,right:n,bottom:r,left:s,disabled:t===!1}}function C0(t,e){const n=[],r=t._getSortedDatasetMetas(e);let s,o;for(s=0,o=r.length;s<o;++s)n.push(r[s].indLine truncated
|
|
|
|
|
`)>-1?t.split(`
|
|
|
|
|
`):t}function l5(t,e){const{element:n,datasetIndex:r,index:s}=e,o=t.getDatasetMeta(r).controller,{label:i,value:a}=o.getLabelAndValue(s);return{chart:t,label:i,parsed:o.getParsed(s),raw:t.data.datasets[r].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function fm(t,e){const n=t.chart.ctx,{body:r,footer:s,title:o}=t,{boxWidth:i,boxHeight:a}=e,l=Ut(e.bodyFont),c=Ut(e.titleFont),d=Ut(e.footerFont),u=o.length,f=s.length,g=r.length,m=gn(e.padding);let p=m.height,y=0,b=r.reduce((E,k)=>E+k.before.length+k.lines.length+k.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*e.titleSpacing+e.titleMarginBottom),b){const E=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=g*E+(b-g)*l.lineHeight+(b-1)*e.bodySpacing}f&&(p+=e.footerMarginTop+f*d.lineHeight+(f-1)*e.footerSpacing);let S=0;const x=function(E){y=Math.max(y,n.measureText(E).width+S)};return n.save(),n.font=c.string,at(t.title,x),n.font=l.string,at(t.beforeBody.concat(t.afterBody),x),S=e.displayColors?i+2+e.boxPadding:0,at(r,E=>{at(E.before,x),at(E.lines,x),at(E.after,x)}),S=0,n.font=d.string,at(t.footer,x),n.restore(),y+=m.width,{width:y,height:p}}function c5(t,e){const{y:n,height:r}=e;return n<r/2?"top":n>t.height-r/2?"bottom":"center"}function d5(t,e,n,r){const{x:s,width:o}=r,i=n.caretSize+n.caretPadding;if(t==="left"&&s+o+i>e.width||t==="right"&&s-o-i<0)return!0}function u5(t,e,n,r){const{x:s,width:o}=n,{width:i,chartArea:{left:a,right:l}}=t;let c="center";return r==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=i-o/2&&(c="right"),d5(c,t,e,n)&&(c="center"),c}function hm(t,e,n){const r=n.yAlign||e.yAlign||c5(t,n);return{xAlign:n.xAlign||e.xAlign||u5(t,e,n,r),yAlign:r}}function f5(t,e){let{x:n,width:r}=t;return e==="right"?n-=r:e==="center"&&(n-=r/2),n}function h5(t,e,n){let{y:r,height:s}=t;return e==="top"?r+=n:e==="bottom"?r-=s+n:r-=s/2,r}function gm(t,e,n,r){const{caretSize:s,caretPadding:o,cornerRadius:i}=t,{xAlign:a,yAlign:l}=n,c=s+o,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=cs(i);let m=f5(e,a);const p=h5(e,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(d,f)+s:a==="right"&&(m+=Math.max(u,g)+s),{x:Zt(m,0,r.width-e.width),y:Zt(p,0,r.height-e.height)}}function wa(t,e,n){const r=gn(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function pm(t){return Vn([],Xn(t))}function g5(t,e,n){return ds(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function mm(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const bm={beforeTitle:Wn,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return n[e.dataIndex]}return""},afterTitle:Wn,beforeBody:Wn,beforeLabel:Wn,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return ct(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Wn,afterBody:Wn,beforeFooter:Wn,footer:Wn,afterFooter:Wn};function Qt(t,e,n,r){const s=t[e].call(n,r);return typeof s>"u"?bm[e].call(n,r):s}class hd extends Ar{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,o=new w0(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=g5(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:r}=n,s=Qt(r,"beforeTitle",this,e),o=Qt(r,"title",this,e),i=Qt(r,"afterTitle",this,e);let a=[];return a=Vn(a,Xn(s)),a=Vn(a,Xn(o)),a=Vn(a,Xn(i)),a}getBeforeBody(e,n){return pm(Qt(n.call
Line truncated
|
|
|
|
|
//# sourceMappingURL=components.iife.js.map
|