@stlhorizon/vue-ui 3.7.6 → 3.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -604,7 +604,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
604
604
  <svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
605
605
  <path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" />
606
606
  </svg>
607
- `},a=t,o=e.ref(!1),r=()=>o.value=!o.value,l=D.cva("",{variants:{variant:{default:"",bordered:"border border-slate-200 rounded-lg overflow-hidden",filled:"bg-slate-50 border border-slate-200 rounded-lg overflow-hidden",flush:""}}}),s=D.cva("flex items-center justify-between w-full text-left transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",{variants:{size:{sm:"p-3 text-sm",md:"p-4 text-base",lg:"p-6 text-lg"}}}),d=D.cva("overflow-hidden text-slate-600 border-t border-slate-200",{variants:{size:{sm:"p-3 text-sm",md:"p-4 text-base",lg:"p-6 text-lg"}}}),m=e.computed(()=>w(l({variant:a.variant}))),p=e.computed(()=>w(s({size:a.size}))),v=e.computed(()=>w(d({size:a.size})));return(y,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(m.value)},[e.createVNode(J,{class:e.normalizeClass(p.value),"aria-expanded":o.value,onClick:r},{default:e.withCtx(()=>[e.renderSlot(y.$slots,"header",{isOpen:o.value}),e.createVNode(n,{class:e.normalizeClass(e.unref(w)("w-5 h-5 transition-transform ml-2",{"rotate-180":o.value}))},null,8,["class"])]),_:3},8,["class","aria-expanded"]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-96","leave-active-class":"transition-all duration-200 ease-in","leave-from-class":"opacity-100 max-h-96","leave-to-class":"opacity-0 max-h-0"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(v.value)},[e.renderSlot(y.$slots,"content",{isOpen:o.value})],2)):e.createCommentVNode("",!0)]),_:3})],2))}},gu={class:"relative w-full"},vu={class:"relative"},hu=["id","value","disabled","placeholder","required","aria-describedby"],bu={class:"flex items-center justify-between mb-3"},yu={class:"text-sm font-medium"},xu={class:"grid grid-cols-7 gap-1 mb-2"},ku={class:"grid grid-cols-7 gap-1"},wu=["disabled","onClick"],Cu={key:0,class:"mt-4 pt-3 border-t border-slate-200"},To={__name:"Calendar",props:{id:String,modelValue:[String,Date],disabled:Boolean,required:Boolean,min:[String,Date],max:[String,Date],placeholder:{type:String,default:"Select date"},format:{type:String,default:"MM/DD/YYYY"},clearable:{type:Boolean,default:!0},showToday:{type:Boolean,default:!0},calendarPosition:{type:String,default:"left-0"},ariaDescribedby:String},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=new Date,s=e.ref(l.getMonth()),d=e.ref(l.getFullYear()),m=e.ref(null),p=["Su","Mo","Tu","We","Th","Fr","Sa"],v=e.computed(()=>new Date(d.value,s.value).toLocaleString("default",{month:"long"})),y=e.computed(()=>new Date(d.value,s.value+1,0).getDate()),S=e.computed(()=>new Date(d.value,s.value,1).getDay()),x=e.computed(()=>{const j=new Date(d.value,s.value,0).getDate(),C=S.value;return Array.from({length:C},($,L)=>j-C+L+1)}),k=e.computed(()=>{const j=x.value.length+y.value,C=j%7===0?0:7-j%7;return Array.from({length:C},($,L)=>L+1)}),f=e.computed(()=>m.value?u(m.value):"");function u(j){if(!j)return"";const C=new Date(j),$=String(C.getMonth()+1).padStart(2,"0"),L=String(C.getDate()).padStart(2,"0"),Y=C.getFullYear();return a.format.replace("MM",$).replace("DD",L).replace("YYYY",Y)}function i(j){if(!j)return null;if(j instanceof Date)return j;const C=new Date(j);return isNaN(C.getTime())?null:C}function c(j){if(!m.value)return!1;const C=new Date(m.value);return C.getDate()===j&&C.getMonth()===s.value&&C.getFullYear()===d.value}function g(j){const C=new Date(d.value,s.value,j);if(a.min){const $=i(a.min);if($&&C<$)return!0}if(a.max){const $=i(a.max);if($&&C>$)return!0}return!1}function b(){a.disabled||(r.value=!r.value)}function h(){r.value=!1}function N(){s.value===0?(s.value=11,d.value--):s.value--}function P(){s.value===11?(s.value=0,d.value++):s.value++}function H(j){if(g(j))return;const C=new Date(d.value,s.value,j);m.value=C,o("update:modelValue",C.toISOString().split("T")[0]),r.value=!1}function _(){s.value=l.getMonth(),d.value=l.getFullYear(),H(l.getDate())}function E(){m.value=null,o("update:modelValue","")}e.watch(()=>a.modelValue,j=>{if(j){const C=i(j);C&&(m.value=C,s.value=C.getMonth(),d.value=C.getFullYear())}else m.value=null},{immediate:!0});function I(j){j.key==="Escape"&&r.value&&h()}return e.onMounted(()=>{document.addEventListener("keydown",I)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",I)}),(j,C)=>(e.openBlock(),e.createElementBlock("div",gu,[e.createElementVNode("div",vu,[e.createElementVNode("input",{id:t.id,type:"text",value:f.value,readonly:"",disabled:t.disabled,placeholder:t.placeholder,required:t.required,"aria-describedby":t.ariaDescribedby,class:"w-full px-3 py-2 pr-10 border border-slate-300 rounded-md bg-white text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 cursor-pointer disabled:bg-slate-50 disabled:text-slate-500 disabled:cursor-not-allowed",onClick:b},null,8,hu),C[2]||(C[2]=e.createElementVNode("div",{class:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"},[e.createElementVNode("svg",{class:"w-5 h-5 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})])],-1)),t.clearable&&f.value&&!t.disabled?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute right-9 top-1/2 -translate-y-1/2 p-1 hover:bg-slate-100 rounded","aria-label":"Clear date",onClick:e.withModifiers(E,["stop"])},[...C[1]||(C[1]=[e.createElementVNode("svg",{class:"w-4 h-4 text-slate-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute z-[99999] mt-2 bg-white border border-slate-200 rounded-lg shadow-lg p-4",t.calendarPosition]),onClick:C[0]||(C[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",bu,[e.createElementVNode("button",{type:"button",class:"p-1 hover:bg-gray-100 rounded","aria-label":"Previous Month",onClick:N},[...C[3]||(C[3]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 18l-6-6 6-6"})],-1)])]),e.createElementVNode("div",yu,e.toDisplayString(v.value)+" "+e.toDisplayString(d.value),1),e.createElementVNode("button",{type:"button",class:"p-1 hover:bg-gray-100 rounded","aria-label":"Next Month",onClick:P},[...C[4]||(C[4]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 18l6-6-6-6"})],-1)])])]),e.createElementVNode("div",xu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(p,$=>e.createElementVNode("div",{key:$,class:"text-center text-xs font-medium text-slate-600 py-1"},e.toDisplayString($),1)),64))]),e.createElementVNode("div",ku,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,($,L)=>(e.openBlock(),e.createElementBlock("div",{key:"prev-"+L,class:"text-center text-sm text-slate-300 py-2"},e.toDisplayString($),1))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,$=>(e.openBlock(),e.createElementBlock("button",{key:$,type:"button",disabled:g($),class:e.normalizeClass(["w-8 h-8 text-sm rounded flex items-center justify-center",c($)?"bg-blue-500 text-white":"hover:bg-gray-100",g($)?"text-gray-300 cursor-not-allowed":""]),onClick:L=>H($)},e.toDisplayString($),11,wu))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,($,L)=>(e.openBlock(),e.createElementBlock("div",{key:"next-"+L,class:"text-center text-sm text-slate-300 py-2"},e.toDisplayString($),1))),128))]),t.showToday?(e.openBlock(),e.createElementBlock("div",Cu,[e.createElementVNode("button",{type:"button",class:"w-full px-3 py-2 text-sm font-medium text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",onClick:_}," Today ")])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:1}),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-[99998]",onClick:h})):e.createCommentVNode("",!0)]))}},Bu={class:"flex items-start justify-between"},Vu={class:"flex-1 min-w-0"},Su={key:0,class:"flex-shrink-0 ml-4"},Eu="text-lg font-semibold text-slate-900 truncate",Nu="text-sm text-slate-600 mt-1",Ao={__name:"Graph",props:{variant:{type:String,default:"default",validator:t=>["default","outlined","elevated","filled"].includes(t)},padding:{type:String,default:"md",validator:t=>["none","sm","md","lg","xl"].includes(t)},title:String,description:String},setup(t){const n=D.cva("rounded-lg overflow-hidden transition-all duration-200",{variants:{variant:{default:"bg-white border border-slate-200",outlined:"bg-white border-2 border-slate-300",elevated:"bg-white shadow-lg border border-slate-100",filled:"bg-slate-50 border border-slate-200"},padding:{none:"",sm:"p-3",md:"p-4",lg:"p-6",xl:"p-8"}},defaultVariants:{variant:"default",padding:"md"}}),a=D.cva("border-b border-slate-100 last:border-b-0",{variants:{padding:{none:"p-4 pb-0",sm:"px-3 pt-3",md:"px-4 pt-4",lg:"px-6 pt-6",xl:"px-8 pt-8"}}}),o=D.cva("border-b border-slate-100",{variants:{padding:{none:"p-4 pb-0",sm:"px-3 py-3",md:"px-4 py-4",lg:"px-6 py-6",xl:"px-8 py-8"}}}),r=D.cva("",{variants:{padding:{none:"p-4",sm:"p-3",md:"p-4",lg:"p-6",xl:"p-8"}}}),l=D.cva("border-t border-slate-100 bg-slate-50/50",{variants:{padding:{none:"p-4 pt-0",sm:"px-3 pb-3",md:"px-4 pb-4",lg:"px-6 pb-6",xl:"px-8 pb-8"}}}),s=D.cva("border-t border-slate-100 bg-slate-50/50",{variants:{padding:{none:"p-4 pt-0",sm:"px-3 pb-3",md:"px-4 pb-4",lg:"px-6 pb-6",xl:"px-8 pb-8"}}});return(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(w)(e.unref(n)({variant:t.variant,padding:t.padding})))},[d.$slots.header||t.title||t.description?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(w)(e.unref(a)({padding:t.padding})))},[e.renderSlot(d.$slots,"header",{},()=>[e.createElementVNode("div",Bu,[e.createElementVNode("div",Vu,[t.title?(e.openBlock(),e.createElementBlock("h3",{key:0,class:e.normalizeClass(Eu)},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(Nu)},e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),d.$slots.actions?(e.openBlock(),e.createElementBlock("div",Su,[e.renderSlot(d.$slots,"actions")])):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),d.$slots.filters?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(w)(e.unref(o)({padding:t.padding})))},[e.renderSlot(d.$slots,"filters")],2)):e.createCommentVNode("",!0),d.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(w)(e.unref(r)({padding:t.padding})))},[e.renderSlot(d.$slots,"default")],2)):e.createCommentVNode("",!0),d.$slots.legend?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(e.unref(w)(e.unref(l)({padding:t.padding})))},[e.renderSlot(d.$slots,"legend")],2)):e.createCommentVNode("",!0),d.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(e.unref(w)(e.unref(s)({padding:t.padding})))},[e.renderSlot(d.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}},$u={class:"w-full h-full"},zu=["width","height","viewBox"],Du={key:0},Tu=["x1","y1","x2","y2","stroke"],Au=["x","y","width","height","fill","onMouseenter"],Fu={key:1},Pu=["x","y"],Lu={key:2},Mu=["x","y"],ju={key:3},Iu=["x","y","width","height","fill","stroke"],Ou=["x","y"],Fo={__name:"BarChart",props:{data:{type:Array,required:!0},labels:{type:Array,default:()=>[]},colors:{type:Array,default:()=>["#3b82f6","#ef4444","#10b981","#f59e0b","#8b5cf6"]},width:{type:Number,default:400},height:{type:Number,default:300},padding:{type:Object,default:()=>({top:20,right:20,bottom:60,left:60})},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},gridColor:{type:String,default:"#e5e7eb"},barClasses:{type:String,default:"transition-all duration-200 hover:opacity-80 cursor-pointer"},axisLabelClasses:{type:String,default:"fill-slate-600 text-xs font-medium"},tooltipBackground:{type:String,default:"#1f2937"},tooltipBorder:{type:String,default:"#374151"},tooltipTextClasses:{type:String,default:"fill-white text-xs font-medium"},maxValue:{type:Number,default:null}},emits:["bar-click","bar-hover"],setup(t,{emit:n}){const a=t,o=n,r=e.ref({visible:!1,x:0,y:0,width:0,height:0,content:""}),l=e.computed(()=>a.maxValue||Math.max(...a.data)),s=e.computed(()=>(a.width-a.padding.left-a.padding.right)/a.data.length*.8),d=e.computed(()=>(a.width-a.padding.left-a.padding.right)/a.data.length*.2),m=e.computed(()=>{const u=[],i=a.height-a.padding.top-a.padding.bottom,c=5;for(let g=0;g<=c;g++){const b=a.padding.top+i/c*g;u.push(b)}return u}),p=u=>a.padding.left+u*(s.value+d.value)+d.value/2,v=u=>{const i=a.height-a.padding.top-a.padding.bottom,c=i/l.value;return a.padding.top+i-u*c},y=u=>{const c=(a.height-a.padding.top-a.padding.bottom)/l.value;return u*c},S=u=>a.colors[u%a.colors.length],x=u=>{const i=a.height-a.padding.top-a.padding.bottom,c=(a.height-a.padding.bottom-u)/i*l.value;return Math.round(c)},k=(u,i,c)=>{const g=u.target.getBoundingClientRect(),b=a.labels[c]||`Item ${c+1}`;r.value={visible:!0,x:g.left+g.width/2,y:g.top,width:80,height:24,content:`${b}: ${i}`},o("bar-hover",{value:i,index:c,label:b})},f=()=>{r.value.visible=!1};return(u,i)=>(e.openBlock(),e.createElementBlock("div",$u,[(e.openBlock(),e.createElementBlock("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,class:"overflow-visible"},[t.showGrid?(e.openBlock(),e.createElementBlock("g",Du,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,c=>(e.openBlock(),e.createElementBlock("line",{key:`grid-${c}`,x1:t.padding.left,y1:c,x2:t.width-t.padding.right,y2:c,stroke:t.gridColor,"stroke-width":"1","stroke-dasharray":"2,2"},null,8,Tu))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(c,g)=>(e.openBlock(),e.createElementBlock("rect",{key:`bar-${g}`,x:p(g),y:v(c),width:s.value,height:y(c),fill:S(g),class:e.normalizeClass(t.barClasses),onMouseenter:b=>k(b,c,g),onMouseleave:f},null,42,Au))),128))]),t.showXAxis?(e.openBlock(),e.createElementBlock("g",Fu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.labels,(c,g)=>(e.openBlock(),e.createElementBlock("text",{key:`xlabel-${g}`,x:p(g)+s.value/2,y:t.height-t.padding.bottom+20,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"middle"},e.toDisplayString(c),11,Pu))),128))])):e.createCommentVNode("",!0),t.showYAxis?(e.openBlock(),e.createElementBlock("g",Lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,c=>(e.openBlock(),e.createElementBlock("text",{key:`ylabel-${c}`,x:t.padding.left-10,y:c+4,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"end"},e.toDisplayString(x(c)),11,Mu))),128))])):e.createCommentVNode("",!0),r.value.visible?(e.openBlock(),e.createElementBlock("g",ju,[e.createElementVNode("rect",{x:r.value.x-r.value.width/2,y:r.value.y-r.value.height-10,width:r.value.width,height:r.value.height,fill:t.tooltipBackground,stroke:t.tooltipBorder,"stroke-width":"1",rx:"4"},null,8,Iu),e.createElementVNode("text",{x:r.value.x,y:r.value.y-r.value.height/2-2,class:e.normalizeClass(t.tooltipTextClasses),"text-anchor":"middle"},e.toDisplayString(r.value.content),11,Ou)])):e.createCommentVNode("",!0)],8,zu))]))}},Ru={class:"w-full h-full"},_u=["width","height","viewBox"],Uu={key:0},qu=["x1","y1","x2","y2","stroke"],Hu=["d","stroke","stroke-width"],Yu={key:1},Wu=["cx","cy","r","fill","stroke","onMouseenter"],Gu=["d","fill","fill-opacity"],Ku={key:3},Xu=["x","y"],Qu={key:4},Ju=["x","y"],Zu={key:5},em=["x","y","width","height","fill","stroke"],tm=["x","y"],Po={__name:"LineChart",props:{data:{type:Array,required:!0},labels:{type:Array,default:()=>[]},width:{type:Number||String,default:400},height:{type:Number,default:300},padding:{type:Object,default:()=>({top:20,right:20,bottom:60,left:60})},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},showPoints:{type:Boolean,default:!0},fillArea:{type:Boolean,default:!1},gridColor:{type:String,default:"#e5e7eb"},lineColor:{type:String,default:"#3b82f6"},strokeWidth:{type:Number,default:2},pointRadius:{type:Number,default:4},pointColor:{type:String,default:"#ffffff"},fillColor:{type:String,default:"#3b82f6"},fillOpacity:{type:Number,default:.1},lineClasses:{type:String,default:"transition-all duration-200"},pointClasses:{type:String,default:"transition-all duration-200 hover:r-6 cursor-pointer"},axisLabelClasses:{type:String,default:"fill-slate-600 text-xs font-medium"},tooltipBackground:{type:String,default:"#1f2937"},tooltipBorder:{type:String,default:"#374151"},tooltipTextClasses:{type:String,default:"fill-white text-xs font-medium"},maxValue:{type:Number,default:null}},emits:["point-click","point-hover"],setup(t,{emit:n}){const a=t,o=n,r=e.ref({visible:!1,x:0,y:0,width:0,height:0,content:""}),l=e.computed(()=>a.maxValue||Math.max(...a.data)),s=e.computed(()=>a.data.map((f,u)=>({x:v(u),y:y(f),value:f}))),d=e.computed(()=>s.value.length===0?"":s.value.map((u,i)=>`${i===0?"M":"L"} ${u.x} ${u.y}`).join(" ")),m=e.computed(()=>{if(s.value.length===0)return"";const f=s.value.map((c,g)=>`${g===0?"M":"L"} ${c.x} ${c.y}`).join(" "),u=a.height-a.padding.bottom,i=`L ${s.value[s.value.length-1].x} ${u} L ${s.value[0].x} ${u} Z`;return f+" "+i}),p=e.computed(()=>{const f=[],u=a.height-a.padding.top-a.padding.bottom,i=5;for(let c=0;c<=i;c++){const g=a.padding.top+u/i*c;f.push(g)}return f}),v=f=>{const i=(a.width-a.padding.left-a.padding.right)/(a.data.length-1||1);return a.padding.left+f*i},y=f=>{const u=a.height-a.padding.top-a.padding.bottom,i=u/l.value;return a.padding.top+u-f*i},S=f=>{const u=a.height-a.padding.top-a.padding.bottom,i=(a.height-a.padding.bottom-f)/u*l.value;return Math.round(i)},x=(f,u,i)=>{const c=f.target.getBoundingClientRect(),g=a.labels[i]||`Point ${i+1}`;r.value={visible:!0,x:c.left+c.width/2,y:c.top,width:80,height:24,content:`${g}: ${u}`},o("point-hover",{value:u,index:i,label:g})},k=()=>{r.value.visible=!1};return(f,u)=>(e.openBlock(),e.createElementBlock("div",Ru,[(e.openBlock(),e.createElementBlock("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,class:"overflow-visible"},[t.showGrid?(e.openBlock(),e.createElementBlock("g",Uu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,i=>(e.openBlock(),e.createElementBlock("line",{key:`grid-${i}`,x1:t.padding.left,y1:i,x2:t.width-t.padding.right,y2:i,stroke:t.gridColor,"stroke-width":"1","stroke-dasharray":"2,2"},null,8,qu))),128))])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:d.value,stroke:t.lineColor,"stroke-width":t.strokeWidth,fill:"none",class:e.normalizeClass(t.lineClasses)},null,10,Hu),t.showPoints?(e.openBlock(),e.createElementBlock("g",Yu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(i,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:i.x,cy:i.y,r:t.pointRadius,fill:t.pointColor,stroke:t.lineColor,"stroke-width":2,class:e.normalizeClass(t.pointClasses),onMouseenter:g=>x(g,i.value,c),onMouseleave:k},null,42,Wu))),128))])):e.createCommentVNode("",!0),t.fillArea?(e.openBlock(),e.createElementBlock("path",{key:2,d:m.value,fill:t.fillColor,"fill-opacity":t.fillOpacity},null,8,Gu)):e.createCommentVNode("",!0),t.showXAxis?(e.openBlock(),e.createElementBlock("g",Ku,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.labels,(i,c)=>(e.openBlock(),e.createElementBlock("text",{key:`xlabel-${c}`,x:v(c),y:t.height-t.padding.bottom+20,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"middle"},e.toDisplayString(i),11,Xu))),128))])):e.createCommentVNode("",!0),t.showYAxis?(e.openBlock(),e.createElementBlock("g",Qu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,i=>(e.openBlock(),e.createElementBlock("text",{key:`ylabel-${i}`,x:t.padding.left-10,y:i+4,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"end"},e.toDisplayString(S(i)),11,Ju))),128))])):e.createCommentVNode("",!0),r.value.visible?(e.openBlock(),e.createElementBlock("g",Zu,[e.createElementVNode("rect",{x:r.value.x-r.value.width/2,y:r.value.y-r.value.height-10,width:r.value.width,height:r.value.height,fill:t.tooltipBackground,stroke:t.tooltipBorder,"stroke-width":"1",rx:"4"},null,8,em),e.createElementVNode("text",{x:r.value.x,y:r.value.y-r.value.height/2-2,class:e.normalizeClass(t.tooltipTextClasses),"text-anchor":"middle"},e.toDisplayString(r.value.content),11,tm)])):e.createCommentVNode("",!0)],8,_u))]))}},am={class:"bg-white border-b border-gray-200"},nm={key:0,class:"flex items-center gap-3 min-w-64"},om={class:"relative flex-1"},rm={class:"relative flex-1"},lm={key:1,class:"min-w-40"},sm={class:"relative"},im={key:2,class:"min-w-40"},cm={class:"relative"},dm=["value"],um={key:3,class:"flex items-center gap-2"},mm={class:"flex items-center gap-3 ml-auto"},fm={class:"flex items-center gap-3 flex-wrap"},pm=["onClick"],Lo={__name:"GraphFilters",props:{showDateFilter:{type:Boolean,default:!0},showChartTypeFilter:{type:Boolean,default:!0},showExport:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!0},dataSources:{type:Array,default:()=>[]},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:dateFrom","update:dateTo","update:chartType","update:dataSource","export","refresh","clear-filters"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),l=e.ref(""),s=e.ref("bar"),d=e.ref(""),m=D.cva("flex flex-wrap items-center gap-4",{variants:{variant:{default:"bg-white",minimal:"bg-transparent",bordered:"bg-gray-50"},padding:{compact:"px-4 py-3",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),p=e.computed(()=>r.value||l.value||d.value),v=e.computed(()=>{const _=[];if(r.value||l.value){let E="";r.value&&l.value?E=`${r.value} to ${l.value}`:r.value?E=`From ${r.value}`:l.value&&(E=`Until ${l.value}`),E&&_.push({key:"date",label:"Date Range",value:E,icon:"calendar"})}if(d.value){const E=a.dataSources.find(I=>I.value===d.value);_.push({key:"dataSource",label:"Data Source",value:E?.label||d.value,icon:"database"})}return _}),y=e.computed(()=>w(m({variant:a.variant,padding:a.padding}))),S=e.computed(()=>"w-full pl-10 pr-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm"),x=e.computed(()=>"w-full pr-8 appearance-none border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm py-2 pl-3"),k=e.computed(()=>"text-gray-700 hover:text-gray-900 border border-gray-200 hover:bg-gray-50 bg-white px-3 py-2 rounded-lg text-sm font-medium transition-all"),f=e.computed(()=>"text-white bg-blue-600 hover:bg-blue-700 border border-blue-600 px-3 py-2 rounded-lg text-sm font-medium transition-all"),u=e.computed(()=>"text-gray-700 hover:text-gray-900 border border-gray-200 hover:bg-gray-50 bg-white px-3 py-2 rounded-lg text-sm font-medium transition-all"),i=e.computed(()=>"px-6 py-3 bg-blue-50 border-t border-blue-100"),c=e.computed(()=>"text-sm font-semibold text-blue-800"),g=e.computed(()=>"flex items-center gap-1.5 bg-white border border-blue-200 text-blue-800 px-3 py-1.5 rounded-full text-sm font-medium"),b=e.computed(()=>"text-blue-600 hover:text-blue-800 ml-1 hover:bg-blue-100 rounded-full p-0.5 transition-all"),h=_=>{s.value=_.target.value,o("update:chartType",_.target.value)},N=_=>{d.value=_.target.value,o("update:dataSource",_.target.value)},P=()=>{r.value="",l.value="",d.value="",o("clear-filters")},H=_=>{switch(_){case"date":r.value="",l.value="";break;case"dataSource":d.value="";break}};return e.watch(()=>r.value,_=>{o("update:dateFrom",_)}),e.watch(()=>l.value,_=>{o("update:dateTo",_)}),(_,E)=>(e.openBlock(),e.createElementBlock("div",am,[e.createElementVNode("div",{class:e.normalizeClass(y.value)},[t.showDateFilter?(e.openBlock(),e.createElementBlock("div",nm,[e.createElementVNode("div",om,[e.createVNode(M,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E[0]||(E[0]=I=>r.value=I),type:"date",class:e.normalizeClass(S.value),placeholder:"From date"},null,2),[[e.vModelText,r.value]])]),E[6]||(E[6]=e.createElementVNode("span",{class:"text-gray-500 text-sm"},"to",-1)),e.createElementVNode("div",rm,[e.createVNode(M,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E[1]||(E[1]=I=>l.value=I),type:"date",class:e.normalizeClass(S.value),placeholder:"To date"},null,2),[[e.vModelText,l.value]])])])):e.createCommentVNode("",!0),t.showChartTypeFilter?(e.openBlock(),e.createElementBlock("div",lm,[e.createElementVNode("div",sm,[e.createVNode(ue,{modelValue:s.value,"onUpdate:modelValue":E[2]||(E[2]=I=>s.value=I),class:e.normalizeClass(x.value),onChange:h},{default:e.withCtx(()=>[...E[7]||(E[7]=[e.createElementVNode("option",{value:"bar"}," Bar Chart ",-1),e.createElementVNode("option",{value:"line"}," Line Chart ",-1),e.createElementVNode("option",{value:"pie"}," Pie Chart ",-1)])]),_:1},8,["modelValue","class"]),e.createVNode(M,{icon:"chart-bar",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])])):e.createCommentVNode("",!0),t.dataSources.length>0?(e.openBlock(),e.createElementBlock("div",im,[e.createElementVNode("div",cm,[e.createVNode(ue,{modelValue:d.value,"onUpdate:modelValue":E[3]||(E[3]=I=>d.value=I),class:e.normalizeClass(x.value),onChange:N},{default:e.withCtx(()=>[E[8]||(E[8]=e.createElementVNode("option",{value:""}," All Sources ",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataSources,I=>(e.openBlock(),e.createElementBlock("option",{key:I.value,value:I.value},e.toDisplayString(I.label),9,dm))),128))]),_:1},8,["modelValue","class"]),e.createVNode(M,{icon:"database",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])])):e.createCommentVNode("",!0),_.$slots.filters?(e.openBlock(),e.createElementBlock("div",um,[e.renderSlot(_.$slots,"filters")])):e.createCommentVNode("",!0),e.createElementVNode("div",mm,[p.value?(e.openBlock(),e.createBlock(J,{key:0,class:e.normalizeClass(k.value),onClick:P},{default:e.withCtx(()=>[e.createVNode(M,{icon:"rotate-left",class:"w-4 h-4 mr-2"}),E[9]||(E[9]=e.createTextVNode(" Clear Filters ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showExport?(e.openBlock(),e.createBlock(J,{key:1,class:e.normalizeClass(f.value),onClick:E[4]||(E[4]=I=>_.$emit("export"))},{default:e.withCtx(()=>[e.createVNode(M,{icon:"download",class:"w-4 h-4 mr-2"}),E[10]||(E[10]=e.createTextVNode(" Export ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showRefresh?(e.openBlock(),e.createBlock(J,{key:2,class:e.normalizeClass(u.value),onClick:E[5]||(E[5]=I=>_.$emit("refresh"))},{default:e.withCtx(()=>[e.createVNode(M,{icon:"sync",class:"w-4 h-4 mr-2"}),E[11]||(E[11]=e.createTextVNode(" Refresh ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0)])],2),v.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(i.value)},[e.createElementVNode("div",fm,[e.createElementVNode("span",{class:e.normalizeClass(c.value)},"Active filters:",2),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,I=>(e.openBlock(),e.createElementBlock("div",{key:I.key,class:e.normalizeClass(g.value)},[e.createVNode(M,{icon:I.icon,class:"w-3 h-3"},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(I.label)+": "+e.toDisplayString(I.value),1),e.createElementVNode("button",{class:e.normalizeClass(b.value),onClick:j=>H(I.key)},[e.createVNode(M,{icon:"xmark",class:"w-3 h-3"})],10,pm)],2))),128))])],2)):e.createCommentVNode("",!0)]))}},gm={class:"flex items-start justify-between"},vm={key:0,class:"flex items-center gap-2"},la={__name:"DataTableHeader",props:{title:{type:String,default:null},description:{type:String,default:null},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},setup(t){const n=t,a=D.cva("border-b border-slate-200",{variants:{variant:{default:"bg-white",minimal:"bg-transparent border-none",bordered:"bg-slate-50 border-2"},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),o=D.cva("font-semibold text-slate-900",{variants:{size:{sm:"text-base",md:"text-lg",lg:"text-xl"}},defaultVariants:{size:"md"}}),r=D.cva("text-slate-600 mt-1",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),l=e.computed(()=>w(a({variant:n.variant,padding:n.padding}))),s=e.computed(()=>w(o({size:"md"}))),d=e.computed(()=>w(r({size:"md"})));return(m,p)=>t.title||t.description||m.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(l.value)},[e.renderSlot(m.$slots,"header",{},()=>[e.createElementVNode("div",gm,[e.createElementVNode("div",null,[t.title?(e.openBlock(),e.createBlock(at,{key:0,class:e.normalizeClass(s.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1},8,["class"])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createBlock(at,{key:1,class:e.normalizeClass(d.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),_:1},8,["class"])):e.createCommentVNode("",!0)]),m.$slots.filters?(e.openBlock(),e.createElementBlock("div",vm,[e.renderSlot(m.$slots,"filters")])):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0)}},hm=["onClick"],bm={key:1},ym={class:"p-2"},xm={class:"text-sm font-bold text-gray-700 whitespace-pre-wrap break-words"},sa={__name:"DataTableRow",props:{item:{type:Object,required:!0},columns:{type:Array,required:!0},index:{type:Number,required:!0},selectable:{type:Boolean,default:!1},isSelected:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},clickableRows:{type:Boolean,default:!1},density:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},variant:{type:String,default:"default",validator:t=>["default","bordered","minimal"].includes(t)}},emits:["toggle-selection","row-click"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(""),s=D.cva("transition-colors",{variants:{striped:{true:"odd:bg-slate-50/50",false:""},hoverable:{true:"hover:bg-slate-50",false:""},clickable:{true:"cursor-pointer hover:bg-slate-100",false:""},selected:{true:"bg-blue-50 border-blue-200",false:""},variant:{default:"",bordered:"border-b border-slate-200",minimal:"border-b border-slate-100"}},compoundVariants:[{hoverable:!0,clickable:!0,class:"hover:bg-slate-100"}],defaultVariants:{striped:!1,hoverable:!0,clickable:!1,selected:!1,variant:"default"}}),d=D.cva("whitespace-nowrap text-sm text-slate-900",{variants:{density:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{density:"normal",align:"left"}}),m=b=>typeof b=="string"?b:b?.key||b?.field||"unknown",p=(b,h)=>{const N=m(h);return typeof h=="object"&&h.accessor?h.accessor(b):N&&N.includes(".")?N.split(".").reduce((P,H)=>P?.[H],b):b?.[N]},v=(b,h)=>{const N=p(b,h);return typeof h=="object"&&h.formatter?h.formatter(N,b):N==null?"":N instanceof Date?N.toLocaleDateString():Array.isArray(N)?N.join(", "):N},y=(b,h=10)=>{if(!b)return b;const N=b.toString().split(" ");return N.length<=h?b:N.slice(0,h).join(" ")+"..."},S=b=>{l.value=b,r.value=!0},x=()=>{r.value=!1,l.value=""},k=()=>{a.clickableRows&&o("row-click",{item:a.item,index:a.index})},f=b=>typeof b=="object"&&b.align?b.align:"left",u=e.computed(()=>w(s({striped:a.striped,hoverable:a.hoverable&&!a.clickableRows,clickable:a.clickableRows,selected:a.isSelected,variant:a.variant}))),i=b=>{const h=f(b);return w(d({density:a.density,align:h}),b.cellClasses)},c=e.computed(()=>w(d({density:a.density}),"w-12")),g=e.computed(()=>w(d({density:a.density,align:"right"}),"font-medium"));return(b,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("tr",{class:e.normalizeClass(u.value),onClick:k},[t.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(c.value)},[e.createVNode(it,{"model-value":t.isSelected,"onUpdate:modelValue":h[0]||(h[0]=N=>b.$emit("toggle-selection",t.item))},null,8,["model-value"])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,N=>(e.openBlock(),e.createElementBlock("td",{key:m(N),class:e.normalizeClass(i(N))},[e.renderSlot(b.$slots,`cell-${m(N)}`,{item:t.item,value:p(t.item,N),column:N,index:t.index},()=>[v(t.item,N).toString().split(" ").length>10?(e.openBlock(),e.createElementBlock("span",{key:0,class:"cursor-pointer text-blue-600 hover:text-blue-800",onClick:e.withModifiers(P=>S(v(t.item,N)),["stop"])},e.toDisplayString(y(v(t.item,N))),9,hm)):(e.openBlock(),e.createElementBlock("span",bm,e.toDisplayString(v(t.item,N)),1))])],2))),128)),b.$slots.actions?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(g.value)},[e.renderSlot(b.$slots,"actions",{item:t.item,index:t.index})],2)):e.createCommentVNode("",!0)],2),e.createVNode(mt,{modelValue:r.value,"onUpdate:modelValue":h[1]||(h[1]=N=>r.value=N),size:"lg",height:"auto",onClose:x},{default:e.withCtx(()=>[e.createElementVNode("div",ym,[h[2]||(h[2]=e.createElementVNode("h3",{class:"text-lg font-semibold mb-4"},"Full Text",-1)),e.createElementVNode("div",xm,e.toDisplayString(l.value),1)])]),_:1},8,["modelValue"])],64))}},km={class:"flex items-center justify-between"},wm={key:0,class:"text-sm text-slate-600"},Cm={key:1,class:"text-sm text-slate-600"},Bm={key:2,class:"flex items-center gap-4"},Vm={key:3,class:"flex items-center gap-4"},Sm={class:"flex items-center gap-2"},Em={class:"flex items-center gap-1"},Nm=["disabled"],$m=["disabled"],zm={class:"flex items-center gap-1"},Dm=["onClick"],Tm=["disabled"],Am=["disabled"],Fm={class:"text-sm text-slate-600 ml-4"},ia={__name:"DataTablePagination",props:{currentPage:{type:Number,required:!0},totalPages:{type:Number,required:!0},total:{type:Number,required:!0},pageSize:{type:Number,required:!0},showPagination:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},selectedCount:{type:Number,default:0},pageSizeOptions:{type:Array,default:()=>[5,10,25,50,100]},maxVisiblePages:{type:Number,default:7},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:currentPage","update:pageSize"],setup(t){const n=t,a=D.cva("border-t border-slate-200",{variants:{variant:{default:"bg-slate-50",minimal:"bg-transparent border-slate-100",bordered:"bg-slate-100 border-t-2 border-slate-300"},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),o=D.cva("text-sm font-medium border rounded-md transition-colors duration-200",{variants:{state:{active:"bg-blue-600 text-white border-blue-600",inactive:"bg-white text-slate-700 border-slate-300 hover:bg-slate-50",disabled:"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed"},size:{sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"}},defaultVariants:{state:"inactive",size:"md"}}),r=D.cva("text-slate-700",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{size:"md"}}),l=D.cva("border border-slate-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm min-w-[60px] focus:border-transparent",{variants:{size:{sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"}},defaultVariants:{size:"sm"}}),s=e.computed(()=>(n.currentPage-1)*n.pageSize+1),d=e.computed(()=>Math.min(n.currentPage*n.pageSize,n.total)),m=e.computed(()=>{const x=[],k=n.totalPages,f=n.currentPage,u=n.maxVisiblePages;if(k<=u)for(let i=1;i<=k;i++)x.push(i);else{const i=Math.floor(u/2);let c=Math.max(1,f-i),g=Math.min(k,c+u-1);g-c+1<u&&(c=Math.max(1,g-u+1));for(let b=c;b<=g;b++)x.push(b)}return x}),p=e.computed(()=>w(a({variant:n.variant,padding:n.padding}))),v=e.computed(()=>w(r({size:"md"}))),y=e.computed(()=>w(l({size:"sm"}))),S=(x,k)=>{let f="inactive";return k?f="disabled":x&&(f="active"),w(o({state:f,size:"md"}))};return(x,k)=>t.showPagination||x.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(p.value)},[e.createElementVNode("div",km,[t.selectable&&t.selectedCount>0?(e.openBlock(),e.createElementBlock("div",wm,e.toDisplayString(t.selectedCount)+" of "+e.toDisplayString(t.total)+" selected ",1)):(e.openBlock(),e.createElementBlock("div",Cm," Showing "+e.toDisplayString(s.value)+" to "+e.toDisplayString(d.value)+" of "+e.toDisplayString(t.total)+" entries ",1)),x.$slots.footer?(e.openBlock(),e.createElementBlock("div",Bm,[e.renderSlot(x.$slots,"footer")])):e.createCommentVNode("",!0),t.showPagination?(e.openBlock(),e.createElementBlock("div",Vm,[e.createElementVNode("div",Sm,[e.createVNode(fe,{for:"pageSize",class:e.normalizeClass(v.value),inline:!0},{default:e.withCtx(()=>[...k[5]||(k[5]=[e.createTextVNode("Show:",-1)])]),_:1},8,["class"]),e.createVNode(ue,{id:"pageSize","model-value":t.pageSize.toString(),class:e.normalizeClass(y.value),"onUpdate:modelValue":k[0]||(k[0]=f=>x.$emit("update:pageSize",parseInt(f)))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pageSizeOptions,f=>(e.openBlock(),e.createBlock(oa,{key:f,value:f.toString(),label:f.toString()},null,8,["value","label"]))),128))]),_:1},8,["model-value","class"])]),e.createElementVNode("div",Em,[e.createElementVNode("button",{disabled:t.currentPage===1,class:e.normalizeClass(S(!1,t.currentPage===1)),title:"First page",onClick:k[1]||(k[1]=f=>x.$emit("update:currentPage",1))},[...k[6]||(k[6]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5"})],-1)])],10,Nm),e.createElementVNode("button",{disabled:t.currentPage===1,class:e.normalizeClass(S(!1,t.currentPage===1)),title:"Previous page",onClick:k[2]||(k[2]=f=>x.$emit("update:currentPage",t.currentPage-1))},[...k[7]||(k[7]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1)])],10,$m),e.createElementVNode("div",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,f=>(e.openBlock(),e.createElementBlock("button",{key:f,class:e.normalizeClass(S(f===t.currentPage,!1)),onClick:u=>x.$emit("update:currentPage",f)},e.toDisplayString(f),11,Dm))),128))]),e.createElementVNode("button",{disabled:t.currentPage===t.totalPages,class:e.normalizeClass(S(!1,t.currentPage===t.totalPages)),title:"Next page",onClick:k[3]||(k[3]=f=>x.$emit("update:currentPage",t.currentPage+1))},[...k[8]||(k[8]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})],-1)])],10,Tm),e.createElementVNode("button",{disabled:t.currentPage===t.totalPages,class:e.normalizeClass(S(!1,t.currentPage===t.totalPages)),title:"Last page",onClick:k[4]||(k[4]=f=>x.$emit("update:currentPage",t.totalPages))},[...k[9]||(k[9]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5"})],-1)])],10,Am)]),e.createElementVNode("div",Fm," Page "+e.toDisplayString(t.currentPage)+" of "+e.toDisplayString(t.totalPages),1)])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)}},pt=(t,n)=>{const a=t.__vccOpts||t;for(const[o,r]of n)a[o]=r;return a},Pm={key:0,class:"loader__backdrop"},Lm={class:"loader__container"},Mm={key:0,class:"loader__text loader__text--top"},jm={key:1,class:"loader__spin"},Im={key:2,class:"loader__pulse"},Om={key:3,class:"loader__bounce"},Rm={key:4,class:"loader__ripple"},_m={key:5,class:"loader__bars"},Um={key:6,class:"loader__dots"},qm={key:7,class:"loader__ring"},Hm={key:8,class:"loader__spinner-text"},Ym={key:9,class:"loader__text loader__text--bottom"},Wm={__name:"Loader",props:{loading:{type:Boolean,default:!0},type:{type:String,default:"spin",validator:t=>["spin","pulse","bounce","ripple","bars","dots","ring","spinner-text"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large","xl"].includes(t)},color:{type:String,default:"#3b82f6"},backgroundColor:{type:String,default:"rgba(255, 255, 255, 0.9)"},text:{type:String,default:""},textPosition:{type:String,default:"bottom",validator:t=>["top","bottom"].includes(t)},overlay:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(t){return(n,a)=>t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["loader",`loader--${t.type}`,`loader--${t.size}`,t.overlay?"loader--overlay":"",t.fullscreen?"loader--fullscreen":""]),style:e.normalizeStyle({"--loader-color":t.color,"--loader-bg":t.backgroundColor})},[t.overlay?(e.openBlock(),e.createElementBlock("div",Pm)):e.createCommentVNode("",!0),e.createElementVNode("div",Lm,[t.text&&t.textPosition==="top"?(e.openBlock(),e.createElementBlock("div",Mm,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0),t.type==="spin"?(e.openBlock(),e.createElementBlock("div",jm)):t.type==="pulse"?(e.openBlock(),e.createElementBlock("div",Im)):t.type==="bounce"?(e.openBlock(),e.createElementBlock("div",Om,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(3,o=>e.createElementVNode("div",{key:o,class:"loader__bounce-dot",style:e.normalizeStyle({animationDelay:`${(o-1)*.1}s`})},null,4)),64))])):t.type==="ripple"?(e.openBlock(),e.createElementBlock("div",Rm,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(2,o=>e.createElementVNode("div",{key:o,class:"loader__ripple-ring",style:e.normalizeStyle({animationDelay:`${(o-1)*.5}s`})},null,4)),64))])):t.type==="bars"?(e.openBlock(),e.createElementBlock("div",_m,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,o=>e.createElementVNode("div",{key:o,class:"loader__bar",style:e.normalizeStyle({animationDelay:`${(o-1)*.1}s`})},null,4)),64))])):t.type==="dots"?(e.openBlock(),e.createElementBlock("div",Um,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(3,o=>e.createElementVNode("div",{key:o,class:"loader__dot",style:e.normalizeStyle({animationDelay:`${(o-1)*.16}s`})},null,4)),64))])):t.type==="ring"?(e.openBlock(),e.createElementBlock("div",qm,[...a[0]||(a[0]=[e.createElementVNode("div",{class:"loader__ring-track"},null,-1),e.createElementVNode("div",{class:"loader__ring-fill"},null,-1)])])):t.type==="spinner-text"?(e.openBlock(),e.createElementBlock("div",Hm,[...a[1]||(a[1]=[e.createElementVNode("div",{class:"loader__spinner"},null,-1)])])):e.createCommentVNode("",!0),t.text&&t.textPosition==="bottom"?(e.openBlock(),e.createElementBlock("div",Ym,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0)])],6)):e.createCommentVNode("",!0)}},je=pt(Wm,[["__scopeId","data-v-68532350"]]),Gm={class:"relative"},Km={class:"flex items-center justify-center"},Xm=["onClick"],Qm={class:"flex items-center gap-2"},Jm={key:1,class:"flex flex-col"},Zm={key:1,class:"flex items-center gap-1 justify-center"},ef={key:1,class:"text-xs"},tf={key:2},af=["colspan"],nf={class:"flex flex-col items-center justify-center py-12"},of={class:"text-slate-400 mb-4 flex justify-center"},rf={class:"text-slate-600 text-lg font-medium mb-2"},lf={class:"text-slate-500 text-sm"},sf={__name:"DataTable",props:{data:{type:Array,required:!0},columns:{type:Array,required:!0},title:{type:String,default:null},description:{type:String,default:null},selectable:{type:Boolean,default:!1},selectedItems:{type:Array,default:()=>[]},sortBy:{type:String,default:null},sortOrder:{type:String,default:"asc",validator:t=>["asc","desc"].includes(t)},pageSize:{type:Number,default:10},showPagination:{type:Boolean,default:!0},striped:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},clickableRows:{type:Boolean,default:!1},emptyText:{type:String,default:"No data available"},emptySubtitle:{type:String,default:"Try adjusting your search or filter criteria"},rowKey:{type:String,default:"id"},variant:{type:String,default:"default",validator:t=>["default","bordered","minimal"].includes(t)},density:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},headerVariant:{type:String,default:"default"},headerPadding:{type:String,default:"normal"},paginationVariant:{type:String,default:"default"},paginationPadding:{type:String,default:"normal"},actions:{type:Array,default:()=>[]},showActionsColumn:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},dataLoading:{type:Boolean,default:!1},sortLoading:{type:Boolean,default:!1},paginationLoading:{type:Boolean,default:!1},bulkLoading:{type:Boolean,default:!1},rowLoading:{type:Object,default:()=>({})},loadingType:{type:String,default:"dots",validator:t=>["spin","pulse","bounce","ripple","bars","dots","ring"].includes(t)},loadingSize:{type:String,default:"medium",validator:t=>["small","medium","large","xl"].includes(t)},loadingColor:{type:String,default:"#3b82f6"},loadingText:{type:String,default:"Loading..."},loadingTextPosition:{type:String,default:"bottom",validator:t=>["top","bottom"].includes(t)},loadingBackground:{type:String,default:"rgba(255, 255, 255, 0.95)"},showSkeleton:{type:Boolean,default:!0},skeletonRows:{type:Number,default:5}},emits:["selection-change","sort-change","row-click","page-change","page-size-change","refresh","action"],setup(t,{expose:n,emit:a}){const o=t,r=a,l=e.ref(1),s=e.ref(o.pageSize),d=e.ref(o.sortBy),m=e.ref(o.sortOrder),p=D.cva("bg-white border border-slate-200 rounded-lg overflow-hidden",{variants:{variant:{default:"shadow-sm",bordered:"border-2 border-slate-300",minimal:"border-none shadow-none bg-transparent"}},defaultVariants:{variant:"default"}}),v=D.cva("min-w-full",{variants:{variant:{default:"divide-y divide-slate-200",bordered:"border-collapse [&_td]:border [&_th]:border",minimal:"divide-y divide-slate-100"}},defaultVariants:{variant:"default"}}),y=D.cva("",{variants:{variant:{default:"bg-slate-50",bordered:"bg-slate-100 border-b-2 border-slate-300",minimal:"bg-transparent border-b border-slate-200"}},defaultVariants:{variant:"default"}}),S=D.cva("divide-y",{variants:{variant:{default:"bg-white divide-slate-200",bordered:"bg-white divide-slate-300",minimal:"bg-transparent divide-slate-100"}},defaultVariants:{variant:"default"}}),x=e.computed(()=>{let T=[...o.data];if(d.value){const R=o.columns.find(G=>G.key===d.value);R&&T.sort((G,te)=>{const ae=H(G,R),Q=H(te,R);return ae<Q?m.value==="asc"?-1:1:ae>Q?m.value==="asc"?1:-1:0})}return T}),k=e.computed(()=>Math.ceil(x.value.length/s.value)),f=e.computed(()=>{if(!o.showPagination)return x.value;const T=(l.value-1)*s.value,R=T+s.value;return x.value.slice(T,R)}),u=e.computed(()=>{let T=o.columns.length;return o.selectable&&T++,(o.$slots?.actions||o.actions.length>0&&o.showActionsColumn)&&T++,T}),i=T=>o.actions.filter(R=>R.visible&&typeof R.visible=="function"?R.visible(T):!0),c=(T,R)=>T.permission&&typeof T.permission=="function"?T.permission(R):!0,g=(T,R)=>T.disabled&&typeof T.disabled=="function"?T.disabled(R):!1,b=(T,R)=>{g(T,R)||!c(T,R)||(r("action",{action:T.key,item:R,actionConfig:T}),T.onClick&&typeof T.onClick=="function"&&T.onClick(R))},h=T=>({default:"default",primary:"gradient",secondary:"secondary",danger:"danger",success:"success",warning:"warning",info:"info",subtle:"subtle",dark:"dark",light:"light",primaryOutline:"primaryOutline",dangerOutline:"dangerOutline",successOutline:"successOutline",outline:"outline",link:"link",ghost:"ghost"})[T]||"ghost",N=e.computed(()=>x.value.length>0&&x.value.every(T=>E(T))),P=e.computed(()=>{const T=x.value.filter(R=>E(R)).length;return T>0&&T<x.value.length}),H=(T,R)=>R.accessor?R.accessor(T):R.key.split(".").reduce((G,te)=>G?.[te],T),_=(T,R)=>T[o.rowKey]||R,E=T=>o.selectedItems.some(R=>_(R)===_(T)),I=T=>{const R=[...o.selectedItems],G=R.findIndex(te=>_(te)===_(T));G>-1?R.splice(G,1):R.push(T),r("selection-change",R)},j=()=>{if(o.loading||o.dataLoading)return;const T=N.value?[]:[...x.value];r("selection-change",T)},C=async T=>{!T.sortable||o.loading||o.sortLoading||(d.value===T.key?m.value=m.value==="asc"?"desc":"asc":(d.value=T.key,m.value="asc"),r("sort-change",{column:T.key,direction:m.value}))},$=T=>{o.loading||r("row-click",T)},L=async T=>{o.paginationLoading||o.loading||(l.value=T,r("page-change",T))},Y=async T=>{o.paginationLoading||o.loading||(s.value=T,l.value=1,r("page-size-change",T))},U=e.computed(()=>w(p({variant:o.variant}))),re=e.computed(()=>w(v({variant:o.variant}))),gt=e.computed(()=>w(y({variant:o.variant}))),$e=e.computed(()=>w(S({variant:o.variant}))),vt=T=>w({compact:"px-4 py-2",normal:"px-6 py-3",comfortable:"px-8 py-4"}[o.density],"text-left text-xs font-medium text-slate-500 uppercase tracking-wider",{"cursor-pointer hover:bg-slate-100 transition-colors":T.sortable&&!o.loading&&!o.sortLoading,"cursor-not-allowed opacity-50":o.loading||o.sortLoading&&d.value===T.key}),ht=()=>w({compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}[o.density],"whitespace-nowrap text-sm text-slate-900"),He=e.computed(()=>w({compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}[o.density],"whitespace-nowrap text-sm text-slate-900 w-12")),xe=e.computed(()=>w({compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}[o.density],"whitespace-nowrap text-sm font-medium text-center")),ze=e.computed(()=>w({compact:"px-4 py-4",normal:"px-6 py-6",comfortable:"px-8 py-8"}[o.density],"text-center")),De=(T,R)=>w({"text-blue-600":d.value===T.key&&m.value===R,"text-slate-300":d.value!==T.key||m.value!==R});return e.watch(()=>o.selectedItems,()=>{},{deep:!0}),e.watch(()=>o.pageSize,T=>{s.value=T}),n({refresh:()=>{r("refresh")},goToPage:T=>{L(T)},selectAll:()=>{j()},clearSelection:()=>{r("selection-change",[])},getCurrentPage:()=>l.value,getTotalPages:()=>k.value,getSelectedItems:()=>o.selectedItems}),(T,R)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(U.value)},[t.title||t.description||T.$slots.header?(e.openBlock(),e.createBlock(la,{key:0,title:t.title,description:t.description,variant:t.headerVariant,padding:t.headerPadding},{header:e.withCtx(()=>[e.renderSlot(T.$slots,"header",{},void 0,!0)]),filters:e.withCtx(()=>[e.renderSlot(T.$slots,"filters",{},void 0,!0)]),_:3},8,["title","description","variant","padding"])):e.createCommentVNode("",!0),e.createElementVNode("div",Gm,[t.loading?(e.openBlock(),e.createBlock(je,{key:0,loading:!0,type:t.loadingType,size:t.loadingSize,color:t.loadingColor,overlay:!0,text:t.loadingText,"text-position":t.loadingTextPosition,"background-color":t.loadingBackground,class:"table-loading-overlay"},null,8,["type","size","color","text","text-position","background-color"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["overflow-x-auto",{"opacity-50":t.loading}])},[e.createElementVNode("table",{class:e.normalizeClass(re.value)},[e.createElementVNode("thead",{class:e.normalizeClass(gt.value)},[e.createElementVNode("tr",null,[t.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(He.value)},[e.createElementVNode("div",Km,[t.bulkLoading?(e.openBlock(),e.createBlock(je,{key:0,loading:!0,type:"spin",size:"small",color:t.loadingColor},null,8,["color"])):(e.openBlock(),e.createBlock(it,{key:1,"model-value":N.value,indeterminate:P.value,disabled:t.loading||t.dataLoading,"onUpdate:modelValue":j},null,8,["model-value","indeterminate","disabled"]))])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,G=>(e.openBlock(),e.createElementBlock("th",{key:G.key,class:e.normalizeClass(vt(G)),onClick:te=>C(G)},[e.createElementVNode("div",Qm,[e.createElementVNode("span",null,e.toDisplayString(G.label),1),t.sortLoading&&d.value===G.key?(e.openBlock(),e.createBlock(je,{key:0,loading:!0,type:"spin",size:"small",color:t.loadingColor},null,8,["color"])):G.sortable?(e.openBlock(),e.createElementBlock("div",Jm,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([De(G,"asc"),"w-3 h-3 transition-colors"]),fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[...R[0]||(R[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"},null,-1)])],2)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([De(G,"desc"),"w-3 h-3 transition-colors"]),fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[...R[1]||(R[1]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)])],2))])):e.createCommentVNode("",!0)])],10,Xm))),128)),T.$slots.actions||t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("th",{key:1,class:e.normalizeClass(xe.value)}," Actions ",2)):e.createCommentVNode("",!0)])],2),e.createElementVNode("tbody",{class:e.normalizeClass($e.value)},[t.showSkeleton&&(t.loading||t.dataLoading)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.skeletonRows,G=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${G}`,class:"animate-pulse"},[t.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(He.value)},[...R[2]||(R[2]=[e.createElementVNode("div",{class:"w-4 h-4 bg-slate-200 rounded"},null,-1)])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,te=>(e.openBlock(),e.createElementBlock("td",{key:te.key,class:e.normalizeClass(ht())},[...R[3]||(R[3]=[e.createElementVNode("div",{class:"h-4 bg-slate-200 rounded w-3/4"},null,-1)])],2))),128)),T.$slots.actions||t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(xe.value)},[...R[4]||(R[4]=[e.createElementVNode("div",{class:"flex gap-2 justify-center"},[e.createElementVNode("div",{class:"w-6 h-6 bg-slate-200 rounded"}),e.createElementVNode("div",{class:"w-6 h-6 bg-slate-200 rounded"})],-1)])],2)):e.createCommentVNode("",!0)]))),128)):f.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(f.value,(G,te)=>(e.openBlock(),e.createBlock(sa,{key:_(G,te),item:G,columns:t.columns,index:te,selectable:t.selectable,"is-selected":E(G),striped:t.striped,hoverable:t.hoverable,"clickable-rows":t.clickableRows,density:t.density,"row-loading":t.rowLoading[_(G,te)],"loading-color":t.loadingColor,onToggleSelection:I,onRowClick:$},e.createSlots({actions:e.withCtx(ae=>[T.$slots.actions?e.renderSlot(T.$slots,"actions",e.mergeProps({key:0,ref_for:!0},ae),void 0,!0):t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("div",Zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i(ae.item),Q=>(e.openBlock(),e.createBlock(ra,{key:Q.key,content:Q.tooltip||Q.label||Q.key,placement:"top"},{default:e.withCtx(()=>[e.createVNode(J,{variant:h(Q.variant),size:"xs",disabled:g(Q,ae.item)||!c(Q,ae.item),class:"h-8 w-8",onClick:e.withModifiers(ca=>b(Q,ae.item),["stop"])},{default:e.withCtx(()=>[Q.icon?(e.openBlock(),e.createBlock(M,{key:0,icon:Q.icon,class:"w-4 h-4"},null,8,["icon"])):Q.label?(e.openBlock(),e.createElementBlock("span",ef,e.toDisplayString(Q.label),1)):e.createCommentVNode("",!0)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["content"]))),128))])):e.createCommentVNode("",!0)]),_:2},[e.renderList(t.columns,ae=>({name:`cell-${ae.key}`,fn:e.withCtx(Q=>[e.renderSlot(T.$slots,`cell-${ae.key}`,e.mergeProps({ref_for:!0},Q),void 0,!0)])}))]),1032,["item","columns","index","selectable","is-selected","striped","hoverable","clickable-rows","density","row-loading","loading-color"]))),128)):(e.openBlock(),e.createElementBlock("tr",tf,[e.createElementVNode("td",{colspan:u.value,class:e.normalizeClass(ze.value)},[e.renderSlot(T.$slots,"empty",{},()=>[e.createElementVNode("div",nf,[e.createElementVNode("div",of,[e.createVNode(M,{icon:"search",class:"w-16 h-16"})]),e.createElementVNode("p",rf,e.toDisplayString(t.emptyText),1),e.createElementVNode("p",lf,e.toDisplayString(t.emptySubtitle),1)])],!0)],10,af)]))],2)],2)],2)]),t.showPagination||T.$slots.footer?(e.openBlock(),e.createBlock(ia,{key:1,"current-page":l.value,"total-pages":k.value,total:x.value.length,"page-size":s.value,"show-pagination":t.showPagination,selectable:t.selectable,"selected-count":t.selectedItems.length,variant:t.paginationVariant,padding:t.paginationPadding,loading:t.paginationLoading,disabled:t.loading||t.dataLoading,"onUpdate:currentPage":L,"onUpdate:pageSize":Y},{footer:e.withCtx(()=>[e.renderSlot(T.$slots,"footer",{},void 0,!0)]),_:3},8,["current-page","total-pages","total","page-size","show-pagination","selectable","selected-count","variant","padding","loading","disabled"])):e.createCommentVNode("",!0)],2))}},Mo=pt(sf,[["__scopeId","data-v-32089b8f"]]),jo={__name:"DataTableCell",props:{item:{type:Object,required:!0},column:{type:Object,required:!0},value:{type:[String,Number,Boolean,Object,Array],default:null},align:{type:String,default:"left",validator:t=>["left","center","right"].includes(t)},width:{type:String,default:null},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},textSize:{type:String,default:"sm",validator:t=>["xs","sm","base","lg"].includes(t)},textColor:{type:String,default:"slate-900"}},setup(t){const n=t,a=e.computed(()=>{const s=n.value??o();return n.column.formatter?n.column.formatter(s,n.item):s}),o=()=>n.column.accessor?n.column.accessor(n.item):n.column.key.split(".").reduce((s,d)=>s?.[d],n.item),r=D.cva("whitespace-nowrap",{variants:{align:{left:"text-left",center:"text-center",right:"text-right"},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"},textSize:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg"}},defaultVariants:{align:"left",padding:"normal",textSize:"sm"}}),l=e.computed(()=>{const s=n.align||n.column.align||"left",d=`text-${n.textColor}`,m=n.width?`w-${n.width}`:"";return w(r({align:s,padding:n.padding,textSize:n.textSize}),d,m,n.column.cellClasses)});return(s,d)=>(e.openBlock(),e.createElementBlock("td",{class:e.normalizeClass(l.value)},[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.value),1)])],2))}},cf={class:"bg-white border-b border-gray-200"},df={key:0,class:"flex-1 min-w-80 max-w-md"},uf={class:"relative group"},mf=["model-value","placeholder"],ff={class:"relative"},pf={value:""},gf=["value"],vf={key:1,class:"min-w-36"},hf={class:"relative"},bf=["value"],yf={key:3,class:"flex items-center gap-2"},xf={class:"flex items-center gap-3 ml-auto"},kf={key:2},wf={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},Cf={class:"flex items-center justify-between"},Bf={class:"flex items-center gap-3"},Vf={class:"relative flex-1"},Sf=["model-value","placeholder","onInput"],Ef={class:"relative flex-1"},Nf=["model-value","placeholder","onInput"],$f=["onClick"],zf={class:"flex items-center justify-between"},Df={class:"flex items-center gap-3"},Tf={class:"relative flex-1"},Af=["model-value","placeholder","step","onInput"],Ff={class:"relative flex-1"},Pf=["model-value","placeholder","step","onInput"],Lf=["onClick"],Mf={class:"flex items-center justify-between"},jf={class:"relative"},If={value:""},Of=["value"],Rf={key:0,class:"flex flex-wrap gap-2 mt-2"},_f=["onClick"],Uf={class:"flex items-center gap-3 flex-wrap"},qf=["onClick"],Hf={key:2,class:"px-6 py-3 bg-gray-50 border-t border-gray-200"},Yf={class:"flex items-center justify-between"},Wf={class:"flex items-center gap-4"},Gf={class:"text-sm text-gray-600"},Kf={class:"font-medium"},Io={__name:"DataTableFilters",props:{searchQuery:{type:String,default:""},searchPlaceholder:{type:String,default:"Search..."},selectedStatus:{type:String,default:""},statusOptions:{type:Array,default:()=>[]},showDateFilter:{type:Boolean,default:!1},dateFrom:{type:String,default:""},dateTo:{type:String,default:""},selectFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"options")&&Object.prototype.hasOwnProperty.call(n,"value"))},dateFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"from")&&Object.prototype.hasOwnProperty.call(n,"to"))},numberFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"min")&&Object.prototype.hasOwnProperty.call(n,"max"))},multiSelectFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"options")&&Object.prototype.hasOwnProperty.call(n,"selected"))},showExport:{type:Boolean,default:!1},showAdd:{type:Boolean,default:!1},addButton:{type:Object,default:()=>({})},showTableInfo:{type:Boolean,default:!0},showSearch:{type:Boolean,default:!0},showFilters:{type:Boolean,default:!0},totalItems:{type:Number,default:0},itemLabel:{type:String,default:"items"},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:searchQuery","update:selectedStatus","update:dateFrom","update:dateTo","update:dateFilters","update:selectFilters","update:numberFilters","update:multiSelectFilters","export","add","clear-filters","add-button-click"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.computed(()=>Object.keys(a.addButton).length>0),s=e.computed(()=>l.value?a.addButton.visible&&typeof a.addButton.visible=="function"?a.addButton.visible():!0:a.showAdd),d=e.computed(()=>l.value&&a.addButton.permission&&typeof a.addButton.permission=="function"?a.addButton.permission():!0),m=e.computed(()=>l.value&&a.addButton.disabled&&typeof a.addButton.disabled=="function"?a.addButton.disabled():!1),p=()=>{m.value||!d.value||(o("add"),o("add-button-click",a.addButton),a.addButton.onClick&&typeof a.addButton.onClick=="function"&&a.addButton.onClick())},v=D.cva("flex flex-wrap items-center gap-4",{variants:{variant:{default:"bg-white",minimal:"bg-transparent",bordered:"bg-gray-50"},padding:{compact:"px-4 py-3",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),y=D.cva("border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-sm",{variants:{size:{sm:"px-2 py-1.5",md:"px-3 py-2.5",lg:"px-4 py-3"}},defaultVariants:{size:"md"}}),S=D.cva("rounded-lg flex items-center font-medium transition-all",{variants:{variant:{default:"text-gray-700 hover:text-gray-900 border border-gray-200 hover:bg-gray-50 hover:border-gray-300 bg-white",primary:"text-white bg-blue-600 hover:bg-blue-700 border border-blue-600 shadow-sm",success:"text-white bg-green-600 hover:bg-green-700 border border-green-600 shadow-sm",ghost:"text-gray-600 hover:text-gray-800 hover:bg-gray-100"},size:{sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),x=(A,V)=>{const B=a.selectFilters.map(F=>F.key===A?{...F,value:V}:F);o("update:selectFilters",B)},k=A=>!!(A.from||A.to),f=A=>{const V=a.dateFilters.map(B=>B.key===A?{...B,from:"",to:""}:B);o("update:dateFilters",V)},u=A=>`text-xs px-2 py-1 rounded ${k(A)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"}`,i=(A,V,B)=>{const F=a.dateFilters.map(W=>W.key===A?{...W,[V]:B}:W);o("update:dateFilters",F)},c=A=>!!(A.min||A.max),g=A=>{const V=a.numberFilters.map(B=>B.key===A?{...B,min:"",max:""}:B);o("update:numberFilters",V)},b=A=>`text-xs px-2 py-1 rounded ${c(A)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"}`,h=(A,V,B)=>{const F=a.numberFilters.map(W=>W.key===A?{...W,[V]:B}:W);o("update:numberFilters",F)},N=A=>A.selected&&A.selected.length>0,P=A=>`text-xs px-2 py-1 rounded ${N(A)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"}`,H=(A,V)=>{if(!V)return;const B=a.multiSelectFilters.map(F=>{if(F.key===A){const W=F.selected||[],Te=W.includes(V);return{...F,selected:Te?W.filter(bt=>bt!==V):[...W,V]}}return F});o("update:multiSelectFilters",B)},_=(A,V)=>{const B=a.multiSelectFilters.map(F=>F.key===A?{...F,selected:F.selected.filter(W=>W!==V)}:F);o("update:multiSelectFilters",B)},E=(A,V)=>{const B=A.options.find(F=>F.value===V);return B?B.label:V},I=()=>{r.value=!r.value},j=e.computed(()=>a.numberFilters.length>0||a.multiSelectFilters.length>0),C=e.computed(()=>{const A=a.searchQuery,V=a.selectedStatus,B=a.dateFrom||a.dateTo,F=a.selectFilters.some(ce=>ce.value),W=a.dateFilters.some(ce=>ce.from||ce.to),Te=a.numberFilters.some(ce=>ce.min||ce.max),bt=a.multiSelectFilters.some(ce=>ce.selected&&ce.selected.length>0);return A||V||B||F||W||Te||bt}),$=e.computed(()=>{let A=0;return a.searchQuery&&A++,a.selectedStatus&&A++,(a.dateFrom||a.dateTo)&&A++,A+=a.selectFilters.filter(V=>V.value).length,A+=a.dateFilters.filter(V=>V.from||V.to).length,A+=a.numberFilters.filter(V=>V.min||V.max).length,A+=a.multiSelectFilters.filter(V=>V.selected&&V.selected.length>0).length,A}),L=e.computed(()=>{const A=[];if(a.searchQuery&&a.searchQuery.trim()&&A.push({key:"search",label:"Search",value:`"${a.searchQuery}"`,icon:"magnifying-glass"}),a.selectedStatus){const V=a.statusOptions.find(B=>B.value===a.selectedStatus);A.push({key:"status",label:"Status",value:V?.label||a.selectedStatus,icon:"filter"})}if(a.selectFilters.forEach(V=>{if(V.value){const B=V.options.find(F=>F.value===V.value);A.push({key:`select-${V.key}`,label:V.label,value:B?.label||V.value,icon:"filter"})}}),a.dateFrom||a.dateTo){let V="";a.dateFrom&&a.dateTo?V=`${a.dateFrom} to ${a.dateTo}`:a.dateFrom?V=`From ${a.dateFrom}`:a.dateTo&&(V=`Until ${a.dateTo}`),V&&A.push({key:"date",label:"Date Range",value:V,icon:"calendar"})}return a.dateFilters.forEach(V=>{if(V.from||V.to){let B="";V.from&&V.to?B=`${V.from} to ${V.to}`:V.from?B=`From ${V.from}`:V.to&&(B=`Until ${V.to}`),B&&A.push({key:`date-${V.key}`,label:V.label,value:B,icon:"calendar"})}}),a.numberFilters.forEach(V=>{if(V.min||V.max){let B="";V.min&&V.max?B=`${V.min} to ${V.max}`:V.min?B=`Min ${V.min}`:V.max&&(B=`Max ${V.max}`),B&&A.push({key:`number-${V.key}`,label:V.label,value:B,icon:"hashtag"})}}),a.multiSelectFilters.forEach(V=>{if(V.selected&&V.selected.length>0){const B=V.selected.map(F=>{const W=V.options.find(Te=>Te.value===F);return W?W.label:F});A.push({key:`multi-${V.key}`,label:V.label,value:B.join(", "),icon:"list"})}}),A}),Y=e.computed(()=>w(v({variant:a.variant,padding:a.padding}))),U=e.computed(()=>"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 group-hover:text-gray-600 transition-colors"),re=e.computed(()=>w(y({size:"md"}),"w-full pl-10 pr-10 hover:border-gray-300")),gt=e.computed(()=>"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600 p-1 hover:bg-gray-100 rounded-full transition-all"),$e=e.computed(()=>w(y({size:"md"}),"w-full pr-8 appearance-none hover:border-gray-300")),vt=e.computed(()=>{const A=r.value||C.value;return w(S({variant:A?"primary":"default",size:"lg"}),"gap-2")}),ht=e.computed(()=>"bg-white text-blue-600 text-xs px-1.5 py-0.5 rounded-full min-w-[20px] text-center font-semibold"),He=e.computed(()=>"px-6 py-4 border-t border-gray-100 bg-gray-50"),xe=e.computed(()=>w(y({size:"md"}),"pl-10 pr-3")),ze=e.computed(()=>"text-sm font-semibold text-gray-700"),De=e.computed(()=>"text-gray-500 text-sm font-medium"),T=e.computed(()=>"text-gray-400 hover:text-gray-600 p-1.5 hover:bg-gray-200 rounded-full transition-all"),R=e.computed(()=>w(S({variant:"ghost",size:"md"}))),G=e.computed(()=>w(S({variant:"default",size:"lg"}))),te=e.computed(()=>"px-6 py-3 bg-blue-50 border-t border-blue-100"),ae=e.computed(()=>"text-sm font-semibold text-blue-800"),Q=e.computed(()=>"flex items-center gap-1.5 bg-white border border-blue-200 text-blue-800 px-3 py-1.5 rounded-full text-sm font-medium"),ca=e.computed(()=>"text-blue-600 hover:text-blue-800 ml-1 hover:bg-blue-100 rounded-full p-0.5 transition-all"),Jo=()=>{o("update:searchQuery",""),o("update:selectedStatus",""),o("update:dateFrom",""),o("update:dateTo","");const A=a.selectFilters.map(W=>({...W,value:""}));o("update:selectFilters",A);const V=a.dateFilters.map(W=>({...W,from:"",to:""}));o("update:dateFilters",V);const B=a.numberFilters.map(W=>({...W,min:"",max:""}));o("update:numberFilters",B);const F=a.multiSelectFilters.map(W=>({...W,selected:[]}));o("update:multiSelectFilters",F),o("clear-filters")},Zo=A=>{switch(A){case"search":o("update:searchQuery","");break;case"status":o("update:selectedStatus","");break;case"date":o("update:dateFrom",""),o("update:dateTo","");break;default:if(A.startsWith("select-")){const V=A.replace("select-",""),B=a.selectFilters.map(F=>F.key===V?{...F,value:""}:F);o("update:selectFilters",B)}else if(A.startsWith("date-")){const V=A.replace("date-",""),B=a.dateFilters.map(F=>F.key===V?{...F,from:"",to:""}:F);o("update:dateFilters",B)}else if(A.startsWith("number-")){const V=A.replace("number-",""),B=a.numberFilters.map(F=>F.key===V?{...F,min:"",max:""}:F);o("update:numberFilters",B)}else if(A.startsWith("multi-")){const V=A.replace("multi-",""),B=a.multiSelectFilters.map(F=>F.key===V?{...F,selected:[]}:F);o("update:multiSelectFilters",B)}break}};return(A,V)=>(e.openBlock(),e.createElementBlock("div",cf,[e.createElementVNode("div",{class:e.normalizeClass(Y.value)},[t.showSearch?(e.openBlock(),e.createElementBlock("div",df,[e.createElementVNode("div",uf,[e.createVNode(M,{icon:"magnifying-glass",class:e.normalizeClass(U.value)},null,8,["class"]),e.createElementVNode("input",{"model-value":t.searchQuery,placeholder:t.searchPlaceholder,class:e.normalizeClass(re.value),onInput:V[0]||(V[0]=B=>A.$emit("update:searchQuery",B.target.value))},null,42,mf),t.searchQuery?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(gt.value),onClick:V[1]||(V[1]=B=>A.$emit("update:searchQuery",""))},[e.createVNode(M,{icon:"xmark",class:"w-3 h-3"})],2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.selectFilters,B=>(e.openBlock(),e.createElementBlock("div",{key:B.key,class:"min-w-36"},[e.createElementVNode("div",ff,[e.createVNode(ue,{"model-value":B.value,class:e.normalizeClass($e.value),onChange:F=>x(B.key,F.target.value)},{default:e.withCtx(()=>[e.createElementVNode("option",pf,e.toDisplayString(B.placeholder||`All ${B.label}`),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.options,F=>(e.openBlock(),e.createElementBlock("option",{key:F.value,value:F.value},e.toDisplayString(F.label),9,gf))),128))]),_:2},1032,["model-value","class","onChange"]),e.createVNode(M,{icon:"chevron-down",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])]))),128)),t.showFilters&&t.statusOptions.length>0?(e.openBlock(),e.createElementBlock("div",vf,[e.createElementVNode("div",hf,[e.createVNode(ue,{"model-value":t.selectedStatus,class:e.normalizeClass($e.value),onChange:V[2]||(V[2]=B=>A.$emit("update:selectedStatus",B.target.value))},{default:e.withCtx(()=>[V[5]||(V[5]=e.createElementVNode("option",{value:""}," All Status ",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.statusOptions,B=>(e.openBlock(),e.createElementBlock("option",{key:B.value,value:B.value},e.toDisplayString(B.label),9,bf))),128))]),_:1},8,["model-value","class"]),e.createVNode(M,{icon:"chevron-down",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])])):e.createCommentVNode("",!0),t.showFilters&&(t.dateFilters.length>0||j.value)?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(vt.value),onClick:I},[e.createVNode(M,{icon:"filter",class:"w-4 h-4"}),V[6]||(V[6]=e.createTextVNode(" Filters ",-1)),$.value>0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(ht.value)},e.toDisplayString($.value),3)):e.createCommentVNode("",!0),e.createVNode(M,{icon:r.value?"chevron-up":"chevron-down",class:"w-4 h-4 ml-1"},null,8,["icon"])],2)):e.createCommentVNode("",!0),A.$slots.filters?(e.openBlock(),e.createElementBlock("div",yf,[e.renderSlot(A.$slots,"filters")])):e.createCommentVNode("",!0),e.createElementVNode("div",xf,[C.value?(e.openBlock(),e.createBlock(J,{key:0,class:e.normalizeClass(R.value),onClick:Jo},{default:e.withCtx(()=>[e.createVNode(M,{icon:"rotate-left",class:"w-4 h-4 mr-2"}),V[7]||(V[7]=e.createTextVNode(" Clear All ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showExport?(e.openBlock(),e.createBlock(J,{key:1,class:e.normalizeClass(G.value),onClick:V[3]||(V[3]=B=>A.$emit("export"))},{default:e.withCtx(()=>[e.createVNode(M,{icon:"download",class:"w-4 h-4 mr-2"}),V[8]||(V[8]=e.createTextVNode(" Export ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showAdd&&s.value?(e.openBlock(),e.createElementBlock("div",kf,[l.value?(e.openBlock(),e.createBlock(J,{key:0,variant:t.addButton.variant||"success",size:t.addButton.size||"lg",disabled:m.value||!d.value,title:t.addButton.tooltip,onClick:p},{default:e.withCtx(()=>[t.addButton.icon?(e.openBlock(),e.createBlock(M,{key:0,icon:t.addButton.icon,class:"w-4 h-4 mr-2"},null,8,["icon"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.addButton.label||"Add"),1)]),_:1},8,["variant","size","disabled","title"])):e.renderSlot(A.$slots,"add",{key:1},()=>[e.createVNode(J,{variant:"success",size:"lg",onClick:V[4]||(V[4]=B=>A.$emit("add"))},{default:e.withCtx(()=>[e.createVNode(M,{icon:"plus",class:"w-4 h-4 mr-2"}),V[9]||(V[9]=e.createTextVNode(" Add ",-1))]),_:1})])])):e.createCommentVNode("",!0)])],2),t.showFilters&&r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(He.value)},[e.createElementVNode("div",wf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dateFilters,B=>(e.openBlock(),e.createElementBlock("div",{key:B.key,class:"space-y-3"},[e.createElementVNode("div",Cf,[e.createElementVNode("label",{class:e.normalizeClass(ze.value)},e.toDisplayString(B.label),3),e.createElementVNode("span",{class:e.normalizeClass(u(B))},e.toDisplayString(k(B)?"Active":"Inactive"),3)]),e.createElementVNode("div",Bf,[e.createElementVNode("div",Vf,[e.createVNode(M,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.createElementVNode("input",{type:"date","model-value":B.from,class:e.normalizeClass(xe.value),placeholder:`From ${B.label}`,onInput:F=>i(B.key,"from",F.target.value)},null,42,Sf)]),e.createElementVNode("span",{class:e.normalizeClass(De.value)},"to",2),e.createElementVNode("div",Ef,[e.createVNode(M,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.createElementVNode("input",{type:"date","model-value":B.to,class:e.normalizeClass(xe.value),placeholder:`To ${B.label}`,onInput:F=>i(B.key,"to",F.target.value)},null,42,Nf)]),k(B)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(T.value),title:"Clear this filter",onClick:F=>f(B.key)},[e.createVNode(M,{icon:"xmark",class:"w-4 h-4"})],10,$f)):e.createCommentVNode("",!0)])]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.numberFilters,B=>(e.openBlock(),e.createElementBlock("div",{key:B.key,class:"space-y-3"},[e.createElementVNode("div",zf,[e.createElementVNode("label",{class:e.normalizeClass(ze.value)},e.toDisplayString(B.label),3),e.createElementVNode("span",{class:e.normalizeClass(b(B))},e.toDisplayString(c(B)?"Active":"Inactive"),3)]),e.createElementVNode("div",Df,[e.createElementVNode("div",Tf,[e.createElementVNode("input",{type:"number","model-value":B.min,class:e.normalizeClass(xe.value),placeholder:`Min ${B.label}`,step:B.step||1,onInput:F=>h(B.key,"min",F.target.value)},null,42,Af)]),e.createElementVNode("span",{class:e.normalizeClass(De.value)},"to",2),e.createElementVNode("div",Ff,[e.createElementVNode("input",{type:"number","model-value":B.max,class:e.normalizeClass(xe.value),placeholder:`Max ${B.label}`,step:B.step||1,onInput:F=>h(B.key,"max",F.target.value)},null,42,Pf)]),c(B)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(T.value),title:"Clear this filter",onClick:F=>g(B.key)},[e.createVNode(M,{icon:"xmark",class:"w-4 h-4"})],10,Lf)):e.createCommentVNode("",!0)])]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.multiSelectFilters,B=>(e.openBlock(),e.createElementBlock("div",{key:B.key,class:"space-y-3"},[e.createElementVNode("div",Mf,[e.createElementVNode("label",{class:e.normalizeClass(ze.value)},e.toDisplayString(B.label),3),e.createElementVNode("span",{class:e.normalizeClass(P(B))},e.toDisplayString(N(B)?`${B.selected.length} selected`:"None"),3)]),e.createElementVNode("div",jf,[e.createVNode(ue,{"model-value":"",class:e.normalizeClass($e.value),onChange:F=>H(B.key,F.target.value)},{default:e.withCtx(()=>[e.createElementVNode("option",If," Select "+e.toDisplayString(B.label),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.options,F=>(e.openBlock(),e.createElementBlock("option",{key:F.value,value:F.value},e.toDisplayString(F.label),9,Of))),128))]),_:2},1032,["class","onChange"]),e.createVNode(M,{icon:"chevron-down",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})]),B.selected.length>0?(e.openBlock(),e.createElementBlock("div",Rf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.selected,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"inline-flex items-center gap-1 bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full"},[e.createTextVNode(e.toDisplayString(E(B,F))+" ",1),e.createElementVNode("button",{class:"hover:bg-blue-200 rounded-full p-0.5",onClick:W=>_(B.key,F)},[e.createVNode(M,{icon:"xmark",class:"w-3 h-3"})],8,_f)]))),128))])):e.createCommentVNode("",!0)]))),128))])],2)):e.createCommentVNode("",!0),t.showFilters&&L.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(te.value)},[e.createElementVNode("div",Uf,[e.createElementVNode("span",{class:e.normalizeClass(ae.value)},"Active filters:",2),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,B=>(e.openBlock(),e.createElementBlock("div",{key:B.key,class:e.normalizeClass(Q.value)},[e.createVNode(M,{icon:B.icon,class:"w-3 h-3"},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(B.label)+": "+e.toDisplayString(B.value),1),e.createElementVNode("button",{class:e.normalizeClass(ca.value),onClick:F=>Zo(B.key)},[e.createVNode(M,{icon:"xmark",class:"w-3 h-3"})],10,qf)],2))),128))])],2)):e.createCommentVNode("",!0),t.showTableInfo?(e.openBlock(),e.createElementBlock("div",Hf,[e.createElementVNode("div",Yf,[e.createElementVNode("div",Wf,[e.createElementVNode("span",Gf,[e.createElementVNode("span",Kf,e.toDisplayString(t.totalItems||0),1),e.createTextVNode(" "+e.toDisplayString(t.itemLabel||"items")+" found ",1)])])])])):e.createCommentVNode("",!0)]))}},Xf={class:"flex items-center gap-3"},Qf={key:0,class:"flex items-center gap-3"},Jf={class:"text-sm text-slate-600"},Zf={class:"flex items-center gap-2"},ep={class:"flex items-center gap-3"},tp=["title","onClick"],ap={key:1,class:"relative"},np={class:"p-3"},op={class:"space-y-1"},rp={class:"flex items-center gap-2 cursor-pointer w-full"},lp=["checked","onChange"],sp=["disabled"],ip={key:3,class:"flex items-center gap-2"},cp=[{key:"delete",label:"Delete",icon:{template:'<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" /></svg>'},variant:"danger"},{key:"edit",label:"Edit",icon:{template:'<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" /></svg>'},variant:"primary"}],dp={name:"DataTableToolBar"},Oo=Object.assign(dp,{props:{selectedItems:{type:Array,default:()=>[]},totalItems:{type:Number,default:0},bulkActions:{type:Array,default:()=>cp},showDensityToggle:{type:Boolean,default:!0},showColumnToggle:{type:Boolean,default:!0},showRefresh:{type:Boolean,default:!0},isRefreshing:{type:Boolean,default:!1},density:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},toggleableColumns:{type:Array,default:()=>[]},visibleColumns:{type:Array,default:()=>[]},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["bulk-action","update:density","toggle-column","refresh"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(null),s=e.ref(null),d=e.computed(()=>a.selectedItems.length),m=[{value:"compact",label:"Compact",icon:["fas","minus"]},{value:"normal",label:"Normal",icon:["fas","bars"]},{value:"comfortable",label:"Comfortable",icon:["fas","bars-staggered"]}],p=D.cva("flex items-center justify-between border-b border-slate-200",{variants:{variant:{default:"bg-white",minimal:"bg-transparent border-slate-100",bordered:"bg-slate-50 border-slate-300"},padding:{compact:"p-2",normal:"p-4",comfortable:"p-6"}},defaultVariants:{variant:"default",padding:"normal"}}),v=D.cva("px-3 py-1.5 text-sm font-medium rounded-md flex items-center gap-1 transition-colors",{variants:{variant:{danger:"text-red-700 bg-red-500 hover:bg-red-400 border border-red-200",primary:"text-blue-700 bg-blue-50 hover:bg-blue-100 border border-blue-200",secondary:"text-slate-700 bg-slate-500 hover:bg-slate-400 border border-slate-200"}},defaultVariants:{variant:"secondary"}}),y=D.cva("p-2 border border-slate-300 transition-colors",{variants:{active:{true:"bg-blue-50 text-blue-600 border-blue-300",false:"bg-white text-slate-600 hover:bg-slate-50"},position:{first:"rounded-l-md border-r-0",middle:"border-x-0",last:"rounded-r-md border-l-0"}},defaultVariants:{active:!1,position:"middle"}}),S=D.cva("px-3 py-2 text-sm border border-slate-300 rounded-md flex items-center gap-2 transition-colors",{variants:{state:{normal:"text-slate-600 hover:text-slate-800 hover:bg-slate-50",refreshing:"text-slate-600 opacity-75 cursor-not-allowed"}},defaultVariants:{state:"normal"}}),x=e.computed(()=>w(p({variant:a.variant,padding:a.padding}))),k=e.computed(()=>"text-sm text-slate-600"),f=e.computed(()=>"flex items-center"),u=e.computed(()=>"flex items-center gap-2 px-3 py-2 text-sm text-slate-600 hover:text-slate-800 border border-slate-300 rounded-md hover:bg-slate-50 transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1"),i=e.computed(()=>"absolute right-0 top-full mt-1 w-56 bg-white border border-slate-200 rounded-lg shadow-lg z-50 max-h-64 overflow-y-auto"),c=e.computed(()=>"text-xs font-medium text-slate-500 uppercase tracking-wider mb-2 border-b border-slate-100 pb-2"),g=e.computed(()=>"py-1 hover:bg-slate-50 rounded transition-colors"),b=e.computed(()=>"w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500 focus:ring-2 focus:ring-offset-1"),h=e.computed(()=>"text-sm text-slate-700 flex-1 select-none"),N=$=>{l.value&&s.value&&!l.value.contains($.target)&&!s.value.contains($.target)&&(r.value=!1)},P=()=>{r.value=!r.value},H=$=>w(v({variant:$.variant||"secondary"})),_=$=>{let L="middle";return $==="compact"?L="first":$==="comfortable"&&(L="last"),w(y({active:a.density===$,position:L}))},E=()=>w(S({state:a.isRefreshing?"refreshing":"normal"})),I=()=>w("w-4 h-4",{"animate-spin":a.isRefreshing}),j=$=>a.visibleColumns.includes($),C=($,L)=>{o("toggle-column",{column:$,visible:L})};return e.onMounted(()=>{document.addEventListener("click",N)}),e.onUnmounted(()=>{document.removeEventListener("click",N)}),($,L)=>{const Y=e.resolveComponent("font-awesome-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(x.value)},[e.createElementVNode("div",Xf,[d.value>0?(e.openBlock(),e.createElementBlock("div",Qf,[e.createElementVNode("span",Jf,e.toDisplayString(d.value)+" selected ",1),e.createElementVNode("div",Zf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bulkActions,U=>(e.openBlock(),e.createBlock(J,{key:U.key,class:e.normalizeClass(H(U)),onClick:re=>$.$emit("bulk-action",{action:U.key,items:t.selectedItems})},{default:e.withCtx(()=>[U.icon?(e.openBlock(),e.createBlock(Y,{key:0,icon:U.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(U.label),1)]),_:2},1032,["class","onClick"]))),128))])])):t.totalItems>0?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(k.value)},e.toDisplayString(t.totalItems)+" "+e.toDisplayString(t.totalItems===1?"item":"items"),3)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ep,[t.showDensityToggle?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(f.value)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(m,U=>e.createElementVNode("button",{key:U.value,class:e.normalizeClass(_(U.value)),title:U.label,type:"button",onClick:re=>$.$emit("update:density",U.value)},[e.createVNode(Y,{icon:U.icon,class:"w-4 h-4"},null,8,["icon"])],10,tp)),64))],2)):e.createCommentVNode("",!0),t.showColumnToggle?(e.openBlock(),e.createElementBlock("div",ap,[e.createElementVNode("button",{ref_key:"columnToggleButton",ref:l,class:e.normalizeClass(u.value),type:"button",onClick:e.withModifiers(P,["stop"])},[e.createVNode(Y,{icon:"columns",class:"w-4 h-4"}),L[2]||(L[2]=e.createElementVNode("span",null,"Columns",-1))],2),e.withDirectives(e.createElementVNode("div",{ref_key:"columnMenu",ref:s,class:e.normalizeClass(i.value),onClick:L[0]||(L[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",np,[e.createElementVNode("div",{class:e.normalizeClass(c.value)}," Show Columns ",2),e.createElementVNode("div",op,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.toggleableColumns,U=>(e.openBlock(),e.createElementBlock("div",{key:U.key,class:e.normalizeClass(g.value)},[e.createElementVNode("label",rp,[e.createElementVNode("input",{type:"checkbox",checked:j(U.key),class:e.normalizeClass(b.value),onChange:re=>C(U.key,re.target.checked)},null,42,lp),e.createElementVNode("span",{class:e.normalizeClass(h.value)},e.toDisplayString(U.label),3)])],2))),128))])])],2),[[e.vShow,r.value]])])):e.createCommentVNode("",!0),t.showRefresh?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:t.isRefreshing,class:e.normalizeClass(E()),type:"button",onClick:L[1]||(L[1]=U=>$.$emit("refresh"))},[e.createVNode(Y,{icon:"sync",class:e.normalizeClass(I())},null,8,["class"]),L[3]||(L[3]=e.createElementVNode("span",null,"Refresh",-1))],10,sp)):e.createCommentVNode("",!0),$.$slots.actions?(e.openBlock(),e.createElementBlock("div",ip,[e.renderSlot($.$slots,"actions")])):e.createCommentVNode("",!0)])],2)}}}),up={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12"},mp={class:"grid grid-cols-1 md:grid-cols-4 gap-8"},fp={class:"col-span-1 md:col-span-2"},pp={class:"space-y-2"},gp={class:"flex space-x-4"},vp={class:"flex flex-col md:flex-row justify-between items-center"},hp={class:"flex space-x-6 mt-4 md:mt-0"},Ro={__name:"Footer",props:{className:{type:String,default:""}},setup(t){return(n,a)=>{const o=e.resolveComponent("Logo"),r=e.resolveComponent("Text"),l=e.resolveComponent("Typography"),s=e.resolveComponent("Link"),d=e.resolveComponent("Icon"),m=e.resolveComponent("Divider");return e.openBlock(),e.createElementBlock("footer",{class:e.normalizeClass(e.unref(w)("bg-gray-50 border-t border-gray-200",t.className))},[e.createElementVNode("div",up,[e.createElementVNode("div",mp,[e.createElementVNode("div",fp,[e.renderSlot(n.$slots,"brand",{},()=>[e.createVNode(o,{class:"mb-4"}),e.createVNode(r,{class:"text-gray-600 max-w-md"},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode(" Building beautiful applications with modern Vue.js components. ",-1)])]),_:1})])]),e.createElementVNode("div",null,[e.renderSlot(n.$slots,"links",{},()=>[e.createVNode(l,{variant:"h6",class:"mb-4"},{default:e.withCtx(()=>[...a[1]||(a[1]=[e.createTextVNode(" Quick Links ",-1)])]),_:1}),e.createElementVNode("div",pp,[e.createVNode(s,{href:"#",class:"block text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[2]||(a[2]=[e.createTextVNode(" About ",-1)])]),_:1}),e.createVNode(s,{href:"#",class:"block text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[3]||(a[3]=[e.createTextVNode(" Services ",-1)])]),_:1}),e.createVNode(s,{href:"#",class:"block text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[4]||(a[4]=[e.createTextVNode(" Contact ",-1)])]),_:1})])])]),e.createElementVNode("div",null,[e.renderSlot(n.$slots,"social",{},()=>[e.createVNode(l,{variant:"h6",class:"mb-4"},{default:e.withCtx(()=>[...a[5]||(a[5]=[e.createTextVNode(" Follow Us ",-1)])]),_:1}),e.createElementVNode("div",gp,[e.createVNode(s,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[e.createVNode(d,{name:"twitter",class:"h-5 w-5"})]),_:1}),e.createVNode(s,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[e.createVNode(d,{name:"github",class:"h-5 w-5"})]),_:1})])])])]),e.createVNode(m,{class:"my-8"}),e.createElementVNode("div",vp,[e.renderSlot(n.$slots,"copyright",{},()=>[e.createVNode(r,{class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(" © "+e.toDisplayString(new Date().getFullYear())+" Your Company. All rights reserved. ",1)]),_:1})]),e.renderSlot(n.$slots,"legal",{},()=>[e.createElementVNode("div",hp,[e.createVNode(s,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[6]||(a[6]=[e.createTextVNode(" Privacy ",-1)])]),_:1}),e.createVNode(s,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[7]||(a[7]=[e.createTextVNode(" Terms ",-1)])]),_:1})])])])])],2)}}},bp={class:"flex items-center justify-between h-16 px-4 md:px-6"},yp={class:"flex items-center"},xp={key:0,class:"mr-4 flex-shrink-0 bg-gradient-to-r from-blue-50 to-indigo-50 px-3 py-2 rounded-lg border border-blue-100"},kp={class:"text-lg font-bold text-blue-900 truncate max-w-[200px]"},wp={key:0,class:"text-xs text-blue-600 truncate font-medium"},Cp={class:"hidden md:flex items-center space-x-2 text-sm truncate"},Bp={class:"text-gray-500 truncate"},Vp={class:"text-gray-900 font-medium truncate"},Sp={class:"flex items-center space-x-3 md:space-x-4"},Ep={key:1,class:"relative"},Np={key:0,class:"absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white text-xs rounded-full flex items-center justify-center"},$p={key:0,class:"absolute right-4 md:right-6 top-16 mt-2 w-72 md:w-80 bg-white rounded-lg shadow-lg border border-gray-200 z-50"},zp={class:"max-h-96 overflow-y-auto"},Dp={class:"flex items-start space-x-3"},Tp={class:"flex-1"},Ap={class:"text-sm text-gray-900"},Fp={class:"text-xs text-gray-500 mt-1"},Pp={class:"relative"},Lp={class:"w-8 h-8 bg-gradient-to-br from-blue-100 to-indigo-100 rounded-full flex items-center justify-center transition-colors shadow-sm"},Mp={class:"text-blue-700 text-sm font-medium"},jp={class:"hidden md:block text-left max-w-[160px] truncate"},Ip={class:"text-sm font-medium text-gray-900 truncate"},Op={class:"text-xs text-gray-500 truncate leading-tight"},Rp={key:0,class:"absolute right-0 mt-2 w-58 bg-white rounded-lg shadow-lg border border-gray-200 z-50"},_p={class:"p-4 border-b border-gray-200"},Up={class:"text-sm font-medium text-gray-900"},qp={class:"text-xs text-gray-500"},Hp={class:"py-2"},Yp={key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gradient-to-b from-blue-500 to-blue-600 rounded-r-full"},Wp=["onClick"],Gp={class:"flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors ml-2 bg-gray-100 text-gray-600 group-hover:bg-gray-200"},Kp={class:"flex-1 truncate font-semibold text-gray-700"},_o={__name:"Header",props:{sidebarWidth:{type:Number,default:256},currentSection:{type:String,default:"Dashboard"},currentPage:{type:String,default:"Overview"},currentRoute:{type:String,default:""},user:{type:Object,required:!0},notifications:{type:Array,default:()=>[]},profileMenuItems:{type:Array,required:!0},mobileOpen:{type:Boolean,default:!1},currentOrganisation:{type:Object,default:null},companyLogo:{type:String,default:""}},emits:["search","profile-action","logout","navigate","toggle-mobile-sidebar"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),l=e.ref(!1),s=e.ref(!1),d=e.ref(a.notifications.length),m=e.ref(!1),p=e.ref(!1),v=e.computed(()=>(a.user?.name||"Guest").split(" ").map(h=>h[0]||"").join("").toUpperCase()),y=e.computed(()=>a.user?.roles?.length?a.user.roles.map(b=>b.name).join(", "):"No role"),S=()=>{l.value=!l.value,s.value=!1},x=()=>{s.value=!s.value,l.value=!1},k=b=>{o("navigate",b),s.value=!1},f=b=>b.route?!!(a.currentRoute===b.route||a.currentRoute.startsWith(b.route+"/")):!1,u=b=>{o("profile-action",b),s.value=!1},i=()=>{o("logout"),s.value=!1},c=b=>{!b.target.closest(".absolute")&&!b.target.closest("button")&&(l.value=!1,s.value=!1)},g=()=>{p.value=window.innerWidth<768};return e.onMounted(()=>{document.addEventListener("click",c),g(),window.addEventListener("resize",g)}),e.onUnmounted(()=>{document.removeEventListener("click",c),window.removeEventListener("resize",g)}),e.watch(r,b=>o("search",b)),(b,h)=>{const N=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("header",{class:e.normalizeClass(e.unref(w)("fixed top-0 z-50 bg-white border-b border-gray-200 transition-all duration-300 ease-in-out w-full")),style:{left:"0"}},[e.createElementVNode("div",bp,[e.createElementVNode("div",yp,[t.currentOrganisation?(e.openBlock(),e.createElementBlock("div",xp,[e.createElementVNode("p",kp,e.toDisplayString(t.currentOrganisation.organisation_name),1),t.currentOrganisation.role?(e.openBlock(),e.createElementBlock("p",wp,e.toDisplayString(t.currentOrganisation.role),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("nav",Cp,[e.createElementVNode("span",Bp,e.toDisplayString(t.currentSection),1),h[4]||(h[4]=e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)),e.createElementVNode("span",Vp,e.toDisplayString(t.currentPage),1)])]),e.createElementVNode("div",Sp,[p.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"p-2 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-50 transition-colors",onClick:h[0]||(h[0]=P=>o("toggle-mobile-sidebar"))},[...h[5]||(h[5]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])])):e.createCommentVNode("",!0),!p.value||m.value?(e.openBlock(),e.createElementBlock("div",Ep,[h[6]||(h[6]=e.createElementVNode("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})])],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[1]||(h[1]=P=>r.value=P),type:"text",placeholder:"Search...",class:"pl-10 pr-4 py-2 w-48 md:w-64 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none"},null,512),[[e.vModelText,r.value]]),p.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",onClick:h[2]||(h[2]=P=>m.value=!1)}," ✕ ")):e.createCommentVNode("",!0)])):p.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"p-2 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-50 transition-colors",onClick:h[3]||(h[3]=P=>m.value=!0)},[...h[7]||(h[7]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"relative p-2 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-50 transition-colors",onClick:S},[h[8]||(h[8]=e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 17h5l-5 5v-5z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 3h2.586a1 1 0 01.707.293l6.414 6.414a1 1 0 01.293.707V19a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h4L13 3z"})],-1)),d.value>0?(e.openBlock(),e.createElementBlock("span",Np,e.toDisplayString(d.value),1)):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",$p,[h[10]||(h[10]=e.createElementVNode("div",{class:"p-4 border-b border-gray-200"},[e.createElementVNode("h3",{class:"text-lg font-semibold text-gray-900"}," Notifications ")],-1)),e.createElementVNode("div",zp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.notifications,P=>(e.openBlock(),e.createElementBlock("div",{key:P.id,class:"p-4 border-b border-gray-100 hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",Dp,[h[9]||(h[9]=e.createElementVNode("div",{class:"flex-shrink-0 w-2 h-2 mt-2 bg-blue-500 rounded-full"},null,-1)),e.createElementVNode("div",Tp,[e.createElementVNode("p",Ap,e.toDisplayString(P.title),1),e.createElementVNode("p",Fp,e.toDisplayString(P.time),1)])])]))),128))]),h[11]||(h[11]=e.createElementVNode("div",{class:"p-4 text-center"},[e.createElementVNode("button",{class:"text-sm text-blue-600 hover:text-blue-800"}," View all notifications ")],-1))])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Pp,[e.createElementVNode("button",{class:"flex items-center space-x-2 md:space-x-3 p-2 rounded-lg hover:bg-gray-50 transition-colors",onClick:x},[e.createElementVNode("div",Lp,[e.createElementVNode("span",Mp,e.toDisplayString(v.value),1)]),e.createElementVNode("div",jp,[e.createElementVNode("p",Ip,e.toDisplayString(t.user.name),1),e.createElementVNode("p",Op,e.toDisplayString(y.value),1)]),h[12]||(h[12]=e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-200 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",Rp,[e.createElementVNode("div",_p,[e.createElementVNode("p",Up,e.toDisplayString(t.user.name),1),e.createElementVNode("p",qp,e.toDisplayString(t.user.email),1)]),e.createElementVNode("div",Hp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.profileMenuItems,P=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:P.name},[P.route?(e.openBlock(),e.createBlock(N,{key:0,to:P.route,class:e.normalizeClass(e.unref(w)("flex items-center px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",f(P)?"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-700 shadow-sm border border-blue-200":"text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent")),onClick:H=>k(P)},{default:e.withCtx(()=>[f(P)?(e.openBlock(),e.createElementBlock("div",Yp)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors ml-2",f(P)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"bg-gray-100 text-gray-600 group-hover:bg-gray-200"))},[P.icon?(e.openBlock(),e.createBlock(M,{key:0,icon:P.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w)("flex-1 truncate font-semibold",f(P)?"text-blue-700":"text-gray-700"))},e.toDisplayString(P.label),3)]),_:2},1032,["to","class","onClick"])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"flex items-center w-full px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent",onClick:H=>u(P)},[e.createElementVNode("div",Gp,[P.icon?(e.openBlock(),e.createBlock(M,{key:0,icon:P.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Kp,e.toDisplayString(P.label),1)],8,Wp))],64))),128))]),e.createElementVNode("div",{class:"border-t border-gray-200 py-2"},[e.createElementVNode("button",{class:"flex items-center w-full px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative text-red-600 hover:bg-red-50 border border-transparent",onClick:i},[...h[13]||(h[13]=[e.createElementVNode("div",{class:"flex items-center justify-center w-8 h-8 rounded-lg mr-1 flex-shrink-0 transition-colors ml-2 bg-red-100 text-red-600 group-hover:bg-red-200"},[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a2 2 0 013-3h4a3 3 0 013 3v1"})])],-1),e.createElementVNode("span",{class:"truncate font-semibold text-red-600"}," Sign out ",-1)])])])])):e.createCommentVNode("",!0)]),_:1})])])])],2)}}},Xp={class:"relative"},Qp=["id","disabled"],Jp={key:0,class:"text-gray-500"},Zp={key:1,class:"flex flex-wrap gap-1.5"},eg={class:"px-3 py-2.5 border-b border-gray-200 bg-gray-50"},tg={key:0,class:"max-h-52 overflow-y-auto py-1"},ag=["onClick"],ng={class:"flex items-center gap-3"},og=["checked"],rg={key:1,class:"px-4 py-6 text-sm text-gray-500 text-center"},Uo={__name:"MultiSelect",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,required:!0,validator:t=>t.every(n=>n.value!==void 0&&n.label)},id:{type:String,default:null},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:"Select options"},hasError:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(""),s=e.ref(null),d=e.ref([...a.options]),m=e.ref(null),p=e.ref({}),v=e.computed(()=>a.options.filter(i=>a.modelValue.includes(i.value)).map(i=>i.label)),y=()=>{if(!m.value)return;const i=m.value.getBoundingClientRect(),c=window.innerHeight,g=c-i.bottom,b=320;g<b&&i.top>b?p.value={position:"fixed",bottom:`${c-i.top+4}px`,left:`${i.left}px`,width:`${i.width}px`,zIndex:9999}:p.value={position:"fixed",top:`${i.bottom+4}px`,left:`${i.left}px`,width:`${i.width}px`,zIndex:9999}},S=()=>{a.disabled||(r.value=!r.value,r.value?(y(),e.nextTick(()=>{s.value?.focus()})):(l.value="",d.value=[...a.options]))},x=i=>{let c;a.modelValue.includes(i)?c=a.modelValue.filter(g=>g!==i):c=[...a.modelValue,i],o("update:modelValue",c)},k=()=>{if(!l.value.trim())d.value=[...a.options];else{const i=l.value.toLowerCase();d.value=a.options.filter(c=>c.label.toLowerCase().includes(i))}},f=i=>{i.key==="Escape"&&(r.value=!1,l.value="",d.value=[...a.options])},u=i=>{if(!m.value)return;const c=i.target;c&&!m.value.contains(c)&&!c.closest("[data-multiselect-dropdown]")&&(r.value=!1,l.value="",d.value=[...a.options])};return e.onMounted(()=>{document.addEventListener("click",u),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y)}),e.onUnmounted(()=>{document.removeEventListener("click",u),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)}),e.watch(()=>a.options,i=>{d.value=[...i]},{immediate:!0}),e.watch(r,i=>{i&&y()}),(i,c)=>(e.openBlock(),e.createElementBlock("div",Xp,[e.createElementVNode("button",{ref_key:"buttonRef",ref:m,type:"button",id:t.id,disabled:t.disabled,class:e.normalizeClass(["w-full px-3 py-2.5 text-left border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white min-h-[42px]",t.hasError?"border-red-500":"border-slate-300",t.disabled?"bg-gray-100 cursor-not-allowed opacity-50":"hover:border-slate-400"]),onClick:S,onKeydown:f},[v.value.length===0?(e.openBlock(),e.createElementBlock("div",Jp,e.toDisplayString(t.placeholder||"Select options"),1)):(e.openBlock(),e.createElementBlock("div",Zp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,g=>(e.openBlock(),e.createBlock(na,{key:g,variant:"primary",size:"sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g),1)]),_:2},1024))),128))])),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["absolute right-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400 pointer-events-none transition-transform duration-200",{"rotate-180":r.value}]),fill:"currentColor",viewBox:"0 0 20 20"},[...c[2]||(c[2]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],42,Qp),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(p.value),"data-multiselect-dropdown":"",class:"bg-white shadow-lg max-h-72 rounded-md text-base ring-1 ring-black ring-opacity-5 overflow-hidden focus:outline-none"},[e.createElementVNode("div",eg,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:s,"onUpdate:modelValue":c[0]||(c[0]=g=>l.value=g),type:"text",placeholder:"Search options...",class:"w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white",onInput:k,onKeydown:c[1]||(c[1]=e.withModifiers(()=>{},["stop"]))},null,544),[[e.vModelText,l.value]])]),d.value.length>0?(e.openBlock(),e.createElementBlock("div",tg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,type:"button",class:e.normalizeClass(["cursor-pointer select-none relative py-2.5 pl-3 pr-9 w-full text-left hover:bg-blue-50 focus:bg-blue-50 focus:outline-none transition-colors duration-150",{"bg-blue-50":t.modelValue.includes(g.value)}]),onClick:b=>x(g.value)},[e.createElementVNode("div",ng,[e.createElementVNode("input",{type:"checkbox",checked:t.modelValue.includes(g.value),class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded cursor-pointer pointer-events-none",readonly:"",tabindex:"-1"},null,8,og),e.createElementVNode("span",{class:e.normalizeClass(["block font-normal truncate",{"text-blue-900 font-medium":t.modelValue.includes(g.value)}])},e.toDisplayString(g.label),3)])],10,ag))),128))])):(e.openBlock(),e.createElementBlock("div",rg," No options found "))],4)):e.createCommentVNode("",!0)]),_:1})]))]))}},lg={class:"mb-6"},sg={class:"text-xl font-semibold text-gray-900"},ig={class:"text-sm text-gray-600 mt-1"},cg=["onUpdate:modelValue"],dg={key:4,class:"flex items-center"},ug={key:5,class:"flex items-center"},mg=["id","aria-checked","disabled","onClick"],fg={key:6,class:"space-y-2"},pg={key:7,class:"space-y-2"},gg={key:0,class:"text-xs text-gray-500"},vg={key:9,class:"space-y-2"},hg={class:"flex items-center gap-4"},bg={class:"text-sm font-medium text-gray-700 min-w-[3rem] text-right"},yg={class:"flex justify-end gap-3 pt-6"},qo={__name:"ReusableFormModal",props:{modelValue:{type:Boolean,default:!1},modalType:{type:String,required:!0,validator:t=>["create","edit"].includes(t)},entityName:{type:String,default:"Item"},fields:{type:Array,required:!0,validator:t=>t.every(n=>n.name&&n.label&&n.type&&["text","number","password","textarea","select","checkbox","slider","date","color","email","tel","url","time","datetime-local","month","week","file","radio","switch","range","search","hidden","multiselect"].includes(n.type))},initialData:{type:Object,default:null},loading:{type:Boolean,default:!1},customValidation:{type:Function,default:null},modalSize:{type:String,default:"4xl",validator:t=>["sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","full"].includes(t)},modalHeight:{type:String,default:"auto"},modalResizable:{type:Boolean,default:!1}},emits:["update:modelValue","submit","close"],setup(t,{emit:n}){const a=t,o=n,r=e.computed({get:()=>a.modelValue,set:u=>o("update:modelValue",u)}),l=e.computed(()=>a.loading),s=e.ref({}),d=e.ref({}),m=e.ref(!1),p=()=>{const u={};return a.fields.forEach(i=>{i.type==="checkbox"||i.type==="switch"?u[i.name]=!1:i.type==="number"||i.type==="slider"||i.type==="range"?u[i.name]=i.min!==void 0?i.min:0:i.type==="file"?u[i.name]=null:i.type==="radio"?u[i.name]=i.options?.[0]?.value||"":i.type==="multiselect"?u[i.name]=[]:u[i.name]=""}),u};e.watch(()=>a.initialData,u=>{if(a.modalType==="edit"&&u){const i={};a.fields.forEach(c=>{c.type==="checkbox"||c.type==="switch"?i[c.name]=u[c.name]??!1:c.type==="number"||c.type==="slider"||c.type==="range"?i[c.name]=u[c.name]??(c.min!==void 0?c.min:0):c.type==="file"?i[c.name]=null:c.type==="multiselect"?i[c.name]=Array.isArray(u[c.name])?u[c.name]:[]:i[c.name]=u[c.name]??""}),s.value=i,m.value=!0}else if(a.modalType==="create"&&u&&!m.value){const i={};a.fields.forEach(c=>{u[c.name]!==void 0&&u[c.name]!==null?i[c.name]=u[c.name]:c.type==="checkbox"||c.type==="switch"?i[c.name]=!1:c.type==="number"||c.type==="slider"||c.type==="range"?i[c.name]=c.min!==void 0?c.min:0:c.type==="file"?i[c.name]=null:c.type==="radio"?i[c.name]=c.options?.[0]?.value||"":c.type==="multiselect"?i[c.name]=[]:i[c.name]=""}),s.value=i,m.value=!0}else a.modalType==="create"&&!u&&(s.value=p(),m.value=!1)},{immediate:!0,deep:!0}),e.watch(()=>a.modelValue,u=>{if(u&&(d.value={},a.modalType==="create")){if(m.value=!1,a.initialData){const i={};a.fields.forEach(c=>{a.initialData[c.name]!==void 0&&a.initialData[c.name]!==null?i[c.name]=a.initialData[c.name]:c.type==="checkbox"||c.type==="switch"?i[c.name]=!1:c.type==="number"||c.type==="slider"||c.type==="range"?i[c.name]=c.min!==void 0?c.min:0:c.type==="file"?i[c.name]=null:c.type==="radio"?i[c.name]=c.options?.[0]?.value||"":c.type==="multiselect"?i[c.name]=[]:i[c.name]=""}),s.value=i}else s.value=p();m.value=!0}}),e.watch(()=>a.initialData,u=>{m.value&&u&&Object.keys(u).forEach(i=>{Object.prototype.hasOwnProperty.call(s.value,i)&&u[i]!==void 0&&u[i]!==null&&(s.value[i]=u[i])})},{deep:!0});const v=()=>{if(d.value={},a.fields.forEach(u=>{if(u.required&&!u.disabled&&u.type!=="hidden"){const i=s.value[u.name];u.type==="checkbox"||u.type==="switch"?u.required&&!i&&(d.value[u.name]=u.errorMessage||`${u.label} is required`):u.type==="number"||u.type==="slider"||u.type==="range"?i===""||i===null||i===void 0?d.value[u.name]=u.errorMessage||`${u.label} is required`:u.min!==void 0&&Number(i)<u.min?d.value[u.name]=`${u.label} must be at least ${u.min}`:u.max!==void 0&&Number(i)>u.max&&(d.value[u.name]=`${u.label} must be at most ${u.max}`):u.type==="email"?!i||!i.trim()?d.value[u.name]=u.errorMessage||`${u.label} is required`:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)||(d.value[u.name]="Please enter a valid email address"):u.type==="url"?!i||!i.trim()?d.value[u.name]=u.errorMessage||`${u.label} is required`:/^https?:\/\/.+/.test(i)||(d.value[u.name]="Please enter a valid URL"):u.type==="tel"?(!i||!i.trim())&&(d.value[u.name]=u.errorMessage||`${u.label} is required`):u.type==="file"?i||(d.value[u.name]=u.errorMessage||`${u.label} is required`):u.type==="radio"?i||(d.value[u.name]=u.errorMessage||`${u.label} is required`):u.type==="multiselect"?(!Array.isArray(i)||i.length===0)&&(d.value[u.name]=u.errorMessage||`${u.label} is required`):u.type==="date"||u.type==="time"||u.type==="datetime-local"||u.type==="month"||u.type==="week"?(!i||typeof i=="string"&&!i.trim())&&(d.value[u.name]=u.errorMessage||`${u.label} is required`):u.type==="password"?(!i||typeof i=="string"&&!i.trim())&&(d.value[u.name]=u.errorMessage||`${u.label} is required`):(!i||typeof i=="string"&&!i.trim())&&(d.value[u.name]=u.errorMessage||`${u.label} is required`)}if(u.validate&&typeof u.validate=="function"){const i=u.validate(s.value[u.name],s.value);i&&(d.value[u.name]=i)}}),a.customValidation){const u=a.customValidation(s.value);u&&Object.keys(u).length>0&&(d.value={...d.value,...u})}return Object.keys(d.value).length===0},y=async(u,i)=>{if(s.value[u.name]=i,u.onChange&&typeof u.onChange=="function")try{await u.onChange(i,s.value)}catch(c){console.error("Error in onChange handler:",c),ne.error("An error occurred while processing the change")}},S=(u,i)=>{if(s.value[u.name]=i,u.onChange&&typeof u.onChange=="function")try{u.onChange(i,s.value)}catch(c){console.error("Error in onChange handler:",c),ne.error("An error occurred while processing the change")}},x=(u,i)=>{const c=i.target.files?.[0]||null;if(s.value[u.name]=c,u.onChange&&typeof u.onChange=="function")try{u.onChange(c,s.value)}catch(g){console.error("Error in onChange handler:",g),ne.error("An error occurred while processing the file")}},k=async()=>{try{if(!v()){ne.error("Please fix the validation errors before submitting");return}const u={};a.fields.forEach(i=>{const c=s.value[i.name];i.type==="number"||i.type==="slider"||i.type==="range"?u[i.name]=Number(c):i.type==="text"||i.type==="textarea"||i.type==="date"||i.type==="email"||i.type==="url"||i.type==="tel"||i.type==="search"||i.type==="time"||i.type==="datetime-local"||i.type==="month"||i.type==="week"?u[i.name]=typeof c=="string"?c.trim():c:(i.type==="password"||i.type,u[i.name]=c)}),o("submit",{formData:u,modalType:a.modalType,originalData:a.initialData})}catch(u){console.error("Error during form submission:",u),ne.error("An error occurred during submission")}},f=()=>{s.value=p(),d.value={},m.value=!1,o("close")};return(u,i)=>(e.openBlock(),e.createBlock(mt,{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),"show-close":!0,"close-on-backdrop":!0,size:t.modalSize,class:e.normalizeClass(t.modalHeight==="auto"?"":t.modalHeight),resizable:t.modalResizable,onClose:f},{default:e.withCtx(()=>[e.createElementVNode("div",lg,[e.createElementVNode("h2",sg,e.toDisplayString(t.modalType==="create"?`Add New ${t.entityName}`:`Edit ${t.entityName}`),1),e.createElementVNode("p",ig,e.toDisplayString(t.modalType==="create"?`Fill in the details to create a new ${t.entityName.toLowerCase()}.`:`Update the ${t.entityName.toLowerCase()} information below.`),1)]),e.createElementVNode("form",{class:"space-y-6 overflow-y-auto",onSubmit:e.withModifiers(k,["prevent"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,c=>(e.openBlock(),e.createElementBlock("div",{key:c.name},[c.type==="hidden"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":g=>s.value[c.name]=g,type:"hidden"},null,8,cg)),[[e.vModelText,s.value[c.name]]]):(e.openBlock(),e.createBlock(ut,{key:1,id:`form-${t.entityName}-${c.name}-${Math.random().toString(36).slice(2,5)}`,label:c.label,required:c.required&&!c.disabled,error:d.value[c.name],"error-message":d.value[c.name]},{default:e.withCtx(({fieldId:g,hasError:b,ariaDescribedBy:h})=>[["text","number","password","color","email","tel","url","search"].includes(c.type)?(e.openBlock(),e.createBlock(X,{key:0,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:c.type,placeholder:c.placeholder,disabled:l.value||c.disabled,readonly:c.disabled,class:e.normalizeClass(b?"border-red-500":"border-slate-300"),"aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","disabled","readonly","class","aria-describedby"])):c.type==="textarea"?(e.openBlock(),e.createBlock(dt,{key:1,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,placeholder:c.placeholder,disabled:l.value||c.disabled,rows:c.rows||3,class:e.normalizeClass(["w-full px-3 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",b?"border-red-500":"border-slate-300"]),"aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","placeholder","disabled","rows","class","aria-describedby"])):c.type==="select"?(e.openBlock(),e.createBlock(ue,{key:2,id:g,"model-value":s.value[c.name],options:c.options,placeholder:c.placeholder||"Select an option",disabled:l.value||c.disabled,"has-error":b,"aria-describedby":h,"onUpdate:modelValue":N=>y(c,N)},null,8,["id","model-value","options","placeholder","disabled","has-error","aria-describedby","onUpdate:modelValue"])):c.type==="multiselect"?(e.openBlock(),e.createBlock(Uo,{key:3,id:g,"model-value":s.value[c.name],options:c.options,disabled:l.value||c.disabled,placeholder:c.placeholder||"Select options","has-error":b,"aria-describedby":h,"onUpdate:modelValue":N=>s.value[c.name]=N},null,8,["id","model-value","options","disabled","placeholder","has-error","aria-describedby","onUpdate:modelValue"])):c.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",dg,[e.createVNode(X,{id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:"checkbox",disabled:l.value||c.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded","aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","disabled","aria-describedby"]),e.createVNode(fe,{for:g,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.checkboxLabel||c.label),1)]),_:2},1032,["for"])])):c.type==="switch"?(e.openBlock(),e.createElementBlock("div",ug,[e.createElementVNode("button",{id:g,type:"button",role:"switch","aria-checked":s.value[c.name],disabled:l.value||c.disabled,class:e.normalizeClass(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",s.value[c.name]?"bg-blue-600":"bg-gray-200",l.value||c.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:N=>s.value[c.name]=!s.value[c.name]},[e.createElementVNode("span",{class:e.normalizeClass(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform",s.value[c.name]?"translate-x-6":"translate-x-1"])},null,2)],10,mg),e.createVNode(fe,{for:g,class:"ml-3 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.checkboxLabel||c.label),1)]),_:2},1032,["for"])])):c.type==="radio"?(e.openBlock(),e.createElementBlock("div",fg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.options,N=>(e.openBlock(),e.createElementBlock("div",{key:N.value,class:"flex items-center"},[e.createVNode(X,{id:`${g}-${N.value}`,modelValue:s.value[c.name],"onUpdate:modelValue":P=>s.value[c.name]=P,type:"radio",value:N.value,disabled:l.value||c.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300","aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","value","disabled","aria-describedby"]),e.createVNode(fe,{for:`${g}-${N.value}`,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N.label),1)]),_:2},1032,["for"])]))),128))])):c.type==="file"?(e.openBlock(),e.createElementBlock("div",pg,[e.createVNode(X,{id:g,type:"file",accept:c.accept,disabled:l.value||c.disabled,class:e.normalizeClass(["w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100",b?"border-red-500":"border-slate-300"]),"aria-describedby":h,onChange:N=>x(c,N)},null,8,["id","accept","disabled","class","aria-describedby","onChange"]),c.helpText?(e.openBlock(),e.createElementBlock("p",gg,e.toDisplayString(c.helpText),1)):e.createCommentVNode("",!0)])):c.type==="slider"?(e.openBlock(),e.createBlock(ft,{key:8,"model-value":s.value[c.name],min:c.min,max:c.max,step:c.step,disabled:l.value||c.disabled,"onUpdate:modelValue":N=>S(c,N)},null,8,["model-value","min","max","step","disabled","onUpdate:modelValue"])):c.type==="range"?(e.openBlock(),e.createElementBlock("div",vg,[e.createElementVNode("div",hg,[e.createVNode(X,{id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:"range",min:c.min,max:c.max,step:c.step||1,disabled:l.value||c.disabled,class:"flex-1","aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","min","max","step","disabled","aria-describedby"]),e.createElementVNode("span",bg,e.toDisplayString(s.value[c.name]),1)])])):c.type==="date"?(e.openBlock(),e.createBlock(qe,{key:10,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,disabled:l.value||c.disabled,required:c.required,min:c.min,max:c.max,placeholder:c.placeholder||"Select date",format:c.format||"MM/DD/YYYY",clearable:c.clearable!==!1,"show-today":c.showToday!==!1,"calendar-position":c.calendarPosition||"left-0 bottom-full","aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","disabled","required","min","max","placeholder","format","clearable","show-today","calendar-position","aria-describedby"])):c.type==="time"?(e.openBlock(),e.createBlock(X,{key:11,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:"time",disabled:l.value||c.disabled,class:e.normalizeClass(b?"border-red-500":"border-slate-300"),"aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):c.type==="datetime-local"?(e.openBlock(),e.createBlock(X,{key:12,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:"datetime-local",disabled:l.value||c.disabled,class:e.normalizeClass(b?"border-red-500":"border-slate-300"),"aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):c.type==="month"?(e.openBlock(),e.createBlock(X,{key:13,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:"month",disabled:l.value||c.disabled,class:e.normalizeClass(b?"border-red-500":"border-slate-300"),"aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):c.type==="week"?(e.openBlock(),e.createBlock(X,{key:14,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:"week",disabled:l.value||c.disabled,class:e.normalizeClass(b?"border-red-500":"border-slate-300"),"aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):e.createCommentVNode("",!0)]),_:2},1032,["id","label","required","error","error-message"]))]))),128)),e.createElementVNode("div",yg,[e.createVNode(J,{type:"button",variant:"outline",disabled:l.value,onClick:f},{default:e.withCtx(()=>[...i[1]||(i[1]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["disabled"]),e.createVNode(J,{type:"submit",disabled:l.value,loading:l.value,variant:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.modalType==="create"?`Create ${t.entityName}`:`Update ${t.entityName}`),1)]),_:1},8,["disabled","loading"])])],32)]),_:1},8,["modelValue","size","class","resizable"]))}},xg={class:"w-full p-6"},kg={key:0,class:"mb-6"},wg={class:"text-xl font-semibold text-gray-900"},Cg=["onUpdate:modelValue"],Bg={key:4,class:"flex items-center"},Vg={key:5,class:"flex items-center"},Sg=["id","aria-checked","disabled","onClick"],Eg={key:6,class:"space-y-2"},Ng={key:7,class:"space-y-2"},$g={key:0,class:"text-xs text-gray-500"},zg={key:9,class:"space-y-2"},Dg={class:"flex items-center gap-4"},Tg={class:"text-sm font-medium text-gray-700 min-w-[3rem] text-right"},Ag={class:"flex justify-end gap-3 pt-6"},Ho={__name:"ReusableForm",props:{title:{type:String,default:"Form"},entityName:{type:String,default:"Item"},fields:{type:Array,required:!0,validator:t=>t.every(n=>n.name&&n.label&&n.type&&["text","number","password","textarea","select","checkbox","slider","date","color","email","tel","url","time","datetime-local","month","week","file","radio","switch","range","search","hidden","multiselect"].includes(n.type))},initialData:{type:Object,default:null},loading:{type:Boolean,default:!1},customValidation:{type:Function,default:null}},emits:["submit","reset"],setup(t,{emit:n}){const a=t,o=n,r=e.computed(()=>a.loading),l=e.ref({}),s=e.ref({}),d=e.ref(!1),m=()=>{const f={};return a.fields.forEach(u=>{u.type==="checkbox"||u.type==="switch"?f[u.name]=!1:u.type==="number"||u.type==="slider"||u.type==="range"?f[u.name]=u.min!==void 0?u.min:0:u.type==="file"?f[u.name]=null:u.type==="radio"?f[u.name]=u.options?.[0]?.value||"":u.type==="multiselect"?f[u.name]=[]:f[u.name]=""}),f};e.watch(()=>a.initialData,f=>{if(f){const u={};a.fields.forEach(i=>{i.type==="checkbox"||i.type==="switch"?u[i.name]=f[i.name]??!1:i.type==="number"||i.type==="slider"||i.type==="range"?u[i.name]=f[i.name]??(i.min!==void 0?i.min:0):i.type==="file"?u[i.name]=null:i.type==="multiselect"?u[i.name]=Array.isArray(f[i.name])?f[i.name]:[]:u[i.name]=f[i.name]??""}),l.value=u,d.value=!0}else l.value=m(),d.value=!1},{immediate:!0,deep:!0}),e.watch(()=>a.initialData,f=>{d.value&&f&&Object.keys(f).forEach(u=>{Object.prototype.hasOwnProperty.call(l.value,u)&&f[u]!==void 0&&f[u]!==null&&(l.value[u]=f[u])})},{deep:!0});const p=()=>{if(s.value={},a.fields.forEach(f=>{if(f.required&&!f.disabled&&f.type!=="hidden"){const u=l.value[f.name];f.type==="checkbox"||f.type==="switch"?f.required&&!u&&(s.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="number"||f.type==="slider"||f.type==="range"?u===""||u===null||u===void 0?s.value[f.name]=f.errorMessage||`${f.label} is required`:f.min!==void 0&&Number(u)<f.min?s.value[f.name]=`${f.label} must be at least ${f.min}`:f.max!==void 0&&Number(u)>f.max&&(s.value[f.name]=`${f.label} must be at most ${f.max}`):f.type==="email"?!u||!u.trim()?s.value[f.name]=f.errorMessage||`${f.label} is required`:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(u)||(s.value[f.name]="Please enter a valid email address"):f.type==="url"?!u||!u.trim()?s.value[f.name]=f.errorMessage||`${f.label} is required`:/^https?:\/\/.+/.test(u)||(s.value[f.name]="Please enter a valid URL"):f.type==="tel"?(!u||!u.trim())&&(s.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="file"?u||(s.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="radio"?u||(s.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="multiselect"?(!Array.isArray(u)||u.length===0)&&(s.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="date"||f.type==="time"||f.type==="datetime-local"||f.type==="month"||f.type==="week"?(!u||typeof u=="string"&&!u.trim())&&(s.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="password"?(!u||typeof u=="string"&&!u.trim())&&(s.value[f.name]=f.errorMessage||`${f.label} is required`):(!u||typeof u=="string"&&!u.trim())&&(s.value[f.name]=f.errorMessage||`${f.label} is required`)}if(f.validate&&typeof f.validate=="function"){const u=f.validate(l.value[f.name],l.value);u&&(s.value[f.name]=u)}}),a.customValidation){const f=a.customValidation(l.value);f&&Object.keys(f).length>0&&(s.value={...s.value,...f})}return Object.keys(s.value).length===0},v=async(f,u)=>{if(l.value[f.name]=u,f.onChange&&typeof f.onChange=="function")try{await f.onChange(u,l.value)}catch(i){console.error("Error in onChange handler:",i),ne.error("An error occurred while processing the change")}},y=(f,u)=>{if(l.value[f.name]=u,f.onChange&&typeof f.onChange=="function")try{f.onChange(u,l.value)}catch(i){console.error("Error in onChange handler:",i),ne.error("An error occurred while processing the change")}},S=(f,u)=>{const i=u.target.files?.[0]||null;if(l.value[f.name]=i,f.onChange&&typeof f.onChange=="function")try{f.onChange(i,l.value)}catch(c){console.error("Error in onChange handler:",c),ne.error("An error occurred while processing the file")}},x=async()=>{try{if(!p()){ne.error("Please fix the validation errors before submitting");return}const f={};a.fields.forEach(u=>{const i=l.value[u.name];u.type==="number"||u.type==="slider"||u.type==="range"?f[u.name]=Number(i):u.type==="text"||u.type==="textarea"||u.type==="date"||u.type==="email"||u.type==="url"||u.type==="tel"||u.type==="search"||u.type==="time"||u.type==="datetime-local"||u.type==="month"||u.type==="week"?f[u.name]=typeof i=="string"?i.trim():i:(u.type==="password"||u.type,f[u.name]=i)}),o("submit",{formData:f,originalData:a.initialData})}catch(f){console.error("Error during form submission:",f),ne.error("An error occurred during submission")}},k=()=>{l.value=m(),s.value={},d.value=!1,o("reset")};return(f,u)=>(e.openBlock(),e.createElementBlock("div",xg,[t.title?(e.openBlock(),e.createElementBlock("div",kg,[e.createElementVNode("h2",wg,e.toDisplayString(t.title),1)])):e.createCommentVNode("",!0),e.createElementVNode("form",{class:"space-y-8",onSubmit:e.withModifiers(x,["prevent"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,i=>(e.openBlock(),e.createElementBlock("div",{key:i.name},[i.type==="hidden"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":c=>l.value[i.name]=c,type:"hidden"},null,8,Cg)),[[e.vModelText,l.value[i.name]]]):(e.openBlock(),e.createBlock(ut,{key:1,id:`form-${t.entityName}-${i.name}-${Math.random().toString(36).slice(2,5)}`,label:i.label,required:i.required&&!i.disabled,error:s.value[i.name],"error-message":s.value[i.name]},{default:e.withCtx(({fieldId:c,hasError:g,ariaDescribedBy:b})=>[["text","number","password","color","email","tel","url","search"].includes(i.type)?(e.openBlock(),e.createBlock(X,{key:0,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:i.type,placeholder:i.placeholder,disabled:r.value||i.disabled,readonly:i.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","disabled","readonly","class","aria-describedby"])):i.type==="textarea"?(e.openBlock(),e.createBlock(dt,{key:1,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,placeholder:i.placeholder,disabled:r.value||i.disabled,rows:i.rows||3,class:e.normalizeClass(["w-full px-3 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",g?"border-red-500":"border-slate-300"]),"aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","placeholder","disabled","rows","class","aria-describedby"])):i.type==="select"?(e.openBlock(),e.createBlock(ue,{key:2,id:c,"model-value":l.value[i.name],options:i.options,placeholder:i.placeholder||"Select an option",disabled:r.value||i.disabled,"has-error":g,"aria-describedby":b,"onUpdate:modelValue":h=>v(i,h)},null,8,["id","model-value","options","placeholder","disabled","has-error","aria-describedby","onUpdate:modelValue"])):i.type==="multiselect"?(e.openBlock(),e.createBlock(Uo,{key:3,id:c,"model-value":l.value[i.name],options:i.options,disabled:r.value||i.disabled,placeholder:i.placeholder||"Select options","has-error":g,"aria-describedby":b,"onUpdate:modelValue":h=>l.value[i.name]=h},null,8,["id","model-value","options","disabled","placeholder","has-error","aria-describedby","onUpdate:modelValue"])):i.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",Bg,[e.createVNode(X,{id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:"checkbox",disabled:r.value||i.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded","aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","disabled","aria-describedby"]),e.createVNode(fe,{for:c,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.checkboxLabel||i.label),1)]),_:2},1032,["for"])])):i.type==="switch"?(e.openBlock(),e.createElementBlock("div",Vg,[e.createElementVNode("button",{id:c,type:"button",role:"switch","aria-checked":l.value[i.name],disabled:r.value||i.disabled,class:e.normalizeClass(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",l.value[i.name]?"bg-blue-600":"bg-gray-200",r.value||i.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:h=>l.value[i.name]=!l.value[i.name]},[e.createElementVNode("span",{class:e.normalizeClass(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform",l.value[i.name]?"translate-x-6":"translate-x-1"])},null,2)],10,Sg),e.createVNode(fe,{for:c,class:"ml-3 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.checkboxLabel||i.label),1)]),_:2},1032,["for"])])):i.type==="radio"?(e.openBlock(),e.createElementBlock("div",Eg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.options,h=>(e.openBlock(),e.createElementBlock("div",{key:h.value,class:"flex items-center"},[e.createVNode(X,{id:`${c}-${h.value}`,modelValue:l.value[i.name],"onUpdate:modelValue":N=>l.value[i.name]=N,type:"radio",value:h.value,disabled:r.value||i.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300","aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","value","disabled","aria-describedby"]),e.createVNode(fe,{for:`${c}-${h.value}`,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.label),1)]),_:2},1032,["for"])]))),128))])):i.type==="file"?(e.openBlock(),e.createElementBlock("div",Ng,[e.createVNode(X,{id:c,type:"file",accept:i.accept,disabled:r.value||i.disabled,class:e.normalizeClass(["w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100",g?"border-red-500":"border-slate-300"]),"aria-describedby":b,onChange:h=>S(i,h)},null,8,["id","accept","disabled","class","aria-describedby","onChange"]),i.helpText?(e.openBlock(),e.createElementBlock("p",$g,e.toDisplayString(i.helpText),1)):e.createCommentVNode("",!0)])):i.type==="slider"?(e.openBlock(),e.createBlock(ft,{key:8,"model-value":l.value[i.name],min:i.min,max:i.max,step:i.step,disabled:r.value||i.disabled,"onUpdate:modelValue":h=>y(i,h)},null,8,["model-value","min","max","step","disabled","onUpdate:modelValue"])):i.type==="range"?(e.openBlock(),e.createElementBlock("div",zg,[e.createElementVNode("div",Dg,[e.createVNode(X,{id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:"range",min:i.min,max:i.max,step:i.step||1,disabled:r.value||i.disabled,class:"flex-1","aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","min","max","step","disabled","aria-describedby"]),e.createElementVNode("span",Tg,e.toDisplayString(l.value[i.name]),1)])])):i.type==="date"?(e.openBlock(),e.createBlock(qe,{key:10,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,disabled:r.value||i.disabled,required:i.required,min:i.min,max:i.max,placeholder:i.placeholder||"Select date",format:i.format||"MM/DD/YYYY",clearable:i.clearable!==!1,"show-today":i.showToday!==!1,"calendar-position":i.calendarPosition||"left-0 bottom-full","aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","disabled","required","min","max","placeholder","format","clearable","show-today","calendar-position","aria-describedby"])):i.type==="time"?(e.openBlock(),e.createBlock(X,{key:11,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:"time",disabled:r.value||i.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):i.type==="datetime-local"?(e.openBlock(),e.createBlock(X,{key:12,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:"datetime-local",disabled:r.value||i.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):i.type==="month"?(e.openBlock(),e.createBlock(X,{key:13,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:"month",disabled:r.value||i.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):i.type==="week"?(e.openBlock(),e.createBlock(X,{key:14,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:"week",disabled:r.value||i.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):e.createCommentVNode("",!0)]),_:2},1032,["id","label","required","error","error-message"]))]))),128)),e.createElementVNode("div",Ag,[e.createVNode(J,{type:"button",variant:"outline",disabled:r.value,onClick:k},{default:e.withCtx(()=>[...u[0]||(u[0]=[e.createTextVNode(" Reset ",-1)])]),_:1},8,["disabled"]),e.createVNode(J,{type:"submit",disabled:r.value,loading:r.value,variant:"default"},{default:e.withCtx(()=>[...u[1]||(u[1]=[e.createTextVNode(" Submit ",-1)])]),_:1},8,["disabled","loading"])])],32)]))}},Fg={key:0,class:"flex items-center justify-between p-4 border-b border-gray-200 flex-shrink-0 lg:hidden"},Pg={class:"text-lg font-bold text-gray-900"},Lg={class:"flex-1 overflow-y-auto overflow-x-hidden p-4"},Mg={class:"space-y-2"},jg={key:0},Ig={key:0,class:"absolute top-2 right-2 inline-flex items-center justify-center w-5 h-5 text-xs font-bold rounded-full bg-red-500 text-white"},Og=["onClick"],Rg={key:0,class:"absolute top-2 right-2 inline-flex items-center justify-center w-5 h-5 text-xs font-bold rounded-full bg-red-500 text-white"},_g={key:1,class:"absolute top-1.5 right-1.5 w-2 h-2 bg-blue-500 rounded-full"},Ug={key:1,class:"border-t border-gray-200 p-4 flex-shrink-0"},qg={key:0,class:"absolute top-1.5 right-1.5 w-2 h-2 bg-blue-500 rounded-full"},Hg={class:"sticky top-0 bg-white border-b border-gray-200 z-10"},Yg={class:"flex items-center justify-between p-4"},Wg={class:"flex-1 text-sm font-bold text-gray-900 ml-2"},Gg={class:"p-3"},Kg={class:"space-y-1"},Xg={key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gradient-to-b from-blue-500 to-blue-600 rounded-r-full"},Qg={key:1,class:"ml-2 inline-flex items-center justify-center px-2 py-0.5 text-xs font-bold rounded-full bg-red-500 text-white"},Jg={class:"p-3"},Zg={class:"space-y-1"},ev={key:0,class:"px-3 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wider"},tv={key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gradient-to-b from-blue-500 to-blue-600 rounded-r-full"},Yo={__name:"Sidebar",props:{sidebarWidth:{type:Number,default:130},header:{type:Object,default:null},navigationItems:{type:Array,required:!0},managementSettings:{type:Array,default:()=>[]},showManagementSettings:{type:Boolean,default:!0},mobileOpen:{type:Boolean,default:!1},isManagementSettingsActive:{type:Boolean,default:!1},currentPath:{type:String,default:""}},emits:["navigate","update:mobileOpen"],setup(t,{expose:n,emit:a}){const o=t,r=a,l=e.ref(!1),s=e.ref(!1),d=e.ref(null),m=e.ref(!1),p=e.computed(()=>o.mobileOpen),v=e.computed(()=>l.value?{}:{left:`${o.sidebarWidth}px`}),y=e.computed(()=>l.value?{}:{left:`${o.sidebarWidth}px`}),S=e.computed(()=>{if(l.value)return 0;let E=o.sidebarWidth;return s.value&&(E+=220),m.value&&(E+=220),E}),x=E=>{r("navigate",E),l.value&&k();const I=s.value&&d.value&&d.value.subItems.some(C=>C.route===E.route),j=m.value&&o.managementSettings.some(C=>C.route===E.route);(l.value||!(I||j))&&b()},k=()=>{r("update:mobileOpen",!1)},f=E=>E.subItems&&E.subItems.length>0,u=E=>{m.value&&g(),s.value&&d.value!==E?(c(),setTimeout(()=>{d.value=E,s.value=!0},300)):s.value?d.value===E&&c():(d.value=E,s.value=!0),l.value&&k()},i=()=>{s.value&&c(),m.value?g():m.value=!0,l.value&&k()},c=()=>{s.value=!1,setTimeout(()=>{d.value=null},300)},g=()=>{m.value=!1},b=()=>{c(),g()},h=E=>{x(E)},N=E=>{x(E)},P=E=>{const I=o.currentPath;return E.route?!!(I===E.route||I.startsWith(E.route+"/")):E.subItems&&E.subItems.length>0?E.subItems.some(j=>j.route?I===j.route||I.startsWith(j.route+"/"):!1):!1},H=()=>{const E=l.value;l.value=window.innerWidth<1024,E&&!l.value&&p.value&&k()},_=E=>{E.key==="Escape"&&(s.value||m.value?b():l.value&&p.value&&k())};return e.onMounted(()=>{H(),window.addEventListener("resize",H),document.addEventListener("keydown",_)}),e.onUnmounted(()=>{window.removeEventListener("resize",H),document.removeEventListener("keydown",_)}),n({isMobile:l,isMobileOpen:p,submenuOpen:s,managementSettingsOpen:m,contentMarginLeft:S,closeAllMenus:b}),(E,I)=>{const j=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.Transition,{"enter-active-class":"transition-opacity duration-300","leave-active-class":"transition-opacity duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[p.value&&l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-30 lg:hidden",onClick:k})):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("aside",{class:e.normalizeClass(e.unref(w)("fixed left-0 z-40 border-r overflow-hidden flex flex-col","transition-all duration-300 ease-in-out","bg-white border-gray-200",l.value?e.unref(w)("transform h-screen",p.value?"translate-x-0":"-translate-x-full"):"translate-x-0 h-[calc(100vh-4rem)]")),style:e.normalizeStyle({width:t.sidebarWidth+"px",top:l.value?"0px":"4rem"})},[l.value?(e.openBlock(),e.createElementBlock("div",Fg,[e.createElementVNode("h2",Pg,e.toDisplayString(t.header?.title),1),e.createElementVNode("button",{class:"p-2 rounded-lg text-gray-500 hover:text-gray-900 hover:bg-gray-100 transition-colors","aria-label":"Close sidebar",onClick:k},[...I[0]||(I[0]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])):e.createCommentVNode("",!0),e.createElementVNode("nav",Lg,[e.createElementVNode("div",Mg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.navigationItems,C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.name||C.label},[C.type==="link"?(e.openBlock(),e.createElementBlock("div",jg,[f(C)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(w)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 cursor-pointer group relative py-4 px-3",P(C)?"bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-transparent")),onClick:$=>u(C)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex items-center justify-center rounded-lg transition-colors mb-2","w-12 h-12",P(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"text-gray-500 group-hover:text-gray-900 bg-gray-100 group-hover:bg-gray-200"))},[e.createVNode(M,{icon:C.icon,class:"w-6 h-6"},null,8,["icon"])],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w)("text-xs font-medium text-center",P(C)?"text-blue-700 font-semibold":"text-gray-500 group-hover:text-gray-900"))},e.toDisplayString(C.label),3),C.badge?(e.openBlock(),e.createElementBlock("span",Rg,e.toDisplayString(C.badge),1)):e.createCommentVNode("",!0),P(C)&&f(C)?(e.openBlock(),e.createElementBlock("div",_g)):e.createCommentVNode("",!0)],10,Og)):(e.openBlock(),e.createBlock(j,{key:0,to:C.route,class:e.normalizeClass(e.unref(w)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 group relative py-4 px-3",P(C)?"bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-transparent")),onClick:$=>x(C)},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex items-center justify-center rounded-lg transition-colors mb-2","w-12 h-12",P(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"text-gray-500 group-hover:text-gray-900 bg-gray-100 group-hover:bg-gray-200"))},[e.createVNode(M,{icon:C.icon,class:"w-6 h-6"},null,8,["icon"])],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w)("text-xs font-medium text-center",P(C)?"text-blue-700 font-semibold":"text-gray-500 group-hover:text-gray-900"))},e.toDisplayString(C.label),3),C.badge?(e.openBlock(),e.createElementBlock("span",Ig,e.toDisplayString(C.badge),1)):e.createCommentVNode("",!0)]),_:2},1032,["to","class","onClick"]))])):e.createCommentVNode("",!0)],64))),128))])]),t.showManagementSettings?(e.openBlock(),e.createElementBlock("div",Ug,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 cursor-pointer group relative py-4 px-3",t.isManagementSettingsActive?"bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-transparent")),onClick:i},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex items-center justify-center rounded-lg transition-colors mb-2","w-12 h-12",t.isManagementSettingsActive?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"text-gray-500 group-hover:text-gray-900 bg-gray-100 group-hover:bg-gray-200"))},[e.createVNode(M,{icon:"cog",class:"w-6 h-6"})],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w)("text-xs font-medium text-center",t.isManagementSettingsActive?"text-blue-700 font-semibold":"text-gray-500 group-hover:text-gray-900"))}," Settings ",2),t.isManagementSettingsActive?(e.openBlock(),e.createElementBlock("div",qg)):e.createCommentVNode("",!0)],2)])):e.createCommentVNode("",!0)],6),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 -translate-x-full","enter-to-class":"opacity-100 translate-x-0","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 -translate-x-full"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(e.unref(w)("fixed z-40 bg-white border-r border-gray-200 overflow-y-auto shadow-lg",l.value?"left-0 w-52 top-20 h-screen":"w-56 top-16 h-[calc(100vh-4rem)]")),style:e.normalizeStyle(v.value)},[e.createElementVNode("div",Hg,[e.createElementVNode("div",Yg,[e.createElementVNode("button",{class:"p-2 -ml-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors","aria-label":"Close submenu",onClick:c},[...I[1]||(I[1]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e.createElementVNode("h3",Wg,e.toDisplayString(d.value?.label),1)])]),e.createElementVNode("nav",Gg,[e.createElementVNode("div",Kg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value?.subItems,C=>(e.openBlock(),e.createBlock(j,{key:C.name,to:C.route,class:e.normalizeClass(e.unref(w)("flex items-center px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",P(C)?"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-700 shadow-sm border border-blue-200":"text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent")),onClick:$=>h(C)},{default:e.withCtx(()=>[P(C)?(e.openBlock(),e.createElementBlock("div",Xg)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors ml-2",P(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"bg-gray-100 text-gray-600 group-hover:bg-gray-200"))},[C.icon?(e.openBlock(),e.createBlock(M,{key:0,icon:C.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w)("flex-1 truncate font-semibold",P(C)?"text-blue-700":"text-gray-700"))},e.toDisplayString(C.label),3),C.badge?(e.openBlock(),e.createElementBlock("span",Qg,e.toDisplayString(C.badge),1)):e.createCommentVNode("",!0)]),_:2},1032,["to","class","onClick"]))),128))])])],6)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 -translate-x-full","enter-to-class":"opacity-100 translate-x-0","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 -translate-x-full"},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(e.unref(w)("fixed z-40 bg-white border-r border-gray-200 overflow-y-auto shadow-lg",l.value?"left-0 w-52 top-20 h-full":"w-58 h-[calc(100vh-4rem)]")),style:e.normalizeStyle({...y.value,top:l.value?"55px":"4rem"})},[e.createElementVNode("div",{class:"sticky top-0 z-10 bg-white border-b border-gray-200"},[e.createElementVNode("div",{class:"flex items-center justify-between p-4"},[e.createElementVNode("button",{class:"p-2 -ml-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors","aria-label":"Close management settings",onClick:g},[...I[2]||(I[2]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),I[3]||(I[3]=e.createElementVNode("h3",{class:"flex-1 text-sm font-bold text-gray-900 ml-2"}," Management Settings ",-1))])]),e.createElementVNode("nav",Jg,[e.createElementVNode("div",Zg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.managementSettings,C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.name},[C.type==="section"?(e.openBlock(),e.createElementBlock("div",ev,e.toDisplayString(C.label),1)):C.route?(e.openBlock(),e.createBlock(j,{key:1,to:C.route,class:e.normalizeClass(e.unref(w)("flex items-center px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",P(C)?"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-700 shadow-sm border border-blue-200":"text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent")),onClick:$=>N(C)},{default:e.withCtx(()=>[P(C)?(e.openBlock(),e.createElementBlock("div",tv)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors",P(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"bg-gray-100 text-gray-600 group-hover:bg-gray-200"))},[C.icon?(e.openBlock(),e.createBlock(M,{key:0,icon:C.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w)("flex-1 truncate font-semibold",P(C)?"text-blue-700":"text-gray-700"))},e.toDisplayString(C.label),3)]),_:2},1032,["to","class","onClick"])):e.createCommentVNode("",!0)],64))),128))])])],6)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{"enter-active-class":"transition-opacity duration-300","leave-active-class":"transition-opacity duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(s.value||m.value)&&l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-30 bg-transparent",onClick:b})):e.createCommentVNode("",!0)]),_:1})])}}},Wo={__name:"Timeline",props:{orientation:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex",t.orientation==="vertical"?"flex-col":"flex-row"])},[e.renderSlot(n.$slots,"default")],2))}},av={key:0,class:"absolute left-3 top-0 w-0.5 h-full bg-slate-200"},nv={class:"z-10 flex items-center justify-center w-6 h-6 rounded-full border-2 border-blue-500 bg-white text-blue-500"},ov={class:"text-slate-900 font-medium"},rv={key:0,class:"text-slate-500 text-sm"},lv={class:"mt-2 text-slate-600 text-sm"},Go={__name:"TimelineItem",props:{title:{type:String,required:!0},subtitle:{type:String,default:""},orientation:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex",t.orientation==="vertical"?"items-start mb-8 last:mb-0":"flex-col items-center mx-8 last:mx-0"])},[t.orientation==="vertical"?(e.openBlock(),e.createElementBlock("div",av)):e.createCommentVNode("",!0),e.createElementVNode("div",nv,[e.renderSlot(n.$slots,"icon",{},()=>[a[0]||(a[0]=e.createElementVNode("div",{class:"w-2 h-2 rounded-full bg-blue-500"},null,-1))])]),e.createElementVNode("div",{class:e.normalizeClass(["ml-6",t.orientation==="horizontal"?"mt-2 text-center":""])},[e.createElementVNode("h3",ov,[e.renderSlot(n.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])]),t.subtitle?(e.openBlock(),e.createElementBlock("p",rv,[e.renderSlot(n.$slots,"subtitle",{},()=>[e.createTextVNode(e.toDisplayString(t.subtitle),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",lv,[e.renderSlot(n.$slots,"default")])],2)],2))}},sv={name:"AuthLayout",props:{title:{type:String,default:null},subtitle:{type:String,default:null},primaryLogoPrefix:{type:String,default:"e"},primaryLogoText:{type:String,default:"HORIZON"},secondaryLogoPrefix:{type:String,default:"e"},secondaryLogoText:{type:String,default:"Risk & Compliance"},quote:{type:String,default:""},primaryColor:{type:String,default:"#e74c3c"},backgroundColor:{type:String,default:"#2c2c2c"},backgroundImage:{type:String,default:"https://images.unsplash.com/photo-1497366216548-37526070297c?ixlib=rb-4.0.3&auto=format&fit=crop&w=2069&q=80"},backgroundOpacity:{type:Number,default:.4},companyName:{type:String,default:"SOFTWARE"},companyType:{type:String,default:"TECHNOLOGIES"},companyTagline:{type:String,default:"People | Processes | Governance"},companyInitials:{type:String,default:"ST"},appName:{type:String,default:"eHorizon eBoard X"},appVersion:{type:String,default:"Version 2.0"},copyright:{type:String,default:"Copyright © 2025 Software Technologies Limited"},socialLinks:{type:Array,default:()=>[{name:"linkedin",url:"#",icon:"linkedin-in",variant:"primary"},{name:"facebook",url:"#",icon:"facebook-f",variant:"primary"},{name:"twitter",url:"#",icon:"twitter",variant:"info"}]}},setup(){return{currentYear:e.computed(()=>new Date().getFullYear())}}},iv={class:"container mx-auto px-4 relative z-10"},cv={class:"grid lg:grid-cols-10 gap-8 items-center min-h-screen"},dv={class:"lg:col-span-6 text-white text-center lg:text-left space-y-6"},uv={class:"mb-6"},mv={class:"text-4xl lg:text-6xl font-bold mb-2"},fv={class:"text-white"},pv={class:"flex items-center justify-center lg:justify-start mb-6"},gv={class:"text-3xl lg:text-4xl font-bold text-white"},vv={class:"lg:col-span-4"},hv={class:"bg-white rounded-lg shadow-xl p-6 lg:p-8 max-w-md mx-auto"},bv={key:0,class:"mb-6"},yv={class:"text-center"},xv={class:"text-2xl font-bold text-gray-900"},kv={key:0,class:"text-gray-600 mt-2"},wv={class:"space-y-6"},Cv={key:1,class:"mt-6"},Bv={key:0,class:"mt-6 text-center"},Vv={class:"absolute bottom-4 right-4 text-right"},Sv={class:"flex items-end justify-end mb-2"},Ev={class:"text-right mr-3"},Nv={class:"text-red-500 font-bold text-xs"},$v={class:"text-white text-xs"},zv={class:"text-white/70 text-xs"},Dv={class:"w-8 h-8 bg-red-500 rounded flex items-center justify-center text-white font-bold text-xs"},Tv={class:"text-white/70 text-xs"},Av={class:"absolute bottom-4 left-4 flex gap-2"},Fv=["href"];function Pv(t,n,a,o,r,l){const s=e.resolveComponent("router-view"),d=e.resolveComponent("font-awesome-icon");return e.openBlock(),e.createElementBlock("div",{class:"min-h-screen relative flex items-center justify-center",style:e.normalizeStyle({backgroundColor:a.backgroundColor})},[e.createElementVNode("div",{class:"absolute inset-0 bg-cover bg-center",style:e.normalizeStyle({backgroundImage:`url('${a.backgroundImage}')`,opacity:a.backgroundOpacity})},null,4),e.createElementVNode("div",iv,[e.createElementVNode("div",cv,[e.createElementVNode("div",dv,[e.createElementVNode("div",uv,[e.createElementVNode("div",mv,[e.createElementVNode("span",{style:e.normalizeStyle({color:a.primaryColor})},e.toDisplayString(a.primaryLogoPrefix),5),e.createElementVNode("span",fv,e.toDisplayString(a.primaryLogoText),1)]),e.createElementVNode("div",{class:"h-0.5 w-30 mx-auto lg:mx-0",style:e.normalizeStyle({backgroundColor:a.primaryColor})},null,4)]),e.createElementVNode("div",pv,[e.createElementVNode("div",{class:"flex items-center justify-center w-15 h-15 rounded-lg mr-4 text-white font-bold text-xl",style:e.normalizeStyle({backgroundColor:a.primaryColor})},e.toDisplayString(a.secondaryLogoPrefix),5),e.createElementVNode("span",gv,e.toDisplayString(a.secondaryLogoText),1)]),n[0]||(n[0]=e.createElementVNode("div",{class:"max-w-md mx-auto lg:mx-0"},[e.createElementVNode("p",{class:"text-sm lg:text-base font-light text-white/70 italic leading-relaxed"})],-1))]),e.createElementVNode("div",vv,[e.createElementVNode("div",hv,[t.$slots["card-header"]||a.title?(e.openBlock(),e.createElementBlock("div",bv,[e.renderSlot(t.$slots,"card-header",{},()=>[e.createElementVNode("div",yv,[e.createElementVNode("h1",xv,e.toDisplayString(a.title),1),a.subtitle?(e.openBlock(),e.createElementBlock("p",kv,e.toDisplayString(a.subtitle),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",wv,[e.createVNode(s)]),t.$slots["card-footer"]?(e.openBlock(),e.createElementBlock("div",Cv,[e.renderSlot(t.$slots,"card-footer")])):e.createCommentVNode("",!0)]),t.$slots.links?(e.openBlock(),e.createElementBlock("div",Bv,[e.renderSlot(t.$slots,"links")])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Vv,[e.createElementVNode("div",Sv,[e.createElementVNode("div",Ev,[e.createElementVNode("div",Nv,e.toDisplayString(a.companyName),1),e.createElementVNode("div",$v,e.toDisplayString(a.companyType),1),e.createElementVNode("div",zv,e.toDisplayString(a.companyTagline),1)]),e.createElementVNode("div",Dv,e.toDisplayString(a.companyInitials),1)]),e.createElementVNode("div",Tv,[e.createElementVNode("div",null,e.toDisplayString(a.appName)+" ("+e.toDisplayString(a.appVersion)+")",1),e.createElementVNode("div",null,e.toDisplayString(a.copyright),1)])]),e.createElementVNode("div",Av,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.socialLinks,m=>(e.openBlock(),e.createElementBlock("a",{key:m.name,href:m.url,class:e.normalizeClass(["w-8 h-7 flex items-center justify-center rounded text-xs transition-colors",m.variant==="primary"?"bg-blue-600 hover:bg-blue-700 text-white":m.variant==="info"?"bg-cyan-500 hover:bg-cyan-600 text-white":"bg-gray-600 hover:bg-gray-700 text-white"])},[e.createVNode(d,{icon:["fab",m.icon]},null,8,["icon"])],10,Fv))),128))])],4)}const Ko=pt(sv,[["render",Pv]]),Lv={class:"min-h-screen bg-gray-50"},Mv={class:"flex-1"},jv={key:0,class:"bg-white border-b border-gray-200"},Iv={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4"},Ov={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},Xo={__name:"DefaultLayout",props:{navigationItems:{type:Array,default:()=>[{label:"Home",href:"/",active:!0},{label:"About",href:"/about"},{label:"Services",href:"/services"},{label:"Contact",href:"/contact"}]},breadcrumbItems:{type:Array,default:()=>[]},showBreadcrumb:{type:Boolean,default:!1}},setup(t){return(n,a)=>{const o=e.resolveComponent("Logo"),r=e.resolveComponent("MainNavigation"),l=e.resolveComponent("Button"),s=e.resolveComponent("Header"),d=e.resolveComponent("Breadcrumb"),m=e.resolveComponent("Text"),p=e.resolveComponent("Footer");return e.openBlock(),e.createElementBlock("div",Lv,[e.createVNode(s,null,{logo:e.withCtx(()=>[e.renderSlot(n.$slots,"logo",{},()=>[e.createVNode(o)])]),navigation:e.withCtx(()=>[e.renderSlot(n.$slots,"navigation",{},()=>[e.createVNode(r,{items:t.navigationItems},null,8,["items"])])]),actions:e.withCtx(()=>[e.renderSlot(n.$slots,"header-actions",{},()=>[e.createVNode(l,{variant:"ghost",size:"sm"},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode(" Sign In ",-1)])]),_:1}),e.createVNode(l,{size:"sm"},{default:e.withCtx(()=>[...a[1]||(a[1]=[e.createTextVNode(" Get Started ",-1)])]),_:1})])]),_:3}),e.createElementVNode("main",Mv,[t.showBreadcrumb?(e.openBlock(),e.createElementBlock("div",jv,[e.createElementVNode("div",Iv,[e.renderSlot(n.$slots,"breadcrumb",{},()=>[e.createVNode(d,{items:t.breadcrumbItems},null,8,["items"])])])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ov,[e.renderSlot(n.$slots,"default")])]),e.createVNode(p,null,{brand:e.withCtx(()=>[e.renderSlot(n.$slots,"footer-brand",{},()=>[e.createVNode(o,{class:"mb-4"}),e.createVNode(m,{class:"text-gray-600 max-w-md"},{default:e.withCtx(()=>[...a[2]||(a[2]=[e.createTextVNode(" Your application description goes here. ",-1)])]),_:1})])]),_:3})])}}},Rv={name:"ErrorLayout",props:{errorType:{type:[String,Number],default:"404"},errorCode:{type:[String,Number],default:null},errorTitle:{type:String,default:null},errorMessage:{type:String,default:null},brandName:{type:String,default:"Software Technologies"},showLogo:{type:Boolean,default:!0},showBackground:{type:Boolean,default:!0},showDefaultIllustration:{type:Boolean,default:!0},showDefaultActions:{type:Boolean,default:!0},showHomeButton:{type:Boolean,default:!0},showBackButton:{type:Boolean,default:!0},showRetryButton:{type:Boolean,default:!1},showSupportButton:{type:Boolean,default:!1},showAdditionalInfo:{type:Boolean,default:!1},homeUrl:{type:String,default:"/"},homeButtonText:{type:String,default:"Go Home"},backButtonText:{type:String,default:"Go Back"},retryButtonText:{type:String,default:"Try Again"},helpText:{type:String,default:null},supportUrl:{type:String,default:null}},emits:["retry","back","contact-support"],setup(t,{emit:n}){const a=e.getCurrentInstance(),o=e.inject("$router",null)||a?.appContext.app.config.globalProperties?.$router,r=e.ref(!1),l=e.ref(!1),s=e.ref(navigator.onLine),d=e.ref(`err_${Date.now()}_${Math.random().toString(36).substr(2,9)}`),m=e.ref(!1),p=()=>{s.value=navigator.onLine};e.onMounted(()=>{window.addEventListener("online",p),window.addEventListener("offline",p)}),e.onUnmounted(()=>{window.removeEventListener("online",p),window.removeEventListener("offline",p)});const v=e.computed(()=>{const U={404:{title:"Page Not Found",message:"Sorry, we couldn't find the page you're looking for.",icon:"🔍",color:"#64748b",homeButtonIcon:"🏠",additionalInfo:{title:"What can you do?",items:[{icon:"✓",iconColor:"green-500",text:"Check the URL for typos"},{icon:"✓",iconColor:"green-500",text:"Go back to the previous page"},{icon:"✓",iconColor:"green-500",text:"Visit our homepage"}]}},403:{title:"Unauthorized Access",message:"You are not authorized to view this page.",icon:"🚫",color:"#ef4444",homeButtonIcon:"🔐",additionalInfo:{title:"Why am I seeing this?",items:[{icon:"⚠️",iconColor:"yellow-500",text:"You may need to log in to access this page"},{icon:"⚠️",iconColor:"yellow-500",text:"Your account might not have the required permissions"},{icon:"⚠️",iconColor:"yellow-500",text:"Contact support if you believe this is an error"}]}},401:{title:"Authentication Required",message:"You need to log in to access this resource.",icon:"🔐",color:"#f59e0b",homeButtonIcon:"🔐",additionalInfo:{title:"How to proceed?",items:[{icon:"✓",iconColor:"blue-500",text:"Log in with your credentials"},{icon:"✓",iconColor:"blue-500",text:"Create an account if you don't have one"},{icon:"✓",iconColor:"blue-500",text:"Reset your password if you forgot it"}]}},500:{title:"Internal Server Error",message:"Something went wrong on our end. Please try again later.",icon:"🔧",color:"#ef4444",homeButtonIcon:"🏠",additionalInfo:{title:"What happened?",items:[{icon:"⚠️",iconColor:"red-500",text:"Our servers are experiencing issues"},{icon:"⚠️",iconColor:"red-500",text:"The problem is temporary"},{icon:"⚠️",iconColor:"red-500",text:"Try refreshing the page or come back later"}]}},503:{title:"Service Unavailable",message:"The service is temporarily unavailable. Please try again later.",icon:"🔧",color:"#f59e0b",homeButtonIcon:"🏠",additionalInfo:{title:"Service Status",items:[{icon:"⚠️",iconColor:"amber-500",text:"We're performing scheduled maintenance"},{icon:"⚠️",iconColor:"amber-500",text:"Normal service will resume shortly"},{icon:"⚠️",iconColor:"amber-500",text:"Check our status page for updates"}]}},network:{title:"Network Error",message:"Unable to connect to the server. Please check your internet connection.",icon:"📶",color:"#ef4444",homeButtonIcon:"🏠",additionalInfo:{title:"Connection Issues",items:[{icon:"⚠️",iconColor:"red-500",text:"Check your internet connection"},{icon:"⚠️",iconColor:"red-500",text:"Try refreshing the page"},{icon:"⚠️",iconColor:"red-500",text:"Contact your network administrator"}]}}};return U[t.errorType]||U[404]}),y=e.computed(()=>v.value),S=e.computed(()=>t.errorTitle||y.value.title),x=e.computed(()=>t.errorMessage||y.value.message),k=e.computed(()=>y.value.homeButtonIcon||"🏠"),f=e.computed(()=>t.showAdditionalInfo?y.value.additionalInfo:null),u=()=>{o?o.push(t.homeUrl):window.location.href=t.homeUrl},i=()=>{o&&window.history.length>1?o.back():window.history.length>1?window.history.back():u(),n("back")},c=async()=>{r.value=!0;try{await new Promise(U=>setTimeout(U,1e3)),window.location.reload()}catch(U){console.error("Retry failed:",U)}finally{r.value=!1}n("retry")},g=e.computed(()=>["min-h-screen relative flex items-center justify-center","px-4 sm:px-6 lg:px-8"]),b=e.computed(()=>["absolute inset-0 -z-10"]),h=e.computed(()=>["w-full max-w-2xl mx-auto text-center"]),N=e.computed(()=>["mb-8"]),P=e.computed(()=>["space-y-8"]),H=e.computed(()=>["flex justify-center mb-6"]),_=e.computed(()=>["w-32 h-32 flex items-center justify-center"]),E=e.computed(()=>["space-y-4"]),I=e.computed(()=>["text-6xl font-bold text-slate-300 mb-4"]),j=e.computed(()=>["text-3xl font-bold text-slate-900"]),C=e.computed(()=>["text-lg text-slate-600 max-w-lg mx-auto"]),$=e.computed(()=>["mt-8"]),L=e.computed(()=>["mt-8"]),Y=e.computed(()=>["mt-6"]);return{isRetrying:r,reportSent:l,isOnline:s,errorId:d,isDev:m,errorConfig:y,title:S,message:x,homeButtonIcon:k,additionalInfoConfig:f,goHome:u,goBack:i,retry:c,layoutClasses:g,backgroundClasses:b,contentClasses:h,headerClasses:N,errorContentClasses:P,illustrationClasses:H,iconContainerClasses:_,detailsClasses:E,codeClasses:I,titleClasses:j,messageClasses:C,actionsClasses:$,additionalInfoClasses:L,helpClasses:Y}}},_v={class:"flex justify-center"},Uv={class:"flex items-center gap-3"},qv={class:"text-2xl font-bold text-slate-900"},Hv={key:1,class:"bg-red-100 border border-red-200 rounded-lg p-4 mx-auto max-w-md mb-6"},Yv={class:"flex flex-col sm:flex-row gap-4 justify-center"},Wv=["disabled"],Gv={key:0,class:"animate-spin"},Kv={key:1},Xv=["disabled"],Qv={key:0},Jv={key:1},Zv={key:0,class:"mt-8 max-w-md mx-auto"},e0={class:"bg-white rounded-lg border border-slate-200 shadow-sm p-6"},t0={class:"text-lg font-semibold text-slate-900 mb-4"},a0={class:"space-y-3"},n0={class:"text-sm text-slate-600"},o0=["href"],r0={key:5,class:"text-xs text-slate-400 font-mono mt-4"};function l0(t,n,a,o,r,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(o.layoutClasses)},[a.showBackground?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.backgroundClasses)},[e.renderSlot(t.$slots,"background",{},()=>[n[4]||(n[4]=e.createElementVNode("div",{class:"absolute inset-0 bg-gradient-to-br from-slate-50 to-slate-100"},null,-1))])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.contentClasses)},[t.$slots.header||a.showLogo?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.headerClasses)},[e.renderSlot(t.$slots,"header",{},()=>[e.createElementVNode("div",_v,[e.renderSlot(t.$slots,"logo",{},()=>[e.createElementVNode("div",Uv,[n[5]||(n[5]=e.createElementVNode("div",{class:"w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center"},[e.createElementVNode("span",{class:"text-white font-bold text-lg"},"STL")],-1)),e.createElementVNode("span",qv,e.toDisplayString(a.brandName),1)])])])])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.errorContentClasses)},[t.$slots.illustration||a.showDefaultIllustration?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.illustrationClasses)},[e.renderSlot(t.$slots,"illustration",{},()=>[e.createElementVNode("div",{class:e.normalizeClass(o.iconContainerClasses)},[e.createElementVNode("div",{class:"text-8xl",style:e.normalizeStyle({color:o.errorConfig.color})},e.toDisplayString(o.errorConfig.icon),5)],2)])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.detailsClasses)},[a.errorCode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.codeClasses)},e.toDisplayString(a.errorCode),3)):e.createCommentVNode("",!0),e.createElementVNode("h1",{class:e.normalizeClass(o.titleClasses)},[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)])],2),e.createElementVNode("p",{class:e.normalizeClass(o.messageClasses)},[e.renderSlot(t.$slots,"message",{},()=>[e.createTextVNode(e.toDisplayString(o.message),1)])],2)],2),o.isOnline?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Hv,[...n[6]||(n[6]=[e.createElementVNode("div",{class:"flex items-center justify-center gap-2 text-red-700"},[e.createElementVNode("span",{class:"w-3 h-3 bg-red-500 rounded-full animate-pulse"}),e.createElementVNode("span",{class:"font-medium"},"No Internet Connection")],-1)])])),t.$slots.actions||a.showDefaultActions?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(o.actionsClasses)},[e.renderSlot(t.$slots,"actions",{},()=>[e.createElementVNode("div",Yv,[a.showHomeButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:"bg-blue-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-blue-700 transition-colors flex items-center justify-center gap-2",onClick:n[0]||(n[0]=(...s)=>o.goHome&&o.goHome(...s))},[e.createElementVNode("span",null,e.toDisplayString(o.homeButtonIcon),1),e.createTextVNode(" "+e.toDisplayString(a.homeButtonText),1)])):e.createCommentVNode("",!0),a.showBackButton?(e.openBlock(),e.createElementBlock("button",{key:1,class:"border border-slate-300 text-slate-700 px-6 py-3 rounded-lg font-medium hover:bg-slate-50 transition-colors flex items-center justify-center gap-2",onClick:n[1]||(n[1]=(...s)=>o.goBack&&o.goBack(...s))},[n[7]||(n[7]=e.createElementVNode("span",null,"←",-1)),e.createTextVNode(" "+e.toDisplayString(a.backButtonText),1)])):e.createCommentVNode("",!0),a.showRetryButton?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:o.isRetrying||!o.isOnline,class:"border border-slate-300 text-slate-700 px-6 py-3 rounded-lg font-medium hover:bg-slate-50 transition-colors flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",onClick:n[2]||(n[2]=(...s)=>o.retry&&o.retry(...s))},[o.isRetrying?(e.openBlock(),e.createElementBlock("span",Gv,"↻")):(e.openBlock(),e.createElementBlock("span",Kv,"🔄")),e.createTextVNode(" "+e.toDisplayString(o.isRetrying?"Retrying...":a.retryButtonText),1)],8,Wv)):e.createCommentVNode("",!0),a.showSupportButton?(e.openBlock(),e.createElementBlock("button",{key:3,disabled:o.reportSent,class:"bg-slate-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-slate-700 transition-colors flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",onClick:n[3]||(n[3]=s=>t.$emit("contact-support"))},[o.reportSent?(e.openBlock(),e.createElementBlock("span",Qv,"✓")):(e.openBlock(),e.createElementBlock("span",Jv,"📝")),e.createTextVNode(" "+e.toDisplayString(o.reportSent?"Report Sent":"Contact Support"),1)],8,Xv)):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),t.$slots["additional-info"]||a.showAdditionalInfo?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(o.additionalInfoClasses)},[e.renderSlot(t.$slots,"additional-info",{},()=>[o.additionalInfoConfig?(e.openBlock(),e.createElementBlock("div",Zv,[e.createElementVNode("div",e0,[e.createElementVNode("h3",t0,e.toDisplayString(o.additionalInfoConfig.title),1),e.createElementVNode("ul",a0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.additionalInfoConfig.items,(s,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,class:"flex items-start gap-3 text-sm text-slate-600"},[e.createElementVNode("span",{class:e.normalizeClass(`w-4 h-4 text-${s.iconColor||"slate-400"} flex-shrink-0 mt-0.5`)},e.toDisplayString(s.icon),3),e.createElementVNode("span",null,e.toDisplayString(s.text),1)]))),128))])])])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0),t.$slots.help||a.helpText?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(o.helpClasses)},[e.renderSlot(t.$slots,"help",{},()=>[e.createElementVNode("p",n0,[e.createTextVNode(e.toDisplayString(a.helpText)+" ",1),a.supportUrl?(e.openBlock(),e.createElementBlock("a",{key:0,href:a.supportUrl,class:"text-blue-600 hover:text-blue-700 underline ml-1"},[...n[8]||(n[8]=[e.createElementVNode("span",{class:"inline-block w-4 h-4 mr-1"},"❓",-1),e.createTextVNode(" Get Help ",-1)])],8,o0)):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),o.isDev?(e.openBlock(),e.createElementBlock("div",r0," Error ID: "+e.toDisplayString(o.errorId),1)):e.createCommentVNode("",!0)],2)],2)],2)}const Qo=pt(Rv,[["render",l0]]),Ut={mounted(t,n){if(!n.value)return;const a=Object.keys(n.modifiers)[0]||"top",o=document.createElement("div");o.textContent=n.value,o.className="tooltip-custom",o.style.cssText=`
607
+ `},a=t,o=e.ref(!1),r=()=>o.value=!o.value,l=D.cva("",{variants:{variant:{default:"",bordered:"border border-slate-200 rounded-lg overflow-hidden",filled:"bg-slate-50 border border-slate-200 rounded-lg overflow-hidden",flush:""}}}),s=D.cva("flex items-center justify-between w-full text-left transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",{variants:{size:{sm:"p-3 text-sm",md:"p-4 text-base",lg:"p-6 text-lg"}}}),d=D.cva("overflow-hidden text-slate-600 border-t border-slate-200",{variants:{size:{sm:"p-3 text-sm",md:"p-4 text-base",lg:"p-6 text-lg"}}}),m=e.computed(()=>w(l({variant:a.variant}))),p=e.computed(()=>w(s({size:a.size}))),v=e.computed(()=>w(d({size:a.size})));return(y,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(m.value)},[e.createVNode(J,{class:e.normalizeClass(p.value),"aria-expanded":o.value,onClick:r},{default:e.withCtx(()=>[e.renderSlot(y.$slots,"header",{isOpen:o.value}),e.createVNode(n,{class:e.normalizeClass(e.unref(w)("w-5 h-5 transition-transform ml-2",{"rotate-180":o.value}))},null,8,["class"])]),_:3},8,["class","aria-expanded"]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-96","leave-active-class":"transition-all duration-200 ease-in","leave-from-class":"opacity-100 max-h-96","leave-to-class":"opacity-0 max-h-0"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(v.value)},[e.renderSlot(y.$slots,"content",{isOpen:o.value})],2)):e.createCommentVNode("",!0)]),_:3})],2))}},gu={class:"relative w-full"},vu={class:"relative"},hu=["id","value","disabled","placeholder","required","aria-describedby"],bu={class:"flex items-center justify-between mb-3"},yu={class:"text-sm font-medium"},xu={class:"grid grid-cols-7 gap-1 mb-2"},ku={class:"grid grid-cols-7 gap-1"},wu=["disabled","onClick"],Cu={key:0,class:"mt-4 pt-3 border-t border-slate-200"},To={__name:"Calendar",props:{id:String,modelValue:[String,Date],disabled:Boolean,required:Boolean,min:[String,Date],max:[String,Date],placeholder:{type:String,default:"Select date"},format:{type:String,default:"MM/DD/YYYY"},clearable:{type:Boolean,default:!0},showToday:{type:Boolean,default:!0},calendarPosition:{type:String,default:"left-0"},ariaDescribedby:String},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=new Date,s=e.ref(l.getMonth()),d=e.ref(l.getFullYear()),m=e.ref(null),p=["Su","Mo","Tu","We","Th","Fr","Sa"],v=e.computed(()=>new Date(d.value,s.value).toLocaleString("default",{month:"long"})),y=e.computed(()=>new Date(d.value,s.value+1,0).getDate()),S=e.computed(()=>new Date(d.value,s.value,1).getDay()),x=e.computed(()=>{const j=new Date(d.value,s.value,0).getDate(),C=S.value;return Array.from({length:C},($,L)=>j-C+L+1)}),k=e.computed(()=>{const j=x.value.length+y.value,C=j%7===0?0:7-j%7;return Array.from({length:C},($,L)=>L+1)}),f=e.computed(()=>m.value?u(m.value):"");function u(j){if(!j)return"";const C=new Date(j),$=String(C.getMonth()+1).padStart(2,"0"),L=String(C.getDate()).padStart(2,"0"),Y=C.getFullYear();return a.format.replace("MM",$).replace("DD",L).replace("YYYY",Y)}function i(j){if(!j)return null;if(j instanceof Date)return j;const C=new Date(j);return isNaN(C.getTime())?null:C}function c(j){if(!m.value)return!1;const C=new Date(m.value);return C.getDate()===j&&C.getMonth()===s.value&&C.getFullYear()===d.value}function g(j){const C=new Date(d.value,s.value,j);if(a.min){const $=i(a.min);if($&&C<$)return!0}if(a.max){const $=i(a.max);if($&&C>$)return!0}return!1}function b(){a.disabled||(r.value=!r.value)}function h(){r.value=!1}function N(){s.value===0?(s.value=11,d.value--):s.value--}function P(){s.value===11?(s.value=0,d.value++):s.value++}function H(j){if(g(j))return;const C=new Date(d.value,s.value,j);m.value=C,o("update:modelValue",C.toISOString().split("T")[0]),r.value=!1}function _(){s.value=l.getMonth(),d.value=l.getFullYear(),H(l.getDate())}function E(){m.value=null,o("update:modelValue","")}e.watch(()=>a.modelValue,j=>{if(j){const C=i(j);C&&(m.value=C,s.value=C.getMonth(),d.value=C.getFullYear())}else m.value=null},{immediate:!0});function I(j){j.key==="Escape"&&r.value&&h()}return e.onMounted(()=>{document.addEventListener("keydown",I)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",I)}),(j,C)=>(e.openBlock(),e.createElementBlock("div",gu,[e.createElementVNode("div",vu,[e.createElementVNode("input",{id:t.id,type:"text",value:f.value,readonly:"",disabled:t.disabled,placeholder:t.placeholder,required:t.required,"aria-describedby":t.ariaDescribedby,class:"w-full px-3 py-2 pr-10 border border-slate-300 rounded-md bg-white text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 cursor-pointer disabled:bg-slate-50 disabled:text-slate-500 disabled:cursor-not-allowed",onClick:b},null,8,hu),C[2]||(C[2]=e.createElementVNode("div",{class:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"},[e.createElementVNode("svg",{class:"w-5 h-5 text-slate-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})])],-1)),t.clearable&&f.value&&!t.disabled?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute right-9 top-1/2 -translate-y-1/2 p-1 hover:bg-slate-100 rounded","aria-label":"Clear date",onClick:e.withModifiers(E,["stop"])},[...C[1]||(C[1]=[e.createElementVNode("svg",{class:"w-4 h-4 text-slate-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["absolute z-[99999] mt-2 bg-white border border-slate-200 rounded-lg shadow-lg p-4",t.calendarPosition]),onClick:C[0]||(C[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",bu,[e.createElementVNode("button",{type:"button",class:"p-1 hover:bg-gray-100 rounded","aria-label":"Previous Month",onClick:N},[...C[3]||(C[3]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 18l-6-6 6-6"})],-1)])]),e.createElementVNode("div",yu,e.toDisplayString(v.value)+" "+e.toDisplayString(d.value),1),e.createElementVNode("button",{type:"button",class:"p-1 hover:bg-gray-100 rounded","aria-label":"Next Month",onClick:P},[...C[4]||(C[4]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 18l6-6-6-6"})],-1)])])]),e.createElementVNode("div",xu,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(p,$=>e.createElementVNode("div",{key:$,class:"text-center text-xs font-medium text-slate-600 py-1"},e.toDisplayString($),1)),64))]),e.createElementVNode("div",ku,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,($,L)=>(e.openBlock(),e.createElementBlock("div",{key:"prev-"+L,class:"text-center text-sm text-slate-300 py-2"},e.toDisplayString($),1))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,$=>(e.openBlock(),e.createElementBlock("button",{key:$,type:"button",disabled:g($),class:e.normalizeClass(["w-8 h-8 text-sm rounded flex items-center justify-center",c($)?"bg-blue-500 text-white":"hover:bg-gray-100",g($)?"text-gray-300 cursor-not-allowed":""]),onClick:L=>H($)},e.toDisplayString($),11,wu))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,($,L)=>(e.openBlock(),e.createElementBlock("div",{key:"next-"+L,class:"text-center text-sm text-slate-300 py-2"},e.toDisplayString($),1))),128))]),t.showToday?(e.openBlock(),e.createElementBlock("div",Cu,[e.createElementVNode("button",{type:"button",class:"w-full px-3 py-2 text-sm font-medium text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",onClick:_}," Today ")])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0)]),_:1}),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-[99998]",onClick:h})):e.createCommentVNode("",!0)]))}},Bu={class:"flex items-start justify-between"},Vu={class:"flex-1 min-w-0"},Su={key:0,class:"flex-shrink-0 ml-4"},Eu="text-lg font-semibold text-slate-900 truncate",Nu="text-sm text-slate-600 mt-1",Ao={__name:"Graph",props:{variant:{type:String,default:"default",validator:t=>["default","outlined","elevated","filled"].includes(t)},padding:{type:String,default:"md",validator:t=>["none","sm","md","lg","xl"].includes(t)},title:String,description:String},setup(t){const n=D.cva("rounded-lg overflow-hidden transition-all duration-200",{variants:{variant:{default:"bg-white border border-slate-200",outlined:"bg-white border-2 border-slate-300",elevated:"bg-white shadow-lg border border-slate-100",filled:"bg-slate-50 border border-slate-200"},padding:{none:"",sm:"p-3",md:"p-4",lg:"p-6",xl:"p-8"}},defaultVariants:{variant:"default",padding:"md"}}),a=D.cva("border-b border-slate-100 last:border-b-0",{variants:{padding:{none:"p-4 pb-0",sm:"px-3 pt-3",md:"px-4 pt-4",lg:"px-6 pt-6",xl:"px-8 pt-8"}}}),o=D.cva("border-b border-slate-100",{variants:{padding:{none:"p-4 pb-0",sm:"px-3 py-3",md:"px-4 py-4",lg:"px-6 py-6",xl:"px-8 py-8"}}}),r=D.cva("",{variants:{padding:{none:"p-4",sm:"p-3",md:"p-4",lg:"p-6",xl:"p-8"}}}),l=D.cva("border-t border-slate-100 bg-slate-50/50",{variants:{padding:{none:"p-4 pt-0",sm:"px-3 pb-3",md:"px-4 pb-4",lg:"px-6 pb-6",xl:"px-8 pb-8"}}}),s=D.cva("border-t border-slate-100 bg-slate-50/50",{variants:{padding:{none:"p-4 pt-0",sm:"px-3 pb-3",md:"px-4 pb-4",lg:"px-6 pb-6",xl:"px-8 pb-8"}}});return(d,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(w)(e.unref(n)({variant:t.variant,padding:t.padding})))},[d.$slots.header||t.title||t.description?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(w)(e.unref(a)({padding:t.padding})))},[e.renderSlot(d.$slots,"header",{},()=>[e.createElementVNode("div",Bu,[e.createElementVNode("div",Vu,[t.title?(e.openBlock(),e.createElementBlock("h3",{key:0,class:e.normalizeClass(Eu)},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(Nu)},e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),d.$slots.actions?(e.openBlock(),e.createElementBlock("div",Su,[e.renderSlot(d.$slots,"actions")])):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),d.$slots.filters?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(w)(e.unref(o)({padding:t.padding})))},[e.renderSlot(d.$slots,"filters")],2)):e.createCommentVNode("",!0),d.$slots.default?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(e.unref(w)(e.unref(r)({padding:t.padding})))},[e.renderSlot(d.$slots,"default")],2)):e.createCommentVNode("",!0),d.$slots.legend?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(e.unref(w)(e.unref(l)({padding:t.padding})))},[e.renderSlot(d.$slots,"legend")],2)):e.createCommentVNode("",!0),d.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(e.unref(w)(e.unref(s)({padding:t.padding})))},[e.renderSlot(d.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}},$u={class:"w-full h-full"},zu=["width","height","viewBox"],Du={key:0},Tu=["x1","y1","x2","y2","stroke"],Au=["x","y","width","height","fill","onMouseenter"],Fu={key:1},Pu=["x","y"],Lu={key:2},Mu=["x","y"],ju={key:3},Iu=["x","y","width","height","fill","stroke"],Ou=["x","y"],Fo={__name:"BarChart",props:{data:{type:Array,required:!0},labels:{type:Array,default:()=>[]},colors:{type:Array,default:()=>["#3b82f6","#ef4444","#10b981","#f59e0b","#8b5cf6"]},width:{type:Number,default:400},height:{type:Number,default:300},padding:{type:Object,default:()=>({top:20,right:20,bottom:60,left:60})},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},gridColor:{type:String,default:"#e5e7eb"},barClasses:{type:String,default:"transition-all duration-200 hover:opacity-80 cursor-pointer"},axisLabelClasses:{type:String,default:"fill-slate-600 text-xs font-medium"},tooltipBackground:{type:String,default:"#1f2937"},tooltipBorder:{type:String,default:"#374151"},tooltipTextClasses:{type:String,default:"fill-white text-xs font-medium"},maxValue:{type:Number,default:null}},emits:["bar-click","bar-hover"],setup(t,{emit:n}){const a=t,o=n,r=e.ref({visible:!1,x:0,y:0,width:0,height:0,content:""}),l=e.computed(()=>a.maxValue||Math.max(...a.data)),s=e.computed(()=>(a.width-a.padding.left-a.padding.right)/a.data.length*.8),d=e.computed(()=>(a.width-a.padding.left-a.padding.right)/a.data.length*.2),m=e.computed(()=>{const u=[],i=a.height-a.padding.top-a.padding.bottom,c=5;for(let g=0;g<=c;g++){const b=a.padding.top+i/c*g;u.push(b)}return u}),p=u=>a.padding.left+u*(s.value+d.value)+d.value/2,v=u=>{const i=a.height-a.padding.top-a.padding.bottom,c=i/l.value;return a.padding.top+i-u*c},y=u=>{const c=(a.height-a.padding.top-a.padding.bottom)/l.value;return u*c},S=u=>a.colors[u%a.colors.length],x=u=>{const i=a.height-a.padding.top-a.padding.bottom,c=(a.height-a.padding.bottom-u)/i*l.value;return Math.round(c)},k=(u,i,c)=>{const g=u.target.getBoundingClientRect(),b=a.labels[c]||`Item ${c+1}`;r.value={visible:!0,x:g.left+g.width/2,y:g.top,width:80,height:24,content:`${b}: ${i}`},o("bar-hover",{value:i,index:c,label:b})},f=()=>{r.value.visible=!1};return(u,i)=>(e.openBlock(),e.createElementBlock("div",$u,[(e.openBlock(),e.createElementBlock("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,class:"overflow-visible"},[t.showGrid?(e.openBlock(),e.createElementBlock("g",Du,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,c=>(e.openBlock(),e.createElementBlock("line",{key:`grid-${c}`,x1:t.padding.left,y1:c,x2:t.width-t.padding.right,y2:c,stroke:t.gridColor,"stroke-width":"1","stroke-dasharray":"2,2"},null,8,Tu))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.data,(c,g)=>(e.openBlock(),e.createElementBlock("rect",{key:`bar-${g}`,x:p(g),y:v(c),width:s.value,height:y(c),fill:S(g),class:e.normalizeClass(t.barClasses),onMouseenter:b=>k(b,c,g),onMouseleave:f},null,42,Au))),128))]),t.showXAxis?(e.openBlock(),e.createElementBlock("g",Fu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.labels,(c,g)=>(e.openBlock(),e.createElementBlock("text",{key:`xlabel-${g}`,x:p(g)+s.value/2,y:t.height-t.padding.bottom+20,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"middle"},e.toDisplayString(c),11,Pu))),128))])):e.createCommentVNode("",!0),t.showYAxis?(e.openBlock(),e.createElementBlock("g",Lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,c=>(e.openBlock(),e.createElementBlock("text",{key:`ylabel-${c}`,x:t.padding.left-10,y:c+4,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"end"},e.toDisplayString(x(c)),11,Mu))),128))])):e.createCommentVNode("",!0),r.value.visible?(e.openBlock(),e.createElementBlock("g",ju,[e.createElementVNode("rect",{x:r.value.x-r.value.width/2,y:r.value.y-r.value.height-10,width:r.value.width,height:r.value.height,fill:t.tooltipBackground,stroke:t.tooltipBorder,"stroke-width":"1",rx:"4"},null,8,Iu),e.createElementVNode("text",{x:r.value.x,y:r.value.y-r.value.height/2-2,class:e.normalizeClass(t.tooltipTextClasses),"text-anchor":"middle"},e.toDisplayString(r.value.content),11,Ou)])):e.createCommentVNode("",!0)],8,zu))]))}},Ru={class:"w-full h-full"},_u=["width","height","viewBox"],Uu={key:0},qu=["x1","y1","x2","y2","stroke"],Hu=["d","stroke","stroke-width"],Yu={key:1},Wu=["cx","cy","r","fill","stroke","onMouseenter"],Gu=["d","fill","fill-opacity"],Ku={key:3},Xu=["x","y"],Qu={key:4},Ju=["x","y"],Zu={key:5},em=["x","y","width","height","fill","stroke"],tm=["x","y"],Po={__name:"LineChart",props:{data:{type:Array,required:!0},labels:{type:Array,default:()=>[]},width:{type:Number||String,default:400},height:{type:Number,default:300},padding:{type:Object,default:()=>({top:20,right:20,bottom:60,left:60})},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},showPoints:{type:Boolean,default:!0},fillArea:{type:Boolean,default:!1},gridColor:{type:String,default:"#e5e7eb"},lineColor:{type:String,default:"#3b82f6"},strokeWidth:{type:Number,default:2},pointRadius:{type:Number,default:4},pointColor:{type:String,default:"#ffffff"},fillColor:{type:String,default:"#3b82f6"},fillOpacity:{type:Number,default:.1},lineClasses:{type:String,default:"transition-all duration-200"},pointClasses:{type:String,default:"transition-all duration-200 hover:r-6 cursor-pointer"},axisLabelClasses:{type:String,default:"fill-slate-600 text-xs font-medium"},tooltipBackground:{type:String,default:"#1f2937"},tooltipBorder:{type:String,default:"#374151"},tooltipTextClasses:{type:String,default:"fill-white text-xs font-medium"},maxValue:{type:Number,default:null}},emits:["point-click","point-hover"],setup(t,{emit:n}){const a=t,o=n,r=e.ref({visible:!1,x:0,y:0,width:0,height:0,content:""}),l=e.computed(()=>a.maxValue||Math.max(...a.data)),s=e.computed(()=>a.data.map((f,u)=>({x:v(u),y:y(f),value:f}))),d=e.computed(()=>s.value.length===0?"":s.value.map((u,i)=>`${i===0?"M":"L"} ${u.x} ${u.y}`).join(" ")),m=e.computed(()=>{if(s.value.length===0)return"";const f=s.value.map((c,g)=>`${g===0?"M":"L"} ${c.x} ${c.y}`).join(" "),u=a.height-a.padding.bottom,i=`L ${s.value[s.value.length-1].x} ${u} L ${s.value[0].x} ${u} Z`;return f+" "+i}),p=e.computed(()=>{const f=[],u=a.height-a.padding.top-a.padding.bottom,i=5;for(let c=0;c<=i;c++){const g=a.padding.top+u/i*c;f.push(g)}return f}),v=f=>{const i=(a.width-a.padding.left-a.padding.right)/(a.data.length-1||1);return a.padding.left+f*i},y=f=>{const u=a.height-a.padding.top-a.padding.bottom,i=u/l.value;return a.padding.top+u-f*i},S=f=>{const u=a.height-a.padding.top-a.padding.bottom,i=(a.height-a.padding.bottom-f)/u*l.value;return Math.round(i)},x=(f,u,i)=>{const c=f.target.getBoundingClientRect(),g=a.labels[i]||`Point ${i+1}`;r.value={visible:!0,x:c.left+c.width/2,y:c.top,width:80,height:24,content:`${g}: ${u}`},o("point-hover",{value:u,index:i,label:g})},k=()=>{r.value.visible=!1};return(f,u)=>(e.openBlock(),e.createElementBlock("div",Ru,[(e.openBlock(),e.createElementBlock("svg",{width:t.width,height:t.height,viewBox:`0 0 ${t.width} ${t.height}`,class:"overflow-visible"},[t.showGrid?(e.openBlock(),e.createElementBlock("g",Uu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,i=>(e.openBlock(),e.createElementBlock("line",{key:`grid-${i}`,x1:t.padding.left,y1:i,x2:t.width-t.padding.right,y2:i,stroke:t.gridColor,"stroke-width":"1","stroke-dasharray":"2,2"},null,8,qu))),128))])):e.createCommentVNode("",!0),e.createElementVNode("path",{d:d.value,stroke:t.lineColor,"stroke-width":t.strokeWidth,fill:"none",class:e.normalizeClass(t.lineClasses)},null,10,Hu),t.showPoints?(e.openBlock(),e.createElementBlock("g",Yu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(i,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:i.x,cy:i.y,r:t.pointRadius,fill:t.pointColor,stroke:t.lineColor,"stroke-width":2,class:e.normalizeClass(t.pointClasses),onMouseenter:g=>x(g,i.value,c),onMouseleave:k},null,42,Wu))),128))])):e.createCommentVNode("",!0),t.fillArea?(e.openBlock(),e.createElementBlock("path",{key:2,d:m.value,fill:t.fillColor,"fill-opacity":t.fillOpacity},null,8,Gu)):e.createCommentVNode("",!0),t.showXAxis?(e.openBlock(),e.createElementBlock("g",Ku,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.labels,(i,c)=>(e.openBlock(),e.createElementBlock("text",{key:`xlabel-${c}`,x:v(c),y:t.height-t.padding.bottom+20,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"middle"},e.toDisplayString(i),11,Xu))),128))])):e.createCommentVNode("",!0),t.showYAxis?(e.openBlock(),e.createElementBlock("g",Qu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,i=>(e.openBlock(),e.createElementBlock("text",{key:`ylabel-${i}`,x:t.padding.left-10,y:i+4,class:e.normalizeClass(t.axisLabelClasses),"text-anchor":"end"},e.toDisplayString(S(i)),11,Ju))),128))])):e.createCommentVNode("",!0),r.value.visible?(e.openBlock(),e.createElementBlock("g",Zu,[e.createElementVNode("rect",{x:r.value.x-r.value.width/2,y:r.value.y-r.value.height-10,width:r.value.width,height:r.value.height,fill:t.tooltipBackground,stroke:t.tooltipBorder,"stroke-width":"1",rx:"4"},null,8,em),e.createElementVNode("text",{x:r.value.x,y:r.value.y-r.value.height/2-2,class:e.normalizeClass(t.tooltipTextClasses),"text-anchor":"middle"},e.toDisplayString(r.value.content),11,tm)])):e.createCommentVNode("",!0)],8,_u))]))}},am={class:"bg-white border-b border-gray-200"},nm={key:0,class:"flex items-center gap-3 min-w-64"},om={class:"relative flex-1"},rm={class:"relative flex-1"},lm={key:1,class:"min-w-40"},sm={class:"relative"},im={key:2,class:"min-w-40"},cm={class:"relative"},dm=["value"],um={key:3,class:"flex items-center gap-2"},mm={class:"flex items-center gap-3 ml-auto"},fm={class:"flex items-center gap-3 flex-wrap"},pm=["onClick"],Lo={__name:"GraphFilters",props:{showDateFilter:{type:Boolean,default:!0},showChartTypeFilter:{type:Boolean,default:!0},showExport:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!0},dataSources:{type:Array,default:()=>[]},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:dateFrom","update:dateTo","update:chartType","update:dataSource","export","refresh","clear-filters"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),l=e.ref(""),s=e.ref("bar"),d=e.ref(""),m=D.cva("flex flex-wrap items-center gap-4",{variants:{variant:{default:"bg-white",minimal:"bg-transparent",bordered:"bg-gray-50"},padding:{compact:"px-4 py-3",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),p=e.computed(()=>r.value||l.value||d.value),v=e.computed(()=>{const _=[];if(r.value||l.value){let E="";r.value&&l.value?E=`${r.value} to ${l.value}`:r.value?E=`From ${r.value}`:l.value&&(E=`Until ${l.value}`),E&&_.push({key:"date",label:"Date Range",value:E,icon:"calendar"})}if(d.value){const E=a.dataSources.find(I=>I.value===d.value);_.push({key:"dataSource",label:"Data Source",value:E?.label||d.value,icon:"database"})}return _}),y=e.computed(()=>w(m({variant:a.variant,padding:a.padding}))),S=e.computed(()=>"w-full pl-10 pr-3 py-2 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm"),x=e.computed(()=>"w-full pr-8 appearance-none border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent text-sm py-2 pl-3"),k=e.computed(()=>"text-gray-700 hover:text-gray-900 border border-gray-200 hover:bg-gray-50 bg-white px-3 py-2 rounded-lg text-sm font-medium transition-all"),f=e.computed(()=>"text-white bg-blue-600 hover:bg-blue-700 border border-blue-600 px-3 py-2 rounded-lg text-sm font-medium transition-all"),u=e.computed(()=>"text-gray-700 hover:text-gray-900 border border-gray-200 hover:bg-gray-50 bg-white px-3 py-2 rounded-lg text-sm font-medium transition-all"),i=e.computed(()=>"px-6 py-3 bg-blue-50 border-t border-blue-100"),c=e.computed(()=>"text-sm font-semibold text-blue-800"),g=e.computed(()=>"flex items-center gap-1.5 bg-white border border-blue-200 text-blue-800 px-3 py-1.5 rounded-full text-sm font-medium"),b=e.computed(()=>"text-blue-600 hover:text-blue-800 ml-1 hover:bg-blue-100 rounded-full p-0.5 transition-all"),h=_=>{s.value=_.target.value,o("update:chartType",_.target.value)},N=_=>{d.value=_.target.value,o("update:dataSource",_.target.value)},P=()=>{r.value="",l.value="",d.value="",o("clear-filters")},H=_=>{switch(_){case"date":r.value="",l.value="";break;case"dataSource":d.value="";break}};return e.watch(()=>r.value,_=>{o("update:dateFrom",_)}),e.watch(()=>l.value,_=>{o("update:dateTo",_)}),(_,E)=>(e.openBlock(),e.createElementBlock("div",am,[e.createElementVNode("div",{class:e.normalizeClass(y.value)},[t.showDateFilter?(e.openBlock(),e.createElementBlock("div",nm,[e.createElementVNode("div",om,[e.createVNode(M,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E[0]||(E[0]=I=>r.value=I),type:"date",class:e.normalizeClass(S.value),placeholder:"From date"},null,2),[[e.vModelText,r.value]])]),E[6]||(E[6]=e.createElementVNode("span",{class:"text-gray-500 text-sm"},"to",-1)),e.createElementVNode("div",rm,[e.createVNode(M,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E[1]||(E[1]=I=>l.value=I),type:"date",class:e.normalizeClass(S.value),placeholder:"To date"},null,2),[[e.vModelText,l.value]])])])):e.createCommentVNode("",!0),t.showChartTypeFilter?(e.openBlock(),e.createElementBlock("div",lm,[e.createElementVNode("div",sm,[e.createVNode(ue,{modelValue:s.value,"onUpdate:modelValue":E[2]||(E[2]=I=>s.value=I),class:e.normalizeClass(x.value),onChange:h},{default:e.withCtx(()=>[...E[7]||(E[7]=[e.createElementVNode("option",{value:"bar"}," Bar Chart ",-1),e.createElementVNode("option",{value:"line"}," Line Chart ",-1),e.createElementVNode("option",{value:"pie"}," Pie Chart ",-1)])]),_:1},8,["modelValue","class"]),e.createVNode(M,{icon:"chart-bar",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])])):e.createCommentVNode("",!0),t.dataSources.length>0?(e.openBlock(),e.createElementBlock("div",im,[e.createElementVNode("div",cm,[e.createVNode(ue,{modelValue:d.value,"onUpdate:modelValue":E[3]||(E[3]=I=>d.value=I),class:e.normalizeClass(x.value),onChange:N},{default:e.withCtx(()=>[E[8]||(E[8]=e.createElementVNode("option",{value:""}," All Sources ",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dataSources,I=>(e.openBlock(),e.createElementBlock("option",{key:I.value,value:I.value},e.toDisplayString(I.label),9,dm))),128))]),_:1},8,["modelValue","class"]),e.createVNode(M,{icon:"database",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])])):e.createCommentVNode("",!0),_.$slots.filters?(e.openBlock(),e.createElementBlock("div",um,[e.renderSlot(_.$slots,"filters")])):e.createCommentVNode("",!0),e.createElementVNode("div",mm,[p.value?(e.openBlock(),e.createBlock(J,{key:0,class:e.normalizeClass(k.value),onClick:P},{default:e.withCtx(()=>[e.createVNode(M,{icon:"rotate-left",class:"w-4 h-4 mr-2"}),E[9]||(E[9]=e.createTextVNode(" Clear Filters ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showExport?(e.openBlock(),e.createBlock(J,{key:1,class:e.normalizeClass(f.value),onClick:E[4]||(E[4]=I=>_.$emit("export"))},{default:e.withCtx(()=>[e.createVNode(M,{icon:"download",class:"w-4 h-4 mr-2"}),E[10]||(E[10]=e.createTextVNode(" Export ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showRefresh?(e.openBlock(),e.createBlock(J,{key:2,class:e.normalizeClass(u.value),onClick:E[5]||(E[5]=I=>_.$emit("refresh"))},{default:e.withCtx(()=>[e.createVNode(M,{icon:"sync",class:"w-4 h-4 mr-2"}),E[11]||(E[11]=e.createTextVNode(" Refresh ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0)])],2),v.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(i.value)},[e.createElementVNode("div",fm,[e.createElementVNode("span",{class:e.normalizeClass(c.value)},"Active filters:",2),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,I=>(e.openBlock(),e.createElementBlock("div",{key:I.key,class:e.normalizeClass(g.value)},[e.createVNode(M,{icon:I.icon,class:"w-3 h-3"},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(I.label)+": "+e.toDisplayString(I.value),1),e.createElementVNode("button",{class:e.normalizeClass(b.value),onClick:j=>H(I.key)},[e.createVNode(M,{icon:"xmark",class:"w-3 h-3"})],10,pm)],2))),128))])],2)):e.createCommentVNode("",!0)]))}},gm={class:"flex items-start justify-between"},vm={key:0,class:"flex items-center gap-2"},la={__name:"DataTableHeader",props:{title:{type:String,default:null},description:{type:String,default:null},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},setup(t){const n=t,a=D.cva("border-b border-slate-200",{variants:{variant:{default:"bg-white",minimal:"bg-transparent border-none",bordered:"bg-slate-50 border-2"},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),o=D.cva("font-semibold text-slate-900",{variants:{size:{sm:"text-base",md:"text-lg",lg:"text-xl"}},defaultVariants:{size:"md"}}),r=D.cva("text-slate-600 mt-1",{variants:{size:{sm:"text-xs",md:"text-sm",lg:"text-base"}},defaultVariants:{size:"md"}}),l=e.computed(()=>w(a({variant:n.variant,padding:n.padding}))),s=e.computed(()=>w(o({size:"md"}))),d=e.computed(()=>w(r({size:"md"})));return(m,p)=>t.title||t.description||m.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(l.value)},[e.renderSlot(m.$slots,"header",{},()=>[e.createElementVNode("div",gm,[e.createElementVNode("div",null,[t.title?(e.openBlock(),e.createBlock(at,{key:0,class:e.normalizeClass(s.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1},8,["class"])):e.createCommentVNode("",!0),t.description?(e.openBlock(),e.createBlock(at,{key:1,class:e.normalizeClass(d.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.description),1)]),_:1},8,["class"])):e.createCommentVNode("",!0)]),m.$slots.filters?(e.openBlock(),e.createElementBlock("div",vm,[e.renderSlot(m.$slots,"filters")])):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0)}},hm=["onClick"],bm={key:1},ym={class:"p-2"},xm={class:"text-xl font-bold text-gray-700 whitespace-pre-wrap break-words"},sa={__name:"DataTableRow",props:{item:{type:Object,required:!0},columns:{type:Array,required:!0},index:{type:Number,required:!0},selectable:{type:Boolean,default:!1},isSelected:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},clickableRows:{type:Boolean,default:!1},density:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},variant:{type:String,default:"default",validator:t=>["default","bordered","minimal"].includes(t)}},emits:["toggle-selection","row-click"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(""),s=D.cva("transition-colors",{variants:{striped:{true:"odd:bg-slate-50/50",false:""},hoverable:{true:"hover:bg-slate-50",false:""},clickable:{true:"cursor-pointer hover:bg-slate-100",false:""},selected:{true:"bg-blue-50 border-blue-200",false:""},variant:{default:"",bordered:"border-b border-slate-200",minimal:"border-b border-slate-100"}},compoundVariants:[{hoverable:!0,clickable:!0,class:"hover:bg-slate-100"}],defaultVariants:{striped:!1,hoverable:!0,clickable:!1,selected:!1,variant:"default"}}),d=D.cva("whitespace-nowrap text-sm text-slate-900",{variants:{density:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{density:"normal",align:"left"}}),m=b=>typeof b=="string"?b:b?.key||b?.field||"unknown",p=(b,h)=>{const N=m(h);return typeof h=="object"&&h.accessor?h.accessor(b):N&&N.includes(".")?N.split(".").reduce((P,H)=>P?.[H],b):b?.[N]},v=(b,h)=>{const N=p(b,h);return typeof h=="object"&&h.formatter?h.formatter(N,b):N==null?"":N instanceof Date?N.toLocaleDateString():Array.isArray(N)?N.join(", "):N},y=(b,h=10)=>{if(!b)return b;const N=b.toString().split(" ");return N.length<=h?b:N.slice(0,h).join(" ")+"..."},S=b=>{l.value=b,r.value=!0},x=()=>{r.value=!1,l.value=""},k=()=>{a.clickableRows&&o("row-click",{item:a.item,index:a.index})},f=b=>typeof b=="object"&&b.align?b.align:"left",u=e.computed(()=>w(s({striped:a.striped,hoverable:a.hoverable&&!a.clickableRows,clickable:a.clickableRows,selected:a.isSelected,variant:a.variant}))),i=b=>{const h=f(b);return w(d({density:a.density,align:h}),b.cellClasses)},c=e.computed(()=>w(d({density:a.density}),"w-12")),g=e.computed(()=>w(d({density:a.density,align:"right"}),"font-medium"));return(b,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("tr",{class:e.normalizeClass(u.value),onClick:k},[t.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(c.value)},[e.createVNode(it,{"model-value":t.isSelected,"onUpdate:modelValue":h[0]||(h[0]=N=>b.$emit("toggle-selection",t.item))},null,8,["model-value"])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,N=>(e.openBlock(),e.createElementBlock("td",{key:m(N),class:e.normalizeClass(i(N))},[e.renderSlot(b.$slots,`cell-${m(N)}`,{item:t.item,value:p(t.item,N),column:N,index:t.index},()=>[v(t.item,N).toString().split(" ").length>10?(e.openBlock(),e.createElementBlock("span",{key:0,class:"cursor-pointer text-blue-600 hover:text-blue-800",onClick:e.withModifiers(P=>S(v(t.item,N)),["stop"])},e.toDisplayString(y(v(t.item,N))),9,hm)):(e.openBlock(),e.createElementBlock("span",bm,e.toDisplayString(v(t.item,N)),1))])],2))),128)),b.$slots.actions?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(g.value)},[e.renderSlot(b.$slots,"actions",{item:t.item,index:t.index})],2)):e.createCommentVNode("",!0)],2),e.createVNode(mt,{modelValue:r.value,"onUpdate:modelValue":h[1]||(h[1]=N=>r.value=N),size:"lg",height:"auto",onClose:x},{default:e.withCtx(()=>[e.createElementVNode("div",ym,[h[2]||(h[2]=e.createElementVNode("h3",{class:"text-md font-semibold mb-4"},"Full Text",-1)),e.createElementVNode("div",xm,e.toDisplayString(l.value),1)])]),_:1},8,["modelValue"])],64))}},km={class:"flex items-center justify-between"},wm={key:0,class:"text-sm text-slate-600"},Cm={key:1,class:"text-sm text-slate-600"},Bm={key:2,class:"flex items-center gap-4"},Vm={key:3,class:"flex items-center gap-4"},Sm={class:"flex items-center gap-2"},Em={class:"flex items-center gap-1"},Nm=["disabled"],$m=["disabled"],zm={class:"flex items-center gap-1"},Dm=["onClick"],Tm=["disabled"],Am=["disabled"],Fm={class:"text-sm text-slate-600 ml-4"},ia={__name:"DataTablePagination",props:{currentPage:{type:Number,required:!0},totalPages:{type:Number,required:!0},total:{type:Number,required:!0},pageSize:{type:Number,required:!0},showPagination:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},selectedCount:{type:Number,default:0},pageSizeOptions:{type:Array,default:()=>[5,10,25,50,100]},maxVisiblePages:{type:Number,default:7},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:currentPage","update:pageSize"],setup(t){const n=t,a=D.cva("border-t border-slate-200",{variants:{variant:{default:"bg-slate-50",minimal:"bg-transparent border-slate-100",bordered:"bg-slate-100 border-t-2 border-slate-300"},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),o=D.cva("text-sm font-medium border rounded-md transition-colors duration-200",{variants:{state:{active:"bg-blue-600 text-white border-blue-600",inactive:"bg-white text-slate-700 border-slate-300 hover:bg-slate-50",disabled:"bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed"},size:{sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"}},defaultVariants:{state:"inactive",size:"md"}}),r=D.cva("text-slate-700",{variants:{size:{sm:"text-sm",md:"text-base",lg:"text-lg"}},defaultVariants:{size:"md"}}),l=D.cva("border border-slate-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 text-sm min-w-[60px] focus:border-transparent",{variants:{size:{sm:"px-2 py-1",md:"px-3 py-2",lg:"px-4 py-3"}},defaultVariants:{size:"sm"}}),s=e.computed(()=>(n.currentPage-1)*n.pageSize+1),d=e.computed(()=>Math.min(n.currentPage*n.pageSize,n.total)),m=e.computed(()=>{const x=[],k=n.totalPages,f=n.currentPage,u=n.maxVisiblePages;if(k<=u)for(let i=1;i<=k;i++)x.push(i);else{const i=Math.floor(u/2);let c=Math.max(1,f-i),g=Math.min(k,c+u-1);g-c+1<u&&(c=Math.max(1,g-u+1));for(let b=c;b<=g;b++)x.push(b)}return x}),p=e.computed(()=>w(a({variant:n.variant,padding:n.padding}))),v=e.computed(()=>w(r({size:"md"}))),y=e.computed(()=>w(l({size:"sm"}))),S=(x,k)=>{let f="inactive";return k?f="disabled":x&&(f="active"),w(o({state:f,size:"md"}))};return(x,k)=>t.showPagination||x.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(p.value)},[e.createElementVNode("div",km,[t.selectable&&t.selectedCount>0?(e.openBlock(),e.createElementBlock("div",wm,e.toDisplayString(t.selectedCount)+" of "+e.toDisplayString(t.total)+" selected ",1)):(e.openBlock(),e.createElementBlock("div",Cm," Showing "+e.toDisplayString(s.value)+" to "+e.toDisplayString(d.value)+" of "+e.toDisplayString(t.total)+" entries ",1)),x.$slots.footer?(e.openBlock(),e.createElementBlock("div",Bm,[e.renderSlot(x.$slots,"footer")])):e.createCommentVNode("",!0),t.showPagination?(e.openBlock(),e.createElementBlock("div",Vm,[e.createElementVNode("div",Sm,[e.createVNode(fe,{for:"pageSize",class:e.normalizeClass(v.value),inline:!0},{default:e.withCtx(()=>[...k[5]||(k[5]=[e.createTextVNode("Show:",-1)])]),_:1},8,["class"]),e.createVNode(ue,{id:"pageSize","model-value":t.pageSize.toString(),class:e.normalizeClass(y.value),"onUpdate:modelValue":k[0]||(k[0]=f=>x.$emit("update:pageSize",parseInt(f)))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pageSizeOptions,f=>(e.openBlock(),e.createBlock(oa,{key:f,value:f.toString(),label:f.toString()},null,8,["value","label"]))),128))]),_:1},8,["model-value","class"])]),e.createElementVNode("div",Em,[e.createElementVNode("button",{disabled:t.currentPage===1,class:e.normalizeClass(S(!1,t.currentPage===1)),title:"First page",onClick:k[1]||(k[1]=f=>x.$emit("update:currentPage",1))},[...k[6]||(k[6]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5"})],-1)])],10,Nm),e.createElementVNode("button",{disabled:t.currentPage===1,class:e.normalizeClass(S(!1,t.currentPage===1)),title:"Previous page",onClick:k[2]||(k[2]=f=>x.$emit("update:currentPage",t.currentPage-1))},[...k[7]||(k[7]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1)])],10,$m),e.createElementVNode("div",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,f=>(e.openBlock(),e.createElementBlock("button",{key:f,class:e.normalizeClass(S(f===t.currentPage,!1)),onClick:u=>x.$emit("update:currentPage",f)},e.toDisplayString(f),11,Dm))),128))]),e.createElementVNode("button",{disabled:t.currentPage===t.totalPages,class:e.normalizeClass(S(!1,t.currentPage===t.totalPages)),title:"Next page",onClick:k[3]||(k[3]=f=>x.$emit("update:currentPage",t.currentPage+1))},[...k[8]||(k[8]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})],-1)])],10,Tm),e.createElementVNode("button",{disabled:t.currentPage===t.totalPages,class:e.normalizeClass(S(!1,t.currentPage===t.totalPages)),title:"Last page",onClick:k[4]||(k[4]=f=>x.$emit("update:currentPage",t.totalPages))},[...k[9]||(k[9]=[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5"})],-1)])],10,Am)]),e.createElementVNode("div",Fm," Page "+e.toDisplayString(t.currentPage)+" of "+e.toDisplayString(t.totalPages),1)])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)}},pt=(t,n)=>{const a=t.__vccOpts||t;for(const[o,r]of n)a[o]=r;return a},Pm={key:0,class:"loader__backdrop"},Lm={class:"loader__container"},Mm={key:0,class:"loader__text loader__text--top"},jm={key:1,class:"loader__spin"},Im={key:2,class:"loader__pulse"},Om={key:3,class:"loader__bounce"},Rm={key:4,class:"loader__ripple"},_m={key:5,class:"loader__bars"},Um={key:6,class:"loader__dots"},qm={key:7,class:"loader__ring"},Hm={key:8,class:"loader__spinner-text"},Ym={key:9,class:"loader__text loader__text--bottom"},Wm={__name:"Loader",props:{loading:{type:Boolean,default:!0},type:{type:String,default:"spin",validator:t=>["spin","pulse","bounce","ripple","bars","dots","ring","spinner-text"].includes(t)},size:{type:String,default:"medium",validator:t=>["small","medium","large","xl"].includes(t)},color:{type:String,default:"#3b82f6"},backgroundColor:{type:String,default:"rgba(255, 255, 255, 0.9)"},text:{type:String,default:""},textPosition:{type:String,default:"bottom",validator:t=>["top","bottom"].includes(t)},overlay:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1}},setup(t){return(n,a)=>t.loading?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["loader",`loader--${t.type}`,`loader--${t.size}`,t.overlay?"loader--overlay":"",t.fullscreen?"loader--fullscreen":""]),style:e.normalizeStyle({"--loader-color":t.color,"--loader-bg":t.backgroundColor})},[t.overlay?(e.openBlock(),e.createElementBlock("div",Pm)):e.createCommentVNode("",!0),e.createElementVNode("div",Lm,[t.text&&t.textPosition==="top"?(e.openBlock(),e.createElementBlock("div",Mm,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0),t.type==="spin"?(e.openBlock(),e.createElementBlock("div",jm)):t.type==="pulse"?(e.openBlock(),e.createElementBlock("div",Im)):t.type==="bounce"?(e.openBlock(),e.createElementBlock("div",Om,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(3,o=>e.createElementVNode("div",{key:o,class:"loader__bounce-dot",style:e.normalizeStyle({animationDelay:`${(o-1)*.1}s`})},null,4)),64))])):t.type==="ripple"?(e.openBlock(),e.createElementBlock("div",Rm,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(2,o=>e.createElementVNode("div",{key:o,class:"loader__ripple-ring",style:e.normalizeStyle({animationDelay:`${(o-1)*.5}s`})},null,4)),64))])):t.type==="bars"?(e.openBlock(),e.createElementBlock("div",_m,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,o=>e.createElementVNode("div",{key:o,class:"loader__bar",style:e.normalizeStyle({animationDelay:`${(o-1)*.1}s`})},null,4)),64))])):t.type==="dots"?(e.openBlock(),e.createElementBlock("div",Um,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(3,o=>e.createElementVNode("div",{key:o,class:"loader__dot",style:e.normalizeStyle({animationDelay:`${(o-1)*.16}s`})},null,4)),64))])):t.type==="ring"?(e.openBlock(),e.createElementBlock("div",qm,[...a[0]||(a[0]=[e.createElementVNode("div",{class:"loader__ring-track"},null,-1),e.createElementVNode("div",{class:"loader__ring-fill"},null,-1)])])):t.type==="spinner-text"?(e.openBlock(),e.createElementBlock("div",Hm,[...a[1]||(a[1]=[e.createElementVNode("div",{class:"loader__spinner"},null,-1)])])):e.createCommentVNode("",!0),t.text&&t.textPosition==="bottom"?(e.openBlock(),e.createElementBlock("div",Ym,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0)])],6)):e.createCommentVNode("",!0)}},je=pt(Wm,[["__scopeId","data-v-68532350"]]),Gm={class:"relative"},Km={class:"flex items-center justify-center"},Xm=["onClick"],Qm={class:"flex items-center gap-2"},Jm={key:1,class:"flex flex-col"},Zm={key:1,class:"flex items-center gap-1 justify-center"},ef={key:1,class:"text-xs"},tf={key:2},af=["colspan"],nf={class:"flex flex-col items-center justify-center py-12"},of={class:"text-slate-400 mb-4 flex justify-center"},rf={class:"text-slate-600 text-lg font-medium mb-2"},lf={class:"text-slate-500 text-sm"},sf={__name:"DataTable",props:{data:{type:Array,required:!0},columns:{type:Array,required:!0},title:{type:String,default:null},description:{type:String,default:null},selectable:{type:Boolean,default:!1},selectedItems:{type:Array,default:()=>[]},sortBy:{type:String,default:null},sortOrder:{type:String,default:"asc",validator:t=>["asc","desc"].includes(t)},pageSize:{type:Number,default:10},showPagination:{type:Boolean,default:!0},striped:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},clickableRows:{type:Boolean,default:!1},emptyText:{type:String,default:"No data available"},emptySubtitle:{type:String,default:"Try adjusting your search or filter criteria"},rowKey:{type:String,default:"id"},variant:{type:String,default:"default",validator:t=>["default","bordered","minimal"].includes(t)},density:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},headerVariant:{type:String,default:"default"},headerPadding:{type:String,default:"normal"},paginationVariant:{type:String,default:"default"},paginationPadding:{type:String,default:"normal"},actions:{type:Array,default:()=>[]},showActionsColumn:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},dataLoading:{type:Boolean,default:!1},sortLoading:{type:Boolean,default:!1},paginationLoading:{type:Boolean,default:!1},bulkLoading:{type:Boolean,default:!1},rowLoading:{type:Object,default:()=>({})},loadingType:{type:String,default:"dots",validator:t=>["spin","pulse","bounce","ripple","bars","dots","ring"].includes(t)},loadingSize:{type:String,default:"medium",validator:t=>["small","medium","large","xl"].includes(t)},loadingColor:{type:String,default:"#3b82f6"},loadingText:{type:String,default:"Loading..."},loadingTextPosition:{type:String,default:"bottom",validator:t=>["top","bottom"].includes(t)},loadingBackground:{type:String,default:"rgba(255, 255, 255, 0.95)"},showSkeleton:{type:Boolean,default:!0},skeletonRows:{type:Number,default:5}},emits:["selection-change","sort-change","row-click","page-change","page-size-change","refresh","action"],setup(t,{expose:n,emit:a}){const o=t,r=a,l=e.ref(1),s=e.ref(o.pageSize),d=e.ref(o.sortBy),m=e.ref(o.sortOrder),p=D.cva("bg-white border border-slate-200 rounded-lg overflow-hidden",{variants:{variant:{default:"shadow-sm",bordered:"border-2 border-slate-300",minimal:"border-none shadow-none bg-transparent"}},defaultVariants:{variant:"default"}}),v=D.cva("min-w-full",{variants:{variant:{default:"divide-y divide-slate-200",bordered:"border-collapse [&_td]:border [&_th]:border",minimal:"divide-y divide-slate-100"}},defaultVariants:{variant:"default"}}),y=D.cva("",{variants:{variant:{default:"bg-slate-50",bordered:"bg-slate-100 border-b-2 border-slate-300",minimal:"bg-transparent border-b border-slate-200"}},defaultVariants:{variant:"default"}}),S=D.cva("divide-y",{variants:{variant:{default:"bg-white divide-slate-200",bordered:"bg-white divide-slate-300",minimal:"bg-transparent divide-slate-100"}},defaultVariants:{variant:"default"}}),x=e.computed(()=>{let T=[...o.data];if(d.value){const R=o.columns.find(G=>G.key===d.value);R&&T.sort((G,te)=>{const ae=H(G,R),Q=H(te,R);return ae<Q?m.value==="asc"?-1:1:ae>Q?m.value==="asc"?1:-1:0})}return T}),k=e.computed(()=>Math.ceil(x.value.length/s.value)),f=e.computed(()=>{if(!o.showPagination)return x.value;const T=(l.value-1)*s.value,R=T+s.value;return x.value.slice(T,R)}),u=e.computed(()=>{let T=o.columns.length;return o.selectable&&T++,(o.$slots?.actions||o.actions.length>0&&o.showActionsColumn)&&T++,T}),i=T=>o.actions.filter(R=>R.visible&&typeof R.visible=="function"?R.visible(T):!0),c=(T,R)=>T.permission&&typeof T.permission=="function"?T.permission(R):!0,g=(T,R)=>T.disabled&&typeof T.disabled=="function"?T.disabled(R):!1,b=(T,R)=>{g(T,R)||!c(T,R)||(r("action",{action:T.key,item:R,actionConfig:T}),T.onClick&&typeof T.onClick=="function"&&T.onClick(R))},h=T=>({default:"default",primary:"gradient",secondary:"secondary",danger:"danger",success:"success",warning:"warning",info:"info",subtle:"subtle",dark:"dark",light:"light",primaryOutline:"primaryOutline",dangerOutline:"dangerOutline",successOutline:"successOutline",outline:"outline",link:"link",ghost:"ghost"})[T]||"ghost",N=e.computed(()=>x.value.length>0&&x.value.every(T=>E(T))),P=e.computed(()=>{const T=x.value.filter(R=>E(R)).length;return T>0&&T<x.value.length}),H=(T,R)=>R.accessor?R.accessor(T):R.key.split(".").reduce((G,te)=>G?.[te],T),_=(T,R)=>T[o.rowKey]||R,E=T=>o.selectedItems.some(R=>_(R)===_(T)),I=T=>{const R=[...o.selectedItems],G=R.findIndex(te=>_(te)===_(T));G>-1?R.splice(G,1):R.push(T),r("selection-change",R)},j=()=>{if(o.loading||o.dataLoading)return;const T=N.value?[]:[...x.value];r("selection-change",T)},C=async T=>{!T.sortable||o.loading||o.sortLoading||(d.value===T.key?m.value=m.value==="asc"?"desc":"asc":(d.value=T.key,m.value="asc"),r("sort-change",{column:T.key,direction:m.value}))},$=T=>{o.loading||r("row-click",T)},L=async T=>{o.paginationLoading||o.loading||(l.value=T,r("page-change",T))},Y=async T=>{o.paginationLoading||o.loading||(s.value=T,l.value=1,r("page-size-change",T))},U=e.computed(()=>w(p({variant:o.variant}))),re=e.computed(()=>w(v({variant:o.variant}))),gt=e.computed(()=>w(y({variant:o.variant}))),$e=e.computed(()=>w(S({variant:o.variant}))),vt=T=>w({compact:"px-4 py-2",normal:"px-6 py-3",comfortable:"px-8 py-4"}[o.density],"text-left text-xs font-medium text-slate-500 uppercase tracking-wider",{"cursor-pointer hover:bg-slate-100 transition-colors":T.sortable&&!o.loading&&!o.sortLoading,"cursor-not-allowed opacity-50":o.loading||o.sortLoading&&d.value===T.key}),ht=()=>w({compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}[o.density],"whitespace-nowrap text-sm text-slate-900"),He=e.computed(()=>w({compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}[o.density],"whitespace-nowrap text-sm text-slate-900 w-12")),xe=e.computed(()=>w({compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"}[o.density],"whitespace-nowrap text-sm font-medium text-center")),ze=e.computed(()=>w({compact:"px-4 py-4",normal:"px-6 py-6",comfortable:"px-8 py-8"}[o.density],"text-center")),De=(T,R)=>w({"text-blue-600":d.value===T.key&&m.value===R,"text-slate-300":d.value!==T.key||m.value!==R});return e.watch(()=>o.selectedItems,()=>{},{deep:!0}),e.watch(()=>o.pageSize,T=>{s.value=T}),n({refresh:()=>{r("refresh")},goToPage:T=>{L(T)},selectAll:()=>{j()},clearSelection:()=>{r("selection-change",[])},getCurrentPage:()=>l.value,getTotalPages:()=>k.value,getSelectedItems:()=>o.selectedItems}),(T,R)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(U.value)},[t.title||t.description||T.$slots.header?(e.openBlock(),e.createBlock(la,{key:0,title:t.title,description:t.description,variant:t.headerVariant,padding:t.headerPadding},{header:e.withCtx(()=>[e.renderSlot(T.$slots,"header",{},void 0,!0)]),filters:e.withCtx(()=>[e.renderSlot(T.$slots,"filters",{},void 0,!0)]),_:3},8,["title","description","variant","padding"])):e.createCommentVNode("",!0),e.createElementVNode("div",Gm,[t.loading?(e.openBlock(),e.createBlock(je,{key:0,loading:!0,type:t.loadingType,size:t.loadingSize,color:t.loadingColor,overlay:!0,text:t.loadingText,"text-position":t.loadingTextPosition,"background-color":t.loadingBackground,class:"table-loading-overlay"},null,8,["type","size","color","text","text-position","background-color"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["overflow-x-auto",{"opacity-50":t.loading}])},[e.createElementVNode("table",{class:e.normalizeClass(re.value)},[e.createElementVNode("thead",{class:e.normalizeClass(gt.value)},[e.createElementVNode("tr",null,[t.selectable?(e.openBlock(),e.createElementBlock("th",{key:0,class:e.normalizeClass(He.value)},[e.createElementVNode("div",Km,[t.bulkLoading?(e.openBlock(),e.createBlock(je,{key:0,loading:!0,type:"spin",size:"small",color:t.loadingColor},null,8,["color"])):(e.openBlock(),e.createBlock(it,{key:1,"model-value":N.value,indeterminate:P.value,disabled:t.loading||t.dataLoading,"onUpdate:modelValue":j},null,8,["model-value","indeterminate","disabled"]))])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,G=>(e.openBlock(),e.createElementBlock("th",{key:G.key,class:e.normalizeClass(vt(G)),onClick:te=>C(G)},[e.createElementVNode("div",Qm,[e.createElementVNode("span",null,e.toDisplayString(G.label),1),t.sortLoading&&d.value===G.key?(e.openBlock(),e.createBlock(je,{key:0,loading:!0,type:"spin",size:"small",color:t.loadingColor},null,8,["color"])):G.sortable?(e.openBlock(),e.createElementBlock("div",Jm,[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([De(G,"asc"),"w-3 h-3 transition-colors"]),fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[...R[0]||(R[0]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"},null,-1)])],2)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass([De(G,"desc"),"w-3 h-3 transition-colors"]),fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},[...R[1]||(R[1]=[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)])],2))])):e.createCommentVNode("",!0)])],10,Xm))),128)),T.$slots.actions||t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("th",{key:1,class:e.normalizeClass(xe.value)}," Actions ",2)):e.createCommentVNode("",!0)])],2),e.createElementVNode("tbody",{class:e.normalizeClass($e.value)},[t.showSkeleton&&(t.loading||t.dataLoading)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.skeletonRows,G=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${G}`,class:"animate-pulse"},[t.selectable?(e.openBlock(),e.createElementBlock("td",{key:0,class:e.normalizeClass(He.value)},[...R[2]||(R[2]=[e.createElementVNode("div",{class:"w-4 h-4 bg-slate-200 rounded"},null,-1)])],2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.columns,te=>(e.openBlock(),e.createElementBlock("td",{key:te.key,class:e.normalizeClass(ht())},[...R[3]||(R[3]=[e.createElementVNode("div",{class:"h-4 bg-slate-200 rounded w-3/4"},null,-1)])],2))),128)),T.$slots.actions||t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("td",{key:1,class:e.normalizeClass(xe.value)},[...R[4]||(R[4]=[e.createElementVNode("div",{class:"flex gap-2 justify-center"},[e.createElementVNode("div",{class:"w-6 h-6 bg-slate-200 rounded"}),e.createElementVNode("div",{class:"w-6 h-6 bg-slate-200 rounded"})],-1)])],2)):e.createCommentVNode("",!0)]))),128)):f.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(f.value,(G,te)=>(e.openBlock(),e.createBlock(sa,{key:_(G,te),item:G,columns:t.columns,index:te,selectable:t.selectable,"is-selected":E(G),striped:t.striped,hoverable:t.hoverable,"clickable-rows":t.clickableRows,density:t.density,"row-loading":t.rowLoading[_(G,te)],"loading-color":t.loadingColor,onToggleSelection:I,onRowClick:$},e.createSlots({actions:e.withCtx(ae=>[T.$slots.actions?e.renderSlot(T.$slots,"actions",e.mergeProps({key:0,ref_for:!0},ae),void 0,!0):t.actions.length>0&&t.showActionsColumn?(e.openBlock(),e.createElementBlock("div",Zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i(ae.item),Q=>(e.openBlock(),e.createBlock(ra,{key:Q.key,content:Q.tooltip||Q.label||Q.key,placement:"top"},{default:e.withCtx(()=>[e.createVNode(J,{variant:h(Q.variant),size:"xs",disabled:g(Q,ae.item)||!c(Q,ae.item),class:"h-8 w-8",onClick:e.withModifiers(ca=>b(Q,ae.item),["stop"])},{default:e.withCtx(()=>[Q.icon?(e.openBlock(),e.createBlock(M,{key:0,icon:Q.icon,class:"w-4 h-4"},null,8,["icon"])):Q.label?(e.openBlock(),e.createElementBlock("span",ef,e.toDisplayString(Q.label),1)):e.createCommentVNode("",!0)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["content"]))),128))])):e.createCommentVNode("",!0)]),_:2},[e.renderList(t.columns,ae=>({name:`cell-${ae.key}`,fn:e.withCtx(Q=>[e.renderSlot(T.$slots,`cell-${ae.key}`,e.mergeProps({ref_for:!0},Q),void 0,!0)])}))]),1032,["item","columns","index","selectable","is-selected","striped","hoverable","clickable-rows","density","row-loading","loading-color"]))),128)):(e.openBlock(),e.createElementBlock("tr",tf,[e.createElementVNode("td",{colspan:u.value,class:e.normalizeClass(ze.value)},[e.renderSlot(T.$slots,"empty",{},()=>[e.createElementVNode("div",nf,[e.createElementVNode("div",of,[e.createVNode(M,{icon:"search",class:"w-16 h-16"})]),e.createElementVNode("p",rf,e.toDisplayString(t.emptyText),1),e.createElementVNode("p",lf,e.toDisplayString(t.emptySubtitle),1)])],!0)],10,af)]))],2)],2)],2)]),t.showPagination||T.$slots.footer?(e.openBlock(),e.createBlock(ia,{key:1,"current-page":l.value,"total-pages":k.value,total:x.value.length,"page-size":s.value,"show-pagination":t.showPagination,selectable:t.selectable,"selected-count":t.selectedItems.length,variant:t.paginationVariant,padding:t.paginationPadding,loading:t.paginationLoading,disabled:t.loading||t.dataLoading,"onUpdate:currentPage":L,"onUpdate:pageSize":Y},{footer:e.withCtx(()=>[e.renderSlot(T.$slots,"footer",{},void 0,!0)]),_:3},8,["current-page","total-pages","total","page-size","show-pagination","selectable","selected-count","variant","padding","loading","disabled"])):e.createCommentVNode("",!0)],2))}},Mo=pt(sf,[["__scopeId","data-v-32089b8f"]]),jo={__name:"DataTableCell",props:{item:{type:Object,required:!0},column:{type:Object,required:!0},value:{type:[String,Number,Boolean,Object,Array],default:null},align:{type:String,default:"left",validator:t=>["left","center","right"].includes(t)},width:{type:String,default:null},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},textSize:{type:String,default:"sm",validator:t=>["xs","sm","base","lg"].includes(t)},textColor:{type:String,default:"slate-900"}},setup(t){const n=t,a=e.computed(()=>{const s=n.value??o();return n.column.formatter?n.column.formatter(s,n.item):s}),o=()=>n.column.accessor?n.column.accessor(n.item):n.column.key.split(".").reduce((s,d)=>s?.[d],n.item),r=D.cva("whitespace-nowrap",{variants:{align:{left:"text-left",center:"text-center",right:"text-right"},padding:{compact:"px-4 py-2",normal:"px-6 py-4",comfortable:"px-8 py-6"},textSize:{xs:"text-xs",sm:"text-sm",base:"text-base",lg:"text-lg"}},defaultVariants:{align:"left",padding:"normal",textSize:"sm"}}),l=e.computed(()=>{const s=n.align||n.column.align||"left",d=`text-${n.textColor}`,m=n.width?`w-${n.width}`:"";return w(r({align:s,padding:n.padding,textSize:n.textSize}),d,m,n.column.cellClasses)});return(s,d)=>(e.openBlock(),e.createElementBlock("td",{class:e.normalizeClass(l.value)},[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(a.value),1)])],2))}},cf={class:"bg-white border-b border-gray-200"},df={key:0,class:"flex-1 min-w-80 max-w-md"},uf={class:"relative group"},mf=["model-value","placeholder"],ff={class:"relative"},pf={value:""},gf=["value"],vf={key:1,class:"min-w-36"},hf={class:"relative"},bf=["value"],yf={key:3,class:"flex items-center gap-2"},xf={class:"flex items-center gap-3 ml-auto"},kf={key:2},wf={class:"grid grid-cols-1 lg:grid-cols-3 gap-6"},Cf={class:"flex items-center justify-between"},Bf={class:"flex items-center gap-3"},Vf={class:"relative flex-1"},Sf=["model-value","placeholder","onInput"],Ef={class:"relative flex-1"},Nf=["model-value","placeholder","onInput"],$f=["onClick"],zf={class:"flex items-center justify-between"},Df={class:"flex items-center gap-3"},Tf={class:"relative flex-1"},Af=["model-value","placeholder","step","onInput"],Ff={class:"relative flex-1"},Pf=["model-value","placeholder","step","onInput"],Lf=["onClick"],Mf={class:"flex items-center justify-between"},jf={class:"relative"},If={value:""},Of=["value"],Rf={key:0,class:"flex flex-wrap gap-2 mt-2"},_f=["onClick"],Uf={class:"flex items-center gap-3 flex-wrap"},qf=["onClick"],Hf={key:2,class:"px-6 py-3 bg-gray-50 border-t border-gray-200"},Yf={class:"flex items-center justify-between"},Wf={class:"flex items-center gap-4"},Gf={class:"text-sm text-gray-600"},Kf={class:"font-medium"},Io={__name:"DataTableFilters",props:{searchQuery:{type:String,default:""},searchPlaceholder:{type:String,default:"Search..."},selectedStatus:{type:String,default:""},statusOptions:{type:Array,default:()=>[]},showDateFilter:{type:Boolean,default:!1},dateFrom:{type:String,default:""},dateTo:{type:String,default:""},selectFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"options")&&Object.prototype.hasOwnProperty.call(n,"value"))},dateFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"from")&&Object.prototype.hasOwnProperty.call(n,"to"))},numberFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"min")&&Object.prototype.hasOwnProperty.call(n,"max"))},multiSelectFilters:{type:Array,default:()=>[],validator:t=>t.every(n=>Object.prototype.hasOwnProperty.call(n,"key")&&Object.prototype.hasOwnProperty.call(n,"label")&&Object.prototype.hasOwnProperty.call(n,"options")&&Object.prototype.hasOwnProperty.call(n,"selected"))},showExport:{type:Boolean,default:!1},showAdd:{type:Boolean,default:!1},addButton:{type:Object,default:()=>({})},showTableInfo:{type:Boolean,default:!0},showSearch:{type:Boolean,default:!0},showFilters:{type:Boolean,default:!0},totalItems:{type:Number,default:0},itemLabel:{type:String,default:"items"},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["update:searchQuery","update:selectedStatus","update:dateFrom","update:dateTo","update:dateFilters","update:selectFilters","update:numberFilters","update:multiSelectFilters","export","add","clear-filters","add-button-click"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.computed(()=>Object.keys(a.addButton).length>0),s=e.computed(()=>l.value?a.addButton.visible&&typeof a.addButton.visible=="function"?a.addButton.visible():!0:a.showAdd),d=e.computed(()=>l.value&&a.addButton.permission&&typeof a.addButton.permission=="function"?a.addButton.permission():!0),m=e.computed(()=>l.value&&a.addButton.disabled&&typeof a.addButton.disabled=="function"?a.addButton.disabled():!1),p=()=>{m.value||!d.value||(o("add"),o("add-button-click",a.addButton),a.addButton.onClick&&typeof a.addButton.onClick=="function"&&a.addButton.onClick())},v=D.cva("flex flex-wrap items-center gap-4",{variants:{variant:{default:"bg-white",minimal:"bg-transparent",bordered:"bg-gray-50"},padding:{compact:"px-4 py-3",normal:"px-6 py-4",comfortable:"px-8 py-6"}},defaultVariants:{variant:"default",padding:"normal"}}),y=D.cva("border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-sm",{variants:{size:{sm:"px-2 py-1.5",md:"px-3 py-2.5",lg:"px-4 py-3"}},defaultVariants:{size:"md"}}),S=D.cva("rounded-lg flex items-center font-medium transition-all",{variants:{variant:{default:"text-gray-700 hover:text-gray-900 border border-gray-200 hover:bg-gray-50 hover:border-gray-300 bg-white",primary:"text-white bg-blue-600 hover:bg-blue-700 border border-blue-600 shadow-sm",success:"text-white bg-green-600 hover:bg-green-700 border border-green-600 shadow-sm",ghost:"text-gray-600 hover:text-gray-800 hover:bg-gray-100"},size:{sm:"px-2 py-1.5 text-xs",md:"px-3 py-2 text-sm",lg:"px-4 py-2.5 text-sm"}},defaultVariants:{variant:"default",size:"md"}}),x=(A,V)=>{const B=a.selectFilters.map(F=>F.key===A?{...F,value:V}:F);o("update:selectFilters",B)},k=A=>!!(A.from||A.to),f=A=>{const V=a.dateFilters.map(B=>B.key===A?{...B,from:"",to:""}:B);o("update:dateFilters",V)},u=A=>`text-xs px-2 py-1 rounded ${k(A)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"}`,i=(A,V,B)=>{const F=a.dateFilters.map(W=>W.key===A?{...W,[V]:B}:W);o("update:dateFilters",F)},c=A=>!!(A.min||A.max),g=A=>{const V=a.numberFilters.map(B=>B.key===A?{...B,min:"",max:""}:B);o("update:numberFilters",V)},b=A=>`text-xs px-2 py-1 rounded ${c(A)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"}`,h=(A,V,B)=>{const F=a.numberFilters.map(W=>W.key===A?{...W,[V]:B}:W);o("update:numberFilters",F)},N=A=>A.selected&&A.selected.length>0,P=A=>`text-xs px-2 py-1 rounded ${N(A)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600"}`,H=(A,V)=>{if(!V)return;const B=a.multiSelectFilters.map(F=>{if(F.key===A){const W=F.selected||[],Te=W.includes(V);return{...F,selected:Te?W.filter(bt=>bt!==V):[...W,V]}}return F});o("update:multiSelectFilters",B)},_=(A,V)=>{const B=a.multiSelectFilters.map(F=>F.key===A?{...F,selected:F.selected.filter(W=>W!==V)}:F);o("update:multiSelectFilters",B)},E=(A,V)=>{const B=A.options.find(F=>F.value===V);return B?B.label:V},I=()=>{r.value=!r.value},j=e.computed(()=>a.numberFilters.length>0||a.multiSelectFilters.length>0),C=e.computed(()=>{const A=a.searchQuery,V=a.selectedStatus,B=a.dateFrom||a.dateTo,F=a.selectFilters.some(ce=>ce.value),W=a.dateFilters.some(ce=>ce.from||ce.to),Te=a.numberFilters.some(ce=>ce.min||ce.max),bt=a.multiSelectFilters.some(ce=>ce.selected&&ce.selected.length>0);return A||V||B||F||W||Te||bt}),$=e.computed(()=>{let A=0;return a.searchQuery&&A++,a.selectedStatus&&A++,(a.dateFrom||a.dateTo)&&A++,A+=a.selectFilters.filter(V=>V.value).length,A+=a.dateFilters.filter(V=>V.from||V.to).length,A+=a.numberFilters.filter(V=>V.min||V.max).length,A+=a.multiSelectFilters.filter(V=>V.selected&&V.selected.length>0).length,A}),L=e.computed(()=>{const A=[];if(a.searchQuery&&a.searchQuery.trim()&&A.push({key:"search",label:"Search",value:`"${a.searchQuery}"`,icon:"magnifying-glass"}),a.selectedStatus){const V=a.statusOptions.find(B=>B.value===a.selectedStatus);A.push({key:"status",label:"Status",value:V?.label||a.selectedStatus,icon:"filter"})}if(a.selectFilters.forEach(V=>{if(V.value){const B=V.options.find(F=>F.value===V.value);A.push({key:`select-${V.key}`,label:V.label,value:B?.label||V.value,icon:"filter"})}}),a.dateFrom||a.dateTo){let V="";a.dateFrom&&a.dateTo?V=`${a.dateFrom} to ${a.dateTo}`:a.dateFrom?V=`From ${a.dateFrom}`:a.dateTo&&(V=`Until ${a.dateTo}`),V&&A.push({key:"date",label:"Date Range",value:V,icon:"calendar"})}return a.dateFilters.forEach(V=>{if(V.from||V.to){let B="";V.from&&V.to?B=`${V.from} to ${V.to}`:V.from?B=`From ${V.from}`:V.to&&(B=`Until ${V.to}`),B&&A.push({key:`date-${V.key}`,label:V.label,value:B,icon:"calendar"})}}),a.numberFilters.forEach(V=>{if(V.min||V.max){let B="";V.min&&V.max?B=`${V.min} to ${V.max}`:V.min?B=`Min ${V.min}`:V.max&&(B=`Max ${V.max}`),B&&A.push({key:`number-${V.key}`,label:V.label,value:B,icon:"hashtag"})}}),a.multiSelectFilters.forEach(V=>{if(V.selected&&V.selected.length>0){const B=V.selected.map(F=>{const W=V.options.find(Te=>Te.value===F);return W?W.label:F});A.push({key:`multi-${V.key}`,label:V.label,value:B.join(", "),icon:"list"})}}),A}),Y=e.computed(()=>w(v({variant:a.variant,padding:a.padding}))),U=e.computed(()=>"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 group-hover:text-gray-600 transition-colors"),re=e.computed(()=>w(y({size:"md"}),"w-full pl-10 pr-10 hover:border-gray-300")),gt=e.computed(()=>"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600 p-1 hover:bg-gray-100 rounded-full transition-all"),$e=e.computed(()=>w(y({size:"md"}),"w-full pr-8 appearance-none hover:border-gray-300")),vt=e.computed(()=>{const A=r.value||C.value;return w(S({variant:A?"primary":"default",size:"lg"}),"gap-2")}),ht=e.computed(()=>"bg-white text-blue-600 text-xs px-1.5 py-0.5 rounded-full min-w-[20px] text-center font-semibold"),He=e.computed(()=>"px-6 py-4 border-t border-gray-100 bg-gray-50"),xe=e.computed(()=>w(y({size:"md"}),"pl-10 pr-3")),ze=e.computed(()=>"text-sm font-semibold text-gray-700"),De=e.computed(()=>"text-gray-500 text-sm font-medium"),T=e.computed(()=>"text-gray-400 hover:text-gray-600 p-1.5 hover:bg-gray-200 rounded-full transition-all"),R=e.computed(()=>w(S({variant:"ghost",size:"md"}))),G=e.computed(()=>w(S({variant:"default",size:"lg"}))),te=e.computed(()=>"px-6 py-3 bg-blue-50 border-t border-blue-100"),ae=e.computed(()=>"text-sm font-semibold text-blue-800"),Q=e.computed(()=>"flex items-center gap-1.5 bg-white border border-blue-200 text-blue-800 px-3 py-1.5 rounded-full text-sm font-medium"),ca=e.computed(()=>"text-blue-600 hover:text-blue-800 ml-1 hover:bg-blue-100 rounded-full p-0.5 transition-all"),Jo=()=>{o("update:searchQuery",""),o("update:selectedStatus",""),o("update:dateFrom",""),o("update:dateTo","");const A=a.selectFilters.map(W=>({...W,value:""}));o("update:selectFilters",A);const V=a.dateFilters.map(W=>({...W,from:"",to:""}));o("update:dateFilters",V);const B=a.numberFilters.map(W=>({...W,min:"",max:""}));o("update:numberFilters",B);const F=a.multiSelectFilters.map(W=>({...W,selected:[]}));o("update:multiSelectFilters",F),o("clear-filters")},Zo=A=>{switch(A){case"search":o("update:searchQuery","");break;case"status":o("update:selectedStatus","");break;case"date":o("update:dateFrom",""),o("update:dateTo","");break;default:if(A.startsWith("select-")){const V=A.replace("select-",""),B=a.selectFilters.map(F=>F.key===V?{...F,value:""}:F);o("update:selectFilters",B)}else if(A.startsWith("date-")){const V=A.replace("date-",""),B=a.dateFilters.map(F=>F.key===V?{...F,from:"",to:""}:F);o("update:dateFilters",B)}else if(A.startsWith("number-")){const V=A.replace("number-",""),B=a.numberFilters.map(F=>F.key===V?{...F,min:"",max:""}:F);o("update:numberFilters",B)}else if(A.startsWith("multi-")){const V=A.replace("multi-",""),B=a.multiSelectFilters.map(F=>F.key===V?{...F,selected:[]}:F);o("update:multiSelectFilters",B)}break}};return(A,V)=>(e.openBlock(),e.createElementBlock("div",cf,[e.createElementVNode("div",{class:e.normalizeClass(Y.value)},[t.showSearch?(e.openBlock(),e.createElementBlock("div",df,[e.createElementVNode("div",uf,[e.createVNode(M,{icon:"magnifying-glass",class:e.normalizeClass(U.value)},null,8,["class"]),e.createElementVNode("input",{"model-value":t.searchQuery,placeholder:t.searchPlaceholder,class:e.normalizeClass(re.value),onInput:V[0]||(V[0]=B=>A.$emit("update:searchQuery",B.target.value))},null,42,mf),t.searchQuery?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(gt.value),onClick:V[1]||(V[1]=B=>A.$emit("update:searchQuery",""))},[e.createVNode(M,{icon:"xmark",class:"w-3 h-3"})],2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.selectFilters,B=>(e.openBlock(),e.createElementBlock("div",{key:B.key,class:"min-w-36"},[e.createElementVNode("div",ff,[e.createVNode(ue,{"model-value":B.value,class:e.normalizeClass($e.value),onChange:F=>x(B.key,F.target.value)},{default:e.withCtx(()=>[e.createElementVNode("option",pf,e.toDisplayString(B.placeholder||`All ${B.label}`),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.options,F=>(e.openBlock(),e.createElementBlock("option",{key:F.value,value:F.value},e.toDisplayString(F.label),9,gf))),128))]),_:2},1032,["model-value","class","onChange"]),e.createVNode(M,{icon:"chevron-down",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])]))),128)),t.showFilters&&t.statusOptions.length>0?(e.openBlock(),e.createElementBlock("div",vf,[e.createElementVNode("div",hf,[e.createVNode(ue,{"model-value":t.selectedStatus,class:e.normalizeClass($e.value),onChange:V[2]||(V[2]=B=>A.$emit("update:selectedStatus",B.target.value))},{default:e.withCtx(()=>[V[5]||(V[5]=e.createElementVNode("option",{value:""}," All Status ",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.statusOptions,B=>(e.openBlock(),e.createElementBlock("option",{key:B.value,value:B.value},e.toDisplayString(B.label),9,bf))),128))]),_:1},8,["model-value","class"]),e.createVNode(M,{icon:"chevron-down",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})])])):e.createCommentVNode("",!0),t.showFilters&&(t.dateFilters.length>0||j.value)?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(vt.value),onClick:I},[e.createVNode(M,{icon:"filter",class:"w-4 h-4"}),V[6]||(V[6]=e.createTextVNode(" Filters ",-1)),$.value>0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(ht.value)},e.toDisplayString($.value),3)):e.createCommentVNode("",!0),e.createVNode(M,{icon:r.value?"chevron-up":"chevron-down",class:"w-4 h-4 ml-1"},null,8,["icon"])],2)):e.createCommentVNode("",!0),A.$slots.filters?(e.openBlock(),e.createElementBlock("div",yf,[e.renderSlot(A.$slots,"filters")])):e.createCommentVNode("",!0),e.createElementVNode("div",xf,[C.value?(e.openBlock(),e.createBlock(J,{key:0,class:e.normalizeClass(R.value),onClick:Jo},{default:e.withCtx(()=>[e.createVNode(M,{icon:"rotate-left",class:"w-4 h-4 mr-2"}),V[7]||(V[7]=e.createTextVNode(" Clear All ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showExport?(e.openBlock(),e.createBlock(J,{key:1,class:e.normalizeClass(G.value),onClick:V[3]||(V[3]=B=>A.$emit("export"))},{default:e.withCtx(()=>[e.createVNode(M,{icon:"download",class:"w-4 h-4 mr-2"}),V[8]||(V[8]=e.createTextVNode(" Export ",-1))]),_:1},8,["class"])):e.createCommentVNode("",!0),t.showAdd&&s.value?(e.openBlock(),e.createElementBlock("div",kf,[l.value?(e.openBlock(),e.createBlock(J,{key:0,variant:t.addButton.variant||"success",size:t.addButton.size||"lg",disabled:m.value||!d.value,title:t.addButton.tooltip,onClick:p},{default:e.withCtx(()=>[t.addButton.icon?(e.openBlock(),e.createBlock(M,{key:0,icon:t.addButton.icon,class:"w-4 h-4 mr-2"},null,8,["icon"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.addButton.label||"Add"),1)]),_:1},8,["variant","size","disabled","title"])):e.renderSlot(A.$slots,"add",{key:1},()=>[e.createVNode(J,{variant:"success",size:"lg",onClick:V[4]||(V[4]=B=>A.$emit("add"))},{default:e.withCtx(()=>[e.createVNode(M,{icon:"plus",class:"w-4 h-4 mr-2"}),V[9]||(V[9]=e.createTextVNode(" Add ",-1))]),_:1})])])):e.createCommentVNode("",!0)])],2),t.showFilters&&r.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(He.value)},[e.createElementVNode("div",wf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dateFilters,B=>(e.openBlock(),e.createElementBlock("div",{key:B.key,class:"space-y-3"},[e.createElementVNode("div",Cf,[e.createElementVNode("label",{class:e.normalizeClass(ze.value)},e.toDisplayString(B.label),3),e.createElementVNode("span",{class:e.normalizeClass(u(B))},e.toDisplayString(k(B)?"Active":"Inactive"),3)]),e.createElementVNode("div",Bf,[e.createElementVNode("div",Vf,[e.createVNode(M,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.createElementVNode("input",{type:"date","model-value":B.from,class:e.normalizeClass(xe.value),placeholder:`From ${B.label}`,onInput:F=>i(B.key,"from",F.target.value)},null,42,Sf)]),e.createElementVNode("span",{class:e.normalizeClass(De.value)},"to",2),e.createElementVNode("div",Ef,[e.createVNode(M,{icon:"calendar",class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),e.createElementVNode("input",{type:"date","model-value":B.to,class:e.normalizeClass(xe.value),placeholder:`To ${B.label}`,onInput:F=>i(B.key,"to",F.target.value)},null,42,Nf)]),k(B)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(T.value),title:"Clear this filter",onClick:F=>f(B.key)},[e.createVNode(M,{icon:"xmark",class:"w-4 h-4"})],10,$f)):e.createCommentVNode("",!0)])]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.numberFilters,B=>(e.openBlock(),e.createElementBlock("div",{key:B.key,class:"space-y-3"},[e.createElementVNode("div",zf,[e.createElementVNode("label",{class:e.normalizeClass(ze.value)},e.toDisplayString(B.label),3),e.createElementVNode("span",{class:e.normalizeClass(b(B))},e.toDisplayString(c(B)?"Active":"Inactive"),3)]),e.createElementVNode("div",Df,[e.createElementVNode("div",Tf,[e.createElementVNode("input",{type:"number","model-value":B.min,class:e.normalizeClass(xe.value),placeholder:`Min ${B.label}`,step:B.step||1,onInput:F=>h(B.key,"min",F.target.value)},null,42,Af)]),e.createElementVNode("span",{class:e.normalizeClass(De.value)},"to",2),e.createElementVNode("div",Ff,[e.createElementVNode("input",{type:"number","model-value":B.max,class:e.normalizeClass(xe.value),placeholder:`Max ${B.label}`,step:B.step||1,onInput:F=>h(B.key,"max",F.target.value)},null,42,Pf)]),c(B)?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(T.value),title:"Clear this filter",onClick:F=>g(B.key)},[e.createVNode(M,{icon:"xmark",class:"w-4 h-4"})],10,Lf)):e.createCommentVNode("",!0)])]))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.multiSelectFilters,B=>(e.openBlock(),e.createElementBlock("div",{key:B.key,class:"space-y-3"},[e.createElementVNode("div",Mf,[e.createElementVNode("label",{class:e.normalizeClass(ze.value)},e.toDisplayString(B.label),3),e.createElementVNode("span",{class:e.normalizeClass(P(B))},e.toDisplayString(N(B)?`${B.selected.length} selected`:"None"),3)]),e.createElementVNode("div",jf,[e.createVNode(ue,{"model-value":"",class:e.normalizeClass($e.value),onChange:F=>H(B.key,F.target.value)},{default:e.withCtx(()=>[e.createElementVNode("option",If," Select "+e.toDisplayString(B.label),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.options,F=>(e.openBlock(),e.createElementBlock("option",{key:F.value,value:F.value},e.toDisplayString(F.label),9,Of))),128))]),_:2},1032,["class","onChange"]),e.createVNode(M,{icon:"chevron-down",class:"absolute right-2 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400 pointer-events-none"})]),B.selected.length>0?(e.openBlock(),e.createElementBlock("div",Rf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.selected,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"inline-flex items-center gap-1 bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full"},[e.createTextVNode(e.toDisplayString(E(B,F))+" ",1),e.createElementVNode("button",{class:"hover:bg-blue-200 rounded-full p-0.5",onClick:W=>_(B.key,F)},[e.createVNode(M,{icon:"xmark",class:"w-3 h-3"})],8,_f)]))),128))])):e.createCommentVNode("",!0)]))),128))])],2)):e.createCommentVNode("",!0),t.showFilters&&L.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(te.value)},[e.createElementVNode("div",Uf,[e.createElementVNode("span",{class:e.normalizeClass(ae.value)},"Active filters:",2),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,B=>(e.openBlock(),e.createElementBlock("div",{key:B.key,class:e.normalizeClass(Q.value)},[e.createVNode(M,{icon:B.icon,class:"w-3 h-3"},null,8,["icon"]),e.createElementVNode("span",null,e.toDisplayString(B.label)+": "+e.toDisplayString(B.value),1),e.createElementVNode("button",{class:e.normalizeClass(ca.value),onClick:F=>Zo(B.key)},[e.createVNode(M,{icon:"xmark",class:"w-3 h-3"})],10,qf)],2))),128))])],2)):e.createCommentVNode("",!0),t.showTableInfo?(e.openBlock(),e.createElementBlock("div",Hf,[e.createElementVNode("div",Yf,[e.createElementVNode("div",Wf,[e.createElementVNode("span",Gf,[e.createElementVNode("span",Kf,e.toDisplayString(t.totalItems||0),1),e.createTextVNode(" "+e.toDisplayString(t.itemLabel||"items")+" found ",1)])])])])):e.createCommentVNode("",!0)]))}},Xf={class:"flex items-center gap-3"},Qf={key:0,class:"flex items-center gap-3"},Jf={class:"text-sm text-slate-600"},Zf={class:"flex items-center gap-2"},ep={class:"flex items-center gap-3"},tp=["title","onClick"],ap={key:1,class:"relative"},np={class:"p-3"},op={class:"space-y-1"},rp={class:"flex items-center gap-2 cursor-pointer w-full"},lp=["checked","onChange"],sp=["disabled"],ip={key:3,class:"flex items-center gap-2"},cp=[{key:"delete",label:"Delete",icon:{template:'<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0" /></svg>'},variant:"danger"},{key:"edit",label:"Edit",icon:{template:'<svg fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" /></svg>'},variant:"primary"}],dp={name:"DataTableToolBar"},Oo=Object.assign(dp,{props:{selectedItems:{type:Array,default:()=>[]},totalItems:{type:Number,default:0},bulkActions:{type:Array,default:()=>cp},showDensityToggle:{type:Boolean,default:!0},showColumnToggle:{type:Boolean,default:!0},showRefresh:{type:Boolean,default:!0},isRefreshing:{type:Boolean,default:!1},density:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)},toggleableColumns:{type:Array,default:()=>[]},visibleColumns:{type:Array,default:()=>[]},variant:{type:String,default:"default",validator:t=>["default","minimal","bordered"].includes(t)},padding:{type:String,default:"normal",validator:t=>["compact","normal","comfortable"].includes(t)}},emits:["bulk-action","update:density","toggle-column","refresh"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(null),s=e.ref(null),d=e.computed(()=>a.selectedItems.length),m=[{value:"compact",label:"Compact",icon:["fas","minus"]},{value:"normal",label:"Normal",icon:["fas","bars"]},{value:"comfortable",label:"Comfortable",icon:["fas","bars-staggered"]}],p=D.cva("flex items-center justify-between border-b border-slate-200",{variants:{variant:{default:"bg-white",minimal:"bg-transparent border-slate-100",bordered:"bg-slate-50 border-slate-300"},padding:{compact:"p-2",normal:"p-4",comfortable:"p-6"}},defaultVariants:{variant:"default",padding:"normal"}}),v=D.cva("px-3 py-1.5 text-sm font-medium rounded-md flex items-center gap-1 transition-colors",{variants:{variant:{danger:"text-red-700 bg-red-500 hover:bg-red-400 border border-red-200",primary:"text-blue-700 bg-blue-50 hover:bg-blue-100 border border-blue-200",secondary:"text-slate-700 bg-slate-500 hover:bg-slate-400 border border-slate-200"}},defaultVariants:{variant:"secondary"}}),y=D.cva("p-2 border border-slate-300 transition-colors",{variants:{active:{true:"bg-blue-50 text-blue-600 border-blue-300",false:"bg-white text-slate-600 hover:bg-slate-50"},position:{first:"rounded-l-md border-r-0",middle:"border-x-0",last:"rounded-r-md border-l-0"}},defaultVariants:{active:!1,position:"middle"}}),S=D.cva("px-3 py-2 text-sm border border-slate-300 rounded-md flex items-center gap-2 transition-colors",{variants:{state:{normal:"text-slate-600 hover:text-slate-800 hover:bg-slate-50",refreshing:"text-slate-600 opacity-75 cursor-not-allowed"}},defaultVariants:{state:"normal"}}),x=e.computed(()=>w(p({variant:a.variant,padding:a.padding}))),k=e.computed(()=>"text-sm text-slate-600"),f=e.computed(()=>"flex items-center"),u=e.computed(()=>"flex items-center gap-2 px-3 py-2 text-sm text-slate-600 hover:text-slate-800 border border-slate-300 rounded-md hover:bg-slate-50 transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1"),i=e.computed(()=>"absolute right-0 top-full mt-1 w-56 bg-white border border-slate-200 rounded-lg shadow-lg z-50 max-h-64 overflow-y-auto"),c=e.computed(()=>"text-xs font-medium text-slate-500 uppercase tracking-wider mb-2 border-b border-slate-100 pb-2"),g=e.computed(()=>"py-1 hover:bg-slate-50 rounded transition-colors"),b=e.computed(()=>"w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500 focus:ring-2 focus:ring-offset-1"),h=e.computed(()=>"text-sm text-slate-700 flex-1 select-none"),N=$=>{l.value&&s.value&&!l.value.contains($.target)&&!s.value.contains($.target)&&(r.value=!1)},P=()=>{r.value=!r.value},H=$=>w(v({variant:$.variant||"secondary"})),_=$=>{let L="middle";return $==="compact"?L="first":$==="comfortable"&&(L="last"),w(y({active:a.density===$,position:L}))},E=()=>w(S({state:a.isRefreshing?"refreshing":"normal"})),I=()=>w("w-4 h-4",{"animate-spin":a.isRefreshing}),j=$=>a.visibleColumns.includes($),C=($,L)=>{o("toggle-column",{column:$,visible:L})};return e.onMounted(()=>{document.addEventListener("click",N)}),e.onUnmounted(()=>{document.removeEventListener("click",N)}),($,L)=>{const Y=e.resolveComponent("font-awesome-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(x.value)},[e.createElementVNode("div",Xf,[d.value>0?(e.openBlock(),e.createElementBlock("div",Qf,[e.createElementVNode("span",Jf,e.toDisplayString(d.value)+" selected ",1),e.createElementVNode("div",Zf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.bulkActions,U=>(e.openBlock(),e.createBlock(J,{key:U.key,class:e.normalizeClass(H(U)),onClick:re=>$.$emit("bulk-action",{action:U.key,items:t.selectedItems})},{default:e.withCtx(()=>[U.icon?(e.openBlock(),e.createBlock(Y,{key:0,icon:U.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(U.label),1)]),_:2},1032,["class","onClick"]))),128))])])):t.totalItems>0?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(k.value)},e.toDisplayString(t.totalItems)+" "+e.toDisplayString(t.totalItems===1?"item":"items"),3)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ep,[t.showDensityToggle?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(f.value)},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(m,U=>e.createElementVNode("button",{key:U.value,class:e.normalizeClass(_(U.value)),title:U.label,type:"button",onClick:re=>$.$emit("update:density",U.value)},[e.createVNode(Y,{icon:U.icon,class:"w-4 h-4"},null,8,["icon"])],10,tp)),64))],2)):e.createCommentVNode("",!0),t.showColumnToggle?(e.openBlock(),e.createElementBlock("div",ap,[e.createElementVNode("button",{ref_key:"columnToggleButton",ref:l,class:e.normalizeClass(u.value),type:"button",onClick:e.withModifiers(P,["stop"])},[e.createVNode(Y,{icon:"columns",class:"w-4 h-4"}),L[2]||(L[2]=e.createElementVNode("span",null,"Columns",-1))],2),e.withDirectives(e.createElementVNode("div",{ref_key:"columnMenu",ref:s,class:e.normalizeClass(i.value),onClick:L[0]||(L[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",np,[e.createElementVNode("div",{class:e.normalizeClass(c.value)}," Show Columns ",2),e.createElementVNode("div",op,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.toggleableColumns,U=>(e.openBlock(),e.createElementBlock("div",{key:U.key,class:e.normalizeClass(g.value)},[e.createElementVNode("label",rp,[e.createElementVNode("input",{type:"checkbox",checked:j(U.key),class:e.normalizeClass(b.value),onChange:re=>C(U.key,re.target.checked)},null,42,lp),e.createElementVNode("span",{class:e.normalizeClass(h.value)},e.toDisplayString(U.label),3)])],2))),128))])])],2),[[e.vShow,r.value]])])):e.createCommentVNode("",!0),t.showRefresh?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:t.isRefreshing,class:e.normalizeClass(E()),type:"button",onClick:L[1]||(L[1]=U=>$.$emit("refresh"))},[e.createVNode(Y,{icon:"sync",class:e.normalizeClass(I())},null,8,["class"]),L[3]||(L[3]=e.createElementVNode("span",null,"Refresh",-1))],10,sp)):e.createCommentVNode("",!0),$.$slots.actions?(e.openBlock(),e.createElementBlock("div",ip,[e.renderSlot($.$slots,"actions")])):e.createCommentVNode("",!0)])],2)}}}),up={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12"},mp={class:"grid grid-cols-1 md:grid-cols-4 gap-8"},fp={class:"col-span-1 md:col-span-2"},pp={class:"space-y-2"},gp={class:"flex space-x-4"},vp={class:"flex flex-col md:flex-row justify-between items-center"},hp={class:"flex space-x-6 mt-4 md:mt-0"},Ro={__name:"Footer",props:{className:{type:String,default:""}},setup(t){return(n,a)=>{const o=e.resolveComponent("Logo"),r=e.resolveComponent("Text"),l=e.resolveComponent("Typography"),s=e.resolveComponent("Link"),d=e.resolveComponent("Icon"),m=e.resolveComponent("Divider");return e.openBlock(),e.createElementBlock("footer",{class:e.normalizeClass(e.unref(w)("bg-gray-50 border-t border-gray-200",t.className))},[e.createElementVNode("div",up,[e.createElementVNode("div",mp,[e.createElementVNode("div",fp,[e.renderSlot(n.$slots,"brand",{},()=>[e.createVNode(o,{class:"mb-4"}),e.createVNode(r,{class:"text-gray-600 max-w-md"},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode(" Building beautiful applications with modern Vue.js components. ",-1)])]),_:1})])]),e.createElementVNode("div",null,[e.renderSlot(n.$slots,"links",{},()=>[e.createVNode(l,{variant:"h6",class:"mb-4"},{default:e.withCtx(()=>[...a[1]||(a[1]=[e.createTextVNode(" Quick Links ",-1)])]),_:1}),e.createElementVNode("div",pp,[e.createVNode(s,{href:"#",class:"block text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[2]||(a[2]=[e.createTextVNode(" About ",-1)])]),_:1}),e.createVNode(s,{href:"#",class:"block text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[3]||(a[3]=[e.createTextVNode(" Services ",-1)])]),_:1}),e.createVNode(s,{href:"#",class:"block text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[4]||(a[4]=[e.createTextVNode(" Contact ",-1)])]),_:1})])])]),e.createElementVNode("div",null,[e.renderSlot(n.$slots,"social",{},()=>[e.createVNode(l,{variant:"h6",class:"mb-4"},{default:e.withCtx(()=>[...a[5]||(a[5]=[e.createTextVNode(" Follow Us ",-1)])]),_:1}),e.createElementVNode("div",gp,[e.createVNode(s,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[e.createVNode(d,{name:"twitter",class:"h-5 w-5"})]),_:1}),e.createVNode(s,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[e.createVNode(d,{name:"github",class:"h-5 w-5"})]),_:1})])])])]),e.createVNode(m,{class:"my-8"}),e.createElementVNode("div",vp,[e.renderSlot(n.$slots,"copyright",{},()=>[e.createVNode(r,{class:"text-gray-600"},{default:e.withCtx(()=>[e.createTextVNode(" © "+e.toDisplayString(new Date().getFullYear())+" Your Company. All rights reserved. ",1)]),_:1})]),e.renderSlot(n.$slots,"legal",{},()=>[e.createElementVNode("div",hp,[e.createVNode(s,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[6]||(a[6]=[e.createTextVNode(" Privacy ",-1)])]),_:1}),e.createVNode(s,{href:"#",class:"text-gray-600 hover:text-gray-900"},{default:e.withCtx(()=>[...a[7]||(a[7]=[e.createTextVNode(" Terms ",-1)])]),_:1})])])])])],2)}}},bp={class:"flex items-center justify-between h-16 px-4 md:px-6"},yp={class:"flex items-center"},xp={key:0,class:"mr-4 flex-shrink-0 bg-gradient-to-r from-blue-50 to-indigo-50 px-3 py-2 rounded-lg border border-blue-100"},kp={class:"text-lg font-bold text-blue-900 truncate max-w-[200px]"},wp={key:0,class:"text-xs text-blue-600 truncate font-medium"},Cp={class:"hidden md:flex items-center space-x-2 text-sm truncate"},Bp={class:"text-gray-500 truncate"},Vp={class:"text-gray-900 font-medium truncate"},Sp={class:"flex items-center space-x-3 md:space-x-4"},Ep={key:1,class:"relative"},Np={key:0,class:"absolute -top-1 -right-1 w-4 h-4 bg-red-500 text-white text-xs rounded-full flex items-center justify-center"},$p={key:0,class:"absolute right-4 md:right-6 top-16 mt-2 w-72 md:w-80 bg-white rounded-lg shadow-lg border border-gray-200 z-50"},zp={class:"max-h-96 overflow-y-auto"},Dp={class:"flex items-start space-x-3"},Tp={class:"flex-1"},Ap={class:"text-sm text-gray-900"},Fp={class:"text-xs text-gray-500 mt-1"},Pp={class:"relative"},Lp={class:"w-8 h-8 bg-gradient-to-br from-blue-100 to-indigo-100 rounded-full flex items-center justify-center transition-colors shadow-sm"},Mp={class:"text-blue-700 text-sm font-medium"},jp={class:"hidden md:block text-left max-w-[160px] truncate"},Ip={class:"text-sm font-medium text-gray-900 truncate"},Op={class:"text-xs text-gray-500 truncate leading-tight"},Rp={key:0,class:"absolute right-0 mt-2 w-58 bg-white rounded-lg shadow-lg border border-gray-200 z-50"},_p={class:"p-4 border-b border-gray-200"},Up={class:"text-sm font-medium text-gray-900"},qp={class:"text-xs text-gray-500"},Hp={class:"py-2"},Yp={key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gradient-to-b from-blue-500 to-blue-600 rounded-r-full"},Wp=["onClick"],Gp={class:"flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors ml-2 bg-gray-100 text-gray-600 group-hover:bg-gray-200"},Kp={class:"flex-1 truncate font-semibold text-gray-700"},_o={__name:"Header",props:{sidebarWidth:{type:Number,default:256},currentSection:{type:String,default:"Dashboard"},currentPage:{type:String,default:"Overview"},currentRoute:{type:String,default:""},user:{type:Object,required:!0},notifications:{type:Array,default:()=>[]},profileMenuItems:{type:Array,required:!0},mobileOpen:{type:Boolean,default:!1},currentOrganisation:{type:Object,default:null},companyLogo:{type:String,default:""}},emits:["search","profile-action","logout","navigate","toggle-mobile-sidebar"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(""),l=e.ref(!1),s=e.ref(!1),d=e.ref(a.notifications.length),m=e.ref(!1),p=e.ref(!1),v=e.computed(()=>(a.user?.name||"Guest").split(" ").map(h=>h[0]||"").join("").toUpperCase()),y=e.computed(()=>a.user?.roles?.length?a.user.roles.map(b=>b.name).join(", "):"No role"),S=()=>{l.value=!l.value,s.value=!1},x=()=>{s.value=!s.value,l.value=!1},k=b=>{o("navigate",b),s.value=!1},f=b=>b.route?!!(a.currentRoute===b.route||a.currentRoute.startsWith(b.route+"/")):!1,u=b=>{o("profile-action",b),s.value=!1},i=()=>{o("logout"),s.value=!1},c=b=>{!b.target.closest(".absolute")&&!b.target.closest("button")&&(l.value=!1,s.value=!1)},g=()=>{p.value=window.innerWidth<768};return e.onMounted(()=>{document.addEventListener("click",c),g(),window.addEventListener("resize",g)}),e.onUnmounted(()=>{document.removeEventListener("click",c),window.removeEventListener("resize",g)}),e.watch(r,b=>o("search",b)),(b,h)=>{const N=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("header",{class:e.normalizeClass(e.unref(w)("fixed top-0 z-50 bg-white border-b border-gray-200 transition-all duration-300 ease-in-out w-full")),style:{left:"0"}},[e.createElementVNode("div",bp,[e.createElementVNode("div",yp,[t.currentOrganisation?(e.openBlock(),e.createElementBlock("div",xp,[e.createElementVNode("p",kp,e.toDisplayString(t.currentOrganisation.organisation_name),1),t.currentOrganisation.role?(e.openBlock(),e.createElementBlock("p",wp,e.toDisplayString(t.currentOrganisation.role),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("nav",Cp,[e.createElementVNode("span",Bp,e.toDisplayString(t.currentSection),1),h[4]||(h[4]=e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})],-1)),e.createElementVNode("span",Vp,e.toDisplayString(t.currentPage),1)])]),e.createElementVNode("div",Sp,[p.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"p-2 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-50 transition-colors",onClick:h[0]||(h[0]=P=>o("toggle-mobile-sidebar"))},[...h[5]||(h[5]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})],-1)])])):e.createCommentVNode("",!0),!p.value||m.value?(e.openBlock(),e.createElementBlock("div",Ep,[h[6]||(h[6]=e.createElementVNode("div",{class:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"},[e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})])],-1)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[1]||(h[1]=P=>r.value=P),type:"text",placeholder:"Search...",class:"pl-10 pr-4 py-2 w-48 md:w-64 text-sm border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none"},null,512),[[e.vModelText,r.value]]),p.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",onClick:h[2]||(h[2]=P=>m.value=!1)}," ✕ ")):e.createCommentVNode("",!0)])):p.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:"p-2 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-50 transition-colors",onClick:h[3]||(h[3]=P=>m.value=!0)},[...h[7]||(h[7]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{class:"relative p-2 text-gray-400 hover:text-gray-600 rounded-lg hover:bg-gray-50 transition-colors",onClick:S},[h[8]||(h[8]=e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 17h5l-5 5v-5z"}),e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 3h2.586a1 1 0 01.707.293l6.414 6.414a1 1 0 01.293.707V19a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h4L13 3z"})],-1)),d.value>0?(e.openBlock(),e.createElementBlock("span",Np,e.toDisplayString(d.value),1)):e.createCommentVNode("",!0)]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",$p,[h[10]||(h[10]=e.createElementVNode("div",{class:"p-4 border-b border-gray-200"},[e.createElementVNode("h3",{class:"text-lg font-semibold text-gray-900"}," Notifications ")],-1)),e.createElementVNode("div",zp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.notifications,P=>(e.openBlock(),e.createElementBlock("div",{key:P.id,class:"p-4 border-b border-gray-100 hover:bg-gray-50 cursor-pointer"},[e.createElementVNode("div",Dp,[h[9]||(h[9]=e.createElementVNode("div",{class:"flex-shrink-0 w-2 h-2 mt-2 bg-blue-500 rounded-full"},null,-1)),e.createElementVNode("div",Tp,[e.createElementVNode("p",Ap,e.toDisplayString(P.title),1),e.createElementVNode("p",Fp,e.toDisplayString(P.time),1)])])]))),128))]),h[11]||(h[11]=e.createElementVNode("div",{class:"p-4 text-center"},[e.createElementVNode("button",{class:"text-sm text-blue-600 hover:text-blue-800"}," View all notifications ")],-1))])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Pp,[e.createElementVNode("button",{class:"flex items-center space-x-2 md:space-x-3 p-2 rounded-lg hover:bg-gray-50 transition-colors",onClick:x},[e.createElementVNode("div",Lp,[e.createElementVNode("span",Mp,e.toDisplayString(v.value),1)]),e.createElementVNode("div",jp,[e.createElementVNode("p",Ip,e.toDisplayString(t.user.name),1),e.createElementVNode("p",Op,e.toDisplayString(y.value),1)]),h[12]||(h[12]=e.createElementVNode("svg",{class:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))]),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","leave-active-class":"transition-all duration-200 ease-in","enter-from-class":"opacity-0 translate-y-2 scale-95","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-2 scale-95"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("div",Rp,[e.createElementVNode("div",_p,[e.createElementVNode("p",Up,e.toDisplayString(t.user.name),1),e.createElementVNode("p",qp,e.toDisplayString(t.user.email),1)]),e.createElementVNode("div",Hp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.profileMenuItems,P=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:P.name},[P.route?(e.openBlock(),e.createBlock(N,{key:0,to:P.route,class:e.normalizeClass(e.unref(w)("flex items-center px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",f(P)?"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-700 shadow-sm border border-blue-200":"text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent")),onClick:H=>k(P)},{default:e.withCtx(()=>[f(P)?(e.openBlock(),e.createElementBlock("div",Yp)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors ml-2",f(P)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"bg-gray-100 text-gray-600 group-hover:bg-gray-200"))},[P.icon?(e.openBlock(),e.createBlock(M,{key:0,icon:P.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w)("flex-1 truncate font-semibold",f(P)?"text-blue-700":"text-gray-700"))},e.toDisplayString(P.label),3)]),_:2},1032,["to","class","onClick"])):(e.openBlock(),e.createElementBlock("button",{key:1,class:"flex items-center w-full px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent",onClick:H=>u(P)},[e.createElementVNode("div",Gp,[P.icon?(e.openBlock(),e.createBlock(M,{key:0,icon:P.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Kp,e.toDisplayString(P.label),1)],8,Wp))],64))),128))]),e.createElementVNode("div",{class:"border-t border-gray-200 py-2"},[e.createElementVNode("button",{class:"flex items-center w-full px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative text-red-600 hover:bg-red-50 border border-transparent",onClick:i},[...h[13]||(h[13]=[e.createElementVNode("div",{class:"flex items-center justify-center w-8 h-8 rounded-lg mr-1 flex-shrink-0 transition-colors ml-2 bg-red-100 text-red-600 group-hover:bg-red-200"},[e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a2 2 0 013-3h4a3 3 0 013 3v1"})])],-1),e.createElementVNode("span",{class:"truncate font-semibold text-red-600"}," Sign out ",-1)])])])])):e.createCommentVNode("",!0)]),_:1})])])])],2)}}},Xp={class:"relative"},Qp=["id","disabled"],Jp={key:0,class:"text-gray-500"},Zp={key:1,class:"flex flex-wrap gap-1.5"},eg={class:"px-3 py-2.5 border-b border-gray-200 bg-gray-50"},tg={key:0,class:"max-h-52 overflow-y-auto py-1"},ag=["onClick"],ng={class:"flex items-center gap-3"},og=["checked"],rg={key:1,class:"px-4 py-6 text-sm text-gray-500 text-center"},Uo={__name:"MultiSelect",props:{modelValue:{type:Array,default:()=>[]},options:{type:Array,required:!0,validator:t=>t.every(n=>n.value!==void 0&&n.label)},id:{type:String,default:null},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:"Select options"},hasError:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const a=t,o=n,r=e.ref(!1),l=e.ref(""),s=e.ref(null),d=e.ref([...a.options]),m=e.ref(null),p=e.ref({}),v=e.computed(()=>a.options.filter(i=>a.modelValue.includes(i.value)).map(i=>i.label)),y=()=>{if(!m.value)return;const i=m.value.getBoundingClientRect(),c=window.innerHeight,g=c-i.bottom,b=320;g<b&&i.top>b?p.value={position:"fixed",bottom:`${c-i.top+4}px`,left:`${i.left}px`,width:`${i.width}px`,zIndex:9999}:p.value={position:"fixed",top:`${i.bottom+4}px`,left:`${i.left}px`,width:`${i.width}px`,zIndex:9999}},S=()=>{a.disabled||(r.value=!r.value,r.value?(y(),e.nextTick(()=>{s.value?.focus()})):(l.value="",d.value=[...a.options]))},x=i=>{let c;a.modelValue.includes(i)?c=a.modelValue.filter(g=>g!==i):c=[...a.modelValue,i],o("update:modelValue",c)},k=()=>{if(!l.value.trim())d.value=[...a.options];else{const i=l.value.toLowerCase();d.value=a.options.filter(c=>c.label.toLowerCase().includes(i))}},f=i=>{i.key==="Escape"&&(r.value=!1,l.value="",d.value=[...a.options])},u=i=>{if(!m.value)return;const c=i.target;c&&!m.value.contains(c)&&!c.closest("[data-multiselect-dropdown]")&&(r.value=!1,l.value="",d.value=[...a.options])};return e.onMounted(()=>{document.addEventListener("click",u),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y)}),e.onUnmounted(()=>{document.removeEventListener("click",u),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)}),e.watch(()=>a.options,i=>{d.value=[...i]},{immediate:!0}),e.watch(r,i=>{i&&y()}),(i,c)=>(e.openBlock(),e.createElementBlock("div",Xp,[e.createElementVNode("button",{ref_key:"buttonRef",ref:m,type:"button",id:t.id,disabled:t.disabled,class:e.normalizeClass(["w-full px-3 py-2.5 text-left border rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 bg-white min-h-[42px]",t.hasError?"border-red-500":"border-slate-300",t.disabled?"bg-gray-100 cursor-not-allowed opacity-50":"hover:border-slate-400"]),onClick:S,onKeydown:f},[v.value.length===0?(e.openBlock(),e.createElementBlock("div",Jp,e.toDisplayString(t.placeholder||"Select options"),1)):(e.openBlock(),e.createElementBlock("div",Zp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,g=>(e.openBlock(),e.createBlock(na,{key:g,variant:"primary",size:"sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g),1)]),_:2},1024))),128))])),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["absolute right-3 top-1/2 -translate-y-1/2 h-5 w-5 text-gray-400 pointer-events-none transition-transform duration-200",{"rotate-180":r.value}]),fill:"currentColor",viewBox:"0 0 20 20"},[...c[2]||(c[2]=[e.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])],2))],42,Qp),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(p.value),"data-multiselect-dropdown":"",class:"bg-white shadow-lg max-h-72 rounded-md text-base ring-1 ring-black ring-opacity-5 overflow-hidden focus:outline-none"},[e.createElementVNode("div",eg,[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:s,"onUpdate:modelValue":c[0]||(c[0]=g=>l.value=g),type:"text",placeholder:"Search options...",class:"w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white",onInput:k,onKeydown:c[1]||(c[1]=e.withModifiers(()=>{},["stop"]))},null,544),[[e.vModelText,l.value]])]),d.value.length>0?(e.openBlock(),e.createElementBlock("div",tg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,g=>(e.openBlock(),e.createElementBlock("button",{key:g.value,type:"button",class:e.normalizeClass(["cursor-pointer select-none relative py-2.5 pl-3 pr-9 w-full text-left hover:bg-blue-50 focus:bg-blue-50 focus:outline-none transition-colors duration-150",{"bg-blue-50":t.modelValue.includes(g.value)}]),onClick:b=>x(g.value)},[e.createElementVNode("div",ng,[e.createElementVNode("input",{type:"checkbox",checked:t.modelValue.includes(g.value),class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded cursor-pointer pointer-events-none",readonly:"",tabindex:"-1"},null,8,og),e.createElementVNode("span",{class:e.normalizeClass(["block font-normal truncate",{"text-blue-900 font-medium":t.modelValue.includes(g.value)}])},e.toDisplayString(g.label),3)])],10,ag))),128))])):(e.openBlock(),e.createElementBlock("div",rg," No options found "))],4)):e.createCommentVNode("",!0)]),_:1})]))]))}},lg={class:"mb-6"},sg={class:"text-xl font-semibold text-gray-900"},ig={class:"text-sm text-gray-600 mt-1"},cg=["onUpdate:modelValue"],dg={key:4,class:"flex items-center"},ug={key:5,class:"flex items-center"},mg=["id","aria-checked","disabled","onClick"],fg={key:6,class:"space-y-2"},pg={key:7,class:"space-y-2"},gg={key:0,class:"text-xs text-gray-500"},vg={key:9,class:"space-y-2"},hg={class:"flex items-center gap-4"},bg={class:"text-sm font-medium text-gray-700 min-w-[3rem] text-right"},yg={class:"flex justify-end gap-3 pt-6"},qo={__name:"ReusableFormModal",props:{modelValue:{type:Boolean,default:!1},modalType:{type:String,required:!0,validator:t=>["create","edit"].includes(t)},entityName:{type:String,default:"Item"},fields:{type:Array,required:!0,validator:t=>t.every(n=>n.name&&n.label&&n.type&&["text","number","password","textarea","select","checkbox","slider","date","color","email","tel","url","time","datetime-local","month","week","file","radio","switch","range","search","hidden","multiselect"].includes(n.type))},initialData:{type:Object,default:null},loading:{type:Boolean,default:!1},customValidation:{type:Function,default:null},modalSize:{type:String,default:"4xl",validator:t=>["sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl","8xl","full"].includes(t)},modalHeight:{type:String,default:"auto"},modalResizable:{type:Boolean,default:!1}},emits:["update:modelValue","submit","close"],setup(t,{emit:n}){const a=t,o=n,r=e.computed({get:()=>a.modelValue,set:u=>o("update:modelValue",u)}),l=e.computed(()=>a.loading),s=e.ref({}),d=e.ref({}),m=e.ref(!1),p=()=>{const u={};return a.fields.forEach(i=>{i.type==="checkbox"||i.type==="switch"?u[i.name]=!1:i.type==="number"||i.type==="slider"||i.type==="range"?u[i.name]=i.min!==void 0?i.min:0:i.type==="file"?u[i.name]=null:i.type==="radio"?u[i.name]=i.options?.[0]?.value||"":i.type==="multiselect"?u[i.name]=[]:u[i.name]=""}),u};e.watch(()=>a.initialData,u=>{if(a.modalType==="edit"&&u){const i={};a.fields.forEach(c=>{c.type==="checkbox"||c.type==="switch"?i[c.name]=u[c.name]??!1:c.type==="number"||c.type==="slider"||c.type==="range"?i[c.name]=u[c.name]??(c.min!==void 0?c.min:0):c.type==="file"?i[c.name]=null:c.type==="multiselect"?i[c.name]=Array.isArray(u[c.name])?u[c.name]:[]:i[c.name]=u[c.name]??""}),s.value=i,m.value=!0}else if(a.modalType==="create"&&u&&!m.value){const i={};a.fields.forEach(c=>{u[c.name]!==void 0&&u[c.name]!==null?i[c.name]=u[c.name]:c.type==="checkbox"||c.type==="switch"?i[c.name]=!1:c.type==="number"||c.type==="slider"||c.type==="range"?i[c.name]=c.min!==void 0?c.min:0:c.type==="file"?i[c.name]=null:c.type==="radio"?i[c.name]=c.options?.[0]?.value||"":c.type==="multiselect"?i[c.name]=[]:i[c.name]=""}),s.value=i,m.value=!0}else a.modalType==="create"&&!u&&(s.value=p(),m.value=!1)},{immediate:!0,deep:!0}),e.watch(()=>a.modelValue,u=>{if(u&&(d.value={},a.modalType==="create")){if(m.value=!1,a.initialData){const i={};a.fields.forEach(c=>{a.initialData[c.name]!==void 0&&a.initialData[c.name]!==null?i[c.name]=a.initialData[c.name]:c.type==="checkbox"||c.type==="switch"?i[c.name]=!1:c.type==="number"||c.type==="slider"||c.type==="range"?i[c.name]=c.min!==void 0?c.min:0:c.type==="file"?i[c.name]=null:c.type==="radio"?i[c.name]=c.options?.[0]?.value||"":c.type==="multiselect"?i[c.name]=[]:i[c.name]=""}),s.value=i}else s.value=p();m.value=!0}}),e.watch(()=>a.initialData,u=>{m.value&&u&&Object.keys(u).forEach(i=>{Object.prototype.hasOwnProperty.call(s.value,i)&&u[i]!==void 0&&u[i]!==null&&(s.value[i]=u[i])})},{deep:!0});const v=()=>{if(d.value={},a.fields.forEach(u=>{if(u.required&&!u.disabled&&u.type!=="hidden"){const i=s.value[u.name];u.type==="checkbox"||u.type==="switch"?u.required&&!i&&(d.value[u.name]=u.errorMessage||`${u.label} is required`):u.type==="number"||u.type==="slider"||u.type==="range"?i===""||i===null||i===void 0?d.value[u.name]=u.errorMessage||`${u.label} is required`:u.min!==void 0&&Number(i)<u.min?d.value[u.name]=`${u.label} must be at least ${u.min}`:u.max!==void 0&&Number(i)>u.max&&(d.value[u.name]=`${u.label} must be at most ${u.max}`):u.type==="email"?!i||!i.trim()?d.value[u.name]=u.errorMessage||`${u.label} is required`:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i)||(d.value[u.name]="Please enter a valid email address"):u.type==="url"?!i||!i.trim()?d.value[u.name]=u.errorMessage||`${u.label} is required`:/^https?:\/\/.+/.test(i)||(d.value[u.name]="Please enter a valid URL"):u.type==="tel"?(!i||!i.trim())&&(d.value[u.name]=u.errorMessage||`${u.label} is required`):u.type==="file"?i||(d.value[u.name]=u.errorMessage||`${u.label} is required`):u.type==="radio"?i||(d.value[u.name]=u.errorMessage||`${u.label} is required`):u.type==="multiselect"?(!Array.isArray(i)||i.length===0)&&(d.value[u.name]=u.errorMessage||`${u.label} is required`):u.type==="date"||u.type==="time"||u.type==="datetime-local"||u.type==="month"||u.type==="week"?(!i||typeof i=="string"&&!i.trim())&&(d.value[u.name]=u.errorMessage||`${u.label} is required`):u.type==="password"?(!i||typeof i=="string"&&!i.trim())&&(d.value[u.name]=u.errorMessage||`${u.label} is required`):(!i||typeof i=="string"&&!i.trim())&&(d.value[u.name]=u.errorMessage||`${u.label} is required`)}if(u.validate&&typeof u.validate=="function"){const i=u.validate(s.value[u.name],s.value);i&&(d.value[u.name]=i)}}),a.customValidation){const u=a.customValidation(s.value);u&&Object.keys(u).length>0&&(d.value={...d.value,...u})}return Object.keys(d.value).length===0},y=async(u,i)=>{if(s.value[u.name]=i,u.onChange&&typeof u.onChange=="function")try{await u.onChange(i,s.value)}catch(c){console.error("Error in onChange handler:",c),ne.error("An error occurred while processing the change")}},S=(u,i)=>{if(s.value[u.name]=i,u.onChange&&typeof u.onChange=="function")try{u.onChange(i,s.value)}catch(c){console.error("Error in onChange handler:",c),ne.error("An error occurred while processing the change")}},x=(u,i)=>{const c=i.target.files?.[0]||null;if(s.value[u.name]=c,u.onChange&&typeof u.onChange=="function")try{u.onChange(c,s.value)}catch(g){console.error("Error in onChange handler:",g),ne.error("An error occurred while processing the file")}},k=async()=>{try{if(!v()){ne.error("Please fix the validation errors before submitting");return}const u={};a.fields.forEach(i=>{const c=s.value[i.name];i.type==="number"||i.type==="slider"||i.type==="range"?u[i.name]=Number(c):i.type==="text"||i.type==="textarea"||i.type==="date"||i.type==="email"||i.type==="url"||i.type==="tel"||i.type==="search"||i.type==="time"||i.type==="datetime-local"||i.type==="month"||i.type==="week"?u[i.name]=typeof c=="string"?c.trim():c:(i.type==="password"||i.type,u[i.name]=c)}),o("submit",{formData:u,modalType:a.modalType,originalData:a.initialData})}catch(u){console.error("Error during form submission:",u),ne.error("An error occurred during submission")}},f=()=>{s.value=p(),d.value={},m.value=!1,o("close")};return(u,i)=>(e.openBlock(),e.createBlock(mt,{modelValue:r.value,"onUpdate:modelValue":i[0]||(i[0]=c=>r.value=c),"show-close":!0,"close-on-backdrop":!0,size:t.modalSize,class:e.normalizeClass(t.modalHeight==="auto"?"":t.modalHeight),resizable:t.modalResizable,onClose:f},{default:e.withCtx(()=>[e.createElementVNode("div",lg,[e.createElementVNode("h2",sg,e.toDisplayString(t.modalType==="create"?`Add New ${t.entityName}`:`Edit ${t.entityName}`),1),e.createElementVNode("p",ig,e.toDisplayString(t.modalType==="create"?`Fill in the details to create a new ${t.entityName.toLowerCase()}.`:`Update the ${t.entityName.toLowerCase()} information below.`),1)]),e.createElementVNode("form",{class:"space-y-6 overflow-y-auto",onSubmit:e.withModifiers(k,["prevent"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,c=>(e.openBlock(),e.createElementBlock("div",{key:c.name},[c.type==="hidden"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":g=>s.value[c.name]=g,type:"hidden"},null,8,cg)),[[e.vModelText,s.value[c.name]]]):(e.openBlock(),e.createBlock(ut,{key:1,id:`form-${t.entityName}-${c.name}-${Math.random().toString(36).slice(2,5)}`,label:c.label,required:c.required&&!c.disabled,error:d.value[c.name],"error-message":d.value[c.name]},{default:e.withCtx(({fieldId:g,hasError:b,ariaDescribedBy:h})=>[["text","number","password","color","email","tel","url","search"].includes(c.type)?(e.openBlock(),e.createBlock(X,{key:0,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:c.type,placeholder:c.placeholder,disabled:l.value||c.disabled,readonly:c.disabled,class:e.normalizeClass(b?"border-red-500":"border-slate-300"),"aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","disabled","readonly","class","aria-describedby"])):c.type==="textarea"?(e.openBlock(),e.createBlock(dt,{key:1,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,placeholder:c.placeholder,disabled:l.value||c.disabled,rows:c.rows||3,class:e.normalizeClass(["w-full px-3 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",b?"border-red-500":"border-slate-300"]),"aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","placeholder","disabled","rows","class","aria-describedby"])):c.type==="select"?(e.openBlock(),e.createBlock(ue,{key:2,id:g,"model-value":s.value[c.name],options:c.options,placeholder:c.placeholder||"Select an option",disabled:l.value||c.disabled,"has-error":b,"aria-describedby":h,"onUpdate:modelValue":N=>y(c,N)},null,8,["id","model-value","options","placeholder","disabled","has-error","aria-describedby","onUpdate:modelValue"])):c.type==="multiselect"?(e.openBlock(),e.createBlock(Uo,{key:3,id:g,"model-value":s.value[c.name],options:c.options,disabled:l.value||c.disabled,placeholder:c.placeholder||"Select options","has-error":b,"aria-describedby":h,"onUpdate:modelValue":N=>s.value[c.name]=N},null,8,["id","model-value","options","disabled","placeholder","has-error","aria-describedby","onUpdate:modelValue"])):c.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",dg,[e.createVNode(X,{id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:"checkbox",disabled:l.value||c.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded","aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","disabled","aria-describedby"]),e.createVNode(fe,{for:g,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.checkboxLabel||c.label),1)]),_:2},1032,["for"])])):c.type==="switch"?(e.openBlock(),e.createElementBlock("div",ug,[e.createElementVNode("button",{id:g,type:"button",role:"switch","aria-checked":s.value[c.name],disabled:l.value||c.disabled,class:e.normalizeClass(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",s.value[c.name]?"bg-blue-600":"bg-gray-200",l.value||c.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:N=>s.value[c.name]=!s.value[c.name]},[e.createElementVNode("span",{class:e.normalizeClass(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform",s.value[c.name]?"translate-x-6":"translate-x-1"])},null,2)],10,mg),e.createVNode(fe,{for:g,class:"ml-3 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.checkboxLabel||c.label),1)]),_:2},1032,["for"])])):c.type==="radio"?(e.openBlock(),e.createElementBlock("div",fg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.options,N=>(e.openBlock(),e.createElementBlock("div",{key:N.value,class:"flex items-center"},[e.createVNode(X,{id:`${g}-${N.value}`,modelValue:s.value[c.name],"onUpdate:modelValue":P=>s.value[c.name]=P,type:"radio",value:N.value,disabled:l.value||c.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300","aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","value","disabled","aria-describedby"]),e.createVNode(fe,{for:`${g}-${N.value}`,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(N.label),1)]),_:2},1032,["for"])]))),128))])):c.type==="file"?(e.openBlock(),e.createElementBlock("div",pg,[e.createVNode(X,{id:g,type:"file",accept:c.accept,disabled:l.value||c.disabled,class:e.normalizeClass(["w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100",b?"border-red-500":"border-slate-300"]),"aria-describedby":h,onChange:N=>x(c,N)},null,8,["id","accept","disabled","class","aria-describedby","onChange"]),c.helpText?(e.openBlock(),e.createElementBlock("p",gg,e.toDisplayString(c.helpText),1)):e.createCommentVNode("",!0)])):c.type==="slider"?(e.openBlock(),e.createBlock(ft,{key:8,"model-value":s.value[c.name],min:c.min,max:c.max,step:c.step,disabled:l.value||c.disabled,"onUpdate:modelValue":N=>S(c,N)},null,8,["model-value","min","max","step","disabled","onUpdate:modelValue"])):c.type==="range"?(e.openBlock(),e.createElementBlock("div",vg,[e.createElementVNode("div",hg,[e.createVNode(X,{id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:"range",min:c.min,max:c.max,step:c.step||1,disabled:l.value||c.disabled,class:"flex-1","aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","min","max","step","disabled","aria-describedby"]),e.createElementVNode("span",bg,e.toDisplayString(s.value[c.name]),1)])])):c.type==="date"?(e.openBlock(),e.createBlock(qe,{key:10,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,disabled:l.value||c.disabled,required:c.required,min:c.min,max:c.max,placeholder:c.placeholder||"Select date",format:c.format||"MM/DD/YYYY",clearable:c.clearable!==!1,"show-today":c.showToday!==!1,"calendar-position":c.calendarPosition||"left-0 bottom-full","aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","disabled","required","min","max","placeholder","format","clearable","show-today","calendar-position","aria-describedby"])):c.type==="time"?(e.openBlock(),e.createBlock(X,{key:11,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:"time",disabled:l.value||c.disabled,class:e.normalizeClass(b?"border-red-500":"border-slate-300"),"aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):c.type==="datetime-local"?(e.openBlock(),e.createBlock(X,{key:12,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:"datetime-local",disabled:l.value||c.disabled,class:e.normalizeClass(b?"border-red-500":"border-slate-300"),"aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):c.type==="month"?(e.openBlock(),e.createBlock(X,{key:13,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:"month",disabled:l.value||c.disabled,class:e.normalizeClass(b?"border-red-500":"border-slate-300"),"aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):c.type==="week"?(e.openBlock(),e.createBlock(X,{key:14,id:g,modelValue:s.value[c.name],"onUpdate:modelValue":N=>s.value[c.name]=N,type:"week",disabled:l.value||c.disabled,class:e.normalizeClass(b?"border-red-500":"border-slate-300"),"aria-describedby":h},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):e.createCommentVNode("",!0)]),_:2},1032,["id","label","required","error","error-message"]))]))),128)),e.createElementVNode("div",yg,[e.createVNode(J,{type:"button",variant:"outline",disabled:l.value,onClick:f},{default:e.withCtx(()=>[...i[1]||(i[1]=[e.createTextVNode(" Cancel ",-1)])]),_:1},8,["disabled"]),e.createVNode(J,{type:"submit",disabled:l.value,loading:l.value,variant:"default"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.modalType==="create"?`Create ${t.entityName}`:`Update ${t.entityName}`),1)]),_:1},8,["disabled","loading"])])],32)]),_:1},8,["modelValue","size","class","resizable"]))}},xg={class:"w-full p-6"},kg={key:0,class:"mb-6"},wg={class:"text-xl font-semibold text-gray-900"},Cg=["onUpdate:modelValue"],Bg={key:4,class:"flex items-center"},Vg={key:5,class:"flex items-center"},Sg=["id","aria-checked","disabled","onClick"],Eg={key:6,class:"space-y-2"},Ng={key:7,class:"space-y-2"},$g={key:0,class:"text-xs text-gray-500"},zg={key:9,class:"space-y-2"},Dg={class:"flex items-center gap-4"},Tg={class:"text-sm font-medium text-gray-700 min-w-[3rem] text-right"},Ag={class:"flex justify-end gap-3 pt-6"},Ho={__name:"ReusableForm",props:{title:{type:String,default:"Form"},entityName:{type:String,default:"Item"},fields:{type:Array,required:!0,validator:t=>t.every(n=>n.name&&n.label&&n.type&&["text","number","password","textarea","select","checkbox","slider","date","color","email","tel","url","time","datetime-local","month","week","file","radio","switch","range","search","hidden","multiselect"].includes(n.type))},initialData:{type:Object,default:null},loading:{type:Boolean,default:!1},customValidation:{type:Function,default:null}},emits:["submit","reset"],setup(t,{emit:n}){const a=t,o=n,r=e.computed(()=>a.loading),l=e.ref({}),s=e.ref({}),d=e.ref(!1),m=()=>{const f={};return a.fields.forEach(u=>{u.type==="checkbox"||u.type==="switch"?f[u.name]=!1:u.type==="number"||u.type==="slider"||u.type==="range"?f[u.name]=u.min!==void 0?u.min:0:u.type==="file"?f[u.name]=null:u.type==="radio"?f[u.name]=u.options?.[0]?.value||"":u.type==="multiselect"?f[u.name]=[]:f[u.name]=""}),f};e.watch(()=>a.initialData,f=>{if(f){const u={};a.fields.forEach(i=>{i.type==="checkbox"||i.type==="switch"?u[i.name]=f[i.name]??!1:i.type==="number"||i.type==="slider"||i.type==="range"?u[i.name]=f[i.name]??(i.min!==void 0?i.min:0):i.type==="file"?u[i.name]=null:i.type==="multiselect"?u[i.name]=Array.isArray(f[i.name])?f[i.name]:[]:u[i.name]=f[i.name]??""}),l.value=u,d.value=!0}else l.value=m(),d.value=!1},{immediate:!0,deep:!0}),e.watch(()=>a.initialData,f=>{d.value&&f&&Object.keys(f).forEach(u=>{Object.prototype.hasOwnProperty.call(l.value,u)&&f[u]!==void 0&&f[u]!==null&&(l.value[u]=f[u])})},{deep:!0});const p=()=>{if(s.value={},a.fields.forEach(f=>{if(f.required&&!f.disabled&&f.type!=="hidden"){const u=l.value[f.name];f.type==="checkbox"||f.type==="switch"?f.required&&!u&&(s.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="number"||f.type==="slider"||f.type==="range"?u===""||u===null||u===void 0?s.value[f.name]=f.errorMessage||`${f.label} is required`:f.min!==void 0&&Number(u)<f.min?s.value[f.name]=`${f.label} must be at least ${f.min}`:f.max!==void 0&&Number(u)>f.max&&(s.value[f.name]=`${f.label} must be at most ${f.max}`):f.type==="email"?!u||!u.trim()?s.value[f.name]=f.errorMessage||`${f.label} is required`:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(u)||(s.value[f.name]="Please enter a valid email address"):f.type==="url"?!u||!u.trim()?s.value[f.name]=f.errorMessage||`${f.label} is required`:/^https?:\/\/.+/.test(u)||(s.value[f.name]="Please enter a valid URL"):f.type==="tel"?(!u||!u.trim())&&(s.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="file"?u||(s.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="radio"?u||(s.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="multiselect"?(!Array.isArray(u)||u.length===0)&&(s.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="date"||f.type==="time"||f.type==="datetime-local"||f.type==="month"||f.type==="week"?(!u||typeof u=="string"&&!u.trim())&&(s.value[f.name]=f.errorMessage||`${f.label} is required`):f.type==="password"?(!u||typeof u=="string"&&!u.trim())&&(s.value[f.name]=f.errorMessage||`${f.label} is required`):(!u||typeof u=="string"&&!u.trim())&&(s.value[f.name]=f.errorMessage||`${f.label} is required`)}if(f.validate&&typeof f.validate=="function"){const u=f.validate(l.value[f.name],l.value);u&&(s.value[f.name]=u)}}),a.customValidation){const f=a.customValidation(l.value);f&&Object.keys(f).length>0&&(s.value={...s.value,...f})}return Object.keys(s.value).length===0},v=async(f,u)=>{if(l.value[f.name]=u,f.onChange&&typeof f.onChange=="function")try{await f.onChange(u,l.value)}catch(i){console.error("Error in onChange handler:",i),ne.error("An error occurred while processing the change")}},y=(f,u)=>{if(l.value[f.name]=u,f.onChange&&typeof f.onChange=="function")try{f.onChange(u,l.value)}catch(i){console.error("Error in onChange handler:",i),ne.error("An error occurred while processing the change")}},S=(f,u)=>{const i=u.target.files?.[0]||null;if(l.value[f.name]=i,f.onChange&&typeof f.onChange=="function")try{f.onChange(i,l.value)}catch(c){console.error("Error in onChange handler:",c),ne.error("An error occurred while processing the file")}},x=async()=>{try{if(!p()){ne.error("Please fix the validation errors before submitting");return}const f={};a.fields.forEach(u=>{const i=l.value[u.name];u.type==="number"||u.type==="slider"||u.type==="range"?f[u.name]=Number(i):u.type==="text"||u.type==="textarea"||u.type==="date"||u.type==="email"||u.type==="url"||u.type==="tel"||u.type==="search"||u.type==="time"||u.type==="datetime-local"||u.type==="month"||u.type==="week"?f[u.name]=typeof i=="string"?i.trim():i:(u.type==="password"||u.type,f[u.name]=i)}),o("submit",{formData:f,originalData:a.initialData})}catch(f){console.error("Error during form submission:",f),ne.error("An error occurred during submission")}},k=()=>{l.value=m(),s.value={},d.value=!1,o("reset")};return(f,u)=>(e.openBlock(),e.createElementBlock("div",xg,[t.title?(e.openBlock(),e.createElementBlock("div",kg,[e.createElementVNode("h2",wg,e.toDisplayString(t.title),1)])):e.createCommentVNode("",!0),e.createElementVNode("form",{class:"space-y-8",onSubmit:e.withModifiers(x,["prevent"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.fields,i=>(e.openBlock(),e.createElementBlock("div",{key:i.name},[i.type==="hidden"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,"onUpdate:modelValue":c=>l.value[i.name]=c,type:"hidden"},null,8,Cg)),[[e.vModelText,l.value[i.name]]]):(e.openBlock(),e.createBlock(ut,{key:1,id:`form-${t.entityName}-${i.name}-${Math.random().toString(36).slice(2,5)}`,label:i.label,required:i.required&&!i.disabled,error:s.value[i.name],"error-message":s.value[i.name]},{default:e.withCtx(({fieldId:c,hasError:g,ariaDescribedBy:b})=>[["text","number","password","color","email","tel","url","search"].includes(i.type)?(e.openBlock(),e.createBlock(X,{key:0,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:i.type,placeholder:i.placeholder,disabled:r.value||i.disabled,readonly:i.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","disabled","readonly","class","aria-describedby"])):i.type==="textarea"?(e.openBlock(),e.createBlock(dt,{key:1,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,placeholder:i.placeholder,disabled:r.value||i.disabled,rows:i.rows||3,class:e.normalizeClass(["w-full px-3 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",g?"border-red-500":"border-slate-300"]),"aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","placeholder","disabled","rows","class","aria-describedby"])):i.type==="select"?(e.openBlock(),e.createBlock(ue,{key:2,id:c,"model-value":l.value[i.name],options:i.options,placeholder:i.placeholder||"Select an option",disabled:r.value||i.disabled,"has-error":g,"aria-describedby":b,"onUpdate:modelValue":h=>v(i,h)},null,8,["id","model-value","options","placeholder","disabled","has-error","aria-describedby","onUpdate:modelValue"])):i.type==="multiselect"?(e.openBlock(),e.createBlock(Uo,{key:3,id:c,"model-value":l.value[i.name],options:i.options,disabled:r.value||i.disabled,placeholder:i.placeholder||"Select options","has-error":g,"aria-describedby":b,"onUpdate:modelValue":h=>l.value[i.name]=h},null,8,["id","model-value","options","disabled","placeholder","has-error","aria-describedby","onUpdate:modelValue"])):i.type==="checkbox"?(e.openBlock(),e.createElementBlock("div",Bg,[e.createVNode(X,{id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:"checkbox",disabled:r.value||i.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded","aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","disabled","aria-describedby"]),e.createVNode(fe,{for:c,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.checkboxLabel||i.label),1)]),_:2},1032,["for"])])):i.type==="switch"?(e.openBlock(),e.createElementBlock("div",Vg,[e.createElementVNode("button",{id:c,type:"button",role:"switch","aria-checked":l.value[i.name],disabled:r.value||i.disabled,class:e.normalizeClass(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",l.value[i.name]?"bg-blue-600":"bg-gray-200",r.value||i.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:h=>l.value[i.name]=!l.value[i.name]},[e.createElementVNode("span",{class:e.normalizeClass(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform",l.value[i.name]?"translate-x-6":"translate-x-1"])},null,2)],10,Sg),e.createVNode(fe,{for:c,class:"ml-3 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.checkboxLabel||i.label),1)]),_:2},1032,["for"])])):i.type==="radio"?(e.openBlock(),e.createElementBlock("div",Eg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.options,h=>(e.openBlock(),e.createElementBlock("div",{key:h.value,class:"flex items-center"},[e.createVNode(X,{id:`${c}-${h.value}`,modelValue:l.value[i.name],"onUpdate:modelValue":N=>l.value[i.name]=N,type:"radio",value:h.value,disabled:r.value||i.disabled,class:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300","aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","value","disabled","aria-describedby"]),e.createVNode(fe,{for:`${c}-${h.value}`,class:"ml-2 text-sm text-gray-700"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.label),1)]),_:2},1032,["for"])]))),128))])):i.type==="file"?(e.openBlock(),e.createElementBlock("div",Ng,[e.createVNode(X,{id:c,type:"file",accept:i.accept,disabled:r.value||i.disabled,class:e.normalizeClass(["w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100",g?"border-red-500":"border-slate-300"]),"aria-describedby":b,onChange:h=>S(i,h)},null,8,["id","accept","disabled","class","aria-describedby","onChange"]),i.helpText?(e.openBlock(),e.createElementBlock("p",$g,e.toDisplayString(i.helpText),1)):e.createCommentVNode("",!0)])):i.type==="slider"?(e.openBlock(),e.createBlock(ft,{key:8,"model-value":l.value[i.name],min:i.min,max:i.max,step:i.step,disabled:r.value||i.disabled,"onUpdate:modelValue":h=>y(i,h)},null,8,["model-value","min","max","step","disabled","onUpdate:modelValue"])):i.type==="range"?(e.openBlock(),e.createElementBlock("div",zg,[e.createElementVNode("div",Dg,[e.createVNode(X,{id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:"range",min:i.min,max:i.max,step:i.step||1,disabled:r.value||i.disabled,class:"flex-1","aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","min","max","step","disabled","aria-describedby"]),e.createElementVNode("span",Tg,e.toDisplayString(l.value[i.name]),1)])])):i.type==="date"?(e.openBlock(),e.createBlock(qe,{key:10,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,disabled:r.value||i.disabled,required:i.required,min:i.min,max:i.max,placeholder:i.placeholder||"Select date",format:i.format||"MM/DD/YYYY",clearable:i.clearable!==!1,"show-today":i.showToday!==!1,"calendar-position":i.calendarPosition||"left-0 bottom-full","aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","disabled","required","min","max","placeholder","format","clearable","show-today","calendar-position","aria-describedby"])):i.type==="time"?(e.openBlock(),e.createBlock(X,{key:11,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:"time",disabled:r.value||i.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):i.type==="datetime-local"?(e.openBlock(),e.createBlock(X,{key:12,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:"datetime-local",disabled:r.value||i.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):i.type==="month"?(e.openBlock(),e.createBlock(X,{key:13,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:"month",disabled:r.value||i.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):i.type==="week"?(e.openBlock(),e.createBlock(X,{key:14,id:c,modelValue:l.value[i.name],"onUpdate:modelValue":h=>l.value[i.name]=h,type:"week",disabled:r.value||i.disabled,class:e.normalizeClass(g?"border-red-500":"border-slate-300"),"aria-describedby":b},null,8,["id","modelValue","onUpdate:modelValue","disabled","class","aria-describedby"])):e.createCommentVNode("",!0)]),_:2},1032,["id","label","required","error","error-message"]))]))),128)),e.createElementVNode("div",Ag,[e.createVNode(J,{type:"button",variant:"outline",disabled:r.value,onClick:k},{default:e.withCtx(()=>[...u[0]||(u[0]=[e.createTextVNode(" Reset ",-1)])]),_:1},8,["disabled"]),e.createVNode(J,{type:"submit",disabled:r.value,loading:r.value,variant:"default"},{default:e.withCtx(()=>[...u[1]||(u[1]=[e.createTextVNode(" Submit ",-1)])]),_:1},8,["disabled","loading"])])],32)]))}},Fg={key:0,class:"flex items-center justify-between p-4 border-b border-gray-200 flex-shrink-0 lg:hidden"},Pg={class:"text-lg font-bold text-gray-900"},Lg={class:"flex-1 overflow-y-auto overflow-x-hidden p-4"},Mg={class:"space-y-2"},jg={key:0},Ig={key:0,class:"absolute top-2 right-2 inline-flex items-center justify-center w-5 h-5 text-xs font-bold rounded-full bg-red-500 text-white"},Og=["onClick"],Rg={key:0,class:"absolute top-2 right-2 inline-flex items-center justify-center w-5 h-5 text-xs font-bold rounded-full bg-red-500 text-white"},_g={key:1,class:"absolute top-1.5 right-1.5 w-2 h-2 bg-blue-500 rounded-full"},Ug={key:1,class:"border-t border-gray-200 p-4 flex-shrink-0"},qg={key:0,class:"absolute top-1.5 right-1.5 w-2 h-2 bg-blue-500 rounded-full"},Hg={class:"sticky top-0 bg-white border-b border-gray-200 z-10"},Yg={class:"flex items-center justify-between p-4"},Wg={class:"flex-1 text-sm font-bold text-gray-900 ml-2"},Gg={class:"p-3"},Kg={class:"space-y-1"},Xg={key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gradient-to-b from-blue-500 to-blue-600 rounded-r-full"},Qg={key:1,class:"ml-2 inline-flex items-center justify-center px-2 py-0.5 text-xs font-bold rounded-full bg-red-500 text-white"},Jg={class:"p-3"},Zg={class:"space-y-1"},ev={key:0,class:"px-3 py-2 text-xs font-semibold text-gray-500 uppercase tracking-wider"},tv={key:0,class:"absolute left-0 top-1/2 transform -translate-y-1/2 w-1 h-8 bg-gradient-to-b from-blue-500 to-blue-600 rounded-r-full"},Yo={__name:"Sidebar",props:{sidebarWidth:{type:Number,default:130},header:{type:Object,default:null},navigationItems:{type:Array,required:!0},managementSettings:{type:Array,default:()=>[]},showManagementSettings:{type:Boolean,default:!0},mobileOpen:{type:Boolean,default:!1},isManagementSettingsActive:{type:Boolean,default:!1},currentPath:{type:String,default:""}},emits:["navigate","update:mobileOpen"],setup(t,{expose:n,emit:a}){const o=t,r=a,l=e.ref(!1),s=e.ref(!1),d=e.ref(null),m=e.ref(!1),p=e.computed(()=>o.mobileOpen),v=e.computed(()=>l.value?{}:{left:`${o.sidebarWidth}px`}),y=e.computed(()=>l.value?{}:{left:`${o.sidebarWidth}px`}),S=e.computed(()=>{if(l.value)return 0;let E=o.sidebarWidth;return s.value&&(E+=220),m.value&&(E+=220),E}),x=E=>{r("navigate",E),l.value&&k();const I=s.value&&d.value&&d.value.subItems.some(C=>C.route===E.route),j=m.value&&o.managementSettings.some(C=>C.route===E.route);(l.value||!(I||j))&&b()},k=()=>{r("update:mobileOpen",!1)},f=E=>E.subItems&&E.subItems.length>0,u=E=>{m.value&&g(),s.value&&d.value!==E?(c(),setTimeout(()=>{d.value=E,s.value=!0},300)):s.value?d.value===E&&c():(d.value=E,s.value=!0),l.value&&k()},i=()=>{s.value&&c(),m.value?g():m.value=!0,l.value&&k()},c=()=>{s.value=!1,setTimeout(()=>{d.value=null},300)},g=()=>{m.value=!1},b=()=>{c(),g()},h=E=>{x(E)},N=E=>{x(E)},P=E=>{const I=o.currentPath;return E.route?!!(I===E.route||I.startsWith(E.route+"/")):E.subItems&&E.subItems.length>0?E.subItems.some(j=>j.route?I===j.route||I.startsWith(j.route+"/"):!1):!1},H=()=>{const E=l.value;l.value=window.innerWidth<1024,E&&!l.value&&p.value&&k()},_=E=>{E.key==="Escape"&&(s.value||m.value?b():l.value&&p.value&&k())};return e.onMounted(()=>{H(),window.addEventListener("resize",H),document.addEventListener("keydown",_)}),e.onUnmounted(()=>{window.removeEventListener("resize",H),document.removeEventListener("keydown",_)}),n({isMobile:l,isMobileOpen:p,submenuOpen:s,managementSettingsOpen:m,contentMarginLeft:S,closeAllMenus:b}),(E,I)=>{const j=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.Transition,{"enter-active-class":"transition-opacity duration-300","leave-active-class":"transition-opacity duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[p.value&&l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-30 lg:hidden",onClick:k})):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("aside",{class:e.normalizeClass(e.unref(w)("fixed left-0 z-40 border-r overflow-hidden flex flex-col","transition-all duration-300 ease-in-out","bg-white border-gray-200",l.value?e.unref(w)("transform h-screen",p.value?"translate-x-0":"-translate-x-full"):"translate-x-0 h-[calc(100vh-4rem)]")),style:e.normalizeStyle({width:t.sidebarWidth+"px",top:l.value?"0px":"4rem"})},[l.value?(e.openBlock(),e.createElementBlock("div",Fg,[e.createElementVNode("h2",Pg,e.toDisplayString(t.header?.title),1),e.createElementVNode("button",{class:"p-2 rounded-lg text-gray-500 hover:text-gray-900 hover:bg-gray-100 transition-colors","aria-label":"Close sidebar",onClick:k},[...I[0]||(I[0]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])):e.createCommentVNode("",!0),e.createElementVNode("nav",Lg,[e.createElementVNode("div",Mg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.navigationItems,C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.name||C.label},[C.type==="link"?(e.openBlock(),e.createElementBlock("div",jg,[f(C)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(w)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 cursor-pointer group relative py-4 px-3",P(C)?"bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-transparent")),onClick:$=>u(C)},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex items-center justify-center rounded-lg transition-colors mb-2","w-12 h-12",P(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"text-gray-500 group-hover:text-gray-900 bg-gray-100 group-hover:bg-gray-200"))},[e.createVNode(M,{icon:C.icon,class:"w-6 h-6"},null,8,["icon"])],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w)("text-xs font-medium text-center",P(C)?"text-blue-700 font-semibold":"text-gray-500 group-hover:text-gray-900"))},e.toDisplayString(C.label),3),C.badge?(e.openBlock(),e.createElementBlock("span",Rg,e.toDisplayString(C.badge),1)):e.createCommentVNode("",!0),P(C)&&f(C)?(e.openBlock(),e.createElementBlock("div",_g)):e.createCommentVNode("",!0)],10,Og)):(e.openBlock(),e.createBlock(j,{key:0,to:C.route,class:e.normalizeClass(e.unref(w)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 group relative py-4 px-3",P(C)?"bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-transparent")),onClick:$=>x(C)},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex items-center justify-center rounded-lg transition-colors mb-2","w-12 h-12",P(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"text-gray-500 group-hover:text-gray-900 bg-gray-100 group-hover:bg-gray-200"))},[e.createVNode(M,{icon:C.icon,class:"w-6 h-6"},null,8,["icon"])],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w)("text-xs font-medium text-center",P(C)?"text-blue-700 font-semibold":"text-gray-500 group-hover:text-gray-900"))},e.toDisplayString(C.label),3),C.badge?(e.openBlock(),e.createElementBlock("span",Ig,e.toDisplayString(C.badge),1)):e.createCommentVNode("",!0)]),_:2},1032,["to","class","onClick"]))])):e.createCommentVNode("",!0)],64))),128))])]),t.showManagementSettings?(e.openBlock(),e.createElementBlock("div",Ug,[e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex flex-col items-center justify-center rounded-xl transition-all duration-200 cursor-pointer group relative py-4 px-3",t.isManagementSettingsActive?"bg-gradient-to-br from-blue-50 to-blue-100 border border-blue-200 shadow-sm":"text-gray-500 hover:bg-gray-100 hover:text-gray-900 border border-transparent")),onClick:i},[e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex items-center justify-center rounded-lg transition-colors mb-2","w-12 h-12",t.isManagementSettingsActive?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"text-gray-500 group-hover:text-gray-900 bg-gray-100 group-hover:bg-gray-200"))},[e.createVNode(M,{icon:"cog",class:"w-6 h-6"})],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w)("text-xs font-medium text-center",t.isManagementSettingsActive?"text-blue-700 font-semibold":"text-gray-500 group-hover:text-gray-900"))}," Settings ",2),t.isManagementSettingsActive?(e.openBlock(),e.createElementBlock("div",qg)):e.createCommentVNode("",!0)],2)])):e.createCommentVNode("",!0)],6),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 -translate-x-full","enter-to-class":"opacity-100 translate-x-0","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 -translate-x-full"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(e.unref(w)("fixed z-40 bg-white border-r border-gray-200 overflow-y-auto shadow-lg",l.value?"left-0 w-52 top-20 h-screen":"w-56 top-16 h-[calc(100vh-4rem)]")),style:e.normalizeStyle(v.value)},[e.createElementVNode("div",Hg,[e.createElementVNode("div",Yg,[e.createElementVNode("button",{class:"p-2 -ml-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors","aria-label":"Close submenu",onClick:c},[...I[1]||(I[1]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),e.createElementVNode("h3",Wg,e.toDisplayString(d.value?.label),1)])]),e.createElementVNode("nav",Gg,[e.createElementVNode("div",Kg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value?.subItems,C=>(e.openBlock(),e.createBlock(j,{key:C.name,to:C.route,class:e.normalizeClass(e.unref(w)("flex items-center px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",P(C)?"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-700 shadow-sm border border-blue-200":"text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent")),onClick:$=>h(C)},{default:e.withCtx(()=>[P(C)?(e.openBlock(),e.createElementBlock("div",Xg)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors ml-2",P(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"bg-gray-100 text-gray-600 group-hover:bg-gray-200"))},[C.icon?(e.openBlock(),e.createBlock(M,{key:0,icon:C.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w)("flex-1 truncate font-semibold",P(C)?"text-blue-700":"text-gray-700"))},e.toDisplayString(C.label),3),C.badge?(e.openBlock(),e.createElementBlock("span",Qg,e.toDisplayString(C.badge),1)):e.createCommentVNode("",!0)]),_:2},1032,["to","class","onClick"]))),128))])])],6)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","leave-active-class":"transition-all duration-300 ease-in","enter-from-class":"opacity-0 -translate-x-full","enter-to-class":"opacity-100 translate-x-0","leave-from-class":"opacity-100 translate-x-0","leave-to-class":"opacity-0 -translate-x-full"},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("aside",{key:0,class:e.normalizeClass(e.unref(w)("fixed z-40 bg-white border-r border-gray-200 overflow-y-auto shadow-lg",l.value?"left-0 w-52 top-20 h-full":"w-58 h-[calc(100vh-4rem)]")),style:e.normalizeStyle({...y.value,top:l.value?"55px":"4rem"})},[e.createElementVNode("div",{class:"sticky top-0 z-10 bg-white border-b border-gray-200"},[e.createElementVNode("div",{class:"flex items-center justify-between p-4"},[e.createElementVNode("button",{class:"p-2 -ml-2 rounded-lg text-gray-500 hover:text-gray-700 hover:bg-gray-100 transition-colors","aria-label":"Close management settings",onClick:g},[...I[2]||(I[2]=[e.createElementVNode("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1)])]),I[3]||(I[3]=e.createElementVNode("h3",{class:"flex-1 text-sm font-bold text-gray-900 ml-2"}," Management Settings ",-1))])]),e.createElementVNode("nav",Jg,[e.createElementVNode("div",Zg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.managementSettings,C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.name},[C.type==="section"?(e.openBlock(),e.createElementBlock("div",ev,e.toDisplayString(C.label),1)):C.route?(e.openBlock(),e.createBlock(j,{key:1,to:C.route,class:e.normalizeClass(e.unref(w)("flex items-center px-3 py-2.5 rounded-lg text-sm font-medium transition-all duration-200 group relative",P(C)?"bg-gradient-to-br from-blue-50 to-blue-100 text-blue-700 shadow-sm border border-blue-200":"text-gray-700 hover:bg-gray-50 hover:text-gray-900 border border-transparent")),onClick:$=>N(C)},{default:e.withCtx(()=>[P(C)?(e.openBlock(),e.createElementBlock("div",tv)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(w)("flex items-center justify-center w-8 h-8 rounded-lg mr-3 flex-shrink-0 transition-colors",P(C)?"bg-gradient-to-br from-blue-500 to-blue-600 text-white shadow-md":"bg-gray-100 text-gray-600 group-hover:bg-gray-200"))},[C.icon?(e.openBlock(),e.createBlock(M,{key:0,icon:C.icon,class:"w-4 h-4"},null,8,["icon"])):e.createCommentVNode("",!0)],2),e.createElementVNode("span",{class:e.normalizeClass(e.unref(w)("flex-1 truncate font-semibold",P(C)?"text-blue-700":"text-gray-700"))},e.toDisplayString(C.label),3)]),_:2},1032,["to","class","onClick"])):e.createCommentVNode("",!0)],64))),128))])])],6)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{"enter-active-class":"transition-opacity duration-300","leave-active-class":"transition-opacity duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[(s.value||m.value)&&l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-30 bg-transparent",onClick:b})):e.createCommentVNode("",!0)]),_:1})])}}},Wo={__name:"Timeline",props:{orientation:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex",t.orientation==="vertical"?"flex-col":"flex-row"])},[e.renderSlot(n.$slots,"default")],2))}},av={key:0,class:"absolute left-3 top-0 w-0.5 h-full bg-slate-200"},nv={class:"z-10 flex items-center justify-center w-6 h-6 rounded-full border-2 border-blue-500 bg-white text-blue-500"},ov={class:"text-slate-900 font-medium"},rv={key:0,class:"text-slate-500 text-sm"},lv={class:"mt-2 text-slate-600 text-sm"},Go={__name:"TimelineItem",props:{title:{type:String,required:!0},subtitle:{type:String,default:""},orientation:{type:String,default:"vertical",validator:t=>["vertical","horizontal"].includes(t)}},setup(t){return(n,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative flex",t.orientation==="vertical"?"items-start mb-8 last:mb-0":"flex-col items-center mx-8 last:mx-0"])},[t.orientation==="vertical"?(e.openBlock(),e.createElementBlock("div",av)):e.createCommentVNode("",!0),e.createElementVNode("div",nv,[e.renderSlot(n.$slots,"icon",{},()=>[a[0]||(a[0]=e.createElementVNode("div",{class:"w-2 h-2 rounded-full bg-blue-500"},null,-1))])]),e.createElementVNode("div",{class:e.normalizeClass(["ml-6",t.orientation==="horizontal"?"mt-2 text-center":""])},[e.createElementVNode("h3",ov,[e.renderSlot(n.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])]),t.subtitle?(e.openBlock(),e.createElementBlock("p",rv,[e.renderSlot(n.$slots,"subtitle",{},()=>[e.createTextVNode(e.toDisplayString(t.subtitle),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",lv,[e.renderSlot(n.$slots,"default")])],2)],2))}},sv={name:"AuthLayout",props:{title:{type:String,default:null},subtitle:{type:String,default:null},primaryLogoPrefix:{type:String,default:"e"},primaryLogoText:{type:String,default:"HORIZON"},secondaryLogoPrefix:{type:String,default:"e"},secondaryLogoText:{type:String,default:"Risk & Compliance"},quote:{type:String,default:""},primaryColor:{type:String,default:"#e74c3c"},backgroundColor:{type:String,default:"#2c2c2c"},backgroundImage:{type:String,default:"https://images.unsplash.com/photo-1497366216548-37526070297c?ixlib=rb-4.0.3&auto=format&fit=crop&w=2069&q=80"},backgroundOpacity:{type:Number,default:.4},companyName:{type:String,default:"SOFTWARE"},companyType:{type:String,default:"TECHNOLOGIES"},companyTagline:{type:String,default:"People | Processes | Governance"},companyInitials:{type:String,default:"ST"},appName:{type:String,default:"eHorizon eBoard X"},appVersion:{type:String,default:"Version 2.0"},copyright:{type:String,default:"Copyright © 2025 Software Technologies Limited"},socialLinks:{type:Array,default:()=>[{name:"linkedin",url:"#",icon:"linkedin-in",variant:"primary"},{name:"facebook",url:"#",icon:"facebook-f",variant:"primary"},{name:"twitter",url:"#",icon:"twitter",variant:"info"}]}},setup(){return{currentYear:e.computed(()=>new Date().getFullYear())}}},iv={class:"container mx-auto px-4 relative z-10"},cv={class:"grid lg:grid-cols-10 gap-8 items-center min-h-screen"},dv={class:"lg:col-span-6 text-white text-center lg:text-left space-y-6"},uv={class:"mb-6"},mv={class:"text-4xl lg:text-6xl font-bold mb-2"},fv={class:"text-white"},pv={class:"flex items-center justify-center lg:justify-start mb-6"},gv={class:"text-3xl lg:text-4xl font-bold text-white"},vv={class:"lg:col-span-4"},hv={class:"bg-white rounded-lg shadow-xl p-6 lg:p-8 max-w-md mx-auto"},bv={key:0,class:"mb-6"},yv={class:"text-center"},xv={class:"text-2xl font-bold text-gray-900"},kv={key:0,class:"text-gray-600 mt-2"},wv={class:"space-y-6"},Cv={key:1,class:"mt-6"},Bv={key:0,class:"mt-6 text-center"},Vv={class:"absolute bottom-4 right-4 text-right"},Sv={class:"flex items-end justify-end mb-2"},Ev={class:"text-right mr-3"},Nv={class:"text-red-500 font-bold text-xs"},$v={class:"text-white text-xs"},zv={class:"text-white/70 text-xs"},Dv={class:"w-8 h-8 bg-red-500 rounded flex items-center justify-center text-white font-bold text-xs"},Tv={class:"text-white/70 text-xs"},Av={class:"absolute bottom-4 left-4 flex gap-2"},Fv=["href"];function Pv(t,n,a,o,r,l){const s=e.resolveComponent("router-view"),d=e.resolveComponent("font-awesome-icon");return e.openBlock(),e.createElementBlock("div",{class:"min-h-screen relative flex items-center justify-center",style:e.normalizeStyle({backgroundColor:a.backgroundColor})},[e.createElementVNode("div",{class:"absolute inset-0 bg-cover bg-center",style:e.normalizeStyle({backgroundImage:`url('${a.backgroundImage}')`,opacity:a.backgroundOpacity})},null,4),e.createElementVNode("div",iv,[e.createElementVNode("div",cv,[e.createElementVNode("div",dv,[e.createElementVNode("div",uv,[e.createElementVNode("div",mv,[e.createElementVNode("span",{style:e.normalizeStyle({color:a.primaryColor})},e.toDisplayString(a.primaryLogoPrefix),5),e.createElementVNode("span",fv,e.toDisplayString(a.primaryLogoText),1)]),e.createElementVNode("div",{class:"h-0.5 w-30 mx-auto lg:mx-0",style:e.normalizeStyle({backgroundColor:a.primaryColor})},null,4)]),e.createElementVNode("div",pv,[e.createElementVNode("div",{class:"flex items-center justify-center w-15 h-15 rounded-lg mr-4 text-white font-bold text-xl",style:e.normalizeStyle({backgroundColor:a.primaryColor})},e.toDisplayString(a.secondaryLogoPrefix),5),e.createElementVNode("span",gv,e.toDisplayString(a.secondaryLogoText),1)]),n[0]||(n[0]=e.createElementVNode("div",{class:"max-w-md mx-auto lg:mx-0"},[e.createElementVNode("p",{class:"text-sm lg:text-base font-light text-white/70 italic leading-relaxed"})],-1))]),e.createElementVNode("div",vv,[e.createElementVNode("div",hv,[t.$slots["card-header"]||a.title?(e.openBlock(),e.createElementBlock("div",bv,[e.renderSlot(t.$slots,"card-header",{},()=>[e.createElementVNode("div",yv,[e.createElementVNode("h1",xv,e.toDisplayString(a.title),1),a.subtitle?(e.openBlock(),e.createElementBlock("p",kv,e.toDisplayString(a.subtitle),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),e.createElementVNode("div",wv,[e.createVNode(s)]),t.$slots["card-footer"]?(e.openBlock(),e.createElementBlock("div",Cv,[e.renderSlot(t.$slots,"card-footer")])):e.createCommentVNode("",!0)]),t.$slots.links?(e.openBlock(),e.createElementBlock("div",Bv,[e.renderSlot(t.$slots,"links")])):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Vv,[e.createElementVNode("div",Sv,[e.createElementVNode("div",Ev,[e.createElementVNode("div",Nv,e.toDisplayString(a.companyName),1),e.createElementVNode("div",$v,e.toDisplayString(a.companyType),1),e.createElementVNode("div",zv,e.toDisplayString(a.companyTagline),1)]),e.createElementVNode("div",Dv,e.toDisplayString(a.companyInitials),1)]),e.createElementVNode("div",Tv,[e.createElementVNode("div",null,e.toDisplayString(a.appName)+" ("+e.toDisplayString(a.appVersion)+")",1),e.createElementVNode("div",null,e.toDisplayString(a.copyright),1)])]),e.createElementVNode("div",Av,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.socialLinks,m=>(e.openBlock(),e.createElementBlock("a",{key:m.name,href:m.url,class:e.normalizeClass(["w-8 h-7 flex items-center justify-center rounded text-xs transition-colors",m.variant==="primary"?"bg-blue-600 hover:bg-blue-700 text-white":m.variant==="info"?"bg-cyan-500 hover:bg-cyan-600 text-white":"bg-gray-600 hover:bg-gray-700 text-white"])},[e.createVNode(d,{icon:["fab",m.icon]},null,8,["icon"])],10,Fv))),128))])],4)}const Ko=pt(sv,[["render",Pv]]),Lv={class:"min-h-screen bg-gray-50"},Mv={class:"flex-1"},jv={key:0,class:"bg-white border-b border-gray-200"},Iv={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4"},Ov={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},Xo={__name:"DefaultLayout",props:{navigationItems:{type:Array,default:()=>[{label:"Home",href:"/",active:!0},{label:"About",href:"/about"},{label:"Services",href:"/services"},{label:"Contact",href:"/contact"}]},breadcrumbItems:{type:Array,default:()=>[]},showBreadcrumb:{type:Boolean,default:!1}},setup(t){return(n,a)=>{const o=e.resolveComponent("Logo"),r=e.resolveComponent("MainNavigation"),l=e.resolveComponent("Button"),s=e.resolveComponent("Header"),d=e.resolveComponent("Breadcrumb"),m=e.resolveComponent("Text"),p=e.resolveComponent("Footer");return e.openBlock(),e.createElementBlock("div",Lv,[e.createVNode(s,null,{logo:e.withCtx(()=>[e.renderSlot(n.$slots,"logo",{},()=>[e.createVNode(o)])]),navigation:e.withCtx(()=>[e.renderSlot(n.$slots,"navigation",{},()=>[e.createVNode(r,{items:t.navigationItems},null,8,["items"])])]),actions:e.withCtx(()=>[e.renderSlot(n.$slots,"header-actions",{},()=>[e.createVNode(l,{variant:"ghost",size:"sm"},{default:e.withCtx(()=>[...a[0]||(a[0]=[e.createTextVNode(" Sign In ",-1)])]),_:1}),e.createVNode(l,{size:"sm"},{default:e.withCtx(()=>[...a[1]||(a[1]=[e.createTextVNode(" Get Started ",-1)])]),_:1})])]),_:3}),e.createElementVNode("main",Mv,[t.showBreadcrumb?(e.openBlock(),e.createElementBlock("div",jv,[e.createElementVNode("div",Iv,[e.renderSlot(n.$slots,"breadcrumb",{},()=>[e.createVNode(d,{items:t.breadcrumbItems},null,8,["items"])])])])):e.createCommentVNode("",!0),e.createElementVNode("div",Ov,[e.renderSlot(n.$slots,"default")])]),e.createVNode(p,null,{brand:e.withCtx(()=>[e.renderSlot(n.$slots,"footer-brand",{},()=>[e.createVNode(o,{class:"mb-4"}),e.createVNode(m,{class:"text-gray-600 max-w-md"},{default:e.withCtx(()=>[...a[2]||(a[2]=[e.createTextVNode(" Your application description goes here. ",-1)])]),_:1})])]),_:3})])}}},Rv={name:"ErrorLayout",props:{errorType:{type:[String,Number],default:"404"},errorCode:{type:[String,Number],default:null},errorTitle:{type:String,default:null},errorMessage:{type:String,default:null},brandName:{type:String,default:"Software Technologies"},showLogo:{type:Boolean,default:!0},showBackground:{type:Boolean,default:!0},showDefaultIllustration:{type:Boolean,default:!0},showDefaultActions:{type:Boolean,default:!0},showHomeButton:{type:Boolean,default:!0},showBackButton:{type:Boolean,default:!0},showRetryButton:{type:Boolean,default:!1},showSupportButton:{type:Boolean,default:!1},showAdditionalInfo:{type:Boolean,default:!1},homeUrl:{type:String,default:"/"},homeButtonText:{type:String,default:"Go Home"},backButtonText:{type:String,default:"Go Back"},retryButtonText:{type:String,default:"Try Again"},helpText:{type:String,default:null},supportUrl:{type:String,default:null}},emits:["retry","back","contact-support"],setup(t,{emit:n}){const a=e.getCurrentInstance(),o=e.inject("$router",null)||a?.appContext.app.config.globalProperties?.$router,r=e.ref(!1),l=e.ref(!1),s=e.ref(navigator.onLine),d=e.ref(`err_${Date.now()}_${Math.random().toString(36).substr(2,9)}`),m=e.ref(!1),p=()=>{s.value=navigator.onLine};e.onMounted(()=>{window.addEventListener("online",p),window.addEventListener("offline",p)}),e.onUnmounted(()=>{window.removeEventListener("online",p),window.removeEventListener("offline",p)});const v=e.computed(()=>{const U={404:{title:"Page Not Found",message:"Sorry, we couldn't find the page you're looking for.",icon:"🔍",color:"#64748b",homeButtonIcon:"🏠",additionalInfo:{title:"What can you do?",items:[{icon:"✓",iconColor:"green-500",text:"Check the URL for typos"},{icon:"✓",iconColor:"green-500",text:"Go back to the previous page"},{icon:"✓",iconColor:"green-500",text:"Visit our homepage"}]}},403:{title:"Unauthorized Access",message:"You are not authorized to view this page.",icon:"🚫",color:"#ef4444",homeButtonIcon:"🔐",additionalInfo:{title:"Why am I seeing this?",items:[{icon:"⚠️",iconColor:"yellow-500",text:"You may need to log in to access this page"},{icon:"⚠️",iconColor:"yellow-500",text:"Your account might not have the required permissions"},{icon:"⚠️",iconColor:"yellow-500",text:"Contact support if you believe this is an error"}]}},401:{title:"Authentication Required",message:"You need to log in to access this resource.",icon:"🔐",color:"#f59e0b",homeButtonIcon:"🔐",additionalInfo:{title:"How to proceed?",items:[{icon:"✓",iconColor:"blue-500",text:"Log in with your credentials"},{icon:"✓",iconColor:"blue-500",text:"Create an account if you don't have one"},{icon:"✓",iconColor:"blue-500",text:"Reset your password if you forgot it"}]}},500:{title:"Internal Server Error",message:"Something went wrong on our end. Please try again later.",icon:"🔧",color:"#ef4444",homeButtonIcon:"🏠",additionalInfo:{title:"What happened?",items:[{icon:"⚠️",iconColor:"red-500",text:"Our servers are experiencing issues"},{icon:"⚠️",iconColor:"red-500",text:"The problem is temporary"},{icon:"⚠️",iconColor:"red-500",text:"Try refreshing the page or come back later"}]}},503:{title:"Service Unavailable",message:"The service is temporarily unavailable. Please try again later.",icon:"🔧",color:"#f59e0b",homeButtonIcon:"🏠",additionalInfo:{title:"Service Status",items:[{icon:"⚠️",iconColor:"amber-500",text:"We're performing scheduled maintenance"},{icon:"⚠️",iconColor:"amber-500",text:"Normal service will resume shortly"},{icon:"⚠️",iconColor:"amber-500",text:"Check our status page for updates"}]}},network:{title:"Network Error",message:"Unable to connect to the server. Please check your internet connection.",icon:"📶",color:"#ef4444",homeButtonIcon:"🏠",additionalInfo:{title:"Connection Issues",items:[{icon:"⚠️",iconColor:"red-500",text:"Check your internet connection"},{icon:"⚠️",iconColor:"red-500",text:"Try refreshing the page"},{icon:"⚠️",iconColor:"red-500",text:"Contact your network administrator"}]}}};return U[t.errorType]||U[404]}),y=e.computed(()=>v.value),S=e.computed(()=>t.errorTitle||y.value.title),x=e.computed(()=>t.errorMessage||y.value.message),k=e.computed(()=>y.value.homeButtonIcon||"🏠"),f=e.computed(()=>t.showAdditionalInfo?y.value.additionalInfo:null),u=()=>{o?o.push(t.homeUrl):window.location.href=t.homeUrl},i=()=>{o&&window.history.length>1?o.back():window.history.length>1?window.history.back():u(),n("back")},c=async()=>{r.value=!0;try{await new Promise(U=>setTimeout(U,1e3)),window.location.reload()}catch(U){console.error("Retry failed:",U)}finally{r.value=!1}n("retry")},g=e.computed(()=>["min-h-screen relative flex items-center justify-center","px-4 sm:px-6 lg:px-8"]),b=e.computed(()=>["absolute inset-0 -z-10"]),h=e.computed(()=>["w-full max-w-2xl mx-auto text-center"]),N=e.computed(()=>["mb-8"]),P=e.computed(()=>["space-y-8"]),H=e.computed(()=>["flex justify-center mb-6"]),_=e.computed(()=>["w-32 h-32 flex items-center justify-center"]),E=e.computed(()=>["space-y-4"]),I=e.computed(()=>["text-6xl font-bold text-slate-300 mb-4"]),j=e.computed(()=>["text-3xl font-bold text-slate-900"]),C=e.computed(()=>["text-lg text-slate-600 max-w-lg mx-auto"]),$=e.computed(()=>["mt-8"]),L=e.computed(()=>["mt-8"]),Y=e.computed(()=>["mt-6"]);return{isRetrying:r,reportSent:l,isOnline:s,errorId:d,isDev:m,errorConfig:y,title:S,message:x,homeButtonIcon:k,additionalInfoConfig:f,goHome:u,goBack:i,retry:c,layoutClasses:g,backgroundClasses:b,contentClasses:h,headerClasses:N,errorContentClasses:P,illustrationClasses:H,iconContainerClasses:_,detailsClasses:E,codeClasses:I,titleClasses:j,messageClasses:C,actionsClasses:$,additionalInfoClasses:L,helpClasses:Y}}},_v={class:"flex justify-center"},Uv={class:"flex items-center gap-3"},qv={class:"text-2xl font-bold text-slate-900"},Hv={key:1,class:"bg-red-100 border border-red-200 rounded-lg p-4 mx-auto max-w-md mb-6"},Yv={class:"flex flex-col sm:flex-row gap-4 justify-center"},Wv=["disabled"],Gv={key:0,class:"animate-spin"},Kv={key:1},Xv=["disabled"],Qv={key:0},Jv={key:1},Zv={key:0,class:"mt-8 max-w-md mx-auto"},e0={class:"bg-white rounded-lg border border-slate-200 shadow-sm p-6"},t0={class:"text-lg font-semibold text-slate-900 mb-4"},a0={class:"space-y-3"},n0={class:"text-sm text-slate-600"},o0=["href"],r0={key:5,class:"text-xs text-slate-400 font-mono mt-4"};function l0(t,n,a,o,r,l){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(o.layoutClasses)},[a.showBackground?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.backgroundClasses)},[e.renderSlot(t.$slots,"background",{},()=>[n[4]||(n[4]=e.createElementVNode("div",{class:"absolute inset-0 bg-gradient-to-br from-slate-50 to-slate-100"},null,-1))])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.contentClasses)},[t.$slots.header||a.showLogo?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.headerClasses)},[e.renderSlot(t.$slots,"header",{},()=>[e.createElementVNode("div",_v,[e.renderSlot(t.$slots,"logo",{},()=>[e.createElementVNode("div",Uv,[n[5]||(n[5]=e.createElementVNode("div",{class:"w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center"},[e.createElementVNode("span",{class:"text-white font-bold text-lg"},"STL")],-1)),e.createElementVNode("span",qv,e.toDisplayString(a.brandName),1)])])])])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.errorContentClasses)},[t.$slots.illustration||a.showDefaultIllustration?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.illustrationClasses)},[e.renderSlot(t.$slots,"illustration",{},()=>[e.createElementVNode("div",{class:e.normalizeClass(o.iconContainerClasses)},[e.createElementVNode("div",{class:"text-8xl",style:e.normalizeStyle({color:o.errorConfig.color})},e.toDisplayString(o.errorConfig.icon),5)],2)])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(o.detailsClasses)},[a.errorCode?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(o.codeClasses)},e.toDisplayString(a.errorCode),3)):e.createCommentVNode("",!0),e.createElementVNode("h1",{class:e.normalizeClass(o.titleClasses)},[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(o.title),1)])],2),e.createElementVNode("p",{class:e.normalizeClass(o.messageClasses)},[e.renderSlot(t.$slots,"message",{},()=>[e.createTextVNode(e.toDisplayString(o.message),1)])],2)],2),o.isOnline?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Hv,[...n[6]||(n[6]=[e.createElementVNode("div",{class:"flex items-center justify-center gap-2 text-red-700"},[e.createElementVNode("span",{class:"w-3 h-3 bg-red-500 rounded-full animate-pulse"}),e.createElementVNode("span",{class:"font-medium"},"No Internet Connection")],-1)])])),t.$slots.actions||a.showDefaultActions?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(o.actionsClasses)},[e.renderSlot(t.$slots,"actions",{},()=>[e.createElementVNode("div",Yv,[a.showHomeButton?(e.openBlock(),e.createElementBlock("button",{key:0,class:"bg-blue-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-blue-700 transition-colors flex items-center justify-center gap-2",onClick:n[0]||(n[0]=(...s)=>o.goHome&&o.goHome(...s))},[e.createElementVNode("span",null,e.toDisplayString(o.homeButtonIcon),1),e.createTextVNode(" "+e.toDisplayString(a.homeButtonText),1)])):e.createCommentVNode("",!0),a.showBackButton?(e.openBlock(),e.createElementBlock("button",{key:1,class:"border border-slate-300 text-slate-700 px-6 py-3 rounded-lg font-medium hover:bg-slate-50 transition-colors flex items-center justify-center gap-2",onClick:n[1]||(n[1]=(...s)=>o.goBack&&o.goBack(...s))},[n[7]||(n[7]=e.createElementVNode("span",null,"←",-1)),e.createTextVNode(" "+e.toDisplayString(a.backButtonText),1)])):e.createCommentVNode("",!0),a.showRetryButton?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:o.isRetrying||!o.isOnline,class:"border border-slate-300 text-slate-700 px-6 py-3 rounded-lg font-medium hover:bg-slate-50 transition-colors flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",onClick:n[2]||(n[2]=(...s)=>o.retry&&o.retry(...s))},[o.isRetrying?(e.openBlock(),e.createElementBlock("span",Gv,"↻")):(e.openBlock(),e.createElementBlock("span",Kv,"🔄")),e.createTextVNode(" "+e.toDisplayString(o.isRetrying?"Retrying...":a.retryButtonText),1)],8,Wv)):e.createCommentVNode("",!0),a.showSupportButton?(e.openBlock(),e.createElementBlock("button",{key:3,disabled:o.reportSent,class:"bg-slate-600 text-white px-6 py-3 rounded-lg font-medium hover:bg-slate-700 transition-colors flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",onClick:n[3]||(n[3]=s=>t.$emit("contact-support"))},[o.reportSent?(e.openBlock(),e.createElementBlock("span",Qv,"✓")):(e.openBlock(),e.createElementBlock("span",Jv,"📝")),e.createTextVNode(" "+e.toDisplayString(o.reportSent?"Report Sent":"Contact Support"),1)],8,Xv)):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),t.$slots["additional-info"]||a.showAdditionalInfo?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(o.additionalInfoClasses)},[e.renderSlot(t.$slots,"additional-info",{},()=>[o.additionalInfoConfig?(e.openBlock(),e.createElementBlock("div",Zv,[e.createElementVNode("div",e0,[e.createElementVNode("h3",t0,e.toDisplayString(o.additionalInfoConfig.title),1),e.createElementVNode("ul",a0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.additionalInfoConfig.items,(s,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,class:"flex items-start gap-3 text-sm text-slate-600"},[e.createElementVNode("span",{class:e.normalizeClass(`w-4 h-4 text-${s.iconColor||"slate-400"} flex-shrink-0 mt-0.5`)},e.toDisplayString(s.icon),3),e.createElementVNode("span",null,e.toDisplayString(s.text),1)]))),128))])])])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0),t.$slots.help||a.helpText?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(o.helpClasses)},[e.renderSlot(t.$slots,"help",{},()=>[e.createElementVNode("p",n0,[e.createTextVNode(e.toDisplayString(a.helpText)+" ",1),a.supportUrl?(e.openBlock(),e.createElementBlock("a",{key:0,href:a.supportUrl,class:"text-blue-600 hover:text-blue-700 underline ml-1"},[...n[8]||(n[8]=[e.createElementVNode("span",{class:"inline-block w-4 h-4 mr-1"},"❓",-1),e.createTextVNode(" Get Help ",-1)])],8,o0)):e.createCommentVNode("",!0)])])],2)):e.createCommentVNode("",!0),o.isDev?(e.openBlock(),e.createElementBlock("div",r0," Error ID: "+e.toDisplayString(o.errorId),1)):e.createCommentVNode("",!0)],2)],2)],2)}const Qo=pt(Rv,[["render",l0]]),Ut={mounted(t,n){if(!n.value)return;const a=Object.keys(n.modifiers)[0]||"top",o=document.createElement("div");o.textContent=n.value,o.className="tooltip-custom",o.style.cssText=`
608
608
  position: fixed;
609
609
  z-index: 9999;
610
610
  background-color: rgba(0, 0, 0, 0.9);